LibreOffice Module sw (master) 1
porfld.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 <hintids.hxx>
21
22#include <com/sun/star/i18n/ScriptType.hpp>
23#include <com/sun/star/i18n/XBreakIterator.hpp>
24#include <utility>
25#include <vcl/graph.hxx>
26#include <editeng/brushitem.hxx>
27#include <vcl/metric.hxx>
28#include <vcl/outdev.hxx>
29#include <viewopt.hxx>
30#include <SwPortionHandler.hxx>
31#include "porlay.hxx"
32#include "porfld.hxx"
33#include "inftxt.hxx"
34#include <fmtornt.hxx>
35#include <frmatr.hxx>
36#include <frmtool.hxx>
37#include <viewsh.hxx>
38#include <doc.hxx>
40#include <rootfrm.hxx>
41#include <breakit.hxx>
42#include "porftn.hxx"
43#include <accessibilityoptions.hxx>
44#include <editeng/lrspitem.hxx>
45#include <unicode/ubidi.h>
46#include <bookmark.hxx>
47
48using namespace ::com::sun::star;
49
51{ return (GetLen() || !m_aExpand.isEmpty() || SwLinePortion::Compress()) ? this : nullptr; }
52
53SwFieldPortion *SwFieldPortion::Clone( const OUString &rExpand ) const
54{
55 std::unique_ptr<SwFont> pNewFnt;
56 if( m_pFont )
57 {
58 pNewFnt.reset(new SwFont( *m_pFont ));
59 }
60 // #i107143#
61 // pass placeholder property to created <SwFieldPortion> instance.
62 SwFieldPortion* pClone = new SwFieldPortion( rExpand, std::move(pNewFnt), m_bPlaceHolder );
64 pClone->m_bNoLength = m_bNoLength;
65 return pClone;
66}
67
69{
70 OSL_ENSURE( pField, "TakeNextOffset: Missing Source" );
71 m_nNextOffset = pField->GetNextOffset();
72 m_aExpand = m_aExpand.replaceAt(0, sal_Int32(m_nNextOffset), u"");
73 m_bFollow = true;
74}
75
76SwFieldPortion::SwFieldPortion(OUString aExpand, std::unique_ptr<SwFont> pFont, bool bPlaceHold, TextFrameIndex const nFieldLen)
77 : m_aExpand(std::move(aExpand)), m_pFont(std::move(pFont)), m_nNextOffset(0)
78 , m_nNextScriptChg(COMPLETE_STRING), m_nFieldLen(nFieldLen), m_nViewWidth(0)
79 , m_bFollow( false ), m_bLeft( false), m_bHide( false)
80 , m_bCenter (false), m_bHasFollow( false )
81 , m_bAnimated( false), m_bNoPaint( false)
82 , m_bReplace( false), m_bPlaceHolder( bPlaceHold )
83 , m_bNoLength( false )
84 , m_nAttrFieldType(0)
85{
87}
88
90 : SwExpandPortion( rField )
91 , m_aExpand( rField.GetExp() )
92 , m_nNextOffset( rField.GetNextOffset() )
93 , m_nNextScriptChg( rField.m_nNextScriptChg )
94 , m_nFieldLen(rField.m_nFieldLen)
95 , m_nViewWidth( rField.m_nViewWidth )
96 , m_bFollow( rField.IsFollow() )
97 , m_bLeft( rField.IsLeft() )
98 , m_bHide( rField.IsHide() )
99 , m_bCenter( rField.IsCenter() )
100 , m_bHasFollow( rField.HasFollow() )
101 , m_bAnimated ( rField.m_bAnimated )
102 , m_bNoPaint( rField.m_bNoPaint)
103 , m_bReplace( rField.m_bReplace )
104 , m_bPlaceHolder( rField.m_bPlaceHolder )
105 , m_bNoLength( rField.m_bNoLength )
106 , m_nAttrFieldType( rField.m_nAttrFieldType)
107{
108 if ( rField.HasFont() )
109 m_pFont.reset( new SwFont( *rField.GetFont() ) );
110
112}
113
115{
116 m_pFont.reset();
117}
118
119sal_uInt16 SwFieldPortion::GetViewWidth( const SwTextSizeInfo &rInf ) const
120{
121 // even though this is const, nViewWidth should be computed at the very end:
122 SwFieldPortion* pThis = const_cast<SwFieldPortion*>(this);
123 if( !Width() && rInf.OnWin() && !rInf.GetOpt().IsPagePreview() &&
124 !rInf.GetOpt().IsReadonly() && rInf.GetOpt().IsFieldShadings() )
125 {
126 if( !m_nViewWidth )
127 pThis->m_nViewWidth = rInf.GetTextSize(OUString(' ')).Width();
128 }
129 else
130 pThis->m_nViewWidth = 0;
131 return m_nViewWidth;
132}
133
134namespace {
135
139class SwFieldSlot
140{
141 std::shared_ptr<const vcl::text::TextLayoutCache> m_pOldCachedVclData;
142 const OUString *pOldText;
143 OUString aText;
144 TextFrameIndex nIdx;
145 TextFrameIndex nLen;
146 SwTextFormatInfo *pInf;
147 bool bOn;
148public:
149 SwFieldSlot( const SwTextFormatInfo* pNew, const SwFieldPortion *pPor );
150 ~SwFieldSlot();
151};
152
153}
154
155SwFieldSlot::SwFieldSlot( const SwTextFormatInfo* pNew, const SwFieldPortion *pPor )
156 : pOldText(nullptr)
157 , nIdx(0)
158 , nLen(0)
159 , pInf(nullptr)
160{
161 bOn = pPor->GetExpText( *pNew, aText );
162
163 // The text will be replaced ...
164 if( !bOn )
165 return;
166
167 pInf = const_cast<SwTextFormatInfo*>(pNew);
168 nIdx = pInf->GetIdx();
169 nLen = pInf->GetLen();
170 pOldText = &(pInf->GetText());
171 m_pOldCachedVclData = pInf->GetCachedVclData();
172 pInf->SetLen(TextFrameIndex(aText.getLength()));
173 pInf->SetCachedVclData(nullptr);
174 if( pPor->IsFollow() )
175 {
176 pInf->SetFakeLineStart( nIdx > pInf->GetLineStart() );
177 pInf->SetIdx(TextFrameIndex(0));
178 }
179 else
180 {
181 TextFrameIndex nEnd(pOldText->getLength());
182 if (nIdx < nEnd)
183 {
184 sal_Int32 const nFieldLen(pPor->GetFieldLen());
185 aText = (*pOldText).replaceAt(sal_Int32(nIdx), nFieldLen, aText);
186 }
187 else if (nIdx == nEnd)
188 aText = *pOldText + aText;
189 else
190 SAL_WARN("sw.core", "SwFieldSlot bad SwFieldPortion index.");
191 }
192 pInf->SetText( aText );
193}
194
195SwFieldSlot::~SwFieldSlot()
196{
197 if( bOn )
198 {
199 pInf->SetCachedVclData(m_pOldCachedVclData);
200 pInf->SetText( *pOldText );
201 pInf->SetIdx( nIdx );
202 pInf->SetLen( nLen );
203 pInf->SetFakeLineStart( false );
204 }
205}
206
208{
209 OUString aText;
210 if (!GetExpText(rInf, aText) || aText.isEmpty())
211 return;
212
213 SwFontScript nActual = m_pFont ? m_pFont->GetActual() : rInf.GetFont()->GetActual();
214 sal_uInt16 nScript = g_pBreakIt->GetBreakIter()->getScriptType( aText, 0 );
215 sal_Int32 nChg = 0;
216 if( i18n::ScriptType::WEAK == nScript )
217 {
218 nChg = g_pBreakIt->GetBreakIter()->endOfScript(aText,0,nScript);
219 if (nChg < aText.getLength() && nChg >= 0)
220 nScript = g_pBreakIt->GetBreakIter()->getScriptType( aText, nChg );
221 }
222
223 // nNextScriptChg will be evaluated during SwFieldPortion::Format()
224
225 if (nChg < aText.getLength() && nChg >= 0)
227 g_pBreakIt->GetBreakIter()->endOfScript(aText, nChg, nScript));
228 else
229 m_nNextScriptChg = TextFrameIndex(aText.getLength());
230
231 SwFontScript nTmp;
232 switch ( nScript ) {
233 case i18n::ScriptType::LATIN : nTmp = SwFontScript::Latin; break;
234 case i18n::ScriptType::ASIAN : nTmp = SwFontScript::CJK; break;
235 case i18n::ScriptType::COMPLEX : nTmp = SwFontScript::CTL; break;
236 default: nTmp = nActual;
237 }
238
239 // #i16354# Change script type for RTL text to CTL.
240 const SwScriptInfo& rSI = rInf.GetParaPortion()->GetScriptInfo();
241 // #i98418#
242 const sal_uInt8 nFieldDir = (IsNumberPortion() || IsFootnoteNumPortion())
243 ? rSI.GetDefaultDir()
244 : rSI.DirType(IsFollow() ? rInf.GetIdx() - m_nFieldLen : rInf.GetIdx());
245
246 {
247 UErrorCode nError = U_ZERO_ERROR;
248 UBiDi* pBidi = ubidi_openSized( aText.getLength(), 0, &nError );
249 ubidi_setPara( pBidi, reinterpret_cast<const UChar *>(aText.getStr()), aText.getLength(), nFieldDir, nullptr, &nError );
250 int32_t nEnd;
251 UBiDiLevel nCurrDir;
252 ubidi_getLogicalRun( pBidi, 0, &nEnd, &nCurrDir );
253 ubidi_close( pBidi );
254 const TextFrameIndex nNextDirChg(nEnd);
256
257 // #i89825# change the script type also to CTL
258 // if there is no strong LTR char in the LTR run (numbers)
259 if (nCurrDir != UBIDI_RTL &&
260 (UBIDI_LTR != nFieldDir || i18n::ScriptType::COMPLEX == nScript))
261 {
262 nCurrDir = UBIDI_RTL;
263 for( sal_Int32 nCharIdx = 0; nCharIdx < nEnd; ++nCharIdx )
264 {
265 UCharDirection nCharDir = u_charDirection ( aText[ nCharIdx ]);
266 if ( nCharDir == U_LEFT_TO_RIGHT ||
267 nCharDir == U_LEFT_TO_RIGHT_EMBEDDING ||
268 nCharDir == U_LEFT_TO_RIGHT_OVERRIDE )
269 {
270 nCurrDir = UBIDI_LTR;
271 break;
272 }
273 }
274 }
275
276 if (nCurrDir == UBIDI_RTL)
277 {
278 nTmp = SwFontScript::CTL;
279 // If we decided that this range was RTL after all and the
280 // previous range was complex but clipped to the start of this
281 // range, then extend it to be complex over the additional RTL range
282 if (nScript == i18n::ScriptType::COMPLEX)
283 m_nNextScriptChg = nNextDirChg;
284 }
285 }
286
287 // #i98418#
288 // keep determined script type for footnote portions as preferred script type.
289 // For footnote portions a font can not be created directly - see footnote
290 // portion format method.
291 if ( IsFootnotePortion() )
292 {
293 static_cast<SwFootnotePortion*>(this)->SetPreferredScriptType( nTmp );
294 }
295 else if ( nTmp != nActual )
296 {
297 if( !m_pFont )
298 m_pFont.reset( new SwFont( *rInf.GetFont() ) );
299 m_pFont->SetActual( nTmp );
300 }
301
302}
303
305{
306 // Scope wegen aDiffText::DTOR!
307 bool bFull = false;
308 bool bEOL = false;
309 TextFrameIndex const nTextRest = TextFrameIndex(rInf.GetText().getLength()) - rInf.GetIdx();
310 {
311 TextFrameIndex nRest;
312 SwFieldSlot aDiffText( &rInf, this );
313 SwLayoutModeModifier aLayoutModeModifier( *rInf.GetOut() );
314 aLayoutModeModifier.SetAuto();
315
316 // Field portion has to be split in several parts if
317 // 1. There are script/direction changes inside the field
318 // 2. There are portion breaks (tab, break) inside the field:
319 const TextFrameIndex nOldFullLen = rInf.GetLen();
320 TextFrameIndex nFullLen = rInf.ScanPortionEnd(rInf.GetIdx(), rInf.GetIdx() + nOldFullLen) - rInf.GetIdx();
321 if ( m_nNextScriptChg < nFullLen )
322 {
323 nFullLen = m_nNextScriptChg;
324 rInf.SetHookChar( 0 );
325 }
326 rInf.SetLen( nFullLen );
327
329 rInf.GetUnderScorePos() > rInf.GetIdx() )
330 rInf.SetUnderScorePos( rInf.GetIdx() );
331
332 if( m_pFont )
333 m_pFont->AllocFontCacheId( rInf.GetVsh(), m_pFont->GetActual() );
334
335 SwFontSave aSave( rInf, m_pFont.get() );
336
337 // Length must be 0: the length is set for bFull after format
338 // and passed along in nRest. Or else the old length would be
339 // retained and be used for nRest!
341 TextFrameIndex const nFollow(IsFollow() ? TextFrameIndex(0) : m_nFieldLen);
342
343 // As odd is may seem: the query for GetLen() must return false due
344 // to the ExpandPortions _after_ aDiffText (see SoftHyphs), caused
345 // by SetFull.
346 if( !nFullLen )
347 {
348 // Don't Init(), as we need height and ascent
349 Width(0);
350 bFull = rInf.Width() <= rInf.GetPos().X();
351 }
352 else
353 {
354 TextFrameIndex const nOldLineStart = rInf.GetLineStart();
355 if( IsFollow() )
357 rInf.SetNotEOL( nFullLen == nOldFullLen && nTextRest > nFollow );
358
359 // the height depending on the fields font is set,
360 // this is required for SwTextGuess::Guess
361 Height( rInf.GetTextHeight() + rInf.GetFont()->GetTopBorderSpace() +
362 rInf.GetFont()->GetBottomBorderSpace() );
363 // If a kerning portion is inserted after our field portion,
364 // the ascent and height must be known
365 SetAscent( rInf.GetAscent() + rInf.GetFont()->GetTopBorderSpace() );
366 bFull = SwTextPortion::Format( rInf );
367 rInf.SetNotEOL( false );
368 rInf.SetLineStart( nOldLineStart );
369 }
370 TextFrameIndex const nTmpLen = GetLen();
371 bEOL = !nTmpLen && nFollow && bFull;
372 nRest = nOldFullLen - nTmpLen;
373
374 // The char is held in the first position
375 // Unconditionally after format!
376 SetLen( m_bNoLength ? TextFrameIndex(0) : nFollow );
377
378 if( nRest )
379 {
380 // aExpand has not yet been shortened; the new Ofst is a
381 // result of nRest
382 TextFrameIndex nNextOfst = TextFrameIndex(m_aExpand.getLength()) - nRest;
383
384 if ( IsQuoVadisPortion() )
385 nNextOfst = nNextOfst + TextFrameIndex(static_cast<SwQuoVadisPortion*>(this)->GetContText().getLength());
386
387 OUString aNew( m_aExpand.copy(sal_Int32(nNextOfst)) );
388 m_aExpand = m_aExpand.copy(0, sal_Int32(nNextOfst));
389
390 // These characters should not be contained in the follow
391 // field portion. They are handled via the HookChar mechanism.
392 const sal_Unicode nNew = !aNew.isEmpty() ? aNew[0] : 0;
393 auto IsHook = [](const sal_Unicode cNew) -> bool
394 {
395 switch (cNew)
396 {
397 case CH_BREAK:
398 case CH_TAB:
399 case CHAR_HARDHYPHEN: // non-breaking hyphen
400 case CHAR_SOFTHYPHEN:
401 case CHAR_HARDBLANK:
402 case CHAR_ZWSP:
403 case CHAR_WJ:
405 case CH_TXTATR_INWORD:
406 {
407 return true;
408 }
409 default:
410 return false;
411 }
412 };
413 if (IsHook(nNew))
414 {
415 if (nNew == CH_BREAK)
416 {
417 bFull = true;
418 }
419 aNew = aNew.copy(1);
420 ++nNextOfst;
421 }
422
423 // Even if there is no more text left for a follow field,
424 // we have to build a follow field portion (without font),
425 // otherwise the HookChar mechanism would not work.
426 SwFieldPortion *pField = Clone( aNew );
427 if( !aNew.isEmpty() && !pField->GetFont() )
428 {
429 pField->SetFont( std::make_unique<SwFont>( *rInf.GetFont() ) );
430 }
431 if (IsFollow() || Compress())
432 { // empty this will be deleted in SwLineLayout::CalcLine()
433 // anyway so make sure pField doesn't have a stale flag
434 pField->SetFollow( true );
435 }
436 if (pField->Compress() && !std::all_of(std::u16string_view(aNew).begin(),
437 std::u16string_view(aNew).end(), IsHook))
438 { // empty pField will be deleted in SwLineLayout::CalcLine()
439 // anyway so make sure this one doesn't have a stale flag
440 SetHasFollow( true );
441 }
442
443 // For a newly created field, nNextOffset contains the Offset
444 // of its start of the original string
445 // If a FollowField is created when formatting, this FollowField's
446 // Offset is being held in nNextOffset
447 m_nNextOffset = m_nNextOffset + nNextOfst;
448 pField->SetNextOffset( m_nNextOffset );
449 rInf.SetRest( pField );
450 }
451 }
452
453 if( bEOL && rInf.GetLast() && !rInf.GetUnderflow() )
454 rInf.GetLast()->FormatEOL( rInf );
455 return bFull;
456}
457
458void SwFieldPortion::Paint( const SwTextPaintInfo &rInf ) const
459{
460 SwFontSave aSave( rInf, m_pFont.get() );
461
462// OSL_ENSURE(GetLen() <= TextFrameIndex(1), "SwFieldPortion::Paint: rest-portion pollution?");
464 {
465 // A very liberal use of the background
466 rInf.DrawViewOpt( *this, PortionType::Field );
468 }
469}
470
471bool SwFieldPortion::GetExpText( const SwTextSizeInfo &rInf, OUString &rText ) const
472{
473 rText = m_aExpand;
474 if( rText.isEmpty() && rInf.OnWin() &&
475 !rInf.GetOpt().IsPagePreview() && !rInf.GetOpt().IsReadonly() &&
476 rInf.GetOpt().IsFieldShadings() &&
477 !HasFollow() )
478 rText = " ";
479 return true;
480}
481
483{
484 rPH.Special( GetLen(), m_aExpand, GetWhichPor() );
485}
486
487void SwFieldPortion::dumpAsXml(xmlTextWriterPtr pWriter, const OUString& rText,
488 TextFrameIndex& nOffset) const
489{
490 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwFieldPortion"));
491 dumpAsXmlAttributes(pWriter, rText, nOffset);
492 nOffset += GetLen();
493
494 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("expand"), BAD_CAST(m_aExpand.toUtf8().getStr()));
495
496 if (m_pFont)
497 {
498 m_pFont->dumpAsXml(pWriter);
499 }
500
501 (void)xmlTextWriterEndElement(pWriter);
502}
503
505{
506 SwFontSave aSave( rInf, m_pFont.get() );
508 return aSize;
509}
510
511SwFieldPortion *SwHiddenPortion::Clone(const OUString &rExpand ) const
512{
513 std::unique_ptr<SwFont> pNewFnt;
514 if( m_pFont )
515 pNewFnt.reset(new SwFont( *m_pFont ));
516 return new SwHiddenPortion( rExpand, std::move(pNewFnt) );
517}
518
520{
521 if( Width() )
522 {
523 SwFontSave aSave( rInf, m_pFont.get() );
524 rInf.DrawViewOpt( *this, PortionType::Hidden );
526 }
527}
528
529bool SwHiddenPortion::GetExpText( const SwTextSizeInfo &rInf, OUString &rText ) const
530{
531 // Do not query for IsHidden()!
532 return SwFieldPortion::GetExpText( rInf, rText );
533}
534
535SwNumberPortion::SwNumberPortion( const OUString &rExpand,
536 std::unique_ptr<SwFont> pFont,
537 const bool bLft,
538 const bool bCntr,
539 const sal_uInt16 nMinDst,
540 const bool bLabelAlignmentPosAndSpaceModeActive )
541 : SwFieldPortion(rExpand, std::move(pFont), false, TextFrameIndex(0))
542 , m_nFixWidth(0)
543 , m_nMinDist(nMinDst)
544 , mbLabelAlignmentPosAndSpaceModeActive(bLabelAlignmentPosAndSpaceModeActive)
545{
547 SetLeft( bLft );
548 SetHide( false );
549 SetCenter( bCntr );
550}
551
553{
554 return TextFrameIndex(0);
555}
556
557SwFieldPortion *SwNumberPortion::Clone( const OUString &rExpand ) const
558{
559 std::unique_ptr<SwFont> pNewFnt;
560 if( m_pFont )
561 pNewFnt.reset(new SwFont( *m_pFont ));
562
563 return new SwNumberPortion( rExpand, std::move(pNewFnt), IsLeft(), IsCenter(),
565}
566
574{
575 SetHide( false );
576 const bool bFull = SwFieldPortion::Format( rInf );
578 // a numbering portion can be contained in a rotated portion!!!
579 m_nFixWidth = rInf.IsMulti() ? Height() : Width();
580 rInf.SetNumDone( !rInf.GetRest() );
581 if( rInf.IsNumDone() )
582 {
583// SetAscent( rInf.GetAscent() );
584 OSL_ENSURE( Height() && mnAscent, "NumberPortions without Height | Ascent" );
585
586 tools::Long nDiff( 0 );
587
589 {
591 // #i32902#
593 {
594 nDiff = rInf.Left()
596 GetSwAttrSet().GetFirstLineIndent().GetTextFirstLineOffset()
597 - rInf.First()
598 + rInf.ForcedLeftMargin();
599 }
600 else
601 {
602 nDiff = rInf.Left() - rInf.First() + rInf.ForcedLeftMargin();
603 }
604 }
605 // The text part of the numbering should always at least
606 // start at the left margin
607 if( nDiff < 0 )
608 nDiff = 0;
609 else if ( nDiff > rInf.X() )
610 nDiff -= rInf.X();
611 else
612 nDiff = 0;
613
614 if( nDiff < m_nFixWidth + m_nMinDist )
615 nDiff = m_nFixWidth + m_nMinDist;
616
617 // Numbering evades the Fly, no nDiff in the second round
618 // Tricky special case: FlyFrame is in an Area we're just about to
619 // acquire
620 // The NumberPortion is marked as hidden
621 const bool bFly = rInf.GetFly() ||
622 ( rInf.GetLast() && rInf.GetLast()->IsFlyPortion() );
623 if( nDiff > rInf.Width() )
624 {
625 nDiff = rInf.Width();
626 if ( bFly )
627 SetHide( true );
628 }
629
630 // A numbering portion can be inside a SwRotatedPortion. Then the
631 // Height has to be changed
632 if ( rInf.IsMulti() )
633 {
634 if ( Height() < nDiff )
635 Height( nDiff );
636 }
637 else if( Width() < nDiff )
638 Width( nDiff );
639 }
640 return bFull;
641}
642
643
650{
651
652 // This caused trouble with flys anchored as characters.
653 // If one of these is numbered but does not fit to the line,
654 // it calls this function, causing a loop because both the number
655 // portion and the fly portion go to the next line
656// SetHide( true );
657}
658
659
665{
666 if ( IsHide() && rInf.GetParaPortion() && rInf.GetParaPortion()->GetNext() )
667 {
669 while ( pTmp && !pTmp->InTextGrp() )
670 pTmp = pTmp->GetNextPortion();
671 if ( !pTmp )
672 return;
673 }
674
675 // calculate the width of the number portion, including follows
676 const sal_uInt16 nOldWidth = Width();
677 sal_uInt16 nSumWidth = 0;
678 sal_uInt16 nOffset = 0;
679
680 const SwLinePortion* pTmp = this;
681 while ( pTmp && pTmp->InNumberGrp() )
682 {
683 nSumWidth = nSumWidth + pTmp->Width();
684 if ( static_cast<const SwNumberPortion*>(pTmp)->HasFollow() )
685 pTmp = pTmp->GetNextPortion();
686 else
687 {
688 nOffset = pTmp->Width() - static_cast<const SwNumberPortion*>(pTmp)->m_nFixWidth;
689 break;
690 }
691 }
692
693 // The master portion takes care for painting the background of the
694 // follow field portions
695 if ( ! IsFollow() )
696 {
697 SwNumberPortion *pThis = const_cast<SwNumberPortion*>(this);
698 pThis->Width( nSumWidth );
699 rInf.DrawViewOpt( *this, PortionType::Number );
700 pThis->Width( nOldWidth );
701 }
702
703 if( m_aExpand.isEmpty() )
704 return;
705
706 const SwFont *pTmpFnt = rInf.GetFont();
707 bool bPaintSpace = ( LINESTYLE_NONE != pTmpFnt->GetUnderline() ||
708 LINESTYLE_NONE != pTmpFnt->GetOverline() ||
709 STRIKEOUT_NONE != pTmpFnt->GetStrikeout() ) &&
710 !pTmpFnt->IsWordLineMode();
711 if( bPaintSpace && m_pFont )
712 bPaintSpace = ( LINESTYLE_NONE != m_pFont->GetUnderline() ||
713 LINESTYLE_NONE != m_pFont->GetOverline() ||
714 STRIKEOUT_NONE != m_pFont->GetStrikeout() ) &&
715 !m_pFont->IsWordLineMode();
716
717 SwFontSave aSave( rInf, m_pFont.get() );
718
719 if( m_nFixWidth == Width() && ! HasFollow() )
721 else
722 {
723 // logical const: reset width
724 SwNumberPortion *pThis = const_cast<SwNumberPortion*>(this);
725 bPaintSpace = bPaintSpace && m_nFixWidth < nOldWidth;
726 sal_uInt16 nSpaceOffs = m_nFixWidth;
727 pThis->Width( m_nFixWidth );
728
729 if( ( IsLeft() && ! rInf.GetTextFrame()->IsRightToLeft() ) ||
730 ( ! IsLeft() && ! IsCenter() && rInf.GetTextFrame()->IsRightToLeft() ) )
732 else
733 {
734 SwTextPaintInfo aInf( rInf );
735 if( nOffset < m_nMinDist )
736 nOffset = 0;
737 else
738 {
739 if( IsCenter() )
740 {
741 /* #110778# a / 2 * 2 == a is not a tautology */
742 sal_uInt16 nTmpOffset = nOffset;
743 nOffset /= 2;
744 if( nOffset < m_nMinDist )
745 nOffset = nTmpOffset - m_nMinDist;
746 }
747 else
748 nOffset = nOffset - m_nMinDist;
749 }
750 aInf.X( aInf.X() + nOffset );
752 if( bPaintSpace )
753 nSpaceOffs = nSpaceOffs + nOffset;
754 }
755 if( bPaintSpace && nOldWidth > nSpaceOffs )
756 {
757 SwTextPaintInfo aInf( rInf );
758 aInf.X( aInf.X() + nSpaceOffs );
759
760 // #i53199# Adjust position of underline:
761 if ( rInf.GetUnderFnt() )
762 {
763 const Point aNewPos( aInf.GetPos().X(), rInf.GetUnderFnt()->GetPos().Y() );
764 rInf.GetUnderFnt()->SetPos( aNewPos );
765 }
766
767 pThis->Width( nOldWidth - nSpaceOffs + 12 );
768 {
769 SwTextSlot aDiffText( &aInf, this, true, false, " " );
770 aInf.DrawText( *this, aInf.GetLen(), true );
771 }
772 }
773 pThis->Width( nOldWidth );
774 }
775}
776
778 std::u16string_view rBulletFollowedBy,
779 std::unique_ptr<SwFont> pFont,
780 const bool bLft,
781 const bool bCntr,
782 const sal_uInt16 nMinDst,
783 const bool bLabelAlignmentPosAndSpaceModeActive )
784 : SwNumberPortion( OUString(&cBullet, 1) + rBulletFollowedBy,
785 std::move(pFont), bLft, bCntr, nMinDst,
786 bLabelAlignmentPosAndSpaceModeActive )
787{
789}
790
791#define GRFNUM_SECURE 10
792
794 const OUString& rGraphicFollowedBy,
795 const SvxBrushItem* pGrfBrush, OUString const & referer,
796 const SwFormatVertOrient* pGrfOrient, const Size& rGrfSize,
797 const bool bLft, const bool bCntr, const sal_uInt16 nMinDst,
798 const bool bLabelAlignmentPosAndSpaceModeActive ) :
799 SwNumberPortion( rGraphicFollowedBy, nullptr, bLft, bCntr, nMinDst,
800 bLabelAlignmentPosAndSpaceModeActive ),
801 m_pBrush( new SvxBrushItem(RES_BACKGROUND) ), m_nId( 0 )
802{
804 SetAnimated( false );
805 m_bReplace = false;
806 if( pGrfBrush )
807 {
808 m_pBrush.reset(pGrfBrush->Clone());
809 const Graphic* pGraph = pGrfBrush->GetGraphic(referer);
810 if( pGraph )
811 SetAnimated( pGraph->IsAnimated() );
812 else
813 m_bReplace = true;
814 }
815 if( pGrfOrient )
816 {
817 m_nYPos = pGrfOrient->GetPos();
818 m_eOrient = pGrfOrient->GetVertOrient();
819 }
820 else
821 {
822 m_nYPos = 0;
823 m_eOrient = text::VertOrientation::TOP;
824 }
825 Width( rGrfSize.Width() + 2 * GRFNUM_SECURE );
826 m_nFixWidth = Width();
827 m_nGrfHeight = rGrfSize.Height() + 2 * GRFNUM_SECURE;
828 Height( sal_uInt16(m_nGrfHeight) );
829 m_bNoPaint = false;
830}
831
833{
834 if ( IsAnimated() )
835 {
836 Graphic* pGraph = const_cast<Graphic*>(m_pBrush->GetGraphic());
837 if (pGraph)
838 pGraph->StopAnimation( nullptr, m_nId );
839 }
840 m_pBrush.reset();
841}
842
844{
845 if ( IsAnimated() )
846 {
847 Graphic* pGraph = const_cast<Graphic*>(m_pBrush->GetGraphic());
848 if (pGraph)
849 pGraph->StopAnimation( pOut, m_nId );
850 }
851}
852
854{
855 SetHide( false );
856// Width( nFixWidth );
857 sal_uInt16 nFollowedByWidth( 0 );
859 {
861 nFollowedByWidth = Width();
863 }
864 Width( m_nFixWidth + nFollowedByWidth );
865 const bool bFull = rInf.Width() < rInf.X() + Width();
866 const bool bFly = rInf.GetFly() ||
867 ( rInf.GetLast() && rInf.GetLast()->IsFlyPortion() );
868 SetAscent( GetRelPos() > 0 ? GetRelPos() : 0 );
869 if( GetAscent() > Height() )
870 Height( GetAscent() );
871
872 if( bFull )
873 {
874 Width( rInf.Width() - rInf.X() );
875 if( bFly )
876 {
878 m_bNoPaint = true;
879 rInf.SetNumDone( false );
880 return true;
881 }
882 }
883 rInf.SetNumDone( true );
884// long nDiff = rInf.Left() - rInf.First() + rInf.ForcedLeftMargin();
886 ? 0
887 : rInf.Left() - rInf.First() + rInf.ForcedLeftMargin();
888 // The TextPortion should at least always start on the
889 // left margin
890 if( nDiff < 0 )
891 nDiff = 0;
892 else if ( nDiff > rInf.X() )
893 nDiff -= rInf.X();
894 if( nDiff < m_nFixWidth + m_nMinDist )
895 nDiff = m_nFixWidth + m_nMinDist;
896
897 // Numbering evades Fly, no nDiff in the second round
898 // Tricky special case: FlyFrame is in the Area we were just
899 // about to get a hold of.
900 // The NumberPortion is marked as hidden
901 if( nDiff > rInf.Width() )
902 {
903 nDiff = rInf.Width();
904 if( bFly )
905 SetHide( true );
906 }
907
908 if( Width() < nDiff )
909 Width( nDiff );
910 return bFull;
911}
912
913
919{
920 if( m_bNoPaint )
921 return;
922 if ( IsHide() && rInf.GetParaPortion() && rInf.GetParaPortion()->GetNext() )
923 {
925 while ( pTmp && !pTmp->InTextGrp() )
926 pTmp = pTmp->GetNextPortion();
927 if ( !pTmp )
928 return;
929 }
930 Point aPos( rInf.X() + GRFNUM_SECURE, rInf.Y() - GetRelPos() + GRFNUM_SECURE );
931 tools::Long nTmpWidth = std::max( tools::Long(0), static_cast<tools::Long>(m_nFixWidth - 2 * GRFNUM_SECURE) );
932 Size aSize( nTmpWidth, GetGrfHeight() - 2 * GRFNUM_SECURE );
933
934 const bool bTmpLeft = mbLabelAlignmentPosAndSpaceModeActive ||
935 ( IsLeft() && ! rInf.GetTextFrame()->IsRightToLeft() ) ||
936 ( ! IsLeft() && ! IsCenter() && rInf.GetTextFrame()->IsRightToLeft() );
937
938 if( m_nFixWidth < Width() && !bTmpLeft )
939 {
940 sal_uInt16 nOffset = Width() - m_nFixWidth;
941 if( nOffset < m_nMinDist )
942 nOffset = 0;
943 else
944 {
945 if( IsCenter() )
946 {
947 nOffset /= 2;
948 if( nOffset < m_nMinDist )
949 nOffset = Width() - m_nFixWidth - m_nMinDist;
950 }
951 else
952 nOffset = nOffset - m_nMinDist;
953 }
954 aPos.AdjustX(nOffset );
955 }
956
957 if( m_bReplace )
958 {
959 const tools::Long nTmpH = GetNextPortion() ? GetNextPortion()->GetAscent() : 120;
960 aSize = Size( nTmpH, nTmpH );
961 aPos.setY( rInf.Y() - nTmpH );
962 }
963 SwRect aTmp( aPos, aSize );
964
965 bool bDraw = true;
966
967 if ( IsAnimated() )
968 {
969 bDraw = !rInf.GetOpt().IsGraphic();
970 if( !m_nId )
971 {
972 SetId( reinterpret_cast<sal_IntPtr>( rInf.GetTextFrame() ) );
973 rInf.GetTextFrame()->SetAnimation();
974 }
975 if( aTmp.Overlaps( rInf.GetPaintRect() ) && !bDraw )
976 {
977 rInf.NoteAnimation();
978 const SwViewShell* pViewShell = rInf.GetVsh();
979
980 // virtual device, not pdf export
981 if( OUTDEV_VIRDEV == rInf.GetOut()->GetOutDevType() &&
982 pViewShell && pViewShell->GetWin() )
983 {
984 Graphic* pGraph = const_cast<Graphic*>(m_pBrush->GetGraphic());
985 if (pGraph)
986 pGraph->StopAnimation(nullptr,m_nId);
988 }
989
990 else if ( pViewShell &&
992 !pViewShell->IsPreview() &&
993 // #i9684# Stop animation during printing/pdf export.
994 pViewShell->GetWin() )
995 {
996 Graphic* pGraph = const_cast<Graphic*>(m_pBrush->GetGraphic());
997 if (pGraph)
998 {
999 const OutputDevice* pOut = rInf.GetOut();
1000 assert(pOut);
1001 pGraph->StartAnimation(
1002 *const_cast<OutputDevice*>(pOut), aPos, aSize, m_nId);
1003 }
1004 }
1005
1006 // pdf export, printing, preview, stop animations...
1007 else
1008 bDraw = true;
1009 }
1010 if( bDraw )
1011 {
1012
1013 Graphic* pGraph = const_cast<Graphic*>(m_pBrush->GetGraphic());
1014 if (pGraph)
1015 pGraph->StopAnimation( nullptr, m_nId );
1016 }
1017 }
1018
1019 SwRect aRepaint( rInf.GetPaintRect() );
1020 const SwTextFrame& rFrame = *rInf.GetTextFrame();
1021 if( rFrame.IsVertical() )
1022 {
1023 rFrame.SwitchHorizontalToVertical( aTmp );
1024 rFrame.SwitchHorizontalToVertical( aRepaint );
1025 }
1026
1027 if( rFrame.IsRightToLeft() )
1028 {
1029 rFrame.SwitchLTRtoRTL( aTmp );
1030 rFrame.SwitchLTRtoRTL( aRepaint );
1031 }
1032
1033 if( bDraw && aTmp.HasArea() )
1034 {
1035 const OutputDevice* pOut = rInf.GetOut();
1036 assert(pOut);
1037 DrawGraphic( m_pBrush.get(), *const_cast<OutputDevice*>(pOut),
1038 aTmp, aRepaint, m_bReplace ? GRFNUM_REPLACE : GRFNUM_YES );
1039 }
1040}
1041
1043 tools::Long nFlyAsc, tools::Long nFlyDesc )
1044{
1046 return;
1047
1048 SetRelPos( 0 );
1049 if ( GetOrient() == text::VertOrientation::CENTER )
1050 SetRelPos( GetGrfHeight() / 2 );
1051 else if ( GetOrient() == text::VertOrientation::TOP )
1053 else if ( GetOrient() == text::VertOrientation::BOTTOM )
1054 ;
1055 else if ( GetOrient() == text::VertOrientation::CHAR_CENTER )
1056 SetRelPos( ( GetGrfHeight() + nLnAscent - nLnDescent ) / 2 );
1057 else if ( GetOrient() == text::VertOrientation::CHAR_TOP )
1058 SetRelPos( nLnAscent );
1059 else if ( GetOrient() == text::VertOrientation::CHAR_BOTTOM )
1060 SetRelPos( GetGrfHeight() - nLnDescent );
1061 else
1062 {
1063 if( GetGrfHeight() >= nFlyAsc + nFlyDesc )
1064 {
1065 // If I'm as large as the line, I do not need to adjust
1066 // at the line; I'll leave the max. ascent unchanged
1067 SetRelPos( nFlyAsc );
1068 }
1069 else if ( GetOrient() == text::VertOrientation::LINE_CENTER )
1070 SetRelPos( ( GetGrfHeight() + nFlyAsc - nFlyDesc ) / 2 );
1071 else if ( GetOrient() == text::VertOrientation::LINE_TOP )
1072 SetRelPos( nFlyAsc );
1073 else if ( GetOrient() == text::VertOrientation::LINE_BOTTOM )
1074 SetRelPos( GetGrfHeight() - nFlyDesc );
1075 }
1076}
1077
1079{
1080 OSL_ENSURE( HasAnimation(), "SwTextFrame::StopAnimation: Which Animation?" );
1081 if( !HasPara() )
1082 return;
1083
1084 SwLineLayout *pLine = GetPara();
1085 while( pLine )
1086 {
1087 SwLinePortion *pPor = pLine->GetNextPortion();
1088 while( pPor )
1089 {
1090 if( pPor->IsGrfNumPortion() )
1091 static_cast<SwGrfNumPortion*>(pPor)->StopAnimation( pOut );
1092 // The NumberPortion is always at the first char,
1093 // which means we can cancel as soon as we've reached a portion
1094 // with a length > 0
1095 pPor = pPor->GetLen() ? nullptr : pPor->GetNextPortion();
1096 }
1097 pLine = pLine->GetLen() ? nullptr : pLine->GetNext();
1098 }
1099}
1100
1105 : SwFieldPortion( rText )
1106 , m_aWidth{ static_cast<sal_uInt16>(0),
1107 static_cast<sal_uInt16>(0),
1108 static_cast<sal_uInt16>(0) }
1109 , m_nUpPos(0)
1110 , m_nLowPos(0)
1111 , m_nProportion(55)
1112{
1115 if( m_aExpand.getLength() > 6 )
1116 m_aExpand = m_aExpand.copy( 0, 6 );
1117
1118 // Initialization of the scripttype array,
1119 // the arrays of width and position are filled by the format function
1120 assert(g_pBreakIt && g_pBreakIt->GetBreakIter().is());
1121
1122 SwFontScript nScr = SW_SCRIPTS;
1123 for( sal_Int32 i = 0; i < rText.getLength(); ++i )
1124 {
1125 switch ( g_pBreakIt->GetBreakIter()->getScriptType( rText, i ) ) {
1126 case i18n::ScriptType::LATIN : nScr = SwFontScript::Latin; break;
1127 case i18n::ScriptType::ASIAN : nScr = SwFontScript::CJK; break;
1128 case i18n::ScriptType::COMPLEX : nScr = SwFontScript::CTL; break;
1129 }
1130 m_aScrType[i] = nScr;
1131 }
1132}
1133
1135{
1136 OSL_ENSURE(GetLen() <= TextFrameIndex(1), "SwFieldPortion::Paint: rest-portion pollution?");
1137 if( !Width() )
1138 return;
1139
1140 rInf.DrawBackBrush( *this );
1141 rInf.DrawViewOpt( *this, PortionType::Field );
1142
1143 // do we have to repaint a post it portion?
1144 if( rInf.OnWin() && mpNextPortion && !mpNextPortion->Width() )
1145 mpNextPortion->PrePaint( rInf, this );
1146
1147 const sal_Int32 nCount = m_aExpand.getLength();
1148 if( !nCount )
1149 return;
1150 OSL_ENSURE( nCount < 7, "Too much combined characters" );
1151
1152 // the first character of the second row
1153 const sal_Int32 nTop = ( nCount + 1 ) / 2;
1154
1155 SwFont aTmpFont( *rInf.GetFont() );
1156 aTmpFont.SetProportion( m_nProportion ); // a smaller font
1157 SwFontSave aFontSave( rInf, &aTmpFont );
1158
1159 Point aOldPos = rInf.GetPos();
1160 Point aOutPos( aOldPos.X(), aOldPos.Y() - m_nUpPos );// Y of the first row
1161 for( sal_Int32 i = 0 ; i < nCount; ++i )
1162 {
1163 if( i == nTop ) // change the row
1164 aOutPos.setY( aOldPos.Y() + m_nLowPos ); // Y of the second row
1165 aOutPos.setX( aOldPos.X() + m_aPos[i] ); // X position
1166 const SwFontScript nAct = m_aScrType[i]; // script type
1167 aTmpFont.SetActual( nAct );
1168
1169 // if there're more than 4 characters to display, we choose fonts
1170 // with 2/3 of the original font width.
1171 if( m_aWidth[ nAct ] )
1172 {
1173 Size aTmpSz = aTmpFont.GetSize( nAct );
1174 if( aTmpSz.Width() != m_aWidth[ nAct ] )
1175 {
1176 aTmpSz.setWidth( m_aWidth[ nAct ] );
1177 aTmpFont.SetSize( aTmpSz, nAct );
1178 }
1179 }
1180 const_cast<SwTextPaintInfo&>(rInf).SetPos( aOutPos );
1182 }
1183 // rInf is const, so we have to take back our manipulations
1184 const_cast<SwTextPaintInfo&>(rInf).SetPos( aOldPos );
1185
1186}
1187
1189{
1190 const sal_Int32 nCount = m_aExpand.getLength();
1191 if( !nCount )
1192 {
1193 Width( 0 );
1194 return false;
1195 }
1196
1197 OSL_ENSURE( nCount < 7, "Too much combined characters" );
1198
1199 // If there are leading "weak"-scripttyped characters in this portion,
1200 // they get the actual scripttype.
1201 for( sal_Int32 i = 0; i < nCount && SW_SCRIPTS == m_aScrType[i]; ++i )
1202 m_aScrType[i] = rInf.GetFont()->GetActual();
1203 if( nCount > 4 )
1204 {
1205 // more than four? Ok, then we need the 2/3 font width
1206 for( sal_Int32 i = 0; i < m_aExpand.getLength(); ++i )
1207 {
1208 OSL_ENSURE( m_aScrType[i] < SW_SCRIPTS, "Combined: Script fault" );
1209 if( !m_aWidth[ m_aScrType[i] ] )
1210 {
1211 rInf.GetOut()->SetFont( rInf.GetFont()->GetFnt( m_aScrType[i] ) );
1212 m_aWidth[ m_aScrType[i] ] =
1213 o3tl::narrowing<sal_uInt16>(2 * rInf.GetOut()->GetFontMetric().GetFontSize().Width() / 3);
1214 }
1215 }
1216 }
1217
1218 const sal_Int32 nTop = ( nCount + 1 ) / 2; // the first character of the second line
1220 SwFont aTmpFont( *rInf.GetFont() );
1221 SwFontSave aFontSave( rInf, &aTmpFont );
1222 m_nProportion = 55;
1223 // In nMainAscent/Descent we store the ascent and descent
1224 // of the original surrounding font
1225 sal_uInt16 nMaxDescent, nMaxAscent, nMaxWidth;
1226 sal_uInt16 nMainDescent = rInf.GetFont()->GetHeight( pSh, *rInf.GetOut() );
1227 const sal_uInt16 nMainAscent = rInf.GetFont()->GetAscent( pSh, *rInf.GetOut() );
1228 nMainDescent = nMainDescent - nMainAscent;
1229 // we start with a 50% font, but if we notice that the combined portion
1230 // becomes bigger than the surrounding font, we check 45% and maybe 40%.
1231 do
1232 {
1233 m_nProportion -= 5;
1234 aTmpFont.SetProportion( m_nProportion );
1235 memset( &m_aPos, 0, sizeof(m_aPos) );
1236 nMaxDescent = 0;
1237 nMaxAscent = 0;
1238 nMaxWidth = 0;
1239 m_nUpPos = m_nLowPos = 0;
1240
1241 // Now we get the width of all characters.
1242 // The ascent and the width of the first line are stored in the
1243 // ascent member of the portion, the descent in nLowPos.
1244 // The ascent, descent and width of the second line are stored in the
1245 // local nMaxAscent, nMaxDescent and nMaxWidth variables.
1246 for( sal_Int32 i = 0; i < nCount; ++i )
1247 {
1248 SwFontScript nScrp = m_aScrType[i];
1249 aTmpFont.SetActual( nScrp );
1250 if( m_aWidth[ nScrp ] )
1251 {
1252 Size aFontSize( aTmpFont.GetSize( nScrp ) );
1253 aFontSize.setWidth( m_aWidth[ nScrp ] );
1254 aTmpFont.SetSize( aFontSize, nScrp );
1255 }
1256
1257 SwDrawTextInfo aDrawInf(pSh, *rInf.GetOut(), m_aExpand, i, 1);
1258 Size aSize = aTmpFont.GetTextSize_( aDrawInf );
1259 const sal_uInt16 nAsc = aTmpFont.GetAscent( pSh, *rInf.GetOut() );
1260 m_aPos[ i ] = o3tl::narrowing<sal_uInt16>(aSize.Width());
1261 if( i == nTop ) // enter the second line
1262 {
1263 m_nLowPos = nMaxDescent;
1264 Height( nMaxDescent + nMaxAscent );
1265 Width( nMaxWidth );
1266 SetAscent( nMaxAscent );
1267 nMaxAscent = 0;
1268 nMaxDescent = 0;
1269 nMaxWidth = 0;
1270 }
1271 nMaxWidth = nMaxWidth + m_aPos[ i ];
1272 if( nAsc > nMaxAscent )
1273 nMaxAscent = nAsc;
1274 if( aSize.Height() - nAsc > nMaxDescent )
1275 nMaxDescent = aSize.Height() - nAsc;
1276 }
1277 // for one or two characters we double the width of the portion
1278 if( nCount < 3 )
1279 {
1280 nMaxWidth *= 2;
1281 Width( 2*Width() );
1282 if( nCount < 2 )
1283 {
1284 Height( nMaxAscent + nMaxDescent );
1285 m_nLowPos = nMaxDescent;
1286 }
1287 }
1288 Height( Height() + nMaxDescent + nMaxAscent );
1289 m_nUpPos = nMaxAscent;
1290 SetAscent( Height() - nMaxDescent - m_nLowPos );
1291 } while( m_nProportion > 40 && ( GetAscent() > nMainAscent ||
1292 Height() - GetAscent() > nMainDescent ) );
1293 // if the combined portion is smaller than the surrounding text,
1294 // the portion grows. This looks better, if there's a character background.
1295 if( GetAscent() < nMainAscent )
1296 {
1297 Height( Height() + nMainAscent - GetAscent() );
1298 SetAscent( nMainAscent );
1299 }
1300 if( Height() < nMainAscent + nMainDescent )
1301 Height( nMainAscent + nMainDescent );
1302
1303 // We calculate the x positions of the characters in both lines...
1304 sal_uInt16 nTopDiff = 0;
1305 sal_uInt16 nBotDiff = 0;
1306 if( nMaxWidth > Width() )
1307 {
1308 nTopDiff = ( nMaxWidth - Width() ) / 2;
1309 Width( nMaxWidth );
1310 }
1311 else
1312 nBotDiff = ( Width() - nMaxWidth ) / 2;
1313 switch( nTop)
1314 {
1315 case 3: m_aPos[1] = m_aPos[0] + nTopDiff;
1316 [[fallthrough]];
1317 case 2: m_aPos[nTop-1] = Width() - m_aPos[nTop-1];
1318 }
1319 m_aPos[0] = 0;
1320 switch( nCount )
1321 {
1322 case 5: m_aPos[4] = m_aPos[3] + nBotDiff;
1323 [[fallthrough]];
1324 case 3: m_aPos[nTop] = nBotDiff; break;
1325 case 6: m_aPos[4] = m_aPos[3] + nBotDiff;
1326 [[fallthrough]];
1327 case 4: m_aPos[nTop] = 0;
1328 [[fallthrough]];
1329 case 2: m_aPos[nCount-1] = Width() - m_aPos[nCount-1];
1330 }
1331
1332 // Does the combined portion fit the line?
1333 const bool bFull = rInf.Width() < rInf.X() + Width();
1334 if( bFull )
1335 {
1336 if( rInf.GetLineStart() == rInf.GetIdx() && (!rInf.GetLast()->InFieldGrp()
1337 || !static_cast<SwFieldPortion*>(rInf.GetLast())->IsFollow() ) )
1338 Width( rInf.Width() - rInf.X() );
1339 else
1340 {
1341 Truncate();
1342 Width( 0 );
1344 if( rInf.GetLast() )
1345 rInf.GetLast()->FormatEOL( rInf );
1346 }
1347 }
1348 return bFull;
1349}
1350
1352{
1353 if( !GetLen() ) // for the dummy part at the end of the line, where
1354 return 0; // the combined portion doesn't fit.
1355 return SwFieldPortion::GetViewWidth( rInf );
1356}
1357
1359{
1360 return new SwFieldFormDropDownPortion(m_pFieldMark, rExpand);
1361}
1362
1364{
1365 SwFieldPortion::Paint( rInf );
1366
1367 ::sw::mark::DropDownFieldmark* pDropDownField = dynamic_cast< ::sw::mark::DropDownFieldmark* >(m_pFieldMark);
1368 if(pDropDownField)
1369 {
1370 SwRect aPaintArea;
1371 rInf.CalcRect( *this, &aPaintArea );
1372 pDropDownField->SetPortionPaintArea(aPaintArea);
1373 }
1374}
1375
1376SwFieldPortion *SwFieldFormDatePortion::Clone(const OUString &/*rExpand*/) const
1377{
1379}
1380
1382{
1383 SwFieldPortion::Paint( rInf );
1384
1385 ::sw::mark::DateFieldmark* pDateField = dynamic_cast< ::sw::mark::DateFieldmark* >(m_pFieldMark);
1386 if(pDateField)
1387 {
1388 SwRect aPaintArea;
1389 rInf.CalcRect( *this, &aPaintArea );
1390 if(m_bStart)
1391 pDateField->SetPortionPaintAreaStart(aPaintArea);
1392 else
1393 pDateField->SetPortionPaintAreaEnd(aPaintArea);
1394 }
1395}
1396
1397/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@ IGNORE_FIRST_LINE_INDENT_IN_NUMBERING
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...
SwBreakIt * g_pBreakIt
Definition: breakit.cxx:34
void StopAnimation(const OutputDevice *pOutputDevice, tools::Long nExtraData)
bool IsAnimated() const
void StartAnimation(OutputDevice &rOutDev, const Point &rDestPt, const Size &rDestSize, tools::Long nExtraData=0, OutputDevice *pFirstFrameOutDev=nullptr)
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
void SetFont(const vcl::Font &rNewFont)
FontMetric GetFontMetric() const
OutDevType GetOutDevType() const
constexpr tools::Long Y() const
void setX(tools::Long nX)
void setY(tools::Long nY)
tools::Long AdjustX(tools::Long nHorzMove)
constexpr tools::Long X() const
constexpr tools::Long Height() const
void setWidth(tools::Long nWidth)
constexpr tools::Long Width() const
const Graphic * GetGraphic(OUString const &referer=OUString()) const
virtual SvxBrushItem * Clone(SfxItemPool *pPool=nullptr) const override
css::uno::Reference< css::i18n::XBreakIterator > const & GetBreakIter() const
Definition: breakit.hxx:63
SwBulletPortion(const sal_UCS4 cCh, std::u16string_view rBulletFollowedBy, std::unique_ptr< SwFont > pFnt, const bool bLeft, const bool bCenter, const sal_uInt16 nMinDst, const bool bLabelAlignmentPosAndSpaceModeActive)
Definition: porfld.cxx:777
SwFontScript m_aScrType[6]
Definition: porfld.hxx:217
virtual sal_uInt16 GetViewWidth(const SwTextSizeInfo &rInf) const override
Definition: porfld.cxx:1351
sal_uInt16 m_aPos[6]
Definition: porfld.hxx:215
sal_uInt16 m_nUpPos
Definition: porfld.hxx:218
sal_uInt8 m_nProportion
Definition: porfld.hxx:220
virtual bool Format(SwTextFormatInfo &rInf) override
Definition: porfld.cxx:1188
SwCombinedPortion(const OUString &rExpand)
Initializes the script array and clears the width array.
Definition: porfld.cxx:1104
sal_uInt16 m_nLowPos
Definition: porfld.hxx:219
o3tl::enumarray< SwFontScript, sal_uInt16 > m_aWidth
Definition: porfld.hxx:216
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: porfld.cxx:1134
IDocumentSettingAccess const & getIDocumentSettingAccess() const
Definition: doc.cxx:190
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: porexp.cxx:75
virtual SwPosSize GetTextSize(const SwTextSizeInfo &rInfo) const override
Definition: porexp.cxx:52
sw::mark::IFieldmark * m_pFieldMark
Definition: porfld.hxx:262
SwFieldFormDatePortion(sw::mark::IFieldmark *pFieldMark, bool bStart)
Definition: porfld.hxx:250
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: porfld.cxx:1381
virtual SwFieldPortion * Clone(const OUString &rExpand) const override
Definition: porfld.cxx:1376
sw::mark::IFieldmark * m_pFieldMark
Definition: porfld.hxx:244
virtual SwFieldPortion * Clone(const OUString &rExpand) const override
Definition: porfld.cxx:1358
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: porfld.cxx:1363
SwFieldFormDropDownPortion(sw::mark::IFieldmark *pFieldMark, const OUString &rExpand)
Definition: porfld.hxx:233
void SetCenter(bool bNew)
Definition: porfld.hxx:93
std::unique_ptr< SwFont > m_pFont
Definition: porfld.hxx:39
bool IsCenter() const
Definition: porfld.hxx:92
bool IsFollow() const
Definition: porfld.hxx:83
bool HasFont() const
Definition: porfld.hxx:69
TextFrameIndex m_nNextOffset
Definition: porfld.hxx:40
bool m_bContentControl
Definition: porfld.hxx:55
OUString m_aExpand
Definition: porfld.hxx:38
void dumpAsXml(xmlTextWriterPtr pWriter, const OUString &rText, TextFrameIndex &nOffset) const override
Definition: porfld.cxx:487
bool m_bNoLength
Definition: porfld.hxx:54
sal_uInt16 m_nViewWidth
Definition: porfld.hxx:44
bool m_bFollow
Definition: porfld.hxx:45
TextFrameIndex GetNextOffset() const
Definition: porfld.hxx:98
const bool m_bPlaceHolder
Definition: porfld.hxx:53
void SetNextOffset(TextFrameIndex nNew)
Definition: porfld.hxx:99
void SetLeft(bool bNew)
Definition: porfld.hxx:87
bool IsHide() const
Definition: porfld.hxx:89
virtual SwFieldPortion * Clone(const OUString &rExpand) const
Definition: porfld.cxx:53
bool IsLeft() const
Definition: porfld.hxx:86
virtual void HandlePortion(SwPortionHandler &rPH) const override
Definition: porfld.cxx:482
const SwFont * GetFont() const
Definition: porfld.hxx:71
bool m_bReplace
Definition: porfld.hxx:52
virtual SwLinePortion * Compress() override
Definition: porfld.cxx:50
bool m_bNoPaint
Definition: porfld.hxx:51
bool HasFollow() const
Definition: porfld.hxx:95
TextFrameIndex GetFieldLen() const
Definition: porfld.hxx:101
void SetHide(bool bNew)
Definition: porfld.hxx:90
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: porfld.cxx:458
TextFrameIndex m_nFieldLen
Definition: porfld.hxx:42
virtual bool Format(SwTextFormatInfo &rInf) override
Definition: porfld.cxx:304
void SetFollow(bool bNew)
Definition: porfld.hxx:84
void CheckScript(const SwTextSizeInfo &rInf)
Definition: porfld.cxx:207
void SetFont(std::unique_ptr< SwFont > pNew)
Definition: porfld.hxx:57
virtual bool GetExpText(const SwTextSizeInfo &rInf, OUString &rText) const override
Definition: porfld.cxx:471
virtual SwPosSize GetTextSize(const SwTextSizeInfo &rInfo) const override
Definition: porfld.cxx:504
TextFrameIndex m_nNextScriptChg
Definition: porfld.hxx:41
SwFieldPortion(const SwFieldPortion &rField)
Definition: porfld.cxx:89
virtual sal_uInt16 GetViewWidth(const SwTextSizeInfo &rInf) const override
Definition: porfld.cxx:119
void SetHasFollow(bool bNew)
Definition: porfld.hxx:96
virtual ~SwFieldPortion() override
Definition: porfld.cxx:114
void TakeNextOffset(const SwFieldPortion *pField)
Definition: porfld.cxx:68
To take Asian or other languages into consideration, an SwFont object consists of 3 SwSubFonts (Latin...
Definition: swfont.hxx:135
sal_uInt16 GetBottomBorderSpace() const
Definition: swfont.hxx:880
sal_uInt16 GetTopBorderSpace() const
Definition: swfont.hxx:865
const Size & GetSize(SwFontScript nWhich) const
Definition: swfont.hxx:209
FontLineStyle GetUnderline() const
Definition: swfont.hxx:275
Size GetTextSize_(SwDrawTextInfo &rInf)
Definition: swfont.hxx:313
void SetProportion(const sal_uInt8 nNewPropr)
Definition: swfont.hxx:772
FontStrikeout GetStrikeout() const
Definition: swfont.hxx:279
void SetSize(const Size &rSize, const SwFontScript nWhich)
Definition: swfont.hxx:744
SwFontScript GetActual() const
Definition: swfont.hxx:187
FontLineStyle GetOverline() const
Definition: swfont.hxx:277
bool IsWordLineMode() const
Definition: swfont.hxx:281
const SvxFont & GetFnt(const SwFontScript nWhich) const
Definition: swfont.hxx:270
sal_uInt16 GetAscent(SwViewShell const *pSh, const OutputDevice &rOut)
Definition: swfont.hxx:330
tools::Long GetHeight() const
Definition: swfont.hxx:287
void SetActual(SwFontScript nNew)
Definition: swfont.hxx:754
Defines the vertical position of a fly frame.
Definition: fmtornt.hxx:37
SwTwips GetPos() const
Definition: fmtornt.hxx:62
sal_Int16 GetVertOrient() const
Definition: fmtornt.hxx:57
bool IsRightToLeft() const
Definition: frame.hxx:993
bool IsVertical() const
Definition: frame.hxx:979
SwRootFrame * getRootFrame()
Definition: frame.hxx:685
SwTwips GetRelPos() const
Definition: porfld.hxx:200
void SetRelPos(SwTwips nNew)
Definition: porfld.hxx:197
void SetBase(tools::Long nLnAscent, tools::Long nLnDescent, tools::Long nFlyAscent, tools::Long nFlyDescent)
Definition: porfld.cxx:1042
tools::Long m_nId
Definition: porfld.hxx:172
sal_Int16 m_eOrient
Definition: porfld.hxx:175
SwGrfNumPortion(const OUString &rGraphicFollowedBy, const SvxBrushItem *pGrfBrush, OUString const &referer, const SwFormatVertOrient *pGrfOrient, const Size &rGrfSize, const bool bLeft, const bool bCenter, const sal_uInt16 nMinDst, const bool bLabelAlignmentPosAndSpaceModeActive)
Definition: porfld.cxx:793
void SetAnimated(bool bNew)
Definition: porfld.hxx:196
std::unique_ptr< SvxBrushItem > m_pBrush
Definition: porfld.hxx:171
SwTwips m_nGrfHeight
Definition: porfld.hxx:174
bool IsAnimated() const
Definition: porfld.hxx:195
virtual ~SwGrfNumPortion() override
Definition: porfld.cxx:832
SwTwips GetGrfHeight() const
Definition: porfld.hxx:201
virtual bool Format(SwTextFormatInfo &rInf) override
We can create multiple NumFields Tricky, if one enters enough previous-text in the dialog box to caus...
Definition: porfld.cxx:853
sal_Int16 GetOrient() const
Definition: porfld.hxx:202
void StopAnimation(const OutputDevice *pOut)
Definition: porfld.cxx:843
virtual void Paint(const SwTextPaintInfo &rInf) const override
A hidden NumberPortion is not displayed, unless there are TextPortions in this line or there's only o...
Definition: porfld.cxx:918
SwTwips m_nYPos
Definition: porfld.hxx:173
void SetId(tools::Long nNew) const
Definition: porfld.hxx:198
virtual SwFieldPortion * Clone(const OUString &rExpand) const override
Definition: porfld.cxx:511
SwHiddenPortion(const OUString &rExpand, std::unique_ptr< SwFont > pFntL=nullptr)
Definition: porfld.hxx:124
virtual bool GetExpText(const SwTextSizeInfo &rInf, OUString &rText) const override
Definition: porfld.cxx:529
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: porfld.cxx:519
Collection of SwLinePortion instances, representing one line of text.
Definition: porlay.hxx:79
SwLineLayout * GetNext()
Definition: porlay.hxx:159
Base class for anything that can be part of a line in the Writer layout.
Definition: porlin.hxx:52
void dumpAsXmlAttributes(xmlTextWriterPtr writer, std::u16string_view rText, TextFrameIndex nOffset) const
Definition: porlin.cxx:333
virtual void FormatEOL(SwTextFormatInfo &rInf)
Definition: porlin.cxx:269
SwLinePortion * mpNextPortion
Definition: porlin.hxx:55
bool InTextGrp() const
Definition: porlin.hxx:105
SwLinePortion * GetNextPortion() const
Definition: porlin.hxx:75
void SetAscent(const SwTwips nNewAsc)
Definition: porlin.hxx:82
bool InNumberGrp() const
Definition: porlin.hxx:109
PortionType GetWhichPor() const
Definition: porlin.hxx:102
TextFrameIndex GetLen() const
Definition: porlin.hxx:77
void Truncate()
Definition: porlin.hxx:214
bool IsFootnotePortion() const
Definition: porlin.hxx:129
virtual SwLinePortion * Compress()
Definition: porlin.cxx:56
SwTwips & GetAscent()
Definition: porlin.hxx:80
bool IsQuoVadisPortion() const
Definition: porlin.hxx:123
void SetLen(TextFrameIndex const nLen)
Definition: porlin.hxx:78
bool IsGrfNumPortion() const
Definition: porlin.hxx:118
bool InFieldGrp() const
Definition: porlin.hxx:111
bool IsFlyPortion() const
Definition: porlin.hxx:134
bool IsFootnoteNumPortion() const
Definition: porlin.hxx:128
void SetWhichPor(const PortionType nNew)
Definition: porlin.hxx:101
SwTwips mnAscent
Definition: porlin.hxx:58
bool IsNumberPortion() const
Definition: porlin.hxx:144
void PrePaint(const SwTextPaintInfo &rInf, const SwLinePortion *pLast) const
Definition: porlin.cxx:77
sal_uInt16 m_nMinDist
Definition: porfld.hxx:138
SwNumberPortion(const OUString &rExpand, std::unique_ptr< SwFont > pFnt, const bool bLeft, const bool bCenter, const sal_uInt16 nMinDst, const bool bLabelAlignmentPosAndSpaceModeActive)
Definition: porfld.cxx:535
bool mbLabelAlignmentPosAndSpaceModeActive
Definition: porfld.hxx:139
sal_uInt16 m_nFixWidth
Definition: porfld.hxx:137
virtual void FormatEOL(SwTextFormatInfo &rInf) override
A FormatEOL indicates that the subsequent text did not fit onto the line anymore.
Definition: porfld.cxx:649
virtual void Paint(const SwTextPaintInfo &rInf) const override
A hidden NumberPortion is not displayed, unless there are TextPortions in this line or there's just o...
Definition: porfld.cxx:664
virtual SwFieldPortion * Clone(const OUString &rExpand) const override
Definition: porfld.cxx:557
virtual TextFrameIndex GetModelPositionForViewPoint(sal_uInt16 nOfst) const override
the parameter is actually SwTwips apparently?
Definition: porfld.cxx:552
virtual bool Format(SwTextFormatInfo &rInf) override
We can create multiple NumFields Tricky, if one enters enough previous-text in the dialog box to caus...
Definition: porfld.cxx:573
SwScriptInfo & GetScriptInfo()
Definition: porlay.hxx:291
The SwPortionHandler interface implements a visitor for the layout engine's text portions.
virtual void Special(TextFrameIndex nLength, const OUString &rText, PortionType nType)=0
special portion.
SwTwips Width() const
Definition: possiz.hxx:51
SwTwips Height() const
Definition: possiz.hxx:49
Used in footnotes if they break across pages, master has this portion at the end.
Definition: porftn.hxx:68
Of course Writer needs its own rectangles.
Definition: swrect.hxx:35
bool HasArea() const
Definition: swrect.hxx:300
bool Overlaps(const SwRect &rRect) const
Definition: swrect.hxx:374
SwViewShell * GetCurrShell() const
Definition: rootfrm.hxx:215
sal_uInt8 GetDefaultDir() const
Definition: scriptinfo.hxx:125
sal_uInt8 DirType(const TextFrameIndex nPos) const
Definition: porlay.cxx:1899
SwLinePortion * GetLast()
Definition: inftxt.hxx:566
void SetUnderScorePos(TextFrameIndex const nNew)
Definition: inftxt.hxx:647
void SetRest(SwLinePortion *pNewRest)
Definition: inftxt.hxx:582
sal_uInt16 ForcedLeftMargin() const
Definition: inftxt.hxx:556
void SetLineStart(TextFrameIndex const nNew)
Definition: inftxt.hxx:596
TextFrameIndex GetLineStart() const
Definition: inftxt.hxx:595
const SwLinePortion * GetUnderflow() const
Definition: inftxt.hxx:604
bool IsNumDone() const
Definition: inftxt.hxx:634
TextFrameIndex ScanPortionEnd(TextFrameIndex nStart, TextFrameIndex nEnd)
Definition: inftxt.cxx:1814
SwTwips Left() const
Definition: inftxt.hxx:547
SwLinePortion * GetRest()
Definition: inftxt.hxx:581
sal_uInt16 Width() const
Definition: inftxt.hxx:533
SwFlyPortion * GetFly()
Definition: inftxt.hxx:614
void SetNumDone(const bool bNew)
Definition: inftxt.hxx:635
TextFrameIndex GetUnderScorePos() const
Definition: inftxt.hxx:646
SwTwips First() const
Definition: inftxt.hxx:551
void SetHookChar(const sal_Unicode cNew)
Definition: inftxt.hxx:626
Represents the visualization of a paragraph.
Definition: txtfrm.hxx:168
SwDoc & GetDoc()
Definition: txtfrm.hxx:475
bool HasPara() const
Definition: txtfrm.hxx:853
void SwitchLTRtoRTL(SwRect &rRect) const
Calculates the coordinates of a rectangle when switching from LTR to RTL layout.
Definition: txtfrm.cxx:683
void SetAnimation() const
Definition: txtfrm.hxx:549
bool HasAnimation() const
Definition: txtfrm.hxx:551
void StopAnimation(const OutputDevice *pOut)
Stops the animations within numberings.
Definition: porfld.cxx:1078
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
SwTextNode const * GetTextNodeForParaProps() const
Definition: txtfrm.cxx:1390
SwParaPortion * GetParaPortion()
Definition: inftxt.hxx:121
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
const SwRect & GetPaintRect() const
Definition: inftxt.hxx:437
SwTwips X() const
Definition: inftxt.hxx:382
const Point & GetPos() const
Definition: inftxt.hxx:434
void CalcRect(const SwLinePortion &rPor, SwRect *pRect, SwRect *pIntersect=nullptr, const bool bInsideBox=false) const
Calculate the rectangular area where the portion takes place.
Definition: inftxt.cxx:735
void DrawBackBrush(const SwLinePortion &rPor) const
Definition: inftxt.cxx:1158
void DrawViewOpt(const SwLinePortion &rPor, PortionType nWhich, const Color *pColor=nullptr) const
Definition: inftxt.cxx:1470
SwTwips Y() const
Definition: inftxt.hxx:384
virtual bool Format(SwTextFormatInfo &rInf) override
Definition: portxt.cxx:442
SwTextFrame * GetTextFrame()
Definition: inftxt.hxx:288
vcl::RenderContext * GetOut()
Definition: inftxt.hxx:225
SwViewShell * GetVsh()
Definition: inftxt.hxx:222
const SwViewOption & GetOpt() const
Definition: inftxt.hxx:239
void SetLen(const TextFrameIndex nNew)
Definition: inftxt.hxx:276
sal_uInt16 GetTextHeight() const
Definition: inftxt.hxx:719
void NoteAnimation() const
Definition: inftxt.cxx:386
SwFont * GetFont()
Definition: inftxt.hxx:232
bool OnWin() const
Definition: inftxt.hxx:193
SwPosSize GetTextSize(OutputDevice *pOut, const SwScriptInfo *pSI, const OUString &rText, TextFrameIndex nIdx, TextFrameIndex nLen) const
Definition: inftxt.cxx:395
SwUnderlineFont * GetUnderFnt() const
Definition: inftxt.hxx:237
sal_uInt16 GetAscent() const
Definition: inftxt.hxx:713
TextFrameIndex GetLen() const
Definition: inftxt.hxx:275
void SetNotEOL(const bool bNew)
Definition: inftxt.hxx:196
const OUString & GetText() const
Definition: inftxt.hxx:240
TextFrameIndex GetIdx() const
Definition: inftxt.hxx:273
bool IsMulti() const
Definition: inftxt.hxx:204
For the text replacement and restoration of SwTextSizeInfo.
Definition: inftxt.hxx:680
void SetPos(const Point &rPoint)
Definition: swfont.hxx:980
const Point & GetPos() const
Definition: swfont.hxx:977
bool IsReadonly() const
Definition: viewopt.hxx:627
bool IsPagePreview() const
Definition: viewopt.hxx:799
bool IsShowPlaceHolderFields() const
Definition: viewopt.hxx:805
bool IsGraphic() const
Definition: viewopt.hxx:499
bool IsFieldShadings() const
Definition: viewopt.hxx:835
bool IsPreview() const
Definition: viewsh.hxx:517
vcl::Window * GetWin() const
Definition: viewsh.hxx:364
void InvalidateWindows(const SwRect &rRect)
Definition: viewsh.cxx:568
const SwAccessibilityOptions * GetAccessibilityOptions() const
Definition: viewsh.hxx:460
Fieldmark representing a date form field.
void SetPortionPaintAreaStart(const SwRect &rPortionPaintArea)
void SetPortionPaintAreaEnd(const SwRect &rPortionPaintArea)
Fieldmark representing a drop-down form field.
void SetPortionPaintArea(const SwRect &rPortionPaintArea)
const Size & GetFontSize() const
int nCount
struct _xmlTextWriter * xmlTextWriterPtr
float u
LINESTYLE_NONE
STRIKEOUT_NONE
#define GRFNUM_REPLACE
Definition: frmtool.hxx:57
#define GRFNUM_YES
Definition: frmtool.hxx:56
void DrawGraphic(const SvxBrushItem *, vcl::RenderContext &, const SwRect &rOrg, const SwRect &rOut, const sal_uInt8 nGrfNum=GRFNUM_NO, const bool bConsiderBackgroundTransparency=false)
Definition: paintfrm.cxx:1823
constexpr TypedWhichId< SvxBrushItem > RES_BACKGROUND(111)
#define CH_TXTATR_INWORD
Definition: hintids.hxx:175
#define CH_TXTATR_BREAKWORD
Definition: hintids.hxx:174
#define SAL_WARN(area, stream)
double getLength(const B2DPolygon &rCandidate)
int i
long Long
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
Definition: nodeoffset.hxx:35
OUTDEV_VIRDEV
#define GRFNUM_SECURE
Definition: porfld.cxx:791
const sal_Unicode CH_TAB
Definition: swfont.hxx:44
#define SW_SCRIPTS
Definition: swfont.hxx:129
const sal_Unicode CH_BREAK
Definition: swfont.hxx:43
SwFontScript
Definition: swfont.hxx:124
#define CHAR_HARDBLANK
Definition: swtypes.hxx:173
#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
unsigned char sal_uInt8
sal_uInt16 sal_Unicode
sal_uInt32 sal_UCS4
oslFileHandle & pOut