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 switch (nNew)
394 {
395 case CH_BREAK : bFull = true;
396 [[fallthrough]];
397 case ' ' :
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 aNew = aNew.copy( 1 );
408 ++nNextOfst;
409 break;
410 }
411 default: ;
412 }
413
414 // Even if there is no more text left for a follow field,
415 // we have to build a follow field portion (without font),
416 // otherwise the HookChar mechanism would not work.
417 SwFieldPortion *pField = Clone( aNew );
418 if( !aNew.isEmpty() && !pField->GetFont() )
419 {
420 pField->SetFont( std::make_unique<SwFont>( *rInf.GetFont() ) );
421 }
422 pField->SetFollow( true );
423 if (pField->Compress())
424 { // empty pField will be deleted in SwLineLayout::CalcLine()
425 // anyway so make sure this one doesn't have a stale flag
426 SetHasFollow( true );
427 }
428
429 // For a newly created field, nNextOffset contains the Offset
430 // of its start of the original string
431 // If a FollowField is created when formatting, this FollowField's
432 // Offset is being held in nNextOffset
433 m_nNextOffset = m_nNextOffset + nNextOfst;
434 pField->SetNextOffset( m_nNextOffset );
435 rInf.SetRest( pField );
436 }
437 }
438
439 if( bEOL && rInf.GetLast() && !rInf.GetUnderflow() )
440 rInf.GetLast()->FormatEOL( rInf );
441 return bFull;
442}
443
444void SwFieldPortion::Paint( const SwTextPaintInfo &rInf ) const
445{
446 SwFontSave aSave( rInf, m_pFont.get() );
447
448// OSL_ENSURE(GetLen() <= TextFrameIndex(1), "SwFieldPortion::Paint: rest-portion pollution?");
450 {
451 // A very liberal use of the background
452 rInf.DrawViewOpt( *this, PortionType::Field );
454 }
455}
456
457bool SwFieldPortion::GetExpText( const SwTextSizeInfo &rInf, OUString &rText ) const
458{
459 rText = m_aExpand;
460 if( rText.isEmpty() && rInf.OnWin() &&
461 !rInf.GetOpt().IsPagePreview() && !rInf.GetOpt().IsReadonly() &&
462 rInf.GetOpt().IsFieldShadings() &&
463 !HasFollow() )
464 rText = " ";
465 return true;
466}
467
469{
470 rPH.Special( GetLen(), m_aExpand, GetWhichPor() );
471}
472
473void SwFieldPortion::dumpAsXml(xmlTextWriterPtr pWriter, const OUString& rText,
474 TextFrameIndex& nOffset) const
475{
476 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwFieldPortion"));
477 dumpAsXmlAttributes(pWriter, rText, nOffset);
478 nOffset += GetLen();
479
480 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("expand"), BAD_CAST(m_aExpand.toUtf8().getStr()));
481
482 if (m_pFont)
483 {
484 m_pFont->dumpAsXml(pWriter);
485 }
486
487 (void)xmlTextWriterEndElement(pWriter);
488}
489
491{
492 SwFontSave aSave( rInf, m_pFont.get() );
494 return aSize;
495}
496
497SwFieldPortion *SwHiddenPortion::Clone(const OUString &rExpand ) const
498{
499 std::unique_ptr<SwFont> pNewFnt;
500 if( m_pFont )
501 pNewFnt.reset(new SwFont( *m_pFont ));
502 return new SwHiddenPortion( rExpand, std::move(pNewFnt) );
503}
504
506{
507 if( Width() )
508 {
509 SwFontSave aSave( rInf, m_pFont.get() );
510 rInf.DrawViewOpt( *this, PortionType::Hidden );
512 }
513}
514
515bool SwHiddenPortion::GetExpText( const SwTextSizeInfo &rInf, OUString &rText ) const
516{
517 // Do not query for IsHidden()!
518 return SwFieldPortion::GetExpText( rInf, rText );
519}
520
521SwNumberPortion::SwNumberPortion( const OUString &rExpand,
522 std::unique_ptr<SwFont> pFont,
523 const bool bLft,
524 const bool bCntr,
525 const sal_uInt16 nMinDst,
526 const bool bLabelAlignmentPosAndSpaceModeActive )
527 : SwFieldPortion( rExpand, std::move(pFont) ),
528 m_nFixWidth(0),
529 m_nMinDist( nMinDst ),
530 mbLabelAlignmentPosAndSpaceModeActive( bLabelAlignmentPosAndSpaceModeActive )
531{
533 SetLeft( bLft );
534 SetHide( false );
535 SetCenter( bCntr );
536}
537
539{
540 return TextFrameIndex(0);
541}
542
543SwFieldPortion *SwNumberPortion::Clone( const OUString &rExpand ) const
544{
545 std::unique_ptr<SwFont> pNewFnt;
546 if( m_pFont )
547 pNewFnt.reset(new SwFont( *m_pFont ));
548
549 return new SwNumberPortion( rExpand, std::move(pNewFnt), IsLeft(), IsCenter(),
551}
552
560{
561 SetHide( false );
562 const bool bFull = SwFieldPortion::Format( rInf );
564 // a numbering portion can be contained in a rotated portion!!!
565 m_nFixWidth = rInf.IsMulti() ? Height() : Width();
566 rInf.SetNumDone( !rInf.GetRest() );
567 if( rInf.IsNumDone() )
568 {
569// SetAscent( rInf.GetAscent() );
570 OSL_ENSURE( Height() && mnAscent, "NumberPortions without Height | Ascent" );
571
572 tools::Long nDiff( 0 );
573
575 {
577 // #i32902#
579 {
580 nDiff = rInf.Left()
582 GetSwAttrSet().GetFirstLineIndent().GetTextFirstLineOffset()
583 - rInf.First()
584 + rInf.ForcedLeftMargin();
585 }
586 else
587 {
588 nDiff = rInf.Left() - rInf.First() + rInf.ForcedLeftMargin();
589 }
590 }
591 // The text part of the numbering should always at least
592 // start at the left margin
593 if( nDiff < 0 )
594 nDiff = 0;
595 else if ( nDiff > rInf.X() )
596 nDiff -= rInf.X();
597 else
598 nDiff = 0;
599
600 if( nDiff < m_nFixWidth + m_nMinDist )
601 nDiff = m_nFixWidth + m_nMinDist;
602
603 // Numbering evades the Fly, no nDiff in the second round
604 // Tricky special case: FlyFrame is in an Area we're just about to
605 // acquire
606 // The NumberPortion is marked as hidden
607 const bool bFly = rInf.GetFly() ||
608 ( rInf.GetLast() && rInf.GetLast()->IsFlyPortion() );
609 if( nDiff > rInf.Width() )
610 {
611 nDiff = rInf.Width();
612 if ( bFly )
613 SetHide( true );
614 }
615
616 // A numbering portion can be inside a SwRotatedPortion. Then the
617 // Height has to be changed
618 if ( rInf.IsMulti() )
619 {
620 if ( Height() < nDiff )
621 Height( nDiff );
622 }
623 else if( Width() < nDiff )
624 Width( nDiff );
625 }
626 return bFull;
627}
628
629
636{
637
638 // This caused trouble with flys anchored as characters.
639 // If one of these is numbered but does not fit to the line,
640 // it calls this function, causing a loop because both the number
641 // portion and the fly portion go to the next line
642// SetHide( true );
643}
644
645
651{
652 if ( IsHide() && rInf.GetParaPortion() && rInf.GetParaPortion()->GetNext() )
653 {
655 while ( pTmp && !pTmp->InTextGrp() )
656 pTmp = pTmp->GetNextPortion();
657 if ( !pTmp )
658 return;
659 }
660
661 // calculate the width of the number portion, including follows
662 const sal_uInt16 nOldWidth = Width();
663 sal_uInt16 nSumWidth = 0;
664 sal_uInt16 nOffset = 0;
665
666 const SwLinePortion* pTmp = this;
667 while ( pTmp && pTmp->InNumberGrp() )
668 {
669 nSumWidth = nSumWidth + pTmp->Width();
670 if ( static_cast<const SwNumberPortion*>(pTmp)->HasFollow() )
671 pTmp = pTmp->GetNextPortion();
672 else
673 {
674 nOffset = pTmp->Width() - static_cast<const SwNumberPortion*>(pTmp)->m_nFixWidth;
675 break;
676 }
677 }
678
679 // The master portion takes care for painting the background of the
680 // follow field portions
681 if ( ! IsFollow() )
682 {
683 SwNumberPortion *pThis = const_cast<SwNumberPortion*>(this);
684 pThis->Width( nSumWidth );
685 rInf.DrawViewOpt( *this, PortionType::Number );
686 pThis->Width( nOldWidth );
687 }
688
689 if( m_aExpand.isEmpty() )
690 return;
691
692 const SwFont *pTmpFnt = rInf.GetFont();
693 bool bPaintSpace = ( LINESTYLE_NONE != pTmpFnt->GetUnderline() ||
694 LINESTYLE_NONE != pTmpFnt->GetOverline() ||
695 STRIKEOUT_NONE != pTmpFnt->GetStrikeout() ) &&
696 !pTmpFnt->IsWordLineMode();
697 if( bPaintSpace && m_pFont )
698 bPaintSpace = ( LINESTYLE_NONE != m_pFont->GetUnderline() ||
699 LINESTYLE_NONE != m_pFont->GetOverline() ||
700 STRIKEOUT_NONE != m_pFont->GetStrikeout() ) &&
701 !m_pFont->IsWordLineMode();
702
703 SwFontSave aSave( rInf, m_pFont.get() );
704
705 if( m_nFixWidth == Width() && ! HasFollow() )
707 else
708 {
709 // logical const: reset width
710 SwNumberPortion *pThis = const_cast<SwNumberPortion*>(this);
711 bPaintSpace = bPaintSpace && m_nFixWidth < nOldWidth;
712 sal_uInt16 nSpaceOffs = m_nFixWidth;
713 pThis->Width( m_nFixWidth );
714
715 if( ( IsLeft() && ! rInf.GetTextFrame()->IsRightToLeft() ) ||
716 ( ! IsLeft() && ! IsCenter() && rInf.GetTextFrame()->IsRightToLeft() ) )
718 else
719 {
720 SwTextPaintInfo aInf( rInf );
721 if( nOffset < m_nMinDist )
722 nOffset = 0;
723 else
724 {
725 if( IsCenter() )
726 {
727 /* #110778# a / 2 * 2 == a is not a tautology */
728 sal_uInt16 nTmpOffset = nOffset;
729 nOffset /= 2;
730 if( nOffset < m_nMinDist )
731 nOffset = nTmpOffset - m_nMinDist;
732 }
733 else
734 nOffset = nOffset - m_nMinDist;
735 }
736 aInf.X( aInf.X() + nOffset );
738 if( bPaintSpace )
739 nSpaceOffs = nSpaceOffs + nOffset;
740 }
741 if( bPaintSpace && nOldWidth > nSpaceOffs )
742 {
743 SwTextPaintInfo aInf( rInf );
744 aInf.X( aInf.X() + nSpaceOffs );
745
746 // #i53199# Adjust position of underline:
747 if ( rInf.GetUnderFnt() )
748 {
749 const Point aNewPos( aInf.GetPos().X(), rInf.GetUnderFnt()->GetPos().Y() );
750 rInf.GetUnderFnt()->SetPos( aNewPos );
751 }
752
753 pThis->Width( nOldWidth - nSpaceOffs + 12 );
754 {
755 SwTextSlot aDiffText( &aInf, this, true, false, " " );
756 aInf.DrawText( *this, aInf.GetLen(), true );
757 }
758 }
759 pThis->Width( nOldWidth );
760 }
761}
762
764 std::u16string_view rBulletFollowedBy,
765 std::unique_ptr<SwFont> pFont,
766 const bool bLft,
767 const bool bCntr,
768 const sal_uInt16 nMinDst,
769 const bool bLabelAlignmentPosAndSpaceModeActive )
770 : SwNumberPortion( OUString(&cBullet, 1) + rBulletFollowedBy,
771 std::move(pFont), bLft, bCntr, nMinDst,
772 bLabelAlignmentPosAndSpaceModeActive )
773{
775}
776
777#define GRFNUM_SECURE 10
778
780 const OUString& rGraphicFollowedBy,
781 const SvxBrushItem* pGrfBrush, OUString const & referer,
782 const SwFormatVertOrient* pGrfOrient, const Size& rGrfSize,
783 const bool bLft, const bool bCntr, const sal_uInt16 nMinDst,
784 const bool bLabelAlignmentPosAndSpaceModeActive ) :
785 SwNumberPortion( rGraphicFollowedBy, nullptr, bLft, bCntr, nMinDst,
786 bLabelAlignmentPosAndSpaceModeActive ),
787 m_pBrush( new SvxBrushItem(RES_BACKGROUND) ), m_nId( 0 )
788{
790 SetAnimated( false );
791 m_bReplace = false;
792 if( pGrfBrush )
793 {
794 m_pBrush.reset(pGrfBrush->Clone());
795 const Graphic* pGraph = pGrfBrush->GetGraphic(referer);
796 if( pGraph )
797 SetAnimated( pGraph->IsAnimated() );
798 else
799 m_bReplace = true;
800 }
801 if( pGrfOrient )
802 {
803 m_nYPos = pGrfOrient->GetPos();
804 m_eOrient = pGrfOrient->GetVertOrient();
805 }
806 else
807 {
808 m_nYPos = 0;
809 m_eOrient = text::VertOrientation::TOP;
810 }
811 Width( rGrfSize.Width() + 2 * GRFNUM_SECURE );
812 m_nFixWidth = Width();
813 m_nGrfHeight = rGrfSize.Height() + 2 * GRFNUM_SECURE;
814 Height( sal_uInt16(m_nGrfHeight) );
815 m_bNoPaint = false;
816}
817
819{
820 if ( IsAnimated() )
821 {
822 Graphic* pGraph = const_cast<Graphic*>(m_pBrush->GetGraphic());
823 if (pGraph)
824 pGraph->StopAnimation( nullptr, m_nId );
825 }
826 m_pBrush.reset();
827}
828
830{
831 if ( IsAnimated() )
832 {
833 Graphic* pGraph = const_cast<Graphic*>(m_pBrush->GetGraphic());
834 if (pGraph)
835 pGraph->StopAnimation( pOut, m_nId );
836 }
837}
838
840{
841 SetHide( false );
842// Width( nFixWidth );
843 sal_uInt16 nFollowedByWidth( 0 );
845 {
847 nFollowedByWidth = Width();
849 }
850 Width( m_nFixWidth + nFollowedByWidth );
851 const bool bFull = rInf.Width() < rInf.X() + Width();
852 const bool bFly = rInf.GetFly() ||
853 ( rInf.GetLast() && rInf.GetLast()->IsFlyPortion() );
854 SetAscent( GetRelPos() > 0 ? GetRelPos() : 0 );
855 if( GetAscent() > Height() )
856 Height( GetAscent() );
857
858 if( bFull )
859 {
860 Width( rInf.Width() - rInf.X() );
861 if( bFly )
862 {
864 m_bNoPaint = true;
865 rInf.SetNumDone( false );
866 return true;
867 }
868 }
869 rInf.SetNumDone( true );
870// long nDiff = rInf.Left() - rInf.First() + rInf.ForcedLeftMargin();
872 ? 0
873 : rInf.Left() - rInf.First() + rInf.ForcedLeftMargin();
874 // The TextPortion should at least always start on the
875 // left margin
876 if( nDiff < 0 )
877 nDiff = 0;
878 else if ( nDiff > rInf.X() )
879 nDiff -= rInf.X();
880 if( nDiff < m_nFixWidth + m_nMinDist )
881 nDiff = m_nFixWidth + m_nMinDist;
882
883 // Numbering evades Fly, no nDiff in the second round
884 // Tricky special case: FlyFrame is in the Area we were just
885 // about to get a hold of.
886 // The NumberPortion is marked as hidden
887 if( nDiff > rInf.Width() )
888 {
889 nDiff = rInf.Width();
890 if( bFly )
891 SetHide( true );
892 }
893
894 if( Width() < nDiff )
895 Width( nDiff );
896 return bFull;
897}
898
899
905{
906 if( m_bNoPaint )
907 return;
908 if ( IsHide() && rInf.GetParaPortion() && rInf.GetParaPortion()->GetNext() )
909 {
911 while ( pTmp && !pTmp->InTextGrp() )
912 pTmp = pTmp->GetNextPortion();
913 if ( !pTmp )
914 return;
915 }
916 Point aPos( rInf.X() + GRFNUM_SECURE, rInf.Y() - GetRelPos() + GRFNUM_SECURE );
917 tools::Long nTmpWidth = std::max( tools::Long(0), static_cast<tools::Long>(m_nFixWidth - 2 * GRFNUM_SECURE) );
918 Size aSize( nTmpWidth, GetGrfHeight() - 2 * GRFNUM_SECURE );
919
920 const bool bTmpLeft = mbLabelAlignmentPosAndSpaceModeActive ||
921 ( IsLeft() && ! rInf.GetTextFrame()->IsRightToLeft() ) ||
922 ( ! IsLeft() && ! IsCenter() && rInf.GetTextFrame()->IsRightToLeft() );
923
924 if( m_nFixWidth < Width() && !bTmpLeft )
925 {
926 sal_uInt16 nOffset = Width() - m_nFixWidth;
927 if( nOffset < m_nMinDist )
928 nOffset = 0;
929 else
930 {
931 if( IsCenter() )
932 {
933 nOffset /= 2;
934 if( nOffset < m_nMinDist )
935 nOffset = Width() - m_nFixWidth - m_nMinDist;
936 }
937 else
938 nOffset = nOffset - m_nMinDist;
939 }
940 aPos.AdjustX(nOffset );
941 }
942
943 if( m_bReplace )
944 {
945 const tools::Long nTmpH = GetNextPortion() ? GetNextPortion()->GetAscent() : 120;
946 aSize = Size( nTmpH, nTmpH );
947 aPos.setY( rInf.Y() - nTmpH );
948 }
949 SwRect aTmp( aPos, aSize );
950
951 bool bDraw = true;
952
953 if ( IsAnimated() )
954 {
955 bDraw = !rInf.GetOpt().IsGraphic();
956 if( !m_nId )
957 {
958 SetId( reinterpret_cast<sal_IntPtr>( rInf.GetTextFrame() ) );
959 rInf.GetTextFrame()->SetAnimation();
960 }
961 if( aTmp.Overlaps( rInf.GetPaintRect() ) && !bDraw )
962 {
963 rInf.NoteAnimation();
964 const SwViewShell* pViewShell = rInf.GetVsh();
965
966 // virtual device, not pdf export
967 if( OUTDEV_VIRDEV == rInf.GetOut()->GetOutDevType() &&
968 pViewShell && pViewShell->GetWin() )
969 {
970 Graphic* pGraph = const_cast<Graphic*>(m_pBrush->GetGraphic());
971 if (pGraph)
972 pGraph->StopAnimation(nullptr,m_nId);
974 }
975
976 else if ( pViewShell &&
978 !pViewShell->IsPreview() &&
979 // #i9684# Stop animation during printing/pdf export.
980 pViewShell->GetWin() )
981 {
982 Graphic* pGraph = const_cast<Graphic*>(m_pBrush->GetGraphic());
983 if (pGraph)
984 {
985 const OutputDevice* pOut = rInf.GetOut();
986 assert(pOut);
987 pGraph->StartAnimation(
988 *const_cast<OutputDevice*>(pOut), aPos, aSize, m_nId);
989 }
990 }
991
992 // pdf export, printing, preview, stop animations...
993 else
994 bDraw = true;
995 }
996 if( bDraw )
997 {
998
999 Graphic* pGraph = const_cast<Graphic*>(m_pBrush->GetGraphic());
1000 if (pGraph)
1001 pGraph->StopAnimation( nullptr, m_nId );
1002 }
1003 }
1004
1005 SwRect aRepaint( rInf.GetPaintRect() );
1006 const SwTextFrame& rFrame = *rInf.GetTextFrame();
1007 if( rFrame.IsVertical() )
1008 {
1009 rFrame.SwitchHorizontalToVertical( aTmp );
1010 rFrame.SwitchHorizontalToVertical( aRepaint );
1011 }
1012
1013 if( rFrame.IsRightToLeft() )
1014 {
1015 rFrame.SwitchLTRtoRTL( aTmp );
1016 rFrame.SwitchLTRtoRTL( aRepaint );
1017 }
1018
1019 if( bDraw && aTmp.HasArea() )
1020 {
1021 const OutputDevice* pOut = rInf.GetOut();
1022 assert(pOut);
1023 DrawGraphic( m_pBrush.get(), *const_cast<OutputDevice*>(pOut),
1024 aTmp, aRepaint, m_bReplace ? GRFNUM_REPLACE : GRFNUM_YES );
1025 }
1026}
1027
1029 tools::Long nFlyAsc, tools::Long nFlyDesc )
1030{
1032 return;
1033
1034 SetRelPos( 0 );
1035 if ( GetOrient() == text::VertOrientation::CENTER )
1036 SetRelPos( GetGrfHeight() / 2 );
1037 else if ( GetOrient() == text::VertOrientation::TOP )
1039 else if ( GetOrient() == text::VertOrientation::BOTTOM )
1040 ;
1041 else if ( GetOrient() == text::VertOrientation::CHAR_CENTER )
1042 SetRelPos( ( GetGrfHeight() + nLnAscent - nLnDescent ) / 2 );
1043 else if ( GetOrient() == text::VertOrientation::CHAR_TOP )
1044 SetRelPos( nLnAscent );
1045 else if ( GetOrient() == text::VertOrientation::CHAR_BOTTOM )
1046 SetRelPos( GetGrfHeight() - nLnDescent );
1047 else
1048 {
1049 if( GetGrfHeight() >= nFlyAsc + nFlyDesc )
1050 {
1051 // If I'm as large as the line, I do not need to adjust
1052 // at the line; I'll leave the max. ascent unchanged
1053 SetRelPos( nFlyAsc );
1054 }
1055 else if ( GetOrient() == text::VertOrientation::LINE_CENTER )
1056 SetRelPos( ( GetGrfHeight() + nFlyAsc - nFlyDesc ) / 2 );
1057 else if ( GetOrient() == text::VertOrientation::LINE_TOP )
1058 SetRelPos( nFlyAsc );
1059 else if ( GetOrient() == text::VertOrientation::LINE_BOTTOM )
1060 SetRelPos( GetGrfHeight() - nFlyDesc );
1061 }
1062}
1063
1065{
1066 OSL_ENSURE( HasAnimation(), "SwTextFrame::StopAnimation: Which Animation?" );
1067 if( !HasPara() )
1068 return;
1069
1070 SwLineLayout *pLine = GetPara();
1071 while( pLine )
1072 {
1073 SwLinePortion *pPor = pLine->GetNextPortion();
1074 while( pPor )
1075 {
1076 if( pPor->IsGrfNumPortion() )
1077 static_cast<SwGrfNumPortion*>(pPor)->StopAnimation( pOut );
1078 // The NumberPortion is always at the first char,
1079 // which means we can cancel as soon as we've reached a portion
1080 // with a length > 0
1081 pPor = pPor->GetLen() ? nullptr : pPor->GetNextPortion();
1082 }
1083 pLine = pLine->GetLen() ? nullptr : pLine->GetNext();
1084 }
1085}
1086
1091 : SwFieldPortion( rText )
1092 , m_aWidth{ static_cast<sal_uInt16>(0),
1093 static_cast<sal_uInt16>(0),
1094 static_cast<sal_uInt16>(0) }
1095 , m_nUpPos(0)
1096 , m_nLowPos(0)
1097 , m_nProportion(55)
1098{
1101 if( m_aExpand.getLength() > 6 )
1102 m_aExpand = m_aExpand.copy( 0, 6 );
1103
1104 // Initialization of the scripttype array,
1105 // the arrays of width and position are filled by the format function
1106 assert(g_pBreakIt && g_pBreakIt->GetBreakIter().is());
1107
1108 SwFontScript nScr = SW_SCRIPTS;
1109 for( sal_Int32 i = 0; i < rText.getLength(); ++i )
1110 {
1111 switch ( g_pBreakIt->GetBreakIter()->getScriptType( rText, i ) ) {
1112 case i18n::ScriptType::LATIN : nScr = SwFontScript::Latin; break;
1113 case i18n::ScriptType::ASIAN : nScr = SwFontScript::CJK; break;
1114 case i18n::ScriptType::COMPLEX : nScr = SwFontScript::CTL; break;
1115 }
1116 m_aScrType[i] = nScr;
1117 }
1118}
1119
1121{
1122 OSL_ENSURE(GetLen() <= TextFrameIndex(1), "SwFieldPortion::Paint: rest-portion pollution?");
1123 if( !Width() )
1124 return;
1125
1126 rInf.DrawBackBrush( *this );
1127 rInf.DrawViewOpt( *this, PortionType::Field );
1128
1129 // do we have to repaint a post it portion?
1130 if( rInf.OnWin() && mpNextPortion && !mpNextPortion->Width() )
1131 mpNextPortion->PrePaint( rInf, this );
1132
1133 const sal_Int32 nCount = m_aExpand.getLength();
1134 if( !nCount )
1135 return;
1136 OSL_ENSURE( nCount < 7, "Too much combined characters" );
1137
1138 // the first character of the second row
1139 const sal_Int32 nTop = ( nCount + 1 ) / 2;
1140
1141 SwFont aTmpFont( *rInf.GetFont() );
1142 aTmpFont.SetProportion( m_nProportion ); // a smaller font
1143 SwFontSave aFontSave( rInf, &aTmpFont );
1144
1145 Point aOldPos = rInf.GetPos();
1146 Point aOutPos( aOldPos.X(), aOldPos.Y() - m_nUpPos );// Y of the first row
1147 for( sal_Int32 i = 0 ; i < nCount; ++i )
1148 {
1149 if( i == nTop ) // change the row
1150 aOutPos.setY( aOldPos.Y() + m_nLowPos ); // Y of the second row
1151 aOutPos.setX( aOldPos.X() + m_aPos[i] ); // X position
1152 const SwFontScript nAct = m_aScrType[i]; // script type
1153 aTmpFont.SetActual( nAct );
1154
1155 // if there're more than 4 characters to display, we choose fonts
1156 // with 2/3 of the original font width.
1157 if( m_aWidth[ nAct ] )
1158 {
1159 Size aTmpSz = aTmpFont.GetSize( nAct );
1160 if( aTmpSz.Width() != m_aWidth[ nAct ] )
1161 {
1162 aTmpSz.setWidth( m_aWidth[ nAct ] );
1163 aTmpFont.SetSize( aTmpSz, nAct );
1164 }
1165 }
1166 const_cast<SwTextPaintInfo&>(rInf).SetPos( aOutPos );
1168 }
1169 // rInf is const, so we have to take back our manipulations
1170 const_cast<SwTextPaintInfo&>(rInf).SetPos( aOldPos );
1171
1172}
1173
1175{
1176 const sal_Int32 nCount = m_aExpand.getLength();
1177 if( !nCount )
1178 {
1179 Width( 0 );
1180 return false;
1181 }
1182
1183 OSL_ENSURE( nCount < 7, "Too much combined characters" );
1184
1185 // If there are leading "weak"-scripttyped characters in this portion,
1186 // they get the actual scripttype.
1187 for( sal_Int32 i = 0; i < nCount && SW_SCRIPTS == m_aScrType[i]; ++i )
1188 m_aScrType[i] = rInf.GetFont()->GetActual();
1189 if( nCount > 4 )
1190 {
1191 // more than four? Ok, then we need the 2/3 font width
1192 for( sal_Int32 i = 0; i < m_aExpand.getLength(); ++i )
1193 {
1194 OSL_ENSURE( m_aScrType[i] < SW_SCRIPTS, "Combined: Script fault" );
1195 if( !m_aWidth[ m_aScrType[i] ] )
1196 {
1197 rInf.GetOut()->SetFont( rInf.GetFont()->GetFnt( m_aScrType[i] ) );
1198 m_aWidth[ m_aScrType[i] ] =
1199 o3tl::narrowing<sal_uInt16>(2 * rInf.GetOut()->GetFontMetric().GetFontSize().Width() / 3);
1200 }
1201 }
1202 }
1203
1204 const sal_Int32 nTop = ( nCount + 1 ) / 2; // the first character of the second line
1206 SwFont aTmpFont( *rInf.GetFont() );
1207 SwFontSave aFontSave( rInf, &aTmpFont );
1208 m_nProportion = 55;
1209 // In nMainAscent/Descent we store the ascent and descent
1210 // of the original surrounding font
1211 sal_uInt16 nMaxDescent, nMaxAscent, nMaxWidth;
1212 sal_uInt16 nMainDescent = rInf.GetFont()->GetHeight( pSh, *rInf.GetOut() );
1213 const sal_uInt16 nMainAscent = rInf.GetFont()->GetAscent( pSh, *rInf.GetOut() );
1214 nMainDescent = nMainDescent - nMainAscent;
1215 // we start with a 50% font, but if we notice that the combined portion
1216 // becomes bigger than the surrounding font, we check 45% and maybe 40%.
1217 do
1218 {
1219 m_nProportion -= 5;
1220 aTmpFont.SetProportion( m_nProportion );
1221 memset( &m_aPos, 0, sizeof(m_aPos) );
1222 nMaxDescent = 0;
1223 nMaxAscent = 0;
1224 nMaxWidth = 0;
1225 m_nUpPos = m_nLowPos = 0;
1226
1227 // Now we get the width of all characters.
1228 // The ascent and the width of the first line are stored in the
1229 // ascent member of the portion, the descent in nLowPos.
1230 // The ascent, descent and width of the second line are stored in the
1231 // local nMaxAscent, nMaxDescent and nMaxWidth variables.
1232 for( sal_Int32 i = 0; i < nCount; ++i )
1233 {
1234 SwFontScript nScrp = m_aScrType[i];
1235 aTmpFont.SetActual( nScrp );
1236 if( m_aWidth[ nScrp ] )
1237 {
1238 Size aFontSize( aTmpFont.GetSize( nScrp ) );
1239 aFontSize.setWidth( m_aWidth[ nScrp ] );
1240 aTmpFont.SetSize( aFontSize, nScrp );
1241 }
1242
1243 SwDrawTextInfo aDrawInf(pSh, *rInf.GetOut(), m_aExpand, i, 1);
1244 Size aSize = aTmpFont.GetTextSize_( aDrawInf );
1245 const sal_uInt16 nAsc = aTmpFont.GetAscent( pSh, *rInf.GetOut() );
1246 m_aPos[ i ] = o3tl::narrowing<sal_uInt16>(aSize.Width());
1247 if( i == nTop ) // enter the second line
1248 {
1249 m_nLowPos = nMaxDescent;
1250 Height( nMaxDescent + nMaxAscent );
1251 Width( nMaxWidth );
1252 SetAscent( nMaxAscent );
1253 nMaxAscent = 0;
1254 nMaxDescent = 0;
1255 nMaxWidth = 0;
1256 }
1257 nMaxWidth = nMaxWidth + m_aPos[ i ];
1258 if( nAsc > nMaxAscent )
1259 nMaxAscent = nAsc;
1260 if( aSize.Height() - nAsc > nMaxDescent )
1261 nMaxDescent = aSize.Height() - nAsc;
1262 }
1263 // for one or two characters we double the width of the portion
1264 if( nCount < 3 )
1265 {
1266 nMaxWidth *= 2;
1267 Width( 2*Width() );
1268 if( nCount < 2 )
1269 {
1270 Height( nMaxAscent + nMaxDescent );
1271 m_nLowPos = nMaxDescent;
1272 }
1273 }
1274 Height( Height() + nMaxDescent + nMaxAscent );
1275 m_nUpPos = nMaxAscent;
1276 SetAscent( Height() - nMaxDescent - m_nLowPos );
1277 } while( m_nProportion > 40 && ( GetAscent() > nMainAscent ||
1278 Height() - GetAscent() > nMainDescent ) );
1279 // if the combined portion is smaller than the surrounding text,
1280 // the portion grows. This looks better, if there's a character background.
1281 if( GetAscent() < nMainAscent )
1282 {
1283 Height( Height() + nMainAscent - GetAscent() );
1284 SetAscent( nMainAscent );
1285 }
1286 if( Height() < nMainAscent + nMainDescent )
1287 Height( nMainAscent + nMainDescent );
1288
1289 // We calculate the x positions of the characters in both lines...
1290 sal_uInt16 nTopDiff = 0;
1291 sal_uInt16 nBotDiff = 0;
1292 if( nMaxWidth > Width() )
1293 {
1294 nTopDiff = ( nMaxWidth - Width() ) / 2;
1295 Width( nMaxWidth );
1296 }
1297 else
1298 nBotDiff = ( Width() - nMaxWidth ) / 2;
1299 switch( nTop)
1300 {
1301 case 3: m_aPos[1] = m_aPos[0] + nTopDiff;
1302 [[fallthrough]];
1303 case 2: m_aPos[nTop-1] = Width() - m_aPos[nTop-1];
1304 }
1305 m_aPos[0] = 0;
1306 switch( nCount )
1307 {
1308 case 5: m_aPos[4] = m_aPos[3] + nBotDiff;
1309 [[fallthrough]];
1310 case 3: m_aPos[nTop] = nBotDiff; break;
1311 case 6: m_aPos[4] = m_aPos[3] + nBotDiff;
1312 [[fallthrough]];
1313 case 4: m_aPos[nTop] = 0;
1314 [[fallthrough]];
1315 case 2: m_aPos[nCount-1] = Width() - m_aPos[nCount-1];
1316 }
1317
1318 // Does the combined portion fit the line?
1319 const bool bFull = rInf.Width() < rInf.X() + Width();
1320 if( bFull )
1321 {
1322 if( rInf.GetLineStart() == rInf.GetIdx() && (!rInf.GetLast()->InFieldGrp()
1323 || !static_cast<SwFieldPortion*>(rInf.GetLast())->IsFollow() ) )
1324 Width( rInf.Width() - rInf.X() );
1325 else
1326 {
1327 Truncate();
1328 Width( 0 );
1330 if( rInf.GetLast() )
1331 rInf.GetLast()->FormatEOL( rInf );
1332 }
1333 }
1334 return bFull;
1335}
1336
1338{
1339 if( !GetLen() ) // for the dummy part at the end of the line, where
1340 return 0; // the combined portion doesn't fit.
1341 return SwFieldPortion::GetViewWidth( rInf );
1342}
1343
1345{
1346 return new SwFieldFormDropDownPortion(m_pFieldMark, rExpand);
1347}
1348
1350{
1351 SwFieldPortion::Paint( rInf );
1352
1353 ::sw::mark::DropDownFieldmark* pDropDownField = dynamic_cast< ::sw::mark::DropDownFieldmark* >(m_pFieldMark);
1354 if(pDropDownField)
1355 {
1356 SwRect aPaintArea;
1357 rInf.CalcRect( *this, &aPaintArea );
1358 pDropDownField->SetPortionPaintArea(aPaintArea);
1359 }
1360}
1361
1362SwFieldPortion *SwFieldFormDatePortion::Clone(const OUString &/*rExpand*/) const
1363{
1365}
1366
1368{
1369 SwFieldPortion::Paint( rInf );
1370
1371 ::sw::mark::DateFieldmark* pDateField = dynamic_cast< ::sw::mark::DateFieldmark* >(m_pFieldMark);
1372 if(pDateField)
1373 {
1374 SwRect aPaintArea;
1375 rInf.CalcRect( *this, &aPaintArea );
1376 if(m_bStart)
1377 pDateField->SetPortionPaintAreaStart(aPaintArea);
1378 else
1379 pDateField->SetPortionPaintAreaEnd(aPaintArea);
1380 }
1381}
1382
1383/* 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 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:763
SwFontScript m_aScrType[6]
Definition: porfld.hxx:217
virtual sal_uInt16 GetViewWidth(const SwTextSizeInfo &rInf) const override
Definition: porfld.cxx:1337
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:1174
SwCombinedPortion(const OUString &rExpand)
Initializes the script array and clears the width array.
Definition: porfld.cxx:1090
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:1120
IDocumentSettingAccess const & getIDocumentSettingAccess() const
Definition: doc.cxx:184
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: porexp.cxx:74
virtual SwPosSize GetTextSize(const SwTextSizeInfo &rInfo) const override
Definition: porexp.cxx:51
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:1367
virtual SwFieldPortion * Clone(const OUString &rExpand) const override
Definition: porfld.cxx:1362
sw::mark::IFieldmark * m_pFieldMark
Definition: porfld.hxx:244
virtual SwFieldPortion * Clone(const OUString &rExpand) const override
Definition: porfld.cxx:1344
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: porfld.cxx:1349
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:473
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:468
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:444
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:457
virtual SwPosSize GetTextSize(const SwTextSizeInfo &rInfo) const override
Definition: porfld.cxx:490
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
sal_uInt16 GetBottomBorderSpace() const
Definition: swfont.hxx:877
sal_uInt16 GetTopBorderSpace() const
Definition: swfont.hxx:862
const Size & GetSize(SwFontScript nWhich) const
Definition: swfont.hxx:206
FontLineStyle GetUnderline() const
Definition: swfont.hxx:272
Size GetTextSize_(SwDrawTextInfo &rInf)
Definition: swfont.hxx:310
void SetProportion(const sal_uInt8 nNewPropr)
Definition: swfont.hxx:769
FontStrikeout GetStrikeout() const
Definition: swfont.hxx:276
void SetSize(const Size &rSize, const SwFontScript nWhich)
Definition: swfont.hxx:741
SwFontScript GetActual() const
Definition: swfont.hxx:184
FontLineStyle GetOverline() const
Definition: swfont.hxx:274
bool IsWordLineMode() const
Definition: swfont.hxx:278
const SvxFont & GetFnt(const SwFontScript nWhich) const
Definition: swfont.hxx:267
sal_uInt16 GetAscent(SwViewShell const *pSh, const OutputDevice &rOut)
Definition: swfont.hxx:327
tools::Long GetHeight() const
Definition: swfont.hxx:284
void SetActual(SwFontScript nNew)
Definition: swfont.hxx:751
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:1028
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:779
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:818
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:839
sal_Int16 GetOrient() const
Definition: porfld.hxx:202
void StopAnimation(const OutputDevice *pOut)
Definition: porfld.cxx:829
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:904
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:497
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:515
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: porfld.cxx:505
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:521
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:635
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:650
virtual SwFieldPortion * Clone(const OUString &rExpand) const override
Definition: porfld.cxx:543
virtual TextFrameIndex GetModelPositionForViewPoint(sal_uInt16 nOfst) const override
the parameter is actually SwTwips apparently?
Definition: porfld.cxx:538
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:559
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:210
sal_uInt8 GetDefaultDir() const
Definition: scriptinfo.hxx:125
sal_uInt8 DirType(const TextFrameIndex nPos) const
Definition: porlay.cxx:1926
SwLinePortion * GetLast()
Definition: inftxt.hxx:564
void SetUnderScorePos(TextFrameIndex const nNew)
Definition: inftxt.hxx:645
void SetRest(SwLinePortion *pNewRest)
Definition: inftxt.hxx:580
sal_uInt16 ForcedLeftMargin() const
Definition: inftxt.hxx:554
void SetLineStart(TextFrameIndex const nNew)
Definition: inftxt.hxx:594
TextFrameIndex GetLineStart() const
Definition: inftxt.hxx:593
const SwLinePortion * GetUnderflow() const
Definition: inftxt.hxx:602
bool IsNumDone() const
Definition: inftxt.hxx:632
TextFrameIndex ScanPortionEnd(TextFrameIndex nStart, TextFrameIndex nEnd)
Definition: inftxt.cxx:1652
SwTwips Left() const
Definition: inftxt.hxx:545
SwLinePortion * GetRest()
Definition: inftxt.hxx:579
sal_uInt16 Width() const
Definition: inftxt.hxx:531
SwFlyPortion * GetFly()
Definition: inftxt.hxx:612
void SetNumDone(const bool bNew)
Definition: inftxt.hxx:633
TextFrameIndex GetUnderScorePos() const
Definition: inftxt.hxx:644
SwTwips First() const
Definition: inftxt.hxx:549
void SetHookChar(const sal_Unicode cNew)
Definition: inftxt.hxx:624
Represents the visualization of a paragraph.
Definition: txtfrm.hxx:166
SwDoc & GetDoc()
Definition: txtfrm.hxx:470
bool HasPara() const
Definition: txtfrm.hxx:833
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:541
bool HasAnimation() const
Definition: txtfrm.hxx:543
void StopAnimation(const OutputDevice *pOut)
Stops the animations within numberings.
Definition: porfld.cxx:1064
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:1303
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:751
const SwRect & GetPaintRect() const
Definition: inftxt.hxx:435
SwTwips X() const
Definition: inftxt.hxx:382
const Point & GetPos() const
Definition: inftxt.hxx:432
void CalcRect(const SwLinePortion &rPor, SwRect *pRect, SwRect *pIntersect=nullptr, const bool bInsideBox=false) const
Calculate the rectangular area where the portion takes place.
Definition: inftxt.cxx:723
void DrawBackBrush(const SwLinePortion &rPor) const
Definition: inftxt.cxx:1146
void DrawViewOpt(const SwLinePortion &rPor, PortionType nWhich, const Color *pColor=nullptr) const
Definition: inftxt.cxx:1308
SwTwips Y() const
Definition: inftxt.hxx:384
virtual bool Format(SwTextFormatInfo &rInf) override
Definition: portxt.cxx:445
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:717
void NoteAnimation() const
Definition: inftxt.cxx:376
SwFont * GetFont()
Definition: inftxt.hxx:232
bool OnWin() const
Definition: inftxt.hxx:193
SwPosSize GetTextSize(OutputDevice *pOut, const SwScriptInfo *pSI, const OUString &rText, TextFrameIndex nIdx, TextFrameIndex nLen) const
Definition: inftxt.cxx:385
SwUnderlineFont * GetUnderFnt() const
Definition: inftxt.hxx:237
sal_uInt16 GetAscent() const
Definition: inftxt.hxx:711
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:678
void SetPos(const Point &rPoint)
Definition: swfont.hxx:977
const Point & GetPos() const
Definition: swfont.hxx:974
bool IsReadonly() const
Definition: viewopt.hxx:629
bool IsPagePreview() const
Definition: viewopt.hxx:801
bool IsShowPlaceHolderFields() const
Definition: viewopt.hxx:807
bool IsGraphic() const
Definition: viewopt.hxx:501
bool IsFieldShadings() const
Definition: viewopt.hxx:838
bool IsPreview() const
Definition: viewsh.hxx:499
vcl::Window * GetWin() const
Definition: viewsh.hxx:346
void InvalidateWindows(const SwRect &rRect)
Definition: viewsh.cxx:556
const SwAccessibilityOptions * GetAccessibilityOptions() const
Definition: viewsh.hxx:442
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:1816
constexpr TypedWhichId< SvxBrushItem > RES_BACKGROUND(111)
#define CH_TXTATR_INWORD
Definition: hintids.hxx:176
#define CH_TXTATR_BREAKWORD
Definition: hintids.hxx:175
#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:777
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