31#include <document.hxx>
53#include <formdata.hxx>
54#include <inputwin.hxx>
79#include <LibreOfficeKit/LibreOfficeKitEnums.h>
91 sal_uInt16 nSlotId =
SC_MOD()->GetCurRefDlgId();
92 if( nSlotId == FID_ADD_NAME )
96 sal_uInt16
nId = ScNameDlgWrapper::GetChildWindowId();
100 SC_MOD()->SetRefDialog(
nId, pWnd ==
nullptr );
102 else if (nSlotId == FID_DEFINE_NAME)
107 sal_uInt16
nId = ScNameDefDlgWrapper::GetChildWindowId();
111 SC_MOD()->SetRefDialog(
nId, pWnd ==
nullptr );
123 if (
SC_MOD()->GetCurRefDlgId() != nSlotId )
138 std::shared_ptr<SfxModelessDialogController> xResult;
147 case SID_CORRELATION_DIALOG:
148 xResult = std::make_shared<ScCorrelationDialog>(pB, pCW, pParent,
GetViewData());
150 case SID_SAMPLING_DIALOG:
151 xResult = std::make_shared<ScSamplingDialog>(pB, pCW, pParent,
GetViewData());
153 case SID_DESCRIPTIVE_STATISTICS_DIALOG:
154 xResult = std::make_shared<ScDescriptiveStatisticsDialog>(pB, pCW, pParent,
GetViewData());
156 case SID_ANALYSIS_OF_VARIANCE_DIALOG:
157 xResult = std::make_shared<ScAnalysisOfVarianceDialog>(pB, pCW, pParent,
GetViewData());
159 case SID_COVARIANCE_DIALOG:
160 xResult = std::make_shared<ScCovarianceDialog>(pB, pCW, pParent,
GetViewData());
162 case SID_EXPONENTIAL_SMOOTHING_DIALOG:
163 xResult = std::make_shared<ScExponentialSmoothingDialog>(pB, pCW, pParent,
GetViewData());
165 case SID_MOVING_AVERAGE_DIALOG:
166 xResult = std::make_shared<ScMovingAverageDialog>(pB, pCW, pParent,
GetViewData());
168 case SID_REGRESSION_DIALOG:
169 xResult = std::make_shared<ScRegressionDialog>(pB, pCW, pParent,
GetViewData());
171 case SID_FTEST_DIALOG:
172 xResult = std::make_shared<ScFTestDialog>(pB, pCW, pParent,
GetViewData());
174 case SID_TTEST_DIALOG:
175 xResult = std::make_shared<ScTTestDialog>(pB, pCW, pParent,
GetViewData());
177 case SID_ZTEST_DIALOG:
178 xResult = std::make_shared<ScZTestDialog>(pB, pCW, pParent,
GetViewData());
180 case SID_CHI_SQUARE_TEST_DIALOG:
181 xResult = std::make_shared<ScChiSquareTestDialog>(pB, pCW, pParent,
GetViewData());
183 case SID_FOURIER_ANALYSIS_DIALOG:
184 xResult = std::make_shared<ScFourierAnalysisDialog>(pB, pCW, pParent,
GetViewData());
192 xResult = std::make_shared<ScSimpleRefDlg>(pB, pCW, pParent);
195 case FID_DEFINE_NAME:
199 xResult = std::make_shared<ScNameDlg>(pB, pCW, pParent,
GetViewData(),
206 xResult = std::make_shared<ScNameDlg>( pB, pCW, pParent,
GetViewData(),
219 std::map<OUString, ScRangeName*> aRangeMap;
221 xResult = std::make_shared<ScNameDefDlg>(pB, pCW, pParent,
GetViewData(), std::move(aRangeMap),
228 std::map<OUString, ScRangeName*> aRangeMap;
231 aRangeMap.insert(std::pair<OUString, ScRangeName*>(itr.first, &itr.second));
233 xResult = std::make_shared<ScNameDefDlg>(pB, pCW, pParent,
GetViewData(), std::move(aRangeMap),
240 case SID_RANDOM_NUMBER_GENERATOR_DIALOG:
241 xResult = std::make_shared<ScRandomNumberGeneratorDialog>(pB, pCW, pParent,
GetViewData());
243 case SID_SPARKLINE_DIALOG:
245 xResult = std::make_shared<sc::SparklineDialog>(pB, pCW, pParent,
GetViewData());
248 case SID_SPARKLINE_DATA_RANGE_DIALOG:
250 xResult = std::make_shared<sc::SparklineDataRangeDialog>(pB, pCW, pParent,
GetViewData());
253 case SID_DEFINE_DBNAME:
261 xResult = std::make_shared<ScDbNameDlg>(pB, pCW, pParent,
GetViewData());
264 case SID_OPENDLG_EDIT_PRINTAREA:
265 xResult = std::make_shared<ScPrintAreasDlg>(pB, pCW, pParent);
267 case SID_DEFINE_COLROWNAMERANGES:
268 xResult = std::make_shared<ScColRowNameRangesDlg>(pB, pCW, pParent,
GetViewData());
270 case SID_OPENDLG_SOLVE:
276 xResult = std::make_shared<ScSolverDlg>(pB, pCW, pParent, &rViewData.
GetDocument(), aCurPos);
279 case SID_OPENDLG_TABOP:
286 xResult = std::make_shared<ScTabOpDlg>(pB, pCW, pParent, &rViewData.
GetDocument(), aCurPos);
289 case SID_OPENDLG_CONSOLIDATE:
300 SCCOL nStartCol, nEndCol;
301 SCROW nStartRow, nEndRow;
302 SCTAB nStartTab, nEndTab;
305 nEndCol, nEndRow, nEndTab );
311 aConsParam.
nCol = nStartCol;
312 aConsParam.
nRow = nStartRow;
313 aConsParam.
nTab = nStartTab;
322 xResult = std::make_shared<ScConsolidateDlg>(pB, pCW, pParent, aArgSet);
346 xResult = std::make_shared<ScFilterDlg>(pB, pCW, pParent, aArgSet);
349 case SID_SPECIAL_FILTER:
368 aArgSet.Put( aItem );
373 xResult = std::make_shared<ScSpecialFilterDlg>(pB, pCW, pParent, aArgSet);
376 case SID_OPENDLG_OPTSOLVER:
380 xResult = std::make_shared<ScOptSolverDlg>(pB, pCW, pParent, rViewData.
GetDocShell(), aCurPos);
386 xResult = std::make_shared<ScHighlightChgDlg>(pB, pCW, pParent,
GetViewData());
389 case SID_MANAGE_XML_SOURCE:
391 xResult = std::make_shared<ScXMLSourceDlg>(pB, pCW, pParent, &rDoc);
394 case SID_OPENDLG_PIVOTTABLE:
404 xResult = std::make_shared<ScPivotLayoutDialog>(pB, pCW, pParent, &rViewData,
pDialogDPObject.get(), pObj ==
nullptr);
409 case SID_OPENDLG_FUNCTION:
418 case WID_CONDFRMT_REF:
423 if (itemsRange.begin() != itemsRange.end())
434 xResult = std::make_shared<ScCondFormatDlg>(pB, pCW, pParent, &rViewData, pDlgItem);
445 xResult->Initialize( pInfo );
502 case svtools::ColorConfigEntry::DOCCOLOR:
522 css::uno::Reference<css::datatransfer::XTransferable2> xTransferable;
523 css::uno::Reference<css::datatransfer::clipboard::XClipboard> xClipboard;
530 xTransferable.set(xClipboard.is() ? xClipboard->getContents() :
nullptr, css::uno::UNO_QUERY);
532 return xTransferable;
560 && (nCurrentTabIndex == -1 || pTabViewShell->
getPart() == nCurrentTabIndex))
576 if (pTabViewShell && pTabViewShell->
GetDocId() == pForViewShell->
GetDocId())
594 bool bRows,
bool bSizes,
bool bHidden,
bool bFiltered,
595 bool bGroups,
SCTAB nCurrentTabIndex)
599 comphelper::LibreOfficeKit::Compat::scPrintTwipsMsgs))
602 if (!bColumns && !bRows)
605 bool bAllTypes = bSizes && bHidden && bFiltered && bGroups;
606 bool bAllDims = bColumns && bRows;
607 OString aPayload = bAllDims ?
"all" : bColumns ?
"columns" :
"rows";
612 aPayload +=
" sizes";
615 aPayload +=
" hidden";
618 aPayload +=
" filtered";
621 aPayload +=
" groups";
629 (nCurrentTabIndex == -1 || pTabViewShell->
getPart() == nCurrentTabIndex))
639 bool bSubTotal =
false;
641 size_t nRangeCount (pRangeList->
size());
642 size_t nRangeIndex (0);
643 while (!bSubTotal && nRangeIndex < nRangeCount)
645 const ScRange& rRange = (*pRangeList)[nRangeIndex];
648 while (!bSubTotal && nTab <= nTabEnd)
652 while (!bSubTotal && nRow <= nRowEnd)
667 for (
const auto& rxDB : rDBs)
674 while (!bSubTotal && nRangeIndex < nRangeCount)
676 const ScRange & rRange = (*pRangeList)[nRangeIndex];
698 rRangeFinder = rSubTotal =
false;
707 const ScRange & rRange( aMarkRangeList[
i] );
724 const bool bSubTotal(
UseSubTotal( &aRangeList ) );
730 const bool bSubTotal(
UseSubTotal( &aMarkRangeList ) );
733 const ScRange & rRange = aMarkRangeList[
i];
734 const bool bSetCursor = (
i ==
nCount - 1 );
735 const bool bContinue = (
i != 0 );
736 if ( !
AutoSum( rRange, bSubTotal, bSetCursor, bContinue, eCode ) )
void PutInOrder(T &nStart, T &nEnd)
void DrawSelectionXOR(OutlinerViewShell *pOtherShell)
void RegisterOtherShell(OutlinerViewShell *pOtherShell)
void ShowCursor(bool bGotoCursor=true, bool bForceVisCursor=true, bool bActivate=false)
EditView & GetEditView() const
void IncRow(SCROW nDelta=1)
Stores global named database ranges.
bool HasAutoFilter() const
void GetArea(SCTAB &rTab, SCCOL &rCol1, SCROW &rRow1, SCCOL &rCol2, SCROW &rRow2) const
SC_DLLPUBLIC bool GetAdvancedQuerySource(ScRange &rSource) const
SC_DLLPUBLIC void GetQueryParam(ScQueryParam &rQueryParam) const
void ExtendDataArea(const ScDocument &rDoc)
ScDBData * GetDBData(bool bMarkArea=true, ScGetDBMode eMode=SC_DB_MAKE, ScGetDBSelection eSel=ScGetDBSelection::Keep)
SC_DLLPUBLIC void GetRangeNameMap(std::map< OUString, ScRangeName * > &rRangeName)
SC_DLLPUBLIC bool RowFiltered(SCROW nRow, SCTAB nTab, SCROW *pFirstRow=nullptr, SCROW *pLastRow=nullptr) const
const ScConsolidateParam * GetConsolidateDlgData() const
SC_DLLPUBLIC ScDBCollection * GetDBCollection() const
SC_DLLPUBLIC ScDPObject * GetDPAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab) const
bool IsBlockEmpty(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab) const
static ScFunctionMgr * GetStarCalcFunctionMgr()
void updateKitCellCursor(const SfxViewShell *pOtherShell) const
todo: It should be possible to have MarkArrays for each table, in order to enable "search all" across...
bool IsMultiMarked() const
void FillRangeListWithMarks(ScRangeList *pList, bool bClear, SCTAB nForTab=-1) const
Create a range list of marks.
void SetAdvancedQuerySource(const ScRange *pSource)
bool Intersects(const ScRange &rRange) const
std::unique_ptr< ScDPObject > pDialogDPObject
bool UseSubTotal(ScRangeList *pRangeList)
void afterCallbackRegistered() override
See SfxViewShell::afterCallbackRegistered().
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...
std::unique_ptr< ScInputHandler, o3tl::default_delete< ScInputHandler > > mpInputHandler
static css::uno::Reference< css::datatransfer::XTransferable2 > GetClipData(vcl::Window *pWin)
::Color GetColorConfigColor(svtools::ColorConfigEntry nColorType) const override
See SfxViewShell::GetColorConfigColor().
static bool isAnyEditViewInRange(const SfxViewShell *pForViewShell, bool bColumns, SCCOLROW nStart, SCCOLROW nEnd)
static void notifyAllViewsHeaderInvalidation(const SfxViewShell *pForViewShell, HeaderType eHeaderType, SCTAB nCurrentTabIndex)
Emits a LOK_CALLBACK_INVALIDATE_HEADER for all views whose current tab is equal to nCurrentTabIndex.
void UpdateInputHandler(bool bForce=false, bool bStopEditing=true)
std::map< OUString, ScRangeName > m_RangeMap
void NotifyCursor(SfxViewShell *pViewShell) const override
See SfxViewShell::NotifyCursor().
void SwitchBetweenRefDialogs(SfxModelessDialogController *pDialog)
OUString GetColorConfigName() const override
See SfxViewShell::GetColorConfigName().
void SetCurRefDlgId(sal_uInt16 nNew)
int getPart() const override
See SfxViewShell::getPart().
OUString DoAutoSum(bool &rRangeFinder, bool &rSubTotal, const OpCode eCode)
std::shared_ptr< SfxModelessDialogController > CreateRefDialogController(SfxBindings *pB, SfxChildWindow *pCW, const SfxChildWinInfo *pInfo, weld::Window *pParent, sal_uInt16 nSlotId)
const ScInputHandler * GetInputHandler() const
std::unique_ptr< ScFormEditData > mpFormEditData
void MarkDataArea(bool bIncludeCursor=true)
void MarkRange(const ScRange &rRange, bool bSetCursor=true, bool bContinue=false)
ScViewData & GetViewData()
SC_DLLPUBLIC void SetCursor(SCCOL nPosX, SCROW nPosY, bool bNew=false)
ScDrawView * GetScDrawView()
SfxDispatcher & GetDispatcher()
const ScViewOptions & GetOptions() const
ScMarkData & GetMarkData()
ScDocument & GetDocument() const
ScDocShell * GetDocShell() const
ScGridWindow * GetActiveWin()
ScMarkType GetSimpleArea(SCCOL &rStartCol, SCROW &rStartRow, SCTAB &rStartTab, SCCOL &rEndCol, SCROW &rEndRow, SCTAB &rEndTab) const
ScAddress GetCurPos() const
void SetRefTabNo(SCTAB nNewTab)
bool AutoSum(const ScRange &rRange, bool bSubTotal, bool bSetCursor, bool bContinue, const OpCode eCode)
bool GetAutoSumArea(ScRangeList &rRangeList)
void EnterAutoSum(const ScRangeList &rRangeList, bool bSubTotal, const ScAddress &rAddr, const OpCode eCode)
OUString GetAutoSumFormula(const ScRangeList &rRangeList, bool bSubTotal, const ScAddress &rAddr, const OpCode eCode)
const Color & GetDocColor() const
const OUString & GetColorSchemeName() const
void AdjustMarkHdl(SfxViewShell *pOtherShell=nullptr)
SdrTextObj * GetTextEditObject() const
const OutlinerView * GetTextEditOutlinerView() const
void SetHideNotDelete(bool bOn)
Item2Range GetItemSurrogates(sal_uInt16 nWhich) const
void Remove(const SfxPoolItem &)
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
SfxItemPool & GetPool() const
vcl::Window & GetWindow() const
SfxChildWindow * GetChildWindow(sal_uInt16)
static SAL_WARN_UNUSED_RESULT SfxViewFrame * GetFirst(const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
bool isLOKMobilePhone() const
virtual void libreOfficeKitViewCallback(int nType, const OString &pPayload) const override
ViewShellDocId GetDocId() const override
SfxViewFrame & GetViewFrame() const
static SAL_WARN_UNUSED_RESULT SfxViewShell * GetNext(const SfxViewShell &rPrev, bool bOnlyVisible=true, const std::function< bool(const SfxViewShell *)> &isViewShell=nullptr)
static SAL_WARN_UNUSED_RESULT SfxViewShell * GetFirst(bool bOnlyVisible=true, const std::function< bool(const SfxViewShell *)> &isViewShell=nullptr)
css::uno::Reference< css::datatransfer::clipboard::XClipboard > GetClipboard()
@ RowDown
If only one row or portion thereof is selected, shrink row to used data columns and select further ro...
@ SC_DB_MAKE
create "untitled" (if necessary)
bool isCompatFlagSet(Compat flag)
#define SCITEM_CONDFORMATDLGDATA
#define SCITEM_CONSOLIDATEDATA
sal_Int32 SCCOLROW
a type capable of holding either SCCOL or SCROW