summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-10-22 08:50:40 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-10-22 08:52:22 +0200
commit9212cd18b9f2b32f2c2340701b010b678938b47a (patch)
treef10c56e3d67c2d79991fedd65be87576c805f9a3 /sw
parent9ecac3874d179b1d7aa6b45337001b1def06a9dd (diff)
sw: port two switchHeaderFooter() calls to DocxTableExportContext
These two APIs do the same, except that the previous doesn't handle nested calls, while the later does, as it stores its state on the stack. The idea is that once all calls to the previous are eliminated, we can get rid of it, reducing code duplication. Change-Id: I0162f3ab475e306734412b39d7166c4f0bc6cd7f
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx22
1 files changed, 9 insertions, 13 deletions
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 3ba8512b3845..9b0a164a7e69 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -483,14 +483,6 @@ void DocxAttributeOutput::EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pT
and VML Drawing in another AlternateContent.
**/
SetAlternateContentChoiceOpen( true );
- /** FDO#71834 :
- We should probably be renaming the function
- switchHeaderFooter to something like SaveRetrieveTableReference.
- Save the table reference attributes before calling WriteDMLTextFrame,
- otherwise the StartParagraph function will use the previous existing
- table reference attributes since the variable is being shared.
- */
- switchHeaderFooter(true,1);
/** Save the table info's before writing the shape
as there might be a new table that might get
spawned from within the VML & DML block and alter
@@ -500,7 +492,14 @@ void DocxAttributeOutput::EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pT
//Reset the table infos after saving.
m_rExport.mpTableInfo = ww8::WW8TableInfo::Pointer_t(new ww8::WW8TableInfo());
+ /** FDO#71834 :
+ Save the table reference attributes before calling WriteDMLTextFrame,
+ otherwise the StartParagraph function will use the previous existing
+ table reference attributes since the variable is being shared.
+ */
+ DocxTableExportContext aDMLTableExportContext(m_rExport.mpTableInfo, m_tableReference->m_bTableCellOpen, m_tableReference->m_nTableDepth);
m_rExport.SdrExporter().writeDMLTextFrame(&aFrame, m_anchorId++);
+ aDMLTableExportContext.restore(m_rExport.mpTableInfo, m_tableReference->m_bTableCellOpen, m_tableReference->m_nTableDepth);
m_pSerializer->endElementNS(XML_mc, XML_Choice);
SetAlternateContentChoiceOpen( false );
@@ -509,14 +508,11 @@ void DocxAttributeOutput::EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pT
// same table second time.
m_rExport.mpTableInfo = ww8::WW8TableInfo::Pointer_t(new ww8::WW8TableInfo());
//reset the tableReference.
- switchHeaderFooter(false,0);
m_pSerializer->startElementNS(XML_mc, XML_Fallback, FSEND);
+ DocxTableExportContext aVMLTableExportContext(m_rExport.mpTableInfo, m_tableReference->m_bTableCellOpen, m_tableReference->m_nTableDepth);
m_rExport.SdrExporter().writeVMLTextFrame(&aFrame);
- /* FDO#71834 :Restore the data here after having written the Shape
- for further processing.
- */
- switchHeaderFooter(false,-1);
+ aVMLTableExportContext.restore(m_rExport.mpTableInfo, m_tableReference->m_bTableCellOpen, m_tableReference->m_nTableDepth);
m_rExport.mpTableInfo = pOldTableInfo;
m_pSerializer->endElementNS(XML_mc, XML_Fallback);