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()) );
319 m_aPos.setX( rInf.GetTextFrame()->getFrameArea().Left() +
321 m_aPos.setY( rInf.GetTextFrame()->getFrameArea().Top() +
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 if (HasFollow() || GetMergedPara() || GetTextNodeFirst()->GetpSwpHints() ||
414 nullptr != GetTextNodeForParaProps()->GetNumRule() ||
415 GetTextNodeFirst()->HasHiddenCharAttribute(true) ||
416 IsInFootnote() || ( HasPara() && GetPara()->IsPrepMustFit() ) )
417 return false;
419 const SvxAdjust nAdjust = aSet.GetAdjust().GetAdjust();
420 if( !bCollapse && ( ( ( ! IsRightToLeft() && ( SvxAdjust::Left != nAdjust ) ) ||
421 ( IsRightToLeft() && ( SvxAdjust::Right != nAdjust ) ) ) ||
422 aSet.GetRegister().GetValue() ) )
423 return false;
424 const SvxLineSpacingItem &rSpacing = aSet.GetLineSpacing();
425 if( !bCollapse && ( SvxLineSpaceRule::Min == rSpacing.GetLineSpaceRule() ||
426 SvxLineSpaceRule::Fix == rSpacing.GetLineSpaceRule() ||
427 aSet.GetLRSpace().IsAutoFirst() ) )
428 return false;
429
430 SwTextFly aTextFly( this );
431 SwRect aRect;
432 bool bFirstFlyCheck = 0 != getFramePrintArea().Height();
433 if ( !bCollapse && bFirstFlyCheck &&
434 aTextFly.IsOn() && aTextFly.IsAnyObj( aRect ) )
435 return false;
436
437 // only need to check one node because of early return on GetMerged()
438 for (SwContentIndex const* pIndex = GetTextNodeFirst()->GetFirstIndex();
439 pIndex; pIndex = pIndex->GetNext())
440 {
441 sw::mark::IMark const*const pMark = pIndex->GetMark();
442 if (dynamic_cast<const sw::mark::IBookmark*>(pMark) != nullptr)
443 { // need bookmark portions!
444 return false;
445 }
446 }
447
448 SwTwips nHeight = EmptyHeight();
449
450 if (aSet.GetParaGrid().GetValue() &&
451 IsInDocBody() )
452 {
453 SwTextGridItem const*const pGrid(GetGridItem(FindPageFrame()));
454 if ( pGrid )
455 nHeight = pGrid->GetBaseHeight() + pGrid->GetRubyHeight();
456 }
457
458 SwRectFnSet aRectFnSet(this);
459 const SwTwips nChg = nHeight - aRectFnSet.GetHeight(getFramePrintArea());
460
461 if( !nChg )
462 SetUndersized( false );
463 AdjustFrame( nChg );
464
466 {
467 ClearPara();
469 }
470
472 if( !IsEmpty() )
473 {
474 SetEmpty( true );
476 }
477 if( !bCollapse && !bFirstFlyCheck &&
478 aTextFly.IsOn() && aTextFly.IsAnyObj( aRect ) )
479 return false;
480
481 // #i35635# - call method <HideAndShowObjects()>
482 // to assure that objects anchored at the empty paragraph are
483 // correctly visible resp. invisible.
485 return true;
486}
487
488bool SwTextFrame::FillRegister( SwTwips& rRegStart, sal_uInt16& rRegDiff )
489{
490 const SwFrame *pFrame = this;
491 rRegDiff = 0;
492 while( !( ( SwFrameType::Body | SwFrameType::Fly )
493 & pFrame->GetType() ) && pFrame->GetUpper() )
494 pFrame = pFrame->GetUpper();
495 if( ( SwFrameType::Body| SwFrameType::Fly ) & pFrame->GetType() )
496 {
497 SwRectFnSet aRectFnSet(pFrame);
498 rRegStart = aRectFnSet.GetPrtTop(*pFrame);
499 pFrame = pFrame->FindPageFrame();
500 if( pFrame->IsPageFrame() )
501 {
502 SwPageDesc* pDesc = const_cast<SwPageFrame*>(static_cast<const SwPageFrame*>(pFrame))->FindPageDesc();
503 if( pDesc )
504 {
505 rRegDiff = pDesc->GetRegHeight();
506 if( !rRegDiff )
507 {
508 const SwTextFormatColl *pFormat = pDesc->GetRegisterFormatColl();
509 if( pFormat )
510 {
511 const SvxLineSpacingItem &rSpace = pFormat->GetLineSpacing();
512 if( SvxLineSpaceRule::Fix == rSpace.GetLineSpaceRule() )
513 {
514 rRegDiff = rSpace.GetLineHeight();
515 pDesc->SetRegHeight( rRegDiff );
516 pDesc->SetRegAscent( ( 4 * rRegDiff ) / 5 );
517 }
518 else
519 {
521 SwFontAccess aFontAccess( pFormat, pSh );
522 SwFont aFnt( aFontAccess.Get()->GetFont() );
523
524 OutputDevice *pOut = nullptr;
525 if( !pSh || !pSh->GetViewOptions()->getBrowseMode() ||
526 pSh->GetViewOptions()->IsPrtFormat() )
528
529 if( pSh && !pOut )
530 pOut = pSh->GetWin()->GetOutDev();
531
532 if( !pOut )
534
535 MapMode aOldMap( pOut->GetMapMode() );
536 pOut->SetMapMode( MapMode( MapUnit::MapTwip ) );
537
538 aFnt.ChgFnt( pSh, *pOut );
539 rRegDiff = aFnt.GetHeight( pSh, *pOut );
540 sal_uInt16 nNetHeight = rRegDiff;
541
542 switch( rSpace.GetLineSpaceRule() )
543 {
544 case SvxLineSpaceRule::Auto:
545 break;
546 case SvxLineSpaceRule::Min:
547 {
548 if( rRegDiff < rSpace.GetLineHeight() )
549 rRegDiff = rSpace.GetLineHeight();
550 break;
551 }
552 default:
553 OSL_FAIL( ": unknown LineSpaceRule" );
554 }
555 switch( rSpace.GetInterLineSpaceRule() )
556 {
557 case SvxInterLineSpaceRule::Off:
558 break;
559 case SvxInterLineSpaceRule::Prop:
560 {
561 tools::Long nTmp = rSpace.GetPropLineSpace();
562 if( nTmp < 50 )
563 nTmp = nTmp ? 50 : 100;
564 nTmp *= rRegDiff;
565 nTmp /= 100;
566 if( !nTmp )
567 ++nTmp;
568 rRegDiff = o3tl::narrowing<sal_uInt16>(nTmp);
569 nNetHeight = rRegDiff;
570 break;
571 }
572 case SvxInterLineSpaceRule::Fix:
573 {
574 rRegDiff = rRegDiff + rSpace.GetInterLineSpace();
575 nNetHeight = rRegDiff;
576 break;
577 }
578 default: OSL_FAIL( ": unknown InterLineSpaceRule" );
579 }
580 pDesc->SetRegHeight( rRegDiff );
581 pDesc->SetRegAscent( rRegDiff - nNetHeight +
582 aFnt.GetAscent( pSh, *pOut ) );
583 pOut->SetMapMode( aOldMap );
584 }
585 }
586 }
587 const tools::Long nTmpDiff = pDesc->GetRegAscent() - rRegDiff;
588 if ( aRectFnSet.IsVert() )
589 rRegStart -= nTmpDiff;
590 else
591 rRegStart += nTmpDiff;
592 }
593 }
594 }
595 return ( 0 != rRegDiff );
596}
597
599{
600#ifdef DBG_UTIL
601 OutputDevice* pOut = const_cast<OutputDevice*>(rInf.GetOut());
603 Color aOldColor( pOut->GetFillColor() );
604 pOut->SetFillColor( aCol );
605 Point aPos( rInf.GetPos() );
606 aPos.AdjustY( -150 );
607 aPos.AdjustX( -25 );
608 SwRect aRect( aPos, Size( 100, 200 ) );
609 pOut->DrawRect( aRect.SVRect() );
610 pOut->SetFillColor( aOldColor );
611#else
612 (void)rInf;
613#endif
614}
615
617{
618 Width( 0 );
619 rInf.GetTextFrame()->HideFootnotes( rInf.GetIdx(), rInf.GetIdx() + GetLen() );
620
621 return false;
622};
623
625 OUString & rOutString, SwFont & rTmpFont, int &) const
626{
628 {
629 return false;
630 }
631
632 switch (mcChar)
633 {
634 case CHAR_ZWSP:
635 rOutString = "/"; break;
636// case CHAR_LRM :
637// rText = sal_Unicode(0x2514); break;
638// case CHAR_RLM :
639// rText = sal_Unicode(0x2518); break;
640 default:
641 assert(false);
642 break;
643 }
644
645 rTmpFont.SetEscapement( CHAR_ZWSP == mcChar ? DFLT_ESC_AUTO_SUB : -25 );
646 const sal_uInt16 nProp = 40;
647 rTmpFont.SetProportion( nProp ); // a smaller font
648
649 return true;
650}
651
653 OUString & rOutString, SwFont & rFont, int & rDeltaY) const
654{
655 // custom color is visible without field shading, too
656 if (!rTextPaintInfo.GetOpt().IsShowBookmarks())
657 {
658 return false;
659 }
660
661 rOutString = OUStringChar(mcChar);
662
663 // init font: we want OpenSymbol to ensure it doesn't look too crazy;
664 // thin and a bit higher than the surrounding text
665 auto const nOrigAscent(rFont.GetAscent(rTextPaintInfo.GetVsh(), *rTextPaintInfo.GetOut()));
666 rFont.SetName("OpenSymbol", rFont.GetActual());
667 Size aSize(rFont.GetSize(rFont.GetActual()));
668 // use also the external leading (line gap) of the portion, but don't use
669 // 100% of it because i can't figure out how to baseline align that
670 assert(aSize.Height() != 0);
671 auto const nFactor = aSize.Height() > 0 ? (Height() * 95) / aSize.Height() : Height();
672 rFont.SetProportion(nFactor);
673 rFont.SetWeight(WEIGHT_THIN, rFont.GetActual());
675 // reset these to default...
680 rFont.SetOutline(false);
681 rFont.SetShadow(false);
682 rFont.SetTransparent(false);
683 rFont.SetEmphasisMark(FontEmphasisMark::NONE);
684 rFont.SetEscapement(0);
685 rFont.SetPitch(PITCH_DONTKNOW, rFont.GetActual());
686 rFont.SetRelief(FontRelief::NONE);
687
688 // adjust Y position to account for different baselines of the fonts
689 auto const nOSAscent(rFont.GetAscent(rTextPaintInfo.GetVsh(), *rTextPaintInfo.GetOut()));
690 rDeltaY = nOSAscent - nOrigAscent;
691
692 return true;
693}
694
696{
697 if ( !Width() ) // is only set during prepaint mode
698 return;
699
700 rInf.DrawViewOpt(*this, GetWhichPor());
701
702 int deltaY(0);
703 SwFont aTmpFont( *rInf.GetFont() );
704 OUString aOutString;
705
706 if (!(rInf.OnWin()
707 && !rInf.GetOpt().IsPagePreview()
708 && !rInf.GetOpt().IsReadonly()
709 && DoPaint(rInf, aOutString, aTmpFont, deltaY)))
710 return;
711
712 SwFontSave aFontSave( rInf, &aTmpFont );
713
714 if ( !mnHalfCharWidth )
715 mnHalfCharWidth = rInf.GetTextSize( aOutString ).Width() / 2;
716
717 Point aOldPos = rInf.GetPos();
718 Point aNewPos( aOldPos );
719 auto const deltaX((Width() / 2) - mnHalfCharWidth);
720 switch (rInf.GetFont()->GetOrientation(rInf.GetTextFrame()->IsVertical()).get())
721 {
722 case 0:
723 aNewPos.AdjustX(deltaX);
724 aNewPos.AdjustY(deltaY);
725 break;
726 case 900:
727 aNewPos.AdjustY(-deltaX);
728 aNewPos.AdjustX(deltaY);
729 break;
730 case 2700:
731 aNewPos.AdjustY(deltaX);
732 aNewPos.AdjustX(-deltaY);
733 break;
734 default:
735 assert(false);
736 break;
737 }
738 const_cast< SwTextPaintInfo& >( rInf ).SetPos( aNewPos );
739
740 rInf.DrawText( aOutString, *this );
741
742 const_cast< SwTextPaintInfo& >( rInf ).SetPos( aOldPos );
743}
744
746{
747 if ( !Width() ) // is only set during prepaint mode
748 return;
749
750 rInf.DrawViewOpt(*this, GetWhichPor());
751
752 int deltaY(0);
753 SwFont aTmpFont( *rInf.GetFont() );
754 OUString aOutString;
755
756 if (!(rInf.OnWin()
757 && !rInf.GetOpt().IsPagePreview()
758 && !rInf.GetOpt().IsReadonly()
759 && DoPaint(rInf, aOutString, aTmpFont, deltaY)))
760 return;
761
762 SwFontSave aFontSave( rInf, &aTmpFont );
763
764 if ( !mnHalfCharWidth )
765 mnHalfCharWidth = rInf.GetTextSize( aOutString ).Width() / 2;
766
767 Point aOldPos = rInf.GetPos();
768 Point aNewPos( aOldPos );
769 auto const deltaX((Width() / 2) - mnHalfCharWidth);
770 switch (rInf.GetFont()->GetOrientation(rInf.GetTextFrame()->IsVertical()).get())
771 {
772 case 0:
773 aNewPos.AdjustX(deltaX);
774 aNewPos.AdjustY(deltaY);
775 break;
776 case 900:
777 aNewPos.AdjustY(-deltaX);
778 aNewPos.AdjustX(deltaY);
779 break;
780 case 2700:
781 aNewPos.AdjustY(deltaX);
782 aNewPos.AdjustX(-deltaY);
783 break;
784 default:
785 assert(false);
786 break;
787 }
788
789 // draw end marks before the character position
790 if ( m_nStart == 0 || m_nEnd == 0 )
791 {
792 // single type boundary marks are there outside of the bookmark text
793 // some |text| here
794 // [[ ]]
795 if (m_nStart > 1)
796 aNewPos.AdjustX(static_cast<tools::Long>(mnHalfCharWidth) * -2 * (m_oColors.size() - 1));
797 }
798 else if ( m_nStart != 0 && m_nEnd != 0 )
799 // both end and start boundary marks: adjust them around the bookmark position
800 // |te|xt|
801 // ]] [[
802 aNewPos.AdjustX(static_cast<tools::Long>(mnHalfCharWidth) * -(2 * m_nEnd - 1 + m_nPoint) );
803
804 const_cast< SwTextPaintInfo& >( rInf ).SetPos( aNewPos );
805
806 for ( const auto& it : m_oColors )
807 {
808 // set bold for custom colored bookmark symbol
809 // and draw multiple symbols showing all custom colors
810 aTmpFont.SetWeight( COL_TRANSPARENT == std::get<1>(it) ? WEIGHT_THIN : WEIGHT_BOLD, aTmpFont.GetActual() );
811 aTmpFont.SetColor( COL_TRANSPARENT == std::get<1>(it) ? SwViewOption::GetFieldShadingsColor() : std::get<1>(it) );
812 aOutString = OUString(std::get<0>(it) == SwScriptInfo::MarkKind::Start ? '[' : ']');
813
814 // MarkKind::Point: drawn I-beam (e.g. U+2336) as overlapping ][
815 if ( std::get<0>(it) == SwScriptInfo::MarkKind::Point )
816 {
817 aNewPos.AdjustX(-mnHalfCharWidth * 5/16);
818 const_cast< SwTextPaintInfo& >( rInf ).SetPos( aNewPos );
819 rInf.DrawText( aOutString, *this );
820
821 // when the overlapping vertical lines are 50 pixel width on the screen,
822 // this distance (half width * 5/8) still results precise overlapping
823 aNewPos.AdjustX(mnHalfCharWidth * 5/8);
824 const_cast< SwTextPaintInfo& >( rInf ).SetPos( aNewPos );
825 aOutString = OUString('[');
826 }
827 rInf.DrawText( aOutString, *this );
828 // place the next symbol after the previous one
829 // TODO: fix orientation and start/end
830 aNewPos.AdjustX(mnHalfCharWidth * 2);
831 const_cast< SwTextPaintInfo& >( rInf ).SetPos( aNewPos );
832 }
833
834 const_cast< SwTextPaintInfo& >( rInf ).SetPos( aOldPos );
835}
836
838{
839 OUStringBuffer aStr;
840 for ( const auto& it : m_oColors )
841 {
842 aStr.append("#" + std::get<2>(it) + " " + SwResId(STR_BOOKMARK_DEF_NAME));
843 switch (std::get<0>(it))
844 {
846 break;
848 aStr.append(" " + SwResId(STR_CAPTION_BEGINNING));
849 break;
851 aStr.append(" " + SwResId(STR_CAPTION_END));
852 break;
853 }
854 }
855
856 rPH.Special( GetLen(), aStr.makeStringAndClear(), GetWhichPor() );
857}
858
859void SwBookmarkPortion::dumpAsXml(xmlTextWriterPtr pWriter, const OUString& rText, TextFrameIndex& nOffset) const
860{
861 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwBookmarkPortion"));
862 dumpAsXmlAttributes(pWriter, rText, nOffset);
863 nOffset += GetLen();
864
865 if (!m_oColors.empty())
866 {
867 OUStringBuffer aStr;
868 for (const auto& rColor : m_oColors)
869 {
870 aStr.append("#" + std::get<2>(rColor) + " " + SwResId(STR_BOOKMARK_DEF_NAME));
871 switch (std::get<0>(rColor))
872 {
874 break;
876 aStr.append(" " + SwResId(STR_CAPTION_BEGINNING));
877 break;
879 aStr.append(" " + SwResId(STR_CAPTION_END));
880 break;
881 }
882 }
883 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("colors"),
884 BAD_CAST(aStr.makeStringAndClear().toUtf8().getStr()));
885 }
886
887 (void)xmlTextWriterEndElement(pWriter);
888}
889
891{
892 const SwLinePortion* pRoot = rInf.GetRoot();
893 Width( 0 );
894 Height( pRoot->Height() );
895 SetAscent( pRoot->GetAscent() );
896
897 return false;
898}
899
901{
902 if( !mnViewWidth )
903 mnViewWidth = rInf.GetTextSize(OUString(' ')).Width();
904
905 return mnViewWidth;
906}
907
908/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
struct _xmlTextWriter * xmlTextWriterPtr
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.
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:194
const SvxLRSpaceItem & GetLRSpace(bool=true) const
Definition: frmatr.hxx:44
const SvxParaGridItem & GetParaGrid(bool=true) const
Definition: paratr.hxx:220
const SvxLineSpacingItem & GetLineSpacing(bool=true) const
Definition: paratr.hxx:192
const SwRegisterItem & GetRegister(bool=true) const
Definition: paratr.hxx:198
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:652
void dumpAsXml(xmlTextWriterPtr pWriter, const OUString &rText, TextFrameIndex &rOffset) const override
Definition: porrst.cxx:859
virtual void HandlePortion(SwPortionHandler &rPH) const override
Definition: porrst.cxx:837
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:745
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:58
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:763
SwFormatColl & GetAnyFormatColl() const
Definition: node.hxx:756
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:695
sal_Unicode mcChar
Definition: porrst.hxx:166
virtual bool Format(SwTextFormatInfo &rInf) override
Definition: porrst.cxx:890
virtual bool DoPaint(SwTextPaintInfo const &rInf, OUString &rOutString, SwFont &rTmpFont, int &rDeltaY) const
Definition: porrst.cxx:624
virtual sal_uInt16 GetViewWidth(const SwTextSizeInfo &rInf) const override
Definition: porrst.cxx:900
IDocumentDeviceAccess const & getIDocumentDeviceAccess() const
Definition: doc.cxx:244
void SetUndersized(const bool bNew)
Definition: flowfrm.hxx:158
bool HasFollow() const
Definition: flowfrm.hxx:166
SwFontObj * Get()
Definition: swfntcch.cxx:56
SwFont & GetFont()
Definition: swfntcch.hxx:58
void SetOverline(const FontLineStyle eOverline)
Definition: swfont.hxx:564
void ChgFnt(SwViewShell const *pSh, OutputDevice &rOut)
Definition: swfont.hxx:177
void SetStrikeout(const FontStrikeout eStrikeout)
Definition: swfont.hxx:579
void SetEscapement(const short nNewEsc)
Definition: swfont.hxx:788
const Size & GetSize(SwFontScript nWhich) const
Definition: swfont.hxx:206
Degree10 GetOrientation(const bool bVertLayout=false, const bool bVertFormatLRBT=false) const
Definition: swfont.cxx:412
void SetAlign(const TextAlign eAlign)
Definition: swfont.hxx:521
void SetEmphasisMark(const FontEmphasisMark eValue)
Definition: swfont.hxx:689
void SetName(const OUString &rName, const SwFontScript nWhich)
Definition: swfont.hxx:468
void SetProportion(const sal_uInt8 nNewPropr)
Definition: swfont.hxx:769
void SetOutline(const bool bOutline)
Definition: swfont.hxx:607
void SetPitch(const FontPitch ePitch, const SwFontScript nWhich)
Definition: swfont.hxx:508
SwFontScript GetActual() const
Definition: swfont.hxx:184
void SetShadow(const bool bShadow)
Definition: swfont.hxx:622
void SetColor(const Color &rColor)
Definition: swfont.hxx:418
bool IsPaintBlank() const
Definition: swfont.hxx:261
void SetTransparent(const bool bTrans)
Definition: swfont.hxx:647
void SetUnderline(const FontLineStyle eUnderline)
Definition: swfont.hxx:549
sal_uInt16 GetAscent(SwViewShell const *pSh, const OutputDevice &rOut)
Definition: swfont.hxx:327
void SetWeight(const FontWeight eWeight, const SwFontScript nWhich)
Definition: swfont.hxx:536
void SetRelief(const FontRelief eNew)
Definition: swfont.hxx:715
tools::Long GetHeight() const
Definition: swfont.hxx:284
const SvxLineSpacingItem & GetLineSpacing(bool=true) const
Paragraph-attributes - implemented in paratr.hxx.
Definition: paratr.hxx:226
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:1055
bool IsInDocBody() const
Definition: frame.hxx:943
bool IsPageFrame() const
Definition: frame.hxx:1178
SwFrameType GetType() const
Definition: frame.hxx:519
bool IsInFootnote() const
Definition: frame.hxx:949
bool IsRightToLeft() const
Definition: frame.hxx:987
SwLayoutFrame * GetUpper()
Definition: frame.hxx:678
bool IsVertical() const
Definition: frame.hxx:973
SwRootFrame * getRootFrame()
Definition: frame.hxx:679
void SetCompletePaint() const
Definition: frame.hxx:994
SwPageFrame * FindPageFrame()
Definition: frame.hxx:680
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: porrst.cxx:598
virtual bool Format(SwTextFormatInfo &rInf) override
Definition: porrst.cxx:616
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:330
virtual void FormatEOL(SwTextFormatInfo &rInf)
Definition: porlin.cxx:266
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:210
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:2160
const IDocumentDeviceAccess & getIDocumentDeviceAccess() const
Provides access to the document device interface.
Definition: node.cxx:2159
const IDocumentSettingAccess * getIDocumentSettingAccess() const
Provides access to the document setting interface.
Definition: node.cxx:2158
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:58
SwPageDesc * FindPageDesc()
Definition: pagechg.cxx:755
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:1366
tools::Long GetHeight(const SwRect &rRect) const
Definition: frame.hxx:1381
tools::Long GetPrtTop(const SwFrame &rFrame) const
Definition: frame.hxx:1408
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:223
vector_type::size_type size_type
Definition: docary.hxx:222
SwViewShell * GetCurrShell() const
Definition: rootfrm.hxx:206
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:122
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:999
bool IsOn() const
Definition: txtfly.hxx:319
Represents the style of a paragraph.
Definition: fmtcol.hxx:59
SwLinePortion * GetLast()
Definition: inftxt.hxx:564
SwLineLayout * GetRoot()
Definition: inftxt.hxx:560
void SetLast(SwLinePortion *pNewLast)
Definition: inftxt.hxx:565
void SetNewLine(const bool bNew)
Definition: inftxt.hxx:582
SwDoc & GetDoc()
Definition: txtfrm.hxx:466
void HideAndShowObjects()
Hides respectively shows objects, which are anchored at paragraph, at/as a character of the paragraph...
Definition: txtfrm.cxx:1549
bool HasPara() const
Definition: txtfrm.hxx:825
bool FillRegister(SwTwips &rRegStart, sal_uInt16 &rRegDiff)
Determines the start position and step size of the register.
Definition: porrst.cxx:488
bool IsSwapped() const
Definition: txtfrm.hxx:541
void ClearPara()
Removes the Line information from the Cache but retains the entry itself.
Definition: txtcache.cxx:104
sw::MergedPara * GetMergedPara()
Definition: txtfrm.hxx:456
void AdjustFrame(const SwTwips nChgHeight, bool bHasToFit=false)
Definition: frmform.cxx:365
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:1455
SwTextNode * GetTextNodeFirst()
Definition: txtfrm.hxx:463
void RemoveFromCache()
Removes this frame completely from the Cache.
Definition: txtcache.cxx:120
SwTextNode const * GetTextNodeForParaProps() const
Definition: txtfrm.cxx:1303
bool FormatEmpty()
Definition: porrst.cxx:406
void SetEmpty(const bool bNew)
Definition: txtfrm.hxx:253
bool GetHasRotatedPortions() const
Definition: txtfrm.hxx:536
bool IsEmpty() const
Definition: txtfrm.hxx:527
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:111
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:751
SwTextFly & GetTextFly()
Definition: inftxt.hxx:387
const Point & GetPos() const
Definition: inftxt.hxx:432
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:723
void DrawBackBrush(const SwLinePortion &rPor) const
Definition: inftxt.cxx:1146
void DrawViewOpt(const SwLinePortion &rPor, PortionType nWhich, const Color *pColor=nullptr) const
Definition: inftxt.cxx:1308
void DrawBorder(const SwLinePortion &rPor) const
Draw character border around a line portion.
Definition: inftxt.cxx:1296
void DrawLineBreak(const SwLinePortion &rPor) const
Definition: inftxt.cxx:965
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:385
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:571
bool IsParagraph(bool bHard=false) const
Definition: viewopt.hxx:313
bool IsPagePreview() const
Definition: viewopt.hxx:743
bool IsShowBookmarks(bool const bHard=false) const
Definition: viewopt.hxx:327
bool IsPrtFormat() const
Definition: viewopt.hxx:649
bool getBrowseMode() const
Definition: viewopt.hxx:580
static bool IsFieldShadings()
Definition: viewopt.hxx:780
bool IsLineBreak(bool bHard=false) const
Definition: viewopt.hxx:333
static Color & GetFieldShadingsColor()
Definition: viewopt.cxx:444
vcl::RenderContext * GetOut() const
Definition: viewsh.hxx:347
const SwViewOption * GetViewOptions() const
Definition: viewsh.hxx:433
vcl::Window * GetWin() const
Definition: viewsh.hxx:346
::OutputDevice const * GetOutDev() const
constexpr ::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
Color m_aColor
#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)
aStr
aBuf
SwNumRule * GetNumRule(SwTextFormatColl &rTextFormatColl)
determines the list style, which directly set at the given paragraph style
Definition: fmtcol.cxx:76
int i
long Long
SwTextGridItem const * GetGridItem(SwPageFrame const *const)
Definition: pagechg.cxx:2595
#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:165
tools::Long SwTwips
Definition: swtypes.hxx:51
#define CHAR_WJ
Definition: swtypes.hxx:177
#define CHAR_ZWSP
Definition: swtypes.hxx:176
#define NON_PRINTING_CHARACTER_COLOR
Definition: txtfrm.hxx:54
oslFileHandle & pOut