summaryrefslogtreecommitdiff
path: root/sw/source/filter/ww8/docxattributeoutput.cxx
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2018-01-07 23:53:02 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2018-01-08 06:57:35 +0100
commit4f65853df16a599fe81576bbccbca6ea78488d54 (patch)
tree6c572bfccbd76914fe2949fcffc5810d62b1b13b /sw/source/filter/ww8/docxattributeoutput.cxx
parentdbf83d315acc454b576355f2e5bd8412586827ac (diff)
tdf#114882: don't try to close SDT when processing inner objects
Change-Id: Ib7e59e1a6c82d2d35a8466312a2571f76f2338b7 Reviewed-on: https://gerrit.libreoffice.org/47546 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sw/source/filter/ww8/docxattributeoutput.cxx')
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx40
1 files changed, 15 insertions, 25 deletions
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 3f6b78ef6932..fbcc5e634f2d 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -494,10 +494,10 @@ void DocxAttributeOutput::EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pT
otherwise the StartParagraph function will use the previous existing
table reference attributes since the variable is being shared.
*/
- DocxTableExportContext aDMLTableExportContext;
- pushToTableExportContext(aDMLTableExportContext);
- m_rExport.SdrExporter().writeDMLTextFrame(&aFrame, m_anchorId++);
- popFromTableExportContext(aDMLTableExportContext);
+ {
+ DocxTableExportContext aDMLTableExportContext(*this);
+ m_rExport.SdrExporter().writeDMLTextFrame(&aFrame, m_anchorId++);
+ }
m_pSerializer->endElementNS(XML_mc, XML_Choice);
SetAlternateContentChoiceOpen( false );
@@ -508,10 +508,10 @@ void DocxAttributeOutput::EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pT
//reset the tableReference.
m_pSerializer->startElementNS(XML_mc, XML_Fallback, FSEND);
- DocxTableExportContext aVMLTableExportContext;
- pushToTableExportContext(aVMLTableExportContext);
- m_rExport.SdrExporter().writeVMLTextFrame(&aFrame);
- popFromTableExportContext(aVMLTableExportContext);
+ {
+ DocxTableExportContext aVMLTableExportContext(*this);
+ m_rExport.SdrExporter().writeVMLTextFrame(&aFrame);
+ }
m_rExport.m_pTableInfo = pOldTableInfo;
m_pSerializer->endElementNS(XML_mc, XML_Fallback);
@@ -579,12 +579,10 @@ void DocxAttributeOutput::EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pT
{
for ( const auto & pFrame : aFramePrTextbox )
{
- DocxTableExportContext aTableExportContext;
- pushToTableExportContext(aTableExportContext);
+ DocxTableExportContext aTableExportContext(*this);
m_pCurrentFrame = pFrame.get();
m_rExport.SdrExporter().writeOnlyTextOfFrame(pFrame.get());
m_pCurrentFrame = nullptr;
- popFromTableExportContext(aTableExportContext);
}
aFramePrTextbox.clear();
}
@@ -5310,7 +5308,6 @@ void DocxAttributeOutput::WritePostponedCustomShape()
if (!m_pPostponedCustomShape)
return;
- bool bStartedParaSdt = m_bStartedParaSdt;
for( const auto & rPostponedDrawing : *m_pPostponedCustomShape)
{
if ( IsAlternateContentChoiceOpen() )
@@ -5318,7 +5315,6 @@ void DocxAttributeOutput::WritePostponedCustomShape()
else
m_rExport.SdrExporter().writeDMLAndVMLDrawing(rPostponedDrawing.object, *rPostponedDrawing.frame, m_anchorId++);
}
- m_bStartedParaSdt = bStartedParaSdt;
m_pPostponedCustomShape.reset(nullptr);
}
@@ -5331,7 +5327,6 @@ void DocxAttributeOutput::WritePostponedDMLDrawing()
std::unique_ptr< std::vector<PostponedDrawing> > pPostponedDMLDrawings(m_pPostponedDMLDrawings.release());
std::unique_ptr< std::vector<PostponedOLE> > pPostponedOLEs(m_pPostponedOLEs.release());
- bool bStartedParaSdt = m_bStartedParaSdt;
for( const auto & rPostponedDrawing : *pPostponedDMLDrawings )
{
// Avoid w:drawing within another w:drawing.
@@ -5340,7 +5335,6 @@ void DocxAttributeOutput::WritePostponedDMLDrawing()
else
m_rExport.SdrExporter().writeDMLAndVMLDrawing(rPostponedDrawing.object, *rPostponedDrawing.frame, m_anchorId++);
}
- m_bStartedParaSdt = bStartedParaSdt;
m_pPostponedOLEs = std::move(pPostponedOLEs);
}
@@ -5393,7 +5387,6 @@ void DocxAttributeOutput::OutputFlyFrame_Impl( const ww8::Frame &rFrame, const P
{
if (!m_pPostponedDMLDrawings)
{
- bool bStartedParaSdt = m_bStartedParaSdt;
if ( IsAlternateContentChoiceOpen() )
{
// Do not write w:drawing inside w:drawing. Instead Postpone the Inner Drawing.
@@ -5404,7 +5397,6 @@ void DocxAttributeOutput::OutputFlyFrame_Impl( const ww8::Frame &rFrame, const P
}
else
m_rExport.SdrExporter().writeDMLAndVMLDrawing( pSdrObj, rFrame.GetFrameFormat(), m_anchorId++);
- m_bStartedParaSdt = bStartedParaSdt;
m_bPostponedProcessingFly = false ;
}
@@ -5579,6 +5571,9 @@ void DocxAttributeOutput::pushToTableExportContext(DocxTableExportContext& rCont
rContext.m_nTableDepth = m_tableReference->m_nTableDepth;
m_tableReference->m_nTableDepth = 0;
+
+ rContext.m_bStartedParaSdt = m_bStartedParaSdt;
+ m_bStartedParaSdt = false;
}
void DocxAttributeOutput::popFromTableExportContext(DocxTableExportContext const & rContext)
@@ -5586,32 +5581,27 @@ void DocxAttributeOutput::popFromTableExportContext(DocxTableExportContext const
m_rExport.m_pTableInfo = rContext.m_pTableInfo;
m_tableReference->m_bTableCellOpen = rContext.m_bTableCellOpen;
m_tableReference->m_nTableDepth = rContext.m_nTableDepth;
+ m_bStartedParaSdt = rContext.m_bStartedParaSdt;
}
void DocxAttributeOutput::WriteTextBox(uno::Reference<drawing::XShape> xShape)
{
- DocxTableExportContext aTableExportContext;
- pushToTableExportContext(aTableExportContext);
+ DocxTableExportContext aTableExportContext(*this);
SwFrameFormat* pTextBox = SwTextBoxHelper::getOtherTextBoxFormat(xShape);
const SwPosition* pAnchor = pTextBox->GetAnchor().GetContentAnchor();
ww8::Frame aFrame(*pTextBox, *pAnchor);
m_rExport.SdrExporter().writeDMLTextFrame(&aFrame, m_anchorId++, /*bTextBoxOnly=*/true);
-
- popFromTableExportContext(aTableExportContext);
}
void DocxAttributeOutput::WriteVMLTextBox(uno::Reference<drawing::XShape> xShape)
{
- DocxTableExportContext aTableExportContext;
- pushToTableExportContext(aTableExportContext);
+ DocxTableExportContext aTableExportContext(*this);
SwFrameFormat* pTextBox = SwTextBoxHelper::getOtherTextBoxFormat(xShape);
const SwPosition* pAnchor = pTextBox->GetAnchor().GetContentAnchor();
ww8::Frame aFrame(*pTextBox, *pAnchor);
m_rExport.SdrExporter().writeVMLTextFrame(&aFrame, /*bTextBoxOnly=*/true);
-
- popFromTableExportContext(aTableExportContext);
}
oox::drawingml::DrawingML& DocxAttributeOutput::GetDrawingML()