diff options
author | Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org> | 2020-11-10 23:55:43 +0100 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org> | 2020-11-12 00:11:59 +0100 |
commit | 693553210828538680408832157faad9654758c8 (patch) | |
tree | 09fa64a2595878dc5567a739a3e4060c75ef75a6 | |
parent | ab72e9fe38b5d30bd1a0393e1611ae969919908f (diff) |
replace RES_GRF_REREAD_AND_INCACHE with sw::GrfRereadAndInCacheHint
Change-Id: I8b36fd0dde6f4e7f83cf73dc8b6aefb196babb8f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105571
Tested-by: Jenkins
Reviewed-by: Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org>
-rw-r--r-- | sw/inc/hintids.hxx | 1 | ||||
-rw-r--r-- | sw/inc/hints.hxx | 4 | ||||
-rw-r--r-- | sw/source/core/doc/docfmt.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/doc/notxtfrm.cxx | 18 | ||||
-rw-r--r-- | sw/source/core/docnode/node.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/graphic/ndgrf.cxx | 3 |
6 files changed, 17 insertions, 19 deletions
diff --git a/sw/inc/hintids.hxx b/sw/inc/hintids.hxx index 021aac0be963..1cfba494d9e6 100644 --- a/sw/inc/hintids.hxx +++ b/sw/inc/hintids.hxx @@ -429,7 +429,6 @@ constexpr TypedWhichId<SwMsgPoolItem> RES_GRAPHIC_PIECE_ARRIVED (175); constexpr TypedWhichId<SwMsgPoolItem> RES_HIDDENPARA_PRINT (176); constexpr TypedWhichId<SwVirtPageNumInfo> RES_VIRTPAGENUM_INFO (178); constexpr TypedWhichId<SwPtrMsgPoolItem> RES_REMOVE_UNO_OBJECT (179); -constexpr TypedWhichId<SwMsgPoolItem> RES_GRF_REREAD_AND_INCACHE (180); // empty constexpr TypedWhichId<SwFindNearestNode> RES_FINDNEARESTNODE (182); constexpr TypedWhichId<SwPtrMsgPoolItem> RES_CONTENT_VISIBLE (183); diff --git a/sw/inc/hints.hxx b/sw/inc/hints.hxx index 6b3073e6a739..68e783d919d2 100644 --- a/sw/inc/hints.hxx +++ b/sw/inc/hints.hxx @@ -135,6 +135,10 @@ public: const SwTextFormatColl& m_rColl; CondCollCondChg(const SwTextFormatColl& rColl) : m_rColl(rColl) {}; }; + +class GrfRereadAndInCacheHint final : public SfxHint +{ +}; } class SwUpdateAttr final : public SwMsgPoolItem diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx index 94f6416878c8..805015216dd8 100644 --- a/sw/source/core/doc/docfmt.cxx +++ b/sw/source/core/doc/docfmt.cxx @@ -629,7 +629,7 @@ void SwDoc::SetDefault( const SfxItemSet& rSet ) { SwFormatChg aChgFormat( mpDfltCharFormat.get() ); // notify the frames - aCallMod.SwClientNotifyCall(aCallMod, sw::LegacyModifyHint( &aChgFormat, &aChgFormat )); + aCallMod.CallSwClientNotify(sw::LegacyModifyHint( &aChgFormat, &aChgFormat )); } } } @@ -638,7 +638,7 @@ void SwDoc::SetDefault( const SfxItemSet& rSet ) { SwAttrSetChg aChgOld( aOld, aOld ); SwAttrSetChg aChgNew( aNew, aNew ); - aCallMod.SwClientNotifyCall(aCallMod, sw::LegacyModifyHint( &aChgOld, &aChgNew )); // all changed are sent + aCallMod.CallSwClientNotify(sw::LegacyModifyHint( &aChgOld, &aChgNew )); // all changed are sent } // remove the default formats from the object again diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx index e8517ba547eb..47054a8df949 100644 --- a/sw/source/core/doc/notxtfrm.cxx +++ b/sw/source/core/doc/notxtfrm.cxx @@ -722,6 +722,15 @@ void SwNoTextFrame::ClearCache() void SwNoTextFrame::SwClientNotify(const SwModify& rModify, const SfxHint& rHint) { + if(dynamic_cast<const sw::GrfRereadAndInCacheHint*>(&rHint)) + { + if(SwNodeType::Grf != GetNode()->GetNodeType()) + { + InvalidatePrt(); + SetCompletePaint(); + } + return; + } auto pLegacy = dynamic_cast<const sw::LegacyModifyHint*>(&rHint); if(!pLegacy) return; @@ -731,7 +740,6 @@ void SwNoTextFrame::SwClientNotify(const SwModify& rModify, const SfxHint& rHint // no <SwContentFrame::Modify(..)> for RES_LINKED_GRAPHIC_STREAM_ARRIVED if ( RES_GRAPHIC_PIECE_ARRIVED != nWhich && RES_GRAPHIC_ARRIVED != nWhich && - RES_GRF_REREAD_AND_INCACHE != nWhich && RES_LINKED_GRAPHIC_STREAM_ARRIVED != nWhich ) { SwContentFrame::SwClientNotify(rModify, rHint); @@ -744,14 +752,6 @@ void SwNoTextFrame::SwClientNotify(const SwModify& rModify, const SfxHint& rHint case RES_OBJECTDYING: break; - case RES_GRF_REREAD_AND_INCACHE: - if( SwNodeType::Grf == GetNode()->GetNodeType() ) - { - // TODO: Remove - due to GraphicObject refactoring - bComplete = false; - } - break; - case RES_UPDATE_ATTR: if (GetNode()->GetNodeType() != SwNodeType::Grf) { break; diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx index 93f58ecddff6..a26109061725 100644 --- a/sw/source/core/docnode/node.cxx +++ b/sw/source/core/docnode/node.cxx @@ -1106,11 +1106,7 @@ void SwContentNode::SwClientNotify( const SwModify&, const SfxHint& rHint) { if (auto pLegacyHint = dynamic_cast<const sw::LegacyModifyHint*>(&rHint)) { - const sal_uInt16 nWhich = pLegacyHint->m_pOld - ? pLegacyHint->m_pOld->Which() - : pLegacyHint->m_pNew - ? pLegacyHint->m_pNew->Which() - : 0 ; + const sal_uInt16 nWhich = pLegacyHint->GetWhich(); bool bSetParent = false; bool bCalcHidden = false; diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx index 1f894a90de8c..01ac5780e4a2 100644 --- a/sw/source/core/graphic/ndgrf.cxx +++ b/sw/source/core/graphic/ndgrf.cxx @@ -214,8 +214,7 @@ bool SwGrfNode::ReRead( { if( getLayoutFrame( GetDoc().getIDocumentLayoutAccess().GetCurrentLayout() ) ) { - SwMsgPoolItem aMsgHint( RES_GRF_REREAD_AND_INCACHE ); - lcl_SwClientNotify(*this, aMsgHint); + CallSwClientNotify(sw::GrfRereadAndInCacheHint()); } else if ( bNewGrf ) { |