LibreOffice Module sw (master) 1
txtfly.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 <vcl/outdev.hxx>
21
22#include <pagefrm.hxx>
23#include <rootfrm.hxx>
24#include <pam.hxx>
25#include <swfont.hxx>
26#include <swregion.hxx>
27#include <dflyobj.hxx>
28#include <drawfont.hxx>
29#include <flyfrm.hxx>
30#include <flyfrms.hxx>
31#include <fmtornt.hxx>
32#include <frmatr.hxx>
33#include <frmtool.hxx>
34#include <ndtxt.hxx>
35#include <txtfly.hxx>
36#include "inftxt.hxx"
37#include "porrst.hxx"
38#include "txtpaint.hxx"
39#include <notxtfrm.hxx>
40#include <fmtcnct.hxx>
41#include <svx/obj3d.hxx>
42#include <editeng/txtrange.hxx>
43#include <editeng/lrspitem.hxx>
44#include <editeng/ulspitem.hxx>
45#include <fmtsrnd.hxx>
46#include <fmtanchr.hxx>
47#include <frmfmt.hxx>
48#include <fmtfollowtextflow.hxx>
49#include <pagedesc.hxx>
50#include <sortedobjs.hxx>
53#include <formatlinebreak.hxx>
54#include <svx/svdoedge.hxx>
55
56#ifdef DBG_UTIL
57#include <viewsh.hxx>
58#include <doc.hxx>
59#endif
60
61using namespace ::com::sun::star;
62
63namespace
64{
65 // #i68520#
66 struct AnchoredObjOrder
67 {
68 bool mbR2L;
69 SwRectFn mfnRect;
70
71 AnchoredObjOrder( const bool bR2L,
72 SwRectFn fnRect )
73 : mbR2L( bR2L ),
74 mfnRect( fnRect )
75 {}
76
77 bool operator()( const SwAnchoredObject* pListedAnchoredObj,
78 const SwAnchoredObject* pNewAnchoredObj )
79 {
80 const SwRect& aBoundRectOfListedObj( pListedAnchoredObj->GetObjRectWithSpaces() );
81 const SwRect& aBoundRectOfNewObj( pNewAnchoredObj->GetObjRectWithSpaces() );
82 if ( ( mbR2L &&
83 ( (aBoundRectOfListedObj.*mfnRect->fnGetRight)() ==
84 (aBoundRectOfNewObj.*mfnRect->fnGetRight)() ) ) ||
85 ( !mbR2L &&
86 ( (aBoundRectOfListedObj.*mfnRect->fnGetLeft)() ==
87 (aBoundRectOfNewObj.*mfnRect->fnGetLeft)() ) ) )
88 {
89 SwTwips nTopDiff =
90 (*mfnRect->fnYDiff)( (aBoundRectOfNewObj.*mfnRect->fnGetTop)(),
91 (aBoundRectOfListedObj.*mfnRect->fnGetTop)() );
92 if ( nTopDiff == 0 &&
93 ( ( mbR2L &&
94 ( (aBoundRectOfNewObj.*mfnRect->fnGetLeft)() >
95 (aBoundRectOfListedObj.*mfnRect->fnGetLeft)() ) ) ||
96 ( !mbR2L &&
97 ( (aBoundRectOfNewObj.*mfnRect->fnGetRight)() <
98 (aBoundRectOfListedObj.*mfnRect->fnGetRight)() ) ) ) )
99 {
100 return true;
101 }
102 else if ( nTopDiff > 0 )
103 {
104 return true;
105 }
106 }
107 else if ( ( mbR2L &&
108 ( (aBoundRectOfListedObj.*mfnRect->fnGetRight)() >
109 (aBoundRectOfNewObj.*mfnRect->fnGetRight)() ) ) ||
110 ( !mbR2L &&
111 ( (aBoundRectOfListedObj.*mfnRect->fnGetLeft)() <
112 (aBoundRectOfNewObj.*mfnRect->fnGetLeft)() ) ) )
113 {
114 return true;
115 }
116
117 return false;
118 }
119 };
120}
121
123 mnPointCount( 0 )
124{
125}
126
128{
129}
130
131void SwContourCache::ClrObject( sal_uInt16 nPos )
132{
133 mnPointCount -= mvItems[ nPos ].mxTextRanger->GetPointCount();
134 mvItems.erase(mvItems.begin() + nPos);
135}
136
137void ClrContourCache( const SdrObject *pObj )
138{
139 if( pContourCache && pObj )
140 for( sal_uInt16 i = 0; i < pContourCache->GetCount(); ++i )
141 if( pObj == pContourCache->GetObject( i ) )
142 {
144 break;
145 }
146}
147
149{
150 if( pContourCache )
151 {
152 pContourCache->mvItems.clear();
154 }
155}
156
157// #i68520#
159 const SwRect &rLine,
160 const SwTextFrame* pFrame,
161 const tools::Long nXPos,
162 const bool bRight )
163{
164 SwRect aRet;
165 const SwFrameFormat* pFormat = &(pAnchoredObj->GetFrameFormat());
166 bool bHandleContour(pFormat->GetSurround().IsContour());
167
168 if(!bHandleContour)
169 {
170 // RotateFlyFrame3: Object has no set contour, but for rotated
171 // FlyFrames we can create a 'default' contour to make text
172 // flow around the free, non-covered
173 const SwFlyFreeFrame* pSwFlyFreeFrame(dynamic_cast< const SwFlyFreeFrame* >(pAnchoredObj));
174
175 if(nullptr != pSwFlyFreeFrame && pSwFlyFreeFrame->supportsAutoContour())
176 {
177 bHandleContour = true;
178 }
179 }
180
181 if( bHandleContour &&
182 ( pAnchoredObj->DynCastFlyFrame() == nullptr ||
183 ( static_cast<const SwFlyFrame*>(pAnchoredObj)->Lower() &&
184 static_cast<const SwFlyFrame*>(pAnchoredObj)->Lower()->IsNoTextFrame() ) ) )
185 {
186 aRet = pAnchoredObj->GetObjRectWithSpaces();
187 if( aRet.Overlaps( rLine ) )
188 {
189 if( !pContourCache )
191
193 pFormat, pAnchoredObj->GetDrawObj(), pFrame, rLine, nXPos, bRight );
194 }
195 else
196 aRet.Width( 0 );
197 }
198 else
199 {
200 aRet = pAnchoredObj->GetObjRectWithSpaces();
201 }
202
203 return aRet;
204}
205
207 const SdrObject* pObj, const SwTextFrame* pFrame, const SwRect &rLine,
208 const tools::Long nXPos, const bool bRight )
209{
210 SwRect aRet;
211 sal_uInt16 nPos = 0; // Search in the Cache
212 while( nPos < GetCount() && pObj != mvItems[ nPos ].mpSdrObj )
213 ++nPos;
214 if( GetCount() == nPos ) // Not found
215 {
216 if( GetCount() == POLY_CNT )
217 {
218 mnPointCount -= mvItems.back().mxTextRanger->GetPointCount();
219 mvItems.pop_back();
220 }
221 ::basegfx::B2DPolyPolygon aPolyPolygon;
222 std::optional<::basegfx::B2DPolyPolygon> pPolyPolygon;
223
224 if ( auto pVirtFlyDrawObj = dynamic_cast< const SwVirtFlyDrawObj *>( pObj ) )
225 {
226 // GetContour() causes the graphic to be loaded, which may cause
227 // the graphic to change its size, call ClrObject()
228 tools::PolyPolygon aPoly;
229 if( !pVirtFlyDrawObj->GetFlyFrame()->GetContour( aPoly ) )
230 aPoly = tools::PolyPolygon( pVirtFlyDrawObj->
231 GetFlyFrame()->getFrameArea().SVRect() );
232 aPolyPolygon.clear();
233 aPolyPolygon.append(aPoly.getB2DPolyPolygon());
234 }
235 else
236 {
237 if( DynCastE3dObject( pObj ) == nullptr )
238 {
239 aPolyPolygon = pObj->TakeXorPoly();
240 }
241
242 pPolyPolygon = pObj->TakeContour();
243 }
244 const SvxLRSpaceItem &rLRSpace = pFormat->GetLRSpace();
245 const SvxULSpaceItem &rULSpace = pFormat->GetULSpace();
246 CacheItem item {
247 pObj, // due to #37347 the Object must be entered only after GetContour()
248 std::make_unique<TextRanger>( aPolyPolygon, pPolyPolygon ? &*pPolyPolygon : nullptr, 20,
249 o3tl::narrowing<sal_uInt16>(rLRSpace.GetLeft()), o3tl::narrowing<sal_uInt16>(rLRSpace.GetRight()),
250 pFormat->GetSurround().IsOutside(), false, pFrame->IsVertical() )
251 };
252 mvItems.insert(mvItems.begin(), std::move(item));
253 mvItems[0].mxTextRanger->SetUpper( rULSpace.GetUpper() );
254 mvItems[0].mxTextRanger->SetLower( rULSpace.GetLower() );
255
256 pPolyPolygon.reset();
257
258 mnPointCount += mvItems[0].mxTextRanger->GetPointCount();
259 while( mnPointCount > POLY_MAX && mvItems.size() > POLY_MIN )
260 {
261 mnPointCount -= mvItems.back().mxTextRanger->GetPointCount();
262 mvItems.pop_back();
263 }
264 }
265 else if( nPos )
266 {
267 CacheItem item = std::move(mvItems[nPos]);
268 mvItems.erase(mvItems.begin() + nPos);
269 mvItems.insert(mvItems.begin(), std::move(item));
270 }
271 SwRectFnSet aRectFnSet(pFrame);
272 tools::Long nTmpTop = aRectFnSet.GetTop(rLine);
273 // fnGetBottom is top + height
274 tools::Long nTmpBottom = aRectFnSet.GetBottom(rLine);
275
276 Range aRange( std::min( nTmpTop, nTmpBottom ), std::max( nTmpTop, nTmpBottom ) );
277
278 std::deque<tools::Long>* pTmp = mvItems[0].mxTextRanger->GetTextRanges( aRange );
279
280 const size_t nCount = pTmp->size();
281 if( 0 != nCount )
282 {
283 size_t nIdx = 0;
284 while( nIdx < nCount && (*pTmp)[ nIdx ] < nXPos )
285 ++nIdx;
286 bool bOdd = nIdx % 2;
287 bool bSet = true;
288 if( bOdd )
289 --nIdx; // within interval
290 else if( ! bRight && ( nIdx >= nCount || (*pTmp)[ nIdx ] != nXPos ) )
291 {
292 if( nIdx )
293 nIdx -= 2; // an interval to the left
294 else
295 bSet = false; // before the first interval
296 }
297
298 if( bSet && nIdx < nCount )
299 {
300 aRectFnSet.SetTopAndHeight( aRet, aRectFnSet.GetTop(rLine),
301 aRectFnSet.GetHeight(rLine) );
302 aRectFnSet.SetLeft( aRet, (*pTmp)[ nIdx ] );
303 aRectFnSet.SetRight( aRet, (*pTmp)[ nIdx + 1 ] + 1 );
304 }
305 }
306 return aRet;
307}
308
310 : m_pPage(nullptr)
311 , mpCurrAnchoredObj(nullptr)
312 , m_pCurrFrame(nullptr)
313 , m_pMaster(nullptr)
314 , m_nMinBottom(0)
315 , m_nNextTop(0)
316 , m_nCurrFrameNodeIndex(0)
317 , m_bOn(false)
318 , m_bTopRule(false)
319 , mbIgnoreCurrentFrame(false)
320 , mbIgnoreContour(false)
321 , mbIgnoreObjsInHeaderFooter(false)
322
323{
324}
325
327{
328 CtorInitTextFly( pFrame );
329}
330
332{
333 m_pPage = rTextFly.m_pPage;
335 m_pCurrFrame = rTextFly.m_pCurrFrame;
336 m_pMaster = rTextFly.m_pMaster;
337 if( rTextFly.mpAnchoredObjList )
338 {
339 mpAnchoredObjList.reset( new SwAnchoredObjList( *(rTextFly.mpAnchoredObjList) ) );
340 }
341
342 m_bOn = rTextFly.m_bOn;
343 m_bTopRule = rTextFly.m_bTopRule;
344 m_nMinBottom = rTextFly.m_nMinBottom;
345 m_nNextTop = rTextFly.m_nNextTop;
350}
351
353{
354}
355
357{
358 mbIgnoreCurrentFrame = false;
359 mbIgnoreContour = false;
361 m_pPage = pFrame->FindPageFrame();
362 const SwFlyFrame* pTmp = pFrame->FindFlyFrame();
363 // #i68520#
364 mpCurrAnchoredObj = pTmp;
365 m_pCurrFrame = pFrame;
366 m_pMaster = m_pCurrFrame->IsFollow() ? nullptr : m_pCurrFrame;
367 // If we're not overlapped by a frame or if a FlyCollection does not exist
368 // at all, we switch off forever.
369 // It could be, however, that a line is added while formatting, that
370 // extends into a frame.
371 // That's why we do not optimize for: bOn = pSortedFlys && IsAnyFrame();
372 m_bOn = m_pPage->GetSortedObjs() != nullptr;
373 m_bTopRule = true;
374 m_nMinBottom = 0;
375 m_nNextTop = 0;
377}
378
379SwRect SwTextFly::GetFrame_( const SwRect &rRect ) const
380{
381 SwRect aRet;
382 if( ForEach( rRect, &aRet, true ) )
383 {
384 SwRectFnSet aRectFnSet(m_pCurrFrame);
385 aRectFnSet.SetTop( aRet, aRectFnSet.GetTop(rRect) );
386
387 // Do not always adapt the bottom
388 const SwTwips nRetBottom = aRectFnSet.GetBottom(aRet);
389 const SwTwips nRectBottom = aRectFnSet.GetBottom(rRect);
390 if ( aRectFnSet.YDiff( nRetBottom, nRectBottom ) > 0 ||
391 aRectFnSet.GetHeight(aRet) < 0 )
392 aRectFnSet.SetBottom( aRet, nRectBottom );
393 }
394 return aRet;
395}
396
398{
400
401 OSL_ENSURE( m_bOn, "IsAnyFrame: Why?" );
404
405 return ForEach( aRect, nullptr, false );
406}
407
408bool SwTextFly::IsAnyObj( const SwRect &rRect ) const
409{
410 OSL_ENSURE( m_bOn, "SwTextFly::IsAnyObj: Who's knocking?" );
411
412 SwRect aRect( rRect );
413 if ( aRect.IsEmpty() )
414 {
417
419 if (nLower > 0)
420 {
421 aRect.AddBottom(nLower);
422 }
423 }
424
425 const SwSortedObjs *pSorted = m_pPage->GetSortedObjs();
426 if( pSorted ) // bOn actually makes sure that we have objects on the side,
427 // but who knows who deleted something in the meantime?
428 {
429 for ( size_t i = 0; i < pSorted->size(); ++i )
430 {
431 const SwAnchoredObject* pObj = (*pSorted)[i];
432
433 const SwRect aBound( pObj->GetObjRectWithSpaces() );
434
435 // Optimization
436 if( pObj->GetObjRect().Left() > aRect.Right() )
437 continue;
438
439 // #i68520#
440 if( mpCurrAnchoredObj != pObj && aBound.Overlaps( aRect ) )
441 return true;
442 }
443 }
444 return false;
445}
446
448{
450 while (m_pMaster && m_pMaster->IsFollow())
452 return m_pMaster;
453}
454
456{
457 SwSaveClip aClipSave( rInf.GetpOut() );
458 SwRect aRect( rInf.GetPos(), rInf.GetSize() );
459 if( rInf.GetSpace() )
460 {
461 TextFrameIndex const nTmpLen = TextFrameIndex(COMPLETE_STRING) == rInf.GetLen()
462 ? TextFrameIndex(rInf.GetText().getLength())
463 : rInf.GetLen();
464 if( rInf.GetSpace() > 0 )
465 {
466 sal_Int32 nSpaceCnt = 0;
467 const TextFrameIndex nEndPos = rInf.GetIdx() + nTmpLen;
468 for (TextFrameIndex nPos = rInf.GetIdx(); nPos < nEndPos; ++nPos)
469 {
470 if (CH_BLANK == rInf.GetText()[sal_Int32(nPos)])
471 ++nSpaceCnt;
472 }
473 if( nSpaceCnt )
474 aRect.Width( aRect.Width() + nSpaceCnt * rInf.GetSpace() );
475 }
476 else
477 aRect.Width( aRect.Width() - sal_Int32(nTmpLen) * rInf.GetSpace() );
478 }
479
480 if( aClipSave.IsOn() && rInf.GetOut().IsClipRegion() )
481 {
482 SwRect aClipRect( rInf.GetOut().GetClipRegion().GetBoundRect() );
483 aRect.Intersection( aClipRect );
484 }
485
486 SwRegionRects aRegion( aRect );
487
488 bool bOpaque = false;
489 // #i68520#
490 const sal_uInt32 nCurrOrd = mpCurrAnchoredObj
493 OSL_ENSURE( !m_bTopRule, "DrawTextOpaque: Wrong TopRule" );
494
495 // #i68520#
496 const SwAnchoredObjList::size_type nCount( m_bOn ? GetAnchoredObjList()->size() : 0 );
497 if (nCount > 0)
498 {
500 for( SwAnchoredObjList::size_type i = 0; i < nCount; ++i )
501 {
502 // #i68520#
503 const SwAnchoredObject* pTmpAnchoredObj = (*mpAnchoredObjList)[i];
504 const SwFlyFrame* pFly = pTmpAnchoredObj->DynCastFlyFrame();
505 if( pFly && mpCurrAnchoredObj != pTmpAnchoredObj )
506 {
507 // #i68520#
508 if( aRegion.GetOrigin().Overlaps( pFly->getFrameArea() ) )
509 {
510 const SwFrameFormat *pFormat = pFly->GetFormat();
511 const SwFormatSurround &rSur = pFormat->GetSurround();
512 const SwFormatAnchor& rAnchor = pFormat->GetAnchor();
513 // Only the ones who are opaque and more to the top
514 if( ! pFly->IsBackgroundTransparent() &&
515 css::text::WrapTextMode_THROUGH == rSur.GetSurround() &&
516 ( !rSur.IsAnchorOnly() ||
517 // #i68520#
518 GetMaster() == pFly->GetAnchorFrame() ||
519 ((RndStdIds::FLY_AT_PARA != rAnchor.GetAnchorId()) &&
520 (RndStdIds::FLY_AT_CHAR != rAnchor.GetAnchorId())
521 )
522 ) &&
523 // #i68520#
524 pTmpAnchoredObj->GetDrawObj()->GetLayer() != nHellId &&
525 nCurrOrd < pTmpAnchoredObj->GetDrawObj()->GetOrdNum()
526 )
527 {
528 // Except for the content is transparent
529 const SwNoTextFrame *pNoText =
530 pFly->Lower() && pFly->Lower()->IsNoTextFrame()
531 ? static_cast<const SwNoTextFrame*>(pFly->Lower())
532 : nullptr;
533 if ( !pNoText ||
534 (!pNoText->IsTransparent() && !rSur.IsContour()) )
535 {
536 bOpaque = true;
537 aRegion -= pFly->getFrameArea();
538 }
539 }
540 }
541 }
542 }
543 }
544
545 Point aPos( rInf.GetPos().X(), rInf.GetPos().Y() + rInf.GetAscent() );
546 const Point aOldPos(rInf.GetPos());
547 rInf.SetPos( aPos );
548
549 if( !bOpaque )
550 {
551 if( rInf.GetKern() )
552 rInf.GetFont()->DrawStretchText_( rInf );
553 else
554 rInf.GetFont()->DrawText_( rInf );
555 rInf.SetPos(aOldPos);
556 return;
557 }
558 else if( !aRegion.empty() )
559 {
560 // What a huge effort ...
561 SwSaveClip aClipVout( rInf.GetpOut() );
562 for( size_t i = 0; i < aRegion.size(); ++i )
563 {
564 SwRect &rRect = aRegion[i];
565 if( rRect != aRegion.GetOrigin() )
566 aClipVout.ChgClip( rRect );
567 if( rInf.GetKern() )
568 rInf.GetFont()->DrawStretchText_( rInf );
569 else
570 rInf.GetFont()->DrawText_( rInf );
571 }
572 }
573 rInf.SetPos(aOldPos);
574}
575
576void SwTextFly::DrawFlyRect( OutputDevice* pOut, const SwRect &rRect )
577{
578 SwRegionRects aRegion( rRect );
579 OSL_ENSURE( !m_bTopRule, "DrawFlyRect: Wrong TopRule" );
580 // #i68520#
581 const SwAnchoredObjList::size_type nCount( m_bOn ? GetAnchoredObjList()->size() : 0 );
582 if (nCount > 0)
583 {
585 for( SwAnchoredObjList::size_type i = 0; i < nCount; ++i )
586 {
587 // #i68520#
588 const SwAnchoredObject* pAnchoredObjTmp = (*mpAnchoredObjList)[i];
589 if (mpCurrAnchoredObj == pAnchoredObjTmp)
590 continue;
591
592 // #i68520#
593 const SwFlyFrame* pFly = pAnchoredObjTmp->DynCastFlyFrame();
594 if (pFly)
595 {
596 // #i68520#
597 const SwFormatSurround& rSur = pAnchoredObjTmp->GetFrameFormat().GetSurround();
598
599 // OD 24.01.2003 #106593# - correct clipping of fly frame area.
600 // Consider that fly frame background/shadow can be transparent
601 // and <SwAlignRect(..)> fly frame area
602 // #i47804# - consider transparent graphics
603 // and OLE objects.
604 bool bClipFlyArea =
605 ( ( css::text::WrapTextMode_THROUGH == rSur.GetSurround() )
606 // #i68520#
607 ? (pAnchoredObjTmp->GetDrawObj()->GetLayer() != nHellId)
608 : !rSur.IsContour() ) &&
609 !pFly->IsBackgroundTransparent() &&
610 ( !pFly->Lower() ||
611 !pFly->Lower()->IsNoTextFrame() ||
612 !static_cast<const SwNoTextFrame*>(pFly->Lower())->IsTransparent() );
613 if ( bClipFlyArea )
614 {
615 // #i68520#
616 SwRect aFly( pAnchoredObjTmp->GetObjRect() );
617 // OD 24.01.2003 #106593#
619 if( !aFly.IsEmpty() )
620 aRegion -= aFly;
621 }
622 }
623 }
624 }
625
626 for( size_t i = 0; i < aRegion.size(); ++i )
627 {
628 pOut->DrawRect( aRegion[i].SVRect() );
629 }
630}
631
636bool SwTextFly::GetTop( const SwAnchoredObject* _pAnchoredObj,
637 const bool bInFootnote,
638 const bool bInFooterOrHeader )
639{
640 // #i68520#
641 // <mpCurrAnchoredObj> is set, if <m_pCurrFrame> is inside a fly frame
642 if( _pAnchoredObj != mpCurrAnchoredObj )
643 {
644 // #i26945#
645 const SdrObject* pNew = _pAnchoredObj->GetDrawObj();
646 // #102344# Ignore connectors which have one or more connections
647 if (const SdrEdgeObj* pEdgeObj = dynamic_cast<const SdrEdgeObj*>(pNew))
648 {
649 if (pEdgeObj->GetConnectedNode(true) || pEdgeObj->GetConnectedNode(false))
650 {
651 return false;
652 }
653 }
654
655 if( ( bInFootnote || bInFooterOrHeader ) && m_bTopRule )
656 {
657 // #i26945#
658 const SwFrameFormat& rFrameFormat = _pAnchoredObj->GetFrameFormat();
659 const SwFormatAnchor& rNewA = rFrameFormat.GetAnchor();
660 if (RndStdIds::FLY_AT_PAGE == rNewA.GetAnchorId())
661 {
662 if ( bInFootnote )
663 return false;
664
665 if ( bInFooterOrHeader )
666 {
667 const SwFormatVertOrient& aVert( rFrameFormat.GetVertOrient() );
668 bool bVertPrt = aVert.GetRelationOrient() == text::RelOrientation::PRINT_AREA ||
669 aVert.GetRelationOrient() == text::RelOrientation::PAGE_PRINT_AREA;
670 if( bVertPrt )
671 return false;
672 }
673 }
674 }
675
676 // #i68520#
677 // bEvade: consider pNew, if we are not inside a fly
678 // consider pNew, if pNew is lower of <mpCurrAnchoredObj>
679 bool bEvade = !mpCurrAnchoredObj ||
681
682 if ( !bEvade )
683 {
684 // We are currently inside a fly frame and pNew is not
685 // inside this fly frame. We can do some more checks if
686 // we have to consider pNew.
687
688 // If bTopRule is not set, we ignore the frame types.
689 // We directly check the z-order
690 if ( !m_bTopRule )
691 bEvade = true;
692 else
693 {
694 // Within chained Flys we only avoid Lower
695 // #i68520#
697 if ( !rChain.GetPrev() && !rChain.GetNext() )
698 {
699 // #i26945#
700 const SwFormatAnchor& rNewA = _pAnchoredObj->GetFrameFormat().GetAnchor();
701 // #i68520#
703
704 // If <mpCurrAnchoredObj> is anchored as character, its content
705 // does not wrap around pNew
706 if (RndStdIds::FLY_AS_CHAR == rCurrA.GetAnchorId())
707 return false;
708
709 // If pNew is anchored to page and <mpCurrAnchoredObj is not anchored
710 // to page, the content of <mpCurrAnchoredObj> does not wrap around pNew
711 // If both pNew and <mpCurrAnchoredObj> are anchored to page, we can do
712 // some more checks
713 if (RndStdIds::FLY_AT_PAGE == rNewA.GetAnchorId())
714 {
715 if (RndStdIds::FLY_AT_PAGE == rCurrA.GetAnchorId())
716 {
717 bEvade = true;
718 }
719 else
720 return false;
721 }
722 else if (RndStdIds::FLY_AT_PAGE == rCurrA.GetAnchorId())
723 return false; // Page anchored ones only avoid page anchored ones
724 else if (RndStdIds::FLY_AT_FLY == rNewA.GetAnchorId())
725 bEvade = true; // Non-page anchored ones avoid frame anchored ones
726 else if( RndStdIds::FLY_AT_FLY == rCurrA.GetAnchorId() )
727 return false; // Frame anchored ones do not avoid paragraph anchored ones
728 // #i57062#
729 // In order to avoid loop situation, it's decided to adjust
730 // the wrapping behaviour of content of at-paragraph/at-character
731 // anchored objects to one in the page header/footer and
732 // the document body --> content of at-paragraph/at-character
733 // anchored objects doesn't wrap around each other.
734 else
735 return false;
736 }
737 }
738
739 // But: we never avoid a subordinate one and additionally we only avoid when overlapping.
740 // #i68520#
741 bEvade &= ( mpCurrAnchoredObj->GetDrawObj()->GetOrdNum() < pNew->GetOrdNum() );
742 if( bEvade )
743 {
744 // #i68520#
745 const SwRect& aTmp( _pAnchoredObj->GetObjRectWithSpaces() );
747 bEvade = false;
748 }
749 }
750
751 if ( bEvade )
752 {
753 // #i26945#
754 const SwFormatAnchor& rNewA = _pAnchoredObj->GetFrameFormat().GetAnchor();
755 OSL_ENSURE( RndStdIds::FLY_AS_CHAR != rNewA.GetAnchorId(),
756 "Don't call GetTop with a FlyInContentFrame" );
757 if (RndStdIds::FLY_AT_PAGE == rNewA.GetAnchorId())
758 return true; // We always avoid page anchored ones
759
760 // If Flys anchored at paragraph are caught in a FlyCnt, then
761 // their influence ends at the borders of the FlyCnt!
762 // If we are currently formatting the text of the FlyCnt, then
763 // it has to get out of the way of the Frame anchored at paragraph!
764 // m_pCurrFrame is the anchor of pNew?
765 // #i26945#
766 const SwFrame* pTmp = _pAnchoredObj->GetAnchorFrame();
767 if (pTmp == m_pCurrFrame)
768 return true;
769 if( pTmp->IsTextFrame() && ( pTmp->IsInFly() || pTmp->IsInFootnote() ) )
770 {
771 // #i26945#
772 Point aPos = _pAnchoredObj->GetObjRect().Pos();
773 pTmp = GetVirtualUpper( pTmp, aPos );
774 }
775 // #i26945#
776 // If <pTmp> is a text frame inside a table, take the upper
777 // of the anchor frame, which contains the anchor position.
778 else if ( pTmp->IsTextFrame() && pTmp->IsInTab() )
779 {
780 pTmp = const_cast<SwAnchoredObject*>(_pAnchoredObj)
781 ->GetAnchorFrameContainingAnchPos()->GetUpper();
782 }
783 // #i28701# - consider all objects in same context,
784 // if wrapping style is considered on object positioning.
785 // Thus, text will wrap around negative positioned objects.
786 // #i3317# - remove condition on checking,
787 // if wrappings style is considered on object positioning.
788 // Thus, text is wrapping around negative positioned objects.
789 // #i35640# - no consideration of negative
790 // positioned objects, if wrapping style isn't considered on
791 // object position and former text wrapping is applied.
792 // This condition is typically for documents imported from the
793 // OpenOffice.org file format.
798 {
799 return true;
800 }
801
802 const SwFrame* pHeader = nullptr;
803 if (m_pCurrFrame->GetNext() != pTmp &&
805 // #i13832#, #i24135# wrap around objects in page header
807 nullptr != ( pHeader = pTmp->FindFooterOrHeader() ) &&
809 {
810 if( pHeader || RndStdIds::FLY_AT_FLY == rNewA.GetAnchorId() )
811 return true;
812
813 // Compare indices:
814 // The Index of the other is retrieved from the anchor attr.
815 SwNodeOffset nTmpIndex = rNewA.GetAnchorNode()->GetIndex();
816 // Now check whether the current paragraph is before the anchor
817 // of the displaced object in the text, then we don't have to
818 // get out of its way.
819 // If possible determine Index via SwFormatAnchor because
820 // otherwise it's quite expensive.
823
824 if (FrameContainsNode(*m_pCurrFrame, nTmpIndex) || nTmpIndex < m_nCurrFrameNodeIndex)
825 return true;
826 }
827 }
828 }
829 return false;
830}
831
833{
834 // i#28701 - consider complete frame area for new text wrapping
835 SwRect aRect;
837 {
839 aRect += m_pCurrFrame->getFrameArea().Pos();
840 }
841 else
842 {
843 aRect = m_pCurrFrame->getFrameArea();
844 }
845 return aRect;
846}
847
848// #i68520#
850{
851 OSL_ENSURE( m_pCurrFrame, "InitFlyList: No Frame, no FlyList" );
852 // #i68520#
853 OSL_ENSURE( !mpAnchoredObjList, "InitFlyList: FlyList already initialized" );
854
856
857 const SwSortedObjs *pSorted = m_pPage->GetSortedObjs();
858 const size_t nCount = pSorted ? pSorted->size() : 0;
859 // --> #108724# Page header/footer content doesn't have to wrap around
860 // floating screen objects
861 // which was added simply to be compatible with MS Office.
862 // MSO still allows text to wrap around in-table-flies in headers/footers/footnotes
863 const bool bFooterHeader = nullptr != m_pCurrFrame->FindFooterOrHeader();
865 // #i40155# - check, if frame is marked not to wrap
866 const bool bAllowCompatWrap = m_pCurrFrame->IsInTab() && (bFooterHeader || m_pCurrFrame->IsInFootnote());
867 const bool bWrapAllowed = ( pIDSA->get(DocumentSettingId::USE_FORMER_TEXT_WRAPPING) ||
868 bAllowCompatWrap ||
869 (!m_pCurrFrame->IsInFootnote() && !bFooterHeader));
870
871 m_bOn = false;
872
873 if( nCount && bWrapAllowed )
874 {
875 // #i68520#
877
878 SwRect const aRect(GetFrameArea());
879 // Make ourselves a little smaller than we are,
880 // so that 1-Twip-overlappings are ignored (#49532)
881 SwRectFnSet aRectFnSet(m_pCurrFrame);
882 const tools::Long nRight = aRectFnSet.GetRight(aRect) - 1;
883 const tools::Long nLeft = aRectFnSet.GetLeft(aRect) + 1;
884 const bool bR2L = m_pCurrFrame->IsRightToLeft();
885
887
888 for( size_t i = 0; i < nCount; ++i )
889 {
890 // #i68520#
891 // do not consider hidden objects
892 // check, if object has to be considered for text wrap
893 // #118809# - If requested, do not consider
894 // objects in page header|footer for text frames not in page
895 // header|footer. This is requested for the calculation of
896 // the base offset for objects <SwTextFrame::CalcBaseOfstForFly()>
897 // #i20505# Do not consider oversized objects
898 SwAnchoredObject* pAnchoredObj = (*pSorted)[ i ];
899 assert(pAnchoredObj);
900 if ( !pAnchoredObj ||
901 !rIDDMA.IsVisibleLayerId( pAnchoredObj->GetDrawObj()->GetLayer() ) ||
902 !pAnchoredObj->ConsiderForTextWrap() ||
903 ( mbIgnoreObjsInHeaderFooter && !bFooterHeader &&
904 pAnchoredObj->GetAnchorFrame()->FindFooterOrHeader() ) ||
905 ( bAllowCompatWrap && !pAnchoredObj->GetFrameFormat().GetFollowTextFlow().GetValue() )
906 )
907 {
908 continue;
909 }
910
911 const SwRect aBound( pAnchoredObj->GetObjRectWithSpaces() );
912 if ( nRight < aRectFnSet.GetLeft(aBound) ||
913 aRectFnSet.YDiff( aRectFnSet.GetTop(aRect),
914 aRectFnSet.GetBottom(aBound) ) > 0 ||
915 nLeft > aRectFnSet.GetRight(aBound) ||
916 aRectFnSet.GetHeight(aBound) >
917 2 * aRectFnSet.GetHeight(m_pPage->getFrameArea()) )
918 {
919 continue;
920 }
921
922 // #i26945# - pass <pAnchoredObj> to method
923 // <GetTop(..)> instead of only the <SdrObject> instance of the
924 // anchored object
925 if (GetTop(pAnchoredObj, m_pCurrFrame->IsInFootnote(), bFooterHeader))
926 {
927 // OD 11.03.2003 #107862# - adjust insert position:
928 // overlapping objects should be sorted from left to right and
929 // inside left to right sorting from top to bottom.
930 // If objects on the same position are found, they are sorted
931 // on its width.
932 // #i68520#
933 {
934 SwAnchoredObjList::iterator aInsPosIter =
935 std::lower_bound( mpAnchoredObjList->begin(),
936 mpAnchoredObjList->end(),
937 pAnchoredObj,
938 AnchoredObjOrder( bR2L, aRectFnSet.FnRect() ) );
939
940 mpAnchoredObjList->insert( aInsPosIter, pAnchoredObj );
941 }
942
943 const SwFormatSurround &rFlyFormat = pAnchoredObj->GetFrameFormat().GetSurround();
944 // #i68520#
945 if ( rFlyFormat.IsAnchorOnly() &&
946 pAnchoredObj->GetAnchorFrame() == GetMaster() )
947 {
948 const SwFormatVertOrient &rTmpFormat =
949 pAnchoredObj->GetFrameFormat().GetVertOrient();
950 if( text::VertOrientation::BOTTOM != rTmpFormat.GetVertOrient() )
951 m_nMinBottom = ( aRectFnSet.IsVert() && m_nMinBottom ) ?
952 std::min( m_nMinBottom, aBound.Left() ) :
953 std::max( m_nMinBottom, aRectFnSet.GetBottom(aBound) );
954 }
955
956 m_bOn = true;
957 }
958 }
959 if( m_nMinBottom )
960 {
961 SwTwips nMax = aRectFnSet.GetPrtBottom(*m_pCurrFrame->GetUpper());
962 if( aRectFnSet.YDiff( m_nMinBottom, nMax ) > 0 )
963 m_nMinBottom = nMax;
964 }
965 }
966 else
967 {
968 // #i68520#
970 }
971
972 // #i68520#
973 return mpAnchoredObjList.get();
974}
975
977{
978 SwTwips nRet = 0;
979 const SwContentFrame *pLclMaster = GetMaster();
980 OSL_ENSURE(pLclMaster, "SwTextFly without master");
981 const SwSortedObjs *pDrawObj = pLclMaster ? pLclMaster->GetDrawObjs() : nullptr;
982 const size_t nCount = pDrawObj ? pDrawObj->size() : 0;
983 if( nCount )
984 {
985 SwTwips nEndOfFrame = m_pCurrFrame->getFrameArea().Bottom();
986 for( size_t i = 0; i < nCount; ++i )
987 {
988 SwAnchoredObject* pAnchoredObj = (*pDrawObj)[ i ];
989 const SwFormatSurround &rFlyFormat = pAnchoredObj->GetFrameFormat().GetSurround();
990 if( rFlyFormat.IsAnchorOnly() )
991 {
992 const SwFormatVertOrient &rTmpFormat =
993 pAnchoredObj->GetFrameFormat().GetVertOrient();
994 if( text::VertOrientation::BOTTOM != rTmpFormat.GetVertOrient() )
995 {
996 const SwRect& aBound( pAnchoredObj->GetObjRectWithSpaces() );
997 if( aBound.Top() < nEndOfFrame )
998 nRet = std::max( nRet, SwTwips(aBound.Bottom()) );
999 }
1000 }
1001 }
1004 if( nRet > nMax )
1005 nRet = nMax;
1006 }
1007 return nRet;
1008}
1009
1011{
1012 // Note that m_pCurrFrame is already swapped at this stage, so it's correct to bypass
1013 // SwRectFnSet here.
1014 SwTwips nRet = 0;
1015 size_t nCount(m_bOn ? GetAnchoredObjList()->size() : 0);
1016
1017 // Get the horizontal position of the break portion in absolute twips. The frame area is in
1018 // absolute twips, the frame's print area is relative to the frame area. Finally the portion's
1019 // position is relative to the frame's print area.
1020 SwTwips nX = rInfo.X();
1021 nX += m_pCurrFrame->getFrameArea().Left();
1023
1024 for (size_t i = 0; i < nCount; ++i)
1025 {
1026 const SwAnchoredObject* pAnchoredObj = (*mpAnchoredObjList)[i];
1027
1028 if (pAnchoredObj->GetAnchorFrame()->FindFooterOrHeader())
1029 {
1030 // Anchored in the header or footer, ignore it for clearing break purposes.
1031 continue;
1032 }
1033
1034 SwRect aRect(pAnchoredObj->GetObjRectWithSpaces());
1035
1036 if (m_pCurrFrame->IsVertical())
1037 {
1039 }
1040
1041 if (rPortion.GetClear() == SwLineBreakClear::LEFT)
1042 {
1043 if (nX < aRect.Left())
1044 {
1045 // Want to jump down to the first line that's unblocked on the left. This object is
1046 // on the right of the break, ignore it.
1047 continue;
1048 }
1049 }
1050 if (rPortion.GetClear() == SwLineBreakClear::RIGHT)
1051 {
1052 if (nX > aRect.Right())
1053 {
1054 // Want to jump down to the first line that's unblocked on the right. This object is
1055 // on the left of the break, ignore it.
1056 continue;
1057 }
1058 }
1059 SwTwips nBottom = aRect.Top() + aRect.Height();
1060 if (nBottom > nRet)
1061 {
1062 nRet = nBottom;
1063 }
1064 }
1065 return nRet;
1066}
1067
1068bool SwTextFly::ForEach( const SwRect &rRect, SwRect* pRect, bool bAvoid ) const
1069{
1071
1072 // Optimization
1073 SwRectFnSet aRectFnSet(m_pCurrFrame);
1074
1075 // tdf#127235 stop if the area is larger than the page
1076 if( aRectFnSet.GetHeight(m_pPage->getFrameArea()) < aRectFnSet.GetHeight(rRect))
1077 {
1078 // get the doc model description
1079 const SwPageDesc* pPageDesc = m_pPage->GetPageDesc();
1080
1081 // if there is no next page style or it is the same as the current
1082 // => stop trying to place the frame (it would end in an infinite loop)
1083 if( pPageDesc &&
1084 ( !pPageDesc->GetFollow() || pPageDesc->GetFollow() == pPageDesc) )
1085 {
1086 return false;
1087 }
1088 }
1089
1090 bool bRet = false;
1091 // #i68520#
1092 const SwAnchoredObjList::size_type nCount( m_bOn ? GetAnchoredObjList()->size() : 0 );
1093 if (nCount > 0)
1094 {
1095 for( SwAnchoredObjList::size_type i = 0; i < nCount; ++i )
1096 {
1097 // #i68520#
1098 const SwAnchoredObject* pAnchoredObj = (*mpAnchoredObjList)[i];
1099
1100 SwRect aRect( pAnchoredObj->GetObjRectWithSpaces() );
1101
1102 if( aRectFnSet.GetLeft(aRect) > aRectFnSet.GetRight(rRect) )
1103 break;
1104
1105 // #i68520#
1106 if ( mpCurrAnchoredObj != pAnchoredObj && aRect.Overlaps( rRect ) )
1107 {
1108 // #i68520#
1109 const SwFormat* pFormat( &(pAnchoredObj->GetFrameFormat()) );
1110 const SwFormatSurround &rSur = pFormat->GetSurround();
1111 if( bAvoid )
1112 {
1113 // If the text flows below, it has no influence on
1114 // formatting. In LineIter::DrawText() it is "just"
1115 // necessary to cleverly set the ClippingRegions
1116 const SwFormatAnchor& rAnchor = pFormat->GetAnchor();
1117 if( ( css::text::WrapTextMode_THROUGH == rSur.GetSurround() &&
1118 ( !rSur.IsAnchorOnly() ||
1119 // #i68520#
1120 GetMaster() == pAnchoredObj->GetAnchorFrame() ||
1121 ((RndStdIds::FLY_AT_PARA != rAnchor.GetAnchorId()) &&
1122 (RndStdIds::FLY_AT_CHAR != rAnchor.GetAnchorId())) ) )
1123 || aRect.Top() == FAR_AWAY )
1124 continue;
1125 }
1126
1127 // #i58642#
1128 // Compare <GetMaster()> instead of <m_pCurrFrame> with the
1129 // anchor frame of the anchored object, because a follow frame
1130 // has to ignore the anchored objects of its master frame.
1131 // Note: Anchored objects are always registered at the master
1132 // frame, exception are as-character anchored objects,
1133 // but these aren't handled here.
1134 // #i68520#
1135 if ( mbIgnoreCurrentFrame &&
1136 GetMaster() == pAnchoredObj->GetAnchorFrame() )
1137 continue;
1138
1139 if( pRect )
1140 {
1141 // #i68520#
1142 SwRect aFly = AnchoredObjToRect( pAnchoredObj, rRect );
1143 if( aFly.IsEmpty() || !aFly.Overlaps( rRect ) )
1144 continue;
1145 if( !bRet || (
1147 ( aRectFnSet.GetLeft(aFly) <
1148 aRectFnSet.GetLeft(*pRect) ) ) ||
1150 ( aRectFnSet.GetRight(aFly) >
1151 aRectFnSet.GetRight(*pRect) ) ) ) )
1152 *pRect = aFly;
1153 if( rSur.IsContour() )
1154 {
1155 bRet = true;
1156 continue;
1157 }
1158 }
1159 bRet = true;
1160 break;
1161 }
1162 }
1163 }
1164
1165 return bRet;
1166}
1167
1168// #i68520#
1169SwAnchoredObjList::size_type SwTextFly::GetPos( const SwAnchoredObject* pAnchoredObj ) const
1170{
1171 SwAnchoredObjList::size_type nCount = GetAnchoredObjList()->size();
1172 SwAnchoredObjList::size_type nRet = 0;
1173 while ( nRet < nCount && pAnchoredObj != (*mpAnchoredObjList)[ nRet ] )
1174 ++nRet;
1175 return nRet;
1176}
1177
1178// #i68520#
1180 SwAnchoredObjList::size_type nFlyPos,
1181 const SwRect &rLine ) const
1182{
1183 // Usually the right margin is the right margin of the Printarea
1184 OSL_ENSURE( !m_pCurrFrame->IsVertical() || !m_pCurrFrame->IsSwapped(),
1185 "SwTextFly::CalcRightMargin with swapped frame" );
1186 SwRectFnSet aRectFnSet(m_pCurrFrame);
1187 // #118796# - correct determination of right of printing area
1188 SwTwips nRight = aRectFnSet.GetPrtRight(*m_pCurrFrame);
1189 SwTwips nFlyRight = aRectFnSet.GetRight(rFly);
1190 SwRect aLine( rLine );
1191 aRectFnSet.SetRight( aLine, nRight );
1192 aRectFnSet.SetLeft( aLine, aRectFnSet.GetLeft(rFly) );
1193
1194 // It is possible that there is another object that is _above_ us
1195 // and protrudes into the same line.
1196 // Flys with run-through are invisible for those below, i.e., they
1197 // are ignored for computing the margins of other Flys.
1198 // 3301: pNext->getFrameArea().Overlaps( rLine ) is necessary
1199 // #i68520#
1200 css::text::WrapTextMode eSurroundForTextWrap;
1201
1202 bool bStop = false;
1203 // #i68520#
1204 SwAnchoredObjList::size_type nPos = 0;
1205
1206 // #i68520#
1207 while( nPos < mpAnchoredObjList->size() && !bStop )
1208 {
1209 if( nPos == nFlyPos )
1210 {
1211 ++nPos;
1212 continue;
1213 }
1214 // #i68520#
1215 const SwAnchoredObject* pNext = (*mpAnchoredObjList)[ nPos++ ];
1216 if ( pNext == mpCurrAnchoredObj )
1217 continue;
1218 eSurroundForTextWrap = GetSurroundForTextWrap( pNext );
1219 if( css::text::WrapTextMode_THROUGH == eSurroundForTextWrap )
1220 continue;
1221
1223 ( pNext, aLine, m_pCurrFrame, nFlyRight, true ) );
1224 SwTwips nTmpRight = aRectFnSet.GetRight(aTmp);
1225
1226 // optimization:
1227 // Record in nNextTop at which Y-position frame related changes are
1228 // likely. This is so that, despite only looking at frames in the
1229 // current line height, for frames without wrap the line height is
1230 // incremented so that with a single line the lower border of the frame
1231 // (or possibly the upper border of another frame) is reached.
1232 // Especially in HTML documents there are often (dummy) paragraphs in
1233 // 2 pt font, and they used to only evade big frames after huge numbers
1234 // of empty lines.
1235 const tools::Long nTmpTop = aRectFnSet.GetTop(aTmp);
1236 if( aRectFnSet.YDiff( nTmpTop, aRectFnSet.GetTop(aLine) ) > 0 )
1237 {
1238 if( aRectFnSet.YDiff( m_nNextTop, nTmpTop ) > 0 )
1239 SetNextTop( nTmpTop ); // upper border of next frame
1240 }
1241 else if (!aRectFnSet.GetWidth(aTmp)) // typical for Objects with contour wrap
1242 { // For Objects with contour wrap that start before the current
1243 // line, and end below it, but do not actually overlap it, the
1244 // optimization has to be disabled, because the circumstances
1245 // can change in the next line.
1246 if( ! aRectFnSet.GetHeight(aTmp) ||
1247 aRectFnSet.YDiff( aRectFnSet.GetBottom(aTmp),
1248 aRectFnSet.GetTop(aLine) ) > 0 )
1249 SetNextTop( 0 );
1250 }
1251 if( aTmp.Overlaps( aLine ) && nTmpRight > nFlyRight )
1252 {
1253 nFlyRight = nTmpRight;
1254 if( css::text::WrapTextMode_RIGHT == eSurroundForTextWrap ||
1255 css::text::WrapTextMode_PARALLEL == eSurroundForTextWrap )
1256 {
1257 // overrule the FlyFrame
1258 if( nRight > nFlyRight )
1259 nRight = nFlyRight;
1260 bStop = true;
1261 }
1262 }
1263 }
1264 aRectFnSet.SetRight( rFly, nRight );
1265}
1266
1267// #i68520#
1269 SwAnchoredObjList::size_type nFlyPos,
1270 const SwRect &rLine ) const
1271{
1272 OSL_ENSURE( !m_pCurrFrame->IsVertical() || !m_pCurrFrame->IsSwapped(),
1273 "SwTextFly::CalcLeftMargin with swapped frame" );
1274 SwRectFnSet aRectFnSet(m_pCurrFrame);
1275 // #118796# - correct determination of left of printing area
1276 SwTwips nLeft = aRectFnSet.GetPrtLeft(*m_pCurrFrame);
1277 const SwTwips nFlyLeft = aRectFnSet.GetLeft(rFly);
1278
1279 if( nLeft > nFlyLeft )
1280 nLeft = rFly.Left();
1281
1282 SwRect aLine( rLine );
1283 aRectFnSet.SetLeft( aLine, nLeft );
1284
1285 // It is possible that there is another object that is _above_ us
1286 // and protrudes into the same line.
1287 // Flys with run-through are invisible for those below, i.e., they
1288 // are ignored for computing the margins of other Flys.
1289 // 3301: pNext->getFrameArea().Overlaps( rLine ) is necessary
1290
1291 // #i68520#
1292 SwAnchoredObjList::size_type nMyPos = nFlyPos;
1293 while( ++nFlyPos < mpAnchoredObjList->size() )
1294 {
1295 // #i68520#
1296 const SwAnchoredObject* pNext = (*mpAnchoredObjList)[ nFlyPos ];
1297 const SwRect& aTmp( pNext->GetObjRectWithSpaces() );
1298 if( aRectFnSet.GetLeft(aTmp) >= nFlyLeft )
1299 break;
1300 }
1301
1302 while( nFlyPos )
1303 {
1304 if( --nFlyPos == nMyPos )
1305 continue;
1306 // #i68520#
1307 const SwAnchoredObject* pNext = (*mpAnchoredObjList)[ nFlyPos ];
1308 if( pNext == mpCurrAnchoredObj )
1309 continue;
1310 css::text::WrapTextMode eSurroundForTextWrap = GetSurroundForTextWrap( pNext );
1311 if( css::text::WrapTextMode_THROUGH == eSurroundForTextWrap )
1312 continue;
1313
1315 (pNext, aLine, m_pCurrFrame, nFlyLeft, false) );
1316
1317 if( aRectFnSet.GetLeft(aTmp) < nFlyLeft && aTmp.Overlaps( aLine ) )
1318 {
1319 // #118796# - no '+1', because <..fnGetRight>
1320 // returns the correct value.
1321 SwTwips nTmpRight = aRectFnSet.GetRight(aTmp);
1322 if ( nLeft <= nTmpRight )
1323 nLeft = nTmpRight;
1324
1325 break;
1326 }
1327 }
1328 aRectFnSet.SetLeft( rFly, nLeft );
1329}
1330
1331// #i68520#
1333 const SwRect &rLine ) const
1334{
1335 SwRectFnSet aRectFnSet(m_pCurrFrame);
1336
1337 const tools::Long nXPos = m_pCurrFrame->IsRightToLeft() ?
1338 rLine.Right() :
1339 aRectFnSet.GetLeft(rLine);
1340
1341 SwRect aFly = mbIgnoreContour ?
1342 pAnchoredObj->GetObjRectWithSpaces() :
1343 SwContourCache::CalcBoundRect(pAnchoredObj, rLine, m_pCurrFrame,
1344 nXPos, !m_pCurrFrame->IsRightToLeft());
1345
1346 if( !aFly.Width() )
1347 return aFly;
1348
1349 // so the line may grow up to the lower edge of the frame
1350 SetNextTop( aRectFnSet.GetBottom(aFly) );
1351 SwAnchoredObjList::size_type nFlyPos = GetPos( pAnchoredObj );
1352
1353 // LEFT and RIGHT, we grow the rectangle.
1354 // We have some problems, when several frames are to be seen.
1355 // At the moment, only the easier case is assumed:
1356 // + LEFT means that the text must flow on the left of the frame,
1357 // that is the frame expands to the right edge of the print area
1358 // or to the next frame.
1359 // + RIGHT is the opposite.
1360 // Otherwise the set distance between text and frame is always
1361 // added up.
1362 switch( GetSurroundForTextWrap( pAnchoredObj ) )
1363 {
1364 case css::text::WrapTextMode_LEFT :
1365 {
1366 CalcRightMargin( aFly, nFlyPos, rLine );
1367 break;
1368 }
1369 case css::text::WrapTextMode_RIGHT :
1370 {
1371 CalcLeftMargin( aFly, nFlyPos, rLine );
1372 break;
1373 }
1374 case css::text::WrapTextMode_NONE :
1375 {
1376 CalcRightMargin( aFly, nFlyPos, rLine );
1377 CalcLeftMargin( aFly, nFlyPos, rLine );
1378 break;
1379 }
1380 default:
1381 break;
1382 }
1383 return aFly;
1384}
1385
1386// #i68520#
1387
1388// Wrap only on sides with at least 2cm space for the text
1389#define TEXT_MIN 1134
1390
1391// Wrap on both sides up to a frame width of 1.5cm
1392#define FRAME_MAX 850
1393
1394css::text::WrapTextMode SwTextFly::GetSurroundForTextWrap( const SwAnchoredObject* pAnchoredObj ) const
1395{
1396 const SwFrameFormat* pFormat = &(pAnchoredObj->GetFrameFormat());
1397 const SwFormatSurround &rFlyFormat = pFormat->GetSurround();
1398 css::text::WrapTextMode eSurroundForTextWrap = rFlyFormat.GetSurround();
1399
1400 if( rFlyFormat.IsAnchorOnly() && pAnchoredObj->GetAnchorFrame() != GetMaster() )
1401 {
1402 const SwFormatAnchor& rAnchor = pFormat->GetAnchor();
1403 if ((RndStdIds::FLY_AT_PARA == rAnchor.GetAnchorId()) ||
1404 (RndStdIds::FLY_AT_CHAR == rAnchor.GetAnchorId()))
1405 {
1406 return css::text::WrapTextMode_NONE;
1407 }
1408 }
1409
1410 // in cause of run-through and nowrap ignore smartly
1411 if( css::text::WrapTextMode_THROUGH == eSurroundForTextWrap ||
1412 css::text::WrapTextMode_NONE == eSurroundForTextWrap )
1413 return eSurroundForTextWrap;
1414
1415 // left is left and right is right
1417 {
1418 if ( css::text::WrapTextMode_LEFT == eSurroundForTextWrap )
1419 eSurroundForTextWrap = css::text::WrapTextMode_RIGHT;
1420 else if ( css::text::WrapTextMode_RIGHT == eSurroundForTextWrap )
1421 eSurroundForTextWrap = css::text::WrapTextMode_LEFT;
1422 }
1423
1424 // "ideal page wrap":
1425 if ( css::text::WrapTextMode_DYNAMIC == eSurroundForTextWrap )
1426 {
1427 SwRectFnSet aRectFnSet(m_pCurrFrame);
1428 const tools::Long nCurrLeft = aRectFnSet.GetPrtLeft(*m_pCurrFrame);
1429 const tools::Long nCurrRight = aRectFnSet.GetPrtRight(*m_pCurrFrame);
1430 const SwRect& aRect( pAnchoredObj->GetObjRectWithSpaces() );
1431 tools::Long nFlyLeft = aRectFnSet.GetLeft(aRect);
1432 tools::Long nFlyRight = aRectFnSet.GetRight(aRect);
1433
1434 if ( nFlyRight < nCurrLeft || nFlyLeft > nCurrRight )
1435 eSurroundForTextWrap = css::text::WrapTextMode_PARALLEL;
1436 else
1437 {
1438 tools::Long nLeft = nFlyLeft - nCurrLeft;
1439 tools::Long nRight = nCurrRight - nFlyRight;
1440 if( nFlyRight - nFlyLeft > FRAME_MAX )
1441 {
1442 if( nLeft < nRight )
1443 nLeft = 0;
1444 else
1445 nRight = 0;
1446 }
1447 const int textMin = GetMaster()->GetDoc()
1450
1451 // In case there is no space on either side, then css::text::WrapTextMode_PARALLEL
1452 // gives the same result when doing the initial layout or a layout
1453 // update after editing, so prefer that over css::text::WrapTextMode_NONE.
1454 if (nLeft == 0 && nRight == 0)
1455 return css::text::WrapTextMode_PARALLEL;
1456
1457 if( nLeft < textMin )
1458 nLeft = 0;
1459 if( nRight < textMin )
1460 nRight = 0;
1461 if( nLeft )
1462 eSurroundForTextWrap = nRight ? css::text::WrapTextMode_PARALLEL : css::text::WrapTextMode_LEFT;
1463 else
1464 eSurroundForTextWrap = nRight ? css::text::WrapTextMode_RIGHT: css::text::WrapTextMode_NONE;
1465 }
1466 }
1467
1468 return eSurroundForTextWrap;
1469}
1470
1471bool SwTextFly::IsAnyFrame( const SwRect &rLine ) const
1472{
1473
1475
1476 OSL_ENSURE( m_bOn, "IsAnyFrame: Why?" );
1477
1478 return ForEach( rLine, nullptr, false );
1479}
1480
1481/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@ CONSIDER_WRAP_ON_OBJECT_POSITION
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 SdrLayerID GetHellId() const =0
virtual bool IsVisibleLayerId(SdrLayerID _nLayerId) const =0
method to determine, if a layer ID belongs to the visible ones.
Provides access to settings of a document.
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
vcl::Region GetClipRegion() const
bool IsClipRegion() const
constexpr tools::Long Y() const
constexpr tools::Long X() const
virtual basegfx::B2DPolyPolygon TakeXorPoly() const
sal_uInt32 GetOrdNum() const
virtual basegfx::B2DPolyPolygon TakeContour() const
virtual SdrLayerID GetLayer() const
bool GetValue() const
tools::Long GetRight() const
tools::Long GetLeft() const
sal_uInt16 GetUpper() const
sal_uInt16 GetLower() const
wrapper class for the positioning of Writer fly frames and drawing objects
const SwFrame * GetAnchorFrame() const
bool ConsiderForTextWrap() const
virtual SwFrameFormat & GetFrameFormat()=0
const SwRect & GetObjRectWithSpaces() const
method to determine object area inclusive its spacing
virtual const SwFlyFrame * DynCastFlyFrame() const
const SdrObject * GetDrawObj() const
virtual SwRect GetObjRect() const =0
SwLineBreakClear GetClear() const
Definition: porrst.cxx:240
SwContentFrame is the layout for content nodes: a common base class for text (paragraph) and non-text...
Definition: cntfrm.hxx:59
SwTextFrame * FindMaster() const
Definition: flowfrm.cxx:762
const SdrObject * GetObject(sal_uInt16 nPos) const
Definition: txtfly.hxx:71
tools::Long mnPointCount
Definition: txtfly.hxx:63
sal_uInt16 GetCount() const
Definition: txtfly.hxx:72
SwRect ContourRect(const SwFormat *pFormat, const SdrObject *pObj, const SwTextFrame *pFrame, const SwRect &rLine, const tools::Long nXPos, const bool bRight)
Definition: txtfly.cxx:206
static SwRect CalcBoundRect(const SwAnchoredObject *pAnchoredObj, const SwRect &rLine, const SwTextFrame *pFrame, const tools::Long nXPos, const bool bRight)
Computes the rectangle that will cover the object in the given line.
Definition: txtfly.cxx:158
void ClrObject(sal_uInt16 nPos)
Definition: txtfly.cxx:131
std::vector< CacheItem > mvItems
Definition: txtfly.hxx:62
IDocumentSettingAccess const & getIDocumentSettingAccess() const
Definition: doc.cxx:190
IDocumentDrawModelAccess const & getIDocumentDrawModelAccess() const
Definition: doc.cxx:169
TextFrameIndex GetIdx() const
Definition: drawfont.hxx:269
void SetPos(const Point &rNew)
Definition: drawfont.hxx:408
TextFrameIndex GetLen() const
Definition: drawfont.hxx:274
const OUString & GetText() const
Definition: drawfont.hxx:222
tools::Long GetKern() const
Definition: drawfont.hxx:331
sal_uInt16 GetAscent() const
Definition: drawfont.hxx:310
vcl::RenderContext & GetOut() const
Definition: drawfont.hxx:186
SwFont * GetFont() const
Definition: drawfont.hxx:256
vcl::RenderContext * GetpOut() const
Definition: drawfont.hxx:191
const Point & GetPos() const
Definition: drawfont.hxx:201
const Size & GetSize() const
Definition: drawfont.hxx:248
tools::Long GetSpace() const
Definition: drawfont.hxx:336
general base class for all free-flowing frames
Definition: flyfrm.hxx:79
virtual const SwFlyFrameFormat * GetFormat() const override
Definition: fly.cxx:3119
bool IsBackgroundTransparent() const
SwFlyFrame::IsBackgroundTransparent.
Definition: paintfrm.cxx:3904
bool supportsAutoContour() const
Definition: flylay.cxx:302
void DrawStretchText_(SwDrawTextInfo &rInf)
Definition: swfont.hxx:324
void DrawText_(SwDrawTextInfo &rInf)
Definition: swfont.hxx:321
FlyAnchors.
Definition: fmtanchr.hxx:37
RndStdIds GetAnchorId() const
Definition: fmtanchr.hxx:67
SwNode * GetAnchorNode() const
Definition: atrfrm.cxx:1614
Connection (text flow) between two FlyFrames.
Definition: fmtcnct.hxx:32
SwFlyFrameFormat * GetPrev() const
Definition: fmtcnct.hxx:53
SwFlyFrameFormat * GetNext() const
Definition: fmtcnct.hxx:54
bool IsAnchorOnly() const
Definition: fmtsrnd.hxx:52
bool IsOutside() const
Definition: fmtsrnd.hxx:54
bool IsContour() const
Definition: fmtsrnd.hxx:53
css::text::WrapTextMode GetSurround() const
Definition: fmtsrnd.hxx:51
Defines the vertical position of a fly frame.
Definition: fmtornt.hxx:37
sal_Int16 GetRelationOrient() const
Definition: fmtornt.hxx:58
sal_Int16 GetVertOrient() const
Definition: fmtornt.hxx:57
Base class for various Writer styles.
Definition: format.hxx:47
const SwFormatChain & GetChain(bool=true) const
Definition: fmtcnct.hxx:70
const SvxLRSpaceItem & GetLRSpace(bool=true) const
Definition: frmatr.hxx:98
const SwFormatVertOrient & GetVertOrient(bool=true) const
Definition: fmtornt.hxx:113
const SwFormatFollowTextFlow & GetFollowTextFlow(bool=true) const
const SwFormatAnchor & GetAnchor(bool=true) const
Definition: fmtanchr.hxx:88
const SwFormatSurround & GetSurround(bool=true) const
Definition: fmtsrnd.hxx:66
const SvxULSpaceItem & GetULSpace(bool=true) const
Definition: frmatr.hxx:100
const SwRect & getFrameArea() const
Definition: frame.hxx:179
const SwRect & getFramePrintArea() const
Definition: frame.hxx:180
Style of a layout element.
Definition: frmfmt.hxx:72
Base class of the Writer layout elements.
Definition: frame.hxx:315
bool IsTextFrame() const
Definition: frame.hxx:1240
bool IsInDocBody() const
Definition: frame.hxx:949
SwFlyFrame * FindFlyFrame()
Definition: frame.hxx:1117
SwFrame * GetNext()
Definition: frame.hxx:682
bool IsInFootnote() const
Definition: frame.hxx:955
const SwSortedObjs * GetDrawObjs() const
Definition: frame.hxx:568
bool IsInTab() const
Definition: frame.hxx:961
bool IsRightToLeft() const
Definition: frame.hxx:993
bool IsInFly() const
Definition: frame.hxx:967
SwLayoutFrame * GetUpper()
Definition: frame.hxx:684
bool IsVertical() const
Definition: frame.hxx:979
SwRootFrame * getRootFrame()
Definition: frame.hxx:685
bool IsNoTextFrame() const
Definition: frame.hxx:1244
SwPageFrame * FindPageFrame()
Definition: frame.hxx:686
SwFrame * FindFooterOrHeader()
Definition: findfrm.cxx:633
const SwFrame * Lower() const
Definition: layfrm.hxx:101
bool IsTransparent() const
Definition: notxtfrm.cxx:1439
SwNodeOffset GetIndex() const
Definition: node.hxx:312
const SwPageDesc * GetFollow() const
Definition: pagedesc.hxx:267
const SwSortedObjs * GetSortedObjs() const
Definition: pagefrm.hxx:136
SwPageDesc * GetPageDesc()
Definition: pagefrm.hxx:147
bool IsVert() const
Definition: frame.hxx:1372
tools::Long GetHeight(const SwRect &rRect) const
Definition: frame.hxx:1387
void SetBottom(SwRect &rRect, tools::Long nNew) const
Definition: frame.hxx:1392
void SetRight(SwRect &rRect, tools::Long nNew) const
Definition: frame.hxx:1394
tools::Long GetWidth(const SwRect &rRect) const
Definition: frame.hxx:1386
tools::Long GetTop(const SwRect &rRect) const
Definition: frame.hxx:1382
SwRectFn FnRect() const
Definition: frame.hxx:1374
tools::Long GetPrtRight(const SwFrame &rFrame) const
Definition: frame.hxx:1417
void SetTopAndHeight(SwRect &rRect, tools::Long nTop, tools::Long nHeight) const
Definition: frame.hxx:1433
tools::Long YDiff(tools::Long n1, tools::Long n2) const
Definition: frame.hxx:1428
tools::Long GetLeft(const SwRect &rRect) const
Definition: frame.hxx:1384
tools::Long GetPrtLeft(const SwFrame &rFrame) const
Definition: frame.hxx:1416
tools::Long GetBottom(const SwRect &rRect) const
Definition: frame.hxx:1383
void SetTop(SwRect &rRect, tools::Long nNew) const
Definition: frame.hxx:1391
tools::Long GetRight(const SwRect &rRect) const
Definition: frame.hxx:1385
tools::Long GetPrtBottom(const SwFrame &rFrame) const
Definition: frame.hxx:1415
void SetLeft(SwRect &rRect, tools::Long nNew) const
Definition: frame.hxx:1393
Of course Writer needs its own rectangles.
Definition: swrect.hxx:35
SwRect & Intersection(const SwRect &rRect)
Definition: swrect.cxx:57
void Height(tools::Long nNew)
Definition: swrect.hxx:193
bool IsEmpty() const
Definition: swrect.hxx:304
void Top(const tools::Long nTop)
Definition: swrect.hxx:206
void Right(const tools::Long nRight)
Definition: swrect.hxx:202
void Bottom(const tools::Long nBottom)
Definition: swrect.hxx:211
void Pos(const Point &rNew)
Definition: swrect.hxx:171
void SSize(const Size &rNew)
Definition: swrect.hxx:180
void AddBottom(const tools::Long nAdd)
Definition: swrect.cxx:130
bool Overlaps(const SwRect &rRect) const
Definition: swrect.hxx:374
void Left(const tools::Long nLeft)
Definition: swrect.hxx:197
void Width(tools::Long nNew)
Definition: swrect.hxx:189
const SwRect & GetOrigin() const
Definition: swregion.hxx:62
SwViewShell * GetCurrShell() const
Definition: rootfrm.hxx:215
bool IsOn() const
Definition: txtpaint.hxx:53
void ChgClip(const SwRect &rRect, const SwTextFrame *pFrame=nullptr, bool bEnlargeRect=false, sal_Int32 nEnlargeTop=0, sal_Int32 nEnlargeBottom=0)
Definition: txtpaint.hxx:47
class for collecting anchored objects
Definition: sortedobjs.hxx:49
size_t size() const
Definition: sortedobjs.cxx:43
The purpose of this class is to be the universal interface between formatting/text output and the pos...
Definition: txtfly.hxx:125
void CalcRightMargin(SwRect &rFly, SwAnchoredObjList::size_type nPos, const SwRect &rLine) const
The right margin is the right margin or it is determined by the next object standing on the line.
Definition: txtfly.cxx:1179
SwTextFly()
Definition: txtfly.cxx:309
void SetNextTop(tools::Long nNew) const
Definition: txtfly.hxx:364
std::unique_ptr< SwAnchoredObjList > mpAnchoredObjList
Definition: txtfly.hxx:130
bool mbIgnoreContour
Definition: txtfly.hxx:139
bool GetTop(const SwAnchoredObject *_pAnchoredObj, const bool bInFootnote, const bool bInFooterOrHeader)
#i26945# - change first parameter Now it's the <SwAnchoredObject> instance of the floating screen obj...
Definition: txtfly.cxx:636
bool IsAnyObj(const SwRect &rRect) const
true when a frame or DrawObj must be taken in account.
Definition: txtfly.cxx:408
SwAnchoredObjList::size_type GetPos(const SwAnchoredObject *pAnchoredObj) const
Definition: txtfly.cxx:1169
SwRect GetFrame_(const SwRect &rPortion) const
This method will be called during the LineIter formatting.
Definition: txtfly.cxx:379
bool m_bOn
Definition: txtfly.hxx:136
SwRect AnchoredObjToRect(const SwAnchoredObject *pAnchoredObj, const SwRect &rRect) const
Determines the demanded rectangle for an anchored object, considering its surround for text wrapping.
Definition: txtfly.cxx:1332
SwTwips GetMaxBottom(const SwBreakPortion &rPortion, const SwTextFormatInfo &rInfo) const
Gets the maximum of the fly frame bottoms.
Definition: txtfly.cxx:1010
tools::Long m_nMinBottom
Definition: txtfly.hxx:132
bool m_bTopRule
Definition: txtfly.hxx:137
SwAnchoredObjList * InitAnchoredObjList()
Definition: txtfly.cxx:849
const SwTextFrame * GetMaster() const
Definition: txtfly.hxx:354
const SwTextFrame * GetMaster_()
Definition: txtfly.cxx:447
bool IsAnyFrame() const
Same as IsAnyFrame(const SwRect&), but uses the current frame print area.
Definition: txtfly.cxx:397
bool ForEach(const SwRect &rRect, SwRect *pRect, bool bAvoid) const
Look for the first object which overlaps with the rectangle.
Definition: txtfly.cxx:1068
SwRect GetFrameArea() const
Definition: txtfly.cxx:832
const SwPageFrame * m_pPage
Definition: txtfly.hxx:126
void DrawFlyRect(OutputDevice *pOut, const SwRect &rRect)
Two subtleties needs to be mentioned:
Definition: txtfly.cxx:576
const SwAnchoredObject * mpCurrAnchoredObj
Definition: txtfly.hxx:127
css::text::WrapTextMode GetSurroundForTextWrap(const SwAnchoredObject *pAnchoredObj) const
Definition: txtfly.cxx:1394
bool mbIgnoreObjsInHeaderFooter
boolean, indicating if objects in page header|footer are considered for text frames not in page heade...
Definition: txtfly.hxx:144
SwTwips CalcMinBottom() const
Definition: txtfly.cxx:976
const SwTextFrame * m_pCurrFrame
Definition: txtfly.hxx:128
const SwTextFrame * m_pMaster
Definition: txtfly.hxx:129
bool mbIgnoreCurrentFrame
Definition: txtfly.hxx:138
SwAnchoredObjList * GetAnchoredObjList() const
Definition: txtfly.hxx:314
tools::Long m_nNextTop
Definition: txtfly.hxx:133
void CalcLeftMargin(SwRect &rFly, SwAnchoredObjList::size_type nPos, const SwRect &rLine) const
The left margin is the left margin of the current PrintArea or it is determined by the last FlyFrame,...
Definition: txtfly.cxx:1268
SwNodeOffset m_nCurrFrameNodeIndex
Stores the upper edge of the "next" frame.
Definition: txtfly.hxx:134
void CtorInitTextFly(const SwTextFrame *pFrame)
Definition: txtfly.cxx:356
~SwTextFly()
Definition: txtfly.cxx:352
void DrawTextOpaque(SwDrawTextInfo &rInf)
This method is called by DrawText().
Definition: txtfly.cxx:455
Represents the visualization of a paragraph.
Definition: txtfrm.hxx:168
SwTwips GetLowerMarginForFlyIntersect() const
Get the amount of lower margin of this frame we need to consider for fly portion purposes.
Definition: porlay.cxx:2776
SwDoc & GetDoc()
Definition: txtfrm.hxx:475
void SwitchVerticalToHorizontal(SwRect &rRect) const
Calculates the coordinates of a rectangle when switching from vertical to horizontal layout.
Definition: txtfrm.cxx:580
bool IsSwapped() const
Definition: txtfrm.hxx:553
SwTextNode * GetTextNodeFirst()
Definition: txtfrm.hxx:472
SwTwips X() const
Definition: inftxt.hxx:382
const IDocumentDrawModelAccess & getIDocumentDrawModelAccess() const
Provides access to the document draw model interface.
Definition: viewsh.cxx:2823
void append(const B2DPolygon &rPolygon, sal_uInt32 nCount=1)
::basegfx::B2DPolyPolygon getB2DPolyPolygon() const
tools::Rectangle GetBoundRect() const
int nCount
bool Is_Lower_Of(const SwFrame *pCurrFrame, const SdrObject *pObj)
Definition: frmtool.cxx:3622
const SwFrame * GetVirtualUpper(const SwFrame *pFrame, const Point &rPos)
Provides the Upper of an anchor in paragraph-bound objects.
Definition: frmtool.cxx:3590
#define FAR_AWAY
Definition: frmtool.hxx:53
void SwAlignRect(SwRect &rRect, const SwViewShell *pSh, const vcl::RenderContext *pRenderContext)
Function <SwAlignRect(..)> is also used outside this file.
Definition: paintfrm.cxx:1135
const SwFrame * FindContext(const SwFrame *pFrame, SwFrameType nAdditionalContextTyp)
provides the area of a frame in that no Fly from another area can overlap
Definition: frmtool.cxx:3654
bool IsFrameInSameContext(const SwFrame *pInnerFrame, const SwFrame *pFrame)
Definition: frmtool.cxx:3668
sal_uInt16 nPos
size
int i
void swap(cow_wrapper< T, P > &a, cow_wrapper< T, P > &b)
bool FrameContainsNode(SwContentFrame const &rFrame, SwNodeOffset nNodeIndex)
Definition: txtfrm.cxx:290
long Long
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
Definition: nodeoffset.hxx:35
constexpr SwNodeOffset NODE_OFFSET_MAX(SAL_MAX_INT32)
SwOperator fnYDiff
Definition: frame.hxx:1342
SwRectGet fnGetLeft
Definition: frame.hxx:1298
SwRectGet fnGetRight
Definition: frame.hxx:1299
SwRectGet fnGetTop
Definition: frame.hxx:1296
SVXCORE_DLLPUBLIC E3dObject * DynCastE3dObject(SdrObject *)
const sal_Unicode CH_BLANK
Definition: swfont.hxx:42
tools::Long SwTwips
Definition: swtypes.hxx:51
constexpr sal_Int32 COMPLETE_STRING
Definition: swtypes.hxx:57
#define TEXT_MIN
Definition: txtfly.cxx:1389
void ClrContourCache(const SdrObject *pObj)
Definition: txtfly.cxx:137
#define FRAME_MAX
Definition: txtfly.cxx:1392
#define POLY_MIN
Definition: txtfly.hxx:49
std::vector< SwAnchoredObject * > SwAnchoredObjList
Definition: txtfly.hxx:39
#define POLY_MAX
Definition: txtfly.hxx:50
#define TEXT_MIN_SMALL
Definition: txtfly.hxx:90
SwContourCache * pContourCache
Contour-cache global variable, initialized/destroyed in txtinit.cxx and needed in txtfly....
Definition: txtinit.cxx:30
#define POLY_CNT
Definition: txtfly.hxx:48
#define SAL_MAX_UINT32
oslFileHandle & pOut