LibreOffice Module sw (master) 1
Functions
SwLangHelper Namespace Reference

Functions

void GetLanguageStatus (OutlinerView *pOLV, SfxItemSet &rSet)
 
bool SetLanguageStatus (OutlinerView *pOLV, SfxRequest &rReq, SwView const &rView, SwWrtShell &rSh)
 
void SetLanguage (SwWrtShell &rWrtSh, std::u16string_view rLangText, bool bIsForSelection, SfxItemSet &rCoreSet)
 
void SetLanguage (SwWrtShell &rWrtSh, OutlinerView const *pOLV, const ESelection &rSelection, std::u16string_view rLangText, bool bIsForSelection, SfxItemSet &rCoreSet)
 
void SetLanguage_None (SwWrtShell &rWrtSh, bool bIsForSelection, SfxItemSet &rCoreSet)
 
void SetLanguage_None (SwWrtShell &rWrtSh, OutlinerView const *pOLV, const ESelection &rSelection, bool bIsForSelection, SfxItemSet &rCoreSet)
 
void ResetLanguages (SwWrtShell &rWrtSh, OutlinerView const *pOLV=nullptr)
 
void SelectCurrentPara (SwWrtShell &rWrtSh)
 
void SelectPara (EditView &rEditView, const ESelection &rCurSel)
 
OUString GetTextForLanguageGuessing (EditEngine const *rEditEngine, const ESelection &rDocSelection)
 
OUString GetTextForLanguageGuessing (SwWrtShell const &rSh)
 
LanguageType GetLanguage (SfxItemSet const &aSet, sal_uInt16 nLangWhichId)
 
LanguageType GetLanguage (SwWrtShell &rSh, sal_uInt16 nLangWhichId)
 
LanguageType GetCurrentLanguage (SfxItemSet const &aSet, SvtScriptType nScriptType)
 
LanguageType GetCurrentLanguage (SwWrtShell &rSh)
 

Function Documentation

◆ GetCurrentLanguage() [1/2]

LanguageType SwLangHelper::GetCurrentLanguage ( SfxItemSet const &  aSet,
SvtScriptType  nScriptType 
)
Returns
: the language in use for the selected text. '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.

Definition at line 444 of file langhelper.cxx.

References aScriptType, EE_CHAR_LANGUAGE(), EE_CHAR_LANGUAGE_CJK(), EE_CHAR_LANGUAGE_CTL(), GetLanguage(), LANGUAGE_DONTKNOW, LANGUAGE_NONE, and LANGUAGE_SYSTEM.

Referenced by GetLanguageStatus(), and SwTextShell::GetState().

◆ GetCurrentLanguage() [2/2]

LanguageType SwLangHelper::GetCurrentLanguage ( SwWrtShell rSh)
Returns
: the language in use for the selected text. '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.

Definition at line 396 of file langhelper.cxx.

References aScriptType, GetLanguage(), SwEditShell::GetScriptType(), LANGUAGE_DONTKNOW, LANGUAGE_NONE, LANGUAGE_SYSTEM, RES_CHRATR_CJK_LANGUAGE(), RES_CHRATR_CTL_LANGUAGE(), and RES_CHRATR_LANGUAGE().

◆ GetLanguage() [1/2]

LanguageType SwLangHelper::GetLanguage ( SfxItemSet const &  aSet,
sal_uInt16  nLangWhichId 
)

◆ GetLanguage() [2/2]

LanguageType SwLangHelper::GetLanguage ( SwWrtShell rSh,
sal_uInt16  nLangWhichId 
)
Returns
: the language for the selected text that is set for the specified attribute (script type). If there are more than one languages used LANGUAGE_DONTKNOW will be returned.
Parameters
nLangWhichId: one of RES_CHRATR_LANGUAGE, RES_CHRATR_CJK_LANGUAGE, RES_CHRATR_CTL_LANGUAGE,

Definition at line 357 of file langhelper.cxx.

References SwViewShell::GetAttrPool(), SwEditShell::GetCurAttr(), and GetLanguage().

◆ GetLanguageStatus()

void SwLangHelper::GetLanguageStatus ( OutlinerView pOLV,
SfxItemSet rSet 
)

◆ GetTextForLanguageGuessing() [1/2]

OUString SwLangHelper::GetTextForLanguageGuessing ( EditEngine const *  rEditEngine,
const ESelection rDocSelection 
)

Definition at line 510 of file langhelper.cxx.

References EditEngine::GetText(), and ESelection::nEndPos.

Referenced by GetLanguageStatus(), and SwTextShell::GetState().

◆ GetTextForLanguageGuessing() [2/2]

OUString SwLangHelper::GetTextForLanguageGuessing ( SwWrtShell const &  rSh)

◆ ResetLanguages()

void SwLangHelper::ResetLanguages ( SwWrtShell rWrtSh,
OutlinerView const *  pOLV = nullptr 
)

◆ SelectCurrentPara()

void SwLangHelper::SelectCurrentPara ( SwWrtShell rWrtSh)

◆ SelectPara()

void SwLangHelper::SelectPara ( EditView rEditView,
const ESelection rCurSel 
)

◆ SetLanguage() [1/2]

void SwLangHelper::SetLanguage ( SwWrtShell rWrtSh,
OutlinerView const *  pOLV,
const ESelection rSelection,
std::u16string_view  rLangText,
bool  bIsForSelection,
SfxItemSet rCoreSet 
)

◆ SetLanguage() [2/2]

void SwLangHelper::SetLanguage ( SwWrtShell rWrtSh,
std::u16string_view  rLangText,
bool  bIsForSelection,
SfxItemSet rCoreSet 
)

◆ SetLanguage_None() [1/2]

void SwLangHelper::SetLanguage_None ( SwWrtShell rWrtSh,
bool  bIsForSelection,
SfxItemSet rCoreSet 
)

Definition at line 258 of file langhelper.cxx.

References SetLanguage_None().

Referenced by SwTextShell::Execute(), SetLanguage_None(), and SetLanguageStatus().

◆ SetLanguage_None() [2/2]

void SwLangHelper::SetLanguage_None ( SwWrtShell rWrtSh,
OutlinerView const *  pOLV,
const ESelection rSelection,
bool  bIsForSelection,
SfxItemSet rCoreSet 
)

◆ SetLanguageStatus()

bool SwLangHelper::SetLanguageStatus ( OutlinerView pOLV,
SfxRequest rReq,
SwView const &  rView,
SwWrtShell rSh 
)