LibreOffice Module sw (master)  1
txthyph.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 <breakit.hxx>
21 #include <hintids.hxx>
22 #include <editeng/unolingu.hxx>
23 #include <com/sun/star/i18n/WordType.hpp>
24 #include <com/sun/star/i18n/XBreakIterator.hpp>
25 #include <viewopt.hxx>
26 #include <viewsh.hxx>
27 #include <SwPortionHandler.hxx>
28 #include "porhyph.hxx"
29 #include "inftxt.hxx"
30 #include "itrform2.hxx"
31 #include "guess.hxx"
32 #include <splargs.hxx>
33 #include <rootfrm.hxx>
34 
35 using namespace ::com::sun::star;
36 using namespace ::com::sun::star::uno;
37 using namespace ::com::sun::star::beans;
38 using namespace ::com::sun::star::linguistic2;
39 using namespace ::com::sun::star::i18n;
40 
41 Reference< XHyphenatedWord > SwTextFormatInfo::HyphWord(
42  const OUString &rText, const sal_Int32 nMinTrail )
43 {
44  if( rText.getLength() < 4 || m_pFnt->IsSymbol(m_pVsh) )
45  return nullptr;
46  Reference< XHyphenator > xHyph = ::GetHyphenator();
47  Reference< XHyphenatedWord > xHyphWord;
48 
49  if( xHyph.is() )
50  xHyphWord = xHyph->hyphenate( rText,
52  rText.getLength() - nMinTrail, GetHyphValues() );
53  return xHyphWord;
54 
55 }
56 
61 {
62  vcl::RenderContext* pRenderContext = getRootFrame()->GetCurrShell()->GetOut();
63  OSL_ENSURE( ! IsVertical() || ! IsSwapped(),"swapped frame at SwTextFrame::Hyphenate" );
64 
65  assert(g_pBreakIt && g_pBreakIt->GetBreakIter().is());
66 
67  // We lock it, to start with
68  OSL_ENSURE( !IsLocked(), "SwTextFrame::Hyphenate: this is locked" );
69 
70  // The frame::Frame must have a valid SSize!
71  Calc(pRenderContext);
72  GetFormatted();
73 
74  bool bRet = false;
75  if( !IsEmpty() )
76  {
77  // We always need to enable hyphenation
78  // Don't be afraid: the SwTextIter saves the old row in the hyphenate
79  TextFrameLockGuard aLock( this );
80 
81  if ( IsVertical() )
83 
84  SwTextFormatInfo aInf( getRootFrame()->GetCurrShell()->GetOut(), this, true ); // true for interactive hyph!
85  SwTextFormatter aLine( this, &aInf );
86  aLine.CharToLine( rHyphInf.m_nStart );
87 
88  // If we're within the first word of a row, it could've been hyphenated
89  // in the row earlier.
90  // That's why we go one row back.
91  if( aLine.Prev() )
92  {
93  SwLinePortion *pPor = aLine.GetCurr()->GetFirstPortion();
94  while( pPor->GetNextPortion() )
95  pPor = pPor->GetNextPortion();
96  if( pPor->GetWhichPor() == PortionType::SoftHyphen ||
98  aLine.Next();
99  }
100 
101  const TextFrameIndex nEnd = rHyphInf.m_nEnd;
102  while( !bRet && aLine.GetStart() < nEnd )
103  {
104  bRet = aLine.Hyphenate( rHyphInf );
105  if( !aLine.Next() )
106  break;
107  }
108 
109  if ( IsVertical() )
111  }
112  return bRet;
113 }
114 
123 {
124  OSL_ENSURE( pRoot, "SetParaPortion: no root anymore" );
125  pInf->m_pPara = pRoot;
126 }
127 
129 {
130  SwTextFormatInfo &rInf = GetInfo();
131 
132  // We never need to hyphenate anything in the last row
133  // Except for, if it contains a FlyPortion or if it's the
134  // last row of the Master
135  if( !GetNext() && !rInf.GetTextFly().IsOn() && !m_pFrame->GetFollow() )
136  return false;
137 
138  TextFrameIndex nWrdStart = m_nStart;
139 
140  // We need to retain the old row
141  // E.g.: The attribute for hyphenation was not set, but
142  // it's always set in SwTextFrame::Hyphenate, because we want
143  // to set breakpoints.
144  SwLineLayout *pOldCurr = m_pCurr;
145 
146  InitCntHyph();
147 
148  // 5298: IsParaLine() (ex.IsFirstLine) calls GetParaPortion().
149  // We have to create the same conditions: in the first line
150  // we format SwParaPortions...
151  if( pOldCurr->IsParaPortion() )
152  {
153  SwParaPortion *pPara = new SwParaPortion();
154  SetParaPortion( &rInf, pPara );
155  m_pCurr = pPara;
156  OSL_ENSURE( IsParaLine(), "SwTextFormatter::Hyphenate: not the first" );
157  }
158  else
159  m_pCurr = new SwLineLayout();
160 
161  nWrdStart = FormatLine( nWrdStart );
162 
163  // You always should keep in mind that for example there are fields
164  // which can be hyphenated
165  if( m_pCurr->PrtWidth() && m_pCurr->GetLen() )
166  {
167  // We must be prepared that there are FlyFrames in the line,
168  // at which line breaking is possible. So we search for the first
169  // HyphPortion in the specified range.
170 
172  const TextFrameIndex nPamStart = rHyphInf.m_nStart;
173  nWrdStart = m_nStart;
174  const TextFrameIndex nEnd = rHyphInf.m_nEnd;
175  while( pPos )
176  {
177  // Either we are above or we are running into a HyphPortion
178  // at the end of line or before a Fly.
179  if( nWrdStart >= nEnd )
180  {
181  nWrdStart = TextFrameIndex(0);
182  break;
183  }
184 
185  if( nWrdStart >= nPamStart && pPos->InHyphGrp()
186  && ( !pPos->IsSoftHyphPortion()
187  || static_cast<SwSoftHyphPortion*>(pPos)->IsExpand() ) )
188  {
189  nWrdStart = nWrdStart + pPos->GetLen();
190  break;
191  }
192 
193  nWrdStart = nWrdStart + pPos->GetLen();
194  pPos = pPos->GetNextPortion();
195  }
196  // When pPos is null, no hyphen position was found.
197  if( !pPos )
198  nWrdStart = TextFrameIndex(0);
199  }
200  else
201  // In case the whole line is zero-length, that's the same situation as
202  // above when the portion iteration ends without explicitly breaking
203  // from the loop.
204  nWrdStart = TextFrameIndex(0);
205 
206  // the old LineLayout is set again ...
207  delete m_pCurr;
208  m_pCurr = pOldCurr;
209 
210  if( pOldCurr->IsParaPortion() )
211  {
212  SetParaPortion( &rInf, static_cast<SwParaPortion*>(pOldCurr) );
213  OSL_ENSURE( IsParaLine(), "SwTextFormatter::Hyphenate: even not the first" );
214  }
215 
216  if (nWrdStart == TextFrameIndex(0))
217  return false;
218 
219  // nWrdStart contains the position in string that should be hyphenated
220  rHyphInf.m_nWordStart = nWrdStart;
221 
222  TextFrameIndex nLen(0);
223  const TextFrameIndex nEnd = nWrdStart;
224 
225  // we search forwards
226  Reference< XHyphenatedWord > xHyphWord;
227 
228  Boundary const aBound = g_pBreakIt->GetBreakIter()->getWordBoundary(
229  rInf.GetText(), sal_Int32(nWrdStart),
230  g_pBreakIt->GetLocale( rInf.GetFont()->GetLanguage() ), WordType::DICTIONARY_WORD, true );
231  nWrdStart = TextFrameIndex(aBound.startPos);
232  nLen = TextFrameIndex(aBound.endPos) - nWrdStart;
233  if (nLen == TextFrameIndex(0))
234  return false;
235 
236  OUString const aSelText(rInf.GetText().copy(sal_Int32(nWrdStart), sal_Int32(nLen)));
237  const sal_Int32 nMinTrail = (nWrdStart + nLen > nEnd)
238  ? sal_Int32(nWrdStart + nLen - nEnd) - 1
239  : 0;
240 
242  xHyphWord = rInf.HyphWord( aSelText, nMinTrail );
243  if ( xHyphWord.is() )
244  {
245  rHyphInf.SetHyphWord( xHyphWord );
246  rHyphInf.m_nWordStart = nWrdStart;
247  rHyphInf.m_nWordLen = nLen;
248  return true;
249  }
250 
251  return false;
252 }
253 
255 {
256  const Reference< XHyphenatedWord >& xHyphWord = rGuess.HyphWord();
257 
258  OSL_ENSURE( !mpNextPortion, "SwTextPortion::CreateHyphen(): another portion, another planet..." );
259  OSL_ENSURE( xHyphWord.is(), "SwTextPortion::CreateHyphen(): You are lucky! The code is robust here." );
260 
261  if( rInf.IsHyphForbud() ||
262  mpNextPortion || // robust
263  !xHyphWord.is() || // more robust
264  // multi-line fields can't be hyphenated interactively
265  ( rInf.IsInterHyph() && InFieldGrp() ) )
266  return false;
267 
268  std::unique_ptr<SwHyphPortion> pHyphPor;
269  TextFrameIndex nPorEnd;
270  SwTextSizeInfo aInf( rInf );
271 
272  // first case: hyphenated word has alternative spelling
273  if ( xHyphWord->isAlternativeSpelling() )
274  {
275  SvxAlternativeSpelling aAltSpell = SvxGetAltSpelling( xHyphWord );
276  OSL_ENSURE( aAltSpell.bIsAltSpelling, "no alternative spelling" );
277 
278  OUString aAltText = aAltSpell.aReplacement;
279  nPorEnd = TextFrameIndex(aAltSpell.nChangedPos) + rGuess.BreakStart() - rGuess.FieldDiff();
280  sal_Int32 nTmpLen = 0;
281 
282  // soft hyphen at alternative spelling position?
283  if( rInf.GetText()[sal_Int32(rInf.GetSoftHyphPos())] == CHAR_SOFTHYPHEN )
284  {
285  pHyphPor.reset(new SwSoftHyphStrPortion( aAltText ));
286  nTmpLen = 1;
287  }
288  else {
289  pHyphPor.reset(new SwHyphStrPortion( aAltText ));
290  }
291 
292  // length of pHyphPor is adjusted
293  pHyphPor->SetLen( TextFrameIndex(aAltText.getLength() + 1) );
294  static_cast<SwPosSize&>(*pHyphPor) = pHyphPor->GetTextSize( rInf );
295  pHyphPor->SetLen( TextFrameIndex(aAltSpell.nChangedLength + nTmpLen) );
296  }
297  else
298  {
299  // second case: no alternative spelling
300  pHyphPor.reset(new SwHyphPortion);
301  pHyphPor->SetLen(TextFrameIndex(1));
302 
303  static const void* nLastFontCacheId = nullptr;
304  static sal_uInt16 aMiniCacheH = 0, aMiniCacheW = 0;
305  const void* nTmpFontCacheId;
306  sal_uInt16 nFntIdx;
307  rInf.GetFont()->GetFontCacheId( nTmpFontCacheId, nFntIdx, rInf.GetFont()->GetActual() );
308  if( !nLastFontCacheId || nLastFontCacheId != nTmpFontCacheId ) {
309  nLastFontCacheId = nTmpFontCacheId;
310  static_cast<SwPosSize&>(*pHyphPor) = pHyphPor->GetTextSize( rInf );
311  aMiniCacheH = pHyphPor->Height();
312  aMiniCacheW = pHyphPor->Width();
313  } else {
314  pHyphPor->Height( aMiniCacheH );
315  pHyphPor->Width( aMiniCacheW );
316  }
317  pHyphPor->SetLen(TextFrameIndex(0));
318 
319  // values required for this
320  nPorEnd = TextFrameIndex(xHyphWord->getHyphenPos() + 1)
321  + rGuess.BreakStart() - rGuess.FieldDiff();
322  }
323 
324  // portion end must be in front of us
325  // we do not put hyphens at start of line
326  if ( nPorEnd > rInf.GetIdx() ||
327  ( nPorEnd == rInf.GetIdx() && rInf.GetLineStart() != rInf.GetIdx() ) )
328  {
329  aInf.SetLen( nPorEnd - rInf.GetIdx() );
330  pHyphPor->SetAscent( GetAscent() );
331  SetLen( aInf.GetLen() );
332  CalcTextSize( aInf );
333 
334  Insert( pHyphPor.release() );
335 
336  short nKern = rInf.GetFont()->CheckKerning();
337  if( nKern )
338  new SwKernPortion( *this, nKern );
339 
340  return true;
341  }
342 
343  // last exit for the lost
344  pHyphPor.reset();
345  BreakCut( rInf, rGuess );
346  return false;
347 }
348 
349 bool SwHyphPortion::GetExpText( const SwTextSizeInfo &/*rInf*/, OUString &rText ) const
350 {
351  rText = "-";
352  return true;
353 }
354 
356 {
357  rPH.Special( GetLen(), OUString('-'), GetWhichPor() );
358 }
359 
361 {
362  const SwLinePortion *pLast = rInf.GetLast();
363  Height( pLast->Height() );
364  SetAscent( pLast->GetAscent() );
365  OUString aText;
366 
367  if( !GetExpText( rInf, aText ) )
368  return false;
369 
370  PrtWidth( rInf.GetTextSize( aText ).Width() );
371  const bool bFull = rInf.Width() <= rInf.X() + PrtWidth();
372  if( bFull && !rInf.IsUnderflow() ) {
373  Truncate();
374  rInf.SetUnderflow( this );
375  }
376 
377  return bFull;
378 }
379 
380 bool SwHyphStrPortion::GetExpText( const SwTextSizeInfo &, OUString &rText ) const
381 {
382  rText = aExpand;
383  return true;
384 }
385 
387 {
388  rPH.Special( GetLen(), aExpand, GetWhichPor() );
389 }
390 
392 
394  bExpand(false), nViewWidth(0)
395 {
398 }
399 
400 sal_uInt16 SwSoftHyphPortion::GetViewWidth( const SwTextSizeInfo &rInf ) const
401 {
402  // Although we're in the const, nViewWidth should be calculated at
403  // the last possible moment
404  if( !Width() && rInf.OnWin() && rInf.GetOpt().IsSoftHyph() && !IsExpand() )
405  {
406  if( !nViewWidth )
407  const_cast<SwSoftHyphPortion*>(this)->nViewWidth
408  = rInf.GetTextSize(OUString('-')).Width();
409  }
410  else
411  const_cast<SwSoftHyphPortion*>(this)->nViewWidth = 0;
412  return nViewWidth;
413 }
414 
425 void SwSoftHyphPortion::Paint( const SwTextPaintInfo &rInf ) const
426 {
427  if( Width() )
428  {
429  rInf.DrawViewOpt( *this, PortionType::SoftHyphen );
430  SwExpandPortion::Paint( rInf );
431  }
432 }
433 
452 {
453  bool bFull = true;
454 
455  // special case for old German spelling
456  if( rInf.IsUnderflow() )
457  {
458  if( rInf.GetSoftHyphPos() )
459  return true;
460 
461  const bool bHyph = rInf.ChgHyph( true );
462  if( rInf.IsHyphenate() )
463  {
464  rInf.SetSoftHyphPos( rInf.GetIdx() );
465  Width(0);
466  // if the soft hyphened word has an alternative spelling
467  // when hyphenated (old German spelling), the soft hyphen
468  // portion has to trigger an underflow
469  SwTextGuess aGuess;
470  bFull = rInf.IsInterHyph() ||
471  !aGuess.AlternativeSpelling(rInf, rInf.GetIdx() - TextFrameIndex(1));
472  }
473  rInf.ChgHyph( bHyph );
474 
475  if( bFull && !rInf.IsHyphForbud() )
476  {
478  FormatEOL( rInf );
479  if ( rInf.GetFly() )
480  rInf.GetRoot()->SetMidHyph( true );
481  else
482  rInf.GetRoot()->SetEndHyph( true );
483  }
484  else
485  {
486  rInf.SetSoftHyphPos( rInf.GetIdx() );
487  Truncate();
488  rInf.SetUnderflow( this );
489  }
490  return true;
491  }
492 
494  SetExpand( true );
495  bFull = SwHyphPortion::Format( rInf );
496  SetExpand( false );
497  if( !bFull )
498  {
499  // By default, we do not have a width, but we do have a height
500  Width(0);
501  }
502  return bFull;
503 }
504 
509 {
510  if( !IsExpand() )
511  {
512  SetExpand( true );
513  if( rInf.GetLast() == this )
514  rInf.SetLast( FindPrevPortion( rInf.GetRoot() ) );
515 
516  // We need to reset the old values
517  const SwTwips nOldX = rInf.X();
518  TextFrameIndex const nOldIdx = rInf.GetIdx();
519  rInf.X( rInf.X() - PrtWidth() );
520  rInf.SetIdx( rInf.GetIdx() - GetLen() );
521  const bool bFull = SwHyphPortion::Format( rInf );
522 
523  // Shady business: We're allowed to get wider, but a Fly is also
524  // being processed, which needs a correct X position
525  if( bFull || !rInf.GetFly() )
526  rInf.X( nOldX );
527  else
528  rInf.X( nOldX + Width() );
529  rInf.SetIdx( nOldIdx );
530  }
531 }
532 
539 bool SwSoftHyphPortion::GetExpText( const SwTextSizeInfo &rInf, OUString &rText ) const
540 {
541  if( IsExpand() || ( rInf.OnWin() && rInf.GetOpt().IsSoftHyph() ) ||
542  ( GetNextPortion() && ( GetNextPortion()->InFixGrp() ||
545  {
546  return SwHyphPortion::GetExpText( rInf, rText );
547  }
548  return false;
549 }
550 
552 {
553  const PortionType nWhich = ! Width() ?
555  GetWhichPor();
556  rPH.Special( GetLen(), OUString('-'), nWhich );
557 }
558 
560 {
561  // Bug or feature?:
562  // {Zu}{k-}{ker}, {k-} will be gray instead of {-}
563  rInf.DrawViewOpt( *this, PortionType::SoftHyphen );
564  SwHyphStrPortion::Paint( rInf );
565 }
566 
568  : SwHyphStrPortion( rStr )
569 {
572 }
573 
574 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
vcl::RenderContext * GetOut() const
Definition: viewsh.hxx:341
uno::Reference< linguistic2::XHyphenator > GetHyphenator()
Definition: swtypes.cxx:50
bool IsParaLine() const
Definition: itrtxt.hxx:125
virtual void HandlePortion(SwPortionHandler &rPH) const override
Definition: txthyph.cxx:355
TextFrameIndex FieldDiff() const
Definition: guess.hxx:57
virtual void FormatEOL(SwTextFormatInfo &rInf) override
Format End of Line.
Definition: txthyph.cxx:508
short CheckKerning()
Definition: swfont.hxx:323
SvxAlternativeSpelling SvxGetAltSpelling(const css::uno::Reference< css::linguistic2::XHyphenatedWord > &rHyphWord)
bool IsUnderflow() const
Definition: inftxt.hxx:588
bool IsExpand() const
Definition: porhyph.hxx:67
const css::beans::PropertyValues & GetHyphValues() const
Definition: inftxt.cxx:1366
sal_uInt16 Height() const
Definition: possiz.hxx:44
SwFont * GetFont()
Definition: inftxt.hxx:238
bool IsSwapped() const
Definition: txtfrm.hxx:524
TextFrameIndex GetStart() const
Definition: itrtxt.hxx:88
void SetParaPortion(SwTextInfo *pInf, SwParaPortion *pRoot)
We format a row for interactive hyphenation We can assume that we've already formatted.
Definition: txthyph.cxx:122
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: porexp.cxx:64
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: txthyph.cxx:559
void BreakCut(SwTextFormatInfo &rInf, const SwTextGuess &rGuess)
Definition: portxt.cxx:224
void CalcTextSize(const SwTextSizeInfo &rInfo)
Definition: porlin.cxx:142
The SwPortionHandler interface implements a visitor for the layout engine's text portions.
bool Hyphenate(SwInterHyphInfoTextFrame &rInf)
Definition: txthyph.cxx:128
void SetLast(SwLinePortion *pNewLast)
Definition: inftxt.hxx:567
SwFont * m_pFnt
Definition: inftxt.hxx:157
virtual bool Format(SwTextFormatInfo &rInf) override
We get the final width from the FormatEOL()
Definition: txthyph.cxx:451
virtual sal_uInt16 GetViewWidth(const SwTextSizeInfo &rInf) const override
Definition: txthyph.cxx:400
void SetLen(TextFrameIndex const nLen)
Definition: porlin.hxx:74
long SwTwips
Definition: swtypes.hxx:49
void CharToLine(TextFrameIndex)
Definition: itrtxt.cxx:194
const SwLineLayout * Next()
Definition: itrtxt.cxx:109
bool IsSymbol(SwViewShell const *pSh)
Definition: swfont.hxx:269
virtual void Calc(vcl::RenderContext *pRenderContext) const
Definition: trvlfrm.cxx:1788
bool InFieldGrp() const
Definition: porlin.hxx:103
SwPosSize GetTextSize(OutputDevice *pOut, const SwScriptInfo *pSI, const OUString &rText, TextFrameIndex nIdx, TextFrameIndex nLen) const
Definition: inftxt.cxx:387
bool AlternativeSpelling(const SwTextFormatInfo &rInf, const TextFrameIndex nPos)
Definition: guess.cxx:559
Collection of SwLineLayout instances, represents the paragraph text in Writer layout.
Definition: porlay.hxx:229
bool ChgHyph(const bool bNew)
Definition: inftxt.cxx:1910
bool IsParaPortion() const
Definition: porlin.hxx:122
bool Hyphenate(SwInterHyphInfoTextFrame &rInf)
We format a Line for interactive hyphenation.
Definition: txthyph.cxx:60
#define CHAR_SOFTHYPHEN
Definition: swtypes.hxx:174
void InitCntHyph()
Definition: itrform2.hxx:218
SwTextFormatInfo & GetInfo()
Definition: itrform2.hxx:213
bool IsLayPortion() const
Definition: porlin.hxx:121
bool IsInterHyph() const
Definition: inftxt.hxx:587
virtual SwLinePortion * Compress() override
Definition: txthyph.cxx:391
bool InHyphGrp() const
Definition: porlin.hxx:100
bool IsBreakPortion() const
Definition: porlin.hxx:113
TextFrameIndex m_nWordStart
output: found word
Definition: txtfrm.hxx:63
SwBreakIt * g_pBreakIt
Definition: breakit.cxx:33
TextFrameIndex BreakStart() const
Definition: guess.hxx:55
TextFrameIndex GetLineStart() const
Definition: inftxt.hxx:595
TextFrameIndex m_nEnd
Definition: txtfrm.hxx:61
SwFontScript GetActual() const
Definition: swfont.hxx:183
SwTextFrame * GetFollow()
Definition: txtfrm.hxx:844
virtual void Special(TextFrameIndex nLength, const OUString &rText, PortionType nType, sal_Int32 nHeight=0, sal_Int32 nWidth=0, const SwFont *pFont=nullptr)=0
special portion.
virtual bool GetExpText(const SwTextSizeInfo &rInf, OUString &rText) const override
Definition: txthyph.cxx:349
bool IsSoftHyphPortion() const
Definition: porlin.hxx:126
virtual bool Format(SwTextFormatInfo &rInf) override
Definition: txthyph.cxx:360
bool IsEmpty() const
Definition: txtfrm.hxx:509
void SetEndHyph(const bool bNew)
Definition: porlay.hxx:112
const SwViewOption & GetOpt() const
Definition: inftxt.hxx:245
Collection of SwLinePortion instances, representing one line of text.
Definition: porlay.hxx:78
SwTextFly & GetTextFly()
Definition: inftxt.hxx:390
void SetWhichPor(const PortionType nNew)
Definition: porlin.hxx:93
void SetUnderflow(SwLinePortion *pNew)
Definition: inftxt.hxx:606
SwLinePortion * GetFirstPortion() const
Definition: porlay.cxx:673
bool IsHyphForbud() const
Definition: inftxt.hxx:570
void SetExpand(const bool bNew)
Definition: porhyph.hxx:66
sal_uInt16 Width() const
Definition: inftxt.hxx:533
SwLineLayout * GetRoot()
Definition: inftxt.hxx:562
PortionType
Definition: txttypes.hxx:22
SwTextFrame * GetFormatted(bool bForceQuickFormat=false)
In case the SwLineLayout was cleared out of the s_pTextCache, recreate it.
Definition: txtfrm.cxx:3360
TextFrameIndex GetIdx() const
Definition: inftxt.hxx:278
bool IsDropPortion() const
Definition: porlin.hxx:120
bool IsLocked() const
Definition: txtfrm.hxx:505
TextFrameIndex GetLen() const
Definition: porlin.hxx:73
const OUString & GetText() const
Definition: inftxt.hxx:246
void Truncate()
Definition: porlin.hxx:195
SwLinePortion * mpNextPortion
Definition: porlin.hxx:53
SwTwips X() const
Definition: inftxt.hxx:385
SwTextFrame * m_pFrame
Definition: itrtxt.hxx:34
Base class for anything that can be part of a line in the Writer layout.
Definition: porlin.hxx:49
const SwLineLayout * Prev()
Definition: itrtxt.cxx:91
const css::lang::Locale & GetLocale(const LanguageType aLang)
Definition: breakit.hxx:67
void SetSoftHyphPos(TextFrameIndex const nNew)
Definition: inftxt.hxx:609
bool CreateHyphen(SwTextFormatInfo &rInf, SwTextGuess const &rGuess)
Definition: txthyph.cxx:254
virtual bool GetExpText(const SwTextSizeInfo &rInf, OUString &rText) const override
We're expanding:
Definition: txthyph.cxx:539
LanguageType GetLanguage() const
Definition: swfont.hxx:282
TextFrameIndex m_nStart
Definition: itrtxt.hxx:41
virtual bool GetExpText(const SwTextSizeInfo &rInf, OUString &rText) const override
Definition: txthyph.cxx:380
TextFrameIndex FormatLine(TextFrameIndex nStart)
Definition: itrform2.cxx:1469
bool IsHyphenate() const
If the Hyphenator returns ERROR or the language is set to NOLANGUAGE we do not hyphenate.
Definition: inftxt.cxx:1439
void SetLen(const TextFrameIndex nNew)
Definition: inftxt.hxx:281
css::uno::Reference< css::linguistic2::XHyphenatedWord > HyphWord(const OUString &rText, const sal_Int32 nMinTrail)
Definition: txthyph.cxx:41
PortionType GetWhichPor() const
Definition: porlin.hxx:94
sal_uInt16 nViewWidth
Definition: porhyph.hxx:57
void SwapWidthAndHeight()
Swaps width and height of the text frame.
Definition: txtfrm.cxx:430
bool OnWin() const
Definition: inftxt.hxx:199
TextFrameIndex m_nStart
input: requested range to hyphenate
Definition: txtfrm.hxx:60
TextFrameIndex GetLen() const
Definition: inftxt.hxx:280
SwLinePortion * FindPrevPortion(const SwLinePortion *pRoot)
Definition: porlin.cxx:213
sal_uInt16 Width() const
Definition: possiz.hxx:46
virtual void Paint(const SwTextPaintInfo &rInf) const override
Cases:
Definition: txthyph.cxx:425
SwParaPortion * m_pPara
Definition: inftxt.hxx:115
virtual void HandlePortion(SwPortionHandler &rPH) const override
Definition: txthyph.cxx:386
SwLinePortion * GetLast()
Definition: inftxt.hxx:566
a clone of SwInterHyphInfo, but with TextFrameIndex instead of node index
Definition: txtfrm.hxx:53
bool IsSoftHyph() const
Definition: viewopt.hxx:247
SwSoftHyphStrPortion(const OUString &rStr)
Definition: txthyph.cxx:567
css::uno::Reference< css::i18n::XBreakIterator > const & GetBreakIter()
Definition: breakit.hxx:62
const SwLineLayout * GetNext() const
Definition: itrtxt.hxx:84
const SwLineLayout * GetCurr() const
Definition: itrtxt.hxx:83
void SetAscent(const sal_uInt16 nNewAsc)
Definition: porlin.hxx:78
bool IsVertical() const
Definition: frame.hxx:949
bool IsOn() const
Definition: txtfly.hxx:313
SwLineLayout * m_pCurr
Definition: itrtxt.hxx:36
void PrtWidth(sal_uInt16 nNewWidth)
Definition: porlin.hxx:79
virtual void HandlePortion(SwPortionHandler &rPH) const override
Definition: txthyph.cxx:551
sal_uInt16 PrtWidth() const
Definition: porlin.hxx:80
SwFlyPortion * GetFly()
Definition: inftxt.hxx:614
void SetMidHyph(const bool bNew)
Definition: porlay.hxx:114
SwLinePortion * GetNextPortion() const
Definition: porlin.hxx:71
bool InFixGrp() const
Definition: porlin.hxx:102
void SetIdx(const TextFrameIndex nNew)
Definition: inftxt.hxx:279
SwViewShell * GetCurrShell() const
Definition: rootfrm.hxx:204
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...
SwViewShell * m_pVsh
Definition: inftxt.hxx:146
TextFrameIndex m_nWordLen
Definition: txtfrm.hxx:64
sal_uInt16 & GetAscent()
Definition: porlin.hxx:76
virtual SwLinePortion * Insert(SwLinePortion *pPortion)
Definition: porlin.cxx:172
TextFrameIndex GetSoftHyphPos() const
Definition: inftxt.hxx:608
SwRootFrame * getRootFrame()
Definition: frame.hxx:657
void DrawViewOpt(const SwLinePortion &rPor, PortionType nWhich) const
Definition: inftxt.cxx:1283
OUString const aExpand
Definition: porhyph.hxx:40
void SetHyphWord(const css::uno::Reference< css::linguistic2::XHyphenatedWord > &xHW)
Definition: txtfrm.hxx:71
const css::uno::Reference< css::linguistic2::XHyphenatedWord > & HyphWord() const
Definition: guess.hxx:58
void GetFontCacheId(const void *&rnFontCacheId, sal_uInt16 &rIdx, SwFontScript nWhich)
Definition: swfont.hxx:197