LibreOffice Module sc (master) 1
arealink.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 <sfx2/fcontnr.hxx>
21#include <sfx2/linkmgr.hxx>
22#include <utility>
23#include <vcl/svapp.hxx>
24#include <vcl/weld.hxx>
26#include <osl/diagnose.h>
27
28#include <arealink.hxx>
29
30#include <tablink.hxx>
31#include <document.hxx>
32#include <docsh.hxx>
33#include <rangenam.hxx>
34#include <dbdata.hxx>
35#include <undoblk.hxx>
36#include <globstr.hrc>
37#include <scresid.hxx>
38#include <markdata.hxx>
39#include <hints.hxx>
40#include <filter.hxx>
41
42#include <attrib.hxx>
43#include <patattr.hxx>
44#include <docpool.hxx>
45
46#include <scabstdlg.hxx>
47#include <clipparam.hxx>
48
49
50ScAreaLink::ScAreaLink( SfxObjectShell* pShell, OUString aFile,
51 OUString aFilter, OUString aOpt,
52 OUString aArea, const ScRange& rDest,
53 sal_Int32 nRefreshDelaySeconds ) :
55 ScRefreshTimer ( nRefreshDelaySeconds ),
56 m_pDocSh(static_cast<ScDocShell*>(pShell)),
57 aFileName (std::move(aFile)),
58 aFilterName (std::move(aFilter)),
59 aOptions (std::move(aOpt)),
60 aSourceArea (std::move(aArea)),
61 aDestArea (rDest),
62 bAddUndo (true),
63 bInCreate (false),
64 bDoInsert (true)
65{
66 OSL_ENSURE(dynamic_cast< const ScDocShell *>( pShell ) != nullptr, "ScAreaLink with wrong ObjectShell");
67 SetRefreshHandler( LINK( this, ScAreaLink, RefreshHdl ) );
69}
70
72{
74}
75
76void ScAreaLink::Edit(weld::Window* pParent, const Link<SvBaseLink&,void>& /* rEndEditHdl */ )
77{
78 // use own dialog instead of SvBaseLink::Edit...
80
83 if ( pDlg->Execute() == RET_OK )
84 {
85 aOptions = pDlg->GetOptions();
86 Refresh( pDlg->GetURL(), pDlg->GetFilter(),
87 pDlg->GetSource(), pDlg->GetRefreshDelaySeconds() );
88
89 // copy source data from members (set in Refresh) into link name for dialog
90 OUString aNewLinkName;
91 sfx2::MakeLnkName( aNewLinkName, nullptr, aFileName, aSourceArea, &aFilterName );
92 SetName( aNewLinkName );
93 }
94}
95
97 const OUString&, const css::uno::Any& )
98{
99 // Do not do anything at bInCreate so that update can be called to set
100 // the status in the LinkManager without changing the data in the document
101
102 if (bInCreate)
103 return SUCCESS;
104
106 if (pLinkManager!=nullptr)
107 {
108 OUString aFile, aArea, aFilter;
109 sfx2::LinkManager::GetDisplayNames(this, nullptr, &aFile, &aArea, &aFilter);
110
111 // the file dialog returns the filter name with the application prefix
112 // -> remove prefix
114
115 // dialog doesn't set area, so keep old one
116 if (aArea.isEmpty())
117 {
118 aArea = aSourceArea;
119
120 // adjust in dialog:
121 OUString aNewLinkName;
122 OUString aTmp = aFilter;
123 sfx2::MakeLnkName(aNewLinkName, nullptr, aFile, aArea, &aTmp);
124 aFilter = aTmp;
125 SetName( aNewLinkName );
126 }
127
128 tools::SvRef<sfx2::SvBaseLink> const xThis(this); // keep yourself alive
129 Refresh( aFile, aFilter, aArea, GetRefreshDelaySeconds() );
130 }
131
132 return SUCCESS;
133}
134
136{
137 // delete link: Undo
138
140 bool bUndo (rDoc.IsUndoEnabled());
141 if (bAddUndo && bUndo)
142 {
143 m_pDocSh->GetUndoManager()->AddUndoAction( std::make_unique<ScUndoRemoveAreaLink>( m_pDocSh,
146
147 bAddUndo = false; // only once
148 }
149
150 SCTAB nDestTab = aDestArea.aStart.Tab();
151 rDoc.SetStreamValid(nDestTab, false);
152
153 SvBaseLink::Closed();
154}
155
157{
158 aDestArea = rNew; // for Undo
159}
160
161void ScAreaLink::SetSource(const OUString& rDoc, const OUString& rFlt, const OUString& rOpt,
162 const OUString& rArea)
163{
164 aFileName = rDoc;
165 aFilterName = rFlt;
166 aOptions = rOpt;
167 aSourceArea = rArea;
168
169 // also update link name for dialog
170 OUString aNewLinkName;
171 sfx2::MakeLnkName( aNewLinkName, nullptr, aFileName, aSourceArea, &aFilterName );
172 SetName( aNewLinkName );
173}
174
175bool ScAreaLink::IsEqual( std::u16string_view rFile, std::u16string_view rFilter, std::u16string_view rOpt,
176 std::u16string_view rSource, const ScRange& rDest ) const
177{
178 return aFileName == rFile && aFilterName == rFilter && aOptions == rOpt &&
179 aSourceArea == rSource && aDestArea.aStart == rDest.aStart;
180}
181
182// find a range with name >rAreaName< in >rSrcDoc<, return it in >rRange<
183bool ScAreaLink::FindExtRange( ScRange& rRange, const ScDocument& rSrcDoc, const OUString& rAreaName )
184{
185 bool bFound = false;
186 OUString aUpperName = ScGlobal::getCharClass().uppercase(rAreaName);
187 ScRangeName* pNames = rSrcDoc.GetRangeName();
188 if (pNames) // named ranges
189 {
190 const ScRangeData* p = pNames->findByUpperName(aUpperName);
191 if (p && p->IsValidReference(rRange))
192 bFound = true;
193 }
194 if (!bFound) // database ranges
195 {
196 ScDBCollection* pDBColl = rSrcDoc.GetDBCollection();
197 if (pDBColl)
198 {
199 const ScDBData* pDB = pDBColl->getNamedDBs().findByUpperName(aUpperName);
200 if (pDB)
201 {
202 SCTAB nTab;
203 SCCOL nCol1, nCol2;
204 SCROW nRow1, nRow2;
205 pDB->GetArea(nTab,nCol1,nRow1,nCol2,nRow2);
206 rRange = ScRange( nCol1,nRow1,nTab, nCol2,nRow2,nTab );
207 bFound = true;
208 }
209 }
210 }
211 if (!bFound) // direct reference (range or cell)
212 {
213 ScAddress::Details aDetails(rSrcDoc.GetAddressConvention(), 0, 0);
214 if ( rRange.ParseAny( rAreaName, rSrcDoc, aDetails ) & ScRefFlags::VALID )
215 bFound = true;
216 }
217 return bFound;
218}
219
220// execute:
221
222bool ScAreaLink::Refresh( const OUString& rNewFile, const OUString& rNewFilter,
223 const OUString& rNewArea, sal_Int32 nNewRefreshDelaySeconds )
224{
225 // load document - like TabLink
226
227 if (rNewFile.isEmpty() || rNewFilter.isEmpty())
228 return false;
229
231 return false;
232
233 OUString aNewUrl( ScGlobal::GetAbsDocName( rNewFile, m_pDocSh ) );
234 bool bNewUrlName = (aNewUrl != aFileName);
235
236 std::shared_ptr<const SfxFilter> pFilter = m_pDocSh->GetFactory().GetFilterContainer()->GetFilter4FilterName(rNewFilter);
237 if (!pFilter)
238 return false;
239
241
242 bool bUndo (rDoc.IsUndoEnabled());
243 rDoc.SetInLinkUpdate( true );
244
245 // if new filter was selected, forget options
246 if ( rNewFilter != aFilterName )
247 aOptions.clear();
248
249 SfxMedium* pMed = ScDocumentLoader::CreateMedium( aNewUrl, pFilter, aOptions);
250
251 // aRef->DoClose() will be closed explicitly, but it is still more safe to use SfxObjectShellLock here
252 ScDocShell* pSrcShell = new ScDocShell(SfxModelFlags::EMBEDDED_OBJECT | SfxModelFlags::DISABLE_EMBEDDED_SCRIPTS);
253 SfxObjectShellLock aRef = pSrcShell;
254 pSrcShell->DoLoad(pMed);
255
256 ScDocument& rSrcDoc = pSrcShell->GetDocument();
257
258 // options could have been set
259 OUString aNewOpt = ScDocumentLoader::GetOptions(*pMed);
260 if (aNewOpt.isEmpty())
261 aNewOpt = aOptions;
262
263 // correct source range name list for web query import
264 OUString aTempArea;
265
266 if( rNewFilter == ScDocShell::GetWebQueryFilterName() )
267 aTempArea = ScFormatFilter::Get().GetHTMLRangeNameList( rSrcDoc, rNewArea );
268 else
269 aTempArea = rNewArea;
270
271 // find total size of source area
272 SCCOL nWidth = 0;
273 SCROW nHeight = 0;
274 ScRangeList aSourceRanges;
275
276 if (rNewFilter == SC_TEXT_CSV_FILTER_NAME && aTempArea == "CSV_all")
277 {
278 // The dummy All range. All data, including top/left empty
279 // rows/columns.
280 aTempArea.clear();
281 SCCOL nEndCol = 0;
282 SCROW nEndRow = 0;
283 if (rSrcDoc.GetCellArea( 0, nEndCol, nEndRow))
284 {
285 aSourceRanges.push_back( ScRange( 0,0,0, nEndCol, nEndRow, 0));
286 nWidth = nEndCol + 1;
287 nHeight = nEndRow + 2;
288 }
289 }
290
291 if (!aTempArea.isEmpty())
292 {
293 sal_Int32 nIdx {0};
294 do
295 {
296 ScRange aTokenRange;
297 if( FindExtRange( aTokenRange, rSrcDoc, aTempArea.getToken( 0, ';', nIdx ) ) )
298 {
299 aSourceRanges.push_back( aTokenRange);
300 // columns: find maximum
301 nWidth = std::max( nWidth, static_cast<SCCOL>(aTokenRange.aEnd.Col() - aTokenRange.aStart.Col() + 1) );
302 // rows: add row range + 1 empty row
303 nHeight += aTokenRange.aEnd.Row() - aTokenRange.aStart.Row() + 2;
304 }
305 }
306 while (nIdx>0);
307 }
308 // remove the last empty row
309 if( nHeight > 0 )
310 nHeight--;
311
312 // delete old data / copy new
313
314 ScAddress aDestPos = aDestArea.aStart;
315 SCTAB nDestTab = aDestPos.Tab();
316 ScRange aOldRange = aDestArea;
317 ScRange aNewRange = aDestArea; // old range, if file not found or similar
318 if (nWidth > 0 && nHeight > 0)
319 {
320 aNewRange.aEnd.SetCol( aNewRange.aStart.Col() + nWidth - 1 );
321 aNewRange.aEnd.SetRow( aNewRange.aStart.Row() + nHeight - 1 );
322 }
323
325 bool bCanDo = rDoc.ValidColRow( aNewRange.aEnd.Col(), aNewRange.aEnd.Row() ) &&
326 rDoc.CanFitBlock( aOldRange, aNewRange );
327 if (bCanDo)
328 {
329 ScDocShellModificator aModificator( *m_pDocSh );
330
331 SCCOL nOldEndX = aOldRange.aEnd.Col();
332 SCROW nOldEndY = aOldRange.aEnd.Row();
333 SCCOL nNewEndX = aNewRange.aEnd.Col();
334 SCROW nNewEndY = aNewRange.aEnd.Row();
335 ScRange aMaxRange( aDestPos,
336 ScAddress(std::max(nOldEndX,nNewEndX), std::max(nOldEndY,nNewEndY), nDestTab) );
337
338 // initialise Undo
339
340 ScDocumentUniquePtr pUndoDoc;
341 if ( bAddUndo && bUndo )
342 {
343 pUndoDoc.reset(new ScDocument( SCDOCMODE_UNDO ));
344 if ( bDoInsert )
345 {
346 if ( nNewEndX != nOldEndX || nNewEndY != nOldEndY ) // range changed?
347 {
348 pUndoDoc->InitUndo( rDoc, 0, rDoc.GetTableCount()-1 );
349 rDoc.CopyToDocument(0, 0, 0, rDoc.MaxCol(), rDoc.MaxRow(), MAXTAB,
350 InsertDeleteFlags::FORMULA, false, *pUndoDoc); // all formulas
351 }
352 else
353 pUndoDoc->InitUndo( rDoc, nDestTab, nDestTab ); // only destination table
354 rDoc.CopyToDocument(aOldRange, InsertDeleteFlags::ALL & ~InsertDeleteFlags::NOTE, false, *pUndoDoc);
355 }
356 else // without insertion
357 {
358 pUndoDoc->InitUndo( rDoc, nDestTab, nDestTab ); // only destination table
359 rDoc.CopyToDocument(aMaxRange, InsertDeleteFlags::ALL & ~InsertDeleteFlags::NOTE, false, *pUndoDoc);
360 }
361 }
362
363 // insert / delete cells
364 // DeleteAreaTab also deletes MERGE_FLAG attributes
365
366 if (bDoInsert)
367 rDoc.FitBlock( aOldRange, aNewRange ); // incl. deletion
368 else
370
371 // copy data
372
373 if (nWidth > 0 && nHeight > 0)
374 {
375 ScDocument aClipDoc( SCDOCMODE_CLIP );
376 ScRange aNewTokenRange( aNewRange.aStart );
377 for (size_t nRange = 0; nRange < aSourceRanges.size(); ++nRange)
378 {
379 ScRange const & rTokenRange( aSourceRanges[nRange]);
380 SCTAB nSrcTab = rTokenRange.aStart.Tab();
381 ScMarkData aSourceMark(rSrcDoc.GetSheetLimits());
382 aSourceMark.SelectOneTable( nSrcTab ); // selecting for CopyToClip
383 aSourceMark.SetMarkArea( rTokenRange );
384
385 ScClipParam aClipParam(rTokenRange, false);
386 rSrcDoc.CopyToClip(aClipParam, &aClipDoc, &aSourceMark, false, false);
387
388 if ( aClipDoc.HasAttrib( 0,0,nSrcTab, rDoc.MaxCol(),rDoc.MaxRow(),nSrcTab,
390 {
392
393 ScPatternAttr aPattern( rSrcDoc.GetPool() );
394 aPattern.GetItemSet().Put( ScMergeAttr() ); // Defaults
395 aPattern.GetItemSet().Put( ScMergeFlagAttr() );
396 aClipDoc.ApplyPatternAreaTab( 0,0, rDoc.MaxCol(),rDoc.MaxRow(), nSrcTab, aPattern );
397 }
398
399 aNewTokenRange.aEnd.SetCol( aNewTokenRange.aStart.Col() + (rTokenRange.aEnd.Col() - rTokenRange.aStart.Col()) );
400 aNewTokenRange.aEnd.SetRow( aNewTokenRange.aStart.Row() + (rTokenRange.aEnd.Row() - rTokenRange.aStart.Row()) );
401 ScMarkData aDestMark(rDoc.GetSheetLimits());
402 aDestMark.SelectOneTable( nDestTab );
403 aDestMark.SetMarkArea( aNewTokenRange );
404 rDoc.CopyFromClip( aNewTokenRange, aDestMark, InsertDeleteFlags::ALL, nullptr, &aClipDoc, false );
405 aNewTokenRange.aStart.SetRow( aNewTokenRange.aEnd.Row() + 2 );
406 }
407 }
408 else
409 {
410 OUString aErr = ScResId(STR_LINKERROR);
411 rDoc.SetString( aDestPos.Col(), aDestPos.Row(), aDestPos.Tab(), aErr );
412 }
413
414 // enter Undo
415
416 if ( bAddUndo && bUndo)
417 {
419 pRedoDoc->InitUndo( rDoc, nDestTab, nDestTab );
420 rDoc.CopyToDocument(aNewRange, InsertDeleteFlags::ALL & ~InsertDeleteFlags::NOTE, false, *pRedoDoc);
421
423 std::make_unique<ScUndoUpdateAreaLink>( m_pDocSh,
426 aNewUrl, rNewFilter, aNewOpt,
427 rNewArea, aNewRange, nNewRefreshDelaySeconds,
428 std::move(pUndoDoc), std::move(pRedoDoc), bDoInsert ) );
429 }
430
431 // remember new settings
432
433 if ( bNewUrlName )
434 aFileName = aNewUrl;
435 if ( rNewFilter != aFilterName )
436 aFilterName = rNewFilter;
437 if ( rNewArea != aSourceArea )
438 aSourceArea = rNewArea;
439 if ( aNewOpt != aOptions )
440 aOptions = aNewOpt;
441
442 if ( aNewRange != aDestArea )
443 aDestArea = aNewRange;
444
445 if ( nNewRefreshDelaySeconds != GetRefreshDelaySeconds() )
446 SetRefreshDelay( nNewRefreshDelaySeconds );
447
448 SCCOL nPaintEndX = std::max( aOldRange.aEnd.Col(), aNewRange.aEnd.Col() );
449 SCROW nPaintEndY = std::max( aOldRange.aEnd.Row(), aNewRange.aEnd.Row() );
450
451 if ( aOldRange.aEnd.Col() != aNewRange.aEnd.Col() )
452 nPaintEndX = rDoc.MaxCol();
453 if ( aOldRange.aEnd.Row() != aNewRange.aEnd.Row() )
454 nPaintEndY = rDoc.MaxRow();
455
456 if ( !m_pDocSh->AdjustRowHeight( aDestPos.Row(), nPaintEndY, nDestTab ) )
458 ScRange(aDestPos.Col(), aDestPos.Row(), nDestTab, nPaintEndX, nPaintEndY, nDestTab),
460 aModificator.SetDocumentModified();
461 }
462 else
463 {
464 // CanFitBlock sal_False -> Problems with summarized cells or table boundary reached!
466
468 // "cannot insert rows"
470 std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pWin,
471 VclMessageType::Info, VclButtonsType::Ok,
472 ScResId(STR_MSSG_DOSUBTOTALS_2)));
473 xInfoBox->run();
474 }
475
476 // clean up
477
478 aRef->DoClose();
479
480 rDoc.SetInLinkUpdate( false );
481
482 if (bCanDo)
483 {
484 // notify Uno objects (for XRefreshListener)
487 aHint.SetAreaLink( aDestPos );
488 rDoc.BroadcastUno( aHint );
489 }
490
491 return bCanDo;
492}
493
494IMPL_LINK_NOARG(ScAreaLink, RefreshHdl, Timer *, void)
495{
496 Refresh( aFileName, aFilterName, aSourceArea, GetRefreshDelaySeconds() );
497}
498
499/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const SCTAB MAXTAB
Definition: address.hxx:70
static weld::Window * GetFrameWeld(const css::uno::Reference< css::awt::XWindow > &rWindow)
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, bool bMobile=false)
OUString uppercase(const OUString &rStr, sal_Int32 nPos, sal_Int32 nCount) const
virtual VclPtr< AbstractScLinkedAreaDlg > CreateScLinkedAreaDlg(weld::Widget *pParent)=0
static SC_DLLPUBLIC ScAbstractDialogFactory * Create()
Definition: scabstdlg.cxx:37
SCTAB Tab() const
Definition: address.hxx:283
void SetCol(SCCOL nColP)
Definition: address.hxx:291
SCROW Row() const
Definition: address.hxx:274
void SetRow(SCROW nRowP)
Definition: address.hxx:287
SCCOL Col() const
Definition: address.hxx:279
ScDBData * findByUpperName(const OUString &rName)
Definition: dbdata.cxx:1210
NamedDBs & getNamedDBs()
Definition: dbdata.hxx:316
void GetArea(SCTAB &rTab, SCCOL &rCol1, SCROW &rRow1, SCCOL &rCol2, SCROW &rRow2) const
Definition: dbdata.cxx:300
Create before modifications of the document and destroy thereafter.
Definition: docsh.hxx:455
void SetDocumentModified()
Definition: docsh.cxx:3297
const ScDocument & GetDocument() const
Definition: docsh.hxx:220
static OUString GetWebQueryFilterName()
Definition: docsh.cxx:2828
void PostPaint(SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab, SCCOL nEndCol, SCROW nEndRow, SCTAB nEndTab, PaintPartFlags nPart, sal_uInt16 nExtFlags=0)
Definition: docsh3.cxx:101
bool AdjustRowHeight(SCROW nStartRow, SCROW nEndRow, SCTAB nTab)
merge with docfunc
Definition: docsh5.cxx:404
virtual SfxUndoManager * GetUndoManager() override
Definition: docsh.cxx:2945
static SfxMedium * CreateMedium(const OUString &rFileName, std::shared_ptr< const SfxFilter > const &pFilter, const OUString &rOptions, weld::Window *pInteractionParent=nullptr)
Create SfxMedium for stream read with SfxFilter and filter options set at the medium's SfxItemSet.
Definition: tablink.cxx:494
static void RemoveAppPrefix(OUString &rFilterName)
Definition: tablink.cxx:487
static OUString GetOptions(const SfxMedium &rMedium)
Definition: tablink.cxx:423
ScSheetLimits & GetSheetLimits() const
Definition: document.hxx:897
SC_DLLPUBLIC void CopyFromClip(const ScRange &rDestRange, const ScMarkData &rMark, InsertDeleteFlags nInsFlag, ScDocument *pRefUndoDoc, ScDocument *pClipDoc, bool bResetCut=true, bool bAsLink=false, bool bIncludeFiltered=true, bool bSkipEmptyCells=false, const ScRangeList *pDestRanges=nullptr)
Paste data from a clipboard document into this document.
Definition: document.cxx:2852
SC_DLLPUBLIC SCCOL MaxCol() const
Definition: document.hxx:891
SC_DLLPUBLIC ScDocumentPool * GetPool()
Definition: document.cxx:6170
SC_DLLPUBLIC void ApplyPatternAreaTab(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab, const ScPatternAttr &rAttr)
Definition: document.cxx:4864
SC_DLLPUBLIC formula::FormulaGrammar::AddressConvention GetAddressConvention() const
Definition: documen3.cxx:500
SC_DLLPUBLIC SCROW MaxRow() const
Definition: document.hxx:892
std::unique_ptr< ScRefreshTimerControl > const & GetRefreshTimerControlAddress() const
Definition: document.hxx:2513
void SetStreamValid(SCTAB nTab, bool bSet, bool bIgnoreLock=false)
Definition: document.cxx:937
SC_DLLPUBLIC void CopyToClip(const ScClipParam &rClipParam, ScDocument *pClipDoc, const ScMarkData *pMarks, bool bKeepScenarioFlags, bool bIncludeObjects)
Definition: document.cxx:2173
void SetInLinkUpdate(bool bSet)
Definition: documen8.cxx:776
SC_DLLPUBLIC bool SetString(SCCOL nCol, SCROW nRow, SCTAB nTab, const OUString &rString, const ScSetStringParam *pParam=nullptr)
Definition: document.cxx:3422
SC_DLLPUBLIC bool HasAttrib(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2, HasAttrFlags nMask) const
Definition: document.cxx:5278
void CopyToDocument(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2, InsertDeleteFlags nFlags, bool bMarked, ScDocument &rDestDoc, const ScMarkData *pMarks=nullptr, bool bColRowFlags=true)
Definition: document.cxx:2072
SC_DLLPUBLIC ScDBCollection * GetDBCollection() const
Definition: document.hxx:826
void FitBlock(const ScRange &rOld, const ScRange &rNew, bool bClear=true)
Definition: document.cxx:1858
SC_DLLPUBLIC bool GetCellArea(SCTAB nTab, SCCOL &rEndCol, SCROW &rEndRow) const
Definition: document.cxx:1022
SC_DLLPUBLIC ScRangeName * GetRangeName(SCTAB nTab) const
Definition: documen3.cxx:174
SC_DLLPUBLIC void DeleteAreaTab(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, SCTAB nTab, InsertDeleteFlags nDelFlag)
Definition: document.cxx:1951
SC_DLLPUBLIC sfx2::LinkManager * GetLinkManager()
Definition: documen2.cxx:231
bool IsUndoEnabled() const
Definition: document.hxx:1593
bool CanFitBlock(const ScRange &rOld, const ScRange &rNew)
Definition: document.cxx:1827
void BroadcastUno(const SfxHint &rHint)
Definition: documen3.cxx:958
SC_DLLPUBLIC SCTAB GetTableCount() const
Definition: document.cxx:317
bool ValidColRow(SCCOL nCol, SCROW nRow) const
Definition: document.hxx:900
virtual OUString GetHTMLRangeNameList(ScDocument &rDoc, const OUString &rOrigName)=0
static SC_DLLPUBLIC ScFormatFilterPlugin & Get()
Definition: impex.cxx:2672
static SC_DLLPUBLIC OUString GetAbsDocName(const OUString &rFileName, const SfxObjectShell *pShell)
Definition: global2.cxx:287
static SC_DLLPUBLIC const CharClass & getCharClass()
Definition: global.cxx:1062
void SetAreaLink(const ScAddress &rPos)
Definition: hints.cxx:77
todo: It should be possible to have MarkArrays for each table, in order to enable "search all" across...
Definition: markdata.hxx:43
void SelectOneTable(SCTAB nTab)
Definition: markdata.cxx:174
void SetMarkArea(const ScRange &rRange)
Definition: markdata.cxx:92
SfxItemSet & GetItemSet()
Definition: patattr.hxx:155
void push_back(const ScRange &rRange)
Definition: rangelst.cxx:1137
size_t size() const
Definition: rangelst.hxx:89
SC_DLLPUBLIC ScRangeData * findByUpperName(const OUString &rName)
Definition: rangenam.cxx:704
ScAddress aEnd
Definition: address.hxx:498
ScRefFlags ParseAny(const OUString &, const ScDocument &, const ScAddress::Details &rDetails=ScAddress::detailsOOOa1)
Definition: address.cxx:1733
ScAddress aStart
Definition: address.hxx:497
sal_Int32 GetRefreshDelaySeconds() const
void StopRefreshTimer()
void SetRefreshHandler(const Link< Timer *, void > &rLink)
void SetRefreshControl(std::unique_ptr< ScRefreshTimerControl > const *pp)
void SetRefreshDelay(sal_Int32 nSeconds)
std::shared_ptr< const SfxFilter > GetFilter4FilterName(const OUString &rName, SfxFilterFlags nMust=SfxFilterFlags::NONE, SfxFilterFlags nDont=SFX_FILTER_NOTINSTALLED) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
SfxFilterContainer * GetFilterContainer() const
comphelper::EmbeddedObjectContainer & GetEmbeddedObjectContainer() const
virtual SfxObjectFactory & GetFactory() const=0
css::uno::Reference< css::awt::XWindow > GetDialogParent(SfxMedium const *pMedium=nullptr)
bool DoLoad(SfxMedium *pMedium)
virtual void AddUndoAction(std::unique_ptr< SfxUndoAction > pAction, bool bTryMerg=false)
static bool GetDisplayNames(const SvBaseLink *, OUString *pType, OUString *pFile=nullptr, OUString *pLink=nullptr, OUString *pFilter=nullptr)
std::unique_ptr< ScDocument, o3tl::default_delete< ScDocument > > ScDocumentUniquePtr
Definition: document.hxx:2717
@ SCDOCMODE_CLIP
Definition: document.hxx:256
@ SCDOCMODE_UNDO
Definition: document.hxx:257
SotClipboardFormatId
constexpr OUStringLiteral SC_TEXT_CSV_FILTER_NAME
Definition: global.hxx:63
@ NOTE
Strings (and string results if InsertDeleteFlags::FORMULA is not set).
@ FORMULA
Cell notes.
void * p
SfxLinkUpdateMode
void MakeLnkName(OUString &rName, const OUString *pType, std::u16string_view rFile, std::u16string_view rLink, const OUString *pFilter)
OUString ScResId(TranslateId aId)
Definition: scdll.cxx:90
This struct stores general clipboard parameters associated with a ScDocument instance created in clip...
Definition: clipparam.hxx:31
sal_Int16 SCTAB
Definition: types.hxx:22
sal_Int16 SCCOL
Definition: types.hxx:21
sal_Int32 SCROW
Definition: types.hxx:17
RET_OK