diff options
author | Bjoern Kirchhoff <bjoern.kirchhoff@escriba.de> | 2020-01-15 17:20:54 +0100 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2020-01-16 20:42:21 +0100 |
commit | 92b10e5c0825a2fe176738a1b86e2b4db0a263cb (patch) | |
tree | d9b15eb41c7debacfe0dd4d283e31c26d71f82f7 /sw/source | |
parent | ed4a1a71f0bcbcaceba8929456ea4e7dd1d43a8f (diff) |
FirstLeft and FirstMaster not handled in CreateParentXText
FirstLeft and FirstMaster were not taken into account in
CreateParentXText. Code calling getAnchor().getText().toString()
on text fields failed, when they where contained in footers/headers
of first left or first right pages. These cases are now implemented.
Change-Id: I7fbe9eb95a3fa0d90ebd8432b8a315d186da6f64
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86869
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/core/unocore/unoobj2.cxx | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx index 66588a58919d..a4708d249970 100644 --- a/sw/source/core/unocore/unoobj2.cxx +++ b/sw/source/core/unocore/unoobj2.cxx @@ -1111,15 +1111,25 @@ CreateParentXText(SwDoc & rDoc, const SwPosition& rPos) for(size_t i = 0; i < nPDescCount; i++) { const SwPageDesc& rDesc = rDoc.GetPageDesc( i ); + const SwFrameFormat* pFrameFormatMaster = &rDesc.GetMaster(); const SwFrameFormat* pFrameFormatLeft = &rDesc.GetLeft(); + const SwFrameFormat* pFrameFormatFirstMaster = &rDesc.GetFirstMaster(); + const SwFrameFormat* pFrameFormatFirstLeft = &rDesc.GetFirstLeft(); SwFrameFormat* pHeadFootFormat = nullptr; if (!lcl_IsStartNodeInFormat(bHeader, pSttNode, pFrameFormatMaster, - pHeadFootFormat)) + pHeadFootFormat)) { - lcl_IsStartNodeInFormat(bHeader, pSttNode, pFrameFormatLeft, - pHeadFootFormat); + if (!lcl_IsStartNodeInFormat(bHeader, pSttNode, pFrameFormatLeft, + pHeadFootFormat)) + { + if (!lcl_IsStartNodeInFormat(bHeader, pSttNode, pFrameFormatFirstMaster, + pHeadFootFormat)) + { + lcl_IsStartNodeInFormat(bHeader, pSttNode, pFrameFormatFirstLeft, pHeadFootFormat); + } + } } if (pHeadFootFormat) |