sw/source/filter/ww8/docxattributeoutput.cxx |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 981c5b5421b5fc728e2b8140d7d52d8c8eb465e7
Author:     Justin Luth <justin.l...@collabora.com>
AuthorDate: Mon Apr 10 10:30:58 2023 -0400
Commit:     Justin Luth <jl...@mail.com>
CommitDate: Fri Apr 21 22:26:56 2023 +0200

    NFC tdf#154703 docx export: optimize/reorder "if TextBoxIsFramePr"
    
    -there is no need to run the long TextBoxIsFramePr function first,
    so start by evaluating the simple boolean case to avoid unnecessary 
processing.
    
    -reorder if/else to logically start with the small section.
    By doing so, it highlights that really we are doing something special
    when TextBoxIsFramePr and the else is the normal for anything else.
    
    Change-Id: Ic06826c2b6dcd5d89a6873784eb58b2d7bedaba4
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150770
    Tested-by: Jenkins
    Reviewed-by: Justin Luth <jl...@mail.com>

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 5590857f1c74..3b84ee2610d3 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -1019,7 +1019,12 @@ void DocxAttributeOutput::EndParagraph( 
ww8::WW8TableNodeInfoInner::Pointer_t pT
             ww8::Frame aFrame = m_aFramesOfParagraph.top()[nIndex];
             const SwFrameFormat& rFrameFormat = aFrame.GetFrameFormat();
 
-            if (!TextBoxIsFramePr(rFrameFormat) || m_bWritingHeaderFooter)
+            if (!m_bWritingHeaderFooter && TextBoxIsFramePr(rFrameFormat))
+            {
+                std::shared_ptr<ww8::Frame> pFramePr = 
std::make_shared<ww8::Frame>(aFrame);
+                aFramePrTextbox.push_back(pFramePr);
+            }
+            else
             {
                 if (m_aRunSdt.m_bStartedSdt)
                 {
@@ -1074,11 +1079,6 @@ void DocxAttributeOutput::EndParagraph( 
ww8::WW8TableNodeInfoInner::Pointer_t pT
                 m_pSerializer->endElementNS( XML_w, XML_r );
                 m_bParagraphFrameOpen = false;
             }
-            else
-            {
-                std::shared_ptr<ww8::Frame> pFramePr = 
std::make_shared<ww8::Frame>(aFrame);
-                aFramePrTextbox.push_back(pFramePr);
-            }
 
             nFrames = m_aFramesOfParagraph.size() ? 
m_aFramesOfParagraph.top().size() : 0;
         }

Reply via email to