25 #include <osl/diagnose.h>
33 #include <globstr.hrc>
68 pData->
GetArea( nTab, nStartCol, nStartRow, nEndCol, nEndRow );
89 bool bShrinkColumnsOnly =
false;
94 bShrinkColumnsOnly =
true;
123 nCol1, nRow1, nCol2, nRow2, bShrinkColumnsOnly);
136 pData = pDocSh->
GetDBData( aRange, eMode, eSel );
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;
298 for (nCol=aParam.
nCol1; nCol<=aParam.
nCol2 && bHasAuto; nCol++)
310 for (nCol=aParam.
nCol1; nCol<=aParam.
nCol2; nCol++)
318 OUString aUndo =
ScResId( STR_UNDO_QUERY );
324 std::make_unique<ScUndoAutoFilter>( pDocSh, aRange, pDBData->
GetName(),
false ) );
334 Query( aParam,
nullptr,
true );
349 VclMessageType::Question,
350 VclButtonsType::YesNo,
ScResId(STR_MSSG_MAKEAUTOFILTER_0)));
351 xBox->set_title(
ScResId(STR_MSSG_DOSUBTOTALS_0));
352 xBox->set_default_response(
RET_YES);
362 std::make_unique<ScUndoAutoFilter>( pDocSh, aRange, pDBData->
GetName(), true ) );
366 for (nCol=aParam.
nCol1; nCol<=aParam.
nCol2; nCol++)
378 VclMessageType::Warning, VclButtonsType::Ok,
408 pDBData->
GetArea(nTab, nCol1, nRow1, nCol2, nRow2);
410 for (
SCCOL nCol=nCol1; nCol<=nCol2; nCol++)
419 std::make_unique<ScUndoAutoFilter>( pDocSh, aRange, pDBData->
GetName(),
false ) );
ScMarkData & GetMarkData()
bool bGroupActive[MAXSUBTOTAL]
active groups
SC_DLLPUBLIC ScDBCollection * GetDBCollection() const
ScDBData * GetDBData(bool bMarkArea=true, ScGetDBMode eMode=SC_DB_MAKE, ScGetDBSelection eSel=ScGetDBSelection::Keep)
ScDocShell * GetDocShell() const
todo: It should be possible to have MarkArrays for each table, in order to enable "search all" across...
OUString ScResId(TranslateId aId)
void ErrorMessage(TranslateId pGlobStrId)
ScDBData * GetAnonymousDBData(const ScRange &rRange)
void MarkRange(const ScRange &rRange, bool bSetCursor=true, bool bContinue=false)
std::unique_ptr< sal_Int32[]> pData
bool DoImport(SCTAB nTab, const ScImportParam &rParam, const svx::ODataAccessDescriptor *pDescriptor)
void GotoDBArea(const OUString &rDBName)
SC_DLLPUBLIC const ScDBData * GetDBAtArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2) const
bool ImportData(const ScImportParam &rParam)
ScDocument & GetDocument() const
void Invalidate(sal_uInt16 nId)
SC_DLLPUBLIC void ApplyAttr(SCCOL nCol, SCROW nRow, SCTAB nTab, const SfxPoolItem &rAttr)
ScDBData * GetDBData(const ScRange &rMarked, ScGetDBMode eMode, ScGetDBSelection eSel)
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...
SC_DLLPUBLIC void MoveCursorAbs(SCCOL nCurX, SCROW nCurY, ScFollowMode eMode, bool bShift, bool bControl, bool bKeepOld=false, bool bKeepSel=false)
virtual SfxUndoManager * GetUndoManager() override
Shrink selection to actually used data area within the selection.
Keep selection as is, expand to used data area if no selection.
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 ...
bool IsMultiMarked() const
SC_DLLPUBLIC SCSIZE GetEntryCount() const
void DoSubTotals(const ScSubTotalParam &rParam, bool bRecord=true, const ScSortParam *pForceNewSort=nullptr)
ScDBFunc(vcl::Window *pParent, ScDocShell &rDocSh, ScTabViewShell *pViewShell)
SC_DLLPUBLIC const ScQueryEntry & GetEntry(SCSIZE n) const
void DoneBlockMode(bool bContinue=false)
If only one row or portion thereof is selected, shrink row to used data columns and select further ro...
ScViewData & GetViewData()
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.
void SelectionChanged(bool bFromPaste=false)
SC_DLLPUBLIC const SfxPoolItem * GetAttr(SCCOL nCol, SCROW nRow, SCTAB nTab, sal_uInt16 nWhich) 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.
virtual void AddUndoAction(std::unique_ptr< SfxUndoAction > pAction, bool bTryMerg=false)
SfxBindings & GetBindings()
ScMarkType
States GetSimpleArea() returns for the underlying selection marks, so the caller can react if the res...
static SC_DLLPUBLIC const CharClass & getCharClass()
SC_DLLPUBLIC void SetTabNo(SCTAB nTab, bool bNew=false, bool bExtendSelection=false, bool bSameTabButMoved=false)
ScMarkType GetSimpleArea(SCCOL &rStartCol, SCROW &rStartRow, SCTAB &rStartTab, SCCOL &rEndCol, SCROW &rEndRow, SCTAB &rEndTab) const
const OUString & GetName() const
bool IsBlockEmpty(SCTAB nTab, SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, bool bIgnoreNotes=false) const
void PostPaint(SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab, SCCOL nEndCol, SCROW nEndRow, SCTAB nEndTab, PaintPartFlags nPart, sal_uInt16 nExtFlags=0)
void GetArea(SCTAB &rTab, SCCOL &rCol1, SCROW &rRow1, SCCOL &rCol2, SCROW &rRow2) const
void SetHeader(bool bHasH)
TranslateId GetMessageId() const
void UpdateScrollBars(HeaderType eHeaderType=BOTH_HEADERS)
void Sort(const ScSortParam &rSortParam, bool bRecord=true, bool bPaint=true)
void GetSubTotalParam(ScSubTotalParam &rSubTotalParam) const
ScDBData * findByUpperName(const OUString &rName)
SC_DLLPUBLIC bool Query(SCTAB nTab, const ScQueryParam &rQueryParam, const ScRange *pAdvSource, bool bRecord, bool bApi)
constexpr TypedWhichId< ScMergeFlagAttr > ATTR_MERGE_FLAG(145)
SC_DLLPUBLIC bool Sort(SCTAB nTab, const ScSortParam &rSortParam, bool bRecord, bool bPaint, bool bApi)
void ResetAutoSpellForContentChange()
ScGetDBSelection
For ScDBFunc::GetDBData()
virtual void EnterListAction(const OUString &rComment, const OUString &rRepeatComment, sal_uInt16 nId, ViewShellId nViewShellId)
force use of sheet-local instead of document global anonymous range
const ScDocument & GetDocument() const
SC_DLLPUBLIC void GetQueryParam(ScQueryParam &rQueryParam) const
void UISort(const ScSortParam &rSortParam)
void SetDocumentModified()
ScDBData * GetAnonymousDBData()
SC_DLLPUBLIC void Query(const ScQueryParam &rQueryParam, const ScRange *pAdvSource, bool bRecord)
const ScDBData * GetDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, ScDBDataPortion ePortion) const
void MarkCursor(SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, bool bCols=false, bool bRows=false, bool bCellSelection=false)
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.
void InitBlockMode(SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, bool bTestNeg=false, bool bCols=false, bool bRows=false, bool bForceNeg=false)
void SetAutoFilter(bool bSet)
bool m_bDetectedRangeSegmentation false