LibreOffice Module sw (master) 1
portxt.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <com/sun/star/i18n/ScriptType.hpp>
21#include <com/sun/star/i18n/XBreakIterator.hpp>
23#include <breakit.hxx>
24#include <hintids.hxx>
26#include <SwPortionHandler.hxx>
27#include "porlay.hxx"
28#include "inftxt.hxx"
29#include "guess.hxx"
30#include "porfld.hxx"
31#include <pagefrm.hxx>
32#include <tgrditem.hxx>
35
36#include <IMark.hxx>
37#include <pam.hxx>
38#include <doc.hxx>
39#include <xmloff/odffields.hxx>
40#include <viewopt.hxx>
41
42using namespace ::sw::mark;
43using namespace ::com::sun::star;
44using namespace ::com::sun::star::i18n::ScriptType;
45
46// Returns for how many characters an extra space has to be added
47// (for justified alignment).
49 const OUString* pStr, const SwLinePortion& rPor)
50{
51 TextFrameIndex nPos, nEnd;
52 const SwScriptInfo* pSI = nullptr;
53
54 if ( pStr )
55 {
56 // passing a string means we are inside a field
58 nEnd = TextFrameIndex(pStr->getLength());
59 }
60 else
61 {
62 nPos = rInf.GetIdx();
63 nEnd = rInf.GetIdx() + rPor.GetLen();
64 pStr = &rInf.GetText();
65 pSI = &const_cast<SwParaPortion*>(rInf.GetParaPortion())->GetScriptInfo();
66 }
67
68 TextFrameIndex nCnt(0);
69 sal_uInt8 nScript = 0;
70
71 // If portion consists of Asian characters and language is not
72 // Korean, we add extra space to each character.
73 // first we get the script type
74 if ( pSI )
75 nScript = pSI->ScriptType( nPos );
76 else
77 nScript = static_cast<sal_uInt8>(
78 g_pBreakIt->GetBreakIter()->getScriptType(*pStr, sal_Int32(nPos)));
79
80 // Note: rInf.GetIdx() can differ from nPos,
81 // e.g., when rPor is a field portion. nPos refers to the string passed
82 // to the function, rInf.GetIdx() refers to the original string.
83
84 // We try to find out which justification mode is required. This is done by
85 // evaluating the script type and the language attribute set for this portion
86
87 // Asian Justification: Each character get some extra space
88 if ( nEnd > nPos && ASIAN == nScript )
89 {
90 LanguageType aLang =
91 rInf.GetTextFrame()->GetLangOfChar(rInf.GetIdx(), nScript);
92
93 if (!MsLangId::isKorean(aLang))
94 {
95 const SwLinePortion* pPor = rPor.GetNextPortion();
96 if ( pPor && ( pPor->IsKernPortion() ||
97 pPor->IsControlCharPortion() ||
98 pPor->IsPostItsPortion() ) )
99 pPor = pPor->GetNextPortion();
100
101 nCnt += SwScriptInfo::CountCJKCharacters( *pStr, nPos, nEnd, aLang );
102
103 if ( !pPor || pPor->IsHolePortion() || pPor->InFixMargGrp() ||
104 pPor->IsBreakPortion() )
105 --nCnt;
106
107 return nCnt;
108 }
109 }
110
111 // Kashida Justification: Insert Kashidas
112 if ( nEnd > nPos && pSI && COMPLEX == nScript )
113 {
114 if ( SwScriptInfo::IsArabicText( *pStr, nPos, nEnd - nPos ) && pSI->CountKashida() )
115 {
116 const sal_Int32 nKashRes = pSI->KashidaJustify(nullptr, nullptr, nPos, nEnd - nPos);
117 // i60591: need to check result of KashidaJustify
118 // determine if kashida justification is applicable
119 if (nKashRes != -1)
120 return TextFrameIndex(nKashRes);
121 }
122 }
123
124 // Thai Justification: Each character cell gets some extra space
125 if ( nEnd > nPos && COMPLEX == nScript )
126 {
127 LanguageType aLang =
128 rInf.GetTextFrame()->GetLangOfChar(rInf.GetIdx(), nScript);
129
130 if ( LANGUAGE_THAI == aLang )
131 {
132 nCnt = SwScriptInfo::ThaiJustify(*pStr, nullptr, nPos, nEnd - nPos);
133
134 const SwLinePortion* pPor = rPor.GetNextPortion();
135 if ( pPor && ( pPor->IsKernPortion() ||
136 pPor->IsControlCharPortion() ||
137 pPor->IsPostItsPortion() ) )
138 pPor = pPor->GetNextPortion();
139
140 if ( nCnt && ( ! pPor || pPor->IsHolePortion() || pPor->InFixMargGrp() ) )
141 --nCnt;
142
143 return nCnt;
144 }
145 }
146
147 // Here starts the good old "Look for blanks and add space to them" part.
148 // Note: We do not want to add space to an isolated latin blank in front
149 // of some complex characters in RTL environment
150 const bool bDoNotAddSpace =
151 LATIN == nScript && (nEnd == nPos + TextFrameIndex(1)) && pSI &&
152 ( i18n::ScriptType::COMPLEX ==
153 pSI->ScriptType(nPos + TextFrameIndex(1))) &&
154 rInf.GetTextFrame() && rInf.GetTextFrame()->IsRightToLeft();
155
156 if ( bDoNotAddSpace )
157 return nCnt;
158
159 TextFrameIndex nTextEnd = std::min(nEnd, TextFrameIndex(pStr->getLength()));
160 for ( ; nPos < nTextEnd; ++nPos )
161 {
162 if (CH_BLANK == (*pStr)[ sal_Int32(nPos) ])
163 ++nCnt;
164 }
165
166 // We still have to examine the next character:
167 // If the next character is ASIAN and not KOREAN we have
168 // to add an extra space
169 // nPos refers to the original string, even if a field string has
170 // been passed to this function
171 nPos = rInf.GetIdx() + rPor.GetLen();
172 if (nPos < TextFrameIndex(rInf.GetText().getLength()))
173 {
174 sal_uInt8 nNextScript = 0;
175 const SwLinePortion* pPor = rPor.GetNextPortion();
176 if ( pPor && pPor->IsKernPortion() )
177 pPor = pPor->GetNextPortion();
178
179 if (!pPor || pPor->InFixMargGrp())
180 return nCnt;
181
182 // next character is inside a field?
183 if ( CH_TXTATR_BREAKWORD == rInf.GetChar( nPos ) && pPor->InExpGrp() )
184 {
185 bool bOldOnWin = rInf.OnWin();
186 const_cast<SwTextSizeInfo &>(rInf).SetOnWin( false );
187
188 OUString aStr;
189 pPor->GetExpText( rInf, aStr );
190 const_cast<SwTextSizeInfo &>(rInf).SetOnWin( bOldOnWin );
191
192 nNextScript = static_cast<sal_uInt8>(g_pBreakIt->GetBreakIter()->getScriptType( aStr, 0 ));
193 }
194 else
195 nNextScript = static_cast<sal_uInt8>(
196 g_pBreakIt->GetBreakIter()->getScriptType(rInf.GetText(), sal_Int32(nPos)));
197
198 if( ASIAN == nNextScript )
199 {
200 LanguageType aLang =
201 rInf.GetTextFrame()->GetLangOfChar(nPos, nNextScript);
202
203 if (!MsLangId::isKorean(aLang))
204 ++nCnt;
205 }
206 }
207
208 return nCnt;
209}
210
212{
213 SwTextPortion *const pNew(new SwTextPortion);
214 static_cast<SwLinePortion&>(*pNew) = rPortion;
215 pNew->SetWhichPor( PortionType::Text ); // overwrite that!
216 return pNew;
217}
218
220{
221 // The word/char is larger than the line
222 // Special case 1: The word is larger than the line
223 // We truncate ...
224 const sal_uInt16 nLineWidth = o3tl::narrowing<sal_uInt16>(rInf.Width() - rInf.X());
225 TextFrameIndex nLen = rGuess.CutPos() - rInf.GetIdx();
226 if (nLen > TextFrameIndex(0))
227 {
228 // special case: guess does not always provide the correct
229 // width, only in common cases.
230 if ( !rGuess.BreakWidth() )
231 {
232 rInf.SetLen( nLen );
233 SetLen( nLen );
234 CalcTextSize( rInf );
235
236 // changing these values requires also changing them in
237 // guess.cxx
238 sal_uInt16 nItalic = 0;
239 if( ITALIC_NONE != rInf.GetFont()->GetItalic() && !rInf.NotEOL() )
240 {
241 nItalic = Height() / 12;
242 }
243 Width( Width() + nItalic );
244 }
245 else
246 {
247 Width( rGuess.BreakWidth() );
248 SetLen( nLen );
249 }
250 }
251 // special case: first character does not fit to line
252 else if ( rGuess.CutPos() == rInf.GetLineStart() )
253 {
255 Width( nLineWidth );
256 }
257 else
258 {
260 Width( 0 );
261 }
262}
263
265{
266 Truncate();
267 Height( 0 );
268 Width( 0 );
270 SetAscent( 0 );
271 rInf.SetUnderflow( this );
272}
273
274static bool lcl_HasContent( const SwFieldPortion& rField, SwTextFormatInfo const &rInf )
275{
276 OUString aText;
277 return rField.GetExpText( rInf, aText ) && !aText.isEmpty();
278}
279
281{
282 // 5744: If only the hyphen does not fit anymore, we still need to wrap
283 // the word, or else return true!
284 if( rInf.IsUnderflow() && rInf.GetSoftHyphPos() )
285 {
286 // soft hyphen portion has triggered an underflow event because
287 // of an alternative spelling position
288 bool bFull = false;
289 const bool bHyph = rInf.ChgHyph( true );
290 if( rInf.IsHyphenate() )
291 {
292 SwTextGuess aGuess;
293 // check for alternative spelling left from the soft hyphen
294 // this should usually be true but
295 aGuess.AlternativeSpelling(rInf, rInf.GetSoftHyphPos() - TextFrameIndex(1));
296 bFull = CreateHyphen( rInf, aGuess );
297 OSL_ENSURE( bFull, "Problem with hyphenation!!!" );
298 }
299 rInf.ChgHyph( bHyph );
301 return bFull;
302 }
303
304 SwTextGuess aGuess;
305 const bool bFull = !aGuess.Guess( *this, rInf, Height() );
306
307 // these are the possible cases:
308 // A Portion fits to current line
309 // B Portion does not fit to current line but a possible line break
310 // within the portion has been found by the break iterator, 2 subcases
311 // B1 break is hyphen
312 // B2 break is word end
313 // C Portion does not fit to current line and no possible line break
314 // has been found by break iterator, 2 subcases:
315 // C1 break iterator found a possible line break in portion before us
316 // ==> this break is used (underflow)
317 // C2 break iterator does not found a possible line break at all:
318 // ==> line break
319
320 // case A: line not yet full
321 if ( !bFull )
322 {
323 Width( aGuess.BreakWidth() );
325 // Caution!
326 if( !InExpGrp() || InFieldGrp() )
327 SetLen( rInf.GetLen() );
328
329 short nKern = rInf.GetFont()->CheckKerning();
330 if( nKern > 0 && rInf.Width() < rInf.X() + Width() + nKern )
331 {
332 nKern = static_cast<short>(rInf.Width() - rInf.X() - Width() - 1);
333 if( nKern < 0 )
334 nKern = 0;
335 }
336 if( nKern )
337 new SwKernPortion( *this, nKern );
338 }
339 // special case: hanging portion
340 else if( bFull && aGuess.GetHangingPortion() )
341 {
342 Width( aGuess.BreakWidth() );
343 SetLen( aGuess.BreakPos() - rInf.GetIdx() );
345 Insert( aGuess.ReleaseHangingPortion() );
346 }
347 // breakPos >= index
348 else if (aGuess.BreakPos() >= rInf.GetIdx() && aGuess.BreakPos() != TextFrameIndex(COMPLETE_STRING))
349 {
350 // case B1
351 if( aGuess.HyphWord().is() && aGuess.BreakPos() > rInf.GetLineStart()
352 && ( aGuess.BreakPos() > rInf.GetIdx() ||
353 ( rInf.GetLast() && ! rInf.GetLast()->IsFlyPortion() ) ) )
354 {
355 CreateHyphen( rInf, aGuess );
356 if ( rInf.GetFly() )
357 rInf.GetRoot()->SetMidHyph( true );
358 else
359 rInf.GetRoot()->SetEndHyph( true );
360 }
361 // case C1
362 // - Footnote portions with fake line start (i.e., not at beginning of line)
363 // should keep together with the text portion. (Note: no keep together
364 // with only footnote portions.
365 // - TabPortions not at beginning of line should keep together with the
366 // text portion, if they are not followed by a blank
367 // (work around different definition of tab stop character - breaking or
368 // non breaking character - in compatibility mode)
369 else if ( ( IsFootnotePortion() && rInf.IsFakeLineStart() &&
370
371 rInf.IsOtherThanFootnoteInside() ) ||
372 ( rInf.GetLast() &&
374 rInf.GetLast()->InTabGrp() &&
375 rInf.GetLineStart() + rInf.GetLast()->GetLen() < rInf.GetIdx() &&
376 aGuess.BreakPos() == rInf.GetIdx() &&
377 CH_BLANK != rInf.GetChar( rInf.GetIdx() ) &&
378 CH_FULL_BLANK != rInf.GetChar( rInf.GetIdx() ) &&
379 CH_SIX_PER_EM != rInf.GetChar( rInf.GetIdx() ) ) )
380 BreakUnderflow( rInf );
381 // case B2
382 else if( rInf.GetIdx() > rInf.GetLineStart() ||
383 aGuess.BreakPos() > rInf.GetIdx() ||
384 // this is weird: during formatting the follow of a field
385 // the values rInf.GetIdx and rInf.GetLineStart are replaced
386 // IsFakeLineStart indicates GetIdx > GetLineStart
387 rInf.IsFakeLineStart() ||
388 rInf.GetFly() ||
389 rInf.IsFirstMulti() ||
390 ( rInf.GetLast() &&
391 ( rInf.GetLast()->IsFlyPortion() ||
392 ( rInf.GetLast()->InFieldGrp() &&
393 ! rInf.GetLast()->InNumberGrp() &&
394 ! rInf.GetLast()->IsErgoSumPortion() &&
395 lcl_HasContent(*static_cast<SwFieldPortion*>(rInf.GetLast()),rInf ) ) ) ) )
396 {
397 // GetLineWidth() takes care of DocumentSettingId::TAB_OVER_MARGIN.
398 if (aGuess.BreakWidth() <= rInf.GetLineWidth())
399 Width( aGuess.BreakWidth() );
400 else
401 // this actually should not happen
402 Width( sal_uInt16(rInf.Width() - rInf.X()) );
403
404 SetLen( aGuess.BreakPos() - rInf.GetIdx() );
405
406 OSL_ENSURE( aGuess.BreakStart() >= aGuess.FieldDiff(),
407 "Trouble with expanded field portions during line break" );
408 TextFrameIndex const nRealStart = aGuess.BreakStart() - aGuess.FieldDiff();
409 if( aGuess.BreakPos() < nRealStart && !InExpGrp() )
410 {
411 SwHolePortion *pNew = new SwHolePortion( *this );
412 pNew->SetLen( nRealStart - aGuess.BreakPos() );
413 pNew->Width(0);
414 pNew->ExtraBlankWidth( aGuess.ExtraBlankWidth() );
415 Insert( pNew );
416 }
417 }
418 else // case C2, last exit
419 BreakCut( rInf, aGuess );
420 }
421 // breakPos < index or no breakpos at all
422 else
423 {
424 bool bFirstPor = rInf.GetLineStart() == rInf.GetIdx();
425 const bool bBreakLineIfHasFly
428 if (aGuess.BreakPos() != TextFrameIndex(COMPLETE_STRING) &&
429 (aGuess.BreakPos() != rInf.GetLineStart() || bBreakLineIfHasFly) &&
430 ( !bFirstPor || rInf.GetFly() || rInf.GetLast()->IsFlyPortion() ||
431 rInf.IsFirstMulti() ) &&
432 ( !rInf.GetLast()->IsBlankPortion() ||
433 SwBlankPortion::MayUnderflow(rInf, rInf.GetIdx() - TextFrameIndex(1), true)))
434 { // case C1 (former BreakUnderflow())
435 BreakUnderflow( rInf );
436 }
437 else
438 // case C2, last exit
439 BreakCut(rInf, aGuess);
440 }
441
442 return bFull;
443}
444
446{
447 // GetLineWidth() takes care of DocumentSettingId::TAB_OVER_MARGIN.
448 if( rInf.GetLineWidth() < 0 || (!GetLen() && !InExpGrp()) )
449 {
450 Height( 0 );
451 Width( 0 );
453 SetAscent( 0 );
454 SetNextPortion( nullptr ); // ????
455 return true;
456 }
457
458 OSL_ENSURE( rInf.RealWidth() || (rInf.X() == rInf.Width()),
459 "SwTextPortion::Format: missing real width" );
460 OSL_ENSURE( Height(), "SwTextPortion::Format: missing height" );
461
462 return Format_( rInf );
463}
464
465// Format end of line
466// 5083: We can have awkward cases e.g.:
467// "from {Santa}"
468// Santa wraps, "from " turns into "from" and " " in a justified
469// paragraph, in which the glue gets expanded instead of merged
470// with the MarginPortion.
471
472// rInf.nIdx points to the next word, nIdx-1 is the portion's last char
474{
475 if( ( GetNextPortion() &&
477 !GetLen() ||
478 rInf.GetIdx() >= TextFrameIndex(rInf.GetText().getLength()) ||
479 TextFrameIndex(1) >= rInf.GetIdx() ||
480 ' ' != rInf.GetChar(rInf.GetIdx() - TextFrameIndex(1)) ||
481 rInf.GetLast()->IsHolePortion() )
482 return;
483
484 // calculate number of blanks
485 TextFrameIndex nX(rInf.GetIdx() - TextFrameIndex(1));
486 TextFrameIndex nHoleLen(1);
487 while( nX && nHoleLen < GetLen() && CH_BLANK == rInf.GetChar( --nX ) )
488 nHoleLen++;
489
490 // First set ourselves and the insert, because there could be
491 // a SwLineLayout
492 sal_uInt16 nBlankSize;
493 if( nHoleLen == GetLen() )
494 nBlankSize = Width();
495 else
496 nBlankSize = sal_Int32(nHoleLen) * rInf.GetTextSize(OUString(' ')).Width();
497 Width( Width() - nBlankSize );
498 rInf.X( rInf.X() - nBlankSize );
499 SetLen( GetLen() - nHoleLen );
500 SwLinePortion *pHole = new SwHolePortion( *this );
501 static_cast<SwHolePortion *>( pHole )->SetBlankWidth( nBlankSize );
502 static_cast<SwHolePortion *>( pHole )->SetLen( nHoleLen );
503 Insert( pHole );
504
505}
506
508{
509 OSL_ENSURE( false, "SwTextPortion::GetModelPositionForViewPoint: don't use this method!" );
511}
512
513// The GetTextSize() assumes that the own length is correct
515{
516 SwPosSize aSize = rInf.GetTextSize();
517 if( !GetJoinBorderWithPrev() )
518 aSize.Width(aSize.Width() + rInf.GetFont()->GetLeftBorderSpace() );
519 if( !GetJoinBorderWithNext() )
520 aSize.Width(aSize.Width() + rInf.GetFont()->GetRightBorderSpace() );
521
522 aSize.Height(aSize.Height() +
523 rInf.GetFont()->GetTopBorderSpace() +
524 rInf.GetFont()->GetBottomBorderSpace() );
525
526 return aSize;
527}
528
529void SwTextPortion::Paint( const SwTextPaintInfo &rInf ) const
530{
531 if (rInf.OnWin() && TextFrameIndex(1) == rInf.GetLen()
532 && CH_TXT_ATR_FIELDEND == rInf.GetText()[sal_Int32(rInf.GetIdx())])
533 {
534 assert(false); // this is some debugging only code
535 rInf.DrawBackBrush( *this );
536 const OUString aText(CH_TXT_ATR_SUBST_FIELDEND);
537 rInf.DrawText(aText, *this, TextFrameIndex(0), TextFrameIndex(aText.getLength()));
538 }
539 else if (rInf.OnWin() && TextFrameIndex(1) == rInf.GetLen()
540 && CH_TXT_ATR_FIELDSTART == rInf.GetText()[sal_Int32(rInf.GetIdx())])
541 {
542 assert(false); // this is some debugging only code
543 rInf.DrawBackBrush( *this );
544 const OUString aText(CH_TXT_ATR_SUBST_FIELDSTART);
545 rInf.DrawText(aText, *this, TextFrameIndex(0), TextFrameIndex(aText.getLength()));
546 }
547 else if( GetLen() )
548 {
549 rInf.DrawBackBrush( *this );
550 rInf.DrawBorder( *this );
551
552 // do we have to repaint a post it portion?
553 if( rInf.OnWin() && mpNextPortion && !mpNextPortion->Width() )
554 mpNextPortion->PrePaint( rInf, this );
555
556 auto const* pWrongList = rInf.GetpWrongList();
557 auto const* pGrammarCheckList = rInf.GetGrammarCheckList();
558 auto const* pSmarttags = rInf.GetSmartTags();
559
560 const bool bWrong = nullptr != pWrongList;
561 const bool bGrammarCheck = nullptr != pGrammarCheckList;
562 const bool bSmartTags = nullptr != pSmarttags;
563
564 if ( bWrong || bSmartTags || bGrammarCheck )
565 rInf.DrawMarkedText( *this, rInf.GetLen(), bWrong, bSmartTags, bGrammarCheck );
566 else
567 rInf.DrawText( *this, rInf.GetLen() );
568 }
569}
570
571bool SwTextPortion::GetExpText( const SwTextSizeInfo &, OUString & ) const
572{
573 return false;
574}
575
576// Responsible for the justified paragraph. They calculate the blank
577// count and the resulting added space.
579 TextFrameIndex& rCharCnt) const
580{
581 TextFrameIndex nCnt(0);
583
584 if ( rInf.SnapToGrid() )
585 {
586 SwTextGridItem const*const pGrid(GetGridItem(rInf.GetTextFrame()->FindPageFrame()));
587 if (pGrid && GRID_LINES_CHARS == pGrid->GetGridType() && pGrid->IsSnapToChars())
588 return TextFrameIndex(0);
589 }
590
592 {
593 if( !IsBlankPortion() && !InNumberGrp() && !IsCombinedPortion() )
594 {
595 // OnWin() likes to return a blank instead of an empty string from
596 // time to time. We cannot use that here at all, however.
597 bool bOldOnWin = rInf.OnWin();
598 const_cast<SwTextSizeInfo &>(rInf).SetOnWin( false );
599
600 OUString aStr;
601 GetExpText( rInf, aStr );
602 const_cast<SwTextSizeInfo &>(rInf).SetOnWin( bOldOnWin );
603
604 nCnt = nCnt + lcl_AddSpace( rInf, &aStr, *this );
605 nPos = TextFrameIndex(aStr.getLength());
606 }
607 }
608 else if( !IsDropPortion() )
609 {
610 nCnt = nCnt + lcl_AddSpace( rInf, nullptr, *this );
611 nPos = GetLen();
612 }
613 rCharCnt = rCharCnt + nPos;
614 return nCnt;
615}
616
618{
619 TextFrameIndex nCnt(0);
620
621 if ( rInf.SnapToGrid() )
622 {
623 SwTextGridItem const*const pGrid(GetGridItem(rInf.GetTextFrame()->FindPageFrame()));
624 if (pGrid && GRID_LINES_CHARS == pGrid->GetGridType() && pGrid->IsSnapToChars())
625 return 0;
626 }
627
629 {
630 if( !IsBlankPortion() && !InNumberGrp() && !IsCombinedPortion() )
631 {
632 // OnWin() likes to return a blank instead of an empty string from
633 // time to time. We cannot use that here at all, however.
634 bool bOldOnWin = rInf.OnWin();
635 const_cast<SwTextSizeInfo &>(rInf).SetOnWin( false );
636
637 OUString aStr;
638 GetExpText( rInf, aStr );
639 const_cast<SwTextSizeInfo &>(rInf).SetOnWin( bOldOnWin );
640 if( nSpaceAdd > 0 )
641 nCnt = nCnt + lcl_AddSpace( rInf, &aStr, *this );
642 else
643 {
644 nSpaceAdd = -nSpaceAdd;
645 nCnt = TextFrameIndex(aStr.getLength());
646 }
647 }
648 }
649 else if( !IsDropPortion() )
650 {
651 if( nSpaceAdd > 0 )
652 nCnt = nCnt + lcl_AddSpace( rInf, nullptr, *this );
653 else
654 {
655 nSpaceAdd = -nSpaceAdd;
656 nCnt = GetLen();
658
659 // we do not want an extra space in front of margin portions
660 if ( nCnt )
661 {
662 while ( pPor && !pPor->Width() && ! pPor->IsHolePortion() )
663 pPor = pPor->GetNextPortion();
664
665 if ( !pPor || pPor->InFixMargGrp() || pPor->IsHolePortion() )
666 --nCnt;
667 }
668 }
669 }
670
671 return sal_Int32(nCnt) * nSpaceAdd / SPACING_PRECISION_FACTOR;
672}
673
675{
676 rPH.Text( GetLen(), GetWhichPor() );
677}
678
680{
682}
683
685{
686 return SwTextPortion::Format(rTextFormatInfo);
687}
688
690{
691 if ( Width() )
692 {
694 SwTextSlot aPaintText( &rInf, this, true, true, OUString() );
695 SwTextPortion::Paint( rInf );
696 }
697 else
698 {
699 // highlight empty input field, elsewhere they are completely invisible for the user
700 SwRect aIntersect;
701 rInf.CalcRect(*this, &aIntersect);
702 const sal_uInt16 aAreaWidth = rInf.GetTextSize(OUString(' ')).Width();
703 aIntersect.Left(aIntersect.Left() - aAreaWidth/2);
704 aIntersect.Width(aAreaWidth);
705
706 if (aIntersect.HasArea()
707 && rInf.OnWin()
708 && rInf.GetOpt().IsFieldShadings()
709 && !rInf.GetOpt().IsPagePreview())
710 {
711 OutputDevice* pOut = const_cast<OutputDevice*>(rInf.GetOut());
713 pOut->SetFillColor(rInf.GetOpt().GetFieldShadingsColor());
714 pOut->SetLineColor();
715 pOut->DrawRect(aIntersect.SVRect());
716 pOut->Pop();
717 }
718 }
719}
720
721bool SwTextInputFieldPortion::GetExpText( const SwTextSizeInfo &rInf, OUString &rText ) const
722{
723 sal_Int32 nIdx(rInf.GetIdx());
724 sal_Int32 nLen(GetLen());
725 if ( rInf.GetChar( rInf.GetIdx() ) == CH_TXT_ATR_INPUTFIELDSTART )
726 {
727 ++nIdx;
728 --nLen;
729 }
730 if (rInf.GetChar(rInf.GetIdx() + GetLen() - TextFrameIndex(1)) == CH_TXT_ATR_INPUTFIELDEND)
731 {
732 --nLen;
733 }
734 rText = rInf.GetText().copy( nIdx, std::min( nLen, rInf.GetText().getLength() - nIdx ) );
735
736 return true;
737}
738
740{
741 SwTextSlot aFormatText( &rInf, this, true, false );
742 if (rInf.GetLen() == TextFrameIndex(0))
743 {
744 return SwPosSize( 0, 0 );
745 }
746
747 return rInf.GetTextSize();
748}
749
751 : m_nBlankWidth( 0 )
752{
754 Height( rPor.Height() );
755 Width(0);
756 SetAscent( rPor.GetAscent() );
758}
759
761
762// The GetTextSize() assumes that the own length is correct
764{
765 SwPosSize aSize = rInf.GetTextSize();
767 aSize.Width(aSize.Width() + rInf.GetFont()->GetLeftBorderSpace());
769 aSize.Width(aSize.Width() + rInf.GetFont()->GetRightBorderSpace());
770
771 aSize.Height(aSize.Height() +
772 rInf.GetFont()->GetTopBorderSpace() +
773 rInf.GetFont()->GetBottomBorderSpace());
774
775 return aSize;
776}
777
778void SwHolePortion::Paint( const SwTextPaintInfo &rInf ) const
779{
780 if( !rInf.GetOut() )
781 return;
782
783 bool bPDFExport = rInf.GetVsh()->GetViewOptions()->IsPDFExport();
784
785 // #i16816# export stuff only needed for tagged pdf support
786 if (bPDFExport && !SwTaggedPDFHelper::IsExportTaggedPDF( *rInf.GetOut()) )
787 return;
788
789 // #i68503# the hole must have no decoration for a consistent visual appearance
790 const SwFont* pOrigFont = rInf.GetFont();
791 std::unique_ptr<SwFont> pHoleFont;
792 std::optional<SwFontSave> oFontSave;
793 if( pOrigFont->GetUnderline() != LINESTYLE_NONE
794 || pOrigFont->GetOverline() != LINESTYLE_NONE
795 || pOrigFont->GetStrikeout() != STRIKEOUT_NONE )
796 {
797 pHoleFont.reset(new SwFont( *pOrigFont ));
798 pHoleFont->SetUnderline( LINESTYLE_NONE );
799 pHoleFont->SetOverline( LINESTYLE_NONE );
800 pHoleFont->SetStrikeout( STRIKEOUT_NONE );
801 oFontSave.emplace( rInf, pHoleFont.get() );
802 }
803
804 if (bPDFExport)
805 {
806 rInf.DrawText(" ", *this, TextFrameIndex(0), TextFrameIndex(1));
807 }
808 else
809 {
810 // tdf#43244: Paint spaces even at end of line,
811 // but only if this paint is not called for pdf export, to keep that pdf export intact
812 rInf.DrawText(*this, rInf.GetLen());
813 }
814
815 oFontSave.reset();
816 pHoleFont.reset();
817}
818
820{
821 return rInf.IsFull() || rInf.X() >= rInf.Width();
822}
823
825{
826 rPH.Text( GetLen(), GetWhichPor() );
827}
828
829void SwHolePortion::dumpAsXml(xmlTextWriterPtr pWriter, const OUString& rText, TextFrameIndex& nOffset) const
830{
831 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwHolePortion"));
832 dumpAsXmlAttributes(pWriter, rText, nOffset);
833 nOffset += GetLen();
834
835 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("blank-width"),
836 BAD_CAST(OString::number(m_nBlankWidth).getStr()));
837
838 (void)xmlTextWriterEndElement(pWriter);
839}
840
841void SwFieldMarkPortion::Paint( const SwTextPaintInfo & /*rInf*/) const
842{
843 // These shouldn't be painted!
844 //SwTextPortion::Paint(rInf);
845}
846
848{
849 Width(0);
850 return false;
851}
852
854{
855 SwPosition const aPosition(rInf.GetTextFrame()->MapViewToModelPos(rInf.GetIdx()));
856
857 IFieldmark const*const pBM = rInf.GetTextFrame()->GetDoc().getIDocumentMarkAccess()->getFieldmarkAt(aPosition);
858
859 OSL_ENSURE(pBM && pBM->GetFieldname( ) == ODF_FORMCHECKBOX,
860 "Where is my form field bookmark???");
861
862 if (pBM && pBM->GetFieldname( ) == ODF_FORMCHECKBOX)
863 {
864 const ICheckboxFieldmark* pCheckboxFm = dynamic_cast<ICheckboxFieldmark const*>(pBM);
865 bool bChecked = pCheckboxFm && pCheckboxFm->IsChecked();
866 rInf.DrawCheckBox(*this, bChecked);
867 }
868}
869
871{
872 SwPosition const aPosition(rInf.GetTextFrame()->MapViewToModelPos(rInf.GetIdx()));
873 IFieldmark const*const pBM = rInf.GetTextFrame()->GetDoc().getIDocumentMarkAccess()->getFieldmarkAt(aPosition);
874 OSL_ENSURE(pBM && pBM->GetFieldname( ) == ODF_FORMCHECKBOX, "Where is my form field bookmark???");
875 if (pBM && pBM->GetFieldname( ) == ODF_FORMCHECKBOX)
876 {
877 // the width of the checkbox portion is the same as its height since it's a square
878 // and that size depends on the font size.
879 // See:
880 // http://document-foundation-mail-archive.969070.n3.nabble.com/Wrong-copy-paste-in-SwFieldFormCheckboxPortion-Format-td4269112.html
881 Width( rInf.GetTextHeight( ) );
882 Height( rInf.GetTextHeight( ) );
883 SetAscent( rInf.GetAscent( ) );
884 }
885 return false;
886}
887
888/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_Int32 nLineWidth
o3tl::strong_int< sal_Int32, struct Tag_TextFrameIndex > TextFrameIndex
Denotes a character index in a text frame at a layout level, after extent mapping from a text node at...
#define COMPLEX
#define ASIAN
SwBreakIt * g_pBreakIt
Definition: breakit.cxx:34
virtual ::sw::mark::IFieldmark * getFieldmarkAt(const SwPosition &rPos) const =0
get Fieldmark for CH_TXT_ATR_FIELDSTART/CH_TXT_ATR_FIELDEND at rPos
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
static bool isKorean(LanguageType nLang)
static sal_uInt16 MayUnderflow(const SwTextFormatInfo &rInf, TextFrameIndex nIdx, bool bUnderflow)
If a Line is full of HardBlanks and overflows, we must not generate underflows! Causes problems with ...
Definition: porexp.cxx:114
css::uno::Reference< css::i18n::XBreakIterator > const & GetBreakIter() const
Definition: breakit.hxx:63
IDocumentSettingAccess const & getIDocumentSettingAccess() const
Definition: doc.cxx:184
IDocumentMarkAccess * getIDocumentMarkAccess()
Definition: docbm.cxx:1877
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: portxt.cxx:853
virtual bool Format(SwTextFormatInfo &rInf) override
Definition: portxt.cxx:870
virtual bool Format(SwTextFormatInfo &rInf) override
Definition: portxt.cxx:847
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: portxt.cxx:841
virtual bool GetExpText(const SwTextSizeInfo &rInf, OUString &rText) const override
Definition: porfld.cxx:457
FontItalic GetItalic() const
Definition: swfont.hxx:282
sal_uInt16 GetBottomBorderSpace() const
Definition: swfont.hxx:877
sal_uInt16 GetTopBorderSpace() const
Definition: swfont.hxx:862
FontLineStyle GetUnderline() const
Definition: swfont.hxx:272
sal_uInt16 GetRightBorderSpace() const
Definition: swfont.hxx:892
FontStrikeout GetStrikeout() const
Definition: swfont.hxx:276
short CheckKerning()
Definition: swfont.hxx:324
FontLineStyle GetOverline() const
Definition: swfont.hxx:274
void SetUnderline(const FontLineStyle eUnderline)
Definition: swfont.hxx:549
sal_uInt16 GetLeftBorderSpace() const
Definition: swfont.hxx:907
bool IsRightToLeft() const
Definition: frame.hxx:993
SwPageFrame * FindPageFrame()
Definition: frame.hxx:686
virtual SwPosSize GetTextSize(const SwTextSizeInfo &rInfo) const override
Definition: portxt.cxx:763
sal_uInt16 m_nBlankWidth
Definition: portxt.hxx:65
virtual SwLinePortion * Compress() override
Definition: portxt.cxx:760
virtual bool Format(SwTextFormatInfo &rInf) override
Definition: portxt.cxx:819
SwHolePortion(const SwTextPortion &rPor)
Definition: portxt.cxx:750
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: portxt.cxx:778
void dumpAsXml(xmlTextWriterPtr pWriter, const OUString &rText, TextFrameIndex &nOffset) const override
Definition: portxt.cxx:829
virtual void HandlePortion(SwPortionHandler &rPH) const override
Definition: portxt.cxx:824
void SetMidHyph(const bool bNew)
Definition: porlay.hxx:124
void SetEndHyph(const bool bNew)
Definition: porlay.hxx:122
Base class for anything that can be part of a line in the Writer layout.
Definition: porlin.hxx:52
bool IsBlankPortion() const
Definition: porlin.hxx:120
void dumpAsXmlAttributes(xmlTextWriterPtr writer, std::u16string_view rText, TextFrameIndex nOffset) const
Definition: porlin.cxx:333
SwLinePortion * mpNextPortion
Definition: porlin.hxx:55
virtual TextFrameIndex GetModelPositionForViewPoint(sal_uInt16 nOfst) const
the parameter is actually SwTwips apparently?
Definition: porlin.cxx:226
SwLinePortion * GetNextPortion() const
Definition: porlin.hxx:75
void SetAscent(const SwTwips nNewAsc)
Definition: porlin.hxx:82
bool GetJoinBorderWithPrev() const
Definition: porlin.hxx:177
bool InNumberGrp() const
Definition: porlin.hxx:109
PortionType GetWhichPor() const
Definition: porlin.hxx:102
void SetNextPortion(SwLinePortion *pNew)
Definition: porlin.hxx:79
bool IsPostItsPortion() const
Definition: porlin.hxx:137
TextFrameIndex GetLen() const
Definition: porlin.hxx:77
bool IsKernPortion() const
Definition: porlin.hxx:141
bool GetJoinBorderWithNext() const
Definition: porlin.hxx:178
void Truncate()
Definition: porlin.hxx:214
virtual bool GetExpText(const SwTextSizeInfo &rInf, OUString &rText) const
Definition: porlin.cxx:314
bool IsControlCharPortion() const
Definition: porlin.hxx:145
bool IsFootnotePortion() const
Definition: porlin.hxx:129
SwTwips & GetAscent()
Definition: porlin.hxx:80
bool IsErgoSumPortion() const
Definition: porlin.hxx:122
bool IsDropPortion() const
Definition: porlin.hxx:130
bool InTabGrp() const
Definition: porlin.hxx:107
bool IsBreakPortion() const
Definition: porlin.hxx:121
void CalcTextSize(const SwTextSizeInfo &rInfo)
Definition: porlin.cxx:139
void SetLen(TextFrameIndex const nLen)
Definition: porlin.hxx:78
bool IsCombinedPortion() const
Definition: porlin.hxx:138
bool IsHolePortion() const
Definition: porlin.hxx:135
bool InFieldGrp() const
Definition: porlin.hxx:111
bool IsFlyPortion() const
Definition: porlin.hxx:134
SwTwips ExtraBlankWidth() const
Definition: porlin.hxx:87
void SetWhichPor(const PortionType nNew)
Definition: porlin.hxx:101
bool InExpGrp() const
Definition: porlin.hxx:114
bool InFixMargGrp() const
Definition: porlin.hxx:115
void PrePaint(const SwTextPaintInfo &rInf, const SwLinePortion *pLast) const
Definition: porlin.cxx:77
virtual SwLinePortion * Insert(SwLinePortion *pPortion)
Definition: porlin.cxx:169
Collection of SwLineLayout instances, represents the paragraph text in Writer layout.
Definition: porlay.hxx:251
The SwPortionHandler interface implements a visitor for the layout engine's text portions.
virtual void Text(TextFrameIndex nLength, PortionType nType)=0
(empty) destructor
SwTwips Width() const
Definition: possiz.hxx:51
SwPosSize(const SwTwips nW=0, const SwTwips nH=0)
Definition: possiz.hxx:30
SwTwips Height() const
Definition: possiz.hxx:49
Of course Writer needs its own rectangles.
Definition: swrect.hxx:35
bool HasArea() const
Definition: swrect.hxx:300
tools::Rectangle SVRect() const
Definition: swrect.hxx:292
void Left(const tools::Long nLeft)
Definition: swrect.hxx:197
void Width(tools::Long nNew)
Definition: swrect.hxx:189
sal_Int16 ScriptType(const TextFrameIndex nPos) const
Definition: porlay.cxx:1898
sal_Int32 KashidaJustify(KernArray *pKernArray, sal_Bool *pKashidaArray, TextFrameIndex nStt, TextFrameIndex nLen, tools::Long nSpaceAdd=0) const
Performs a kashida justification on the kerning array.
Definition: porlay.cxx:2334
static TextFrameIndex CountCJKCharacters(const OUString &rText, TextFrameIndex nPos, TextFrameIndex nEnd, LanguageType aLang)
Definition: porlay.cxx:2931
static TextFrameIndex ThaiJustify(std::u16string_view aText, KernArray *pKernArray, TextFrameIndex nIdx, TextFrameIndex nLen, TextFrameIndex nNumberOfBlanks=TextFrameIndex(0), tools::Long nSpaceAdd=0)
Performs a thai justification on the kerning array.
Definition: porlay.cxx:2596
size_t CountKashida() const
Definition: scriptinfo.hxx:152
static bool IsArabicText(const OUString &rText, TextFrameIndex nStt, TextFrameIndex nLen)
Checks if text is Arabic text.
Definition: porlay.cxx:2422
static bool IsExportTaggedPDF(const OutputDevice &rOut)
SwLinePortion * GetLast()
Definition: inftxt.hxx:564
bool IsFakeLineStart() const
Definition: inftxt.hxx:575
SwLineLayout * GetRoot()
Definition: inftxt.hxx:560
sal_uInt16 RealWidth() const
Definition: inftxt.hxx:552
TextFrameIndex GetLineStart() const
Definition: inftxt.hxx:593
bool IsUnderflow() const
Definition: inftxt.hxx:586
bool IsFull() const
Definition: inftxt.hxx:566
sal_uInt16 Width() const
Definition: inftxt.hxx:531
SwFlyPortion * GetFly()
Definition: inftxt.hxx:612
TextFrameIndex GetSoftHyphPos() const
Definition: inftxt.hxx:606
bool IsHyphenate() const
If the Hyphenator returns ERROR or the language is set to NOLANGUAGE we do not hyphenate.
Definition: inftxt.cxx:1496
SwTwips GetLineWidth()
Returns the distance between the current horizontal position and the end of the line.
Definition: inftxt.cxx:1773
void SetUnderflow(SwLinePortion *pNew)
Definition: inftxt.hxx:604
void SetSoftHyphPos(TextFrameIndex const nNew)
Definition: inftxt.hxx:607
bool ChgHyph(const bool bNew)
Definition: inftxt.cxx:1995
SwDoc & GetDoc()
Definition: txtfrm.hxx:470
SwPosition MapViewToModelPos(TextFrameIndex nIndex) const
Definition: txtfrm.cxx:1246
LanguageType GetLangOfChar(TextFrameIndex nIndex, sal_uInt16 nScript, bool bNoChar=false) const
Definition: txtfrm.cxx:1343
SwTextGrid GetGridType() const
Definition: tgrditem.hxx:81
bool IsSnapToChars() const
Definition: tgrditem.hxx:100
bool AlternativeSpelling(const SwTextFormatInfo &rInf, const TextFrameIndex nPos)
Definition: guess.cxx:672
SwHangingPortion * GetHangingPortion() const
Definition: guess.hxx:52
TextFrameIndex FieldDiff() const
Definition: guess.hxx:59
sal_uInt16 BreakWidth() const
Definition: guess.hxx:54
SwHangingPortion * ReleaseHangingPortion()
Definition: guess.hxx:53
TextFrameIndex BreakStart() const
Definition: guess.hxx:57
const css::uno::Reference< css::linguistic2::XHyphenatedWord > & HyphWord() const
Definition: guess.hxx:60
TextFrameIndex CutPos() const
Definition: guess.hxx:56
TextFrameIndex BreakPos() const
Definition: guess.hxx:58
bool Guess(const SwTextPortion &rPor, SwTextFormatInfo &rInf, const sal_uInt16 nHeight)
Definition: guess.cxx:52
sal_uInt16 ExtraBlankWidth() const
Definition: guess.hxx:55
SwParaPortion * GetParaPortion()
Definition: inftxt.hxx:121
virtual bool Format(SwTextFormatInfo &rInf) override
Definition: portxt.cxx:684
virtual bool GetExpText(const SwTextSizeInfo &rInf, OUString &rText) const override
Definition: portxt.cxx:721
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: portxt.cxx:689
virtual SwPosSize GetTextSize(const SwTextSizeInfo &rInfo) const override
Definition: portxt.cxx:739
void DrawMarkedText(const SwLinePortion &rPor, TextFrameIndex nLen, const bool bWrong, const bool bSmartTags, const bool bGrammarCheck) const
Definition: inftxt.hxx:765
sw::WrongListIterator * GetpWrongList() const
Definition: inftxt.hxx:452
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
SwTwips X() const
Definition: inftxt.hxx:382
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
sw::WrongListIterator * GetGrammarCheckList() const
Definition: inftxt.hxx:455
void DrawViewOpt(const SwLinePortion &rPor, PortionType nWhich, const Color *pColor=nullptr) const
Definition: inftxt.cxx:1308
void DrawCheckBox(const SwFieldFormCheckboxPortion &rPor, bool bChecked) const
Definition: inftxt.cxx:1091
void DrawBorder(const SwLinePortion &rPor) const
Draw character border around a line portion.
Definition: inftxt.cxx:1296
sw::WrongListIterator * GetSmartTags() const
Definition: inftxt.hxx:458
This portion represents a part of the paragraph string.
Definition: portxt.hxx:27
virtual SwPosSize GetTextSize(const SwTextSizeInfo &rInfo) const override
Definition: portxt.cxx:514
virtual bool GetExpText(const SwTextSizeInfo &rInf, OUString &rText) const override
Definition: portxt.cxx:571
bool CreateHyphen(SwTextFormatInfo &rInf, SwTextGuess const &rGuess)
Definition: txthyph.cxx:252
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: portxt.cxx:529
virtual void HandlePortion(SwPortionHandler &rPH) const override
Definition: portxt.cxx:674
void BreakUnderflow(SwTextFormatInfo &rInf)
Definition: portxt.cxx:264
virtual TextFrameIndex GetModelPositionForViewPoint(sal_uInt16 nOfst) const override
the parameter is actually SwTwips apparently?
Definition: portxt.cxx:507
void BreakCut(SwTextFormatInfo &rInf, const SwTextGuess &rGuess)
Definition: portxt.cxx:219
TextFrameIndex GetSpaceCnt(const SwTextSizeInfo &rInf, TextFrameIndex &rCnt) const
Definition: portxt.cxx:578
static SwTextPortion * CopyLinePortion(const SwLinePortion &rPortion)
Definition: portxt.cxx:211
virtual bool Format(SwTextFormatInfo &rInf) override
Definition: portxt.cxx:445
bool Format_(SwTextFormatInfo &rInf)
Definition: portxt.cxx:280
virtual void FormatEOL(SwTextFormatInfo &rInf) override
Definition: portxt.cxx:473
virtual tools::Long CalcSpacing(tools::Long nSpaceAdd, const SwTextSizeInfo &rInf) const override
Definition: portxt.cxx:617
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
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
sal_uInt16 GetAscent() const
Definition: inftxt.hxx:711
sal_Unicode GetChar(TextFrameIndex const nPos) const
Definition: inftxt.hxx:241
TextFrameIndex GetLen() const
Definition: inftxt.hxx:275
bool IsOtherThanFootnoteInside() const
Definition: inftxt.hxx:202
bool NotEOL() const
Definition: inftxt.hxx:195
bool IsFirstMulti() const
Definition: inftxt.hxx:206
const OUString & GetText() const
Definition: inftxt.hxx:240
TextFrameIndex GetIdx() const
Definition: inftxt.hxx:273
bool SnapToGrid() const
Definition: inftxt.hxx:216
For the text replacement and restoration of SwTextSizeInfo.
Definition: inftxt.hxx:678
bool IsPagePreview() const
Definition: viewopt.hxx:801
bool IsPDFExport() const
Definition: viewopt.hxx:590
const Color & GetFieldShadingsColor() const
Definition: viewopt.cxx:527
bool IsFieldShadings() const
Definition: viewopt.hxx:838
const SwViewOption * GetViewOptions() const
Definition: viewsh.hxx:434
struct _xmlTextWriter * xmlTextWriterPtr
LINESTYLE_NONE
STRIKEOUT_NONE
ITALIC_NONE
constexpr OUStringLiteral CH_TXT_ATR_SUBST_FIELDSTART
Definition: hintids.hxx:187
#define CH_TXT_ATR_INPUTFIELDSTART
Definition: hintids.hxx:179
constexpr OUStringLiteral CH_TXT_ATR_SUBST_FIELDEND
Definition: hintids.hxx:188
#define CH_TXT_ATR_INPUTFIELDEND
Definition: hintids.hxx:180
#define CH_TXT_ATR_FIELDEND
Definition: hintids.hxx:186
#define CH_TXT_ATR_FIELDSTART
Definition: hintids.hxx:184
#define CH_TXTATR_BREAKWORD
Definition: hintids.hxx:175
#define LANGUAGE_THAI
sal_uInt16 nPos
aStr
long Long
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
Definition: nodeoffset.hxx:35
constexpr OUStringLiteral ODF_FORMCHECKBOX
SwTextGridItem const * GetGridItem(SwPageFrame const *const)
Definition: pagechg.cxx:2650
static TextFrameIndex lcl_AddSpace(const SwTextSizeInfo &rInf, const OUString *pStr, const SwLinePortion &rPor)
Definition: portxt.cxx:48
static bool lcl_HasContent(const SwFieldPortion &rField, SwTextFormatInfo const &rInf)
Definition: portxt.cxx:274
#define SPACING_PRECISION_FACTOR
Definition: scriptinfo.hxx:41
Marks a position in the document model.
Definition: pam.hxx:37
const sal_Unicode CH_SIX_PER_EM
Definition: swfont.hxx:49
const sal_Unicode CH_BLANK
Definition: swfont.hxx:42
const sal_Unicode CH_FULL_BLANK
Definition: swfont.hxx:47
constexpr sal_Int32 COMPLETE_STRING
Definition: swtypes.hxx:57
@ GRID_LINES_CHARS
Definition: tgrditem.hxx:30
unsigned char sal_uInt8
oslFileHandle & pOut