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>
54
55using namespace com::sun::star;
56
58
59void ScDrawView::BeginDrag( vcl::Window* pWindow, const Point& rStartPos )
60{
61 if ( !AreObjectsMarked() )
62 return;
63
64 BrkAction();
65
66 tools::Rectangle aMarkedRect = GetAllMarkedRect();
67
68 aDragStartDiff = rStartPos - aMarkedRect.TopLeft();
69
70 bool bAnyOle, bOneOle;
71 const SdrMarkList& rMarkList = GetMarkedObjectList();
72 CheckOle( rMarkList, bAnyOle, bOneOle );
73
74 ScDocShellRef aDragShellRef;
75 if (bAnyOle)
76 {
77 aDragShellRef = new ScDocShell; // DocShell needs a Ref immediately
78 aDragShellRef->DoInitNew();
79 }
80 ScDrawLayer::SetGlobalDrawPersist( aDragShellRef.get() );
81 std::unique_ptr<SdrModel> pModel(CreateMarkedObjModel());
83
84 // Charts now always copy their data in addition to the source reference, so
85 // there's no need to call SchDLL::Update for the charts in the clipboard doc.
86 // Update with the data (including NumberFormatter) from the live document would
87 // also store the NumberFormatter in the clipboard chart (#88749#)
88
89 ScDocShell* pDocSh = pViewData->GetDocShell();
90
92 pDocSh->FillTransferableObjectDescriptor( aObjDesc );
93 aObjDesc.maDisplayName = pDocSh->GetMedium()->GetURLObject().GetURLNoPass();
94 // maSize is set in ScDrawTransferObj ctor
95
96 rtl::Reference<ScDrawTransferObj> pTransferObj = new ScDrawTransferObj( std::move(pModel), pDocSh, std::move(aObjDesc) );
97
98 pTransferObj->SetDrawPersist( aDragShellRef.get() ); // keep persist for ole objects alive
99 pTransferObj->SetDragSource( this ); // copies selection
100
101 SC_MOD()->SetDragObject( nullptr, pTransferObj.get() ); // for internal D&D
102 pTransferObj->StartDrag( pWindow, DND_ACTION_COPYMOVE | DND_ACTION_LINK );
103}
104
105namespace {
106
107void getRangeFromDataSource( uno::Reference< chart2::data::XDataSource > const & xDataSource, std::vector<OUString>& rRangeRep)
108{
109 const uno::Sequence<uno::Reference<chart2::data::XLabeledDataSequence> > xSeqs = xDataSource->getDataSequences();
110 for (const uno::Reference<chart2::data::XLabeledDataSequence>& xLS : xSeqs)
111 {
112 uno::Reference<chart2::data::XDataSequence> xSeq = xLS->getValues();
113 if (xSeq.is())
114 {
115 OUString aRep = xSeq->getSourceRangeRepresentation();
116 rRangeRep.push_back(aRep);
117 }
118 xSeq = xLS->getLabel();
119 if (xSeq.is())
120 {
121 OUString aRep = xSeq->getSourceRangeRepresentation();
122 rRangeRep.push_back(aRep);
123 }
124 }
125}
126
127void getRangeFromErrorBar(const uno::Reference< chart2::XChartDocument >& rChartDoc, std::vector<OUString>& rRangeRep)
128{
129 uno::Reference <chart2::XDiagram > xDiagram = rChartDoc->getFirstDiagram();
130 if(!xDiagram.is())
131 return;
132
133 uno::Reference< chart2::XCoordinateSystemContainer > xCooSysContainer( xDiagram, uno::UNO_QUERY);
134 if(!xCooSysContainer.is())
135 return;
136
137 const uno::Sequence< uno::Reference< chart2::XCoordinateSystem > > xCooSysSequence( xCooSysContainer->getCoordinateSystems());
138 for(const auto& rCooSys : xCooSysSequence)
139 {
140 uno::Reference< chart2::XChartTypeContainer > xChartTypeContainer( rCooSys, uno::UNO_QUERY);
141 if(!xChartTypeContainer.is())
142 continue;
143
144 const uno::Sequence< uno::Reference< chart2::XChartType > > xChartTypeSequence( xChartTypeContainer->getChartTypes() );
145 for(const auto& rChartType : xChartTypeSequence)
146 {
147 uno::Reference< chart2::XDataSeriesContainer > xDataSequenceContainer( rChartType, uno::UNO_QUERY);
148 if(!xDataSequenceContainer.is())
149 continue;
150
151 const uno::Sequence< uno::Reference< chart2::XDataSeries > > xSeriesSequence( xDataSequenceContainer->getDataSeries() );
152 for(const uno::Reference<chart2::XDataSeries>& xSeries : xSeriesSequence)
153 {
154 uno::Reference< beans::XPropertySet > xPropSet( xSeries, uno::UNO_QUERY);
155 uno::Reference< chart2::data::XDataSource > xErrorBarY;
156 xPropSet->getPropertyValue("ErrorBarY") >>= xErrorBarY;
157 if(xErrorBarY.is())
158 getRangeFromDataSource(xErrorBarY, rRangeRep);
159 uno::Reference< chart2::data::XDataSource > xErrorBarX;
160 xPropSet->getPropertyValue("ErrorBarX") >>= xErrorBarX;
161 if(xErrorBarX.is())
162 getRangeFromDataSource(xErrorBarX, rRangeRep);
163 }
164 }
165 }
166}
167
168void getRangeFromOle2Object(const SdrOle2Obj& rObj, std::vector<OUString>& rRangeRep)
169{
170 if (!rObj.IsChart())
171 // not a chart object.
172 return;
173
174 const uno::Reference<embed::XEmbeddedObject>& xObj = rObj.GetObjRef();
175 if (!xObj.is())
176 return;
177
178 uno::Reference<chart2::XChartDocument> xChartDoc(xObj->getComponent(), uno::UNO_QUERY);
179 if (!xChartDoc.is())
180 return;
181
182 if(xChartDoc->hasInternalDataProvider())
183 return;
184
185 getRangeFromErrorBar(xChartDoc, rRangeRep);
186
187 uno::Reference<chart2::data::XDataSource> xDataSource(xChartDoc, uno::UNO_QUERY);
188 if (!xDataSource.is())
189 return;
190
191 // Get all data sources used in this chart.
192 getRangeFromDataSource(xDataSource, rRangeRep);
193
194 return;
195}
196
197// Get all cell ranges that are referenced by the selected chart objects.
198void getOleSourceRanges(const SdrMarkList& rMarkList, bool& rAnyOle, bool& rOneOle, std::vector<ScRange>* pRanges = nullptr, const ScDocument* pDoc = nullptr )
199{
200 bool bCalcSourceRanges = pRanges && pDoc;
201 std::vector<OUString> aRangeReps;
202 rAnyOle = rOneOle = false;
203 const size_t nCount = rMarkList.GetMarkCount();
204 for (size_t i=0; i<nCount; ++i)
205 {
206 SdrMark* pMark = rMarkList.GetMark(i);
207 if ( !pMark )
208 continue;
209
210 SdrObject* pObj = pMark->GetMarkedSdrObj();
211 if ( !pObj )
212 continue;
213
214 SdrObjKind nSdrObjKind = pObj->GetObjIdentifier();
215 if (nSdrObjKind == SdrObjKind::OLE2)
216 {
217 rAnyOle = true;
218 rOneOle = (nCount == 1);
219 if ( bCalcSourceRanges )
220 getRangeFromOle2Object( static_cast<const SdrOle2Obj&>( *pObj ), aRangeReps );
221 else
222 break;
223 }
224 else if ( dynamic_cast<const SdrObjGroup*>( pObj) != nullptr )
225 {
226 SdrObjListIter aIter( *pObj, SdrIterMode::DeepNoGroups );
227 SdrObject* pSubObj = aIter.Next();
228 while (pSubObj)
229 {
230 if ( pSubObj->GetObjIdentifier() == SdrObjKind::OLE2 )
231 {
232 rAnyOle = true;
233 // rOneOle remains false - a group isn't treated like a single OLE object
234 if ( !bCalcSourceRanges )
235 return;
236
237 getRangeFromOle2Object( static_cast<const SdrOle2Obj&>( *pSubObj ), aRangeReps );
238 }
239 pSubObj = aIter.Next();
240 }
241 }
242 }
243
244 if (!bCalcSourceRanges)
245 return;
246
247 // Compile all range representation strings into ranges.
248 for (const auto& rRangeRep : aRangeReps)
249 {
250 ScRangeList aRange;
251 ScAddress aAddr;
252 if (aRange.Parse(rRangeRep, *pDoc, pDoc->GetAddressConvention()) & ScRefFlags::VALID)
253 {
254 pRanges->insert(pRanges->end(), aRange.begin(), aRange.end());
255 }
256 else if (aAddr.Parse(rRangeRep, *pDoc, pDoc->GetAddressConvention()) & ScRefFlags::VALID)
257 pRanges->push_back(aAddr);
258 }
259
260 return;
261}
262
263class InsertTabIndex
264{
265 std::vector<SCTAB>& mrTabs;
266public:
267 explicit InsertTabIndex(std::vector<SCTAB>& rTabs) : mrTabs(rTabs) {}
268 void operator() (const ScRange& rRange)
269 {
270 mrTabs.push_back(rRange.aStart.Tab());
271 }
272};
273
274class CopyRangeData
275{
276 ScDocument& mrSrc;
277 ScDocument& mrDest;
278public:
279 CopyRangeData(ScDocument& rSrc, ScDocument& rDest) : mrSrc(rSrc), mrDest(rDest) {}
280
281 void operator() (const ScRange& rRange)
282 {
283 OUString aTabName;
284 mrSrc.GetName(rRange.aStart.Tab(), aTabName);
285
286 SCTAB nTab;
287 if (!mrDest.GetTable(aTabName, nTab))
288 // Sheet by this name doesn't exist.
289 return;
290
291 mrSrc.CopyStaticToDocument(rRange, nTab, mrDest);
292 }
293};
294
295void copyChartRefDataToClipDoc(ScDocument& rSrcDoc, ScDocument& rClipDoc, const std::vector<ScRange>& rRanges)
296{
297 // Get a list of referenced table indices.
298 std::vector<SCTAB> aTabs;
299 std::for_each(rRanges.begin(), rRanges.end(), InsertTabIndex(aTabs));
300 std::sort(aTabs.begin(), aTabs.end());
301 aTabs.erase(std::unique(aTabs.begin(), aTabs.end()), aTabs.end());
302
303 // Get table names.
304 if (aTabs.empty())
305 return;
306
307 // Create sheets only for referenced source sheets.
308 OUString aName;
309 std::vector<SCTAB>::const_iterator it = aTabs.begin(), itEnd = aTabs.end();
310 if (!rSrcDoc.GetName(*it, aName))
311 return;
312
313 rClipDoc.SetTabNameOnLoad(0, aName); // document initially has one sheet.
314
315 for (++it; it != itEnd; ++it)
316 {
317 if (!rSrcDoc.GetName(*it, aName))
318 return;
319
320 rClipDoc.AppendTabOnLoad(aName);
321 }
322
323 std::for_each(rRanges.begin(), rRanges.end(), CopyRangeData(rSrcDoc, rClipDoc));
324}
325
326}
327
328void ScDrawView::CheckOle( const SdrMarkList& rMarkList, bool& rAnyOle, bool& rOneOle )
329{
330 getOleSourceRanges( rMarkList, rAnyOle, rOneOle );
331}
332
334{
335 const SdrMarkList& rMarkList = GetMarkedObjectList();
336 std::vector<ScRange> aRanges;
337 bool bAnyOle = false, bOneOle = false;
338 getOleSourceRanges( rMarkList, bAnyOle, bOneOle, &aRanges, &rDoc );
339
340 // update ScGlobal::xDrawClipDocShellRef
342 if (ScGlobal::xDrawClipDocShellRef.is() && !aRanges.empty())
343 {
344 // Copy data referenced by the chart objects to the draw clip
345 // document. We need to do this before CreateMarkedObjModel() below.
347 ScDocument& rClipDoc = xDocSh->GetDocument();
348 copyChartRefDataToClipDoc(rDoc, rClipDoc, aRanges);
349 }
350 std::unique_ptr<SdrModel> pModel(CreateMarkedObjModel());
352
353 // Charts now always copy their data in addition to the source reference, so
354 // there's no need to call SchDLL::Update for the charts in the clipboard doc.
355 // Update with the data (including NumberFormatter) from the live document would
356 // also store the NumberFormatter in the clipboard chart (#88749#)
357
358 ScDocShell* pDocSh = pViewData->GetDocShell();
359
361 pDocSh->FillTransferableObjectDescriptor( aObjDesc );
362 aObjDesc.maDisplayName = pDocSh->GetMedium()->GetURLObject().GetURLNoPass();
363 // maSize is set in ScDrawTransferObj ctor
364
365 rtl::Reference<ScDrawTransferObj> pTransferObj(new ScDrawTransferObj( std::move(pModel), pDocSh, std::move(aObjDesc) ));
366
368 {
369 pTransferObj->SetDrawPersist( ScGlobal::xDrawClipDocShellRef.get() ); // keep persist for ole objects alive
370 }
371
372 pTransferObj->CopyToClipboard( pViewData->GetActiveWin() ); // system clipboard
373}
374
375uno::Reference<datatransfer::XTransferable> ScDrawView::CopyToTransferable()
376{
377 bool bAnyOle, bOneOle;
378 const SdrMarkList& rMarkList = GetMarkedObjectList();
379 CheckOle( rMarkList, bAnyOle, bOneOle );
380
381 // update ScGlobal::xDrawClipDocShellRef
383 std::unique_ptr<SdrModel> pModel( CreateMarkedObjModel() );
385
386 // Charts now always copy their data in addition to the source reference, so
387 // there's no need to call SchDLL::Update for the charts in the clipboard doc.
388 // Update with the data (including NumberFormatter) from the live document would
389 // also store the NumberFormatter in the clipboard chart (#88749#)
390 // lcl_RefreshChartData( pModel, pViewData->GetDocument() );
391
392 ScDocShell* pDocSh = pViewData->GetDocShell();
393
395 pDocSh->FillTransferableObjectDescriptor( aObjDesc );
396 aObjDesc.maDisplayName = pDocSh->GetMedium()->GetURLObject().GetURLNoPass();
397 // maSize is set in ScDrawTransferObj ctor
398
399 rtl::Reference<ScDrawTransferObj> pTransferObj = new ScDrawTransferObj( std::move(pModel), pDocSh, std::move(aObjDesc) );
400
402 {
403 pTransferObj->SetDrawPersist( ScGlobal::xDrawClipDocShellRef.get() ); // keep persist for ole objects alive
404 }
405
406 return pTransferObj;
407}
408
409// Calculate correction for 100%, regardless of current settings
410
411void ScDrawView::CalcNormScale( Fraction& rFractX, Fraction& rFractY ) const
412{
415
416 if (pViewData)
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 SdrObjKind nIdent = pObj->GetObjIdentifier();
443 bool bDo = false;
444 Size aOriginalSize;
445 if (nIdent == SdrObjKind::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 TOOLS_WARN_EXCEPTION("sc.ui", "Can't get the original size of the object!" );
473 }
474 }
475 }
476 }
477 else if (nIdent == SdrObjKind::Graphic)
478 {
479 const SdrGrafObj* pSdrGrafObj = static_cast<const SdrGrafObj*>(pObj);
480
481 MapMode aSourceMap = pSdrGrafObj->GetGraphic().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 aOriginalSize = pSdrGrafObj->getOriginalSize();
492 bDo = true;
493 }
494
495 if ( bDo )
496 {
497 tools::Rectangle aDrawRect = pObj->GetLogicRect();
498
499 pUndoGroup->AddAction( std::make_unique<SdrUndoGeoObj>( *pObj ) );
500 pObj->Resize( aDrawRect.TopLeft(), Fraction( aOriginalSize.Width(), aDrawRect.GetWidth() ),
501 Fraction( aOriginalSize.Height(), aDrawRect.GetHeight() ) );
502 ++nDone;
503 }
504 }
505
506 if (nDone && pViewData)
507 {
508 pUndoGroup->SetComment(ScResId( STR_UNDO_ORIGINALSIZE ));
509 ScDocShell* pDocSh = pViewData->GetDocShell();
510 pDocSh->GetUndoManager()->AddUndoAction(std::move(pUndoGroup));
511 pDocSh->SetDrawModified();
512 }
513}
514
516{
517 const SdrMarkList& rMarkList = GetMarkedObjectList();
518
519 if (rMarkList.GetMarkCount() != 1)
520 {
521 SAL_WARN("sc.ui", "Fit to cell only works with one graphic!");
522 return;
523 }
524
525 SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
526
527 ScAnchorType aAnchorType = ScDrawLayer::GetAnchorType(*pObj);
528 if (aAnchorType != SCA_CELL && aAnchorType != SCA_CELL_RESIZE)
529 {
530 SAL_WARN("sc.ui", "Fit to cell only works with cell anchored graphics!");
531 return;
532 }
533
534 ScDrawObjData* pObjData = ScDrawLayer::GetObjData(pObj);
535 if (!pObjData)
536 {
537 SAL_WARN("sc.ui", "Missing ScDrawObjData!");
538 return;
539 }
540
541 std::unique_ptr<SdrUndoGroup> pUndoGroup(new SdrUndoGroup(GetModel()));
542 tools::Rectangle aGraphicRect = pObj->GetSnapRect();
543 tools::Rectangle aCellRect = ScDrawLayer::GetCellRect( rDoc, pObjData->maStart, true);
544
545 // For graphic objects, we want to keep the aspect ratio
546 if (pObj->shouldKeepAspectRatio())
547 {
548 tools::Long nWidth = aGraphicRect.GetWidth();
549 assert(nWidth && "div-by-zero");
550 double fScaleX = static_cast<double>(aCellRect.GetWidth()) / static_cast<double>(nWidth);
551 tools::Long nHeight = aGraphicRect.GetHeight();
552 assert(nHeight && "div-by-zero");
553 double fScaleY = static_cast<double>(aCellRect.GetHeight()) / static_cast<double>(nHeight);
554 double fScaleMin = std::min(fScaleX, fScaleY);
555
556 aCellRect.setWidth(static_cast<double>(aGraphicRect.GetWidth()) * fScaleMin);
557 aCellRect.setHeight(static_cast<double>(aGraphicRect.GetHeight()) * fScaleMin);
558 }
559
560 pUndoGroup->AddAction( std::make_unique<SdrUndoGeoObj>( *pObj ) );
561 if (pObj->GetObjIdentifier() == SdrObjKind::CustomShape)
562 pObj->AdjustToMaxRect(aCellRect);
563 else
564 pObj->SetSnapRect(aCellRect);
565
566 pUndoGroup->SetComment(ScResId( STR_UNDO_FITCELLSIZE ));
567 ScDocShell* pDocSh = pViewData->GetDocShell();
568 pDocSh->GetUndoManager()->AddUndoAction(std::move(pUndoGroup));
569
570}
571
572/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual std::unique_ptr< SdrModel > CreateMarkedObjModel() const override
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:3046
double GetOutputFactor() const
Definition: docsh.hxx:358
virtual SfxUndoManager * GetUndoManager() override
Definition: docsh.cxx:2968
SC_DLLPUBLIC bool GetTable(const OUString &rName, SCTAB &rTab) const
Definition: document.cxx:244
void AppendTabOnLoad(const OUString &rName)
Definition: document.cxx:453
SC_DLLPUBLIC void CopyStaticToDocument(const ScRange &rSrcRange, SCTAB nDestTab, ScDocument &rDestDoc)
Copy only raw cell values to another document.
Definition: document.cxx:2214
void SetTabNameOnLoad(SCTAB nTab, const OUString &rName)
Definition: document.cxx:465
SC_DLLPUBLIC bool GetTableArea(SCTAB nTab, SCCOL &rEndCol, SCROW &rEndRow, bool bCalcHiddens=false) const
Definition: document.cxx:1008
SC_DLLPUBLIC bool GetName(SCTAB nTab, OUString &rName) const
Definition: document.cxx:204
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:2385
static ScDrawObjData * GetObjData(SdrObject *pObj, bool bCreate=false)
Definition: drwlayer.cxx:2874
static ScAnchorType GetAnchorType(const SdrObject &)
Definition: drwlayer.cxx:2724
static void SetGlobalDrawPersist(SfxObjectShell *pPersist)
Definition: drwlayer.cxx:2927
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:411
void BeginDrag(vcl::Window *pWindow, const Point &rStartPos)
Definition: drawvie4.cxx:59
css::uno::Reference< css::datatransfer::XTransferable > CopyToTransferable()
Definition: drawvie4.cxx:375
void DoCopy()
Definition: drawvie4.cxx:333
SCTAB nTab
Definition: drawview.hxx:38
static void CheckOle(const SdrMarkList &rMarkList, bool &rAnyOle, bool &rOneOle)
Definition: drawvie4.cxx:328
ScDocument & rDoc
needed ?
Definition: drawview.hxx:37
VclPtr< OutputDevice > pDev
Definition: drawview.hxx:36
void SetMarkedOriginalSize()
Definition: drawvie4.cxx:432
void FitToCellSize()
Definition: drawvie4.cxx:515
static SC_DLLPUBLIC double nScreenPPTX
Horizontal pixel per twips factor.
Definition: global.hxx:589
static SC_DLLPUBLIC double nScreenPPTY
Vertical pixel per twips factor.
Definition: global.hxx:591
static tools::SvRef< ScDocShell > xDrawClipDocShellRef
Definition: global.hxx:593
::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:810
ScDocShell * GetDocShell() const
Definition: viewdata.hxx:354
ScGridWindow * GetActiveWin()
Definition: viewdata.cxx:3162
virtual void BrkAction() override
const Graphic & GetGraphic() const
Size getOriginalSize() const
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
int nCount
constexpr double nPPTX
constexpr double nPPTY
#define TOOLS_WARN_EXCEPTION(area, stream)
Point aDragStartDiff
Definition: drawvie4.cxx:57
ScAnchorType
Definition: global.hxx:374
@ SCA_CELL_RESIZE
Definition: global.hxx:376
@ SCA_CELL
Definition: global.hxx:375
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:247
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