LibreOffice Module sw (master) 1
widorp.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 <layfrm.hxx>
21#include <ftnboss.hxx>
22#include <ndtxt.hxx>
23#include <paratr.hxx>
24#include <editeng/orphitem.hxx>
25#include <editeng/widwitem.hxx>
26#include <editeng/keepitem.hxx>
27#include <editeng/spltitem.hxx>
28#include <frmatr.hxx>
29#include <txtftn.hxx>
30#include <fmtftn.hxx>
31#include <rowfrm.hxx>
32
33#include "widorp.hxx"
34#include <txtfrm.hxx>
35#include "itrtxt.hxx"
36#include <sectfrm.hxx>
37#include <ftnfrm.hxx>
38#include <pagefrm.hxx>
39
40#undef WIDOWTWIPS
41
42namespace
43{
44
45// A Follow on the same page as its master is nasty.
46bool IsNastyFollow( const SwTextFrame *pFrame )
47{
48 OSL_ENSURE( !pFrame->IsFollow() || !pFrame->GetPrev() ||
49 static_cast<const SwTextFrame*>(pFrame->GetPrev())->GetFollow() == pFrame,
50 "IsNastyFollow: What is going on here?" );
51 return pFrame->IsFollow() && pFrame->GetPrev();
52}
53
54}
55
57 : m_nRstHeight(nRst), m_pFrame(pNewFrame)
58{
60 SwRectFnSet aRectFnSet(m_pFrame);
61 m_nOrigin = aRectFnSet.GetPrtTop(*m_pFrame);
62 m_bKeep = !m_pFrame->IsMoveable() || IsNastyFollow( m_pFrame );
63 if( !m_bKeep && m_pFrame->IsInSct() )
64 {
65 const SwSectionFrame* const pSct = m_pFrame->FindSctFrame();
66 m_bKeep = pSct->Lower()->IsColumnFrame() && !pSct->MoveAllowed( m_pFrame );
67 }
70 m_bBreak = false;
71
72 if( !m_nRstHeight && !m_pFrame->IsFollow() && m_pFrame->IsInFootnote() && m_pFrame->HasPara() )
73 {
76 aRectFnSet.GetHeight(m_pFrame->getFrameArea());
77 if( m_nRstHeight < 0 )
78 m_nRstHeight = 0;
79 }
80}
81
102bool SwTextFrameBreak::IsInside( SwTextMargin const &rLine ) const
103{
104 bool bFit = false;
105
107 SwRectFnSet aRectFnSet(m_pFrame);
108 // nOrigin is an absolute value, rLine refers to the swapped situation.
109
110 SwTwips nTmpY;
111 if ( m_pFrame->IsVertical() )
112 nTmpY = m_pFrame->SwitchHorizontalToVertical( rLine.Y() + rLine.GetLineHeight() );
113 else
114 nTmpY = rLine.Y() + rLine.GetLineHeight();
115
116 SwTwips nLineHeight = aRectFnSet.YDiff( nTmpY , m_nOrigin );
117
118 // Calculate extra space for bottom border.
119 nLineHeight += aRectFnSet.GetBottomMargin(*m_pFrame);
120
121 if( m_nRstHeight )
122 bFit = m_nRstHeight >= nLineHeight;
123 else
124 {
125 // The Frame has a height to fit on the page.
126 SwTwips nHeight =
127 aRectFnSet.YDiff( aRectFnSet.GetPrtBottom(*m_pFrame->GetUpper()), m_nOrigin );
128 SwTwips nDiff = nHeight - nLineHeight;
129
130 // Hide whitespace may require not to insert a new page.
131 SwPageFrame* pPageFrame = m_pFrame->FindPageFrame();
132 if (!pPageFrame->CheckPageHeightValidForHideWhitespace(nDiff))
133 nDiff = 0;
134
135 // If everything is inside the existing frame the result is true;
136 bFit = nDiff >= 0;
137
138 // If it didn't fit, try to add the space of footnotes that are anchored
139 // in frames below (in next-chain of) this one as they will need to move
140 // forward anyway if this frame is split.
141 // - except if in tables (need to check if row is splittable?
142 // also, multiple columns looks difficult)
143 if (!bFit && !m_pFrame->IsInTab())
144 {
145 if (SwFootnoteBossFrame const*const pBoss = m_pFrame->FindFootnoteBossFrame())
146 {
147 if (SwFootnoteContFrame const*const pCont = pBoss->FindFootnoteCont())
148 {
149 SwContentFrame const* pContent(m_pFrame);
150 while (pContent->HasFollow())
151 {
152 pContent = pContent->GetFollow();
153 }
154 // start with first text frame that isn't a follow
155 // (ignoring Keep attribute for now, MakeAll should handle it?)
156 pContent = pContent->GetNextContentFrame();
157 ::std::set<SwContentFrame const*> nextFrames;
158 while (pBoss->IsAnLower(pContent))
159 {
160 nextFrames.insert(pContent);
161 pContent = pContent->GetNextContentFrame();
162 }
163 SwTwips nNextFootnotes(0);
164 for (SwFootnoteFrame const* pFootnote = static_cast<SwFootnoteFrame const*>(pCont->Lower());
165 pFootnote != nullptr;
166 pFootnote = static_cast<SwFootnoteFrame const*>(pFootnote->GetNext()))
167 {
168 SwContentFrame const*const pAnchor = pFootnote->GetRef();
169 if (nextFrames.find(pAnchor) != nextFrames.end())
170 {
171 nNextFootnotes += aRectFnSet.GetHeight(pFootnote->getFrameArea());
172 }
173 }
174 bFit = 0 <= nDiff + nNextFootnotes;
175 SAL_INFO_IF(bFit, "sw.core", "no text frame break because ignoring "
176 << nNextFootnotes << " footnote height");
177 }
178 }
179 }
180 if (!bFit && rLine.MaybeHasHints() && m_pFrame->GetFollow()
181 // if using same footnote container as the follow, pointless to try?
183 {
184 // possibly a footnote that is anchored beyond the end of this
185 // (the last) line is in the way, try to remove it and check again
187 nHeight = aRectFnSet.YDiff( aRectFnSet.GetPrtBottom(*m_pFrame->GetUpper()), m_nOrigin );
188 bFit = nHeight >= nLineHeight;
189 }
190 if ( !bFit )
191 {
192 if ( rLine.GetNext() &&
194 {
195 // add additional space taken as lower space as last content in a table
196 // for all text lines except the last one.
197 nHeight += m_pFrame->CalcAddLowerSpaceAsLastInTableCell();
198 bFit = nHeight >= nLineHeight;
199 }
200 }
201 if( !bFit )
202 {
203 // The LineHeight exceeds the current Frame height.
204 // Call a test Grow to detect if the Frame could
205 // grow the requested area.
206 nHeight += m_pFrame->GrowTst( LONG_MAX );
207
208 // The Grow() returns the height by which the Upper of the TextFrame
209 // would let the TextFrame grow.
210 // The TextFrame itself can grow as much as it wants.
211 bFit = nHeight >= nLineHeight;
212 }
213 }
214
215 return bFit;
216}
217
219{
221
222 // bKeep is stronger than IsBreakNow()
223 // Is there enough space ?
224 if( m_bKeep || IsInside( rLine ) )
225 m_bBreak = false;
226 else
227 {
228 /* This class assumes that the SwTextMargin is processed from Top to
229 * Bottom. Because of performance reasons we stop splitting in the
230 * following cases:
231 * If only one line does not fit.
232 * Special case: with DummyPortions there is LineNr == 1, though we
233 * want to split.
234 */
235 // Include DropLines
236
237 bool bFirstLine = 1 == rLine.GetLineNr() && !rLine.GetPrev();
238 m_bBreak = true;
239 if( ( bFirstLine && m_pFrame->GetIndPrev() )
240 || ( rLine.GetLineNr() <= rLine.GetDropLines() ) )
241 {
242 m_bKeep = true;
243 m_bBreak = false;
244 }
245 else if(bFirstLine && m_pFrame->IsInFootnote() && !m_pFrame->FindFootnoteFrame()->GetPrev())
246 {
248 if( !pTmp || !pTmp->Lower() )
249 m_bBreak = false;
250 }
251 }
252
253 return m_bBreak;
254}
255
257{
258 // Consider bottom margin
259 SwRectFnSet aRectFnSet(m_pFrame);
260
262
263 if ( aRectFnSet.IsVert() )
264 {
265 if ( m_pFrame->IsVertLR() )
266 m_nRstHeight = aRectFnSet.YDiff( m_pFrame->SwitchHorizontalToVertical( rLine.Y() ) , m_nOrigin );
267 else
269 }
270 else
271 m_nRstHeight += rLine.Y() - m_nOrigin;
272}
273
275 bool bChkKeep )
276 : SwTextFrameBreak( pNewFrame, nRst ), m_nWidLines( 0 ), m_nOrphLines( 0 )
277{
279
280 if( m_bKeep )
281 {
282 // If paragraph should not be split but is larger than
283 // the page, then bKeep is overruled.
284 if( bChkKeep && !m_pFrame->GetPrev() && !m_pFrame->IsInFootnote() &&
285 m_pFrame->IsMoveable() &&
287 m_bKeep = false;
288 // Even if Keep is set, Orphans has to be respected.
289 // e.g. if there are chained frames where a Follow in the last frame
290 // receives a Keep, because it is not (forward) movable -
291 // nevertheless the paragraph can request lines from the Master
292 // because of the Orphan rule.
293 if( m_pFrame->IsFollow() )
295 }
296 else
297 {
299 const SvxOrphansItem &rOrph = rSet.GetOrphans();
300 if ( rOrph.GetValue() > 1 )
301 m_nOrphLines = rOrph.GetValue();
302 if ( m_pFrame->IsFollow() )
303 m_nWidLines = rSet.GetWidows().GetValue();
304
305 }
306
307 if ( !(m_bKeep || m_nWidLines || m_nOrphLines) )
308 return;
309
310 bool bResetFlags = false;
311
312 if ( m_pFrame->IsInTab() )
313 {
314 // For compatibility reasons, we disable Keep/Widows/Orphans
315 // inside splittable row frames:
317 {
318 const SwFrame* pTmpFrame = m_pFrame->GetUpper();
319 while ( !pTmpFrame->IsRowFrame() )
320 pTmpFrame = pTmpFrame->GetUpper();
321 if ( static_cast<const SwRowFrame*>(pTmpFrame)->IsRowSplitAllowed() )
322 bResetFlags = true;
323 }
324 }
325
327 {
328 // Inside of footnotes there are good reasons to turn off the Keep attribute
329 // as well as Widows/Orphans.
331 const bool bFt = !pFootnote->GetAttr()->GetFootnote().IsEndNote();
332 if( !pFootnote->GetPrev() &&
333 pFootnote->FindFootnoteBossFrame( bFt ) != pFootnote->GetRef()->FindFootnoteBossFrame( bFt )
335 {
336 bResetFlags = true;
337 }
338 }
339
340 if ( bResetFlags )
341 {
342 m_bKeep = false;
343 m_nOrphLines = 0;
344 m_nWidLines = 0;
345 }
346}
347
354 bool bHasToFit )
355{
356 // i#16128 - Why member <pFrame> _*and*_ parameter <pFrame>??
357 // Thus, assertion on situation, that these are different to figure out why.
358 OSL_ENSURE( m_pFrame == pFrame, "<WidowsAndOrphans::FindBreak> - pFrame != pFrame" );
359
361
362 bool bRet = true;
363 sal_uInt16 nOldOrphans = m_nOrphLines;
364 if( bHasToFit )
365 m_nOrphLines = 0;
366 rLine.Bottom();
367
368 if( !IsBreakNowWidAndOrp( rLine ) )
369 bRet = false;
370 if( !FindWidows( pFrame, rLine ) )
371 {
372 bool bBack = false;
373
374 while( IsBreakNowWidAndOrp( rLine ) )
375 {
376 if( rLine.PrevLine() )
377 bBack = true;
378 else
379 break;
380 }
381 // Usually Orphans are not taken into account for HasToFit.
382 // But if Dummy-Lines are concerned and the Orphans rule is violated
383 // we make an exception: We leave behind one Dummyline and take
384 // the whole text to the next page/column.
385 if( rLine.GetLineNr() <= nOldOrphans &&
386 rLine.GetInfo().GetParaPortion()->IsDummy() &&
387 ( ( bHasToFit && bRet ) || IsBreakNow( rLine ) ) )
388 rLine.Top();
389
390 rLine.TruncLines( true );
391 bRet = bBack;
392 }
393 m_nOrphLines = nOldOrphans;
394
395 return bRet;
396}
397
405{
406 OSL_ENSURE( ! pFrame->IsVertical() || ! pFrame->IsSwapped(),
407 "WidowsAndOrphans::FindWidows with swapped frame" );
408
409 if( !m_nWidLines || !pFrame->IsFollow() )
410 return false;
411
412 rLine.Bottom();
413
414 // We can still cut something off
415 SwTextFrame *pMaster = pFrame->FindMaster();
416 OSL_ENSURE(pMaster, "+WidowsAndOrphans::FindWidows: Widows in a master?");
417 if( !pMaster )
418 return false;
419
420 // If the first line of the Follow does not fit, the master
421 // probably is full of Dummies. In this case a PrepareHint::Widows would be fatal.
422 if( pMaster->GetOffset() == pFrame->GetOffset() )
423 return false;
424
425 // Remaining height of the master
426 SwRectFnSet aRectFnSet(pFrame);
427
428 const SwTwips nDocPrtTop = aRectFnSet.GetPrtTop(*pFrame);
429 SwTwips nOldHeight;
430 SwTwips nTmpY = rLine.Y() + rLine.GetLineHeight();
431
432 if ( aRectFnSet.IsVert() )
433 {
434 nTmpY = pFrame->SwitchHorizontalToVertical( nTmpY );
435 nOldHeight = -aRectFnSet.GetHeight(pFrame->getFramePrintArea());
436 }
437 else
438 nOldHeight = aRectFnSet.GetHeight(pFrame->getFramePrintArea());
439
440 const SwTwips nChg = aRectFnSet.YDiff( nTmpY, nDocPrtTop + nOldHeight );
441
442 // below the Widows-threshold...
443 if( rLine.GetLineNr() >= m_nWidLines )
444 {
445 // Follow to Master I
446 // If the Follow *grows*, there is the chance for the Master to
447 // receive lines, that it was forced to hand over to the Follow lately:
448 // Prepare(Need); check that below nChg!
449 // (0W, 2O, 2M, 2F) + 1F = 3M, 2F
450 if( rLine.GetLineNr() > m_nWidLines && pFrame->IsJustWidow() )
451 {
452 // If the Master is locked, it has probably just donated a line
453 // to us, we don't return that just because we turned it into
454 // multiple lines (e.g. via frames).
455 if( !pMaster->IsLocked() && pMaster->GetUpper() )
456 {
457 const SwTwips nTmpRstHeight = aRectFnSet.BottomDist( pMaster->getFrameArea(),
458 aRectFnSet.GetPrtBottom(*pMaster->GetUpper()) );
459 if ( nTmpRstHeight >=
460 rLine.GetInfo().GetParaPortion()->Height() )
461 {
463 pMaster->InvalidateSize_();
464 pMaster->InvalidatePage();
465 }
466 }
467
468 pFrame->SetJustWidow( false );
469 }
470 return false;
471 }
472
473 // Follow to Master II
474 // If the Follow *shrinks*, maybe the Master can absorb the whole Orphan.
475 // (0W, 2O, 2M, 1F) - 1F = 3M, 0F -> PrepareHint::AdjustSizeWithoutFormatting
476 // (0W, 2O, 3M, 2F) - 1F = 2M, 2F -> PrepareHint::Widows
477
478 if( 0 > nChg && !pMaster->IsLocked() && pMaster->GetUpper() )
479 {
480 SwTwips nTmpRstHeight = aRectFnSet.BottomDist( pMaster->getFrameArea(),
481 aRectFnSet.GetPrtBottom(*pMaster->GetUpper()) );
482 if( nTmpRstHeight >= rLine.GetInfo().GetParaPortion()->Height() )
483 {
485 pMaster->InvalidateSize_();
486 pMaster->InvalidatePage();
487 pFrame->SetJustWidow( false );
488 return false;
489 }
490 }
491
492 // Master to Follow
493 // If the Follow contains fewer lines than Widows after formatting,
494 // we still can move over some lines from the Master. If this triggers
495 // the Orphans rule of the Master, the Master frame must be Grow()n
496 // in its CalcPreps(), such that it won't fit onto its page anymore.
497 // But if the Master Frame can still lose a few lines, we need to
498 // do a Shrink() in the CalcPreps(); the Follow with the Widows then
499 // moves onto the page of the Master, but remains unsplit, so that
500 // it (finally) moves onto the next page. So much for the theory!
501 //
502 // We only request one line at a time for now, because a Master's line
503 // could result in multiple lines for us.
504 // Therefore, the CalcFollow() remains in control until the Follow got all
505 // necessary lines.
506 sal_uInt16 nNeed = 1; // was: nWidLines - rLine.GetLineNr();
507
508 // Special case: Master cannot give lines to follow
509 // i#91421
510 if ( !pMaster->GetIndPrev() )
511 {
512 pMaster->ChgThisLines();
513 sal_uLong nLines = pMaster->GetThisLines();
514 if(nLines == 0 && pMaster->HasPara())
515 {
516 const SwParaPortion *pMasterPara = pMaster->GetPara();
517 if(pMasterPara && pMasterPara->GetNext())
518 nLines = 2;
519 }
520 if( nLines <= nNeed )
521 return false;
522 }
523
524 pMaster->Prepare( PrepareHint::Widows, static_cast<void*>(&nNeed) );
525 return true;
526}
527
528bool WidowsAndOrphans::WouldFit( SwTextMargin &rLine, SwTwips &rMaxHeight, bool bTst, bool bMoveBwd )
529{
530 // Here it does not matter, if pFrame is swapped or not.
531 // IsInside() takes care of itself
532
533 // We expect that rLine is set to the last line
534 OSL_ENSURE( !rLine.GetNext(), "WouldFit: aLine::Bottom missed!" );
535 sal_uInt16 nLineCnt = rLine.GetLineNr();
536
537 // First satisfy the Orphans-rule and the wish for initials ...
538 const sal_uInt16 nMinLines = std::max( GetOrphansLines(), rLine.GetDropLines() );
539 if ( nLineCnt < nMinLines )
540 return false;
541
542 rLine.Top();
543 SwTwips nLineSum = rLine.GetLineHeight();
544
545 // tdf#146500 for MoveBwd(), want at least 1 line with non-fly
546 bool hasNonFly(!bMoveBwd);
547 while (nMinLines > rLine.GetLineNr() || !hasNonFly)
548 {
549 if( !rLine.NextLine() )
550 {
551 if (nMinLines > rLine.GetLineNr())
552 return false;
553 else
554 break;
555 }
556 nLineSum += rLine.GetLineHeight();
557 for (SwLinePortion const* pPortion = rLine.GetCurr()->GetFirstPortion();
558 !hasNonFly && pPortion; pPortion = pPortion->GetNextPortion())
559 {
560 switch (pPortion->GetWhichPor())
561 {
562 case PortionType::Fly:
565 break;
566 default:
567 {
568 hasNonFly = true;
569 break;
570 }
571 }
572 }
573 }
574
575 // We do not fit
576 if( !IsInside( rLine ) )
577 return false;
578
579 // Check the Widows-rule
580 if( !m_nWidLines && !m_pFrame->IsFollow() )
581 {
582 // Usually we only have to check for Widows if we are a Follow.
583 // On WouldFit the rule has to be checked for the Master too,
584 // because we are just in the middle of calculating the break.
585 // In Ctor of WidowsAndOrphans the nWidLines are only calced for
586 // Follows from the AttrSet - so we catch up now:
588 m_nWidLines = rSet.GetWidows().GetValue();
589 }
590
591 // After Orphans/Initials, do enough lines remain for Widows?
592 // If we are currently doing a test formatting, we may not
593 // consider the widows rule for two reasons:
594 // 1. The columns may have different widths.
595 // Widow lines would have wrong width.
596 // 2. Test formatting is only done up to the given space.
597 // we do not have any lines for widows at all.
598 if( bTst || nLineCnt - nMinLines >= m_nWidLines )
599 {
600 if( rMaxHeight >= nLineSum )
601 {
602 rMaxHeight -= nLineSum;
603 return true;
604 }
605 }
606 return false;
607}
608
609/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool MaybeHasHints() const
Definition: itratr.cxx:123
const SvxFormatSplitItem & GetSplit(bool=true) const
Definition: paratr.hxx:196
const SvxWidowsItem & GetWidows(bool=true) const
Definition: paratr.hxx:200
const SvxFormatKeepItem & GetKeep(bool=true) const
Definition: frmatr.hxx:56
SwContentFrame is the layout for content nodes: a common base class for text (paragraph) and non-text...
Definition: cntfrm.hxx:58
const SwContentFrame * GetFollow() const
Definition: cntfrm.hxx:135
SwContentFrame * GetNextContentFrame() const
Definition: cntfrm.hxx:119
SwTextFrame * FindMaster() const
Definition: flowfrm.cxx:737
const SwAttrSet & GetSwAttrSet() const
Does node has already its own auto-attributes? Access to SwAttrSet.
Definition: node.hxx:765
SwLayoutFrame * FindBodyCont()
Searches the first ContentFrame in BodyText below the page.
Definition: findfrm.cxx:47
const SwTextFootnote * GetAttr() const
Definition: ftnfrm.hxx:122
const SwContentFrame * GetRef() const
Definition: ftnfrm.cxx:2906
bool IsEndNote() const
Definition: fmtftn.hxx:73
const SwRect & getFrameArea() const
Definition: frame.hxx:179
const SwRect & getFramePrintArea() const
Definition: frame.hxx:180
Base class of the Writer layout elements.
Definition: frame.hxx:315
bool IsRowFrame() const
Definition: frame.hxx:1223
SwFrame * GetIndPrev() const
Definition: frame.hxx:725
SwSectionFrame * FindSctFrame()
Definition: frame.hxx:1116
bool IsColumnFrame() const
Definition: frame.hxx:1183
bool IsInFootnote() const
Definition: frame.hxx:950
bool IsInTab() const
Definition: frame.hxx:956
const SwRowFrame * IsInFollowFlowRow() const
Definition: findfrm.cxx:1854
bool IsMoveable(const SwLayoutFrame *_pLayoutFrame=nullptr) const
determine, if frame is moveable in given environment
Definition: findfrm.cxx:1427
SwLayoutFrame * GetNextCellLeaf()
Definition: findfrm.cxx:1591
SwLayoutFrame * GetUpper()
Definition: frame.hxx:679
bool IsVertical() const
Definition: frame.hxx:974
void InvalidatePage(const SwPageFrame *pPage=nullptr) const
Invalidates the page in which the Frame is currently placed.
Definition: wsfrm.cxx:613
SwFrame * GetPrev()
Definition: frame.hxx:678
void InvalidateSize_()
Definition: frame.hxx:772
bool IsVertLR() const
Definition: frame.hxx:980
SwPageFrame * FindPageFrame()
Definition: frame.hxx:681
SwFootnoteFrame * FindFootnoteFrame()
Definition: frame.hxx:1108
SwFrame * GetIndNext()
Definition: frame.hxx:728
SwFootnoteBossFrame * FindFootnoteBossFrame(bool bFootnotes=false)
Definition: findfrm.cxx:471
bool IsInSct() const
Definition: frame.hxx:968
A layout frame is a frame that contains other frames (m_pLower), e.g. SwPageFrame or SwTabFrame.
Definition: layfrm.hxx:36
const SwFrame * Lower() const
Definition: layfrm.hxx:101
SwLineLayout * GetNext()
Definition: porlay.hxx:159
SwLinePortion * GetFirstPortion() const
Definition: porlay.cxx:849
virtual void Height(const SwTwips nNew, const bool bText=true) override
Definition: porlay.cxx:239
bool IsDummy() const
Definition: porlay.hxx:151
Base class for anything that can be part of a line in the Writer layout.
Definition: porlin.hxx:52
SwLinePortion * GetNextPortion() const
Definition: porlin.hxx:75
A page of the document layout.
Definition: pagefrm.hxx:58
bool CheckPageHeightValidForHideWhitespace(SwTwips nDiff)
Is bottom-of-page-frame - bottom-of-text-frame difference valid in case whitespace is hidden?...
Definition: pagechg.cxx:2541
Collection of SwLineLayout instances, represents the paragraph text in Writer layout.
Definition: porlay.hxx:251
bool IsVert() const
Definition: frame.hxx:1367
tools::Long GetHeight(const SwRect &rRect) const
Definition: frame.hxx:1382
tools::Long GetBottomMargin(const SwFrame &rFrame) const
Definition: frame.hxx:1404
tools::Long YDiff(tools::Long n1, tools::Long n2) const
Definition: frame.hxx:1423
tools::Long GetPrtTop(const SwFrame &rFrame) const
Definition: frame.hxx:1409
tools::Long BottomDist(const SwRect &rRect, tools::Long nPos) const
Definition: frame.hxx:1414
tools::Long GetPrtBottom(const SwFrame &rFrame) const
Definition: frame.hxx:1410
SwRowFrame is one table row in the document layout.
Definition: rowfrm.hxx:29
bool MoveAllowed(const SwFrame *) const
Definition: sectfrm.cxx:2400
const SwFormatFootnote & GetFootnote() const
Definition: txatbase.hxx:208
SwTextFrameBreak(SwTextFrame *pFrame, const SwTwips nRst=0)
Definition: widorp.cxx:56
SwTwips m_nOrigin
Definition: widorp.hxx:30
bool IsBreakNow(SwTextMargin &rLine)
Definition: widorp.cxx:218
void SetRstHeight(const SwTextMargin &rLine)
Definition: widorp.cxx:256
SwTextFrame * m_pFrame
Definition: widorp.hxx:32
bool IsInside(SwTextMargin const &rLine) const
BP 18.6.93: Widows.
Definition: widorp.cxx:102
SwTwips m_nRstHeight
Definition: widorp.hxx:29
Represents the visualization of a paragraph.
Definition: txtfrm.hxx:165
sal_uLong GetThisLines() const
Definition: txtfrm.hxx:674
SwTextFrame * GetFollow()
Definition: txtfrm.hxx:861
TextFrameIndex GetOffset() const
Definition: txtfrm.hxx:444
bool HasPara() const
Definition: txtfrm.hxx:825
void RemoveFootnote(TextFrameIndex nStart, TextFrameIndex nLen=TextFrameIndex(COMPLETE_STRING))
Footnote.
Definition: txtftn.cxx:408
bool IsSwapped() const
Definition: txtfrm.hxx:541
SwParaPortion * GetPara()
Definition: txtcache.cxx:90
bool IsLocked() const
Definition: txtfrm.hxx:523
void SwitchHorizontalToVertical(SwRect &rRect) const
Calculates the coordinates of a rectangle when switching from horizontal to vertical layout.
Definition: txtfrm.cxx:473
void SetJustWidow(const bool bNew)
Definition: txtfrm.hxx:252
void ChgThisLines()
Definition: txtfrm.cxx:3832
SwTwips GrowTst(const SwTwips nGrow)
Test grow.
Definition: txtfrm.hxx:830
virtual bool Prepare(const PrepareHint ePrep=PrepareHint::Clear, const void *pVoid=nullptr, bool bNotify=true) override
SwContentFrame: the shortcut for the Frames If the void* casts wrongly, it's its own fault!...
Definition: txtfrm.cxx:2748
SwTwips GetFootnoteFrameHeight() const
Definition: txtfrm.hxx:849
bool IsJustWidow() const
Definition: txtfrm.hxx:526
SwTextNode const * GetTextNodeForParaProps() const
Definition: txtfrm.cxx:1303
SwParaPortion * GetParaPortion()
Definition: inftxt.hxx:121
const SwLineLayout * NextLine()
Definition: itrtxt.cxx:125
TextFrameIndex GetEnd() const
Definition: itrtxt.hxx:89
SwTwips Y() const
Definition: itrtxt.hxx:90
const SwLineLayout * GetNext() const
Definition: itrtxt.hxx:84
void TruncLines(bool bNoteFollow=false)
Definition: itrtxt.cxx:365
void Bottom()
Definition: itrtxt.cxx:186
const SwLineLayout * PrevLine()
Definition: itrtxt.cxx:171
void Top()
Definition: itrtxt.hxx:99
SwTwips GetLineHeight() const
Definition: itrtxt.hxx:116
const SwLineLayout * GetCurr() const
Definition: itrtxt.hxx:83
sal_uInt16 GetLineNr() const
Definition: itrtxt.hxx:87
const SwLineLayout * GetPrev()
Definition: itrtxt.cxx:83
sal_uInt16 GetDropLines() const
Definition: itrtxt.hxx:202
SwTextSizeInfo & GetInfo()
Definition: itrtxt.hxx:216
sal_uInt16 GetOrphansLines() const
Definition: widorp.hxx:61
sal_uInt16 m_nOrphLines
Definition: widorp.hxx:55
bool FindBreak(SwTextFrame *pFrame, SwTextMargin &rLine, bool bHasToFit)
The Find*-Methods do not only search, but adjust the SwTextMargin to the line where the paragraph sho...
Definition: widorp.cxx:353
bool FindWidows(SwTextFrame *pFrame, SwTextMargin &rLine)
FindWidows positions the SwTextMargin of the Master to the line where to break by examining and forma...
Definition: widorp.cxx:404
WidowsAndOrphans(SwTextFrame *pFrame, const SwTwips nRst=0, bool bCheckKeep=true)
Definition: widorp.cxx:274
bool IsBreakNowWidAndOrp(SwTextMargin &rLine)
Definition: widorp.hxx:69
sal_uInt16 m_nWidLines
Definition: widorp.hxx:55
bool WouldFit(SwTextMargin &rLine, SwTwips &rMaxHeight, bool bTest, bool bMoveBwd)
Definition: widorp.cxx:528
const long LONG_MAX
#define SAL_INFO_IF(condition, area, stream)
void swap(cow_wrapper< T, P > &a, cow_wrapper< T, P > &b)
static SfxItemSet & rSet
sal_uIntPtr sal_uLong
tools::Long SwTwips
Definition: swtypes.hxx:51
@ AdjustSizeWithoutFormatting