LibreOffice Module sw (master)  1
dview.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 <hintids.hxx>
21 #include <editeng/protitem.hxx>
22 #include <svx/svdpagv.hxx>
23 #include <svx/fmmodel.hxx>
24 #include <sot/exchange.hxx>
25 #include <svx/sdrundomanager.hxx>
26 #include <tools/globname.hxx>
27 #include <editeng/outliner.hxx>
28 #include <com/sun/star/embed/EmbedMisc.hpp>
29 #include <com/sun/star/embed/XEmbeddedObject.hpp>
30 
31 #include <swtypes.hxx>
32 #include <pagefrm.hxx>
33 #include <rootfrm.hxx>
34 #include <cntfrm.hxx>
35 #include <notxtfrm.hxx>
36 #include <flyfrm.hxx>
37 #include <frmfmt.hxx>
38 #include <dflyobj.hxx>
39 #include <dcontact.hxx>
40 #include <textboxhelper.hxx>
41 #include <frmatr.hxx>
42 #include <viewsh.hxx>
43 #include <viewimp.hxx>
44 #include <dview.hxx>
45 #include <dpage.hxx>
46 #include <doc.hxx>
47 #include <mdiexp.hxx>
48 #include <ndole.hxx>
49 #include <ndgrf.hxx>
50 #include <fmtanchr.hxx>
51 #include <shellres.hxx>
52 #include <IDocumentUndoRedo.hxx>
55 
56 #include <com/sun/star/embed/Aspects.hpp>
57 
58 #include <vector>
59 
60 #include <sortedobjs.hxx>
61 #include <flyfrms.hxx>
62 #include <UndoManager.hxx>
63 
64 using namespace com::sun::star;
65 
66 class SwSdrHdl : public SdrHdl
67 {
68 public:
69  SwSdrHdl(const Point& rPnt, bool bTopRight ) :
70  SdrHdl( rPnt, bTopRight ? SdrHdlKind::Anchor_TR : SdrHdlKind::Anchor ) {}
71  virtual bool IsFocusHdl() const override;
72 };
73 
75 {
76  if( SdrHdlKind::Anchor == eKind || SdrHdlKind::Anchor_TR == eKind )
77  return true;
78  return SdrHdl::IsFocusHdl();
79 }
80 
81 static const SwFrame *lcl_FindAnchor( const SdrObject *pObj, bool bAll )
82 {
83  const SwVirtFlyDrawObj *pVirt = dynamic_cast< const SwVirtFlyDrawObj *>( pObj ) != nullptr ?
84  static_cast<const SwVirtFlyDrawObj*>(pObj) : nullptr;
85  if ( pVirt )
86  {
87  if ( bAll || !pVirt->GetFlyFrame()->IsFlyInContentFrame() )
88  return pVirt->GetFlyFrame()->GetAnchorFrame();
89  }
90  else
91  {
92  const SwDrawContact *pCont = static_cast<const SwDrawContact*>(GetUserCall(pObj));
93  if ( pCont )
94  return pCont->GetAnchorFrame( pObj );
95  }
96  return nullptr;
97 }
98 
100  SwViewShellImp& rI,
101  FmFormModel& rFmFormModel,
102  OutputDevice* pOutDev)
103 : FmFormView(rFmFormModel, pOutDev),
104  m_rImp( rI )
105 {
106  SetPageVisible( false );
107  SetBordVisible( false );
108  SetGridVisible( false );
109  SetHlplVisible( false );
110  SetGlueVisible( false );
113 
116 
118 
120 
121  // #i73602# Use default from the configuration
122  SetBufferedOverlayAllowed(getOptionsDrawinglayer().IsOverlayBuffer_Writer());
123 
124  // #i74769#, #i75172# Use default from the configuration
125  SetBufferedOutputAllowed(getOptionsDrawinglayer().IsPaintBuffer_Writer());
126 }
127 
128 // #i99665#
130 {
132 }
133 
134 static SdrObject* impLocalHitCorrection(SdrObject* pRetval, const Point& rPnt, sal_uInt16 nTol, const SdrMarkList &rMrkList)
135 {
136  if(!nTol)
137  {
138  // the old method forced back to outer bounds test when nTol == 0, so
139  // do not try to correct when nTol is not set (used from HelpContent)
140  }
141  else
142  {
143  // rebuild logic from former SwVirtFlyDrawObj::CheckSdrObjectHit. This is needed since
144  // the SdrObject-specific CheckHit implementations are now replaced with primitives and
145  // 'tricks' like in the old implementation (e.g. using a view from a model-data class to
146  // detect if object is selected) are no longer valid.
147  // The standard primitive hit-test for SwVirtFlyDrawObj now is the outer bound. The old
148  // implementation reduced this excluding the inner bound when the object was not selected.
149  SwVirtFlyDrawObj* pSwVirtFlyDrawObj = dynamic_cast< SwVirtFlyDrawObj* >(pRetval);
150 
151  if(pSwVirtFlyDrawObj)
152  {
153  if(pSwVirtFlyDrawObj->GetFlyFrame()->Lower() && pSwVirtFlyDrawObj->GetFlyFrame()->Lower()->IsNoTextFrame())
154  {
155  // the old method used IsNoTextFrame (should be for SW's own OLE and
156  // graphic's) to accept hit only based on outer bounds; nothing to do
157  }
158  else
159  {
160  // check if the object is selected in this view
161  const size_t nMarkCount(rMrkList.GetMarkCount());
162  bool bSelected(false);
163 
164  for(size_t a = 0; !bSelected && a < nMarkCount; ++a)
165  {
166  if(pSwVirtFlyDrawObj == rMrkList.GetMark(a)->GetMarkedSdrObj())
167  {
168  bSelected = true;
169  }
170  }
171 
172  if(!bSelected)
173  {
174  // when not selected, the object is not hit when hit position is inside
175  // inner range. Get and shrink inner range
176  basegfx::B2DRange aInnerBound(pSwVirtFlyDrawObj->getInnerBound());
177 
178  aInnerBound.grow(-1.0 * nTol);
179 
180  if(aInnerBound.isInside(basegfx::B2DPoint(rPnt.X(), rPnt.Y())))
181  {
182  // exclude this hit
183  pRetval = nullptr;
184  }
185  }
186  }
187  }
188  }
189 
190  return pRetval;
191 }
192 
193 SdrObject* SwDrawView::CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nTol, SdrObject* pObj, SdrPageView* pPV, SdrSearchOptions nOptions, const SdrLayerIDSet* pMVisLay) const
194 {
195  // call parent
196  SdrObject* pRetval = FmFormView::CheckSingleSdrObjectHit(rPnt, nTol, pObj, pPV, nOptions, pMVisLay);
197 
198  if(pRetval)
199  {
200  // override to allow extra handling when picking SwVirtFlyDrawObj's
201  pRetval = impLocalHitCorrection(pRetval, rPnt, nTol, GetMarkedObjectList());
202  }
203 
204  return pRetval;
205 }
206 
209 {
210  const SdrMarkList &rMrkList = GetMarkedObjectList();
211 
212  if(rMrkList.GetMarkCount() != 1 || !GetUserCall(rMrkList.GetMark( 0 )->GetMarkedSdrObj()))
213  return;
214 
215  SdrObject *pObj = rMrkList.GetMark(0)->GetMarkedSdrObj();
216  // make code robust
217  SwFrameFormat* pFrameFormat( ::FindFrameFormat( pObj ) );
218  if ( !pFrameFormat )
219  {
220  OSL_FAIL( "<SwDrawView::AddCustomHdl()> - missing frame format!" );
221  return;
222  }
223  const SwFormatAnchor &rAnchor = pFrameFormat->GetAnchor();
224 
225  if (RndStdIds::FLY_AS_CHAR == rAnchor.GetAnchorId())
226  return;
227 
228  const SwFrame* pAnch;
229  if(nullptr == (pAnch = CalcAnchor()))
230  return;
231 
232  Point aPos(m_aAnchorPoint);
233 
234  if ( RndStdIds::FLY_AT_CHAR == rAnchor.GetAnchorId() )
235  {
236  // #i28701# - use last character rectangle saved at object
237  // in order to avoid a format of the anchor frame
238  SwAnchoredObject* pAnchoredObj = ::GetUserCall( pObj )->GetAnchoredObj( pObj );
239  SwRect aAutoPos = pAnchoredObj->GetLastCharRect();
240  if ( aAutoPos.Height() )
241  {
242  aPos = aAutoPos.Pos();
243  }
244  }
245 
246  // add anchor handle:
247  maHdlList.AddHdl( std::make_unique<SwSdrHdl>( aPos, ( pAnch->IsVertical() && !pAnch->IsVertLR() ) ||
248  pAnch->IsRightToLeft() ) );
249 }
250 
252 {
253  if ( GetUserCall(pObj) )
254  {
255  const SwFrame *pAnch = ::lcl_FindAnchor( pObj, false );
256  if ( pAnch )
257  {
258  //The topmost Obj within the anchor must not be overtaken.
259  const SwFlyFrame *pFly = pAnch->FindFlyFrame();
260  if ( pFly )
261  {
262  const SwPageFrame *pPage = pFly->FindPageFrame();
263  if ( pPage->GetSortedObjs() )
264  {
265  size_t nOrdNum = 0;
266  for (SwAnchoredObject* i : *pPage->GetSortedObjs())
267  {
268  const SdrObject *pO = i->GetDrawObj();
269 
270  if ( pO->GetOrdNumDirect() > nOrdNum )
271  {
272  const SwFrame *pTmpAnch = ::lcl_FindAnchor( pO, false );
273  if ( pFly->IsAnLower( pTmpAnch ) )
274  {
275  nOrdNum = pO->GetOrdNumDirect();
276  }
277  }
278  }
279  if ( nOrdNum )
280  {
281  SdrPage *pTmpPage = GetModel()->GetPage( 0 );
282  ++nOrdNum;
283  if ( nOrdNum < pTmpPage->GetObjCount() )
284  {
285  return pTmpPage->GetObj( nOrdNum );
286  }
287  }
288  }
289  }
290  }
291  }
292  return nullptr;
293 }
294 
296 {
297  if ( GetUserCall(pObj) )
298  {
299  const SwFrame *pAnch = ::lcl_FindAnchor( pObj, false );
300  if ( pAnch )
301  {
302  //The Fly of the anchor must not be "flying under".
303  const SwFlyFrame *pFly = pAnch->FindFlyFrame();
304  if ( pFly )
305  {
306  SdrObject *pRet = const_cast<SdrObject*>(static_cast<SdrObject const *>(pFly->GetVirtDrawObj()));
307  return pRet != pObj ? pRet : nullptr;
308  }
309  }
310  }
311  return nullptr;
312 }
313 
315 sal_uInt32 SwDrawView::GetMaxChildOrdNum( const SwFlyFrame& _rParentObj,
316  const SdrObject* _pExclChildObj )
317 {
318  sal_uInt32 nMaxChildOrdNum = _rParentObj.GetDrawObj()->GetOrdNum();
319 
320  const SdrPage* pDrawPage = _rParentObj.GetDrawObj()->getSdrPageFromSdrObject();
321  OSL_ENSURE( pDrawPage,
322  "<SwDrawView::GetMaxChildOrdNum(..) - missing drawing page at parent object - crash!" );
323 
324  const size_t nObjCount = pDrawPage->GetObjCount();
325  for ( size_t i = nObjCount-1; i > _rParentObj.GetDrawObj()->GetOrdNum() ; --i )
326  {
327  const SdrObject* pObj = pDrawPage->GetObj( i );
328 
329  // Don't consider 'child' object <_pExclChildObj>
330  if ( pObj == _pExclChildObj )
331  {
332  continue;
333  }
334 
335  if ( pObj->GetOrdNum() > nMaxChildOrdNum &&
336  _rParentObj.IsAnLower( lcl_FindAnchor( pObj, true ) ) )
337  {
338  nMaxChildOrdNum = pObj->GetOrdNum();
339  break;
340  }
341  }
342 
343  return nMaxChildOrdNum;
344 }
345 
347 void SwDrawView::MoveRepeatedObjs( const SwAnchoredObject& _rMovedAnchoredObj,
348  const std::vector<SdrObject*>& _rMovedChildObjs ) const
349 {
350  // determine 'repeated' objects of already moved object <_rMovedAnchoredObj>
351  std::vector<SwAnchoredObject*> aAnchoredObjs;
352  {
353  const SwContact* pContact = ::GetUserCall( _rMovedAnchoredObj.GetDrawObj() );
354  assert(pContact && "SwDrawView::MoveRepeatedObjs(..) - missing contact object -> crash.");
355  pContact->GetAnchoredObjs( aAnchoredObjs );
356  }
357 
358  // check, if 'repeated' objects exists.
359  if ( aAnchoredObjs.size() > 1 )
360  {
361  SdrPage* pDrawPage = GetModel()->GetPage( 0 );
362 
363  // move 'repeated' ones to the same order number as the already moved one.
364  const size_t nNewPos = _rMovedAnchoredObj.GetDrawObj()->GetOrdNum();
365  while ( !aAnchoredObjs.empty() )
366  {
367  SwAnchoredObject* pAnchoredObj = aAnchoredObjs.back();
368  if ( pAnchoredObj != &_rMovedAnchoredObj )
369  {
370  pDrawPage->SetObjectOrdNum( pAnchoredObj->GetDrawObj()->GetOrdNum(),
371  nNewPos );
372  pDrawPage->RecalcObjOrdNums();
373  // adjustments for accessibility API
374  if ( dynamic_cast< const SwFlyFrame *>( pAnchoredObj ) != nullptr )
375  {
376  const SwFlyFrame *pTmpFlyFrame = static_cast<SwFlyFrame*>(pAnchoredObj);
377  m_rImp.DisposeAccessibleFrame( pTmpFlyFrame );
378  m_rImp.AddAccessibleFrame( pTmpFlyFrame );
379  }
380  else
381  {
382  m_rImp.DisposeAccessibleObj(pAnchoredObj->GetDrawObj(), true);
383  m_rImp.AddAccessibleObj( pAnchoredObj->GetDrawObj() );
384  }
385  }
386  aAnchoredObjs.pop_back();
387  }
388 
389  // move 'repeated' ones of 'child' objects
390  for ( SdrObject* pChildObj : _rMovedChildObjs )
391  {
392  {
393  const SwContact* pContact = ::GetUserCall( pChildObj );
394  assert(pContact && "SwDrawView::MoveRepeatedObjs(..) - missing contact object -> crash.");
395  pContact->GetAnchoredObjs( aAnchoredObjs );
396  }
397  // move 'repeated' ones to the same order number as the already moved one.
398  const size_t nTmpNewPos = pChildObj->GetOrdNum();
399  while ( !aAnchoredObjs.empty() )
400  {
401  SwAnchoredObject* pAnchoredObj = aAnchoredObjs.back();
402  if ( pAnchoredObj->GetDrawObj() != pChildObj )
403  {
404  pDrawPage->SetObjectOrdNum( pAnchoredObj->GetDrawObj()->GetOrdNum(),
405  nTmpNewPos );
406  pDrawPage->RecalcObjOrdNums();
407  // adjustments for accessibility API
408  if ( dynamic_cast< const SwFlyFrame *>( pAnchoredObj ) != nullptr )
409  {
410  const SwFlyFrame *pTmpFlyFrame = static_cast<SwFlyFrame*>(pAnchoredObj);
411  m_rImp.DisposeAccessibleFrame( pTmpFlyFrame );
412  m_rImp.AddAccessibleFrame( pTmpFlyFrame );
413  }
414  else
415  {
416  m_rImp.DisposeAccessibleObj(pAnchoredObj->GetDrawObj(), true);
417  m_rImp.AddAccessibleObj( pAnchoredObj->GetDrawObj() );
418  }
419  }
420  aAnchoredObjs.pop_back();
421  }
422  }
423  }
424 }
425 
426 // --> adjustment and re-factoring of method
427 void SwDrawView::ObjOrderChanged( SdrObject* pObj, size_t nOldPos,
428  size_t nNewPos )
429 {
430  // nothing to do for group members
431  if ( pObj->getParentSdrObjectFromSdrObject() )
432  {
433  return;
434  }
435 
436  // determine drawing page and assure that the order numbers are correct.
437  SdrPage* pDrawPage = GetModel()->GetPage( 0 );
438  if ( pDrawPage->IsObjOrdNumsDirty() )
439  pDrawPage->RecalcObjOrdNums();
440  const size_t nObjCount = pDrawPage->GetObjCount();
441 
442  SwAnchoredObject* pMovedAnchoredObj =
443  ::GetUserCall( pObj )->GetAnchoredObj( pObj );
444  const SwFlyFrame* pParentAnchoredObj =
445  pMovedAnchoredObj->GetAnchorFrame()->FindFlyFrame();
446 
447  const bool bMovedForward = nOldPos < nNewPos;
448 
449  // assure for a 'child' object, that it doesn't exceed the limits of its 'parent'
450  if ( pParentAnchoredObj )
451  {
452  if ( bMovedForward )
453  {
454  const size_t nMaxChildOrdNumWithoutMoved =
455  GetMaxChildOrdNum( *pParentAnchoredObj, pMovedAnchoredObj->GetDrawObj() );
456  if ( nNewPos > nMaxChildOrdNumWithoutMoved+1 )
457  {
458  // set position to the top of the 'child' object group
459  pDrawPage->SetObjectOrdNum( nNewPos, nMaxChildOrdNumWithoutMoved+1 );
460  nNewPos = nMaxChildOrdNumWithoutMoved+1;
461  }
462  }
463  else
464  {
465  const size_t nParentOrdNum = pParentAnchoredObj->GetDrawObj()->GetOrdNum();
466  if ( nNewPos < nParentOrdNum )
467  {
468  // set position to the bottom of the 'child' object group
469  pDrawPage->SetObjectOrdNum( nNewPos, nParentOrdNum );
470  nNewPos = nParentOrdNum;
471  }
472  }
473  if ( pDrawPage->IsObjOrdNumsDirty() )
474  pDrawPage->RecalcObjOrdNums();
475  }
476 
477  // Assure, that object isn't positioned between 'repeated' ones
478  if ( ( bMovedForward && nNewPos < nObjCount - 1 ) ||
479  ( !bMovedForward && nNewPos > 0 ) )
480  {
481  const SdrObject* pTmpObj =
482  pDrawPage->GetObj( bMovedForward ? nNewPos - 1 : nNewPos + 1 );
483  if ( pTmpObj )
484  {
485  size_t nTmpNewPos( nNewPos );
486  if ( bMovedForward )
487  {
488  // move before the top 'repeated' object
489  const sal_uInt32 nTmpMaxOrdNum =
490  ::GetUserCall( pTmpObj )->GetMaxOrdNum();
491  if ( nTmpMaxOrdNum > nNewPos )
492  nTmpNewPos = nTmpMaxOrdNum;
493  }
494  else
495  {
496  // move behind the bottom 'repeated' object
497  const sal_uInt32 nTmpMinOrdNum =
498  ::GetUserCall( pTmpObj )->GetMinOrdNum();
499  if ( nTmpMinOrdNum < nNewPos )
500  nTmpNewPos = nTmpMinOrdNum;
501  }
502  if ( nTmpNewPos != nNewPos )
503  {
504  pDrawPage->SetObjectOrdNum( nNewPos, nTmpNewPos );
505  nNewPos = nTmpNewPos;
506  pDrawPage->RecalcObjOrdNums();
507  }
508  }
509  }
510 
511  // On move forward, assure that object is moved before its own children.
512  // Only Writer fly frames can have children.
513  if ( dynamic_cast< const SwFlyFrame *>( pMovedAnchoredObj ) != nullptr &&
514  bMovedForward && nNewPos < nObjCount - 1 )
515  {
516  sal_uInt32 nMaxChildOrdNum =
517  GetMaxChildOrdNum( *static_cast<const SwFlyFrame*>(pMovedAnchoredObj) );
518  if ( nNewPos < nMaxChildOrdNum )
519  {
520  // determine position before the object before its top 'child' object
521  const SdrObject* pTmpObj = pDrawPage->GetObj( nMaxChildOrdNum );
522  size_t nTmpNewPos = ::GetUserCall( pTmpObj )->GetMaxOrdNum() + 1;
523  if ( nTmpNewPos >= nObjCount )
524  {
525  --nTmpNewPos;
526  }
527  // assure, that determined position isn't between 'repeated' objects
528  pTmpObj = pDrawPage->GetObj( nTmpNewPos );
529  nTmpNewPos = ::GetUserCall( pTmpObj )->GetMaxOrdNum();
530  // apply new position
531  pDrawPage->SetObjectOrdNum( nNewPos, nTmpNewPos );
532  nNewPos = nTmpNewPos;
533  pDrawPage->RecalcObjOrdNums();
534  }
535  }
536 
537  // Assure, that object isn't positioned between nested objects
538  if ( ( bMovedForward && nNewPos < nObjCount - 1 ) ||
539  ( !bMovedForward && nNewPos > 0 ) )
540  {
541  size_t nTmpNewPos( nNewPos );
542  const SwFrameFormat* pParentFrameFormat =
543  pParentAnchoredObj ? &(pParentAnchoredObj->GetFrameFormat()) : nullptr;
544  const SdrObject* pTmpObj = pDrawPage->GetObj( nNewPos + 1 );
545  while ( pTmpObj )
546  {
547  // #i38563# - assure, that anchor frame exists.
548  // If object is anchored inside an invisible part of the document
549  // (e.g. page header, whose page style isn't applied, or hidden
550  // section), no anchor frame exists.
551  const SwFrame* pTmpAnchorFrame = lcl_FindAnchor( pTmpObj, true );
552  const SwFlyFrame* pTmpParentObj = pTmpAnchorFrame
553  ? pTmpAnchorFrame->FindFlyFrame() : nullptr;
554  if ( pTmpParentObj &&
555  &(pTmpParentObj->GetFrameFormat()) != pParentFrameFormat )
556  {
557  if ( bMovedForward )
558  {
559  nTmpNewPos = ::GetUserCall( pTmpObj )->GetMaxOrdNum();
560  pTmpObj = pDrawPage->GetObj( nTmpNewPos + 1 );
561  }
562  else
563  {
564  nTmpNewPos = ::GetUserCall( pTmpParentObj->GetDrawObj() )
565  ->GetMinOrdNum();
566  pTmpObj = pTmpParentObj->GetDrawObj();
567  }
568  }
569  else
570  break;
571  }
572  if ( nTmpNewPos != nNewPos )
573  {
574  pDrawPage->SetObjectOrdNum( nNewPos, nTmpNewPos );
575  nNewPos = nTmpNewPos;
576  pDrawPage->RecalcObjOrdNums();
577  }
578  }
579 
580  // setup collection of moved 'child' objects to move its 'repeated' objects.
581  std::vector< SdrObject* > aMovedChildObjs;
582 
583  // move 'children' accordingly
584  if ( dynamic_cast< const SwFlyFrame *>( pMovedAnchoredObj ) != nullptr )
585  {
586  const SwFlyFrame* pFlyFrame = static_cast<SwFlyFrame*>(pMovedAnchoredObj);
587 
588  // adjustments for accessibility API
589  m_rImp.DisposeAccessibleFrame( pFlyFrame );
590  m_rImp.AddAccessibleFrame( pFlyFrame );
591 
592  const sal_uInt32 nChildNewPos = bMovedForward ? nNewPos : nNewPos+1;
593  size_t i = bMovedForward ? nOldPos : nObjCount-1;
594  do
595  {
596  SdrObject* pTmpObj = pDrawPage->GetObj( i );
597  if ( pTmpObj == pObj )
598  break;
599 
600  // #i38563# - assure, that anchor frame exists.
601  // If object is anchored inside an invisible part of the document
602  // (e.g. page header, whose page style isn't applied, or hidden
603  // section), no anchor frame exists.
604  const SwFrame* pTmpAnchorFrame = lcl_FindAnchor( pTmpObj, true );
605  const SwFlyFrame* pTmpParentObj = pTmpAnchorFrame
606  ? pTmpAnchorFrame->FindFlyFrame() : nullptr;
607  if ( pTmpParentObj &&
608  ( ( pTmpParentObj == pFlyFrame ) ||
609  ( pFlyFrame->IsUpperOf( *pTmpParentObj ) ) ) )
610  {
611  // move child object.,
612  pDrawPage->SetObjectOrdNum( i, nChildNewPos );
613  pDrawPage->RecalcObjOrdNums();
614  // collect 'child' object
615  aMovedChildObjs.push_back( pTmpObj );
616  // adjustments for accessibility API
617  if ( dynamic_cast< const SwVirtFlyDrawObj *>( pTmpObj ) != nullptr )
618  {
619  const SwFlyFrame *pTmpFlyFrame =
620  static_cast<SwVirtFlyDrawObj*>(pTmpObj)->GetFlyFrame();
621  m_rImp.DisposeAccessibleFrame( pTmpFlyFrame );
622  m_rImp.AddAccessibleFrame( pTmpFlyFrame );
623  }
624  else
625  {
626  m_rImp.DisposeAccessibleObj(pTmpObj, true);
627  m_rImp.AddAccessibleObj( pTmpObj );
628  }
629  }
630  else
631  {
632  // adjust loop counter
633  if ( bMovedForward )
634  ++i;
635  else if (i > 0)
636  --i;
637  }
638 
639  } while ( ( bMovedForward && i < ( nObjCount - aMovedChildObjs.size() ) ) ||
640  ( !bMovedForward && i > ( nNewPos + aMovedChildObjs.size() ) ) );
641  }
642  else
643  {
644  // adjustments for accessibility API
645  m_rImp.DisposeAccessibleObj(pObj, true);
646  m_rImp.AddAccessibleObj( pObj );
647  }
648 
649  MoveRepeatedObjs( *pMovedAnchoredObj, aMovedChildObjs );
650 }
651 
653  tools::Rectangle& rRect ) const
654 {
655  const SdrMarkList &rMrkList = GetMarkedObjectList();
656  bool bRet = false;
657  if( 1 == rMrkList.GetMarkCount() )
658  {
659  const SdrObject *pObj = rMrkList.GetMark( 0 )->GetMarkedSdrObj();
660  SwRect aRect;
661  if( ::CalcClipRect( pObj, aRect, eMode == SdrDragMode::Move ) )
662  {
663  rRect = aRect.SVRect();
664  bRet = true;
665  }
666  }
667  return bRet;
668 }
669 
671 {
672  const SdrMarkList &rMrkList = GetMarkedObjectList();
673  if ( rMrkList.GetMarkCount() != 1 )
674  return nullptr;
675 
676  SdrObject* pObj = rMrkList.GetMark( 0 )->GetMarkedSdrObj();
677 
678  //Search for paragraph bound objects, otherwise only the
679  //current anchor. Search only if we currently drag.
680  const SwFrame* pAnch;
681  tools::Rectangle aMyRect;
682  const bool bFly = dynamic_cast< const SwVirtFlyDrawObj *>( pObj ) != nullptr;
683  if ( bFly )
684  {
685  pAnch = static_cast<SwVirtFlyDrawObj*>(pObj)->GetFlyFrame()->GetAnchorFrame();
686  aMyRect = static_cast<SwVirtFlyDrawObj*>(pObj)->GetFlyFrame()->getFrameArea().SVRect();
687  }
688  else
689  {
690  SwDrawContact *pC = static_cast<SwDrawContact*>(GetUserCall(pObj));
691  // determine correct anchor position for 'virtual' drawing objects.
692  // #i26791#
693  pAnch = pC->GetAnchorFrame( pObj );
694  if( !pAnch )
695  {
696  pC->ConnectToLayout();
697  // determine correct anchor position for 'virtual' drawing objects.
698  // #i26791#
699  pAnch = pC->GetAnchorFrame( pObj );
700  }
701  aMyRect = pObj->GetSnapRect();
702  }
703 
704  const bool bTopRight = pAnch && ( ( pAnch->IsVertical() &&
705  !pAnch->IsVertLR() ) ||
706  pAnch->IsRightToLeft() );
707  const Point aMyPt = bTopRight ? aMyRect.TopRight() : aMyRect.TopLeft();
708 
709  Point aPt;
710  if ( IsAction() )
711  {
712  if ( !TakeDragObjAnchorPos( aPt, bTopRight ) )
713  return nullptr;
714  }
715  else
716  {
717  tools::Rectangle aRect = pObj->GetSnapRect();
718  aPt = bTopRight ? aRect.TopRight() : aRect.TopLeft();
719  }
720 
721  if ( aPt != aMyPt )
722  {
723  if ( pAnch && pAnch->IsContentFrame() )
724  {
725  // allow drawing objects in header/footer,
726  // but exclude control objects.
727  bool bBodyOnly = CheckControlLayer( pObj );
728  pAnch = ::FindAnchor( static_cast<const SwContentFrame*>(pAnch), aPt, bBodyOnly );
729  }
730  else if ( !bFly )
731  {
732  const SwRect aRect( aPt.getX(), aPt.getY(), 1, 1 );
733 
734  SwDrawContact* pContact = static_cast<SwDrawContact*>(GetUserCall(pObj));
735  if ( pContact->GetAnchorFrame( pObj ) &&
736  pContact->GetAnchorFrame( pObj )->IsPageFrame() )
737  pAnch = pContact->GetPageFrame();
738  else
739  pAnch = pContact->FindPage( aRect );
740  }
741  }
742  if( pAnch && !pAnch->IsProtected() )
743  m_aAnchorPoint = pAnch->GetFrameAnchorPos( ::HasWrap( pObj ) );
744  else
745  pAnch = nullptr;
746  return pAnch;
747 }
748 
750 {
751  SdrHdl* pHdl = maHdlList.GetHdl(SdrHdlKind::Anchor);
752  if ( ! pHdl )
753  pHdl = maHdlList.GetHdl(SdrHdlKind::Anchor_TR);
754 
755  if(pHdl)
756  {
757  CalcAnchor();
758  pHdl->SetPos(m_aAnchorPoint);
759  }
760 }
761 
763 {
764  Imp().GetShell()->DrawSelChanged();
766 }
767 
768 // #i7672#
770 {
771  // The ModelHasChanged() call in DrawingLayer also updates
772  // an eventually active text edit view (OutlinerView). This also leads
773  // to newly setting the background color for that edit view. Thus,
774  // this method rescues the current background color if an OutlinerView
775  // exists and re-establishes it then. To be more safe, the OutlinerView
776  // will be fetched again (maybe textedit has ended).
778  Color aBackColor;
779  bool bColorWasSaved(false);
780 
781  if(pView)
782  {
783  aBackColor = pView->GetBackgroundColor();
784  bColorWasSaved = true;
785  }
786 
787  // call parent
789 
790  if(bColorWasSaved)
791  {
792  pView = GetTextEditOutlinerView();
793 
794  if(pView)
795  {
796  pView->SetBackgroundColor(aBackColor);
797  }
798  }
799 }
800 
802 {
803  OSL_ENSURE( m_rImp.GetShell()->GetWin(), "MakeVisible, unknown Window");
804  m_rImp.GetShell()->MakeVisible( SwRect( rRect ) );
805 }
806 
808 {
810 
811  //In addition to the existing flags of the objects themselves,
812  //which are evaluated by the DrawingEngine, other circumstances
813  //lead to a protection.
814  //Objects that are anchored in frames need to be protected
815  //if the content of the frame is protected.
816  //OLE-Objects may themselves wish a resize protection (StarMath)
817 
818  const SdrMarkList &rMrkList = GetMarkedObjectList();
819  bool bProtect = false;
820  bool bSzProtect = false;
821  bool bRotate(false);
822 
823  for ( size_t i = 0; !bProtect && i < rMrkList.GetMarkCount(); ++i )
824  {
825  const SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
826  const SwFrame *pFrame = nullptr;
827  if ( auto pVirtFlyDrawObj = dynamic_cast< const SwVirtFlyDrawObj *>( pObj ) )
828  {
829  const SwFlyFrame *pFly = pVirtFlyDrawObj->GetFlyFrame();
830  if ( pFly )
831  {
832  pFrame = pFly->GetAnchorFrame();
833  if ( pFly->Lower() && pFly->Lower()->IsNoTextFrame() )
834  {
835  const SwNoTextFrame *const pNTF(static_cast<const SwNoTextFrame*>(pFly->Lower()));
836  const SwOLENode *const pOLENd = pNTF->GetNode()->GetOLENode();
837  const SwGrfNode *const pGrfNd = pNTF->GetNode()->GetGrfNode();
838 
839  if ( pOLENd )
840  {
841  const uno::Reference < embed::XEmbeddedObject > xObj = const_cast< SwOLEObj& >(pOLENd->GetOLEObj()).GetOleRef();
842 
843  if ( xObj.is() )
844  {
845  // --> improvement for the future, when more
846  // than one Writer fly frame can be selected.
847 
848  // TODO/LATER: retrieve Aspect - from where?!
849  bSzProtect |= ( embed::EmbedMisc::EMBED_NEVERRESIZE & xObj->getStatus( embed::Aspects::MSOLE_CONTENT ) ) != 0;
850 
851  // #i972: protect position if it is a Math object anchored 'as char' and baseline alignment is activated
852  SwDoc* pDoc = Imp().GetShell()->GetDoc();
853  const bool bProtectMathPos = SotExchange::IsMath( xObj->getClassID() )
854  && RndStdIds::FLY_AS_CHAR == pFly->GetFormat()->GetAnchor().GetAnchorId()
856  if (bProtectMathPos)
857  m_bMoveProtect = true;
858  }
859  }
860  else if(pGrfNd)
861  {
862  // RotGrfFlyFrame: GraphicNode allows rotation(s). The loop ew are in stops
863  // as soon as bMoveProtect is set, but since rotation is valid only with
864  // a single object selected this makes no difference
865  bRotate = true;
866  }
867  }
868  }
869  }
870  else
871  {
872  SwDrawContact *pC = static_cast<SwDrawContact*>(GetUserCall(pObj));
873  if ( pC )
874  pFrame = pC->GetAnchorFrame( pObj );
875  }
876  if ( pFrame )
877  bProtect = pFrame->IsProtected(); //Frames, areas etc.
878  {
879  SwFrameFormat* pFrameFormat( ::FindFrameFormat( const_cast<SdrObject*>(pObj) ) );
880  if ( !pFrameFormat )
881  {
882  OSL_FAIL( "<SwDrawView::CheckPossibilities()> - missing frame format" );
883  bProtect = true;
884  }
885  else if ((RndStdIds::FLY_AS_CHAR == pFrameFormat->GetAnchor().GetAnchorId()) &&
886  rMrkList.GetMarkCount() > 1 )
887  {
888  bProtect = true;
889  }
890  }
891  }
892  m_bMoveProtect |= bProtect;
893  m_bResizeProtect |= bProtect || bSzProtect;
894 
895  // RotGrfFlyFrame: allow rotation when SwGrfNode is selected and not size protected
896  m_bRotateFreeAllowed |= bRotate && !bProtect;
898 }
899 
902 {
903  SdrPageView* pDrawPageView = _rMarkView.GetSdrPageView();
904  const SdrMarkList& rMarkList = _rMarkView.GetMarkedObjectList();
905 
906  if( rMarkList.GetMarkCount() )
907  {
908  // collect marked objects in a local data structure
909  std::vector<SdrObject*> aMarkedObjs;
910  for( size_t i = 0; i < rMarkList.GetMarkCount(); ++i )
911  {
912  SdrObject* pMarkedObj = rMarkList.GetMark( i )->GetMarkedSdrObj();
913  aMarkedObjs.push_back( pMarkedObj );
914  }
915  // unmark all objects
916  _rMarkView.UnmarkAllObj();
917  // re-mark objects, but for marked <SwDrawVirtObj>-objects marked its
918  // reference object.
919  while ( !aMarkedObjs.empty() )
920  {
921  SdrObject* pMarkObj = aMarkedObjs.back();
922  if ( dynamic_cast< const SwDrawVirtObj *>( pMarkObj ) != nullptr )
923  {
924  SdrObject* pRefObj = &(static_cast<SwDrawVirtObj*>(pMarkObj)->ReferencedObj());
925  if ( !_rMarkView.IsObjMarked( pRefObj ) )
926  {
927  _rMarkView.MarkObj( pRefObj, pDrawPageView );
928  }
929  }
930  else
931  {
932  _rMarkView.MarkObj( pMarkObj, pDrawPageView );
933  }
934 
935  aMarkedObjs.pop_back();
936  }
937  // sort marked list in order to assure consistent state in drawing layer
938  _rMarkView.SortMarkedObjects();
939  }
940 }
941 
943 {
944  return m_rImp.GetShell()->GetSfxViewShell();
945 }
946 
948 {
949  SwDoc* pDoc = Imp().GetShell()->GetDoc();
951  if ( pTmpRoot )
952  pTmpRoot->StartAllAction();
954  // replace marked <SwDrawVirtObj>-objects by its reference objects.
955  if (SdrPageView* pDrawPageView = m_rImp.GetPageView())
956  {
957  ReplaceMarkedDrawVirtObjs(pDrawPageView->GetView());
958  }
959 
960  // Check what textboxes have to be deleted afterwards.
961  const SdrMarkList& rMarkList = GetMarkedObjectList();
962  std::vector<SwFrameFormat*> aTextBoxesToDelete;
963  for (size_t i = 0; i < rMarkList.GetMarkCount(); ++i)
964  {
965  SdrObject *pObject = rMarkList.GetMark(i)->GetMarkedSdrObj();
966  SwContact* pContact = GetUserCall(pObject);
967  SwFrameFormat* pFormat = pContact->GetFormat();
969  aTextBoxesToDelete.push_back(pTextBox);
970  }
971 
972  if ( pDoc->DeleteSelection( *this ) )
973  {
976 
977  // Only delete these now: earlier deletion would clear the mark list as well.
978  for (auto& rpTextBox : aTextBoxesToDelete)
979  pDoc->getIDocumentLayoutAccess().DelLayoutFormat(rpTextBox);
980  }
981  pDoc->GetIDocumentUndoRedo().EndUndo(SwUndoId::EMPTY, nullptr);
982  if( pTmpRoot )
983  pTmpRoot->EndAllAction();
984 }
985 
986 // support enhanced text edit for draw objects
988 {
989  SwDoc* pDoc = Imp().GetShell()->GetDoc();
990 
991  return pDoc ? dynamic_cast< SdrUndoManager* >(&(pDoc->GetUndoManager())) : nullptr;
992 }
993 
994 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool IsAnLower(const SwFrame *) const
Definition: findfrm.cxx:206
Point TopLeft() const
sal_uInt32 GetMaxOrdNum() const
get maximum order number of anchored objects handled by with contact
Definition: dcontact.cxx:377
void UnmarkAllObj(SdrPageView const *pPV=nullptr)
virtual void ModelHasChanged() override
void FrameNotify(SwViewShell *pVwSh, FlyMode eMode)
Definition: edtwin3.cxx:85
Base class for the following contact objects (frame + draw objects).
Definition: dcontact.hxx:66
const SwVirtFlyDrawObj * GetVirtDrawObj() const
Definition: fly.cxx:2725
Base class of the Writer layout elements.
Definition: frame.hxx:295
const SwRect & GetLastCharRect() const
void SetHlplVisible(bool bOn=true)
virtual const SwFlyFrameFormat * GetFormat() const override
Definition: fly.cxx:2814
size_t GetMarkCount() const
void SetPos(const Point &rPnt)
static const SwFrame * lcl_FindAnchor(const SdrObject *pObj, bool bAll)
Definition: dview.cxx:81
void SortMarkedObjects() const
bool CheckControlLayer(const SdrObject *pObj)
Definition: dcontact.cxx:662
SwOLENode * GetOLENode()
Inline methods from Node.hxx.
Definition: ndole.hxx:161
bool IsAntiAliasing() const
Definition: dview.cxx:129
const SwOLEObj & GetOLEObj() const
Definition: ndole.hxx:112
virtual const SwRootFrame * GetCurrentLayout() const =0
virtual bool get(DocumentSettingId id) const override
Return the specified document setting.
static sal_uInt32 GetMaxChildOrdNum(const SwFlyFrame &_rParentObj, const SdrObject *_pExclChildObj=nullptr)
determine maximal order number for a 'child' object of given 'parent' object
Definition: dview.cxx:315
virtual void MakeVisible(const tools::Rectangle &, vcl::Window &rWin) override
Definition: dview.cxx:801
void AddAccessibleFrame(const SwFrame *pFrame)
Add a frame in the accessible view.
Definition: viewimp.hxx:296
basegfx::B2DRange getInnerBound() const
Definition: dflyobj.cxx:337
SdrHdlKind
void SetHitTolerancePixel(sal_uInt16 nVal)
SdrSearchOptions
void SetPrintPreview(bool bOn=true)
void EnableExtendedKeyInputDispatcher(bool bOn)
void AddAccessibleObj(const SdrObject *pObj)
Definition: viewimp.hxx:302
bool m_bResizeProtect
virtual SwUndoId EndUndo(SwUndoId const eUndoId, SwRewriter const *const pRewriter)=0
Closes undo block.
SdrObject * GetObj(size_t nNum) const
void RecalcObjOrdNums()
Definition: doc.hxx:185
size_t GetObjCount() const
virtual bool IsFocusHdl() const
void Height(long nNew)
Definition: swrect.hxx:189
bool DeleteSelection(SwDrawView &)
Definition: docdraw.cxx:388
SdrMark * GetMark(size_t nNum) const
void Pos(const Point &rNew)
Definition: swrect.hxx:167
IDocumentUndoRedo & GetIDocumentUndoRedo()
Definition: doc.cxx:176
bool CalcClipRect(const SdrObject *pSdrObj, SwRect &rRect, bool bMove=true)
calculate rectangle in that the object can be moved or rather be resized
Definition: flylay.cxx:1161
Of course Writer needs its own rectangles.
Definition: swrect.hxx:34
SfxViewShell * GetSfxViewShell() const
Definition: viewsh.hxx:444
void EnableExtendedMouseEventDispatcher(bool bOn)
void SetFrameDragSingles(bool bOn=true)
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
const SwViewShellImp & Imp() const
Definition: dview.hxx:103
static SwFrameFormat * getOtherTextBoxFormat(const SwFrameFormat *pFormat, sal_uInt16 nType)
If we have an associated TextFrame, then return that.
virtual SwFrameFormat & GetFrameFormat() override
Definition: fly.cxx:2744
virtual const tools::Rectangle & GetSnapRect() const
void SetBufferedOutputAllowed(bool bNew)
bool m_bMoveProtect
bool IsObjOrdNumsDirty() const
virtual SdrObject * GetMaxToTopObj(SdrObject *pObj) const override
Definition: dview.cxx:251
Color const & GetBackgroundColor() const
wrapper class for the positioning of Writer fly frames and drawing objects
virtual SdrObject * CheckSingleSdrObjectHit(const Point &rPnt, sal_uInt16 nTol, SdrObject *pObj, SdrPageView *pPV, SdrSearchOptions nOptions, const SdrLayerIDSet *pMVisLay) const override
Definition: dview.cxx:193
SdrPage * getSdrPageFromSdrObject() const
const SwFrame * GetAnchorFrame(const SdrObject *_pDrawObj=nullptr) const
Definition: dcontact.cxx:787
void DisposeAccessibleObj(const SdrObject *pObj, bool bCanSkipInvisible)
Definition: viewimp.hxx:285
void SetGlueVisible(bool bOn=true)
virtual void DelLayoutFormat(SwFrameFormat *pFormat)=0
void SetBordVisible(bool bOn=true)
static SdrObject * impLocalHitCorrection(SdrObject *pRetval, const Point &rPnt, sal_uInt16 nTol, const SdrMarkList &rMrkList)
Definition: dview.cxx:134
void SetPageVisible(bool bOn=true)
sal_uInt32 GetMinOrdNum() const
get minimum order number of anchored objects handled by with contact
Definition: dcontact.cxx:352
SwDoc * GetDoc() const
Definition: viewsh.hxx:284
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
static sal_uInt16 IsMath(const SvGlobalName &rName)
virtual SdrObject * CheckSingleSdrObjectHit(const Point &rPnt, sal_uInt16 nTol, SdrObject *pObj, SdrPageView *pPV, SdrSearchOptions nOptions, const SdrLayerIDSet *pMVisLay) const
bool IsUpperOf(const SwFlyFrame &_rLower) const
Definition: flyfrm.hxx:206
bool IsFlyInContentFrame() const
Definition: flyfrm.hxx:193
sal_uInt32 GetOrdNumDirect() const
const SwViewShell * GetShell() const
Only for SwViewShell::Init()
Definition: viewimp.hxx:140
void MakeVisible(const SwRect &)
Definition: viewsh.cxx:578
void grow(double fValue)
long getY() const
SfxViewShell * GetSfxViewShell() const override
See SdrMarkView::GetSfxViewShell().
Definition: dview.cxx:942
SdrObject * GetMarkedSdrObj() const
long getX() const
void SetSwapAsynchron(bool bJa=true)
bool HasWrap(const SdrObject *pObj)
Definition: dcontact.cxx:144
virtual SdrObject * GetMaxToBtmObj(SdrObject *pObj) const override
Definition: dview.cxx:295
Style of a layout element.
Definition: frmfmt.hxx:57
::sw::UndoManager & GetUndoManager()
Definition: doc.cxx:165
virtual SwUndoId StartUndo(SwUndoId const eUndoId, SwRewriter const *const pRewriter)=0
Opens undo block.
bool IsContentFrame() const
Definition: frame.hxx:1206
void SetBufferedOverlayAllowed(bool bNew)
Shell * GetShell()
const SdrObject * GetDrawObj() const
const SwSortedObjs * GetSortedObjs() const
Definition: pagefrm.hxx:118
const SwFormatAnchor & GetAnchor(bool=true) const
Definition: fmtanchr.hxx:81
SwSdrHdl(const Point &rPnt, bool bTopRight)
Definition: dview.cxx:69
virtual void DrawSelChanged()
Definition: viewsh.cxx:2098
SwFrameFormat * GetFormat()
Definition: dcontact.hxx:112
RndStdIds GetAnchorId() const
Definition: fmtanchr.hxx:65
SwPageFrame * FindPageFrame()
Definition: frame.hxx:658
bool m_bRotate90Allowed
const SwFrame * Lower() const
Definition: layfrm.hxx:100
int i
bool m_bRotateFreeAllowed
bool IsPreview() const
Definition: viewsh.hxx:491
const SdrMarkList & GetMarkedObjectList() const
FlyAnchors.
Definition: fmtanchr.hxx:34
const SdrPage * GetPage(sal_uInt16 nPgNum) const
sal_uInt32 GetOrdNum() const
const OutlinerView * GetTextEditOutlinerView() const
virtual void ObjOrderChanged(SdrObject *pObj, size_t nOldPos, size_t nNewPos) override
Definition: dview.cxx:427
Point m_aAnchorPoint
Definition: dview.hxx:34
bool TakeDragObjAnchorPos(Point &rPos, bool bTopRight) const
virtual const SwAnchoredObject * GetAnchoredObj(const SdrObject *_pSdrObj) const =0
A page of the document layout.
Definition: pagefrm.hxx:40
long X() const
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:437
virtual void CheckPossibilities() override
Definition: dview.cxx:807
virtual bool IsAction() const override
SdrHdl * GetHdl(size_t nNum) const
const SvtOptionsDrawinglayer & getOptionsDrawinglayer() const
const SwContentNode * GetNode() const
Definition: notxtfrm.hxx:60
SwFlyFrame * GetFlyFrame()
Definition: dflyobj.hxx:127
bool IsVertLR() const
Definition: frame.hxx:955
void ShowDragAnchor()
Definition: dview.cxx:749
tools::Rectangle SVRect() const
Definition: swrect.hxx:282
static void ReplaceMarkedDrawVirtObjs(SdrMarkView &_rMarkView)
replace marked -objects by its reference object for delete marked objects.
Definition: dview.cxx:901
general base class for all free-flowing frames
Definition: flyfrm.hxx:60
SwDrawView(SwViewShellImp &rI, FmFormModel &rFmFormModel, OutputDevice *pOutDev)
Definition: dview.cxx:99
#define RES_DRAWFRMFMT
Definition: hintids.hxx:279
virtual void MarkListHasChanged() override
SdrDragMode
SwViewShellImp & m_rImp
Definition: dview.hxx:35
vcl::Window * GetWin() const
Definition: viewsh.hxx:340
bool IsNoTextFrame() const
Definition: frame.hxx:1214
void ConnectToLayout(const SwFormatAnchor *pAnch=nullptr)
Inserts SdrObject in the arrays of the layout ((SwPageFrame and SwFrame).
Definition: dcontact.cxx:1720
void SetBackgroundColor(const Color &rColor)
void MoveRepeatedObjs(const SwAnchoredObject &_rMovedAnchoredObj, const std::vector< SdrObject * > &_rMovedChildObjs) const
method to move 'repeated' objects of the given moved object to the according level ...
Definition: dview.cxx:347
void SetGridVisible(bool bOn)
virtual void DeleteMarked()
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
::sw::DocumentSettingManager & GetDocumentSettingManager()
Definition: doc.cxx:218
virtual void GetAnchoredObjs(std::vector< SwAnchoredObject * > &_roAnchoredObjs) const =0
get data collection of anchored objects, handled by with contact
virtual bool IsFocusHdl() const override
Definition: dview.cxx:74
SdrObject * getParentSdrObjectFromSdrObject() const
SdrPageView * GetSdrPageView() const
const SwContentFrame * FindAnchor(const SwFrame *pOldAnch, const Point &rNew, const bool bBody=false)
search an anchor for paragraph bound frames starting from pOldAnch
Definition: flycnt.cxx:1014
virtual void CheckPossibilities() override
bool IsAntiAliasing() const
sal_uInt16 GetMarkHdlSizePixel() const
bool IsVertical() const
Definition: frame.hxx:949
SdrHdlList maHdlList
virtual void AddCustomHdl() override
Gets called every time the handles need to be build.
Definition: dview.cxx:208
bool MarkObj(const Point &rPnt, short nTol=-2, bool bToggle=false, bool bDeep=false)
virtual void MarkListHasChanged() override
Definition: dview.cxx:762
virtual SdrObject * SetObjectOrdNum(size_t nOldObjNum, size_t nNewObjNum)
void StartAllAction()
Set up Start-/EndAction for all Shells on an as high as possible (Shell section) level.
Definition: pagechg.cxx:1864
const SwFrame * GetAnchorFrame() const
SwGrfNode * GetGrfNode()
Definition: ndgrf.hxx:155
const SwFrame * CalcAnchor()
Definition: dview.cxx:670
void EndAllAction(bool bVirDev=false)
Definition: pagechg.cxx:1876
Point GetFrameAnchorPos(bool bIgnoreFlysAnchoredAtThisFrame) const
returns the position for anchors based on frame direction
Definition: ssfrm.cxx:289
SdrModel * GetModel() const
virtual bool TakeDragLimit(SdrDragMode eMode, tools::Rectangle &rRect) const override
Definition: dview.cxx:652
Point TopRight() const
void AddHdl(std::unique_ptr< SdrHdl > pHdl)
virtual void DeleteMarked() override
Definition: dview.cxx:947
long Y() const
SdrPageView * GetPageView()
Definition: viewimp.hxx:158
void DisposeAccessibleFrame(const SwFrame *pFrame, bool bRecursive=false)
Definition: viewimp.hxx:279
bool IsProtected() const
Is the Frame or rather the Section in which it lies protected?
Definition: trvlfrm.cxx:1622
bool IsObjMarked(SdrObject const *pObj) const
virtual SdrUndoManager * getSdrUndoManagerForEnhancedTextEdit() const override
Definition: dview.cxx:987
virtual void ModelHasChanged() override
Definition: dview.cxx:769