38 Commits
Author SHA1 Message Date
Andrea Gelmini 4be7492a29 Fix typos
Change-Id: I8c9c7f3e622f266c0d789f708d17fb413ec120ec
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209891
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
2026-08-25 14:29:36 +02:00
Xisco Fauli 0159850b67 [API CHANGE] drop ComplexColorJSON
No need to use it when we can use ComplexColor

Change-Id: I921e229d2dee719b7457f046c1ed1ff0492aa3e8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205810
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-05-28 20:07:19 +02:00
Xisco Fauli fb28678005 loplugin:unusedmethods
Change-Id: If3dae53e3cf16df2d0c505a898138dfa6fe6c0f9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205442
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-05-22 09:32:38 +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
Tomaž Vajngerl a967935a76 add representation string to XComplexColor
Mainly useful for debugging and to see the content with develop.
tools. For now it just outputs the JSON string, but this might
change to something more concise.

Change-Id: I5641d20f292495f5474755ab9c3b651f67aa6f6e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195617
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2025-12-16 07:00:08 +01:00
Tomaž Vajngerl 959decdcda basegfx: BColorStops shouldn't derive from std::vector
Change-Id: I9f246c0d9a5ddc7f8cf428bf7fc8c8957e8584b6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158710
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Jenkins
2025-12-08 13:40:28 +01:00
Tomaž Vajngerl 1dbe0aa24f docmodel: add ComplexColor.cxx and move function definitions there
No need to be a template only class.

Change-Id: I3d73fe18443662205967ce5904233a93d7785164
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195166
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Jenkins
2025-12-08 04:15:06 +01:00
Kurt Nordback 0686b19728 tdf#167941 - Chart color sequence OOXML import/export
Support import, storage, and export of OOXML chart color styles
(color sequence). In OOXML, chart color styles are in files such
as colors1.xml, and conform to the chartStyle schema. This commit
supports I/O of color styles, and provides supports storing them
in the chart document model. It does not include any features for
using or modifying the color styles, so at this point it has no
appreciable effect on users.

Change-Id: I5c02137ebf9c25e11951eea55c4c77fda35b0e80
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194998
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2025-12-05 02:12:41 +01:00
Gabor Kelemen 90d8e7b78c tdf#146619 Run IWYU on docmodel/
Change-Id: I023858143314dda373fd6042280fde678d3cc96c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190906
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
2025-09-17 08:08:12 +02:00
Kurt Nordback f3e728aead tdf#167941 - Chart style file is not supported in OOXML
Implement chart style file export, beginning to use the document
model data rather than hard-coded text. Also add a simple test
that style data round-trips OOXML -> LO -> OOXML properly.

This uses oox structures in docmodel. That will be fixed in a
subsequent commit.

Change-Id: Icc0ef5b212cc32c8c84b51529bc4cf05ab54636c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190586
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2025-09-16 09:20:37 +02:00
Kurt Nordback 33bbf0bd20 tdf#167941 - Chart style file is not supported in OOXML
Parse the style*.xml file in the OOXML package, and store the imported
styles in XChartDocument via a new XChartStyle. Some areas are yet to be
fleshed out, but the intent here is to get a review of the general approach
and architecture. This includes no work on the export side (or the UI and
application of styles to a chart, which is a separate but related project).

Change-Id: I9d5b9f5aa44fb7944b2d971edc26e04dc2256c7f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189531
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2025-09-03 16:54:45 +02:00
Mike Kaganski a25172b811 Simplify UNO theme handling, by allowing empty Any in FromAny
This allows to avoid passing empty sequence as the "no theme" value.

Change-Id: I46b077149ec317fbcb19b39591aca6db3bf97393
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186520
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-06-15 16:40:30 +02:00
Mike Kaganski bd19135131 Don't check if enumrange iterates through ThemeColorType::Unknown
It is not needed, because Unknown is -1, outside of the iterated
range of [0, LAST].

Change-Id: I3ee1c7112d4594d76f2ed526d4c18dc0d8c73e7b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186514
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-06-15 15:09:10 +02:00
Mike Kaganski 749b9a889e Related: tdf#167018 Generalize and deduplicate Theme::FromAny
Let it also handle a hypothetical non-UnoTheme implementation (it
is possible to create these e.g. from Basic / Python code). When
handling it, use theme name as color set name (there seems to be
no UNO API to get color set name?). And use the same code for the
creation of Theme from PropertyValue list.

The check that enumrange<ThemeColorType> does not iterate through
ThemeColorType::Unknown is redundant, since that value is outside
of [0, LAST] range.

Change-Id: Iae6770f196011deeb2a92d3b64af514fb6a53d06
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186513
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2025-06-15 15:09:03 +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
Caolán McNamara 2f81046033 cid#1554709 COPY_INSTEAD_OF_MOVE
and

cid#1554745 COPY_INSTEAD_OF_MOVE
cid#1554758 COPY_INSTEAD_OF_MOVE
cid#1554766 COPY_INSTEAD_OF_MOVE
cid#1554771 COPY_INSTEAD_OF_MOVE
cid#1554787 COPY_INSTEAD_OF_MOVE
cid#1554802 COPY_INSTEAD_OF_MOVE
cid#1554820 COPY_INSTEAD_OF_MOVE
cid#1554828 COPY_INSTEAD_OF_MOVE
cid#1554829 COPY_INSTEAD_OF_MOVE
cid#1554832 COPY_INSTEAD_OF_MOVE
cid#1554842 COPY_INSTEAD_OF_MOVE
cid#1554885 COPY_INSTEAD_OF_MOVE

Change-Id: I43ec20250a04dc087f3d7fdeafc75f0c1dd0de25
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170542
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-07-16 15:13:41 +02:00
Caolán McNamara c11c5f9b87 cid#1557551 Use of auto that causes a copy
Change-Id: Id3b31e1a5ca54f6bc3c61ad325f37bb6896dc760
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170200
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
2024-07-09 18:19:26 +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
Noel Grandin 04c73e2749 cool#8327 use tools::JsonWriter for theme colors
Change-Id: Iebca3781910f9e28100258da8266d51f673f31d8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164232
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2024-03-04 11:50:45 +01: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 242bb3fdda move BGradient to awt::Gradient2 UNO conversion into docmodel
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-21 09:27:12 +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 7d2a7307da fix wrong transform type, error handling when JSON parsing
also fix theme export - change scheme enum type name "hlink" to
"hyperlink" and "folHlink" to "followedHyperlink"

Change-Id: Id5435d59cd51352efc4a4a8e333ec1ff45847a6f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152782
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-06-09 14:12:18 +02:00
Tomaž Vajngerl e86a0236e6 lok: callback to send the updated theme palette when theme changes
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-06-05 13:06:57 +02:00
Tomaž Vajngerl ca3bfa9bde change ComplexColor to show more useful properties
Change-Id: Ie19f080f2faf388f9b8ba3e9a4b3c0926d5ebdd4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151674
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-05-12 05:00:39 +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 7a10187042 XComplexColor and UnoComplexColor - a wrapper for model:ComplexColor
Change-Id: I40107fc38a4d080d969fee862595660d2f585e51
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151225
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-05-08 07:23:09 +02:00
Noel Grandin 5c1561561a loplugin:unnecessarygetstr extend to more std::string checking
suggested by mike kaganski

Change-Id: I5f5f254142767aca45a6101abdd84a0163ca6a34
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150936
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-04-24 18:04:50 +02:00
Tomaž Vajngerl 4f347ebaba use shared_ptr for model::Theme instead of unique_ptr
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-04-08 07:56:19 +02: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