diff options
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/tabpages/page.cxx | 22 | ||||
-rw-r--r-- | cui/source/tabpages/paragrph.cxx | 39 | ||||
-rw-r--r-- | cui/source/tabpages/tabstpge.cxx | 3 |
3 files changed, 35 insertions, 29 deletions
diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx index 809bd672817b..3f13a6bf6324 100644 --- a/cui/source/tabpages/page.cxx +++ b/cui/source/tabpages/page.cxx @@ -336,13 +336,13 @@ void SvxPageDescPage::Reset( const SfxItemSet* rSet ) if ( pItem ) { const SvxLRSpaceItem& rLRSpace = static_cast<const SvxLRSpaceItem&>(*pItem); - SetMetricValue( *m_xLeftMarginEdit, rLRSpace.GetLeft(), eUnit ); + SetMetricValue(*m_xLeftMarginEdit, rLRSpace.ResolveLeft({}), eUnit); SetMetricValue(*m_xGutterMarginEdit, rLRSpace.GetGutterMargin(), eUnit); m_aBspWin.SetLeft( - static_cast<sal_uInt16>(ConvertLong_Impl( rLRSpace.GetLeft(), eUnit )) ); - SetMetricValue( *m_xRightMarginEdit, rLRSpace.GetRight(), eUnit ); + static_cast<sal_uInt16>(ConvertLong_Impl(rLRSpace.ResolveLeft({}), eUnit))); + SetMetricValue(*m_xRightMarginEdit, rLRSpace.ResolveRight({}), eUnit); m_aBspWin.SetRight( - static_cast<sal_uInt16>(ConvertLong_Impl( rLRSpace.GetRight(), eUnit )) ); + static_cast<sal_uInt16>(ConvertLong_Impl(rLRSpace.ResolveRight({}), eUnit))); } // adjust margins (top/bottom) @@ -633,13 +633,15 @@ bool SvxPageDescPage::FillItemSet( SfxItemSet* rSet ) if (m_xLeftMarginEdit->get_value_changed_from_saved()) { - aMargin.SetLeft( static_cast<sal_uInt16>(GetCoreValue( *m_xLeftMarginEdit, eUnit )) ); + aMargin.SetLeft(SvxIndentValue::twips( + static_cast<sal_uInt16>(GetCoreValue(*m_xLeftMarginEdit, eUnit)))); bModified = true; } if (m_xRightMarginEdit->get_value_changed_from_saved()) { - aMargin.SetRight( static_cast<sal_uInt16>(GetCoreValue( *m_xRightMarginEdit, eUnit )) ); + aMargin.SetRight(SvxIndentValue::twips( + static_cast<sal_uInt16>(GetCoreValue(*m_xRightMarginEdit, eUnit)))); bModified = true; } @@ -1254,8 +1256,8 @@ void SvxPageDescPage::InitHeadFoot_Impl( const SfxItemSet& rSet ) m_aBspWin.SetHdDist( nDist ); const SvxLRSpaceItem& rLR = rHeaderSet.Get( GetWhich( SID_ATTR_LRSPACE ) ); - m_aBspWin.SetHdLeft( rLR.GetLeft() ); - m_aBspWin.SetHdRight( rLR.GetRight() ); + m_aBspWin.SetHdLeft(rLR.ResolveLeft({})); + m_aBspWin.SetHdRight(rLR.ResolveRight({})); m_aBspWin.SetHeader( true ); } else @@ -1309,8 +1311,8 @@ void SvxPageDescPage::InitHeadFoot_Impl( const SfxItemSet& rSet ) m_aBspWin.SetFtDist( nDist ); const SvxLRSpaceItem& rLR = rFooterSet.Get( GetWhich( SID_ATTR_LRSPACE ) ); - m_aBspWin.SetFtLeft( rLR.GetLeft() ); - m_aBspWin.SetFtRight( rLR.GetRight() ); + m_aBspWin.SetFtLeft(rLR.ResolveLeft({})); + m_aBspWin.SetFtRight(rLR.ResolveRight({})); m_aBspWin.SetFooter( true ); } else diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx index a8f6150d0dab..ea8b6a4def38 100644 --- a/cui/source/tabpages/paragrph.cxx +++ b/cui/source/tabpages/paragrph.cxx @@ -381,12 +381,12 @@ bool SvxStdParagraphTabPage::FillItemSet( SfxItemSet* rOutSet ) } else { - item.SetTextLeft(m_aLeftIndent.GetCoreValue(eUnit)); + item.SetTextLeft(lcl_GetFontRelativeValue(m_aLeftIndent, eUnit)); } } else { - item.SetTextLeft(m_aLeftIndent.GetCoreValue(eUnit)); + item.SetTextLeft(lcl_GetFontRelativeValue(m_aLeftIndent, eUnit)); } if (!pOld || *static_cast<const SvxTextLeftMarginItem*>(pOld) != item || SfxItemState::INVALID == GetItemSet().GetItemState(nWhich)) @@ -417,12 +417,12 @@ bool SvxStdParagraphTabPage::FillItemSet( SfxItemSet* rOutSet ) } else { - item.SetRight(m_aRightIndent.GetCoreValue(eUnit)); + item.SetRight(lcl_GetFontRelativeValue(m_aRightIndent, eUnit)); } } else { - item.SetRight(m_aRightIndent.GetCoreValue(eUnit)); + item.SetRight(lcl_GetFontRelativeValue(m_aRightIndent, eUnit)); } if (!pOld || *static_cast<const SvxRightMarginItem*>(pOld) != item || SfxItemState::INVALID == GetItemSet().GetItemState(nWhich)) @@ -463,7 +463,7 @@ bool SvxStdParagraphTabPage::FillItemSet( SfxItemSet* rOutSet ) item.SetTextFirstLineOffset(lcl_GetFontRelativeValue(m_aFLineIndent, eUnit)); } item.SetAutoFirst(m_xAutoCB->get_active()); - if (item.GetTextFirstLineOffsetValue() < 0) + if (item.GetTextFirstLineOffset().m_dValue < 0.0) { bNullTab = true; } @@ -498,13 +498,13 @@ bool SvxStdParagraphTabPage::FillItemSet( SfxItemSet* rOutSet ) aMargin.SetTextLeft( rOldItem.GetTextLeft(), static_cast<sal_uInt16>(m_aLeftIndent.get_value(FieldUnit::NONE)) ); else - aMargin.SetTextLeft(m_aLeftIndent.GetCoreValue(eUnit)); + aMargin.SetTextLeft(lcl_GetFontRelativeValue(m_aLeftIndent, eUnit)); if ( m_aRightIndent.IsRelative() ) aMargin.SetRight( rOldItem.GetRight(), static_cast<sal_uInt16>(m_aRightIndent.get_value(FieldUnit::NONE)) ); else - aMargin.SetRight(m_aRightIndent.GetCoreValue(eUnit)); + aMargin.SetRight(lcl_GetFontRelativeValue(m_aRightIndent, eUnit)); if ( m_aFLineIndent.IsRelative() ) aMargin.SetTextFirstLineOffset( @@ -517,12 +517,12 @@ bool SvxStdParagraphTabPage::FillItemSet( SfxItemSet* rOutSet ) } else { - aMargin.SetTextLeft(m_aLeftIndent.GetCoreValue(eUnit)); - aMargin.SetRight(m_aRightIndent.GetCoreValue(eUnit)); + aMargin.SetTextLeft(lcl_GetFontRelativeValue(m_aLeftIndent, eUnit)); + aMargin.SetRight(lcl_GetFontRelativeValue(m_aRightIndent, eUnit)); aMargin.SetTextFirstLineOffset(lcl_GetFontRelativeValue(m_aFLineIndent, eUnit)); } aMargin.SetAutoFirst(m_xAutoCB->get_active()); - if ( aMargin.GetTextFirstLineOffsetValue() < 0.0 ) + if (aMargin.GetTextFirstLineOffset().m_dValue < 0.0) bNullTab = true; if ( !pOld || *static_cast<const SvxLRSpaceItem*>(pOld) != aMargin || @@ -642,12 +642,12 @@ void SvxStdParagraphTabPage::Reset( const SfxItemSet* rSet ) { m_aLeftIndent.SetRelative(false); m_aLeftIndent.SetFieldUnit(eFUnit); - m_aLeftIndent.SetMetricValue(rOldLeftMargin.GetTextLeft(), eUnit); + lcl_SetFontRelativeValue(m_aLeftIndent, rOldLeftMargin.GetTextLeft(), eUnit); } } else { - m_aLeftIndent.SetMetricValue(rOldLeftMargin.GetTextLeft(), eUnit); + lcl_SetFontRelativeValue(m_aLeftIndent, rOldLeftMargin.GetTextLeft(), eUnit); } } else if (m_bSplitLRSpace) @@ -673,12 +673,12 @@ void SvxStdParagraphTabPage::Reset( const SfxItemSet* rSet ) { m_aRightIndent.SetRelative(false); m_aRightIndent.SetFieldUnit(eFUnit); - m_aRightIndent.SetMetricValue(rOldRightMargin.GetRight(), eUnit); + lcl_SetFontRelativeValue(m_aRightIndent, rOldRightMargin.GetRight(), eUnit); } } else { - m_aRightIndent.SetMetricValue(rOldRightMargin.GetRight(), eUnit); + lcl_SetFontRelativeValue(m_aRightIndent, rOldRightMargin.GetRight(), eUnit); } } else if (m_bSplitLRSpace) @@ -743,7 +743,7 @@ void SvxStdParagraphTabPage::Reset( const SfxItemSet* rSet ) { m_aLeftIndent.SetRelative(false); m_aLeftIndent.SetFieldUnit(eFUnit); - m_aLeftIndent.SetMetricValue(rOldItem.GetTextLeft(), eUnit); + lcl_SetFontRelativeValue(m_aLeftIndent, rOldItem.GetTextLeft(), eUnit); } if ( rOldItem.GetPropRight() != 100 ) @@ -755,7 +755,7 @@ void SvxStdParagraphTabPage::Reset( const SfxItemSet* rSet ) { m_aRightIndent.SetRelative(false); m_aRightIndent.SetFieldUnit(eFUnit); - m_aRightIndent.SetMetricValue(rOldItem.GetRight(), eUnit); + lcl_SetFontRelativeValue(m_aRightIndent, rOldItem.GetRight(), eUnit); } if ( rOldItem.GetPropTextFirstLineOffset() != 100 ) @@ -777,8 +777,8 @@ void SvxStdParagraphTabPage::Reset( const SfxItemSet* rSet ) const SvxLRSpaceItem& rSpace = static_cast<const SvxLRSpaceItem&>(rSet->Get( _nWhich )); - m_aLeftIndent.SetMetricValue(rSpace.GetTextLeft(), eUnit); - m_aRightIndent.SetMetricValue(rSpace.GetRight(), eUnit); + lcl_SetFontRelativeValue(m_aLeftIndent, rSpace.GetTextLeft(), eUnit); + lcl_SetFontRelativeValue(m_aRightIndent, rSpace.GetRight(), eUnit); lcl_SetFontRelativeValue(m_aFLineIndent, rSpace.GetTextFirstLineOffset(), eUnit); m_xAutoCB->set_active(rSpace.IsAutoFirst()); } @@ -979,6 +979,9 @@ SvxStdParagraphTabPage::SvxStdParagraphTabPage(weld::Container* pPage, weld::Dia Init_Impl(); m_aFLineIndent.set_min(-9999, FieldUnit::NONE); // is set to 0 on default m_aFLineIndent.EnableFontRelativeMode(); + + m_aLeftIndent.EnableFontRelativeMode(); + m_aRightIndent.EnableFontRelativeMode(); } SvxStdParagraphTabPage::~SvxStdParagraphTabPage() diff --git a/cui/source/tabpages/tabstpge.cxx b/cui/source/tabpages/tabstpge.cxx index 34b0b631af3a..78e9aec3b739 100644 --- a/cui/source/tabpages/tabstpge.cxx +++ b/cui/source/tabpages/tabstpge.cxx @@ -177,7 +177,8 @@ bool SvxTabulatorTabPage::FillItemSet(SfxItemSet* rSet) pLRSpace = GetOldItem(*rSet, SID_ATTR_LRSPACE); if (pLRSpace - && static_cast<const SvxLRSpaceItem*>(pLRSpace)->GetTextFirstLineOffsetValue() < 0.0) + && static_cast<const SvxLRSpaceItem*>(pLRSpace)->GetTextFirstLineOffset().m_dValue + < 0.0) { SvxTabStop aNull(0, SvxTabAdjust::Default); aNewTabs->Insert(aNull); |