summaryrefslogtreecommitdiff
path: root/include/docmodel
AgeCommit message (Collapse)Author
2024-05-20loplugin:ostr in variousNoel Grandin
Change-Id: I9f399b3752da9df930e0647536ffcd4e82beb1ac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167856 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-03-04cool#8327 use tools::JsonWriter for theme colorsNoel Grandin
Change-Id: Iebca3781910f9e28100258da8266d51f673f31d8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164232 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2024-02-12use more UNLESS_MERGELIBSNoel Grandin
Change-Id: I351a9127fb26369d8f598b6d6519d7e490fa476b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163190 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-18c++20: use std::erase(_if) instead of std::remove(_if)+erase (include part)Julien Nabet
Change-Id: I32ac73e1ada08bfaa29e654f26fc89257733cd79 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159614 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-09-23tdf#146619 Recheck include/d* with IWYUGabor Kelemen
Change-Id: Ib17953b49e5035255203e33778a262211d1491f7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156985 Tested-by: Jenkins Reviewed-by: Gabor Kelemen <kelemeng@ubuntu.com>
2023-09-01various theme and complex color related fixesTomaž Vajngerl
Most of changes are a results of code reviews. Added comments and clarifications, removed unneeded methods, renamed variables to be more clear, protection against nullptr dereference,... Change-Id: Iae2b6abfa90b3bbd3f28328ca7fcf429765cbe9d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156203 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-08-21move BGradient to awt::Gradient2 UNO conversion into docmodelTomaž Vajngerl
This is needed because the module dependencies are an issues if the conversion is done in basegfx. The bigger issue will come when the ComplexColor conversion will be done as basegfx can't depend on docmodel because of circular dependencies. The BGradient is also more suitable for docmodel anyway as the previously it was part of the model and is not a basic (gfx) type - however this doesn't move the whole BGradient into docmodel yet. Change-Id: Id91ce52232f89f00e09b451c13da36e2854ae14b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155674 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-08-15ComplexColor various clean-up and (trivial) refactoringsTomaž Vajngerl
Don't allow access to member variables of ComplexColor and makes them private. Needs a lot of changes. Change "scheme" to "theme" to be more consistent. In LO we usually call the "theme color" what is usually refered to as "scheme color" in OOXML, where it is sometimes refered to as "scheme" and other times as theme color. Remove ThemeColor class which was replaced with CmplexColor some time ago. Remove un-needed includes and un-needed components. Use isValidThemeColor in many places where we check that the ComplexColor is of "Theme" type and that ThemeColorType is set to a valid value. Change-Id: I325595fa65b8e56a4707e9d22acc6330aac28961 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155359 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-08-05Rename setRGB to createRGB to make it less misleadingMike Kaganski
Somehow I overlooked completely, that there already is a non-static setRGB. Thanks Miklos and Tomaž for the heads up! Change-Id: If20018a317d90e0a6297950dff201671316aacad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155353 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-08-04docmodel: Fix comment at end of namespaceMichael Weghorn
Change-Id: I6a89ae49f735bde8220a110d83001604cc3c335e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155337 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-08-04Rename ComplexColor::RGB to setRGB, to avoid conflict with Windows defineMike Kaganski
Affects Windows' no-pch builds. Change-Id: Ifff401df40854f59760bd398c156a8837b528efe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155340 Tested-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-08-02sc: theme color support for sparklines + ODF & OOXML import/exportTomaž Vajngerl
This changes Sparkline colors to use complex colors instead and adds Sparkline theme color import and export support for ODF and OOXML. Change-Id: I58edd525d50f95199bd4fe7825afb51aaa7fc091 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155113 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-07-04sc: OOXML export of theme colors for text and backgroundTomaž Vajngerl
Change-Id: Ifd0d8184c9210caa5ca099767baa5dbbf8783f36 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153785 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-06-29sc: use ComplexColor for font color (+others) in OOXML exportTomaž Vajngerl
Change-Id: I2544c7ece152323d84faafe1a544e4f89ca466d5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152014 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-06-08sw: remove char color GrabBag and fix export, fix tint/shade calc.Tomaž Vajngerl
Don't store values from grab bag when exporting character theme colors and tint/shade values. The values could be wrong now and aren't needed anyway as we support the values in the model. Add proper export support for char color theme information with correct conversion of values into tint/shade values in 0-255 inverted interval. This also fixes the import of tint/shade values whcih calculation was slightly off. We divided by 256 instead of 255, which introduced an error. In addition introduce ThemeColorUsage enum, which marks if the theme color type has a specific "usage" - text or background. This is determined on import if the theme type is background{1,2} or text{1,2}. This is then taken into account on export, so the exact type is preserved. Change-Id: I0022a159397fd0c3d39a118a7149bb2488dfc149 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152705 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-06-05lok: callback to send the updated theme palette when theme changesTomaž Vajngerl
The callback sends the updated theme color palette when the theme changes or initially when the view is registered, so the client should always have the up-to-date theme color palette stored, so it can just show the color picker with the theme at any time without the need to call the server. Change-Id: I7cceccc46c2fad23ba89e6d3f3643e37f8dab292 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152589 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-05-27xmloff: add color-type attribute to complex colorTomaž Vajngerl
We need to identify what the color type of the complex color is. For now we mostly use "theme", but in the future we can also have other types like "rgb",... when the infrastructure for that is built. Change-Id: I38c91d294a191ca3124be4e99050977c9815d23e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152253 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-05-20docmodel: add hash to ComplexColor and Transformation classesTomaž Vajngerl
Change-Id: I206235162b057f184fbd413982c06f9bd9fa8a94 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152013 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-05-12change ComplexColor to show more useful propertiesTomaž Vajngerl
Change-Id: Ie19f080f2faf388f9b8ba3e9a4b3c0926d5ebdd4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151674 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-05-12use ComplexColor instead of ThemeColor for better OOXML compat.Tomaž Vajngerl
In OOXML a color definition includes more represenations, one of which is scheme color (which is what is implemented in ThemeColor currently), but it supports other representations too (RGB, HSL, System,..). ComplexColor includes all the representations, so to have a better compatibility with OOXML, this changes all uses of ThemeColor to ComplexColor. In many cases the usage of ComplexColor isn't the same as the usage of ThemeColors, but this cases will need to be changed in a later commit. Change-Id: I9cc8acee2ac0a1998fe9b98247bcf4a96273149a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151492 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-05-09change model::ColorSet to be stored in a shared_ptr in model::ThemeTomaž Vajngerl
Change-Id: Ic3067f1681c047cd944e64179c568f4e972e0c95 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151447 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-05-08svx: use ComplexColor in SvxColorItem instead of the ThemeColorTomaž Vajngerl
ComplexColor includes everything a ThemeColor has and in addition also can have various other representations that are supported by OOXML. This is important for compatibility reasons to preserve the color information. Change-Id: I677775a96511dc1742c75b1949e002eaa8c622e2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151226 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-05-08XComplexColor and UnoComplexColor - a wrapper for model:ComplexColorTomaž Vajngerl
Change-Id: I40107fc38a4d080d969fee862595660d2f585e51 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151225 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-05-01docmodel: extract ColorDefinition into own file and renameTomaž Vajngerl
ColorDefinition is renamed into ComplexColor. Change-Id: I81c2d97e6b7bf9de4ce703c02b6db40636b04961 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151224 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-05-01docmodel: extract Transformation from ThemeColor into own fileTomaž Vajngerl
Change-Id: I45316e377cf895773037f500c521111f7e4d1ed7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151223 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-04-25svx: rework the theme dialog to allow editing theme colorsTomaž Vajngerl
In addition to editing of theme colors, this also changes the way how theme colors are represented in the theme dialog and the behaviour when changing applying a theme color change. Previously a theme colors were applied with double-click, now a double-click still applies, but automatically exits the dialog. The selected theme is applied also when OK button is pressed. Change-Id: Ic0f8399ede180d6ab0001a7f8b5dda0e7c49fa3c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150975 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-04-25oox: add support for theme import and export of blip effectsTomaž Vajngerl
This adds support for (most) blip effects import, export and the document model. Change-Id: Iec15f4de22c31268019fa1a60432e40ae8f03635 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150262 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-04-24oox: extend ThemeExport to export font and format scheme of a themeTomaž Vajngerl
Also use the ThemeExport when exporting PPTX documents and remove all the hard-coded theme bits. Change-Id: I03791e23d6ac4023748b5a553e4824b72ed63a93 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149363 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-04-18tdf#150020 pptx import: handle algn for outerShdwSarper Akdemir
Introduces RectangleAlignmentItem that holds a value of the enum model::RectangleAlignment. Introduces SDRATTR_SHADOWALIGNMENT that holds alignment for a shadow. Implements import of algn for outerShdw. Makes the alignment considered while the shadow is being scaled. Also adds a unit test that covers this. Change-Id: I8f4eaed5f0d9428a7f405c65f19237f9e70ca151 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148934 Tested-by: Jenkins Reviewed-by: Sarper Akdemir <sarper.akdemir@collabora.com>
2023-04-12oox: add model::EffectStyle and import effect style elements of a themeTomaž Vajngerl
Extends the SwCoreThemeTest with effect style use-cases- Change-Id: Ifcb96a860fcbc0aae65e8ec276e069f7f60fb950 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149361 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-04-12oox: add model::LineStyle and import line style elements of a themeTomaž Vajngerl
Also extend the SwCoreThemeTest with asserts for the LineStyles for the example theme. Change-Id: I72aa64345d39fea84544e39b0a37a22f3e6baa5d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149360 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-04-12oox: add model::BlipFilll and import blip (graphic) fill elementsTomaž Vajngerl
Change-Id: I610b732b1fd4eebcfcc55acb6f04a8acf84f92b7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147954 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-04-12oox: add model::PatternFill and import pattern fill elementsTomaž Vajngerl
Change-Id: I49ef33fd81509599f4081e6a913b05dae1e4a642 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147953 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-04-08oox: add FormatScheme test case and make sure FillStyle is imortedTomaž Vajngerl
Extends ThemeTest in sw with the use cases relevant for import of FormatScheme into the model::Theme (as much as it is implemented currently). Change-Id: I888f64c24ba455913d688be256f095d9c298dc2f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147693 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-04-08use shared_ptr for model::Theme instead of unique_ptrTomaž Vajngerl
Also change other cases to use the shared_ptr so there is no need to do copies and replace some of docmodel/theme/Theme.hxximports with forward declarations. Change-Id: I4588cb25e05e5f3e535011fffb68a8075b05aecc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147691 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-03-23oox: import gradient fill to model::FormatSchemeTomaž Vajngerl
Change-Id: I90bc7cf4239f08efbc7239928c34ccdbec20cb2c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147575 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-03-22oox: introduce FormatScheme - use in Theme importTomaž Vajngerl
Introduces model::FormatScheme as an member of model::Theme, which is used in the theme import. As an first step it imports FillStyleList, but only SolidFill and NoFill. Change-Id: I14a75782ebabcf7ff69b0872752d411183653a47 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147573 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-03-06oox: import font scheme structure directly into model::FontSchemeTomaž Vajngerl
Change-Id: Ic9084cbbf451ca406133f07476b8b4e7c234a650 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147572 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-03-01send theme info when changing color (in the picker) via UNO commandTomaž Vajngerl
Change-Id: I288f8fb3375e152b5ee746fab2c05d08150d6c99 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146817 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-01-31sd: use XTheme to transport the theme to xmloff import/exportTomaž Vajngerl
Refactor the existing places and tests in Impress code (sd) to use it instead. Also keep the old property of construction and view of the theme with a sequence of property values, but under the new property named "ThemeUnoRepresentation". This is needed by the UI tests currently. Change-Id: I484567f4a603f1a5e2e03955fdd2b63132dcc66e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146225 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-01-28introduce XTheme and UnoTheme implementationTomaž Vajngerl
Needed to transprt model::Theme around using throught UNO API as xmloff can't access SdrPage directly. Change-Id: I5931e42352186d62e7f09b112d8e8c9e4fb79440 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146224 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-01-27move Theme class to own file inside docmodelTomaž Vajngerl
Also move Theme from svx to model namespace so it is consistent with other classes in docmodel. Theme header also includes ThemeSupplementalFont, ThemeFont, FontScheme classes that are used by the Theme and were also moved to docmodel. These may be moved to its own file in the future when they are used in more places. Change-Id: Ic409bea8e5298adc2b039b529c4f7b01cf64f03e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146221 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-01-27move ColorSet class to own file inside docmodelTomaž Vajngerl
Also move ColorSet from svx to model namespace so it is consistent with other classes in docmodel. Change-Id: Iacbdbdf5ece4015c628a0e45adf6a732b2d27777 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146220 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-01-13Fix typosAndrea Gelmini
Change-Id: I173920a96524f991f2965af99e8d95f11d1b3c35 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145455 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-01-12introduce docmodel comp., model::ThemeColor, use it in SvxColorItemTomaž Vajngerl
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>