From ea358f5d5b04a2a8e11a73d35643cd0afc5cb63b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolnai=20Tam=C3=A1s?= Date: Tue, 13 Aug 2013 18:04:14 +0200 Subject: [PATCH] CharBrd 8.2: Tests for UNO API and ODF filter Use just those API tests which still alive. Export filter test use import so no need for distinct import tests. Change-Id: Idddc2ece10e20027551538f4e8c224edffa9bfe8 --- .../com.sun.star.comp.office.SwXCellRange.csv | 9 + ...com.sun.star.comp.office.SwXTextCursor.csv | 9 + .../com.sun.star.comp.office.SwXTextRange.csv | 9 + ...un.star.comp.office.SwXTextTableCursor.csv | 9 + ...sun.star.comp.office.SwXTextViewCursor.csv | 9 + .../sw/com.sun.star.style.CharacterStyle.csv | 9 + sw/qa/extras/inc/swmodeltestbase.hxx | 27 +++ sw/qa/extras/odfexport/data/charborder.odt | Bin 0 -> 8841 bytes sw/qa/extras/odfexport/odfexport.cxx | 176 ++++++++++++++++++ 9 files changed, 257 insertions(+) create mode 100644 sw/qa/extras/odfexport/data/charborder.odt diff --git a/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXCellRange.csv b/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXCellRange.csv index 13c319cf4720..bbf37c193e67 100644 --- a/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXCellRange.csv +++ b/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXCellRange.csv @@ -134,6 +134,15 @@ "SwXCellRange";"com::sun::star::style::CharacterProperties";"CharStyleNames#optional" "SwXCellRange";"com::sun::star::style::CharacterProperties";"CharHidden#optional" "SwXCellRange";"com::sun::star::style::CharacterProperties";"TextUserDefinedAttributes#optional" +"SwXCellRange";"com::sun::star::style::CharacterProperties";"CharLeftBorder#optional" +"SwXCellRange";"com::sun::star::style::CharacterProperties";"CharRightBorder#optional" +"SwXCellRange";"com::sun::star::style::CharacterProperties";"CharBottomBorder#optional" +"SwXCellRange";"com::sun::star::style::CharacterProperties";"CharTopBorder#optional" +"SwXCellRange";"com::sun::star::style::CharacterProperties";"CharBorderDistance#optional" +"SwXCellRange";"com::sun::star::style::CharacterProperties";"CharLeftBorderDistance#optional" +"SwXCellRange";"com::sun::star::style::CharacterProperties";"CharRightBorderDistance#optional" +"SwXCellRange";"com::sun::star::style::CharacterProperties";"CharBottomBorderDistance#optional" +"SwXCellRange";"com::sun::star::style::CharacterProperties";"CharTopBorderDistance#optional" "SwXCellRange";"com::sun::star::sheet::XCellRangeData#optional";"getDataArray()" "SwXCellRange";"com::sun::star::sheet::XCellRangeData#optional";"setDataArray()" "SwXCellRange";"com::sun::star::style::ParagraphPropertiesAsian#optional";"ParaIsHangingPunctuation" diff --git a/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXTextCursor.csv b/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXTextCursor.csv index 4082ae2c74d8..fd964f8ef408 100644 --- a/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXTextCursor.csv +++ b/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXTextCursor.csv @@ -156,6 +156,15 @@ "SwXTextCursor";"com::sun::star::style::CharacterProperties";"CharStyleNames#optional" "SwXTextCursor";"com::sun::star::style::CharacterProperties";"CharHidden#optional" "SwXTextCursor";"com::sun::star::style::CharacterProperties";"TextUserDefinedAttributes#optional" +"SwXTextCursor";"com::sun::star::style::CharacterProperties";"CharLeftBorder#optional" +"SwXTextCursor";"com::sun::star::style::CharacterProperties";"CharRightBorder#optional" +"SwXTextCursor";"com::sun::star::style::CharacterProperties";"CharBottomBorder#optional" +"SwXTextCursor";"com::sun::star::style::CharacterProperties";"CharTopBorder#optional" +"SwXTextCursor";"com::sun::star::style::CharacterProperties";"CharBorderDistance#optional" +"SwXTextCursor";"com::sun::star::style::CharacterProperties";"CharLeftBorderDistance#optional" +"SwXTextCursor";"com::sun::star::style::CharacterProperties";"CharRightBorderDistance#optional" +"SwXTextCursor";"com::sun::star::style::CharacterProperties";"CharBottomBorderDistance#optional" +"SwXTextCursor";"com::sun::star::style::CharacterProperties";"CharTopBorderDistance#optional" "SwXTextCursor";"com::sun::star::document::XDocumentInsertable#optional";"insertDocumentFromURL()" "SwXTextCursor";"com::sun::star::beans::XPropertySet";"getPropertySetInfo()" "SwXTextCursor";"com::sun::star::beans::XPropertySet";"setPropertyValue()" diff --git a/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXTextRange.csv b/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXTextRange.csv index c93369af74f3..261865374e2e 100644 --- a/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXTextRange.csv +++ b/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXTextRange.csv @@ -130,6 +130,15 @@ "SwXTextRange";"com::sun::star::style::CharacterProperties";"CharStyleNames#optional" "SwXTextRange";"com::sun::star::style::CharacterProperties";"CharHidden#optional" "SwXTextRange";"com::sun::star::style::CharacterProperties";"TextUserDefinedAttributes#optional" +"SwXTextRange";"com::sun::star::style::CharacterProperties";"CharLeftBorder#optional" +"SwXTextRange";"com::sun::star::style::CharacterProperties";"CharRightBorder#optional" +"SwXTextRange";"com::sun::star::style::CharacterProperties";"CharBottomBorder#optional" +"SwXTextRange";"com::sun::star::style::CharacterProperties";"CharTopBorder#optional" +"SwXTextRange";"com::sun::star::style::CharacterProperties";"CharBorderDistance#optional" +"SwXTextRange";"com::sun::star::style::CharacterProperties";"CharLeftBorderDistance#optional" +"SwXTextRange";"com::sun::star::style::CharacterProperties";"CharRightBorderDistance#optional" +"SwXTextRange";"com::sun::star::style::CharacterProperties";"CharBottomBorderDistance#optional" +"SwXTextRange";"com::sun::star::style::CharacterProperties";"CharTopBorderDistance#optional" "SwXTextRange";"com::sun::star::beans::XPropertySet";"getPropertySetInfo()" "SwXTextRange";"com::sun::star::beans::XPropertySet";"setPropertyValue()" "SwXTextRange";"com::sun::star::beans::XPropertySet";"getPropertyValue()" diff --git a/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXTextTableCursor.csv b/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXTextTableCursor.csv index 2f2e52f42508..b2fbb91c2f2b 100644 --- a/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXTextTableCursor.csv +++ b/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXTextTableCursor.csv @@ -133,6 +133,15 @@ "SwXTextTableCursor";"com::sun::star::style::CharacterProperties";"CharStyleNames#optional" "SwXTextTableCursor";"com::sun::star::style::CharacterProperties";"CharHidden#optional" "SwXTextTableCursor";"com::sun::star::style::CharacterProperties";"TextUserDefinedAttributes#optional" +"SwXTextTableCursor";"com::sun::star::style::CharacterProperties";"CharLeftBorder#optional" +"SwXTextTableCursor";"com::sun::star::style::CharacterProperties";"CharRightBorder#optional" +"SwXTextTableCursor";"com::sun::star::style::CharacterProperties";"CharBottomBorder#optional" +"SwXTextTableCursor";"com::sun::star::style::CharacterProperties";"CharTopBorder#optional" +"SwXTextTableCursor";"com::sun::star::style::CharacterProperties";"CharBorderDistance#optional" +"SwXTextTableCursor";"com::sun::star::style::CharacterProperties";"CharLeftBorderDistance#optional" +"SwXTextTableCursor";"com::sun::star::style::CharacterProperties";"CharRightBorderDistance#optional" +"SwXTextTableCursor";"com::sun::star::style::CharacterProperties";"CharBottomBorderDistance#optional" +"SwXTextTableCursor";"com::sun::star::style::CharacterProperties";"CharTopBorderDistance#optional" "SwXTextTableCursor";"com::sun::star::beans::XPropertySet";"getPropertySetInfo()" "SwXTextTableCursor";"com::sun::star::beans::XPropertySet";"setPropertyValue()" "SwXTextTableCursor";"com::sun::star::beans::XPropertySet";"getPropertyValue()" diff --git a/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXTextViewCursor.csv b/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXTextViewCursor.csv index 524fd0f3299b..6ecd7ca2b1bd 100644 --- a/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXTextViewCursor.csv +++ b/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXTextViewCursor.csv @@ -166,6 +166,15 @@ "SwXTextViewCursor";"com::sun::star::style::CharacterProperties";"CharStyleNames#optional" "SwXTextViewCursor";"com::sun::star::style::CharacterProperties";"CharHidden#optional" "SwXTextViewCursor";"com::sun::star::style::CharacterProperties";"TextUserDefinedAttributes#optional" +"SwXTextViewCursor";"com::sun::star::style::CharacterProperties";"CharLeftBorder#optional" +"SwXTextViewCursor";"com::sun::star::style::CharacterProperties";"CharRightBorder#optional" +"SwXTextViewCursor";"com::sun::star::style::CharacterProperties";"CharBottomBorder#optional" +"SwXTextViewCursor";"com::sun::star::style::CharacterProperties";"CharTopBorder#optional" +"SwXTextViewCursor";"com::sun::star::style::CharacterProperties";"CharBorderDistance#optional" +"SwXTextViewCursor";"com::sun::star::style::CharacterProperties";"CharLeftBorderDistance#optional" +"SwXTextViewCursor";"com::sun::star::style::CharacterProperties";"CharRightBorderDistance#optional" +"SwXTextViewCursor";"com::sun::star::style::CharacterProperties";"CharBottomBorderDistance#optional" +"SwXTextViewCursor";"com::sun::star::style::CharacterProperties";"CharTopBorderDistance#optional" "SwXTextViewCursor";"com::sun::star::document::XDocumentInsertable#optional";"insertDocumentFromURL()" "SwXTextViewCursor";"com::sun::star::beans::XPropertySet";"getPropertySetInfo()" "SwXTextViewCursor";"com::sun::star::beans::XPropertySet";"setPropertyValue()" diff --git a/qadevOOo/objdsc/sw/com.sun.star.style.CharacterStyle.csv b/qadevOOo/objdsc/sw/com.sun.star.style.CharacterStyle.csv index f9dbb50ff760..c7d16cda2f99 100644 --- a/qadevOOo/objdsc/sw/com.sun.star.style.CharacterStyle.csv +++ b/qadevOOo/objdsc/sw/com.sun.star.style.CharacterStyle.csv @@ -92,6 +92,15 @@ "CharacterStyle";"com::sun::star::style::CharacterProperties";"CharStyleNames#optional" "CharacterStyle";"com::sun::star::style::CharacterProperties";"CharHidden#optional" "CharacterStyle";"com::sun::star::style::CharacterProperties";"TextUserDefinedAttributes#optional" +"CharacterStyle";"com::sun::star::style::CharacterProperties";"CharLeftBorder#optional" +"CharacterStyle";"com::sun::star::style::CharacterProperties";"CharRightBorder#optional" +"CharacterStyle";"com::sun::star::style::CharacterProperties";"CharBottomBorder#optional" +"CharacterStyle";"com::sun::star::style::CharacterProperties";"CharTopBorder#optional" +"CharacterStyle";"com::sun::star::style::CharacterProperties";"CharBorderDistance#optional" +"CharacterStyle";"com::sun::star::style::CharacterProperties";"CharLeftBorderDistance#optional" +"CharacterStyle";"com::sun::star::style::CharacterProperties";"CharRightBorderDistance#optional" +"CharacterStyle";"com::sun::star::style::CharacterProperties";"CharBottomBorderDistance#optional" +"CharacterStyle";"com::sun::star::style::CharacterProperties";"CharTopBorderDistance#optional" "CharacterStyle";"com::sun::star::beans::XPropertySet";"getPropertySetInfo()" "CharacterStyle";"com::sun::star::beans::XPropertySet";"setPropertyValue()" "CharacterStyle";"com::sun::star::beans::XPropertySet";"getPropertyValue()" diff --git a/sw/qa/extras/inc/swmodeltestbase.hxx b/sw/qa/extras/inc/swmodeltestbase.hxx index 38c5a47b01d5..9bd8a46a0cd6 100644 --- a/sw/qa/extras/inc/swmodeltestbase.hxx +++ b/sw/qa/extras/inc/swmodeltestbase.hxx @@ -10,12 +10,15 @@ #include #include #include +#include +#include #include #include #include #include #include #include +#include #include #include @@ -120,6 +123,15 @@ protected: return xStyleFamily; } + /// Get a family of auto styles, see com.sun.star.style.StyleFamilies for possible values. + uno::Reference getAutoStyles(OUString aFamily) + { + uno::Reference< style::XAutoStylesSupplier > xAutoStylesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference< style::XAutoStyles > xAutoStyles(xAutoStylesSupplier->getAutoStyles()); + uno::Reference< style::XAutoStyleFamily > xAutoStyleFamily(xAutoStyles->getByName(aFamily), uno::UNO_QUERY); + return xAutoStyleFamily; + } + /** * Extract a value from the layout dump using an XPath expression and an attribute name. * @@ -326,6 +338,21 @@ protected: return xCursor->getPage(); } + void assertEqualBorder( + const table::BorderLine2& rLeft, const sal_Int32 nLeftDist, + const table::BorderLine2& rRight, const sal_Int32 nRightDist ) + { + // Border + CPPUNIT_ASSERT_EQUAL(rLeft.Color, rRight.Color); + CPPUNIT_ASSERT_EQUAL(rLeft.InnerLineWidth, rRight.InnerLineWidth); + CPPUNIT_ASSERT_EQUAL(rLeft.LineDistance, rRight.LineDistance); + CPPUNIT_ASSERT_EQUAL(rLeft.LineStyle, rRight.LineStyle); + CPPUNIT_ASSERT_EQUAL(rLeft.LineWidth, rRight.LineWidth); + CPPUNIT_ASSERT_EQUAL(rLeft.OuterLineWidth, rRight.OuterLineWidth); + // Padding + CPPUNIT_ASSERT_EQUAL(nLeftDist, nRightDist); + } + uno::Reference mxComponent; xmlBufferPtr mpXmlBuffer; diff --git a/sw/qa/extras/odfexport/data/charborder.odt b/sw/qa/extras/odfexport/data/charborder.odt new file mode 100644 index 0000000000000000000000000000000000000000..9f37d58b76c16a225f6059682532226e9c45df4b GIT binary patch literal 8841 zcmeHtWmH_tvM_`YB)A5L5P~zfI|O%k2^p9HX0SnmyIXJxL4#}XU?Io^_uvpb!QJJ9 zbKiMK-aYsG{nmOlYg_lO>OIv})g`T_i1e5M0Ra^O0ZSWG%A}hUgB}3^;o-P%LV$oF zK-gP*pt-%hE!e^w2DXC&T%d2*?983OPHcAeKh-*G9%?YFkUg+sP!xJL4wY5!HMhCnka-~4a9)1!d4ZddP zUIOU-`b9m$Y^$=Ok4J`&hwn$JfGAyF@#^A@WwSsne5O?dP?B`}5 z7zbWKNz>w{fv72T?&sUH-5OQ@#feYY*11Vu4R6O~Sg*2pk0msesfIGe+U%FUW(c_+ zngdK*n?25;bhM6~#lI}Pyl(nax%&G0s;jG2KL}qO|I*AIY4E;rH#J>MWY)#P!s6xS z9lS?xY;3HotZZp9{(g3P>f+)O92_j_b8Ey4hr^i#@QbyTsn+7eJkRZ+P$&cfadUHX za5xx9=d-Y|pi97}5;baet0J#%Yx9A@YHDkp-Q4uPD-tEM88c}oy7#Uxnhb8t&J^ay zz+Tg4zIx9hz- zv-PuW0s;clf~B+^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7A4+3?2nrcS67bqUcC`97}=)5f9C4ejM-=;@@g zc0TZUhed`G5E%5rC$#)fe{iQSn6=JrhSGm$C<#6xCJ1IO=oX$h&%^6S(8kNB0*O{0DwoGnv zNPK7@jeuFC=N6-tXhy~tX66aRsa1ys<;badTbMnfNC9Z()OQqb`C&=5X^f{K6sCns z>lkeraEh6*xO#{tXemrDU{|4JVA5H1b~h?Sw6$QOmKAa(m=+@+CS=}2NR;kxJ} zKdD>i=yqimY!itr;);gg`Qk&KzT*j0h!*V1)wc*eV#QTNzB3M^qLjr>c!xT?YFWDc zwjw77`XrcvpG2{crpoVhlIqS$j4HX#J3+hms?lJF{$Xht;c!b{ zx_1@!U;h7=28cNnYzcINu{pl69Ecx)2C(AlQXpLi6SQg0wEfc&$HVi#A^k-9*8_Rccg ztYs`9N7!tiIeKVnArvEj&E!W*<*re{qGuw=eb>U>d93STkv75XJ?F0KW|Pp{yNz46 zp*xc0iW(PbTk*kMtIODpnnNmW*@_4D)trGwk?&X5fd9C%J`{qb?4XulD`&^w%D+yW z0CNiqpe^wJ(asTI;q2)6Utu%SeT0qj;F%#j)NLQ&ujSx>wf*Z%b$|IgSun)h3g`ro z1j8Wa_D+C*4%Z3qk(FO*NwCVR$N>I(Ztq>eGA%`D2Q|+81_9A*@35tIHov~~CfX>H zny^c(S*2O%@+`5TQTCxLRPrPa}@1$DAP)<1&fku4)_;&fh_=8kLMH*K^IhE8_8u!oqk+RW?>z)kw&Y zm0#{v8V{Sjx0b-T&}Mn({`B1j2ip&x~BkxmyM zrpD50;SME{3c{!4IvpS(W{)q`UG0jc-I{;is-DI!04cn$sj=Xw9{&VKud{|AG+ Bo&Nv; literal 0 HcmV?d00001 diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx index efbd931dcd6e..3fbf196d4c5e 100644 --- a/sw/qa/extras/odfexport/odfexport.cxx +++ b/sw/qa/extras/odfexport/odfexport.cxx @@ -19,6 +19,7 @@ public: void testTextframeGradient(); void testFdo60769(); void testFdo58949(); + void testCharacterBorder(); CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) @@ -38,6 +39,7 @@ void Test::run() {"textframe-gradient.odt", &Test::testTextframeGradient}, {"fdo60769.odt", &Test::testFdo60769}, {"fdo58949.docx", &Test::testFdo58949}, + {"charborder.odt", &Test::testCharacterBorder }, }; header(); for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i) @@ -162,6 +164,180 @@ void Test::testFdo58949() CPPUNIT_ASSERT_EQUAL(true, bool(xNameAccess->hasByName("Obj102"))); } +void Test::testCharacterBorder() +{ + // Make sure paragraph and character attributes don't interfere + // First paragraph has a paragraph border and a character border included by the paragraph style + + // Paragraph border of first paragraph + { + const table::BorderLine2 aFirstParTopBorder(6711039,0,26,26,7,53); + const sal_Int32 aFirstParTopPadding(150); + uno::Reference xSet(getParagraph(1), uno::UNO_QUERY); + + // Top border + assertEqualBorder( + aFirstParTopBorder, aFirstParTopPadding, + getProperty(xSet,"TopBorder"), + getProperty(xSet,"TopBorderDistance")); + + // Bottom border (same as top border) + assertEqualBorder( + aFirstParTopBorder, aFirstParTopPadding, + getProperty(xSet,"BottomBorder"), + getProperty(xSet,"BottomBorderDistance")); + + // Left border (same as top border) + assertEqualBorder( + aFirstParTopBorder, aFirstParTopPadding, + getProperty(xSet,"LeftBorder"), + getProperty(xSet,"LeftBorderDistance")); + + // Right border (same as top border) + assertEqualBorder( + aFirstParTopBorder, aFirstParTopPadding, + getProperty(xSet,"RightBorder"), + getProperty(xSet,"RightBorderDistance")); + } + + // Character border for first paragraph + { + const table::BorderLine2 aFirstParCharTopBorder(16724787,0,37,0,2,37); + const sal_Int32 aFirstParCharTopPadding(450); + uno::Reference xSet(getParagraph(1), uno::UNO_QUERY); + + // Top border + assertEqualBorder( + aFirstParCharTopBorder, aFirstParCharTopPadding, + getProperty(xSet,"CharTopBorder"), + getProperty(xSet,"CharTopBorderDistance")); + + // Bottom border (same as top border) + assertEqualBorder( + aFirstParCharTopBorder, aFirstParCharTopPadding, + getProperty(xSet,"CharBottomBorder"), + getProperty(xSet,"CharBottomBorderDistance")); + + // Left border (same as top border) + assertEqualBorder( + aFirstParCharTopBorder, aFirstParCharTopPadding, + getProperty(xSet,"CharLeftBorder"), + getProperty(xSet,"CharLeftBorderDistance")); + + // Right border (same as top border) + assertEqualBorder( + aFirstParCharTopBorder, aFirstParCharTopPadding, + getProperty(xSet,"CharRightBorder"), + getProperty(xSet,"CharRightBorderDistance")); + + // Check autostyle + { + uno::Reference< style::XAutoStyleFamily > xAutoStyleFamily(getAutoStyles("ParagraphStyles")); + uno::Reference < container::XEnumeration > xAutoStylesEnum( xAutoStyleFamily->createEnumeration() ); + CPPUNIT_ASSERT_EQUAL((bool)xAutoStylesEnum->hasMoreElements(), true); + + // First paragraph autostyle + uno::Reference < beans::XPropertySet > xPSet( xAutoStylesEnum->nextElement(), uno::UNO_QUERY ); + + // Top border + assertEqualBorder( + aFirstParCharTopBorder, aFirstParCharTopPadding, + getProperty(xSet,"CharTopBorder"), + getProperty(xSet,"CharTopBorderDistance")); + + // Bottom border + assertEqualBorder( + aFirstParCharTopBorder, aFirstParCharTopPadding, + getProperty(xSet,"CharBottomBorder"), + getProperty(xSet,"CharBottomBorderDistance")); + + // Left border + assertEqualBorder( + aFirstParCharTopBorder, aFirstParCharTopPadding, + getProperty(xSet,"CharLeftBorder"), + getProperty(xSet,"CharLeftBorderDistance")); + + // Right border + assertEqualBorder( + aFirstParCharTopBorder, aFirstParCharTopPadding, + getProperty(xSet,"CharRightBorder"), + getProperty(xSet,"CharRightBorderDistance")); + } + } + + // Second paragraph's second text portion has a character style named CharDiffBor + // This style includes border with different sides + { + + table::BorderLine2 aBorderArray[4] = + { + table::BorderLine2(16724787,26,2,4,13,35), // Top + table::BorderLine2(10092390,26,26,53,11,106), // Bottom + table::BorderLine2(6711039,9,26,9,12,71), // Left + table::BorderLine2(0,0,0,0,0,0) // Right + }; + + sal_Int32 aDistances[4] = { 400 /*Top*/, 300 /*Bottom*/, 250 /*Left*/, 0 /*Right*/ }; + + // Get second text portion of second paragraph + uno::Reference < beans::XPropertySet > xSet( getRun(getParagraph(2),2), uno::UNO_QUERY ); + + // Top border + assertEqualBorder( + aBorderArray[0], aDistances[0], + getProperty(xSet,"CharTopBorder"), + getProperty(xSet,"CharTopBorderDistance")); + + // Bottom border + assertEqualBorder( + aBorderArray[1], aDistances[1], + getProperty(xSet,"CharBottomBorder"), + getProperty(xSet,"CharBottomBorderDistance")); + + // Left border + assertEqualBorder( + aBorderArray[2], aDistances[2], + getProperty(xSet,"CharLeftBorder"), + getProperty(xSet,"CharLeftBorderDistance")); + + // Right border + assertEqualBorder( + aBorderArray[3], aDistances[3], + getProperty(xSet,"CharRightBorder"), + getProperty(xSet,"CharRightBorderDistance")); + + // Check character style + { + uno::Reference< container::XNameAccess > xStyleFamily(getStyles("CharacterStyles"), uno::UNO_QUERY); + uno::Reference < beans::XPropertySet > xStyleSet(xStyleFamily->getByName("CharDiffBor"), uno::UNO_QUERY); + + // Top border + assertEqualBorder( + aBorderArray[0], aDistances[0], + getProperty(xStyleSet,"CharTopBorder"), + getProperty(xStyleSet,"CharTopBorderDistance")); + + // Bottom border + assertEqualBorder( + aBorderArray[1], aDistances[1], + getProperty(xStyleSet,"CharBottomBorder"), + getProperty(xStyleSet,"CharBottomBorderDistance")); + + // Left border + assertEqualBorder( + aBorderArray[2], aDistances[2], + getProperty(xStyleSet,"CharLeftBorder"), + getProperty(xStyleSet,"CharLeftBorderDistance")); + + // Right border + assertEqualBorder( + aBorderArray[3], aDistances[3], + getProperty(xStyleSet,"CharRightBorder"), + getProperty(xStyleSet,"CharRightBorderDistance")); + } + } +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_PLUGIN_IMPLEMENT();