LibreOffice Module editeng (master) 1
edtspell.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
21#include "impedit.hxx"
22#include <sal/log.hxx>
23#include <o3tl/safeint.hxx>
24#include <osl/diagnose.h>
25#include <editeng/editview.hxx>
26#include <editeng/editeng.hxx>
27#include <edtspell.hxx>
28#include <editeng/flditem.hxx>
29#include <svl/intitem.hxx>
30#include <svl/eitem.hxx>
31#include <editeng/unolingu.hxx>
32#include <com/sun/star/linguistic2/XDictionary.hpp>
33
34using namespace com::sun::star::uno;
35using namespace com::sun::star::beans;
36using namespace com::sun::star::linguistic2;
37
38
40 bool bIsStart, EditView* pView )
41 : SvxSpellWrapper(pWindow, bIsStart, false/*bIsAllRight*/)
42{
43 SAL_WARN_IF( !pView, "editeng", "One view has to be abandoned!" );
44 // Keep IgnoreList, delete ReplaceList...
47 pEditView = pView;
48}
49
51{
54 SpellInfo* pSpellInfo = pImpEE->GetSpellInfo();
55
56 if ( eArea == SvxSpellArea::BodyStart )
57 {
58 // Is called when
59 // a) Spell-Forward has arrived at the end and should restart at the top
60 // IsEndDone() returns also true, when backward-spelling is started at the end!
61 if ( IsEndDone() )
62 {
63 pSpellInfo->bSpellToEnd = false;
64 pSpellInfo->aSpellTo = pSpellInfo->aSpellStart;
66 pEE->GetEditDoc().GetStartPaM() );
67 }
68 else
69 {
70 pSpellInfo->bSpellToEnd = true;
71 pSpellInfo->aSpellTo = pImpEE->CreateEPaM(
72 pEE->GetEditDoc().GetStartPaM() );
73 }
74 }
75 else if ( eArea == SvxSpellArea::BodyEnd )
76 {
77 // Is called when
78 // a) Spell-Forward is launched
79 // IsStartDone() return also true, when forward-spelling is started at the beginning!
80 if ( !IsStartDone() )
81 {
82 pSpellInfo->bSpellToEnd = true;
83 pSpellInfo->aSpellTo = pImpEE->CreateEPaM(
84 pEE->GetEditDoc().GetEndPaM() );
85 }
86 else
87 {
88 pSpellInfo->bSpellToEnd = false;
89 pSpellInfo->aSpellTo = pSpellInfo->aSpellStart;
91 pEE->GetEditDoc().GetEndPaM() );
92 }
93 }
94 else if ( eArea == SvxSpellArea::Body )
95 {
96 ; // Is handled by the App through SpellNextDocument
97 }
98 else
99 {
100 OSL_FAIL( "SpellStart: Unknown Area!" );
101 }
102}
103
105{
107}
108
110{
113 SpellInfo* pSpellInfo = pImpEE->GetSpellInfo();
114 bool bMore = false;
115 if ( pSpellInfo->bMultipleDoc )
116 {
117 bMore = pEE->SpellNextDocument();
118 if ( bMore )
119 {
120 // The text has been entered into the engine, when backwards then
121 // it must be behind the selection.
123 pEE->GetEditDoc().GetStartPaM() );
124 }
125 }
126 return bMore;
127}
128
129void EditSpellWrapper::ReplaceAll( const OUString &rNewText )
130{
131 // Is called when the word is in ReplaceList of the spell checker
132 pEditView->InsertText( rNewText );
133 CheckSpellTo();
134}
135
137{
139 SpellInfo* pSpellInfo = pImpEE->GetSpellInfo();
141 EPaM aEPaM = pImpEE->CreateEPaM( aPaM );
142 if ( aEPaM.nPara == pSpellInfo->aSpellTo.nPara )
143 {
144 // Check if SpellToEnd still has a valid Index, if replace has been
145 // performed in the paragraph.
146 if ( pSpellInfo->aSpellTo.nIndex > aPaM.GetNode()->Len() )
147 pSpellInfo->aSpellTo.nIndex = aPaM.GetNode()->Len();
148 }
149}
150
151WrongList::WrongList() : mnInvalidStart(0), mnInvalidEnd(Valid) {}
152
153void WrongList::SetRanges( std::vector<editeng::MisspellRange>&&rRanges )
154{
155 maRanges = std::move(rRanges);
156}
157
159{
160 return mnInvalidStart == Valid;
161}
162
164{
166 mnInvalidEnd = 0;
167}
168
169void WrongList::SetInvalidRange( size_t nStart, size_t nEnd )
170{
171 if (mnInvalidStart == Valid || nStart < mnInvalidStart)
172 mnInvalidStart = nStart;
173
174 if (mnInvalidEnd < nEnd)
175 mnInvalidEnd = nEnd;
176}
177
178void WrongList::ResetInvalidRange( size_t nStart, size_t nEnd )
179{
180 mnInvalidStart = nStart;
181 mnInvalidEnd = nEnd;
182}
183
184void WrongList::TextInserted( size_t nPos, size_t nLength, bool bPosIsSep )
185{
186 if (IsValid())
187 {
190 }
191 else
192 {
193 if ( mnInvalidStart > nPos )
195 if ( mnInvalidEnd >= nPos )
197 else
199 }
200
201 for (size_t i = 0, n = maRanges.size(); i < n; ++i)
202 {
204 bool bRefIsValid = true;
205 if (rWrong.mnEnd >= nPos)
206 {
207 // Move all Wrongs after the insert position...
208 if (rWrong.mnStart > nPos)
209 {
210 rWrong.mnStart += nLength;
211 rWrong.mnEnd += nLength;
212 }
213 // 1: Starts before and goes until nPos...
214 else if (rWrong.mnEnd == nPos)
215 {
216 // Should be halted at a blank!
217 if ( !bPosIsSep )
218 rWrong.mnEnd += nLength;
219 }
220 // 2: Starts before and goes until after nPos...
221 else if ((rWrong.mnStart < nPos) && (rWrong.mnEnd > nPos))
222 {
223 rWrong.mnEnd += nLength;
224 // When a separator remove and re-examine the Wrong
225 if ( bPosIsSep )
226 {
227 // Split Wrong...
228 editeng::MisspellRange aNewWrong(rWrong.mnStart, nPos);
229 rWrong.mnStart = nPos + 1;
230 maRanges.insert(maRanges.begin() + i, aNewWrong);
231 // Reference no longer valid after Insert, the other
232 // was inserted in front of this position
233 bRefIsValid = false;
234 ++i; // Not this again...
235 }
236 }
237 // 3: Attribute starts at position ..
238 else if (rWrong.mnStart == nPos)
239 {
240 rWrong.mnEnd += nLength;
241 if ( bPosIsSep )
242 ++(rWrong.mnStart);
243 }
244 }
245 SAL_WARN_IF(bRefIsValid && rWrong.mnStart >= rWrong.mnEnd, "editeng",
246 "TextInserted, editeng::MisspellRange: Start >= End?!");
247 }
248
249 SAL_WARN_IF(DbgIsBuggy(), "editeng", "InsertWrong: WrongList broken!");
250}
251
252void WrongList::TextDeleted( size_t nPos, size_t nLength )
253{
254 size_t nEndPos = nPos + nLength;
255 if (IsValid())
256 {
257 const size_t nNewInvalidStart = nPos ? nPos - 1 : 0;
258 mnInvalidStart = nNewInvalidStart;
259 mnInvalidEnd = nNewInvalidStart + 1;
260 }
261 else
262 {
263 if ( mnInvalidStart > nPos )
265 if ( mnInvalidEnd > nPos )
266 {
267 if (mnInvalidEnd > nEndPos)
269 else
270 mnInvalidEnd = nPos+1;
271 }
272 }
273
274 for (WrongList::iterator i = maRanges.begin(); i != maRanges.end(); )
275 {
276 bool bDelWrong = false;
277 if (i->mnEnd >= nPos)
278 {
279 // Move all Wrongs after the insert position...
280 if (i->mnStart >= nEndPos)
281 {
282 i->mnStart -= nLength;
283 i->mnEnd -= nLength;
284 }
285 // 1. Delete Internal Wrongs ...
286 else if (i->mnStart >= nPos && i->mnEnd <= nEndPos)
287 {
288 bDelWrong = true;
289 }
290 // 2. Wrong begins before, ends inside or behind it ...
291 else if (i->mnStart <= nPos && i->mnEnd > nPos)
292 {
293 if (i->mnEnd <= nEndPos) // ends inside
294 i->mnEnd = nPos;
295 else
296 i->mnEnd -= nLength; // ends after
297 }
298 // 3. Wrong begins inside, ending after ...
299 else if (i->mnStart >= nPos && i->mnEnd > nEndPos)
300 {
301 i->mnStart = nEndPos - nLength;
302 i->mnEnd -= nLength;
303 }
304 }
305 SAL_WARN_IF(i->mnStart >= i->mnEnd, "editeng",
306 "TextDeleted, editeng::MisspellRange: Start >= End?!");
307 if ( bDelWrong )
308 {
309 i = maRanges.erase(i);
310 }
311 else
312 {
313 ++i;
314 }
315 }
316
317 SAL_WARN_IF(DbgIsBuggy(), "editeng", "TextDeleted: WrongList broken!");
318}
319
320bool WrongList::NextWrong( size_t& rnStart, size_t& rnEnd ) const
321{
322 /*
323 rnStart get the start position, is possibly adjusted wrt. Wrong start
324 rnEnd does not have to be initialized.
325 */
326 for (auto const& range : maRanges)
327 {
328 if (range.mnEnd > rnStart)
329 {
330 rnStart = range.mnStart;
331 rnEnd = range.mnEnd;
332 return true;
333 }
334 }
335 return false;
336}
337
338bool WrongList::HasWrong( size_t nStart, size_t nEnd ) const
339{
340 for (auto const& range : maRanges)
341 {
342 if (range.mnStart == nStart && range.mnEnd == nEnd)
343 return true;
344 else if (range.mnStart >= nStart)
345 break;
346 }
347 return false;
348}
349
350bool WrongList::HasAnyWrong( size_t nStart, size_t nEnd ) const
351{
352 for (auto const& range : maRanges)
353 {
354 if (range.mnEnd >= nStart && range.mnStart < nEnd)
355 return true;
356 else if (range.mnStart >= nEnd)
357 break;
358 }
359 return false;
360}
361
362void WrongList::ClearWrongs( size_t nStart, size_t nEnd,
363 const ContentNode* pNode )
364{
365 for (WrongList::iterator i = maRanges.begin(); i != maRanges.end(); )
366 {
367 if (i->mnEnd > nStart && i->mnStart < nEnd)
368 {
369 if (i->mnEnd > nEnd) // Runs out
370 {
371 i->mnStart = nEnd;
372 // Blanks?
373 while (i->mnStart < o3tl::make_unsigned(pNode->Len()) &&
374 (pNode->GetChar(i->mnStart) == ' ' ||
375 pNode->IsFeature(i->mnStart)))
376 {
377 ++i->mnStart;
378 }
379 ++i;
380 }
381 else
382 {
383 i = maRanges.erase(i);
384 // no increment here
385 }
386 }
387 else
388 {
389 ++i;
390 }
391 }
392
393 SAL_WARN_IF(DbgIsBuggy(), "editeng", "ClearWrongs: WrongList broken!");
394}
395
396void WrongList::InsertWrong( size_t nStart, size_t nEnd )
397{
398 WrongList::iterator nPos = std::find_if(maRanges.begin(), maRanges.end(),
399 [&nStart](const editeng::MisspellRange& rRange) { return rRange.mnStart >= nStart; });
400
401 if (nPos != maRanges.end())
402 {
403 {
404 // It can really only happen that the Wrong starts exactly here
405 // and runs along, but not that there are several ranges ...
406 // Exactly in the range is no one allowed to be, otherwise this
407 // Method can not be called!
408 SAL_WARN_IF((nPos->mnStart != nStart || nPos->mnEnd <= nEnd) && nPos->mnStart <= nEnd, "editeng", "InsertWrong: RangeMismatch!");
409 if (nPos->mnStart == nStart && nPos->mnEnd > nEnd)
410 nPos->mnStart = nEnd + 1;
411 }
412 maRanges.insert(nPos, editeng::MisspellRange(nStart, nEnd));
413 }
414 else
415 maRanges.emplace_back(nStart, nEnd);
416
417 SAL_WARN_IF(DbgIsBuggy(), "editeng", "InsertWrong: WrongList broken!");
418}
419
421{
422 if (!maRanges.empty())
423 SetInvalidRange(maRanges.front().mnStart, maRanges.back().mnEnd);
424}
425
427{
428 return new WrongList(*this);
429}
430
431// #i102062#
432bool WrongList::operator==(const WrongList& rCompare) const
433{
434 // check direct members
435 if(GetInvalidStart() != rCompare.GetInvalidStart()
436 || GetInvalidEnd() != rCompare.GetInvalidEnd())
437 return false;
438
439 return std::equal(maRanges.begin(), maRanges.end(), rCompare.maRanges.begin(), rCompare.maRanges.end(),
440 [](const editeng::MisspellRange& a, const editeng::MisspellRange& b) {
441 return a.mnStart == b.mnStart && a.mnEnd == b.mnEnd; });
442}
443
445{
446 return maRanges.empty();
447}
448
450{
451 maRanges.push_back(rRange);
452}
453
455{
456 return maRanges.back();
457}
458
460{
461 return maRanges.back();
462}
463
465{
466 return maRanges.begin();
467}
468
470{
471 return maRanges.end();
472}
473
475{
476 return maRanges.begin();
477}
478
480{
481 return maRanges.end();
482}
483
485{
486 // Check if the ranges overlap.
487 bool bError = false;
488 for (WrongList::const_iterator i = maRanges.begin(); !bError && (i != maRanges.end()); ++i)
489 {
490 bError = std::any_of(i + 1, maRanges.end(), [&i](const editeng::MisspellRange& rRange) {
491 return i->mnStart <= rRange.mnEnd && rRange.mnStart <= i->mnEnd; });
492 }
493 return bError;
494}
495
496
498 EditEngine* pE, ContentNode* pN, sal_Int32 nCrsr, sal_Unicode cIns) :
499 mpEditEngine(pE),
500 pCurNode(pN),
501 nCursor(nCrsr),
502 bAllowUndoAction(cIns != 0),
503 bUndoAction(false) {}
504
506{
507 if ( bUndoAction )
509}
510
511bool EdtAutoCorrDoc::Delete(sal_Int32 nStt, sal_Int32 nEnd)
512{
513 EditSelection aSel( EditPaM( pCurNode, nStt ), EditPaM( pCurNode, nEnd ) );
515 SAL_WARN_IF(nCursor < nEnd, "editeng",
516 "Cursor in the heart of the action?!");
517 nCursor -= ( nEnd-nStt );
518 bAllowUndoAction = false;
519 return true;
520}
521
522bool EdtAutoCorrDoc::Insert(sal_Int32 nPos, const OUString& rTxt)
523{
525 mpEditEngine->InsertText(aSel, rTxt);
526 SAL_WARN_IF(nCursor < nPos, "editeng",
527 "Cursor in the heart of the action?!");
528 nCursor = nCursor + rTxt.getLength();
529
530 if ( bAllowUndoAction && ( rTxt.getLength() == 1 ) )
532 bAllowUndoAction = false;
533
534 return true;
535}
536
537bool EdtAutoCorrDoc::Replace(sal_Int32 nPos, const OUString& rTxt)
538{
539 return ReplaceRange( nPos, rTxt.getLength(), rTxt );
540}
541
542bool EdtAutoCorrDoc::ReplaceRange(sal_Int32 nPos, sal_Int32 nSourceLength, const OUString& rTxt)
543{
544 // Actually a Replace introduce => corresponds to UNDO
545 sal_Int32 nEnd = nPos+nSourceLength;
546 if ( nEnd > pCurNode->Len() )
547 nEnd = pCurNode->Len();
548
549 // #i5925# First insert new text behind to be deleted text, for keeping attributes.
553
554 if ( nPos == nCursor )
555 nCursor = nCursor + rTxt.getLength();
556
557 if ( bAllowUndoAction && ( rTxt.getLength() == 1 ) )
559
560 bAllowUndoAction = false;
561
562 return true;
563}
564
565void EdtAutoCorrDoc::SetAttr(sal_Int32 nStt, sal_Int32 nEnd,
566 sal_uInt16 nSlotId, SfxPoolItem& rItem)
567{
569 while ( pPool->GetSecondaryPool() &&
570 pPool->GetName() != "EditEngineItemPool" )
571 {
572 pPool = pPool->GetSecondaryPool();
573
574 }
575 sal_uInt16 nWhich = pPool->GetWhich( nSlotId );
576 if ( nWhich )
577 {
578 rItem.SetWhich( nWhich );
579
581 aSet.Put( rItem );
582
583 EditSelection aSel( EditPaM( pCurNode, nStt ), EditPaM( pCurNode, nEnd ) );
584 aSel.Max().SetIndex( nEnd ); // ???
586 bAllowUndoAction = false;
587 }
588}
589
590bool EdtAutoCorrDoc::SetINetAttr(sal_Int32 nStt, sal_Int32 nEnd,
591 const OUString& rURL)
592{
593 // Turn the Text into a command field ...
594 EditSelection aSel( EditPaM( pCurNode, nStt ), EditPaM( pCurNode, nEnd ) );
595 OUString aText = mpEditEngine->GetSelected(aSel);
596 aSel = mpEditEngine->DeleteSelection(aSel);
597 SAL_WARN_IF(nCursor < nEnd, "editeng",
598 "Cursor in the heart of the action?!");
599 nCursor -= ( nEnd-nStt );
600 SvxFieldItem aField( SvxURLField( rURL, aText, SvxURLFormat::Repr ),
602 mpEditEngine->InsertField(aSel, aField);
603 nCursor++;
605 bAllowUndoAction = false;
606 return true;
607}
608
609OUString const* EdtAutoCorrDoc::GetPrevPara(bool const)
610{
611 // Return previous paragraph, so that it can be determined,
612 // whether the current word is at the beginning of a sentence.
613
614 bAllowUndoAction = false; // Not anymore ...
615
616 EditDoc& rNodes = mpEditEngine->GetEditDoc();
617 sal_Int32 nPos = rNodes.GetPos( pCurNode );
618
619 // Special case: Bullet => Paragraph start => simply return NULL...
621 bool bBullet = rBulletState.GetValue();
622 if ( !bBullet && (mpEditEngine->GetControlWord() & EEControlBits::OUTLINER) )
623 {
624 // The Outliner has still a Bullet at Level 0.
626 if ( rLevel.GetValue() == 0 )
627 bBullet = true;
628 }
629 if ( bBullet )
630 return nullptr;
631
632 for ( sal_Int32 n = nPos; n; )
633 {
634 n--;
635 ContentNode* pNode = rNodes[n];
636 if ( pNode->Len() )
637 return & pNode->GetString();
638 }
639 return nullptr;
640
641}
642
643bool EdtAutoCorrDoc::ChgAutoCorrWord( sal_Int32& rSttPos,
644 sal_Int32 nEndPos, SvxAutoCorrect& rACorrect,
645 OUString* pPara )
646{
647 // Paragraph-start or a blank found, search for the word
648 // shortcut in Auto
649 bAllowUndoAction = false; // Not anymore ...
650
651 OUString aShort( pCurNode->Copy( rSttPos, nEndPos - rSttPos ) );
652 bool bRet = false;
653
654 if( aShort.isEmpty() )
655 return bRet;
656
657 LanguageTag aLanguageTag( mpEditEngine->GetLanguage( EditPaM( pCurNode, rSttPos+1 ) ).nLang );
658 const SvxAutocorrWord* pFnd = rACorrect.SearchWordsInList(
659 pCurNode->GetString(), rSttPos, nEndPos, *this, aLanguageTag);
660 if( pFnd && pFnd->IsTextOnly() )
661 {
662
663 // replace also last colon of keywords surrounded by colons (for example, ":name:")
664 bool replaceLastChar = pFnd->GetShort()[0] == ':' && pFnd->GetShort().endsWith(":");
665
666 // then replace
667 EditSelection aSel( EditPaM( pCurNode, rSttPos ),
668 EditPaM( pCurNode, nEndPos + (replaceLastChar ? 1 : 0) ));
669 aSel = mpEditEngine->DeleteSelection(aSel);
670 SAL_WARN_IF(nCursor < nEndPos, "editeng",
671 "Cursor in the heart of the action?!");
672 nCursor -= ( nEndPos-rSttPos );
673 mpEditEngine->InsertText(aSel, pFnd->GetLong());
674 nCursor = nCursor + pFnd->GetLong().getLength();
675 if( pPara )
676 *pPara = pCurNode->GetString();
677 bRet = true;
678 }
679
680 return bRet;
681}
682
683bool EdtAutoCorrDoc::TransliterateRTLWord( sal_Int32& /*rSttPos*/,
684 sal_Int32 /*nEndPos*/, bool /*bApply*/ )
685{
686 // Paragraph-start or a blank found, search for the word
687 // shortcut in Auto
688 bool bRet = false;
689
690 return bRet;
691}
692
693
695{
697}
698
700{
701 sal_Int32 nPara = mpEditEngine->GetEditDoc().GetPos( pCurNode );
702 ESelection aSel( nPara, nCursor, nPara, nCursor );
704 bUndoAction = true;
705 bAllowUndoAction = false;
706}
707
708/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_Unicode GetChar(sal_Int32 nPos) const
Definition: editdoc.cxx:1766
bool IsFeature(sal_Int32 nPos) const
Definition: editdoc.cxx:1610
const OUString & GetString() const
Definition: editdoc.hxx:281
OUString Copy(sal_Int32 nPos) const
Definition: editdoc.cxx:1756
sal_Int32 Len() const
Definition: editdoc.cxx:1615
EditPaM GetEndPaM() const
Definition: editdoc.cxx:2204
sal_Int32 GetPos(const ContentNode *pNode) const
Definition: editdoc.cxx:2086
SfxItemPool & GetItemPool()
Definition: editdoc.hxx:812
EditPaM GetStartPaM() const
Definition: editdoc.cxx:2198
EditPaM DeleteSelection(const EditSelection &rSel)
Definition: editeng.cxx:935
EditPaM InsertField(const EditSelection &rEditSelection, const SvxFieldItem &rFld)
Definition: editeng.cxx:835
bool UpdateFieldsOnly()
Definition: editeng.cxx:2372
editeng::LanguageSpan GetLanguage(const EditPaM &rPaM) const
Definition: editeng.cxx:482
EEControlBits GetControlWord() const
Definition: editeng.cxx:1953
EditSelection InsertText(css::uno::Reference< css::datatransfer::XTransferable > const &rxDataObj, const OUString &rBaseURL, const EditPaM &rPaM, bool bUseSpecial)
virtual bool SpellNextDocument()
Definition: editeng.cxx:2225
const SfxPoolItem & GetParaAttrib(sal_Int32 nPara, sal_uInt16 nWhich) const
Definition: editeng.cxx:1764
const SfxItemSet & GetEmptyItemSet() const
Definition: editeng.cxx:199
OUString GetSelected(const EditSelection &rSel) const
Definition: editeng.cxx:965
void UndoActionStart(sal_uInt16 nId)
Definition: editeng.cxx:125
void UndoActionEnd()
Definition: editeng.cxx:137
void SetAttribs(const EditSelection &rSel, const SfxItemSet &rSet, SetAttribsMode nSpecial=SetAttribsMode::NONE)
Definition: editeng.cxx:960
EditDoc & GetEditDoc()
Definition: editeng.cxx:905
void SetIndex(sal_Int32 n)
Definition: editdoc.hxx:317
const ContentNode * GetNode() const
Definition: editdoc.hxx:312
EditPaM & Max()
Definition: editdoc.hxx:706
EditSpellWrapper(weld::Widget *pWin, bool bIsStart, EditView *pView)
Definition: edtspell.cxx:39
virtual bool SpellMore() override
Definition: edtspell.cxx:109
void CheckSpellTo()
Definition: edtspell.cxx:136
virtual void SpellStart(SvxSpellArea eArea) override
Definition: edtspell.cxx:50
EditView * pEditView
Definition: edtspell.hxx:39
virtual void SpellContinue() override
Definition: edtspell.cxx:104
virtual void ReplaceAll(const OUString &rNewText) override
Definition: edtspell.cxx:129
ImpEditView * GetImpEditView() const
Definition: editview.hxx:162
void InsertText(const OUString &rNew, bool bSelect=false, bool bLOKShowSelect=true)
Definition: editview.cxx:436
EditEngine * GetEditEngine() const
Definition: editview.cxx:178
ImpEditEngine * GetImpEditEngine() const
Definition: editview.cxx:173
virtual OUString const * GetPrevPara(bool bAtNormalPos) override
Definition: edtspell.cxx:609
virtual bool TransliterateRTLWord(sal_Int32 &rSttPos, sal_Int32 nEndPos, bool bApply=false) override
Definition: edtspell.cxx:683
virtual bool ChgAutoCorrWord(sal_Int32 &rSttPos, sal_Int32 nEndPos, SvxAutoCorrect &rACorrect, OUString *pPara) override
Definition: edtspell.cxx:643
virtual ~EdtAutoCorrDoc() override
Definition: edtspell.cxx:505
virtual bool Replace(sal_Int32 nPos, const OUString &rTxt) override
Definition: edtspell.cxx:537
void ImplStartUndoAction()
Definition: edtspell.cxx:699
virtual bool SetINetAttr(sal_Int32 nStt, sal_Int32 nEnd, const OUString &rURL) override
Definition: edtspell.cxx:590
sal_Int32 nCursor
Definition: edtspell.hxx:111
EdtAutoCorrDoc(EditEngine *pE, ContentNode *pCurNode, sal_Int32 nCrsr, sal_Unicode cIns)
Definition: edtspell.cxx:497
virtual bool ReplaceRange(sal_Int32 nPos, sal_Int32 nLen, const OUString &rTxt) override
Definition: edtspell.cxx:542
ContentNode * pCurNode
Definition: edtspell.hxx:110
EditEngine * mpEditEngine
Definition: edtspell.hxx:109
virtual LanguageType GetLanguage(sal_Int32 nPos) const override
Definition: edtspell.cxx:694
bool bAllowUndoAction
Definition: edtspell.hxx:113
virtual bool Insert(sal_Int32 nPos, const OUString &rTxt) override
Definition: edtspell.cxx:522
virtual void SetAttr(sal_Int32 nStt, sal_Int32 nEnd, sal_uInt16 nSlotId, SfxPoolItem &) override
Definition: edtspell.cxx:565
virtual bool Delete(sal_Int32 nStt, sal_Int32 nEnd) override
Definition: edtspell.cxx:511
css::uno::Reference< css::linguistic2::XSpellAlternatives > ImpSpell(EditView *pEditView)
Definition: impedit4.cxx:1813
SpellInfo * GetSpellInfo() const
Definition: impedit.hxx:1053
EPaM CreateEPaM(const EditPaM &rPaM) const
Definition: impedit.hxx:1233
const EditSelection & GetEditSelection() const
Definition: impedit.hxx:390
void SetEditSelection(const EditSelection &rEditSelection)
Definition: impedit.cxx:245
static css::uno::Reference< css::linguistic2::XDictionary > GetChangeAllList()
Definition: unolingu.cxx:516
bool GetValue() const
sal_Int16 GetValue() const
sal_uInt16 GetWhich(sal_uInt16 nSlot, bool bDeep=true) const
SfxItemPool * GetSecondaryPool() const
const OUString & GetName() const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
void SetWhich(sal_uInt16 nId)
const SvxAutocorrWord * SearchWordsInList(std::u16string_view rTxt, sal_Int32 &rStt, sal_Int32 nEndPos, SvxAutoCorrDoc &rDoc, LanguageTag &rLang)
Definition: svxacorr.cxx:1978
bool IsTextOnly() const
Definition: svxacorr.hxx:154
const OUString & GetShort() const
Definition: svxacorr.hxx:152
const OUString & GetLong() const
Definition: svxacorr.hxx:153
This item stores a field (SvxFieldData).
Definition: flditem.hxx:70
bool IsEndDone() const
Definition: splwrap.hxx:92
void SetLast(const css::uno::Reference< css::uno::XInterface > &xNewLast)
Definition: splwrap.hxx:98
bool IsStartDone() const
Definition: splwrap.hxx:91
Keeps track of misspelled ranges in paragraph.
Definition: edtspell.hxx:55
bool DbgIsBuggy() const
Definition: edtspell.cxx:484
void SetValid()
Definition: edtspell.cxx:163
void MarkWrongsInvalid()
Definition: edtspell.cxx:420
editeng::MisspellRange & back()
Definition: edtspell.cxx:454
static constexpr size_t Valid
Definition: edtspell.hxx:56
void ResetInvalidRange(size_t nStart, size_t nEnd)
Definition: edtspell.cxx:178
void SetInvalidRange(size_t nStart, size_t nEnd)
Definition: edtspell.cxx:169
size_t mnInvalidStart
Definition: edtspell.hxx:59
void TextDeleted(size_t nPos, size_t nLength)
Definition: edtspell.cxx:252
bool IsValid() const
Definition: edtspell.cxx:158
void TextInserted(size_t nPos, size_t nLength, bool bPosIsSep)
Definition: edtspell.cxx:184
bool operator==(const WrongList &rCompare) const
Definition: edtspell.cxx:432
bool HasWrong(size_t nStart, size_t nEnd) const
Definition: edtspell.cxx:338
void push_back(const editeng::MisspellRange &rRange)
Definition: edtspell.cxx:449
WrongList * Clone() const
Definition: edtspell.cxx:426
void ClearWrongs(size_t nStart, size_t nEnd, const ContentNode *pNode)
Definition: edtspell.cxx:362
size_t GetInvalidEnd() const
Definition: edtspell.hxx:79
void InsertWrong(size_t nStart, size_t nEnd)
Definition: edtspell.cxx:396
bool NextWrong(size_t &rnStart, size_t &rnEnd) const
Definition: edtspell.cxx:320
iterator begin()
Definition: edtspell.cxx:464
void SetRanges(std::vector< editeng::MisspellRange > &&rRanges)
Definition: edtspell.cxx:153
size_t GetInvalidStart() const
Definition: edtspell.hxx:78
std::vector< editeng::MisspellRange > maRanges
Definition: edtspell.hxx:58
std::vector< editeng::MisspellRange >::const_iterator const_iterator
Definition: edtspell.hxx:66
std::vector< editeng::MisspellRange >::iterator iterator
Definition: edtspell.hxx:65
iterator end()
Definition: edtspell.cxx:469
bool empty() const
Definition: edtspell.cxx:444
size_t mnInvalidEnd
Definition: edtspell.hxx:60
bool HasAnyWrong(size_t nStart, size_t nEnd) const
Definition: edtspell.cxx:350
FormulaCommand pE
#define EDITUNDO_INSERT
Definition: editdata.hxx:72
constexpr TypedWhichId< SvxFieldItem > EE_FEATURE_FIELD(EE_FEATURE_NOTCONV+1)
constexpr TypedWhichId< SfxBoolItem > EE_PARA_BULLETSTATE(EE_PARA_START+9)
constexpr TypedWhichId< SfxInt16Item > EE_PARA_OUTLLEVEL(EE_PARA_START+11)
sal_Int64 n
uno_Any a
sal_uInt16 nPos
#define SAL_WARN_IF(condition, area, stream)
int i
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
Definition: editdoc.hxx:56
sal_Int32 nIndex
Definition: editdoc.hxx:58
sal_Int32 nPara
Definition: editdoc.hxx:57
bool bMultipleDoc
Definition: impedit.hxx:165
EPaM aSpellTo
Definition: impedit.hxx:163
EPaM aSpellStart
Definition: impedit.hxx:162
bool bSpellToEnd
Definition: impedit.hxx:164
LanguageType nLang
Definition: editdata.hxx:350
SvxSpellArea
Definition: svxenum.hxx:133
sal_uInt16 sal_Unicode
sal_Int32 nLength