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

2023-08-01 Thread Tomaž Vajngerl (via logerrit)
 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) 

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

2013-10-21 Thread Stephan Bergmann
 include/editeng/unotext.hxx |4 ++--
 include/sfx2/objface.hxx|1 -
 2 files changed, 2 insertions(+), 3 deletions(-)

New commits:
commit be42330ae276219dee5b7ed3c7625f8da6121d1d
Author: Stephan Bergmann sberg...@redhat.com
Date:   Mon Oct 21 15:35:24 2013 +0200

Base class ctors/dtors can be protected

Change-Id: I8b68b78042a980850d71a0f67ec520986d6085e4

diff --git a/include/editeng/unotext.hxx b/include/editeng/unotext.hxx
index dd56df8..90f5845 100644
--- a/include/editeng/unotext.hxx
+++ b/include/editeng/unotext.hxx
@@ -278,12 +278,12 @@ protected:
 virtual void getPropertyValue( const SfxItemPropertySimpleEntry* pMap, 
com::sun::star::uno::Any rAny, const SfxItemSet rSet ) 
throw(::com::sun::star::beans::UnknownPropertyException );
 virtual void setPropertyValue( const SfxItemPropertySimpleEntry* pMap, 
const com::sun::star::uno::Any rValue, const ESelection rSelection, const 
SfxItemSet rOldSet, SfxItemSet rNewSet ) 
throw(::com::sun::star::beans::UnknownPropertyException, 
::com::sun::star::lang::IllegalArgumentException );
 
-public:
 SvxUnoTextRangeBase( const SvxItemPropertySet* _pSet ) throw();
 SvxUnoTextRangeBase( const SvxEditSource* pSource, const 
SvxItemPropertySet* _pSet ) throw();
 SvxUnoTextRangeBase( const SvxUnoTextRangeBase rRange ) throw();
 virtual ~SvxUnoTextRangeBase() throw();
 
+public:
 // Internal
 const ESelection   GetSelection() const throw() { CheckSelection( 
((SvxUnoTextRangeBase*)this)-maSelection, mpEditSource-GetTextForwarder() ); 
return maSelection; };
 voidSetSelection( const ESelection rSelection ) 
throw();
@@ -394,13 +394,13 @@ class EDITENG_DLLPUBLIC SvxUnoTextBase  : public 
SvxUnoTextRangeBase,
 protected:
 ::com::sun::star::uno::Reference ::com::sun::star::text::XText
xParentText;
 
-public:
 SvxUnoTextBase( ) throw();
 SvxUnoTextBase( const SvxItemPropertySet* _pSet ) throw();
 SvxUnoTextBase( const SvxEditSource* pSource, const SvxItemPropertySet* 
_pSet, ::com::sun::star::uno::Reference  ::com::sun::star::text::XText  
xParent ) throw();
 SvxUnoTextBase( const SvxUnoTextBase rText ) throw();
 virtual ~SvxUnoTextBase() throw();
 
+public:
 UNO3_GETIMPLEMENTATION_DECL( SvxUnoTextBase )
 
 ESelection InsertField( const SvxFieldItem rField ) throw();
commit 9775a3715498183ae6f5118fbaee1c5d488b6dc6
Author: Stephan Bergmann sberg...@redhat.com
Date:   Mon Oct 21 14:37:44 2013 +0200

Remove unused forward declaration

Change-Id: I2b725ad476cbd9552a7e57a550945a1f227fc823

diff --git a/include/sfx2/objface.hxx b/include/sfx2/objface.hxx
index f852a00..34ca4ba 100644
--- a/include/sfx2/objface.hxx
+++ b/include/sfx2/objface.hxx
@@ -26,7 +26,6 @@
 #include sfx2/msg.hxx
 #include tools/resid.hxx
 
-struct SfxFormalArgument;
 struct SfxInterface_Impl;
 class  SfxConfigItem;
 class  SfxModule;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits