diff options
Diffstat (limited to 'svx/source/svdraw/svdobj.cxx')
-rw-r--r-- | svx/source/svdraw/svdobj.cxx | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index c1a21fca565a..2bfa847f8552 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -2030,6 +2030,23 @@ const SfxPoolItem& SdrObject::GetObjectItem(const sal_uInt16 nWhich) const return GetObjectItemSet().Get(nWhich); } +SfxMapUnit SdrObject::GetObjectMapUnit() const +{ + SfxMapUnit aRetval(SFX_MAPUNIT_100TH_MM); + SdrItemPool* pPool = GetObjectItemPool(); + + if(pPool) + { + aRetval = pPool->GetMetric(0); + } + else + { + OSL_ENSURE(pPool, "SdrObjects always need a pool (!)"); + } + + return aRetval; +} + const SfxPoolItem& SdrObject::GetMergedItem(const sal_uInt16 nWhich) const { return GetMergedItemSet().Get(nWhich); @@ -3028,7 +3045,7 @@ sal_Bool SdrObject::TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B } // force MapUnit to 100th mm - SfxMapUnit eMapUnit = GetObjectItemSet().GetPool()->GetMetric(0); + const SfxMapUnit eMapUnit(GetObjectMapUnit()); if(eMapUnit != SFX_MAPUNIT_100TH_MM) { switch(eMapUnit) @@ -3079,7 +3096,7 @@ void SdrObject::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const ba } // force metric to pool metric - SfxMapUnit eMapUnit = GetObjectItemSet().GetPool()->GetMetric(0); + const SfxMapUnit eMapUnit(GetObjectMapUnit()); if(eMapUnit != SFX_MAPUNIT_100TH_MM) { switch(eMapUnit) |