LibreOffice Module sw (master) 1
langhelper.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <string.h>
21
22#include <wrtsh.hxx>
23#include <doc.hxx>
24#include <docary.hxx>
25#include <charfmt.hxx>
26
27#include <sfx2/bindings.hxx>
28#include <sfx2/request.hxx>
29#include <sfx2/sfxdlg.hxx>
30#include <sfx2/viewfrm.hxx>
31#include <editeng/eeitem.hxx>
32#include <editeng/editeng.hxx>
33#include <editeng/editdata.hxx>
34#include <editeng/outliner.hxx>
35#include <editeng/editview.hxx>
36#include <editeng/langitem.hxx>
37
39#include <svtools/langtab.hxx>
40#include <svl/slstitm.hxx>
41#include <svl/stritem.hxx>
42#include <svx/svxids.hrc>
43#include <osl/diagnose.h>
44
45#include <ndtxt.hxx>
46#include <pam.hxx>
47#include <view.hxx>
48#include <viewopt.hxx>
49
50#include <langhelper.hxx>
51
52using namespace ::com::sun::star;
53
54namespace SwLangHelper
55{
56
58 {
59 ESelection aSelection = pOLV->GetSelection();
60 EditView& rEditView=pOLV->GetEditView();
61 EditEngine* pEditEngine=rEditView.GetEditEngine();
62
63 // the value of used script types
64 const SvtScriptType nScriptType =pOLV->GetSelectedScriptType();
65 OUString aScriptTypesInUse( OUString::number( static_cast<int>(nScriptType) ) );//pEditEngine->GetScriptType(aSelection)
66
67 // get keyboard language
68 OUString aKeyboardLang;
72
73 // get the language that is in use
74 OUString aCurrentLang("*");
75 SfxItemSet aSet(pOLV->GetAttribs());
76 nLang = SwLangHelper::GetCurrentLanguage( aSet,nScriptType );
79
80 // build sequence for status value
81 uno::Sequence< OUString > aSeq{ aCurrentLang,
82 aScriptTypesInUse,
83 aKeyboardLang,
85 aSelection ) };
86
87 // set sequence as status value
88 SfxStringListItem aItem( SID_LANGUAGE_STATUS );
89 aItem.SetStringList( aSeq );
90 rSet.Put( aItem );
91 }
92
93 bool SetLanguageStatus( OutlinerView* pOLV, SfxRequest &rReq, SwView const &rView, SwWrtShell &rSh )
94 {
95 bool bRestoreSelection = false;
96 ESelection aSelection = pOLV->GetSelection();
97 EditView & rEditView = pOLV->GetEditView();
98 SfxItemSet aEditAttr(rEditView.GetEmptyItemSet());
99
100 // get the language
101 OUString aNewLangText;
102
103 const SfxStringItem* pItem = rReq.GetArg<SfxStringItem>(SID_LANGUAGE_STATUS);
104 if (pItem)
105 aNewLangText = pItem->GetValue();
106
110 SfxViewFrame& rViewFrame = rView.GetViewFrame();
111
112 if (aNewLangText == "*" )
113 {
114 // open the dialog "Tools/Options/Language Settings - Language"
116 ScopedVclPtr<VclAbstractDialog> pDlg(pFact->CreateVclDialog( rView.GetFrameWeld(), SID_LANGUAGE_OPTIONS ));
117 pDlg->Execute();
118 }
119 else
120 {
121 // setting the new language...
122 if (!aNewLangText.isEmpty())
123 {
124 static constexpr OUStringLiteral aSelectionLangPrefix(u"Current_");
125 static constexpr OUStringLiteral aParagraphLangPrefix(u"Paragraph_");
126 static constexpr OUStringLiteral aDocumentLangPrefix(u"Default_");
127
128 sal_Int32 nPos = 0;
129 bool bForSelection = true;
130 bool bForParagraph = false;
131 if (-1 != (nPos = aNewLangText.indexOf( aSelectionLangPrefix )))
132 {
133 // ... for the current selection
134 aNewLangText = aNewLangText.replaceAt(nPos, aSelectionLangPrefix.getLength(), u"");
135 bForSelection = true;
136 }
137 else if (-1 != (nPos = aNewLangText.indexOf( aParagraphLangPrefix )))
138 {
139 // ... for the current paragraph language
140 aNewLangText = aNewLangText.replaceAt(nPos, aParagraphLangPrefix.getLength(), u"");
141 bForSelection = true;
142 bForParagraph = true;
143 }
144 else if (-1 != (nPos = aNewLangText.indexOf( aDocumentLangPrefix )))
145 {
146 // ... as default document language
147 aNewLangText = aNewLangText.replaceAt(nPos, aDocumentLangPrefix.getLength(), u"");
148 bForSelection = false;
149 }
150
151 if (bForParagraph)
152 {
153 bRestoreSelection = true;
154 SwLangHelper::SelectPara( rEditView, aSelection );
155 aSelection = pOLV->GetSelection();
156 }
157 if (!bForSelection) // document language to be changed...
158 {
159 rSh.StartAction();
160 rSh.LockView( true );
161 rSh.Push();
162
163 // prepare to apply new language to all text in document
164 rSh.SelAll();
165 rSh.ExtendedSelectAll();
166 }
167
168 if (aNewLangText == "LANGUAGE_NONE")
169 SwLangHelper::SetLanguage_None( rSh, pOLV, aSelection, bForSelection, aEditAttr );
170 else if (aNewLangText == "RESET_LANGUAGES")
171 SwLangHelper::ResetLanguages( rSh, pOLV );
172 else
173 SwLangHelper::SetLanguage( rSh, pOLV, aSelection, aNewLangText, bForSelection, aEditAttr );
174
175 if (!bForSelection)
176 {
177 // need to release view and restore selection...
179 rSh.LockView( false );
180 rSh.EndAction();
181 }
182 }
183 }
184
185 // invalidate slot to get the new language displayed
186 rViewFrame.GetBindings().Invalidate( rReq.GetSlot() );
187
188 rReq.Done();
189 return bRestoreSelection;
190 }
191
192 void SetLanguage( SwWrtShell &rWrtSh, std::u16string_view rLangText, bool bIsForSelection, SfxItemSet &rCoreSet )
193 {
194 SetLanguage( rWrtSh, nullptr , ESelection(), rLangText, bIsForSelection, rCoreSet );
195 }
196
197 void SetLanguage( SwWrtShell &rWrtSh, OutlinerView const * pOLV, const ESelection& rSelection, std::u16string_view rLangText, bool bIsForSelection, SfxItemSet &rCoreSet )
198 {
201 return;
202
203 EditEngine* pEditEngine = pOLV ? pOLV->GetEditView().GetEditEngine() : nullptr;
204 OSL_ENSURE( !pOLV || pEditEngine, "OutlinerView without EditEngine???" );
205
206 //get ScriptType
207 sal_uInt16 nLangWhichId = 0;
208 bool bIsSingleScriptType = true;
210 {
211 case SvtScriptType::LATIN : nLangWhichId = pEditEngine ? sal_uInt16(EE_CHAR_LANGUAGE) : sal_uInt16(RES_CHRATR_LANGUAGE); break;
212 case SvtScriptType::ASIAN : nLangWhichId = pEditEngine ? sal_uInt16(EE_CHAR_LANGUAGE_CJK) : sal_uInt16(RES_CHRATR_CJK_LANGUAGE); break;
213 case SvtScriptType::COMPLEX : nLangWhichId = pEditEngine ? sal_uInt16(EE_CHAR_LANGUAGE_CTL) : sal_uInt16(RES_CHRATR_CTL_LANGUAGE); break;
214 default:
215 bIsSingleScriptType = false;
216 OSL_FAIL("unexpected case" );
217 }
218 if (!bIsSingleScriptType)
219 return;
220
221 // change language for selection or paragraph
222 // (for paragraph is handled by previously having set the selection to the
223 // whole paragraph)
224 if (bIsForSelection)
225 {
226 // apply language to current selection
227 if (pEditEngine)
228 {
229 rCoreSet.Put( SvxLanguageItem( nLang, nLangWhichId ));
230 pEditEngine->QuickSetAttribs(rCoreSet, rSelection);
231 }
232 else
233 {
234 rWrtSh.GetCurAttr( rCoreSet );
235 rCoreSet.Put( SvxLanguageItem( nLang, nLangWhichId ));
236 rWrtSh.SetAttrSet( rCoreSet );
237 }
238 }
239 else // change language for all text
240 {
241 // set document default language
242 switch (nLangWhichId)
243 {
244 case EE_CHAR_LANGUAGE : nLangWhichId = RES_CHRATR_LANGUAGE; break;
245 case EE_CHAR_LANGUAGE_CJK : nLangWhichId = RES_CHRATR_CJK_LANGUAGE; break;
246 case EE_CHAR_LANGUAGE_CTL : nLangWhichId = RES_CHRATR_CTL_LANGUAGE; break;
247 }
248 //Set the default document language
249 rWrtSh.SetDefault( SvxLanguageItem( nLang, nLangWhichId ) );
250 rWrtSh.GetDoc()->GetDocShell()->Broadcast(SfxHint(SfxHintId::LanguageChanged));
251
252 // #i102191: hard set respective language attribute in text document
253 // (for all text in the document - which should be selected by now...)
254 rWrtSh.SetAttrItem( SvxLanguageItem( nLang, nLangWhichId ) );
255 }
256 }
257
258 void SetLanguage_None( SwWrtShell &rWrtSh, bool bIsForSelection, SfxItemSet &rCoreSet )
259 {
260 SetLanguage_None( rWrtSh,nullptr,ESelection(),bIsForSelection,rCoreSet );
261 }
262
263 void SetLanguage_None( SwWrtShell &rWrtSh, OutlinerView const * pOLV, const ESelection& rSelection, bool bIsForSelection, SfxItemSet &rCoreSet )
264 {
265 // EditEngine IDs
266 const sal_uInt16 aLangWhichId_EE[3] =
267 {
271 };
272
273 // Writer IDs
274 const sal_uInt16 aLangWhichId_Writer[3] =
275 {
279 };
280
281 if (bIsForSelection)
282 {
283 // change language for selection or paragraph
284 // (for paragraph is handled by previously having set the selection to the
285 // whole paragraph)
286
287 EditEngine* pEditEngine = pOLV ? pOLV->GetEditView().GetEditEngine() : nullptr;
288 OSL_ENSURE( !pOLV || pEditEngine, "OutlinerView without EditEngine???" );
289 if (pEditEngine)
290 {
291 for (sal_uInt16 i : aLangWhichId_EE)
292 rCoreSet.Put( SvxLanguageItem( LANGUAGE_NONE, i ));
293 pEditEngine->QuickSetAttribs(rCoreSet, rSelection);
294 }
295 else
296 {
297 rWrtSh.GetCurAttr( rCoreSet );
298 for (sal_uInt16 i : aLangWhichId_Writer)
299 rCoreSet.Put( SvxLanguageItem( LANGUAGE_NONE, i ));
300 rWrtSh.SetAttrSet( rCoreSet );
301 }
302 }
303 else // change language for all text
304 {
306 for (sal_uInt16 i : aLangWhichId_Writer)
307 {
309 aAttribs.insert( i );
310 }
311 rWrtSh.GetDoc()->GetDocShell()->Broadcast(SfxHint(SfxHintId::LanguageChanged));
312
313 // set all language attributes to default
314 // (for all text in the document - which should be selected by now...)
315 rWrtSh.ResetAttr( aAttribs );
316 }
317 }
318
319 void ResetLanguages( SwWrtShell &rWrtSh, OutlinerView const * pOLV )
320 {
321 // reset language for current selection.
322 // The selection should already have been expanded to the whole paragraph or
323 // to all text in the document if those are the ranges where to reset
324 // the language attributes
325
326 if (pOLV)
327 {
328 EditView &rEditView = pOLV->GetEditView();
329 rEditView.RemoveAttribs( true, EE_CHAR_LANGUAGE );
330 rEditView.RemoveAttribs( true, EE_CHAR_LANGUAGE_CJK );
331 rEditView.RemoveAttribs( true, EE_CHAR_LANGUAGE_CTL );
332
333 // ugly hack, as it seems that EditView/EditEngine does not update their spellchecking marks
334 // when setting a new language attribute
335 EditEngine* pEditEngine = rEditView.GetEditEngine();
336 EEControlBits nCntrl = pEditEngine->GetControlWord();
337 // turn off
338 pEditEngine->SetControlWord(nCntrl & ~EEControlBits::ONLINESPELLING);
339 //turn back on
340 pEditEngine->SetControlWord(nCntrl);
341 pEditEngine->CompleteOnlineSpelling();
342
343 rEditView.Invalidate();
344 }
345 else
346 {
347 rWrtSh.ResetAttr(
349 }
350 }
351
357 LanguageType GetLanguage( SwWrtShell &rSh, sal_uInt16 nLangWhichId )
358 {
359 SfxItemSet aSet( rSh.GetAttrPool(), nLangWhichId, nLangWhichId );
360 rSh.GetCurAttr( aSet );
361
362 return GetLanguage(aSet,nLangWhichId);
363 }
364
365 LanguageType GetLanguage( SfxItemSet const & aSet, sal_uInt16 nLangWhichId )
366 {
367
369
370 const SfxPoolItem *pItem = nullptr;
371 SfxItemState nState = aSet.GetItemState( nLangWhichId, true, &pItem );
372 if (nState > SfxItemState::DEFAULT && pItem)
373 {
374 // the item is set and can be used
375 nLang = dynamic_cast<const SvxLanguageItem&>(*pItem).GetLanguage();
376 }
377 else if (nState == SfxItemState::DEFAULT)
378 {
379 // since the attribute is not set: retrieve the default value
380 nLang = dynamic_cast<const SvxLanguageItem&>(aSet.GetPool()->GetDefaultItem( nLangWhichId )).GetLanguage();
381 }
382 else if (nState == SfxItemState::DONTCARE)
383 {
384 // there is more than one language...
386 }
387 OSL_ENSURE( nLang != LANGUAGE_SYSTEM, "failed to get the language?" );
388
389 return nLang;
390 }
391
397 {
398 //set language attribute to use according to the script type
399 sal_uInt16 nLangWhichId = 0;
400 bool bIsSingleScriptType = true;
401 switch (rSh.GetScriptType())
402 {
403 case SvtScriptType::LATIN : nLangWhichId = RES_CHRATR_LANGUAGE; break;
404 case SvtScriptType::ASIAN : nLangWhichId = RES_CHRATR_CJK_LANGUAGE; break;
405 case SvtScriptType::COMPLEX : nLangWhichId = RES_CHRATR_CTL_LANGUAGE; break;
406 default: bIsSingleScriptType = false; break;
407 }
408
409 // get language according to the script type(s) in use
410 LanguageType nCurrentLang = LANGUAGE_SYSTEM;
411 if (bIsSingleScriptType)
412 nCurrentLang = GetLanguage( rSh, nLangWhichId );
413 else
414 {
415 // check if all script types are set to LANGUAGE_NONE and return
416 // that if this is the case. Otherwise, having multiple script types
417 // in use always means there are several languages in use...
418 const sal_uInt16 aScriptTypes[3] =
419 {
423 };
424 nCurrentLang = LANGUAGE_NONE;
425 for (sal_uInt16 aScriptType : aScriptTypes)
426 {
427 LanguageType nTmpLang = GetLanguage( rSh, aScriptType );
428 if (nTmpLang != LANGUAGE_NONE)
429 {
430 nCurrentLang = LANGUAGE_DONTKNOW;
431 break;
432 }
433 }
434 }
435 OSL_ENSURE( nCurrentLang != LANGUAGE_SYSTEM, "failed to get the language?" );
436
437 return nCurrentLang;
438 }
439
445 {
446 //set language attribute to use according to the script type
447 sal_uInt16 nLangWhichId = 0;
448 bool bIsSingleScriptType = true;
449 switch (nScriptType)
450 {
451 case SvtScriptType::LATIN : nLangWhichId = EE_CHAR_LANGUAGE; break;
452 case SvtScriptType::ASIAN : nLangWhichId = EE_CHAR_LANGUAGE_CJK; break;
453 case SvtScriptType::COMPLEX : nLangWhichId = EE_CHAR_LANGUAGE_CTL; break;
454 default: bIsSingleScriptType = false;
455 }
456
457 // get language according to the script type(s) in use
458 LanguageType nCurrentLang = LANGUAGE_SYSTEM;
459 if (bIsSingleScriptType)
460 nCurrentLang = GetLanguage( aSet, nLangWhichId );
461 else
462 {
463 // check if all script types are set to LANGUAGE_NONE and return
464 // that if this is the case. Otherwise, having multiple script types
465 // in use always means there are several languages in use...
466 const sal_uInt16 aScriptTypes[3] =
467 {
471 };
472 nCurrentLang = LANGUAGE_NONE;
473 for (sal_uInt16 aScriptType : aScriptTypes)
474 {
475 LanguageType nTmpLang = GetLanguage( aSet, aScriptType );
476 if (nTmpLang != LANGUAGE_NONE)
477 {
478 nCurrentLang = LANGUAGE_DONTKNOW;
479 break;
480 }
481 }
482 }
483 OSL_ENSURE( nCurrentLang != LANGUAGE_SYSTEM, "failed to get the language?" );
484
485 return nCurrentLang;
486 }
487
489 {
490 // string for guessing language
491 OUString aText;
492 SwPaM *pCursor = rSh.GetCursor();
493 SwTextNode *pNode = pCursor->GetPointNode().GetTextNode();
494 if (pNode)
495 {
496 aText = pNode->GetText();
497 if (!aText.isEmpty())
498 {
499 sal_Int32 nEnd = pCursor->GetPoint()->GetContentIndex();
500 // at most 100 chars to the left...
501 const sal_Int32 nStt = nEnd > 100 ? nEnd - 100 : 0;
502 // ... and 100 to the right of the cursor position
503 nEnd = aText.getLength() - nEnd > 100 ? nEnd + 100 : aText.getLength();
504 aText = aText.copy( nStt, nEnd - nStt );
505 }
506 }
507 return aText;
508 }
509
510 OUString GetTextForLanguageGuessing(EditEngine const * rEditEngine, const ESelection& rDocSelection)
511 {
512 // string for guessing language
513
514 // get the full text of the paragraph that the end of selection is in
515 OUString aText = rEditEngine->GetText(rDocSelection.nEndPos);
516 if (!aText.isEmpty())
517 {
518 sal_Int32 nStt = 0;
519 sal_Int32 nEnd = rDocSelection.nEndPos;
520 // at most 100 chars to the left...
521 nStt = nEnd > 100 ? nEnd - 100 : 0;
522 // ... and 100 to the right of the cursor position
523 nEnd = aText.getLength() - nEnd > 100 ? nEnd + 100 : aText.getLength();
524 aText = aText.copy( nStt, nEnd - nStt );
525 }
526
527 return aText;
528 }
529
530 void SelectPara( EditView &rEditView, const ESelection &rCurSel )
531 {
532 ESelection aParaSel( rCurSel.nStartPara, 0, rCurSel.nStartPara, EE_TEXTPOS_ALL );
533 rEditView.SetSelection( aParaSel );
534 }
535
537 {
538 // select current para
539 if (!rWrtSh.IsSttPara())
541 if (!rWrtSh.HasMark())
542 rWrtSh.SetMark();
543 rWrtSh.SwapPam();
544 if (!rWrtSh.IsEndPara())
545 rWrtSh.MovePara( GoCurrPara, fnParaEnd );
546 }
547}
548
549/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const OUString & GetValue() const
OUString GetText(LineEnd eEnd=LINEEND_LF) const
EEControlBits GetControlWord() const
void CompleteOnlineSpelling()
void SetControlWord(EEControlBits nWord)
void QuickSetAttribs(const SfxItemSet &rSet, const ESelection &rSel)
void RemoveAttribs(bool bRemoveParaAttribs=false, sal_uInt16 nWhich=0)
void SetSelection(const ESelection &rNewSel)
const SfxItemSet & GetEmptyItemSet() const
LanguageType GetInputLanguage() const
EditEngine * GetEditEngine() const
void Invalidate()
SvtScriptType GetSelectedScriptType() const
ESelection GetSelection() const
SfxItemSet GetAttribs()
EditView & GetEditView() const
static SfxAbstractDialogFactory * Create()
void Invalidate(sal_uInt16 nId)
const SfxPoolItem & GetDefaultItem(sal_uInt16 nWhich) const
SfxItemPool * GetPool() const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
sal_uInt16 GetSlot() const
const T * GetArg(sal_uInt16 nSlotId) const
void Done(bool bRemove=false)
void SetStringList(const css::uno::Sequence< OUString > &rList)
SfxBindings & GetBindings()
weld::Window * GetFrameWeld() const
SfxViewFrame & GetViewFrame() const
static OUString GetLanguageString(const LanguageType eType)
static LanguageType GetLanguageType(std::u16string_view rStr)
LanguageType GetLanguage() const
void ExtendedSelectAll(bool bFootnotes=true)
Definition: crsrsh.cxx:748
void Push()
store a copy of the current cursor on the cursor stack
Definition: crsrsh.cxx:2550
void StartAction()
Definition: crsrsh.cxx:226
void SwapPam()
Definition: crsrsh.cxx:1262
bool MovePara(SwWhichPara, SwMoveFnCollection const &)
Definition: crsrsh.cxx:982
bool IsEndPara() const
Definition: crsrsh.cxx:1400
SwCursor * GetCursor(bool bMakeTableCursor=true) const
Return pointer to the current shell cursor.
Definition: crsrsh.cxx:194
bool IsSttPara() const
Definition: crsrsh.cxx:1381
bool HasMark() const
Definition: crsrsh.hxx:908
void EndAction(const bool bIdleEnd=false)
Definition: crsrsh.cxx:243
void SetMark()
Definition: crsrsh.hxx:906
SwDocShell * GetDocShell()
Definition: doc.hxx:1370
bool GetCurAttr(SfxItemSet &, const bool bMergeIndentValuesOfNumRule=false) const
Definition: edattr.cxx:171
void SetAttrItem(const SfxPoolItem &, SetAttrMode nFlags=SetAttrMode::DEFAULT, const bool bParagraphSetting=false)
Definition: edatmisc.cxx:98
void SetAttrSet(const SfxItemSet &, SetAttrMode nFlags=SetAttrMode::DEFAULT, SwPaM *pCursor=nullptr, const bool bParagraphSetting=false)
Definition: edatmisc.cxx:129
void SetDefault(const SfxPoolItem &)
Set attribute as new default attribute in document.
Definition: edatmisc.cxx:84
SvtScriptType GetScriptType() const
returns the script type of the selection
Definition: edattr.cxx:662
void ResetAttr(const o3tl::sorted_vector< sal_uInt16 > &attrs=o3tl::sorted_vector< sal_uInt16 >(), SwPaM *pCursor=nullptr)
Definition: edatmisc.cxx:32
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Definition: ndtxt.hxx:901
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:188
SwNode & GetPointNode() const
Definition: pam.hxx:275
const SwPosition * GetPoint() const
Definition: pam.hxx:253
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:112
const OUString & GetText() const
Definition: ndtxt.hxx:244
SwDoc * GetDoc() const
Definition: viewsh.hxx:308
void LockView(bool b)
Definition: viewsh.hxx:491
const SfxItemPool & GetAttrPool() const
Definition: viewsh.hxx:648
Definition: view.hxx:146
Used by the UI to modify the document model.
Definition: wrtsh.hxx:97
void SelAll()
Definition: select.cxx:124
bool Pop(SwCursorShell::PopMode, ::std::optional< SwCallLink > &roLink)
Definition: wrtsh1.cxx:2047
std::pair< const_iterator, bool > insert(Value &&x)
float u
#define EE_TEXTPOS_ALL
EEControlBits
constexpr TypedWhichId< SvxLanguageItem > EE_CHAR_LANGUAGE_CTL(EE_CHAR_START+16)
constexpr TypedWhichId< SvxLanguageItem > EE_CHAR_LANGUAGE_CJK(EE_CHAR_START+15)
constexpr TypedWhichId< SvxLanguageItem > EE_CHAR_LANGUAGE(EE_CHAR_START+14)
sal_Int32 nState
OUString const aScriptType
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_LANGUAGE(10)
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CTL_LANGUAGE(29)
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CJK_LANGUAGE(24)
#define LANGUAGE_SYSTEM
#define LANGUAGE_NONE
#define LANGUAGE_DONTKNOW
SvtScriptType
sal_uInt16 nPos
Sequence< sal_Int8 > aSeq
SvtScriptType GetScriptTypeOfLanguage(LanguageType nLang)
LanguageType GetCurrentLanguage(SfxItemSet const &aSet, SvtScriptType nScriptType)
Definition: langhelper.cxx:444
void SelectPara(EditView &rEditView, const ESelection &rCurSel)
Definition: langhelper.cxx:530
void SetLanguage_None(SwWrtShell &rWrtSh, bool bIsForSelection, SfxItemSet &rCoreSet)
Definition: langhelper.cxx:258
void ResetLanguages(SwWrtShell &rWrtSh, OutlinerView const *pOLV=nullptr)
Definition: langhelper.cxx:319
void SelectCurrentPara(SwWrtShell &rWrtSh)
Definition: langhelper.cxx:536
void GetLanguageStatus(OutlinerView *pOLV, SfxItemSet &rSet)
Definition: langhelper.cxx:57
bool SetLanguageStatus(OutlinerView *pOLV, SfxRequest &rReq, SwView const &rView, SwWrtShell &rSh)
Definition: langhelper.cxx:93
void SetLanguage(SwWrtShell &rWrtSh, std::u16string_view rLangText, bool bIsForSelection, SfxItemSet &rCoreSet)
Definition: langhelper.cxx:192
OUString GetTextForLanguageGuessing(EditEngine const *rEditEngine, const ESelection &rDocSelection)
Definition: langhelper.cxx:510
LanguageType GetLanguage(SfxItemSet const &aSet, sal_uInt16 nLangWhichId)
Definition: langhelper.cxx:365
int i
bool GoCurrPara(SwPaM &rPam, SwMoveFnCollection const &aPosPara)
Definition: pam.cxx:1248
SwMoveFnCollection const & fnParaStart
Definition: paminit.cxx:48
SwMoveFnCollection const & fnParaEnd
Definition: paminit.cxx:49
SfxItemState
static SfxItemSet & rSet
static LanguageType nLang
Definition: srtdlg.cxx:51
sal_Int32 nStartPara
sal_Int32 nEndPos
sal_Int32 GetContentIndex() const
Definition: pam.hxx:85