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  return;
60 
61  const SwFont* pOldFnt = rInf.GetFont();
62 
63  SwFont aFont(*pOldFnt);
65  const_cast<SwTextPaintInfo&>(rInf).SetFont(&aFont);
66 
67  // draw the pilcrow
68  rInf.DrawText(CH_PAR, *this);
69 
70  const_cast<SwTextPaintInfo&>(rInf).SetFont(const_cast<SwFont*>(pOldFnt));
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  return;
140 
141  // bBackground is set for Kerning Portions between two fields
142  if ( bBackground )
143  rInf.DrawViewOpt( *this, PortionType::Field );
144 
145  rInf.DrawBackBrush( *this );
147  rInf.DrawBorder( *this );
148 
149  // do we have to repaint a post it portion?
150  if( rInf.OnWin() && mpNextPortion && !mpNextPortion->Width() )
151  mpNextPortion->PrePaint( rInf, this );
152 
153  if( rInf.GetFont()->IsPaintBlank() )
154  {
155  SwRect aClipRect;
156  rInf.CalcRect( *this, &aClipRect );
157  SwSaveClip aClip( const_cast<OutputDevice*>(rInf.GetOut()) );
158  aClip.ChgClip( aClipRect );
159  rInf.DrawText(" ", *this, TextFrameIndex(0), TextFrameIndex(2), true );
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 ( auto pCrSh = dynamic_cast<SwCursorShell*>( pSh ) ) {
209  // this is called during formatting so avoid recursive layout
210  SwContentFrame const*const pCurrFrame = pCrSh->GetCurrFrame(false);
211  if (pCurrFrame==static_cast<SwContentFrame const *>(this)) {
212  // do nothing
213  } else {
214  return 1;
215  }
216  } else {
217  return 1;
218  }
219  }
220  OSL_ENSURE( ! IsVertical() || ! IsSwapped(),"SwTextFrame::EmptyHeight with swapped frame" );
221 
222  std::unique_ptr<SwFont> pFnt;
223  const SwTextNode& rTextNode = *GetTextNodeForParaProps();
224  const IDocumentSettingAccess* pIDSA = rTextNode.getIDocumentSettingAccess();
226  if ( rTextNode.HasSwAttrSet() )
227  {
228  const SwAttrSet *pAttrSet = &( rTextNode.GetSwAttrSet() );
229  pFnt.reset(new SwFont( pAttrSet, pIDSA ));
230  }
231  else
232  {
233  SwFontAccess aFontAccess( &rTextNode.GetAnyFormatColl(), pSh);
234  pFnt.reset(new SwFont( aFontAccess.Get()->GetFont() ));
235  pFnt->CheckFontCacheId( pSh, pFnt->GetActual() );
236  }
237 
238  if ( IsVertical() )
239  pFnt->SetVertical( Degree10(2700) );
240 
241  OutputDevice* pOut = pSh ? pSh->GetOut() : nullptr;
242  if ( !pOut || !pSh->GetViewOptions()->getBrowseMode() ||
243  pSh->GetViewOptions()->IsPrtFormat() )
244  {
245  pOut = rTextNode.getIDocumentDeviceAccess().getReferenceDevice(true);
246  }
247 
248  const IDocumentRedlineAccess& rIDRA = rTextNode.getIDocumentRedlineAccess();
250  && !getRootFrame()->IsHideRedlines())
251  {
252  const SwRedlineTable::size_type nRedlPos = rIDRA.GetRedlinePos( rTextNode, RedlineType::Any );
253  if( SwRedlineTable::npos != nRedlPos )
254  {
255  SwAttrHandler aAttrHandler;
256  aAttrHandler.Init(rTextNode.GetSwAttrSet(),
257  *rTextNode.getIDocumentSettingAccess());
258  SwRedlineItr aRedln( rTextNode, *pFnt, aAttrHandler,
259  nRedlPos, SwRedlineItr::Mode::Show);
260  }
261  }
262 
263  SwTwips nRet;
264  if( !pOut )
265  nRet = IsVertical() ?
266  getFramePrintArea().SSize().Width() + 1 :
267  getFramePrintArea().SSize().Height() + 1;
268  else
269  {
270  pFnt->SetFntChg( true );
271  pFnt->ChgPhysFnt( pSh, *pOut );
272  nRet = pFnt->GetHeight( pSh, *pOut );
273  }
274  return nRet;
275 }
276 
278 {
279  OSL_ENSURE( ! IsVertical() || ! IsSwapped(),"SwTextFrame::FormatEmpty with swapped frame" );
280 
281  bool bCollapse = EmptyHeight( ) == 1 && IsCollapse( );
282 
283  // sw_redlinehide: just disable FormatEmpty optimisation for now
284  if (HasFollow() || GetMergedPara() || GetTextNodeFirst()->GetpSwpHints() ||
285  nullptr != GetTextNodeForParaProps()->GetNumRule() ||
286  GetTextNodeFirst()->HasHiddenCharAttribute(true) ||
287  IsInFootnote() || ( HasPara() && GetPara()->IsPrepMustFit() ) )
288  return false;
290  const SvxAdjust nAdjust = aSet.GetAdjust().GetAdjust();
291  if( !bCollapse && ( ( ( ! IsRightToLeft() && ( SvxAdjust::Left != nAdjust ) ) ||
292  ( IsRightToLeft() && ( SvxAdjust::Right != nAdjust ) ) ) ||
293  aSet.GetRegister().GetValue() ) )
294  return false;
295  const SvxLineSpacingItem &rSpacing = aSet.GetLineSpacing();
296  if( !bCollapse && ( SvxLineSpaceRule::Min == rSpacing.GetLineSpaceRule() ||
297  SvxLineSpaceRule::Fix == rSpacing.GetLineSpaceRule() ||
298  aSet.GetLRSpace().IsAutoFirst() ) )
299  return false;
300 
301  SwTextFly aTextFly( this );
302  SwRect aRect;
303  bool bFirstFlyCheck = 0 != getFramePrintArea().Height();
304  if ( !bCollapse && bFirstFlyCheck &&
305  aTextFly.IsOn() && aTextFly.IsAnyObj( aRect ) )
306  return false;
307 
308  // only need to check one node because of early return on GetMerged()
309  for (SwIndex const* pIndex = GetTextNodeFirst()->GetFirstIndex();
310  pIndex; pIndex = pIndex->GetNext())
311  {
312  sw::mark::IMark const*const pMark = pIndex->GetMark();
313  if (dynamic_cast<const sw::mark::IBookmark*>(pMark) != nullptr)
314  { // need bookmark portions!
315  return false;
316  }
317  }
318 
319  SwTwips nHeight = EmptyHeight();
320 
321  if (aSet.GetParaGrid().GetValue() &&
322  IsInDocBody() )
323  {
324  SwTextGridItem const*const pGrid(GetGridItem(FindPageFrame()));
325  if ( pGrid )
326  nHeight = pGrid->GetBaseHeight() + pGrid->GetRubyHeight();
327  }
328 
329  SwRectFnSet aRectFnSet(this);
330  const SwTwips nChg = nHeight - aRectFnSet.GetHeight(getFramePrintArea());
331 
332  if( !nChg )
333  SetUndersized( false );
334  AdjustFrame( nChg );
335 
336  if (GetHasRotatedPortions())
337  {
338  ClearPara();
339  SetHasRotatedPortions(false);
340  }
341 
342  RemoveFromCache();
343  if( !IsEmpty() )
344  {
345  SetEmpty( true );
347  }
348  if( !bCollapse && !bFirstFlyCheck &&
349  aTextFly.IsOn() && aTextFly.IsAnyObj( aRect ) )
350  return false;
351 
352  // #i35635# - call method <HideAndShowObjects()>
353  // to assure that objects anchored at the empty paragraph are
354  // correctly visible resp. invisible.
356  return true;
357 }
358 
359 bool SwTextFrame::FillRegister( SwTwips& rRegStart, sal_uInt16& rRegDiff )
360 {
361  const SwFrame *pFrame = this;
362  rRegDiff = 0;
363  while( !( ( SwFrameType::Body | SwFrameType::Fly )
364  & pFrame->GetType() ) && pFrame->GetUpper() )
365  pFrame = pFrame->GetUpper();
366  if( ( SwFrameType::Body| SwFrameType::Fly ) & pFrame->GetType() )
367  {
368  SwRectFnSet aRectFnSet(pFrame);
369  rRegStart = aRectFnSet.GetPrtTop(*pFrame);
370  pFrame = pFrame->FindPageFrame();
371  if( pFrame->IsPageFrame() )
372  {
373  SwPageDesc* pDesc = const_cast<SwPageFrame*>(static_cast<const SwPageFrame*>(pFrame))->FindPageDesc();
374  if( pDesc )
375  {
376  rRegDiff = pDesc->GetRegHeight();
377  if( !rRegDiff )
378  {
379  const SwTextFormatColl *pFormat = pDesc->GetRegisterFormatColl();
380  if( pFormat )
381  {
382  const SvxLineSpacingItem &rSpace = pFormat->GetLineSpacing();
383  if( SvxLineSpaceRule::Fix == rSpace.GetLineSpaceRule() )
384  {
385  rRegDiff = rSpace.GetLineHeight();
386  pDesc->SetRegHeight( rRegDiff );
387  pDesc->SetRegAscent( ( 4 * rRegDiff ) / 5 );
388  }
389  else
390  {
392  SwFontAccess aFontAccess( pFormat, pSh );
393  SwFont aFnt( aFontAccess.Get()->GetFont() );
394 
395  OutputDevice *pOut = nullptr;
396  if( !pSh || !pSh->GetViewOptions()->getBrowseMode() ||
397  pSh->GetViewOptions()->IsPrtFormat() )
399 
400  if( pSh && !pOut )
401  pOut = pSh->GetWin();
402 
403  if( !pOut )
405 
406  MapMode aOldMap( pOut->GetMapMode() );
407  pOut->SetMapMode( MapMode( MapUnit::MapTwip ) );
408 
409  aFnt.ChgFnt( pSh, *pOut );
410  rRegDiff = aFnt.GetHeight( pSh, *pOut );
411  sal_uInt16 nNetHeight = rRegDiff;
412 
413  switch( rSpace.GetLineSpaceRule() )
414  {
415  case SvxLineSpaceRule::Auto:
416  break;
417  case SvxLineSpaceRule::Min:
418  {
419  if( rRegDiff < rSpace.GetLineHeight() )
420  rRegDiff = rSpace.GetLineHeight();
421  break;
422  }
423  default:
424  OSL_FAIL( ": unknown LineSpaceRule" );
425  }
426  switch( rSpace.GetInterLineSpaceRule() )
427  {
428  case SvxInterLineSpaceRule::Off:
429  break;
430  case SvxInterLineSpaceRule::Prop:
431  {
432  tools::Long nTmp = rSpace.GetPropLineSpace();
433  if( nTmp < 50 )
434  nTmp = nTmp ? 50 : 100;
435  nTmp *= rRegDiff;
436  nTmp /= 100;
437  if( !nTmp )
438  ++nTmp;
439  rRegDiff = static_cast<sal_uInt16>(nTmp);
440  nNetHeight = rRegDiff;
441  break;
442  }
443  case SvxInterLineSpaceRule::Fix:
444  {
445  rRegDiff = rRegDiff + rSpace.GetInterLineSpace();
446  nNetHeight = rRegDiff;
447  break;
448  }
449  default: OSL_FAIL( ": unknown InterLineSpaceRule" );
450  }
451  pDesc->SetRegHeight( rRegDiff );
452  pDesc->SetRegAscent( rRegDiff - nNetHeight +
453  aFnt.GetAscent( pSh, *pOut ) );
454  pOut->SetMapMode( aOldMap );
455  }
456  }
457  }
458  const tools::Long nTmpDiff = pDesc->GetRegAscent() - rRegDiff;
459  if ( aRectFnSet.IsVert() )
460  rRegStart -= nTmpDiff;
461  else
462  rRegStart += nTmpDiff;
463  }
464  }
465  }
466  return ( 0 != rRegDiff );
467 }
468 
470 {
471 #ifdef DBG_UTIL
472  OutputDevice* pOut = const_cast<OutputDevice*>(rInf.GetOut());
474  Color aOldColor( pOut->GetFillColor() );
475  pOut->SetFillColor( aCol );
476  Point aPos( rInf.GetPos() );
477  aPos.AdjustY( -150 );
478  aPos.AdjustX( -25 );
479  SwRect aRect( aPos, Size( 100, 200 ) );
480  pOut->DrawRect( aRect.SVRect() );
481  pOut->SetFillColor( aOldColor );
482 #else
483  (void)rInf;
484 #endif
485 }
486 
488 {
489  Width( 0 );
490  rInf.GetTextFrame()->HideFootnotes( rInf.GetIdx(), rInf.GetIdx() + GetLen() );
491 
492  return false;
493 };
494 
496  OUString & rOutString, SwFont & rTmpFont, int &) const
497 {
499  {
500  return false;
501  }
502 
503  switch (mcChar)
504  {
505  case CHAR_ZWSP:
506  rOutString = "/"; break;
507 // case CHAR_LRM :
508 // rText = sal_Unicode(0x2514); break;
509 // case CHAR_RLM :
510 // rText = sal_Unicode(0x2518); break;
511  default:
512  assert(false);
513  break;
514  }
515 
516  rTmpFont.SetEscapement( CHAR_ZWSP == mcChar ? DFLT_ESC_AUTO_SUB : -25 );
517  const sal_uInt16 nProp = 40;
518  rTmpFont.SetProportion( nProp ); // a smaller font
519 
520  return true;
521 }
522 
523 bool SwBookmarkPortion::DoPaint(SwTextPaintInfo const& rTextPaintInfo,
524  OUString & rOutString, SwFont & rFont, int & rDeltaY) const
525 {
526  if (!rTextPaintInfo.GetOpt().IsShowBookmarks())
527  {
528  return false;
529  }
530 
531  rOutString = OUStringChar(mcChar);
532 
533  // init font: we want OpenSymbol to ensure it doesn't look too crazy;
534  // thin and a bit higher than the surrounding text
535  auto const nOrigAscent(rFont.GetAscent(rTextPaintInfo.GetVsh(), *rTextPaintInfo.GetOut()));
536  rFont.SetName("OpenSymbol", rFont.GetActual());
537  Size aSize(rFont.GetSize(rFont.GetActual()));
538  // use also the external leading (line gap) of the portion, but don't use
539  // 100% of it because i can't figure out how to baseline align that
540  auto const nFactor = (Height() * 95) / aSize.Height();
541  rFont.SetProportion(nFactor);
542  rFont.SetWeight(WEIGHT_THIN, rFont.GetActual());
544  // reset these to default...
545  rFont.SetAlign(ALIGN_BASELINE);
549  rFont.SetOutline(false);
550  rFont.SetShadow(false);
551  rFont.SetTransparent(false);
552  rFont.SetEmphasisMark(FontEmphasisMark::NONE);
553  rFont.SetEscapement(0);
554  rFont.SetPitch(PITCH_DONTKNOW, rFont.GetActual());
555  rFont.SetRelief(FontRelief::NONE);
556 
557  // adjust Y position to account for different baselines of the fonts
558  auto const nOSAscent(rFont.GetAscent(rTextPaintInfo.GetVsh(), *rTextPaintInfo.GetOut()));
559  rDeltaY = nOSAscent - nOrigAscent;
560 
561  return true;
562 }
563 
565 {
566  if ( !Width() ) // is only set during prepaint mode
567  return;
568 
569  rInf.DrawViewOpt(*this, GetWhichPor());
570 
571  int deltaY(0);
572  SwFont aTmpFont( *rInf.GetFont() );
573  OUString aOutString;
574 
575  if (!(rInf.OnWin()
576  && !rInf.GetOpt().IsPagePreview()
577  && !rInf.GetOpt().IsReadonly()
578  && DoPaint(rInf, aOutString, aTmpFont, deltaY)))
579  return;
580 
581  SwFontSave aFontSave( rInf, &aTmpFont );
582 
583  if ( !mnHalfCharWidth )
584  mnHalfCharWidth = rInf.GetTextSize( aOutString ).Width() / 2;
585 
586  Point aOldPos = rInf.GetPos();
587  Point aNewPos( aOldPos );
588  auto const deltaX((Width() / 2) - mnHalfCharWidth);
589  switch (rInf.GetFont()->GetOrientation(rInf.GetTextFrame()->IsVertical()).get())
590  {
591  case 0:
592  aNewPos.AdjustX(deltaX);
593  aNewPos.AdjustY(deltaY);
594  break;
595  case 900:
596  aNewPos.AdjustY(-deltaX);
597  aNewPos.AdjustX(deltaY);
598  break;
599  case 2700:
600  aNewPos.AdjustY(deltaX);
601  aNewPos.AdjustX(-deltaY);
602  break;
603  default:
604  assert(false);
605  break;
606  }
607  const_cast< SwTextPaintInfo& >( rInf ).SetPos( aNewPos );
608 
609  rInf.DrawText( aOutString, *this );
610 
611  const_cast< SwTextPaintInfo& >( rInf ).SetPos( aOldPos );
612 }
613 
615 {
616  const SwLinePortion* pRoot = rInf.GetRoot();
617  Width( 0 );
618  Height( pRoot->Height() );
619  SetAscent( pRoot->GetAscent() );
620 
621  return false;
622 }
623 
624 sal_uInt16 SwControlCharPortion::GetViewWidth( const SwTextSizeInfo& rInf ) const
625 {
626  if( !mnViewWidth )
627  mnViewWidth = rInf.GetTextSize(OUString(' ')).Width();
628 
629  return mnViewWidth;
630 }
631 
632 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual SwLinePortion * Compress() override
Definition: porrst.cxx:88
vcl::RenderContext * GetOut() const
Definition: viewsh.hxx:338
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:487
const SvxLRSpaceItem & GetLRSpace(bool=true) const
Definition: frmatr.hxx:44
static Color & GetFieldShadingsColor()
Definition: viewopt.cxx:430
void Right(const tools::Long nRight)
Definition: swrect.hxx:200
SwViewShell * GetVsh()
Definition: inftxt.hxx:228
void DrawBackBrush(const SwLinePortion &rPor) const
Definition: inftxt.cxx:1156
virtual bool DoPaint(SwTextPaintInfo const &rInf, OUString &rOutString, SwFont &rTmpFont, int &rDeltaY) const override
Definition: porrst.cxx:523
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:624
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: porrst.cxx:469
SwPageDesc * FindPageDesc()
Definition: pagechg.cxx:745
bool IsInDocBody() const
Definition: frame.hxx:921
SvxAdjust GetAdjust() const
SwFont & GetFont()
Definition: swfntcch.hxx:58
sal_uInt16 Height() const
Definition: possiz.hxx:50
SwFont * GetFont()
Definition: inftxt.hxx:238
sal_uInt16 mnViewWidth
Definition: porrst.hxx:135
bool IsSwapped() const
Definition: txtfrm.hxx:526
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:406
bool GetHasRotatedPortions() const
Definition: txtfrm.hxx:521
bool HasPara() const
Definition: txtfrm.hxx:810
Point aPos
Definition: porrst.hxx:89
IDocumentDeviceAccess const & getIDocumentDeviceAccess() const
Definition: doc.cxx:238
void Left(const tools::Long nLeft)
Definition: swrect.hxx:195
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:495
long Long
constexpr OUStringChar CH_PAR
Definition: swfont.hxx:45
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:441
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:1303
void SetEmphasisMark(const FontEmphasisMark eValue)
Definition: swfont.hxx:682
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
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:1539
const Size & GetSize(SwFontScript nWhich) const
Definition: swfont.hxx:204
#define DFLT_ESC_AUTO_SUB
Of course Writer needs its own rectangles.
Definition: swrect.hxx:35
void SetOutline(const bool bOutline)
Definition: swfont.hxx:600
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:433
void SetPitch(const FontPitch ePitch, const SwFontScript nWhich)
Definition: swfont.hxx:501
SvxLineSpaceRule GetLineSpaceRule() const
static bool IsShowChanges(const RedlineFlags eM)
const SwIndex * GetNext() const
Definition: index.hxx:98
void SetColor(const Color &rColor)
Definition: swfont.hxx:411
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:615
const SwRegisterItem & GetRegister(bool=true) const
Definition: paratr.hxx:184
bool IsReadonly() const
Definition: viewopt.hxx:452
sal_uInt16 mnHalfCharWidth
Definition: porrst.hxx:136
virtual sal_uInt16 GetViewWidth(const SwTextSizeInfo &rInf) const override
Definition: porrst.cxx:624
sal_uInt16 GetLineHeight() const
virtual void FormatEOL(SwTextFormatInfo &rInf) override
Definition: porrst.cxx:163
LINESTYLE_NONE
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: porrst.cxx:564
const SwRect & getFrameArea() const
Definition: frame.hxx:177
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
bool getBrowseMode() const
Definition: viewopt.hxx:461
sal_uInt16 GetAscent(SwViewShell const *pSh, const OutputDevice &rOut)
Definition: swfont.hxx:323
Used by Attribute Iterators to organize attributes on stacks to find the valid attribute in each cate...
Definition: atrhndl.hxx:38
oslFileHandle & pOut
void SetUnderline(const FontLineStyle eUnderline)
Definition: swfont.hxx:542
virtual bool Format(SwTextFormatInfo &rInf) override
Definition: porrst.cxx:97
const IDocumentDeviceAccess & getIDocumentDeviceAccess() const
Provides access to the document device interface.
Definition: node.cxx:2111
void SetStrikeout(const FontStrikeout eStrikeout)
Definition: swfont.hxx:572
void SetAlign(const FontAlign eAlign)
Definition: swfont.hxx:514
SwFontScript GetActual() const
Definition: swfont.hxx:182
void DrawRect(const tools::Rectangle &rRect)
SwFormatColl & GetAnyFormatColl() const
Definition: node.hxx:715
void SetUndersized(const bool bNew)
Definition: flowfrm.hxx:157
bool IsEmpty() const
Definition: txtfrm.hxx:512
SwTextNode * GetTextNodeFirst()
Definition: txtfrm.hxx:448
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:1293
void SetRegHeight(sal_uInt16 const nNew)
Definition: pagedesc.hxx:239
ALIGN_BASELINE
void SetTransparent(const bool bTrans)
Definition: swfont.hxx:640
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:2112
SvxAdjust
bool IsCollapse() const
Definition: calcmove.cxx:1061
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:994
SwPageFrame * FindPageFrame()
Definition: frame.hxx:660
void SetWhichPor(const PortionType nNew)
Definition: porlin.hxx:94
SwTextGridItem const * GetGridItem(SwPageFrame const *const)
Definition: pagechg.cxx:2538
vector_type::size_type size_type
Definition: docary.hxx:228
tools::Long GetHeight(const SwRect &rRect) const
Definition: frame.hxx:1360
bool IsParagraph(bool bHard=false) const
Definition: viewopt.hxx:235
SwLayoutFrame * GetUpper()
Definition: frame.hxx:658
void SetFillColor()
void SetRelief(const FontRelief eNew)
Definition: swfont.hxx:708
const SvxAdjustItem & GetAdjust(bool=true) const
Definition: paratr.hxx:180
Marks a character position inside a document model node.
Definition: index.hxx:33
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:781
tools::Long GetPrtTop(const SwFrame &rFrame) const
Definition: frame.hxx:1387
Provides access to settings of a document.
PITCH_DONTKNOW
SvxInterLineSpaceRule GetInterLineSpaceRule() const
#define NON_PRINTING_CHARACTER_COLOR
Definition: txtfrm.hxx:50
#define CHAR_ZWSP
Definition: swtypes.hxx:169
TextFrameIndex GetIdx() const
Definition: inftxt.hxx:278
void SetWeight(const FontWeight eWeight, const SwFontScript nWhich)
Definition: swfont.hxx:529
const IDocumentSettingAccess * getIDocumentSettingAccess() const
Provides access to the document setting interface.
Definition: node.cxx:2110
bool IsLineBreak(bool bHard=false) const
Definition: viewopt.hxx:251
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:452
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:660
bool FillRegister(SwTwips &rRegStart, sal_uInt16 &rRegDiff)
Determines the start position and step size of the register.
Definition: porrst.cxx:359
TextFrameIndex GetLen() const
Definition: porlin.hxx:74
A page of the document layout.
Definition: pagefrm.hxx:41
SwTextFrame * GetTextFrame()
Definition: inftxt.hxx:291
bool IsPaintBlank() const
Definition: swfont.hxx:257
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
bool bBackground
Definition: porrst.hxx:66
void Bottom(const tools::Long nBottom)
Definition: swrect.hxx:209
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:80
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
PortionType GetWhichPor() const
Definition: porlin.hxx:95
virtual bool Format(SwTextFormatInfo &rInf) override
Definition: porrst.cxx:614
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:423
vcl::Window * GetWin() const
Definition: viewsh.hxx:337
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
void Top(const tools::Long nTop)
Definition: swrect.hxx:204
tools::Long Height() const
bool FormatEmpty()
Definition: porrst.cxx:277
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:52
bool IsPrtFormat() const
Definition: viewopt.hxx:530
SwLinePortion * GetLast()
Definition: inftxt.hxx:567
bool IsHideRedlines() const
Replacement for sw::DocumentRedlineManager::GetRedlineFlags() (this is layout-level redline hiding)...
Definition: rootfrm.hxx:417
#define CHAR_ZWNBSP
Definition: swtypes.hxx:170
const SwAttrSet & GetSwAttrSet() const
Does node has already its own auto-attributes? Access to SwAttrSet.
Definition: node.hxx:722
void SetName(const OUString &rName, const SwFontScript nWhich)
Definition: swfont.hxx:461
bool IsShowBookmarks(bool const bHard=false) const
Definition: viewopt.hxx:245
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:451
bool IsOn() const
Definition: txtfly.hxx:313
const SwIndex * GetFirstIndex() const
Definition: index.hxx:125
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:762
bool GetJoinBorderWithNext() const
Definition: porlin.hxx:169
SwLinePortion * GetNextPortion() const
Definition: porlin.hxx:72
void SetEmpty(const bool bNew)
Definition: txtfrm.hxx:240
SwViewShell * GetCurrShell() const
Definition: rootfrm.hxx:205
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
void Height(tools::Long nNew)
Definition: swrect.hxx:191
bool IsAutoFirst() const
sal_Unicode mcChar
Definition: porrst.hxx:138
void SetOverline(const FontLineStyle eOverline)
Definition: swfont.hxx:557
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:1315
void SetRegAscent(sal_uInt16 const nNew)
Definition: pagedesc.hxx:240
void HideFootnotes(TextFrameIndex nStart, TextFrameIndex nEnd)
Definition: txtfrm.cxx:1445
const Color & GetFillColor() const
SwTmpEndPortion(const SwLinePortion &rPortion)
Definition: porrst.cxx:49
typedef void(CALLTYPE *GetFuncDataPtr)(sal_uInt16 &nNo