[Libreoffice-commits] core.git: sw/qa sw/source
Tushar Bende
tushar.bende at synerzip.com
Wed Jan 22 00:41:46 PST 2014
sw/qa/extras/ooxmlexport/data/table-row-data-displayed-twice.docx |binary
sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 12 +++++++
sw/source/filter/ww8/docxattributeoutput.cxx | 3 +
sw/source/filter/ww8/wrtww8.hxx | 2 -
sw/source/filter/ww8/ww8atr.cxx | 17 +++++++---
5 files changed, 27 insertions(+), 7 deletions(-)
New commits:
commit 92414c42cdd03d4eda5dbb4fe1a95cfe1ce3e7e9
Author: Tushar Bende <tushar.bende at synerzip.com>
Date: Tue Jan 14 21:34:32 2014 +0530
fdo#73534 : Table row data was getting displayed twice after RT
There was a problem for some documents(containing table on page spanning across multiple pages
& pages having different Header-Footer type), during export Invalid sectPr was getting added
because of wrong condition check in the code.
Because of this:
1)Table row data was getting displayed twice after RT.
2)Increased number of pages after RT.
3)Header & footer were also divided into sections (like: Header-Section1 Footer-Section1 & Header-Section2 Footer-Section2).
Conflicts:
sw/qa/extras/ooxmlexport/ooxmlexport.cxx
Reviewed on:
https://gerrit.libreoffice.org/7440
Change-Id: I6c07e47321353e84af306c6285702852303ccee0
diff --git a/sw/qa/extras/ooxmlexport/data/table-row-data-displayed-twice.docx b/sw/qa/extras/ooxmlexport/data/table-row-data-displayed-twice.docx
new file mode 100644
index 0000000..00c63d8
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/table-row-data-displayed-twice.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 8bfc251..cdb228e 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -2570,6 +2570,18 @@ DECLARE_OOXMLEXPORT_TEST(testTOCFlag_u,"testTOCFlag_u.docx")
CPPUNIT_ASSERT(contents.match(" TOC \\z \\o \"1-9\" \\u \\h"));
}
+DECLARE_OOXMLEXPORT_TEST(testTableRowDataDisplayedTwice,"table-row-data-displayed-twice.docx")
+{
+ // fdo#73534: There was a problem for some documents during export.Invalid sectPr getting added
+ // because of wrong condition in code.
+ // This was the reason for increasing number of pages after RT
+ uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY);
+ uno::Reference<text::XTextViewCursorSupplier> xTextViewCursorSupplier(xModel->getCurrentController(), uno::UNO_QUERY);
+ uno::Reference<text::XPageCursor> xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY);
+ xCursor->jumpToLastPage();
+ CPPUNIT_ASSERT_EQUAL(sal_Int16(2), xCursor->getPage());
+}
+
#endif
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index c70a2a4..98b36f6 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -392,8 +392,9 @@ void DocxAttributeOutput::SectionBreaks(const SwTxtNode& rNode)
{
const SwTxtNode* pTxtNode = static_cast< SwTxtNode* >( &aNextIndex.GetNode() );
// If next node has no string - it is an empty node, so no need to output the section break
+
if (!pTxtNode->GetTxt().isEmpty())
- m_rExport.OutputSectionBreaks( pTxtNode->GetpSwAttrSet(), *pTxtNode );
+ m_rExport.OutputSectionBreaks( pTxtNode->GetpSwAttrSet(), *pTxtNode, m_tableReference->m_bTableCellOpen );
}
else if ( aNextIndex.GetNode().IsTableNode() )
{
diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index df34b50..06bff4b 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -693,7 +693,7 @@ public:
sal_uLong GetSectionLineNo( const SfxItemSet* pSet, const SwNode& rNd ) const;
/// Start new section.
- void OutputSectionBreaks( const SfxItemSet *pSet, const SwNode& rNd );
+ void OutputSectionBreaks( const SfxItemSet *pSet, const SwNode& rNd, bool isCellOpen = false);
/// Write section properties.
///
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 9dfc8dc..82a05c5 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -396,13 +396,12 @@ bool MSWordExportBase::SetAktPageDescFromNode(const SwNode &rNd)
// Es duerfen nur Funktionen gerufen werden, die nicht in den
// Ausgabebereich pO schreiben, da dieser nur einmal fuer CHP und PAP existiert
// und damit im falschen landen wuerden.
-void MSWordExportBase::OutputSectionBreaks( const SfxItemSet *pSet, const SwNode& rNd )
+void MSWordExportBase::OutputSectionBreaks( const SfxItemSet *pSet, const SwNode& rNd, bool isCellOpen)
{
if ( bStyDef || bOutKF || bInWriteEscher || bOutPageDescs )
return;
bBreakBefore = true;
-
bool bNewPageDesc = false;
const SfxPoolItem* pItem=0;
const SwFmtPageDesc *pPgDesc=0;
@@ -415,11 +414,19 @@ void MSWordExportBase::OutputSectionBreaks( const SfxItemSet *pSet, const SwNode
const SwPageDesc * pPageDesc = rNd.FindPageDesc(sal_False);
+ // Even if pAktPageDesc != pPageDesc ,it might be because of the different header & footer types.
if (pAktPageDesc != pPageDesc)
{
- bBreakSet = true;
- bNewPageDesc = true;
- pAktPageDesc = pPageDesc;
+ if (isCellOpen && (pAktPageDesc->GetName() != pPageDesc->GetName()))
+ {
+ // Table cell is open and page header types are different,so do not output section break.
+ }
+ else
+ {
+ bBreakSet = true;
+ bNewPageDesc = true;
+ pAktPageDesc = pPageDesc;
+ }
}
if ( pSet && pSet->Count() )
More information about the Libreoffice-commits
mailing list