From 37203cb43758048134584f7d52efbc9b3dc59f65 Mon Sep 17 00:00:00 2001 From: Tomaž Vajngerl Date: Mon, 14 Aug 2023 22:28:16 +0200 Subject: Fix setting ComplexColor for lines/strokes through the dialog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Setting the line/stroke color through the (tab) dialog did not work as the complex colors was not set to the XLineColorItem. Change-Id: Ie1404264f2f82964fe3a5507a6f61ba269254134 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155683 Tested-by: Tomaž Vajngerl Reviewed-by: Tomaž Vajngerl --- cui/source/tabpages/tpline.cxx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'cui') diff --git a/cui/source/tabpages/tpline.cxx b/cui/source/tabpages/tpline.cxx index cbb6a6c1a6d1..37fe8ef913b0 100644 --- a/cui/source/tabpages/tpline.cxx +++ b/cui/source/tabpages/tpline.cxx @@ -456,8 +456,10 @@ bool SvxLineTabPage::FillItemSet( SfxItemSet* rAttrs ) // Line color if (m_xLbColor->IsValueChangedFromSaved()) { - NamedColor aColor = m_xLbColor->GetSelectedEntry(); - XLineColorItem aItem(aColor.m_aName, aColor.m_aColor); + NamedColor aNamedColor = m_xLbColor->GetSelectedEntry(); + XLineColorItem aItem(aNamedColor.m_aName, aNamedColor.m_aColor); + aItem.setComplexColor(aNamedColor.getComplexColor()); + pOld = GetOldItem( *rAttrs, XATTR_LINECOLOR ); if ( !pOld || !( *static_cast(pOld) == aItem ) ) { @@ -758,8 +760,10 @@ void SvxLineTabPage::FillXLSet_Impl() m_rXLSet.Put( XLineEndWidthItem( GetCoreValue( *m_xMtrEndWidth, m_ePoolUnit ) ) ); m_rXLSet.Put( XLineWidthItem( GetCoreValue( *m_xMtrLineWidth, m_ePoolUnit ) ) ); - NamedColor aColor = m_xLbColor->GetSelectedEntry(); - m_rXLSet.Put(XLineColorItem(aColor.m_aName, aColor.m_aColor)); + NamedColor aNamedColor = m_xLbColor->GetSelectedEntry(); + XLineColorItem aLineColor(aNamedColor.m_aName, aNamedColor.m_aColor); + aLineColor.setComplexColor(aNamedColor.getComplexColor()); + m_rXLSet.Put(aLineColor); // Centered line end if( m_xTsbCenterStart->get_state() == TRISTATE_TRUE ) -- cgit