summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@suse.cz>2012-05-28 17:49:59 +0200
committerLuboš Luňák <l.lunak@suse.cz>2012-05-28 18:06:15 +0200
commit985f9740f76fb735ea99868cf6b0445811ef568f (patch)
treee3369ca23d38d20669f4f861ae7e5b16d1905a27 /sw/qa
parent5845298e615a599d5edc7c42275b52ae954250e8 (diff)
testcase for bnc#757118
Change-Id: I992c114669a9012a18982cf8cd313e3bdccdcb32
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/ww8tok/data/n757118.docbin0 -> 35840 bytes
-rw-r--r--sw/qa/extras/ww8tok/ww8tok.cxx33
2 files changed, 33 insertions, 0 deletions
diff --git a/sw/qa/extras/ww8tok/data/n757118.doc b/sw/qa/extras/ww8tok/data/n757118.doc
new file mode 100644
index 000000000000..2c69485212a1
--- /dev/null
+++ b/sw/qa/extras/ww8tok/data/n757118.doc
Binary files differ
diff --git a/sw/qa/extras/ww8tok/ww8tok.cxx b/sw/qa/extras/ww8tok/ww8tok.cxx
index fc9f650b24a5..08c77c0afdd3 100644
--- a/sw/qa/extras/ww8tok/ww8tok.cxx
+++ b/sw/qa/extras/ww8tok/ww8tok.cxx
@@ -27,6 +27,7 @@
#include "../swmodeltestbase.hxx"
+#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
#include <com/sun/star/table/BorderLine2.hpp>
#include <com/sun/star/table/TableBorder.hpp>
#include <com/sun/star/text/XDependentTextField.hpp>
@@ -46,6 +47,7 @@ public:
void testN760294();
void testN750255();
void testN652364();
+ void testN757118();
CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT)
@@ -53,6 +55,7 @@ public:
CPPUNIT_TEST(testN760294);
CPPUNIT_TEST(testN750255);
CPPUNIT_TEST(testN652364);
+ CPPUNIT_TEST(testN757118);
#endif
CPPUNIT_TEST_SUITE_END();
@@ -175,6 +178,36 @@ xray para2.PageStyleName
CPPUNIT_ASSERT_EQUAL( OUString( "Standard" ), pageStyle2 );
}
+void Test::testN757118()
+{
+ load( "n757118.doc" );
+/*
+Two pairs of horizontal rules (one absolute width, one relative width)
+have the same width (full page width, half page width).
+xray ThisComponent.DrawPage.getByIndex(0).BoundRect
+*/
+ uno::Reference<text::XTextDocument> textDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<drawing::XDrawPageSupplier> drawPageSupplier(textDocument, uno::UNO_QUERY);
+ uno::Reference<drawing::XDrawPage> drawPage = drawPageSupplier->getDrawPage();
+ uno::Reference<drawing::XShape> rule1, rule2, rule3, rule4;
+ drawPage->getByIndex(0) >>= rule1;
+ drawPage->getByIndex(1) >>= rule2;
+ drawPage->getByIndex(2) >>= rule3;
+ drawPage->getByIndex(3) >>= rule4;
+ uno::Reference<beans::XPropertySet> ruleProperties1(rule1, uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> ruleProperties2(rule2, uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> ruleProperties3(rule3, uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> ruleProperties4(rule4, uno::UNO_QUERY);
+ awt::Rectangle boundRect1, boundRect2, boundRect3, boundRect4;
+ ruleProperties1->getPropertyValue( "BoundRect" ) >>= boundRect1;
+ ruleProperties2->getPropertyValue( "BoundRect" ) >>= boundRect2;
+ ruleProperties3->getPropertyValue( "BoundRect" ) >>= boundRect3;
+ ruleProperties4->getPropertyValue( "BoundRect" ) >>= boundRect4;
+ // compare, allow for < 5 differences because of rounding errors
+ CPPUNIT_ASSERT( abs( boundRect1.Width - boundRect3.Width ) < 5 );
+ CPPUNIT_ASSERT( abs( boundRect2.Width - boundRect4.Width ) < 5 );
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT();