diff options
author | Justin Luth <justin.luth@collabora.com> | 2023-04-11 11:19:56 -0400 |
---|---|---|
committer | Justin Luth <jluth@mail.com> | 2023-04-13 21:04:12 +0200 |
commit | 499247966af565071542f1cdfa882d6b8e6c33f0 (patch) | |
tree | ff0748438df1199a8cab5a05a29fb7426553451a /sw/source/filter/ww8/docxattributeoutput.cxx | |
parent | 6cd14af780efb5704538622b6d95c2a1ba3dc7dc (diff) |
NFC tdf#154703 docx export framePr: cleanup prep before patch
This sets up the building blocks for a series of patches.
Lets get this formatting/renaming stuff out of the way first
so that we can focus on the actual logic changes later on.
Change-Id: I20aa333080d9f31af4f4b9e89a51eafba1d39530
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150354
Reviewed-by: Justin Luth <jluth@mail.com>
Tested-by: Jenkins
Diffstat (limited to 'sw/source/filter/ww8/docxattributeoutput.cxx')
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 8f7a5b9d7bf1..06915e5c4b17 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -575,6 +575,12 @@ OString DocxAttributeOutput::convertToOOXMLHoriOrientRel(sal_Int16 nOrientRel) } } +void FramePrHelper::SetFrame(ww8::Frame* pFrame) +{ + assert(!pFrame || !m_pFrame); + m_pFrame = pFrame; +} + void SdtBlockHelper::DeleteAndResetTheLists() { if (m_pTokenChildren.is() ) @@ -1099,9 +1105,9 @@ void DocxAttributeOutput::EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pT for ( const auto & pFrame : aFramePrTextbox ) { DocxTableExportContext aTableExportContext(*this); - m_pCurrentFrame = pFrame.get(); + m_aFramePr.SetFrame(pFrame.get()); m_rExport.SdrExporter().writeOnlyTextOfFrame(pFrame.get()); - m_pCurrentFrame = nullptr; + m_aFramePr.SetFrame(nullptr); } m_pSerializer->mergeTopMarks(Tag_StartParagraph_2, sax_fastparser::MergeMarks::PREPEND); @@ -1477,16 +1483,14 @@ void DocxAttributeOutput::EndParagraphProperties(const SfxItemSet& rParagraphMar m_pSerializer->mergeTopMarks(Tag_InitCollectedRunProperties); m_pSerializer->endElementNS( XML_w, XML_rPr ); - if (!m_bWritingHeaderFooter && m_pCurrentFrame) + if (!m_bWritingHeaderFooter && m_aFramePr.Frame()) { - const SwFrameFormat& rFrameFormat = m_pCurrentFrame->GetFrameFormat(); - const SvxBoxItem& rBox = rFrameFormat.GetBox(); - if (TextBoxIsFramePr(rFrameFormat)) - { - const Size aSize = m_pCurrentFrame->GetSize(); - PopulateFrameProperties(&rFrameFormat, aSize); - FormatBox(rBox); - } + const SwFrameFormat& rFrameFormat = m_aFramePr.Frame()->GetFrameFormat(); + assert(TextBoxIsFramePr(rFrameFormat) && "by definition, because Frame()"); + + const Size aSize = m_aFramePr.Frame()->GetSize(); + PopulateFrameProperties(&rFrameFormat, aSize); + FormatBox(rFrameFormat.GetBox()); } m_pSerializer->endElementNS( XML_w, XML_pPr ); @@ -9852,7 +9856,6 @@ DocxAttributeOutput::DocxAttributeOutput( DocxExport &rExport, const FSHelperPtr m_nNextAnnotationMarkId( 0 ), m_nEmbedFlyLevel(0), m_pMoveRedlineData(nullptr), - m_pCurrentFrame( nullptr ), m_bParagraphOpened( false ), m_bParagraphFrameOpen( false ), m_bIsFirstParagraph( true ), |