41 #include <officecfg/Office/Common.hxx>
54 OSL_ENSURE(
GetFix() >= rInf.
X(),
"SwFlyPortion::Format" );
64 OSL_ENSURE(
Width(),
"+SwFlyPortion::Format: a fly is a fly is a fly" );
85 const sal_uInt16 nNewWidth = o3tl::narrowing<sal_uInt16>(rInf.
X() +
PrtWidth());
86 if( rInf.
Width() <= nNewWidth )
89 if( nNewWidth > rInf.
Width() )
112 const sal_uInt16 nLeft = ( pLastPor &&
118 if( nLeft == rInf.
X() && ! rInf.
GetFly() )
154 if (
nullptr == pObjs )
166 if (nStart <= nIndex && nIndex < nEnd)
173 else if ( dynamic_cast< const SwAnchoredDrawObject *>( pAnchoredObj ) !=
nullptr )
191 SwFrameFormat* pFrameFormat = pHt->GetFlyCnt().GetFrameFormat();
192 if( pFrameFormat == pSearch )
198 OSL_ENSURE(
false,
"CalcFlyPos: Not Found!");
236 if ( bIsAntiAliasing )
238 tools::Long startX = aPaintRect.Left( ), endX = aPaintRect.Right();
239 tools::Long startY = aPaintRect.Top( ), endY = aPaintRect.Bottom();
244 if ( bIsAntiAliasing )
257 const_cast<SwTextPaintInfo&>(rInf).SetOut(rInf.
GetVsh()->
GetOut());
262 if(!m_pContact->GetAnchorFrame())
265 m_pContact->ConnectToLayout();
275 , m_nAuthor(
std::string::npos)
285 SAL_WARN_IF(!pFly,
"sw.core",
"SwFlyCntPortion::SwFlyCntPortion: no SwFlyInContentFrame!");
289 : m_pContact(nullptr)
314 return m_pFly->GetVirtDrawObj();
321 pSdrObj = m_pContact->GetDrawObjectByAnchorFrame(rFrame);
324 SAL_WARN(
"sw.core",
"SwFlyCntPortion::SetBase(..) - No drawing object found by <GetDrawContact()->GetDrawObjectByAnchorFrame( rFrame )>");
325 pSdrObj = m_pContact->GetMaster();
332 m_pContact->GetAnchoredObj(pSdrObj)->MakeObjPos();
357 nLnAscent, nLnDescent, nFlyAsc, nFlyDesc );
367 if (pFormat->GetOtherTextBoxFormats())
369 const bool bModified = pFormat->GetDoc()->getIDocumentState().IsEnableSetModified();
370 pFormat->GetDoc()->getIDocumentState().SetEnableSetModified(
false);
372 pFormat->FindRealSdrObject());
373 pFormat->GetDoc()->getIDocumentState().SetEnableSetModified(bModified);
398 Height(
Height() + o3tl::narrowing<sal_uInt16>(nRelPos) );
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
vcl::RenderContext * GetOut() const
const SwVirtFlyDrawObj * GetVirtDrawObj() const
Base class of the Writer layout elements.
Represents the visualization of a paragraph.
virtual void Paint(const SwTextPaintInfo &rInf) const override
const SwSortedObjs * GetDrawObjs() const
Marks a position in the document model.
void SetBlankWidth(const sal_uInt16 nNew)
void SwitchHorizontalToVertical(SwRect &rRect) const
Calculates the coordinates of a rectangle when switching from horizontal to vertical layout...
void SetFixWidth(const sal_uInt16 nNew)
virtual bool Format(SwTextFormatInfo &rInf) override
SwTabPortion * GetLastTab()
SwTwips GetRelPosY() const
void MoveFlyInCnt(SwTextFrame *pNew, TextFrameIndex nStart, TextFrameIndex nEnd)
Rewires FlyInContentFrame, if nEnd > Index >= nStart.
void SetLen(TextFrameIndex const nLen)
sal_uInt16 RealWidth() const
static Color GetColorAnchor(std::size_t aAuthorIndex)
Dialog to specify the properties of date form field.
Helper class for notify that positioning of an anchored object is in progress.
sal_uInt16 GetFix() const
vcl::text::ComplexTextLayoutFlags GetLayoutMode() const
Of course Writer needs its own rectangles.
virtual void CalcPosition() override
calculate position for object position
virtual void PaintSwFrame(vcl::RenderContext &rRenderContext, SwRect const &, SwPrintData const *const pPrintData=nullptr) const override
SwPosSize GetTextSize(OutputDevice *pOut, const SwScriptInfo *pSI, const OUString &rText, TextFrameIndex nIdx, TextFrameIndex nLen) const
void SetBase(const SwTextFrame &rFrame, const Point &rBase, tools::Long nLnAscent, tools::Long nLnDescent, tools::Long nFlyAscent, tools::Long nFlyDescent, AsCharFlags nFlags)
After setting the RefPoints, the ascent needs to be recalculated because it is dependent on RelPos...
AntialiasingFlags GetAntialiasing() const
virtual bool Format(SwTextFormatInfo &rInf) override
SwTextAttr const * NextAttr(SwTextNode const **ppNode=nullptr)
SwRect & Intersection_(const SwRect &rRect)
SwRect GetPaintArea() const
|* The paintarea is the area, in which the content of a frame is allowed |* to be displayed...
wrapper class for the positioning of Writer fly frames and drawing objects
void AppendFly(SwFlyFrame *pNew)
void RemoveDrawObj(SwAnchoredObject &_rToRemoveObj)
bool IsBreakPortion() const
const SwRect & getFrameArea() const
virtual SdrObject * GetSdrObj(const SwTextFrame &) override
virtual ~FlyContentPortion() override
A wrapper around SfxPoolItem to store the start position of (usually) a text portion, with an optional end.
sal_Unicode GetChar(TextFrameIndex const nPos) const
SwDrawContact * m_pContact
const SwRect & GetObjBoundRectInclSpacing() const
static DrawFlyCntPortion * Create(const SwTextFrame &rFrame, SwFrameFormat const &rFormat, const Point &rBase, tools::Long nAsc, tools::Long nDescent, tools::Long nFlyAsc, tools::Long nFlyDesc, AsCharFlags nFlags)
static FlyContentPortion * Create(const SwTextFrame &rFrame, SwFlyInContentFrame *pFly, const Point &rBase, tools::Long nAscent, tools::Long nDescent, tools::Long nFlyAsc, tools::Long nFlyDesc, AsCharFlags nFlags)
static void synchronizeGroupTextBoxProperty(bool pFunc(SwFrameFormat *, SdrObject *), SwFrameFormat *pFormat, SdrObject *pObj)
Calls the method given by pFunc with every textboxes of the group given by pFormat.
virtual ~DrawFlyCntPortion() override
TextFrameIndex MapModelToViewPos(SwPosition const &rPos) const
void RemoveFly(SwFlyFrame *pToRemove)
vcl::RenderContext * GetOut()
constexpr TypedWhichId< SwFormatFlyCnt > RES_TXTATR_FLYCNT(58)
SwParaPortion * GetParaPortion()
void SetWhichPor(const PortionType nNew)
bool IsCompletePaint() const
virtual void Paint(const SwTextPaintInfo &rInf) const override
const SwFrame * Lower() const
bool IsKernPortion() const
virtual const SwFlyFrame * DynCastFlyFrame() const
TextFrameIndex GetIdx() const
void SSize(const Size &rNew)
static bool changeAnchor(SwFrameFormat *pShape, SdrObject *pObj)
Sets the anchor of the associated textframe of the given shape, and returns true on success...
void SetFly(SwFlyPortion *pNew)
SwTextFrame * GetTextFrame()
const OUString & GetText() const
void SwitchLTRtoRTL(SwRect &rRect) const
Calculates the coordinates of a rectangle when switching from LTR to RTL layout.
Base class for anything that can be part of a line in the Writer layout.
TextFrameIndex mnLineLength
HFONT SelectFont(HDC hDC, HFONT hFont)
virtual SwFrameFormat & GetFrameFormat()=0
#define SAL_WARN_IF(condition, area, stream)
virtual void Paint(const SwTextPaintInfo &rInf) const override
class SwFlyPortion => we expect a frame-locale SwRect!
sw::LineAlign GetLineAlignment() const
SwLinePortion * GetRest()
bool IsErgoSumPortion() const
bool IsRightToLeft() const
TextFrameIndex CalcFlyPos(SwFrameFormat const *pSearch)
Calculates the position of FlyInContentFrames.
SwFlyCntPortion()
Use the dimensions of pFly->OutRect()
SwLinePortion * GetLast()
static bool IsPaint(SdrObject *pObj, const SwViewShell *pSh)
virtual void CallSwClientNotify(const SfxHint &rHint) const override
void AppendDrawObj(SwAnchoredObject &_rNewObj)
constexpr sal_Int32 COMPLETE_STRING
const Point & GetAnchorPos() const
FlyContentPortion(SwFlyInContentFrame *pFly)
virtual SdrObject * GetSdrObj(const SwTextFrame &) override
void SetNewLine(const bool bNew)
#define SAL_WARN(area, stream)
const SwRect & GetPaintRect() const
SwFlyInContentFrame * m_pFly
void SetLineColor(const css::uno::Reference< css::beans::XPropertySet > &xGridProperties, sal_Int32 nColor)
virtual void FormatEOL(SwTextFormatInfo &rInf)
DrawFlyCntPortion(SwFrameFormat const &rFormat)
SwViewShell * GetCurrShell() 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...
class for collecting anchored objects
virtual void FormatEOL(SwTextFormatInfo &rInf) override
bool Overlaps(const SwRect &rRect) const
SwRootFrame * getRootFrame()
bool m_bDetectedRangeSegmentation false
void SetAscent(const SwTwips nNewAsc)