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