summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorAdam Co <rattles2013@gmail.com>2013-07-21 16:27:45 +0300
committerFridrich Strba <fridrich@documentfoundation.org>2013-07-22 20:28:30 +0000
commit2d5978b22b402dea9dee5b468d2044ccc1208a15 (patch)
treecb0fb438dd3d6823320db7fa1f64d2de5f290504 /sw
parentf4546b72702dbe30505594a8307dd402e81a0303 (diff)
fdo#66145: fix for FirstIsShared flag
Change-Id: Id8cc3829ccd5806295b0f240a570dc1d66ed0c87 Reviewed-on: https://gerrit.libreoffice.org/5002 Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org> Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlexport/data/fdo66145.docxbin0 -> 16245 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx9
-rw-r--r--sw/source/core/doc/docdesc.cxx10
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx4
4 files changed, 21 insertions, 2 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/fdo66145.docx b/sw/qa/extras/ooxmlexport/data/fdo66145.docx
new file mode 100644
index 000000000000..62ffdbe22e98
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/fdo66145.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index ea460588c9b6..afaa0610bb91 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -96,6 +96,7 @@ public:
void testFdo58577();
void testBnc581614();
void testFdo66929();
+ void testFdo66145();
void testPageBorderSpacingExportCase2();
CPPUNIT_TEST_SUITE(Test);
@@ -162,6 +163,7 @@ void Test::run()
{"fdo43093.docx", &Test::testFdo43093},
{"fdo64238_a.docx", &Test::testFdo64238_a},
{"fdo64238_b.docx", &Test::testFdo64238_b},
+ {"fdo66145.docx", &Test::testFdo66145},
{"fdo56679.docx", &Test::testFdo56679},
{"fdo65400.docx", &Test::testFdo65400},
{"fdo66543.docx", &Test::testFdo66543},
@@ -1003,6 +1005,13 @@ void Test::testPageBorderSpacingExportCase2()
assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:pgBorders/w:right", "space", "24");
}
+void Test::testFdo66145()
+{
+ // The Writer ignored the 'First Is Shared' flag
+ uno::Reference<beans::XPropertySet> xPropertySet(getStyles("PageStyles")->getByName("First Page"), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(false, bool(getProperty<sal_Bool>(xPropertySet, "FirstIsShared")));
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx
index 920853f6b463..67f2d18f5d00 100644
--- a/sw/source/core/doc/docdesc.cxx
+++ b/sw/source/core/doc/docdesc.cxx
@@ -189,7 +189,15 @@ void SwDoc::CopyMasterHeader(const SwPageDesc &rChged, const SwFmtHeader &rHead,
const SwFrmFmt *pRight = rHead.GetHeaderFmt();
const SwFmtCntnt &aRCnt = pRight->GetCntnt();
const SwFmtCntnt &aCnt = rFmtHead.GetHeaderFmt()->GetCntnt();
- if( !aCnt.GetCntntIdx() )
+
+ // In case "PROP_FIRST_IS_SHARED" (writefilter) is set and headerFmt has 'cntnt' node,
+ // Already anchored node is original fmt.
+ // But at this part, change startnode(below create new pSttNd).
+ // Because of this, fdo45183.rtf(sw/qa/extras/rtfimport/data/fdo45183.rtf) cannot draw picture.
+ // Compare module is sw/source/core/layout/frmtool.cxx : AppendObjs() function.
+ // In this function, because selected node index and anchored node index aren't equal, don't draw object.
+ // So, If (aCnt.GetCntntIdx() && !bLeft) - use the original headerFmt.
+ if( !aCnt.GetCntntIdx() || !bLeft )
{
const SwFrmFmt& rChgedFrmFmt = (bLeft ? rChged.GetLeft() : rChged.GetFirst());
rDescFrmFmt.SetFmtAttr( rChgedFrmFmt.GetHeader() );
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 1f01d7ba1043..f4a56087b468 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -422,7 +422,9 @@ void DocxAttributeOutput::StartParagraphProperties( const SwTxtNode& rNode )
if ( aNextIndex.GetNode().IsTxtNode() )
{
const SwTxtNode* pTxtNode = static_cast< SwTxtNode* >( &aNextIndex.GetNode() );
- m_rExport.OutputSectionBreaks( pTxtNode->GetpSwAttrSet(), *pTxtNode );
+ // 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 );
}
else if ( aNextIndex.GetNode().IsTableNode() )
{