|
12 | 12 |
|
13 | 13 | #include <com/sun/star/beans/XPropertySet.hpp>
|
14 | 14 | #include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
|
| 15 | +#include <com/sun/star/drawing/FillStyle.hpp> |
| 16 | +#include <com/sun/star/drawing/XShape.hpp> |
| 17 | +#include <com/sun/star/text/XText.hpp> |
15 | 18 | #include <com/sun/star/frame/Desktop.hpp>
|
16 | 19 | #include <com/sun/star/frame/XStorable.hpp>
|
17 | 20 |
|
|
20 | 23 |
|
21 | 24 | using namespace ::com::sun::star;
|
22 | 25 |
|
| 26 | +namespace |
| 27 | +{ |
| 28 | +/// Gets one child of xShape, which one is specified by nIndex. |
| 29 | +uno::Reference<drawing::XShape> getChildShape(const uno::Reference<drawing::XShape>& xShape, |
| 30 | + sal_Int32 nIndex) |
| 31 | +{ |
| 32 | + uno::Reference<container::XIndexAccess> xGroup(xShape, uno::UNO_QUERY); |
| 33 | + CPPUNIT_ASSERT(xGroup.is()); |
| 34 | + |
| 35 | + CPPUNIT_ASSERT(xGroup->getCount() > nIndex); |
| 36 | + |
| 37 | + uno::Reference<drawing::XShape> xRet(xGroup->getByIndex(nIndex), uno::UNO_QUERY); |
| 38 | + CPPUNIT_ASSERT(xRet.is()); |
| 39 | + |
| 40 | + return xRet; |
| 41 | +} |
| 42 | +} |
| 43 | + |
23 | 44 | /// oox drawingml tests.
|
24 | 45 | class OoxDrawingmlTest : public test::BootstrapFixture, public unotest::MacrosTest
|
25 | 46 | {
|
@@ -87,6 +108,27 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testTransparentText)
|
87 | 108 | CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(75), nTransparency);
|
88 | 109 | }
|
89 | 110 |
|
| 111 | +CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testTdf131082) |
| 112 | +{ |
| 113 | + OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "tdf131082.pptx"; |
| 114 | + loadAndReload(aURL, "Impress Office Open XML"); |
| 115 | + |
| 116 | + uno::Reference<drawing::XDrawPagesSupplier> xDrawPagesSupplier(getComponent(), uno::UNO_QUERY); |
| 117 | + uno::Reference<drawing::XDrawPage> xDrawPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0), |
| 118 | + uno::UNO_QUERY); |
| 119 | + |
| 120 | + uno::Reference<drawing::XShape> xShape(xDrawPage->getByIndex(0), uno::UNO_QUERY); |
| 121 | + uno::Reference<beans::XPropertySet> XPropSet(getChildShape(getChildShape(xShape, 0), 0), |
| 122 | + uno::UNO_QUERY); |
| 123 | + |
| 124 | + drawing::FillStyle eFillStyle = drawing::FillStyle_NONE; |
| 125 | + XPropSet->getPropertyValue("FillStyle") >>= eFillStyle; |
| 126 | + |
| 127 | + // Without the accompanying fix in place, this test would have failed with: |
| 128 | + // with drawing::FillStyle_NONE - 0 |
| 129 | + CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, eFillStyle); |
| 130 | +} |
| 131 | + |
90 | 132 | CPPUNIT_PLUGIN_IMPLEMENT();
|
91 | 133 |
|
92 | 134 | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
0 commit comments