summaryrefslogtreecommitdiff
path: root/svx/source/sidebar/paragraph
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2018-11-06 14:37:23 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2018-11-08 12:15:51 +0100
commit9e0770ea7e0cf094add54ad64bc9ff825d24bbe1 (patch)
treee897291e44ecb11ca44ba5e5ebefe03ac536862f /svx/source/sidebar/paragraph
parent841ee6fb052fb35467d74b70f575a86c8c0fe3b7 (diff)
Convert FieldUnit to scoped enum
Change-Id: Id2df31daa596a18c79af5fc6ea162deb6e24d5af Reviewed-on: https://gerrit.libreoffice.org/62958 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'svx/source/sidebar/paragraph')
-rw-r--r--svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx8
-rw-r--r--svx/source/sidebar/paragraph/ParaPropertyPanel.cxx36
-rw-r--r--svx/source/sidebar/paragraph/ParaSpacingWindow.cxx30
3 files changed, 37 insertions, 37 deletions
diff --git a/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx b/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx
index 183c9405631d..d77b26962dc0 100644
--- a/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx
+++ b/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx
@@ -78,7 +78,7 @@ ParaLineSpacingControl::ParaLineSpacingControl(sal_uInt16 nId, vcl::Window* pPar
mpLineDistAtPercentBox->SetModifyHdl( aLink2 );
mpLineDistAtMetricBox->SetModifyHdl( aLink2 );
- FieldUnit eUnit = FUNIT_INCH;
+ FieldUnit eUnit = FieldUnit::INCH;
const SfxPoolItem* pItem = nullptr;
if (SfxViewFrame::Current()->GetBindings().GetDispatcher()->QueryState(SID_ATTR_METRIC, pItem) >= SfxItemState::DEFAULT)
eUnit = static_cast<FieldUnit>(static_cast<const SfxUInt16Item*>(pItem)->GetValue());
@@ -281,7 +281,7 @@ void ParaLineSpacingControl::UpdateMetricFields()
mpLineDistAtMetricBox->SetMin(0);
if (mpLineDistAtMetricBox->GetText().isEmpty())
- mpLineDistAtMetricBox->SetValue(mpLineDistAtMetricBox->Normalize(0), FUNIT_TWIP);
+ mpLineDistAtMetricBox->SetValue(mpLineDistAtMetricBox->Normalize(0), FieldUnit::TWIP);
mpLineDistLabel->Enable();
mpActLineDistFld->Show();
@@ -294,7 +294,7 @@ void ParaLineSpacingControl::UpdateMetricFields()
mpActLineDistFld = mpLineDistAtPercentBox.get();
if (mpLineDistAtPercentBox->GetText().isEmpty())
- mpLineDistAtPercentBox->SetValue(mpLineDistAtPercentBox->Normalize(100), FUNIT_TWIP);
+ mpLineDistAtPercentBox->SetValue(mpLineDistAtPercentBox->Normalize(100), FieldUnit::TWIP);
mpLineDistLabel->Enable();
mpActLineDistFld->Show();
@@ -306,7 +306,7 @@ void ParaLineSpacingControl::UpdateMetricFields()
mpActLineDistFld = mpLineDistAtMetricBox.get();
sal_Int64 nTemp = mpLineDistAtMetricBox->GetValue();
- mpLineDistAtMetricBox->SetMin(mpLineDistAtMetricBox->Normalize(MIN_FIXED_DISTANCE), FUNIT_TWIP);
+ mpLineDistAtMetricBox->SetMin(mpLineDistAtMetricBox->Normalize(MIN_FIXED_DISTANCE), FieldUnit::TWIP);
if (mpLineDistAtMetricBox->GetValue() != nTemp)
SetMetricValue(*mpLineDistAtMetricBox, FIX_DIST_DEF, MapUnit::MapTwip);
diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
index b750a25663d9..a6db28c0d02c 100644
--- a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
+++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
@@ -245,9 +245,9 @@ void ParaPropertyPanel::StateChangedIndentImpl( SfxItemState eState, const SfxPo
case CombinedEnumContext(Application::WriterVariants, Context::Text):
case CombinedEnumContext(Application::WriterVariants, Context::Table):
{
- mpLeftIndent->SetMin( NEGA_MAXVALUE, FUNIT_100TH_MM );
- mpRightIndent->SetMin( NEGA_MAXVALUE, FUNIT_100TH_MM );
- mpFLineIndent->SetMin( NEGA_MAXVALUE, FUNIT_100TH_MM );
+ mpLeftIndent->SetMin( NEGA_MAXVALUE, FieldUnit::MM_100TH );
+ mpRightIndent->SetMin( NEGA_MAXVALUE, FieldUnit::MM_100TH );
+ mpFLineIndent->SetMin( NEGA_MAXVALUE, FieldUnit::MM_100TH );
}
break;
}
@@ -274,7 +274,7 @@ void ParaPropertyPanel::StateChangedIndentImpl( SfxItemState eState, const SfxPo
&& maContext.GetCombinedContext_DI() != CombinedEnumContext(Application::WriterVariants, Context::Default)
&& maContext.GetCombinedContext_DI() != CombinedEnumContext(Application::WriterVariants, Context::Table))
{
- mpFLineIndent->SetMin( nVal*-1, FUNIT_100TH_MM );
+ mpFLineIndent->SetMin( nVal*-1, FieldUnit::MM_100TH );
}
long nrVal = OutputDevice::LogicToLogic( aTxtRight, MapUnit::MapTwip, MapUnit::Map100thMM );
@@ -288,9 +288,9 @@ void ParaPropertyPanel::StateChangedIndentImpl( SfxItemState eState, const SfxPo
case CombinedEnumContext(Application::WriterVariants, Context::Table):
case CombinedEnumContext(Application::WriterVariants, Context::Annotation):
{
- mpLeftIndent->SetMax( MAX_SW - nrVal, FUNIT_100TH_MM );
- mpRightIndent->SetMax( MAX_SW - nVal, FUNIT_100TH_MM );
- mpFLineIndent->SetMax( MAX_SW - nVal - nrVal, FUNIT_100TH_MM );
+ mpLeftIndent->SetMax( MAX_SW - nrVal, FieldUnit::MM_100TH );
+ mpRightIndent->SetMax( MAX_SW - nVal, FieldUnit::MM_100TH );
+ mpFLineIndent->SetMax( MAX_SW - nVal - nrVal, FieldUnit::MM_100TH );
}
break;
case CombinedEnumContext(Application::DrawImpress, Context::DrawText):
@@ -299,18 +299,18 @@ void ParaPropertyPanel::StateChangedIndentImpl( SfxItemState eState, const SfxPo
case CombinedEnumContext(Application::DrawImpress, Context::TextObject):
case CombinedEnumContext(Application::DrawImpress, Context::Graphic):
{
- mpLeftIndent->SetMax( MAX_SC_SD - nrVal, FUNIT_100TH_MM );
- mpRightIndent->SetMax( MAX_SC_SD - nVal, FUNIT_100TH_MM );
- mpFLineIndent->SetMax( MAX_SC_SD - nVal - nrVal, FUNIT_100TH_MM );
+ mpLeftIndent->SetMax( MAX_SC_SD - nrVal, FieldUnit::MM_100TH );
+ mpRightIndent->SetMax( MAX_SC_SD - nVal, FieldUnit::MM_100TH );
+ mpFLineIndent->SetMax( MAX_SC_SD - nVal - nrVal, FieldUnit::MM_100TH );
}
}
- mpLeftIndent->SetValue( nVal, FUNIT_100TH_MM );
- mpRightIndent->SetValue( nrVal, FUNIT_100TH_MM );
+ mpLeftIndent->SetValue( nVal, FieldUnit::MM_100TH );
+ mpRightIndent->SetValue( nrVal, FieldUnit::MM_100TH );
long nfVal = OutputDevice::LogicToLogic( aTxtFirstLineOfst, MapUnit::MapTwip, MapUnit::Map100thMM );
nfVal = static_cast<long>(mpFLineIndent->Normalize( nfVal ));
- mpFLineIndent->SetValue( nfVal, FUNIT_100TH_MM );
+ mpFLineIndent->SetValue( nfVal, FieldUnit::MM_100TH );
}
else if( eState == SfxItemState::DISABLED )
{
@@ -345,11 +345,11 @@ void ParaPropertyPanel::StateChangedULImpl( SfxItemState eState, const SfxPoolIt
sal_Int64 nVal = OutputDevice::LogicToLogic( maUpper, MapUnit::MapTwip, MapUnit::Map100thMM );
nVal = mpTopDist->Normalize( nVal );
- mpTopDist->SetValue( nVal, FUNIT_100TH_MM );
+ mpTopDist->SetValue( nVal, FieldUnit::MM_100TH );
nVal = OutputDevice::LogicToLogic( maLower, MapUnit::MapTwip, MapUnit::Map100thMM );
nVal = mpBottomDist->Normalize( nVal );
- mpBottomDist->SetValue( nVal, FUNIT_100TH_MM );
+ mpBottomDist->SetValue( nVal, FieldUnit::MM_100TH );
}
else if(eState == SfxItemState::DISABLED )
{
@@ -365,7 +365,7 @@ void ParaPropertyPanel::StateChangedULImpl( SfxItemState eState, const SfxPoolIt
FieldUnit ParaPropertyPanel::GetCurrentUnit( SfxItemState eState, const SfxPoolItem* pState )
{
- FieldUnit eUnit = FUNIT_NONE;
+ FieldUnit eUnit = FieldUnit::NONE;
if ( pState && eState >= SfxItemState::DEFAULT )
eUnit = static_cast<FieldUnit>(static_cast<const SfxUInt16Item*>(pState)->GetValue());
@@ -403,8 +403,8 @@ ParaPropertyPanel::ParaPropertyPanel(vcl::Window* pParent,
maTxtLeft (0),
maUpper (0),
maLower (0),
- m_eMetricUnit(FUNIT_NONE),
- m_last_eMetricUnit(FUNIT_NONE),
+ m_eMetricUnit(FieldUnit::NONE),
+ m_last_eMetricUnit(FieldUnit::NONE),
m_eLRSpaceUnit(),
m_eULSpaceUnit(),
maLRSpaceControl (SID_ATTR_PARA_LRSPACE,*pBindings,*this),
diff --git a/svx/source/sidebar/paragraph/ParaSpacingWindow.cxx b/svx/source/sidebar/paragraph/ParaSpacingWindow.cxx
index 90153f18d8a2..8b67b8919907 100644
--- a/svx/source/sidebar/paragraph/ParaSpacingWindow.cxx
+++ b/svx/source/sidebar/paragraph/ParaSpacingWindow.cxx
@@ -86,11 +86,11 @@ void ParaULSpacingWindow::SetValue(const SvxULSpaceItem* pItem)
{
sal_Int64 nVal = pItem->GetUpper();
nVal = m_pAboveSpacing->Normalize(nVal);
- m_pAboveSpacing->SetValue(nVal, FUNIT_100TH_MM);
+ m_pAboveSpacing->SetValue(nVal, FieldUnit::MM_100TH);
nVal = pItem->GetLower();
nVal = m_pBelowSpacing->Normalize(nVal);
- m_pBelowSpacing->SetValue(nVal, FUNIT_100TH_MM);
+ m_pBelowSpacing->SetValue(nVal, FieldUnit::MM_100TH);
}
IMPL_LINK_NOARG(ParaULSpacingWindow, ModifySpacingHdl, Edit&, void)
@@ -193,9 +193,9 @@ void ParaLRSpacingWindow::SetValue(SfxItemState eState, const SfxPoolItem* pStat
case CombinedEnumContext(Application::WriterVariants, Context::Text):
case CombinedEnumContext(Application::WriterVariants, Context::Table):
{
- m_pBeforeSpacing->SetMin(NEGA_MAXVALUE, FUNIT_100TH_MM);
- m_pAfterSpacing->SetMin(NEGA_MAXVALUE, FUNIT_100TH_MM);
- m_pFLSpacing->SetMin(NEGA_MAXVALUE, FUNIT_100TH_MM);
+ m_pBeforeSpacing->SetMin(NEGA_MAXVALUE, FieldUnit::MM_100TH);
+ m_pAfterSpacing->SetMin(NEGA_MAXVALUE, FieldUnit::MM_100TH);
+ m_pFLSpacing->SetMin(NEGA_MAXVALUE, FieldUnit::MM_100TH);
}
break;
}
@@ -217,7 +217,7 @@ void ParaLRSpacingWindow::SetValue(SfxItemState eState, const SfxPoolItem* pStat
&& m_aContext.GetCombinedContext_DI() != CombinedEnumContext(Application::WriterVariants, Context::Default)
&& m_aContext.GetCombinedContext_DI() != CombinedEnumContext(Application::WriterVariants, Context::Table))
{
- m_pFLSpacing->SetMin(aTxtLeft*-1, FUNIT_100TH_MM);
+ m_pFLSpacing->SetMin(aTxtLeft*-1, FieldUnit::MM_100TH);
}
aTxtRight = static_cast<long>(m_pAfterSpacing->Normalize(aTxtRight));
@@ -230,9 +230,9 @@ void ParaLRSpacingWindow::SetValue(SfxItemState eState, const SfxPoolItem* pStat
case CombinedEnumContext(Application::WriterVariants, Context::Table):
case CombinedEnumContext(Application::WriterVariants, Context::Annotation):
{
- m_pBeforeSpacing->SetMax(MAX_SW - aTxtRight, FUNIT_100TH_MM);
- m_pAfterSpacing->SetMax(MAX_SW - aTxtLeft, FUNIT_100TH_MM);
- m_pFLSpacing->SetMax(MAX_SW - aTxtLeft - aTxtRight, FUNIT_100TH_MM);
+ m_pBeforeSpacing->SetMax(MAX_SW - aTxtRight, FieldUnit::MM_100TH);
+ m_pAfterSpacing->SetMax(MAX_SW - aTxtLeft, FieldUnit::MM_100TH);
+ m_pFLSpacing->SetMax(MAX_SW - aTxtLeft - aTxtRight, FieldUnit::MM_100TH);
}
break;
case CombinedEnumContext(Application::DrawImpress, Context::DrawText):
@@ -241,17 +241,17 @@ void ParaLRSpacingWindow::SetValue(SfxItemState eState, const SfxPoolItem* pStat
case CombinedEnumContext(Application::DrawImpress, Context::TextObject):
case CombinedEnumContext(Application::DrawImpress, Context::Graphic):
{
- m_pBeforeSpacing->SetMax(MAX_SC_SD - aTxtRight, FUNIT_100TH_MM);
- m_pAfterSpacing->SetMax(MAX_SC_SD - aTxtLeft, FUNIT_100TH_MM);
- m_pFLSpacing->SetMax(MAX_SC_SD - aTxtLeft - aTxtRight, FUNIT_100TH_MM);
+ m_pBeforeSpacing->SetMax(MAX_SC_SD - aTxtRight, FieldUnit::MM_100TH);
+ m_pAfterSpacing->SetMax(MAX_SC_SD - aTxtLeft, FieldUnit::MM_100TH);
+ m_pFLSpacing->SetMax(MAX_SC_SD - aTxtLeft - aTxtRight, FieldUnit::MM_100TH);
}
}
- m_pBeforeSpacing->SetValue(aTxtLeft, FUNIT_100TH_MM);
- m_pAfterSpacing->SetValue(aTxtRight, FUNIT_100TH_MM);
+ m_pBeforeSpacing->SetValue(aTxtLeft, FieldUnit::MM_100TH);
+ m_pAfterSpacing->SetValue(aTxtRight, FieldUnit::MM_100TH);
aTxtFirstLineOfst = static_cast<long>(m_pFLSpacing->Normalize(aTxtFirstLineOfst));
- m_pFLSpacing->SetValue(aTxtFirstLineOfst, FUNIT_100TH_MM);
+ m_pFLSpacing->SetValue(aTxtFirstLineOfst, FieldUnit::MM_100TH);
}
else if(eState == SfxItemState::DISABLED)
{