[Libreoffice-commits] core.git: svx/source

Noel Grandin noel at peralex.com
Mon Jun 24 02:05:34 PDT 2013


 svx/source/form/fmtools.cxx |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 44b2fb6164aeffcc0c5bfbf53dac12f7b53fb0d4
Author: Noel Grandin <noel at peralex.com>
Date:   Mon Jun 24 11:04:14 2013 +0200

    fix exception in DbGridColumn::impl_toggleScriptManager_nothrow
    
    The messages would look like this:
      warn:legacy.osl:28639:1:svx/source/fmcomp/gridcell.cxx:255: caught an exception!
    
    I introduced this bug in commit 6a043e9c0acff20e1618ca8ec15c21d5d0fd0d37
    "Use the new type-checking Reference constructor to reduce code noise"
    
    Change-Id: I922d46f7c7eefbc12892a2525b30dcb798619a8b

diff --git a/svx/source/form/fmtools.cxx b/svx/source/form/fmtools.cxx
index da7f05f..716d550 100644
--- a/svx/source/form/fmtools.cxx
+++ b/svx/source/form/fmtools.cxx
@@ -177,8 +177,9 @@ sal_Int32 getElementPos(const Reference< ::com::sun::star::container::XIndexAcce
         return nIndex;
 
 
+    Reference< XInterface > xNormalized( xElement, UNO_QUERY );
     DBG_ASSERT( xElement.is(), "getElementPos: invalid element!" );
-    if ( xElement.is() )
+    if ( xNormalized.is() )
     {
         // Feststellen an welcher Position sich das Kind befindet
         nIndex = xCont->getCount();
@@ -189,7 +190,7 @@ sal_Int32 getElementPos(const Reference< ::com::sun::star::container::XIndexAcce
                 Reference< XInterface > xCurrent(xCont->getByIndex( nIndex ),UNO_QUERY);
                 DBG_ASSERT( xCurrent.get() == Reference< XInterface >( xCurrent, UNO_QUERY ).get(),
                     "getElementPos: container element not normalized!" );
-                if ( xElement.get() == xCurrent.get() )
+                if ( xNormalized.get() == xCurrent.get() )
                     break;
             }
             catch(Exception&)


More information about the Libreoffice-commits mailing list