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>
22 #include <svx/svdpage.hxx>
23 #include <svx/svdpagv.hxx>
24 #include <svx/fmmodel.hxx>
25 #include <sot/exchange.hxx>
26 #include <svx/sdrundomanager.hxx>
27 #include <tools/globname.hxx>
28 #include <editeng/outliner.hxx>
29 #include <osl/diagnose.h>
30 #include <com/sun/star/embed/EmbedMisc.hpp>
31 #include <com/sun/star/embed/XEmbeddedObject.hpp>
32 
33 #include <pagefrm.hxx>
34 #include <rootfrm.hxx>
35 #include <cntfrm.hxx>
36 #include <notxtfrm.hxx>
37 #include <flyfrm.hxx>
38 #include <frmfmt.hxx>
39 #include <dflyobj.hxx>
40 #include <dcontact.hxx>
41 #include <textboxhelper.hxx>
42 #include <viewsh.hxx>
43 #include <viewimp.hxx>
44 #include <dview.hxx>
45 #include <doc.hxx>
46 #include <mdiexp.hxx>
47 #include <ndole.hxx>
48 #include <ndgrf.hxx>
49 #include <fmtanchr.hxx>
50 #include <IDocumentUndoRedo.hxx>
53 
54 #include <com/sun/star/embed/Aspects.hpp>
55 
56 #include <vector>
57 
58 #include <sortedobjs.hxx>
59 #include <UndoManager.hxx>
60 
61 using namespace com::sun::star;
62 
63 namespace {
64 
65 class SwSdrHdl : public SdrHdl
66 {
67 public:
68  SwSdrHdl(const Point& rPnt, bool bTopRight ) :
69  SdrHdl( rPnt, bTopRight ? SdrHdlKind::Anchor_TR : SdrHdlKind::Anchor ) {}
70  virtual bool IsFocusHdl() const override;
71 };
72 
73 }
74 
75 bool SwSdrHdl::IsFocusHdl() const
76 {
77  if( SdrHdlKind::Anchor == eKind || SdrHdlKind::Anchor_TR == eKind )
78  return true;
79  return SdrHdl::IsFocusHdl();
80 }
81 
82 static const SwFrame *lcl_FindAnchor( const SdrObject *pObj, bool bAll )
83 {
84  const SwVirtFlyDrawObj *pVirt = dynamic_cast< const SwVirtFlyDrawObj *>( pObj );
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
123 
124  // #i74769#, #i75172# Use default from the configuration
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 = CalcAnchor();
229  if(nullptr == pAnch)
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 
240  // Invalidate/recalc LastCharRect which can contain invalid frame offset because
241  // of later frame changes
242  pAnchoredObj->CheckCharRectAndTopOfLine(false);
243 
244  SwRect aAutoPos = pAnchoredObj->GetLastCharRect();
245  if ( aAutoPos.Height() )
246  {
247  aPos = aAutoPos.Pos();
248  }
249  }
250 
251  // add anchor handle:
252  std::unique_ptr<SdrHdl> hdl = std::make_unique<SwSdrHdl>( aPos, ( pAnch->IsVertical() && !pAnch->IsVertLR() ) ||
253  pAnch->IsRightToLeft() );
254  hdl->SetObjHdlNum(maHdlList.GetHdlCount());
255  maHdlList.AddHdl(std::move(hdl));
256 }
257 
259 {
260  if ( GetUserCall(pObj) )
261  {
262  const SwFrame *pAnch = ::lcl_FindAnchor( pObj, false );
263  if ( pAnch )
264  {
265  //The topmost Obj within the anchor must not be overtaken.
266  const SwFlyFrame *pFly = pAnch->FindFlyFrame();
267  if ( pFly )
268  {
269  const SwPageFrame *pPage = pFly->FindPageFrame();
270  if ( pPage->GetSortedObjs() )
271  {
272  size_t nOrdNum = 0;
273  for (SwAnchoredObject* i : *pPage->GetSortedObjs())
274  {
275  const SdrObject *pO = i->GetDrawObj();
276 
277  if ( pO->GetOrdNumDirect() > nOrdNum )
278  {
279  const SwFrame *pTmpAnch = ::lcl_FindAnchor( pO, false );
280  if ( pFly->IsAnLower( pTmpAnch ) )
281  {
282  nOrdNum = pO->GetOrdNumDirect();
283  }
284  }
285  }
286  if ( nOrdNum )
287  {
288  SdrPage *pTmpPage = GetModel()->GetPage( 0 );
289  ++nOrdNum;
290  if ( nOrdNum < pTmpPage->GetObjCount() )
291  {
292  return pTmpPage->GetObj( nOrdNum );
293  }
294  }
295  }
296  }
297  }
298  }
299  return nullptr;
300 }
301 
303 {
304  if ( GetUserCall(pObj) )
305  {
306  const SwFrame *pAnch = ::lcl_FindAnchor( pObj, false );
307  if ( pAnch )
308  {
309  //The Fly of the anchor must not be "flying under".
310  const SwFlyFrame *pFly = pAnch->FindFlyFrame();
311  if ( pFly )
312  {
313  SdrObject *pRet = const_cast<SdrObject*>(static_cast<SdrObject const *>(pFly->GetVirtDrawObj()));
314  return pRet != pObj ? pRet : nullptr;
315  }
316  }
317  }
318  return nullptr;
319 }
320 
322 sal_uInt32 SwDrawView::GetMaxChildOrdNum( const SwFlyFrame& _rParentObj,
323  const SdrObject* _pExclChildObj )
324 {
325  sal_uInt32 nMaxChildOrdNum = _rParentObj.GetDrawObj()->GetOrdNum();
326 
327  const SdrPage* pDrawPage = _rParentObj.GetDrawObj()->getSdrPageFromSdrObject();
328  OSL_ENSURE( pDrawPage,
329  "<SwDrawView::GetMaxChildOrdNum(..) - missing drawing page at parent object - crash!" );
330 
331  const size_t nObjCount = pDrawPage->GetObjCount();
332  for ( size_t i = nObjCount-1; i > _rParentObj.GetDrawObj()->GetOrdNum() ; --i )
333  {
334  const SdrObject* pObj = pDrawPage->GetObj( i );
335 
336  // Don't consider 'child' object <_pExclChildObj>
337  if ( pObj == _pExclChildObj )
338  {
339  continue;
340  }
341 
342  if ( pObj->GetOrdNum() > nMaxChildOrdNum &&
343  _rParentObj.IsAnLower( lcl_FindAnchor( pObj, true ) ) )
344  {
345  nMaxChildOrdNum = pObj->GetOrdNum();
346  break;
347  }
348  }
349 
350  return nMaxChildOrdNum;
351 }
352 
354 void SwDrawView::MoveRepeatedObjs( const SwAnchoredObject& _rMovedAnchoredObj,
355  const std::vector<SdrObject*>& _rMovedChildObjs ) const
356 {
357  // determine 'repeated' objects of already moved object <_rMovedAnchoredObj>
358  std::vector<SwAnchoredObject*> aAnchoredObjs;
359  {
360  const SwContact* pContact = ::GetUserCall( _rMovedAnchoredObj.GetDrawObj() );
361  assert(pContact && "SwDrawView::MoveRepeatedObjs(..) - missing contact object -> crash.");
362  pContact->GetAnchoredObjs( aAnchoredObjs );
363  }
364 
365  // check, if 'repeated' objects exists.
366  if ( aAnchoredObjs.size() <= 1 )
367  return;
368 
369  SdrPage* pDrawPage = GetModel()->GetPage( 0 );
370 
371  // move 'repeated' ones to the same order number as the already moved one.
372  const size_t nNewPos = _rMovedAnchoredObj.GetDrawObj()->GetOrdNum();
373  while ( !aAnchoredObjs.empty() )
374  {
375  SwAnchoredObject* pAnchoredObj = aAnchoredObjs.back();
376  if ( pAnchoredObj != &_rMovedAnchoredObj )
377  {
378  pDrawPage->SetObjectOrdNum( pAnchoredObj->GetDrawObj()->GetOrdNum(),
379  nNewPos );
380  pDrawPage->RecalcObjOrdNums();
381  // adjustments for accessibility API
382  if ( auto pTmpFlyFrame = pAnchoredObj->DynCastFlyFrame() )
383  {
384  m_rImp.DisposeAccessibleFrame( pTmpFlyFrame );
385  m_rImp.AddAccessibleFrame( pTmpFlyFrame );
386  }
387  else
388  {
389  m_rImp.DisposeAccessibleObj(pAnchoredObj->GetDrawObj(), true);
390  m_rImp.AddAccessibleObj( pAnchoredObj->GetDrawObj() );
391  }
392  }
393  aAnchoredObjs.pop_back();
394  }
395 
396  // move 'repeated' ones of 'child' objects
397  for ( SdrObject* pChildObj : _rMovedChildObjs )
398  {
399  {
400  const SwContact* pContact = ::GetUserCall( pChildObj );
401  assert(pContact && "SwDrawView::MoveRepeatedObjs(..) - missing contact object -> crash.");
402  pContact->GetAnchoredObjs( aAnchoredObjs );
403  }
404  // move 'repeated' ones to the same order number as the already moved one.
405  const size_t nTmpNewPos = pChildObj->GetOrdNum();
406  while ( !aAnchoredObjs.empty() )
407  {
408  SwAnchoredObject* pAnchoredObj = aAnchoredObjs.back();
409  if ( pAnchoredObj->GetDrawObj() != pChildObj )
410  {
411  pDrawPage->SetObjectOrdNum( pAnchoredObj->GetDrawObj()->GetOrdNum(),
412  nTmpNewPos );
413  pDrawPage->RecalcObjOrdNums();
414  // adjustments for accessibility API
415  if ( auto pTmpFlyFrame = pAnchoredObj->DynCastFlyFrame() )
416  {
417  m_rImp.DisposeAccessibleFrame( pTmpFlyFrame );
418  m_rImp.AddAccessibleFrame( pTmpFlyFrame );
419  }
420  else
421  {
422  m_rImp.DisposeAccessibleObj(pAnchoredObj->GetDrawObj(), true);
423  m_rImp.AddAccessibleObj( pAnchoredObj->GetDrawObj() );
424  }
425  }
426  aAnchoredObjs.pop_back();
427  }
428  }
429 }
430 
431 // --> adjustment and re-factoring of method
432 void SwDrawView::ObjOrderChanged( SdrObject* pObj, size_t nOldPos,
433  size_t nNewPos )
434 {
435  // nothing to do for group members
436  if ( pObj->getParentSdrObjectFromSdrObject() )
437  {
438  return;
439  }
440 
441  // determine drawing page and assure that the order numbers are correct.
442  SdrPage* pDrawPage = GetModel()->GetPage( 0 );
443  if ( pDrawPage->IsObjOrdNumsDirty() )
444  pDrawPage->RecalcObjOrdNums();
445  const size_t nObjCount = pDrawPage->GetObjCount();
446 
447  SwAnchoredObject* pMovedAnchoredObj =
448  ::GetUserCall( pObj )->GetAnchoredObj( pObj );
449  const SwFlyFrame* pParentAnchoredObj =
450  pMovedAnchoredObj->GetAnchorFrame()->FindFlyFrame();
451 
452  const bool bMovedForward = nOldPos < nNewPos;
453 
454  // assure for a 'child' object, that it doesn't exceed the limits of its 'parent'
455  if ( pParentAnchoredObj )
456  {
457  if ( bMovedForward )
458  {
459  const size_t nMaxChildOrdNumWithoutMoved =
460  GetMaxChildOrdNum( *pParentAnchoredObj, pMovedAnchoredObj->GetDrawObj() );
461  if ( nNewPos > nMaxChildOrdNumWithoutMoved+1 )
462  {
463  // set position to the top of the 'child' object group
464  pDrawPage->SetObjectOrdNum( nNewPos, nMaxChildOrdNumWithoutMoved+1 );
465  nNewPos = nMaxChildOrdNumWithoutMoved+1;
466  }
467  }
468  else
469  {
470  const size_t nParentOrdNum = pParentAnchoredObj->GetDrawObj()->GetOrdNum();
471  if ( nNewPos < nParentOrdNum )
472  {
473  // set position to the bottom of the 'child' object group
474  pDrawPage->SetObjectOrdNum( nNewPos, nParentOrdNum );
475  nNewPos = nParentOrdNum;
476  }
477  }
478  if ( pDrawPage->IsObjOrdNumsDirty() )
479  pDrawPage->RecalcObjOrdNums();
480  }
481 
482  // Assure, that object isn't positioned between 'repeated' ones
483  if ( ( bMovedForward && nNewPos < nObjCount - 1 ) ||
484  ( !bMovedForward && nNewPos > 0 ) )
485  {
486  const SdrObject* pTmpObj =
487  pDrawPage->GetObj( bMovedForward ? nNewPos - 1 : nNewPos + 1 );
488  if ( pTmpObj )
489  {
490  size_t nTmpNewPos( nNewPos );
491  if ( bMovedForward )
492  {
493  // move before the top 'repeated' object
494  const sal_uInt32 nTmpMaxOrdNum =
495  ::GetUserCall( pTmpObj )->GetMaxOrdNum();
496  if ( nTmpMaxOrdNum > nNewPos )
497  nTmpNewPos = nTmpMaxOrdNum;
498  }
499  else
500  {
501  // move behind the bottom 'repeated' object
502  const sal_uInt32 nTmpMinOrdNum =
503  ::GetUserCall( pTmpObj )->GetMinOrdNum();
504  if ( nTmpMinOrdNum < nNewPos )
505  nTmpNewPos = nTmpMinOrdNum;
506  }
507  if ( nTmpNewPos != nNewPos )
508  {
509  pDrawPage->SetObjectOrdNum( nNewPos, nTmpNewPos );
510  nNewPos = nTmpNewPos;
511  pDrawPage->RecalcObjOrdNums();
512  }
513  }
514  }
515 
516  // On move forward, assure that object is moved before its own children.
517  // Only Writer fly frames can have children.
518  if ( pMovedAnchoredObj->DynCastFlyFrame() &&
519  bMovedForward && nNewPos < nObjCount - 1 )
520  {
521  sal_uInt32 nMaxChildOrdNum =
522  GetMaxChildOrdNum( *static_cast<const SwFlyFrame*>(pMovedAnchoredObj) );
523  if ( nNewPos < nMaxChildOrdNum )
524  {
525  // determine position before the object before its top 'child' object
526  const SdrObject* pTmpObj = pDrawPage->GetObj( nMaxChildOrdNum );
527  size_t nTmpNewPos = ::GetUserCall( pTmpObj )->GetMaxOrdNum() + 1;
528  if ( nTmpNewPos >= nObjCount )
529  {
530  --nTmpNewPos;
531  }
532  // assure, that determined position isn't between 'repeated' objects
533  pTmpObj = pDrawPage->GetObj( nTmpNewPos );
534  nTmpNewPos = ::GetUserCall( pTmpObj )->GetMaxOrdNum();
535  // apply new position
536  pDrawPage->SetObjectOrdNum( nNewPos, nTmpNewPos );
537  nNewPos = nTmpNewPos;
538  pDrawPage->RecalcObjOrdNums();
539  }
540  }
541 
542  // Assure, that object isn't positioned between nested objects
543  if ( ( bMovedForward && nNewPos < nObjCount - 1 ) ||
544  ( !bMovedForward && nNewPos > 0 ) )
545  {
546  size_t nTmpNewPos( nNewPos );
547  const SwFrameFormat* pParentFrameFormat =
548  pParentAnchoredObj ? &(pParentAnchoredObj->GetFrameFormat()) : nullptr;
549  const SdrObject* pTmpObj = pDrawPage->GetObj( nNewPos + 1 );
550  while ( pTmpObj )
551  {
552  // #i38563# - assure, that anchor frame exists.
553  // If object is anchored inside an invisible part of the document
554  // (e.g. page header, whose page style isn't applied, or hidden
555  // section), no anchor frame exists.
556  const SwFrame* pTmpAnchorFrame = lcl_FindAnchor( pTmpObj, true );
557  const SwFlyFrame* pTmpParentObj = pTmpAnchorFrame
558  ? pTmpAnchorFrame->FindFlyFrame() : nullptr;
559  if ( pTmpParentObj &&
560  &(pTmpParentObj->GetFrameFormat()) != pParentFrameFormat )
561  {
562  if ( bMovedForward )
563  {
564  nTmpNewPos = ::GetUserCall( pTmpObj )->GetMaxOrdNum();
565  pTmpObj = pDrawPage->GetObj( nTmpNewPos + 1 );
566  }
567  else
568  {
569  nTmpNewPos = ::GetUserCall( pTmpParentObj->GetDrawObj() )
570  ->GetMinOrdNum();
571  pTmpObj = pTmpParentObj->GetDrawObj();
572  }
573  }
574  else
575  break;
576  }
577  if ( nTmpNewPos != nNewPos )
578  {
579  pDrawPage->SetObjectOrdNum( nNewPos, nTmpNewPos );
580  nNewPos = nTmpNewPos;
581  pDrawPage->RecalcObjOrdNums();
582  }
583  }
584 
585  // setup collection of moved 'child' objects to move its 'repeated' objects.
586  std::vector< SdrObject* > aMovedChildObjs;
587 
588  // move 'children' accordingly
589  if ( auto pFlyFrame = pMovedAnchoredObj->DynCastFlyFrame() )
590  {
591  // adjustments for accessibility API
592  m_rImp.DisposeAccessibleFrame( pFlyFrame );
593  m_rImp.AddAccessibleFrame( pFlyFrame );
594 
595  const sal_uInt32 nChildNewPos = bMovedForward ? nNewPos : nNewPos+1;
596  size_t i = bMovedForward ? nOldPos : nObjCount-1;
597  do
598  {
599  SdrObject* pTmpObj = pDrawPage->GetObj( i );
600  if ( pTmpObj == pObj )
601  break;
602 
603  // #i38563# - assure, that anchor frame exists.
604  // If object is anchored inside an invisible part of the document
605  // (e.g. page header, whose page style isn't applied, or hidden
606  // section), no anchor frame exists.
607  const SwFrame* pTmpAnchorFrame = lcl_FindAnchor( pTmpObj, true );
608  const SwFlyFrame* pTmpParentObj = pTmpAnchorFrame
609  ? pTmpAnchorFrame->FindFlyFrame() : nullptr;
610  if ( pTmpParentObj &&
611  ( ( pTmpParentObj == pFlyFrame ) ||
612  ( pFlyFrame->IsUpperOf( *pTmpParentObj ) ) ) )
613  {
614  // move child object.,
615  pDrawPage->SetObjectOrdNum( i, nChildNewPos );
616  pDrawPage->RecalcObjOrdNums();
617  // collect 'child' object
618  aMovedChildObjs.push_back( pTmpObj );
619  // adjustments for accessibility API
620  if ( auto pFlyDrawObj = dynamic_cast<SwVirtFlyDrawObj *>( pTmpObj ) )
621  {
622  const SwFlyFrame *pTmpFlyFrame = pFlyDrawObj->GetFlyFrame();
623  m_rImp.DisposeAccessibleFrame( pTmpFlyFrame );
624  m_rImp.AddAccessibleFrame( pTmpFlyFrame );
625  }
626  else
627  {
628  m_rImp.DisposeAccessibleObj(pTmpObj, true);
629  m_rImp.AddAccessibleObj( pTmpObj );
630  }
631  }
632  else
633  {
634  // adjust loop counter
635  if ( bMovedForward )
636  ++i;
637  else if (i > 0)
638  --i;
639  }
640 
641  } while ( ( bMovedForward && i < ( nObjCount - aMovedChildObjs.size() ) ) ||
642  ( !bMovedForward && i > ( nNewPos + aMovedChildObjs.size() ) ) );
643  }
644  else
645  {
646  // adjustments for accessibility API
647  m_rImp.DisposeAccessibleObj(pObj, true);
648  m_rImp.AddAccessibleObj( pObj );
649  }
650 
651  MoveRepeatedObjs( *pMovedAnchoredObj, aMovedChildObjs );
652 }
653 
655  tools::Rectangle& rRect ) const
656 {
657  const SdrMarkList &rMrkList = GetMarkedObjectList();
658  bool bRet = false;
659  if( 1 == rMrkList.GetMarkCount() )
660  {
661  const SdrObject *pObj = rMrkList.GetMark( 0 )->GetMarkedSdrObj();
662  SwRect aRect;
663  if( ::CalcClipRect( pObj, aRect, eMode == SdrDragMode::Move ) )
664  {
665  rRect = aRect.SVRect();
666  bRet = true;
667  }
668  }
669  return bRet;
670 }
671 
673 {
674  const SdrMarkList &rMrkList = GetMarkedObjectList();
675  if ( rMrkList.GetMarkCount() != 1 )
676  return nullptr;
677 
678  SdrObject* pObj = rMrkList.GetMark( 0 )->GetMarkedSdrObj();
679 
680  //Search for paragraph bound objects, otherwise only the
681  //current anchor. Search only if we currently drag.
682  const SwFrame* pAnch;
683  tools::Rectangle aMyRect;
684  auto pFlyDrawObj = dynamic_cast<SwVirtFlyDrawObj *>( pObj );
685  if ( pFlyDrawObj )
686  {
687  pAnch = pFlyDrawObj->GetFlyFrame()->GetAnchorFrame();
688  aMyRect = pFlyDrawObj->GetFlyFrame()->getFrameArea().SVRect();
689  }
690  else
691  {
692  SwDrawContact *pC = static_cast<SwDrawContact*>(GetUserCall(pObj));
693  // determine correct anchor position for 'virtual' drawing objects.
694  // #i26791#
695  pAnch = pC->GetAnchorFrame( pObj );
696  if( !pAnch )
697  {
698  pC->ConnectToLayout();
699  // determine correct anchor position for 'virtual' drawing objects.
700  // #i26791#
701  pAnch = pC->GetAnchorFrame( pObj );
702  }
703  aMyRect = pObj->GetSnapRect();
704  }
705 
706  const bool bTopRight = pAnch && ( ( pAnch->IsVertical() &&
707  !pAnch->IsVertLR() ) ||
708  pAnch->IsRightToLeft() );
709  const Point aMyPt = bTopRight ? aMyRect.TopRight() : aMyRect.TopLeft();
710 
711  Point aPt;
712  if ( IsAction() )
713  {
714  if ( !TakeDragObjAnchorPos( aPt, bTopRight ) )
715  return nullptr;
716  }
717  else
718  {
719  tools::Rectangle aRect = pObj->GetSnapRect();
720  aPt = bTopRight ? aRect.TopRight() : aRect.TopLeft();
721  }
722 
723  if ( aPt != aMyPt )
724  {
725  if ( pAnch && pAnch->IsContentFrame() )
726  {
727  // allow drawing objects in header/footer,
728  // but exclude control objects.
729  bool bBodyOnly = CheckControlLayer( pObj );
730  pAnch = ::FindAnchor( static_cast<const SwContentFrame*>(pAnch), aPt, bBodyOnly );
731  }
732  else if ( !pFlyDrawObj )
733  {
734  const SwRect aRect( aPt.getX(), aPt.getY(), 1, 1 );
735 
736  SwDrawContact* pContact = static_cast<SwDrawContact*>(GetUserCall(pObj));
737  if ( pContact->GetAnchorFrame( pObj ) &&
738  pContact->GetAnchorFrame( pObj )->IsPageFrame() )
739  pAnch = pContact->GetPageFrame();
740  else
741  pAnch = pContact->FindPage( aRect );
742  }
743  }
744  if( pAnch && !pAnch->IsProtected() )
745  m_aAnchorPoint = pAnch->GetFrameAnchorPos( ::HasWrap( pObj ) );
746  else
747  pAnch = nullptr;
748  return pAnch;
749 }
750 
752 {
753  SdrHdl* pHdl = maHdlList.GetHdl(SdrHdlKind::Anchor);
754  if ( ! pHdl )
755  pHdl = maHdlList.GetHdl(SdrHdlKind::Anchor_TR);
756 
757  if(pHdl)
758  {
759  CalcAnchor();
760  pHdl->SetPos(m_aAnchorPoint);
761  }
762 }
763 
765 {
766  Imp().GetShell()->DrawSelChanged();
768 }
769 
770 // #i7672#
772 {
773  // The ModelHasChanged() call in DrawingLayer also updates
774  // an eventually active text edit view (OutlinerView). This also leads
775  // to newly setting the background color for that edit view. Thus,
776  // this method rescues the current background color if an OutlinerView
777  // exists and re-establishes it then. To be more safe, the OutlinerView
778  // will be fetched again (maybe textedit has ended).
780  Color aBackColor;
781  bool bColorWasSaved(false);
782 
783  if(pView)
784  {
785  aBackColor = pView->GetBackgroundColor();
786  bColorWasSaved = true;
787  }
788 
789  // call parent
791 
792  if(bColorWasSaved)
793  {
794  pView = GetTextEditOutlinerView();
795 
796  if(pView)
797  {
798  pView->SetBackgroundColor(aBackColor);
799  }
800  }
801 }
802 
804 {
805  OSL_ENSURE( m_rImp.GetShell()->GetWin(), "MakeVisible, unknown Window");
806  m_rImp.GetShell()->MakeVisible( SwRect( rRect ) );
807 }
808 
810 {
812 
813  //In addition to the existing flags of the objects themselves,
814  //which are evaluated by the DrawingEngine, other circumstances
815  //lead to a protection.
816  //Objects that are anchored in frames need to be protected
817  //if the content of the frame is protected.
818  //OLE-Objects may themselves wish a resize protection (StarMath)
819 
820  const SdrMarkList &rMrkList = GetMarkedObjectList();
821  bool bProtect = false;
822  bool bSzProtect = false;
823  bool bRotate(false);
824 
825  for ( size_t i = 0; !bProtect && i < rMrkList.GetMarkCount(); ++i )
826  {
827  const SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
828  const SwFrame *pFrame = nullptr;
829  if ( auto pVirtFlyDrawObj = dynamic_cast< const SwVirtFlyDrawObj *>( pObj ) )
830  {
831  const SwFlyFrame *pFly = pVirtFlyDrawObj->GetFlyFrame();
832  if ( pFly )
833  {
834  pFrame = pFly->GetAnchorFrame();
835  if ( pFly->Lower() && pFly->Lower()->IsNoTextFrame() )
836  {
837  const SwNoTextFrame *const pNTF(static_cast<const SwNoTextFrame*>(pFly->Lower()));
838  const SwOLENode *const pOLENd = pNTF->GetNode()->GetOLENode();
839  const SwGrfNode *const pGrfNd = pNTF->GetNode()->GetGrfNode();
840 
841  if ( pOLENd )
842  {
843  const uno::Reference < embed::XEmbeddedObject > xObj = const_cast< SwOLEObj& >(pOLENd->GetOLEObj()).GetOleRef();
844 
845  if ( xObj.is() )
846  {
847  // --> improvement for the future, when more
848  // than one Writer fly frame can be selected.
849 
850  // TODO/LATER: retrieve Aspect - from where?!
851  bSzProtect |= ( embed::EmbedMisc::EMBED_NEVERRESIZE & xObj->getStatus( embed::Aspects::MSOLE_CONTENT ) ) != 0;
852 
853  // #i972: protect position if it is a Math object anchored 'as char' and baseline alignment is activated
854  SwDoc* pDoc = Imp().GetShell()->GetDoc();
855  const bool bProtectMathPos = SotExchange::IsMath( xObj->getClassID() )
856  && RndStdIds::FLY_AS_CHAR == pFly->GetFormat()->GetAnchor().GetAnchorId()
858  if (bProtectMathPos)
859  m_bMoveProtect = true;
860  }
861  }
862  else if(pGrfNd)
863  {
864  // RotGrfFlyFrame: GraphicNode allows rotation(s). The loop ew are in stops
865  // as soon as bMoveProtect is set, but since rotation is valid only with
866  // a single object selected this makes no difference
867  bRotate = true;
868  }
869  }
870  }
871  }
872  else
873  {
874  SwDrawContact *pC = static_cast<SwDrawContact*>(GetUserCall(pObj));
875  if ( pC )
876  pFrame = pC->GetAnchorFrame( pObj );
877  }
878  if ( pFrame )
879  bProtect = pFrame->IsProtected(); //Frames, areas etc.
880  {
881  SwFrameFormat* pFrameFormat( ::FindFrameFormat( const_cast<SdrObject*>(pObj) ) );
882  if ( !pFrameFormat )
883  {
884  OSL_FAIL( "<SwDrawView::CheckPossibilities()> - missing frame format" );
885  bProtect = true;
886  }
887  else if ((RndStdIds::FLY_AS_CHAR == pFrameFormat->GetAnchor().GetAnchorId()) &&
888  rMrkList.GetMarkCount() > 1 )
889  {
890  bProtect = true;
891  }
892  }
893  }
894  m_bMoveProtect |= bProtect;
895  m_bResizeProtect |= bProtect || bSzProtect;
896 
897  // RotGrfFlyFrame: allow rotation when SwGrfNode is selected and not size protected
898  m_bRotateFreeAllowed |= bRotate && !bProtect;
900 }
901 
904 {
905  SdrPageView* pDrawPageView = _rMarkView.GetSdrPageView();
906  const SdrMarkList& rMarkList = _rMarkView.GetMarkedObjectList();
907 
908  if( !rMarkList.GetMarkCount() )
909  return;
910 
911  // collect marked objects in a local data structure
912  std::vector<SdrObject*> aMarkedObjs;
913  for( size_t i = 0; i < rMarkList.GetMarkCount(); ++i )
914  {
915  SdrObject* pMarkedObj = rMarkList.GetMark( i )->GetMarkedSdrObj();
916  aMarkedObjs.push_back( pMarkedObj );
917  }
918  // unmark all objects
919  _rMarkView.UnmarkAllObj();
920  // re-mark objects, but for marked <SwDrawVirtObj>-objects marked its
921  // reference object.
922  while ( !aMarkedObjs.empty() )
923  {
924  SdrObject* pMarkObj = aMarkedObjs.back();
925  if ( auto pVirtObj = dynamic_cast<SwDrawVirtObj *>( pMarkObj ) )
926  {
927  SdrObject* pRefObj = &(pVirtObj->ReferencedObj());
928  if ( !_rMarkView.IsObjMarked( pRefObj ) )
929  {
930  _rMarkView.MarkObj( pRefObj, pDrawPageView );
931  }
932  }
933  else
934  {
935  _rMarkView.MarkObj( pMarkObj, pDrawPageView );
936  }
937 
938  aMarkedObjs.pop_back();
939  }
940  // sort marked list in order to assure consistent state in drawing layer
941  _rMarkView.SortMarkedObjects();
942 }
943 
945 {
946  return m_rImp.GetShell()->GetSfxViewShell();
947 }
948 
950 {
951  SwDoc* pDoc = Imp().GetShell()->GetDoc();
953  if ( pTmpRoot )
954  pTmpRoot->StartAllAction();
956  // replace marked <SwDrawVirtObj>-objects by its reference objects.
957  if (SdrPageView* pDrawPageView = m_rImp.GetPageView())
958  {
959  ReplaceMarkedDrawVirtObjs(pDrawPageView->GetView());
960  }
961 
962  // Check what textboxes have to be deleted afterwards.
963  const SdrMarkList& rMarkList = GetMarkedObjectList();
964  std::vector<SwFrameFormat*> aTextBoxesToDelete;
965  for (size_t i = 0; i < rMarkList.GetMarkCount(); ++i)
966  {
967  SdrObject *pObject = rMarkList.GetMark(i)->GetMarkedSdrObj();
968  SwContact* pContact = GetUserCall(pObject);
969  SwFrameFormat* pFormat = pContact->GetFormat();
970  if (auto pChildren = pObject->getChildrenOfSdrObject())
971  {
972  for (size_t it = 0; it < pChildren->GetObjCount(); ++it)
974  pFormat, RES_DRAWFRMFMT, pChildren->GetObj(it)))
975  aTextBoxesToDelete.push_back(pTextBox);
976  }
977  else
979  aTextBoxesToDelete.push_back(pTextBox);
980  }
981 
982  if ( pDoc->DeleteSelection( *this ) )
983  {
986  }
987 
988  // Only delete these now: earlier deletion would clear the mark list as well.
989  // Delete in reverse order, assuming that the container is sorted by anchor positions.
990  for (int i = aTextBoxesToDelete.size() - 1; i >= 0; --i)
991  {
992  SwFrameFormat*& rpTextBox = aTextBoxesToDelete[i];
993  pDoc->getIDocumentLayoutAccess().DelLayoutFormat(rpTextBox);
994  }
995 
996  pDoc->GetIDocumentUndoRedo().EndUndo(SwUndoId::EMPTY, nullptr);
997  if( pTmpRoot )
998  pTmpRoot->EndAllAction();
999 }
1000 
1001 // support enhanced text edit for draw objects
1003 {
1004  SwDoc* pDoc = Imp().GetShell()->GetDoc();
1005 
1006  return pDoc ? &(pDoc->GetUndoManager()) : nullptr;
1007 }
1008 
1009 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool IsAnLower(const SwFrame *) const
Definition: findfrm.cxx:207
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 CheckCharRectAndTopOfLine(const bool _bCheckForParaPorInf)
check anchor character rectangle and top of line
void FrameNotify(SwViewShell *pVwSh, FlyMode eMode)
Definition: edtwin3.cxx:78
Base class for the following contact objects (frame + draw objects).
Definition: dcontact.hxx:66
const SwVirtFlyDrawObj * GetVirtDrawObj() const
Definition: fly.cxx:2783
Base class of the Writer layout elements.
Definition: frame.hxx:315
const SwRect & GetLastCharRect() const
void SetHlplVisible(bool bOn=true)
virtual const SwFlyFrameFormat * GetFormat() const override
Definition: fly.cxx:2877
size_t GetMarkCount() const
void SetPos(const Point &rPnt)
static const SwFrame * lcl_FindAnchor(const SdrObject *pObj, bool bAll)
Definition: dview.cxx:82
void SortMarkedObjects() const
bool CheckControlLayer(const SdrObject *pObj)
Definition: dcontact.cxx:679
SwOLENode * GetOLENode()
Inline methods from Node.hxx.
Definition: ndole.hxx:161
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:322
virtual void MakeVisible(const tools::Rectangle &, vcl::Window &rWin) override
Definition: dview.cxx:803
void AddAccessibleFrame(const SwFrame *pFrame)
Add a frame in the accessible view.
Definition: viewimp.hxx:294
virtual SdrObjList * getChildrenOfSdrObject() const
basegfx::B2DRange getInnerBound() const
Definition: dflyobj.cxx:335
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:188
size_t GetObjCount() const
virtual bool IsFocusHdl() const
bool DeleteSelection(SwDrawView &)
Definition: docdraw.cxx:405
SdrMark * GetMark(size_t nNum) const
void Pos(const Point &rNew)
Definition: swrect.hxx:168
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:1144
Of course Writer needs its own rectangles.
Definition: swrect.hxx:34
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:102
virtual SwFrameFormat & GetFrameFormat() override
Definition: fly.cxx:2802
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:258
Color const & GetBackgroundColor() const
wrapper class for the positioning of Writer fly frames and drawing objects
constexpr TypedWhichId< SwDrawFrameFormat > RES_DRAWFRMFMT(159)
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:803
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:134
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:1112
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:215
sal_uInt32 GetOrdNumDirect() const
const SwViewShell * GetShell() const
Only for SwViewShell::Init()
Definition: viewimp.hxx:138
void MakeVisible(const SwRect &)
Definition: viewsh.cxx:577
static SwFrameFormat * getOtherTextBoxFormat(const SwFrameFormat *pFormat, sal_uInt16 nType, SdrObject *pObject=nullptr)
If we have an associated TextFrame, then return that.
void grow(double fValue)
SfxViewShell * GetSfxViewShell() const override
See SdrMarkView::GetSfxViewShell().
Definition: dview.cxx:944
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:302
Style of a layout element.
Definition: frmfmt.hxx:59
::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:1231
void SetBufferedOverlayAllowed(bool bNew)
Shell * GetShell()
const SdrObject * GetDrawObj() const
const SwSortedObjs * GetSortedObjs() const
Definition: pagefrm.hxx:132
const SwFormatAnchor & GetAnchor(bool=true) const
Definition: fmtanchr.hxx:81
int i
uno_Any a
virtual void DrawSelChanged()
Definition: viewsh.cxx:2097
SwFrameFormat * GetFormat()
Definition: dcontact.hxx:112
RndStdIds GetAnchorId() const
Definition: fmtanchr.hxx:65
SwPageFrame * FindPageFrame()
Definition: frame.hxx:681
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
virtual const SwFlyFrame * DynCastFlyFrame() const
sal_uInt32 GetOrdNum() const
const OutlinerView * GetTextEditOutlinerView() const
virtual void ObjOrderChanged(SdrObject *pObj, size_t nOldPos, size_t nNewPos) override
Definition: dview.cxx:432
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:57
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:405
virtual void CheckPossibilities() override
Definition: dview.cxx:809
constexpr Point TopLeft() const
virtual bool IsAction() const override
size_t GetHdlCount() const
SdrHdl * GetHdl(size_t nNum) const
const SwContentNode * GetNode() const
Definition: notxtfrm.hxx:66
SwFlyFrame * GetFlyFrame()
Definition: dflyobj.hxx:128
bool IsVertLR() const
Definition: frame.hxx:980
void ShowDragAnchor()
Definition: dview.cxx:751
tools::Rectangle SVRect() const
Definition: swrect.hxx:272
static void ReplaceMarkedDrawVirtObjs(SdrMarkView &_rMarkView)
replace marked -objects by its reference object for delete marked objects.
Definition: dview.cxx:903
general base class for all free-flowing frames
Definition: flyfrm.hxx:78
SwDrawView(SwViewShellImp &rI, FmFormModel &rFmFormModel, OutputDevice *pOutDev)
Definition: dview.cxx:99
virtual void MarkListHasChanged() override
SdrDragMode
SwViewShellImp & m_rImp
Definition: dview.hxx:35
vcl::Window * GetWin() const
Definition: viewsh.hxx:337
constexpr Point TopRight() const
bool IsNoTextFrame() const
Definition: frame.hxx:1239
void ConnectToLayout(const SwFormatAnchor *pAnch=nullptr)
Inserts SdrObject in the arrays of the layout ((SwPageFrame and SwFrame).
Definition: dcontact.cxx:1785
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:354
void SetGridVisible(bool bOn)
virtual void DeleteMarked()
bool IsRightToLeft() const
Definition: frame.hxx:988
::sw::DocumentSettingManager & GetDocumentSettingManager()
Definition: doc.cxx:186
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:1058
virtual void CheckPossibilities() override
sal_uInt16 GetMarkHdlSizePixel() const
bool IsVertical() const
Definition: frame.hxx:974
static bool IsAntiAliasing()
Definition: dview.cxx:129
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:764
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:1892
const SwFrame * GetAnchorFrame() const
SwGrfNode * GetGrfNode()
Definition: ndgrf.hxx:154
const SwFrame * CalcAnchor()
Definition: dview.cxx:672
void EndAllAction(bool bVirDev=false)
Definition: pagechg.cxx:1904
Point GetFrameAnchorPos(bool bIgnoreFlysAnchoredAtThisFrame) const
returns the position for anchors based on frame direction
Definition: ssfrm.cxx:291
void Height(tools::Long nNew)
Definition: swrect.hxx:190
SdrModel * GetModel() const
virtual bool TakeDragLimit(SdrDragMode eMode, tools::Rectangle &rRect) const override
Definition: dview.cxx:654
void AddHdl(std::unique_ptr< SdrHdl > pHdl)
virtual void DeleteMarked() override
Definition: dview.cxx:949
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:1628
bool IsObjMarked(SdrObject const *pObj) const
virtual SdrUndoManager * getSdrUndoManagerForEnhancedTextEdit() const override
Definition: dview.cxx:1002
virtual void ModelHasChanged() override
Definition: dview.cxx:771