diff options
author | Ivo Hinkelmann <ihi@openoffice.org> | 2007-11-23 15:27:41 +0000 |
---|---|---|
committer | Ivo Hinkelmann <ihi@openoffice.org> | 2007-11-23 15:27:41 +0000 |
commit | 7e4f03d70967c4ccb9f0b1b3b3a7768c0dab263f (patch) | |
tree | dddcc2277f993560c5b78c3ad6e85eba62ee844b /sw/source/ui/uiview/view2.cxx | |
parent | 53b60a751c1822e15419e85cd72604cfd5745076 (diff) |
INTEGRATION: CWS langstatusbar (1.78.22); FILE MERGED
2007/10/25 14:54:05 tl 1.78.22.1: #i77208# new language status-bar control
Diffstat (limited to 'sw/source/ui/uiview/view2.cxx')
-rw-r--r-- | sw/source/ui/uiview/view2.cxx | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/sw/source/ui/uiview/view2.cxx b/sw/source/ui/uiview/view2.cxx index 333dd178d75b..d5f96b22970d 100644 --- a/sw/source/ui/uiview/view2.cxx +++ b/sw/source/ui/uiview/view2.cxx @@ -4,9 +4,9 @@ * * $RCSfile: view2.cxx,v $ * - * $Revision: 1.79 $ + * $Revision: 1.80 $ * - * last change: $Author: ihi $ $Date: 2007-11-22 15:41:37 $ + * last change: $Author: ihi $ $Date: 2007-11-23 16:27:41 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -365,6 +365,31 @@ using namespace ::com::sun::star::beans; using namespace ::com::sun::star::container; using namespace ::com::sun::star::ui::dialogs; + +static void lcl_SetAllTextToDefaultLanguage( SwWrtShell &rWrtSh, USHORT nWhichId ) +{ + if (nWhichId == RES_CHRATR_LANGUAGE || + nWhichId == RES_CHRATR_CJK_LANGUAGE || + nWhichId == RES_CHRATR_CTL_LANGUAGE) + { + rWrtSh.StartAction(); + rWrtSh.LockView( TRUE ); + rWrtSh.Push(); + + // prepare to apply new language to all text in document + rWrtSh.SelAll(); + + // set language attribute to default for all text + SvUShortsSort aAttribs; + aAttribs.Insert( nWhichId ); + rWrtSh.ResetAttr( &aAttribs ); + + rWrtSh.Pop( FALSE ); + rWrtSh.LockView( FALSE ); + rWrtSh.EndAction(); + } +} + /*--------------------------------------------------------------------------- Beschreibung: String fuer die Seitenanzeige in der Statusbar basteln. ----------------------------------------------------------------------------*/ @@ -1093,18 +1118,21 @@ void __EXPORT SwView::Execute(SfxRequest &rReq) { SvxLanguageItem aLang(((SvxLanguageItem*)pItem)->GetLanguage(), RES_CHRATR_LANGUAGE); pWrtShell->SetDefault( aLang ); + lcl_SetAllTextToDefaultLanguage( *pWrtShell, RES_CHRATR_LANGUAGE ); } break; case SID_ATTR_CHAR_CTL_LANGUAGE: if(pArgs && SFX_ITEM_SET == pArgs->GetItemState(RES_CHRATR_CTL_LANGUAGE, FALSE, &pItem)) { pWrtShell->SetDefault( *pItem ); + lcl_SetAllTextToDefaultLanguage( *pWrtShell, RES_CHRATR_CTL_LANGUAGE ); } break; case SID_ATTR_CHAR_CJK_LANGUAGE: if(pArgs && SFX_ITEM_SET == pArgs->GetItemState(RES_CHRATR_CJK_LANGUAGE, FALSE, &pItem)) { pWrtShell->SetDefault( *pItem ); + lcl_SetAllTextToDefaultLanguage( *pWrtShell, RES_CHRATR_CJK_LANGUAGE ); } break; case FN_SCROLL_NEXT_PREV: |