LibreOffice Module sw (master)  1
porrst.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 <editeng/lspcitem.hxx>
21 #include <editeng/adjustitem.hxx>
23 #include <editeng/lrspitem.hxx>
24 #include <editeng/pgrditem.hxx>
25 #include <vcl/svapp.hxx>
26 #include <viewsh.hxx>
27 #include <viewopt.hxx>
28 #include <ndtxt.hxx>
29 #include <pagefrm.hxx>
30 #include <paratr.hxx>
31 #include <SwPortionHandler.hxx>
32 #include "porrst.hxx"
33 #include "inftxt.hxx"
34 #include "txtpaint.hxx"
35 #include <swfntcch.hxx>
36 #include <tgrditem.hxx>
37 #include <pagedesc.hxx>
38 #include <frmatr.hxx>
39 #include "redlnitr.hxx"
40 #include "atrhndl.hxx"
41 #include <rootfrm.hxx>
42 
46 
47 #include <crsrsh.hxx>
48 
50 {
51  Height( rPortion.Height() );
52  SetAscent( rPortion.GetAscent() );
54 }
55 
56 void SwTmpEndPortion::Paint( const SwTextPaintInfo &rInf ) const
57 {
58  if (rInf.OnWin() && rInf.GetOpt().IsParagraph())
59  {
60  const SwFont* pOldFnt = rInf.GetFont();
61 
62  SwFont aFont(*pOldFnt);
64  const_cast<SwTextPaintInfo&>(rInf).SetFont(&aFont);
65 
66  // draw the pilcrow
67  rInf.DrawText(OUString(CH_PAR), *this);
68 
69  const_cast<SwTextPaintInfo&>(rInf).SetFont(const_cast<SwFont*>(pOldFnt));
70  }
71 }
72 
74  : SwLinePortion( rPortion )
75 {
78 }
79 
81 {
82  return TextFrameIndex(0);
83 }
84 
85 sal_uInt16 SwBreakPortion::GetViewWidth( const SwTextSizeInfo & ) const
86 { return 0; }
87 
89 { return (GetNextPortion() && GetNextPortion()->InTextGrp() ? nullptr : this); }
90 
91 void SwBreakPortion::Paint( const SwTextPaintInfo &rInf ) const
92 {
93  if( rInf.OnWin() && rInf.GetOpt().IsLineBreak() )
94  rInf.DrawLineBreak( *this );
95 }
96 
98 {
99  const SwLinePortion *pRoot = rInf.GetRoot();
100  Width( 0 );
101  Height( pRoot->Height() );
102  SetAscent( pRoot->GetAscent() );
103  if (rInf.GetIdx() + TextFrameIndex(1) == TextFrameIndex(rInf.GetText().getLength()))
104  rInf.SetNewLine( true );
105  return true;
106 }
107 
109 {
110  rPH.Text( GetLen(), GetWhichPor() );
111 }
112 
114  bool bBG, bool bGK ) :
115  nKern( nKrn ), bBackground( bBG ), bGridKern( bGK )
116 {
117  Height( rPortion.Height() );
118  SetAscent( rPortion.GetAscent() );
121  if( nKern > 0 )
122  Width( nKern );
123  rPortion.Insert( this );
124 }
125 
127  nKern( 0 ), bBackground( false ), bGridKern( true )
128 {
129  Height( rPortion.Height() );
130  SetAscent( rPortion.GetAscent() );
131 
134 }
135 
136 void SwKernPortion::Paint( const SwTextPaintInfo &rInf ) const
137 {
138  if( Width() )
139  {
140  // bBackground is set for Kerning Portions between two fields
141  if ( bBackground )
142  rInf.DrawViewOpt( *this, PortionType::Field );
143 
144  rInf.DrawBackBrush( *this );
146  rInf.DrawBorder( *this );
147 
148  // do we have to repaint a post it portion?
149  if( rInf.OnWin() && mpNextPortion && !mpNextPortion->Width() )
150  mpNextPortion->PrePaint( rInf, this );
151 
152  if( rInf.GetFont()->IsPaintBlank() )
153  {
154  SwRect aClipRect;
155  rInf.CalcRect( *this, &aClipRect );
156  SwSaveClip aClip( const_cast<OutputDevice*>(rInf.GetOut()) );
157  aClip.ChgClip( aClipRect );
158  rInf.DrawText(" ", *this, TextFrameIndex(0), TextFrameIndex(2), true );
159  }
160  }
161 }
162 
164 {
165  if ( bGridKern )
166  return;
167 
168  if( rInf.GetLast() == this )
169  rInf.SetLast( FindPrevPortion( rInf.GetRoot() ) );
170  if( nKern < 0 )
171  Width( -nKern );
172  else
173  Width( 0 );
174  rInf.GetLast()->FormatEOL( rInf );
175 }
176 
178  bLeft( true )
179 {
180  Height( rPortion.Height() );
181  SetAscent( rPortion.GetAscent() );
184 }
185 
187  : bLeft( false )
188 {
189  Height( static_cast<sal_uInt16>(rInf.GetTextFrame()->getFramePrintArea().Height()) );
190  aPos.setX( rInf.GetTextFrame()->getFrameArea().Left() +
191  rInf.GetTextFrame()->getFramePrintArea().Right() );
192  aPos.setY( rInf.GetTextFrame()->getFrameArea().Top() +
193  rInf.GetTextFrame()->getFramePrintArea().Bottom() );
195 }
196 
197 void SwArrowPortion::Paint( const SwTextPaintInfo &rInf ) const
198 {
199  const_cast<SwArrowPortion*>(this)->aPos = rInf.GetPos();
200 }
201 
203 
205 {
206  if (IsCollapse()) {
208  if ( dynamic_cast<const SwCursorShell*>( pSh ) != nullptr ) {
209  SwCursorShell *pCrSh = static_cast<SwCursorShell*>(pSh);
210  // this is called during formatting so avoid recursive layout
211  SwContentFrame const*const pCurrFrame = pCrSh->GetCurrFrame(false);
212  if (pCurrFrame==static_cast<SwContentFrame const *>(this)) {
213  // do nothing
214  } else {
215  return 1;
216  }
217  } else {
218  return 1;
219  }
220  }
221  OSL_ENSURE( ! IsVertical() || ! IsSwapped(),"SwTextFrame::EmptyHeight with swapped frame" );
222 
223  std::unique_ptr<SwFont> pFnt;
224  const SwTextNode& rTextNode = *GetTextNodeForParaProps();
225  const IDocumentSettingAccess* pIDSA = rTextNode.getIDocumentSettingAccess();
227  if ( rTextNode.HasSwAttrSet() )
228  {
229  const SwAttrSet *pAttrSet = &( rTextNode.GetSwAttrSet() );
230  pFnt.reset(new SwFont( pAttrSet, pIDSA ));
231  }
232  else
233  {
234  SwFontAccess aFontAccess( &rTextNode.GetAnyFormatColl(), pSh);
235  pFnt.reset(new SwFont( aFontAccess.Get()->GetFont() ));
236  pFnt->CheckFontCacheId( pSh, pFnt->GetActual() );
237  }
238 
239  if ( IsVertical() )
240  pFnt->SetVertical( 2700 );
241 
242  OutputDevice* pOut = pSh ? pSh->GetOut() : nullptr;
243  if ( !pOut || !pSh->GetViewOptions()->getBrowseMode() ||
244  pSh->GetViewOptions()->IsPrtFormat() )
245  {
246  pOut = rTextNode.getIDocumentDeviceAccess().getReferenceDevice(true);
247  }
248 
249  const IDocumentRedlineAccess& rIDRA = rTextNode.getIDocumentRedlineAccess();
251  && !getRootFrame()->IsHideRedlines())
252  {
253  const SwRedlineTable::size_type nRedlPos = rIDRA.GetRedlinePos( rTextNode, RedlineType::Any );
254  if( SwRedlineTable::npos != nRedlPos )
255  {
256  SwAttrHandler aAttrHandler;
257  aAttrHandler.Init(rTextNode.GetSwAttrSet(),
258  *rTextNode.getIDocumentSettingAccess());
259  SwRedlineItr aRedln( rTextNode, *pFnt, aAttrHandler,
260  nRedlPos, SwRedlineItr::Mode::Show);
261  }
262  }
263 
264  SwTwips nRet;
265  if( !pOut )
266  nRet = IsVertical() ?
267  getFramePrintArea().SSize().Width() + 1 :
268  getFramePrintArea().SSize().Height() + 1;
269  else
270  {
271  pFnt->SetFntChg( true );
272  pFnt->ChgPhysFnt( pSh, *pOut );
273  nRet = pFnt->GetHeight( pSh, *pOut );
274  }
275  return nRet;
276 }
277 
279 {
280  OSL_ENSURE( ! IsVertical() || ! IsSwapped(),"SwTextFrame::FormatEmpty with swapped frame" );
281 
282  bool bCollapse = EmptyHeight( ) == 1 && IsCollapse( );
283 
284  // sw_redlinehide: just disable FormatEmpty optimisation for now
285  if (HasFollow() || GetMergedPara() || GetTextNodeFirst()->GetpSwpHints() ||
286  nullptr != GetTextNodeForParaProps()->GetNumRule() ||
287  GetTextNodeFirst()->HasHiddenCharAttribute(true) ||
288  IsInFootnote() || ( HasPara() && GetPara()->IsPrepMustFit() ) )
289  return false;
291  const SvxAdjust nAdjust = aSet.GetAdjust().GetAdjust();
292  if( !bCollapse && ( ( ( ! IsRightToLeft() && ( SvxAdjust::Left != nAdjust ) ) ||
293  ( IsRightToLeft() && ( SvxAdjust::Right != nAdjust ) ) ) ||
294  aSet.GetRegister().GetValue() ) )
295  return false;
296  const SvxLineSpacingItem &rSpacing = aSet.GetLineSpacing();
297  if( !bCollapse && ( SvxLineSpaceRule::Min == rSpacing.GetLineSpaceRule() ||
298  SvxLineSpaceRule::Fix == rSpacing.GetLineSpaceRule() ||
299  aSet.GetLRSpace().IsAutoFirst() ) )
300  return false;
301 
302  SwTextFly aTextFly( this );
303  SwRect aRect;
304  bool bFirstFlyCheck = 0 != getFramePrintArea().Height();
305  if ( !bCollapse && bFirstFlyCheck &&
306  aTextFly.IsOn() && aTextFly.IsAnyObj( aRect ) )
307  return false;
308 
309  // only need to check one node because of early return on GetMerged()
310  for (SwIndex const* pIndex = GetTextNodeFirst()->GetFirstIndex();
311  pIndex; pIndex = pIndex->GetNext())
312  {
313  sw::mark::IMark const*const pMark = pIndex->GetMark();
314  if (dynamic_cast<const sw::mark::IBookmark*>(pMark) != nullptr)
315  { // need bookmark portions!
316  return false;
317  }
318  }
319 
320  SwTwips nHeight = EmptyHeight();
321 
322  if (aSet.GetParaGrid().GetValue() &&
323  IsInDocBody() )
324  {
325  SwTextGridItem const*const pGrid(GetGridItem(FindPageFrame()));
326  if ( pGrid )
327  nHeight = pGrid->GetBaseHeight() + pGrid->GetRubyHeight();
328  }
329 
330  SwRectFnSet aRectFnSet(this);
331  const SwTwips nChg = nHeight - aRectFnSet.GetHeight(getFramePrintArea());
332 
333  if( !nChg )
334  SetUndersized( false );
335  AdjustFrame( nChg );
336 
337  if( HasBlinkPor() )
338  {
339  ClearPara();
340  ResetBlinkPor();
341  }
342 
343  if (GetHasRotatedPortions())
344  {
345  ClearPara();
346  SetHasRotatedPortions(false);
347  }
348 
349  RemoveFromCache();
350  if( !IsEmpty() )
351  {
352  SetEmpty( true );
354  }
355  if( !bCollapse && !bFirstFlyCheck &&
356  aTextFly.IsOn() && aTextFly.IsAnyObj( aRect ) )
357  return false;
358 
359  // #i35635# - call method <HideAndShowObjects()>
360  // to assure that objects anchored at the empty paragraph are
361  // correctly visible resp. invisible.
363  return true;
364 }
365 
366 bool SwTextFrame::FillRegister( SwTwips& rRegStart, sal_uInt16& rRegDiff )
367 {
368  const SwFrame *pFrame = this;
369  rRegDiff = 0;
370  while( !( ( SwFrameType::Body | SwFrameType::Fly )
371  & pFrame->GetType() ) && pFrame->GetUpper() )
372  pFrame = pFrame->GetUpper();
373  if( ( SwFrameType::Body| SwFrameType::Fly ) & pFrame->GetType() )
374  {
375  SwRectFnSet aRectFnSet(pFrame);
376  rRegStart = aRectFnSet.GetPrtTop(*pFrame);
377  pFrame = pFrame->FindPageFrame();
378  if( pFrame->IsPageFrame() )
379  {
380  SwPageDesc* pDesc = const_cast<SwPageFrame*>(static_cast<const SwPageFrame*>(pFrame))->FindPageDesc();
381  if( pDesc )
382  {
383  rRegDiff = pDesc->GetRegHeight();
384  if( !rRegDiff )
385  {
386  const SwTextFormatColl *pFormat = pDesc->GetRegisterFormatColl();
387  if( pFormat )
388  {
389  const SvxLineSpacingItem &rSpace = pFormat->GetLineSpacing();
390  if( SvxLineSpaceRule::Fix == rSpace.GetLineSpaceRule() )
391  {
392  rRegDiff = rSpace.GetLineHeight();
393  pDesc->SetRegHeight( rRegDiff );
394  pDesc->SetRegAscent( ( 4 * rRegDiff ) / 5 );
395  }
396  else
397  {
399  SwFontAccess aFontAccess( pFormat, pSh );
400  SwFont aFnt( aFontAccess.Get()->GetFont() );
401 
402  OutputDevice *pOut = nullptr;
403  if( !pSh || !pSh->GetViewOptions()->getBrowseMode() ||
404  pSh->GetViewOptions()->IsPrtFormat() )
406 
407  if( pSh && !pOut )
408  pOut = pSh->GetWin();
409 
410  if( !pOut )
412 
413  MapMode aOldMap( pOut->GetMapMode() );
414  pOut->SetMapMode( MapMode( MapUnit::MapTwip ) );
415 
416  aFnt.ChgFnt( pSh, *pOut );
417  rRegDiff = aFnt.GetHeight( pSh, *pOut );
418  sal_uInt16 nNetHeight = rRegDiff;
419 
420  switch( rSpace.GetLineSpaceRule() )
421  {
422  case SvxLineSpaceRule::Auto:
423  break;
424  case SvxLineSpaceRule::Min:
425  {
426  if( rRegDiff < rSpace.GetLineHeight() )
427  rRegDiff = rSpace.GetLineHeight();
428  break;
429  }
430  default:
431  OSL_FAIL( ": unknown LineSpaceRule" );
432  }
433  switch( rSpace.GetInterLineSpaceRule() )
434  {
435  case SvxInterLineSpaceRule::Off:
436  break;
437  case SvxInterLineSpaceRule::Prop:
438  {
439  long nTmp = rSpace.GetPropLineSpace();
440  if( nTmp < 50 )
441  nTmp = nTmp ? 50 : 100;
442  nTmp *= rRegDiff;
443  nTmp /= 100;
444  if( !nTmp )
445  ++nTmp;
446  rRegDiff = static_cast<sal_uInt16>(nTmp);
447  nNetHeight = rRegDiff;
448  break;
449  }
450  case SvxInterLineSpaceRule::Fix:
451  {
452  rRegDiff = rRegDiff + rSpace.GetInterLineSpace();
453  nNetHeight = rRegDiff;
454  break;
455  }
456  default: OSL_FAIL( ": unknown InterLineSpaceRule" );
457  }
458  pDesc->SetRegHeight( rRegDiff );
459  pDesc->SetRegAscent( rRegDiff - nNetHeight +
460  aFnt.GetAscent( pSh, *pOut ) );
461  pOut->SetMapMode( aOldMap );
462  }
463  }
464  }
465  const long nTmpDiff = pDesc->GetRegAscent() - rRegDiff;
466  if ( aRectFnSet.IsVert() )
467  rRegStart -= nTmpDiff;
468  else
469  rRegStart += nTmpDiff;
470  }
471  }
472  }
473  return ( 0 != rRegDiff );
474 }
475 
477 {
478 #ifdef DBG_UTIL
479  OutputDevice* pOut = const_cast<OutputDevice*>(rInf.GetOut());
481  Color aOldColor( pOut->GetFillColor() );
482  pOut->SetFillColor( aCol );
483  Point aPos( rInf.GetPos() );
484  aPos.AdjustY( -150 );
485  aPos.AdjustX( -25 );
486  SwRect aRect( aPos, Size( 100, 200 ) );
487  pOut->DrawRect( aRect.SVRect() );
488  pOut->SetFillColor( aOldColor );
489 #else
490  (void)rInf;
491 #endif
492 }
493 
495 {
496  Width( 0 );
497  rInf.GetTextFrame()->HideFootnotes( rInf.GetIdx(), rInf.GetIdx() + GetLen() );
498 
499  return false;
500 };
501 
503  OUString & rOutString, SwFont & rTmpFont, int &) const
504 {
506  {
507  return false;
508  }
509 
510  switch (mcChar)
511  {
512  case CHAR_ZWSP:
513  rOutString = "/"; break;
514 // case CHAR_LRM :
515 // rText = sal_Unicode(0x2514); break;
516 // case CHAR_RLM :
517 // rText = sal_Unicode(0x2518); break;
518  default:
519  assert(false);
520  break;
521  }
522 
523  rTmpFont.SetEscapement( CHAR_ZWSP == mcChar ? DFLT_ESC_AUTO_SUB : -25 );
524  const sal_uInt16 nProp = 40;
525  rTmpFont.SetProportion( nProp ); // a smaller font
526 
527  return true;
528 }
529 
531  OUString & rOutString, SwFont & rTmpFont, int & rDeltaY) const
532 {
533  if (!rInf.GetOpt().IsShowBookmarks())
534  {
535  return false;
536  }
537 
538  rOutString = OUStringChar(mcChar);
539 
540  // init font: we want OpenSymbol to ensure it doesn't look too crazy;
541  // thin and a bit higher than the surrounding text
542  auto const nOrigAscent(rTmpFont.GetAscent(rInf.GetVsh(), *rInf.GetOut()));
543  rTmpFont.SetName("OpenSymbol", rTmpFont.GetActual());
544  Size size(rTmpFont.GetSize(rTmpFont.GetActual()));
545  // use also the external leading (line gap) of the portion, but don't use
546  // 100% of it because i can't figure out how to baseline align that
547  auto const nFactor = (Height() * 95) / size.Height();
548  rTmpFont.SetProportion(nFactor);
549  rTmpFont.SetWeight(WEIGHT_THIN, rTmpFont.GetActual());
551  // reset these to default...
552  rTmpFont.SetAlign(ALIGN_BASELINE);
553  rTmpFont.SetUnderline(LINESTYLE_NONE);
554  rTmpFont.SetOverline(LINESTYLE_NONE);
555  rTmpFont.SetStrikeout(STRIKEOUT_NONE);
556  rTmpFont.SetOutline(false);
557  rTmpFont.SetShadow(false);
558  rTmpFont.SetTransparent(false);
559  rTmpFont.SetEmphasisMark(FontEmphasisMark::NONE);
560  rTmpFont.SetEscapement(0);
561  rTmpFont.SetPitch(PITCH_DONTKNOW, rTmpFont.GetActual());
562  rTmpFont.SetRelief(FontRelief::NONE);
563 
564  // adjust Y position to account for different baselines of the fonts
565  auto const nOSAscent(rTmpFont.GetAscent(rInf.GetVsh(), *rInf.GetOut()));
566  rDeltaY = nOSAscent - nOrigAscent;
567 
568  return true;
569 }
570 
572 {
573  if ( Width() ) // is only set during prepaint mode
574  {
575  rInf.DrawViewOpt(*this, GetWhichPor());
576 
577  int deltaY(0);
578  SwFont aTmpFont( *rInf.GetFont() );
579  OUString aOutString;
580 
581  if (rInf.OnWin()
582  && !rInf.GetOpt().IsPagePreview()
583  && !rInf.GetOpt().IsReadonly()
584  && DoPaint(rInf, aOutString, aTmpFont, deltaY))
585  {
586  SwFontSave aFontSave( rInf, &aTmpFont );
587 
588  if ( !mnHalfCharWidth )
589  mnHalfCharWidth = rInf.GetTextSize( aOutString ).Width() / 2;
590 
591  Point aOldPos = rInf.GetPos();
592  Point aNewPos( aOldPos );
593  auto const deltaX((Width() / 2) - mnHalfCharWidth);
594  switch (rInf.GetFont()->GetOrientation(rInf.GetTextFrame()->IsVertical()))
595  {
596  case 0:
597  aNewPos.AdjustX(deltaX);
598  aNewPos.AdjustY(deltaY);
599  break;
600  case 900:
601  aNewPos.AdjustY(-deltaX);
602  aNewPos.AdjustX(deltaY);
603  break;
604  case 2700:
605  aNewPos.AdjustY(deltaX);
606  aNewPos.AdjustX(-deltaY);
607  break;
608  default:
609  assert(false);
610  break;
611  }
612  const_cast< SwTextPaintInfo& >( rInf ).SetPos( aNewPos );
613 
614  rInf.DrawText( aOutString, *this );
615 
616  const_cast< SwTextPaintInfo& >( rInf ).SetPos( aOldPos );
617  }
618  }
619 }
620 
622 {
623  const SwLinePortion* pRoot = rInf.GetRoot();
624  Width( 0 );
625  Height( pRoot->Height() );
626  SetAscent( pRoot->GetAscent() );
627 
628  return false;
629 }
630 
631 sal_uInt16 SwControlCharPortion::GetViewWidth( const SwTextSizeInfo& rInf ) const
632 {
633  if( !mnViewWidth )
634  mnViewWidth = rInf.GetTextSize(OUString(' ')).Width();
635 
636  return mnViewWidth;
637 }
638 
640 {
641  assert(!m_pPrevious || m_pPrevious->GetNextPortion() == this);
642  m_pPrevious->SetNextPortion(nullptr);
643  auto const pTmp(m_pPrevious);
644  m_pPrevious = nullptr;
645  return pTmp;
646 }
647 
648 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual SwLinePortion * Compress() override
Definition: porrst.cxx:88
vcl::RenderContext * GetOut() const
Definition: viewsh.hxx:341
void SetHasRotatedPortions(bool bHasRotatedPortions)
Definition: txtftn.cxx:86
bool GetValue() const
Base class of the Writer layout elements.
Definition: frame.hxx:297
virtual bool Format(SwTextFormatInfo &rInf) override
Definition: porrst.cxx:494
const SvxLRSpaceItem & GetLRSpace(bool=true) const
Definition: frmatr.hxx:44
SwLinePortion * Unchain()
Definition: porrst.cxx:639
static Color & GetFieldShadingsColor()
Definition: viewopt.cxx:430
SwViewShell * GetVsh()
Definition: inftxt.hxx:228
void DrawBackBrush(const SwLinePortion &rPor) const
Definition: inftxt.cxx:1154
virtual bool DoPaint(SwTextPaintInfo const &rInf, OUString &rOutString, SwFont &rTmpFont, int &rDeltaY) const override
Definition: porrst.cxx:530
sal_uInt16 GetPropLineSpace() const
Represents the style of a paragraph.
Definition: fmtcol.hxx:55
SwTwips EmptyHeight() const
Definition: porrst.cxx:204
bool IsPagePreview() const
Definition: viewopt.hxx:608
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: porrst.cxx:476
SwPageDesc * FindPageDesc()
Definition: pagechg.cxx:746
bool IsInDocBody() const
Definition: frame.hxx:921
SvxAdjust GetAdjust() const
SwFont & GetFont()
Definition: swfntcch.hxx:58
sal_uInt16 Height() const
Definition: possiz.hxx:44
SwFont * GetFont()
Definition: inftxt.hxx:238
sal_uInt16 mnViewWidth
Definition: porrst.hxx:135
bool IsSwapped() const
Definition: txtfrm.hxx:530
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: porrst.cxx:91
SwBreakPortion(const SwLinePortion &rPortion)
Definition: porrst.cxx:73
sal_uInt16 GetRegHeight() const
Definition: pagedesc.hxx:237
bool IsAnyObj(const SwRect &rRect) const
true when a frame or DrawObj must be taken in account.
Definition: txtfly.cxx:405
SwLinePortion * m_pPrevious
Definition: porrst.hxx:160
bool GetHasRotatedPortions() const
Definition: txtfrm.hxx:525
bool HasPara() const
Definition: txtfrm.hxx:814
Point aPos
Definition: porrst.hxx:89
IDocumentDeviceAccess const & getIDocumentDeviceAccess() const
Definition: doc.cxx:237
long Height() const
void SetCompletePaint() const
Definition: frame.hxx:972
SwArrowPortion(const SwLinePortion &rPortion)
Definition: porrst.cxx:177
bool IsInFootnote() const
Definition: frame.hxx:927
sal_uInt16 char char * pDesc
bool GetJoinBorderWithPrev() const
Definition: porlin.hxx:168
SwFrameType GetType() const
Definition: frame.hxx:500
virtual bool DoPaint(SwTextPaintInfo const &rInf, OUString &rOutString, SwFont &rTmpFont, int &rDeltaY) const
Definition: porrst.cxx:502
const SwRect & getFramePrintArea() const
Definition: frame.hxx:178
The SwPortionHandler interface implements a visitor for the layout engine's text portions.
WEIGHT_THIN
sw::MergedPara * GetMergedPara()
Definition: txtfrm.hxx:442
The purpose of this class is to be the universal interface between formatting/text output and the pos...
Definition: txtfly.hxx:119
void SetLast(SwLinePortion *pNewLast)
Definition: inftxt.hxx:568
void DrawBorder(const SwLinePortion &rPor) const
Draw character border around a line portion.
Definition: inftxt.cxx:1301
void SetEmphasisMark(const FontEmphasisMark eValue)
Definition: swfont.hxx:685
bool HasFollow() const
Definition: flowfrm.hxx:165
virtual sal_uInt16 GetViewWidth(const SwTextSizeInfo &rInf) const override
Definition: porrst.cxx:85
SwParaPortion * GetPara()
Definition: txtcache.cxx:89
void Height(long nNew)
Definition: swrect.hxx:191
bool bGridKern
Definition: porrst.hxx:67
long SwTwips
Definition: swtypes.hxx:49
const SvxLineSpacingItem & GetLineSpacing(bool=true) const
Paragraph-attributes - implemented in paratr.hxx.
Definition: paratr.hxx:212
bool IsVert() const
Definition: frame.hxx:1345
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:747
void HideAndShowObjects()
Hides respectively shows objects, which are anchored at paragraph, at/as a character of the paragraph...
Definition: txtfrm.cxx:1536
const Size & GetSize(SwFontScript nWhich) const
Definition: swfont.hxx:205
#define DFLT_ESC_AUTO_SUB
Of course Writer needs its own rectangles.
Definition: swrect.hxx:35
void SetOutline(const bool bOutline)
Definition: swfont.hxx:603
long GetPrtTop(const SwFrame &rFrame) const
Definition: frame.hxx:1387
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:382
virtual void Text(TextFrameIndex nLength, PortionType nType, sal_Int32 nHeight=0, sal_Int32 nWidth=0)=0
(empty) destructor
void SetPitch(const FontPitch ePitch, const SwFontScript nWhich)
Definition: swfont.hxx:504
SvxLineSpaceRule GetLineSpaceRule() const
static bool IsShowChanges(const RedlineFlags eM)
const SwIndex * GetNext() const
Definition: index.hxx:102
void SetColor(const Color &rColor)
Definition: swfont.hxx:414
SwKernPortion(SwLinePortion &rPortion, short nKrn, bool bBG=false, bool bGridKern=false)
Definition: porrst.cxx:113
static OutputDevice * GetDefaultDevice()
short nKern
Definition: porrst.hxx:65
void SetShadow(const bool bShadow)
Definition: swfont.hxx:618
const SwRegisterItem & GetRegister(bool=true) const
Definition: paratr.hxx:184
bool IsReadonly() const
Definition: viewopt.hxx:436
sal_uInt16 mnHalfCharWidth
Definition: porrst.hxx:136
virtual sal_uInt16 GetViewWidth(const SwTextSizeInfo &rInf) const override
Definition: porrst.cxx:631
sal_uInt16 GetLineHeight() const
void Top(const long nTop)
Definition: swrect.hxx:204
virtual void FormatEOL(SwTextFormatInfo &rInf) override
Definition: porrst.cxx:163
LINESTYLE_NONE
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: porrst.cxx:571
const SwRect & getFrameArea() const
Definition: frame.hxx:177
bool getBrowseMode() const
Definition: viewopt.hxx:445
sal_uInt16 GetAscent(SwViewShell const *pSh, const OutputDevice &rOut)
Definition: swfont.hxx:326
void ResetBlinkPor() const
Definition: txtfrm.hxx:879
Used by Attribute Iterators to organize attributes on stacks to find the valid attribute in each cate...
Definition: atrhndl.hxx:40
oslFileHandle & pOut
void SetUnderline(const FontLineStyle eUnderline)
Definition: swfont.hxx:545
virtual bool Format(SwTextFormatInfo &rInf) override
Definition: porrst.cxx:97
void Right(const long nRight)
Definition: swrect.hxx:200
const IDocumentDeviceAccess & getIDocumentDeviceAccess() const
Provides access to the document device interface.
Definition: node.cxx:2067
void SetStrikeout(const FontStrikeout eStrikeout)
Definition: swfont.hxx:575
void SetAlign(const FontAlign eAlign)
Definition: swfont.hxx:517
SwFontScript GetActual() const
Definition: swfont.hxx:183
void DrawRect(const tools::Rectangle &rRect)
SwFormatColl & GetAnyFormatColl() const
Definition: node.hxx:716
void SetUndersized(const bool bNew)
Definition: flowfrm.hxx:157
bool IsEmpty() const
Definition: txtfrm.hxx:513
SwTextNode * GetTextNodeFirst()
Definition: txtfrm.hxx:449
const SwViewOption & GetOpt() const
Definition: inftxt.hxx:245
virtual SwRedlineTable::size_type GetRedlinePos(const SwNode &rNode, RedlineType nType) const =0
SwTextNode const * GetTextNodeForParaProps() const
Definition: txtfrm.cxx:1290
void SetRegHeight(sal_uInt16 const nNew)
Definition: pagedesc.hxx:239
ALIGN_BASELINE
void SetTransparent(const bool bTrans)
Definition: swfont.hxx:643
void Init(const SwAttrSet &rAttrSet, const IDocumentSettingAccess &rIDocumentSettingAccess)
Definition: atrstck.cxx:278
TextFrameIndex nLineLength
Definition: porlin.hxx:56
const IDocumentRedlineAccess & getIDocumentRedlineAccess() const
Provides access to the document redline interface.
Definition: node.cxx:2068
SvxAdjust
bool IsCollapse() const
Definition: calcmove.cxx:1058
vcl::RenderContext * GetOut()
Definition: inftxt.hxx:231
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: porrst.cxx:197
void DrawLineBreak(const SwLinePortion &rPor) const
Definition: inftxt.cxx:992
SwPageFrame * FindPageFrame()
Definition: frame.hxx:660
void SetWhichPor(const PortionType nNew)
Definition: porlin.hxx:94
SwTextGridItem const * GetGridItem(SwPageFrame const *const)
Definition: pagechg.cxx:2515
vector_type::size_type size_type
Definition: docary.hxx:228
bool IsParagraph(bool bHard=false) const
Definition: viewopt.hxx:231
SwLayoutFrame * GetUpper()
Definition: frame.hxx:658
void SetFillColor()
void SetRelief(const FontRelief eNew)
Definition: swfont.hxx:711
const SvxAdjustItem & GetAdjust(bool=true) const
Definition: paratr.hxx:180
Marks a character position inside a document model node.
Definition: index.hxx:37
void CalcRect(const SwLinePortion &rPor, SwRect *pRect, SwRect *pIntersect=nullptr, const bool bInsideBox=false) const
Calculate the rectangular area where the portion takes place.
Definition: inftxt.cxx:752
const SwTextFormatColl * GetRegisterFormatColl() const
retrieve the style for the grid alignment
Definition: pagedesc.cxx:204
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: porrst.cxx:136
SwLineLayout * GetRoot()
Definition: inftxt.hxx:563
void SetEscapement(const short nNewEsc)
Definition: swfont.hxx:784
Provides access to settings of a document.
PITCH_DONTKNOW
SvxInterLineSpaceRule GetInterLineSpaceRule() const
size
#define NON_PRINTING_CHARACTER_COLOR
Definition: txtfrm.hxx:50
#define CHAR_ZWSP
Definition: swtypes.hxx:177
TextFrameIndex GetIdx() const
Definition: inftxt.hxx:278
void SetWeight(const FontWeight eWeight, const SwFontScript nWhich)
Definition: swfont.hxx:532
const IDocumentSettingAccess * getIDocumentSettingAccess() const
Provides access to the document setting interface.
Definition: node.cxx:2066
bool IsLineBreak(bool bHard=false) const
Definition: viewopt.hxx:247
void RemoveFromCache()
Removes this frame completely from the Cache.
Definition: txtcache.cxx:119
const SvxLineSpacingItem & GetLineSpacing(bool=true) const
Definition: paratr.hxx:178
bool HasSwAttrSet() const
Definition: node.hxx:444
void PrePaint(const SwTextPaintInfo &rInf, const SwLinePortion *pLast) const
Definition: porlin.cxx:76
void SSize(const Size &rNew)
Definition: swrect.hxx:178
static bool IsFieldShadings()
Definition: viewopt.hxx:644
bool FillRegister(SwTwips &rRegStart, sal_uInt16 &rRegDiff)
Determines the start position and step size of the register.
Definition: porrst.cxx:366
TextFrameIndex GetLen() const
Definition: porlin.hxx:74
A page of the document layout.
Definition: pagefrm.hxx:40
SwTextFrame * GetTextFrame()
Definition: inftxt.hxx:291
bool IsPaintBlank() const
Definition: swfont.hxx:260
const OUString & GetText() const
Definition: inftxt.hxx:246
short GetInterLineSpace() const
virtual TextFrameIndex GetModelPositionForViewPoint(sal_uInt16 nOfst) const override
the parameter is actually SwTwips apparently?
Definition: porrst.cxx:80
SwLinePortion * mpNextPortion
Definition: porlin.hxx:54
virtual SwLinePortion * Compress() override
Definition: porrst.cxx:202
sal_uInt16 GetRegAscent() const
Definition: pagedesc.hxx:238
const Point & GetPos() const
Definition: inftxt.hxx:435
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:195
bool bBackground
Definition: porrst.hxx:66
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:80
void Bottom(const long nBottom)
Definition: swrect.hxx:209
SwFontObj * Get()
Definition: swfntcch.cxx:56
tools::Rectangle SVRect() const
Definition: swrect.hxx:280
void ChgClip(const SwRect &rRect, const SwTextFrame *pFrame=nullptr, bool bEnlargeRect=false, sal_Int32 nEnlargeTop=0, sal_Int32 nEnlargeBottom=0)
Definition: txtpaint.hxx:46
SwContentFrame * GetCurrFrame(const bool bCalcFrame=true) const
Get current frame in which the cursor is positioned.
Definition: crsrsh.cxx:2440
PortionType GetWhichPor() const
Definition: porlin.hxx:95
virtual bool Format(SwTextFormatInfo &rInf) override
Definition: porrst.cxx:621
void ClearPara()
Removes the Line information from the Cache but retains the entry itself.
Definition: txtcache.cxx:103
const SwViewOption * GetViewOptions() const
Definition: viewsh.hxx:426
vcl::Window * GetWin() const
Definition: viewsh.hxx:340
const SvxParaGridItem & GetParaGrid(bool=true) const
Definition: paratr.hxx:206
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: porrst.cxx:56
void AdjustFrame(const SwTwips nChgHeight, bool bHasToFit=false)
Definition: frmform.cxx:362
bool OnWin() const
Definition: inftxt.hxx:199
bool IsRightToLeft() const
Definition: frame.hxx:965
bool FormatEmpty()
Definition: porrst.cxx:278
bool IsPageFrame() const
Definition: frame.hxx:1156
SwLinePortion * FindPrevPortion(const SwLinePortion *pRoot)
Definition: porlin.cxx:209
bool InTextGrp() const
Definition: porlin.hxx:98
virtual OutputDevice * getReferenceDevice(bool bCreate) const =0
Returns the current reference device.
sal_uInt16 Width() const
Definition: possiz.hxx:46
bool IsPrtFormat() const
Definition: viewopt.hxx:514
SwLinePortion * GetLast()
Definition: inftxt.hxx:567
long GetHeight(const SwRect &rRect) const
Definition: frame.hxx:1360
bool IsHideRedlines() const
Replacement for sw::DocumentRedlineManager::GetRedlineFlags() (this is layout-level redline hiding)...
Definition: rootfrm.hxx:416
#define CHAR_ZWNBSP
Definition: swtypes.hxx:178
void SetNextPortion(SwLinePortion *pNew)
Definition: porlin.hxx:76
const SwAttrSet & GetSwAttrSet() const
Does node has already its own auto-attributes? Access to SwAttrSet.
Definition: node.hxx:723
void SetName(const OUString &rName, const SwFontScript nWhich)
Definition: swfont.hxx:464
bool IsShowBookmarks(bool const bHard=false) const
Definition: viewopt.hxx:241
void SetAscent(const sal_uInt16 nNewAsc)
Definition: porlin.hxx:79
bool IsVertical() const
Definition: frame.hxx:951
void SetNewLine(const bool bNew)
Definition: inftxt.hxx:585
virtual RedlineFlags GetRedlineFlags() const =0
Query the currently set redline mode.
SwDoc & GetDoc()
Definition: txtfrm.hxx:452
bool IsOn() const
Definition: txtfly.hxx:313
const SwIndex * GetFirstIndex() const
Definition: index.hxx:129
const sal_Unicode CH_PAR
Definition: swfont.hxx:45
bool HasBlinkPor() const
Definition: txtfrm.hxx:523
STRIKEOUT_NONE
virtual void FormatEOL(SwTextFormatInfo &rInf)
Definition: porlin.cxx:265
sal_uInt16 GetBaseHeight() const
Definition: tgrditem.hxx:75
void SetProportion(const sal_uInt8 nNewPropr)
Definition: swfont.hxx:765
bool GetJoinBorderWithNext() const
Definition: porlin.hxx:169
SwLinePortion * GetNextPortion() const
Definition: porlin.hxx:72
void SetEmpty(const bool bNew)
Definition: txtfrm.hxx:241
SwViewShell * GetCurrShell() const
Definition: rootfrm.hxx:204
virtual void HandlePortion(SwPortionHandler &rPH) const override
Definition: porrst.cxx:108
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...
SwNumRule * GetNumRule(SwTextFormatColl &rTextFormatColl)
determines the list style, which directly set at the given paragraph style
Definition: fmtcol.cxx:74
static constexpr size_type npos
Definition: docary.hxx:229
bool IsAutoFirst() const
sal_Unicode mcChar
Definition: porrst.hxx:138
void SetOverline(const FontLineStyle eOverline)
Definition: swfont.hxx:560
sal_uInt16 GetRubyHeight() const
Definition: tgrditem.hxx:78
sal_uInt16 & GetAscent()
Definition: porlin.hxx:77
virtual SwLinePortion * Insert(SwLinePortion *pPortion)
Definition: porlin.cxx:168
SwRootFrame * getRootFrame()
Definition: frame.hxx:659
void DrawViewOpt(const SwLinePortion &rPor, PortionType nWhich) const
Definition: inftxt.cxx:1313
void SetRegAscent(sal_uInt16 const nNew)
Definition: pagedesc.hxx:240
void HideFootnotes(TextFrameIndex nStart, TextFrameIndex nEnd)
Definition: txtfrm.cxx:1442
const Color & GetFillColor() const
SwTmpEndPortion(const SwLinePortion &rPortion)
Definition: porrst.cxx:49
typedef void(CALLTYPE *GetFuncDataPtr)(sal_uInt16 &nNo