diff options
author | Amelia Wang <amwang@novell.com> | 2010-09-13 14:37:50 +0200 |
---|---|---|
committer | Cédric Bosdonnat <cedricbosdo@openoffice.org> | 2010-09-13 15:55:47 +0200 |
commit | 258524d43e52170947e94d2af5cd36ba02f31416 (patch) | |
tree | dea059468f9b04c4f9e9d56cf6d328221bb49836 | |
parent | 72832ea6fb8fa69b3cfbbcadab8f49a803448b4e (diff) |
cjk-character-units-imp.diff: add a new unit 'character unit'
-rw-r--r-- | svx/inc/dlgutil.hxx | 1 | ||||
-rw-r--r-- | svx/source/dialog/dlgutil.cxx | 33 |
2 files changed, 34 insertions, 0 deletions
diff --git a/svx/inc/dlgutil.hxx b/svx/inc/dlgutil.hxx index 861203c2bd..3e4f736394 100644 --- a/svx/inc/dlgutil.hxx +++ b/svx/inc/dlgutil.hxx @@ -39,6 +39,7 @@ class SfxItemSet; SVX_DLLPUBLIC FieldUnit GetModuleFieldUnit( const SfxItemSet& ); +SVX_DLLPUBLIC BOOL GetApplyCharUnit( const SfxItemSet& ); #define OUTPUT_DRAWMODE_COLOR (DRAWMODE_DEFAULT) #define OUTPUT_DRAWMODE_CONTRAST (DRAWMODE_SETTINGSLINE | DRAWMODE_SETTINGSFILL | DRAWMODE_SETTINGSTEXT | DRAWMODE_SETTINGSGRADIENT) diff --git a/svx/source/dialog/dlgutil.cxx b/svx/source/dialog/dlgutil.cxx index 5fa005d0dc..884b49e899 100644 --- a/svx/source/dialog/dlgutil.cxx +++ b/svx/source/dialog/dlgutil.cxx @@ -35,6 +35,9 @@ #include <sfx2/sfxsids.hrc> #include <sfx2/module.hxx> #include <svl/intitem.hxx> +#include <svl/eitem.hxx> +#include <sfx2/viewfrm.hxx> +#include <sfx2/objsh.hxx> // ----------------------------------------------------------------------- @@ -53,3 +56,33 @@ FieldUnit GetModuleFieldUnit( const SfxItemSet& rSet ) return eUnit; } +BOOL GetApplyCharUnit( const SfxItemSet& rSet ) +{ + BOOL bUseCharUnit = FALSE; + const SfxPoolItem* pItem = NULL; + if ( SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_APPLYCHARUNIT, FALSE, &pItem ) ) + bUseCharUnit = (BOOL)( (const SfxBoolItem*)pItem )->GetValue(); + else + { + // FIXME - this might be wrong, cf. the DEV300 changes in GetModuleFieldUnit() + SfxViewFrame* pFrame = SfxViewFrame::Current(); + SfxObjectShell* pSh = NULL; + if ( pFrame ) + pSh = pFrame->GetObjectShell(); + if ( pSh ) // #93209# the object shell is not always available during reload + { + SfxModule* pModule = pSh->GetModule(); + if ( pModule ) + { + pItem = pModule->GetItem( SID_ATTR_APPLYCHARUNIT ); + if ( pItem ) + bUseCharUnit = (BOOL)( (SfxBoolItem*)pItem )->GetValue(); + } + else + { + DBG_ERRORFILE( "GetApplyCharUnit(): no module found" ); + } + } + } + return bUseCharUnit; +} |