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
21 void AllFamiliesCanBeRestoredFromSavedString();
23 CPPUNIT_TEST_SUITE(SdrTextObjTest
);
24 CPPUNIT_TEST(AllFamiliesCanBeRestoredFromSavedString
);
25 CPPUNIT_TEST_SUITE_END();
28 void SdrTextObjTest::AllFamiliesCanBeRestoredFromSavedString()
30 std::vector
<SfxStyleFamily
> allFamilies
{ SfxStyleFamily::Char
, SfxStyleFamily::Para
,
31 SfxStyleFamily::Page
, SfxStyleFamily::Pseudo
};
33 for (SfxStyleFamily family
: allFamilies
)
35 OUString styleName
= u
"styleName"_ustr
;
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: */