32 Commits
Author SHA1 Message Date
Aron Budea 80fa879dec oox: omit default attributes/elements in theme XMLs in OOXML
For fonts: charset, pitchFamily.
Various rectangles: fillRect, fillToRect, srcRect, tileRect

Change-Id: I6dbd914ca8d9f8a2760bfecc6e294d465d52c32f
Signed-off-by: Aron Budea <aron.budea@collabora.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/13779
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit 2b4ed81074195c85d4fc179e22ca7d2e2e6da8f1)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211692
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-10-07 08:50:12 +02:00
Balazs Varga 1882c2017f Table Styles: Add resolveOOXMLColor() for correct tint resolution
Follow-up to 92d78c3fa385f794b63cf6b328b41222f9e4c8b2
(Table Styles: Move Calc table style generation from OOXML filter to core).

ComplexColor::applyTransformations() applies LumMod and LumOff as
two separate RGB-HSL-RGB round-trips, which can produce off-by-one
color values due to intermediate uint8 rounding. The OOXML filter's
Color::getColor() avoided this by staying in HSL between the two
transforms.

Add ColorSet::resolveOOXMLColor() which collects LumMod and LumOff
from the ComplexColor transforms and applies them in a single
ApplyLumModOff() call.

Also fixes the ComplexColor transform scale in TableStyleGenerator
from 100'000 (OOXML scale) to 10'000 (ComplexColor convention),
matching what the oox filter's createComplexColor() produces.

Change-Id: Id0173f44ffa3663893e3012d7aefbeabbe264241
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/232
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
(cherry picked from commit b44399314130a10698a18ffdab482a68bfdcff1a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204568
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-04-29 21:59:49 +02:00
Mike Kaganski e5c690c6be tdf#167018: let Theme::FromAny handle XTheme
It is created e.g. in XMLThemeContext dtor.

The type of return of FromAny is changed to shared_ptr, which allows
to return the result of UnoTheme::getTheme, and which matches the
types used by all the function callers.

Change-Id: Ie223e5663843be098e2da45cb04d825c72c372fd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186508
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2025-06-15 12:00:59 +02:00
Noel Grandin d573e2ae17 loplugin:ostr in various
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-05-20 22:09:56 +02:00
Gabor Kelemen 35af9aa550 tdf#146619 Recheck include/d* with IWYU
Change-Id: Ib17953b49e5035255203e33778a262211d1491f7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156985
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen <kelemeng@ubuntu.com>
2023-09-23 07:22:53 +02:00
Tomaž Vajngerl 03bc5199f9 various theme and complex color related fixes
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-09-01 22:52:16 +02:00
Tomaž Vajngerl 9d5a7d9257 ComplexColor various clean-up and (trivial) refactorings
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-15 20:58:13 +02:00
Tomaž Vajngerl 17105fc44b sw: remove char color GrabBag and fix export, fix tint/shade calc.
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-08 07:45:13 +02:00
Tomaž Vajngerl 1df0565fb9 use ComplexColor instead of ThemeColor for better OOXML compat.
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-12 05:00:28 +02:00
Tomaž Vajngerl 8bafae3656 change model::ColorSet to be stored in a shared_ptr in model::Theme
Change-Id: Ic3067f1681c047cd944e64179c568f4e972e0c95
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151447
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-05-09 08:25:53 +02:00
Tomaž Vajngerl 900c3a2a85 svx: use ComplexColor in SvxColorItem instead of the ThemeColor
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-08 07:23:17 +02:00
Tomaž Vajngerl 113c6d11af docmodel: extract ColorDefinition into own file and rename
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-01 06:05:19 +02:00
Tomaž Vajngerl a0a61ffc29 docmodel: extract Transformation from ThemeColor into own file
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-05-01 06:05:13 +02:00
Tomaž Vajngerl 8e5df127d2 svx: rework the theme dialog to allow editing theme colors
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-25 20:38:25 +02:00
Tomaž Vajngerl 6252959192 oox: add support for theme import and export of blip effects
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-25 13:38:18 +02:00
Tomaž Vajngerl c3f7720ff1 oox: extend ThemeExport to export font and format scheme of a theme
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-24 23:49:57 +02:00
Sarper Akdemir c27946fb15 tdf#150020 pptx import: handle algn for outerShdw
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-18 17:43:18 +02:00
Tomaž Vajngerl 2a7ab2ab77 oox: add model::EffectStyle and import effect style elements of a theme
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-12 09:40:09 +02:00
Tomaž Vajngerl f69614d811 oox: add model::LineStyle and import line style elements of a theme
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-12 06:55:41 +02:00
Tomaž Vajngerl 0ffa50031e oox: add model::BlipFilll and import blip (graphic) fill elements
Change-Id: I610b732b1fd4eebcfcc55acb6f04a8acf84f92b7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147954
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-04-12 06:01:53 +02:00
Tomaž Vajngerl 17167dbede oox: add model::PatternFill and import pattern fill elements
Change-Id: I49ef33fd81509599f4081e6a913b05dae1e4a642
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147953
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-04-12 05:37:33 +02:00
Tomaž Vajngerl 4208d95a29 oox: add FormatScheme test case and make sure FillStyle is imorted
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-08 09:02:13 +02:00
Tomaž Vajngerl 0d18262789 oox: import gradient fill to model::FormatScheme
Change-Id: I90bc7cf4239f08efbc7239928c34ccdbec20cb2c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147575
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-03-23 02:28:08 +00:00
Tomaž Vajngerl 7a0cf6797b oox: introduce FormatScheme - use in Theme import
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-22 09:24:46 +00:00
Tomaž Vajngerl 3203cf9df2 oox: import font scheme structure directly into model::FontScheme
Change-Id: Ic9084cbbf451ca406133f07476b8b4e7c234a650
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147572
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-03-06 07:47:58 +00:00
Tomaž Vajngerl 855f7c08d1 send theme info when changing color (in the picker) via UNO command
Change-Id: I288f8fb3375e152b5ee746fab2c05d08150d6c99
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146817
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-03-01 12:57:21 +00:00
Tomaž Vajngerl 75c0d78276 sd: use XTheme to transport the theme to xmloff import/export
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-31 08:59:09 +00:00
Tomaž Vajngerl 312f83bcf5 introduce XTheme and UnoTheme implementation
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-28 12:52:52 +00:00
Tomaž Vajngerl c9fb441c55 move Theme class to own file inside docmodel
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-27 03:22:22 +00:00
Tomaž Vajngerl 69c6f7bcce move ColorSet class to own file inside docmodel
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-27 01:41:22 +00:00
Andrea Gelmini 18b6406439 Fix typos
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-13 10:49:27 +00:00
Tomaž Vajngerl bd0f526f2d 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>
2023-01-12 23:15:58 +00:00