diff options
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/editobj.cxx | 6 | ||||
-rw-r--r-- | editeng/source/editeng/editobj2.hxx | 11 | ||||
-rw-r--r-- | editeng/source/editeng/impedit4.cxx | 4 |
3 files changed, 11 insertions, 10 deletions
diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx index 2179b27af7fc..e9654f4d3a38 100644 --- a/editeng/source/editeng/editobj.cxx +++ b/editeng/source/editeng/editobj.cxx @@ -275,7 +275,7 @@ EditTextObjectImpl::EditTextObjectImpl( SfxItemPool* pP ) : meUserType(OutlinerMode::DontKnow) , meScriptType(SvtScriptType::NONE) , meRotation(TextRotation::NONE) - , mnMetric(0xFFFF) + , meMetric(MapUnit::LASTENUMDUMMY) , mbVertical(false) { // #i101239# ensure target is an EditEngineItemPool, else @@ -301,7 +301,7 @@ EditTextObjectImpl::EditTextObjectImpl( const EditTextObjectImpl& r ) : meUserType(r.meUserType) , meScriptType(r.meScriptType) , meRotation(r.meRotation) - , mnMetric(r.mnMetric) + , meMetric(r.meMetric) , mbVertical(r.mbVertical) { // Do not copy PortionInfo @@ -791,7 +791,7 @@ bool EditTextObjectImpl::Equals( const EditTextObjectImpl& rCompare, bool bCompa return true; if( ( bComparePool && mpPool != rCompare.mpPool ) || - ( mnMetric != rCompare.mnMetric ) || + ( meMetric != rCompare.meMetric ) || ( meUserType!= rCompare.meUserType ) || ( meScriptType != rCompare.meScriptType ) || ( mbVertical != rCompare.mbVertical ) || diff --git a/editeng/source/editeng/editobj2.hxx b/editeng/source/editeng/editobj2.hxx index 2a972a4a9564..66a3517883be 100644 --- a/editeng/source/editeng/editobj2.hxx +++ b/editeng/source/editeng/editobj2.hxx @@ -26,6 +26,8 @@ #include <svl/sharedstring.hxx> #include <svl/languageoptions.hxx> +#include <tools/long.hxx> +#include <tools/mapunit.hxx> #include <memory> #include <vector> @@ -176,8 +178,7 @@ private: OutlinerMode meUserType; SvtScriptType meScriptType; TextRotation meRotation; - - sal_uInt16 mnMetric; + MapUnit meMetric; bool mbOwnerOfPool; bool mbVertical; @@ -251,9 +252,9 @@ public: virtual editeng::FieldUpdater GetFieldUpdater() override { return editeng::FieldUpdater(*this); } - bool HasMetric() const { return mnMetric != 0xFFFF; } - sal_uInt16 GetMetric() const { return mnMetric; } - void SetMetric( sal_uInt16 n ) { mnMetric = n; } + bool HasMetric() const { return meMetric != MapUnit::LASTENUMDUMMY; } + MapUnit GetMetric() const { return meMetric; } + void SetMetric( MapUnit n ) { meMetric = n; } bool IsOwnerOfPool() const { return mbOwnerOfPool; } diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx index 5b11662eda1b..90b89fc3bcc7 100644 --- a/editeng/source/editeng/impedit4.cxx +++ b/editeng/source/editeng/impedit4.cxx @@ -993,7 +993,7 @@ std::unique_ptr<EditTextObject> ImpEditEngine::CreateTextObject( EditSelection a pTxtObj->SetVertical( GetDirectVertical() ); pTxtObj->SetRotation( GetRotation() ); MapUnit eMapUnit = aEditDoc.GetItemPool().GetMetric( DEF_METRIC ); - pTxtObj->SetMetric( static_cast<sal_uInt16>(eMapUnit) ); + pTxtObj->SetMetric( eMapUnit ); if ( pTxtObj->IsOwnerOfPool() ) pTxtObj->GetPool()->SetDefaultMetric( eMapUnit ); @@ -1191,7 +1191,7 @@ EditSelection ImpEditEngine::InsertTextObject( const EditTextObject& rTextObject MapUnit eSourceUnit = MapUnit(), eDestUnit = MapUnit(); if (rTextObjectImpl.HasMetric()) { - eSourceUnit = static_cast<MapUnit>(rTextObjectImpl.GetMetric()); + eSourceUnit = rTextObjectImpl.GetMetric(); eDestUnit = aEditDoc.GetItemPool().GetMetric( DEF_METRIC ); if ( eSourceUnit != eDestUnit ) bConvertMetricOfItems = true; |