fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / xmloff / qa / unit / uxmloff.cxx
blob4380a9e66ef30491e61d51eeaf77ff297458eb06
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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/.
8 */
10 #include <sal/config.h>
11 #include <test/bootstrapfixture.hxx>
13 #include <xmloff/xmlexp.hxx>
14 #include <xmloff/xmltoken.hxx>
15 #include <xmloff/xmlaustp.hxx>
16 #include "SchXMLExport.hxx"
17 #include "XMLChartPropertySetMapper.hxx"
18 #include "impastpl.hxx"
19 #include <comphelper/processfactory.hxx>
20 #include <com/sun/star/util/MeasureUnit.hpp>
22 using namespace ::xmloff::token;
23 using namespace ::com::sun::star;
25 class Test : public test::BootstrapFixture {
26 public:
27 Test();
29 virtual void setUp();
30 virtual void tearDown();
32 void testAutoStylePool();
34 CPPUNIT_TEST_SUITE(Test);
35 CPPUNIT_TEST(testAutoStylePool);
36 CPPUNIT_TEST_SUITE_END();
37 private:
38 SvXMLExport *pExport;
41 Test::Test()
42 : pExport( NULL )
46 void Test::setUp()
48 BootstrapFixture::setUp();
50 pExport = new SchXMLExport(/* util::MeasureUnit::CM, */
51 comphelper::getProcessComponentContext());
54 void Test::tearDown()
56 delete pExport;
57 BootstrapFixture::tearDown();
60 void Test::testAutoStylePool()
62 UniReference< SvXMLAutoStylePoolP > xPool(
63 new SvXMLAutoStylePoolP( *pExport ) );
64 UniReference< XMLPropertySetMapper > xSetMapper(
65 new XMLChartPropertySetMapper( true) );
66 UniReference< XMLChartExportPropertyMapper > xExportPropMapper(
67 new XMLChartExportPropertyMapper( xSetMapper, *pExport ) );
69 xPool->AddFamily( XML_STYLE_FAMILY_TEXT_PARAGRAPH,
70 GetXMLToken( XML_PARAGRAPH ),
71 xExportPropMapper.get(),
72 OUString( "Bob" ) );
74 std::vector< XMLPropertyState > aProperties;
75 OUString aName = xPool->Add( XML_STYLE_FAMILY_TEXT_PARAGRAPH, "", aProperties );
77 // not that interesting but worth checking
78 CPPUNIT_ASSERT_MESSAGE( "style / naming changed", aName == "Bob1" );
80 // find ourselves again:
81 OUString aSameName = xPool->Find( XML_STYLE_FAMILY_TEXT_PARAGRAPH, "", aProperties );
82 CPPUNIT_ASSERT_MESSAGE( "same style not found", aSameName == aName );
85 CPPUNIT_TEST_SUITE_REGISTRATION(Test);
87 CPPUNIT_PLUGIN_IMPLEMENT();
89 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */