include/editeng/borderline.hxx |4 -
include/editeng/brushitem.hxx |2
include/sfx2/namedcolor.hxx |4 +
sc/source/filter/excel/xestyle.cxx | 96 ++--
sc/source/filter/inc/export/ExportTools.hxx | 38 +++
5 files changed, 68 insertions(+), 76 deletions(-)
New commits:
commit 614dfb98cd4705b63bf1e525d3d34df9ce950ebb
Author: Tomaž Vajngerl
AuthorDate: Sat Jul 29 15:48:35 2023 +0200
Commit: Tomaž Vajngerl
CommitDate: Tue Aug 1 08:16:03 2023 +0200
set finalColor of the ComplexColor in BorderLine and BrushItem
The final color is stored inside the ComplexColor and is used to
represent the final computed color from theme color and/or
transforms.
Change-Id: I405615bba144bfe876b75c565746d9eebc88e973
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155111
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl
diff --git a/include/editeng/borderline.hxx b/include/editeng/borderline.hxx
index eb7d2f0f4f8e..596b8b59f413 100644
--- a/include/editeng/borderline.hxx
+++ b/include/editeng/borderline.hxx
@@ -172,8 +172,11 @@ public:
model::ComplexColor const& getComplexColor() const
{
+auto pUnConst = const_cast(this);
+pUnConst->m_aComplexColor.setFinalColor(GetColor());
return m_aComplexColor;
}
+
void setComplexColor(model::ComplexColor const& rComplexColor)
{
m_aComplexColor = rComplexColor;
@@ -258,4 +261,3 @@ EDITENG_DLLPUBLIC bool operator!=( const SvxBorderLine&
rLeft, const SvxBorderLi
} // namespace editeng
#endif
-
diff --git a/include/editeng/brushitem.hxx b/include/editeng/brushitem.hxx
index 26e5458bc5bf..de433f2f272d 100644
--- a/include/editeng/brushitem.hxx
+++ b/include/editeng/brushitem.hxx
@@ -93,6 +93,8 @@ public:
const model::ComplexColor& getComplexColor() const
{
+auto pUnConst = const_cast(this);
+pUnConst->maComplexColor.setFinalColor(GetColor());
return maComplexColor;
}
diff --git a/include/sfx2/namedcolor.hxx b/include/sfx2/namedcolor.hxx
index fc7941686fbd..1235cf848827 100644
--- a/include/sfx2/namedcolor.hxx
+++ b/include/sfx2/namedcolor.hxx
@@ -47,6 +47,10 @@ struct SFX2_DLLPUBLIC NamedColor
if (m_nLumMod != 0)
aComplexColor.addTransformation({
model::TransformationType::LumOff, m_nLumOff });
}
+else
+{
+aComplexColor.setColor(m_aColor);
+}
aComplexColor.setFinalColor(m_aColor);
commit fc996d8d195263f09d8aaf65deaf9d42f7413be8
Author: Tomaž Vajngerl
AuthorDate: Sat Jul 29 15:42:32 2023 +0200
Commit: Tomaž Vajngerl
CommitDate: Tue Aug 1 08:15:55 2023 +0200
sc: remove code duplication at OOXML export of ComplexColor
This removes the code duplication when exporting the ComplexColor
to OOXML. Now we use a common oox::xls::writeComplexColor function
which writes a ComplexColor to the stream.
Change-Id: I4e7bb1f8427409d09550c71894c327dba5096bec
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155110
Tested-by: Tomaž Vajngerl
Reviewed-by: Tomaž Vajngerl
diff --git a/sc/source/filter/excel/xestyle.cxx
b/sc/source/filter/excel/xestyle.cxx
index 02fb6c1a90d6..2937c153fb21 100644
--- a/sc/source/filter/excel/xestyle.cxx
+++ b/sc/source/filter/excel/xestyle.cxx
@@ -49,6 +49,7 @@
#include
#include
#include
+#include
#include
#include
@@ -1851,29 +1852,17 @@ static void lcl_WriteBorder(XclExpXmlStream& rStrm,
sal_Int32 nElement, sal_uInt
if( nLineStyle == EXC_LINE_NONE )
{
rStyleSheet->singleElement(nElement);
-}
-else if (rComplexColor.isValidSchemeType())
-{
-rStyleSheet->startElement(nElement, XML_style,
ToLineStyle(nLineStyle));
-
-sal_Int32 nTheme =
oox::convertThemeColorTypeToExcelThemeNumber(rComplexColor.getSchemeType());
-double fTintShade =
oox::convertColorTransformsToTintOrShade(rComplexColor);
-rStyleSheet->singleElement(XML_color,
-XML_theme, OString::number(nTheme),
-XML_tint,
sax_fastparser::UseIf(OString::number(fTintShade), fTintShade != 0.0));
-
-rStyleSheet->endElement(nElement);
+return;
}
else if (rColor == Color(0, 0, 0))
{
rStyleSheet->singleElement(nElement, XML_style,
ToLineStyle(nLineStyle));
+return;
}
-else
-{
-rStyleSheet->startElement(nElement, XML_style,
ToLineStyle(nLineStyle));
-rStyleSheet->singleElement(XML_color, XML_rgb,
XclXmlUtils::ToOString(rColor));
-rStyleSheet->endElement( nElement );
-}
+
+rStyleSheet->startElement(nElement, XML_style, ToLineStyle(nLineStyle));
+oox::xls::writeComplexColor(rStyleSheet, XML_color, rComplexColor, rColor);
+rStyleSheet->endElement(nElement);
}
void XclExpCellBorder::SaveXml(XclExpXmlStream& rStream)