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