summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2018-11-14 17:32:26 +0100
committerMichael Stahl <Michael.Stahl@cib.de>2018-11-14 18:42:15 +0100
commit510829c5493df129604df5d8fe43078cb1a0800d (patch)
tree08424c9e442d05a9d54cb94091982d3e53a80f32
parent76ea34e606b358f14f104e496f316fc616abd3f6 (diff)
sw_redlinehide_3: filter deleted footnotes in Field Reference dialog
Change-Id: I386bce6b929e38077c01595de618b89fccdaf5fe
-rw-r--r--sw/inc/ftnidx.hxx7
-rw-r--r--sw/source/core/doc/ftnidx.cxx8
-rw-r--r--sw/source/core/edit/edattr.cxx8
3 files changed, 22 insertions, 1 deletions
diff --git a/sw/inc/ftnidx.hxx b/sw/inc/ftnidx.hxx
index 3dfb118a1f6b..245d9176dc16 100644
--- a/sw/inc/ftnidx.hxx
+++ b/sw/inc/ftnidx.hxx
@@ -67,6 +67,13 @@ public:
IDocumentRedlineAccess const&, const SwTextFootnote& rTextFootnote);
};
+namespace sw {
+
+bool IsFootnoteDeleted(IDocumentRedlineAccess const& rIDRA,
+ SwTextFootnote const& rTextFootnote);
+
+}
+
#endif // INCLUDED_SW_INC_FTNIDX_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/ftnidx.cxx b/sw/source/core/doc/ftnidx.cxx
index 85c35ecc51e7..41831272a534 100644
--- a/sw/source/core/doc/ftnidx.cxx
+++ b/sw/source/core/doc/ftnidx.cxx
@@ -32,7 +32,9 @@
#include <rootfrm.hxx>
#include <txtfrm.hxx>
-static bool IsFootnoteDeleted(IDocumentRedlineAccess const& rIDRA,
+namespace sw {
+
+bool IsFootnoteDeleted(IDocumentRedlineAccess const& rIDRA,
SwTextFootnote const& rTextFootnote)
{
SwRedlineTable::size_type tmp;
@@ -44,6 +46,10 @@ static bool IsFootnoteDeleted(IDocumentRedlineAccess const& rIDRA,
&& *pRedline->GetPoint() != *pRedline->GetMark());
}
+}
+
+using sw::IsFootnoteDeleted;
+
bool CompareSwFootnoteIdxs::operator()(SwTextFootnote* const& lhs, SwTextFootnote* const& rhs) const
{
sal_uLong nIdxLHS = SwTextFootnote_GetIndex( lhs );
diff --git a/sw/source/core/edit/edattr.cxx b/sw/source/core/edit/edattr.cxx
index 34610c2b57e1..e80ef6f109e1 100644
--- a/sw/source/core/edit/edattr.cxx
+++ b/sw/source/core/edit/edattr.cxx
@@ -446,6 +446,8 @@ size_t SwEditShell::GetSeqFootnoteList( SwSeqFieldList& rList, bool bEndNotes )
{
rList.Clear();
+ IDocumentRedlineAccess & rIDRA(mxDoc->getIDocumentRedlineAccess());
+
const size_t nFootnoteCnt = mxDoc->GetFootnoteIdxs().size();
SwTextFootnote* pTextFootnote;
for( size_t n = 0; n < nFootnoteCnt; ++n )
@@ -465,6 +467,12 @@ size_t SwEditShell::GetSeqFootnoteList( SwSeqFieldList& rList, bool bEndNotes )
if( pTextNd )
{
+ if (GetLayout()->IsHideRedlines()
+ && sw::IsFootnoteDeleted(rIDRA, *pTextFootnote))
+ {
+ continue;
+ }
+
OUString sText(rFootnote.GetViewNumStr(*mxDoc, GetLayout()));
if( !sText.isEmpty() )
sText += " ";