summaryrefslogtreecommitdiff
path: root/sfx2/source/appl/module.cxx
diff options
context:
space:
mode:
authorMathias Bauer <mba@openoffice.org>2010-02-02 23:59:20 +0100
committerMathias Bauer <mba@openoffice.org>2010-02-02 23:59:20 +0100
commit804ec146aef02c1f7b4fc8ae3e3b1b76dee5fc6e (patch)
treef905b46fc7fd455f89d8fb42cb0b0c2a589e8811 /sfx2/source/appl/module.cxx
parent67e1bf3e38752438334f66ddcc0217def867b512 (diff)
#i107450#: some fixes for problems found in CAT0 test
Diffstat (limited to 'sfx2/source/appl/module.cxx')
-rw-r--r--sfx2/source/appl/module.cxx23
1 files changed, 19 insertions, 4 deletions
diff --git a/sfx2/source/appl/module.cxx b/sfx2/source/appl/module.cxx
index e74d1805a3ef..1bba58ba0318 100644
--- a/sfx2/source/appl/module.cxx
+++ b/sfx2/source/appl/module.cxx
@@ -413,13 +413,28 @@ SfxModule* SfxModule::GetActiveModule( SfxViewFrame* pFrame )
return pSh ? pSh->GetModule() : 0;
}
-FieldUnit SfxModule::GetModuleFieldUnit() const
+FieldUnit SfxModule::GetCurrentFieldUnit()
{
FieldUnit eUnit = FUNIT_INCH;
- const SfxPoolItem* _pItem = GetItem( SID_ATTR_METRIC );
- if ( _pItem )
- eUnit = (FieldUnit)( (SfxUInt16Item*)_pItem )->GetValue();
+ SfxModule* pModule = GetActiveModule();
+ if ( pModule )
+ {
+ const SfxPoolItem* pItem = pModule->GetItem( SID_ATTR_METRIC );
+ DBG_ASSERT( pItem, "GetFieldUnit(): no item" );
+ if ( pItem )
+ eUnit = (FieldUnit)( (SfxUInt16Item*)pItem )->GetValue();
+ }
else
DBG_ERRORFILE( "GetModuleFieldUnit(): no module found" );
return eUnit;
}
+
+FieldUnit SfxModule::GetFieldUnit() const
+{
+ FieldUnit eUnit = FUNIT_INCH;
+ const SfxPoolItem* pItem = GetItem( SID_ATTR_METRIC );
+ DBG_ASSERT( pItem, "GetFieldUnit(): no item" );
+ if ( pItem )
+ eUnit = (FieldUnit)( (SfxUInt16Item*)pItem )->GetValue();
+ return eUnit;
+}