Kaydet (Commit) bb9fce28 authored tarafından Miklos Vajna's avatar Miklos Vajna

sw: RTF export of TextFrame border/shadow testcase

Change-Id: I85b85afb6d1b170d71633f93d56f7ce4fffdf0a3
üst d74ba0c4
{\rtf1
{\shp
{\*\shpinst\shpleft-540\shptop152\shpright9900\shpbottom1592\shpfhdr0\shpbxcolumn\shpbxignore\shpbypara\shpbyignore\shpwr3\shpwrk0\shpfblwtxt0\shpz0\shplid1026
{\sp
{\sn shapeType}
{\sv 1}
}
{\sp
{\sn fFitShapeToText}
{\sv 1}
}
{\sp
{\sn fillColor}
{\sv 9737689}
}
{\sp
{\sn lineColor}
{\sv 5066944}
}
{\sp
{\sn lineWidth}
{\sv 12700}
}
{\sp
{\sn shadowType}
{\sv 2}
}
{\sp
{\sn shadowColor}
{\sv 2303074}
}
{\sp
{\sn shadowOffsetX}
{\sv 12700}
}
{\sp
{\sn shadowSecondOffsetX}
{\sv -38100}
}
{\sp
{\sn fShadow}
{\sv 1}
}
{\shptxt aaa
}
}
}
\par
}
......@@ -28,6 +28,8 @@
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
#include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp>
#include <com/sun/star/frame/XStorable.hpp>
#include <com/sun/star/table/BorderLine2.hpp>
#include <com/sun/star/table/ShadowFormat.hpp>
#include <com/sun/star/text/XFootnotesSupplier.hpp>
#include <com/sun/star/text/XPageCursor.hpp>
#include <com/sun/star/text/XTextViewCursorSupplier.hpp>
......@@ -77,6 +79,7 @@ public:
void testI120928();
void testBookmark();
void testHyperlink();
void testTextFrameBorders();
CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT)
......@@ -128,6 +131,7 @@ void Test::run()
{"i120928.rtf", &Test::testI120928},
{"bookmark.rtf", &Test::testBookmark},
{"hyperlink.rtf", &Test::testHyperlink},
{"textframe-borders.rtf", &Test::testTextFrameBorders},
};
// Don't test the first import of these, for some reason those tests fail
const char* aBlacklist[] = {
......@@ -557,6 +561,23 @@ void Test::testHyperlink()
CPPUNIT_ASSERT_EQUAL(OUString(""), getProperty<OUString>(getRun(getParagraph(1), 3, "!"), "HyperLinkURL"));
}
void Test::testTextFrameBorders()
{
uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY);
uno::Reference<container::XIndexAccess> xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY);
uno::Reference<beans::XPropertySet> xFrame(xIndexAccess->getByIndex(0), uno::UNO_QUERY);
CPPUNIT_ASSERT_EQUAL(sal_Int32(0xD99594), getProperty<sal_Int32>(xFrame, "BackColor"));
table::BorderLine2 aBorder = getProperty<table::BorderLine2>(xFrame, "TopBorder");
CPPUNIT_ASSERT_EQUAL(sal_Int32(0xC0504D), aBorder.Color);
CPPUNIT_ASSERT_EQUAL(sal_uInt32(35), aBorder.LineWidth);
table::ShadowFormat aShadowFormat = getProperty<table::ShadowFormat>(xFrame, "ShadowFormat");
CPPUNIT_ASSERT_EQUAL(table::ShadowLocation_BOTTOM_RIGHT, aShadowFormat.Location);
CPPUNIT_ASSERT_EQUAL(sal_Int16(48), aShadowFormat.ShadowWidth);
CPPUNIT_ASSERT_EQUAL(sal_Int32(0x622423), aShadowFormat.Color);
}
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment