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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Aug 15 16:12:05 UTC 2018


 sw/source/core/unocore/unochart.cxx |   48 ++++++++++++------------------------
 1 file changed, 17 insertions(+), 31 deletions(-)

New commits:
commit 11c782a3bc70a6820334515002e9c5b849aa5025
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Aug 15 14:31:39 2018 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Aug 15 18:11:40 2018 +0200

    outer loop unrelated to inner loop
    
    since original checkin of...
    
    commit 9cddf9da7fb256418e1bc3b4719abb55e3b0604c
    Date:   Tue May 22 15:33:44 2007 +0000
    
        INTEGRATION: CWS chart2mst3 (1.1.2); FILE ADDED
    ...
        2006/12/13 12:31:03 tl 1.1.2.38: #i71244# update charts in writer
    
    where I think this LockUnlockAllCharts chart2 loop was modelled on
    the previous chart[1] styles loop of e.g. DoUpdateAllCharts which
    loop over tables.
    
    chart2 objects are unrelated to these tables, so remove the outer
    loop, which then means the ofz#9689 ofz#9856 ofz9874 crashes that
    made me look at it will get fixed
    
    Change-Id: I7d7ba0a2aa257b5aa399f20d902f01306fbaecff
    Reviewed-on: https://gerrit.libreoffice.org/59110
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/core/unocore/unochart.cxx b/sw/source/core/unocore/unochart.cxx
index 8dcc9b13a670..89d331952654 100644
--- a/sw/source/core/unocore/unochart.cxx
+++ b/sw/source/core/unocore/unochart.cxx
@@ -117,44 +117,30 @@ void SwChartLockController_Helper::LockUnlockAllCharts( bool bLock )
     if (!pDoc)
         return;
 
-    const SwFrameFormats& rTableFormats = *pDoc->GetTableFrameFormats();
-    for( size_t n = 0; n < rTableFormats.size(); ++n )
+    uno::Reference< frame::XModel > xRes;
+    SwOLENode *pONd;
+    SwStartNode *pStNd;
+    SwNodeIndex aIdx( *pDoc->GetNodes().GetEndOfAutotext().StartOfSectionNode(), 1 );
+    while( nullptr != (pStNd = aIdx.GetNode().GetStartNode()) )
     {
-        const SwFrameFormat* pFormat = rTableFormats[ n ];
-        SwTable* pTmpTable = SwTable::FindTable(pFormat);
-        if (!pTmpTable)
-            continue;
-        const SwTableNode* pTableNd = pTmpTable->GetTableNode();
-        if (!pTableNd)
-            continue;
-        if (!pTableNd->GetNodes().IsDocNodes())
-            continue;
-
-        uno::Reference< frame::XModel > xRes;
-        SwOLENode *pONd;
-        SwStartNode *pStNd;
-        SwNodeIndex aIdx( *pDoc->GetNodes().GetEndOfAutotext().StartOfSectionNode(), 1 );
-        while( nullptr != (pStNd = aIdx.GetNode().GetStartNode()) )
+        ++aIdx;
+        if (nullptr != ( pONd = aIdx.GetNode().GetOLENode() ) &&
+            !pONd->GetChartTableName().isEmpty() /* is chart object? */)
         {
-            ++aIdx;
-            if (nullptr != ( pONd = aIdx.GetNode().GetOLENode() ) &&
-                !pONd->GetChartTableName().isEmpty() /* is chart object? */)
+            uno::Reference < embed::XEmbeddedObject > xIP = pONd->GetOLEObj().GetOleRef();
+            if ( svt::EmbeddedObjectRef::TryRunningState( xIP ) )
             {
-                uno::Reference < embed::XEmbeddedObject > xIP = pONd->GetOLEObj().GetOleRef();
-                if ( svt::EmbeddedObjectRef::TryRunningState( xIP ) )
+                xRes.set( xIP->getComponent(), uno::UNO_QUERY );
+                if (xRes.is())
                 {
-                    xRes.set( xIP->getComponent(), uno::UNO_QUERY );
-                    if (xRes.is())
-                    {
-                        if (bLock)
-                            xRes->lockControllers();
-                        else
-                            xRes->unlockControllers();
-                    }
+                    if (bLock)
+                        xRes->lockControllers();
+                    else
+                        xRes->unlockControllers();
                 }
             }
-            aIdx.Assign( *pStNd->EndOfSectionNode(), + 1 );
         }
+        aIdx.Assign( *pStNd->EndOfSectionNode(), + 1 );
     }
 
     bIsLocked = bLock;


More information about the Libreoffice-commits mailing list