Skip to content

Commit

Permalink
Bug 826479 Assertion failure: mInitialized when using Ctrl+Middle-cli…
Browse files Browse the repository at this point in the history
…ck paste r=ehsan
  • Loading branch information
Neil Rashbrook committed Jan 4, 2013
1 parent 6b9c40d commit 5c21175
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions editor/libeditor/text/nsPlaintextEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1329,13 +1329,11 @@ nsPlaintextEditor::PasteAsQuotation(int32_t aSelectionType)
nsCOMPtr<nsIClipboard> clipboard(do_GetService("@mozilla.org/widget/clipboard;1", &rv));
NS_ENSURE_SUCCESS(rv, rv);

// Create generic Transferable for getting the data
nsCOMPtr<nsITransferable> trans = do_CreateInstance("@mozilla.org/widget/transferable;1", &rv);
// Get the nsITransferable interface for getting the data from the clipboard
nsCOMPtr<nsITransferable> trans;
rv = PrepareTransferable(getter_AddRefs(trans));
if (NS_SUCCEEDED(rv) && trans)
{
// We only handle plaintext pastes here
trans->AddDataFlavor(kUnicodeMime);

// Get the Data from the clipboard
clipboard->GetData(trans, aSelectionType);

Expand All @@ -1357,7 +1355,8 @@ nsPlaintextEditor::PasteAsQuotation(int32_t aSelectionType)
#ifdef DEBUG_clipboard
printf("Got flavor [%s]\n", flav);
#endif
if (0 == nsCRT::strcmp(flav, kUnicodeMime))
if (0 == nsCRT::strcmp(flav, kUnicodeMime) ||
0 == nsCRT::strcmp(flav, kMozTextInternal))
{
nsCOMPtr<nsISupportsString> textDataObj ( do_QueryInterface(genericDataObj) );
if (textDataObj && len > 0)
Expand Down

0 comments on commit 5c21175

Please sign in to comment.