32 #include <osl/diagnose.h>
42 #include <com/sun/star/text/HoriOrientation.hpp>
43 #include <com/sun/star/text/VertOrientation.hpp>
44 #include <com/sun/star/text/RelOrientation.hpp>
58 XATTR_FILL_FIRST, XATTR_FILL_LAST,
60 SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER,
70 m_bIsInVertical(
false ),
71 m_bIsInVerticalL2R(
false )
82 default: nId=0;
break;
100 if (rStyleAnchor.
GetAnchorId() != RndStdIds::FLY_AT_PARA)
125 m_bIsInVertical(
false),
126 m_bIsInVerticalL2R(
false)
161 "no frame selected or no shell, update not possible");
172 (pGItem = aGetSet.GetItemIfSet(
RES_ANCHOR,
false ))
210 OSL_ENSURE( eAnchorType == RndStdIds::FLY_AT_PAGE ||
211 eAnchorType == RndStdIds::FLY_AT_PARA ||
212 eAnchorType == RndStdIds::FLY_AT_CHAR ||
213 eAnchorType == RndStdIds::FLY_AT_FLY ||
214 eAnchorType == RndStdIds::FLY_AS_CHAR,
"invalid frame type" );
226 sal_uInt16 nPhyPageNum, nVirtPageNum;
230 if ((RndStdIds::FLY_AT_PAGE == eId) || (RndStdIds::FLY_AT_PARA == eId) || (RndStdIds::FLY_AT_CHAR == eId)
231 || (RndStdIds::FLY_AT_FLY == eId))
264 bool bOnlyPercentRefValue )
266 if (!bOnlyPercentRefValue)
286 if (bOnlyPercentRefValue)
294 aPos.setX( aPos.Y() );
297 nTmp = aSize.
Width();
298 aSize.setWidth( aSize.Height() );
299 aSize.setHeight( nTmp );
300 aBoundRect.
Chg( aPos, aSize );
306 if ((eAnchorType == RndStdIds::FLY_AT_PAGE) || (eAnchorType == RndStdIds::FLY_AT_FLY))
343 nV = aBoundRect.
Top();
346 nH = aBoundRect.
Left();
356 else if ((eAnchorType == RndStdIds::FLY_AT_PARA) ||
357 ((eAnchorType == RndStdIds::FLY_AT_CHAR) &&
358 (rVal.
nVRelOrient != text::RelOrientation::CHAR) &&
359 (rVal.
nVRelOrient != text::RelOrientation::TEXT_LINE) ) )
374 rVal.
nVRelOrient == text::RelOrientation::PAGE_FRAME ||
375 rVal.
nVRelOrient == text::RelOrientation::PAGE_PRINT_AREA;
377 SwTwips nTmpMaxVPos = ( bMaxVPosAtBottom
381 if ( rVal.
nVPos > nTmpMaxVPos )
385 rVal.
nVPos = nTmpMaxVPos;
389 rVal.
nHeight = ( bMaxVPosAtBottom
401 if ( bMaxVPosAtBottom )
424 else if ( (eAnchorType == RndStdIds::FLY_AT_CHAR) &&
425 ( rVal.
nVRelOrient == text::RelOrientation::CHAR ||
426 rVal.
nVRelOrient == text::RelOrientation::TEXT_LINE ) )
471 else if ( eAnchorType == RndStdIds::FLY_AS_CHAR )
539 OSL_ENSURE(
LONG_MAX != nLeft &&
LONG_MAX != nRight,
"Which border to set?" );
543 aTmp.
SetLeft( sal_uInt16(nLeft) );
545 aTmp.SetRight( sal_uInt16(nRight) );
551 OSL_ENSURE(
LONG_MAX != nTop &&
LONG_MAX != nBottom,
"Which border to set?" );
557 aTmp.SetLower( sal_uInt16(nBottom) );
566 aHoriOrient.
SetPos ( rPoint.X() );
569 aVertOrient.
SetPos ( rPoint.Y() );
void SetFlyName(const OUString &rName)
Set name at selected FlyFrame.
void FrameNotify(SwViewShell *pVwSh, FlyMode eMode)
const SwFormatFrameSize & GetFrameSize() const
void Right(const tools::Long nRight)
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
SAL_DLLPRIVATE SwTwips CalcTopSpace()
Marks a position in the document model.
void SetPos(const Point &rLPoint)
static constexpr auto Items
void Left(const tools::Long nLeft)
constexpr TypedWhichId< SwFormatFrameSize > RES_FRM_SIZE(89)
const SwFormatAnchor & GetAnchor(bool=true) const
RndStdIds GetDefaultAnchorType() const
constexpr sal_uInt16 RES_FRMATR_END(133)
void GetPageNum(sal_uInt16 &rnPhyNum, sal_uInt16 &rnVirtNum, bool bAtCursorPos=true, const bool bCalcFrame=true)
void SetCol(const SwFormatCol &rCol)
void Pos(const Point &rNew)
Of course Writer needs its own rectangles.
void DelAttr(sal_uInt16 nId)
Value in Var-direction gives minimum (can be exceeded but not be less).
Used by the UI to modify the document model.
constexpr tools::Long Width() const
constexpr SwTwips DFLT_WIDTH
const SwView & GetView() const
void Width(tools::Long nNew)
void SetVertOrientation(sal_Int16 eOrient)
void SetFlyPos(const Point &rAbsPos)
bool GetFlyFrameAttr(SfxItemSet &rSet) const
void SetHeightSizeType(SwFrameSize eType)
constexpr TypedWhichId< SwRotationGrf > RES_GRFATR_ROTATION(135)
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
void SetAbsPos(const Point &rLPoint)
sal_uInt16 CalcShadowSpace(SvxShadowItemSide nShadow) const
void SetAttrItem(const SfxPoolItem &, SetAttrMode nFlags=SetAttrMode::DEFAULT, const bool bParagraphSetting=false)
bool SetFlyFrameAttr(SfxItemSet &rSet)
sal_uInt16 GetHtmlMode(const SwDocShell *pShell)
void SetAttrSet(const SfxItemSet &rSet)
SAL_DLLPRIVATE SwTwips CalcBottomSpace()
void SetAnchor(RndStdIds eId)
void SSize(const Size &rNew)
SwFlyFrameAttrMgr(bool bNew, SwWrtShell *pSh, Frmmgr_Type nType, const SvGlobalName *pName)
SfxItemPool * GetPool() const
const WhichRangesContainer aFrameMgrRange(svl::Items< RES_FRMATR_BEGIN, RES_FRMATR_END-1, RES_GRFATR_ROTATION, RES_GRFATR_ROTATION, XATTR_FILL_FIRST, XATTR_FILL_LAST, SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER, FN_SET_FRM_NAME, FN_SET_FRM_NAME >)
SwDocShell * GetDocShell()
void CalcBoundRect(SwRect &_orRect, const RndStdIds _nAnchorId, const sal_Int16 _eHoriRelOrient=css::text::RelOrientation::FRAME, const sal_Int16 _eVertRelOrient=css::text::RelOrientation::FRAME, const SwPosition *_pToCharContentPos=nullptr, const bool _bFollowTextFlow=false, bool _bMirror=false, Point *_opRef=nullptr, Size *_opPercent=nullptr, const SwFormatFrameSize *pFormatFrameSize=nullptr) const
i#17567 - adjustments to allow negative vertical positions for fly frames anchored to paragraph or to...
void SetParent(const SfxItemSet *pNew)
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
void Bottom(const tools::Long nBottom)
const SwFrameFormat * NewFlyFrame(const SfxItemSet &rSet, bool bAnchValid=false, SwFrameFormat *pParent=nullptr)
SAL_DLLPRIVATE SwTwips CalcRightSpace()
bool IsFrameVertical(const bool bEnvironment, bool &bRightToLeft, bool &bVertL2R) const
Determines whether a frame or its environment is vertically formatted and right-to-left.
void SetLeft(const tools::Long nL, const sal_uInt16 nProp=100)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
constexpr tools::Long Height() const
constexpr SwTwips DFLT_HEIGHT
const SwViewOption * GetViewOptions() const
void SetHorzOrientation(sal_Int16 eOrient)
void SetULSpace(tools::Long nTop, tools::Long nBottom)
if(aStr!=aBuf) UpdateName_Impl(m_xFollowLb.get()
SwFormat * GetFormatFromPool(sal_uInt16 nId)
return the requested automatic format - base-class !
void Top(const tools::Long nTop)
void SetSize(const Size &rSize)
void SetSize(const Size &rLSize)
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(91)
const SwFormatVertOrient & GetVertOrient() const
sal_uInt16 CalcLineSpace(SvxBoxItemLine nLine, bool bEvenIfNoLine=false) const
const SvxShadowItem & GetShadow() const
void EnterSelFrameMode(const Point *pStartDrag=nullptr)
void StartAllAction()
For all views of this document.
void SetUpper(const sal_uInt16 nU, const sal_uInt16 nProp=100)
void Chg(const Point &rNP, const Size &rNS)
void Height(tools::Long nNew)
constexpr sal_uInt16 RES_FRMATR_BEGIN(RES_PARATR_LIST_END)
constexpr TypedWhichId< SvxULSpaceItem > RES_UL_SPACE(92)
bool IsFrameSelected() const
void ValidateMetrics(SvxSwFrameValidation &rVal, const SwPosition *pToCharContentPos, bool bOnlyPercentRefValue=false)
SAL_DLLPRIVATE void UpdateFlyFrame_()
void SetRotation(Degree10 nOld, Degree10 nNew, const Size &rUnrotatedSize)
SAL_DLLPRIVATE SwTwips CalcLeftSpace()
const SwFormatHoriOrient & GetHoriOrient() const
constexpr TypedWhichId< SwFormatAnchor > RES_ANCHOR(104)
const SvxBoxItem & GetBox() const
bool m_bDetectedRangeSegmentation false
void SetLRSpace(tools::Long nLeft, tools::Long nRight)