20#include <config_wasm_strip.h>
25#include <osl/diagnose.h>
111 aFrm.
Pos().setX(aFrm.
Pos().getX() + aFrm.
Width() - nWidth);
114 aFrm.
Width( nWidth );
147 if( nNumberOfLines > pGrid->
GetLines() )
151 nSize = nNumberOfLines * nSum;
157 GetFootnoteIdxs().empty();
179 (void)xmlTextWriterStartElement(writer,
reinterpret_cast<const xmlChar*
>(
"body"));
182 (void)xmlTextWriterStartElement(writer, BAD_CAST(
"infos"));
184 (void)xmlTextWriterEndElement(writer);
187 (void)xmlTextWriterEndElement(writer);
229 aFrm.
Width ( nWidth );
246 Calc(pRenderContext);
249 pBodyFrame->
Paste(
this );
250 pBodyFrame->
Calc(pRenderContext);
295 pAnchoredObj->SetPageFrame(
nullptr );
354 if( SvxFrameDirection::Horizontal_LR_TB == nDir || SvxFrameDirection::Horizontal_RL_TB == nDir )
371 if(SvxFrameDirection::Vertical_RL_TB == nDir)
373 else if(SvxFrameDirection::Vertical_LR_TB==nDir)
382 if( SvxFrameDirection::Horizontal_RL_TB == nDir )
403 if ( pTmp->
GetType() & nTypes )
407 pLay->
Calc(pRenderContext);
414 for(
size_t i = 0;
i < rSpzs.
size(); ++
i )
416 auto pSpz = rSpzs[
i];
426 pSpz->SetFormatAttr( aAnch );
435 if ( bSdrObj &&
nullptr == (pSdrObj = pSpz->FindSdrObject()) )
437 OSL_FAIL(
"DrawObject not found." );
438 pSpz->GetDoc()->DelFrameFormat( pSpz );
453 if (
auto pDrawVirtObj =
dynamic_cast<SwDrawVirtObj *
>( pSdrObj ) )
457 pDrawVirtObj->RemoveFromWriterLayout();
458 pDrawVirtObj->RemoveFromDrawingPage();
532 else if (rHint.
GetId() == SfxHintId::SwLegacyModify)
536 pSh->SetFirstVisPageInvalid();
541 auto& rOldSetChg = *
static_cast<const SwAttrSetChg*
>(pLegacy->m_pOld);
542 auto& rNewSetChg = *
static_cast<const SwAttrSetChg*
>(pLegacy->m_pNew);
551 UpdateAttr_(pOItem, pNItem, eInvFlags, &aOldSet, &aNewSet);
559 UpdateAttr_(pLegacy->m_pOld, pLegacy->m_pNew, eInvFlags);
586 const sal_uInt16 nWhich = pOld ? pOld->
Which() : pNew ? pNew->
Which() : 0;
605 Calc(pRenderContext);
608 pBodyFrame->
Paste(
this);
615 assert(pOld && pNew);
618 assert(pOldFormat && pNewFormat);
621 if( rOldCol != rNewCol )
624 assert(pB &&
"Page without Body.");
664 static_cast<const SwFormatChg*
>(pNew)->pChangedFormat->GetFrameSize() :
684 SwRect aOldRectWithBorderAndShadow;
696 assert(pOld && pNew);
726 if ( pOldSet || pNewSet )
801 if ( pFlow && pFlow->
IsInTab() )
807 SwFlowFrame *pTmp = SwFlowFrame::CastFlowFrame( pFlow );
808 if ( !pTmp->IsFollow() )
829 OSL_ENSURE( pRet,
"could not find page descriptor." );
842 if( pRoot == rSh.GetLayout() )
879 if ( pAnchPage && (pAnchPage !=
this) )
882 pFly->InvalidateSize();
883 pFly->InvalidatePos_();
892 if ( pSh && pSh->
GetWin() )
916 static_cast<SwRootFrame*
>(pRootFrame)->CheckViewLayout(
nullptr,
nullptr );
921 OSL_ENSURE( pParent->
IsRootFrame(),
"Parent is no Root." );
922 OSL_ENSURE( pParent,
"No parent for Paste()." );
923 OSL_ENSURE( pParent !=
this,
"I'm my own parent." );
924 OSL_ENSURE( pSibling !=
this,
"I'm my own neighbour." );
926 "I am still registered somewhere." );
1000 if (
auto pFly = pAnchoredObj->DynCastFlyFrame() )
1002 pFrame = pFly->ContainsContent();
1017 bool bExistEssentialObjs = (
nullptr != rPage.
GetSortedObjs());
1018 if (bExistEssentialObjs)
1024 bool bOnlySuperfluousObjs =
true;
1026 for (
size_t i = 0; bOnlySuperfluousObjs &&
i < rObjs.
size(); ++
i)
1035 bOnlySuperfluousObjs =
false;
1038 bExistEssentialObjs = !bOnlySuperfluousObjs;
1043 if ( bExistEssentialObjs ||
1081 assert(pStart &&
"no starting page.");
1089 SAL_INFO(
"sw.pageframe",
"CheckPageDescs out fast - via SetCheckPageNum: "
1121 if ( bIsOdd != bWantOdd ||
1124 ( !bIsEmpty || pFormatWish )
1145 if ( bIsEmpty && ( pFormatWish ||
1146 ( !bWantOdd && !pPrevPage ) ) )
1161 if ( !pNextFormatWish )
1163 if ( pNextFormatWish && pNextPage->
GetFormat() == pNextFormatWish )
1166 <<
" c: 1+3 - skip next page of p: " << pPage );
1176 bool bUpdatePrev =
false;
1177 if (ppPrev && *ppPrev == pPage)
1180 <<
" c: 1 - destroy p: " << pPage );
1182 if ( pStart == pPage )
1186 *ppPrev = pNextPage;
1189 else if ( bIsEmpty && !pFormatWish &&
1193 <<
" c: 2 - set desc p: " << pPage <<
" d: " << pDesc );
1196 else if ( !bIsEmpty &&
1197 bIsOdd != bWantOdd &&
1198 ( ( !pPrevPage && !bWantOdd ) ||
1207 <<
" c: 3 - insert empty p: " << pTmp <<
" d: " << pDesc );
1208 pTmp->
Paste( pRoot, pPage );
1211 isPageFrameEmpty =
false;
1218 <<
" c: 4 - set desc + format p: " << pPage
1219 <<
" d: " << pDesc <<
" f: " << pFormatWish );
1231 else if ( pFormatWish && pPage->
GetFormat() != pFormatWish )
1235 <<
" c: 5 - set format p: " << pPage <<
" f: " << pFormatWish );
1237 else if ( !pFormatWish )
1241 if ( pFormatWish && pPage->
GetFormat() != pFormatWish )
1245 <<
" c: 6 - set format p: " << pPage <<
" f: " << pFormatWish );
1248#if OSL_DEBUG_LEVEL > 0
1251 OSL_FAIL(
"CheckPageDescs, missing solution" );
1255 assert(!bIsEmpty || !isPageFrameEmpty);
1256 const bool bWantRemovePage = bIsEmpty || isPageFrameEmpty;
1267 if (isPageFrameEmpty && pPage->
GetPrev())
1272 bool bUpdatePrev =
false;
1273 if (ppPrev && *ppPrev == pPage)
1276 SAL_INFO(
"sw.pageframe",
"CheckPageDescs - handle bIsEmpty - destroy p: " << pPage );
1277 if ( pStart == pPage )
1296#if OSL_DEBUG_LEVEL > 0
1298 bool bEmpty =
false;
1306 OSL_FAIL(
"double empty pages." );
1317 SAL_INFO(
"sw.pageframe",
"CheckPageDescs out)" );
1327 const SwFrame* pBodyContent = pBody ? pBody->
Lower() :
nullptr;
1340 SAL_INFO(
"sw.pageframe",
"doInsertPage p: " << pPage
1341 <<
" d: " << pDesc <<
" f: " << pFormat );
1344 SAL_INFO(
"sw.pageframe",
"doInsertPage - insert empty p: "
1345 << pPage <<
" d: " << pDesc );
1346 pPage->
Paste( pRoot, pSibling );
1355 pPrevPage->InvalidateSize();
1368 if (!pRefPage || !isDeleteForbidden(pSibling))
1386 bool bWishedRightPage = bNextRightPage;
1391 if (
IsFlowFrame() && !SwFlowFrame::CastFlowFrame(
this )->IsFollow() )
1397 ::std::optional<sal_uInt16> oNumOffset = rDesc.
GetNumOffset();
1406 assert(pDesc &&
"Missing PageDesc");
1408 bWishedRightPage = !bWishedRightPage;
1409 bool const bWishedFirst = pDesc != pPrevPage->
GetPageDesc();
1412 bool bCheckPages =
false;
1414 if (bWishedRightPage != bNextRightPage)
1425 if( doInsertPage( pRoot, &pSibling, pFormat, pDesc,
bFootnote, &pPage ) )
1442 SAL_INFO(
"sw.pageframe",
"InsertPage - SetCheckPageNumDirect: "
1475 return bRightSidebar
1494 OSL_ENSURE( nDist >= 0,
"nDist < 0." );
1541 OSL_ENSURE( pPage,
"only endnote pages remain." );
1551 SAL_INFO(
"sw.pageframe",
"RemoveSuperfluous - DestroyFrm p: " << pPage );
1577 sal_uInt16 nMaxPg(0);
1581 for(
auto pSpz: *pSpzs )
1586 const sal_uInt16 nPageNum(rAnch.
GetPageNum());
1589 nMaxPg = std::max(nMaxPg, nPageNum);
1592 neededPages.
insert(nPageNum);
1607 nullptr != pPrevPage &&
1608 neededPages.
find(nPageNum) != neededPages.
end())
1618 assert(pDesc &&
"Missing PageDesc");
1622 bWishedRightPage = !bWishedRightPage;
1625 bool const bWishedFirst(pDesc != pPrevPage->
GetPageDesc());
1632 if(
nullptr == pFirstRevivedEmptyPage)
1635 pFirstRevivedEmptyPage = pPage;
1640 if(
nullptr == pPage->
GetNext())
1683 if(
nullptr != pFirstRevivedEmptyPage)
1691#if OSL_DEBUG_LEVEL > 0
1693 while ( pPage && pPage->
GetNext() &&
1710 SAL_INFO(
"sw.pageframe",
"(AssertPageFlys in" );
1722 if ((rAnch.
GetAnchorId() == RndStdIds::FLY_AT_PAGE) &&
1731#if OSL_DEBUG_LEVEL > 1
1736 "Object couldn't be reattached!" );
1749 SAL_INFO(
"sw.pageframe",
"AssertPageFlys out)" );
1756 aFrm.
SSize(aNewSize);
1804 "CalcBrowseWidth and not in BrowseView" );
1814 pFrame =
static_cast<SwContentFrame*
>(pFrame)->GetNextContentFrame();
1834 if ( nWidth <
int(USHRT_MAX)-2000 &&
1838 static_cast<const SwTabFrame *
>(pFrame)->GetTable()
1839 ->GetHTMLTableLayout();
1849 case text::HoriOrientation::LEFT_AND_WIDTH:
1850 nWidth += rAttrs.
CalcLeft( pFrame );
1875 case RndStdIds::FLY_AS_CHAR:
1879 case RndStdIds::FLY_AT_PARA:
1893 nWidth += rHori.
GetPos();
1895 case text::HoriOrientation::INSIDE:
1896 case text::HoriOrientation::LEFT:
1925 if (
auto pCursorShell =
dynamic_cast<SwCursorShell*
>( &rSh) )
1926 pCursorShell->StartAction();
1939 if (
auto pCursorShell =
dynamic_cast<SwCursorShell*
>( &rSh) )
1941 pCursorShell->EndAction();
1942 pCursorShell->CallChgLnk();
1943 if (
auto pFEShell =
dynamic_cast<SwFEShell*
>( &rSh) )
1944 pFEShell->SetChainMarker();
1961 if ( !rSh.IsInEndAction() )
1963 OSL_ENSURE(!rSh.GetRestoreActions(),
"Restore action count is already set!");
1964 bool bCursor =
dynamic_cast<const SwCursorShell*
>( &rSh) !=
nullptr;
1965 bool bFE =
dynamic_cast<const SwFEShell*
>( &rSh) !=
nullptr;
1966 sal_uInt16 nRestore = 0;
1967 while( rSh.ActionCount() )
1974 static_cast<SwFEShell*
>(&rSh)->SetChainMarker();
1980 rSh.SetRestoreActions(nRestore);
1993 sal_uInt16 nActions = rSh.GetRestoreActions();
1996 if (
auto pCursorShell =
dynamic_cast<SwCursorShell*
>( &rSh) )
1997 pCursorShell->StartAction();
2001 rSh.SetRestoreActions(0);
2002 rSh.LockView(
false);
2013 ?
static_cast<SwPageFrame*
>(pFrame)->GetSortedObjs()
2015 if (pSortedObj ==
nullptr)
2021 for (
size_t i = 0;
i < pSortedObj->
size(); ++
i)
2029 if ( !bPage && (rAnchor.
GetAnchorId() != RndStdIds::FLY_AS_CHAR) )
2038 if (pFlyFrame->IsFlyInContentFrame())
2044 SwFrame* pLower = pFlyFrame->Lower();
2072 if ( pAnchoredDrawObj->NotYetPositioned() )
2075 const Point& aCurrAnchorPos = pAnchoredDrawObj->GetDrawObj()->GetAnchorPos();
2076 const Point aNewAnchorPos( aCurrAnchorPos + rOffset );
2077 pAnchoredDrawObj->DrawObj()->SetAnchorPos( aNewAnchorPos );
2078 pAnchoredDrawObj->SetLastObjRect( pAnchoredDrawObj->GetObjRect().SVRect() );
2081 if ( pAnchoredDrawObj->GetFrameFormat().GetSurround().IsContour() )
2098#if !ENABLE_WASM_STRIP_ACCESSIBILITY
2119 while ( pLowerFrame )
2122 pLowerFrame = pLowerFrame->
GetNext();
2150 assert(pViewOpt &&
"CheckViewLayout required ViewOptions");
2170 Calc(pRenderContext);
2201 sal_uInt16 nNumberOfPagesInRow =
mbBookMode ? 1 : 0;
2202 bool bFirstRow =
true;
2204 bool bPageChanged =
false;
2208 while ( pPageFrame )
2213 const bool bStartOfRow = pPageFrame == pStartOfRow ||
2226 nPageWidth = rFormatPage.
getFrameArea().
Width() + nSidebarWidth + ((bStartOfRow || 1 == (pPageFrame->
GetPhyPageNum()%2)) ? 0 : nGapBetweenPages);
2233 nPageWidth = pPageFrame->
getFrameArea().
Width() + nSidebarWidth + (bStartOfRow ? 0 : nGapBetweenPages);
2239 ++nNumberOfPagesInRow;
2244 bool bRowFinished = (0 ==
mnColumns && nWidthRemain < nPageWidth ) ||
2248 if ( !bRowFinished || bStartOfRow )
2251 nWidthRemain = nWidthRemain - nPageWidth;
2253 nCurrentRowWidth = nCurrentRowWidth + nPageWidth;
2254 nCurrentRowHeight = std::max( nCurrentRowHeight, nPageHeight );
2259 bRowFinished =
true;
2268 if ( !pPageFrame && nWidthRemain > 0 )
2271 const SwPageFrame* pLastPageInCurrentRow = pStartOfRow;
2272 while( pLastPageInCurrentRow->
GetNext() )
2273 pLastPageInCurrentRow =
static_cast<const SwPageFrame*
>(pLastPageInCurrentRow->
GetNext());
2276 pLastPageInCurrentRow =
static_cast<const SwPageFrame*
>(pLastPageInCurrentRow->
GetPrev());
2279 sal_uInt16 nNumberOfVirtualPages = 0;
2280 const sal_uInt16 nMaxNumberOfVirtualPages =
mnColumns > 0 ?
mnColumns - nNumberOfPagesInRow : USHRT_MAX;
2281 SwTwips nRemain = nWidthRemain;
2282 SwTwips nVirtualPagesWidth = 0;
2285 while ( (
mnColumns > 0 || nRemain > 0 ) && nNumberOfVirtualPages < nMaxNumberOfVirtualPages )
2287 SwTwips nLastPageWidthWithGap = nLastPageWidth;
2288 if ( !
mbBookMode || ( 0 == (nNumberOfVirtualPages + nNumberOfPagesInRow) %2) )
2289 nLastPageWidthWithGap += nGapBetweenPages;
2291 if (
mnColumns > 0 || nLastPageWidthWithGap < nRemain )
2293 ++nNumberOfVirtualPages;
2294 nVirtualPagesWidth += nLastPageWidthWithGap;
2296 nRemain = nRemain - nLastPageWidthWithGap;
2299 nCurrentRowWidth = nCurrentRowWidth + nVirtualPagesWidth;
2313 nSizeDiff = ( nVisWidth - nCurrentRowWidth ) / 2;
2319 const tools::Long nRowEnd = nRowStart + nCurrentRowWidth;
2339 const SwTwips nLeftPageAddOffset = bLeftSidebar ?
2344 Point aNewPagePosWithLeftOffset(
nBorder + nX + nLeftPageAddOffset,
nBorder + nSumRowHeight );
2350 aNewPagePos.
setX(nRowEnd - nXOffsetInRow - nCurrentPageWidth);
2351 aNewPagePosWithLeftOffset = aNewPagePos;
2352 aNewPagePosWithLeftOffset.
setX(aNewPagePosWithLeftOffset.
getX() + nLeftPageAddOffset);
2355 if ( aNewPagePosWithLeftOffset != aOldPagePos )
2359 bPageChanged =
true;
2364 const bool bFirstColumn = pPageToAdjust == pStartOfRow;
2365 const bool bLastColumn = pPageToAdjust->
GetNext() == pEndOfRow;
2366 const bool bLastRow = !pEndOfRow;
2369 nMaxPageRight = std::max( nMaxPageRight,
SwTwips(aNewPagePos.
getX() + nCurrentPageWidth));
2372 SwRect aPageRectWithBorders( aNewPagePos.
getX() - nGapBetweenPages,
2374 pPageToAdjust->
getFrameArea().
SSize().Width() + nGapBetweenPages + nSidebarWidth,
2375 nCurrentRowHeight );
2377 static const tools::Long nOuterClickDiff = 1000000;
2380 if ( (bFirstColumn && !bRTL) || (bLastColumn && bRTL) )
2381 aPageRectWithBorders.
SubLeft( nOuterClickDiff );
2382 if ( (bLastColumn && !bRTL) || (bFirstColumn && bRTL) )
2383 aPageRectWithBorders.
AddRight( nOuterClickDiff );
2385 aPageRectWithBorders.
SubTop( nOuterClickDiff );
2387 aPageRectWithBorders.
AddBottom( nOuterClickDiff );
2391 nX = nX + nCurrentPageWidth;
2395 if ( pPageToAdjust && pPageToAdjust != pEndOfRow )
2401 nX = nX + nGapBetweenPages;
2408 const bool bDontAddGap = ( pPageToAdjust->
IsEmptyPage() && pPageToAdjust->
GetNext() == pEndOfRow ) ||
2412 nX = nX + nGapBetweenPages;
2416 while (pPageToAdjust && pPageToAdjust != pEndOfRow);
2419 nSumRowHeight = nSumRowHeight + nCurrentRowHeight;
2422 nCurrentRowHeight = 0;
2423 nCurrentRowWidth = 0;
2424 pStartOfRow = pEndOfRow;
2425 nWidthRemain = nVisWidth;
2426 nNumberOfPagesInRow = 0;
2433 const Size aNewSize( nMaxPageRight -
nBorder, nSumRowHeight - nGapBetweenPages );
2435 if ( bPageChanged || aNewSize != aOldSize )
2439 Calc(pRenderContext);
2444 if (bOldCallbackActionEnabled)
2483 if ( pRet ==
nullptr )
2495 "<SwPageFrame::GetFormatPage()> - inconsistent layout: empty page without previous and next page frame --> crash.");
2525 if (!bHideWhitespaceMode ||
static_cast<const SwFrameFormat*
>(
GetDep())->GetHeader().IsActive())
2536 if ( aFooterArea.
Contains( rPt ) &&
2537 (!bHideWhitespaceMode ||
static_cast<const SwFrameFormat*
>(
GetDep())->GetFooter().IsActive()) )
2565 if (nWhitespace > -nDiff)
2584 pLowerFrame = pLowerFrame->
GetNext();
2596 pLowerFrame = pLowerFrame->
GetNext();
2620 (void)xmlTextWriterStartElement(writer,
reinterpret_cast<const xmlChar*
>(
"page"));
2623 (void)xmlTextWriterStartElement(writer, BAD_CAST(
"page_status"));
2624 (void)xmlTextWriterWriteAttribute(writer, BAD_CAST(
"ValidFlyLayout"), BAD_CAST(OString::boolean(!
IsInvalidFlyLayout()).getStr()));
2625 (void)xmlTextWriterWriteAttribute(writer, BAD_CAST(
"ValidFlyContent"), BAD_CAST(OString::boolean(!
IsInvalidFlyContent()).getStr()));
2626 (void)xmlTextWriterWriteAttribute(writer, BAD_CAST(
"ValidFlyInCnt"), BAD_CAST(OString::boolean(!
IsInvalidFlyInCnt()).getStr()));
2627 (void)xmlTextWriterWriteAttribute(writer, BAD_CAST(
"ValidLayout"), BAD_CAST(OString::boolean(!
IsInvalidLayout()).getStr()));
2628 (void)xmlTextWriterWriteAttribute(writer, BAD_CAST(
"ValidContent"), BAD_CAST(OString::boolean(!
IsInvalidContent()).getStr()));
2629 (void)xmlTextWriterEndElement(writer);
2630 (void)xmlTextWriterStartElement(writer, BAD_CAST(
"page_info"));
2631 (void)xmlTextWriterWriteFormatAttribute(writer, BAD_CAST(
"phyNum"),
"%d",
GetPhyPageNum());
2632 (void)xmlTextWriterWriteFormatAttribute(writer, BAD_CAST(
"virtNum"),
"%d",
GetVirtPageNum());
2634 (void)xmlTextWriterWriteFormatAttribute( writer, BAD_CAST(
"pageDesc"),
"%s", BAD_CAST(
OUStringToOString(aFormatName, RTL_TEXTENCODING_UTF8).getStr()));
2635 (void)xmlTextWriterEndElement(writer);
2638 (void)xmlTextWriterStartElement(writer, BAD_CAST(
"sorted_objs"));
2644 (void)xmlTextWriterStartElement(writer, BAD_CAST(
"fly"));
2645 (void)xmlTextWriterWriteFormatAttribute(writer, BAD_CAST(
"ptr"),
"%p", pFly);
2649 (void)xmlTextWriterStartElement(writer, BAD_CAST(pObj->getElementName()));
2650 (void)xmlTextWriterWriteFormatAttribute(writer, BAD_CAST(
"ptr"),
"%p", pObj);
2652 (void)xmlTextWriterEndElement(writer);
2654 (void)xmlTextWriterEndElement(writer);
2657 (void)xmlTextWriterStartElement(writer, BAD_CAST(
"infos"));
2659 (void)xmlTextWriterEndElement(writer);
2661 if ( pAnchored && pAnchored->
size() > 0 )
2663 (void)xmlTextWriterStartElement( writer, BAD_CAST(
"anchored" ) );
2670 (void)xmlTextWriterEndElement( writer );
2673 (void)xmlTextWriterEndElement(writer);
2678 if (pPage && pPage->
HasGrid())
virtual bool IsVisibleLayerId(SdrLayerID _nLayerId) const =0
method to determine, if a layer ID belongs to the visible ones.
virtual void UpdatePageFields(const SwTwips)=0
void setX(tools::Long nX)
constexpr tools::Long X() const
constexpr tools::Long getX() const
constexpr tools::Long getY() const
const Point & GetAnchorPos() const
virtual SdrLayerID GetLayer() const
const SfxPoolItem * GetCurItem() const
const SfxPoolItem * NextItem()
constexpr tools::Long getHeight() const
constexpr tools::Long Width() const
tools::Long GetHeight() const
tools::Long GetWidth() const
const Size & GetSize() const
class for the positioning of drawing objects
wrapper class for the positioning of Writer fly frames and drawing objects
const SwFrame * GetAnchorFrame() const
virtual SwFrameFormat & GetFrameFormat()=0
virtual const SwFlyFrame * DynCastFlyFrame() const
void InvalidateObjRectWithSpaces() const
const SdrObject * GetDrawObj() const
virtual SwRect GetObjRect() const =0
void ClearItem(sal_uInt16 nWhichL)
const SwFormatHoriOrient & GetHoriOrient(bool=true) const
Container of body content (i.e.
virtual void Format(vcl::RenderContext *pRenderContext, const SwBorderAttrs *pAttrs=nullptr) override
"Formats" the Frame; Frame and PrtArea.
SwBodyFrame(SwFrameFormat *, SwFrame *)
void dumpAsXml(xmlTextWriterPtr writer=nullptr) const override
const Size & GetSize() const
tools::Long CalcLeft(const SwFrame *pCaller) const
const SwAttrSet & GetAttrSet() const
tools::Long CalcRight(const SwFrame *pCaller) const
SwContentFrame is the layout for content nodes: a common base class for text (paragraph) and non-text...
SwContentFrame * GetNextContentFrame() const
void EndAction(const bool bIdleEnd=false)
const SwFootnoteInfo & GetFootnoteInfo() const
IDocumentFieldsAccess const & getIDocumentFieldsAccess() const
SwFootnoteIdxs & GetFootnoteIdxs()
const SwEndNoteInfo & GetEndNoteInfo() const
bool IsSquaredPageMode() const
const SwFrameFormat * GetEmptyPageFormat() const
IDocumentDrawModelAccess const & getIDocumentDrawModelAccess() const
const SwFrameFormat * GetDfltFrameFormat() const
const sw::FrameFormats< sw::SpzFrameFormat * > * GetSpzFrameFormats() const
SwDocShell * GetDocShell()
const SwPageDesc & GetPageDesc(const size_t i) const
new class for re-direct methods calls at a 'virtual' drawing object to its referenced object.
Window class for the Writer edit area, this is the one handling mouse and keyboard events and doing t...
SwFrameControlsManager & GetFrameControlsManager()
SwPageDesc * GetPageDesc(SwDoc &rDoc) const
virtual void MoveObjectIfActive(svt::EmbeddedObjectRef &xObj, const Point &rOffset)
The layout has been changed, so the active object has to be moved after that.
Flys that are anchored to content (at-para, at-char) but not in content (as-char).
general base class for all free-flowing frames
virtual const SwFlyFrame * DynCastFlyFrame() const override
Flys that are anchored as a character in the content.
Flys that are bound to layout frames (to-frame) and not to/as content.
Pagedescriptor Client of SwPageDesc that is "described" by the attribute.
SwPageDesc * GetPageDesc()
const ::std::optional< sal_uInt16 > & GetNumOffset() const
const SwRect & getFrameArea() const
bool isFrameAreaPositionValid() const
const SwRect & getFramePrintArea() const
void setFramePrintAreaValid(bool bNew)
void setFrameAreaPositionValid(bool bNew)
virtual void transform_translate(const Point &rOffset)
bool isFramePrintAreaValid() const
bool isFrameAreaSizeValid() const
void setFrameAreaSizeValid(bool bNew)
void RemoveControls(const SwFrame *pFrame)
Base class of the Writer layout elements.
bool WannaRightPage() const
Decides if the page want to be a right page or not.
bool IsFootnoteContFrame() const
void RemoveFly(SwFlyFrame *pToRemove)
virtual bool Prepare(const PrepareHint ePrep=PrepareHint::Clear, const void *pVoid=nullptr, bool bNotify=true)
void SetDerivedR2L(bool bNew)
sal_uInt16 GetVirtPageNum() const
void CheckDirChange()
checks the layout direction and invalidates the lower frames recursively, if necessary.
bool IsAccessibleFrame() const
SwTabFrame * FindTabFrame()
SwFrameType GetType() const
bool IsHeaderFrame() const
SwPageFrame * InsertPage(SwPageFrame *pSibling, bool bFootnote)
virtual void Calc(vcl::RenderContext *pRenderContext) const
const SwSortedObjs * GetDrawObjs() const
virtual void SwClientNotify(const SwModify &, const SfxHint &) override
static SwCache & GetCache()
bool IsRightToLeft() const
void InsertBefore(SwLayoutFrame *pParent, SwFrame *pBehind)
Insert SwFrame into existing structure.
void AppendFly(SwFlyFrame *pNew)
static void CheckPageDescs(SwPageFrame *pStart, bool bNotifyFields=true, SwPageFrame **ppPrev=nullptr)
Check all pages (starting from the given one) if they use the appropriate frame format.
virtual bool IsDeleteForbidden() const
void dumpInfosAsXml(xmlTextWriterPtr writer) const
bool IsFooterFrame() const
SwLayoutFrame * GetUpper()
virtual void dumpAsXmlAttributes(xmlTextWriterPtr writer) const
void InvalidatePage(const SwPageFrame *pPage=nullptr) const
Invalidates the page in which the Frame is currently placed.
SwRootFrame * getRootFrame()
bool IsNoTextFrame() const
void SetCompletePaint() const
SwContentFrame * FindNextCnt(const bool _bInSameFootnote=false)
SwPageFrame * FindPageFrame()
sw::BroadcastingModify * GetDep()
use these so we can grep for SwFrame's GetRegisteredIn accesses beware that SwTextFrame may return sw...
void AppendDrawObj(SwAnchoredObject &_rNewObj)
SwFrame * FindFooterOrHeader()
virtual const SwFormatPageDesc & GetPageDescItem() const
virtual Size ChgSize(const Size &aNewSize)
static void DestroyFrame(SwFrame *const pFrame)
this is the only way to delete a SwFrame instance
void dumpChildrenAsXml(xmlTextWriterPtr writer) const
void SetDerivedVert(bool bNew)
bool IsLayoutFrame() const
tools::Long GetBrowseWidthMin() const
void SetCheckPageNumDirect(sal_uInt16 nNew)
void SetCheckPageNum(sal_uInt16 nNew)
void SetAgain(bool bAgain)
sal_uInt16 GetCheckPageNum() const
bool IsCheckPages() const
A layout frame is a frame that contains other frames (m_pLower), e.g. SwPageFrame or SwTabFrame.
void SetFrameFormat(SwFrameFormat *)
bool IsAnLower(const SwFrame *) const
bool ContainsDeleteForbiddenLayFrame() const
virtual const SwFrameFormat * GetFormat() const
virtual void DestroyImpl() override
virtual void Paste(SwFrame *pParent, SwFrame *pSibling=nullptr) override
const SwContentFrame * ContainsContent() const
Checks if the frame contains one or more ContentFrame's anywhere in his subsidiary structure; if so t...
void ChgColumns(const SwFormatCol &rOld, const SwFormatCol &rNew, const bool bChgFootnote=false)
add or remove columns from a layoutframe.
const SwFrame * Lower() const
const SwContentNode * GetNode() const
SwOLENode * GetOLENode()
Inline methods from Node.hxx.
const SwOLEObj & GetOLEObj() const
svt::EmbeddedObjectRef & GetObject()
Helper class for notify that positioning of an anchored object is in progress.
const OUString & GetName() const
SwFrameFormat & GetMaster()
SwFrameFormat * GetRightFormat(bool const bFirst=false)
Layout uses the following methods to obtain a format in order to be able to create a page.
const SwPageDesc * GetFollow() const
const SwPageFootnoteInfo & GetFootnoteInfo() const
SwFrameFormat * GetLeftFormat(bool const bFirst=false)
A page of the document layout.
void SetPageDesc(SwPageDesc *, SwFrameFormat *)
void PrepareRegisterChg()
virtual void SwClientNotify(const SwModify &, const SfxHint &) override
virtual bool GetInfo(SfxPoolItem &) const override
Get info from Client.
void SetPhyPageNum(sal_uInt16 nNum)
bool IsOverHeaderFooterArea(const Point &rPt, FrameControlType &rControl) const
If in header or footer area, it also indicates the exact area in rControl.
bool IsEndNotePage() const
void PrepareFooter()
Creates or removes footer.
void PreparePage(bool bFootnote)
Always call after Paste Creates the page-bound frames and formats the generic content.
sal_uInt16 GetPhyPageNum() const
static void GetBorderAndShadowBoundRect(const SwRect &_rPageRect, const SwViewShell *_pViewShell, OutputDevice const *pRenderContext, SwRect &_orBorderAndShadowBoundRect, const bool bLeftShadow, const bool bRightShadow, const bool bRightSidebar)
get bound rectangle of border and shadow for repaints
const SwPageFrame & GetFormatPage() const
bool IsInvalidFlyContent() const
virtual ~SwPageFrame() override
const SwSortedObjs * GetSortedObjs() const
bool IsInvalidFlyLayout() const
bool m_bInvalidAutoCmplWrds
bool IsLeftShadowNeeded() const
SwContentFrame * FindFirstBodyContent()
sal_uInt16 m_nPhyPageNum
Physical page number: index into list of SwRootFrame lowers.
bool m_bInvalidFlyContent
void SetColMaxFootnoteHeight()
Adapt the max. footnote height in each single column.
sw::sidebarwindows::SidebarPosition SidebarPosition() const
asks the page on which side a margin should be shown, e.g for notes returns true for left side,...
void MoveFly(SwFlyFrame *pToMove, SwPageFrame *pDest)
virtual void DestroyImpl() override
void InvalidateLayout() const
virtual void Paste(SwFrame *pParent, SwFrame *pSibling=nullptr) override
SwPageDesc * FindPageDesc()
const SwFooterFrame * GetFooterFrame() const
bool IsFootnotePage() const
Foot note interface.
void PrepareHeader()
Make this public, so that the SwViewShell can access it when switching from browse mode Add/remove he...
bool IsInvalidContent() const
bool CheckPageHeightValidForHideWhitespace(SwTwips nDiff)
Is bottom-of-page-frame - bottom-of-text-frame difference valid in case whitespace is hidden?...
void UpdateAttr_(const SfxPoolItem *, const SfxPoolItem *, SwPageFrameInvFlags &, SwAttrSetChg *pa=nullptr, SwAttrSetChg *pb=nullptr)
const SwHeaderFrame * GetHeaderFrame() const
void dumpAsXml(xmlTextWriterPtr writer=nullptr) const override
virtual void CheckDirection(bool bVert) override
SwPageDesc * GetPageDesc()
void SetFootnotePage(bool b)
static SwTwips GetSidebarBorderWidth(const SwViewShell *)
void CheckGrid(bool bInvalidate)
std::unique_ptr< SwSortedObjs > m_pSortedObjs
bool IsInvalidFlyInCnt() const
virtual void Cut() override
bool IsRightShadowNeeded() const
bool IsInvalidLayout() const
bool UpdateVirtPageNumInfo(SwVirtPageNumInfo &rHint, const SwFrame *pFrame) const
tools::Long GetHeight(const SwRect &rRect) const
void SetWidth(SwRect &rRect, tools::Long nNew) const
void SetPosX(SwRect &rRect, tools::Long nNew) const
tools::Long GetWidth(const SwRect &rRect) const
void SetHeight(SwRect &rRect, tools::Long nNew) const
void SetPosY(SwRect &rRect, tools::Long nNew) const
Of course Writer needs its own rectangles.
void SubLeft(const tools::Long nSub)
void SubTop(const tools::Long nSub)
void Height(tools::Long nNew)
void Top(const tools::Long nTop)
void Right(const tools::Long nRight)
void Bottom(const tools::Long nBottom)
void Pos(const Point &rNew)
void SSize(const Size &rNew)
bool Contains(const Point &rPOINT) const
void AddBottom(const tools::Long nAdd)
void AddRight(const tools::Long nAdd)
void AddHeight(const tools::Long nAdd)
void Left(const tools::Long nLeft)
void Left_(const tools::Long nLeft)
void Width(tools::Long nNew)
The root element of a Writer document layout.
bool IsAssertFlyPages() const
bool IsLeftToRightViewLayout() const
void SetVirtPageNum(const bool bOf) const
virtual Size ChgSize(const Size &aNewSize) override
bool IsSuperfluous() const
void StartAllAction()
Set up Start-/EndAction for all Shells on an as high as possible (Shell section) level.
friend void AdjustSizeChgNotify(SwRootFrame *pRoot)
SwViewShell * GetCurrShell() const
static constexpr sal_Int64 MIN_BROWSE_WIDTH
Width of the HTML / Web document if not defined otherwise: 20cm.
void ImplInvalidateBrowseWidth()
void UnoRestoreAllActions()
static void AssertPageFlys(SwPageFrame *)
Makes sure that, starting from the passed Page, all page-bound Frames are on the right Page (pagenumb...
virtual SwTwips GrowFrame(SwTwips, bool bTst=false, bool bInfo=false) override
void CheckViewLayout(const SwViewOption *pViewOpt, const SwRect *pVisArea)
bool IsAnyShellAccessible() const
std::vector< SwRect > maPageRects
static void RemoveMasterObjs(SdrPage *pPg)
Remove MasterObjects from the Page (called by the ctors)
void RemoveSuperfluous()
remove pages that are not needed at all
bool IsCallbackActionEnabled() const
void UnoRemoveAllActions()
Certain UNO Actions (e.g.
const SwPageFrame * GetLastPage() const
SdrPage * mpDrawPage
One Page per DrawModel per Document; is always the size of the Root.
void RemovePage(SwPageFrame **pDel, SwRemoveResult eResult)
tools::Long mnBrowseWidth
For BrowseMode mnBrowseWidth is the outer margin of the object most to the right.
void RemoveFootnotes(SwPageFrame *pPage=nullptr, bool bPageOnly=false, bool bEndNotes=false)
Remove all footnotes (but no references)
void SetCallbackActionEnabled(bool b)
void SetAssertFlyPages()
Makes sure that all requested page-bound Flys find a Page.
virtual SwTwips ShrinkFrame(SwTwips, bool bTst=false, bool bInfo=false) override
void AssertFlyPages()
Ensures that enough pages exist, so that all page bound frames and draw objects can be placed.
virtual void MakeAll(vcl::RenderContext *pRenderContext) override
void ImplCalcBrowseWidth()
class for collecting anchored objects
SwTabFrame is one table in the document layout, containing rows (which contain cells).
Represents the visualization of a paragraph.
sal_uInt16 GetBaseHeight() const
sal_uInt16 GetBaseWidth() const
sal_uInt16 GetRubyHeight() const
SwTextGrid GetGridType() const
sal_Int32 GetLines() const
bool IsHideWhitespaceMode() const
sal_uInt16 GetGapBetweenPages() const
bool IsViewLayoutBookMode() const
static constexpr sal_uInt16 defGapBetweenPages
sal_uInt16 GetViewLayoutColumns() const
bool getBrowseMode() const
bool IsWhitespaceHidden() const
void CheckWaitCursor()
If an Action is running we ask it to check whether it's time to enable the WaitCursor.
void SetFirstVisPageInvalid()
bool IsAction() const
SS for the Lay-/IdleAction and relatives.
SwLayAction & GetLayAction()
void MoveAccessibleFrame(const SwFrame *pFrame, const SwRect &rOldFrame)
vcl::RenderContext * GetOut() const
const SwViewOption * GetViewOptions() const
bool AddPaintRect(const SwRect &rRect)
vcl::Window * GetWin() const
const SwRect & VisArea() const
void InvalidateWindows(const SwRect &rRect)
const Size & GetBrowseBorder() const
void SetFirstVisPageInvalid()
void SetInfo(const SwPageFrame *pPg, const SwFrame *pF)
const SwPageFrame * GetOrigPage() const
const SwPageFrame * GetPage() const
Used by the UI to modify the document model.
const SwView & GetView() const
void reserve(size_type amount)
const_iterator find(const Value &x) const
const_iterator end() const
std::pair< const_iterator, bool > insert(Value &&x)
ring_container GetRingContainer()
struct _xmlTextWriter * xmlTextWriterPtr
EmbeddedObjectRef * pObject
constexpr TypedWhichId< SvxFrameDirectionItem > RES_FRAMEDIR(126)
constexpr TypedWhichId< SwFormatHeader > RES_HEADER(102)
constexpr TypedWhichId< SwFormatFrameSize > RES_FRM_SIZE(89)
constexpr TypedWhichId< SwFormatCol > RES_COL(115)
constexpr TypedWhichId< SwTextGridItem > RES_TEXTGRID(121)
constexpr TypedWhichId< SwAttrSetChg > RES_ATTRSET_CHG(169)
constexpr TypedWhichId< SwFormatFooter > RES_FOOTER(103)
constexpr TypedWhichId< SwDrawFrameFormat > RES_DRAWFRMFMT(165)
constexpr TypedWhichId< SwAutoFormatGetDocNode > RES_AUTOFMT_DOCNODE(176)
constexpr TypedWhichId< SwFormatChg > RES_FMT_CHG(168)
#define SAL_INFO(area, stream)
tools::Long const nBorder
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
Dialog to specify the properties of date form field.
bool IsRightPageByNumber(SwRootFrame const &rLayout, sal_uInt16 nPageNum)
bool IsPageFrameEmpty(SwPageFrame const &rPage)
check if there's content on the page that requires it to exist
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
static void lcl_MoveAllLowers(SwFrame *pFrame, const Point &rOffset)
static void lcl_MakeObjs(const sw::FrameFormats< sw::SpzFrameFormat * > &rSpzs, SwPageFrame *pPage)
Create Flys or register draw objects.
sal_uInt16 GetGridWidth(SwTextGridItem const &rG, SwDoc const &rDoc)
void AdjustSizeChgNotify(SwRootFrame *pRoot)
static void lcl_PrepFlyInCntRegister(SwContentFrame *pFrame)
static void lcl_FormatLay(SwLayoutFrame *pLay)
create specific Flys for this page and format generic content
SwTextGridItem const * GetGridItem(SwPageFrame const *const pPage)
void SetLastPage(SwPageFrame *pPage)
static void lcl_MoveAllLowerObjs(SwFrame *pFrame, const Point &rOffset)
constexpr SwTwips DOCUMENTBORDER
void ClrContourCache(const SdrObject *pObj)