summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@libreoffice.org>2018-02-05 13:17:50 +0100
committerBjoern Michaelsen <bjoern.michaelsen@libreoffice.org>2018-02-05 13:17:50 +0100
commit7d24155305670e8e9249aef1fc4c5f234d6d11e7 (patch)
treefc9bd5b9fa07ad0d349453a480e7cd43fbfc29af
parent35317520fb9fbd5c530aacff61d78353baebd9d2 (diff)
notice modify changes
Change-Id: I65b704e6d4d6f6949d92891f7dfc6807208c53d3
-rw-r--r--sw/inc/ftninfo.hxx2
-rw-r--r--sw/source/core/doc/docftn.cxx44
2 files changed, 26 insertions, 20 deletions
diff --git a/sw/inc/ftninfo.hxx b/sw/inc/ftninfo.hxx
index 2552fc34a578..de543323fe72 100644
--- a/sw/inc/ftninfo.hxx
+++ b/sw/inc/ftninfo.hxx
@@ -40,7 +40,7 @@ class SW_DLLPUBLIC SwEndNoteInfo : public SwClient
OUString sSuffix;
protected:
bool m_bEndNote;
- virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) override;
+ virtual void SwClientNotify( const SwModify&, const SfxHint&) override;
public:
SvxNumberType aFormat;
diff --git a/sw/source/core/doc/docftn.cxx b/sw/source/core/doc/docftn.cxx
index f074edb04020..db3dd5cfbbf3 100644
--- a/sw/source/core/doc/docftn.cxx
+++ b/sw/source/core/doc/docftn.cxx
@@ -171,32 +171,38 @@ SwCharFormat* SwEndNoteInfo::GetCurrentCharFormat(const bool bAnchor) const
: const_cast<SwCharFormat*>(static_cast<const SwCharFormat*>(aCharFormatDep.GetRegisteredIn()));
}
-
-void SwEndNoteInfo::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
+void SwEndNoteInfo::SwClientNotify( const SwModify& rModify, const SfxHint& rHint)
{
- const sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0 ;
-
- if( RES_ATTRSET_CHG == nWhich ||
- RES_FMT_CHG == nWhich )
+ if (auto pLegacyHint = dynamic_cast<const sw::LegacyModifyHint*>(&rHint))
{
- SwDoc* pDoc;
- if( aCharFormatDep.GetRegisteredIn() )
- pDoc = static_cast<SwFormat*>(aCharFormatDep.GetRegisteredIn())->GetDoc();
- else
- pDoc = pAnchorFormat->GetDoc();
- SwFootnoteIdxs& rFootnoteIdxs = pDoc->GetFootnoteIdxs();
- for( size_t nPos = 0; nPos < rFootnoteIdxs.size(); ++nPos )
+ const sal_uInt16 nWhich = pLegacyHint->m_pOld ? pLegacyHint->m_pOld->Which() : pLegacyHint->m_pNew ? pLegacyHint->m_pNew->Which() : 0 ;
+ if( RES_ATTRSET_CHG == nWhich ||
+ RES_FMT_CHG == nWhich )
{
- SwTextFootnote *pTextFootnote = rFootnoteIdxs[ nPos ];
- const SwFormatFootnote &rFootnote = pTextFootnote->GetFootnote();
- if ( rFootnote.IsEndNote() == m_bEndNote )
+ SwDoc* pDoc;
+ if( aCharFormatDep.GetRegisteredIn() )
+ pDoc = static_cast<SwFormat*>(aCharFormatDep.GetRegisteredIn())->GetDoc();
+ else
+ pDoc = pAnchorFormat->GetDoc();
+ SwFootnoteIdxs& rFootnoteIdxs = pDoc->GetFootnoteIdxs();
+ for( size_t nPos = 0; nPos < rFootnoteIdxs.size(); ++nPos )
{
- pTextFootnote->SetNumber(rFootnote.GetNumber(), rFootnote.GetNumStr());
+ SwTextFootnote *pTextFootnote = rFootnoteIdxs[ nPos ];
+ const SwFormatFootnote &rFootnote = pTextFootnote->GetFootnote();
+ if ( rFootnote.IsEndNote() == m_bEndNote )
+ {
+ pTextFootnote->SetNumber(rFootnote.GetNumber(), rFootnote.GetNumStr());
+ }
}
}
+ else
+ CheckRegistration( pLegacyHint->m_pOld );
+ }
+ else if (auto pModifyChangedHint = dynamic_cast<const sw::ModifyChangedHint*>(&rHint))
+ {
+ if(pAnchorFormat == &rModify)
+ pAnchorFormat = const_cast<SwCharFormat*>(static_cast<const SwCharFormat*>(pModifyChangedHint->m_pNew));
}
- else
- CheckRegistration( pOld );
}
SwFootnoteInfo& SwFootnoteInfo::operator=(const SwFootnoteInfo& rInfo)