diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2022-12-28 09:43:46 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2023-01-12 23:15:58 +0000 |
commit | bd0f526f2d3e1ffe43a74672485815768eee6e9e (patch) | |
tree | fcb675aa06dcc3251f2c23961520ee317483a225 /oox | |
parent | c945eafc99856f0bcd0a99195e2c5164c2a6d24a (diff) |
introduce docmodel comp., model::ThemeColor, use it in SvxColorItem
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 <quikee@gmail.com>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/CppunitTest_oox_drawingml.mk | 1 | ||||
-rw-r--r-- | oox/CppunitTest_oox_shape.mk | 1 | ||||
-rw-r--r-- | oox/CppunitTest_oox_tokenmap.mk | 1 | ||||
-rw-r--r-- | oox/Library_oox.mk | 1 | ||||
-rw-r--r-- | oox/inc/pch/precompiled_oox.hxx | 69 | ||||
-rw-r--r-- | oox/source/export/ThemeExport.cxx | 28 |
6 files changed, 70 insertions, 31 deletions
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 <cmath> #include <cstddef> #include <cstdlib> +#include <cstring> #include <functional> #include <iomanip> #include <limits.h> @@ -36,9 +37,11 @@ #include <math.h> #include <memory> #include <new> +#include <numeric> #include <optional> #include <ostream> #include <set> +#include <stack> #include <string.h> #include <string_view> #include <type_traits> @@ -47,13 +50,12 @@ #include <utility> #include <vector> #include <boost/algorithm/string.hpp> +#include <boost/property_tree/ptree_fwd.hpp> #endif // PCH_LEVEL >= 1 #if PCH_LEVEL >= 2 #include <osl/diagnose.h> -#include <osl/doublecheckedlocking.h> #include <osl/endian.h> #include <osl/file.hxx> -#include <osl/getglobalmutex.hxx> #include <osl/interlck.h> #include <osl/mutex.hxx> #include <osl/thread.h> @@ -67,6 +69,7 @@ #include <rtl/math.hxx> #include <rtl/random.h> #include <rtl/ref.hxx> +#include <rtl/strbuf.h> #include <rtl/strbuf.hxx> #include <rtl/string.h> #include <rtl/string.hxx> @@ -79,14 +82,21 @@ #include <rtl/ustring.h> #include <rtl/ustring.hxx> #include <sal/log.hxx> +#include <sal/macros.h> #include <sal/saldllapi.h> #include <sal/types.h> +#include <vcl/GraphicExternalLink.hxx> +#include <vcl/animate/Animation.hxx> #include <vcl/bitmap.hxx> +#include <vcl/bitmapex.hxx> #include <vcl/cairo.hxx> #include <vcl/devicecoordinate.hxx> #include <vcl/dllapi.h> #include <vcl/fntstyle.hxx> #include <vcl/font.hxx> +#include <vcl/gfxlink.hxx> +#include <vcl/graph.hxx> +#include <vcl/kernarray.hxx> #include <vcl/mapmod.hxx> #include <vcl/metaactiontypes.hxx> #include <vcl/outdev.hxx> @@ -105,7 +115,9 @@ #include <vcl/rendercontext/State.hxx> #include <vcl/rendercontext/SystemTextColorFlags.hxx> #include <vcl/salnativewidgets.hxx> +#include <vcl/settings.hxx> #include <vcl/vclreferencebase.hxx> +#include <vcl/vectorgraphicdata.hxx> #include <vcl/wall.hxx> #endif // PCH_LEVEL >= 2 #if PCH_LEVEL >= 3 @@ -113,8 +125,13 @@ #include <basegfx/color/bcolor.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/numeric/ftools.hxx> +#include <basegfx/point/b2dpoint.hxx> +#include <basegfx/point/b2ipoint.hxx> #include <basegfx/polygon/b2dpolypolygon.hxx> +#include <basegfx/tuple/Tuple2D.hxx> +#include <basegfx/tuple/b2dtuple.hxx> #include <basegfx/tuple/b3dtuple.hxx> +#include <basegfx/vector/b2dsize.hxx> #include <basegfx/vector/b2enums.hxx> #include <com/sun/star/awt/DeviceInfo.hpp> #include <com/sun/star/awt/FontWeight.hpp> @@ -122,15 +139,20 @@ #include <com/sun/star/beans/NamedValue.hpp> #include <com/sun/star/beans/PropertyState.hpp> #include <com/sun/star/beans/PropertyValue.hpp> +#include <com/sun/star/beans/PropertyValues.hpp> #include <com/sun/star/beans/XPropertySet.hpp> -#include <com/sun/star/chart2/XChartDocument.hpp> #include <com/sun/star/container/XNameContainer.hpp> #include <com/sun/star/container/XNamed.hpp> #include <com/sun/star/drawing/EnhancedCustomShapeAdjustmentValue.hpp> +#include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp> +#include <com/sun/star/drawing/EnhancedCustomShapeSegment.hpp> +#include <com/sun/star/drawing/EnhancedCustomShapeTextFrame.hpp> #include <com/sun/star/drawing/FillStyle.hpp> #include <com/sun/star/drawing/Hatch.hpp> #include <com/sun/star/drawing/LineCap.hpp> #include <com/sun/star/drawing/LineStyle.hpp> +#include <com/sun/star/drawing/TextFitToSizeType.hpp> +#include <com/sun/star/drawing/TextHorizontalAdjust.hpp> #include <com/sun/star/drawing/XDrawPage.hpp> #include <com/sun/star/drawing/XShape.hpp> #include <com/sun/star/drawing/XShapes.hpp> @@ -147,6 +169,7 @@ #include <com/sun/star/style/LineSpacingMode.hpp> #include <com/sun/star/style/ParagraphAdjust.hpp> #include <com/sun/star/text/WritingMode.hpp> +#include <com/sun/star/text/WritingMode2.hpp> #include <com/sun/star/text/XText.hpp> #include <com/sun/star/uno/Any.h> #include <com/sun/star/uno/Any.hxx> @@ -167,7 +190,9 @@ #include <com/sun/star/xml/sax/XFastDocumentHandler.hpp> #include <com/sun/star/xml/sax/XFastSAXSerializable.hpp> #include <comphelper/comphelperdllapi.h> +#include <comphelper/diagnose_ex.hxx> #include <comphelper/processfactory.hxx> +#include <comphelper/propertyvalue.hxx> #include <comphelper/sequence.hxx> #include <comphelper/sequenceashashmap.hxx> #include <comphelper/storagehelper.hxx> @@ -175,18 +200,15 @@ #include <cppu/unotype.hxx> #include <cppuhelper/implbase.hxx> #include <cppuhelper/implbase_ex.hxx> -#include <cppuhelper/supportsservice.hxx> #include <cppuhelper/weak.hxx> #include <cppuhelper/weakref.hxx> -#include <drawingml/chart/chartcontextbase.hxx> -#include <drawingml/chart/chartspacemodel.hxx> -#include <drawingml/chart/converterbase.hxx> -#include <drawingml/chart/objectformatter.hxx> -#include <drawingml/chart/titlemodel.hxx> +#include <docmodel/theme/ThemeColorType.hxx> +#include <drawinglayer/primitive2d/Primitive2DContainer.hxx> #include <drawingml/colorchoicecontext.hxx> #include <drawingml/customshapeproperties.hxx> #include <drawingml/fillproperties.hxx> #include <drawingml/lineproperties.hxx> +#include <drawingml/linepropertiescontext.hxx> #include <drawingml/misccontexts.hxx> #include <drawingml/shapepropertiescontext.hxx> #include <drawingml/table/tablestylepart.hxx> @@ -200,25 +222,42 @@ #include <i18nlangtag/lang.h> #include <o3tl/cow_wrapper.hxx> #include <o3tl/safeint.hxx> +#include <o3tl/span.hxx> +#include <o3tl/string_view.hxx> #include <o3tl/typed_flags_set.hxx> #include <o3tl/unit_conversion.hxx> #include <sax/fastattribs.hxx> #include <sax/fshelper.hxx> #include <sax/saxdllapi.h> +#include <svl/eitem.hxx> +#include <svl/itemset.hxx> #include <svl/poolitem.hxx> +#include <svl/style.hxx> #include <svl/svldllapi.h> #include <svl/typedwhich.hxx> +#include <svl/whichranges.hxx> +#include <svx/ColorSets.hxx> +#include <svx/itextprovider.hxx> #include <svx/msdffdef.hxx> +#include <svx/sdtaditm.hxx> +#include <svx/sdtaitm.hxx> +#include <svx/sdtakitm.hxx> +#include <svx/svddef.hxx> +#include <svx/svdoattr.hxx> #include <svx/svdobjkind.hxx> +#include <svx/svdotext.hxx> +#include <svx/svdtext.hxx> +#include <svx/svdtrans.hxx> #include <svx/svdtypes.hxx> #include <svx/svxdllapi.h> #include <tools/color.hxx> +#include <tools/datetime.hxx> #include <tools/degree.hxx> -#include <comphelper/diagnose_ex.hxx> #include <tools/fldunit.hxx> #include <tools/fontenum.hxx> #include <tools/fract.hxx> #include <tools/gen.hxx> +#include <tools/helpers.hxx> #include <tools/link.hxx> #include <tools/long.hxx> #include <tools/mapunit.hxx> @@ -243,14 +282,11 @@ #include <oox/core/relations.hxx> #include <oox/core/xmlfilterbase.hxx> #include <oox/dllapi.h> -#include <oox/drawingml/chart/chartconverter.hxx> -#include <oox/drawingml/chart/datasourcemodel.hxx> -#include <oox/drawingml/chart/modelbase.hxx> #include <oox/drawingml/clrscheme.hxx> #include <oox/drawingml/color.hxx> #include <oox/drawingml/drawingmltypes.hxx> -#include <oox/drawingml/graphicshapecontext.hxx> #include <oox/drawingml/shape.hxx> +#include <oox/drawingml/shapecontext.hxx> #include <oox/drawingml/shapepropertymap.hxx> #include <oox/drawingml/theme.hxx> #include <oox/export/utils.hxx> @@ -261,16 +297,15 @@ #include <oox/helper/containerhelper.hxx> #include <oox/helper/graphichelper.hxx> #include <oox/helper/helper.hxx> -#include <oox/helper/modelobjecthelper.hxx> #include <oox/helper/propertymap.hxx> #include <oox/helper/propertyset.hxx> #include <oox/helper/refmap.hxx> -#include <oox/helper/refvector.hxx> #include <oox/helper/storagebase.hxx> #include <oox/helper/textinputstream.hxx> #include <oox/ole/olestorage.hxx> #include <oox/ppt/comments.hxx> #include <oox/ppt/headerfooter.hxx> +#include <oox/ppt/pptimport.hxx> #include <oox/ppt/pptshape.hxx> #include <oox/ppt/slidepersist.hxx> #include <oox/token/namespaces.hxx> 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<sal_Int32, svx::ThemeColorType> 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<sal_Int32, model::ThemeColorType> 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<sal_Int32, 12> 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))); |