summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-07-07 17:12:50 +0100
committerCaolán McNamara <caolanm@redhat.com>2021-07-07 22:11:44 +0200
commited2d309b5ccdaa1a58f37f70a00ad74452e163cd (patch)
tree82710f1aef307af774555de63222a3c327f97eab /sw/source
parent7d180d713392b98e40bc3778d9434a9b6fd0aa8b (diff)
make code a little clearer to indicate that pAnchor isn't leaked
Change-Id: I656a8c8506d7905ece3ff1b0547c82c42b234ab6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118585 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index bbf4994a1d05..f5978957635c 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -6450,7 +6450,8 @@ void DocxAttributeOutput::WriteTextBox(uno::Reference<drawing::XShape> xShape)
SwFrameFormat* pTextBox = SwTextBoxHelper::getOtherTextBoxFormat(xShape);
assert(pTextBox);
const SwPosition* pAnchor = nullptr;
- if (pTextBox->GetAnchor().GetAnchorId() == RndStdIds::FLY_AT_PAGE) //tdf135711
+ const bool bFlyAtPage = pTextBox->GetAnchor().GetAnchorId() == RndStdIds::FLY_AT_PAGE;
+ if (bFlyAtPage) //tdf135711
{
auto pNdIdx = pTextBox->GetContent().GetContentIdx();
if (pNdIdx) //Is that possible it is null?
@@ -6465,7 +6466,7 @@ void DocxAttributeOutput::WriteTextBox(uno::Reference<drawing::XShape> xShape)
{
ww8::Frame aFrame(*pTextBox, *pAnchor);
m_rExport.SdrExporter().writeDMLTextFrame(&aFrame, m_anchorId++, /*bTextBoxOnly=*/true);
- if (pTextBox->GetAnchor().GetAnchorId() == RndStdIds::FLY_AT_PAGE)
+ if (bFlyAtPage)
{
delete pAnchor;
}