diff options
author | Jonathan Clark <jonathan@libreoffice.org> | 2024-11-18 10:03:13 -0700 |
---|---|---|
committer | Jonathan Clark <jonathan@libreoffice.org> | 2024-11-28 22:10:05 +0100 |
commit | 7e4f4a0ccd3c56093dec44c7dcdd14c8b34623c3 (patch) | |
tree | 143ed734707df3092338b951af6072ae5e47cd99 /svx/source/dialog/hdft.cxx | |
parent | c73e52d295c97e1ce35ad7066d0e92982e897e29 (diff) |
tdf#163913 Implement font-relative margins
This change adds loext:margin-left and loext:margin-right, which
implement margins that support font-relative units.
See tdf#36709 for additional details.
Change-Id: I31b0dd2b6f98cb5b02fd4dca3608db6fdee4054c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177473
Tested-by: Jenkins
Reviewed-by: Jonathan Clark <jonathan@libreoffice.org>
Diffstat (limited to 'svx/source/dialog/hdft.cxx')
-rw-r--r-- | svx/source/dialog/hdft.cxx | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/svx/source/dialog/hdft.cxx b/svx/source/dialog/hdft.cxx index fe91c933326b..0bce3b3f4381 100644 --- a/svx/source/dialog/hdft.cxx +++ b/svx/source/dialog/hdft.cxx @@ -255,8 +255,8 @@ bool SvxHFPage::FillItemSet( SfxItemSet* rSet ) // Margins SvxLRSpaceItem aLR( nWLRSpace ); - aLR.SetLeft( static_cast<sal_uInt16>(GetCoreValue( *m_xLMEdit, eUnit )) ); - aLR.SetRight( static_cast<sal_uInt16>(GetCoreValue( *m_xRMEdit, eUnit )) ); + aLR.SetLeft(SvxIndentValue::twips(GetCoreValue(*m_xLMEdit, eUnit))); + aLR.SetRight(SvxIndentValue::twips(GetCoreValue(*m_xRMEdit, eUnit))); aSet.Put( aLR ); SvxULSpaceItem aUL( nWULSpace ); @@ -372,8 +372,8 @@ void SvxHFPage::Reset( const SfxItemSet* rSet ) } m_xHeightDynBtn->set_active(rDynamic.GetValue()); - SetMetricValue( *m_xLMEdit, rLR.GetLeft(), eUnit ); - SetMetricValue( *m_xRMEdit, rLR.GetRight(), eUnit ); + SetMetricValue(*m_xLMEdit, rLR.ResolveLeft({}), eUnit); + SetMetricValue(*m_xRMEdit, rLR.ResolveRight({}), eUnit); m_xCntSharedBox->set_active(rShared.GetValue()); if (pSharedFirst) m_xCntSharedFirstBox->set_active(pSharedFirst->GetValue()); @@ -794,8 +794,8 @@ void SvxHFPage::ActivatePage( const SfxItemSet& rSet ) // Set left and right margins const SvxLRSpaceItem& rLRSpace = static_cast<const SvxLRSpaceItem&>(*pItem); - m_aBspWin.SetLeft( rLRSpace.GetLeft() ); - m_aBspWin.SetRight( rLRSpace.GetRight() ); + m_aBspWin.SetLeft(rLRSpace.ResolveLeft({})); + m_aBspWin.SetRight(rLRSpace.ResolveRight({})); } else { @@ -865,8 +865,8 @@ void SvxHFPage::ActivatePage( const SfxItemSet& rSet ) m_aBspWin.SetHdHeight( rSize.GetSize().Height() - nDist ); m_aBspWin.SetHdDist( nDist ); - 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 @@ -903,8 +903,8 @@ void SvxHFPage::ActivatePage( const SfxItemSet& rSet ) m_aBspWin.SetFtHeight( rSize.GetSize().Height() - nDist ); m_aBspWin.SetFtDist( nDist ); - 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 |