LibreOffice Module sw (master)  1
txttab.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 <comphelper/string.hxx>
22 #include <editeng/tstpitem.hxx>
23 #include <rtl/ustrbuf.hxx>
25 #include <doc.hxx>
26 #include <SwPortionHandler.hxx>
27 
28 #include <viewopt.hxx>
29 #include "portab.hxx"
30 #include "inftxt.hxx"
31 #include "itrform2.hxx"
32 #include <txtfrm.hxx>
33 #include "porfld.hxx"
34 #include <memory>
35 
43 const SvxTabStop *SwLineInfo::GetTabStop( const SwTwips nSearchPos, const SwTwips nRight ) const
44 {
45  for( sal_uInt16 i = 0; i < pRuler->Count(); ++i )
46  {
47  const SvxTabStop &rTabStop = pRuler->operator[](i);
48  if( rTabStop.GetTabPos() > SwTwips(nRight) )
49  return i ? nullptr : &rTabStop;
50 
51  if( rTabStop.GetTabPos() > nSearchPos )
52  return &rTabStop;
53  }
54  return nullptr;
55 }
56 
57 sal_uInt16 SwLineInfo::NumberOfTabStops() const
58 {
59  return pRuler->Count();
60 }
61 
63 {
64  sal_Unicode cFill = 0;
65  sal_Unicode cDec = 0;
66  SvxTabAdjust eAdj;
67 
68  sal_uInt16 nNewTabPos;
69  bool bAutoTabStop = true;
70  {
71  const bool bRTL = m_pFrame->IsRightToLeft();
72  // #i24363# tab stops relative to indent
73  // nTabLeft: The absolute value, the tab stops are relative to: Tabs origin.
74 
75  // #i91133#
76  const bool bTabsRelativeToIndent =
78  const SwTwips nTabLeft = bRTL
79  ? m_pFrame->getFrameArea().Right() -
80  ( bTabsRelativeToIndent ? GetTabLeft() : 0 )
81  : m_pFrame->getFrameArea().Left() +
82  ( bTabsRelativeToIndent ? GetTabLeft() : 0 );
83 
84  // The absolute position, where we started the line formatting
85  SwTwips nLinePos = GetLeftMargin();
86  if ( bRTL )
87  {
88  Point aPoint( nLinePos, 0 );
89  m_pFrame->SwitchLTRtoRTL( aPoint );
90  nLinePos = aPoint.X();
91  }
92 
93  // The current position, relative to the line start
94  SwTwips nTabPos = rInf.GetLastTab() ? rInf.GetLastTab()->GetTabPos() : 0;
95  if( nTabPos < rInf.X() )
96  {
97  nTabPos = rInf.X();
98  }
99 
100  // The current position in absolute coordinates
101  const SwTwips nCurrentAbsPos = bRTL ?
102  nLinePos - nTabPos :
103  nLinePos + nTabPos;
104 
105  SwTwips nMyRight;
106  if ( m_pFrame->IsVertLR() )
107  nMyRight = Left();
108  else
109  nMyRight = Right();
110 
111  if ( m_pFrame->IsVertical() )
112  {
113  Point aRightTop( nMyRight, m_pFrame->getFrameArea().Top() );
114  m_pFrame->SwitchHorizontalToVertical( aRightTop );
115  nMyRight = aRightTop.Y();
116  }
117 
118  SwTwips nNextPos = 0;
119 
120  // #i24363# tab stops relative to indent
121  // nSearchPos: The current position relative to the tabs origin
122  const SwTwips nSearchPos = bRTL ?
123  nTabLeft - nCurrentAbsPos :
124  nCurrentAbsPos - nTabLeft;
125 
126  // First, we examine the tab stops set at the paragraph style or
127  // any hard set tab stops:
128  // Note: If there are no user defined tab stops, there is always a
129  // default tab stop.
130  const SvxTabStop* pTabStop = m_aLineInf.GetTabStop( nSearchPos, nMyRight );
131  if ( pTabStop )
132  {
133  cFill = ' ' != pTabStop->GetFill() ? pTabStop->GetFill() : 0;
134  cDec = pTabStop->GetDecimal();
135  eAdj = pTabStop->GetAdjustment();
136  nNextPos = pTabStop->GetTabPos();
137  if(!bTabsRelativeToIndent && eAdj == SvxTabAdjust::Default && nSearchPos < 0)
138  {
139  //calculate default tab position of default tabs in negative indent
140  nNextPos = ( nSearchPos / nNextPos ) * nNextPos;
141  }
142  bAutoTabStop = false;
143  }
144  else
145  {
146  sal_uInt16 nDefTabDist = m_aLineInf.GetDefTabStop();
147  if( USHRT_MAX == nDefTabDist )
148  {
149  const SvxTabStopItem& rTab =
151  if( rTab.Count() )
152  nDefTabDist = static_cast<sal_uInt16>(rTab[0].GetTabPos());
153  else
154  nDefTabDist = SVX_TAB_DEFDIST;
155  m_aLineInf.SetDefTabStop( nDefTabDist );
156  }
157  SwTwips nCount = nSearchPos;
158 
159  // Minimum tab stop width is 1
160  if (nDefTabDist <= 0)
161  nDefTabDist = 1;
162 
163  nCount /= nDefTabDist;
164  nNextPos = ( nCount < 0 || ( !nCount && nSearchPos <= 0 ) )
165  ? ( nCount * nDefTabDist )
166  : ( ( nCount + 1 ) * nDefTabDist );
167 
168  // --> FME 2004-09-21 #117919 Minimum tab stop width is 1 or 51 twips:
169  const SwTwips nMinimumTabWidth = m_pFrame->GetDoc().getIDocumentSettingAccess().get(DocumentSettingId::TAB_COMPAT) ? 0 : 50;
170  if( ( bRTL && nTabLeft - nNextPos >= nCurrentAbsPos - nMinimumTabWidth ) ||
171  ( !bRTL && nNextPos + nTabLeft <= nCurrentAbsPos + nMinimumTabWidth ) )
172  {
173  nNextPos += nDefTabDist;
174  }
175  cFill = 0;
176  eAdj = SvxTabAdjust::Left;
177  }
178 
179  // #i115705# - correction and refactoring:
180  // overrule determined next tab stop position in order to apply
181  // a tab stop at the left margin under the following conditions:
182  // - the new tab portion is inside the hanging indent
183  // - a tab stop at the left margin is allowed
184  // - the determined next tab stop is a default tab stop position OR
185  // the determined next tab stop is beyond the left margin
186  {
187  long nLeftMarginTabPos = 0;
188  {
189  if ( !bTabsRelativeToIndent )
190  {
191  if ( bRTL )
192  {
193  Point aPoint( Left(), 0 );
194  m_pFrame->SwitchLTRtoRTL( aPoint );
195  nLeftMarginTabPos = m_pFrame->getFrameArea().Right() - aPoint.X();
196  }
197  else
198  {
199  nLeftMarginTabPos = Left() - m_pFrame->getFrameArea().Left();
200  }
201  }
203  {
205  while( pPor && !pPor->IsFlyPortion() )
206  {
207  pPor = pPor->GetNextPortion();
208  }
209  if ( pPor )
210  {
211  nLeftMarginTabPos += pPor->Width();
212  }
213  }
214  }
215  const bool bNewTabPortionInsideHangingIndent =
216  bRTL ? nCurrentAbsPos > nTabLeft - nLeftMarginTabPos
217  : nCurrentAbsPos < nTabLeft + nLeftMarginTabPos;
218  if ( bNewTabPortionInsideHangingIndent )
219  {
220  // If the paragraph is not inside a list having a list tab stop following
221  // the list label or no further tab stop found in such a paragraph or
222  // the next tab stop position does not equal the list tab stop,
223  // a tab stop at the left margin can be applied. If this condition is
224  // not hold, it is overruled by compatibility option TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST.
225  const bool bTabAtLeftMarginAllowed =
227  !pTabStop ||
228  nNextPos != m_aLineInf.GetListTabStopPosition() ) ||
229  // compatibility option TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST:
232  if ( bTabAtLeftMarginAllowed )
233  {
234  if ( !pTabStop || eAdj == SvxTabAdjust::Default ||
235  ( nNextPos > nLeftMarginTabPos ) )
236  {
237  eAdj = SvxTabAdjust::Default;
238  cFill = 0;
239  nNextPos = nLeftMarginTabPos;
240  }
241  }
242  }
243  }
244 
245  nNextPos += bRTL ? nLinePos - nTabLeft : nTabLeft - nLinePos;
246  OSL_ENSURE( nNextPos >= 0, "GetTabStop: Don't go back!" );
247  nNewTabPos = sal_uInt16(nNextPos);
248  }
249 
250  SwTabPortion *pTabPor = nullptr;
251  if ( bAuto )
252  {
253  if ( SvxTabAdjust::Decimal == eAdj &&
255  pTabPor = new SwAutoTabDecimalPortion( nNewTabPos, cDec, cFill );
256  }
257  else
258  {
259  switch( eAdj )
260  {
261  case SvxTabAdjust::Right :
262  {
263  pTabPor = new SwTabRightPortion( nNewTabPos, cFill );
264  break;
265  }
266  case SvxTabAdjust::Center :
267  {
268  pTabPor = new SwTabCenterPortion( nNewTabPos, cFill );
269  break;
270  }
271  case SvxTabAdjust::Decimal :
272  {
273  pTabPor = new SwTabDecimalPortion( nNewTabPos, cDec, cFill );
274  break;
275  }
276  default:
277  {
278  OSL_ENSURE( SvxTabAdjust::Left == eAdj || SvxTabAdjust::Default == eAdj,
279  "+SwTextFormatter::NewTabPortion: unknown adjustment" );
280  pTabPor = new SwTabLeftPortion( nNewTabPos, cFill, bAutoTabStop );
281  break;
282  }
283  }
284  }
285 
286  return pTabPor;
287 }
288 
292 SwTabPortion::SwTabPortion( const sal_uInt16 nTabPosition, const sal_Unicode cFillChar, const bool bAutoTab )
293  : SwFixPortion(), nTabPos(nTabPosition), cFill(cFillChar), bAutoTabStop( bAutoTab )
294 {
296  OSL_ENSURE(!IsFilled() || ' ' != cFill, "SwTabPortion::CTOR: blanks ?!");
298 }
299 
301 {
302  SwTabPortion *pLastTab = rInf.GetLastTab();
303  if( pLastTab == this )
304  return PostFormat( rInf );
305  if( pLastTab )
306  pLastTab->PostFormat( rInf );
307  return PreFormat( rInf );
308 }
309 
311 {
312  if( rInf.GetLastTab() == this )
313  PostFormat( rInf );
314 }
315 
317 {
318  OSL_ENSURE( rInf.X() <= GetTabPos(), "SwTabPortion::PreFormat: rush hour" );
319 
320  // Here we settle down ...
321  SetFix( static_cast<sal_uInt16>(rInf.X()) );
322 
324  const bool bTabCompat = rIDSA.get(DocumentSettingId::TAB_COMPAT);
325  const bool bTabOverflow = rIDSA.get(DocumentSettingId::TAB_OVERFLOW);
326  const bool bTabOverMargin = rIDSA.get(DocumentSettingId::TAB_OVER_MARGIN);
327 
328  // The minimal width of a tab is one blank at least.
329  // #i37686# In compatibility mode, the minimum width
330  // should be 1, even for non-left tab stops.
331  sal_uInt16 nMinimumTabWidth = 1;
332  if ( !bTabCompat )
333  {
334  // #i89179#
335  // tab portion representing the list tab of a list label gets the
336  // same font as the corresponding number portion
337  std::unique_ptr< SwFontSave > pSave;
338  if ( GetLen() == TextFrameIndex(0) &&
339  rInf.GetLast() && rInf.GetLast()->InNumberGrp() &&
340  static_cast<SwNumberPortion*>(rInf.GetLast())->HasFont() )
341  {
342  const SwFont* pNumberPortionFont =
343  static_cast<SwNumberPortion*>(rInf.GetLast())->GetFont();
344  pSave.reset( new SwFontSave( rInf, const_cast<SwFont*>(pNumberPortionFont) ) );
345  }
346  OUString aTmp( ' ' );
347  SwTextSizeInfo aInf( rInf, &aTmp );
348  nMinimumTabWidth = aInf.GetTextSize().Width();
349  }
350  PrtWidth( nMinimumTabWidth );
351 
352  // Break tab stop to next line if:
353  // 1. Minimal width does not fit to line anymore.
354  // 2. An underflow event was called for the tab portion.
355  bool bFull = ( bTabCompat && rInf.IsUnderflow() ) ||
356  ( rInf.Width() <= rInf.X() + PrtWidth() && rInf.X() <= rInf.Width() ) ;
357 
358  // #95477# Rotated tab stops get the width of one blank
359  const sal_uInt16 nDir = rInf.GetFont()->GetOrientation( rInf.GetTextFrame()->IsVertical() );
360 
361  if( ! bFull && 0 == nDir )
362  {
363  const PortionType nWhich = GetWhichPor();
364  switch( nWhich )
365  {
369  {
370  if( PortionType::TabDecimal == nWhich )
371  rInf.SetTabDecimal(
372  static_cast<SwTabDecimalPortion*>(this)->GetTabDecimal());
373  rInf.SetLastTab( this );
374  break;
375  }
377  {
378  // handle this case in PostFormat
379  if( bTabOverMargin && !bAutoTabStop && GetTabPos() > rInf.Width() )
380  {
381  rInf.SetLastTab( this );
382  break;
383  }
384 
385  PrtWidth( static_cast<sal_uInt16>(GetTabPos() - rInf.X()) );
386  bFull = rInf.Width() <= rInf.X() + PrtWidth();
387 
388  // In tabulator compatibility mode, we reset the bFull flag
389  // if the tabulator is at the end of the paragraph and the
390  // tab stop position is outside the frame:
391  bool bAtParaEnd = rInf.GetIdx() + GetLen() == TextFrameIndex(rInf.GetText().getLength());
392  if ( bFull && bTabCompat &&
393  ( ( bTabOverflow && ( rInf.IsTabOverflow() || !bAutoTabStop ) ) || bAtParaEnd ) &&
394  GetTabPos() >= rInf.GetTextFrame()->getFrameArea().Width() )
395  {
396  bFull = false;
397  if ( bTabOverflow && !bAutoTabStop )
398  rInf.SetTabOverflow( true );
399  }
400 
401  break;
402  }
403  default: OSL_ENSURE( false, "SwTabPortion::PreFormat: unknown adjustment" );
404  }
405  }
406 
407  if( bFull )
408  {
409  // We have to look for endless loops, if the width is smaller than one blank
410  if( rInf.GetIdx() == rInf.GetLineStart() &&
411  // #119175# TabStop should be forced to current
412  // line if there is a fly reducing the line width:
413  !rInf.GetFly() )
414  {
415  PrtWidth( static_cast<sal_uInt16>(rInf.Width() - rInf.X()) );
416  SetFixWidth( PrtWidth() );
417  }
418  else
419  {
420  Height( 0 );
421  Width( 0 );
422  SetLen( TextFrameIndex(0) );
423  SetAscent( 0 );
424  SetNextPortion( nullptr ); //?????
425  }
426  return true;
427  }
428  else
429  {
430  // A trick with impact: The new Tabportions now behave like
431  // FlyFrames, located in the line - including adjustment !
432  SetFixWidth( PrtWidth() );
433  return false;
434  }
435 }
436 
438 {
440  // If the tab position is larger than the right margin, it gets scaled down by default.
441  // However, if compat mode enabled, we allow tabs to go over the margin: the rest of the paragraph is not broken into lines.
442  const sal_uInt16 nRight = bTabOverMargin ? GetTabPos() : std::min(GetTabPos(), rInf.Width());
443  const SwLinePortion *pPor = GetNextPortion();
444 
445  sal_uInt16 nPorWidth = 0;
446  while( pPor )
447  {
448  nPorWidth = nPorWidth + pPor->Width();
449  pPor = pPor->GetNextPortion();
450  }
451 
452  const PortionType nWhich = GetWhichPor();
454 
455  if ( bTabOverMargin && PortionType::TabLeft == nWhich )
456  {
457  nPorWidth = 0;
458  }
459 
460  // #127428# Abandon dec. tab position if line is full
461  if ( bTabCompat && PortionType::TabDecimal == nWhich )
462  {
463  sal_uInt16 nPrePorWidth = static_cast<const SwTabDecimalPortion*>(this)->GetWidthOfPortionsUpToDecimalPosition();
464 
465  // no value was set => no decimal character was found
466  if ( USHRT_MAX != nPrePorWidth )
467  {
468  if ( !bTabOverMargin && nPrePorWidth && nPorWidth - nPrePorWidth > rInf.Width() - nRight )
469  {
470  nPrePorWidth += nPorWidth - nPrePorWidth - ( rInf.Width() - nRight );
471  }
472 
473  nPorWidth = nPrePorWidth - 1;
474  }
475  }
476 
477  if( PortionType::TabCenter == nWhich )
478  {
479  // centered tabs are problematic:
480  // We have to detect how much fits into the line.
481  sal_uInt16 nNewWidth = nPorWidth /2;
482  if( !bTabOverMargin && nNewWidth > rInf.Width() - nRight )
483  nNewWidth = nPorWidth - (rInf.Width() - nRight);
484  nPorWidth = nNewWidth;
485  }
486 
487  const sal_uInt16 nDiffWidth = nRight - GetFix();
488 
489  if( nDiffWidth > nPorWidth )
490  {
491  const sal_uInt16 nOldWidth = GetFixWidth();
492  const sal_uInt16 nAdjDiff = nDiffWidth - nPorWidth;
493  if( nAdjDiff > GetFixWidth() )
494  PrtWidth( nAdjDiff );
495  // Don't be afraid: we have to move rInf further.
496  // The right-tab till now only had the width of one blank.
497  // Now that we stretched, the difference had to be added to rInf.X() !
498  rInf.X( rInf.X() + PrtWidth() - nOldWidth );
499  }
500  SetFixWidth( PrtWidth() );
501  // reset last values
502  rInf.SetLastTab(nullptr);
503  if( PortionType::TabDecimal == nWhich )
504  rInf.SetTabDecimal(0);
505 
506  return rInf.Width() <= rInf.X();
507 }
508 
512 void SwTabPortion::Paint( const SwTextPaintInfo &rInf ) const
513 {
514  // #i89179#
515  // tab portion representing the list tab of a list label gets the
516  // same font as the corresponding number portion
517  std::unique_ptr< SwFontSave > pSave;
518  bool bAfterNumbering = false;
519  if (GetLen() == TextFrameIndex(0))
520  {
521  const SwLinePortion* pPrevPortion =
522  const_cast<SwTabPortion*>(this)->FindPrevPortion( rInf.GetParaPortion() );
523  if ( pPrevPortion &&
524  pPrevPortion->InNumberGrp() &&
525  static_cast<const SwNumberPortion*>(pPrevPortion)->HasFont() )
526  {
527  const SwFont* pNumberPortionFont =
528  static_cast<const SwNumberPortion*>(pPrevPortion)->GetFont();
529  pSave.reset( new SwFontSave( rInf, const_cast<SwFont*>(pNumberPortionFont) ) );
530  bAfterNumbering = true;
531  }
532  }
533  rInf.DrawBackBrush( *this );
534  if( !bAfterNumbering )
535  rInf.DrawBorder( *this );
536 
537  // do we have to repaint a post it portion?
538  if( rInf.OnWin() && mpNextPortion && !mpNextPortion->Width() )
539  mpNextPortion->PrePaint( rInf, this );
540 
541  // display special characters
542  if( rInf.OnWin() && rInf.GetOpt().IsTab() )
543  {
544  // filled tabs are shaded in gray
545  if( IsFilled() )
546  rInf.DrawViewOpt( *this, PortionType::Table );
547  else
548  rInf.DrawTab( *this );
549  }
550 
551  // Tabs should be underlined at once
552  if( rInf.GetFont()->IsPaintBlank() )
553  {
554  // Tabs with filling/filled tabs
555  const sal_uInt16 nCharWidth = rInf.GetTextSize(OUString(' ')).Width();
556 
557  // Robust:
558  if( nCharWidth )
559  {
560  // Always with kerning, also on printer!
561  sal_uInt16 nChar = Width() / nCharWidth;
562  OUStringBuffer aBuf;
563  comphelper::string::padToLength(aBuf, nChar, ' ');
564  rInf.DrawText(aBuf.makeStringAndClear(), *this, TextFrameIndex(0),
565  TextFrameIndex(nChar), true);
566  }
567  }
568 
569  // Display fill characters
570  if( IsFilled() )
571  {
572  // Tabs with filling/filled tabs
573  const sal_uInt16 nCharWidth = rInf.GetTextSize(OUString(cFill)).Width();
574  OSL_ENSURE( nCharWidth, "!SwTabPortion::Paint: sophisticated tabchar" );
575 
576  // Robust:
577  if( nCharWidth )
578  {
579  // Always with kerning, also on printer!
580  sal_uInt16 nChar = Width() / nCharWidth;
581  if ( cFill == '_' )
582  ++nChar; // to avoid gaps
583  OUStringBuffer aBuf;
585  rInf.DrawText(aBuf.makeStringAndClear(), *this, TextFrameIndex(0),
586  TextFrameIndex(nChar), true);
587  }
588  }
589 }
590 
592 {
593 }
594 
596 {
597  rPH.Text( GetLen(), GetWhichPor(), Height(), Width() );
598 }
599 
600 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void DrawBackBrush(const SwLinePortion &rPor) const
Definition: inftxt.cxx:1193
sal_uInt16 Count() const
bool IsUnderflow() const
Definition: inftxt.hxx:588
sal_uInt16 Height() const
Definition: possiz.hxx:44
SwFont * GetFont()
Definition: inftxt.hxx:238
bool PreFormat(SwTextFormatInfo &rInf)
Definition: txttab.cxx:316
bool InNumberGrp() const
Definition: porlin.hxx:102
void SetFix(const sal_uInt16 nNewFix)
Definition: porglue.hxx:55
SwTwips GetTabLeft() const
Definition: itrtxt.hxx:197
void SetFixWidth(const sal_uInt16 nNew)
Definition: porglue.hxx:38
void SwitchHorizontalToVertical(SwRect &rRect) const
Calculates the coordinates of a rectangle when switching from horizontal to vertical layout...
Definition: txtfrm.cxx:471
long GetListTabStopPosition() const
Definition: inftxt.hxx:105
The SwPortionHandler interface implements a visitor for the layout engine's text portions.
std::unique_ptr< SvxTabStopItem > pRuler
Definition: inftxt.hxx:70
SwTabPortion * NewTabPortion(SwTextFormatInfo &rInf, bool bAuto) const
Definition: txttab.cxx:62
SwTabPortion * GetLastTab()
Definition: inftxt.hxx:620
void DrawBorder(const SwLinePortion &rPor) const
Draw character border around a line portion.
Definition: inftxt.cxx:1340
aBuf
virtual void Paint(const SwTextPaintInfo &rInf) const override
Ex: LineIter::DrawTab()
Definition: txttab.cxx:512
void SetLen(TextFrameIndex const nLen)
Definition: porlin.hxx:75
bool PostFormat(SwTextFormatInfo &rInf)
Definition: txttab.cxx:437
long SwTwips
Definition: swtypes.hxx:49
void DrawText(const OUString &rText, const SwLinePortion &rPor, TextFrameIndex nIdx=TextFrameIndex(0), TextFrameIndex nLen=TextFrameIndex(COMPLETE_STRING), const bool bKern=false) const
Definition: inftxt.hxx:746
SwLineInfo m_aLineInf
Definition: itrtxt.hxx:33
sal_uInt16 GetFix() const
Definition: porglue.hxx:56
bool HasForcedLeftMargin() const
Definition: porlay.hxx:127
sal_uInt16 GetOrientation(const bool bVertLayout=false, const bool bVertFormatLRBT=false) const
Definition: swfont.cxx:433
SwPosSize GetTextSize(OutputDevice *pOut, const SwScriptInfo *pSI, const OUString &rText, TextFrameIndex nIdx, TextFrameIndex nLen) const
Definition: inftxt.cxx:384
virtual void Text(TextFrameIndex nLength, PortionType nType, sal_Int32 nHeight=0, sal_Int32 nWidth=0)=0
(empty) destructor
void SetDefTabStop(sal_uInt16 nNew) const
Definition: inftxt.hxx:88
bool IsFilled() const
Definition: portab.hxx:38
sal_uInt16 sal_Unicode
void Top(const long nTop)
Definition: swrect.hxx:202
void SetLastTab(SwTabPortion *pNew)
Definition: inftxt.hxx:621
bool IsTabOverflow() const
Definition: inftxt.hxx:666
const SwRect & getFrameArea() const
Definition: frame.hxx:175
#define RES_PARATR_TABSTOP
Definition: hintids.hxx:260
int nCount
SwTwips Right() const
Definition: itrtxt.hxx:181
sal_Int32 & GetTabPos()
sal_Unicode & GetDecimal()
void Right(const long nRight)
Definition: swrect.hxx:198
TextFrameIndex GetLineStart() const
Definition: inftxt.hxx:595
SwAttrPool * GetPool() const
Definition: swatrset.hxx:190
const SwAttrSet * GetAttrSet() const
WARNING: this may not return correct RES_PAGEDESC/RES_BREAK items for SwTextFrame, use GetBreakItem()/GetPageDescItem() instead.
Definition: findfrm.cxx:674
SvxTabAdjust & GetAdjustment()
const bool bAutoTabStop
Definition: portab.hxx:28
SwTabPortion(const sal_uInt16 nTabPos, const sal_Unicode cFill, const bool bAutoTab=true)
The base class is initialized without setting anything.
Definition: txttab.cxx:292
const SwViewOption & GetOpt() const
Definition: inftxt.hxx:245
TextFrameIndex nLineLength
Definition: porlin.hxx:56
SwTwips Left() const
Definition: itrtxt.hxx:333
SwParaPortion * GetParaPortion()
Definition: inftxt.hxx:128
void SetWhichPor(const PortionType nNew)
Definition: porlin.hxx:94
bool IsFlyPortion() const
Definition: porlin.hxx:125
int i
SwTwips GetLeftMargin() const
Definition: itrtxt.hxx:328
sal_uInt16 Width() const
Definition: inftxt.hxx:533
Provides access to settings of a document.
bool IsTab(bool bHard=false) const
Definition: viewopt.hxx:212
PortionType
Definition: txttypes.hxx:23
sal_uInt16 GetTabPos() const
Definition: portab.hxx:39
void DrawTab(const SwLinePortion &rPor) const
Definition: inftxt.cxx:1014
TextFrameIndex GetIdx() const
Definition: inftxt.hxx:278
void SetTabDecimal(const sal_Unicode cNew)
Definition: inftxt.hxx:623
const SvxTabStop * GetTabStop(const SwTwips nSearchPos, const SwTwips nRight) const
#i24363# tab stops relative to indent
Definition: txttab.cxx:43
void SetTabOverflow(bool bOverflow)
Definition: inftxt.hxx:665
void PrePaint(const SwTextPaintInfo &rInf, const SwLinePortion *pLast) const
Definition: porlin.cxx:79
const SfxPoolItem & GetDefaultItem(sal_uInt16 nWhich) const
TextFrameIndex GetLen() const
Definition: porlin.hxx:74
SwTextFrame * GetTextFrame()
Definition: inftxt.hxx:291
long X() const
bool IsPaintBlank() const
Definition: swfont.hxx:260
const OUString & GetText() const
Definition: inftxt.hxx:246
SwLinePortion * mpNextPortion
Definition: porlin.hxx:54
SwTwips X() const
Definition: inftxt.hxx:385
void SwitchLTRtoRTL(SwRect &rRect) const
Calculates the coordinates of a rectangle when switching from LTR to RTL layout.
Definition: txtfrm.cxx:681
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:50
void Left(const long nLeft)
Definition: swrect.hxx:193
virtual bool Format(SwTextFormatInfo &rInf) override
Definition: txttab.cxx:300
bool IsVertLR() const
Definition: frame.hxx:955
virtual void Paint(const SwTextPaintInfo &rInf) const override
Ex: LineIter::DrawTab()
Definition: txttab.cxx:591
sal_uInt16 GetDefTabStop() const
Definition: inftxt.hxx:87
sal_Unicode & GetFill()
sal_uInt16 NumberOfTabStops() const
Definition: txttab.cxx:57
PortionType GetWhichPor() const
Definition: porlin.hxx:95
void Width(long nNew)
Definition: swrect.hxx:185
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
Definition: unosett.cxx:253
#define SVX_TAB_DEFDIST
IDocumentSettingAccess const & getIDocumentSettingAccess() const
Definition: doc.cxx:175
bool OnWin() const
Definition: inftxt.hxx:199
bool IsRightToLeft() const
Definition: frame.hxx:963
SwLinePortion * FindPrevPortion(const SwLinePortion *pRoot)
Definition: porlin.cxx:211
sal_uInt16 Width() const
Definition: possiz.hxx:46
SwLinePortion * GetLast()
Definition: inftxt.hxx:566
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
const sal_Unicode cFill
Definition: portab.hxx:27
void SetNextPortion(SwLinePortion *pNew)
Definition: porlin.hxx:76
void SetAscent(const sal_uInt16 nNewAsc)
Definition: porlin.hxx:79
bool IsVertical() const
Definition: frame.hxx:949
SwDoc & GetDoc()
Definition: txtfrm.hxx:450
SwLineLayout * m_pCurr
Definition: itrtxt.hxx:36
bool IsListTabStopIncluded() const
Definition: inftxt.hxx:101
sal_uInt16 PrtWidth() const
Definition: porlin.hxx:81
SwFlyPortion * GetFly()
Definition: inftxt.hxx:614
sal_uInt16 GetFixWidth() const
Definition: porglue.hxx:37
SwLinePortion * GetNextPortion() const
Definition: porlin.hxx:72
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...
virtual void FormatEOL(SwTextFormatInfo &rInf) override
Definition: txttab.cxx:310
void DrawViewOpt(const SwLinePortion &rPor, PortionType nWhich) const
Definition: inftxt.cxx:1352
SvxTabAdjust
virtual void HandlePortion(SwPortionHandler &rPH) const override
Definition: txttab.cxx:595
OStringBuffer & padToLength(OStringBuffer &rBuffer, sal_Int32 nLength, char cFill= '\0')