diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2022-12-12 22:12:58 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2023-01-15 11:23:36 +0000 |
commit | e15372dd4ce43bb867d0b4d66cbcee993d4c5449 (patch) | |
tree | aa2fd763b456e809267e1cafa5f28be0c3458c05 /svx | |
parent | a9dd747987eaa79d11f296bbd01e005289c7dd52 (diff) |
oox: add support for importing font scheme into a svx::Theme
Change-Id: I862256a17ce84c85174678f3fd03c8ef6661f2c5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143995
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
(cherry picked from commit d5a71bc6a28f8a3d726b2ac4688c7cef9d77ddf0)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145387
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/CppunitTest_svx_unit.mk | 1 | ||||
-rw-r--r-- | svx/qa/unit/ThemeTest.cxx | 40 |
2 files changed, 41 insertions, 0 deletions
diff --git a/svx/CppunitTest_svx_unit.mk b/svx/CppunitTest_svx_unit.mk index fe165c88bc82..5595d70ea8e9 100644 --- a/svx/CppunitTest_svx_unit.mk +++ b/svx/CppunitTest_svx_unit.mk @@ -33,6 +33,7 @@ $(eval $(call gb_CppunitTest_add_exception_objects,svx_unit, \ svx/qa/unit/xoutdev \ svx/qa/unit/xml \ svx/qa/unit/XTableImportExportTest \ + svx/qa/unit/ThemeTest \ )) $(eval $(call gb_CppunitTest_use_libraries,svx_unit, \ diff --git a/svx/qa/unit/ThemeTest.cxx b/svx/qa/unit/ThemeTest.cxx new file mode 100644 index 000000000000..757561b1bd17 --- /dev/null +++ b/svx/qa/unit/ThemeTest.cxx @@ -0,0 +1,40 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include <cppunit/TestAssert.h> +#include <cppunit/TestFixture.h> +#include <cppunit/extensions/HelperMacros.h> +#include <cppunit/plugin/TestPlugIn.h> + +#include <config_features.h> + +#include <svx/ColorSets.hxx> + +namespace +{ +class ThemeTest : public CppUnit::TestFixture +{ +}; + +CPPUNIT_TEST_FIXTURE(ThemeTest, testPitchFamilyConversion) +{ + svx::ThemeFont aFont; + aFont.maPitch = 2; + aFont.maFamily = 1; + + CPPUNIT_ASSERT_EQUAL(sal_Int16(0x12), aFont.getPitchFamily()); + + aFont.maPitch = sal_Int16(0x7FF2); // only lower 4-bit + aFont.maFamily = sal_Int16(0x7FF3); // only lower 4-bit + + CPPUNIT_ASSERT_EQUAL(sal_Int16(0x32), aFont.getPitchFamily()); +} +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |