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#include <osl/diagnose.h>
30
31#include <drawview.hxx>
32#include <global.hxx>
33#include <drwlayer.hxx>
34#include <viewdata.hxx>
35#include <document.hxx>
36#include <docsh.hxx>
37#include <drwtrans.hxx>
38#include <transobj.hxx>
39#include <drawutil.hxx>
40#include <scmod.hxx>
41#include <globstr.hrc>
42#include <scresid.hxx>
43#include <gridwin.hxx>
44#include <userdat.hxx>
45
46#include <com/sun/star/embed/NoVisualAreaSizeException.hpp>
47#include <com/sun/star/embed/Aspects.hpp>
48#include <com/sun/star/embed/XEmbeddedObject.hpp>
49#include <com/sun/star/chart2/XChartTypeContainer.hpp>
50#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
51#include <com/sun/star/chart2/XDataSeriesContainer.hpp>
52#include <com/sun/star/chart2/XChartDocument.hpp>
53
54using namespace com::sun::star;
55
57
58void ScDrawView::BeginDrag( vcl::Window* pWindow, const Point& rStartPos )
59{
60 if ( !AreObjectsMarked() )
61 return;
62
63 BrkAction();
64
65 tools::Rectangle aMarkedRect = GetAllMarkedRect();
66
67 aDragStartDiff = rStartPos - aMarkedRect.TopLeft();
68
69 bool bAnyOle, bOneOle;
70 const SdrMarkList& rMarkList = GetMarkedObjectList();
71 CheckOle( rMarkList, bAnyOle, bOneOle );
72
73 ScDocShellRef aDragShellRef;
74 if (bAnyOle)
75 {
76 aDragShellRef = new ScDocShell; // DocShell needs a Ref immediately
77 aDragShellRef->DoInitNew();
78 }
79 ScDrawLayer::SetGlobalDrawPersist( aDragShellRef.get() );
80 std::unique_ptr<SdrModel> pModel(CreateMarkedObjModel());
82
83 // Charts now always copy their data in addition to the source reference, so
84 // there's no need to call SchDLL::Update for the charts in the clipboard doc.
85 // Update with the data (including NumberFormatter) from the live document would
86 // also store the NumberFormatter in the clipboard chart (#88749#)
87
88 ScDocShell* pDocSh = pViewData->GetDocShell();
89
91 pDocSh->FillTransferableObjectDescriptor( aObjDesc );
92 aObjDesc.maDisplayName = pDocSh->GetMedium()->GetURLObject().GetURLNoPass();
93 // maSize is set in ScDrawTransferObj ctor
94
95 rtl::Reference<ScDrawTransferObj> pTransferObj = new ScDrawTransferObj( std::move(pModel), pDocSh, std::move(aObjDesc) );
96
97 pTransferObj->SetDrawPersist( aDragShellRef.get() ); // keep persist for ole objects alive
98 pTransferObj->SetDragSource( this ); // copies selection
99
100 SC_MOD()->SetDragObject( nullptr, pTransferObj.get() ); // for internal D&D
101 pTransferObj->StartDrag( pWindow, DND_ACTION_COPYMOVE | DND_ACTION_LINK );
102}
103
104namespace {
105
106void getRangeFromDataSource( uno::Reference< chart2::data::XDataSource > const & xDataSource, std::vector<OUString>& rRangeRep)
107{
108 const uno::Sequence<uno::Reference<chart2::data::XLabeledDataSequence> > xSeqs = xDataSource->getDataSequences();
109 for (const uno::Reference<chart2::data::XLabeledDataSequence>& xLS : xSeqs)
110 {
111 uno::Reference<chart2::data::XDataSequence> xSeq = xLS->getValues();
112 if (xSeq.is())
113 {
114 OUString aRep = xSeq->getSourceRangeRepresentation();
115 rRangeRep.push_back(aRep);
116 }
117 xSeq = xLS->getLabel();
118 if (xSeq.is())
119 {
120 OUString aRep = xSeq->getSourceRangeRepresentation();
121 rRangeRep.push_back(aRep);
122 }
123 }
124}
125
126void getRangeFromErrorBar(const uno::Reference< chart2::XChartDocument >& rChartDoc, std::vector<OUString>& rRangeRep)
127{
128 uno::Reference <chart2::XDiagram > xDiagram = rChartDoc->getFirstDiagram();
129 if(!xDiagram.is())
130 return;
131
132 uno::Reference< chart2::XCoordinateSystemContainer > xCooSysContainer( xDiagram, uno::UNO_QUERY);
133 if(!xCooSysContainer.is())
134 return;
135
136 const uno::Sequence< uno::Reference< chart2::XCoordinateSystem > > xCooSysSequence( xCooSysContainer->getCoordinateSystems());
137 for(const auto& rCooSys : xCooSysSequence)
138 {
139 uno::Reference< chart2::XChartTypeContainer > xChartTypeContainer( rCooSys, uno::UNO_QUERY);
140 if(!xChartTypeContainer.is())
141 continue;
142
143 const uno::Sequence< uno::Reference< chart2::XChartType > > xChartTypeSequence( xChartTypeContainer->getChartTypes() );
144 for(const auto& rChartType : xChartTypeSequence)
145 {
146 uno::Reference< chart2::XDataSeriesContainer > xDataSequenceContainer( rChartType, uno::UNO_QUERY);
147 if(!xDataSequenceContainer.is())
148 continue;
149
150 const uno::Sequence< uno::Reference< chart2::XDataSeries > > xSeriesSequence( xDataSequenceContainer->getDataSeries() );
151 for(const uno::Reference<chart2::XDataSeries>& xSeries : xSeriesSequence)
152 {
153 uno::Reference< beans::XPropertySet > xPropSet( xSeries, uno::UNO_QUERY);
154 uno::Reference< chart2::data::XDataSource > xErrorBarY;
155 xPropSet->getPropertyValue("ErrorBarY") >>= xErrorBarY;
156 if(xErrorBarY.is())
157 getRangeFromDataSource(xErrorBarY, rRangeRep);
158 uno::Reference< chart2::data::XDataSource > xErrorBarX;
159 xPropSet->getPropertyValue("ErrorBarX") >>= xErrorBarX;
160 if(xErrorBarX.is())
161 getRangeFromDataSource(xErrorBarX, rRangeRep);
162 }
163 }
164 }
165}
166
167void getRangeFromOle2Object(const SdrOle2Obj& rObj, std::vector<OUString>& rRangeRep)
168{
169 if (!rObj.IsChart())
170 // not a chart object.
171 return;
172
173 const uno::Reference<embed::XEmbeddedObject>& xObj = rObj.GetObjRef();
174 if (!xObj.is())
175 return;
176
177 uno::Reference<chart2::XChartDocument> xChartDoc(xObj->getComponent(), uno::UNO_QUERY);
178 if (!xChartDoc.is())
179 return;
180
181 if(xChartDoc->hasInternalDataProvider())
182 return;
183
184 getRangeFromErrorBar(xChartDoc, rRangeRep);
185
186 uno::Reference<chart2::data::XDataSource> xDataSource(xChartDoc, uno::UNO_QUERY);
187 if (!xDataSource.is())
188 return;
189
190 // Get all data sources used in this chart.
191 getRangeFromDataSource(xDataSource, rRangeRep);
192
193 return;
194}
195
196// Get all cell ranges that are referenced by the selected chart objects.
197void getOleSourceRanges(const SdrMarkList& rMarkList, bool& rAnyOle, bool& rOneOle, std::vector<ScRange>* pRanges = nullptr, const ScDocument* pDoc = nullptr )
198{
199 bool bCalcSourceRanges = pRanges && pDoc;
200 std::vector<OUString> aRangeReps;
201 rAnyOle = rOneOle = false;
202 const size_t nCount = rMarkList.GetMarkCount();
203 for (size_t i=0; i<nCount; ++i)
204 {
205 SdrMark* pMark = rMarkList.GetMark(i);
206 if ( !pMark )
207 continue;
208
209 SdrObject* pObj = pMark->GetMarkedSdrObj();
210 if ( !pObj )
211 continue;
212
213 SdrObjKind nSdrObjKind = pObj->GetObjIdentifier();
214 if (nSdrObjKind == SdrObjKind::OLE2)
215 {
216 rAnyOle = true;
217 rOneOle = (nCount == 1);
218 if ( bCalcSourceRanges )
219 getRangeFromOle2Object( static_cast<const SdrOle2Obj&>( *pObj ), aRangeReps );
220 else
221 break;
222 }
223 else if ( dynamic_cast<const SdrObjGroup*>( pObj) != nullptr )
224 {
225 SdrObjListIter aIter( *pObj, SdrIterMode::DeepNoGroups );
226 SdrObject* pSubObj = aIter.Next();
227 while (pSubObj)
228 {
229 if ( pSubObj->GetObjIdentifier() == SdrObjKind::OLE2 )
230 {
231 rAnyOle = true;
232 // rOneOle remains false - a group isn't treated like a single OLE object
233 if ( !bCalcSourceRanges )
234 return;
235
236 getRangeFromOle2Object( static_cast<const SdrOle2Obj&>( *pSubObj ), aRangeReps );
237 }
238 pSubObj = aIter.Next();
239 }
240 }
241 }
242
243 if (!bCalcSourceRanges)
244 return;
245
246 // Compile all range representation strings into ranges.
247 for (const auto& rRangeRep : aRangeReps)
248 {
249 ScRangeList aRange;
250 ScAddress aAddr;
251 if (aRange.Parse(rRangeRep, *pDoc, pDoc->GetAddressConvention()) & ScRefFlags::VALID)
252 {
253 pRanges->insert(pRanges->end(), aRange.begin(), aRange.end());
254 }
255 else if (aAddr.Parse(rRangeRep, *pDoc, pDoc->GetAddressConvention()) & ScRefFlags::VALID)
256 pRanges->push_back(aAddr);
257 }
258
259 return;
260}
261
262class InsertTabIndex
263{
264 std::vector<SCTAB>& mrTabs;
265public:
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
273class CopyRangeData
274{
275 ScDocument& mrSrc;
276 ScDocument& mrDest;
277public:
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
294void 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
327void 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, std::move(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
374uno::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 rtl::Reference<ScDrawTransferObj> pTransferObj = new ScDrawTransferObj( std::move(pModel), pDocSh, std::move(aObjDesc) );
399
401 {
402 pTransferObj->SetDrawPersist( ScGlobal::xDrawClipDocShellRef.get() ); // keep persist for ole objects alive
403 }
404
405 return pTransferObj;
406}
407
408// Calculate correction for 100%, regardless of current settings
409
410void ScDrawView::CalcNormScale( Fraction& rFractX, Fraction& rFractY ) const
411{
414
415 if (pViewData)
417
418 SCCOL nEndCol = 0;
419 SCROW nEndRow = 0;
420 rDoc.GetTableArea( nTab, nEndCol, nEndRow );
421 if (nEndCol<20)
422 nEndCol = 20;
423 if (nEndRow<20)
424 nEndRow = 1000;
425
426 Fraction aZoom(1,1);
427 ScDrawUtil::CalcScale( rDoc, nTab, 0,0, nEndCol,nEndRow, pDev, aZoom,aZoom,
428 nPPTX, nPPTY, rFractX,rFractY );
429}
430
432{
433 std::unique_ptr<SdrUndoGroup> pUndoGroup(new SdrUndoGroup(*GetModel()));
434
435 const SdrMarkList& rMarkList = GetMarkedObjectList();
436 tools::Long nDone = 0;
437 const size_t nCount = rMarkList.GetMarkCount();
438 for (size_t i=0; i<nCount; ++i)
439 {
440 SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
441 SdrObjKind nIdent = pObj->GetObjIdentifier();
442 bool bDo = false;
443 Size aOriginalSize;
444 if (nIdent == SdrObjKind::OLE2)
445 {
446 // TODO/LEAN: working with visual area can switch object to running state
447 uno::Reference < embed::XEmbeddedObject > xObj = static_cast<SdrOle2Obj*>(pObj)->GetObjRef();
448 if ( xObj.is() ) // NULL for an invalid object that couldn't be loaded
449 {
450 sal_Int64 nAspect = static_cast<SdrOle2Obj*>(pObj)->GetAspect();
451
452 if ( nAspect == embed::Aspects::MSOLE_ICON )
453 {
454 MapMode aMapMode( MapUnit::Map100thMM );
455 aOriginalSize = static_cast<SdrOle2Obj*>(pObj)->GetOrigObjSize( &aMapMode );
456 bDo = true;
457 }
458 else
459 {
460 MapUnit aUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( static_cast<SdrOle2Obj*>(pObj)->GetAspect() ) );
461 try
462 {
463 awt::Size aSz = xObj->getVisualAreaSize( static_cast<SdrOle2Obj*>(pObj)->GetAspect() );
464 aOriginalSize = OutputDevice::LogicToLogic(
465 Size( aSz.Width, aSz.Height ),
466 MapMode(aUnit),
467 MapMode(MapUnit::Map100thMM));
468 bDo = true;
469 } catch( embed::NoVisualAreaSizeException& )
470 {
471 OSL_ENSURE( false, "Can't get the original size of the object!" );
472 }
473 }
474 }
475 }
476 else if (nIdent == SdrObjKind::Graphic)
477 {
478 const Graphic& rGraphic = static_cast<SdrGrafObj*>(pObj)->GetGraphic();
479
480 MapMode aSourceMap = rGraphic.GetPrefMapMode();
481 MapMode aDestMap( MapUnit::Map100thMM );
482 if (aSourceMap.GetMapUnit() == MapUnit::MapPixel)
483 {
484 // consider pixel correction, so that the bitmap is correct on the screen
485 Fraction aNormScaleX, aNormScaleY;
486 CalcNormScale( aNormScaleX, aNormScaleY );
487 aDestMap.SetScaleX(aNormScaleX);
488 aDestMap.SetScaleY(aNormScaleY);
489 }
490 if (pViewData)
491 {
492 vcl::Window* pActWin = pViewData->GetActiveWin();
493 if (pActWin)
494 {
495 aOriginalSize = pActWin->LogicToLogic(
496 rGraphic.GetPrefSize(), &aSourceMap, &aDestMap );
497 bDo = true;
498 }
499 }
500 }
501
502 if ( bDo )
503 {
504 tools::Rectangle aDrawRect = pObj->GetLogicRect();
505
506 pUndoGroup->AddAction( std::make_unique<SdrUndoGeoObj>( *pObj ) );
507 pObj->Resize( aDrawRect.TopLeft(), Fraction( aOriginalSize.Width(), aDrawRect.GetWidth() ),
508 Fraction( aOriginalSize.Height(), aDrawRect.GetHeight() ) );
509 ++nDone;
510 }
511 }
512
513 if (nDone && pViewData)
514 {
515 pUndoGroup->SetComment(ScResId( STR_UNDO_ORIGINALSIZE ));
516 ScDocShell* pDocSh = pViewData->GetDocShell();
517 pDocSh->GetUndoManager()->AddUndoAction(std::move(pUndoGroup));
518 pDocSh->SetDrawModified();
519 }
520}
521
523{
524 const SdrMarkList& rMarkList = GetMarkedObjectList();
525
526 if (rMarkList.GetMarkCount() != 1)
527 {
528 SAL_WARN("sc.ui", "Fit to cell only works with one graphic!");
529 return;
530 }
531
532 SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
533
534 ScAnchorType aAnchorType = ScDrawLayer::GetAnchorType(*pObj);
535 if (aAnchorType != SCA_CELL && aAnchorType != SCA_CELL_RESIZE)
536 {
537 SAL_WARN("sc.ui", "Fit to cell only works with cell anchored graphics!");
538 return;
539 }
540
541 ScDrawObjData* pObjData = ScDrawLayer::GetObjData(pObj);
542 if (!pObjData)
543 {
544 SAL_WARN("sc.ui", "Missing ScDrawObjData!");
545 return;
546 }
547
548 std::unique_ptr<SdrUndoGroup> pUndoGroup(new SdrUndoGroup(*GetModel()));
549 tools::Rectangle aGraphicRect = pObj->GetSnapRect();
550 tools::Rectangle aCellRect = ScDrawLayer::GetCellRect( rDoc, pObjData->maStart, true);
551
552 // For graphic objects, we want to keep the aspect ratio
553 if (pObj->shouldKeepAspectRatio())
554 {
555 tools::Long nWidth = aGraphicRect.GetWidth();
556 assert(nWidth && "div-by-zero");
557 double fScaleX = static_cast<double>(aCellRect.GetWidth()) / static_cast<double>(nWidth);
558 tools::Long nHeight = aGraphicRect.GetHeight();
559 assert(nHeight && "div-by-zero");
560 double fScaleY = static_cast<double>(aCellRect.GetHeight()) / static_cast<double>(nHeight);
561 double fScaleMin = std::min(fScaleX, fScaleY);
562
563 aCellRect.setWidth(static_cast<double>(aGraphicRect.GetWidth()) * fScaleMin);
564 aCellRect.setHeight(static_cast<double>(aGraphicRect.GetHeight()) * fScaleMin);
565 }
566
567 pUndoGroup->AddAction( std::make_unique<SdrUndoGeoObj>( *pObj ) );
568 if (pObj->GetObjIdentifier() == SdrObjKind::CustomShape)
569 pObj->AdjustToMaxRect(aCellRect);
570 else
571 pObj->SetSnapRect(aCellRect);
572
573 pUndoGroup->SetComment(ScResId( STR_UNDO_FITCELLSIZE ));
574 ScDocShell* pDocSh = pViewData->GetDocShell();
575 pDocSh->GetUndoManager()->AddUndoAction(std::move(pUndoGroup));
576
577}
578
579/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual std::unique_ptr< SdrModel > CreateMarkedObjModel() const override
Size GetPrefSize() const
MapMode GetPrefMapMode() const
OUString GetURLNoPass(DecodeMechanism eMechanism=DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) 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
SCTAB Tab() const
Definition: address.hxx:283
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:1537
void SetDrawModified()
SetDrawModified - without Formula update.
Definition: docsh.cxx:3025
double GetOutputFactor() const
Definition: docsh.hxx:358
virtual SfxUndoManager * GetUndoManager() override
Definition: docsh.cxx:2947
SC_DLLPUBLIC bool GetTable(const OUString &rName, SCTAB &rTab) const
Definition: document.cxx:263
void AppendTabOnLoad(const OUString &rName)
Definition: document.cxx:474
SC_DLLPUBLIC void CopyStaticToDocument(const ScRange &rSrcRange, SCTAB nDestTab, ScDocument &rDestDoc)
Copy only raw cell values to another document.
Definition: document.cxx:2244
void SetTabNameOnLoad(SCTAB nTab, const OUString &rName)
Definition: document.cxx:486
SC_DLLPUBLIC bool GetTableArea(SCTAB nTab, SCCOL &rEndCol, SCROW &rEndRow, bool bCalcHiddens=false) const
Definition: document.cxx:1032
SC_DLLPUBLIC bool GetName(SCTAB nTab, OUString &rName) const
Definition: document.cxx:216
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:2109
static ScDrawObjData * GetObjData(SdrObject *pObj, bool bCreate=false)
Definition: drwlayer.cxx:2604
static ScAnchorType GetAnchorType(const SdrObject &)
Definition: drwlayer.cxx:2448
static void SetGlobalDrawPersist(SfxObjectShell *pPersist)
Definition: drwlayer.cxx:2657
ScAddress maStart
Definition: userdat.hxx:36
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:29
ScViewData * pViewData
Definition: drawview.hxx:35
void CalcNormScale(Fraction &rFractX, Fraction &rFractY) const
Definition: drawvie4.cxx:410
void BeginDrag(vcl::Window *pWindow, const Point &rStartPos)
Definition: drawvie4.cxx:58
css::uno::Reference< css::datatransfer::XTransferable > CopyToTransferable()
Definition: drawvie4.cxx:374
void DoCopy()
Definition: drawvie4.cxx:332
SCTAB nTab
Definition: drawview.hxx:38
static void CheckOle(const SdrMarkList &rMarkList, bool &rAnyOle, bool &rOneOle)
Definition: drawvie4.cxx:327
ScDocument & rDoc
needed ?
Definition: drawview.hxx:37
VclPtr< OutputDevice > pDev
Definition: drawview.hxx:36
void SetMarkedOriginalSize()
Definition: drawvie4.cxx:431
void FitToCellSize()
Definition: drawvie4.cxx:522
static SC_DLLPUBLIC double nScreenPPTX
Horizontal pixel per twips factor.
Definition: global.hxx:588
static SC_DLLPUBLIC double nScreenPPTY
Vertical pixel per twips factor.
Definition: global.hxx:590
static tools::SvRef< ScDocShell > xDrawClipDocShellRef
Definition: global.hxx:592
::std::vector< ScRange >::const_iterator begin() const
Definition: rangelst.hxx:97
::std::vector< ScRange >::const_iterator end() const
Definition: rangelst.hxx:98
ScRefFlags Parse(std::u16string_view, const ScDocument &, formula::FormulaGrammar::AddressConvention eConv=formula::FormulaGrammar::CONV_OOO, SCTAB nDefaultTab=0, sal_Unicode cDelimiter=0)
Definition: rangelst.cxx:92
ScAddress aStart
Definition: address.hxx:497
static SfxObjectShell * SetDrawClipDoc(bool bAnyOle, const std::shared_ptr< ScDocument > &={})
Definition: transobj.cxx:814
ScDocShell * GetDocShell() const
Definition: viewdata.hxx:354
ScGridWindow * GetActiveWin()
Definition: viewdata.cxx:3157
virtual void BrkAction() override
size_t GetMarkCount() const
SdrMark * GetMark(size_t nNum) const
const SdrMarkList & GetMarkedObjectList() const
bool AreObjectsMarked() const
const tools::Rectangle & GetAllMarkedRect() const
SdrObject * GetMarkedSdrObj() const
virtual const tools::Rectangle & GetSnapRect() const
virtual void AdjustToMaxRect(const tools::Rectangle &rMaxRect, bool bShrinkOnly=false)
virtual SdrObjKind GetObjIdentifier() const
virtual void SetSnapRect(const tools::Rectangle &rRect)
virtual bool shouldKeepAspectRatio() const
virtual const tools::Rectangle & GetLogicRect() const
virtual void Resize(const Point &rRef, const Fraction &xFact, const Fraction &yFact, bool bUnsetRelative=true)
sal_Int64 GetAspect() const
css::uno::Reference< css::embed::XEmbeddedObject > const & GetObjRef() const
bool IsChart() const
SdrModel * GetModel() const
const INetURLObject & GetURLObject() const
void FillTransferableObjectDescriptor(TransferableObjectDescriptor &rDesc) const
SfxMedium * GetMedium() const
virtual void AddUndoAction(std::unique_ptr< SfxUndoAction > pAction, bool bTryMerg=false)
constexpr tools::Long Height() const
constexpr tools::Long Width() const
static MapUnit UnoEmbed2VCLMapUnit(sal_Int32 nUnoEmbedMapUnit)
constexpr tools::Long GetWidth() const
constexpr Point TopLeft() const
void setWidth(tools::Long n)
constexpr tools::Long GetHeight() const
void setHeight(tools::Long n)
T * get() const
Size LogicToLogic(const Size &rSzSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
int nCount
constexpr double nPPTX
constexpr double nPPTY
Point aDragStartDiff
Definition: drawvie4.cxx:56
ScAnchorType
Definition: global.hxx:373
@ SCA_CELL_RESIZE
Definition: global.hxx:375
@ SCA_CELL
Definition: global.hxx:374
OUString aName
#define SAL_WARN(area, stream)
MapUnit
int i
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
long Long
OUString ScResId(TranslateId aId)
Definition: scdll.cxx:90
#define SC_MOD()
Definition: scmod.hxx:249
SdrObjKind
#define DND_ACTION_COPYMOVE
#define DND_ACTION_LINK
sal_Int16 SCTAB
Definition: types.hxx:22
sal_Int16 SCCOL
Definition: types.hxx:21
sal_Int32 SCROW
Definition: types.hxx:17