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