sw/source/core/inc/ftnfrm.hxx                   |    1 -
 sw/source/core/text/EnhancedPDFExportHelper.cxx |   23 +++++++++++++++--------
 2 files changed, 15 insertions(+), 9 deletions(-)

New commits:
commit 9942f9f76ffda559eccc3e4c8e196d5fe36f2051
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Mon Oct 2 19:46:36 2023 +0200
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Thu Oct 5 21:18:32 2023 +0200

    sw: PDF/UA export: merge footnote frame follows
    
    Change-Id: Icb1c585c4d321e38a6ac3d841846d505c4816db2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157504
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>
    (cherry picked from commit 5cdb4e495e23be77466d8f8bbe6ae643b60d3aa6)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157535
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/sw/source/core/inc/ftnfrm.hxx b/sw/source/core/inc/ftnfrm.hxx
index a514e4ba10d3..89d9f34f863a 100644
--- a/sw/source/core/inc/ftnfrm.hxx
+++ b/sw/source/core/inc/ftnfrm.hxx
@@ -84,7 +84,6 @@ class SwFootnoteFrame final : public SwLayoutFrame
 {
     // Pointer to FootnoteFrame in which the footnote will be continued:
     //  - 0     no following existent
-    //  - this  for the last one
     //  - otherwise the following FootnoteFrame
     SwFootnoteFrame     *mpFollow;
     SwFootnoteFrame     *mpMaster;      // FootnoteFrame from which I am the 
following
diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx 
b/sw/source/core/text/EnhancedPDFExportHelper.cxx
index 3cd5176cb786..3103b3fe9ef8 100644
--- a/sw/source/core/text/EnhancedPDFExportHelper.cxx
+++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx
@@ -67,6 +67,7 @@
 #include <rowfrm.hxx>
 #include <cellfrm.hxx>
 #include <sectfrm.hxx>
+#include <ftnfrm.hxx>
 #include <flyfrm.hxx>
 #include <notxtfrm.hxx>
 #include "porfld.hxx"
@@ -266,25 +267,29 @@ bool lcl_IsInNonStructEnv( const SwFrame& rFrame )
 }
 
 // Generate key from frame for reopening tags:
-void* lcl_GetKeyFromFrame( const SwFrame& rFrame )
+void const* lcl_GetKeyFromFrame( const SwFrame& rFrame )
 {
-    void* pKey = nullptr;
+    void const* pKey = nullptr;
 
     if ( rFrame.IsPageFrame() )
-        pKey = const_cast<void*>(static_cast<void const *>(&(static_cast<const 
SwPageFrame&>(rFrame).GetFormat()->getIDocumentSettingAccess())));
+        pKey = static_cast<void const *>(&(static_cast<const 
SwPageFrame&>(rFrame).GetFormat()->getIDocumentSettingAccess()));
     else if ( rFrame.IsTextFrame() )
-        pKey = const_cast<void*>(static_cast<void const *>(static_cast<const 
SwTextFrame&>(rFrame).GetTextNodeFirst()));
+        pKey = static_cast<void const *>(static_cast<const 
SwTextFrame&>(rFrame).GetTextNodeFirst());
     else if ( rFrame.IsSctFrame() )
-        pKey = const_cast<void*>(static_cast<void const *>(static_cast<const 
SwSectionFrame&>(rFrame).GetSection()));
+        pKey = static_cast<void const *>(static_cast<const 
SwSectionFrame&>(rFrame).GetSection());
     else if ( rFrame.IsTabFrame() )
-        pKey = const_cast<void*>(static_cast<void const *>(static_cast<const 
SwTabFrame&>(rFrame).GetTable()));
+        pKey = static_cast<void const *>(static_cast<const 
SwTabFrame&>(rFrame).GetTable());
     else if ( rFrame.IsRowFrame() )
-        pKey = const_cast<void*>(static_cast<void const *>(static_cast<const 
SwRowFrame&>(rFrame).GetTabLine()));
+        pKey = static_cast<void const *>(static_cast<const 
SwRowFrame&>(rFrame).GetTabLine());
     else if ( rFrame.IsCellFrame() )
     {
         const SwTabFrame* pTabFrame = rFrame.FindTabFrame();
         const SwTable* pTable = pTabFrame->GetTable();
-        pKey = const_cast<void*>(static_cast<void const *>(& static_cast<const 
SwCellFrame&>(rFrame).GetTabBox()->FindStartOfRowSpan( *pTable )));
+        pKey = static_cast<void const *>(& static_cast<const 
SwCellFrame&>(rFrame).GetTabBox()->FindStartOfRowSpan(*pTable));
+    }
+    else if (rFrame.IsFootnoteFrame())
+    {
+        pKey = static_cast<void const*>(static_cast<SwFootnoteFrame 
const&>(rFrame).GetAttr());
     }
 
     return pKey;
@@ -420,6 +425,7 @@ bool SwTaggedPDFHelper::CheckReopenTag()
         // - rFrame is a cell frame in a follow flow row (reopen TableData tag)
         if ( ( rFrame.IsPageFrame() && static_cast<const 
SwPageFrame&>(rFrame).GetPrev() ) ||
              ( rFrame.IsFlowFrame() && 
SwFlowFrame::CastFlowFrame(&rFrame)->IsFollow() ) ||
+             (rFrame.IsFootnoteFrame() && static_cast<SwFootnoteFrame 
const&>(rFrame).GetMaster()) ||
              ( rFrame.IsRowFrame() && rFrame.IsInFollowFlowRow() ) ||
              ( rFrame.IsCellFrame() && 
const_cast<SwFrame&>(rFrame).GetPrevCellLeaf() ) )
         {
@@ -511,6 +517,7 @@ void SwTaggedPDFHelper::BeginTag( 
vcl::PDFWriter::StructElement eType, const OUS
         if ( ( rFrame.IsPageFrame() && !static_cast<const 
SwPageFrame&>(rFrame).GetPrev() ) ||
              ( rFrame.IsFlowFrame() && 
!SwFlowFrame::CastFlowFrame(&rFrame)->IsFollow() && 
SwFlowFrame::CastFlowFrame(&rFrame)->HasFollow() ) ||
              ( rFrame.IsTextFrame() && rFrame.GetDrawObjs() ) ||
+             (rFrame.IsFootnoteFrame() && static_cast<SwFootnoteFrame 
const&>(rFrame).GetFollow()) ||
              ( rFrame.IsRowFrame() && rFrame.IsInSplitTableRow() ) ||
              ( rFrame.IsCellFrame() && 
const_cast<SwFrame&>(rFrame).GetNextCellLeaf() ) )
         {

Reply via email to