22 #include <osl/diagnose.h>
35 maStartPaM( rPaM ), maEndPaM( rPaM )
40 maStartPaM( rStart ), maEndPaM( rEnd )
128 sal_Int32 nTmpPos = 0;
129 for ( std::size_t nPortion = 0; nPortion <
maPortions.size(); nPortion++ )
132 nTmpPos += rPortion.
GetLen();
133 if ( nTmpPos >= nCharPos )
136 if ( ( nTmpPos != nCharPos ) || !bPreferStartingPortion || ( nPortion ==
maPortions.size() - 1 ) )
138 nPortionStart = nTmpPos - rPortion.
GetLen();
143 OSL_FAIL(
"FindPortion: Not found!" );
149 , mnInvalidPosStart {0}
183 SAL_WARN_IF( ( nDiff < 0 ) && ( (nStart+nDiff) < 0 ),
"vcl",
"MarkInvalid: Diff out of Range" );
215 for ( std::vector<TextLine>::size_type nLine = 0; nLine <
maLines.size(); nLine++ )
218 if ( ( bInclEnd && ( rLine.
GetEnd() >= nChar ) ) ||
219 ( rLine.
GetEnd() > nChar ) )
226 OSL_ENSURE(nChar ==
maLines.back().GetEnd(),
"wrong Index");
227 OSL_ENSURE(!bInclEnd,
"Line not found: FindLine");
233 sal_uInt16 nLines =
maLines.size();
234 SAL_WARN_IF( !nLines,
"vcl",
"CorrectPortionNumbersFromLine: Empty portion?" );
235 if ( nLastFormattedLine >= ( nLines - 1 ) )
241 sal_Int32 nTextDiff = rUnformatted.
GetStart() - rLastFormatted.
GetEnd();
247 std::ptrdiff_t nPDiff = -( nPortionDiff-1 );
248 const sal_Int32 nTDiff = -( nTextDiff-1 );
249 if ( !(nPDiff || nTDiff) )
252 for ( sal_uInt16 nL = nLastFormattedLine+1; nL < nLines; nL++ )
271 :
Idle(
"vcl::TextEngine mpIdleFormatter")
320 : aOldTextAfterStartPos(rOldTextAfterStartPos)
323 , bWasCursorOverwrite(
false)
std::size_t GetStartPortion() const
void CopyAttribs(const ExtTextInputAttr *pA, sal_Int32 nL)
std::vector< TETextPortion >::iterator erase(const std::vector< TETextPortion >::iterator &aIter)
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)
std::vector< TETextPortion >::iterator end()
void push_back(const TETextPortion &aTP)
sal_Int32 mnInvalidPosStart
std::vector< TETextPortion > maPortions
std::vector< TextLine > maLines
void CorrectValuesBehindLastFormattedLine(sal_uInt16 nLastFormattedLine)
TEParaPortion(TextNode *pNode)
void MarkInvalid(sal_Int32 nStart, sal_Int32 nDiff)
TETextPortion & operator[](std::size_t nPos)
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)
std::vector< TETextPortion >::iterator begin()
#define SAL_WARN_IF(condition, area, stream)
std::vector< TEWritingDirectionInfo > maWritingDirectionInfos
TEIMEInfos(const TextPaM &rPos, const OUString &rOldTextAfterStartPos)
virtual void Start(bool bStartTimer=true) override
Schedules the task for execution.
sal_Int32 GetStart() const
void SetPriority(TaskPriority ePriority)
std::vector< TETextPortion >::iterator insert(const std::vector< TETextPortion >::iterator &aIter, const TETextPortion &rTP)
std::size_t GetEndPortion() const
An idle is a timer to be scheduled immediately.
bool m_bDetectedRangeSegmentation false