LibreOffice Module sw (master)  1
Public Types | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
SwWrongList Class Reference

#include <wrong.hxx>

Inheritance diagram for SwWrongList:
[legend]

Public Types

enum  FreshState {
  FreshState::FRESH,
  FreshState::CURSOR,
  FreshState::NOTHING
}
 

Public Member Functions

 SwWrongList (WrongListType eType)
 
virtual ~SwWrongList ()
 
virtual SwWrongListClone ()
 
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 ()
 
SwWrongListSplitList (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)
 
SwWrongListSubList (sal_uInt16 nIdx) const
 
void InsertSubList (sal_Int32 nNewPos, sal_Int32 nNewLen, sal_uInt16 nWhere, SwWrongList *pSubList)
 
const SwWrongAreaGetElement (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)
 
SwWrongListoperator= (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< SwWrongAreamaList
 
WrongListType meType
 
sal_Int32 mnBeginInvalid
 
sal_Int32 mnEndInvalid
 

Detailed Description

Definition at line 266 of file wrong.hxx.

Member Enumeration Documentation

Enumerator
FRESH 
CURSOR 
NOTHING 

Definition at line 298 of file wrong.hxx.

Constructor & Destructor Documentation

SwWrongList::SwWrongList ( const SwWrongList rCpy)
privatedelete

Referenced by Clone(), and SplitList().

SwWrongList::SwWrongList ( WrongListType  eType)

Definition at line 52 of file wrong.cxx.

References maList, and meType.

SwWrongList::~SwWrongList ( )
virtual

Definition at line 60 of file wrong.cxx.

References ClearList().

Member Function Documentation

bool SwWrongList::Check ( sal_Int32 &  rChk,
sal_Int32 &  rLn 
) const

Calculate first incorrectly selected area.

Parameters
[in,out]rChkstarting position of the word to check
[in,out]rLnlength of the word
Returns
<true> if incorrectly selected area was found, <false> otherwise

Definition at line 126 of file wrong.cxx.

References Count(), GetWrongPos(), Len(), nPos, and Pos().

Referenced by sw::WrongListIterator::Check().

void SwWrongList::ClearList ( )

Definition at line 85 of file wrong.cxx.

References i, and maList.

Referenced by SwGrammarMarkUp::ClearGrammarList(), and ~SwWrongList().

SwWrongList * SwWrongList::Clone ( )
virtual

Reimplemented in SwGrammarMarkUp.

Definition at line 65 of file wrong.cxx.

References CopyFrom(), meType, and SwWrongList().

void SwWrongList::CopyFrom ( const SwWrongList rCopy)
virtual

Reimplemented in SwGrammarMarkUp.

Definition at line 72 of file wrong.cxx.

References i, maList, meType, mnBeginInvalid, and mnEndInvalid.

Referenced by SwGrammarMarkUp::Clone(), Clone(), and SwGrammarMarkUp::CopyFrom().

sal_uInt16 SwWrongList::Count ( ) const
inline
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.

Parameters
rStart???
rEnd???
nPosstarting position of the range
nLenlength of the range
nIndexindex to start lookup at
nCursorPos???
Returns
<true> if ???

Definition at line 355 of file wrong.cxx.

References Count, nPos, Pos, and Remove.

Referenced by SwTextFrame::AutoSpell_(), and SwTextFrame::SmartTagScan().

sal_Int32 SwWrongList::GetBeginInv ( ) const
inline
const SwWrongArea* SwWrongList::GetElement ( sal_uInt16  nIdx) const
inline
sal_Int32 SwWrongList::GetEndInv ( ) const
inline
WrongListType SwWrongList::GetWrongListType ( ) const
inline
sal_uInt16 SwWrongList::GetWrongPos ( sal_Int32  nValue) const

Find the first position that is greater or equal to the given value.

Note
Resulting position might be behind the last element of the array.
Parameters
[in]nValuevalue for comparison
Returns
first position that is greater or equal to the given value

Definition at line 190 of file wrong.cxx.

References Count(), Len(), maList, maType, and Pos().

Referenced by SwTextFrame::AutoSpell_(), Check(), SwXTextMarkup::commitStringMarkup(), SwCursorShell::GetContentAtPos(), SwCursorShell::GetSmartTagTerm(), sw::WrongListIterator::GetWrongElement(), InWrongWord(), lcl_commitGrammarMarkUp(), Move(), NextWrong(), and SwTextFrame::SmartTagScan().

void SwWrongList::Insert ( sal_uInt16  nWhere,
std::vector< SwWrongArea >::iterator  startPos,
std::vector< SwWrongArea >::iterator const &  endPos 
)
private

Definition at line 537 of file wrong.cxx.

References i, and maList.

Referenced by SwTextFrame::AutoSpell_(), SwXTextMarkup::commitStringMarkup(), JoinList(), and SplitList().

void SwWrongList::Insert ( const OUString &  rType,
css::uno::Reference< css::container::XStringKeyMap > const &  xPropertyBag,
sal_Int32  nNewPos,
sal_Int32  nNewLen,
sal_uInt16  nWhere 
)
inline

Definition at line 329 of file wrong.hxx.

References i.

Referenced by lcl_commitGrammarMarkUp().

void SwWrongList::Insert ( const OUString &  rType,
css::uno::Reference< css::container::XStringKeyMap > const &  xPropertyBag,
sal_Int32  nNewPos,
sal_Int32  nNewLen 
)

Definition at line 621 of file wrong.cxx.

References maList, and meType.

void SwWrongList::InsertSubList ( sal_Int32  nNewPos,
sal_Int32  nNewLen,
sal_uInt16  nWhere,
SwWrongList pSubList 
)

Definition at line 522 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 425 of file wrong.cxx.

References COMPLETE_STRING, GetBeginInv(), Invalidate_(), and SetInvalid().

Referenced by InvalidateWrong(), JoinList(), lcl_SetWrong(), and Move().

void SwWrongList::Invalidate_ ( sal_Int32  nBegin,
sal_Int32  nEnd 
)
private

Definition at line 245 of file wrong.cxx.

References COMPLETE_STRING, GetBeginInv(), GetEndInv(), mnBeginInvalid, and mnEndInvalid.

Referenced by Invalidate(), Move(), and SplitList().

bool SwWrongList::InvalidateWrong ( )

Definition at line 433 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.

Parameters
[in,out]rChkstarting position of the word to check
[out]rLnlength of the word
Returns
<true> if incorrectly selected, <false> otherwise

Definition at line 102 of file wrong.cxx.

References Count(), GetWrongPos(), Len(), nPos, and Pos().

Referenced by SwAccessibleParagraph::_correctValues(), SwTextFrame::AutoSpell_(), SwCursorShell::GetContentAtPos(), SwEditShell::GetCorrection(), SwEditShell::GetGrammarCorrection(), SwCursorShell::GetSmartTagRect(), and SwCursorShell::GetSmartTagTerm().

void SwWrongList::JoinList ( SwWrongList pNext,
sal_Int32  nInsertPos 
)
sal_Int32 SwWrongList::Len ( sal_uInt16  nIdx) const
inline
bool SwWrongList::LookForEntry ( sal_Int32  nBegin,
sal_Int32  nEnd 
)

Definition at line 613 of file wrong.cxx.

References maList.

Referenced by lcl_syncGrammarError().

void SwWrongList::Move ( sal_Int32  nPos,
sal_Int32  nDiff 
)

Change all values after the given position.

Needed after insert/deletion of characters.

Parameters
nPosposition after that everything should be changed
nDiffamount how much the positions should be moved

Definition at line 266 of file wrong.cxx.

References COMPLETE_STRING, Count(), GetBeginInv(), GetWrongPos(), i, Invalidate(), Invalidate_(), Len(), maList, mnBeginInvalid, mnEndInvalid, Pos(), Remove(), SetInvalid(), and ShiftLeft().

Referenced by JoinList(), SwTextNode::JoinNext(), SwTextNode::JoinPrev(), lcl_SetWrong(), and SwGrammarMarkUp::MoveGrammar().

sal_Int32 SwWrongList::NextWrong ( sal_Int32  nChk) const

Find next incorrectly selected position.

Parameters
[in]rChkstarting position of the word to check
Returns
starting position of incorrectly selected area, <COMPLETE_STRING> otherwise

Definition at line 163 of file wrong.cxx.

References COMPLETE_STRING, Count(), GetBeginInv(), GetEndInv(), GetWrongPos(), Len(), nPos, and Pos().

Referenced by SwTextNode::Spell().

SwWrongList& SwWrongList::operator= ( const SwWrongList )
privatedelete
sal_Int32 SwWrongList::Pos ( sal_uInt16  nIdx) const
inline
void SwWrongList::Remove ( sal_uInt16  nIdx,
sal_uInt16  nLen 
)
private

Definition at line 555 of file wrong.cxx.

References Count(), and maList.

Referenced by JoinList(), Move(), RemoveEntry(), and SplitList().

void SwWrongList::RemoveEntry ( sal_Int32  nBegin,
sal_Int32  nEnd 
)
void SwWrongList::SetInvalid ( sal_Int32  nBegin,
sal_Int32  nEnd 
)
static void SwWrongList::ShiftLeft ( sal_Int32 &  rPos,
sal_Int32  nStart,
sal_Int32  nEnd 
)
inlinestaticprivate

Definition at line 274 of file wrong.hxx.

Referenced by Move(), and SplitList().

SwWrongList * SwWrongList::SplitList ( sal_Int32  nSplitPos)
SwWrongList* SwWrongList::SubList ( sal_uInt16  nIdx) const
inline
void SwWrongList::Validate ( )
inline

Definition at line 295 of file wrong.hxx.

References COMPLETE_STRING.

Referenced by SwGrammarMarkUp::ClearGrammarList().

Member Data Documentation

std::vector<SwWrongArea> SwWrongList::maList
private
WrongListType SwWrongList::meType
private

Definition at line 269 of file wrong.hxx.

Referenced by Clone(), CopyFrom(), GetWrongListType(), and Insert().

sal_Int32 SwWrongList::mnBeginInvalid
private

Definition at line 271 of file wrong.hxx.

Referenced by CopyFrom(), GetBeginInv(), Invalidate_(), Move(), SetInvalid(), and SplitList().

sal_Int32 SwWrongList::mnEndInvalid
private

Definition at line 272 of file wrong.hxx.

Referenced by CopyFrom(), GetEndInv(), Invalidate_(), Move(), SetInvalid(), and SplitList().


The documentation for this class was generated from the following files: