1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 #include <test/unoapi_test.hxx>
12 #include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
13 #include <com/sun/star/drawing/XDrawPage.hpp>
14 #include <com/sun/star/beans/XPropertySet.hpp>
15 #include <com/sun/star/graphic/XGraphic.hpp>
17 #include <rtl/ustring.hxx>
19 using namespace ::com::sun::star
;
23 /// Tests for svx/source/xml/ code.
24 class Test
: public UnoApiTest
28 : UnoApiTest("svx/qa/unit/data/")
33 CPPUNIT_TEST_FIXTURE(Test
, test3DObjectFallback
)
35 // Load a document which has a 3D model we don't understand, but has a fallback PNG.
36 loadFromURL(u
"3d-object-fallback.odp");
37 uno::Reference
<drawing::XDrawPagesSupplier
> xDrawPagesSupplier(mxComponent
, uno::UNO_QUERY
);
38 uno::Reference
<drawing::XDrawPage
> xDrawPage(xDrawPagesSupplier
->getDrawPages()->getByIndex(0),
40 uno::Reference
<beans::XPropertySet
> xShape(xDrawPage
->getByIndex(0), uno::UNO_QUERY
);
41 uno::Reference
<graphic::XGraphic
> xGraphic
;
42 xShape
->getPropertyValue("Graphic") >>= xGraphic
;
43 // Without the accompanying fix in place, this test would have failed, we could not read
44 // Models/Fallbacks/duck.png, as we assumed a format like Pictures/something.png, i.e. a single
46 CPPUNIT_ASSERT(xGraphic
.is());
50 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */