From 57d73796837fd6e3407d1dc55f173b0d38418ba9 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Wed, 12 Jun 2013 09:00:08 +0200 Subject: [PATCH] Bug 880999 - Use do_QueryObject for nsIAbsorbingTransaction; r=ehsan --- editor/libeditor/base/PlaceholderTxn.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/editor/libeditor/base/PlaceholderTxn.cpp b/editor/libeditor/base/PlaceholderTxn.cpp index 5ee5da0802e..30febc599db 100644 --- a/editor/libeditor/base/PlaceholderTxn.cpp +++ b/editor/libeditor/base/PlaceholderTxn.cpp @@ -114,10 +114,7 @@ NS_IMETHODIMP PlaceholderTxn::Merge(nsITransaction *aTransaction, bool *aDidMerg EditTxn *editTxn = (EditTxn*)aTransaction; //XXX: hack, not safe! need nsIEditTransaction! // determine if this incoming txn is a placeholder txn - nsCOMPtr plcTxn;// = do_QueryInterface(editTxn); - // can't do_QueryInterface() above due to our broken transaction interfaces. - // instead have to brute it below. ugh. - editTxn->QueryInterface(NS_GET_IID(nsIAbsorbingTransaction), getter_AddRefs(plcTxn)); + nsCOMPtr plcTxn = do_QueryObject(editTxn); // we are absorbing all txn's if mAbsorb is lit. if (mAbsorb) @@ -164,12 +161,8 @@ NS_IMETHODIMP PlaceholderTxn::Merge(nsITransaction *aTransaction, bool *aDidMerg (mName.get() == nsGkAtoms::DeleteTxnName)) && !mCommitted ) { - nsCOMPtr plcTxn;// = do_QueryInterface(editTxn); - // can't do_QueryInterface() above due to our broken transaction interfaces. - // instead have to brute it below. ugh. - editTxn->QueryInterface(NS_GET_IID(nsIAbsorbingTransaction), getter_AddRefs(plcTxn)); - if (plcTxn) - { + nsCOMPtr plcTxn = do_QueryObject(editTxn); + if (plcTxn) { nsCOMPtr atom; plcTxn->GetTxnName(getter_AddRefs(atom)); if (atom && (atom == mName))