LibreOffice Module sw (master)  1
itrcrsr.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include <hintids.hxx>
21 #include <ndtxt.hxx>
22 #include <doc.hxx>
23 #include <frmfmt.hxx>
24 #include <paratr.hxx>
25 #include <flyfrm.hxx>
26 #include <pam.hxx>
27 #include <swselectionlist.hxx>
28 #include <sortedobjs.hxx>
29 #include <editeng/protitem.hxx>
30 #include <editeng/adjustitem.hxx>
31 #include <editeng/lspcitem.hxx>
32 #include <editeng/lrspitem.hxx>
33 #include <editeng/borderline.hxx>
34 #include <frmatr.hxx>
35 #include <pagedesc.hxx>
36 #include <tgrditem.hxx>
38 #include <pagefrm.hxx>
39 
40 #include "itrtxt.hxx"
41 #include <txtfrm.hxx>
42 #include <flyfrms.hxx>
43 #include "porglue.hxx"
44 #include "porfld.hxx"
45 #include "porfly.hxx"
46 #include "pordrop.hxx"
47 #include <crstate.hxx>
48 #include "pormulti.hxx"
49 #include <numrule.hxx>
50 #include <com/sun/star/i18n/ScriptType.hpp>
51 
52 // Not reentrant !!!
53 // is set in GetCharRect and is interpreted in UnitUp/Down.
54 bool SwTextCursor::bRightMargin = false;
55 
56 // After calculating the position of a character during GetCharRect
57 // this function allows to find the coordinates of a position (defined
58 // in pCMS->pSpecialPos) inside a special portion (e.g., a field)
60  const SwCursorMoveState& rCMS,
61  const SwLinePortion& rPor )
62 {
63  OSL_ENSURE( rCMS.m_pSpecialPos, "Information about special pos missing" );
64 
65  if ( rPor.InFieldGrp() && !static_cast<const SwFieldPortion&>(rPor).GetExp().isEmpty() )
66  {
67  const sal_Int32 nCharOfst = rCMS.m_pSpecialPos->nCharOfst;
68  sal_Int32 nFieldIdx = 0;
69  sal_Int32 nFieldLen = 0;
70 
71  OUString sString;
72  const OUString* pString = nullptr;
73  const SwLinePortion* pPor = &rPor;
74  do
75  {
76  if ( pPor->InFieldGrp() )
77  {
78  sString = static_cast<const SwFieldPortion*>(pPor)->GetExp();
79  pString = &sString;
80  nFieldLen = pString->getLength();
81  }
82  else
83  {
84  pString = nullptr;
85  nFieldLen = 0;
86  }
87 
88  if ( ! pPor->GetNextPortion() || nFieldIdx + nFieldLen > nCharOfst )
89  break;
90 
91  nFieldIdx = nFieldIdx + nFieldLen;
92  rOrig.Pos().AdjustX(pPor->Width() );
93  pPor = pPor->GetNextPortion();
94 
95  } while ( true );
96 
97  OSL_ENSURE( nCharOfst >= nFieldIdx, "Request of position inside field failed" );
98  sal_Int32 nLen = nCharOfst - nFieldIdx + 1;
99 
100  if ( pString )
101  {
102  // get script for field portion
103  rInf.GetFont()->SetActual( SwScriptInfo::WhichFont(0, *pString) );
104 
105  TextFrameIndex const nOldLen = pPor->GetLen();
106  const_cast<SwLinePortion*>(pPor)->SetLen(TextFrameIndex(nLen - 1));
107  const SwTwips nX1 = pPor->GetLen() ?
108  pPor->GetTextSize( rInf ).Width() :
109  0;
110 
111  SwTwips nX2 = 0;
112  if ( rCMS.m_bRealWidth )
113  {
114  const_cast<SwLinePortion*>(pPor)->SetLen(TextFrameIndex(nLen));
115  nX2 = pPor->GetTextSize( rInf ).Width();
116  }
117 
118  const_cast<SwLinePortion*>(pPor)->SetLen( nOldLen );
119 
120  rOrig.Pos().AdjustX(nX1 );
121  rOrig.Width( ( nX2 > nX1 ) ?
122  ( nX2 - nX1 ) :
123  1 );
124  }
125  }
126  else
127  {
128  // special cases: no common fields, e.g., graphic number portion,
129  // FlyInCntPortions, Notes
130  rOrig.Width( rCMS.m_bRealWidth && rPor.Width() ? rPor.Width() : 1 );
131  }
132 }
133 
134 // #i111284#
135 namespace {
136  bool AreListLevelIndentsApplicableAndLabelAlignmentActive( const SwTextNode& rTextNode )
137  {
138  bool bRet( false );
139 
140  if ( rTextNode.GetNumRule() && rTextNode.AreListLevelIndentsApplicable() )
141  {
142  int nListLevel = rTextNode.GetActualListLevel();
143 
144  if (nListLevel < 0)
145  nListLevel = 0;
146 
147  if (nListLevel >= MAXLEVEL)
148  nListLevel = MAXLEVEL - 1;
149 
150  const SwNumFormat& rNumFormat =
151  rTextNode.GetNumRule()->Get( static_cast<sal_uInt16>(nListLevel) );
153  {
154  bRet = true;
155  }
156  }
157 
158  return bRet;
159  }
160 } // end of anonymous namespace
161 
163 {
164  CtorInitTextIter( pNewFrame, pNewInf );
165 
166  m_pInf = pNewInf;
167  GetInfo().SetFont( GetFnt() );
168  const SwTextNode *const pNode = m_pFrame->GetTextNodeForParaProps();
169 
170  const SvxLRSpaceItem &rSpace = pNode->GetSwAttrSet().GetLRSpace();
171  // #i95907#
172  // #i111284#
173  const bool bListLevelIndentsApplicableAndLabelAlignmentActive(
174  AreListLevelIndentsApplicableAndLabelAlignmentActive( *(m_pFrame->GetTextNodeForParaProps()) ) );
175 
176  // Carefully adjust the text formatting ranges.
177 
178  // This whole area desperately needs some rework. There are
179  // quite a couple of values that need to be considered:
180  // 1. paragraph indent
181  // 2. paragraph first line indent
182  // 3. numbering indent
183  // 4. numbering spacing to text
184  // 5. paragraph border
185  // Note: These values have already been used during calculation
186  // of the printing area of the paragraph.
187  const int nLMWithNum = pNode->GetLeftMarginWithNum( true );
188  if ( m_pFrame->IsRightToLeft() )
189  {
190  // this calculation is identical this the calculation for L2R layout - see below
193  nLMWithNum -
194  pNode->GetLeftMarginWithNum() -
195  // #i95907#
196  // #i111284#
197  // rSpace.GetLeft() + rSpace.GetTextLeft();
198  ( bListLevelIndentsApplicableAndLabelAlignmentActive
199  ? 0
200  : ( rSpace.GetLeft() - rSpace.GetTextLeft() ) );
201  }
202  else
203  {
204  // #i95907#
205  // #i111284#
206  if ( bListLevelIndentsApplicableAndLabelAlignmentActive ||
208  {
209  // this calculation is identical this the calculation for R2L layout - see above
212  nLMWithNum -
213  pNode->GetLeftMarginWithNum() -
214  // #i95907#
215  // #i111284#
216  ( bListLevelIndentsApplicableAndLabelAlignmentActive
217  ? 0
218  : ( rSpace.GetLeft() - rSpace.GetTextLeft() ) );
219  }
220  else
221  {
223  std::max( long( rSpace.GetTextLeft() + nLMWithNum ),
225  }
226  }
227 
229 
230  if( nLeft >= nRight &&
231  // #i53066# Omit adjustment of nLeft for numbered
232  // paras inside cells inside new documents:
234  !m_pFrame->IsInTab() ||
235  !nLMWithNum ) )
236  {
238  if( nLeft >= nRight ) // e.g. with large paragraph indentations in slim table columns
239  nRight = nLeft + 1; // einen goennen wir uns immer
240  }
241 
242  if( m_pFrame->IsFollow() && m_pFrame->GetOfst() )
243  nFirst = nLeft;
244  else
245  {
246  short nFLOfst = 0;
247  long nFirstLineOfs = 0;
248  if( !pNode->GetFirstLineOfsWithNum( nFLOfst ) &&
249  rSpace.IsAutoFirst() )
250  {
251  nFirstLineOfs = GetFnt()->GetSize( GetFnt()->GetActual() ).Height();
252  LanguageType const aLang = m_pFrame->GetLangOfChar(
253  TextFrameIndex(0), css::i18n::ScriptType::ASIAN);
254  if (aLang != LANGUAGE_KOREAN && aLang != LANGUAGE_JAPANESE)
255  nFirstLineOfs<<=1;
256 
257  const SvxLineSpacingItem *pSpace = m_aLineInf.GetLineSpacing();
258  if( pSpace )
259  {
260  switch( pSpace->GetLineSpaceRule() )
261  {
262  case SvxLineSpaceRule::Auto:
263  break;
264  case SvxLineSpaceRule::Min:
265  {
266  if( nFirstLineOfs < pSpace->GetLineHeight() )
267  nFirstLineOfs = pSpace->GetLineHeight();
268  break;
269  }
270  case SvxLineSpaceRule::Fix:
271  nFirstLineOfs = pSpace->GetLineHeight();
272  break;
273  default: OSL_FAIL( ": unknown LineSpaceRule" );
274  }
275  switch( pSpace->GetInterLineSpaceRule() )
276  {
277  case SvxInterLineSpaceRule::Off:
278  break;
279  case SvxInterLineSpaceRule::Prop:
280  {
281  long nTmp = pSpace->GetPropLineSpace();
282  // 50% is the minimum, at 0% we switch to
283  // the default value 100%...
284  if( nTmp < 50 )
285  nTmp = nTmp ? 50 : 100;
286 
287  nTmp *= nFirstLineOfs;
288  nTmp /= 100;
289  if( !nTmp )
290  ++nTmp;
291  nFirstLineOfs = nTmp;
292  break;
293  }
294  case SvxInterLineSpaceRule::Fix:
295  {
296  nFirstLineOfs += pSpace->GetInterLineSpace();
297  break;
298  }
299  default: OSL_FAIL( ": unknown InterLineSpaceRule" );
300  }
301  }
302  }
303  else
304  nFirstLineOfs = nFLOfst;
305 
306  // #i95907#
307  // #i111284#
308  if ( m_pFrame->IsRightToLeft() ||
309  bListLevelIndentsApplicableAndLabelAlignmentActive ||
311  {
312  nFirst = nLeft + nFirstLineOfs;
313  }
314  else
315  {
317  std::max( rSpace.GetTextLeft() + nLMWithNum+ nFirstLineOfs,
319  }
320 
321  // Note: <SwTextFrame::GetAdditionalFirstLineOffset()> returns a negative
322  // value for the new list label position and space mode LABEL_ALIGNMENT
323  // and label alignment CENTER and RIGHT in L2R layout respectively
324  // label alignment LEFT and CENTER in R2L layout
326 
327  if( nFirst >= nRight )
328  nFirst = nRight - 1;
329  }
331  nAdjust = rAdjust.GetAdjust();
332 
333  // left is left and right is right
334  if ( m_pFrame->IsRightToLeft() )
335  {
336  if ( SvxAdjust::Left == nAdjust )
337  nAdjust = SvxAdjust::Right;
338  else if ( SvxAdjust::Right == nAdjust )
339  nAdjust = SvxAdjust::Left;
340  }
341 
342  m_bOneBlock = rAdjust.GetOneWord() == SvxAdjust::Block;
343  m_bLastBlock = rAdjust.GetLastBlock() == SvxAdjust::Block;
344  m_bLastCenter = rAdjust.GetLastBlock() == SvxAdjust::Center;
345 
346  // #i91133#
348 
349  DropInit();
350 }
351 
353 {
355  const SwParaPortion *pPara = GetInfo().GetParaPortion();
356  if( pPara )
357  {
358  const SwDropPortion *pPorDrop = pPara->FindDropPortion();
359  if ( pPorDrop )
360  {
361  nDropLeft = pPorDrop->GetDropLeft();
362  nDropLines = pPorDrop->GetLines();
363  nDropHeight = pPorDrop->GetDropHeight();
364  nDropDescent = pPorDrop->GetDropDescent();
365  }
366  }
367 }
368 
369 // The function is interpreting / observing / evaluating / keeping / respecting the first line indention and the specified width.
371 {
372  SwTwips nRet = GetLeftMargin();
373  if( GetAdjust() != SvxAdjust::Left &&
375  {
376  // If the first portion is a Margin, then the
377  // adjustment is expressed by the portions.
378  if( GetAdjust() == SvxAdjust::Right )
379  nRet = Right() - CurrWidth();
380  else if( GetAdjust() == SvxAdjust::Center )
381  nRet += (GetLineWidth() - CurrWidth()) / 2;
382  }
383  return nRet;
384 }
385 
387 {
388  CtorInitTextMargin( pNewFrame, pNewInf );
389  // 6096: Attention, the iterators are derived!
390  // GetInfo().SetOut( GetInfo().GetWin() );
391 }
392 
393 // 1170: Ancient bug: Shift-End forgets the last character ...
395  SwCursorMoveState* pCMS, const long nMax )
396 {
397  // 1170: Ambiguity of document positions
398  bRightMargin = true;
399  CharCursorToLine(nOfst);
400 
401  // Somehow twisted: nOfst names the position behind the last
402  // character of the last line == This is the position in front of the first character
403  // of the line, in which we are situated:
404  if( nOfst != GetStart() || !m_pCurr->GetLen() )
405  {
406  // 8810: Master line RightMargin, after that LeftMargin
407  GetCharRect( pOrig, nOfst, pCMS, nMax );
408  bRightMargin = nOfst >= GetEnd() && nOfst < TextFrameIndex(GetInfo().GetText().getLength());
409  return;
410  }
411 
412  if( !GetPrev() || !GetPrev()->GetLen() || !PrevLine() )
413  {
414  GetCharRect( pOrig, nOfst, pCMS, nMax );
415  return;
416  }
417 
418  // If necessary, as catch up, do the adjustment
419  GetAdjusted();
420 
421  long nX = 0;
422  long nLast = 0;
424 
425  sal_uInt16 nTmpHeight, nTmpAscent;
426  CalcAscentAndHeight( nTmpAscent, nTmpHeight );
427  sal_uInt16 nPorHeight = nTmpHeight;
428  sal_uInt16 nPorAscent = nTmpAscent;
429 
430  // Search for the last Text/EndPortion of the line
431  while( pPor )
432  {
433  nX = nX + pPor->Width();
434  if( pPor->InTextGrp() || ( pPor->GetLen() && !pPor->IsFlyPortion()
435  && !pPor->IsHolePortion() ) || pPor->IsBreakPortion() )
436  {
437  nLast = nX;
438  nPorHeight = pPor->Height();
439  nPorAscent = pPor->GetAscent();
440  }
441  pPor = pPor->GetNextPortion();
442  }
443 
444  const Size aCharSize( 1, nTmpHeight );
445  pOrig->Pos( GetTopLeft() );
446  pOrig->SSize( aCharSize );
447  pOrig->Pos().AdjustX(nLast );
448  const SwTwips nTmpRight = Right() - 1;
449  if( pOrig->Left() > nTmpRight )
450  pOrig->Pos().setX( nTmpRight );
451 
452  if ( pCMS && pCMS->m_bRealHeight )
453  {
454  if ( nTmpAscent > nPorAscent )
455  pCMS->m_aRealHeight.setX( nTmpAscent - nPorAscent );
456  else
457  pCMS->m_aRealHeight.setX( 0 );
458  OSL_ENSURE( nPorHeight, "GetCharRect: Missing Portion-Height" );
459  pCMS->m_aRealHeight.setY( nPorHeight );
460  }
461 }
462 
463 // internal function, called by SwTextCursor::GetCharRect() to calculate
464 // the relative character position in the current line.
465 // pOrig referes to x and y coordinates, width and height of the cursor
466 // pCMS is used for restricting the cursor, if there are different font
467 // heights in one line ( first value = offset to y of pOrig, second
468 // value = real height of (shortened) cursor
470  SwCursorMoveState* pCMS )
471 {
472  const OUString aText = GetInfo().GetText();
473  SwTextSizeInfo aInf( GetInfo(), &aText, m_nStart );
474  if( GetPropFont() )
475  aInf.GetFont()->SetProportion( GetPropFont() );
476  sal_uInt16 nTmpAscent, nTmpHeight; // Line height
477  CalcAscentAndHeight( nTmpAscent, nTmpHeight );
478  const Size aCharSize( 1, nTmpHeight );
479  const Point aCharPos;
480  pOrig->Pos( aCharPos );
481  pOrig->SSize( aCharSize );
482 
483  // If we are looking for a position inside a field which covers
484  // more than one line we may not skip any "empty portions" at the
485  // beginning of a line
486  const bool bInsideFirstField = pCMS && pCMS->m_pSpecialPos &&
487  ( pCMS->m_pSpecialPos->nLineOfst ||
489  pCMS->m_pSpecialPos->nExtendRange );
490 
491  bool bWidth = pCMS && pCMS->m_bRealWidth;
492  if( !m_pCurr->GetLen() && !m_pCurr->Width() )
493  {
494  if ( pCMS && pCMS->m_bRealHeight )
495  {
496  pCMS->m_aRealHeight.setX( 0 );
497  pCMS->m_aRealHeight.setY( nTmpHeight );
498  }
499  }
500  else
501  {
502  sal_uInt16 nPorHeight = nTmpHeight;
503  sal_uInt16 nPorAscent = nTmpAscent;
504  SwTwips nX = 0;
505  SwTwips nTmpFirst = 0;
507  SwBidiPortion* pLastBidiPor = nullptr;
508  TextFrameIndex nLastBidiIdx(-1);
509  SwTwips nLastBidiPorWidth = 0;
510  std::deque<sal_uInt16>* pKanaComp = m_pCurr->GetpKanaComp();
511  sal_uInt16 nSpaceIdx = 0;
512  size_t nKanaIdx = 0;
513  long nSpaceAdd = m_pCurr->IsSpaceAdd() ? m_pCurr->GetLLSpaceAdd( 0 ) : 0;
514 
515  bool bNoText = true;
516 
517  // First all portions without Len at beginning of line are skipped.
518  // Exceptions are the mean special portions from WhichFirstPortion:
519  // Num, ErgoSum, FootnoteNum, FieldRests
520  // 8477: but also the only Textportion of an empty line with
521  // Right/Center-Adjustment! So not just pPor->GetExpandPortion() ...
522  while( pPor && !pPor->GetLen() && ! bInsideFirstField )
523  {
524  nX += pPor->Width();
525  if ( pPor->InSpaceGrp() && nSpaceAdd )
526  nX += pPor->CalcSpacing( nSpaceAdd, aInf );
527  if( bNoText )
528  nTmpFirst = nX;
529  // 8670: EndPortions count once as TextPortions.
530  // if( pPor->InTextGrp() || pPor->IsBreakPortion() )
531  if( pPor->InTextGrp() || pPor->IsBreakPortion() || pPor->InTabGrp() )
532  {
533  bNoText = false;
534  nTmpFirst = nX;
535  }
536  if( pPor->IsMultiPortion() && static_cast<SwMultiPortion*>(pPor)->HasTabulator() )
537  {
538  if ( m_pCurr->IsSpaceAdd() )
539  {
540  if ( ++nSpaceIdx < m_pCurr->GetLLSpaceAddCount() )
541  nSpaceAdd = m_pCurr->GetLLSpaceAdd( nSpaceIdx );
542  else
543  nSpaceAdd = 0;
544  }
545 
546  if( pKanaComp && ( nKanaIdx + 1 ) < pKanaComp->size() )
547  ++nKanaIdx;
548  }
549  if( pPor->InFixMargGrp() )
550  {
551  if( pPor->IsMarginPortion() )
552  bNoText = false;
553  else
554  {
555  // fix margin portion => next SpaceAdd, KanaComp value
556  if ( m_pCurr->IsSpaceAdd() )
557  {
558  if ( ++nSpaceIdx < m_pCurr->GetLLSpaceAddCount() )
559  nSpaceAdd = m_pCurr->GetLLSpaceAdd( nSpaceIdx );
560  else
561  nSpaceAdd = 0;
562  }
563 
564  if( pKanaComp && ( nKanaIdx + 1 ) < pKanaComp->size() )
565  ++nKanaIdx;
566  }
567  }
568  pPor = pPor->GetNextPortion();
569  }
570 
571  if( !pPor )
572  {
573  // There's just Spezialportions.
574  nX = nTmpFirst;
575  }
576  else
577  {
578  if( !pPor->IsMarginPortion() && !pPor->IsPostItsPortion() &&
579  (!pPor->InFieldGrp() || pPor->GetAscent() ) )
580  {
581  nPorHeight = pPor->Height();
582  nPorAscent = pPor->GetAscent();
583  }
584  while( pPor && !pPor->IsBreakPortion() && ( aInf.GetIdx() < nOfst ||
585  ( bWidth && ( pPor->IsKernPortion() || pPor->IsMultiPortion() ) ) ) )
586  {
587  if( !pPor->IsMarginPortion() && !pPor->IsPostItsPortion() &&
588  (!pPor->InFieldGrp() || pPor->GetAscent() ) )
589  {
590  nPorHeight = pPor->Height();
591  nPorAscent = pPor->GetAscent();
592  }
593 
594  // If we are behind the portion, we add the portion width to
595  // nX. Special case: nOfst = aInf.GetIdx() + pPor->GetLen().
596  // For common portions (including BidiPortions) we want to add
597  // the portion width to nX. For MultiPortions, nExtra = 0,
598  // therefore we go to the 'else' branch and start a recursion.
599  const TextFrameIndex nExtra( (pPor->IsMultiPortion()
600  && !static_cast<SwMultiPortion*>(pPor)->IsBidi()
601  && !bWidth)
602  ? 0 : 1 );
603  if ( aInf.GetIdx() + pPor->GetLen() < nOfst + nExtra )
604  {
605  if ( pPor->InSpaceGrp() && nSpaceAdd )
606  nX += pPor->PrtWidth() +
607  pPor->CalcSpacing( nSpaceAdd, aInf );
608  else
609  {
610  if( pPor->InFixMargGrp() && ! pPor->IsMarginPortion() )
611  {
612  // update to current SpaceAdd, KanaComp values
613  if ( m_pCurr->IsSpaceAdd() )
614  {
615  if ( ++nSpaceIdx < m_pCurr->GetLLSpaceAddCount() )
616  nSpaceAdd = m_pCurr->GetLLSpaceAdd( nSpaceIdx );
617  else
618  nSpaceAdd = 0;
619  }
620 
621  if ( pKanaComp &&
622  ( nKanaIdx + 1 ) < pKanaComp->size()
623  )
624  ++nKanaIdx;
625  }
626  if ( !pPor->IsFlyPortion() || ( pPor->GetNextPortion() &&
627  !pPor->GetNextPortion()->IsMarginPortion() ) )
628  nX += pPor->PrtWidth();
629  }
630  if( pPor->IsMultiPortion() )
631  {
632  if ( static_cast<SwMultiPortion*>(pPor)->HasTabulator() )
633  {
634  if ( m_pCurr->IsSpaceAdd() )
635  {
636  if ( ++nSpaceIdx < m_pCurr->GetLLSpaceAddCount() )
637  nSpaceAdd = m_pCurr->GetLLSpaceAdd( nSpaceIdx );
638  else
639  nSpaceAdd = 0;
640  }
641 
642  if( pKanaComp && ( nKanaIdx + 1 ) < pKanaComp->size() )
643  ++nKanaIdx;
644  }
645 
646  // if we are right behind a BidiPortion, we have to
647  // hold a pointer to the BidiPortion in order to
648  // find the correct cursor position, depending on the
649  // cursor level
650  if ( static_cast<SwMultiPortion*>(pPor)->IsBidi() &&
651  aInf.GetIdx() + pPor->GetLen() == nOfst )
652  {
653  pLastBidiPor = static_cast<SwBidiPortion*>(pPor);
654  nLastBidiIdx = aInf.GetIdx();
655  nLastBidiPorWidth = pLastBidiPor->Width() +
656  pLastBidiPor->CalcSpacing( nSpaceAdd, aInf );
657  }
658  }
659 
660  aInf.SetIdx( aInf.GetIdx() + pPor->GetLen() );
661  pPor = pPor->GetNextPortion();
662  }
663  else
664  {
665  if( pPor->IsMultiPortion() )
666  {
667  nTmpAscent = AdjustBaseLine( *m_pCurr, pPor );
668  GetInfo().SetMulti( true );
669  pOrig->Pos().AdjustY(nTmpAscent - nPorAscent );
670 
671  if( pCMS && pCMS->m_b2Lines )
672  {
673  const bool bRecursion (pCMS->m_p2Lines);
674  if ( !bRecursion )
675  {
676  pCMS->m_p2Lines.reset(new Sw2LinesPos);
677  pCMS->m_p2Lines->aLine = SwRect(aCharPos, aCharSize);
678  }
679 
680  if( static_cast<SwMultiPortion*>(pPor)->HasRotation() )
681  {
682  if( static_cast<SwMultiPortion*>(pPor)->IsRevers() )
683  pCMS->m_p2Lines->nMultiType = MultiPortionType::ROT_270;
684  else
685  pCMS->m_p2Lines->nMultiType = MultiPortionType::ROT_90;
686  }
687  else if( static_cast<SwMultiPortion*>(pPor)->IsDouble() )
688  pCMS->m_p2Lines->nMultiType = MultiPortionType::TWOLINE;
689  else if( static_cast<SwMultiPortion*>(pPor)->IsBidi() )
690  pCMS->m_p2Lines->nMultiType = MultiPortionType::BIDI;
691  else
692  pCMS->m_p2Lines->nMultiType = MultiPortionType::RUBY;
693 
694  SwTwips nTmpWidth = pPor->Width();
695  if( nSpaceAdd )
696  nTmpWidth += pPor->CalcSpacing(nSpaceAdd, aInf);
697 
698  SwRect aRect( Point(aCharPos.X() + nX, pOrig->Top() ),
699  Size( nTmpWidth, pPor->Height() ) );
700 
701  if ( ! bRecursion )
702  pCMS->m_p2Lines->aPortion = aRect;
703  else
704  pCMS->m_p2Lines->aPortion2 = aRect;
705  }
706 
707  // In a multi-portion we use GetCharRect()-function
708  // recursively and must add the x-position
709  // of the multi-portion.
710  TextFrameIndex const nOldStart = m_nStart;
711  SwTwips nOldY = m_nY;
712  sal_uInt8 nOldProp = GetPropFont();
713  m_nStart = aInf.GetIdx();
714  SwLineLayout* pOldCurr = m_pCurr;
715  m_pCurr = &static_cast<SwMultiPortion*>(pPor)->GetRoot();
716  if( static_cast<SwMultiPortion*>(pPor)->IsDouble() )
717  SetPropFont( 50 );
718 
719  SwTextGridItem const*const pGrid(
720  GetGridItem(GetTextFrame()->FindPageFrame()));
721  const bool bHasGrid = pGrid && GetInfo().SnapToGrid();
722  const sal_uInt16 nRubyHeight = bHasGrid ?
723  pGrid->GetRubyHeight() : 0;
724 
725  if( m_nStart + m_pCurr->GetLen() <= nOfst && GetNext() &&
726  ( ! static_cast<SwMultiPortion*>(pPor)->IsRuby() ||
727  static_cast<SwMultiPortion*>(pPor)->OnTop() ) )
728  {
729  sal_uInt16 nOffset;
730  // in grid mode we may only add the height of the
731  // ruby line if ruby line is on top
732  if ( bHasGrid &&
733  static_cast<SwMultiPortion*>(pPor)->IsRuby() &&
734  static_cast<SwMultiPortion*>(pPor)->OnTop() )
735  nOffset = nRubyHeight;
736  else
737  nOffset = GetLineHeight();
738 
739  pOrig->Pos().AdjustY(nOffset );
740  Next();
741  }
742 
743  const bool bSpaceChg = static_cast<SwMultiPortion*>(pPor)->
744  ChgSpaceAdd( m_pCurr, nSpaceAdd );
745  Point aOldPos = pOrig->Pos();
746 
747  // Ok, for ruby portions in grid mode we have to
748  // temporarily set the inner line height to the
749  // outer line height because that value is needed
750  // for the adjustment inside the recursion
751  const sal_uInt16 nOldRubyHeight = m_pCurr->Height();
752  const sal_uInt16 nOldRubyRealHeight = m_pCurr->GetRealHeight();
753  const bool bChgHeight =
754  static_cast<SwMultiPortion*>(pPor)->IsRuby() && bHasGrid;
755 
756  if ( bChgHeight )
757  {
758  m_pCurr->Height( pOldCurr->Height() - nRubyHeight );
759  m_pCurr->SetRealHeight( pOldCurr->GetRealHeight() -
760  nRubyHeight );
761  }
762 
763  SwLayoutModeModifier aLayoutModeModifier( *GetInfo().GetOut() );
764  if ( static_cast<SwMultiPortion*>(pPor)->IsBidi() )
765  {
766  aLayoutModeModifier.Modify(
767  static_cast<SwBidiPortion*>(pPor)->GetLevel() % 2 );
768  }
769 
770  GetCharRect_( pOrig, nOfst, pCMS );
771 
772  if ( bChgHeight )
773  {
774  m_pCurr->Height( nOldRubyHeight );
775  m_pCurr->SetRealHeight( nOldRubyRealHeight );
776  }
777 
778  // if we are still in the first row of
779  // our 2 line multiportion, we use the FirstMulti flag
780  // to indicate this
781  if ( static_cast<SwMultiPortion*>(pPor)->IsDouble() )
782  {
783  // the recursion may have damaged our font size
784  SetPropFont( nOldProp );
785  GetInfo().GetFont()->SetProportion( 100 );
786 
787  if ( m_pCurr == &static_cast<SwMultiPortion*>(pPor)->GetRoot() )
788  {
789  GetInfo().SetFirstMulti( true );
790 
791  // we want to treat a double line portion like a
792  // single line portion, if there is no text in
793  // the second line
794  if ( !m_pCurr->GetNext() ||
795  !m_pCurr->GetNext()->GetLen() )
796  GetInfo().SetMulti( false );
797  }
798  }
799  // ruby portions are treated like single line portions
800  else if( static_cast<SwMultiPortion*>(pPor)->IsRuby() ||
801  static_cast<SwMultiPortion*>(pPor)->IsBidi() )
802  GetInfo().SetMulti( false );
803 
804  // calculate cursor values
805  if( static_cast<SwMultiPortion*>(pPor)->HasRotation() )
806  {
807  GetInfo().SetMulti( false );
808  long nTmp = pOrig->Width();
809  pOrig->Width( pOrig->Height() );
810  pOrig->Height( nTmp );
811  nTmp = pOrig->Left() - aOldPos.X();
812 
813  // if we travel into our rotated portion from
814  // a line below, we have to take care, that the
815  // y coord in pOrig is less than line height:
816  if ( nTmp )
817  nTmp--;
818 
819  pOrig->Pos().setX( nX + aOldPos.X() );
820  if( static_cast<SwMultiPortion*>(pPor)->IsRevers() )
821  pOrig->Pos().setY( aOldPos.Y() + nTmp );
822  else
823  pOrig->Pos().setY( aOldPos.Y()
824  + pPor->Height() - nTmp - pOrig->Height() );
825  if ( pCMS && pCMS->m_bRealHeight )
826  {
827  pCMS->m_aRealHeight.setY( -pCMS->m_aRealHeight.Y() );
828  // result for rotated multi portion is not
829  // correct for reverse (270 degree) portions
830  if( static_cast<SwMultiPortion*>(pPor)->IsRevers() )
831  {
834  // if vertical alignment is set to auto,
835  // we switch from base line alignment
836  // to centered alignment
837  pCMS->m_aRealHeight.setX(
838  ( pOrig->Width() +
839  pCMS->m_aRealHeight.Y() ) / 2 );
840  else
841  pCMS->m_aRealHeight.setX(
842  pOrig->Width() -
843  pCMS->m_aRealHeight.X() +
844  pCMS->m_aRealHeight.Y() );
845  }
846  }
847  }
848  else
849  {
850  pOrig->Pos().AdjustY(aOldPos.Y() );
851  if ( static_cast<SwMultiPortion*>(pPor)->IsBidi() )
852  {
853  const SwTwips nPorWidth = pPor->Width() +
854  pPor->CalcSpacing( nSpaceAdd, aInf );
855  const SwTwips nInsideOfst = pOrig->Pos().X();
856  pOrig->Pos().setX( nX + nPorWidth -
857  nInsideOfst - pOrig->Width() );
858  }
859  else
860  pOrig->Pos().AdjustX(nX );
861 
862  if( static_cast<SwMultiPortion*>(pPor)->HasBrackets() )
863  pOrig->Pos().AdjustX(
864  static_cast<SwDoubleLinePortion*>(pPor)->PreWidth() );
865  }
866 
867  if( bSpaceChg )
869 
870  m_pCurr = pOldCurr;
871  m_nStart = nOldStart;
872  m_nY = nOldY;
873  m_bPrev = false;
874 
875  return;
876  }
877  if ( pPor->PrtWidth() )
878  {
879  TextFrameIndex const nOldLen = pPor->GetLen();
880  pPor->SetLen( nOfst - aInf.GetIdx() );
881  aInf.SetLen( pPor->GetLen() );
882  if( nX || !pPor->InNumberGrp() )
883  {
884  SeekAndChg( aInf );
885  const bool bOldOnWin = aInf.OnWin();
886  aInf.SetOnWin( false ); // no BULLETs!
887  SwTwips nTmp = nX;
888  aInf.SetKanaComp( pKanaComp );
889  aInf.SetKanaIdx( nKanaIdx );
890  nX += pPor->GetTextSize( aInf ).Width();
891  aInf.SetOnWin( bOldOnWin );
892  if ( pPor->InSpaceGrp() && nSpaceAdd )
893  nX += pPor->CalcSpacing( nSpaceAdd, aInf );
894  if( bWidth )
895  {
896  pPor->SetLen(pPor->GetLen() + TextFrameIndex(1));
897  aInf.SetLen( pPor->GetLen() );
898  aInf.SetOnWin( false ); // no BULLETs!
899  nTmp += pPor->GetTextSize( aInf ).Width();
900  aInf.SetOnWin( bOldOnWin );
901  if ( pPor->InSpaceGrp() && nSpaceAdd )
902  nTmp += pPor->CalcSpacing(nSpaceAdd, aInf);
903  pOrig->Width( nTmp - nX );
904  }
905  }
906  pPor->SetLen( nOldLen );
907 
908  // Shift the cursor with the right border width
909  // Note: nX remains positive because GetTextSize() also include the width of the right border
910  if( aInf.GetIdx() < nOfst && nOfst < aInf.GetIdx() + pPor->GetLen() )
911  {
912  // Find the current drop portion part and use its right border
913  if( pPor->IsDropPortion() && static_cast<SwDropPortion*>(pPor)->GetLines() > 1 )
914  {
915  SwDropPortion* pDrop = static_cast<SwDropPortion*>(pPor);
916  const SwDropPortionPart* pCurrPart = pDrop->GetPart();
917  TextFrameIndex nSumLength(0);
918  while( pCurrPart && (nSumLength += pCurrPart->GetLen()) < nOfst - aInf.GetIdx() )
919  {
920  pCurrPart = pCurrPart->GetFollow();
921  }
922  if( pCurrPart && nSumLength != nOfst - aInf.GetIdx() &&
923  pCurrPart->GetFont().GetRightBorder() && !pCurrPart->GetJoinBorderWithNext() )
924  {
925  nX -= pCurrPart->GetFont().GetRightBorderSpace();
926  }
927  }
928  else if( GetInfo().GetFont()->GetRightBorder() && !pPor->GetJoinBorderWithNext())
929  {
930  nX -= GetInfo().GetFont()->GetRightBorderSpace();
931  }
932  }
933  }
934  bWidth = false;
935  break;
936  }
937  }
938  }
939 
940  if( pPor )
941  {
942  OSL_ENSURE( !pPor->InNumberGrp() || bInsideFirstField, "Number surprise" );
943  bool bEmptyField = false;
944  if( pPor->InFieldGrp() && pPor->GetLen() )
945  {
946  SwFieldPortion *pTmp = static_cast<SwFieldPortion*>(pPor);
947  while( pTmp->HasFollow() && pTmp->GetExp().isEmpty() )
948  {
949  sal_uInt16 nAddX = pTmp->Width();
950  SwLinePortion *pNext = pTmp->GetNextPortion();
951  while( pNext && !pNext->InFieldGrp() )
952  {
953  OSL_ENSURE( !pNext->GetLen(), "Where's my field follow?" );
954  nAddX = nAddX + pNext->Width();
955  pNext = pNext->GetNextPortion();
956  }
957  if( !pNext )
958  break;
959  pTmp = static_cast<SwFieldPortion*>(pNext);
960  nPorHeight = pTmp->Height();
961  nPorAscent = pTmp->GetAscent();
962  nX += nAddX;
963  bEmptyField = true;
964  }
965  }
966  // 8513: Fields in justified text, skipped
967  while( pPor && !pPor->GetLen() && ! bInsideFirstField &&
968  ( pPor->IsFlyPortion() || pPor->IsKernPortion() ||
969  pPor->IsBlankPortion() || pPor->InTabGrp() ||
970  ( !bEmptyField && pPor->InFieldGrp() ) ) )
971  {
972  if ( pPor->InSpaceGrp() && nSpaceAdd )
973  nX += pPor->PrtWidth() +
974  pPor->CalcSpacing( nSpaceAdd, aInf );
975  else
976  {
977  if( pPor->InFixMargGrp() && ! pPor->IsMarginPortion() )
978  {
979  if ( m_pCurr->IsSpaceAdd() )
980  {
981  if ( ++nSpaceIdx < m_pCurr->GetLLSpaceAddCount() )
982  nSpaceAdd = m_pCurr->GetLLSpaceAdd( nSpaceIdx );
983  else
984  nSpaceAdd = 0;
985  }
986 
987  if( pKanaComp && ( nKanaIdx + 1 ) < pKanaComp->size() )
988  ++nKanaIdx;
989  }
990  if ( !pPor->IsFlyPortion() || ( pPor->GetNextPortion() &&
991  !pPor->GetNextPortion()->IsMarginPortion() ) )
992  nX += pPor->PrtWidth();
993  }
994  if( pPor->IsMultiPortion() &&
995  static_cast<SwMultiPortion*>(pPor)->HasTabulator() )
996  {
997  if ( m_pCurr->IsSpaceAdd() )
998  {
999  if ( ++nSpaceIdx < m_pCurr->GetLLSpaceAddCount() )
1000  nSpaceAdd = m_pCurr->GetLLSpaceAdd( nSpaceIdx );
1001  else
1002  nSpaceAdd = 0;
1003  }
1004 
1005  if( pKanaComp && ( nKanaIdx + 1 ) < pKanaComp->size() )
1006  ++nKanaIdx;
1007  }
1008  if( !pPor->IsFlyPortion() )
1009  {
1010  nPorHeight = pPor->Height();
1011  nPorAscent = pPor->GetAscent();
1012  }
1013  pPor = pPor->GetNextPortion();
1014  }
1015 
1016  if( aInf.GetIdx() == nOfst && pPor && pPor->InHyphGrp() &&
1017  pPor->GetNextPortion() && pPor->GetNextPortion()->InFixGrp() )
1018  {
1019  // All special portions have to be skipped
1020  // Taking the German word "zusammen" as example: zu-[FLY]sammen, 'u' == 19, 's' == 20; Right()
1021  // Without the adjustment we end up in front of '-', with the
1022  // adjustment in front of the 's'.
1023  while( pPor && !pPor->GetLen() )
1024  {
1025  nX += pPor->Width();
1026  if( !pPor->IsMarginPortion() )
1027  {
1028  nPorHeight = pPor->Height();
1029  nPorAscent = pPor->GetAscent();
1030  }
1031  pPor = pPor->GetNextPortion();
1032  }
1033  }
1034  if( pPor && pCMS )
1035  {
1036  if( pCMS->m_bFieldInfo && pPor->InFieldGrp() && pPor->Width() )
1037  pOrig->Width( pPor->Width() );
1038  if( pPor->IsDropPortion() )
1039  {
1040  nPorAscent = static_cast<SwDropPortion*>(pPor)->GetDropHeight();
1041  // The drop height is only calculated, if we have more than
1042  // one line. Otherwise it is 0.
1043  if ( ! nPorAscent)
1044  nPorAscent = pPor->Height();
1045  nPorHeight = nPorAscent;
1046  pOrig->Height( nPorHeight +
1047  static_cast<SwDropPortion*>(pPor)->GetDropDescent() );
1048  if( nTmpHeight < pOrig->Height() )
1049  {
1050  nTmpAscent = nPorAscent;
1051  nTmpHeight = sal_uInt16( pOrig->Height() );
1052  }
1053  }
1054  if( bWidth && pPor->PrtWidth() && pPor->GetLen() &&
1055  aInf.GetIdx() == nOfst )
1056  {
1057  if( !pPor->IsFlyPortion() && pPor->Height() &&
1058  pPor->GetAscent() )
1059  {
1060  nPorHeight = pPor->Height();
1061  nPorAscent = pPor->GetAscent();
1062  }
1063  SwTwips nTmp;
1064  if (TextFrameIndex(2) > pPor->GetLen())
1065  {
1066  nTmp = pPor->Width();
1067  if ( pPor->InSpaceGrp() && nSpaceAdd )
1068  nTmp += pPor->CalcSpacing( nSpaceAdd, aInf );
1069  }
1070  else
1071  {
1072  const bool bOldOnWin = aInf.OnWin();
1073  TextFrameIndex const nOldLen = pPor->GetLen();
1074  pPor->SetLen( TextFrameIndex(1) );
1075  aInf.SetLen( pPor->GetLen() );
1076  SeekAndChg( aInf );
1077  aInf.SetOnWin( false ); // no BULLETs!
1078  aInf.SetKanaComp( pKanaComp );
1079  aInf.SetKanaIdx( nKanaIdx );
1080  nTmp = pPor->GetTextSize( aInf ).Width();
1081  aInf.SetOnWin( bOldOnWin );
1082  if ( pPor->InSpaceGrp() && nSpaceAdd )
1083  nTmp += pPor->CalcSpacing( nSpaceAdd, aInf );
1084  pPor->SetLen( nOldLen );
1085  }
1086  pOrig->Width( nTmp );
1087  }
1088 
1089  // travel inside field portion?
1090  if ( pCMS->m_pSpecialPos )
1091  {
1092  // apply attributes to font
1093  Seek( nOfst );
1094  lcl_GetCharRectInsideField( aInf, *pOrig, *pCMS, *pPor );
1095  }
1096  }
1097  }
1098 
1099  // special case: We are at the beginning of a BidiPortion or
1100  // directly behind a BidiPortion
1101  if ( pCMS &&
1102  ( pLastBidiPor ||
1103  ( pPor &&
1104  pPor->IsMultiPortion() &&
1105  static_cast<SwMultiPortion*>(pPor)->IsBidi() ) ) )
1106  {
1107  // we determine if the cursor has to blink before or behind
1108  // the bidi portion
1109  if ( pLastBidiPor )
1110  {
1111  const sal_uInt8 nPortionLevel = pLastBidiPor->GetLevel();
1112 
1113  if ( pCMS->m_nCursorBidiLevel >= nPortionLevel )
1114  {
1115  // we came from inside the bidi portion, we want to blink
1116  // behind the portion
1117  pOrig->Pos().AdjustX( -nLastBidiPorWidth );
1118 
1119  // Again, there is a special case: logically behind
1120  // the portion can actually mean that the cursor is inside
1121  // the portion. This can happen is the last portion
1122  // inside the bidi portion is a nested bidi portion
1123  SwLineLayout& rLineLayout =
1124  static_cast<SwMultiPortion*>(pLastBidiPor)->GetRoot();
1125 
1126  const SwLinePortion *pLast = rLineLayout.FindLastPortion();
1127  if ( pLast->IsMultiPortion() )
1128  {
1129  OSL_ENSURE( static_cast<const SwMultiPortion*>(pLast)->IsBidi(),
1130  "Non-BidiPortion inside BidiPortion" );
1131  TextFrameIndex const nIdx = aInf.GetIdx();
1132  // correct the index before using CalcSpacing.
1133  aInf.SetIdx(nLastBidiIdx);
1134  pOrig->Pos().AdjustX(pLast->Width() +
1135  pLast->CalcSpacing( nSpaceAdd, aInf ) );
1136  aInf.SetIdx(nIdx);
1137  }
1138  }
1139  }
1140  else
1141  {
1142  const sal_uInt8 nPortionLevel = static_cast<SwBidiPortion*>(pPor)->GetLevel();
1143 
1144  if ( pCMS->m_nCursorBidiLevel >= nPortionLevel )
1145  {
1146  // we came from inside the bidi portion, we want to blink
1147  // behind the portion
1148  pOrig->Pos().AdjustX(pPor->Width() +
1149  pPor->CalcSpacing( nSpaceAdd, aInf ) );
1150  }
1151  }
1152  }
1153 
1154  pOrig->Pos().AdjustX(nX );
1155 
1156  if ( pCMS && pCMS->m_bRealHeight )
1157  {
1158  nTmpAscent = AdjustBaseLine( *m_pCurr, nullptr, nPorHeight, nPorAscent );
1159  if ( nTmpAscent > nPorAscent )
1160  pCMS->m_aRealHeight.setX( nTmpAscent - nPorAscent );
1161  else
1162  pCMS->m_aRealHeight.setX( 0 );
1163  OSL_ENSURE( nPorHeight, "GetCharRect: Missing Portion-Height" );
1164  if ( nTmpHeight > nPorHeight )
1165  pCMS->m_aRealHeight.setY( nPorHeight );
1166  else
1167  pCMS->m_aRealHeight.setY( nTmpHeight );
1168  }
1169  }
1170 }
1171 
1173  SwCursorMoveState* pCMS, const long nMax )
1174 {
1175  CharCursorToLine(nOfst);
1176 
1177  // Indicates that a position inside a special portion (field, number portion)
1178  // is requested.
1179  const bool bSpecialPos = pCMS && pCMS->m_pSpecialPos;
1180  TextFrameIndex nFindOfst = nOfst;
1181 
1182  if ( bSpecialPos )
1183  {
1184  const SwSPExtendRange nExtendRange = pCMS->m_pSpecialPos->nExtendRange;
1185 
1186  OSL_ENSURE( ! pCMS->m_pSpecialPos->nLineOfst || SwSPExtendRange::BEFORE != nExtendRange,
1187  "LineOffset AND Number Portion?" );
1188 
1189  // portions which are behind the string
1190  if ( SwSPExtendRange::BEHIND == nExtendRange )
1191  ++nFindOfst;
1192 
1193  // skip lines for fields which cover more than one line
1194  for ( sal_uInt16 i = 0; i < pCMS->m_pSpecialPos->nLineOfst; i++ )
1195  Next();
1196  }
1197 
1198  // If necessary, as catch up, do the adjustment
1199  GetAdjusted();
1200 
1201  const Point aCharPos( GetTopLeft() );
1202 
1203  GetCharRect_( pOrig, nFindOfst, pCMS );
1204 
1205  // This actually would have to be "-1 LogicToPixel", but that seems too
1206  // expensive, so it's a value (-12), that should hopefully be OK.
1207  const SwTwips nTmpRight = Right() - 12;
1208 
1209  pOrig->Pos().AdjustX(aCharPos.X() );
1210  pOrig->Pos().AdjustY(aCharPos.Y() );
1211 
1212  if( pCMS && pCMS->m_b2Lines && pCMS->m_p2Lines )
1213  {
1214  pCMS->m_p2Lines->aLine.Pos().AdjustX(aCharPos.X() );
1215  pCMS->m_p2Lines->aLine.Pos().AdjustY(aCharPos.Y() );
1216  pCMS->m_p2Lines->aPortion.Pos().AdjustX(aCharPos.X() );
1217  pCMS->m_p2Lines->aPortion.Pos().AdjustY(aCharPos.Y() );
1218  }
1219 
1221  // Make sure the cursor respects the right margin, unless in compat mode, where the tab size has priority over the margin size.
1222  if( pOrig->Left() > nTmpRight && !bTabOverMargin)
1223  pOrig->Pos().setX( nTmpRight );
1224 
1225  if( nMax )
1226  {
1227  if( pOrig->Top() + pOrig->Height() > nMax )
1228  {
1229  if( pOrig->Top() > nMax )
1230  pOrig->Top( nMax );
1231  pOrig->Height( nMax - pOrig->Top() );
1232  }
1233  if ( pCMS && pCMS->m_bRealHeight && pCMS->m_aRealHeight.Y() >= 0 )
1234  {
1235  long nTmp = pCMS->m_aRealHeight.X() + pOrig->Top();
1236  if( nTmp >= nMax )
1237  {
1238  pCMS->m_aRealHeight.setX( nMax - pOrig->Top() );
1239  pCMS->m_aRealHeight.setY( 0 );
1240  }
1241  else if( nTmp + pCMS->m_aRealHeight.Y() > nMax )
1242  pCMS->m_aRealHeight.setY( nMax - nTmp );
1243  }
1244  }
1245  long nOut = pOrig->Right() - GetTextFrame()->getFrameArea().Right();
1246  if( nOut > 0 )
1247  {
1248  if( GetTextFrame()->getFrameArea().Width() < GetTextFrame()->getFramePrintArea().Left()
1249  + GetTextFrame()->getFramePrintArea().Width() )
1252  if( nOut > 0 )
1253  pOrig->Pos().AdjustX( -(nOut + 10) );
1254  }
1255 }
1256 
1257 // Return: Offset in String
1259  bool bChgNode, SwCursorMoveState* pCMS ) const
1260 {
1261  // If necessary, as catch up, do the adjustment
1262  GetAdjusted();
1263 
1264  const OUString &rText = GetInfo().GetText();
1265  TextFrameIndex nOffset(0);
1266 
1267  // x is the horizontal offset within the line.
1268  SwTwips x = rPoint.X();
1269  const SwTwips nLeftMargin = GetLineStart();
1271  ( GetCurr()->IsHanging() ? GetCurr()->GetHangingMargin() : 0 );
1272  if( nRightMargin == nLeftMargin )
1273  nRightMargin += 30;
1274 
1275  const bool bLeftOver = x < nLeftMargin;
1276  if( bLeftOver )
1277  x = nLeftMargin;
1278  const bool bRightOver = x > nRightMargin;
1279  if( bRightOver )
1280  x = nRightMargin;
1281 
1282  const bool bRightAllowed = pCMS && ( pCMS->m_eState == MV_NONE );
1283 
1284  // Until here everything in document coordinates.
1285  x -= nLeftMargin;
1286 
1287  sal_uInt16 nX = sal_uInt16( x );
1288 
1289  // If there are attribute changes in the line, search for the paragraph,
1290  // in which nX is situated.
1292  TextFrameIndex nCurrStart = m_nStart;
1293  bool bHolePortion = false;
1294  bool bLastHyph = false;
1295 
1296  std::deque<sal_uInt16> *pKanaComp = m_pCurr->GetpKanaComp();
1297  TextFrameIndex const nOldIdx = GetInfo().GetIdx();
1298  sal_uInt16 nSpaceIdx = 0;
1299  size_t nKanaIdx = 0;
1300  long nSpaceAdd = m_pCurr->IsSpaceAdd() ? m_pCurr->GetLLSpaceAdd( 0 ) : 0;
1301  short nKanaComp = pKanaComp ? (*pKanaComp)[0] : 0;
1302 
1303  // nWidth is the width of the line, or the width of
1304  // the paragraph with the font change, in which nX is situated.
1305 
1306  sal_uInt16 nWidth = pPor->Width();
1307  if ( m_pCurr->IsSpaceAdd() || pKanaComp )
1308  {
1309  if ( pPor->InSpaceGrp() && nSpaceAdd )
1310  {
1311  const_cast<SwTextSizeInfo&>(GetInfo()).SetIdx( nCurrStart );
1312  nWidth = nWidth + sal_uInt16( pPor->CalcSpacing( nSpaceAdd, GetInfo() ) );
1313  }
1314  if( ( pPor->InFixMargGrp() && ! pPor->IsMarginPortion() ) ||
1315  ( pPor->IsMultiPortion() && static_cast<SwMultiPortion*>(pPor)->HasTabulator() )
1316  )
1317  {
1318  if ( m_pCurr->IsSpaceAdd() )
1319  {
1320  if ( ++nSpaceIdx < m_pCurr->GetLLSpaceAddCount() )
1321  nSpaceAdd = m_pCurr->GetLLSpaceAdd( nSpaceIdx );
1322  else
1323  nSpaceAdd = 0;
1324  }
1325 
1326  if( pKanaComp )
1327  {
1328  if ( nKanaIdx + 1 < pKanaComp->size() )
1329  nKanaComp = (*pKanaComp)[++nKanaIdx];
1330  else
1331  nKanaComp = 0;
1332  }
1333  }
1334  }
1335 
1336  sal_uInt16 nWidth30;
1337  if ( pPor->IsPostItsPortion() )
1338  nWidth30 = 30 + pPor->GetViewWidth( GetInfo() ) / 2;
1339  else
1340  nWidth30 = ! nWidth && pPor->GetLen() && pPor->InToxRefOrFieldGrp() ?
1341  30 :
1342  nWidth;
1343 
1344  while( pPor->GetNextPortion() && nWidth30 < nX && !pPor->IsBreakPortion() )
1345  {
1346  nX = nX - nWidth;
1347  nCurrStart = nCurrStart + pPor->GetLen();
1348  bHolePortion = pPor->IsHolePortion();
1349  pPor = pPor->GetNextPortion();
1350  nWidth = pPor->Width();
1351  if ( m_pCurr->IsSpaceAdd() || pKanaComp )
1352  {
1353  if ( pPor->InSpaceGrp() && nSpaceAdd )
1354  {
1355  const_cast<SwTextSizeInfo&>(GetInfo()).SetIdx( nCurrStart );
1356  nWidth = nWidth + sal_uInt16( pPor->CalcSpacing( nSpaceAdd, GetInfo() ) );
1357  }
1358 
1359  if( ( pPor->InFixMargGrp() && ! pPor->IsMarginPortion() ) ||
1360  ( pPor->IsMultiPortion() && static_cast<SwMultiPortion*>(pPor)->HasTabulator() )
1361  )
1362  {
1363  if ( m_pCurr->IsSpaceAdd() )
1364  {
1365  if ( ++nSpaceIdx < m_pCurr->GetLLSpaceAddCount() )
1366  nSpaceAdd = m_pCurr->GetLLSpaceAdd( nSpaceIdx );
1367  else
1368  nSpaceAdd = 0;
1369  }
1370 
1371  if ( pKanaComp )
1372  {
1373  if( nKanaIdx + 1 < pKanaComp->size() )
1374  nKanaComp = (*pKanaComp)[++nKanaIdx];
1375  else
1376  nKanaComp = 0;
1377  }
1378  }
1379  }
1380 
1381  if ( pPor->IsPostItsPortion() )
1382  nWidth30 = 30 + pPor->GetViewWidth( GetInfo() ) / 2;
1383  else
1384  nWidth30 = ! nWidth && pPor->GetLen() && pPor->InToxRefOrFieldGrp() ?
1385  30 :
1386  nWidth;
1387  if( !pPor->IsFlyPortion() && !pPor->IsMarginPortion() )
1388  bLastHyph = pPor->InHyphGrp();
1389  }
1390 
1391  const bool bLastPortion = (nullptr == pPor->GetNextPortion());
1392 
1393  if( nX==nWidth )
1394  {
1395  SwLinePortion *pNextPor = pPor->GetNextPortion();
1396  while( pNextPor && pNextPor->InFieldGrp() && !pNextPor->Width() )
1397  {
1398  nCurrStart = nCurrStart + pPor->GetLen();
1399  pPor = pNextPor;
1400  if( !pPor->IsFlyPortion() && !pPor->IsMarginPortion() )
1401  bLastHyph = pPor->InHyphGrp();
1402  pNextPor = pPor->GetNextPortion();
1403  }
1404  }
1405 
1406  const_cast<SwTextSizeInfo&>(GetInfo()).SetIdx( nOldIdx );
1407 
1408  TextFrameIndex nLength = pPor->GetLen();
1409 
1410  const bool bFieldInfo = pCMS && pCMS->m_bFieldInfo;
1411 
1412  if( bFieldInfo && ( nWidth30 < nX || bRightOver || bLeftOver ||
1413  ( pPor->InNumberGrp() && !pPor->IsFootnoteNumPortion() ) ||
1414  ( pPor->IsMarginPortion() && nWidth > nX + 30 ) ) )
1415  pCMS->m_bPosCorr = true;
1416 
1417  // #i27615#
1418  if (pCMS && pCMS->m_bInFrontOfLabel)
1419  {
1420  if (! (2 * nX < nWidth && pPor->InNumberGrp() &&
1421  !pPor->IsFootnoteNumPortion()))
1422  pCMS->m_bInFrontOfLabel = false;
1423  }
1424 
1425  // 7684: We are exactly ended up at their HyphPortion. It is our task to
1426  // provide, that we end up in the String.
1427  // 7993: If length = 0, then we must exit...
1428  if( !nLength )
1429  {
1430  if( pCMS )
1431  {
1432  if( pPor->IsFlyPortion() && bFieldInfo )
1433  pCMS->m_bPosCorr = true;
1434 
1435  if (!bRightOver && nX)
1436  {
1437  if( pPor->IsFootnoteNumPortion())
1438  pCMS->m_bFootnoteNoInfo = true;
1439  else if (pPor->InNumberGrp() ) // #i23726#
1440  {
1441  pCMS->m_nInNumPortionOffset = nX;
1442  pCMS->m_bInNumPortion = true;
1443  }
1444  }
1445  }
1446  if( !nCurrStart )
1447  return TextFrameIndex(0);
1448 
1449  // 7849, 7816: pPor->GetHyphPortion is mandatory!
1450  if( bHolePortion || ( !bRightAllowed && bLastHyph ) ||
1451  ( pPor->IsMarginPortion() && !pPor->GetNextPortion() &&
1452  // 46598: Consider the situation: We might end up behind the last character,
1453  // in the last line of a centered paragraph
1454  nCurrStart < TextFrameIndex(rText.getLength())))
1455  --nCurrStart;
1456  else if( pPor->InFieldGrp() && static_cast<SwFieldPortion*>(pPor)->IsFollow()
1457  && nWidth > nX )
1458  {
1459  if( bFieldInfo )
1460  --nCurrStart;
1461  else
1462  {
1463  sal_uInt16 nHeight = pPor->Height();
1464  if ( !nHeight || nHeight > nWidth )
1465  nHeight = nWidth;
1466  if( bChgNode && nWidth - nHeight/2 > nX )
1467  --nCurrStart;
1468  }
1469  }
1470  return nCurrStart;
1471  }
1472  if (TextFrameIndex(1) == nLength)
1473  {
1474  if ( nWidth )
1475  {
1476  // no quick return for as-character frames, we want to peek inside
1477  if (!(bChgNode && pPos && pPor->IsFlyCntPortion())
1478  // if we want to get the position inside the field, we should not return
1479  && (!pCMS || !pCMS->m_pSpecialPos))
1480  {
1481  if ( pPor->InFieldGrp() ||
1482  ( pPor->IsMultiPortion() &&
1483  static_cast<SwMultiPortion*>(pPor)->IsBidi() ) )
1484  {
1485  sal_uInt16 nHeight = 0;
1486  if( !bFieldInfo )
1487  {
1488  nHeight = pPor->Height();
1489  if ( !nHeight || nHeight > nWidth )
1490  nHeight = nWidth;
1491  }
1492 
1493  if( nWidth - nHeight/2 <= nX &&
1494  ( ! pPor->InFieldGrp() ||
1495  !static_cast<SwFieldPortion*>(pPor)->HasFollow() ) )
1496  ++nCurrStart;
1497  }
1498  else if ( ( !pPor->IsFlyPortion() || ( pPor->GetNextPortion() &&
1499  !pPor->GetNextPortion()->IsMarginPortion() &&
1500  !pPor->GetNextPortion()->IsHolePortion() ) )
1501  && ( nWidth/2 < nX ) &&
1502  ( !bFieldInfo ||
1503  ( pPor->GetNextPortion() &&
1504  pPor->GetNextPortion()->IsPostItsPortion() ) )
1505  && ( bRightAllowed || !bLastHyph ))
1506  ++nCurrStart;
1507 
1508  return nCurrStart;
1509  }
1510  }
1511  else
1512  {
1513  if ( pPor->IsPostItsPortion() || pPor->IsBreakPortion() ||
1514  pPor->InToxRefGrp() )
1515  return nCurrStart;
1516  if ( pPor->InFieldGrp() )
1517  {
1518  if( bRightOver && !static_cast<SwFieldPortion*>(pPor)->HasFollow() )
1519  ++nCurrStart;
1520  return nCurrStart;
1521  }
1522  }
1523  }
1524 
1525  // Skip space at the end of the line
1526  if( bLastPortion && (m_pCurr->GetNext() || m_pFrame->GetFollow() )
1527  && rText[sal_Int32(nCurrStart + nLength) - 1] == ' ' )
1528  --nLength;
1529 
1530  if( nWidth > nX ||
1531  ( nWidth == nX && pPor->IsMultiPortion() && static_cast<SwMultiPortion*>(pPor)->IsDouble() ) )
1532  {
1533  if( pPor->IsMultiPortion() )
1534  {
1535  // In a multi-portion we use GetCursorOfst()-function recursively
1536  SwTwips nTmpY = rPoint.Y() - m_pCurr->GetAscent() + pPor->GetAscent();
1537  // if we are in the first line of a double line portion, we have
1538  // to add a value to nTmpY for not staying in this line
1539  // we also want to skip the first line, if we are inside ruby
1540  if ( ( static_cast<SwTextSizeInfo*>(m_pInf)->IsMulti() &&
1541  static_cast<SwTextSizeInfo*>(m_pInf)->IsFirstMulti() ) ||
1542  ( static_cast<SwMultiPortion*>(pPor)->IsRuby() &&
1543  static_cast<SwMultiPortion*>(pPor)->OnTop() ) )
1544  nTmpY += static_cast<SwMultiPortion*>(pPor)->Height();
1545 
1546  // Important for cursor traveling in ruby portions:
1547  // We have to set nTmpY to 0 in order to stay in the first row
1548  // if the phonetic line is the second row
1549  if ( static_cast<SwMultiPortion*>(pPor)->IsRuby() &&
1550  ! static_cast<SwMultiPortion*>(pPor)->OnTop() )
1551  nTmpY = 0;
1552 
1553  SwTextCursorSave aSave( const_cast<SwTextCursor*>(this), static_cast<SwMultiPortion*>(pPor),
1554  nTmpY, nX, nCurrStart, nSpaceAdd );
1555 
1556  SwLayoutModeModifier aLayoutModeModifier( *GetInfo().GetOut() );
1557  if ( static_cast<SwMultiPortion*>(pPor)->IsBidi() )
1558  {
1559  const sal_uInt8 nBidiLevel = static_cast<SwBidiPortion*>(pPor)->GetLevel();
1560  aLayoutModeModifier.Modify( nBidiLevel % 2 );
1561  }
1562 
1563  if( static_cast<SwMultiPortion*>(pPor)->HasRotation() )
1564  {
1565  nTmpY -= m_nY;
1566  if( !static_cast<SwMultiPortion*>(pPor)->IsRevers() )
1567  nTmpY = pPor->Height() - nTmpY;
1568  if( nTmpY < 0 )
1569  nTmpY = 0;
1570  nX = static_cast<sal_uInt16>(nTmpY);
1571  }
1572 
1573  if( static_cast<SwMultiPortion*>(pPor)->HasBrackets() )
1574  {
1575  const sal_uInt16 nPreWidth = static_cast<SwDoubleLinePortion*>(pPor)->PreWidth();
1576  if ( nX > nPreWidth )
1577  nX = nX - nPreWidth;
1578  else
1579  nX = 0;
1580  }
1581 
1582  return GetCursorOfst( pPos, Point( GetLineStart() + nX, rPoint.Y() ),
1583  bChgNode, pCMS );
1584  }
1585  if( pPor->InTextGrp() )
1586  {
1587  sal_uInt8 nOldProp;
1588  if( GetPropFont() )
1589  {
1590  const_cast<SwFont*>(GetFnt())->SetProportion( GetPropFont() );
1591  nOldProp = GetFnt()->GetPropr();
1592  }
1593  else
1594  nOldProp = 0;
1595  {
1596  SwTextSizeInfo aSizeInf( GetInfo(), &rText, nCurrStart );
1597  const_cast<SwTextCursor*>(this)->SeekAndChg( aSizeInf );
1598  SwTextSlot aDiffText( &aSizeInf, static_cast<SwTextPortion*>(pPor), false, false );
1599  SwFontSave aSave( aSizeInf, pPor->IsDropPortion() ?
1600  static_cast<SwDropPortion*>(pPor)->GetFnt() : nullptr );
1601 
1602  SwParaPortion* pPara = const_cast<SwParaPortion*>(GetInfo().GetParaPortion());
1603  OSL_ENSURE( pPara, "No paragraph!" );
1604 
1605  SwDrawTextInfo aDrawInf( aSizeInf.GetVsh(),
1606  *aSizeInf.GetOut(),
1607  &pPara->GetScriptInfo(),
1608  aSizeInf.GetText(),
1609  aSizeInf.GetIdx(),
1610  pPor->GetLen() );
1611 
1612  // Drop portion works like a multi portion, just its parts are not portions
1613  if( pPor->IsDropPortion() && static_cast<SwDropPortion*>(pPor)->GetLines() > 1 )
1614  {
1615  SwDropPortion* pDrop = static_cast<SwDropPortion*>(pPor);
1616  const SwDropPortionPart* pCurrPart = pDrop->GetPart();
1617  sal_uInt16 nSumWidth = 0;
1618  sal_uInt16 nSumBorderWidth = 0;
1619  // Shift offset with the right and left border of previous parts and left border of actual one
1620  while (pCurrPart && nSumWidth <= nX - sal_Int32(nCurrStart))
1621  {
1622  nSumWidth += pCurrPart->GetWidth();
1623  if( pCurrPart->GetFont().GetLeftBorder() && !pCurrPart->GetJoinBorderWithPrev() )
1624  {
1625  nSumBorderWidth += pCurrPart->GetFont().GetLeftBorderSpace();
1626  }
1627  if (nSumWidth <= nX - sal_Int32(nCurrStart) && pCurrPart->GetFont().GetRightBorder() &&
1628  !pCurrPart->GetJoinBorderWithNext() )
1629  {
1630  nSumBorderWidth += pCurrPart->GetFont().GetRightBorderSpace();
1631  }
1632  pCurrPart = pCurrPart->GetFollow();
1633  }
1634  nX = std::max(0, nX - nSumBorderWidth);
1635  }
1636  // Shift the offset with the left border width
1637  else if( GetInfo().GetFont()->GetLeftBorder() && !pPor->GetJoinBorderWithPrev() )
1638  {
1639  nX = std::max(0, nX - GetInfo().GetFont()->GetLeftBorderSpace());
1640  }
1641 
1642  aDrawInf.SetOfst( nX );
1643 
1644  if ( nSpaceAdd )
1645  {
1646  TextFrameIndex nCharCnt(0);
1647  // #i41860# Thai justified alignment needs some
1648  // additional information:
1649  aDrawInf.SetNumberOfBlanks( pPor->InTextGrp() ?
1650  static_cast<const SwTextPortion*>(pPor)->GetSpaceCnt( aSizeInf, nCharCnt ) :
1651  TextFrameIndex(0) );
1652  }
1653 
1654  if ( pPor->InFieldGrp() && pCMS && pCMS->m_pSpecialPos )
1655  aDrawInf.SetLen( TextFrameIndex(COMPLETE_STRING) );
1656 
1657  aDrawInf.SetSpace( nSpaceAdd );
1658  aDrawInf.SetFont( aSizeInf.GetFont() );
1659  aDrawInf.SetFrame( m_pFrame );
1660  aDrawInf.SetSnapToGrid( aSizeInf.SnapToGrid() );
1661  aDrawInf.SetPosMatchesBounds( pCMS && pCMS->m_bPosMatchesBounds );
1662 
1663  if ( SwFontScript::CJK == aSizeInf.GetFont()->GetActual() &&
1664  pPara->GetScriptInfo().CountCompChg() &&
1665  ! pPor->InFieldGrp() )
1666  aDrawInf.SetKanaComp( nKanaComp );
1667 
1668  nLength = aSizeInf.GetFont()->GetCursorOfst_( aDrawInf );
1669 
1670  // get position inside field portion?
1671  if ( pPor->InFieldGrp() && pCMS && pCMS->m_pSpecialPos )
1672  {
1673  pCMS->m_pSpecialPos->nCharOfst = sal_Int32(nLength);
1674  nLength = TextFrameIndex(0);
1675  }
1676 
1677  // set cursor bidi level
1678  if ( pCMS )
1679  pCMS->m_nCursorBidiLevel =
1680  aDrawInf.GetCursorBidiLevel();
1681 
1682  if( bFieldInfo && nLength == pPor->GetLen() &&
1683  ( ! pPor->GetNextPortion() ||
1684  ! pPor->GetNextPortion()->IsPostItsPortion() ) )
1685  --nLength;
1686  }
1687  if( nOldProp )
1688  const_cast<SwFont*>(GetFnt())->SetProportion( nOldProp );
1689  }
1690  else
1691  {
1692  sw::FlyContentPortion* pFlyPor(nullptr);
1693  if(bChgNode && pPos && (pFlyPor = dynamic_cast<sw::FlyContentPortion*>(pPor)))
1694  {
1695  // JP 24.11.94: if the Position is not in Fly, then
1696  // we many not return with COMPLETE_STRING as value!
1697  // (BugId: 9692 + Change in feshview)
1698  SwFlyInContentFrame *pTmp = pFlyPor->GetFlyFrame();
1699  SwFrame* pLower = pTmp->GetLower();
1700  bool bChgNodeInner = pLower
1701  && (pLower->IsTextFrame() || pLower->IsLayoutFrame());
1702  Point aTmpPoint( rPoint );
1703 
1704  if ( m_pFrame->IsRightToLeft() )
1705  m_pFrame->SwitchLTRtoRTL( aTmpPoint );
1706 
1707  if ( m_pFrame->IsVertical() )
1708  m_pFrame->SwitchHorizontalToVertical( aTmpPoint );
1709 
1710  if( bChgNodeInner && pTmp->getFrameArea().IsInside( aTmpPoint ) &&
1711  !( pTmp->IsProtected() ) )
1712  {
1713  pFlyPor->GetFlyCursorOfst(aTmpPoint, *pPos, pCMS);
1714  // After a change of the frame, our font must be still
1715  // available for/in the OutputDevice.
1716  // For comparison: Paint and new SwFlyCntPortion !
1717  static_cast<SwTextSizeInfo*>(m_pInf)->SelectFont();
1718 
1719  // 6776: The pIter->GetCursorOfst is returning here
1720  // from a nesting with COMPLETE_STRING.
1722  }
1723  }
1724  else
1725  nLength = pPor->GetCursorOfst( nX );
1726  }
1727  }
1728  nOffset = nCurrStart + nLength;
1729 
1730  // 7684: We end up in front of the HyphPortion. We must assure
1731  // that we end up in the string.
1732  // If we are at end of line in front of FlyFrames, we must proceed the same way.
1733  if( nOffset && pPor->GetLen() == nLength && pPor->GetNextPortion() &&
1734  !pPor->GetNextPortion()->GetLen() && pPor->GetNextPortion()->InHyphGrp() )
1735  --nOffset;
1736 
1737  return nOffset;
1738 }
1739 
1757 bool SwTextFrame::FillSelection( SwSelectionList& rSelList, const SwRect& rRect ) const
1758 {
1759  bool bRet = false;
1760  // GetPaintArea() instead getFrameArea() for negative indents
1761  SwRect aTmpFrame( GetPaintArea() );
1762  if( !rRect.IsOver( aTmpFrame ) )
1763  return false;
1764  if( rSelList.checkContext( this ) )
1765  {
1766  SwRect aRect( aTmpFrame );
1767  aRect.Intersection( rRect );
1769  if( IsEmpty() )
1770  {
1771  SwPaM *pPam = new SwPaM( aPosL, aPosL );
1772  rSelList.insertPaM( pPam );
1773  }
1774  else if( aRect.HasArea() )
1775  {
1776  SwPosition aOld(aPosL.nNode.GetNodes().GetEndOfContent());
1777  SwPosition aPosR( aPosL );
1778  Point aPoint;
1779  SwTextInfo aInf( const_cast<SwTextFrame*>(this) );
1780  SwTextIter aLine( const_cast<SwTextFrame*>(this), &aInf );
1781  // We have to care for top-to-bottom layout, where right becomes top etc.
1782  SwRectFnSet aRectFnSet(this);
1783  SwTwips nTop = aRectFnSet.GetTop(aRect);
1784  SwTwips nBottom = aRectFnSet.GetBottom(aRect);
1785  SwTwips nLeft = aRectFnSet.GetLeft(aRect);
1786  SwTwips nRight = aRectFnSet.GetRight(aRect);
1787  SwTwips nY = aLine.Y(); // Top position of the first line
1788  SwTwips nLastY = nY;
1789  while( nY < nTop && aLine.Next() ) // line above rectangle
1790  {
1791  nLastY = nY;
1792  nY = aLine.Y();
1793  }
1794  bool bLastLine = false;
1795  if( nY < nTop && !aLine.GetNext() )
1796  {
1797  bLastLine = true;
1798  nY += aLine.GetLineHeight();
1799  }
1800  do // check the lines for overlapping
1801  {
1802  if( nLastY < nTop ) // if the last line was above rectangle
1803  nLastY = nTop;
1804  if( nY > nBottom ) // if the current line leaves the rectangle
1805  nY = nBottom;
1806  if( nY >= nLastY ) // gotcha: overlapping
1807  {
1808  nLastY += nY;
1809  nLastY /= 2;
1810  if( aRectFnSet.IsVert() )
1811  {
1812  aPoint.setX( nLastY );
1813  aPoint.setY( nLeft );
1814  }
1815  else
1816  {
1817  aPoint.setX( nLeft );
1818  aPoint.setY( nLastY );
1819  }
1820  // Looking for the position of the left border of the rectangle
1821  // in this text line
1822  SwCursorMoveState aState( MV_UPDOWN );
1823  if( GetCursorOfst( &aPosL, aPoint, &aState ) )
1824  {
1825  if( aRectFnSet.IsVert() )
1826  {
1827  aPoint.setX( nLastY );
1828  aPoint.setY( nRight );
1829  }
1830  else
1831  {
1832  aPoint.setX( nRight );
1833  aPoint.setY( nLastY );
1834  }
1835  // If we get a right position and if the left position
1836  // is not the same like the left position of the line before
1837  // which could happen e.g. for field portions or fly frames
1838  // a SwPaM will be inserted with these positions
1839  if( GetCursorOfst( &aPosR, aPoint, &aState ) &&
1840  aOld != aPosL)
1841  {
1842  SwPaM *pPam = new SwPaM( aPosL, aPosR );
1843  rSelList.insertPaM( pPam );
1844  aOld = aPosL;
1845  }
1846  }
1847  }
1848  if( aLine.Next() )
1849  {
1850  nLastY = nY;
1851  nY = aLine.Y();
1852  }
1853  else if( !bLastLine )
1854  {
1855  bLastLine = true;
1856  nLastY = nY;
1857  nY += aLine.GetLineHeight();
1858  }
1859  else
1860  break;
1861  }while( nLastY < nBottom );
1862  }
1863  }
1864  if( GetDrawObjs() )
1865  {
1866  const SwSortedObjs &rObjs = *GetDrawObjs();
1867  for (SwAnchoredObject* pAnchoredObj : rObjs)
1868  {
1869  if( dynamic_cast< const SwFlyFrame *>( pAnchoredObj ) == nullptr )
1870  continue;
1871  const SwFlyFrame* pFly = static_cast<const SwFlyFrame*>(pAnchoredObj);
1872  if( pFly->IsFlyInContentFrame() && pFly->FillSelection( rSelList, rRect ) )
1873  bRet = true;
1874  }
1875  }
1876  return bRet;
1877 }
1878 
1879 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
long GetLeft() const
void CtorInitTextIter(SwTextFrame *pFrame, SwTextInfo *pInf)
Definition: itrtxt.cxx:37
std::deque< sal_uInt16 > * GetpKanaComp() const
Definition: porlay.hxx:184
Base class of the Writer layout elements.
Definition: frame.hxx:295
Represents the visualization of a paragraph.
Definition: txtfrm.hxx:149
const SvxLRSpaceItem & GetLRSpace(bool=true) const
Definition: frmatr.hxx:44
sal_uInt16 GetLeftBorderSpace() const
Definition: swfont.hxx:905
SwFontScript WhichFont(TextFrameIndex nIdx) const
Definition: porlay.cxx:724
bool m_bFieldInfo
should be fields recognized?
Definition: crstate.hxx:140
SwViewShell * GetVsh()
Definition: inftxt.hxx:228
bool IsFollow() const
Definition: flowfrm.hxx:166
const SwSortedObjs * GetDrawObjs() const
Definition: frame.hxx:543
sal_uInt16 GetPropLineSpace() const
void GetAdjusted() const
Definition: itrtxt.hxx:250
bool InToxRefGrp() const
Definition: porlin.hxx:104
virtual bool FillSelection(SwSelectionList &rList, const SwRect &rRect) const override
Looks for text portions which are inside the given rectangle.
Definition: itrcrsr.cxx:1757
Marks a position in the document model.
Definition: pam.hxx:35
sal_uInt16 GetDropDescent() const
Definition: itrtxt.hxx:207
static bool bRightMargin
Definition: itrtxt.hxx:268
sal_Int32 nCharOfst
Definition: crstate.hxx:108
long GetLeftMarginWithNum(bool bTextLeft=false) const
Returns the additional indents of this text node and its numbering.
Definition: ndtxt.cxx:3162
sal_uInt16 nDropHeight
Definition: itrtxt.hxx:148
bool IsHanging() const
Definition: porlay.hxx:129
sal_uInt16 GetLines() const
Definition: pordrop.hxx:88
SvxAdjust GetAdjust() const
LanguageType GetLangOfChar(TextFrameIndex nIndex, sal_uInt16 nScript, bool bNoChar=false) const
Definition: txtfrm.cxx:1328
bool InSpaceGrp() const
Definition: porlin.hxx:108
bool m_bRealHeight
should the real height be calculated?
Definition: crstate.hxx:139
sal_uInt16 Height() const
Definition: possiz.hxx:44
SwFont * GetFont()
Definition: inftxt.hxx:238
SwLineLayout * GetNext()
Definition: porlay.hxx:143
sal_uInt16 GetDropLeft() const
Definition: pordrop.hxx:92
bool InNumberGrp() const
Definition: porlin.hxx:101
virtual long CalcSpacing(long nSpaceAdd, const SwTextSizeInfo &rInf) const override
Definition: pormulti.cxx:200
TextFrameIndex GetStart() const
Definition: itrtxt.hxx:88
long Height() const
SwNodeIndex nNode
Definition: pam.hxx:37
sal_uInt8 GetPropr() const
Definition: swfont.hxx:277
bool GetJoinBorderWithPrev() const
Definition: porlin.hxx:167
void SwitchHorizontalToVertical(SwRect &rRect) const
Calculates the coordinates of a rectangle when switching from horizontal to vertical layout...
Definition: txtfrm.cxx:476
sal_uInt16 GetRightBorderSpace() const
Definition: swfont.hxx:890
default
Definition: crstate.hxx:121
bool GetFirstLineOfsWithNum(short &rFirstOffset) const
Returns the combined first line indent of this text node and its numbering.
Definition: ndtxt.cxx:3205
void SetPropFont(const sal_uInt8 nNew)
Definition: itratr.hxx:107
SwTwips GetHangingMargin() const
Definition: porlay.hxx:158
const SwRect & getFramePrintArea() const
Definition: frame.hxx:176
void SetOnWin(const bool bNew)
Definition: inftxt.hxx:200
#define LANGUAGE_KOREAN
sal_uInt8 m_nCursorBidiLevel
Definition: crstate.hxx:137
bool m_bRealWidth
Calculation of the width required.
Definition: crstate.hxx:147
sal_uInt16 GetDropHeight() const
Definition: itrtxt.hxx:205
void Height(long nNew)
Definition: swrect.hxx:189
long GetBottom(const SwRect &rRect) const
Definition: frame.hxx:1339
TextFrameIndex GetOfst() const
Definition: txtfrm.hxx:426
void SetLen(TextFrameIndex const nLen)
Definition: porlin.hxx:74
bool IsSpaceAdd()
Definition: porlay.hxx:165
bool SeekAndChg(SwTextSizeInfo &rInf)
Definition: itrtxt.hxx:310
Cursor Up/Down.
Definition: crstate.hxx:122
long SwTwips
Definition: swtypes.hxx:49
SwDropPortionPart * GetPart() const
Definition: pordrop.hxx:94
This class is used as parameter for creation of a block cursor selection.
bool IsVert() const
Definition: frame.hxx:1328
const SwLineLayout * Next()
Definition: itrtxt.cxx:109
void Pos(const Point &rNew)
Definition: swrect.hxx:167
bool AreListLevelIndentsApplicable() const
Determines, if the list level indent attributes can be applied to the paragraph.
Definition: ndtxt.cxx:4412
const Size & GetSize(SwFontScript nWhich) const
Definition: swfont.hxx:202
SwLineInfo m_aLineInf
Definition: itrtxt.hxx:33
bool checkContext(const SwFrame *pCheck)
Checks if the context of the list is equal to the context of the frame.
void SetKanaComp(std::deque< sal_uInt16 > *pNew)
Definition: inftxt.hxx:329
void SetMulti(const bool bNew)
Definition: inftxt.hxx:211
Of course Writer needs its own rectangles.
Definition: swrect.hxx:34
bool m_bLastCenter
Definition: itrtxt.hxx:48
bool InFieldGrp() const
Definition: porlin.hxx:103
long GetLeftMarginForTabCalculation() const
return left margin for tab stop position calculation
Definition: ndtxt.cxx:3309
SwTwips Y() const
Definition: itrtxt.hxx:90
float x
const boost::optional< editeng::SvxBorderLine > & GetRightBorder() const
Definition: swfont.hxx:338
Collection of SwLineLayout instances, represents the paragraph text in Writer layout.
Definition: porlay.hxx:229
int GetActualListLevel() const
Returns the actual list level of this text node, when it is a list item.
Definition: ndtxt.cxx:4097
const SvxLineSpacingItem * GetLineSpacing() const
Definition: inftxt.hxx:86
SvxAdjust GetOneWord() const
bool Seek(TextFrameIndex nPos)
Enables the attributes used at char pos nPos in the logical font.
Definition: itratr.cxx:305
SvxLineSpaceRule GetLineSpaceRule() const
void GetCharRect_(SwRect *, TextFrameIndex, SwCursorMoveState *)
Definition: itrcrsr.cxx:469
SwFlyInContentFrame * GetFlyFrame()
Definition: porfly.hxx:72
long GetLen(const Point &rPnt)
bool IsMarginPortion() const
Definition: porlin.hxx:123
bool InToxRefOrFieldGrp() const
Definition: porlin.hxx:105
wrapper class for the positioning of Writer fly frames and drawing objects
void GetFlyCursorOfst(Point &rPoint, SwPosition &rPos, SwCursorMoveState *pCMS) const
Definition: porfly.hxx:73
sal_uInt16 GetLineHeight() const
void Top(const long nTop)
Definition: swrect.hxx:202
bool InHyphGrp() const
Definition: porlin.hxx:100
bool IsBreakPortion() const
Definition: porlin.hxx:113
const SwRect & getFrameArea() const
Definition: frame.hxx:175
void setX(long nX)
bool IsInTab() const
Definition: frame.hxx:931
int m_nInNumPortionOffset
distance from number portion's start
Definition: crstate.hxx:162
SwRect & Intersection(const SwRect &rRect)
Definition: swrect.cxx:57
void SetKanaIdx(sal_uInt16 nNew)
Definition: inftxt.hxx:327
SwTwips Right() const
Definition: itrtxt.hxx:181
bool IsTextFrame() const
Definition: frame.hxx:1210
const sal_uInt8 MAXLEVEL
Definition: swtypes.hxx:95
SwTwips nRight
Definition: itrtxt.hxx:145
long GetLeft(const SwRect &rRect) const
Definition: frame.hxx:1340
long GetRight(const SwRect &rRect) const
Definition: frame.hxx:1341
void Right(const long nRight)
Definition: swrect.hxx:198
void setY(long nY)
bool IsFlyInContentFrame() const
Definition: flyfrm.hxx:193
void insertPaM(SwPaM *pPam)
Adds a text portion to the selection list.
if(nullptr==pCandidateA||nullptr==pCandidateB)
SwFontScript GetActual() const
Definition: swfont.hxx:180
const SwRect GetPaintArea() const
|* The paintarea is the area, in which the content of a frame is allowed |* to be displayed...
Definition: ssfrm.cxx:619
SwTextFrame * GetFollow()
Definition: txtfrm.hxx:842
bool InFixMargGrp() const
Definition: porlin.hxx:107
This portion represents a part of the paragraph string.
Definition: portxt.hxx:27
SwNode & GetEndOfContent() const
Regular ContentSection (i.e. the BodyText).
Definition: ndarr.hxx:164
SwTwips CurrWidth() const
Definition: itrtxt.hxx:183
bool IsEmpty() const
Definition: txtfrm.hxx:509
void CalcAscentAndHeight(sal_uInt16 &rAscent, sal_uInt16 &rHeight) const
Definition: itrtxt.cxx:66
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:136
void SetRealHeight(sal_uInt16 nNew)
Definition: porlay.hxx:152
const OUString & GetExp() const
Definition: porfld.hxx:66
bool m_bPrev
Definition: itrtxt.hxx:44
SwTextNode const * GetTextNodeForParaProps() const
Definition: txtfrm.cxx:1288
sal_uInt8 GetLevel() const
Definition: pormulti.hxx:224
bool IsFootnoteNumPortion() const
Definition: porlin.hxx:118
SwTextInfo * m_pInf
Definition: itrtxt.hxx:35
virtual TextFrameIndex GetCursorOfst(sal_uInt16 nOfst) const
the parameter is actually SwTwips apparently?
Definition: porlin.cxx:226
virtual sal_uInt16 GetViewWidth(const SwTextSizeInfo &rInf) const
Definition: porlin.cxx:66
sal_uInt16 AdjustBaseLine(const SwLineLayout &rLine, const SwLinePortion *pPor, sal_uInt16 nPorHeight=0, sal_uInt16 nAscent=0, const bool bAutoToCentered=false) const
Definition: itrtxt.cxx:215
TextFrameIndex GetCursorOfst(SwPosition *pPos, const Point &rPoint, bool bChgNode, SwCursorMoveState *=nullptr) const
Definition: itrcrsr.cxx:1258
sal_uInt16 GetDropDescent() const
Definition: pordrop.hxx:91
SwTwips Left() const
Definition: itrtxt.hxx:333
SwTwips GetLineStart() const
Definition: itrcrsr.cxx:370
Collection of SwLinePortion instances, representing one line of text.
Definition: porlay.hxx:78
const SwLineInfo & GetLineInfo() const
Definition: itrtxt.hxx:128
vcl::RenderContext * GetOut()
Definition: inftxt.hxx:231
static void ResetSpaceAdd(SwLineLayout *pCurr)
Definition: pormulti.cxx:530
void SetFont(SwFont *pNew)
Definition: inftxt.hxx:240
SwParaPortion * GetParaPortion()
Definition: inftxt.hxx:128
bool IsFlyPortion() const
Definition: porlin.hxx:124
sal_uInt16 nDropDescent
Definition: itrtxt.hxx:149
SwTextGridItem const * GetGridItem(SwPageFrame const *const)
Definition: pagechg.cxx:2516
int i
SwLinePortion * GetFirstPortion() const
Definition: porlay.cxx:673
bool IsKernPortion() const
Definition: porlin.hxx:131
bool HasArea() const
Definition: swrect.hxx:290
SvxAdjust GetLastBlock() const
const SvxAdjustItem & GetAdjust(bool=true) const
Definition: paratr.hxx:180
void CtorInitTextMargin(SwTextFrame *pFrame, SwTextSizeInfo *pInf)
Definition: itrcrsr.cxx:162
SwTwips GetLeftMargin() const
Definition: itrtxt.hxx:328
SvxAdjust nAdjust
Definition: itrtxt.hxx:151
const boost::optional< editeng::SvxBorderLine > & GetLeftBorder() const
Definition: swfont.hxx:339
SwNumRule * GetNumRule(bool bInParent=true) const
Returns numbering rule of this text node.
Definition: ndtxt.cxx:2814
const SwLineLayout * GetPrev()
Definition: itrtxt.cxx:84
SvxInterLineSpaceRule GetInterLineSpaceRule() const
SwFont * GetFnt()
Definition: itratr.hxx:103
void Modify(bool bChgToRTL)
Definition: txtfrm.cxx:714
sal_uInt16 GetLineHeight() const
Definition: itrtxt.hxx:116
TextFrameIndex GetIdx() const
Definition: inftxt.hxx:278
const IDocumentSettingAccess * getIDocumentSettingAccess() const
Provides access to the document setting interface.
Definition: node.cxx:2039
bool IsDropPortion() const
Definition: porlin.hxx:120
bool m_bInFrontOfLabel
cursor in front of label
Definition: crstate.hxx:160
void SSize(const Size &rNew)
Definition: swrect.hxx:176
Point m_aRealHeight
contains then the position/height of the cursor
Definition: crstate.hxx:135
bool SnapToGrid() const
Definition: inftxt.hxx:222
SvxNumPositionAndSpaceMode GetPositionAndSpaceMode() const
SwTwips GetLineEnd() const
Definition: itrtxt.hxx:185
TextFrameIndex GetLen() const
Definition: porlin.hxx:73
sal_uInt16 nDropLines
Definition: itrtxt.hxx:150
bool m_bLastBlock
Definition: itrtxt.hxx:47
bool InTabGrp() const
Definition: porlin.hxx:99
bool m_b2Lines
Check 2line portions and fill p2Lines.
Definition: crstate.hxx:148
long X() const
Point GetTopLeft() const
Definition: itrtxt.hxx:186
const OUString & GetText() const
Definition: inftxt.hxx:246
short GetInterLineSpace() const
std::unique_ptr< Sw2LinesPos > m_p2Lines
for selections inside/around 2line portions
Definition: crstate.hxx:133
bool IsHolePortion() const
Definition: porlin.hxx:125
sal_uInt16 nLineOfst
Definition: crstate.hxx:109
sal_uInt16 GetWidth() const
Definition: pordrop.hxx:52
bool IsMultiPortion() const
Definition: porlin.hxx:133
bool m_bOneBlock
Definition: itrtxt.hxx:46
bool m_bFootnoteNoInfo
recognized footnote numbering
Definition: crstate.hxx:142
void SwitchLTRtoRTL(SwRect &rRect) const
Calculates the coordinates of a rectangle when switching from LTR to RTL layout.
Definition: txtfrm.cxx:686
SwTextFrame * m_pFrame
Definition: itrtxt.hxx:34
Base class for anything that can be part of a line in the Writer layout.
Definition: porlin.hxx:49
const SwNumFormat & Get(sal_uInt16 i) const
Definition: number.cxx:83
long GetLLSpaceAdd(sal_uInt16 nIdx)
Definition: porlay.hxx:177
bool m_bInNumPortion
point is in number portion #i23726#
Definition: crstate.hxx:161
void CtorInitTextCursor(SwTextFrame *pFrame, SwTextSizeInfo *pInf)
Definition: itrcrsr.cxx:386
bool IsLayoutFrame() const
Definition: frame.hxx:1146
void Left(const long nLeft)
Definition: swrect.hxx:193
HFONT SelectFont(HDC hDC, HFONT hFont)
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:79
TextFrameIndex m_nStart
Definition: itrtxt.hxx:41
SwTwips nLeft
Definition: itrtxt.hxx:144
void SetLen(const TextFrameIndex nNew)
Definition: inftxt.hxx:281
TextFrameIndex GetLen() const
Definition: pordrop.hxx:51
For the text replacement and restoration of SwTextSizeInfo.
Definition: inftxt.hxx:677
general base class for all free-flowing frames
Definition: flyfrm.hxx:60
TextFrameIndex GetCursorOfst_(SwDrawTextInfo &rInf)
Definition: swfont.hxx:311
long const nLeftMargin
void SetFirstMulti(const bool bNew)
Definition: inftxt.hxx:213
SwTwips mnTabLeft
Definition: itrtxt.hxx:153
sal_uInt8 GetPropFont() const
Definition: itratr.hxx:106
unsigned char sal_uInt8
const SwNodes & GetNodes() const
Definition: ndindex.hxx:155
void Width(long nNew)
Definition: swrect.hxx:185
bool GetJoinBorderWithNext() const
Definition: pordrop.hxx:56
void GetEndCharRect(SwRect *, TextFrameIndex, SwCursorMoveState *=nullptr, const long nMax=0)
Definition: itrcrsr.cxx:394
SwLinePortion * FindLastPortion()
Definition: porlin.cxx:182
bool IsInside(const Point &rPOINT) const
Definition: swrect.cxx:110
SwTwips nFirst
Definition: itrtxt.hxx:146
void SetActual(SwFontScript nNew)
Definition: swfont.hxx:744
IDocumentSettingAccess const & getIDocumentSettingAccess() const
Definition: doc.cxx:208
SvxAdjust GetAdjust() const
Definition: itrtxt.hxx:190
bool OnWin() const
Definition: inftxt.hxx:199
SwTextSizeInfo & GetInfo()
Definition: itrtxt.hxx:216
SwTwips GetAdditionalFirstLineOffset() const
Definition: txtfrm.hxx:626
bool IsRightToLeft() const
Definition: frame.hxx:963
virtual SwPosSize GetTextSize(const SwTextSizeInfo &rInfo) const
Definition: porlin.cxx:234
SwFrame * GetLower()
Definition: findfrm.cxx:169
bool HasFollow() const
Definition: porfld.hxx:88
SwSpecialPos * m_pSpecialPos
for positions inside fields
Definition: crstate.hxx:134
bool InTextGrp() const
Definition: porlin.hxx:97
sal_uInt16 Width() const
Definition: possiz.hxx:46
const SwLineLayout * PrevLine()
Definition: itrtxt.cxx:171
CursorMoveState m_eState
Definition: crstate.hxx:136
double getLength(const B2DPolygon &rCandidate)
void GetCharRect(SwRect *, TextFrameIndex, SwCursorMoveState *=nullptr, const long nMax=0)
Definition: itrcrsr.cxx:1172
SwSPExtendRange
SwSpecialPos.
Definition: crstate.hxx:101
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
SwTwips m_nY
Definition: itrtxt.hxx:39
const SwAttrSet & GetSwAttrSet() const
Does node has already its own auto-attributes? Access to SwAttrSet.
Definition: node.hxx:723
bool m_bPosMatchesBounds
GetCursorOfst should not return the next position if screen position is inside second have of bound r...
Definition: crstate.hxx:150
bool m_bPosCorr
Point had to be corrected.
Definition: crstate.hxx:141
const SwDropPortion * FindDropPortion() const
Definition: porlay.cxx:2175
sal_uInt16 GetRealHeight() const
Definition: porlay.hxx:153
const SwLineLayout * GetNext() const
Definition: itrtxt.hxx:84
sal_uInt16 GetLineWidth() const
Definition: itrtxt.hxx:191
const SwLineLayout * GetCurr() const
Definition: itrtxt.hxx:83
bool IsVertical() const
Definition: frame.hxx:949
long GetTop(const SwRect &rRect) const
Definition: frame.hxx:1338
SwDropPortionPart * GetFollow() const
Definition: pordrop.hxx:48
SwSPExtendRange nExtendRange
Definition: crstate.hxx:110
const SwLineLayout * CharCursorToLine(TextFrameIndex const nPos)
Definition: itrtxt.cxx:203
SwDoc & GetDoc()
Definition: txtfrm.hxx:448
virtual bool GetCursorOfst(SwPosition *, Point &, SwCursorMoveState *=nullptr, bool bTestBackground=false) const override
In nOffset returns the offset of the char within the set text buffer, which is closest to the positio...
Definition: frmcrsr.cxx:662
SwTextFrame * GetTextFrame()
Definition: itrtxt.hxx:134
SwLineLayout * m_pCurr
Definition: itrtxt.hxx:36
void PrtWidth(sal_uInt16 nNewWidth)
Definition: porlin.hxx:79
TextFrameIndex GetEnd() const
Definition: itrtxt.hxx:89
sal_Int32 const nLength
long const nRightMargin
void SetProportion(const sal_uInt8 nNewPropr)
Definition: swfont.hxx:762
void DropInit()
Definition: itrcrsr.cxx:352
bool IsOver(const SwRect &rRect) const
Definition: swrect.cxx:128
bool GetJoinBorderWithNext() const
Definition: porlin.hxx:168
SwLinePortion * GetNextPortion() const
Definition: porlin.hxx:71
bool InFixGrp() const
Definition: porlin.hxx:102
void SetIdx(const TextFrameIndex nNew)
Definition: inftxt.hxx:279
SvxParaVertAlignItem::Align GetVertAlign() const
Definition: inftxt.hxx:92
long GetTextLeft() const
o3tl::strong_int< sal_Int32, struct Tag_TextFrameIndex > TextFrameIndex
Denotes a character index in a text frame at a layout level, after extent mapping from a text node at...
class for collecting anchored objects
Definition: sortedobjs.hxx:48
SwPosition MapViewToModelPos(TextFrameIndex nIndex) const
Definition: txtfrm.cxx:1233
#define LANGUAGE_JAPANESE
bool IsAutoFirst() const
virtual long CalcSpacing(long nSpaceAdd, const SwTextSizeInfo &rInf) const
Definition: porlin.cxx:309
sal_uInt16 nDropLeft
Definition: itrtxt.hxx:147
bool IsFlyCntPortion() const
Definition: porlin.hxx:111
sal_uInt16 GetRubyHeight() const
Definition: tgrditem.hxx:78
sal_uInt16 & GetAscent()
Definition: porlin.hxx:76
const sal_Int32 COMPLETE_STRING
Definition: swtypes.hxx:61
static void lcl_GetCharRectInsideField(SwTextSizeInfo &rInf, SwRect &rOrig, const SwCursorMoveState &rCMS, const SwLinePortion &rPor)
Definition: itrcrsr.cxx:59
long Y() const
bool IsPostItsPortion() const
Definition: porlin.hxx:127
SwFont & GetFont() const
Definition: pordrop.hxx:50
virtual bool FillSelection(SwSelectionList &rList, const SwRect &rRect) const override
Definition: trvlfrm.cxx:361
sal_uInt16 GetDropHeight() const
Definition: pordrop.hxx:90
bool IsProtected() const
Is the Frame or rather the Section in which it lies protected?
Definition: trvlfrm.cxx:1621
bool IsBlankPortion() const
Definition: porlin.hxx:112
bool GetJoinBorderWithPrev() const
Definition: pordrop.hxx:55