diff options
Diffstat (limited to 'sw/source/ui/shells/langhelper.cxx')
-rwxr-xr-x[-rw-r--r--] | sw/source/ui/shells/langhelper.cxx | 44 |
1 files changed, 21 insertions, 23 deletions
diff --git a/sw/source/ui/shells/langhelper.cxx b/sw/source/ui/shells/langhelper.cxx index 37d5e1ed5d69..6f00f198e33f 100644..100755 --- a/sw/source/ui/shells/langhelper.cxx +++ b/sw/source/ui/shells/langhelper.cxx @@ -67,14 +67,14 @@ using namespace ::com::sun::star; namespace SwLangHelper { - USHORT GetLanguageStatus( OutlinerView* pOLV, SfxItemSet& rSet ) + sal_uInt16 GetLanguageStatus( OutlinerView* pOLV, SfxItemSet& rSet ) { ESelection aSelection = pOLV->GetSelection(); EditView& rEditView=pOLV->GetEditView(); EditEngine* pEditEngine=rEditView.GetEditEngine(); // the value of used script types - const USHORT nScriptType =pOLV->GetSelectedScriptType(); + const sal_uInt16 nScriptType =pOLV->GetSelectedScriptType(); String aScriptTypesInUse( String::CreateFromInt32( nScriptType ) );//pEditEngine->GetScriptType(aSelection) SvtLanguageTable aLangTable; @@ -185,7 +185,7 @@ namespace SwLangHelper if (!bForSelection) // document language to be changed... { rSh.StartAction(); - rSh.LockView( TRUE ); + rSh.LockView( sal_True ); rSh.Push(); // prepare to apply new language to all text in document @@ -205,7 +205,7 @@ namespace SwLangHelper if (bForSelection) { const SwViewOption* pVOpt = rView.GetWrtShellPtr()->GetViewOptions(); - ULONG nCntrl = pEditEngine->GetControlWord(); + sal_uLong nCntrl = pEditEngine->GetControlWord(); // turn off if (!pVOpt->IsOnlineSpell()) nCntrl &= ~EE_CNTRL_ONLINESPELLING; @@ -227,8 +227,8 @@ namespace SwLangHelper if (!bForSelection) { // need to release view and restore selection... - rSh.Pop( FALSE ); - rSh.LockView( FALSE ); + rSh.Pop( sal_False ); + rSh.LockView( sal_False ); rSh.EndAction(); } } @@ -252,13 +252,13 @@ namespace SwLangHelper const LanguageType nLang = SvtLanguageTable().GetType( rLangText ); if (nLang != LANGUAGE_DONTKNOW) { - USHORT nScriptType = SvtLanguageOptions::GetScriptTypeOfLanguage( nLang ); + sal_uInt16 nScriptType = SvtLanguageOptions::GetScriptTypeOfLanguage( nLang ); EditEngine* pEditEngine = pOLV ? pOLV->GetEditView().GetEditEngine() : NULL; DBG_ASSERT( !pOLV || pEditEngine, "OutlinerView without EditEngine???" ); //get ScriptType - USHORT nLangWhichId = 0; + sal_uInt16 nLangWhichId = 0; bool bIsSingleScriptType = true; switch (nScriptType) { @@ -300,11 +300,9 @@ namespace SwLangHelper } rWrtSh.SetDefault( SvxLanguageItem( nLang, nLangWhichId ) ); - // set respective language attribute in text document to default + // #i102191: hard set respective language attribute in text document // (for all text in the document - which should be selected by now...) - SvUShortsSort aAttribs; - aAttribs.Insert( nLangWhichId ); - rWrtSh.ResetAttr( &aAttribs ); + rWrtSh.SetAttr( SvxLanguageItem( nLang, nLangWhichId ) ); } } } @@ -318,7 +316,7 @@ namespace SwLangHelper void SetLanguage_None( SwWrtShell &rWrtSh, OutlinerView* pOLV, ESelection aSelection, bool bIsForSelection, SfxItemSet &rCoreSet ) { // EditEngine IDs - const USHORT aLangWhichId_EE[3] = + const sal_uInt16 aLangWhichId_EE[3] = { EE_CHAR_LANGUAGE, EE_CHAR_LANGUAGE_CJK, @@ -326,7 +324,7 @@ namespace SwLangHelper }; // Writewr IDs - const USHORT aLangWhichId_Writer[3] = + const sal_uInt16 aLangWhichId_Writer[3] = { RES_CHRATR_LANGUAGE, RES_CHRATR_CJK_LANGUAGE, @@ -408,7 +406,7 @@ namespace SwLangHelper /// If there are more than one languages used LANGUAGE_DONTKNOW will be returned. /// @param nLangWhichId : one of /// RES_CHRATR_LANGUAGE, RES_CHRATR_CJK_LANGUAGE, RES_CHRATR_CTL_LANGUAGE, - LanguageType GetLanguage( SwWrtShell &rSh, USHORT nLangWhichId ) + LanguageType GetLanguage( SwWrtShell &rSh, sal_uInt16 nLangWhichId ) { SfxItemSet aSet( rSh.GetAttrPool(), nLangWhichId, nLangWhichId ); rSh.GetCurAttr( aSet ); @@ -416,13 +414,13 @@ namespace SwLangHelper return GetLanguage(aSet,nLangWhichId); } - LanguageType GetLanguage( SfxItemSet aSet, USHORT nLangWhichId ) + LanguageType GetLanguage( SfxItemSet aSet, sal_uInt16 nLangWhichId ) { LanguageType nLang = LANGUAGE_SYSTEM; const SfxPoolItem *pItem = 0; - SfxItemState nState = aSet.GetItemState( nLangWhichId, TRUE, &pItem ); + SfxItemState nState = aSet.GetItemState( nLangWhichId, sal_True, &pItem ); if (nState > SFX_ITEM_DEFAULT && pItem) { // the item is set and can be used @@ -450,10 +448,10 @@ namespace SwLangHelper LanguageType GetCurrentLanguage( SwWrtShell &rSh ) { // get all script types used in current selection - const USHORT nScriptType = rSh.GetScriptType(); + const sal_uInt16 nScriptType = rSh.GetScriptType(); //set language attribute to use according to the script type - USHORT nLangWhichId = 0; + sal_uInt16 nLangWhichId = 0; bool bIsSingleScriptType = true; switch (nScriptType) { @@ -472,7 +470,7 @@ namespace SwLangHelper // check if all script types are set to LANGUAGE_NONE and return // that if this is the case. Otherwise, having multiple script types // in use always means there are several languages in use... - const USHORT aScriptTypes[3] = + const sal_uInt16 aScriptTypes[3] = { RES_CHRATR_LANGUAGE, RES_CHRATR_CJK_LANGUAGE, @@ -498,10 +496,10 @@ namespace SwLangHelper /// 'In use' means the language(s) matching the script type(s) of the /// selected text. Or in other words, the language a spell checker would use. /// If there is more than one language LANGUAGE_DONTKNOW will be returned. - LanguageType GetCurrentLanguage( SfxItemSet aSet, USHORT nScriptType ) + LanguageType GetCurrentLanguage( SfxItemSet aSet, sal_uInt16 nScriptType ) { //set language attribute to use according to the script type - USHORT nLangWhichId = 0; + sal_uInt16 nLangWhichId = 0; bool bIsSingleScriptType = true; switch (nScriptType) { @@ -520,7 +518,7 @@ namespace SwLangHelper // check if all script types are set to LANGUAGE_NONE and return // that if this is the case. Otherwise, having multiple script types // in use always means there are several languages in use... - const USHORT aScriptTypes[3] = + const sal_uInt16 aScriptTypes[3] = { EE_CHAR_LANGUAGE, EE_CHAR_LANGUAGE_CJK, |