25#include <osl/diagnose.h>
68 pData->GetArea( nTab, nStartCol, nStartRow, nEndCol, nEndRow );
89 bool bShrinkColumnsOnly =
false;
94 bShrinkColumnsOnly =
true;
123 nCol1, nRow1, nCol2, nRow2, bShrinkColumnsOnly);
150 pData->GetArea(aFound);
195 OSL_FAIL(
"Sort: no DBData" );
218 bool bSuccess = aDBDocFunc.
Sort( nTab, rSortParam, bRecord, bPaint,
false );
219 if ( bSuccess && !rSortParam.
bInplace )
239 bool bSuccess = aDBDocFunc.
Query( nTab, rQueryParam, pAdvSource, bRecord,
false );
255 pDestData->
GetArea(aDestRange);
265 false ,
true ,
true ,
292 bool bHasAuto =
true;
297 for (nCol=aParam.
nCol1; nCol<=aParam.
nCol2 && bHasAuto; nCol++)
309 for (nCol=aParam.
nCol1; nCol<=aParam.
nCol2; nCol++)
317 OUString aUndo =
ScResId( STR_UNDO_QUERY );
323 std::make_unique<ScUndoAutoFilter>( pDocSh, aRange, pDBData->
GetName(),
false ) );
333 Query( aParam,
nullptr,
true );
347 VclMessageType::Question,
348 VclButtonsType::YesNo,
ScResId(STR_MSSG_MAKEAUTOFILTER_0)));
349 xBox->set_title(
ScResId(STR_MSSG_DOSUBTOTALS_0));
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) {
367 VclMessageType::Warning, VclButtonsType::Ok,
369 xErrorBox->SetInstallLOKNotifierHdl(
LINK(
this,
ScDBFunc, InstallLOKNotifierHdl));
370 xErrorBox->runAsync(xErrorBox, [] (sal_Int32) {});
387 std::make_unique<ScUndoAutoFilter>(pDocSh, aRange, pDBData->
GetName(),
true));
391 for (nCol=aParam.
nCol1; nCol<=aParam.
nCol2; nCol++)
426 pDBData->
GetArea(nTab, nCol1, nRow1, nCol2, nRow2);
428 for (
SCCOL nCol=nCol1; nCol<=nCol2; nCol++)
437 std::make_unique<ScUndoAutoFilter>( pDocSh, aRange, pDBData->
GetName(),
false ) );
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 ...
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, const ILibreOfficeKitNotifier *pNotifier=nullptr)
ScDBData * findByUpperName(const OUString &rName)
const OUString & GetName() const
void GetArea(SCTAB &rTab, SCCOL &rCol1, SCROW &rRow1, SCCOL &rCol2, SCROW &rRow2) const
void SetAutoFilter(bool bSet)
void SetHeader(bool bHasH)
SC_DLLPUBLIC void GetQueryParam(ScQueryParam &rQueryParam) const
void GetSubTotalParam(ScSubTotalParam &rSubTotalParam) const
SC_DLLPUBLIC bool Sort(SCTAB nTab, const ScSortParam &rSortParam, bool bRecord, bool bPaint, bool bApi)
SC_DLLPUBLIC bool Query(SCTAB nTab, const ScQueryParam &rQueryParam, const ScRange *pAdvSource, bool bRecord, bool bApi)
bool DoImport(SCTAB nTab, const ScImportParam &rParam, const svx::ODataAccessDescriptor *pDescriptor)
ScDBData * GetAnonymousDBData()
static void ModifiedAutoFilter(ScDocShell *pDocSh)
ScDBData * GetDBData(bool bMarkArea=true, ScGetDBMode eMode=SC_DB_MAKE, ScGetDBSelection eSel=ScGetDBSelection::Keep)
void Sort(const ScSortParam &rSortParam, bool bRecord=true, bool bPaint=true)
SC_DLLPUBLIC void Query(const ScQueryParam &rQueryParam, const ScRange *pAdvSource, bool bRecord)
void DoSubTotals(const ScSubTotalParam &rParam, bool bRecord=true, const ScSortParam *pForceNewSort=nullptr)
void GotoDBArea(const OUString &rDBName)
void UISort(const ScSortParam &rSortParam)
bool ImportData(const ScImportParam &rParam)
ScDBFunc(vcl::Window *pParent, ScDocShell &rDocSh, ScTabViewShell *pViewShell)
static void ApplyAutoFilter(ScDocShell *pDocSh, ScViewData *pViewData, ScDBData *pDBData, SCCOL nCol, SCROW nRow, SCTAB nTab, ScQueryParam aParam)
Create before modifications of the document and destroy thereafter.
void SetDocumentModified()
SfxBindings * GetViewBindings()
const ScDocument & GetDocument() const
ScDBData * GetDBData(const ScRange &rMarked, ScGetDBMode eMode, ScGetDBSelection eSel)
ScDBData * GetAnonymousDBData(const ScRange &rRange)
void PostPaint(SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab, SCCOL nEndCol, SCROW nEndRow, SCTAB nEndTab, PaintPartFlags nPart, sal_uInt16 nExtFlags=0)
virtual SfxUndoManager * GetUndoManager() override
const ScDBData * GetDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, ScDBDataPortion ePortion) const
SC_DLLPUBLIC const ScDBData * GetDBAtArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2) const
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.
SC_DLLPUBLIC ScDBCollection * GetDBCollection() const
SC_DLLPUBLIC void ApplyAttr(SCCOL nCol, SCROW nRow, SCTAB nTab, const SfxPoolItem &rAttr)
bool IsBlockEmpty(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab) const
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.
SC_DLLPUBLIC const SfxPoolItem * GetAttr(SCCOL nCol, SCROW nRow, SCTAB nTab, sal_uInt16 nWhich) const
TranslateId GetMessageId() const
static SC_DLLPUBLIC const CharClass & getCharClass()
todo: It should be possible to have MarkArrays for each table, in order to enable "search all" across...
bool IsMultiMarked() const
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...
void InitBlockMode(SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, bool bTestNeg=false, bool bCols=false, bool bRows=false, bool bForceNeg=false)
void DoneBlockMode(bool bContinue=false)
void ErrorMessage(TranslateId pGlobStrId)
void SelectionChanged(bool bFromPaste=false)
void MarkRange(const ScRange &rRange, bool bSetCursor=true, bool bContinue=false)
void MarkCursor(SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, bool bCols=false, bool bRows=false, bool bCellSelection=false)
SC_DLLPUBLIC void MoveCursorAbs(SCCOL nCurX, SCROW nCurY, ScFollowMode eMode, bool bShift, bool bControl, bool bKeepOld=false, bool bKeepSel=false)
ScViewData & GetViewData()
void ResetAutoSpellForContentChange()
void UpdateScrollBars(HeaderType eHeaderType=BOTH_HEADERS)
SC_DLLPUBLIC void SetTabNo(SCTAB nTab, bool bNew=false, bool bExtendSelection=false, bool bSameTabButMoved=false)
ScMarkData & GetMarkData()
ScDocument & GetDocument() const
ScDocShell * GetDocShell() const
ScTabViewShell * GetViewShell() const
ScMarkType GetSimpleArea(SCCOL &rStartCol, SCROW &rStartRow, SCTAB &rStartTab, SCCOL &rEndCol, SCROW &rEndRow, SCTAB &rEndTab) const
weld::Window * GetDialogParent()
SfxBindings & GetBindings()
void Invalidate(sal_uInt16 nId)
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 *)
ScGetDBSelection
For ScDBFunc::GetDBData()
@ 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.
@ SC_DB_AUTOFILTER
force use of sheet-local instead of document global anonymous range
#define LINK(Instance, Class, Member)
std::unique_ptr< sal_Int32[]> pData
OUString ScResId(TranslateId aId)
constexpr TypedWhichId< ScMergeFlagAttr > ATTR_MERGE_FLAG(145)
SC_DLLPUBLIC const ScQueryEntry & GetEntry(SCSIZE n) const
SC_DLLPUBLIC SCSIZE GetEntryCount() const
bool bGroupActive[MAXSUBTOTAL]
active groups
VCL_DLLPUBLIC Application * GetpApp()
ScMarkType
States GetSimpleArea() returns for the underlying selection marks, so the caller can react if the res...
@ SC_MARK_SIMPLE_FILTERED