LibreOffice Module sw (master)  1
dcontact.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 <memory>
21 #include <hintids.hxx>
22 #include <editeng/lrspitem.hxx>
23 #include <svx/svdpage.hxx>
24 #include <svx/svditer.hxx>
25 #include <svx/svdogrp.hxx>
26 #include <svx/svdotext.hxx>
27 #include <svx/svdmodel.hxx>
28 #include <svx/svdviter.hxx>
29 #include <svx/svdview.hxx>
32 #include <drawdoc.hxx>
33 #include <fmtornt.hxx>
34 #include <viewimp.hxx>
35 #include <fmtsrnd.hxx>
36 #include <fmtanchr.hxx>
37 #include <node.hxx>
38 #include <fmtcntnt.hxx>
39 #include <fmtfsize.hxx>
40 #include <pam.hxx>
41 #include <pagefrm.hxx>
42 #include <rootfrm.hxx>
43 #include <frmtool.hxx>
44 #include <flyfrm.hxx>
45 #include <textboxhelper.hxx>
46 #include <frmfmt.hxx>
47 #include <fmtfollowtextflow.hxx>
48 #include <dflyobj.hxx>
49 #include <dcontact.hxx>
50 #include <unodraw.hxx>
53 #include <doc.hxx>
54 #include <hints.hxx>
55 #include <txtfrm.hxx>
56 #include <docary.hxx>
57 #include <sortedobjs.hxx>
64 #include <com/sun/star/text/WritingMode2.hpp>
65 #include <calbck.hxx>
66 #include <algorithm>
67 #include <txtfly.hxx>
68 #include <sal/log.hxx>
69 
70 using namespace ::com::sun::star;
71 
72 namespace
73 {
75  struct VirtObjAnchoredAtFramePred
76  {
77  const SwFrame* m_pAnchorFrame;
78 
79  // #i26791# - compare with master frame
80  static const SwFrame* FindFrame(const SwFrame* pFrame)
81  {
82  if(!pFrame || !pFrame->IsContentFrame())
83  return pFrame;
84  auto pContentFrame = static_cast<const SwContentFrame*>(pFrame);
85  while(pContentFrame->IsFollow())
86  pContentFrame = pContentFrame->FindMaster();
87  return pContentFrame;
88  }
89 
90  VirtObjAnchoredAtFramePred(const SwFrame* pAnchorFrame)
91  : m_pAnchorFrame(FindFrame(pAnchorFrame))
92  {}
93 
94  bool operator()(const SwDrawVirtObjPtr& rpDrawVirtObj)
95  {
96  return FindFrame(rpDrawVirtObj->GetAnchorFrame()) == m_pAnchorFrame;
97  }
98  };
99 }
100 
101 void setContextWritingMode(SdrObject* pObj, SwFrame const * pAnchor)
102 {
103  if(!pObj || !pAnchor)
104  return;
105  short nWritingDirection =
106  pAnchor->IsVertical() ? text::WritingMode2::TB_RL :
107  pAnchor->IsRightToLeft() ? text::WritingMode2::RL_TB :
108  text::WritingMode2::LR_TB;
109  pObj->SetContextWritingMode(nWritingDirection);
110 }
111 
112 
120 {
121  SwFrameFormat* pRetval = nullptr;
122 
123  if (SwVirtFlyDrawObj* pFlyDrawObj = dynamic_cast<SwVirtFlyDrawObj*>(pObj))
124  {
125  pRetval = pFlyDrawObj->GetFormat();
126  }
127  else
128  {
129  SwContact* pContact = GetUserCall(pObj);
130  if ( pContact )
131  {
132  pRetval = pContact->GetFormat();
133  }
134  }
135  return pRetval;
136 }
137 
138 bool HasWrap( const SdrObject* pObj )
139 {
140  if ( pObj )
141  {
142  const SwFrameFormat* pFormat = ::FindFrameFormat( pObj );
143  if ( pFormat )
144  {
145  return css::text::WrapTextMode_THROUGH != pFormat->GetSurround().GetSurround();
146  }
147  }
148 
149  return false;
150 }
151 
154 {
155  SwRect aRet( pObj->GetCurrentBoundRect() );
156  // #i68520# - call cache of <SwAnchoredObject>
157  SwContact* pContact( GetUserCall( pObj ) );
158  if ( pContact )
159  {
160  const SwAnchoredObject* pAnchoredObj( pContact->GetAnchoredObj( pObj ) );
161  if ( pAnchoredObj )
162  {
163  aRet = pAnchoredObj->GetObjRectWithSpaces();
164  }
165  }
166  return aRet;
167 }
168 
171 {
172  SdrObject *pTmp;
173  while ( !pObj->GetUserCall() && nullptr != (pTmp = pObj->getParentSdrObjectFromSdrObject()) )
174  pObj = pTmp;
175  assert((!pObj->GetUserCall() || nullptr != dynamic_cast<const SwContact*>(pObj->GetUserCall())) &&
176  "<::GetUserCall(..)> - wrong type of found object user call." );
177  return static_cast<SwContact*>(pObj->GetUserCall());
178 }
179 
181 bool IsMarqueeTextObj( const SdrObject& rObj )
182 {
183  SdrTextAniKind eTKind;
184  return SdrInventor::Default == rObj.GetObjInventor() &&
185  OBJ_TEXT == rObj.GetObjIdentifier() &&
186  ( SdrTextAniKind::Scroll == ( eTKind = static_cast<const SdrTextObj&>(rObj).GetTextAniKind())
187  || SdrTextAniKind::Alternate == eTKind || SdrTextAniKind::Slide == eTKind );
188 }
189 
191  SwClient( pToRegisterIn ),
192  mbInDTOR( false )
193 {}
194 
196 {
197  SetInDTOR();
198 }
199 
200 
202 {
203  mbInDTOR = true;
204 }
205 
208 {
209  // #i46297# - notify background about the arriving of
210  // the object and invalidate its position.
211  const bool bNotify( !GetFormat()->getIDocumentDrawModelAccess().IsVisibleLayerId( _pDrawObj->GetLayer() ) );
212 
213  MoveObjToLayer( true, _pDrawObj );
214 
215  // #i46297#
216  if ( bNotify )
217  {
218  SwAnchoredObject* pAnchoredObj = GetAnchoredObj( _pDrawObj );
219  assert(pAnchoredObj);
220  ::setContextWritingMode( _pDrawObj, pAnchoredObj->GetAnchorFrameContainingAnchPos() );
221  // Note: as-character anchored objects aren't registered at a page frame and
222  // a notification of its background isn't needed.
223  if ( pAnchoredObj->GetPageFrame() )
224  {
225  ::Notify_Background( _pDrawObj, pAnchoredObj->GetPageFrame(),
226  pAnchoredObj->GetObjRect(), PREP_FLY_ARRIVE, true );
227  }
228 
229  pAnchoredObj->InvalidateObjPos();
230  }
231 }
232 
235 {
236  // #i46297# - notify background about the leaving of the object.
237  const bool bNotify( GetFormat()->getIDocumentDrawModelAccess().IsVisibleLayerId( _pDrawObj->GetLayer() ) );
238 
239  MoveObjToLayer( false, _pDrawObj );
240 
241  // #i46297#
242  if ( bNotify )
243  {
244  SwAnchoredObject* pAnchoredObj = GetAnchoredObj( _pDrawObj );
245  assert(pAnchoredObj);
246  // Note: as-character anchored objects aren't registered at a page frame and
247  // a notification of its background isn't needed.
248  if (pAnchoredObj->GetPageFrame())
249  {
250  ::Notify_Background( _pDrawObj, pAnchoredObj->GetPageFrame(),
251  pAnchoredObj->GetObjRect(), PREP_FLY_LEAVE, true );
252  }
253  }
254 }
255 
261 void SwContact::MoveObjToLayer( const bool _bToVisible,
262  SdrObject* _pDrawObj )
263 {
264  if ( !_pDrawObj )
265  {
266  OSL_FAIL( "SwDrawContact::MoveObjToLayer(..) - no drawing object!" );
267  return;
268  }
269 
270  if ( !GetRegisteredIn() )
271  {
272  OSL_FAIL( "SwDrawContact::MoveObjToLayer(..) - no drawing frame format!" );
273  return;
274  }
275 
276  const IDocumentDrawModelAccess& rIDDMA = static_cast<SwFrameFormat*>(GetRegisteredInNonConst())->getIDocumentDrawModelAccess();
277 
278  SdrLayerID nToHellLayerId =
279  _bToVisible ? rIDDMA.GetHellId() : rIDDMA.GetInvisibleHellId();
280  SdrLayerID nToHeavenLayerId =
281  _bToVisible ? rIDDMA.GetHeavenId() : rIDDMA.GetInvisibleHeavenId();
282  SdrLayerID nToControlLayerId =
283  _bToVisible ? rIDDMA.GetControlsId() : rIDDMA.GetInvisibleControlsId();
284  SdrLayerID nFromHellLayerId =
285  _bToVisible ? rIDDMA.GetInvisibleHellId() : rIDDMA.GetHellId();
286  SdrLayerID nFromHeavenLayerId =
287  _bToVisible ? rIDDMA.GetInvisibleHeavenId() : rIDDMA.GetHeavenId();
288  SdrLayerID nFromControlLayerId =
289  _bToVisible ? rIDDMA.GetInvisibleControlsId() : rIDDMA.GetControlsId();
290 
291  if ( dynamic_cast<const SdrObjGroup*>( _pDrawObj) != nullptr )
292  {
293  // determine layer for group object
294  {
295  // proposed layer of a group object is the hell layer
296  SdrLayerID nNewLayerId = nToHellLayerId;
297  if ( ::CheckControlLayer( _pDrawObj ) )
298  {
299  // it has to be the control layer, if one of the member
300  // is a control
301  nNewLayerId = nToControlLayerId;
302  }
303  else if ( _pDrawObj->GetLayer() == rIDDMA.GetHeavenId() ||
304  _pDrawObj->GetLayer() == rIDDMA.GetInvisibleHeavenId() )
305  {
306  // it has to be the heaven layer, if method <GetLayer()> reveals
307  // a heaven layer
308  nNewLayerId = nToHeavenLayerId;
309  }
310  // set layer at group object, but do *not* broadcast and
311  // no propagation to the members.
312  // Thus, call <NbcSetLayer(..)> at super class
313  _pDrawObj->SdrObject::NbcSetLayer( nNewLayerId );
314  }
315 
316  // call method recursively for group object members
317  const SdrObjList* pLst =
318  static_cast<SdrObjGroup*>(_pDrawObj)->GetSubList();
319  if ( pLst )
320  {
321  for ( size_t i = 0; i < pLst->GetObjCount(); ++i )
322  {
323  MoveObjToLayer( _bToVisible, pLst->GetObj( i ) );
324  }
325  }
326  }
327  else
328  {
329  const SdrLayerID nLayerIdOfObj = _pDrawObj->GetLayer();
330  if ( nLayerIdOfObj == nFromHellLayerId )
331  {
332  _pDrawObj->SetLayer( nToHellLayerId );
333  }
334  else if ( nLayerIdOfObj == nFromHeavenLayerId )
335  {
336  _pDrawObj->SetLayer( nToHeavenLayerId );
337  }
338  else if ( nLayerIdOfObj == nFromControlLayerId )
339  {
340  _pDrawObj->SetLayer( nToControlLayerId );
341  }
342  }
343 }
344 
346 sal_uInt32 SwContact::GetMinOrdNum() const
347 {
348  sal_uInt32 nMinOrdNum( SAL_MAX_UINT32 );
349 
350  std::vector< SwAnchoredObject* > aObjs;
351  GetAnchoredObjs( aObjs );
352 
353  while ( !aObjs.empty() )
354  {
355  sal_uInt32 nTmpOrdNum = aObjs.back()->GetDrawObj()->GetOrdNum();
356 
357  if ( nTmpOrdNum < nMinOrdNum )
358  {
359  nMinOrdNum = nTmpOrdNum;
360  }
361 
362  aObjs.pop_back();
363  }
364 
365  OSL_ENSURE( nMinOrdNum != SAL_MAX_UINT32,
366  "<SwContact::GetMinOrdNum()> - no order number found." );
367  return nMinOrdNum;
368 }
369 
371 sal_uInt32 SwContact::GetMaxOrdNum() const
372 {
373  sal_uInt32 nMaxOrdNum( 0 );
374 
375  std::vector< SwAnchoredObject* > aObjs;
376  GetAnchoredObjs( aObjs );
377 
378  while ( !aObjs.empty() )
379  {
380  sal_uInt32 nTmpOrdNum = aObjs.back()->GetDrawObj()->GetOrdNum();
381 
382  if ( nTmpOrdNum > nMaxOrdNum )
383  {
384  nMaxOrdNum = nTmpOrdNum;
385  }
386 
387  aObjs.pop_back();
388  }
389 
390  return nMaxOrdNum;
391 }
392 
393 namespace
394 {
395  Point lcl_GetWW8Pos(SwAnchoredObject const * pAnchoredObj, const bool bFollowTextFlow, sw::WW8AnchorConv& reConv)
396  {
397  switch(reConv)
398  {
400  {
401  bool bRelToTableCell(false);
402  Point aPos(pAnchoredObj->GetRelPosToPageFrame(bFollowTextFlow, bRelToTableCell));
403  if(bRelToTableCell)
405  return aPos;
406  }
408  return pAnchoredObj->GetRelPosToAnchorFrame();
410  return pAnchoredObj->GetRelPosToChar();
412  return pAnchoredObj->GetRelPosToLine();
413  default: ;
414  }
415  return Point();
416  }
417 }
418 void SwContact::SwClientNotify(const SwModify& rMod, const SfxHint& rHint)
419 {
420  // this does not call SwClient::SwClientNotify and thus doesn't handle RES_OBJECTDYING as usual. Is this intentional?
421  if (auto pFindSdrObjectHint = dynamic_cast<const sw::FindSdrObjectHint*>(&rHint))
422  {
423  if(!pFindSdrObjectHint->m_rpObject)
424  pFindSdrObjectHint->m_rpObject = GetMaster();
425  }
426  else if (auto pWW8AnchorConvHint = dynamic_cast<const sw::WW8AnchorConvHint*>(&rHint))
427  {
428  // determine anchored object
429  SwAnchoredObject* pAnchoredObj(nullptr);
430  {
431  std::vector<SwAnchoredObject*> aAnchoredObjs;
432  GetAnchoredObjs(aAnchoredObjs);
433  if(!aAnchoredObjs.empty())
434  pAnchoredObj = aAnchoredObjs.front();
435  }
436  // no anchored object found. Thus, the needed layout information can't
437  // be determined. --> no conversion
438  if(!pAnchoredObj)
439  return;
440  // no conversion for anchored drawing object, which aren't attached to an
441  // anchor frame.
442  // This is the case for drawing objects, which are anchored inside a page
443  // header/footer of an *unused* page style.
444  if(dynamic_cast<SwAnchoredDrawObject*>(pAnchoredObj) && !pAnchoredObj->GetAnchorFrame())
445  return;
446  const bool bFollowTextFlow = static_cast<const SwFrameFormat&>(rMod).GetFollowTextFlow().GetValue();
447  sw::WW8AnchorConvResult& rResult(pWW8AnchorConvHint->m_rResult);
448  // No distinction between layout directions, because of missing
449  // information about WW8 in vertical layout.
450  rResult.m_aPos.setX(lcl_GetWW8Pos(pAnchoredObj, bFollowTextFlow, rResult.m_eHoriConv).getX());
451  rResult.m_aPos.setY(lcl_GetWW8Pos(pAnchoredObj, bFollowTextFlow, rResult.m_eVertConv).getY());
452  rResult.m_bConverted = true;
453  }
454 }
455 
456 
458  SwFlyFrameFormat *pToRegisterIn,
459  SdrModel& rTargetModel)
460 : SwContact(pToRegisterIn),
461  mpMasterObj(new SwFlyDrawObj(rTargetModel))
462 {
463  // #i26791# - class <SwFlyDrawContact> contains the 'master'
464  // drawing object of type <SwFlyDrawObj> on its own.
465  mpMasterObj->SetOrdNum( 0xFFFFFFFE );
466  mpMasterObj->SetUserCall( this );
467 }
468 
470 {
471  if ( mpMasterObj )
472  {
473  mpMasterObj->SetUserCall( nullptr );
474  if ( mpMasterObj->getSdrPageFromSdrObject() )
475  mpMasterObj->getSdrPageFromSdrObject()->RemoveObject( mpMasterObj->GetOrdNum() );
476  }
477 }
478 
480 {
481  // search for another Writer fly frame registered at same frame format
483  const SwFlyFrame* pFlyFrame(nullptr);
484  for(pFlyFrame = aIter.First(); pFlyFrame; pFlyFrame = aIter.Next())
485  {
486  if(pFlyFrame != pFly)
487  break;
488  }
489 
490  if(pFlyFrame)
491  {
492  // another Writer fly frame found. Take its order number
493  return pFlyFrame->GetVirtDrawObj()->GetOrdNum();
494  }
495  // no other Writer fly frame found. Take order number of 'master' object
496  // #i35748# - use method <GetOrdNumDirect()> instead
497  // of method <GetOrdNum()> to avoid a recalculation of the order number,
498  // which isn't intended.
499  return GetMaster()->GetOrdNumDirect();
500 }
501 
503 {
504  // Find ContactObject from the Format. If there's already one, we just
505  // need to create a new Ref, else we create the Contact now.
506 
508  SwFlyDrawContact* pContact = pFormat->GetOrCreateContact();
509  SwVirtFlyDrawObj* pDrawObj(
510  new SwVirtFlyDrawObj(
511  pContact->GetMaster()->getSdrModelFromSdrObject(),
512  *pContact->GetMaster(),
513  pFly));
514  pDrawObj->SetUserCall(pContact);
515 
516  // The Reader creates the Masters and inserts them into the Page in
517  // order to transport the z-order.
518  // After creating the first Reference the Masters are removed from the
519  // List and are not important anymore.
520  SdrPage* pPg(nullptr);
521  if(nullptr != (pPg = pContact->GetMaster()->getSdrPageFromSdrObject()))
522  {
523  const size_t nOrdNum = pContact->GetMaster()->GetOrdNum();
524  pPg->ReplaceObject(pDrawObj, nOrdNum);
525  }
526  // #i27030# - insert new <SwVirtFlyDrawObj> instance
527  // into drawing page with correct order number
528  else
529  rIDDMA.GetDrawModel()->GetPage(0)->InsertObject(pDrawObj, pContact->GetOrdNumForNewRef(pFly));
530  // #i38889# - assure, that new <SwVirtFlyDrawObj> instance
531  // is in a visible layer.
532  pContact->MoveObjToVisibleLayer(pDrawObj);
533  return pDrawObj;
534 }
535 
536 // #i26791#
538 {
539  assert(pSdrObj);
540  assert(dynamic_cast<const SwVirtFlyDrawObj*>(pSdrObj) != nullptr);
541  assert(GetUserCall(pSdrObj) == this &&
542  "<SwFlyDrawContact::GetAnchoredObj(..)> - provided object doesn't belong to this contact");
543 
544  const SwAnchoredObject *const pRetAnchoredObj =
545  static_cast<const SwVirtFlyDrawObj*>(pSdrObj)->GetFlyFrame();
546 
547  return pRetAnchoredObj;
548 }
549 
551 {
552  return const_cast<SwAnchoredObject *>(const_cast<SwFlyDrawContact const*>(this)->GetAnchoredObj(pSdrObj));
553 }
554 
556 {
557  return mpMasterObj.get();
558 }
559 
566 {
567  assert(dynamic_cast<const SwVirtFlyDrawObj*>(_pDrawObj) != nullptr);
568 
569  if ( GetFormat()->getIDocumentDrawModelAccess().IsVisibleLayerId( _pDrawObj->GetLayer() ) )
570  {
571  // nothing to do
572  return;
573  }
574 
575  SwFlyFrame* pFlyFrame = static_cast<SwVirtFlyDrawObj*>(_pDrawObj)->GetFlyFrame();
576 
577  // #i44464# - consider, that Writer fly frame content
578  // already exists - (e.g. WW8 document is inserted into an existing document).
579  if ( !pFlyFrame->Lower() )
580  {
581  pFlyFrame->InsertColumns();
582  pFlyFrame->Chain( pFlyFrame->AnchorFrame() );
583  pFlyFrame->InsertCnt();
584  }
585  if ( pFlyFrame->GetDrawObjs() )
586  {
587  for (SwAnchoredObject* i : *pFlyFrame->GetDrawObjs())
588  {
589  // #i28701# - consider type of objects in sorted object list.
590  SdrObject* pObj = i->DrawObj();
591  SwContact* pContact = static_cast<SwContact*>(pObj->GetUserCall());
592  pContact->MoveObjToVisibleLayer( pObj );
593  }
594  }
595 
596  // make fly frame visible
598 }
599 
606 {
607  assert(dynamic_cast<const SwVirtFlyDrawObj*>(_pDrawObj) != nullptr);
608 
609  if ( !GetFormat()->getIDocumentDrawModelAccess().IsVisibleLayerId( _pDrawObj->GetLayer() ) )
610  {
611  // nothing to do
612  return;
613  }
614 
615  SwFlyFrame* pFlyFrame = static_cast<SwVirtFlyDrawObj*>(_pDrawObj)->GetFlyFrame();
616 
617  pFlyFrame->Unchain();
618  pFlyFrame->DeleteCnt();
619  if ( pFlyFrame->GetDrawObjs() )
620  {
621  for (SwAnchoredObject* i : *pFlyFrame->GetDrawObjs())
622  {
623  // #i28701# - consider type of objects in sorted object list.
624  SdrObject* pObj = i->DrawObj();
625  SwContact* pContact = static_cast<SwContact*>(pObj->GetUserCall());
626  pContact->MoveObjToInvisibleLayer( pObj );
627  }
628  }
629 
630  // make fly frame invisible
632 }
633 
635 void SwFlyDrawContact::GetAnchoredObjs( std::vector<SwAnchoredObject*>& _roAnchoredObjs ) const
636 {
637  const SwFrameFormat* pFormat = GetFormat();
638  SwFlyFrame::GetAnchoredObjects( _roAnchoredObjs, *pFormat );
639 }
640 void SwFlyDrawContact::SwClientNotify(const SwModify& rMod, const SfxHint& rHint)
641 {
642  SwContact::SwClientNotify(rMod, rHint);
643  if(auto pGetZOrdnerHint = dynamic_cast<const sw::GetZOrderHint*>(&rHint))
644  {
645  // #i11176#
646  // This also needs to work when no layout exists. Thus, for
647  // FlyFrames an alternative method is used now in that case.
648  auto pFormat(dynamic_cast<const SwFrameFormat*>(&rMod));
649  if (pFormat && pFormat->Which() == RES_FLYFRMFMT && !pFormat->getIDocumentLayoutAccess().GetCurrentViewShell())
650  pGetZOrdnerHint->m_rnZOrder = GetMaster()->GetOrdNum();
651  }
652 }
653 
654 // SwDrawContact
655 
656 bool CheckControlLayer( const SdrObject *pObj )
657 {
658  if ( SdrInventor::FmForm == pObj->GetObjInventor() )
659  return true;
660  if (const SdrObjGroup *pObjGroup = dynamic_cast<const SdrObjGroup*>(pObj))
661  {
662  const SdrObjList *pLst = pObjGroup->GetSubList();
663  for ( size_t i = 0; i < pLst->GetObjCount(); ++i )
664  {
665  if ( ::CheckControlLayer( pLst->GetObj( i ) ) )
666  {
667  // #i18447# - return correct value ;-)
668  return true;
669  }
670  }
671  }
672  return false;
673 }
674 
676  SwContact( pToRegisterIn ),
677  maAnchoredDrawObj(),
678  mbMasterObjCleared( false ),
679  mbDisconnectInProgress( false ),
680  mbUserCallActive( false ),
681  // Note: value of <meEventTypeOfCurrentUserCall> isn't of relevance, because
682  // <mbUserCallActive> is false.
683  meEventTypeOfCurrentUserCall( SdrUserCallType::MoveOnly )
684 {
685  // --> #i33909# - assure, that drawing object is inserted
686  // in the drawing page.
687  if ( !pObj->IsInserted() )
688  {
689  pToRegisterIn->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0)->
690  InsertObject( pObj, pObj->GetOrdNumDirect() );
691  }
692 
693  // Controls have to be always in the Control-Layer. This is also true for
694  // group objects, if they contain controls.
695  if ( ::CheckControlLayer( pObj ) )
696  {
697  // set layer of object to corresponding invisible layer.
698  pObj->SetLayer( pToRegisterIn->getIDocumentDrawModelAccess().GetInvisibleControlsId() );
699  }
700 
701  // #i26791#
702  pObj->SetUserCall( this );
703  maAnchoredDrawObj.SetDrawObj( *pObj );
704 
705  // if there already exists an SwXShape for the object, ensure it knows about us, and the SdrObject
706  // #i99056#
708 }
709 
711 {
712  SetInDTOR();
713 
715 
716  // remove 'master' from drawing page
718 
719  // remove and destroy 'virtual' drawing objects.
721 
722  if ( !mbMasterObjCleared )
723  {
724  SdrObject* pObject = const_cast< SdrObject* >( maAnchoredDrawObj.GetDrawObj() );
725  SdrObject::Free( pObject );
726  }
727 }
728 
729 void SwDrawContact::GetTextObjectsFromFormat(std::list<SdrTextObj*>& o_rTextObjects, SwDoc* pDoc)
730 {
731  for(auto& rpFly : *pDoc->GetSpzFrameFormats())
732  {
733  if(dynamic_cast<const SwDrawFrameFormat*>(rpFly))
734  rpFly->CallSwClientNotify(sw::CollectTextObjectsHint(o_rTextObjects));
735  }
736 }
737 
738 // #i26791#
740 {
741  // handle default parameter value
742  if (!pSdrObj)
743  {
744  pSdrObj = GetMaster();
745  }
746 
747  assert(pSdrObj);
748  assert(dynamic_cast<const SwDrawVirtObj*>(pSdrObj) != nullptr ||
749  dynamic_cast<const SdrVirtObj*>(pSdrObj) == nullptr);
750  assert((GetUserCall(pSdrObj) == this ||
751  pSdrObj == GetMaster()) &&
752  "<SwDrawContact::GetAnchoredObj(..)> - provided object doesn't belongs to this contact" );
753 
754  const SwAnchoredObject* pRetAnchoredObj = nullptr;
755 
756  if (auto pVirtObj = dynamic_cast<const SwDrawVirtObj*>(pSdrObj))
757  {
758  pRetAnchoredObj = &(pVirtObj->GetAnchoredObj());
759  }
760  else
761  {
762  assert(dynamic_cast<const SdrVirtObj*>(pSdrObj) == nullptr);
763  pRetAnchoredObj = &maAnchoredDrawObj;
764  }
765 
766  return pRetAnchoredObj;
767 }
768 
770 {
771  return const_cast<SwAnchoredObject*>(const_cast<SwDrawContact const*>(this)->GetAnchoredObj(pSdrObj));
772 }
773 
775 {
776  return !mbMasterObjCleared
778  : nullptr;
779 }
780 
781 const SwFrame* SwDrawContact::GetAnchorFrame( const SdrObject* _pDrawObj ) const
782 {
783  const SwFrame* pAnchorFrame = nullptr;
784  if ( !_pDrawObj ||
785  _pDrawObj == GetMaster() ||
786  ( !_pDrawObj->GetUserCall() &&
787  GetUserCall( _pDrawObj ) == this ) )
788  {
789  pAnchorFrame = maAnchoredDrawObj.GetAnchorFrame();
790  }
791  else
792  {
793  assert(dynamic_cast<SwDrawVirtObj const*>(_pDrawObj) != nullptr);
794  pAnchorFrame = static_cast<const SwDrawVirtObj*>(_pDrawObj)->GetAnchorFrame();
795  }
796 
797  return pAnchorFrame;
798 }
799 
801 {
802  return const_cast<SwFrame *>(const_cast<SwDrawContact const*>(this)->GetAnchorFrame(pDrawObj));
803 }
804 
808 {
809  maDrawVirtObjs.push_back(
811  new SwDrawVirtObj(
812  GetMaster()->getSdrModelFromSdrObject(),
813  *GetMaster(),
814  *this)));
815  maDrawVirtObjs.back()->AddToDrawingPage();
816  return maDrawVirtObjs.back().get();
817 }
818 
821 {
822  for(auto& rpDrawVirtObj : maDrawVirtObjs)
823  {
824  // remove and destroy 'virtual object'
825  rpDrawVirtObj->RemoveFromWriterLayout();
826  rpDrawVirtObj->RemoveFromDrawingPage();
827  }
828  maDrawVirtObjs.clear();
829 }
830 
831 
834 {
835  SdrObject* pRetDrawObj = nullptr;
836 
837  // #i26791# - compare master frames instead of direct frames
838  const SwFrame* pProposedAnchorFrame = &_rAnchorFrame;
839  if ( pProposedAnchorFrame->IsContentFrame() )
840  {
841  const SwContentFrame* pTmpFrame =
842  static_cast<const SwContentFrame*>( pProposedAnchorFrame );
843  while ( pTmpFrame->IsFollow() )
844  {
845  pTmpFrame = pTmpFrame->FindMaster();
846  }
847  pProposedAnchorFrame = pTmpFrame;
848  }
849 
850  const SwFrame* pMasterObjAnchorFrame = GetAnchorFrame();
851  if ( pMasterObjAnchorFrame && pMasterObjAnchorFrame->IsContentFrame() )
852  {
853  const SwContentFrame* pTmpFrame =
854  static_cast<const SwContentFrame*>( pMasterObjAnchorFrame );
855  while ( pTmpFrame->IsFollow() )
856  {
857  pTmpFrame = pTmpFrame->FindMaster();
858  }
859  pMasterObjAnchorFrame = pTmpFrame;
860  }
861 
862  if ( pMasterObjAnchorFrame && pMasterObjAnchorFrame == pProposedAnchorFrame )
863  {
864  pRetDrawObj = GetMaster();
865  }
866  else
867  {
868  const auto ppFoundVirtObj(std::find_if(maDrawVirtObjs.begin(), maDrawVirtObjs.end(),
869  VirtObjAnchoredAtFramePred(pProposedAnchorFrame)));
870  if(ppFoundVirtObj != maDrawVirtObjs.end())
871  pRetDrawObj = ppFoundVirtObj->get();
872  }
873 
874  return pRetDrawObj;
875 }
876 
878 {
879  for(const auto& rpDrawVirtObj : maDrawVirtObjs)
880  {
881  SwDrawVirtObj* pDrawVirtObj(rpDrawVirtObj.get());
882  if ( pDrawVirtObj->GetAnchorFrame() )
883  {
884  // #i34640# - determine correct page frame
885  SwPageFrame* pPage = pDrawVirtObj->AnchoredObj().FindPageFrameOfAnchor();
886  if( pOldBoundRect && pPage )
887  {
888  SwRect aOldRect( *pOldBoundRect );
889  aOldRect.Pos() += pDrawVirtObj->GetOffset();
890  if( aOldRect.HasArea() )
891  ::Notify_Background( pDrawVirtObj, pPage,
892  aOldRect, PREP_FLY_LEAVE,true);
893  }
894  // #i34640# - include spacing for wrapping
895  SwRect aRect( pDrawVirtObj->GetAnchoredObj().GetObjRectWithSpaces() );
896  if (aRect.HasArea() && pPage)
897  {
898  SwPageFrame* pPg = const_cast<SwPageFrame*>(static_cast<const SwPageFrame*>(::FindPage( aRect, pPage )));
899  if ( pPg )
900  ::Notify_Background( pDrawVirtObj, pPg, aRect,
901  PREP_FLY_ARRIVE, true );
902  }
903  ::ClrContourCache( pDrawVirtObj );
904  }
905  }
906 }
907 
909 static void lcl_NotifyBackgroundOfObj( SwDrawContact const & _rDrawContact,
910  const SdrObject& _rObj,
911  const tools::Rectangle* _pOldObjRect )
912 {
913  // #i34640#
914  SwAnchoredObject* pAnchoredObj =
915  const_cast<SwAnchoredObject*>(_rDrawContact.GetAnchoredObj( &_rObj ));
916  if ( pAnchoredObj && pAnchoredObj->GetAnchorFrame() )
917  {
918  // #i34640# - determine correct page frame
919  SwPageFrame* pPageFrame = pAnchoredObj->FindPageFrameOfAnchor();
920  if( _pOldObjRect && pPageFrame )
921  {
922  SwRect aOldRect( *_pOldObjRect );
923  if( aOldRect.HasArea() )
924  {
925  // #i34640# - determine correct page frame
926  SwPageFrame* pOldPageFrame = const_cast<SwPageFrame*>(static_cast<const SwPageFrame*>(::FindPage( aOldRect, pPageFrame )));
927  ::Notify_Background( &_rObj, pOldPageFrame, aOldRect,
928  PREP_FLY_LEAVE, true);
929  }
930  }
931  // #i34640# - include spacing for wrapping
932  SwRect aNewRect( pAnchoredObj->GetObjRectWithSpaces() );
933  if( aNewRect.HasArea() && pPageFrame )
934  {
935  pPageFrame = const_cast<SwPageFrame*>(static_cast<const SwPageFrame*>(::FindPage( aNewRect, pPageFrame )));
936  ::Notify_Background( &_rObj, pPageFrame, aNewRect,
937  PREP_FLY_ARRIVE, true );
938  }
939  ClrContourCache( &_rObj );
940  }
941 }
942 
944  SdrUserCallType eType,
945  const tools::Rectangle& rOldBoundRect )
946 {
947  // #i26791# - no event handling, if existing <SwViewShell>
948  // is in construction
949  SwDoc* pDoc = GetFormat()->GetDoc();
952  {
953  return;
954  }
955 
956  // #i44339#
957  // no event handling, if document is in destruction.
958  // Exception: It's the SdrUserCallType::Delete event
959  if ( pDoc->IsInDtor() && eType != SdrUserCallType::Delete )
960  {
961  return;
962  }
963 
964  //Put on Action, but not if presently anywhere an action runs.
965  bool bHasActions(true);
967  if ( pTmpRoot && pTmpRoot->IsCallbackActionEnabled() )
968  {
970  if ( pSh )
971  {
972  for(SwViewShell& rShell : pSh->GetRingContainer() )
973  {
974  if ( rShell.Imp()->IsAction() || rShell.Imp()->IsIdleAction() )
975  {
976  bHasActions = true;
977  break;
978  }
979  bHasActions = false;
980  }
981  }
982  if(!bHasActions)
983  pTmpRoot->StartAllAction();
984  }
985  SdrObjUserCall::Changed( rObj, eType, rOldBoundRect );
986  Changed_( rObj, eType, &rOldBoundRect ); //Attention, possibly suicidal!
987 
988  if(!bHasActions)
989  pTmpRoot->EndAllAction();
990 }
991 
995 {
996  private:
1000 
1001  public:
1003  SdrUserCallType _eEventType )
1004  : mpDrawContact( _pDrawContact ),
1005  mbParentUserCallActive( _pDrawContact->mbUserCallActive ),
1006  meParentUserCallEventType( _pDrawContact->meEventTypeOfCurrentUserCall )
1007  {
1008  mpDrawContact->mbUserCallActive = true;
1009  mpDrawContact->meEventTypeOfCurrentUserCall = _eEventType;
1010  }
1011 
1013  {
1014  if ( mpDrawContact )
1015  {
1016  mpDrawContact->mbUserCallActive = mbParentUserCallActive;
1018  }
1019  }
1020 
1022  {
1023  mpDrawContact = nullptr;
1024  }
1025 
1026  bool IsNestedUserCall() const
1027  {
1028  return mbParentUserCallActive;
1029  }
1030 
1032  {
1033  if ( IsNestedUserCall() )
1034  {
1035  bool bTmpAssert( true );
1036  // Currently its known, that a nested event SdrUserCallType::Resize
1037  // could occur during parent user call SdrUserCallType::Inserted,
1038  // SdrUserCallType::Delete and SdrUserCallType::Resize for edge objects.
1039  // Also possible are nested SdrUserCallType::ChildResize events for
1040  // edge objects
1041  // Thus, assert all other combinations
1042  if ( ( meParentUserCallEventType == SdrUserCallType::Inserted ||
1043  meParentUserCallEventType == SdrUserCallType::Delete ||
1044  meParentUserCallEventType == SdrUserCallType::Resize ) &&
1045  mpDrawContact->meEventTypeOfCurrentUserCall == SdrUserCallType::Resize )
1046  {
1047  bTmpAssert = false;
1048  }
1049  else if ( meParentUserCallEventType == SdrUserCallType::ChildResize &&
1050  mpDrawContact->meEventTypeOfCurrentUserCall == SdrUserCallType::ChildResize )
1051  {
1052  bTmpAssert = false;
1053  }
1054 
1055  if ( bTmpAssert )
1056  {
1057  OSL_FAIL( "<SwDrawContact::Changed_(..)> - unknown nested <UserCall> event. This is serious." );
1058  }
1059  }
1060  }
1061 };
1062 
1065 {
1067  {
1068  // Just notify the textbox that the size has changed, the actual object size is not interesting.
1070  SwFormatFrameSize aSize;
1071  aResizeSet.Put(aSize);
1072  SwTextBoxHelper::syncFlyFrameAttr(*pFormat, aResizeSet);
1073  }
1074 }
1075 
1076 // !!!ATTENTION!!! The object may commit suicide!!!
1077 
1079  SdrUserCallType eType,
1080  const tools::Rectangle* pOldBoundRect )
1081 {
1082  // suppress handling of nested <SdrObjUserCall> events
1083  NestedUserCallHdl aNestedUserCallHdl( this, eType );
1084  if ( aNestedUserCallHdl.IsNestedUserCall() )
1085  {
1086  aNestedUserCallHdl.AssertNestedUserCall();
1087  return;
1088  }
1089  // do *not* notify, if document is destructing
1090  // #i35912# - do *not* notify for as-character anchored
1091  // drawing objects.
1092  // #i35007#
1093  // improvement: determine as-character anchored object flag only once.
1094  const bool bAnchoredAsChar = ObjAnchoredAsChar();
1095  const bool bNotify = !(GetFormat()->GetDoc()->IsInDtor()) &&
1096  ( css::text::WrapTextMode_THROUGH != GetFormat()->GetSurround().GetSurround() ) &&
1097  !bAnchoredAsChar;
1098  switch( eType )
1099  {
1100  case SdrUserCallType::Delete:
1101  {
1102  if ( bNotify )
1103  {
1104  lcl_NotifyBackgroundOfObj( *this, rObj, pOldBoundRect );
1105  // --> #i36181# - background of 'virtual'
1106  // drawing objects have also been notified.
1107  NotifyBackgrdOfAllVirtObjs( pOldBoundRect );
1108  }
1109  DisconnectFromLayout( false );
1110  mbMasterObjCleared = true;
1111  delete this;
1112  // --> #i65784# Prevent memory corruption
1113  aNestedUserCallHdl.DrawContactDeleted();
1114  break;
1115  }
1116  case SdrUserCallType::Inserted:
1117  {
1118  if ( mbDisconnectInProgress )
1119  {
1120  OSL_FAIL( "<SwDrawContact::Changed_(..)> - Insert event during disconnection from layout is invalid." );
1121  }
1122  else
1123  {
1124  ConnectToLayout();
1125  if ( bNotify )
1126  {
1127  lcl_NotifyBackgroundOfObj( *this, rObj, pOldBoundRect );
1128  }
1129  }
1130  break;
1131  }
1132  case SdrUserCallType::Removed:
1133  {
1134  if ( bNotify )
1135  {
1136  lcl_NotifyBackgroundOfObj( *this, rObj, pOldBoundRect );
1137  }
1138  DisconnectFromLayout( false );
1139  break;
1140  }
1141  case SdrUserCallType::ChildInserted :
1142  case SdrUserCallType::ChildRemoved :
1143  {
1144  // --> #i113730#
1145  // force layer of controls for group objects containing control objects
1146  if(dynamic_cast< SdrObjGroup* >(maAnchoredDrawObj.DrawObj()))
1147  {
1149  {
1150  const IDocumentDrawModelAccess& rIDDMA = static_cast<SwFrameFormat*>(GetRegisteredInNonConst())->getIDocumentDrawModelAccess();
1151  const SdrLayerID aCurrentLayer(maAnchoredDrawObj.DrawObj()->GetLayer());
1152  const SdrLayerID aControlLayerID(rIDDMA.GetControlsId());
1153  const SdrLayerID aInvisibleControlLayerID(rIDDMA.GetInvisibleControlsId());
1154 
1155  if(aCurrentLayer != aControlLayerID && aCurrentLayer != aInvisibleControlLayerID)
1156  {
1157  if ( aCurrentLayer == rIDDMA.GetInvisibleHellId() ||
1158  aCurrentLayer == rIDDMA.GetInvisibleHeavenId() )
1159  {
1160  maAnchoredDrawObj.DrawObj()->SetLayer(aInvisibleControlLayerID);
1161  }
1162  else
1163  {
1164  maAnchoredDrawObj.DrawObj()->SetLayer(aControlLayerID);
1165  }
1166  }
1167  }
1168  }
1169  [[fallthrough]];
1170  }
1171  case SdrUserCallType::MoveOnly:
1172  case SdrUserCallType::Resize:
1173  case SdrUserCallType::ChildMoveOnly :
1174  case SdrUserCallType::ChildResize :
1175  case SdrUserCallType::ChildChangeAttr :
1176  case SdrUserCallType::ChildDelete :
1177  {
1178  // #i31698# - improvement
1179  // get instance <SwAnchoredDrawObject> only once
1180  const SwAnchoredDrawObject* pAnchoredDrawObj =
1181  static_cast<const SwAnchoredDrawObject*>( GetAnchoredObj( &rObj ) );
1182 
1183  /* protect against NULL pointer dereferencing */
1184  if(!pAnchoredDrawObj)
1185  {
1186  break;
1187  }
1188 
1189  // #i26791# - adjust positioning and alignment attributes,
1190  // if positioning of drawing object isn't in progress.
1191  // #i53320# - no adjust of positioning attributes,
1192  // if drawing object isn't positioned.
1193  if ( !pAnchoredDrawObj->IsPositioningInProgress() &&
1194  !pAnchoredDrawObj->NotYetPositioned() )
1195  {
1196  // #i34748# - If no last object rectangle is
1197  // provided by the anchored object, use parameter <pOldBoundRect>.
1198  const tools::Rectangle& aOldObjRect = pAnchoredDrawObj->GetLastObjRect()
1199  ? *(pAnchoredDrawObj->GetLastObjRect())
1200  : *pOldBoundRect;
1201  // #i79400#
1202  // always invalidate object rectangle inclusive spaces
1203  pAnchoredDrawObj->InvalidateObjRectWithSpaces();
1204  // #i41324# - notify background before
1205  // adjusting position
1206  if ( bNotify )
1207  {
1208  // #i31573# - correction
1209  // background of given drawing object.
1210  lcl_NotifyBackgroundOfObj( *this, rObj, &aOldObjRect );
1211  }
1212  // #i31698# - determine layout direction
1213  // via draw frame format.
1214  SwFrameFormat::tLayoutDir eLayoutDir =
1215  pAnchoredDrawObj->GetFrameFormat().GetLayoutDir();
1216  // use geometry of drawing object
1217  SwRect aObjRect( rObj.GetSnapRect() );
1218  // If drawing object is a member of a group, the adjustment
1219  // of the positioning and the alignment attributes has to
1220  // be done for the top group object.
1221  if ( rObj.getParentSdrObjectFromSdrObject() )
1222  {
1223  const SdrObject* pGroupObj = rObj.getParentSdrObjectFromSdrObject();
1224  while ( pGroupObj->getParentSdrObjectFromSdrObject() )
1225  {
1226  pGroupObj = pGroupObj->getParentSdrObjectFromSdrObject();
1227  }
1228  // use geometry of drawing object
1229  aObjRect = pGroupObj->GetSnapRect();
1230  }
1231  SwTwips nXPosDiff(0);
1232  SwTwips nYPosDiff(0);
1233  switch ( eLayoutDir )
1234  {
1236  {
1237  nXPosDiff = aObjRect.Left() - aOldObjRect.Left();
1238  nYPosDiff = aObjRect.Top() - aOldObjRect.Top();
1239  }
1240  break;
1242  {
1243  nXPosDiff = aOldObjRect.Right() - aObjRect.Right();
1244  nYPosDiff = aObjRect.Top() - aOldObjRect.Top();
1245  }
1246  break;
1248  {
1249  nXPosDiff = aObjRect.Top() - aOldObjRect.Top();
1250  nYPosDiff = aOldObjRect.Right() - aObjRect.Right();
1251  }
1252  break;
1253  default:
1254  {
1255  assert(!"<SwDrawContact::Changed_(..)> - unsupported layout direction");
1256  }
1257  }
1258  SfxItemSet aSet( GetFormat()->GetDoc()->GetAttrPool(),
1260  const SwFormatVertOrient& rVert = GetFormat()->GetVertOrient();
1261  if ( nYPosDiff != 0 )
1262  {
1263 
1264  if ( rVert.GetRelationOrient() == text::RelOrientation::CHAR ||
1265  rVert.GetRelationOrient() == text::RelOrientation::TEXT_LINE )
1266  {
1267  nYPosDiff = -nYPosDiff;
1268  }
1269  aSet.Put( SwFormatVertOrient( rVert.GetPos()+nYPosDiff,
1271  rVert.GetRelationOrient() ) );
1272  }
1273 
1274  const SwFormatHoriOrient& rHori = GetFormat()->GetHoriOrient();
1275  if ( !bAnchoredAsChar && nXPosDiff != 0 )
1276  {
1277  aSet.Put( SwFormatHoriOrient( rHori.GetPos()+nXPosDiff,
1279  rHori.GetRelationOrient() ) );
1280  }
1281 
1282  if ( nYPosDiff ||
1283  ( !bAnchoredAsChar && nXPosDiff != 0 ) )
1284  {
1285  GetFormat()->GetDoc()->SetFlyFrameAttr( *(GetFormat()), aSet );
1286  // keep new object rectangle, to avoid multiple
1287  // changes of the attributes by multiple event from
1288  // the drawing layer - e.g. group objects and its members
1289  // #i34748# - use new method
1290  // <SwAnchoredDrawObject::SetLastObjRect(..)>.
1291  const_cast<SwAnchoredDrawObject*>(pAnchoredDrawObj)
1292  ->SetLastObjRect( aObjRect.SVRect() );
1293  }
1294  else if ( aObjRect.SSize() != aOldObjRect.GetSize() )
1295  {
1296  InvalidateObjs_();
1297  // #i35007# - notify anchor frame
1298  // of as-character anchored object
1299  if ( bAnchoredAsChar )
1300  {
1301  SwFrame* pAnchorFrame = const_cast<SwAnchoredDrawObject*>(pAnchoredDrawObj)->AnchorFrame();
1302  if(pAnchorFrame)
1303  {
1304  pAnchorFrame->Prepare( PREP_FLY_ATTR_CHG, GetFormat() );
1305  }
1306  }
1307 
1309  }
1310  else if (eType == SdrUserCallType::Resize)
1311  // Even if the bounding box of the shape didn't change,
1312  // notify about the size change, as an adjustment change
1313  // may affect the size of the underlying textbox.
1315  }
1316  }
1317  break;
1318  case SdrUserCallType::ChangeAttr:
1319  if ( bNotify )
1320  {
1321  lcl_NotifyBackgroundOfObj( *this, rObj, pOldBoundRect );
1322  }
1323  break;
1324  default:
1325  break;
1326  }
1327 }
1328 
1329 namespace
1330 {
1331  const SwFormatAnchor* lcl_getAnchorFormat( const SfxPoolItem& _rItem )
1332  {
1333  sal_uInt16 nWhich = _rItem.Which();
1334  const SwFormatAnchor* pAnchorFormat = nullptr;
1335  if ( RES_ATTRSET_CHG == nWhich )
1336  {
1337  static_cast<const SwAttrSetChg&>(_rItem).GetChgSet()->
1338  GetItemState( RES_ANCHOR, false, reinterpret_cast<const SfxPoolItem**>(&pAnchorFormat) );
1339  }
1340  else if ( RES_ANCHOR == nWhich )
1341  {
1342  pAnchorFormat = &static_cast<const SwFormatAnchor&>(_rItem);
1343  }
1344  return pAnchorFormat;
1345  }
1346 }
1347 
1348 void SwDrawContact::SwClientNotify(const SwModify& rMod, const SfxHint& rHint)
1349 {
1350  SwClient::SwClientNotify(rMod, rHint); // needed as SwContact::SwClientNotify doesn't explicitly call SwClient::SwClientNotify
1351  SwContact::SwClientNotify(rMod, rHint);
1352  if (auto pLegacyHint = dynamic_cast<const sw::LegacyModifyHint*>(&rHint))
1353  {
1354  SAL_WARN_IF(mbDisconnectInProgress, "sw.core", "<SwDrawContact::Modify(..)> called during disconnection.");
1355 
1356  const SfxPoolItem* pNew = pLegacyHint->m_pNew;
1357  sal_uInt16 nWhich = pNew ? pNew->Which() : 0;
1358  if(const SwFormatAnchor* pNewAnchorFormat = pNew ? lcl_getAnchorFormat(*pNew) : nullptr)
1359  {
1360  // Do not respond to a Reset Anchor!
1361  if(GetFormat()->GetAttrSet().GetItemState(RES_ANCHOR, false) == SfxItemState::SET)
1362  {
1363  // no connect to layout during disconnection
1365  {
1366  // determine old object rectangle of 'master' drawing object
1367  // for notification
1368  const tools::Rectangle* pOldRect = nullptr;
1369  tools::Rectangle aOldRect;
1370  if(GetAnchorFrame())
1371  {
1372  // --> #i36181# - include spacing in object
1373  // rectangle for notification.
1375  pOldRect = &aOldRect;
1376  }
1377  // re-connect to layout due to anchor format change
1378  ConnectToLayout(pNewAnchorFormat);
1379  // notify background of drawing objects
1380  lcl_NotifyBackgroundOfObj(*this, *GetMaster(), pOldRect);
1381  NotifyBackgrdOfAllVirtObjs(pOldRect);
1382 
1383  const SwFormatAnchor* pOldAnchorFormat = pLegacyHint->m_pOld ? lcl_getAnchorFormat(*pLegacyHint->m_pOld) : nullptr;
1384  if(!pOldAnchorFormat || (pOldAnchorFormat->GetAnchorId() != pNewAnchorFormat->GetAnchorId()))
1385  {
1387  {
1388  // --> #i102752#
1389  // assure that a ShapePropertyChangeNotifier exists
1391  }
1392  else
1393  SAL_WARN("sw.core", "SwDrawContact::Modify: no draw object here?");
1394  }
1395  }
1396  }
1397  else
1399  }
1400  else if (nWhich == RES_REMOVE_UNO_OBJECT)
1401  {} // nothing to do
1402  // --> #i62875# - no further notification, if not connected to Writer layout
1403  else if ( maAnchoredDrawObj.GetAnchorFrame() &&
1405  {
1406  bool bUpdateSortedObjsList(false);
1407  switch(nWhich)
1408  {
1409  case RES_UL_SPACE:
1410  case RES_LR_SPACE:
1411  case RES_HORI_ORIENT:
1412  case RES_VERT_ORIENT:
1413  case RES_FOLLOW_TEXT_FLOW: // #i28701# - add attribute 'Follow text flow'
1414  break;
1415  case RES_SURROUND:
1416  case RES_OPAQUE:
1418  // --> #i28701# - on change of wrapping style, hell|heaven layer,
1419  // or wrapping style influence an update of the <SwSortedObjs> list,
1420  // the drawing object is registered in, has to be performed. This is triggered
1421  // by the 1st parameter of method call <InvalidateObjs_(..)>.
1422  bUpdateSortedObjsList = true;
1423  break;
1424  case RES_ATTRSET_CHG: // #i35443#
1425  {
1426  auto pChgSet = static_cast<const SwAttrSetChg*>(pNew)->GetChgSet();
1427  if(pChgSet->GetItemState(RES_SURROUND, false) == SfxItemState::SET ||
1428  pChgSet->GetItemState(RES_OPAQUE, false) == SfxItemState::SET ||
1429  pChgSet->GetItemState(RES_WRAP_INFLUENCE_ON_OBJPOS, false) == SfxItemState::SET)
1430  bUpdateSortedObjsList = true;
1431  }
1432  break;
1433  default:
1434  assert(!"<SwDraw Contact::Modify(..)> - unhandled attribute?");
1435  }
1436  lcl_NotifyBackgroundOfObj(*this, *GetMaster(), nullptr);
1437  NotifyBackgrdOfAllVirtObjs(nullptr);
1438  InvalidateObjs_(bUpdateSortedObjsList);
1439  }
1440 
1441  // #i51474#
1443  }
1444  else if (auto pDrawFrameFormatHint = dynamic_cast<const sw::DrawFrameFormatHint*>(&rHint))
1445  {
1446  switch(pDrawFrameFormatHint->m_eId)
1447  {
1449  delete this;
1450  break;
1453  break;
1456  // #i40845# - follow-up of #i35635#
1457  // move object to visible layer
1459  break;
1462  break;
1466  break;
1468  ConnectToLayout();
1469  break;
1472  break;
1473  default:
1474  ;
1475  }
1476  }
1477  else if (auto pCheckDrawFrameFormatLayerHint = dynamic_cast<const sw::CheckDrawFrameFormatLayerHint*>(&rHint))
1478  {
1479  *(pCheckDrawFrameFormatLayerHint->m_bCheckControlLayer) |= (GetMaster() && CheckControlLayer(GetMaster()));
1480  }
1481  else if (auto pContactChangedHint = dynamic_cast<const sw::ContactChangedHint*>(&rHint))
1482  {
1483  if(!*pContactChangedHint->m_ppObject)
1484  *pContactChangedHint->m_ppObject = GetMaster();
1485  auto pObject = *pContactChangedHint->m_ppObject;
1486  Changed(*pObject, SdrUserCallType::Delete, pObject->GetLastBoundRect());
1487  }
1488  else if (auto pDrawFormatLayoutCopyHint = dynamic_cast<const sw::DrawFormatLayoutCopyHint*>(&rHint))
1489  {
1490  const SwDrawFrameFormat& rFormat = static_cast<const SwDrawFrameFormat&>(rMod);
1491  new SwDrawContact(
1492  &pDrawFormatLayoutCopyHint->m_rDestFormat,
1493  pDrawFormatLayoutCopyHint->m_rDestDoc.CloneSdrObj(
1494  *GetMaster(),
1495  pDrawFormatLayoutCopyHint->m_rDestDoc.IsCopyIsMove() && &pDrawFormatLayoutCopyHint->m_rDestDoc == rFormat.GetDoc()));
1496  // #i49730# - notify draw frame format that position attributes are
1497  // already set, if the position attributes are already set at the
1498  // source draw frame format.
1499  if(rFormat.IsPosAttrSet())
1500  pDrawFormatLayoutCopyHint->m_rDestFormat.PosAttrSet();
1501  }
1502  else if (auto pRestoreFlyAnchorHint = dynamic_cast<const sw::RestoreFlyAnchorHint*>(&rHint))
1503  {
1504  SdrObject* pObj = GetMaster();
1505  if(GetAnchorFrame() && !pObj->IsInserted())
1506  {
1507  auto pDrawModel = const_cast<SwDrawFrameFormat&>(static_cast<const SwDrawFrameFormat&>(rMod)).GetDoc()->getIDocumentDrawModelAccess().GetDrawModel();
1508  assert(pDrawModel);
1509  pDrawModel->GetPage(0)->InsertObject(pObj);
1510  }
1511  pObj->SetRelativePos(pRestoreFlyAnchorHint->m_aPos);
1512  }
1513  else if (auto pCreatePortionHint = dynamic_cast<const sw::CreatePortionHint*>(&rHint))
1514  {
1515  if(*pCreatePortionHint->m_ppContact)
1516  return;
1517  *pCreatePortionHint->m_ppContact = this; // This is kind of ridiculous: the FrameFormat doesn't even hold a pointer to the contact itself, but here we are leaking it out randomly
1518  if(!GetAnchorFrame())
1519  {
1520  // No direct positioning needed any more
1521  ConnectToLayout();
1522  // Move object to visible layer
1524  }
1525  }
1526  else if (auto pCollectTextObjectsHint = dynamic_cast<const sw::CollectTextObjectsHint*>(&rHint))
1527  {
1528  auto pSdrO = GetMaster();
1529  if(!pSdrO)
1530  return;
1531  if(dynamic_cast<const SdrObjGroup*>(pSdrO))
1532  {
1533  SdrObjListIter aListIter(*pSdrO, SdrIterMode::DeepNoGroups);
1534  //iterate inside of a grouped object
1535  while(aListIter.IsMore())
1536  {
1537  SdrObject* pSdrOElement = aListIter.Next();
1538  auto pTextObj = const_cast<SdrTextObj*>(dynamic_cast<const SdrTextObj*>(pSdrOElement));
1539  if(pTextObj && pTextObj->HasText())
1540  pCollectTextObjectsHint->m_rTextObjects.push_back(pTextObj);
1541  }
1542  }
1543  else if(auto pTextObj = const_cast<SdrTextObj*>(dynamic_cast<const SdrTextObj*>(pSdrO)))
1544  {
1545  if(pTextObj->HasText())
1546  pCollectTextObjectsHint->m_rTextObjects.push_back(pTextObj);
1547  }
1548  }
1549  else if (auto pGetZOrdnerHint = dynamic_cast<const sw::GetZOrderHint*>(&rHint))
1550  {
1551  auto pFormat(dynamic_cast<const SwFrameFormat*>(&rMod));
1552  if(pFormat->Which() == RES_DRAWFRMFMT)
1553  pGetZOrdnerHint->m_rnZOrder = GetMaster()->GetOrdNum();
1554  }
1555  else if (auto pConnectedHint = dynamic_cast<const sw::GetObjectConnectedHint*>(&rHint))
1556  {
1557  pConnectedHint->m_risConnected |= (GetAnchorFrame() != nullptr);
1558  }
1559 }
1560 
1561 // #i26791#
1562 // #i28701# - added parameter <_bUpdateSortedObjsList>
1563 void SwDrawContact::InvalidateObjs_( const bool _bUpdateSortedObjsList )
1564 {
1565  for(const auto& rpDrawVirtObj : maDrawVirtObjs)
1566  // invalidate position of existing 'virtual' drawing objects
1567  {
1568  SwDrawVirtObj* pDrawVirtObj(rpDrawVirtObj.get());
1569  // #i33313# - invalidation only for connected
1570  // 'virtual' drawing objects
1571  if ( pDrawVirtObj->IsConnected() )
1572  {
1573  pDrawVirtObj->AnchoredObj().InvalidateObjPos();
1574  // #i28701#
1575  if ( _bUpdateSortedObjsList )
1576  {
1577  pDrawVirtObj->AnchoredObj().UpdateObjInSortedList();
1578  }
1579  }
1580  }
1581 
1582  // invalidate position of 'master' drawing object
1583  SwAnchoredObject* pAnchoredObj = GetAnchoredObj( nullptr );
1584  pAnchoredObj->InvalidateObjPos();
1585  // #i28701#
1586  if ( _bUpdateSortedObjsList )
1587  {
1588  pAnchoredObj->UpdateObjInSortedList();
1589  }
1590 }
1591 
1592 void SwDrawContact::DisconnectFromLayout( bool _bMoveMasterToInvisibleLayer )
1593 {
1594  mbDisconnectInProgress = true;
1595 
1596  // --> #i36181# - notify background of drawing object
1597  if ( _bMoveMasterToInvisibleLayer &&
1598  !(GetFormat()->GetDoc()->IsInDtor()) &&
1599  GetAnchorFrame() && !GetAnchorFrame()->IsInDtor() )
1600  {
1602  lcl_NotifyBackgroundOfObj( *this, *GetMaster(), &aOldRect );
1603  NotifyBackgrdOfAllVirtObjs( &aOldRect );
1604  }
1605 
1606  // remove 'virtual' drawing objects from writer
1607  // layout and from drawing page
1608  for(auto& rpVirtDrawObj : maDrawVirtObjs)
1609  {
1610  rpVirtDrawObj->RemoveFromWriterLayout();
1611  rpVirtDrawObj->RemoveFromDrawingPage();
1612  }
1613 
1615  {
1617  }
1618 
1619  if ( _bMoveMasterToInvisibleLayer && GetMaster() && GetMaster()->IsInserted() )
1620  {
1621  SdrViewIter aIter( GetMaster() );
1622  for( SdrView* pView = aIter.FirstView(); pView;
1623  pView = aIter.NextView() )
1624  {
1625  pView->MarkObj( GetMaster(), pView->GetSdrPageView(), true );
1626  }
1627 
1628  // Instead of removing 'master' object from drawing page, move the
1629  // 'master' drawing object into the corresponding invisible layer.
1630  {
1631  //static_cast<SwFrameFormat*>(GetRegisteredIn())->getIDocumentDrawModelAccess()->GetDrawModel()->GetPage(0)->
1632  // RemoveObject( GetMaster()->GetOrdNum() );
1633  // #i18447# - in order to consider group object correct
1634  // use new method <SwDrawContact::MoveObjToInvisibleLayer(..)>
1636  }
1637  }
1638 
1639  mbDisconnectInProgress = false;
1640 }
1641 
1644 {
1645  if ( GetMaster() )
1646  {
1647  GetMaster()->SetUserCall( nullptr );
1648  if ( GetMaster()->IsInserted() )
1649  {
1650  static_cast<SwFrameFormat*>(GetRegisteredIn())->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0)->
1651  RemoveObject( GetMaster()->GetOrdNum() );
1652  }
1653  }
1654 }
1655 
1656 // disconnect for a dedicated drawing object - could be 'master' or 'virtual'.
1657 // a 'master' drawing object will disconnect a 'virtual' drawing object
1658 // in order to take its place.
1659 // #i19919# - no special case, if drawing object isn't in
1660 // page header/footer, in order to get drawing objects in repeating table headers
1661 // also working.
1663 {
1664  if ( dynamic_cast<const SwDrawVirtObj*>( _pDrawObj) != nullptr )
1665  {
1666  SwDrawVirtObj* pDrawVirtObj = static_cast<SwDrawVirtObj*>(_pDrawObj);
1667  pDrawVirtObj->RemoveFromWriterLayout();
1668  pDrawVirtObj->RemoveFromDrawingPage();
1669  }
1670  else
1671  {
1672  const auto ppVirtDrawObj(std::find_if(maDrawVirtObjs.begin(), maDrawVirtObjs.end(),
1673  [] (const SwDrawVirtObjPtr& pObj) { return pObj->IsConnected(); }));
1674 
1675  if(ppVirtDrawObj != maDrawVirtObjs.end())
1676  {
1677  // replace found 'virtual' drawing object by 'master' drawing
1678  // object and disconnect the 'virtual' one
1679  SwDrawVirtObj* pDrawVirtObj(ppVirtDrawObj->get());
1680  SwFrame* pNewAnchorFrameOfMaster = pDrawVirtObj->AnchorFrame();
1681  // disconnect 'virtual' drawing object
1682  pDrawVirtObj->RemoveFromWriterLayout();
1683  pDrawVirtObj->RemoveFromDrawingPage();
1684  // disconnect 'master' drawing object from current frame
1686  // re-connect 'master' drawing object to frame of found 'virtual'
1687  // drawing object.
1688  pNewAnchorFrameOfMaster->AppendDrawObj( maAnchoredDrawObj );
1689  }
1690  else
1691  {
1692  // no connected 'virtual' drawing object found. Thus, disconnect
1693  // completely from layout.
1695  }
1696  }
1697 }
1698 
1699 static SwTextFrame* lcl_GetFlyInContentAnchor( SwTextFrame* _pProposedAnchorFrame,
1700  SwPosition const& rAnchorPos)
1701 {
1702  SwTextFrame* pAct = _pProposedAnchorFrame;
1703  SwTextFrame* pTmp;
1704  TextFrameIndex const nTextOffset(_pProposedAnchorFrame->MapModelToViewPos(rAnchorPos));
1705  do
1706  {
1707  pTmp = pAct;
1708  pAct = pTmp->GetFollow();
1709  }
1710  while (pAct && nTextOffset >= pAct->GetOfst());
1711  return pTmp;
1712 }
1713 
1715 {
1716  // *no* connect to layout during disconnection from layout.
1717  if ( mbDisconnectInProgress )
1718  {
1719  OSL_FAIL( "<SwDrawContact::ConnectToLayout(..)> called during disconnection.");
1720  return;
1721  }
1722 
1723  // --> #i33909# - *no* connect to layout, if 'master' drawing
1724  // object isn't inserted in the drawing page
1725  if ( !GetMaster()->IsInserted() )
1726  {
1727  OSL_FAIL( "<SwDrawContact::ConnectToLayout(..)> - master drawing object not inserted -> no connect to layout. Please inform od@openoffice.org" );
1728  return;
1729  }
1730 
1731  SwFrameFormat* pDrawFrameFormat = static_cast<SwFrameFormat*>(GetRegisteredIn());
1732 
1733  if( !pDrawFrameFormat->getIDocumentLayoutAccess().GetCurrentViewShell() )
1734  return;
1735 
1736  // remove 'virtual' drawing objects from writer
1737  // layout and from drawing page, and remove 'master' drawing object from
1738  // writer layout - 'master' object will remain in drawing page.
1739  DisconnectFromLayout( false );
1740 
1741  if ( !pAnch )
1742  {
1743  pAnch = &(pDrawFrameFormat->GetAnchor());
1744  }
1745 
1746  switch ( pAnch->GetAnchorId() )
1747  {
1748  case RndStdIds::FLY_AT_PAGE:
1749  {
1750  sal_uInt16 nPgNum = pAnch->GetPageNum();
1751  SwViewShell *pShell = pDrawFrameFormat->getIDocumentLayoutAccess().GetCurrentViewShell();
1752  if( !pShell )
1753  break;
1754  SwRootFrame* pRoot = pShell->GetLayout();
1755  SwPageFrame *pPage = static_cast<SwPageFrame*>(pRoot->Lower());
1756 
1757  for ( sal_uInt16 i = 1; i < nPgNum && pPage; ++i )
1758  {
1759  pPage = static_cast<SwPageFrame*>(pPage->GetNext());
1760  }
1761 
1762  if ( pPage )
1763  {
1764  pPage->AppendDrawObj( maAnchoredDrawObj );
1765  }
1766  else
1767  //Looks stupid but is allowed (compare SwFEShell::SetPageObjsNewPage)
1768  pRoot->SetAssertFlyPages();
1769  }
1770  break;
1771 
1772  case RndStdIds::FLY_AT_CHAR:
1773  case RndStdIds::FLY_AT_PARA:
1774  case RndStdIds::FLY_AT_FLY:
1775  case RndStdIds::FLY_AS_CHAR:
1776  {
1777  if ( pAnch->GetAnchorId() == RndStdIds::FLY_AS_CHAR )
1778  {
1780  }
1781  // support drawing objects in header/footer,
1782  // but not control objects:
1783  // anchor at first found frame the 'master' object and
1784  // at the following frames 'virtual' drawing objects.
1785  // Note: method is similar to <SwFlyFrameFormat::MakeFrames(..)>
1786  SwModify *pModify = nullptr;
1787  if( pAnch->GetContentAnchor() )
1788  {
1789  if ( pAnch->GetAnchorId() == RndStdIds::FLY_AT_FLY )
1790  {
1791  SwNodeIndex aIdx( pAnch->GetContentAnchor()->nNode );
1792  SwContentNode* pCNd = pDrawFrameFormat->GetDoc()->GetNodes().GoNext( &aIdx );
1794  pModify = pCNd;
1795  else
1796  {
1797  const SwNodeIndex& rIdx = pAnch->GetContentAnchor()->nNode;
1798  SwFrameFormats& rFormats = *(pDrawFrameFormat->GetDoc()->GetSpzFrameFormats());
1799  for( auto pFlyFormat : rFormats )
1800  {
1801  if( pFlyFormat->GetContent().GetContentIdx() &&
1802  rIdx == *(pFlyFormat->GetContent().GetContentIdx()) )
1803  {
1804  pModify = pFlyFormat;
1805  break;
1806  }
1807  }
1808  }
1809  }
1810  else
1811  {
1812  pModify = pAnch->GetContentAnchor()->nNode.GetNode().GetContentNode();
1813  }
1814  }
1815 
1816  // #i29199# - It is possible, that
1817  // the anchor doesn't exist - E.g., reordering the
1818  // sub-documents in a master document.
1819  // Note: The anchor will be inserted later.
1820  if ( !pModify )
1821  {
1822  // break to end of the current switch case.
1823  break;
1824  }
1825 
1827  SwFrame* pAnchorFrameOfMaster = nullptr;
1828  for( SwFrame *pFrame = aIter.First(); pFrame; pFrame = aIter.Next() )
1829  {
1830  // append drawing object, if
1831  // (1) proposed anchor frame isn't a follow and
1832  // (2) drawing object isn't a control object to be anchored
1833  // in header/footer.
1834  bool bAdd = ( !pFrame->IsContentFrame() ||
1835  !static_cast<SwContentFrame*>(pFrame)->IsFollow() ) &&
1836  ( !::CheckControlLayer( GetMaster() ) ||
1837  !pFrame->FindFooterOrHeader() );
1838 
1839  if (bAdd && RndStdIds::FLY_AT_FLY != pAnch->GetAnchorId())
1840  {
1841  assert(pFrame->IsTextFrame());
1842  bAdd = IsAnchoredObjShown(*static_cast<SwTextFrame*>(pFrame), *pAnch);
1843  }
1844 
1845  if( bAdd )
1846  {
1847  if ( RndStdIds::FLY_AT_FLY == pAnch->GetAnchorId() && !pFrame->IsFlyFrame() )
1848  {
1849  pFrame = pFrame->FindFlyFrame();
1850  assert(pFrame);
1851  }
1852 
1853  // find correct follow for as character anchored objects
1854  if ((pAnch->GetAnchorId() == RndStdIds::FLY_AS_CHAR) &&
1855  pFrame->IsTextFrame() )
1856  {
1857  pFrame = lcl_GetFlyInContentAnchor(
1858  static_cast<SwTextFrame*>(pFrame),
1859  *pAnch->GetContentAnchor());
1860  }
1861 
1862  if ( !pAnchorFrameOfMaster )
1863  {
1864  // append 'master' drawing object
1865  pAnchorFrameOfMaster = pFrame;
1866  pFrame->AppendDrawObj( maAnchoredDrawObj );
1867  }
1868  else
1869  {
1870  // append 'virtual' drawing object
1871  SwDrawVirtObj* pDrawVirtObj = AddVirtObj();
1872  if ( pAnch->GetAnchorId() == RndStdIds::FLY_AS_CHAR )
1873  {
1874  ClrContourCache( pDrawVirtObj );
1875  }
1876  pFrame->AppendDrawObj( pDrawVirtObj->AnchoredObj() );
1877 
1878  pDrawVirtObj->ActionChanged();
1879  }
1880 
1881  if ( pAnch->GetAnchorId() == RndStdIds::FLY_AS_CHAR )
1882  {
1883  pFrame->InvalidatePrt();
1884  }
1885  }
1886  }
1887  }
1888  break;
1889  default:
1890  assert(!"Unknown Anchor.");
1891  break;
1892  }
1893  if ( GetAnchorFrame() )
1894  {
1896  // #i26791# - invalidate objects instead of direct positioning
1897  InvalidateObjs_();
1898  }
1899 }
1900 
1903 {
1904  if ( !GetMaster()->IsInserted() )
1905  {
1907  ->InsertObject( GetMaster(), GetMaster()->GetOrdNumDirect() );
1908  }
1909  GetMaster()->SetUserCall( this );
1910 }
1911 
1913 {
1914  // --> #i28701# - use method <GetPageFrame()>
1915  SwPageFrame* pPg = GetPageFrame();
1916  if ( !pPg && GetAnchorFrame() )
1917  pPg = GetAnchorFrame()->FindPageFrame();
1918  if ( pPg )
1919  pPg = const_cast<SwPageFrame*>(static_cast<const SwPageFrame*>(::FindPage( rRect, pPg )));
1920  return pPg;
1921 }
1922 
1924 {
1925  if ( mbDisconnectInProgress )
1926  {
1927  OSL_FAIL( "<SwDrawContact::ChkPage()> called during disconnection." );
1928  return;
1929  }
1930 
1931  // --> #i28701#
1934  ? GetPageFrame()
1935  : FindPage( GetMaster()->GetCurrentBoundRect() );
1936  if ( GetPageFrame() != pPg )
1937  {
1938  // if drawing object is anchor in header/footer a change of the page
1939  // is a dramatic change. Thus, completely re-connect to the layout
1942  {
1943  ConnectToLayout();
1944  }
1945  else
1946  {
1947  // --> #i28701# - use methods <GetPageFrame()> and <SetPageFrame>
1948  if ( GetPageFrame() )
1952  }
1953  }
1954 }
1955 
1956 // Important note:
1957 // method is called by method <SwDPage::ReplaceObject(..)>, which called its
1958 // corresponding superclass method <FmFormPage::ReplaceObject(..)>.
1959 // Note: 'master' drawing object *has* to be connected to layout triggered
1960 // by the caller of this, if method is called.
1962 {
1963  DisconnectFromLayout( false );
1964  // consider 'virtual' drawing objects
1966 
1967  GetMaster()->SetUserCall( nullptr );
1968  if(pNewMaster)
1969  maAnchoredDrawObj.SetDrawObj(*pNewMaster);
1970  else
1971  mbMasterObjCleared = true;
1972  GetMaster()->SetUserCall( this );
1973 
1974  InvalidateObjs_();
1975 }
1976 
1978 void SwDrawContact::GetAnchoredObjs(std::vector<SwAnchoredObject*>& o_rAnchoredObjs) const
1979 {
1980  o_rAnchoredObjs.push_back(const_cast<SwAnchoredDrawObject*>(&maAnchoredDrawObj));
1981 
1982  for(auto& rpDrawVirtObj : maDrawVirtObjs)
1983  o_rAnchoredObjs.push_back(&rpDrawVirtObj->AnchoredObj());
1984 }
1985 
1986 // AW: own sdr::contact::ViewContact (VC) sdr::contact::ViewObjectContact (VOC) needed
1987 // since offset is defined different from SdrVirtObj's sdr::contact::ViewContactOfVirtObj.
1988 // For paint, that offset is used by setting at the OutputDevice; for primitives this is
1989 // not possible since we have no OutputDevice, but define the geometry itself.
1990 
1991 namespace sdr
1992 {
1993  namespace contact
1994  {
1996  {
1997  protected:
2007 
2008  public:
2009  VOCOfDrawVirtObj(ObjectContact& rObjectContact, ViewContact& rViewContact)
2010  : ViewObjectContactOfSdrObj(rObjectContact, rViewContact)
2011  {
2012  }
2013  };
2014 
2016  {
2017  protected:
2023  virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact) override;
2024 
2025  public:
2028  : ViewContactOfVirtObj(rObj)
2029  {
2030  }
2031 
2034  {
2035  return static_cast<SwDrawVirtObj&>(mrObject);
2036  }
2037  };
2038  } // end of namespace contact
2039 } // end of namespace sdr
2040 
2041 namespace sdr
2042 {
2043  namespace contact
2044  {
2046  static void impAddPrimitivesFromGroup(const ViewObjectContact& rVOC, const basegfx::B2DHomMatrix& rOffsetMatrix, const DisplayInfo& rDisplayInfo, drawinglayer::primitive2d::Primitive2DContainer& rxTarget)
2047  {
2048  const sal_uInt32 nSubHierarchyCount(rVOC.GetViewContact().GetObjectCount());
2049 
2050  for(sal_uInt32 a(0); a < nSubHierarchyCount; a++)
2051  {
2053 
2054  if(rCandidate.GetViewContact().GetObjectCount())
2055  {
2056  // is a group object itself, call recursively
2057  impAddPrimitivesFromGroup(rCandidate, rOffsetMatrix, rDisplayInfo, rxTarget);
2058  }
2059  else
2060  {
2061  // single object, add primitives; check model-view visibility
2062  if(rCandidate.isPrimitiveVisible(rDisplayInfo))
2063  {
2064  drawinglayer::primitive2d::Primitive2DContainer aNewSequence(rCandidate.getPrimitive2DSequence(rDisplayInfo));
2065 
2066  if(!aNewSequence.empty())
2067  {
2068  // get ranges
2069  const drawinglayer::geometry::ViewInformation2D& rViewInformation2D(rCandidate.GetObjectContact().getViewInformation2D());
2070  const basegfx::B2DRange aViewRange(rViewInformation2D.getViewport());
2071  basegfx::B2DRange aObjectRange(rCandidate.getObjectRange());
2072 
2073  // correct with virtual object's offset
2074  aObjectRange.transform(rOffsetMatrix);
2075 
2076  // check geometrical visibility (with offset)
2077  if(!aViewRange.overlaps(aObjectRange))
2078  {
2079  // not visible, release
2080  aNewSequence.clear();
2081  }
2082  }
2083 
2084  if(!aNewSequence.empty())
2085  {
2086  rxTarget.append(aNewSequence);
2087  }
2088  }
2089  }
2090  }
2091  }
2092 
2094  {
2095  // tdf#91260 have already checked top-level one is on the right page
2096  assert(isPrimitiveVisible(rDisplayInfo));
2097  // nasty corner case: override to clear page frame to disable the
2098  // sub-objects' anchor check, because their anchor is always on
2099  // the first page that the page style is applied to
2100  DisplayInfo aDisplayInfo(rDisplayInfo);
2101  aDisplayInfo.SetWriterPageFrame(basegfx::B2IRectangle());
2102  const VCOfDrawVirtObj& rVC = static_cast< const VCOfDrawVirtObj& >(GetViewContact());
2103  const SdrObject& rReferencedObject = rVC.GetSwDrawVirtObj().GetReferencedObj();
2105 
2106  // create offset transformation
2107  basegfx::B2DHomMatrix aOffsetMatrix;
2108  const Point aLocalOffset(rVC.GetSwDrawVirtObj().GetOffset());
2109 
2110  if(aLocalOffset.X() || aLocalOffset.Y())
2111  {
2112  aOffsetMatrix.set(0, 2, aLocalOffset.X());
2113  aOffsetMatrix.set(1, 2, aLocalOffset.Y());
2114  }
2115 
2116  if(dynamic_cast<const SdrObjGroup*>( &rReferencedObject) != nullptr)
2117  {
2118  // group object. Since the VOC/OC/VC hierarchy does not represent the
2119  // hierarchy virtual objects when they have group objects
2120  // (ViewContactOfVirtObj::GetObjectCount() returns null for that purpose)
2121  // to avoid multiple usages of VOCs (which would not work), the primitives
2122  // for the sub-hierarchy need to be collected here
2123 
2124  // Get the VOC of the referenced object (the Group) and fetch primitives from it
2125  const ViewObjectContact& rVOCOfRefObj = rReferencedObject.GetViewContact().GetViewObjectContact(GetObjectContact());
2126  impAddPrimitivesFromGroup(rVOCOfRefObj, aOffsetMatrix, aDisplayInfo, xRetval);
2127  }
2128  else
2129  {
2130  // single object, use method from referenced object to get the Primitive2DSequence
2131  xRetval = rReferencedObject.GetViewContact().getViewIndependentPrimitive2DContainer();
2132  }
2133 
2134  if(!xRetval.empty())
2135  {
2136  // create transform primitive
2138  xRetval = drawinglayer::primitive2d::Primitive2DContainer { xReference };
2139  }
2140 
2141  return xRetval;
2142  }
2143 
2145  {
2146  return *(new VOCOfDrawVirtObj(rObjectContact, *this));
2147  }
2148 
2149  } // end of namespace contact
2150 } // end of namespace sdr
2151 
2153 std::unique_ptr<sdr::contact::ViewContact> SwDrawVirtObj::CreateObjectSpecificViewContact()
2154 {
2155  return std::make_unique<sdr::contact::VCOfDrawVirtObj>(*this);
2156 }
2157 
2159  SdrModel& rSdrModel,
2160  SdrObject& _rNewObj,
2161  SwDrawContact& _rDrawContact)
2162 : SdrVirtObj(rSdrModel, _rNewObj ),
2163  maAnchoredDrawObj(),
2164  mrDrawContact(_rDrawContact)
2165 {
2166  // #i26791#
2167  maAnchoredDrawObj.SetDrawObj( *this );
2168 
2169  // #i35635# - set initial position out of sight
2170  NbcMove( Size( -16000, -16000 ) );
2171 }
2172 
2174 {
2175 }
2176 
2178 {
2179  SdrVirtObj::operator=(rObj);
2180  // Note: Members <maAnchoredDrawObj> and <mrDrawContact>
2181  // haven't to be considered.
2182  return *this;
2183 }
2184 
2186 {
2187  SwDrawVirtObj* pObj = new SwDrawVirtObj(
2188  rTargetModel,
2189  rRefObj,
2190  mrDrawContact);
2191 
2192  pObj->operator=( *this );
2193  // Note: Member <maAnchoredDrawObj> hasn't to be considered.
2194 
2195  return pObj;
2196 }
2197 
2199 {
2200  // #i26791# - use new member <maAnchoredDrawObj>
2202 }
2203 
2205 {
2206  // #i26791# - use new member <maAnchoredDrawObj>
2207  return maAnchoredDrawObj.AnchorFrame();
2208 }
2209 
2211 {
2212  // remove contact object from frame for 'virtual' drawing object
2213  // #i26791# - use new member <maAnchoredDrawObj>
2215  {
2217  }
2218 }
2219 
2221 {
2222  // determine 'master'
2223  SdrObject* pOrgMasterSdrObj = mrDrawContact.GetMaster();
2224 
2225  // insert 'virtual' drawing object into page, set layer and user call.
2226  SdrPage* pDrawPg;
2227  // #i27030# - apply order number of referenced object
2228  if ( nullptr != ( pDrawPg = pOrgMasterSdrObj->getSdrPageFromSdrObject() ) )
2229  {
2230  // #i27030# - apply order number of referenced object
2231  pDrawPg->InsertObject( this, GetReferencedObj().GetOrdNum() );
2232  }
2233  else
2234  {
2235  pDrawPg = getSdrPageFromSdrObject();
2236  if ( pDrawPg )
2237  {
2238  pDrawPg->SetObjectOrdNum( GetOrdNumDirect(),
2240  }
2241  else
2242  {
2244  }
2245  }
2247 }
2248 
2250 {
2251  SetUserCall( nullptr );
2252  if ( getSdrPageFromSdrObject() )
2253  {
2255  }
2256 }
2257 
2260 {
2261  bool bRetVal = GetAnchorFrame() &&
2263 
2264  return bRetVal;
2265 }
2266 
2268 {
2270 }
2271 
2272 // #i97197#
2273 // the methods relevant for positioning
2274 
2276 {
2277  if(aOutRect.IsEmpty())
2278  {
2279  const_cast<SwDrawVirtObj*>(this)->RecalcBoundRect();
2280  }
2281 
2282  return aOutRect;
2283 }
2284 
2286 {
2287  return aOutRect;
2288 }
2289 
2291 {
2292  // do NOT use IsEmpty() here, there is already a useful offset
2293  // in the position
2294  if(aOutRect == tools::Rectangle())
2295  {
2296  return Point();
2297  }
2298  else
2299  {
2301  }
2302 }
2303 
2305 {
2306  // do nothing to not lose model information in aOutRect
2307 }
2308 
2310 {
2311  // #i26791# - switch order of calling <GetOffset()> and
2312  // <ReferencedObj().GetCurrentBoundRect()>, because <GetOffset()> calculates
2313  // its value by the 'BoundRect' of the referenced object.
2314 
2315  const Point aOffset(GetOffset());
2316  aOutRect = ReferencedObj().GetCurrentBoundRect() + aOffset;
2317 }
2318 
2320 {
2323 
2324  return aRetval;
2325 }
2326 
2328 {
2331 
2332  return aRetval;
2333 }
2334 
2336 {
2337  SdrHdlList tmpList(nullptr);
2338  rRefObj.AddToHdlList(tmpList);
2339 
2340  size_t cnt = tmpList.GetHdlCount();
2341  for(size_t i=0; i < cnt; ++i)
2342  {
2343  SdrHdl* pHdl = tmpList.GetHdl(i);
2344  Point aP(pHdl->GetPos() + GetOffset());
2345  pHdl->SetPos(aP);
2346  }
2347  tmpList.MoveTo(rHdlList);
2348 }
2349 
2350 void SwDrawVirtObj::NbcMove(const Size& rSiz)
2351 {
2352  SdrObject::NbcMove( rSiz );
2353 }
2354 
2355 void SwDrawVirtObj::NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact)
2356 {
2357  rRefObj.NbcResize(rRef - GetOffset(), xFact, yFact);
2358  SetRectsDirty();
2359 }
2360 
2361 void SwDrawVirtObj::NbcRotate(const Point& rRef, long nAngle, double sn, double cs)
2362 {
2363  rRefObj.NbcRotate(rRef - GetOffset(), nAngle, sn, cs);
2364  SetRectsDirty();
2365 }
2366 
2367 void SwDrawVirtObj::NbcMirror(const Point& rRef1, const Point& rRef2)
2368 {
2369  rRefObj.NbcMirror(rRef1 - GetOffset(), rRef2 - GetOffset());
2370  SetRectsDirty();
2371 }
2372 
2373 void SwDrawVirtObj::NbcShear(const Point& rRef, long nAngle, double tn, bool bVShear)
2374 {
2375  rRefObj.NbcShear(rRef - GetOffset(), nAngle, tn, bVShear);
2376  SetRectsDirty();
2377 }
2378 
2379 void SwDrawVirtObj::Move(const Size& rSiz)
2380 {
2381  SdrObject::Move( rSiz );
2382 }
2383 
2384 void SwDrawVirtObj::Resize(const Point& rRef, const Fraction& xFact, const Fraction& yFact, bool bUnsetRelative)
2385 {
2386  if(xFact.GetNumerator() != xFact.GetDenominator() || yFact.GetNumerator() != yFact.GetDenominator())
2387  {
2388  tools::Rectangle aBoundRect0; if(pUserCall) aBoundRect0 = GetLastBoundRect();
2389  rRefObj.Resize(rRef - GetOffset(), xFact, yFact, bUnsetRelative);
2390  SetRectsDirty();
2391  SendUserCall(SdrUserCallType::Resize, aBoundRect0);
2392  }
2393 }
2394 
2395 void SwDrawVirtObj::Rotate(const Point& rRef, long nAngle, double sn, double cs)
2396 {
2397  if(nAngle)
2398  {
2399  tools::Rectangle aBoundRect0; if(pUserCall) aBoundRect0 = GetLastBoundRect();
2400  rRefObj.Rotate(rRef - GetOffset(), nAngle, sn, cs);
2401  SetRectsDirty();
2402  SendUserCall(SdrUserCallType::Resize, aBoundRect0);
2403  }
2404 }
2405 
2406 void SwDrawVirtObj::Mirror(const Point& rRef1, const Point& rRef2)
2407 {
2408  tools::Rectangle aBoundRect0; if(pUserCall) aBoundRect0 = GetLastBoundRect();
2409  rRefObj.Mirror(rRef1 - GetOffset(), rRef2 - GetOffset());
2410  SetRectsDirty();
2411  SendUserCall(SdrUserCallType::Resize, aBoundRect0);
2412 }
2413 
2414 void SwDrawVirtObj::Shear(const Point& rRef, long nAngle, double tn, bool bVShear)
2415 {
2416  if(nAngle)
2417  {
2418  tools::Rectangle aBoundRect0; if(pUserCall) aBoundRect0 = GetLastBoundRect();
2419  rRefObj.Shear(rRef - GetOffset(), nAngle, tn, bVShear);
2420  SetRectsDirty();
2421  SendUserCall(SdrUserCallType::Resize, aBoundRect0);
2422  }
2423 }
2424 
2426 {
2428  aSnapRect += GetOffset();
2429 }
2430 
2432 {
2433  const_cast<SwDrawVirtObj*>(this)->aSnapRect = rRefObj.GetSnapRect();
2434  const_cast<SwDrawVirtObj*>(this)->aSnapRect += GetOffset();
2435 
2436  return aSnapRect;
2437 }
2438 
2440 {
2441  tools::Rectangle aBoundRect0; if(pUserCall) aBoundRect0 = GetLastBoundRect();
2442  tools::Rectangle aR(rRect);
2443  aR -= GetOffset();
2444  rRefObj.SetSnapRect(aR);
2445  SetRectsDirty();
2446  SendUserCall(SdrUserCallType::Resize, aBoundRect0);
2447 }
2448 
2450 {
2451  tools::Rectangle aR(rRect);
2452  aR -= GetOffset();
2453  SetRectsDirty();
2454  rRefObj.NbcSetSnapRect(aR);
2455 }
2456 
2458 {
2459  const_cast<SwDrawVirtObj*>(this)->aSnapRect = rRefObj.GetLogicRect();
2460  const_cast<SwDrawVirtObj*>(this)->aSnapRect += GetOffset();
2461 
2462  return aSnapRect;
2463 }
2464 
2466 {
2467  tools::Rectangle aBoundRect0; if(pUserCall) aBoundRect0 = GetLastBoundRect();
2468  tools::Rectangle aR(rRect);
2469  aR -= GetOffset();
2470  rRefObj.SetLogicRect(aR);
2471  SetRectsDirty();
2472  SendUserCall(SdrUserCallType::Resize, aBoundRect0);
2473 }
2474 
2476 {
2477  tools::Rectangle aR(rRect);
2478  aR -= GetOffset();
2480  SetRectsDirty();
2481 }
2482 
2484 {
2485  Point aP(rRefObj.GetSnapPoint(i));
2486  aP += GetOffset();
2487 
2488  return aP;
2489 }
2490 
2491 Point SwDrawVirtObj::GetPoint(sal_uInt32 i) const
2492 {
2493  return rRefObj.GetPoint(i) + GetOffset();
2494 }
2495 
2496 void SwDrawVirtObj::NbcSetPoint(const Point& rPnt, sal_uInt32 i)
2497 {
2498  Point aP(rPnt);
2499  aP -= GetOffset();
2500  rRefObj.SetPoint(aP, i);
2501  SetRectsDirty();
2502 }
2503 
2505 {
2506  return rRefObj.HasTextEdit();
2507 }
2508 
2509 // override 'layer' methods for 'virtual' drawing object to assure
2510 // that layer of 'virtual' object is the layer of the referenced object.
2512 {
2513  return GetReferencedObj().GetLayer();
2514 }
2515 
2517 {
2518  ReferencedObj().NbcSetLayer( nLayer );
2520 }
2521 
2523 {
2524  ReferencedObj().SetLayer( nLayer );
2526 }
2527 
2528 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Point TopLeft() const
void RemoveAllVirtObjs()
remove 'virtual' drawing objects and destroy them.
Definition: dcontact.cxx:820
SwFrame * FindFooterOrHeader()
Definition: findfrm.cxx:547
sal_uInt32 GetMaxOrdNum() const
get maximum order number of anchored objects handled by with contact
Definition: dcontact.cxx:371
virtual bool HasTextEdit() const
SwFrame * AnchorFrame()
Definition: dcontact.cxx:2204
virtual void MakeObjPos()=0
method to determine position for the object and set the position at the object
SwRect GetBoundRectOfAnchoredObj(const SdrObject *pObj)
returns the BoundRect inclusive distance of the object.
Definition: dcontact.cxx:153
sal_uInt32 GetOrdNumForNewRef(const SwFlyFrame *pFly)
Definition: dcontact.cxx:479
const SwVirtFlyDrawObj * GetVirtDrawObj() const
Definition: fly.cxx:2721
Base class for the following contact objects (frame + draw objects).
Definition: dcontact.hxx:66
void ChangeMasterObject(SdrObject *pNewMaster)
Moves all SW-connections to new Master)
Definition: dcontact.cxx:1961
Base class of the Writer layout elements.
Definition: frame.hxx:295
virtual basegfx::B2DPolyPolygon TakeXorPoly() const
Represents the visualization of a paragraph.
Definition: txtfrm.hxx:149
SdrObject * GetDrawObjectByAnchorFrame(const SwFrame &_rAnchorFrame)
get drawing object ('master' or 'virtual') by frame.
Definition: dcontact.cxx:833
virtual SwRect GetObjRect() const =0
void SetWriterPageFrame(basegfx::B2IRectangle const &rPageFrame)
void InsertCnt()
Definition: fly.cxx:207
SwFlyDrawObjPtr mpMasterObj
Definition: dcontact.hxx:180
SwFlyDrawContact * GetOrCreateContact()
Definition: atrfrm.cxx:2851
SwDrawContact(const SwDrawContact &)=delete
void ChkPage()
Definition: dcontact.cxx:1923
bool IsFollow() const
Definition: flowfrm.hxx:166
WW8AnchorConv
Definition: frmfmt.hxx:294
const SwSortedObjs * GetDrawObjs() const
Definition: frame.hxx:543
SwAnchoredDrawObject maAnchoredDrawObj
anchored drawing object instance for the 'virtual' drawing object
Definition: dcontact.hxx:216
SdrObject & ReferencedObj()
Marks a position in the document model.
Definition: pam.hxx:35
class for the positioning of drawing objects
virtual const tools::Rectangle & GetCurrentBoundRect() const
tools::Rectangle aSnapRect
virtual void Resize(const Point &rRef, const Fraction &xFact, const Fraction &yFact, bool bUnsetRelative=true)
void SetPos(const Point &rPnt)
void set(sal_uInt16 nRow, sal_uInt16 nColumn, double fValue)
SwDrawContact * mpDrawContact
Definition: dcontact.cxx:997
virtual SwDrawVirtObj * CloneSdrObject(SdrModel &rTargetModel) const override
Definition: dcontact.cxx:2185
bool CheckControlLayer(const SdrObject *pObj)
Definition: dcontact.cxx:656
void InsertColumns()
Definition: fly.cxx:227
void SetPoint(const Point &rPnt, sal_uInt32 i)
#define RES_ATTRSET_CHG
Definition: hintids.hxx:287
SdrObjUserCall * pUserCall
void DisconnectFromLayout(bool _bMoveMasterToInvisibleLayer=true)
Definition: dcontact.cxx:1592
virtual const SwRootFrame * GetCurrentLayout() const =0
std::unique_ptr< SwDrawVirtObj, SdrObjectFreeOp > SwDrawVirtObjPtr
ContactObject for connection of formats as representatives of draw objects in SwClient and the object...
Definition: dcontact.hxx:302
#define RES_HORI_ORIENT
Definition: hintids.hxx:210
virtual void MoveObjToVisibleLayer(SdrObject *_pDrawObj) override
override methods to control Writer fly frames, which are linked, and to assure that all objects ancho...
Definition: dcontact.cxx:565
virtual void NbcResize(const Point &rRef, const Fraction &xFact, const Fraction &yFact)
const SwFormatVertOrient & GetVertOrient(bool=true) const
Definition: fmtornt.hxx:106
SwNodeIndex nNode
Definition: pam.hxx:37
virtual ~SwContact() override
Definition: dcontact.cxx:195
virtual SdrLayerID GetInvisibleControlsId() const =0
OBJ_TEXT
sal_uInt16 GetPageNum() const
Definition: fmtanchr.hxx:66
const SwFrame * FindPage(const SwRect &rRect, const SwFrame *pPage)
Definition: frmtool.cxx:3474
SwTwips GetPos() const
Definition: fmtornt.hxx:92
static void lcl_NotifyBackgroundOfObj(SwDrawContact const &_rDrawContact, const SdrObject &_rObj, const tools::Rectangle *_pOldObjRect)
local method to notify the background for a drawing object - #i26791#
Definition: dcontact.cxx:909
bool mbMasterObjCleared
boolean indicating set 'master' drawing object has been cleared.
Definition: dcontact.hxx:316
helper class for method for handling nested events ...
Definition: dcontact.cxx:994
#define RES_SURROUND
Definition: hintids.hxx:208
virtual SdrLayerID GetHeavenId() const =0
SdrUserCallType
bool IsAnchoredObjShown(SwTextFrame const &rFrame, SwFormatAnchor const &rAnchor)
Definition: frmtool.cxx:1264
void RemoveDrawObjFromPage(SwAnchoredObject &_rToRemoveObj)
Definition: flylay.cxx:1095
virtual ~SwDrawVirtObj() override
Definition: dcontact.cxx:2173
SdrObject * GetObj(size_t nNum) const
bool IsInserted() const
Definition: doc.hxx:185
SwContact(SwFrameFormat *pToRegisterIn)
For reader. Only the connection is created.
Definition: dcontact.cxx:190
virtual SdrLayerID GetControlsId() const =0
size_t GetObjCount() const
TElementType * Next()
Definition: calbck.hxx:373
SwDrawVirtObj(SdrModel &rSdrModel, SdrObject &_rNewObj, SwDrawContact &_rDrawContact)
Definition: dcontact.cxx:2158
virtual ~SwDrawContact() override
Definition: dcontact.cxx:710
virtual void AddToHdlList(SdrHdlList &rHdlList) const override
Definition: dcontact.cxx:2335
TextFrameIndex GetOfst() const
Definition: txtfrm.hxx:426
ViewObjectContact & GetViewObjectContact(ObjectContact &rObjectContact)
VCOfDrawVirtObj(SwDrawVirtObj &rObj)
basic constructor, used from SdrObject.
Definition: dcontact.cxx:2027
SwNode & GetNode() const
Definition: ndindex.hxx:119
void SwClientNotify(const SwModify &, const SfxHint &rHint) override
Definition: dcontact.cxx:640
bool IsPosAttrSet() const
Definition: frmfmt.hxx:397
long SwTwips
Definition: swtypes.hxx:49
virtual void Move(const Size &rSiz) override
Definition: dcontact.cxx:2379
void Pos(const Point &rNew)
Definition: swrect.hxx:167
SdrUserCallType meEventTypeOfCurrentUserCall
event type, which is handled for .
Definition: dcontact.hxx:327
virtual void NbcMove(const Size &rSiz) override
Definition: dcontact.cxx:2350
const Point & GetPos() const
virtual void SwClientNotify(const SwModify &, const SfxHint &rHint) override
Definition: calbck.cxx:108
virtual void AddToHdlList(SdrHdlList &rHdlList) const
Of course Writer needs its own rectangles.
Definition: swrect.hxx:34
#define RES_WRAP_INFLUENCE_ON_OBJPOS
Definition: hintids.hxx:232
Point GetRelPosToChar() const
method to determine position of anchored object relative to anchor character
static void Free(SdrObject *&_rpObject)
#define RES_REMOVE_UNO_OBJECT
Definition: hintids.hxx:305
virtual void InsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE)
SwDrawContact & mrDrawContact
writer-drawing contact object the 'virtual' drawing object is controlled by.
Definition: dcontact.hxx:221
void Notify_Background(const SdrObject *pObj, SwPageFrame *pPage, const SwRect &rRect, const PrepareHint eHint, const bool bInva)
Definition: frmtool.cxx:3134
void Chain(SwFrame *_pAnchor)
Definition: fly.cxx:176
The root element of a Writer document layout.
Definition: rootfrm.hxx:79
SwContact * GetUserCall(const SdrObject *pObj)
Returns the UserCall if applicable from the group object.
Definition: dcontact.cxx:170
virtual drawinglayer::primitive2d::Primitive2DContainer createPrimitive2DSequence(const DisplayInfo &rDisplayInfo) const override
This method is responsible for creating the graphical visualisation data which is stored/cached in th...
Definition: dcontact.cxx:2093
void DeleteCnt()
Definition: fly.cxx:318
virtual bool HasTextEdit() const override
Definition: dcontact.cxx:2504
const SwFrameFormats * GetSpzFrameFormats() const
Definition: doc.hxx:737
boost::optional< tools::Rectangle > const & GetLastObjRect() const
virtual void Rotate(const Point &rRef, long nAngle, double sn, double cs)
void MoveObjToLayer(const bool _bToVisible, SdrObject *_pDrawObj)
method to move object to visible/invisible layer
Definition: dcontact.cxx:261
sdr::contact::ViewContact & GetViewContact() const
void DrawContactDeleted()
Definition: dcontact.cxx:1021
SdrTextAniKind
drawinglayer::primitive2d::Primitive2DContainer const & getPrimitive2DSequence(const DisplayInfo &rDisplayInfo) const
virtual Point GetOffset() const override
access to offset
Definition: dcontact.cxx:2290
SwDrawVirtObj * AddVirtObj()
add a 'virtual' drawing object to drawing page.
Definition: dcontact.cxx:807
IDocumentDrawModelAccess const & getIDocumentDrawModelAccess() const
Definition: doc.cxx:154
virtual const tools::Rectangle & GetSnapRect() const
bool IsEmpty() const
SdrView * NextView()
#define SAL_MAX_UINT32
void SetDrawObj(SdrObject &_rDrawObj)
bool IsFlyFrame() const
Definition: frame.hxx:1186
wrapper class for the positioning of Writer fly frames and drawing objects
long Right() const
static SwVirtFlyDrawObj * CreateNewRef(SwFlyFrame *pFly, SwFlyFrameFormat *pFormat)
Definition: dcontact.cxx:502
void RemoveDrawObj(SwAnchoredObject &_rToRemoveObj)
Definition: fly.cxx:2267
SwDrawVirtObj & operator=(const SwDrawVirtObj &rObj)
Definition: dcontact.cxx:2177
bool IsMore() const
SdrPage * getSdrPageFromSdrObject() const
const SwFrame * GetAnchorFrame(const SdrObject *_pDrawObj=nullptr) const
Definition: dcontact.cxx:781
void setX(long nX)
BASEGFX_DLLPUBLIC void transform(const B2DHomMatrix &rMatrix)
virtual void SwClientNotify(const SwModify &, const SfxHint &rHint) override
Definition: dcontact.cxx:1348
Point GetRelPosToPageFrame(const bool _bFollowTextFlow, bool &_obRelToTableCell) const
method to determine position of anchored object relative to page frame
virtual Point GetSnapPoint(sal_uInt32 i) const
WW8AnchorConv m_eVertConv
Definition: frmfmt.hxx:306
virtual const tools::Rectangle & GetLogicRect() const override
Definition: dcontact.cxx:2457
#define X
SdrObject & rRefObj
static bool isTextBox(const SwFrameFormat *pFormat, sal_uInt16 nType)
Is the frame format a text box?
virtual void SwClientNotify(const SwModify &, const SfxHint &rHint) override
Definition: dcontact.cxx:418
bool IsTextFrame() const
Definition: frame.hxx:1210
bool mbUserCallActive
Needed data for handling of nested events in method ...
Definition: dcontact.hxx:324
#define RES_UL_SPACE
Definition: hintids.hxx:199
const SdrObject & GetReferencedObj() const
const SwFormatSurround & GetSurround(bool=true) const
Definition: fmtsrnd.hxx:66
sal_uInt32 GetMinOrdNum() const
get minimum order number of anchored objects handled by with contact
Definition: dcontact.cxx:346
long Top() const
SwFlyFrame * FindFlyFrame()
Definition: frame.hxx:1087
SwFrameFormat * FindFrameFormat(SdrObject *pObj)
The Get reverse way: seeks the format to the specified object.
Definition: dcontact.cxx:119
void setY(long nY)
void AssertNestedUserCall()
Definition: dcontact.cxx:1031
SdrObject * DrawObj()
virtual void GetAnchoredObjs(std::vector< SwAnchoredObject * > &_roAnchoredObjs) const override
get data collection of anchored objects handled by with contact
Definition: dcontact.cxx:635
virtual void NbcMirror(const Point &rRef1, const Point &rRef2) override
Definition: dcontact.cxx:2367
virtual void NbcRotate(const Point &rRef, long nAngle, double sn, double cs)
virtual void MoveObjToVisibleLayer(SdrObject *_pDrawObj)
method to move drawing object to corresponding visible layer
Definition: dcontact.cxx:207
virtual void Changed(const SdrObject &rObj, SdrUserCallType eType, const tools::Rectangle &rOldBoundRect)
bool IsInConstructor() const
Definition: viewsh.hxx:554
SwFrame * AnchorFrame()
SwTextFrame * GetFollow()
Definition: txtfrm.hxx:844
sal_uInt32 GetOrdNumDirect() const
#define RES_FOLLOW_TEXT_FLOW
Definition: hintids.hxx:230
Specific frame formats (frames, DrawObjects).
Definition: docary.hxx:201
bool mbInDTOR
boolean, indicating destruction of contact object important note: boolean has to be set at the beginn...
Definition: dcontact.hxx:71
virtual SdrLayerID GetInvisibleHellId() const =0
ObjectContact & GetObjectContact() const
ContactObject for connection between frames (or their formats respectively) in SwClient and the drawo...
Definition: dcontact.hxx:175
virtual std::unique_ptr< sdr::contact::ViewContact > CreateObjectSpecificViewContact() override
AW: Need own sdr::contact::ViewContact since AnchorPos from parent is not used but something own (top...
Definition: dcontact.cxx:2153
#define RES_FLYFRMFMT
Definition: hintids.hxx:276
bool IsMarqueeTextObj(const SdrObject &rObj)
Returns true if the SrdObject is a Marquee-Object (scrolling text)
Definition: dcontact.cxx:181
bool HasWrap(const SdrObject *pObj)
Definition: dcontact.cxx:138
void AddToDrawingPage()
connection to drawing layer
Definition: dcontact.cxx:2220
virtual void SetLayer(SdrLayerID nLayer)
Style of a layout element.
Definition: frmfmt.hxx:57
Point GetRelPosToLine() const
method to determine position of anchored object relative to top of line
TextFrameIndex MapModelToViewPos(SwPosition const &rPos) const
Definition: txtfrm.cxx:1266
bool IsContentFrame() const
Definition: frame.hxx:1206
void InsertMasterIntoDrawPage()
method to insert 'master' drawing object into drawing page
Definition: dcontact.cxx:1902
#define RES_ANCHOR
Definition: hintids.hxx:211
virtual const tools::Rectangle & GetCurrentBoundRect() const override
Definition: dcontact.cxx:2275
const SdrObject * GetDrawObj() const
void InvalidatePrt()
Definition: frame.hxx:1012
const SwFormatAnchor & GetAnchor(bool=true) const
Definition: fmtanchr.hxx:81
virtual void NbcSetLogicRect(const tools::Rectangle &rRect) override
Definition: dcontact.cxx:2475
virtual SdrLayerID GetLayer() const override
Definition: dcontact.cxx:2511
void MoveTo(SdrHdlList &rOther)
void SetAssertFlyPages()
Makes sure that all requested page-bound Flys find a Page.
Definition: rootfrm.hxx:275
static void GetAnchoredObjects(std::vector< SwAnchoredObject * > &, const SwFormat &rFormat)
Definition: fly.cxx:2803
const drawinglayer::geometry::ViewInformation2D & getViewInformation2D() const
const IDocumentLayoutAccess & getIDocumentLayoutAccess() const
Provides access to the document layout interface.
Definition: format.cxx:760
virtual sal_uInt16 GetObjIdentifier() const
virtual SwFrameFormat::tLayoutDir GetLayoutDir() const
Definition: atrfrm.cxx:2768
SwFrameFormat * GetFormat()
Definition: dcontact.hxx:112
RndStdIds GetAnchorId() const
Definition: fmtanchr.hxx:65
virtual void NbcMirror(const Point &rRef1, const Point &rRef2)
const SwFormatHoriOrient & GetHoriOrient(bool=true) const
Definition: fmtornt.hxx:108
const SwPosition * GetContentAnchor() const
Definition: fmtanchr.hxx:67
SwPageFrame * FindPageFrame()
Definition: frame.hxx:658
virtual void SetBoundRectDirty() override
Definition: dcontact.cxx:2304
#define RES_VERT_ORIENT
Definition: hintids.hxx:209
tools::Rectangle aOutRect
void AppendDrawObjToPage(SwAnchoredObject &_rNewObj)
Definition: flylay.cxx:1046
const SwFrame * Lower() const
Definition: layfrm.hxx:101
TElementType * First()
Definition: calbck.hxx:342
int i
SwContentNode * GetContentNode()
Definition: node.hxx:615
FlyAnchors.
Definition: fmtanchr.hxx:34
const SdrPage * GetPage(sal_uInt16 nPgNum) const
void ActionChanged() const
virtual const SwDrawModel * GetDrawModel() const =0
Draw Model and id accessors.
virtual void NbcShear(const Point &rRef, long nAngle, double tn, bool bVShear) override
Definition: dcontact.cxx:2373
static void impAddPrimitivesFromGroup(const ViewObjectContact &rVOC, const basegfx::B2DHomMatrix &rOffsetMatrix, const DisplayInfo &rDisplayInfo, drawinglayer::primitive2d::Primitive2DContainer &rxTarget)
recursively collect primitive data from given VOC with given offset
Definition: dcontact.cxx:2046
bool HasArea() const
Definition: swrect.hxx:290
bool const mbParentUserCallActive
Definition: dcontact.cxx:998
const SwRect & GetObjRectWithSpaces() const
method to determine object area inclusive its spacing
VOCOfDrawVirtObj(ObjectContact &rObjectContact, ViewContact &rViewContact)
Definition: dcontact.cxx:2009
virtual basegfx::B2DPolyPolygon TakeContour() const
void UpdateObjInSortedList()
method to update anchored object in the lists
SdrModel & getSdrModelFromSdrObject() const
void transform(const basegfx::B2DHomMatrix &rMatrix)
sal_uInt32 GetOrdNum() const
virtual void append(const Primitive2DReference &) override
css::text::WrapTextMode GetSurround() const
Definition: fmtsrnd.hxx:51
virtual const SdrObject * GetMaster() const override
Definition: dcontact.hxx:349
virtual bool isPrimitiveVisible(const DisplayInfo &rDisplayInfo) const
SwFlyDrawContact(SwFlyFrameFormat *pToRegisterIn, SdrModel &rTargetModel)
Creates DrawObject and registers it with the Model.
Definition: dcontact.cxx:457
virtual void SetLogicRect(const tools::Rectangle &rRect)
Marks a node in the document model.
Definition: ndindex.hxx:31
virtual void Move(const Size &rSiz)
SdrUserCallType const meParentUserCallEventType
Definition: dcontact.cxx:999
ring_container GetRingContainer()
Definition: ring.hxx:240
void InvalidateObjs_(const bool _bUpdateSortedObjsList=false)
Definition: dcontact.cxx:1563
virtual void InvalidateObjPos()=0
method to invalidate position of the anchored object
virtual void SetRelativePos(const Point &rPnt)
void SetUserCall(SdrObjUserCall *pUser)
const SwDoc * GetDoc() const
The document is set in SwAttrPool now, therefore you always can access it.
Definition: format.hxx:119
virtual const tools::Rectangle & GetLastBoundRect() const override
Definition: dcontact.cxx:2285
virtual const SwAnchoredObject * GetAnchoredObj(const SdrObject *_pSdrObj) const override
Definition: dcontact.cxx:537
virtual const SwAnchoredObject * GetAnchoredObj(const SdrObject *_pSdrObj) const =0
void NotifyBackgrdOfAllVirtObjs(const tools::Rectangle *pOldBoundRect)
Definition: dcontact.cxx:877
A page of the document layout.
Definition: pagefrm.hxx:40
virtual SdrObject * RemoveObject(size_t nObjNum)
void notifyShapePropertyChange(const svx::ShapeProperty _eProperty) const
bool SetFlyFrameAttr(SwFrameFormat &rFlyFormat, SfxItemSet &rSet)
Definition: docfly.cxx:540
void Changed_(const SdrObject &rObj, SdrUserCallType eType, const tools::Rectangle *pOldBoundRect)
Used by Changed() and by UndoDraw.
Definition: dcontact.cxx:1078
SwFrame * GetAnchorFrameContainingAnchPos()
determine anchor frame containing the anchor position
virtual void Mirror(const Point &rRef1, const Point &rRef2)
static sal_uInt16 nPgNum
Definition: viewport.cxx:63
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:404
Size GetSize() const
#define Y
virtual const SdrObject * GetMaster() const =0
virtual SdrInventor GetObjInventor() const
virtual SdrLayerID GetHellId() const =0
virtual SdrLayerID GetLayer() const
#define RES_LR_SPACE
Definition: hintids.hxx:198
virtual void NbcSetSnapRect(const tools::Rectangle &rRect) override
Definition: dcontact.cxx:2449
virtual void RecalcBoundRect() override
All overridden methods which need to use the offset.
Definition: dcontact.cxx:2309
virtual void RecalcSnapRect() override
Definition: dcontact.cxx:2425
static void AddExistingShapeToFormat(SdrObject const &_rObj)
Definition: unodraw.cxx:918
virtual void SetLogicRect(const tools::Rectangle &rRect) override
Definition: dcontact.cxx:2465
virtual void NbcShear(const Point &rRef, long nAngle, double tn, bool bVShear)
virtual sal_uInt32 GetObjectCount() const
SdrObject * Next()
size_t GetHdlCount() const
SdrHdl * GetHdl(size_t nNum) const
virtual ViewObjectContact & CreateObjectSpecificViewObjectContact(ObjectContact &rObjectContact) override
Create an Object-Specific ViewObjectContact, set ViewContact and ObjectContact.
Definition: dcontact.cxx:2144
virtual Point GetSnapPoint(sal_uInt32 i) const override
Definition: dcontact.cxx:2483
virtual SwFrameFormat & GetFrameFormat() override
virtual void SetLayer(SdrLayerID nLayer) override
Definition: dcontact.cxx:2522
drawinglayer::primitive2d::Primitive2DContainer const & getViewIndependentPrimitive2DContainer() const
tools::Rectangle SVRect() const
Definition: swrect.hxx:282
sal_Int32 GetDenominator() const
virtual SdrObject * ReplaceObject(SdrObject *pNewObj, size_t nObjNum)
virtual const tools::Rectangle & GetSnapRect() const override
Definition: dcontact.cxx:2431
general base class for all free-flowing frames
Definition: flyfrm.hxx:60
sal_Int16 GetRelationOrient() const
Definition: fmtornt.hxx:88
virtual void NbcSetSnapRect(const tools::Rectangle &rRect)
SwPageFrame * FindPageFrameOfAnchor()
method to determine the page frame, on which the 'anchor' of the given anchored object is...
#define SAL_WARN_IF(condition, area, stream)
virtual void Shear(const Point &rRef, long nAngle, double tn, bool bVShear) override
Definition: dcontact.cxx:2414
#define RES_DRAWFRMFMT
Definition: hintids.hxx:279
virtual SdrLayerID GetInvisibleHeavenId() const =0
SwTextFrame * FindMaster() const
Definition: flowfrm.cxx:681
virtual const SwViewShell * GetCurrentViewShell() const =0
Returns the layout set at the document.
SwPageFrame * GetPageFrame()
virtual void NbcSetLogicRect(const tools::Rectangle &rRect)
void ClrContourCache(const SdrObject *pObj)
Definition: txtfly.cxx:140
void SetOrdNum(sal_uInt32 nNum)
virtual void Mirror(const Point &rRef1, const Point &rRef2) override
Definition: dcontact.cxx:2406
virtual const SwAnchoredObject * GetAnchoredObj(const SdrObject *_pSdrObj) const override
Definition: dcontact.cxx:739
void SetInDTOR()
Definition: dcontact.cxx:201
virtual void NbcMove(const Size &rSiz)
void SetPageFrame(SwPageFrame *_pNewPageFrame)
#define RES_OPAQUE
Definition: hintids.hxx:206
virtual void NbcSetLayer(SdrLayerID nLayer) override
Definition: dcontact.cxx:2516
Point GetRelPosToAnchorFrame() const
method to determine position of anchored object relative to anchor frame
void DisconnectObjFromLayout(SdrObject *_pDrawObj)
disconnect for a dedicated drawing object - could be 'master' or 'virtual'.
Definition: dcontact.cxx:1662
void ConnectToLayout(const SwFormatAnchor *pAnch=nullptr)
Inserts SdrObject in the arrays of the layout ((SwPageFrame and SwFrame).
Definition: dcontact.cxx:1714
virtual void Changed(const SdrObject &rObj, SdrUserCallType eType, const tools::Rectangle &rOldBoundRect) override
Virtual methods of SdrObjUserCall.
Definition: dcontact.cxx:943
const SwPageFrame * GetPageFrame() const
Definition: dcontact.hxx:356
virtual void NbcRotate(const Point &rRef, long nAngle, double sn, double cs) override
Definition: dcontact.cxx:2361
void RemoveFromDrawingPage()
Definition: dcontact.cxx:2249
SwNodes & GetNodes()
Definition: doc.hxx:402
new class for re-direct methods calls at a 'virtual' drawing object to its referenced object...
Definition: dcontact.hxx:210
bool IsRightToLeft() const
Definition: frame.hxx:963
const SwModify * GetRegisteredIn() const
Definition: calbck.hxx:157
virtual void Resize(const Point &rRef, const Fraction &xFact, const Fraction &yFact, bool bUnsetRelative=true) override
Definition: dcontact.cxx:2384
void InvalidateObjRectWithSpaces() const
bool IsPageFrame() const
Definition: frame.hxx:1154
bool ObjAnchoredAsChar() const
Definition: dcontact.hxx:150
sal_Int32 GetNumerator() const
virtual void NbcResize(const Point &rRef, const Fraction &xFact, const Fraction &yFact) override
Definition: dcontact.cxx:2355
void RemoveMasterFromDrawPage()
method to remove 'master' drawing object from drawing page.
Definition: dcontact.cxx:1643
css::uno::Reference< css::graphic::XPrimitive2D > Primitive2DReference
std::vector< SwDrawVirtObjPtr > maDrawVirtObjs
container for 'virtual' drawing object supporting drawing objects in headers/footers.
Definition: dcontact.hxx:312
long Left() const
void Unchain()
Definition: fly.cxx:309
virtual void GetAnchoredObjs(std::vector< SwAnchoredObject * > &_roAnchoredObjs) const =0
get data collection of anchored objects, handled by with contact
virtual void MoveObjToInvisibleLayer(SdrObject *_pDrawObj)
method to move drawing object to corresponding invisible layer
Definition: dcontact.cxx:234
virtual ::basegfx::B2DPolyPolygon TakeXorPoly() const override
Definition: dcontact.cxx:2319
virtual ViewContact & GetViewContact(sal_uInt32 nIndex) const
SdrObject * getParentSdrObjectFromSdrObject() const
virtual void SetRectsDirty(bool bNotMyself=false, bool bRecursive=true)
void AppendDrawObj(SwAnchoredObject &_rNewObj)
Definition: fly.cxx:2186
virtual ::basegfx::B2DPolyPolygon TakeContour() const override
Definition: dcontact.cxx:2327
virtual void Shear(const Point &rRef, long nAngle, double tn, bool bVShear)
void RemoveFromWriterLayout()
Definition: dcontact.cxx:2210
void setContextWritingMode(SdrObject *pObj, SwFrame const *pAnchor)
Definition: dcontact.cxx:101
ViewContact & GetViewContact() const
virtual void SetSnapRect(const tools::Rectangle &rRect)
static void syncFlyFrameAttr(SwFrameFormat &rShape, SfxItemSet const &rSet)
Similar to syncProperty(), but used by the internal API (e.g. for UI purposes).
bool IsVertical() const
Definition: frame.hxx:949
static void GetTextObjectsFromFormat(std::list< SdrTextObj * > &, SwDoc *)
get data collection of anchored objects, handled by with contact
Definition: dcontact.cxx:729
bool IsInDtor() const
Definition: doc.hxx:397
const SwFrame * GetAnchorFrame() const
Definition: dcontact.cxx:2198
SwModify * GetRegisteredInNonConst() const
Definition: calbck.hxx:134
#define SAL_WARN(area, stream)
virtual void NbcSetAnchorPos(const Point &rPnt)
bool IsNestedUserCall() const
Definition: dcontact.cxx:1026
virtual SdrObject * SetObjectOrdNum(size_t nOldObjNum, size_t nNewObjNum)
SwDrawVirtObj & GetSwDrawVirtObj() const
access to SwDrawVirtObj
Definition: dcontact.cxx:2033
virtual void SetContextWritingMode(const sal_Int16 _nContextWritingMode)
virtual void SetSnapRect(const tools::Rectangle &rRect) override
Definition: dcontact.cxx:2439
virtual void Rotate(const Point &rRef, long nAngle, double sn, double cs) override
Definition: dcontact.cxx:2395
virtual const tools::Rectangle & GetLogicRect() const
NestedUserCallHdl(SwDrawContact *_pDrawContact, SdrUserCallType _eEventType)
Definition: dcontact.cxx:1002
void StartAllAction()
Set up Start-/EndAction for all Shells on an as high as possible (Shell section) level.
Definition: pagechg.cxx:1864
virtual void NbcSetAnchorPos(const Point &rPnt) override
Definition: dcontact.cxx:2267
SwAnchoredDrawObject maAnchoredDrawObj
anchored drawing object instance for the 'master' drawing object
Definition: dcontact.hxx:309
SdrVirtObj & operator=(const SdrVirtObj &rObj)
bool mbDisconnectInProgress
internal flag to indicate that disconnect from layout is in progress
Definition: dcontact.hxx:320
virtual ~SwFlyDrawContact() override
Definition: dcontact.cxx:469
const SwFrame * GetAnchorFrame() const
void ResetLayoutProcessBools()
B2DHomMatrix createTranslateB2DHomMatrix(double fTranslateX, double fTranslateY)
virtual void MoveObjToInvisibleLayer(SdrObject *_pDrawObj) override
Definition: dcontact.cxx:605
virtual bool Prepare(const PrepareHint ePrep=PREP_CLEAR, const void *pVoid=nullptr, bool bNotify=true)
Definition: wsfrm.cxx:587
void EndAllAction(bool bVirDev=false)
Definition: pagechg.cxx:1876
WW8AnchorConv m_eHoriConv
Definition: frmfmt.hxx:305
virtual void NbcSetPoint(const Point &rPnt, sal_uInt32 i) override
Definition: dcontact.cxx:2496
SwRootFrame * GetLayout() const
Definition: viewsh.cxx:2075
bool IsPositioningInProgress() const
is positioning of anchored object in progress
virtual void GetAnchoredObjs(std::vector< SwAnchoredObject * > &_roAnchoredObjs) const override
get data collection of anchored objects, handled by with contact
Definition: dcontact.cxx:1978
virtual Point GetPoint(sal_uInt32 i) const
SdrView * FirstView()
static SwTextFrame * lcl_GetFlyInContentAnchor(SwTextFrame *_pProposedAnchorFrame, SwPosition const &rAnchorPos)
Definition: dcontact.cxx:1699
SdrObjUserCall * GetUserCall() const
virtual Point GetPoint(sal_uInt32 i) const override
Definition: dcontact.cxx:2491
SwContentNode * GoNext(SwNodeIndex *) const
Definition: nodes.cxx:1271
sal_uInt16 Which() const
void SendUserCall(SdrUserCallType eUserCall, const tools::Rectangle &rBoundRect) const
SwAnchoredObject & AnchoredObj()
Definition: dcontact.hxx:245
bool IsCallbackActionEnabled() const
Definition: rootfrm.hxx:382
const basegfx::B2DRange & getObjectRange() const
const SwAttrPool & GetAttrPool() const
Definition: doc.hxx:1309
const IDocumentDrawModelAccess & getIDocumentDrawModelAccess() const
Provides access to the document draw model interface.
Definition: format.cxx:758
static void lcl_textBoxSizeNotify(SwFrameFormat *pFormat)
Notify the format's textbox that it should reconsider its position / size.
Definition: dcontact.cxx:1064
bool IsConnected() const
is 'virtual' drawing object connected to writer layout and / to drawing layer.
Definition: dcontact.cxx:2259
virtual const SdrObject * GetMaster() const override
Definition: dcontact.hxx:194
virtual void NbcSetLayer(SdrLayerID nLayer)
SwPageFrame * FindPage(const SwRect &rRect)
Definition: dcontact.cxx:1912
virtual bool isPrimitiveVisible(const DisplayInfo &rDisplayInfo) const override