22 #include <osl/diagnose.h>
36 maStartPaM( rPaM ), maEndPaM( rPaM )
41 maStartPaM( rStart ), maEndPaM( rEnd )
99 std::vector<std::unique_ptr<TETextPortion>>::iterator
TETextPortionList::erase(
const std::vector<std::unique_ptr<TETextPortion>>::iterator& aIter )
104 std::vector<std::unique_ptr<TETextPortion>>::iterator
TETextPortionList::insert(
const std::vector<std::unique_ptr<TETextPortion>>::iterator& aIter,
105 std::unique_ptr<TETextPortion> pTP )
107 return maPortions.insert( aIter, std::move(pTP) );
129 sal_Int32 nTmpPos = 0;
130 for ( std::size_t nPortion = 0; nPortion <
maPortions.size(); nPortion++ )
133 nTmpPos += pPortion->
GetLen();
134 if ( nTmpPos >= nCharPos )
137 if ( ( nTmpPos != nCharPos ) || !bPreferStartingPortion || ( nPortion ==
maPortions.size() - 1 ) )
139 nPortionStart = nTmpPos - pPortion->
GetLen();
144 OSL_FAIL(
"FindPortion: Not found!" );
150 , mnInvalidPosStart {0}
184 SAL_WARN_IF( ( nDiff < 0 ) && ( (nStart+nDiff) < 0 ),
"vcl",
"MarkInvalid: Diff out of Range" );
216 for ( std::vector<TextLine>::size_type nLine = 0; nLine <
maLines.size(); nLine++ )
219 if ( ( bInclEnd && ( rLine.
GetEnd() >= nChar ) ) ||
220 ( rLine.
GetEnd() > nChar ) )
227 OSL_ENSURE(nChar ==
maLines.back().GetEnd(),
"wrong Index");
228 OSL_ENSURE(!bInclEnd,
"Line not found: FindLine");
234 sal_uInt16 nLines =
maLines.size();
235 SAL_WARN_IF( !nLines,
"vcl",
"CorrectPortionNumbersFromLine: Empty portion?" );
236 if ( nLastFormattedLine >= ( nLines - 1 ) )
242 sal_Int32 nTextDiff = rUnformatted.
GetStart() - rLastFormatted.
GetEnd();
248 std::ptrdiff_t nPDiff = -( nPortionDiff-1 );
249 const sal_Int32 nTDiff = -( nTextDiff-1 );
250 if ( !(nPDiff || nTDiff) )
253 for ( sal_uInt16 nL = nLastFormattedLine+1; nL < nLines; nL++ )
320 : aOldTextAfterStartPos(rOldTextAfterStartPos)
323 , bWasCursorOverwrite(false)
std::size_t GetStartPortion() const
TETextPortion * operator[](std::size_t nPos)
void CopyAttribs(const ExtTextInputAttr *pA, sal_Int32 nL)
std::vector< std::unique_ptr< TETextPortion > >::iterator insert(const std::vector< std::unique_ptr< TETextPortion >>::iterator &aIter, std::unique_ptr< TETextPortion > pTP)
std::vector< std::unique_ptr< TETextPortion > >::iterator begin()
std::unique_ptr< ExtTextInputAttr[]> pAttribs
Important idle events to be run before processing drawing events.
void SetStart(sal_Int32 n)
void SetEndPortion(std::size_t n)
sal_Int32 mnInvalidPosStart
std::vector< std::unique_ptr< TETextPortion > >::iterator end()
std::vector< TextLine > maLines
void CorrectValuesBehindLastFormattedLine(sal_uInt16 nLastFormattedLine)
TEParaPortion(TextNode *pNode)
virtual void Start() override
Activates the timer task.
void MarkInvalid(sal_Int32 nStart, sal_Int32 nDiff)
std::vector< std::unique_ptr< TETextPortion > > maPortions
virtual void Invoke() override
Calls the maInvokeHandler with the parameter this.
void MarkSelectionInvalid(sal_Int32 nStart)
std::vector< TextLine >::size_type GetLineNumber(sal_Int32 nIndex, bool bInclEnd)
std::size_t FindPortion(sal_Int32 nCharPos, sal_Int32 &rPortionStart, bool bPreferStartingPortion=false)
void DeleteFromPortion(std::size_t nDelFrom)
void SetStartPortion(std::size_t n)
#define SAL_WARN_IF(condition, area, stream)
std::vector< TEWritingDirectionInfo > maWritingDirectionInfos
void push_back(std::unique_ptr< TETextPortion > pTP)
TEIMEInfos(const TextPaM &rPos, const OUString &rOldTextAfterStartPos)
sal_Int32 GetStart() const
void SetPriority(TaskPriority ePriority)
std::vector< std::unique_ptr< TETextPortion > >::iterator erase(const std::vector< std::unique_ptr< TETextPortion >>::iterator &aIter)
std::size_t GetEndPortion() const