[Libreoffice-commits] .: sw/qa

Miklos Vajna vmiklos at kemper.freedesktop.org
Wed May 30 00:40:45 PDT 2012


 sw/qa/extras/ooxmltok/data/n760764.docx |binary
 sw/qa/extras/ooxmltok/ooxmltok.cxx      |   21 +++++++++++++++++++++
 2 files changed, 21 insertions(+)

New commits:
commit 3784063afcc344273821503694467100d3913d2d
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Wed May 30 09:38:27 2012 +0200

    n#760764 testcase
    
    Change-Id: I4d5cea0ae02fda751fb13b9c86684ccd70abf126

diff --git a/sw/qa/extras/ooxmltok/data/n760764.docx b/sw/qa/extras/ooxmltok/data/n760764.docx
new file mode 100644
index 0000000..5e479e2
Binary files /dev/null and b/sw/qa/extras/ooxmltok/data/n760764.docx differ
diff --git a/sw/qa/extras/ooxmltok/ooxmltok.cxx b/sw/qa/extras/ooxmltok/ooxmltok.cxx
index fb5e3d2..67d18ce 100644
--- a/sw/qa/extras/ooxmltok/ooxmltok.cxx
+++ b/sw/qa/extras/ooxmltok/ooxmltok.cxx
@@ -61,6 +61,7 @@ public:
     void testN747461();
     void testN750255();
     void testN652364();
+    void testN760764();
 
     CPPUNIT_TEST_SUITE(Test);
 #if !defined(MACOSX) && !defined(WNT)
@@ -76,6 +77,7 @@ public:
     CPPUNIT_TEST(testN747461);
     CPPUNIT_TEST(testN750255);
     CPPUNIT_TEST(testN652364);
+    CPPUNIT_TEST(testN760764);
 #endif
     CPPUNIT_TEST_SUITE_END();
 
@@ -403,6 +405,25 @@ xray para2.PageStyleName
     CPPUNIT_ASSERT_EQUAL( OUString( "Standard" ), pageStyle2 );
 }
 
+void Test::testN760764()
+{
+    load("n760764.docx");
+
+    uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
+    uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY);
+    uno::Reference<container::XEnumeration> xParaEnum(xParaEnumAccess->createEnumeration());
+    uno::Reference<container::XEnumerationAccess> xRunEnumAccess(xParaEnum->nextElement(), uno::UNO_QUERY);
+    uno::Reference<container::XEnumeration> xRunEnum(xRunEnumAccess->createEnumeration());
+
+    // Access the second run, which is a textfield
+    xRunEnum->nextElement();
+    uno::Reference<beans::XPropertySet> xRun(xRunEnum->nextElement(), uno::UNO_QUERY);
+    float fValue;
+    xRun->getPropertyValue("CharHeight") >>= fValue;
+    // This used to be 11, as character properties were ignored.
+    CPPUNIT_ASSERT_EQUAL(8.f, fValue);
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(Test);
 
 CPPUNIT_PLUGIN_IMPLEMENT();


More information about the Libreoffice-commits mailing list