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>
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
43ScDBFunc::ScDBFunc( vcl::Window* pParent, ScDocShell& rDocSh, ScTabViewShell* pViewShell ) :
44 ScViewFunc( pParent, rDocSh, pViewShell )
45{
46}
47
49{
50}
51
52// auxiliary functions
53
54void ScDBFunc::GotoDBArea( const OUString& rDBName )
55{
57 ScDBCollection* pDBCol = rDoc.GetDBCollection();
58 ScDBData* pData = pDBCol->getNamedDBs().findByUpperName(ScGlobal::getCharClass().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
74 InitBlockMode( nStartCol, nStartRow, nTab );
75 MarkCursor( nEndCol, nEndRow, nTab );
77}
78
79// search current datarange for sort / filter
80
82{
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()))
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() ),
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
186void 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
213void 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
234void 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 ScViewData* pViewData = &GetViewData();
279 ScDocShell* pDocSh = pViewData->GetDocShell();
280
281 ScQueryParam aParam;
282 ScDocument& rDoc = pViewData->GetDocument();
284
285 pDBData->SetByRow( true );
286 pDBData->GetQueryParam( aParam );
287
288 SCCOL nCol;
289 SCROW nRow = aParam.nRow1;
290 SCTAB nTab = pViewData->GetTabNo();
291 ScMF nFlag;
292 bool bHasAuto = true;
293 bool bHeader = pDBData->HasHeader();
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, pViewData->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
338 }
339 else // show filter buttons
340 {
341 if ( !rDoc.IsBlockEmpty( aParam.nCol1, aParam.nRow1,
342 aParam.nCol2, aParam.nRow2, nTab ) )
343 {
344 if (!bHeader)
345 {
346 std::shared_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(pViewData->GetDialogParent(),
347 VclMessageType::Question,
348 VclButtonsType::YesNo, ScResId(STR_MSSG_MAKEAUTOFILTER_0))); // header from first row?
349 xBox->set_title(ScResId(STR_MSSG_DOSUBTOTALS_0)); // "StarCalc"
350 xBox->set_default_response(RET_YES);
351 xBox->SetInstallLOKNotifierHdl(LINK(this, ScDBFunc, InstallLOKNotifierHdl));
352 xBox->runAsync(xBox, [pDocSh, pViewData, pDBData, nCol, nRow, nTab, aParam] (sal_Int32 nResult) {
353 if (nResult == RET_YES)
354 {
355 pDBData->SetHeader( true );
356 }
357
358 ApplyAutoFilter(pDocSh, pViewData, pDBData, nCol, nRow, nTab, aParam);
359 });
360 }
361 else
362 ApplyAutoFilter(pDocSh, pViewData, pDBData, nCol, nRow, nTab, aParam);
363 }
364 else
365 {
366 std::shared_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(pViewData->GetDialogParent(),
367 VclMessageType::Warning, VclButtonsType::Ok,
368 ScResId(STR_ERR_AUTOFILTER)));
369 xErrorBox->SetInstallLOKNotifierHdl(LINK(this, ScDBFunc, InstallLOKNotifierHdl));
370 xErrorBox->runAsync(xErrorBox, [] (sal_Int32) {});
371 }
372 }
373}
374
376{
377 return GetpApp();
378}
379
380void ScDBFunc::ApplyAutoFilter(ScDocShell* pDocSh, ScViewData* pViewData, ScDBData* pDBData,
381 SCCOL nCol, SCROW nRow, SCTAB nTab, ScQueryParam aParam)
382{
383 ScDocument& rDoc = pViewData->GetDocument();
384 ScRange aRange;
385 pDBData->GetArea(aRange);
386 pDocSh->GetUndoManager()->AddUndoAction(
387 std::make_unique<ScUndoAutoFilter>(pDocSh, aRange, pDBData->GetName(), true));
388
389 pDBData->SetAutoFilter(true);
390
391 for (nCol=aParam.nCol1; nCol<=aParam.nCol2; nCol++)
392 {
393 ScMF nFlag = rDoc.GetAttr(nCol, nRow, nTab, ATTR_MERGE_FLAG)->GetValue();
394 rDoc.ApplyAttr(nCol, nRow, nTab, ScMergeFlagAttr(nFlag | ScMF::Auto));
395 }
396 pDocSh->PostPaint(ScRange(aParam.nCol1, nRow, nTab, aParam.nCol2, nRow, nTab),
398
400}
401
403{
404 ScDocShellModificator aModificator(*pDocSh);
405 aModificator.SetDocumentModified();
406
407 SfxBindings* pBindings = pDocSh->GetViewBindings();
408 pBindings->Invalidate(SID_AUTO_FILTER);
409 pBindings->Invalidate(SID_AUTOFILTER_HIDE);
410}
411
412// just hide, no data change
413
415{
416 ScDocShell* pDocSh = GetViewData().GetDocShell();
417 ScDocShellModificator aModificator( *pDocSh );
418
419 ScDocument& rDoc = pDocSh->GetDocument();
420
421 ScDBData* pDBData = GetDBData( false );
422
423 SCTAB nTab;
424 SCCOL nCol1, nCol2;
425 SCROW nRow1, nRow2;
426 pDBData->GetArea(nTab, nCol1, nRow1, nCol2, nRow2);
427
428 for (SCCOL nCol=nCol1; nCol<=nCol2; nCol++)
429 {
430 ScMF nFlag = rDoc.GetAttr( nCol, nRow1, nTab, ATTR_MERGE_FLAG )->GetValue();
431 rDoc.ApplyAttr( nCol, nRow1, nTab, ScMergeFlagAttr( nFlag & ~ScMF::Auto ) );
432 }
433
434 ScRange aRange;
435 pDBData->GetArea( aRange );
436 pDocSh->GetUndoManager()->AddUndoAction(
437 std::make_unique<ScUndoAutoFilter>( pDocSh, aRange, pDBData->GetName(), false ) );
438
439 pDBData->SetAutoFilter(false);
440
441 pDocSh->PostPaint(ScRange(nCol1, nRow1, nTab, nCol2, nRow1, nTab), PaintPartFlags::Grid );
442 aModificator.SetDocumentModified();
443
444 SfxBindings& rBindings = GetViewData().GetBindings();
445 rBindings.Invalidate( SID_AUTO_FILTER );
446 rBindings.Invalidate( SID_AUTOFILTER_HIDE );
447}
448
449// Re-Import
450
452{
454 ScEditableTester aTester( rDoc, GetViewData().GetTabNo(), rParam.nCol1,rParam.nRow1,
455 rParam.nCol2,rParam.nRow2 );
456 if ( !aTester.IsEditable() )
457 {
458 ErrorMessage(aTester.GetMessageId());
459 return false;
460 }
461
462 ScDBDocFunc aDBDocFunc( *GetViewData().GetDocShell() );
463 return aDBDocFunc.DoImport( GetViewData().GetTabNo(), rParam, nullptr );
464}
465
466/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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
ScMF
Definition: attrib.hxx:34
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, const ILibreOfficeKitNotifier *pNotifier=nullptr)
SCTAB Tab() const
Definition: address.hxx:283
void SetCol(SCCOL nColP)
Definition: address.hxx:291
SCROW Row() const
Definition: address.hxx:274
void SetRow(SCROW nRowP)
Definition: address.hxx:287
SCCOL Col() const
Definition: address.hxx:279
ScDBData * findByUpperName(const OUString &rName)
Definition: dbdata.cxx:1221
NamedDBs & getNamedDBs()
Definition: dbdata.hxx:324
void SetByRow(bool bByR)
Definition: dbdata.hxx:135
bool HasHeader() const
Definition: dbdata.hxx:136
const OUString & GetName() const
Definition: dbdata.hxx:127
void GetArea(SCTAB &rTab, SCCOL &rCol1, SCROW &rRow1, SCCOL &rCol2, SCROW &rRow2) const
Definition: dbdata.cxx:298
void SetAutoFilter(bool bSet)
Definition: dbdata.hxx:213
void SetHeader(bool bHasH)
Definition: dbdata.hxx:137
SC_DLLPUBLIC void GetQueryParam(ScQueryParam &rQueryParam) const
Definition: dbdata.cxx:422
void GetSubTotalParam(ScSubTotalParam &rSubTotalParam) const
Definition: dbdata.cxx:461
SC_DLLPUBLIC bool Sort(SCTAB nTab, const ScSortParam &rSortParam, bool bRecord, bool bPaint, bool bApi)
Definition: dbdocfun.cxx:466
SC_DLLPUBLIC bool Query(SCTAB nTab, const ScQueryParam &rQueryParam, const ScRange *pAdvSource, bool bRecord, bool bApi)
Definition: dbdocfun.cxx:678
bool DoImport(SCTAB nTab, const ScImportParam &rParam, const svx::ODataAccessDescriptor *pDescriptor)
Definition: dbdocimp.cxx:121
ScDBData * GetAnonymousDBData()
Definition: dbfunc.cxx:156
static void ModifiedAutoFilter(ScDocShell *pDocSh)
Definition: dbfunc.cxx:402
ScDBData * GetDBData(bool bMarkArea=true, ScGetDBMode eMode=SC_DB_MAKE, ScGetDBSelection eSel=ScGetDBSelection::Keep)
Definition: dbfunc.cxx:81
void HideAutoFilter()
Definition: dbfunc.cxx:414
virtual ~ScDBFunc()
Definition: dbfunc.cxx:48
void ToggleAutoFilter()
Definition: dbfunc.cxx:276
void Sort(const ScSortParam &rSortParam, bool bRecord=true, bool bPaint=true)
Definition: dbfunc.cxx:213
SC_DLLPUBLIC void Query(const ScQueryParam &rQueryParam, const ScRange *pAdvSource, bool bRecord)
Definition: dbfunc.cxx:234
void DoSubTotals(const ScSubTotalParam &rParam, bool bRecord=true, const ScSortParam *pForceNewSort=nullptr)
Definition: dbfunc3.cxx:431
void GotoDBArea(const OUString &rDBName)
Definition: dbfunc.cxx:54
void UISort(const ScSortParam &rSortParam)
Definition: dbfunc.cxx:186
bool ImportData(const ScImportParam &rParam)
Definition: dbfunc.cxx:451
ScDBFunc(vcl::Window *pParent, ScDocShell &rDocSh, ScTabViewShell *pViewShell)
Definition: dbfunc.cxx:43
static void ApplyAutoFilter(ScDocShell *pDocSh, ScViewData *pViewData, ScDBData *pDBData, SCCOL nCol, SCROW nRow, SCTAB nTab, ScQueryParam aParam)
Definition: dbfunc.cxx:380
Create before modifications of the document and destroy thereafter.
Definition: docsh.hxx:455
void SetDocumentModified()
Definition: docsh.cxx:3315
SfxBindings * GetViewBindings()
Definition: docsh4.cxx:2642
const ScDocument & GetDocument() const
Definition: docsh.hxx:219
ScDBData * GetDBData(const ScRange &rMarked, ScGetDBMode eMode, ScGetDBSelection eSel)
Definition: docsh5.cxx:115
ScDBData * GetAnonymousDBData(const ScRange &rRange)
Definition: docsh5.cxx:344
void PostPaint(SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab, SCCOL nEndCol, SCROW nEndRow, SCTAB nEndTab, PaintPartFlags nPart, sal_uInt16 nExtFlags=0)
Definition: docsh3.cxx:101
virtual SfxUndoManager * GetUndoManager() override
Definition: docsh.cxx:2968
const ScDBData * GetDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, ScDBDataPortion ePortion) const
Definition: documen3.cxx:322
SC_DLLPUBLIC const ScDBData * GetDBAtArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2) const
Definition: documen3.cxx:338
bool ShrinkToUsedDataArea(bool &o_bShrunk, SCTAB nTab, SCCOL &rStartCol, SCROW &rStartRow, SCCOL &rEndCol, SCROW &rEndRow, bool bColumnsOnly, bool bStickyTopRow=false, bool bStickyLeftCol=false, ScDataAreaExtras *pDataAreaExtras=nullptr) const
Shrink a range to only include used data area.
Definition: document.cxx:1049
SC_DLLPUBLIC ScDBCollection * GetDBCollection() const
Definition: document.hxx:827
SC_DLLPUBLIC void ApplyAttr(SCCOL nCol, SCROW nRow, SCTAB nTab, const SfxPoolItem &rAttr)
Definition: document.cxx:4741
bool IsBlockEmpty(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab) const
Definition: document.cxx:5288
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:1072
SC_DLLPUBLIC const SfxPoolItem * GetAttr(SCCOL nCol, SCROW nRow, SCTAB nTab, sal_uInt16 nWhich) const
Definition: document.cxx:4684
bool IsEditable() const
Definition: editable.hxx:84
TranslateId GetMessageId() const
Definition: editable.cxx:152
static SC_DLLPUBLIC const CharClass & getCharClass()
Definition: global.cxx:1064
todo: It should be possible to have MarkArrays for each table, in order to enable "search all" across...
Definition: markdata.hxx:43
bool IsMultiMarked() const
Definition: markdata.hxx:81
bool IsMarked() const
Definition: markdata.hxx:80
ScAddress aEnd
Definition: address.hxx:498
ScAddress aStart
Definition: address.hxx:497
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:593
void InitBlockMode(SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, bool bTestNeg=false, bool bCols=false, bool bRows=false, bool bForceNeg=false)
Definition: tabview2.cxx:453
void DoneBlockMode(bool bContinue=false)
Definition: tabview2.cxx:509
void ErrorMessage(TranslateId pGlobStrId)
Definition: tabview2.cxx:1553
void SelectionChanged(bool bFromPaste=false)
Definition: tabview3.cxx:532
void MarkRange(const ScRange &rRange, bool bSetCursor=true, bool bContinue=false)
Definition: tabview3.cxx:1708
void MarkCursor(SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, bool bCols=false, bool bRows=false, bool bCellSelection=false)
Definition: tabview2.cxx:549
SC_DLLPUBLIC void MoveCursorAbs(SCCOL nCurX, SCROW nCurY, ScFollowMode eMode, bool bShift, bool bControl, bool bKeepOld=false, bool bKeepSel=false)
Definition: tabview3.cxx:1191
ScViewData & GetViewData()
Definition: tabview.hxx:344
void ResetAutoSpellForContentChange()
Definition: tabview.cxx:2366
void UpdateScrollBars(HeaderType eHeaderType=BOTH_HEADERS)
Definition: tabview4.cxx:389
SC_DLLPUBLIC void SetTabNo(SCTAB nTab, bool bNew=false, bool bExtendSelection=false, bool bSameTabButMoved=false)
Definition: tabview3.cxx:1819
ScMarkData & GetMarkData()
Definition: viewdata.cxx:3146
SCTAB GetTabNo() const
Definition: viewdata.hxx:395
ScDocument & GetDocument() const
Definition: viewdata.hxx:380
ScDocShell * GetDocShell() const
Definition: viewdata.hxx:354
ScTabViewShell * GetViewShell() const
Definition: viewdata.hxx:357
ScMarkType GetSimpleArea(SCCOL &rStartCol, SCROW &rStartRow, SCTAB &rStartTab, SCCOL &rEndCol, SCROW &rEndRow, SCTAB &rEndTab) const
Definition: viewdata.cxx:1182
weld::Window * GetDialogParent()
Definition: viewdata.cxx:3156
SfxBindings & GetBindings()
Definition: viewdata.cxx:3134
void Invalidate(sal_uInt16 nId)
size_t LeaveListAction()
virtual void EnterListAction(const OUString &rComment, const OUString &rRepeatComment, sal_uInt16 nId, ViewShellId nViewShellId)
virtual void AddUndoAction(std::unique_ptr< SfxUndoAction > pAction, bool bTryMerg=false)
ViewShellId GetViewShellId() const override
@ TOP_LEFT
top left cell of area
IMPL_STATIC_LINK_NOARG(ScDBFunc, InstallLOKNotifierHdl, void *, vcl::ILibreOfficeKitNotifier *)
Definition: dbfunc.cxx:375
ScGetDBSelection
For ScDBFunc::GetDBData()
Definition: global.hxx:391
@ Keep
Keep selection as is, expand to used data area if no selection.
@ RowDown
If only one row or portion thereof is selected, shrink row to used data columns and select further ro...
@ ShrinkToUsedData
Shrink selection to actually used data area within the selection.
ScGetDBMode
Definition: global.hxx:382
@ SC_DB_AUTOFILTER
force use of sheet-local instead of document global anonymous range
Definition: global.hxx:384
@ SC_DB_OLD
don't create
Definition: global.hxx:386
Mode eMode
std::unique_ptr< sal_Int32[]> pData
int i
OUString ScResId(TranslateId aId)
Definition: scdll.cxx:90
constexpr TypedWhichId< ScMergeFlagAttr > ATTR_MERGE_FLAG(145)
SCROW nRow1
Definition: global.hxx:442
SCCOL nCol1
Definition: global.hxx:441
SCCOL nCol2
Definition: global.hxx:443
SCROW nRow2
Definition: global.hxx:444
SC_DLLPUBLIC const ScQueryEntry & GetEntry(SCSIZE n) const
Definition: queryparam.cxx:116
SC_DLLPUBLIC SCSIZE GetEntryCount() const
Definition: queryparam.cxx:111
SCTAB nDestTab
Definition: sortparam.hxx:126
SCROW nDestRow
Definition: sortparam.hxx:128
SCCOL nDestCol
Definition: sortparam.hxx:127
bool bGroupActive[MAXSUBTOTAL]
active groups
VCL_DLLPUBLIC Application * GetpApp()
@ ROW_HEADER
Definition: tabview.hxx:60
sal_Int16 SCTAB
Definition: types.hxx:22
sal_Int16 SCCOL
Definition: types.hxx:21
sal_Int32 SCROW
Definition: types.hxx:17
RET_YES
ScMarkType
States GetSimpleArea() returns for the underlying selection marks, so the caller can react if the res...
Definition: viewdata.hxx:61
@ SC_MARK_SIMPLE
Definition: viewdata.hxx:65
@ SC_MARK_SIMPLE_FILTERED
Definition: viewdata.hxx:67
@ SC_FOLLOW_JUMP
Definition: viewdata.hxx:52