diff options
author | Frank Schoenheit [fs] <frank.schoenheit@oracle.com> | 2011-03-03 15:22:23 +0100 |
---|---|---|
committer | Frank Schoenheit [fs] <frank.schoenheit@oracle.com> | 2011-03-03 15:22:23 +0100 |
commit | a6752da41c7c71a5100c73df055ce76cd2adaa8d (patch) | |
tree | 67421dee5ae452d9fa371878fa3a72eb2c9dd306 /sfx2/inc | |
parent | 0b0874b5aa1982b0503877fe46690fa3e025b931 (diff) |
debuglevels: introduce SfxModule::GetModuleFieldUnit, taking an XFrame, to not rely on SfxObjectShell::Current, which is implicitly used by SfxModule::GetCurrentFieldUnit, and might (like all this static crap) fail unforseeably. Use this new method in the Metric Field (to be used in toolbars) and the Pos/Size status bar control. Finally, this prevents a sporadic assertion during the smoketest, where GetCurrentFieldUnit fails for whatever reasons
Diffstat (limited to 'sfx2/inc')
-rw-r--r-- | sfx2/inc/sfx2/module.hxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sfx2/inc/sfx2/module.hxx b/sfx2/inc/sfx2/module.hxx index c2750990bd..ee18fff5d0 100644 --- a/sfx2/inc/sfx2/module.hxx +++ b/sfx2/inc/sfx2/module.hxx @@ -34,6 +34,7 @@ #include <sfx2/imgdef.hxx> #include <sal/types.h> #include <tools/fldunit.hxx> +#include <com/sun/star/uno/Reference.hxx> class ImageList; @@ -56,6 +57,9 @@ class SfxStbCtrlFactArr_Impl; class SfxTabPage; class Window; +namespace com { namespace sun { namespace star { namespace frame { + class XFrame; +} } } } //==================================================================== class SFX2_DLLPUBLIC SfxModule : public SfxShell @@ -97,6 +101,14 @@ public: static SfxModule* GetActiveModule( SfxViewFrame* pFrame=NULL ); static FieldUnit GetCurrentFieldUnit(); + /** retrieves the field unit of the module belonging to the document displayed in the given frame + + Effectively, this method looks up the SfxViewFrame belonging to the given XFrame, then the SfxModule belonging to + the document in this frame, then this module's field unit. + + Failures in any of those steps are reported as assertion in non-product builds, and then FUNIT_100TH_MM is returned. + */ + static FieldUnit GetModuleFieldUnit( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > const & i_frame ); FieldUnit GetFieldUnit() const; //#if 0 // _SOLAR__PRIVATE |