summaryrefslogtreecommitdiff
path: root/sw/inc
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2025-01-22 20:36:03 +0100
committerLászló Németh <nemeth@numbertext.org>2025-01-23 17:28:07 +0100
commit2f135fa82c5d78ddafc14f38c0ee33358075b266 (patch)
tree69d7be4bc7375eaeb9779b4591f32b4a29312b9f /sw/inc
parent333484e34418a3e33633d231d3e3386d79911486 (diff)
tdf#121119 master docs at-page anchor: fix missing images
Images and other objects anchored at pages weren't imported from the subdocuments, resulting broken master document. Subdocuments are imported as sections of the master document, but their objects anchored at page need a document-level copy, not a section one. To calculate the new document-level page number of the copied object, store and sum the page count meta data of the previous subdocuments, added to the subdocument- level page number of the object. Note: the recent solution doesn't calculate with the own text content of the master document yet. As a workaround, to get the original page number exactly, store everything in subdocuments before the objects anchored at page. The problem is inherited from OpenOffice.org, see ooo#19131. Change-Id: I0be80bb27442565764142d2b23b0f56a3421c035 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180626 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw/inc')
-rw-r--r--sw/inc/section.hxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/sw/inc/section.hxx b/sw/inc/section.hxx
index 0c45e470d247..b2f5fb53a54a 100644
--- a/sw/inc/section.hxx
+++ b/sw/inc/section.hxx
@@ -67,6 +67,7 @@ private:
OUString m_sLinkFileName;
OUString m_sLinkFilePassword; // Must be changed to Sequence.
css::uno::Sequence <sal_Int8> m_Password;
+ sal_uInt16 m_nPage; // loaded meta page count for page anchored flys in master document
/// It seems this flag caches the current final "hidden" state.
bool m_bHiddenFlag : 1;
@@ -133,6 +134,9 @@ public:
bool IsConnectFlag() const { return m_bConnectFlag; }
void SetConnectFlag(bool const bFlag){ m_bConnectFlag = bFlag; }
+ sal_uInt16 GetPageNum() const { return m_nPage; }
+ void SetPageNum(sal_uInt16 nPageNum){ m_nPage = nPageNum; }
+
void dumpAsXml(xmlTextWriterPtr pWriter) const;
};
@@ -213,6 +217,11 @@ public:
css::uno::Sequence<sal_Int8> const& GetPassword() const
{ return m_Data.GetPassword(); }
+ sal_uInt16 GetPageNum() const
+ { return m_Data.GetPageNum(); }
+ void SetPageNum(sal_uInt16 nPage)
+ { m_Data.SetPageNum(nPage); }
+
// Data server methods.
void SetRefObject( SwServerObject* pObj );
const SwServerObject* GetObject() const { return m_RefObj.get(); }