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