22#include <svx/strings.hrc>
92#include <LibreOfficeKit/LibreOfficeKitEnums.h>
96#include <svx/svxids.hrc>
97#include <osl/diagnose.h>
99#include <com/sun/star/embed/EmbedMisc.hpp>
100#include <com/sun/star/embed/Aspects.hpp>
101#include <com/sun/star/embed/XEmbeddedObject.hpp>
118 return pVirtO->GetFlyFrame();
127 (!pOldSelFly || pOldSelFly->
GetFormat() != pFlyFormat) )
148 const SwPosition* pContentAnchor = pNewDrawFormat->GetAnchor().GetContentAnchor();
180 bool bUnmark = !bAddSelect;
234 OSL_ENSURE( !bEnterGroup,
"SW_ENTER_GROUP is not supported" );
235 pDView->
MarkObj( pObj,
Imp()->GetPageView() );
242 pDView->
MarkObj( rPt, nMinMove, bAddSelect, bEnterGroup );
270 while (pMaster->IsFollow())
274 if (pMaster != pSelFly)
308 SdrObject* pShape = pShapeFormat->FindSdrObject();
310 pDView->
MarkObj(pShape,
Imp()->GetPageView(), bAddSelect, bEnterGroup);
312 pNewDrawFormat = pShapeFormat;
324 OSL_ENSURE( pTmp,
"Graphic without Fly" );
329 else if ( !pOldSelFly && bHadSelection )
332 if( bRet || !bHadSelection )
362 || ( aPt1.
getY() == aPt2.
getY() && bOld ) ) );
369 || ( aPt1.
getX() == aPt2.
getX() && bOld ) ) );
384 pFly = pVirtO->GetFlyFrame();
398 if ( RndStdIds::FLY_AS_CHAR == nAnchorId )
419 switch ( nAnchorId ) {
420 case RndStdIds::FLY_AT_PAGE:
422 OSL_ENSURE( pOld->
IsPageFrame(),
"Wrong anchor, page expected." );
427 if( pNew && pNew != pOld )
434 case RndStdIds::FLY_AT_CHAR:
436 OSL_ENSURE(pOld->
IsTextFrame(),
"Wrong anchor, text frame expected.");
468 case RndStdIds::FLY_AT_PARA:
470 OSL_ENSURE(pOld->
IsTextFrame(),
"Wrong anchor, text frame expected.");
480 (bRet && pNewFrame->
GetText().getLength() != 0)
481 ? pNewFrame->
GetText().getLength() - 1
490 case RndStdIds::FLY_AT_FLY:
492 OSL_ENSURE( pOld->
IsFlyFrame(),
"Wrong anchor, fly frame expected.");
494 OSL_ENSURE( pPage,
"Where's my page?" );
504 if(
auto pTmp = pAnchObj->DynCastFlyFrame() )
510 const SwFlyFrame* pCheck = pFly ? pTmp :
nullptr;
520 Point aNew( pTmp->getFrameArea().Left() +
521 pTmp->getFrameArea().Width()/2,
522 pTmp->getFrameArea().Top() +
523 pTmp->getFrameArea().Height()/2 );
524 bool bAccept =
false;
528 bAccept =
LessX( aCenter, aNew, bOld )
530 LessX( aNew, aBest,
false ) );
535 bAccept =
LessX( aNew, aCenter, !bOld )
537 LessX( aBest, aNew,
true ) );
542 bAccept =
LessY( aNew, aCenter, !bOld )
544 LessY( aBest, aNew,
true ) );
549 bAccept =
LessY( aCenter, aNew, bOld )
551 LessY( aNew, aBest,
false ) );
568 GetContent().GetContentIdx());
584 std::unique_ptr<SwHandleAnchorNodeChg> pHandleAnchorNodeChg;
586 if ( pFlyFrameFormat )
588 pHandleAnchorNodeChg.reset(
620 if( pMarkList ==
nullptr || pMarkList->
GetMarkCount() == 0 )
627 if ( pFly !=
nullptr )
654 if( pMarkList !=
nullptr && pMarkList->
GetMarkCount() == 1 )
666 const SwRect aRect( rPt, rPt );
669 Imp()->IsDragPossible( rPt )) )
778 ChgAnchor( RndStdIds::FLY_AT_PARA,
true );
785 if(
auto pCursorShell =
dynamic_cast<SwCursorShell *
>(&rSh) )
786 pCursorShell->CallChgLnk();
795 OSL_ENSURE(
Imp()->
HasDrawView(),
"BreakDrag without DrawView?" );
853 bool bCheckNeighbours =
false;
866 bCheckNeighbours =
true;
869 aFrm.
Pos().AdjustY(1 );
895 if ( aRect.
Overlaps( aTmpCalcPnt ) )
902 if ( aRect.
Overlaps( aTmpCalcPnt ) )
916 aFrm.
Pos().AdjustY(1 );
930 OSL_ENSURE(
Imp()->
HasDrawView(),
"SelectionToTop without DrawView?" );
932 OSL_ENSURE( rMrkList.
GetMarkCount(),
"No object selected." );
956 = pFormat->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel())
959 if (
auto pPage = pDrwModel->GetPage(0))
971 sal_uInt32 nShift = 0;
973 const auto pNextObj = pPage->SetObjectOrdNum(pObj->GetOrdNum() + 1, pObj->GetOrdNum() + 1);
987 pPage->SetObjectOrdNum(pObj->GetOrdNum(), pObj->GetOrdNum() + nShift);
999 OSL_ENSURE(
Imp()->
HasDrawView(),
"SelectionToBottom without DrawView?" );
1001 OSL_ENSURE( rMrkList.
GetMarkCount(),
"No object selected." );
1025 = pFormat->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel())
1026 if (
auto pPage = pDrwModel->GetPage(0))
1028 const auto pNextObj = pPage->SetObjectOrdNum(pObj->GetOrdNum() - 1, pObj->GetOrdNum() - 1);
1036 pPage->SetObjectOrdNum(pObj->GetOrdNum(), pObj->GetOrdNum() - 1);
1063 else if ( nRet != pObj->
GetLayer() )
1092 OSL_ENSURE( pContact && pContact->
GetMaster(),
"<SwFEShell::ChangeOpaque(..)> - missing contact or missing master object at contact!" );
1093 const bool bControlObj = ( pContact && pContact->
GetMaster() )
1096 if ( !bControlObj && pObj->
GetLayer() != nLayerId )
1102 SwFormat *pFormat = pVirtO->GetFlyFrame()->GetFormat();
1104 aOpa.SetValue( nLayerId == rIDDMA.
GetHellId() );
1163 if(
nullptr != pVirtFlyDraw)
1200 "EndTextEdit a no Object" );
1206 if(
nullptr != pUserCall )
1215 if ( SdrEndTextEditKind::ShouldBeDeleted == pView->
SdrEndTextEdit(
true) )
1224 pView->
MarkObj( pObj,
Imp()->GetPageView() );
1269 bRet = pDView->
PickObj(rPt, pDView->
getHitTolLog(), pPV, SdrSearchOptions::PICKMARKABLE) !=
nullptr;
1315 bool bObjInBackground(
false );
1322 if ( rSurround.
GetSurround() == css::text::WrapTextMode_THROUGH )
1324 bObjInBackground =
true;
1328 if ( bObjInBackground )
1334 while ( pContentFrame )
1342 Point aTmpPt( rPt );
1383 for(
size_t a = pObj->
GetOrdNum()+1; bRet && a < pPage->GetObjCount(); ++
a)
1409 if(
dynamic_cast<const SdrUnoObj*
>( pObj) !=
nullptr)
1411 else if(
auto pObjGroup =
dynamic_cast<const SdrObjGroup*
>( pObj) )
1414 const SdrObjList *pLst = pObjGroup->GetSubList();
1427 explicit MarkableObjectsOnly(
SdrPageView* i_pPV )
1434 return m_pPV && m_pPV->GetView().IsObjMarkable( &i_rObject, m_pPV );
1456 Point aBestPos( nTmp, nTmp );
1457 Point aTopPos( nTmp, nTmp );
1463 if( !bNoFly && bNoDraw )
1472 MarkableObjectsOnly aDefaultFilter( pPV );
1474 pFilter = &aDefaultFilter;
1483 if(
auto pVirtFlyDrawObj =
dynamic_cast<const SwVirtFlyDrawObj*
>( pStartObj) )
1484 aPos = pVirtFlyDrawObj->GetFlyFrame()->getFrameArea().Pos();
1499 if (
dynamic_cast<const SdrObjGroup*
>( pStartObj) )
1511 OSL_ENSURE( pList,
"No object list to iterate" );
1513 SdrObjListIter aObjIter( pList, bFlat ? SdrIterMode::Flat : SdrIterMode::DeepNoGroups );
1514 while ( aObjIter.
IsMore() )
1518 if( ( bNoFly && pVirtO ) ||
1519 ( bNoDraw && !pVirtO ) ||
1540 if ( pFly->
Lower() &&
1546 if ( pFly->
Lower() &&
1560 if( aCurPos != aPos &&
1562 (bNext? (aCurPos.
getX() > aPos.
getX()) :
1565 aBestPos =
Point( nTmp, nTmp );
1566 SdrObjListIter aTmpIter( pList, bFlat ? SdrIterMode::Flat : SdrIterMode::DeepNoGroups );
1567 while ( aTmpIter.
IsMore() )
1571 if( ( bNoFly && pVirtO ) || ( bNoDraw && !pVirtO ) )
1580 if( aCurPos != aPos && aCurPos.
Y() == aPos.
Y() &&
1581 (bNext? (aCurPos.
getX() > aPos.
getX()) :
1583 (bNext? (aCurPos.
getX() < aBestPos.
getX()) :
1584 (aCurPos.
getX() > aBestPos.
getX())) )
1594 (bNext? (aPos.
getY() < aCurPos.
getY()) :
1596 (bNext? (aBestPos.
getY() > aCurPos.
getY()) :
1597 (aBestPos.
getY() < aCurPos.
getY()))
1599 (aBestPos.
getY() == aCurPos.
getY() &&
1600 (bNext? (aBestPos.
getX() > aCurPos.
getX()) :
1601 (aBestPos.
getX() < aCurPos.
getX()))))
1608 if( (bNext? (aTopPos.
getY() > aCurPos.
getY()) :
1609 (aTopPos.
getY() < aCurPos.
getY())) ||
1610 (aTopPos.
getY() == aCurPos.
getY() &&
1611 (bNext? (aTopPos.
getX() > aCurPos.
getX()) :
1612 (aTopPos.
getX() < aCurPos.
getX()))))
1622 if (pbWrapped && pBest)
1634 bool bWrapped(
false);
1661 SearchLabel::StartWrapped);
1676 if ( eSdrObjectKind == SdrObjKind::Caption )
1710 OSL_ENSURE(
Imp()->
HasDrawView(),
"MoveCreate without DrawView?" );
1723 OSL_ENSURE(
Imp()->
HasDrawView(),
"EndCreate without DrawView?" );
1737 if ( eSdrCreateCmd == SdrCreateCmd::NextPoint )
1747 if (
Imp()->
GetDrawView()->GetMarkedObjectList().GetMarkCount() == 0)
1782 const SwFrame *pAnch =
nullptr;
1783 bool bCharBound =
false;
1784 if(
dynamic_cast<const SdrUnoObj*
>( &rSdrObj) !=
nullptr )
1794 std::pair<Point, bool>
const tmp(aPoint,
true);
1818 aAnch.
SetType( RndStdIds::FLY_AS_CHAR );
1831 bool bBodyOnly = SdrInventor::Default != rSdrObj.
GetObjInventor();
1832 bool bAtPage =
false;
1833 const SwFrame* pPage =
nullptr;
1835 Point aPoint( aPt );
1848 std::pair<Point, bool>
const tmp(aPoint,
false);
1861 const SwFrame* pTmpFrame = pAnch;
1886 std::pair<SwTextNode const*, sal_Int32>
const pos(
1902 aAnch.
SetType( RndStdIds::FLY_AT_PARA );
1911 aAnch.
SetType( RndStdIds::FLY_AT_PAGE );
1927 nXOffset = nYOffset;
1937 if (pTmp->IsFollow())
1941 OSL_ENSURE(pTmp,
"Where's my Master?");
1946 }
while (pTmp->IsFollow());
1968 const SwRect aFlyRect( rBound );
1978 auto pNewPage = pTmpSdrModel->
AllocPage(
false );
1980 pPg = pNewPage.get();
1993 const bool bLeftFrame = aFlyRect.
Left() <
1995 bLeftPrt = aFlyRect.
Left() + aFlyRect.
Width() <
1997 if( bLeftFrame || bLeftPrt )
2000 aHori.
SetRelationOrient( bLeftFrame ? text::RelOrientation::FRAME : text::RelOrientation::PRINT_AREA );
2004 const bool bRightFrame = aFlyRect.
Left() >
2007 aHori.
SetRelationOrient( bRightFrame ? text::RelOrientation::FRAME : text::RelOrientation::PRINT_AREA );
2009 aHtmlSet.
Put( aHori );
2012 aHtmlSet.
Put( aVert );
2019 if (rSdrObj.
GetName().isEmpty())
2038 assert(pTmp &&
"Where's my Master?");
2041 }
while ( pTmp->IsFollow() );
2048 text::PositionLayoutDir::PositionInLayoutDirOfAnchor );
2058 OSL_ENSURE( aAnch.
GetAnchorId() == RndStdIds::FLY_AS_CHAR,
"wrong AnchorType" );
2064 aVertical.SetVertOrient( text::VertOrientation::LINE_CENTER );
2072 OSL_ENSURE( pTmp,
"Where's my Master?" );
2073 }
while( pTmp->IsFollow() );
2103 OSL_ENSURE(
Imp()->
HasDrawView(),
"BreakCreate without DrawView?" );
2136 OSL_ENSURE(
Imp()->
HasDrawView(),
"MoveMark without DrawView?" );
2163 bool bShowHdl =
false;
2220 nRet = RndStdIds::UNKNOWN;
2227 else if ( nRet !=
nId )
2229 nRet = RndStdIds::UNKNOWN;
2235 nRet = RndStdIds::UNKNOWN;
2241 OSL_ENSURE(
Imp()->
HasDrawView(),
"ChgAnchor without DrawView?" );
2259 OSL_ENSURE(
Imp()->
HasDrawView(),
"DelSelectedObj(), no DrawView available" );
2286 OSL_ENSURE( pView,
"GetAnchorObjDiff without DrawView?" );
2314 OSL_ENSURE(
Imp()->
GetDrawView(),
"GetObjAbsPos() without DrawView?" );
2352 bool HasSuitableGroupingAnchor(
const SdrObject* pObj)
2354 bool bSuitable =
true;
2358 OSL_FAIL(
"<HasSuitableGroupingAnchor> - missing frame format" );
2361 else if (RndStdIds::FLY_AS_CHAR == pFrameFormat->GetAnchor().GetAnchorId())
2375 bool bIsGroupAllowed =
false;
2378 bIsGroupAllowed =
true;
2380 const SwFrame* pHeaderFooterFrame =
nullptr;
2382 for (
size_t i = 0; bIsGroupAllowed &&
i < rMrkList.
GetMarkCount(); ++
i )
2390 if ( bIsGroupAllowed )
2391 bIsGroupAllowed = HasSuitableGroupingAnchor(pObj);
2395 if ( bIsGroupAllowed )
2397 const SwFrame* pAnchorFrame =
nullptr;
2400 const SwFlyFrame* pFlyFrame = pVirtFlyDrawObj->GetFlyFrame();
2430 return bIsGroupAllowed;
2435 bool bIsUnGroupAllowed =
false;
2441 bIsUnGroupAllowed = HasSuitableGroupingAnchor(pObj);
2442 if (!bIsUnGroupAllowed)
2446 return bIsUnGroupAllowed;
2562 FlyCntType const eType,
bool const bIgnoreTextBoxes)
2610 uno::Reference < embed::XEmbeddedObject > xObj( pNd ? pNd->
GetOLEObj().
GetOleRef() :
nullptr );
2614 const bool bNeverResize = (embed::EmbedMisc::EMBED_NEVERRESIZE & xObj->getStatus( embed::Aspects::MSOLE_CONTENT ));
2636 pAnch = pVirtO->GetFlyFrame()->GetAnchorFrame();
2660 OSL_ENSURE( pContact,
"<SwFEShell::GetObjAttr(..)> - missing <pContact>." );
2678 OSL_ENSURE(
false,
"SetObjAttr, empty set." );
2725 OSL_ENSURE( pPage,
"Page not found." );
2733 aAnch.
SetType( RndStdIds::FLY_AT_PARA );
2765 const Point &rPt )
const
2841 bool bDelFrom =
true,
2892 if( pFrame && pFrame->
IsInSct() )
2908 if( !pSct->IsFollow() )
2910 return pSct->getFrameArea().Width();
2923 SdrInventor::Default,
2929 if(SdrObjKind::CircleArc == eSdrObjectKind || SdrObjKind::CircleCut == eSdrObjectKind)
2945 pObj->SetLogicRect(aRect);
2950 if(
dynamic_cast<const SdrCircObj*
>( pObj.get()) !=
nullptr)
2955 pObj->SetMergedItemSet(aAttr);
2957 else if(
auto pPathObj =
dynamic_cast<SdrPathObj*
>( pObj.get()))
2961 switch(eSdrObjectKind)
2963 case SdrObjKind::PathLine:
2964 case SdrObjKind::PathFill:
2983 aPoly.
append(aInnerPoly);
2986 case SdrObjKind::FreehandLine:
2987 case SdrObjKind::FreehandFill:
3005 aPoly.
append(aInnerPoly);
3008 case SdrObjKind::Polygon:
3009 case SdrObjKind::PolyLine:
3024 if(SdrObjKind::PolyLine == eSdrObjectKind)
3033 aPoly.
append(aInnerPoly);
3036 case SdrObjKind::Line :
3038 sal_Int32 nYMiddle((aRect.
Top() + aRect.
Bottom()) / 2);
3044 SfxItemSet aAttr(pObj->getSdrModelFromSdrObject().GetItemPool());
3046 pObj->SetMergedItemSet(aAttr);
3053 pPathObj->SetPathPoly(aPoly);
3055 else if(
auto pMeasureObj =
dynamic_cast<SdrMeasureObj*
>( pObj.get()))
3057 sal_Int32 nYMiddle((aRect.
Top() + aRect.
Bottom()) / 2);
3058 pMeasureObj->SetPoint(
Point(aStart.
X(), nYMiddle), 0);
3059 pMeasureObj->SetPoint(
Point(aEnd.
X(), nYMiddle), 1);
3061 SfxItemSet aAttr(pObj->getSdrModelFromSdrObject().GetItemPool());
3063 pObj->SetMergedItemSet(aAttr);
3065 else if(
auto pCaptionObj =
dynamic_cast<SdrCaptionObj*
>( pObj.get()))
3067 bool bVerticalText = ( SID_DRAW_TEXT_VERTICAL == nSlotId ||
3068 SID_DRAW_CAPTION_VERTICAL == nSlotId );
3069 pCaptionObj->SetVerticalWriting(bVerticalText);
3075 pObj->SetMergedItemSet(aSet);
3078 pCaptionObj->SetLogicRect(aRect);
3079 pCaptionObj->SetTailPos(
3084 pText->SetLogicRect(aRect);
3086 bool bVertical = (SID_DRAW_TEXT_VERTICAL == nSlotId);
3087 bool bMarquee = (SID_DRAW_TEXT_MARQUEE == nSlotId);
3089 pText->SetVerticalWriting(bVertical);
3098 pText->SetMergedItemSet(aSet);
3110 pObj->SetMergedItemSetAndBroadcast(aSet);
3139 OSL_ENSURE(
Imp()->
GetDrawView(),
"wrong usage of SwFEShell::GetShapeBackground - no draw view!");
3145 OSL_ENSURE( pMrkList->
GetMarkCount() == 1,
"wrong usage of SwFEShell::GetShapeBackground - no selected object!");
3151 OSL_ENSURE(
dynamic_cast<const SwVirtFlyDrawObj*
>( pSdrObj) ==
nullptr,
"wrong usage of SwFEShell::GetShapeBackground - selected object is not a drawing object!");
3157 OSL_ENSURE( pAnchorFrame,
"inconsistent model - no anchor at shape!");
3161 OSL_ENSURE( pPageFrame,
"inconsistent model - no page!");
3187 OSL_ENSURE(
Imp()->
GetDrawView(),
"wrong usage of SwFEShell::GetShapeBackground - no draw view!");
3193 OSL_ENSURE( pMrkList->
GetMarkCount() == 1,
"wrong usage of SwFEShell::GetShapeBackground - no selected object!");
3199 OSL_ENSURE(
dynamic_cast<const SwVirtFlyDrawObj*
>( pSdrObj) ==
nullptr,
"wrong usage of SwFEShell::GetShapeBackground - selected object is not a drawing object!");
3205 OSL_ENSURE( pAnchorFrame,
"inconsistent model - no anchor at shape!");
3209 OSL_ENSURE( pPageFrame,
"inconsistent model - no page!");
@ MATH_BASELINE_ALIGNMENT
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...
static void SetLineEnds(SfxItemSet &rAttr, const SdrObject &rObj, sal_uInt16 nSlotId, tools::Long nWidth)
virtual void MovAction(const Point &rPnt) override
virtual SwDrawModel * GetOrCreateDrawModel()=0
virtual SdrLayerID GetHellId() const =0
virtual const SwDrawModel * GetDrawModel() const =0
Draw Model and id accessors.
virtual SwFrameFormat * MakeLayoutFormat(RndStdIds eRequest, const SfxItemSet *pSet)=0
virtual void SetModified()=0
Must be called manually at changes of format.
SAL_WARN_UNUSED_RESULT Point PixelToLogic(const Point &rDevicePt) const
constexpr tools::Long Y() const
void setX(tools::Long nX)
constexpr tools::Long X() const
constexpr tools::Long getX() const
constexpr tools::Long getY() const
bool BegCreateObj(const Point &rPnt, OutputDevice *pOut=nullptr, short nMinMov=-3)
void SetEditMode(SdrViewEditMode eMode)
static void SetupObjLayer(const SdrPageView *pPageView, const OUString &aActiveLayer, SdrObject *pObj)
bool EndCreateObj(SdrCreateCmd eCmd)
void SetCurrentObj(SdrObjKind nIdent, SdrInventor nInvent=SdrInventor::Default)
virtual void TakeActionRect(tools::Rectangle &rRect) const override
bool BegCreateCaptionObj(const Point &rPnt, const Size &rObjSiz, OutputDevice *pOut=nullptr, short nMinMov=-3)
void MovCreateObj(const Point &rPnt)
void SetShiftPressed(bool bShiftPressed)
const tools::Rectangle & GetActionRect() const
SdrDragMethod * GetDragMethod() const
bool EndDragObj(bool bCopy=false)
virtual bool BegDragObj(const Point &rPnt, OutputDevice *pOut, SdrHdl *pHdl, short nMinMov=-3, SdrDragMethod *pForcedMeth=nullptr)
bool IsInsObjPoint() const
void MovInsObjPoint(const Point &rPnt)
void MovDragObj(const Point &rPnt)
void MirrorAllMarkedVertical()
bool InsertObjectAtView(SdrObject *pObj, SdrPageView &rPV, SdrInsertFlags nOptions=SdrInsertFlags::NONE)
void MirrorAllMarkedHorizontal()
bool IsAlignPossible() const
bool IsMirrorAllowed(bool b45Deg=false, bool b90Deg=false) const
size_t FindObject(const SdrObject *pObj) const
size_t GetMarkCount() const
SdrMark * GetMark(size_t nNum) const
void DeleteMark(size_t nNum)
void SetDragMode(SdrDragMode eMode)
SdrHdl * PickHandle(const Point &rPnt) const
bool IsObjMarked(SdrObject const *pObj) const
bool IsMarkPoints() const
const SdrMarkList & GetMarkedObjectList() const
bool IsMarkedObjHit(const Point &rPnt, short nTol=-2) const
bool AreObjectsMarked() const
void BegMarkObj(const Point &rPnt, bool bUnmark=false)
bool BegMarkPoints(const Point &rPnt, bool bUnmark=false)
SdrObject * PickObj(const Point &rPnt, short nTol, SdrPageView *&rpPV, SdrSearchOptions nOptions, SdrObject **ppRootObj, bool *pbHitPassDirect=nullptr) const
SdrDragMode GetDragMode() const
sal_uInt16 GetMarkHdlSizePixel() const
void MovMarkPoints(const Point &rPnt)
virtual bool HasMarkablePoints() const
void AdjustMarkHdl(SfxViewShell *pOtherShell=nullptr)
const tools::Rectangle & GetAllMarkedRect() const
bool MarkObj(const Point &rPnt, short nTol=-2, bool bToggle=false, bool bDeep=false)
SdrObject * GetMarkedSdrObj() const
virtual void InsertPage(SdrPage *pPage, sal_uInt16 nPos=0xFFFF)
virtual rtl::Reference< SdrPage > AllocPage(bool bMasterPage)
const SfxItemPool & GetItemPool() const
const SdrPage * GetPage(sal_uInt16 nPgNum) const
SdrTextObj * GetTextEditObject() const
virtual SdrEndTextEditKind SdrEndTextEdit(bool bDontDeleteReally=false)
static rtl::Reference< SdrObject > MakeNewObject(SdrModel &rSdrModel, SdrInventor nInventor, SdrObjKind nObjIdentifier, const tools::Rectangle *pSnapRect=nullptr)
SdrObject * GetObj(size_t nNum) const
size_t GetObjCount() const
virtual rtl::Reference< SdrObject > RemoveObject(size_t nObjNum)
virtual void Changed(const SdrObject &rObj, SdrUserCallType eType, const tools::Rectangle &rOldBoundRect)
sal_uInt32 GetOrdNumDirect() const
virtual void NbcSetAnchorPos(const Point &rPnt)
bool IsResizeProtect() const
SdrObjUserCall * GetUserCall() const
const Point & GetAnchorPos() const
bool IsMoveProtect() const
virtual void NbcSetRelativePos(const Point &rPnt)
virtual SdrInventor GetObjInventor() const
sal_uInt32 GetOrdNum() const
virtual SdrObjList * GetSubList() const
virtual const tools::Rectangle & GetCurrentBoundRect() const
SdrObjList * getParentSdrObjListFromSdrObject() const
virtual const tools::Rectangle & GetSnapRect() const
virtual const OUString & GetName() const
bool IsGroupObject() const
virtual SdrObjKind GetObjIdentifier() const
virtual const tools::Rectangle & GetLastBoundRect() const
SdrObject * getParentSdrObjectFromSdrObject() const
virtual SdrLayerID GetLayer() const
virtual void SetLayer(SdrLayerID nLayer)
SdrObject * GetCurrentGroup() const
sal_uInt16 GetHitTolerancePixel() const
void SetHitTolerancePixel(sal_uInt16 nVal)
const SdrDragStat & GetDragStat() const
SdrPageView * GetSdrPageView() const
SdrModel & GetModel() const
sal_uInt16 getHitTolLog() const
const OUString & GetActiveLayer() const
void MergeValues(const SfxItemSet &rSet)
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
static void notifyOtherViews(const SfxViewShell *pThisView, int nType, std::string_view rKey, const OString &rPayload)
static sal_uInt16 IsMath(const SvGlobalName &rName)
bool IsContentProtected() const
static void SetSearchLabel(const SearchLabel &rSL)
wrapper class for the positioning of Writer fly frames and drawing objects
const SwFrame * GetAnchorFrame() const
void ClearCharRectAndTopOfLine()
reset members <maLastCharRect> and <mnLastTopOfLine>
virtual SwFrameFormat & GetFrameFormat()=0
virtual const SwFlyFrame * DynCastFlyFrame() const
SwContentFrame is the layout for content nodes: a common base class for text (paragraph) and non-text...
SwContentFrame * GetNextContentFrame() const
SwTextFrame * FindMaster() const
SwContentFrame * getLayoutFrame(const SwRootFrame *, const SwPosition *pPos=nullptr, std::pair< Point, bool > const *pViewPosAndCalcFrame=nullptr) const
bool IsReadOnlyAvailable() const
const SwRect & GetCharRect() const
Point & GetCursorDocPos() const
void SetSelection(const SwPaM &rCursor)
int SetCursor(const Point &rPt, bool bOnlyText=false, bool bBlock=true)
SwCursor * GetCursor(bool bMakeTableCursor=true) const
Return pointer to the current shell cursor.
void EndAction(const bool bIdleEnd=false)
SwContentFrame * GetCurrFrame(const bool bCalcFrame=true) const
Get current frame in which the cursor is positioned.
const Link< const SwFlyFrameFormat *, void > & GetFlyMacroLnk() const
virtual void MakeSelVisible()
show the current selected "object"
SwChainRet Chainable(const SwFrameFormat &rSource, const SwFrameFormat &rDest)
IDocumentState const & getIDocumentState() const
SwChainRet Chain(SwFrameFormat &rSource, const SwFrameFormat &rDest)
SwFrameFormat * GetFlyNum(size_t nIdx, FlyCntType eType, bool bIgnoreTextBoxes=false)
void Unchain(SwFrameFormat &rFormat)
void SetAttr(const SfxPoolItem &, SwFormat &)
Set attribute in given format.1y If Undo is enabled, the old values is added to the Undo history.
std::vector< SwFrameFormat const * > GetFlyFrameFormats(FlyCntType eType, bool bIgnoreTextBoxes)
IDocumentUndoRedo & GetIDocumentUndoRedo()
size_t GetFlyCount(FlyCntType eType, bool bIgnoreTextBoxes=false) const
Access to frames.
SwDrawContact * GroupSelection(SdrView &)
void UnGroupSelection(SdrView &)
void SetCalcFieldValueHdl(Outliner *pOutliner)
In the Outliner, set a link to the method for field display in edit objects.
bool IsInHeaderFooter(const SwNode &) const
virtual void MarkListHasChanged() override
virtual void DeleteMarked() override
sal_uInt16 GetCntType() const
Determine form of content. Return Type at CurrentCursor->SPoint.
void StartAllAction()
For all views of this document.
SwUndoId StartUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Undo: set up Undo parenthesis, return nUndoId of this parenthesis.
SwUndoId EndUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Closes parenthesis of nUndoId, not used by UI.
SwFlyFrame * GetSelectedFlyFrame() const
void Unchain(SwFrameFormat &rFormat)
void Drag(const Point *pPt, bool bProp)
void SelectionToHell()
Below document.
void SetObjAttr(const SfxItemSet &rSet)
Point GetAnchorObjDiff() const
Methods for status line.
FlyProtectFlags IsSelObjProtected(FlyProtectFlags eType) const
Which Protection is set at selected object?
std::vector< SwFrameFormat const * > GetFlyFrameFormats(FlyCntType eType, bool bIgnoreTextBoxes)
SdrDragMode GetDragMode() const
bool IsObjSameLevelWithMarked(const SdrObject *pObj) const
RndStdIds GetAnchorId() const
Anchor type of selected object, RndStdIds::UNKNOWN if ambiguous or in case of frame selection.
SAL_DLLPRIVATE bool ImpEndCreate()
bool BeginMark(const Point &rPos)
Functions for Rubberbox, it selects Draw-Objects.
bool ShouldObjectBeSelected(const Point &rPt)
Test if there is a draw object at that position and if it should be selected.
const SwFrameFormat * SelFlyGrabCursor()
If a fly is selected, it draws cursor into the first ContentFrame.
void SelectionToHeaven()
Above document.
bool IsFrameSelected() const
void GroupSelection()
Afterwards the group is selected.
bool GotoObj(bool bNext, GotoObjFlags eType=GotoObjFlags::DrawAny)
bool IsRotationOfSwGrfNodePossible() const
const SwFrameFormat * GetFlyNum(size_t nIdx, FlyCntType eType, bool bIgnoreTextBoxes=false) const
virtual void MakeSelVisible() override
Show current selection (frame / draw object as required).
bool MoveAnchor(SwMove nDir)
FrameTypeFlags GetSelFrameType() const
void SelectionToTop(bool bTop=true)
Move selection upwards or downwards (Z-Order).
void SelectionToBottom(bool bBottom=true)
bool IsObjSelectable(const Point &rPt)
The following two methods return enum SdrHdlKind.
void ChgAnchor(RndStdIds eAnchorId, bool bSameOnly=false, bool bPosCorr=true)
frmatr.hxx.
SAL_DLLPRIVATE void EndAllActionAndCall()
Terminate actions for all shells and call ChangeLink.
std::unique_ptr< SdrDropMarkerOverlay > m_pChainTo
bool GotoFly(const OUString &rName, FlyCntType eType, bool bSelFrame)
Jump to named Fly (graphic/OLE).
SdrObject * GetObjAt(const Point &rPt)
Same as IsObjSelectable(), but return the object as well.
bool BeginCreate(SdrObjKind eSdrObjectKind, const Point &rPos)
Process of creating draw objects.
SAL_DLLPRIVATE void ScrollTo(const Point &rPt)
bool IsSelContainsControl() const
check whether selected frame contains a control; companion method to GetSelFrameType,...
SAL_DLLPRIVATE const SdrMarkList * GetMarkList_() const
Get list of marked SdrObjects; helper method for GetSelFrameType, IsSelContainsControl.
SAL_DLLPRIVATE void ChangeOpaque(SdrLayerID nLayerId)
bool GetObjAttr(SfxItemSet &rSet) const
Attention: Ambiguities if multiple selections.
void CheckUnboundObjects()
Temporary work around for bug.
const SwFrameFormat * NewFlyFrame(const SfxItemSet &rSet, bool bAnchValid=false, SwFrameFormat *pParent=nullptr)
size_t GetFlyCount(FlyCntType eType, bool bIgnoreTextBoxes=false) const
Iterate over flys - for Basic-collections.
bool IsGroupSelected(bool bAllowDiagams)
Create and destroy group, don't when frame is selected.
void SetDragMode(SdrDragMode eSdrDragMode)
Set DragMode (e.g. Rotate), but do nothing when frame is selected.
bool EndCreate(SdrCreateCmd eSdrCreateCmd)
Point GetObjAbsPos() const
void CreateDefaultShape(SdrObjKind eSdrObjectKind, const tools::Rectangle &rRect, sal_uInt16 nSlotId)
void MirrorSelection(bool bHorizontal)
Vertical if FALSE.
sal_uInt16 GetPhyPageNum() const
Phy: real page count.
void SetCalcFieldValueHdl(Outliner *pOutliner)
bool IsDrawCreate() const
SdrLayerID GetLayerId() const
1 Heaven, 0 Hell, SDRLAYER_NOTFOUND Ambiguous.
SwChainRet Chain(SwFrameFormat &rSource, const Point &rPt)
const SdrObject * GetBestObject(bool bNext, GotoObjFlags eType, bool bFlat=true, const svx::ISdrObjectFilter *pFilter=nullptr, bool *pbWrapped=nullptr)
bool IsUnGroupAllowed() const
void EndTextEdit()
Deletes object if required.
std::unique_ptr< SdrDropMarkerOverlay > m_pChainFrom
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).
void MoveCreate(const Point &rPos)
void MoveMark(const Point &rPos)
void BeginDrag(const Point *pPt, bool bProp)
void UnGroupSelection()
The individual objects are selected, but it is possible that there are groups included.
bool IsAlignPossible() const
Point GetRelativePagePosition(const Point &rDocPos)
Convert document position into position relative to the current page.
SwChainRet Chainable(SwRect &rRect, const SwFrameFormat &rSource, const Point &rPt) const
For Chain always connect Fly specified by format with that hit by point.
bool IsInsideSelectedObj(const Point &rPt)
returns enum values
tools::Long GetSectionWidth(SwFormat const &rFormat) const
Width of current range for column-dialog.
sal_uInt16 GetPageNumber(const Point &rPoint) const
Page number of the page containing Point, O if no page.
bool IsGroupAllowed() const
bool IsShapeDefaultHoriTextDirR2L() const
Is default horizontal text direction for selected drawing object right-to-left.
static void SetLineEnds(SfxItemSet &rAttr, SdrObject const &rObj, sal_uInt16 nSlotId)
Color GetShapeBackground() const
SwFEShell::GetShapeBackground.
Flys that are anchored to content (at-para, at-char) but not in content (as-char).
const SwFlyAtContentFrame * GetPrecede() const
general base class for all free-flowing frames
const SwVirtFlyDrawObj * GetVirtDrawObj() const
SwFlyFrame * GetPrevLink() const
virtual const SwFlyFrameFormat * GetFormat() const override
bool IsFlyAtContentFrame() const
bool IsFlySplitAllowed() const
Is this fly allowed to split across pages? (Disabled by default.)
void SelectionHasChanged(SwFEShell *pShell)
SwFlyFrame * GetNextLink() const
bool IsFlyInContentFrame() const
bool IsFlyLayFrame() const
const SwRect & getFrameArea() const
const SwRect & getFramePrintArea() const
Base class of the Writer layout elements.
SwTextFrame * DynCastTextFrame()
SwFlyFrame * FindFlyFrame()
SwSectionFrame * FindSctFrame()
bool IsProtected() const
Is the Frame or rather the Section in which it lies protected?
bool KnowsFormat(const SwFormat &rFormat) const
bool IsRightToLeft() const
SwRect UnionFrame(bool bBorder=false) const
|* The unionframe is the framearea (getFrameArea()) of a frame expanded by the |* printarea,...
SwLayoutFrame * GetUpper()
bool IsNoTextFrame() const
bool IsContentFrame() const
SwPageFrame * FindPageFrame()
SwFrame * FindFooterOrHeader()
sal_uInt16 GetPhyPageNum() const
virtual bool GetCharRect(SwRect &, const SwPosition &, SwCursorMoveState *=nullptr, bool bAllowFarAway=true) const
const SwContentFrame * ContainsContent() const
Checks if the frame contains one or more ContentFrame's anywhere in his subsidiary structure; if so t...
const SwFrame * Lower() const
bool HasAnimation() const
const SwContentNode * GetNode() const
Base class of the Writer document model elements.
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
bool IsProtect() const
Is node in something that is protected (range, frame, table cells ... including anchor in case of fra...
SwOLENode * GetOLENode()
Inline methods from Node.hxx.
SwContentNode * GetContentNode()
const SwOLEObj & GetOLEObj() const
css::uno::Reference< css::embed::XEmbeddedObject > const & GetOleRef()
PaM is Point and Mark: a selection of the document model.
const SwPosition * GetPoint() const
A page of the document layout.
Color GetDrawBackgroundColor() const
SwPageFrame::GetDrawBackgroundColor.
const SwSortedObjs * GetSortedObjs() const
Of course Writer needs its own rectangles.
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)
bool Contains(const Point &rPOINT) const
bool Overlaps(const SwRect &rRect) const
tools::Rectangle SVRect() const
void Left(const tools::Long nLeft)
void Width(tools::Long nNew)
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 GetModelPositionForViewPoint(SwPosition *, Point &, SwCursorMoveState *=nullptr, bool bTestBackground=false) const override
Primary passes the call to the first page.
static bool DoTextBoxZOrderCorrection(SwFrameFormat *pShape, const SdrObject *pObj)
static SwFrameFormat * getOtherTextBoxFormat(const SwFrameFormat *pFormat, sal_uInt16 nType, const SdrObject *pObject=nullptr)
If we have an associated TextFrame, then return that.
static bool isTextBox(const SwFrameFormat *pFormat, sal_uInt16 nType, const SdrObject *pObject=nullptr)
Is the frame format a text box?
Represents the visualization of a paragraph.
SwPosition MapViewToModelPos(TextFrameIndex nIndex) const
SwTwips GetBaseVertOffsetForFly(bool bIgnoreFlysAnchoredAtThisFrame) const
bool GetKeyCursorOfst(SwPosition *pPos, const Point &rPoint) const
Makes sure that the Frame is not switched (e.g.
TextFrameIndex MapModelToViewPos(SwPosition const &rPos) const
virtual bool GetCharRect(SwRect &rRect, const SwPosition &rPos, SwCursorMoveState *pCMS=nullptr, bool bAllowFarAway=true) const override
Returns the view rectangle for the rPos model position.
const OUString & GetText() const
Returns the text portion we want to edit (for inline see underneath)
SwTextNode const * GetTextNodeForParaProps() const
SwTextNode is a paragraph in the document model.
SwTextAttr * InsertItem(SfxPoolItem &rAttr, const sal_Int32 nStart, const sal_Int32 nEnd, const SetAttrMode nMode=SetAttrMode::DEFAULT)
create new text attribute from rAttr and insert it
bool HasDrawView() const
New Interface for StarView Drawing.
SwDrawView * GetDrawView()
SdrPageView * GetPageView()
bool IsViewLocked() const
vcl::RenderContext * GetOut() const
bool IsHeaderFooterEdit() const
Acts both for headers / footers, depending on the bShow(Header|Footer)Separator flags.
void UnlockPaint(bool bVirDev=false)
const SwNodes & GetNodes() const
rtl::Reference< SwDoc > mxDoc
The document; never 0.
bool HasDrawViewDrag() const
SwRootFrame * GetLayout() const
vcl::Window * GetWin() const
const IDocumentDrawModelAccess & getIDocumentDrawModelAccess() const
Provides access to the document draw model interface.
IDocumentUndoRedo const & GetIDocumentUndoRedo() const
Provides access to the document undo/redo interface.
void InvalidateWindows(const SwRect &rRect)
const IDocumentLayoutAccess & getIDocumentLayoutAccess() const
Provides access to the document layout interface.
SfxViewShell * GetSfxViewShell() const
void LockPaint(LockPaintReason eReason)
const SfxItemPool & GetAttrPool() const
void MakeVisible(const SwRect &)
virtual bool IsTextBox() const override
SwFlyFrame * GetFlyFrame()
bool ContainsSwGrfNode() const
virtual const tools::Rectangle & GetCurrentBoundRect() const override
void append(const B2DPolygon &rPolygon, sal_uInt32 nCount=1)
void append(const basegfx::B2DPoint &rPoint, sal_uInt32 nCount)
void setClosed(bool bNew)
void appendBezierSegment(const basegfx::B2DPoint &rNextControlPoint, const basegfx::B2DPoint &rPrevControlPoint, const basegfx::B2DPoint &rPoint)
virtual bool includeObject(const SdrObject &i_rObject) const=0
ring_container GetRingContainer()
void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
@ SetOnlyText
stay with the cursor inside text
virtual SotClipboardFormatId GetFormat(const TransferableDataHelper &aHelper) override
bool IsScrollMDI(SwViewShell const *pVwSh, const SwRect &rRect)
void FrameNotify(SwViewShell *pVwSh, FlyMode eMode)
void ScrollMDI(SwViewShell const *pVwSh, const SwRect &rRect, sal_uInt16 nRangeX, sal_uInt16 nRangeY)
EmbeddedObjectRef * pObject
GotoObjFlags
values can be combined via logical or
FrameTypeFlags
values can be combined via logical or
#define SW_ALLOW_TEXTBOX
Allow SwFEShell::SelectObj() to select the TextBox of a shape.
FlyProtectFlags
values can be combined via logical or
@ Parent
Check only parents.
@ Fixed
Only protection that cannot be withdrawn e.g.
static void lcl_GrabCursor(SwFEShell *pSh, SwFlyFrame *pOldSelFly, SwFrameFormat *pNewDrawFormat=nullptr)
static void lcl_NotifyNeighbours(const SdrMarkList *pLst)
SwFlyFrame * GetFlyFromMarked(const SdrMarkList *pLst, SwViewShell *pSh)
static bool LessX(Point const &aPt1, Point const &aPt2, bool bOld)
static bool LessY(Point const &aPt1, Point const &aPt2, bool bOld)
static bool lcl_IsControlGroup(const SdrObject *pObj)
@ SOURCE_CHAINED
Source already has a follow.
@ NOT_FOUND
Destination and/or source not found.
const SwContentFrame * FindAnchor(const SwFrame *pOldAnch, const Point &rNew, const bool bBody=false)
search an anchor for paragraph bound frames starting from pOldAnch
@ Minimum
Value in Var-direction gives minimum (can be exceeded but not be less).
constexpr TypedWhichId< SwFormatFrameSize > RES_FRM_SIZE(89)
constexpr TypedWhichId< SwFlyFrameFormat > RES_FLYFRMFMT(162)
constexpr TypedWhichId< SwDrawFrameFormat > RES_DRAWFRMFMT(165)
constexpr TypedWhichId< SwFormatAnchor > RES_ANCHOR(110)
constexpr TypedWhichId< SwFormatSurround > RES_SURROUND(107)
constexpr auto toTwips(N number, Length from)
std::pair< SwTextNode *, sal_Int32 > MapViewToModel(MergedPara const &, TextFrameIndex nIndex)
static SwRectFnCollection aVertical
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.
SdrOnOffItem makeSdrTextAutoGrowHeightItem(bool bAuto)
SdrOnOffItem makeSdrTextAutoGrowWidthItem(bool bAuto)
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.
SVXCORE_DLLPUBLIC SdrTextObj * DynCastSdrTextObj(SdrObject *)
constexpr SdrLayerID SDRLAYER_NOTFOUND(-1)
@ FlyFrameAttributesChanged
constexpr SwTwips lMinBorder
SdrAngleItem makeSdrCircStartAngleItem(Degree100 nAngle)
SdrAngleItem makeSdrCircEndAngleItem(Degree100 nAngle)
sal_uInt16 GetHtmlMode(const SwDocShell *pShell)