24#include <osl/diagnose.h>
32#include <com/sun/star/linguistic2/XDictionary.hpp>
43 SAL_WARN_IF( !pView,
"editeng",
"One view has to be abandoned!" );
100 OSL_FAIL(
"SpellStart: Unknown Area!" );
204 bool bRefIsValid =
true;
246 "TextInserted, editeng::MisspellRange: Start >= End?!");
257 const size_t nNewInvalidStart =
nPos ?
nPos - 1 : 0;
276 bool bDelWrong =
false;
277 if (
i->mnEnd >=
nPos)
280 if (
i->mnStart >= nEndPos)
286 else if (
i->mnStart >=
nPos &&
i->mnEnd <= nEndPos)
291 else if (
i->mnStart <=
nPos &&
i->mnEnd >
nPos)
293 if (
i->mnEnd <= nEndPos)
299 else if (
i->mnStart >=
nPos &&
i->mnEnd > nEndPos)
306 "TextDeleted, editeng::MisspellRange: Start >= End?!");
328 if (range.mnEnd > rnStart)
330 rnStart = range.mnStart;
342 if (range.mnStart == nStart && range.mnEnd == nEnd)
344 else if (range.mnStart >= nStart)
354 if (range.mnEnd >= nStart && range.mnStart < nEnd)
356 else if (range.mnStart >= nEnd)
367 if (
i->mnEnd > nStart &&
i->mnStart < nEnd)
374 (pNode->
GetChar(
i->mnStart) ==
' ' ||
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;
415 maRanges.emplace_back(nStart, nEnd);
441 return a.mnStart == b.mnStart && a.mnEnd == b.mnEnd; });
491 return i->mnStart <= rRange.mnEnd && rRange.mnStart <= i->mnEnd; });
502 bAllowUndoAction(cIns != 0),
503 bUndoAction(false) {}
516 "Cursor in the heart of the action?!");
527 "Cursor in the heart of the action?!");
545 sal_Int32 nEnd =
nPos+nSourceLength;
570 pPool->
GetName() !=
"EditEngineItemPool" )
575 sal_uInt16 nWhich = pPool->
GetWhich( nSlotId );
591 const OUString& rURL)
598 "Cursor in the heart of the action?!");
621 bool bBullet = rBulletState.
GetValue();
632 for ( sal_Int32
n =
nPos;
n; )
651 OUString aShort(
pCurNode->
Copy( rSttPos, nEndPos - rSttPos ) );
654 if( aShort.isEmpty() )
664 bool replaceLastChar = pFnd->
GetShort()[0] ==
':' && pFnd->
GetShort().endsWith(
":");
671 "Cursor in the heart of the action?!");
672 nCursor -= ( nEndPos-rSttPos );
sal_Unicode GetChar(sal_Int32 nPos) const
bool IsFeature(sal_Int32 nPos) const
const OUString & GetString() const
OUString Copy(sal_Int32 nPos) const
EditPaM GetEndPaM() const
sal_Int32 GetPos(const ContentNode *pNode) const
SfxItemPool & GetItemPool()
EditPaM GetStartPaM() const
EditPaM DeleteSelection(const EditSelection &rSel)
EditPaM InsertField(const EditSelection &rEditSelection, const SvxFieldItem &rFld)
editeng::LanguageSpan GetLanguage(const EditPaM &rPaM) const
EEControlBits GetControlWord() const
EditSelection InsertText(css::uno::Reference< css::datatransfer::XTransferable > const &rxDataObj, const OUString &rBaseURL, const EditPaM &rPaM, bool bUseSpecial)
virtual bool SpellNextDocument()
const SfxPoolItem & GetParaAttrib(sal_Int32 nPara, sal_uInt16 nWhich) const
const SfxItemSet & GetEmptyItemSet() const
OUString GetSelected(const EditSelection &rSel) const
void UndoActionStart(sal_uInt16 nId)
void SetAttribs(const EditSelection &rSel, const SfxItemSet &rSet, SetAttribsMode nSpecial=SetAttribsMode::NONE)
void SetIndex(sal_Int32 n)
const ContentNode * GetNode() const
EditSpellWrapper(weld::Widget *pWin, bool bIsStart, EditView *pView)
virtual bool SpellMore() override
virtual void SpellStart(SvxSpellArea eArea) override
virtual void SpellContinue() override
virtual void ReplaceAll(const OUString &rNewText) override
ImpEditView * GetImpEditView() const
void InsertText(const OUString &rNew, bool bSelect=false, bool bLOKShowSelect=true)
EditEngine * GetEditEngine() const
ImpEditEngine * GetImpEditEngine() const
virtual OUString const * GetPrevPara(bool bAtNormalPos) override
virtual bool TransliterateRTLWord(sal_Int32 &rSttPos, sal_Int32 nEndPos, bool bApply=false) override
virtual bool ChgAutoCorrWord(sal_Int32 &rSttPos, sal_Int32 nEndPos, SvxAutoCorrect &rACorrect, OUString *pPara) override
virtual ~EdtAutoCorrDoc() override
virtual bool Replace(sal_Int32 nPos, const OUString &rTxt) override
void ImplStartUndoAction()
virtual bool SetINetAttr(sal_Int32 nStt, sal_Int32 nEnd, const OUString &rURL) override
EdtAutoCorrDoc(EditEngine *pE, ContentNode *pCurNode, sal_Int32 nCrsr, sal_Unicode cIns)
virtual bool ReplaceRange(sal_Int32 nPos, sal_Int32 nLen, const OUString &rTxt) override
EditEngine * mpEditEngine
virtual LanguageType GetLanguage(sal_Int32 nPos) const override
virtual bool Insert(sal_Int32 nPos, const OUString &rTxt) override
virtual void SetAttr(sal_Int32 nStt, sal_Int32 nEnd, sal_uInt16 nSlotId, SfxPoolItem &) override
virtual bool Delete(sal_Int32 nStt, sal_Int32 nEnd) override
css::uno::Reference< css::linguistic2::XSpellAlternatives > ImpSpell(EditView *pEditView)
SpellInfo * GetSpellInfo() const
EPaM CreateEPaM(const EditPaM &rPaM) const
const EditSelection & GetEditSelection() const
void SetEditSelection(const EditSelection &rEditSelection)
static css::uno::Reference< css::linguistic2::XDictionary > GetChangeAllList()
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)
const OUString & GetShort() const
const OUString & GetLong() const
This item stores a field (SvxFieldData).
void SetLast(const css::uno::Reference< css::uno::XInterface > &xNewLast)
Keeps track of misspelled ranges in paragraph.
editeng::MisspellRange & back()
static constexpr size_t Valid
void ResetInvalidRange(size_t nStart, size_t nEnd)
void SetInvalidRange(size_t nStart, size_t nEnd)
void TextDeleted(size_t nPos, size_t nLength)
void TextInserted(size_t nPos, size_t nLength, bool bPosIsSep)
bool operator==(const WrongList &rCompare) const
bool HasWrong(size_t nStart, size_t nEnd) const
void push_back(const editeng::MisspellRange &rRange)
WrongList * Clone() const
void ClearWrongs(size_t nStart, size_t nEnd, const ContentNode *pNode)
size_t GetInvalidEnd() const
void InsertWrong(size_t nStart, size_t nEnd)
bool NextWrong(size_t &rnStart, size_t &rnEnd) const
void SetRanges(std::vector< editeng::MisspellRange > &&rRanges)
size_t GetInvalidStart() const
std::vector< editeng::MisspellRange > maRanges
std::vector< editeng::MisspellRange >::const_iterator const_iterator
std::vector< editeng::MisspellRange >::iterator iterator
bool HasAnyWrong(size_t nStart, size_t nEnd) const
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)
#define SAL_WARN_IF(condition, area, stream)
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)