Fix setting ComplexColor for lines/strokes through the dialog

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 <quikee@gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
This commit is contained in:
Tomaž Vajngerl 2023-08-14 22:28:16 +02:00 committed by Tomaž Vajngerl
parent ad873064b0
commit 37203cb437

View file

@ -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<const XLineColorItem*>(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 )