21 #include <svx/strings.hrc>
53 #include <drawdoc.hxx>
75 #include <viewimp.hxx>
91 #include <LibreOfficeKit/LibreOfficeKitEnums.h>
94 #include <svx/svxids.hrc>
95 #include <osl/diagnose.h>
97 #include <com/sun/star/embed/EmbedMisc.hpp>
98 #include <com/sun/star/embed/Aspects.hpp>
99 #include <com/sun/star/embed/XEmbeddedObject.hpp>
118 if( pLineEndList.is() )
120 OUString aArrowName(
SvxResId(pResId) );
123 for( nIndex = 0; nIndex < nCount; nIndex++ )
126 if( pEntry->
GetName() == aArrowName )
148 return pVirtO->GetFlyFrame();
157 (!pOldSelFly || pOldSelFly->
GetFormat() != pFlyFormat) )
196 bool bUnmark = !bAddSelect;
204 const sal_uInt16
nType = GetCntType();
207 && !IsReadOnlyAvailable() ))
215 aPt.setX(aPt.getX() - 1);
216 bool bUnLockView = !IsViewLocked();
218 SetCursor( aPt,
true );
223 static_cast<SwNoTextFrame*>(pOldSelFly->
Lower())->HasAnimation() )
229 if ( SdrDragMode::Crop == GetDragMode() )
230 SetDragMode( SdrDragMode::Move );
250 OSL_ENSURE( !bEnterGroup,
"SW_ENTER_GROUP is not supported" );
251 pDView->
MarkObj( pObj, Imp()->GetPageView() );
256 const auto nHdlSizePixel = Imp()->GetDrawView()->GetMarkHdlSizePixel();
257 const short nMinMove =
static_cast<short>(GetOut()->PixelToLogic(
Size(nHdlSizePixel/2, 0)).Width());
258 pDView->
MarkObj( rPt, nMinMove, bAddSelect, bEnterGroup );
274 pDView->
MarkObj( pTmpObj, Imp()->GetPageView(), bAddSelect, bEnterGroup );
296 SdrObject* pShape = pShapeFormat->FindSdrObject();
298 pDView->
MarkObj(pShape, Imp()->GetPageView(), bAddSelect, bEnterGroup);
310 OSL_ENSURE( pTmp,
"Graphic without Fly" );
311 if ( static_cast<const SwNoTextFrame*>(pTmp->
Lower())->HasAnimation() )
312 static_cast<const SwNoTextFrame*>(pTmp->
Lower())->StopAnimation( GetOut() );
315 else if ( !pOldSelFly && bHadSelection )
316 SetCursor( aOldPos,
true);
318 if( bRet || !bHadSelection )
343 static bool LessX( Point
const & aPt1, Point
const & aPt2,
bool bOld )
345 return aPt1.getX() < aPt2.getX()
346 || ( aPt1.getX() == aPt2.getX()
347 && ( aPt1.getY() < aPt2.getY()
348 || ( aPt1.getY() == aPt2.getY() && bOld ) ) );
350 static bool LessY( Point
const & aPt1, Point
const & aPt2,
bool bOld )
352 return aPt1.getY() < aPt2.getY()
353 || ( aPt1.getY() == aPt2.getY()
354 && ( aPt1.getX() < aPt2.getX()
355 || ( aPt1.getX() == aPt2.getX() && bOld ) ) );
360 if (!Imp()->GetDrawView())
362 const SdrMarkList& pMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
370 pFly = pVirtO->GetFlyFrame();
384 if ( RndStdIds::FLY_AS_CHAR == nAnchorId )
405 switch ( nAnchorId ) {
406 case RndStdIds::FLY_AT_PAGE:
408 OSL_ENSURE( pOld->
IsPageFrame(),
"Wrong anchor, page expected." );
413 if( pNew && pNew != pOld )
415 aAnch.SetPageNum( static_cast<SwPageFrame*>(pNew)->GetPhyPageNum() );
420 case RndStdIds::FLY_AT_CHAR:
422 OSL_ENSURE(pOld->
IsTextFrame(),
"Wrong anchor, text frame expected.");
426 SwTextFrame *
const pOldFrame(static_cast<SwTextFrame*>(pOld));
449 if( pos != *aAnch.GetContentAnchor())
450 aAnch.SetAnchor( &pos );
454 case RndStdIds::FLY_AT_PARA:
456 OSL_ENSURE(pOld->
IsTextFrame(),
"Wrong anchor, text frame expected.");
463 SwTextFrame *
const pNewFrame(static_cast<SwTextFrame*>(pNew));
466 (bRet && pNewFrame->
GetText().getLength() != 0)
467 ? pNewFrame->
GetText().getLength() - 1
469 aAnch.SetAnchor( &pos );
476 case RndStdIds::FLY_AT_FLY:
478 OSL_ENSURE( pOld->
IsFlyFrame(),
"Wrong anchor, fly frame expected.");
480 OSL_ENSURE( pPage,
"Where's my page?" );
482 if( pPage->GetSortedObjs() )
490 if(
auto pTmp = dynamic_cast<SwFlyFrame*>( pAnchObj) )
496 const SwFlyFrame* pCheck = pFly ? pTmp :
nullptr;
506 Point aNew( pTmp->getFrameArea().Left() +
507 pTmp->getFrameArea().Width()/2,
508 pTmp->getFrameArea().Top() +
509 pTmp->getFrameArea().Height()/2 );
510 bool bAccept =
false;
514 bAccept =
LessX( aCenter, aNew, bOld )
516 LessX( aNew, aBest,
false ) );
521 bAccept =
LessX( aNew, aCenter, !bOld )
523 LessX( aBest, aNew,
true ) );
528 bAccept =
LessY( aNew, aCenter, !bOld )
530 LessY( aBest, aNew,
true ) );
535 bAccept =
LessY( aCenter, aNew, bOld )
537 LessY( aNew, aBest,
false ) );
554 GetContent().GetContentIdx());
555 aAnch.SetAnchor( &aPos );
570 std::unique_ptr<SwHandleAnchorNodeChg, o3tl::default_delete<SwHandleAnchorNodeChg>> pHandleAnchorNodeChg;
571 SwFlyFrameFormat* pFlyFrameFormat( dynamic_cast<SwFlyFrameFormat*>(&rFormat) );
572 if ( pFlyFrameFormat )
574 pHandleAnchorNodeChg.reset(
595 if( Imp()->GetDrawView() !=
nullptr )
596 pMarkList = &Imp()->GetDrawView()->GetMarkedObjectList();
606 if( pMarkList ==
nullptr || pMarkList->
GetMarkCount() == 0 )
613 if ( pFly !=
nullptr )
640 if( pMarkList !=
nullptr && pMarkList->
GetMarkCount() == 1 )
652 const SwRect aRect( rPt, rPt );
654 (!Imp()->GetDrawView()->GetMarkedObjectList().GetMarkCount() ||
655 Imp()->IsDragPossible( rPt )) )
663 if ( Imp()->HasDrawView() )
664 Imp()->GetDrawView()->SetDragMode( eDragMode );
670 if ( Imp()->HasDrawView() )
672 nRet = Imp()->GetDrawView()->GetDragMode();
679 if ( !Imp()->HasDrawView() )
683 SdrView *pView = Imp()->GetDrawView();
702 pView->
MarkObj( pTmpObj, Imp()->GetPageView() );
710 SetDragMode( SdrDragMode::Crop );
715 SdrView *pView = Imp()->GetDrawView();
718 m_pChainFrom.reset();
729 OSL_ENSURE( Imp()->HasDrawView(),
"Drag without DrawView?" );
730 if ( HasDrawViewDrag() )
733 Imp()->GetDrawView()->MovDragObj( *pPt );
734 Imp()->GetDrawView()->ShowDragAnchor();
741 OSL_ENSURE( Imp()->HasDrawView(),
"EndDrag without DrawView?" );
742 SdrView *pView = Imp()->GetDrawView();
763 GetDoc()->GetIDocumentUndoRedo().DoDrawUndo(
true);
764 ChgAnchor( RndStdIds::FLY_AT_PARA,
true );
771 if(
auto pCursorShell = dynamic_cast<SwCursorShell *>(&rSh) )
772 pCursorShell->CallChgLnk();
775 GetDoc()->getIDocumentState().SetModified();
781 OSL_ENSURE( Imp()->HasDrawView(),
"BreakDrag without DrawView?" );
782 if( HasDrawViewDrag() )
783 Imp()->GetDrawView()->BrkDragObj();
790 if ( Imp()->HasDrawView() )
792 const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
803 SwPaM *pCursor = GetCursor();
821 GetCursorDocPos() = rChrRect.
Pos();
840 bool bCheckNeighbours =
false;
853 bCheckNeighbours =
true;
856 aFrm.
Pos().AdjustY(1 );
873 for (
size_t i = 0;
i < nCount; ++
i )
882 if ( aRect.
IsOver( aTmpCalcPnt ) )
889 if ( aRect.
IsOver( aTmpCalcPnt ) )
903 aFrm.
Pos().AdjustY(1 );
914 if ( !(nSlotId == SID_LINE_ARROW_START ||
915 nSlotId == SID_LINE_ARROW_END ||
916 nSlotId == SID_LINE_ARROWS ||
917 nSlotId == SID_LINE_ARROW_CIRCLE ||
918 nSlotId == SID_LINE_CIRCLE_ARROW ||
919 nSlotId == SID_LINE_ARROW_SQUARE ||
920 nSlotId == SID_LINE_SQUARE_ARROW ||
921 nSlotId == SID_DRAW_MEASURELINE) )
928 if( !aArrow.
count() )
940 if( !aCircle.
count() )
944 aCircle.
append(aNewCircle);
949 if( !aSquare.
count() )
957 aSquare.
append(aNewSquare);
973 case SID_LINE_ARROWS:
974 case SID_DRAW_MEASURELINE:
984 case SID_LINE_ARROW_START:
985 case SID_LINE_ARROW_CIRCLE:
986 case SID_LINE_ARROW_SQUARE:
994 case SID_LINE_ARROW_END:
995 case SID_LINE_CIRCLE_ARROW:
996 case SID_LINE_SQUARE_ARROW:
1008 case SID_LINE_CIRCLE_ARROW:
1016 case SID_LINE_ARROW_SQUARE:
1024 case SID_LINE_SQUARE_ARROW:
1037 OSL_ENSURE( Imp()->HasDrawView(),
"SelectionToTop without DrawView?" );
1038 const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
1039 OSL_ENSURE( rMrkList.
GetMarkCount(),
"No object selected." );
1042 if ( pFly && pFly->IsFlyInContentFrame() )
1047 Imp()->GetDrawView()->PutMarkedToTop();
1049 Imp()->GetDrawView()->MovMarkedToTop();
1051 GetDoc()->getIDocumentState().SetModified();
1057 OSL_ENSURE( Imp()->HasDrawView(),
"SelectionToBottom without DrawView?" );
1058 const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
1059 OSL_ENSURE( rMrkList.
GetMarkCount(),
"No object selected." );
1062 if ( pFly && pFly->IsFlyInContentFrame() )
1067 Imp()->GetDrawView()->PutMarkedToBtm();
1069 Imp()->GetDrawView()->MovMarkedToBtm();
1071 GetDoc()->getIDocumentState().SetModified();
1079 if ( !Imp()->HasDrawView() )
1083 const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
1091 else if ( nRet != pObj->
GetLayer() )
1105 if ( !Imp()->HasDrawView() )
1108 const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
1120 OSL_ENSURE( pContact && pContact->
GetMaster(),
"<SwFEShell::ChangeOpaque(..)> - missing contact or missing master object at contact!" );
1121 const bool bControlObj = ( pContact && pContact->
GetMaster() )
1124 if ( !bControlObj && pObj->
GetLayer() != nLayerId )
1130 SwFormat *pFormat = pVirtO->GetFlyFrame()->GetFormat();
1132 aOpa.SetValue( nLayerId == rIDDMA.
GetHellId() );
1137 GetDoc()->getIDocumentState().SetModified();
1142 ChangeOpaque( getIDocumentDrawModelAccess().GetHeavenId() );
1147 ChangeOpaque( getIDocumentDrawModelAccess().GetHellId() );
1152 if ( IsFrameSelected() || !Imp()->HasDrawView() )
1155 return Imp()->GetDrawView()->GetMarkedObjectList().GetMarkCount();
1160 if ( !Imp()->HasDrawView() )
1164 const_cast<SwFEShell*>(
this) );
1169 if ( IsFrameSelected() || !Imp()->HasDrawView() )
1172 return Imp()->GetDrawView()->IsObjMarked( &rObj );
1178 const SdrView *pSdrView = Imp()->GetDrawView();
1184 if(1 == rList.GetMarkCount())
1186 const SwVirtFlyDrawObj* pVirtFlyDraw(dynamic_cast< const SwVirtFlyDrawObj* >(rList.GetMark(0)->GetMarkedSdrObj()));
1188 if(
nullptr != pVirtFlyDraw)
1202 const SdrMarkList& aMarkList = Imp()->GetDrawView()->GetMarkedObjectList();
1224 OSL_ENSURE( Imp()->HasDrawView() && Imp()->GetDrawView()->IsTextEdit(),
1225 "EndTextEdit a no Object" );
1228 SdrView *pView = Imp()->GetDrawView();
1231 if(
nullptr != pUserCall )
1240 if ( SdrEndTextEditKind::ShouldBeDeleted == pView->
SdrEndTextEdit(
true) )
1245 aSave.
DeleteMark( aSave.FindObject( pObj ) );
1246 if ( aSave.GetMarkCount() )
1249 pView->
MarkObj( pObj, Imp()->GetPageView() );
1252 for (
size_t i = 0;
i < aSave.GetMarkCount(); ++
i )
1253 pView->
MarkObj( aSave.GetMark(
i )->GetMarkedSdrObj(), Imp()->GetPageView() );
1270 if( Imp()->HasDrawView() )
1294 bRet = pDView->
PickObj(rPt, pDView->
getHitTolLog(), pPV, SdrSearchOptions::PICKMARKABLE) !=
nullptr;
1321 SwDrawView *pDrawView = Imp()->GetDrawView();
1340 bool bObjInBackground(
false );
1347 if ( rSurround.
GetSurround() == css::text::WrapTextMode_THROUGH )
1349 bObjInBackground =
true;
1353 if ( bObjInBackground )
1355 const SwPageFrame* pPageFrame = GetLayout()->GetPageAtPos( rPt );
1359 while ( pContentFrame )
1361 if ( pContentFrame->UnionFrame().IsInside( rPt ) )
1368 Point aTmpPt( rPt );
1389 pContentFrame = pContentFrame->GetNextContentFrame();
1399 bool bInHdrFtr = GetDoc()->IsInHeaderFooter( rPos.
nNode );
1400 if (IsHeaderFooterEdit() != bInHdrFtr)
1435 if(dynamic_cast<const SdrUnoObj*>( pObj) !=
nullptr)
1437 else if(
auto pObjGroup = dynamic_cast<const SdrObjGroup*>( pObj) )
1440 const SdrObjList *pLst = pObjGroup->GetSubList();
1453 explicit MarkableObjectsOnly(
SdrPageView* i_pPV )
1458 virtual bool includeObject(
const SdrObject& i_rObject )
const override
1460 return m_pPV && m_pPV->GetView().IsObjMarkable( &i_rObject, m_pPV );
1470 if( !Imp()->HasDrawView() )
1477 Point aBestPos( nTmp, nTmp );
1478 Point aTopPos( nTmp, nTmp );
1484 if( !bNoFly && bNoDraw )
1490 const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
1491 SdrPageView* pPV = Imp()->GetDrawView()->GetSdrPageView();
1493 MarkableObjectsOnly aDefaultFilter( pPV );
1495 pFilter = &aDefaultFilter;
1504 if(
auto pVirtFlyDrawObj = dynamic_cast<const SwVirtFlyDrawObj*>( pStartObj) )
1505 aPos = pVirtFlyDrawObj->GetFlyFrame()->getFrameArea().Pos();
1518 aPos = GetCharRect().Center();
1520 if ( dynamic_cast<const SdrObjGroup*>( pStartObj) )
1529 pList = getIDocumentDrawModelAccess().GetDrawModel()->GetPage( 0 );
1532 OSL_ENSURE( pList,
"No object list to iterate" );
1534 SdrObjListIter aObjIter( pList, bFlat ? SdrIterMode::Flat : SdrIterMode::DeepNoGroups );
1535 while ( aObjIter.
IsMore() )
1539 if( ( bNoFly && pVirtO ) ||
1540 ( bNoDraw && !pVirtO ) ||
1561 if ( pFly->
Lower() &&
1567 if ( pFly->
Lower() &&
1581 if( aCurPos != aPos &&
1582 aCurPos.getY() == aPos.getY() &&
1583 (bNext? (aCurPos.getX() > aPos.getX()) :
1584 (aCurPos.getX() < aPos.getX())) )
1586 aBestPos =
Point( nTmp, nTmp );
1587 SdrObjListIter aTmpIter( pList, bFlat ? SdrIterMode::Flat : SdrIterMode::DeepNoGroups );
1588 while ( aTmpIter.
IsMore() )
1592 if( ( bNoFly && pVirtO ) || ( bNoDraw && !pVirtO ) )
1601 if( aCurPos != aPos && aCurPos.Y() == aPos.Y() &&
1602 (bNext? (aCurPos.getX() > aPos.getX()) :
1603 (aCurPos.getX() < aPos.getX())) &&
1604 (bNext? (aCurPos.getX() < aBestPos.getX()) :
1605 (aCurPos.getX() > aBestPos.getX())) )
1615 (bNext? (aPos.getY() < aCurPos.getY()) :
1616 (aPos.getY() > aCurPos.getY())) &&
1617 (bNext? (aBestPos.getY() > aCurPos.getY()) :
1618 (aBestPos.getY() < aCurPos.getY()))
1620 (aBestPos.getY() == aCurPos.getY() &&
1621 (bNext? (aBestPos.getX() > aCurPos.getX()) :
1622 (aBestPos.getX() < aCurPos.getX()))))
1629 if( (bNext? (aTopPos.getY() > aCurPos.getY()) :
1630 (aTopPos.getY() < aCurPos.getY())) ||
1631 (aTopPos.getY() == aCurPos.getY() &&
1632 (bNext? (aTopPos.getX() > aCurPos.getX()) :
1633 (aTopPos.getX() < aCurPos.getX()))))
1640 if( bNext ? (aBestPos.getX() ==
LONG_MAX) : (aBestPos.getX() == 0) )
1654 const SdrObject* pBest = GetBestObject( bNext, eType );
1666 SelectObj( rFrame.
Pos(), 0,
const_cast<SdrObject*
>(pBest) );
1668 MakeVisible( rFrame );
1672 SelectObj(
Point(), 0, const_cast<SdrObject*>(pBest) );
1684 if ( !Imp()->HasDrawView() )
1685 Imp()->MakeDrawView();
1687 if ( GetPageNumber( rPos ) )
1689 Imp()->GetDrawView()->SetCurrentObj( eSdrObjectKind );
1691 bRet = Imp()->GetDrawView()->BegCreateCaptionObj(
1695 bRet = Imp()->GetDrawView()->BegCreateObj( rPos, GetOut() );
1709 if ( !Imp()->HasDrawView() )
1710 Imp()->MakeDrawView();
1712 if ( GetPageNumber( rPos ) )
1714 Imp()->GetDrawView()->SetCurrentObj( eSdrObjectKind, eObjInventor );
1715 bRet = Imp()->GetDrawView()->BegCreateObj( rPos, GetOut() );
1724 OSL_ENSURE( Imp()->HasDrawView(),
"MoveCreate without DrawView?" );
1725 if ( GetPageNumber( rPos ) )
1728 Imp()->GetDrawView()->MovCreateObj( rPos );
1737 OSL_ENSURE( Imp()->HasDrawView(),
"EndCreate without DrawView?" );
1738 if( !Imp()->GetDrawView()->IsGroupEntered() )
1740 GetDoc()->GetIDocumentUndoRedo().DoDrawUndo(
false);
1742 bool bCreate = Imp()->GetDrawView()->EndCreateObj( eSdrCreateCmd );
1743 GetDoc()->GetIDocumentUndoRedo().DoDrawUndo(
true);
1751 if ( eSdrCreateCmd == SdrCreateCmd::NextPoint )
1756 return ImpEndCreate();
1761 OSL_ENSURE( Imp()->GetDrawView()->GetMarkedObjectList().GetMarkCount() == 1,
1762 "New object not selected." );
1764 SdrObject& rSdrObj = *Imp()->GetDrawView()->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj();
1769 Imp()->GetDrawView()->DeleteMarked();
1770 Imp()->GetDrawView()->UnmarkAll();
1789 Imp()->GetDrawView()->UnmarkAll();
1796 sal_uInt16 nIdent = SdrInventor::Default == rSdrObj.
GetObjInventor()
1802 const SwFrame *pAnch =
nullptr;
1803 bool bCharBound =
false;
1804 if( dynamic_cast<const SdrUnoObj*>( &rSdrObj) !=
nullptr )
1809 GetLayout()->GetModelPositionForViewPoint( &aPos, aPoint, &aState );
1814 std::pair<Point, bool>
const tmp(aPoint,
true);
1823 aRect.AdjustTop( -(
MM50*2) );
1824 aRect.AdjustRight(
MM50*2 );
1825 aRect.AdjustBottom(
MM50*2 );
1827 if( !aRect.IsOver( rBound ) && !
::GetHtmlMode( GetDoc()->GetDocShell() ))
1832 bCharBound = !GetDoc()->IsInHeaderFooter( aPos.
nNode );
1836 aAnch.
SetType( RndStdIds::FLY_AS_CHAR );
1849 bool bBodyOnly = 0xFFFF == nIdent;
1850 bool bAtPage =
false;
1851 const SwFrame* pPage =
nullptr;
1853 Point aPoint( aPt );
1855 GetLayout()->GetModelPositionForViewPoint( &aPos, aPoint, &aState );
1866 std::pair<Point, bool>
const tmp(aPoint,
false);
1867 pAnch = pCNode ? pCNode->
getLayoutFrame(GetLayout(),
nullptr, &tmp) :
nullptr;
1879 const SwFrame* pTmpFrame = pAnch;
1904 std::pair<SwTextNode const*, sal_Int32>
const pos(
1906 aPos.
nNode = *pos.first;
1920 aAnch.
SetType( RndStdIds::FLY_AT_PARA );
1927 pPage = pAnch ? pAnch->
FindPageFrame() : GetLayout()->GetPageAtPos(aPoint);
1929 aAnch.
SetType( RndStdIds::FLY_AT_PAGE );
1945 nXOffset = nYOffset;
1959 OSL_ENSURE(pTmp,
"Where's my Master?");
1986 const SwRect aFlyRect( rBound );
1990 GetDoc()->GetIDocumentUndoRedo().DoDrawUndo(
false);
1992 SdrPage *pPg = getIDocumentDrawModelAccess().GetOrCreateDrawModel()->GetPage( 0 );
1995 SdrModel* pTmpSdrModel = getIDocumentDrawModelAccess().GetDrawModel();
1996 auto pNewPage = pTmpSdrModel->
AllocPage(
false );
1998 pPg = pNewPage.get();
2003 GetDoc()->GetIDocumentUndoRedo().DoDrawUndo(
true);
2006 if( NewFlyFrame( aSet,
true ) &&
2008 nullptr != ( pFlyFrame = GetSelectedFlyFrame() ))
2012 const bool bLeftFrame = aFlyRect.
Left() <
2014 bLeftPrt = aFlyRect.
Left() + aFlyRect.
Width() <
2016 if( bLeftFrame || bLeftPrt )
2019 aHori.
SetRelationOrient( bLeftFrame ? text::RelOrientation::FRAME : text::RelOrientation::PRINT_AREA );
2023 const bool bRightFrame = aFlyRect.
Left() >
2026 aHori.
SetRelationOrient( bRightFrame ? text::RelOrientation::FRAME : text::RelOrientation::PRINT_AREA );
2028 aHtmlSet.Put( aHori );
2031 aHtmlSet.Put( aVert );
2033 GetDoc()->SetAttr( aHtmlSet, *pFlyFrame->
GetFormat() );
2038 if (rSdrObj.
GetName().isEmpty())
2040 bool bRestore = GetDoc()->GetIDocumentUndoRedo().DoesDrawUndo();
2041 GetDoc()->GetIDocumentUndoRedo().DoDrawUndo(
false);
2043 GetDoc()->GetIDocumentUndoRedo().DoDrawUndo(bRestore);
2048 aRelNullPt =
static_cast<SdrCaptionObj&
>(rSdrObj).GetTailPos();
2050 aRelNullPt = rBound.
TopLeft();
2063 assert(pTmp &&
"Where's my Master?");
2073 text::PositionLayoutDir::PositionInLayoutDirOfAnchor );
2083 OSL_ENSURE( aAnch.
GetAnchorId() == RndStdIds::FLY_AS_CHAR,
"wrong AnchorType" );
2086 pNd->InsertItem(aFormat,
2089 aVertical.SetVertOrient( text::VertOrientation::LINE_CENTER );
2097 OSL_ENSURE( pTmp,
"Where's my Master?" );
2109 Imp()->GetDrawView()->MarkObj( pMarkObj, Imp()->GetPageView() );
2113 Imp()->GetDrawView()->MarkObj( &rSdrObj, Imp()->GetPageView() );
2118 GetDoc()->getIDocumentState().SetModified();
2121 EndAllActionAndCall();
2128 OSL_ENSURE( Imp()->HasDrawView(),
"BreakCreate without DrawView?" );
2129 Imp()->GetDrawView()->BrkCreateObj();
2135 return Imp()->HasDrawView() && Imp()->GetDrawView()->IsCreateObj();
2140 if ( !Imp()->HasDrawView() )
2141 Imp()->MakeDrawView();
2143 if ( GetPageNumber( rPos ) )
2161 OSL_ENSURE( Imp()->HasDrawView(),
"MoveMark without DrawView?" );
2163 if ( GetPageNumber( rPos ) )
2180 OSL_ENSURE( Imp()->HasDrawView(),
"EndMark without DrawView?" );
2182 if (Imp()->GetDrawView()->IsMarkObj())
2184 bRet = Imp()->GetDrawView()->EndMarkObj();
2188 bool bShowHdl =
false;
2199 if( dynamic_cast<const SwVirtFlyDrawObj*>( pObj) !=
nullptr )
2226 if (Imp()->GetDrawView()->IsMarkPoints())
2227 bRet = Imp()->GetDrawView()->EndMarkPoints();
2237 if ( Imp()->HasDrawView() )
2239 const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
2243 if ( dynamic_cast<const SwVirtFlyDrawObj*>( pObj) !=
nullptr )
2245 nRet = RndStdIds::UNKNOWN;
2252 else if ( nRet != nId )
2254 nRet = RndStdIds::UNKNOWN;
2260 nRet = RndStdIds::UNKNOWN;
2266 OSL_ENSURE( Imp()->HasDrawView(),
"ChgAnchor without DrawView?" );
2267 const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
2273 if( GetDoc()->ChgAnchor( rMrkList, eAnchorId, bSameOnly, bPosCorr ))
2274 Imp()->GetDrawView()->UnmarkAll();
2284 OSL_ENSURE( Imp()->HasDrawView(),
"DelSelectedObj(), no DrawView available" );
2285 if ( Imp()->HasDrawView() )
2288 Imp()->GetDrawView()->DeleteMarked();
2298 if ( Imp()->HasDrawView() )
2300 if ( Imp()->GetDrawView()->IsAction() )
2301 Imp()->GetDrawView()->TakeActionRect( aRect );
2303 aRect = Imp()->GetDrawView()->GetAllMarkedRect();
2310 const SdrView *pView = Imp()->GetDrawView();
2311 OSL_ENSURE( pView,
"GetAnchorObjDiff without DrawView?" );
2314 if ( Imp()->GetDrawView()->IsAction() )
2315 Imp()->GetDrawView()->TakeActionRect( aRect );
2317 aRect = Imp()->GetDrawView()->GetAllMarkedRect();
2321 if ( IsFrameSelected() )
2339 OSL_ENSURE( Imp()->GetDrawView(),
"GetObjAbsPos() without DrawView?" );
2340 return Imp()->GetDrawView()->GetDragStat().GetActionRect().TopLeft();
2345 if ( IsObjSelected() )
2347 const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
2368 bool HasSuitableGroupingAnchor(
const SdrObject* pObj)
2370 bool bSuitable =
true;
2374 OSL_FAIL(
"<HasSuitableGroupingAnchor> - missing frame format" );
2377 else if (RndStdIds::FLY_AS_CHAR == pFrameFormat->GetAnchor().GetAnchorId())
2391 bool bIsGroupAllowed =
false;
2392 if ( IsObjSelected() > 1 )
2394 bIsGroupAllowed =
true;
2396 const SwFrame* pHeaderFooterFrame =
nullptr;
2397 const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
2398 for (
size_t i = 0; bIsGroupAllowed &&
i < rMrkList.
GetMarkCount(); ++
i )
2406 if ( bIsGroupAllowed )
2407 bIsGroupAllowed = HasSuitableGroupingAnchor(pObj);
2411 if ( bIsGroupAllowed )
2413 const SwFrame* pAnchorFrame =
nullptr;
2414 if (
auto pVirtFlyDrawObj = dynamic_cast<const SwVirtFlyDrawObj*>( pObj) )
2416 const SwFlyFrame* pFlyFrame = pVirtFlyDrawObj->GetFlyFrame();
2446 return bIsGroupAllowed;
2451 bool bIsUnGroupAllowed =
false;
2453 const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
2457 bIsUnGroupAllowed = HasSuitableGroupingAnchor(pObj);
2458 if (!bIsUnGroupAllowed)
2462 return bIsUnGroupAllowed;
2468 if ( IsGroupAllowed() )
2473 GetDoc()->GroupSelection( *Imp()->GetDrawView() );
2483 if ( IsGroupSelected() )
2488 GetDoc()->UnGroupSelection( *Imp()->GetDrawView() );
2497 SdrView *pView = Imp()->GetDrawView();
2519 const SwFlyFrameFormat* pFlyFormat = mxDoc->FindFlyByName( rName, aChkArr[ eType]);
2540 SwPaM* pCursor = GetCursor();
2559 GetCursorDocPos() = rChrRect.
Pos();
2570 return GetDoc()->GetFlyCount(eType, bIgnoreTextBoxes);
2575 return GetDoc()->GetFlyNum(nIdx, eType, bIgnoreTextBoxes);
2579 FlyCntType const eType,
bool const bIgnoreTextBoxes)
2581 return GetDoc()->GetFlyFrameFormats(eType, bIgnoreTextBoxes);
2587 if ( Imp()->HasDrawView() &&
2588 Imp()->GetDrawView()->GetMarkedObjectList().GetMarkCount() )
2591 MakeVisible( Imp()->GetDrawView()->GetAllMarkedRect() );
2602 if( Imp()->HasDrawView() )
2604 const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
2622 uno::Reference < embed::XEmbeddedObject > xObj( pNd ? pNd->
GetOLEObj().
GetOleRef() : nullptr );
2626 const bool bNeverResize = (embed::EmbedMisc::EMBED_NEVERRESIZE & xObj->getStatus( embed::Aspects::MSOLE_CONTENT ));
2648 pAnch = pVirtO->GetFlyFrame()->GetAnchorFrame();
2663 if ( !IsObjSelected() )
2666 const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
2672 OSL_ENSURE( pContact,
"<SwFEShell::GetObjAttr(..)> - missing <pContact>." );
2688 if ( !rSet.
Count() )
2690 OSL_ENSURE(
false,
"SetObjAttr, empty set." );
2697 const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
2702 GetDoc()->SetAttr( rSet, *pContact->
GetFormat() );
2706 EndAllActionAndCall();
2707 GetDoc()->getIDocumentState().SetModified();
2712 return Imp()->GetDrawView()->IsAlignPossible();
2719 const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
2727 const SwFrame *pPage = GetLayout()->Lower();
2729 while ( pPage && !pPage->getFrameArea().IsInside( aPt ) )
2731 if ( aPt.Y() > pPage->getFrameArea().Bottom() )
2737 OSL_ENSURE( pPage,
"Page not found." );
2742 Imp()->GetDrawView()->GetCurrentObjInventor() == SdrInventor::Default ?
2743 Imp()->GetDrawView()->GetCurrentObjIdentifier() : 0xFFFF;
2749 ? *
static_cast<SwTextFrame const*
>(pAnch)->GetTextNodeForParaProps()
2751 aAnch.
SetType( RndStdIds::FLY_AT_PARA );
2753 const_cast<SwRect&
>(GetCharRect()).
Pos() = aPt;
2766 aRelNullPt =
static_cast<SdrCaptionObj*
>(pObj)->GetTailPos();
2768 aRelNullPt = rBound.
TopLeft();
2772 SwFrameFormat* pFormat = getIDocumentLayoutAccess().MakeLayoutFormat( RndStdIds::DRAW_OBJECT, &aSet );
2775 static_cast<SwDrawFrameFormat*>(pFormat), pObj );
2788 GetDoc()->SetCalcFieldValueHdl(pOutliner);
2792 const Point &rPt )
const
2802 if( Imp()->HasDrawView() )
2818 nRet = GetDoc()->Chainable(rSource, *pFormat);
2827 GetDoc()->Chain(rSource, rDest);
2833 SwChainRet nErr = Chainable( aDummy, rSource, rPt );
2846 GetDoc()->Chain(rSource, *pFormat);
2856 GetDoc()->Unchain(rFormat);
2862 m_pChainFrom.reset();
2868 bool bDelFrom =
true,
2870 if ( IsFrameSelected() )
2906 m_pChainFrom.reset();
2917 SwFrame *pFrame = GetCurrFrame();
2919 if( pFrame && pFrame->
IsInSct() )
2935 if( !pSct->IsFollow() )
2937 return pSct->getFrameArea().Width();
2946 SdrView* pDrawView = GetDrawView();
2950 SdrInventor::Default,
2977 if(dynamic_cast<const SdrCircObj*>( pObj) !=
nullptr)
2984 else if(
auto pPathObj = dynamic_cast<SdrPathObj*>( pObj))
2988 switch(eSdrObjectKind)
3010 aPoly.
append(aInnerPoly);
3032 aPoly.
append(aInnerPoly);
3060 aPoly.
append(aInnerPoly);
3065 sal_Int32 nYMiddle((aRect.
Top() + aRect.
Bottom()) / 2);
3072 SetLineEnds(aAttr, *pObj, nSlotId);
3080 pPathObj->SetPathPoly(aPoly);
3082 else if(
auto pMeasureObj = dynamic_cast<SdrMeasureObj*>( pObj))
3084 sal_Int32 nYMiddle((aRect.
Top() + aRect.
Bottom()) / 2);
3085 pMeasureObj->SetPoint(
Point(aStart.X(), nYMiddle), 0);
3086 pMeasureObj->SetPoint(
Point(aEnd.X(), nYMiddle), 1);
3089 SetLineEnds(aAttr, *pObj, nSlotId);
3092 else if(
auto pCaptionObj = dynamic_cast<SdrCaptionObj*>( pObj))
3094 bool bVerticalText = ( SID_DRAW_TEXT_VERTICAL == nSlotId ||
3095 SID_DRAW_CAPTION_VERTICAL == nSlotId );
3096 pCaptionObj->SetVerticalWriting(bVerticalText);
3105 pCaptionObj->SetLogicRect(aRect);
3106 pCaptionObj->SetTailPos(
3109 else if(
auto pText = dynamic_cast<SdrTextObj*>( pObj))
3111 pText->SetLogicRect(aRect);
3113 bool bVertical = (SID_DRAW_TEXT_VERTICAL == nSlotId);
3114 bool bMarquee = (SID_DRAW_TEXT_MARQUEE == nSlotId);
3116 pText->SetVerticalWriting(bVertical);
3125 pText->SetMergedItemSet(aSet);
3144 const bool bUndo(GetDoc()->GetIDocumentUndoRedo().DoesUndo());
3145 GetDoc()->GetIDocumentUndoRedo().DoUndo(
false);
3147 GetDoc()->GetIDocumentUndoRedo().DoUndo(bUndo);
3166 OSL_ENSURE( Imp()->GetDrawView(),
"wrong usage of SwFEShell::GetShapeBackgrd - no draw view!");
3167 if( Imp()->GetDrawView() )
3170 const SdrMarkList* pMrkList = &Imp()->GetDrawView()->GetMarkedObjectList();
3172 OSL_ENSURE( pMrkList->
GetMarkCount() == 1,
"wrong usage of SwFEShell::GetShapeBackgrd - no selected object!");
3178 OSL_ENSURE( dynamic_cast<const SwVirtFlyDrawObj*>( pSdrObj) ==
nullptr,
"wrong usage of SwFEShell::GetShapeBackgrd - selected object is not a drawing object!");
3179 if ( dynamic_cast<const SwVirtFlyDrawObj*>( pSdrObj) ==
nullptr )
3184 OSL_ENSURE( pAnchorFrame,
"inconsistent model - no anchor at shape!");
3188 OSL_ENSURE( pPageFrame,
"inconsistent model - no page!");
3214 OSL_ENSURE( Imp()->GetDrawView(),
"wrong usage of SwFEShell::GetShapeBackgrd - no draw view!");
3215 if( Imp()->GetDrawView() )
3218 const SdrMarkList* pMrkList = &Imp()->GetDrawView()->GetMarkedObjectList();
3220 OSL_ENSURE( pMrkList->
GetMarkCount() == 1,
"wrong usage of SwFEShell::GetShapeBackgrd - no selected object!");
3226 OSL_ENSURE( dynamic_cast<const SwVirtFlyDrawObj*>( pSdrObj) ==
nullptr,
"wrong usage of SwFEShell::GetShapeBackgrd - selected object is not a drawing object!");
3227 if ( dynamic_cast<const SwVirtFlyDrawObj*>( pSdrObj) ==
nullptr )
3232 OSL_ENSURE( pAnchorFrame,
"inconsistent model - no anchor at shape!");
3236 OSL_ENSURE( pPageFrame,
"inconsistent model - no page!");
3252 const SwFrame *pPage = GetLayout()->Lower();
static bool lcl_IsControlGroup(const SdrObject *pObj)
SwFrame * FindFooterOrHeader()
void FrameNotify(SwViewShell *pVwSh, FlyMode eMode)
const SwVirtFlyDrawObj * GetVirtDrawObj() const
Base class of the Writer layout elements.
Represents the visualization of a paragraph.
SwChainRet Chainable(SwRect &rRect, const SwFrameFormat &rSource, const Point &rPt) const
For Chain always connect Fly specified by format with that hit by point.
SAL_DLLPRIVATE const SdrMarkList * GetMarkList_() const
Get list of marked SdrObjects; helper method for GetSelFrameType, IsSelContainsControl.
static void notifyOtherViews(const SfxViewShell *pThisView, int nType, std::string_view rKey, const OString &rPayload)
void UnGroupSelection()
The individual objects are selected, but it is possible that there are groups included.
constexpr TypedWhichId< SwFormatSurround > RES_SURROUND(101)
SwTwips GetBaseVertOffsetForFly(bool bIgnoreFlysAnchoredAtThisFrame) const
void Right(const tools::Long nRight)
virtual bool BegDragObj(const Point &rPnt, OutputDevice *pOut, SdrHdl *pHdl, short nMinMov=-3, SdrDragMethod *pForcedMeth=nullptr)
bool IsFlyLayFrame() const
void append(const basegfx::B2DPoint &rPoint, sal_uInt32 nCount)
virtual const SwFlyFrameFormat * GetFormat() const override
size_t GetMarkCount() const
Marks a position in the document model.
virtual const tools::Rectangle & GetCurrentBoundRect() const
bool IsAlignPossible() const
void ChgAnchor(RndStdIds eAnchorId, bool bSameOnly=false, bool bPosCorr=true)
frmatr.hxx.
virtual SdrEndTextEditKind SdrEndTextEdit(bool bDontDeleteReally=false)
bool IsUnGroupAllowed() const
SwContentFrame * GetNextContentFrame() const
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.
void SetShiftPressed(bool bShiftPressed)
bool IsRotationOfSwGrfNodePossible() const
virtual rtl::Reference< SdrPage > AllocPage(bool bMasterPage)
SwOLENode * GetOLENode()
Inline methods from Node.hxx.
const SwOLEObj & GetOLEObj() const
static SwRectFnCollection aVertical
void Left(const tools::Long nLeft)
constexpr TypedWhichId< SwFormatFrameSize > RES_FRM_SIZE(89)
void GroupSelection()
Afterwards the group is selected.
void SetHitTolerancePixel(sal_uInt16 nVal)
void MirrorSelection(bool bHorizontal)
Vertical if FALSE.
bool AreObjectsMarked() const
void MirrorAllMarkedHorizontal()
SdrTextObj * GetTextEditObject() const
void SelectionToHeaven()
Above document.
const SwRect & getFramePrintArea() const
virtual void InsertPage(SdrPage *pPage, sal_uInt16 nPos=0xFFFF)
bool EndDragObj(bool bCopy=false)
void MovInsObjPoint(const Point &rPnt)
css::uno::Reference< css::embed::XEmbeddedObject > const & GetOleRef()
bool IsInsObjPoint() const
constexpr TypedWhichId< XLineWidthItem > XATTR_LINEWIDTH(XATTR_LINE_FIRST+2)
SwContentFrame * getLayoutFrame(const SwRootFrame *, const SwPosition *pPos=nullptr, std::pair< Point, bool > const *pViewPosAndCalcFrame=nullptr) const
SdrObject * GetObj(size_t nNum) const
void CheckUnboundObjects()
Temporary work around for bug.
size_t GetObjCount() const
bool KnowsFormat(const SwFormat &rFormat) const
virtual void MakeSelVisible()
show the current selected "object"
void appendBezierSegment(const basegfx::B2DPoint &rNextControlPoint, const basegfx::B2DPoint &rPrevControlPoint, const basegfx::B2DPoint &rPoint)
virtual bool GetCharRect(SwRect &rRect, const SwPosition &rPos, SwCursorMoveState *pCMS=nullptr, bool bAllowFarAway=true) const override
Returns the screen position of rPos.
bool IsInsideSelectedObj(const Point &rPt)
returns enum values
static SdrObject * MakeNewObject(SdrModel &rSdrModel, SdrInventor nInventor, SdrObjKind nObjIdentifier, const tools::Rectangle *pSnapRect=nullptr)
SdrMark * GetMark(size_t nNum) const
void Pos(const Point &rNew)
Of course Writer needs its own rectangles.
bool IsGroupSelected()
Create and destroy group, don't when frame is selected.
const OUString & GetText() const
Returns the text portion we want to edit (for inline see underneath)
static void Free(SdrObject *&_rpObject)
virtual SdrObjKind GetObjIdentifier() const
void ClearCharRectAndTopOfLine()
reset members and
EmbeddedObjectRef * pObject
void DeleteMark(size_t nNum)
static SwFrameFormat * getOtherTextBoxFormat(const SwFrameFormat *pFormat, sal_uInt16 nType)
If we have an associated TextFrame, then return that.
virtual SdrObjList * GetSubList() const
Value in Var-direction gives minimum (can be exceeded but not be less).
bool InsertObjectAtView(SdrObject *pObj, SdrPageView &rPV, SdrInsertFlags nOptions=SdrInsertFlags::NONE)
constexpr TypedWhichId< SwFlyFrameFormat > RES_FLYFRMFMT(156)
SdrObject * GetObjAt(const Point &rPt)
Same as IsObjSelectable(), but return the object as well.
SdrOnOffItem makeSdrTextAutoGrowHeightItem(bool bAuto)
bool ContainsSwGrfNode() const
bool BegMarkPoints(const Point &rPnt, bool bUnmark=false)
const SwFrameFormat * GetFlyNum(size_t nIdx, FlyCntType eType, bool bIgnoreTextBoxes=false) const
Point GetRelativePagePosition(const Point &rDocPos)
Convert document position into position relative to the current page.
virtual const tools::Rectangle & GetSnapRect() const
bool IsFlyAtContentFrame() const
void BeginDrag(const Point *pPt, bool bProp)
static void lcl_GrabCursor(SwFEShell *pSh, SwFlyFrame *pOldSelFly)
std::vector< SwFrameFormat const * > GetFlyFrameFormats(FlyCntType eType, bool bIgnoreTextBoxes)
wrapper class for the positioning of Writer fly frames and drawing objects
virtual void MovAction(const Point &rPnt) override
static void SetupObjLayer(const SdrPageView *pPageView, const OUString &aActiveLayer, SdrObject *pObj)
bool GetKeyCursorOfst(SwPosition *pPos, const Point &rPoint) const
Makes sure that the Frame is not switched (e.g.
constexpr TypedWhichId< SwDrawFrameFormat > RES_DRAWFRMFMT(159)
OUString SvxResId(const char *pId)
Destination and/or source not found.
const SwRect & getFrameArea() const
SwFlyFrame * GetPrevLink() const
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
void SetAttr(const SfxPoolItem &, SwFormat &)
Set attribute in given format.1y If Undo is enabled, the old values is added to the Undo history...
tools::Long GetSectionWidth(SwFormat const &rFormat) const
Width of current range for column-dialog.
Point GetAnchorObjDiff() const
Methods for status line.
void Width(tools::Long nNew)
int SetCursor(const Point &rPt, bool bOnlyText=false, bool bBlock=true)
void SetMergedItemSet(const SfxItemSet &rSet, bool bClearAllItems=false)
static void SetLineEnds(SfxItemSet &rAttr, SdrObject const &rObj, sal_uInt16 nSlotId)
XLineEndListRef GetLineEndList() const
void SetEditMode(SdrViewEditMode eMode)
SdrOnOffItem makeSdrTextAutoGrowWidthItem(bool bAuto)
constexpr SdrLayerID SDRLAYER_NOTFOUND(0xff)
SwFlyFrame * FindFlyFrame()
Color GetDrawBackgrdColor() const
SwPageFrame::GetDrawBackgrdColor.
static sal_uInt16 IsMath(const SvGlobalName &rName)
bool BeginCreate(SdrObjKind eSdrObjectKind, const Point &rPos)
Process of creating draw objects.
bool IsFlyInContentFrame() const
virtual void Changed(const SdrObject &rObj, SdrUserCallType eType, const tools::Rectangle &rOldBoundRect)
const Link< const SwFlyFrameFormat *, void > & GetFlyMacroLnk() const
Point GetObjAbsPos() const
sal_uInt32 GetOrdNumDirect() const
virtual bool GetCharRect(SwRect &, const SwPosition &, SwCursorMoveState *=nullptr, bool bAllowFarAway=true) const
void SelectionToHell()
Below document.
bool GotoFly(const OUString &rName, FlyCntType eType, bool bSelFrame)
Jump to named Fly (graphic/OLE).
GotoObjFlags
values can be combined via logical or
void SelectionToBottom(bool bBottom=true)
size_t GetFlyCount(FlyCntType eType, bool bIgnoreTextBoxes=false) const
Iterate over flys - for Basic-collections.
const OUString & GetName() const
SdrObject * GetMarkedSdrObj() const
PaM is Point and Mark: a selection of the document model.
SdrObject * PickObj(const Point &rPnt, short nTol, SdrPageView *&rpPV, SdrSearchOptions nOptions, SdrObject **ppRootObj, bool *pbHitPassDirect=nullptr) const
virtual void SetLayer(SdrLayerID nLayer)
static void EndUndo(SwWrtShell &rSh)
bool IsShapeDefaultHoriTextDirR2L() const
Is default horizontal text direction for selected drawing object right-to-left.
SdrDragMethod * GetDragMethod() const
TextFrameIndex MapModelToViewPos(SwPosition const &rPos) const
bool IsContentFrame() const
void MirrorAllMarkedVertical()
Only protection that cannot be withdrawn e.g.
const SwSortedObjs * GetSortedObjs() const
bool GetObjAttr(SfxItemSet &rSet) const
Attention: Ambiguities if multiple selections.
const SwPosition * GetPoint() const
SwIndex & Assign(SwIndexReg *, sal_Int32)
bool IsSelContainsControl() const
check whether selected frame contains a control; companion method to GetSelFrameType, used for preventing drag&drop of controls into header
SwPageFrame * FindPageFrame()
bool IsMarkedObjHit(const Point &rPnt, short nTol=-2) const
const SdrObject * GetBestObject(bool bNext, GotoObjFlags eType, bool bFlat=true, const svx::ISdrObjectFilter *pFilter=nullptr)
const SwFrame * Lower() const
SwContentNode * GetContentNode()
void SelectionHasChanged(SwFEShell *pShell)
const SdrMarkList & GetMarkedObjectList() const
FrameTypeFlags
values can be combined via logical or
sal_uInt16 GetHtmlMode(const SwDocShell *pShell)
std::pair< SwTextNode *, sal_Int32 > MapViewToModel(MergedPara const &, TextFrameIndex nIndex)
const SdrPage * GetPage(sal_uInt16 nPgNum) const
SwLayoutFrame * GetUpper()
virtual const SwDrawModel * GetDrawModel() const =0
Draw Model and id accessors.
void SetMergedItemSetAndBroadcast(const SfxItemSet &rSet, bool bClearAllItems=false)
FlyProtectFlags
values can be combined via logical or
SdrHdl * PickHandle(const Point &rPnt) const
SdrModel & getSdrModelFromSdrObject() const
sal_uInt32 GetOrdNum() const
bool IsGroupAllowed() const
bool IsGroupObject() const
bool IsContentProtected() const
void BegMarkObj(const Point &rPnt, bool bUnmark=false)
virtual void SetLogicRect(const tools::Rectangle &rRect)
void CreateDefaultShape(SdrObjKind eSdrObjectKind, const tools::Rectangle &rRect, sal_uInt16 nSlotId)
bool IsResizeProtect() const
SdrDragMode GetDragMode() const
void SetCalcFieldValueHdl(Outliner *pOutliner)
void MergeValues(const SfxItemSet &rSet)
void MoveMark(const Point &rPos)
void SelectionToTop(bool bTop=true)
Move selection upwards or downwards (Z-Order).
bool IsProtect() const
Is node in something that is protected (range, frame, table cells ...
RndStdIds GetAnchorId() const
Anchor type of selected object, RndStdIds::UNKNOWN if ambiguous or in case of frame selection...
A page of the document layout.
virtual SdrObject * RemoveObject(size_t nObjNum)
SdrAngleItem makeSdrCircStartAngleItem(Degree100 nAngle)
stay with the cursor inside text
static void SetSearchLabel(const SearchLabel &rSL)
const tools::Rectangle & GetAllMarkedRect() const
FlyProtectFlags IsSelObjProtected(FlyProtectFlags eType) const
Which Protection is set at selected object?
virtual SdrInventor GetObjInventor() const
void MovMarkPoints(const Point &rPnt)
virtual SdrLayerID GetHellId() const =0
SwSectionFrame * FindSctFrame()
virtual SdrLayerID GetLayer() const
static bool LessY(Point const &aPt1, Point const &aPt2, bool bOld)
SAL_DLLPRIVATE void ScrollTo(const Point &rPt)
SAL_DLLPRIVATE bool ImpEndCreate()
bool ShouldObjectBeSelected(const Point &rPt)
Test if there is a draw object at that position and if it should be selected.
const basegfx::B2DPolyPolygon & GetLineEnd() const
SdrLayerID GetLayerId() const
1 Heaven, 0 Hell, SDRLAYER_NOTFOUND Ambiguous.
void append(const B2DPolygon &rPolygon, sal_uInt32 nCount=1)
bool GotoObj(bool bNext, GotoObjFlags eType=GotoObjFlags::DrawAny)
virtual const tools::Rectangle & GetLastBoundRect() const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
void Bottom(const tools::Long nBottom)
SwTextNode is a paragraph in the document model.
void MoveCreate(const Point &rPos)
void setClosed(bool bNew)
SwFlyFrame * GetFlyFrame()
bool IsMarkPoints() const
void Drag(const Point *pPt, bool bProp)
bool IsMirrorAllowed(bool b45Deg=false, bool b90Deg=false) const
tools::Rectangle SVRect() const
void ScrollMDI(SwViewShell const *pVwSh, const SwRect &rRect, sal_uInt16 nRangeX, sal_uInt16 nRangeY)
SwDrawView * GetDrawView()
general base class for all free-flowing frames
virtual SwFrameFormat & GetFrameFormat()=0
SwTextFrame * FindMaster() const
sal_uInt16 GetPhyPageNum() const
SwFlyFrame * GetFlyFromMarked(const SdrMarkList *pLst, SwViewShell *pSh)
static bool LessX(Point const &aPt1, Point const &aPt2, bool bOld)
sal_Int32 GetIndex() const
const SfxItemSet & GetMergedItemSet() const
SAL_DLLPRIVATE void ChangeOpaque(SdrLayerID nLayerId)
bool IsInside(const Point &rPOINT) const
bool IsNoTextFrame() const
void AdjustMarkHdl(SfxViewShell *pOtherShell=nullptr)
sal_uInt16 GetHitTolerancePixel() const
bool IsRightToLeft() const
void Top(const tools::Long nTop)
void EndTextEdit()
Deletes object if required.
SwFlyFrame * GetNextLink() const
size_t IsObjSelected() const
bool SelectObj(const Point &rSelPt, sal_uInt8 nFlag=0, SdrObject *pObj=nullptr)
If an object has been given, exactly this object is selected (instead of searching over position)...
bool IsScrollMDI(SwViewShell const *pVwSh, const SwRect &rRect)
const SwFrameFormat * SelFlyGrabCursor()
If a fly is selected, it draws cursor into the first ContentFrame.
const Point & GetAnchorPos() const
void SetObjAttr(const SfxItemSet &rSet)
SdrObject * getParentSdrObjectFromSdrObject() const
void SetDragMode(SdrDragMode eSdrDragMode)
Set DragMode (e.g. Rotate), but do nothing when frame is selected.
SdrPageView * GetSdrPageView() const
const SwContentFrame * FindAnchor(const SwFrame *pOldAnch, const Point &rNew, const bool bBody=false)
search an anchor for paragraph bound frames starting from pOldAnch
sal_uInt16 GetMarkHdlSizePixel() const
bool BeginMark(const Point &rPos)
Functions for Rubberbox, it selects Draw-Objects.
void Unchain(SwFrameFormat &rFormat)
const SfxItemPool & GetItemPool() const
virtual void NbcSetAnchorPos(const Point &rPnt)
virtual bool includeObject(const SdrObject &i_rObject) const =0
bool MarkObj(const Point &rPnt, short nTol=-2, bool bToggle=false, bool bDeep=false)
virtual void MarkListHasChanged() override
#define SW_ALLOW_TEXTBOX
Allow SwFEShell::SelectObj() to select the TextBox of a shape.
bool IsObjSameLevelWithMarked(const SdrObject *pObj) const
virtual void MakeSelVisible() override
Show current selection (frame / draw object as required).
bool IsObjSelectable(const Point &rPt)
The following two methods return enum SdrHdlKind.
const SwFrame * GetAnchorFrame() const
SdrObjList * getParentSdrObjListFromSdrObject() const
const OUString & GetActiveLayer() const
SdrAngleItem makeSdrCircEndAngleItem(Degree100 nAngle)
SwChainRet Chain(SwFrameFormat &rSource, const Point &rPt)
bool IsOver(const SwRect &rRect) const
Source already has a follow.
const SwContentFrame * ContainsContent() const
Checks if the frame contains one or more ContentFrame's anywhere in his subsidiary structure; if so t...
bool IsDrawCreate() const
static void lcl_NotifyNeighbours(const SdrMarkList *pLst)
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...
sal_uInt16 getHitTolLog() const
void Height(tools::Long nNew)
SdrModel * GetModel() const
SwPosition MapViewToModelPos(TextFrameIndex nIndex) const
virtual void NbcSetRelativePos(const Point &rPnt)
SdrObjUserCall * GetUserCall() const
bool IsFrameSelected() const
virtual bool IsTextBox() const override
bool MoveAnchor(SwMove nDir)
bool IsMoveProtect() const
constexpr TypedWhichId< SwFormatAnchor > RES_ANCHOR(104)
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
virtual bool HasMarkablePoints() const
bool IsProtected() const
Is the Frame or rather the Section in which it lies protected?
bool EndCreate(SdrCreateCmd eSdrCreateCmd)
FrameTypeFlags GetSelFrameType() const
virtual const tools::Rectangle & GetCurrentBoundRect() const override
SdrObject * GetCurrentGroup() const
Color GetShapeBackgrd() const
SwFEShell::GetShapeBackgrd.