writerfilter/source/rtftok/rtfdocumentimpl.cxx |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 0ce7c7a64fbc1b5c15dd6887c31ca7c93b069ff7
Author:     Justin Luth <justin.l...@collabora.com>
AuthorDate: Thu Dec 28 15:32:00 2023 -0500
Commit:     Justin Luth <jl...@mail.com>
CommitDate: Tue Jan 2 23:16:04 2024 +0100

    rtf writerfilter: calculate if frame hasProperties once
    
    Change-Id: I0a5888b73a4eccb84f4eae6613519d877e550a17
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161390
    Reviewed-by: Justin Luth <jl...@mail.com>
    Tested-by: Jenkins

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 33b90aa9b5ca..c7624da50012 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -589,8 +589,9 @@ void RTFDocumentImpl::checkNeedPap()
             NS_ooxml::LN_Value_ST_StyleType_paragraph));
 
         // Writer will ignore a page break before a text frame, so guard it 
with empty paragraphs
+        const bool bIsInFrame = m_aStates.top().getFrame().hasProperties();
         bool hasBreakBeforeFrame
-            = m_aStates.top().getFrame().hasProperties()
+            = bIsInFrame
               && 
m_aStates.top().getParagraphSprms().find(NS_ooxml::LN_CT_PPrBase_pageBreakBefore);
         if (hasBreakBeforeFrame)
         {
@@ -601,7 +602,7 @@ void RTFDocumentImpl::checkNeedPap()
         if (hasBreakBeforeFrame)
             dispatchSymbol(RTFKeyword::PAR);
 
-        if (m_aStates.top().getFrame().hasProperties())
+        if (bIsInFrame)
         {
             writerfilter::Reference<Properties>::Pointer_t const 
pFrameProperties(
                 new RTFReferenceProperties(RTFSprms(), 
m_aStates.top().getFrame().getSprms()));

Reply via email to