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