diff options
author | umeshkadam <umesh.kadam@synerzip.com> | 2014-01-10 16:46:58 +0530 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-01-10 15:52:14 +0100 |
commit | 89a3acbdb590c3552a3184137ba0aad7f97f1549 (patch) | |
tree | d2025208b95a8bfd1a145287467a29c9648dc09a /sw/source | |
parent | 3a6fdd146a37a1dbdec56b6a1d4eff3a8a28a3f8 (diff) |
fdo#71834: Fix for floating table
Issue :
- When we have overlapping tables the first table gets
exported as a table and the second table gets exported
as a DML/VML shape.
- While exporting, the system starts with the table row &
the cell, within which it starts exporting the overlapped
table, while doing so the previous table attributes were
being referred since the variable was shared.
Implementation:
- Save and reset the table related attributes before
calling the WriteDMLTextFrame & writeVMLTextFrame
functions.
- Restore the table attributes for further processing after
having written the shape.
Conflicts:
sw/qa/extras/ooxmlexport/ooxmlexport.cxx
Reviewed on:
https://gerrit.libreoffice.org/7364
Change-Id: I0052a08c74ffbbebd3eb91a7075a43a4c225b670
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 34 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.hxx | 7 |
2 files changed, 37 insertions, 4 deletions
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 1606038bad80..26a7507aa3b2 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -368,6 +368,23 @@ void DocxAttributeOutput::EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pT m_pSerializer->startElementNS(XML_mc, XML_Choice, XML_Requires, "wps", FSEND); + /** 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 + the contents. + */ + ww8::WW8TableInfo::Pointer_t pOldTableInfo = m_rExport.mpTableInfo; + //Reset the table infos after saving. + m_rExport.mpTableInfo = ww8::WW8TableInfo::Pointer_t(new ww8::WW8TableInfo()); + WriteDMLTextFrame(pParentFrame); m_pSerializer->endElementNS(XML_mc, XML_Choice); @@ -375,9 +392,17 @@ void DocxAttributeOutput::EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pT // in case the text frame had table(s) and we try to export the // 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); m_rExport.SdrExporter().writeVMLTextFrame(pParentFrame); + /* FDO#71834 :Restore the data here after having written the Shape + for further processing. + */ + switchHeaderFooter(false,-1); + m_rExport.mpTableInfo = pOldTableInfo; + m_pSerializer->endElementNS(XML_mc, XML_Fallback); m_pSerializer->endElementNS(XML_mc, XML_AlternateContent); @@ -563,6 +588,9 @@ void DocxAttributeOutput::EndParagraphProperties( const boost::shared_ptr<SfxIte WriteCollectedParagraphProperties(); + // Merge the marks for the ordered elements + m_pSerializer->mergeTopMarks( ); + // Write 'Paragraph Mark' properties if ( pRedlineParagraphMarkerDeleted || pRedlineParagraphMarkerInserted || pParagraphMarkerProperties) { @@ -617,9 +645,6 @@ void DocxAttributeOutput::EndParagraphProperties( const boost::shared_ptr<SfxIte m_pSerializer->endElementNS( XML_w, XML_rPr ); } - // Merge the marks for the ordered elements - m_pSerializer->mergeTopMarks( ); - m_pSerializer->endElementNS( XML_w, XML_pPr ); if ( m_nColBreakStatus == COLBRK_WRITE ) @@ -2146,7 +2171,7 @@ void DocxAttributeOutput::switchHeaderFooter(bool isHeaderFooter, sal_Int32 inde } else if( index == -1) { - m_tableReference = m_oldTableReference; + *m_tableReference = *m_oldTableReference; } else { @@ -2154,6 +2179,7 @@ void DocxAttributeOutput::switchHeaderFooter(bool isHeaderFooter, sal_Int32 inde m_tableReference->m_nTableDepth = 0; } } + void DocxAttributeOutput::StartTable( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) { m_pSerializer->startElementNS( XML_w, XML_tbl, FSEND ); diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx index 53c0ce0bfddc..3375895d249f 100644 --- a/sw/source/filter/ww8/docxattributeoutput.hxx +++ b/sw/source/filter/ww8/docxattributeoutput.hxx @@ -116,6 +116,13 @@ struct TableReference m_nTableDepth(0) { } + + TableReference operator= (const TableReference& rhs) + { + m_bTableCellOpen = rhs.m_bTableCellOpen ; + m_nTableDepth = rhs.m_nTableDepth ; + return *this ; + } }; /// The class that has handlers for various resource types when exporting as DOCX. |