[Libreoffice-commits] .: sc/source

Petr Mladek pmladek at kemper.freedesktop.org
Wed Mar 30 02:56:23 PDT 2011


 sc/source/ui/unoobj/cellsuno.cxx |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 5fc793d0be167eb8b9fdbeee7dfe08bfa26bdd7f
Author: Petr Mladek <pmladek at suse.cz>
Date:   Wed Mar 30 11:43:04 2011 +0200

    sc-cellsuno-avoid-early-destruction.diff: avoid a crash (i#90076)

diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index 55369e7..8e7475d 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -1485,9 +1485,12 @@ void ScCellRangesBase::Notify( SfxBroadcaster&, const SfxHint& rHint )
         if ( aRanges.UpdateReference( rRef.GetMode(), pDoc, rRef.GetRange(),
                                     rRef.GetDx(), rRef.GetDy(), rRef.GetDz() ) )
         {
+            // i#90076; the object "this" was destroyed after calling ScTableSheetObj::getImplementation
+            // this hack make sure that the object lives a bit longer
+            uno::Reference<uno::XInterface> xInterface((cppu::OWeakObject*)this, uno::UNO_QUERY);
             if (  rRef.GetMode() == URM_INSDEL
                && aRanges.size() == 1
-               && ScTableSheetObj::getImplementation( (cppu::OWeakObject*)this )
+               && ScTableSheetObj::getImplementation( xInterface )
                )
             {
                 // #101755#; the range size of a sheet does not change


More information about the Libreoffice-commits mailing list