LibreOffice Module sw (master)  1
porfly.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include <dcontact.hxx>
21 #include <dflyobj.hxx>
22 #include <pam.hxx>
23 #include "portab.hxx"
24 #include <flyfrm.hxx>
25 #include <rootfrm.hxx>
26 #include <frmfmt.hxx>
27 #include <viewsh.hxx>
28 #include <textboxhelper.hxx>
29 #include <frmatr.hxx>
30 
31 #include <sal/log.hxx>
32 #include <fmtanchr.hxx>
33 #include <fmtflcnt.hxx>
34 #include <fmtornt.hxx>
35 #include <flyfrms.hxx>
36 #include <txatbase.hxx>
37 #include "porfly.hxx"
38 #include "porlay.hxx"
39 #include "inftxt.hxx"
40 
41 #include <sortedobjs.hxx>
42 #include <officecfg/Office/Common.hxx>
43 #include <PostItMgr.hxx>
44 
50 {
51 }
52 
54 {
55  OSL_ENSURE( GetFix() >= rInf.X(), "SwFlyPortion::Format" );
56 
57  // tabs must be expanded
58  if( rInf.GetLastTab() )
59  rInf.GetLastTab()->FormatEOL( rInf );
60 
61  rInf.GetLast()->FormatEOL( rInf );
62  PrtWidth( o3tl::narrowing<sal_uInt16>(GetFix() - rInf.X() + PrtWidth()) );
63  if( !Width() )
64  {
65  OSL_ENSURE( Width(), "+SwFlyPortion::Format: a fly is a fly is a fly" );
66  Width(1);
67  }
68 
69  // resetting
70  rInf.SetFly( nullptr );
71  rInf.Width( rInf.RealWidth() );
72  rInf.GetParaPortion()->SetFly();
73 
74  // trailing blank:
75  if( rInf.GetIdx() < TextFrameIndex(rInf.GetText().getLength())
76  && TextFrameIndex(1) < rInf.GetIdx()
77  && !rInf.GetRest()
78  && ' ' == rInf.GetChar( rInf.GetIdx() )
79  && ' ' != rInf.GetChar(rInf.GetIdx() - TextFrameIndex(1))
80  && ( !rInf.GetLast() || !rInf.GetLast()->IsBreakPortion() ) )
81  {
82  SetBlankWidth( rInf.GetTextSize(OUString(' ')).Width() );
84  }
85 
86  const sal_uInt16 nNewWidth = o3tl::narrowing<sal_uInt16>(rInf.X() + PrtWidth());
87  if( rInf.Width() <= nNewWidth )
88  {
89  Truncate();
90  if( nNewWidth > rInf.Width() )
91  {
92  PrtWidth( nNewWidth - rInf.Width() );
93  SetFixWidth( PrtWidth() );
94  }
95  return true;
96  }
97  return false;
98 }
99 
101 {
102  bool bFull = rInf.Width() < rInf.X() + PrtWidth();
103 
104  if( bFull )
105  {
106  // If the line is full, and the character-bound frame is at
107  // the beginning of a line
108  // If it is not possible to side step into a Fly
109  // "Begin of line" criteria ( ! rInf.X() ) has to be extended.
110  // KerningPortions at beginning of line, e.g., for grid layout
111  // must be considered.
112  const SwLinePortion* pLastPor = rInf.GetLast();
113  const sal_uInt16 nLeft = ( pLastPor &&
114  ( pLastPor->IsKernPortion() ||
115  pLastPor->IsErgoSumPortion() ) ) ?
116  pLastPor->Width() :
117  0;
118 
119  if( nLeft == rInf.X() && ! rInf.GetFly() )
120  {
121  Width( rInf.Width() );
122  bFull = false; // so that notes can still be placed in this line
123  }
124  else
125  {
126  if( !rInf.GetFly() )
127  rInf.SetNewLine( true );
128  Width(0);
129  SetAscent(0);
131  if( rInf.GetLast() )
132  rInf.GetLast()->FormatEOL( rInf );
133 
134  return bFull;
135  }
136  }
137 
138  rInf.GetParaPortion()->SetFly();
139  return bFull;
140 }
141 
142 //TODO: improve documentation
152  TextFrameIndex const nStart, TextFrameIndex const nEnd)
153 {
154  SwSortedObjs *pObjs = GetDrawObjs();
155  if ( nullptr == pObjs )
156  return;
157 
158  for ( size_t i = 0; GetDrawObjs() && i < pObjs->size(); ++i )
159  {
160  // Consider changed type of <SwSortedList> entries
161  SwAnchoredObject* pAnchoredObj = (*pObjs)[i];
162  const SwFormatAnchor& rAnch = pAnchoredObj->GetFrameFormat().GetAnchor();
163  if (rAnch.GetAnchorId() == RndStdIds::FLY_AS_CHAR)
164  {
165  const SwPosition* pPos = rAnch.GetContentAnchor();
167  if (nStart <= nIndex && nIndex < nEnd)
168  {
169  if ( auto pFlyFrame = pAnchoredObj->DynCastFlyFrame() )
170  {
171  RemoveFly( pFlyFrame );
172  pNew->AppendFly( pFlyFrame );
173  }
174  else if ( dynamic_cast< const SwAnchoredDrawObject *>( pAnchoredObj ) != nullptr )
175  {
176  RemoveDrawObj( *pAnchoredObj );
177  pNew->AppendDrawObj( *pAnchoredObj );
178  }
179  --i;
180  }
181  }
182  }
183 }
184 
186 {
187  sw::MergedAttrIter iter(*this);
188  for (SwTextAttr const* pHt = iter.NextAttr(); pHt; pHt = iter.NextAttr())
189  {
190  if( RES_TXTATR_FLYCNT == pHt->Which() )
191  {
192  SwFrameFormat* pFrameFormat = pHt->GetFlyCnt().GetFrameFormat();
193  if( pFrameFormat == pSearch )
194  {
195  return TextFrameIndex(pHt->GetStart());
196  }
197  }
198  }
199  OSL_ENSURE(false, "CalcFlyPos: Not Found!");
201 }
202 
204 {
205  // Baseline output
206  // Re-paint everything at a CompletePaint call
207  SwRect aRepaintRect(rInf.GetPaintRect());
208 
209  if(rInf.GetTextFrame()->IsRightToLeft())
210  rInf.GetTextFrame()->SwitchLTRtoRTL(aRepaintRect);
211 
212  if(rInf.GetTextFrame()->IsVertical())
213  rInf.GetTextFrame()->SwitchHorizontalToVertical(aRepaintRect);
214 
215  if(!((m_pFly->IsCompletePaint() ||
216  m_pFly->getFrameArea().IsOver(aRepaintRect)) &&
218  return;
219 
220  SwRect aRect(m_pFly->getFrameArea());
221  if(!m_pFly->IsCompletePaint())
222  aRect.Intersection_(aRepaintRect);
223 
224  // GetFlyFrame() may change the layout mode at the output device.
225  {
226  SwLayoutModeModifier aLayoutModeModifier(*rInf.GetOut());
227  m_pFly->PaintSwFrame(const_cast<vcl::RenderContext&>(*rInf.GetOut()), aRect);
228 
229  // track changes: cross out the image, if it is deleted
230  const SwFrame *pFrame = m_pFly->Lower();
231  if ( GetAuthor() != std::string::npos && IsDeleted() && pFrame )
232  {
233  SwRect aPaintRect( pFrame->GetPaintArea() );
234 
235  const AntialiasingFlags nFormerAntialiasing( rInf.GetOut()->GetAntialiasing() );
236  const bool bIsAntiAliasing = officecfg::Office::Common::Drawinglayer::AntiAliasing::get();
237  if ( bIsAntiAliasing )
238  const_cast<vcl::RenderContext&>(*rInf.GetOut()).SetAntialiasing(AntialiasingFlags::Enable);
239  tools::Long startX = aPaintRect.Left( ), endX = aPaintRect.Right();
240  tools::Long startY = aPaintRect.Top( ), endY = aPaintRect.Bottom();
241  const_cast<vcl::RenderContext&>(*rInf.GetOut()).SetLineColor(
243  const_cast<vcl::RenderContext&>(*rInf.GetOut()).DrawLine(Point(startX, startY), Point(endX, endY));
244  const_cast<vcl::RenderContext&>(*rInf.GetOut()).DrawLine(Point(startX, endY), Point(endX, startY));
245  if ( bIsAntiAliasing )
246  const_cast<vcl::RenderContext&>(*rInf.GetOut()).SetAntialiasing(nFormerAntialiasing);
247  }
248  }
249  const_cast<SwTextPaintInfo&>(rInf).GetRefDev()->SetLayoutMode(rInf.GetOut()->GetLayoutMode());
250 
251  // As the OutputDevice might be anything, the font must be re-selected.
252  // Being in const method should not be a problem.
253  const_cast<SwTextPaintInfo&>(rInf).SelectFont();
254 
255  assert(rInf.GetVsh());
256  SAL_WARN_IF(rInf.GetVsh()->GetOut() != rInf.GetOut(), "sw.core", "SwFlyCntPortion::Paint: Outdev has changed");
257  if(rInf.GetVsh())
258  const_cast<SwTextPaintInfo&>(rInf).SetOut(rInf.GetVsh()->GetOut());
259 }
260 
262 {
263  if(!m_pContact->GetAnchorFrame())
264  {
265  // No direct positioning of the drawing object is needed
266  m_pContact->ConnectToLayout();
267  }
268 }
269 
274  : m_bMax(false)
275  , m_bDeleted(false)
276  , m_nAuthor(std::string::npos)
277  , m_eAlign(sw::LineAlign::NONE)
278 {
281 }
282 
284  : m_pFly(pFly)
285 {
286  SAL_WARN_IF(!pFly, "sw.core", "SwFlyCntPortion::SwFlyCntPortion: no SwFlyInContentFrame!");
287 }
288 
290  : m_pContact(nullptr)
291 {
293  assert(m_pContact);
294 }
295 
296 sw::FlyContentPortion* sw::FlyContentPortion::Create(const SwTextFrame& rFrame, SwFlyInContentFrame* pFly, const Point& rBase, tools::Long nLnAscent, tools::Long nLnDescent, tools::Long nFlyAsc, tools::Long nFlyDesc, AsCharFlags nFlags)
297 {
298  auto pNew(new sw::FlyContentPortion(pFly));
299  pNew->SetBase(rFrame, rBase, nLnAscent, nLnDescent, nFlyAsc, nFlyDesc, nFlags | AsCharFlags::UlSpace | AsCharFlags::Init);
300  return pNew;
301 }
302 
303 sw::DrawFlyCntPortion* sw::DrawFlyCntPortion::Create(const SwTextFrame& rFrame, SwFrameFormat const & rFormat, const Point& rBase, tools::Long nLnAscent, tools::Long nLnDescent, tools::Long nFlyAsc, tools::Long nFlyDesc, AsCharFlags nFlags)
304 {
305  auto pNew(new DrawFlyCntPortion(rFormat));
306  pNew->SetBase(rFrame, rBase, nLnAscent, nLnDescent, nFlyAsc, nFlyDesc, nFlags | AsCharFlags::UlSpace | AsCharFlags::Init);
307  return pNew;
308 }
309 
312 
314 {
315  return m_pFly->GetVirtDrawObj();
316 }
317 
319 {
320  SdrObject* pSdrObj;
321  // Determine drawing object ('master' or 'virtual') by frame
322  pSdrObj = m_pContact->GetDrawObjectByAnchorFrame(rFrame);
323  if(!pSdrObj)
324  {
325  SAL_WARN("sw.core", "SwFlyCntPortion::SetBase(..) - No drawing object found by <GetDrawContact()->GetDrawObjectByAnchorFrame( rFrame )>");
326  pSdrObj = m_pContact->GetMaster();
327  }
328 
329  // Call <SwAnchoredDrawObject::MakeObjPos()> to assure that flag at
330  // the <DrawFrameFormat> and at the <SwAnchoredDrawObject> instance are
331  // correctly set
332  if(pSdrObj)
333  m_pContact->GetAnchoredObj(pSdrObj)->MakeObjPos();
334  return pSdrObj;
335 }
336 
343 void SwFlyCntPortion::SetBase( const SwTextFrame& rFrame, const Point &rBase,
344  tools::Long nLnAscent, tools::Long nLnDescent,
345  tools::Long nFlyAsc, tools::Long nFlyDesc,
346  AsCharFlags nFlags )
347 {
348  // Use new class to position object
349  // Determine drawing object
350  SdrObject* pSdrObj = GetSdrObj(rFrame);
351  if (!pSdrObj)
352  return;
353 
354  // position object
356  *pSdrObj,
357  rBase, nFlags,
358  nLnAscent, nLnDescent, nFlyAsc, nFlyDesc );
359 
360  // Scope of local variable <aObjPosInProgress>
361  {
362  SwObjPositioningInProgress aObjPosInProgress( *pSdrObj );
363  aObjPositioning.CalcPosition();
364  }
365 
366  SwFrameFormat* pShape = FindFrameFormat(pSdrObj);
367  const SwFormatAnchor& rAnchor(pShape->GetAnchor());
368  if (rAnchor.GetAnchorId() == RndStdIds::FLY_AS_CHAR)
369  {
370  // This is an inline draw shape, see if it has a textbox.
372  if (pTextBox)
373  {
374  // It has, so look up its text rectangle, and adjust the position
375  // of the textbox accordingly.
376  // Both rectangles are absolute, SwFormatHori/VertOrient's position
377  // is relative to the print area of the anchor text frame.
378  tools::Rectangle aTextRectangle = SwTextBoxHelper::getTextRectangle(pSdrObj);
379 
380  const auto aPos(pShape->GetAnchor().GetContentAnchor());
381  SwFormatVertOrient aVert(pTextBox->GetVertOrient());
382  SwFormatHoriOrient aHori(pTextBox->GetHoriOrient());
383 
384  // tdf#138598 Replace vertical alignment of As_char textboxes in footer
385  // tdf#140158 Remove horizontal positioning of As_char textboxes, because
386  // the anchor moving does the same for it.
387  const bool bIsInHeaderFooter = aPos->nNode.GetNode().FindFooterStartNode();
388  // TODO: Find solution for Group Shapes in Header/Footer.
389  tools::Long nXoffs
391  bIsInHeaderFooter ? pShape->FindRealSdrObject() : pSdrObj, false)
392  .Left();
393  if (!bIsInHeaderFooter)
394  {
395  aVert.SetVertOrient(css::text::VertOrientation::NONE);
396  aVert.SetRelationOrient(css::text::RelOrientation::FRAME);
397  auto const nTop = aTextRectangle.Top() - rFrame.getFrameArea().Top()
398  - rFrame.getFramePrintArea().Top();
399  aVert.SetPos(nTop);
400  }
401  else
402  {
403  aVert.SetVertOrient(css::text::VertOrientation::NONE);
404  aVert.SetPos(SwTextBoxHelper::getTextRectangle(pShape->FindRealSdrObject(), false).Top());
405  }
406 
407  SwFormatAnchor aNewTxBxAnchor(pTextBox->GetAnchor());
408  aNewTxBxAnchor.SetAnchor(aPos);
409  aHori.SetPos(nXoffs + pShape->GetLRSpace().GetLeft());
410 
411  pTextBox->LockModify();
412  pTextBox->SetFormatAttr(aNewTxBxAnchor);
413  pTextBox->SetFormatAttr(aVert);
414  pTextBox->SetFormatAttr(aHori);
415  pTextBox->UnlockModify();
416  }
417  }
418 
419  SetAlign( aObjPositioning.GetLineAlignment() );
420 
421  m_aRef = aObjPositioning.GetAnchorPos();
422  if( nFlags & AsCharFlags::Rotate )
423  SvXSize( aObjPositioning.GetObjBoundRectInclSpacing().SSize() );
424  else
425  SvLSize( aObjPositioning.GetObjBoundRectInclSpacing().SSize() );
426  if( Height() )
427  {
428  // GetRelPosY returns the relative position to baseline (if 0, the
429  // upper border of the FlyCnt if on the baseline of a line)
430  SwTwips nRelPos = aObjPositioning.GetRelPosY();
431  if ( nRelPos < 0 )
432  {
433  mnAscent = -nRelPos;
434  if( mnAscent > Height() )
435  Height( mnAscent );
436  }
437  else
438  {
439  mnAscent = 0;
440  Height( Height() + o3tl::narrowing<sal_uInt16>(nRelPos) );
441  }
442  }
443  else
444  {
445  Height( 1 );
446  mnAscent = 0;
447  }
448 }
449 
450 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
vcl::RenderContext * GetOut() const
Definition: viewsh.hxx:338
const SwVirtFlyDrawObj * GetVirtDrawObj() const
Definition: fly.cxx:2783
Base class of the Writer layout elements.
Definition: frame.hxx:315
Represents the visualization of a paragraph.
Definition: txtfrm.hxx:158
SwViewShell * GetVsh()
Definition: inftxt.hxx:221
sal_Int32 nIndex
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: porfly.cxx:203
const SwSortedObjs * GetDrawObjs() const
Definition: frame.hxx:565
Marks a position in the document model.
Definition: pam.hxx:35
size_t GetAuthor() const
Definition: porfly.hxx:60
AntialiasingFlags
void SetBlankWidth(const sal_uInt16 nNew)
Definition: porfly.hxx:38
const SwFormatVertOrient & GetVertOrient(bool=true) const
Definition: fmtornt.hxx:106
void SwitchHorizontalToVertical(SwRect &rRect) const
Calculates the coordinates of a rectangle when switching from horizontal to vertical layout...
Definition: txtfrm.cxx:475
void SetFixWidth(const sal_uInt16 nNew)
Definition: porglue.hxx:38
virtual bool Format(SwTextFormatInfo &rInf) override
Definition: porfly.cxx:53
long Long
const SwRect & getFramePrintArea() const
Definition: frame.hxx:181
SwTabPortion * GetLastTab()
Definition: inftxt.hxx:614
void MoveFlyInCnt(SwTextFrame *pNew, TextFrameIndex nStart, TextFrameIndex nEnd)
Rewires FlyInContentFrame, if nEnd > Index >= nStart.
Definition: porfly.cxx:151
constexpr TypedWhichId< SwFormatFlyCnt > RES_TXTATR_FLYCNT(57)
ComplexTextLayoutFlags GetLayoutMode() const
void SetLen(TextFrameIndex const nLen)
Definition: porlin.hxx:76
sal_uInt16 RealWidth() const
Definition: inftxt.hxx:548
static Color GetColorAnchor(std::size_t aAuthorIndex)
Definition: PostItMgr.cxx:2163
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
Definition: porglue.hxx:56
Of course Writer needs its own rectangles.
Definition: swrect.hxx:34
virtual void PaintSwFrame(vcl::RenderContext &rRenderContext, SwRect const &, SwPrintData const *const pPrintData=nullptr) const override
Definition: paintfrm.cxx:3985
SwPosSize GetTextSize(OutputDevice *pOut, const SwScriptInfo *pSI, const OUString &rText, TextFrameIndex nIdx, TextFrameIndex nLen) const
Definition: inftxt.cxx:382
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...
Definition: porfly.cxx:343
AntialiasingFlags GetAntialiasing() const
virtual bool Format(SwTextFormatInfo &rInf) override
Definition: porfly.cxx:100
SwTextAttr const * NextAttr(SwTextNode const **ppNode=nullptr)
Definition: txtfrm.cxx:89
void SetFly()
Definition: porlay.hxx:302
SwRect & Intersection_(const SwRect &rRect)
Definition: swrect.cxx:80
SwRect GetPaintArea() const
|* The paintarea is the area, in which the content of a frame is allowed |* to be displayed...
Definition: ssfrm.cxx:589
wrapper class for the positioning of Writer fly frames and drawing objects
void AppendFly(SwFlyFrame *pNew)
Definition: fly.cxx:2180
constexpr TypedWhichId< SwDrawFrameFormat > RES_DRAWFRMFMT(159)
NONE
void RemoveDrawObj(SwAnchoredObject &_rToRemoveObj)
Definition: fly.cxx:2319
bool IsBreakPortion() const
Definition: porlin.hxx:115
const SwRect & getFrameArea() const
Definition: frame.hxx:180
virtual SdrObject * GetSdrObj(const SwTextFrame &) override
Definition: porfly.cxx:318
virtual ~FlyContentPortion() override
Definition: porfly.cxx:311
A wrapper around SfxPoolItem to store the start position of (usually) a text portion, with an optional end.
Definition: txatbase.hxx:41
sal_Unicode GetChar(TextFrameIndex const nPos) const
Definition: inftxt.hxx:240
SwDrawContact * m_pContact
Definition: porfly.hxx:85
SwFrameFormat * FindFrameFormat(SdrObject *pObj)
The Get reverse way: seeks the format to the specified object.
Definition: dcontact.cxx:120
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)
Definition: porfly.cxx:303
void SetAscent(const sal_uInt32 nNewAsc)
Definition: porlin.hxx:80
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)
Definition: porfly.cxx:296
static SwFrameFormat * getOtherTextBoxFormat(const SwFrameFormat *pFormat, sal_uInt16 nType, SdrObject *pObject=nullptr)
If we have an associated TextFrame, then return that.
void DrawLine(OutputDevice &rDev, const basegfx::B2DPoint &rP1, const basegfx::B2DPoint &rP2, sal_uInt32 nWidth, SvxBorderLineStyle nDashing)
Style of a layout element.
Definition: frmfmt.hxx:59
virtual ~DrawFlyCntPortion() override
Definition: porfly.cxx:310
TextFrameIndex MapModelToViewPos(SwPosition const &rPos) const
Definition: txtfrm.cxx:1269
void RemoveFly(SwFlyFrame *pToRemove)
Definition: fly.cxx:2198
const SwFormatAnchor & GetAnchor(bool=true) const
Definition: fmtanchr.hxx:81
int i
RndStdIds GetAnchorId() const
Definition: fmtanchr.hxx:65
vcl::RenderContext * GetOut()
Definition: inftxt.hxx:224
const SwFormatHoriOrient & GetHoriOrient(bool=true) const
Definition: fmtornt.hxx:108
size_t size() const
Definition: sortedobjs.cxx:43
const SwPosition * GetContentAnchor() const
Definition: fmtanchr.hxx:67
SwParaPortion * GetParaPortion()
Definition: inftxt.hxx:121
void SetWhichPor(const PortionType nNew)
Definition: porlin.hxx:95
bool IsCompletePaint() const
Definition: frame.hxx:602
virtual void Paint(const SwTextPaintInfo &rInf) const override
Definition: porfly.cxx:261
const SwFrame * Lower() const
Definition: layfrm.hxx:101
FlyAnchors.
Definition: fmtanchr.hxx:34
bool IsKernPortion() const
Definition: porlin.hxx:135
tools::Long GetLeft() const
virtual const SwFlyFrame * DynCastFlyFrame() const
void UnlockModify()
Definition: calbck.hxx:210
sal_uInt16 Width() const
Definition: inftxt.hxx:527
void LockModify()
Definition: calbck.hxx:209
bool IsDeleted() const
Definition: porfly.hxx:58
constexpr tools::Long Top() const
TextFrameIndex GetIdx() const
Definition: inftxt.hxx:271
void SSize(const Size &rNew)
Definition: swrect.hxx:177
void SetFly(SwFlyPortion *pNew)
Definition: inftxt.hxx:609
SwTextFrame * GetTextFrame()
Definition: inftxt.hxx:284
tools::Long SwTwips
Definition: swtypes.hxx:52
const OUString & GetText() const
Definition: inftxt.hxx:239
void Truncate()
Definition: porlin.hxx:201
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:450
SwTwips X() const
Definition: inftxt.hxx:378
void SwitchLTRtoRTL(SwRect &rRect) const
Calculates the coordinates of a rectangle when switching from LTR to RTL layout.
Definition: txtfrm.cxx:685
Base class for anything that can be part of a line in the Writer layout.
Definition: porlin.hxx:51
TextFrameIndex mnLineLength
Definition: porlin.hxx:57
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!
Definition: porfly.cxx:49
SwLinePortion * GetRest()
Definition: inftxt.hxx:575
bool IsErgoSumPortion() const
Definition: porlin.hxx:116
bool IsRightToLeft() const
Definition: frame.hxx:988
void Top(const tools::Long nTop)
Definition: swrect.hxx:203
TextFrameIndex CalcFlyPos(SwFrameFormat const *pSearch)
Calculates the position of FlyInContentFrames.
Definition: porfly.cxx:185
SwFlyCntPortion()
Use the dimensions of pFly->OutRect()
Definition: porfly.cxx:273
SwLinePortion * GetLast()
Definition: inftxt.hxx:560
static bool IsPaint(SdrObject *pObj, const SwViewShell *pSh)
Definition: paintfrm.cxx:3864
virtual void CallSwClientNotify(const SfxHint &rHint) const override
Definition: calbck.cxx:326
void AppendDrawObj(SwAnchoredObject &_rNewObj)
Definition: fly.cxx:2238
constexpr sal_Int32 COMPLETE_STRING
Definition: swtypes.hxx:58
FlyContentPortion(SwFlyInContentFrame *pFly)
Definition: porfly.cxx:283
bool IsVertical() const
Definition: frame.hxx:974
virtual SdrObject * GetSdrObj(const SwTextFrame &) override
Definition: porfly.cxx:313
void SetNewLine(const bool bNew)
Definition: inftxt.hxx:578
#define SAL_WARN(area, stream)
const SwRect & GetPaintRect() const
Definition: inftxt.hxx:431
SwFlyInContentFrame * m_pFly
Definition: porfly.hxx:73
void SetLineColor(const css::uno::Reference< css::beans::XPropertySet > &xGridProperties, sal_Int32 nColor)
Left
virtual void FormatEOL(SwTextFormatInfo &rInf)
Definition: porlin.cxx:265
static tools::Rectangle getTextRectangle(SdrObject *pShape, bool bAbsolute=true)
Return the textbox rectangle of a draw shape (in twips).
DrawFlyCntPortion(SwFrameFormat const &rFormat)
Definition: porfly.cxx:289
SwFlyPortion * GetFly()
Definition: inftxt.hxx:608
sal_uInt32 Width() const
Definition: possiz.hxx:51
bool IsOver(const SwRect &rRect) const
Definition: swrect.cxx:123
SwViewShell * GetCurrShell() const
Definition: rootfrm.hxx:207
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
Definition: sortedobjs.hxx:48
virtual void FormatEOL(SwTextFormatInfo &rInf) override
Definition: txttab.cxx:348
virtual void CalcPosition() override
calculate position for object position
SwRootFrame * getRootFrame()
Definition: frame.hxx:680
SdrObject * FindRealSdrObject()
Definition: atrfrm.cxx:2773
sal_uInt32 PrtWidth() const
Definition: porlin.hxx:82
void SetAnchor(const SwPosition *pPos)
Definition: atrfrm.cxx:1584
const SvxLRSpaceItem & GetLRSpace(bool=true) const
Definition: frmatr.hxx:74