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

Bjoern Michaelsen bjoern.michaelsen at canonical.com
Sun Dec 4 11:36:42 UTC 2016


 sw/inc/frmfmt.hxx                 |    6 ++++++
 sw/source/core/draw/dcontact.cxx  |    4 ++++
 sw/source/core/layout/atrfrm.cxx  |    1 +
 sw/source/core/txtnode/thints.cxx |    8 +++-----
 4 files changed, 14 insertions(+), 5 deletions(-)

New commits:
commit 5c0321439a6dd5b00ef13a6ab69c3ef30629d5ea
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date:   Sat Dec 3 02:17:32 2016 +0100

    use proper message passing
    
    Change-Id: I5c0b9007e5a84643ccbe3c5b6b6a913a43667e18
    Reviewed-on: https://gerrit.libreoffice.org/31573
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Björn Michaelsen <bjoern.michaelsen at canonical.com>

diff --git a/sw/inc/frmfmt.hxx b/sw/inc/frmfmt.hxx
index 644271d..0dd00dc 100644
--- a/sw/inc/frmfmt.hxx
+++ b/sw/inc/frmfmt.hxx
@@ -249,6 +249,12 @@ namespace sw
         DrawFrameFormatHint(DrawFrameFormatHintId eId) : m_eId(eId) {};
         virtual ~DrawFrameFormatHint() override;
     };
+    struct SW_DLLPUBLIC CheckDrawFrameFormatLayerHint final: SfxHint
+    {
+        bool* m_bCheckControlLayer;
+        CheckDrawFrameFormatLayerHint(bool* bCheckControlLayer) : m_bCheckControlLayer(bCheckControlLayer) {};
+        virtual ~CheckDrawFrameFormatLayerHint() override;
+    };
 }
 
 class SW_DLLPUBLIC SwDrawFrameFormat: public SwFrameFormat
diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx
index 2c78efc..82425a0 100644
--- a/sw/source/core/draw/dcontact.cxx
+++ b/sw/source/core/draw/dcontact.cxx
@@ -1555,6 +1555,10 @@ void SwDrawContact::SwClientNotify(const SwModify& rMod, const SfxHint& rHint)
                 SAL_WARN("sw.core", "unhandled DrawFrameFormatHintId");
         }
     }
+    else if (auto pCheckDrawFrameFormatLayerHint = dynamic_cast<const sw::CheckDrawFrameFormatLayerHint*>(&rHint))
+    {
+        *(pCheckDrawFrameFormatLayerHint->m_bCheckControlLayer) |= (GetMaster() && CheckControlLayer(GetMaster()));
+    }
 }
 
 // #i26791#
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index aaccfa7..4d5cd195 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -3329,6 +3329,7 @@ IMPL_FIXEDMEMPOOL_NEWDEL( SwDrawFrameFormat )
 namespace sw
 {
     DrawFrameFormatHint::~DrawFrameFormatHint() {}
+    CheckDrawFrameFormatLayerHint::~CheckDrawFrameFormatLayerHint() {}
 }
 
 SwDrawFrameFormat::~SwDrawFrameFormat()
diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx
index b091b6f..53a439c 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -1314,11 +1314,9 @@ bool SwTextNode::InsertHint( SwTextAttr * const pAttr, const SetAttrMode nMode )
                 if( RES_DRAWFRMFMT == pFormat->Which() &&
                     pDoc->IsInHeaderFooter( pFormat->GetAnchor().GetContentAnchor()->nNode ) )
                 {
-                    SwDrawContact* pDrawContact =
-                        static_cast<SwDrawContact*>(pFormat->FindContactObj());
-                    if ( pDrawContact &&
-                         pDrawContact->GetMaster() &&
-                         ::CheckControlLayer( pDrawContact->GetMaster() ) )
+                    bool bCheckControlLayer = false;
+                    pFormat->CallSwClientNotify(sw::CheckDrawFrameFormatLayerHint(&bCheckControlLayer));
+                    if( bCheckControlLayer )
                     {
                         // das soll nicht meoglich sein; hier verhindern
                         // Der Dtor des TextHints loescht nicht das Zeichen.


More information about the Libreoffice-commits mailing list