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