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>
40#include <sortedobjs.hxx>
41#include <anchoredobject.hxx>
42#include <flyfrm.hxx>
43
44#undef WIDOWTWIPS
45
46namespace
47{
48
49// A Follow on the same page as its master is nasty.
50bool IsNastyFollow( const SwTextFrame *pFrame )
51{
52 OSL_ENSURE( !pFrame->IsFollow() || !pFrame->GetPrev() ||
53 static_cast<const SwTextFrame*>(pFrame->GetPrev())->GetFollow() == pFrame,
54 "IsNastyFollow: What is going on here?" );
55 return pFrame->IsFollow() && pFrame->GetPrev();
56}
57
58}
59
61 : m_nRstHeight(nRst), m_pFrame(pNewFrame)
62{
64 SwRectFnSet aRectFnSet(m_pFrame);
65 m_nOrigin = aRectFnSet.GetPrtTop(*m_pFrame);
66 m_bKeep = !m_pFrame->IsMoveable() || IsNastyFollow( m_pFrame );
67 if( !m_bKeep && m_pFrame->IsInSct() )
68 {
69 const SwSectionFrame* const pSct = m_pFrame->FindSctFrame();
70 m_bKeep = pSct->Lower()->IsColumnFrame() && !pSct->MoveAllowed( m_pFrame );
71 }
74 m_bBreak = false;
75
76 if( !m_nRstHeight && !m_pFrame->IsFollow() && m_pFrame->IsInFootnote() && m_pFrame->HasPara() )
77 {
80 aRectFnSet.GetHeight(m_pFrame->getFrameArea());
81 if( m_nRstHeight < 0 )
82 m_nRstHeight = 0;
83 }
84}
85
106bool SwTextFrameBreak::IsInside( SwTextMargin const &rLine ) const
107{
108 bool bFit = false;
109
111 SwRectFnSet aRectFnSet(m_pFrame);
112 // nOrigin is an absolute value, rLine refers to the swapped situation.
113
114 SwTwips nTmpY;
115 if ( m_pFrame->IsVertical() )
116 nTmpY = m_pFrame->SwitchHorizontalToVertical( rLine.Y() + rLine.GetLineHeight() );
117 else
118 nTmpY = rLine.Y() + rLine.GetLineHeight();
119
120 SwTwips nLineHeight = aRectFnSet.YDiff( nTmpY , m_nOrigin );
121
122 // Calculate extra space for bottom border.
123 nLineHeight += aRectFnSet.GetBottomMargin(*m_pFrame);
124
125 if( m_nRstHeight )
126 bFit = m_nRstHeight >= nLineHeight;
127 else
128 {
129 // The Frame has a height to fit on the page.
130 SwTwips nHeight =
131 aRectFnSet.YDiff( aRectFnSet.GetPrtBottom(*m_pFrame->GetUpper()), m_nOrigin );
132 SwTwips nDiff = nHeight - nLineHeight;
133
134 // Hide whitespace may require not to insert a new page.
135 SwPageFrame* pPageFrame = m_pFrame->FindPageFrame();
136 if (!pPageFrame->CheckPageHeightValidForHideWhitespace(nDiff))
137 nDiff = 0;
138
139 // If everything is inside the existing frame the result is true;
140 bFit = nDiff >= 0;
141
142 // If it didn't fit, try to add the space of footnotes that are anchored
143 // in frames below (in next-chain of) this one as they will need to move
144 // forward anyway if this frame is split.
145 // - except if in tables (need to check if row is splittable?
146 // also, multiple columns looks difficult)
147 if (!bFit && !m_pFrame->IsInTab())
148 {
149 if (SwFootnoteBossFrame const*const pBoss = m_pFrame->FindFootnoteBossFrame())
150 {
151 if (SwFootnoteContFrame const*const pCont = pBoss->FindFootnoteCont())
152 {
153 SwContentFrame const* pContent(m_pFrame);
154 while (pContent->HasFollow())
155 {
156 pContent = pContent->GetFollow();
157 }
158 // start with first text frame that isn't a follow
159 // (ignoring Keep attribute for now, MakeAll should handle it?)
160 pContent = pContent->GetNextContentFrame();
161 ::std::set<SwContentFrame const*> nextFrames;
162 while (pBoss->IsAnLower(pContent))
163 {
164 nextFrames.insert(pContent);
165 pContent = pContent->GetNextContentFrame();
166 }
167 SwTwips nNextFootnotes(0);
168 for (SwFootnoteFrame const* pFootnote = static_cast<SwFootnoteFrame const*>(pCont->Lower());
169 pFootnote != nullptr;
170 pFootnote = static_cast<SwFootnoteFrame const*>(pFootnote->GetNext()))
171 {
172 SwContentFrame const*const pAnchor = pFootnote->GetRef();
173 if (nextFrames.find(pAnchor) != nextFrames.end())
174 {
175 nNextFootnotes += aRectFnSet.GetHeight(pFootnote->getFrameArea());
176 }
177 }
178 bFit = 0 <= nDiff + nNextFootnotes;
179 SAL_INFO_IF(bFit, "sw.core", "no text frame break because ignoring "
180 << nNextFootnotes << " footnote height");
181 }
182 }
183 }
184 if (!bFit && rLine.MaybeHasHints() && m_pFrame->GetFollow()
185 // tdf#153319 RemoveFootnote only works if this frame doesn't
186 && !rLine.GetNext() // contain the footnote portion
187 // if using same footnote container as the follow, pointless to try?
189 {
190 // possibly a footnote that is anchored beyond the end of this
191 // (the last) line is in the way, try to remove it and check again
193 nHeight = aRectFnSet.YDiff( aRectFnSet.GetPrtBottom(*m_pFrame->GetUpper()), m_nOrigin );
194 bFit = nHeight >= nLineHeight;
195 }
196 if ( !bFit )
197 {
198 if ( rLine.GetNext() &&
200 {
201 // add additional space taken as lower space as last content in a table
202 // for all text lines except the last one.
203 nHeight += m_pFrame->CalcAddLowerSpaceAsLastInTableCell();
204 bFit = nHeight >= nLineHeight;
205 }
206 }
207 if( !bFit )
208 {
209 // The LineHeight exceeds the current Frame height.
210 // Call a test Grow to detect if the Frame could
211 // grow the requested area.
212 nHeight += m_pFrame->GrowTst( LONG_MAX );
213
214 // The Grow() returns the height by which the Upper of the TextFrame
215 // would let the TextFrame grow.
216 // The TextFrame itself can grow as much as it wants.
217 bFit = nHeight >= nLineHeight;
218 }
219 }
220
221 return bFit;
222}
223
225{
227
228 // bKeep is stronger than IsBreakNow()
229 // Is there enough space ?
230 if( m_bKeep || IsInside( rLine ) )
231 m_bBreak = false;
232 else
233 {
234 /* This class assumes that the SwTextMargin is processed from Top to
235 * Bottom. Because of performance reasons we stop splitting in the
236 * following cases:
237 * If only one line does not fit.
238 * Special case: with DummyPortions there is LineNr == 1, though we
239 * want to split.
240 */
241 // Include DropLines
242
243 bool bFirstLine = 1 == rLine.GetLineNr() && !rLine.GetPrev();
244 m_bBreak = true;
245
246 if (bFirstLine && m_pFrame->IsEmptyWithSplitFly())
247 {
248 // Not really the first line, visually we may have a previous line (including the fly
249 // frame) already.
250 bFirstLine = false;
251 }
252
253 if( ( bFirstLine && m_pFrame->GetIndPrev() )
254 || ( rLine.GetLineNr() <= rLine.GetDropLines() ) )
255 {
256 m_bKeep = true;
257 m_bBreak = false;
258 }
259 else if(bFirstLine && m_pFrame->IsInFootnote() && !m_pFrame->FindFootnoteFrame()->GetPrev())
260 {
262 if( !pTmp || !pTmp->Lower() )
263 m_bBreak = false;
264 }
265 }
266
267 return m_bBreak;
268}
269
271{
272 // Consider bottom margin
273 SwRectFnSet aRectFnSet(m_pFrame);
274
276
277 if ( aRectFnSet.IsVert() )
278 {
279 if ( m_pFrame->IsVertLR() )
280 m_nRstHeight = aRectFnSet.YDiff( m_pFrame->SwitchHorizontalToVertical( rLine.Y() ) , m_nOrigin );
281 else
283 }
284 else
285 m_nRstHeight += rLine.Y() - m_nOrigin;
286}
287
289 bool bChkKeep )
290 : SwTextFrameBreak( pNewFrame, nRst ), m_nWidLines( 0 ), m_nOrphLines( 0 )
291{
293
294 if( m_bKeep )
295 {
296 // If paragraph should not be split but is larger than
297 // the page, then bKeep is overruled.
298 if( bChkKeep && !m_pFrame->GetPrev() && !m_pFrame->IsInFootnote() &&
299 m_pFrame->IsMoveable() &&
301 m_bKeep = false;
302 // Even if Keep is set, Orphans has to be respected.
303 // e.g. if there are chained frames where a Follow in the last frame
304 // receives a Keep, because it is not (forward) movable -
305 // nevertheless the paragraph can request lines from the Master
306 // because of the Orphan rule.
307 if( m_pFrame->IsFollow() )
309 }
310 else
311 {
313 const SvxOrphansItem &rOrph = rSet.GetOrphans();
314 if ( rOrph.GetValue() > 1 )
315 m_nOrphLines = rOrph.GetValue();
316 if ( m_pFrame->IsFollow() )
317 m_nWidLines = rSet.GetWidows().GetValue();
318
319 }
320
321 if ( !(m_bKeep || m_nWidLines || m_nOrphLines) )
322 return;
323
324 bool bResetFlags = false;
325
326 bool bWordTableCell = false;
327 if (m_pFrame->IsInFly())
328 {
329 // Enable widow / orphan control in Word-style table cells in split rows, at least inside
330 // flys.
331 const SwDoc& rDoc = m_pFrame->GetTextNodeForParaProps()->GetDoc();
333 bWordTableCell = rIDSA.get(DocumentSettingId::TABLE_ROW_KEEP);
334 }
335
336 if ( m_pFrame->IsInTab() && !bWordTableCell )
337 {
338 // For compatibility reasons, we disable Keep/Widows/Orphans
339 // inside splittable row frames:
341 {
342 const SwFrame* pTmpFrame = m_pFrame->GetUpper();
343 while ( !pTmpFrame->IsRowFrame() )
344 pTmpFrame = pTmpFrame->GetUpper();
345 if ( static_cast<const SwRowFrame*>(pTmpFrame)->IsRowSplitAllowed() )
346 bResetFlags = true;
347 }
348 }
349
351 {
352 // Inside of footnotes there are good reasons to turn off the Keep attribute
353 // as well as Widows/Orphans.
355 const bool bFt = !pFootnote->GetAttr()->GetFootnote().IsEndNote();
356 if( !pFootnote->GetPrev() &&
357 pFootnote->FindFootnoteBossFrame( bFt ) != pFootnote->GetRef()->FindFootnoteBossFrame( bFt )
359 {
360 bResetFlags = true;
361 }
362 }
363
364 if ( bResetFlags )
365 {
366 m_bKeep = false;
367 m_nOrphLines = 0;
368 m_nWidLines = 0;
369 }
370}
371
378 bool bHasToFit )
379{
380 // i#16128 - Why member <pFrame> _*and*_ parameter <pFrame>??
381 // Thus, assertion on situation, that these are different to figure out why.
382 OSL_ENSURE( m_pFrame == pFrame, "<WidowsAndOrphans::FindBreak> - pFrame != pFrame" );
383
385
386 bool bRet = true;
387 sal_uInt16 nOldOrphans = m_nOrphLines;
388 if( bHasToFit )
389 m_nOrphLines = 0;
390 rLine.Bottom();
391
392 if( !IsBreakNowWidAndOrp( rLine ) )
393 bRet = false;
394 if( !FindWidows( pFrame, rLine ) )
395 {
396 bool bBack = false;
397
398 while( IsBreakNowWidAndOrp( rLine ) )
399 {
400 if( rLine.PrevLine() )
401 bBack = true;
402 else
403 break;
404 }
405 // Usually Orphans are not taken into account for HasToFit.
406 // But if Dummy-Lines are concerned and the Orphans rule is violated
407 // we make an exception: We leave behind one Dummyline and take
408 // the whole text to the next page/column.
409 if( rLine.GetLineNr() <= nOldOrphans &&
410 rLine.GetInfo().GetParaPortion()->IsDummy() &&
411 ( ( bHasToFit && bRet ) || IsBreakNow( rLine ) ) )
412 rLine.Top();
413
414 rLine.TruncLines( true );
415 bRet = bBack;
416 }
417 m_nOrphLines = nOldOrphans;
418
419 return bRet;
420}
421
429{
430 OSL_ENSURE( ! pFrame->IsVertical() || ! pFrame->IsSwapped(),
431 "WidowsAndOrphans::FindWidows with swapped frame" );
432
433 if( !m_nWidLines || !pFrame->IsFollow() )
434 return false;
435
436 rLine.Bottom();
437
438 // We can still cut something off
439 SwTextFrame *pMaster = pFrame->FindMaster();
440 OSL_ENSURE(pMaster, "+WidowsAndOrphans::FindWidows: Widows in a master?");
441 if( !pMaster )
442 return false;
443
444 // If the first line of the Follow does not fit, the master
445 // probably is full of Dummies. In this case a PrepareHint::Widows would be fatal.
446 if( pMaster->GetOffset() == pFrame->GetOffset() )
447 return false;
448
449 // Remaining height of the master
450 SwRectFnSet aRectFnSet(pFrame);
451
452 const SwTwips nDocPrtTop = aRectFnSet.GetPrtTop(*pFrame);
453 SwTwips nOldHeight;
454 SwTwips nTmpY = rLine.Y() + rLine.GetLineHeight();
455
456 if ( aRectFnSet.IsVert() )
457 {
458 nTmpY = pFrame->SwitchHorizontalToVertical( nTmpY );
459 nOldHeight = -aRectFnSet.GetHeight(pFrame->getFramePrintArea());
460 }
461 else
462 nOldHeight = aRectFnSet.GetHeight(pFrame->getFramePrintArea());
463
464 const SwTwips nChg = aRectFnSet.YDiff( nTmpY, nDocPrtTop + nOldHeight );
465
466 // below the Widows-threshold...
467 if( rLine.GetLineNr() >= m_nWidLines )
468 {
469 // Follow to Master I
470 // If the Follow *grows*, there is the chance for the Master to
471 // receive lines, that it was forced to hand over to the Follow lately:
472 // Prepare(Need); check that below nChg!
473 // (0W, 2O, 2M, 2F) + 1F = 3M, 2F
474 if( rLine.GetLineNr() > m_nWidLines && pFrame->IsJustWidow() )
475 {
476 // If the Master is locked, it has probably just donated a line
477 // to us, we don't return that just because we turned it into
478 // multiple lines (e.g. via frames).
479 if( !pMaster->IsLocked() && pMaster->GetUpper() )
480 {
481 const SwTwips nTmpRstHeight = aRectFnSet.BottomDist( pMaster->getFrameArea(),
482 aRectFnSet.GetPrtBottom(*pMaster->GetUpper()) );
483 if ( nTmpRstHeight >=
484 rLine.GetInfo().GetParaPortion()->Height() )
485 {
487 pMaster->InvalidateSize_();
488 pMaster->InvalidatePage();
489 }
490 }
491
492 pFrame->SetJustWidow( false );
493 }
494 return false;
495 }
496
497 // Follow to Master II
498 // If the Follow *shrinks*, maybe the Master can absorb the whole Orphan.
499 // (0W, 2O, 2M, 1F) - 1F = 3M, 0F -> PrepareHint::AdjustSizeWithoutFormatting
500 // (0W, 2O, 3M, 2F) - 1F = 2M, 2F -> PrepareHint::Widows
501
502 if( 0 > nChg && !pMaster->IsLocked() && pMaster->GetUpper() )
503 {
504 SwTwips nTmpRstHeight = aRectFnSet.BottomDist( pMaster->getFrameArea(),
505 aRectFnSet.GetPrtBottom(*pMaster->GetUpper()) );
506 if( nTmpRstHeight >= rLine.GetInfo().GetParaPortion()->Height() )
507 {
509 pMaster->InvalidateSize_();
510 pMaster->InvalidatePage();
511 pFrame->SetJustWidow( false );
512 return false;
513 }
514 }
515
516 // Master to Follow
517 // If the Follow contains fewer lines than Widows after formatting,
518 // we still can move over some lines from the Master. If this triggers
519 // the Orphans rule of the Master, the Master frame must be Grow()n
520 // in its CalcPreps(), such that it won't fit onto its page anymore.
521 // But if the Master Frame can still lose a few lines, we need to
522 // do a Shrink() in the CalcPreps(); the Follow with the Widows then
523 // moves onto the page of the Master, but remains unsplit, so that
524 // it (finally) moves onto the next page. So much for the theory!
525 //
526 // We only request one line at a time for now, because a Master's line
527 // could result in multiple lines for us.
528 // Therefore, the CalcFollow() remains in control until the Follow got all
529 // necessary lines.
530 sal_Int32 nNeed = 1; // was: nWidLines - rLine.GetLineNr();
531
532 // Special case: Master cannot give lines to follow
533 // i#91421
534 if ( !pMaster->GetIndPrev() )
535 {
536 pMaster->ChgThisLines();
537 sal_Int32 nLines = pMaster->GetThisLines();
538 if(nLines == 0 && pMaster->HasPara())
539 {
540 const SwParaPortion *pMasterPara = pMaster->GetPara();
541 if(pMasterPara && pMasterPara->GetNext())
542 nLines = 2;
543 }
544 if( nLines <= nNeed )
545 return false;
546
547 if (pFrame->IsInTab())
548 {
549 const SwFrame* pRow = pFrame;
550 while (pRow && !pRow->IsRowFrame())
551 {
552 pRow = pRow->GetUpper();
553 }
554
555 if (pRow && pRow->HasFixSize())
556 {
557 // This is a follow frame and our side is fixed.
559 const SvxOrphansItem& rOrph = rSet.GetOrphans();
560 if (nLines <= static_cast<sal_Int32>(rOrph.GetValue()))
561 {
562 // If the master gives us a line as part of widow control, then its orphan
563 // control will move everything to the follow, which is worse than having no
564 // widow / orphan control at all. Don't send a Widows prepare hint, in this
565 // case.
566 return true;
567 }
568 }
569 }
570 }
571
572 pMaster->Prepare( PrepareHint::Widows, static_cast<void*>(&nNeed) );
573 return true;
574}
575
576bool WidowsAndOrphans::WouldFit( SwTextMargin &rLine, SwTwips &rMaxHeight, bool bTst, bool bMoveBwd )
577{
578 // Here it does not matter, if pFrame is swapped or not.
579 // IsInside() takes care of itself
580
581 // We expect that rLine is set to the last line
582 OSL_ENSURE( !rLine.GetNext(), "WouldFit: aLine::Bottom missed!" );
583 sal_Int32 nLineCnt = rLine.GetLineNr();
584
585 // First satisfy the Orphans-rule and the wish for initials ...
586 const sal_uInt16 nMinLines = std::max( GetOrphansLines(), rLine.GetDropLines() );
587 if ( nLineCnt < nMinLines )
588 return false;
589
590 rLine.Top();
591 SwTwips nLineSum = rLine.GetLineHeight();
592
593 // tdf#146500 for MoveBwd(), want at least 1 line with non-fly
594 bool hasNonFly(!bMoveBwd);
595 while (nMinLines > rLine.GetLineNr() || !hasNonFly)
596 {
597 if( !rLine.NextLine() )
598 {
599 if (nMinLines > rLine.GetLineNr())
600 return false;
601 else
602 break;
603 }
604 nLineSum += rLine.GetLineHeight();
605 for (SwLinePortion const* pPortion = rLine.GetCurr()->GetFirstPortion();
606 !hasNonFly && pPortion; pPortion = pPortion->GetNextPortion())
607 {
608 switch (pPortion->GetWhichPor())
609 {
610 case PortionType::Fly:
613 break;
614 default:
615 {
616 hasNonFly = true;
617 break;
618 }
619 }
620 }
621 }
622
623 // We do not fit
624 if( !IsInside( rLine ) )
625 return false;
626
627 // Check the Widows-rule
628 if( !m_nWidLines && !m_pFrame->IsFollow() )
629 {
630 // Usually we only have to check for Widows if we are a Follow.
631 // On WouldFit the rule has to be checked for the Master too,
632 // because we are just in the middle of calculating the break.
633 // In Ctor of WidowsAndOrphans the nWidLines are only calced for
634 // Follows from the AttrSet - so we catch up now:
636 m_nWidLines = rSet.GetWidows().GetValue();
637 }
638
639 // After Orphans/Initials, do enough lines remain for Widows?
640 // If we are currently doing a test formatting, we may not
641 // consider the widows rule for two reasons:
642 // 1. The columns may have different widths.
643 // Widow lines would have wrong width.
644 // 2. Test formatting is only done up to the given space.
645 // we do not have any lines for widows at all.
646 if( bTst || nLineCnt - nMinLines >= m_nWidLines )
647 {
648 if( rMaxHeight >= nLineSum )
649 {
650 rMaxHeight -= nLineSum;
651 return true;
652 }
653 }
654 return false;
655}
656
657/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Provides access to settings of a document.
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
bool MaybeHasHints() const
Definition: itratr.cxx:127
const SvxFormatSplitItem & GetSplit(bool=true) const
Definition: paratr.hxx:205
const SvxWidowsItem & GetWidows(bool=true) const
Definition: paratr.hxx:209
const SvxFormatKeepItem & GetKeep(bool=true) const
Definition: frmatr.hxx:68
SwContentFrame is the layout for content nodes: a common base class for text (paragraph) and non-text...
Definition: cntfrm.hxx:59
const SwContentFrame * GetFollow() const
Definition: cntfrm.hxx:136
SwContentFrame * GetNextContentFrame() const
Definition: cntfrm.hxx:120
SwTextFrame * FindMaster() const
Definition: flowfrm.cxx:762
const SwAttrSet & GetSwAttrSet() const
Does node has already its own auto-attributes? Access to SwAttrSet.
Definition: node.hxx:727
Definition: doc.hxx:197
IDocumentSettingAccess const & getIDocumentSettingAccess() const
Definition: doc.cxx:190
SwLayoutFrame * FindBodyCont()
Searches the first ContentFrame in BodyText below the page.
Definition: findfrm.cxx:48
Represents one footnote or endnote in the layout.
Definition: ftnfrm.hxx:84
const SwTextFootnote * GetAttr() const
Definition: ftnfrm.hxx:126
const SwContentFrame * GetRef() const
Definition: ftnfrm.cxx:2909
bool IsEndNote() const
Definition: fmtftn.hxx:75
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:1228
SwFrame * GetIndPrev() const
Definition: frame.hxx:730
SwSectionFrame * FindSctFrame()
Definition: frame.hxx:1121
bool HasFixSize() const
Definition: frame.hxx:676
bool IsColumnFrame() const
Definition: frame.hxx:1188
bool IsInFootnote() const
Definition: frame.hxx:955
bool IsInTab() const
Definition: frame.hxx:961
bool IsInFly() const
Definition: frame.hxx:967
const SwRowFrame * IsInFollowFlowRow() const
Definition: findfrm.cxx:1874
bool IsMoveable(const SwLayoutFrame *_pLayoutFrame=nullptr) const
determine, if frame is moveable in given environment
Definition: findfrm.cxx:1447
SwLayoutFrame * GetNextCellLeaf()
Definition: findfrm.cxx:1611
SwLayoutFrame * GetUpper()
Definition: frame.hxx:684
bool IsVertical() const
Definition: frame.hxx:979
void InvalidatePage(const SwPageFrame *pPage=nullptr) const
Invalidates the page in which the Frame is currently placed.
Definition: wsfrm.cxx:618
SwFrame * GetPrev()
Definition: frame.hxx:683
void InvalidateSize_()
Definition: frame.hxx:777
bool IsVertLR() const
Definition: frame.hxx:985
SwPageFrame * FindPageFrame()
Definition: frame.hxx:686
SwFootnoteFrame * FindFootnoteFrame()
Definition: frame.hxx:1113
SwFrame * GetIndNext()
Definition: frame.hxx:733
SwFootnoteBossFrame * FindFootnoteBossFrame(bool bFootnotes=false)
Definition: findfrm.cxx:491
bool IsInSct() const
Definition: frame.hxx:973
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:841
virtual void Height(const SwTwips nNew, const bool bText=true) override
Definition: porlay.cxx:231
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
SwDoc & GetDoc()
Definition: node.hxx:233
A page of the document layout.
Definition: pagefrm.hxx:60
bool CheckPageHeightValidForHideWhitespace(SwTwips nDiff)
Is bottom-of-page-frame - bottom-of-text-frame difference valid in case whitespace is hidden?...
Definition: pagechg.cxx:2547
Collection of SwLineLayout instances, represents the paragraph text in Writer layout.
Definition: porlay.hxx:251
bool IsVert() const
Definition: frame.hxx:1372
tools::Long GetHeight(const SwRect &rRect) const
Definition: frame.hxx:1387
tools::Long GetBottomMargin(const SwFrame &rFrame) const
Definition: frame.hxx:1409
tools::Long YDiff(tools::Long n1, tools::Long n2) const
Definition: frame.hxx:1428
tools::Long GetPrtTop(const SwFrame &rFrame) const
Definition: frame.hxx:1414
tools::Long BottomDist(const SwRect &rRect, tools::Long nPos) const
Definition: frame.hxx:1419
tools::Long GetPrtBottom(const SwFrame &rFrame) const
Definition: frame.hxx:1415
SwRowFrame is one table row in the document layout.
Definition: rowfrm.hxx:29
bool MoveAllowed(const SwFrame *) const
Definition: sectfrm.cxx:2418
const SwFormatFootnote & GetFootnote() const
Definition: txatbase.hxx:208
SwTextFrameBreak(SwTextFrame *pFrame, const SwTwips nRst=0)
Definition: widorp.cxx:60
SwTwips m_nOrigin
Definition: widorp.hxx:30
bool IsBreakNow(SwTextMargin &rLine)
Definition: widorp.cxx:224
void SetRstHeight(const SwTextMargin &rLine)
Definition: widorp.cxx:270
SwTextFrame * m_pFrame
Definition: widorp.hxx:32
bool IsInside(SwTextMargin const &rLine) const
BP 18.6.93: Widows.
Definition: widorp.cxx:106
SwTwips m_nRstHeight
Definition: widorp.hxx:29
Represents the visualization of a paragraph.
Definition: txtfrm.hxx:168
SwTextFrame * GetFollow()
Definition: txtfrm.hxx:889
bool IsEmptyWithSplitFly() const
This text frame is not split, doesn't fit the upper, has a single split fly anchored to it with a neg...
Definition: itratr.cxx:1549
TextFrameIndex GetOffset() const
Definition: txtfrm.hxx:453
bool HasPara() const
Definition: txtfrm.hxx:853
void RemoveFootnote(TextFrameIndex nStart, TextFrameIndex nLen=TextFrameIndex(COMPLETE_STRING))
Footnote.
Definition: txtftn.cxx:408
bool IsSwapped() const
Definition: txtfrm.hxx:553
SwParaPortion * GetPara()
Definition: txtcache.cxx:90
bool IsLocked() const
Definition: txtfrm.hxx:535
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:255
void ChgThisLines()
Definition: txtfrm.cxx:3929
SwTwips GrowTst(const SwTwips nGrow)
Test grow.
Definition: txtfrm.hxx:858
sal_Int32 GetThisLines() const
Definition: txtfrm.hxx:686
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:2840
SwTwips GetFootnoteFrameHeight() const
Definition: txtfrm.hxx:877
bool IsJustWidow() const
Definition: txtfrm.hxx:538
SwTextNode const * GetTextNodeForParaProps() const
Definition: txtfrm.cxx:1390
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_Int32 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:377
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:428
WidowsAndOrphans(SwTextFrame *pFrame, const SwTwips nRst=0, bool bCheckKeep=true)
Definition: widorp.cxx:288
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:576
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
tools::Long SwTwips
Definition: swtypes.hxx:51
@ AdjustSizeWithoutFormatting