55#include <osl/diagnose.h>
58 bool lcl_GetModelPositionForViewPoint_Objects(
const SwPageFrame* pPageFrame,
bool bSearchBackground,
62 Point aPoint( rPoint );
72 bool bInBackground = ( rSurround.
GetSurround() == css::text::WrapTextMode_THROUGH ) && !rOpaque.GetValue();
74 bool bBackgroundMatches = bInBackground == bSearchBackground;
77 if ( pFly && bBackgroundMatches &&
93 double lcl_getDistance(
const SwRect& rRect,
const Point& rPoint )
102 nDist = aLine.GetLength( );
112class SwCursorOszControl
124 if (pFly != m_pStack1 && pFly != m_pStack2)
126 m_pStack1 = m_pStack2;
136 m_pEntry = m_pStack1 = pFly;
141 if (pFly == m_pEntry)
142 m_pEntry = m_pStack1 = m_pStack2 =
nullptr;
148static SwCursorOszControl
g_OszCtrl = {
nullptr,
nullptr,
nullptr };
157 while ( !bRet && pFrame )
159 pFrame->
Calc(pRenderContext);
163 const SwRect aPaintRect( bContentCheck ?
167 if ( aPaintRect.
Contains( rPoint ) &&
183 Point aPoint( rPoint );
200 bRet = lcl_GetModelPositionForViewPoint_Objects(
this,
false, pPos, rPoint, pCMS );
224 bool bTextRet =
false;
226 OSL_ENSURE( pCnt,
"Cursor is gone to a Black hole" );
249 bool bConsiderBackground =
true;
251 if (pContentNode && pContentNode->
IsTextNode())
259 bConsiderBackground =
false;
263 bool bBackRet =
false;
267 bBackRet = lcl_GetModelPositionForViewPoint_Objects(
this,
true, &aBackPos, rPoint, pCMS );
270 if (bConsiderBackground && bTestBackground && bBackRet)
284 double nTextDistance = 0;
285 bool bValidTextDistance =
false;
310 pTextFrame->
GetCharRect(nextTextRect, nextTextPos);
312 if (aRectFnSet.
GetTop(aTextRect) ==
313 aRectFnSet.
GetTop(nextTextRect))
316 if (aRectFnSet.
GetLeft(aTextRect) <
317 aRectFnSet.
GetLeft(nextTextRect))
320 aRectFnSet.
GetLeft(nextTextRect));
325 aRectFnSet.
GetLeft(nextTextRect));
330 nTextDistance = lcl_getDistance(aTextRect, rPoint);
331 bValidTextDistance =
true;
335 double nBackDistance = 0;
336 bool bValidBackDistance =
false;
338 if ( pBackNd && bConsiderBackground)
347 nBackDistance = lcl_getDistance( rBackRect, rPoint );
348 bValidBackDistance =
true;
352 if ( bValidTextDistance && bValidBackDistance &&
basegfx::fTools::more( nTextDistance, nBackDistance ) )
433 Point aOldPoint = rPoint;
445 while ( pPage && pPage->
GetNext() )
452 pPage->SwPageFrame::GetModelPositionForViewPoint( pPos, rPoint, pCMS, bTestBackground );
463 return aOldPoint == rPoint;
481 GetFormat()->GetProtect().IsContentProtected() )
500 Calc(pRenderContext);
504 while ( pFrame && !bRet )
506 pFrame->
Calc(pRenderContext);
517 const bool bFill = pCMS && pCMS->
m_pFill;
518 Point aPoint( rPoint );
549 Calc(pRenderContext);
564 while ( aIter() && !bRet )
583 while ( bInside && !bRet )
586 while ( pFrame && !bRet )
588 pFrame->
Calc(pRenderContext);
599 const bool bFill = pCMS && pCMS->
m_pFill;
600 Point aPoint( rPoint );
652 return pTab && pTab->IsFollow() && pTab->
IsInHeadline( *pFrame );
662 bool bMissFollowFlowLine )
666 bool bProtect =
true;
667 while ( pCnt && bProtect )
679 pCnt = (*fnNxtPrv)( pCnt );
682 else if ( !bInReadOnly )
684 pCnt = (*fnNxtPrv)( pCnt );
693 "lcl_UpDown doesn't work for others." );
700 bool bTableSel =
false;
713 static_cast<const SwCellFrame*
>(pCell)->GetFollowCell() :
714 static_cast<const SwCellFrame*
>(pCell)->GetPreviousCell();
717 while ( pTmpCell &&
nullptr != ( pTmpStart = pTmpCell->
ContainsContent() ) )
721 static_cast<const SwCellFrame*
>(pCell)->GetFollowCell() :
722 static_cast<const SwCellFrame*
>(pCell)->GetPreviousCell();
729 pNxt = (*fnNxtPrv)( pNxt );
733 pCnt = (*fnNxtPrv)( pCnt ? pCnt : pStart );
738 const bool bTab = pStTab || (pCnt && pCnt->
IsInTab());
741 const SwFrame* pVertRefFrame = pStart;
742 if ( bTableSel && pStTab )
743 pVertRefFrame = pStTab;
753 nX = aRectFnSet.
IsVert() ? aCenter.
Y() : aCenter.
X();
766 OSL_ENSURE( pCell,
"could not find the cell" );
773 if ( pStTab != pTable )
788 if (bRTL != (aRectFnSet.
XDiff(nPrtLeft, nX) > 0))
795 if (bRTL != (aRectFnSet.
XDiff(nX, nPrtRight) > 0))
809 pCnt = (*fnNxtPrv)( pCnt );
821 pCnt = (*fnNxtPrv)( pCnt );
831 pCnt = (*fnNxtPrv)( pCnt );
844 while ( pCntUp && !bSame )
855 pCnt = (*fnNxtPrv)( pCnt );
871 if ( pTab != pTable )
891 if ( aRectFnSet.
IsVert() )
894 nTmpTop = aRectFnSet.
XInc(nTmpTop, -1);
896 aInsideCell =
Point( nTmpTop, nX );
899 aInsideCell =
Point( nX, nTmpTop );
903 if ( aRectFnSet.
IsVert() )
906 nTmpTop = aRectFnSet.
XInc(nTmpTop, -1);
908 aInsideCnt =
Point( nTmpTop, nX );
911 aInsideCnt =
Point( nX, nTmpTop );
931 pCnt = (*fnNxtPrv)( pCnt );
948 ? pFrame->
GetText().getLength()
980 OSL_ENSURE( pActualCursor,
"got no page cursor" );
1008 while ( pContent && pPage->
IsAnLower( pContent ) )
1010 pContent->
Calc(pRenderContext);
1097 if ( !pLayoutFrame || (
nullptr == (pLayoutFrame = (*fnWhichPage)(pLayoutFrame))) )
1101 pCnt = (*fnPosPage)(pLayoutFrame);
1102 if(
nullptr == pCnt )
1110 if ( pTab->IsFollow() )
1145 sal_uInt64 dX = std::max( rPt1.
X(), rPt2.
X() ) -
1147 dY = std::max( rPt1.
Y(), rPt2.
Y() ) -
1149 return (dX * dX) + (dY * dY);
1184 const bool bDontLeave,
1185 const bool bBodyOnly,
1187 const bool bDefaultExpand )
const
1194 if ( !pContent && (
GetPrev() && !bDontLeave) )
1197 if ( bBodyOnly && pContent && !pContent->
IsInDocBody() )
1203 sal_uInt16 nMaxPage =
GetPhyPageNum() + (bDefaultExpand ? 1 : 0);
1204 Point aPoint = rPoint;
1210 ((!bDontLeave ||
IsAnLower( pContent )) &&
1221 if ( pComp != pContent )
1227 if ( aContentFrame.
Contains( rPoint ) )
1235 Point aContentPoint( rPoint );
1238 if ( aContentFrame.
Top() > aContentPoint.
Y() )
1239 aContentPoint.
setY( aContentFrame.
Top() );
1240 else if ( aContentFrame.
Bottom() < aContentPoint.
Y() )
1241 aContentPoint.
setY( aContentFrame.
Bottom() );
1244 if ( aContentFrame.
Left() > aContentPoint.
X() )
1245 aContentPoint.
setX( aContentFrame.
Left() );
1246 else if ( aContentFrame.
Right() < aContentPoint.
X() )
1247 aContentPoint.
setX( aContentFrame.
Right() );
1252 if( !pInside || ( pInside->
IsAnLower( pContent ) &&
1255 const sal_uInt64 nDiff =
::CalcDiff(aContentPoint, rPoint);
1256 bool bBetter = nDiff < nDistance;
1265 aPoint = aContentPoint;
1284 while ( !pContent && pStart->
GetPrev() )
1336 OSL_ENSURE( pActual,
"no Content found." );
1337 OSL_ENSURE( !bBodyOnly || pActual->
IsInDocBody(),
"Content not in Body." );
1343 if ( pTab->IsFollow() && pTab->
IsInHeadline( *pActual ) )
1358 aRectFnSet.
IsVert() ? rPoint.
X() : rPoint.
Y() ) > 0 )
1366 else if ( !pActual->
GetNext() &&
1368 aRectFnSet.
IsVert() ? rPoint.
X() : rPoint.
Y() ) < 0 )
1380 if ( aPoint.
Y() < aRect.
Top() )
1382 else if ( aPoint.
Y() > aRect.
Bottom() )
1384 if ( aPoint.
X() < aRect.
Left() )
1386 else if ( aPoint.
X() > aRect.
Right() )
1416 if ( aContentFrame.
Contains( rPt ) )
1424 Point aPoint( rPt );
1427 if ( aContentFrame.
Top() > rPt.
Y() )
1428 aPoint.
setY( aContentFrame.
Top() );
1429 else if ( aContentFrame.
Bottom() < rPt.
Y() )
1433 if ( aContentFrame.
Left() > rPt.
X() )
1434 aPoint.
setX( aContentFrame.
Left() );
1435 else if ( aContentFrame.
Right() < rPt.
X() )
1438 const sal_uInt64 nDiff =
::CalcDiff( aPoint, rPt );
1439 if ( nDiff < nDist )
1456 if ( aAct.
Y() < aRect.
Top() )
1458 else if ( aAct.
Y() > aRect.
Bottom() )
1460 if ( aAct.
X() < aRect.
Left() )
1462 else if ( aAct.
X() > aRect.
Right() )
1506 return Point( 0, 0 );
1508 pCnt->
Calc(pRenderContext);
1525 pCnt->
Calc(pRenderContext);
1561 pNxt->
Calc(pRenderContext);
1606 while ( pPageFrame && pPageFrame->
GetPhyPageNum() < _nPageNum )
1611 if ( pPageFrame && pPageFrame->
GetPhyPageNum() == _nPageNum )
1645 if (isFormProtected)
1675 GetProtect().IsContentProtected() )
1684 if (
static_cast<const SwFlyFrame*
>(pFrame)->GetPrevLink() )
1693 pFrame =
static_cast<const SwFlyFrame*
>(pFrame)->GetAnchorFrame();
1728 if ( !pPage || !pPage->
GetUpper() )
1733 ::std::optional<sal_uInt16> oPgNum;
1738 const SwFlowFrame *pTmp = SwFlowFrame::CastFlowFrame( pFlow );
1739 if ( !pTmp->IsFollow() )
1759 OSL_ENSURE( pDesc,
"No pagedescriptor" );
1767 isRightPage = !isRightPage;
1772 isRightPage =
false;
1820 if ( !pPage || !pPage->
GetUpper() )
1832 const SwFrame *pFrame =
nullptr;
1842 const sw::BroadcastingModify *pMod = pDesc->
GetDefinedIn();
1844 pMod->GetInfo( aInfo );
1875 "Tabselection not on Cnt." );
1898 std::pair<Point, bool> tmp(aPtPt,
false);
1899 const SwFrame *
const pTmpStartFrame = pTmpStartNode ? pTmpStartNode->
getLayoutFrame(
this,
nullptr, &tmp) :
nullptr;
1901 const SwFrame *
const pTmpEndFrame = pTmpEndNode ? pTmpEndNode->
getLayoutFrame(
this,
nullptr, &tmp) :
nullptr;
1906 OSL_ENSURE( pStart && pEnd,
"MakeTableCursors: Good to have the code robust here!" );
1935 while ( pCell && pRow->
IsAnLower( pCell ) )
1937 OSL_ENSURE( pCell->
IsCellFrame(),
"Frame without cell" );
1939 (bReadOnlyAvailable ||
1943 static_cast<const SwCellFrame*
>(pCell)->GetTabBox());
1958 }
while ( pCell && pLastCell->
IsAnLower( pCell ) );
1960 if( pCell && pCell->
IsInTab() )
1965 OSL_ENSURE( pCell,
"Where's my cell?" );
2021 auto [pStartPos, pEndPos] = rCursor.
StartEnd();
2025 bool bIgnoreVisArea =
true;
2033 if( !pStartPos->GetNode().IsContentNode() ||
2034 !pStartPos->GetNode().GetContentNode()->getLayoutFrame(
this) ||
2035 ( pStartPos->GetNode() != pEndPos->GetNode() &&
2036 ( !pEndPos->GetNode().IsContentNode() ||
2037 !pEndPos->GetNode().GetContentNode()->getLayoutFrame(
this) ) ) )
2046 std::pair<Point, bool> tmp(rCursor.
GetSttPos(),
true);
2054 assert(pStartFrame && pEndFrame &&
"No ContentFrames found.");
2063 OSL_ENSURE( pObj,
"No Start Object." );
2066 OSL_ENSURE( pObj2,
"SwRootFrame::CalcFrameRects(..) - FlyFrame missing - looks like an invalid selection" );
2067 if ( pObj2 !=
nullptr && pObj2 != pObj )
2078 while( pSttLFrame &&
2079 ! (cHdFtTableHd & pSttLFrame->
GetType() ))
2080 pSttLFrame = pSttLFrame->
GetUpper();
2084 while( pEndLFrame &&
2085 ! (cHdFtTableHd & pEndLFrame->
GetType() ))
2086 pEndLFrame = pEndLFrame->
GetUpper();
2091 "Selection over different content" );
2092 switch( pSttLFrame->
GetType() )
2100 if( pStartPos == rCursor.
GetPoint() )
2101 pEndFrame = pStartFrame;
2103 pStartFrame = pEndFrame;
2118 if( pStartPos == rCursor.
GetPoint() )
2119 pEndFrame = pStartFrame;
2121 pStartFrame = pEndFrame;
2135 SwRect aStRect, aEndRect;
2136 pStartFrame->
GetCharRect( aStRect, *pStartPos, &aTmpState );
2137 std::unique_ptr<Sw2LinesPos> pSt2Pos = std::move(aTmpState.
m_p2Lines);
2140 pEndFrame->
GetCharRect( aEndRect, *pEndPos, &aTmpState );
2141 std::unique_ptr<Sw2LinesPos> pEnd2Pos = std::move(aTmpState.
m_p2Lines);
2145 SwRect aEndFrame( pStartFrame == pEndFrame ? aStFrame : pEndFrame->
UnionFrame(
true ) );
2146 if( pStartFrame != pEndFrame )
2158 if( pSt2Pos != pEnd2Pos && ( !pSt2Pos || !pEnd2Pos ||
2159 pSt2Pos->aPortion != pEnd2Pos->aPortion ) )
2175 aRectFnSet.
GetWidth(pSt2Pos->aPortion2) )
2179 nRightAbs -= aRectFnSet.
GetLeft(pSt2Pos->aPortion2);
2182 aRectFnSet.
SetRight( aTmp, nRightAbs );
2184 if ( ! pEnd2Pos || pEnd2Pos->aPortion != pSt2Pos->aPortion )
2186 SwRect aTmp2( pSt2Pos->aPortion );
2187 aRectFnSet.
SetRight( aTmp2, nLeftAbs );
2189 Sub( aRegion, aTmp2 );
2195 aRectFnSet.
SetLeft( aTmp, aRectFnSet.
GetLeft(pSt2Pos->aPortion) );
2201 aRectFnSet.
GetTop(pSt2Pos->aPortion) ==
2202 aRectFnSet.
GetTop(aTmp) )
2204 aRectFnSet.
SetTop( aTmp, aRectFnSet.
GetTop(pSt2Pos->aLine) );
2208 Sub( aRegion, aTmp );
2221 aRectFnSet.
SetLeft( aTmp, aRectFnSet.
GetLeft(pSt2Pos->aPortion) );
2224 Sub( aRegion, aTmp );
2227 aStRect = pSt2Pos->aLine;
2228 aRectFnSet.
SetLeft( aStRect, bR2L ?
2229 aRectFnSet.
GetLeft(pSt2Pos->aPortion) :
2230 aRectFnSet.
GetRight(pSt2Pos->aPortion) );
2245 fnRectX.
GetWidth(pEnd2Pos->aPortion2) )
2249 nRightAbs = nRightAbs - fnRectX.
GetLeft(pEnd2Pos->aPortion2);
2252 fnRectX.
SetLeft( aTmp, nLeftAbs );
2254 if ( ! pSt2Pos || pSt2Pos->aPortion != pEnd2Pos->aPortion )
2256 SwRect aTmp2( pEnd2Pos->aPortion );
2257 fnRectX.
SetLeft( aTmp2, nRightAbs );
2259 Sub( aRegion, aTmp2 );
2271 fnRectX.
GetBottom(pEnd2Pos->aPortion) ==
2278 Sub( aRegion, aTmp );
2284 if( fnRectX.
GetTop(aEndRect) != nTmp )
2287 fnRectX.
SetTop( aTmp, nTmp );
2288 if( fnRectX.
GetTop(aEndRect) !=
2289 fnRectX.
GetTop(pEnd2Pos->aPortion) )
2297 Sub( aRegion, aTmp );
2301 aEndRect = pEnd2Pos->aLine;
2302 fnRectX.
SetLeft( aEndRect, bEndR2L ?
2303 fnRectX.
GetRight(pEnd2Pos->aPortion) :
2304 fnRectX.
GetLeft(pEnd2Pos->aPortion) );
2308 else if( pSt2Pos && pEnd2Pos &&
2311 pSt2Pos->aPortion == pEnd2Pos->aPortion &&
2312 pSt2Pos->aPortion2 != pEnd2Pos->aPortion2 )
2318 if ( aRectFnSet.
GetWidth(pSt2Pos->aPortion2) )
2322 nRightAbs -= aRectFnSet.
GetLeft(pSt2Pos->aPortion2);
2325 aRectFnSet.
SetRight( aTmp, nRightAbs );
2327 Sub( aRegion, aTmp );
2329 aStRect = pSt2Pos->aLine;
2330 aRectFnSet.
SetLeft( aStRect, bR2L ? nRightAbs : nLeftAbs );
2335 if ( fnRectX.
GetWidth(pEnd2Pos->aPortion2) )
2339 nRightAbs -= fnRectX.
GetLeft(pEnd2Pos->aPortion2);
2342 fnRectX.
SetLeft( aTmp, nLeftAbs );
2344 Sub( aRegion, aTmp );
2346 aEndRect = pEnd2Pos->aLine;
2347 fnRectX.
SetLeft( aEndRect, bEndR2L ? nLeftAbs : nRightAbs );
2354 if( aStRect.
Left() < aStFrame.
Left() )
2356 else if( aStRect.
Left() > aStFrame.
Right() )
2359 if( nTmp < aStFrame.
Left() )
2361 else if( nTmp > aStFrame.
Right() )
2363 if( aEndRect.
Left() < aEndFrame.
Left() )
2365 else if( aEndRect.
Left() > aEndFrame.
Right() )
2367 nTmp = aEndRect.
Right();
2368 if( nTmp < aEndFrame.
Left() )
2370 else if( nTmp > aEndFrame.
Right() )
2373 if( pStartFrame == pEndFrame )
2375 bool bSameRotatedOrBidi = pSt2Pos && pEnd2Pos &&
2379 pSt2Pos->aPortion == pEnd2Pos->aPortion;
2381 if( bSameRotatedOrBidi ||
2382 aRectFnSet.
GetTop(aStRect) == aRectFnSet.
GetTop(aEndRect) )
2386 if (bSameRotatedOrBidi || bR2L || bB2T)
2388 if( aTmpSt.
Y() > aTmpEnd.
Y() )
2391 aTmpEnd.
setY( aTmpSt.
Y() );
2392 aTmpSt.
setY( nTmpY );
2394 if( aTmpSt.
X() > aTmpEnd.
X() )
2397 aTmpEnd.
setX( aTmpSt.
X() );
2398 aTmpSt.
setX( nTmpX );
2402 SwRect aTmp( aTmpSt, aTmpEnd );
2406 if( 1 == aRectFnSet.
GetWidth(aTmp) &&
2407 pStartPos->GetContentIndex() !=
2408 pEndPos->GetContentIndex() )
2417 Sub( aRegion, aTmp );
2423 if( pSt2Pos && pEnd2Pos && pSt2Pos->aPortion == pEnd2Pos->aPortion )
2425 lLeft = aRectFnSet.
GetLeft(pSt2Pos->aPortion);
2426 lRight = aRectFnSet.
GetRight(pSt2Pos->aPortion);
2432 lRight = aRectFnSet.
GetRight(aEndFrame);
2434 if( lLeft < aRectFnSet.
GetLeft(aStFrame) )
2435 lLeft = aRectFnSet.
GetLeft(aStFrame);
2436 if( lRight > aRectFnSet.
GetRight(aStFrame) )
2437 lRight = aRectFnSet.
GetRight(aStFrame);
2438 SwRect aSubRect( aStRect );
2441 aRectFnSet.
SetLeft( aSubRect, lLeft );
2443 aRectFnSet.
SetRight( aSubRect, lRight );
2444 Sub( aRegion, aSubRect );
2450 if( aTmpBottom != aTmpTop )
2452 aRectFnSet.
SetLeft( aSubRect, lLeft );
2453 aRectFnSet.
SetRight( aSubRect, lRight );
2454 aRectFnSet.
SetTop( aSubRect, aTmpBottom );
2455 aRectFnSet.
SetBottom( aSubRect, aTmpTop );
2456 Sub( aRegion, aSubRect );
2459 aSubRect = aEndRect;
2461 aRectFnSet.
SetRight( aSubRect, lRight );
2463 aRectFnSet.
SetLeft( aSubRect, lLeft );
2464 Sub( aRegion, aSubRect );
2471 SwRect aSubRect( aStRect );
2476 Sub( aRegion, aSubRect );
2478 if( aRectFnSet.
GetBottom(aStFrame) != nTmpTwips )
2480 aSubRect = aStFrame;
2481 aRectFnSet.
SetTop( aSubRect, nTmpTwips );
2482 Sub( aRegion, aSubRect );
2495 OSL_ENSURE( pContent,
2496 "<SwRootFrame::CalcFrameRects(..)> - no content frame. This is a serious defect" );
2497 while ( pContent && pContent != pEndFrame )
2514 pTmpCellBox =
nullptr;
2516 ( !pCellBox || pCellBox == pTmpCellBox ) )
2523 aTmp.
Union( aCRect );
2528 aPrvRect.
Union( aCRect );
2533 Sub( aRegion, aPrvRect );
2539 OSL_ENSURE( pContent,
2540 "<SwRootFrame::CalcFrameRects(..)> - no content frame. This is a serious defect!" );
2543 Sub( aRegion, aPrvRect );
2546 aRectFnSet.
Refresh(pEndFrame);
2547 nTmpTwips = aRectFnSet.
GetTop(aEndRect);
2548 if( aRectFnSet.
GetTop(aEndFrame) != nTmpTwips )
2550 aSubRect = aEndFrame;
2551 aRectFnSet.
SetBottom( aSubRect, nTmpTwips );
2552 Sub( aRegion, aSubRect );
2554 aSubRect = aEndRect;
2559 Sub( aRegion, aSubRect );
2589 bool inSelection = (
2590 anchoredAt !=
nullptr
2591 && ( (rAnchor.
GetAnchorId() == RndStdIds::FLY_AT_CHAR
2593 || (rAnchor.
GetAnchorId() == RndStdIds::FLY_AT_PARA
2597 else if ( !pFly->
IsAnLower( pStartFrame ) &&
2598 (rSur.
GetSurround() != css::text::WrapTextMode_THROUGH &&
2601 if ( aSortObjs.
Contains( *pAnchoredObj ) )
2606 for (
size_t k = 0; bSub && k < aSortObjs.
size(); ++k )
2608 assert(
dynamic_cast< const SwFlyFrame *
>( aSortObjs[k] ) &&
2609 "<SwRootFrame::CalcFrameRects(..)> - object in <aSortObjs> of unexpected type" );
2613 if ( nPos < pTmp->GetVirtDrawObj()->GetOrdNumDirect() )
2621 }
while ( bSub && pTmp );
2628 if ( pPage == pEndPage )
2639 Sub( aRegion, aDropRect );
2641 if ( pEndFrame != pStartFrame && pEndFrame->
IsTextFrame() )
2644 Sub( aRegion, aDropRect );
2647 rCursor.assign( aRegion.begin(), aRegion.end() );
o3tl::strong_int< sal_Int32, struct Tag_TextFrameIndex > TextFrameIndex
Denotes a character index in a text frame at a layout level, after extent mapping from a text node at...
helper class to disable creation of an action by a callback event in particular, change event from a ...
constexpr tools::Long Y() const
void setX(tools::Long nX)
void setY(tools::Long nY)
constexpr tools::Long X() const
sal_uInt32 GetOrdNum() const
Item2Range GetItemSurrogates(sal_uInt16 nWhich) const
constexpr tools::Long Height() const
void setHeight(tools::Long nHeight)
bool IsContentProtected() const
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
SwCellFrame is one table cell in the document layout.
virtual bool GetModelPositionForViewPoint(SwPosition *, Point &, SwCursorMoveState *=nullptr, bool bTestBackground=false) const override
If this is about a Content-carrying cell the Cursor will be force inserted into one of the ContentFra...
SwContentFrame is the layout for content nodes: a common base class for text (paragraph) and non-text...
SwContentFrame * GetPrevContentFrame() const
virtual bool UnitUp(SwPaM *, const SwTwips nOffset, bool bSetInReadOnly) const
SwContentFrame * GetNextContentFrame() const
virtual bool UnitDown(SwPaM *, const SwTwips nOffset, bool bSetInReadOnly) const
SwContentFrame * getLayoutFrame(const SwRootFrame *, const SwPosition *pPos=nullptr, std::pair< Point, bool > const *pViewPosAndCalcFrame=nullptr) const
virtual sal_Int32 Len() const
virtual bool IsReadOnlyAvailable() const
const SwAttrPool & GetAttrPool() const
::sw::DocumentSettingManager & GetDocumentSettingManager()
const SwPageDesc & GetPageDesc(const size_t i) const
Base class of all fields.
bool IsClickable() const
Is this field clickable?
general base class for all free-flowing frames
const SwVirtFlyDrawObj * GetVirtDrawObj() const
SwFlyFrame * GetPrevLink() const
virtual bool GetModelPositionForViewPoint(SwPosition *, Point &, SwCursorMoveState *=nullptr, bool bTestBackground=false) const override
Searches the ContentFrame owning the PrtArea containing the point.
virtual const SwFlyFrameFormat * GetFormat() const override
virtual void Calc(vcl::RenderContext *pRenderContext) const override
Pagedescriptor Client of SwPageDesc that is "described" by the attribute.
const sw::BroadcastingModify * GetDefinedIn() const
Query / set where attribute is anchored.
SwPageDesc * GetPageDesc()
const ::std::optional< sal_uInt16 > & GetNumOffset() const
const SwRect & getFrameArea() const
bool isFrameAreaDefinitionValid() const
bool isFrameAreaPositionValid() const
const SwRect & getFramePrintArea() const
bool isFramePrintAreaValid() const
bool isFrameAreaSizeValid() const
Base class of the Writer layout elements.
bool WannaRightPage() const
Decides if the page want to be a right page or not.
SwRect GetPaintArea() const
|* The paintarea is the area, in which the content of a frame is allowed |* to be displayed.
bool IsFootnoteContFrame() const
sal_uInt16 GetVirtPageNum() const
SwFlyFrame * FindFlyFrame()
SwTabFrame * FindTabFrame()
void PrepareMake(vcl::RenderContext *pRenderContext)
Prepares the Frame for "formatting" (MakeAll()).
virtual bool IsCoveredCell() const
SwFrameType GetType() const
bool IsInFootnote() const
bool IsHeaderFrame() const
virtual void Calc(vcl::RenderContext *pRenderContext) const
bool IsProtected() const
Is the Frame or rather the Section in which it lies protected?
virtual bool FillSelection(SwSelectionList &rList, const SwRect &rRect) const
bool IsRightToLeft() const
bool IsPageBodyFrame() const
const SwRowFrame * IsInFollowFlowRow() const
virtual bool GetModelPositionForViewPoint(SwPosition *, Point &, SwCursorMoveState *=nullptr, bool bTestBackground=false) const
SwRect UnionFrame(bool bBorder=false) const
|* The unionframe is the framearea (getFrameArea()) of a frame expanded by the |* printarea,...
bool IsFooterFrame() const
bool IsFootnoteFrame() const
SwLayoutFrame * GetUpper()
const SwLayoutFrame * GetNextLayoutLeaf() const
SwRootFrame * getRootFrame()
bool IsNoTextFrame() const
bool IsContentFrame() const
SwPageFrame * FindPageFrame()
virtual const SwFormatPageDesc & GetPageDescItem() const
sal_uInt16 GetPhyPageNum() const
virtual bool GetCharRect(SwRect &, const SwPosition &, SwCursorMoveState *=nullptr, bool bAllowFarAway=true) const
bool IsLayoutFrame() const
A layout frame is a frame that contains other frames (m_pLower), e.g. SwPageFrame or SwTabFrame.
const SwCellFrame * FirstCell() const
Calls ContainsAny first to reach the innermost cell.
bool IsAnLower(const SwFrame *) const
virtual bool GetModelPositionForViewPoint(SwPosition *, Point &, SwCursorMoveState *=nullptr, bool bTestBackground=false) const override
Searches the ContentFrame owning the PrtArea containing the point.
virtual const SwFrameFormat * GetFormat() const
virtual bool FillSelection(SwSelectionList &rList, const SwRect &rRect) const override
const SwContentFrame * ContainsContent() const
Checks if the frame contains one or more ContentFrame's anywhere in his subsidiary structure; if so t...
const SwContentFrame * GetContentPos(Point &rPoint, const bool bDontLeave, const bool bBodyOnly=false, SwCursorMoveState *pCMS=nullptr, const bool bDefaultExpand=true) const
Finds the closest Content for the SPoint Is used for Pages, Flys and Cells if GetModelPositionForView...
const SwFrame * Lower() const
const SwContentNode * GetNode() const
virtual bool RightMargin(SwPaM *, bool bAPI=false) const override
virtual bool LeftMargin(SwPaM *) const override
Layout dependent cursor travelling.
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
SwNodeOffset GetIndex() const
bool IsInProtectSect() const
Is node in a protected area?
const SwStartNode * StartOfSectionNode() const
SwContentNode * GetContentNode()
PaM is Point and Mark: a selection of the document model.
SwNode & GetPointNode() const
std::pair< const SwPosition *, const SwPosition * > StartEnd() const
Because sometimes the cost of the operator<= can add up.
SwContentNode * GetPointContentNode() const
SwContentNode * GetMarkContentNode() const
SwNode & GetMarkNode() const
const SwPosition * GetPoint() const
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
SwFrameFormat * GetLeftFormat(bool const bFirst=false)
A page of the document layout.
virtual bool FillSelection(SwSelectionList &rList, const SwRect &rRect) const override
SwContentFrame * FindLastBodyContent()
Searches the last ContentFrame in BodyText below the page.
sal_uInt16 GetPhyPageNum() const
const SwSortedObjs * GetSortedObjs() const
virtual bool GetModelPositionForViewPoint(SwPosition *, Point &, SwCursorMoveState *=nullptr, bool bTestBackground=false) const override
Searches the page containing the searched point.
SwContentFrame * FindFirstBodyContent()
bool IsFootnotePage() const
Foot note interface.
void GetContentPosition(const Point &rPt, SwPosition &rPos) const
Same as SwLayoutFrame::GetContentPos().
SwPageDesc * GetPageDesc()
void SetWidth(SwRect &rRect, tools::Long nNew) const
void SetBottom(SwRect &rRect, tools::Long nNew) const
void SetRight(SwRect &rRect, tools::Long nNew) const
tools::Long GetWidth(const SwRect &rRect) const
tools::Long GetTop(const SwRect &rRect) const
tools::Long XDiff(tools::Long n1, tools::Long n2) const
tools::Long GetPrtRight(const SwFrame &rFrame) const
tools::Long XInc(tools::Long n1, tools::Long n2) const
tools::Long YDiff(tools::Long n1, tools::Long n2) const
tools::Long GetLeft(const SwRect &rRect) const
tools::Long GetPrtTop(const SwFrame &rFrame) const
tools::Long GetPrtLeft(const SwFrame &rFrame) const
tools::Long GetBottom(const SwRect &rRect) const
tools::Long BottomDist(const SwRect &rRect, tools::Long nPos) const
void SetTop(SwRect &rRect, tools::Long nNew) const
void Refresh(const SwFrame *pFrame)
tools::Long GetRight(const SwRect &rRect) const
tools::Long GetPrtBottom(const SwFrame &rFrame) const
void SetLeft(SwRect &rRect, tools::Long nNew) const
Of course Writer needs its own rectangles.
SwRect & Intersection(const SwRect &rRect)
void Height(tools::Long nNew)
SwRect & Union(const SwRect &rRect)
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
bool Overlaps(const SwRect &rRect) const
void Left(const tools::Long nLeft)
void Width(tools::Long nNew)
const SwRect & GetOrigin() const
void Invert()
invert current rectangle
The root element of a Writer document layout.
SwViewShell * GetCurrShell() const
SwPageFrame * GetPageByPageNum(sal_uInt16 _nPageNum) const
Get page frame by physical page number looping through the lowers, which are page frame,...
bool IsVirtPageNum() const
void CalcFrameRects(SwShellCursor &)
const SwPageFrame * GetPageAtPos(const Point &rPt, const Size *pSize=nullptr, bool bExtend=false) const
Point rPt: The point that should be used to find the page Size pSize: If given, we return the (first)...
virtual bool FillSelection(SwSelectionList &rList, const SwRect &rRect) const override
sal_uInt16 GetPageNum() const
bool IsDummyPage(sal_uInt16 nPageNum) const
Point GetNextPrevContentPos(const Point &rPoint, bool bNext) const
Search the nearest Content to the passed point.
Point GetPagePos(sal_uInt16 nPageNum) const
Returns the absolute document position of the desired page.
bool IsCallbackActionEnabled() const
sal_uInt16 GetCurrPage(const SwPaM *) const
Query/set the current Page and the collective Page count We'll format as much as necessary.
sal_uInt16 SetCurrPage(SwCursor *, sal_uInt16 nPageNum)
Returns a PaM which sits at the beginning of the requested page.
void SetCallbackActionEnabled(bool b)
bool MakeTableCursors(SwTableCursor &)
Calculates the cells included from the current selection.
virtual bool GetModelPositionForViewPoint(SwPosition *, Point &, SwCursorMoveState *=nullptr, bool bTestBackground=false) const override
Primary passes the call to the first page.
This class is used as parameter for creation of a block cursor selection.
bool isEmpty() const
Reports if the list does not contain any text portion.
Represents the current text cursor of one opened edit window.
const Point & GetEndPos() const
const Point & GetSttPos() const
const Point & GetPtPos() const
const Point & GetMkPos() const
class for collecting anchored objects
bool Contains(const SwAnchoredObject &_rAnchoredObj) const
bool Insert(SwAnchoredObject &_rAnchoredObj)
SwTabFrame is one table in the document layout, containing rows (which contain cells).
const SwTabFrame * GetFollow() const
SwRowFrame * GetFirstNonHeadlineRow() const
const SwTable * GetTable() const
bool IsInHeadline(const SwFrame &rFrame) const
SwTableBox is one table cell in the document model.
void ActualizeSelection(const SwSelBoxes &rBoxes)
sal_uInt16 GetRowsToRepeat() const
A wrapper around SfxPoolItem to store the start position of (usually) a text portion,...
const SwFormatField & GetFormatField() const
Represents the visualization of a paragraph.
bool GetDropRect(SwRect &rRect) const
DropCaps and selections.
SwTextFrame * GetFollow()
SwPosition MapViewToModelPos(TextFrameIndex nIndex) const
TextFrameIndex GetOffset() const
bool IsHiddenNow() const
Hidden.
SwTextNode * GetTextNodeFirst()
const OUString & GetText() const
Returns the text portion we want to edit (for inline see underneath)
SwTextNode is a paragraph in the document model.
SwTextAttr * GetTextAttrForCharAt(const sal_Int32 nIndex, const sal_uInt16 nWhich=RES_TXTATR_END) const
get the text attribute at position nIndex which owns the dummy character CH_TXTATR_* at that position...
vcl::RenderContext * GetOut() const
const SwViewOption * GetViewOptions() const
const SwRect & VisArea() const
SwFlyFrame * GetFlyFrame()
const SwPageFrame * GetPage() const
const SwFrame * GetFrame() const
std::pair< const_iterator, bool > insert(Value &&x)
virtual bool get(DocumentSettingId id) const override
Return the specified document setting.
@ SetOnlyText
stay with the cursor inside text
@ TableSel
not in repeated headlines
SwLayoutFrame *(* SwWhichPage)(const SwLayoutFrame *)
SwContentFrame *(* SwPosPage)(const SwLayoutFrame *)
virtual SotClipboardFormatId GetFormat(const TransferableDataHelper &aHelper) override
static SwContentNode * GetContentNode(SwDoc &rDoc, SwPosition &rPos, bool bNext)
constexpr TypedWhichId< SwFormatPageDesc > RES_PAGEDESC(99)
constexpr TypedWhichId< SwFormatField > RES_TXTATR_FIELD(RES_TXTATR_NOEND_BEGIN)
bool IsRightPageByNumber(SwRootFrame const &rLayout, sal_uInt16 nPageNum)
bool FrameContainsNode(SwContentFrame const &rFrame, SwNodeOffset nNodeIndex)
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
SwContentNode * GetNode(SwPaM &rPam, bool &rbFirst, SwMoveFnCollection const &fnMove, bool const bInReadOnly, SwRootFrame const *const i_pLayout)
This function returns the next node in direction of search.
SwFillCursorPos * m_pFill
for automatic filling with tabs etc
bool m_b2Lines
Check 2line portions and fill p2Lines.
sal_uInt8 m_nCursorBidiLevel
bool m_bNoScroll
No scrolling of undersized textframes.
std::unique_ptr< Sw2LinesPos > m_p2Lines
for selections inside/around 2line portions
bool m_bFillRet
only used temporary in FillMode
bool m_bPosMatchesBounds
GetModelPositionForViewPoint should not return the next position if screen position is inside second ...
bool m_bExactOnly
let GetModelPositionForViewPoint look for exact matches only, i.e.
bool m_bSetInReadOnly
ReadOnly areas may be entered.
Marks a position in the document model.
void Assign(const SwNode &rNd, SwNodeOffset nDelta, sal_Int32 nContentOffset=0)
These all set both nNode and nContent.
void AssignEndIndex(const SwContentNode &rNd)
Set nNode to rNd, and nContent to the end of rNd.
void AssignStartIndex(const SwContentNode &rNd)
Set nNode to rNd, and nContent to the beginning of rNd.
sal_Int32 GetContentIndex() const
void AdjustContent(sal_Int32 nDelta)
Adjust content index, only valid to call this if the position points to a SwContentNode subclass.
void MakeSelUnions(SwSelUnions &rUnions, const SwLayoutFrame *pStart, const SwLayoutFrame *pEnd, const SwTableSearchType eSearchType)
bool IsFrameInTableSel(const SwRect &rUnion, const SwFrame *pCell)
std::vector< SwSelUnion > SwSelUnions
SwContentFrame * GetLastSub(const SwLayoutFrame *pLayout)
static void Add(SwRegionRects &rRegion, const SwRect &rRect)
static const SwContentFrame * lcl_MissProtectedFrames(const SwContentFrame *pCnt, GetNxtPrvCnt fnNxtPrv, bool bMissHeadline, bool bInReadOnly, bool bMissFollowFlowLine)
Skip protected table cells. Optionally also skip repeated headlines.
static SwCursorOszControl g_OszCtrl
SwContentFrame * GetFirstSub(const SwLayoutFrame *pLayout)
static const SwLayoutFrame * lcl_Inside(const SwContentFrame *pCnt, Point const &rPt)
Check if the point lies inside the page part in which also the ContentFrame lies.
static void Sub(SwRegionRects &rRegion, const SwRect &rRect)
const SwContentFrame *(* GetNxtPrvCnt)(const SwContentFrame *)
SwLayoutFrame * GetPrevFrame(const SwLayoutFrame *pFrame)
SwLayoutFrame * GetThisFrame(const SwLayoutFrame *pFrame)
static const SwContentFrame * lcl_GetNxtCnt(const SwContentFrame *pCnt)
SwLayoutFrame * GetNextFrame(const SwLayoutFrame *pFrame)
static const SwContentFrame * lcl_GetPrvCnt(const SwContentFrame *pCnt)
static sal_uInt64 CalcDiff(const Point &rPt1, const Point &rPt2)
static bool lcl_UpDown(SwPaM *pPam, const SwContentFrame *pStart, GetNxtPrvCnt fnNxtPrv, bool bInReadOnly)
static bool lcl_IsInRepeatedHeadline(const SwFrame *pFrame, const SwTabFrame **ppTFrame=nullptr)
Frame in repeated headline?
bool GetFrameInPage(const SwContentFrame *pCnt, SwWhichPage fnWhichPage, SwPosPage fnPosPage, SwPaM *pPam)
Returns the first/last Contentframe (controlled using the parameter fnPosPage) of the current/previou...
bool IsSelectFrameAnchoredAtPara(SwPosition const &rAnchorPos, SwPosition const &rStart, SwPosition const &rEnd, DelContentType const nDelContentType)
is a fly anchored at paragraph at rAnchorPos selected?
bool IsDestroyFrameAnchoredAtChar(SwPosition const &rAnchorPos, SwPosition const &rStart, SwPosition const &rEnd, DelContentType const nDelContentType)
will DelContentIndex destroy a frame anchored at character at rAnchorPos?