summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2024-05-16 08:46:36 +0200
committerMiklos Vajna <vmiklos@collabora.com>2024-05-16 10:13:43 +0200
commitd74fb6b571304b41c13b7a6dcdd2b853bfca7210 (patch)
tree9f5e289d8341cb688c28443188e154f1211841db /sw
parent7fcd5ac42086f1374c3bd5eb2be9a59e6f38f2e3 (diff)
tdf#160984 sw continuous endnotes, DOC import: enable this unconditionally
DOC files with <= 2 endnotes were imported fine, but not if they had more endnotes. This was added in commit dc11f5b151e1a2ea2623fc8cf806a400763955d9 (tdf#143445 DOC import: limit the usage of the CONTINUOUS_ENDNOTES compat flag, 2023-05-23), because mapping endnotes to footnotes was a dead-end. The limitation can be dropped: I checked that the tdf#143445 bugdoc with all its 72 endnotes is laid out reasonably. Also add a new SwFrame::DynCastColumnFrame() to easily get a column frame from a frame using our own RTTI, if we have it anyway. Change-Id: If7fd856f5dc5f1feb1366fca69a2ad6b3602044d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167722 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/filter/ww8/ww8.cxx7
-rw-r--r--sw/source/core/inc/frame.hxx3
-rw-r--r--sw/source/core/layout/findfrm.cxx11
-rw-r--r--sw/source/filter/ww8/ww8par.cxx7
4 files changed, 20 insertions, 8 deletions
diff --git a/sw/qa/filter/ww8/ww8.cxx b/sw/qa/filter/ww8/ww8.cxx
index af19051a03e5..4cbbfe5fbf31 100644
--- a/sw/qa/filter/ww8/ww8.cxx
+++ b/sw/qa/filter/ww8/ww8.cxx
@@ -30,6 +30,8 @@
#include <fmtwrapinfluenceonobjpos.hxx>
#include <ftnidx.hxx>
#include <tabfrm.hxx>
+#include <cntfrm.hxx>
+#include <colfrm.hxx>
namespace
{
@@ -298,7 +300,10 @@ CPPUNIT_TEST_FIXTURE(Test, test3Endnotes)
SwDoc* pDoc = getSwDoc();
SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout();
SwPageFrame* pPage = pLayout->GetLastPage();
- SwFootnoteContFrame* pFootnoteCont = pPage->FindFootnoteCont();
+ SwContentFrame* pLastContent = pPage->FindLastBodyContent();
+ SwFrame* pSectionFrame = pLastContent->GetNext();
+ auto pColumnFrame = pSectionFrame->GetLower()->DynCastColumnFrame();
+ SwFootnoteContFrame* pFootnoteCont = pColumnFrame->FindFootnoteCont();
int nEndnotes = 0;
for (SwFrame* pLower = pFootnoteCont->GetLower(); pLower; pLower = pLower->GetNext())
{
diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index f0b7439bd283..399ab4d0b448 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -40,6 +40,7 @@ namespace drawinglayer::processor2d { class BaseProcessor2D; }
class SwLayoutFrame;
class SwRootFrame;
class SwPageFrame;
+class SwColumnFrame;
class SwBodyFrame;
class SwFlyFrame;
class SwSectionFrame;
@@ -879,6 +880,8 @@ public:
const SwTextFrame* DynCastTextFrame() const;
SW_DLLPUBLIC SwPageFrame* DynCastPageFrame();
const SwPageFrame* DynCastPageFrame() const;
+ SW_DLLPUBLIC SwColumnFrame* DynCastColumnFrame();
+ const SwColumnFrame* DynCastColumnFrame() const;
inline bool IsNoTextFrame() const;
// Frames where its PrtArea depends on their neighbors and that are
// positioned in the content flow
diff --git a/sw/source/core/layout/findfrm.cxx b/sw/source/core/layout/findfrm.cxx
index 60ca1fe7d326..e83f4f8414a0 100644
--- a/sw/source/core/layout/findfrm.cxx
+++ b/sw/source/core/layout/findfrm.cxx
@@ -18,6 +18,7 @@
*/
#include <pagefrm.hxx>
+#include <colfrm.hxx>
#include <rootfrm.hxx>
#include <cellfrm.hxx>
#include <rowfrm.hxx>
@@ -1990,4 +1991,14 @@ const SwPageFrame* SwFrame::DynCastPageFrame() const
return IsPageFrame() ? static_cast<const SwPageFrame*>(this) : nullptr;
}
+SwColumnFrame* SwFrame::DynCastColumnFrame()
+{
+ return IsColumnFrame() ? static_cast<SwColumnFrame*>(this) : nullptr;
+}
+
+const SwColumnFrame* SwFrame::DynCastColumnFrame() const
+{
+ return IsColumnFrame() ? static_cast<const SwColumnFrame*>(this) : nullptr;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 45eef231ab27..6d1666359eec 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -5196,13 +5196,6 @@ ErrCode SwWW8ImplReader::CoreLoad(WW8Glossary const *pGloss)
if( m_xWDop->nEdn )
aInfo.m_nFootnoteOffset = m_xWDop->nEdn - 1;
m_rDoc.SetEndNoteInfo( aInfo );
-
- if (m_xSBase->GetEndnoteCount() > 2)
- {
- // This compatibility flag only works in easy cases, disable it for anything non-trivial
- // for now.
- m_rDoc.getIDocumentSettingAccess().set(DocumentSettingId::CONTINUOUS_ENDNOTES, false);
- }
}
if (m_xWwFib->m_lcbPlcfhdd)