[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - sw/source

Tomáš Chvátal (via logerrit) logerrit at kemper.freedesktop.org
Tue Aug 27 09:06:50 UTC 2019


 sw/source/core/inc/frame.hxx       |    4 ++++
 sw/source/core/layout/calcmove.cxx |    9 +++++++--
 sw/source/core/layout/flowfrm.cxx  |    6 +++++-
 3 files changed, 16 insertions(+), 3 deletions(-)

New commits:
commit 3780d305ae1607458029af3c9452bad251490461
Author:     Tomáš Chvátal <tchvatal at suse.com>
AuthorDate: Fri Aug 23 09:44:01 2019 +0200
Commit:     Michael Stahl <Michael.Stahl at cib.de>
CommitDate: Tue Aug 27 11:05:47 2019 +0200

    Fix old boost build for good
    
    With the previous approach the code could lead to crashes in
    the flowfrm.cxx
    
    Change-Id: I3b56ed46db9d37a606a1cd793a20b8aff22db6e2
    Reviewed-on: https://gerrit.libreoffice.org/78001
    Reviewed-by: Tomáš Chvátal <tchvatal at suse.com>
    Tested-by: Tomáš Chvátal <tchvatal at suse.com>
    Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>

diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index 920bd621fff4..6519a4ae1207 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -1232,11 +1232,15 @@ public:
             m_pForbidFrame->ForbidDelete();
     }
 
+    SwFrameDeleteGuard(const SwFrameDeleteGuard&) =delete;
+
     ~SwFrameDeleteGuard()
     {
         if (m_pForbidFrame)
             m_pForbidFrame->AllowDelete();
     }
+
+    SwFrameDeleteGuard& operator=(const SwFrameDeleteGuard&) =delete;
 };
 
 typedef long (SwFrame:: *SwFrameGet)() const;
diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx
index ff2befe5d969..316ba4de217c 100644
--- a/sw/source/core/layout/calcmove.cxx
+++ b/sw/source/core/layout/calcmove.cxx
@@ -403,14 +403,19 @@ void SwFrame::PrepareCursor()
         const bool bTab = IsTabFrame();
         bool bNoSect = IsInSct();
 
+#if BOOST_VERSION < 105600
+        std::list<FlowFrameJoinLockGuard> tabGuard;
+        std::list<SwFrameDeleteGuard> rowGuard;
+#else
         boost::optional<FlowFrameJoinLockGuard> tabGuard;
         boost::optional<SwFrameDeleteGuard> rowGuard;
+#endif
         SwFlowFrame* pThis = bCnt ? static_cast<SwContentFrame*>(this) : nullptr;
 
         if ( bTab )
         {
 #if BOOST_VERSION < 105600
-            tabGuard.reset(static_cast<SwTabFrame*>(this)); // tdf#125741
+            tabGuard.emplace_back(static_cast<SwTabFrame*>(this)); // tdf#125741
 #else
             tabGuard.emplace(static_cast<SwTabFrame*>(this)); // tdf#125741
 #endif
@@ -419,7 +424,7 @@ void SwFrame::PrepareCursor()
         else if (IsRowFrame())
         {
 #if BOOST_VERSION < 105600
-            rowGuard.reset(SwFrameDeleteGuard(this)); // tdf#125741 keep this alive
+            rowGuard.emplace_back(this); // tdf#125741 keep this alive
 #else
             rowGuard.emplace(this); // tdf#125741 keep this alive
 #endif
diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx
index dbe7d9c7feec..77617dc5cfa9 100644
--- a/sw/source/core/layout/flowfrm.cxx
+++ b/sw/source/core/layout/flowfrm.cxx
@@ -2517,7 +2517,11 @@ bool SwFlowFrame::MoveBwd( bool &rbReformat )
 
         {
             auto const pOld = m_rThis.GetUpper();
+#if BOOST_VERSION < 105600
+            std::list<SwFrameDeleteGuard> g;
+#else
             ::boost::optional<SwFrameDeleteGuard> g;
+#endif
             if (m_rThis.GetUpper()->IsCellFrame())
             {
                 // note: IsFollowFlowRow() is never set for new-style tables
@@ -2528,7 +2532,7 @@ bool SwFlowFrame::MoveBwd( bool &rbReformat )
                 {
                     // lock follow-flow-row (similar to sections above)
 #if BOOST_VERSION < 105600
-                    g.reset(SwFrameDeleteGuard(m_rThis.GetUpper()->GetUpper()));
+                    g.emplace_back(m_rThis.GetUpper()->GetUpper());
 #else
                     g.emplace(m_rThis.GetUpper()->GetUpper());
 #endif


More information about the Libreoffice-commits mailing list