tdf#89953: put zero kerning if item state has been invalid

Change-Id: I96d81ed7654dc310df68a7ff376bbcd2e1d5810b
Reviewed-on: https://gerrit.libreoffice.org/24361
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
This commit is contained in:
Oliver Specht
2016-04-26 11:34:13 +00:00
committed by Samuel Mehrbrodt
parent b308e79340
commit c3572701cf
+3 -2
View File
@@ -3178,10 +3178,11 @@ bool SvxCharPositionPage::FillItemSet( SfxItemSet* rSet )
long nVal = LogicToLogic( nTmp, MAP_POINT, (MapUnit)eUnit );
nKerning = (short)m_pKerningMF->Denormalize( nVal );
SfxItemState eOldKernState = rOldSet.GetItemState( nWhich, false );
if ( pOld )
{
const SvxKerningItem& rItem = *static_cast<const SvxKerningItem*>(pOld);
if ( rItem.GetValue() == nKerning )
if ( (eOldKernState >= SfxItemState::DEFAULT || m_pKerningMF->GetText().isEmpty()) && rItem.GetValue() == nKerning )
bChanged = false;
}
@@ -3190,7 +3191,7 @@ bool SvxCharPositionPage::FillItemSet( SfxItemSet* rSet )
rSet->Put( SvxKerningItem( nKerning, nWhich ) );
bModified = true;
}
else if ( SfxItemState::DEFAULT == rOldSet.GetItemState( nWhich, false ) )
else if ( SfxItemState::DEFAULT == eOldKernState )
rSet->InvalidateItem(nWhich);
// Pair-Kerning