diff options
author | Mathias Bauer <mba@openoffice.org> | 2010-02-02 23:59:20 +0100 |
---|---|---|
committer | Mathias Bauer <mba@openoffice.org> | 2010-02-02 23:59:20 +0100 |
commit | 804ec146aef02c1f7b4fc8ae3e3b1b76dee5fc6e (patch) | |
tree | f905b46fc7fd455f89d8fb42cb0b0c2a589e8811 /sfx2 | |
parent | 67e1bf3e38752438334f66ddcc0217def867b512 (diff) |
#i107450#: some fixes for problems found in CAT0 test
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/inc/sfx2/module.hxx | 3 | ||||
-rw-r--r-- | sfx2/source/appl/module.cxx | 23 |
2 files changed, 21 insertions, 5 deletions
diff --git a/sfx2/inc/sfx2/module.hxx b/sfx2/inc/sfx2/module.hxx index 599102464c79..cd2028eee0e1 100644 --- a/sfx2/inc/sfx2/module.hxx +++ b/sfx2/inc/sfx2/module.hxx @@ -97,7 +97,8 @@ public: BOOL IsActive() const; static SfxModule* GetActiveModule( SfxViewFrame* pFrame=NULL ); - FieldUnit GetModuleFieldUnit() const; + static FieldUnit GetCurrentFieldUnit(); + FieldUnit GetFieldUnit() const; //#if 0 // _SOLAR__PRIVATE SAL_DLLPRIVATE static SfxModuleArr_Impl& GetModules_Impl(); 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; +} |