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();
216 aFrm.
Width ( nWidth );
233 Calc(pRenderContext);
236 pBodyFrame->
Paste(
this );
237 pBodyFrame->
Calc(pRenderContext);
282 pAnchoredObj->SetPageFrame(
nullptr );
341 if( SvxFrameDirection::Horizontal_LR_TB == nDir || SvxFrameDirection::Horizontal_RL_TB == nDir )
358 if(SvxFrameDirection::Vertical_RL_TB == nDir)
360 else if(SvxFrameDirection::Vertical_LR_TB==nDir)
369 if( SvxFrameDirection::Horizontal_RL_TB == nDir )
390 if ( pTmp->
GetType() & nTypes )
394 pLay->
Calc(pRenderContext);
402 for (
size_t i = 0;
i < rTable.
size(); ++
i )
423 if ( bSdrObj &&
nullptr == (pSdrObj = pFormat->
FindSdrObject()) )
425 OSL_FAIL(
"DrawObject not found." );
441 if (
auto pDrawVirtObj =
dynamic_cast<SwDrawVirtObj *
>( pSdrObj ) )
445 pDrawVirtObj->RemoveFromWriterLayout();
446 pDrawVirtObj->RemoveFromDrawingPage();
520 else if (rHint.
GetId() == SfxHintId::SwLegacyModify)
524 pSh->SetFirstVisPageInvalid();
529 auto& rOldSetChg = *
static_cast<const SwAttrSetChg*
>(pLegacy->m_pOld);
530 auto& rNewSetChg = *
static_cast<const SwAttrSetChg*
>(pLegacy->m_pNew);
539 UpdateAttr_(pOItem, pNItem, eInvFlags, &aOldSet, &aNewSet);
547 UpdateAttr_(pLegacy->m_pOld, pLegacy->m_pNew, eInvFlags);
574 const sal_uInt16 nWhich = pOld ? pOld->
Which() : pNew ? pNew->
Which() : 0;
593 Calc(pRenderContext);
596 pBodyFrame->
Paste(
this);
603 assert(pOld && pNew);
606 assert(pOldFormat && pNewFormat);
609 if( rOldCol != rNewCol )
612 assert(pB &&
"Page without Body.");
652 static_cast<const SwFormatChg*
>(pNew)->pChangedFormat->GetFrameSize() :
672 SwRect aOldRectWithBorderAndShadow;
684 assert(pOld && pNew);
714 if ( pOldSet || pNewSet )
789 if ( pFlow && pFlow->
IsInTab() )
795 SwFlowFrame *pTmp = SwFlowFrame::CastFlowFrame( pFlow );
796 if ( !pTmp->IsFollow() )
817 OSL_ENSURE( pRet,
"could not find page descriptor." );
830 if( pRoot == rSh.GetLayout() )
867 if ( pAnchPage && (pAnchPage !=
this) )
870 pFly->InvalidateSize();
871 pFly->InvalidatePos_();
880 if ( pSh && pSh->
GetWin() )
904 static_cast<SwRootFrame*
>(pRootFrame)->CheckViewLayout(
nullptr,
nullptr );
909 OSL_ENSURE( pParent->
IsRootFrame(),
"Parent is no Root." );
910 OSL_ENSURE( pParent,
"No parent for Paste()." );
911 OSL_ENSURE( pParent !=
this,
"I'm my own parent." );
912 OSL_ENSURE( pSibling !=
this,
"I'm my own neighbour." );
914 "I am still registered somewhere." );
988 if (
auto pFly = pAnchoredObj->DynCastFlyFrame() )
990 pFrame = pFly->ContainsContent();
1005 bool bExistEssentialObjs = (
nullptr != rPage.
GetSortedObjs());
1006 if (bExistEssentialObjs)
1012 bool bOnlySuperfluousObjs =
true;
1014 for (
size_t i = 0; bOnlySuperfluousObjs &&
i < rObjs.
size(); ++
i)
1023 bOnlySuperfluousObjs =
false;
1026 bExistEssentialObjs = !bOnlySuperfluousObjs;
1031 if ( bExistEssentialObjs ||
1069 assert(pStart &&
"no starting page.");
1077 SAL_INFO(
"sw.pageframe",
"CheckPageDescs out fast - via SetCheckPageNum: "
1109 if ( bIsOdd != bWantOdd ||
1112 ( !bIsEmpty || pFormatWish )
1133 if ( bIsEmpty && ( pFormatWish ||
1134 ( !bWantOdd && !pPrevPage ) ) )
1149 if ( !pNextFormatWish )
1151 if ( pNextFormatWish && pNextPage->
GetFormat() == pNextFormatWish )
1154 <<
" c: 1+3 - skip next page of p: " << pPage );
1164 bool bUpdatePrev =
false;
1165 if (ppPrev && *ppPrev == pPage)
1168 <<
" c: 1 - destroy p: " << pPage );
1170 if ( pStart == pPage )
1174 *ppPrev = pNextPage;
1177 else if ( bIsEmpty && !pFormatWish &&
1181 <<
" c: 2 - set desc p: " << pPage <<
" d: " << pDesc );
1184 else if ( !bIsEmpty &&
1185 bIsOdd != bWantOdd &&
1186 ( ( !pPrevPage && !bWantOdd ) ||
1195 <<
" c: 3 - insert empty p: " << pTmp <<
" d: " << pDesc );
1196 pTmp->
Paste( pRoot, pPage );
1199 isPageFrameEmpty =
false;
1206 <<
" c: 4 - set desc + format p: " << pPage
1207 <<
" d: " << pDesc <<
" f: " << pFormatWish );
1219 else if ( pFormatWish && pPage->
GetFormat() != pFormatWish )
1223 <<
" c: 5 - set format p: " << pPage <<
" f: " << pFormatWish );
1225 else if ( !pFormatWish )
1229 if ( pFormatWish && pPage->
GetFormat() != pFormatWish )
1233 <<
" c: 6 - set format p: " << pPage <<
" f: " << pFormatWish );
1236#if OSL_DEBUG_LEVEL > 0
1239 OSL_FAIL(
"CheckPageDescs, missing solution" );
1243 assert(!bIsEmpty || !isPageFrameEmpty);
1244 const bool bWantRemovePage = bIsEmpty || isPageFrameEmpty;
1255 if (isPageFrameEmpty && pPage->
GetPrev())
1260 bool bUpdatePrev =
false;
1261 if (ppPrev && *ppPrev == pPage)
1264 SAL_INFO(
"sw.pageframe",
"CheckPageDescs - handle bIsEmpty - destroy p: " << pPage );
1265 if ( pStart == pPage )
1284#if OSL_DEBUG_LEVEL > 0
1286 bool bEmpty =
false;
1294 OSL_FAIL(
"double empty pages." );
1305 SAL_INFO(
"sw.pageframe",
"CheckPageDescs out)" );
1315 const SwFrame* pBodyContent = pBody ? pBody->
Lower() :
nullptr;
1328 SAL_INFO(
"sw.pageframe",
"doInsertPage p: " << pPage
1329 <<
" d: " << pDesc <<
" f: " << pFormat );
1332 SAL_INFO(
"sw.pageframe",
"doInsertPage - insert empty p: "
1333 << pPage <<
" d: " << pDesc );
1334 pPage->
Paste( pRoot, pSibling );
1343 pPrevPage->InvalidateSize();
1356 if (!pRefPage || !isDeleteForbidden(pSibling))
1374 bool bWishedRightPage = bNextRightPage;
1379 if (
IsFlowFrame() && !SwFlowFrame::CastFlowFrame(
this )->IsFollow() )
1385 ::std::optional<sal_uInt16> oNumOffset = rDesc.
GetNumOffset();
1394 assert(pDesc &&
"Missing PageDesc");
1396 bWishedRightPage = !bWishedRightPage;
1397 bool const bWishedFirst = pDesc != pPrevPage->
GetPageDesc();
1400 bool bCheckPages =
false;
1402 if (bWishedRightPage != bNextRightPage)
1413 if( doInsertPage( pRoot, &pSibling, pFormat, pDesc,
bFootnote, &pPage ) )
1430 SAL_INFO(
"sw.pageframe",
"InsertPage - SetCheckPageNumDirect: "
1463 return bRightSidebar
1482 OSL_ENSURE( nDist >= 0,
"nDist < 0." );
1529 OSL_ENSURE( pPage,
"only endnote pages remain." );
1539 SAL_INFO(
"sw.pageframe",
"RemoveSuperfluous - DestroyFrm p: " << pPage );
1565 sal_uInt16 nMaxPg(0);
1569 for (
size_t i = 0;
i < pTable->
size(); ++
i )
1574 const sal_uInt16 nPageNum(rAnch.
GetPageNum());
1577 nMaxPg = std::max(nMaxPg, nPageNum);
1580 neededPages.
insert(nPageNum);
1595 nullptr != pPrevPage &&
1596 neededPages.
find(nPageNum) != neededPages.
end())
1606 assert(pDesc &&
"Missing PageDesc");
1610 bWishedRightPage = !bWishedRightPage;
1613 bool const bWishedFirst(pDesc != pPrevPage->
GetPageDesc());
1620 if(
nullptr == pFirstRevivedEmptyPage)
1623 pFirstRevivedEmptyPage = pPage;
1628 if(
nullptr == pPage->
GetNext())
1671 if(
nullptr != pFirstRevivedEmptyPage)
1679#if OSL_DEBUG_LEVEL > 0
1681 while ( pPage && pPage->
GetNext() &&
1698 SAL_INFO(
"sw.pageframe",
"(AssertPageFlys in" );
1710 if ((rAnch.
GetAnchorId() == RndStdIds::FLY_AT_PAGE) &&
1719#if OSL_DEBUG_LEVEL > 1
1724 "Object couldn't be reattached!" );
1737 SAL_INFO(
"sw.pageframe",
"AssertPageFlys out)" );
1744 aFrm.
SSize(aNewSize);
1792 "CalcBrowseWidth and not in BrowseView" );
1802 pFrame =
static_cast<SwContentFrame*
>(pFrame)->GetNextContentFrame();
1822 if ( nWidth <
int(USHRT_MAX)-2000 &&
1826 static_cast<const SwTabFrame *
>(pFrame)->GetTable()
1827 ->GetHTMLTableLayout();
1837 case text::HoriOrientation::LEFT_AND_WIDTH:
1838 nWidth += rAttrs.
CalcLeft( pFrame );
1863 case RndStdIds::FLY_AS_CHAR:
1867 case RndStdIds::FLY_AT_PARA:
1881 nWidth += rHori.
GetPos();
1883 case text::HoriOrientation::INSIDE:
1884 case text::HoriOrientation::LEFT:
1913 if (
auto pCursorShell =
dynamic_cast<SwCursorShell*
>( &rSh) )
1914 pCursorShell->StartAction();
1927 const bool bOldEndActionByVirDev = rSh.IsEndActionByVirDev();
1928 rSh.SetEndActionByVirDev( bVirDev );
1929 if (
auto pCursorShell =
dynamic_cast<SwCursorShell*
>( &rSh) )
1931 pCursorShell->EndAction();
1932 pCursorShell->CallChgLnk();
1933 if (
auto pFEShell =
dynamic_cast<SwFEShell*
>( &rSh) )
1934 pFEShell->SetChainMarker();
1938 rSh.SetEndActionByVirDev( bOldEndActionByVirDev );
1952 if ( !rSh.IsInEndAction() )
1954 OSL_ENSURE(!rSh.GetRestoreActions(),
"Restore action count is already set!");
1955 bool bCursor =
dynamic_cast<const SwCursorShell*
>( &rSh) !=
nullptr;
1956 bool bFE =
dynamic_cast<const SwFEShell*
>( &rSh) !=
nullptr;
1957 sal_uInt16 nRestore = 0;
1958 while( rSh.ActionCount() )
1965 static_cast<SwFEShell*
>(&rSh)->SetChainMarker();
1971 rSh.SetRestoreActions(nRestore);
1984 sal_uInt16 nActions = rSh.GetRestoreActions();
1987 if (
auto pCursorShell =
dynamic_cast<SwCursorShell*
>( &rSh) )
1988 pCursorShell->StartAction();
1992 rSh.SetRestoreActions(0);
1993 rSh.LockView(
false);
2004 ?
static_cast<SwPageFrame*
>(pFrame)->GetSortedObjs()
2006 if (pSortedObj ==
nullptr)
2012 for (
size_t i = 0;
i < pSortedObj->
size(); ++
i)
2020 if ( !bPage && (rAnchor.
GetAnchorId() != RndStdIds::FLY_AS_CHAR) )
2029 if (pFlyFrame->IsFlyInContentFrame())
2035 SwFrame* pLower = pFlyFrame->Lower();
2063 if ( pAnchoredDrawObj->NotYetPositioned() )
2066 const Point& aCurrAnchorPos = pAnchoredDrawObj->GetDrawObj()->GetAnchorPos();
2067 const Point aNewAnchorPos( aCurrAnchorPos + rOffset );
2068 pAnchoredDrawObj->DrawObj()->SetAnchorPos( aNewAnchorPos );
2069 pAnchoredDrawObj->SetLastObjRect( pAnchoredDrawObj->GetObjRect().SVRect() );
2072 if ( pAnchoredDrawObj->GetFrameFormat().GetSurround().IsContour() )
2089#if !ENABLE_WASM_STRIP_ACCESSIBILITY
2110 while ( pLowerFrame )
2113 pLowerFrame = pLowerFrame->
GetNext();
2141 assert(pViewOpt &&
"CheckViewLayout required ViewOptions");
2161 Calc(pRenderContext);
2192 sal_uInt16 nNumberOfPagesInRow =
mbBookMode ? 1 : 0;
2193 bool bFirstRow =
true;
2195 bool bPageChanged =
false;
2199 while ( pPageFrame )
2204 const bool bStartOfRow = pPageFrame == pStartOfRow ||
2217 nPageWidth = rFormatPage.
getFrameArea().
Width() + nSidebarWidth + ((bStartOfRow || 1 == (pPageFrame->
GetPhyPageNum()%2)) ? 0 : nGapBetweenPages);
2224 nPageWidth = pPageFrame->
getFrameArea().
Width() + nSidebarWidth + (bStartOfRow ? 0 : nGapBetweenPages);
2230 ++nNumberOfPagesInRow;
2235 bool bRowFinished = (0 ==
mnColumns && nWidthRemain < nPageWidth ) ||
2239 if ( !bRowFinished || bStartOfRow )
2242 nWidthRemain = nWidthRemain - nPageWidth;
2244 nCurrentRowWidth = nCurrentRowWidth + nPageWidth;
2245 nCurrentRowHeight = std::max( nCurrentRowHeight, nPageHeight );
2250 bRowFinished =
true;
2259 if ( !pPageFrame && nWidthRemain > 0 )
2262 const SwPageFrame* pLastPageInCurrentRow = pStartOfRow;
2263 while( pLastPageInCurrentRow->
GetNext() )
2264 pLastPageInCurrentRow =
static_cast<const SwPageFrame*
>(pLastPageInCurrentRow->
GetNext());
2267 pLastPageInCurrentRow =
static_cast<const SwPageFrame*
>(pLastPageInCurrentRow->
GetPrev());
2270 sal_uInt16 nNumberOfVirtualPages = 0;
2271 const sal_uInt16 nMaxNumberOfVirtualPages =
mnColumns > 0 ?
mnColumns - nNumberOfPagesInRow : USHRT_MAX;
2272 SwTwips nRemain = nWidthRemain;
2273 SwTwips nVirtualPagesWidth = 0;
2276 while ( (
mnColumns > 0 || nRemain > 0 ) && nNumberOfVirtualPages < nMaxNumberOfVirtualPages )
2278 SwTwips nLastPageWidthWithGap = nLastPageWidth;
2279 if ( !
mbBookMode || ( 0 == (nNumberOfVirtualPages + nNumberOfPagesInRow) %2) )
2280 nLastPageWidthWithGap += nGapBetweenPages;
2282 if (
mnColumns > 0 || nLastPageWidthWithGap < nRemain )
2284 ++nNumberOfVirtualPages;
2285 nVirtualPagesWidth += nLastPageWidthWithGap;
2287 nRemain = nRemain - nLastPageWidthWithGap;
2290 nCurrentRowWidth = nCurrentRowWidth + nVirtualPagesWidth;
2304 nSizeDiff = ( nVisWidth - nCurrentRowWidth ) / 2;
2310 const tools::Long nRowEnd = nRowStart + nCurrentRowWidth;
2330 const SwTwips nLeftPageAddOffset = bLeftSidebar ?
2335 Point aNewPagePosWithLeftOffset(
nBorder + nX + nLeftPageAddOffset,
nBorder + nSumRowHeight );
2340 const tools::Long nXOffsetInRow = aNewPagePos.getX() - nRowStart;
2341 aNewPagePos.setX(nRowEnd - nXOffsetInRow - nCurrentPageWidth);
2342 aNewPagePosWithLeftOffset = aNewPagePos;
2343 aNewPagePosWithLeftOffset.setX(aNewPagePosWithLeftOffset.getX() + nLeftPageAddOffset);
2346 if ( aNewPagePosWithLeftOffset != aOldPagePos )
2350 bPageChanged =
true;
2355 const bool bFirstColumn = pPageToAdjust == pStartOfRow;
2356 const bool bLastColumn = pPageToAdjust->
GetNext() == pEndOfRow;
2357 const bool bLastRow = !pEndOfRow;
2360 nMaxPageRight = std::max( nMaxPageRight,
SwTwips(aNewPagePos.getX() + nCurrentPageWidth));
2363 SwRect aPageRectWithBorders( aNewPagePos.getX() - nGapBetweenPages,
2365 pPageToAdjust->
getFrameArea().
SSize().Width() + nGapBetweenPages + nSidebarWidth,
2366 nCurrentRowHeight );
2368 static const tools::Long nOuterClickDiff = 1000000;
2371 if ( (bFirstColumn && !bRTL) || (bLastColumn && bRTL) )
2372 aPageRectWithBorders.
SubLeft( nOuterClickDiff );
2373 if ( (bLastColumn && !bRTL) || (bFirstColumn && bRTL) )
2374 aPageRectWithBorders.
AddRight( nOuterClickDiff );
2376 aPageRectWithBorders.
SubTop( nOuterClickDiff );
2378 aPageRectWithBorders.
AddBottom( nOuterClickDiff );
2382 nX = nX + nCurrentPageWidth;
2386 if ( pPageToAdjust && pPageToAdjust != pEndOfRow )
2392 nX = nX + nGapBetweenPages;
2399 const bool bDontAddGap = ( pPageToAdjust->
IsEmptyPage() && pPageToAdjust->
GetNext() == pEndOfRow ) ||
2403 nX = nX + nGapBetweenPages;
2407 while (pPageToAdjust && pPageToAdjust != pEndOfRow);
2410 nSumRowHeight = nSumRowHeight + nCurrentRowHeight;
2413 nCurrentRowHeight = 0;
2414 nCurrentRowWidth = 0;
2415 pStartOfRow = pEndOfRow;
2416 nWidthRemain = nVisWidth;
2417 nNumberOfPagesInRow = 0;
2424 const Size aNewSize( nMaxPageRight -
nBorder, nSumRowHeight - nGapBetweenPages );
2426 if ( bPageChanged || aNewSize != aOldSize )
2430 Calc(pRenderContext);
2435 if (bOldCallbackActionEnabled)
2474 if ( pRet ==
nullptr )
2486 "<SwPageFrame::GetFormatPage()> - inconsistent layout: empty page without previous and next page frame --> crash.");
2516 if (!bHideWhitespaceMode ||
static_cast<const SwFrameFormat*
>(
GetDep())->GetHeader().IsActive())
2527 if ( aFooterArea.
Contains( rPt ) &&
2528 (!bHideWhitespaceMode ||
static_cast<const SwFrameFormat*
>(
GetDep())->GetFooter().IsActive()) )
2556 if (nWhitespace > -nDiff)
2575 pLowerFrame = pLowerFrame->
GetNext();
2587 pLowerFrame = pLowerFrame->
GetNext();
2594 (void)xmlTextWriterStartElement(writer,
reinterpret_cast<const xmlChar*
>(
"page"));
2597 (void)xmlTextWriterStartElement(writer, BAD_CAST(
"page_status"));
2598 (void)xmlTextWriterWriteAttribute(writer, BAD_CAST(
"ValidFlyLayout"), BAD_CAST(OString::boolean(!
IsInvalidFlyLayout()).getStr()));
2599 (void)xmlTextWriterWriteAttribute(writer, BAD_CAST(
"ValidFlyContent"), BAD_CAST(OString::boolean(!
IsInvalidFlyContent()).getStr()));
2600 (void)xmlTextWriterWriteAttribute(writer, BAD_CAST(
"ValidFlyInCnt"), BAD_CAST(OString::boolean(!
IsInvalidFlyInCnt()).getStr()));
2601 (void)xmlTextWriterWriteAttribute(writer, BAD_CAST(
"ValidLayout"), BAD_CAST(OString::boolean(!
IsInvalidLayout()).getStr()));
2602 (void)xmlTextWriterWriteAttribute(writer, BAD_CAST(
"ValidContent"), BAD_CAST(OString::boolean(!
IsInvalidContent()).getStr()));
2603 (void)xmlTextWriterEndElement(writer);
2604 (void)xmlTextWriterStartElement(writer, BAD_CAST(
"page_info"));
2605 (void)xmlTextWriterWriteFormatAttribute(writer, BAD_CAST(
"phyNum"),
"%d",
GetPhyPageNum());
2606 (void)xmlTextWriterWriteFormatAttribute(writer, BAD_CAST(
"virtNum"),
"%d",
GetVirtPageNum());
2608 (void)xmlTextWriterWriteFormatAttribute( writer, BAD_CAST(
"pageDesc"),
"%s", BAD_CAST(
OUStringToOString(aFormatName, RTL_TEXTENCODING_UTF8).getStr()));
2609 (void)xmlTextWriterEndElement(writer);
2612 (void)xmlTextWriterStartElement(writer, BAD_CAST(
"sorted_objs"));
2618 (void)xmlTextWriterStartElement(writer, BAD_CAST(
"fly"));
2619 (void)xmlTextWriterWriteFormatAttribute(writer, BAD_CAST(
"ptr"),
"%p", pFly);
2623 (void)xmlTextWriterStartElement(writer, BAD_CAST(pObj->getElementName()));
2624 (void)xmlTextWriterWriteFormatAttribute(writer, BAD_CAST(
"ptr"),
"%p", pObj);
2626 (void)xmlTextWriterEndElement(writer);
2628 (void)xmlTextWriterEndElement(writer);
2631 (void)xmlTextWriterStartElement(writer, BAD_CAST(
"infos"));
2633 (void)xmlTextWriterEndElement(writer);
2635 if ( pAnchored && pAnchored->
size() > 0 )
2637 (void)xmlTextWriterStartElement( writer, BAD_CAST(
"anchored" ) );
2644 (void)xmlTextWriterEndElement( writer );
2647 (void)xmlTextWriterEndElement(writer);
2652 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
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 *)
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
void DelFrameFormat(SwFrameFormat *pFormat, bool bBroadcast=false)
IDocumentDrawModelAccess const & getIDocumentDrawModelAccess() const
const SwFrameFormat * GetDfltFrameFormat() const
const SwFrameFormats * 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.
general base class for all free-flowing frames
virtual const SwFlyFrame * DynCastFlyFrame() const override
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
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 EndAllAction(bool bVirDev=false)
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
sal_uInt16 GetLines() const
SwTextGrid GetGridType() 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()
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)
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)
static void lcl_MakeObjs(const SwFrameFormats &rTable, SwPageFrame *pPage)
Create Flys or register draw objects.
constexpr SwTwips DOCUMENTBORDER
void ClrContourCache(const SdrObject *pObj)