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 pTransparentText.reset(new SwTransparentTextGuard(rPor, *this, aDrawInf));
701 }
702
703 if( GetTextFly().IsOn() )
704 {
705 // aPos needs to be the TopLeft, because we cannot calculate the
706 // ClipRects otherwise
707 const Point aPoint( aFontPos.X(), aFontPos.Y() - rPor.GetAscent() );
708 const Size aSize( rPor.Width(), rPor.Height() );
709 aDrawInf.SetPos( aPoint );
710 aDrawInf.SetSize( aSize );
711 aDrawInf.SetAscent( rPor.GetAscent() );
712 aDrawInf.SetKern( bKern ? rPor.Width() : 0 );
713 aDrawInf.SetWrong( bTmpWrong ? m_pWrongList : nullptr );
714 aDrawInf.SetGrammarCheck( bTmpGrammarCheck ? m_pGrammarCheckList : nullptr );
715 aDrawInf.SetSmartTags( bTmpSmart ? m_pSmartTags : nullptr );
716 GetTextFly().DrawTextOpaque( aDrawInf );
717 }
718 else
719 {
720 aDrawInf.SetPos( aFontPos );
721 if( bKern )
722 m_pFnt->DrawStretchText_( aDrawInf );
723 else
724 {
725 aDrawInf.SetWrong( bTmpWrong ? m_pWrongList : nullptr );
726 aDrawInf.SetGrammarCheck( bTmpGrammarCheck ? m_pGrammarCheckList : nullptr );
727 aDrawInf.SetSmartTags( bTmpSmart ? m_pSmartTags : nullptr );
728 m_pFnt->DrawText_( aDrawInf );
729 }
730 }
731}
732
734 SwRect* pRect, SwRect* pIntersect,
735 const bool bInsideBox ) const
736{
737 Size aSize( rPor.Width(), rPor.Height() );
738 if( rPor.IsHangingPortion() )
739 aSize.setWidth( static_cast<const SwHangingPortion&>(rPor).GetInnerWidth() );
740 if( rPor.InSpaceGrp() && GetSpaceAdd() )
741 {
742 SwTwips nAdd = rPor.CalcSpacing( GetSpaceAdd(), *this );
743 if( rPor.InFieldGrp() && GetSpaceAdd() < 0 && nAdd )
745 aSize.AdjustWidth(nAdd );
746 }
747
748 Point aPoint;
749
750 if( IsRotated() )
751 {
752 tools::Long nTmp = aSize.Width();
753 aSize.setWidth( aSize.Height() );
754 aSize.setHeight( nTmp );
755 if ( 1 == GetDirection() )
756 {
757 aPoint.setX( X() - rPor.GetAscent() );
758 aPoint.setY( Y() - aSize.Height() );
759 }
760 else
761 {
762 aPoint.setX( X() - rPor.Height() + rPor.GetAscent() );
763 aPoint.setY( Y() );
764 }
765 }
766 else
767 {
768 aPoint.setX( X() );
769 if (GetTextFrame()->IsVertLR() && !GetTextFrame()->IsVertLRBT())
770 aPoint.setY( Y() - rPor.Height() + rPor.GetAscent() );
771 else
772 aPoint.setY( Y() - rPor.GetAscent() );
773 }
774
775 // Adjust x coordinate if we are inside a bidi portion
776 const bool bFrameDir = GetTextFrame()->IsRightToLeft();
777 const bool bCounterDir = ( !bFrameDir && DIR_RIGHT2LEFT == GetDirection() ) ||
778 ( bFrameDir && DIR_LEFT2RIGHT == GetDirection() );
779
780 if ( bCounterDir )
781 aPoint.AdjustX( -(aSize.Width()) );
782
783 SwRect aRect( aPoint, aSize );
784
785 if ( GetTextFrame()->IsRightToLeft() )
786 GetTextFrame()->SwitchLTRtoRTL( aRect );
787
788 if ( GetTextFrame()->IsVertical() )
790
791 if( bInsideBox && rPor.InTextGrp() )
792 {
793 const bool bJoinWithPrev =
794 static_cast<const SwTextPortion&>(rPor).GetJoinBorderWithPrev();
795 const bool bJoinWithNext =
796 static_cast<const SwTextPortion&>(rPor).GetJoinBorderWithNext();
797 const bool bIsVert = GetTextFrame()->IsVertical();
798 const bool bIsVertLRBT = GetTextFrame()->IsVertLRBT();
799 aRect.AddTop( GetFont()->CalcShadowSpace(SvxShadowItemSide::TOP, bIsVert, bIsVertLRBT,
800 bJoinWithPrev, bJoinWithNext));
801 aRect.AddBottom( - GetFont()->CalcShadowSpace(SvxShadowItemSide::BOTTOM, bIsVert, bIsVertLRBT,
802 bJoinWithPrev, bJoinWithNext));
803 aRect.AddLeft( GetFont()->CalcShadowSpace(SvxShadowItemSide::LEFT, bIsVert, bIsVertLRBT,
804 bJoinWithPrev, bJoinWithNext));
805 aRect.AddRight( - GetFont()->CalcShadowSpace(SvxShadowItemSide::RIGHT, bIsVert, bIsVertLRBT,
806 bJoinWithPrev, bJoinWithNext));
807 }
808
809 if ( pRect )
810 *pRect = aRect;
811
812 if( aRect.HasArea() && pIntersect )
813 {
814 ::SwAlignRect( aRect, GetVsh(), GetOut() );
815
816 if ( GetOut()->IsClipRegion() )
817 {
818 SwRect aClip( GetOut()->GetClipRegion().GetBoundRect() );
819 aRect.Intersection( aClip );
820 }
821
822 *pIntersect = aRect;
823 }
824}
825
836static void lcl_DrawSpecial( const SwTextPaintInfo& rTextPaintInfo, const SwLinePortion& rPor,
837 SwRect& rRect, const Color& rCol, sal_Unicode cChar,
838 sal_uInt8 nOptions )
839{
840 bool bCenter = 0 != ( nOptions & DRAW_SPECIAL_OPTIONS_CENTER );
841 bool bRotate = 0 != ( nOptions & DRAW_SPECIAL_OPTIONS_ROTATE );
842
843 // rRect is given in absolute coordinates
844 if ( rTextPaintInfo.GetTextFrame()->IsRightToLeft() )
845 rTextPaintInfo.GetTextFrame()->SwitchRTLtoLTR( rRect );
846 if ( rTextPaintInfo.GetTextFrame()->IsVertical() )
847 rTextPaintInfo.GetTextFrame()->SwitchVerticalToHorizontal( rRect );
848
849 const SwFont* pOldFnt = rTextPaintInfo.GetFont();
850
851 // Font is generated only once:
852 static SwFont s_aFnt = [&]()
853 {
854 SwFont tmp( *pOldFnt );
855 tmp.SetFamily( FAMILY_DONTKNOW, tmp.GetActual() );
857 tmp.SetStyleName(OUString(), tmp.GetActual());
858 tmp.SetCharSet( RTL_TEXTENCODING_SYMBOL, tmp.GetActual() );
859 return tmp;
860 }();
861
862 // Some of the current values are set at the font:
863 if ( ! bRotate )
864 s_aFnt.SetVertical( 0_deg10, rTextPaintInfo.GetTextFrame()->IsVertical() );
865 else
866 s_aFnt.SetVertical( pOldFnt->GetOrientation() );
867
868 s_aFnt.SetColor(rCol);
869
870 Size aFontSize( 0, SPECIAL_FONT_HEIGHT );
871 s_aFnt.SetSize( aFontSize, s_aFnt.GetActual() );
872
873 SwTextPaintInfo& rNonConstTextPaintInfo = const_cast<SwTextPaintInfo&>(rTextPaintInfo);
874
875 rNonConstTextPaintInfo.SetFont( &s_aFnt );
876
877 // The maximum width depends on the current orientation
878 const Degree10 nDir = s_aFnt.GetOrientation( rTextPaintInfo.GetTextFrame()->IsVertical() );
879 SwTwips nMaxWidth;
880 if (nDir == 900_deg10 || nDir == 2700_deg10)
881 nMaxWidth = rRect.Height();
882 else
883 {
884 assert(nDir == 0_deg10); //Unknown direction set at font
885 nMaxWidth = rRect.Width();
886 }
887
888 // check if char fits into rectangle
889 const OUString aTmp( cChar );
890 aFontSize = rTextPaintInfo.GetTextSize( aTmp ).SvLSize();
891 while ( aFontSize.Width() > nMaxWidth )
892 {
893 SwTwips nFactor = ( 100 * aFontSize.Width() ) / nMaxWidth;
894 const SwTwips nOldWidth = aFontSize.Width();
895
896 // new height for font
897 const SwFontScript nAct = s_aFnt.GetActual();
898 aFontSize.setHeight( ( 100 * s_aFnt.GetSize( nAct ).Height() ) / nFactor );
899 aFontSize.setWidth( ( 100 * s_aFnt.GetSize( nAct).Width() ) / nFactor );
900
901 if ( !aFontSize.Width() && !aFontSize.Height() )
902 break;
903
904 s_aFnt.SetSize( aFontSize, nAct );
905
906 aFontSize = rTextPaintInfo.GetTextSize( aTmp ).SvLSize();
907
908 if ( aFontSize.Width() >= nOldWidth )
909 break;
910 }
911
912 const Point aOldPos( rTextPaintInfo.GetPos() );
913
914 // adjust values so that tab is vertically and horizontally centered
915 SwTwips nX = rRect.Left();
916 SwTwips nY = rRect.Top();
917 switch ( nDir.get() )
918 {
919 case 0 :
920 if ( bCenter )
921 nX += ( rRect.Width() - aFontSize.Width() ) / 2;
922 nY += ( rRect.Height() - aFontSize.Height() ) / 2 + rTextPaintInfo.GetAscent();
923 break;
924 case 900 :
925 if ( bCenter )
926 nX += ( rRect.Width() - aFontSize.Height() ) / 2 + rTextPaintInfo.GetAscent();
927 nY += ( rRect.Height() + aFontSize.Width() ) / 2;
928 break;
929 case 2700 :
930 if ( bCenter )
931 nX += ( rRect.Width() + aFontSize.Height() ) / 2 - rTextPaintInfo.GetAscent();
932 nY += ( rRect.Height() - aFontSize.Width() ) / 2;
933 break;
934 }
935
936 Point aTmpPos( nX, nY );
937 rNonConstTextPaintInfo.SetPos( aTmpPos );
938 sal_uInt16 nOldWidth = rPor.Width();
939 const_cast<SwLinePortion&>(rPor).Width( o3tl::narrowing<sal_uInt16>(aFontSize.Width()) );
940 rTextPaintInfo.DrawText( aTmp, rPor );
941 const_cast<SwLinePortion&>(rPor).Width( nOldWidth );
942 rNonConstTextPaintInfo.SetFont( const_cast<SwFont*>(pOldFnt) );
943 rNonConstTextPaintInfo.SetPos( aOldPos );
944}
945
946void SwTextPaintInfo::DrawRect( const SwRect &rRect, bool bRetouche ) const
947{
948 if ( OnWin() || !bRetouche )
949 {
950 if( m_aTextFly.IsOn() )
951 const_cast<SwTextPaintInfo*>(this)->GetTextFly().
952 DrawFlyRect( m_pOut, rRect );
953 else
954 m_pOut->DrawRect( rRect.SVRect() );
955 }
956}
957
959{
960 if( !OnWin() )
961 return;
962
963 SwRect aRect;
964 CalcRect( rPor, &aRect );
965
966 if ( ! aRect.HasArea() )
967 return;
968
971
972 lcl_DrawSpecial( *this, rPor, aRect, NON_PRINTING_CHARACTER_COLOR, cChar, nOptions );
973}
974
976{
977 if( !OnWin() )
978 return;
979
981 if (rPor.IsBreakPortion())
982 {
983 const auto& rBreakPortion = static_cast<const SwBreakPortion&>(rPor);
984 eClear = rBreakPortion.GetClear();
985 }
986
987 sal_uInt16 nOldWidth = rPor.Width();
988 const_cast<SwLinePortion&>(rPor).Width( LINE_BREAK_WIDTH );
989
990 SwRect aRect;
991 CalcRect( rPor, &aRect );
992
993 if( aRect.HasArea() )
994 {
995 const sal_Unicode cChar = GetTextFrame()->IsRightToLeft() ?
997 const sal_uInt8 nOptions = 0;
998
999 SwRect aTextRect(aRect);
1000 if (eClear == SwLineBreakClear::LEFT || eClear == SwLineBreakClear::ALL)
1001 aTextRect.AddLeft(30);
1002 if (eClear == SwLineBreakClear::RIGHT || eClear == SwLineBreakClear::ALL)
1003 aTextRect.AddRight(-30);
1004 lcl_DrawSpecial( *this, rPor, aTextRect, NON_PRINTING_CHARACTER_COLOR, cChar, nOptions );
1005
1006 if (eClear != SwLineBreakClear::NONE)
1007 {
1008 // Paint indicator if this clear is left/right/all.
1010 m_pOut->SetLineColor(NON_PRINTING_CHARACTER_COLOR);
1011 if (eClear != SwLineBreakClear::RIGHT)
1012 m_pOut->DrawLine(aRect.BottomLeft(), aRect.TopLeft());
1013 if (eClear != SwLineBreakClear::LEFT)
1014 m_pOut->DrawLine(aRect.BottomRight(), aRect.TopRight());
1015 m_pOut->Pop();
1016 }
1017 }
1018
1019 const_cast<SwLinePortion&>(rPor).Width( nOldWidth );
1020}
1021
1023{
1025 SwRect aRect( static_cast<const SwArrowPortion&>(rPor).GetPos(), aSize );
1026 sal_Unicode cChar;
1027 if( static_cast<const SwArrowPortion&>(rPor).IsLeft() )
1028 {
1029 aRect.Pos().AdjustY(20 - GetAscent() );
1030 aRect.Pos().AdjustX(20 );
1031 if( aSize.Height() > rPor.Height() )
1032 aRect.Height( rPor.Height() );
1033 cChar = CHAR_LEFT_ARROW;
1034 }
1035 else
1036 {
1037 if( aSize.Height() > rPor.Height() )
1038 aRect.Height( rPor.Height() );
1039 aRect.Pos().AdjustY( -(aRect.Height() + 20) );
1040 aRect.Pos().AdjustX( -(aRect.Width() + 20) );
1041 cChar = CHAR_RIGHT_ARROW;
1042 }
1043
1044 if ( GetTextFrame()->IsVertical() )
1046
1047 if( aRect.HasArea() )
1048 {
1049 const sal_uInt8 nOptions = 0;
1050 lcl_DrawSpecial( *this, rPor, aRect, COL_LIGHTRED, cChar, nOptions );
1051 }
1052}
1053
1054void SwTextPaintInfo::DrawPostIts( bool bScript ) const
1055{
1056 if( !OnWin() || !m_pOpt->IsPostIts() )
1057 return;
1058
1059 Size aSize;
1060 Point aTmp;
1061
1062 const sal_uInt16 nPostItsWidth = SwViewOption::GetPostItsWidth( GetOut() );
1063 const sal_uInt16 nFontHeight = m_pFnt->GetHeight( m_pVsh, *GetOut() );
1064 const sal_uInt16 nFontAscent = m_pFnt->GetAscent( m_pVsh, *GetOut() );
1065
1066 switch ( m_pFnt->GetOrientation( GetTextFrame()->IsVertical() ).get() )
1067 {
1068 case 0 :
1069 aSize.setWidth( nPostItsWidth );
1070 aSize.setHeight( nFontHeight );
1071 aTmp.setX( m_aPos.X() );
1072 aTmp.setY( m_aPos.Y() - nFontAscent );
1073 break;
1074 case 900 :
1075 aSize.setHeight( nPostItsWidth );
1076 aSize.setWidth( nFontHeight );
1077 aTmp.setX( m_aPos.X() - nFontAscent );
1078 aTmp.setY( m_aPos.Y() );
1079 break;
1080 case 2700 :
1081 aSize.setHeight( nPostItsWidth );
1082 aSize.setWidth( nFontHeight );
1083 aTmp.setX( m_aPos.X() - nFontHeight +
1084 nFontAscent );
1085 aTmp.setY( m_aPos.Y() );
1086 break;
1087 }
1088
1089 SwRect aTmpRect( aTmp, aSize );
1090
1091 if ( GetTextFrame()->IsRightToLeft() )
1092 GetTextFrame()->SwitchLTRtoRTL( aTmpRect );
1093
1094 if ( GetTextFrame()->IsVertical() )
1096
1097 GetOpt().PaintPostIts( const_cast<OutputDevice*>(GetOut()), aTmpRect, bScript );
1098
1099}
1100
1101void SwTextPaintInfo::DrawCheckBox(const SwFieldFormCheckboxPortion &rPor, bool bChecked) const
1102{
1103 SwRect aIntersect;
1104 CalcRect( rPor, &aIntersect );
1105 if ( !aIntersect.HasArea() )
1106 return;
1107
1108 if (OnWin() && GetOpt().IsFieldShadings() &&
1109 !GetOpt().IsPagePreview())
1110 {
1111 OutputDevice* pOut = const_cast<OutputDevice*>(GetOut());
1113 pOut->SetFillColor( GetOpt().GetFieldShadingsColor() );
1114 pOut->SetLineColor();
1115 pOut->DrawRect( aIntersect.SVRect() );
1116 pOut->Pop();
1117 }
1118 const int delta=10;
1119 tools::Rectangle r(aIntersect.Left()+delta, aIntersect.Top()+delta, aIntersect.Right()-delta, aIntersect.Bottom()-delta);
1121 m_pOut->SetLineColor( Color(0, 0, 0));
1122 m_pOut->SetFillColor();
1123 m_pOut->DrawRect( r );
1124 if (bChecked)
1125 {
1126 m_pOut->DrawLine(r.TopLeft(), r.BottomRight());
1127 m_pOut->DrawLine(r.TopRight(), r.BottomLeft());
1128 }
1129 m_pOut->Pop();
1130}
1131
1132void SwTextPaintInfo::DrawBackground( const SwLinePortion &rPor, const Color *pColor ) const
1133{
1134 OSL_ENSURE( OnWin(), "SwTextPaintInfo::DrawBackground: printer pollution ?" );
1135
1136 SwRect aIntersect;
1137 CalcRect( rPor, nullptr, &aIntersect, true );
1138
1139 if ( !aIntersect.HasArea() )
1140 return;
1141
1142 OutputDevice* pOut = const_cast<OutputDevice*>(GetOut());
1144
1145 if ( pColor )
1146 pOut->SetFillColor( *pColor );
1147 else
1148 pOut->SetFillColor( GetOpt().GetFieldShadingsColor() );
1149
1150 pOut->SetLineColor();
1151
1152 DrawRect( aIntersect, true );
1153 pOut->Pop();
1154}
1155
1157{
1158 {
1159 SwRect aIntersect;
1160 CalcRect( rPor, &aIntersect, nullptr, true );
1161 if(aIntersect.HasArea())
1162 {
1163 SwPosition const aPosition(m_pFrame->MapViewToModelPos(GetIdx()));
1164 const ::sw::mark::IMark* pFieldmark =
1166 bool bIsStartMark = (TextFrameIndex(1) == GetLen()
1167 && CH_TXT_ATR_FIELDSTART == GetText()[sal_Int32(GetIdx())]);
1168 if(pFieldmark) {
1169 SAL_INFO("sw.core", "Found Fieldmark " << pFieldmark->ToString());
1170 }
1171 if(bIsStartMark)
1172 SAL_INFO("sw.core", "Found StartMark");
1173 if (OnWin() && (pFieldmark!=nullptr || bIsStartMark) &&
1174 GetOpt().IsFieldShadings() &&
1175 !GetOpt().IsPagePreview())
1176 {
1177 OutputDevice* pOutDev = const_cast<OutputDevice*>(GetOut());
1180 pOutDev->SetLineColor( );
1181 pOutDev->DrawRect( aIntersect.SVRect() );
1182 pOutDev->Pop();
1183 }
1184 }
1185 }
1186
1187 SwRect aIntersect;
1188 CalcRect( rPor, nullptr, &aIntersect, true );
1189
1190 if ( !aIntersect.HasArea() )
1191 return;
1192
1193 OutputDevice* pTmpOut = const_cast<OutputDevice*>(GetOut());
1194
1195 // #i16816# tagged pdf support
1196 SwTaggedPDFHelper aTaggedPDFHelper( nullptr, nullptr, nullptr, *pTmpOut );
1197
1198 Color aFillColor;
1199
1201 {
1202 aFillColor = m_pFnt->GetHighlightColor();
1203 }
1204 else
1205 {
1206 if( !m_pFnt->GetBackColor() )
1207 return;
1208 aFillColor = *m_pFnt->GetBackColor();
1209 }
1210
1211 // tdf#104349 do not highlight portions of space chars before end of line if the compatibility option is enabled
1212 // for LTR mode only
1213 if ( !GetTextFrame()->IsRightToLeft() )
1214 {
1215 if (GetTextFrame()->GetDoc().getIDocumentSettingAccess().get(DocumentSettingId::MS_WORD_COMP_TRAILING_BLANKS))
1216 {
1217 bool draw = false;
1218 bool full = false;
1219 const sal_Int32 nMaxLen = GetText().getLength();
1220 const sal_Int32 nCurrPorEnd(GetIdx() + rPor.GetLen());
1221 const SwLinePortion* pPos = &rPor;
1222 TextFrameIndex nIdx = GetIdx();
1223
1224 do
1225 {
1226 const sal_Int32 nEndPos = std::min(sal_Int32(nIdx + pPos->GetLen()), nMaxLen);
1227 for (sal_Int32 i = sal_Int32(nIdx); i < nEndPos; ++i)
1228 {
1229 if (i < nMaxLen && i >= nCurrPorEnd && GetText()[i] == CH_TXTATR_NEWLINE)
1230 goto drawcontinue;
1231
1232 if (i == nMaxLen || GetText()[i] != CH_BLANK)
1233 {
1234 draw = true;
1235 if (i >= nCurrPorEnd)
1236 {
1237 full = true;
1238 goto drawcontinue;
1239 }
1240 }
1241 }
1242 nIdx += pPos->GetLen();
1243 pPos = pPos->GetNextPortion();
1244 } while ( pPos );
1245
1246 drawcontinue:
1247
1248 if ( !draw )
1249 return;
1250
1251 if ( !full )
1252 {
1253 const sal_Int32 nLastPos = std::min(nCurrPorEnd, nMaxLen) - 1;
1254 for (sal_Int32 i = nLastPos; TextFrameIndex(i) >= GetIdx(); --i)
1255 {
1256 if (GetText()[i] == CH_TXTATR_NEWLINE)
1257 continue;
1258
1259 if (GetText()[i] != CH_BLANK)
1260 {
1261 const sal_uInt16 nOldWidth = rPor.Width();
1262 const sal_uInt16 nExcessWidth
1263 = GetTextSize(m_pOut, nullptr, GetText(), TextFrameIndex(i + 1),
1264 TextFrameIndex(nLastPos - i)).Width();
1265 const_cast<SwLinePortion&>(rPor).Width(nOldWidth - nExcessWidth);
1266 CalcRect( rPor, nullptr, &aIntersect, true );
1267 const_cast<SwLinePortion&>(rPor).Width( nOldWidth );
1268
1269 if ( !aIntersect.HasArea() )
1270 return;
1271
1272 break;
1273 }
1274 }
1275 }
1276 }
1277 }
1278
1280
1281 pTmpOut->SetFillColor(aFillColor);
1282 pTmpOut->SetLineColor();
1283
1284 DrawRect( aIntersect, false );
1285
1286 pTmpOut->Pop();
1287}
1288
1290{
1291 SwRect aDrawArea;
1292 CalcRect( rPor, &aDrawArea );
1293 if ( aDrawArea.HasArea() )
1294 {
1295 PaintCharacterBorder(*m_pFnt, aDrawArea, GetTextFrame()->IsVertical(),
1296 GetTextFrame()->IsVertLRBT(), rPor.GetJoinBorderWithPrev(),
1297 rPor.GetJoinBorderWithNext());
1298 }
1299}
1300
1301namespace {
1302
1303bool HasValidPropertyValue(const uno::Any& rAny)
1304{
1305 if (bool bValue; rAny >>= bValue)
1306 {
1307 return true;
1308 }
1309 else if (OUString aValue; (rAny >>= aValue) && !(aValue.isEmpty()))
1310 {
1311 return true;
1312 }
1313 else if (awt::FontSlant eValue; rAny >>= eValue)
1314 {
1315 return true;
1316 }
1317 else if (tools::Long nValueLong; rAny >>= nValueLong)
1318 {
1319 return true;
1320 }
1321 else if (double fValue; rAny >>= fValue)
1322 {
1323 return true;
1324 }
1325 else if (short nValueShort; rAny >>= nValueShort)
1326 {
1327 return true;
1328 }
1329 else
1330 return false;
1331}
1332}
1333
1335{
1336 // Don't use GetActiveView() as it does not work as expected when there are multiple open
1337 // documents.
1338 SwView* pView = SwTextFrame::GetView();
1339 if (!pView)
1340 return;
1341
1342 StylesHighlighterColorMap& rCharStylesColorMap = pView->GetStylesHighlighterCharColorMap();
1343
1344 if (rCharStylesColorMap.empty() && !pView->IsHighlightCharDF())
1345 return;
1346
1347 SwRect aRect;
1348 CalcRect(rPor, &aRect, nullptr, true);
1349 if(!aRect.HasArea())
1350 return;
1351
1352 SwTextFrame* pFrame = const_cast<SwTextFrame*>(GetTextFrame());
1353 if (!pFrame)
1354 return;
1355
1356 SwPosition aPosition(pFrame->MapViewToModelPos(GetIdx()));
1357 SwPosition aMarkPosition(pFrame->MapViewToModelPos(GetIdx() + GetLen()));
1358
1359 uno::Reference<text::XTextRange> xRange(
1360 SwXTextRange::CreateXTextRange(pFrame->GetDoc(), aPosition, &aMarkPosition));
1361 uno::Reference<beans::XPropertySet> xPropertiesSet(xRange, uno::UNO_QUERY_THROW);
1362
1363 OUString sCurrentCharStyle;
1364 xPropertiesSet->getPropertyValue("CharStyleName") >>= sCurrentCharStyle;
1365
1366 std::optional<OUString> sCSNumberOrDF; // CS number or "df" or not used
1367 std::optional<Color> aFillColor;
1368
1369 // check for CS formatting, if not CS formatted check for direct character formatting
1370 if (!sCurrentCharStyle.isEmpty())
1371 {
1372 if (!rCharStylesColorMap.empty())
1373 {
1374 OUString sCharStyleDisplayName;
1375 sCharStyleDisplayName = SwStyleNameMapper::GetUIName(sCurrentCharStyle,
1377 if (!sCharStyleDisplayName.isEmpty()
1378 && rCharStylesColorMap.find(sCharStyleDisplayName)
1379 != rCharStylesColorMap.end())
1380 {
1381 aFillColor = rCharStylesColorMap[sCharStyleDisplayName].first;
1382 sCSNumberOrDF = OUString::number(rCharStylesColorMap[sCharStyleDisplayName].second);
1383 }
1384 }
1385 }
1386 // not character style formatted
1387 else if (pView->IsHighlightCharDF())
1388 {
1389 const std::vector<OUString> aHiddenProperties{ UNO_NAME_RSID,
1403
1404 SfxItemPropertySet const& rPropSet(
1406 SfxItemPropertyMap const& rMap(rPropSet.getPropertyMap());
1407
1408
1409 uno::Reference<beans::XPropertyState> xPropertiesState(xRange, uno::UNO_QUERY_THROW);
1410 const uno::Sequence<beans::Property> aProperties
1411 = xPropertiesSet->getPropertySetInfo()->getProperties();
1412
1413 for (const beans::Property& rProperty : aProperties)
1414 {
1415 const OUString& rPropName = rProperty.Name;
1416
1417 if (!rMap.hasPropertyByName(rPropName))
1418 continue;
1419
1420 if (std::find(aHiddenProperties.begin(), aHiddenProperties.end(), rPropName)
1421 != aHiddenProperties.end())
1422 continue;
1423
1424 if (xPropertiesState->getPropertyState(rPropName) == beans::PropertyState_DIRECT_VALUE)
1425 {
1426 const uno::Any aAny = xPropertiesSet->getPropertyValue(rPropName);
1427 if (HasValidPropertyValue(aAny))
1428 {
1429 sCSNumberOrDF = SwResId(STR_CHARACTER_DIRECT_FORMATTING_TAG);
1430 aFillColor = COL_LIGHTGRAY;
1431 break;
1432 }
1433 }
1434 }
1435 }
1436 if (sCSNumberOrDF)
1437 {
1438 OutputDevice* pTmpOut = const_cast<OutputDevice*>(GetOut());
1441
1442 // draw a filled rectangle at the formatted CS or DF text
1443 pTmpOut->SetFillColor(aFillColor.value());
1444 pTmpOut->SetLineColor(aFillColor.value());
1445 tools::Rectangle aSVRect(aRect.SVRect());
1446 pTmpOut->DrawRect(aSVRect);
1447
1448 // calculate size and position for the CS number or "df" text and rectangle
1449 tools::Long nWidth = pTmpOut->GetTextWidth(sCSNumberOrDF.value());
1450 tools::Long nHeight = pTmpOut->GetTextHeight();
1451 aSVRect.SetSize(Size(nWidth, nHeight));
1452 aSVRect.Move(-(nWidth / 1.5), -(nHeight / 1.5));
1453
1454 vcl::Font aFont(pTmpOut->GetFont());
1455 aFont.SetOrientation(Degree10(0));
1456 pTmpOut->SetFont(aFont);
1457
1459 //pTmpOut->SetLayoutMode(vcl::text::ComplexTextLayoutFlags::BiDiStrong);
1460
1461 pTmpOut->SetTextFillColor(aFillColor.value());
1462 pTmpOut->DrawText(aSVRect, sCSNumberOrDF.value(), DrawTextFlags::NONE);
1463
1464 pTmpOut->Pop();
1465 }
1466}
1467
1469 PortionType nWhich, const Color *pColor ) const
1470{
1471 if( !OnWin() || IsMulti() )
1472 return;
1473
1474 bool bDraw = false;
1475 switch( nWhich )
1476 {
1480 case PortionType::Field:
1482 case PortionType::Tox:
1483 case PortionType::Ref:
1484 case PortionType::Meta:
1487 if ( !GetOpt().IsPagePreview()
1488 && !GetOpt().IsReadonly()
1489 && GetOpt().IsFieldShadings()
1490 && ( PortionType::Number != nWhich
1491 || m_pFrame->GetTextNodeForParaProps()->HasMarkedLabel())) // #i27615#
1492 {
1493 bDraw = PortionType::Footnote != nWhich || m_pFrame->IsFootnoteAllowed();
1494 }
1495 break;
1497 // no shading
1498 break;
1500 // input field shading also in read-only mode
1501 if ( !GetOpt().IsPagePreview()
1502 && GetOpt().IsFieldShadings() )
1503 {
1504 bDraw = true;
1505 }
1506 break;
1507 case PortionType::Tab:
1508 if ( GetOpt().IsTab() ) bDraw = true;
1509 break;
1511 if ( GetOpt().IsSoftHyph() )bDraw = true;
1512 break;
1513 case PortionType::Blank:
1514 if ( GetOpt().IsHardBlank())bDraw = true;
1515 break;
1516 default:
1517 {
1518 OSL_ENSURE( false, "SwTextPaintInfo::DrawViewOpt: don't know how to draw this" );
1519 break;
1520 }
1521 }
1522 if ( bDraw )
1523 DrawBackground( rPor, pColor );
1524}
1525
1527 sal_Int16 nMinLeading, sal_Int16 nMinTrailing,
1528 bool bNoCapsHyphenation, bool bNoLastWordHyphenation,
1529 sal_Int16 nMinWordLength, sal_Int16 nTextHyphZone )
1530{
1531 sal_Int32 nLen = rVals.getLength();
1532
1533 if (0 == nLen) // yet to be initialized?
1534 {
1535 rVals.realloc( 6 );
1536 PropertyValue *pVal = rVals.getArray();
1537
1538 pVal[0].Name = UPN_HYPH_MIN_LEADING;
1539 pVal[0].Handle = UPH_HYPH_MIN_LEADING;
1540 pVal[0].Value <<= nMinLeading;
1541
1542 pVal[1].Name = UPN_HYPH_MIN_TRAILING;
1543 pVal[1].Handle = UPH_HYPH_MIN_TRAILING;
1544 pVal[1].Value <<= nMinTrailing;
1545
1546 pVal[2].Name = UPN_HYPH_NO_CAPS;
1547 pVal[2].Handle = UPH_HYPH_NO_CAPS;
1548 pVal[2].Value <<= bNoCapsHyphenation;
1549
1550 pVal[3].Name = UPN_HYPH_NO_LAST_WORD;
1551 pVal[3].Handle = UPH_HYPH_NO_LAST_WORD;
1552 pVal[3].Value <<= bNoLastWordHyphenation;
1553
1554 pVal[4].Name = UPN_HYPH_MIN_WORD_LENGTH;
1555 pVal[4].Handle = UPH_HYPH_MIN_WORD_LENGTH;
1556 pVal[4].Value <<= nMinWordLength;
1557
1558 pVal[5].Name = UPN_HYPH_ZONE;
1559 pVal[5].Handle = UPH_HYPH_ZONE;
1560 pVal[5].Value <<= nTextHyphZone;
1561 }
1562 else if (6 == nLen) // already initialized once?
1563 {
1564 PropertyValue *pVal = rVals.getArray();
1565 pVal[0].Value <<= nMinLeading;
1566 pVal[1].Value <<= nMinTrailing;
1567 pVal[2].Value <<= bNoCapsHyphenation;
1568 pVal[3].Value <<= bNoLastWordHyphenation;
1569 pVal[4].Value <<= nMinWordLength;
1570 pVal[5].Value <<= nTextHyphZone;
1571 }
1572 else {
1573 OSL_FAIL( "unexpected size of sequence" );
1574 }
1575}
1576
1578{
1579 OSL_ENSURE( 6 == m_aHyphVals.getLength(),
1580 "hyphenation values not yet initialized" );
1581 return m_aHyphVals;
1582}
1583
1584bool SwTextFormatInfo::InitHyph( const bool bAutoHyphen )
1585{
1587 SetHanging( rAttrSet.GetHangingPunctuation().GetValue() );
1588 SetScriptSpace( rAttrSet.GetScriptSpace().GetValue() );
1589 SetForbiddenChars( rAttrSet.GetForbiddenRule().GetValue() );
1590 const SvxHyphenZoneItem &rAttr = rAttrSet.GetHyphenZone();
1591 MaxHyph() = rAttr.GetMaxHyphens();
1592 const bool bAuto = bAutoHyphen || rAttr.IsHyphen();
1593 if( bAuto || m_bInterHyph )
1594 {
1595 const sal_Int16 nMinimalLeading = std::max(rAttr.GetMinLead(), sal_uInt8(2));
1596 const sal_Int16 nMinimalTrailing = rAttr.GetMinTrail();
1597 const sal_Int16 nMinimalWordLength = rAttr.GetMinWordLength();
1598 const bool bNoCapsHyphenation = rAttr.IsNoCapsHyphenation();
1599 const bool bNoLastWordHyphenation = rAttr.IsNoLastWordHyphenation();
1600 const sal_Int16 nTextHyphZone = rAttr.GetTextHyphenZone();
1601 lcl_InitHyphValues( m_aHyphVals, nMinimalLeading, nMinimalTrailing,
1602 bNoCapsHyphenation, bNoLastWordHyphenation,
1603 nMinimalWordLength, nTextHyphZone );
1604 }
1605 return bAuto;
1606}
1607
1608void SwTextFormatInfo::CtorInitTextFormatInfo( OutputDevice* pRenderContext, SwTextFrame *pNewFrame, const bool bNewInterHyph,
1609 const bool bNewQuick, const bool bTst )
1610{
1611 CtorInitTextPaintInfo( pRenderContext, pNewFrame, SwRect() );
1612
1613 m_bQuick = bNewQuick;
1614 m_bInterHyph = bNewInterHyph;
1615
1618
1619 m_bIgnoreFly = false;
1620 m_bFakeLineStart = false;
1621 m_bShift = false;
1622 m_bDropInit = false;
1623 m_bTestFormat = bTst;
1624 m_nLeft = 0;
1625 m_nRight = 0;
1626 m_nFirst = 0;
1627 m_nRealWidth = 0;
1629 m_pRest = nullptr;
1630 m_nLineHeight = 0;
1631 m_nLineNetHeight = 0;
1633
1634 SvtCTLOptions::TextNumerals const nTextNumerals(
1635 SW_MOD()->GetCTLOptions().GetCTLTextNumerals());
1636 // cannot cache for NUMERALS_CONTEXT because we need to know the string
1637 // for the whole paragraph now
1638 if (nTextNumerals != SvtCTLOptions::NUMERALS_CONTEXT)
1639 {
1640 // set digit mode to what will be used later to get same results
1641 SwDigitModeModifier const m(*m_pRef, LANGUAGE_NONE /*dummy*/);
1642 assert(m_pRef->GetDigitLanguage() != LANGUAGE_NONE);
1644 }
1645
1646 Init();
1647}
1648
1657{
1658 if( !m_bInterHyph && !m_bAutoHyph )
1659 return false;
1660
1661 LanguageType eTmp = GetFont()->GetLanguage();
1662 // TODO: check for more ideographic langs w/o hyphenation as a concept
1663 if ( LANGUAGE_DONTKNOW == eTmp || LANGUAGE_NONE == eTmp
1664 || !MsLangId::usesHyphenation(eTmp) )
1665 return false;
1666
1667 uno::Reference< XHyphenator > xHyph = ::GetHyphenator();
1668 if (!xHyph.is())
1669 return false;
1670
1671 if (m_bInterHyph)
1672 SvxSpellWrapper::CheckHyphLang( xHyph, eTmp );
1673
1674 if (!xHyph->hasLocale(g_pBreakIt->GetLocale(eTmp)))
1675 {
1677 if (pShell)
1678 {
1679 pShell->AppendInfoBarWhenReady(
1680 "hyphenationmissing", SwResId(STR_HYPH_MISSING),
1681 SwResId(STR_HYPH_MISSING_DETAIL)
1682 .replaceFirst("%1", LanguageTag::convertToBcp47( g_pBreakIt->GetLocale(eTmp))),
1683 InfobarType::WARNING);
1684 }
1685 }
1686
1687 return xHyph->hasLocale( g_pBreakIt->GetLocale(eTmp) );
1688}
1689
1691{
1693 if( 1 >= pDrop->GetLines() ||
1694 ( !pDrop->GetChars() && !pDrop->GetWholeWord() ) )
1695 pDrop = nullptr;
1696 return pDrop;
1697}
1698
1700{
1701 // Not initialized: pRest, nLeft, nRight, nFirst, nRealWidth
1702 X(0);
1705
1706 // generally we do not allow number portions in follows, except...
1707 if ( GetTextFrame()->IsFollow() )
1708 {
1709 const SwTextFrame* pMaster = GetTextFrame()->FindMaster();
1710 OSL_ENSURE(pMaster, "pTextFrame without Master");
1711 const SwLinePortion* pTmpPara = pMaster ? pMaster->GetPara() : nullptr;
1712
1713 // there is a master for this follow and the master does not have
1714 // any contents (especially it does not have a number portion)
1715 m_bNumDone = ! pTmpPara ||
1716 ! static_cast<const SwParaPortion*>(pTmpPara)->GetFirstPortion()->IsFlyPortion();
1717 }
1718
1719 m_pRoot = nullptr;
1720 m_pLast = nullptr;
1721 m_pFly = nullptr;
1722 m_pLastTab = nullptr;
1723 m_pUnderflow = nullptr;
1724 m_cTabDecimal = 0;
1730 m_cHookChar = 0;
1733 SetPaintOfst(0);
1734}
1735
1736SwTextFormatInfo::SwTextFormatInfo(OutputDevice* pRenderContext, SwTextFrame *pFrame, const bool bInterHyphL,
1737 const bool bQuickL, const bool bTst)
1738{
1739 CtorInitTextFormatInfo(pRenderContext, pFrame, bInterHyphL, bQuickL, bTst);
1740}
1741
1751 SwLineLayout& rLay, SwTwips nActWidth ) :
1752 SwTextPaintInfo( rInf ),
1753 m_pRoot(&rLay),
1754 m_pLast(&rLay),
1755 m_pFly(nullptr),
1756 m_pUnderflow(nullptr),
1757 m_pRest(nullptr),
1758 m_pLastTab(nullptr),
1759 m_nSoftHyphPos(TextFrameIndex(0)),
1760 m_nLineStart(rInf.GetIdx()),
1761 m_nUnderScorePos(TextFrameIndex(COMPLETE_STRING)),
1762 m_nLeft(rInf.m_nLeft),
1763 m_nRight(rInf.m_nRight),
1764 m_nFirst(rInf.m_nLeft),
1765 m_nRealWidth(sal_uInt16(nActWidth)),
1766 m_nWidth(m_nRealWidth),
1767 m_nLineHeight(0),
1768 m_nLineNetHeight(0),
1769 m_nForcedLeftMargin(0),
1770 m_bFull(false),
1771 m_bFootnoteDone(true),
1772 m_bErgoDone(true),
1773 m_bNumDone(true),
1774 m_bArrowDone(true),
1775 m_bStop(false),
1776 m_bNewLine(true),
1777 m_bShift(false),
1778 m_bUnderflow(false),
1779 m_bInterHyph(false),
1780 m_bAutoHyph(false),
1781 m_bDropInit(false),
1782 m_bQuick(rInf.m_bQuick),
1783 m_bNoEndHyph(false),
1784 m_bNoMidHyph(false),
1785 m_bIgnoreFly(false),
1786 m_bFakeLineStart(false),
1787 m_bTabOverflow( false ),
1788 m_bTestFormat(rInf.m_bTestFormat),
1789 m_cTabDecimal(0),
1790 m_cHookChar(0),
1791 m_nMaxHyph(0)
1792{
1793 SetMulti( true );
1794 SetFirstMulti( rInf.IsFirstMulti() );
1795}
1796
1798{
1799 const sal_uInt16 nHeight = pCurr->GetRealHeight();
1800 for( SwLinePortion *pPor = pCurr->GetNextPortion(); pPor; pPor = pPor->GetNextPortion() )
1801 {
1802 if( pPor->IsFootnotePortion() && nHeight > static_cast<SwFootnotePortion*>(pPor)->Orig() )
1803 {
1804 SetLineHeight( nHeight );
1805 SetLineNetHeight( pCurr->Height() );
1806 return true;
1807 }
1808 }
1809 return false;
1810}
1811
1813 TextFrameIndex const nEnd)
1814{
1815 m_cHookChar = 0;
1816 TextFrameIndex i = nStart;
1817
1818 // Used for decimal tab handling:
1819 const sal_Unicode cTabDec = GetLastTab() ? GetTabDecimal() : 0;
1820 const sal_Unicode cThousandSep = ',' == cTabDec ? '.' : ',';
1821
1822 // #i45951# German (Switzerland) uses ' as thousand separator
1823 const sal_Unicode cThousandSep2 = ',' == cTabDec ? '.' : '\'';
1824
1825 bool bNumFound = false;
1827
1828 for( ; i < nEnd; ++i )
1829 {
1830 const sal_Unicode cPos = GetChar( i );
1831 switch( cPos )
1832 {
1834 case CH_TXTATR_INWORD:
1835 if( !HasHint( i ))
1836 break;
1837 [[fallthrough]];
1838
1839 case CHAR_SOFTHYPHEN:
1840 case CHAR_HARDHYPHEN:
1841 case CHAR_HARDBLANK:
1842 case CH_TAB:
1843 case CH_BREAK:
1844 case CHAR_ZWSP :
1845 case CHAR_WJ :
1846 m_cHookChar = cPos;
1847 return i;
1848
1849 case CHAR_UNDERSCORE:
1852 break;
1853
1854 default:
1855 if ( cTabDec )
1856 {
1857 if( cTabDec == cPos )
1858 {
1859 OSL_ENSURE( cPos, "Unexpected end of string" );
1860 if( cPos ) // robust
1861 {
1862 m_cHookChar = cPos;
1863 return i;
1864 }
1865 }
1866
1867 // Compatibility: First non-digit character behind a
1868 // a digit character becomes the hook character
1869 if ( bTabCompat )
1870 {
1871 if ( ( 0x2F < cPos && cPos < 0x3A ) ||
1872 ( bNumFound && ( cPos == cThousandSep || cPos == cThousandSep2 ) ) )
1873 {
1874 bNumFound = true;
1875 }
1876 else
1877 {
1878 if ( bNumFound )
1879 {
1880 m_cHookChar = cPos;
1881 SetTabDecimal( cPos );
1882 return i;
1883 }
1884 }
1885 }
1886 }
1887 }
1888 }
1889
1890 // Check if character *behind* the portion has
1891 // to become the hook:
1892 if (i == nEnd && i < TextFrameIndex(GetText().getLength()) && bNumFound)
1893 {
1894 const sal_Unicode cPos = GetChar( i );
1895 if ( cPos != cTabDec && cPos != cThousandSep && cPos !=cThousandSep2 && ( 0x2F >= cPos || cPos >= 0x3A ) )
1896 {
1897 m_cHookChar = GetChar( i );
1899 }
1900 }
1901
1902 return i;
1903}
1904
1906{
1907 if( GetLast() )
1908 {
1909 if( GetLast()->IsKernPortion() )
1910 return true;
1911 if( GetLast()->Width() || ( GetLast()->GetLen() &&
1912 !GetLast()->IsHolePortion() ) )
1913 return false;
1914 }
1915 SwLinePortion* pPor = GetRoot();
1916 SwLinePortion *pKern = nullptr;
1917 while( pPor )
1918 {
1919 if( pPor->IsKernPortion() )
1920 pKern = pPor;
1921 else if( pPor->Width() || ( pPor->GetLen() && !pPor->IsHolePortion() ) )
1922 pKern = nullptr;
1923 pPor = pPor->GetNextPortion();
1924 }
1925 if( pKern )
1926 {
1927 SetLast( pKern );
1928 return true;
1929 }
1930 return false;
1931}
1932
1934{
1935 SwTwips nLineWidth = Width() - X();
1936
1937 const bool bTabOverMargin = GetTextFrame()->GetDoc().getIDocumentSettingAccess().get(
1939 const bool bTabOverSpacing = GetTextFrame()->GetDoc().getIDocumentSettingAccess().get(
1941 if (!bTabOverMargin && !bTabOverSpacing)
1942 return nLineWidth;
1943
1944 SwTabPortion* pLastTab = GetLastTab();
1945 if (!pLastTab)
1946 return nLineWidth;
1947
1948 // Consider tab portions over the printing bounds of the text frame.
1949 if (pLastTab->GetTabPos() <= Width())
1950 return nLineWidth;
1951
1952 // Calculate the width that starts at the left (or in case of first line:
1953 // first) margin, but ends after the right paragraph margin:
1954 //
1955 // +--------------------+
1956 // |LL| |RR|
1957 // +--------------------+
1958 // ^ m_nLeftMargin (absolute)
1959 // ^ nLeftMarginWidth (relative to m_nLeftMargin), X() is relative to this
1960 // ^ right margin
1961 // ^ paragraph right
1962 // <--------------------> is GetTextFrame()->getFrameArea().Width()
1963 // <--------------> is Width()
1964 // <-----------------> is what we need to be able to compare to X() (nTextFrameWidth)
1965 SwTwips nLeftMarginWidth = m_nLeftMargin - GetTextFrame()->getFrameArea().Left();
1966 SwTwips nTextFrameWidth = GetTextFrame()->getFrameArea().Width() - nLeftMarginWidth;
1967
1968 // If there is one such tab portion, then text is allowed to use the full
1969 // text frame area to the right (RR above, but not LL).
1970 nLineWidth = nTextFrameWidth - X();
1971
1972 if (!bTabOverMargin) // thus bTabOverSpacing only
1973 {
1974 // right, center, decimal can back-fill all the available space - same as TabOverMargin
1975 if (pLastTab->GetWhichPor() == PortionType::TabLeft)
1976 nLineWidth = nTextFrameWidth - pLastTab->GetTabPos();
1977 }
1978 return nLineWidth;
1979}
1980
1982 const SwTextSizeInfo *pNew,
1983 const SwLinePortion *pPor,
1984 bool bTextLen,
1985 bool bExgLists,
1986 OUString const & rCh )
1987 : pOldText(nullptr)
1988 , m_pOldSmartTagList(nullptr)
1989 , m_pOldGrammarCheckList(nullptr)
1990 , nIdx(0)
1991 , nLen(0)
1992 , nMeasureLen(0)
1993 , pInf(nullptr)
1994{
1995 if( rCh.isEmpty() )
1996 {
1997 bOn = pPor->GetExpText( *pNew, aText );
1998 }
1999 else
2000 {
2001 aText = rCh;
2002 bOn = true;
2003 }
2004
2005 // The text is replaced ...
2006 if( !bOn )
2007 return;
2008
2009 pInf = const_cast<SwTextSizeInfo*>(pNew);
2010 nIdx = pInf->GetIdx();
2011 nLen = pInf->GetLen();
2013 pOldText = &(pInf->GetText());
2015 pInf->SetText( aText );
2017 pInf->SetLen(bTextLen ? TextFrameIndex(pInf->GetText().getLength()) : pPor->GetLen());
2020
2021 pInf->SetCachedVclData(nullptr);
2022
2023 // ST2
2024 if ( !bExgLists )
2025 return;
2026
2027 m_pOldSmartTagList = static_cast<SwTextPaintInfo*>(pInf)->GetSmartTags();
2029 {
2030 std::pair<SwTextNode const*, sal_Int32> pos(pNew->GetTextFrame()->MapViewToModel(nIdx));
2031 SwWrongList const*const pSmartTags(pos.first->GetSmartTags());
2032 if (pSmartTags)
2033 {
2034 const sal_uInt16 nPos = pSmartTags->GetWrongPos(pos.second);
2035 const sal_Int32 nListPos = pSmartTags->Pos(nPos);
2036 if (nListPos == pos.second && pSmartTags->SubList(nPos) != nullptr)
2037 {
2038 m_pTempIter.reset(new sw::WrongListIterator(*pSmartTags->SubList(nPos)));
2039 static_cast<SwTextPaintInfo*>(pInf)->SetSmartTags(m_pTempIter.get());
2040 }
2041 else if (!m_pTempList && nPos < pSmartTags->Count()
2042 && nListPos < pos.second && !aText.isEmpty())
2043 {
2045 m_pTempList->Insert( OUString(), nullptr, 0, aText.getLength(), 0 );
2047 static_cast<SwTextPaintInfo*>(pInf)->SetSmartTags(m_pTempIter.get());
2048 }
2049 else
2050 static_cast<SwTextPaintInfo*>(pInf)->SetSmartTags(nullptr);
2051 }
2052 else
2053 static_cast<SwTextPaintInfo*>(pInf)->SetSmartTags(nullptr);
2054 }
2055 m_pOldGrammarCheckList = static_cast<SwTextPaintInfo*>(pInf)->GetGrammarCheckList();
2057 return;
2058
2059 std::pair<SwTextNode const*, sal_Int32> pos(pNew->GetTextFrame()->MapViewToModel(nIdx));
2060 SwWrongList const*const pGrammar(pos.first->GetGrammarCheck());
2061 if (pGrammar)
2062 {
2063 const sal_uInt16 nPos = pGrammar->GetWrongPos(pos.second);
2064 const sal_Int32 nListPos = pGrammar->Pos(nPos);
2065 if (nListPos == pos.second && pGrammar->SubList(nPos) != nullptr)
2066 {
2067 m_pTempIter.reset(new sw::WrongListIterator(*pGrammar->SubList(nPos)));
2068 static_cast<SwTextPaintInfo*>(pInf)->SetGrammarCheckList(m_pTempIter.get());
2069 }
2070 else if (!m_pTempList && nPos < pGrammar->Count()
2071 && nListPos < pos.second && !aText.isEmpty())
2072 {
2074 m_pTempList->Insert( OUString(), nullptr, 0, aText.getLength(), 0 );
2076 static_cast<SwTextPaintInfo*>(pInf)->SetGrammarCheckList(m_pTempIter.get());
2077 }
2078 else
2079 static_cast<SwTextPaintInfo*>(pInf)->SetGrammarCheckList(nullptr);
2080 }
2081 else
2082 static_cast<SwTextPaintInfo*>(pInf)->SetGrammarCheckList(nullptr);
2083}
2084
2086{
2087 if( !bOn )
2088 return;
2089
2091 pInf->SetText( *pOldText );
2092 pInf->SetIdx( nIdx );
2093 pInf->SetLen( nLen );
2095
2096 // ST2
2097 // Restore old smart tag list
2099 static_cast<SwTextPaintInfo*>(pInf)->SetSmartTags(m_pOldSmartTagList);
2101 static_cast<SwTextPaintInfo*>(pInf)->SetGrammarCheckList(m_pOldGrammarCheckList);
2102}
2103
2105 SwAttrIter* pItr)
2106 : pInf(nullptr)
2107 , pFnt(pNew ? const_cast<SwTextSizeInfo&>(rInf).GetFont() : nullptr)
2108 , pIter(nullptr)
2109{
2110 if( !pFnt )
2111 return;
2112
2113 pInf = &const_cast<SwTextSizeInfo&>(rInf);
2114 // In these cases we temporarily switch to the new font:
2115 // 1. the fonts have a different magic number
2116 // 2. they have different script types
2117 // 3. their background colors differ (this is not covered by 1.)
2118 if( pFnt->DifferentFontCacheId( pNew, pFnt->GetActual() ) ||
2119 pNew->GetActual() != pFnt->GetActual() ||
2120 ( ! pNew->GetBackColor() && pFnt->GetBackColor() ) ||
2121 ( pNew->GetBackColor() && ! pFnt->GetBackColor() ) ||
2122 ( pNew->GetBackColor() && pFnt->GetBackColor() &&
2123 ( *pNew->GetBackColor() != *pFnt->GetBackColor() ) ) )
2124 {
2125 pNew->SetTransparent( true );
2126 pNew->SetAlign( ALIGN_BASELINE );
2127 pInf->SetFont( pNew );
2128 }
2129 else
2130 pFnt = nullptr;
2131 pNew->Invalidate();
2132 pNew->ChgPhysFnt( pInf->GetVsh(), *pInf->GetOut() );
2133 if( pItr && pItr->GetFnt() == pFnt )
2134 {
2135 pIter = pItr;
2136 pIter->SetFnt( pNew );
2137 }
2138}
2139
2141{
2142 if( pFnt )
2143 {
2144 // Reset SwFont
2145 pFnt->Invalidate();
2146 pInf->SetFont( pFnt );
2147 if( pIter )
2148 {
2149 pIter->SetFnt( pFnt );
2151 }
2152 }
2153}
2154
2155bool SwTextFormatInfo::ChgHyph( const bool bNew )
2156{
2157 const bool bOld = m_bAutoHyph;
2158 if( m_bAutoHyph != bNew )
2159 {
2160 m_bAutoHyph = bNew;
2161 InitHyph( bNew );
2162 // Set language in the Hyphenator
2163 if( m_pFnt )
2165 }
2166 return bOld;
2167}
2168
2169
2171{
2172 if (m_nLastBookmarkPos != GetIdx())
2173 {
2175 return true;
2176 }
2177 else
2178 {
2179 return false;
2180 }
2181}
2182
2183/* 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
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
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:738
const SwAttrSet & GetSwAttrSet() const
Does node has already its own auto-attributes? Access to SwAttrSet.
Definition: node.hxx:765
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:1367
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:2104
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:1949
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:239
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:323
void CtorInitTextFly(const SwTextFrame *pFrame)
Definition: txtfly.cxx:356
void DrawTextOpaque(SwDrawTextInfo &rInf)
This method is called by DrawText().
Definition: txtfly.cxx:449
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:1608
SwLineLayout * GetRoot()
Definition: inftxt.hxx:562
const SwFormatDrop * GetDropFormat() const
Definition: inftxt.cxx:1690
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:1584
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:1797
bool LastKernPortion()
Definition: inftxt.cxx:1905
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:1812
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:1656
bool CheckCurrentPosBookmark()
Definition: inftxt.cxx:2170
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:1933
bool m_bFakeLineStart
Definition: inftxt.hxx:508
const css::beans::PropertyValues & GetHyphValues() const
Definition: inftxt.cxx:1577
SwTextFormatInfo(OutputDevice *pRenderContext, SwTextFrame *pFrame, const bool bInterHyphL=false, const bool bQuickL=false, const bool bTst=false)
Definition: inftxt.cxx:1736
SwLinePortion * m_pLast
Definition: inftxt.hxx:469
bool ChgHyph(const bool bNew)
Definition: inftxt.cxx:2155
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:1246
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:1231
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:4340
void SwitchRTLtoLTR(SwRect &rRect) const
Calculates the coordinates of a rectangle when switching from RTL to LTR layout.
Definition: txtfrm.hxx:750
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:1852
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:1293
SwTextNode const * GetTextNodeForParaProps() const
Definition: txtfrm.cxx:1303
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:4689
bool HasMarkedLabel() const
Returns if this text node has a marked label.
Definition: ndtxt.cxx:2993
void DrawCSDFHighlighting(const SwLinePortion &rPor) const
Definition: inftxt.cxx:1334
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:958
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:1132
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:733
SwRect m_aPaintRect
Definition: inftxt.hxx:351
void DrawRect(const SwRect &rRect, bool bRetouche) const
Definition: inftxt.cxx:946
void DrawBackBrush(const SwLinePortion &rPor) const
Definition: inftxt.cxx:1156
std::vector< tools::Long > * m_pSpaceAdd
Definition: inftxt.hxx:347
void DrawPostIts(bool bScript) const
Definition: inftxt.cxx:1054
void DrawViewOpt(const SwLinePortion &rPor, PortionType nWhich, const Color *pColor=nullptr) const
Definition: inftxt.cxx:1468
void DrawCheckBox(const SwFieldFormCheckboxPortion &rPor, bool bChecked) const
Definition: inftxt.cxx:1101
void DrawRedArrow(const SwLinePortion &rPor) const
Definition: inftxt.cxx:1022
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:1289
void DrawLineBreak(const SwLinePortion &rPor) const
Definition: inftxt.cxx:975
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:580
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:1981
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:1083
bool IsPagePreview() const
Definition: viewopt.hxx:801
bool IsBlank(bool bHard=false) const
Definition: viewopt.hxx:353
void PaintPostIts(OutputDevice *pOut, const SwRect &rRect, bool bIsScript) const
Definition: viewopt.cxx:221
bool IsPostIts() const
Definition: viewopt.hxx:427
const Color & GetFieldShadingsColor() const
Definition: viewopt.cxx:528
bool IsOnlineSpell() const
Definition: viewopt.hxx:539
static sal_uInt16 GetPostItsWidth(const OutputDevice *pOut)
Definition: viewopt.cxx:215
vcl::RenderContext * GetOut() const
Definition: viewsh.hxx:364
const SwViewOption * GetViewOptions() const
Definition: viewsh.hxx:451
bool isOutputToWindow() const
Definition: viewsh.cxx:138
vcl::Window * GetWin() const
Definition: viewsh.hxx:363
vcl::RenderContext & GetRefDev() const
Definition: viewsh.cxx:2154
Definition: view.hxx:146
bool IsHighlightCharDF()
Definition: view.hxx:712
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:1201
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:1133
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:5021
#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:836
#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:1526
#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:1385
Count
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:256
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
constexpr OUStringLiteral UNO_NAME_SORTED_TEXT_ID
Definition: unoprnms.hxx:415
constexpr OUStringLiteral UNO_NAME_PARA_IS_NUMBERING_RESTART
Definition: unoprnms.hxx:518
constexpr OUStringLiteral UNO_NAME_CHAR_COLOR_THEME
constexpr OUStringLiteral UNO_NAME_NUMBERING_IS_NUMBER
Definition: unoprnms.hxx:165
constexpr OUStringLiteral UNO_NAME_PARA_CONDITIONAL_STYLE_NAME
Definition: unoprnms.hxx:489
constexpr OUStringLiteral UNO_NAME_PARA_STYLE_NAME
Definition: unoprnms.hxx:189
constexpr OUStringLiteral UNO_NAME_CHAR_COLOR_TINT_OR_SHADE
constexpr OUStringLiteral UNO_NAME_RSID
Definition: unoprnms.hxx:849
constexpr OUStringLiteral UNO_NAME_NUMBERING_LEVEL
constexpr OUStringLiteral UNO_NAME_PAGE_STYLE_NAME
Definition: unoprnms.hxx:185
constexpr OUStringLiteral UNO_NAME_NUMBERING_START_VALUE
Definition: unoprnms.hxx:164
constexpr OUStringLiteral UNO_NAME_PARA_CONTINUEING_PREVIOUS_SUB_TREE
Definition: unoprnms.hxx:833
constexpr OUStringLiteral UNO_NAME_PARRSID
Definition: unoprnms.hxx:850
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