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