21#include <svx/strings.hrc>
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) );
126 if( pEntry->
GetName() == aArrowName )
148 return pVirtO->GetFlyFrame();
157 (!pOldSelFly || pOldSelFly->
GetFormat() != pFlyFormat) )
196 bool bUnmark = !bAddSelect;
215 aPt.setX(aPt.getX() - 1);
250 OSL_ENSURE( !bEnterGroup,
"SW_ENTER_GROUP is not supported" );
251 pDView->
MarkObj( pObj,
Imp()->GetPageView() );
258 pDView->
MarkObj( rPt, nMinMove, bAddSelect, bEnterGroup );
302 SdrObject* pShape = pShapeFormat->FindSdrObject();
304 pDView->
MarkObj(pShape,
Imp()->GetPageView(), bAddSelect, bEnterGroup);
316 OSL_ENSURE( pTmp,
"Graphic without Fly" );
321 else if ( !pOldSelFly && bHadSelection )
324 if( bRet || !bHadSelection )
349static bool LessX( Point
const & aPt1, Point
const & aPt2,
bool bOld )
351 return aPt1.getX() < aPt2.getX()
352 || ( aPt1.getX() == aPt2.getX()
353 && ( aPt1.getY() < aPt2.getY()
354 || ( aPt1.getY() == aPt2.getY() && bOld ) ) );
356static bool LessY( Point
const & aPt1, Point
const & aPt2,
bool bOld )
358 return aPt1.getY() < aPt2.getY()
359 || ( aPt1.getY() == aPt2.getY()
360 && ( aPt1.getX() < aPt2.getX()
361 || ( aPt1.getX() == aPt2.getX() && bOld ) ) );
376 pFly = pVirtO->GetFlyFrame();
390 if ( RndStdIds::FLY_AS_CHAR == nAnchorId )
411 switch ( nAnchorId ) {
412 case RndStdIds::FLY_AT_PAGE:
414 OSL_ENSURE( pOld->
IsPageFrame(),
"Wrong anchor, page expected." );
419 if( pNew && pNew != pOld )
426 case RndStdIds::FLY_AT_CHAR:
428 OSL_ENSURE(pOld->
IsTextFrame(),
"Wrong anchor, text frame expected.");
460 case RndStdIds::FLY_AT_PARA:
462 OSL_ENSURE(pOld->
IsTextFrame(),
"Wrong anchor, text frame expected.");
472 (bRet && pNewFrame->
GetText().getLength() != 0)
473 ? pNewFrame->
GetText().getLength() - 1
482 case RndStdIds::FLY_AT_FLY:
484 OSL_ENSURE( pOld->
IsFlyFrame(),
"Wrong anchor, fly frame expected.");
486 OSL_ENSURE( pPage,
"Where's my page?" );
496 if(
auto pTmp = pAnchObj->DynCastFlyFrame() )
502 const SwFlyFrame* pCheck = pFly ? pTmp :
nullptr;
512 Point aNew( pTmp->getFrameArea().Left() +
513 pTmp->getFrameArea().Width()/2,
514 pTmp->getFrameArea().Top() +
515 pTmp->getFrameArea().Height()/2 );
516 bool bAccept =
false;
520 bAccept =
LessX( aCenter, aNew, bOld )
522 LessX( aNew, aBest,
false ) );
527 bAccept =
LessX( aNew, aCenter, !bOld )
529 LessX( aBest, aNew,
true ) );
534 bAccept =
LessY( aNew, aCenter, !bOld )
536 LessY( aBest, aNew,
true ) );
541 bAccept =
LessY( aCenter, aNew, bOld )
543 LessY( aNew, aBest,
false ) );
560 GetContent().GetContentIdx());
576 std::unique_ptr<SwHandleAnchorNodeChg> pHandleAnchorNodeChg;
578 if ( pFlyFrameFormat )
580 pHandleAnchorNodeChg.reset(
612 if( pMarkList ==
nullptr || pMarkList->
GetMarkCount() == 0 )
619 if ( pFly !=
nullptr )
646 if( pMarkList !=
nullptr && pMarkList->
GetMarkCount() == 1 )
658 const SwRect aRect( rPt, rPt );
661 Imp()->IsDragPossible( rPt )) )
770 ChgAnchor( RndStdIds::FLY_AT_PARA,
true );
777 if(
auto pCursorShell =
dynamic_cast<SwCursorShell *
>(&rSh) )
778 pCursorShell->CallChgLnk();
787 OSL_ENSURE(
Imp()->
HasDrawView(),
"BreakDrag without DrawView?" );
845 bool bCheckNeighbours =
false;
858 bCheckNeighbours =
true;
861 aFrm.
Pos().AdjustY(1 );
887 if ( aRect.
Overlaps( aTmpCalcPnt ) )
894 if ( aRect.
Overlaps( aTmpCalcPnt ) )
908 aFrm.
Pos().AdjustY(1 );
919 if ( !(nSlotId == SID_LINE_ARROW_START ||
920 nSlotId == SID_LINE_ARROW_END ||
921 nSlotId == SID_LINE_ARROWS ||
922 nSlotId == SID_LINE_ARROW_CIRCLE ||
923 nSlotId == SID_LINE_CIRCLE_ARROW ||
924 nSlotId == SID_LINE_ARROW_SQUARE ||
925 nSlotId == SID_LINE_SQUARE_ARROW ||
926 nSlotId == SID_DRAW_MEASURELINE) )
933 if( !aArrow.
count() )
945 if( !aCircle.
count() )
949 aCircle.
append(aNewCircle);
954 if( !aSquare.
count() )
962 aSquare.
append(aNewSquare);
978 case SID_LINE_ARROWS:
979 case SID_DRAW_MEASURELINE:
989 case SID_LINE_ARROW_START:
990 case SID_LINE_ARROW_CIRCLE:
991 case SID_LINE_ARROW_SQUARE:
999 case SID_LINE_ARROW_END:
1000 case SID_LINE_CIRCLE_ARROW:
1001 case SID_LINE_SQUARE_ARROW:
1013 case SID_LINE_ARROW_CIRCLE:
1021 case SID_LINE_CIRCLE_ARROW:
1029 case SID_LINE_ARROW_SQUARE:
1037 case SID_LINE_SQUARE_ARROW:
1050 OSL_ENSURE(
Imp()->
HasDrawView(),
"SelectionToTop without DrawView?" );
1052 OSL_ENSURE( rMrkList.
GetMarkCount(),
"No object selected." );
1076 = pFormat->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel())
1079 if (
auto pPage = pDrwModel->GetPage(0))
1091 sal_uInt32 nShift = 0;
1093 const auto pNextObj = pPage->SetObjectOrdNum(pObj->GetOrdNum() + 1, pObj->GetOrdNum() + 1);
1107 pPage->SetObjectOrdNum(pObj->GetOrdNum(), pObj->GetOrdNum() + nShift);
1119 OSL_ENSURE(
Imp()->
HasDrawView(),
"SelectionToBottom without DrawView?" );
1121 OSL_ENSURE( rMrkList.
GetMarkCount(),
"No object selected." );
1145 = pFormat->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel())
1146 if (
auto pPage = pDrwModel->GetPage(0))
1148 const auto pNextObj = pPage->SetObjectOrdNum(pObj->GetOrdNum() - 1, pObj->GetOrdNum() - 1);
1156 pPage->SetObjectOrdNum(pObj->GetOrdNum(), pObj->GetOrdNum() - 1);
1183 else if ( nRet != pObj->
GetLayer() )
1212 OSL_ENSURE( pContact && pContact->
GetMaster(),
"<SwFEShell::ChangeOpaque(..)> - missing contact or missing master object at contact!" );
1213 const bool bControlObj = ( pContact && pContact->
GetMaster() )
1216 if ( !bControlObj && pObj->
GetLayer() != nLayerId )
1222 SwFormat *pFormat = pVirtO->GetFlyFrame()->GetFormat();
1224 aOpa.SetValue( nLayerId == rIDDMA.
GetHellId() );
1283 if(
nullptr != pVirtFlyDraw)
1320 "EndTextEdit a no Object" );
1326 if(
nullptr != pUserCall )
1335 if ( SdrEndTextEditKind::ShouldBeDeleted == pView->
SdrEndTextEdit(
true) )
1344 pView->
MarkObj( pObj,
Imp()->GetPageView() );
1389 bRet = pDView->
PickObj(rPt, pDView->
getHitTolLog(), pPV, SdrSearchOptions::PICKMARKABLE) !=
nullptr;
1435 bool bObjInBackground(
false );
1442 if ( rSurround.
GetSurround() == css::text::WrapTextMode_THROUGH )
1444 bObjInBackground =
true;
1448 if ( bObjInBackground )
1454 while ( pContentFrame )
1462 Point aTmpPt( rPt );
1503 for(
size_t a = pObj->
GetOrdNum()+1; bRet && a < pPage->GetObjCount(); ++
a)
1529 if(
dynamic_cast<const SdrUnoObj*
>( pObj) !=
nullptr)
1531 else if(
auto pObjGroup =
dynamic_cast<const SdrObjGroup*
>( pObj) )
1534 const SdrObjList *pLst = pObjGroup->GetSubList();
1547 explicit MarkableObjectsOnly(
SdrPageView* i_pPV )
1554 return m_pPV && m_pPV->GetView().IsObjMarkable( &i_rObject, m_pPV );
1576 Point aBestPos( nTmp, nTmp );
1577 Point aTopPos( nTmp, nTmp );
1583 if( !bNoFly && bNoDraw )
1592 MarkableObjectsOnly aDefaultFilter( pPV );
1594 pFilter = &aDefaultFilter;
1603 if(
auto pVirtFlyDrawObj =
dynamic_cast<const SwVirtFlyDrawObj*
>( pStartObj) )
1604 aPos = pVirtFlyDrawObj->GetFlyFrame()->getFrameArea().Pos();
1619 if (
dynamic_cast<const SdrObjGroup*
>( pStartObj) )
1631 OSL_ENSURE( pList,
"No object list to iterate" );
1633 SdrObjListIter aObjIter( pList, bFlat ? SdrIterMode::Flat : SdrIterMode::DeepNoGroups );
1634 while ( aObjIter.
IsMore() )
1638 if( ( bNoFly && pVirtO ) ||
1639 ( bNoDraw && !pVirtO ) ||
1660 if ( pFly->
Lower() &&
1666 if ( pFly->
Lower() &&
1680 if( aCurPos != aPos &&
1681 aCurPos.getY() == aPos.getY() &&
1682 (bNext? (aCurPos.getX() > aPos.getX()) :
1683 (aCurPos.getX() < aPos.getX())) )
1685 aBestPos =
Point( nTmp, nTmp );
1686 SdrObjListIter aTmpIter( pList, bFlat ? SdrIterMode::Flat : SdrIterMode::DeepNoGroups );
1687 while ( aTmpIter.
IsMore() )
1691 if( ( bNoFly && pVirtO ) || ( bNoDraw && !pVirtO ) )
1700 if( aCurPos != aPos && aCurPos.Y() == aPos.Y() &&
1701 (bNext? (aCurPos.getX() > aPos.getX()) :
1702 (aCurPos.getX() < aPos.getX())) &&
1703 (bNext? (aCurPos.getX() < aBestPos.getX()) :
1704 (aCurPos.getX() > aBestPos.getX())) )
1714 (bNext? (aPos.getY() < aCurPos.getY()) :
1715 (aPos.getY() > aCurPos.getY())) &&
1716 (bNext? (aBestPos.getY() > aCurPos.getY()) :
1717 (aBestPos.getY() < aCurPos.getY()))
1719 (aBestPos.getY() == aCurPos.getY() &&
1720 (bNext? (aBestPos.getX() > aCurPos.getX()) :
1721 (aBestPos.getX() < aCurPos.getX()))))
1728 if( (bNext? (aTopPos.getY() > aCurPos.getY()) :
1729 (aTopPos.getY() < aCurPos.getY())) ||
1730 (aTopPos.getY() == aCurPos.getY() &&
1731 (bNext? (aTopPos.getX() > aCurPos.getX()) :
1732 (aTopPos.getX() < aCurPos.getX()))))
1739 if( bNext ? (aBestPos.getX() ==
LONG_MAX) : (aBestPos.getX() == 0) )
1742 if (pbWrapped && pBest)
1754 bool bWrapped(
false);
1781 SearchLabel::StartWrapped);
1796 if ( eSdrObjectKind == SdrObjKind::Caption )
1830 OSL_ENSURE(
Imp()->
HasDrawView(),
"MoveCreate without DrawView?" );
1843 OSL_ENSURE(
Imp()->
HasDrawView(),
"EndCreate without DrawView?" );
1857 if ( eSdrCreateCmd == SdrCreateCmd::NextPoint )
1867 if (
Imp()->
GetDrawView()->GetMarkedObjectList().GetMarkCount() == 0)
1902 const SwFrame *pAnch =
nullptr;
1903 bool bCharBound =
false;
1904 if(
dynamic_cast<const SdrUnoObj*
>( &rSdrObj) !=
nullptr )
1914 std::pair<Point, bool>
const tmp(aPoint,
true);
1938 aAnch.
SetType( RndStdIds::FLY_AS_CHAR );
1951 bool bBodyOnly = SdrInventor::Default != rSdrObj.
GetObjInventor();
1952 bool bAtPage =
false;
1953 const SwFrame* pPage =
nullptr;
1955 Point aPoint( aPt );
1968 std::pair<Point, bool>
const tmp(aPoint,
false);
1981 const SwFrame* pTmpFrame = pAnch;
2006 std::pair<SwTextNode const*, sal_Int32>
const pos(
2022 aAnch.
SetType( RndStdIds::FLY_AT_PARA );
2031 aAnch.
SetType( RndStdIds::FLY_AT_PAGE );
2047 nXOffset = nYOffset;
2057 if (pTmp->IsFollow())
2061 OSL_ENSURE(pTmp,
"Where's my Master?");
2066 }
while (pTmp->IsFollow());
2088 const SwRect aFlyRect( rBound );
2098 auto pNewPage = pTmpSdrModel->
AllocPage(
false );
2100 pPg = pNewPage.get();
2113 const bool bLeftFrame = aFlyRect.
Left() <
2115 bLeftPrt = aFlyRect.
Left() + aFlyRect.
Width() <
2117 if( bLeftFrame || bLeftPrt )
2120 aHori.
SetRelationOrient( bLeftFrame ? text::RelOrientation::FRAME : text::RelOrientation::PRINT_AREA );
2124 const bool bRightFrame = aFlyRect.
Left() >
2127 aHori.
SetRelationOrient( bRightFrame ? text::RelOrientation::FRAME : text::RelOrientation::PRINT_AREA );
2129 aHtmlSet.
Put( aHori );
2132 aHtmlSet.
Put( aVert );
2139 if (rSdrObj.
GetName().isEmpty())
2158 assert(pTmp &&
"Where's my Master?");
2161 }
while ( pTmp->IsFollow() );
2168 text::PositionLayoutDir::PositionInLayoutDirOfAnchor );
2178 OSL_ENSURE( aAnch.
GetAnchorId() == RndStdIds::FLY_AS_CHAR,
"wrong AnchorType" );
2184 aVertical.SetVertOrient( text::VertOrientation::LINE_CENTER );
2192 OSL_ENSURE( pTmp,
"Where's my Master?" );
2193 }
while( pTmp->IsFollow() );
2223 OSL_ENSURE(
Imp()->
HasDrawView(),
"BreakCreate without DrawView?" );
2256 OSL_ENSURE(
Imp()->
HasDrawView(),
"MoveMark without DrawView?" );
2283 bool bShowHdl =
false;
2340 nRet = RndStdIds::UNKNOWN;
2347 else if ( nRet !=
nId )
2349 nRet = RndStdIds::UNKNOWN;
2355 nRet = RndStdIds::UNKNOWN;
2361 OSL_ENSURE(
Imp()->
HasDrawView(),
"ChgAnchor without DrawView?" );
2379 OSL_ENSURE(
Imp()->
HasDrawView(),
"DelSelectedObj(), no DrawView available" );
2406 OSL_ENSURE( pView,
"GetAnchorObjDiff without DrawView?" );
2434 OSL_ENSURE(
Imp()->
GetDrawView(),
"GetObjAbsPos() without DrawView?" );
2472 bool HasSuitableGroupingAnchor(
const SdrObject* pObj)
2474 bool bSuitable =
true;
2478 OSL_FAIL(
"<HasSuitableGroupingAnchor> - missing frame format" );
2481 else if (RndStdIds::FLY_AS_CHAR == pFrameFormat->GetAnchor().GetAnchorId())
2495 bool bIsGroupAllowed =
false;
2498 bIsGroupAllowed =
true;
2500 const SwFrame* pHeaderFooterFrame =
nullptr;
2502 for (
size_t i = 0; bIsGroupAllowed &&
i < rMrkList.
GetMarkCount(); ++
i )
2510 if ( bIsGroupAllowed )
2511 bIsGroupAllowed = HasSuitableGroupingAnchor(pObj);
2515 if ( bIsGroupAllowed )
2517 const SwFrame* pAnchorFrame =
nullptr;
2520 const SwFlyFrame* pFlyFrame = pVirtFlyDrawObj->GetFlyFrame();
2550 return bIsGroupAllowed;
2555 bool bIsUnGroupAllowed =
false;
2561 bIsUnGroupAllowed = HasSuitableGroupingAnchor(pObj);
2562 if (!bIsUnGroupAllowed)
2566 return bIsUnGroupAllowed;
2682 FlyCntType const eType,
bool const bIgnoreTextBoxes)
2730 uno::Reference < embed::XEmbeddedObject > xObj( pNd ? pNd->
GetOLEObj().
GetOleRef() :
nullptr );
2734 const bool bNeverResize = (embed::EmbedMisc::EMBED_NEVERRESIZE & xObj->getStatus( embed::Aspects::MSOLE_CONTENT ));
2756 pAnch = pVirtO->GetFlyFrame()->GetAnchorFrame();
2780 OSL_ENSURE( pContact,
"<SwFEShell::GetObjAttr(..)> - missing <pContact>." );
2798 OSL_ENSURE(
false,
"SetObjAttr, empty set." );
2845 OSL_ENSURE( pPage,
"Page not found." );
2853 aAnch.
SetType( RndStdIds::FLY_AT_PARA );
2885 const Point &rPt )
const
2961 bool bDelFrom =
true,
3012 if( pFrame && pFrame->
IsInSct() )
3028 if( !pSct->IsFollow() )
3030 return pSct->getFrameArea().Width();
3043 SdrInventor::Default,
3049 if(SdrObjKind::CircleArc == eSdrObjectKind || SdrObjKind::CircleCut == eSdrObjectKind)
3065 pObj->SetLogicRect(aRect);
3070 if(
dynamic_cast<const SdrCircObj*
>( pObj.get()) !=
nullptr)
3075 pObj->SetMergedItemSet(aAttr);
3077 else if(
auto pPathObj =
dynamic_cast<SdrPathObj*
>( pObj.get()))
3081 switch(eSdrObjectKind)
3083 case SdrObjKind::PathLine:
3084 case SdrObjKind::PathFill:
3103 aPoly.
append(aInnerPoly);
3106 case SdrObjKind::FreehandLine:
3107 case SdrObjKind::FreehandFill:
3125 aPoly.
append(aInnerPoly);
3128 case SdrObjKind::Polygon:
3129 case SdrObjKind::PolyLine:
3144 if(SdrObjKind::PolyLine == eSdrObjectKind)
3153 aPoly.
append(aInnerPoly);
3156 case SdrObjKind::Line :
3158 sal_Int32 nYMiddle((aRect.
Top() + aRect.
Bottom()) / 2);
3164 SfxItemSet aAttr(pObj->getSdrModelFromSdrObject().GetItemPool());
3166 pObj->SetMergedItemSet(aAttr);
3173 pPathObj->SetPathPoly(aPoly);
3175 else if(
auto pMeasureObj =
dynamic_cast<SdrMeasureObj*
>( pObj.get()))
3177 sal_Int32 nYMiddle((aRect.
Top() + aRect.
Bottom()) / 2);
3178 pMeasureObj->SetPoint(
Point(aStart.X(), nYMiddle), 0);
3179 pMeasureObj->SetPoint(
Point(aEnd.X(), nYMiddle), 1);
3181 SfxItemSet aAttr(pObj->getSdrModelFromSdrObject().GetItemPool());
3183 pObj->SetMergedItemSet(aAttr);
3185 else if(
auto pCaptionObj =
dynamic_cast<SdrCaptionObj*
>( pObj.get()))
3187 bool bVerticalText = ( SID_DRAW_TEXT_VERTICAL == nSlotId ||
3188 SID_DRAW_CAPTION_VERTICAL == nSlotId );
3189 pCaptionObj->SetVerticalWriting(bVerticalText);
3195 pObj->SetMergedItemSet(aSet);
3198 pCaptionObj->SetLogicRect(aRect);
3199 pCaptionObj->SetTailPos(
3204 pText->SetLogicRect(aRect);
3206 bool bVertical = (SID_DRAW_TEXT_VERTICAL == nSlotId);
3207 bool bMarquee = (SID_DRAW_TEXT_MARQUEE == nSlotId);
3209 pText->SetVerticalWriting(bVertical);
3218 pText->SetMergedItemSet(aSet);
3230 pObj->SetMergedItemSetAndBroadcast(aSet);
3259 OSL_ENSURE(
Imp()->
GetDrawView(),
"wrong usage of SwFEShell::GetShapeBackground - no draw view!");
3265 OSL_ENSURE( pMrkList->
GetMarkCount() == 1,
"wrong usage of SwFEShell::GetShapeBackground - no selected object!");
3271 OSL_ENSURE(
dynamic_cast<const SwVirtFlyDrawObj*
>( pSdrObj) ==
nullptr,
"wrong usage of SwFEShell::GetShapeBackground - selected object is not a drawing object!");
3277 OSL_ENSURE( pAnchorFrame,
"inconsistent model - no anchor at shape!");
3281 OSL_ENSURE( pPageFrame,
"inconsistent model - no page!");
3307 OSL_ENSURE(
Imp()->
GetDrawView(),
"wrong usage of SwFEShell::GetShapeBackground - no draw view!");
3313 OSL_ENSURE( pMrkList->
GetMarkCount() == 1,
"wrong usage of SwFEShell::GetShapeBackground - no selected object!");
3319 OSL_ENSURE(
dynamic_cast<const SwVirtFlyDrawObj*
>( pSdrObj) ==
nullptr,
"wrong usage of SwFEShell::GetShapeBackground - selected object is not a drawing object!");
3325 OSL_ENSURE( pAnchorFrame,
"inconsistent model - no anchor at shape!");
3329 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...
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
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)
XLineEndListRef GetLineEndList() const
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
SdrModel & getSdrModelFromSdrObject() 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)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
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
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.
general base class for all free-flowing frames
const SwVirtFlyDrawObj * GetVirtDrawObj() const
SwFlyFrame * GetPrevLink() const
virtual const SwFlyFrameFormat * GetFormat() const override
bool IsFlyAtContentFrame() const
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
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
const basegfx::B2DPolyPolygon & GetLineEnd() const
const OUString & GetName() const
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()
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
@ SetOnlyText
stay with the cursor inside text
SVXCORE_DLLPUBLIC OUString SvxResId(TranslateId aId)
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_NotifyNeighbours(const SdrMarkList *pLst)
static void lcl_GrabCursor(SwFEShell *pSh, SwFlyFrame *pOldSelFly)
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)
constexpr TypedWhichId< XLineWidthItem > XATTR_LINEWIDTH(XATTR_LINE_FIRST+2)