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 // 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
442 // only need to check one node because of early return on GetMerged()
443 for (SwContentIndex const* pIndex = GetTextNodeFirst()->GetFirstIndex();
444 pIndex; pIndex = pIndex->GetNext())
445 {
446 sw::mark::IMark const*const pMark = pIndex->GetMark();
447 if (dynamic_cast<const sw::mark::IBookmark*>(pMark) != nullptr)
448 { // need bookmark portions!
449 return false;
450 }
451 }
452
453 SwTwips nHeight = EmptyHeight();
454
455 if (aSet.GetParaGrid().GetValue() &&
456 IsInDocBody() )
457 {
458 SwTextGridItem const*const pGrid(GetGridItem(FindPageFrame()));
459 if ( pGrid )
460 nHeight = pGrid->GetBaseHeight() + pGrid->GetRubyHeight();
461 }
462
463 SwRectFnSet aRectFnSet(this);
464 const SwTwips nChg = nHeight - aRectFnSet.GetHeight(getFramePrintArea());
465
466 if( !nChg )
467 SetUndersized( false );
468 AdjustFrame( nChg );
469
471 {
472 ClearPara();
474 }
475
477 if( !IsEmpty() )
478 {
479 SetEmpty( true );
481 }
482 if( !bCollapse && !bFirstFlyCheck &&
483 aTextFly.IsOn() && aTextFly.IsAnyObj( aRect ) )
484 return false;
485
486 // #i35635# - call method <HideAndShowObjects()>
487 // to assure that objects anchored at the empty paragraph are
488 // correctly visible resp. invisible.
490 return true;
491}
492
493bool SwTextFrame::FillRegister( SwTwips& rRegStart, sal_uInt16& rRegDiff )
494{
495 const SwFrame *pFrame = this;
496 rRegDiff = 0;
497 while( !( ( SwFrameType::Body | SwFrameType::Fly )
498 & pFrame->GetType() ) && pFrame->GetUpper() )
499 pFrame = pFrame->GetUpper();
500 if( ( SwFrameType::Body| SwFrameType::Fly ) & pFrame->GetType() )
501 {
502 SwRectFnSet aRectFnSet(pFrame);
503 rRegStart = aRectFnSet.GetPrtTop(*pFrame);
504 pFrame = pFrame->FindPageFrame();
505 if( pFrame->IsPageFrame() )
506 {
507 SwPageDesc* pDesc = const_cast<SwPageFrame*>(static_cast<const SwPageFrame*>(pFrame))->FindPageDesc();
508 if( pDesc )
509 {
510 rRegDiff = pDesc->GetRegHeight();
511 if( !rRegDiff )
512 {
513 const SwTextFormatColl *pFormat = pDesc->GetRegisterFormatColl();
514 if( pFormat )
515 {
516 const SvxLineSpacingItem &rSpace = pFormat->GetLineSpacing();
517 if( SvxLineSpaceRule::Fix == rSpace.GetLineSpaceRule() )
518 {
519 rRegDiff = rSpace.GetLineHeight();
520 pDesc->SetRegHeight( rRegDiff );
521 pDesc->SetRegAscent( ( 4 * rRegDiff ) / 5 );
522 }
523 else
524 {
526 SwFontAccess aFontAccess( pFormat, pSh );
527 SwFont aFnt( aFontAccess.Get()->GetFont() );
528
529 OutputDevice *pOut = nullptr;
530 if( !pSh || !pSh->GetViewOptions()->getBrowseMode() ||
531 pSh->GetViewOptions()->IsPrtFormat() )
533
534 if( pSh && !pOut )
535 pOut = pSh->GetWin()->GetOutDev();
536
537 if( !pOut )
539
540 MapMode aOldMap( pOut->GetMapMode() );
541 pOut->SetMapMode( MapMode( MapUnit::MapTwip ) );
542
543 aFnt.ChgFnt( pSh, *pOut );
544 rRegDiff = aFnt.GetHeight( pSh, *pOut );
545 sal_uInt16 nNetHeight = rRegDiff;
546
547 switch( rSpace.GetLineSpaceRule() )
548 {
549 case SvxLineSpaceRule::Auto:
550 break;
551 case SvxLineSpaceRule::Min:
552 {
553 if( rRegDiff < rSpace.GetLineHeight() )
554 rRegDiff = rSpace.GetLineHeight();
555 break;
556 }
557 default:
558 OSL_FAIL( ": unknown LineSpaceRule" );
559 }
560 switch( rSpace.GetInterLineSpaceRule() )
561 {
562 case SvxInterLineSpaceRule::Off:
563 break;
564 case SvxInterLineSpaceRule::Prop:
565 {
566 tools::Long nTmp = rSpace.GetPropLineSpace();
567 if( nTmp < 50 )
568 nTmp = nTmp ? 50 : 100;
569 nTmp *= rRegDiff;
570 nTmp /= 100;
571 if( !nTmp )
572 ++nTmp;
573 rRegDiff = o3tl::narrowing<sal_uInt16>(nTmp);
574 nNetHeight = rRegDiff;
575 break;
576 }
577 case SvxInterLineSpaceRule::Fix:
578 {
579 rRegDiff = rRegDiff + rSpace.GetInterLineSpace();
580 nNetHeight = rRegDiff;
581 break;
582 }
583 default: OSL_FAIL( ": unknown InterLineSpaceRule" );
584 }
585 pDesc->SetRegHeight( rRegDiff );
586 pDesc->SetRegAscent( rRegDiff - nNetHeight +
587 aFnt.GetAscent( pSh, *pOut ) );
588 pOut->SetMapMode( aOldMap );
589 }
590 }
591 }
592 const tools::Long nTmpDiff = pDesc->GetRegAscent() - rRegDiff;
593 if ( aRectFnSet.IsVert() )
594 rRegStart -= nTmpDiff;
595 else
596 rRegStart += nTmpDiff;
597 }
598 }
599 }
600 return ( 0 != rRegDiff );
601}
602
604{
605#ifdef DBG_UTIL
606 OutputDevice* pOut = const_cast<OutputDevice*>(rInf.GetOut());
607 Color aCol( rInf.GetOpt().GetFieldShadingsColor() );
608 Color aOldColor( pOut->GetFillColor() );
609 pOut->SetFillColor( aCol );
610 Point aPos( rInf.GetPos() );
611 aPos.AdjustY( -150 );
612 aPos.AdjustX( -25 );
613 SwRect aRect( aPos, Size( 100, 200 ) );
614 pOut->DrawRect( aRect.SVRect() );
615 pOut->SetFillColor( aOldColor );
616#else
617 (void)rInf;
618#endif
619}
620
622{
623 Width( 0 );
624 rInf.GetTextFrame()->HideFootnotes( rInf.GetIdx(), rInf.GetIdx() + GetLen() );
625
626 return false;
627};
628
630 OUString & rOutString, SwFont & rTmpFont, int &) const
631{
632 if (mcChar == CHAR_WJ || !rTextPaintInfo.GetOpt().IsFieldShadings())
633 {
634 return false;
635 }
636
637 switch (mcChar)
638 {
639 case CHAR_ZWSP:
640 rOutString = "/"; break;
641// case CHAR_LRM :
642// rText = sal_Unicode(0x2514); break;
643// case CHAR_RLM :
644// rText = sal_Unicode(0x2518); break;
645 default:
646 assert(false);
647 break;
648 }
649
650 rTmpFont.SetEscapement( CHAR_ZWSP == mcChar ? DFLT_ESC_AUTO_SUB : -25 );
651 const sal_uInt16 nProp = 40;
652 rTmpFont.SetProportion( nProp ); // a smaller font
653
654 return true;
655}
656
658 OUString & rOutString, SwFont & rFont, int & rDeltaY) const
659{
660 // custom color is visible without field shading, too
661 if (!rTextPaintInfo.GetOpt().IsShowBookmarks())
662 {
663 return false;
664 }
665
666 rOutString = OUStringChar(mcChar);
667
668 // init font: we want OpenSymbol to ensure it doesn't look too crazy;
669 // thin and a bit higher than the surrounding text
670 auto const nOrigAscent(rFont.GetAscent(rTextPaintInfo.GetVsh(), *rTextPaintInfo.GetOut()));
671 rFont.SetName("OpenSymbol", rFont.GetActual());
672 Size aSize(rFont.GetSize(rFont.GetActual()));
673 // use also the external leading (line gap) of the portion, but don't use
674 // 100% of it because i can't figure out how to baseline align that
675 assert(aSize.Height() != 0);
676 auto const nFactor = aSize.Height() > 0 ? (Height() * 95) / aSize.Height() : Height();
677 rFont.SetProportion(nFactor);
678 rFont.SetWeight(WEIGHT_THIN, rFont.GetActual());
679 rFont.SetColor(rTextPaintInfo.GetOpt().GetFieldShadingsColor());
680 // reset these to default...
685 rFont.SetOutline(false);
686 rFont.SetShadow(false);
687 rFont.SetTransparent(false);
688 rFont.SetEmphasisMark(FontEmphasisMark::NONE);
689 rFont.SetEscapement(0);
690 rFont.SetPitch(PITCH_DONTKNOW, rFont.GetActual());
691 rFont.SetRelief(FontRelief::NONE);
692
693 // adjust Y position to account for different baselines of the fonts
694 auto const nOSAscent(rFont.GetAscent(rTextPaintInfo.GetVsh(), *rTextPaintInfo.GetOut()));
695 rDeltaY = nOSAscent - nOrigAscent;
696
697 return true;
698}
699
701{
702 if ( !Width() ) // is only set during prepaint mode
703 return;
704
705 rInf.DrawViewOpt(*this, GetWhichPor());
706
707 int deltaY(0);
708 SwFont aTmpFont( *rInf.GetFont() );
709 OUString aOutString;
710
711 if (!(rInf.OnWin()
712 && !rInf.GetOpt().IsPagePreview()
713 && !rInf.GetOpt().IsReadonly()
714 && DoPaint(rInf, aOutString, aTmpFont, deltaY)))
715 return;
716
717 SwFontSave aFontSave( rInf, &aTmpFont );
718
719 if ( !mnHalfCharWidth )
720 mnHalfCharWidth = rInf.GetTextSize( aOutString ).Width() / 2;
721
722 Point aOldPos = rInf.GetPos();
723 Point aNewPos( aOldPos );
724 auto const deltaX((Width() / 2) - mnHalfCharWidth);
725 switch (rInf.GetFont()->GetOrientation(rInf.GetTextFrame()->IsVertical()).get())
726 {
727 case 0:
728 aNewPos.AdjustX(deltaX);
729 aNewPos.AdjustY(deltaY);
730 break;
731 case 900:
732 aNewPos.AdjustY(-deltaX);
733 aNewPos.AdjustX(deltaY);
734 break;
735 case 2700:
736 aNewPos.AdjustY(deltaX);
737 aNewPos.AdjustX(-deltaY);
738 break;
739 default:
740 assert(false);
741 break;
742 }
743 const_cast< SwTextPaintInfo& >( rInf ).SetPos( aNewPos );
744
745 rInf.DrawText( aOutString, *this );
746
747 const_cast< SwTextPaintInfo& >( rInf ).SetPos( aOldPos );
748}
749
751{
752 if ( !Width() ) // is only set during prepaint mode
753 return;
754
755 rInf.DrawViewOpt(*this, GetWhichPor());
756
757 int deltaY(0);
758 SwFont aTmpFont( *rInf.GetFont() );
759 OUString aOutString;
760
761 if (!(rInf.OnWin()
762 && !rInf.GetOpt().IsPagePreview()
763 && !rInf.GetOpt().IsReadonly()
764 && DoPaint(rInf, aOutString, aTmpFont, deltaY)))
765 return;
766
767 SwFontSave aFontSave( rInf, &aTmpFont );
768
769 if ( !mnHalfCharWidth )
770 mnHalfCharWidth = rInf.GetTextSize( aOutString ).Width() / 2;
771
772 Point aOldPos = rInf.GetPos();
773 Point aNewPos( aOldPos );
774 auto const deltaX((Width() / 2) - mnHalfCharWidth);
775 switch (rInf.GetFont()->GetOrientation(rInf.GetTextFrame()->IsVertical()).get())
776 {
777 case 0:
778 aNewPos.AdjustX(deltaX);
779 aNewPos.AdjustY(deltaY);
780 break;
781 case 900:
782 aNewPos.AdjustY(-deltaX);
783 aNewPos.AdjustX(deltaY);
784 break;
785 case 2700:
786 aNewPos.AdjustY(deltaX);
787 aNewPos.AdjustX(-deltaY);
788 break;
789 default:
790 assert(false);
791 break;
792 }
793
794 // draw end marks before the character position
795 if ( m_nStart == 0 || m_nEnd == 0 )
796 {
797 // single type boundary marks are there outside of the bookmark text
798 // some |text| here
799 // [[ ]]
800 if (m_nStart > 1)
801 aNewPos.AdjustX(static_cast<tools::Long>(mnHalfCharWidth) * -2 * (m_oColors.size() - 1));
802 }
803 else if ( m_nStart != 0 && m_nEnd != 0 )
804 // both end and start boundary marks: adjust them around the bookmark position
805 // |te|xt|
806 // ]] [[
807 aNewPos.AdjustX(static_cast<tools::Long>(mnHalfCharWidth) * -(2 * m_nEnd - 1 + m_nPoint) );
808
809 const_cast< SwTextPaintInfo& >( rInf ).SetPos( aNewPos );
810
811 for ( const auto& it : m_oColors )
812 {
813 // set bold for custom colored bookmark symbol
814 // and draw multiple symbols showing all custom colors
815 aTmpFont.SetWeight( COL_TRANSPARENT == std::get<1>(it) ? WEIGHT_THIN : WEIGHT_BOLD, aTmpFont.GetActual() );
816 aTmpFont.SetColor( COL_TRANSPARENT == std::get<1>(it) ? rInf.GetOpt().GetFieldShadingsColor() : std::get<1>(it) );
817 aOutString = OUString(std::get<0>(it) == SwScriptInfo::MarkKind::Start ? '[' : ']');
818
819 // MarkKind::Point: drawn I-beam (e.g. U+2336) as overlapping ][
820 if ( std::get<0>(it) == SwScriptInfo::MarkKind::Point )
821 {
822 aNewPos.AdjustX(-mnHalfCharWidth * 5/16);
823 const_cast< SwTextPaintInfo& >( rInf ).SetPos( aNewPos );
824 rInf.DrawText( aOutString, *this );
825
826 // when the overlapping vertical lines are 50 pixel width on the screen,
827 // this distance (half width * 5/8) still results precise overlapping
828 aNewPos.AdjustX(mnHalfCharWidth * 5/8);
829 const_cast< SwTextPaintInfo& >( rInf ).SetPos( aNewPos );
830 aOutString = OUString('[');
831 }
832 rInf.DrawText( aOutString, *this );
833 // place the next symbol after the previous one
834 // TODO: fix orientation and start/end
835 aNewPos.AdjustX(mnHalfCharWidth * 2);
836 const_cast< SwTextPaintInfo& >( rInf ).SetPos( aNewPos );
837 }
838
839 const_cast< SwTextPaintInfo& >( rInf ).SetPos( aOldPos );
840}
841
843{
844 OUStringBuffer aStr;
845 for ( const auto& it : m_oColors )
846 {
847 aStr.append("#" + std::get<2>(it) + " " + SwResId(STR_BOOKMARK_DEF_NAME));
848 switch (std::get<0>(it))
849 {
851 break;
853 aStr.append(" " + SwResId(STR_CAPTION_BEGINNING));
854 break;
856 aStr.append(" " + SwResId(STR_CAPTION_END));
857 break;
858 }
859 }
860
861 rPH.Special( GetLen(), aStr.makeStringAndClear(), GetWhichPor() );
862}
863
864void SwBookmarkPortion::dumpAsXml(xmlTextWriterPtr pWriter, const OUString& rText, TextFrameIndex& nOffset) const
865{
866 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwBookmarkPortion"));
867 dumpAsXmlAttributes(pWriter, rText, nOffset);
868 nOffset += GetLen();
869
870 if (!m_oColors.empty())
871 {
872 OUStringBuffer aStr;
873 for (const auto& rColor : m_oColors)
874 {
875 aStr.append("#" + std::get<2>(rColor) + " " + SwResId(STR_BOOKMARK_DEF_NAME));
876 switch (std::get<0>(rColor))
877 {
879 break;
881 aStr.append(" " + SwResId(STR_CAPTION_BEGINNING));
882 break;
884 aStr.append(" " + SwResId(STR_CAPTION_END));
885 break;
886 }
887 }
888 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("colors"),
889 BAD_CAST(aStr.makeStringAndClear().toUtf8().getStr()));
890 }
891
892 (void)xmlTextWriterEndElement(pWriter);
893}
894
896{
897 const SwLinePortion* pRoot = rInf.GetRoot();
898 Width( 0 );
899 Height( pRoot->Height() );
900 SetAscent( pRoot->GetAscent() );
901
902 return false;
903}
904
906{
907 if( !mnViewWidth )
908 mnViewWidth = rInf.GetTextSize(OUString(' ')).Width();
909
910 return mnViewWidth;
911}
912
913/* 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.
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:657
void dumpAsXml(xmlTextWriterPtr pWriter, const OUString &rText, TextFrameIndex &rOffset) const override
Definition: porrst.cxx:864
virtual void HandlePortion(SwPortionHandler &rPH) const override
Definition: porrst.cxx:842
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:750
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:765
SwFormatColl & GetAnyFormatColl() const
Definition: node.hxx:758
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:700
sal_Unicode mcChar
Definition: porrst.hxx:166
virtual bool Format(SwTextFormatInfo &rInf) override
Definition: porrst.cxx:895
virtual bool DoPaint(SwTextPaintInfo const &rInf, OUString &rOutString, SwFont &rTmpFont, int &rDeltaY) const
Definition: porrst.cxx:629
virtual sal_uInt16 GetViewWidth(const SwTextSizeInfo &rInf) const override
Definition: porrst.cxx:905
IDocumentDeviceAccess const & getIDocumentDeviceAccess() const
Definition: doc.cxx:246
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: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:603
virtual bool Format(SwTextFormatInfo &rInf) override
Definition: porrst.cxx:621
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:2150
const IDocumentDeviceAccess & getIDocumentDeviceAccess() const
Provides access to the document device interface.
Definition: node.cxx:2149
const IDocumentSettingAccess * getIDocumentSettingAccess() const
Provides access to the document setting interface.
Definition: node.cxx:2148
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:59
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: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:223
vector_type::size_type size_type
Definition: docary.hxx:222
SwViewShell * GetCurrShell() const
Definition: rootfrm.hxx:210
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:61
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:470
void HideAndShowObjects()
Hides respectively shows objects, which are anchored at paragraph, at/as a character of the paragraph...
Definition: txtfrm.cxx:1570
bool HasPara() const
Definition: txtfrm.hxx:833
bool FillRegister(SwTwips &rRegStart, sal_uInt16 &rRegDiff)
Determines the start position and step size of the register.
Definition: porrst.cxx:493
bool IsSwapped() const
Definition: txtfrm.hxx:545
void ClearPara()
Removes the Line information from the Cache but retains the entry itself.
Definition: txtcache.cxx:104
sw::MergedPara * GetMergedPara()
Definition: txtfrm.hxx:460
void AdjustFrame(const SwTwips nChgHeight, bool bHasToFit=false)
Definition: frmform.cxx:392
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:1476
bool HasNonLastSplitFlyDrawObj() const
This text frame may have a split fly frames anchored to it.
Definition: itratr.cxx:1483
SwTextNode * GetTextNodeFirst()
Definition: txtfrm.hxx:467
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:254
bool GetHasRotatedPortions() const
Definition: txtfrm.hxx:540
bool IsEmpty() const
Definition: txtfrm.hxx:531
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: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:629
bool IsParagraph(bool bHard=false) const
Definition: viewopt.hxx:371
bool IsPagePreview() const
Definition: viewopt.hxx:801
bool IsShowBookmarks(bool const bHard=false) const
Definition: viewopt.hxx:385
bool IsPrtFormat() const
Definition: viewopt.hxx:707
bool getBrowseMode() const
Definition: viewopt.hxx:638
bool IsLineBreak(bool bHard=false) const
Definition: viewopt.hxx:391
const Color & GetFieldShadingsColor() const
Definition: viewopt.cxx:527
bool IsFieldShadings() const
Definition: viewopt.hxx:838
vcl::RenderContext * GetOut() const
Definition: viewsh.hxx:347
const SwViewOption * GetViewOptions() const
Definition: viewsh.hxx:434
vcl::Window * GetWin() const
Definition: viewsh.hxx:346
::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:2650
#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:55
oslFileHandle & pOut