LibreOffice Module sc (master)  1
drawvie4.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 <svx/svditer.hxx>
21 #include <svx/svdograf.hxx>
22 #include <svx/svdogrp.hxx>
23 #include <svx/svdoole2.hxx>
24 #include <svx/svdundo.hxx>
25 #include <sfx2/docfile.hxx>
26 #include <tools/urlobj.hxx>
28 #include <sal/log.hxx>
29 
30 #include <drawview.hxx>
31 #include <global.hxx>
32 #include <drwlayer.hxx>
33 #include <viewdata.hxx>
34 #include <document.hxx>
35 #include <docsh.hxx>
36 #include <drwtrans.hxx>
37 #include <transobj.hxx>
38 #include <drawutil.hxx>
39 #include <scmod.hxx>
40 #include <globstr.hrc>
41 #include <scresid.hxx>
42 #include <gridwin.hxx>
43 #include <userdat.hxx>
44 
45 #include <com/sun/star/embed/NoVisualAreaSizeException.hpp>
46 #include <com/sun/star/embed/Aspects.hpp>
47 #include <com/sun/star/embed/XEmbeddedObject.hpp>
48 #include <com/sun/star/chart2/XChartTypeContainer.hpp>
49 #include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
50 #include <com/sun/star/chart2/XDataSeriesContainer.hpp>
51 #include <com/sun/star/chart2/XChartDocument.hpp>
52 
53 using namespace com::sun::star;
54 
56 
57 void ScDrawView::BeginDrag( vcl::Window* pWindow, const Point& rStartPos )
58 {
59  if ( !AreObjectsMarked() )
60  return;
61 
62  BrkAction();
63 
64  tools::Rectangle aMarkedRect = GetAllMarkedRect();
65 
66  aDragStartDiff = rStartPos - aMarkedRect.TopLeft();
67 
68  bool bAnyOle, bOneOle;
69  const SdrMarkList& rMarkList = GetMarkedObjectList();
70  CheckOle( rMarkList, bAnyOle, bOneOle );
71 
72  ScDocShellRef aDragShellRef;
73  if (bAnyOle)
74  {
75  aDragShellRef = new ScDocShell; // DocShell needs a Ref immediately
76  aDragShellRef->DoInitNew();
77  }
78  ScDrawLayer::SetGlobalDrawPersist( aDragShellRef.get() );
79  std::unique_ptr<SdrModel> pModel(CreateMarkedObjModel());
81 
82  // Charts now always copy their data in addition to the source reference, so
83  // there's no need to call SchDLL::Update for the charts in the clipboard doc.
84  // Update with the data (including NumberFormatter) from the live document would
85  // also store the NumberFormatter in the clipboard chart (#88749#)
86 
87  ScDocShell* pDocSh = pViewData->GetDocShell();
88 
90  pDocSh->FillTransferableObjectDescriptor( aObjDesc );
91  aObjDesc.maDisplayName = pDocSh->GetMedium()->GetURLObject().GetURLNoPass();
92  // maSize is set in ScDrawTransferObj ctor
93 
94  rtl::Reference<ScDrawTransferObj> pTransferObj = new ScDrawTransferObj( std::move(pModel), pDocSh, aObjDesc );
95 
96  pTransferObj->SetDrawPersist( aDragShellRef.get() ); // keep persist for ole objects alive
97  pTransferObj->SetDragSource( this ); // copies selection
98 
99  SC_MOD()->SetDragObject( nullptr, pTransferObj.get() ); // for internal D&D
100  pTransferObj->StartDrag( pWindow, DND_ACTION_COPYMOVE | DND_ACTION_LINK );
101 }
102 
103 namespace {
104 
105 void getRangeFromDataSource( uno::Reference< chart2::data::XDataSource > const & xDataSource, std::vector<OUString>& rRangeRep)
106 {
107  const uno::Sequence<uno::Reference<chart2::data::XLabeledDataSequence> > xSeqs = xDataSource->getDataSequences();
108  for (const uno::Reference<chart2::data::XLabeledDataSequence>& xLS : xSeqs)
109  {
110  uno::Reference<chart2::data::XDataSequence> xSeq = xLS->getValues();
111  if (xSeq.is())
112  {
113  OUString aRep = xSeq->getSourceRangeRepresentation();
114  rRangeRep.push_back(aRep);
115  }
116  xSeq = xLS->getLabel();
117  if (xSeq.is())
118  {
119  OUString aRep = xSeq->getSourceRangeRepresentation();
120  rRangeRep.push_back(aRep);
121  }
122  }
123 }
124 
125 void getRangeFromErrorBar(const uno::Reference< chart2::XChartDocument >& rChartDoc, std::vector<OUString>& rRangeRep)
126 {
127  uno::Reference <chart2::XDiagram > xDiagram = rChartDoc->getFirstDiagram();
128  if(!xDiagram.is())
129  return;
130 
131  uno::Reference< chart2::XCoordinateSystemContainer > xCooSysContainer( xDiagram, uno::UNO_QUERY);
132  if(!xCooSysContainer.is())
133  return;
134 
135  const uno::Sequence< uno::Reference< chart2::XCoordinateSystem > > xCooSysSequence( xCooSysContainer->getCoordinateSystems());
136  for(const auto& rCooSys : xCooSysSequence)
137  {
138  uno::Reference< chart2::XChartTypeContainer > xChartTypeContainer( rCooSys, uno::UNO_QUERY);
139  if(!xChartTypeContainer.is())
140  continue;
141 
142  const uno::Sequence< uno::Reference< chart2::XChartType > > xChartTypeSequence( xChartTypeContainer->getChartTypes() );
143  for(const auto& rChartType : xChartTypeSequence)
144  {
145  uno::Reference< chart2::XDataSeriesContainer > xDataSequenceContainer( rChartType, uno::UNO_QUERY);
146  if(!xDataSequenceContainer.is())
147  continue;
148 
149  const uno::Sequence< uno::Reference< chart2::XDataSeries > > xSeriesSequence( xDataSequenceContainer->getDataSeries() );
150  for(const uno::Reference<chart2::XDataSeries>& xSeries : xSeriesSequence)
151  {
152  uno::Reference< beans::XPropertySet > xPropSet( xSeries, uno::UNO_QUERY);
153  uno::Reference< chart2::data::XDataSource > xErrorBarY;
154  xPropSet->getPropertyValue("ErrorBarY") >>= xErrorBarY;
155  if(xErrorBarY.is())
156  getRangeFromDataSource(xErrorBarY, rRangeRep);
157  uno::Reference< chart2::data::XDataSource > xErrorBarX;
158  xPropSet->getPropertyValue("ErrorBarX") >>= xErrorBarX;
159  if(xErrorBarX.is())
160  getRangeFromDataSource(xErrorBarX, rRangeRep);
161  }
162  }
163  }
164 }
165 
166 void getRangeFromOle2Object(const SdrOle2Obj& rObj, std::vector<OUString>& rRangeRep)
167 {
168  if (!rObj.IsChart())
169  // not a chart object.
170  return;
171 
172  const uno::Reference<embed::XEmbeddedObject>& xObj = rObj.GetObjRef();
173  if (!xObj.is())
174  return;
175 
176  uno::Reference<chart2::XChartDocument> xChartDoc(xObj->getComponent(), uno::UNO_QUERY);
177  if (!xChartDoc.is())
178  return;
179 
180  if(xChartDoc->hasInternalDataProvider())
181  return;
182 
183  getRangeFromErrorBar(xChartDoc, rRangeRep);
184 
185  uno::Reference<chart2::data::XDataSource> xDataSource(xChartDoc, uno::UNO_QUERY);
186  if (!xDataSource.is())
187  return;
188 
189  // Get all data sources used in this chart.
190  getRangeFromDataSource(xDataSource, rRangeRep);
191 
192  return;
193 }
194 
195 // Get all cell ranges that are referenced by the selected chart objects.
196 void getOleSourceRanges(const SdrMarkList& rMarkList, bool& rAnyOle, bool& rOneOle, std::vector<ScRange>* pRanges = nullptr, const ScDocument* pDoc = nullptr )
197 {
198  bool bCalcSourceRanges = pRanges && pDoc;
199  std::vector<OUString> aRangeReps;
200  rAnyOle = rOneOle = false;
201  const size_t nCount = rMarkList.GetMarkCount();
202  for (size_t i=0; i<nCount; ++i)
203  {
204  SdrMark* pMark = rMarkList.GetMark(i);
205  if ( !pMark )
206  continue;
207 
208  SdrObject* pObj = pMark->GetMarkedSdrObj();
209  if ( !pObj )
210  continue;
211 
212  sal_uInt16 nSdrObjKind = pObj->GetObjIdentifier();
213  if (nSdrObjKind == OBJ_OLE2)
214  {
215  rAnyOle = true;
216  rOneOle = (nCount == 1);
217  if ( bCalcSourceRanges )
218  getRangeFromOle2Object( static_cast<const SdrOle2Obj&>( *pObj ), aRangeReps );
219  else
220  break;
221  }
222  else if ( dynamic_cast<const SdrObjGroup*>( pObj) != nullptr )
223  {
224  SdrObjListIter aIter( *pObj, SdrIterMode::DeepNoGroups );
225  SdrObject* pSubObj = aIter.Next();
226  while (pSubObj)
227  {
228  if ( pSubObj->GetObjIdentifier() == OBJ_OLE2 )
229  {
230  rAnyOle = true;
231  // rOneOle remains false - a group isn't treated like a single OLE object
232  if ( !bCalcSourceRanges )
233  return;
234 
235  getRangeFromOle2Object( static_cast<const SdrOle2Obj&>( *pSubObj ), aRangeReps );
236  }
237  pSubObj = aIter.Next();
238  }
239  }
240  }
241 
242  if (!bCalcSourceRanges)
243  return;
244 
245  // Compile all range representation strings into ranges.
246  for (const auto& rRangeRep : aRangeReps)
247  {
248  ScRangeList aRange;
249  ScAddress aAddr;
250  if (aRange.Parse(rRangeRep, *pDoc, pDoc->GetAddressConvention()) & ScRefFlags::VALID)
251  {
252  for(size_t i = 0; i < aRange.size(); ++i)
253  pRanges->push_back(aRange[i]);
254  }
255  else if (aAddr.Parse(rRangeRep, *pDoc, pDoc->GetAddressConvention()) & ScRefFlags::VALID)
256  pRanges->push_back(aAddr);
257  }
258 
259  return;
260 }
261 
262 class InsertTabIndex
263 {
264  std::vector<SCTAB>& mrTabs;
265 public:
266  explicit InsertTabIndex(std::vector<SCTAB>& rTabs) : mrTabs(rTabs) {}
267  void operator() (const ScRange& rRange)
268  {
269  mrTabs.push_back(rRange.aStart.Tab());
270  }
271 };
272 
273 class CopyRangeData
274 {
275  ScDocument& mrSrc;
276  ScDocument& mrDest;
277 public:
278  CopyRangeData(ScDocument& rSrc, ScDocument& rDest) : mrSrc(rSrc), mrDest(rDest) {}
279 
280  void operator() (const ScRange& rRange)
281  {
282  OUString aTabName;
283  mrSrc.GetName(rRange.aStart.Tab(), aTabName);
284 
285  SCTAB nTab;
286  if (!mrDest.GetTable(aTabName, nTab))
287  // Sheet by this name doesn't exist.
288  return;
289 
290  mrSrc.CopyStaticToDocument(rRange, nTab, mrDest);
291  }
292 };
293 
294 void copyChartRefDataToClipDoc(ScDocument& rSrcDoc, ScDocument& rClipDoc, const std::vector<ScRange>& rRanges)
295 {
296  // Get a list of referenced table indices.
297  std::vector<SCTAB> aTabs;
298  std::for_each(rRanges.begin(), rRanges.end(), InsertTabIndex(aTabs));
299  std::sort(aTabs.begin(), aTabs.end());
300  aTabs.erase(std::unique(aTabs.begin(), aTabs.end()), aTabs.end());
301 
302  // Get table names.
303  if (aTabs.empty())
304  return;
305 
306  // Create sheets only for referenced source sheets.
307  OUString aName;
308  std::vector<SCTAB>::const_iterator it = aTabs.begin(), itEnd = aTabs.end();
309  if (!rSrcDoc.GetName(*it, aName))
310  return;
311 
312  rClipDoc.SetTabNameOnLoad(0, aName); // document initially has one sheet.
313 
314  for (++it; it != itEnd; ++it)
315  {
316  if (!rSrcDoc.GetName(*it, aName))
317  return;
318 
319  rClipDoc.AppendTabOnLoad(aName);
320  }
321 
322  std::for_each(rRanges.begin(), rRanges.end(), CopyRangeData(rSrcDoc, rClipDoc));
323 }
324 
325 }
326 
327 void ScDrawView::CheckOle( const SdrMarkList& rMarkList, bool& rAnyOle, bool& rOneOle )
328 {
329  getOleSourceRanges( rMarkList, rAnyOle, rOneOle );
330 }
331 
333 {
334  const SdrMarkList& rMarkList = GetMarkedObjectList();
335  std::vector<ScRange> aRanges;
336  bool bAnyOle = false, bOneOle = false;
337  getOleSourceRanges( rMarkList, bAnyOle, bOneOle, &aRanges, &rDoc );
338 
339  // update ScGlobal::xDrawClipDocShellRef
341  if (ScGlobal::xDrawClipDocShellRef.is() && !aRanges.empty())
342  {
343  // Copy data referenced by the chart objects to the draw clip
344  // document. We need to do this before CreateMarkedObjModel() below.
346  ScDocument& rClipDoc = xDocSh->GetDocument();
347  copyChartRefDataToClipDoc(rDoc, rClipDoc, aRanges);
348  }
349  std::unique_ptr<SdrModel> pModel(CreateMarkedObjModel());
351 
352  // Charts now always copy their data in addition to the source reference, so
353  // there's no need to call SchDLL::Update for the charts in the clipboard doc.
354  // Update with the data (including NumberFormatter) from the live document would
355  // also store the NumberFormatter in the clipboard chart (#88749#)
356 
357  ScDocShell* pDocSh = pViewData->GetDocShell();
358 
360  pDocSh->FillTransferableObjectDescriptor( aObjDesc );
361  aObjDesc.maDisplayName = pDocSh->GetMedium()->GetURLObject().GetURLNoPass();
362  // maSize is set in ScDrawTransferObj ctor
363 
364  rtl::Reference<ScDrawTransferObj> pTransferObj(new ScDrawTransferObj( std::move(pModel), pDocSh, aObjDesc ));
365 
367  {
368  pTransferObj->SetDrawPersist( ScGlobal::xDrawClipDocShellRef.get() ); // keep persist for ole objects alive
369  }
370 
371  pTransferObj->CopyToClipboard( pViewData->GetActiveWin() ); // system clipboard
372 }
373 
374 uno::Reference<datatransfer::XTransferable> ScDrawView::CopyToTransferable()
375 {
376  bool bAnyOle, bOneOle;
377  const SdrMarkList& rMarkList = GetMarkedObjectList();
378  CheckOle( rMarkList, bAnyOle, bOneOle );
379 
380  // update ScGlobal::xDrawClipDocShellRef
382  std::unique_ptr<SdrModel> pModel( CreateMarkedObjModel() );
384 
385  // Charts now always copy their data in addition to the source reference, so
386  // there's no need to call SchDLL::Update for the charts in the clipboard doc.
387  // Update with the data (including NumberFormatter) from the live document would
388  // also store the NumberFormatter in the clipboard chart (#88749#)
389  // lcl_RefreshChartData( pModel, pViewData->GetDocument() );
390 
391  ScDocShell* pDocSh = pViewData->GetDocShell();
392 
394  pDocSh->FillTransferableObjectDescriptor( aObjDesc );
395  aObjDesc.maDisplayName = pDocSh->GetMedium()->GetURLObject().GetURLNoPass();
396  // maSize is set in ScDrawTransferObj ctor
397 
398  ScDrawTransferObj* pTransferObj = new ScDrawTransferObj( std::move(pModel), pDocSh, aObjDesc );
399  uno::Reference<datatransfer::XTransferable> xTransferable( pTransferObj );
400 
402  {
403  pTransferObj->SetDrawPersist( ScGlobal::xDrawClipDocShellRef.get() ); // keep persist for ole objects alive
404  }
405 
406  return xTransferable;
407 }
408 
409 // Calculate correction for 100%, regardless of current settings
410 
411 void ScDrawView::CalcNormScale( Fraction& rFractX, Fraction& rFractY ) const
412 {
413  double nPPTX = ScGlobal::nScreenPPTX;
414  double nPPTY = ScGlobal::nScreenPPTY;
415 
416  if (pViewData)
417  nPPTX /= pViewData->GetDocShell()->GetOutputFactor();
418 
419  SCCOL nEndCol = 0;
420  SCROW nEndRow = 0;
421  rDoc.GetTableArea( nTab, nEndCol, nEndRow );
422  if (nEndCol<20)
423  nEndCol = 20;
424  if (nEndRow<20)
425  nEndRow = 1000;
426 
427  Fraction aZoom(1,1);
428  ScDrawUtil::CalcScale( rDoc, nTab, 0,0, nEndCol,nEndRow, pDev, aZoom,aZoom,
429  nPPTX, nPPTY, rFractX,rFractY );
430 }
431 
433 {
434  std::unique_ptr<SdrUndoGroup> pUndoGroup(new SdrUndoGroup(*GetModel()));
435 
436  const SdrMarkList& rMarkList = GetMarkedObjectList();
437  tools::Long nDone = 0;
438  const size_t nCount = rMarkList.GetMarkCount();
439  for (size_t i=0; i<nCount; ++i)
440  {
441  SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
442  sal_uInt16 nIdent = pObj->GetObjIdentifier();
443  bool bDo = false;
444  Size aOriginalSize;
445  if (nIdent == OBJ_OLE2)
446  {
447  // TODO/LEAN: working with visual area can switch object to running state
448  uno::Reference < embed::XEmbeddedObject > xObj = static_cast<SdrOle2Obj*>(pObj)->GetObjRef();
449  if ( xObj.is() ) // NULL for an invalid object that couldn't be loaded
450  {
451  sal_Int64 nAspect = static_cast<SdrOle2Obj*>(pObj)->GetAspect();
452 
453  if ( nAspect == embed::Aspects::MSOLE_ICON )
454  {
455  MapMode aMapMode( MapUnit::Map100thMM );
456  aOriginalSize = static_cast<SdrOle2Obj*>(pObj)->GetOrigObjSize( &aMapMode );
457  bDo = true;
458  }
459  else
460  {
461  MapUnit aUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( static_cast<SdrOle2Obj*>(pObj)->GetAspect() ) );
462  try
463  {
464  awt::Size aSz = xObj->getVisualAreaSize( static_cast<SdrOle2Obj*>(pObj)->GetAspect() );
465  aOriginalSize = OutputDevice::LogicToLogic(
466  Size( aSz.Width, aSz.Height ),
467  MapMode(aUnit),
468  MapMode(MapUnit::Map100thMM));
469  bDo = true;
470  } catch( embed::NoVisualAreaSizeException& )
471  {
472  OSL_ENSURE( false, "Can't get the original size of the object!" );
473  }
474  }
475  }
476  }
477  else if (nIdent == OBJ_GRAF)
478  {
479  const Graphic& rGraphic = static_cast<SdrGrafObj*>(pObj)->GetGraphic();
480 
481  MapMode aSourceMap = rGraphic.GetPrefMapMode();
482  MapMode aDestMap( MapUnit::Map100thMM );
483  if (aSourceMap.GetMapUnit() == MapUnit::MapPixel)
484  {
485  // consider pixel correction, so that the bitmap is correct on the screen
486  Fraction aNormScaleX, aNormScaleY;
487  CalcNormScale( aNormScaleX, aNormScaleY );
488  aDestMap.SetScaleX(aNormScaleX);
489  aDestMap.SetScaleY(aNormScaleY);
490  }
491  if (pViewData)
492  {
493  vcl::Window* pActWin = pViewData->GetActiveWin();
494  if (pActWin)
495  {
496  aOriginalSize = pActWin->LogicToLogic(
497  rGraphic.GetPrefSize(), &aSourceMap, &aDestMap );
498  bDo = true;
499  }
500  }
501  }
502 
503  if ( bDo )
504  {
505  tools::Rectangle aDrawRect = pObj->GetLogicRect();
506 
507  pUndoGroup->AddAction( std::make_unique<SdrUndoGeoObj>( *pObj ) );
508  pObj->Resize( aDrawRect.TopLeft(), Fraction( aOriginalSize.Width(), aDrawRect.GetWidth() ),
509  Fraction( aOriginalSize.Height(), aDrawRect.GetHeight() ) );
510  ++nDone;
511  }
512  }
513 
514  if (nDone && pViewData)
515  {
516  pUndoGroup->SetComment(ScResId( STR_UNDO_ORIGINALSIZE ));
517  ScDocShell* pDocSh = pViewData->GetDocShell();
518  pDocSh->GetUndoManager()->AddUndoAction(std::move(pUndoGroup));
519  pDocSh->SetDrawModified();
520  }
521 }
522 
524 {
525  const SdrMarkList& rMarkList = GetMarkedObjectList();
526 
527  if (rMarkList.GetMarkCount() != 1)
528  {
529  SAL_WARN("sc.ui", "Fit to cell only works with one graphic!");
530  return;
531  }
532 
533  SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
534 
535  ScAnchorType aAnchorType = ScDrawLayer::GetAnchorType(*pObj);
536  if (aAnchorType != SCA_CELL && aAnchorType != SCA_CELL_RESIZE)
537  {
538  SAL_WARN("sc.ui", "Fit to cell only works with cell anchored graphics!");
539  return;
540  }
541 
542  ScDrawObjData* pObjData = ScDrawLayer::GetObjData(pObj);
543  if (!pObjData)
544  {
545  SAL_WARN("sc.ui", "Missing ScDrawObjData!");
546  return;
547  }
548 
549  std::unique_ptr<SdrUndoGroup> pUndoGroup(new SdrUndoGroup(*GetModel()));
550  tools::Rectangle aGraphicRect = pObj->GetSnapRect();
551  tools::Rectangle aCellRect = ScDrawLayer::GetCellRect( rDoc, pObjData->maStart, true);
552 
553  // For graphic objects, we want to keep the aspect ratio
554  if (pObj->shouldKeepAspectRatio())
555  {
556  tools::Long nWidth = aGraphicRect.GetWidth();
557  assert(nWidth && "div-by-zero");
558  double fScaleX = static_cast<double>(aCellRect.GetWidth()) / static_cast<double>(nWidth);
559  tools::Long nHeight = aGraphicRect.GetHeight();
560  assert(nHeight && "div-by-zero");
561  double fScaleY = static_cast<double>(aCellRect.GetHeight()) / static_cast<double>(nHeight);
562  double fScaleMin = std::min(fScaleX, fScaleY);
563 
564  aCellRect.setWidth(static_cast<double>(aGraphicRect.GetWidth()) * fScaleMin);
565  aCellRect.setHeight(static_cast<double>(aGraphicRect.GetHeight()) * fScaleMin);
566  }
567 
568  pUndoGroup->AddAction( std::make_unique<SdrUndoGeoObj>( *pObj ) );
569  if (pObj->GetObjIdentifier() == OBJ_CUSTOMSHAPE)
570  pObj->AdjustToMaxRect(aCellRect);
571  else
572  pObj->SetSnapRect(aCellRect);
573 
574  pUndoGroup->SetComment(ScResId( STR_UNDO_FITCELLSIZE ));
575  ScDocShell* pDocSh = pViewData->GetDocShell();
576  pDocSh->GetUndoManager()->AddUndoAction(std::move(pUndoGroup));
577 
578 }
579 
580 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Point TopLeft() const
bool IsChart() const
OBJ_GRAF
constexpr double nPPTY
ScAddress aStart
Definition: address.hxx:500
size_t GetMarkCount() const
virtual void Resize(const Point &rRef, const Fraction &xFact, const Fraction &yFact, bool bUnsetRelative=true)
OBJ_CUSTOMSHAPE
OBJ_OLE2
css::uno::Reference< css::embed::XEmbeddedObject > const & GetObjRef() const
Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
void CalcNormScale(Fraction &rFractX, Fraction &rFractY) const
Definition: drawvie4.cxx:411
static SfxObjectShell * SetDrawClipDoc(bool bAnyOle)
Definition: transobj.cxx:811
long Long
static ScDrawObjData * GetObjData(SdrObject *pObj, bool bCreate=false)
Definition: drwlayer.cxx:2282
#define DND_ACTION_COPYMOVE
tools::Long GetWidth() const
SdrMark * GetMark(size_t nNum) const
static tools::Rectangle GetCellRect(const ScDocument &rDoc, const ScAddress &rPos, bool bMergedCell)
Returns the rectangle for the passed cell address in 1/100 mm.
Definition: drwlayer.cxx:1848
void FillTransferableObjectDescriptor(TransferableObjectDescriptor &rDesc) const
ScAddress maStart
Definition: userdat.hxx:38
virtual const tools::Rectangle & GetSnapRect() const
SC_DLLPUBLIC void CopyStaticToDocument(const ScRange &rSrcRange, SCTAB nDestTab, ScDocument &rDestDoc)
Copy only raw cell values to another document.
Definition: document.cxx:2247
virtual SfxUndoManager * GetUndoManager() override
Definition: docsh.cxx:2805
static void SetGlobalDrawPersist(SfxObjectShell *pPersist)
Definition: drwlayer.cxx:2335
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
int nCount
SC_DLLPUBLIC bool GetTable(const OUString &rName, SCTAB &rTab) const
Definition: document.cxx:260
SCTAB Tab() const
Definition: address.hxx:271
void BeginDrag(vcl::Window *pWindow, const Point &rStartPos)
Definition: drawvie4.cxx:57
constexpr double nPPTX
void SetTabNameOnLoad(SCTAB nTab, const OUString &rName)
Definition: document.cxx:484
SdrObject * GetMarkedSdrObj() const
ScAnchorType
Definition: global.hxx:383
T * get() const
virtual void AddUndoAction(std::unique_ptr< SfxUndoAction > pAction, bool bTryMerg=false)
void SetScaleX(const Fraction &rScaleX)
static void CheckOle(const SdrMarkList &rMarkList, bool &rAnyOle, bool &rOneOle)
Definition: drawvie4.cxx:327
int i
virtual sal_uInt16 GetObjIdentifier() const
static ScAnchorType GetAnchorType(const SdrObject &)
Definition: drwlayer.cxx:2150
sal_Int16 SCCOL
Definition: types.hxx:22
static tools::SvRef< ScDocShell > xDrawClipDocShellRef
Definition: global.hxx:581
static SC_DLLPUBLIC double nScreenPPTY
Vertical pixel per twips factor.
Definition: global.hxx:579
#define SC_MOD()
Definition: scmod.hxx:253
virtual void AdjustToMaxRect(const tools::Rectangle &rMaxRect, bool bShrinkOnly=false)
tools::Long Width() const
ScRefFlags Parse(const OUString &, const ScDocument &, formula::FormulaGrammar::AddressConvention eConv=formula::FormulaGrammar::CONV_OOO, SCTAB nDefaultTab=0, sal_Unicode cDelimiter=0)
Definition: rangelst.cxx:106
size_t size() const
Definition: rangelst.hxx:90
OUString ScResId(const char *pId)
Definition: scdll.cxx:95
void SetScaleY(const Fraction &rScaleY)
MapUnit GetMapUnit() const
#define DND_ACTION_LINK
Size GetPrefSize() const
sal_Int32 SCROW
Definition: types.hxx:18
void SetMarkedOriginalSize()
Definition: drawvie4.cxx:432
void AppendTabOnLoad(const OUString &rName)
Definition: document.cxx:472
static MapUnit UnoEmbed2VCLMapUnit(sal_Int32 nUnoEmbedMapUnit)
MapMode GetPrefMapMode() const
void setWidth(tools::Long n)
OUString aName
bool DoInitNew(SfxMedium *pMedium=nullptr)
tools::Long Height() const
const INetURLObject & GetURLObject() const
static SC_DLLPUBLIC double nScreenPPTX
Horizontal pixel per twips factor.
Definition: global.hxx:577
const ScDocument & GetDocument() const
Definition: docsh.hxx:216
void SetDrawPersist(const SfxObjectShellRef &rRef)
Definition: drwtrans.cxx:591
OUString GetURLNoPass(DecodeMechanism eMechanism=DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
css::uno::Reference< css::datatransfer::XTransferable > CopyToTransferable()
Definition: drawvie4.cxx:374
tools::Long GetHeight() const
virtual void SetSnapRect(const tools::Rectangle &rRect)
virtual bool shouldKeepAspectRatio() const
MapUnit
#define SAL_WARN(area, stream)
void SetDrawModified()
SetDrawModified - without Formula update.
Definition: docsh.cxx:2883
SC_DLLPUBLIC ScRefFlags Parse(const OUString &, const ScDocument &, const Details &rDetails=detailsOOOa1, ExternalInfo *pExtInfo=nullptr, const css::uno::Sequence< css::sheet::ExternalLinkInfo > *pExternalLinks=nullptr, sal_Int32 *pSheetEndPos=nullptr, const OUString *pErrRef=nullptr)
Definition: address.cxx:1539
virtual const tools::Rectangle & GetLogicRect() const
void DoCopy()
Definition: drawvie4.cxx:332
static void CalcScale(const ScDocument &rDoc, SCTAB nTab, SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, const OutputDevice *pDev, const Fraction &rZoomX, const Fraction &rZoomY, double nPPTX, double nPPTY, Fraction &rScaleX, Fraction &rScaleY)
Definition: drawutil.cxx:27
SC_DLLPUBLIC bool GetName(SCTAB nTab, OUString &rName) const
Definition: document.cxx:213
void FitToCellSize()
Definition: drawvie4.cxx:523
Point aDragStartDiff
Definition: drawvie4.cxx:55
void setHeight(tools::Long n)
sal_Int16 SCTAB
Definition: types.hxx:23
SfxMedium * GetMedium() const