[Libreoffice-commits] core.git: sc/inc sc/source solenv/clang-format

2023-06-25 Thread Tomaž Vajngerl (via logerrit)
 sc/inc/CommonProperties.hxx  |   20 
 sc/source/ui/unoobj/cellsuno.cxx |   37 +
 sc/source/ui/unoobj/styleuno.cxx |7 +++
 solenv/clang-format/excludelist  |1 +
 4 files changed, 37 insertions(+), 28 deletions(-)

New commits:
commit bcd3ca80cd1f59c4b94660daa8c3e66944caf58f
Author: Tomaž Vajngerl 
AuthorDate: Fri Jun 23 17:13:44 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Sun Jun 25 17:36:00 2023 +0200

sc: simplify and fix prop. mapping for cell BG and char theme color

Change-Id: I461106200d37f0c605c07095c6b5871ea89e0e20
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153501
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/sc/inc/CommonProperties.hxx b/sc/inc/CommonProperties.hxx
new file mode 100644
index ..2c7d1e0a080b
--- /dev/null
+++ b/sc/inc/CommonProperties.hxx
@@ -0,0 +1,20 @@
+/* -*- 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
+
+#define CELL_BACKGROUND_COLOR_PROPERTIES \
+{ SC_UNONAME_CELLBACK, ATTR_BACKGROUND, cppu::UnoType::get(), 
0, MID_BACK_COLOR }, \
+{ SC_UNONAME_CELL_BACKGROUND_COMPLEX_COLOR, ATTR_BACKGROUND, 
cppu::UnoType::get(), 0, MID_BACKGROUND_COMPLEX_COLOR 
}, \
+
+#define CHAR_COLOR_PROPERTIES \
+{ SC_UNONAME_CCOLOR, ATTR_FONT_COLOR, cppu::UnoType::get(), 0, 
MID_COLOR_RGB }, \
+{ SC_UNONAME_CHAR_COMPLEX_COLOR, ATTR_FONT_COLOR, 
cppu::UnoType::get(), 0, MID_COMPLEX_COLOR }, \
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index 371ea346d364..d6a836fdc8d9 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -137,6 +137,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -156,12 +157,10 @@ static const SfxItemPropertySet* lcl_GetCellsPropertySet()
 { SC_UNONAME_ASIANVERT,ATTR_VERTICAL_ASIAN,cppu::UnoType::get(), 
 0, 0 },
 { SC_UNONAME_BOTTBORDER,ATTR_BORDER,   
::cppu::UnoType::get(), 0, BOTTOM_BORDER | CONVERT_TWIPS },
 { SC_UNONAME_BOTTBORDER2,ATTR_BORDER,  
::cppu::UnoType::get(), 0, BOTTOM_BORDER | CONVERT_TWIPS },
-{ SC_UNONAME_CELLBACK, ATTR_BACKGROUND,
cppu::UnoType::get(),0, MID_BACK_COLOR },
-{ SC_UNONAME_CELL_BACKGROUND_COMPLEX_COLOR, ATTR_BACKGROUND, 
cppu::UnoType::get(), 0, MID_BACKGROUND_COMPLEX_COLOR 
},
+CELL_BACKGROUND_COLOR_PROPERTIES
 { SC_UNONAME_CELLPRO,  ATTR_PROTECTION,
cppu::UnoType::get(), 0, 0 },
 { SC_UNONAME_CELLSTYL, 
SC_WID_UNO_CELLSTYL,cppu::UnoType::get(),0, 0 },
-{ SC_UNONAME_CCOLOR,   ATTR_FONT_COLOR,
cppu::UnoType::get(),0, 0 },
-{ SC_UNONAME_CHAR_COMPLEX_COLOR,   ATTR_FONT_COLOR, 
cppu::UnoType::get(), 0, MID_BACKGROUND_COMPLEX_COLOR 
},
+CHAR_COLOR_PROPERTIES
 { SC_UNONAME_COUTL,ATTR_FONT_CONTOUR,  cppu::UnoType::get(), 
 0, 0 },
 { SC_UNONAME_CCROSS,   
ATTR_FONT_CROSSEDOUT,cppu::UnoType::get(), 0, 
MID_CROSSED_OUT },
 { SC_UNONAME_CEMPHAS,  
ATTR_FONT_EMPHASISMARK,cppu::UnoType::get(), 0, MID_EMPHASIS 
},
@@ -267,12 +266,10 @@ static const SfxItemPropertySet* lcl_GetRangePropertySet()
 { SC_UNONAME_ASIANVERT,ATTR_VERTICAL_ASIAN,cppu::UnoType::get(), 
 0, 0 },
 { SC_UNONAME_BOTTBORDER,ATTR_BORDER,   
::cppu::UnoType::get(), 0, BOTTOM_BORDER | CONVERT_TWIPS },
 { SC_UNONAME_BOTTBORDER2,ATTR_BORDER,  
::cppu::UnoType::get(), 0, BOTTOM_BORDER | CONVERT_TWIPS },
-{ SC_UNONAME_CELLBACK, ATTR_BACKGROUND,
cppu::UnoType::get(),0, MID_BACK_COLOR },
-{ SC_UNONAME_CELL_BACKGROUND_COMPLEX_COLOR, ATTR_BACKGROUND, 
cppu::UnoType::get(), 0, MID_BACKGROUND_COMPLEX_COLOR 
},
+CELL_BACKGROUND_COLOR_PROPERTIES
 { SC_UNONAME_CELLPRO,  ATTR_PROTECTION,
cppu::UnoType::get(), 0, 0 },
 { SC_UNONAME_CELLSTYL, 
SC_WID_UNO_CELLSTYL,cppu::UnoType::get(),0, 0 },
-{ SC_UNONAME_CCOLOR,   ATTR_FONT_COLOR,
cppu::UnoType::get(),0, 0 },
-{ SC_UNONAME_CHAR_COMPLEX_COLOR,   ATTR_FONT_COLOR, 
cppu::UnoType::get(), 0, MID_BACKGROUND_COMPLEX_COLOR 
},
+CHAR_COLOR_PROPERTIES
 { SC_UNONAME_COUTL,ATTR_FONT_CONTOUR,  cppu::UnoType::get(), 
 0, 0 },
 { SC_UNONAME_CCROSS,   
ATTR_FONT_CROSSEDOUT,cppu::UnoType::get(), 0, 
MID_CROSSED_OUT },
 { SC_UNONAME_CEMPHAS,  
ATTR_FONT_EMPHASISMARK,cppu::UnoType::get(), 0, MID_EMPHASIS 
},
@@ -379,12 +376,10 @@ 

[Libreoffice-commits] core.git: 2 commits - oox/source sc/source

2023-06-25 Thread Tomaž Vajngerl (via logerrit)
 oox/source/drawingml/color.cxx   |   36 +++
 sc/source/ui/theme/ThemeColorChanger.cxx |   36 +++
 2 files changed, 59 insertions(+), 13 deletions(-)

New commits:
commit 95d199e3d1a04a469e1d22896ffd967c7a06c3f0
Author: Tomaž Vajngerl 
AuthorDate: Fri Jun 23 13:49:24 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Sun Jun 25 17:35:50 2023 +0200

sc: ThemeColorChanger - change theme color for borders

Change-Id: Id6b08ad48b496d2f1138aeea8d024a5f61bee633
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153500
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/sc/source/ui/theme/ThemeColorChanger.cxx 
b/sc/source/ui/theme/ThemeColorChanger.cxx
index 2211aa67b554..a245f7b0c1c0 100644
--- a/sc/source/ui/theme/ThemeColorChanger.cxx
+++ b/sc/source/ui/theme/ThemeColorChanger.cxx
@@ -16,6 +16,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #include 
 #include 
@@ -35,6 +37,26 @@ ThemeColorChanger::~ThemeColorChanger() = default;
 
 namespace
 {
+bool changeBorderLine(editeng::SvxBorderLine* pBorderLine, model::ColorSet 
const& rColorSet)
+{
+if (!pBorderLine)
+return false;
+
+model::ComplexColor const& rComplexColor = pBorderLine->getComplexColor();
+if (rComplexColor.meType == model::ColorType::Scheme)
+{
+auto eThemeType = rComplexColor.meSchemeType;
+
+if (eThemeType != model::ThemeColorType::Unknown)
+{
+Color aColor = rColorSet.resolveColor(rComplexColor);
+pBorderLine->SetColor(aColor);
+return true;
+}
+}
+return false;
+}
+
 void changeCellItems(SfxItemSet& rItemSet, model::ColorSet const& rColorSet)
 {
 const SfxPoolItem* pItem = nullptr;
@@ -75,6 +97,20 @@ void changeCellItems(SfxItemSet& rItemSet, model::ColorSet 
const& rColorSet)
 }
 }
 }
+if (rItemSet.HasItem(ATTR_BORDER, ))
+{
+auto const* pBoxItem = static_cast(pItem);
+SvxBoxItem rNewItem(*pBoxItem);
+bool bChanged = false;
+
+bChanged = changeBorderLine(rNewItem.GetBottom(), rColorSet) || 
bChanged;
+bChanged = changeBorderLine(rNewItem.GetTop(), rColorSet) || bChanged;
+bChanged = changeBorderLine(rNewItem.GetLeft(), rColorSet) || bChanged;
+bChanged = changeBorderLine(rNewItem.GetRight(), rColorSet) || 
bChanged;
+
+if (bChanged)
+rItemSet.Put(rNewItem);
+}
 }
 } // end anonymous ns
 
commit 163ad701b61af6888bb9fbaaf2d8a49054f9a846
Author: Tomaž Vajngerl 
AuthorDate: Fri Jun 23 21:58:22 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Sun Jun 25 17:35:40 2023 +0200

oox: map color transforms direct to create model::Transform

Change-Id: I82382f8d0936e90218fefe889ea5bfdd04c3e82b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153507
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/oox/source/drawingml/color.cxx b/oox/source/drawingml/color.cxx
index 4d2ee2afbbce..b653458300f4 100644
--- a/oox/source/drawingml/color.cxx
+++ b/oox/source/drawingml/color.cxx
@@ -840,21 +840,31 @@ model::ComplexColor Color::createComplexColor(const 
GraphicHelper& /*rGraphicHel
 return aNewComplexColor;
 }
 
-if (getLumMod() != 1)
-aNewComplexColor.addTransformation({model::TransformationType::LumMod, 
getLumMod()});
-
-if (getLumOff() != 0)
-aNewComplexColor.addTransformation({model::TransformationType::LumOff, 
getLumOff()});
-
-if (getTintOrShade() > 0)
-{
-aNewComplexColor.addTransformation({model::TransformationType::Tint, 
getTintOrShade()});
-}
-else if (getTintOrShade() < 0)
+for(auto const& aTransform : maTransforms)
 {
-sal_Int16 nShade = o3tl::narrowing(-getTintOrShade());
-aNewComplexColor.addTransformation({model::TransformationType::Shade, 
nShade});
+sal_Int16 nValue = sal_Int16(aTransform.mnValue / 10);
+
+switch(aTransform.mnToken)
+{
+case XML_lumMod:
+if (nValue != 10'000)
+
aNewComplexColor.addTransformation({model::TransformationType::LumMod, nValue});
+break;
+case XML_lumOff:
+if (nValue != 0)
+
aNewComplexColor.addTransformation({model::TransformationType::LumOff, nValue});
+break;
+case XML_tint:
+if (nValue != 0)
+
aNewComplexColor.addTransformation({model::TransformationType::Tint, nValue});
+break;
+case XML_shade:
+if (nValue != 0)
+
aNewComplexColor.addTransformation({model::TransformationType::Shade, nValue});
+break;
+}
 }
+
 return aNewComplexColor;
 }
 


[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - svx/source

2023-06-25 Thread Tomaž Vajngerl (via logerrit)
 svx/source/tbxctrls/PaletteManager.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 6a7bfd512e7ff00d8a4caadd9edcf3299bfa35c6
Author: Tomaž Vajngerl 
AuthorDate: Fri Jun 23 00:01:19 2023 +0900
Commit: Caolán McNamara 
CommitDate: Sun Jun 25 14:13:27 2023 +0200

fix crash in PaletteManager triggered by the color picker

The code expects the SfxObjectShell::GetThemeColors() always
returns a current set of theme colors, but then for some modules
we return nullptr.

Change-Id: I4096b75942d818965cedf43f35444faeb870cb74
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153424
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit f4867086c8498ef168f7d2e8d94b872e516a9d4d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153429
Reviewed-by: Caolán McNamara 

diff --git a/svx/source/tbxctrls/PaletteManager.cxx 
b/svx/source/tbxctrls/PaletteManager.cxx
index 141938d145d7..7735e09d44e8 100644
--- a/svx/source/tbxctrls/PaletteManager.cxx
+++ b/svx/source/tbxctrls/PaletteManager.cxx
@@ -209,6 +209,9 @@ void PaletteManager::ReloadColorSet(SvxColorValueSet 
)
 rColorSet.Clear();
 sal_uInt16 nItemId = 0;
 
+if (!pColorSet)
+return;
+
 svx::ThemeColorPaletteManager aThemeColorManager(pColorSet);
 moThemePaletteCollection = aThemeColorManager.generate();
 


[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - writerfilter/source

2023-06-23 Thread Tomaž Vajngerl (via logerrit)
 writerfilter/source/dmapper/PropertyIds.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 1b5cee822e0bc15ddbdfc86926678ca35ab3e082
Author: Tomaž Vajngerl 
AuthorDate: Sun Jun 18 23:35:36 2023 +0900
Commit: Xisco Fauli 
CommitDate: Fri Jun 23 13:19:39 2023 +0200

use frozen::make_unordered_map so no need to specify the count

Change-Id: I08057846e735028fb4634fad8b210c707905e096
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153233
Tested-by: Jenkins
Tested-by: Julien Nabet 
Reviewed-by: Julien Nabet 
(cherry picked from commit d7bc610a359ca7e95b3a600c03da6a0b9e6f439c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153515
Tested-by: Xisco Fauli 
Reviewed-by: Xisco Fauli 

diff --git a/writerfilter/source/dmapper/PropertyIds.cxx 
b/writerfilter/source/dmapper/PropertyIds.cxx
index d294a3ad082c..11ef07230fad 100644
--- a/writerfilter/source/dmapper/PropertyIds.cxx
+++ b/writerfilter/source/dmapper/PropertyIds.cxx
@@ -26,7 +26,7 @@ namespace writerfilter::dmapper{
 
 namespace
 {
-constexpr frozen::unordered_map 
constPropertyMap
+constexpr auto constPropertyMap = frozen::make_unordered_map(
 {
 { PROP_CHAR_WEIGHT, u"CharWeight"},
 { PROP_CHAR_POSTURE, u"CharPosture"},
@@ -378,7 +378,7 @@ namespace
 { PROP_CURSOR_NOT_IGNORE_TABLES_IN_HF, u"CursorNotIgnoreTables"},
 { PROP_PARA_CONNECT_BORDERS, u"ParaIsConnectBorder"},
 { PROP_DECORATIVE, u"Decorative"},
-};
+});
 } // end anonymous ns
 
 OUString getPropertyName( PropertyIds eId )


[Libreoffice-commits] core.git: svx/source

2023-06-22 Thread Tomaž Vajngerl (via logerrit)
 svx/source/tbxctrls/PaletteManager.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit bbf6fa94a92abc1085addaba20519ee0166bae5e
Author: Tomaž Vajngerl 
AuthorDate: Fri Jun 23 00:01:19 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Fri Jun 23 03:53:23 2023 +0200

fix crash in PaletteManager triggered by the color picker

The code expects the SfxObjectShell::GetThemeColors() always
returns a current set of theme colors, but then for some modules
we return nullptr.

Change-Id: I4096b75942d818965cedf43f35444faeb870cb74
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153424
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/svx/source/tbxctrls/PaletteManager.cxx 
b/svx/source/tbxctrls/PaletteManager.cxx
index 141938d145d7..7735e09d44e8 100644
--- a/svx/source/tbxctrls/PaletteManager.cxx
+++ b/svx/source/tbxctrls/PaletteManager.cxx
@@ -209,6 +209,9 @@ void PaletteManager::ReloadColorSet(SvxColorValueSet 
)
 rColorSet.Clear();
 sal_uInt16 nItemId = 0;
 
+if (!pColorSet)
+return;
+
 svx::ThemeColorPaletteManager aThemeColorManager(pColorSet);
 moThemePaletteCollection = aThemeColorManager.generate();
 


[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - svgio/Library_svgio.mk svgio/source

2023-06-22 Thread Tomaž Vajngerl (via logerrit)
 svgio/Library_svgio.mk  |5 
 svgio/source/svgreader/svgtoken.cxx |  538 ++--
 2 files changed, 214 insertions(+), 329 deletions(-)

New commits:
commit e09c3c43ce372cbd22fcc064d2a8eeb11d3b2a1d
Author: Tomaž Vajngerl 
AuthorDate: Mon Jul 25 15:38:24 2022 +0200
Commit: Xisco Fauli 
CommitDate: Thu Jun 22 22:26:32 2023 +0200

svgio: use "frozen" for mapping between token strings and enums

Change-Id: I2061606146cfcb34169dccf69b6f720727839d04
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153174
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153471

diff --git a/svgio/Library_svgio.mk b/svgio/Library_svgio.mk
index 6221cb141316..76c0e87123bb 100644
--- a/svgio/Library_svgio.mk
+++ b/svgio/Library_svgio.mk
@@ -25,7 +25,10 @@ $(eval $(call gb_Library_set_include,svgio,\
 -I$(SRCDIR)/svgio/inc \
 ))
 
-$(eval $(call gb_Library_use_external,svgio,boost_headers))
+$(eval $(call gb_Library_use_externals,svgio,\
+boost_headers \
+frozen \
+))
 
 $(eval $(call 
gb_Library_set_precompiled_header,svgio,svgio/inc/pch/precompiled_svgio))
 
diff --git a/svgio/source/svgreader/svgtoken.cxx 
b/svgio/source/svgreader/svgtoken.cxx
index 09ed13459b2e..45af658b1ebd 100644
--- a/svgio/source/svgreader/svgtoken.cxx
+++ b/svgio/source/svgreader/svgtoken.cxx
@@ -18,359 +18,241 @@
  */
 
 #include 
-#include 
+#include 
+#include 
+#include 
 
 namespace svgio::svgreader
 {
-const char aSVGStrWidth[] = "width";
-const char aSVGStrHeight[] = "height";
-const char aSVGStrViewBox[] = "viewBox";
-const char aSVGStrTransform[] = "transform";
-const char aSVGStrStyle[] = "style";
-const char aSVGStrDisplay[] = "display"; // #i121656#
-const char aSVGStrD[] = "d";
-const char aSVGStrX[] = "x";
-const char aSVGStrY[] = "y";
-const char aSVGStrXmlns[] = "xmlns";
-const char aSVGStrVersion[] = "version";
-const char aSVGStrId[] = "id";
-const char aSVGStrIn[] = "in";
-const char aSVGStrRx[] = "rx";
-const char aSVGStrRy[] = "ry";
-const char aSVGStrPoints[] = "points";
-const char aSVGStrDx[] = "dx";
-const char aSVGStrDy[] = "dy";
-const char aSVGStrRotate[] = "rotate";
-const char aSVGStrTextLength[] = "textLength";
-const char aSVGStrLengthAdjust[] = "lengthAdjust";
-const char aSVGStrFont[] = "font";
-const char aSVGStrFontFamily[] = "font-family";
-const char aSVGStrFontSize[] = "font-size";
-const char aSVGStrFontSizeAdjust[] = "font-size-adjust";
-const char aSVGStrFontStretch[] = "font-stretch";
-const char aSVGStrFontStyle[] = "font-style";
-const char aSVGStrFontVariant[] = "font-variant";
-const char aSVGStrFontWeight[] = "font-weight";
-const char aSVGStrDirection[] = "direction";
-const char aSVGStrLetterSpacing[] = "letter-spacing";
-const char aSVGStrTextDecoration[] = "text-decoration";
-const char aSVGStrUnicodeBidi[] = "unicode-bidi";
-const char aSVGStrWordSpacing[] = "word-spacing";
-const char aSVGStrTspan[] = "tspan";
-const char aSVGStrTref[] = "tref";
-const char aSVGStrTextPath[] = "textPath";
-const char aSVGStrStartOffset[] = "startOffset";
-const char aSVGStrMethod[] = "method";
-const char aSVGStrSpacing[] = "spacing";
-const char aSVGStrStdDeviation[] = "stdDeviation";
-const char aSVGStrTextAlign[] = "text-align";
-const char aSVGStrPathLength[] = "pathLength";
-const char aSVGStrType[] = "type";
-const char aSVGStrClass[] = "class";
-const char aSVGStrTextAnchor[] = "text-anchor";
-const char aSVGStrXmlSpace[] = "xml:space";
-const char aSVGStrColor[] = "color";
-const char aSVGStrClipPathNode[] = "clipPath";
-const char aSVGStrClipPathProperty[] = "clip-path";
-const char aSVGStrFeGaussianBlur[] = "feGaussianBlur";
-const char aSVGStrFeColorMatrix[] = "feColorMatrix";
-const char aSVGStrFilter[] = "filter";
-const char aSVGStrMask[] = "mask";
-const char aSVGStrClipPathUnits[] = "clipPathUnits";
-const char aSVGStrMaskUnits[] = "maskUnits";
-const char aSVGStrMaskContentUnits[] = "maskContentUnits";
-const char aSVGStrClipRule[] = "clip-rule";
-const char aSVGStrMarker[] = "marker";
-const char aSVGStrMarkerStart[] = "marker-start";
-const char aSVGStrMarkerMid[] = "marker-mid";
-const char aSVGStrMarkerEnd[] = "marker-end";
-const char aSVGStrRefX[] = "refX";
-const char aSVGStrRefY[] = "refY";
-const char aSVGStrMarkerUnits[] = "markerUnits";
-const char aSVGStrMarkerWidth[] = "markerWidth";
-

[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - 2 commits - include/editeng oox/source sw/qa sw/source writerfilter/source

2023-06-22 Thread Tomaž Vajngerl (via logerrit)
 include/editeng/unoprnms.hxx |4 +
 include/editeng/unotext.hxx  |5 -
 oox/source/drawingml/textcharacterproperties.cxx |6 +
 oox/source/token/properties.txt  |2 
 sw/qa/extras/ooxmlexport/data/tdf155945.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport19.cxx   |   11 +++
 sw/source/core/unocore/unoobj.cxx|   48 ---
 sw/source/filter/ww8/docxattributeoutput.cxx |   28 ++---
 writerfilter/source/dmapper/CellColorHandler.cxx |   70 ++-
 writerfilter/source/dmapper/CellColorHandler.hxx |   15 
 writerfilter/source/dmapper/PropertyIds.cxx  |7 +-
 writerfilter/source/dmapper/PropertyIds.hxx  |3 
 12 files changed, 163 insertions(+), 36 deletions(-)

New commits:
commit 79b17173296c00f2292240c2304cdbd6c4a97b06
Author: Tomaž Vajngerl 
AuthorDate: Sun Jun 11 00:57:36 2023 +0900
Commit: Xisco Fauli 
CommitDate: Thu Jun 22 21:03:15 2023 +0200

ooxml: import and export background and fill theme colors props.

This adds support to import and export background and fill theme
color properties.

Change-Id: I0f40615fe2d06cdcb4f2f9752602fe2ec699c7b3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152835
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 9e121f3a6b95dab7525aa1583f810b2b504ce1b3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153421
Reviewed-by: Xisco Fauli 

diff --git a/include/editeng/unoprnms.hxx b/include/editeng/unoprnms.hxx
index 8859dfe5a4a5..214b8fd53dea 100644
--- a/include/editeng/unoprnms.hxx
+++ b/include/editeng/unoprnms.hxx
@@ -350,6 +350,10 @@ inline constexpr OUStringLiteral 
UNO_NAME_EDIT_CHAR_SHADOWED = u"CharShadowed";
 inline constexpr OUStringLiteral UNO_NAME_EDIT_CHAR_UNDERLINE = 
u"CharUnderline";
 inline constexpr OUStringLiteral UNO_NAME_EDIT_CHAR_OVERLINE = u"CharOverline";
 
+inline constexpr OUStringLiteral UNO_NAME_EDIT_CHAR_BACKGROUND_COLOR = 
u"CharBackColor";
+inline constexpr OUStringLiteral UNO_NAME_EDIT_CHAR_BACKGROUND_COMPLEX_COLOR = 
u"CharBackgroundComplexColor";
+inline constexpr OUStringLiteral UNO_NAME_EDIT_CHAR_BACKGROUND_TRANSPARENT = 
u"CharBackTransparent";
+
 inline constexpr OUStringLiteral UNO_NAME_BITMAP = u"Bitmap";
 
 inline constexpr OUStringLiteral UNO_NAME_LINKDISPLAYNAME = u"LinkDisplayName";
diff --git a/include/editeng/unotext.hxx b/include/editeng/unotext.hxx
index 84dc7d9fdb6f..a027e331ae00 100644
--- a/include/editeng/unotext.hxx
+++ b/include/editeng/unotext.hxx
@@ -93,8 +93,9 @@ struct SfxItemPropertyMapEntry;
 { UNO_NAME_EDIT_CHAR_COLOR_LUM_MOD,   EE_CHAR_COLOR, 
::cppu::UnoType::get(), 0, MID_COLOR_LUM_MOD }, \
 { UNO_NAME_EDIT_CHAR_COLOR_LUM_OFF,   EE_CHAR_COLOR, 
::cppu::UnoType::get(), 0, MID_COLOR_LUM_OFF }, \
 { UNO_NAME_EDIT_CHAR_COMPLEX_COLOR, EE_CHAR_COLOR,
::cppu::UnoType::get(), 0, MID_COMPLEX_COLOR }, \
-{ u"CharBackColor",EE_CHAR_BKGCOLOR,   
::cppu::UnoType::get(),0, 0 }, \
-{ u"CharBackTransparent",  EE_CHAR_BKGCOLOR,   
::cppu::UnoType::get(), 0, MID_GRAPHIC_TRANSPARENT }, \
+{ UNO_NAME_EDIT_CHAR_BACKGROUND_COLOR, EE_CHAR_BKGCOLOR,   
::cppu::UnoType::get(),0, MID_COLOR_RGB }, \
+{ UNO_NAME_EDIT_CHAR_BACKGROUND_COMPLEX_COLOR, EE_CHAR_BKGCOLOR, 
::cppu::UnoType::get(), 0, MID_COMPLEX_COLOR }, \
+{ UNO_NAME_EDIT_CHAR_BACKGROUND_TRANSPARENT, EE_CHAR_BKGCOLOR,   
::cppu::UnoType::get(), 0, MID_GRAPHIC_TRANSPARENT }, \
 { UNO_NAME_EDIT_CHAR_ESCAPEMENT,  EE_CHAR_ESCAPEMENT, 
::cppu::UnoType::get(),0, MID_ESC }, \
 { UNO_NAME_EDIT_CHAR_UNDERLINE,   EE_CHAR_UNDERLINE,  
::cppu::UnoType::get(),0, MID_TL_STYLE }, \
 { u"CharUnderlineColor",   EE_CHAR_UNDERLINE,  
::cppu::UnoType::get(),0, MID_TL_COLOR }, \
diff --git a/oox/source/drawingml/textcharacterproperties.cxx 
b/oox/source/drawingml/textcharacterproperties.cxx
index 1217c19441ae..c3dde4889a64 100644
--- a/oox/source/drawingml/textcharacterproperties.cxx
+++ b/oox/source/drawingml/textcharacterproperties.cxx
@@ -216,7 +216,11 @@ void TextCharacterProperties::pushToPropMap( PropertyMap& 
rPropMap, const XmlFil
 }
 
 if (maHighlightColor.isUsed() && maHighlightColor.getTransparency() != 100)
-rPropMap.setProperty( PROP_CharBackColor, maHighlightColor.getColor( 
rFilter.getGraphicHelper() ));
+{
+rPropMap.setProperty(PROP_CharBackColor, maHighlightColor.getColor( 
rFilter.getGraphicHelper() ));
+model::ComplexColor aComplexColor = maHighlightColor.getComplexColor();
+rPropMap.setProperty(PROP_CharBackgroundComplexColor, 
model::color::createXComplexColor(aComplexColor));
+}
 else
 rPropMap.setProperty( PROP_CharBackColor, sal_Int32(-1));
 }
diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt
index 

[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - sc/CppunitTest_sc_theme_import_export_test.mk sc/Module_sc.mk sc/qa sc/source

2023-06-22 Thread Tomaž Vajngerl (via logerrit)
 sc/CppunitTest_sc_theme_import_export_test.mk |   67 
 sc/Module_sc.mk   |1 
 sc/qa/unit/ThemeImportExportTest.cxx  |   71 ++
 sc/qa/unit/data/xlsx/CalcThemeTest.xlsx   |binary
 sc/source/filter/excel/xestyle.cxx|   62 +++---
 sc/source/filter/inc/xestyle.hxx  |5 +
 6 files changed, 186 insertions(+), 20 deletions(-)

New commits:
commit 2e027a9d5ae1ed65c25755c77d14584fff126866
Author: Tomaž Vajngerl 
AuthorDate: Wed May 17 14:54:20 2023 +0900
Commit: Xisco Fauli 
CommitDate: Thu Jun 22 21:00:40 2023 +0200

sc: theme color export for cell fill color + test

Change-Id: Ibaad410f094f86d9f7197090db702ae45340c239
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151859
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153448

diff --git a/sc/CppunitTest_sc_theme_import_export_test.mk 
b/sc/CppunitTest_sc_theme_import_export_test.mk
new file mode 100644
index ..52f9736e36b9
--- /dev/null
+++ b/sc/CppunitTest_sc_theme_import_export_test.mk
@@ -0,0 +1,67 @@
+# -*- 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_CppunitTest_CppunitTest,sc_theme_import_export_test))
+
+$(eval $(call 
gb_CppunitTest_use_common_precompiled_header,sc_theme_import_export_test))
+
+$(eval $(call 
gb_CppunitTest_add_exception_objects,sc_theme_import_export_test, \
+sc/qa/unit/ThemeImportExportTest \
+))
+
+$(eval $(call gb_CppunitTest_use_externals,sc_theme_import_export_test, \
+boost_headers \
+mdds_headers \
+libxml2 \
+))
+
+$(eval $(call gb_CppunitTest_use_libraries,sc_theme_import_export_test, \
+basegfx \
+comphelper \
+cppu \
+cppuhelper \
+sal \
+salhelper \
+sax \
+sc \
+scqahelper \
+sfx \
+subsequenttest \
+test \
+tl \
+unotest \
+utl \
+vcl \
+))
+
+$(eval $(call gb_CppunitTest_set_include,sc_theme_import_export_test,\
+-I$(SRCDIR)/sc/source/ui/inc \
+-I$(SRCDIR)/sc/inc \
+$$(INCLUDE) \
+))
+
+$(eval $(call gb_CppunitTest_use_api,sc_theme_import_export_test,\
+offapi \
+udkapi \
+))
+
+$(eval $(call gb_CppunitTest_use_sdk_api,sc_theme_import_export_test))
+$(eval $(call gb_CppunitTest_use_ure,sc_theme_import_export_test))
+$(eval $(call gb_CppunitTest_use_vcl,sc_theme_import_export_test))
+$(eval $(call gb_CppunitTest_use_rdb,sc_theme_import_export_test,services))
+$(eval $(call gb_CppunitTest_use_components,sc_theme_import_export_test))
+$(eval $(call gb_CppunitTest_use_configuration,sc_theme_import_export_test))
+
+$(eval $(call gb_CppunitTest_add_arguments,sc_theme_import_export_test, \
+
-env:arg-env=$(gb_Helper_LIBRARY_PATH_VAR)"{$(gb_Helper_LIBRARY_PATH_VAR)+=$(gb_Helper_LIBRARY_PATH_VAR)}"
 \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/sc/Module_sc.mk b/sc/Module_sc.mk
index ce76695b4e4b..0c2178b7fea1 100644
--- a/sc/Module_sc.mk
+++ b/sc/Module_sc.mk
@@ -236,6 +236,7 @@ $(eval $(call gb_Module_add_subsequentcheck_targets,sc,\
CppunitTest_sc_tablesheetsobj \
CppunitTest_sc_tablevalidationobj \
CppunitTest_sc_tabviewobj \
+   CppunitTest_sc_theme_import_export_test \
CppunitTest_sc_uniquecellformatsenumeration \
CppunitTest_sc_uniquecellformatsobj \
CppunitTest_sc_viewpaneobj \
diff --git a/sc/qa/unit/ThemeImportExportTest.cxx 
b/sc/qa/unit/ThemeImportExportTest.cxx
new file mode 100644
index ..ae1653837f36
--- /dev/null
+++ b/sc/qa/unit/ThemeImportExportTest.cxx
@@ -0,0 +1,71 @@
+/* -*- 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 
+#include 
+#include 
+
+using namespace css;
+
+class ThemeImportExportTest : public UnoApiXmlTest
+{
+public:
+ThemeImportExportTest()
+: UnoApiXmlTest("sc/qa/unit/data")
+{
+}
+
+void test();
+
+CPPUNIT_TEST_SUITE(ThemeImportExportTest);
+CPPUNIT_TEST(test);
+CPPUNIT_TEST_SUITE_END();
+};
+
+void ThemeImportExportTest::test()
+{
+loadFromURL(u"xlsx/CalcThemeTest.xlsx");
+
+save("Calc Office Open XML");
+
+xmlDocUniquePtr pXmlDoc = 

[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - 3 commits - include/oox oox/source sc/inc sc/qa sc/source test/Library_subsequenttest.mk test/source

2023-06-22 Thread Tomaž Vajngerl (via logerrit)
 include/oox/drawingml/color.hxx|   10 ++-
 oox/source/drawingml/color.cxx |   84 +-
 sc/inc/patattr.hxx |   50 +---
 sc/inc/unonames.hxx|2 
 sc/qa/extras/scstyleobj.cxx|   35 ---
 sc/qa/unit/helper/qahelper.cxx |   26 
 sc/qa/unit/subsequent_export_test4.cxx |4 -
 sc/qa/unit/ucalc.cxx   |2 
 sc/qa/unit/uicalc/uicalc.cxx   |   10 +--
 sc/qa/unit/uicalc/uicalc2.cxx  |   10 +--
 sc/source/core/data/column2.cxx|6 -
 sc/source/core/data/global.cxx |2 
 sc/source/core/data/patattr.cxx|  103 +++--
 sc/source/core/tool/editutil.cxx   |2 
 sc/source/core/tool/interpr1.cxx   |4 -
 sc/source/filter/excel/xecontent.cxx   |8 +-
 sc/source/filter/excel/xehelper.cxx|   23 ---
 sc/source/filter/excel/xestyle.cxx |   16 ++---
 sc/source/filter/excel/xlstyle.cxx |   18 ++---
 sc/source/filter/inc/stylesbuffer.hxx  |3 
 sc/source/filter/inc/xestyle.hxx   |   18 ++---
 sc/source/filter/inc/xlstyle.hxx   |8 +-
 sc/source/filter/oox/stylesbuffer.cxx  |   17 +++--
 sc/source/ui/cctrl/dpcontrol.cxx   |5 -
 sc/source/ui/docshell/docsh3.cxx   |4 -
 sc/source/ui/unoobj/cellsuno.cxx   |   13 
 sc/source/ui/unoobj/styleuno.cxx   |2 
 sc/source/ui/vba/vbarange.cxx  |4 -
 sc/source/ui/view/cellsh1.cxx  |8 +-
 sc/source/ui/view/gridwin4.cxx |6 -
 sc/source/ui/view/output2.cxx  |   12 +--
 sc/source/ui/view/printfun.cxx |8 +-
 test/Library_subsequenttest.mk |1 
 test/source/beans/xpropertyset.cxx |9 ++
 34 files changed, 368 insertions(+), 165 deletions(-)

New commits:
commit 076ab906e6007b1a2e58e27af30700051a970004
Author: Tomaž Vajngerl 
AuthorDate: Tue May 16 22:10:10 2023 +0900
Commit: Xisco Fauli 
CommitDate: Thu Jun 22 21:00:34 2023 +0200

sc: factor out color from setting vcl::Font from a ItemSet

vcl::Font color parameter is deprecated so we need to handle the
color separately from font data. This refactors GetFont into 2
separate functions - fillFontOnly and fillColor, where fillFont
now does the same as previously GetFont function did.
All GetFont calls have been changed depending on if we need only
the font data or also color - where the color is now treated in
a different call. There are a couple of calls where fillFont was
used, because to change that needs a more complex refactoring.

Change-Id: I0a2ce50a0cb28d196fcff87e1e80099a2bb60a9e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151858
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153447

diff --git a/sc/inc/patattr.hxx b/sc/inc/patattr.hxx
index 49cae62994b4..ba15cfb1dd27 100644
--- a/sc/inc/patattr.hxx
+++ b/sc/inc/patattr.hxx
@@ -92,23 +92,55 @@ public:
 SvxCellOrientation  GetCellOrientation( const SfxItemSet* pCondSet = 
nullptr ) const;
 
 /** Static helper function to fill a font object from the passed item set. 
*/
-static void GetFont( vcl::Font& rFont, const SfxItemSet& 
rItemSet,
+static void fillFontOnly(vcl::Font& rFont, const SfxItemSet& rItemSet,
+const OutputDevice* pOutDev = nullptr,
+const Fraction* pScale = nullptr,
+const SfxItemSet* pCondSet = nullptr,
+SvtScriptType nScript = 
SvtScriptType::NONE);
+
+static void fillFont( vcl::Font& rFont, const SfxItemSet& rItemSet,
 ScAutoFontColorMode eAutoMode,
 const OutputDevice* pOutDev = nullptr,
 const Fraction* pScale = nullptr,
 const SfxItemSet* pCondSet = nullptr,
 SvtScriptType nScript = 
SvtScriptType::NONE, const Color* pBackConfigColor = nullptr,
-const Color* pTextConfigColor = 
nullptr );
+const Color* pTextConfigColor = 
nullptr);
+
+static void fillColor(Color& rColor, const SfxItemSet& rItemSet, 
ScAutoFontColorMode eAutoMode, const SfxItemSet* pCondSet = nullptr,
+const Color* pBackConfigColor = nullptr, const 
Color* pTextConfigColor = nullptr);
+
 
 static ScDxfFontGetDxfFont(const SfxItemSet& rSet, SvtScriptType 
nScript);
+
+void fillColor(Color& rColor,
+ScAutoFontColorMode eAutoMode,
+const SfxItemSet* pCondSet = nullptr,
+const Color* pBackConfigColor = nullptr,
+ 

[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - 2 commits - config_host.mk.in configure.ac external/Module_external.mk filter/Library_msfilter.mk filter/source include/oox oox/Library_oox.m

2023-06-22 Thread Tomaž Vajngerl (via logerrit)
 RepositoryExternal.mk  |   10 
 config_host.mk.in  |2 
 configure.ac   |   26 +
 external/Module_external.mk|2 
 filter/Library_msfilter.mk |5 
 filter/source/msfilter/msvbahelper.cxx |   95 ++---
 include/oox/drawingml/clrscheme.hxx|   17 
 oox/Library_oox.mk |1 
 oox/source/drawingml/clrscheme.cxx |   34 +
 oox/source/drawingml/color.cxx |  310 -
 oox/source/drawingml/colorchoicecontext.cxx|7 
 oox/source/drawingml/fontworkhelpers.cxx   |   44 +-
 oox/source/drawingml/misccontexts.cxx  |5 
 oox/source/drawingml/table/predefined-table-styles.cxx |   44 +-
 oox/source/export/ThemeExport.cxx  |  164 
 oox/source/ppt/presentationfragmenthandler.cxx |   29 +
 oox/source/token/relationship.cxx  |   25 -
 oox/source/token/relationship.inc  |   96 ++---
 sc/Library_scfilt.mk   |1 
 sd/Library_sd.mk   |1 
 sd/source/filter/eppt/pptx-epptooxml.cxx   |2 
 writerfilter/Library_writerfilter.mk   |1 
 writerfilter/source/dmapper/PropertyIds.cxx|   19 -
 writerfilter/source/dmapper/PropertyIds.hxx|2 
 xmloff/Library_xo.mk   |5 
 xmloff/source/style/XMLRtlGutterPropertyHandler.cxx|   18 
 26 files changed, 547 insertions(+), 418 deletions(-)

New commits:
commit 5a61e6cb899ebce32228d5ee70332c3fcf303212
Author: Tomaž Vajngerl 
AuthorDate: Wed Jun 14 11:48:51 2023 +0900
Commit: Xisco Fauli 
CommitDate: Thu Jun 22 21:00:12 2023 +0200

oox, writerfilter, xmloff: use frozen data structures for static data

Change-Id: I4a53fa57f52900104d249c84cde36c9d3b9e1300
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153175
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153444

diff --git a/filter/Library_msfilter.mk b/filter/Library_msfilter.mk
index 0429a6e31874..fcc343520602 100644
--- a/filter/Library_msfilter.mk
+++ b/filter/Library_msfilter.mk
@@ -21,7 +21,10 @@ $(eval $(call gb_Library_Library,msfilter))
 
 $(eval $(call 
gb_Library_set_componentfile,msfilter,filter/source/msfilter/msfilter,services))
 
-$(eval $(call gb_Library_use_external,msfilter,boost_headers))
+$(eval $(call gb_Library_use_externals,msfilter,\
+boost_headers \
+frozen \
+))
 
 $(eval $(call gb_Library_use_sdk_api,msfilter))
 
diff --git a/filter/source/msfilter/msvbahelper.cxx 
b/filter/source/msfilter/msvbahelper.cxx
index 923aecb9c3dd..d3fc42af8c2d 100644
--- a/filter/source/msfilter/msvbahelper.cxx
+++ b/filter/source/msfilter/msvbahelper.cxx
@@ -42,7 +42,9 @@
 #include 
 #include 
 #include 
-#include 
+#include 
+#include 
+#include 
 
 using namespace ::com::sun::star;
 
@@ -643,64 +645,51 @@ static sal_uInt16 parseChar( sal_Unicode c )
 return nVclKey;
 }
 
-namespace {
+namespace
+{
 
-struct KeyCodeEntry
+constexpr frozen::unordered_map s_KeyCodes
 {
-   const char* sName;
-   sal_uInt16 nCode;
+{ u"BACKSPACE", KEY_BACKSPACE },
+{ u"BS", KEY_BACKSPACE },
+{ u"DELETE", KEY_DELETE },
+{ u"DEL", KEY_DELETE },
+{ u"DOWN", KEY_DOWN },
+{ u"UP", KEY_UP },
+{ u"LEFT", KEY_LEFT },
+{ u"RIGHT", KEY_RIGHT },
+{ u"END", KEY_END },
+{ u"ESCAPE", KEY_ESCAPE },
+{ u"ESC", KEY_ESCAPE },
+{ u"HELP", KEY_HELP },
+{ u"HOME", KEY_HOME },
+{ u"PGDN", KEY_PAGEDOWN },
+{ u"PGUP", KEY_PAGEUP },
+{ u"INSERT", KEY_INSERT },
+{ u"SCROLLLOCK", KEY_SCROLLLOCK },
+{ u"NUMLOCK", KEY_NUMLOCK },
+{ u"TAB", KEY_TAB },
+{ u"F1", KEY_F1 },
+{ u"F2", KEY_F2 },
+{ u"F3", KEY_F3 },
+{ u"F4", KEY_F4 },
+{ u"F5", KEY_F5 },
+{ u"F6", KEY_F6 },
+{ u"F7", KEY_F7 },
+{ u"F8", KEY_F8 },
+{ u"F9", KEY_F9 },
+{ u"F10", KEY_F10 },
+{ u"F11", KEY_F11 },
+{ u"F12", KEY_F12 },
+{ u"F13", KEY_F13 },
+{ u"F14", KEY_F14 },
+{ u"F15", KEY_F15 }
 };
 
-}
-
-KeyCodeEntry const aMSKeyCodesData[] = {
-{ "BACKSPACE", KEY_BACKSPACE },
-{ "BS", KEY_BACKSPACE },
-{ "DELETE", KEY_DELETE },
-{ "DEL", KEY_DELETE },
-{ "DOWN", KEY_DOWN },
-{ "UP", KEY_UP },
-{ "LEFT", KEY_LEFT },
-{ "RIGHT", KEY_RIGHT },
-{ "END", KEY_END },
-{ "ESCAPE", KEY_ESCAPE },
-{ "ESC", KEY_ESCAPE },
-{ "HELP", KEY_HELP },
-{ "HOME", KEY_HOME },
-{ "PGDN", KEY_PAGEDOWN },
-{ "PGUP", KEY_PAGEUP },
-{ "INSERT", KEY_INSERT },
-{ "SCROLLLOCK", KEY_SCROLLLOCK },
-{ "NUMLOCK", KEY_NUMLOCK },
-{ 

[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - 3 commits - download.lst external/frozen external/Module_external.mk include/svx Makefile.fetch RepositoryExternal.mk sc/source svx/source sw

2023-06-22 Thread Tomaž Vajngerl (via logerrit)
 Makefile.fetch |1 
 RepositoryExternal.mk  |   10 ++
 download.lst   |5 +++
 external/Module_external.mk|1 
 external/frozen/Module_frozen.mk   |   16 ++
 external/frozen/README.md  |7 
 external/frozen/UnpackedTarball_frozen.mk  |   18 +++
 external/frozen/defines_h_constexpr_string.patch.0 |   11 +++
 include/svx/dialog/ThemeDialog.hxx |7 +---
 include/svx/theme/IThemeColorChanger.hxx   |2 -
 include/svx/theme/ThemeColorChanger.hxx|2 -
 sc/source/ui/inc/ThemeColorChanger.hxx |2 -
 sc/source/ui/theme/ThemeColorChanger.cxx   |   27 +++--
 sc/source/ui/view/tabvwsh3.cxx |7 +---
 svx/source/dialog/ThemeDialog.cxx  |   11 +++
 svx/source/svdraw/svdpage.cxx  |   17 ---
 svx/source/theme/ThemeColorChanger.cxx |6 +--
 sw/qa/core/theme/ThemeTest.cxx |6 +--
 sw/source/core/inc/ThemeColorChanger.hxx   |2 -
 sw/source/core/model/ThemeColorChanger.cxx |   32 ++---
 sw/source/uibase/shells/basesh.cxx |   16 +++---
 sw/source/uibase/sidebar/ThemePanel.cxx|2 -
 22 files changed, 143 insertions(+), 65 deletions(-)

New commits:
commit b31e885e987025fba953ce9d6cb713a48a853d6a
Author: Tomaž Vajngerl 
AuthorDate: Sat Jul 16 12:17:20 2022 +0200
Commit: Xisco Fauli 
CommitDate: Thu Jun 22 20:59:56 2023 +0200

Add frozen library support - for compile-time dict, set support

Change-Id: I8fa02569ba02048cc3ef02b349aafba1c0cbebb4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153173
Reviewed-by: Taichi Haradaguchi <20001...@ymail.ne.jp>
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153442

diff --git a/Makefile.fetch b/Makefile.fetch
index c8c5c91941f2..625e781dc36a 100644
--- a/Makefile.fetch
+++ b/Makefile.fetch
@@ -125,6 +125,7 @@ $(WORKDIR)/download: $(BUILDDIR)/config_$(gb_Side).mk 
$(SRCDIR)/download.lst $(S
$(call fetch_Optional,FONTCONFIG,FONTCONFIG_TARBALL) \
$(call fetch_Optional,FREEHAND,FREEHAND_TARBALL) \
$(call fetch_Optional,FREETYPE,FREETYPE_TARBALL) \
+   FROZEN_TARBALL \
$(call fetch_Optional,EPOXY,EPOXY_TARBALL) \
$(call fetch_Optional,GLM,GLM_TARBALL) \
$(call fetch_Optional,GPGMEPP,GPGME_TARBALL) \
diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk
index 3ec3cd924395..631466f0001a 100644
--- a/RepositoryExternal.mk
+++ b/RepositoryExternal.mk
@@ -4297,4 +4297,14 @@ endif # ENABLE_ZXING
 
 endif # SYSTEM_ZXING
 
+
+define gb_LinkTarget__use_frozen
+$(call gb_LinkTarget_use_unpacked,$(1),frozen)
+$(call gb_LinkTarget_set_include,$(1),\
+   -I$(call gb_UnpackedTarball_get_dir,frozen/include/)\
+   $$(INCLUDE) \
+)
+endef
+
+
 # vim: set noet sw=4 ts=4:
diff --git a/download.lst b/download.lst
index e8ce2bfc67aa..7111b41795c9 100644
--- a/download.lst
+++ b/download.lst
@@ -202,6 +202,11 @@ FREETYPE_TARBALL := freetype-2.13.0.tar.xz
 # three static lines
 # so that git cherry-pick
 # will not run into conflicts
+FROZEN_SHA256SUM := 
f7c7075750e8fceeac081e9ef01944f221b36d9725beac8681cbd2838d26be45
+FROZEN_TARBALL := frozen-1.1.1.tar.gz
+# three static lines
+# so that git cherry-pick
+# will not run into conflicts
 GLM_SHA256SUM := 
6bba5f032bed47c73ad9397f2313b9acbfb56253d0d0576b5873d3dcb25e99ad
 GLM_TARBALL := glm-0.9.9.8.zip
 # three static lines
diff --git a/external/Module_external.mk b/external/Module_external.mk
index 73d6530ac10f..cd9c5924d71d 100644
--- a/external/Module_external.mk
+++ b/external/Module_external.mk
@@ -41,6 +41,7 @@ $(eval $(call gb_Module_add_moduledirs,external,\
$(call gb_Helper_optional,FONTCONFIG,fontconfig) \
$(call gb_Helper_optional,FREEHAND,libfreehand) \
$(call gb_Helper_optional,FREETYPE,freetype) \
+   frozen \
$(call gb_Helper_optional,GLM,glm) \
$(call gb_Helper_optional,GPGMEPP,gpgmepp) \
$(call gb_Helper_optional,GRAPHITE,graphite) \
diff --git a/external/frozen/Module_frozen.mk b/external/frozen/Module_frozen.mk
new file mode 100644
index ..10fa0997e0ed
--- /dev/null
+++ b/external/frozen/Module_frozen.mk
@@ -0,0 +1,16 @@
+# -*- 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 

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - svx/source

2023-06-22 Thread Tomaž Vajngerl (via logerrit)
 svx/source/tbxctrls/PaletteManager.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit b62c2b10066638b7f545865a608b5c197b1c1224
Author: Tomaž Vajngerl 
AuthorDate: Fri Jun 23 00:01:19 2023 +0900
Commit: Michael Meeks 
CommitDate: Thu Jun 22 17:28:45 2023 +0200

fix crash in PaletteManager triggered by the color picker

The code expects the SfxObjectShell::GetThemeColors() always
returns a current set of theme colors, but then for some modules
we return nullptr.

Change-Id: I4096b75942d818965cedf43f35444faeb870cb74
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153463
Reviewed-by: Michael Meeks 
Tested-by: Michael Meeks 

diff --git a/svx/source/tbxctrls/PaletteManager.cxx 
b/svx/source/tbxctrls/PaletteManager.cxx
index 082b07f94c92..f43bd984bcf9 100644
--- a/svx/source/tbxctrls/PaletteManager.cxx
+++ b/svx/source/tbxctrls/PaletteManager.cxx
@@ -210,6 +210,9 @@ void PaletteManager::ReloadColorSet(SvxColorValueSet 
)
 rColorSet.Clear();
 sal_uInt16 nItemId = 0;
 
+if (!pColorSet)
+return;
+
 svx::ThemeColorPaletteManager aThemeColorManager(pColorSet);
 moThemePaletteCollection = aThemeColorManager.generate();
 


[Libreoffice-commits] core.git: sc/CppunitTest_sc_theme_import_export_test.mk sc/Module_sc.mk sc/qa sc/source

2023-06-21 Thread Tomaž Vajngerl (via logerrit)
 sc/CppunitTest_sc_theme_import_export_test.mk |   67 
 sc/Module_sc.mk   |1 
 sc/qa/unit/ThemeImportExportTest.cxx  |   71 ++
 sc/qa/unit/data/xlsx/CalcThemeTest.xlsx   |binary
 sc/source/filter/excel/xestyle.cxx|   62 +++---
 sc/source/filter/inc/xestyle.hxx  |5 +
 6 files changed, 186 insertions(+), 20 deletions(-)

New commits:
commit 25aa310b923ac26b62a97c0e95549e053d294da4
Author: Tomaž Vajngerl 
AuthorDate: Wed May 17 14:54:20 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Thu Jun 22 05:24:09 2023 +0200

sc: theme color export for cell fill color + test

Change-Id: Ibaad410f094f86d9f7197090db702ae45340c239
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151859
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/sc/CppunitTest_sc_theme_import_export_test.mk 
b/sc/CppunitTest_sc_theme_import_export_test.mk
new file mode 100644
index ..52f9736e36b9
--- /dev/null
+++ b/sc/CppunitTest_sc_theme_import_export_test.mk
@@ -0,0 +1,67 @@
+# -*- 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_CppunitTest_CppunitTest,sc_theme_import_export_test))
+
+$(eval $(call 
gb_CppunitTest_use_common_precompiled_header,sc_theme_import_export_test))
+
+$(eval $(call 
gb_CppunitTest_add_exception_objects,sc_theme_import_export_test, \
+sc/qa/unit/ThemeImportExportTest \
+))
+
+$(eval $(call gb_CppunitTest_use_externals,sc_theme_import_export_test, \
+boost_headers \
+mdds_headers \
+libxml2 \
+))
+
+$(eval $(call gb_CppunitTest_use_libraries,sc_theme_import_export_test, \
+basegfx \
+comphelper \
+cppu \
+cppuhelper \
+sal \
+salhelper \
+sax \
+sc \
+scqahelper \
+sfx \
+subsequenttest \
+test \
+tl \
+unotest \
+utl \
+vcl \
+))
+
+$(eval $(call gb_CppunitTest_set_include,sc_theme_import_export_test,\
+-I$(SRCDIR)/sc/source/ui/inc \
+-I$(SRCDIR)/sc/inc \
+$$(INCLUDE) \
+))
+
+$(eval $(call gb_CppunitTest_use_api,sc_theme_import_export_test,\
+offapi \
+udkapi \
+))
+
+$(eval $(call gb_CppunitTest_use_sdk_api,sc_theme_import_export_test))
+$(eval $(call gb_CppunitTest_use_ure,sc_theme_import_export_test))
+$(eval $(call gb_CppunitTest_use_vcl,sc_theme_import_export_test))
+$(eval $(call gb_CppunitTest_use_rdb,sc_theme_import_export_test,services))
+$(eval $(call gb_CppunitTest_use_components,sc_theme_import_export_test))
+$(eval $(call gb_CppunitTest_use_configuration,sc_theme_import_export_test))
+
+$(eval $(call gb_CppunitTest_add_arguments,sc_theme_import_export_test, \
+
-env:arg-env=$(gb_Helper_LIBRARY_PATH_VAR)"{$(gb_Helper_LIBRARY_PATH_VAR)+=$(gb_Helper_LIBRARY_PATH_VAR)}"
 \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/sc/Module_sc.mk b/sc/Module_sc.mk
index ce76695b4e4b..0c2178b7fea1 100644
--- a/sc/Module_sc.mk
+++ b/sc/Module_sc.mk
@@ -236,6 +236,7 @@ $(eval $(call gb_Module_add_subsequentcheck_targets,sc,\
CppunitTest_sc_tablesheetsobj \
CppunitTest_sc_tablevalidationobj \
CppunitTest_sc_tabviewobj \
+   CppunitTest_sc_theme_import_export_test \
CppunitTest_sc_uniquecellformatsenumeration \
CppunitTest_sc_uniquecellformatsobj \
CppunitTest_sc_viewpaneobj \
diff --git a/sc/qa/unit/ThemeImportExportTest.cxx 
b/sc/qa/unit/ThemeImportExportTest.cxx
new file mode 100644
index ..ae1653837f36
--- /dev/null
+++ b/sc/qa/unit/ThemeImportExportTest.cxx
@@ -0,0 +1,71 @@
+/* -*- 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 
+#include 
+#include 
+
+using namespace css;
+
+class ThemeImportExportTest : public UnoApiXmlTest
+{
+public:
+ThemeImportExportTest()
+: UnoApiXmlTest("sc/qa/unit/data")
+{
+}
+
+void test();
+
+CPPUNIT_TEST_SUITE(ThemeImportExportTest);
+CPPUNIT_TEST(test);
+CPPUNIT_TEST_SUITE_END();
+};
+
+void ThemeImportExportTest::test()
+{
+loadFromURL(u"xlsx/CalcThemeTest.xlsx");
+
+save("Calc Office Open XML");
+
+xmlDocUniquePtr pXmlDoc = parseExport("xl/styles.xml");
+
+assertXPath(pXmlDoc, "/x:styleSheet", 1);
+
+// Fonts
+

[Libreoffice-commits] core.git: sc/inc sc/qa sc/source

2023-06-21 Thread Tomaž Vajngerl (via logerrit)
 sc/inc/patattr.hxx |   50 +---
 sc/qa/unit/helper/qahelper.cxx |   26 
 sc/qa/unit/subsequent_export_test4.cxx |4 -
 sc/qa/unit/ucalc.cxx   |2 
 sc/qa/unit/uicalc/uicalc.cxx   |   10 +--
 sc/qa/unit/uicalc/uicalc2.cxx  |   10 +--
 sc/source/core/data/column2.cxx|6 -
 sc/source/core/data/global.cxx |2 
 sc/source/core/data/patattr.cxx|  103 +++--
 sc/source/core/tool/editutil.cxx   |2 
 sc/source/core/tool/interpr1.cxx   |4 -
 sc/source/filter/excel/xecontent.cxx   |8 +-
 sc/source/filter/excel/xehelper.cxx|   23 ---
 sc/source/filter/excel/xestyle.cxx |   16 ++---
 sc/source/filter/excel/xlstyle.cxx |   18 ++---
 sc/source/filter/inc/xestyle.hxx   |   18 ++---
 sc/source/filter/inc/xlstyle.hxx   |8 +-
 sc/source/ui/cctrl/dpcontrol.cxx   |5 -
 sc/source/ui/docshell/docsh3.cxx   |4 -
 sc/source/ui/vba/vbarange.cxx  |4 -
 sc/source/ui/view/cellsh1.cxx  |8 +-
 sc/source/ui/view/gridwin4.cxx |6 -
 sc/source/ui/view/output2.cxx  |   12 +--
 sc/source/ui/view/printfun.cxx |8 +-
 24 files changed, 210 insertions(+), 147 deletions(-)

New commits:
commit 3537cef02c25c2c2459d7900eed13eeec533b7ae
Author: Tomaž Vajngerl 
AuthorDate: Tue May 16 22:10:10 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Thu Jun 22 02:21:15 2023 +0200

sc: factor out color from setting vcl::Font from a ItemSet

vcl::Font color parameter is deprecated so we need to handle the
color separately from font data. This refactors GetFont into 2
separate functions - fillFontOnly and fillColor, where fillFont
now does the same as previously GetFont function did.
All GetFont calls have been changed depending on if we need only
the font data or also color - where the color is now treated in
a different call. There are a couple of calls where fillFont was
used, because to change that needs a more complex refactoring.

Change-Id: I0a2ce50a0cb28d196fcff87e1e80099a2bb60a9e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151858
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/sc/inc/patattr.hxx b/sc/inc/patattr.hxx
index 49cae62994b4..ba15cfb1dd27 100644
--- a/sc/inc/patattr.hxx
+++ b/sc/inc/patattr.hxx
@@ -92,23 +92,55 @@ public:
 SvxCellOrientation  GetCellOrientation( const SfxItemSet* pCondSet = 
nullptr ) const;
 
 /** Static helper function to fill a font object from the passed item set. 
*/
-static void GetFont( vcl::Font& rFont, const SfxItemSet& 
rItemSet,
+static void fillFontOnly(vcl::Font& rFont, const SfxItemSet& rItemSet,
+const OutputDevice* pOutDev = nullptr,
+const Fraction* pScale = nullptr,
+const SfxItemSet* pCondSet = nullptr,
+SvtScriptType nScript = 
SvtScriptType::NONE);
+
+static void fillFont( vcl::Font& rFont, const SfxItemSet& rItemSet,
 ScAutoFontColorMode eAutoMode,
 const OutputDevice* pOutDev = nullptr,
 const Fraction* pScale = nullptr,
 const SfxItemSet* pCondSet = nullptr,
 SvtScriptType nScript = 
SvtScriptType::NONE, const Color* pBackConfigColor = nullptr,
-const Color* pTextConfigColor = 
nullptr );
+const Color* pTextConfigColor = 
nullptr);
+
+static void fillColor(Color& rColor, const SfxItemSet& rItemSet, 
ScAutoFontColorMode eAutoMode, const SfxItemSet* pCondSet = nullptr,
+const Color* pBackConfigColor = nullptr, const 
Color* pTextConfigColor = nullptr);
+
 
 static ScDxfFontGetDxfFont(const SfxItemSet& rSet, SvtScriptType 
nScript);
+
+void fillColor(Color& rColor,
+ScAutoFontColorMode eAutoMode,
+const SfxItemSet* pCondSet = nullptr,
+const Color* pBackConfigColor = nullptr,
+const Color* pTextConfigColor = nullptr) const
+{
+fillColor(rColor, GetItemSet(), eAutoMode, pCondSet, pBackConfigColor, 
pTextConfigColor);
+}
+
+void fillFontOnly(vcl::Font& rFont,
+const OutputDevice* pOutDev = nullptr,
+const Fraction* pScale = nullptr,
+const SfxItemSet* pCondSet = nullptr,
+SvtScriptType nScript = SvtScriptType::NONE) const
+{
+fillFontOnly(rFont, GetItemSet(), pOutDev, pScale, pCondSet, nScript);
+}
+
 /** Fills a font object from the own item set. */
-   

[Libreoffice-commits] core.git: 2 commits - include/oox oox/source sc/source

2023-06-21 Thread Tomaž Vajngerl (via logerrit)
 include/oox/drawingml/color.hxx  |   10 +++
 oox/source/drawingml/color.cxx   |   84 +--
 sc/source/filter/inc/stylesbuffer.hxx|3 +
 sc/source/filter/oox/stylesbuffer.cxx|   17 --
 sc/source/ui/theme/ThemeColorChanger.cxx |   25 -
 5 files changed, 127 insertions(+), 12 deletions(-)

New commits:
commit ea1cd4993be992b89930db4811d08a4a51b1f68d
Author: Tomaž Vajngerl 
AuthorDate: Fri May 12 23:21:22 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Wed Jun 21 16:33:57 2023 +0200

sc: OOXML import of theme colors for char and background colors

Change-Id: I8209238927bb425e8e306352f1fa78d63378f005
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151707
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/include/oox/drawingml/color.hxx b/include/oox/drawingml/color.hxx
index 245e655d7c78..ea02ef8a03e4 100644
--- a/include/oox/drawingml/color.hxx
+++ b/include/oox/drawingml/color.hxx
@@ -37,6 +37,7 @@ namespace oox { class GraphicHelper; }
 namespace oox::drawingml
 {
 
+model::ThemeColorType schemeTokenToThemeColorType(sal_uInt32 nToken);
 model::ThemeColorType schemeNameToThemeColorType(OUString const& rSchemeName);
 
 class OOX_DLLPUBLIC Color
@@ -107,6 +108,13 @@ public:
 sal_Int16   getLumMod() const;
 sal_Int16   getLumOff() const;
 
+model::ThemeColorType getThemeColorType() const
+{
+return meThemeColorType;
+}
+
+model::ComplexColor createComplexColor(const GraphicHelper& 
rGraphicHelper, sal_Int16 nPhClrTheme) const;
+
 /** Returns the unaltered list of transformations for interoperability 
purposes */
 const css::uno::Sequence< css::beans::PropertyValue >& 
getTransformations() const { return maInteropTransformations;}
 
@@ -160,8 +168,8 @@ private:
 mutable sal_Int32   mnC2;   /// Green, green%, saturation, or 
system default RGB.
 mutable sal_Int32   mnC3;   /// Blue, blue%, or luminance.
 sal_Int32   mnAlpha;/// Alpha value (color opacity).
-
 OUStringmsSchemeName;   /// Scheme name from the a:schemeClr 
element for interoperability purposes
+model::ThemeColorType meThemeColorType;
 css::uno::Sequence< css::beans::PropertyValue >
 maInteropTransformations;   /// Unaltered list of 
transformations for interoperability purposes
 };
diff --git a/oox/source/drawingml/color.cxx b/oox/source/drawingml/color.cxx
index 91543b3ef123..d13e29839227 100644
--- a/oox/source/drawingml/color.cxx
+++ b/oox/source/drawingml/color.cxx
@@ -209,7 +209,7 @@ void lclOffValue( sal_Int32& ornValue, sal_Int32 nOff, 
sal_Int32 nMax = MAX_PERC
 ornValue = getLimitedValue< sal_Int32, sal_Int32 >( ornValue + nOff, 0, 
nMax );
 }
 
-constexpr frozen::unordered_map aSchemeColorNameToIndex
+constexpr frozen::unordered_map constSchemeColorNameToIndex
 {
 { u"dk1", model::ThemeColorType::Dark1 },
 { u"lt1", model::ThemeColorType::Light1 },
@@ -239,12 +239,51 @@ constexpr frozen::unordered_map
 { u"followedHyperlink", model::ThemeColorType::FollowedHyperlink }
 };
 
+constexpr frozen::unordered_map 
constThemeColorTokenMap
+{
+{ 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 },
+{ XML_tx1, model::ThemeColorType::Dark1 },
+{ XML_bg1, model::ThemeColorType::Light1 },
+{ XML_tx2, model::ThemeColorType::Dark2 },
+{ XML_bg2, model::ThemeColorType::Light2 },
+{ XML_dark1, model::ThemeColorType::Dark1 },
+{ XML_light1, model::ThemeColorType::Light1 },
+{ XML_dark2, model::ThemeColorType::Dark2 },
+{ XML_light2, model::ThemeColorType::Light2 },
+{ XML_text1, model::ThemeColorType::Dark1 },
+{ XML_background1, model::ThemeColorType::Light1 },
+{ XML_text2, model::ThemeColorType::Dark2 },
+{ XML_background2, model::ThemeColorType::Light2 },
+{ XML_hyperlink, model::ThemeColorType::Hyperlink },
+{ XML_followedHyperlink, model::ThemeColorType::FollowedHyperlink },
+};
+
 } // end anonymous namespace
 
 model::ThemeColorType schemeNameToThemeColorType(OUString const& rSchemeName)
 {
-auto aIterator = aSchemeColorNameToIndex.find(rSchemeName);
-if (aIterator == aSchemeColorNameToIndex.end())
+auto aIterator = constSchemeColorNameToIndex.find(rSchemeName);
+if (aIterator == constSchemeColorNameToIndex.end())
+return 

[Libreoffice-commits] core.git: sc/inc sc/qa sc/source test/Library_subsequenttest.mk test/source

2023-06-21 Thread Tomaž Vajngerl (via logerrit)
 sc/inc/unonames.hxx|2 ++
 sc/qa/extras/scstyleobj.cxx|   35 ++-
 sc/source/ui/unoobj/cellsuno.cxx   |   13 +
 sc/source/ui/unoobj/styleuno.cxx   |2 ++
 test/Library_subsequenttest.mk |1 +
 test/source/beans/xpropertyset.cxx |9 +
 6 files changed, 53 insertions(+), 9 deletions(-)

New commits:
commit 56e58e6a1280d9bdd23550ba998f14aef4980244
Author: Tomaž Vajngerl 
AuthorDate: Thu May 11 19:40:06 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Wed Jun 21 10:58:13 2023 +0200

sc: add CharComplexColor and CellBackgroundComplexColor properties

Change-Id: I30153796a39b2aa3648cb107905974ed6f0f3851
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151668
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/sc/inc/unonames.hxx b/sc/inc/unonames.hxx
index 4617bcf46700..7a7396a358e4 100644
--- a/sc/inc/unonames.hxx
+++ b/sc/inc/unonames.hxx
@@ -50,6 +50,7 @@ inline constexpr OUStringLiteral SC_UNO_HASDRAWPAGES 
= u"HasDrawPages";
 
 //  CharacterProperties
 inline constexpr OUStringLiteral SC_UNONAME_CCOLOR   = u"CharColor";
+inline constexpr OUStringLiteral SC_UNONAME_CHAR_COMPLEX_COLOR = 
u"CharComplexColor";
 inline constexpr OUStringLiteral SC_UNONAME_CHEIGHT  = u"CharHeight";
 inline constexpr OUStringLiteral SC_UNONAME_CUNDER   = 
u"CharUnderline";
 inline constexpr OUStringLiteral SC_UNONAME_CUNDLCOL = 
u"CharUnderlineColor";
@@ -97,6 +98,7 @@ inline constexpr OUStringLiteral SC_UNO_CTL_CLOCAL   
= u"CharLocaleCompl
 //  CellProperties
 inline constexpr OUStringLiteral SC_UNONAME_CELLSTYL = u"CellStyle";
 inline constexpr OUStringLiteral SC_UNONAME_CELLBACK = 
u"CellBackColor";
+inline constexpr OUStringLiteral SC_UNONAME_CELL_BACKGROUND_COMPLEX_COLOR = 
u"CellBackgroundComplexColor";
 inline constexpr OUStringLiteral SC_UNONAME_CELLTRAN = 
u"IsCellBackgroundTransparent";
 inline constexpr OUStringLiteral SC_UNONAME_CELLPRO  = 
u"CellProtection";
 inline constexpr OUStringLiteral SC_UNONAME_CELLHJUS = u"HoriJustify";
diff --git a/sc/qa/extras/scstyleobj.cxx b/sc/qa/extras/scstyleobj.cxx
index 7b8ca77c03ab..813a59db944b 100644
--- a/sc/qa/extras/scstyleobj.cxx
+++ b/sc/qa/extras/scstyleobj.cxx
@@ -59,15 +59,32 @@ public:
 ScStyleObj::ScStyleObj()
 : UnoApiTest("/sc/qa/extras/testdocuments")
 , XNamed("ScStyleObj")
-, XPropertySet({
-  "BottomBorder",  "BottomBorder2", "CellProtection", 
"CharLocale",
-  "CharLocaleAsian",   "CharLocaleComplex", "CharPosture",
"CharPostureAsian",
-  "CharPostureComplex","DiagonalBLTR",  "DiagonalBLTR2",  
"DiagonalTLBR",
-  "DiagonalTLBR2", "HoriJustify",   "LeftBorder", 
"LeftBorder2",
-  "NumberFormat",  "Orientation",   "RightBorder",
"RightBorder2",
-  "ShadowFormat",  "TableBorder",   "TopBorder",  
"TopBorder2",
-  "UserDefinedAttributes",
-  })
+, XPropertySet({ "BottomBorder",
+ "BottomBorder2",
+ "CellProtection",
+ "CharLocale",
+ "CharLocaleAsian",
+ "CharLocaleComplex",
+ "CharPosture",
+ "CharPostureAsian",
+ "CharPostureComplex",
+ "DiagonalBLTR",
+ "DiagonalBLTR2",
+ "DiagonalTLBR",
+ "DiagonalTLBR2",
+ "HoriJustify",
+ "LeftBorder",
+ "LeftBorder2",
+ "NumberFormat",
+ "Orientation",
+ "RightBorder",
+ "RightBorder2",
+ "ShadowFormat",
+ "TableBorder",
+ "TopBorder",
+ "TopBorder2",
+ "UserDefinedAttributes",
+ "CellBackgroundComplexColor" })
 {
 }
 
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index 55f72d3dce09..371ea346d364 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -65,6 +65,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -156,9 +157,11 @@ static const SfxItemPropertySet* lcl_GetCellsPropertySet()
 { SC_UNONAME_BOTTBORDER,ATTR_BORDER,   
::cppu::UnoType::get(), 0, BOTTOM_BORDER | CONVERT_TWIPS },
 { SC_UNONAME_BOTTBORDER2,ATTR_BORDER,  
::cppu::UnoType::get(), 0, BOTTOM_BORDER | CONVERT_TWIPS },
 { SC_UNONAME_CELLBACK, ATTR_BACKGROUND,
cppu::UnoType::get(),0, MID_BACK_COLOR },
+{ SC_UNONAME_CELL_BACKGROUND_COMPLEX_COLOR, ATTR_BACKGROUND, 
cppu::UnoType::get(), 0, MID_BACKGROUND_COMPLEX_COLOR 
},
 { SC_UNONAME_CELLPRO,  

[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - sd/source

2023-06-21 Thread Tomaž Vajngerl (via logerrit)
 sd/source/filter/eppt/pptx-epptooxml.cxx |   22 +-
 1 file changed, 17 insertions(+), 5 deletions(-)

New commits:
commit 6e75e18782051d174cb198e129a4d68fe0af9a33
Author: Tomaž Vajngerl 
AuthorDate: Tue Jun 20 17:39:40 2023 +0900
Commit: Xisco Fauli 
CommitDate: Wed Jun 21 08:54:11 2023 +0200

sd: fix setting theme for notes master

Notes master also needs a theme set or the document will not load
properly. For now we don't save the theme for the notes master on
import, so we can only set the default "LibreOffice" theme instead.

Change-Id: Ia9e5db53d4e1a4ca06b10d147cc879475166dfd9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153314
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit b13733de130e2f1ca029315e977dc01bd196b05b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153344
Reviewed-by: Xisco Fauli 

diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx 
b/sd/source/filter/eppt/pptx-epptooxml.cxx
index 023f29dc82c6..88f1d4f541ab 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -66,6 +66,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -2044,12 +2045,23 @@ void PowerPointExport::WriteNotesMaster()
  
"application/vnd.openxmlformats-officedocument.presentationml.notesMaster+xml");
 // write theme per master
 
-WriteTheme(mnMasterPages, nullptr);
+// TODO: Need to implement theme support for note master, so the
+// note master has his own theme associated.
 
-// add implicit relation to the presentation theme
-addRelation(pFS->getOutputStream(),
-oox::getRelationship(Relationship::THEME),
-Concat2View("../theme/theme" + OUString::number(mnMasterPages 
+ 1) + ".xml"));
+// For now just use the default theme
+auto const* pDefaultColorSet = 
svx::ColorSets::get().getColorSet(u"LibreOffice");
+if (pDefaultColorSet)
+{
+auto pTheme = std::make_shared("Office Theme");
+
pTheme->setColorSet(std::make_shared(*pDefaultColorSet));
+
+WriteTheme(mnMasterPages, pTheme.get());
+
+// add implicit relation to the presentation theme
+addRelation(pFS->getOutputStream(),
+oox::getRelationship(Relationship::THEME),
+Concat2View("../theme/theme" + 
OUString::number(mnMasterPages + 1) + ".xml"));
+}
 
 pFS->startElementNS(XML_p, XML_notesMaster, PNMSS);
 


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sd/source

2023-06-20 Thread Tomaž Vajngerl (via logerrit)
 sd/source/filter/eppt/pptx-epptooxml.cxx |   22 +-
 1 file changed, 17 insertions(+), 5 deletions(-)

New commits:
commit a56040d28fb19187ac34abcce37ef337e5a8593d
Author: Tomaž Vajngerl 
AuthorDate: Tue Jun 20 17:39:40 2023 +0900
Commit: Aron Budea 
CommitDate: Tue Jun 20 17:54:48 2023 +0200

sd: fix setting theme for notes master

Notes master also needs a theme set or the document will not load
properly. For now we don't save the theme for the notes master on
import, so we can only set the default "LibreOffice" theme instead.

Change-Id: Ia9e5db53d4e1a4ca06b10d147cc879475166dfd9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153314
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit b13733de130e2f1ca029315e977dc01bd196b05b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153321
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Aron Budea 

diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx 
b/sd/source/filter/eppt/pptx-epptooxml.cxx
index 1b784e1e5fa5..f56a04c04750 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -66,6 +66,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -2042,12 +2043,23 @@ void PowerPointExport::WriteNotesMaster()
  
"application/vnd.openxmlformats-officedocument.presentationml.notesMaster+xml");
 // write theme per master
 
-WriteTheme(mnMasterPages, nullptr);
+// TODO: Need to implement theme support for note master, so the
+// note master has his own theme associated.
 
-// add implicit relation to the presentation theme
-addRelation(pFS->getOutputStream(),
-oox::getRelationship(Relationship::THEME),
-Concat2View("../theme/theme" + OUString::number(mnMasterPages 
+ 1) + ".xml"));
+// For now just use the default theme
+auto const* pDefaultColorSet = 
svx::ColorSets::get().getColorSet(u"LibreOffice");
+if (pDefaultColorSet)
+{
+auto pTheme = std::make_shared("Office Theme");
+
pTheme->setColorSet(std::make_shared(*pDefaultColorSet));
+
+WriteTheme(mnMasterPages, pTheme.get());
+
+// add implicit relation to the presentation theme
+addRelation(pFS->getOutputStream(),
+oox::getRelationship(Relationship::THEME),
+Concat2View("../theme/theme" + 
OUString::number(mnMasterPages + 1) + ".xml"));
+}
 
 pFS->startElementNS(XML_p, XML_notesMaster, PNMSS);
 


[Libreoffice-commits] core.git: sd/source

2023-06-20 Thread Tomaž Vajngerl (via logerrit)
 sd/source/filter/eppt/pptx-epptooxml.cxx |   22 +-
 1 file changed, 17 insertions(+), 5 deletions(-)

New commits:
commit b13733de130e2f1ca029315e977dc01bd196b05b
Author: Tomaž Vajngerl 
AuthorDate: Tue Jun 20 17:39:40 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Tue Jun 20 13:14:48 2023 +0200

sd: fix setting theme for notes master

Notes master also needs a theme set or the document will not load
properly. For now we don't save the theme for the notes master on
import, so we can only set the default "LibreOffice" theme instead.

Change-Id: Ia9e5db53d4e1a4ca06b10d147cc879475166dfd9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153314
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx 
b/sd/source/filter/eppt/pptx-epptooxml.cxx
index 8d0a85b16b5a..8c0e7f740437 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -66,6 +66,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -2044,12 +2045,23 @@ void PowerPointExport::WriteNotesMaster()
  
"application/vnd.openxmlformats-officedocument.presentationml.notesMaster+xml");
 // write theme per master
 
-WriteTheme(mnMasterPages, nullptr);
+// TODO: Need to implement theme support for note master, so the
+// note master has his own theme associated.
 
-// add implicit relation to the presentation theme
-addRelation(pFS->getOutputStream(),
-oox::getRelationship(Relationship::THEME),
-Concat2View("../theme/theme" + OUString::number(mnMasterPages 
+ 1) + ".xml"));
+// For now just use the default theme
+auto const* pDefaultColorSet = 
svx::ColorSets::get().getColorSet(u"LibreOffice");
+if (pDefaultColorSet)
+{
+auto pTheme = std::make_shared("Office Theme");
+
pTheme->setColorSet(std::make_shared(*pDefaultColorSet));
+
+WriteTheme(mnMasterPages, pTheme.get());
+
+// add implicit relation to the presentation theme
+addRelation(pFS->getOutputStream(),
+oox::getRelationship(Relationship::THEME),
+Concat2View("../theme/theme" + 
OUString::number(mnMasterPages + 1) + ".xml"));
+}
 
 pFS->startElementNS(XML_p, XML_notesMaster, PNMSS);
 


[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - sd/qa sd/source

2023-06-20 Thread Tomaž Vajngerl (via logerrit)
 sd/qa/unit/uiimpress.cxx   |5 +++--
 sd/source/ui/func/fuconstr.cxx |   36 
 2 files changed, 3 insertions(+), 38 deletions(-)

New commits:
commit cf36777e8df6ed7233e3c6c6fc0ba0a1ed505cfb
Author: Tomaž Vajngerl 
AuthorDate: Mon Jun 19 15:28:40 2023 +0900
Commit: Xisco Fauli 
CommitDate: Tue Jun 20 10:10:37 2023 +0200

tdf#155086 remove code that sets theme color to shapes as DF

Remove this functionallity for now until we support theme colors
in shape styles. Then we can do it for the default style, and not
as a direct format for each inserted shape.

Change-Id: Ib042072954a79cadc750372333c40269fbe4ca40
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153244
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 2afff27c5327bcb30f894d9a507131f2ad8f1dc6)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153286
Reviewed-by: Xisco Fauli 

diff --git a/sd/qa/unit/uiimpress.cxx b/sd/qa/unit/uiimpress.cxx
index e3a9c86e91d1..c4cdc0a5e338 100644
--- a/sd/qa/unit/uiimpress.cxx
+++ b/sd/qa/unit/uiimpress.cxx
@@ -1144,7 +1144,8 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf127696)
 CPPUNIT_ASSERT(bContoured);
 }
 
-CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testThemeShapeInsert)
+// TODO - Readd when we implement style level fill color and set that for 
default style
+/*CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testThemeShapeInsert)
 {
 // Given a document with a theme, accent1 color is set to 0x04:
 createSdImpressDoc();
@@ -1188,7 +1189,7 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, 
testThemeShapeInsert)
 // - Expected: 0 / 0x04 (~black)
 // - Actual  : 7512015 / 0x729fcf (~blue)
 CPPUNIT_ASSERT_EQUAL(static_cast(0x4), nFillColor);
-}
+}*/
 
 CPPUNIT_PLUGIN_IMPLEMENT();
 
diff --git a/sd/source/ui/func/fuconstr.cxx b/sd/source/ui/func/fuconstr.cxx
index 4db1f4042dc9..fd93a3ce7c94 100644
--- a/sd/source/ui/func/fuconstr.cxx
+++ b/sd/source/ui/func/fuconstr.cxx
@@ -371,42 +371,6 @@ void FuConstruct::SetStyleSheet( SfxItemSet& rAttr, 
SdrObject* pObj,
 pObj->SetMergedItemSet(aAttr);
 }
 }
-else
-{
-// Creating an object with fill.
-SdrPage* pThemePage = pPage;
-if (pThemePage->TRG_HasMasterPage())
-{
-pThemePage = >TRG_GetMasterPage();
-}
-
-auto const& pTheme = pThemePage->getSdrPageProperties().GetTheme();
-if (pTheme)
-{
-// We construct an object on a page where the master page has 
a theme. Take the
-// accent1 color from that theme, make sure it has priority 
over the shape's
-// document-global style.
-SfxItemSet aAttr(mpView->GetDefaultAttr());
-
-aAttr.Put(XFillStyleItem(css::drawing::FillStyle_SOLID));
-
-model::ThemeColorType eColorType = 
model::ThemeColorType::Accent1;
-Color aColor = pTheme->GetColor(eColorType);
-XFillColorItem aFillColorItem("", aColor);
-aFillColorItem.getComplexColor().setSchemeColor(eColorType);
-aAttr.Put(aFillColorItem);
-
-aAttr.Put(XLineStyleItem(css::drawing::LineStyle_SOLID));
-
-// Line color is 50% darker than the fill color.
-aColor.ApplyTintOrShade(-5000);
-XLineColorItem aLineColorItem("", aColor);
-// TODO no theme or theme effect for line colors yet.
-aAttr.Put(aLineColorItem);
-
-pObj->SetMergedItemSet(aAttr);
-}
-}
 }
 }
 


[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - oox/source

2023-06-20 Thread Tomaž Vajngerl (via logerrit)
 oox/source/export/ThemeExport.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit a8a29024c0268159995f81fb509cac792721b2d4
Author: Tomaž Vajngerl 
AuthorDate: Mon Jun 19 15:25:40 2023 +0900
Commit: Xisco Fauli 
CommitDate: Tue Jun 20 09:11:29 2023 +0200

oox: ThemeExport - add "relationship" xml:r namespace

Blips are referenced by r:embed element, which needs the xmlns:r
to be present, so add it at the toplevel.

Change-Id: Iccc3d197bf30b428927521c6ba598d8d92fa734d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153243
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 23a7fb9582fba4e5b699f0ea4bb270719256b403)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153275
Reviewed-by: Xisco Fauli 

diff --git a/oox/source/export/ThemeExport.cxx 
b/oox/source/export/ThemeExport.cxx
index f09f9012e246..568d0dbbf615 100644
--- a/oox/source/export/ThemeExport.cxx
+++ b/oox/source/export/ThemeExport.cxx
@@ -49,7 +49,8 @@ void ThemeExport::write(OUString const& rPath, model::Theme 
const& rTheme)
 OUString aThemeName = rTheme.GetName();
 
 mpFS->startElementNS(XML_a, XML_theme, FSNS(XML_xmlns, XML_a),
- mpFilterBase->getNamespaceURL(OOX_NS(dml)), XML_name, 
aThemeName);
+ mpFilterBase->getNamespaceURL(OOX_NS(dml)), 
FSNS(XML_xmlns, XML_r),
+ mpFilterBase->getNamespaceURL(OOX_NS(officeRel)), 
XML_name, aThemeName);
 
 mpFS->startElementNS(XML_a, XML_themeElements);
 


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - include/editeng oox/source sw/source writerfilter/source

2023-06-20 Thread Tomaž Vajngerl (via logerrit)
 include/editeng/unoprnms.hxx |4 +
 include/editeng/unotext.hxx  |5 -
 oox/source/drawingml/textcharacterproperties.cxx |6 +
 oox/source/token/properties.txt  |2 
 sw/source/filter/ww8/docxattributeoutput.cxx |   26 ++--
 writerfilter/source/dmapper/CellColorHandler.cxx |   70 ++-
 writerfilter/source/dmapper/CellColorHandler.hxx |   15 
 writerfilter/source/dmapper/PropertyIds.cxx  |7 +-
 writerfilter/source/dmapper/PropertyIds.hxx  |3 
 9 files changed, 124 insertions(+), 14 deletions(-)

New commits:
commit abff4459415dac99c66ad4d6b13ece6755ac37ab
Author: Tomaž Vajngerl 
AuthorDate: Sun Jun 11 00:57:36 2023 +0900
Commit: Miklos Vajna 
CommitDate: Tue Jun 20 08:48:55 2023 +0200

ooxml: import and export background and fill theme colors props.

This adds support to import and export background and fill theme
color properties.

Change-Id: I0f40615fe2d06cdcb4f2f9752602fe2ec699c7b3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152835
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 9e121f3a6b95dab7525aa1583f810b2b504ce1b3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153255
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/include/editeng/unoprnms.hxx b/include/editeng/unoprnms.hxx
index e9fedb92d611..c38a7ecaa493 100644
--- a/include/editeng/unoprnms.hxx
+++ b/include/editeng/unoprnms.hxx
@@ -350,6 +350,10 @@ inline constexpr OUStringLiteral 
UNO_NAME_EDIT_CHAR_SHADOWED = u"CharShadowed";
 inline constexpr OUStringLiteral UNO_NAME_EDIT_CHAR_UNDERLINE = 
u"CharUnderline";
 inline constexpr OUStringLiteral UNO_NAME_EDIT_CHAR_OVERLINE = u"CharOverline";
 
+inline constexpr OUStringLiteral UNO_NAME_EDIT_CHAR_BACKGROUND_COLOR = 
u"CharBackColor";
+inline constexpr OUStringLiteral UNO_NAME_EDIT_CHAR_BACKGROUND_COMPLEX_COLOR = 
u"CharBackgroundComplexColor";
+inline constexpr OUStringLiteral UNO_NAME_EDIT_CHAR_BACKGROUND_TRANSPARENT = 
u"CharBackTransparent";
+
 inline constexpr OUStringLiteral UNO_NAME_BITMAP = u"Bitmap";
 
 inline constexpr OUStringLiteral UNO_NAME_LINKDISPLAYNAME = u"LinkDisplayName";
diff --git a/include/editeng/unotext.hxx b/include/editeng/unotext.hxx
index 79cbb92a3770..2e3397d392a5 100644
--- a/include/editeng/unotext.hxx
+++ b/include/editeng/unotext.hxx
@@ -93,8 +93,9 @@ struct SfxItemPropertyMapEntry;
 { UNO_NAME_EDIT_CHAR_COLOR_LUM_MOD,   EE_CHAR_COLOR, 
::cppu::UnoType::get(), 0, MID_COLOR_LUM_MOD }, \
 { UNO_NAME_EDIT_CHAR_COLOR_LUM_OFF,   EE_CHAR_COLOR, 
::cppu::UnoType::get(), 0, MID_COLOR_LUM_OFF }, \
 { UNO_NAME_EDIT_CHAR_COMPLEX_COLOR, EE_CHAR_COLOR,
::cppu::UnoType::get(), 0, MID_COMPLEX_COLOR }, \
-{ u"CharBackColor",EE_CHAR_BKGCOLOR,   
::cppu::UnoType::get(),0, 0 }, \
-{ u"CharBackTransparent",  EE_CHAR_BKGCOLOR,   
::cppu::UnoType::get(), 0, MID_GRAPHIC_TRANSPARENT }, \
+{ UNO_NAME_EDIT_CHAR_BACKGROUND_COLOR, EE_CHAR_BKGCOLOR,   
::cppu::UnoType::get(),0, MID_COLOR_RGB }, \
+{ UNO_NAME_EDIT_CHAR_BACKGROUND_COMPLEX_COLOR, EE_CHAR_BKGCOLOR, 
::cppu::UnoType::get(), 0, MID_COMPLEX_COLOR }, \
+{ UNO_NAME_EDIT_CHAR_BACKGROUND_TRANSPARENT, EE_CHAR_BKGCOLOR,   
::cppu::UnoType::get(), 0, MID_GRAPHIC_TRANSPARENT }, \
 { UNO_NAME_EDIT_CHAR_ESCAPEMENT,  EE_CHAR_ESCAPEMENT, 
::cppu::UnoType::get(),0, MID_ESC }, \
 { UNO_NAME_EDIT_CHAR_UNDERLINE,   EE_CHAR_UNDERLINE,  
::cppu::UnoType::get(),0, MID_TL_STYLE }, \
 { u"CharUnderlineColor",   EE_CHAR_UNDERLINE,  
::cppu::UnoType::get(),0, MID_TL_COLOR }, \
diff --git a/oox/source/drawingml/textcharacterproperties.cxx 
b/oox/source/drawingml/textcharacterproperties.cxx
index 1217c19441ae..c3dde4889a64 100644
--- a/oox/source/drawingml/textcharacterproperties.cxx
+++ b/oox/source/drawingml/textcharacterproperties.cxx
@@ -216,7 +216,11 @@ void TextCharacterProperties::pushToPropMap( PropertyMap& 
rPropMap, const XmlFil
 }
 
 if (maHighlightColor.isUsed() && maHighlightColor.getTransparency() != 100)
-rPropMap.setProperty( PROP_CharBackColor, maHighlightColor.getColor( 
rFilter.getGraphicHelper() ));
+{
+rPropMap.setProperty(PROP_CharBackColor, maHighlightColor.getColor( 
rFilter.getGraphicHelper() ));
+model::ComplexColor aComplexColor = maHighlightColor.getComplexColor();
+rPropMap.setProperty(PROP_CharBackgroundComplexColor, 
model::color::createXComplexColor(aComplexColor));
+}
 else
 rPropMap.setProperty( PROP_CharBackColor, sal_Int32(-1));
 }
diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt
index 025b0628b9d8..a6de5458b663 100644
--- a/oox/source/token/properties.txt
+++ b/oox/source/token/properties.txt
@@ -24,6 +24,7 @@ BackGraphicLocation
 BackGraphic
 

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - oox/source

2023-06-19 Thread Tomaž Vajngerl (via logerrit)
 oox/source/export/ThemeExport.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit b421bbf432602bd892b2c179ecdd11e00ea12813
Author: Tomaž Vajngerl 
AuthorDate: Mon Jun 19 15:25:40 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Mon Jun 19 15:52:59 2023 +0200

oox: ThemeExport - add "relationship" xml:r namespace

Blips are referenced by r:embed element, which needs the xmlns:r
to be present, so add it at the toplevel.

Change-Id: Iccc3d197bf30b428927521c6ba598d8d92fa734d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153243
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 23a7fb9582fba4e5b699f0ea4bb270719256b403)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153273
Reviewed-by: Michael Meeks 
Tested-by: Jenkins CollaboraOffice 

diff --git a/oox/source/export/ThemeExport.cxx 
b/oox/source/export/ThemeExport.cxx
index f09f9012e246..568d0dbbf615 100644
--- a/oox/source/export/ThemeExport.cxx
+++ b/oox/source/export/ThemeExport.cxx
@@ -49,7 +49,8 @@ void ThemeExport::write(OUString const& rPath, model::Theme 
const& rTheme)
 OUString aThemeName = rTheme.GetName();
 
 mpFS->startElementNS(XML_a, XML_theme, FSNS(XML_xmlns, XML_a),
- mpFilterBase->getNamespaceURL(OOX_NS(dml)), XML_name, 
aThemeName);
+ mpFilterBase->getNamespaceURL(OOX_NS(dml)), 
FSNS(XML_xmlns, XML_r),
+ mpFilterBase->getNamespaceURL(OOX_NS(officeRel)), 
XML_name, aThemeName);
 
 mpFS->startElementNS(XML_a, XML_themeElements);
 


[Libreoffice-commits] core.git: 2 commits - sd/qa sd/source sw/qa

2023-06-19 Thread Tomaž Vajngerl (via logerrit)
 sd/qa/unit/uiimpress.cxx |5 -
 sd/source/ui/func/fuconstr.cxx   |   36 

 sw/qa/extras/ooxmlexport/data/Test_ThemeTextParaBackgroundColor.docx |binary
 sw/qa/extras/ooxmlexport/ooxml_ThemeExport.cxx   |   43 
++
 4 files changed, 46 insertions(+), 38 deletions(-)

New commits:
commit 2afff27c5327bcb30f894d9a507131f2ad8f1dc6
Author: Tomaž Vajngerl 
AuthorDate: Mon Jun 19 15:28:40 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Mon Jun 19 13:36:37 2023 +0200

tdf#155086 remove code that sets theme color to shapes as DF

Remove this functionallity for now until we support theme colors
in shape styles. Then we can do it for the default style, and not
as a direct format for each inserted shape.

Change-Id: Ib042072954a79cadc750372333c40269fbe4ca40
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153244
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/sd/qa/unit/uiimpress.cxx b/sd/qa/unit/uiimpress.cxx
index e3a9c86e91d1..c4cdc0a5e338 100644
--- a/sd/qa/unit/uiimpress.cxx
+++ b/sd/qa/unit/uiimpress.cxx
@@ -1144,7 +1144,8 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf127696)
 CPPUNIT_ASSERT(bContoured);
 }
 
-CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testThemeShapeInsert)
+// TODO - Readd when we implement style level fill color and set that for 
default style
+/*CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testThemeShapeInsert)
 {
 // Given a document with a theme, accent1 color is set to 0x04:
 createSdImpressDoc();
@@ -1188,7 +1189,7 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, 
testThemeShapeInsert)
 // - Expected: 0 / 0x04 (~black)
 // - Actual  : 7512015 / 0x729fcf (~blue)
 CPPUNIT_ASSERT_EQUAL(static_cast(0x4), nFillColor);
-}
+}*/
 
 CPPUNIT_PLUGIN_IMPLEMENT();
 
diff --git a/sd/source/ui/func/fuconstr.cxx b/sd/source/ui/func/fuconstr.cxx
index 4db1f4042dc9..fd93a3ce7c94 100644
--- a/sd/source/ui/func/fuconstr.cxx
+++ b/sd/source/ui/func/fuconstr.cxx
@@ -371,42 +371,6 @@ void FuConstruct::SetStyleSheet( SfxItemSet& rAttr, 
SdrObject* pObj,
 pObj->SetMergedItemSet(aAttr);
 }
 }
-else
-{
-// Creating an object with fill.
-SdrPage* pThemePage = pPage;
-if (pThemePage->TRG_HasMasterPage())
-{
-pThemePage = >TRG_GetMasterPage();
-}
-
-auto const& pTheme = pThemePage->getSdrPageProperties().GetTheme();
-if (pTheme)
-{
-// We construct an object on a page where the master page has 
a theme. Take the
-// accent1 color from that theme, make sure it has priority 
over the shape's
-// document-global style.
-SfxItemSet aAttr(mpView->GetDefaultAttr());
-
-aAttr.Put(XFillStyleItem(css::drawing::FillStyle_SOLID));
-
-model::ThemeColorType eColorType = 
model::ThemeColorType::Accent1;
-Color aColor = pTheme->GetColor(eColorType);
-XFillColorItem aFillColorItem("", aColor);
-aFillColorItem.getComplexColor().setSchemeColor(eColorType);
-aAttr.Put(aFillColorItem);
-
-aAttr.Put(XLineStyleItem(css::drawing::LineStyle_SOLID));
-
-// Line color is 50% darker than the fill color.
-aColor.ApplyTintOrShade(-5000);
-XLineColorItem aLineColorItem("", aColor);
-// TODO no theme or theme effect for line colors yet.
-aAttr.Put(aLineColorItem);
-
-pObj->SetMergedItemSet(aAttr);
-}
-}
 }
 }
 
commit 703c28d76924bcbda3f492de8a14cc9c30ee1dfb
Author: Tomaž Vajngerl 
AuthorDate: Mon Jun 19 15:48:56 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Mon Jun 19 13:36:28 2023 +0200

sw: Test paragraph level text background

Change-Id: Icea365ae036cae49749dd24bb8412775fafbd6c5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153247
Tested-by: Tomaž Vajngerl 
Reviewed-by: Tomaž Vajngerl 

diff --git 
a/sw/qa/extras/ooxmlexport/data/Test_ThemeTextParaBackgroundColor.docx 
b/sw/qa/extras/ooxmlexport/data/Test_ThemeTextParaBackgroundColor.docx
new file mode 100644
index ..5b012f01333b
Binary files /dev/null and 
b/sw/qa/extras/ooxmlexport/data/Test_ThemeTextParaBackgroundColor.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxml_ThemeExport.cxx 
b/sw/qa/extras/ooxmlexport/ooxml_ThemeExport.cxx
index f9e7155859ea..45bd8014f1d3 100644
--- a/sw/qa/extras/ooxmlexport/ooxml_ThemeExport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxml_ThemeExport.cxx
@@ -97,6 +97,49 @@ DECLARE_SW_ROUNDTRIP_TEST(testCharUnderlineTheme_DOCX, 
"Test_CharUnderlineThemeC
 CPPUNIT_ASSERT_EQUAL(sal_Int16(2509), rTransforms[0].mnValue);
 }
 

[Libreoffice-commits] core.git: oox/source

2023-06-19 Thread Tomaž Vajngerl (via logerrit)
 oox/source/export/ThemeExport.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 23a7fb9582fba4e5b699f0ea4bb270719256b403
Author: Tomaž Vajngerl 
AuthorDate: Mon Jun 19 15:25:40 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Mon Jun 19 10:07:28 2023 +0200

oox: ThemeExport - add "relationship" xml:r namespace

Blips are referenced by r:embed element, which needs the xmlns:r
to be present, so add it at the toplevel.

Change-Id: Iccc3d197bf30b428927521c6ba598d8d92fa734d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153243
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/oox/source/export/ThemeExport.cxx 
b/oox/source/export/ThemeExport.cxx
index 8d2d90fe1598..87cb5f2bc0bc 100644
--- a/oox/source/export/ThemeExport.cxx
+++ b/oox/source/export/ThemeExport.cxx
@@ -52,7 +52,8 @@ void ThemeExport::write(OUString const& rPath, model::Theme 
const& rTheme)
 OUString aThemeName = rTheme.GetName();
 
 mpFS->startElementNS(XML_a, XML_theme, FSNS(XML_xmlns, XML_a),
- mpFilterBase->getNamespaceURL(OOX_NS(dml)), XML_name, 
aThemeName);
+ mpFilterBase->getNamespaceURL(OOX_NS(dml)), 
FSNS(XML_xmlns, XML_r),
+ mpFilterBase->getNamespaceURL(OOX_NS(officeRel)), 
XML_name, aThemeName);
 
 mpFS->startElementNS(XML_a, XML_themeElements);
 


[Libreoffice-commits] core.git: writerfilter/source

2023-06-18 Thread Tomaž Vajngerl (via logerrit)
 writerfilter/source/dmapper/PropertyIds.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit d7bc610a359ca7e95b3a600c03da6a0b9e6f439c
Author: Tomaž Vajngerl 
AuthorDate: Sun Jun 18 23:35:36 2023 +0900
Commit: Julien Nabet 
CommitDate: Sun Jun 18 17:36:51 2023 +0200

use frozen::make_unordered_map so no need to specify the count

Change-Id: I08057846e735028fb4634fad8b210c707905e096
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153233
Tested-by: Jenkins
Tested-by: Julien Nabet 
Reviewed-by: Julien Nabet 

diff --git a/writerfilter/source/dmapper/PropertyIds.cxx 
b/writerfilter/source/dmapper/PropertyIds.cxx
index d294a3ad082c..11ef07230fad 100644
--- a/writerfilter/source/dmapper/PropertyIds.cxx
+++ b/writerfilter/source/dmapper/PropertyIds.cxx
@@ -26,7 +26,7 @@ namespace writerfilter::dmapper{
 
 namespace
 {
-constexpr frozen::unordered_map 
constPropertyMap
+constexpr auto constPropertyMap = frozen::make_unordered_map(
 {
 { PROP_CHAR_WEIGHT, u"CharWeight"},
 { PROP_CHAR_POSTURE, u"CharPosture"},
@@ -378,7 +378,7 @@ namespace
 { PROP_CURSOR_NOT_IGNORE_TABLES_IN_HF, u"CursorNotIgnoreTables"},
 { PROP_PARA_CONNECT_BORDERS, u"ParaIsConnectBorder"},
 { PROP_DECORATIVE, u"Decorative"},
-};
+});
 } // end anonymous ns
 
 OUString getPropertyName( PropertyIds eId )


[Libreoffice-commits] core.git: include/editeng oox/source sw/source writerfilter/source

2023-06-18 Thread Tomaž Vajngerl (via logerrit)
 include/editeng/unoprnms.hxx |4 +
 include/editeng/unotext.hxx  |5 -
 oox/source/drawingml/textcharacterproperties.cxx |6 +
 oox/source/token/properties.txt  |2 
 sw/source/filter/ww8/docxattributeoutput.cxx |   28 ++---
 writerfilter/source/dmapper/CellColorHandler.cxx |   70 ++-
 writerfilter/source/dmapper/CellColorHandler.hxx |   15 
 writerfilter/source/dmapper/PropertyIds.cxx  |7 +-
 writerfilter/source/dmapper/PropertyIds.hxx  |3 
 9 files changed, 125 insertions(+), 15 deletions(-)

New commits:
commit 9e121f3a6b95dab7525aa1583f810b2b504ce1b3
Author: Tomaž Vajngerl 
AuthorDate: Sun Jun 11 00:57:36 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Sun Jun 18 13:32:12 2023 +0200

ooxml: import and export background and fill theme colors props.

This adds support to import and export background and fill theme
color properties.

Change-Id: I0f40615fe2d06cdcb4f2f9752602fe2ec699c7b3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152835
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/include/editeng/unoprnms.hxx b/include/editeng/unoprnms.hxx
index 8859dfe5a4a5..214b8fd53dea 100644
--- a/include/editeng/unoprnms.hxx
+++ b/include/editeng/unoprnms.hxx
@@ -350,6 +350,10 @@ inline constexpr OUStringLiteral 
UNO_NAME_EDIT_CHAR_SHADOWED = u"CharShadowed";
 inline constexpr OUStringLiteral UNO_NAME_EDIT_CHAR_UNDERLINE = 
u"CharUnderline";
 inline constexpr OUStringLiteral UNO_NAME_EDIT_CHAR_OVERLINE = u"CharOverline";
 
+inline constexpr OUStringLiteral UNO_NAME_EDIT_CHAR_BACKGROUND_COLOR = 
u"CharBackColor";
+inline constexpr OUStringLiteral UNO_NAME_EDIT_CHAR_BACKGROUND_COMPLEX_COLOR = 
u"CharBackgroundComplexColor";
+inline constexpr OUStringLiteral UNO_NAME_EDIT_CHAR_BACKGROUND_TRANSPARENT = 
u"CharBackTransparent";
+
 inline constexpr OUStringLiteral UNO_NAME_BITMAP = u"Bitmap";
 
 inline constexpr OUStringLiteral UNO_NAME_LINKDISPLAYNAME = u"LinkDisplayName";
diff --git a/include/editeng/unotext.hxx b/include/editeng/unotext.hxx
index de79cae965f2..213c5efa6b4f 100644
--- a/include/editeng/unotext.hxx
+++ b/include/editeng/unotext.hxx
@@ -94,8 +94,9 @@ struct SfxItemPropertyMapEntry;
 { UNO_NAME_EDIT_CHAR_COLOR_LUM_MOD,   EE_CHAR_COLOR, 
::cppu::UnoType::get(), 0, MID_COLOR_LUM_MOD }, \
 { UNO_NAME_EDIT_CHAR_COLOR_LUM_OFF,   EE_CHAR_COLOR, 
::cppu::UnoType::get(), 0, MID_COLOR_LUM_OFF }, \
 { UNO_NAME_EDIT_CHAR_COMPLEX_COLOR, EE_CHAR_COLOR,
::cppu::UnoType::get(), 0, MID_COMPLEX_COLOR }, \
-{ u"CharBackColor",EE_CHAR_BKGCOLOR,   
::cppu::UnoType::get(),0, 0 }, \
-{ u"CharBackTransparent",  EE_CHAR_BKGCOLOR,   
::cppu::UnoType::get(), 0, MID_GRAPHIC_TRANSPARENT }, \
+{ UNO_NAME_EDIT_CHAR_BACKGROUND_COLOR, EE_CHAR_BKGCOLOR,   
::cppu::UnoType::get(),0, MID_COLOR_RGB }, \
+{ UNO_NAME_EDIT_CHAR_BACKGROUND_COMPLEX_COLOR, EE_CHAR_BKGCOLOR, 
::cppu::UnoType::get(), 0, MID_COMPLEX_COLOR }, \
+{ UNO_NAME_EDIT_CHAR_BACKGROUND_TRANSPARENT, EE_CHAR_BKGCOLOR,   
::cppu::UnoType::get(), 0, MID_GRAPHIC_TRANSPARENT }, \
 { UNO_NAME_EDIT_CHAR_ESCAPEMENT,  EE_CHAR_ESCAPEMENT, 
::cppu::UnoType::get(),0, MID_ESC }, \
 { UNO_NAME_EDIT_CHAR_UNDERLINE,   EE_CHAR_UNDERLINE,  
::cppu::UnoType::get(),0, MID_TL_STYLE }, \
 { u"CharUnderlineColor",   EE_CHAR_UNDERLINE,  
::cppu::UnoType::get(),0, MID_TL_COLOR }, \
diff --git a/oox/source/drawingml/textcharacterproperties.cxx 
b/oox/source/drawingml/textcharacterproperties.cxx
index 1217c19441ae..c3dde4889a64 100644
--- a/oox/source/drawingml/textcharacterproperties.cxx
+++ b/oox/source/drawingml/textcharacterproperties.cxx
@@ -216,7 +216,11 @@ void TextCharacterProperties::pushToPropMap( PropertyMap& 
rPropMap, const XmlFil
 }
 
 if (maHighlightColor.isUsed() && maHighlightColor.getTransparency() != 100)
-rPropMap.setProperty( PROP_CharBackColor, maHighlightColor.getColor( 
rFilter.getGraphicHelper() ));
+{
+rPropMap.setProperty(PROP_CharBackColor, maHighlightColor.getColor( 
rFilter.getGraphicHelper() ));
+model::ComplexColor aComplexColor = maHighlightColor.getComplexColor();
+rPropMap.setProperty(PROP_CharBackgroundComplexColor, 
model::color::createXComplexColor(aComplexColor));
+}
 else
 rPropMap.setProperty( PROP_CharBackColor, sal_Int32(-1));
 }
diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt
index 025b0628b9d8..a6de5458b663 100644
--- a/oox/source/token/properties.txt
+++ b/oox/source/token/properties.txt
@@ -24,6 +24,7 @@ BackGraphicLocation
 BackGraphic
 Background
 BackgroundColor
+BackgroundComplexColor
 BasicLibraries
 BlackDay
 BlockIncrement
@@ -52,6 +53,7 @@ CenterHorizontally
 CenterVertically
 Change
 CharBackColor
+CharBackgroundComplexColor
 

[Libreoffice-commits] core.git: filter/Library_msfilter.mk filter/source include/oox oox/Library_oox.mk oox/source sc/Library_scfilt.mk sd/Library_sd.mk sd/source writerfilter/Library_writerfilter.mk

2023-06-17 Thread Tomaž Vajngerl (via logerrit)
 filter/Library_msfilter.mk |5 
 filter/source/msfilter/msvbahelper.cxx |   95 ++---
 include/oox/drawingml/clrscheme.hxx|   17 
 oox/Library_oox.mk |1 
 oox/source/drawingml/clrscheme.cxx |   34 +
 oox/source/drawingml/color.cxx |  310 -
 oox/source/drawingml/colorchoicecontext.cxx|7 
 oox/source/drawingml/fontworkhelpers.cxx   |   44 +-
 oox/source/drawingml/misccontexts.cxx  |5 
 oox/source/drawingml/table/predefined-table-styles.cxx |   44 +-
 oox/source/export/ThemeExport.cxx  |  164 
 oox/source/ppt/presentationfragmenthandler.cxx |   29 +
 oox/source/token/relationship.cxx  |   25 -
 oox/source/token/relationship.inc  |   96 ++---
 sc/Library_scfilt.mk   |1 
 sd/Library_sd.mk   |1 
 sd/source/filter/eppt/pptx-epptooxml.cxx   |2 
 writerfilter/Library_writerfilter.mk   |1 
 writerfilter/source/dmapper/PropertyIds.cxx|   19 -
 writerfilter/source/dmapper/PropertyIds.hxx|2 
 xmloff/Library_xo.mk   |5 
 xmloff/source/style/XMLRtlGutterPropertyHandler.cxx|   18 
 22 files changed, 509 insertions(+), 416 deletions(-)

New commits:
commit 2fa7d4a88061a599b0ee29ac94c2515c9fdafc79
Author: Tomaž Vajngerl 
AuthorDate: Wed Jun 14 11:48:51 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Sat Jun 17 12:31:24 2023 +0200

oox, writerfilter, xmloff: use frozen data structures for static data

Change-Id: I4a53fa57f52900104d249c84cde36c9d3b9e1300
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153175
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/filter/Library_msfilter.mk b/filter/Library_msfilter.mk
index 0429a6e31874..fcc343520602 100644
--- a/filter/Library_msfilter.mk
+++ b/filter/Library_msfilter.mk
@@ -21,7 +21,10 @@ $(eval $(call gb_Library_Library,msfilter))
 
 $(eval $(call 
gb_Library_set_componentfile,msfilter,filter/source/msfilter/msfilter,services))
 
-$(eval $(call gb_Library_use_external,msfilter,boost_headers))
+$(eval $(call gb_Library_use_externals,msfilter,\
+boost_headers \
+frozen \
+))
 
 $(eval $(call gb_Library_use_sdk_api,msfilter))
 
diff --git a/filter/source/msfilter/msvbahelper.cxx 
b/filter/source/msfilter/msvbahelper.cxx
index 923aecb9c3dd..d3fc42af8c2d 100644
--- a/filter/source/msfilter/msvbahelper.cxx
+++ b/filter/source/msfilter/msvbahelper.cxx
@@ -42,7 +42,9 @@
 #include 
 #include 
 #include 
-#include 
+#include 
+#include 
+#include 
 
 using namespace ::com::sun::star;
 
@@ -643,64 +645,51 @@ static sal_uInt16 parseChar( sal_Unicode c )
 return nVclKey;
 }
 
-namespace {
+namespace
+{
 
-struct KeyCodeEntry
+constexpr frozen::unordered_map s_KeyCodes
 {
-   const char* sName;
-   sal_uInt16 nCode;
+{ u"BACKSPACE", KEY_BACKSPACE },
+{ u"BS", KEY_BACKSPACE },
+{ u"DELETE", KEY_DELETE },
+{ u"DEL", KEY_DELETE },
+{ u"DOWN", KEY_DOWN },
+{ u"UP", KEY_UP },
+{ u"LEFT", KEY_LEFT },
+{ u"RIGHT", KEY_RIGHT },
+{ u"END", KEY_END },
+{ u"ESCAPE", KEY_ESCAPE },
+{ u"ESC", KEY_ESCAPE },
+{ u"HELP", KEY_HELP },
+{ u"HOME", KEY_HOME },
+{ u"PGDN", KEY_PAGEDOWN },
+{ u"PGUP", KEY_PAGEUP },
+{ u"INSERT", KEY_INSERT },
+{ u"SCROLLLOCK", KEY_SCROLLLOCK },
+{ u"NUMLOCK", KEY_NUMLOCK },
+{ u"TAB", KEY_TAB },
+{ u"F1", KEY_F1 },
+{ u"F2", KEY_F2 },
+{ u"F3", KEY_F3 },
+{ u"F4", KEY_F4 },
+{ u"F5", KEY_F5 },
+{ u"F6", KEY_F6 },
+{ u"F7", KEY_F7 },
+{ u"F8", KEY_F8 },
+{ u"F9", KEY_F9 },
+{ u"F10", KEY_F10 },
+{ u"F11", KEY_F11 },
+{ u"F12", KEY_F12 },
+{ u"F13", KEY_F13 },
+{ u"F14", KEY_F14 },
+{ u"F15", KEY_F15 }
 };
 
-}
-
-KeyCodeEntry const aMSKeyCodesData[] = {
-{ "BACKSPACE", KEY_BACKSPACE },
-{ "BS", KEY_BACKSPACE },
-{ "DELETE", KEY_DELETE },
-{ "DEL", KEY_DELETE },
-{ "DOWN", KEY_DOWN },
-{ "UP", KEY_UP },
-{ "LEFT", KEY_LEFT },
-{ "RIGHT", KEY_RIGHT },
-{ "END", KEY_END },
-{ "ESCAPE", KEY_ESCAPE },
-{ "ESC", KEY_ESCAPE },
-{ "HELP", KEY_HELP },
-{ "HOME", KEY_HOME },
-{ "PGDN", KEY_PAGEDOWN },
-{ "PGUP", KEY_PAGEUP },
-{ "INSERT", KEY_INSERT },
-{ "SCROLLLOCK", KEY_SCROLLLOCK },
-{ "NUMLOCK", KEY_NUMLOCK },
-{ "TAB", KEY_TAB },
-{ "F1", KEY_F1 },
-{ "F2", KEY_F2 },
-{ "F3", KEY_F3 },
-{ "F4", KEY_F4 },
-{ "F5", KEY_F5 },
-{ "F6", KEY_F6 },
-{ "F7", KEY_F7 },
-{ "F8", KEY_F8 },
-{ "F9", KEY_F9 },
-{ "F10", KEY_F10 },
-{ "F11", KEY_F11 },
-{ "F12", KEY_F12 },
-{ "F13", KEY_F13 },
-{ "F14", KEY_F14 },

[Libreoffice-commits] core.git: 2 commits - download.lst external/frozen external/Module_external.mk Makefile.fetch RepositoryExternal.mk svgio/Library_svgio.mk svgio/source

2023-06-17 Thread Tomaž Vajngerl (via logerrit)
 Makefile.fetch |1 
 RepositoryExternal.mk  |   10 
 download.lst   |5 
 external/Module_external.mk|1 
 external/frozen/Module_frozen.mk   |   16 
 external/frozen/README.md  |7 
 external/frozen/UnpackedTarball_frozen.mk  |   18 
 external/frozen/defines_h_constexpr_string.patch.0 |   11 
 svgio/Library_svgio.mk |5 
 svgio/source/svgreader/svgtoken.cxx|  538 -
 10 files changed, 283 insertions(+), 329 deletions(-)

New commits:
commit 215454b5f9327093608aba5fc08ef1c27bf019df
Author: Tomaž Vajngerl 
AuthorDate: Mon Jul 25 15:38:24 2022 +0200
Commit: Tomaž Vajngerl 
CommitDate: Sat Jun 17 12:31:17 2023 +0200

svgio: use "frozen" for mapping between token strings and enums

Change-Id: I2061606146cfcb34169dccf69b6f720727839d04
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153174
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/svgio/Library_svgio.mk b/svgio/Library_svgio.mk
index 6221cb141316..76c0e87123bb 100644
--- a/svgio/Library_svgio.mk
+++ b/svgio/Library_svgio.mk
@@ -25,7 +25,10 @@ $(eval $(call gb_Library_set_include,svgio,\
 -I$(SRCDIR)/svgio/inc \
 ))
 
-$(eval $(call gb_Library_use_external,svgio,boost_headers))
+$(eval $(call gb_Library_use_externals,svgio,\
+boost_headers \
+frozen \
+))
 
 $(eval $(call 
gb_Library_set_precompiled_header,svgio,svgio/inc/pch/precompiled_svgio))
 
diff --git a/svgio/source/svgreader/svgtoken.cxx 
b/svgio/source/svgreader/svgtoken.cxx
index 09ed13459b2e..45af658b1ebd 100644
--- a/svgio/source/svgreader/svgtoken.cxx
+++ b/svgio/source/svgreader/svgtoken.cxx
@@ -18,359 +18,241 @@
  */
 
 #include 
-#include 
+#include 
+#include 
+#include 
 
 namespace svgio::svgreader
 {
-const char aSVGStrWidth[] = "width";
-const char aSVGStrHeight[] = "height";
-const char aSVGStrViewBox[] = "viewBox";
-const char aSVGStrTransform[] = "transform";
-const char aSVGStrStyle[] = "style";
-const char aSVGStrDisplay[] = "display"; // #i121656#
-const char aSVGStrD[] = "d";
-const char aSVGStrX[] = "x";
-const char aSVGStrY[] = "y";
-const char aSVGStrXmlns[] = "xmlns";
-const char aSVGStrVersion[] = "version";
-const char aSVGStrId[] = "id";
-const char aSVGStrIn[] = "in";
-const char aSVGStrRx[] = "rx";
-const char aSVGStrRy[] = "ry";
-const char aSVGStrPoints[] = "points";
-const char aSVGStrDx[] = "dx";
-const char aSVGStrDy[] = "dy";
-const char aSVGStrRotate[] = "rotate";
-const char aSVGStrTextLength[] = "textLength";
-const char aSVGStrLengthAdjust[] = "lengthAdjust";
-const char aSVGStrFont[] = "font";
-const char aSVGStrFontFamily[] = "font-family";
-const char aSVGStrFontSize[] = "font-size";
-const char aSVGStrFontSizeAdjust[] = "font-size-adjust";
-const char aSVGStrFontStretch[] = "font-stretch";
-const char aSVGStrFontStyle[] = "font-style";
-const char aSVGStrFontVariant[] = "font-variant";
-const char aSVGStrFontWeight[] = "font-weight";
-const char aSVGStrDirection[] = "direction";
-const char aSVGStrLetterSpacing[] = "letter-spacing";
-const char aSVGStrTextDecoration[] = "text-decoration";
-const char aSVGStrUnicodeBidi[] = "unicode-bidi";
-const char aSVGStrWordSpacing[] = "word-spacing";
-const char aSVGStrTspan[] = "tspan";
-const char aSVGStrTref[] = "tref";
-const char aSVGStrTextPath[] = "textPath";
-const char aSVGStrStartOffset[] = "startOffset";
-const char aSVGStrMethod[] = "method";
-const char aSVGStrSpacing[] = "spacing";
-const char aSVGStrStdDeviation[] = "stdDeviation";
-const char aSVGStrTextAlign[] = "text-align";
-const char aSVGStrPathLength[] = "pathLength";
-const char aSVGStrType[] = "type";
-const char aSVGStrClass[] = "class";
-const char aSVGStrTextAnchor[] = "text-anchor";
-const char aSVGStrXmlSpace[] = "xml:space";
-const char aSVGStrColor[] = "color";
-const char aSVGStrClipPathNode[] = "clipPath";
-const char aSVGStrClipPathProperty[] = "clip-path";
-const char aSVGStrFeGaussianBlur[] = "feGaussianBlur";
-const char aSVGStrFeColorMatrix[] = "feColorMatrix";
-const char aSVGStrFilter[] = "filter";
-const char aSVGStrMask[] = "mask";
-const char aSVGStrClipPathUnits[] = "clipPathUnits";
-const char aSVGStrMaskUnits[] = "maskUnits";
-const char aSVGStrMaskContentUnits[] = "maskContentUnits";
-const char aSVGStrClipRule[] = "clip-rule";
-const char 

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - oox/source sw/qa sw/source writerfilter/source

2023-06-16 Thread Tomaž Vajngerl (via logerrit)
 oox/source/drawingml/textcharacterproperties.cxx|2 
 oox/source/token/properties.txt |1 
 sw/qa/extras/ooxmlexport/data/Test_CharUnderlineThemeColor.docx |binary
 sw/qa/extras/ooxmlexport/ooxml_ThemeExport.cxx  |   16 +++
 sw/source/filter/ww8/docxattributeoutput.cxx|   10 +-
 writerfilter/source/dmapper/DomainMapper.cxx|   42 
++
 writerfilter/source/dmapper/PropertyIds.cxx |1 
 writerfilter/source/dmapper/PropertyIds.hxx |1 
 8 files changed, 70 insertions(+), 3 deletions(-)

New commits:
commit 100a896db9f9ec29ec7e132a732afde68c4ba88f
Author: Tomaž Vajngerl 
AuthorDate: Sun Jun 11 00:50:08 2023 +0900
Commit: Miklos Vajna 
CommitDate: Fri Jun 16 08:18:05 2023 +0200

ooxml: import and export char underline theme colors

This adds support to import and export char underline theme color
properties.

Change-Id: Ia8948ee5aacd20e0c2b7cbb1b2fdf97fc65c04e0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152834
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 953ef30494661788b2e980ece84b62c653d77321)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152993
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/oox/source/drawingml/textcharacterproperties.cxx 
b/oox/source/drawingml/textcharacterproperties.cxx
index 0e1e2830a67f..1217c19441ae 100644
--- a/oox/source/drawingml/textcharacterproperties.cxx
+++ b/oox/source/drawingml/textcharacterproperties.cxx
@@ -206,6 +206,8 @@ void TextCharacterProperties::pushToPropMap( PropertyMap& 
rPropMap, const XmlFil
 {
 rPropMap.setProperty( PROP_CharUnderlineHasColor, true);
 rPropMap.setProperty( PROP_CharUnderlineColor, 
maUnderlineColor.getColor( rFilter.getGraphicHelper() ));
+model::ComplexColor aComplexColor = maUnderlineColor.getComplexColor();
+rPropMap.setProperty( PROP_CharUnderlineComplexColor, 
model::color::createXComplexColor(aComplexColor));
 }
 else
 {
diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt
index 40988ffb0222..025b0628b9d8 100644
--- a/oox/source/token/properties.txt
+++ b/oox/source/token/properties.txt
@@ -91,6 +91,7 @@ CharStyleName
 CharTransparence
 CharUnderline
 CharUnderlineColor
+CharUnderlineComplexColor
 CharUnderlineHasColor
 CharWeight
 CharWeightAsian
diff --git a/sw/qa/extras/ooxmlexport/data/Test_CharUnderlineThemeColor.docx 
b/sw/qa/extras/ooxmlexport/data/Test_CharUnderlineThemeColor.docx
new file mode 100644
index ..3ee3cdf457f0
Binary files /dev/null and 
b/sw/qa/extras/ooxmlexport/data/Test_CharUnderlineThemeColor.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxml_ThemeExport.cxx 
b/sw/qa/extras/ooxmlexport/ooxml_ThemeExport.cxx
index 3804f4606187..f9e7155859ea 100644
--- a/sw/qa/extras/ooxmlexport/ooxml_ThemeExport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxml_ThemeExport.cxx
@@ -81,6 +81,22 @@ DECLARE_SW_ROUNDTRIP_TEST(testThemePortionBorderColor_DOCX, 
"Test_ThemeBorderCol
 CPPUNIT_ASSERT(isPropertyVoid(xParagraph, "RightBorderComplexColor"));
 }
 
+DECLARE_SW_ROUNDTRIP_TEST(testCharUnderlineTheme_DOCX, 
"Test_CharUnderlineThemeColor.docx", nullptr,
+  Test)
+{
+auto xParagraph = getParagraph(1);
+CPPUNIT_ASSERT(xParagraph.is());
+auto xRun = getRun(xParagraph, 1);
+auto xComplexColor
+= getProperty>(xRun, 
"CharUnderlineComplexColor");
+auto aComplexColor = model::color::getFromXComplexColor(xComplexColor);
+CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent1, 
aComplexColor.getSchemeType());
+auto const& rTransforms = aComplexColor.getTransformations();
+CPPUNIT_ASSERT_EQUAL(size_t(1), rTransforms.size());
+CPPUNIT_ASSERT_EQUAL(model::TransformationType::Shade, 
rTransforms[0].meType);
+CPPUNIT_ASSERT_EQUAL(sal_Int16(2509), rTransforms[0].mnValue);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 3b6bcb26096a..d7cb68aa9fa8 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -7873,10 +7873,14 @@ void DocxAttributeOutput::CharUnderline( const 
SvxUnderlineItem& rUnderline )
 bool  bUnderlineHasColor = !aUnderlineColor.IsTransparent();
 if (bUnderlineHasColor)
 {
+model::ComplexColor const& rComplexColor = 
rUnderline.getComplexColor();
 // Underline has a color
-m_pSerializer->singleElementNS( XML_w, XML_u,
-FSNS( XML_w, XML_val ), 
pUnderlineValue,
-FSNS( XML_w, XML_color ), 
msfilter::util::ConvertColor(aUnderlineColor) );
+rtl::Reference pAttrList 

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - editeng/source include/editeng oox/source sw/qa sw/source writerfilter/source

2023-06-16 Thread Tomaž Vajngerl (via logerrit)
 editeng/source/items/frmitems.cxx|   97 +++-
 include/editeng/boxitem.hxx  |7 
 oox/source/token/properties.txt  |4 
 sw/qa/extras/ooxmlexport/data/Test_ThemeBorderColor.docx |binary
 sw/qa/extras/ooxmlexport/ooxml_ThemeExport.cxx   |   30 ++
 sw/qa/inc/swmodeltestbase.hxx|9 
 sw/source/core/unocore/unomap1.cxx   |   12 -
 sw/source/core/unocore/unomapproperties.hxx  |8 
 sw/source/filter/ww8/docxattributeoutput.cxx |  179 +++
 writerfilter/source/dmapper/BorderHandler.cxx|   34 ++
 writerfilter/source/dmapper/BorderHandler.hxx|8 
 writerfilter/source/dmapper/DomainMapper.cxx |   40 ++-
 writerfilter/source/dmapper/PropertyIds.cxx  |8 
 writerfilter/source/dmapper/PropertyIds.hxx  |   11 
 writerfilter/source/dmapper/TDefTableHandler.cxx |   22 +
 writerfilter/source/dmapper/TDefTableHandler.hxx |   12 -
 16 files changed, 369 insertions(+), 112 deletions(-)

New commits:
commit 7e6cfbb69356957d40775f030633edcf80ae7f1f
Author: Tomaž Vajngerl 
AuthorDate: Sat Jun 10 22:25:43 2023 +0900
Commit: Miklos Vajna 
CommitDate: Fri Jun 16 08:15:52 2023 +0200

ooxml: import and export border theme colors for various props.

This adds support to import and export various border (lines)
theme color properties.

SvxBoxItem needed to be fixed, because it can happen that the
BorderLine is not yet initialised and we already set the border's
ComplexColor. Now there is a maTempComplexColor inside SvxBoxItem,
which stores the ComplexColor until the specific BorderLine is
initialized.

In addition add roundtrip test for import and export cycle.

Change-Id: Idd307a3adaf364745aed8fc8540bf72ef4948198
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152833
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 92fc0ace46398eeb6c9238c8292459cc78db6694)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152992
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/editeng/source/items/frmitems.cxx 
b/editeng/source/items/frmitems.cxx
index 3e132cdc44e9..1477af246698 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -1295,6 +1295,7 @@ SvxBoxItem::SvxBoxItem(const SvxBoxItem& rCopy)
 , mnBottomDistance(rCopy.mnBottomDistance)
 , mnLeftDistance(rCopy.mnLeftDistance)
 , mnRightDistance(rCopy.mnRightDistance)
+, maTempComplexColors(rCopy.maTempComplexColors)
 , mbRemoveAdjCellBorder(rCopy.mbRemoveAdjCellBorder)
 {
 }
@@ -1363,6 +1364,7 @@ bool SvxBoxItem::operator==( const SfxPoolItem& rAttr ) 
const
 (mnLeftDistance == rBoxItem.mnLeftDistance) &&
 (mnRightDistance == rBoxItem.mnRightDistance) &&
 (mbRemoveAdjCellBorder == rBoxItem.mbRemoveAdjCellBorder ) &&
+(maTempComplexColors == rBoxItem.maTempComplexColors) &&
 CompareBorderLine(mpTopBorderLine, rBoxItem.GetTop()) &&
 CompareBorderLine(mpBottomBorderLine, rBoxItem.GetBottom()) &&
 CompareBorderLine(mpLeftBorderLine, rBoxItem.GetLeft()) &&
@@ -1456,8 +1458,11 @@ bool SvxBoxItem::QueryValue( uno::Any& rVal, sal_uInt8 
nMemberId ) const
 {
 if (mpBottomBorderLine)
 {
-auto xComplexColor = 
model::color::createXComplexColor(mpBottomBorderLine->getComplexColor());
-rVal <<= xComplexColor;
+rVal <<= 
model::color::createXComplexColor(mpBottomBorderLine->getComplexColor());
+}
+else if 
(maTempComplexColors[size_t(SvxBoxItemLine::BOTTOM)].getType() != 
model::ColorType::Unused)
+{
+rVal <<= 
model::color::createXComplexColor(maTempComplexColors[size_t(SvxBoxItemLine::BOTTOM)]);
 }
 return true;
 }
@@ -1465,8 +1470,11 @@ bool SvxBoxItem::QueryValue( uno::Any& rVal, sal_uInt8 
nMemberId ) const
 {
 if (mpLeftBorderLine)
 {
-auto xComplexColor = 
model::color::createXComplexColor(mpLeftBorderLine->getComplexColor());
-rVal <<= xComplexColor;
+rVal <<= 
model::color::createXComplexColor(mpLeftBorderLine->getComplexColor());
+}
+else if 
(maTempComplexColors[size_t(SvxBoxItemLine::LEFT)].getType() != 
model::ColorType::Unused)
+{
+rVal <<= 
model::color::createXComplexColor(maTempComplexColors[size_t(SvxBoxItemLine::LEFT)]);
 }
 return true;
 }
@@ -1474,8 +1482,11 @@ bool SvxBoxItem::QueryValue( uno::Any& rVal, sal_uInt8 
nMemberId ) const
 {
 if (mpRightBorderLine)
 {
-auto xComplexColor = 

[Libreoffice-commits] core.git: Branch 'private/tvajngerl/staging' - oox/Library_oox.mk oox/source writerfilter/Library_writerfilter.mk writerfilter/source xmloff/Library_xo.mk xmloff/source

2023-06-15 Thread Tomaž Vajngerl (via logerrit)
Rebased ref, commits from common ancestor:
commit 31699dc711942bde9d1fb9b64aa9c87217967f81
Author: Tomaž Vajngerl 
AuthorDate: Wed Jun 14 11:48:51 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Thu Jun 15 20:12:15 2023 +0900

oox, writerfilter, xmloff: use frozen unordered_map for static data

Change-Id: I4a53fa57f52900104d249c84cde36c9d3b9e1300

diff --git a/oox/Library_oox.mk b/oox/Library_oox.mk
index b878089027b1..3bf2d607918c 100644
--- a/oox/Library_oox.mk
+++ b/oox/Library_oox.mk
@@ -65,6 +65,7 @@ $(eval $(call gb_Library_use_libraries,oox,\
 
 $(eval $(call gb_Library_use_externals,oox,\
boost_headers \
+   frozen \
 ))
 
 ifeq ($(TLS),OPENSSL)
diff --git a/oox/source/drawingml/color.cxx b/oox/source/drawingml/color.cxx
index ad0b5ca7835e..6660c6bd2660 100644
--- a/oox/source/drawingml/color.cxx
+++ b/oox/source/drawingml/color.cxx
@@ -19,7 +19,9 @@
 
 #include 
 #include 
-#include 
+#include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -214,39 +216,40 @@ void lclOffValue( sal_Int32& ornValue, sal_Int32 nOff, 
sal_Int32 nMax = MAX_PERC
 ornValue = getLimitedValue< sal_Int32, sal_Int32 >( ornValue + nOff, 0, 
nMax );
 }
 
+static constexpr frozen::unordered_map aSchemeColorNameToIndex
+{
+{ u"dk1", model::ThemeColorType::Dark1 },
+{ u"lt1", model::ThemeColorType::Light1 },
+{ u"dk2", model::ThemeColorType::Dark2 },
+{ u"lt2", model::ThemeColorType::Light2 },
+{ u"accent1", model::ThemeColorType::Accent1 },
+{ u"accent2", model::ThemeColorType::Accent2 },
+{ u"accent3", model::ThemeColorType::Accent3 },
+{ u"accent4", model::ThemeColorType::Accent4 },
+{ u"accent5", model::ThemeColorType::Accent5 },
+{ u"accent6", model::ThemeColorType::Accent6 },
+{ u"hlink", model::ThemeColorType::Hyperlink },
+{ u"folHlink", model::ThemeColorType::FollowedHyperlink },
+{ u"tx1", model::ThemeColorType::Dark1 },
+{ u"bg1", model::ThemeColorType::Light1 },
+{ u"tx2", model::ThemeColorType::Dark2 },
+{ u"bg2", model::ThemeColorType::Light2 },
+{ u"dark1", model::ThemeColorType::Dark1},
+{ u"light1", model::ThemeColorType::Light1},
+{ u"dark2", model::ThemeColorType::Dark2 },
+{ u"light2", model::ThemeColorType::Light2 },
+{ u"text1", model::ThemeColorType::Dark1 },
+{ u"background1", model::ThemeColorType::Light1 },
+{ u"text2", model::ThemeColorType::Dark2 },
+{ u"background2", model::ThemeColorType::Light2 },
+{ u"hyperlink", model::ThemeColorType::Hyperlink },
+{ u"followedHyperlink", model::ThemeColorType::FollowedHyperlink }
+};
+
 } // namespace
 
 model::ThemeColorType schemeNameToThemeColorType(OUString const& rSchemeName)
 {
-static std::unordered_map const 
aSchemeColorNameToIndex{
-{ u"dk1", model::ThemeColorType::Dark1 },
-{ u"lt1", model::ThemeColorType::Light1 },
-{ u"dk2", model::ThemeColorType::Dark2 },
-{ u"lt2", model::ThemeColorType::Light2 },
-{ u"accent1", model::ThemeColorType::Accent1 },
-{ u"accent2", model::ThemeColorType::Accent2 },
-{ u"accent3", model::ThemeColorType::Accent3 },
-{ u"accent4", model::ThemeColorType::Accent4 },
-{ u"accent5", model::ThemeColorType::Accent5 },
-{ u"accent6", model::ThemeColorType::Accent6 },
-{ u"hlink", model::ThemeColorType::Hyperlink },
-{ u"folHlink", model::ThemeColorType::FollowedHyperlink },
-{ u"tx1", model::ThemeColorType::Dark1 },
-{ u"bg1", model::ThemeColorType::Light1 },
-{ u"tx2", model::ThemeColorType::Dark2 },
-{ u"bg2", model::ThemeColorType::Light2 },
-{ u"dark1", model::ThemeColorType::Dark1},
-{ u"light1", model::ThemeColorType::Light1},
-{ u"dark2", model::ThemeColorType::Dark2 },
-{ u"light2", model::ThemeColorType::Light2 },
-{ u"text1", model::ThemeColorType::Dark1 },
-{ u"background1", model::ThemeColorType::Light1 },
-{ u"text2", model::ThemeColorType::Dark2 },
-{ u"background2", model::ThemeColorType::Light2 },
-{ u"hyperlink", model::ThemeColorType::Hyperlink },
-{ u"followedHyperlink", model::ThemeColorType::FollowedHyperlink}
-};
-
 auto aIterator = aSchemeColorNameToIndex.find(rSchemeName);
 if (aIterator == aSchemeColorNameToIndex.end())
 return model::ThemeColorType::Unknown;
diff --git a/oox/source/drawingml/colorchoicecontext.cxx 
b/oox/source/drawingml/colorchoicecontext.cxx
index b0977c5e003c..04b9f996d8d5 100644
--- a/oox/source/drawingml/colorchoicecontext.cxx
+++ b/oox/source/drawingml/colorchoicecontext.cxx
@@ -24,13 +24,16 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
 
 namespace oox::drawingml {
 
 namespace
 {
 
-const std::unordered_map 
constSystemColorMap =
+static constexpr frozen::unordered_map 
constSystemColorMap
 {
 { XML_scrollBar, model::SystemColorType::ScrollBar },
 { XML_background, 

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - 2 commits - include/oox oox/source writerfilter/source

2023-06-14 Thread Tomaž Vajngerl (via logerrit)
 include/oox/drawingml/color.hxx  |3 ++
 oox/source/drawingml/color.cxx   |   24 +++
 oox/source/drawingml/fillproperties.cxx  |   16 +--
 oox/source/drawingml/textcharacterproperties.cxx |   15 --
 writerfilter/source/ooxml/model.xml  |   12 +--
 5 files changed, 36 insertions(+), 34 deletions(-)

New commits:
commit 92a7222b04f18644f6a58d1503ab0d29ca8b057c
Author: Tomaž Vajngerl 
AuthorDate: Sat Jun 10 22:22:17 2023 +0900
Commit: Miklos Vajna 
CommitDate: Wed Jun 14 08:34:17 2023 +0200

oox: fix theme data in model.xml to use a correct types

Change-Id: Ifaa725d8a3e6c4cfefc92a6c5fcdb581610d3ce6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152832
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 3a6d360b5e585b8e92cc0d58d5fbc497448e11fb)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152990
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/writerfilter/source/ooxml/model.xml 
b/writerfilter/source/ooxml/model.xml
index 8082c433e89b..89a1d9f91425 100644
--- a/writerfilter/source/ooxml/model.xml
+++ b/writerfilter/source/ooxml/model.xml
@@ -10997,13 +10997,13 @@
   
 
 
-  
+  
 
 
-  
+  
 
 
-  
+  
 
   
   
@@ -12591,13 +12591,13 @@
   
 
 
-  
+  
 
 
-  
+  
 
 
-  
+  
 
 
   
commit b9aa62a714370b63ff93f55f1e599e4cad4c7eef
Author: Tomaž Vajngerl 
AuthorDate: Fri Jun 9 23:34:24 2023 +0900
Commit: Miklos Vajna 
CommitDate: Wed Jun 14 08:34:08 2023 +0200

oox: remove code duplication and add getComplexColor to oox::Color

Change-Id: I9cfbc851d4f303a5a8c92183f01cb5b6545b7984
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152800
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit c1470e15bd0643be8d91aaf6a0d25c78867d0b3e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152969
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/include/oox/drawingml/color.hxx b/include/oox/drawingml/color.hxx
index 75812c200c28..245e655d7c78 100644
--- a/include/oox/drawingml/color.hxx
+++ b/include/oox/drawingml/color.hxx
@@ -30,6 +30,7 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace oox { class GraphicHelper; }
 
@@ -117,6 +118,8 @@ public:
 /// Compares this color with rOther.
 bool equals(const Color& rOther, const GraphicHelper& rGraphicHelper, 
::Color nPhClr) const;
 
+model::ComplexColor getComplexColor() const;
+
 private:
 /** Internal helper for getColor(). */
 voidsetResolvedRgb( ::Color nRgb ) const;
diff --git a/oox/source/drawingml/color.cxx b/oox/source/drawingml/color.cxx
index 592d0734efc2..e9c645b99b7c 100644
--- a/oox/source/drawingml/color.cxx
+++ b/oox/source/drawingml/color.cxx
@@ -567,6 +567,30 @@ sal_Int16 Color::getLumOff() const
 return 0;
 }
 
+model::ComplexColor Color::getComplexColor() const
+{
+model::ComplexColor aComplexColor;
+
aComplexColor.setSchemeColor(model::convertToThemeColorType(getSchemeColorIndex()));
+
+if (getTintOrShade() > 0)
+{
+aComplexColor.addTransformation({model::TransformationType::Tint, 
getTintOrShade()});
+}
+else if (getTintOrShade() < 0)
+{
+sal_Int16 nShade = o3tl::narrowing(-getTintOrShade());
+aComplexColor.addTransformation({model::TransformationType::Shade, 
nShade});
+}
+
+if (getLumMod() != 1)
+aComplexColor.addTransformation({model::TransformationType::LumMod, 
getLumMod()});
+
+if (getLumOff() != 0)
+aComplexColor.addTransformation({model::TransformationType::LumOff, 
getLumOff()});
+
+return aComplexColor;
+}
+
 ::Color Color::getColor( const GraphicHelper& rGraphicHelper, ::Color nPhClr ) 
const
 {
 const sal_Int32 nTempC1 = mnC1;
diff --git a/oox/source/drawingml/fillproperties.cxx 
b/oox/source/drawingml/fillproperties.cxx
index fe00d12cf078..0a2e53928076 100644
--- a/oox/source/drawingml/fillproperties.cxx
+++ b/oox/source/drawingml/fillproperties.cxx
@@ -430,24 +430,12 @@ void FillProperties::pushToPropMap( ShapePropertyMap& 
rPropMap,
 if (aFillColor == nPhClr)
 {
 
aComplexColor.setSchemeColor(model::convertToThemeColorType(nPhClrTheme));
-rPropMap.setProperty(PROP_FillComplexColor, 
model::color::createXComplexColor(aComplexColor));
 }
 else
 {
-
aComplexColor.setSchemeColor(model::convertToThemeColorType(maFillColor.getSchemeColorIndex()));
-if (maFillColor.getLumMod() != 1)
- 

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - docmodel/source editeng/source svx/source

2023-06-14 Thread Tomaž Vajngerl (via logerrit)
 docmodel/source/color/ComplexColorJSON.cxx|   52 +-
 editeng/source/items/textitem.cxx |9 ++--
 svx/source/theme/ThemeColorPaletteManager.cxx |2 -
 3 files changed, 33 insertions(+), 30 deletions(-)

New commits:
commit 81ae86d5f9e6d06300a2d6cf160de004c881ade5
Author: Tomaž Vajngerl 
AuthorDate: Fri Jun 9 16:06:37 2023 +0900
Commit: Miklos Vajna 
CommitDate: Wed Jun 14 08:33:12 2023 +0200

fix wrong transform type, error handling when JSON parsing

Change-Id: Id5435d59cd51352efc4a4a8e333ec1ff45847a6f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152781
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/docmodel/source/color/ComplexColorJSON.cxx 
b/docmodel/source/color/ComplexColorJSON.cxx
index 409ecd27277b..f4d6fdf0af1b 100644
--- a/docmodel/source/color/ComplexColorJSON.cxx
+++ b/docmodel/source/color/ComplexColorJSON.cxx
@@ -18,40 +18,42 @@ namespace model::color
 bool convertFromJSON(OString const& rJsonString, model::ComplexColor& 
rComplexColor)
 {
 model::ComplexColor aComplexColor;
-std::stringstream aStream((std::string(rJsonString)));
-boost::property_tree::ptree aRootTree;
+
 try
 {
+std::stringstream aStream((std::string(rJsonString)));
+boost::property_tree::ptree aRootTree;
 boost::property_tree::read_json(aStream, aRootTree);
+
+sal_Int32 nThemeType = aRootTree.get("ThemeIndex", -1);
+
aComplexColor.setSchemeColor(model::convertToThemeColorType(nThemeType));
+boost::property_tree::ptree aTransformTree = 
aRootTree.get_child("Transformations");
+for (const auto& rEachTransformationNode :
+ boost::make_iterator_range(aTransformTree.equal_range("")))
+{
+auto const& rTransformationTree = rEachTransformationNode.second;
+std::string sType = rTransformationTree.get("Type", 
"");
+sal_Int16 nValue = rTransformationTree.get("Value", 0);
+
+auto eType = model::TransformationType::Undefined;
+if (sType == "LumOff")
+eType = model::TransformationType::LumOff;
+else if (sType == "LumMod")
+eType = model::TransformationType::LumMod;
+else if (sType == "Tint")
+eType = model::TransformationType::Tint;
+else if (sType == "Shade")
+eType = model::TransformationType::Shade;
+
+if (eType != model::TransformationType::Undefined)
+aComplexColor.addTransformation({ eType, nValue });
+}
 }
 catch (const boost::property_tree::json_parser_error& /*exception*/)
 {
 return false;
 }
 
-sal_Int32 nThemeType = aRootTree.get("ThemeIndex", -1);
-aComplexColor.setSchemeColor(model::convertToThemeColorType(nThemeType));
-boost::property_tree::ptree aTransformTree = 
aRootTree.get_child("Transformations");
-for (const auto& rEachTransformationNode :
- boost::make_iterator_range(aTransformTree.equal_range("")))
-{
-auto const& rTransformationTree = rEachTransformationNode.second;
-std::string sType = rTransformationTree.get("Type", "");
-sal_Int16 nValue = rTransformationTree.get("Value", 0);
-
-auto eType = model::TransformationType::Undefined;
-if (sType == "LumOff")
-eType = model::TransformationType::LumOff;
-else if (sType == "LumMod")
-eType = model::TransformationType::LumMod;
-else if (sType == "Tint")
-eType = model::TransformationType::Tint;
-else if (sType == "Shade")
-eType = model::TransformationType::Shade;
-
-if (eType != model::TransformationType::Undefined)
-aComplexColor.addTransformation({ eType, nValue });
-}
 rComplexColor = aComplexColor;
 return true;
 }
diff --git a/editeng/source/items/textitem.cxx 
b/editeng/source/items/textitem.cxx
index 3e7cc6c6a736..f4194da865a6 100644
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -1555,11 +1555,11 @@ bool SvxColorItem::PutValue( const uno::Any& rVal, 
sal_uInt8 nMemberId )
 return false;
 
 if (sComplexColorJson.isEmpty())
-{
 return false;
-}
+
 OString aJSON = OUStringToOString(sComplexColorJson, 
RTL_TEXTENCODING_ASCII_US);
-model::color::convertFromJSON(aJSON, maComplexColor);
+if (!model::color::convertFromJSON(aJSON, maComplexColor))
+return false;
 }
 break;
 case MID_COMPLEX_COLOR:
@@ -1575,7 +1575,8 @@ bool SvxColorItem::PutValue( const uno::Any& rVal, 
sal_uInt8 nMemberId )
 case MID_COLOR_RGB:
 default:
 {
-return rVal >>= mColor;
+if (!(rVal >>= mColor))
+return false;
 }
 break;
 }
diff --git 

[Libreoffice-commits] core.git: Branch 'private/tvajngerl/staging' - 2 commits - oox/Library_oox.mk oox/source svgio/Library_svgio.mk svgio/source

2023-06-13 Thread Tomaž Vajngerl (via logerrit)
Rebased ref, commits from common ancestor:
commit 80773825cc2af1aa9862e7503e20110a850fdd8d
Author: Tomaž Vajngerl 
AuthorDate: Wed Jun 14 11:48:51 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Wed Jun 14 11:48:51 2023 +0900

oox: use frozen unordered_map for static data

Change-Id: I4a53fa57f52900104d249c84cde36c9d3b9e1300

diff --git a/oox/Library_oox.mk b/oox/Library_oox.mk
index b878089027b1..3bf2d607918c 100644
--- a/oox/Library_oox.mk
+++ b/oox/Library_oox.mk
@@ -65,6 +65,7 @@ $(eval $(call gb_Library_use_libraries,oox,\
 
 $(eval $(call gb_Library_use_externals,oox,\
boost_headers \
+   frozen \
 ))
 
 ifeq ($(TLS),OPENSSL)
diff --git a/oox/source/drawingml/color.cxx b/oox/source/drawingml/color.cxx
index ad0b5ca7835e..6660c6bd2660 100644
--- a/oox/source/drawingml/color.cxx
+++ b/oox/source/drawingml/color.cxx
@@ -19,7 +19,9 @@
 
 #include 
 #include 
-#include 
+#include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -214,39 +216,40 @@ void lclOffValue( sal_Int32& ornValue, sal_Int32 nOff, 
sal_Int32 nMax = MAX_PERC
 ornValue = getLimitedValue< sal_Int32, sal_Int32 >( ornValue + nOff, 0, 
nMax );
 }
 
+static constexpr frozen::unordered_map aSchemeColorNameToIndex
+{
+{ u"dk1", model::ThemeColorType::Dark1 },
+{ u"lt1", model::ThemeColorType::Light1 },
+{ u"dk2", model::ThemeColorType::Dark2 },
+{ u"lt2", model::ThemeColorType::Light2 },
+{ u"accent1", model::ThemeColorType::Accent1 },
+{ u"accent2", model::ThemeColorType::Accent2 },
+{ u"accent3", model::ThemeColorType::Accent3 },
+{ u"accent4", model::ThemeColorType::Accent4 },
+{ u"accent5", model::ThemeColorType::Accent5 },
+{ u"accent6", model::ThemeColorType::Accent6 },
+{ u"hlink", model::ThemeColorType::Hyperlink },
+{ u"folHlink", model::ThemeColorType::FollowedHyperlink },
+{ u"tx1", model::ThemeColorType::Dark1 },
+{ u"bg1", model::ThemeColorType::Light1 },
+{ u"tx2", model::ThemeColorType::Dark2 },
+{ u"bg2", model::ThemeColorType::Light2 },
+{ u"dark1", model::ThemeColorType::Dark1},
+{ u"light1", model::ThemeColorType::Light1},
+{ u"dark2", model::ThemeColorType::Dark2 },
+{ u"light2", model::ThemeColorType::Light2 },
+{ u"text1", model::ThemeColorType::Dark1 },
+{ u"background1", model::ThemeColorType::Light1 },
+{ u"text2", model::ThemeColorType::Dark2 },
+{ u"background2", model::ThemeColorType::Light2 },
+{ u"hyperlink", model::ThemeColorType::Hyperlink },
+{ u"followedHyperlink", model::ThemeColorType::FollowedHyperlink }
+};
+
 } // namespace
 
 model::ThemeColorType schemeNameToThemeColorType(OUString const& rSchemeName)
 {
-static std::unordered_map const 
aSchemeColorNameToIndex{
-{ u"dk1", model::ThemeColorType::Dark1 },
-{ u"lt1", model::ThemeColorType::Light1 },
-{ u"dk2", model::ThemeColorType::Dark2 },
-{ u"lt2", model::ThemeColorType::Light2 },
-{ u"accent1", model::ThemeColorType::Accent1 },
-{ u"accent2", model::ThemeColorType::Accent2 },
-{ u"accent3", model::ThemeColorType::Accent3 },
-{ u"accent4", model::ThemeColorType::Accent4 },
-{ u"accent5", model::ThemeColorType::Accent5 },
-{ u"accent6", model::ThemeColorType::Accent6 },
-{ u"hlink", model::ThemeColorType::Hyperlink },
-{ u"folHlink", model::ThemeColorType::FollowedHyperlink },
-{ u"tx1", model::ThemeColorType::Dark1 },
-{ u"bg1", model::ThemeColorType::Light1 },
-{ u"tx2", model::ThemeColorType::Dark2 },
-{ u"bg2", model::ThemeColorType::Light2 },
-{ u"dark1", model::ThemeColorType::Dark1},
-{ u"light1", model::ThemeColorType::Light1},
-{ u"dark2", model::ThemeColorType::Dark2 },
-{ u"light2", model::ThemeColorType::Light2 },
-{ u"text1", model::ThemeColorType::Dark1 },
-{ u"background1", model::ThemeColorType::Light1 },
-{ u"text2", model::ThemeColorType::Dark2 },
-{ u"background2", model::ThemeColorType::Light2 },
-{ u"hyperlink", model::ThemeColorType::Hyperlink },
-{ u"followedHyperlink", model::ThemeColorType::FollowedHyperlink}
-};
-
 auto aIterator = aSchemeColorNameToIndex.find(rSchemeName);
 if (aIterator == aSchemeColorNameToIndex.end())
 return model::ThemeColorType::Unknown;
diff --git a/oox/source/drawingml/colorchoicecontext.cxx 
b/oox/source/drawingml/colorchoicecontext.cxx
index b0977c5e003c..04b9f996d8d5 100644
--- a/oox/source/drawingml/colorchoicecontext.cxx
+++ b/oox/source/drawingml/colorchoicecontext.cxx
@@ -24,13 +24,16 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
 
 namespace oox::drawingml {
 
 namespace
 {
 
-const std::unordered_map 
constSystemColorMap =
+static constexpr frozen::unordered_map 
constSystemColorMap
 {
 { XML_scrollBar, model::SystemColorType::ScrollBar },
 { XML_background, 

[Libreoffice-commits] core.git: Branch 'private/tvajngerl/staging' - 13 commits - basctl/source basegfx/CppunitTest_basegfx.mk basegfx/test chart2/source cui/source download.lst editeng/source externa

2023-06-13 Thread Tomaž Vajngerl (via logerrit)
Rebased ref, commits from common ancestor:
commit a765a9b52fdcbb2592e8ca121b93895a59ee120d
Author: Tomaž Vajngerl 
AuthorDate: Mon Jul 25 15:38:24 2022 +0200
Commit: Tomaž Vajngerl 
CommitDate: Wed Jun 14 01:23:58 2023 +0900

svgio: use "frozen" for mapping between token strings and enums

Change-Id: I2061606146cfcb34169dccf69b6f720727839d04

diff --git a/svgio/Library_svgio.mk b/svgio/Library_svgio.mk
index 6221cb141316..76c0e87123bb 100644
--- a/svgio/Library_svgio.mk
+++ b/svgio/Library_svgio.mk
@@ -25,7 +25,10 @@ $(eval $(call gb_Library_set_include,svgio,\
 -I$(SRCDIR)/svgio/inc \
 ))
 
-$(eval $(call gb_Library_use_external,svgio,boost_headers))
+$(eval $(call gb_Library_use_externals,svgio,\
+boost_headers \
+frozen \
+))
 
 $(eval $(call 
gb_Library_set_precompiled_header,svgio,svgio/inc/pch/precompiled_svgio))
 
diff --git a/svgio/source/svgreader/svgtoken.cxx 
b/svgio/source/svgreader/svgtoken.cxx
index 8228689606bf..e283b6e344bb 100644
--- a/svgio/source/svgreader/svgtoken.cxx
+++ b/svgio/source/svgreader/svgtoken.cxx
@@ -18,357 +18,369 @@
  */
 
 #include 
-#include 
+#include 
+#include 
+#include 
+#include 
 
 namespace svgio::svgreader
 {
-const char aSVGStrWidth[] = "width";
-const char aSVGStrHeight[] = "height";
-const char aSVGStrViewBox[] = "viewBox";
-const char aSVGStrTransform[] = "transform";
-const char aSVGStrStyle[] = "style";
-const char aSVGStrDisplay[] = "display"; // #i121656#
-const char aSVGStrD[] = "d";
-const char aSVGStrX[] = "x";
-const char aSVGStrY[] = "y";
-const char aSVGStrXmlns[] = "xmlns";
-const char aSVGStrVersion[] = "version";
-const char aSVGStrId[] = "id";
-const char aSVGStrIn[] = "in";
-const char aSVGStrRx[] = "rx";
-const char aSVGStrRy[] = "ry";
-const char aSVGStrPoints[] = "points";
-const char aSVGStrDx[] = "dx";
-const char aSVGStrDy[] = "dy";
-const char aSVGStrRotate[] = "rotate";
-const char aSVGStrTextLength[] = "textLength";
-const char aSVGStrLengthAdjust[] = "lengthAdjust";
-const char aSVGStrFont[] = "font";
-const char aSVGStrFontFamily[] = "font-family";
-const char aSVGStrFontSize[] = "font-size";
-const char aSVGStrFontSizeAdjust[] = "font-size-adjust";
-const char aSVGStrFontStretch[] = "font-stretch";
-const char aSVGStrFontStyle[] = "font-style";
-const char aSVGStrFontVariant[] = "font-variant";
-const char aSVGStrFontWeight[] = "font-weight";
-const char aSVGStrDirection[] = "direction";
-const char aSVGStrLetterSpacing[] = "letter-spacing";
-const char aSVGStrTextDecoration[] = "text-decoration";
-const char aSVGStrUnicodeBidi[] = "unicode-bidi";
-const char aSVGStrWordSpacing[] = "word-spacing";
-const char aSVGStrTspan[] = "tspan";
-const char aSVGStrTref[] = "tref";
-const char aSVGStrTextPath[] = "textPath";
-const char aSVGStrStartOffset[] = "startOffset";
-const char aSVGStrMethod[] = "method";
-const char aSVGStrSpacing[] = "spacing";
-const char aSVGStrStdDeviation[] = "stdDeviation";
-const char aSVGStrTextAlign[] = "text-align";
-const char aSVGStrPathLength[] = "pathLength";
-const char aSVGStrType[] = "type";
-const char aSVGStrClass[] = "class";
-const char aSVGStrTextAnchor[] = "text-anchor";
-const char aSVGStrXmlSpace[] = "xml:space";
-const char aSVGStrColor[] = "color";
-const char aSVGStrClipPathNode[] = "clipPath";
-const char aSVGStrClipPathProperty[] = "clip-path";
-const char aSVGStrFeGaussianBlur[] = "feGaussianBlur";
-const char aSVGStrFeColorMatrix[] = "feColorMatrix";
-const char aSVGStrFilter[] = "filter";
-const char aSVGStrMask[] = "mask";
-const char aSVGStrClipPathUnits[] = "clipPathUnits";
-const char aSVGStrMaskUnits[] = "maskUnits";
-const char aSVGStrMaskContentUnits[] = "maskContentUnits";
-const char aSVGStrClipRule[] = "clip-rule";
-const char aSVGStrMarker[] = "marker";
-const char aSVGStrMarkerStart[] = "marker-start";
-const char aSVGStrMarkerMid[] = "marker-mid";
-const char aSVGStrMarkerEnd[] = "marker-end";
-const char aSVGStrRefX[] = "refX";
-const char aSVGStrRefY[] = "refY";
-const char aSVGStrMarkerUnits[] = "markerUnits";
-const char aSVGStrMarkerWidth[] = "markerWidth";
-const char aSVGStrMarkerHeight[] = "markerHeight";
-const char aSVGStrOrient[] = "orient";
-const char aSVGStrPattern[] = "pattern";
-const char aSVGStrPatternUnits[] = "patternUnits";
-const char aSVGStrPatternContentUnits[] = "patternContentUnits";
-const char aSVGStrPatternTransform[] = "patternTransform";
-  

[Libreoffice-commits] core.git: Branch 'private/tvajngerl/staging' - sd/source

2023-06-13 Thread Tomaž Vajngerl (via logerrit)
 sd/source/filter/grf/sdgrffilter.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 48b3ed91b34d2a6667cf2c0a2dab9afeeacb9e05
Author: Tomaž Vajngerl 
AuthorDate: Wed Jun 14 01:20:05 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Wed Jun 14 01:20:05 2023 +0900

fix: issue with pGraphic

Change-Id: I1b6a92ed8e1d29b5f6bb48a596138060809b37c8

diff --git a/sd/source/filter/grf/sdgrffilter.cxx 
b/sd/source/filter/grf/sdgrffilter.cxx
index cd621d4bddc6..dff4c8026eba 100644
--- a/sd/source/filter/grf/sdgrffilter.cxx
+++ b/sd/source/filter/grf/sdgrffilter.cxx
@@ -187,7 +187,7 @@ void SdGRFFilter::InsertSdrGrafObj(Graphic aGraphic, 
SdPage* pPage)
 {
 Point aPos;
 Size aPagSize(pPage->getSize().toToolsSize());
-Size aGrfSize(OutputDevice::LogicToLogic(aGraphic.GetPrefSize(), 
pGraphic.GetPrefMapMode(),
+Size aGrfSize(OutputDevice::LogicToLogic(aGraphic.GetPrefSize(), 
aGraphic.GetPrefMapMode(),
  MapMode(MapUnit::Map100thMM)));
 
 aPagSize.AdjustWidth(-basegfx::fround((pPage->getBorder().getLeft() + 
pPage->getBorder().getRight()).as(pPage->getUnit(;
@@ -217,7 +217,7 @@ void SdGRFFilter::InsertSdrGrafObj(Graphic aGraphic, 
SdPage* pPage)
 aPos.setX(((aPagSize.Width() - aGrfSize.Width()) / 2.0) + 
pPage->getBorder().leftUnit());
 aPos.setY(((aPagSize.Height() - aGrfSize.Height()) / 2.0) + 
pPage->getBorder().upperUnit());
 
-pPage->InsertObject(new SdrGrafObj(pPage->getSdrModelFromSdrPage(), 
+pPage->InsertObject(new SdrGrafObj(pPage->getSdrModelFromSdrPage(),
 aGraphic, ::tools::Rectangle(aPos, aGrfSize)));
 }
 


[Libreoffice-commits] core.git: Branch 'private/tvajngerl/staging' - 12 commits - basctl/source basegfx/CppunitTest_basegfx.mk basegfx/test chart2/source cui/source editeng/source filter/source includ

2023-06-13 Thread Tomaž Vajngerl (via logerrit)
Rebased ref, commits from common ancestor:
commit 11c082b8d9a90d9dc63a053836cac493c743883c
Author: Tomaž Vajngerl 
AuthorDate: Mon Jul 25 15:38:24 2022 +0200
Commit: Tomaž Vajngerl 
CommitDate: Tue Jun 13 22:20:23 2023 +0900

svgio: use "frozen" for mapping between token strings and enums

Change-Id: I2061606146cfcb34169dccf69b6f720727839d04

diff --git a/svgio/Library_svgio.mk b/svgio/Library_svgio.mk
index 6221cb141316..76c0e87123bb 100644
--- a/svgio/Library_svgio.mk
+++ b/svgio/Library_svgio.mk
@@ -25,7 +25,10 @@ $(eval $(call gb_Library_set_include,svgio,\
 -I$(SRCDIR)/svgio/inc \
 ))
 
-$(eval $(call gb_Library_use_external,svgio,boost_headers))
+$(eval $(call gb_Library_use_externals,svgio,\
+boost_headers \
+frozen \
+))
 
 $(eval $(call 
gb_Library_set_precompiled_header,svgio,svgio/inc/pch/precompiled_svgio))
 
diff --git a/svgio/source/svgreader/svgtoken.cxx 
b/svgio/source/svgreader/svgtoken.cxx
index 8228689606bf..e283b6e344bb 100644
--- a/svgio/source/svgreader/svgtoken.cxx
+++ b/svgio/source/svgreader/svgtoken.cxx
@@ -18,357 +18,369 @@
  */
 
 #include 
-#include 
+#include 
+#include 
+#include 
+#include 
 
 namespace svgio::svgreader
 {
-const char aSVGStrWidth[] = "width";
-const char aSVGStrHeight[] = "height";
-const char aSVGStrViewBox[] = "viewBox";
-const char aSVGStrTransform[] = "transform";
-const char aSVGStrStyle[] = "style";
-const char aSVGStrDisplay[] = "display"; // #i121656#
-const char aSVGStrD[] = "d";
-const char aSVGStrX[] = "x";
-const char aSVGStrY[] = "y";
-const char aSVGStrXmlns[] = "xmlns";
-const char aSVGStrVersion[] = "version";
-const char aSVGStrId[] = "id";
-const char aSVGStrIn[] = "in";
-const char aSVGStrRx[] = "rx";
-const char aSVGStrRy[] = "ry";
-const char aSVGStrPoints[] = "points";
-const char aSVGStrDx[] = "dx";
-const char aSVGStrDy[] = "dy";
-const char aSVGStrRotate[] = "rotate";
-const char aSVGStrTextLength[] = "textLength";
-const char aSVGStrLengthAdjust[] = "lengthAdjust";
-const char aSVGStrFont[] = "font";
-const char aSVGStrFontFamily[] = "font-family";
-const char aSVGStrFontSize[] = "font-size";
-const char aSVGStrFontSizeAdjust[] = "font-size-adjust";
-const char aSVGStrFontStretch[] = "font-stretch";
-const char aSVGStrFontStyle[] = "font-style";
-const char aSVGStrFontVariant[] = "font-variant";
-const char aSVGStrFontWeight[] = "font-weight";
-const char aSVGStrDirection[] = "direction";
-const char aSVGStrLetterSpacing[] = "letter-spacing";
-const char aSVGStrTextDecoration[] = "text-decoration";
-const char aSVGStrUnicodeBidi[] = "unicode-bidi";
-const char aSVGStrWordSpacing[] = "word-spacing";
-const char aSVGStrTspan[] = "tspan";
-const char aSVGStrTref[] = "tref";
-const char aSVGStrTextPath[] = "textPath";
-const char aSVGStrStartOffset[] = "startOffset";
-const char aSVGStrMethod[] = "method";
-const char aSVGStrSpacing[] = "spacing";
-const char aSVGStrStdDeviation[] = "stdDeviation";
-const char aSVGStrTextAlign[] = "text-align";
-const char aSVGStrPathLength[] = "pathLength";
-const char aSVGStrType[] = "type";
-const char aSVGStrClass[] = "class";
-const char aSVGStrTextAnchor[] = "text-anchor";
-const char aSVGStrXmlSpace[] = "xml:space";
-const char aSVGStrColor[] = "color";
-const char aSVGStrClipPathNode[] = "clipPath";
-const char aSVGStrClipPathProperty[] = "clip-path";
-const char aSVGStrFeGaussianBlur[] = "feGaussianBlur";
-const char aSVGStrFeColorMatrix[] = "feColorMatrix";
-const char aSVGStrFilter[] = "filter";
-const char aSVGStrMask[] = "mask";
-const char aSVGStrClipPathUnits[] = "clipPathUnits";
-const char aSVGStrMaskUnits[] = "maskUnits";
-const char aSVGStrMaskContentUnits[] = "maskContentUnits";
-const char aSVGStrClipRule[] = "clip-rule";
-const char aSVGStrMarker[] = "marker";
-const char aSVGStrMarkerStart[] = "marker-start";
-const char aSVGStrMarkerMid[] = "marker-mid";
-const char aSVGStrMarkerEnd[] = "marker-end";
-const char aSVGStrRefX[] = "refX";
-const char aSVGStrRefY[] = "refY";
-const char aSVGStrMarkerUnits[] = "markerUnits";
-const char aSVGStrMarkerWidth[] = "markerWidth";
-const char aSVGStrMarkerHeight[] = "markerHeight";
-const char aSVGStrOrient[] = "orient";
-const char aSVGStrPattern[] = "pattern";
-const char aSVGStrPatternUnits[] = "patternUnits";
-const char aSVGStrPatternContentUnits[] = "patternContentUnits";
-const char aSVGStrPatternTransform[] = "patternTransform";
-  

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - svx/sdi svx/source

2023-06-13 Thread Tomaž Vajngerl (via logerrit)
 svx/sdi/svxitems.sdi |8 -
 svx/source/xoutdev/xattr.cxx |   64 ++-
 2 files changed, 65 insertions(+), 7 deletions(-)

New commits:
commit e04080c1259cd91388e157b58e3c4b041aed163c
Author: Tomaž Vajngerl 
AuthorDate: Thu Jun 8 15:17:38 2023 +0900
Commit: Miklos Vajna 
CommitDate: Tue Jun 13 15:54:33 2023 +0200

svx: add "Color" and "ComplexColorJSON" argument for XColorItem

This is needed now that the color picker expects this argument to
be present. Without the "ComplexColorJSON" argument, it is not
possible for the color picker to set any ComplexColor attributes,
which is needed for theme support.

Change-Id: I0a04ea57826afb9f17a54ce24a4cbcc88dfe1481
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152727
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit ac2838a9cd5577f92dbece130fa6fb8b8e26e6cd)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152739
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/svx/sdi/svxitems.sdi b/svx/sdi/svxitems.sdi
index eabb753f647a..6e8773315d29 100644
--- a/svx/sdi/svxitems.sdi
+++ b/svx/sdi/svxitems.sdi
@@ -214,7 +214,13 @@ item String SvxPatternListItem;
 item String SfxLockBytesItem;
 item String SvxFontListItem;
 item String avmedia_MediaItem;
-item INT32  XColorItem;
+struct XColor
+{
+INT32  ColorMID_COLOR_RGB;
+String ComplexColorJSON MID_COMPLEX_COLOR_JSON;
+};
+item XColor XColorItem;
+
 item INT16  SdrPercentItem;
 item INT32  SdrMetricItem;
 
diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx
index d3fd73f5fa04..3cb12c467b74 100644
--- a/svx/source/xoutdev/xattr.cxx
+++ b/svx/source/xoutdev/xattr.cxx
@@ -306,18 +306,70 @@ const Color& XColorItem::GetColorValue() const
 
 }
 
-bool XColorItem::QueryValue( css::uno::Any& rVal, sal_uInt8 /*nMemberId*/) 
const
+bool XColorItem::QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId) const
 {
-rVal <<= GetColorValue().GetRGBColor();
+nMemberId &= ~CONVERT_TWIPS;
+switch (nMemberId)
+{
+case MID_COMPLEX_COLOR:
+{
+auto xComplexColor = 
model::color::createXComplexColor(getComplexColor());
+rVal <<= xComplexColor;
+break;
+}
+case MID_COMPLEX_COLOR_JSON:
+{
+rVal <<= 
OStringToOUString(model::color::convertToJSON(getComplexColor()), 
RTL_TEXTENCODING_UTF8);
+break;
+}
+default:
+{
+rVal <<= GetColorValue().GetRGBColor();
+break;
+}
+}
 return true;
 }
 
-bool XColorItem::PutValue( const css::uno::Any& rVal, sal_uInt8 /*nMemberId*/)
+bool XColorItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId)
 {
-Color nValue;
-rVal >>= nValue;
-SetColorValue( nValue );
+nMemberId &= ~CONVERT_TWIPS;
+switch (nMemberId)
+{
+case MID_COMPLEX_COLOR:
+{
+css::uno::Reference xComplexColor;
+if (!(rVal >>= xComplexColor))
+return false;
+setComplexColor(model::color::getFromXComplexColor(xComplexColor));
+}
+break;
+case MID_COMPLEX_COLOR_JSON:
+{
+OUString sComplexColorJson;
+if (!(rVal >>= sComplexColorJson))
+return false;
+
+if (sComplexColorJson.isEmpty())
+return false;
+
+OString aJSON = OUStringToOString(sComplexColorJson, 
RTL_TEXTENCODING_ASCII_US);
+model::ComplexColor aComplexColor;
+model::color::convertFromJSON(aJSON, aComplexColor);
+setComplexColor(aComplexColor);
+}
+break;
+default:
+{
+Color nValue;
+if(!(rVal >>= nValue ))
+return false;
+
+SetColorValue( nValue );
 
+}
+break;
+}
 return true;
 }
 


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-06-13 Thread Tomaž Vajngerl (via logerrit)
 sw/source/filter/ww8/docxexport.cxx |   37 ++--
 1 file changed, 11 insertions(+), 26 deletions(-)

New commits:
commit a3ca125a08973c8b41a7170c085dff64a89c5f07
Author: Tomaž Vajngerl 
AuthorDate: Thu Jun 8 12:37:21 2023 +0900
Commit: Miklos Vajna 
CommitDate: Tue Jun 13 15:03:32 2023 +0200

sw: use ThemeExport instead of grab bag

Change-Id: I68d300d58aaa1e5da374a8ddea4ff37e9a1e1819
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152723
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit fcccb8f8d67dd7deec772746661d2d6dff2c14a3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152725
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/filter/ww8/docxexport.cxx 
b/sw/source/filter/ww8/docxexport.cxx
index b9c75140b7f6..7ad0f16eb6fb 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -48,11 +48,14 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
 
+#include 
+
 #include 
 #include 
 #include 
@@ -62,6 +65,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include "wrtww8.hxx"
@@ -74,6 +78,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -1464,35 +1469,15 @@ void DocxExport::WriteSettings()
 
 void DocxExport::WriteTheme()
 {
-uno::Reference< beans::XPropertySet > xPropSet( 
m_rDoc.GetDocShell()->GetBaseModel(), uno::UNO_QUERY_THROW );
-
-uno::Reference< beans::XPropertySetInfo > xPropSetInfo = 
xPropSet->getPropertySetInfo();
-OUString aName = UNO_NAME_MISC_OBJ_INTEROPGRABBAG;
-if ( !xPropSetInfo->hasPropertyByName( aName ) )
+SdrPage* pPage = 
m_rDoc.getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0);
+auto const& pTheme = pPage->getSdrPageProperties().GetTheme();
+if (!pTheme)
 return;
 
-uno::Reference themeDom;
-uno::Sequence< beans::PropertyValue > propList;
-xPropSet->getPropertyValue( aName ) >>= propList;
-auto pProp = std::find_if(std::cbegin(propList), std::cend(propList),
-[](const beans::PropertyValue& rProp) { return rProp.Name == 
"OOXTheme"; });
-if (pProp != std::cend(propList))
-pProp->Value >>= themeDom;
-
-// no theme dom to write
-if ( !themeDom.is() )
-return;
-
-m_rFilter.addRelation( m_pDocumentFS->getOutputStream(),
-oox::getRelationship(Relationship::THEME),
-u"theme/theme1.xml" );
+m_rFilter.addRelation(m_pDocumentFS->getOutputStream(), 
oox::getRelationship(Relationship::THEME), u"theme/theme1.xml" );
 
-uno::Reference< xml::sax::XSAXSerializable > serializer( themeDom, 
uno::UNO_QUERY );
-uno::Reference< xml::sax::XWriter > writer = xml::sax::Writer::create( 
comphelper::getProcessComponentContext() );
-writer->setOutputStream( GetFilter().openFragmentStream( 
"word/theme/theme1.xml",
-"application/vnd.openxmlformats-officedocument.theme+xml" ) );
-serializer->serialize( uno::Reference< xml::sax::XDocumentHandler >( 
writer, uno::UNO_QUERY_THROW ),
-uno::Sequence< beans::StringPair >() );
+oox::ThemeExport aThemeExport(_rFilter, oox::drawingml::DOCUMENT_DOCX);
+aThemeExport.write(u"word/theme/theme1.xml", *pTheme);
 }
 
 // See OOXMLDocumentImpl::resolveGlossaryStream


[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - include/oox oox/source

2023-06-13 Thread Tomaž Vajngerl (via logerrit)
 include/oox/drawingml/color.hxx  |3 ++
 oox/source/drawingml/color.cxx   |   24 +++
 oox/source/drawingml/fillproperties.cxx  |   16 +--
 oox/source/drawingml/textcharacterproperties.cxx |   15 --
 4 files changed, 30 insertions(+), 28 deletions(-)

New commits:
commit cba27b9723764b7215ad62fad9b30280dfea5f94
Author: Tomaž Vajngerl 
AuthorDate: Fri Jun 9 23:34:24 2023 +0900
Commit: Xisco Fauli 
CommitDate: Tue Jun 13 13:33:04 2023 +0200

oox: remove code duplication and add getComplexColor to oox::Color

Change-Id: I9cfbc851d4f303a5a8c92183f01cb5b6545b7984
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152800
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit c1470e15bd0643be8d91aaf6a0d25c78867d0b3e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152979
Reviewed-by: Xisco Fauli 

diff --git a/include/oox/drawingml/color.hxx b/include/oox/drawingml/color.hxx
index 75812c200c28..245e655d7c78 100644
--- a/include/oox/drawingml/color.hxx
+++ b/include/oox/drawingml/color.hxx
@@ -30,6 +30,7 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace oox { class GraphicHelper; }
 
@@ -117,6 +118,8 @@ public:
 /// Compares this color with rOther.
 bool equals(const Color& rOther, const GraphicHelper& rGraphicHelper, 
::Color nPhClr) const;
 
+model::ComplexColor getComplexColor() const;
+
 private:
 /** Internal helper for getColor(). */
 voidsetResolvedRgb( ::Color nRgb ) const;
diff --git a/oox/source/drawingml/color.cxx b/oox/source/drawingml/color.cxx
index 805ca6c4faed..ad0b5ca7835e 100644
--- a/oox/source/drawingml/color.cxx
+++ b/oox/source/drawingml/color.cxx
@@ -571,6 +571,30 @@ sal_Int16 Color::getLumOff() const
 return 0;
 }
 
+model::ComplexColor Color::getComplexColor() const
+{
+model::ComplexColor aComplexColor;
+
aComplexColor.setSchemeColor(model::convertToThemeColorType(getSchemeColorIndex()));
+
+if (getTintOrShade() > 0)
+{
+aComplexColor.addTransformation({model::TransformationType::Tint, 
getTintOrShade()});
+}
+else if (getTintOrShade() < 0)
+{
+sal_Int16 nShade = o3tl::narrowing(-getTintOrShade());
+aComplexColor.addTransformation({model::TransformationType::Shade, 
nShade});
+}
+
+if (getLumMod() != 1)
+aComplexColor.addTransformation({model::TransformationType::LumMod, 
getLumMod()});
+
+if (getLumOff() != 0)
+aComplexColor.addTransformation({model::TransformationType::LumOff, 
getLumOff()});
+
+return aComplexColor;
+}
+
 ::Color Color::getColor( const GraphicHelper& rGraphicHelper, ::Color nPhClr ) 
const
 {
 const sal_Int32 nTempC1 = mnC1;
diff --git a/oox/source/drawingml/fillproperties.cxx 
b/oox/source/drawingml/fillproperties.cxx
index 705f2dc3b55a..7e2f5185b7f6 100644
--- a/oox/source/drawingml/fillproperties.cxx
+++ b/oox/source/drawingml/fillproperties.cxx
@@ -431,24 +431,12 @@ void FillProperties::pushToPropMap(ShapePropertyMap& 
rPropMap, const GraphicHelp
 if (aFillColor == nPhClr)
 {
 
aComplexColor.setSchemeColor(model::convertToThemeColorType(nPhClrTheme));
-rPropMap.setProperty(PROP_FillComplexColor, 
model::color::createXComplexColor(aComplexColor));
 }
 else
 {
-
aComplexColor.setSchemeColor(model::convertToThemeColorType(maFillColor.getSchemeColorIndex()));
-if (maFillColor.getLumMod() != 1)
-
aComplexColor.addTransformation({model::TransformationType::LumMod, 
maFillColor.getLumMod()});
-if (maFillColor.getLumOff() != 0)
-
aComplexColor.addTransformation({model::TransformationType::LumOff, 
maFillColor.getLumOff()});
-if (maFillColor.getTintOrShade() > 0)
-
aComplexColor.addTransformation({model::TransformationType::Tint, 
maFillColor.getTintOrShade()});
-if (maFillColor.getTintOrShade() < 0)
-{
-sal_Int16 nShade = 
o3tl::narrowing(-maFillColor.getTintOrShade());
-
aComplexColor.addTransformation({model::TransformationType::Shade, nShade});
-}
-rPropMap.setProperty(PROP_FillComplexColor, 
model::color::createXComplexColor(aComplexColor));
+aComplexColor = maFillColor.getComplexColor();
 }
+rPropMap.setProperty(PROP_FillComplexColor, 
model::color::createXComplexColor(aComplexColor));
 
 eFillStyle = FillStyle_SOLID;
 }
diff --git a/oox/source/drawingml/textcharacterproperties.cxx 
b/oox/source/drawingml/textcharacterproperties.cxx
index 7d3dda284680..0e1e2830a67f 100644
--- 

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - include/docmodel sw/CppunitTest_sw_ooxml_theme_export.mk sw/Library_msword.mk sw/Module_sw.mk sw/qa sw/source writerfilter/source

2023-06-13 Thread Tomaž Vajngerl (via logerrit)
 include/docmodel/color/ComplexColor.hxx |1 
 include/docmodel/theme/ThemeColorType.hxx   |7 
 sw/CppunitTest_sw_ooxml_theme_export.mk |   53 +
 sw/Library_msword.mk|1 
 sw/Module_sw.mk |1 
 sw/qa/core/theme/ThemeTest.cxx  |   12 
 sw/qa/extras/ooxmlexport/data/Test_ThemePortionLevel_CharColor.docx |binary
 sw/qa/extras/ooxmlexport/data/Test_ThemePortionLevel_CharColor.fodt |  420 
++
 sw/qa/extras/ooxmlexport/ooxml_ThemeExport.cxx  |   56 +
 sw/source/filter/ww8/docxattributeoutput.cxx|  122 ++
 writerfilter/source/dmapper/DomainMapper.cxx|8 
 writerfilter/source/dmapper/TDefTableHandler.cxx|   16 
 writerfilter/source/dmapper/TDefTableHandler.hxx|1 
 13 files changed, 666 insertions(+), 32 deletions(-)

New commits:
commit 695c8d47b210616002db4c8bc170b53fd86d7a4e
Author: Tomaž Vajngerl 
AuthorDate: Wed Jun 7 23:29:05 2023 +0900
Commit: Miklos Vajna 
CommitDate: Tue Jun 13 13:22:12 2023 +0200

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 
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 17105fc44bceea61ff8876686cc1362aa787ead2)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152724
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/include/docmodel/color/ComplexColor.hxx 
b/include/docmodel/color/ComplexColor.hxx
index 958f82f19b4e..19e228b2a858 100644
--- a/include/docmodel/color/ComplexColor.hxx
+++ b/include/docmodel/color/ComplexColor.hxx
@@ -88,6 +88,7 @@ public:
 ::Color maLastColor;
 
 ThemeColorType meSchemeType = ThemeColorType::Unknown;
+ThemeColorUsage meThemeColorUsage = ThemeColorUsage::Unknown;
 std::vector maTransformations;
 
 ::Color maFinalColor;
diff --git a/include/docmodel/theme/ThemeColorType.hxx 
b/include/docmodel/theme/ThemeColorType.hxx
index a8ed9a56a6dc..04e7f5068f1b 100644
--- a/include/docmodel/theme/ThemeColorType.hxx
+++ b/include/docmodel/theme/ThemeColorType.hxx
@@ -31,6 +31,13 @@ enum class ThemeColorType : sal_Int32
 LAST = FollowedHyperlink
 };
 
+enum class ThemeColorUsage
+{
+Unknown = 0,
+Text,
+Background
+};
+
 constexpr ThemeColorType convertToThemeColorType(sal_Int32 nIndex)
 {
 if (nIndex < 0 || nIndex > 11)
diff --git a/sw/CppunitTest_sw_ooxml_theme_export.mk 
b/sw/CppunitTest_sw_ooxml_theme_export.mk
new file mode 100644
index ..8e4f94fc5cc6
--- /dev/null
+++ b/sw/CppunitTest_sw_ooxml_theme_export.mk
@@ -0,0 +1,53 @@
+# -*- 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_CppunitTest_CppunitTest,sw_ooxml_theme_export))
+
+$(eval $(call 
gb_CppunitTest_use_common_precompiled_header,sw_ooxml_theme_export))
+
+$(eval $(call gb_CppunitTest_add_exception_objects,sw_ooxml_theme_export, \
+sw/qa/extras/ooxmlexport/ooxml_ThemeExport \
+))
+
+$(eval $(call gb_CppunitTest_use_libraries,sw_ooxml_theme_export, \
+   $(sw_ooxmlexport_libraries) \
+))
+
+$(eval $(call gb_CppunitTest_use_externals,sw_ooxml_theme_export,\
+   boost_headers \
+libxml2 \
+))
+
+$(eval $(call gb_CppunitTest_set_include,sw_ooxml_theme_export,\
+-I$(SRCDIR)/sw/inc \
+-I$(SRCDIR)/sw/source/core/inc \
+   -I$(SRCDIR)/sw/qa/inc \
+$$(INCLUDE) \
+))
+
+$(eval $(call 

[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - editeng/source include/editeng oox/source sw/qa sw/source writerfilter/source

2023-06-13 Thread Tomaž Vajngerl (via logerrit)
 editeng/source/items/frmitems.cxx|   97 +++-
 include/editeng/boxitem.hxx  |7 
 oox/source/token/properties.txt  |4 
 sw/qa/extras/ooxmlexport/data/Test_ThemeBorderColor.docx |binary
 sw/qa/extras/ooxmlexport/ooxml_ThemeExport.cxx   |   30 ++
 sw/qa/inc/swmodeltestbase.hxx|9 
 sw/source/core/unocore/unomap1.cxx   |   12 -
 sw/source/core/unocore/unomapproperties.hxx  |8 
 sw/source/filter/ww8/docxattributeoutput.cxx |  180 +++
 writerfilter/source/dmapper/BorderHandler.cxx|   34 ++
 writerfilter/source/dmapper/BorderHandler.hxx|8 
 writerfilter/source/dmapper/DomainMapper.cxx |   40 ++-
 writerfilter/source/dmapper/PropertyIds.cxx  |8 
 writerfilter/source/dmapper/PropertyIds.hxx  |   11 
 writerfilter/source/dmapper/TDefTableHandler.cxx |   22 +
 writerfilter/source/dmapper/TDefTableHandler.hxx |   12 -
 16 files changed, 370 insertions(+), 112 deletions(-)

New commits:
commit d154adeea846c972cc5b4ce679cdd8794d3e
Author: Tomaž Vajngerl 
AuthorDate: Sat Jun 10 22:25:43 2023 +0900
Commit: Xisco Fauli 
CommitDate: Tue Jun 13 10:30:24 2023 +0200

ooxml: import and export border theme colors for various props.

This adds support to import and export various border (lines)
theme color properties.

SvxBoxItem needed to be fixed, because it can happen that the
BorderLine is not yet initialised and we already set the border's
ComplexColor. Now there is a maTempComplexColor inside SvxBoxItem,
which stores the ComplexColor until the specific BorderLine is
initialized.

In addition add roundtrip test for import and export cycle.

Change-Id: Idd307a3adaf364745aed8fc8540bf72ef4948198
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152833
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 47afd1e5e022a2c83e2b2c15581c7f7eb149e852)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152915
Reviewed-by: Xisco Fauli 

diff --git a/editeng/source/items/frmitems.cxx 
b/editeng/source/items/frmitems.cxx
index 77c497079634..94b7704303ba 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -2301,6 +2301,7 @@ SvxBoxItem::SvxBoxItem(const SvxBoxItem& rCopy)
 , mnBottomDistance(rCopy.mnBottomDistance)
 , mnLeftDistance(rCopy.mnLeftDistance)
 , mnRightDistance(rCopy.mnRightDistance)
+, maTempComplexColors(rCopy.maTempComplexColors)
 , mbRemoveAdjCellBorder(rCopy.mbRemoveAdjCellBorder)
 {
 }
@@ -2369,6 +2370,7 @@ bool SvxBoxItem::operator==( const SfxPoolItem& rAttr ) 
const
 (mnLeftDistance == rBoxItem.mnLeftDistance) &&
 (mnRightDistance == rBoxItem.mnRightDistance) &&
 (mbRemoveAdjCellBorder == rBoxItem.mbRemoveAdjCellBorder ) &&
+(maTempComplexColors == rBoxItem.maTempComplexColors) &&
 CompareBorderLine(mpTopBorderLine, rBoxItem.GetTop()) &&
 CompareBorderLine(mpBottomBorderLine, rBoxItem.GetBottom()) &&
 CompareBorderLine(mpLeftBorderLine, rBoxItem.GetLeft()) &&
@@ -2462,8 +2464,11 @@ bool SvxBoxItem::QueryValue( uno::Any& rVal, sal_uInt8 
nMemberId ) const
 {
 if (mpBottomBorderLine)
 {
-auto xComplexColor = 
model::color::createXComplexColor(mpBottomBorderLine->getComplexColor());
-rVal <<= xComplexColor;
+rVal <<= 
model::color::createXComplexColor(mpBottomBorderLine->getComplexColor());
+}
+else if 
(maTempComplexColors[size_t(SvxBoxItemLine::BOTTOM)].getType() != 
model::ColorType::Unused)
+{
+rVal <<= 
model::color::createXComplexColor(maTempComplexColors[size_t(SvxBoxItemLine::BOTTOM)]);
 }
 return true;
 }
@@ -2471,8 +2476,11 @@ bool SvxBoxItem::QueryValue( uno::Any& rVal, sal_uInt8 
nMemberId ) const
 {
 if (mpLeftBorderLine)
 {
-auto xComplexColor = 
model::color::createXComplexColor(mpLeftBorderLine->getComplexColor());
-rVal <<= xComplexColor;
+rVal <<= 
model::color::createXComplexColor(mpLeftBorderLine->getComplexColor());
+}
+else if 
(maTempComplexColors[size_t(SvxBoxItemLine::LEFT)].getType() != 
model::ColorType::Unused)
+{
+rVal <<= 
model::color::createXComplexColor(maTempComplexColors[size_t(SvxBoxItemLine::LEFT)]);
 }
 return true;
 }
@@ -2480,8 +2488,11 @@ bool SvxBoxItem::QueryValue( uno::Any& rVal, sal_uInt8 
nMemberId ) const
 {
 if (mpRightBorderLine)
 {
-auto xComplexColor = 

[Libreoffice-commits] core.git: Branch 'private/tvajngerl/staging' - 1817 commits - accessibility/inc accessibility/source animations/source avmedia/source basctl/inc basctl/source basctl/uiconfig bas

2023-06-13 Thread Tomaž Vajngerl (via logerrit)
Rebased ref, commits from common ancestor:
commit 7ef013f62cc3febc967ddd495efc69bd0de63f4a
Author: Tomaž Vajngerl 
AuthorDate: Sun Mar 5 18:48:23 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Tue Jun 13 15:44:09 2023 +0900

svx: use gfx::Length based types directly in SdrTextObj::NbcResize

Change-Id: I839430b30685994e1767998b353c63b97f461284

diff --git a/svx/source/svdraw/svdotxtr.cxx b/svx/source/svdraw/svdotxtr.cxx
index 74afe966425f..60c968bc1847 100644
--- a/svx/source/svdraw/svdotxtr.cxx
+++ b/svx/source/svdraw/svdotxtr.cxx
@@ -122,81 +122,103 @@ void SdrTextObj::NbcMove(const Size& rSize)
 
 void SdrTextObj::NbcResize(const Point& rRef, const Fraction& xFact, const 
Fraction& yFact)
 {
-bool bNotSheared=maGeo.nShearAngle==0_deg100;
-bool bRotate90=bNotSheared && maGeo.nRotationAngle.get() % 9000 ==0;
-bool bXMirr=(xFact.GetNumerator()<0) != (xFact.GetDenominator()<0);
-bool bYMirr=(yFact.GetNumerator()<0) != (yFact.GetDenominator()<0);
-if (bXMirr || bYMirr) {
+bool bNotSheared = maGeo.nShearAngle == 0_deg100;
+bool bRotate90 = bNotSheared && maGeo.nRotationAngle.get() % 9000 == 0;
+
+bool bXMirrored = (xFact.GetNumerator() < 0) != (xFact.GetDenominator() < 
0);
+bool bYMirrored = (yFact.GetNumerator() < 0) != (yFact.GetDenominator() < 
0);
+
+double fFactorX = xFact.IsValid() ? double(xFact) : 1.0;
+double fFactorY = yFact.IsValid() ? double(yFact) : 1.0;
+
+if (bXMirrored || bYMirrored)
+{
 Point aRef1(GetSnapRect().Center());
-if (bXMirr) {
+if (bXMirrored)
+{
 Point aRef2(aRef1);
 aRef2.AdjustY( 1 );
 NbcMirrorGluePoints(aRef1,aRef2);
 }
-if (bYMirr) {
+if (bYMirrored)
+{
 Point aRef2(aRef1);
 aRef2.AdjustX( 1 );
 NbcMirrorGluePoints(aRef1,aRef2);
 }
 }
 
-if (maGeo.nRotationAngle==0_deg100 && maGeo.nShearAngle==0_deg100) {
-auto aRectangle = getRectangle();
-ResizeRect(aRectangle, rRef, xFact, yFact);
-setRectangle(aRectangle);
-if (bYMirr)
+if (maGeo.nRotationAngle == 0_deg100 && maGeo.nShearAngle == 0_deg100)
+{
+auto eUnit = getSdrModelFromSdrObject().getUnit();
+gfx::Tuple2DL aReference = createTupleFromPoint(rRef, eUnit);
+svx::resizeRange(maRectangleRange, aReference, fFactorX, fFactorY);
+
+if (bYMirrored)
 {
-//maRectangle.Normalize();
-moveRectangle(aRectangle.Right() - aRectangle.Left(), 
aRectangle.Bottom() - aRectangle.Top());
-maGeo.nRotationAngle=18000_deg100;
+maRectangleRange.shift(maRectangleRange.getWidth(), 
maRectangleRange.getHeight());
+maGeo.nRotationAngle = 18000_deg100;
 maGeo.RecalcSinCos();
 }
 }
 else
 {
-tools::Polygon aPol(Rect2Poly(getRectangle(), maGeo));
+tools::Polygon aPolygon(Rect2Poly(getRectangle(), maGeo));
 
-for(sal_uInt16 a(0); a < aPol.GetSize(); a++)
+for (sal_uInt16 a(0); a < aPolygon.GetSize(); a++)
 {
- ResizePoint(aPol[a], rRef, xFact, yFact);
+ ResizePoint(aPolygon[a], rRef, xFact, yFact);
 }
 
-if(bXMirr != bYMirr)
+if (bXMirrored != bYMirrored)
 {
 // turn polygon and move it a little
-tools::Polygon aPol0(aPol);
+tools::Polygon aPol0(aPolygon);
 
-aPol[0] = aPol0[1];
-aPol[1] = aPol0[0];
-aPol[2] = aPol0[3];
-aPol[3] = aPol0[2];
-aPol[4] = aPol0[1];
+aPolygon[0] = aPol0[1];
+aPolygon[1] = aPol0[0];
+aPolygon[2] = aPol0[3];
+aPolygon[3] = aPol0[2];
+aPolygon[4] = aPol0[1];
 }
-tools::Rectangle aRectangle = svx::polygonToRectangle(aPol, maGeo);
+tools::Rectangle aRectangle = svx::polygonToRectangle(aPolygon, maGeo);
 setRectangle(aRectangle);
 }
 
-if (bRotate90) {
-bool bRota90=maGeo.nRotationAngle.get() % 9000 ==0;
-if (!bRota90) { // there's seems to be a rounding error occurring: 
correct it
-Degree100 a=NormAngle36000(maGeo.nRotationAngle);
-if (a<4500_deg100) a=0_deg100;
-else if (a<13500_deg100) a=9000_deg100;
-else if (a<22500_deg100) a=18000_deg100;
-else if (a<31500_deg100) a=27000_deg100;
-else a=0_deg100;
-maGeo.nRotationAngle=a;
+if (bRotate90)
+{
+bool bRota90 = maGeo.nRotationAngle.get() % 9000 == 0;
+if (!bRota90)
+{
+// there's seems to be a rounding error occurring: correct it
+
+Degree100 angle = NormAngle36000(maGeo.nRotationAngle);
+if (angle < 4500_deg100)
+angle = 0_deg100;
+else if (angle < 13500_deg100)
+angle = 9000_deg100;
+  

[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - docmodel/source editeng/source svx/source sw/source

2023-06-12 Thread Tomaž Vajngerl (via logerrit)
 docmodel/source/color/ComplexColorJSON.cxx|   52 +-
 editeng/source/items/textitem.cxx |9 ++--
 svx/source/theme/ThemeColorPaletteManager.cxx |2 -
 sw/source/filter/ww8/docxattributeoutput.cxx  |4 +-
 4 files changed, 35 insertions(+), 32 deletions(-)

New commits:
commit 7f7bada86cb2ac495d27fce9aca56a4dc9b0aedc
Author: Tomaž Vajngerl 
AuthorDate: Fri Jun 9 16:06:37 2023 +0900
Commit: Xisco Fauli 
CommitDate: Mon Jun 12 17:56:02 2023 +0200

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 
(cherry picked from commit 7d2a7307da71b245fe55c55c5a29f4695c3c54f7)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152883
Reviewed-by: Xisco Fauli 

diff --git a/docmodel/source/color/ComplexColorJSON.cxx 
b/docmodel/source/color/ComplexColorJSON.cxx
index db36f29e6a4e..f6b52d1bf55c 100644
--- a/docmodel/source/color/ComplexColorJSON.cxx
+++ b/docmodel/source/color/ComplexColorJSON.cxx
@@ -18,40 +18,42 @@ namespace model::color
 bool convertFromJSON(OString const& rJsonString, model::ComplexColor& 
rComplexColor)
 {
 model::ComplexColor aComplexColor;
-std::stringstream aStream((std::string(rJsonString)));
-boost::property_tree::ptree aRootTree;
+
 try
 {
+std::stringstream aStream((std::string(rJsonString)));
+boost::property_tree::ptree aRootTree;
 boost::property_tree::read_json(aStream, aRootTree);
+
+sal_Int32 nThemeType = aRootTree.get("ThemeIndex", -1);
+
aComplexColor.setSchemeColor(model::convertToThemeColorType(nThemeType));
+boost::property_tree::ptree aTransformTree = 
aRootTree.get_child("Transformations");
+for (const auto& rEachTransformationNode :
+ boost::make_iterator_range(aTransformTree.equal_range("")))
+{
+auto const& rTransformationTree = rEachTransformationNode.second;
+std::string sType = rTransformationTree.get("Type", 
"");
+sal_Int16 nValue = rTransformationTree.get("Value", 0);
+
+auto eType = model::TransformationType::Undefined;
+if (sType == "LumOff")
+eType = model::TransformationType::LumOff;
+else if (sType == "LumMod")
+eType = model::TransformationType::LumMod;
+else if (sType == "Tint")
+eType = model::TransformationType::Tint;
+else if (sType == "Shade")
+eType = model::TransformationType::Shade;
+
+if (eType != model::TransformationType::Undefined)
+aComplexColor.addTransformation({ eType, nValue });
+}
 }
 catch (const boost::property_tree::json_parser_error& /*exception*/)
 {
 return false;
 }
 
-sal_Int32 nThemeType = aRootTree.get("ThemeIndex", -1);
-aComplexColor.setSchemeColor(model::convertToThemeColorType(nThemeType));
-boost::property_tree::ptree aTransformTree = 
aRootTree.get_child("Transformations");
-for (const auto& rEachTransformationNode :
- boost::make_iterator_range(aTransformTree.equal_range("")))
-{
-auto const& rTransformationTree = rEachTransformationNode.second;
-std::string sType = rTransformationTree.get("Type", "");
-sal_Int16 nValue = rTransformationTree.get("Value", 0);
-
-auto eType = model::TransformationType::Undefined;
-if (sType == "LumOff")
-eType = model::TransformationType::LumOff;
-else if (sType == "LumMod")
-eType = model::TransformationType::LumMod;
-else if (sType == "Tint")
-eType = model::TransformationType::Tint;
-else if (sType == "Shade")
-eType = model::TransformationType::Shade;
-
-if (eType != model::TransformationType::Undefined)
-aComplexColor.addTransformation({ eType, nValue });
-}
 rComplexColor = aComplexColor;
 return true;
 }
diff --git a/editeng/source/items/textitem.cxx 
b/editeng/source/items/textitem.cxx
index 2f11ab7bb9b2..546918197a34 100644
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -1555,11 +1555,11 @@ bool SvxColorItem::PutValue( const uno::Any& rVal, 
sal_uInt8 nMemberId )
 return false;
 
 if (sComplexColorJson.isEmpty())
-{
 return false;
-}
+
 OString aJSON = OUStringToOString(sComplexColorJson, 
RTL_TEXTENCODING_ASCII_US);
-model::color::convertFromJSON(aJSON, maComplexColor);
+if (!model::color::convertFromJSON(aJSON, maComplexColor))
+return false;
 }
 break;
 

[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - writerfilter/source

2023-06-12 Thread Tomaž Vajngerl (via logerrit)
 writerfilter/source/ooxml/model.xml |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit f60e889c95cc894eaae06ea2199e2b2d107d54a0
Author: Tomaž Vajngerl 
AuthorDate: Sat Jun 10 22:22:17 2023 +0900
Commit: Xisco Fauli 
CommitDate: Mon Jun 12 17:53:36 2023 +0200

oox: fix theme data in model.xml to use a correct types

Change-Id: Ifaa725d8a3e6c4cfefc92a6c5fcdb581610d3ce6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152832
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 3a6d360b5e585b8e92cc0d58d5fbc497448e11fb)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152887
Reviewed-by: Xisco Fauli 

diff --git a/writerfilter/source/ooxml/model.xml 
b/writerfilter/source/ooxml/model.xml
index 888ffeba173c..526fbc223c16 100644
--- a/writerfilter/source/ooxml/model.xml
+++ b/writerfilter/source/ooxml/model.xml
@@ -10997,13 +10997,13 @@
   
 
 
-  
+  
 
 
-  
+  
 
 
-  
+  
 
   
   
@@ -12591,13 +12591,13 @@
   
 
 
-  
+  
 
 
-  
+  
 
 
-  
+  
 
 
   


[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - sw/source

2023-06-12 Thread Tomaž Vajngerl (via logerrit)
 sw/source/filter/ww8/docxexport.cxx |   37 ++--
 1 file changed, 11 insertions(+), 26 deletions(-)

New commits:
commit 3c7643570913c149d68f0850612edcb538c6d346
Author: Tomaž Vajngerl 
AuthorDate: Thu Jun 8 12:37:21 2023 +0900
Commit: Xisco Fauli 
CommitDate: Mon Jun 12 11:16:39 2023 +0200

sw: use ThemeExport instead of grab bag

Change-Id: I68d300d58aaa1e5da374a8ddea4ff37e9a1e1819
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152723
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit fcccb8f8d67dd7deec772746661d2d6dff2c14a3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152768
Reviewed-by: Xisco Fauli 

diff --git a/sw/source/filter/ww8/docxexport.cxx 
b/sw/source/filter/ww8/docxexport.cxx
index af9979a1d660..f7258952a541 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -48,11 +48,14 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
 
+#include 
+
 #include 
 #include 
 #include 
@@ -62,6 +65,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include "wrtww8.hxx"
@@ -74,6 +78,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -1466,35 +1471,15 @@ void DocxExport::WriteSettings()
 
 void DocxExport::WriteTheme()
 {
-uno::Reference< beans::XPropertySet > xPropSet( 
m_rDoc.GetDocShell()->GetBaseModel(), uno::UNO_QUERY_THROW );
-
-uno::Reference< beans::XPropertySetInfo > xPropSetInfo = 
xPropSet->getPropertySetInfo();
-OUString aName = UNO_NAME_MISC_OBJ_INTEROPGRABBAG;
-if ( !xPropSetInfo->hasPropertyByName( aName ) )
+SdrPage* pPage = 
m_rDoc.getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0);
+auto const& pTheme = pPage->getSdrPageProperties().GetTheme();
+if (!pTheme)
 return;
 
-uno::Reference themeDom;
-uno::Sequence< beans::PropertyValue > propList;
-xPropSet->getPropertyValue( aName ) >>= propList;
-auto pProp = std::find_if(std::cbegin(propList), std::cend(propList),
-[](const beans::PropertyValue& rProp) { return rProp.Name == 
"OOXTheme"; });
-if (pProp != std::cend(propList))
-pProp->Value >>= themeDom;
-
-// no theme dom to write
-if ( !themeDom.is() )
-return;
-
-m_rFilter.addRelation( m_pDocumentFS->getOutputStream(),
-oox::getRelationship(Relationship::THEME),
-u"theme/theme1.xml" );
+m_rFilter.addRelation(m_pDocumentFS->getOutputStream(), 
oox::getRelationship(Relationship::THEME), u"theme/theme1.xml" );
 
-uno::Reference< xml::sax::XSAXSerializable > serializer( themeDom, 
uno::UNO_QUERY );
-uno::Reference< xml::sax::XWriter > writer = xml::sax::Writer::create( 
comphelper::getProcessComponentContext() );
-writer->setOutputStream( GetFilter().openFragmentStream( 
"word/theme/theme1.xml",
-"application/vnd.openxmlformats-officedocument.theme+xml" ) );
-serializer->serialize( uno::Reference< xml::sax::XDocumentHandler >( 
writer, uno::UNO_QUERY_THROW ),
-uno::Sequence< beans::StringPair >() );
+oox::ThemeExport aThemeExport(_rFilter, oox::drawingml::DOCUMENT_DOCX);
+aThemeExport.write(u"word/theme/theme1.xml", *pTheme);
 }
 
 // See OOXMLDocumentImpl::resolveGlossaryStream


[Libreoffice-commits] core.git: oox/source sw/qa sw/source writerfilter/source

2023-06-11 Thread Tomaž Vajngerl (via logerrit)
 oox/source/drawingml/textcharacterproperties.cxx|2 
 oox/source/token/properties.txt |1 
 sw/qa/extras/ooxmlexport/data/Test_CharUnderlineThemeColor.docx |binary
 sw/qa/extras/ooxmlexport/ooxml_ThemeExport.cxx  |   16 +++
 sw/source/filter/ww8/docxattributeoutput.cxx|   10 +-
 writerfilter/source/dmapper/DomainMapper.cxx|   42 
++
 writerfilter/source/dmapper/PropertyIds.cxx |1 
 writerfilter/source/dmapper/PropertyIds.hxx |1 
 8 files changed, 70 insertions(+), 3 deletions(-)

New commits:
commit 953ef30494661788b2e980ece84b62c653d77321
Author: Tomaž Vajngerl 
AuthorDate: Sun Jun 11 00:50:08 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Mon Jun 12 05:26:11 2023 +0200

ooxml: import and export char underline theme colors

This adds support to import and export char underline theme color
properties.

Change-Id: Ia8948ee5aacd20e0c2b7cbb1b2fdf97fc65c04e0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152834
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/oox/source/drawingml/textcharacterproperties.cxx 
b/oox/source/drawingml/textcharacterproperties.cxx
index 0e1e2830a67f..1217c19441ae 100644
--- a/oox/source/drawingml/textcharacterproperties.cxx
+++ b/oox/source/drawingml/textcharacterproperties.cxx
@@ -206,6 +206,8 @@ void TextCharacterProperties::pushToPropMap( PropertyMap& 
rPropMap, const XmlFil
 {
 rPropMap.setProperty( PROP_CharUnderlineHasColor, true);
 rPropMap.setProperty( PROP_CharUnderlineColor, 
maUnderlineColor.getColor( rFilter.getGraphicHelper() ));
+model::ComplexColor aComplexColor = maUnderlineColor.getComplexColor();
+rPropMap.setProperty( PROP_CharUnderlineComplexColor, 
model::color::createXComplexColor(aComplexColor));
 }
 else
 {
diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt
index 40988ffb0222..025b0628b9d8 100644
--- a/oox/source/token/properties.txt
+++ b/oox/source/token/properties.txt
@@ -91,6 +91,7 @@ CharStyleName
 CharTransparence
 CharUnderline
 CharUnderlineColor
+CharUnderlineComplexColor
 CharUnderlineHasColor
 CharWeight
 CharWeightAsian
diff --git a/sw/qa/extras/ooxmlexport/data/Test_CharUnderlineThemeColor.docx 
b/sw/qa/extras/ooxmlexport/data/Test_CharUnderlineThemeColor.docx
new file mode 100644
index ..3ee3cdf457f0
Binary files /dev/null and 
b/sw/qa/extras/ooxmlexport/data/Test_CharUnderlineThemeColor.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxml_ThemeExport.cxx 
b/sw/qa/extras/ooxmlexport/ooxml_ThemeExport.cxx
index 3804f4606187..f9e7155859ea 100644
--- a/sw/qa/extras/ooxmlexport/ooxml_ThemeExport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxml_ThemeExport.cxx
@@ -81,6 +81,22 @@ DECLARE_SW_ROUNDTRIP_TEST(testThemePortionBorderColor_DOCX, 
"Test_ThemeBorderCol
 CPPUNIT_ASSERT(isPropertyVoid(xParagraph, "RightBorderComplexColor"));
 }
 
+DECLARE_SW_ROUNDTRIP_TEST(testCharUnderlineTheme_DOCX, 
"Test_CharUnderlineThemeColor.docx", nullptr,
+  Test)
+{
+auto xParagraph = getParagraph(1);
+CPPUNIT_ASSERT(xParagraph.is());
+auto xRun = getRun(xParagraph, 1);
+auto xComplexColor
+= getProperty>(xRun, 
"CharUnderlineComplexColor");
+auto aComplexColor = model::color::getFromXComplexColor(xComplexColor);
+CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent1, 
aComplexColor.getSchemeType());
+auto const& rTransforms = aComplexColor.getTransformations();
+CPPUNIT_ASSERT_EQUAL(size_t(1), rTransforms.size());
+CPPUNIT_ASSERT_EQUAL(model::TransformationType::Shade, 
rTransforms[0].meType);
+CPPUNIT_ASSERT_EQUAL(sal_Int16(2509), rTransforms[0].mnValue);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index f5742eae4515..a75682761d84 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -7953,10 +7953,14 @@ void DocxAttributeOutput::CharUnderline( const 
SvxUnderlineItem& rUnderline )
 bool  bUnderlineHasColor = !aUnderlineColor.IsTransparent();
 if (bUnderlineHasColor)
 {
+model::ComplexColor const& rComplexColor = 
rUnderline.getComplexColor();
 // Underline has a color
-m_pSerializer->singleElementNS( XML_w, XML_u,
-FSNS( XML_w, XML_val ), 
pUnderlineValue,
-FSNS( XML_w, XML_color ), 
msfilter::util::ConvertColor(aUnderlineColor) );
+rtl::Reference pAttrList = 
FastSerializerHelper::createAttrList();
+pAttrList->add(FSNS(XML_w, XML_val), pUnderlineValue);
+pAttrList->add(FSNS(XML_w, XML_color), 
msfilter::util::ConvertColor(aUnderlineColor));
+ 

[Libreoffice-commits] core.git: editeng/source include/editeng oox/source sw/qa sw/source writerfilter/source

2023-06-11 Thread Tomaž Vajngerl (via logerrit)
 editeng/source/items/frmitems.cxx|   97 +++-
 include/editeng/boxitem.hxx  |7 
 oox/source/token/properties.txt  |4 
 sw/qa/extras/ooxmlexport/data/Test_ThemeBorderColor.docx |binary
 sw/qa/extras/ooxmlexport/ooxml_ThemeExport.cxx   |   30 ++
 sw/qa/inc/swmodeltestbase.hxx|9 
 sw/source/core/unocore/unomap1.cxx   |   12 -
 sw/source/core/unocore/unomapproperties.hxx  |8 
 sw/source/filter/ww8/docxattributeoutput.cxx |  180 +++
 writerfilter/source/dmapper/BorderHandler.cxx|   34 ++
 writerfilter/source/dmapper/BorderHandler.hxx|8 
 writerfilter/source/dmapper/DomainMapper.cxx |   40 ++-
 writerfilter/source/dmapper/PropertyIds.cxx  |8 
 writerfilter/source/dmapper/PropertyIds.hxx  |   11 
 writerfilter/source/dmapper/TDefTableHandler.cxx |   22 +
 writerfilter/source/dmapper/TDefTableHandler.hxx |   12 -
 16 files changed, 370 insertions(+), 112 deletions(-)

New commits:
commit 92fc0ace46398eeb6c9238c8292459cc78db6694
Author: Tomaž Vajngerl 
AuthorDate: Sat Jun 10 22:25:43 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Mon Jun 12 03:54:48 2023 +0200

ooxml: import and export border theme colors for various props.

This adds support to import and export various border (lines)
theme color properties.

SvxBoxItem needed to be fixed, because it can happen that the
BorderLine is not yet initialised and we already set the border's
ComplexColor. Now there is a maTempComplexColor inside SvxBoxItem,
which stores the ComplexColor until the specific BorderLine is
initialized.

In addition add roundtrip test for import and export cycle.

Change-Id: Idd307a3adaf364745aed8fc8540bf72ef4948198
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152833
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/editeng/source/items/frmitems.cxx 
b/editeng/source/items/frmitems.cxx
index 77c497079634..94b7704303ba 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -2301,6 +2301,7 @@ SvxBoxItem::SvxBoxItem(const SvxBoxItem& rCopy)
 , mnBottomDistance(rCopy.mnBottomDistance)
 , mnLeftDistance(rCopy.mnLeftDistance)
 , mnRightDistance(rCopy.mnRightDistance)
+, maTempComplexColors(rCopy.maTempComplexColors)
 , mbRemoveAdjCellBorder(rCopy.mbRemoveAdjCellBorder)
 {
 }
@@ -2369,6 +2370,7 @@ bool SvxBoxItem::operator==( const SfxPoolItem& rAttr ) 
const
 (mnLeftDistance == rBoxItem.mnLeftDistance) &&
 (mnRightDistance == rBoxItem.mnRightDistance) &&
 (mbRemoveAdjCellBorder == rBoxItem.mbRemoveAdjCellBorder ) &&
+(maTempComplexColors == rBoxItem.maTempComplexColors) &&
 CompareBorderLine(mpTopBorderLine, rBoxItem.GetTop()) &&
 CompareBorderLine(mpBottomBorderLine, rBoxItem.GetBottom()) &&
 CompareBorderLine(mpLeftBorderLine, rBoxItem.GetLeft()) &&
@@ -2462,8 +2464,11 @@ bool SvxBoxItem::QueryValue( uno::Any& rVal, sal_uInt8 
nMemberId ) const
 {
 if (mpBottomBorderLine)
 {
-auto xComplexColor = 
model::color::createXComplexColor(mpBottomBorderLine->getComplexColor());
-rVal <<= xComplexColor;
+rVal <<= 
model::color::createXComplexColor(mpBottomBorderLine->getComplexColor());
+}
+else if 
(maTempComplexColors[size_t(SvxBoxItemLine::BOTTOM)].getType() != 
model::ColorType::Unused)
+{
+rVal <<= 
model::color::createXComplexColor(maTempComplexColors[size_t(SvxBoxItemLine::BOTTOM)]);
 }
 return true;
 }
@@ -2471,8 +2476,11 @@ bool SvxBoxItem::QueryValue( uno::Any& rVal, sal_uInt8 
nMemberId ) const
 {
 if (mpLeftBorderLine)
 {
-auto xComplexColor = 
model::color::createXComplexColor(mpLeftBorderLine->getComplexColor());
-rVal <<= xComplexColor;
+rVal <<= 
model::color::createXComplexColor(mpLeftBorderLine->getComplexColor());
+}
+else if 
(maTempComplexColors[size_t(SvxBoxItemLine::LEFT)].getType() != 
model::ColorType::Unused)
+{
+rVal <<= 
model::color::createXComplexColor(maTempComplexColors[size_t(SvxBoxItemLine::LEFT)]);
 }
 return true;
 }
@@ -2480,8 +2488,11 @@ bool SvxBoxItem::QueryValue( uno::Any& rVal, sal_uInt8 
nMemberId ) const
 {
 if (mpRightBorderLine)
 {
-auto xComplexColor = 
model::color::createXComplexColor(mpRightBorderLine->getComplexColor());
-rVal <<= xComplexColor;
+rVal <<= 
model::color::createXComplexColor(mpRightBorderLine->getComplexColor());
+  

[Libreoffice-commits] core.git: writerfilter/source

2023-06-10 Thread Tomaž Vajngerl (via logerrit)
 writerfilter/source/ooxml/model.xml |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 3a6d360b5e585b8e92cc0d58d5fbc497448e11fb
Author: Tomaž Vajngerl 
AuthorDate: Sat Jun 10 22:22:17 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Sun Jun 11 02:27:33 2023 +0200

oox: fix theme data in model.xml to use a correct types

Change-Id: Ifaa725d8a3e6c4cfefc92a6c5fcdb581610d3ce6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152832
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/writerfilter/source/ooxml/model.xml 
b/writerfilter/source/ooxml/model.xml
index 888ffeba173c..526fbc223c16 100644
--- a/writerfilter/source/ooxml/model.xml
+++ b/writerfilter/source/ooxml/model.xml
@@ -10997,13 +10997,13 @@
   
 
 
-  
+  
 
 
-  
+  
 
 
-  
+  
 
   
   
@@ -12591,13 +12591,13 @@
   
 
 
-  
+  
 
 
-  
+  
 
 
-  
+  
 
 
   


[Libreoffice-commits] core.git: include/oox oox/source

2023-06-09 Thread Tomaž Vajngerl (via logerrit)
 include/oox/drawingml/color.hxx  |3 ++
 oox/source/drawingml/color.cxx   |   24 +++
 oox/source/drawingml/fillproperties.cxx  |   16 +--
 oox/source/drawingml/textcharacterproperties.cxx |   15 --
 4 files changed, 30 insertions(+), 28 deletions(-)

New commits:
commit c1470e15bd0643be8d91aaf6a0d25c78867d0b3e
Author: Tomaž Vajngerl 
AuthorDate: Fri Jun 9 23:34:24 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Fri Jun 9 17:59:48 2023 +0200

oox: remove code duplication and add getComplexColor to oox::Color

Change-Id: I9cfbc851d4f303a5a8c92183f01cb5b6545b7984
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152800
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/include/oox/drawingml/color.hxx b/include/oox/drawingml/color.hxx
index 75812c200c28..245e655d7c78 100644
--- a/include/oox/drawingml/color.hxx
+++ b/include/oox/drawingml/color.hxx
@@ -30,6 +30,7 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace oox { class GraphicHelper; }
 
@@ -117,6 +118,8 @@ public:
 /// Compares this color with rOther.
 bool equals(const Color& rOther, const GraphicHelper& rGraphicHelper, 
::Color nPhClr) const;
 
+model::ComplexColor getComplexColor() const;
+
 private:
 /** Internal helper for getColor(). */
 voidsetResolvedRgb( ::Color nRgb ) const;
diff --git a/oox/source/drawingml/color.cxx b/oox/source/drawingml/color.cxx
index 805ca6c4faed..ad0b5ca7835e 100644
--- a/oox/source/drawingml/color.cxx
+++ b/oox/source/drawingml/color.cxx
@@ -571,6 +571,30 @@ sal_Int16 Color::getLumOff() const
 return 0;
 }
 
+model::ComplexColor Color::getComplexColor() const
+{
+model::ComplexColor aComplexColor;
+
aComplexColor.setSchemeColor(model::convertToThemeColorType(getSchemeColorIndex()));
+
+if (getTintOrShade() > 0)
+{
+aComplexColor.addTransformation({model::TransformationType::Tint, 
getTintOrShade()});
+}
+else if (getTintOrShade() < 0)
+{
+sal_Int16 nShade = o3tl::narrowing(-getTintOrShade());
+aComplexColor.addTransformation({model::TransformationType::Shade, 
nShade});
+}
+
+if (getLumMod() != 1)
+aComplexColor.addTransformation({model::TransformationType::LumMod, 
getLumMod()});
+
+if (getLumOff() != 0)
+aComplexColor.addTransformation({model::TransformationType::LumOff, 
getLumOff()});
+
+return aComplexColor;
+}
+
 ::Color Color::getColor( const GraphicHelper& rGraphicHelper, ::Color nPhClr ) 
const
 {
 const sal_Int32 nTempC1 = mnC1;
diff --git a/oox/source/drawingml/fillproperties.cxx 
b/oox/source/drawingml/fillproperties.cxx
index 705f2dc3b55a..7e2f5185b7f6 100644
--- a/oox/source/drawingml/fillproperties.cxx
+++ b/oox/source/drawingml/fillproperties.cxx
@@ -431,24 +431,12 @@ void FillProperties::pushToPropMap(ShapePropertyMap& 
rPropMap, const GraphicHelp
 if (aFillColor == nPhClr)
 {
 
aComplexColor.setSchemeColor(model::convertToThemeColorType(nPhClrTheme));
-rPropMap.setProperty(PROP_FillComplexColor, 
model::color::createXComplexColor(aComplexColor));
 }
 else
 {
-
aComplexColor.setSchemeColor(model::convertToThemeColorType(maFillColor.getSchemeColorIndex()));
-if (maFillColor.getLumMod() != 1)
-
aComplexColor.addTransformation({model::TransformationType::LumMod, 
maFillColor.getLumMod()});
-if (maFillColor.getLumOff() != 0)
-
aComplexColor.addTransformation({model::TransformationType::LumOff, 
maFillColor.getLumOff()});
-if (maFillColor.getTintOrShade() > 0)
-
aComplexColor.addTransformation({model::TransformationType::Tint, 
maFillColor.getTintOrShade()});
-if (maFillColor.getTintOrShade() < 0)
-{
-sal_Int16 nShade = 
o3tl::narrowing(-maFillColor.getTintOrShade());
-
aComplexColor.addTransformation({model::TransformationType::Shade, nShade});
-}
-rPropMap.setProperty(PROP_FillComplexColor, 
model::color::createXComplexColor(aComplexColor));
+aComplexColor = maFillColor.getComplexColor();
 }
+rPropMap.setProperty(PROP_FillComplexColor, 
model::color::createXComplexColor(aComplexColor));
 
 eFillStyle = FillStyle_SOLID;
 }
diff --git a/oox/source/drawingml/textcharacterproperties.cxx 
b/oox/source/drawingml/textcharacterproperties.cxx
index 7d3dda284680..0e1e2830a67f 100644
--- a/oox/source/drawingml/textcharacterproperties.cxx
+++ b/oox/source/drawingml/textcharacterproperties.cxx
@@ -136,20 +136,7 @@ void TextCharacterProperties::pushToPropMap( PropertyMap& 

[Libreoffice-commits] core.git: docmodel/source editeng/source svx/source sw/source

2023-06-09 Thread Tomaž Vajngerl (via logerrit)
 docmodel/source/color/ComplexColorJSON.cxx|   52 +-
 editeng/source/items/textitem.cxx |9 ++--
 svx/source/theme/ThemeColorPaletteManager.cxx |2 -
 sw/source/filter/ww8/docxattributeoutput.cxx  |4 +-
 4 files changed, 35 insertions(+), 32 deletions(-)

New commits:
commit 7d2a7307da71b245fe55c55c5a29f4695c3c54f7
Author: Tomaž Vajngerl 
AuthorDate: Fri Jun 9 16:06:37 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Fri Jun 9 14:12:18 2023 +0200

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 

diff --git a/docmodel/source/color/ComplexColorJSON.cxx 
b/docmodel/source/color/ComplexColorJSON.cxx
index db36f29e6a4e..f6b52d1bf55c 100644
--- a/docmodel/source/color/ComplexColorJSON.cxx
+++ b/docmodel/source/color/ComplexColorJSON.cxx
@@ -18,40 +18,42 @@ namespace model::color
 bool convertFromJSON(OString const& rJsonString, model::ComplexColor& 
rComplexColor)
 {
 model::ComplexColor aComplexColor;
-std::stringstream aStream((std::string(rJsonString)));
-boost::property_tree::ptree aRootTree;
+
 try
 {
+std::stringstream aStream((std::string(rJsonString)));
+boost::property_tree::ptree aRootTree;
 boost::property_tree::read_json(aStream, aRootTree);
+
+sal_Int32 nThemeType = aRootTree.get("ThemeIndex", -1);
+
aComplexColor.setSchemeColor(model::convertToThemeColorType(nThemeType));
+boost::property_tree::ptree aTransformTree = 
aRootTree.get_child("Transformations");
+for (const auto& rEachTransformationNode :
+ boost::make_iterator_range(aTransformTree.equal_range("")))
+{
+auto const& rTransformationTree = rEachTransformationNode.second;
+std::string sType = rTransformationTree.get("Type", 
"");
+sal_Int16 nValue = rTransformationTree.get("Value", 0);
+
+auto eType = model::TransformationType::Undefined;
+if (sType == "LumOff")
+eType = model::TransformationType::LumOff;
+else if (sType == "LumMod")
+eType = model::TransformationType::LumMod;
+else if (sType == "Tint")
+eType = model::TransformationType::Tint;
+else if (sType == "Shade")
+eType = model::TransformationType::Shade;
+
+if (eType != model::TransformationType::Undefined)
+aComplexColor.addTransformation({ eType, nValue });
+}
 }
 catch (const boost::property_tree::json_parser_error& /*exception*/)
 {
 return false;
 }
 
-sal_Int32 nThemeType = aRootTree.get("ThemeIndex", -1);
-aComplexColor.setSchemeColor(model::convertToThemeColorType(nThemeType));
-boost::property_tree::ptree aTransformTree = 
aRootTree.get_child("Transformations");
-for (const auto& rEachTransformationNode :
- boost::make_iterator_range(aTransformTree.equal_range("")))
-{
-auto const& rTransformationTree = rEachTransformationNode.second;
-std::string sType = rTransformationTree.get("Type", "");
-sal_Int16 nValue = rTransformationTree.get("Value", 0);
-
-auto eType = model::TransformationType::Undefined;
-if (sType == "LumOff")
-eType = model::TransformationType::LumOff;
-else if (sType == "LumMod")
-eType = model::TransformationType::LumMod;
-else if (sType == "Tint")
-eType = model::TransformationType::Tint;
-else if (sType == "Shade")
-eType = model::TransformationType::Shade;
-
-if (eType != model::TransformationType::Undefined)
-aComplexColor.addTransformation({ eType, nValue });
-}
 rComplexColor = aComplexColor;
 return true;
 }
diff --git a/editeng/source/items/textitem.cxx 
b/editeng/source/items/textitem.cxx
index 2f11ab7bb9b2..546918197a34 100644
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -1555,11 +1555,11 @@ bool SvxColorItem::PutValue( const uno::Any& rVal, 
sal_uInt8 nMemberId )
 return false;
 
 if (sComplexColorJson.isEmpty())
-{
 return false;
-}
+
 OString aJSON = OUStringToOString(sComplexColorJson, 
RTL_TEXTENCODING_ASCII_US);
-model::color::convertFromJSON(aJSON, maComplexColor);
+if (!model::color::convertFromJSON(aJSON, maComplexColor))
+return false;
 }
 break;
 case MID_COMPLEX_COLOR:
@@ -1575,7 +1575,8 @@ bool SvxColorItem::PutValue( const uno::Any& rVal, 
sal_uInt8 nMemberId )
 case MID_COLOR_RGB:
 

[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - include/docmodel oox/qa sw/CppunitTest_sw_ooxml_theme_export.mk sw/Library_msword.mk sw/Module_sw.mk sw/qa sw/source writerfilter/source

2023-06-09 Thread Tomaž Vajngerl (via logerrit)
 include/docmodel/color/ComplexColor.hxx |1 
 include/docmodel/theme/ThemeColorType.hxx   |7 
 oox/qa/unit/export.cxx  |4 
 sw/CppunitTest_sw_ooxml_theme_export.mk |   53 +
 sw/Library_msword.mk|1 
 sw/Module_sw.mk |1 
 sw/qa/core/theme/ThemeTest.cxx  |   12 
 sw/qa/extras/ooxmlexport/data/Test_ThemePortionLevel_CharColor.docx |binary
 sw/qa/extras/ooxmlexport/data/Test_ThemePortionLevel_CharColor.fodt |  420 
++
 sw/qa/extras/ooxmlexport/ooxml_ThemeExport.cxx  |   56 +
 sw/source/filter/ww8/docxattributeoutput.cxx|  119 ++
 writerfilter/source/dmapper/DomainMapper.cxx|8 
 writerfilter/source/dmapper/TDefTableHandler.cxx|   16 
 writerfilter/source/dmapper/TDefTableHandler.hxx|1 
 14 files changed, 668 insertions(+), 31 deletions(-)

New commits:
commit 558f4297561d6ea4940f0fb984b2b4e838ce19ab
Author: Tomaž Vajngerl 
AuthorDate: Wed Jun 7 23:29:05 2023 +0900
Commit: Xisco Fauli 
CommitDate: Fri Jun 9 09:13:44 2023 +0200

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 
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 17105fc44bceea61ff8876686cc1362aa787ead2)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152668
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/include/docmodel/color/ComplexColor.hxx 
b/include/docmodel/color/ComplexColor.hxx
index 958f82f19b4e..19e228b2a858 100644
--- a/include/docmodel/color/ComplexColor.hxx
+++ b/include/docmodel/color/ComplexColor.hxx
@@ -88,6 +88,7 @@ public:
 ::Color maLastColor;
 
 ThemeColorType meSchemeType = ThemeColorType::Unknown;
+ThemeColorUsage meThemeColorUsage = ThemeColorUsage::Unknown;
 std::vector maTransformations;
 
 ::Color maFinalColor;
diff --git a/include/docmodel/theme/ThemeColorType.hxx 
b/include/docmodel/theme/ThemeColorType.hxx
index a8ed9a56a6dc..04e7f5068f1b 100644
--- a/include/docmodel/theme/ThemeColorType.hxx
+++ b/include/docmodel/theme/ThemeColorType.hxx
@@ -31,6 +31,13 @@ enum class ThemeColorType : sal_Int32
 LAST = FollowedHyperlink
 };
 
+enum class ThemeColorUsage
+{
+Unknown = 0,
+Text,
+Background
+};
+
 constexpr ThemeColorType convertToThemeColorType(sal_Int32 nIndex)
 {
 if (nIndex < 0 || nIndex > 11)
diff --git a/oox/qa/unit/export.cxx b/oox/qa/unit/export.cxx
index 8a17f352716b..3922726306b3 100644
--- a/oox/qa/unit/export.cxx
+++ b/oox/qa/unit/export.cxx
@@ -963,7 +963,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFontworkThemeColor)
 
 // Make sure the fallback in  has correct values
 assertXPath(pXmlDoc, sElement + "w:color", "val", "948A54");
-assertXPath(pXmlDoc, sElement + "w:color", "themeColor", "background2");
+assertXPath(pXmlDoc, sElement + "w:color", "themeColor", "light2");
 assertXPath(pXmlDoc, sElement + "w:color", "themeShade", "80");
 
 // ... and w14:textFill exists and has correct values.
@@ -977,7 +977,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFontworkThemeColor)
 
 // Make sure the fallback in  has correct values
 assertXPath(pXmlDoc, sElement + "w:color", "val", "558ED5");
-assertXPath(pXmlDoc, sElement + "w:color", "themeColor", "text2");
+assertXPath(pXmlDoc, sElement + "w:color", "themeColor", "dark2");
 assertXPath(pXmlDoc, sElement + "w:color", "themeTint", "99");
 
 // ... and w14:textFill exists and has correct values.
diff --git a/sw/CppunitTest_sw_ooxml_theme_export.mk 
b/sw/CppunitTest_sw_ooxml_theme_export.mk
new file mode 100644
index ..8e4f94fc5cc6
--- /dev/null
+++ b/sw/CppunitTest_sw_ooxml_theme_export.mk
@@ -0,0 +1,53 @@
+# -*- Mode: makefile-gmake; tab-width: 4; 

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - svx/sdi svx/source

2023-06-08 Thread Tomaž Vajngerl (via logerrit)
 svx/sdi/xoitems.sdi|   16 +++--
 svx/source/tbxctrls/PaletteManager.cxx |2 +
 svx/source/xoutdev/xattr.cxx   |   40 +
 3 files changed, 56 insertions(+), 2 deletions(-)

New commits:
commit 1ff0a84e1f9cd82b750217e1c4042e385d5978dd
Author: Tomaž Vajngerl 
AuthorDate: Thu Jun 8 01:36:27 2023 +0900
Commit: Miklos Vajna 
CommitDate: Thu Jun 8 11:52:30 2023 +0200

tdf#155404 handle ComplexColor as JSON for XLineColor and XFillColor

This adds support for MID_COMPLEX_COLOR_JSON attribute for
XLineColorItem and XFillColorItem, which makes it possible to set
a theme colors from the UI also for fills and lines.

In addition this resolved the issue tdf#155404 which had the effect
that unsupported "Color" attribute for the UNO call resulted that
the dialog was opened. This is now not the case anymore as the
"Color" argument for XLineColorItem and XFillColorItem was added
in addition to "ComplexColorJSON" argument.

Change-Id: I8876942b07aba453cbe1422b76a1608c78e42109
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152713
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 5a2c6f4df7149f8c1f543f120fe19bd66abfc189)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152722
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/svx/sdi/xoitems.sdi b/svx/sdi/xoitems.sdi
index 015ead6e0d72..50db129a6434 100644
--- a/svx/sdi/xoitems.sdi
+++ b/svx/sdi/xoitems.sdi
@@ -24,7 +24,13 @@ struct XFillBitmap
 };
 item XFillBitmap XFillBitmapItem;
 
-item INT32  XFillColorItem; // XColorItem
+struct XFillColor
+{
+INT32 Color MID_COLOR_RGB;
+String ComplexColorJSON MID_COMPLEX_COLOR_JSON;
+};
+
+item XFillColor XFillColorItem; // XColorItem
 
 enum SvxGradientStyle
 {
@@ -84,7 +90,13 @@ item SvxFillStyle XFillStyleItem;
 
 //item String XLineAttrSetItem; SfxSetItem!
 
-item INT32  XLineColorItem;
+struct XLineColor
+{
+INT32  Color MID_COLOR_RGB;
+String ComplexColorJSON MID_COMPLEX_COLOR_JSON;
+};
+
+item XLineColor XLineColorItem;
 
 enum SvxDashStyle
 {
diff --git a/svx/source/tbxctrls/PaletteManager.cxx 
b/svx/source/tbxctrls/PaletteManager.cxx
index 3fb713f50a6e..082b07f94c92 100644
--- a/svx/source/tbxctrls/PaletteManager.cxx
+++ b/svx/source/tbxctrls/PaletteManager.cxx
@@ -428,6 +428,8 @@ void PaletteManager::DispatchColorCommand(const OUString& 
aCommand, const NamedC
 comphelper::makePropertyValue(aObj.GetURLPath()+ ".Color", 
sal_Int32(rColor.m_aColor)),
 };
 
+printf ("Sending: %s\n", aObj.GetURLPath().toUtf8().getStr());
+
 if (rColor.m_nThemeIndex != -1)
 {
 model::ComplexColor aComplexColor;
diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx
index 4860373836a8..d3fd73f5fa04 100644
--- a/svx/source/xoutdev/xattr.cxx
+++ b/svx/source/xoutdev/xattr.cxx
@@ -37,6 +37,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1002,6 +1003,11 @@ bool XLineColorItem::QueryValue( css::uno::Any& rVal, 
sal_uInt8 nMemberId) const
 rVal <<= xComplexColor;
 break;
 }
+case MID_COMPLEX_COLOR_JSON:
+{
+rVal <<= 
OStringToOUString(model::color::convertToJSON(getComplexColor()), 
RTL_TEXTENCODING_UTF8);
+break;
+}
 default:
 {
 rVal <<= GetColorValue().GetRGBColor();
@@ -1024,6 +1030,20 @@ bool XLineColorItem::PutValue( const css::uno::Any& 
rVal, sal_uInt8 nMemberId)
 setComplexColor(model::color::getFromXComplexColor(xComplexColor));
 }
 break;
+case MID_COMPLEX_COLOR_JSON:
+{
+OUString sComplexColorJson;
+if (!(rVal >>= sComplexColorJson))
+return false;
+
+if (sComplexColorJson.isEmpty())
+return false;
+model::ComplexColor aComplexColor;
+OString aJSON = OUStringToOString(sComplexColorJson, 
RTL_TEXTENCODING_ASCII_US);
+model::color::convertFromJSON(aJSON, aComplexColor);
+setComplexColor(aComplexColor);
+}
+break;
 default:
 {
 sal_Int32 nValue;
@@ -1985,6 +2005,11 @@ bool XFillColorItem::QueryValue( css::uno::Any& rVal, 
sal_uInt8 nMemberId ) cons
 rVal <<= xComplexColor;
 break;
 }
+case MID_COMPLEX_COLOR_JSON:
+{
+rVal <<= 
OStringToOUString(model::color::convertToJSON(getComplexColor()), 
RTL_TEXTENCODING_UTF8);
+break;
+}
 default:
 {
 rVal <<= GetColorValue().GetRGBColor();
@@ -2034,6 +2059,21 @@ bool XFillColorItem::PutValue( const css::uno::Any& 
rVal, sal_uInt8 nMemberId )
 setComplexColor(model::color::getFromXComplexColor(xComplexColor));
 }
 break;
+case 

[Libreoffice-commits] core.git: svx/sdi svx/source

2023-06-08 Thread Tomaž Vajngerl (via logerrit)
 svx/sdi/svxitems.sdi |8 -
 svx/source/xoutdev/xattr.cxx |   64 ++-
 2 files changed, 65 insertions(+), 7 deletions(-)

New commits:
commit ac2838a9cd5577f92dbece130fa6fb8b8e26e6cd
Author: Tomaž Vajngerl 
AuthorDate: Thu Jun 8 15:17:38 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Thu Jun 8 11:13:28 2023 +0200

svx: add "Color" and "ComplexColorJSON" argument for XColorItem

This is needed now that the color picker expects this argument to
be present. Without the "ComplexColorJSON" argument, it is not
possible for the color picker to set any ComplexColor attributes,
which is needed for theme support.

Change-Id: I0a04ea57826afb9f17a54ce24a4cbcc88dfe1481
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152727
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/svx/sdi/svxitems.sdi b/svx/sdi/svxitems.sdi
index eabb753f647a..6e8773315d29 100644
--- a/svx/sdi/svxitems.sdi
+++ b/svx/sdi/svxitems.sdi
@@ -214,7 +214,13 @@ item String SvxPatternListItem;
 item String SfxLockBytesItem;
 item String SvxFontListItem;
 item String avmedia_MediaItem;
-item INT32  XColorItem;
+struct XColor
+{
+INT32  ColorMID_COLOR_RGB;
+String ComplexColorJSON MID_COMPLEX_COLOR_JSON;
+};
+item XColor XColorItem;
+
 item INT16  SdrPercentItem;
 item INT32  SdrMetricItem;
 
diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx
index d3fd73f5fa04..3cb12c467b74 100644
--- a/svx/source/xoutdev/xattr.cxx
+++ b/svx/source/xoutdev/xattr.cxx
@@ -306,18 +306,70 @@ const Color& XColorItem::GetColorValue() const
 
 }
 
-bool XColorItem::QueryValue( css::uno::Any& rVal, sal_uInt8 /*nMemberId*/) 
const
+bool XColorItem::QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId) const
 {
-rVal <<= GetColorValue().GetRGBColor();
+nMemberId &= ~CONVERT_TWIPS;
+switch (nMemberId)
+{
+case MID_COMPLEX_COLOR:
+{
+auto xComplexColor = 
model::color::createXComplexColor(getComplexColor());
+rVal <<= xComplexColor;
+break;
+}
+case MID_COMPLEX_COLOR_JSON:
+{
+rVal <<= 
OStringToOUString(model::color::convertToJSON(getComplexColor()), 
RTL_TEXTENCODING_UTF8);
+break;
+}
+default:
+{
+rVal <<= GetColorValue().GetRGBColor();
+break;
+}
+}
 return true;
 }
 
-bool XColorItem::PutValue( const css::uno::Any& rVal, sal_uInt8 /*nMemberId*/)
+bool XColorItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId)
 {
-Color nValue;
-rVal >>= nValue;
-SetColorValue( nValue );
+nMemberId &= ~CONVERT_TWIPS;
+switch (nMemberId)
+{
+case MID_COMPLEX_COLOR:
+{
+css::uno::Reference xComplexColor;
+if (!(rVal >>= xComplexColor))
+return false;
+setComplexColor(model::color::getFromXComplexColor(xComplexColor));
+}
+break;
+case MID_COMPLEX_COLOR_JSON:
+{
+OUString sComplexColorJson;
+if (!(rVal >>= sComplexColorJson))
+return false;
+
+if (sComplexColorJson.isEmpty())
+return false;
+
+OString aJSON = OUStringToOString(sComplexColorJson, 
RTL_TEXTENCODING_ASCII_US);
+model::ComplexColor aComplexColor;
+model::color::convertFromJSON(aJSON, aComplexColor);
+setComplexColor(aComplexColor);
+}
+break;
+default:
+{
+Color nValue;
+if(!(rVal >>= nValue ))
+return false;
+
+SetColorValue( nValue );
 
+}
+break;
+}
 return true;
 }
 


[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - svx/sdi svx/source

2023-06-08 Thread Tomaž Vajngerl (via logerrit)
 svx/sdi/xoitems.sdi|   16 +++--
 svx/source/tbxctrls/PaletteManager.cxx |2 +
 svx/source/xoutdev/xattr.cxx   |   40 +
 3 files changed, 56 insertions(+), 2 deletions(-)

New commits:
commit d915ea96cf9190ada63a14ca84ee96f5a946d94b
Author: Tomaž Vajngerl 
AuthorDate: Thu Jun 8 01:36:27 2023 +0900
Commit: Xisco Fauli 
CommitDate: Thu Jun 8 10:52:37 2023 +0200

tdf#155404 handle ComplexColor as JSON for XLineColor and XFillColor

This adds support for MID_COMPLEX_COLOR_JSON attribute for
XLineColorItem and XFillColorItem, which makes it possible to set
a theme colors from the UI also for fills and lines.

In addition this resolved the issue tdf#155404 which had the effect
that unsupported "Color" attribute for the UNO call resulted that
the dialog was opened. This is now not the case anymore as the
"Color" argument for XLineColorItem and XFillColorItem was added
in addition to "ComplexColorJSON" argument.

Change-Id: I8876942b07aba453cbe1422b76a1608c78e42109
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152713
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 5a2c6f4df7149f8c1f543f120fe19bd66abfc189)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152666
Reviewed-by: Xisco Fauli 

diff --git a/svx/sdi/xoitems.sdi b/svx/sdi/xoitems.sdi
index 015ead6e0d72..50db129a6434 100644
--- a/svx/sdi/xoitems.sdi
+++ b/svx/sdi/xoitems.sdi
@@ -24,7 +24,13 @@ struct XFillBitmap
 };
 item XFillBitmap XFillBitmapItem;
 
-item INT32  XFillColorItem; // XColorItem
+struct XFillColor
+{
+INT32 Color MID_COLOR_RGB;
+String ComplexColorJSON MID_COMPLEX_COLOR_JSON;
+};
+
+item XFillColor XFillColorItem; // XColorItem
 
 enum SvxGradientStyle
 {
@@ -84,7 +90,13 @@ item SvxFillStyle XFillStyleItem;
 
 //item String XLineAttrSetItem; SfxSetItem!
 
-item INT32  XLineColorItem;
+struct XLineColor
+{
+INT32  Color MID_COLOR_RGB;
+String ComplexColorJSON MID_COMPLEX_COLOR_JSON;
+};
+
+item XLineColor XLineColorItem;
 
 enum SvxDashStyle
 {
diff --git a/svx/source/tbxctrls/PaletteManager.cxx 
b/svx/source/tbxctrls/PaletteManager.cxx
index b56248825600..141938d145d7 100644
--- a/svx/source/tbxctrls/PaletteManager.cxx
+++ b/svx/source/tbxctrls/PaletteManager.cxx
@@ -427,6 +427,8 @@ void PaletteManager::DispatchColorCommand(const OUString& 
aCommand, const NamedC
 comphelper::makePropertyValue(aObj.GetURLPath()+ ".Color", 
sal_Int32(rColor.m_aColor)),
 };
 
+printf ("Sending: %s\n", aObj.GetURLPath().toUtf8().getStr());
+
 if (rColor.m_nThemeIndex != -1)
 {
 model::ComplexColor aComplexColor;
diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx
index 4860373836a8..d3fd73f5fa04 100644
--- a/svx/source/xoutdev/xattr.cxx
+++ b/svx/source/xoutdev/xattr.cxx
@@ -37,6 +37,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1002,6 +1003,11 @@ bool XLineColorItem::QueryValue( css::uno::Any& rVal, 
sal_uInt8 nMemberId) const
 rVal <<= xComplexColor;
 break;
 }
+case MID_COMPLEX_COLOR_JSON:
+{
+rVal <<= 
OStringToOUString(model::color::convertToJSON(getComplexColor()), 
RTL_TEXTENCODING_UTF8);
+break;
+}
 default:
 {
 rVal <<= GetColorValue().GetRGBColor();
@@ -1024,6 +1030,20 @@ bool XLineColorItem::PutValue( const css::uno::Any& 
rVal, sal_uInt8 nMemberId)
 setComplexColor(model::color::getFromXComplexColor(xComplexColor));
 }
 break;
+case MID_COMPLEX_COLOR_JSON:
+{
+OUString sComplexColorJson;
+if (!(rVal >>= sComplexColorJson))
+return false;
+
+if (sComplexColorJson.isEmpty())
+return false;
+model::ComplexColor aComplexColor;
+OString aJSON = OUStringToOString(sComplexColorJson, 
RTL_TEXTENCODING_ASCII_US);
+model::color::convertFromJSON(aJSON, aComplexColor);
+setComplexColor(aComplexColor);
+}
+break;
 default:
 {
 sal_Int32 nValue;
@@ -1985,6 +2005,11 @@ bool XFillColorItem::QueryValue( css::uno::Any& rVal, 
sal_uInt8 nMemberId ) cons
 rVal <<= xComplexColor;
 break;
 }
+case MID_COMPLEX_COLOR_JSON:
+{
+rVal <<= 
OStringToOUString(model::color::convertToJSON(getComplexColor()), 
RTL_TEXTENCODING_UTF8);
+break;
+}
 default:
 {
 rVal <<= GetColorValue().GetRGBColor();
@@ -2034,6 +2059,21 @@ bool XFillColorItem::PutValue( const css::uno::Any& 
rVal, sal_uInt8 nMemberId )
 setComplexColor(model::color::getFromXComplexColor(xComplexColor));
 }
 break;
+case MID_COMPLEX_COLOR_JSON:
+{
+   

[Libreoffice-commits] core.git: 2 commits - include/docmodel oox/qa sw/CppunitTest_sw_ooxml_theme_export.mk sw/Library_msword.mk sw/Module_sw.mk sw/qa sw/source writerfilter/source

2023-06-07 Thread Tomaž Vajngerl (via logerrit)
 include/docmodel/color/ComplexColor.hxx |1 
 include/docmodel/theme/ThemeColorType.hxx   |7 
 oox/qa/unit/export.cxx  |4 
 sw/CppunitTest_sw_ooxml_theme_export.mk |   53 +
 sw/Library_msword.mk|1 
 sw/Module_sw.mk |1 
 sw/qa/core/theme/ThemeTest.cxx  |   12 
 sw/qa/extras/ooxmlexport/data/Test_ThemePortionLevel_CharColor.docx |binary
 sw/qa/extras/ooxmlexport/data/Test_ThemePortionLevel_CharColor.fodt |  420 
++
 sw/qa/extras/ooxmlexport/ooxml_ThemeExport.cxx  |   56 +
 sw/source/filter/ww8/docxattributeoutput.cxx|  119 ++
 sw/source/filter/ww8/docxexport.cxx |   37 
 writerfilter/source/dmapper/DomainMapper.cxx|8 
 writerfilter/source/dmapper/TDefTableHandler.cxx|   16 
 writerfilter/source/dmapper/TDefTableHandler.hxx|1 
 15 files changed, 679 insertions(+), 57 deletions(-)

New commits:
commit fcccb8f8d67dd7deec772746661d2d6dff2c14a3
Author: Tomaž Vajngerl 
AuthorDate: Thu Jun 8 12:37:21 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Thu Jun 8 07:45:21 2023 +0200

sw: use ThemeExport instead of grab bag

Change-Id: I68d300d58aaa1e5da374a8ddea4ff37e9a1e1819
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152723
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/sw/source/filter/ww8/docxexport.cxx 
b/sw/source/filter/ww8/docxexport.cxx
index af9979a1d660..f7258952a541 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -48,11 +48,14 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
 
+#include 
+
 #include 
 #include 
 #include 
@@ -62,6 +65,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include "wrtww8.hxx"
@@ -74,6 +78,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -1466,35 +1471,15 @@ void DocxExport::WriteSettings()
 
 void DocxExport::WriteTheme()
 {
-uno::Reference< beans::XPropertySet > xPropSet( 
m_rDoc.GetDocShell()->GetBaseModel(), uno::UNO_QUERY_THROW );
-
-uno::Reference< beans::XPropertySetInfo > xPropSetInfo = 
xPropSet->getPropertySetInfo();
-OUString aName = UNO_NAME_MISC_OBJ_INTEROPGRABBAG;
-if ( !xPropSetInfo->hasPropertyByName( aName ) )
+SdrPage* pPage = 
m_rDoc.getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0);
+auto const& pTheme = pPage->getSdrPageProperties().GetTheme();
+if (!pTheme)
 return;
 
-uno::Reference themeDom;
-uno::Sequence< beans::PropertyValue > propList;
-xPropSet->getPropertyValue( aName ) >>= propList;
-auto pProp = std::find_if(std::cbegin(propList), std::cend(propList),
-[](const beans::PropertyValue& rProp) { return rProp.Name == 
"OOXTheme"; });
-if (pProp != std::cend(propList))
-pProp->Value >>= themeDom;
-
-// no theme dom to write
-if ( !themeDom.is() )
-return;
-
-m_rFilter.addRelation( m_pDocumentFS->getOutputStream(),
-oox::getRelationship(Relationship::THEME),
-u"theme/theme1.xml" );
+m_rFilter.addRelation(m_pDocumentFS->getOutputStream(), 
oox::getRelationship(Relationship::THEME), u"theme/theme1.xml" );
 
-uno::Reference< xml::sax::XSAXSerializable > serializer( themeDom, 
uno::UNO_QUERY );
-uno::Reference< xml::sax::XWriter > writer = xml::sax::Writer::create( 
comphelper::getProcessComponentContext() );
-writer->setOutputStream( GetFilter().openFragmentStream( 
"word/theme/theme1.xml",
-"application/vnd.openxmlformats-officedocument.theme+xml" ) );
-serializer->serialize( uno::Reference< xml::sax::XDocumentHandler >( 
writer, uno::UNO_QUERY_THROW ),
-uno::Sequence< beans::StringPair >() );
+oox::ThemeExport aThemeExport(_rFilter, oox::drawingml::DOCUMENT_DOCX);
+aThemeExport.write(u"word/theme/theme1.xml", *pTheme);
 }
 
 // See OOXMLDocumentImpl::resolveGlossaryStream
commit 17105fc44bceea61ff8876686cc1362aa787ead2
Author: Tomaž Vajngerl 
AuthorDate: Wed Jun 7 23:29:05 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Thu Jun 8 07:45:13 2023 +0200

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 

[Libreoffice-commits] core.git: svx/sdi svx/source

2023-06-07 Thread Tomaž Vajngerl (via logerrit)
 svx/sdi/xoitems.sdi|   16 +++--
 svx/source/tbxctrls/PaletteManager.cxx |2 +
 svx/source/xoutdev/xattr.cxx   |   40 +
 3 files changed, 56 insertions(+), 2 deletions(-)

New commits:
commit 5a2c6f4df7149f8c1f543f120fe19bd66abfc189
Author: Tomaž Vajngerl 
AuthorDate: Thu Jun 8 01:36:27 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Thu Jun 8 01:21:44 2023 +0200

tdf#155404 handle ComplexColor as JSON for XLineColor and XFillColor

This adds support for MID_COMPLEX_COLOR_JSON attribute for
XLineColorItem and XFillColorItem, which makes it possible to set
a theme colors from the UI also for fills and lines.

In addition this resolved the issue tdf#155404 which had the effect
that unsupported "Color" attribute for the UNO call resulted that
the dialog was opened. This is now not the case anymore as the
"Color" argument for XLineColorItem and XFillColorItem was added
in addition to "ComplexColorJSON" argument.

Change-Id: I8876942b07aba453cbe1422b76a1608c78e42109
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152713
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/svx/sdi/xoitems.sdi b/svx/sdi/xoitems.sdi
index 015ead6e0d72..50db129a6434 100644
--- a/svx/sdi/xoitems.sdi
+++ b/svx/sdi/xoitems.sdi
@@ -24,7 +24,13 @@ struct XFillBitmap
 };
 item XFillBitmap XFillBitmapItem;
 
-item INT32  XFillColorItem; // XColorItem
+struct XFillColor
+{
+INT32 Color MID_COLOR_RGB;
+String ComplexColorJSON MID_COMPLEX_COLOR_JSON;
+};
+
+item XFillColor XFillColorItem; // XColorItem
 
 enum SvxGradientStyle
 {
@@ -84,7 +90,13 @@ item SvxFillStyle XFillStyleItem;
 
 //item String XLineAttrSetItem; SfxSetItem!
 
-item INT32  XLineColorItem;
+struct XLineColor
+{
+INT32  Color MID_COLOR_RGB;
+String ComplexColorJSON MID_COMPLEX_COLOR_JSON;
+};
+
+item XLineColor XLineColorItem;
 
 enum SvxDashStyle
 {
diff --git a/svx/source/tbxctrls/PaletteManager.cxx 
b/svx/source/tbxctrls/PaletteManager.cxx
index b56248825600..141938d145d7 100644
--- a/svx/source/tbxctrls/PaletteManager.cxx
+++ b/svx/source/tbxctrls/PaletteManager.cxx
@@ -427,6 +427,8 @@ void PaletteManager::DispatchColorCommand(const OUString& 
aCommand, const NamedC
 comphelper::makePropertyValue(aObj.GetURLPath()+ ".Color", 
sal_Int32(rColor.m_aColor)),
 };
 
+printf ("Sending: %s\n", aObj.GetURLPath().toUtf8().getStr());
+
 if (rColor.m_nThemeIndex != -1)
 {
 model::ComplexColor aComplexColor;
diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx
index 4860373836a8..d3fd73f5fa04 100644
--- a/svx/source/xoutdev/xattr.cxx
+++ b/svx/source/xoutdev/xattr.cxx
@@ -37,6 +37,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1002,6 +1003,11 @@ bool XLineColorItem::QueryValue( css::uno::Any& rVal, 
sal_uInt8 nMemberId) const
 rVal <<= xComplexColor;
 break;
 }
+case MID_COMPLEX_COLOR_JSON:
+{
+rVal <<= 
OStringToOUString(model::color::convertToJSON(getComplexColor()), 
RTL_TEXTENCODING_UTF8);
+break;
+}
 default:
 {
 rVal <<= GetColorValue().GetRGBColor();
@@ -1024,6 +1030,20 @@ bool XLineColorItem::PutValue( const css::uno::Any& 
rVal, sal_uInt8 nMemberId)
 setComplexColor(model::color::getFromXComplexColor(xComplexColor));
 }
 break;
+case MID_COMPLEX_COLOR_JSON:
+{
+OUString sComplexColorJson;
+if (!(rVal >>= sComplexColorJson))
+return false;
+
+if (sComplexColorJson.isEmpty())
+return false;
+model::ComplexColor aComplexColor;
+OString aJSON = OUStringToOString(sComplexColorJson, 
RTL_TEXTENCODING_ASCII_US);
+model::color::convertFromJSON(aJSON, aComplexColor);
+setComplexColor(aComplexColor);
+}
+break;
 default:
 {
 sal_Int32 nValue;
@@ -1985,6 +2005,11 @@ bool XFillColorItem::QueryValue( css::uno::Any& rVal, 
sal_uInt8 nMemberId ) cons
 rVal <<= xComplexColor;
 break;
 }
+case MID_COMPLEX_COLOR_JSON:
+{
+rVal <<= 
OStringToOUString(model::color::convertToJSON(getComplexColor()), 
RTL_TEXTENCODING_UTF8);
+break;
+}
 default:
 {
 rVal <<= GetColorValue().GetRGBColor();
@@ -2034,6 +2059,21 @@ bool XFillColorItem::PutValue( const css::uno::Any& 
rVal, sal_uInt8 nMemberId )
 setComplexColor(model::color::getFromXComplexColor(xComplexColor));
 }
 break;
+case MID_COMPLEX_COLOR_JSON:
+{
+OUString sComplexColorJson;
+if (!(rVal >>= sComplexColorJson))
+return false;
+
+if (sComplexColorJson.isEmpty())
+   

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - include/svx svx/source sw/qa sw/source

2023-06-07 Thread Tomaž Vajngerl (via logerrit)
 include/svx/dialog/ThemeDialog.hxx |7 +-
 include/svx/theme/IThemeColorChanger.hxx   |2 -
 include/svx/theme/ThemeColorChanger.hxx|2 -
 svx/source/dialog/ThemeDialog.cxx  |   11 +
 svx/source/svdraw/svdpage.cxx  |   17 ---
 svx/source/theme/ThemeColorChanger.cxx |6 ++---
 sw/qa/core/theme/ThemeTest.cxx |6 ++---
 sw/source/core/inc/ThemeColorChanger.hxx   |2 -
 sw/source/core/model/ThemeColorChanger.cxx |   32 ++---
 sw/source/uibase/shells/basesh.cxx |   16 ++
 sw/source/uibase/sidebar/ThemePanel.cxx|2 -
 11 files changed, 47 insertions(+), 56 deletions(-)

New commits:
commit 6c40e4d1796bcb6418dcb5ec17f46f576c171796
Author: Tomaž Vajngerl 
AuthorDate: Tue Jun 6 15:05:18 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Wed Jun 7 08:42:12 2023 +0200

lok: send theme palette after the change in ThemeDialog

For some reason the SdrPage is constructed in Online after every
change (cursor, selection) so can't use that to send theme change
callback. Instead of that send it after the theme is changed with
the ThemeDialog.

in addition this requires that we transport model::ColorSet in a
shared_ptr more, to prevent doing constant copies. This requires
that the IThemeColorChanger interface is changed and the signature
of apply() method.

Change-Id: Iac951fce57a8e9dff467bd27b2f9c64ec65ea30c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152635
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tomaž Vajngerl 

diff --git a/include/svx/dialog/ThemeDialog.hxx 
b/include/svx/dialog/ThemeDialog.hxx
index d715894f027a..020240c97ca3 100644
--- a/include/svx/dialog/ThemeDialog.hxx
+++ b/include/svx/dialog/ThemeDialog.hxx
@@ -36,7 +36,7 @@ private:
 std::unique_ptr mxValueSetThemeColorsWindow;
 std::unique_ptr mxAdd;
 
-std::optional> moCurrentColorSet;
+std::shared_ptr mpCurrentColorSet;
 
 void runThemeColorEditDialog();
 void initColorSets();
@@ -49,10 +49,7 @@ public:
 DECL_LINK(SelectItem, ValueSet*, void);
 DECL_LINK(ButtonClicked, weld::Button&, void);
 
-std::optional> const& 
getCurrentColorSet()
-{
-return moCurrentColorSet;
-}
+std::shared_ptr const& getCurrentColorSet() { return 
mpCurrentColorSet; }
 };
 
 } // end svx namespace
diff --git a/include/svx/theme/IThemeColorChanger.hxx 
b/include/svx/theme/IThemeColorChanger.hxx
index 4f10ad15120f..d9273238c712 100644
--- a/include/svx/theme/IThemeColorChanger.hxx
+++ b/include/svx/theme/IThemeColorChanger.hxx
@@ -18,7 +18,7 @@ class SVXCORE_DLLPUBLIC IThemeColorChanger
 {
 public:
 virtual ~IThemeColorChanger() = default;
-virtual void apply(model::ColorSet const& rColorSet) = 0;
+virtual void apply(std::shared_ptr const& pColorSet) = 0;
 };
 
 } // end svx namespace
diff --git a/include/svx/theme/ThemeColorChanger.hxx 
b/include/svx/theme/ThemeColorChanger.hxx
index 708344fef2b3..8e942ea975ad 100644
--- a/include/svx/theme/ThemeColorChanger.hxx
+++ b/include/svx/theme/ThemeColorChanger.hxx
@@ -31,7 +31,7 @@ public:
 ThemeColorChanger(SdrPage* pPage);
 virtual ~ThemeColorChanger() override;
 
-void apply(model::ColorSet const& rColorSet) override;
+void apply(std::shared_ptr const& pColorSet) override;
 };
 
 } // end svx namespace
diff --git a/svx/source/dialog/ThemeDialog.cxx 
b/svx/source/dialog/ThemeDialog.cxx
index ce88b2ef4b79..8af6f5975df2 100644
--- a/svx/source/dialog/ThemeDialog.cxx
+++ b/svx/source/dialog/ThemeDialog.cxx
@@ -40,7 +40,7 @@ ThemeDialog::ThemeDialog(weld::Window* pParent, model::Theme* 
pTheme)
 if (!maColorSets.empty())
 {
 mxValueSetThemeColors->SelectItem(1); // ItemId 1, position 0
-moCurrentColorSet = std::ref(maColorSets[0]);
+mpCurrentColorSet = std::make_shared(maColorSets[0]);
 }
 }
 
@@ -80,12 +80,12 @@ IMPL_LINK_NOARG(ThemeDialog, SelectItem, ValueSet*, void)
 if (nIndex >= maColorSets.size())
 return;
 
-moCurrentColorSet = std::ref(maColorSets[nIndex]);
+mpCurrentColorSet = std::make_shared(maColorSets[nIndex]);
 }
 
 void ThemeDialog::runThemeColorEditDialog()
 {
-auto pDialog = std::make_shared(mpWindow, 
*moCurrentColorSet);
+auto pDialog = std::make_shared(mpWindow, 
*mpCurrentColorSet);
 weld::DialogController::runAsync(pDialog, [this, pDialog](sal_uInt32 
nResult) {
 if (nResult != RET_OK)
 return;
@@ -99,14 +99,15 @@ void ThemeDialog::runThemeColorEditDialog()
 initColorSets();
 
 mxValueSetThemeColors->SelectItem(maColorSets.size() - 1);
-moCurrentColorSet = std::ref(maColorSets[maColorSets.size() - 1]);
+mpCurrentColorSet
+= 
std::make_shared(maColorSets[maColorSets.size() - 1]);
 }
 });
 }
 
 IMPL_LINK(ThemeDialog, ButtonClicked, weld::Button&, rButton, 

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - sc/inc sc/source

2023-06-06 Thread Tomaž Vajngerl (via logerrit)
 sc/inc/unonames.hxx |1 +
 sc/source/ui/unoobj/confuno.cxx |   14 --
 2 files changed, 13 insertions(+), 2 deletions(-)

New commits:
commit d19f877be396bb69e1ae0ee5535e193e3feb35e1
Author: Tomaž Vajngerl 
AuthorDate: Tue Jan 4 21:39:20 2022 +0900
Commit: Aron Budea 
CommitDate: Tue Jun 6 13:03:48 2023 +0200

sc: fix crash with document properties dialog

"ImagePreferredDPI" property was added for impress and writer,
but it was not handled in calc, so it document properties dialog
crashed (exception because of a non existent property).

Change-Id: I9eb3f6aa7cf6d8ab48930b3071b993e073117688
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127942
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 88d8c9af7140ec25dfbcd9323b870a2da7b6f7e0)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152558
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Aron Budea 

diff --git a/sc/inc/unonames.hxx b/sc/inc/unonames.hxx
index 36ab650e918b..848053ba4542 100644
--- a/sc/inc/unonames.hxx
+++ b/sc/inc/unonames.hxx
@@ -574,6 +574,7 @@
 #define SC_UNO_UPDTEMPL "UpdateFromTemplate"
 #define SC_UNO_FILTERED_RANGE_SELECTION   "FilteredRangeSelection"
 #define SC_UNO_VISAREASCREEN"VisibleAreaOnScreen"
+#define SC_UNO_IMAGE_PREFERRED_DPI  "ImagePreferredDPI"
 
 /*Stampit enable/disable print cancel */
 #define SC_UNO_ALLOWPRINTJOBCANCEL  "AllowPrintJobCancel"
diff --git a/sc/source/ui/unoobj/confuno.cxx b/sc/source/ui/unoobj/confuno.cxx
index ba081d5e2433..95c6fe64c9e8 100644
--- a/sc/source/ui/unoobj/confuno.cxx
+++ b/sc/source/ui/unoobj/confuno.cxx
@@ -89,6 +89,7 @@ static const SfxItemPropertyMapEntry* 
lcl_GetConfigPropertyMap()
 {u"" SC_UNO_EMBED_FONT_SCRIPT_LATIN,   0,  cppu::UnoType::get(), 
0, 0},
 {u"" SC_UNO_EMBED_FONT_SCRIPT_ASIAN,   0,  cppu::UnoType::get(), 
0, 0},
 {u"" SC_UNO_EMBED_FONT_SCRIPT_COMPLEX, 0,  cppu::UnoType::get(), 
0, 0},
+{u"" SC_UNO_IMAGE_PREFERRED_DPI,   0,  
cppu::UnoType::get(), 0, 0},
 {u"" SC_UNO_SYNTAXSTRINGREF, 0,  cppu::UnoType::get(), 
0, 0},
 { u"", 0, css::uno::Type(), 0, 0 }
 };
@@ -396,7 +397,13 @@ void SAL_CALL ScDocumentConfiguration::setPropertyValue(
 rDoc.SetCalcConfig( aCalcConfig );
 }
 }
-
+else if (aPropertyName == SC_UNO_IMAGE_PREFERRED_DPI)
+{
+if (aValue.has())
+{
+rDoc.SetImagePreferredDPI(aValue.get());
+}
+}
 else
 {
 ScGridOptions aGridOpt(aViewOpt.GetGridOptions());
@@ -599,7 +606,10 @@ uno::Any SAL_CALL 
ScDocumentConfiguration::getPropertyValue( const OUString& aPr
  }
 }
 }
-
+else if (aPropertyName == SC_UNO_IMAGE_PREFERRED_DPI)
+{
+aRet <<= rDoc.GetImagePreferredDPI();
+}
 else
 {
 const ScGridOptions& aGridOpt = aViewOpt.GetGridOptions();


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - 2 commits - cui/source desktop/qa desktop/source docmodel/source editeng/source include/docmodel include/editeng include/LibreOffic

2023-06-06 Thread Tomaž Vajngerl (via logerrit)
 cui/source/tabpages/backgrnd.cxx   |8 
 cui/source/tabpages/border.cxx |4 
 cui/source/tabpages/chardlg.cxx|   34 +-
 cui/source/tabpages/tpcolor.cxx|   32 --
 desktop/qa/data/ThemeDocument.docx |binary
 desktop/qa/desktop_lib/test_desktop_lib.cxx|   40 +++
 desktop/source/lib/init.cxx|2 
 docmodel/source/color/ComplexColorJSON.cxx |   16 -
 editeng/source/items/borderline.cxx|   22 +
 editeng/source/items/frmitems.cxx  |  104 
 editeng/source/items/textitem.cxx  |   44 ++-
 include/LibreOfficeKit/LibreOfficeKitEnums.h   |9 
 include/docmodel/color/ComplexColorJSON.hxx|3 
 include/editeng/borderline.hxx |   19 +
 include/editeng/boxitem.hxx|   17 +
 include/editeng/brushitem.hxx  |   22 +
 include/editeng/colritem.hxx   |   14 +
 include/editeng/memberids.h|   18 +
 include/editeng/udlnitem.hxx   |   26 +-
 include/svx/frmsel.hxx |2 
 include/svx/svdpage.hxx|1 
 include/svx/theme/ThemeColorPaletteManager.hxx |1 
 libreofficekit/source/gtk/lokdocview.cxx   |1 
 sd/source/ui/inc/ViewShellBase.hxx |2 
 sd/source/ui/view/ViewShellBase.cxx|5 
 svx/source/dialog/frmsel.cxx   |6 
 svx/source/svdraw/svdpage.cxx  |   19 +
 svx/source/theme/ThemeColorPaletteManager.cxx  |   43 +++
 svx/source/unodraw/unobrushitemhelper.cxx  |   15 -
 sw/inc/unoprnms.hxx|   20 +
 sw/inc/view.hxx|2 
 sw/source/core/docnode/ndtbl1.cxx  |8 
 sw/source/core/model/ThemeColorChanger.cxx |  297 +++--
 sw/source/core/unocore/unomap.cxx  |   23 +
 sw/source/core/unocore/unomap1.cxx |   30 ++
 sw/source/core/unocore/unomapproperties.hxx|   27 ++
 sw/source/uibase/docvw/edtwin.cxx  |2 
 sw/source/uibase/inc/uitool.hxx|3 
 sw/source/uibase/shells/basesh.cxx |3 
 sw/source/uibase/shells/frmsh.cxx  |   16 -
 sw/source/uibase/shells/textsh1.cxx|   38 +--
 sw/source/uibase/sidebar/PageStylesPanel.cxx   |5 
 sw/source/uibase/uiview/view.cxx   |   15 +
 sw/source/uibase/utlui/uitool.cxx  |7 
 44 files changed, 865 insertions(+), 160 deletions(-)

New commits:
commit a87efdf4cdd950129e005370ef822a56286d3ba0
Author: Tomaž Vajngerl 
AuthorDate: Tue May 30 21:11:28 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Tue Jun 6 08:36:49 2023 +0200

sw: border and background theme color support for multiple props.

This adds support for theme colors for multiple properties that
are stored in SvxBoxItem and SvxBrushItem / XFillColorItem. For
those items the ComplexColor member variable was introduced.

The UNO properties for the colors are added.

The properties with the added support includes paragraph border
and background + styles, page border and  background, frame border
and background + styles.

The ThemeColorChanges has been extended to support changing the
colors for those propertes.

Color picker and tab pages have been fixed so they pass or set
the theme color properties to the items.

Change-Id: Id27272f5c4a448703a62a759d829e8a9540066e4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152397
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit cc6db9f418cae422a4733163f85801c5a14f47c8)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152590
Tested-by: Jenkins CollaboraOffice 

diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx
index 14269ad3c6c8..5706f98c310a 100644
--- a/cui/source/tabpages/backgrnd.cxx
+++ b/cui/source/tabpages/backgrnd.cxx
@@ -166,13 +166,13 @@ bool SvxBkgTabPage::FillItemSet( SfxItemSet* rCoreSet )
 XFillColorItem aColorItem( maSet.Get( XATTR_FILLCOLOR ) );
 if ( SID_ATTR_CHAR_BACK_COLOR == nSlot )
 {
-maSet.Put( SvxColorItem( aColorItem.GetColorValue(), nWhich ) 
);
-rCoreSet->Put( SvxColorItem( aColorItem.GetColorValue(), 
nWhich ) );
+maSet.Put( SvxColorItem( aColorItem.GetColorValue(), 
aColorItem.getComplexColor(), nWhich ) );
+rCoreSet->Put( SvxColorItem( aColorItem.GetColorValue(), 
aColorItem.getComplexColor(), nWhich ) );
 }
 else
 {
-maSet.Put( SvxBrushItem( aColorItem.GetColorValue(), nWhich ) 
);
-rCoreSet->Put( SvxBrushItem( aColorItem.GetColorValue(), 
nWhich ) );
+maSet.Put( SvxBrushItem( aColorItem.GetColorValue(), 

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - include/sfx2 include/svx sd/source sfx2/source svx/Library_svxcore.mk svx/source sw/inc sw/source

2023-06-06 Thread Tomaž Vajngerl (via logerrit)
 include/sfx2/objsh.hxx |3 
 include/svx/PaletteManager.hxx |   29 
 include/svx/theme/ThemeColorPaletteManager.hxx |   67 +++
 sd/source/ui/docshell/docshell.cxx |   14 --
 sd/source/ui/inc/DrawDocShell.hxx  |2 
 sfx2/source/doc/objcont.cxx|2 
 svx/Library_svxcore.mk |1 
 svx/source/tbxctrls/PaletteManager.cxx |  151 ++---
 svx/source/theme/ThemeColorPaletteManager.cxx  |  130 +
 sw/inc/docsh.hxx   |2 
 sw/source/uibase/app/docst.cxx |4 
 11 files changed, 231 insertions(+), 174 deletions(-)

New commits:
commit f46d6a53f83d3942c83edee9189162e37fb99937
Author: Tomaž Vajngerl 
AuthorDate: Sat Jun 3 10:44:51 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Tue Jun 6 08:13:19 2023 +0200

svx: extract theme color generation into ThemeColorPaletteManager

The generation of theme colors generation code is moved to the
ThemeColorPaletteManager class, so it can be reused.

Also change the GetThemeColors return type from std::vector
to std::shared_ptr as we can now safely do that
and simplifies things.

Change-Id: I4a54bff889a1f97cb1e30467188dc69e07e8c518
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152588
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 6c4c040d2ebc4371a706c762e7e6707875c43535)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152607
Tested-by: Jenkins CollaboraOffice 

diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx
index ef1a0a33e1dc..38ae4166cf0e 100644
--- a/include/sfx2/objsh.hxx
+++ b/include/sfx2/objsh.hxx
@@ -46,6 +46,7 @@
 #include 
 
 namespace weld {class Button; }
+namespace model {class ColorSet; }
 class SbxValue;
 class SbxArray;
 class BasicManager;
@@ -558,7 +559,7 @@ public:
 StarBASIC*  GetBasic() const;
 
 virtual std::set GetDocColors();
-virtual std::vector GetThemeColors();
+virtual std::shared_ptr GetThemeColors();
 
 // Accessibility Check
 virtual sfx::AccessibilityIssueCollection runAccessibilityCheck();
diff --git a/include/svx/PaletteManager.hxx b/include/svx/PaletteManager.hxx
index 37d22b92ec64..5a5000bc0076 100644
--- a/include/svx/PaletteManager.hxx
+++ b/include/svx/PaletteManager.hxx
@@ -16,13 +16,13 @@
  *   except in compliance with the License. You may obtain a copy of
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
-#ifndef INCLUDED_SVX_PALETTEMANAGER_HXX
-#define INCLUDED_SVX_PALETTEMANAGER_HXX
+#pragma once
 
 #include 
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -31,26 +31,7 @@
 namespace com::sun::star::uno { class XComponentContext; }
 namespace svx { class ToolboxButtonColorUpdaterBase; }
 namespace weld { class Window; }
-
-enum class ThemePaletteColorType
-{
-Black,
-White,
-Low,
-High,
-Normal
-};
-
-struct ThemePaletteData
-{
-ThemePaletteColorType meType = ThemePaletteColorType::Normal;
-Color maColor;
-};
-
-struct ThemePaletteCollection
-{
-std::array maData;
-};
+namespace model { class ColorSet; }
 
 class SVXCORE_DLLPUBLIC PaletteManager
 {
@@ -69,7 +50,7 @@ class SVXCORE_DLLPUBLIC PaletteManager
 ColorSelectFunction maColorSelectFunction;
 
 std::unique_ptr m_pColorDlg;
-std::optional moThemePaletteCollection;
+std::optional moThemePaletteCollection;
 
 PaletteManager(const PaletteManager* pClone);
 public:
@@ -106,6 +87,4 @@ public:
 static void DispatchColorCommand(const OUString& aCommand, const 
NamedColor& rColor);
 };
 
-#endif // INCLUDED_SVX_PALETTEMANAGER_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/theme/ThemeColorPaletteManager.hxx 
b/include/svx/theme/ThemeColorPaletteManager.hxx
new file mode 100644
index ..14fbda39248b
--- /dev/null
+++ b/include/svx/theme/ThemeColorPaletteManager.hxx
@@ -0,0 +1,67 @@
+/* -*- 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 
+
+namespace model
+{
+class ColorSet;
+}
+
+namespace svx
+{
+struct SVXCORE_DLLPUBLIC ThemePaletteEffect
+{
+Color maColor;
+OUString maColorName;
+sal_Int16 mnLumOff = 0;
+sal_Int16 mnLumMod = 10'000;
+
+sal_Int16 getPercentage()
+{
+if (mnLumOff > 0)
+return mnLumOff / 100;
+else
+return (-10'000 + mnLumMod) / 100;
+}
+};
+
+struct SVXCORE_DLLPUBLIC ThemePaletteColorData
+{
+Color 

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - 2 commits - editeng/source include/editeng

2023-06-05 Thread Tomaž Vajngerl (via logerrit)
 editeng/source/items/borderline.cxx |   40 ++--
 editeng/source/items/frmitems.cxx   |  333 +---
 include/editeng/borderline.hxx  |6 
 include/editeng/boxitem.hxx |  116 +++-
 4 files changed, 254 insertions(+), 241 deletions(-)

New commits:
commit 358668852337fac9535a12c0150ee8ffc83c666b
Author: Tomaž Vajngerl 
AuthorDate: Fri May 12 16:05:36 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Tue Jun 6 02:20:38 2023 +0200

prefix members and cleanup SvxBoxItem, SvxBoxInfoItem

Change-Id: I9f3d36257175a5118a2b8ddca981815b24b8d243
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151718
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit ef106661fcc40cfdd406064cbf73fd62477d0e79)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152624
Tested-by: Jenkins CollaboraOffice 

diff --git a/editeng/source/items/frmitems.cxx 
b/editeng/source/items/frmitems.cxx
index 890d74a75510..82e81f59d9e4 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -1283,29 +1283,23 @@ void SvxShadowItem::dumpAsXml(xmlTextWriterPtr pWriter) 
const
 
 // class SvxBoxItem --
 
-SvxBoxItem::SvxBoxItem( const SvxBoxItem& rCpy ) :
-
-SfxPoolItem ( rCpy ),
-pTop( rCpy.pTop ? new SvxBorderLine( *rCpy.pTop ): nullptr 
),
-pBottom ( rCpy.pBottom  ? new SvxBorderLine( *rCpy.pBottom ) : nullptr 
),
-pLeft   ( rCpy.pLeft? new SvxBorderLine( *rCpy.pLeft )   : nullptr 
),
-pRight  ( rCpy.pRight   ? new SvxBorderLine( *rCpy.pRight )  : nullptr 
),
-nTopDist( rCpy.nTopDist ),
-nBottomDist ( rCpy.nBottomDist ),
-nLeftDist   ( rCpy.nLeftDist ),
-nRightDist  ( rCpy.nRightDist ),
-bRemoveAdjCellBorder ( rCpy.bRemoveAdjCellBorder )
+SvxBoxItem::SvxBoxItem(const SvxBoxItem& rCopy)
+: SfxPoolItem (rCopy)
+, mpTopBorderLine(rCopy.mpTopBorderLine ? new 
SvxBorderLine(*rCopy.mpTopBorderLine) : nullptr)
+, mpBottomBorderLine(rCopy.mpBottomBorderLine ? new 
SvxBorderLine(*rCopy.mpBottomBorderLine) : nullptr)
+, mpLeftBorderLine(rCopy.mpLeftBorderLine ? new 
SvxBorderLine(*rCopy.mpLeftBorderLine) : nullptr)
+, mpRightBorderLine(rCopy.mpRightBorderLine ? new 
SvxBorderLine(*rCopy.mpRightBorderLine) : nullptr)
+, mnTopDistance(rCopy.mnTopDistance)
+, mnBottomDistance(rCopy.mnBottomDistance)
+, mnLeftDistance(rCopy.mnLeftDistance)
+, mnRightDistance(rCopy.mnRightDistance)
+, mbRemoveAdjCellBorder(rCopy.mbRemoveAdjCellBorder)
 {
 }
 
 
-SvxBoxItem::SvxBoxItem( const sal_uInt16 nId ) :
-SfxPoolItem( nId ),
-nTopDist( 0 ),
-nBottomDist ( 0 ),
-nLeftDist   ( 0 ),
-nRightDist  ( 0 ),
-bRemoveAdjCellBorder ( false )
+SvxBoxItem::SvxBoxItem(const sal_uInt16 nId)
+: SfxPoolItem(nId)
 {
 }
 
@@ -1318,13 +1312,13 @@ void SvxBoxItem::dumpAsXml(xmlTextWriterPtr pWriter) 
const
 {
 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SvxBoxItem"));
 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("top-dist"),
-  
BAD_CAST(OString::number(nTopDist).getStr()));
+  
BAD_CAST(OString::number(mnTopDistance).getStr()));
 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("bottom-dist"),
-  
BAD_CAST(OString::number(nBottomDist).getStr()));
+  
BAD_CAST(OString::number(mnBottomDistance).getStr()));
 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("left-dist"),
-  
BAD_CAST(OString::number(nLeftDist).getStr()));
+  
BAD_CAST(OString::number(mnLeftDistance).getStr()));
 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("right-dist"),
-  
BAD_CAST(OString::number(nRightDist).getStr()));
+  
BAD_CAST(OString::number(mnRightDistance).getStr()));
 SfxPoolItem::dumpAsXml(pWriter);
 (void)xmlTextWriterEndElement(pWriter);
 }
@@ -1346,7 +1340,7 @@ boost::property_tree::ptree SvxBoxItem::dumpAsJSON() const
 }
 
 
-static bool CmpBrdLn( const std::unique_ptr & pBrd1, const 
SvxBorderLine* pBrd2 )
+static bool CompareBorderLine(const std::unique_ptr & pBrd1, 
const SvxBorderLine* pBrd2)
 {
 if( pBrd1.get() == pBrd2 )
 return true;
@@ -1362,15 +1356,15 @@ bool SvxBoxItem::operator==( const SfxPoolItem& rAttr ) 
const
 
 const SvxBoxItem& rBoxItem = static_cast(rAttr);
 return (
-( nTopDist == rBoxItem.nTopDist ) &&
-( nBottomDist == rBoxItem.nBottomDist )   &&
-( nLeftDist == rBoxItem.nLeftDist )   &&
-( nRightDist == rBoxItem.nRightDist ) &&
-( bRemoveAdjCellBorder == rBoxItem.bRemoveAdjCellBorder ) &&
-CmpBrdLn( pTop, rBoxItem.GetTop() )   &&
-  

[Libreoffice-commits] core.git: desktop/qa desktop/source docmodel/source include/docmodel include/LibreOfficeKit include/svx libreofficekit/source sd/source svx/source sw/inc sw/source

2023-06-05 Thread Tomaž Vajngerl (via logerrit)
 desktop/qa/data/ThemeDocument.docx |binary
 desktop/qa/desktop_lib/test_desktop_lib.cxx|   40 +++
 desktop/source/lib/init.cxx|2 +
 docmodel/source/color/ComplexColorJSON.cxx |   15 +---
 include/LibreOfficeKit/LibreOfficeKitEnums.h   |9 -
 include/docmodel/color/ComplexColorJSON.hxx|3 +
 include/svx/svdpage.hxx|1 
 include/svx/theme/ThemeColorPaletteManager.hxx |1 
 libreofficekit/source/gtk/lokdocview.cxx   |1 
 sd/source/ui/inc/ViewShellBase.hxx |2 +
 sd/source/ui/view/ViewShellBase.cxx|5 ++
 svx/source/svdraw/svdpage.cxx  |   19 +++
 svx/source/theme/ThemeColorPaletteManager.cxx  |   43 +
 sw/inc/view.hxx|2 +
 sw/source/uibase/uiview/view.cxx   |   15 
 15 files changed, 150 insertions(+), 8 deletions(-)

New commits:
commit e86a0236e69d76769b91f96d71fe852b91c5db6e
Author: Tomaž Vajngerl 
AuthorDate: Sun Jun 4 20:57:19 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Mon Jun 5 13:06:57 2023 +0200

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 

diff --git a/desktop/qa/data/ThemeDocument.docx 
b/desktop/qa/data/ThemeDocument.docx
new file mode 100644
index ..4dbba883d9b6
Binary files /dev/null and b/desktop/qa/data/ThemeDocument.docx differ
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx 
b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index 74db478c09a3..b698cc5976b7 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -219,6 +219,7 @@ public:
 void testRenderSearchResult_CommonNode();
 void testNoDuplicateTableSelection();
 void testMultiViewTableSelection();
+void testColorPaletteCallback();
 void testABI();
 
 CPPUNIT_TEST_SUITE(DesktopLOKTest);
@@ -291,6 +292,7 @@ public:
 CPPUNIT_TEST(testRenderSearchResult_CommonNode);
 CPPUNIT_TEST(testNoDuplicateTableSelection);
 CPPUNIT_TEST(testMultiViewTableSelection);
+CPPUNIT_TEST(testColorPaletteCallback);
 CPPUNIT_TEST(testABI);
 CPPUNIT_TEST_SUITE_END();
 
@@ -2160,12 +2162,14 @@ class ViewCallback
 public:
 OString m_aCellFormula;
 int m_nTableSelectionCount;
+int m_nColorPaletteCallbackCount = 0;
 bool m_bEmptyTableSelection;
 bool m_bTilesInvalidated;
 bool m_bZeroCursor;
 tools::Rectangle m_aOwnCursor;
 boost::property_tree::ptree m_aCommentCallbackResult;
 boost::property_tree::ptree m_aCallbackWindowResult;
+boost::property_tree::ptree m_aColorPaletteCallbackResult;
 bool m_bWindowHidden;
 
 ViewCallback(LibLODocument_Impl* pDocument)
@@ -2245,6 +2249,14 @@ public:
 ++m_nTableSelectionCount;
 }
 break;
+case LOK_CALLBACK_COLOR_PALETTES:
+{
+m_aColorPaletteCallbackResult.clear();
+std::stringstream aStream(pPayload);
+boost::property_tree::read_json(aStream, 
m_aColorPaletteCallbackResult);
+++m_nColorPaletteCallbackCount;
+}
+break;
 }
 }
 };
@@ -3525,6 +3537,34 @@ void DesktopLOKTest::testMultiViewTableSelection()
 CPPUNIT_ASSERT(!aView1.m_bEmptyTableSelection);
 }
 
+void DesktopLOKTest::testColorPaletteCallback()
+{
+LibLODocument_Impl* pDocument = loadDoc("ThemeDocument.docx");
+
+// Create view 1.
+pDocument->m_pDocumentClass->initializeForRendering(pDocument, "{}");
+ViewCallback aView1(pDocument);
+Scheduler::ProcessEventsToIdle();
+{
+CPPUNIT_ASSERT_EQUAL(1, aView1.m_nColorPaletteCallbackCount);
+boost::property_tree::ptree aValues = 
aView1.m_aColorPaletteCallbackResult.get_child("ThemeColors");
+CPPUNIT_ASSERT(!aValues.empty());
+CPPUNIT_ASSERT_EQUAL(size_t(6), aValues.size());
+}
+
+// Create view 2.
+pDocument->m_pDocumentClass->createView(pDocument);
+pDocument->m_pDocumentClass->initializeForRendering(pDocument, "{}");
+ViewCallback aView2(pDocument);
+Scheduler::ProcessEventsToIdle();
+{
+CPPUNIT_ASSERT_EQUAL(1, aView2.m_nColorPaletteCallbackCount);
+boost::property_tree::ptree aValues = 
aView1.m_aColorPaletteCallbackResult.get_child("ThemeColors");
+CPPUNIT_ASSERT(!aValues.empty());
+CPPUNIT_ASSERT_EQUAL(size_t(6), aValues.size());
+}
+}
+
 

[Libreoffice-commits] core.git: include/sfx2 include/svx sc/source sd/source sfx2/source svx/Library_svxcore.mk svx/source sw/inc sw/source

2023-06-05 Thread Tomaž Vajngerl (via logerrit)
 include/sfx2/objsh.hxx |3 
 include/svx/PaletteManager.hxx |   29 
 include/svx/theme/ThemeColorPaletteManager.hxx |   67 +++
 sc/source/ui/docshell/docsh.cxx|   15 +-
 sc/source/ui/inc/docsh.hxx |2 
 sd/source/ui/docshell/docshell.cxx |   14 --
 sd/source/ui/inc/DrawDocShell.hxx  |2 
 sfx2/source/doc/objcont.cxx|2 
 svx/Library_svxcore.mk |1 
 svx/source/tbxctrls/PaletteManager.cxx |  151 ++---
 svx/source/theme/ThemeColorPaletteManager.cxx  |  130 +
 sw/inc/docsh.hxx   |2 
 sw/source/uibase/app/docst.cxx |4 
 13 files changed, 242 insertions(+), 180 deletions(-)

New commits:
commit 6c4c040d2ebc4371a706c762e7e6707875c43535
Author: Tomaž Vajngerl 
AuthorDate: Sat Jun 3 10:44:51 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Mon Jun 5 12:06:23 2023 +0200

svx: extract theme color generation into ThemeColorPaletteManager

The generation of theme colors generation code is moved to the
ThemeColorPaletteManager class, so it can be reused.

Also change the GetThemeColors return type from std::vector
to std::shared_ptr as we can now safely do that
and simplifies things.

Change-Id: I4a54bff889a1f97cb1e30467188dc69e07e8c518
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152588
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx
index 3a88131b8f27..b29fb43d77e4 100644
--- a/include/sfx2/objsh.hxx
+++ b/include/sfx2/objsh.hxx
@@ -46,6 +46,7 @@
 #include 
 
 namespace weld {class Button; }
+namespace model {class ColorSet; }
 class SbxValue;
 class SbxArray;
 class BasicManager;
@@ -558,7 +559,7 @@ public:
 StarBASIC*  GetBasic() const;
 
 virtual std::set GetDocColors();
-virtual std::vector GetThemeColors();
+virtual std::shared_ptr GetThemeColors();
 
 // Accessibility Check
 virtual sfx::AccessibilityIssueCollection runAccessibilityCheck();
diff --git a/include/svx/PaletteManager.hxx b/include/svx/PaletteManager.hxx
index 37d22b92ec64..5a5000bc0076 100644
--- a/include/svx/PaletteManager.hxx
+++ b/include/svx/PaletteManager.hxx
@@ -16,13 +16,13 @@
  *   except in compliance with the License. You may obtain a copy of
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
-#ifndef INCLUDED_SVX_PALETTEMANAGER_HXX
-#define INCLUDED_SVX_PALETTEMANAGER_HXX
+#pragma once
 
 #include 
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -31,26 +31,7 @@
 namespace com::sun::star::uno { class XComponentContext; }
 namespace svx { class ToolboxButtonColorUpdaterBase; }
 namespace weld { class Window; }
-
-enum class ThemePaletteColorType
-{
-Black,
-White,
-Low,
-High,
-Normal
-};
-
-struct ThemePaletteData
-{
-ThemePaletteColorType meType = ThemePaletteColorType::Normal;
-Color maColor;
-};
-
-struct ThemePaletteCollection
-{
-std::array maData;
-};
+namespace model { class ColorSet; }
 
 class SVXCORE_DLLPUBLIC PaletteManager
 {
@@ -69,7 +50,7 @@ class SVXCORE_DLLPUBLIC PaletteManager
 ColorSelectFunction maColorSelectFunction;
 
 std::unique_ptr m_pColorDlg;
-std::optional moThemePaletteCollection;
+std::optional moThemePaletteCollection;
 
 PaletteManager(const PaletteManager* pClone);
 public:
@@ -106,6 +87,4 @@ public:
 static void DispatchColorCommand(const OUString& aCommand, const 
NamedColor& rColor);
 };
 
-#endif // INCLUDED_SVX_PALETTEMANAGER_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/theme/ThemeColorPaletteManager.hxx 
b/include/svx/theme/ThemeColorPaletteManager.hxx
new file mode 100644
index ..14fbda39248b
--- /dev/null
+++ b/include/svx/theme/ThemeColorPaletteManager.hxx
@@ -0,0 +1,67 @@
+/* -*- 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 
+
+namespace model
+{
+class ColorSet;
+}
+
+namespace svx
+{
+struct SVXCORE_DLLPUBLIC ThemePaletteEffect
+{
+Color maColor;
+OUString maColorName;
+sal_Int16 mnLumOff = 0;
+sal_Int16 mnLumMod = 10'000;
+
+sal_Int16 getPercentage()
+{
+if (mnLumOff > 0)
+return mnLumOff / 100;
+else
+return (-10'000 + mnLumMod) / 100;
+}
+};
+
+struct SVXCORE_DLLPUBLIC ThemePaletteColorData
+{
+Color maBaseColor;
+model::ThemeColorType meThemeColorType;
+

[Libreoffice-commits] core.git: cui/source editeng/source include/editeng include/svx svx/source sw/inc sw/source

2023-06-04 Thread Tomaž Vajngerl (via logerrit)
 cui/source/tabpages/border.cxx   |4 
 cui/source/tabpages/chardlg.cxx  |   34 ++-
 cui/source/tabpages/tpcolor.cxx  |   32 --
 editeng/source/items/borderline.cxx  |   22 +-
 editeng/source/items/frmitems.cxx|   68 ++
 editeng/source/items/textitem.cxx|   39 ++-
 include/editeng/borderline.hxx   |   19 +
 include/editeng/boxitem.hxx  |   17 +
 include/editeng/memberids.h  |   17 +
 include/editeng/udlnitem.hxx |   26 +-
 include/svx/frmsel.hxx   |2 
 svx/source/dialog/frmsel.cxx |6 
 svx/source/unodraw/unobrushitemhelper.cxx|   15 -
 sw/inc/unoprnms.hxx  |   20 +
 sw/source/core/docnode/ndtbl1.cxx|8 
 sw/source/core/model/ThemeColorChanger.cxx   |  297 +--
 sw/source/core/unocore/unomap.cxx|   23 +-
 sw/source/core/unocore/unomap1.cxx   |   30 ++
 sw/source/core/unocore/unomapproperties.hxx  |   27 ++
 sw/source/uibase/docvw/edtwin.cxx|2 
 sw/source/uibase/inc/uitool.hxx  |3 
 sw/source/uibase/shells/basesh.cxx   |6 
 sw/source/uibase/shells/frmsh.cxx|   16 -
 sw/source/uibase/shells/textsh1.cxx  |   34 +--
 sw/source/uibase/sidebar/PageStylesPanel.cxx |5 
 sw/source/uibase/utlui/uitool.cxx|7 
 26 files changed, 644 insertions(+), 135 deletions(-)

New commits:
commit cc6db9f418cae422a4733163f85801c5a14f47c8
Author: Tomaž Vajngerl 
AuthorDate: Tue May 30 21:11:28 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Sun Jun 4 18:27:45 2023 +0200

sw: border and background theme color support for multiple props.

This adds support for theme colors for multiple properties that
are stored in SvxBoxItem and SvxBrushItem / XFillColorItem. For
those items the ComplexColor member variable was introduced.

The UNO properties for the colors are added.

The properties with the added support includes paragraph border
and background + styles, page border and  background, frame border
and background + styles.

The ThemeColorChanges has been extended to support changing the
colors for those propertes.

Color picker and tab pages have been fixed so they pass or set
the theme color properties to the items.

Change-Id: Id27272f5c4a448703a62a759d829e8a9540066e4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152397
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx
index 9b94bc0eb28a..549ab533410a 100644
--- a/cui/source/tabpages/border.cxx
+++ b/cui/source/tabpages/border.cxx
@@ -1234,8 +1234,8 @@ IMPL_LINK_NOARG(SvxBorderTabPage, SelSdwHdl_Impl, 
ValueSet*, void)
 
 IMPL_LINK(SvxBorderTabPage, SelColHdl_Impl, ColorListBox&, rColorBox, void)
 {
-Color aColor = rColorBox.GetSelectEntryColor();
-m_aFrameSel.SetColorToSelection(aColor);
+NamedColor aNamedColor = rColorBox.GetSelectedEntry();
+m_aFrameSel.SetColorToSelection(aNamedColor.m_aColor, 
aNamedColor.getComplexColor());
 }
 
 IMPL_LINK_NOARG(SvxBorderTabPage, ModifyWidthLBHdl_Impl, weld::ComboBox&, void)
diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx
index 7a8788728b46..ace220bcc5c0 100644
--- a/cui/source/tabpages/chardlg.cxx
+++ b/cui/source/tabpages/chardlg.cxx
@@ -2095,21 +2095,26 @@ bool SvxCharEffectsPage::FillItemSet( SfxItemSet* rSet )
 //! item-state in the 'rOldSet' will be invalid. In this case
 //! changing the underline style will be allowed if a style is
 //! selected in the listbox.
-bool bAllowChg = nPos != -1  &&
+bool bAllowChange = nPos != -1  &&
  SfxItemState::DEFAULT > rOldSet.GetItemState( nWhich 
);
 
 const SvxUnderlineItem& rItem = *static_cast(pOld);
-if ( rItem.GetValue() == eUnder &&
- ( LINESTYLE_NONE == eUnder || rItem.GetColor() == 
m_xUnderlineColorLB->GetSelectEntryColor() ) &&
- ! bAllowChg )
+if (rItem.GetValue() == eUnder &&
+ (LINESTYLE_NONE == eUnder || (rItem.GetColor() == 
m_xUnderlineColorLB->GetSelectEntryColor() &&
+   rItem.getComplexColor() == 
m_xUnderlineColorLB->GetSelectedEntry().getComplexColor())) &&
+ !bAllowChange)
+{
 bChanged = false;
+}
 }
 
 if ( bChanged )
 {
 SvxUnderlineItem aNewItem( eUnder, nWhich );
-aNewItem.SetColor( m_xUnderlineColorLB->GetSelectEntryColor() );
-rSet->Put( aNewItem );
+auto aNamedColor = m_xUnderlineColorLB->GetSelectedEntry();
+aNewItem.SetColor(aNamedColor.m_aColor);
+aNewItem.setComplexColor(aNamedColor.getComplexColor());
+rSet->Put(aNewItem);
 

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - cui/qa cui/source include/svx svx/source

2023-06-04 Thread Tomaž Vajngerl (via logerrit)
 cui/qa/uitest/dialogs/chardlg.py   |4 
 cui/source/tabpages/tpcolor.cxx|8 +
 include/svx/PaletteManager.hxx |   25 -
 include/svx/strings.hrc|   15 +--
 svx/source/tbxctrls/PaletteManager.cxx |  155 +++--
 svx/source/tbxctrls/tbcontrl.cxx   |   14 +-
 6 files changed, 174 insertions(+), 47 deletions(-)

New commits:
commit ab90ce6f21e6adef70d39f08749ce9fcf30bcbd6
Author: Tomaž Vajngerl 
AuthorDate: Thu May 25 00:53:22 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Sun Jun 4 15:38:12 2023 +0200

tdf#153361 improve theme color generation in color picker

The theme color generator needs to take color luminocity into
account, so that the very dark or very light colors are properly
shaded. Otherwise a too dark color will generate a too dark (almost
black) color variant, or a too light a too light (almost white)
color variant. However those colors aren't useful.

Change-Id: Id803a8f6f1a79cbc822ed2d7faca9bec228c0188
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152237
Tested-by: Tomaž Vajngerl 
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit e6215c7233c0fb437a81b51c8a8a30bb53eef65f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152517
Tested-by: Jenkins CollaboraOffice 

diff --git a/cui/qa/uitest/dialogs/chardlg.py b/cui/qa/uitest/dialogs/chardlg.py
index 4a756cf6c979..85e60f766238 100644
--- a/cui/qa/uitest/dialogs/chardlg.py
+++ b/cui/qa/uitest/dialogs/chardlg.py
@@ -115,8 +115,8 @@ class Test(UITestCase):
 # AssertionError: 1 != 2000
 # i.e. the effects where not applied, luminance modulation was the 
default instead of a
 # custom value.
-self.assertEqual(portion.CharColorLumMod, 2000)
-self.assertEqual(portion.CharColorLumOff, 8000)
+self.assertEqual(portion.CharColorLumMod, 5000)
+self.assertEqual(portion.CharColorLumOff, 5000)
 
 def testSvxCharEffectsPageWriter(self):
 # Start Writer.
diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx
index fd458ee9b08f..cf09baf45c06 100644
--- a/cui/source/tabpages/tpcolor.cxx
+++ b/cui/source/tabpages/tpcolor.cxx
@@ -523,7 +523,13 @@ IMPL_LINK(SvxColorTabPage, SelectValSetHdl_Impl, 
ValueSet*, pValSet, void)
 aNamedColor.m_aColor = aColor;
 if (bThemePaletteSelected)
 {
-PaletteManager::GetThemeIndexLumModOff(nPos, 
aNamedColor.m_nThemeIndex, aNamedColor.m_nLumMod, aNamedColor.m_nLumOff);
+sal_uInt16 nThemeIndex;
+sal_uInt16 nEffectIndex;
+if (PaletteManager::GetThemeAndEffectIndex(nPos, nThemeIndex, 
nEffectIndex))
+{
+aNamedColor.m_nThemeIndex = nThemeIndex;
+maPaletteManager.GetLumModOff(nThemeIndex, nEffectIndex, 
aNamedColor.m_nLumMod, aNamedColor.m_nLumOff);
+}
 }
 
 ChangeColor(aNamedColor, false);
diff --git a/include/svx/PaletteManager.hxx b/include/svx/PaletteManager.hxx
index c6d1712a12f4..37d22b92ec64 100644
--- a/include/svx/PaletteManager.hxx
+++ b/include/svx/PaletteManager.hxx
@@ -32,6 +32,26 @@ namespace com::sun::star::uno { class XComponentContext; }
 namespace svx { class ToolboxButtonColorUpdaterBase; }
 namespace weld { class Window; }
 
+enum class ThemePaletteColorType
+{
+Black,
+White,
+Low,
+High,
+Normal
+};
+
+struct ThemePaletteData
+{
+ThemePaletteColorType meType = ThemePaletteColorType::Normal;
+Color maColor;
+};
+
+struct ThemePaletteCollection
+{
+std::array maData;
+};
+
 class SVXCORE_DLLPUBLIC PaletteManager
 {
 const sal_uInt16mnMaxRecentColors;
@@ -49,6 +69,7 @@ class SVXCORE_DLLPUBLIC PaletteManager
 ColorSelectFunction maColorSelectFunction;
 
 std::unique_ptr m_pColorDlg;
+std::optional moThemePaletteCollection;
 
 PaletteManager(const PaletteManager* pClone);
 public:
@@ -79,8 +100,8 @@ public:
 
 PaletteManager* Clone() const;
 
-static void GetThemeIndexLumModOff(sal_uInt16 nItemId, sal_Int16& 
rThemeIndex,
-   sal_Int16& rLumMod, sal_Int16& rLumOff);
+static bool GetThemeAndEffectIndex(sal_uInt16 nItemId, sal_uInt16& 
rThemeIndex, sal_uInt16& rEffectIndex);
+bool GetLumModOff(sal_uInt16 nThemeIndex, sal_uInt16 nEffect, sal_Int16& 
rLumMod, sal_Int16& rLumOff);
 
 static void DispatchColorCommand(const OUString& aCommand, const 
NamedColor& rColor);
 };
diff --git a/include/svx/strings.hrc b/include/svx/strings.hrc
index 6f8a353a4204..86422a9a63a8 100644
--- a/include/svx/strings.hrc
+++ b/include/svx/strings.hrc
@@ -1121,10 +1121,10 @@
 #define RID_SVXSTR_DOC_COLORS   
NC_("RID_SVXSTR_DOC_COLORS", "Document colors")
 #define RID_SVXSTR_THEME_COLORS 
NC_("RID_SVXSTR_THEME_COLORS", "Theme colors")
 #define RID_SVXSTR_DOC_COLOR_PREFIX 

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - include/docmodel oox/qa schema/libreoffice xmloff/qa xmloff/source

2023-06-04 Thread Tomaž Vajngerl (via logerrit)
 include/docmodel/color/ComplexColor.hxx |2 +
 oox/qa/unit/data/ReferenceShapeFill.fodp|   14 
 schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng |3 +
 xmloff/qa/unit/data/theme.fodp  |   20 ++--
 xmloff/qa/unit/draw.cxx |6 +++
 xmloff/source/text/XMLComplexColorContext.cxx   |8 
 xmloff/source/text/XMLComplexColorExport.cxx|1 
 7 files changed, 37 insertions(+), 17 deletions(-)

New commits:
commit 433a2ced036b8522a60559d9ca6387e5b478e3a9
Author: Tomaž Vajngerl 
AuthorDate: Thu May 25 13:55:21 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Sun Jun 4 15:37:30 2023 +0200

xmloff: add color-type attribute to complex color

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 
(cherry picked from commit 38e0e78998153463caf9c3c72ef7f4549ddff0e8)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152516
Tested-by: Jenkins CollaboraOffice 

diff --git a/include/docmodel/color/ComplexColor.hxx 
b/include/docmodel/color/ComplexColor.hxx
index 471c6b30e4d1..1cac6816bfa5 100644
--- a/include/docmodel/color/ComplexColor.hxx
+++ b/include/docmodel/color/ComplexColor.hxx
@@ -92,6 +92,8 @@ public:
 public:
 ColorType getType() const { return meType; }
 
+void setType(ColorType eType) { meType = eType; }
+
 ThemeColorType getSchemeType() const { return meSchemeType; }
 
 Color getRGBColor() const { return Color(mnComponent1, mnComponent2, 
mnComponent3); }
diff --git a/oox/qa/unit/data/ReferenceShapeFill.fodp 
b/oox/qa/unit/data/ReferenceShapeFill.fodp
index d3db08712ac9..432891b0d849 100644
--- a/oox/qa/unit/data/ReferenceShapeFill.fodp
+++ b/oox/qa/unit/data/ReferenceShapeFill.fodp
@@ -350,28 +350,28 @@



-
+

   
   



-
+

   
   



-
+

   
   



-
+

   
   
@@ -489,7 +489,7 @@



-
+

   
   
@@ -531,7 +531,7 @@
   
   

-
+
  
 

@@ -585,7 +585,7 @@
   
   

-
+

   
   
diff --git a/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng 
b/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng
index 50968cb1a62e..8160b6bbd845 100644
--- a/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng
+++ b/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng
@@ -3411,6 +3411,9 @@ 
xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.
 
   
 
+  
+
+  
   
 
   
diff --git a/xmloff/qa/unit/data/theme.fodp b/xmloff/qa/unit/data/theme.fodp
index b1e719d77959..dd6460281897 100644
--- a/xmloff/qa/unit/data/theme.fodp
+++ b/xmloff/qa/unit/data/theme.fodp
@@ -351,28 +351,28 @@



-
+

   
   



-
+

   
   



-
+

   
   



-
+

   
   
@@ -490,7 +490,7 @@



-
+

   
   
@@ -532,7 +532,7 @@
   
   

-
+


   
@@ -625,19 +625,19 @@
   
   

-
+

   
   

-
+
  
 

   
   

-
+
  
  
 
@@ -994,4 +994,4 @@

   
  
-
\ No newline at end of file
+
diff --git a/xmloff/qa/unit/draw.cxx b/xmloff/qa/unit/draw.cxx
index 5f6b46af1044..c46f70db3806 100644
--- a/xmloff/qa/unit/draw.cxx
+++ b/xmloff/qa/unit/draw.cxx
@@ -250,6 +250,7 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, 
testThemeColorExportImport)
 // Text color
 OString aStyle1(
 
"//style:style[@style:name='T2']/style:text-properties/loext:char-complex-color");
+assertXPath(pXmlDoc, aStyle1, "color-type", "theme");
 assertXPath(pXmlDoc, aStyle1, "theme-type", "accent3");
 assertXPath(pXmlDoc, aStyle1 + "/loext:transformation[1]", "type", 
"lummod");
 assertXPath(pXmlDoc, aStyle1 + "/loext:transformation[1]", "value", 
"2000");
@@ -258,6 +259,7 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, 
testThemeColorExportImport)
 
 OString aStyle2(
 
"//style:style[@style:name='T3']/style:text-properties/loext:char-complex-color");
+assertXPath(pXmlDoc, aStyle1, "color-type", "theme");
 assertXPath(pXmlDoc, aStyle2, "theme-type", "accent3");
 assertXPath(pXmlDoc, aStyle2 + "/loext:transformation[1]", "type", 
"lummod");
 assertXPath(pXmlDoc, aStyle2 + "/loext:transformation[1]", "value", 
"6000");
@@ -266,6 +268,7 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, 
testThemeColorExportImport)
 
 OString aStyle3(
 

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - include/xmloff oox/qa schema/libreoffice sw/qa sw/source xmloff/inc xmloff/qa xmloff/source

2023-06-01 Thread Tomaž Vajngerl (via logerrit)
 dev/null|binary
 include/xmloff/xmltoken.hxx |   12 
 oox/qa/unit/data/ReferenceShapeFill.fodp|   28 
 schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng |   28 
 sw/qa/core/theme/ThemeTest.cxx  |2 
 sw/qa/core/theme/data/ThemeColorInHeading.fodt  |  391 
 sw/source/filter/xml/xmlfmte.cxx|   14 
 xmloff/inc/XMLThemeContext.hxx  |   12 
 xmloff/qa/unit/data/theme.fodp  |  997 
 xmloff/qa/unit/draw.cxx |   10 
 xmloff/qa/unit/text.cxx |   21 
 xmloff/source/core/xmltoken.cxx |   29 
 xmloff/source/draw/sdxmlexp.cxx |   20 
 xmloff/source/style/XMLThemeContext.cxx |   34 
 xmloff/source/text/XMLComplexColorContext.cxx   |   19 
 xmloff/source/text/XMLComplexColorExport.cxx|4 
 xmloff/source/token/tokens.txt  |   12 
 17 files changed, 1514 insertions(+), 119 deletions(-)

New commits:
commit 2f23c3a0f7916da89577b85da2c967e983236e8e
Author: Tomaž Vajngerl 
AuthorDate: Thu May 25 13:15:41 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Fri Jun 2 02:20:37 2023 +0200

xmloff: rename theme color names and color-table to theme-colors

For ODF it's not needed to abbreviate names and we prefer to use
full names. The theme color names in OOXML are abbreviated and the
same names were used also for ODF - this was changed now.

"color-table" used in "theme" element has reused the already
existing "color-table" element name in ODF, but they don't relate
to each other. The name was changed to "theme-colors", which makes
more sense anyway.

Change-Id: I61ec91895d301ad4343f2b977d5cbcf38e360b99
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152252
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 9747d9a6ea954dfca4152d36fdb28a8b77fec84b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152266
Tested-by: Jenkins CollaboraOffice 

diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx
index 5a38c20c289d..294d555c5669 100644
--- a/include/xmloff/xmltoken.hxx
+++ b/include/xmloff/xmltoken.hxx
@@ -3486,21 +3486,21 @@ namespace xmloff::token {
 XML_LINKED_STYLE_NAME,
 
 XML_THEME,
+XML_THEME_COLORS,
 XML_THEME_TYPE,
 XML_CHAR_COMPLEX_COLOR,
 XML_FILL_COMPLEX_COLOR,
-XML_DK1,
-XML_LT1,
-XML_DK2,
-XML_LT2,
+XML_DARK1,
+XML_LIGHT1,
+XML_DARK2,
+XML_LIGHT2,
 XML_ACCENT1,
 XML_ACCENT2,
 XML_ACCENT3,
 XML_ACCENT4,
 XML_ACCENT5,
 XML_ACCENT6,
-XML_HLINK,
-XML_FOLHLINK,
+XML_FOLLOWED_HYPERLINK,
 
 XML_CONTENT_CONTROL,
 XML_SHOWING_PLACE_HOLDER,
diff --git a/oox/qa/unit/data/ReferenceShapeFill.fodp 
b/oox/qa/unit/data/ReferenceShapeFill.fodp
index 09a231c0344d..d3db08712ac9 100644
--- a/oox/qa/unit/data/ReferenceShapeFill.fodp
+++ b/oox/qa/unit/data/ReferenceShapeFill.fodp
@@ -350,28 +350,28 @@



-
+

   
   



-
+

   
   



-
+

   
   



-
+

   
   
@@ -489,7 +489,7 @@



-
+

   
   
@@ -585,7 +585,7 @@
   
   

-
+

   
   
@@ -753,20 +753,20 @@
   
   

-
- 
- 
- 
- 
+
+ 
+ 
+ 
+ 
  
  
  
  
  
  
- 
- 
-
+ 
+ 
+


 
diff --git a/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng 
b/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng
index 9e97a5d03317..50968cb1a62e 100644
--- a/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng
+++ b/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng
@@ -3239,7 +3239,7 @@ 
xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.
   
 
   
-  
+  
 
   
 
@@ -3248,9 +3248,9 @@ 
xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.
   
 
   
-  
-
-  
+  
+
+  
   
 
   
@@ -3269,7 +3269,7 @@ 
xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.
 
   
   
-
+
   
 
   
@@ -3382,24 +3382,18 @@ 
xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.
   
   
 
-  
-  dk1
-  
-  lt1
-  
-  dk2
-  
-  lt2
+  dark1
+  light1
+  dark2
+  light2
   accent1
   accent2
   accent3
   

[Libreoffice-commits] core.git: cui/source include/svx

2023-06-01 Thread Tomaž Vajngerl (via logerrit)
 cui/source/inc/cuitabarea.hxx   |4 -
 cui/source/tabpages/tpcolor.cxx |   91 
 include/svx/Palette.hxx |   31 +++--
 3 files changed, 76 insertions(+), 50 deletions(-)

New commits:
commit d7d2b172065f90aa2f61c0216f3722e868ae76a1
Author: Tomaž Vajngerl 
AuthorDate: Mon May 29 19:03:33 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Thu Jun 1 18:26:14 2023 +0200

prefix aPreviousColor and aCurrentColor in SvxColorTabPage

Change-Id: I631ce120d7a2825c6d170f4b25ffefdd155e04e2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152396
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/cui/source/inc/cuitabarea.hxx b/cui/source/inc/cuitabarea.hxx
index 7399f03eb0be..2d6c713236da 100644
--- a/cui/source/inc/cuitabarea.hxx
+++ b/cui/source/inc/cuitabarea.hxx
@@ -657,8 +657,8 @@ private:
 
 ColorModel  eCM;
 
-Color   aPreviousColor;
-NamedColor aCurrentColor;
+Color m_aPreviousColor;
+NamedColor m_aCurrentColor;
 
 PaletteManager maPaletteManager;
 SvxXRectPreview m_aCtlPreviewOld;
diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx
index bdefcf10114d..056afe822e7a 100644
--- a/cui/source/tabpages/tpcolor.cxx
+++ b/cui/source/tabpages/tpcolor.cxx
@@ -238,25 +238,25 @@ bool SvxColorTabPage::FillItemSet( SfxItemSet* rSet )
 {
 Color aColor = m_xValSetColorList->GetItemColor( 
m_xValSetColorList->GetSelectedItemId() );
 OUString sColorName;
-if ( aCurrentColor.m_aColor == aColor )
+if (m_aCurrentColor.m_aColor == aColor)
sColorName = m_xValSetColorList->GetItemText( 
m_xValSetColorList->GetSelectedItemId() );
 else
-   sColorName = "#" + 
aCurrentColor.m_aColor.AsRGBHexString().toAsciiUpperCase();
-maPaletteManager.AddRecentColor( aCurrentColor.m_aColor, sColorName );
-XFillColorItem aColorItem( sColorName, aCurrentColor.m_aColor );
-model::ThemeColorType eType = 
model::convertToThemeColorType(aCurrentColor.m_nThemeIndex);
+   sColorName = "#" + 
m_aCurrentColor.m_aColor.AsRGBHexString().toAsciiUpperCase();
+maPaletteManager.AddRecentColor( m_aCurrentColor.m_aColor, sColorName );
+XFillColorItem aColorItem( sColorName, m_aCurrentColor.m_aColor );
+model::ThemeColorType eType = 
model::convertToThemeColorType(m_aCurrentColor.m_nThemeIndex);
 if (eType != model::ThemeColorType::Unknown)
 {
 aColorItem.getComplexColor().setSchemeColor(eType);
 }
 aColorItem.getComplexColor().clearTransformations();
-if (aCurrentColor.m_nLumMod != 1)
+if (m_aCurrentColor.m_nLumMod != 1)
 {
-
aColorItem.getComplexColor().addTransformation({model::TransformationType::LumMod,
 aCurrentColor.m_nLumMod});
+
aColorItem.getComplexColor().addTransformation({model::TransformationType::LumMod,
 m_aCurrentColor.m_nLumMod});
 }
-if (aCurrentColor.m_nLumOff != 0)
+if (m_aCurrentColor.m_nLumOff != 0)
 {
-
aColorItem.getComplexColor().addTransformation({model::TransformationType::LumOff,
 aCurrentColor.m_nLumOff});
+
aColorItem.getComplexColor().addTransformation({model::TransformationType::LumOff,
 m_aCurrentColor.m_nLumOff});
 }
 rSet->Put( aColorItem );
 rSet->Put( XFillStyleItem( drawing::FillStyle_SOLID ) );
@@ -278,7 +278,7 @@ void SvxColorTabPage::Reset( const SfxItemSet* rSet )
 if ( nState >= SfxItemState::DEFAULT )
 {
 XFillColorItem aColorItem( rSet->Get( XATTR_FILLCOLOR ) );
-aPreviousColor = aColorItem.GetColorValue();
+m_aPreviousColor = aColorItem.GetColorValue();
 aNewColor = aColorItem.GetColorValue();
 }
 
@@ -304,12 +304,12 @@ std::unique_ptr 
SvxColorTabPage::Create(weld::Container* pPage, weld
 IMPL_LINK_NOARG(SvxColorTabPage, SpinValueHdl_Impl, weld::SpinButton&, void)
 {
 // read current MtrFields, if cmyk, then k-value as transparency
-aCurrentColor.m_aColor = 
Color(static_cast(PercentToColor_Impl(m_xRcustom->get_value())),
+m_aCurrentColor.m_aColor = 
Color(static_cast(PercentToColor_Impl(m_xRcustom->get_value())),
   
static_cast(PercentToColor_Impl(m_xGcustom->get_value())),
   
static_cast(PercentToColor_Impl(m_xBcustom->get_value(;
 UpdateColorValues();
 
-rXFSet.Put( XFillColorItem( OUString(), aCurrentColor.m_aColor ) );
+rXFSet.Put( XFillColorItem( OUString(), m_aCurrentColor.m_aColor ) );
 m_aCtlPreviewNew.SetAttributes( aXFillAttr.GetItemSet() );
 
 m_aCtlPreviewNew.Invalidate();
@@ -318,13 +318,13 @@ IMPL_LINK_NOARG(SvxColorTabPage, SpinValueHdl_Impl, 
weld::SpinButton&, void)
 IMPL_LINK_NOARG(SvxColorTabPage, MetricSpinValueHdl_Impl, 
weld::MetricSpinButton&, void)
 {
 // read current MtrFields, if cmyk, then k-value as transparency
-aCurrentColor.m_aColor = Color(ColorTransparency, 

[Libreoffice-commits] core.git: cui/qa cui/source include/svx svx/source

2023-06-01 Thread Tomaž Vajngerl (via logerrit)
 cui/qa/uitest/dialogs/chardlg.py   |4 
 cui/source/tabpages/tpcolor.cxx|8 +
 include/svx/PaletteManager.hxx |   25 -
 include/svx/strings.hrc|   15 +--
 svx/source/tbxctrls/PaletteManager.cxx |  155 +++--
 svx/source/tbxctrls/tbcontrl.cxx   |   14 +-
 6 files changed, 174 insertions(+), 47 deletions(-)

New commits:
commit e6215c7233c0fb437a81b51c8a8a30bb53eef65f
Author: Tomaž Vajngerl 
AuthorDate: Thu May 25 00:53:22 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Thu Jun 1 18:25:58 2023 +0200

tdf#153361 improve theme color generation in color picker

The theme color generator needs to take color luminocity into
account, so that the very dark or very light colors are properly
shaded. Otherwise a too dark color will generate a too dark (almost
black) color variant, or a too light a too light (almost white)
color variant. However those colors aren't useful.

Change-Id: Id803a8f6f1a79cbc822ed2d7faca9bec228c0188
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152237
Tested-by: Tomaž Vajngerl 
Reviewed-by: Tomaž Vajngerl 

diff --git a/cui/qa/uitest/dialogs/chardlg.py b/cui/qa/uitest/dialogs/chardlg.py
index 4a756cf6c979..85e60f766238 100644
--- a/cui/qa/uitest/dialogs/chardlg.py
+++ b/cui/qa/uitest/dialogs/chardlg.py
@@ -115,8 +115,8 @@ class Test(UITestCase):
 # AssertionError: 1 != 2000
 # i.e. the effects where not applied, luminance modulation was the 
default instead of a
 # custom value.
-self.assertEqual(portion.CharColorLumMod, 2000)
-self.assertEqual(portion.CharColorLumOff, 8000)
+self.assertEqual(portion.CharColorLumMod, 5000)
+self.assertEqual(portion.CharColorLumOff, 5000)
 
 def testSvxCharEffectsPageWriter(self):
 # Start Writer.
diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx
index 470b1c13a866..bdefcf10114d 100644
--- a/cui/source/tabpages/tpcolor.cxx
+++ b/cui/source/tabpages/tpcolor.cxx
@@ -522,7 +522,13 @@ IMPL_LINK(SvxColorTabPage, SelectValSetHdl_Impl, 
ValueSet*, pValSet, void)
 aNamedColor.m_aColor = aColor;
 if (bThemePaletteSelected)
 {
-PaletteManager::GetThemeIndexLumModOff(nPos, 
aNamedColor.m_nThemeIndex, aNamedColor.m_nLumMod, aNamedColor.m_nLumOff);
+sal_uInt16 nThemeIndex;
+sal_uInt16 nEffectIndex;
+if (PaletteManager::GetThemeAndEffectIndex(nPos, nThemeIndex, 
nEffectIndex))
+{
+aNamedColor.m_nThemeIndex = nThemeIndex;
+maPaletteManager.GetLumModOff(nThemeIndex, nEffectIndex, 
aNamedColor.m_nLumMod, aNamedColor.m_nLumOff);
+}
 }
 
 ChangeColor(aNamedColor, false);
diff --git a/include/svx/PaletteManager.hxx b/include/svx/PaletteManager.hxx
index c6d1712a12f4..37d22b92ec64 100644
--- a/include/svx/PaletteManager.hxx
+++ b/include/svx/PaletteManager.hxx
@@ -32,6 +32,26 @@ namespace com::sun::star::uno { class XComponentContext; }
 namespace svx { class ToolboxButtonColorUpdaterBase; }
 namespace weld { class Window; }
 
+enum class ThemePaletteColorType
+{
+Black,
+White,
+Low,
+High,
+Normal
+};
+
+struct ThemePaletteData
+{
+ThemePaletteColorType meType = ThemePaletteColorType::Normal;
+Color maColor;
+};
+
+struct ThemePaletteCollection
+{
+std::array maData;
+};
+
 class SVXCORE_DLLPUBLIC PaletteManager
 {
 const sal_uInt16mnMaxRecentColors;
@@ -49,6 +69,7 @@ class SVXCORE_DLLPUBLIC PaletteManager
 ColorSelectFunction maColorSelectFunction;
 
 std::unique_ptr m_pColorDlg;
+std::optional moThemePaletteCollection;
 
 PaletteManager(const PaletteManager* pClone);
 public:
@@ -79,8 +100,8 @@ public:
 
 PaletteManager* Clone() const;
 
-static void GetThemeIndexLumModOff(sal_uInt16 nItemId, sal_Int16& 
rThemeIndex,
-   sal_Int16& rLumMod, sal_Int16& rLumOff);
+static bool GetThemeAndEffectIndex(sal_uInt16 nItemId, sal_uInt16& 
rThemeIndex, sal_uInt16& rEffectIndex);
+bool GetLumModOff(sal_uInt16 nThemeIndex, sal_uInt16 nEffect, sal_Int16& 
rLumMod, sal_Int16& rLumOff);
 
 static void DispatchColorCommand(const OUString& aCommand, const 
NamedColor& rColor);
 };
diff --git a/include/svx/strings.hrc b/include/svx/strings.hrc
index e0573c485d99..249d01060a39 100644
--- a/include/svx/strings.hrc
+++ b/include/svx/strings.hrc
@@ -1120,10 +1120,10 @@
 #define RID_SVXSTR_DOC_COLORS   
NC_("RID_SVXSTR_DOC_COLORS", "Document colors")
 #define RID_SVXSTR_THEME_COLORS 
NC_("RID_SVXSTR_THEME_COLORS", "Theme colors")
 #define RID_SVXSTR_DOC_COLOR_PREFIX 
NC_("RID_SVXSTR_DOC_COLOR_PREFIX", "Document Color")
-#define RID_SVXSTR_THEME_COLOR1 
NC_("RID_SVXSTR_THEME_COLOR1", "Background - Dark 1")
-#define 

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - chart2/source cui/source include/svx reportdesign/source svx/source

2023-06-01 Thread Tomaž Vajngerl (via logerrit)
 chart2/source/controller/sidebar/ChartColorWrapper.cxx |2 
 chart2/source/controller/sidebar/ChartColorWrapper.hxx |2 
 cui/source/inc/cuitabarea.hxx  |4 -
 cui/source/tabpages/chardlg.cxx|2 
 cui/source/tabpages/tpcolor.cxx|   22 +-
 include/svx/Palette.hxx|   23 +--
 include/svx/PaletteManager.hxx |2 
 include/svx/colorbox.hxx   |   10 ++--
 include/svx/tbcontrl.hxx   |2 
 reportdesign/source/ui/dlg/Condition.cxx   |4 -
 reportdesign/source/ui/dlg/Condition.hxx   |2 
 svx/source/tbxctrls/Palette.cxx|   13 --
 svx/source/tbxctrls/PaletteManager.cxx |4 -
 svx/source/tbxctrls/tbcontrl.cxx   |   35 -
 14 files changed, 49 insertions(+), 78 deletions(-)

New commits:
commit e538b0b10dea838ca7cf6329e67dc715bc6cf5ba
Author: Tomaž Vajngerl 
AuthorDate: Mon May 22 14:35:19 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Thu Jun 1 17:58:34 2023 +0200

svx: combine svx::NamedThemedColor into NamedColor

Change-Id: I9a9656ddce9c12564411cfcb3e8e8714ae74a418
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152236
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 9a4b768b0a22bd3ae627c7355bbd223b9cf65015)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152265
Tested-by: Jenkins CollaboraOffice 

diff --git a/chart2/source/controller/sidebar/ChartColorWrapper.cxx 
b/chart2/source/controller/sidebar/ChartColorWrapper.cxx
index fc2f8b79839b..bbaf95c56e7d 100644
--- a/chart2/source/controller/sidebar/ChartColorWrapper.cxx
+++ b/chart2/source/controller/sidebar/ChartColorWrapper.cxx
@@ -87,7 +87,7 @@ ChartColorWrapper::ChartColorWrapper(
 {
 }
 
-void ChartColorWrapper::operator()([[maybe_unused]] const OUString& , const 
svx::NamedThemedColor& rColor)
+void ChartColorWrapper::operator()([[maybe_unused]] const OUString& , const 
NamedColor& rColor)
 {
 css::uno::Reference xPropSet = 
getPropSet(mxModel);
 
diff --git a/chart2/source/controller/sidebar/ChartColorWrapper.hxx 
b/chart2/source/controller/sidebar/ChartColorWrapper.hxx
index c4d30a8a314c..6894726768d0 100644
--- a/chart2/source/controller/sidebar/ChartColorWrapper.hxx
+++ b/chart2/source/controller/sidebar/ChartColorWrapper.hxx
@@ -28,7 +28,7 @@ public:
 SvxColorToolBoxControl* pControl,
 OUString  rPropertyName);
 
-void operator()(const OUString& rCommand, const svx::NamedThemedColor& 
rColor);
+void operator()(const OUString& rCommand, const NamedColor& rColor);
 // ColorSelectFunction signature
 
 void updateModel(const rtl::Reference<::chart::ChartModel>& xModel);
diff --git a/cui/source/inc/cuitabarea.hxx b/cui/source/inc/cuitabarea.hxx
index b05ce7af425f..bc2d968f2443 100644
--- a/cui/source/inc/cuitabarea.hxx
+++ b/cui/source/inc/cuitabarea.hxx
@@ -658,7 +658,7 @@ private:
 ColorModel  eCM;
 
 Color   aPreviousColor;
-svx::NamedThemedColor aCurrentColor;
+NamedColor aCurrentColor;
 
 PaletteManager maPaletteManager;
 SvxXRectPreview m_aCtlPreviewOld;
@@ -714,7 +714,7 @@ private:
 DECL_LINK(SelectPaletteLBHdl, weld::ComboBox&, void);
 DECL_LINK( SelectValSetHdl_Impl, ValueSet*, void );
 DECL_LINK( SelectColorModeHdl_Impl, weld::Toggleable&, void );
-void ChangeColor(const svx::NamedThemedColor , bool 
bUpdatePreset = true);
+void ChangeColor(const NamedColor , bool bUpdatePreset = true);
 void SetColorModel(ColorModel eModel);
 void ChangeColorModel();
 void UpdateColorValues( bool bUpdatePreset = true );
diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx
index 438a9ac37cbf..46dd3ded5e6f 100644
--- a/cui/source/tabpages/chardlg.cxx
+++ b/cui/source/tabpages/chardlg.cxx
@@ -1572,7 +1572,7 @@ bool SvxCharEffectsPage::FillItemSetColor_Impl( 
SfxItemSet& rSet )
 sal_uInt16 nWhich = GetWhich( SID_ATTR_CHAR_COLOR );
 const SfxItemSet& rOldSet = GetItemSet();
 
-svx::NamedThemedColor aSelectedColor;
+NamedColor aSelectedColor;
 bool bChanged = m_bNewFontColor;
 
 if (bChanged)
diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx
index 50019764830f..fd458ee9b08f 100644
--- a/cui/source/tabpages/tpcolor.cxx
+++ b/cui/source/tabpages/tpcolor.cxx
@@ -210,9 +210,9 @@ void SvxColorTabPage::ActivatePage( const SfxItemSet& )
 ChangeColorModel();
 
 const Color aColor = pFillColorItem->GetColorValue();
-svx::NamedThemedColor aThemedColor;
-aThemedColor.m_aColor = aColor;
-ChangeColor( aThemedColor );
+NamedColor aNamedColor;
+aNamedColor.m_aColor = aColor;
+ChangeColor(aNamedColor);
 sal_Int32 

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - 2 commits - chart2/source cui/source include/svx include/xmloff oox/qa reportdesign/source schema/libreoffice sc/source sd/source s

2023-06-01 Thread Tomaž Vajngerl (via logerrit)
 chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx |2 
 cui/source/tabpages/tphatch.cxx  |2 
 cui/source/tabpages/tpline.cxx   |4 -
 include/svx/Palette.hxx  |   14 
 include/xmloff/xmltoken.hxx  |1 
 oox/qa/unit/data/ReferenceShapeFill.fodp |   18 ++---
 reportdesign/source/ui/dlg/Condition.cxx |2 
 sc/source/ui/optdlg/tpview.cxx   |   18 ++---
 schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng  |   20 +++---
 sd/source/ui/dlg/copydlg.cxx |4 -
 svx/source/engine3d/float3d.cxx  |2 
 svx/source/tbxctrls/Palette.cxx  |8 +-
 svx/source/tbxctrls/PaletteManager.cxx   |   14 ++--
 svx/source/tbxctrls/tbcontrl.cxx |   34 +--
 svx/source/tbxctrls/tbxcolorupdate.cxx   |4 -
 xmloff/qa/unit/draw.cxx  |   24 +++
 xmloff/source/core/xmltoken.cxx  |5 -
 xmloff/source/text/XMLComplexColorContext.cxx|2 
 xmloff/source/text/XMLComplexColorExport.cxx |2 
 xmloff/source/token/tokens.txt   |5 -
 20 files changed, 101 insertions(+), 84 deletions(-)

New commits:
commit f72273402b96ad54e27a73d99d29296efe61b8e3
Author: Tomaž Vajngerl 
AuthorDate: Mon May 22 14:16:01 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Thu Jun 1 17:58:23 2023 +0200

svx: change NamedColor be a struct instead of std::pair

Change-Id: Ice1625e8cae8da859ea8a940b3f8e40f6f9d7037
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152235
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 8e87f1f2ff4df763e29bdc097786230c6293744b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152264
Tested-by: Tomaž Vajngerl 

diff --git a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx 
b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx
index 7cb38e9e8b48..8e06eee8fe18 100644
--- a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx
+++ b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx
@@ -101,7 +101,7 @@ namespace
 void lcl_selectColor(ColorListBox& rListBox, const Color& rColor)
 {
 rListBox.SetNoSelection();
-rListBox.SelectEntry(std::make_pair(rColor, 
lcl_makeColorName(rColor)));
+rListBox.SelectEntry({rColor, lcl_makeColorName(rColor)});
 }
 
 ::chart::LightSource lcl_getLightSourceFromProperties(
diff --git a/cui/source/tabpages/tphatch.cxx b/cui/source/tabpages/tphatch.cxx
index 1a35114739fc..879e68a0462c 100644
--- a/cui/source/tabpages/tphatch.cxx
+++ b/cui/source/tabpages/tphatch.cxx
@@ -245,7 +245,7 @@ bool SvxHatchTabPage::FillItemSet( SfxItemSet* rSet )
 if (m_xCbBackgroundColor->get_active())
 {
 NamedColor aColor = m_xLbBackgroundColor->GetSelectedEntry();
-rSet->Put(XFillColorItem(aColor.second, aColor.first));
+rSet->Put(XFillColorItem(aColor.m_aName, aColor.m_aColor));
 }
 return true;
 }
diff --git a/cui/source/tabpages/tpline.cxx b/cui/source/tabpages/tpline.cxx
index 85efe01a1c2f..01786624aa02 100644
--- a/cui/source/tabpages/tpline.cxx
+++ b/cui/source/tabpages/tpline.cxx
@@ -457,7 +457,7 @@ bool SvxLineTabPage::FillItemSet( SfxItemSet* rAttrs )
 if (m_xLbColor->IsValueChangedFromSaved())
 {
 NamedColor aColor = m_xLbColor->GetSelectedEntry();
-XLineColorItem aItem(aColor.second, aColor.first);
+XLineColorItem aItem(aColor.m_aName, aColor.m_aColor);
 pOld = GetOldItem( *rAttrs, XATTR_LINECOLOR );
 if ( !pOld || !( *static_cast(pOld) == aItem ) )
 {
@@ -759,7 +759,7 @@ void SvxLineTabPage::FillXLSet_Impl()
 
 m_rXLSet.Put( XLineWidthItem( GetCoreValue( *m_xMtrLineWidth, m_ePoolUnit 
) ) );
 NamedColor aColor = m_xLbColor->GetSelectedEntry();
-m_rXLSet.Put(XLineColorItem(aColor.second, aColor.first));
+m_rXLSet.Put(XLineColorItem(aColor.m_aName, aColor.m_aColor));
 
 // Centered line end
 if( m_xTsbCenterStart->get_state() == TRISTATE_TRUE )
diff --git a/include/svx/Palette.hxx b/include/svx/Palette.hxx
index b24825be3d3c..8965138c7831 100644
--- a/include/svx/Palette.hxx
+++ b/include/svx/Palette.hxx
@@ -29,10 +29,22 @@
 
 class SvxColorValueSet;
 
-typedef std::pair NamedColor;
+struct SVXCORE_DLLPUBLIC NamedColor
+{
+Color m_aColor;
+OUString m_aName;
+
+NamedColor() = default;
+
+NamedColor(Color const& rColor, OUString const& rName)
+: m_aColor(rColor)
+, m_aName(rName)
+{}
+};
 
 namespace svx
 {
+
 /// A color with an optional name and other theming-related properties.
 struct 

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - 2 commits - oox/qa xmloff/inc xmloff/source

2023-06-01 Thread Tomaž Vajngerl (via logerrit)
 dev/null |binary
 oox/qa/unit/data/ReferenceShapeFill.fodp |  838 +++
 oox/qa/unit/export.cxx   |2 
 xmloff/source/draw/sdpropls.cxx  |2 
 xmloff/source/text/txtprhdl.cxx  |2 
 5 files changed, 841 insertions(+), 3 deletions(-)

New commits:
commit 3577f734b607f4d044018f1295328367fdfbbf48
Author: Tomaž Vajngerl 
AuthorDate: Sun May 21 18:09:12 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Thu Jun 1 15:19:57 2023 +0200

oox: convert odp documents to fodp so it is easiert to change

Mainly to change the non yet fixed theme ODF format.

Change-Id: Iad51de7b4f9a721e566fe12266e633534c15bb54
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152052
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit f0dbebc76b819adebf228fbdb0f25a6ee14187c9)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152242
Tested-by: Jenkins CollaboraOffice 

diff --git a/oox/qa/unit/data/ReferenceShapeFill.fodp 
b/oox/qa/unit/data/ReferenceShapeFill.fodp
new file mode 100644
index ..6d406c32
--- /dev/null
+++ b/oox/qa/unit/data/ReferenceShapeFill.fodp
@@ -0,0 +1,838 @@
+
+
+http://www.w3.org/TR/css3-text/; 
xmlns:grddl="http://www.w3.org/2003/g/data-view#; 
xmlns:xhtml="http://www.w3.org/1999/xhtml; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema; 
xmlns:xforms="http://www.w3.org/2002/xforms; 
xmlns:dom="http://www.w3.org/2001/xml-events; 
xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" 
xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" 
xmlns:math="http://www.w3.org/1998/Math/MathML; 
xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" 
xmlns:ooo="http://openoffice.org/2004/office; 
xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" 
xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" 
xmlns:ooow="http://ope
 noffice.org/2004/writer" xmlns:xlink="http://www.w3.org/1999/xlink; 
xmlns:drawooo="http://openoffice.org/2010/draw; 
xmlns:oooc="http://openoffice.org/2004/calc; 
xmlns:dc="http://purl.org/dc/elements/1.1/; 
xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0"
 xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" 
xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" 
xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" 
xmlns:tableooo="http://openoffice.org/2009/table; 
xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" 
xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" 
xmlns:rpt="http://openoffice.org/2005/report; 
xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0"
 xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" 
xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" 
xmlns:officeooo="http://openoffice.org/2009/office; 
xmlns:table="urn:oasis:names:tc:opendocument:x
 mlns:table:1.0" 
xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" 
xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" 
xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" 
xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0"
 office:version="1.3" 
office:mimetype="application/vnd.oasis.opendocument.presentation">
+ PowerPoint 
Presentationquikeequikee12023-01-01T23:48:392023-01-01T23:48:54P0DLibreOfficeDev/7.6.0.0.alpha1$Linux_X86_64
 
LibreOffice_project/d7984b1f13530624080dca2068c2cfa08d5341fa16.Widescreen1
+ 
+  
+   -2187
+   -513
+   34909
+   23435
+   
+
+ view1
+ false
+ false
+ true
+ true
+ true
+ true
+ false
+ false
+ true
+ 1500
+ false
+ Hw==
+ Hw==
+ 
+ false
+ true
+ false
+ 0
+ 0
+ false
+ true
+ true
+ 4
+ 0
+ -2703
+ -512
+ 34880
+ 24439
+ 2000
+ 2000
+ 500
+ 500
+ 2000
+ 4
+ 2000
+ 4
+ false
+ 1500
+ true
+ false
+ true
+ false
+ false
+
+   
+  
+  
+   6
+   false
+   false
+   false
+   false
+   false
+   0
+   false
+   false
+   true
+   true
+   true
+   true
+   false
+   true
+   $(brandbaseurl)/share/palette%3B$(userpath)/config/standard.soe
+   true
+   true
+   

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - xmloff/inc xmloff/Library_xo.mk xmloff/source

2023-06-01 Thread Tomaž Vajngerl (via logerrit)
 xmloff/Library_xo.mk |2 +-
 xmloff/inc/XMLComplexColorExport.hxx |4 ++--
 xmloff/source/text/XMLComplexColorExport.cxx |8 
 xmloff/source/text/txtexppr.cxx  |4 ++--
 xmloff/source/text/txtexppr.hxx  |4 ++--
 5 files changed, 11 insertions(+), 11 deletions(-)

New commits:
commit 6de688d2ac72036ff5ad546f6a6d84620a945315
Author: Tomaž Vajngerl 
AuthorDate: Sat May 20 15:01:55 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Thu Jun 1 15:19:20 2023 +0200

xmloff: rename XMLThemeColorExport to XMLComplexColorExport

Change-Id: I3d943f20e76b8f3e0409d307d11e3bf16489bf02
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152050
Tested-by: Tomaž Vajngerl 
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 66fff7efab4dd1ff08b43ed6d2d557ecad578509)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152240
Tested-by: Jenkins CollaboraOffice 

diff --git a/xmloff/Library_xo.mk b/xmloff/Library_xo.mk
index a08fc79d8ac0..588fefdbb17b 100644
--- a/xmloff/Library_xo.mk
+++ b/xmloff/Library_xo.mk
@@ -304,6 +304,7 @@ $(eval $(call gb_Library_add_exception_objects,xo,\
 xmloff/source/text/XMLChangeInfoContext \
 xmloff/source/text/XMLChangedRegionImportContext \
 xmloff/source/text/XMLComplexColorContext \
+xmloff/source/text/XMLComplexColorExport \
 xmloff/source/text/XMLFootnoteBodyImportContext \
 xmloff/source/text/XMLFootnoteConfigurationImportContext \
 xmloff/source/text/XMLFootnoteImportContext \
@@ -342,7 +343,6 @@ $(eval $(call gb_Library_add_exception_objects,xo,\
 xmloff/source/text/XMLTextCharStyleNamesElementExport \
 xmloff/source/text/XMLTextColumnsContext \
 xmloff/source/text/XMLTextColumnsExport \
-xmloff/source/text/XMLThemeColorExport \
 xmloff/source/text/XMLTextFrameContext \
 xmloff/source/text/XMLTextFrameHyperlinkContext \
 xmloff/source/text/XMLTextHeaderFooterContext \
diff --git a/xmloff/inc/XMLThemeColorExport.hxx 
b/xmloff/inc/XMLComplexColorExport.hxx
similarity index 89%
rename from xmloff/inc/XMLThemeColorExport.hxx
rename to xmloff/inc/XMLComplexColorExport.hxx
index 9a360c2782d2..d62e10fd5c1b 100644
--- a/xmloff/inc/XMLThemeColorExport.hxx
+++ b/xmloff/inc/XMLComplexColorExport.hxx
@@ -17,12 +17,12 @@ class Any;
 }
 class SvXMLExport;
 
-class XMLThemeColorExport
+class XMLComplexColorExport
 {
 SvXMLExport& mrExport;
 
 public:
-XMLThemeColorExport(SvXMLExport& rExport);
+XMLComplexColorExport(SvXMLExport& rExport);
 
 void exportXML(const css::uno::Any& rAny, sal_uInt16 nPrefix, const 
OUString& rLocalName);
 };
diff --git a/xmloff/source/text/XMLThemeColorExport.cxx 
b/xmloff/source/text/XMLComplexColorExport.cxx
similarity index 91%
rename from xmloff/source/text/XMLThemeColorExport.cxx
rename to xmloff/source/text/XMLComplexColorExport.cxx
index 9a48faf63546..a118d12ba689 100644
--- a/xmloff/source/text/XMLThemeColorExport.cxx
+++ b/xmloff/source/text/XMLComplexColorExport.cxx
@@ -7,7 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#include 
+#include 
 
 #include 
 
@@ -21,7 +21,7 @@
 using namespace css;
 using namespace ::xmloff::token;
 
-XMLThemeColorExport::XMLThemeColorExport(SvXMLExport& rExport)
+XMLComplexColorExport::XMLComplexColorExport(SvXMLExport& rExport)
 : mrExport(rExport)
 {
 }
@@ -34,8 +34,8 @@ constexpr const std::array 
constThemeColorTypeToToken{
 };
 }
 
-void XMLThemeColorExport::exportXML(const uno::Any& rAny, sal_uInt16 nPrefix,
-const OUString& rLocalName)
+void XMLComplexColorExport::exportXML(const uno::Any& rAny, sal_uInt16 nPrefix,
+  const OUString& rLocalName)
 {
 uno::Reference xComplexColor;
 rAny >>= xComplexColor;
diff --git a/xmloff/source/text/txtexppr.cxx b/xmloff/source/text/txtexppr.cxx
index 6e792e35d8fa..3713fb72c1d0 100644
--- a/xmloff/source/text/txtexppr.cxx
+++ b/xmloff/source/text/txtexppr.cxx
@@ -73,7 +73,7 @@ void XMLTextExportPropertySetMapper::handleElementItem(
 break;
 
 case CTF_COMPLEX_COLOR:
-pThis->maThemeColorExport.exportXML(rProperty.maValue,
+pThis->maComplexColorExport.exportXML(rProperty.maValue,
 
getPropertySetMapper()->GetEntryNameSpace(rProperty.mnIndex),
 
getPropertySetMapper()->GetEntryXMLName(rProperty.mnIndex));
 break;
@@ -216,7 +216,7 @@ 
XMLTextExportPropertySetMapper::XMLTextExportPropertySetMapper(
 maDropCapExport( rExp ),
 maTabStopExport( rExp ),
 maTextColumnsExport( rExp ),
-maThemeColorExport(rExp),
+maComplexColorExport(rExp),
 maBackgroundImageExport( rExp )
 {
 }
diff --git a/xmloff/source/text/txtexppr.hxx b/xmloff/source/text/txtexppr.hxx
index bb7e3c230a2c..afc54a074973 100644
--- a/xmloff/source/text/txtexppr.hxx
+++ b/xmloff/source/text/txtexppr.hxx
@@ -24,7 +24,7 @@
 #include 

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - xmloff/inc xmloff/Library_xo.mk xmloff/source

2023-06-01 Thread Tomaž Vajngerl (via logerrit)
 xmloff/Library_xo.mk  |2 +-
 xmloff/inc/XMLComplexColorContext.hxx |8 
 xmloff/source/draw/XMLShapePropertySetContext.cxx |4 ++--
 xmloff/source/text/XMLComplexColorContext.cxx |8 
 xmloff/source/text/XMLTextPropertySetContext.cxx  |4 ++--
 xmloff/source/text/XMLTextShapeStyleContext.cxx   |4 ++--
 6 files changed, 15 insertions(+), 15 deletions(-)

New commits:
commit c7e19bc78c186184dd5bbc51637917f75ead525e
Author: Tomaž Vajngerl 
AuthorDate: Sat May 20 14:51:49 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Thu Jun 1 11:19:42 2023 +0200

xmloff: rename XMLThemeColorContext to XMLComplexColorContext

Change-Id: I039aea6656cc8dedd74782f4fda8b0e1c25d3910
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152029
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit e1cc0f3e7adc9d4c930a1c37bbe45c69dd3725ab)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152239
Tested-by: Jenkins CollaboraOffice 

diff --git a/xmloff/Library_xo.mk b/xmloff/Library_xo.mk
index 11934fbb2016..a08fc79d8ac0 100644
--- a/xmloff/Library_xo.mk
+++ b/xmloff/Library_xo.mk
@@ -303,6 +303,7 @@ $(eval $(call gb_Library_add_exception_objects,xo,\
 xmloff/source/text/XMLChangeImportContext \
 xmloff/source/text/XMLChangeInfoContext \
 xmloff/source/text/XMLChangedRegionImportContext \
+xmloff/source/text/XMLComplexColorContext \
 xmloff/source/text/XMLFootnoteBodyImportContext \
 xmloff/source/text/XMLFootnoteConfigurationImportContext \
 xmloff/source/text/XMLFootnoteImportContext \
@@ -341,7 +342,6 @@ $(eval $(call gb_Library_add_exception_objects,xo,\
 xmloff/source/text/XMLTextCharStyleNamesElementExport \
 xmloff/source/text/XMLTextColumnsContext \
 xmloff/source/text/XMLTextColumnsExport \
-xmloff/source/text/XMLThemeColorContext \
 xmloff/source/text/XMLThemeColorExport \
 xmloff/source/text/XMLTextFrameContext \
 xmloff/source/text/XMLTextFrameHyperlinkContext \
diff --git a/xmloff/inc/XMLThemeColorContext.hxx 
b/xmloff/inc/XMLComplexColorContext.hxx
similarity index 72%
rename from xmloff/inc/XMLThemeColorContext.hxx
rename to xmloff/inc/XMLComplexColorContext.hxx
index 8bab725c44a6..2d43da23fedd 100644
--- a/xmloff/inc/XMLThemeColorContext.hxx
+++ b/xmloff/inc/XMLComplexColorContext.hxx
@@ -13,15 +13,15 @@
 #include "XMLElementPropertyContext.hxx"
 #include 
 
-class XMLThemeColorContext final : public XMLElementPropertyContext
+class XMLComplexColorContext final : public XMLElementPropertyContext
 {
 model::ComplexColor maComplexColor;
 sal_Int32 mnRootElement;
 
 public:
-XMLThemeColorContext(SvXMLImport& rImport, sal_Int32 nElement,
- const 
css::uno::Reference& xAttrList,
- const XMLPropertyState& rProp, 
std::vector& rProps);
+XMLComplexColorContext(SvXMLImport& rImport, sal_Int32 nElement,
+   const 
css::uno::Reference& xAttrList,
+   const XMLPropertyState& rProp, 
std::vector& rProps);
 
 css::uno::Reference SAL_CALL 
createFastChildContext(
 sal_Int32 nElement,
diff --git a/xmloff/source/draw/XMLShapePropertySetContext.cxx 
b/xmloff/source/draw/XMLShapePropertySetContext.cxx
index 9db7cac43464..067e1e7d13a4 100644
--- a/xmloff/source/draw/XMLShapePropertySetContext.cxx
+++ b/xmloff/source/draw/XMLShapePropertySetContext.cxx
@@ -19,7 +19,7 @@
 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -84,7 +84,7 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > 
XMLShapePropertySetCon
 return new XMLTextColumnsContext(GetImport(), nElement, xAttrList, 
rProp, rProperties);
 
 case CTF_COMPLEX_COLOR:
-return new XMLThemeColorContext(GetImport(), nElement, xAttrList, 
rProp, rProperties);
+return new XMLComplexColorContext(GetImport(), nElement, xAttrList, 
rProp, rProperties);
 }
 
 return SvXMLPropertySetContext::createFastChildContext( nElement,
diff --git a/xmloff/source/text/XMLThemeColorContext.cxx 
b/xmloff/source/text/XMLComplexColorContext.cxx
similarity index 95%
rename from xmloff/source/text/XMLThemeColorContext.cxx
rename to xmloff/source/text/XMLComplexColorContext.cxx
index aeea540bbdf3..f506a71941d9 100644
--- a/xmloff/source/text/XMLThemeColorContext.cxx
+++ b/xmloff/source/text/XMLComplexColorContext.cxx
@@ -18,7 +18,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 using namespace css;
 using namespace xmloff::token;
@@ -29,7 +29,7 @@ SvXMLEnumMapEntry const pXML_ThemeColor_Enum[]
 { XML_ACCENT4, 7 },   { XML_ACCENT5, 8 },  { XML_ACCENT6, 9 }, { 
XML_HLINK, 10 },
 { XML_FOLHLINK, 11 }, { XML_TOKEN_INVALID, 0 } };
 
-XMLThemeColorContext::XMLThemeColorContext(
+XMLComplexColorContext::XMLComplexColorContext(
 SvXMLImport& rImport, sal_Int32 nElement,
 const 

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - 2 commits - cui/source docmodel/Library_docmodel.mk docmodel/source editeng/source include/docmodel include/editeng include/svx inc

2023-06-01 Thread Tomaž Vajngerl (via logerrit)
 cui/source/tabpages/tpcolor.cxx   |8 -
 docmodel/Library_docmodel.mk  |3 
 docmodel/source/color/ComplexColorJSON.cxx|   22 ++--
 docmodel/source/theme/ColorSet.cxx|   12 --
 docmodel/source/uno/UnoComplexColor.cxx   |   12 +-
 docmodel/source/uno/UnoThemeColor.cxx |   40 ---
 editeng/source/items/textitem.cxx |   53 +++--
 editeng/source/uno/unotext.cxx|2 
 include/docmodel/color/ComplexColor.hxx   |7 +
 include/docmodel/color/ComplexColorJSON.hxx   |9 -
 include/docmodel/theme/ColorSet.hxx   |2 
 include/docmodel/uno/UnoComplexColor.hxx  |5 
 include/docmodel/uno/UnoThemeColor.hxx|   55 --
 include/editeng/memberids.h   |4 
 include/editeng/unoprnms.hxx  |8 -
 include/editeng/unotext.hxx   |4 
 include/svx/svxids.hrc|2 
 include/svx/unoshprp.hxx  |4 
 include/svx/xcolit.hxx|9 -
 include/xmloff/txtprmap.hxx   |2 
 include/xmloff/xmltoken.hxx   |4 
 include/xmloff/xmltypes.hxx   |2 
 offapi/UnoApi_offapi.mk   |1 
 offapi/com/sun/star/util/XComplexColor.idl|9 +
 offapi/com/sun/star/util/XThemeColor.idl  |   26 
 oox/qa/unit/drawingml.cxx |   99 --
 oox/qa/unit/shape.cxx |   15 +-
 oox/source/drawingml/fillproperties.cxx   |   20 +--
 oox/source/drawingml/lineproperties.cxx   |   21 +--
 oox/source/drawingml/textcharacterproperties.cxx  |   16 +-
 oox/source/export/drawingml.cxx   |   27 ++--
 oox/source/token/properties.txt   |6 -
 sc/source/core/data/document.cxx  |   13 +-
 sd/qa/unit/uiimpress.cxx  |   40 +++
 sd/source/core/stlsheet.cxx   |   16 +-
 sd/source/ui/func/fuconstr.cxx|2 
 sd/source/ui/view/drviews2.cxx|   10 +
 svx/qa/unit/styles.cxx|   32 ++---
 svx/qa/unit/xoutdev.cxx   |   33 ++
 svx/sdi/svxitems.sdi  |4 
 svx/source/dialog/ThemeColorValueSet.cxx  |2 
 svx/source/dialog/ThemeDialog.cxx |1 
 svx/source/table/cell.cxx |   23 ++--
 svx/source/tbxctrls/PaletteManager.cxx|   16 +-
 svx/source/theme/ThemeColorChanger.cxx|   52 -
 svx/source/unodraw/unoprov.cxx|2 
 svx/source/unodraw/unoshap2.cxx   |2 
 svx/source/unodraw/unoshape.cxx   |   17 +--
 svx/source/xoutdev/xattr.cxx  |   63 +--
 sw/qa/core/theme/ThemeTest.cxx|   11 --
 sw/source/core/model/ThemeColorChanger.cxx|2 
 sw/source/core/unocore/unomap.cxx |4 
 sw/source/core/unocore/unomap1.cxx|6 -
 sw/source/core/unocore/unomapproperties.hxx   |6 -
 sw/source/filter/xml/xmlfmte.cxx  |2 
 writerfilter/source/dmapper/DomainMapper.cxx  |   14 +-
 writerfilter/source/dmapper/PropertyIds.cxx   |2 
 writerfilter/source/dmapper/PropertyIds.hxx   |2 
 writerfilter/source/dmapper/ThemeColorHandler.hxx |2 
 xmloff/inc/XMLThemeColorContext.hxx   |4 
 xmloff/inc/XMLThemeColorHandler.hxx   |   21 +--
 xmloff/inc/xmlprop.hxx|4 
 xmloff/qa/unit/draw.cxx   |  119 ++
 xmloff/source/core/xmltoken.cxx   |4 
 xmloff/source/draw/XMLShapePropertySetContext.cxx |2 
 xmloff/source/draw/sdpropls.cxx   |6 -
 xmloff/source/text/XMLTextPropertySetContext.cxx  |2 
 xmloff/source/text/XMLTextShapeStyleContext.cxx   |2 
 xmloff/source/text/XMLThemeColorContext.cxx   |8 -
 xmloff/source/text/XMLThemeColorExport.cxx|   19 +--
 xmloff/source/text/txtexppr.cxx   |2 
 xmloff/source/text/txtprhdl.cxx   |4 
 xmloff/source/text/txtprmap.cxx   |6 -
 73 files changed, 473 insertions(+), 618 deletions(-)

New commits:
commit 0e155e7ba984262200e3589d594325fe36b0ec14
Author: Tomaž Vajngerl 
AuthorDate: Thu May 11 23:01:10 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Thu Jun 1 11:19:28 2023 +0200

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 
(cherry picked from 

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - 2 commits - docmodel/source include/docmodel oox/qa oox/source sd/qa svx/source sw/inc sw/Library_sw.mk sw/qa sw/source xmloff/inc

2023-06-01 Thread Tomaž Vajngerl (via logerrit)
 docmodel/source/theme/Theme.cxx   |   18 +
 docmodel/source/uno/UnoTheme.cxx  |2 
 include/docmodel/theme/Theme.hxx  |8 +-
 oox/qa/unit/drawingml.cxx |4 -
 oox/source/drawingml/themeelementscontext.cxx |4 -
 oox/source/export/ThemeExport.cxx |4 -
 sd/qa/filter/eppt/eppt.cxx|6 -
 sd/qa/unit/uiimpress.cxx  |4 -
 svx/source/dialog/ThemeDialog.cxx |2 
 svx/source/svdraw/svdmodel.cxx|4 -
 svx/source/svdraw/svdpage.cxx |8 +-
 sw/Library_sw.mk  |1 
 sw/inc/strings.hrc|2 
 sw/inc/swundo.hxx |1 
 sw/qa/core/theme/ThemeTest.cxx|   82 +-
 sw/source/core/inc/ThemeColorChanger.hxx  |3 
 sw/source/core/inc/UndoThemeChange.hxx|   35 +++
 sw/source/core/model/ThemeColorChanger.cxx|   23 ---
 sw/source/core/undo/UndoThemeChange.cxx   |   48 +++
 sw/source/core/undo/undobj.cxx|3 
 sw/source/filter/xml/xmlfmte.cxx  |2 
 xmloff/inc/XMLThemeContext.hxx|4 -
 xmloff/qa/unit/draw.cxx   |8 +-
 xmloff/qa/unit/text.cxx   |4 -
 xmloff/source/draw/sdxmlexp.cxx   |2 
 xmloff/source/style/XMLThemeContext.cxx   |   12 +--
 26 files changed, 229 insertions(+), 65 deletions(-)

New commits:
commit 34872a4d4e721bdf17642d406b08d407e9cfe8b2
Author: Tomaž Vajngerl 
AuthorDate: Thu May 4 00:21:55 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Thu Jun 1 11:18:50 2023 +0200

sw: support Undo/Redo for theme colors

Change-Id: Ic4166ec4836545467866a70b4160f1adba0bad96
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151448
Tested-by: Tomaž Vajngerl 
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 33d35a2181c9cebf77bc1aa9322a2d11892de5fd)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152233
Tested-by: Jenkins CollaboraOffice 

diff --git a/sw/Library_sw.mk b/sw/Library_sw.mk
index 05dd36258649..be2f30b3acb9 100644
--- a/sw/Library_sw.mk
+++ b/sw/Library_sw.mk
@@ -482,6 +482,7 @@ $(eval $(call gb_Library_add_exception_objects,sw,\
 sw/source/core/undo/unspnd \
 sw/source/core/undo/untbl \
 sw/source/core/undo/untblk \
+sw/source/core/undo/UndoThemeChange \
 sw/source/core/unocore/SwXTextDefaults \
 sw/source/core/unocore/TextCursorHelper  \
 sw/source/core/unocore/XMLRangeHelper \
diff --git a/sw/inc/strings.hrc b/sw/inc/strings.hrc
index e6927179b875..22ee62908a16 100644
--- a/sw/inc/strings.hrc
+++ b/sw/inc/strings.hrc
@@ -589,6 +589,8 @@
 #define STR_UNDO_TABLE_DELETE   NC_("STR_UNDO_TABLE_DELETE", 
"Delete table")
 #define STR_UNDO_INSERT_FORM_FIELD  
NC_("STR_UNDO_INSERT_FORM_FIELD", "Insert form field")
 #define STR_UNDO_INSERT_PAGE_NUMBER 
NC_("STR_UNDO_INSERT_PAGE_NUMBER", "Insert page number")
+#define STR_UNDO_CHANGE_THEME_COLORS
NC_("STR_UNDO_CHANGE_THEME_COLORS", "Change document theme color")
+
 #define STR_DROP_DOWN_FIELD_ITEM_LIMIT  
NC_("STR_DROP_DOWN_FIELD_ITEM_LIMIT", "You can specify maximum of 25 items for 
a drop-down form field.")
 
 #define STR_ACCESS_DOC_NAME NC_("STR_ACCESS_DOC_NAME", 
"Document view")
diff --git a/sw/inc/swundo.hxx b/sw/inc/swundo.hxx
index 7e9e0108b71f..874e63413a10 100644
--- a/sw/inc/swundo.hxx
+++ b/sw/inc/swundo.hxx
@@ -167,6 +167,7 @@ enum class SwUndoId
 INSERT_FORM_FIELD, // 135
 OUTLINE_EDIT,  // 136
 INSERT_PAGE_NUMBER,// 137
+CHANGE_THEME = 148,
 };
 
 OUString GetUndoComment(SwUndoId eId);
diff --git a/sw/qa/core/theme/ThemeTest.cxx b/sw/qa/core/theme/ThemeTest.cxx
index 0802994aead6..f76460eb6b98 100644
--- a/sw/qa/core/theme/ThemeTest.cxx
+++ b/sw/qa/core/theme/ThemeTest.cxx
@@ -18,6 +18,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 using namespace css;
 
@@ -392,6 +394,82 @@ CPPUNIT_TEST_FIXTURE(SwCoreThemeTest, 
testDrawPageThemeExistsODT)
 CPPUNIT_ASSERT_EQUAL(Color(0xCCDDEA), 
pTheme->GetColor(model::ThemeColorType::Light2));
 }
 
+CPPUNIT_TEST_FIXTURE(SwCoreThemeTest, testThemeChanging)
+{
+createSwDoc("ThemeColorInHeading.docx");
+SwDoc* pDoc = getSwDoc();
+CPPUNIT_ASSERT(pDoc);
+SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+CPPUNIT_ASSERT(pWrtShell);
+SdrPage* pPage = 
pDoc->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0);
+CPPUNIT_ASSERT(pPage);
+
+// Check current theme colors
+{
+auto const& pTheme = pPage->getSdrPageProperties().GetTheme();
+CPPUNIT_ASSERT(pTheme);
+CPPUNIT_ASSERT_EQUAL(OUString(u"Office Theme"), pTheme->GetName());
+
+auto 

[Libreoffice-commits] core.git: include/docmodel oox/qa schema/libreoffice xmloff/qa xmloff/source

2023-05-26 Thread Tomaž Vajngerl (via logerrit)
 include/docmodel/color/ComplexColor.hxx |2 +
 oox/qa/unit/data/ReferenceShapeFill.fodp|   14 
 oox/qa/unit/data/tdf51195_Fontwork_ThemeColor.fodt  |4 +-
 oox/qa/unit/data/tdf51195_Fontwork_axialGradient.fodt   |8 ++--
 oox/qa/unit/data/tdf51195_Fontwork_rectGradient.fodt|8 ++--
 oox/qa/unit/data/tdf51195_Fontwork_squareGradient.fodt  |6 +--
 schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng |3 +
 xmloff/qa/unit/data/theme.fodp  |   20 ++--
 xmloff/qa/unit/draw.cxx |6 +++
 xmloff/source/text/XMLComplexColorContext.cxx   |8 
 xmloff/source/text/XMLComplexColorExport.cxx|1 
 11 files changed, 50 insertions(+), 30 deletions(-)

New commits:
commit 38e0e78998153463caf9c3c72ef7f4549ddff0e8
Author: Tomaž Vajngerl 
AuthorDate: Thu May 25 13:55:21 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Sat May 27 06:00:31 2023 +0200

xmloff: add color-type attribute to complex color

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 

diff --git a/include/docmodel/color/ComplexColor.hxx 
b/include/docmodel/color/ComplexColor.hxx
index d43318cdbe65..958f82f19b4e 100644
--- a/include/docmodel/color/ComplexColor.hxx
+++ b/include/docmodel/color/ComplexColor.hxx
@@ -95,6 +95,8 @@ public:
 public:
 ColorType getType() const { return meType; }
 
+void setType(ColorType eType) { meType = eType; }
+
 ThemeColorType getSchemeType() const { return meSchemeType; }
 
 Color getRGBColor() const { return Color(mnComponent1, mnComponent2, 
mnComponent3); }
diff --git a/oox/qa/unit/data/ReferenceShapeFill.fodp 
b/oox/qa/unit/data/ReferenceShapeFill.fodp
index d3db08712ac9..432891b0d849 100644
--- a/oox/qa/unit/data/ReferenceShapeFill.fodp
+++ b/oox/qa/unit/data/ReferenceShapeFill.fodp
@@ -350,28 +350,28 @@



-
+

   
   



-
+

   
   



-
+

   
   



-
+

   
   
@@ -489,7 +489,7 @@



-
+

   
   
@@ -531,7 +531,7 @@
   
   

-
+
  
 

@@ -585,7 +585,7 @@
   
   

-
+

   
   
diff --git a/oox/qa/unit/data/tdf51195_Fontwork_ThemeColor.fodt 
b/oox/qa/unit/data/tdf51195_Fontwork_ThemeColor.fodt
index 8d2f8726d53b..f7af1acc9bbd 100644
--- a/oox/qa/unit/data/tdf51195_Fontwork_ThemeColor.fodt
+++ b/oox/qa/unit/data/tdf51195_Fontwork_ThemeColor.fodt
@@ -358,7 +358,7 @@
   
   

-
+
  
  
 
@@ -367,7 +367,7 @@
   
   

-
+
  
 

diff --git a/oox/qa/unit/data/tdf51195_Fontwork_axialGradient.fodt 
b/oox/qa/unit/data/tdf51195_Fontwork_axialGradient.fodt
index fb792bd34e00..70f1448397f3 100644
--- a/oox/qa/unit/data/tdf51195_Fontwork_axialGradient.fodt
+++ b/oox/qa/unit/data/tdf51195_Fontwork_axialGradient.fodt
@@ -340,7 +340,7 @@
 


-
+

   
   
@@ -349,17 +349,17 @@
 


-
+

   
   

-
+

   
   

-
+
  
 

diff --git a/oox/qa/unit/data/tdf51195_Fontwork_rectGradient.fodt 
b/oox/qa/unit/data/tdf51195_Fontwork_rectGradient.fodt
index 85f1f6f9de89..018363fdab35 100644
--- a/oox/qa/unit/data/tdf51195_Fontwork_rectGradient.fodt
+++ b/oox/qa/unit/data/tdf51195_Fontwork_rectGradient.fodt
@@ -344,7 +344,7 @@
 


-
+

   
   
@@ -353,17 +353,17 @@
 


-
+

   
   

-
+

   
   

-
+
  
  
 
diff --git a/oox/qa/unit/data/tdf51195_Fontwork_squareGradient.fodt 
b/oox/qa/unit/data/tdf51195_Fontwork_squareGradient.fodt
index ea343737ff6a..6ab0b87822fc 100644
--- a/oox/qa/unit/data/tdf51195_Fontwork_squareGradient.fodt
+++ b/oox/qa/unit/data/tdf51195_Fontwork_squareGradient.fodt
@@ -344,7 +344,7 @@
 


-
+

   
   
@@ -353,12 +353,12 @@
 


-
+

   
   

-
+

   
   
diff --git a/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng 
b/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng
index d56acc1668ca..f01e1c8533e7 100644
--- a/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng
+++ b/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng
@@ -3493,6 +3493,9 @@ 
xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.
 
   
 
+  
+
+  
   
 
   
diff --git a/xmloff/qa/unit/data/theme.fodp b/xmloff/qa/unit/data/theme.fodp
index 

[Libreoffice-commits] core.git: include/xmloff oox/qa schema/libreoffice sw/qa sw/source xmloff/inc xmloff/qa xmloff/source

2023-05-25 Thread Tomaž Vajngerl (via logerrit)
 dev/null|binary
 include/xmloff/xmltoken.hxx |   12 
 oox/qa/unit/data/ReferenceShapeFill.fodp|   28 
 oox/qa/unit/data/tdf51195_Fontwork_ThemeColor.fodt  |   20 
 oox/qa/unit/data/tdf51195_Fontwork_axialGradient.fodt   |   16 
 oox/qa/unit/data/tdf51195_Fontwork_ellipticalGradient.fodt  |   18 
 oox/qa/unit/data/tdf51195_Fontwork_linearGradient.fodt  |   18 
 oox/qa/unit/data/tdf51195_Fontwork_radialGradient.fodt  |   18 
 oox/qa/unit/data/tdf51195_Fontwork_rectGradient.fodt|   16 
 oox/qa/unit/data/tdf51195_Fontwork_squareGradient.fodt  |   16 
 schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng |   28 
 sw/qa/core/theme/ThemeTest.cxx  |2 
 sw/qa/core/theme/data/ThemeColorInHeading.fodt  |  391 
 sw/source/filter/xml/xmlfmte.cxx|   14 
 xmloff/inc/XMLThemeContext.hxx  |   12 
 xmloff/qa/unit/data/theme.fodp  |  997 
 xmloff/qa/unit/draw.cxx |   10 
 xmloff/qa/unit/text.cxx |   21 
 xmloff/source/core/xmltoken.cxx |   29 
 xmloff/source/draw/sdxmlexp.cxx |   20 
 xmloff/source/style/XMLThemeContext.cxx |   34 
 xmloff/source/text/XMLComplexColorContext.cxx   |   19 
 xmloff/source/text/XMLComplexColorExport.cxx|4 
 xmloff/source/token/tokens.txt  |   12 
 24 files changed, 1575 insertions(+), 180 deletions(-)

New commits:
commit 9747d9a6ea954dfca4152d36fdb28a8b77fec84b
Author: Tomaž Vajngerl 
AuthorDate: Thu May 25 13:15:41 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Thu May 25 10:05:21 2023 +0200

xmloff: rename theme color names and color-table to theme-colors

For ODF it's not needed to abbreviate names and we prefer to use
full names. The theme color names in OOXML are abbreviated and the
same names were used also for ODF - this was changed now.

"color-table" used in "theme" element has reused the already
existing "color-table" element name in ODF, but they don't relate
to each other. The name was changed to "theme-colors", which makes
more sense anyway.

Change-Id: I61ec91895d301ad4343f2b977d5cbcf38e360b99
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152252
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx
index 2edbfac23f47..ef3725868aba 100644
--- a/include/xmloff/xmltoken.hxx
+++ b/include/xmloff/xmltoken.hxx
@@ -3489,21 +3489,21 @@ namespace xmloff::token {
 XML_LINKED_STYLE_NAME,
 
 XML_THEME,
+XML_THEME_COLORS,
 XML_THEME_TYPE,
 XML_CHAR_COMPLEX_COLOR,
 XML_FILL_COMPLEX_COLOR,
-XML_DK1,
-XML_LT1,
-XML_DK2,
-XML_LT2,
+XML_DARK1,
+XML_LIGHT1,
+XML_DARK2,
+XML_LIGHT2,
 XML_ACCENT1,
 XML_ACCENT2,
 XML_ACCENT3,
 XML_ACCENT4,
 XML_ACCENT5,
 XML_ACCENT6,
-XML_HLINK,
-XML_FOLHLINK,
+XML_FOLLOWED_HYPERLINK,
 
 XML_CONTENT_CONTROL,
 XML_SHOWING_PLACE_HOLDER,
diff --git a/oox/qa/unit/data/ReferenceShapeFill.fodp 
b/oox/qa/unit/data/ReferenceShapeFill.fodp
index 09a231c0344d..d3db08712ac9 100644
--- a/oox/qa/unit/data/ReferenceShapeFill.fodp
+++ b/oox/qa/unit/data/ReferenceShapeFill.fodp
@@ -350,28 +350,28 @@



-
+

   
   



-
+

   
   



-
+

   
   



-
+

   
   
@@ -489,7 +489,7 @@



-
+

   
   
@@ -585,7 +585,7 @@
   
   

-
+

   
   
@@ -753,20 +753,20 @@
   
   

-
- 
- 
- 
- 
+
+ 
+ 
+ 
+ 
  
  
  
  
  
  
- 
- 
-
+ 
+ 
+


 
diff --git a/oox/qa/unit/data/tdf51195_Fontwork_ThemeColor.fodt 
b/oox/qa/unit/data/tdf51195_Fontwork_ThemeColor.fodt
index 6f0da7b5c49b..8d2f8726d53b 100644
--- a/oox/qa/unit/data/tdf51195_Fontwork_ThemeColor.fodt
+++ b/oox/qa/unit/data/tdf51195_Fontwork_ThemeColor.fodt
@@ -312,20 +312,20 @@

   
   
-   
-
-
-
-
+   
+
+
+
+
 
 
 
 
 
 
-
-
-   
+
+
+   
   
  
  
@@ -358,7 +358,7 @@
   
   

-
+
  
  
 
@@ -367,7 +367,7 @@
   
   

-
+
  
 

diff --git a/oox/qa/unit/data/tdf51195_Fontwork_axialGradient.fodt 
b/oox/qa/unit/data/tdf51195_Fontwork_axialGradient.fodt
index 3d8a5ff30ff8..fb792bd34e00 100644
--- a/oox/qa/unit/data/tdf51195_Fontwork_axialGradient.fodt
+++ 

[Libreoffice-commits] core.git: chart2/source cui/source include/svx reportdesign/source svx/source

2023-05-24 Thread Tomaž Vajngerl (via logerrit)
 chart2/source/controller/sidebar/ChartColorWrapper.cxx |2 
 chart2/source/controller/sidebar/ChartColorWrapper.hxx |2 
 cui/source/inc/cuitabarea.hxx  |4 -
 cui/source/tabpages/chardlg.cxx|2 
 cui/source/tabpages/tpcolor.cxx|   22 +-
 include/svx/Palette.hxx|   23 +--
 include/svx/PaletteManager.hxx |2 
 include/svx/colorbox.hxx   |   10 ++--
 include/svx/tbcontrl.hxx   |2 
 reportdesign/source/ui/dlg/Condition.cxx   |4 -
 reportdesign/source/ui/dlg/Condition.hxx   |2 
 svx/source/tbxctrls/Palette.cxx|   13 --
 svx/source/tbxctrls/PaletteManager.cxx |4 -
 svx/source/tbxctrls/tbcontrl.cxx   |   35 -
 14 files changed, 49 insertions(+), 78 deletions(-)

New commits:
commit 9a4b768b0a22bd3ae627c7355bbd223b9cf65015
Author: Tomaž Vajngerl 
AuthorDate: Mon May 22 14:35:19 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Thu May 25 03:59:01 2023 +0200

svx: combine svx::NamedThemedColor into NamedColor

Change-Id: I9a9656ddce9c12564411cfcb3e8e8714ae74a418
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152236
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/chart2/source/controller/sidebar/ChartColorWrapper.cxx 
b/chart2/source/controller/sidebar/ChartColorWrapper.cxx
index 7376f37070ff..e1011a684787 100644
--- a/chart2/source/controller/sidebar/ChartColorWrapper.cxx
+++ b/chart2/source/controller/sidebar/ChartColorWrapper.cxx
@@ -87,7 +87,7 @@ ChartColorWrapper::ChartColorWrapper(
 {
 }
 
-void ChartColorWrapper::operator()([[maybe_unused]] const OUString& , const 
svx::NamedThemedColor& rColor)
+void ChartColorWrapper::operator()([[maybe_unused]] const OUString& , const 
NamedColor& rColor)
 {
 css::uno::Reference xPropSet = 
getPropSet(mxModel);
 
diff --git a/chart2/source/controller/sidebar/ChartColorWrapper.hxx 
b/chart2/source/controller/sidebar/ChartColorWrapper.hxx
index c4d30a8a314c..6894726768d0 100644
--- a/chart2/source/controller/sidebar/ChartColorWrapper.hxx
+++ b/chart2/source/controller/sidebar/ChartColorWrapper.hxx
@@ -28,7 +28,7 @@ public:
 SvxColorToolBoxControl* pControl,
 OUString  rPropertyName);
 
-void operator()(const OUString& rCommand, const svx::NamedThemedColor& 
rColor);
+void operator()(const OUString& rCommand, const NamedColor& rColor);
 // ColorSelectFunction signature
 
 void updateModel(const rtl::Reference<::chart::ChartModel>& xModel);
diff --git a/cui/source/inc/cuitabarea.hxx b/cui/source/inc/cuitabarea.hxx
index 64ec01ef5abf..7399f03eb0be 100644
--- a/cui/source/inc/cuitabarea.hxx
+++ b/cui/source/inc/cuitabarea.hxx
@@ -658,7 +658,7 @@ private:
 ColorModel  eCM;
 
 Color   aPreviousColor;
-svx::NamedThemedColor aCurrentColor;
+NamedColor aCurrentColor;
 
 PaletteManager maPaletteManager;
 SvxXRectPreview m_aCtlPreviewOld;
@@ -714,7 +714,7 @@ private:
 DECL_LINK(SelectPaletteLBHdl, weld::ComboBox&, void);
 DECL_LINK( SelectValSetHdl_Impl, ValueSet*, void );
 DECL_LINK( SelectColorModeHdl_Impl, weld::Toggleable&, void );
-void ChangeColor(const svx::NamedThemedColor , bool 
bUpdatePreset = true);
+void ChangeColor(const NamedColor , bool bUpdatePreset = true);
 void SetColorModel(ColorModel eModel);
 void ChangeColorModel();
 void UpdateColorValues( bool bUpdatePreset = true );
diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx
index 601dae8dce0e..87984d573281 100644
--- a/cui/source/tabpages/chardlg.cxx
+++ b/cui/source/tabpages/chardlg.cxx
@@ -1572,7 +1572,7 @@ bool SvxCharEffectsPage::FillItemSetColor_Impl( 
SfxItemSet& rSet )
 sal_uInt16 nWhich = GetWhich( SID_ATTR_CHAR_COLOR );
 const SfxItemSet& rOldSet = GetItemSet();
 
-svx::NamedThemedColor aSelectedColor;
+NamedColor aSelectedColor;
 bool bChanged = m_bNewFontColor;
 
 if (bChanged)
diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx
index 799f53957678..470b1c13a866 100644
--- a/cui/source/tabpages/tpcolor.cxx
+++ b/cui/source/tabpages/tpcolor.cxx
@@ -209,9 +209,9 @@ void SvxColorTabPage::ActivatePage( const SfxItemSet& )
 ChangeColorModel();
 
 const Color aColor = pFillColorItem->GetColorValue();
-svx::NamedThemedColor aThemedColor;
-aThemedColor.m_aColor = aColor;
-ChangeColor( aThemedColor );
+NamedColor aNamedColor;
+aNamedColor.m_aColor = aColor;
+ChangeColor(aNamedColor);
 sal_Int32 nPos = FindInPalette( aColor );
 
 if ( nPos != -1 )
@@ -288,9 +288,9 @@ void SvxColorTabPage::Reset( const SfxItemSet* rSet )
 SetColorModel( eCM );
 

[Libreoffice-commits] core.git: 2 commits - chart2/source cui/source include/svx include/xmloff oox/qa reportdesign/source schema/libreoffice sd/source svx/source xmloff/qa xmloff/source

2023-05-24 Thread Tomaž Vajngerl (via logerrit)
 chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx |2 
 cui/source/tabpages/tphatch.cxx  |2 
 cui/source/tabpages/tpline.cxx   |4 -
 include/svx/Palette.hxx  |   14 
 include/xmloff/xmltoken.hxx  |1 
 oox/qa/unit/data/ReferenceShapeFill.fodp |   18 ++---
 oox/qa/unit/data/tdf51195_Fontwork_ThemeColor.fodt   |   10 +--
 oox/qa/unit/data/tdf51195_Fontwork_axialGradient.fodt|   12 +--
 oox/qa/unit/data/tdf51195_Fontwork_rectGradient.fodt |   12 +--
 oox/qa/unit/data/tdf51195_Fontwork_squareGradient.fodt   |8 +-
 reportdesign/source/ui/dlg/Condition.cxx |2 
 schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng  |   20 +++---
 sd/source/ui/dlg/copydlg.cxx |4 -
 svx/source/engine3d/float3d.cxx  |2 
 svx/source/tbxctrls/Palette.cxx  |8 +-
 svx/source/tbxctrls/PaletteManager.cxx   |   14 ++--
 svx/source/tbxctrls/tbcontrl.cxx |   34 +--
 svx/source/tbxctrls/tbxcolorupdate.cxx   |4 -
 xmloff/qa/unit/draw.cxx  |   24 +++
 xmloff/source/core/xmltoken.cxx  |5 -
 xmloff/source/text/XMLComplexColorContext.cxx|2 
 xmloff/source/text/XMLComplexColorExport.cxx |2 
 xmloff/source/token/tokens.txt   |5 -
 23 files changed, 113 insertions(+), 96 deletions(-)

New commits:
commit 8e87f1f2ff4df763e29bdc097786230c6293744b
Author: Tomaž Vajngerl 
AuthorDate: Mon May 22 14:16:01 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Thu May 25 03:58:52 2023 +0200

svx: change NamedColor be a struct instead of std::pair

Change-Id: Ice1625e8cae8da859ea8a940b3f8e40f6f9d7037
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152235
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx 
b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx
index 11fc0c88adb5..2020365fd12f 100644
--- a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx
+++ b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx
@@ -101,7 +101,7 @@ namespace
 void lcl_selectColor(ColorListBox& rListBox, const Color& rColor)
 {
 rListBox.SetNoSelection();
-rListBox.SelectEntry(std::make_pair(rColor, 
lcl_makeColorName(rColor)));
+rListBox.SelectEntry({rColor, lcl_makeColorName(rColor)});
 }
 
 ::chart::LightSource lcl_getLightSourceFromProperties(
diff --git a/cui/source/tabpages/tphatch.cxx b/cui/source/tabpages/tphatch.cxx
index 1a35114739fc..879e68a0462c 100644
--- a/cui/source/tabpages/tphatch.cxx
+++ b/cui/source/tabpages/tphatch.cxx
@@ -245,7 +245,7 @@ bool SvxHatchTabPage::FillItemSet( SfxItemSet* rSet )
 if (m_xCbBackgroundColor->get_active())
 {
 NamedColor aColor = m_xLbBackgroundColor->GetSelectedEntry();
-rSet->Put(XFillColorItem(aColor.second, aColor.first));
+rSet->Put(XFillColorItem(aColor.m_aName, aColor.m_aColor));
 }
 return true;
 }
diff --git a/cui/source/tabpages/tpline.cxx b/cui/source/tabpages/tpline.cxx
index 06e95d3fdcaf..d150767daf37 100644
--- a/cui/source/tabpages/tpline.cxx
+++ b/cui/source/tabpages/tpline.cxx
@@ -457,7 +457,7 @@ bool SvxLineTabPage::FillItemSet( SfxItemSet* rAttrs )
 if (m_xLbColor->IsValueChangedFromSaved())
 {
 NamedColor aColor = m_xLbColor->GetSelectedEntry();
-XLineColorItem aItem(aColor.second, aColor.first);
+XLineColorItem aItem(aColor.m_aName, aColor.m_aColor);
 pOld = GetOldItem( *rAttrs, XATTR_LINECOLOR );
 if ( !pOld || !( *static_cast(pOld) == aItem ) )
 {
@@ -759,7 +759,7 @@ void SvxLineTabPage::FillXLSet_Impl()
 
 m_rXLSet.Put( XLineWidthItem( GetCoreValue( *m_xMtrLineWidth, m_ePoolUnit 
) ) );
 NamedColor aColor = m_xLbColor->GetSelectedEntry();
-m_rXLSet.Put(XLineColorItem(aColor.second, aColor.first));
+m_rXLSet.Put(XLineColorItem(aColor.m_aName, aColor.m_aColor));
 
 // Centered line end
 if( m_xTsbCenterStart->get_state() == TRISTATE_TRUE )
diff --git a/include/svx/Palette.hxx b/include/svx/Palette.hxx
index b24825be3d3c..8965138c7831 100644
--- a/include/svx/Palette.hxx
+++ b/include/svx/Palette.hxx
@@ -29,10 +29,22 @@
 
 class SvxColorValueSet;
 
-typedef std::pair NamedColor;
+struct SVXCORE_DLLPUBLIC NamedColor
+{
+Color m_aColor;
+OUString m_aName;
+
+NamedColor() = default;
+
+NamedColor(Color const& rColor, OUString const& rName)
+: m_aColor(rColor)
+, m_aName(rName)
+{}
+};
 
 namespace svx
 {
+
 /// A color with an optional name and 

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - 2 commits - cui/source docmodel/Library_docmodel.mk docmodel/source editeng/source include/docmodel include/editeng include/oox off

2023-05-24 Thread Tomaž Vajngerl (via logerrit)
 cui/source/tabpages/chardlg.cxx|9 +--
 docmodel/Library_docmodel.mk   |1 
 docmodel/source/theme/ColorSet.cxx |   12 
 docmodel/source/uno/UnoComplexColor.cxx|   37 
 editeng/source/items/textitem.cxx  |   58 +++
 editeng/source/uno/unotext.cxx |8 +-
 include/docmodel/color/ComplexColor.hxx|   87 -
 include/docmodel/theme/ColorSet.hxx|3 +
 include/docmodel/theme/ThemeColor.hxx  |5 +
 include/docmodel/uno/UnoComplexColor.hxx   |   50 
 include/editeng/colritem.hxx   |   16 +
 include/oox/export/ThemeExport.hxx |2 
 offapi/UnoApi_offapi.mk|1 
 offapi/com/sun/star/util/XComplexColor.idl |   26 
 sd/source/ui/view/drtxtob1.cxx |9 +--
 sw/source/core/model/ThemeColorChanger.cxx |   16 +++--
 sw/source/uibase/shells/textsh1.cxx|2 
 17 files changed, 284 insertions(+), 58 deletions(-)

New commits:
commit e21f2c8710b6116b9b17f065b1482d057e7842ff
Author: Tomaž Vajngerl 
AuthorDate: Mon May 1 10:19:06 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Thu May 25 02:18:16 2023 +0200

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: I65a96511dc1742c75b1949e002eaa8c622e2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151226
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 900c3a2a854436fdbacd488ef1da12ea99fbceb0)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152231
Tested-by: Jenkins CollaboraOffice 

diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx
index 194dfd65f830..438a9ac37cbf 100644
--- a/cui/source/tabpages/chardlg.cxx
+++ b/cui/source/tabpages/chardlg.cxx
@@ -1600,10 +1600,11 @@ bool SvxCharEffectsPage::FillItemSetColor_Impl( 
SfxItemSet& rSet )
 model::ThemeColorType eType = 
model::convertToThemeColorType(aSelectedColor.m_nThemeIndex);
 if (eType != model::ThemeColorType::Unknown)
 {
-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});
+model::ComplexColor aComplexColor;
+aComplexColor.setSchemeColor(eType);
+
aComplexColor.addTransformation({model::TransformationType::LumMod, 
aSelectedColor.m_nLumMod});
+
aComplexColor.addTransformation({model::TransformationType::LumOff, 
aSelectedColor.m_nLumOff});
+aItem.setComplexColor(aComplexColor);
 }
 
 rSet.Put(aItem);
diff --git a/docmodel/source/theme/ColorSet.cxx 
b/docmodel/source/theme/ColorSet.cxx
index 55c03dadba8c..44cd5bdc6c4f 100644
--- a/docmodel/source/theme/ColorSet.cxx
+++ b/docmodel/source/theme/ColorSet.cxx
@@ -50,6 +50,18 @@ Color ColorSet::resolveColor(model::ThemeColor const& 
rThemeColor) const
 return rThemeColor.applyTransformations(aColor);
 }
 
+Color ColorSet::resolveColor(model::ComplexColor const& rComplexColor) const
+{
+auto eSchemeType = rComplexColor.meSchemeType;
+if (eSchemeType == model::ThemeColorType::Unknown)
+{
+SAL_WARN("svx", "ColorSet::resolveColor with ThemeColorType::Unknown");
+return COL_AUTO;
+}
+Color aColor = getColor(eSchemeType);
+return rComplexColor.applyTransformations(aColor);
+}
+
 void ColorSet::dumpAsXml(xmlTextWriterPtr pWriter) const
 {
 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("ColorSet"));
diff --git a/editeng/source/items/textitem.cxx 
b/editeng/source/items/textitem.cxx
index ece9a4a35237..153319ae8e75 100644
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -1368,10 +1368,10 @@ SvxColorItem::SvxColorItem( const Color& rCol, const 
sal_uInt16 nId ) :
 {
 }
 
-SvxColorItem::SvxColorItem(Color const& rColor, model::ThemeColor const& 
rThemeColor, const sal_uInt16 nId)
+SvxColorItem::SvxColorItem(Color const& rColor, model::ComplexColor const& 
rComplexColor, const sal_uInt16 nId)
 : SfxPoolItem(nId)
 , mColor(rColor)
-, maThemeColor(rThemeColor)
+, maComplexColor(rComplexColor)
 {
 }
 
@@ -1385,7 +1385,7 @@ bool SvxColorItem::operator==( const SfxPoolItem& rAttr ) 
const
 const SvxColorItem& rColorItem = static_cast(rAttr);
 
 return mColor == rColorItem.mColor &&
-   maThemeColor == rColorItem.maThemeColor;
+   maComplexColor == rColorItem.maComplexColor;
 }
 
 

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - 2 commits - include/docmodel include/oox oox/inc oox/source sw/qa

2023-05-24 Thread Tomaž Vajngerl (via logerrit)
 include/docmodel/color/ComplexColor.hxx  |  127 
 include/docmodel/color/Transformation.hxx|   72 +++
 include/docmodel/theme/FormatScheme.hxx  |  142 +++
 include/docmodel/theme/ThemeColor.hxx|   52 
 include/oox/export/ThemeExport.hxx   |   16 +-
 oox/inc/drawingml/colorchoicecontext.hxx |8 -
 oox/source/drawingml/colorchoicecontext.cxx  |   46 +++
 oox/source/drawingml/effectpropertiescontext.cxx |   10 -
 oox/source/drawingml/misccontexts.cxx|   28 ++--
 oox/source/export/ThemeExport.cxx|   64 +-
 sw/qa/core/theme/ThemeTest.cxx   |   16 +-
 11 files changed, 313 insertions(+), 268 deletions(-)

New commits:
commit fa81974797c66df101771ff4f62f642c8d261a3b
Author: Tomaž Vajngerl 
AuthorDate: Sun Apr 30 15:52:32 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Thu May 25 02:17:50 2023 +0200

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 
(cherry picked from commit 113c6d11afbfc97e17fe90d90dd55d149a33a191)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152209
Tested-by: Jenkins CollaboraOffice 

diff --git a/include/docmodel/color/ComplexColor.hxx 
b/include/docmodel/color/ComplexColor.hxx
new file mode 100644
index ..228b32b16932
--- /dev/null
+++ b/include/docmodel/color/ComplexColor.hxx
@@ -0,0 +1,127 @@
+/* -*- 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
+{
+enum class ColorType
+{
+Unused,
+RGB,
+CRGB,
+HSL,
+Scheme,
+Palette,
+System,
+Placeholder
+};
+
+enum class SystemColorType
+{
+Unused,
+DarkShadow3D,
+Light3D,
+ActiveBorder,
+ActiveCaption,
+AppWorkspace,
+Background,
+ButtonFace,
+ButtonHighlight,
+ButtonShadow,
+ButtonText,
+CaptionText,
+GradientActiveCaption,
+GradientInactiveCaption,
+GrayText,
+Highlight,
+HighlightText,
+HotLight,
+InactiveBorder,
+InactiveCaption,
+InactiveCaptionText,
+InfoBack,
+InfoText,
+Menu,
+MenuBar,
+MenuHighlight,
+MenuText,
+ScrollBar,
+Window,
+WindowFrame,
+WindowText
+};
+
+struct DOCMODEL_DLLPUBLIC ComplexColor
+{
+ColorType meType = ColorType::Unused;
+
+sal_Int32 mnComponent1 = 0; // Red, Hue
+sal_Int32 mnComponent2 = 0; // Green, Saturation
+sal_Int32 mnComponent3 = 0; // Blue, Luminance
+sal_Int32 mnAlpha = 0; // Percentage
+
+SystemColorType meSystemColorType = SystemColorType::Unused;
+::Color maLastColor;
+
+ThemeColorType meSchemeType = ThemeColorType::Unknown;
+std::vector maTransformations;
+
+Color getRGBColor() const { return Color(mnComponent1, mnComponent2, 
mnComponent3); }
+
+void setCRGB(sal_Int32 nR, sal_Int32 nG, sal_Int32 nB)
+{
+mnComponent1 = nR;
+mnComponent2 = nG;
+mnComponent3 = nB;
+meType = ColorType::CRGB;
+}
+
+void setRGB(sal_Int32 nRGB)
+{
+::Color aColor(ColorTransparency, nRGB);
+mnComponent1 = aColor.GetRed();
+mnComponent2 = aColor.GetGreen();
+mnComponent3 = aColor.GetBlue();
+meType = ColorType::RGB;
+}
+
+void setHSL(sal_Int32 nH, sal_Int32 nS, sal_Int32 nL)
+{
+mnComponent1 = nH;
+mnComponent2 = nS;
+mnComponent3 = nL;
+meType = ColorType::HSL;
+}
+
+void setSystemColor(SystemColorType eSystemColorType, sal_Int32 nRGB)
+{
+maLastColor = ::Color(ColorTransparency, nRGB);
+meSystemColorType = eSystemColorType;
+meType = ColorType::System;
+}
+
+void setSchemePlaceholder() { meType = ColorType::Placeholder; }
+
+void setSchemeColor(ThemeColorType eType)
+{
+meSchemeType = eType;
+meType = ColorType::Scheme;
+}
+};
+
+} // end of namespace svx
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/docmodel/theme/FormatScheme.hxx 
b/include/docmodel/theme/FormatScheme.hxx
index fb65d24d2ba8..6e20d88b51ca 100644
--- a/include/docmodel/theme/FormatScheme.hxx
+++ b/include/docmodel/theme/FormatScheme.hxx
@@ -13,115 +13,11 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 namespace model
 {
-enum class ColorType
-{
-Unused,
-RGB,
-CRGB,
-HSL,
-

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - include/editeng include/svx svx/source sw/source

2023-05-24 Thread Tomaž Vajngerl (via logerrit)
 include/editeng/unotext.hxx |3 ++-
 include/svx/unoshprp.hxx|4 ++--
 svx/source/unodraw/unoprov.cxx  |2 +-
 sw/source/core/unocore/unomap.cxx   |3 ++-
 sw/source/core/unocore/unomap1.cxx  |5 +++--
 sw/source/core/unocore/unomapproperties.hxx |6 +++---
 6 files changed, 13 insertions(+), 10 deletions(-)

New commits:
commit 1f0a022bfe872192491400e8143c2756bd5acac5
Author: Tomaž Vajngerl 
AuthorDate: Sat Apr 29 23:04:27 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Thu May 25 02:17:15 2023 +0200

use XThemeColor instead of XInterface for *ThemeReference props

Change-Id: I23b6a7429bbcf7901f3d817c970ee7ef4a453197
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151184
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 0cda9cdba77bfe3c5f4b78f7538e2b6c96a01493)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152207
Tested-by: Jenkins CollaboraOffice 

diff --git a/include/editeng/unotext.hxx b/include/editeng/unotext.hxx
index 5231219b5a1a..8fb6710cb2e8 100644
--- a/include/editeng/unotext.hxx
+++ b/include/editeng/unotext.hxx
@@ -41,6 +41,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -91,7 +92,7 @@ struct SfxItemPropertyMapEntry;
 { UNO_NAME_EDIT_CHAR_COLOR_TINT_OR_SHADE, EE_CHAR_COLOR, 
::cppu::UnoType::get(), 0, MID_COLOR_TINT_OR_SHADE }, \
 { UNO_NAME_EDIT_CHAR_COLOR_LUM_MOD,   EE_CHAR_COLOR, 
::cppu::UnoType::get(), 0, MID_COLOR_LUM_MOD }, \
 { UNO_NAME_EDIT_CHAR_COLOR_LUM_OFF,   EE_CHAR_COLOR, 
::cppu::UnoType::get(), 0, MID_COLOR_LUM_OFF }, \
-{ UNO_NAME_EDIT_CHAR_COLOR_THEME_REFERENCE, EE_CHAR_COLOR,
::cppu::UnoType::get(), 0, MID_COLOR_THEME_REFERENCE }, \
+{ UNO_NAME_EDIT_CHAR_COLOR_THEME_REFERENCE, EE_CHAR_COLOR,
::cppu::UnoType::get(), 0, MID_COLOR_THEME_REFERENCE }, 
\
 { u"CharBackColor",EE_CHAR_BKGCOLOR,   
::cppu::UnoType::get(),0, 0 }, \
 { u"CharBackTransparent",  EE_CHAR_BKGCOLOR,   
::cppu::UnoType::get(), 0, MID_GRAPHIC_TRANSPARENT }, \
 { UNO_NAME_EDIT_CHAR_ESCAPEMENT,  EE_CHAR_ESCAPEMENT, 
::cppu::UnoType::get(),0, MID_ESC }, \
diff --git a/include/svx/unoshprp.hxx b/include/svx/unoshprp.hxx
index c385f0766358..828e02771e4b 100644
--- a/include/svx/unoshprp.hxx
+++ b/include/svx/unoshprp.hxx
@@ -237,7 +237,7 @@
 #define LINE_PROPERTIES_DEFAULTS\
 { UNO_NAME_LINECAP,   XATTR_LINECAP,  
::cppu::UnoType::get(), 0, 0}, \
 { UNO_NAME_LINECOLOR, XATTR_LINECOLOR,
::cppu::UnoType::get() ,   0, 0}, \
-{ UNO_NAME_LINECOLOR_THEME_REFERENCE, XATTR_LINECOLOR, 
::cppu::UnoType::get() ,   0, 
MID_COLOR_THEME_REFERENCE}, \
+{ UNO_NAME_LINECOLOR_THEME_REFERENCE, XATTR_LINECOLOR, 
::cppu::UnoType::get() ,   0, 
MID_COLOR_THEME_REFERENCE}, \
 { UNO_NAME_LINEENDCENTER, XATTR_LINEENDCENTER,
cppu::UnoType::get() ,   0, 0}, \
 { UNO_NAME_LINEENDWIDTH,  XATTR_LINEENDWIDTH, 
::cppu::UnoType::get() ,   0, 0, 
PropertyMoreFlags::METRIC_ITEM}, \
 { UNO_NAME_LINEJOINT, XATTR_LINEJOINT,
::cppu::UnoType::get(), 0, 0}, \
@@ -294,7 +294,7 @@
 { UNO_NAME_FILLCOLOR_THEME,   XATTR_FILLCOLOR, 
::cppu::UnoType::get(),  0, MID_COLOR_THEME_INDEX}, \
 { UNO_NAME_FILLCOLOR_LUM_MOD, XATTR_FILLCOLOR, 
::cppu::UnoType::get(),  0, MID_COLOR_LUM_MOD}, \
 { UNO_NAME_FILLCOLOR_LUM_OFF, XATTR_FILLCOLOR, 
::cppu::UnoType::get(),  0, MID_COLOR_LUM_OFF}, \
-{ UNO_NAME_FILLCOLOR_THEME_REFERENCE,   XATTR_FILLCOLOR, 
::cppu::UnoType::get(),  0, 
MID_COLOR_THEME_REFERENCE}, \
+{ UNO_NAME_FILLCOLOR_THEME_REFERENCE,   XATTR_FILLCOLOR, 
::cppu::UnoType::get(),  0, 
MID_COLOR_THEME_REFERENCE}, \
 { UNO_NAME_GRAPHIC_GRAPHICCROP, SDRATTR_GRAFCROP  , 
::cppu::UnoType::get(), 0, 0 }, \
 { UNO_NAME_FILLUSESLIDEBACKGROUND, XATTR_FILLUSESLIDEBACKGROUND, 
cppu::UnoType::get(), 0,   0},
 
diff --git a/svx/source/unodraw/unoprov.cxx b/svx/source/unodraw/unoprov.cxx
index 139e9d3ac48e..00a48d272b22 100644
--- a/svx/source/unodraw/unoprov.cxx
+++ b/svx/source/unodraw/unoprov.cxx
@@ -566,7 +566,7 @@ static o3tl::span 
ImplGetSvxControlShapePropertyM
 { UNO_NAME_EDIT_CHAR_COLOR,   0,  
cppu::UnoType::get(),0, MID_COLOR_RGB },
 { UNO_NAME_EDIT_CHAR_COLOR_THEME, 0,  
cppu::UnoType::get(),0, MID_COLOR_THEME_INDEX },
 { UNO_NAME_EDIT_CHAR_COLOR_TINT_OR_SHADE, 0, 
cppu::UnoType::get(), 0, MID_COLOR_TINT_OR_SHADE },
-{ UNO_NAME_EDIT_CHAR_COLOR_THEME_REFERENCE, 0,  
cppu::UnoType::get(), 0, MID_COLOR_THEME_REFERENCE },
+{ UNO_NAME_EDIT_CHAR_COLOR_THEME_REFERENCE, 0,  
cppu::UnoType::get(), 0, MID_COLOR_THEME_REFERENCE },
 { 

[Libreoffice-commits] core.git: oox/qa

2023-05-21 Thread Tomaž Vajngerl (via logerrit)
 dev/null   |binary
 oox/qa/unit/data/ReferenceShapeFill.fodp   |  838 +
 oox/qa/unit/data/tdf51195_Fontwork_ThemeColor.fodt |  475 +++
 oox/qa/unit/data/tdf51195_Fontwork_axialGradient.fodt  |  462 +++
 oox/qa/unit/data/tdf51195_Fontwork_ellipticalGradient.fodt |  728 +++
 oox/qa/unit/data/tdf51195_Fontwork_linearGradient.fodt |  416 ++
 oox/qa/unit/data/tdf51195_Fontwork_radialGradient.fodt |  395 ++
 oox/qa/unit/data/tdf51195_Fontwork_rectGradient.fodt   |  493 +++
 oox/qa/unit/data/tdf51195_Fontwork_squareGradient.fodt |  488 +++
 oox/qa/unit/export.cxx |   16 
 10 files changed, 4303 insertions(+), 8 deletions(-)

New commits:
commit f0dbebc76b819adebf228fbdb0f25a6ee14187c9
Author: Tomaž Vajngerl 
AuthorDate: Sun May 21 18:09:12 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Sun May 21 13:00:39 2023 +0200

oox: convert odp documents to fodp so it is easiert to change

Mainly to change the non yet fixed theme ODF format.

Change-Id: Iad51de7b4f9a721e566fe12266e633534c15bb54
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152052
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/oox/qa/unit/data/ReferenceShapeFill.fodp 
b/oox/qa/unit/data/ReferenceShapeFill.fodp
new file mode 100644
index ..6d406c32
--- /dev/null
+++ b/oox/qa/unit/data/ReferenceShapeFill.fodp
@@ -0,0 +1,838 @@
+
+
+http://www.w3.org/TR/css3-text/; 
xmlns:grddl="http://www.w3.org/2003/g/data-view#; 
xmlns:xhtml="http://www.w3.org/1999/xhtml; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema; 
xmlns:xforms="http://www.w3.org/2002/xforms; 
xmlns:dom="http://www.w3.org/2001/xml-events; 
xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" 
xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" 
xmlns:math="http://www.w3.org/1998/Math/MathML; 
xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" 
xmlns:ooo="http://openoffice.org/2004/office; 
xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" 
xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" 
xmlns:ooow="http://ope
 noffice.org/2004/writer" xmlns:xlink="http://www.w3.org/1999/xlink; 
xmlns:drawooo="http://openoffice.org/2010/draw; 
xmlns:oooc="http://openoffice.org/2004/calc; 
xmlns:dc="http://purl.org/dc/elements/1.1/; 
xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0"
 xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" 
xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" 
xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" 
xmlns:tableooo="http://openoffice.org/2009/table; 
xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" 
xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" 
xmlns:rpt="http://openoffice.org/2005/report; 
xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0"
 xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" 
xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" 
xmlns:officeooo="http://openoffice.org/2009/office; 
xmlns:table="urn:oasis:names:tc:opendocument:x
 mlns:table:1.0" 
xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" 
xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" 
xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" 
xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0"
 office:version="1.3" 
office:mimetype="application/vnd.oasis.opendocument.presentation">
+ PowerPoint 
Presentationquikeequikee12023-01-01T23:48:392023-01-01T23:48:54P0DLibreOfficeDev/7.6.0.0.alpha1$Linux_X86_64
 
LibreOffice_project/d7984b1f13530624080dca2068c2cfa08d5341fa16.Widescreen1
+ 
+  
+   -2187
+   -513
+   34909
+   23435
+   
+
+ view1
+ false
+ false
+ true
+ true
+ true
+ true
+ false
+ false
+ true
+ 1500
+ false
+ Hw==
+ Hw==
+ 
+ false
+ true
+ false
+ 0
+ 0
+ false
+ true
+ true
+ 4
+ 0
+ -2703
+ -512
+ 34880
+ 24439
+ 2000
+ 2000
+ 500
+ 500
+ 2000
+ 4
+ 2000
+ 4
+ false
+ 1500
+ true
+ false
+ true
+ false
+ false
+
+   
+  
+  
+   6
+   false
+   false
+   false
+   false
+   false
+   0
+   false
+   false
+   true
+   true
+   true
+   true
+   false
+   true
+   $(brandbaseurl)/share/palette%3B$(userpath)/config/standard.soe
+   true
+   true
+   

[Libreoffice-commits] core.git: xmloff/inc xmloff/source

2023-05-21 Thread Tomaž Vajngerl (via logerrit)
 xmloff/source/draw/sdpropls.cxx |2 +-
 xmloff/source/text/txtprhdl.cxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit f8cd1d5f0a6f515d8c06b8d4b189eade800d9b5d
Author: Tomaž Vajngerl 
AuthorDate: Sat May 20 15:06:17 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Sun May 21 13:00:11 2023 +0200

xmloff: rename XMLThemeColorHandler to XMLComplexColorHandler

Change-Id: Ib24c4b819c31cdc6a9626b09a5b2acd10389ad7a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152051
Tested-by: Tomaž Vajngerl 
Reviewed-by: Tomaž Vajngerl 

diff --git a/xmloff/inc/XMLThemeColorHandler.hxx 
b/xmloff/inc/XMLComplexColorHandler.hxx
similarity index 100%
rename from xmloff/inc/XMLThemeColorHandler.hxx
rename to xmloff/inc/XMLComplexColorHandler.hxx
diff --git a/xmloff/source/draw/sdpropls.cxx b/xmloff/source/draw/sdpropls.cxx
index 0555914f09a0..30d6faebc8a2 100644
--- a/xmloff/source/draw/sdpropls.cxx
+++ b/xmloff/source/draw/sdpropls.cxx
@@ -60,7 +60,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/xmloff/source/text/txtprhdl.cxx b/xmloff/source/text/txtprhdl.cxx
index 0755810efa4e..165dbb851675 100644
--- a/xmloff/source/text/txtprhdl.cxx
+++ b/xmloff/source/text/txtprhdl.cxx
@@ -56,7 +56,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 
 using namespace ::com::sun::star;


[Libreoffice-commits] core.git: xmloff/inc xmloff/Library_xo.mk xmloff/source

2023-05-21 Thread Tomaž Vajngerl (via logerrit)
 xmloff/Library_xo.mk |2 +-
 xmloff/inc/XMLComplexColorExport.hxx |4 ++--
 xmloff/source/text/XMLComplexColorExport.cxx |8 
 xmloff/source/text/txtexppr.cxx  |4 ++--
 xmloff/source/text/txtexppr.hxx  |4 ++--
 5 files changed, 11 insertions(+), 11 deletions(-)

New commits:
commit 66fff7efab4dd1ff08b43ed6d2d557ecad578509
Author: Tomaž Vajngerl 
AuthorDate: Sat May 20 15:01:55 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Sun May 21 12:59:53 2023 +0200

xmloff: rename XMLThemeColorExport to XMLComplexColorExport

Change-Id: I3d943f20e76b8f3e0409d307d11e3bf16489bf02
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152050
Tested-by: Tomaž Vajngerl 
Reviewed-by: Tomaž Vajngerl 

diff --git a/xmloff/Library_xo.mk b/xmloff/Library_xo.mk
index d19aabd2d5ad..d2b539d514d9 100644
--- a/xmloff/Library_xo.mk
+++ b/xmloff/Library_xo.mk
@@ -303,6 +303,7 @@ $(eval $(call gb_Library_add_exception_objects,xo,\
 xmloff/source/text/XMLChangeInfoContext \
 xmloff/source/text/XMLChangedRegionImportContext \
 xmloff/source/text/XMLComplexColorContext \
+xmloff/source/text/XMLComplexColorExport \
 xmloff/source/text/XMLFootnoteBodyImportContext \
 xmloff/source/text/XMLFootnoteConfigurationImportContext \
 xmloff/source/text/XMLFootnoteImportContext \
@@ -341,7 +342,6 @@ $(eval $(call gb_Library_add_exception_objects,xo,\
 xmloff/source/text/XMLTextCharStyleNamesElementExport \
 xmloff/source/text/XMLTextColumnsContext \
 xmloff/source/text/XMLTextColumnsExport \
-xmloff/source/text/XMLThemeColorExport \
 xmloff/source/text/XMLTextFrameContext \
 xmloff/source/text/XMLTextFrameHyperlinkContext \
 xmloff/source/text/XMLTextHeaderFooterContext \
diff --git a/xmloff/inc/XMLThemeColorExport.hxx 
b/xmloff/inc/XMLComplexColorExport.hxx
similarity index 89%
rename from xmloff/inc/XMLThemeColorExport.hxx
rename to xmloff/inc/XMLComplexColorExport.hxx
index 9a360c2782d2..d62e10fd5c1b 100644
--- a/xmloff/inc/XMLThemeColorExport.hxx
+++ b/xmloff/inc/XMLComplexColorExport.hxx
@@ -17,12 +17,12 @@ class Any;
 }
 class SvXMLExport;
 
-class XMLThemeColorExport
+class XMLComplexColorExport
 {
 SvXMLExport& mrExport;
 
 public:
-XMLThemeColorExport(SvXMLExport& rExport);
+XMLComplexColorExport(SvXMLExport& rExport);
 
 void exportXML(const css::uno::Any& rAny, sal_uInt16 nPrefix, const 
OUString& rLocalName);
 };
diff --git a/xmloff/source/text/XMLThemeColorExport.cxx 
b/xmloff/source/text/XMLComplexColorExport.cxx
similarity index 91%
rename from xmloff/source/text/XMLThemeColorExport.cxx
rename to xmloff/source/text/XMLComplexColorExport.cxx
index 9a48faf63546..a118d12ba689 100644
--- a/xmloff/source/text/XMLThemeColorExport.cxx
+++ b/xmloff/source/text/XMLComplexColorExport.cxx
@@ -7,7 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#include 
+#include 
 
 #include 
 
@@ -21,7 +21,7 @@
 using namespace css;
 using namespace ::xmloff::token;
 
-XMLThemeColorExport::XMLThemeColorExport(SvXMLExport& rExport)
+XMLComplexColorExport::XMLComplexColorExport(SvXMLExport& rExport)
 : mrExport(rExport)
 {
 }
@@ -34,8 +34,8 @@ constexpr const std::array 
constThemeColorTypeToToken{
 };
 }
 
-void XMLThemeColorExport::exportXML(const uno::Any& rAny, sal_uInt16 nPrefix,
-const OUString& rLocalName)
+void XMLComplexColorExport::exportXML(const uno::Any& rAny, sal_uInt16 nPrefix,
+  const OUString& rLocalName)
 {
 uno::Reference xComplexColor;
 rAny >>= xComplexColor;
diff --git a/xmloff/source/text/txtexppr.cxx b/xmloff/source/text/txtexppr.cxx
index 67f742b69b46..f49084d9cbe7 100644
--- a/xmloff/source/text/txtexppr.cxx
+++ b/xmloff/source/text/txtexppr.cxx
@@ -73,7 +73,7 @@ void XMLTextExportPropertySetMapper::handleElementItem(
 break;
 
 case CTF_COMPLEX_COLOR:
-pThis->maThemeColorExport.exportXML(rProperty.maValue,
+pThis->maComplexColorExport.exportXML(rProperty.maValue,
 
getPropertySetMapper()->GetEntryNameSpace(rProperty.mnIndex),
 
getPropertySetMapper()->GetEntryXMLName(rProperty.mnIndex));
 break;
@@ -216,7 +216,7 @@ 
XMLTextExportPropertySetMapper::XMLTextExportPropertySetMapper(
 maDropCapExport( rExp ),
 maTabStopExport( rExp ),
 maTextColumnsExport( rExp ),
-maThemeColorExport(rExp),
+maComplexColorExport(rExp),
 maBackgroundImageExport( rExp )
 {
 }
diff --git a/xmloff/source/text/txtexppr.hxx b/xmloff/source/text/txtexppr.hxx
index 878ca9a9389d..5a3d955e17d1 100644
--- a/xmloff/source/text/txtexppr.hxx
+++ b/xmloff/source/text/txtexppr.hxx
@@ -24,7 +24,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 class SvXMLExport;
 class XMLTextExportPropertySetMapper: public SvXMLExportPropertyMapper
@@ -53,7 +53,7 @@ private:
 

[Libreoffice-commits] core.git: xmloff/inc xmloff/Library_xo.mk xmloff/source

2023-05-21 Thread Tomaž Vajngerl (via logerrit)
 xmloff/Library_xo.mk  |2 +-
 xmloff/inc/XMLComplexColorContext.hxx |8 
 xmloff/source/draw/XMLShapePropertySetContext.cxx |4 ++--
 xmloff/source/text/XMLComplexColorContext.cxx |8 
 xmloff/source/text/XMLTextPropertySetContext.cxx  |4 ++--
 xmloff/source/text/XMLTextShapeStyleContext.cxx   |4 ++--
 6 files changed, 15 insertions(+), 15 deletions(-)

New commits:
commit e1cc0f3e7adc9d4c930a1c37bbe45c69dd3725ab
Author: Tomaž Vajngerl 
AuthorDate: Sat May 20 14:51:49 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Sun May 21 12:59:35 2023 +0200

xmloff: rename XMLThemeColorContext to XMLComplexColorContext

Change-Id: I039aea6656cc8dedd74782f4fda8b0e1c25d3910
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152029
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/xmloff/Library_xo.mk b/xmloff/Library_xo.mk
index 8a3fd112902d..d19aabd2d5ad 100644
--- a/xmloff/Library_xo.mk
+++ b/xmloff/Library_xo.mk
@@ -302,6 +302,7 @@ $(eval $(call gb_Library_add_exception_objects,xo,\
 xmloff/source/text/XMLChangeImportContext \
 xmloff/source/text/XMLChangeInfoContext \
 xmloff/source/text/XMLChangedRegionImportContext \
+xmloff/source/text/XMLComplexColorContext \
 xmloff/source/text/XMLFootnoteBodyImportContext \
 xmloff/source/text/XMLFootnoteConfigurationImportContext \
 xmloff/source/text/XMLFootnoteImportContext \
@@ -340,7 +341,6 @@ $(eval $(call gb_Library_add_exception_objects,xo,\
 xmloff/source/text/XMLTextCharStyleNamesElementExport \
 xmloff/source/text/XMLTextColumnsContext \
 xmloff/source/text/XMLTextColumnsExport \
-xmloff/source/text/XMLThemeColorContext \
 xmloff/source/text/XMLThemeColorExport \
 xmloff/source/text/XMLTextFrameContext \
 xmloff/source/text/XMLTextFrameHyperlinkContext \
diff --git a/xmloff/inc/XMLThemeColorContext.hxx 
b/xmloff/inc/XMLComplexColorContext.hxx
similarity index 72%
rename from xmloff/inc/XMLThemeColorContext.hxx
rename to xmloff/inc/XMLComplexColorContext.hxx
index 8bab725c44a6..2d43da23fedd 100644
--- a/xmloff/inc/XMLThemeColorContext.hxx
+++ b/xmloff/inc/XMLComplexColorContext.hxx
@@ -13,15 +13,15 @@
 #include "XMLElementPropertyContext.hxx"
 #include 
 
-class XMLThemeColorContext final : public XMLElementPropertyContext
+class XMLComplexColorContext final : public XMLElementPropertyContext
 {
 model::ComplexColor maComplexColor;
 sal_Int32 mnRootElement;
 
 public:
-XMLThemeColorContext(SvXMLImport& rImport, sal_Int32 nElement,
- const 
css::uno::Reference& xAttrList,
- const XMLPropertyState& rProp, 
std::vector& rProps);
+XMLComplexColorContext(SvXMLImport& rImport, sal_Int32 nElement,
+   const 
css::uno::Reference& xAttrList,
+   const XMLPropertyState& rProp, 
std::vector& rProps);
 
 css::uno::Reference SAL_CALL 
createFastChildContext(
 sal_Int32 nElement,
diff --git a/xmloff/source/draw/XMLShapePropertySetContext.cxx 
b/xmloff/source/draw/XMLShapePropertySetContext.cxx
index 9db7cac43464..067e1e7d13a4 100644
--- a/xmloff/source/draw/XMLShapePropertySetContext.cxx
+++ b/xmloff/source/draw/XMLShapePropertySetContext.cxx
@@ -19,7 +19,7 @@
 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -84,7 +84,7 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > 
XMLShapePropertySetCon
 return new XMLTextColumnsContext(GetImport(), nElement, xAttrList, 
rProp, rProperties);
 
 case CTF_COMPLEX_COLOR:
-return new XMLThemeColorContext(GetImport(), nElement, xAttrList, 
rProp, rProperties);
+return new XMLComplexColorContext(GetImport(), nElement, xAttrList, 
rProp, rProperties);
 }
 
 return SvXMLPropertySetContext::createFastChildContext( nElement,
diff --git a/xmloff/source/text/XMLThemeColorContext.cxx 
b/xmloff/source/text/XMLComplexColorContext.cxx
similarity index 95%
rename from xmloff/source/text/XMLThemeColorContext.cxx
rename to xmloff/source/text/XMLComplexColorContext.cxx
index aeea540bbdf3..f506a71941d9 100644
--- a/xmloff/source/text/XMLThemeColorContext.cxx
+++ b/xmloff/source/text/XMLComplexColorContext.cxx
@@ -18,7 +18,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 using namespace css;
 using namespace xmloff::token;
@@ -29,7 +29,7 @@ SvXMLEnumMapEntry const pXML_ThemeColor_Enum[]
 { XML_ACCENT4, 7 },   { XML_ACCENT5, 8 },  { XML_ACCENT6, 9 }, { 
XML_HLINK, 10 },
 { XML_FOLHLINK, 11 }, { XML_TOKEN_INVALID, 0 } };
 
-XMLThemeColorContext::XMLThemeColorContext(
+XMLComplexColorContext::XMLComplexColorContext(
 SvXMLImport& rImport, sal_Int32 nElement,
 const uno::Reference& xAttrList, const 
XMLPropertyState& rProp,
 std::vector& rProps)
@@ -57,7 +57,7 @@ XMLThemeColorContext::XMLThemeColorContext(
 }
 
 css::uno::Reference

[Libreoffice-commits] core.git: include/docmodel

2023-05-20 Thread Tomaž Vajngerl (via logerrit)
 include/docmodel/color/ComplexColor.hxx   |   30 ++
 include/docmodel/color/Transformation.hxx |   20 
 2 files changed, 50 insertions(+)

New commits:
commit a3d566165c0580ab41334cb3e031465df1f839ad
Author: Tomaž Vajngerl 
AuthorDate: Thu May 18 14:48:30 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Sat May 20 11:54:28 2023 +0200

docmodel: add hash to ComplexColor and Transformation classes

Change-Id: I206235162b057f184fbd413982c06f9bd9fa8a94
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152013
Tested-by: Tomaž Vajngerl 
Reviewed-by: Tomaž Vajngerl 

diff --git a/include/docmodel/color/ComplexColor.hxx 
b/include/docmodel/color/ComplexColor.hxx
index 471c6b30e4d1..d43318cdbe65 100644
--- a/include/docmodel/color/ComplexColor.hxx
+++ b/include/docmodel/color/ComplexColor.hxx
@@ -14,6 +14,7 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace model
 {
@@ -89,6 +90,8 @@ public:
 ThemeColorType meSchemeType = ThemeColorType::Unknown;
 std::vector maTransformations;
 
+::Color maFinalColor;
+
 public:
 ColorType getType() const { return meType; }
 
@@ -210,8 +213,35 @@ public:
 }
 return aColor;
 }
+
+void setFinalColor(Color const& rColor) { maFinalColor = rColor; }
+
+Color const& getFinalColor() const { return maFinalColor; }
+
+std::size_t getHash() const
+{
+std::size_t seed = 0;
+o3tl::hash_combine(seed, meType);
+o3tl::hash_combine(seed, mnComponent1);
+o3tl::hash_combine(seed, mnComponent2);
+o3tl::hash_combine(seed, mnComponent3);
+o3tl::hash_combine(seed, meSystemColorType);
+o3tl::hash_combine(seed, sal_uInt32(maLastColor));
+for (auto const& rTransform : maTransformations)
+o3tl::hash_combine(seed, rTransform);
+o3tl::hash_combine(seed, sal_uInt32(maFinalColor));
+return seed;
+}
 };
 
 } // end of namespace svx
 
+namespace std
+{
+template <> struct hash
+{
+std::size_t operator()(model::ComplexColor const& rColor) const { return 
rColor.getHash(); }
+};
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/docmodel/color/Transformation.hxx 
b/include/docmodel/color/Transformation.hxx
index 26f618dee289..7a05d88aa9e9 100644
--- a/include/docmodel/color/Transformation.hxx
+++ b/include/docmodel/color/Transformation.hxx
@@ -12,6 +12,7 @@
 
 #include 
 #include 
+#include 
 
 namespace model
 {
@@ -65,8 +66,27 @@ struct DOCMODEL_DLLPUBLIC Transformation
 {
 return meType == rTransformation.meType && mnValue == 
rTransformation.mnValue;
 }
+
+std::size_t getHash() const
+{
+std::size_t seed = 0;
+o3tl::hash_combine(seed, meType);
+o3tl::hash_combine(seed, mnValue);
+return seed;
+}
 };
 
 } // end of namespace model
 
+namespace std
+{
+template <> struct hash
+{
+std::size_t operator()(model::Transformation const& rTransformation) const
+{
+return rTransformation.getHash();
+}
+};
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


[Libreoffice-commits] core.git: sw/source

2023-05-19 Thread Tomaž Vajngerl (via logerrit)
 sw/source/core/access/AccessibilityCheck.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit c53a8284cf1740af7035b952fbc040a785117319
Author: Tomaž Vajngerl 
AuthorDate: Fri May 19 22:56:57 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Sat May 20 06:09:34 2023 +0200

sw: prevent crash in TextContrastCheck

Change-Id: Idc8740a275b9f49aca08d8a3add9a88f9d53a220
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152012
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/sw/source/core/access/AccessibilityCheck.cxx 
b/sw/source/core/access/AccessibilityCheck.cxx
index 3a2bf556d112..e9cead1fe243 100644
--- a/sw/source/core/access/AccessibilityCheck.cxx
+++ b/sw/source/core/access/AccessibilityCheck.cxx
@@ -436,6 +436,8 @@ private:
 }
 
 const SwPageDesc* pPageDescription = pTextNode->FindPageDesc();
+if (!pPageDescription)
+return;
 const SwFrameFormat& rPageFormat = pPageDescription->GetMaster();
 const SwAttrSet& rPageSet = rPageFormat.GetAttrSet();
 


[Libreoffice-commits] core.git: editeng/source include/editeng

2023-05-19 Thread Tomaž Vajngerl (via logerrit)
 editeng/source/items/borderline.cxx |   40 ++--
 include/editeng/borderline.hxx  |6 ++---
 2 files changed, 23 insertions(+), 23 deletions(-)

New commits:
commit 028c974cf2fcb9494f42267edf1427cb45342f39
Author: Tomaž Vajngerl 
AuthorDate: Wed May 17 14:27:49 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Sat May 20 04:38:36 2023 +0200

prefix SvxBorderLine aColor attribute

Change-Id: I77f950a88e5875469a95c3ec37716b99328672f8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151855
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/editeng/source/items/borderline.cxx 
b/editeng/source/items/borderline.cxx
index 42d61b5daa43..698fd2b964b0 100644
--- a/editeng/source/items/borderline.cxx
+++ b/editeng/source/items/borderline.cxx
@@ -109,8 +109,8 @@ SvxBorderLine::SvxBorderLine( const Color *pCol, 
tools::Long nWidth,
 , m_bMirrorWidths(false)
 , m_bUseLeftTop(false)
 {
-if ( pCol )
-aColor = *pCol;
+if (pCol)
+m_aColor = *pCol;
 }
 
 SvxBorderLineStyle
@@ -518,15 +518,15 @@ sal_uInt16 SvxBorderLine::GetDistance() const
 
 bool SvxBorderLine::operator==( const SvxBorderLine& rCmp ) const
 {
-return ( ( aColor== rCmp.aColor )&&
- ( m_nWidth == rCmp.m_nWidth )   &&
- ( m_bMirrorWidths  == rCmp.m_bMirrorWidths )  &&
- ( m_aWidthImpl  == rCmp.m_aWidthImpl )  &&
- ( m_nStyle == rCmp.GetBorderLineStyle()) &&
- ( m_bUseLeftTop == rCmp.m_bUseLeftTop ) &&
- ( m_pColorOutFn == rCmp.m_pColorOutFn ) &&
- ( m_pColorInFn == rCmp.m_pColorInFn )   &&
- ( m_pColorGapFn == rCmp.m_pColorGapFn ) );
+return (m_aColor == rCmp.m_aColor &&
+m_nWidth == rCmp.m_nWidth &&
+m_bMirrorWidths == rCmp.m_bMirrorWidths &&
+m_aWidthImpl == rCmp.m_aWidthImpl &&
+m_nStyle == rCmp.GetBorderLineStyle() &&
+m_bUseLeftTop == rCmp.m_bUseLeftTop &&
+m_pColorOutFn == rCmp.m_pColorOutFn &&
+m_pColorInFn == rCmp.m_pColorInFn &&
+m_pColorGapFn == rCmp.m_pColorGapFn);
 }
 
 void SvxBorderLine::SetBorderLineStyle( SvxBorderLineStyle nNew )
@@ -571,14 +571,14 @@ void SvxBorderLine::SetBorderLineStyle( 
SvxBorderLineStyle nNew )
 
 Color SvxBorderLine::GetColorOut( bool bLeftOrTop ) const
 {
-Color aResult = aColor;
+Color aResult = m_aColor;
 
 if ( m_aWidthImpl.IsDouble() && m_pColorOutFn != nullptr )
 {
 if ( !bLeftOrTop && m_bUseLeftTop )
-aResult = (*m_pColorInFn)( aColor );
+aResult = (*m_pColorInFn)(m_aColor);
 else
-aResult = (*m_pColorOutFn)( aColor );
+aResult = (*m_pColorOutFn)(m_aColor);
 }
 
 return aResult;
@@ -586,14 +586,14 @@ Color SvxBorderLine::GetColorOut( bool bLeftOrTop ) const
 
 Color SvxBorderLine::GetColorIn( bool bLeftOrTop ) const
 {
-Color aResult = aColor;
+Color aResult = m_aColor;
 
 if ( m_aWidthImpl.IsDouble() && m_pColorInFn != nullptr )
 {
 if ( !bLeftOrTop && m_bUseLeftTop )
-aResult = (*m_pColorOutFn)( aColor );
+aResult = (*m_pColorOutFn)(m_aColor);
 else
-aResult = (*m_pColorInFn)( aColor );
+aResult = (*m_pColorInFn)(m_aColor);
 }
 
 return aResult;
@@ -601,11 +601,11 @@ Color SvxBorderLine::GetColorIn( bool bLeftOrTop ) const
 
 Color SvxBorderLine::GetColorGap( ) const
 {
-Color aResult = aColor;
+Color aResult = m_aColor;
 
 if ( m_aWidthImpl.IsDouble() && m_pColorGapFn != nullptr )
 {
-aResult = (*m_pColorGapFn)( aColor );
+aResult = (*m_pColorGapFn)(m_aColor);
 }
 
 return aResult;
@@ -642,7 +642,7 @@ OUString SvxBorderLine::GetValueString(MapUnit eSrcUnit,
 RID_DASH_DOT,
 RID_DASH_DOT_DOT
 };
-OUString aStr = "(" + ::GetColorString( aColor ) + cpDelim;
+OUString aStr = "(" + ::GetColorString(m_aColor) + cpDelim;
 
 if ( static_cast(m_nStyle) < int(SAL_N_ELEMENTS(aStyleIds)) )
 {
diff --git a/include/editeng/borderline.hxx b/include/editeng/borderline.hxx
index 6cf1c45120be..affd513e853e 100644
--- a/include/editeng/borderline.hxx
+++ b/include/editeng/borderline.hxx
@@ -153,7 +153,7 @@ class EDITENG_DLLPUBLIC SvxBorderLine final
 Color (*m_pColorInFn)(Color);
 Color (*m_pColorGapFn)(Color);
 BorderWidthImpl m_aWidthImpl;
-Color aColor;
+Color m_aColor;
 SvxBorderLineStyle   m_nStyle;
 bool m_bMirrorWidths;
 bool m_bUseLeftTop;
@@ -165,7 +165,7 @@ public:
 Color (*pColorOutFn)( Color ) = ,
 Color (*pColorInFn)( Color ) =  );
 
-const Color&GetColor() const { return aColor; }
+const Color&GetColor() const { return m_aColor; }
 Color   GetColorOut( bool bLeftOrTop = true ) const;
 Color   GetColorIn( bool bLeftOrTop = true ) const;
 

[Libreoffice-commits] core.git: cui/source editeng/source include/editeng sc/Library_sc.mk sc/source

2023-05-17 Thread Tomaž Vajngerl (via logerrit)
 cui/source/tabpages/backgrnd.cxx |8 +-
 editeng/source/items/frmitems.cxx|   36 +++
 editeng/source/items/textitem.cxx|5 -
 include/editeng/brushitem.hxx|   22 ---
 include/editeng/colritem.hxx |   14 
 include/editeng/memberids.h  |1 
 sc/Library_sc.mk |1 
 sc/source/ui/inc/ThemeColorChanger.hxx   |   31 +
 sc/source/ui/theme/ThemeColorChanger.cxx |   97 +++
 sc/source/ui/view/formatsh.cxx   |4 -
 sc/source/ui/view/tabvwsh3.cxx   |6 -
 11 files changed, 204 insertions(+), 21 deletions(-)

New commits:
commit c25f8f0468a830cfd855389261a7b7250ef712b1
Author: Tomaž Vajngerl 
AuthorDate: Thu May 11 17:51:49 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Wed May 17 11:14:57 2023 +0200

sc: change (char, background) style colors when changing the theme

This adds a Calc specific ThemeColorChanger, which changes the
character and background colors in styles. In addition add the
changes that make this possible - support in SvxBrushItem for
the ComplexColor, making sure that ComplexColor is properly passed
to other items (mainly from color picker),...

Change-Id: Id2e98c42bbe195a0f75cc8951ff69f6d7eea6be0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151667
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx
index 14269ad3c6c8..5706f98c310a 100644
--- a/cui/source/tabpages/backgrnd.cxx
+++ b/cui/source/tabpages/backgrnd.cxx
@@ -166,13 +166,13 @@ bool SvxBkgTabPage::FillItemSet( SfxItemSet* rCoreSet )
 XFillColorItem aColorItem( maSet.Get( XATTR_FILLCOLOR ) );
 if ( SID_ATTR_CHAR_BACK_COLOR == nSlot )
 {
-maSet.Put( SvxColorItem( aColorItem.GetColorValue(), nWhich ) 
);
-rCoreSet->Put( SvxColorItem( aColorItem.GetColorValue(), 
nWhich ) );
+maSet.Put( SvxColorItem( aColorItem.GetColorValue(), 
aColorItem.getComplexColor(), nWhich ) );
+rCoreSet->Put( SvxColorItem( aColorItem.GetColorValue(), 
aColorItem.getComplexColor(), nWhich ) );
 }
 else
 {
-maSet.Put( SvxBrushItem( aColorItem.GetColorValue(), nWhich ) 
);
-rCoreSet->Put( SvxBrushItem( aColorItem.GetColorValue(), 
nWhich ) );
+maSet.Put( SvxBrushItem( aColorItem.GetColorValue(), 
aColorItem.getComplexColor(), nWhich ) );
+rCoreSet->Put( SvxBrushItem( aColorItem.GetColorValue(), 
aColorItem.getComplexColor(), nWhich ) );
 }
 break;
 }
diff --git a/editeng/source/items/frmitems.cxx 
b/editeng/source/items/frmitems.cxx
index ad0977fab753..63cbc018c1ab 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -33,6 +33,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -75,6 +76,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -3857,6 +3859,18 @@ SvxBrushItem::SvxBrushItem(const Color& rColor, 
sal_uInt16 _nWhich)
 {
 }
 
+SvxBrushItem::SvxBrushItem(Color const& rColor, model::ComplexColor const& 
rComplexColor, sal_uInt16 nWhich)
+: SfxPoolItem(nWhich)
+, aColor(rColor)
+, maComplexColor(rComplexColor)
+, aFilterColor(COL_TRANSPARENT)
+, nShadingValue(ShadingPattern::CLEAR)
+, nGraphicTransparency(0)
+, eGraphicPos(GPOS_NONE)
+, bLoadAgain(true)
+{
+}
+
 SvxBrushItem::SvxBrushItem(const Graphic& rGraphic, SvxGraphicPosition ePos, 
sal_uInt16 _nWhich)
 : SfxPoolItem(_nWhich)
 , aColor(COL_TRANSPARENT)
@@ -3901,6 +3915,7 @@ SvxBrushItem::SvxBrushItem(OUString aLink, OUString 
aFilter,
 SvxBrushItem::SvxBrushItem(const SvxBrushItem& rItem)
 : SfxPoolItem(rItem)
 , aColor(rItem.aColor)
+, maComplexColor(rItem.maComplexColor)
 , aFilterColor(rItem.aFilterColor)
 , nShadingValue(rItem.nShadingValue)
 , xGraphicObject(rItem.xGraphicObject ? new 
GraphicObject(*rItem.xGraphicObject) : nullptr)
@@ -3915,6 +3930,7 @@ SvxBrushItem::SvxBrushItem(const SvxBrushItem& rItem)
 SvxBrushItem::SvxBrushItem(SvxBrushItem&& rItem)
 : SfxPoolItem(std::move(rItem))
 , aColor(std::move(rItem.aColor))
+, maComplexColor(std::move(rItem.maComplexColor))
 , aFilterColor(std::move(rItem.aFilterColor))
 , nShadingValue(std::move(rItem.nShadingValue))
 , xGraphicObject(std::move(rItem.xGraphicObject))
@@ -3974,6 +3990,15 @@ bool SvxBrushItem::QueryValue( uno::Any& rVal, sal_uInt8 
nMemberId ) const
 case MID_BACK_COLOR_TRANSPARENCY:
 rVal <<= SvxBrushItem::TransparencyToPercent(255 - 
aColor.GetAlpha());
 break;
+
+case MID_BACKGROUND_COMPLEX_COLOR:
+{
+auto xComplexColor = 
model::color::createXComplexColor(maComplexColor);
+

[Libreoffice-commits] core.git: editeng/source include/editeng

2023-05-13 Thread Tomaž Vajngerl (via logerrit)
 editeng/source/items/frmitems.cxx |  333 ++
 include/editeng/boxitem.hxx   |  116 +++--
 2 files changed, 231 insertions(+), 218 deletions(-)

New commits:
commit ef106661fcc40cfdd406064cbf73fd62477d0e79
Author: Tomaž Vajngerl 
AuthorDate: Fri May 12 16:05:36 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Sat May 13 16:12:18 2023 +0200

prefix members and cleanup SvxBoxItem, SvxBoxInfoItem

Change-Id: I9f3d36257175a5118a2b8ddca981815b24b8d243
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151718
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/editeng/source/items/frmitems.cxx 
b/editeng/source/items/frmitems.cxx
index 250b61e33753..ad0977fab753 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -2289,29 +2289,23 @@ void SvxShadowItem::dumpAsXml(xmlTextWriterPtr pWriter) 
const
 
 // class SvxBoxItem --
 
-SvxBoxItem::SvxBoxItem( const SvxBoxItem& rCpy ) :
-
-SfxPoolItem ( rCpy ),
-pTop( rCpy.pTop ? new SvxBorderLine( *rCpy.pTop ): nullptr 
),
-pBottom ( rCpy.pBottom  ? new SvxBorderLine( *rCpy.pBottom ) : nullptr 
),
-pLeft   ( rCpy.pLeft? new SvxBorderLine( *rCpy.pLeft )   : nullptr 
),
-pRight  ( rCpy.pRight   ? new SvxBorderLine( *rCpy.pRight )  : nullptr 
),
-nTopDist( rCpy.nTopDist ),
-nBottomDist ( rCpy.nBottomDist ),
-nLeftDist   ( rCpy.nLeftDist ),
-nRightDist  ( rCpy.nRightDist ),
-bRemoveAdjCellBorder ( rCpy.bRemoveAdjCellBorder )
+SvxBoxItem::SvxBoxItem(const SvxBoxItem& rCopy)
+: SfxPoolItem (rCopy)
+, mpTopBorderLine(rCopy.mpTopBorderLine ? new 
SvxBorderLine(*rCopy.mpTopBorderLine) : nullptr)
+, mpBottomBorderLine(rCopy.mpBottomBorderLine ? new 
SvxBorderLine(*rCopy.mpBottomBorderLine) : nullptr)
+, mpLeftBorderLine(rCopy.mpLeftBorderLine ? new 
SvxBorderLine(*rCopy.mpLeftBorderLine) : nullptr)
+, mpRightBorderLine(rCopy.mpRightBorderLine ? new 
SvxBorderLine(*rCopy.mpRightBorderLine) : nullptr)
+, mnTopDistance(rCopy.mnTopDistance)
+, mnBottomDistance(rCopy.mnBottomDistance)
+, mnLeftDistance(rCopy.mnLeftDistance)
+, mnRightDistance(rCopy.mnRightDistance)
+, mbRemoveAdjCellBorder(rCopy.mbRemoveAdjCellBorder)
 {
 }
 
 
-SvxBoxItem::SvxBoxItem( const sal_uInt16 nId ) :
-SfxPoolItem( nId ),
-nTopDist( 0 ),
-nBottomDist ( 0 ),
-nLeftDist   ( 0 ),
-nRightDist  ( 0 ),
-bRemoveAdjCellBorder ( false )
+SvxBoxItem::SvxBoxItem(const sal_uInt16 nId)
+: SfxPoolItem(nId)
 {
 }
 
@@ -2324,13 +2318,13 @@ void SvxBoxItem::dumpAsXml(xmlTextWriterPtr pWriter) 
const
 {
 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SvxBoxItem"));
 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("top-dist"),
-  
BAD_CAST(OString::number(nTopDist).getStr()));
+  
BAD_CAST(OString::number(mnTopDistance).getStr()));
 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("bottom-dist"),
-  
BAD_CAST(OString::number(nBottomDist).getStr()));
+  
BAD_CAST(OString::number(mnBottomDistance).getStr()));
 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("left-dist"),
-  
BAD_CAST(OString::number(nLeftDist).getStr()));
+  
BAD_CAST(OString::number(mnLeftDistance).getStr()));
 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("right-dist"),
-  
BAD_CAST(OString::number(nRightDist).getStr()));
+  
BAD_CAST(OString::number(mnRightDistance).getStr()));
 SfxPoolItem::dumpAsXml(pWriter);
 (void)xmlTextWriterEndElement(pWriter);
 }
@@ -2352,7 +2346,7 @@ boost::property_tree::ptree SvxBoxItem::dumpAsJSON() const
 }
 
 
-static bool CmpBrdLn( const std::unique_ptr & pBrd1, const 
SvxBorderLine* pBrd2 )
+static bool CompareBorderLine(const std::unique_ptr & pBrd1, 
const SvxBorderLine* pBrd2)
 {
 if( pBrd1.get() == pBrd2 )
 return true;
@@ -2368,15 +2362,15 @@ bool SvxBoxItem::operator==( const SfxPoolItem& rAttr ) 
const
 
 const SvxBoxItem& rBoxItem = static_cast(rAttr);
 return (
-( nTopDist == rBoxItem.nTopDist ) &&
-( nBottomDist == rBoxItem.nBottomDist )   &&
-( nLeftDist == rBoxItem.nLeftDist )   &&
-( nRightDist == rBoxItem.nRightDist ) &&
-( bRemoveAdjCellBorder == rBoxItem.bRemoveAdjCellBorder ) &&
-CmpBrdLn( pTop, rBoxItem.GetTop() )   &&
-CmpBrdLn( pBottom, rBoxItem.GetBottom() ) &&
-CmpBrdLn( pLeft, rBoxItem.GetLeft() ) &&
-CmpBrdLn( pRight, rBoxItem.GetRight() ) );
+(mnTopDistance == rBoxItem.mnTopDistance) &&
+(mnBottomDistance == 

[Libreoffice-commits] core.git: sd/qa

2023-05-12 Thread Tomaž Vajngerl (via logerrit)
 sd/qa/unit/TextFittingTest.cxx |   45 ++---
 1 file changed, 7 insertions(+), 38 deletions(-)

New commits:
commit d23ec642e9eecd792da7a39b7871b384b9256e91
Author: Tomaž Vajngerl 
AuthorDate: Tue May 9 21:51:05 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Fri May 12 11:03:16 2023 +0200

sd: remove unneeded includes in TextFittingTest

Change-Id: Ifaf94f0e9cce1a54ddd592b480aa52bb1f6377e3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151666
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/sd/qa/unit/TextFittingTest.cxx b/sd/qa/unit/TextFittingTest.cxx
index 5cbe8a6b9c69..588d3f0ddd54 100644
--- a/sd/qa/unit/TextFittingTest.cxx
+++ b/sd/qa/unit/TextFittingTest.cxx
@@ -7,51 +7,20 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#include 
-
 #include "sdmodeltestbase.hxx"
 
-#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 
+#include 
+#include 
 
 using namespace css;
 


[Libreoffice-commits] core.git: 2 commits - cui/source docmodel/Library_docmodel.mk docmodel/source editeng/source include/docmodel include/editeng include/svx include/xmloff offapi/com offapi/UnoApi_

2023-05-11 Thread Tomaž Vajngerl (via logerrit)
 cui/source/tabpages/tpcolor.cxx   |8 -
 docmodel/Library_docmodel.mk  |3 
 docmodel/source/color/ComplexColorJSON.cxx|   20 +--
 docmodel/source/theme/ColorSet.cxx|   12 --
 docmodel/source/uno/UnoComplexColor.cxx   |   12 +-
 docmodel/source/uno/UnoThemeColor.cxx |   40 ---
 editeng/source/items/textitem.cxx |   53 +++--
 editeng/source/uno/unotext.cxx|2 
 include/docmodel/color/ComplexColor.hxx   |7 +
 include/docmodel/color/ComplexColorJSON.hxx   |9 -
 include/docmodel/theme/ColorSet.hxx   |2 
 include/docmodel/uno/UnoComplexColor.hxx  |5 
 include/docmodel/uno/UnoThemeColor.hxx|   55 --
 include/editeng/memberids.h   |4 
 include/editeng/unoprnms.hxx  |8 -
 include/editeng/unotext.hxx   |4 
 include/svx/svxids.hrc|2 
 include/svx/unoshprp.hxx  |4 
 include/svx/xcolit.hxx|9 -
 include/xmloff/txtprmap.hxx   |2 
 include/xmloff/xmltoken.hxx   |4 
 include/xmloff/xmltypes.hxx   |2 
 offapi/UnoApi_offapi.mk   |1 
 offapi/com/sun/star/util/XComplexColor.idl|9 +
 offapi/com/sun/star/util/XThemeColor.idl  |   26 
 oox/inc/drawingml/fontworkhelpers.hxx |   16 +-
 oox/qa/unit/drawingml.cxx |   99 --
 oox/qa/unit/shape.cxx |   15 +-
 oox/source/drawingml/fillproperties.cxx   |   20 +--
 oox/source/drawingml/fontworkhelpers.cxx  |   94 -
 oox/source/drawingml/lineproperties.cxx   |   21 +--
 oox/source/drawingml/textcharacterproperties.cxx  |   16 +-
 oox/source/export/drawingml.cxx   |   38 +++
 oox/source/token/properties.txt   |6 -
 sc/source/core/data/document.cxx  |   13 +-
 sd/qa/unit/uiimpress.cxx  |   40 +++
 sd/source/core/stlsheet.cxx   |   16 +-
 sd/source/ui/func/fuconstr.cxx|2 
 sd/source/ui/view/drviews2.cxx|   10 +
 svx/qa/unit/styles.cxx|   32 ++---
 svx/qa/unit/xoutdev.cxx   |   33 ++
 svx/sdi/svxitems.sdi  |4 
 svx/source/dialog/ThemeColorValueSet.cxx  |2 
 svx/source/dialog/ThemeDialog.cxx |1 
 svx/source/table/cell.cxx |   23 ++--
 svx/source/tbxctrls/PaletteManager.cxx|   16 +-
 svx/source/theme/ThemeColorChanger.cxx|   52 -
 svx/source/unodraw/unoprov.cxx|2 
 svx/source/unodraw/unoshap2.cxx   |2 
 svx/source/unodraw/unoshape.cxx   |   17 +--
 svx/source/xoutdev/xattr.cxx  |   63 +--
 sw/qa/core/theme/ThemeTest.cxx|   11 --
 sw/source/core/model/ThemeColorChanger.cxx|2 
 sw/source/core/unocore/unomap.cxx |4 
 sw/source/core/unocore/unomap1.cxx|6 -
 sw/source/core/unocore/unomapproperties.hxx   |6 -
 sw/source/filter/xml/xmlfmte.cxx  |2 
 writerfilter/source/dmapper/DomainMapper.cxx  |   14 +-
 writerfilter/source/dmapper/PropertyIds.cxx   |2 
 writerfilter/source/dmapper/PropertyIds.hxx   |2 
 writerfilter/source/dmapper/ThemeColorHandler.hxx |2 
 xmloff/inc/XMLThemeColorContext.hxx   |4 
 xmloff/inc/XMLThemeColorHandler.hxx   |   21 +--
 xmloff/inc/xmlprop.hxx|4 
 xmloff/qa/unit/draw.cxx   |  119 ++
 xmloff/source/core/xmltoken.cxx   |4 
 xmloff/source/draw/XMLShapePropertySetContext.cxx |2 
 xmloff/source/draw/sdpropls.cxx   |6 -
 xmloff/source/text/XMLTextPropertySetContext.cxx  |2 
 xmloff/source/text/XMLTextShapeStyleContext.cxx   |2 
 xmloff/source/text/XMLThemeColorContext.cxx   |8 -
 xmloff/source/text/XMLThemeColorExport.cxx|   19 +--
 xmloff/source/text/txtexppr.cxx   |2 
 xmloff/source/text/txtprhdl.cxx   |4 
 xmloff/source/text/txtprmap.cxx   |6 -
 75 files changed, 529 insertions(+), 681 deletions(-)

New commits:
commit ca3bfa9bded6103d4d172ace486b697beeb191be
Author: Tomaž Vajngerl 
AuthorDate: Thu May 11 23:01:10 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Fri May 12 05:00:39 2023 +0200

change ComplexColor to show more useful properties

Change-Id: Ie19f080f2faf388f9b8ba3e9a4b3c0926d5ebdd4

[Libreoffice-commits] core.git: sc/sdi sc/source sc/uiconfig

2023-05-11 Thread Tomaž Vajngerl (via logerrit)
 sc/sdi/tabvwsh.sdi|1 +
 sc/source/ui/view/tabvwsh3.cxx|   34 +-
 sc/uiconfig/scalc/menubar/menubar.xml |1 +
 3 files changed, 35 insertions(+), 1 deletion(-)

New commits:
commit 7f46e701f25e8eef1572e94d092170e0d793dc87
Author: Tomaž Vajngerl 
AuthorDate: Fri May 5 23:10:14 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Thu May 11 18:09:14 2023 +0200

sc: add ThemeDialog to the main menu

Change-Id: I677aac5fdc8f493dcd8190c12e4e44ba09d3eb9d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151450
Tested-by: Tomaž Vajngerl 
Reviewed-by: Tomaž Vajngerl 

diff --git a/sc/sdi/tabvwsh.sdi b/sc/sdi/tabvwsh.sdi
index b10d42bdb7f3..e1da8b2f5d14 100644
--- a/sc/sdi/tabvwsh.sdi
+++ b/sc/sdi/tabvwsh.sdi
@@ -184,6 +184,7 @@ interface TableEditView
 SID_JUMPTOMARK  [ ExecMethod = Execute; StateMethod = NoState; ] // 
status(final|play)
 
 SID_PRINTPREVIEW[ ExecMethod = Execute; StateMethod = GetState; ]
+SID_THEME_DIALOG[ ExecMethod = Execute; StateMethod = GetState; ]
 
 
 // search/replace
diff --git a/sc/source/ui/view/tabvwsh3.cxx b/sc/source/ui/view/tabvwsh3.cxx
index 5c41a4e49b75..da061b14e57b 100644
--- a/sc/source/ui/view/tabvwsh3.cxx
+++ b/sc/source/ui/view/tabvwsh3.cxx
@@ -59,6 +59,11 @@
 
 #include 
 
+#include 
+#include 
+#include 
+#include 
+
 namespace
 {
 void collectUIInformation(const OUString& aZoom)
@@ -1335,7 +1340,34 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
 SelectionChanged();
 }
 break;
-
+case SID_THEME_DIALOG:
+{
+MakeDrawLayer();
+ScTabView* pTabView = GetViewData().GetView();
+ScDrawView* pView = pTabView->GetScDrawView();
+SdrPage* pPage = pView->GetSdrPageView()->GetPage();
+auto const& pTheme = pPage->getSdrPageProperties().GetTheme();
+if (pTheme)
+{
+ScViewData& rViewData = GetViewData();
+vcl::Window* pWin = rViewData.GetActiveWin();
+auto pDialog = std::make_shared(pWin ? 
pWin->GetFrameWeld() : nullptr, pTheme.get());
+weld::DialogController::runAsync(pDialog, [pDialog, 
pPage](sal_uInt32 nResult) {
+if (RET_OK != nResult)
+return;
+
+auto oColorSet = pDialog->getCurrentColorSet();
+if (oColorSet)
+{
+auto& rColorSet = (*oColorSet).get();
+svx::ThemeColorChanger aChanger(pPage);
+aChanger.apply(rColorSet);
+}
+});
+}
+rReq.Done();
+}
+break;
 case SID_OPT_LOCALE_CHANGED :
 {   // locale changed, SYSTEM number formats changed => repaint 
cell contents
 PaintGrid();
diff --git a/sc/uiconfig/scalc/menubar/menubar.xml 
b/sc/uiconfig/scalc/menubar/menubar.xml
index 7b51b4b8d816..413e2e5ce11c 100644
--- a/sc/uiconfig/scalc/menubar/menubar.xml
+++ b/sc/uiconfig/scalc/menubar/menubar.xml
@@ -421,6 +421,7 @@
   
   
   
+  
   
   
 


[Libreoffice-commits] core.git: sc/Library_sc.mk sc/Library_scui.mk sc/source sc/ucalc_setup.mk

2023-05-09 Thread Tomaž Vajngerl (via logerrit)
 sc/Library_sc.mk|1 +
 sc/Library_scui.mk  |1 +
 sc/source/ui/docshell/docsh.cxx |   23 +++
 sc/source/ui/inc/docsh.hxx  |1 +
 sc/ucalc_setup.mk   |1 +
 5 files changed, 27 insertions(+)

New commits:
commit 600ad0a53e25beed8b418d477635d0c8513d5d07
Author: Tomaž Vajngerl 
AuthorDate: Fri May 5 23:09:32 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Tue May 9 16:27:17 2023 +0200

sc: add theme colors to the color picker

Change-Id: Iae8f502a24187f4d41f60fbb727066f214d1cf70
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151449
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/sc/Library_sc.mk b/sc/Library_sc.mk
index 82bab43389c1..141c01fc73b8 100644
--- a/sc/Library_sc.mk
+++ b/sc/Library_sc.mk
@@ -72,6 +72,7 @@ $(eval $(call gb_Library_use_libraries,sc,\
 dbtools \
 drawinglayercore \
 drawinglayer \
+docmodel \
 editeng \
 for \
 forui \
diff --git a/sc/Library_scui.mk b/sc/Library_scui.mk
index 02c2bc8244d1..a4c7572734ae 100644
--- a/sc/Library_scui.mk
+++ b/sc/Library_scui.mk
@@ -50,6 +50,7 @@ $(eval $(call gb_Library_use_libraries,scui,\
comphelper \
cppu \
cppuhelper \
+   docmodel \
editeng \
for \
forui \
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index f5d10cfe67ab..3d8647dc8ea8 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -79,6 +79,9 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
 
 #include 
 #include 
@@ -215,6 +218,26 @@ std::set ScDocShell::GetDocColors()
 return m_pDocument->GetDocColors();
 }
 
+std::vector ScDocShell::GetThemeColors()
+{
+ScTabViewShell* pSh = GetBestViewShell();
+if (!pSh)
+return {};
+ScTabView* pTabView = pSh->GetViewData().GetView();
+if (!pTabView)
+return {};
+ScDrawView* pView = pTabView->GetScDrawView();
+if (!pView)
+return {};
+SdrPage* pPage = pView->GetSdrPageView()->GetPage();
+if (!pPage)
+return {};
+auto const& pTheme = pPage->getSdrPageProperties().GetTheme();
+if (!pTheme)
+return {};
+return pTheme->GetColors();
+}
+
 void ScDocShell::DoEnterHandler()
 {
 ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell();
diff --git a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx
index d92c93e73ff3..5c8484a2fd32 100644
--- a/sc/source/ui/inc/docsh.hxx
+++ b/sc/source/ui/inc/docsh.hxx
@@ -181,6 +181,7 @@ public:
bool bTemplate = false ) const override;
 
 virtual std::set GetDocColors() override;
+virtual std::vector GetThemeColors() override;
 
 virtual boolInitNew( const css::uno::Reference< css::embed::XStorage 
>& ) override;
 virtual boolLoad( SfxMedium& rMedium ) override;
diff --git a/sc/ucalc_setup.mk b/sc/ucalc_setup.mk
index 9a2323572611..63351a87aa28 100644
--- a/sc/ucalc_setup.mk
+++ b/sc/ucalc_setup.mk
@@ -47,6 +47,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sc_ucalc$(1), \
 dbtools \
 drawinglayer \
 drawinglayercore \
+docmodel \
 editeng \
 for \
 forui \


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - editeng/source include/editeng sd/CppunitTest_sd_textfitting_tests.mk sd/Module_sd.mk sd/qa svx/source

2023-05-09 Thread Tomaž Vajngerl (via logerrit)
 editeng/source/editeng/editeng.cxx |   16 +++
 include/editeng/editeng.hxx|5 -
 sd/CppunitTest_sd_textfitting_tests.mk |   79 ++
 sd/Module_sd.mk|1 
 sd/qa/unit/TextFittingTest.cxx |  139 +
 sd/qa/unit/data/TextFitting.odp|binary
 svx/source/svdraw/svdotext.cxx |   20 
 7 files changed, 257 insertions(+), 3 deletions(-)

New commits:
commit d8e4c649f511b4af179dc379bb871df4b0314e8e
Author: Tomaž Vajngerl 
AuthorDate: Fri May 5 15:34:38 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Tue May 9 13:57:57 2023 +0200

Change text auto-fit alg. to also increase the scaling

When in edit mode, the text can be deleted, so the text box size
can become smaller, but the auto-fit algorithm didn't take into
account.
In this case we already have the font and spacing scaling already
set to a specific value and we need to find a scaling value where
the margin is the smallest.

This change also adds a test for the issue.

Change-Id: I6c52f06dfbf5a1e582f7b31aceabf4736498ee90
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151412
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 6c042848b688f64b3c56d65dd9dc5fe85412660a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151446
Tested-by: Jenkins CollaboraOffice 

diff --git a/editeng/source/editeng/editeng.cxx 
b/editeng/source/editeng/editeng.cxx
index d364cc47a179..579766796b93 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -2285,11 +2285,27 @@ void EditEngine::getGlobalSpacingScale(double& rX, 
double& rY) const
 pImpEditEngine->getSpacingScale(rX, rY);
 }
 
+basegfx::B2DTuple EditEngine::getGlobalSpacingScale() const
+{
+double x = 0.0;
+double y = 0.0;
+pImpEditEngine->getSpacingScale(x, y);
+return {x, y};
+}
+
 void EditEngine::getGlobalFontScale(double& rX, double& rY) const
 {
 pImpEditEngine->getFontScale(rX, rY);
 }
 
+basegfx::B2DTuple EditEngine::getGlobalFontScale() const
+{
+double x = 0.0;
+double y = 0.0;
+pImpEditEngine->getFontScale(x, y);
+return {x, y};
+}
+
 void EditEngine::setRoundFontSizeToPt(bool bRound) const
 {
 pImpEditEngine->setRoundToNearestPt(bRound);
diff --git a/include/editeng/editeng.hxx b/include/editeng/editeng.hxx
index 57e57125da8c..55e08f694c1b 100644
--- a/include/editeng/editeng.hxx
+++ b/include/editeng/editeng.hxx
@@ -16,7 +16,7 @@
  *   except in compliance with the License. You may obtain a copy of
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
-// MyEDITENG, due to exported EditEng
+
 #ifndef INCLUDED_EDITENG_EDITENG_HXX
 #define INCLUDED_EDITENG_EDITENG_HXX
 
@@ -40,6 +40,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -419,7 +420,9 @@ public:
 void setGlobalScale(double fFontScaleX, double fFontScaleY, double 
fSpacingScaleX, double fSpacingScaleY);
 
 void getGlobalSpacingScale(double& rX, double& rY) const;
+basegfx::B2DTuple getGlobalSpacingScale() const;
 void getGlobalFontScale(double& rX, double& rY) const;
+basegfx::B2DTuple getGlobalFontScale() const;
 
 void setRoundFontSizeToPt(bool bRound) const;
 
diff --git a/sd/CppunitTest_sd_textfitting_tests.mk 
b/sd/CppunitTest_sd_textfitting_tests.mk
new file mode 100644
index ..20e302d86793
--- /dev/null
+++ b/sd/CppunitTest_sd_textfitting_tests.mk
@@ -0,0 +1,79 @@
+# -*- 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_CppunitTest_CppunitTest,sd_textfitting_tests))
+
+$(eval $(call gb_CppunitTest_use_externals,sd_textfitting_tests,\
+boost_headers \
+libxml2 \
+))
+
+$(eval $(call 
gb_CppunitTest_use_common_precompiled_header,sd_textfitting_tests))
+
+$(eval $(call gb_CppunitTest_add_exception_objects,sd_textfitting_tests, \
+sd/qa/unit/TextFittingTest \
+))
+
+$(eval $(call gb_CppunitTest_use_libraries,sd_textfitting_tests, \
+basegfx \
+comphelper \
+cppu \
+cppuhelper \
+drawinglayer \
+editeng \
+for \
+forui \
+i18nlangtag \
+msfilter \
+oox \
+sal \
+salhelper \
+sax \
+sd \
+sfx \
+sot \
+subsequenttest \
+svl \
+svt \
+svx \
+svxcore \
+test \
+tl \
+tk \
+ucbhelper \
+unotest \
+utl \
+vcl \
+xo \
+))
+
+$(eval $(call gb_CppunitTest_set_include,sd_textfitting_tests,\
+

[Libreoffice-commits] core.git: sc/CppunitTest_sc_ucalc_document_themes.mk sc/Module_sc.mk sc/qa svx/source

2023-05-09 Thread Tomaž Vajngerl (via logerrit)
 sc/CppunitTest_sc_ucalc_document_themes.mk |   67 +
 sc/Module_sc.mk|1 
 sc/qa/unit/ucalc_DocumentThemes.cxx|   38 
 svx/source/svdraw/svdpage.cxx  |2 
 4 files changed, 107 insertions(+), 1 deletion(-)

New commits:
commit 60cc7b1fbe8e44f323016ce79a14c5c74c8b4cd0
Author: Tomaž Vajngerl 
AuthorDate: Wed Apr 12 16:04:42 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Tue May 9 12:41:58 2023 +0200

sc: enable document themes in Calc

Create and check that the SdrPage, that is associated with the
current sheet, has a model::Theme available on creation.

Change-Id: I1814d4a86452b1a15ef01e0b2349d435405f4b7d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150263
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/sc/CppunitTest_sc_ucalc_document_themes.mk 
b/sc/CppunitTest_sc_ucalc_document_themes.mk
new file mode 100644
index ..b779a643ba19
--- /dev/null
+++ b/sc/CppunitTest_sc_ucalc_document_themes.mk
@@ -0,0 +1,67 @@
+# -*- 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_CppunitTest_CppunitTest,sc_ucalc_document_themes))
+
+$(eval $(call 
gb_CppunitTest_use_common_precompiled_header,sc_ucalc_document_themes))
+
+$(eval $(call gb_CppunitTest_add_exception_objects,sc_ucalc_document_themes, \
+sc/qa/unit/ucalc_DocumentThemes \
+))
+
+$(eval $(call gb_CppunitTest_use_externals,sc_ucalc_document_themes, \
+boost_headers \
+mdds_headers \
+libxml2 \
+))
+
+$(eval $(call gb_CppunitTest_use_libraries,sc_ucalc_document_themes, \
+basegfx \
+comphelper \
+cppu \
+cppuhelper \
+sal \
+salhelper \
+sax \
+sc \
+scqahelper \
+sfx \
+svxcore \
+subsequenttest \
+test \
+tl \
+unotest \
+utl \
+vcl \
+))
+
+$(eval $(call gb_CppunitTest_set_include,sc_ucalc_document_themes,\
+-I$(SRCDIR)/sc/source/ui/inc \
+-I$(SRCDIR)/sc/inc \
+$$(INCLUDE) \
+))
+
+$(eval $(call gb_CppunitTest_use_api,sc_ucalc_document_themes,\
+offapi \
+udkapi \
+))
+
+$(eval $(call gb_CppunitTest_use_sdk_api,sc_ucalc_document_themes))
+$(eval $(call gb_CppunitTest_use_ure,sc_ucalc_document_themes))
+$(eval $(call gb_CppunitTest_use_vcl,sc_ucalc_document_themes))
+$(eval $(call gb_CppunitTest_use_rdb,sc_ucalc_document_themes,services))
+$(eval $(call gb_CppunitTest_use_components,sc_ucalc_document_themes))
+$(eval $(call gb_CppunitTest_use_configuration,sc_ucalc_document_themes))
+$(eval $(call gb_CppunitTest_add_arguments,sc_ucalc_document_themes, \
+
-env:arg-env=$(gb_Helper_LIBRARY_PATH_VAR)"{$(gb_Helper_LIBRARY_PATH_VAR)+=$(gb_Helper_LIBRARY_PATH_VAR)}"
 \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/sc/Module_sc.mk b/sc/Module_sc.mk
index 7531130809e8..ce76695b4e4b 100644
--- a/sc/Module_sc.mk
+++ b/sc/Module_sc.mk
@@ -46,6 +46,7 @@ $(eval $(call gb_Module_add_check_targets,sc,\
CppunitTest_sc_ucalc_condformat \
CppunitTest_sc_ucalc_copypaste \
CppunitTest_sc_ucalc_datatransformation \
+   CppunitTest_sc_ucalc_document_themes \
CppunitTest_sc_ucalc_formula \
CppunitTest_sc_ucalc_formula2 \
CppunitTest_sc_ucalc_parallelism \
diff --git a/sc/qa/unit/ucalc_DocumentThemes.cxx 
b/sc/qa/unit/ucalc_DocumentThemes.cxx
new file mode 100644
index ..5c568b9f5ca0
--- /dev/null
+++ b/sc/qa/unit/ucalc_DocumentThemes.cxx
@@ -0,0 +1,38 @@
+/* -*- 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 "helper/qahelper.hxx"
+#include 
+#include 
+
+using namespace css;
+
+class DocumentThemesTest : public ScUcalcTestBase
+{
+};
+
+namespace
+{
+CPPUNIT_TEST_FIXTURE(DocumentThemesTest, testThemes)
+{
+m_pDoc->InitDrawLayer();
+m_pDoc->InsertTab(0, "Test");
+ScDrawLayer* pDrawLayer = m_pDoc->GetDrawLayer();
+CPPUNIT_ASSERT(pDrawLayer);
+const SdrPage* pPage(pDrawLayer->GetPage(0));
+CPPUNIT_ASSERT(pPage);
+auto const& pTheme = pPage->getSdrPageProperties().GetTheme();
+CPPUNIT_ASSERT(pTheme);
+}
+
+} // end anonymous namespace
+
+CPPUNIT_PLUGIN_IMPLEMENT();
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/svdraw/svdpage.cxx 

<    1   2   3   4   5   6   7   8   9   10   >