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::getCharClassPtr()->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 
229  OUString aNewUrl( ScGlobal::GetAbsDocName( rNewFile, m_pDocSh ) );
230  bool bNewUrlName = (aNewUrl != aFileName);
231 
232  std::shared_ptr<const SfxFilter> pFilter = m_pDocSh->GetFactory().GetFilterContainer()->GetFilter4FilterName(rNewFilter);
233  if (!pFilter)
234  return false;
235 
236  ScDocument& rDoc = m_pDocSh->GetDocument();
237 
238  bool bUndo (rDoc.IsUndoEnabled());
239  rDoc.SetInLinkUpdate( true );
240 
241  // if new filter was selected, forget options
242  if ( rNewFilter != aFilterName )
243  aOptions.clear();
244 
245  SfxMedium* pMed = ScDocumentLoader::CreateMedium( aNewUrl, pFilter, aOptions);
246 
247  // aRef->DoClose() will be closed explicitly, but it is still more safe to use SfxObjectShellLock here
248  ScDocShell* pSrcShell = new ScDocShell(SfxModelFlags::EMBEDDED_OBJECT | SfxModelFlags::DISABLE_EMBEDDED_SCRIPTS);
249  SfxObjectShellLock aRef = pSrcShell;
250  pSrcShell->DoLoad(pMed);
251 
252  ScDocument& rSrcDoc = pSrcShell->GetDocument();
253 
254  // options could have been set
255  OUString aNewOpt = ScDocumentLoader::GetOptions(*pMed);
256  if (aNewOpt.isEmpty())
257  aNewOpt = aOptions;
258 
259  // correct source range name list for web query import
260  OUString aTempArea;
261 
262  if( rNewFilter == ScDocShell::GetWebQueryFilterName() )
263  aTempArea = ScFormatFilter::Get().GetHTMLRangeNameList( rSrcDoc, rNewArea );
264  else
265  aTempArea = rNewArea;
266 
267  // find total size of source area
268  SCCOL nWidth = 0;
269  SCROW nHeight = 0;
270  ScRangeList aSourceRanges;
271 
272  if (rNewFilter == SC_TEXT_CSV_FILTER_NAME && aTempArea == "CSV_all")
273  {
274  // The dummy All range. All data, including top/left empty
275  // rows/columns.
276  aTempArea.clear();
277  SCCOL nEndCol = 0;
278  SCROW nEndRow = 0;
279  if (rSrcDoc.GetCellArea( 0, nEndCol, nEndRow))
280  {
281  aSourceRanges.push_back( ScRange( 0,0,0, nEndCol, nEndRow, 0));
282  nWidth = nEndCol + 1;
283  nHeight = nEndRow + 2;
284  }
285  }
286 
287  if (!aTempArea.isEmpty())
288  {
289  sal_Int32 nIdx {0};
290  do
291  {
292  ScRange aTokenRange;
293  if( FindExtRange( aTokenRange, rSrcDoc, aTempArea.getToken( 0, ';', nIdx ) ) )
294  {
295  aSourceRanges.push_back( aTokenRange);
296  // columns: find maximum
297  nWidth = std::max( nWidth, static_cast<SCCOL>(aTokenRange.aEnd.Col() - aTokenRange.aStart.Col() + 1) );
298  // rows: add row range + 1 empty row
299  nHeight += aTokenRange.aEnd.Row() - aTokenRange.aStart.Row() + 2;
300  }
301  }
302  while (nIdx>0);
303  }
304  // remove the last empty row
305  if( nHeight > 0 )
306  nHeight--;
307 
308  // delete old data / copy new
309 
310  ScAddress aDestPos = aDestArea.aStart;
311  SCTAB nDestTab = aDestPos.Tab();
312  ScRange aOldRange = aDestArea;
313  ScRange aNewRange = aDestArea; // old range, if file not found or similar
314  if (nWidth > 0 && nHeight > 0)
315  {
316  aNewRange.aEnd.SetCol( aNewRange.aStart.Col() + nWidth - 1 );
317  aNewRange.aEnd.SetRow( aNewRange.aStart.Row() + nHeight - 1 );
318  }
319 
321  bool bCanDo = rDoc.ValidColRow( aNewRange.aEnd.Col(), aNewRange.aEnd.Row() ) &&
322  rDoc.CanFitBlock( aOldRange, aNewRange );
323  if (bCanDo)
324  {
325  ScDocShellModificator aModificator( *m_pDocSh );
326 
327  SCCOL nOldEndX = aOldRange.aEnd.Col();
328  SCROW nOldEndY = aOldRange.aEnd.Row();
329  SCCOL nNewEndX = aNewRange.aEnd.Col();
330  SCROW nNewEndY = aNewRange.aEnd.Row();
331  ScRange aMaxRange( aDestPos,
332  ScAddress(std::max(nOldEndX,nNewEndX), std::max(nOldEndY,nNewEndY), nDestTab) );
333 
334  // initialise Undo
335 
336  ScDocumentUniquePtr pUndoDoc;
337  if ( bAddUndo && bUndo )
338  {
339  pUndoDoc.reset(new ScDocument( SCDOCMODE_UNDO ));
340  if ( bDoInsert )
341  {
342  if ( nNewEndX != nOldEndX || nNewEndY != nOldEndY ) // range changed?
343  {
344  pUndoDoc->InitUndo( rDoc, 0, rDoc.GetTableCount()-1 );
345  rDoc.CopyToDocument(0, 0, 0, rDoc.MaxCol(), rDoc.MaxRow(), MAXTAB,
346  InsertDeleteFlags::FORMULA, false, *pUndoDoc); // all formulas
347  }
348  else
349  pUndoDoc->InitUndo( rDoc, nDestTab, nDestTab ); // only destination table
350  rDoc.CopyToDocument(aOldRange, InsertDeleteFlags::ALL & ~InsertDeleteFlags::NOTE, false, *pUndoDoc);
351  }
352  else // without insertion
353  {
354  pUndoDoc->InitUndo( rDoc, nDestTab, nDestTab ); // only destination table
355  rDoc.CopyToDocument(aMaxRange, InsertDeleteFlags::ALL & ~InsertDeleteFlags::NOTE, false, *pUndoDoc);
356  }
357  }
358 
359  // insert / delete cells
360  // DeleteAreaTab also deletes MERGE_FLAG attributes
361 
362  if (bDoInsert)
363  rDoc.FitBlock( aOldRange, aNewRange ); // incl. deletion
364  else
366 
367  // copy data
368 
369  if (nWidth > 0 && nHeight > 0)
370  {
371  ScDocument aClipDoc( SCDOCMODE_CLIP );
372  ScRange aNewTokenRange( aNewRange.aStart );
373  for (size_t nRange = 0; nRange < aSourceRanges.size(); ++nRange)
374  {
375  ScRange const & rTokenRange( aSourceRanges[nRange]);
376  SCTAB nSrcTab = rTokenRange.aStart.Tab();
377  ScMarkData aSourceMark(rSrcDoc.GetSheetLimits());
378  aSourceMark.SelectOneTable( nSrcTab ); // selecting for CopyToClip
379  aSourceMark.SetMarkArea( rTokenRange );
380 
381  ScClipParam aClipParam(rTokenRange, false);
382  rSrcDoc.CopyToClip(aClipParam, &aClipDoc, &aSourceMark, false, false);
383 
384  if ( aClipDoc.HasAttrib( 0,0,nSrcTab, rDoc.MaxCol(),rDoc.MaxRow(),nSrcTab,
386  {
388 
389  ScPatternAttr aPattern( rSrcDoc.GetPool() );
390  aPattern.GetItemSet().Put( ScMergeAttr() ); // Defaults
391  aPattern.GetItemSet().Put( ScMergeFlagAttr() );
392  aClipDoc.ApplyPatternAreaTab( 0,0, rDoc.MaxCol(),rDoc.MaxRow(), nSrcTab, aPattern );
393  }
394 
395  aNewTokenRange.aEnd.SetCol( aNewTokenRange.aStart.Col() + (rTokenRange.aEnd.Col() - rTokenRange.aStart.Col()) );
396  aNewTokenRange.aEnd.SetRow( aNewTokenRange.aStart.Row() + (rTokenRange.aEnd.Row() - rTokenRange.aStart.Row()) );
397  ScMarkData aDestMark(rDoc.GetSheetLimits());
398  aDestMark.SelectOneTable( nDestTab );
399  aDestMark.SetMarkArea( aNewTokenRange );
400  rDoc.CopyFromClip( aNewTokenRange, aDestMark, InsertDeleteFlags::ALL, nullptr, &aClipDoc, false );
401  aNewTokenRange.aStart.SetRow( aNewTokenRange.aEnd.Row() + 2 );
402  }
403  }
404  else
405  {
406  OUString aErr = ScResId(STR_LINKERROR);
407  rDoc.SetString( aDestPos.Col(), aDestPos.Row(), aDestPos.Tab(), aErr );
408  }
409 
410  // enter Undo
411 
412  if ( bAddUndo && bUndo)
413  {
415  pRedoDoc->InitUndo( rDoc, nDestTab, nDestTab );
416  rDoc.CopyToDocument(aNewRange, InsertDeleteFlags::ALL & ~InsertDeleteFlags::NOTE, false, *pRedoDoc);
417 
419  std::make_unique<ScUndoUpdateAreaLink>( m_pDocSh,
421  aSourceArea, aOldRange, GetRefreshDelay(),
422  aNewUrl, rNewFilter, aNewOpt,
423  rNewArea, aNewRange, nNewRefresh,
424  std::move(pUndoDoc), std::move(pRedoDoc), bDoInsert ) );
425  }
426 
427  // remember new settings
428 
429  if ( bNewUrlName )
430  aFileName = aNewUrl;
431  if ( rNewFilter != aFilterName )
432  aFilterName = rNewFilter;
433  if ( rNewArea != aSourceArea )
434  aSourceArea = rNewArea;
435  if ( aNewOpt != aOptions )
436  aOptions = aNewOpt;
437 
438  if ( aNewRange != aDestArea )
439  aDestArea = aNewRange;
440 
441  if ( nNewRefresh != GetRefreshDelay() )
442  SetRefreshDelay( nNewRefresh );
443 
444  SCCOL nPaintEndX = std::max( aOldRange.aEnd.Col(), aNewRange.aEnd.Col() );
445  SCROW nPaintEndY = std::max( aOldRange.aEnd.Row(), aNewRange.aEnd.Row() );
446 
447  if ( aOldRange.aEnd.Col() != aNewRange.aEnd.Col() )
448  nPaintEndX = rDoc.MaxCol();
449  if ( aOldRange.aEnd.Row() != aNewRange.aEnd.Row() )
450  nPaintEndY = rDoc.MaxRow();
451 
452  if ( !m_pDocSh->AdjustRowHeight( aDestPos.Row(), nPaintEndY, nDestTab ) )
454  ScRange(aDestPos.Col(), aDestPos.Row(), nDestTab, nPaintEndX, nPaintEndY, nDestTab),
456  aModificator.SetDocumentModified();
457  }
458  else
459  {
460  // CanFitBlock sal_False -> Problems with summarized cells or table boundary reached!
462 
464  // "cannot insert rows"
466  std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pWin,
467  VclMessageType::Info, VclButtonsType::Ok,
468  ScResId(STR_MSSG_DOSUBTOTALS_2)));
469  xInfoBox->run();
470  }
471 
472  // clean up
473 
474  aRef->DoClose();
475 
476  rDoc.SetInLinkUpdate( false );
477 
478  if (bCanDo)
479  {
480  // notify Uno objects (for XRefreshListener)
482  ScLinkRefreshedHint aHint;
483  aHint.SetAreaLink( aDestPos );
484  rDoc.BroadcastUno( aHint );
485  }
486 
487  return bCanDo;
488 }
489 
490 IMPL_LINK_NOARG(ScAreaLink, RefreshHdl, Timer *, void)
491 {
492  Refresh( aFileName, aFilterName, aSourceArea, GetRefreshDelay() );
493 }
494 
495 /* 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
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:2430
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:776
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:2428
ScAddress aEnd
Definition: address.hxx:500
static OUString GetWebQueryFilterName()
Definition: docsh.cxx:2783
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:2901
SC_DLLPUBLIC SCROW MaxRow() const
Definition: document.hxx:872
SC_DLLPUBLIC SCTAB GetTableCount() const
Definition: document.cxx:313
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:1142
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:1009
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:284
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:2621
sal_Int16 SCCOL
Definition: types.hxx:21
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:189
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:100
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:1167
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
OUString ScResId(std::string_view aId)
Definition: scdll.cxx:89
void SetStreamValid(SCTAB nTab, bool bSet, bool bIgnoreLock=false)
Definition: document.cxx:924
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:60
static SC_DLLPUBLIC const CharClass * getCharClassPtr()
Definition: global.cxx:1010
void * p
const ScDocument & GetDocument() const
Definition: docsh.hxx:216
SC_DLLPUBLIC bool IsValidReference(ScRange &rRef) const
Definition: rangenam.cxx:384
NamedDBs & getNamedDBs()
Definition: dbdata.hxx:315
void SetDocumentModified()
Definition: docsh.cxx:3254
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:217
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:451
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