[Libreoffice-commits] core.git: editeng/source include/editeng svx/source
Noel Grandin
noel.grandin at collabora.co.uk
Fri Sep 15 08:21:40 UTC 2017
editeng/source/items/flditem.cxx | 6 +++---
editeng/source/uno/unofield.cxx | 6 +++---
include/editeng/measfld.hxx | 2 +-
svx/source/svdraw/svdomeas.cxx | 14 +++++++-------
4 files changed, 14 insertions(+), 14 deletions(-)
New commits:
commit fda59e9768bc8643ea36bda1539f22928b7946cf
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Fri Sep 15 09:29:37 2017 +0200
convert SdrMeasureFieldKind to scoped enum
Change-Id: I8896d46623843d3fe341c057d7ee0376a99f4741
Reviewed-on: https://gerrit.libreoffice.org/42310
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/editeng/source/items/flditem.cxx b/editeng/source/items/flditem.cxx
index 138a10e557a0..b16c0da747b6 100644
--- a/editeng/source/items/flditem.cxx
+++ b/editeng/source/items/flditem.cxx
@@ -197,11 +197,11 @@ SvxFieldData* SvxFieldData::Create(const uno::Reference<text::XTextContent>& xTe
}
case text::textfield::Type::MEASURE:
{
- SdrMeasureFieldKind eKind = SDRMEASUREFIELD_VALUE;
+ SdrMeasureFieldKind eKind = SdrMeasureFieldKind::Value;
sal_Int16 nTmp = -1;
xPropSet->getPropertyValue(UNO_TC_PROP_MEASURE_KIND) >>= nTmp;
- if (nTmp == static_cast<sal_Int16>(SDRMEASUREFIELD_UNIT) ||
- nTmp == static_cast<sal_Int16>(SDRMEASUREFIELD_ROTA90BLANCS))
+ if (nTmp == static_cast<sal_Int16>(SdrMeasureFieldKind::Unit) ||
+ nTmp == static_cast<sal_Int16>(SdrMeasureFieldKind::Rotate90Blanks))
eKind = static_cast<SdrMeasureFieldKind>(nTmp);
return new SdrMeasureField(eKind);
diff --git a/editeng/source/uno/unofield.cxx b/editeng/source/uno/unofield.cxx
index b6d6da1dfb79..e6357f0e4969 100644
--- a/editeng/source/uno/unofield.cxx
+++ b/editeng/source/uno/unofield.cxx
@@ -278,7 +278,7 @@ SvxUnoTextField::SvxUnoTextField( sal_Int32 nServiceId ) throw()
break;
case text::textfield::Type::MEASURE:
- mpImpl->mnInt16 = SDRMEASUREFIELD_VALUE;
+ mpImpl->mnInt16 = static_cast<sal_uInt16>(SdrMeasureFieldKind::Value);
break;
default:
@@ -490,8 +490,8 @@ SvxFieldData* SvxUnoTextField::CreateFieldData() const throw()
case text::textfield::Type::MEASURE:
{
- SdrMeasureFieldKind eKind = SDRMEASUREFIELD_VALUE;
- if( mpImpl->mnInt16 == (sal_Int16)SDRMEASUREFIELD_UNIT || mpImpl->mnInt16 == (sal_Int16)SDRMEASUREFIELD_ROTA90BLANCS )
+ SdrMeasureFieldKind eKind = SdrMeasureFieldKind::Value;
+ if( mpImpl->mnInt16 == (sal_Int16)SdrMeasureFieldKind::Unit || mpImpl->mnInt16 == (sal_Int16)SdrMeasureFieldKind::Rotate90Blanks )
eKind = (SdrMeasureFieldKind) mpImpl->mnInt16;
pData = new SdrMeasureField( eKind);
break;
diff --git a/include/editeng/measfld.hxx b/include/editeng/measfld.hxx
index f29ae7e9f314..6422afb07753 100644
--- a/include/editeng/measfld.hxx
+++ b/include/editeng/measfld.hxx
@@ -35,7 +35,7 @@
class SdrMeasureObj;
-enum SdrMeasureFieldKind {SDRMEASUREFIELD_VALUE,SDRMEASUREFIELD_UNIT,SDRMEASUREFIELD_ROTA90BLANCS};
+enum class SdrMeasureFieldKind { Value, Unit, Rotate90Blanks };
class EDITENG_DLLPUBLIC SdrMeasureField: public SvxFieldData {
SdrMeasureFieldKind eMeasureFieldKind;
diff --git a/svx/source/svdraw/svdomeas.cxx b/svx/source/svdraw/svdomeas.cxx
index f2ea26644eb1..b81fadca3811 100644
--- a/svx/source/svdraw/svdomeas.cxx
+++ b/svx/source/svdraw/svdomeas.cxx
@@ -92,7 +92,7 @@ OUString SdrMeasureObj::TakeRepresentation(SdrMeasureFieldKind eMeasureFieldKind
switch(eMeasureFieldKind)
{
- case SDRMEASUREFIELD_VALUE:
+ case SdrMeasureFieldKind::Value:
{
if(pModel)
{
@@ -160,7 +160,7 @@ OUString SdrMeasureObj::TakeRepresentation(SdrMeasureFieldKind eMeasureFieldKind
break;
}
- case SDRMEASUREFIELD_UNIT:
+ case SdrMeasureFieldKind::Unit:
{
if(bShowUnit)
{
@@ -178,7 +178,7 @@ OUString SdrMeasureObj::TakeRepresentation(SdrMeasureFieldKind eMeasureFieldKind
break;
}
- case SDRMEASUREFIELD_ROTA90BLANCS:
+ case SdrMeasureFieldKind::Rotate90Blanks:
{
if(bTextRota90)
{
@@ -580,11 +580,11 @@ void SdrMeasureObj::UndirtyText() const
OutlinerParaObject* pOutlinerParaObject = SdrTextObj::GetOutlinerParaObject();
if(pOutlinerParaObject==nullptr)
{
- rOutliner.QuickInsertField(SvxFieldItem(SdrMeasureField(SDRMEASUREFIELD_ROTA90BLANCS), EE_FEATURE_FIELD), ESelection(0,0));
- rOutliner.QuickInsertField(SvxFieldItem(SdrMeasureField(SDRMEASUREFIELD_VALUE), EE_FEATURE_FIELD),ESelection(0,1));
+ rOutliner.QuickInsertField(SvxFieldItem(SdrMeasureField(SdrMeasureFieldKind::Rotate90Blanks), EE_FEATURE_FIELD), ESelection(0,0));
+ rOutliner.QuickInsertField(SvxFieldItem(SdrMeasureField(SdrMeasureFieldKind::Value), EE_FEATURE_FIELD),ESelection(0,1));
rOutliner.QuickInsertText(" ", ESelection(0,2));
- rOutliner.QuickInsertField(SvxFieldItem(SdrMeasureField(SDRMEASUREFIELD_UNIT), EE_FEATURE_FIELD),ESelection(0,3));
- rOutliner.QuickInsertField(SvxFieldItem(SdrMeasureField(SDRMEASUREFIELD_ROTA90BLANCS), EE_FEATURE_FIELD),ESelection(0,4));
+ rOutliner.QuickInsertField(SvxFieldItem(SdrMeasureField(SdrMeasureFieldKind::Unit), EE_FEATURE_FIELD),ESelection(0,3));
+ rOutliner.QuickInsertField(SvxFieldItem(SdrMeasureField(SdrMeasureFieldKind::Rotate90Blanks), EE_FEATURE_FIELD),ESelection(0,4));
if(GetStyleSheet())
rOutliner.SetStyleSheet(0, GetStyleSheet());
More information about the Libreoffice-commits
mailing list