sw/qa/filter/ww8/ww8.cxx          |    7 ++++++-
 sw/source/core/inc/frame.hxx      |    3 +++
 sw/source/core/layout/findfrm.cxx |   11 +++++++++++
 sw/source/filter/ww8/ww8par.cxx   |    7 -------
 4 files changed, 20 insertions(+), 8 deletions(-)

New commits:
commit 135e86e7e3bafdb0ab39a372a989854eefefe30c
Author:     Miklos Vajna <vmik...@collabora.com>
AuthorDate: Thu May 16 08:46:36 2024 +0200
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Fri May 17 12:03:49 2024 +0200

    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.
    
    (cherry picked from commit d74fb6b571304b41c13b7a6dcdd2b853bfca7210)
    
    Change-Id: If7fd856f5dc5f1feb1366fca69a2ad6b3602044d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167763
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

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 a86358508182..b662adc89086 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;
@@ -876,6 +877,8 @@ public:
     const SwTextFrame* DynCastTextFrame() const;
     SwPageFrame* DynCastPageFrame();
     const SwPageFrame* DynCastPageFrame() const;
+    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 378e451b9f89..4efa25e553e6 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>
@@ -1973,4 +1974,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 c88990a5f663..3f18c2058122 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -5195,13 +5195,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)

Reply via email to