29#include <com/sun/star/form/FormButtonType.hpp>
30#include <com/sun/star/beans/XPropertySet.hpp>
31#include <com/sun/star/embed/XEmbeddedObject.hpp>
33#include <osl/diagnose.h>
96 std::pair<Point, bool>
const tmp(rPt,
false);
99 nullptr, &tmp) :
nullptr;
103 rAnchor.
SetType( RndStdIds::FLY_AT_PAGE );
120 Point aTmpPnt( rPt );
123 case RndStdIds::FLY_AS_CHAR:
124 case RndStdIds::FLY_AT_PARA:
125 case RndStdIds::FLY_AT_CHAR:
140 if ((RndStdIds::FLY_AT_CHAR == nNew) || (RndStdIds::FLY_AS_CHAR == nNew))
173 case RndStdIds::FLY_AT_FLY:
185 if( pNewAnch && &rFrame != pNewAnch && !pNewAnch->
IsProtected() )
194 nNew = RndStdIds::FLY_AT_PAGE;
198 case RndStdIds::FLY_AT_PAGE:
204 OSL_ENSURE(
false,
"Wrong Id for new anchor." );
228#if OSL_DEBUG_LEVEL > 0
229 OSL_ENSURE( !(nNew == RndStdIds::FLY_AT_PAGE &&
230 (RndStdIds::FLY_AT_PARA==nOld || RndStdIds::FLY_AT_CHAR==nOld || RndStdIds::FLY_AS_CHAR==nOld ) &&
232 "forbidden anchor change in Head/Foot." );
253 OSL_ENSURE( rFrame.
IsFlyFrame(),
"SelectFlyFrame wants a Fly" );
339 pFly = pFlyObj->GetFlyFrame()->GetAnchorFrame();
346 OSL_ENSURE( pFly,
"IsFlyInFly: Where's my anchor?" );
347 OSL_ENSURE( pFly->
IsFlyFrame(),
"IsFlyInFly: Funny anchor!" );
358 Point aPoint( aTmpPos );
363 std::pair<Point, bool>
const tmp(aTmpPos,
false);
395 const Point aNewAbsPos(
444 if ( RndStdIds::FLY_AS_CHAR == nAnchorId )
449 bool bTextBox =
false;
456 const SwFrame* pFooterOrHeader =
nullptr;
470 if ( RndStdIds::FLY_AT_PAGE != nAnchorId )
482 pFly = pFlyFormat->GetFrame();
503 Point aTmpPnt( rAbsPos );
513 const SwFrame *pNewAnch =
nullptr;
514 if( pTextFrame !=
nullptr )
516 if ( RndStdIds::FLY_AT_PAGE == nAnchorId )
524 if( RndStdIds::FLY_AT_FLY == nAnchorId )
551 if ( bMoveIt || (nAnchorId == RndStdIds::FLY_AT_CHAR) )
556 case RndStdIds::FLY_AT_PARA:
564 case RndStdIds::FLY_AT_PAGE:
571 case RndStdIds::FLY_AT_FLY:
574 GetContent().GetContentIdx() );
579 case RndStdIds::FLY_AT_CHAR:
582 Point aTmpPnt( rAbsPos );
587 aRet = aTmpRect.
Pos();
609 std::unique_ptr<SwHandleAnchorNodeChg> pHandleAnchorNodeChg;
611 if ( pFlyFrameFormat )
613 pHandleAnchorNodeChg.reset(
643 SwRect aTmpRect( aRet, rAbsPos );
644 if( aTmpRect.HasArea() )
646#if OSL_DEBUG_LEVEL > 0
650 OSL_FAIL(
"Hey, Joe: Where's my Null Pen?" );
670 bool bMoveContent =
true;
674 if( !aBoxes.
empty() )
688 bMoveContent =
false;
691 bMoveContent =
false;
699 case RndStdIds::FLY_AT_PAGE:
704 case RndStdIds::FLY_AT_FLY:
705 case RndStdIds::FLY_AT_PARA:
706 case RndStdIds::FLY_AT_CHAR:
707 case RndStdIds::FLY_AS_CHAR:
710 if( RndStdIds::FLY_AT_FLY != eRndId )
716 eRndId = RndStdIds::FLY_AT_PAGE;
722 OSL_ENSURE(
false,
"What is the purpose of this Fly?" );
730 std::unique_ptr<SwFormatAnchor> pOldAnchor;
731 bool bHOriChgd =
false, bVOriChgd =
false;
732 std::shared_ptr<SwFormatVertOrient> aOldV;
733 std::shared_ptr<SwFormatHoriOrient> aOldH;
735 if ( RndStdIds::FLY_AT_PAGE != eRndId )
749 aOldH.reset(pHoriOrientItem->
Clone());
757 aOldV.reset(pVertOrientItem->
Clone());
780 if ( RndStdIds::FLY_AS_CHAR == eRndId )
785 pOldAnchor->SetAnchor( &aPos );
789 bool const bDoesUndo =
859 case RndStdIds::FLY_AT_PARA:
860 case RndStdIds::FLY_AT_CHAR:
861 case RndStdIds::FLY_AS_CHAR:
867 case RndStdIds::FLY_AT_FLY:
874 case RndStdIds::FLY_AT_PAGE:
891 OSL_ENSURE(pFormat,
"IDocumentContentOperations::InsertGraphic failed.");
894 }
while( pCursor != pStartCursor );
938 rPaM, xObj, pFlyAttrSet );
939 OSL_ENSURE(pFormat,
"IDocumentContentOperations::InsertEmbObject failed.");
959 const Point& rInsertPosition )
973 Point aTmpPt( rInsertPosition );
1009 if (RndStdIds::FLY_AT_PAGE == pFormat->GetAnchor().GetAnchorId())
1011 rFillArr.push_back( pFormat );
1018 if( rFillArr.empty() )
1025 sal_uInt16 nMaxPage = pTmpRootFrame->
GetPageNum();
1026 bool bTmpAssert =
false;
1027 for(
auto pFormat : rFillArr )
1034 if (RndStdIds::FLY_AT_PAGE != aNewAnchor.
GetAnchorId())
1037 sal_uInt16 nNewPage = aNewAnchor.
GetPageNum() + 1;
1038 if (nNewPage > nMaxPage)
1043 pFormat->DelFrames();
1047 mxDoc->SetAttr( aNewAnchor, *pFormat );
1066 OSL_ENSURE(
false,
"GetFlyFrameAttr, no Fly selected." );
1082 if ( RndStdIds::FLY_AT_PAGE !=
eType )
1086 if ( RndStdIds::FLY_AS_CHAR ==
eType )
1111 OSL_ENSURE(pFly,
"SetFlyFrameAttr, no Fly selected.");
1191 OSL_ENSURE( pFly,
"SetFlyFrameAttr, no Fly selected." );
1202 sal_uInt16 nWhich = pItem->Which();
1218 GetDoc()->GetDfltFrameFormat() )
1231 pFly = pFlyFormat->GetFrame();
1235 OSL_ENSURE( pFly,
"SetFrameFormat: no frame" );
1245 std::optional<SfxItemSet> oSet;
1250 oSet->Put( *pItem );
1257 if(
GetDoc()->SetFrameFormatToFly( *pFlyFormat, *pNewFormat, oSet ? &*oSet :
nullptr, bKeepOrient ))
1325 aResult = rRect.
SSize();
1394 aResult = pFly->
ChgSize( aSz );
1408 if ( rRect.
Top() != LONG_MIN && rRect.
Pos() != aPt && !bPosProt )
1427 rVert.
GetPos() + lYDiff );
1433 OSL_ENSURE( pFlyFrameFormat,
"fly frame format missing!" );
1434 if ( pFlyFrameFormat )
1447 if( !rSpzArr.
empty() )
1450 if( rCursorNd >
mxDoc->GetNodes().GetEndOfExtras() )
1454 for(
auto pFormat : rSpzArr )
1456 const SwNodeIndex* pIdx = pFormat->GetContent(
false ).GetContentIdx();
1460 *pSttNd < rCursorNd &&
1461 rCursorNd < *pSttNd->EndOfSectionNode() )
1477 OSL_ENSURE(
false,
"no FlyFrame selected" );
1487 OSL_ENSURE(
false,
"no FlyFrame selected" );
1493 uno::Reference < embed::XEmbeddedObject > xObj;
1510 OUString *pTargetFrameName,
1511 OUString *pDescription )
const
1531 bool bSetTargetFrameName = pTargetFrameName !=
nullptr;
1532 bool bSetDescription = pDescription !=
nullptr;
1540 if ( bSetTargetFrameName && !
pObject->GetTarget().isEmpty() )
1542 bSetTargetFrameName =
false;
1543 *pTargetFrameName =
pObject->GetTarget();
1545 if ( bSetDescription )
1547 bSetDescription =
false;
1548 *pDescription =
pObject->GetAltText();
1565 aPt,
MapMode( MapUnit::MapTwip ) );
1566 *pURL = *pURL +
"?" + OUString::number( aPt.
getX() )
1567 +
"," + OUString::number(aPt.
getY() );
1572 if ( bSetTargetFrameName )
1574 if ( bSetDescription )
1583 OUString &rName,
bool &rbLink )
const
1611 if ( rName.isEmpty() )
1613 return &pNd->
GetGrf(
true);
1639 pRet = pFlyObj->GetFormat();
1642 if(pRet && pRectToFill)
1660 std::pair<Point, bool>
const tmp(rPt,
false);
1676 pInvestigatedObj = &(pDrawVirtObj->GetReferencedObj());
1680 pInvestigatedObj = &rObj;
1686 uno::Reference< awt::XControlModel >
xModel =
1691 OUString
sName(
"ButtonType");
1692 uno::Reference< beans::XPropertySet > xSet(
xModel, uno::UNO_QUERY);
1694 uno::Reference< beans::XPropertySetInfo > xInfo = xSet->getPropertySetInfo();
1695 if(xInfo->hasPropertyByName(
sName ))
1697 aVal = xSet->getPropertyValue(
sName );
1698 if( aVal.
hasValue() && form::FormButtonType_URL == *o3tl::doAccess<form::FormButtonType>(aVal) )
1705 const SwFlyFrame *pFly = pFlyObj->GetFlyFrame();
1716 else if (
dynamic_cast<const SdrObjGroup*
>( pInvestigatedObj) !=
nullptr )
1719 if ( !pDrawContact )
1721 OSL_FAIL(
"<SwFEShell::GetObjCntType(..)> - missing draw contact object" );
1727 if ( !pFrameFormat )
1729 OSL_FAIL(
"<SwFEShell::GetObjCntType(..)> - missing frame format" );
1786 else if( eTmp !=
eType )
1803 ( pMrkList = &
Imp()->
GetDrawView()->GetMarkedObjectList())->GetMarkCount()) )
1844 *
GetCursor(), rGrfName,
"", pGrf, &aFrameSet,
nullptr,
nullptr);
1852 OSL_ENSURE(pFormat !=
nullptr,
"invalid argument");
1858 if (pFrame !=
nullptr)
1867 const OUString & rReference,
1869 std::vector< OUString > & aPrevPageVec,
1870 std::vector< OUString > & aThisPageVec,
1871 std::vector< OUString > & aNextPageVec,
1872 std::vector< OUString > & aRestVec)
1881 mxDoc->Unchain(rFormat);
1884 mxDoc->Unchain(*pOldChainPrev);
1889 std::vector< const SwFrameFormat * > aTmpSpzArray;
1891 mxDoc->FindFlyByName(rReference);
1893 for (
size_t n = 0;
n < nCnt; ++
n)
1908 nChainState =
mxDoc->Chainable(rFormat, rFormat1);
1910 nChainState =
mxDoc->Chainable(rFormat1, rFormat);
1914 aTmpSpzArray.push_back(&rFormat1);
1920 if (!aTmpSpzArray.empty())
1922 aPrevPageVec.clear();
1923 aThisPageVec.clear();
1924 aNextPageVec.clear();
1930 for (
const auto& rpFormat : aTmpSpzArray)
1932 const OUString aString = rpFormat->GetName();
1936 if (aString != rReference && aString != rFormat.
GetName())
1941 if (nNum1 == nPageNum -1)
1942 aPrevPageVec.push_back(aString);
1943 else if (nNum1 == nPageNum)
1944 aThisPageVec.push_back(aString);
1945 else if (nNum1 == nPageNum + 1)
1946 aNextPageVec.push_back(aString);
1948 aRestVec.push_back(aString);
1955 mxDoc->Chain(rFormat, *pOldChainNext);
1958 mxDoc->Chain(*pOldChainPrev, rFormat);
2099#if OSL_DEBUG_LEVEL > 0
2102 OSL_ENSURE( bStarMath,
"AlignFormulaToBaseline should only be called for Math objects" );
2109 OSL_ENSURE( pFly ,
"No fly frame!" );
2113 if ( !pFly || !pFrameFormat || RndStdIds::FLY_AS_CHAR != pFrameFormat->
GetAnchor().
GetAnchorId() )
2120 uno::Reference < beans::XPropertySet > xSet( xObj->getComponent(), uno::UNO_QUERY );
2125 aBaseline = xSet->getPropertyValue(
"BaseLine");
2127 catch ( uno::Exception& )
2129 OSL_FAIL(
"Baseline could not be retrieved from Starmath!" );
2134 sal_Int32 nBaseline = ::comphelper::getINT32(aBaseline);
2137 OSL_ENSURE( nBaseline > 0,
"Wrong value of Baseline while retrieving from Starmath!" );
2140 OSL_ENSURE( pFlyFrameFormat,
"fly frame format missing!" );
2141 if ( pFlyFrameFormat )
2146 aVert.
SetPos( -nBaseline );
2149 pFrameFormat->LockModify();
2151 pFrameFormat->UnlockModify();
2168 const uno::Reference < embed::XEmbeddedObject > & xObj( pOleNode->
GetOLEObj().
GetOleRef() );
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 SwDrawFrameFormat * InsertDrawObj(const SwPaM &rRg, SdrObject &rDrawObj, const SfxItemSet &rFlyAttrSet)=0
Insert a DrawObject.
virtual SwFlyFrameFormat * InsertGraphic(const SwPaM &rRg, const OUString &rGrfName, const OUString &rFltName, const Graphic *pGraphic, const SfxItemSet *pFlyAttrSet, const SfxItemSet *pGrfAttrSet, SwFrameFormat *)=0
Insert graphic or formula.
virtual SwFlyFrameFormat * InsertEmbObject(const SwPaM &rRg, const svt::EmbeddedObjectRef &xObj, SfxItemSet *pFlyAttrSet)=0
Insert OLE-objects.
virtual const SwRootFrame * GetCurrentLayout() const =0
virtual AppendResult AppendRedline(SwRangeRedline *pNewRedl, bool bCallDelete)=0
Append a new redline.
virtual void SetModified()=0
Must be called manually at changes of format.
SAL_WARN_UNUSED_RESULT Point LogicToPixel(const Point &rLogicPt) const
constexpr tools::Long Y() const
void setX(tools::Long nX)
void setY(tools::Long nY)
constexpr tools::Long X() const
constexpr tools::Long getX() const
constexpr tools::Long getY() const
void SetAllMarkedRect(const tools::Rectangle &rRect)
size_t GetMarkCount() const
SdrMark * GetMark(size_t nNum) const
const SdrMarkList & GetMarkedObjectList() const
bool AreObjectsMarked() const
SdrObject * PickObj(const Point &rPnt, short nTol, SdrPageView *&rpPV, SdrSearchOptions nOptions, SdrObject **ppRootObj, bool *pbHitPassDirect=nullptr) const
sal_uInt16 GetMarkHdlSizePixel() const
bool MarkObj(const Point &rPnt, short nTol=-2, bool bToggle=false, bool bDeep=false)
SdrObject * GetMarkedSdrObj() const
SdrObject * GetObj(size_t nNum) const
SdrObjUserCall * GetUserCall() const
virtual OUString GetTitle() const
virtual void SetTitle(const OUString &rStr)
virtual void SetDescription(const OUString &rStr)
virtual SdrInventor GetObjInventor() const
sal_uInt32 GetOrdNum() const
virtual const tools::Rectangle & GetCurrentBoundRect() const
virtual OUString GetDescription() const
virtual const tools::Rectangle & GetSnapRect() const
virtual const OUString & GetName() const
virtual SdrObjList * getChildrenOfSdrObject() const
virtual void SetLayer(SdrLayerID nLayer)
virtual void SetDecorative(bool isDecorative)
virtual bool IsDecorative() const
virtual void SetRelativePos(const Point &rPnt)
virtual Point GetRelativePos() const
sal_uInt16 GetHitTolerancePixel() const
void SetHitTolerancePixel(sal_uInt16 nVal)
sal_uInt16 getHitTolLog() const
const css::uno::Reference< css::awt::XControlModel > & GetUnoControlModel() const
const SfxPoolItem * GetCurItem() const
const SfxPoolItem * NextItem()
const WhichRangesContainer & GetRanges() const
void SetParent(const SfxItemSet *pNew)
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
const SfxItemSet * GetParent() const
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
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
bool Set(const SfxItemSet &, bool bDeep=true)
constexpr tools::Long Height() const
tools::Long AdjustHeight(tools::Long n)
tools::Long AdjustWidth(tools::Long n)
constexpr tools::Long Width() const
static sal_uInt16 IsMath(const SvGlobalName &rName)
bool IsPosProtected() const
bool IsSizeProtected() const
void SetHeight(tools::Long n)
void SetWidth(tools::Long n)
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
SwPageFrame * FindPageFrameOfAnchor()
method to determine the page frame, on which the 'anchor' of the given anchored object is.
SwContentFrame is the layout for content nodes: a common base class for text (paragraph) and non-text...
SwContentFrame * getLayoutFrame(const SwRootFrame *, const SwPosition *pPos=nullptr, std::pair< Point, bool > const *pViewPosAndCalcFrame=nullptr) const
Point & GetCursorDocPos() const
void ParkCursor(const SwNode &rIdx)
Remove selections and additional cursors of all shells.
SwCursor * GetCursor(bool bMakeTableCursor=true) const
Return pointer to the current shell cursor.
void EndAction(const bool bIdleEnd=false)
static sal_Int32 StartOfInputFieldAtPos(const SwPosition &rPos)
SwContentFrame * GetCurrFrame(const bool bCalcFrame=true) const
Get current frame in which the cursor is positioned.
static bool PosInsideInputField(const SwPosition &rPos)
SwFlyFrameFormat * MakeFlySection(RndStdIds eAnchorType, const SwPosition *pAnchorPos, const SfxItemSet *pSet=nullptr, SwFrameFormat *pParent=nullptr, bool bCalledFromShell=false)
void SetFlyFrameTitle(SwFlyFrameFormat &rFlyFrameFormat, const OUString &sNewTitle)
void SetFlyName(SwFlyFrameFormat &rFormat, const OUString &rName)
IDocumentState const & getIDocumentState() const
void SetFlyFrameDecorative(SwFlyFrameFormat &rFlyFrameFormat, bool isDecorative)
OUString GetUniqueGrfName(std::u16string_view rPrefix=std::u16string_view()) const
void SetFlyFrameDescription(SwFlyFrameFormat &rFlyFrameFormat, const OUString &sNewDescription)
void SetAttr(const SfxPoolItem &, SwFormat &)
Set attribute in given format.1y If Undo is enabled, the old values is added to the Undo history.
IDocumentContentOperations const & getIDocumentContentOperations() const
IDocumentUndoRedo & GetIDocumentUndoRedo()
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
SwFlyFrameFormat * MakeFlyAndMove(const SwPaM &rPam, const SfxItemSet &rSet, const SwSelBoxes *pSelBoxes, SwFrameFormat *pParent)
bool SetFlyFrameAttr(SwFrameFormat &rFlyFormat, SfxItemSet &rSet)
bool IsInHeaderFooter(const SwNode &) const
new class for re-direct methods calls at a 'virtual' drawing object to its referenced object.
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.
bool GetLastUndoInfo(OUString *const o_pStr, SwUndoId *const o_pId, const SwView *pView=nullptr) const
SwUndoId EndUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Closes parenthesis of nUndoId, not used by UI.
SwFlyFrame * GetSelectedFlyFrame() const
SwRect GetFlyRect() const
For moving flys with keyboard.
SwFlyFrame * GetSelectedOrCurrFlyFrame() const
const Graphic * GetGrfAtPos(const Point &rDocPos, OUString &rName, bool &rbLink) const
Deliver graphic in rName besides graphic name.
bool SetFlyFrameAttr(SfxItemSet &rSet)
void AlignFormulaToBaseline(const css::uno::Reference< css::embed::XEmbeddedObject > &xObj)
for starmath formulas anchored 'as char' it aligns it baseline to baseline changing the previous vert...
void SetObjDescription(const OUString &rDescription)
void SetFrameFormat(SwFrameFormat *pFormat, bool bKeepOrient=false, Point const *pDocPos=nullptr)
If frame then set frame style.
void GetConnectableFrameFormats(SwFrameFormat &rFormat, const OUString &rReference, bool bSuccessors, std::vector< OUString > &aPrevPageVec, std::vector< OUString > &aThisPageVec, std::vector< OUString > &aNextPageVec, std::vector< OUString > &aRestVec)
OUString GetFlyName() const
void SetFlyPos(const Point &rAbsPos)
OUString GetObjTitle() const
OUString GetUniqueGrfName() const
Created unique name for frame.
void SetObjTitle(const OUString &rTitle)
SwFlyFrameFormat * InsertObject(const svt::EmbeddedObjectRef &, SfxItemSet *pFlyAttrSet)
void SetFlyName(const OUString &rName)
Set name at selected FlyFrame.
const SwFrameFormat * SelFlyGrabCursor()
If a fly is selected, it draws cursor into the first ContentFrame.
Point FindAnchorPos(const Point &rAbsPos, bool bMoveIt=false)
void SetObjDecorative(bool isDecorative)
OUString GetObjDescription() const
bool SetDrawingAttr(SfxItemSet &rSet)
const SwFrameFormat * IsURLGrfAtPos(const Point &rPt, OUString *pURL=nullptr, OUString *pTargetFrameName=nullptr, OUString *pURLDescription=nullptr) const
Position is a graphic with URL?
css::uno::Reference< css::embed::XEmbeddedObject > GetOleRef() const
get reference to OLE object (if there is one) for selected FlyFrame
void SetObjRect(const SwRect &rRect)
Set size of draw objects.
SwFrameFormat * GetSelectedFrameFormat() const
If frame then frame style, else 0.
void ChgAnchor(RndStdIds eAnchorId, bool bSameOnly=false, bool bPosCorr=true)
frmatr.hxx.
SAL_DLLPRIVATE void EndAllActionAndCall()
Terminate actions for all shells and call ChangeLink.
const SwFrameFormat * GetFormatFromObj(const Point &rPt, SwRect **pRectToFill=nullptr) const
ObjCntType GetObjCntTypeOfSelection() const
void ReplaceSdrObj(const OUString &rGrfName, const Graphic *pGrf)
void Insert(const OUString &rGrfName, const OUString &rFltName, const Graphic *pGraphic, const SfxItemSet *pFlyAttrSet)
static SfxItemSetFixed< RES_VERT_ORIENT, RES_ANCHOR > makeItemSetFromFormatAnchor(SfxItemPool &rPool, const SwFormatAnchor &rAnchor)
void InsertDrawObj(SdrObject &rDrawObj, const Point &rInsertPosition)
Insertion of a drawing object which have to be already inserted in the DrawModel.
const SwFrameFormat * NewFlyFrame(const SfxItemSet &rSet, bool bAnchValid=false, SwFrameFormat *pParent=nullptr)
SwFrameFormat * WizardGetFly()
Find/delete fly containing the cursor.
sal_uInt16 GetPhyPageNum() const
Phy: real page count.
SwFlyFrame * GetCurrFlyFrame(const bool bCalcFrame=true) const
bool m_bCheckForOLEInCaption
SwRect GetObjRect() const
For adjustment of PosAttr when anchor changes.
static ObjCntType GetObjCntType(const SdrObject &rObj)
void AlignAllFormulasToBaseline()
aligns all formulas with anchor 'as char' to baseline
bool GetFlyFrameAttr(SfxItemSet &rSet) const
Size RequestObjectResize(const SwRect &rRect, const css::uno::Reference< css::embed::XEmbeddedObject > &)
OLE.
SAL_DLLPRIVATE SwFlyFrame * FindFlyFrame(const css::uno::Reference< css::embed::XEmbeddedObject > &) const
const SwFrameFormat * GetFormatFromAnyObj(const Point &rPt) 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 SetPageObjsNewPage(std::vector< SwFrameFormat * > &rFillArr)
bool IsObjDecorative() const
void ResetFlyFrameAttr(const SfxItemSet *pSet)
const SwFrameFormat * IsFlyInFly()
Is selected frame within another frame?
void GetPageObjs(std::vector< SwFrameFormat * > &rFillArr)
SS for envelopes: get all page-bound objects and set them to new page.
void SelectFlyFrame(SwFlyFrame &rFrame)
const SwFrameFormat * GetFlyFrameFormat() const
Get FlyFrameFormat; for UI macro linkage at Flys.
SwFieldTypesEnum GetTypeId() const
Flys that are anchored to content (at-para, at-char) but not in content (as-char).
general base class for all free-flowing frames
const SwVirtFlyDrawObj * GetVirtDrawObj() const
virtual const SwFlyFrameFormat * GetFormat() const override
bool IsFlyAtContentFrame() const
void SelectionHasChanged(SwFEShell *pShell)
bool IsFlyInContentFrame() const
virtual Size ChgSize(const Size &aNewSize) override
bool IsFlyFreeFrame() const
void ChgRelPos(const Point &rAbsPos)
Change the relative position.
bool isTransformableSwFrame() const
const SwRect & getFrameArea() const
const SwRect & getFramePrintArea() const
Base class of the Writer layout elements.
SwFlyFrame * FindFlyFrame()
Point GetFrameAnchorPos(bool bIgnoreFlysAnchoredAtThisFrame) const
returns the position for anchors based on frame direction
bool IsProtected() const
Is the Frame or rather the Section in which it lies protected?
virtual bool GetModelPositionForViewPoint(SwPosition *, Point &, SwCursorMoveState *=nullptr, bool bTestBackground=false) const
SwLayoutFrame * GetUpper()
SwRootFrame * getRootFrame()
bool IsNoTextFrame() const
void SetCompletePaint() const
SwPageFrame * FindPageFrame()
SwFrame * FindFooterOrHeader()
sal_uInt16 GetPhyPageNum() const
virtual bool GetCharRect(SwRect &, const SwPosition &, SwCursorMoveState *=nullptr, bool bAllowFarAway=true) const
const tools::SvRef< sfx2::SvBaseLink > & GetLink() const
const Graphic & GetGrf(bool bWait=false) const
bool GetFileFilterNms(OUString *pFileNm, OUString *pFilterNm) const
bool IsGrfLink() const
Query link-data.
A layout frame is a frame that contains other frames (m_pLower), e.g. SwPageFrame or SwTabFrame.
virtual const SwFrameFormat * GetFormat() const
const SwFrame * Lower() const
const SwContentNode * GetNode() const
Layout frame for SwNoTextNode, i.e. graphics and OLE nodes (including charts).
void SetContour(const tools::PolyPolygon *pPoly, bool bAutomatic=false)
Marks a node in the document model.
SwNodeIndex & Assign(SwNodes const &rNds, SwNodeOffset nIdx)
Base class of the Writer document model elements.
SwStartNode * GetStartNode()
const SwStartNode * FindFlyStartNode() const
SwOLENode * GetOLENode()
Inline methods from Node.hxx.
SwContentNode * GetContentNode()
SwNoTextNode * GetNoTextNode()
const SwEndNode * EndOfSectionNode() const
const SwOLEObj & GetOLEObj() const
css::uno::Reference< css::embed::XEmbeddedObject > const & GetOleRef()
PaM is Point and Mark: a selection of the document model.
SwNode & GetPointNode() const
bool IsMultiSelection() const
SwContentNode * GetPointContentNode() const
sal_uInt16 GetPageNum(bool bAtPoint=true, const Point *pLayPos=nullptr)
Get number of page which contains cursor.
const SwPosition * GetPoint() const
const SwPosition * Start() const
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
A page of the document layout.
void InvalidateContent() const
void InvalidateFlyLayout() const
Validate, invalidate and query the Page status Layout/Content and Fly/non-Fly respectively are inspec...
sal_uInt16 GetPhyPageNum() const
Of course Writer needs its own rectangles.
void Height(tools::Long nNew)
void Top(const tools::Long nTop)
void Bottom(const tools::Long nBottom)
void Pos(const Point &rNew)
void SSize(const Size &rNew)
tools::Rectangle SVRect() const
void Left(const tools::Long nLeft)
void Width(tools::Long nNew)
The root element of a Writer document layout.
sal_uInt16 GetPageNum() const
void SetAssertFlyPages()
Makes sure that all requested page-bound Flys find a Page.
virtual bool GetModelPositionForViewPoint(SwPosition *, Point &, SwCursorMoveState *=nullptr, bool bTestBackground=false) const override
Primary passes the call to the first page.
Represents the current text cursor of one opened edit window.
SwShellCursor * GetNext()
const Point & GetPtPos() const
Starts a section of nodes in the document model.
A wrapper around SfxPoolItem to store the start position of (usually) a text portion,...
static SwFrameFormat * getOtherTextBoxFormat(const SwFrameFormat *pFormat, sal_uInt16 nType, const SdrObject *pObject=nullptr)
If we have an associated TextFrame, then return that.
static bool changeAnchor(SwFrameFormat *pShape, SdrObject *pObj)
Sets the anchor of the associated textframe of the given shape, and returns true on success.
static void syncFlyFrameAttr(SwFrameFormat &rShape, SfxItemSet const &rSet, SdrObject *pObj)
Similar to syncProperty(), but used by the internal API (e.g. for UI purposes).
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
const OUString & GetText() const
Returns the text portion we want to edit (for inline see underneath)
SwTextNode const * GetTextNodeForParaProps() const
SwDrawView * GetDrawView()
SdrPageView * GetPageView()
vcl::RenderContext * GetOut() const
const SwNodes & GetNodes() const
rtl::Reference< SwDoc > mxDoc
The document; never 0.
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.
const SfxItemPool & GetAttrPool() const
void MakeVisible(const SwRect &)
SwFlyFrame * GetFlyFrame()
virtual bool IsPending() const
static bool TryRunningState(const css::uno::Reference< css::embed::XEmbeddedObject > &)
SwTextAttr const * NextAttr(SwTextNode const **ppNode=nullptr)
ring_container GetRingContainer()
@ SetOnlyText
stay with the cursor inside text
virtual SotClipboardFormatId GetFormat(const TransferableDataHelper &aHelper) override
EmbeddedObjectRef * pObject
static bool lcl_FindAnchorPos(SwDoc &rDoc, const Point &rPt, const SwFrame &rFrame, SfxItemSet &rSet)
bool sw_ChkAndSetNewAnchor(const SwFlyFrame &rFly, SfxItemSet &rSet)
also used in unoframe.cxx
static bool lcl_SetNewFlyPos(const SwNode &rNode, SwFormatAnchor &rAnchor, const Point &rPt)
static sal_uInt16 SwFormatGetPageNum(const SwFlyFrameFormat *pFormat)
@ OBJCNT_DONTCARE
Not determinable - different objects are selected.
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< SwFormatHoriOrient > RES_HORI_ORIENT(109)
constexpr TypedWhichId< SwFormatVertOrient > RES_VERT_ORIENT(108)
constexpr TypedWhichId< SwFormatFillOrder > RES_FILL_ORDER(RES_FRMATR_BEGIN)
constexpr TypedWhichId< SvxOpaqueItem > RES_OPAQUE(105)
constexpr TypedWhichId< SwFlyFrameFormat > RES_FLYFRMFMT(162)
constexpr TypedWhichId< SwFormatField > RES_TXTATR_FIELD(RES_TXTATR_NOEND_BEGIN)
constexpr TypedWhichId< SwDrawFrameFormat > RES_DRAWFRMFMT(165)
constexpr TypedWhichId< SwFormatAnchor > RES_ANCHOR(110)
constexpr TypedWhichId< SfxBoolItem > RES_DECORATIVE(140)
constexpr TypedWhichId< SwFormatChain > RES_CHAIN(120)
constexpr TypedWhichId< SwFormatSurround > RES_SURROUND(107)
constexpr TypedWhichId< SwFormatContent > RES_CNTNT(101)
WhichRangesContainer const aFrameFormatSetRange(svl::Items< RES_FRMATR_BEGIN, RES_FRMATR_END-1, RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1, XATTR_FILL_FIRST, XATTR_FILL_LAST >)
constexpr auto toTwips(N number, Length from)
Color GetLineColor(Color const &rColor, DrawModeFlags nDrawMode, StyleSettings const &rStyleSettings)
SwNodeOffset abs(const SwNodeOffset &a)
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.
bool IsInvalidItem(const SfxPoolItem *pItem)
Marks a position in the document model.
void Assign(const SwNode &rNd, SwNodeOffset nDelta, sal_Int32 nContentOffset=0)
These all set both nNode and nContent.
void SetContent(sal_Int32 nContentIndex)
Set content index, only valid to call this if the position points to a SwContentNode subclass.
sal_Int32 GetContentIndex() const
Reference< XModel > xModel
void GetTableSel(const SwCursorShell &rShell, SwSelBoxes &rBoxes, const SwTableSearchType eSearchType)
void ClrContourCache(const SdrObject *pObj)