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 <vcl/window.hxx>
25 #include <unotools/charclass.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 
50 ScAreaLink::ScAreaLink( SfxObjectShell* pShell, const OUString& rFile,
51  const OUString& rFilter, const OUString& rOpt,
52  const OUString& rArea, const ScRange& rDest,
53  sal_uLong nRefresh ) :
55  ScRefreshTimer ( nRefresh ),
56  m_pDocSh(static_cast<ScDocShell*>(pShell)),
57  aFileName (rFile),
58  aFilterName (rFilter),
59  aOptions (rOpt),
60  aSourceArea (rArea),
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 
76 void ScAreaLink::Edit(weld::Window* pParent, const Link<SvBaseLink&,void>& /* rEndEditHdl */ )
77 {
78  // use own dialog instead of SvBaseLink::Edit...
80 
82  pDlg->InitFromOldLink( aFileName, aFilterName, aOptions, aSourceArea, GetRefreshDelay() );
83  if ( pDlg->Execute() == RET_OK )
84  {
85  aOptions = pDlg->GetOptions();
86  Refresh( pDlg->GetURL(), pDlg->GetFilter(),
87  pDlg->GetSource(), pDlg->GetRefresh() );
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, GetRefreshDelay() );
130  }
131 
132  return SUCCESS;
133 }
134 
136 {
137  // delete link: Undo
138 
139  ScDocument& rDoc = m_pDocSh->GetDocument();
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 
161 void 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 
175 bool ScAreaLink::IsEqual( const OUString& rFile, const OUString& rFilter, const OUString& rOpt,
176  const OUString& 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 >pSrcDoc<, return it in >rRange<
183 bool ScAreaLink::FindExtRange( ScRange& rRange, const ScDocument* pSrcDoc, const OUString& rAreaName )
184 {
185  bool bFound = false;
186  OUString aUpperName = ScGlobal::getCharClassPtr()->uppercase(rAreaName);
187  ScRangeName* pNames = pSrcDoc->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 = pSrcDoc->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(pSrcDoc->GetAddressConvention(), 0, 0);
214  if ( rRange.ParseAny( rAreaName, pSrcDoc, aDetails ) & ScRefFlags::VALID )
215  bFound = true;
216  }
217  return bFound;
218 }
219 
220 // execute:
221 
222 bool ScAreaLink::Refresh( const OUString& rNewFile, const OUString& rNewFilter,
223  const OUString& rNewArea, sal_uLong nNewRefresh )
224 {
225  // load document - like TabLink
226 
227  if (rNewFile.isEmpty() || rNewFilter.isEmpty())
228  return false;
229 
230  OUString aNewUrl( ScGlobal::GetAbsDocName( rNewFile, m_pDocSh ) );
231  bool bNewUrlName = (aNewUrl != aFileName);
232 
233  std::shared_ptr<const SfxFilter> pFilter = m_pDocSh->GetFactory().GetFilterContainer()->GetFilter4FilterName(rNewFilter);
234  if (!pFilter)
235  return false;
236 
237  ScDocument& rDoc = m_pDocSh->GetDocument();
238 
239  bool bUndo (rDoc.IsUndoEnabled());
240  rDoc.SetInLinkUpdate( true );
241 
242  // if new filter was selected, forget options
243  if ( rNewFilter != aFilterName )
244  aOptions.clear();
245 
246  SfxMedium* pMed = ScDocumentLoader::CreateMedium( aNewUrl, pFilter, aOptions);
247 
248  // aRef->DoClose() will be closed explicitly, but it is still more safe to use SfxObjectShellLock here
249  ScDocShell* pSrcShell = new ScDocShell(SfxModelFlags::EMBEDDED_OBJECT | SfxModelFlags::DISABLE_EMBEDDED_SCRIPTS);
250  SfxObjectShellLock aRef = pSrcShell;
251  pSrcShell->DoLoad(pMed);
252 
253  ScDocument& rSrcDoc = pSrcShell->GetDocument();
254 
255  // options could have been set
256  OUString aNewOpt = ScDocumentLoader::GetOptions(*pMed);
257  if (aNewOpt.isEmpty())
258  aNewOpt = aOptions;
259 
260  // correct source range name list for web query import
261  OUString aTempArea;
262 
263  if( rNewFilter == ScDocShell::GetWebQueryFilterName() )
264  aTempArea = ScFormatFilter::Get().GetHTMLRangeNameList( &rSrcDoc, rNewArea );
265  else
266  aTempArea = rNewArea;
267 
268  // find total size of source area
269  SCCOL nWidth = 0;
270  SCROW nHeight = 0;
271  ScRangeList aSourceRanges;
272 
273  if (rNewFilter == SC_TEXT_CSV_FILTER_NAME && aTempArea == "CSV_all")
274  {
275  // The dummy All range. All data, including top/left empty
276  // rows/columns.
277  aTempArea.clear();
278  SCCOL nEndCol = 0;
279  SCROW nEndRow = 0;
280  if (rSrcDoc.GetCellArea( 0, nEndCol, nEndRow))
281  {
282  aSourceRanges.push_back( ScRange( 0,0,0, nEndCol, nEndRow, 0));
283  nWidth = nEndCol + 1;
284  nHeight = nEndRow + 2;
285  }
286  }
287 
288  if (!aTempArea.isEmpty())
289  {
290  sal_Int32 nIdx {0};
291  do
292  {
293  ScRange aTokenRange;
294  if( FindExtRange( aTokenRange, &rSrcDoc, aTempArea.getToken( 0, ';', nIdx ) ) )
295  {
296  aSourceRanges.push_back( aTokenRange);
297  // columns: find maximum
298  nWidth = std::max( nWidth, static_cast<SCCOL>(aTokenRange.aEnd.Col() - aTokenRange.aStart.Col() + 1) );
299  // rows: add row range + 1 empty row
300  nHeight += aTokenRange.aEnd.Row() - aTokenRange.aStart.Row() + 2;
301  }
302  }
303  while (nIdx>0);
304  }
305  // remove the last empty row
306  if( nHeight > 0 )
307  nHeight--;
308 
309  // delete old data / copy new
310 
311  ScAddress aDestPos = aDestArea.aStart;
312  SCTAB nDestTab = aDestPos.Tab();
313  ScRange aOldRange = aDestArea;
314  ScRange aNewRange = aDestArea; // old range, if file not found or similar
315  if (nWidth > 0 && nHeight > 0)
316  {
317  aNewRange.aEnd.SetCol( aNewRange.aStart.Col() + nWidth - 1 );
318  aNewRange.aEnd.SetRow( aNewRange.aStart.Row() + nHeight - 1 );
319  }
320 
322  bool bCanDo = rDoc.ValidColRow( aNewRange.aEnd.Col(), aNewRange.aEnd.Row() ) &&
323  rDoc.CanFitBlock( aOldRange, aNewRange );
324  if (bCanDo)
325  {
326  ScDocShellModificator aModificator( *m_pDocSh );
327 
328  SCCOL nOldEndX = aOldRange.aEnd.Col();
329  SCROW nOldEndY = aOldRange.aEnd.Row();
330  SCCOL nNewEndX = aNewRange.aEnd.Col();
331  SCROW nNewEndY = aNewRange.aEnd.Row();
332  ScRange aMaxRange( aDestPos,
333  ScAddress(std::max(nOldEndX,nNewEndX), std::max(nOldEndY,nNewEndY), nDestTab) );
334 
335  // initialise Undo
336 
337  ScDocumentUniquePtr pUndoDoc;
338  if ( bAddUndo && bUndo )
339  {
340  pUndoDoc.reset(new ScDocument( SCDOCMODE_UNDO ));
341  if ( bDoInsert )
342  {
343  if ( nNewEndX != nOldEndX || nNewEndY != nOldEndY ) // range changed?
344  {
345  pUndoDoc->InitUndo( &rDoc, 0, rDoc.GetTableCount()-1 );
346  rDoc.CopyToDocument(0, 0, 0, rDoc.MaxCol(), rDoc.MaxRow(), MAXTAB,
347  InsertDeleteFlags::FORMULA, false, *pUndoDoc); // all formulas
348  }
349  else
350  pUndoDoc->InitUndo( &rDoc, nDestTab, nDestTab ); // only destination table
351  rDoc.CopyToDocument(aOldRange, InsertDeleteFlags::ALL & ~InsertDeleteFlags::NOTE, false, *pUndoDoc);
352  }
353  else // without insertion
354  {
355  pUndoDoc->InitUndo( &rDoc, nDestTab, nDestTab ); // only destination table
356  rDoc.CopyToDocument(aMaxRange, InsertDeleteFlags::ALL & ~InsertDeleteFlags::NOTE, false, *pUndoDoc);
357  }
358  }
359 
360  // insert / delete cells
361  // DeleteAreaTab also deletes MERGE_FLAG attributes
362 
363  if (bDoInsert)
364  rDoc.FitBlock( aOldRange, aNewRange ); // incl. deletion
365  else
367 
368  // copy data
369 
370  if (nWidth > 0 && nHeight > 0)
371  {
372  ScDocument aClipDoc( SCDOCMODE_CLIP );
373  ScRange aNewTokenRange( aNewRange.aStart );
374  for (size_t nRange = 0; nRange < aSourceRanges.size(); ++nRange)
375  {
376  ScRange const & rTokenRange( aSourceRanges[nRange]);
377  SCTAB nSrcTab = rTokenRange.aStart.Tab();
378  ScMarkData aSourceMark(rSrcDoc.GetSheetLimits());
379  aSourceMark.SelectOneTable( nSrcTab ); // selecting for CopyToClip
380  aSourceMark.SetMarkArea( rTokenRange );
381 
382  ScClipParam aClipParam(rTokenRange, false);
383  rSrcDoc.CopyToClip(aClipParam, &aClipDoc, &aSourceMark, false, false);
384 
385  if ( aClipDoc.HasAttrib( 0,0,nSrcTab, rDoc.MaxCol(),rDoc.MaxRow(),nSrcTab,
387  {
389 
390  ScPatternAttr aPattern( rSrcDoc.GetPool() );
391  aPattern.GetItemSet().Put( ScMergeAttr() ); // Defaults
392  aPattern.GetItemSet().Put( ScMergeFlagAttr() );
393  aClipDoc.ApplyPatternAreaTab( 0,0, rDoc.MaxCol(),rDoc.MaxRow(), nSrcTab, aPattern );
394  }
395 
396  aNewTokenRange.aEnd.SetCol( aNewTokenRange.aStart.Col() + (rTokenRange.aEnd.Col() - rTokenRange.aStart.Col()) );
397  aNewTokenRange.aEnd.SetRow( aNewTokenRange.aStart.Row() + (rTokenRange.aEnd.Row() - rTokenRange.aStart.Row()) );
398  ScMarkData aDestMark(rDoc.GetSheetLimits());
399  aDestMark.SelectOneTable( nDestTab );
400  aDestMark.SetMarkArea( aNewTokenRange );
401  rDoc.CopyFromClip( aNewTokenRange, aDestMark, InsertDeleteFlags::ALL, nullptr, &aClipDoc, false );
402  aNewTokenRange.aStart.SetRow( aNewTokenRange.aEnd.Row() + 2 );
403  }
404  }
405  else
406  {
407  OUString aErr = ScResId(STR_LINKERROR);
408  rDoc.SetString( aDestPos.Col(), aDestPos.Row(), aDestPos.Tab(), aErr );
409  }
410 
411  // enter Undo
412 
413  if ( bAddUndo && bUndo)
414  {
416  pRedoDoc->InitUndo( &rDoc, nDestTab, nDestTab );
417  rDoc.CopyToDocument(aNewRange, InsertDeleteFlags::ALL & ~InsertDeleteFlags::NOTE, false, *pRedoDoc);
418 
420  std::make_unique<ScUndoUpdateAreaLink>( m_pDocSh,
422  aSourceArea, aOldRange, GetRefreshDelay(),
423  aNewUrl, rNewFilter, aNewOpt,
424  rNewArea, aNewRange, nNewRefresh,
425  std::move(pUndoDoc), std::move(pRedoDoc), bDoInsert ) );
426  }
427 
428  // remember new settings
429 
430  if ( bNewUrlName )
431  aFileName = aNewUrl;
432  if ( rNewFilter != aFilterName )
433  aFilterName = rNewFilter;
434  if ( rNewArea != aSourceArea )
435  aSourceArea = rNewArea;
436  if ( aNewOpt != aOptions )
437  aOptions = aNewOpt;
438 
439  if ( aNewRange != aDestArea )
440  aDestArea = aNewRange;
441 
442  if ( nNewRefresh != GetRefreshDelay() )
443  SetRefreshDelay( nNewRefresh );
444 
445  SCCOL nPaintEndX = std::max( aOldRange.aEnd.Col(), aNewRange.aEnd.Col() );
446  SCROW nPaintEndY = std::max( aOldRange.aEnd.Row(), aNewRange.aEnd.Row() );
447 
448  if ( aOldRange.aEnd.Col() != aNewRange.aEnd.Col() )
449  nPaintEndX = rDoc.MaxCol();
450  if ( aOldRange.aEnd.Row() != aNewRange.aEnd.Row() )
451  nPaintEndY = rDoc.MaxRow();
452 
453  if ( !m_pDocSh->AdjustRowHeight( aDestPos.Row(), nPaintEndY, nDestTab ) )
455  ScRange(aDestPos.Col(), aDestPos.Row(), nDestTab, nPaintEndX, nPaintEndY, nDestTab),
457  aModificator.SetDocumentModified();
458  }
459  else
460  {
461  // CanFitBlock sal_False -> Problems with summarized cells or table boundary reached!
463 
465  // "cannot insert rows"
467  std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr,
468  VclMessageType::Info, VclButtonsType::Ok,
469  ScResId(STR_MSSG_DOSUBTOTALS_2)));
470  xInfoBox->run();
471  }
472 
473  // clean up
474 
475  aRef->DoClose();
476 
477  rDoc.SetInLinkUpdate( false );
478 
479  if (bCanDo)
480  {
481  // notify Uno objects (for XRefreshListener)
483  ScLinkRefreshedHint aHint;
484  aHint.SetAreaLink( aDestPos );
485  rDoc.BroadcastUno( aHint );
486  }
487 
488  return bCanDo;
489 }
490 
491 IMPL_LINK_NOARG(ScAreaLink, RefreshHdl, Timer *, void)
492 {
493  Refresh( aFileName, aFilterName, aSourceArea, GetRefreshDelay() );
494 }
495 
496 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool CanFitBlock(const ScRange &rOld, const ScRange &rNew)
Definition: document.cxx:1831
SC_DLLPUBLIC ScRefFlags ParseAny(const OUString &, const ScDocument *, const ScAddress::Details &rDetails=ScAddress::detailsOOOa1)
Definition: address.cxx:1770
virtual SfxObjectFactory & GetFactory() const =0
void FitBlock(const ScRange &rOld, const ScRange &rNew, bool bClear=true)
Definition: document.cxx:1862
SC_DLLPUBLIC ScDBCollection * GetDBCollection() const
Definition: document.hxx:816
ScAddress aStart
Definition: address.hxx:500
todo: It should be possible to have MarkArrays for each table, in order to enable "search all" across...
Definition: markdata.hxx:43
SCROW Row() const
Definition: address.hxx:262
bool AdjustRowHeight(SCROW nStartRow, SCROW nEndRow, SCTAB nTab)
merge with docfunc
Definition: docsh5.cxx:405
std::unique_ptr< ScRefreshTimerControl > const & GetRefreshTimerControlAddress() const
Definition: document.hxx:2418
virtual OUString GetHTMLRangeNameList(ScDocument *pDoc, const OUString &rOrigName)=0
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:2801
void SetInLinkUpdate(bool bSet)
Definition: documen8.cxx:774
static vcl::Window * GetDefDialogParent()
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:2347
ScAddress aEnd
Definition: address.hxx:501
static OUString GetWebQueryFilterName()
Definition: docsh.cxx:2687
SC_DLLPUBLIC formula::FormulaGrammar::AddressConvention GetAddressConvention() const
Definition: documen3.cxx:475
SC_DLLPUBLIC bool HasAttrib(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2, HasAttrFlags nMask) const
Definition: document.cxx:5182
SC_DLLPUBLIC ScDocumentPool * GetPool()
Definition: document.cxx:6064
virtual SfxUndoManager * GetUndoManager() override
Definition: docsh.cxx:2805
weld::Window * GetFrameWeld() const
virtual VclPtr< AbstractScLinkedAreaDlg > CreateScLinkedAreaDlg(weld::Window *pParent)=0
SC_DLLPUBLIC SCROW MaxRow() const
Definition: document.hxx:873
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:2076
void push_back(const ScRange &rRange)
Definition: rangelst.cxx:1144
SCTAB Tab() const
Definition: address.hxx:271
void SetRow(SCROW nRowP)
Definition: address.hxx:275
SotClipboardFormatId
static OUString GetOptions(const SfxMedium &rMedium)
Definition: tablink.cxx:422
void SetCol(SCCOL nColP)
Definition: address.hxx:279
SC_DLLPUBLIC bool GetCellArea(SCTAB nTab, SCCOL &rEndCol, SCROW &rEndRow) const
Definition: document.cxx:1018
SC_DLLPUBLIC bool SetString(SCCOL nCol, SCROW nRow, SCTAB nTab, const OUString &rString, const ScSetStringParam *pParam=nullptr)
Definition: document.cxx:3366
static SC_DLLPUBLIC OUString GetAbsDocName(const OUString &rFileName, const SfxObjectShell *pShell)
Definition: global2.cxx:284
SC_DLLPUBLIC ScRangeData * findByUpperName(const OUString &rName)
Definition: rangenam.cxx:682
SC_DLLPUBLIC SCCOL MaxCol() const
Definition: document.hxx:872
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:2613
sal_Int16 SCCOL
Definition: types.hxx:22
ScSheetLimits & GetSheetLimits() const
Definition: document.hxx:874
size_t size() const
Definition: rangelst.hxx:90
OUString uppercase(const OUString &rStr, sal_Int32 nPos, sal_Int32 nCount) const
void SelectOneTable(SCTAB nTab)
Definition: markdata.cxx:189
OUString ScResId(const char *pId)
Definition: scdll.cxx:95
SC_DLLPUBLIC void ApplyPatternAreaTab(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab, const ScPatternAttr &rAttr)
Definition: document.cxx:4789
void BroadcastUno(const SfxHint &rHint)
Definition: documen3.cxx:930
const SCTAB MAXTAB
Definition: address.hxx:71
void PostPaint(SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab, SCCOL nEndCol, SCROW nEndRow, SCTAB nEndTab, PaintPartFlags nPart, sal_uInt16 nExtFlags=0)
Definition: docsh3.cxx:99
void GetArea(SCTAB &rTab, SCCOL &rCol1, SCROW &rRow1, SCCOL &rCol2, SCROW &rRow2) const
Definition: dbdata.cxx:301
void StopRefreshTimer()
SCCOL Col() const
Definition: address.hxx:267
ScDBData * findByUpperName(const OUString &rName)
Definition: dbdata.cxx:1145
bool ValidColRow(SCCOL nCol, SCROW nRow) const
Definition: document.hxx:877
void SetAreaLink(const ScAddress &rPos)
Definition: hints.cxx:77
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:18
void SetStreamValid(SCTAB nTab, bool bSet, bool bIgnoreLock=false)
Definition: document.cxx:925
void MakeLnkName(OUString &rName, const OUString *pType, const OUString &rFile, const OUString &rLink, const OUString *pFilter)
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:38
RET_OK
#define SC_TEXT_CSV_FILTER_NAME
Definition: global.hxx:59
static SC_DLLPUBLIC const CharClass * getCharClassPtr()
Definition: global.cxx:1016
void * p
const ScDocument & GetDocument() const
Definition: docsh.hxx:216
SC_DLLPUBLIC bool IsValidReference(ScRange &rRef) const
Definition: rangenam.cxx:385
NamedDBs & getNamedDBs()
Definition: dbdata.hxx:315
void SetDocumentModified()
Definition: docsh.cxx:3158
bool IsUndoEnabled() const
Definition: document.hxx:1531
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:1955
SC_DLLPUBLIC sfx2::LinkManager * GetLinkManager()
Definition: documen2.cxx:215
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:450
SfxLinkUpdateMode
sal_Int16 SCTAB
Definition: types.hxx:23
void CopyToClip(const ScClipParam &rClipParam, ScDocument *pClipDoc, const ScMarkData *pMarks, bool bKeepScenarioFlags, bool bIncludeObjects)
Definition: document.cxx:2175