summaryrefslogtreecommitdiff
path: root/sw
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-15 15:10:08 +0100
commitf30c45f52f7df3c463886b1674917ee681290fee (patch)
treefc00ee037102e2deeb288a9aebdda3475ab42417 /sw
parentf1db41715ad9cc9655cc7f9bba86b822d693bb83 (diff)
sw_redlinehide_3: filter deleted footnotes in Field Reference dialog
Change-Id: I386bce6b929e38077c01595de618b89fccdaf5fe
Diffstat (limited to 'sw')
-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 += " ";