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