Kaydet (Commit) fda59e97 authored tarafından Noel Grandin's avatar Noel Grandin

convert SdrMeasureFieldKind to scoped enum

Change-Id: I8896d46623843d3fe341c057d7ee0376a99f4741
Reviewed-on: https://gerrit.libreoffice.org/42310Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 1fb44aaf
...@@ -197,11 +197,11 @@ SvxFieldData* SvxFieldData::Create(const uno::Reference<text::XTextContent>& xTe ...@@ -197,11 +197,11 @@ SvxFieldData* SvxFieldData::Create(const uno::Reference<text::XTextContent>& xTe
} }
case text::textfield::Type::MEASURE: case text::textfield::Type::MEASURE:
{ {
SdrMeasureFieldKind eKind = SDRMEASUREFIELD_VALUE; SdrMeasureFieldKind eKind = SdrMeasureFieldKind::Value;
sal_Int16 nTmp = -1; sal_Int16 nTmp = -1;
xPropSet->getPropertyValue(UNO_TC_PROP_MEASURE_KIND) >>= nTmp; xPropSet->getPropertyValue(UNO_TC_PROP_MEASURE_KIND) >>= nTmp;
if (nTmp == static_cast<sal_Int16>(SDRMEASUREFIELD_UNIT) || if (nTmp == static_cast<sal_Int16>(SdrMeasureFieldKind::Unit) ||
nTmp == static_cast<sal_Int16>(SDRMEASUREFIELD_ROTA90BLANCS)) nTmp == static_cast<sal_Int16>(SdrMeasureFieldKind::Rotate90Blanks))
eKind = static_cast<SdrMeasureFieldKind>(nTmp); eKind = static_cast<SdrMeasureFieldKind>(nTmp);
return new SdrMeasureField(eKind); return new SdrMeasureField(eKind);
......
...@@ -278,7 +278,7 @@ SvxUnoTextField::SvxUnoTextField( sal_Int32 nServiceId ) throw() ...@@ -278,7 +278,7 @@ SvxUnoTextField::SvxUnoTextField( sal_Int32 nServiceId ) throw()
break; break;
case text::textfield::Type::MEASURE: case text::textfield::Type::MEASURE:
mpImpl->mnInt16 = SDRMEASUREFIELD_VALUE; mpImpl->mnInt16 = static_cast<sal_uInt16>(SdrMeasureFieldKind::Value);
break; break;
default: default:
...@@ -490,8 +490,8 @@ SvxFieldData* SvxUnoTextField::CreateFieldData() const throw() ...@@ -490,8 +490,8 @@ SvxFieldData* SvxUnoTextField::CreateFieldData() const throw()
case text::textfield::Type::MEASURE: case text::textfield::Type::MEASURE:
{ {
SdrMeasureFieldKind eKind = SDRMEASUREFIELD_VALUE; SdrMeasureFieldKind eKind = SdrMeasureFieldKind::Value;
if( mpImpl->mnInt16 == (sal_Int16)SDRMEASUREFIELD_UNIT || mpImpl->mnInt16 == (sal_Int16)SDRMEASUREFIELD_ROTA90BLANCS ) if( mpImpl->mnInt16 == (sal_Int16)SdrMeasureFieldKind::Unit || mpImpl->mnInt16 == (sal_Int16)SdrMeasureFieldKind::Rotate90Blanks )
eKind = (SdrMeasureFieldKind) mpImpl->mnInt16; eKind = (SdrMeasureFieldKind) mpImpl->mnInt16;
pData = new SdrMeasureField( eKind); pData = new SdrMeasureField( eKind);
break; break;
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
class SdrMeasureObj; class SdrMeasureObj;
enum SdrMeasureFieldKind {SDRMEASUREFIELD_VALUE,SDRMEASUREFIELD_UNIT,SDRMEASUREFIELD_ROTA90BLANCS}; enum class SdrMeasureFieldKind { Value, Unit, Rotate90Blanks };
class EDITENG_DLLPUBLIC SdrMeasureField: public SvxFieldData { class EDITENG_DLLPUBLIC SdrMeasureField: public SvxFieldData {
SdrMeasureFieldKind eMeasureFieldKind; SdrMeasureFieldKind eMeasureFieldKind;
......
...@@ -92,7 +92,7 @@ OUString SdrMeasureObj::TakeRepresentation(SdrMeasureFieldKind eMeasureFieldKind ...@@ -92,7 +92,7 @@ OUString SdrMeasureObj::TakeRepresentation(SdrMeasureFieldKind eMeasureFieldKind
switch(eMeasureFieldKind) switch(eMeasureFieldKind)
{ {
case SDRMEASUREFIELD_VALUE: case SdrMeasureFieldKind::Value:
{ {
if(pModel) if(pModel)
{ {
...@@ -160,7 +160,7 @@ OUString SdrMeasureObj::TakeRepresentation(SdrMeasureFieldKind eMeasureFieldKind ...@@ -160,7 +160,7 @@ OUString SdrMeasureObj::TakeRepresentation(SdrMeasureFieldKind eMeasureFieldKind
break; break;
} }
case SDRMEASUREFIELD_UNIT: case SdrMeasureFieldKind::Unit:
{ {
if(bShowUnit) if(bShowUnit)
{ {
...@@ -178,7 +178,7 @@ OUString SdrMeasureObj::TakeRepresentation(SdrMeasureFieldKind eMeasureFieldKind ...@@ -178,7 +178,7 @@ OUString SdrMeasureObj::TakeRepresentation(SdrMeasureFieldKind eMeasureFieldKind
break; break;
} }
case SDRMEASUREFIELD_ROTA90BLANCS: case SdrMeasureFieldKind::Rotate90Blanks:
{ {
if(bTextRota90) if(bTextRota90)
{ {
...@@ -580,11 +580,11 @@ void SdrMeasureObj::UndirtyText() const ...@@ -580,11 +580,11 @@ void SdrMeasureObj::UndirtyText() const
OutlinerParaObject* pOutlinerParaObject = SdrTextObj::GetOutlinerParaObject(); OutlinerParaObject* pOutlinerParaObject = SdrTextObj::GetOutlinerParaObject();
if(pOutlinerParaObject==nullptr) if(pOutlinerParaObject==nullptr)
{ {
rOutliner.QuickInsertField(SvxFieldItem(SdrMeasureField(SDRMEASUREFIELD_ROTA90BLANCS), EE_FEATURE_FIELD), ESelection(0,0)); rOutliner.QuickInsertField(SvxFieldItem(SdrMeasureField(SdrMeasureFieldKind::Rotate90Blanks), EE_FEATURE_FIELD), ESelection(0,0));
rOutliner.QuickInsertField(SvxFieldItem(SdrMeasureField(SDRMEASUREFIELD_VALUE), EE_FEATURE_FIELD),ESelection(0,1)); rOutliner.QuickInsertField(SvxFieldItem(SdrMeasureField(SdrMeasureFieldKind::Value), EE_FEATURE_FIELD),ESelection(0,1));
rOutliner.QuickInsertText(" ", ESelection(0,2)); rOutliner.QuickInsertText(" ", ESelection(0,2));
rOutliner.QuickInsertField(SvxFieldItem(SdrMeasureField(SDRMEASUREFIELD_UNIT), EE_FEATURE_FIELD),ESelection(0,3)); rOutliner.QuickInsertField(SvxFieldItem(SdrMeasureField(SdrMeasureFieldKind::Unit), EE_FEATURE_FIELD),ESelection(0,3));
rOutliner.QuickInsertField(SvxFieldItem(SdrMeasureField(SDRMEASUREFIELD_ROTA90BLANCS), EE_FEATURE_FIELD),ESelection(0,4)); rOutliner.QuickInsertField(SvxFieldItem(SdrMeasureField(SdrMeasureFieldKind::Rotate90Blanks), EE_FEATURE_FIELD),ESelection(0,4));
if(GetStyleSheet()) if(GetStyleSheet())
rOutliner.SetStyleSheet(0, GetStyleSheet()); rOutliner.SetStyleSheet(0, GetStyleSheet());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment