[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-4.1' - 3 commits - dbaccess/source include/sfx2 sc/source sfx2/source

Caolán McNamara caolanm at redhat.com
Wed Dec 4 07:39:42 PST 2013


 dbaccess/source/core/api/RowSet.cxx |    2 +
 include/sfx2/dispatch.hxx           |   33 +++++++++++++++-
 sc/source/filter/excel/xestyle.cxx  |   12 +++---
 sfx2/source/control/dispatch.cxx    |   72 ++++++++++++++++++------------------
 4 files changed, 76 insertions(+), 43 deletions(-)

New commits:
commit c064375f611e405434ebfc37034d916ac5bdb60a
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Nov 20 16:17:54 2013 +0000

    Resolves: fdo#70703 guard against FlushImpl inside FlushImpl
    
    where the inner one deletes Shells that the outer one is still
    processing. Push the candidates onto a stack and let inner
    FlushImpl modify them to inform outer FlushImpl's that an entry
    has been deleted
    
    Change-Id: I1db8546d53e24cc96c72f2cd5cbec57b6cecaff5
    Reviewed-on: https://gerrit.libreoffice.org/6735
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    Tested-by: Michael Stahl <mstahl at redhat.com>

diff --git a/include/sfx2/dispatch.hxx b/include/sfx2/dispatch.hxx
index 2b02a5e..4cf5fb1 100644
--- a/include/sfx2/dispatch.hxx
+++ b/include/sfx2/dispatch.hxx
@@ -27,6 +27,7 @@
 
 #include <sfx2/bindings.hxx>
 #include <sfx2/viewfrm.hxx>
+#include <deque>
 #include <map>
 #include <vector>
 
@@ -76,10 +77,38 @@ public:
     }
 };
 
+struct SfxToDo_Impl
+{
+    SfxShell*  pCluster;
+    bool       bPush;
+    bool       bDelete;
+    bool       bDeleted;
+    bool       bUntil;
+
+    SfxToDo_Impl()
+        : pCluster(0)
+        , bPush(false)
+        , bDelete(false)
+        , bDeleted(false)
+        , bUntil(false)
+                {}
+    SfxToDo_Impl( bool bOpPush, bool bOpDelete, bool bOpUntil, SfxShell& rCluster )
+        : pCluster(&rCluster)
+        , bPush(bOpPush)
+        , bDelete(bOpDelete)
+        , bDeleted(false)
+        , bUntil(bOpUntil)
+                {}
+
+    bool operator==( const SfxToDo_Impl& rWith ) const
+    { return pCluster==rWith.pCluster && bPush==rWith.bPush; }
+};
+
 class SFX2_DLLPUBLIC SfxDispatcher
 {
-    SfxDispatcher_Impl*             pImp;
-    sal_Bool                            bFlushed;
+    SfxDispatcher_Impl*      pImp;
+    sal_Bool                 bFlushed;
+    std::deque< std::deque<SfxToDo_Impl> > aToDoCopyStack;
 
 private:
     // Search for temporary evaluated Todos
diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx
index 9acf705..3e10fff 100644
--- a/sfx2/source/control/dispatch.cxx
+++ b/sfx2/source/control/dispatch.cxx
@@ -67,31 +67,6 @@ DBG_NAME(SfxDispatcherFillState)
 
 typedef std::vector<SfxRequest*> SfxRequestPtrArray;
 
-struct SfxToDo_Impl
-{
-    SfxShell*  pCluster;
-    bool       bPush;
-    bool       bDelete;
-    bool       bUntil;
-
-    SfxToDo_Impl()
-        : pCluster(0)
-        , bPush(false)
-        , bDelete(false)
-        , bUntil(false)
-                {}
-    SfxToDo_Impl( bool bOpPush, bool bOpDelete, bool bOpUntil, SfxShell& rCluster )
-        : pCluster(&rCluster)
-        , bPush(bOpPush)
-        , bDelete(bOpDelete)
-        , bUntil(bOpUntil)
-                {}
-    ~SfxToDo_Impl(){}
-
-    bool operator==( const SfxToDo_Impl& rWith ) const
-    { return pCluster==rWith.pCluster && bPush==rWith.bPush; }
-};
-
 struct SfxObjectBars_Impl
 {
     sal_uInt32     nResId;  // Resource - and ConfigId of the Toolbox
@@ -1625,22 +1600,49 @@ void SfxDispatcher::FlushImpl()
     bFlushed = sal_True;
     OSL_TRACE("Successfully flushed dispatcher!");
 
+    //fdo#70703 FlushImpl may call back into itself so use aToDoCopyStack to talk
+    //to outer levels of ourself. If DoActivate_Impl/DoDeactivate_Impl deletes
+    //an entry, then they will walk back up aToDoCopyStack and set outer
+    //levels's entries to bDeleted
+    aToDoCopyStack.push_back(aToDoCopy);
+    std::deque<SfxToDo_Impl>& rToDoCopy = aToDoCopyStack.back();
     // Activate the Shells and possible delete them in the 2nd round
-    for(std::deque<SfxToDo_Impl>::reverse_iterator i = aToDoCopy.rbegin(); i != aToDoCopy.rend(); ++i)
-    {
-        if(i->bPush)
-        {
-            if ( pImp->bActive )
-                i->pCluster->DoActivate_Impl(pImp->pFrame, sal_True);
-        }
-        else if ( pImp->bActive )
-                i->pCluster->DoDeactivate_Impl(pImp->pFrame, sal_True);
+    for(std::deque<SfxToDo_Impl>::reverse_iterator i = rToDoCopy.rbegin(); i != rToDoCopy.rend(); ++i)
+    {
+        if (i->bDeleted)
+            continue;
+        if (!pImp->bActive)
+            continue;
+        if (i->bPush)
+            i->pCluster->DoActivate_Impl(pImp->pFrame, sal_True);
+        else
+            i->pCluster->DoDeactivate_Impl(pImp->pFrame, sal_True);
     }
 
+    aToDoCopy = aToDoCopyStack.back();
+    aToDoCopyStack.pop_back();
+
     for(std::deque<SfxToDo_Impl>::reverse_iterator i = aToDoCopy.rbegin(); i != aToDoCopy.rend(); ++i)
     {
-        if(i->bDelete)
+        if (i->bDelete && !i->bDeleted)
+        {
+            if (!aToDoCopyStack.empty())
+            {
+                //fdo#70703 if there is an outer FlushImpl then inform it that
+                //we have deleted this cluster
+                for (std::deque< std::deque<SfxToDo_Impl> >::iterator aI = aToDoCopyStack.begin();
+                    aI != aToDoCopyStack.end(); ++aI)
+                {
+                    std::deque<SfxToDo_Impl> &v = *aI;
+                    for(std::deque<SfxToDo_Impl>::iterator aJ = v.begin(); aJ != v.end(); ++aJ)
+                    {
+                        if (aJ->pCluster == i->pCluster)
+                            aJ->bDeleted = true;
+                    }
+                }
+            }
             delete i->pCluster;
+        }
     }
     sal_Bool bAwakeBindings = !aToDoCopy.empty();
     if( bAwakeBindings )
commit bd3e9519d6091c3294f846a927547c4c71cb4f1e
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sat Nov 30 06:50:50 2013 +0100

    write valid dxf record, related fdo#71971
    
    Change-Id: I99f4dfca78cc0fd5d9b947000a99f8414c2a899b
    (cherry picked from commit 7415fc31f5cdf7ff3f78dd304b9576b931a82aeb)
    Reviewed-on: https://gerrit.libreoffice.org/6878
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>

diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx
index 3186cda..486481a 100644
--- a/sc/source/filter/excel/xestyle.cxx
+++ b/sc/source/filter/excel/xestyle.cxx
@@ -3021,18 +3021,18 @@ void XclExpDxf::SaveXml( XclExpXmlStream& rStrm )
     sax_fastparser::FSHelperPtr& rStyleSheet = rStrm.GetCurrentStream();
     rStyleSheet->startElement( XML_dxf, FSEND );
 
-    if (mpAlign)
-        mpAlign->SaveXml(rStrm);
-    if (mpBorder)
-        mpBorder->SaveXml(rStrm);
     if (mpFont)
         mpFont->SaveXml(rStrm);
     if (mpNumberFmt)
         mpNumberFmt->SaveXml(rStrm);
-    if (mpProt)
-        mpProt->SaveXml(rStrm);
     if (mpColor)
         mpColor->SaveXml(rStrm);
+    if (mpAlign)
+        mpAlign->SaveXml(rStrm);
+    if (mpBorder)
+        mpBorder->SaveXml(rStrm);
+    if (mpProt)
+        mpProt->SaveXml(rStrm);
     rStyleSheet->endElement( XML_dxf );
 }
 
commit 53b36db0546f702fe4c3d3832dc1a1fbea1cc82b
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date:   Mon Dec 2 23:44:11 2013 +0100

    fdo#72163 after updating m_xComposer, command facets are not dirty anymore
    
    Else we dispose m_xComposer too eagerly; still used by m_pCacheSet.
    
    Change-Id: I205488465c19a356534df17b8a5e9a20ce6766c9
    Reviewed-on: https://gerrit.libreoffice.org/6906
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx
index a58a68a..6002747 100644
--- a/dbaccess/source/core/api/RowSet.cxx
+++ b/dbaccess/source/core/api/RowSet.cxx
@@ -2295,6 +2295,8 @@ sal_Bool ORowSet::impl_initComposer_throw( OUString& _out_rCommandToExecute )
 
     _out_rCommandToExecute = m_xComposer->getQueryWithSubstitution();
 
+    m_bCommandFacetsDirty = sal_False;
+
     return bUseEscapeProcessing;
 }
 


More information about the Libreoffice-commits mailing list