summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/inc/fldbas.hxx3
-rw-r--r--sw/inc/fmtfld.hxx5
-rw-r--r--sw/source/core/fields/fldbas.cxx5
-rw-r--r--sw/source/core/txtnode/atrfld.cxx4
-rw-r--r--sw/source/filter/ww8/ww8atr.cxx10
5 files changed, 18 insertions, 9 deletions
diff --git a/sw/inc/fldbas.hxx b/sw/inc/fldbas.hxx
index 93012dc5458b..8601dea443b8 100644
--- a/sw/inc/fldbas.hxx
+++ b/sw/inc/fldbas.hxx
@@ -22,6 +22,8 @@
#include <i18nlangtag/lang.h>
#include "swdllapi.h"
#include "calbck.hxx"
+#include "ndindex.hxx"
+
#include <cppuhelper/weakref.hxx>
#include <editeng/svxenum.hxx>
#include <vector>
@@ -274,6 +276,7 @@ public:
SwFormatField* FindFormatForPostItId(sal_uInt32 nPostItId) const;
void CollectPostIts(std::vector<SwFormatField*>& rvFormatFields, IDocumentRedlineAccess const& rIDRA, bool HideRedlines);
bool HasHiddenInformationNotes();
+ void GatherNodeIndex(std::vector<sal_uLong>& rvNodeIndex);
};
inline void SwFieldType::UpdateFields() const
diff --git a/sw/inc/fmtfld.hxx b/sw/inc/fmtfld.hxx
index b2e6a6bf1508..e68a9be41582 100644
--- a/sw/inc/fmtfld.hxx
+++ b/sw/inc/fmtfld.hxx
@@ -26,6 +26,7 @@
#include "swdllapi.h"
#include "calbck.hxx"
+#include "ndindex.hxx"
class SwField;
class SwTextField;
@@ -56,6 +57,10 @@ namespace sw {
bool& m_rbHasHiddenInformationNotes;
HasHiddenInformationNotesHint(bool& rbHasHiddenInformationNotes) : m_rbHasHiddenInformationNotes(rbHasHiddenInformationNotes) {};
};
+ struct GatherNodeIndexHint final : SfxHint {
+ std::vector<sal_uLong>& m_rvNodeIndex;
+ GatherNodeIndexHint(std::vector<sal_uLong>& rvNodeIndex) : m_rvNodeIndex(rvNodeIndex) {};
+ };
}
diff --git a/sw/source/core/fields/fldbas.cxx b/sw/source/core/fields/fldbas.cxx
index b17d07fd4171..a56b2c81302b 100644
--- a/sw/source/core/fields/fldbas.cxx
+++ b/sw/source/core/fields/fldbas.cxx
@@ -180,6 +180,11 @@ bool SwFieldType::HasHiddenInformationNotes()
return bHasHiddenInformationNotes;
}
+void SwFieldType::GatherNodeIndex(std::vector<sal_uLong>& rvNodeIndex)
+{
+ CallSwClientNotify(sw::GatherNodeIndexHint(rvNodeIndex));
+}
+
void SwFieldTypes::dumpAsXml(xmlTextWriterPtr pWriter) const
{
xmlTextWriterStartElement(pWriter, BAD_CAST("SwFieldTypes"));
diff --git a/sw/source/core/txtnode/atrfld.cxx b/sw/source/core/txtnode/atrfld.cxx
index 67ec2b0992f2..88b67c451b94 100644
--- a/sw/source/core/txtnode/atrfld.cxx
+++ b/sw/source/core/txtnode/atrfld.cxx
@@ -262,6 +262,10 @@ void SwFormatField::SwClientNotify( const SwModify& rModify, const SfxHint& rHin
{
if(!pHasHiddenInfoHint->m_rbHasHiddenInformationNotes && GetTextField() && IsFieldInDoc())
pHasHiddenInfoHint->m_rbHasHiddenInformationNotes = true;
+ } else if (const auto pGatherNodeIndexHint = dynamic_cast<const sw::GatherNodeIndexHint*>( &rHint ))
+ {
+ if(auto pTextField = GetTextField())
+ pGatherNodeIndexHint->m_rvNodeIndex.push_back(pTextField->GetTextNode().GetIndex());
}
}
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 96c7ebe0f50c..38181c2d69b8 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -355,15 +355,7 @@ void MSWordExportBase::GatherChapterFields()
{
//If the header/footer contains a chapter field
SwFieldType* pType = m_pDoc->getIDocumentFieldsAccess().GetSysFieldType( SwFieldIds::Chapter );
- SwIterator<SwFormatField,SwFieldType> aFormatFields( *pType );
- for ( SwFormatField* pField = aFormatFields.First(); pField; pField = aFormatFields.Next() )
- {
- if (const SwTextField *pTextField = pField->GetTextField())
- {
- const SwTextNode &rTextNode = pTextField->GetTextNode();
- m_aChapterFieldLocs.push_back(rTextNode.GetIndex());
- }
- }
+ pType->GatherNodeIndex(m_aChapterFieldLocs);
}
bool MSWordExportBase::ContentContainsChapterField(const SwFormatContent &rContent) const