LibreOffice Module sw (master) 1
|
#include <wrong.hxx>
Public Types | |
enum class | FreshState { FRESH , CURSOR , NOTHING } |
Public Member Functions | |
SwWrongList (WrongListType eType) | |
virtual | ~SwWrongList () |
virtual SwWrongList * | Clone () |
virtual void | CopyFrom (const SwWrongList &rCopy) |
WrongListType | GetWrongListType () const |
sal_Int32 | GetBeginInv () const |
sal_Int32 | GetEndInv () const |
void | SetInvalid (sal_Int32 nBegin, sal_Int32 nEnd) |
void | Validate () |
void | Invalidate (sal_Int32 nBegin, sal_Int32 nEnd) |
bool | InvalidateWrong () |
FreshState | Fresh (sal_Int32 &rStart, sal_Int32 &rEnd, sal_Int32 nPos, sal_Int32 nLen, sal_uInt16 nIndex, sal_Int32 nCursorPos) |
Remove given range of entries. More... | |
sal_uInt16 | GetWrongPos (sal_Int32 nValue) const |
Find the first position that is greater or equal to the given value. More... | |
bool | Check (sal_Int32 &rChk, sal_Int32 &rLn) const |
Calculate first incorrectly selected area. More... | |
bool | InWrongWord (sal_Int32 &rChk, sal_Int32 &rLn) const |
If a word is incorrectly selected, this method returns begin and length of it. More... | |
sal_Int32 | NextWrong (sal_Int32 nChk) const |
Find next incorrectly selected position. More... | |
void | Move (sal_Int32 nPos, sal_Int32 nDiff) |
Change all values after the given position. More... | |
void | ClearList () |
std::unique_ptr< SwWrongList > | SplitList (sal_Int32 nSplitPos) |
void | JoinList (SwWrongList *pNext, sal_Int32 nInsertPos) |
sal_Int32 | Len (sal_uInt16 nIdx) const |
sal_Int32 | Pos (sal_uInt16 nIdx) const |
sal_uInt16 | Count () const |
void | Insert (const OUString &rType, css::uno::Reference< css::container::XStringKeyMap > const &xPropertyBag, sal_Int32 nNewPos, sal_Int32 nNewLen, sal_uInt16 nWhere) |
void | Insert (const OUString &rType, css::uno::Reference< css::container::XStringKeyMap > const &xPropertyBag, sal_Int32 nNewPos, sal_Int32 nNewLen) |
SwWrongList * | SubList (sal_uInt16 nIdx) const |
void | InsertSubList (sal_Int32 nNewPos, sal_Int32 nNewLen, sal_uInt16 nWhere, SwWrongList *pSubList) |
const SwWrongArea * | GetElement (sal_uInt16 nIdx) const |
void | RemoveEntry (sal_Int32 nBegin, sal_Int32 nEnd) |
bool | LookForEntry (sal_Int32 nBegin, sal_Int32 nEnd) |
Private Member Functions | |
void | Invalidate_ (sal_Int32 nBegin, sal_Int32 nEnd) |
void | Insert (sal_uInt16 nWhere, std::vector< SwWrongArea >::iterator startPos, std::vector< SwWrongArea >::iterator const &endPos) |
void | Remove (sal_uInt16 nIdx, sal_uInt16 nLen) |
SwWrongList & | operator= (const SwWrongList &)=delete |
SwWrongList (const SwWrongList &rCpy)=delete | |
Static Private Member Functions | |
static void | ShiftLeft (sal_Int32 &rPos, sal_Int32 nStart, sal_Int32 nEnd) |
Private Attributes | |
std::vector< SwWrongArea > | maList |
WrongListType | meType |
sal_Int32 | mnBeginInvalid |
sal_Int32 | mnEndInvalid |
|
strong |
|
privatedelete |
References Clone().
Referenced by Clone(), and SplitList().
SwWrongList::SwWrongList | ( | WrongListType | eType | ) |
|
virtual |
Definition at line 61 of file wrong.cxx.
References ClearList().
bool SwWrongList::Check | ( | sal_Int32 & | rChk, |
sal_Int32 & | rLn | ||
) | const |
Calculate first incorrectly selected area.
[in,out] | rChk | starting position of the word to check |
[in,out] | rLn | length of the word |
Definition at line 127 of file wrong.cxx.
References Count(), GetWrongPos(), Len(), nPos, and Pos().
Referenced by sw::WrongListIterator::Check().
void SwWrongList::ClearList | ( | ) |
Definition at line 86 of file wrong.cxx.
Referenced by SwGrammarMarkUp::ClearGrammarList(), and ~SwWrongList().
|
virtual |
Reimplemented in SwGrammarMarkUp.
Definition at line 66 of file wrong.cxx.
References CopyFrom(), meType, and SwWrongList().
|
virtual |
Reimplemented in SwGrammarMarkUp.
Definition at line 73 of file wrong.cxx.
References i, maList, meType, mnBeginInvalid, and mnEndInvalid.
Referenced by Clone(), SwGrammarMarkUp::Clone(), and SwGrammarMarkUp::CopyFrom().
|
inline |
Definition at line 323 of file wrong.hxx.
Referenced by SwTextFrame::AutoSpell_(), Check(), sw::WrongListIteratorCounter::GetElementAt(), sw::WrongListIteratorCounter::GetElementCount(), GetWrongPos(), InvalidateWrong(), InWrongWord(), JoinList(), lcl_FillRecognizerData(), Move(), NextWrong(), Remove(), SwTextFrame::SmartTagScan(), and SplitList().
auto SwWrongList::Fresh | ( | sal_Int32 & | rStart, |
sal_Int32 & | rEnd, | ||
sal_Int32 | nPos, | ||
sal_Int32 | nLen, | ||
sal_uInt16 | nIndex, | ||
sal_Int32 | nCursorPos | ||
) |
Remove given range of entries.
For a given range [nPos, nPos + nLen[ and an index nIndex, this function basically counts the number of SwWrongArea entries starting with nIndex up to nPos + nLen. All these entries are removed.
rStart | ??? |
rEnd | ??? |
nPos | starting position of the range |
nLen | length of the range |
nIndex | index to start lookup at |
nCursorPos | ??? |
Definition at line 356 of file wrong.cxx.
References Count, nIndex, nPos, Pos, and Remove.
Referenced by SwTextFrame::AutoSpell_(), and SwTextFrame::SmartTagScan().
|
inline |
Definition at line 288 of file wrong.hxx.
Referenced by SwTextFrame::AutoSpell_(), SwGrammarMarkUp::ClearGrammarList(), SwXTextMarkup::commitMultiTextMarkup(), SwXTextMarkup::commitStringMarkup(), Invalidate(), Invalidate_(), JoinList(), Move(), NextWrong(), SwTextFrame::SmartTagScan(), and SplitList().
|
inline |
Definition at line 349 of file wrong.hxx.
Referenced by sw::WrongListIteratorCounter::GetElementAt(), sw::WrongListIteratorCounter::GetElementCount(), sw::WrongListIterator::GetWrongElement(), and lcl_FillRecognizerData().
|
inline |
Definition at line 289 of file wrong.hxx.
Referenced by SwTextFrame::AutoSpell_(), Invalidate_(), JoinList(), NextWrong(), SwTextFrame::SmartTagScan(), and SplitList().
|
inline |
Definition at line 287 of file wrong.hxx.
References meType.
Referenced by SwXTextMarkup::commitStringMarkup(), InsertSubList(), JoinList(), RemoveEntry(), SplitList(), and SwWrongArea::SwWrongArea().
sal_uInt16 SwWrongList::GetWrongPos | ( | sal_Int32 | nValue | ) | const |
Find the first position that is greater or equal to the given value.
[in] | nValue | value for comparison |
Definition at line 191 of file wrong.cxx.
References Count(), Len(), maList, maType, nValue, and Pos().
Referenced by SwTextFrame::AutoSpell_(), Check(), SwXTextMarkup::commitStringMarkup(), SwCursorShell::GetContentAtPos(), SwCursorShell::GetSmartTagTerm(), sw::WrongListIterator::GetWrongElement(), InWrongWord(), lcl_commitGrammarMarkUp(), Move(), NextWrong(), SwTextFrame::SmartTagScan(), and SwTextSlot::SwTextSlot().
void SwWrongList::Insert | ( | const OUString & | rType, |
css::uno::Reference< css::container::XStringKeyMap > const & | xPropertyBag, | ||
sal_Int32 | nNewPos, | ||
sal_Int32 | nNewLen | ||
) |
|
inline |
|
private |
Definition at line 538 of file wrong.cxx.
Referenced by SwTextFrame::AutoSpell_(), SwXTextMarkup::commitStringMarkup(), JoinList(), and lcl_commitGrammarMarkUp().
void SwWrongList::InsertSubList | ( | sal_Int32 | nNewPos, |
sal_Int32 | nNewLen, | ||
sal_uInt16 | nWhere, | ||
SwWrongList * | pSubList | ||
) |
Definition at line 523 of file wrong.cxx.
References GetWrongListType(), i, and maList.
Referenced by SwXTextMarkup::commitStringMarkup(), and lcl_commitGrammarMarkUp().
void SwWrongList::Invalidate | ( | sal_Int32 | nBegin, |
sal_Int32 | nEnd | ||
) |
Definition at line 426 of file wrong.cxx.
References COMPLETE_STRING, GetBeginInv(), Invalidate_(), and SetInvalid().
Referenced by InvalidateWrong(), JoinList(), lcl_SetWrong(), and Move().
|
private |
Definition at line 246 of file wrong.cxx.
References COMPLETE_STRING, GetBeginInv(), GetEndInv(), mnBeginInvalid, and mnEndInvalid.
Referenced by Invalidate(), Move(), and SplitList().
bool SwWrongList::InvalidateWrong | ( | ) |
Definition at line 434 of file wrong.cxx.
References Count(), Invalidate(), Len(), and Pos().
Referenced by lcl_SpellAndGrammarAgain().
bool SwWrongList::InWrongWord | ( | sal_Int32 & | rChk, |
sal_Int32 & | rLn | ||
) | const |
If a word is incorrectly selected, this method returns begin and length of it.
[in,out] | rChk | starting position of the word to check |
[out] | rLn | length of the word |
Definition at line 103 of file wrong.cxx.
References Count(), GetWrongPos(), Len(), nPos, and Pos().
Referenced by SwAccessibleParagraph::_correctValues(), SwTextFrame::AutoSpell_(), SwCursorShell::GetContentAtPos(), SwEditShell::GetCorrection(), SwEditShell::GetGrammarCorrection(), SwVisibleCursor::getLOKPayload(), SwCursorShell::GetSmartTagRect(), and SwCursorShell::GetSmartTagTerm().
void SwWrongList::JoinList | ( | SwWrongList * | pNext, |
sal_Int32 | nInsertPos | ||
) |
Definition at line 490 of file wrong.cxx.
References Count(), GetBeginInv(), GetEndInv(), GetWrongListType(), Insert(), Invalidate(), Len(), maList, Move(), Pos(), and Remove().
Referenced by SwGrammarMarkUp::JoinGrammarList().
|
inline |
Definition at line 313 of file wrong.hxx.
Referenced by SwTextFrame::AutoSpell_(), Check(), GetWrongPos(), InvalidateWrong(), InWrongWord(), JoinList(), lcl_FillRecognizerData(), Move(), NextWrong(), and SplitList().
bool SwWrongList::LookForEntry | ( | sal_Int32 | nBegin, |
sal_Int32 | nEnd | ||
) |
void SwWrongList::Move | ( | sal_Int32 | nPos, |
sal_Int32 | nDiff | ||
) |
Change all values after the given position.
Needed after insert/deletion of characters.
nPos | position after that everything should be changed |
nDiff | amount how much the positions should be moved |
Definition at line 267 of file wrong.cxx.
References COMPLETE_STRING, Count(), GetBeginInv(), GetWrongPos(), i, Invalidate(), Invalidate_(), Len(), maList, mnBeginInvalid, mnEndInvalid, nPos, Pos(), Remove(), SetInvalid(), and ShiftLeft().
Referenced by JoinList(), lcl_SetWrong(), and SwGrammarMarkUp::MoveGrammar().
sal_Int32 SwWrongList::NextWrong | ( | sal_Int32 | nChk | ) | const |
Find next incorrectly selected position.
[in] | rChk | starting position of the word to check |
Definition at line 164 of file wrong.cxx.
References COMPLETE_STRING, Count(), GetBeginInv(), GetEndInv(), GetWrongPos(), Len(), nPos, and Pos().
Referenced by SwTextNode::Spell().
|
privatedelete |
|
inline |
Definition at line 318 of file wrong.hxx.
Referenced by SwTextFrame::AutoSpell_(), Check(), GetWrongPos(), InvalidateWrong(), InWrongWord(), JoinList(), lcl_FillRecognizerData(), Move(), NextWrong(), SplitList(), and SwTextSlot::SwTextSlot().
|
private |
Definition at line 556 of file wrong.cxx.
References Count(), and maList.
Referenced by JoinList(), Move(), RemoveEntry(), and SplitList().
void SwWrongList::RemoveEntry | ( | sal_Int32 | nBegin, |
sal_Int32 | nEnd | ||
) |
Definition at line 586 of file wrong.cxx.
References GetWrongListType(), maList, SwWrongArea::mnLen, SwWrongArea::mnPos, Remove(), and WRONGLIST_GRAMMAR.
Referenced by SwGrammarMarkUp::ClearGrammarList(), and SwEditShell::IgnoreGrammarErrorAt().
void SwWrongList::SetInvalid | ( | sal_Int32 | nBegin, |
sal_Int32 | nEnd | ||
) |
Definition at line 254 of file wrong.cxx.
References mnBeginInvalid, and mnEndInvalid.
Referenced by SwTextFrame::AutoSpell_(), SwGrammarMarkUp::ClearGrammarList(), SwXTextMarkup::commitMultiTextMarkup(), sw::GrammarContact::getGrammarCheck(), Invalidate(), lcl_SetWrong(), lcl_SpellAndGrammarAgain(), Move(), SwTextFrame::SmartTagScan(), and SplitList().
|
inlinestaticprivate |
Definition at line 270 of file wrong.hxx.
Referenced by Move(), and SplitList().
std::unique_ptr< SwWrongList > SwWrongList::SplitList | ( | sal_Int32 | nSplitPos | ) |
Definition at line 446 of file wrong.cxx.
References COMPLETE_STRING, Count(), GetBeginInv(), GetEndInv(), GetWrongListType(), Invalidate_(), Len(), maList, mnBeginInvalid, mnEndInvalid, Pos(), Remove(), SetInvalid(), ShiftLeft(), SwWrongList(), and WRONGLIST_GRAMMAR.
Referenced by SwGrammarMarkUp::SplitGrammarList().
|
inline |
Definition at line 342 of file wrong.hxx.
Referenced by SwXTextMarkup::commitStringMarkup(), SwCursorShell::GetContentAtPos(), SwCursorShell::GetSmartTagTerm(), lcl_commitGrammarMarkUp(), and SwTextSlot::SwTextSlot().
|
inline |
Definition at line 291 of file wrong.hxx.
References COMPLETE_STRING.
Referenced by SwGrammarMarkUp::ClearGrammarList().
|
private |
Definition at line 264 of file wrong.hxx.
Referenced by ClearList(), CopyFrom(), GetWrongPos(), Insert(), InsertSubList(), JoinList(), LookForEntry(), Move(), Remove(), RemoveEntry(), SplitList(), and SwWrongList().
|
private |
Definition at line 265 of file wrong.hxx.
Referenced by Clone(), CopyFrom(), and Insert().
|
private |
Definition at line 267 of file wrong.hxx.
Referenced by CopyFrom(), Invalidate_(), Move(), SetInvalid(), and SplitList().
|
private |
Definition at line 268 of file wrong.hxx.
Referenced by CopyFrom(), Invalidate_(), Move(), SetInvalid(), and SplitList().