From bd0f526f2d3e1ffe43a74672485815768eee6e9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toma=C5=BE=20Vajngerl?= Date: Wed, 28 Dec 2022 09:43:46 +0900 Subject: [PATCH] introduce docmodel comp., model::ThemeColor, use it in SvxColorItem MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added a new component docmodel, that has the document model types, which only depend on other basic components. This is needed so the types can be used in every relevant component - xmloff, oox, svx, editeng,... Introduces model::ThemeColor, which is a class used to store the theme color data, including transformations (svx::Transformation). For UNO use XThemeColor is added, and the implementation UnoThemeColor which wraps svx::ThemeColor, so it can be tranported around. Reactor all the code and tests to accomodate for this change. Change-Id: I7ce6752cdfaf5e4d3b8e4d90314afa469dd65cfc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144847 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl --- Repository.mk | 1 + RepositoryModule_build.mk | 1 + RepositoryModule_host.mk | 1 + bin/update_pch | 31 ++-- cui/Library_cui.mk | 1 + cui/inc/pch/precompiled_cui.hxx | 14 +- cui/source/tabpages/chardlg.cxx | 12 +- cui/source/tabpages/tpcolor.cxx | 10 +- docmodel/Library_docmodel.mk | 39 +++++ docmodel/Makefile | 7 + docmodel/Module_docmodel.mk | 18 +++ docmodel/README.md | 5 + docmodel/inc/pch/precompiled_docmodel.cxx | 12 ++ docmodel/inc/pch/precompiled_docmodel.hxx | 34 ++++ docmodel/source/uno/UnoThemeColor.cxx | 40 +++++ editeng/CppunitTest_editeng_core.mk | 1 + editeng/Library_editeng.mk | 1 + editeng/inc/pch/precompiled_editeng.hxx | 7 +- editeng/source/items/textitem.cxx | 105 +++++++------ editeng/source/uno/unotext.cxx | 22 ++- include/docmodel/dllapi.h | 21 +++ include/docmodel/theme/ThemeColor.hxx | 146 ++++++++++++++++++ include/docmodel/theme/ThemeColorType.hxx | 42 +++++ include/docmodel/uno/UnoThemeColor.hxx | 55 +++++++ include/editeng/colritem.hxx | 54 +------ include/svx/ColorSets.hxx | 32 +--- include/svx/xcolit.hxx | 9 +- offapi/UnoApi_offapi.mk | 1 + offapi/com/sun/star/util/XThemeColor.idl | 26 ++++ oox/CppunitTest_oox_drawingml.mk | 1 + oox/CppunitTest_oox_shape.mk | 1 + oox/CppunitTest_oox_tokenmap.mk | 1 + oox/Library_oox.mk | 1 + oox/inc/pch/precompiled_oox.hxx | 69 +++++++-- oox/source/export/ThemeExport.cxx | 28 ++-- sd/CppunitTest_sd_uiimpress.mk | 1 + sd/CppunitTest_sd_uimpress.mk | 1 + sd/Library_sd.mk | 1 + sd/inc/pch/precompiled_sd.hxx | 68 +++++++- sd/source/core/stlsheet.cxx | 18 ++- sd/source/filter/eppt/pptx-epptooxml.cxx | 2 +- sd/source/ui/func/fuconstr.cxx | 4 +- sd/source/ui/view/drtxtob1.cxx | 29 ++-- sd/source/ui/view/drviews2.cxx | 7 +- .../gbuild/extensions/pre_MergedLibsList.mk | 1 + solenv/qa/python/gbuildtojson.py | 2 +- svx/CppunitTest_svx_removewhichrange.mk | 1 + svx/CppunitTest_svx_styles.mk | 1 + svx/CppunitTest_svx_unit.mk | 1 + svx/Library_svxcore.mk | 1 + svx/inc/pch/precompiled_svx.hxx | 29 ++-- svx/source/styles/ColorSets.cxx | 14 +- svx/source/table/cell.cxx | 19 ++- svx/source/unodraw/unoshape.cxx | 18 ++- svx/source/xoutdev/xattr.cxx | 47 ++++-- sw/CppunitTest_sw_apitests.mk | 1 + sw/CppunitTest_sw_core_draw.mk | 1 + sw/CppunitTest_sw_core_theme.mk | 1 + sw/CppunitTest_sw_macros_test.mk | 1 + sw/CppunitTest_sw_ooxmlimport.mk | 1 + sw/CppunitTest_sw_ooxmlimport2.mk | 1 + sw/CppunitTest_sw_tiledrendering.mk | 1 + sw/CppunitTest_sw_uwriter.mk | 1 + sw/Library_sw.mk | 1 + sw/layoutwriter_setup.mk | 1 + sw/ooxmlexport_setup.mk | 1 + sw/qa/core/theme/ThemeTest.cxx | 20 +-- sw/source/uibase/sidebar/ThemePanel.cxx | 13 +- sw/uiwriter_setup.mk | 1 + sw/ww8export_setup.mk | 1 + 70 files changed, 883 insertions(+), 277 deletions(-) create mode 100644 docmodel/Library_docmodel.mk create mode 100644 docmodel/Makefile create mode 100644 docmodel/Module_docmodel.mk create mode 100644 docmodel/README.md create mode 100644 docmodel/inc/pch/precompiled_docmodel.cxx create mode 100644 docmodel/inc/pch/precompiled_docmodel.hxx create mode 100644 docmodel/source/uno/UnoThemeColor.cxx create mode 100644 include/docmodel/dllapi.h create mode 100644 include/docmodel/theme/ThemeColor.hxx create mode 100644 include/docmodel/theme/ThemeColorType.hxx create mode 100644 include/docmodel/uno/UnoThemeColor.hxx create mode 100644 offapi/com/sun/star/util/XThemeColor.idl diff --git a/Repository.mk b/Repository.mk index ff20165796a5..89eb990b3354 100644 --- a/Repository.mk +++ b/Repository.mk @@ -401,6 +401,7 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \ deploymentmisc \ $(if $(filter-out MACOSX WNT,$(OS)),desktopbe1) \ $(call gb_Helper_optional,SCRIPTING,dlgprov) \ + docmodel \ drawinglayercore \ drawinglayer \ editeng \ diff --git a/RepositoryModule_build.mk b/RepositoryModule_build.mk index 2f3a06edd12a..2059c1f2a5a9 100644 --- a/RepositoryModule_build.mk +++ b/RepositoryModule_build.mk @@ -63,6 +63,7 @@ $(eval $(call gb_Module_add_moduledirs,cross_toolset,\ configmgr \ connectivity \ cppcanvas \ + docmodel \ drawinglayer \ editeng \ emfio \ diff --git a/RepositoryModule_host.mk b/RepositoryModule_host.mk index c0bd27b1c260..2fbee39dc610 100644 --- a/RepositoryModule_host.mk +++ b/RepositoryModule_host.mk @@ -74,6 +74,7 @@ $(eval $(call gb_Module_add_moduledirs,libreoffice,\ cui \ desktop \ $(call gb_Helper_optional,DICTIONARIES,dictionaries) \ + docmodel\ drawinglayer \ editeng \ embeddedobj \ diff --git a/bin/update_pch b/bin/update_pch index 1cb5cb9979a6..63a39ce51b0b 100755 --- a/bin/update_pch +++ b/bin/update_pch @@ -73,6 +73,7 @@ DEFAULTS = \ 'desktop.deploymentgui' : ( 3, EXCLUDE, EXCLUDE, EXCLUDE), # 5.7 'desktop.deploymentmisc' : ( 3, EXCLUDE, EXCLUDE, EXCLUDE), # 3.4 'desktop.sofficeapp' : ( 6, EXCLUDE, INCLUDE, INCLUDE), # 6.5 + 'docmodel.docmodel' : ( 3, EXCLUDE, EXCLUDE, INCLUDE), # 3.8 'drawinglayer.drawinglayer' : ( 4, EXCLUDE, EXCLUDE, EXCLUDE), # 7.4 'editeng.editeng' : ( 5, EXCLUDE, INCLUDE, EXCLUDE), # 13.0 'forms.frm' : ( 2, EXCLUDE, EXCLUDE, EXCLUDE), # 14.2 @@ -1191,8 +1192,8 @@ class TestMakefileParser(unittest.TestCase): def test_parse_multiline_eval(self): source = """$(eval $(call gb_Library_set_include,sal,\\ - $$(INCLUDE) \\ - -I$(SRCDIR)/sal/inc \\ + $$(INCLUDE) \\ + -I$(SRCDIR)/sal/inc \\ )) """ lines = source.split('\n') @@ -1203,9 +1204,9 @@ class TestMakefileParser(unittest.TestCase): def test_parse_multiline_eval_with_if(self): source = """$(eval $(call gb_Library_add_defs,sal,\\ - $(if $(filter $(OS),iOS), \\ - -DNO_CHILD_PROCESSES \\ - ) \\ + $(if $(filter $(OS),iOS), \\ + -DNO_CHILD_PROCESSES \\ + ) \\ )) """ lines = source.split('\n') @@ -1216,7 +1217,7 @@ class TestMakefileParser(unittest.TestCase): def test_parse_multiline_add_with_if(self): source = """$(eval $(call gb_Library_add_exception_objects,sal,\\ - sal/osl/unx/time \\ + sal/osl/unx/time \\ $(if $(filter DESKTOP,$(BUILD_TYPE)), sal/osl/unx/salinit) \\ )) """ @@ -1230,11 +1231,11 @@ class TestMakefileParser(unittest.TestCase): def test_parse_if_else(self): source = """ifeq ($(OS),MACOSX) $(eval $(call gb_Library_add_exception_objects,sal,\\ - sal/osl/mac/mac \\ + sal/osl/mac/mac \\ )) else $(eval $(call gb_Library_add_exception_objects,sal,\\ - sal/osl/unx/uunxapi \\ + sal/osl/unx/uunxapi \\ )) endif """ @@ -1251,16 +1252,16 @@ endif def test_parse_nested_if(self): source = """ifeq ($(OS),MACOSX) $(eval $(call gb_Library_add_exception_objects,sal,\\ - sal/osl/mac/mac \\ + sal/osl/mac/mac \\ )) else $(eval $(call gb_Library_add_exception_objects,sal,\\ - sal/osl/unx/uunxapi \\ + sal/osl/unx/uunxapi \\ )) ifeq ($(OS),LINUX) $(eval $(call gb_Library_add_exception_objects,sal,\\ - sal/textenc/context \\ + sal/textenc/context \\ )) endif endif @@ -1280,16 +1281,16 @@ endif def test_parse_exclude_system(self): source = """ifeq ($(OS),MACOSX) $(eval $(call gb_Library_add_exception_objects,sal,\\ - sal/osl/mac/mac \\ + sal/osl/mac/mac \\ )) else $(eval $(call gb_Library_add_exception_objects,sal,\\ - sal/osl/unx/uunxapi \\ + sal/osl/unx/uunxapi \\ )) ifeq ($(OS),LINUX) $(eval $(call gb_Library_add_exception_objects,sal,\\ - sal/textenc/context \\ + sal/textenc/context \\ )) endif endif @@ -1306,7 +1307,7 @@ endif def test_parse_filter(self): source = """ifneq ($(filter $(OS),MACOSX iOS),) $(eval $(call gb_Library_add_exception_objects,sal,\\ - sal/osl/unx/osxlocale \\ + sal/osl/unx/osxlocale \\ )) endif """ diff --git a/cui/Library_cui.mk b/cui/Library_cui.mk index 85f779cc964d..03a1577ee66b 100644 --- a/cui/Library_cui.mk +++ b/cui/Library_cui.mk @@ -38,6 +38,7 @@ $(eval $(call gb_Library_use_libraries,cui,\ comphelper \ cppu \ cppuhelper \ + docmodel \ drawinglayer \ editeng \ i18nlangtag \ diff --git a/cui/inc/pch/precompiled_cui.hxx b/cui/inc/pch/precompiled_cui.hxx index 6553c5874b1a..7b7688c74ad9 100644 --- a/cui/inc/pch/precompiled_cui.hxx +++ b/cui/inc/pch/precompiled_cui.hxx @@ -13,7 +13,7 @@ manual changes will be rewritten by the next run of update_pch.sh (which presumably also fixes all possible problems, so it's usually better to use it). - Generated on 2022-08-13 18:00:55 using: + Generated on 2023-01-10 23:29:57 using: ./bin/update_pch cui cui --cutoff=8 --exclude:system --include:module --exclude:local If after updating build fails, use the following command to locate conflicting headers: @@ -53,6 +53,7 @@ #include #include #include +#include #include #include #include @@ -114,7 +115,6 @@ #include #include #include -#include #include #include #include @@ -125,6 +125,7 @@ #include #include #include +#include #include #include #include @@ -177,6 +178,7 @@ #include #include #include +#include #include #include #include @@ -186,6 +188,7 @@ #include #include #include +#include #include #include #include @@ -261,6 +264,8 @@ #include #include #include +#include +#include #include #include #include @@ -276,6 +281,7 @@ #include #include #include +#include #include #include #include @@ -297,6 +303,7 @@ #include #include #include +#include #include #include #include @@ -401,7 +408,6 @@ #include #include #include -#include #include #include #include @@ -420,7 +426,6 @@ #include #include #include -#include #include #include #include @@ -434,6 +439,7 @@ #include #include #include +#include #endif // PCH_LEVEL >= 3 #if PCH_LEVEL >= 4 #include diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx index 3fff1a62352a..194dfd65f830 100644 --- a/cui/source/tabpages/chardlg.cxx +++ b/cui/source/tabpages/chardlg.cxx @@ -1596,12 +1596,14 @@ bool SvxCharEffectsPage::FillItemSetColor_Impl( SfxItemSet& rSet ) { SvxColorItem aItem( aSelectedColor.m_aColor, nWhich ); - if (aSelectedColor.m_nThemeIndex != -1) + // The color was picked from the theme palette, remember its index. + model::ThemeColorType eType = model::convertToThemeColorType(aSelectedColor.m_nThemeIndex); + if (eType != model::ThemeColorType::Unknown) { - // The color was picked from the theme palette, remember its index. - aItem.GetThemeColor().SetThemeIndex(aSelectedColor.m_nThemeIndex); - aItem.GetThemeColor().SetLumMod(aSelectedColor.m_nLumMod); - aItem.GetThemeColor().SetLumOff(aSelectedColor.m_nLumOff); + aItem.GetThemeColor().setType(eType); + aItem.GetThemeColor().clearTransformations(); + aItem.GetThemeColor().addTransformation({model::TransformationType::LumMod, aSelectedColor.m_nLumMod}); + aItem.GetThemeColor().addTransformation({model::TransformationType::LumOff, aSelectedColor.m_nLumOff}); } rSet.Put(aItem); diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx index 7790ff60a8c2..9c0b5b457525 100644 --- a/cui/source/tabpages/tpcolor.cxx +++ b/cui/source/tabpages/tpcolor.cxx @@ -245,17 +245,19 @@ bool SvxColorTabPage::FillItemSet( SfxItemSet* rSet ) sColorName = "#" + aCurrentColor.m_aColor.AsRGBHexString().toAsciiUpperCase(); maPaletteManager.AddRecentColor( aCurrentColor.m_aColor, sColorName ); XFillColorItem aColorItem( sColorName, aCurrentColor.m_aColor ); - if (aCurrentColor.m_nThemeIndex != -1) + model::ThemeColorType eType = model::convertToThemeColorType(aCurrentColor.m_nThemeIndex); + if (eType != model::ThemeColorType::Unknown) { - aColorItem.GetThemeColor().SetThemeIndex(aCurrentColor.m_nThemeIndex); + aColorItem.GetThemeColor().setType(eType); } + aColorItem.GetThemeColor().clearTransformations(); if (aCurrentColor.m_nLumMod != 10000) { - aColorItem.GetThemeColor().SetLumMod(aCurrentColor.m_nLumMod); + aColorItem.GetThemeColor().addTransformation({model::TransformationType::LumMod, aCurrentColor.m_nLumMod}); } if (aCurrentColor.m_nLumOff != 0) { - aColorItem.GetThemeColor().SetLumOff(aCurrentColor.m_nLumOff); + aColorItem.GetThemeColor().addTransformation({model::TransformationType::LumOff, aCurrentColor.m_nLumOff}); } rSet->Put( aColorItem ); rSet->Put( XFillStyleItem( drawing::FillStyle_SOLID ) ); diff --git a/docmodel/Library_docmodel.mk b/docmodel/Library_docmodel.mk new file mode 100644 index 000000000000..3e0d28dfda28 --- /dev/null +++ b/docmodel/Library_docmodel.mk @@ -0,0 +1,39 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t; fill-column: 100 -*- +# +# 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/. +# + +$(eval $(call gb_Library_Library,docmodel)) + +$(eval $(call gb_Library_add_exception_objects,docmodel,\ + docmodel/source/uno/UnoThemeColor \ +)) + +$(eval $(call gb_Library_set_include,docmodel,\ + $$(INCLUDE) \ + -I$(SRCDIR)/docmodel/inc \ +)) + +$(eval $(call gb_Library_add_defs,docmodel,\ + -DDOCMODEL_DLLIMPLEMENTATION \ +)) + +$(eval $(call gb_Library_set_precompiled_header,docmodel,docmodel/inc/pch/precompiled_docmodel)) + +$(eval $(call gb_Library_use_sdk_api,docmodel)) + +$(eval $(call gb_Library_use_libraries,docmodel,\ + basegfx \ + comphelper \ + cppuhelper \ + cppu \ + sal \ + vcl \ + tl \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/docmodel/Makefile b/docmodel/Makefile new file mode 100644 index 000000000000..ccb1c85a04da --- /dev/null +++ b/docmodel/Makefile @@ -0,0 +1,7 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- + +module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST)))) + +include $(module_directory)/../solenv/gbuild/partial_build.mk + +# vim: set noet sw=4 ts=4: diff --git a/docmodel/Module_docmodel.mk b/docmodel/Module_docmodel.mk new file mode 100644 index 000000000000..7e55ff74ad60 --- /dev/null +++ b/docmodel/Module_docmodel.mk @@ -0,0 +1,18 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# 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/. +# + +$(eval $(call gb_Module_Module,docmodel)) + +$(eval $(call gb_Module_add_targets,docmodel,\ + Library_docmodel \ +)) + + + +# vim: set noet sw=4 ts=4: diff --git a/docmodel/README.md b/docmodel/README.md new file mode 100644 index 000000000000..c8d08b133b1e --- /dev/null +++ b/docmodel/README.md @@ -0,0 +1,5 @@ +# Document Model Types and Objects + +Contains document model types, that don't require many depenencies except +basic types found in basegfx and tools. The purpose of this types and +objects is to be available in all common components. diff --git a/docmodel/inc/pch/precompiled_docmodel.cxx b/docmodel/inc/pch/precompiled_docmodel.cxx new file mode 100644 index 000000000000..f8a84e17d6c3 --- /dev/null +++ b/docmodel/inc/pch/precompiled_docmodel.cxx @@ -0,0 +1,12 @@ +/* -*- 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 "precompiled_docmodel.hxx" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/docmodel/inc/pch/precompiled_docmodel.hxx b/docmodel/inc/pch/precompiled_docmodel.hxx new file mode 100644 index 000000000000..1942b8737a17 --- /dev/null +++ b/docmodel/inc/pch/precompiled_docmodel.hxx @@ -0,0 +1,34 @@ +/* -*- 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/. + */ + +/* + This file has been autogenerated by update_pch.sh. It is possible to edit it + manually (such as when an include file has been moved/renamed/removed). All such + manual changes will be rewritten by the next run of update_pch.sh (which presumably + also fixes all possible problems, so it's usually better to use it). + + Generated on 2023-01-10 23:20:14 using: + bin/update_pch docmodel docmodel --cutoff=3 --exclude:system --exclude:module --include:local + + If after updating build fails, use the following command to locate conflicting headers: + ./bin/update_pch_bisect ./docmodel/inc/pch/precompiled_docmodel.hxx "make docmodel.build" --find-conflicts +*/ + +#include +#if PCH_LEVEL >= 1 +#endif // PCH_LEVEL >= 1 +#if PCH_LEVEL >= 2 +#include +#endif // PCH_LEVEL >= 2 +#if PCH_LEVEL >= 3 +#endif // PCH_LEVEL >= 3 +#if PCH_LEVEL >= 4 +#endif // PCH_LEVEL >= 4 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/docmodel/source/uno/UnoThemeColor.cxx b/docmodel/source/uno/UnoThemeColor.cxx new file mode 100644 index 000000000000..f6374b54933b --- /dev/null +++ b/docmodel/source/uno/UnoThemeColor.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 +#include + +using namespace css; + +// css::lang::XUnoTunnel +UNO3_GETIMPLEMENTATION_IMPL(UnoThemeColor); + +sal_Int16 UnoThemeColor::getType() { return sal_uInt16(maThemeColor.getType()); } + +namespace model::theme +{ +uno::Reference createXThemeColor(model::ThemeColor const& rThemeColor) +{ + return new UnoThemeColor(rThemeColor); +} + +void setFromXThemeColor(model::ThemeColor& rThemeColor, + uno::Reference const& rxColorTheme) +{ + UnoThemeColor* pUnoThemeColor = comphelper::getFromUnoTunnel(rxColorTheme); + if (pUnoThemeColor) + { + rThemeColor = pUnoThemeColor->getThemeColor(); + } +} + +} // end model::theme + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/editeng/CppunitTest_editeng_core.mk b/editeng/CppunitTest_editeng_core.mk index 3b3a999e8fa0..9b79048b637a 100644 --- a/editeng/CppunitTest_editeng_core.mk +++ b/editeng/CppunitTest_editeng_core.mk @@ -22,6 +22,7 @@ $(eval $(call gb_CppunitTest_use_libraries,editeng_core, \ comphelper \ cppu \ cppuhelper \ + docmodel \ i18nlangtag \ i18nutil \ lng \ diff --git a/editeng/Library_editeng.mk b/editeng/Library_editeng.mk index 6602793e3e02..7f7f3581b62f 100644 --- a/editeng/Library_editeng.mk +++ b/editeng/Library_editeng.mk @@ -138,6 +138,7 @@ $(eval $(call gb_Library_add_exception_objects,editeng,\ $(eval $(call gb_Library_use_libraries,editeng,\ xo \ basegfx \ + docmodel \ lng \ svt \ tk \ diff --git a/editeng/inc/pch/precompiled_editeng.hxx b/editeng/inc/pch/precompiled_editeng.hxx index 8472a893b5a1..3f5d71018ac5 100644 --- a/editeng/inc/pch/precompiled_editeng.hxx +++ b/editeng/inc/pch/precompiled_editeng.hxx @@ -13,7 +13,7 @@ manual changes will be rewritten by the next run of update_pch.sh (which presumably also fixes all possible problems, so it's usually better to use it). - Generated on 2022-09-03 23:10:43 using: + Generated on 2023-01-10 23:29:32 using: ./bin/update_pch editeng editeng --cutoff=5 --exclude:system --include:module --exclude:local If after updating build fails, use the following command to locate conflicting headers: @@ -107,7 +107,6 @@ #include #include #include -#include #include #include #include @@ -128,6 +127,7 @@ #if PCH_LEVEL >= 3 #include #include +#include #include #include #include @@ -136,6 +136,7 @@ #include #include #include +#include #include #include #include @@ -145,6 +146,7 @@ #include #include #include +#include #include #include #include @@ -190,6 +192,7 @@ #include #include #include +#include #include #include #include diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx index 30b780f1b855..bf6017cdcf6d 100644 --- a/editeng/source/items/textitem.cxx +++ b/editeng/source/items/textitem.cxx @@ -1353,38 +1353,6 @@ bool SvxContourItem::GetPresentation return true; } -SvxThemeColor::SvxThemeColor() - : maThemeIndex(-1) - , mnLumMod(10000) - , mnLumOff(0) - , mnTintOrShade(0) -{ -} - -bool SvxThemeColor::operator==(const SvxThemeColor& rThemeColor) const -{ - return maThemeIndex == rThemeColor.maThemeIndex && - mnLumMod == rThemeColor.mnLumMod && - mnLumOff == rThemeColor.mnLumOff && - mnTintOrShade == rThemeColor.mnTintOrShade; -} - -void SvxThemeColor::dumpAsXml(xmlTextWriterPtr pWriter) const -{ - (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SvxThemeColor")); - - (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("theme-index"), - BAD_CAST(OString::number(maThemeIndex).getStr())); - (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("lum-mod"), - BAD_CAST(OString::number(mnLumMod).getStr())); - (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("lum-off"), - BAD_CAST(OString::number(mnLumOff).getStr())); - (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("tint-or-shade"), - BAD_CAST(OString::number(mnTintOrShade).getStr())); - - (void)xmlTextWriterEndElement(pWriter); -} - // class SvxColorItem ---------------------------------------------------- SvxColorItem::SvxColorItem( const sal_uInt16 nId ) : SfxPoolItem(nId), @@ -1429,22 +1397,42 @@ bool SvxColorItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const } case MID_COLOR_THEME_INDEX: { - rVal <<= maThemeColor.GetThemeIndex(); + rVal <<= sal_Int16(maThemeColor.getType()); break; } case MID_COLOR_TINT_OR_SHADE: { - rVal <<= maThemeColor.GetTintOrShade(); + sal_Int16 nValue = 0; + for (auto const& rTransform : maThemeColor.getTransformations()) + { + if (rTransform.meType == model::TransformationType::Tint) + nValue = rTransform.mnValue; + else if (rTransform.meType == model::TransformationType::Shade) + nValue = -rTransform.mnValue; + } + rVal <<= nValue; break; } case MID_COLOR_LUM_MOD: { - rVal <<= maThemeColor.GetLumMod(); + sal_Int16 nValue = 10000; + for (auto const& rTransform : maThemeColor.getTransformations()) + { + if (rTransform.meType == model::TransformationType::LumMod) + nValue = rTransform.mnValue; + } + rVal <<= nValue; break; } case MID_COLOR_LUM_OFF: { - rVal <<= maThemeColor.GetLumOff(); + sal_Int16 nValue = 0; + for (auto const& rTransform : maThemeColor.getTransformations()) + { + if (rTransform.meType == model::TransformationType::LumOff) + nValue = rTransform.mnValue; + } + rVal <<= nValue; break; } default: @@ -1482,31 +1470,43 @@ bool SvxColorItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) sal_Int16 nIndex = -1; if (!(rVal >>= nIndex)) return false; - maThemeColor.SetThemeIndex(nIndex); + maThemeColor.setType(model::convertToThemeColorType(nIndex)); } break; case MID_COLOR_TINT_OR_SHADE: { - sal_Int16 nTintShade = -1; + sal_Int16 nTintShade = 0; if (!(rVal >>= nTintShade)) return false; - maThemeColor.SetTintOrShade(nTintShade); + + maThemeColor.removeTransformations(model::TransformationType::Tint); + maThemeColor.removeTransformations(model::TransformationType::Shade); + + if (nTintShade > 0) + maThemeColor.addTransformation({model::TransformationType::Tint, nTintShade}); + else if (nTintShade < 0) + { + sal_Int16 nShade = o3tl::narrowing(-nTintShade); + maThemeColor.addTransformation({model::TransformationType::Shade, nShade}); + } } break; case MID_COLOR_LUM_MOD: { - sal_Int16 nLumMod = -1; + sal_Int16 nLumMod = 10000; if (!(rVal >>= nLumMod)) return false; - maThemeColor.SetLumMod(nLumMod); + maThemeColor.removeTransformations(model::TransformationType::LumMod); + maThemeColor.addTransformation({model::TransformationType::LumMod, nLumMod}); } break; case MID_COLOR_LUM_OFF: { - sal_Int16 nLumOff = -1; + sal_Int16 nLumOff = 0; if (!(rVal >>= nLumOff)) return false; - maThemeColor.SetLumOff(nLumOff); + maThemeColor.removeTransformations(model::TransformationType::LumOff); + maThemeColor.addTransformation({model::TransformationType::LumOff, nLumOff}); } break; default: @@ -1549,13 +1549,26 @@ void SvxColorItem::dumpAsXml(xmlTextWriterPtr pWriter) const GetPresentation( SfxItemPresentation::Complete, MapUnit::Map100thMM, MapUnit::Map100thMM, aStr, aIntlWrapper); (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("presentation"), BAD_CAST(OUStringToOString(aStr, RTL_TEXTENCODING_UTF8).getStr())); - maThemeColor.dumpAsXml(pWriter); + (void)xmlTextWriterStartElement(pWriter, BAD_CAST("theme-color")); + + (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("theme-index"), + BAD_CAST(OString::number(sal_Int16(maThemeColor.getType())).getStr())); + + for (auto const& rTransform : maThemeColor.getTransformations()) + { + (void)xmlTextWriterStartElement(pWriter, BAD_CAST("transformation")); + (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("type"), + BAD_CAST(OString::number(sal_Int16(rTransform.meType)).getStr())); + (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), + BAD_CAST(OString::number(rTransform.mnValue).getStr())); + (void)xmlTextWriterEndElement(pWriter); + } + + (void)xmlTextWriterEndElement(pWriter); (void)xmlTextWriterEndElement(pWriter); } - - void SvxColorItem::SetValue( const Color& rNewCol ) { mColor = rNewCol; diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx index 8d6b2aa9ec53..e5877a7d2e5a 100644 --- a/editeng/source/uno/unotext.cxx +++ b/editeng/source/uno/unotext.cxx @@ -1142,23 +1142,39 @@ bool SvxUnoTextRangeBase::_getOnePropertyStates(const SfxItemSet* pSet, const Sf switch (pMap->nMemberId) { case MID_COLOR_THEME_INDEX: - if (pColor->GetThemeColor().GetThemeIndex() == -1) + if (pColor->GetThemeColor().getType() == model::ThemeColorType::Unknown) { eItemState = SfxItemState::DEFAULT; } break; case MID_COLOR_LUM_MOD: - if (pColor->GetThemeColor().GetLumMod() == 10000) + { + sal_Int16 nLumMod = 10000; + for (auto const& rTransform : pColor->GetThemeColor().getTransformations()) + { + if (rTransform.meType == model::TransformationType::LumMod) + nLumMod = rTransform.mnValue; + } + if (nLumMod == 10000) { eItemState = SfxItemState::DEFAULT; } break; + } case MID_COLOR_LUM_OFF: - if (pColor->GetThemeColor().GetLumOff() == 0) + { + sal_Int16 nLumOff = 0; + for (auto const& rTransform : pColor->GetThemeColor().getTransformations()) + { + if (rTransform.meType == model::TransformationType::LumOff) + nLumOff = rTransform.mnValue; + } + if (nLumOff == 0) { eItemState = SfxItemState::DEFAULT; } break; + } } } diff --git a/include/docmodel/dllapi.h b/include/docmodel/dllapi.h new file mode 100644 index 000000000000..f90b7cc4c08e --- /dev/null +++ b/include/docmodel/dllapi.h @@ -0,0 +1,21 @@ +/* -*- 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/. + */ + +#pragma once + +#include + +#if defined(DOCMODEL_DLLIMPLEMENTATION) +#define DOCMODEL_DLLPUBLIC SAL_DLLPUBLIC_EXPORT +#else +#define DOCMODEL_DLLPUBLIC SAL_DLLPUBLIC_IMPORT +#endif +#define DOCMODEL_DLLPRIVATE SAL_DLLPRIVATE + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/docmodel/theme/ThemeColor.hxx b/include/docmodel/theme/ThemeColor.hxx new file mode 100644 index 000000000000..2069594713d8 --- /dev/null +++ b/include/docmodel/theme/ThemeColor.hxx @@ -0,0 +1,146 @@ +/* -*- 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/. + * + */ + +#pragma once + +#include +#include +#include +#include + +namespace model +{ +/** Color transfomation type */ +enum class TransformationType +{ + Undefined, + Red, + RedMod, + RedOff, + Green, + GreenMod, + GreenOff, + Blue, + BlueMod, + BlueOff, + Alpha, + AlphaMod, + AlphaOff, + Hue, + HueMod, + HueOff, + Sat, + SatMod, + SatOff, + Lum, + LumMod, + LumOff, + Shade, + Tint, + Gray, + Comp, + Inv, + Gamma, + InvGamma +}; + +/** Definition of a color transformation. + * + * This just defines how a color should be transformed (changed). The + * type defines what kind of transformation should occur and the value + * defines by how much. + */ +struct DOCMODEL_DLLPUBLIC Transformation +{ + TransformationType meType = TransformationType::Undefined; + sal_Int16 mnValue = 0; /// percentage value -10000 to +10000 + + bool operator==(const Transformation& rTransformation) const + { + return meType == rTransformation.meType && mnValue == rTransformation.mnValue; + } +}; + +/** Definition of a theme color + * + * A theme color is defined by the type of theme color and a set of + * transformations that in addition manipulate the resulting color + * (i.e. tints, shades). + */ +class DOCMODEL_DLLPUBLIC ThemeColor +{ + ThemeColorType meType = ThemeColorType::Unknown; + std::vector maTransformations; + +public: + ThemeColor() = default; + + ThemeColorType getType() const { return meType; } + + void setType(ThemeColorType eType) { meType = eType; } + + void clearTransformations() { maTransformations.clear(); } + + void addTransformation(Transformation const& rTransform) + { + maTransformations.push_back(rTransform); + } + + void removeTransformations(TransformationType eType) + { + maTransformations.erase(std::remove_if(maTransformations.begin(), maTransformations.end(), + [eType](Transformation const& rTransform) { + return rTransform.meType == eType; + }), + maTransformations.end()); + } + + std::vector const& getTransformations() const { return maTransformations; } + + /** Applies the defined trasformations to the input color */ + Color applyTransformations(Color const& rColor) const + { + Color aColor(rColor); + + for (auto const& rTransform : maTransformations) + { + switch (rTransform.meType) + { + case TransformationType::Tint: + aColor.ApplyTintOrShade(rTransform.mnValue); + break; + case TransformationType::Shade: + aColor.ApplyTintOrShade(-rTransform.mnValue); + break; + case TransformationType::LumMod: + aColor.ApplyLumModOff(rTransform.mnValue, 0); + break; + case TransformationType::LumOff: + aColor.ApplyLumModOff(10000, rTransform.mnValue); + break; + default: + break; + } + } + return aColor; + } + + bool operator==(const ThemeColor& rThemeColor) const + { + return meType == rThemeColor.meType + && maTransformations.size() == rThemeColor.maTransformations.size() + && std::equal(maTransformations.begin(), maTransformations.end(), + rThemeColor.maTransformations.begin()); + } +}; + +} // end of namespace model + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/docmodel/theme/ThemeColorType.hxx b/include/docmodel/theme/ThemeColorType.hxx new file mode 100644 index 000000000000..a8ed9a56a6dc --- /dev/null +++ b/include/docmodel/theme/ThemeColorType.hxx @@ -0,0 +1,42 @@ +/* -*- 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/. + * + */ + +#pragma once + +namespace model +{ +/// Offsets into the color list of a theme. +enum class ThemeColorType : sal_Int32 +{ + Unknown = -1, + Dark1 = 0, + Light1 = 1, + Dark2 = 2, + Light2 = 3, + Accent1 = 4, + Accent2 = 5, + Accent3 = 6, + Accent4 = 7, + Accent5 = 8, + Accent6 = 9, + Hyperlink = 10, + FollowedHyperlink = 11, + LAST = FollowedHyperlink +}; + +constexpr ThemeColorType convertToThemeColorType(sal_Int32 nIndex) +{ + if (nIndex < 0 || nIndex > 11) + return ThemeColorType::Unknown; + return static_cast(nIndex); +} +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/docmodel/uno/UnoThemeColor.hxx b/include/docmodel/uno/UnoThemeColor.hxx new file mode 100644 index 000000000000..50063ab981dd --- /dev/null +++ b/include/docmodel/uno/UnoThemeColor.hxx @@ -0,0 +1,55 @@ +/* -*- 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/. + */ + +#pragma once + +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +class DOCMODEL_DLLPUBLIC UnoThemeColor final + : public cppu::WeakImplHelper +{ +private: + model::ThemeColor maThemeColor; + +public: + UnoThemeColor(model::ThemeColor const& rThemeColor) + : maThemeColor(rThemeColor) + { + } + + model::ThemeColor const& getThemeColor() const { return maThemeColor; } + + // XThemeColor + sal_Int16 SAL_CALL getType() override; + + UNO3_GETIMPLEMENTATION_DECL(UnoThemeColor) +}; + +namespace model::theme +{ +DOCMODEL_DLLPUBLIC css::uno::Reference +createXThemeColor(model::ThemeColor const& rThemeColor); + +DOCMODEL_DLLPUBLIC void +setFromXThemeColor(model::ThemeColor& rThemeColor, + css::uno::Reference const& rxThemeColor); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/editeng/colritem.hxx b/include/editeng/colritem.hxx index 05a7183c8582..d4090eb9e7eb 100644 --- a/include/editeng/colritem.hxx +++ b/include/editeng/colritem.hxx @@ -22,63 +22,17 @@ #include #include #include +#include #define VERSION_USEAUTOCOLOR 1 -/// Represents theme metadata for a (tools) Color. -class EDITENG_DLLPUBLIC SvxThemeColor -{ - sal_Int16 maThemeIndex; - /// Luminance Modulation: 100th percentage, defaults to 100%. - sal_Int16 mnLumMod; - /// Luminance Offset: 100th percentage, defaults to 0%. - sal_Int16 mnLumOff; - - sal_Int16 mnTintOrShade; - -public: - explicit SvxThemeColor(); - bool operator==(const SvxThemeColor& rThemeColor) const; - - sal_Int16 GetThemeIndex() const - { - return maThemeIndex; - } - - void SetThemeIndex(sal_Int16 nIndex) - { - maThemeIndex = nIndex; - - } - void SetLumMod(sal_Int16 nLumMod) { mnLumMod = nLumMod; } - - sal_Int16 GetLumMod() const { return mnLumMod; } - - void SetLumOff(sal_Int16 nLumOff) { mnLumOff = nLumOff; } - - sal_Int16 GetLumOff() const { return mnLumOff; } - - sal_Int16 GetTintOrShade() const - { - return mnTintOrShade; - } - - void SetTintOrShade(sal_Int16 nTintOrShade) - { - mnTintOrShade = nTintOrShade; - } - - void dumpAsXml(xmlTextWriterPtr pWriter) const; -}; - /** SvxColorItem item describes a color. */ class EDITENG_DLLPUBLIC SvxColorItem final : public SfxPoolItem { private: Color mColor; - SvxThemeColor maThemeColor; - + model::ThemeColor maThemeColor; public: static SfxPoolItem* CreateDefault(); @@ -105,9 +59,9 @@ public: } void SetValue(const Color& rNewColor); - SvxThemeColor& GetThemeColor() { return maThemeColor; } + model::ThemeColor& GetThemeColor() { return maThemeColor; } - const SvxThemeColor& GetThemeColor() const { return maThemeColor; } + const model::ThemeColor& GetThemeColor() const { return maThemeColor; } void dumpAsXml(xmlTextWriterPtr pWriter) const override; }; diff --git a/include/svx/ColorSets.hxx b/include/svx/ColorSets.hxx index 115b7448a8a0..a5d41cc05a57 100644 --- a/include/svx/ColorSets.hxx +++ b/include/svx/ColorSets.hxx @@ -18,6 +18,7 @@ #include #include #include +#include #include typedef struct _xmlTextWriter* xmlTextWriterPtr; @@ -26,31 +27,6 @@ class SdrPage; namespace svx { -/// Offsets into the color list of a theme. -enum class ThemeColorType : sal_Int32 -{ - Unknown = -1, - Dark1 = 0, - Light1 = 1, - Dark2 = 2, - Light2 = 3, - Accent1 = 4, - Accent2 = 5, - Accent3 = 6, - Accent4 = 7, - Accent5 = 8, - Accent6 = 9, - Hyperlink = 10, - FollowedHyperlink = 11, - LAST = FollowedHyperlink -}; - -constexpr ThemeColorType convertToThemeColorType(sal_Int32 nIndex) -{ - if (nIndex < 0 || nIndex > 11) - return ThemeColorType::Unknown; - return static_cast(nIndex); -} class SVXCORE_DLLPUBLIC ColorSet { @@ -67,9 +43,9 @@ public: return maName; } - Color getColor(ThemeColorType nType) const + Color getColor(model::ThemeColorType nType) const { - if (nType == ThemeColorType::Unknown) + if (nType == model::ThemeColorType::Unknown) { SAL_WARN("svx", "ColorSet::getColor with ThemeColorType::Unknown"); return COL_AUTO; @@ -279,7 +255,7 @@ public: std::vector GetColors() const; - Color GetColor(ThemeColorType eType) const; + Color GetColor(model::ThemeColorType eType) const; }; } // end of namespace svx diff --git a/include/svx/xcolit.hxx b/include/svx/xcolit.hxx index 5b882f9a97a9..3ece0ef3b52b 100644 --- a/include/svx/xcolit.hxx +++ b/include/svx/xcolit.hxx @@ -22,18 +22,17 @@ #include #include +#include #include #include class XColorList; - - class SVXCORE_DLLPUBLIC XColorItem : public NameOrIndex { Color aColor; - SvxThemeColor maThemeColor; + model::ThemeColor maThemeColor; public: static SfxPoolItem* CreateDefault(); @@ -51,8 +50,8 @@ public: const Color& GetColorValue() const; void SetColorValue(const Color& rNew) { aColor = rNew; Detach(); } - SvxThemeColor& GetThemeColor() { return maThemeColor; } - const SvxThemeColor& GetThemeColor() const { return maThemeColor; } + model::ThemeColor& GetThemeColor() { return maThemeColor; } + const model::ThemeColor& GetThemeColor() const { return maThemeColor; } virtual void dumpAsXml(xmlTextWriterPtr pWriter) const override; }; diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk index 6d0b4c1b5954..4913d17747c6 100644 --- a/offapi/UnoApi_offapi.mk +++ b/offapi/UnoApi_offapi.mk @@ -4173,6 +4173,7 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,com/sun/star/util,\ XCloseBroadcaster \ XCloseListener \ XCloseable \ + XThemeColor \ XDataEditor \ XDataEditorListener \ XFlushListener \ diff --git a/offapi/com/sun/star/util/XThemeColor.idl b/offapi/com/sun/star/util/XThemeColor.idl new file mode 100644 index 000000000000..7da38c4850a2 --- /dev/null +++ b/offapi/com/sun/star/util/XThemeColor.idl @@ -0,0 +1,26 @@ +/* -*- 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/. + */ + + +module com { module sun { module star { module util { + + +/** Theme Color interface + + @since LibreOffice 7.6 +*/ +interface XThemeColor +{ + /** Type of the theme color */ + short getType(); +}; + +}; }; }; }; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/CppunitTest_oox_drawingml.mk b/oox/CppunitTest_oox_drawingml.mk index 0ad75df13870..3a9e0d0a28f7 100644 --- a/oox/CppunitTest_oox_drawingml.mk +++ b/oox/CppunitTest_oox_drawingml.mk @@ -23,6 +23,7 @@ $(eval $(call gb_CppunitTest_use_libraries,oox_drawingml, \ comphelper \ cppu \ cppuhelper \ + docmodel \ oox \ sal \ subsequenttest \ diff --git a/oox/CppunitTest_oox_shape.mk b/oox/CppunitTest_oox_shape.mk index 2d3638763490..073a21133708 100644 --- a/oox/CppunitTest_oox_shape.mk +++ b/oox/CppunitTest_oox_shape.mk @@ -23,6 +23,7 @@ $(eval $(call gb_CppunitTest_use_libraries,oox_shape, \ comphelper \ cppu \ cppuhelper \ + docmodel \ oox \ sal \ subsequenttest \ diff --git a/oox/CppunitTest_oox_tokenmap.mk b/oox/CppunitTest_oox_tokenmap.mk index 46294ecab965..60557288646e 100644 --- a/oox/CppunitTest_oox_tokenmap.mk +++ b/oox/CppunitTest_oox_tokenmap.mk @@ -40,6 +40,7 @@ $(eval $(call gb_CppunitTest_use_libraries,oox_tokenmap,\ comphelper \ cppu \ cppuhelper \ + docmodel \ editeng \ expwrap \ drawinglayer \ diff --git a/oox/Library_oox.mk b/oox/Library_oox.mk index 67f4f6e1ec0f..9943c2e7eb38 100644 --- a/oox/Library_oox.mk +++ b/oox/Library_oox.mk @@ -46,6 +46,7 @@ $(eval $(call gb_Library_use_libraries,oox,\ editeng \ expwrap \ drawinglayer \ + docmodel \ msfilter \ sal \ i18nlangtag \ diff --git a/oox/inc/pch/precompiled_oox.hxx b/oox/inc/pch/precompiled_oox.hxx index 4281760d10cc..cba76097feed 100644 --- a/oox/inc/pch/precompiled_oox.hxx +++ b/oox/inc/pch/precompiled_oox.hxx @@ -13,7 +13,7 @@ manual changes will be rewritten by the next run of update_pch.sh (which presumably also fixes all possible problems, so it's usually better to use it). - Generated on 2021-09-28 05:37:38 using: + Generated on 2023-01-10 23:28:48 using: ./bin/update_pch oox oox --cutoff=6 --exclude:system --exclude:module --include:local If after updating build fails, use the following command to locate conflicting headers: @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -36,9 +37,11 @@ #include #include #include +#include #include #include #include +#include #include #include #include @@ -47,13 +50,12 @@ #include #include #include +#include #endif // PCH_LEVEL >= 1 #if PCH_LEVEL >= 2 #include -#include #include #include -#include #include #include #include @@ -67,6 +69,7 @@ #include #include #include +#include #include #include #include @@ -79,14 +82,21 @@ #include #include #include +#include #include #include +#include +#include #include +#include #include #include #include #include #include +#include +#include +#include #include #include #include @@ -105,7 +115,9 @@ #include #include #include +#include #include +#include #include #endif // PCH_LEVEL >= 2 #if PCH_LEVEL >= 3 @@ -113,8 +125,13 @@ #include #include #include +#include +#include #include +#include +#include #include +#include #include #include #include @@ -122,15 +139,20 @@ #include #include #include +#include #include -#include #include #include #include +#include +#include +#include #include #include #include #include +#include +#include #include #include #include @@ -147,6 +169,7 @@ #include #include #include +#include #include #include #include @@ -167,7 +190,9 @@ #include #include #include +#include #include +#include #include #include #include @@ -175,18 +200,15 @@ #include #include #include -#include #include #include -#include -#include -#include -#include -#include +#include +#include #include #include #include #include +#include #include #include #include @@ -200,25 +222,42 @@ #include #include #include +#include +#include #include #include #include #include #include +#include +#include #include +#include #include #include +#include +#include +#include #include +#include +#include +#include +#include +#include #include +#include +#include +#include #include #include #include +#include #include -#include #include #include #include #include +#include #include #include #include @@ -243,14 +282,11 @@ #include #include #include -#include -#include -#include #include #include #include -#include #include +#include #include #include #include @@ -261,16 +297,15 @@ #include #include #include -#include #include #include #include -#include #include #include #include #include #include +#include #include #include #include diff --git a/oox/source/export/ThemeExport.cxx b/oox/source/export/ThemeExport.cxx index f11b894f924a..b1684986f028 100644 --- a/oox/source/export/ThemeExport.cxx +++ b/oox/source/export/ThemeExport.cxx @@ -224,19 +224,19 @@ bool ThemeExport::writeFormatScheme(sax_fastparser::FSHelperPtr pFS) bool ThemeExport::writeColorSet(sax_fastparser::FSHelperPtr pFS, svx::Theme const& rTheme) { - static std::unordered_map constTokenMap - = { { XML_dk1, svx::ThemeColorType::Dark1 }, - { XML_lt1, svx::ThemeColorType::Light1 }, - { XML_dk2, svx::ThemeColorType::Dark2 }, - { XML_lt2, svx::ThemeColorType::Light2 }, - { XML_accent1, svx::ThemeColorType::Accent1 }, - { XML_accent2, svx::ThemeColorType::Accent2 }, - { XML_accent3, svx::ThemeColorType::Accent3 }, - { XML_accent4, svx::ThemeColorType::Accent4 }, - { XML_accent5, svx::ThemeColorType::Accent5 }, - { XML_accent6, svx::ThemeColorType::Accent6 }, - { XML_hlink, svx::ThemeColorType::Hyperlink }, - { XML_folHlink, svx::ThemeColorType::FollowedHyperlink } }; + static std::unordered_map constTokenMap + = { { XML_dk1, model::ThemeColorType::Dark1 }, + { XML_lt1, model::ThemeColorType::Light1 }, + { XML_dk2, model::ThemeColorType::Dark2 }, + { XML_lt2, model::ThemeColorType::Light2 }, + { XML_accent1, model::ThemeColorType::Accent1 }, + { XML_accent2, model::ThemeColorType::Accent2 }, + { XML_accent3, model::ThemeColorType::Accent3 }, + { XML_accent4, model::ThemeColorType::Accent4 }, + { XML_accent5, model::ThemeColorType::Accent5 }, + { XML_accent6, model::ThemeColorType::Accent6 }, + { XML_hlink, model::ThemeColorType::Hyperlink }, + { XML_folHlink, model::ThemeColorType::FollowedHyperlink } }; static std::array constTokenArray = { XML_dk1, XML_lt1, XML_dk2, XML_lt2, XML_accent1, XML_accent2, @@ -248,7 +248,7 @@ bool ThemeExport::writeColorSet(sax_fastparser::FSHelperPtr pFS, svx::Theme cons for (auto nToken : constTokenArray) { - svx::ThemeColorType eColorType = constTokenMap[nToken]; + model::ThemeColorType eColorType = constTokenMap[nToken]; Color aColor = pColorSet->getColor(eColorType); pFS->startElementNS(XML_a, nToken); pFS->singleElementNS(XML_a, XML_srgbClr, XML_val, I32SHEX(sal_Int32(aColor))); diff --git a/sd/CppunitTest_sd_uiimpress.mk b/sd/CppunitTest_sd_uiimpress.mk index 2599d0a97982..c2ba59be987a 100644 --- a/sd/CppunitTest_sd_uiimpress.mk +++ b/sd/CppunitTest_sd_uiimpress.mk @@ -30,6 +30,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sd_uiimpress, \ cppcanvas \ cppu \ cppuhelper \ + docmodel \ drawinglayer \ editeng \ for \ diff --git a/sd/CppunitTest_sd_uimpress.mk b/sd/CppunitTest_sd_uimpress.mk index 4575a06107b5..bff68b0386d0 100644 --- a/sd/CppunitTest_sd_uimpress.mk +++ b/sd/CppunitTest_sd_uimpress.mk @@ -26,6 +26,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sd_uimpress,\ cppcanvas \ cppu \ cppuhelper \ + docmodel \ drawinglayer \ drawinglayercore \ editeng \ diff --git a/sd/Library_sd.mk b/sd/Library_sd.mk index 1a3a87174098..3c60a60b3a3d 100644 --- a/sd/Library_sd.mk +++ b/sd/Library_sd.mk @@ -74,6 +74,7 @@ $(eval $(call gb_Library_use_libraries,sd,\ cppcanvas \ cppu \ cppuhelper \ + docmodel \ drawinglayercore \ drawinglayer \ editeng \ diff --git a/sd/inc/pch/precompiled_sd.hxx b/sd/inc/pch/precompiled_sd.hxx index 8963b9432162..b4110da7f641 100644 --- a/sd/inc/pch/precompiled_sd.hxx +++ b/sd/inc/pch/precompiled_sd.hxx @@ -13,7 +13,7 @@ manual changes will be rewritten by the next run of update_pch.sh (which presumably also fixes all possible problems, so it's usually better to use it). - Generated on 2022-08-08 10:27:15 using: + Generated on 2023-01-10 23:30:40 using: ./bin/update_pch sd sd --cutoff=4 --exclude:system --exclude:module --include:local If after updating build fails, use the following command to locate conflicting headers: @@ -25,16 +25,21 @@ #include #include #include +#include #include +#include #include #include #include #include +#include #include #include +#include #include #include #include +#include #include #include #include @@ -61,12 +66,16 @@ #include #include #include +#include #include -#include +#include #include #include +#include #include #include +#include +#include #include #include #include @@ -77,13 +86,13 @@ #include #include #include +#include #include #include #include #include #include #include -#include #include #include #include @@ -96,6 +105,7 @@ #include #include #include +#include #include #include #include @@ -121,6 +131,7 @@ #include #include #include +#include #include #include #include @@ -131,6 +142,7 @@ #include #include #include +#include #include #include #include @@ -138,10 +150,27 @@ #include #include #include +#include +#include +#include +#include #include +#include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include #include #include +#include #include #include #include @@ -164,9 +193,13 @@ #include #include #include +#include +#include +#include #include #include #include +#include #include #include #include @@ -185,6 +218,7 @@ #include #include #include +#include #include #include #include @@ -198,11 +232,20 @@ #include #include #include +#include +#include +#include +#include #include #include #include +#include +#include +#include +#include #include #include +#include #include #include #include @@ -226,6 +269,8 @@ #include #include #include +#include +#include #include #include #include @@ -233,6 +278,7 @@ #include #include #include +#include #include #include #include @@ -293,16 +339,17 @@ #include #include #include +#include #include #include #include #include -#include #include #include #include #include #include +#include #include #include #include @@ -312,7 +359,10 @@ #include #include #include +#include #include +#include +#include #include #include #include @@ -351,6 +401,7 @@ #include #include #include +#include #include #include #include @@ -368,6 +419,7 @@ #include #include #include +#include #include #include #include @@ -385,9 +437,11 @@ #include #include #include +#include #include #include #include +#include #include #include #include @@ -402,6 +456,7 @@ #include #include #include +#include #include #include #include @@ -422,6 +477,7 @@ #include #include #include +#include #include #include #include @@ -448,12 +504,11 @@ #include #include #include -#include #include #include +#include #include #include -#include #include #include #include @@ -474,6 +529,7 @@ #include #include #include +#include #include #include #include diff --git a/sd/source/core/stlsheet.cxx b/sd/source/core/stlsheet.cxx index 4d72cf0915c6..b12e280f231f 100644 --- a/sd/source/core/stlsheet.cxx +++ b/sd/source/core/stlsheet.cxx @@ -1358,7 +1358,7 @@ PropertyState SAL_CALL SdStyleSheet::getPropertyState( const OUString& PropertyN if (pEntry->nMemberId == MID_COLOR_THEME_INDEX) { const XFillColorItem* pColor = rStyleSet.GetItem(pEntry->nWID); - if (pColor->GetThemeColor().GetThemeIndex() == -1) + if (pColor->GetThemeColor().getType() == model::ThemeColorType::Unknown) { eState = PropertyState_DEFAULT_VALUE; } @@ -1366,7 +1366,13 @@ PropertyState SAL_CALL SdStyleSheet::getPropertyState( const OUString& PropertyN else if (pEntry->nMemberId == MID_COLOR_LUM_MOD) { const XFillColorItem* pColor = rStyleSet.GetItem(pEntry->nWID); - if (pColor->GetThemeColor().GetLumMod() == 10000) + sal_Int16 nLumMod = 10000; + for (auto const& rTransform : pColor->GetThemeColor().getTransformations()) + { + if (rTransform.meType == model::TransformationType::LumMod) + nLumMod = rTransform.mnValue; + } + if (nLumMod == 10000) { eState = PropertyState_DEFAULT_VALUE; } @@ -1374,7 +1380,13 @@ PropertyState SAL_CALL SdStyleSheet::getPropertyState( const OUString& PropertyN else if (pEntry->nMemberId == MID_COLOR_LUM_OFF) { const XFillColorItem* pColor = rStyleSet.GetItem(pEntry->nWID); - if (pColor->GetThemeColor().GetLumOff() == 0) + sal_Int16 nLumOff = 0; + for (auto const& rTransform : pColor->GetThemeColor().getTransformations()) + { + if (rTransform.meType == model::TransformationType::LumOff) + nLumOff = rTransform.mnValue; + } + if (nLumOff == 0) { eState = PropertyState_DEFAULT_VALUE; } diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx index d0d602cb4299..3827c90e045e 100644 --- a/sd/source/filter/eppt/pptx-epptooxml.cxx +++ b/sd/source/filter/eppt/pptx-epptooxml.cxx @@ -2186,7 +2186,7 @@ bool PowerPointExport::WriteColorSets(const FSHelperPtr& pFS, svx::Theme* pTheme { sal_Int32 nToken = aPredefinedClrTokens[static_cast(nId)]; pFS->startElementNS(XML_a, nToken); - svx::ThemeColorType eType = svx::convertToThemeColorType(nId); + model::ThemeColorType eType = model::convertToThemeColorType(nId); pFS->singleElementNS(XML_a, XML_srgbClr, XML_val, I32SHEX(static_cast(pColorSet->getColor(eType)))); pFS->endElementNS(XML_a, nToken); } diff --git a/sd/source/ui/func/fuconstr.cxx b/sd/source/ui/func/fuconstr.cxx index dd086641cdbf..e7f0bb3a67bb 100644 --- a/sd/source/ui/func/fuconstr.cxx +++ b/sd/source/ui/func/fuconstr.cxx @@ -389,10 +389,10 @@ void FuConstruct::SetStyleSheet( SfxItemSet& rAttr, SdrObject* pObj, aAttr.Put(XFillStyleItem(css::drawing::FillStyle_SOLID)); - svx::ThemeColorType eColorType = svx::ThemeColorType::Accent1; + model::ThemeColorType eColorType = model::ThemeColorType::Accent1; Color aColor = pTheme->GetColor(eColorType); XFillColorItem aFillColorItem("", aColor); - aFillColorItem.GetThemeColor().SetThemeIndex(static_cast(eColorType)); + aFillColorItem.GetThemeColor().setType(eColorType); aAttr.Put(aFillColorItem); aAttr.Put(XLineStyleItem(css::drawing::LineStyle_SOLID)); diff --git a/sd/source/ui/view/drtxtob1.cxx b/sd/source/ui/view/drtxtob1.cxx index 6282b750aa06..7fba8728d991 100644 --- a/sd/source/ui/view/drtxtob1.cxx +++ b/sd/source/ui/view/drtxtob1.cxx @@ -780,21 +780,20 @@ void TextObjectBar::Execute( SfxRequest &rReq ) if (nSlot == SID_ATTR_CHAR_COLOR) { pColorItem = std::make_unique(pNewArgs->Get(EE_CHAR_COLOR)); - } - if (const SfxInt16Item* pIntItem = pArgs->GetItemIfSet(SID_ATTR_COLOR_THEME_INDEX, false)) - { - pColorItem->GetThemeColor().SetThemeIndex(pIntItem->GetValue()); - } - if (const SfxInt16Item* pIntItem = pArgs->GetItemIfSet(SID_ATTR_COLOR_LUM_MOD, false)) - { - pColorItem->GetThemeColor().SetLumMod(pIntItem->GetValue()); - } - if (const SfxInt16Item* pIntItem = pArgs->GetItemIfSet(SID_ATTR_COLOR_LUM_OFF, false)) - { - pColorItem->GetThemeColor().SetLumOff(pIntItem->GetValue()); - } - if (pColorItem) - { + pColorItem->GetThemeColor().clearTransformations(); + + if (const SfxInt16Item* pIntItem = pArgs->GetItemIfSet(SID_ATTR_COLOR_THEME_INDEX, false)) + { + pColorItem->GetThemeColor().setType(model::convertToThemeColorType(pIntItem->GetValue())); + } + if (const SfxInt16Item* pIntItem = pArgs->GetItemIfSet(SID_ATTR_COLOR_LUM_MOD, false)) + { + pColorItem->GetThemeColor().addTransformation({model::TransformationType::LumMod, pIntItem->GetValue()}); + } + if (const SfxInt16Item* pIntItem = pArgs->GetItemIfSet(SID_ATTR_COLOR_LUM_OFF, false)) + { + pColorItem->GetThemeColor().addTransformation({model::TransformationType::LumOff, pIntItem->GetValue()}); + } pNewArgs->Put(std::move(pColorItem)); } diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index b2c2803a2438..a390533e89dc 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -575,20 +575,21 @@ public: if (pColorItem) { XFillColorItem aColorItem(*pColorItem); + aColorItem.GetThemeColor().clearTransformations(); if (pArgs->GetItemState(SID_ATTR_COLOR_THEME_INDEX, false, &pItem) == SfxItemState::SET) { auto pIntItem = static_cast(pItem); - aColorItem.GetThemeColor().SetThemeIndex(pIntItem->GetValue()); + aColorItem.GetThemeColor().setType(model::convertToThemeColorType(pIntItem->GetValue())); } if (pArgs->GetItemState(SID_ATTR_COLOR_LUM_MOD, false, &pItem) == SfxItemState::SET) { auto pIntItem = static_cast(pItem); - aColorItem.GetThemeColor().SetLumMod(pIntItem->GetValue()); + aColorItem.GetThemeColor().addTransformation({model::TransformationType::LumMod, pIntItem->GetValue()}); } if (pArgs->GetItemState(SID_ATTR_COLOR_LUM_OFF, false, &pItem) == SfxItemState::SET) { auto pIntItem = static_cast(pItem); - aColorItem.GetThemeColor().SetLumOff(pIntItem->GetValue()); + aColorItem.GetThemeColor().addTransformation({model::TransformationType::LumOff, pIntItem->GetValue()}); } pArgs->Put(aColorItem); } diff --git a/solenv/gbuild/extensions/pre_MergedLibsList.mk b/solenv/gbuild/extensions/pre_MergedLibsList.mk index b2402ec0c2af..6bf0157a361b 100644 --- a/solenv/gbuild/extensions/pre_MergedLibsList.mk +++ b/solenv/gbuild/extensions/pre_MergedLibsList.mk @@ -28,6 +28,7 @@ gb_MERGE_LIBRARY_LIST := \ deploymentmisc \ $(if $(filter-out MACOSX WNT,$(OS)),desktopbe1) \ $(if $(filter WNT,$(OS)),directx9canvas) \ + docmodel \ drawinglayercore \ drawinglayer \ editeng \ diff --git a/solenv/qa/python/gbuildtojson.py b/solenv/qa/python/gbuildtojson.py index 8f08668dbbdd..e693f75f5947 100644 --- a/solenv/qa/python/gbuildtojson.py +++ b/solenv/qa/python/gbuildtojson.py @@ -124,7 +124,7 @@ class CheckGbuildToJsonModules(unittest.TestCase): shutil.rmtree(self.tempwork) def test_gbuildtojson(self): - modules = ['accessibility', 'android', 'animations', 'apple_remote', 'avmedia', 'basctl', 'basegfx', 'basic', 'bean', 'canvas', 'chart2', 'codemaker', 'comphelper', 'cppcanvas', 'cui', 'dbaccess', 'desktop', 'drawinglayer', 'editeng', 'embeddedobj', 'embedserv', 'eventattacher', 'extras', 'filter', 'forms', 'formula', 'fpicker', 'framework', 'hwpfilter', 'i18nlangtag', 'i18nutil', 'idl', 'instsetoo_native', 'io', 'ios', 'jvmaccess', 'jvmfwk', 'l10ntools', 'librelogo', 'libreofficekit', 'linguistic', 'lotuswordpro', 'nlpsolver', 'o3tl', 'offapi', 'officecfg', 'onlineupdate', 'oovbaapi', 'oox', 'opencl', 'package', 'postprocess', 'pyuno', 'registry', 'remotebridges', 'reportbuilder', 'reportdesign', 'ridljar', 'salhelper', 'sax', 'sc', 'sccomp', 'scp2', 'scripting', 'sd', 'sdext', 'setup_native', 'sfx2', 'slideshow', 'smoketest', 'soltools', 'sot', 'starmath', 'store', 'svgio', 'emfio', 'svl', 'svtools', 'svx', 'sw', 'swext', 'sysui', 'test', 'testtools', 'toolkit', 'ucb', 'ucbhelper', 'udkapi', 'uitest', 'UnoControls', 'unodevtools', 'unoidl', 'unoil', 'unotest', 'unotools', 'unoxml', 'ure', 'uui', 'vbahelper', 'vcl', 'winaccessibility', 'wizards', 'writerperfect', 'xmerge', 'xmlhelp', 'xmloff', 'xmlreader', 'xmlscript', 'xmlsecurity'] + modules = ['accessibility', 'android', 'animations', 'apple_remote', 'avmedia', 'basctl', 'basegfx', 'basic', 'bean', 'canvas', 'chart2', 'codemaker', 'comphelper', 'cppcanvas', 'cui', 'dbaccess', 'desktop', 'docmodel', 'drawinglayer', 'editeng', 'embeddedobj', 'embedserv', 'eventattacher', 'extras', 'filter', 'forms', 'formula', 'fpicker', 'framework', 'hwpfilter', 'i18nlangtag', 'i18nutil', 'idl', 'instsetoo_native', 'io', 'ios', 'jvmaccess', 'jvmfwk', 'l10ntools', 'librelogo', 'libreofficekit', 'linguistic', 'lotuswordpro', 'nlpsolver', 'o3tl', 'offapi', 'officecfg', 'onlineupdate', 'oovbaapi', 'oox', 'opencl', 'package', 'postprocess', 'pyuno', 'registry', 'remotebridges', 'reportbuilder', 'reportdesign', 'ridljar', 'salhelper', 'sax', 'sc', 'sccomp', 'scp2', 'scripting', 'sd', 'sdext', 'setup_native', 'sfx2', 'slideshow', 'smoketest', 'soltools', 'sot', 'starmath', 'store', 'svgio', 'emfio', 'svl', 'svtools', 'svx', 'sw', 'swext', 'sysui', 'test', 'testtools', 'toolkit', 'ucb', 'ucbhelper', 'udkapi', 'uitest', 'UnoControls', 'unodevtools', 'unoidl', 'unoil', 'unotest', 'unotools', 'unoxml', 'ure', 'uui', 'vbahelper', 'vcl', 'winaccessibility', 'wizards', 'writerperfect', 'xmerge', 'xmlhelp', 'xmloff', 'xmlreader', 'xmlscript', 'xmlsecurity'] if os.environ['OS'] == 'WNT': # for now, use a limited subset for testing on windows as it is so annoyingly slow on this modules = ['chart2', 'cui', 'dbaccess', 'framework', 'oox', 'sfx2', 'svl', 'svtools', 'svx', 'toolkit', 'vcl', 'xmloff'] diff --git a/svx/CppunitTest_svx_removewhichrange.mk b/svx/CppunitTest_svx_removewhichrange.mk index 6819c4452609..9fea95320f7b 100644 --- a/svx/CppunitTest_svx_removewhichrange.mk +++ b/svx/CppunitTest_svx_removewhichrange.mk @@ -23,6 +23,7 @@ $(eval $(call gb_CppunitTest_use_libraries,svx_removewhichrange, \ comphelper \ cppu \ cppuhelper \ + docmodel \ drawinglayer \ drawinglayercore \ editeng \ diff --git a/svx/CppunitTest_svx_styles.mk b/svx/CppunitTest_svx_styles.mk index 60f7e13d07d3..9d5cccabb8b9 100644 --- a/svx/CppunitTest_svx_styles.mk +++ b/svx/CppunitTest_svx_styles.mk @@ -23,6 +23,7 @@ $(eval $(call gb_CppunitTest_use_libraries,svx_styles, \ comphelper \ cppu \ cppuhelper \ + docmodel \ svx \ sal \ subsequenttest \ diff --git a/svx/CppunitTest_svx_unit.mk b/svx/CppunitTest_svx_unit.mk index 678a27322e02..a46aa5b0d583 100644 --- a/svx/CppunitTest_svx_unit.mk +++ b/svx/CppunitTest_svx_unit.mk @@ -38,6 +38,7 @@ $(eval $(call gb_CppunitTest_add_exception_objects,svx_unit, \ $(eval $(call gb_CppunitTest_use_libraries,svx_unit, \ basegfx \ + docmodel \ drawinglayer \ drawinglayercore \ editeng \ diff --git a/svx/Library_svxcore.mk b/svx/Library_svxcore.mk index 6a1c0b5de352..439ae516427c 100644 --- a/svx/Library_svxcore.mk +++ b/svx/Library_svxcore.mk @@ -62,6 +62,7 @@ $(eval $(call gb_Library_use_libraries,svxcore,\ cppu \ $(call gb_Helper_optional,DBCONNECTIVITY, \ dbtools) \ + docmodel \ drawinglayercore \ drawinglayer \ editeng \ diff --git a/svx/inc/pch/precompiled_svx.hxx b/svx/inc/pch/precompiled_svx.hxx index 8f83a82187d6..8ccbe5900922 100644 --- a/svx/inc/pch/precompiled_svx.hxx +++ b/svx/inc/pch/precompiled_svx.hxx @@ -13,7 +13,7 @@ manual changes will be rewritten by the next run of update_pch.sh (which presumably also fixes all possible problems, so it's usually better to use it). - Generated on 2022-01-26 09:16:16 using: + Generated on 2023-01-10 23:28:52 using: ./bin/update_pch svx svx --cutoff=3 --exclude:system --exclude:module --include:local If after updating build fails, use the following command to locate conflicting headers: @@ -26,11 +26,13 @@ #include #include #include +#include #include #include #include #include #include +#include #include #include #include @@ -84,7 +86,6 @@ #include #include #include -#include #include #include #include @@ -122,10 +123,11 @@ #include #include #include -#include -#include +#include +#include #include -#include +#include +#include #include #include #include @@ -169,7 +171,6 @@ #include #include #include -#include #include #include #include @@ -196,7 +197,6 @@ #include #include #include -#include #include #include #include @@ -206,6 +206,8 @@ #include #include #include +#include +#include #include #include #include @@ -217,7 +219,6 @@ #include #include #include -#include #include #include #include @@ -226,11 +227,9 @@ #include #include #include +#include #include -#include #include -#include -#include #include #include #include @@ -267,6 +266,8 @@ #include #include #include +#include +#include #include #include #include @@ -334,7 +335,6 @@ #include #include #include -#include #include #include #include @@ -350,15 +350,14 @@ #include #include #include -#include -#include +#include #include #include -#include #include #include #include #include +#include #endif // PCH_LEVEL >= 3 #if PCH_LEVEL >= 4 #include diff --git a/svx/source/styles/ColorSets.cxx b/svx/source/styles/ColorSets.cxx index 5511253f3d03..00ffdae3b031 100644 --- a/svx/source/styles/ColorSets.cxx +++ b/svx/source/styles/ColorSets.cxx @@ -39,9 +39,9 @@ void UpdateTextPortionColorSet(const uno::Reference& xPorti { sal_Int16 nCharColorTheme = -1; xPortion->getPropertyValue(UNO_NAME_EDIT_CHAR_COLOR_THEME) >>= nCharColorTheme; - svx::ThemeColorType eColorThemeType = svx::convertToThemeColorType(nCharColorTheme); + model::ThemeColorType eColorThemeType = model::convertToThemeColorType(nCharColorTheme); - if (eColorThemeType == svx::ThemeColorType::Unknown) + if (eColorThemeType == model::ThemeColorType::Unknown) return; Color aColor = rColorSet.getColor(eColorThemeType); @@ -74,8 +74,8 @@ void UpdateFillColorSet(const uno::Reference& xShape, const sal_Int16 nFillColorTheme = -1; xShape->getPropertyValue(UNO_NAME_FILLCOLOR_THEME) >>= nFillColorTheme; - svx::ThemeColorType eColorThemeType = svx::convertToThemeColorType(nFillColorTheme); - if (eColorThemeType == svx::ThemeColorType::Unknown) + model::ThemeColorType eColorThemeType = model::convertToThemeColorType(nFillColorTheme); + if (eColorThemeType == model::ThemeColorType::Unknown) return; Color aColor = rColorSet.getColor(eColorThemeType); @@ -281,7 +281,7 @@ void Theme::ToAny(css::uno::Any& rVal) const if (mpColorSet) { std::vector aColorScheme; - for (auto eThemeColorType : o3tl::enumrange()) + for (auto eThemeColorType : o3tl::enumrange()) { Color aColor = mpColorSet->getColor(eThemeColorType); aColorScheme.push_back(sal_Int32(aColor)); @@ -362,14 +362,14 @@ std::vector Theme::GetColors() const return {}; std::vector aColors; - for (auto eThemeColorType : o3tl::enumrange()) + for (auto eThemeColorType : o3tl::enumrange()) { aColors.push_back(mpColorSet->getColor(eThemeColorType)); } return aColors; } -Color Theme::GetColor(ThemeColorType eType) const +Color Theme::GetColor(model::ThemeColorType eType) const { if (!mpColorSet) return {}; diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx index 5dbc1ee1a8e5..4d200239c2e0 100644 --- a/svx/source/table/cell.cxx +++ b/svx/source/table/cell.cxx @@ -1450,10 +1450,11 @@ PropertyState SAL_CALL Cell::getPropertyState( const OUString& PropertyName ) } break; case XATTR_FILLCOLOR: + if (pMap->nMemberId == MID_COLOR_THEME_INDEX) { const XFillColorItem* pColor = rSet.GetItem(pMap->nWID); - if (pColor->GetThemeColor().GetThemeIndex() == -1) + if (pColor->GetThemeColor().getType() == model::ThemeColorType::Unknown) { eState = PropertyState_DEFAULT_VALUE; } @@ -1461,7 +1462,13 @@ PropertyState SAL_CALL Cell::getPropertyState( const OUString& PropertyName ) else if (pMap->nMemberId == MID_COLOR_LUM_MOD) { const XFillColorItem* pColor = rSet.GetItem(pMap->nWID); - if (pColor->GetThemeColor().GetLumMod() == 10000) + sal_Int16 nLumMod = 10000; + for (auto const& rTransform : pColor->GetThemeColor().getTransformations()) + { + if (rTransform.meType == model::TransformationType::LumMod) + nLumMod = rTransform.mnValue; + } + if (nLumMod == 10000) { eState = PropertyState_DEFAULT_VALUE; } @@ -1469,7 +1476,13 @@ PropertyState SAL_CALL Cell::getPropertyState( const OUString& PropertyName ) else if (pMap->nMemberId == MID_COLOR_LUM_OFF) { const XFillColorItem* pColor = rSet.GetItem(pMap->nWID); - if (pColor->GetThemeColor().GetLumOff() == 0) + sal_Int16 nLumOff = 0; + for (auto const& rTransform : pColor->GetThemeColor().getTransformations()) + { + if (rTransform.meType == model::TransformationType::LumOff) + nLumOff = rTransform.mnValue; + } + if (nLumOff == 0) { eState = PropertyState_DEFAULT_VALUE; } diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx index 60dd13aeac7d..9692df8c130d 100644 --- a/svx/source/unodraw/unoshape.cxx +++ b/svx/source/unodraw/unoshape.cxx @@ -1957,7 +1957,7 @@ beans::PropertyState SvxShape::_getPropertyState( const OUString& PropertyName ) if (pMap->nMemberId == MID_COLOR_THEME_INDEX) { const XFillColorItem* pColor = rSet.GetItem(pMap->nWID); - if (pColor->GetThemeColor().GetThemeIndex() == -1) + if (pColor->GetThemeColor().getType() == model::ThemeColorType::Unknown) { eState = beans::PropertyState_DEFAULT_VALUE; } @@ -1965,7 +1965,13 @@ beans::PropertyState SvxShape::_getPropertyState( const OUString& PropertyName ) else if (pMap->nMemberId == MID_COLOR_LUM_MOD) { const XFillColorItem* pColor = rSet.GetItem(pMap->nWID); - if (pColor->GetThemeColor().GetLumMod() == 10000) + sal_Int16 nLumMod = 10000; + for (auto const& rTransform : pColor->GetThemeColor().getTransformations()) + { + if (rTransform.meType == model::TransformationType::LumMod) + nLumMod = rTransform.mnValue; + } + if (nLumMod == 10000) { eState = beans::PropertyState_DEFAULT_VALUE; } @@ -1973,7 +1979,13 @@ beans::PropertyState SvxShape::_getPropertyState( const OUString& PropertyName ) else if (pMap->nMemberId == MID_COLOR_LUM_OFF) { const XFillColorItem* pColor = rSet.GetItem(pMap->nWID); - if (pColor->GetThemeColor().GetLumOff() == 0) + sal_Int16 nLumOff = 0; + for (auto const& rTransform : pColor->GetThemeColor().getTransformations()) + { + if (rTransform.meType == model::TransformationType::LumOff) + nLumOff = rTransform.mnValue; + } + if (nLumOff == 0) { eState = beans::PropertyState_DEFAULT_VALUE; } diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx index 47668cc6bf6b..38a9431a47a6 100644 --- a/svx/source/xoutdev/xattr.cxx +++ b/svx/source/xoutdev/xattr.cxx @@ -335,7 +335,22 @@ void XColorItem::dumpAsXml(xmlTextWriterPtr pWriter) const NameOrIndex::dumpAsXml(pWriter); - maThemeColor.dumpAsXml(pWriter); + (void)xmlTextWriterStartElement(pWriter, BAD_CAST("theme-color")); + + (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("theme-index"), + BAD_CAST(OString::number(sal_Int16(maThemeColor.getType())).getStr())); + + for (auto const& rTransform : maThemeColor.getTransformations()) + { + (void)xmlTextWriterStartElement(pWriter, BAD_CAST("transformation")); + (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("type"), + BAD_CAST(OString::number(sal_Int16(rTransform.meType)).getStr())); + (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), + BAD_CAST(OString::number(rTransform.mnValue).getStr())); + (void)xmlTextWriterEndElement(pWriter); + } + + (void)xmlTextWriterEndElement(pWriter); (void)xmlTextWriterEndElement(pWriter); } @@ -1908,17 +1923,29 @@ bool XFillColorItem::QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId ) cons { case MID_COLOR_THEME_INDEX: { - rVal <<= GetThemeColor().GetThemeIndex(); + rVal <<= sal_Int16(GetThemeColor().getType()); break; } case MID_COLOR_LUM_MOD: { - rVal <<= GetThemeColor().GetLumMod(); + sal_Int16 nValue = 10000; + for (auto const& rTransform : GetThemeColor().getTransformations()) + { + if (rTransform.meType == model::TransformationType::LumMod) + nValue = rTransform.mnValue; + } + rVal <<= nValue; break; } case MID_COLOR_LUM_OFF: { - rVal <<= GetThemeColor().GetLumOff(); + sal_Int16 nValue = 0; + for (auto const& rTransform : GetThemeColor().getTransformations()) + { + if (rTransform.meType == model::TransformationType::LumOff) + nValue = rTransform.mnValue; + } + rVal <<= nValue; break; } default: @@ -1941,23 +1968,25 @@ bool XFillColorItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) sal_Int16 nIndex = -1; if (!(rVal >>= nIndex)) return false; - GetThemeColor().SetThemeIndex(nIndex); + GetThemeColor().setType(model::convertToThemeColorType(nIndex)); break; } case MID_COLOR_LUM_MOD: { - sal_Int16 nLumMod = -1; + sal_Int16 nLumMod = 10000; if (!(rVal >>= nLumMod)) return false; - GetThemeColor().SetLumMod(nLumMod); + GetThemeColor().removeTransformations(model::TransformationType::LumMod); + GetThemeColor().addTransformation({model::TransformationType::LumMod, nLumMod}); } break; case MID_COLOR_LUM_OFF: { - sal_Int16 nLumOff = -1; + sal_Int16 nLumOff = 0; if (!(rVal >>= nLumOff)) return false; - GetThemeColor().SetLumOff(nLumOff); + GetThemeColor().removeTransformations(model::TransformationType::LumOff); + GetThemeColor().addTransformation({model::TransformationType::LumOff, nLumOff}); } break; default: diff --git a/sw/CppunitTest_sw_apitests.mk b/sw/CppunitTest_sw_apitests.mk index 9af8873079d3..716607dbe404 100644 --- a/sw/CppunitTest_sw_apitests.mk +++ b/sw/CppunitTest_sw_apitests.mk @@ -29,6 +29,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_apitests, \ cppu \ cppuhelper \ drawinglayer \ + docmodel \ editeng \ for \ forui \ diff --git a/sw/CppunitTest_sw_core_draw.mk b/sw/CppunitTest_sw_core_draw.mk index 63dfd5f828b9..0267fc60e2d5 100644 --- a/sw/CppunitTest_sw_core_draw.mk +++ b/sw/CppunitTest_sw_core_draw.mk @@ -21,6 +21,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_core_draw, \ comphelper \ cppu \ cppuhelper \ + docmodel \ sal \ sfx \ subsequenttest \ diff --git a/sw/CppunitTest_sw_core_theme.mk b/sw/CppunitTest_sw_core_theme.mk index 84b462ea8245..03b42a32e666 100644 --- a/sw/CppunitTest_sw_core_theme.mk +++ b/sw/CppunitTest_sw_core_theme.mk @@ -21,6 +21,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_core_theme, \ comphelper \ cppu \ cppuhelper \ + docmodel \ sal \ sfx \ subsequenttest \ diff --git a/sw/CppunitTest_sw_macros_test.mk b/sw/CppunitTest_sw_macros_test.mk index a0be4e6cd27f..9cc9b597c9ce 100644 --- a/sw/CppunitTest_sw_macros_test.mk +++ b/sw/CppunitTest_sw_macros_test.mk @@ -25,6 +25,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_macros_test, \ cppu \ cppuhelper \ drawinglayer \ + docmodel \ editeng \ for \ forui \ diff --git a/sw/CppunitTest_sw_ooxmlimport.mk b/sw/CppunitTest_sw_ooxmlimport.mk index 93ecf2324477..0df45a3b11c5 100644 --- a/sw/CppunitTest_sw_ooxmlimport.mk +++ b/sw/CppunitTest_sw_ooxmlimport.mk @@ -24,6 +24,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_ooxmlimport, \ comphelper \ cppu \ cppuhelper \ + docmodel \ sal \ sfx \ subsequenttest \ diff --git a/sw/CppunitTest_sw_ooxmlimport2.mk b/sw/CppunitTest_sw_ooxmlimport2.mk index ed8d2a92e514..89dd74ff40d1 100644 --- a/sw/CppunitTest_sw_ooxmlimport2.mk +++ b/sw/CppunitTest_sw_ooxmlimport2.mk @@ -24,6 +24,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_ooxmlimport2, \ comphelper \ cppu \ cppuhelper \ + docmodel \ sal \ sfx \ subsequenttest \ diff --git a/sw/CppunitTest_sw_tiledrendering.mk b/sw/CppunitTest_sw_tiledrendering.mk index 198fc04a0028..830167ca21d3 100644 --- a/sw/CppunitTest_sw_tiledrendering.mk +++ b/sw/CppunitTest_sw_tiledrendering.mk @@ -22,6 +22,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_tiledrendering, \ cppu \ cppuhelper \ editeng \ + docmodel \ sal \ sfx \ subsequenttest \ diff --git a/sw/CppunitTest_sw_uwriter.mk b/sw/CppunitTest_sw_uwriter.mk index 2c2361d199b6..7b328c998fe3 100644 --- a/sw/CppunitTest_sw_uwriter.mk +++ b/sw/CppunitTest_sw_uwriter.mk @@ -34,6 +34,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_uwriter, \ cppuhelper \ $(call gb_Helper_optional,DBCONNECTIVITY, \ dbtools) \ + docmodel \ drawinglayer \ drawinglayercore \ editeng \ diff --git a/sw/Library_sw.mk b/sw/Library_sw.mk index 19cb6baeac74..478136e50f54 100644 --- a/sw/Library_sw.mk +++ b/sw/Library_sw.mk @@ -58,6 +58,7 @@ $(eval $(call gb_Library_use_libraries,sw,\ cppuhelper \ $(call gb_Helper_optional,DBCONNECTIVITY, \ dbtools) \ + docmodel \ drawinglayercore \ drawinglayer \ editeng \ diff --git a/sw/layoutwriter_setup.mk b/sw/layoutwriter_setup.mk index e151bcf75509..bfc9548fceef 100644 --- a/sw/layoutwriter_setup.mk +++ b/sw/layoutwriter_setup.mk @@ -26,6 +26,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_layoutwriter$(1), \ comphelper \ cppu \ cppuhelper \ + docmodel \ editeng \ msword \ sal \ diff --git a/sw/ooxmlexport_setup.mk b/sw/ooxmlexport_setup.mk index 8f45d30be7c3..e124ee3b6a12 100644 --- a/sw/ooxmlexport_setup.mk +++ b/sw/ooxmlexport_setup.mk @@ -13,6 +13,7 @@ define sw_ooxmlexport_libraries comphelper \ cppu \ cppuhelper \ + docmodel \ editeng \ sal \ sfx \ diff --git a/sw/qa/core/theme/ThemeTest.cxx b/sw/qa/core/theme/ThemeTest.cxx index 2ab9072469c0..a6591c6b77db 100644 --- a/sw/qa/core/theme/ThemeTest.cxx +++ b/sw/qa/core/theme/ThemeTest.cxx @@ -50,16 +50,16 @@ CPPUNIT_TEST_FIXTURE(SwCoreThemeTest, testDrawPageThemeExists) CPPUNIT_ASSERT(pColorSet); CPPUNIT_ASSERT_EQUAL(OUString(u"Orange"), pColorSet->getName()); - CPPUNIT_ASSERT_EQUAL(Color(0xE48312), pTheme->GetColor(svx::ThemeColorType::Accent1)); - CPPUNIT_ASSERT_EQUAL(Color(0xBD582C), pTheme->GetColor(svx::ThemeColorType::Accent2)); - CPPUNIT_ASSERT_EQUAL(Color(0x865640), pTheme->GetColor(svx::ThemeColorType::Accent3)); - CPPUNIT_ASSERT_EQUAL(Color(0x9B8357), pTheme->GetColor(svx::ThemeColorType::Accent4)); - CPPUNIT_ASSERT_EQUAL(Color(0xC2BC80), pTheme->GetColor(svx::ThemeColorType::Accent5)); - CPPUNIT_ASSERT_EQUAL(Color(0x94A088), pTheme->GetColor(svx::ThemeColorType::Accent6)); - CPPUNIT_ASSERT_EQUAL(Color(0x000000), pTheme->GetColor(svx::ThemeColorType::Dark1)); - CPPUNIT_ASSERT_EQUAL(Color(0x637052), pTheme->GetColor(svx::ThemeColorType::Dark2)); - CPPUNIT_ASSERT_EQUAL(Color(0xFFFFFF), pTheme->GetColor(svx::ThemeColorType::Light1)); - CPPUNIT_ASSERT_EQUAL(Color(0xCCDDEA), pTheme->GetColor(svx::ThemeColorType::Light2)); + CPPUNIT_ASSERT_EQUAL(Color(0xE48312), pTheme->GetColor(model::ThemeColorType::Accent1)); + CPPUNIT_ASSERT_EQUAL(Color(0xBD582C), pTheme->GetColor(model::ThemeColorType::Accent2)); + CPPUNIT_ASSERT_EQUAL(Color(0x865640), pTheme->GetColor(model::ThemeColorType::Accent3)); + CPPUNIT_ASSERT_EQUAL(Color(0x9B8357), pTheme->GetColor(model::ThemeColorType::Accent4)); + CPPUNIT_ASSERT_EQUAL(Color(0xC2BC80), pTheme->GetColor(model::ThemeColorType::Accent5)); + CPPUNIT_ASSERT_EQUAL(Color(0x94A088), pTheme->GetColor(model::ThemeColorType::Accent6)); + CPPUNIT_ASSERT_EQUAL(Color(0x000000), pTheme->GetColor(model::ThemeColorType::Dark1)); + CPPUNIT_ASSERT_EQUAL(Color(0x637052), pTheme->GetColor(model::ThemeColorType::Dark2)); + CPPUNIT_ASSERT_EQUAL(Color(0xFFFFFF), pTheme->GetColor(model::ThemeColorType::Light1)); + CPPUNIT_ASSERT_EQUAL(Color(0xCCDDEA), pTheme->GetColor(model::ThemeColorType::Light2)); svx::FontScheme const& rFontScheme = pTheme->getFontScheme(); CPPUNIT_ASSERT_EQUAL(OUString(u"Calibri Light"), rFontScheme.getMajorLatin().maTypeface); diff --git a/sw/source/uibase/sidebar/ThemePanel.cxx b/sw/source/uibase/sidebar/ThemePanel.cxx index ad0d74e2b678..83a09d092dbf 100644 --- a/sw/source/uibase/sidebar/ThemePanel.cxx +++ b/sw/source/uibase/sidebar/ThemePanel.cxx @@ -223,11 +223,12 @@ void changeFont(SwFormat* pFormat, SwDocStyleSheet const * pStyle, FontSet const void changeColor(SwTextFormatColl* pCollection, svx::ColorSet const& rColorSet, StyleRedefinition* /*pRedefinition*/) { SvxColorItem aColorItem(pCollection->GetColor()); - auto nThemeIndex = aColorItem.GetThemeColor().GetThemeIndex(); - if (nThemeIndex >= 0) + model::ThemeColor const& rThemeColor = aColorItem.GetThemeColor(); + auto eThemeType = rThemeColor.getType(); + if (eThemeType != model::ThemeColorType::Unknown) { - Color aColor = rColorSet.getColor(svx::convertToThemeColorType(nThemeIndex)); - aColor.ApplyTintOrShade(aColorItem.GetThemeColor().GetTintOrShade()); + Color aColor = rColorSet.getColor(eThemeType); + aColor = rThemeColor.applyTransformations(aColor); aColorItem.SetValue(aColor); pCollection->SetFormatAttr(aColorItem); } @@ -399,10 +400,10 @@ BitmapEx GenerateColorPreview(const svx::ColorSet& rColorSet) for (sal_uInt32 i = 0; i < 12; i += 2) { - pVirtualDev->SetFillColor(rColorSet.getColor(svx::convertToThemeColorType(i))); + pVirtualDev->SetFillColor(rColorSet.getColor(model::convertToThemeColorType(i))); pVirtualDev->DrawRect(tools::Rectangle(x, y1, x + SIZE, y1 + SIZE)); - pVirtualDev->SetFillColor(rColorSet.getColor(svx::convertToThemeColorType(i + 1))); + pVirtualDev->SetFillColor(rColorSet.getColor(model::convertToThemeColorType(i + 1))); pVirtualDev->DrawRect(tools::Rectangle(x, y2, x + SIZE, y2 + SIZE)); x += SIZE + BORDER; diff --git a/sw/uiwriter_setup.mk b/sw/uiwriter_setup.mk index 37c506149e7e..013cb3e29953 100644 --- a/sw/uiwriter_setup.mk +++ b/sw/uiwriter_setup.mk @@ -13,6 +13,7 @@ define sw_uiwriter_libraries comphelper \ cppu \ cppuhelper \ + docmodel \ editeng \ i18nlangtag \ msword \ diff --git a/sw/ww8export_setup.mk b/sw/ww8export_setup.mk index 26a58ad41191..daa726c1b667 100644 --- a/sw/ww8export_setup.mk +++ b/sw/ww8export_setup.mk @@ -24,6 +24,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_ww8export$(1), \ comphelper \ cppu \ cppuhelper \ + docmodel \ editeng \ emboleobj \ sal \