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