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 | |
parent | 67e1bf3e38752438334f66ddcc0217def867b512 (diff) |
#i107450#: some fixes for problems found in CAT0 test
-rw-r--r-- | sfx2/inc/sfx2/module.hxx | 3 | ||||
-rw-r--r-- | sfx2/source/appl/module.cxx | 23 | ||||
-rw-r--r-- | svx/source/dialog/_contdlg.cxx | 4 | ||||
-rw-r--r-- | svx/source/dialog/fontwork.cxx | 6 | ||||
-rw-r--r-- | svx/source/dialog/imapdlg.cxx | 4 | ||||
-rw-r--r-- | svx/source/dialog/srchdlg.cxx | 2 | ||||
-rw-r--r-- | svx/source/engine3d/float3d.cxx | 2 | ||||
-rw-r--r-- | svx/source/stbctrls/pszctrl.cxx | 2 | ||||
-rw-r--r-- | svx/source/tbxctrls/itemwin.cxx | 4 |
9 files changed, 33 insertions, 17 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; +} diff --git a/svx/source/dialog/_contdlg.cxx b/svx/source/dialog/_contdlg.cxx index df2486aaf98a..f3fd48f6b024 100644 --- a/svx/source/dialog/_contdlg.cxx +++ b/svx/source/dialog/_contdlg.cxx @@ -874,7 +874,7 @@ IMPL_LINK( SvxSuperContourDlg, Tbx1ClickHdl, ToolBox*, pTbx ) IMPL_LINK( SvxSuperContourDlg, MousePosHdl, ContourWindow*, pWnd ) { String aStr; - const FieldUnit eFieldUnit = GetBindings().GetDispatcher()->GetModule()->GetModuleFieldUnit(); + const FieldUnit eFieldUnit = GetBindings().GetDispatcher()->GetModule()->GetFieldUnit(); const Point& rMousePos = pWnd->GetMousePos(); LocaleDataWrapper aLocaleWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() ); const sal_Unicode cSep = aLocaleWrapper.getNumDecimalSep().GetChar(0); @@ -897,7 +897,7 @@ IMPL_LINK( SvxSuperContourDlg, MousePosHdl, ContourWindow*, pWnd ) IMPL_LINK( SvxSuperContourDlg, GraphSizeHdl, ContourWindow*, pWnd ) { String aStr; - const FieldUnit eFieldUnit = GetBindings().GetDispatcher()->GetModule()->GetModuleFieldUnit(); + const FieldUnit eFieldUnit = GetBindings().GetDispatcher()->GetModule()->GetFieldUnit(); const Size& rSize = pWnd->GetGraphicSize(); LocaleDataWrapper aLocaleWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() ); const sal_Unicode cSep = aLocaleWrapper.getNumDecimalSep().GetChar(0); diff --git a/svx/source/dialog/fontwork.cxx b/svx/source/dialog/fontwork.cxx index 49d28989529e..b06582d09238 100644 --- a/svx/source/dialog/fontwork.cxx +++ b/svx/source/dialog/fontwork.cxx @@ -295,7 +295,7 @@ SvxFontWorkDialog::SvxFontWorkDialog( SfxBindings *pBindinx, aMtrFldShadowY.SetModifyHdl( aLink ); // System-Metrik setzen - const FieldUnit eDlgUnit = rBindings.GetDispatcher()->GetModule()->GetModuleFieldUnit(); + const FieldUnit eDlgUnit = rBindings.GetDispatcher()->GetModule()->GetFieldUnit(); SetFieldUnit( aMtrFldDistance, eDlgUnit, TRUE ); SetFieldUnit( aMtrFldTextStart, eDlgUnit, TRUE ); SetFieldUnit( aMtrFldShadowX, eDlgUnit, TRUE ); @@ -605,7 +605,7 @@ void SvxFontWorkDialog::SetShadow_Impl(const XFormTextShadowItem* pItem, if ( pItem->GetValue() == XFTSHADOW_NORMAL ) { nId = TBI_SHADOW_NORMAL; - const FieldUnit eDlgUnit = rBindings.GetDispatcher()->GetModule()->GetModuleFieldUnit(); + const FieldUnit eDlgUnit = rBindings.GetDispatcher()->GetModule()->GetFieldUnit(); // aFbShadowX.SetBitmap( Bitmap( ResId(RID_SVXBMP_SHADOW_XDIST, _pMgr ) ) ); //aMtrFldShadowX.SetUnit(FUNIT_MM); @@ -888,7 +888,7 @@ IMPL_LINK( SvxFontWorkDialog, InputTimoutHdl_Impl, void *, EMPTYARG ) // System-Metrik evtl. neu setzen // Dieses sollte mal als Listener passieren, ist aber aus // inkompatibilitaetsgruenden z.Z. nicht moeglich - const FieldUnit eDlgUnit = rBindings.GetDispatcher()->GetModule()->GetModuleFieldUnit(); + const FieldUnit eDlgUnit = rBindings.GetDispatcher()->GetModule()->GetFieldUnit(); if( eDlgUnit != aMtrFldDistance.GetUnit() ) { SetFieldUnit( aMtrFldDistance, eDlgUnit, TRUE ); diff --git a/svx/source/dialog/imapdlg.cxx b/svx/source/dialog/imapdlg.cxx index f650885b5e70..2fe50c05c52c 100644 --- a/svx/source/dialog/imapdlg.cxx +++ b/svx/source/dialog/imapdlg.cxx @@ -835,7 +835,7 @@ IMPL_LINK( SvxIMapDlg, InfoHdl, IMapWindow*, pWnd ) IMPL_LINK( SvxIMapDlg, MousePosHdl, IMapWindow*, pWnd ) { String aStr; - const FieldUnit eFieldUnit = GetBindings().GetDispatcher()->GetModule()->GetModuleFieldUnit(); + const FieldUnit eFieldUnit = GetBindings().GetDispatcher()->GetModule()->GetFieldUnit(); const Point& rMousePos = pWnd->GetMousePos(); LocaleDataWrapper aLocaleWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() ); const sal_Unicode cSep = aLocaleWrapper.getNumDecimalSep().GetChar(0); @@ -858,7 +858,7 @@ IMPL_LINK( SvxIMapDlg, MousePosHdl, IMapWindow*, pWnd ) IMPL_LINK( SvxIMapDlg, GraphSizeHdl, IMapWindow*, pWnd ) { String aStr; - const FieldUnit eFieldUnit = GetBindings().GetDispatcher()->GetModule()->GetModuleFieldUnit(); + const FieldUnit eFieldUnit = GetBindings().GetDispatcher()->GetModule()->GetFieldUnit(); const Size& rSize = pWnd->GetGraphicSize(); LocaleDataWrapper aLocaleWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() ); const sal_Unicode cSep = aLocaleWrapper.getNumDecimalSep().GetChar(0); diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx index 8d11ea6d1fee..f6c48530121b 100644 --- a/svx/source/dialog/srchdlg.cxx +++ b/svx/source/dialog/srchdlg.cxx @@ -2322,7 +2322,7 @@ String& SvxSearchDialog::BuildAttrText_Impl( String& rStr, // Metrik abfragen SfxMapUnit eMapUnit = SFX_MAPUNIT_CM; - FieldUnit eFieldUnit = pSh->GetModule()->GetModuleFieldUnit(); + FieldUnit eFieldUnit = pSh->GetModule()->GetFieldUnit(); switch ( eFieldUnit ) { case FUNIT_MM: eMapUnit = SFX_MAPUNIT_MM; break; diff --git a/svx/source/engine3d/float3d.cxx b/svx/source/engine3d/float3d.cxx index a70302c4ad71..236b9e010f33 100644 --- a/svx/source/engine3d/float3d.cxx +++ b/svx/source/engine3d/float3d.cxx @@ -307,7 +307,7 @@ __EXPORT Svx3DWin::Svx3DWin( SfxBindings* pInBindings, FreeResource(); // Metrik einstellen - eFUnit = pInBindings->GetDispatcher()->GetModule()->GetModuleFieldUnit(); + eFUnit = pInBindings->GetDispatcher()->GetModule()->GetFieldUnit(); aMtrDepth.SetUnit( eFUnit ); aMtrDistance.SetUnit( eFUnit ); diff --git a/svx/source/stbctrls/pszctrl.cxx b/svx/source/stbctrls/pszctrl.cxx index 5fbd087b4835..ae4bada34b06 100644 --- a/svx/source/stbctrls/pszctrl.cxx +++ b/svx/source/stbctrls/pszctrl.cxx @@ -81,7 +81,7 @@ String SvxPosSizeStatusBarControl::GetMetricStr_Impl( long nVal ) { // Applikations-Metrik besorgen und setzen - FieldUnit eOutUnit = SfxModule::GetActiveModule()->GetModuleFieldUnit(); + FieldUnit eOutUnit = SfxModule::GetCurrentFieldUnit(); FieldUnit eInUnit = FUNIT_100TH_MM; String sMetric; diff --git a/svx/source/tbxctrls/itemwin.cxx b/svx/source/tbxctrls/itemwin.cxx index 60b273ea3fae..6c3759d6ad08 100644 --- a/svx/source/tbxctrls/itemwin.cxx +++ b/svx/source/tbxctrls/itemwin.cxx @@ -494,7 +494,7 @@ SvxMetricField::SvxMetricField( SetLast( 5000 ); SetFirst( 0 ); - eDlgUnit = SfxModule::GetActiveModule()->GetModuleFieldUnit(); + eDlgUnit = SfxModule::GetCurrentFieldUnit(); SetFieldUnit( *this, eDlgUnit, FALSE ); Show(); } @@ -579,7 +579,7 @@ void SvxMetricField::SetCoreUnit( SfxMapUnit eUnit ) void SvxMetricField::RefreshDlgUnit() { - FieldUnit eTmpUnit = SfxModule::GetActiveModule()->GetModuleFieldUnit(); + FieldUnit eTmpUnit = SfxModule::GetCurrentFieldUnit(); if ( eDlgUnit != eTmpUnit ) { eDlgUnit = eTmpUnit; |