summaryrefslogtreecommitdiff
path: root/sw/source/filter/ww8/docxattributeoutput.cxx
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2023-04-10 10:30:58 -0400
committerJustin Luth <jluth@mail.com>2023-04-21 22:26:56 +0200
commit981c5b5421b5fc728e2b8140d7d52d8c8eb465e7 (patch)
tree3f972d2de70aa68708a13ffd05ae475e512a6221 /sw/source/filter/ww8/docxattributeoutput.cxx
parent36db242816099bdc3ed2573df1230313056c552c (diff)
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 <jluth@mail.com>
Diffstat (limited to 'sw/source/filter/ww8/docxattributeoutput.cxx')
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx12
1 files changed, 6 insertions, 6 deletions
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;
}