LibreOffice Module sc (master)  1
dbfunc.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 <scitems.hxx>
21 #include <sfx2/bindings.hxx>
22 #include <vcl/svapp.hxx>
23 #include <vcl/weld.hxx>
24 #include <unotools/charclass.hxx>
25 #include <osl/diagnose.h>
26 
27 #include <dbfunc.hxx>
28 #include <docsh.hxx>
29 #include <attrib.hxx>
30 #include <sc.hrc>
31 #include <undodat.hxx>
32 #include <dbdata.hxx>
33 #include <globstr.hrc>
34 #include <scresid.hxx>
35 #include <global.hxx>
36 #include <dbdocfun.hxx>
37 #include <editable.hxx>
38 #include <queryentry.hxx>
39 #include <markdata.hxx>
40 #include <tabvwsh.hxx>
41 #include <sortparam.hxx>
42 
43 ScDBFunc::ScDBFunc( vcl::Window* pParent, ScDocShell& rDocSh, ScTabViewShell* pViewShell ) :
44  ScViewFunc( pParent, rDocSh, pViewShell )
45 {
46 }
47 
49 {
50 }
51 
52 // auxiliary functions
53 
54 void ScDBFunc::GotoDBArea( const OUString& rDBName )
55 {
57  ScDBCollection* pDBCol = rDoc.GetDBCollection();
58  ScDBData* pData = pDBCol->getNamedDBs().findByUpperName(ScGlobal::getCharClassPtr()->uppercase(rDBName));
59  if (!pData)
60  return;
61 
62  SCTAB nTab = 0;
63  SCCOL nStartCol = 0;
64  SCROW nStartRow = 0;
65  SCCOL nEndCol = 0;
66  SCROW nEndRow = 0;
67 
68  pData->GetArea( nTab, nStartCol, nStartRow, nEndCol, nEndRow );
69  SetTabNo( nTab );
70 
71  MoveCursorAbs( nStartCol, nStartRow, SC_FOLLOW_JUMP,
72  false, false ); // bShift,bControl
73  DoneBlockMode();
74  InitBlockMode( nStartCol, nStartRow, nTab );
75  MarkCursor( nEndCol, nEndRow, nTab );
77 }
78 
79 // search current datarange for sort / filter
80 
82 {
83  ScDocShell* pDocSh = GetViewData().GetDocShell();
84  ScDBData* pData = nullptr;
85  ScRange aRange;
86  ScMarkType eMarkType = GetViewData().GetSimpleArea(aRange);
87  if ( eMarkType == SC_MARK_SIMPLE || eMarkType == SC_MARK_SIMPLE_FILTERED )
88  {
89  bool bShrinkColumnsOnly = false;
90  if (eSel == ScGetDBSelection::RowDown)
91  {
92  // Don't alter row range, additional rows may have been selected on
93  // purpose to append data, or to have a fake header row.
94  bShrinkColumnsOnly = true;
95  // Select further rows only if only one row or a portion thereof is
96  // selected.
97  if (aRange.aStart.Row() != aRange.aEnd.Row())
98  {
99  // If an area is selected shrink that to the actual used
100  // columns, don't draw filter buttons for empty columns.
102  }
103  else if (aRange.aStart.Col() == aRange.aEnd.Col())
104  {
105  // One cell only, if it is not marked obtain entire used data
106  // area.
107  const ScMarkData& rMarkData = GetViewData().GetMarkData();
108  if (!(rMarkData.IsMarked() || rMarkData.IsMultiMarked()))
109  eSel = ScGetDBSelection::Keep;
110  }
111  }
112  switch (eSel)
113  {
116  {
117  // Shrink the selection to actual used area.
118  ScDocument& rDoc = pDocSh->GetDocument();
119  SCCOL nCol1 = aRange.aStart.Col(), nCol2 = aRange.aEnd.Col();
120  SCROW nRow1 = aRange.aStart.Row(), nRow2 = aRange.aEnd.Row();
121  bool bShrunk;
122  rDoc.ShrinkToUsedDataArea( bShrunk, aRange.aStart.Tab(),
123  nCol1, nRow1, nCol2, nRow2, bShrinkColumnsOnly);
124  if (bShrunk)
125  {
126  aRange.aStart.SetCol(nCol1);
127  aRange.aEnd.SetCol(nCol2);
128  aRange.aStart.SetRow(nRow1);
129  aRange.aEnd.SetRow(nRow2);
130  }
131  }
132  break;
133  default:
134  ; // nothing
135  }
136  pData = pDocSh->GetDBData( aRange, eMode, eSel );
137  }
138  else if ( eMode != SC_DB_OLD )
139  pData = pDocSh->GetDBData(
140  ScRange( GetViewData().GetCurX(), GetViewData().GetCurY(),
141  GetViewData().GetTabNo() ),
142  eMode, ScGetDBSelection::Keep );
143 
144  if (!pData)
145  return nullptr;
146 
147  if (bMark)
148  {
149  ScRange aFound;
150  pData->GetArea(aFound);
151  MarkRange( aFound, false );
152  }
153  return pData;
154 }
155 
157 {
158  ScDocShell* pDocSh = GetViewData().GetDocShell();
159  ScRange aRange;
160  ScMarkType eMarkType = GetViewData().GetSimpleArea(aRange);
161  if (eMarkType != SC_MARK_SIMPLE && eMarkType != SC_MARK_SIMPLE_FILTERED)
162  return nullptr;
163 
164  // Expand to used data area if not explicitly marked.
165  const ScMarkData& rMarkData = GetViewData().GetMarkData();
166  if (!rMarkData.IsMarked() && !rMarkData.IsMultiMarked())
167  {
168  SCCOL nCol1 = aRange.aStart.Col();
169  SCCOL nCol2 = aRange.aEnd.Col();
170  SCROW nRow1 = aRange.aStart.Row();
171  SCROW nRow2 = aRange.aEnd.Row();
172  pDocSh->GetDocument().GetDataArea(aRange.aStart.Tab(), nCol1, nRow1, nCol2, nRow2, false, false);
173  aRange.aStart.SetCol(nCol1);
174  aRange.aStart.SetRow(nRow1);
175  aRange.aEnd.SetCol(nCol2);
176  aRange.aEnd.SetRow(nRow2);
177  }
178 
179  return pDocSh->GetAnonymousDBData(aRange);
180 }
181 
182 // main functions
183 
184 // Sort
185 
186 void ScDBFunc::UISort( const ScSortParam& rSortParam )
187 {
188  ScDocShell* pDocSh = GetViewData().GetDocShell();
189  ScDocument& rDoc = pDocSh->GetDocument();
190  SCTAB nTab = GetViewData().GetTabNo();
191  ScDBData* pDBData = rDoc.GetDBAtArea( nTab, rSortParam.nCol1, rSortParam.nRow1,
192  rSortParam.nCol2, rSortParam.nRow2 );
193  if (!pDBData)
194  {
195  OSL_FAIL( "Sort: no DBData" );
196  return;
197  }
198 
199  ScSubTotalParam aSubTotalParam;
200  pDBData->GetSubTotalParam( aSubTotalParam );
201  if (aSubTotalParam.bGroupActive[0] && !aSubTotalParam.bRemoveOnly)
202  {
203  // repeat subtotals, with new sortorder
204 
205  DoSubTotals( aSubTotalParam, true/*bRecord*/, &rSortParam );
206  }
207  else
208  {
209  Sort( rSortParam ); // just sort
210  }
211 }
212 
213 void ScDBFunc::Sort( const ScSortParam& rSortParam, bool bRecord, bool bPaint )
214 {
215  ScDocShell* pDocSh = GetViewData().GetDocShell();
216  SCTAB nTab = GetViewData().GetTabNo();
217  ScDBDocFunc aDBDocFunc( *pDocSh );
218  bool bSuccess = aDBDocFunc.Sort( nTab, rSortParam, bRecord, bPaint, false );
219  if ( bSuccess && !rSortParam.bInplace )
220  {
221  // mark target
222  ScRange aDestRange( rSortParam.nDestCol, rSortParam.nDestRow, rSortParam.nDestTab,
223  rSortParam.nDestCol + rSortParam.nCol2 - rSortParam.nCol1,
224  rSortParam.nDestRow + rSortParam.nRow2 - rSortParam.nRow1,
225  rSortParam.nDestTab );
226  MarkRange( aDestRange );
227  }
228 
230 }
231 
232 // filters
233 
234 void ScDBFunc::Query( const ScQueryParam& rQueryParam, const ScRange* pAdvSource, bool bRecord )
235 {
236  ScDocShell* pDocSh = GetViewData().GetDocShell();
237  SCTAB nTab = GetViewData().GetTabNo();
238  ScDBDocFunc aDBDocFunc( *pDocSh );
239  bool bSuccess = aDBDocFunc.Query( nTab, rQueryParam, pAdvSource, bRecord, false );
240 
241  if (!bSuccess)
242  return;
243 
244  bool bCopy = !rQueryParam.bInplace;
245  if (bCopy)
246  {
247  // mark target range (data base range has been set up if applicable)
248  ScDocument& rDoc = pDocSh->GetDocument();
249  ScDBData* pDestData = rDoc.GetDBAtCursor(
250  rQueryParam.nDestCol, rQueryParam.nDestRow,
251  rQueryParam.nDestTab, ScDBDataPortion::TOP_LEFT );
252  if (pDestData)
253  {
254  ScRange aDestRange;
255  pDestData->GetArea(aDestRange);
256  MarkRange( aDestRange );
257  }
258  }
259 
260  if (!bCopy)
261  {
263  GetViewData().GetViewShell(),
264  false /* bColumns */, true /* bRows */,
265  false /* bSizes*/, true /* bHidden */, true /* bFiltered */,
266  false /* bGroups */, nTab);
268  SelectionChanged(); // for attribute states (filtered rows are ignored)
269  }
270 
271  GetViewData().GetBindings().Invalidate( SID_UNFILTER );
272 }
273 
274 // autofilter-buttons show / hide
275 
277 {
278  ScDocShell* pDocSh = GetViewData().GetDocShell();
279  ScDocShellModificator aModificator( *pDocSh );
280 
281  ScQueryParam aParam;
282  ScDocument& rDoc = GetViewData().GetDocument();
284 
285  pDBData->SetByRow( true );
286  pDBData->GetQueryParam( aParam );
287 
288  SCCOL nCol;
289  SCROW nRow = aParam.nRow1;
290  SCTAB nTab = GetViewData().GetTabNo();
291  ScMF nFlag;
292  bool bHasAuto = true;
293  bool bHeader = pDBData->HasHeader();
294  bool bPaint = false;
295 
297 
298  for (nCol=aParam.nCol1; nCol<=aParam.nCol2 && bHasAuto; nCol++)
299  {
300  nFlag = rDoc.GetAttr( nCol, nRow, nTab, ATTR_MERGE_FLAG )->GetValue();
301 
302  if ( !(nFlag & ScMF::Auto) )
303  bHasAuto = false;
304  }
305 
306  if (bHasAuto) // remove
307  {
308  // hide filter buttons
309 
310  for (nCol=aParam.nCol1; nCol<=aParam.nCol2; nCol++)
311  {
312  nFlag = rDoc.GetAttr( nCol, nRow, nTab, ATTR_MERGE_FLAG )->GetValue();
313  rDoc.ApplyAttr( nCol, nRow, nTab, ScMergeFlagAttr( nFlag & ~ScMF::Auto ) );
314  }
315 
316  // use a list action for the AutoFilter buttons (ScUndoAutoFilter) and the filter operation
317 
318  OUString aUndo = ScResId( STR_UNDO_QUERY );
319  pDocSh->GetUndoManager()->EnterListAction( aUndo, aUndo, 0, GetViewData().GetViewShell()->GetViewShellId() );
320 
321  ScRange aRange;
322  pDBData->GetArea( aRange );
323  pDocSh->GetUndoManager()->AddUndoAction(
324  std::make_unique<ScUndoAutoFilter>( pDocSh, aRange, pDBData->GetName(), false ) );
325 
326  pDBData->SetAutoFilter(false);
327 
328  // remove filter (incl. Paint / Undo)
329 
330  SCSIZE nEC = aParam.GetEntryCount();
331  for (SCSIZE i=0; i<nEC; i++)
332  aParam.GetEntry(i).bDoQuery = false;
333  aParam.bDuplicate = true;
334  Query( aParam, nullptr, true );
335 
336  pDocSh->GetUndoManager()->LeaveListAction();
337 
338  bPaint = true;
339  }
340  else // show filter buttons
341  {
342  if ( !rDoc.IsBlockEmpty( nTab,
343  aParam.nCol1, aParam.nRow1,
344  aParam.nCol2, aParam.nRow2 ) )
345  {
346  if (!bHeader)
347  {
348  std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetViewData().GetDialogParent(),
349  VclMessageType::Question,
350  VclButtonsType::YesNo, ScResId(STR_MSSG_MAKEAUTOFILTER_0))); // header from first row?
351  xBox->set_title(ScResId(STR_MSSG_DOSUBTOTALS_0)); // "StarCalc"
352  xBox->set_default_response(RET_YES);
353  if (xBox->run() == RET_YES)
354  {
355  pDBData->SetHeader( true );
356  }
357  }
358 
359  ScRange aRange;
360  pDBData->GetArea( aRange );
361  pDocSh->GetUndoManager()->AddUndoAction(
362  std::make_unique<ScUndoAutoFilter>( pDocSh, aRange, pDBData->GetName(), true ) );
363 
364  pDBData->SetAutoFilter(true);
365 
366  for (nCol=aParam.nCol1; nCol<=aParam.nCol2; nCol++)
367  {
368  nFlag = rDoc.GetAttr( nCol, nRow, nTab, ATTR_MERGE_FLAG )->GetValue();
369  rDoc.ApplyAttr( nCol, nRow, nTab, ScMergeFlagAttr( nFlag | ScMF::Auto ) );
370  }
371  pDocSh->PostPaint(ScRange(aParam.nCol1, nRow, nTab, aParam.nCol2, nRow, nTab),
373  bPaint = true;
374  }
375  else
376  {
377  std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(GetViewData().GetDialogParent(),
378  VclMessageType::Warning, VclButtonsType::Ok,
379  ScResId(STR_ERR_AUTOFILTER)));
380  xErrorBox->run();
381  }
382  }
383 
384  if ( bPaint )
385  {
386  aModificator.SetDocumentModified();
387 
388  SfxBindings& rBindings = GetViewData().GetBindings();
389  rBindings.Invalidate( SID_AUTO_FILTER );
390  rBindings.Invalidate( SID_AUTOFILTER_HIDE );
391  }
392 }
393 
394 // just hide, no data change
395 
397 {
398  ScDocShell* pDocSh = GetViewData().GetDocShell();
399  ScDocShellModificator aModificator( *pDocSh );
400 
401  ScDocument& rDoc = pDocSh->GetDocument();
402 
403  ScDBData* pDBData = GetDBData( false );
404 
405  SCTAB nTab;
406  SCCOL nCol1, nCol2;
407  SCROW nRow1, nRow2;
408  pDBData->GetArea(nTab, nCol1, nRow1, nCol2, nRow2);
409 
410  for (SCCOL nCol=nCol1; nCol<=nCol2; nCol++)
411  {
412  ScMF nFlag = rDoc.GetAttr( nCol, nRow1, nTab, ATTR_MERGE_FLAG )->GetValue();
413  rDoc.ApplyAttr( nCol, nRow1, nTab, ScMergeFlagAttr( nFlag & ~ScMF::Auto ) );
414  }
415 
416  ScRange aRange;
417  pDBData->GetArea( aRange );
418  pDocSh->GetUndoManager()->AddUndoAction(
419  std::make_unique<ScUndoAutoFilter>( pDocSh, aRange, pDBData->GetName(), false ) );
420 
421  pDBData->SetAutoFilter(false);
422 
423  pDocSh->PostPaint(ScRange(nCol1, nRow1, nTab, nCol2, nRow1, nTab), PaintPartFlags::Grid );
424  aModificator.SetDocumentModified();
425 
426  SfxBindings& rBindings = GetViewData().GetBindings();
427  rBindings.Invalidate( SID_AUTO_FILTER );
428  rBindings.Invalidate( SID_AUTOFILTER_HIDE );
429 }
430 
431 // Re-Import
432 
433 bool ScDBFunc::ImportData( const ScImportParam& rParam )
434 {
435  ScDocument& rDoc = GetViewData().GetDocument();
436  ScEditableTester aTester( rDoc, GetViewData().GetTabNo(), rParam.nCol1,rParam.nRow1,
437  rParam.nCol2,rParam.nRow2 );
438  if ( !aTester.IsEditable() )
439  {
440  ErrorMessage(aTester.GetMessageId());
441  return false;
442  }
443 
444  ScDBDocFunc aDBDocFunc( *GetViewData().GetDocShell() );
445  return aDBDocFunc.DoImport( GetViewData().GetTabNo(), rParam, nullptr );
446 }
447 
448 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ScMarkData & GetMarkData()
Definition: viewdata.cxx:3047
bool bGroupActive[MAXSUBTOTAL]
active groups
SCROW nRow1
Definition: sortparam.hxx:43
SC_DLLPUBLIC ScDBCollection * GetDBCollection() const
Definition: document.hxx:813
ScDBData * GetDBData(bool bMarkArea=true, ScGetDBMode eMode=SC_DB_MAKE, ScGetDBSelection eSel=ScGetDBSelection::Keep)
Definition: dbfunc.cxx:81
ScAddress aStart
Definition: address.hxx:499
ScDocShell * GetDocShell() const
Definition: viewdata.hxx:353
todo: It should be possible to have MarkArrays for each table, in order to enable "search all" across...
Definition: markdata.hxx:42
SCCOL nCol2
Definition: sortparam.hxx:44
SCROW Row() const
Definition: address.hxx:261
ScDBData * GetAnonymousDBData(const ScRange &rRange)
Definition: docsh5.cxx:343
std::unique_ptr< ContentProperties > pData
SCCOL nDestCol
Definition: sortparam.hxx:57
bool HasHeader() const
Definition: dbdata.hxx:129
void MarkRange(const ScRange &rRange, bool bSetCursor=true, bool bContinue=false)
Definition: tabview3.cxx:1685
don't create
Definition: global.hxx:395
bool DoImport(SCTAB nTab, const ScImportParam &rParam, const svx::ODataAccessDescriptor *pDescriptor)
Definition: dbdocimp.cxx:121
void GotoDBArea(const OUString &rDBName)
Definition: dbfunc.cxx:54
SC_DLLPUBLIC const ScDBData * GetDBAtArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2) const
Definition: documen3.cxx:338
SCTAB GetTabNo() const
Definition: viewdata.hxx:394
bool ImportData(const ScImportParam &rParam)
Definition: dbfunc.cxx:433
ScAddress aEnd
Definition: address.hxx:500
ScDocument & GetDocument() const
Definition: viewdata.hxx:379
virtual ~ScDBFunc()
Definition: dbfunc.cxx:48
SCROW nRow2
Definition: global.hxx:453
void Invalidate(sal_uInt16 nId)
SC_DLLPUBLIC void ApplyAttr(SCCOL nCol, SCROW nRow, SCTAB nTab, const SfxPoolItem &rAttr)
Definition: document.cxx:4749
ScDBData * GetDBData(const ScRange &rMarked, ScGetDBMode eMode, ScGetDBSelection eSel)
Definition: docsh5.cxx:114
static void notifyAllViewsSheetGeomInvalidation(const SfxViewShell *pForViewShell, bool bColumns, bool bRows, bool bSizes, bool bHidden, bool bFiltered, bool bGroups, SCTAB nCurrentTabIndex)
Emits a LOK_CALLBACK_INVALIDATE_SHEET_GEOMETRY for all views whose current tab is equal to nCurrentTa...
Definition: tabvwshc.cxx:560
SC_DLLPUBLIC void MoveCursorAbs(SCCOL nCurX, SCROW nCurY, ScFollowMode eMode, bool bShift, bool bControl, bool bKeepOld=false, bool bKeepSel=false)
Definition: tabview3.cxx:1188
ScGetDBMode
Definition: global.hxx:390
virtual SfxUndoManager * GetUndoManager() override
Definition: docsh.cxx:2806
Shrink selection to actually used data area within the selection.
SCROW nRow2
Definition: sortparam.hxx:45
Keep selection as is, expand to used data area if no selection.
RET_YES
size_t SCSIZE
size_t typedef to be able to find places where code was changed from USHORT to size_t and is used to ...
Definition: address.hxx:44
bool IsMultiMarked() const
Definition: markdata.hxx:82
SC_DLLPUBLIC SCSIZE GetEntryCount() const
Definition: queryparam.cxx:119
void DoSubTotals(const ScSubTotalParam &rParam, bool bRecord=true, const ScSortParam *pForceNewSort=nullptr)
Definition: dbfunc3.cxx:430
ScDBFunc(vcl::Window *pParent, ScDocShell &rDocSh, ScTabViewShell *pViewShell)
Definition: dbfunc.cxx:43
SC_DLLPUBLIC const ScQueryEntry & GetEntry(SCSIZE n) const
Definition: queryparam.cxx:124
SCCOL nCol2
Definition: global.hxx:452
SCTAB Tab() const
Definition: address.hxx:270
void SetRow(SCROW nRowP)
Definition: address.hxx:274
void DoneBlockMode(bool bContinue=false)
Definition: tabview2.cxx:409
If only one row or portion thereof is selected, shrink row to used data columns and select further ro...
void SetCol(SCCOL nColP)
Definition: address.hxx:278
SCROW nRow1
Definition: global.hxx:451
ScViewData & GetViewData()
Definition: tabview.hxx:333
void SelectionChanged(bool bFromPaste=false)
Definition: tabview3.cxx:531
SC_DLLPUBLIC const SfxPoolItem * GetAttr(SCCOL nCol, SCROW nRow, SCTAB nTab, sal_uInt16 nWhich) const
Definition: document.cxx:4706
SCCOL nCol1
Definition: sortparam.hxx:42
const char * GetMessageId() const
Definition: editable.cxx:152
SC_DLLPUBLIC void GetDataArea(SCTAB nTab, SCCOL &rStartCol, SCROW &rStartRow, SCCOL &rEndCol, SCROW &rEndRow, bool bIncludeOld, bool bOnlyDown) const
Return the smallest area containing at least all contiguous cells having data.
Definition: document.cxx:1088
virtual void AddUndoAction(std::unique_ptr< SfxUndoAction > pAction, bool bTryMerg=false)
bool IsMarked() const
Definition: markdata.hxx:81
int i
SfxBindings & GetBindings()
Definition: viewdata.cxx:3035
ScMarkType
States GetSimpleArea() returns for the underlying selection marks, so the caller can react if the res...
Definition: viewdata.hxx:60
sal_Int16 SCCOL
Definition: types.hxx:21
SC_DLLPUBLIC void SetTabNo(SCTAB nTab, bool bNew=false, bool bExtendSelection=false, bool bSameTabButMoved=false)
Definition: tabview3.cxx:1796
OUString ScResId(const char *pId)
Definition: scdll.cxx:89
ScMarkType GetSimpleArea(SCCOL &rStartCol, SCROW &rStartRow, SCTAB &rStartTab, SCCOL &rEndCol, SCROW &rEndRow, SCTAB &rEndTab) const
Definition: viewdata.cxx:1171
const OUString & GetName() const
Definition: dbdata.hxx:121
bool IsEditable() const
Definition: editable.hxx:83
bool IsBlockEmpty(SCTAB nTab, SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, bool bIgnoreNotes=false) const
Definition: document.cxx:5283
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 SetHeader(bool bHasH)
Definition: dbdata.hxx:130
void UpdateScrollBars(HeaderType eHeaderType=BOTH_HEADERS)
Definition: tabview4.cxx:390
SCCOL Col() const
Definition: address.hxx:266
void Sort(const ScSortParam &rSortParam, bool bRecord=true, bool bPaint=true)
Definition: dbfunc.cxx:213
void GetSubTotalParam(ScSubTotalParam &rSubTotalParam) const
Definition: dbdata.cxx:448
void SetByRow(bool bByR)
Definition: dbdata.hxx:128
size_t LeaveListAction()
ScDBData * findByUpperName(const OUString &rName)
Definition: dbdata.cxx:1147
SC_DLLPUBLIC bool Query(SCTAB nTab, const ScQueryParam &rQueryParam, const ScRange *pAdvSource, bool bRecord, bool bApi)
Definition: dbdocfun.cxx:647
top left cell of area
constexpr TypedWhichId< ScMergeFlagAttr > ATTR_MERGE_FLAG(145)
sal_Int32 SCROW
Definition: types.hxx:17
SC_DLLPUBLIC bool Sort(SCTAB nTab, const ScSortParam &rSortParam, bool bRecord, bool bPaint, bool bApi)
Definition: dbdocfun.cxx:466
void ResetAutoSpellForContentChange()
Definition: tabview.cxx:2270
ScGetDBSelection
For ScDBFunc::GetDBData()
Definition: global.hxx:399
bool bInplace
Definition: sortparam.hxx:55
ScMF
Definition: attrib.hxx:34
void ErrorMessage(const char *pGlobStrId)
Definition: tabview2.cxx:1413
void ToggleAutoFilter()
Definition: dbfunc.cxx:276
void HideAutoFilter()
Definition: dbfunc.cxx:396
virtual void EnterListAction(const OUString &rComment, const OUString &rRepeatComment, sal_uInt16 nId, ViewShellId nViewShellId)
static SC_DLLPUBLIC const CharClass * getCharClassPtr()
Definition: global.cxx:1009
force use of sheet-local instead of document global anonymous range
Definition: global.hxx:393
const ScDocument & GetDocument() const
Definition: docsh.hxx:216
SC_DLLPUBLIC void GetQueryParam(ScQueryParam &rQueryParam) const
Definition: dbdata.cxx:409
NamedDBs & getNamedDBs()
Definition: dbdata.hxx:314
void UISort(const ScSortParam &rSortParam)
Definition: dbfunc.cxx:186
void SetDocumentModified()
Definition: docsh.cxx:3159
SCCOL nCol1
Definition: global.hxx:450
SCROW nDestRow
Definition: sortparam.hxx:58
ScDBData * GetAnonymousDBData()
Definition: dbfunc.cxx:156
bool ShrinkToUsedDataArea(bool &o_bShrunk, SCTAB nTab, SCCOL &rStartCol, SCROW &rStartRow, SCCOL &rEndCol, SCROW &rEndRow, bool bColumnsOnly, bool bStickyTopRow=false, bool bStickyLeftCol=false, bool bConsiderCellNotes=false, bool bConsiderCellDrawObjects=false, bool bConsiderCellFormats=false) const
Shrink a range to only include used data area.
Definition: document.cxx:1062
SC_DLLPUBLIC void Query(const ScQueryParam &rQueryParam, const ScRange *pAdvSource, bool bRecord)
Definition: dbfunc.cxx:234
const ScDBData * GetDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, ScDBDataPortion ePortion) const
Definition: documen3.cxx:322
void MarkCursor(SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, bool bCols=false, bool bRows=false, bool bCellSelection=false)
Definition: tabview2.cxx:449
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
void InitBlockMode(SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, bool bTestNeg=false, bool bCols=false, bool bRows=false, bool bForceNeg=false)
Definition: tabview2.cxx:353
sal_Int16 SCTAB
Definition: types.hxx:22
void SetAutoFilter(bool bSet)
Definition: dbdata.hxx:204
SCTAB nDestTab
Definition: sortparam.hxx:56