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 <svx/svdotext.hxx>
11 #include <rtl/ustring.hxx>
13 #include <cppunit/TestAssert.h>
14 #include <cppunit/TestFixture.h>
15 #include <cppunit/extensions/HelperMacros.h>
16 #include <cppunit/plugin/TestPlugIn.h>
18 class SdrTextObjTest
: public CppUnit::TestFixture
{
20 void AllFamiliesCanBeRestoredFromSavedString();
22 CPPUNIT_TEST_SUITE(SdrTextObjTest
);
23 CPPUNIT_TEST(AllFamiliesCanBeRestoredFromSavedString
);
24 CPPUNIT_TEST_SUITE_END();
27 void SdrTextObjTest::AllFamiliesCanBeRestoredFromSavedString() {
28 std::vector
<SfxStyleFamily
> allFamilies
;
29 allFamilies
.push_back(SfxStyleFamily::Char
);
30 allFamilies
.push_back(SfxStyleFamily::Para
);
31 allFamilies
.push_back(SfxStyleFamily::Page
);
32 allFamilies
.push_back(SfxStyleFamily::Pseudo
);
34 for (SfxStyleFamily family
: allFamilies
) {
35 OUString styleName
= "styleName";
36 SdrTextObj::AppendFamilyToStyleName(styleName
, family
);
37 SfxStyleFamily readFamily
= SdrTextObj::ReadFamilyFromStyleName(styleName
);
38 CPPUNIT_ASSERT_EQUAL(static_cast<int>(family
), static_cast<int>(readFamily
));
42 CPPUNIT_TEST_SUITE_REGISTRATION(SdrTextObjTest
);
44 CPPUNIT_PLUGIN_IMPLEMENT();
46 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */