summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorAdam Co <rattles2013@gmail.com>2013-08-20 18:27:41 +0300
committerCaolán McNamara <caolanm@redhat.com>2013-08-30 15:56:57 +0000
commit196328c91ee889a0a1cbc39ce2549c7405afbef5 (patch)
tree9b180b9507a583f2dd34fd3ab36f5df43ee6954e /sw/qa
parentd07e7d692ddd2a9ab956a59bcc0f676c7d76bc10 (diff)
fix for IsPlausibleSingleWordSection checking wrong condition
Conflicts: sw/qa/extras/ooxmlexport/ooxmlexport.cxx Change-Id: I503e5944079b6c03413caea27ef940efbd44ced5 Reviewed-on: https://gerrit.libreoffice.org/5548 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/ooxmlexport/data/fdo68418.docxbin0 -> 13897 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx18
2 files changed, 18 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/fdo68418.docx b/sw/qa/extras/ooxmlexport/data/fdo68418.docx
new file mode 100644
index 000000000000..10b7c009c2a5
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/fdo68418.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 0f1e500e5ca6..b9c5ba77fd77 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -113,6 +113,7 @@ public:
void testFdo67737();
void testTransparentShadow();
void testBnc834035();
+ void testFdo68418();
CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT)
@@ -202,6 +203,7 @@ void Test::run()
{"fdo67737.docx", &Test::testFdo67737},
{"transparent-shadow.docx", &Test::testTransparentShadow},
{"bnc834035.odt", &Test::testBnc834035},
+ {"fdo68418.docx", &Test::testFdo68418},
};
// Don't test the first import of these, for some reason those tests fail
const char* aBlacklist[] = {
@@ -1232,6 +1234,22 @@ void Test::testBnc834035()
assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:hyperlink", "anchor", "_Toc363553908");
}
+void Test::testFdo68418()
+{
+ // The problem was that in 'MSWordExportBase::SectionProperties' function in 'wrt8sty.cxx'
+ // it checked if it 'IsPlausableSingleWordSection'.
+ // The 'IsPlausableSingleWordSection' compared different aspects of 2 'SwFrmFmt' objects.
+ // One of the checks was 'do both formats have the same distance from the top and bottom ?'
+ // This check is correct if both have headers or both don't have headers.
+ // However - if one has a header, and the other one has an empty header (no header) - it is not correct to compare
+ // between them (same goes for 'footer').
+ uno::Reference<text::XText> xFooterText = getProperty< uno::Reference<text::XText> >(getStyles("PageStyles")->getByName(DEFAULT_STYLE), "FooterText");
+ uno::Reference< text::XTextRange > xFooterParagraph = getParagraphOfText( 1, xFooterText );
+
+ // First page footer is empty, second page footer is 'aaaa'
+ CPPUNIT_ASSERT_EQUAL(OUString("aaaa"), xFooterParagraph->getString()); // I get an error that it expects ''
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT();