LibreOffice Module sw (master) 1
inftxt.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 <com/sun/star/linguistic2/XHyphenator.hpp>
21
23#include <unotools/lingucfg.hxx>
24#include <hintids.hxx>
25#include <svl/ctloptions.hxx>
26#include <sfx2/infobar.hxx>
27#include <sfx2/printer.hxx>
28#include <sal/log.hxx>
32#include <editeng/splwrap.hxx>
33#include <editeng/pgrditem.hxx>
34#include <editeng/tstpitem.hxx>
35#include <editeng/shaditem.hxx>
36
37#include <SwSmartTagMgr.hxx>
38#include <breakit.hxx>
40#include <swmodule.hxx>
41#include <vcl/svapp.hxx>
42#include <viewsh.hxx>
43#include <viewopt.hxx>
44#include <frmtool.hxx>
48#include <paratr.hxx>
49#include <rootfrm.hxx>
50#include "inftxt.hxx"
51#include <noteurl.hxx>
52#include "porftn.hxx"
53#include "porrst.hxx"
54#include "itratr.hxx"
55#include "portab.hxx"
56#include <wrong.hxx>
57#include <doc.hxx>
58#include <pam.hxx>
59#include <numrule.hxx>
61#include <docsh.hxx>
62#include <strings.hrc>
63#include <o3tl/deleter.hxx>
64#include <vcl/gdimtf.hxx>
65#include <vcl/virdev.hxx>
66#include <vcl/gradient.hxx>
68#include <formatlinebreak.hxx>
69
70#include <view.hxx>
71#include <wrtsh.hxx>
72#include <com/sun/star/text/XTextRange.hpp>
73#include <unotextrange.hxx>
74#include <SwStyleNameMapper.hxx>
75#include <unoprnms.hxx>
76#include <editeng/unoprnms.hxx>
77#include <unomap.hxx>
78#include <com/sun/star/awt/FontSlant.hpp>
79
80using namespace ::com::sun::star;
81using namespace ::com::sun::star::linguistic2;
82using namespace ::com::sun::star::uno;
83using namespace ::com::sun::star::beans;
84
85#define CHAR_UNDERSCORE u'_'
86#define CHAR_LEFT_ARROW u'\x25C0'
87#define CHAR_RIGHT_ARROW u'\x25B6'
88#define CHAR_TAB u'\x2192'
89#define CHAR_TAB_RTL u'\x2190'
90#define CHAR_LINEBREAK u'\x21B5'
91#define CHAR_LINEBREAK_RTL u'\x21B3'
92
93#define DRAW_SPECIAL_OPTIONS_CENTER 1
94#define DRAW_SPECIAL_OPTIONS_ROTATE 2
95
97 : m_pSpace( nullptr ),
98 m_nVertAlign( SvxParaVertAlignItem::Align::Automatic ),
99 m_nDefTabStop( 0 ),
100 m_bListTabStopIncluded( false ),
101 m_nListTabStopPosition( 0 )
102{
103}
104
106{
107}
108
110 const SwTextNode& rTextNode )
111{
112 m_oRuler.emplace( rAttrSet.GetTabStops() );
114 {
116
117 // insert the list tab stop into SvxTabItem instance <pRuler>
118 const SvxTabStop aListTabStop( m_nListTabStopPosition,
119 SvxTabAdjust::Left );
120 m_oRuler->Insert( aListTabStop );
121
122 // remove default tab stops, which are before the inserted list tab stop
123 for ( sal_uInt16 i = 0; i < m_oRuler->Count(); i++ )
124 {
125 if ( (*m_oRuler)[i].GetTabPos() < m_nListTabStopPosition &&
126 (*m_oRuler)[i].GetAdjustment() == SvxTabAdjust::Default )
127 {
128 m_oRuler->Remove(i);
129 continue;
130 }
131 }
132 }
133
135 {
136 // remove default tab stop at position 0
137 for ( sal_uInt16 i = 0; i < m_oRuler->Count(); i++ )
138 {
139 if ( (*m_oRuler)[i].GetTabPos() == 0 &&
140 (*m_oRuler)[i].GetAdjustment() == SvxTabAdjust::Default )
141 {
142 m_oRuler->Remove(i);
143 break;
144 }
145 }
146 }
147
148 m_pSpace = &rAttrSet.GetLineSpacing();
150 m_nDefTabStop = USHRT_MAX;
151}
152
154{
155 m_pPara = pFrame->GetPara();
156 m_nTextStart = pFrame->GetOffset();
157 if (!m_pPara)
158 {
159 SAL_WARN("sw.core", "+SwTextInfo::CTOR: missing paragraph information");
160 pFrame->Format(pFrame->getRootFrame()->GetCurrShell()->GetOut());
161 m_pPara = pFrame->GetPara();
162 }
163}
164
166 : m_pPara( const_cast<SwTextInfo&>(rInf).GetParaPortion() )
167 , m_nTextStart( rInf.GetTextStart() )
168{ }
169
170#if OSL_DEBUG_LEVEL > 0
171
172static void ChkOutDev( const SwTextSizeInfo &rInf )
173{
174 if ( !rInf.GetVsh() )
175 return;
176
177 const OutputDevice* pOut = rInf.GetOut();
178 const OutputDevice* pRef = rInf.GetRefDev();
179 OSL_ENSURE( pOut && pRef, "ChkOutDev: invalid output devices" );
180}
181#endif
182
184{
185 const TextFrameIndex nTextLen(rInf.GetText().getLength());
187 return nTextLen;
188 const TextFrameIndex nInfLen = rInf.GetIdx() + rInf.GetLen();
189 return std::min(nTextLen, nInfLen);
190}
191
193: m_pKanaComp(nullptr)
194, m_pVsh(nullptr)
195, m_pOut(nullptr)
196, m_pRef(nullptr)
197, m_pFnt(nullptr)
198, m_pUnderFnt(nullptr)
199, m_pFrame(nullptr)
200, m_pOpt(nullptr)
201, m_pText(nullptr)
202, m_nIdx(0)
203, m_nLen(0)
204, m_nMeasureLen(COMPLETE_STRING)
205, m_nKanaIdx(0)
206, m_bOnWin (false)
207, m_bNotEOL (false)
208, m_bURLNotify(false)
209, m_bStopUnderflow(false)
210, m_bFootnoteInside(false)
211, m_bOtherThanFootnoteInside(false)
212, m_bMulti(false)
213, m_bFirstMulti(false)
214, m_bRuby(false)
215, m_bHanging(false)
216, m_bScriptSpace(false)
217, m_bForbiddenChars(false)
218, m_bSnapToGrid(false)
219, m_nDirection(0)
220{}
221
223 : SwTextInfo( rNew ),
224 m_pKanaComp(rNew.GetpKanaComp()),
225 m_pVsh(const_cast<SwTextSizeInfo&>(rNew).GetVsh()),
226 m_pOut(const_cast<SwTextSizeInfo&>(rNew).GetOut()),
227 m_pRef(const_cast<SwTextSizeInfo&>(rNew).GetRefDev()),
228 m_pFnt(const_cast<SwTextSizeInfo&>(rNew).GetFont()),
229 m_pUnderFnt(rNew.GetUnderFnt()),
230 m_pFrame(rNew.m_pFrame),
231 m_pOpt(&rNew.GetOpt()),
232 m_pText(&rNew.GetText()),
233 m_nIdx(rNew.GetIdx()),
234 m_nLen(rNew.GetLen()),
235 m_nMeasureLen(rNew.GetMeasureLen()),
236 m_nKanaIdx( rNew.GetKanaIdx() ),
237 m_bOnWin( rNew.OnWin() ),
238 m_bNotEOL( rNew.NotEOL() ),
239 m_bURLNotify( rNew.URLNotify() ),
240 m_bStopUnderflow( rNew.StopUnderflow() ),
241 m_bFootnoteInside( rNew.IsFootnoteInside() ),
242 m_bOtherThanFootnoteInside( rNew.IsOtherThanFootnoteInside() ),
243 m_bMulti( rNew.IsMulti() ),
244 m_bFirstMulti( rNew.IsFirstMulti() ),
245 m_bRuby( rNew.IsRuby() ),
246 m_bHanging( rNew.IsHanging() ),
247 m_bScriptSpace( rNew.HasScriptSpace() ),
248 m_bForbiddenChars( rNew.HasForbiddenChars() ),
249 m_bSnapToGrid( rNew.SnapToGrid() ),
250 m_nDirection( rNew.GetDirection() )
251{
252#if OSL_DEBUG_LEVEL > 0
253 ChkOutDev( *this );
254#endif
255}
256
258 TextFrameIndex const nNewIdx)
259{
260 m_pKanaComp = nullptr;
261 m_nKanaIdx = 0;
262 m_pFrame = pFrame;
264 SwDoc const& rDoc(m_pFrame->GetDoc());
266
267 // Get the output and reference device
268 if ( m_pVsh )
269 {
270 m_pOut = pRenderContext;
271 m_pRef = &m_pVsh->GetRefDev();
272 m_bOnWin = m_pVsh->GetWin() || OUTDEV_WINDOW == m_pOut->GetOutDevType() || m_pVsh->isOutputToWindow();
273 }
274 else
275 {
276 // Access via StarONE. We do not need a Shell or an active one.
278 {
279 // We can only pick the AppWin here? (there's nothing better to pick?)
281 }
282 else
284
285 m_pRef = m_pOut;
286 }
287
288#if OSL_DEBUG_LEVEL > 0
289 ChkOutDev( *this );
290#endif
291
292 // Set default layout mode ( LTR or RTL ).
293 if ( m_pFrame->IsRightToLeft() )
294 {
298 }
299 else
300 {
304 }
305
306 // The Options
307
308 m_pOpt = m_pVsh ?
310 SW_MOD()->GetViewOption(rDoc.getIDocumentSettingAccess().get(DocumentSettingId::HTML_MODE)); // Options from Module, due to StarONE
311
312 // bURLNotify is set if MakeGraphic prepares it
313 // TODO: Unwind
315
318
319 m_pFnt = nullptr;
320 m_pUnderFnt = nullptr;
322
323 m_nIdx = nNewIdx;
325 m_bNotEOL = false;
328 m_bForbiddenChars = false;
329
330 SetLen( GetMinLen( *this ) );
331}
332
333SwTextSizeInfo::SwTextSizeInfo( const SwTextSizeInfo &rNew, const OUString* pText,
334 TextFrameIndex const nIndex)
335 : SwTextInfo( rNew ),
336 m_pKanaComp(rNew.GetpKanaComp()),
337 m_pVsh(const_cast<SwTextSizeInfo&>(rNew).GetVsh()),
338 m_pOut(const_cast<SwTextSizeInfo&>(rNew).GetOut()),
339 m_pRef(const_cast<SwTextSizeInfo&>(rNew).GetRefDev()),
340 m_pFnt(const_cast<SwTextSizeInfo&>(rNew).GetFont()),
341 m_pUnderFnt(rNew.GetUnderFnt()),
342 m_pFrame( rNew.m_pFrame ),
343 m_pOpt(&rNew.GetOpt()),
344 m_pText(pText),
345 m_nIdx(nIndex),
346 m_nLen(COMPLETE_STRING),
347 m_nMeasureLen(COMPLETE_STRING),
348 m_nKanaIdx( rNew.GetKanaIdx() ),
349 m_bOnWin( rNew.OnWin() ),
350 m_bNotEOL( rNew.NotEOL() ),
351 m_bURLNotify( rNew.URLNotify() ),
352 m_bStopUnderflow( rNew.StopUnderflow() ),
353 m_bFootnoteInside( rNew.IsFootnoteInside() ),
354 m_bOtherThanFootnoteInside( rNew.IsOtherThanFootnoteInside() ),
355 m_bMulti( rNew.IsMulti() ),
356 m_bFirstMulti( rNew.IsFirstMulti() ),
357 m_bRuby( rNew.IsRuby() ),
358 m_bHanging( rNew.IsHanging() ),
359 m_bScriptSpace( rNew.HasScriptSpace() ),
360 m_bForbiddenChars( rNew.HasForbiddenChars() ),
361 m_bSnapToGrid( rNew.SnapToGrid() ),
362 m_nDirection( rNew.GetDirection() )
363{
364#if OSL_DEBUG_LEVEL > 0
365 ChkOutDev( *this );
366#endif
367 SetLen( GetMinLen( *this ) );
368}
369
371 TextFrameIndex const nIndex)
372 : m_bOnWin(false)
373{
374 CtorInitTextSizeInfo( pTextFrame->getRootFrame()->GetCurrShell()->GetOut(), pTextFrame, nIndex );
375}
376
378{
379 // The path needs to go via ChgPhysFnt or the FontMetricCache gets confused.
380 // In this case pLastMet has it's old value.
381 // Wrong: GetOut()->SetFont( GetFont()->GetFnt() );
382 GetFont()->Invalidate();
384}
385
387{
388 if( OnWin() )
390
391 OSL_ENSURE( m_pOut == m_pVsh->GetOut(),
392 "SwTextSizeInfo::NoteAnimation() changed m_pOut" );
393}
394
396 const SwScriptInfo* pSI,
397 const OUString& rText,
398 const TextFrameIndex nIndex,
399 const TextFrameIndex nLength) const
400{
401 SwDrawTextInfo aDrawInf( m_pVsh, *pOutDev, pSI, rText, nIndex, nLength );
402 aDrawInf.SetFrame( m_pFrame );
403 aDrawInf.SetFont( m_pFnt );
404 aDrawInf.SetSnapToGrid( SnapToGrid() );
405 aDrawInf.SetKanaComp( 0 );
406 return SwPosSize(m_pFnt->GetTextSize_( aDrawInf ));
407}
408
410{
411 const SwScriptInfo& rSI =
412 const_cast<SwParaPortion*>(GetParaPortion())->GetScriptInfo();
413
414 // in some cases, compression is not allowed or suppressed for
415 // performance reasons
416 sal_uInt16 nComp =( SwFontScript::CJK == GetFont()->GetActual() &&
417 rSI.CountCompChg() &&
418 ! IsMulti() ) ?
419 GetKanaComp() :
420 0 ;
421
422 SwDrawTextInfo aDrawInf( m_pVsh, *m_pOut, &rSI, *m_pText, m_nIdx, m_nLen );
423 aDrawInf.SetMeasureLen( m_nMeasureLen );
424 aDrawInf.SetFrame( m_pFrame );
425 aDrawInf.SetFont( m_pFnt );
426 aDrawInf.SetSnapToGrid( SnapToGrid() );
427 aDrawInf.SetKanaComp( nComp );
428 return SwPosSize(m_pFnt->GetTextSize_( aDrawInf ));
429}
430
432 const TextFrameIndex nLength, const sal_uInt16 nComp,
433 sal_uInt16& nMinSize, sal_uInt16& nMaxSizeDiff,
434 vcl::text::TextLayoutCache const*const pCache) const
435{
436 SwDrawTextInfo aDrawInf( m_pVsh, *m_pOut, pSI, *m_pText, nIndex, nLength,
437 0, false, pCache);
438 aDrawInf.SetFrame( m_pFrame );
439 aDrawInf.SetFont( m_pFnt );
440 aDrawInf.SetSnapToGrid( SnapToGrid() );
441 aDrawInf.SetKanaComp( nComp );
442 SwPosSize aSize( m_pFnt->GetTextSize_( aDrawInf ) );
443 nMaxSizeDiff = o3tl::narrowing<sal_uInt16>(aDrawInf.GetKanaDiff());
444 nMinSize = aSize.Width();
445}
446
448 const TextFrameIndex nMaxLen,
449 const sal_uInt16 nComp,
450 vcl::text::TextLayoutCache const*const pCache) const
451{
452 const SwScriptInfo& rScriptInfo =
453 const_cast<SwParaPortion*>(GetParaPortion())->GetScriptInfo();
454
455 OSL_ENSURE( m_pRef == m_pOut, "GetTextBreak is supposed to use the RefDev" );
456 SwDrawTextInfo aDrawInf( m_pVsh, *m_pOut, &rScriptInfo,
457 *m_pText, GetIdx(), nMaxLen, 0, false, pCache );
458 aDrawInf.SetFrame( m_pFrame );
459 aDrawInf.SetFont( m_pFnt );
460 aDrawInf.SetSnapToGrid( SnapToGrid() );
461 aDrawInf.SetKanaComp( nComp );
462 aDrawInf.SetHyphPos( nullptr );
463
464 return m_pFnt->GetTextBreak( aDrawInf, nLineWidth );
465}
466
468 const TextFrameIndex nMaxLen,
469 const sal_uInt16 nComp,
470 TextFrameIndex& rExtraCharPos,
471 vcl::text::TextLayoutCache const*const pCache) const
472{
473 const SwScriptInfo& rScriptInfo =
474 const_cast<SwParaPortion*>(GetParaPortion())->GetScriptInfo();
475
476 OSL_ENSURE( m_pRef == m_pOut, "GetTextBreak is supposed to use the RefDev" );
477 SwDrawTextInfo aDrawInf( m_pVsh, *m_pOut, &rScriptInfo,
478 *m_pText, GetIdx(), nMaxLen, 0, false, pCache );
479 aDrawInf.SetFrame( m_pFrame );
480 aDrawInf.SetFont( m_pFnt );
481 aDrawInf.SetSnapToGrid( SnapToGrid() );
482 aDrawInf.SetKanaComp( nComp );
483 aDrawInf.SetHyphPos( &rExtraCharPos );
484
485 return m_pFnt->GetTextBreak( aDrawInf, nLineWidth );
486}
487
489{
490 std::pair<SwTextNode const*, sal_Int32> const pos(m_pFrame->MapViewToModel(nPos));
491 return pos.first->GetTextAttrForCharAt(pos.second);
492}
493
494void SwTextPaintInfo::CtorInitTextPaintInfo( OutputDevice* pRenderContext, SwTextFrame *pFrame, const SwRect &rPaint )
495{
496 CtorInitTextSizeInfo( pRenderContext, pFrame, TextFrameIndex(0) );
497 m_aTextFly.CtorInitTextFly( pFrame );
498 m_aPaintRect = rPaint;
499 m_nSpaceIdx = 0;
500 m_pSpaceAdd = nullptr;
501 m_pWrongList = nullptr;
502 m_pGrammarCheckList = nullptr;
503 m_pSmartTags = nullptr;
504 m_pBrushItem = nullptr;
505}
506
507SwTextPaintInfo::SwTextPaintInfo( const SwTextPaintInfo &rInf, const OUString* pText )
508 : SwTextSizeInfo( rInf, pText )
509 , m_pWrongList( rInf.GetpWrongList() )
510 , m_pGrammarCheckList( rInf.GetGrammarCheckList() )
511 , m_pSmartTags( rInf.GetSmartTags() )
512 , m_pSpaceAdd( rInf.GetpSpaceAdd() ),
513 m_pBrushItem( rInf.GetBrushItem() ),
514 m_aTextFly( rInf.GetTextFly() ),
515 m_aPos( rInf.GetPos() ),
516 m_aPaintRect( rInf.GetPaintRect() ),
517 m_nSpaceIdx( rInf.GetSpaceIdx() )
518{ }
519
521 : SwTextSizeInfo( rInf )
522 , m_pWrongList( rInf.GetpWrongList() )
523 , m_pGrammarCheckList( rInf.GetGrammarCheckList() )
524 , m_pSmartTags( rInf.GetSmartTags() )
525 , m_pSpaceAdd( rInf.GetpSpaceAdd() ),
526 m_pBrushItem( rInf.GetBrushItem() ),
527 m_aTextFly( rInf.GetTextFly() ),
528 m_aPos( rInf.GetPos() ),
529 m_aPaintRect( rInf.GetPaintRect() ),
530 m_nSpaceIdx( rInf.GetSpaceIdx() )
531{ }
532
534{
535 CtorInitTextPaintInfo( pFrame->getRootFrame()->GetCurrShell()->GetOut(), pFrame, rPaint );
536}
537
538namespace
539{
544class SwTransparentTextGuard
545{
547 GDIMetaFile m_aContentMetafile;
548 MapMode m_aNewMapMode;
549 SwRect m_aPorRect;
550 SwTextPaintInfo& m_rPaintInf;
551 SwDrawTextInfo& m_rDrawInf;
552
553public:
554 SwTransparentTextGuard(const SwLinePortion& rPor, SwTextPaintInfo& rPaintInf,
555 SwDrawTextInfo& rDrawInf);
556 ~SwTransparentTextGuard();
557};
558
559SwTransparentTextGuard::SwTransparentTextGuard(const SwLinePortion& rPor,
560 SwTextPaintInfo& rPaintInf, SwDrawTextInfo& rDrawInf)
561 : m_aNewMapMode(rPaintInf.GetOut()->GetMapMode())
562 , m_rPaintInf(rPaintInf)
563 , m_rDrawInf(rDrawInf)
564{
565 rPaintInf.CalcRect(rPor, &m_aPorRect);
566 rDrawInf.SetOut(*m_aContentVDev);
567 m_aContentVDev->SetMapMode(rPaintInf.GetOut()->GetMapMode());
568 m_aContentMetafile.Record(m_aContentVDev.get());
569 m_aContentVDev->SetLineColor(rPaintInf.GetOut()->GetLineColor());
570 m_aContentVDev->SetFillColor(rPaintInf.GetOut()->GetFillColor());
571 m_aContentVDev->SetFont(rPaintInf.GetOut()->GetFont());
572 m_aContentVDev->SetDrawMode(rPaintInf.GetOut()->GetDrawMode());
573 m_aContentVDev->SetSettings(rPaintInf.GetOut()->GetSettings());
574 m_aContentVDev->SetRefPoint(rPaintInf.GetOut()->GetRefPoint());
575}
576
577SwTransparentTextGuard::~SwTransparentTextGuard()
578{
579 m_aContentMetafile.Stop();
580 m_aContentMetafile.WindStart();
581 m_aNewMapMode.SetOrigin(m_aPorRect.TopLeft());
582 m_aContentMetafile.SetPrefMapMode(m_aNewMapMode);
583 m_aContentMetafile.SetPrefSize(m_aPorRect.SSize());
584 m_rDrawInf.SetOut(*m_rPaintInf.GetOut());
585 Gradient aVCLGradient;
586 sal_uInt8 nTransPercentVcl = 255 - m_rPaintInf.GetFont()->GetColor().GetAlpha();
587 const Color aTransColor(nTransPercentVcl, nTransPercentVcl, nTransPercentVcl);
588 aVCLGradient.SetStyle(css::awt::GradientStyle_LINEAR);
589 aVCLGradient.SetStartColor(aTransColor);
590 aVCLGradient.SetEndColor(aTransColor);
591 aVCLGradient.SetAngle(0_deg10);
592 aVCLGradient.SetBorder(0);
593 aVCLGradient.SetOfsX(0);
594 aVCLGradient.SetOfsY(0);
595 aVCLGradient.SetStartIntensity(100);
596 aVCLGradient.SetEndIntensity(100);
597 aVCLGradient.SetSteps(2);
598 m_rPaintInf.GetOut()->DrawTransparent(m_aContentMetafile, m_aPorRect.TopLeft(),
599 m_aPorRect.SSize(), aVCLGradient);
600}
601}
602
603void SwTextPaintInfo::DrawText_( const OUString &rText, const SwLinePortion &rPor,
604 TextFrameIndex const nStart, TextFrameIndex const nLength,
605 const bool bKern, const bool bWrong,
606 const bool bSmartTag,
607 const bool bGrammarCheck )
608{
609 if( !nLength )
610 return;
611
612 // The SwScriptInfo is useless if we are inside a field portion
613 SwScriptInfo* pSI = nullptr;
614 if ( ! rPor.InFieldGrp() )
615 pSI = &GetParaPortion()->GetScriptInfo();
616
617 // in some cases, kana compression is not allowed or suppressed for
618 // performance reasons
619 sal_uInt16 nComp = 0;
620 if ( ! IsMulti() )
621 nComp = GetKanaComp();
622
623 bool bCfgIsAutoGrammar = false;
624 SvtLinguConfig().GetProperty( UPN_IS_GRAMMAR_AUTO ) >>= bCfgIsAutoGrammar;
625 const bool bBullet = OnWin() && GetOpt().IsBlank() && IsNoSymbol();
626 const bool bTmpWrong = bWrong && OnWin() && GetOpt().IsOnlineSpell();
627 const bool bTmpGrammarCheck = bGrammarCheck && OnWin() && bCfgIsAutoGrammar && GetOpt().IsOnlineSpell();
628 const bool bTmpSmart = bSmartTag && OnWin() && !GetOpt().IsPagePreview() && SwSmartTagMgr::Get().IsSmartTagsEnabled();
629
630 OSL_ENSURE( GetParaPortion(), "No paragraph!");
631 SwDrawTextInfo aDrawInf( m_pFrame->getRootFrame()->GetCurrShell(), *m_pOut, pSI, rText, nStart, nLength,
632 rPor.Width(), bBullet );
633
634 aDrawInf.SetUnderFnt( m_pUnderFnt );
635
636 const tools::Long nSpaceAdd = ( rPor.IsBlankPortion() || rPor.IsDropPortion() ||
637 rPor.InNumberGrp() ) ? 0 : GetSpaceAdd();
638 if ( nSpaceAdd )
639 {
640 TextFrameIndex nCharCnt(0);
641 // #i41860# Thai justified alignment needs some
642 // additional information:
643 aDrawInf.SetNumberOfBlanks( rPor.InTextGrp() ?
644 static_cast<const SwTextPortion&>(rPor).GetSpaceCnt( *this, nCharCnt ) :
645 TextFrameIndex(0) );
646 }
647
648 aDrawInf.SetSpace( nSpaceAdd );
649 aDrawInf.SetKanaComp( nComp );
650
651 // the font is used to identify the current script via nActual
652 aDrawInf.SetFont( m_pFnt );
653 // the frame is used to identify the orientation
654 aDrawInf.SetFrame( GetTextFrame() );
655 // we have to know if the paragraph should snap to grid
656 aDrawInf.SetSnapToGrid( SnapToGrid() );
657 // for underlining we must know when not to add extra space behind
658 // a character in justified mode
659 aDrawInf.SetSpaceStop( ! rPor.GetNextPortion() ||
660 rPor.GetNextPortion()->InFixMargGrp() ||
661 rPor.GetNextPortion()->IsHolePortion() );
662
663 // Draw text next to the left border
664 Point aFontPos(m_aPos);
665 if( m_pFnt->GetLeftBorder() && rPor.InTextGrp() && !static_cast<const SwTextPortion&>(rPor).GetJoinBorderWithPrev() )
666 {
667 const sal_uInt16 nLeftBorderSpace = m_pFnt->GetLeftBorderSpace();
668 if ( GetTextFrame()->IsRightToLeft() )
669 {
670 aFontPos.AdjustX( -nLeftBorderSpace );
671 }
672 else
673 {
674 switch( m_pFnt->GetOrientation(GetTextFrame()->IsVertical()).get() )
675 {
676 case 0 :
677 aFontPos.AdjustX(nLeftBorderSpace );
678 break;
679 case 900 :
680 aFontPos.AdjustY( -nLeftBorderSpace );
681 break;
682 case 1800 :
683 aFontPos.AdjustX( -nLeftBorderSpace );
684 break;
685 case 2700 :
686 aFontPos.AdjustY(nLeftBorderSpace );
687 break;
688 }
689 }
690 if( aFontPos.X() < 0 )
691 aFontPos.setX( 0 );
692 if( aFontPos.Y() < 0 )
693 aFontPos.setY( 0 );
694 }
695
696 // Handle semi-transparent text if necessary.
697 std::unique_ptr<SwTransparentTextGuard, o3tl::default_delete<SwTransparentTextGuard>> pTransparentText;
699 {
700 // if drawing to a backend that supports transparency for text color, then we don't need to use this
701 if (!m_bOnWin || !m_pOut->SupportsOperation(OutDevSupportType::TransparentText) || m_pOut->GetConnectMetaFile())
702 pTransparentText.reset(new SwTransparentTextGuard(rPor, *this, aDrawInf));
703 }
704
705 if( GetTextFly().IsOn() )
706 {
707 // aPos needs to be the TopLeft, because we cannot calculate the
708 // ClipRects otherwise
709 const Point aPoint( aFontPos.X(), aFontPos.Y() - rPor.GetAscent() );
710 const Size aSize( rPor.Width(), rPor.Height() );
711 aDrawInf.SetPos( aPoint );
712 aDrawInf.SetSize( aSize );
713 aDrawInf.SetAscent( rPor.GetAscent() );
714 aDrawInf.SetKern( bKern ? rPor.Width() : 0 );
715 aDrawInf.SetWrong( bTmpWrong ? m_pWrongList : nullptr );
716 aDrawInf.SetGrammarCheck( bTmpGrammarCheck ? m_pGrammarCheckList : nullptr );
717 aDrawInf.SetSmartTags( bTmpSmart ? m_pSmartTags : nullptr );
718 GetTextFly().DrawTextOpaque( aDrawInf );
719 }
720 else
721 {
722 aDrawInf.SetPos( aFontPos );
723 if( bKern )
724 m_pFnt->DrawStretchText_( aDrawInf );
725 else
726 {
727 aDrawInf.SetWrong( bTmpWrong ? m_pWrongList : nullptr );
728 aDrawInf.SetGrammarCheck( bTmpGrammarCheck ? m_pGrammarCheckList : nullptr );
729 aDrawInf.SetSmartTags( bTmpSmart ? m_pSmartTags : nullptr );
730 m_pFnt->DrawText_( aDrawInf );
731 }
732 }
733}
734
736 SwRect* pRect, SwRect* pIntersect,
737 const bool bInsideBox ) const
738{
739 Size aSize( rPor.Width(), rPor.Height() );
740 if( rPor.IsHangingPortion() )
741 aSize.setWidth( static_cast<const SwHangingPortion&>(rPor).GetInnerWidth() );
742 if( rPor.InSpaceGrp() && GetSpaceAdd() )
743 {
744 SwTwips nAdd = rPor.CalcSpacing( GetSpaceAdd(), *this );
745 if( rPor.InFieldGrp() && GetSpaceAdd() < 0 && nAdd )
747 aSize.AdjustWidth(nAdd );
748 }
749
750 Point aPoint;
751
752 if( IsRotated() )
753 {
754 tools::Long nTmp = aSize.Width();
755 aSize.setWidth( aSize.Height() );
756 aSize.setHeight( nTmp );
757 if ( 1 == GetDirection() )
758 {
759 aPoint.setX( X() - rPor.GetAscent() );
760 aPoint.setY( Y() - aSize.Height() );
761 }
762 else
763 {
764 aPoint.setX( X() - rPor.Height() + rPor.GetAscent() );
765 aPoint.setY( Y() );
766 }
767 }
768 else
769 {
770 aPoint.setX( X() );
771 if (GetTextFrame()->IsVertLR() && !GetTextFrame()->IsVertLRBT())
772 aPoint.setY( Y() - rPor.Height() + rPor.GetAscent() );
773 else
774 aPoint.setY( Y() - rPor.GetAscent() );
775 }
776
777 // Adjust x coordinate if we are inside a bidi portion
778 const bool bFrameDir = GetTextFrame()->IsRightToLeft();
779 const bool bCounterDir = ( !bFrameDir && DIR_RIGHT2LEFT == GetDirection() ) ||
780 ( bFrameDir && DIR_LEFT2RIGHT == GetDirection() );
781
782 if ( bCounterDir )
783 aPoint.AdjustX( -(aSize.Width()) );
784
785 SwRect aRect( aPoint, aSize );
786
787 if ( GetTextFrame()->IsRightToLeft() )
788 GetTextFrame()->SwitchLTRtoRTL( aRect );
789
790 if ( GetTextFrame()->IsVertical() )
792
793 if( bInsideBox && rPor.InTextGrp() )
794 {
795 const bool bJoinWithPrev =
796 static_cast<const SwTextPortion&>(rPor).GetJoinBorderWithPrev();
797 const bool bJoinWithNext =
798 static_cast<const SwTextPortion&>(rPor).GetJoinBorderWithNext();
799 const bool bIsVert = GetTextFrame()->IsVertical();
800 const bool bIsVertLRBT = GetTextFrame()->IsVertLRBT();
801 aRect.AddTop( GetFont()->CalcShadowSpace(SvxShadowItemSide::TOP, bIsVert, bIsVertLRBT,
802 bJoinWithPrev, bJoinWithNext));
803 aRect.AddBottom( - GetFont()->CalcShadowSpace(SvxShadowItemSide::BOTTOM, bIsVert, bIsVertLRBT,
804 bJoinWithPrev, bJoinWithNext));
805 aRect.AddLeft( GetFont()->CalcShadowSpace(SvxShadowItemSide::LEFT, bIsVert, bIsVertLRBT,
806 bJoinWithPrev, bJoinWithNext));
807 aRect.AddRight( - GetFont()->CalcShadowSpace(SvxShadowItemSide::RIGHT, bIsVert, bIsVertLRBT,
808 bJoinWithPrev, bJoinWithNext));
809 }
810
811 if ( pRect )
812 *pRect = aRect;
813
814 if( aRect.HasArea() && pIntersect )
815 {
816 ::SwAlignRect( aRect, GetVsh(), GetOut() );
817
818 if ( GetOut()->IsClipRegion() )
819 {
820 SwRect aClip( GetOut()->GetClipRegion().GetBoundRect() );
821 aRect.Intersection( aClip );
822 }
823
824 *pIntersect = aRect;
825 }
826}
827
838static void lcl_DrawSpecial( const SwTextPaintInfo& rTextPaintInfo, const SwLinePortion& rPor,
839 SwRect& rRect, const Color& rCol, sal_Unicode cChar,
840 sal_uInt8 nOptions )
841{
842 bool bCenter = 0 != ( nOptions & DRAW_SPECIAL_OPTIONS_CENTER );
843 bool bRotate = 0 != ( nOptions & DRAW_SPECIAL_OPTIONS_ROTATE );
844
845 // rRect is given in absolute coordinates
846 if ( rTextPaintInfo.GetTextFrame()->IsRightToLeft() )
847 rTextPaintInfo.GetTextFrame()->SwitchRTLtoLTR( rRect );
848 if ( rTextPaintInfo.GetTextFrame()->IsVertical() )
849 rTextPaintInfo.GetTextFrame()->SwitchVerticalToHorizontal( rRect );
850
851 const SwFont* pOldFnt = rTextPaintInfo.GetFont();
852
853 // Font is generated only once:
854 static SwFont s_aFnt = [&]()
855 {
856 SwFont tmp( *pOldFnt );
857 tmp.SetFamily( FAMILY_DONTKNOW, tmp.GetActual() );
859 tmp.SetStyleName(OUString(), tmp.GetActual());
860 tmp.SetCharSet( RTL_TEXTENCODING_SYMBOL, tmp.GetActual() );
861 return tmp;
862 }();
863
864 // Some of the current values are set at the font:
865 if ( ! bRotate )
866 s_aFnt.SetVertical( 0_deg10, rTextPaintInfo.GetTextFrame()->IsVertical() );
867 else
868 s_aFnt.SetVertical( pOldFnt->GetOrientation() );
869
870 s_aFnt.SetColor(rCol);
871
872 Size aFontSize( 0, SPECIAL_FONT_HEIGHT );
873 s_aFnt.SetSize( aFontSize, s_aFnt.GetActual() );
874
875 SwTextPaintInfo& rNonConstTextPaintInfo = const_cast<SwTextPaintInfo&>(rTextPaintInfo);
876
877 rNonConstTextPaintInfo.SetFont( &s_aFnt );
878
879 // The maximum width depends on the current orientation
880 const Degree10 nDir = s_aFnt.GetOrientation( rTextPaintInfo.GetTextFrame()->IsVertical() );
881 SwTwips nMaxWidth;
882 if (nDir == 900_deg10 || nDir == 2700_deg10)
883 nMaxWidth = rRect.Height();
884 else
885 {
886 assert(nDir == 0_deg10); //Unknown direction set at font
887 nMaxWidth = rRect.Width();
888 }
889
890 // check if char fits into rectangle
891 const OUString aTmp( cChar );
892 aFontSize = rTextPaintInfo.GetTextSize( aTmp ).SvLSize();
893 while ( aFontSize.Width() > nMaxWidth )
894 {
895 SwTwips nFactor = ( 100 * aFontSize.Width() ) / nMaxWidth;
896 const SwTwips nOldWidth = aFontSize.Width();
897
898 // new height for font
899 const SwFontScript nAct = s_aFnt.GetActual();
900 aFontSize.setHeight( ( 100 * s_aFnt.GetSize( nAct ).Height() ) / nFactor );
901 aFontSize.setWidth( ( 100 * s_aFnt.GetSize( nAct).Width() ) / nFactor );
902
903 if ( !aFontSize.Width() && !aFontSize.Height() )
904 break;
905
906 s_aFnt.SetSize( aFontSize, nAct );
907
908 aFontSize = rTextPaintInfo.GetTextSize( aTmp ).SvLSize();
909
910 if ( aFontSize.Width() >= nOldWidth )
911 break;
912 }
913
914 const Point aOldPos( rTextPaintInfo.GetPos() );
915
916 // adjust values so that tab is vertically and horizontally centered
917 SwTwips nX = rRect.Left();
918 SwTwips nY = rRect.Top();
919 switch ( nDir.get() )
920 {
921 case 0 :
922 if ( bCenter )
923 nX += ( rRect.Width() - aFontSize.Width() ) / 2;
924 nY += ( rRect.Height() - aFontSize.Height() ) / 2 + rTextPaintInfo.GetAscent();
925 break;
926 case 900 :
927 if ( bCenter )
928 nX += ( rRect.Width() - aFontSize.Height() ) / 2 + rTextPaintInfo.GetAscent();
929 nY += ( rRect.Height() + aFontSize.Width() ) / 2;
930 break;
931 case 2700 :
932 if ( bCenter )
933 nX += ( rRect.Width() + aFontSize.Height() ) / 2 - rTextPaintInfo.GetAscent();
934 nY += ( rRect.Height() - aFontSize.Width() ) / 2;
935 break;
936 }
937
938 Point aTmpPos( nX, nY );
939 rNonConstTextPaintInfo.SetPos( aTmpPos );
940 sal_uInt16 nOldWidth = rPor.Width();
941 const_cast<SwLinePortion&>(rPor).Width( o3tl::narrowing<sal_uInt16>(aFontSize.Width()) );
942 rTextPaintInfo.DrawText( aTmp, rPor );
943 const_cast<SwLinePortion&>(rPor).Width( nOldWidth );
944 rNonConstTextPaintInfo.SetFont( const_cast<SwFont*>(pOldFnt) );
945 rNonConstTextPaintInfo.SetPos( aOldPos );
946}
947
948void SwTextPaintInfo::DrawRect( const SwRect &rRect, bool bRetouche ) const
949{
950 if ( OnWin() || !bRetouche )
951 {
952 if( m_aTextFly.IsOn() )
953 const_cast<SwTextPaintInfo*>(this)->GetTextFly().
954 DrawFlyRect( m_pOut, rRect );
955 else
956 m_pOut->DrawRect( rRect.SVRect() );
957 }
958}
959
961{
962 if( !OnWin() )
963 return;
964
965 SwRect aRect;
966 CalcRect( rPor, &aRect );
967
968 if ( ! aRect.HasArea() )
969 return;
970
973
974 lcl_DrawSpecial( *this, rPor, aRect, NON_PRINTING_CHARACTER_COLOR, cChar, nOptions );
975}
976
978{
979 if( !OnWin() )
980 return;
981
983 if (rPor.IsBreakPortion())
984 {
985 const auto& rBreakPortion = static_cast<const SwBreakPortion&>(rPor);
986 eClear = rBreakPortion.GetClear();
987 }
988
989 sal_uInt16 nOldWidth = rPor.Width();
990 const_cast<SwLinePortion&>(rPor).Width( LINE_BREAK_WIDTH );
991
992 SwRect aRect;
993 CalcRect( rPor, &aRect );
994
995 if( aRect.HasArea() )
996 {
997 const sal_Unicode cChar = GetTextFrame()->IsRightToLeft() ?
999 const sal_uInt8 nOptions = 0;
1000
1001 SwRect aTextRect(aRect);
1002 if (eClear == SwLineBreakClear::LEFT || eClear == SwLineBreakClear::ALL)
1003 aTextRect.AddLeft(30);
1004 if (eClear == SwLineBreakClear::RIGHT || eClear == SwLineBreakClear::ALL)
1005 aTextRect.AddRight(-30);
1006 lcl_DrawSpecial( *this, rPor, aTextRect, NON_PRINTING_CHARACTER_COLOR, cChar, nOptions );
1007
1008 if (eClear != SwLineBreakClear::NONE)
1009 {
1010 // Paint indicator if this clear is left/right/all.
1012 m_pOut->SetLineColor(NON_PRINTING_CHARACTER_COLOR);
1013 if (eClear != SwLineBreakClear::RIGHT)
1014 m_pOut->DrawLine(aRect.BottomLeft(), aRect.TopLeft());
1015 if (eClear != SwLineBreakClear::LEFT)
1016 m_pOut->DrawLine(aRect.BottomRight(), aRect.TopRight());
1017 m_pOut->Pop();
1018 }
1019 }
1020
1021 const_cast<SwLinePortion&>(rPor).Width( nOldWidth );
1022}
1023
1025{
1027 SwRect aRect( static_cast<const SwArrowPortion&>(rPor).GetPos(), aSize );
1028 sal_Unicode cChar;
1029 if( static_cast<const SwArrowPortion&>(rPor).IsLeft() )
1030 {
1031 aRect.Pos().AdjustY(20 - GetAscent() );
1032 aRect.Pos().AdjustX(20 );
1033 if( aSize.Height() > rPor.Height() )
1034 aRect.Height( rPor.Height() );
1035 cChar = CHAR_LEFT_ARROW;
1036 }
1037 else
1038 {
1039 if( aSize.Height() > rPor.Height() )
1040 aRect.Height( rPor.Height() );
1041 aRect.Pos().AdjustY( -(aRect.Height() + 20) );
1042 aRect.Pos().AdjustX( -(aRect.Width() + 20) );
1043 cChar = CHAR_RIGHT_ARROW;
1044 }
1045
1046 if ( GetTextFrame()->IsVertical() )
1048
1049 if( aRect.HasArea() )
1050 {
1051 const sal_uInt8 nOptions = 0;
1052 lcl_DrawSpecial( *this, rPor, aRect, COL_LIGHTRED, cChar, nOptions );
1053 }
1054}
1055
1056void SwTextPaintInfo::DrawPostIts( bool bScript ) const
1057{
1058 if( !OnWin() || !m_pOpt->IsPostIts() )
1059 return;
1060
1061 Size aSize;
1062 Point aTmp;
1063
1064 const sal_uInt16 nPostItsWidth = SwViewOption::GetPostItsWidth( GetOut() );
1065 const sal_uInt16 nFontHeight = m_pFnt->GetHeight( m_pVsh, *GetOut() );
1066 const sal_uInt16 nFontAscent = m_pFnt->GetAscent( m_pVsh, *GetOut() );
1067
1068 switch ( m_pFnt->GetOrientation( GetTextFrame()->IsVertical() ).get() )
1069 {
1070 case 0 :
1071 aSize.setWidth( nPostItsWidth );
1072 aSize.setHeight( nFontHeight );
1073 aTmp.setX( m_aPos.X() );
1074 aTmp.setY( m_aPos.Y() - nFontAscent );
1075 break;
1076 case 900 :
1077 aSize.setHeight( nPostItsWidth );
1078 aSize.setWidth( nFontHeight );
1079 aTmp.setX( m_aPos.X() - nFontAscent );
1080 aTmp.setY( m_aPos.Y() );
1081 break;
1082 case 2700 :
1083 aSize.setHeight( nPostItsWidth );
1084 aSize.setWidth( nFontHeight );
1085 aTmp.setX( m_aPos.X() - nFontHeight +
1086 nFontAscent );
1087 aTmp.setY( m_aPos.Y() );
1088 break;
1089 }
1090
1091 SwRect aTmpRect( aTmp, aSize );
1092
1093 if ( GetTextFrame()->IsRightToLeft() )
1094 GetTextFrame()->SwitchLTRtoRTL( aTmpRect );
1095
1096 if ( GetTextFrame()->IsVertical() )
1098
1099 GetOpt().PaintPostIts( const_cast<OutputDevice*>(GetOut()), aTmpRect, bScript );
1100
1101}
1102
1103void SwTextPaintInfo::DrawCheckBox(const SwFieldFormCheckboxPortion &rPor, bool bChecked) const
1104{
1105 SwRect aIntersect;
1106 CalcRect( rPor, &aIntersect );
1107 if ( !aIntersect.HasArea() )
1108 return;
1109
1110 if (OnWin() && GetOpt().IsFieldShadings() &&
1111 !GetOpt().IsPagePreview())
1112 {
1113 OutputDevice* pOut = const_cast<OutputDevice*>(GetOut());
1115 pOut->SetFillColor( GetOpt().GetFieldShadingsColor() );
1116 pOut->SetLineColor();
1117 pOut->DrawRect( aIntersect.SVRect() );
1118 pOut->Pop();
1119 }
1120 const int delta=10;
1121 tools::Rectangle r(aIntersect.Left()+delta, aIntersect.Top()+delta, aIntersect.Right()-delta, aIntersect.Bottom()-delta);
1123 m_pOut->SetLineColor( Color(0, 0, 0));
1124 m_pOut->SetFillColor();
1125 m_pOut->DrawRect( r );
1126 if (bChecked)
1127 {
1128 m_pOut->DrawLine(r.TopLeft(), r.BottomRight());
1129 m_pOut->DrawLine(r.TopRight(), r.BottomLeft());
1130 }
1131 m_pOut->Pop();
1132}
1133
1134void SwTextPaintInfo::DrawBackground( const SwLinePortion &rPor, const Color *pColor ) const
1135{
1136 OSL_ENSURE( OnWin(), "SwTextPaintInfo::DrawBackground: printer pollution ?" );
1137
1138 SwRect aIntersect;
1139 CalcRect( rPor, nullptr, &aIntersect, true );
1140
1141 if ( !aIntersect.HasArea() )
1142 return;
1143
1144 OutputDevice* pOut = const_cast<OutputDevice*>(GetOut());
1146
1147 if ( pColor )
1148 pOut->SetFillColor( *pColor );
1149 else
1150 pOut->SetFillColor( GetOpt().GetFieldShadingsColor() );
1151
1152 pOut->SetLineColor();
1153
1154 DrawRect( aIntersect, true );
1155 pOut->Pop();
1156}
1157
1159{
1160 {
1161 SwRect aIntersect;
1162 CalcRect( rPor, &aIntersect, nullptr, true );
1163 if(aIntersect.HasArea())
1164 {
1165 SwPosition const aPosition(m_pFrame->MapViewToModelPos(GetIdx()));
1166 const ::sw::mark::IMark* pFieldmark =
1168 bool bIsStartMark = (TextFrameIndex(1) == GetLen()
1169 && CH_TXT_ATR_FIELDSTART == GetText()[sal_Int32(GetIdx())]);
1170 if(pFieldmark) {
1171 SAL_INFO("sw.core", "Found Fieldmark " << pFieldmark->ToString());
1172 }
1173 if(bIsStartMark)
1174 SAL_INFO("sw.core", "Found StartMark");
1175 if (OnWin() && (pFieldmark!=nullptr || bIsStartMark) &&
1176 GetOpt().IsFieldShadings() &&
1177 !GetOpt().IsPagePreview())
1178 {
1179 OutputDevice* pOutDev = const_cast<OutputDevice*>(GetOut());
1182 pOutDev->SetLineColor( );
1183 pOutDev->DrawRect( aIntersect.SVRect() );
1184 pOutDev->Pop();
1185 }
1186 }
1187 }
1188
1189 SwRect aIntersect;
1190 CalcRect( rPor, nullptr, &aIntersect, true );
1191
1192 if ( !aIntersect.HasArea() )
1193 return;
1194
1195 OutputDevice* pTmpOut = const_cast<OutputDevice*>(GetOut());
1196
1197 // #i16816# tagged pdf support
1198 SwTaggedPDFHelper aTaggedPDFHelper( nullptr, nullptr, nullptr, *pTmpOut );
1199
1200 Color aFillColor;
1201
1203 {
1204 aFillColor = m_pFnt->GetHighlightColor();
1205 }
1206 else
1207 {
1208 if( !m_pFnt->GetBackColor() )
1209 return;
1210 aFillColor = *m_pFnt->GetBackColor();
1211 }
1212
1213 // tdf#104349 do not highlight portions of space chars before end of line if the compatibility option is enabled
1214 // for LTR mode only
1215 if ( !GetTextFrame()->IsRightToLeft() )
1216 {
1217 if (GetTextFrame()->GetDoc().getIDocumentSettingAccess().get(DocumentSettingId::MS_WORD_COMP_TRAILING_BLANKS))
1218 {
1219 bool draw = false;
1220 bool full = false;
1221 const sal_Int32 nMaxLen = GetText().getLength();
1222 const sal_Int32 nCurrPorEnd(GetIdx() + rPor.GetLen());
1223 const SwLinePortion* pPos = &rPor;
1224 TextFrameIndex nIdx = GetIdx();
1225
1226 do
1227 {
1228 const sal_Int32 nEndPos = std::min(sal_Int32(nIdx + pPos->GetLen()), nMaxLen);
1229 for (sal_Int32 i = sal_Int32(nIdx); i < nEndPos; ++i)
1230 {
1231 if (i < nMaxLen && i >= nCurrPorEnd && GetText()[i] == CH_TXTATR_NEWLINE)
1232 goto drawcontinue;
1233
1234 if (i == nMaxLen || GetText()[i] != CH_BLANK)
1235 {
1236 draw = true;
1237 if (i >= nCurrPorEnd)
1238 {
1239 full = true;
1240 goto drawcontinue;
1241 }
1242 }
1243 }
1244 nIdx += pPos->GetLen();
1245 pPos = pPos->GetNextPortion();
1246 } while ( pPos );
1247
1248 drawcontinue:
1249
1250 if ( !draw )
1251 return;
1252
1253 if ( !full )
1254 {
1255 const sal_Int32 nLastPos = std::min(nCurrPorEnd, nMaxLen) - 1;
1256 for (sal_Int32 i = nLastPos; TextFrameIndex(i) >= GetIdx(); --i)
1257 {
1258 if (GetText()[i] == CH_TXTATR_NEWLINE)
1259 continue;
1260
1261 if (GetText()[i] != CH_BLANK)
1262 {
1263 const sal_uInt16 nOldWidth = rPor.Width();
1264 const sal_uInt16 nExcessWidth
1265 = GetTextSize(m_pOut, nullptr, GetText(), TextFrameIndex(i + 1),
1266 TextFrameIndex(nLastPos - i)).Width();
1267 const_cast<SwLinePortion&>(rPor).Width(nOldWidth - nExcessWidth);
1268 CalcRect( rPor, nullptr, &aIntersect, true );
1269 const_cast<SwLinePortion&>(rPor).Width( nOldWidth );
1270
1271 if ( !aIntersect.HasArea() )
1272 return;
1273
1274 break;
1275 }
1276 }
1277 }
1278 }
1279 }
1280
1282
1283 pTmpOut->SetFillColor(aFillColor);
1284 pTmpOut->SetLineColor();
1285
1286 DrawRect( aIntersect, false );
1287
1288 pTmpOut->Pop();
1289}
1290
1292{
1293 SwRect aDrawArea;
1294 CalcRect( rPor, &aDrawArea );
1295 if ( aDrawArea.HasArea() )
1296 {
1297 PaintCharacterBorder(*m_pFnt, aDrawArea, GetTextFrame()->IsVertical(),
1298 GetTextFrame()->IsVertLRBT(), rPor.GetJoinBorderWithPrev(),
1299 rPor.GetJoinBorderWithNext());
1300 }
1301}
1302
1303namespace {
1304
1305bool HasValidPropertyValue(const uno::Any& rAny)
1306{
1307 if (bool bValue; rAny >>= bValue)
1308 {
1309 return true;
1310 }
1311 else if (OUString aValue; (rAny >>= aValue) && !(aValue.isEmpty()))
1312 {
1313 return true;
1314 }
1315 else if (awt::FontSlant eValue; rAny >>= eValue)
1316 {
1317 return true;
1318 }
1319 else if (tools::Long nValueLong; rAny >>= nValueLong)
1320 {
1321 return true;
1322 }
1323 else if (double fValue; rAny >>= fValue)
1324 {
1325 return true;
1326 }
1327 else if (short nValueShort; rAny >>= nValueShort)
1328 {
1329 return true;
1330 }
1331 else
1332 return false;
1333}
1334}
1335
1337{
1338 // Don't use GetActiveView() as it does not work as expected when there are multiple open
1339 // documents.
1340 SwView* pView = SwTextFrame::GetView();
1341 if (!pView)
1342 return;
1343
1344 StylesHighlighterColorMap& rCharStylesColorMap = pView->GetStylesHighlighterCharColorMap();
1345
1346 if (rCharStylesColorMap.empty() && !pView->IsHighlightCharDF())
1347 return;
1348
1349 SwRect aRect;
1350 CalcRect(rPor, &aRect, nullptr, true);
1351 if(!aRect.HasArea())
1352 return;
1353
1354 SwTextFrame* pFrame = const_cast<SwTextFrame*>(GetTextFrame());
1355 if (!pFrame)
1356 return;
1357
1358 SwPosition aPosition(pFrame->MapViewToModelPos(GetIdx()));
1359 SwPosition aMarkPosition(pFrame->MapViewToModelPos(GetIdx() + GetLen()));
1360
1361 uno::Reference<text::XTextRange> xRange(
1362 SwXTextRange::CreateXTextRange(pFrame->GetDoc(), aPosition, &aMarkPosition));
1363 uno::Reference<beans::XPropertySet> xPropertiesSet(xRange, uno::UNO_QUERY_THROW);
1364
1365 OUString sCurrentCharStyle;
1366 xPropertiesSet->getPropertyValue("CharStyleName") >>= sCurrentCharStyle;
1367
1368 std::optional<OUString> sCSNumberOrDF; // CS number or "df" or not used
1369 std::optional<Color> aFillColor;
1370
1371 // check for CS formatting, if not CS formatted check for direct character formatting
1372 if (!sCurrentCharStyle.isEmpty())
1373 {
1374 if (!rCharStylesColorMap.empty())
1375 {
1376 OUString sCharStyleDisplayName;
1377 sCharStyleDisplayName = SwStyleNameMapper::GetUIName(sCurrentCharStyle,
1379 if (!sCharStyleDisplayName.isEmpty()
1380 && rCharStylesColorMap.find(sCharStyleDisplayName)
1381 != rCharStylesColorMap.end())
1382 {
1383 aFillColor = rCharStylesColorMap[sCharStyleDisplayName].first;
1384 sCSNumberOrDF = OUString::number(rCharStylesColorMap[sCharStyleDisplayName].second);
1385 }
1386 }
1387 }
1388 // not character style formatted
1389 else if (pView->IsHighlightCharDF())
1390 {
1391 const std::vector<OUString> aHiddenProperties{ UNO_NAME_RSID,
1405
1406 SfxItemPropertySet const& rPropSet(
1408 SfxItemPropertyMap const& rMap(rPropSet.getPropertyMap());
1409
1410
1411 uno::Reference<beans::XPropertyState> xPropertiesState(xRange, uno::UNO_QUERY_THROW);
1412 const uno::Sequence<beans::Property> aProperties
1413 = xPropertiesSet->getPropertySetInfo()->getProperties();
1414
1415 for (const beans::Property& rProperty : aProperties)
1416 {
1417 const OUString& rPropName = rProperty.Name;
1418
1419 if (!rMap.hasPropertyByName(rPropName))
1420 continue;
1421
1422 if (std::find(aHiddenProperties.begin(), aHiddenProperties.end(), rPropName)
1423 != aHiddenProperties.end())
1424 continue;
1425
1426 if (xPropertiesState->getPropertyState(rPropName) == beans::PropertyState_DIRECT_VALUE)
1427 {
1428 const uno::Any aAny = xPropertiesSet->getPropertyValue(rPropName);
1429 if (HasValidPropertyValue(aAny))
1430 {
1431 sCSNumberOrDF = SwResId(STR_CHARACTER_DIRECT_FORMATTING_TAG);
1432 aFillColor = COL_LIGHTGRAY;
1433 break;
1434 }
1435 }
1436 }
1437 }
1438 if (sCSNumberOrDF)
1439 {
1440 OutputDevice* pTmpOut = const_cast<OutputDevice*>(GetOut());
1443
1444 // draw a filled rectangle at the formatted CS or DF text
1445 pTmpOut->SetFillColor(aFillColor.value());
1446 pTmpOut->SetLineColor(aFillColor.value());
1447 tools::Rectangle aSVRect(aRect.SVRect());
1448 pTmpOut->DrawRect(aSVRect);
1449
1450 // calculate size and position for the CS number or "df" text and rectangle
1451 tools::Long nWidth = pTmpOut->GetTextWidth(sCSNumberOrDF.value());
1452 tools::Long nHeight = pTmpOut->GetTextHeight();
1453 aSVRect.SetSize(Size(nWidth, nHeight));
1454 aSVRect.Move(-(nWidth / 1.5), -(nHeight / 1.5));
1455
1456 vcl::Font aFont(pTmpOut->GetFont());
1457 aFont.SetOrientation(Degree10(0));
1458 pTmpOut->SetFont(aFont);
1459
1461 //pTmpOut->SetLayoutMode(vcl::text::ComplexTextLayoutFlags::BiDiStrong);
1462
1463 pTmpOut->SetTextFillColor(aFillColor.value());
1464 pTmpOut->DrawText(aSVRect, sCSNumberOrDF.value(), DrawTextFlags::NONE);
1465
1466 pTmpOut->Pop();
1467 }
1468}
1469
1471 PortionType nWhich, const Color *pColor ) const
1472{
1473 if( !OnWin() || IsMulti() )
1474 return;
1475
1476 bool bDraw = false;
1477 switch( nWhich )
1478 {
1482 case PortionType::Field:
1484 case PortionType::Tox:
1485 case PortionType::Ref:
1486 case PortionType::Meta:
1489 if ( !GetOpt().IsPagePreview()
1490 && !GetOpt().IsReadonly()
1491 && GetOpt().IsFieldShadings()
1492 && ( PortionType::Number != nWhich
1493 || m_pFrame->GetTextNodeForParaProps()->HasMarkedLabel())) // #i27615#
1494 {
1495 bDraw = PortionType::Footnote != nWhich || m_pFrame->IsFootnoteAllowed();
1496 }
1497 break;
1499 // no shading
1500 break;
1502 // input field shading also in read-only mode
1503 if ( !GetOpt().IsPagePreview()
1504 && GetOpt().IsFieldShadings() )
1505 {
1506 bDraw = true;
1507 }
1508 break;
1509 case PortionType::Tab:
1510 if ( GetOpt().IsTab() ) bDraw = true;
1511 break;
1513 if ( GetOpt().IsSoftHyph() )bDraw = true;
1514 break;
1515 case PortionType::Blank:
1516 if ( GetOpt().IsHardBlank())bDraw = true;
1517 break;
1518 default:
1519 {
1520 OSL_ENSURE( false, "SwTextPaintInfo::DrawViewOpt: don't know how to draw this" );
1521 break;
1522 }
1523 }
1524 if ( bDraw )
1525 DrawBackground( rPor, pColor );
1526}
1527
1529 sal_Int16 nMinLeading, sal_Int16 nMinTrailing,
1530 bool bNoCapsHyphenation, bool bNoLastWordHyphenation,
1531 sal_Int16 nMinWordLength, sal_Int16 nTextHyphZone )
1532{
1533 sal_Int32 nLen = rVals.getLength();
1534
1535 if (0 == nLen) // yet to be initialized?
1536 {
1537 rVals.realloc( 6 );
1538 PropertyValue *pVal = rVals.getArray();
1539
1540 pVal[0].Name = UPN_HYPH_MIN_LEADING;
1541 pVal[0].Handle = UPH_HYPH_MIN_LEADING;
1542 pVal[0].Value <<= nMinLeading;
1543
1544 pVal[1].Name = UPN_HYPH_MIN_TRAILING;
1545 pVal[1].Handle = UPH_HYPH_MIN_TRAILING;
1546 pVal[1].Value <<= nMinTrailing;
1547
1548 pVal[2].Name = UPN_HYPH_NO_CAPS;
1549 pVal[2].Handle = UPH_HYPH_NO_CAPS;
1550 pVal[2].Value <<= bNoCapsHyphenation;
1551
1552 pVal[3].Name = UPN_HYPH_NO_LAST_WORD;
1553 pVal[3].Handle = UPH_HYPH_NO_LAST_WORD;
1554 pVal[3].Value <<= bNoLastWordHyphenation;
1555
1556 pVal[4].Name = UPN_HYPH_MIN_WORD_LENGTH;
1557 pVal[4].Handle = UPH_HYPH_MIN_WORD_LENGTH;
1558 pVal[4].Value <<= nMinWordLength;
1559
1560 pVal[5].Name = UPN_HYPH_ZONE;
1561 pVal[5].Handle = UPH_HYPH_ZONE;
1562 pVal[5].Value <<= nTextHyphZone;
1563 }
1564 else if (6 == nLen) // already initialized once?
1565 {
1566 PropertyValue *pVal = rVals.getArray();
1567 pVal[0].Value <<= nMinLeading;
1568 pVal[1].Value <<= nMinTrailing;
1569 pVal[2].Value <<= bNoCapsHyphenation;
1570 pVal[3].Value <<= bNoLastWordHyphenation;
1571 pVal[4].Value <<= nMinWordLength;
1572 pVal[5].Value <<= nTextHyphZone;
1573 }
1574 else {
1575 OSL_FAIL( "unexpected size of sequence" );
1576 }
1577}
1578
1580{
1581 OSL_ENSURE( 6 == m_aHyphVals.getLength(),
1582 "hyphenation values not yet initialized" );
1583 return m_aHyphVals;
1584}
1585
1586bool SwTextFormatInfo::InitHyph( const bool bAutoHyphen )
1587{
1589 SetHanging( rAttrSet.GetHangingPunctuation().GetValue() );
1590 SetScriptSpace( rAttrSet.GetScriptSpace().GetValue() );
1591 SetForbiddenChars( rAttrSet.GetForbiddenRule().GetValue() );
1592 const SvxHyphenZoneItem &rAttr = rAttrSet.GetHyphenZone();
1593 MaxHyph() = rAttr.GetMaxHyphens();
1594 const bool bAuto = bAutoHyphen || rAttr.IsHyphen();
1595 if( bAuto || m_bInterHyph )
1596 {
1597 const sal_Int16 nMinimalLeading = std::max(rAttr.GetMinLead(), sal_uInt8(2));
1598 const sal_Int16 nMinimalTrailing = rAttr.GetMinTrail();
1599 const sal_Int16 nMinimalWordLength = rAttr.GetMinWordLength();
1600 const bool bNoCapsHyphenation = rAttr.IsNoCapsHyphenation();
1601 const bool bNoLastWordHyphenation = rAttr.IsNoLastWordHyphenation();
1602 const sal_Int16 nTextHyphZone = rAttr.GetTextHyphenZone();
1603 lcl_InitHyphValues( m_aHyphVals, nMinimalLeading, nMinimalTrailing,
1604 bNoCapsHyphenation, bNoLastWordHyphenation,
1605 nMinimalWordLength, nTextHyphZone );
1606 }
1607 return bAuto;
1608}
1609
1610void SwTextFormatInfo::CtorInitTextFormatInfo( OutputDevice* pRenderContext, SwTextFrame *pNewFrame, const bool bNewInterHyph,
1611 const bool bNewQuick, const bool bTst )
1612{
1613 CtorInitTextPaintInfo( pRenderContext, pNewFrame, SwRect() );
1614
1615 m_bQuick = bNewQuick;
1616 m_bInterHyph = bNewInterHyph;
1617
1620
1621 m_bIgnoreFly = false;
1622 m_bFakeLineStart = false;
1623 m_bShift = false;
1624 m_bDropInit = false;
1625 m_bTestFormat = bTst;
1626 m_nLeft = 0;
1627 m_nRight = 0;
1628 m_nFirst = 0;
1629 m_nRealWidth = 0;
1631 m_pRest = nullptr;
1632 m_nLineHeight = 0;
1633 m_nLineNetHeight = 0;
1635
1636 SvtCTLOptions::TextNumerals const nTextNumerals(
1638 // cannot cache for NUMERALS_CONTEXT because we need to know the string
1639 // for the whole paragraph now
1640 if (nTextNumerals != SvtCTLOptions::NUMERALS_CONTEXT)
1641 {
1642 // set digit mode to what will be used later to get same results
1643 SwDigitModeModifier const m(*m_pRef, LANGUAGE_NONE /*dummy*/);
1644 assert(m_pRef->GetDigitLanguage() != LANGUAGE_NONE);
1646 }
1647
1648 Init();
1649}
1650
1659{
1660 if( !m_bInterHyph && !m_bAutoHyph )
1661 return false;
1662
1663 LanguageType eTmp = GetFont()->GetLanguage();
1664 // TODO: check for more ideographic langs w/o hyphenation as a concept
1665 if ( LANGUAGE_DONTKNOW == eTmp || LANGUAGE_NONE == eTmp
1666 || !MsLangId::usesHyphenation(eTmp) )
1667 return false;
1668
1669 uno::Reference< XHyphenator > xHyph = ::GetHyphenator();
1670 if (!xHyph.is())
1671 return false;
1672
1673 if (m_bInterHyph)
1674 SvxSpellWrapper::CheckHyphLang( xHyph, eTmp );
1675
1676 if (!xHyph->hasLocale(g_pBreakIt->GetLocale(eTmp)))
1677 {
1679 if (pShell)
1680 {
1681 pShell->AppendInfoBarWhenReady(
1682 "hyphenationmissing", SwResId(STR_HYPH_MISSING),
1683 SwResId(STR_HYPH_MISSING_DETAIL)
1684 .replaceFirst("%1", LanguageTag::convertToBcp47( g_pBreakIt->GetLocale(eTmp))),
1685 InfobarType::WARNING);
1686 }
1687 }
1688
1689 return xHyph->hasLocale( g_pBreakIt->GetLocale(eTmp) );
1690}
1691
1693{
1695 if( 1 >= pDrop->GetLines() ||
1696 ( !pDrop->GetChars() && !pDrop->GetWholeWord() ) )
1697 pDrop = nullptr;
1698 return pDrop;
1699}
1700
1702{
1703 // Not initialized: pRest, nLeft, nRight, nFirst, nRealWidth
1704 X(0);
1707
1708 // generally we do not allow number portions in follows, except...
1709 if ( GetTextFrame()->IsFollow() )
1710 {
1711 const SwTextFrame* pMaster = GetTextFrame()->FindMaster();
1712 OSL_ENSURE(pMaster, "pTextFrame without Master");
1713 const SwLinePortion* pTmpPara = pMaster ? pMaster->GetPara() : nullptr;
1714
1715 // there is a master for this follow and the master does not have
1716 // any contents (especially it does not have a number portion)
1717 m_bNumDone = ! pTmpPara ||
1718 ! static_cast<const SwParaPortion*>(pTmpPara)->GetFirstPortion()->IsFlyPortion();
1719 }
1720
1721 m_pRoot = nullptr;
1722 m_pLast = nullptr;
1723 m_pFly = nullptr;
1724 m_pLastTab = nullptr;
1725 m_pUnderflow = nullptr;
1726 m_cTabDecimal = 0;
1732 m_cHookChar = 0;
1735 SetPaintOfst(0);
1736}
1737
1738SwTextFormatInfo::SwTextFormatInfo(OutputDevice* pRenderContext, SwTextFrame *pFrame, const bool bInterHyphL,
1739 const bool bQuickL, const bool bTst)
1740{
1741 CtorInitTextFormatInfo(pRenderContext, pFrame, bInterHyphL, bQuickL, bTst);
1742}
1743
1753 SwLineLayout& rLay, SwTwips nActWidth ) :
1754 SwTextPaintInfo( rInf ),
1755 m_pRoot(&rLay),
1756 m_pLast(&rLay),
1757 m_pFly(nullptr),
1758 m_pUnderflow(nullptr),
1759 m_pRest(nullptr),
1760 m_pLastTab(nullptr),
1761 m_nSoftHyphPos(TextFrameIndex(0)),
1762 m_nLineStart(rInf.GetIdx()),
1763 m_nUnderScorePos(TextFrameIndex(COMPLETE_STRING)),
1764 m_nLeft(rInf.m_nLeft),
1765 m_nRight(rInf.m_nRight),
1766 m_nFirst(rInf.m_nLeft),
1767 m_nRealWidth(sal_uInt16(nActWidth)),
1768 m_nWidth(m_nRealWidth),
1769 m_nLineHeight(0),
1770 m_nLineNetHeight(0),
1771 m_nForcedLeftMargin(0),
1772 m_bFull(false),
1773 m_bFootnoteDone(true),
1774 m_bErgoDone(true),
1775 m_bNumDone(true),
1776 m_bArrowDone(true),
1777 m_bStop(false),
1778 m_bNewLine(true),
1779 m_bShift(false),
1780 m_bUnderflow(false),
1781 m_bInterHyph(false),
1782 m_bAutoHyph(false),
1783 m_bDropInit(false),
1784 m_bQuick(rInf.m_bQuick),
1785 m_bNoEndHyph(false),
1786 m_bNoMidHyph(false),
1787 m_bIgnoreFly(false),
1788 m_bFakeLineStart(false),
1789 m_bTabOverflow( false ),
1790 m_bTestFormat(rInf.m_bTestFormat),
1791 m_cTabDecimal(0),
1792 m_cHookChar(0),
1793 m_nMaxHyph(0)
1794{
1795 SetMulti( true );
1796 SetFirstMulti( rInf.IsFirstMulti() );
1797}
1798
1800{
1801 const sal_uInt16 nHeight = pCurr->GetRealHeight();
1802 for( SwLinePortion *pPor = pCurr->GetNextPortion(); pPor; pPor = pPor->GetNextPortion() )
1803 {
1804 if( pPor->IsFootnotePortion() && nHeight > static_cast<SwFootnotePortion*>(pPor)->Orig() )
1805 {
1806 SetLineHeight( nHeight );
1807 SetLineNetHeight( pCurr->Height() );
1808 return true;
1809 }
1810 }
1811 return false;
1812}
1813
1815 TextFrameIndex const nEnd)
1816{
1817 m_cHookChar = 0;
1818 TextFrameIndex i = nStart;
1819
1820 // Used for decimal tab handling:
1821 const sal_Unicode cTabDec = GetLastTab() ? GetTabDecimal() : 0;
1822 const sal_Unicode cThousandSep = ',' == cTabDec ? '.' : ',';
1823
1824 // #i45951# German (Switzerland) uses ' as thousand separator
1825 const sal_Unicode cThousandSep2 = ',' == cTabDec ? '.' : '\'';
1826
1827 bool bNumFound = false;
1829
1830 for( ; i < nEnd; ++i )
1831 {
1832 const sal_Unicode cPos = GetChar( i );
1833 switch( cPos )
1834 {
1836 case CH_TXTATR_INWORD:
1837 if( !HasHint( i ))
1838 break;
1839 [[fallthrough]];
1840
1841 case CHAR_SOFTHYPHEN:
1842 case CHAR_HARDHYPHEN:
1843 case CHAR_HARDBLANK:
1844 case CH_TAB:
1845 case CH_BREAK:
1846 case CHAR_ZWSP :
1847 case CHAR_WJ :
1848 m_cHookChar = cPos;
1849 return i;
1850
1851 case CHAR_UNDERSCORE:
1854 break;
1855
1856 default:
1857 if ( cTabDec )
1858 {
1859 if( cTabDec == cPos )
1860 {
1861 OSL_ENSURE( cPos, "Unexpected end of string" );
1862 if( cPos ) // robust
1863 {
1864 m_cHookChar = cPos;
1865 return i;
1866 }
1867 }
1868
1869 // Compatibility: First non-digit character behind a
1870 // a digit character becomes the hook character
1871 if ( bTabCompat )
1872 {
1873 if ( ( 0x2F < cPos && cPos < 0x3A ) ||
1874 ( bNumFound && ( cPos == cThousandSep || cPos == cThousandSep2 ) ) )
1875 {
1876 bNumFound = true;
1877 }
1878 else
1879 {
1880 if ( bNumFound )
1881 {
1882 m_cHookChar = cPos;
1883 SetTabDecimal( cPos );
1884 return i;
1885 }
1886 }
1887 }
1888 }
1889 }
1890 }
1891
1892 // Check if character *behind* the portion has
1893 // to become the hook:
1894 if (i == nEnd && i < TextFrameIndex(GetText().getLength()) && bNumFound)
1895 {
1896 const sal_Unicode cPos = GetChar( i );
1897 if ( cPos != cTabDec && cPos != cThousandSep && cPos !=cThousandSep2 && ( 0x2F >= cPos || cPos >= 0x3A ) )
1898 {
1899 m_cHookChar = GetChar( i );
1901 }
1902 }
1903
1904 return i;
1905}
1906
1908{
1909 if( GetLast() )
1910 {
1911 if( GetLast()->IsKernPortion() )
1912 return true;
1913 if( GetLast()->Width() || ( GetLast()->GetLen() &&
1914 !GetLast()->IsHolePortion() ) )
1915 return false;
1916 }
1917 SwLinePortion* pPor = GetRoot();
1918 SwLinePortion *pKern = nullptr;
1919 while( pPor )
1920 {
1921 if( pPor->IsKernPortion() )
1922 pKern = pPor;
1923 else if( pPor->Width() || ( pPor->GetLen() && !pPor->IsHolePortion() ) )
1924 pKern = nullptr;
1925 pPor = pPor->GetNextPortion();
1926 }
1927 if( pKern )
1928 {
1929 SetLast( pKern );
1930 return true;
1931 }
1932 return false;
1933}
1934
1936{
1937 SwTwips nLineWidth = Width() - X();
1938
1939 const bool bTabOverMargin = GetTextFrame()->GetDoc().getIDocumentSettingAccess().get(
1941 const bool bTabOverSpacing = GetTextFrame()->GetDoc().getIDocumentSettingAccess().get(
1943 if (!bTabOverMargin && !bTabOverSpacing)
1944 return nLineWidth;
1945
1946 SwTabPortion* pLastTab = GetLastTab();
1947 if (!pLastTab)
1948 return nLineWidth;
1949
1950 // Consider tab portions over the printing bounds of the text frame.
1951 if (pLastTab->GetTabPos() <= Width())
1952 return nLineWidth;
1953
1954 // Calculate the width that starts at the left (or in case of first line:
1955 // first) margin, but ends after the right paragraph margin:
1956 //
1957 // +--------------------+
1958 // |LL| |RR|
1959 // +--------------------+
1960 // ^ m_nLeftMargin (absolute)
1961 // ^ nLeftMarginWidth (relative to m_nLeftMargin), X() is relative to this
1962 // ^ right margin
1963 // ^ paragraph right
1964 // <--------------------> is GetTextFrame()->getFrameArea().Width()
1965 // <--------------> is Width()
1966 // <-----------------> is what we need to be able to compare to X() (nTextFrameWidth)
1967 SwTwips nLeftMarginWidth = m_nLeftMargin - GetTextFrame()->getFrameArea().Left();
1968 SwTwips nTextFrameWidth = GetTextFrame()->getFrameArea().Width() - nLeftMarginWidth;
1969
1970 // If there is one such tab portion, then text is allowed to use the full
1971 // text frame area to the right (RR above, but not LL).
1972 nLineWidth = nTextFrameWidth - X();
1973
1974 if (!bTabOverMargin) // thus bTabOverSpacing only
1975 {
1976 // right, center, decimal can back-fill all the available space - same as TabOverMargin
1977 if (pLastTab->GetWhichPor() == PortionType::TabLeft)
1978 nLineWidth = nTextFrameWidth - pLastTab->GetTabPos();
1979 }
1980 return nLineWidth;
1981}
1982
1984 const SwTextSizeInfo *pNew,
1985 const SwLinePortion *pPor,
1986 bool bTextLen,
1987 bool bExgLists,
1988 OUString const & rCh )
1989 : pOldText(nullptr)
1990 , m_pOldSmartTagList(nullptr)
1991 , m_pOldGrammarCheckList(nullptr)
1992 , nIdx(0)
1993 , nLen(0)
1994 , nMeasureLen(0)
1995 , pInf(nullptr)
1996{
1997 if( rCh.isEmpty() )
1998 {
1999 bOn = pPor->GetExpText( *pNew, aText );
2000 }
2001 else
2002 {
2003 aText = rCh;
2004 bOn = true;
2005 }
2006
2007 // The text is replaced ...
2008 if( !bOn )
2009 return;
2010
2011 pInf = const_cast<SwTextSizeInfo*>(pNew);
2012 nIdx = pInf->GetIdx();
2013 nLen = pInf->GetLen();
2015 pOldText = &(pInf->GetText());
2017 pInf->SetText( aText );
2019 pInf->SetLen(bTextLen ? TextFrameIndex(pInf->GetText().getLength()) : pPor->GetLen());
2022
2023 pInf->SetCachedVclData(nullptr);
2024
2025 // ST2
2026 if ( !bExgLists )
2027 return;
2028
2029 m_pOldSmartTagList = static_cast<SwTextPaintInfo*>(pInf)->GetSmartTags();
2031 {
2032 std::pair<SwTextNode const*, sal_Int32> pos(pNew->GetTextFrame()->MapViewToModel(nIdx));
2033 SwWrongList const*const pSmartTags(pos.first->GetSmartTags());
2034 if (pSmartTags)
2035 {
2036 const sal_uInt16 nPos = pSmartTags->GetWrongPos(pos.second);
2037 const sal_Int32 nListPos = pSmartTags->Pos(nPos);
2038 if (nListPos == pos.second && pSmartTags->SubList(nPos) != nullptr)
2039 {
2040 m_pTempIter.reset(new sw::WrongListIterator(*pSmartTags->SubList(nPos)));
2041 static_cast<SwTextPaintInfo*>(pInf)->SetSmartTags(m_pTempIter.get());
2042 }
2043 else if (!m_pTempList && nPos < pSmartTags->Count()
2044 && nListPos < pos.second && !aText.isEmpty())
2045 {
2047 m_pTempList->Insert( OUString(), nullptr, 0, aText.getLength(), 0 );
2049 static_cast<SwTextPaintInfo*>(pInf)->SetSmartTags(m_pTempIter.get());
2050 }
2051 else
2052 static_cast<SwTextPaintInfo*>(pInf)->SetSmartTags(nullptr);
2053 }
2054 else
2055 static_cast<SwTextPaintInfo*>(pInf)->SetSmartTags(nullptr);
2056 }
2057 m_pOldGrammarCheckList = static_cast<SwTextPaintInfo*>(pInf)->GetGrammarCheckList();
2059 return;
2060
2061 std::pair<SwTextNode const*, sal_Int32> pos(pNew->GetTextFrame()->MapViewToModel(nIdx));
2062 SwWrongList const*const pGrammar(pos.first->GetGrammarCheck());
2063 if (pGrammar)
2064 {
2065 const sal_uInt16 nPos = pGrammar->GetWrongPos(pos.second);
2066 const sal_Int32 nListPos = pGrammar->Pos(nPos);
2067 if (nListPos == pos.second && pGrammar->SubList(nPos) != nullptr)
2068 {
2069 m_pTempIter.reset(new sw::WrongListIterator(*pGrammar->SubList(nPos)));
2070 static_cast<SwTextPaintInfo*>(pInf)->SetGrammarCheckList(m_pTempIter.get());
2071 }
2072 else if (!m_pTempList && nPos < pGrammar->Count()
2073 && nListPos < pos.second && !aText.isEmpty())
2074 {
2076 m_pTempList->Insert( OUString(), nullptr, 0, aText.getLength(), 0 );
2078 static_cast<SwTextPaintInfo*>(pInf)->SetGrammarCheckList(m_pTempIter.get());
2079 }
2080 else
2081 static_cast<SwTextPaintInfo*>(pInf)->SetGrammarCheckList(nullptr);
2082 }
2083 else
2084 static_cast<SwTextPaintInfo*>(pInf)->SetGrammarCheckList(nullptr);
2085}
2086
2088{
2089 if( !bOn )
2090 return;
2091
2093 pInf->SetText( *pOldText );
2094 pInf->SetIdx( nIdx );
2095 pInf->SetLen( nLen );
2097
2098 // ST2
2099 // Restore old smart tag list
2101 static_cast<SwTextPaintInfo*>(pInf)->SetSmartTags(m_pOldSmartTagList);
2103 static_cast<SwTextPaintInfo*>(pInf)->SetGrammarCheckList(m_pOldGrammarCheckList);
2104}
2105
2107 SwAttrIter* pItr)
2108 : pInf(nullptr)
2109 , pFnt(pNew ? const_cast<SwTextSizeInfo&>(rInf).GetFont() : nullptr)
2110 , pIter(nullptr)
2111{
2112 if( !pFnt )
2113 return;
2114
2115 pInf = &const_cast<SwTextSizeInfo&>(rInf);
2116 // In these cases we temporarily switch to the new font:
2117 // 1. the fonts have a different magic number
2118 // 2. they have different script types
2119 // 3. their background colors differ (this is not covered by 1.)
2120 if( pFnt->DifferentFontCacheId( pNew, pFnt->GetActual() ) ||
2121 pNew->GetActual() != pFnt->GetActual() ||
2122 ( ! pNew->GetBackColor() && pFnt->GetBackColor() ) ||
2123 ( pNew->GetBackColor() && ! pFnt->GetBackColor() ) ||
2124 ( pNew->GetBackColor() && pFnt->GetBackColor() &&
2125 ( *pNew->GetBackColor() != *pFnt->GetBackColor() ) ) )
2126 {
2127 pNew->SetTransparent( true );
2128 pNew->SetAlign( ALIGN_BASELINE );
2129 pInf->SetFont( pNew );
2130 }
2131 else
2132 pFnt = nullptr;
2133 pNew->Invalidate();
2134 pNew->ChgPhysFnt( pInf->GetVsh(), *pInf->GetOut() );
2135 if( pItr && pItr->GetFnt() == pFnt )
2136 {
2137 pIter = pItr;
2138 pIter->SetFnt( pNew );
2139 }
2140}
2141
2143{
2144 if( pFnt )
2145 {
2146 // Reset SwFont
2147 pFnt->Invalidate();
2148 pInf->SetFont( pFnt );
2149 if( pIter )
2150 {
2151 pIter->SetFnt( pFnt );
2153 }
2154 }
2155}
2156
2157bool SwTextFormatInfo::ChgHyph( const bool bNew )
2158{
2159 const bool bOld = m_bAutoHyph;
2160 if( m_bAutoHyph != bNew )
2161 {
2162 m_bAutoHyph = bNew;
2163 InitHyph( bNew );
2164 // Set language in the Hyphenator
2165 if( m_pFnt )
2167 }
2168 return bOld;
2169}
2170
2171
2173{
2174 if (m_nLastBookmarkPos != GetIdx())
2175 {
2177 return true;
2178 }
2179 else
2180 {
2181 return false;
2182 }
2183}
2184
2185/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_Int32 nLineWidth
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...
PropertiesInfo aProperties
SwBreakIt * g_pBreakIt
Definition: breakit.cxx:34
static OutputDevice * GetDefaultDevice()
bool IsTransparent() const
void SetStyle(css::awt::GradientStyle eStyle)
void SetOfsX(sal_uInt16 nOfsX)
void SetStartIntensity(sal_uInt16 nIntens)
void SetBorder(sal_uInt16 nBorder)
void SetStartColor(const Color &rColor)
void SetSteps(sal_uInt16 nSteps)
void SetOfsY(sal_uInt16 nOfsY)
void SetAngle(Degree10 nAngle)
void SetEndColor(const Color &rColor)
void SetEndIntensity(sal_uInt16 nIntens)
virtual SfxPrinter * getPrinter(bool bCreate) const =0
Return the printer set at the document.
virtual sw::mark::IFieldmark * getInnerFieldmarkFor(const SwPosition &pos) const =0
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
static OUString convertToBcp47(LanguageType nLangID)
static bool usesHyphenation(LanguageType nLang)
const vcl::Font & GetFont() const
void SetFont(const vcl::Font &rNewFont)
void DrawRect(const tools::Rectangle &rRect)
const Point & GetRefPoint() const
void SetLineColor()
tools::Long GetTextWidth(const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, vcl::text::TextLayoutCache const *=nullptr, SalLayoutGlyphs const *const pLayoutCache=nullptr) const
void SetFillColor()
const Color & GetLineColor() const
const MapMode & GetMapMode() const
void SetTextFillColor()
void Push(vcl::PushFlags nFlags=vcl::PushFlags::ALL)
tools::Long GetTextHeight() const
void DrawText(const Point &rStartPt, const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, std::vector< tools::Rectangle > *pVector=nullptr, OUString *pDisplayText=nullptr, const SalLayoutGlyphs *pLayoutCache=nullptr)
void SetLayoutMode(vcl::text::ComplexTextLayoutFlags nTextLayoutMode)
DrawModeFlags GetDrawMode() const
const AllSettings & GetSettings() const
static std::shared_ptr< const vcl::text::TextLayoutCache > CreateTextLayoutCache(OUString const &)
const Color & GetFillColor() const
constexpr tools::Long Y() const
void setX(tools::Long nX)
void setY(tools::Long nY)
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
constexpr tools::Long X() const
bool hasPropertyByName(std::u16string_view rName) const
const SfxItemPropertyMap & getPropertyMap() const
void AppendInfoBarWhenReady(const OUString &sId, const OUString &sPrimaryMessage, const OUString &sSecondaryMessage, InfobarType aInfobarType, bool bShowCloseButton=true)
StylesHighlighterColorMap & GetStylesHighlighterCharColorMap()
constexpr tools::Long Height() const
void setWidth(tools::Long nWidth)
tools::Long AdjustWidth(tools::Long n)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
bool IsSmartTagsEnabled() const
static TextNumerals GetCTLTextNumerals()
css::uno::Any GetProperty(std::u16string_view rPropertyName) const
sal_uInt8 & GetMinLead()
bool IsNoLastWordHyphenation() const
sal_uInt16 & GetTextHyphenZone()
sal_uInt8 & GetMinWordLength()
sal_uInt8 & GetMaxHyphens()
bool IsHyphen() const
bool IsNoCapsHyphenation() const
sal_uInt8 & GetMinTrail()
Align GetValue() const
static sal_Int16 CheckHyphLang(css::uno::Reference< css::linguistic2::XHyphenator >const &xHyph, LanguageType nLang)
Indicator that the content does not fit into a fixed height frame (red triangle on the UI).
Definition: porrst.hxx:116
sal_Int32 m_nPosition
current iteration index in text node
Definition: itratr.hxx:52
void SetFnt(SwFont *pNew)
Definition: itratr.hxx:61
SwFont * GetFnt()
Definition: itratr.hxx:103
const SvxParaVertAlignItem & GetParaVertAlign(bool=true) const
Definition: paratr.hxx:227
const SwFormatDrop & GetDrop(bool=true) const
Definition: paratr.hxx:217
const SvxTabStopItem & GetTabStops(bool=true) const
Definition: paratr.hxx:213
const SvxScriptSpaceItem & GetScriptSpace(bool=true) const
Definition: paratr.hxx:221
const SvxForbiddenRuleItem & GetForbiddenRule(bool=true) const
Definition: paratr.hxx:225
const SvxHangingPunctuationItem & GetHangingPunctuation(bool=true) const
Definition: paratr.hxx:223
const SvxParaGridItem & GetParaGrid(bool=true) const
Definition: paratr.hxx:229
const SvxLineSpacingItem & GetLineSpacing(bool=true) const
Definition: paratr.hxx:201
const SvxHyphenZoneItem & GetHyphenZone(bool=true) const
Definition: paratr.hxx:215
const css::lang::Locale & GetLocale(const LanguageType aLang)
Definition: breakit.hxx:68
SwLineBreakClear GetClear() const
Definition: porrst.cxx:240
SwTextFrame * FindMaster() const
Definition: flowfrm.cxx:762
const SwAttrSet & GetSwAttrSet() const
Does node has already its own auto-attributes? Access to SwAttrSet.
Definition: node.hxx:727
Definition: doc.hxx:197
IDocumentDeviceAccess const & getIDocumentDeviceAccess() const
Definition: doc.cxx:252
IDocumentSettingAccess const & getIDocumentSettingAccess() const
Definition: doc.cxx:190
IDocumentMarkAccess * getIDocumentMarkAccess()
Definition: docbm.cxx:1890
SwDocShell * GetDocShell()
Definition: doc.hxx:1370
void SetKern(tools::Long nNew)
Definition: drawfont.hxx:533
void SetAscent(sal_uInt16 nNew)
Definition: drawfont.hxx:525
void SetSpaceStop(bool bNew)
Definition: drawfont.hxx:605
void SetNumberOfBlanks(TextFrameIndex const nNew)
Definition: drawfont.hxx:556
void SetSnapToGrid(bool bNew)
Definition: drawfont.hxx:610
void SetHyphPos(TextFrameIndex *const pNew)
Definition: drawfont.hxx:416
void SetPos(const Point &rNew)
Definition: drawfont.hxx:408
void SetSize(const Size &rNew)
Definition: drawfont.hxx:470
void SetFont(SwFont *pNew)
Definition: drawfont.hxx:478
void SetSmartTags(sw::WrongListIterator *const pNew)
Definition: drawfont.hxx:465
void SetMeasureLen(TextFrameIndex const nNew)
Definition: drawfont.hxx:498
void SetKanaComp(short nNew)
Definition: drawfont.hxx:569
tools::Long GetKanaDiff() const
Definition: drawfont.hxx:297
void SetFrame(const SwTextFrame *pNewFrame)
Definition: drawfont.hxx:176
void SetGrammarCheck(sw::WrongListIterator *const pNew)
Definition: drawfont.hxx:457
void SetOut(OutputDevice &rNew)
Definition: drawfont.hxx:403
void SetUnderFnt(SwUnderlineFont *pULFnt)
Definition: drawfont.hxx:579
void SetSpace(tools::Long nNew)
Definition: drawfont.hxx:538
void SetWrong(sw::WrongListIterator *const pNew)
Definition: drawfont.hxx:449
SwTextSizeInfo * pInf
Definition: inftxt.hxx:704
SwAttrIter * pIter
Definition: inftxt.hxx:706
SwFont * pFnt
Definition: inftxt.hxx:705
SwFontSave(const SwTextSizeInfo &rInf, SwFont *pFnt, SwAttrIter *pItr=nullptr)
Definition: inftxt.cxx:2106
To take Asian or other languages into consideration, an SwFont object consists of 3 SwSubFonts (Latin...
Definition: swfont.hxx:135
void DrawStretchText_(SwDrawTextInfo &rInf)
Definition: swfont.hxx:324
void Invalidate()
Definition: swfont.hxx:338
void SetCharSet(const rtl_TextEncoding eCharSet, const SwFontScript nWhich)
Definition: swfont.hxx:497
const std::optional< Color > & GetBackColor() const
Definition: swfont.hxx:195
bool DifferentFontCacheId(const SwFont *pFnt, SwFontScript nWhich)
Definition: swfont.hxx:205
void DrawText_(SwDrawTextInfo &rInf)
Definition: swfont.hxx:321
const Size & GetSize(SwFontScript nWhich) const
Definition: swfont.hxx:209
void SetVertical(Degree10 nDir, const bool bVertLayout=false, const bool bVertLayoutLRBT=false)
Definition: swfont.cxx:417
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 SetName(const OUString &rName, const SwFontScript nWhich)
Definition: swfont.hxx:471
Size GetTextSize_(SwDrawTextInfo &rInf)
Definition: swfont.hxx:313
void SetSize(const Size &rSize, const SwFontScript nWhich)
Definition: swfont.hxx:744
SwFontScript GetActual() const
Definition: swfont.hxx:187
TextFrameIndex GetTextBreak(SwDrawTextInfo const &rInf, tools::Long nTextWidth)
Definition: fntcache.cxx:1959
void SetColor(const Color &rColor)
Definition: swfont.hxx:421
const std::optional< editeng::SvxBorderLine > & GetLeftBorder() const
Definition: swfont.hxx:349
const Color & GetColor() const
Definition: swfont.hxx:280
LanguageType GetLanguage() const
Definition: swfont.hxx:286
void SetTransparent(const bool bTrans)
Definition: swfont.hxx:650
void SetFamily(const FontFamily eFamily, const SwFontScript nWhich)
Definition: swfont.hxx:458
sal_uInt16 GetAscent(SwViewShell const *pSh, const OutputDevice &rOut)
Definition: swfont.hxx:330
void ChgPhysFnt(SwViewShell const *pSh, OutputDevice &rOut)
Definition: swfont.cxx:893
tools::Long GetHeight() const
Definition: swfont.hxx:287
sal_uInt16 GetLeftBorderSpace() const
Definition: swfont.hxx:910
const Color & GetHighlightColor() const
Definition: swfont.hxx:197
void SetStyleName(const OUString &rStyleName, const SwFontScript nWhich)
Definition: swfont.hxx:484
sal_uInt16 & Orig()
Definition: porftn.hxx:40
If SwFormatDrop is a Client, it is the CharFormat that describes the font for the DropCaps.
Definition: paratr.hxx:72
sal_uInt8 GetLines() const
Definition: paratr.hxx:110
sal_uInt8 GetChars() const
Definition: paratr.hxx:113
bool GetWholeWord() const
Definition: paratr.hxx:116
const SwRect & getFrameArea() const
Definition: frame.hxx:179
bool IsInDocBody() const
Definition: frame.hxx:949
bool IsVertLRBT() const
Definition: frame.hxx:989
bool IsRightToLeft() const
Definition: frame.hxx:993
bool IsVertical() const
Definition: frame.hxx:979
SwRootFrame * getRootFrame()
Definition: frame.hxx:685
bool IsFootnoteAllowed() const
Definition: ftnfrm.cxx:889
SwLineInfo()
Definition: inftxt.cxx:96
void CtorInitLineInfo(const SwAttrSet &rAttrSet, const SwTextNode &rTextNode)
Definition: inftxt.cxx:109
tools::Long m_nListTabStopPosition
Definition: inftxt.hxx:69
~SwLineInfo()
Definition: inftxt.cxx:105
sal_uInt16 m_nDefTabStop
Definition: inftxt.hxx:67
const SvxLineSpacingItem * m_pSpace
Definition: inftxt.hxx:65
bool m_bListTabStopIncluded
Definition: inftxt.hxx:68
std::optional< SvxTabStopItem > m_oRuler
Definition: inftxt.hxx:64
SvxParaVertAlignItem::Align m_nVertAlign
Definition: inftxt.hxx:66
Collection of SwLinePortion instances, representing one line of text.
Definition: porlay.hxx:79
virtual void Height(const SwTwips nNew, const bool bText=true) override
Definition: porlay.cxx:231
SwTwips GetRealHeight() const
Definition: porlay.hxx:169
Base class for anything that can be part of a line in the Writer layout.
Definition: porlin.hxx:52
bool IsBlankPortion() const
Definition: porlin.hxx:120
bool IsHangingPortion() const
Definition: porlin.hxx:140
bool InTextGrp() const
Definition: porlin.hxx:105
SwLinePortion * GetNextPortion() const
Definition: porlin.hxx:75
bool GetJoinBorderWithPrev() const
Definition: porlin.hxx:177
bool InNumberGrp() const
Definition: porlin.hxx:109
PortionType GetWhichPor() const
Definition: porlin.hxx:102
TextFrameIndex GetLen() const
Definition: porlin.hxx:77
bool IsKernPortion() const
Definition: porlin.hxx:141
bool GetJoinBorderWithNext() const
Definition: porlin.hxx:178
virtual bool GetExpText(const SwTextSizeInfo &rInf, OUString &rText) const
Definition: porlin.cxx:314
SwTwips & GetAscent()
Definition: porlin.hxx:80
bool InSpaceGrp() const
Definition: porlin.hxx:116
bool IsDropPortion() const
Definition: porlin.hxx:130
virtual tools::Long CalcSpacing(tools::Long nSpaceAdd, const SwTextSizeInfo &rInf) const
Definition: porlin.cxx:309
bool IsBreakPortion() const
Definition: porlin.hxx:121
bool IsHolePortion() const
Definition: porlin.hxx:135
bool InFieldGrp() const
Definition: porlin.hxx:111
bool IsFlyPortion() const
Definition: porlin.hxx:134
bool InFixMargGrp() const
Definition: porlin.hxx:115
const IDocumentSettingAccess * getIDocumentSettingAccess() const
Provides access to the document setting interface.
Definition: node.cxx:2138
Collection of SwLineLayout instances, represents the paragraph text in Writer layout.
Definition: porlay.hxx:251
SwScriptInfo & GetScriptInfo()
Definition: porlay.hxx:291
SwTwips Width() const
Definition: possiz.hxx:51
SwTwips Height() const
Definition: possiz.hxx:49
Size SvLSize() const
Definition: possiz.hxx:53
Of course Writer needs its own rectangles.
Definition: swrect.hxx:35
SwRect & Intersection(const SwRect &rRect)
Definition: swrect.cxx:57
void Height(tools::Long nNew)
Definition: swrect.hxx:193
bool HasArea() const
Definition: swrect.hxx:300
Point TopLeft() const
Definition: swrect.hxx:254
void Top(const tools::Long nTop)
Definition: swrect.hxx:206
Point BottomLeft() const
Definition: swrect.hxx:262
void Right(const tools::Long nRight)
Definition: swrect.hxx:202
void Bottom(const tools::Long nBottom)
Definition: swrect.hxx:211
void Pos(const Point &rNew)
Definition: swrect.hxx:171
void AddLeft(const tools::Long nAdd)
Definition: swrect.cxx:125
void AddBottom(const tools::Long nAdd)
Definition: swrect.cxx:130
void AddRight(const tools::Long nAdd)
Definition: swrect.cxx:127
void AddTop(const tools::Long nAdd)
Definition: swrect.cxx:128
Point BottomRight() const
Definition: swrect.hxx:266
tools::Rectangle SVRect() const
Definition: swrect.hxx:292
void Left(const tools::Long nLeft)
Definition: swrect.hxx:197
Point TopRight() const
Definition: swrect.hxx:258
void Width(tools::Long nNew)
Definition: swrect.hxx:189
SwViewShell * GetCurrShell() const
Definition: rootfrm.hxx:215
static bool FlushVout()
Output virtual Device (e.g. for animations)
Definition: virtoutp.cxx:30
size_t CountCompChg() const
Definition: scriptinfo.hxx:163
static SwSmartTagMgr & Get()
static const OUString & GetUIName(const OUString &rName, SwGetPoolIdFromName)
sal_uInt16 GetTabPos() const
Definition: portab.hxx:38
bool IsOn() const
Definition: txtfly.hxx:326
void CtorInitTextFly(const SwTextFrame *pFrame)
Definition: txtfly.cxx:356
void DrawTextOpaque(SwDrawTextInfo &rInf)
This method is called by DrawText().
Definition: txtfly.cxx:455
TextFrameIndex m_nLastBookmarkPos
need to check for bookmarks at every portion
Definition: inftxt.hxx:479
SwLinePortion * GetLast()
Definition: inftxt.hxx:566
sal_uInt16 m_nLineHeight
Definition: inftxt.hxx:488
SwTabPortion * GetLastTab()
Definition: inftxt.hxx:620
sal_Unicode m_cHookChar
Definition: inftxt.hxx:515
void CtorInitTextFormatInfo(OutputDevice *pRenderContext, SwTextFrame *pFrame, const bool bInterHyph=false, const bool bQuick=false, const bool bTst=false)
Definition: inftxt.cxx:1610
SwLineLayout * GetRoot()
Definition: inftxt.hxx:562
const SwFormatDrop * GetDropFormat() const
Definition: inftxt.cxx:1692
SwLineLayout * m_pRoot
Definition: inftxt.hxx:468
SwLinePortion * m_pUnderflow
Definition: inftxt.hxx:471
void SetLineStart(TextFrameIndex const nNew)
Definition: inftxt.hxx:596
bool InitHyph(const bool bAuto=false)
Definition: inftxt.cxx:1586
bool m_bFootnoteDone
Definition: inftxt.hxx:493
sal_uInt16 m_nRealWidth
Definition: inftxt.hxx:486
bool m_bTestFormat
Definition: inftxt.hxx:512
sal_uInt16 m_nLineNetHeight
Definition: inftxt.hxx:489
void SetLineNetHeight(const sal_uInt16 nNew)
Definition: inftxt.hxx:602
bool CheckFootnotePortion_(SwLineLayout const *pCurr)
Definition: inftxt.cxx:1799
bool LastKernPortion()
Definition: inftxt.cxx:1907
void SetLineHeight(const sal_uInt16 nNew)
Definition: inftxt.hxx:600
TextFrameIndex m_nUnderScorePos
enlarge repaint if underscore has been found
Definition: inftxt.hxx:478
TextFrameIndex ScanPortionEnd(TextFrameIndex nStart, TextFrameIndex nEnd)
Definition: inftxt.cxx:1814
TextFrameIndex m_nSoftHyphPos
SoftHyphPos for Hyphenation.
Definition: inftxt.hxx:476
bool m_bTabOverflow
Definition: inftxt.hxx:511
sal_Unicode m_cTabDecimal
Definition: inftxt.hxx:514
SwTabPortion * m_pLastTab
Definition: inftxt.hxx:474
sal_uInt8 & MaxHyph()
Definition: inftxt.hxx:559
void SetLast(SwLinePortion *pNewLast)
Definition: inftxt.hxx:567
SwLinePortion * m_pRest
Definition: inftxt.hxx:472
sal_uInt16 m_nForcedLeftMargin
Definition: inftxt.hxx:490
SwTwips m_nLeftMargin
First or left margin, depending on context.
Definition: inftxt.hxx:485
sal_uInt16 Width() const
Definition: inftxt.hxx:533
SwTwips m_nLeft
Definition: inftxt.hxx:481
sal_Unicode GetTabDecimal() const
Definition: inftxt.hxx:622
void SetTabDecimal(const sal_Unicode cNew)
Definition: inftxt.hxx:623
bool IsHyphenate() const
If the Hyphenator returns ERROR or the language is set to NOLANGUAGE we do not hyphenate.
Definition: inftxt.cxx:1658
bool CheckCurrentPosBookmark()
Definition: inftxt.cxx:2172
SwTwips m_nFirst
Definition: inftxt.hxx:483
SwTwips m_nRight
Definition: inftxt.hxx:482
SwTwips GetLineWidth()
Returns the distance between the current horizontal position and the end of the line.
Definition: inftxt.cxx:1935
bool m_bFakeLineStart
Definition: inftxt.hxx:508
const css::beans::PropertyValues & GetHyphValues() const
Definition: inftxt.cxx:1579
SwTextFormatInfo(OutputDevice *pRenderContext, SwTextFrame *pFrame, const bool bInterHyphL=false, const bool bQuickL=false, const bool bTst=false)
Definition: inftxt.cxx:1738
SwLinePortion * m_pLast
Definition: inftxt.hxx:469
bool ChgHyph(const bool bNew)
Definition: inftxt.cxx:2157
css::beans::PropertyValues m_aHyphVals
Definition: inftxt.hxx:466
sal_uInt16 m_nWidth
Definition: inftxt.hxx:487
SwFlyPortion * m_pFly
Definition: inftxt.hxx:470
Represents the visualization of a paragraph.
Definition: txtfrm.hxx:168
SwDoc & GetDoc()
Definition: txtfrm.hxx:475
void SwitchVerticalToHorizontal(SwRect &rRect) const
Calculates the coordinates of a rectangle when switching from vertical to horizontal layout.
Definition: txtfrm.cxx:580
SwPosition MapViewToModelPos(TextFrameIndex nIndex) const
Definition: txtfrm.cxx:1333
TextFrameIndex GetOffset() const
Definition: txtfrm.hxx:453
std::pair< SwTextNode *, sal_Int32 > MapViewToModel(TextFrameIndex nIndex) const
map position in potentially merged text frame to SwPosition
Definition: txtfrm.cxx:1318
void SwitchLTRtoRTL(SwRect &rRect) const
Calculates the coordinates of a rectangle when switching from LTR to RTL layout.
Definition: txtfrm.cxx:683
static SwView * GetView()
Definition: paintfrm.cxx:4359
void SwitchRTLtoLTR(SwRect &rRect) const
Calculates the coordinates of a rectangle when switching from RTL to LTR layout.
Definition: txtfrm.hxx:753
virtual void Format(vcl::RenderContext *pRenderContext, const SwBorderAttrs *pAttrs=nullptr) override
Calculates the frame area size and the print area, in case they are invalid.
Definition: frmform.cxx:1881
SwParaPortion * GetPara()
Definition: txtcache.cxx:90
void SwitchHorizontalToVertical(SwRect &rRect) const
Calculates the coordinates of a rectangle when switching from horizontal to vertical layout.
Definition: txtfrm.cxx:473
const OUString & GetText() const
Returns the text portion we want to edit (for inline see underneath)
Definition: txtfrm.cxx:1380
SwTextNode const * GetTextNodeForParaProps() const
Definition: txtfrm.cxx:1390
SwTextInfo()
Definition: inftxt.hxx:112
SwParaPortion * GetParaPortion()
Definition: inftxt.hxx:121
TextFrameIndex m_nTextStart
Definition: inftxt.hxx:109
void CtorInitTextInfo(SwTextFrame *pFrame)
Definition: inftxt.cxx:153
SwParaPortion * m_pPara
Definition: inftxt.hxx:108
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:112
bool GetListTabStopPosition(tools::Long &nListTabStopPosition) const
Retrieves the list tab stop position, if the paragraph's list level defines one and this list tab sto...
Definition: ndtxt.cxx:4691
bool HasMarkedLabel() const
Returns if this text node has a marked label.
Definition: ndtxt.cxx:2995
void DrawCSDFHighlighting(const SwLinePortion &rPor) const
Definition: inftxt.cxx:1336
SwTextFly m_aTextFly
Definition: inftxt.hxx:349
const SvxBrushItem * m_pBrushItem
Definition: inftxt.hxx:348
void SetPaintOfst(const SwTwips nNew)
Definition: inftxt.hxx:748
void DrawText_(const OUString &rText, const SwLinePortion &rPor, const TextFrameIndex nIdx, const TextFrameIndex nLen, const bool bKern, const bool bWrong=false, const bool bSmartTag=false, const bool bGrammarCheck=false)
Definition: inftxt.cxx:603
void DrawTab(const SwLinePortion &rPor) const
Definition: inftxt.cxx:960
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
void DrawBackground(const SwLinePortion &rPor, const Color *pColor=nullptr) const
Definition: inftxt.cxx:1134
SwTextFly & GetTextFly()
Definition: inftxt.hxx:387
SwTwips X() const
Definition: inftxt.hxx:382
void SetPos(const Point &rNew)
Definition: inftxt.hxx:435
const Point & GetPos() const
Definition: inftxt.hxx:434
sw::WrongListIterator * m_pSmartTags
Definition: inftxt.hxx:346
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
SwRect m_aPaintRect
Definition: inftxt.hxx:351
void DrawRect(const SwRect &rRect, bool bRetouche) const
Definition: inftxt.cxx:948
void DrawBackBrush(const SwLinePortion &rPor) const
Definition: inftxt.cxx:1158
std::vector< tools::Long > * m_pSpaceAdd
Definition: inftxt.hxx:347
void DrawPostIts(bool bScript) const
Definition: inftxt.cxx:1056
void DrawViewOpt(const SwLinePortion &rPor, PortionType nWhich, const Color *pColor=nullptr) const
Definition: inftxt.cxx:1470
void DrawCheckBox(const SwFieldFormCheckboxPortion &rPor, bool bChecked) const
Definition: inftxt.cxx:1103
void DrawRedArrow(const SwLinePortion &rPor) const
Definition: inftxt.cxx:1024
sal_uInt16 m_nSpaceIdx
Definition: inftxt.hxx:353
sw::WrongListIterator * m_pGrammarCheckList
Definition: inftxt.hxx:345
tools::Long GetSpaceAdd() const
Definition: inftxt.hxx:446
sw::WrongListIterator * m_pWrongList
Definition: inftxt.hxx:344
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
void CtorInitTextPaintInfo(OutputDevice *pRenderContext, SwTextFrame *pFrame, const SwRect &rPaint)
Definition: inftxt.cxx:494
SwTwips Y() const
Definition: inftxt.hxx:384
This portion represents a part of the paragraph string.
Definition: portxt.hxx:27
TextFrameIndex GetSpaceCnt(const SwTextSizeInfo &rInf, TextFrameIndex &rCnt) const
Definition: portxt.cxx:577
SwTextFrame * GetTextFrame()
Definition: inftxt.hxx:288
vcl::RenderContext * GetOut()
Definition: inftxt.hxx:225
void CtorInitTextSizeInfo(OutputDevice *pRenderContext, SwTextFrame *pFrame, TextFrameIndex nIdx)
Definition: inftxt.cxx:257
TextFrameIndex m_nLen
Definition: inftxt.hxx:156
TextFrameIndex m_nIdx
Definition: inftxt.hxx:155
bool m_bFootnoteInside
Definition: inftxt.hxx:163
sal_uInt8 GetDirection() const
Definition: inftxt.hxx:218
SwViewShell * GetVsh()
Definition: inftxt.hxx:222
const SwViewOption & GetOpt() const
Definition: inftxt.hxx:239
void SetMulti(const bool bNew)
Definition: inftxt.hxx:205
VclPtr< OutputDevice > m_pOut
Definition: inftxt.hxx:142
void SetLen(const TextFrameIndex nNew)
Definition: inftxt.hxx:276
VclPtr< OutputDevice > m_pRef
Definition: inftxt.hxx:143
SwFont * m_pFnt
Definition: inftxt.hxx:150
SwTextFrame * m_pFrame
Definition: inftxt.hxx:152
void SetSnapToGrid(const bool bN)
Definition: inftxt.hxx:217
TextFrameIndex GetTextBreak(const tools::Long nLineWidth, const TextFrameIndex nMaxLen, const sal_uInt16 nComp, vcl::text::TextLayoutCache const *) const
Definition: inftxt.cxx:447
TextFrameIndex GetMeasureLen() const
Definition: inftxt.hxx:277
void SetMeasureLen(const TextFrameIndex nNew)
Definition: inftxt.hxx:278
const std::shared_ptr< const vcl::text::TextLayoutCache > & GetCachedVclData() const
Definition: inftxt.hxx:332
void SetCachedVclData(std::shared_ptr< const vcl::text::TextLayoutCache > const &pCachedVclData)
Definition: inftxt.hxx:336
bool m_bFirstMulti
Definition: inftxt.hxx:167
void NoteAnimation() const
Definition: inftxt.cxx:386
bool m_bStopUnderflow
Definition: inftxt.hxx:162
void SetForbiddenChars(const bool bN)
Definition: inftxt.hxx:215
vcl::RenderContext * GetRefDev()
Definition: inftxt.hxx:229
SwFont * GetFont()
Definition: inftxt.hxx:232
bool OnWin() const
Definition: inftxt.hxx:193
void SetIdx(const TextFrameIndex nNew)
Definition: inftxt.hxx:274
void SetFont(SwFont *pNew)
Definition: inftxt.hxx:234
bool m_bScriptSpace
Definition: inftxt.hxx:173
bool IsRotated() const
Definition: inftxt.hxx:220
TextFrameIndex m_nMeasureLen
Definition: inftxt.hxx:157
bool m_bOtherThanFootnoteInside
Definition: inftxt.hxx:164
SwPosSize GetTextSize(OutputDevice *pOut, const SwScriptInfo *pSI, const OUString &rText, TextFrameIndex nIdx, TextFrameIndex nLen) const
Definition: inftxt.cxx:395
bool m_bNotEOL
Definition: inftxt.hxx:160
SwViewShell * m_pVsh
Definition: inftxt.hxx:139
sal_uInt16 m_nKanaIdx
Definition: inftxt.hxx:158
bool m_bForbiddenChars
Definition: inftxt.hxx:174
bool m_bHanging
Definition: inftxt.hxx:172
bool m_bURLNotify
Definition: inftxt.hxx:161
void SetFirstMulti(const bool bNew)
Definition: inftxt.hxx:207
sal_uInt16 GetAscent() const
Definition: inftxt.hxx:713
sal_Unicode GetChar(TextFrameIndex const nPos) const
Definition: inftxt.hxx:241
std::deque< sal_uInt16 > * m_pKanaComp
Definition: inftxt.hxx:137
void SetText(const OUString &rNew)
Definition: inftxt.hxx:279
TextFrameIndex GetLen() const
Definition: inftxt.hxx:275
bool IsNoSymbol() const
Definition: inftxt.hxx:282
const OUString * m_pText
Definition: inftxt.hxx:154
void SelectFont()
Definition: inftxt.cxx:377
sal_uInt8 m_nDirection
Definition: inftxt.hxx:176
bool IsFirstMulti() const
Definition: inftxt.hxx:206
const OUString & GetText() const
Definition: inftxt.hxx:240
SwPosSize GetTextSize() const
Definition: inftxt.cxx:409
TextFrameIndex GetIdx() const
Definition: inftxt.hxx:273
bool SnapToGrid() const
Definition: inftxt.hxx:216
void SetHanging(const bool bNew)
Definition: inftxt.hxx:211
bool HasHint(TextFrameIndex nPos) const
Definition: inftxt.cxx:488
void SetScriptSpace(const bool bNew)
Definition: inftxt.hxx:213
sal_uInt16 GetKanaComp() const
Definition: inftxt.hxx:328
bool IsMulti() const
Definition: inftxt.hxx:204
const SwViewOption * m_pOpt
Definition: inftxt.hxx:153
SwUnderlineFont * m_pUnderFnt
Definition: inftxt.hxx:151
bool bOn
Definition: inftxt.hxx:691
TextFrameIndex nLen
Definition: inftxt.hxx:689
sw::WrongListIterator * m_pOldSmartTagList
Definition: inftxt.hxx:684
TextFrameIndex nMeasureLen
Definition: inftxt.hxx:690
SwTextSlot(const SwTextSizeInfo *pNew, const SwLinePortion *pPor, bool bTextLen, bool bExgLists, OUString const &rCh=OUString())
Definition: inftxt.cxx:1983
OUString aText
Definition: inftxt.hxx:681
SwTextSizeInfo * pInf
Definition: inftxt.hxx:692
std::unique_ptr< SwWrongList > m_pTempList
Definition: inftxt.hxx:686
sw::WrongListIterator * m_pOldGrammarCheckList
Definition: inftxt.hxx:685
const OUString * pOldText
Definition: inftxt.hxx:683
std::unique_ptr< sw::WrongListIterator > m_pTempIter
Definition: inftxt.hxx:687
TextFrameIndex nIdx
Definition: inftxt.hxx:688
std::shared_ptr< const vcl::text::TextLayoutCache > m_pOldCachedVclData
Definition: inftxt.hxx:682
const SfxItemPropertySet * GetPropertySet(sal_uInt16 PropertyId)
Definition: unomap1.cxx:1111
bool IsPagePreview() const
Definition: viewopt.hxx:799
bool IsBlank(bool bHard=false) const
Definition: viewopt.hxx:351
void PaintPostIts(OutputDevice *pOut, const SwRect &rRect, bool bIsScript) const
Definition: viewopt.cxx:220
bool IsPostIts() const
Definition: viewopt.hxx:425
const Color & GetFieldShadingsColor() const
Definition: viewopt.cxx:522
bool IsOnlineSpell() const
Definition: viewopt.hxx:537
static sal_uInt16 GetPostItsWidth(const OutputDevice *pOut)
Definition: viewopt.cxx:214
vcl::RenderContext * GetOut() const
Definition: viewsh.hxx:365
const SwViewOption * GetViewOptions() const
Definition: viewsh.hxx:452
bool isOutputToWindow() const
Definition: viewsh.cxx:152
vcl::Window * GetWin() const
Definition: viewsh.hxx:364
vcl::RenderContext & GetRefDev() const
Definition: viewsh.cxx:2168
Definition: view.hxx:146
bool IsHighlightCharDF()
Definition: view.hxx:718
sal_Int32 Pos(sal_uInt16 nIdx) const
Definition: wrong.hxx:318
sal_uInt16 GetWrongPos(sal_Int32 nValue) const
Find the first position that is greater or equal to the given value.
Definition: wrong.cxx:191
SwWrongList * SubList(sal_uInt16 nIdx) const
Definition: wrong.hxx:342
static rtl::Reference< SwXTextRange > CreateXTextRange(SwDoc &rDoc, const SwPosition &rPos, const SwPosition *const pMark)
Definition: unoobj2.cxx:1221
void SetSize(const Size &)
constexpr Point TopLeft() const
void Move(tools::Long nHorzMoveDelta, tools::Long nVertMoveDelta)
constexpr Point BottomRight() const
constexpr Point TopRight() const
constexpr Point BottomLeft() const
void SetOrientation(Degree10 nLineOrientation)
constexpr ::Color COL_LIGHTRED(0xFF, 0x00, 0x00)
constexpr ::Color COL_AUTO(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
constexpr ::Color COL_LIGHTGRAY(0xC0, 0xC0, 0xC0)
constexpr ::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
virtual editeng::HangulHanjaConversion::ConversionDirection GetDirection(editeng::HangulHanjaConversion::ConversionDirection _eDefaultDirection) const override
ALIGN_BASELINE
FAMILY_DONTKNOW
SwLineBreakClear
Defines the location of a line break text wrapping restart.
void SwAlignRect(SwRect &rRect, const SwViewShell *pSh, const vcl::RenderContext *pRenderContext)
Function <SwAlignRect(..)> is also used outside this file.
Definition: paintfrm.cxx:1135
void PaintCharacterBorder(const SwFont &rFont, const SwRect &rPaintArea, const bool bVerticalLayout, const bool bVerticalLayoutLRBT, const bool bJoinWithPrev, const bool bJoinWithNext)
Paint border around a run of characters using frame painting code.
Definition: paintfrm.cxx:5040
#define CH_TXTATR_INWORD
Definition: hintids.hxx:175
#define CH_TXTATR_NEWLINE
Definition: hintids.hxx:177
#define CH_TXT_ATR_FIELDSTART
Definition: hintids.hxx:183
#define CH_TXTATR_BREAKWORD
Definition: hintids.hxx:174
#define DRAW_SPECIAL_OPTIONS_ROTATE
Definition: inftxt.cxx:94
#define DRAW_SPECIAL_OPTIONS_CENTER
Definition: inftxt.cxx:93
#define CHAR_TAB_RTL
Definition: inftxt.cxx:89
#define CHAR_RIGHT_ARROW
Definition: inftxt.cxx:87
static void lcl_DrawSpecial(const SwTextPaintInfo &rTextPaintInfo, const SwLinePortion &rPor, SwRect &rRect, const Color &rCol, sal_Unicode cChar, sal_uInt8 nOptions)
Draws a special portion E.g.
Definition: inftxt.cxx:838
#define CHAR_TAB
Definition: inftxt.cxx:88
#define CHAR_LEFT_ARROW
Definition: inftxt.cxx:86
static void lcl_InitHyphValues(PropertyValues &rVals, sal_Int16 nMinLeading, sal_Int16 nMinTrailing, bool bNoCapsHyphenation, bool bNoLastWordHyphenation, sal_Int16 nMinWordLength, sal_Int16 nTextHyphZone)
Definition: inftxt.cxx:1528
#define CHAR_LINEBREAK
Definition: inftxt.cxx:90
#define CHAR_UNDERSCORE
Definition: inftxt.cxx:85
static TextFrameIndex GetMinLen(const SwTextSizeInfo &rInf)
Definition: inftxt.cxx:183
static void ChkOutDev(const SwTextSizeInfo &rInf)
Definition: inftxt.cxx:172
#define CHAR_LINEBREAK_RTL
Definition: inftxt.cxx:91
#define DIR_LEFT2RIGHT
Definition: inftxt.hxx:54
#define DIR_RIGHT2LEFT
Definition: inftxt.hxx:56
sal_Int32 nIndex
#define LANGUAGE_NONE
#define LANGUAGE_DONTKNOW
constexpr OUStringLiteral UPN_IS_GRAMMAR_AUTO
#define UPH_HYPH_NO_LAST_WORD
#define UPH_HYPH_MIN_WORD_LENGTH
#define UPH_HYPH_MIN_LEADING
constexpr OUStringLiteral UPN_HYPH_ZONE
#define UPH_HYPH_ZONE
constexpr OUStringLiteral UPN_HYPH_NO_CAPS
constexpr OUStringLiteral UPN_HYPH_MIN_WORD_LENGTH
constexpr OUStringLiteral UPN_HYPH_NO_LAST_WORD
constexpr OUStringLiteral UPN_HYPH_MIN_LEADING
#define UPH_HYPH_MIN_TRAILING
constexpr OUStringLiteral UPN_HYPH_MIN_TRAILING
#define UPH_HYPH_NO_CAPS
sal_uInt16 nPos
#define SAL_WARN(area, stream)
#define SAL_INFO(area, stream)
double getLength(const B2DPolygon &rCandidate)
std::map< sal_Int32, std::shared_ptr< SetItemPropertyStorage > > PropertyValues
int i
m
OUString const & GetDefBulletFontname()
retrieve font family name used for the default bullet list characters
Definition: number.cxx:1362
tools::Long SnapToGrid(KernArray &rKernArray, std::u16string_view aText, sal_Int32 nStt, sal_Int32 nLen, tools::Long nGridWidth, bool bForceLeft)
Snap ideographs to text grids: a) Ideographic open brackets are aligned to the rightmost edge of span...
Definition: justify.cxx:176
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
long Long
vcl::Font GetFont(vcl::Font const &rFont, DrawModeFlags nDrawMode, StyleSettings const &rStyleSettings)
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
Definition: nodeoffset.hxx:35
SwNoteURL * pNoteURL
Definition: noteurl.cxx:23
OUTDEV_WINDOW
#define LINE_BREAK_WIDTH
Definition: porrst.hxx:38
#define SPECIAL_FONT_HEIGHT
Definition: porrst.hxx:39
#define SPACING_PRECISION_FACTOR
Definition: scriptinfo.hxx:41
Marks a position in the document model.
Definition: pam.hxx:38
UNDERLYING_TYPE get() const
tools::Long GetLen(const Point &rPnt)
const sal_Unicode CH_TAB
Definition: swfont.hxx:44
const sal_Unicode CH_BREAK
Definition: swfont.hxx:43
const sal_Unicode CH_BLANK
Definition: swfont.hxx:42
SwFontScript
Definition: swfont.hxx:124
OUString SwResId(TranslateId aId)
Definition: swmodule.cxx:168
#define SW_MOD()
Definition: swmodule.hxx:254
uno::Reference< linguistic2::XHyphenator > GetHyphenator()
Definition: swtypes.cxx:57
#define CHAR_HARDBLANK
Definition: swtypes.hxx:173
tools::Long SwTwips
Definition: swtypes.hxx:51
#define CHAR_SOFTHYPHEN
Definition: swtypes.hxx:175
#define CHAR_WJ
Definition: swtypes.hxx:179
#define CHAR_HARDHYPHEN
Definition: swtypes.hxx:174
#define CHAR_ZWSP
Definition: swtypes.hxx:178
constexpr sal_Int32 COMPLETE_STRING
Definition: swtypes.hxx:57
#define NON_PRINTING_CHARACTER_COLOR
Definition: txtfrm.hxx:57
PortionType
Definition: txttypes.hxx:24
unsigned char sal_uInt8
sal_uInt16 sal_Unicode
SwUnoPropertyMapProvider aSwMapProvider
Definition: unomap1.cxx:88
#define PROPERTY_MAP_CHAR_AUTO_STYLE
Definition: unomap.hxx:120
Count
constexpr OUStringLiteral UNO_NAME_SORTED_TEXT_ID
Definition: unoprnms.hxx:424
constexpr OUStringLiteral UNO_NAME_PARA_IS_NUMBERING_RESTART
Definition: unoprnms.hxx:527
constexpr OUStringLiteral UNO_NAME_CHAR_COLOR_THEME
constexpr OUStringLiteral UNO_NAME_NUMBERING_IS_NUMBER
Definition: unoprnms.hxx:169
constexpr OUStringLiteral UNO_NAME_PARA_CONDITIONAL_STYLE_NAME
Definition: unoprnms.hxx:498
constexpr OUStringLiteral UNO_NAME_PARA_STYLE_NAME
Definition: unoprnms.hxx:193
constexpr OUStringLiteral UNO_NAME_CHAR_COLOR_TINT_OR_SHADE
constexpr OUStringLiteral UNO_NAME_RSID
Definition: unoprnms.hxx:857
constexpr OUStringLiteral UNO_NAME_NUMBERING_LEVEL
constexpr OUStringLiteral UNO_NAME_PAGE_STYLE_NAME
Definition: unoprnms.hxx:189
constexpr OUStringLiteral UNO_NAME_NUMBERING_START_VALUE
Definition: unoprnms.hxx:168
constexpr OUStringLiteral UNO_NAME_PARA_CONTINUEING_PREVIOUS_SUB_TREE
Definition: unoprnms.hxx:840
constexpr OUStringLiteral UNO_NAME_PARRSID
Definition: unoprnms.hxx:858
constexpr OUStringLiteral UNO_NAME_CHAR_STYLE_NAME
std::unordered_map< OUString, std::pair< Color, int > > StylesHighlighterColorMap
oslFileHandle & pOut
size_t pos
@ WRONGLIST_SMARTTAG
Definition: wrong.hxx:60
@ WRONGLIST_GRAMMAR
Definition: wrong.hxx:59
sal_Int32 nLength