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>
23#include <editeng/lrspitem.hxx>
24#include <editeng/pgrditem.hxx>
25#include <vcl/svapp.hxx>
27
28#include <viewsh.hxx>
29#include <viewopt.hxx>
30#include <ndtxt.hxx>
31#include <pagefrm.hxx>
32#include <paratr.hxx>
33#include <SwPortionHandler.hxx>
34#include "porrst.hxx"
35#include "inftxt.hxx"
36#include "txtpaint.hxx"
37#include <swfntcch.hxx>
38#include <tgrditem.hxx>
39#include <pagedesc.hxx>
40#include <frmatr.hxx>
41#include "redlnitr.hxx"
42#include "atrhndl.hxx"
43#include <rootfrm.hxx>
44#include <formatlinebreak.hxx>
45#include <txatbase.hxx>
46
50
51#include <crsrsh.hxx>
52#include <swtypes.hxx>
53#include <strings.hrc>
54
56 const FontLineStyle eUL,
57 const FontStrikeout eStrkout,
58 const Color& rCol ) :
59 m_eUnderline( eUL ), m_eStrikeout( eStrkout ), m_aColor( rCol )
60{
61 Height( rPortion.Height() );
62 SetAscent( rPortion.GetAscent() );
64}
65
66void SwTmpEndPortion::Paint( const SwTextPaintInfo &rInf ) const
67{
68 if (!(rInf.OnWin() && rInf.GetOpt().IsParagraph()))
69 return;
70
71 const SwFont* pOldFnt = rInf.GetFont();
72
73 SwFont aFont(*pOldFnt);
74
75 // Paint strikeout/underline based on redline color and settings
76 // (with an extra pilcrow in the background, because there is
77 // no SetStrikeoutColor(), also SetUnderColor() doesn't work()).
79 {
80 aFont.SetColor( m_aColor );
83
84 const_cast<SwTextPaintInfo&>(rInf).SetFont(&aFont);
85
86 // draw the pilcrow with strikeout/underline in redline color
87 rInf.DrawText(CH_PAR, *this);
88
89 }
90
94 const_cast<SwTextPaintInfo&>(rInf).SetFont(&aFont);
95
96 // draw the pilcrow
97 rInf.DrawText(CH_PAR, *this);
98
99 const_cast<SwTextPaintInfo&>(rInf).SetFont(const_cast<SwFont*>(pOldFnt));
100}
101
103 : SwLinePortion( rPortion )
104{
106 m_eRedline = RedlineType::None;
108
110 if (pAttr && pAttr->Which() == RES_TXTATR_LINEBREAK)
111 {
112 m_eClear = pAttr->GetLineBreak().GetValue();
113 }
114 m_nTextHeight = 0;
115}
116
118{
119 return TextFrameIndex(0);
120}
121
123{ return 0; }
124
126{ return (GetNextPortion() && GetNextPortion()->InTextGrp() ? nullptr : this); }
127
128void SwBreakPortion::Paint( const SwTextPaintInfo &rInf ) const
129{
130 if( !(rInf.OnWin() && rInf.GetOpt().IsLineBreak()) )
131 return;
132
133 // Reduce height to text height for the duration of the print, so the vertical height will look
134 // correct for the line break character, even for clearing breaks.
135 SwTwips nHeight = Height();
136 SwTwips nVertPosOffset = (nHeight - m_nTextHeight) / 2;
137 auto pPortion = const_cast<SwBreakPortion*>(this);
138 pPortion->Height(m_nTextHeight, false);
139 if (rInf.GetTextFrame()->IsVertical())
140 {
141 // Compensate for the offset done in SwTextCursor::AdjustBaseLine() for the vertical case.
142 const_cast<SwTextPaintInfo&>(rInf).Y(rInf.Y() + nVertPosOffset);
143 }
145 [pPortion, nHeight, &rInf, nVertPosOffset]
146 {
147 if (rInf.GetTextFrame()->IsVertical())
148 {
149 const_cast<SwTextPaintInfo&>(rInf).Y(rInf.Y() - nVertPosOffset);
150 }
151 pPortion->Height(nHeight, false);
152 });
153
154 rInf.DrawLineBreak( *this );
155
156 // paint redlining
157 if (m_eRedline == RedlineType::None)
158 return;
159
160 sal_Int16 nNoBreakWidth = rInf.GetTextSize(S_NOBREAK_FOR_REDLINE).Width();
161 if ( nNoBreakWidth > 0 )
162 {
163 // approximate portion size with multiple no-break spaces
164 // and draw these spaces (at least a single one) by DrawText
165 // painting the requested redline underline/strikeout
166 sal_Int16 nSpaces = (LINE_BREAK_WIDTH + nNoBreakWidth/2) / nNoBreakWidth;
167 OUStringBuffer aBuf(S_NOBREAK_FOR_REDLINE);
168 for (sal_Int16 i = 1; i < nSpaces; ++i)
170
171 const SwFont* pOldFnt = rInf.GetFont();
172
173 SwFont aFont(*pOldFnt);
174
175 if (m_eRedline == RedlineType::Delete)
177 else
179
180 const_cast<SwTextPaintInfo&>(rInf).SetFont(&aFont);
181
182 rInf.DrawText(aBuf.makeStringAndClear(), *this);
183
184 const_cast<SwTextPaintInfo&>(rInf).SetFont(const_cast<SwFont*>(pOldFnt));
185 }
186}
187
189{
190 const SwLinePortion *pRoot = rInf.GetRoot();
191 Width( 0 );
192 Height( pRoot->Height() );
194
195 // See if this is a clearing break. If so, calculate how much we need to "jump down" so the next
196 // line can again use the full text width.
197 SwLineBreakClear eClear = m_eClear;
198 if (rInf.GetTextFrame()->IsRightToLeft() && eClear != SwLineBreakClear::ALL)
199 {
200 // RTL ignores left/right breaks.
201 eClear = SwLineBreakClear::NONE;
202 }
203 if (eClear != SwLineBreakClear::NONE)
204 {
205 SwTextFly& rTextFly = rInf.GetTextFly();
206 if (rTextFly.IsOn())
207 {
208 SwTwips nHeight = rTextFly.GetMaxBottom(*this, rInf) - rInf.Y();
209 if (nHeight > Height())
210 {
211 Height(nHeight, /*bText=*/false);
212 }
213 }
214 }
215
216 SetAscent( pRoot->GetAscent() );
217 if (rInf.GetIdx() + TextFrameIndex(1) == TextFrameIndex(rInf.GetText().getLength()))
218 rInf.SetNewLine( true );
219 return true;
220}
221
223{
224 rPH.Text( GetLen(), GetWhichPor() );
225}
226
227void SwBreakPortion::dumpAsXml(xmlTextWriterPtr pWriter, const OUString& rText, TextFrameIndex&
228 nOffset) const
229{
230 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwBreakPortion"));
231 dumpAsXmlAttributes(pWriter, rText, nOffset);
232 nOffset += GetLen();
233
234 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("text-height"),
235 BAD_CAST(OString::number(m_nTextHeight).getStr()));
236
237 (void)xmlTextWriterEndElement(pWriter);
238}
239
241
243 bool bBG, bool bGK ) :
244 m_nKern( nKrn ), m_bBackground( bBG ), m_bGridKern( bGK )
245{
246 Height( rPortion.Height() );
247 SetAscent( rPortion.GetAscent() );
250 if( m_nKern > 0 )
251 Width( m_nKern );
252 rPortion.Insert( this );
253}
254
256 m_nKern( 0 ), m_bBackground( false ), m_bGridKern( true )
257{
258 Height( rPortion.Height() );
259 SetAscent( rPortion.GetAscent() );
260
263}
264
265void SwKernPortion::Paint( const SwTextPaintInfo &rInf ) const
266{
267 if( !Width() )
268 return;
269
270 // bBackground is set for Kerning Portions between two fields
271 if ( m_bBackground )
272 rInf.DrawViewOpt( *this, PortionType::Field );
273
274 rInf.DrawBackBrush( *this );
276 rInf.DrawBorder( *this );
277
278 // do we have to repaint a post it portion?
279 if( rInf.OnWin() && mpNextPortion && !mpNextPortion->Width() )
280 mpNextPortion->PrePaint( rInf, this );
281
282 if( rInf.GetFont()->IsPaintBlank() )
283 {
284 SwRect aClipRect;
285 rInf.CalcRect( *this, &aClipRect );
286 SwSaveClip aClip( const_cast<OutputDevice*>(rInf.GetOut()) );
287 aClip.ChgClip( aClipRect );
288 rInf.DrawText(" ", *this, TextFrameIndex(0), TextFrameIndex(2), true );
289 }
290}
291
293{
294 if ( m_bGridKern )
295 return;
296
297 if( rInf.GetLast() == this )
298 rInf.SetLast( FindPrevPortion( rInf.GetRoot() ) );
299 if( m_nKern < 0 )
300 Width( -m_nKern );
301 else
302 Width( 0 );
303 rInf.GetLast()->FormatEOL( rInf );
304}
305
307 m_bLeft( true )
308{
309 Height( rPortion.Height() );
310 SetAscent( rPortion.GetAscent() );
313}
314
316 : m_bLeft( false )
317{
318 Height( o3tl::narrowing<sal_uInt16>(rInf.GetTextFrame()->getFramePrintArea().Height()) );
324}
325
326void SwArrowPortion::Paint( const SwTextPaintInfo &rInf ) const
327{
328 const_cast<SwArrowPortion*>(this)->m_aPos = rInf.GetPos();
329}
330
332
334{
335 if (IsCollapse()) {
337 if ( auto pCrSh = dynamic_cast<SwCursorShell*>( pSh ) ) {
338 // this is called during formatting so avoid recursive layout
339 SwContentFrame const*const pCurrFrame = pCrSh->GetCurrFrame(false);
340 if (pCurrFrame==static_cast<SwContentFrame const *>(this)) {
341 // do nothing
342 } else {
343 return 1;
344 }
345 } else {
346 return 1;
347 }
348 }
349 OSL_ENSURE( ! IsVertical() || ! IsSwapped(),"SwTextFrame::EmptyHeight with swapped frame" );
350
351 std::unique_ptr<SwFont> pFnt;
352 const SwTextNode& rTextNode = *GetTextNodeForParaProps();
353 const IDocumentSettingAccess* pIDSA = rTextNode.getIDocumentSettingAccess();
355 if ( rTextNode.HasSwAttrSet() )
356 {
357 const SwAttrSet *pAttrSet = &( rTextNode.GetSwAttrSet() );
358 pFnt.reset(new SwFont( pAttrSet, pIDSA ));
359 }
360 else
361 {
362 SwFontAccess aFontAccess( &rTextNode.GetAnyFormatColl(), pSh);
363 pFnt.reset(new SwFont( aFontAccess.Get()->GetFont() ));
364 pFnt->CheckFontCacheId( pSh, pFnt->GetActual() );
365 }
366
367 if ( IsVertical() )
368 pFnt->SetVertical( 2700_deg10 );
369
370 OutputDevice* pOut = pSh ? pSh->GetOut() : nullptr;
371 if ( !pOut || !pSh->GetViewOptions()->getBrowseMode() ||
372 pSh->GetViewOptions()->IsPrtFormat() )
373 {
375 }
376
377 const IDocumentRedlineAccess& rIDRA = rTextNode.getIDocumentRedlineAccess();
379 && !getRootFrame()->IsHideRedlines())
380 {
381 const SwRedlineTable::size_type nRedlPos = rIDRA.GetRedlinePos( rTextNode, RedlineType::Any );
382 if( SwRedlineTable::npos != nRedlPos )
383 {
384 SwAttrHandler aAttrHandler;
385 aAttrHandler.Init(rTextNode.GetSwAttrSet(),
386 *rTextNode.getIDocumentSettingAccess());
387 SwRedlineItr aRedln( rTextNode, *pFnt, aAttrHandler,
388 nRedlPos, SwRedlineItr::Mode::Show);
389 }
390 }
391
392 SwTwips nRet;
393 if( !pOut )
394 nRet = IsVertical() ?
395 getFramePrintArea().SSize().Width() + 1 :
396 getFramePrintArea().SSize().Height() + 1;
397 else
398 {
399 pFnt->SetFntChg( true );
400 pFnt->ChgPhysFnt( pSh, *pOut );
401 nRet = pFnt->GetHeight( pSh, *pOut );
402 }
403 return nRet;
404}
405
407{
408 OSL_ENSURE( ! IsVertical() || ! IsSwapped(),"SwTextFrame::FormatEmpty with swapped frame" );
409
410 bool bCollapse = EmptyHeight( ) == 1 && IsCollapse( );
411
412 // sw_redlinehide: just disable FormatEmpty optimisation for now
413 // Split fly frames: non-last parts of the anchor want this optimization to clear the old
414 // content.
415 bool bHasNonLastSplitFlyDrawObj = HasNonLastSplitFlyDrawObj();
416 if ((HasFollow() && !bHasNonLastSplitFlyDrawObj) || GetMergedPara() || GetTextNodeFirst()->GetpSwpHints() ||
417 nullptr != GetTextNodeForParaProps()->GetNumRule() ||
418 GetTextNodeFirst()->HasHiddenCharAttribute(true) ||
419 IsInFootnote() || ( HasPara() && GetPara()->IsPrepMustFit() ) )
420 return false;
422 const SvxAdjust nAdjust = aSet.GetAdjust().GetAdjust();
423 if( !bCollapse && ( ( ( ! IsRightToLeft() && ( SvxAdjust::Left != nAdjust ) ) ||
424 ( IsRightToLeft() && ( SvxAdjust::Right != nAdjust ) ) ) ||
425 aSet.GetRegister().GetValue() ) )
426 return false;
427 const SvxLineSpacingItem &rSpacing = aSet.GetLineSpacing();
428 if( !bCollapse && ( SvxLineSpaceRule::Min == rSpacing.GetLineSpaceRule() ||
429 SvxLineSpaceRule::Fix == rSpacing.GetLineSpaceRule() ||
431 {
432 return false;
433 }
434
435 SwTextFly aTextFly( this );
436 SwRect aRect;
437 bool bFirstFlyCheck = 0 != getFramePrintArea().Height();
438 if ( !bCollapse && bFirstFlyCheck &&
439 aTextFly.IsOn() && aTextFly.IsAnyObj( aRect ) && !bHasNonLastSplitFlyDrawObj )
440 return false;
441
443 {
444 // We don't want this optimization in case the paragraph is not really empty, because it has
445 // a fly frame and it also needs space for the empty paragraph in a next line.
446 return false;
447 }
448
449 // only need to check one node because of early return on GetMerged()
450 for (SwContentIndex const* pIndex = GetTextNodeFirst()->GetFirstIndex();
451 pIndex; pIndex = pIndex->GetNext())
452 {
453 sw::mark::IMark const*const pMark = pIndex->GetMark();
454 if (dynamic_cast<const sw::mark::IBookmark*>(pMark) != nullptr)
455 { // need bookmark portions!
456 return false;
457 }
458 }
459
460 SwTwips nHeight = EmptyHeight();
461
462 if (aSet.GetParaGrid().GetValue() &&
463 IsInDocBody() )
464 {
465 SwTextGridItem const*const pGrid(GetGridItem(FindPageFrame()));
466 if ( pGrid )
467 nHeight = pGrid->GetBaseHeight() + pGrid->GetRubyHeight();
468 }
469
470 SwRectFnSet aRectFnSet(this);
471 const SwTwips nChg = nHeight - aRectFnSet.GetHeight(getFramePrintArea());
472
473 if( !nChg )
474 SetUndersized( false );
475 AdjustFrame( nChg );
476
478 {
479 ClearPara();
481 }
482
484 if( !IsEmpty() )
485 {
486 SetEmpty( true );
488 }
489 if( !bCollapse && !bFirstFlyCheck &&
490 aTextFly.IsOn() && aTextFly.IsAnyObj( aRect ) )
491 return false;
492
493 // #i35635# - call method <HideAndShowObjects()>
494 // to assure that objects anchored at the empty paragraph are
495 // correctly visible resp. invisible.
497 return true;
498}
499
500bool SwTextFrame::FillRegister( SwTwips& rRegStart, sal_uInt16& rRegDiff )
501{
502 const SwFrame *pFrame = this;
503 rRegDiff = 0;
504 while( !( ( SwFrameType::Body | SwFrameType::Fly )
505 & pFrame->GetType() ) && pFrame->GetUpper() )
506 pFrame = pFrame->GetUpper();
507 if( ( SwFrameType::Body| SwFrameType::Fly ) & pFrame->GetType() )
508 {
509 SwRectFnSet aRectFnSet(pFrame);
510 rRegStart = aRectFnSet.GetPrtTop(*pFrame);
511 pFrame = pFrame->FindPageFrame();
512 if( pFrame->IsPageFrame() )
513 {
514 SwPageDesc* pDesc = const_cast<SwPageFrame*>(static_cast<const SwPageFrame*>(pFrame))->FindPageDesc();
515 if( pDesc )
516 {
517 rRegDiff = pDesc->GetRegHeight();
518 if( !rRegDiff )
519 {
520 const SwTextFormatColl *pFormat = pDesc->GetRegisterFormatColl();
521 if( pFormat )
522 {
523 const SvxLineSpacingItem &rSpace = pFormat->GetLineSpacing();
524 if( SvxLineSpaceRule::Fix == rSpace.GetLineSpaceRule() )
525 {
526 rRegDiff = rSpace.GetLineHeight();
527 pDesc->SetRegHeight( rRegDiff );
528 pDesc->SetRegAscent( ( 4 * rRegDiff ) / 5 );
529 }
530 else
531 {
533 SwFontAccess aFontAccess( pFormat, pSh );
534 SwFont aFnt( aFontAccess.Get()->GetFont() );
535
536 OutputDevice *pOut = nullptr;
537 if( !pSh || !pSh->GetViewOptions()->getBrowseMode() ||
538 pSh->GetViewOptions()->IsPrtFormat() )
540
541 if( pSh && !pOut )
542 pOut = pSh->GetWin()->GetOutDev();
543
544 if( !pOut )
546
547 MapMode aOldMap( pOut->GetMapMode() );
548 pOut->SetMapMode( MapMode( MapUnit::MapTwip ) );
549
550 aFnt.ChgFnt( pSh, *pOut );
551 rRegDiff = aFnt.GetHeight( pSh, *pOut );
552 sal_uInt16 nNetHeight = rRegDiff;
553
554 switch( rSpace.GetLineSpaceRule() )
555 {
556 case SvxLineSpaceRule::Auto:
557 break;
558 case SvxLineSpaceRule::Min:
559 {
560 if( rRegDiff < rSpace.GetLineHeight() )
561 rRegDiff = rSpace.GetLineHeight();
562 break;
563 }
564 default:
565 OSL_FAIL( ": unknown LineSpaceRule" );
566 }
567 switch( rSpace.GetInterLineSpaceRule() )
568 {
569 case SvxInterLineSpaceRule::Off:
570 break;
571 case SvxInterLineSpaceRule::Prop:
572 {
573 tools::Long nTmp = rSpace.GetPropLineSpace();
574 if( nTmp < 50 )
575 nTmp = nTmp ? 50 : 100;
576 nTmp *= rRegDiff;
577 nTmp /= 100;
578 if( !nTmp )
579 ++nTmp;
580 rRegDiff = o3tl::narrowing<sal_uInt16>(nTmp);
581 nNetHeight = rRegDiff;
582 break;
583 }
584 case SvxInterLineSpaceRule::Fix:
585 {
586 rRegDiff = rRegDiff + rSpace.GetInterLineSpace();
587 nNetHeight = rRegDiff;
588 break;
589 }
590 default: OSL_FAIL( ": unknown InterLineSpaceRule" );
591 }
592 pDesc->SetRegHeight( rRegDiff );
593 pDesc->SetRegAscent( rRegDiff - nNetHeight +
594 aFnt.GetAscent( pSh, *pOut ) );
595 pOut->SetMapMode( aOldMap );
596 }
597 }
598 }
599 const tools::Long nTmpDiff = pDesc->GetRegAscent() - rRegDiff;
600 if ( aRectFnSet.IsVert() )
601 rRegStart -= nTmpDiff;
602 else
603 rRegStart += nTmpDiff;
604 }
605 }
606 }
607 return ( 0 != rRegDiff );
608}
609
611{
612#ifdef DBG_UTIL
613 OutputDevice* pOut = const_cast<OutputDevice*>(rInf.GetOut());
614 Color aCol( rInf.GetOpt().GetFieldShadingsColor() );
615 Color aOldColor( pOut->GetFillColor() );
616 pOut->SetFillColor( aCol );
617 Point aPos( rInf.GetPos() );
618 aPos.AdjustY( -150 );
619 aPos.AdjustX( -25 );
620 SwRect aRect( aPos, Size( 100, 200 ) );
621 pOut->DrawRect( aRect.SVRect() );
622 pOut->SetFillColor( aOldColor );
623#else
624 (void)rInf;
625#endif
626}
627
629{
630 Width( 0 );
631 rInf.GetTextFrame()->HideFootnotes( rInf.GetIdx(), rInf.GetIdx() + GetLen() );
632
633 return false;
634};
635
637 OUString & rOutString, SwFont & rTmpFont, int &) const
638{
639 if (mcChar == CHAR_WJ || !rTextPaintInfo.GetOpt().IsFieldShadings())
640 {
641 return false;
642 }
643
644 switch (mcChar)
645 {
646 case CHAR_ZWSP:
647 rOutString = "/"; break;
648// case CHAR_LRM :
649// rText = sal_Unicode(0x2514); break;
650// case CHAR_RLM :
651// rText = sal_Unicode(0x2518); break;
652 default:
653 assert(false);
654 break;
655 }
656
657 rTmpFont.SetEscapement( CHAR_ZWSP == mcChar ? DFLT_ESC_AUTO_SUB : -25 );
658 const sal_uInt16 nProp = 40;
659 rTmpFont.SetProportion( nProp ); // a smaller font
660
661 return true;
662}
663
665 OUString & rOutString, SwFont & rFont, int & rDeltaY) const
666{
667 // custom color is visible without field shading, too
668 if (!rTextPaintInfo.GetOpt().IsShowBookmarks())
669 {
670 return false;
671 }
672
673 rOutString = OUStringChar(mcChar);
674
675 // init font: we want OpenSymbol to ensure it doesn't look too crazy;
676 // thin and a bit higher than the surrounding text
677 auto const nOrigAscent(rFont.GetAscent(rTextPaintInfo.GetVsh(), *rTextPaintInfo.GetOut()));
678 rFont.SetName("OpenSymbol", rFont.GetActual());
679 Size aSize(rFont.GetSize(rFont.GetActual()));
680 // use also the external leading (line gap) of the portion, but don't use
681 // 100% of it because i can't figure out how to baseline align that
682 assert(aSize.Height() != 0);
683 auto const nFactor = aSize.Height() > 0 ? (Height() * 95) / aSize.Height() : Height();
684 rFont.SetProportion(nFactor);
685 rFont.SetWeight(WEIGHT_THIN, rFont.GetActual());
686 rFont.SetColor(rTextPaintInfo.GetOpt().GetFieldShadingsColor());
687 // reset these to default...
692 rFont.SetOutline(false);
693 rFont.SetShadow(false);
694 rFont.SetTransparent(false);
695 rFont.SetEmphasisMark(FontEmphasisMark::NONE);
696 rFont.SetEscapement(0);
697 rFont.SetPitch(PITCH_DONTKNOW, rFont.GetActual());
698 rFont.SetRelief(FontRelief::NONE);
699
700 // adjust Y position to account for different baselines of the fonts
701 auto const nOSAscent(rFont.GetAscent(rTextPaintInfo.GetVsh(), *rTextPaintInfo.GetOut()));
702 rDeltaY = nOSAscent - nOrigAscent;
703
704 return true;
705}
706
708{
709 if ( !Width() ) // is only set during prepaint mode
710 return;
711
712 rInf.DrawViewOpt(*this, GetWhichPor());
713
714 int deltaY(0);
715 SwFont aTmpFont( *rInf.GetFont() );
716 OUString aOutString;
717
718 if (!(rInf.OnWin()
719 && !rInf.GetOpt().IsPagePreview()
720 && !rInf.GetOpt().IsReadonly()
721 && DoPaint(rInf, aOutString, aTmpFont, deltaY)))
722 return;
723
724 SwFontSave aFontSave( rInf, &aTmpFont );
725
726 if ( !mnHalfCharWidth )
727 mnHalfCharWidth = rInf.GetTextSize( aOutString ).Width() / 2;
728
729 Point aOldPos = rInf.GetPos();
730 Point aNewPos( aOldPos );
731 auto const deltaX((Width() / 2) - mnHalfCharWidth);
732 switch (rInf.GetFont()->GetOrientation(rInf.GetTextFrame()->IsVertical()).get())
733 {
734 case 0:
735 aNewPos.AdjustX(deltaX);
736 aNewPos.AdjustY(deltaY);
737 break;
738 case 900:
739 aNewPos.AdjustY(-deltaX);
740 aNewPos.AdjustX(deltaY);
741 break;
742 case 2700:
743 aNewPos.AdjustY(deltaX);
744 aNewPos.AdjustX(-deltaY);
745 break;
746 default:
747 assert(false);
748 break;
749 }
750 const_cast< SwTextPaintInfo& >( rInf ).SetPos( aNewPos );
751
752 rInf.DrawText( aOutString, *this );
753
754 const_cast< SwTextPaintInfo& >( rInf ).SetPos( aOldPos );
755}
756
758{
759 if ( !Width() ) // is only set during prepaint mode
760 return;
761
762 rInf.DrawViewOpt(*this, GetWhichPor());
763
764 int deltaY(0);
765 SwFont aTmpFont( *rInf.GetFont() );
766 OUString aOutString;
767
768 if (!(rInf.OnWin()
769 && !rInf.GetOpt().IsPagePreview()
770 && !rInf.GetOpt().IsReadonly()
771 && DoPaint(rInf, aOutString, aTmpFont, deltaY)))
772 return;
773
774 SwFontSave aFontSave( rInf, &aTmpFont );
775
776 if ( !mnHalfCharWidth )
777 mnHalfCharWidth = rInf.GetTextSize( aOutString ).Width() / 2;
778
779 Point aOldPos = rInf.GetPos();
780 Point aNewPos( aOldPos );
781 auto const deltaX((Width() / 2) - mnHalfCharWidth);
782 switch (rInf.GetFont()->GetOrientation(rInf.GetTextFrame()->IsVertical()).get())
783 {
784 case 0:
785 aNewPos.AdjustX(deltaX);
786 aNewPos.AdjustY(deltaY);
787 break;
788 case 900:
789 aNewPos.AdjustY(-deltaX);
790 aNewPos.AdjustX(deltaY);
791 break;
792 case 2700:
793 aNewPos.AdjustY(deltaX);
794 aNewPos.AdjustX(-deltaY);
795 break;
796 default:
797 assert(false);
798 break;
799 }
800
801 // draw end marks before the character position
802 if ( m_nStart == 0 || m_nEnd == 0 )
803 {
804 // single type boundary marks are there outside of the bookmark text
805 // some |text| here
806 // [[ ]]
807 if (m_nStart > 1)
808 aNewPos.AdjustX(static_cast<tools::Long>(mnHalfCharWidth) * -2 * (m_oColors.size() - 1));
809 }
810 else if ( m_nStart != 0 && m_nEnd != 0 )
811 // both end and start boundary marks: adjust them around the bookmark position
812 // |te|xt|
813 // ]] [[
814 aNewPos.AdjustX(static_cast<tools::Long>(mnHalfCharWidth) * -(2 * m_nEnd - 1 + m_nPoint) );
815
816 const_cast< SwTextPaintInfo& >( rInf ).SetPos( aNewPos );
817
818 for ( const auto& it : m_oColors )
819 {
820 // set bold for custom colored bookmark symbol
821 // and draw multiple symbols showing all custom colors
822 aTmpFont.SetWeight( COL_TRANSPARENT == std::get<1>(it) ? WEIGHT_THIN : WEIGHT_BOLD, aTmpFont.GetActual() );
823 aTmpFont.SetColor( COL_TRANSPARENT == std::get<1>(it) ? rInf.GetOpt().GetFieldShadingsColor() : std::get<1>(it) );
824 aOutString = OUString(std::get<0>(it) == SwScriptInfo::MarkKind::Start ? '[' : ']');
825
826 // MarkKind::Point: drawn I-beam (e.g. U+2336) as overlapping ][
827 if ( std::get<0>(it) == SwScriptInfo::MarkKind::Point )
828 {
829 aNewPos.AdjustX(-mnHalfCharWidth * 5/16);
830 const_cast< SwTextPaintInfo& >( rInf ).SetPos( aNewPos );
831 rInf.DrawText( aOutString, *this );
832
833 // when the overlapping vertical lines are 50 pixel width on the screen,
834 // this distance (half width * 5/8) still results precise overlapping
835 aNewPos.AdjustX(mnHalfCharWidth * 5/8);
836 const_cast< SwTextPaintInfo& >( rInf ).SetPos( aNewPos );
837 aOutString = OUString('[');
838 }
839 rInf.DrawText( aOutString, *this );
840 // place the next symbol after the previous one
841 // TODO: fix orientation and start/end
842 aNewPos.AdjustX(mnHalfCharWidth * 2);
843 const_cast< SwTextPaintInfo& >( rInf ).SetPos( aNewPos );
844 }
845
846 const_cast< SwTextPaintInfo& >( rInf ).SetPos( aOldPos );
847}
848
850{
851 OUStringBuffer aStr;
852 for ( const auto& it : m_oColors )
853 {
854 aStr.append("#" + std::get<2>(it) + " " + SwResId(STR_BOOKMARK_DEF_NAME));
855 switch (std::get<0>(it))
856 {
858 break;
860 aStr.append(" " + SwResId(STR_CAPTION_BEGINNING));
861 break;
863 aStr.append(" " + SwResId(STR_CAPTION_END));
864 break;
865 }
866 }
867
868 rPH.Special( GetLen(), aStr.makeStringAndClear(), GetWhichPor() );
869}
870
871void SwBookmarkPortion::dumpAsXml(xmlTextWriterPtr pWriter, const OUString& rText, TextFrameIndex& nOffset) const
872{
873 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwBookmarkPortion"));
874 dumpAsXmlAttributes(pWriter, rText, nOffset);
875 nOffset += GetLen();
876
877 if (!m_oColors.empty())
878 {
879 OUStringBuffer aStr;
880 for (const auto& rColor : m_oColors)
881 {
882 aStr.append("#" + std::get<2>(rColor) + " " + SwResId(STR_BOOKMARK_DEF_NAME));
883 switch (std::get<0>(rColor))
884 {
886 break;
888 aStr.append(" " + SwResId(STR_CAPTION_BEGINNING));
889 break;
891 aStr.append(" " + SwResId(STR_CAPTION_END));
892 break;
893 }
894 }
895 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("colors"),
896 BAD_CAST(aStr.makeStringAndClear().toUtf8().getStr()));
897 }
898
899 (void)xmlTextWriterEndElement(pWriter);
900}
901
903{
904 const SwLinePortion* pRoot = rInf.GetRoot();
905 Width( 0 );
906 Height( pRoot->Height() );
907 SetAscent( pRoot->GetAscent() );
908
909 return false;
910}
911
913{
914 if( !mnViewWidth )
915 mnViewWidth = rInf.GetTextSize(OUString(' ')).Width();
916
917 return mnViewWidth;
918}
919
920/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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...
static OutputDevice * GetDefaultDevice()
virtual OutputDevice * getReferenceDevice(bool bCreate) const =0
Returns the current reference device.
static bool IsShowChanges(const RedlineFlags eM)
virtual SwRedlineTable::size_type GetRedlinePos(const SwNode &rNode, RedlineType nType) const =0
virtual RedlineFlags GetRedlineFlags() const =0
Query the currently set redline mode.
Provides access to settings of a document.
void setX(tools::Long nX)
void setY(tools::Long nY)
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
bool GetValue() const
EnumT GetValue() const
constexpr tools::Long Height() const
SvxAdjust GetAdjust() const
bool IsAutoFirst() const
sal_uInt16 GetPropLineSpace() const
SvxInterLineSpaceRule GetInterLineSpaceRule() const
SvxLineSpaceRule GetLineSpaceRule() const
sal_uInt16 GetLineHeight() const
short GetInterLineSpace() const
Indicator that the content does not fit into a fixed height frame (red triangle on the UI).
Definition: porrst.hxx:116
SwArrowPortion(const SwLinePortion &rPortion)
Definition: porrst.cxx:306
virtual SwLinePortion * Compress() override
Definition: porrst.cxx:331
Point m_aPos
Definition: porrst.hxx:117
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: porrst.cxx:326
Used by Attribute Iterators to organize attributes on stacks to find the valid attribute in each cate...
Definition: atrhndl.hxx:38
void Init(const SwAttrSet &rAttrSet, const IDocumentSettingAccess &rIDocumentSettingAccess)
Definition: atrstck.cxx:277
const SvxAdjustItem & GetAdjust(bool=true) const
Definition: paratr.hxx:203
const SvxFirstLineIndentItem & GetFirstLineIndent(bool=true) const
Definition: frmatr.hxx:48
const SvxParaGridItem & GetParaGrid(bool=true) const
Definition: paratr.hxx:229
const SvxLineSpacingItem & GetLineSpacing(bool=true) const
Definition: paratr.hxx:201
const SwRegisterItem & GetRegister(bool=true) const
Definition: paratr.hxx:207
sal_Int16 m_nEnd
Definition: porrst.hxx:190
sal_Int16 m_nStart
Definition: porrst.hxx:190
virtual bool DoPaint(SwTextPaintInfo const &rInf, OUString &rOutString, SwFont &rTmpFont, int &rDeltaY) const override
Definition: porrst.cxx:664
void dumpAsXml(xmlTextWriterPtr pWriter, const OUString &rText, TextFrameIndex &rOffset) const override
Definition: porrst.cxx:871
virtual void HandlePortion(SwPortionHandler &rPH) const override
Definition: porrst.cxx:849
std::vector< std::tuple< SwScriptInfo::MarkKind, Color, OUString > > m_oColors
Definition: porrst.hxx:188
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: porrst.cxx:757
sal_Int16 m_nPoint
Definition: porrst.hxx:190
RedlineType m_eRedline
Definition: porrst.hxx:61
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: porrst.cxx:128
static constexpr OUStringLiteral S_NOBREAK_FOR_REDLINE
Definition: porrst.hxx:84
virtual SwLinePortion * Compress() override
Definition: porrst.cxx:125
SwBreakPortion(const SwLinePortion &rPortion, const SwTextAttr *pAttr)
Definition: porrst.cxx:102
virtual bool Format(SwTextFormatInfo &rInf) override
Definition: porrst.cxx:188
SwLineBreakClear m_eClear
Tracks the type of the breaking clear from SwTextLineBreak, if there is one.
Definition: porrst.hxx:64
SwTwips m_nTextHeight
Height of the line-break character itself, without spacing added for clearing.
Definition: porrst.hxx:67
void dumpAsXml(xmlTextWriterPtr pWriter, const OUString &rText, TextFrameIndex &nOffset) const override
Definition: porrst.cxx:227
SwLineBreakClear GetClear() const
Definition: porrst.cxx:240
virtual sal_uInt16 GetViewWidth(const SwTextSizeInfo &rInf) const override
Definition: porrst.cxx:122
virtual TextFrameIndex GetModelPositionForViewPoint(sal_uInt16 nOfst) const override
the parameter is actually SwTwips apparently?
Definition: porrst.cxx:117
virtual void HandlePortion(SwPortionHandler &rPH) const override
Definition: porrst.cxx:222
SwContentFrame is the layout for content nodes: a common base class for text (paragraph) and non-text...
Definition: cntfrm.hxx:59
Marks a character position inside a document model content node (SwContentNode)
bool HasSwAttrSet() const
Definition: node.hxx:494
const SwAttrSet & GetSwAttrSet() const
Does node has already its own auto-attributes? Access to SwAttrSet.
Definition: node.hxx:727
SwFormatColl & GetAnyFormatColl() const
Definition: node.hxx:720
sal_uInt16 mnHalfCharWidth
Definition: porrst.hxx:165
sal_uInt16 mnViewWidth
Definition: porrst.hxx:163
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: porrst.cxx:707
sal_Unicode mcChar
Definition: porrst.hxx:166
virtual bool Format(SwTextFormatInfo &rInf) override
Definition: porrst.cxx:902
virtual bool DoPaint(SwTextPaintInfo const &rInf, OUString &rOutString, SwFont &rTmpFont, int &rDeltaY) const
Definition: porrst.cxx:636
virtual sal_uInt16 GetViewWidth(const SwTextSizeInfo &rInf) const override
Definition: porrst.cxx:912
IDocumentDeviceAccess const & getIDocumentDeviceAccess() const
Definition: doc.cxx:252
SwFontObj * Get()
Definition: swfntcch.cxx:56
SwFont & GetFont()
Definition: swfntcch.hxx:58
To take Asian or other languages into consideration, an SwFont object consists of 3 SwSubFonts (Latin...
Definition: swfont.hxx:135
void SetOverline(const FontLineStyle eOverline)
Definition: swfont.hxx:567
void ChgFnt(SwViewShell const *pSh, OutputDevice &rOut)
Definition: swfont.hxx:180
void SetStrikeout(const FontStrikeout eStrikeout)
Definition: swfont.hxx:582
void SetEscapement(const short nNewEsc)
Definition: swfont.hxx:791
const Size & GetSize(SwFontScript nWhich) const
Definition: swfont.hxx:209
Degree10 GetOrientation(const bool bVertLayout=false, const bool bVertFormatLRBT=false) const
Definition: swfont.cxx:412
void SetAlign(const TextAlign eAlign)
Definition: swfont.hxx:524
void SetEmphasisMark(const FontEmphasisMark eValue)
Definition: swfont.hxx:692
void SetName(const OUString &rName, const SwFontScript nWhich)
Definition: swfont.hxx:471
void SetProportion(const sal_uInt8 nNewPropr)
Definition: swfont.hxx:772
void SetOutline(const bool bOutline)
Definition: swfont.hxx:610
void SetPitch(const FontPitch ePitch, const SwFontScript nWhich)
Definition: swfont.hxx:511
SwFontScript GetActual() const
Definition: swfont.hxx:187
void SetShadow(const bool bShadow)
Definition: swfont.hxx:625
void SetColor(const Color &rColor)
Definition: swfont.hxx:421
bool IsPaintBlank() const
Definition: swfont.hxx:264
void SetTransparent(const bool bTrans)
Definition: swfont.hxx:650
void SetUnderline(const FontLineStyle eUnderline)
Definition: swfont.hxx:552
sal_uInt16 GetAscent(SwViewShell const *pSh, const OutputDevice &rOut)
Definition: swfont.hxx:330
void SetWeight(const FontWeight eWeight, const SwFontScript nWhich)
Definition: swfont.hxx:539
void SetRelief(const FontRelief eNew)
Definition: swfont.hxx:718
tools::Long GetHeight() const
Definition: swfont.hxx:287
const SvxLineSpacingItem & GetLineSpacing(bool=true) const
Paragraph-attributes - implemented in paratr.hxx.
Definition: paratr.hxx:235
const SwRect & getFrameArea() const
Definition: frame.hxx:179
const SwRect & getFramePrintArea() const
Definition: frame.hxx:180
Base class of the Writer layout elements.
Definition: frame.hxx:315
bool IsCollapse() const
Definition: calcmove.cxx:1052
bool IsInDocBody() const
Definition: frame.hxx:949
bool IsPageFrame() const
Definition: frame.hxx:1184
SwFrameType GetType() const
Definition: frame.hxx:521
bool IsInFootnote() const
Definition: frame.hxx:955
bool IsRightToLeft() const
Definition: frame.hxx:993
SwLayoutFrame * GetUpper()
Definition: frame.hxx:684
bool IsVertical() const
Definition: frame.hxx:979
SwRootFrame * getRootFrame()
Definition: frame.hxx:685
void SetCompletePaint() const
Definition: frame.hxx:1000
SwPageFrame * FindPageFrame()
Definition: frame.hxx:686
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: porrst.cxx:610
virtual bool Format(SwTextFormatInfo &rInf) override
Definition: porrst.cxx:628
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: porrst.cxx:265
bool m_bGridKern
Definition: porrst.hxx:94
SwKernPortion(SwLinePortion &rPortion, short nKrn, bool bBG=false, bool bGridKern=false)
Definition: porrst.cxx:242
short m_nKern
Definition: porrst.hxx:92
bool m_bBackground
Definition: porrst.hxx:93
virtual void FormatEOL(SwTextFormatInfo &rInf) override
Definition: porrst.cxx:292
Base class for anything that can be part of a line in the Writer layout.
Definition: porlin.hxx:52
TextFrameIndex mnLineLength
Definition: porlin.hxx:57
void dumpAsXmlAttributes(xmlTextWriterPtr writer, std::u16string_view rText, TextFrameIndex nOffset) const
Definition: porlin.cxx:333
virtual void FormatEOL(SwTextFormatInfo &rInf)
Definition: porlin.cxx:269
SwLinePortion * mpNextPortion
Definition: porlin.hxx:55
bool InTextGrp() const
Definition: porlin.hxx:105
SwLinePortion * GetNextPortion() const
Definition: porlin.hxx:75
void SetAscent(const SwTwips nNewAsc)
Definition: porlin.hxx:82
bool GetJoinBorderWithPrev() const
Definition: porlin.hxx:177
PortionType GetWhichPor() const
Definition: porlin.hxx:102
TextFrameIndex GetLen() const
Definition: porlin.hxx:77
bool GetJoinBorderWithNext() const
Definition: porlin.hxx:178
SwTwips & GetAscent()
Definition: porlin.hxx:80
SwLinePortion * FindPrevPortion(const SwLinePortion *pRoot)
Definition: porlin.cxx:213
void SetWhichPor(const PortionType nNew)
Definition: porlin.hxx:101
void PrePaint(const SwTextPaintInfo &rInf, const SwLinePortion *pLast) const
Definition: porlin.cxx:77
virtual SwLinePortion * Insert(SwLinePortion *pPortion)
Definition: porlin.cxx:169
const IDocumentRedlineAccess & getIDocumentRedlineAccess() const
Provides access to the document redline interface.
Definition: node.cxx:2140
const IDocumentDeviceAccess & getIDocumentDeviceAccess() const
Provides access to the document device interface.
Definition: node.cxx:2139
const IDocumentSettingAccess * getIDocumentSettingAccess() const
Provides access to the document setting interface.
Definition: node.cxx:2138
sal_uInt16 GetRegHeight() const
Definition: pagedesc.hxx:258
void SetRegAscent(sal_uInt16 const nNew)
Definition: pagedesc.hxx:261
void SetRegHeight(sal_uInt16 const nNew)
Definition: pagedesc.hxx:260
sal_uInt16 GetRegAscent() const
Definition: pagedesc.hxx:259
const SwTextFormatColl * GetRegisterFormatColl() const
retrieve the style for the grid alignment
Definition: pagedesc.cxx:223
A page of the document layout.
Definition: pagefrm.hxx:60
SwPageDesc * FindPageDesc()
Definition: pagechg.cxx:767
The SwPortionHandler interface implements a visitor for the layout engine's text portions.
virtual void Text(TextFrameIndex nLength, PortionType nType)=0
(empty) destructor
virtual void Special(TextFrameIndex nLength, const OUString &rText, PortionType nType)=0
special portion.
SwTwips Width() const
Definition: possiz.hxx:51
SwTwips Height() const
Definition: possiz.hxx:49
bool IsVert() const
Definition: frame.hxx:1372
tools::Long GetHeight(const SwRect &rRect) const
Definition: frame.hxx:1387
tools::Long GetPrtTop(const SwFrame &rFrame) const
Definition: frame.hxx:1414
Of course Writer needs its own rectangles.
Definition: swrect.hxx:35
void Height(tools::Long nNew)
Definition: swrect.hxx:193
void Top(const tools::Long nTop)
Definition: swrect.hxx:206
void Right(const tools::Long nRight)
Definition: swrect.hxx:202
void Bottom(const tools::Long nBottom)
Definition: swrect.hxx:211
void SSize(const Size &rNew)
Definition: swrect.hxx:180
tools::Rectangle SVRect() const
Definition: swrect.hxx:292
void Left(const tools::Long nLeft)
Definition: swrect.hxx:197
static constexpr size_type npos
Definition: docary.hxx:224
vector_type::size_type size_type
Definition: docary.hxx:223
SwViewShell * GetCurrShell() const
Definition: rootfrm.hxx:215
void ChgClip(const SwRect &rRect, const SwTextFrame *pFrame=nullptr, bool bEnlargeRect=false, sal_Int32 nEnlargeTop=0, sal_Int32 nEnlargeBottom=0)
Definition: txtpaint.hxx:47
A wrapper around SfxPoolItem to store the start position of (usually) a text portion,...
Definition: txatbase.hxx:44
const SwFormatLineBreak & GetLineBreak() const
Definition: txatbase.hxx:214
sal_uInt16 Which() const
Definition: txatbase.hxx:116
The purpose of this class is to be the universal interface between formatting/text output and the pos...
Definition: txtfly.hxx:125
bool IsAnyObj(const SwRect &rRect) const
true when a frame or DrawObj must be taken in account.
Definition: txtfly.cxx:408
SwTwips GetMaxBottom(const SwBreakPortion &rPortion, const SwTextFormatInfo &rInfo) const
Gets the maximum of the fly frame bottoms.
Definition: txtfly.cxx:1010
bool IsOn() const
Definition: txtfly.hxx:326
Represents the style of a paragraph.
Definition: fmtcol.hxx:61
SwLinePortion * GetLast()
Definition: inftxt.hxx:566
SwLineLayout * GetRoot()
Definition: inftxt.hxx:562
void SetLast(SwLinePortion *pNewLast)
Definition: inftxt.hxx:567
void SetNewLine(const bool bNew)
Definition: inftxt.hxx:584
SwDoc & GetDoc()
Definition: txtfrm.hxx:475
void HideAndShowObjects()
Hides respectively shows objects, which are anchored at paragraph, at/as a character of the paragraph...
Definition: txtfrm.cxx:1657
bool IsEmptyWithSplitFly() const
This text frame is not split, doesn't fit the upper, has a single split fly anchored to it with a neg...
Definition: itratr.cxx:1549
bool HasPara() const
Definition: txtfrm.hxx:853
bool FillRegister(SwTwips &rRegStart, sal_uInt16 &rRegDiff)
Determines the start position and step size of the register.
Definition: porrst.cxx:500
bool IsSwapped() const
Definition: txtfrm.hxx:553
void ClearPara()
Removes the Line information from the Cache but retains the entry itself.
Definition: txtcache.cxx:104
sw::MergedPara * GetMergedPara()
Definition: txtfrm.hxx:465
void AdjustFrame(const SwTwips nChgHeight, bool bHasToFit=false)
Definition: frmform.cxx:400
SwTwips EmptyHeight() const
Definition: porrst.cxx:333
SwParaPortion * GetPara()
Definition: txtcache.cxx:90
void SetHasRotatedPortions(bool bHasRotatedPortions)
Definition: txtftn.cxx:98
void HideFootnotes(TextFrameIndex nStart, TextFrameIndex nEnd)
Definition: txtfrm.cxx:1563
bool HasNonLastSplitFlyDrawObj() const
This text frame may have a split fly frames anchored to it.
Definition: itratr.cxx:1483
SwTextNode * GetTextNodeFirst()
Definition: txtfrm.hxx:472
void RemoveFromCache()
Removes this frame completely from the Cache.
Definition: txtcache.cxx:120
SwTextNode const * GetTextNodeForParaProps() const
Definition: txtfrm.cxx:1390
bool FormatEmpty()
Definition: porrst.cxx:406
void SetEmpty(const bool bNew)
Definition: txtfrm.hxx:256
bool GetHasRotatedPortions() const
Definition: txtfrm.hxx:548
bool IsEmpty() const
Definition: txtfrm.hxx:539
sal_uInt16 GetBaseHeight() const
Definition: tgrditem.hxx:75
sal_uInt16 GetRubyHeight() const
Definition: tgrditem.hxx:78
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:112
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:753
SwTextFly & GetTextFly()
Definition: inftxt.hxx:387
const Point & GetPos() const
Definition: inftxt.hxx:434
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:735
void DrawBackBrush(const SwLinePortion &rPor) const
Definition: inftxt.cxx:1158
void DrawViewOpt(const SwLinePortion &rPor, PortionType nWhich, const Color *pColor=nullptr) const
Definition: inftxt.cxx:1470
void DrawBorder(const SwLinePortion &rPor) const
Draw character border around a line portion.
Definition: inftxt.cxx:1291
void DrawLineBreak(const SwLinePortion &rPor) const
Definition: inftxt.cxx:977
SwTwips Y() const
Definition: inftxt.hxx:384
SwTextFrame * GetTextFrame()
Definition: inftxt.hxx:288
vcl::RenderContext * GetOut()
Definition: inftxt.hxx:225
SwViewShell * GetVsh()
Definition: inftxt.hxx:222
const SwViewOption & GetOpt() const
Definition: inftxt.hxx:239
SwFont * GetFont()
Definition: inftxt.hxx:232
bool OnWin() const
Definition: inftxt.hxx:193
SwPosSize GetTextSize(OutputDevice *pOut, const SwScriptInfo *pSI, const OUString &rText, TextFrameIndex nIdx, TextFrameIndex nLen) const
Definition: inftxt.cxx:395
const OUString & GetText() const
Definition: inftxt.hxx:240
TextFrameIndex GetIdx() const
Definition: inftxt.hxx:273
const FontStrikeout m_eStrikeout
Definition: porrst.hxx:46
Color m_aColor
Definition: porrst.hxx:47
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: porrst.cxx:66
SwTmpEndPortion(const SwLinePortion &rPortion, const FontLineStyle eUnderline, const FontStrikeout eStrikeout, const Color &rColor)
Definition: porrst.cxx:55
const FontLineStyle m_eUnderline
Definition: porrst.hxx:45
bool IsReadonly() const
Definition: viewopt.hxx:627
bool IsParagraph(bool bHard=false) const
Definition: viewopt.hxx:369
bool IsPagePreview() const
Definition: viewopt.hxx:799
bool IsShowBookmarks(bool const bHard=false) const
Definition: viewopt.hxx:383
bool IsPrtFormat() const
Definition: viewopt.hxx:705
bool getBrowseMode() const
Definition: viewopt.hxx:636
bool IsLineBreak(bool bHard=false) const
Definition: viewopt.hxx:389
const Color & GetFieldShadingsColor() const
Definition: viewopt.cxx:522
bool IsFieldShadings() const
Definition: viewopt.hxx:835
vcl::RenderContext * GetOut() const
Definition: viewsh.hxx:365
const SwViewOption * GetViewOptions() const
Definition: viewsh.hxx:452
vcl::Window * GetWin() const
Definition: viewsh.hxx:364
::OutputDevice const * GetOutDev() const
constexpr ::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
Color m_aColor
struct _xmlTextWriter * xmlTextWriterPtr
#define DFLT_ESC_AUTO_SUB
FontLineStyle
LINESTYLE_NONE
FontStrikeout
STRIKEOUT_NONE
PITCH_DONTKNOW
ALIGN_BASELINE
WEIGHT_THIN
WEIGHT_BOLD
SwLineBreakClear
Defines the location of a line break text wrapping restart.
constexpr TypedWhichId< SwFormatLineBreak > RES_TXTATR_LINEBREAK(61)
sal_Int16 nAdjust
aStr
aBuf
SwNumRule * GetNumRule(SwTextFormatColl &rTextFormatColl)
determines the list style, which directly set at the given paragraph style
Definition: fmtcol.cxx:74
int i
long Long
SwTextGridItem const * GetGridItem(SwPageFrame const *const)
Definition: pagechg.cxx:2676
#define Y
#define LINE_BREAK_WIDTH
Definition: porrst.hxx:38
UNDERLYING_TYPE get() const
SvxAdjust
constexpr OUStringChar CH_PAR
Definition: swfont.hxx:45
OUString SwResId(TranslateId aId)
Definition: swmodule.cxx:168
tools::Long SwTwips
Definition: swtypes.hxx:51
#define CHAR_WJ
Definition: swtypes.hxx:179
#define CHAR_ZWSP
Definition: swtypes.hxx:178
#define NON_PRINTING_CHARACTER_COLOR
Definition: txtfrm.hxx:57
oslFileHandle & pOut