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>
44 #include <viewimp.hxx>
94 std::pair<Point, bool>
const tmp(rPt,
false);
97 nullptr, &tmp) :
nullptr;
101 rAnchor.
SetType( RndStdIds::FLY_AT_PAGE );
118 Point aTmpPnt( rPt );
121 case RndStdIds::FLY_AS_CHAR:
122 case RndStdIds::FLY_AT_PARA:
123 case RndStdIds::FLY_AT_CHAR:
136 ? *
static_cast<SwTextFrame const*
>(pNewAnch)->GetTextNodeForParaProps()
138 if ((RndStdIds::FLY_AT_CHAR == nNew) || (RndStdIds::FLY_AS_CHAR == nNew))
143 aTmpPnt.setX(aTmpPnt.getX() - 1);
148 static_cast<SwTextFrame const*>(pNewAnch));
155 aPos = pTextFrame->MapViewToModelPos(
167 aNewAnch.SetAnchor( &aPos );
171 case RndStdIds::FLY_AT_FLY:
177 aTmpPnt.setX(aTmpPnt.getX() - 1);
180 aPos.nNode.GetNode().GetContentNode()->getLayoutFrame(rFrame.
getRootFrame(),
nullptr,
nullptr),
183 if( pNewAnch && &rFrame != pNewAnch && !pNewAnch->
IsProtected() )
185 aPos.nNode = *
static_cast<const SwFlyFrame*
>(pNewAnch)->GetFormat()->GetContent().
187 aNewAnch.SetAnchor( &aPos );
192 nNew = RndStdIds::FLY_AT_PAGE;
193 aNewAnch.SetType( nNew );
196 case RndStdIds::FLY_AT_PAGE:
202 OSL_ENSURE(
false,
"Wrong Id for new anchor." );
205 rSet.
Put( aNewAnch );
226 #if OSL_DEBUG_LEVEL > 0
227 OSL_ENSURE( !(nNew == RndStdIds::FLY_AT_PAGE &&
228 (RndStdIds::FLY_AT_PARA==nOld || RndStdIds::FLY_AT_CHAR==nOld || RndStdIds::FLY_AS_CHAR==nOld ) &&
230 "forbidden anchor change in Head/Foot." );
251 OSL_ENSURE( rFrame.
IsFlyFrame(),
"SelectFlyFrame wants a Fly" );
337 pFly = pFlyObj->GetFlyFrame()->GetAnchorFrame();
344 OSL_ENSURE( pFly,
"IsFlyInFly: Where's my anchor?" );
345 OSL_ENSURE( pFly->
IsFlyFrame(),
"IsFlyInFly: Funny anchor!" );
346 return static_cast<const SwFlyFrame*
>(pFly)->GetFormat();
356 Point aPoint( aTmpPos );
357 aPoint.setX(aPoint.getX() - 1);
361 std::pair<Point, bool>
const tmp(aTmpPos,
false);
391 TransformableSwFrame* pTransformableSwFrame(static_cast<SwFlyFreeFrame*>(pFly)->getTransformableSwFrame());
393 const Point aNewAbsPos(
395 rAbsPos.Y() + aUntransformedFrameArea.Top() - pFly->
getFrameArea().
Top());
409 aOrient.setX(rAbsPos.getX());
412 aOrient.setX(rAbsPos.getX() - aOrient.getX());
413 aOrient.setY(rAbsPos.getY() - aOrient.getY());
439 if ( RndStdIds::FLY_AS_CHAR == nAnchorId )
444 bool bTextBox =
false;
451 const SwFrame* pFooterOrHeader =
nullptr;
465 if ( RndStdIds::FLY_AT_PAGE != nAnchorId )
476 pFly = pFlyFormat->GetFrame();
497 Point aTmpPnt( rAbsPos );
507 const SwFrame *pNewAnch =
nullptr;
508 if( pTextFrame !=
nullptr )
510 if ( RndStdIds::FLY_AT_PAGE == nAnchorId )
518 if( RndStdIds::FLY_AT_FLY == nAnchorId )
545 if ( bMoveIt || (nAnchorId == RndStdIds::FLY_AT_CHAR) )
550 case RndStdIds::FLY_AT_PARA:
554 ? *
static_cast<SwTextFrame const*
>(pTextFrame)->GetTextNodeForParaProps()
557 aAnch.SetAnchor( &pos );
560 case RndStdIds::FLY_AT_PAGE:
562 aAnch.SetPageNum( static_cast<const SwPageFrame*>(pNewAnch)->
567 case RndStdIds::FLY_AT_FLY:
569 SwPosition aPos( *static_cast<const SwFlyFrame*>(pNewAnch)->GetFormat()->
570 GetContent().GetContentIdx() );
571 aAnch.SetAnchor( &aPos );
575 case RndStdIds::FLY_AT_CHAR:
578 Point aTmpPnt( rAbsPos );
583 aRet = aTmpRect.
Pos();
589 aAnch.SetAnchor( &pos );
605 std::unique_ptr<SwHandleAnchorNodeChg, o3tl::default_delete<SwHandleAnchorNodeChg>> pHandleAnchorNodeChg;
606 SwFlyFrameFormat* pFlyFrameFormat( dynamic_cast<SwFlyFrameFormat*>(&rFormat) );
607 if ( pFlyFrameFormat )
609 pHandleAnchorNodeChg.reset(
629 SwRect aTmpRect( aRet, rAbsPos );
632 #if OSL_DEBUG_LEVEL > 0
636 OSL_FAIL(
"Hey, Joe: Where's my Null Pen?" );
656 bool bMoveContent =
true;
660 if( !aBoxes.
empty() )
674 bMoveContent =
false;
677 bMoveContent =
false;
685 case RndStdIds::FLY_AT_PAGE:
690 case RndStdIds::FLY_AT_FLY:
691 case RndStdIds::FLY_AT_PARA:
692 case RndStdIds::FLY_AT_CHAR:
693 case RndStdIds::FLY_AS_CHAR:
696 if( RndStdIds::FLY_AT_FLY != eRndId )
702 eRndId = RndStdIds::FLY_AT_PAGE;
708 OSL_ENSURE(
false,
"What is the purpose of this Fly?" );
716 std::unique_ptr<SwFormatAnchor> pOldAnchor;
717 bool bHOriChgd =
false, bVOriChgd =
false;
718 std::shared_ptr<SwFormatVertOrient> aOldV;
719 std::shared_ptr<SwFormatHoriOrient> aOldH;
721 if ( RndStdIds::FLY_AT_PAGE != eRndId )
735 aOldH.reset(static_cast<SwFormatHoriOrient*>(pItem->
Clone()));
742 aOldV.reset(static_cast<SwFormatVertOrient*>(pItem->
Clone()));
762 ? *
static_cast<SwTextFrame const*
>(pAnch)->GetTextNodeForParaProps()
765 if ( RndStdIds::FLY_AS_CHAR == eRndId )
770 pOldAnchor->SetAnchor( &aPos );
774 bool const bDoesUndo =
846 case RndStdIds::FLY_AT_PARA:
847 case RndStdIds::FLY_AT_CHAR:
848 case RndStdIds::FLY_AS_CHAR:
854 case RndStdIds::FLY_AT_FLY:
861 case RndStdIds::FLY_AT_PAGE:
878 OSL_ENSURE(pFormat,
"IDocumentContentOperations::InsertGraphic failed.");
881 }
while( pCursor != pStartCursor );
915 rPaM, xObj, pFlyAttrSet );
916 OSL_ENSURE(pFormat,
"IDocumentContentOperations::InsertEmbObject failed.");
936 const Point& rInsertPosition )
950 Point aTmpPt( rInsertPosition );
952 const SwFrame* pFrame = aPam.GetContentNode()->getLayoutFrame(
GetLayout(),
nullptr,
nullptr);
984 for(
auto pFormat : *
mxDoc->GetSpzFrameFormats() )
986 if (RndStdIds::FLY_AT_PAGE == pFormat->GetAnchor().GetAnchorId())
988 rFillArr.push_back( pFormat );
995 if( rFillArr.empty() )
1002 sal_uInt16 nMaxPage = pTmpRootFrame->
GetPageNum();
1003 bool bTmpAssert =
false;
1004 for(
auto pFormat : rFillArr )
1006 if (
mxDoc->GetSpzFrameFormats()->IsAlive(pFormat))
1011 if (RndStdIds::FLY_AT_PAGE != aNewAnchor.GetAnchorId())
1014 sal_uInt16 nNewPage = aNewAnchor.
GetPageNum() + 1;
1015 if (nNewPage > nMaxPage)
1020 pFormat->DelFrames();
1023 aNewAnchor.SetPageNum(nNewPage);
1024 mxDoc->SetAttr( aNewAnchor, *pFormat );
1043 OSL_ENSURE(
false,
"GetFlyFrameAttr, no Fly selected." );
1047 CurrShell aCurr( const_cast<SwFEShell*>(
this) );
1060 if ( RndStdIds::FLY_AT_PAGE != eType )
1064 if ( RndStdIds::FLY_AS_CHAR == eType )
1089 OSL_ENSURE(pFly,
"SetFlyFrameAttr, no Fly selected.");
1129 if ( !rSet.
Count() ||
1169 OSL_ENSURE( pFly,
"SetFlyFrameAttr, no Fly selected." );
1180 sal_uInt16 nWhich = pItem->Which();
1208 if (
const SwFlyFrameFormat* pFlyFormat = dynamic_cast<const SwFlyFrameFormat*>(pFormat))
1209 pFly = pFlyFormat->GetFrame();
1213 OSL_ENSURE( pFly,
"SetFrameFormat: no frame" );
1223 std::unique_ptr<SfxItemSet> pSet;
1228 pSet->Put( *pItem );
1235 if(
GetDoc()->SetFrameFormatToFly( *pFlyFormat, *pNewFormat, pSet.get(), bKeepOrient ))
1303 aResult = rRect.
SSize();
1330 pAnchor->IsTextFrame() &&
1331 !pAnchor->GetNext() && !pAnchor->GetPrev() &&
1332 pAnchor->GetUpper()->IsFlyFrame())
1351 aFrameSz.
SetWidth( aNewSz.Width() );
1357 aFrameSz.SetHeight( aNewSz.Height() );
1360 pFormat->GetDoc()->SetAttr( aFrameSz, *pFormat );
1372 aResult = pFly->
ChgSize( aSz );
1378 pNd->SetContour(
nullptr );
1386 if ( rRect.
Top() != LONG_MIN && rRect.
Pos() != aPt && !bPosProt )
1396 static_cast<SwFlyAtContentFrame*>(pFly)->SetAbsPos( aPt );
1405 rVert.
GetPos() + lYDiff );
1411 OSL_ENSURE( pFlyFrameFormat,
"fly frame format missing!" );
1412 if ( pFlyFrameFormat )
1425 if( !rSpzArr.
empty() )
1428 if( rCursorNd.
GetIndex() >
mxDoc->GetNodes().GetEndOfExtras().GetIndex() )
1432 for(
auto pFormat : rSpzArr )
1434 const SwNodeIndex* pIdx = pFormat->GetContent(
false ).GetContentIdx();
1455 OSL_ENSURE(
false,
"no FlyFrame selected" );
1465 OSL_ENSURE(
false,
"no FlyFrame selected" );
1471 uno::Reference < embed::XEmbeddedObject > xObj;
1488 OUString *pTargetFrameName,
1489 OUString *pDescription )
const
1509 bool bSetTargetFrameName = pTargetFrameName !=
nullptr;
1510 bool bSetDescription = pDescription !=
nullptr;
1514 if ( pObject && !pObject->
GetURL().isEmpty() )
1517 *pURL = pObject->
GetURL();
1518 if ( bSetTargetFrameName && !pObject->
GetTarget().isEmpty() )
1520 bSetTargetFrameName =
false;
1521 *pTargetFrameName = pObject->
GetTarget();
1523 if ( bSetDescription )
1525 bSetDescription =
false;
1543 aPt,
MapMode( MapUnit::MapTwip ) );
1544 *pURL = *pURL +
"?" + OUString::number( aPt.getX() )
1545 +
"," + OUString::number(aPt.getY() );
1550 if ( bSetTargetFrameName )
1552 if ( bSetDescription )
1561 OUString &rName,
bool &rbLink )
const
1589 if ( rName.isEmpty() )
1591 return &pNd->
GetGrf(
true);
1617 pRet = pFlyObj->GetFormat();
1619 pRet = static_cast<SwDrawContact*>(pObj->
GetUserCall())->GetFormat();
1620 if(pRet && pRectToFill)
1638 std::pair<Point, bool>
const tmp(rPt,
false);
1640 pRet = pFrame ?
static_cast<SwLayoutFrame*
>(pFrame)->GetFormat() :
nullptr;
1652 if (
const SwDrawVirtObj* pDrawVirtObj = dynamic_cast<const SwDrawVirtObj*>( &rObj))
1654 pInvestigatedObj = &(pDrawVirtObj->GetReferencedObj());
1658 pInvestigatedObj = &rObj;
1664 uno::Reference< awt::XControlModel >
xModel =
1669 OUString
sName(
"ButtonType");
1670 uno::Reference< beans::XPropertySet > xSet(xModel, uno::UNO_QUERY);
1672 uno::Reference< beans::XPropertySetInfo > xInfo = xSet->getPropertySetInfo();
1673 if(xInfo->hasPropertyByName( sName ))
1675 aVal = xSet->getPropertyValue( sName );
1676 if( aVal.
hasValue() && form::FormButtonType_URL == *o3tl::doAccess<form::FormButtonType>(aVal) )
1681 else if (
const SwVirtFlyDrawObj *pFlyObj = dynamic_cast<const SwVirtFlyDrawObj*>(pInvestigatedObj))
1683 const SwFlyFrame *pFly = pFlyObj->GetFlyFrame();
1694 else if ( dynamic_cast<const SdrObjGroup*>( pInvestigatedObj) != nullptr )
1697 if ( !pDrawContact )
1699 OSL_FAIL(
"<SwFEShell::GetObjCntType(..)> - missing draw contact object" );
1705 if ( !pFrameFormat )
1707 OSL_FAIL(
"<SwFEShell::GetObjCntType(..)> - missing frame format" );
1710 else if ( RndStdIds::FLY_AS_CHAR != pFrameFormat->GetAnchor().GetAnchorId() )
1764 else if( eTmp != eType )
1781 ( pMrkList = &
Imp()->
GetDrawView()->GetMarkedObjectList())->GetMarkCount()) )
1793 if( dynamic_cast<const SwVirtFlyDrawObj*>( pObj) == nullptr )
1822 *
GetCursor(), rGrfName,
"", pGrf, &aFrameSet,
nullptr,
nullptr);
1830 OSL_ENSURE(pFormat !=
nullptr,
"invalid argument");
1836 if (pFrame !=
nullptr)
1845 const OUString & rReference,
1847 std::vector< OUString > & aPrevPageVec,
1848 std::vector< OUString > & aThisPageVec,
1849 std::vector< OUString > & aNextPageVec,
1850 std::vector< OUString > & aRestVec)
1859 mxDoc->Unchain(rFormat);
1862 mxDoc->Unchain(*pOldChainPrev);
1867 std::vector< const SwFrameFormat * > aTmpSpzArray;
1869 mxDoc->FindFlyByName(rReference);
1871 for (
size_t n = 0;
n < nCnt; ++
n)
1886 nChainState =
mxDoc->Chainable(rFormat, rFormat1);
1888 nChainState =
mxDoc->Chainable(rFormat1, rFormat);
1892 aTmpSpzArray.push_back(&rFormat1);
1898 if (!aTmpSpzArray.empty())
1900 aPrevPageVec.clear();
1901 aThisPageVec.clear();
1902 aNextPageVec.clear();
1908 for (
const auto& rpFormat : aTmpSpzArray)
1910 const OUString aString = rpFormat->GetName();
1914 if (aString != rReference && aString != rFormat.
GetName())
1919 if (nNum1 == nPageNum -1)
1920 aPrevPageVec.push_back(aString);
1921 else if (nNum1 == nPageNum)
1922 aThisPageVec.push_back(aString);
1923 else if (nNum1 == nPageNum + 1)
1924 aNextPageVec.push_back(aString);
1926 aRestVec.push_back(aString);
1933 mxDoc->Chain(rFormat, *pOldChainNext);
1936 mxDoc->Chain(*pOldChainPrev, rFormat);
2028 #if OSL_DEBUG_LEVEL > 0
2031 OSL_ENSURE( bStarMath,
"AlignFormulaToBaseline should only be called for Math objects" );
2038 OSL_ENSURE( pFly ,
"No fly frame!" );
2042 if ( !pFly || !pFrameFormat || RndStdIds::FLY_AS_CHAR != pFrameFormat->
GetAnchor().
GetAnchorId() )
2049 uno::Reference < beans::XPropertySet > xSet( xObj->getComponent(), uno::UNO_QUERY );
2054 aBaseline = xSet->getPropertyValue(
"BaseLine");
2056 catch ( uno::Exception& )
2058 OSL_FAIL(
"Baseline could not be retrieved from Starmath!" );
2063 sal_Int32 nBaseline = ::comphelper::getINT32(aBaseline);
2064 const MapMode aSourceMapMode( MapUnit::Map100thMM );
2065 const MapMode aTargetMapMode( MapUnit::MapTwip );
2068 OSL_ENSURE( nBaseline > 0,
"Wrong value of Baseline while retrieving from Starmath!" );
2071 OSL_ENSURE( pFlyFrameFormat,
"fly frame format missing!" );
2072 if ( pFlyFrameFormat )
2077 aVert.
SetPos( -nBaseline );
2099 const uno::Reference < embed::XEmbeddedObject > & xObj( pOleNode->
GetOLEObj().
GetOleRef() );
vcl::RenderContext * GetOut() const
SwFrame * FindFooterOrHeader()
const SwEndNode * EndOfSectionNode() const
void GetPageObjs(std::vector< SwFrameFormat * > &rFillArr)
SS for envelopes: get all page-bound objects and set them to new page.
SAL_DLLPRIVATE void EndAllActionAndCall()
Terminate actions for all shells and call ChangeLink.
Starts a section of nodes in the document model.
void SetFlyName(const OUString &rName)
Set name at selected FlyFrame.
const OUString & GetTarget() const
const SwVirtFlyDrawObj * GetVirtDrawObj() const
Base class of the Writer layout elements.
Represents the visualization of a paragraph.
OUString GetUniqueGrfName() const
constexpr TypedWhichId< SwFormatSurround > RES_SURROUND(101)
constexpr TypedWhichId< SwFormatFillOrder > RES_FILL_ORDER(RES_FRMATR_BEGIN)
sal_uLong GetIndex() const
SwNode & GetNode(bool bPoint=true) const
virtual const SwFlyFrameFormat * GetFormat() const override
size_t GetMarkCount() const
Marks a position in the document model.
virtual const tools::Rectangle & GetCurrentBoundRect() const
void ChgAnchor(RndStdIds eAnchorId, bool bSameOnly=false, bool bPosCorr=true)
frmatr.hxx.
const SwFrameFormat * IsURLGrfAtPos(const Point &rPt, OUString *pURL=nullptr, OUString *pTargetFrameName=nullptr, OUString *pURLDescription=nullptr) const
Position is a graphic with URL?
const SwNodes & GetNodes() const
const tools::SvRef< sfx2::SvBaseLink > & GetLink() const
void InsertDrawObj(SdrObject &rDrawObj, const Point &rInsertPosition)
Insertion of a drawing object which have to be already inserted in the DrawModel. ...
bool IsMultiSelection() const
SwContentNode * GetNode(SwPaM &rPam, bool &rbFirst, SwMoveFnCollection const &fnMove, bool const bInReadOnly, SwRootFrame const *const i_pLayout)
This function returns the next node in direction of search.
SwPaM * GetCursor(bool bMakeTableCursor=true) const
Return pointer to the current shell cursor.
SwOLENode * GetOLENode()
Inline methods from Node.hxx.
const SwOLEObj & GetOLEObj() const
bool Set(const SfxItemSet &, bool bDeep=true)
virtual const SwRootFrame * GetCurrentLayout() const =0
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.
Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
SfxItemSet(const SfxItemSet &)
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const =0
const Graphic * GetGrfAtPos(const Point &rDocPos, OUString &rName, bool &rbLink) const
Deliver graphic in rName besides graphic name.
void Left(const tools::Long nLeft)
SwFrameFormat * WizardGetFly()
Find/delete fly containing the cursor.
void SetCompletePaint() const
void SetHitTolerancePixel(sal_uInt16 nVal)
bool AreObjectsMarked() const
SwRect GetFlyRect() const
For moving flys with keyboard.
virtual void SetModified()=0
Must be called manually at changes of format.
constexpr::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
const SwRect & getFramePrintArea() const
OUString GetDescription() const
bool GetLastUndoInfo(OUString *const o_pStr, SwUndoId *const o_pId, const SwView *pView=nullptr) const
virtual Point GetRelativePos() const
css::uno::Reference< css::embed::XEmbeddedObject > const & GetOleRef()
SwContentFrame * getLayoutFrame(const SwRootFrame *, const SwPosition *pPos=nullptr, std::pair< Point, bool > const *pViewPosAndCalcFrame=nullptr) const
virtual SwUndoId EndUndo(SwUndoId const eUndoId, SwRewriter const *const pRewriter)=0
Closes undo block.
SwCursor * GetSwCursor() const
SwUndoId EndUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Closes parenthesis of nUndoId, not used by UI.
virtual bool IsPending() const
SdrMark * GetMark(size_t nNum) const
constexpr TypedWhichId< SvxOpaqueItem > RES_OPAQUE(99)
void Pos(const Point &rNew)
IDocumentUndoRedo & GetIDocumentUndoRedo()
static SfxItemSet makeItemSetFromFormatAnchor(SfxItemPool &rPool, const SwFormatAnchor &rAnchor)
bool IsSizeProtected() const
Of course Writer needs its own rectangles.
SwFlyFrame * GetSelectedFlyFrame() const
void ClearCharRectAndTopOfLine()
reset members and
IDocumentContentOperations const & getIDocumentContentOperations() const
EmbeddedObjectRef * pObject
The root element of a Writer document layout.
static SwFrameFormat * getOtherTextBoxFormat(const SwFrameFormat *pFormat, sal_uInt16 nType)
If we have an associated TextFrame, then return that.
Value in Var-direction gives minimum (can be exceeded but not be less).
bool IsInHeaderFooter(const SwNodeIndex &rIdx) const
constexpr TypedWhichId< SwFlyFrameFormat > RES_FLYFRMFMT(156)
SwTextAttr const * NextAttr(SwTextNode const **ppNode=nullptr)
virtual const tools::Rectangle & GetSnapRect() const
sal_uInt16 GetPhyPageNum() const
void SelectFlyFrame(SwFlyFrame &rFrame)
virtual bool GetModelPositionForViewPoint(SwPosition *, Point &, SwCursorMoveState *=nullptr, bool bTestBackground=false) const
bool IsFlyAtContentFrame() const
constexpr TypedWhichId< SwFormatVertOrient > RES_VERT_ORIENT(102)
void SetAllMarkedRect(const tools::Rectangle &rRect)
virtual bool GetModelPositionForViewPoint(SwPosition *, Point &, SwCursorMoveState *=nullptr, bool bTestBackground=false) const override
Primary passes the call to the first page.
const SfxPoolItem * NextItem()
wrapper class for the positioning of Writer fly frames and drawing objects
SwFlyFrameFormat * MakeFlySection(RndStdIds eAnchorType, const SwPosition *pAnchorPos, const SfxItemSet *pSet=nullptr, SwFrameFormat *pParent=nullptr, bool bCalledFromShell=false)
constexpr TypedWhichId< SwDrawFrameFormat > RES_DRAWFRMFMT(159)
const SwFrameFormat * IsFlyInFly()
Is selected frame within another frame?
void SetPageObjsNewPage(std::vector< SwFrameFormat * > &rFillArr)
constexpr TypedWhichId< SwFormatHoriOrient > RES_HORI_ORIENT(103)
rtl::Reference< SwDoc > mxDoc
The document; never 0.
const SwRect & getFrameArea() const
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
A wrapper around SfxPoolItem to store the start position of (usually) a text portion, with an optional end.
void SetAttr(const SfxPoolItem &, SwFormat &)
Set attribute in given format.1y If Undo is enabled, the old values is added to the Undo history...
sal_uLong GetIndex() const
static bool isTextBox(const SwFrameFormat *pFormat, sal_uInt16 nType)
Is the frame format a text box?
virtual void DoUndo(bool const bDoUndo)=0
Enable/Disable Undo.
SwFlyFrameFormat * MakeFlyAndMove(const SwPaM &rPam, const SfxItemSet &rSet, const SwSelBoxes *pSelBoxes, SwFrameFormat *pParent)
void Width(tools::Long nNew)
void SetFlyName(SwFlyFrameFormat &rFormat, const OUString &rName)
static sal_uInt16 SwFormatGetPageNum(const SwFlyFrameFormat *pFormat)
SwFlyFrame * FindFlyFrame()
bool GetFileFilterNms(OUString *pFileNm, OUString *pFilterNm) const
const IDocumentDrawModelAccess & getIDocumentDrawModelAccess() const
Provides access to the document draw model interface.
static sal_uInt16 IsMath(const SvGlobalName &rName)
void SetFlyPos(const Point &rAbsPos)
bool IsFlyInContentFrame() const
virtual bool DoesUndo() const =0
Is Undo enabled?
css::uno::Reference< css::embed::XEmbeddedObject > GetOleRef() const
get reference to OLE object (if there is one) for selected FlyFrame
virtual bool GetCharRect(SwRect &, const SwPosition &, SwCursorMoveState *=nullptr, bool bAllowFarAway=true) const
void InvalidateContent() const
void MakeVisible(const SwRect &)
bool GetFlyFrameAttr(SfxItemSet &rSet) const
OUString GetObjTitle() const
SdrObject * GetMarkedSdrObj() const
void SetObjDescription(const OUString &rDescription)
PaM is Point and Mark: a selection of the document model.
SdrObject * PickObj(const Point &rPnt, short nTol, SdrPageView *&rpPV, SdrSearchOptions nOptions, SdrObject **ppRootObj, bool *pbHitPassDirect=nullptr) const
const SfxItemPool & GetAttrPool() const
virtual void SetLayer(SdrLayerID nLayer)
constexpr TypedWhichId< SwFormatField > RES_TXTATR_FIELD(RES_TXTATR_NOEND_BEGIN)
SvLinkSource * GetObj() const
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
virtual SwUndoId StartUndo(SwUndoId const eUndoId, SwRewriter const *const pRewriter)=0
Opens undo block.
const SfxItemSet * GetParent() const
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...
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
void GetTableSel(const SwCursorShell &rShell, SwSelBoxes &rBoxes, const SwTableSearchType eSearchType)
const SwPosition * GetPoint() const
void SetAssertFlyPages()
Makes sure that all requested page-bound Flys find a Page.
const OUString & GetAltText() const
SwIndex & Assign(SwIndexReg *, sal_Int32)
SwPageFrame * FindPageFrame()
void ParkCursor(const SwNodeIndex &rIdx)
Remove selections and additional cursors of all shells.
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)
sal_uInt16 GetPhyPageNum() const
Phy: real page count.
SwFlyFrame * GetSelectedOrCurrFlyFrame() const
void SetFlyFrameDescription(SwFlyFrameFormat &rFlyFrameFormat, const OUString &sNewDescription)
const SwFrame * Lower() const
SwContentNode * GetContentNode()
void SelectionHasChanged(SwFEShell *pShell)
const SdrMarkList & GetMarkedObjectList() const
bool SetFlyFrameAttr(SfxItemSet &rSet)
static bool lcl_SetNewFlyPos(const SwNode &rNode, SwFormatAnchor &rAnchor, const Point &rPt)
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
SwNoTextNode * GetNoTextNode()
SwUndoId StartUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Undo: set up Undo parenthesis, return nUndoId of this parenthesis.
Not determinable - different objects are selected.
const Color & GetLineColor() const
::rtl::Reference< Content > pContent
OUString GetTitle() const
sal_uInt32 GetOrdNum() const
IDocumentState const & getIDocumentState() const
Marks a node in the document model.
SwFlyFrame * GetCurrFlyFrame(const bool bCalcFrame=true) const
ring_container GetRingContainer()
MapUnit GetMapUnit() const
virtual void SetRelativePos(const Point &rPnt)
void SetObjRect(const SwRect &rRect)
Set size of draw objects.
void SSize(const Size &rNew)
SwStartNode * GetStartNode()
const SwFrameFormat * GetFormatFromAnyObj(const Point &rPt) const
void InvalidateFlyLayout() const
Validate, invalidate and query the Page status Layout/Content and Fly/non-Fly respectively are inspec...
void Insert(const OUString &rGrfName, const OUString &rFltName, const Graphic *pGraphic, const SfxItemSet *pFlyAttrSet)
A page of the document layout.
bool SetFlyFrameAttr(SwFrameFormat &rFlyFormat, SfxItemSet &rSet)
stay with the cursor inside text
const tools::Rectangle & GetAllMarkedRect() const
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
const SwPosition * Start() const
constexpr TypedWhichId< SwFormatContent > RES_CNTNT(95)
virtual SdrInventor GetObjInventor() const
bool m_bCheckForOLEInCaption
void SetWidth(tools::Long n)
virtual SwFlyFrameFormat * InsertEmbObject(const SwPaM &rRg, const svt::EmbeddedObjectRef &xObj, SfxItemSet *pFlyAttrSet)=0
Insert OLE-objects.
SAL_DLLPRIVATE SwFlyFrame * FindFlyFrame(const css::uno::Reference< css::embed::XEmbeddedObject > &) const
SwFrameFormat * GetSelectedFrameFormat() const
If frame then frame style, else 0.
void ReplaceSdrObj(const OUString &rGrfName, const Graphic *pGrf)
const SwFrameFormat * GetDfltFrameFormat() const
Point LogicToPixel(const Point &rLogicPt) const
void SetParent(const SfxItemSet *pNew)
sal_uInt16 const aFrameFormatSetRange[]
SwFlyFrameFormat * InsertObject(const svt::EmbeddedObjectRef &, SfxItemSet *pFlyAttrSet)
IDocumentUndoRedo const & GetIDocumentUndoRedo() const
Provides access to the document undo/redo interface.
sal_uLong EndOfSectionIndex() const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
void Bottom(const tools::Long nBottom)
SwFlyFrame * GetFlyFrame()
constexpr TypedWhichId< SwFormatChain > RES_CHAIN(114)
virtual SwDrawFrameFormat * InsertDrawObj(const SwPaM &rRg, SdrObject &rDrawObj, const SfxItemSet &rFlyAttrSet)=0
Insert a DrawObject.
const SwFrameFormat * GetFormatFromObj(const Point &rPt, SwRect **pRectToFill=nullptr) const
const SwFrameFormat * NewFlyFrame(const SfxItemSet &rSet, bool bAnchValid=false, SwFrameFormat *pParent=nullptr)
tools::Rectangle SVRect() const
SwDrawView * GetDrawView()
general base class for all free-flowing frames
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
virtual SwFrameFormat & GetFrameFormat()=0
SwContentFrame * GetCurrFrame(const bool bCalcFrame=true) const
Get current frame in which the cursor is positioned.
SwPageFrame * FindPageFrameOfAnchor()
method to determine the page frame, on which the 'anchor' of the given anchored object is...
sal_uInt16 GetPhyPageNum() const
void ClrContourCache(const SdrObject *pObj)
vcl::Window * GetWin() const
static sal_Int32 StartOfInputFieldAtPos(const SwPosition &rPos)
void AlignAllFormulasToBaseline()
aligns all formulas with anchor 'as char' to baseline
SwShellCursor * GetNext()
OUString GetUniqueGrfName() const
Created unique name for frame.
ObjCntType GetObjCntTypeOfSelection() const
SwRect GetObjRect() const
For adjustment of PosAttr when anchor changes.
virtual Size ChgSize(const Size &aNewSize) override
bool IsNoTextFrame() const
bool IsFlyFreeFrame() const
static bool PosInsideInputField(const SwPosition &rPos)
new class for re-direct methods calls at a 'virtual' drawing object to its referenced object...
sal_uInt16 GetHitTolerancePixel() const
bool IsGrfLink() const
Query link-data.
void Top(const tools::Long nTop)
void SetDescription(const OUString &rStr)
const Point & GetPtPos() const
Size RequestObjectResize(const SwRect &rRect, const css::uno::Reference< css::embed::XEmbeddedObject > &)
OLE.
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)...
static bool lcl_FindAnchorPos(SwDoc &rDoc, const Point &rPt, const SwFrame &rFrame, SfxItemSet &rSet)
bool HasDrawView() const
New Interface for StarView Drawing.
void SetFlyFrameTitle(SwFlyFrameFormat &rFlyFrameFormat, const OUString &sNewTitle)
const SwFrameFormat * SelFlyGrabCursor()
If a fly is selected, it draws cursor into the first ContentFrame.
void ResetFlyFrameAttr(const SfxItemSet *pSet)
void SetFrameFormat(SwFrameFormat *pFormat, bool bKeepOrient=false, Point const *pDocPos=nullptr)
If frame then set frame style.
const css::uno::Reference< css::awt::XControlModel > & GetUnoControlModel() const
const SwContentFrame * FindAnchor(const SwFrame *pOldAnch, const Point &rNew, const bool bBody=false)
search an anchor for paragraph bound frames starting from pOldAnch
const SwStartNode * FindFlyStartNode() const
sal_uInt16 GetMarkHdlSizePixel() const
static void syncFlyFrameAttr(SwFrameFormat &rShape, SfxItemSet const &rSet)
Similar to syncProperty(), but used by the internal API (e.g. for UI purposes).
const sal_uInt16 * GetRanges() const
const SwFrameFormat * GetFlyFrameFormat() const
Get FlyFrameFormat; for UI macro linkage at Flys.
Reference< XModel > xModel
bool MarkObj(const Point &rPnt, short nTol=-2, bool bToggle=false, bool bDeep=false)
static bool TryRunningState(const css::uno::Reference< css::embed::XEmbeddedObject > &)
void SetObjTitle(const OUString &rTitle)
A layout frame is a frame that contains other frames (m_pLower), e.g. SwPageFrame or SwTabFrame...
static ObjCntType GetObjCntType(const SdrObject &rObj)
const SwFrame * GetAnchorFrame() const
bool IsInvalidItem(const SfxPoolItem *pItem)
OUString GetObjDescription() const
void StartAllAction()
For all views of this document.
SwRootFrame * GetLayout() const
o3tl::strong_int< sal_Int32, struct Tag_TextFrameIndex > TextFrameIndex
Denotes a character index in a text frame at a layout level, after extent mapping from a text node at...
sal_uInt16 getHitTolLog() const
Point GetFrameAnchorPos(bool bIgnoreFlysAnchoredAtThisFrame) const
returns the position for anchors based on frame direction
void ChgRelPos(const Point &rAbsPos)
Change the relative position.
void Height(tools::Long nNew)
SdrObjUserCall * GetUserCall() const
Point & GetCursorDocPos() const
OUString GetFlyName() const
const OUString & GetURL() const
void SetTitle(const OUString &rStr)
sal_uInt16 GetPageNum() const
SwRootFrame * getRootFrame()
const Graphic & GetGrf(bool bWait=false) const
sal_uInt16 GetPageNum(bool bAtPoint=true, const Point *pLayPos=nullptr)
Get number of page which contains cursor.
bool SetDrawingAttr(SfxItemSet &rSet)
bool sw_ChkAndSetNewAnchor(const SwFlyFrame &rFly, SfxItemSet &rSet)
also used in unoframe.cxx
const SfxPoolItem * GetCurItem() const
constexpr TypedWhichId< SwFormatAnchor > RES_ANCHOR(104)
SdrPageView * GetPageView()
bool IsPosProtected() const
SwNodeIndex & Assign(SwNodes const &rNds, sal_uLong)
void EndAction(const bool bIdleEnd=false)
virtual const SwFrameFormat * GetFormat() const
bool IsProtected() const
Is the Frame or rather the Section in which it lies protected?
Point FindAnchorPos(const Point &rAbsPos, bool bMoveIt=false)
Base class of the Writer document model elements.