LibreOffice Module sc (master)  1
viewfun7.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 <com/sun/star/embed/NoVisualAreaSizeException.hpp>
21 #include <com/sun/star/embed/XEmbeddedObject.hpp>
22 
23 #include <svx/svditer.hxx>
24 #include <svx/svdograf.hxx>
25 #include <svx/svdoole2.hxx>
26 #include <svx/svdouno.hxx>
27 #include <svx/svdpage.hxx>
28 #include <svx/svdpagv.hxx>
29 #include <svx/svdundo.hxx>
30 #include <svtools/embedhlp.hxx>
31 #include <sfx2/objsh.hxx>
32 #include <sfx2/ipclient.hxx>
34 #include <com/sun/star/embed/Aspects.hpp>
35 #include <osl/diagnose.h>
36 
37 #include <document.hxx>
38 #include <viewfunc.hxx>
39 #include <tabvwsh.hxx>
40 #include <drawview.hxx>
41 #include <scmod.hxx>
42 #include <drwlayer.hxx>
43 #include <drwtrans.hxx>
44 #include <globstr.hrc>
45 #include <scresid.hxx>
46 #include <docuno.hxx>
47 #include <docsh.hxx>
48 #include <dragdata.hxx>
49 #include <gridwin.hxx>
50 
51 bool bPasteIsMove = false;
52 
53 using namespace com::sun::star;
54 
55 static void lcl_AdjustInsertPos( ScViewData& rData, Point& rPos, const Size& rSize )
56 {
57  SdrPage* pPage = rData.GetScDrawView()->GetModel()->GetPage( static_cast<sal_uInt16>(rData.GetTabNo()) );
58  OSL_ENSURE(pPage,"pPage ???");
59  Size aPgSize( pPage->GetSize() );
60  if (aPgSize.Width() < 0)
61  aPgSize.setWidth( -aPgSize.Width() );
62  tools::Long x = aPgSize.Width() - rPos.X() - rSize.Width();
63  tools::Long y = aPgSize.Height() - rPos.Y() - rSize.Height();
64  // if necessary: adjustments (80/200) for pixel approx. errors
65  if( x < 0 )
66  rPos.AdjustX(x + 80 );
67  if( y < 0 )
68  rPos.AdjustY(y + 200 );
69  rPos.AdjustX(rSize.Width() / 2 ); // position at paste is center
70  rPos.AdjustY(rSize.Height() / 2 );
71 }
72 
73 void ScViewFunc::PasteDraw( const Point& rLogicPos, SdrModel* pModel,
74  bool bGroup, std::u16string_view rSrcShellID, std::u16string_view rDestShellID )
75 {
76  bool bSameDocClipboard = rSrcShellID == rDestShellID;
77 
78  MakeDrawLayer();
79  Point aPos( rLogicPos );
80 
81  // MapMode at Outliner-RefDevice has to be right (as in FuText::MakeOutliner)
83  MapMode aOldMapMode;
84  OutputDevice* pRef = GetViewData().GetDocument().GetDrawLayer()->GetRefDevice();
85  if (pRef)
86  {
87  aOldMapMode = pRef->GetMapMode();
88  pRef->SetMapMode( MapMode(MapUnit::Map100thMM) );
89  }
90 
91  bool bNegativePage = GetViewData().GetDocument().IsNegativePage( GetViewData().GetTabNo() );
92 
93  SdrView* pDragEditView = nullptr;
94  ScModule* pScMod = SC_MOD();
95  const ScDragData& rData = pScMod->GetDragData();
96  ScDrawTransferObj* pDrawTrans = rData.pDrawTransfer;
97  if (pDrawTrans)
98  {
99  pDragEditView = pDrawTrans->GetDragSourceView();
100 
101  aPos -= aDragStartDiff;
102  if ( bNegativePage )
103  {
104  if (aPos.X() > 0) aPos.setX( 0 );
105  }
106  else
107  {
108  if (aPos.X() < 0) aPos.setX( 0 );
109  }
110  if (aPos.Y() < 0) aPos.setY( 0 );
111  }
112 
113  ScDrawView* pScDrawView = GetScDrawView();
114  if (bGroup)
115  pScDrawView->BegUndo( ScResId( STR_UNDO_PASTE ) );
116 
117  bool bSameDoc = ( pDragEditView && pDragEditView->GetModel() == pScDrawView->GetModel() );
118  if (bSameDoc)
119  {
120  // copy locally - incl. charts
121 
122  Point aSourceStart = pDragEditView->GetAllMarkedRect().TopLeft();
123  tools::Long nDiffX = aPos.X() - aSourceStart.X();
124  tools::Long nDiffY = aPos.Y() - aSourceStart.Y();
125 
126  // move within a page?
127 
128  if ( bPasteIsMove &&
129  pScDrawView->GetSdrPageView()->GetPage() ==
130  pDragEditView->GetSdrPageView()->GetPage() )
131  {
132  if ( nDiffX != 0 || nDiffY != 0 )
133  pDragEditView->MoveAllMarked(Size(nDiffX,nDiffY));
134  }
135  else
136  {
137  SdrModel* pDrawModel = pDragEditView->GetModel();
138  SCTAB nTab = GetViewData().GetTabNo();
139  SdrPage* pDestPage = pDrawModel->GetPage( static_cast< sal_uInt16 >( nTab ) );
140  OSL_ENSURE(pDestPage,"who is this, Page?");
141 
142  ::std::vector< OUString > aExcludedChartNames;
143  if ( pDestPage )
144  {
145  ScChartHelper::GetChartNames( aExcludedChartNames, pDestPage );
146  }
147 
148  SdrMarkList aMark = pDragEditView->GetMarkedObjectList();
149  aMark.ForceSort();
150  const size_t nMarkCnt=aMark.GetMarkCount();
151  for (size_t nm=0; nm<nMarkCnt; ++nm) {
152  const SdrMark* pM=aMark.GetMark(nm);
153  const SdrObject* pObj=pM->GetMarkedSdrObj();
154 
155  // Directly Clone to target SdrModel
156  SdrObject* pNewObj(pObj->CloneSdrObject(*pDrawModel));
157 
158  if (pNewObj!=nullptr)
159  {
160  // copy graphics within the same model - always needs new name
161  if ( dynamic_cast<const SdrGrafObj*>( pNewObj) != nullptr && !bPasteIsMove )
162  pNewObj->SetName(static_cast<ScDrawLayer*>(pDrawModel)->GetNewGraphicName());
163 
164  if (nDiffX!=0 || nDiffY!=0)
165  pNewObj->NbcMove(Size(nDiffX,nDiffY));
166  if (pDestPage)
167  pDestPage->InsertObject( pNewObj );
168  pScDrawView->AddUndo(std::make_unique<SdrUndoInsertObj>( *pNewObj ));
169 
170  if (ScDrawLayer::IsCellAnchored(*pNewObj))
171  ScDrawLayer::SetCellAnchoredFromPosition(*pNewObj, GetViewData().GetDocument(), nTab,
173  }
174  }
175 
176  if (bPasteIsMove)
177  pDragEditView->DeleteMarked();
178 
179  ScDocument& rDocument = GetViewData().GetDocument();
180  ScDocShell* pDocShell = GetViewData().GetDocShell();
181  ScModelObj* pModelObj = ( pDocShell ? comphelper::getUnoTunnelImplementation<ScModelObj>( pDocShell->GetModel() ) : nullptr );
182  if ( pDestPage && pModelObj && pDrawTrans )
183  {
184  const ScRangeListVector& rProtectedChartRangesVector( pDrawTrans->GetProtectedChartRangesVector() );
185  ScChartHelper::CreateProtectedChartListenersAndNotify( rDocument, pDestPage, pModelObj, nTab,
186  rProtectedChartRangesVector, aExcludedChartNames, bSameDoc );
187  }
188  }
189  }
190  else
191  {
192  bPasteIsMove = false; // no internal move happened
193  SdrView aView(*pModel); // #i71529# never create a base class of SdrView directly!
194  SdrPageView* pPv = aView.ShowSdrPage(aView.GetModel()->GetPage(0));
195  aView.MarkAllObj(pPv);
196  Size aSize = aView.GetAllMarkedRect().GetSize();
197  lcl_AdjustInsertPos( GetViewData(), aPos, aSize );
198 
199  // don't change marking if OLE object is active
200  // (at Drop from OLE object it would be deactivated in the middle of ExecuteDrag!)
201 
202  SdrInsertFlags nOptions = SdrInsertFlags::NONE;
203  SfxInPlaceClient* pClient = GetViewData().GetViewShell()->GetIPClient();
204  if ( pClient && pClient->IsObjectInPlaceActive() )
205  nOptions |= SdrInsertFlags::DONTMARK;
206 
207  ::std::vector< OUString > aExcludedChartNames;
208  SCTAB nTab = GetViewData().GetTabNo();
209  SdrPage* pPage = pScDrawView->GetModel()->GetPage( static_cast< sal_uInt16 >( nTab ) );
210  OSL_ENSURE( pPage, "Page?" );
211  if ( pPage )
212  {
213  ScChartHelper::GetChartNames( aExcludedChartNames, pPage );
214  }
215 
216  // #89247# Set flag for ScDocument::UpdateChartListeners() which is
217  // called during paste.
218  if ( !bSameDocClipboard )
219  GetViewData().GetDocument().SetPastingDrawFromOtherDoc( true );
220 
221  pScDrawView->Paste(*pModel, aPos, nullptr, nOptions);
222 
223  if ( !bSameDocClipboard )
224  GetViewData().GetDocument().SetPastingDrawFromOtherDoc( false );
225 
226  // Paste puts all objects on the active (front) layer
227  // controls must be on SC_LAYER_CONTROLS
228  if (pPage)
229  {
230  SdrObjListIter aIter( pPage, SdrIterMode::DeepNoGroups );
231  SdrObject* pObject = aIter.Next();
232  while (pObject)
233  {
234  if ( dynamic_cast<const SdrUnoObj*>( pObject) != nullptr && pObject->GetLayer() != SC_LAYER_CONTROLS )
235  pObject->NbcSetLayer(SC_LAYER_CONTROLS);
236 
237  if (ScDrawLayer::IsCellAnchored(*pObject))
238  ScDrawLayer::SetCellAnchoredFromPosition(*pObject, GetViewData().GetDocument(), nTab,
240 
241  pObject = aIter.Next();
242  }
243  }
244 
245  // all graphics objects must have names
246  GetViewData().GetDocument().EnsureGraphicNames();
247 
248  ScDocument& rDocument = GetViewData().GetDocument();
249  ScDocShell* pDocShell = GetViewData().GetDocShell();
250  ScModelObj* pModelObj = ( pDocShell ? comphelper::getUnoTunnelImplementation<ScModelObj>( pDocShell->GetModel() ) : nullptr );
251  const ScDrawTransferObj* pTransferObj = ScDrawTransferObj::GetOwnClipboard(ScTabViewShell::GetClipData(GetViewData().GetActiveWin()));
252  if ( pPage && pModelObj && ( pTransferObj || pDrawTrans ) )
253  {
254  const ScRangeListVector& rProtectedChartRangesVector(
255  pTransferObj ? pTransferObj->GetProtectedChartRangesVector() : pDrawTrans->GetProtectedChartRangesVector() );
256  ScChartHelper::CreateProtectedChartListenersAndNotify( rDocument, pPage, pModelObj, nTab,
257  rProtectedChartRangesVector, aExcludedChartNames, bSameDocClipboard );
258  }
259  }
260 
261  if (bGroup)
262  {
263  pScDrawView->GroupMarked();
264  pScDrawView->EndUndo();
265  }
266 
267  if (pRef)
268  pRef->SetMapMode( aOldMapMode );
269 
270  // GetViewData().GetViewShell()->SetDrawShell( true );
271  // It is not sufficient to just set the DrawShell if we pasted, for
272  // example, a chart. SetDrawShellOrSub() would only work for D&D in the
273  // same document but not if inserting from the clipboard, therefore
274  // MarkListHasChanged() is what we need.
275  pScDrawView->MarkListHasChanged();
276 
277 }
278 
279 bool ScViewFunc::PasteObject( const Point& rPos, const uno::Reference < embed::XEmbeddedObject >& xObj,
280  const Size* pDescSize, const Graphic* pReplGraph, const OUString& aMediaType, sal_Int64 nAspect )
281 {
282  MakeDrawLayer();
283  if ( xObj.is() )
284  {
285  OUString aName;
286  //TODO/MBA: is that OK?
287  comphelper::EmbeddedObjectContainer& aCnt = GetViewData().GetViewShell()->GetObjectShell()->GetEmbeddedObjectContainer();
288  if ( !aCnt.HasEmbeddedObject( xObj ) )
289  aCnt.InsertEmbeddedObject( xObj, aName );
290  else
291  aName = aCnt.GetEmbeddedObjectName( xObj );
292 
293  svt::EmbeddedObjectRef aObjRef( xObj, nAspect );
294  if ( pReplGraph )
295  aObjRef.SetGraphic( *pReplGraph, aMediaType );
296 
297  Size aSize;
298  if ( nAspect == embed::Aspects::MSOLE_ICON )
299  {
300  MapMode aMapMode( MapUnit::Map100thMM );
301  aSize = aObjRef.GetSize( &aMapMode );
302  }
303  else
304  {
305  // working with visual area can switch object to running state
306  MapUnit aMapObj = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( nAspect ) );
307  MapUnit aMap100 = MapUnit::Map100thMM;
308 
309  if ( pDescSize && pDescSize->Width() && pDescSize->Height() )
310  {
311  // use size from object descriptor if given
312  aSize = OutputDevice::LogicToLogic(*pDescSize, MapMode(aMap100), MapMode(aMapObj));
313  awt::Size aSz;
314  aSz.Width = aSize.Width();
315  aSz.Height = aSize.Height();
316  xObj->setVisualAreaSize( nAspect, aSz );
317  }
318 
319  awt::Size aSz;
320  try
321  {
322  aSz = xObj->getVisualAreaSize( nAspect );
323  }
324  catch ( embed::NoVisualAreaSizeException& )
325  {
326  // the default size will be set later
327  }
328 
329  aSize = Size( aSz.Width, aSz.Height );
330  aSize = OutputDevice::LogicToLogic(aSize, MapMode(aMapObj), MapMode(aMap100)); // for SdrOle2Obj
331 
332  if( aSize.IsEmpty() )
333  {
334  OSL_FAIL("SvObjectDescriptor::GetSize == 0");
335  aSize.setWidth( 5000 );
336  aSize.setHeight( 5000 );
337  aSize = OutputDevice::LogicToLogic(aSize, MapMode(aMap100), MapMode(aMapObj));
338  aSz.Width = aSize.Width();
339  aSz.Height = aSize.Height();
340  xObj->setVisualAreaSize( nAspect, aSz );
341  }
342  }
343 
344  // don't call AdjustInsertPos
345  Point aInsPos = rPos;
346  if ( GetViewData().GetDocument().IsNegativePage( GetViewData().GetTabNo() ) )
347  aInsPos.AdjustX( -(aSize.Width()) );
348  tools::Rectangle aRect( aInsPos, aSize );
349 
350  ScDrawView* pDrView = GetScDrawView();
351  SdrOle2Obj* pSdrObj = new SdrOle2Obj(
352  pDrView->getSdrModelFromSdrView(),
353  aObjRef,
354  aName,
355  aRect);
356 
357  SdrPageView* pPV = pDrView->GetSdrPageView();
358  pDrView->InsertObjectSafe( pSdrObj, *pPV ); // don't mark if OLE
359  GetViewData().GetViewShell()->SetDrawShell( true );
360  return true;
361  }
362  else
363  return false;
364 }
365 
366 bool ScViewFunc::PasteBitmapEx( const Point& rPos, const BitmapEx& rBmpEx )
367 {
368  Graphic aGraphic(rBmpEx);
369  return PasteGraphic( rPos, aGraphic, "" );
370 }
371 
372 bool ScViewFunc::PasteMetaFile( const Point& rPos, const GDIMetaFile& rMtf )
373 {
374  Graphic aGraphic(rMtf);
375  return PasteGraphic( rPos, aGraphic, "" );
376 }
377 
378 bool ScViewFunc::PasteGraphic( const Point& rPos, const Graphic& rGraphic,
379  const OUString& rFile )
380 {
381  MakeDrawLayer();
382  ScDrawView* pScDrawView = GetScDrawView();
383 
384  if (!pScDrawView)
385  return false;
386 
387  // #i123922# check if the drop was over an existing object; if yes, evtl. replace
388  // the graphic for a SdrGraphObj (including link state updates) or adapt the fill
389  // style for other objects
390  SdrPageView* pPageView = pScDrawView->GetSdrPageView();
391  if (pPageView)
392  {
393  SdrObject* pPickObj = pScDrawView->PickObj(rPos, pScDrawView->getHitTolLog(), pPageView);
394  if (pPickObj)
395  {
396  const OUString aBeginUndo(ScResId(STR_UNDO_DRAGDROP));
397  SdrObject* pResult = pScDrawView->ApplyGraphicToObject(
398  *pPickObj,
399  rGraphic,
400  aBeginUndo,
401  rFile);
402 
403  if (pResult)
404  {
405  // we are done; mark the modified/new object
406  pScDrawView->MarkObj(pResult, pScDrawView->GetSdrPageView());
407  return true;
408  }
409  }
410  }
411 
412  Point aPos( rPos );
413  vcl::Window* pWin = GetActiveWin();
414  MapMode aSourceMap = rGraphic.GetPrefMapMode();
415  MapMode aDestMap( MapUnit::Map100thMM );
416 
417  if (aSourceMap.GetMapUnit() == MapUnit::MapPixel)
418  {
419  // consider pixel correction, so bitmap fits to screen
420  Fraction aScaleX, aScaleY;
421  pScDrawView->CalcNormScale( aScaleX, aScaleY );
422  aDestMap.SetScaleX(aScaleX);
423  aDestMap.SetScaleY(aScaleY);
424  }
425 
426  Size aSize = pWin->LogicToLogic( rGraphic.GetPrefSize(), &aSourceMap, &aDestMap );
427 
428  if ( GetViewData().GetDocument().IsNegativePage( GetViewData().GetTabNo() ) )
429  aPos.AdjustX( -(aSize.Width()) );
430 
431  GetViewData().GetViewShell()->SetDrawShell( true );
432  tools::Rectangle aRect(aPos, aSize);
433  SdrGrafObj* pGrafObj = new SdrGrafObj(
434  pScDrawView->getSdrModelFromSdrView(),
435  rGraphic,
436  aRect);
437 
438  // path was the name of the graphic in history
439 
440  ScDrawLayer* pLayer = static_cast<ScDrawLayer*>( pScDrawView->GetModel() );
441  OUString aName = pLayer->GetNewGraphicName(); // "Graphics"
442  pGrafObj->SetName(aName);
443 
444  // don't mark if OLE
445  bool bSuccess = pScDrawView->InsertObjectSafe(pGrafObj, *pScDrawView->GetSdrPageView());
446 
447  // SetGraphicLink has to be used after inserting the object,
448  // otherwise an empty graphic is swapped in and the contact stuff crashes.
449  // See #i37444#.
450  if (bSuccess && !rFile.isEmpty())
451  pGrafObj->SetGraphicLink( rFile );
452 
453  return bSuccess;
454 }
455 
456 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Point TopLeft() const
static ScDrawTransferObj * GetOwnClipboard(const css::uno::Reference< css::datatransfer::XTransferable2 > &)
Definition: drwtrans.cxx:231
size_t GetMarkCount() const
void setWidth(tools::Long nWidth)
Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
void SetName(const OUString &rStr, const bool bSetChanged=true)
bool IsObjectInPlaceActive() const
void CalcNormScale(Fraction &rFractX, Fraction &rFractY) const
Definition: drawvie4.cxx:411
long Long
bool PasteGraphic(const Point &rPos, const Graphic &rGraphic, const OUString &rFile)
Definition: viewfun7.cxx:378
static bool IsCellAnchored(const SdrObject &rObj)
Definition: drwlayer.cxx:2411
void BegUndo()
const ContentProperties & rData
const MapMode & GetMapMode() const
bool HasEmbeddedObject(const OUString &)
SCTAB GetTabNo() const
Definition: viewdata.hxx:394
SdrMark * GetMark(size_t nNum) const
static css::uno::Reference< css::datatransfer::XTransferable2 > GetClipData(vcl::Window *pWin)
Definition: tabvwshc.cxx:486
css::uno::Reference< css::frame::XModel > GetModel() const
const ScDragData & GetDragData() const
Definition: scmod.hxx:140
virtual void InsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE)
float x
EmbeddedObjectRef * pObject
void SetMapMode()
static void CreateProtectedChartListenersAndNotify(ScDocument &rDoc, const SdrPage *pPage, ScModelObj *pModelObj, SCTAB nTab, const ScRangeListVector &rRangesVector, const ::std::vector< OUString > &rExcludedChartNames, bool bSameDoc=true)
constexpr tools::Long Width() const
static void lcl_AdjustInsertPos(ScViewData &rData, Point &rPos, const Size &rSize)
Definition: viewfun7.cxx:55
Point aDragStartDiff
Definition: drawvie4.cxx:56
bool bPasteIsMove
Definition: viewfun7.cxx:51
ScDrawTransferObj * pDrawTransfer
Definition: dragdata.hxx:21
SdrPageView * ShowSdrPage(SdrPage *pPage) override
ScDrawView * GetScDrawView()
Definition: viewdata.cxx:3075
void EndUndo()
float y
SdrObject * GetMarkedSdrObj() const
void MarkAllObj(SdrPageView *pPV=nullptr)
SdrObject * PickObj(const Point &rPnt, short nTol, SdrPageView *&rpPV, SdrSearchOptions nOptions, SdrObject **ppRootObj, bool *pbHitPassDirect=nullptr) const
static void GetChartNames(::std::vector< OUString > &rChartNames, const SdrPage *pPage)
void AddUndo(std::unique_ptr< SdrUndoAction > pUndo)
virtual void MarkListHasChanged() override
Definition: drawview.cxx:358
void SetScaleX(const Fraction &rScaleX)
bool IsEmpty() const
static void SetCellAnchoredFromPosition(SdrObject &rObj, const ScDocument &rDoc, SCTAB nTab, bool bResizeWithCell)
Definition: drwlayer.cxx:2286
#define SC_MOD()
Definition: scmod.hxx:249
Size GetSize() const
bool PasteBitmapEx(const Point &, const BitmapEx &)
Definition: viewfun7.cxx:366
const SdrMarkList & GetMarkedObjectList() const
const SdrPage * GetPage(sal_uInt16 nPgNum) const
OUString ScResId(const char *pId)
Definition: scdll.cxx:89
void SetScaleY(const Fraction &rScaleY)
MapUnit GetMapUnit() const
const tools::Rectangle & GetAllMarkedRect() const
SdrInsertFlags
Size GetSize() const
void SetGraphicLink(const OUString &rFileName)
virtual bool Paste(const SdrModel &rMod, const Point &rPos, SdrObjList *pLst, SdrInsertFlags nOptions) override
virtual SdrLayerID GetLayer() const
Size GetPrefSize() const
::std::vector< ScRangeList > ScRangeListVector
Definition: charthelper.hxx:29
OUString GetEmbeddedObjectName(const css::uno::Reference< css::embed::XEmbeddedObject > &) const
bool InsertObjectSafe(SdrObject *pObj, SdrPageView &rPV)
Definition: drawview.cxx:804
SdrObject * Next()
SfxViewShell * GetViewShell() const
void ForceSort() const
SfxInPlaceClient * GetIPClient() const
static MapUnit UnoEmbed2VCLMapUnit(sal_Int32 nUnoEmbedMapUnit)
void GroupMarked()
MapMode GetPrefMapMode() const
constexpr tools::Long Height() const
SdrPage * GetPage() const
OUString aName
virtual void DeleteMarked()
virtual SdrObject * CloneSdrObject(SdrModel &rTargetModel) const
Size GetSize(MapMode const *pTargetMapMode) const
void SetGraphic(const Graphic &rGraphic, const OUString &rMediaType)
SdrView * GetDragSourceView()
Definition: drwtrans.hxx:88
bool PasteMetaFile(const Point &, const GDIMetaFile &)
Definition: viewfun7.cxx:372
void PasteDraw()
Definition: viewfun3.cxx:466
bool InsertEmbeddedObject(const css::uno::Reference< css::embed::XEmbeddedObject > &, OUString &)
SdrPageView * GetSdrPageView() const
SdrObject * ApplyGraphicToObject(SdrObject &rHitObject, const Graphic &rGraphic, const OUString &rBeginUndoText, const OUString &rFile)
Definition: drawview.cxx:1115
void setHeight(tools::Long nHeight)
MapUnit
SdrModel & getSdrModelFromSdrView() const
bool MarkObj(const Point &rPnt, short nTol=-2, bool bToggle=false, bool bDeep=false)
bool PasteObject(const Point &, const css::uno::Reference< css::embed::XEmbeddedObject > &, const Size *, const Graphic *=nullptr, const OUString &=OUString(), sal_Int64 nAspect=css::embed::Aspects::MSOLE_CONTENT)
Definition: viewfun7.cxx:279
void MoveAllMarked(const Size &rSiz, bool bCopy=false)
sal_uInt16 getHitTolLog() const
SdrModel * GetModel() const
constexpr SdrLayerID SC_LAYER_CONTROLS(3)
static bool IsResizeWithCell(const SdrObject &rObj)
Definition: drwlayer.cxx:2418
sal_Int16 SCTAB
Definition: types.hxx:22
const ScRangeListVector & GetProtectedChartRangesVector() const
Definition: drwtrans.hxx:96
virtual void NbcSetLayer(SdrLayerID nLayer)