From 141f3fd15633803afa720837405a0bacbc2726cb Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Thu, 19 Dec 2024 19:22:10 +0500 Subject: Simplify abstract dialog impls using vcl::AbstractDialogImpl* in sc Change-Id: Iff9ac377a5cfa259c5911632ad16d2b1e3269868 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178986 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- sc/source/ui/attrdlg/scdlgfact.cxx | 1621 +++++++++++++----------------------- sc/source/ui/attrdlg/scdlgfact.hxx | 635 -------------- sc/source/ui/attrdlg/scuiexp.cxx | 5 + 3 files changed, 593 insertions(+), 1668 deletions(-) (limited to 'sc') diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx index c088322f01a2..2dc64da32d5f 100644 --- a/sc/source/ui/attrdlg/scdlgfact.cxx +++ b/sc/source/ui/attrdlg/scdlgfact.cxx @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -70,1119 +71,422 @@ #include #include +#include #include -short AbstractScImportAsciiDlg_Impl::Execute() +namespace { - return m_xDlg->run(); -} - -bool AbstractScImportAsciiDlg_Impl::StartExecuteAsync(VclAbstractDialog::AsyncContext &rCtx) -{ - return weld::DialogController::runAsync(m_xDlg, rCtx.maEndDialogFn); -} - -short AbstractScAutoFormatDlg_Impl::Execute() -{ - return m_xDlg->run(); -} - -short AbstractScColRowLabelDlg_Impl::Execute() -{ - return m_xDlg->run(); -} - -bool AbstractScColRowLabelDlg_Impl::StartExecuteAsync(AsyncContext &rCtx) -{ - return weld::GenericDialogController::runAsync(m_xDlg, rCtx.maEndDialogFn); -} - -short AbstractScCondFormatManagerDlg_Impl::Execute() -{ - return m_xDlg->run(); -} - -bool AbstractScCondFormatManagerDlg_Impl::StartExecuteAsync(VclAbstractDialog::AsyncContext &rCtx) -{ - return weld::DialogController::runAsync(m_xDlg, rCtx.maEndDialogFn); -} - -short AbstractScDataPilotDatabaseDlg_Impl::Execute() -{ - return m_xDlg->run(); -} - -bool AbstractScDataPilotDatabaseDlg_Impl::StartExecuteAsync(AsyncContext &rCtx) -{ - return weld::DialogController::runAsync(m_xDlg, rCtx.maEndDialogFn); -} - -short AbstractScDataPilotSourceTypeDlg_Impl::Execute() -{ - return m_xDlg->run(); -} - -bool AbstractScDataPilotSourceTypeDlg_Impl::StartExecuteAsync(AsyncContext &rCtx) -{ - return weld::DialogController::runAsync(m_xDlg, rCtx.maEndDialogFn); -} - -short AbstractScDataPilotServiceDlg_Impl::Execute() -{ - return m_xDlg->run(); -} - -bool AbstractScDataPilotServiceDlg_Impl::StartExecuteAsync(VclAbstractDialog::AsyncContext &rCtx) -{ - return weld::DialogController::runAsync(m_xDlg, rCtx.maEndDialogFn); -} - -short AbstractScDeleteCellDlg_Impl::Execute() -{ - return m_xDlg->run(); -} - -bool AbstractScDeleteCellDlg_Impl::StartExecuteAsync(AsyncContext& rCtx) -{ - return ScDeleteCellDlg::runAsync(m_xDlg, rCtx.maEndDialogFn); -} - -//for dataform -short AbstractScDataFormDlg_Impl::Execute() -{ - return m_xDlg->run(); -} - -BitmapEx AbstractScDataFormDlg_Impl::createScreenshot() const -{ - VclPtr xDialogSurface(m_xDlg->getDialog()->screenshot()); - return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel()); -} - -OUString AbstractScDataFormDlg_Impl::GetScreenshotId() const -{ - return m_xDlg->get_help_id(); -} - -short AbstractScDeleteContentsDlg_Impl::Execute() -{ - return m_xDlg->run(); -} - -short AbstractScFillSeriesDlg_Impl::Execute() -{ - return m_xDlg->run(); -} - -short AbstractScGroupDlg_Impl::Execute() -{ - return m_xDlg->run(); -} - -short AbstractScInsertCellDlg_Impl::Execute() -{ - return m_xDlg->run(); -} - -bool AbstractScInsertCellDlg_Impl::StartExecuteAsync(AsyncContext& rCtx) -{ - return ScInsertCellDlg::runAsync(m_xDlg, rCtx.maEndDialogFn); -} - -short AbstractScInsertContentsDlg_Impl::Execute() -{ - return m_xDlg->run(); -} - -short AbstractScInsertTableDlg_Impl::Execute() -{ - return m_xDlg->run(); -} - -bool AbstractScInsertTableDlg_Impl::StartExecuteAsync(VclAbstractDialog::AsyncContext &rCtx) -{ - return weld::DialogController::runAsync(m_xDlg, rCtx.maEndDialogFn); -} - -short AbstractScSelEntryDlg_Impl::Execute() -{ - return m_xDlg->run(); -} - -short AbstractScMetricInputDlg_Impl::Execute() -{ - return m_xDlg->run(); -} - -bool AbstractScMetricInputDlg_Impl::StartExecuteAsync(AsyncContext& rCtx) -{ - return ScMetricInputDlg::runAsync(m_xDlg, rCtx.maEndDialogFn); -} - -short AbstractScMoveTableDlg_Impl::Execute() -{ - return m_xDlg->run(); -} - -bool AbstractScMoveTableDlg_Impl::StartExecuteAsync(VclAbstractDialog::AsyncContext& rCtx) -{ - return weld::DialogController::runAsync(m_xDlg, rCtx.maEndDialogFn); -} - -BitmapEx AbstractScMoveTableDlg_Impl::createScreenshot() const -{ - VclPtr xDialogSurface(m_xDlg->getDialog()->screenshot()); - return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel()); -} - -OUString AbstractScMoveTableDlg_Impl::GetScreenshotId() const -{ - return m_xDlg->get_help_id(); -} - -short AbstractScNameCreateDlg_Impl::Execute() -{ - return m_xDlg->run(); -} - -short AbstractScNamePasteDlg_Impl::Execute() -{ - return m_xDlg->run(); -} - -short AbstractScPivotFilterDlg_Impl::Execute() -{ - return m_xDlg->run(); -} - -short AbstractScDPFunctionDlg_Impl::Execute() -{ - return m_xDlg->run(); -} - -bool AbstractScDPFunctionDlg_Impl::StartExecuteAsync(VclAbstractDialog::AsyncContext &rCtx) -{ - return weld::DialogController::runAsync(m_xDlg, rCtx.maEndDialogFn); -} - -short AbstractScDPSubtotalDlg_Impl::Execute() -{ - return m_xDlg->run(); -} - -bool AbstractScDPSubtotalDlg_Impl::StartExecuteAsync(VclAbstractDialog::AsyncContext &rCtx) -{ - return weld::DialogController::runAsync(m_xDlg, rCtx.maEndDialogFn); -} - -short AbstractScDPNumGroupDlg_Impl::Execute() -{ - return m_xDlg->run(); -} - -short AbstractScDPDateGroupDlg_Impl::Execute() -{ - return m_xDlg->run(); -} - -short AbstractScDPShowDetailDlg_Impl::Execute() -{ - return m_xDlg->run(); -} - -short AbstractScNewScenarioDlg_Impl::Execute() -{ - return m_xDlg->run(); -} - -short AbstractScShowTabDlg_Impl::Execute() -{ - return m_xDlg->run(); -} - -bool AbstractScShowTabDlg_Impl::StartExecuteAsync(VclAbstractDialog::AsyncContext &rCtx) -{ - return weld::DialogController::runAsync(m_xDlg, rCtx.maEndDialogFn); -} - -short AbstractScGoToTabDlg_Impl::Execute() -{ - return m_xDlg->run(); -} - -bool AbstractScGoToTabDlg_Impl::StartExecuteAsync(VclAbstractDialog::AsyncContext &rCtx) -{ - return weld::DialogController::runAsync(m_xDlg, rCtx.maEndDialogFn); -} - -short AbstractScSortWarningDlg_Impl::Execute() -{ - return m_xDlg->run(); -} - -short AbstractScTabBgColorDlg_Impl::Execute() -{ - return m_xDlg->run(); -} - -bool AbstractScTabBgColorDlg_Impl::StartExecuteAsync(VclAbstractDialog::AsyncContext &rCtx) -{ - return weld::DialogController::runAsync(m_xDlg, rCtx.maEndDialogFn); -} - -short AbstractScImportOptionsDlg_Impl::Execute() -{ - return m_xDlg->run(); -} - -short AbstractScTextImportOptionsDlg_Impl::Execute() -{ - return m_xDlg->run(); -} - -AbstractScLinkedAreaDlg_Impl::~AbstractScLinkedAreaDlg_Impl() -{ -} - -short AbstractScLinkedAreaDlg_Impl::Execute() -{ - return m_xDlg->run(); -} - -void AbstractScImportAsciiDlg_Impl::GetOptions( ScAsciiOptions& rOpt ) -{ - m_xDlg->GetOptions( rOpt ); -} - -void AbstractScImportAsciiDlg_Impl::SaveParameters() -{ - m_xDlg->SaveParameters(); -} - -BitmapEx AbstractScImportAsciiDlg_Impl::createScreenshot() const -{ - VclPtr xDialogSurface(m_xDlg->getDialog()->screenshot()); - return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel()); -} - -OUString AbstractScImportAsciiDlg_Impl::GetScreenshotId() const -{ - return m_xDlg->get_help_id(); -} - -sal_uInt16 AbstractScAutoFormatDlg_Impl::GetIndex() const -{ - return m_xDlg->GetIndex(); -} - -OUString AbstractScAutoFormatDlg_Impl::GetCurrFormatName() -{ - return m_xDlg->GetCurrFormatName(); -} - -bool AbstractScColRowLabelDlg_Impl::IsCol() -{ - return m_xDlg->IsCol(); -} - -bool AbstractScColRowLabelDlg_Impl::IsRow() -{ - return m_xDlg->IsRow(); -} - -BitmapEx AbstractScColRowLabelDlg_Impl::createScreenshot() const -{ - VclPtr xDialogSurface(m_xDlg->getDialog()->screenshot()); - return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel()); -} - -OUString AbstractScColRowLabelDlg_Impl::GetScreenshotId() const -{ - return m_xDlg->get_help_id(); -} - -void AbstractScDataPilotDatabaseDlg_Impl::GetValues( ScImportSourceDesc& rDesc ) -{ - m_xDlg->GetValues(rDesc); -} - -BitmapEx AbstractScDataPilotDatabaseDlg_Impl::createScreenshot() const -{ - VclPtr xDialogSurface(m_xDlg->getDialog()->screenshot()); - return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel()); -} - -OUString AbstractScDataPilotDatabaseDlg_Impl::GetScreenshotId() const -{ - return m_xDlg->get_help_id(); -} - -bool AbstractScDataPilotSourceTypeDlg_Impl::IsDatabase() const -{ - return m_xDlg->IsDatabase(); -} - -bool AbstractScDataPilotSourceTypeDlg_Impl::IsExternal() const -{ - return m_xDlg->IsExternal(); -} - -bool AbstractScDataPilotSourceTypeDlg_Impl::IsNamedRange() const -{ - return m_xDlg->IsNamedRange(); -} - -OUString AbstractScDataPilotSourceTypeDlg_Impl::GetSelectedNamedRange() const -{ - return m_xDlg->GetSelectedNamedRange(); -} - -void AbstractScDataPilotSourceTypeDlg_Impl::AppendNamedRange(const OUString& rName) -{ - m_xDlg->AppendNamedRange(rName); -} - -BitmapEx AbstractScDataPilotSourceTypeDlg_Impl::createScreenshot() const -{ - VclPtr xDialogSurface(m_xDlg->getDialog()->screenshot()); - return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel()); -} - -OUString AbstractScDataPilotSourceTypeDlg_Impl::GetScreenshotId() const -{ - return m_xDlg->get_help_id(); -} - -OUString AbstractScDataPilotServiceDlg_Impl::GetServiceName() const -{ - return m_xDlg->GetServiceName(); -} - -OUString AbstractScDataPilotServiceDlg_Impl::GetParSource() const -{ - return m_xDlg->GetParSource(); -} - -OUString AbstractScDataPilotServiceDlg_Impl::GetParName() const -{ - return m_xDlg->GetParName(); -} - -OUString AbstractScDataPilotServiceDlg_Impl::GetParUser() const +template class ImplTemplate> +class ScreenshottedDialog_Impl_BASE : public ImplTemplate { - return m_xDlg->GetParUser(); -} - -OUString AbstractScDataPilotServiceDlg_Impl::GetParPass() const -{ - return m_xDlg->GetParPass(); -} - -DelCellCmd AbstractScDeleteCellDlg_Impl::GetDelCellCmd() const -{ - return m_xDlg->GetDelCellCmd(); -} - -BitmapEx AbstractScDeleteCellDlg_Impl::createScreenshot() const -{ - VclPtr xDialogSurface(m_xDlg->getDialog()->screenshot()); - return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel()); -} - -OUString AbstractScDeleteCellDlg_Impl::GetScreenshotId() const -{ - return m_xDlg->get_help_id(); -} - -void AbstractScDeleteContentsDlg_Impl::DisableObjects() -{ - m_xDlg->DisableObjects(); -} - -InsertDeleteFlags AbstractScDeleteContentsDlg_Impl::GetDelContentsCmdBits() const -{ - return m_xDlg->GetDelContentsCmdBits(); -} +public: + using ImplTemplate::ImplTemplate; -BitmapEx AbstractScDeleteContentsDlg_Impl::createScreenshot() const -{ - VclPtr xDialogSurface(m_xDlg->getDialog()->screenshot()); - return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel()); -} - -OUString AbstractScDeleteContentsDlg_Impl::GetScreenshotId() const -{ - return m_xDlg->get_help_id(); -} - -FillDir AbstractScFillSeriesDlg_Impl::GetFillDir() const -{ - return m_xDlg->GetFillDir(); -} - -FillCmd AbstractScFillSeriesDlg_Impl::GetFillCmd() const -{ - return m_xDlg->GetFillCmd(); -} - -FillDateCmd AbstractScFillSeriesDlg_Impl::GetFillDateCmd() const -{ - return m_xDlg->GetFillDateCmd(); -} - -double AbstractScFillSeriesDlg_Impl::GetStart() const -{ - return m_xDlg->GetStart(); -} - -double AbstractScFillSeriesDlg_Impl::GetStep() const -{ - return m_xDlg->GetStep(); -} - -double AbstractScFillSeriesDlg_Impl::GetMax() const -{ - return m_xDlg->GetMax(); -} - -OUString AbstractScFillSeriesDlg_Impl::GetStartStr() const -{ - return m_xDlg->GetStartStr(); -} - -void AbstractScFillSeriesDlg_Impl::SetEdStartValEnabled(bool bFlag) -{ - m_xDlg->SetEdStartValEnabled(bFlag); -} - -bool AbstractScGroupDlg_Impl::StartExecuteAsync(VclAbstractDialog::AsyncContext &rCtx) -{ - return weld::DialogController::runAsync(m_xDlg, rCtx.maEndDialogFn); -} - -bool AbstractScGroupDlg_Impl::GetColsChecked() const -{ - return m_xDlg->GetColsChecked(); -} - -InsCellCmd AbstractScInsertCellDlg_Impl::GetInsCellCmd() const -{ - return m_xDlg->GetInsCellCmd(); -} - -size_t AbstractScInsertCellDlg_Impl::GetCount() const -{ - return m_xDlg->GetCount(); -} - -InsertDeleteFlags AbstractScInsertContentsDlg_Impl::GetInsContentsCmdBits() const -{ - return m_xDlg->GetInsContentsCmdBits(); -} - -ScPasteFunc AbstractScInsertContentsDlg_Impl::GetFormulaCmdBits() const -{ - return m_xDlg->GetFormulaCmdBits(); -} - -bool AbstractScInsertContentsDlg_Impl::IsSkipEmptyCells() const -{ - return m_xDlg->IsSkipEmptyCells(); -} - -bool AbstractScInsertContentsDlg_Impl::IsLink() const -{ - return m_xDlg->IsLink(); -} - -void AbstractScInsertContentsDlg_Impl::SetFillMode( bool bSet ) -{ - m_xDlg->SetFillMode( bSet ); -} - -void AbstractScInsertContentsDlg_Impl::SetOtherDoc( bool bSet ) -{ - m_xDlg->SetOtherDoc( bSet ); -} - -bool AbstractScInsertContentsDlg_Impl::IsTranspose() const -{ - return m_xDlg->IsTranspose(); -} - -void AbstractScInsertContentsDlg_Impl::SetChangeTrack( bool bSet ) -{ - m_xDlg->SetChangeTrack( bSet ); -} - -void AbstractScInsertContentsDlg_Impl::SetCellShiftDisabled( CellShiftDisabledFlags nDisable ) -{ - m_xDlg->SetCellShiftDisabled( nDisable ); -} - -InsCellCmd AbstractScInsertContentsDlg_Impl::GetMoveMode() -{ - return m_xDlg->GetMoveMode(); -} - -BitmapEx AbstractScInsertContentsDlg_Impl::createScreenshot() const -{ - VclPtr xDialogSurface(m_xDlg->getDialog()->screenshot()); - return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel()); -} - -OUString AbstractScInsertContentsDlg_Impl::GetScreenshotId() const -{ - return m_xDlg->get_help_id(); -} - -bool AbstractScInsertTableDlg_Impl::GetTablesFromFile() -{ - return m_xDlg->GetTablesFromFile(); -} - -bool AbstractScInsertTableDlg_Impl::GetTablesAsLink() -{ - return m_xDlg->GetTablesAsLink(); -} - -const OUString* AbstractScInsertTableDlg_Impl::GetFirstTable( sal_uInt16* pN ) -{ - return m_xDlg->GetFirstTable( pN ); -} - -ScDocShell* AbstractScInsertTableDlg_Impl::GetDocShellTables() -{ - return m_xDlg->GetDocShellTables(); -} - -bool AbstractScInsertTableDlg_Impl::IsTableBefore() -{ - return m_xDlg->IsTableBefore(); -} - -sal_uInt16 AbstractScInsertTableDlg_Impl::GetTableCount() -{ - return m_xDlg->GetTableCount(); -} - -const OUString* AbstractScInsertTableDlg_Impl::GetNextTable( sal_uInt16* pN ) -{ - return m_xDlg->GetNextTable( pN ); -} - -BitmapEx AbstractScInsertTableDlg_Impl::createScreenshot() const -{ - VclPtr xDialogSurface(m_xDlg->getDialog()->screenshot()); - return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel()); -} - -OUString AbstractScInsertTableDlg_Impl::GetScreenshotId() const -{ - return m_xDlg->get_help_id(); -} - -OUString AbstractScSelEntryDlg_Impl::GetSelectedEntry() const -{ - return m_xDlg->GetSelectedEntry(); -} - -void AbstractScLinkedAreaDlg_Impl::InitFromOldLink( const OUString& rFile, const OUString& rFilter, - const OUString& rOptions, const OUString& rSource, - sal_Int32 nRefreshDelaySeconds ) -{ - m_xDlg->InitFromOldLink( rFile, rFilter, rOptions, rSource, nRefreshDelaySeconds); -} - -OUString AbstractScLinkedAreaDlg_Impl::GetURL() -{ - return m_xDlg->GetURL(); -} - -OUString AbstractScLinkedAreaDlg_Impl::GetFilter() -{ - return m_xDlg->GetFilter(); -} - -OUString AbstractScLinkedAreaDlg_Impl::GetOptions() -{ - return m_xDlg->GetOptions(); -} - -OUString AbstractScLinkedAreaDlg_Impl::GetSource() -{ - return m_xDlg->GetSource(); -} - -sal_Int32 AbstractScLinkedAreaDlg_Impl::GetRefreshDelaySeconds() -{ - return m_xDlg->GetRefreshDelaySeconds(); -} - -std::unique_ptr AbstractScCondFormatManagerDlg_Impl::GetConditionalFormatList() -{ - return m_xDlg->GetConditionalFormatList(); -} - -bool AbstractScCondFormatManagerDlg_Impl::CondFormatsChanged() const -{ - return m_xDlg->CondFormatsChanged(); -} - -void AbstractScCondFormatManagerDlg_Impl::SetModified() -{ - return m_xDlg->SetModified(); -} - -ScConditionalFormat* AbstractScCondFormatManagerDlg_Impl::GetCondFormatSelected() -{ - return m_xDlg->GetCondFormatSelected(); -} - -int AbstractScMetricInputDlg_Impl::GetInputValue() const -{ - return m_xDlg->GetInputValue(); -} - -sal_uInt16 AbstractScMoveTableDlg_Impl::GetSelectedDocument() const -{ - return m_xDlg->GetSelectedDocument(); -} - -sal_uInt16 AbstractScMoveTableDlg_Impl::GetSelectedTable() const -{ - return m_xDlg->GetSelectedTable(); -} - -bool AbstractScMoveTableDlg_Impl::GetCopyTable() const -{ - return m_xDlg->GetCopyTable(); -} - -bool AbstractScMoveTableDlg_Impl::GetRenameTable() const -{ - return m_xDlg->GetRenameTable(); -} - -void AbstractScMoveTableDlg_Impl::GetTabNameString( OUString& rString ) const -{ - m_xDlg->GetTabNameString( rString ); -} - -void AbstractScMoveTableDlg_Impl::SetForceCopyTable() -{ - return m_xDlg->SetForceCopyTable(); -} - -void AbstractScMoveTableDlg_Impl::EnableRenameTable(bool bFlag) -{ - return m_xDlg->EnableRenameTable( bFlag); -} - -CreateNameFlags AbstractScNameCreateDlg_Impl::GetFlags() const -{ - return m_xDlg->GetFlags(); -} - -BitmapEx AbstractScNameCreateDlg_Impl::createScreenshot() const -{ - VclPtr xDialogSurface(m_xDlg->getDialog()->screenshot()); - return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel()); -} - -OUString AbstractScNameCreateDlg_Impl::GetScreenshotId() const -{ - return m_xDlg->get_help_id(); -} - -std::vector AbstractScNamePasteDlg_Impl::GetSelectedNames() const -{ - return m_xDlg->GetSelectedNames(); -} - -const ScQueryItem& AbstractScPivotFilterDlg_Impl::GetOutputItem() -{ - return m_xDlg->GetOutputItem(); -} - -PivotFunc AbstractScDPFunctionDlg_Impl::GetFuncMask() const -{ - return m_xDlg->GetFuncMask(); -} - -void AbstractScDPFunctionDlg_Impl::Response(int nResponse) -{ - m_xDlg->response(nResponse); -} - -css::sheet::DataPilotFieldReference AbstractScDPFunctionDlg_Impl::GetFieldRef() const -{ - return m_xDlg->GetFieldRef(); -} - -PivotFunc AbstractScDPSubtotalDlg_Impl::GetFuncMask() const -{ - return m_xDlg->GetFuncMask(); -} - -void AbstractScDPSubtotalDlg_Impl::FillLabelData( ScDPLabelData& rLabelData ) const -{ - m_xDlg->FillLabelData( rLabelData ); -} - -void AbstractScDPSubtotalDlg_Impl::Response(int nResponse) -{ - m_xDlg->response(nResponse); -} - -ScDPNumGroupInfo AbstractScDPNumGroupDlg_Impl::GetGroupInfo() const -{ - return m_xDlg->GetGroupInfo(); -} - -ScDPNumGroupInfo AbstractScDPDateGroupDlg_Impl::GetGroupInfo() const -{ - return m_xDlg->GetGroupInfo(); -} - -sal_Int32 AbstractScDPDateGroupDlg_Impl::GetDatePart() const -{ - return m_xDlg->GetDatePart(); -} - -OUString AbstractScDPShowDetailDlg_Impl::GetDimensionName() const -{ - return m_xDlg->GetDimensionName(); -} - -void AbstractScNewScenarioDlg_Impl::SetScenarioData( - const OUString& rName, const OUString& rComment, const Color& rColor, ScScenarioFlags nFlags ) -{ - m_xDlg->SetScenarioData(rName, rComment, rColor, nFlags); -} - -void AbstractScNewScenarioDlg_Impl::GetScenarioData( - OUString& rName, OUString& rComment, Color& rColor, ScScenarioFlags& rFlags ) const -{ - m_xDlg->GetScenarioData(rName, rComment, rColor, rFlags); -} + // screenshotting + BitmapEx createScreenshot() const override + { + VclPtr xDialogSurface(this->m_pDlg->getDialog()->screenshot()); + return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel()); + } + OUString GetScreenshotId() const override { return this->m_pDlg->get_help_id(); } +}; -void AbstractScShowTabDlg_Impl::Insert( const OUString& rString, bool bSelected ) -{ - m_xDlg->Insert(rString, bSelected); -} +template +using ScreenshottedDialog_Impl_Sync + = ScreenshottedDialog_Impl_BASE; -void AbstractScShowTabDlg_Impl::SetDescription( - const OUString& rTitle, const OUString& rFixedText, - const OUString& sDlgHelpId, const OUString& sLbHelpId ) -{ - m_xDlg->SetDescription( rTitle, rFixedText, sDlgHelpId, sLbHelpId ); +template +using ScreenshottedDialog_Impl_Async + = ScreenshottedDialog_Impl_BASE; } -std::vector AbstractScShowTabDlg_Impl::GetSelectedRows() const -{ - return m_xDlg->GetSelectedRows(); -} +// =========================Factories for createdialog =================== -OUString AbstractScShowTabDlg_Impl::GetEntry(sal_Int32 nPos) const +namespace { - return m_xDlg->GetEntry(nPos); -} - -void AbstractScGoToTabDlg_Impl::Insert( const OUString& rString, bool bSelected ) +class AbstractScImportAsciiDlg_Impl + : public ScreenshottedDialog_Impl_Async { - m_xDlg->Insert(rString, bSelected); +public: + using ScreenshottedDialog_Impl_BASE::ScreenshottedDialog_Impl_BASE; + void GetOptions(ScAsciiOptions& rOpt) override { m_pDlg->GetOptions(rOpt); } + void SaveParameters() override { m_pDlg->SaveParameters(); } +}; } -void AbstractScGoToTabDlg_Impl::SetDescription( - const OUString& rTitle, const OUString& rEntryLabel, const OUString& rListLabel, - const OUString& rDlgHelpId, const OUString& rEnHelpId, const OUString& rLbHelpId ) +VclPtr ScAbstractDialogFactory_Impl::CreateScImportAsciiDlg(weld::Window* pParent, + const OUString& aDatName, + SvStream* pInStream, ScImportAsciiCall eCall) { - m_xDlg->SetDescription( rTitle, rEntryLabel, rListLabel, rDlgHelpId, rEnHelpId, rLbHelpId ); + return VclPtr::Create(pParent, aDatName, pInStream, eCall); } -OUString AbstractScGoToTabDlg_Impl::GetSelectedEntry() const +namespace { - return m_xDlg->GetSelectedEntry(); -} - -short AbstractScStringInputDlg_Impl::Execute() +class AbstractScTextImportOptionsDlg_Impl + : public ScreenshottedDialog_Impl_Sync { - return m_xDlg->run(); +public: + using ScreenshottedDialog_Impl_BASE::ScreenshottedDialog_Impl_BASE; + LanguageType GetLanguageType() const override { return m_pDlg->getLanguageType(); } + bool IsDateConversionSet() const override { return m_pDlg->isDateConversionSet(); } + bool IsScientificConversionSet() const override { return m_pDlg->isScientificConversionSet(); } + bool IsKeepAskingSet() const override { return m_pDlg->isKeepAskingSet(); } +}; } -bool AbstractScStringInputDlg_Impl::StartExecuteAsync(VclAbstractDialog::AsyncContext &rCtx) +VclPtr ScAbstractDialogFactory_Impl::CreateScTextImportOptionsDlg(weld::Window* pParent) { - return weld::DialogController::runAsync(m_xDlg, rCtx.maEndDialogFn); + return VclPtr::Create(pParent); } -OUString AbstractScStringInputDlg_Impl::GetInputString() const +namespace { - return m_xDlg->GetInputString(); -} - -BitmapEx AbstractScStringInputDlg_Impl::createScreenshot() const +class AbstractScAutoFormatDlg_Impl + : public vcl::AbstractDialogImpl_Sync { - VclPtr xDialogSurface(m_xDlg->getDialog()->screenshot()); - return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel()); +public: + using AbstractDialogImpl_BASE::AbstractDialogImpl_BASE; + sal_uInt16 GetIndex() const override { return m_pDlg->GetIndex(); } + OUString GetCurrFormatName() override { return m_pDlg->GetCurrFormatName(); } +}; } -OUString AbstractScStringInputDlg_Impl::GetScreenshotId() const +VclPtr ScAbstractDialogFactory_Impl::CreateScAutoFormatDlg(weld::Window* pParent, + ScAutoFormat* pAutoFormat, + const ScAutoFormatData* pSelFormatData, + ScViewData& rViewData) { - return m_xDlg->get_help_id(); + return VclPtr::Create(pParent, pAutoFormat, pSelFormatData, rViewData); } -void AbstractScTabBgColorDlg_Impl::GetSelectedColor( Color& rColor ) const +namespace { - m_xDlg->GetSelectedColor( rColor ); -} - -BitmapEx AbstractScTabBgColorDlg_Impl::createScreenshot() const +class AbstractScColRowLabelDlg_Impl + : public ScreenshottedDialog_Impl_Async { - VclPtr xDialogSurface(m_xDlg->getDialog()->screenshot()); - return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel()); +public: + using ScreenshottedDialog_Impl_BASE::ScreenshottedDialog_Impl_BASE; + bool IsCol() override { return m_pDlg->IsCol(); } + bool IsRow() override { return m_pDlg->IsRow(); } +}; } -OUString AbstractScTabBgColorDlg_Impl::GetScreenshotId() const +VclPtr ScAbstractDialogFactory_Impl::CreateScColRowLabelDlg(weld::Window* pParent, + bool bCol, bool bRow) { - return m_xDlg->get_help_id(); + return VclPtr::Create(pParent, bCol, bRow); } -void AbstractScImportOptionsDlg_Impl::GetImportOptions( ScImportOptions& rOptions ) const +VclPtr ScAbstractDialogFactory_Impl::CreateScSortWarningDlg(weld::Window* pParent, const OUString& rExtendText, const OUString& rCurrentText) { - m_xDlg->GetImportOptions(rOptions); + using AbstractScSortWarningDlg_Impl + = vcl::AbstractDialogImpl_Sync; + return VclPtr::Create(pParent, rExtendText, rCurrentText); } -void AbstractScImportOptionsDlg_Impl::SaveImportOptions() const +namespace { - m_xDlg->SaveImportOptions(); -} - -LanguageType AbstractScTextImportOptionsDlg_Impl::GetLanguageType() const +class AbstractScCondFormatManagerDlg_Impl + : public vcl::AbstractDialogImpl_Async { - return m_xDlg->getLanguageType(); +public: + using AbstractDialogImpl_BASE::AbstractDialogImpl_BASE; + std::unique_ptr GetConditionalFormatList() override + { + return m_pDlg->GetConditionalFormatList(); + } + bool CondFormatsChanged() const override { return m_pDlg->CondFormatsChanged(); } + void SetModified() override { return m_pDlg->SetModified(); } + ScConditionalFormat* GetCondFormatSelected() override + { + return m_pDlg->GetCondFormatSelected(); + } +}; } -bool AbstractScTextImportOptionsDlg_Impl::IsDateConversionSet() const +VclPtr ScAbstractDialogFactory_Impl::CreateScCondFormatMgrDlg(weld::Window* pParent, ScDocument& rDoc, const ScConditionalFormatList* pFormatList ) { - return m_xDlg->isDateConversionSet(); + return VclPtr::Create(pParent, rDoc, pFormatList); } -bool AbstractScTextImportOptionsDlg_Impl::IsScientificConversionSet() const +namespace { - return m_xDlg->isScientificConversionSet(); -} - -bool AbstractScTextImportOptionsDlg_Impl::IsKeepAskingSet() const +class AbstractScDataPilotDatabaseDlg_Impl + : public ScreenshottedDialog_Impl_Async { - return m_xDlg->isKeepAskingSet(); +public: + using ScreenshottedDialog_Impl_BASE::ScreenshottedDialog_Impl_BASE; + void GetValues(ScImportSourceDesc& rDesc) override { m_pDlg->GetValues(rDesc); } +}; } -BitmapEx AbstractScTextImportOptionsDlg_Impl::createScreenshot() const +VclPtr ScAbstractDialogFactory_Impl::CreateScDataPilotDatabaseDlg(weld::Window* pParent) { - VclPtr xDialogSurface(m_xDlg->getDialog()->screenshot()); - return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel()); + return VclPtr::Create(pParent); } -OUString AbstractScTextImportOptionsDlg_Impl::GetScreenshotId() const +namespace { - return m_xDlg->get_help_id(); -} - -short ScAbstractTabController_Impl::Execute() +class AbstractScDataPilotSourceTypeDlg_Impl + : public ScreenshottedDialog_Impl_Async { - return m_xDlg->run(); +public: + using ScreenshottedDialog_Impl_BASE::ScreenshottedDialog_Impl_BASE; + bool IsDatabase() const override { return m_pDlg->IsDatabase(); } + bool IsExternal() const override { return m_pDlg->IsExternal(); } + bool IsNamedRange() const override { return m_pDlg->IsNamedRange(); } + OUString GetSelectedNamedRange() const override { return m_pDlg->GetSelectedNamedRange(); } + void AppendNamedRange(const OUString& rName) override { m_pDlg->AppendNamedRange(rName); } +}; } -bool ScAbstractTabController_Impl::StartExecuteAsync(AsyncContext &rCtx) +VclPtr ScAbstractDialogFactory_Impl::CreateScDataPilotSourceTypeDlg( + weld::Window* pParent, bool bEnableExternal) { - return SfxTabDialogController::runAsync(m_xDlg, rCtx.maEndDialogFn); + return VclPtr::Create(pParent, bEnableExternal); } -void ScAbstractTabController_Impl::SetCurPageId( const OUString &rName ) +namespace { - m_xDlg->SetCurPageId( rName ); -} - -const SfxItemSet* ScAbstractTabController_Impl::GetOutputItemSet() const +class AbstractScDataPilotServiceDlg_Impl + : public vcl::AbstractDialogImpl_Async { - return m_xDlg->GetOutputItemSet(); +public: + using AbstractDialogImpl_BASE::AbstractDialogImpl_BASE; + OUString GetServiceName() const override { return m_pDlg->GetServiceName(); } + OUString GetParSource() const override { return m_pDlg->GetParSource(); } + OUString GetParName() const override { return m_pDlg->GetParName(); } + OUString GetParUser() const override { return m_pDlg->GetParUser(); } + OUString GetParPass() const override { return m_pDlg->GetParPass(); } +}; } -WhichRangesContainer ScAbstractTabController_Impl::GetInputRanges(const SfxItemPool& pItem ) +VclPtr ScAbstractDialogFactory_Impl::CreateScDataPilotServiceDlg(weld::Window* pParent, + const std::vector& rServices) { - return m_xDlg->GetInputRanges( pItem ); + return VclPtr::Create(pParent, rServices); } -void ScAbstractTabController_Impl::SetInputSet( const SfxItemSet* pInSet ) +namespace { - m_xDlg->SetInputSet( pInSet ); -} - -//From class Window. -void ScAbstractTabController_Impl::SetText( const OUString& rStr ) +class AbstractScDeleteCellDlg_Impl + : public ScreenshottedDialog_Impl_Async { - m_xDlg->set_title(rStr); +public: + using ScreenshottedDialog_Impl_BASE::ScreenshottedDialog_Impl_BASE; + DelCellCmd GetDelCellCmd() const override { return m_pDlg->GetDelCellCmd(); } +}; } -std::vector ScAbstractTabController_Impl::getAllPageUIXMLDescriptions() const +VclPtr ScAbstractDialogFactory_Impl::CreateScDeleteCellDlg(weld::Window* pParent, + bool bDisallowCellMove) { - return m_xDlg->getAllPageUIXMLDescriptions(); + return VclPtr::Create(pParent, bDisallowCellMove); } -bool ScAbstractTabController_Impl::selectPageByUIXMLDescription(const OUString& rUIXMLDescription) +VclPtr ScAbstractDialogFactory_Impl::CreateScDataFormDlg(weld::Window* pParent, + ScTabViewShell* pTabViewShell) { - return m_xDlg->selectPageByUIXMLDescription(rUIXMLDescription); + // for dataform + using AbstractScDataFormDlg_Impl + = ScreenshottedDialog_Impl_Sync; + return VclPtr::Create(pParent, pTabViewShell); } -BitmapEx ScAbstractTabController_Impl::createScreenshot() const +namespace { - return m_xDlg->createScreenshot(); -} - -OUString ScAbstractTabController_Impl::GetScreenshotId() const +class AbstractScDeleteContentsDlg_Impl + : public ScreenshottedDialog_Impl_Sync { - return m_xDlg->GetScreenshotId(); +public: + using ScreenshottedDialog_Impl_BASE::ScreenshottedDialog_Impl_BASE; + void DisableObjects() override { m_pDlg->DisableObjects(); } + InsertDeleteFlags GetDelContentsCmdBits() const override + { + return m_pDlg->GetDelContentsCmdBits(); + } +}; } -bool ScAsyncTabController_Impl::StartExecuteAsync(VclAbstractDialog::AsyncContext &rCtx) +VclPtr ScAbstractDialogFactory_Impl::CreateScDeleteContentsDlg(weld::Window* pParent) { - return SfxTabDialogController::runAsync(m_xDlg, rCtx.maEndDialogFn); + return VclPtr::Create(pParent); } -void ScAsyncTabController_Impl::SetCurPageId( const OUString &rName ) +namespace { - m_xDlg->SetCurPageId( rName ); -} - -const SfxItemSet* ScAsyncTabController_Impl::GetOutputItemSet() const +class AbstractScFillSeriesDlg_Impl + : public vcl::AbstractDialogImpl_Sync { - return m_xDlg->GetOutputItemSet(); +public: + using AbstractDialogImpl_BASE::AbstractDialogImpl_BASE; + FillDir GetFillDir() const override { return m_pDlg->GetFillDir(); } + FillCmd GetFillCmd() const override { return m_pDlg->GetFillCmd(); } + FillDateCmd GetFillDateCmd() const override { return m_pDlg->GetFillDateCmd(); } + double GetStart() const override { return m_pDlg->GetStart(); } + double GetStep() const override { return m_pDlg->GetStep(); } + double GetMax() const override { return m_pDlg->GetMax(); } + OUString GetStartStr() const override { return m_pDlg->GetStartStr(); } + void SetEdStartValEnabled(bool bFlag) override { m_pDlg->SetEdStartValEnabled(bFlag); } +}; } -bool AbstractScSelEntryDlg_Impl::StartExecuteAsync(VclAbstractDialog::AsyncContext &rCtx) +VclPtr ScAbstractDialogFactory_Impl::CreateScFillSeriesDlg(weld::Window* pParent, + ScDocument& rDocument, + FillDir eFillDir, + FillCmd eFillCmd, + FillDateCmd eFillDateCmd, + const OUString& aStartStr, + double fStep, + double fMax, + const SCSIZE nSelectHeight, + const SCSIZE nSelectWidth, + sal_uInt16 nPossDir) { - return weld::DialogController::runAsync(m_xDlg, rCtx.maEndDialogFn); + return VclPtr::Create(pParent, rDocument,eFillDir, eFillCmd,eFillDateCmd, aStartStr,fStep,fMax,nSelectHeight,nSelectWidth,nPossDir); } -// =========================Factories for createdialog =================== -VclPtr ScAbstractDialogFactory_Impl::CreateScImportAsciiDlg(weld::Window* pParent, - const OUString& aDatName, - SvStream* pInStream, ScImportAsciiCall eCall) +namespace { - return VclPtr::Create(std::make_shared(pParent, aDatName,pInStream, eCall)); -} - -VclPtr ScAbstractDialogFactory_Impl::CreateScTextImportOptionsDlg(weld::Window* pParent) +class AbstractScGroupDlg_Impl : public vcl::AbstractDialogImpl_Async { - return VclPtr::Create(std::make_unique(pParent)); +public: + using AbstractDialogImpl_BASE::AbstractDialogImpl_BASE; + bool GetColsChecked() const override { return m_pDlg->GetColsChecked(); } +}; } -VclPtr ScAbstractDialogFactory_Impl::CreateScAutoFormatDlg(weld::Window* pParent, - ScAutoFormat* pAutoFormat, - const ScAutoFormatData* pSelFormatData, - ScViewData& rViewData) +VclPtr ScAbstractDialogFactory_Impl::CreateAbstractScGroupDlg(weld::Window* pParent, bool bUnGroup) { - return VclPtr::Create(std::make_unique(pParent, pAutoFormat, pSelFormatData, rViewData)); + return VclPtr::Create(pParent, bUnGroup, true); } -VclPtr ScAbstractDialogFactory_Impl::CreateScColRowLabelDlg(weld::Window* pParent, - bool bCol, bool bRow) +namespace { - return VclPtr::Create(std::make_unique(pParent, bCol, bRow)); -} - -VclPtr ScAbstractDialogFactory_Impl::CreateScSortWarningDlg(weld::Window* pParent, const OUString& rExtendText, const OUString& rCurrentText) +class AbstractScInsertCellDlg_Impl + : public vcl::AbstractDialogImpl_Async { - return VclPtr::Create(std::make_unique(pParent, rExtendText, rCurrentText)); +public: + using AbstractDialogImpl_BASE::AbstractDialogImpl_BASE; + InsCellCmd GetInsCellCmd() const override { return m_pDlg->GetInsCellCmd(); } + size_t GetCount() const override { return m_pDlg->GetCount(); } +}; } -VclPtr ScAbstractDialogFactory_Impl::CreateScCondFormatMgrDlg(weld::Window* pParent, ScDocument& rDoc, const ScConditionalFormatList* pFormatList ) +VclPtr ScAbstractDialogFactory_Impl::CreateScInsertCellDlg(weld::Window* pParent, + bool bDisallowCellMove) { - return VclPtr::Create(std::make_shared(pParent, rDoc, pFormatList)); + return VclPtr::Create(pParent, bDisallowCellMove); } -VclPtr ScAbstractDialogFactory_Impl::CreateScDataPilotDatabaseDlg(weld::Window* pParent) +namespace { - return VclPtr::Create(std::make_shared(pParent)); -} - -VclPtr ScAbstractDialogFactory_Impl::CreateScDataPilotSourceTypeDlg( - weld::Window* pParent, bool bEnableExternal) +class AbstractScInsertContentsDlg_Impl + : public ScreenshottedDialog_Impl_Sync { - return VclPtr::Create(std::make_shared(pParent, bEnableExternal)); +public: + using ScreenshottedDialog_Impl_BASE::ScreenshottedDialog_Impl_BASE; + InsertDeleteFlags GetInsContentsCmdBits() const override + { + return m_pDlg->GetInsContentsCmdBits(); + } + ScPasteFunc GetFormulaCmdBits() const override { return m_pDlg->GetFormulaCmdBits(); } + bool IsSkipEmptyCells() const override { return m_pDlg->IsSkipEmptyCells(); } + bool IsLink() const override { return m_pDlg->IsLink(); } + void SetFillMode(bool bSet) override { m_pDlg->SetFillMode(bSet); } + void SetOtherDoc(bool bSet) override { m_pDlg->SetOtherDoc(bSet); } + bool IsTranspose() const override { return m_pDlg->IsTranspose(); } + void SetChangeTrack(bool bSet) override { m_pDlg->SetChangeTrack(bSet); } + void SetCellShiftDisabled(CellShiftDisabledFlags nDisable) override + { + m_pDlg->SetCellShiftDisabled(nDisable); + } + InsCellCmd GetMoveMode() override { return m_pDlg->GetMoveMode(); } +}; } -VclPtr ScAbstractDialogFactory_Impl::CreateScDataPilotServiceDlg(weld::Window* pParent, - const std::vector& rServices) +VclPtr ScAbstractDialogFactory_Impl::CreateScInsertContentsDlg(weld::Window* pParent, + const OUString* pStrTitle) { - return VclPtr::Create(std::make_shared(pParent, rServices)); + return VclPtr::Create(pParent, pStrTitle); } -VclPtr ScAbstractDialogFactory_Impl::CreateScDeleteCellDlg(weld::Window* pParent, - bool bDisallowCellMove) +namespace { - return VclPtr::Create(std::make_unique(pParent, bDisallowCellMove)); -} - -VclPtr ScAbstractDialogFactory_Impl::CreateScDataFormDlg(weld::Window* pParent, - ScTabViewShell* pTabViewShell) +class AbstractScInsertTableDlg_Impl + : public ScreenshottedDialog_Impl_Async { - return VclPtr::Create(std::make_unique(pParent, pTabViewShell)); +public: + using ScreenshottedDialog_Impl_BASE::ScreenshottedDialog_Impl_BASE; + bool GetTablesFromFile() override { return m_pDlg->GetTablesFromFile(); } + bool GetTablesAsLink() override { return m_pDlg->GetTablesAsLink(); } + const OUString* GetFirstTable(sal_uInt16* pN) override { return m_pDlg->GetFirstTable(pN); } + ScDocShell* GetDocShellTables() override { return m_pDlg->GetDocShellTables(); } + bool IsTableBefore() override { return m_pDlg->IsTableBefore(); } + sal_uInt16 GetTableCount() override { return m_pDlg->GetTableCount(); } + const OUString* GetNextTable(sal_uInt16* pN) override { return m_pDlg->GetNextTable(pN); } +}; } -VclPtr ScAbstractDialogFactory_Impl::CreateScDeleteContentsDlg(weld::Window* pParent) +VclPtr ScAbstractDialogFactory_Impl::CreateScInsertTableDlg(weld::Window* pParent, ScViewData& rViewData, + SCTAB nTabCount, bool bFromFile) { - return VclPtr::Create(std::make_unique(pParent)); + return VclPtr::Create(pParent, rViewData,nTabCount, bFromFile); } -VclPtr ScAbstractDialogFactory_Impl::CreateScFillSeriesDlg(weld::Window* pParent, - ScDocument& rDocument, - FillDir eFillDir, - FillCmd eFillCmd, - FillDateCmd eFillDateCmd, - const OUString& aStartStr, - double fStep, - double fMax, - const SCSIZE nSelectHeight, - const SCSIZE nSelectWidth, - sal_uInt16 nPossDir) +namespace { - return VclPtr::Create(std::make_unique(pParent, rDocument,eFillDir, eFillCmd,eFillDateCmd, aStartStr,fStep,fMax,nSelectHeight,nSelectWidth,nPossDir)); -} - -VclPtr ScAbstractDialogFactory_Impl::CreateAbstractScGroupDlg(weld::Window* pParent, bool bUnGroup) +class AbstractScSelEntryDlg_Impl + : public vcl::AbstractDialogImpl_Async { - return VclPtr::Create(std::make_shared(pParent, bUnGroup, true/*bRows*/)); +public: + using AbstractDialogImpl_BASE::AbstractDialogImpl_BASE; + OUString GetSelectedEntry() const override { return m_pDlg->GetSelectedEntry(); } +}; } -VclPtr ScAbstractDialogFactory_Impl::CreateScInsertCellDlg(weld::Window* pParent, - bool bDisallowCellMove) +VclPtr ScAbstractDialogFactory_Impl::CreateScSelEntryDlg(weld::Window* pParent, + const std::vector &rEntryList) { - return VclPtr::Create(std::make_unique(pParent, bDisallowCellMove)); + return VclPtr::Create(pParent, rEntryList); } -VclPtr ScAbstractDialogFactory_Impl::CreateScInsertContentsDlg(weld::Window* pParent, - const OUString* pStrTitle) +namespace { - return VclPtr::Create(std::make_unique(pParent, pStrTitle)); -} - -VclPtr ScAbstractDialogFactory_Impl::CreateScInsertTableDlg(weld::Window* pParent, ScViewData& rViewData, - SCTAB nTabCount, bool bFromFile) +class AbstractScLinkedAreaDlg_Impl + : public vcl::AbstractDialogImpl_Sync { - return VclPtr::Create(std::make_unique(pParent, rViewData,nTabCount, bFromFile)); +public: + using AbstractDialogImpl_BASE::AbstractDialogImpl_BASE; + void InitFromOldLink(const OUString& rFile, const OUString& rFilter, const OUString& rOptions, + const OUString& rSource, sal_Int32 nRefreshDelaySeconds) override + { + m_pDlg->InitFromOldLink(rFile, rFilter, rOptions, rSource, nRefreshDelaySeconds); + } + OUString GetURL() override { return m_pDlg->GetURL(); } + OUString GetFilter() override { return m_pDlg->GetFilter(); } + OUString GetOptions() override { return m_pDlg->GetOptions(); } + OUString GetSource() override { return m_pDlg->GetSource(); } + sal_Int32 GetRefreshDelaySeconds() override { return m_pDlg->GetRefreshDelaySeconds(); } +}; } -VclPtr ScAbstractDialogFactory_Impl::CreateScSelEntryDlg(weld::Window* pParent, - const std::vector &rEntryList) +VclPtr ScAbstractDialogFactory_Impl::CreateScLinkedAreaDlg(weld::Widget* pParent) { - return VclPtr::Create(std::make_unique(pParent, rEntryList)); + return VclPtr::Create(pParent); } -VclPtr ScAbstractDialogFactory_Impl::CreateScLinkedAreaDlg(weld::Widget* pParent) +namespace +{ +class AbstractScMetricInputDlg_Impl + : public vcl::AbstractDialogImpl_Async { - return VclPtr::Create(std::make_unique(pParent)); +public: + using AbstractDialogImpl_BASE::AbstractDialogImpl_BASE; + int GetInputValue() const override { return m_pDlg->GetInputValue(); } +}; } VclPtr ScAbstractDialogFactory_Impl::CreateScMetricInputDlg(weld::Window* pParent, @@ -1194,30 +498,96 @@ VclPtr ScAbstractDialogFactory_Impl::CreateScMetricInp tools::Long nMaximum , tools::Long nMinimum ) { - return VclPtr::Create(std::make_shared(pParent, sDialogName, nCurrent ,nDefault, eFUnit, - nDecimals, nMaximum , nMinimum)); + return VclPtr::Create(pParent, sDialogName, nCurrent, nDefault, + eFUnit, nDecimals, nMaximum, nMinimum); +} + +namespace +{ +class AbstractScMoveTableDlg_Impl + : public ScreenshottedDialog_Impl_Async +{ +public: + using ScreenshottedDialog_Impl_BASE::ScreenshottedDialog_Impl_BASE; + sal_uInt16 GetSelectedDocument() const override { return m_pDlg->GetSelectedDocument(); } + sal_uInt16 GetSelectedTable() const override { return m_pDlg->GetSelectedTable(); } + bool GetCopyTable() const override { return m_pDlg->GetCopyTable(); } + bool GetRenameTable() const override { return m_pDlg->GetRenameTable(); } + void GetTabNameString(OUString& rString) const override { m_pDlg->GetTabNameString(rString); } + void SetForceCopyTable() override { return m_pDlg->SetForceCopyTable(); } + void EnableRenameTable(bool bFlag) override { return m_pDlg->EnableRenameTable(bFlag); } +}; } VclPtr ScAbstractDialogFactory_Impl::CreateScMoveTableDlg(weld::Window* pParent, const OUString& rDefault) { - return VclPtr::Create(std::make_shared(pParent, rDefault)); + return VclPtr::Create(pParent, rDefault); +} + +namespace +{ +class AbstractScNameCreateDlg_Impl + : public ScreenshottedDialog_Impl_Sync +{ +public: + using ScreenshottedDialog_Impl_BASE::ScreenshottedDialog_Impl_BASE; + CreateNameFlags GetFlags() const override { return m_pDlg->GetFlags(); } +}; } VclPtr ScAbstractDialogFactory_Impl::CreateScNameCreateDlg(weld::Window * pParent, CreateNameFlags nFlags) { - return VclPtr::Create(std::make_unique(pParent, nFlags)); + return VclPtr::Create(pParent, nFlags); +} + +namespace +{ +class AbstractScNamePasteDlg_Impl + : public vcl::AbstractDialogImpl_Sync +{ +public: + using AbstractDialogImpl_BASE::AbstractDialogImpl_BASE; + std::vector GetSelectedNames() const override { return m_pDlg->GetSelectedNames(); } +}; } VclPtr ScAbstractDialogFactory_Impl::CreateScNamePasteDlg(weld::Window * pParent, ScDocShell* pShell) { - return VclPtr::Create(std::make_unique(pParent, pShell)); + return VclPtr::Create(pParent, pShell); +} + +namespace +{ +class AbstractScPivotFilterDlg_Impl + : public vcl::AbstractDialogImpl_Sync +{ +public: + using AbstractDialogImpl_BASE::AbstractDialogImpl_BASE; + const ScQueryItem& GetOutputItem() override { return m_pDlg->GetOutputItem(); } +}; } VclPtr ScAbstractDialogFactory_Impl::CreateScPivotFilterDlg(weld::Window* pParent, const SfxItemSet& rArgSet, sal_uInt16 nSourceTab) { - return VclPtr::Create(std::make_unique(pParent, rArgSet, nSourceTab)); + return VclPtr::Create(pParent, rArgSet, nSourceTab); +} + +namespace +{ +class AbstractScDPFunctionDlg_Impl + : public vcl::AbstractDialogImpl_Async +{ +public: + using AbstractDialogImpl_BASE::AbstractDialogImpl_BASE; + PivotFunc GetFuncMask() const override { return m_pDlg->GetFuncMask(); } + css::sheet::DataPilotFieldReference GetFieldRef() const override + { + return m_pDlg->GetFieldRef(); + } + void Response(int nResponse) override { m_pDlg->response(nResponse); } +}; } VclPtr ScAbstractDialogFactory_Impl::CreateScDPFunctionDlg(weld::Widget* pParent, @@ -1225,7 +595,23 @@ VclPtr ScAbstractDialogFactory_Impl::CreateScDPFunction const ScDPLabelData& rLabelData, const ScPivotFuncData& rFuncData) { - return VclPtr::Create(std::make_shared(pParent, rLabelVec, rLabelData, rFuncData)); + return VclPtr::Create(pParent, rLabelVec, rLabelData, rFuncData); +} + +namespace +{ +class AbstractScDPSubtotalDlg_Impl + : public vcl::AbstractDialogImpl_Async +{ +public: + using AbstractDialogImpl_BASE::AbstractDialogImpl_BASE; + PivotFunc GetFuncMask() const override { return m_pDlg->GetFuncMask(); } + void FillLabelData(ScDPLabelData& rLabelData) const override + { + m_pDlg->FillLabelData(rLabelData); + } + void Response(int nResponse) override { m_pDlg->response(nResponse); } +}; } VclPtr ScAbstractDialogFactory_Impl::CreateScDPSubtotalDlg(weld::Widget* pParent, @@ -1234,48 +620,168 @@ VclPtr ScAbstractDialogFactory_Impl::CreateScDPSubtotal const ScPivotFuncData& rFuncData, const ScDPNameVec& rDataFields) { - return VclPtr::Create(std::make_shared(pParent, rDPObj, rLabelData, rFuncData, rDataFields, true/*bEnableLayout*/)); + return VclPtr::Create(pParent, rDPObj, rLabelData, rFuncData, rDataFields, true/*bEnableLayout*/); +} + +namespace +{ +class AbstractScDPNumGroupDlg_Impl + : public vcl::AbstractDialogImpl_Sync +{ +public: + using AbstractDialogImpl_BASE::AbstractDialogImpl_BASE; + ScDPNumGroupInfo GetGroupInfo() const override { return m_pDlg->GetGroupInfo(); } +}; } VclPtr ScAbstractDialogFactory_Impl::CreateScDPNumGroupDlg(weld::Window* pParent, const ScDPNumGroupInfo& rInfo) { - return VclPtr::Create(std::make_unique(pParent, rInfo)); + return VclPtr::Create(pParent, rInfo); +} + +namespace +{ +class AbstractScDPDateGroupDlg_Impl + : public vcl::AbstractDialogImpl_Sync +{ +public: + using AbstractDialogImpl_BASE::AbstractDialogImpl_BASE; + ScDPNumGroupInfo GetGroupInfo() const override { return m_pDlg->GetGroupInfo(); } + sal_Int32 GetDatePart() const override { return m_pDlg->GetDatePart(); } +}; } VclPtr ScAbstractDialogFactory_Impl::CreateScDPDateGroupDlg( weld::Window* pParent, const ScDPNumGroupInfo& rInfo, sal_Int32 nDatePart, const Date& rNullDate) { - return VclPtr::Create(std::make_unique(pParent, rInfo, nDatePart, rNullDate)); + return VclPtr::Create(pParent, rInfo, nDatePart, rNullDate); +} + +namespace +{ +class AbstractScDPShowDetailDlg_Impl + : public vcl::AbstractDialogImpl_Sync +{ +public: + using AbstractDialogImpl_BASE::AbstractDialogImpl_BASE; + OUString GetDimensionName() const override { return m_pDlg->GetDimensionName(); } +}; } VclPtr ScAbstractDialogFactory_Impl::CreateScDPShowDetailDlg ( weld::Window* pParent, ScDPObject& rDPObj, css::sheet::DataPilotFieldOrientation nOrient ) { - return VclPtr::Create(std::make_unique(pParent, rDPObj, nOrient)); + return VclPtr::Create(pParent, rDPObj, nOrient); +} + +namespace +{ +class AbstractScNewScenarioDlg_Impl + : public vcl::AbstractDialogImpl_Sync +{ +public: + using AbstractDialogImpl_BASE::AbstractDialogImpl_BASE; + + void SetScenarioData(const OUString& rName, const OUString& rComment, const Color& rColor, + ScScenarioFlags nFlags) override + { + m_pDlg->SetScenarioData(rName, rComment, rColor, nFlags); + } + + void GetScenarioData(OUString& rName, OUString& rComment, Color& rColor, + ScScenarioFlags& rFlags) const override + { + m_pDlg->GetScenarioData(rName, rComment, rColor, rFlags); + } +}; } VclPtr ScAbstractDialogFactory_Impl::CreateScNewScenarioDlg(weld::Window* pParent, const OUString& rName, bool bEdit, bool bSheetProtected) { - return VclPtr::Create(std::make_unique(pParent, rName, bEdit, bSheetProtected)); + return VclPtr::Create(pParent, rName, bEdit, bSheetProtected); +} + +namespace +{ +class AbstractScShowTabDlg_Impl + : public vcl::AbstractDialogImpl_Async +{ +public: + using AbstractDialogImpl_BASE::AbstractDialogImpl_BASE; + void Insert(const OUString& rString, bool bSelected) override + { + m_pDlg->Insert(rString, bSelected); + } + void SetDescription(const OUString& rTitle, const OUString& rFixedText, + const OUString& sDlgHelpId, const OUString& sLbHelpId) override + { + m_pDlg->SetDescription(rTitle, rFixedText, sDlgHelpId, sLbHelpId); + } + OUString GetEntry(sal_Int32 nPos) const override { return m_pDlg->GetEntry(nPos); } + std::vector GetSelectedRows() const override { return m_pDlg->GetSelectedRows(); } +}; } VclPtr ScAbstractDialogFactory_Impl::CreateScShowTabDlg(weld::Window* pParent) { - return VclPtr::Create(std::make_shared(pParent)); + return VclPtr::Create(pParent); +} + +namespace +{ +class AbstractScGoToTabDlg_Impl + : public vcl::AbstractDialogImpl_Async +{ +public: + using AbstractDialogImpl_BASE::AbstractDialogImpl_BASE; + void Insert(const OUString& rString, bool bSelected) override + { + m_pDlg->Insert(rString, bSelected); + } + void SetDescription(const OUString& rTitle, const OUString& rEntryLabel, + const OUString& rListLabel, const OUString& rDlgHelpId, + const OUString& rEnHelpId, const OUString& rLbHelpId) override + { + m_pDlg->SetDescription(rTitle, rEntryLabel, rListLabel, rDlgHelpId, rEnHelpId, rLbHelpId); + } + OUString GetSelectedEntry() const override { return m_pDlg->GetSelectedEntry(); } +}; } VclPtr ScAbstractDialogFactory_Impl::CreateScGoToTabDlg(weld::Window* pParent) { - return VclPtr::Create(std::make_shared(pParent)); + return VclPtr::Create(pParent); +} + +namespace +{ +class AbstractScStringInputDlg_Impl + : public ScreenshottedDialog_Impl_Async +{ +public: + using ScreenshottedDialog_Impl_BASE::ScreenshottedDialog_Impl_BASE; + OUString GetInputString() const override { return m_pDlg->GetInputString(); } +}; } VclPtr ScAbstractDialogFactory_Impl::CreateScStringInputDlg(weld::Window* pParent, const OUString& rTitle, const OUString& rEditTitle, const OUString& rDefault, const OUString& rHelpId, const OUString& rEditHelpId) { - return VclPtr::Create(std::make_unique(pParent, rTitle, rEditTitle, - rDefault, rHelpId, rEditHelpId)); + return VclPtr::Create(pParent, rTitle, rEditTitle, rDefault, + rHelpId, rEditHelpId); +} + +namespace +{ +class AbstractScTabBgColorDlg_Impl + : public ScreenshottedDialog_Impl_Async +{ +public: + using ScreenshottedDialog_Impl_BASE::ScreenshottedDialog_Impl_BASE; + void GetSelectedColor(Color& rColor) const override { m_pDlg->GetSelectedColor(rColor); } +}; } VclPtr ScAbstractDialogFactory_Impl::CreateScTabBgColorDlg( @@ -1284,7 +790,22 @@ VclPtr ScAbstractDialogFactory_Impl::CreateScTabBgColor const OUString& rTabBgColorNoColorText, const Color& rDefaultColor) { - return VclPtr::Create(std::make_unique(pParent, rTitle, rTabBgColorNoColorText, rDefaultColor)); + return VclPtr::Create(pParent, rTitle, rTabBgColorNoColorText, rDefaultColor); +} + +namespace +{ +class AbstractScImportOptionsDlg_Impl + : public vcl::AbstractDialogImpl_Sync +{ +public: + using AbstractDialogImpl_BASE::AbstractDialogImpl_BASE; + void GetImportOptions(ScImportOptions& rOptions) const override + { + m_pDlg->GetImportOptions(rOptions); + } + void SaveImportOptions() const override { m_pDlg->SaveImportOptions(); } +}; } VclPtr ScAbstractDialogFactory_Impl::CreateScImportOptionsDlg(weld::Window* pParent, @@ -1294,12 +815,44 @@ VclPtr ScAbstractDialogFactory_Impl::CreateScImportO bool bOnlyDbtoolsEncodings, bool bImport) { - return VclPtr::Create(std::make_unique(pParent, bAscii, pOptions, pStrTitle, true/*bMultiByte*/, bOnlyDbtoolsEncodings, bImport)); + return VclPtr::Create(pParent, bAscii, pOptions, pStrTitle, true/*bMultiByte*/, bOnlyDbtoolsEncodings, bImport); +} + +namespace +{ +template +class ScAbstractTabController_Impl + : public vcl::AbstractDialogImpl_Async +{ +public: + using vcl::AbstractDialogImpl_Async::AbstractDialogImpl_Async; + void SetCurPageId(const OUString& rName) override { this->m_pDlg->SetCurPageId(rName); } + const SfxItemSet* GetOutputItemSet() const override { return this->m_pDlg->GetOutputItemSet(); } + WhichRangesContainer GetInputRanges(const SfxItemPool& pItem) override + { + return this->m_pDlg->GetInputRanges(pItem); + } + void SetInputSet(const SfxItemSet* pInSet) override { this->m_pDlg->SetInputSet(pInSet); } + // From class Window. + void SetText(const OUString& rStr) override { this->m_pDlg->set_title(rStr); } + + // screenshotting + std::vector getAllPageUIXMLDescriptions() const override + { + return this->m_pDlg->getAllPageUIXMLDescriptions(); + } + bool selectPageByUIXMLDescription(const OUString& rUIXMLDescription) override + { + return this->m_pDlg->selectPageByUIXMLDescription(rUIXMLDescription); + } + BitmapEx createScreenshot() const override { return this->m_pDlg->createScreenshot(); } + OUString GetScreenshotId() const override { return this->m_pDlg->GetScreenshotId(); } +}; } VclPtr ScAbstractDialogFactory_Impl::CreateScAttrDlg(weld::Window* pParent, const SfxItemSet* pCellAttrs) { - return VclPtr::Create(std::make_shared(pParent, pCellAttrs)); + return VclPtr>::Create(pParent, pCellAttrs); } VclPtr ScAbstractDialogFactory_Impl::CreateScHFEditDlg( weld::Window* pParent, @@ -1307,89 +860,91 @@ VclPtr ScAbstractDialogFactory_Impl::CreateScHFEditDlg( we const OUString& rPageStyle, sal_uInt16 nResId ) { - std::shared_ptr xDlg; - switch (nResId) { case RID_SCDLG_HFED_HEADER: case RID_SCDLG_HFEDIT_HEADER: - xDlg = std::make_shared(pParent, rCoreSet, rPageStyle); - break; + return VclPtr>::Create(pParent, rCoreSet, rPageStyle); case RID_SCDLG_HFED_FOOTER: case RID_SCDLG_HFEDIT_FOOTER: - xDlg = std::make_shared(pParent, rCoreSet, rPageStyle); - break; + return VclPtr>::Create(pParent, rCoreSet, rPageStyle); case RID_SCDLG_HFEDIT_SHAREDFIRSTHEADER: - xDlg = std::make_shared(pParent, rCoreSet, rPageStyle); - break; + return VclPtr>::Create(pParent, rCoreSet, rPageStyle); case RID_SCDLG_HFEDIT_SHAREDLEFTHEADER: - xDlg = std::make_shared(pParent, rCoreSet, rPageStyle); - break; + return VclPtr>::Create(pParent, rCoreSet, rPageStyle); case RID_SCDLG_HFEDIT_SHAREDFIRSTFOOTER: - xDlg = std::make_shared(pParent, rCoreSet, rPageStyle); - break; + return VclPtr>::Create(pParent, rCoreSet, rPageStyle); case RID_SCDLG_HFEDIT_SHAREDLEFTFOOTER: - xDlg = std::make_shared(pParent, rCoreSet, rPageStyle); - break; + return VclPtr>::Create(pParent, rCoreSet, rPageStyle); case RID_SCDLG_HFEDIT_LEFTHEADER: - xDlg = std::make_shared(pParent, rCoreSet, rPageStyle); - break; + return VclPtr>::Create(pParent, rCoreSet, rPageStyle); case RID_SCDLG_HFEDIT_RIGHTHEADER: - xDlg = std::make_shared(pParent, rCoreSet, rPageStyle); - break; + return VclPtr>::Create(pParent, rCoreSet, rPageStyle); case RID_SCDLG_HFEDIT_LEFTFOOTER: - xDlg = std::make_shared(pParent, rCoreSet, rPageStyle); - break; + return VclPtr>::Create(pParent, rCoreSet, rPageStyle); case RID_SCDLG_HFEDIT_RIGHTFOOTER: - xDlg = std::make_shared(pParent, rCoreSet, rPageStyle); - break; + return VclPtr>::Create(pParent, rCoreSet, rPageStyle); case RID_SCDLG_HFEDIT_SHDR: - xDlg = std::make_shared(pParent, rCoreSet, rPageStyle); - break; + return VclPtr>::Create(pParent, rCoreSet, rPageStyle); case RID_SCDLG_HFEDIT_SFTR: - xDlg = std::make_shared(pParent, rCoreSet, rPageStyle); - break; + return VclPtr>::Create(pParent, rCoreSet, rPageStyle); case RID_SCDLG_HFEDIT_ALL: - xDlg = std::make_shared(pParent, rCoreSet, rPageStyle); - break; + return VclPtr>::Create(pParent, rCoreSet, rPageStyle); default: case RID_SCDLG_HFEDIT: - xDlg = std::make_shared(pParent, rCoreSet, rPageStyle); - break; + return VclPtr>::Create(pParent, rCoreSet, rPageStyle); } - - return VclPtr::Create(std::move(xDlg)); } VclPtr ScAbstractDialogFactory_Impl::CreateScStyleDlg(weld::Window* pParent, SfxStyleSheetBase& rStyleBase, bool bPage) { - return VclPtr::Create(std::make_shared(pParent, rStyleBase, bPage)); + return VclPtr>::Create(pParent, rStyleBase, bPage); } VclPtr ScAbstractDialogFactory_Impl::CreateScDrawStyleDlg(weld::Window* pParent, SfxStyleSheetBase& rStyleBase, SdrView* pView) { - return VclPtr::Create(std::make_shared(pParent, rStyleBase, pView)); + return VclPtr>::Create(pParent, rStyleBase, pView); } VclPtr ScAbstractDialogFactory_Impl::CreateScSubTotalDlg(weld::Window* pParent, const SfxItemSet& rArgSet) { - return VclPtr::Create(std::make_shared(pParent, rArgSet)); + return VclPtr>::Create(pParent, rArgSet); } VclPtr ScAbstractDialogFactory_Impl::CreateScCharDlg( weld::Window* pParent, const SfxItemSet* pAttr, const SfxObjectShell* pDocShell, bool bDrawText) { - return VclPtr::Create(std::make_shared(pParent, pAttr, pDocShell, bDrawText)); + return VclPtr>::Create(pParent, pAttr, pDocShell, bDrawText); } VclPtr ScAbstractDialogFactory_Impl::CreateScParagraphDlg( weld::Window* pParent, const SfxItemSet* pAttr) { - return VclPtr::Create(std::make_shared(pParent, pAttr)); + return VclPtr>::Create(pParent, pAttr); +} + +namespace +{ +class ScAsyncTabController_Impl : public ScAsyncTabController +{ + std::shared_ptr m_pDlg; + +public: + explicit ScAsyncTabController_Impl(std::shared_ptr p) + : m_pDlg(std::move(p)) + { + } + bool StartExecuteAsync(VclAbstractDialog::AsyncContext& rCtx) override + { + return SfxTabDialogController::runAsync(m_pDlg, rCtx.maEndDialogFn); + } + const SfxItemSet* GetOutputItemSet() const override { return m_pDlg->GetOutputItemSet(); } + void SetCurPageId(const OUString& rName) override { m_pDlg->SetCurPageId(rName); } +}; } std::shared_ptr ScAbstractDialogFactory_Impl::CreateScSortDlg(weld::Window* pParent, const SfxItemSet* pArgSet) diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx index fe60d59bc8e6..adb4293df269 100644 --- a/sc/source/ui/attrdlg/scdlgfact.hxx +++ b/sc/source/ui/attrdlg/scdlgfact.hxx @@ -19,641 +19,6 @@ #pragma once #include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -class AbstractScImportAsciiDlg_Impl : public AbstractScImportAsciiDlg -{ - std::shared_ptr m_xDlg; -public: - explicit AbstractScImportAsciiDlg_Impl(std::shared_ptr p) - : m_xDlg(std::move(p)) - { - } - virtual short Execute() override; - virtual bool StartExecuteAsync(VclAbstractDialog::AsyncContext &rCtx) override; - virtual void GetOptions( ScAsciiOptions& rOpt ) override; - virtual void SaveParameters() override; - - // screenshotting - virtual BitmapEx createScreenshot() const override; - virtual OUString GetScreenshotId() const override; -}; - -class AbstractScAutoFormatDlg_Impl : public AbstractScAutoFormatDlg -{ - std::unique_ptr m_xDlg; -public: - explicit AbstractScAutoFormatDlg_Impl(std::unique_ptr p) - : m_xDlg(std::move(p)) - { - } - virtual short Execute() override; - virtual sal_uInt16 GetIndex() const override; - virtual OUString GetCurrFormatName() override; -}; - -class AbstractScColRowLabelDlg_Impl : public AbstractScColRowLabelDlg -{ - std::shared_ptr m_xDlg; -public: - explicit AbstractScColRowLabelDlg_Impl(std::shared_ptr p) - : m_xDlg(std::move(p)) - { - } - virtual short Execute() override; - virtual bool StartExecuteAsync(VclAbstractDialog::AsyncContext &rCtx) override; - virtual bool IsCol() override; - virtual bool IsRow() override; - - // screenshotting - virtual BitmapEx createScreenshot() const override; - virtual OUString GetScreenshotId() const override; -}; - -class AbstractScCondFormatManagerDlg_Impl : public AbstractScCondFormatManagerDlg -{ - std::shared_ptr m_xDlg; -public: - explicit AbstractScCondFormatManagerDlg_Impl(std::shared_ptr p) - : m_xDlg(std::move(p)) - { - } - virtual short Execute() override; - virtual bool StartExecuteAsync(VclAbstractDialog::AsyncContext &rCtx) override; - virtual std::unique_ptr GetConditionalFormatList() override; - virtual bool CondFormatsChanged() const override; - virtual void SetModified() override; - virtual ScConditionalFormat* GetCondFormatSelected() override; -}; - -class AbstractScDataPilotDatabaseDlg_Impl :public AbstractScDataPilotDatabaseDlg -{ - std::shared_ptr m_xDlg; -public: - explicit AbstractScDataPilotDatabaseDlg_Impl(std::shared_ptr p) - : m_xDlg(std::move(p)) - { - } - virtual short Execute() override; - virtual bool StartExecuteAsync(AsyncContext &) override; - virtual void GetValues( ScImportSourceDesc& rDesc ) override; - - // screenshotting - virtual BitmapEx createScreenshot() const override; - virtual OUString GetScreenshotId() const override; -}; - -class AbstractScDataPilotSourceTypeDlg_Impl :public AbstractScDataPilotSourceTypeDlg -{ - std::shared_ptr m_xDlg; -public: - explicit AbstractScDataPilotSourceTypeDlg_Impl(std::shared_ptr p) - : m_xDlg(std::move(p)) - { - } - virtual short Execute() override; - virtual bool StartExecuteAsync(AsyncContext &) override; - virtual bool IsDatabase() const override; - virtual bool IsExternal() const override; - virtual bool IsNamedRange() const override; - virtual OUString GetSelectedNamedRange() const override; - virtual void AppendNamedRange(const OUString& rName) override; - - // screenshotting - virtual BitmapEx createScreenshot() const override; - virtual OUString GetScreenshotId() const override; -}; - -class AbstractScDataPilotServiceDlg_Impl : public AbstractScDataPilotServiceDlg -{ - std::shared_ptr m_xDlg; -public: - explicit AbstractScDataPilotServiceDlg_Impl(std::shared_ptr p) - : m_xDlg(std::move(p)) - { - } - virtual short Execute() override; - virtual bool StartExecuteAsync(AsyncContext &) override; - virtual OUString GetServiceName() const override; - virtual OUString GetParSource() const override; - virtual OUString GetParName() const override; - virtual OUString GetParUser() const override; - virtual OUString GetParPass() const override; -}; - -class AbstractScDeleteCellDlg_Impl : public AbstractScDeleteCellDlg -{ - std::shared_ptr m_xDlg; -public: - explicit AbstractScDeleteCellDlg_Impl(std::unique_ptr p) - : m_xDlg(std::move(p)) - { - } - virtual short Execute() override; - virtual bool StartExecuteAsync(AsyncContext& rCtx) override; - virtual DelCellCmd GetDelCellCmd() const override; - - // screenshotting - virtual BitmapEx createScreenshot() const override; - virtual OUString GetScreenshotId() const override; -}; - -//for dataform -class AbstractScDataFormDlg_Impl : public AbstractScDataFormDlg -{ - std::unique_ptr m_xDlg; -public: - explicit AbstractScDataFormDlg_Impl(std::unique_ptr p) - : m_xDlg(std::move(p)) - { - } - virtual short Execute() override; - - // screenshotting - virtual BitmapEx createScreenshot() const override; - virtual OUString GetScreenshotId() const override; -}; - -class AbstractScDeleteContentsDlg_Impl : public AbstractScDeleteContentsDlg -{ - std::unique_ptr m_xDlg; -public: - explicit AbstractScDeleteContentsDlg_Impl(std::unique_ptr p) - : m_xDlg(std::move(p)) - { - } - virtual short Execute() override; - virtual void DisableObjects() override; - virtual InsertDeleteFlags GetDelContentsCmdBits() const override; - - // screenshotting - virtual BitmapEx createScreenshot() const override; - virtual OUString GetScreenshotId() const override; -}; - -class AbstractScFillSeriesDlg_Impl:public AbstractScFillSeriesDlg -{ - std::unique_ptr m_xDlg; -public: - explicit AbstractScFillSeriesDlg_Impl(std::unique_ptr p) - : m_xDlg(std::move(p)) - { - } - virtual short Execute() override; - virtual FillDir GetFillDir() const override; - virtual FillCmd GetFillCmd() const override; - virtual FillDateCmd GetFillDateCmd() const override; - virtual double GetStart() const override; - virtual double GetStep() const override; - virtual double GetMax() const override; - virtual OUString GetStartStr() const override; - virtual void SetEdStartValEnabled(bool bFlag) override; -}; - -class AbstractScGroupDlg_Impl : public AbstractScGroupDlg -{ - std::shared_ptr m_xDlg; -public: - explicit AbstractScGroupDlg_Impl(std::shared_ptr p) - : m_xDlg(std::move(p)) - { - } - virtual short Execute() override; - virtual bool StartExecuteAsync(VclAbstractDialog::AsyncContext &rCtx) override; - virtual bool GetColsChecked() const override; -}; - -class AbstractScInsertCellDlg_Impl : public AbstractScInsertCellDlg -{ - std::shared_ptr m_xDlg; -public: - explicit AbstractScInsertCellDlg_Impl(std::unique_ptr p) - : m_xDlg(std::move(p)) - { - } - virtual short Execute() override; - virtual bool StartExecuteAsync(VclAbstractDialog::AsyncContext &rCtx) override; - virtual InsCellCmd GetInsCellCmd() const override ; - virtual size_t GetCount() const override ; -}; - -class AbstractScInsertContentsDlg_Impl : public AbstractScInsertContentsDlg -{ - std::unique_ptr m_xDlg; -public: - explicit AbstractScInsertContentsDlg_Impl(std::unique_ptr p) - : m_xDlg(std::move(p)) - { - } - virtual short Execute() override; - virtual InsertDeleteFlags GetInsContentsCmdBits() const override; - virtual ScPasteFunc GetFormulaCmdBits() const override; - virtual bool IsSkipEmptyCells() const override; - virtual bool IsLink() const override; - virtual void SetFillMode( bool bSet ) override; - virtual void SetOtherDoc( bool bSet ) override; - virtual bool IsTranspose() const override; - virtual void SetChangeTrack( bool bSet ) override; - virtual void SetCellShiftDisabled( CellShiftDisabledFlags nDisable ) override; - virtual InsCellCmd GetMoveMode() override; - - // screenshotting - virtual BitmapEx createScreenshot() const override; - virtual OUString GetScreenshotId() const override; -}; - -class AbstractScInsertTableDlg_Impl : public AbstractScInsertTableDlg -{ - std::shared_ptr m_xDlg; -public: - explicit AbstractScInsertTableDlg_Impl(std::shared_ptr p) - : m_xDlg(std::move(p)) - { - } - virtual short Execute() override; - virtual bool StartExecuteAsync(VclAbstractDialog::AsyncContext &rCtx) override; - virtual bool GetTablesFromFile() override; - virtual bool GetTablesAsLink() override; - virtual const OUString* GetFirstTable( sal_uInt16* pN = nullptr ) override; - virtual ScDocShell* GetDocShellTables() override; - virtual bool IsTableBefore() override; - virtual sal_uInt16 GetTableCount() override; - virtual const OUString* GetNextTable( sal_uInt16* pN ) override; - - // screenshotting - virtual BitmapEx createScreenshot() const override; - virtual OUString GetScreenshotId() const override; -}; - -class AbstractScSelEntryDlg_Impl : public AbstractScSelEntryDlg -{ - std::shared_ptr m_xDlg; -public: - explicit AbstractScSelEntryDlg_Impl(std::unique_ptr p) - : m_xDlg(std::move(p)) - { - } - virtual short Execute() override; - virtual bool StartExecuteAsync(AsyncContext& rCtx) override; - virtual OUString GetSelectedEntry() const override; -}; - -class AbstractScLinkedAreaDlg_Impl : public AbstractScLinkedAreaDlg -{ - std::unique_ptr m_xDlg; -public: - explicit AbstractScLinkedAreaDlg_Impl(std::unique_ptr p) - : m_xDlg(std::move(p)) - { - } - virtual ~AbstractScLinkedAreaDlg_Impl() override; - virtual short Execute() override; - virtual void InitFromOldLink( const OUString& rFile, const OUString& rFilter, - const OUString& rOptions, const OUString& rSource, - sal_Int32 nRefreshDelaySeconds ) override; - virtual OUString GetURL() override; - virtual OUString GetFilter() override; // may be empty - virtual OUString GetOptions() override; // filter options - virtual OUString GetSource() override; // separated by ";" - virtual sal_Int32 GetRefreshDelaySeconds() override; // 0 if disabled -}; - -class AbstractScMetricInputDlg_Impl : public AbstractScMetricInputDlg -{ - std::shared_ptr m_xDlg; -public: - explicit AbstractScMetricInputDlg_Impl(std::shared_ptr p) - : m_xDlg(std::move(p)) - { - } - virtual short Execute() override; - virtual bool StartExecuteAsync(AsyncContext& rCtx) override; - virtual int GetInputValue() const override; -}; - -class AbstractScMoveTableDlg_Impl : public AbstractScMoveTableDlg -{ - std::shared_ptr m_xDlg; -public: - explicit AbstractScMoveTableDlg_Impl(std::shared_ptr p) - : m_xDlg(std::move(p)) - { - } - virtual short Execute() override; - virtual bool StartExecuteAsync(VclAbstractDialog::AsyncContext& rCtx) override; - virtual sal_uInt16 GetSelectedDocument () const override; - virtual sal_uInt16 GetSelectedTable () const override; - virtual bool GetCopyTable () const override; - virtual bool GetRenameTable () const override; - virtual void GetTabNameString( OUString& rString ) const override; - virtual void SetForceCopyTable () override; - virtual void EnableRenameTable (bool bFlag) override; - - // screenshotting - virtual BitmapEx createScreenshot() const override; - virtual OUString GetScreenshotId() const override; -}; - -class AbstractScNameCreateDlg_Impl : public AbstractScNameCreateDlg -{ - std::unique_ptr m_xDlg; -public: - explicit AbstractScNameCreateDlg_Impl(std::unique_ptr p) - : m_xDlg(std::move(p)) - { - } - virtual short Execute() override; - virtual CreateNameFlags GetFlags() const override; - - // screenshotting - virtual BitmapEx createScreenshot() const override; - virtual OUString GetScreenshotId() const override; -}; - -class AbstractScNamePasteDlg_Impl : public AbstractScNamePasteDlg -{ - std::unique_ptr m_xDlg; -public: - explicit AbstractScNamePasteDlg_Impl(std::unique_ptr p) - : m_xDlg(std::move(p)) - { - } - virtual short Execute() override; - virtual std::vector GetSelectedNames() const override; -}; - -class AbstractScPivotFilterDlg_Impl : public AbstractScPivotFilterDlg -{ - std::unique_ptr m_xDlg; -public: - explicit AbstractScPivotFilterDlg_Impl(std::unique_ptr p) - : m_xDlg(std::move(p)) - { - } - virtual short Execute() override; - virtual const ScQueryItem& GetOutputItem() override; -}; - -class AbstractScDPFunctionDlg_Impl : public AbstractScDPFunctionDlg -{ - std::shared_ptr m_xDlg; -public: - explicit AbstractScDPFunctionDlg_Impl(std::shared_ptr p) - : m_xDlg(std::move(p)) - { - } - virtual short Execute() override; - virtual bool StartExecuteAsync(VclAbstractDialog::AsyncContext &rCtx) override; - virtual PivotFunc GetFuncMask() const override; - virtual css::sheet::DataPilotFieldReference GetFieldRef() const override; - virtual void Response(int nResponse) override; -}; - -class AbstractScDPSubtotalDlg_Impl : public AbstractScDPSubtotalDlg -{ - std::shared_ptr m_xDlg; -public: - explicit AbstractScDPSubtotalDlg_Impl(std::shared_ptr p) - : m_xDlg(std::move(p)) - { - } - virtual short Execute() override; - virtual bool StartExecuteAsync(VclAbstractDialog::AsyncContext &rCtx) override; - virtual PivotFunc GetFuncMask() const override; - virtual void FillLabelData( ScDPLabelData& rLabelData ) const override; - virtual void Response(int nResponse) override; -}; - -class AbstractScDPNumGroupDlg_Impl : public AbstractScDPNumGroupDlg -{ - std::unique_ptr m_xDlg; -public: - explicit AbstractScDPNumGroupDlg_Impl(std::unique_ptr p) - : m_xDlg(std::move(p)) - { - } - virtual short Execute() override; - virtual ScDPNumGroupInfo GetGroupInfo() const override; -}; - -class AbstractScDPDateGroupDlg_Impl : public AbstractScDPDateGroupDlg -{ - std::unique_ptr m_xDlg; -public: - explicit AbstractScDPDateGroupDlg_Impl(std::unique_ptr p) - : m_xDlg(std::move(p)) - { - } - virtual short Execute() override; - virtual ScDPNumGroupInfo GetGroupInfo() const override; - virtual sal_Int32 GetDatePart() const override; -}; - -class AbstractScDPShowDetailDlg_Impl : public AbstractScDPShowDetailDlg -{ - std::unique_ptr m_xDlg; -public: - explicit AbstractScDPShowDetailDlg_Impl(std::unique_ptr p) - : m_xDlg(std::move(p)) - { - } - virtual short Execute() override; - virtual OUString GetDimensionName() const override; -}; - -class AbstractScNewScenarioDlg_Impl : public AbstractScNewScenarioDlg -{ - std::unique_ptr m_xDlg; -public: - explicit AbstractScNewScenarioDlg_Impl(std::unique_ptr p) - : m_xDlg(std::move(p)) - { - } - virtual short Execute() override; - - virtual void SetScenarioData( const OUString& rName, const OUString& rComment, - const Color& rColor, ScScenarioFlags nFlags ) override; - - virtual void GetScenarioData( OUString& rName, OUString& rComment, - Color& rColor, ScScenarioFlags& rFlags ) const override; -}; - -class AbstractScShowTabDlg_Impl : public AbstractScShowTabDlg -{ - std::shared_ptr m_xDlg; -public: - explicit AbstractScShowTabDlg_Impl(std::shared_ptr p) - : m_xDlg(std::move(p)) - { - } - virtual short Execute() override; - virtual bool StartExecuteAsync(VclAbstractDialog::AsyncContext &rCtx) override; - virtual void Insert( const OUString& rString, bool bSelected ) override; - virtual void SetDescription(const OUString& rTitle, const OUString& rFixedText, const OUString& sDlgHelpId, const OUString& sLbHelpId) override; - virtual OUString GetEntry(sal_Int32 nPos) const override; - virtual std::vector GetSelectedRows() const override; -}; - -class AbstractScGoToTabDlg_Impl : public AbstractScGoToTabDlg -{ - std::shared_ptr m_xDlg; -public: - explicit AbstractScGoToTabDlg_Impl(std::shared_ptr p) - : m_xDlg(std::move(p)) - { - } - virtual short Execute() override; - virtual bool StartExecuteAsync(VclAbstractDialog::AsyncContext &rCtx) override; - virtual void Insert( const OUString& rString, bool bSelected ) override; - virtual void SetDescription(const OUString& rTitle, const OUString& rEntryLabel, const OUString& rListLabel, - const OUString& rDlgHelpId, const OUString& rEnHelpId, const OUString& rLbHelpId) override; - virtual OUString GetSelectedEntry() const override; -}; - -class AbstractScSortWarningDlg_Impl : public AbstractScSortWarningDlg -{ - std::unique_ptr m_xDlg; -public: - explicit AbstractScSortWarningDlg_Impl(std::unique_ptr p) - : m_xDlg(std::move(p)) - { - } - virtual short Execute() override; -}; - -class AbstractScStringInputDlg_Impl : public AbstractScStringInputDlg -{ - std::shared_ptr m_xDlg; -public: - explicit AbstractScStringInputDlg_Impl(std::shared_ptr p) - : m_xDlg(std::move(p)) - { - } - virtual short Execute() override; - virtual bool StartExecuteAsync(AsyncContext &rCtx) override; - virtual OUString GetInputString() const override; - - // screenshotting - virtual BitmapEx createScreenshot() const override; - virtual OUString GetScreenshotId() const override; -}; - -class AbstractScTabBgColorDlg_Impl : public AbstractScTabBgColorDlg -{ - std::shared_ptr m_xDlg; -public: - explicit AbstractScTabBgColorDlg_Impl(std::shared_ptr p) - : m_xDlg(std::move(p)) - { - } - virtual short Execute() override; - virtual bool StartExecuteAsync(VclAbstractDialog::AsyncContext &rCtx) override; - virtual void GetSelectedColor( Color& rColor ) const override; - - // screenshotting - virtual BitmapEx createScreenshot() const override; - virtual OUString GetScreenshotId() const override; -}; - -class AbstractScImportOptionsDlg_Impl : public AbstractScImportOptionsDlg -{ - std::unique_ptr m_xDlg; -public: - explicit AbstractScImportOptionsDlg_Impl(std::unique_ptr p) - : m_xDlg(std::move(p)) - { - } - virtual short Execute() override; - virtual void GetImportOptions( ScImportOptions& rOptions ) const override; - virtual void SaveImportOptions() const override; -}; - -class AbstractScTextImportOptionsDlg_Impl : public AbstractScTextImportOptionsDlg -{ - std::unique_ptr m_xDlg; -public: - explicit AbstractScTextImportOptionsDlg_Impl(std::unique_ptr p) - : m_xDlg(std::move(p)) - { - } - virtual short Execute() override; - virtual LanguageType GetLanguageType() const override; - virtual bool IsDateConversionSet() const override; - virtual bool IsScientificConversionSet() const override; - virtual bool IsKeepAskingSet() const override; - - // screenshotting - virtual BitmapEx createScreenshot() const override; - virtual OUString GetScreenshotId() const override; -}; - -class ScAbstractTabController_Impl : public SfxAbstractTabDialog -{ - std::shared_ptr m_xDlg; -public: - explicit ScAbstractTabController_Impl(std::shared_ptr p) - : m_xDlg(std::move(p)) - { - } - virtual short Execute() override; - virtual bool StartExecuteAsync(AsyncContext &rCtx) override; - virtual void SetCurPageId( const OUString &rName ) override; - virtual const SfxItemSet* GetOutputItemSet() const override; - virtual WhichRangesContainer GetInputRanges( const SfxItemPool& pItem ) override; - virtual void SetInputSet( const SfxItemSet* pInSet ) override; - virtual void SetText( const OUString& rStr ) override; - - // screenshotting - virtual std::vector getAllPageUIXMLDescriptions() const override; - virtual bool selectPageByUIXMLDescription(const OUString& rUIXMLDescription) override; - virtual BitmapEx createScreenshot() const override; - virtual OUString GetScreenshotId() const override; -}; - -class ScAsyncTabController_Impl : public ScAsyncTabController -{ - std::shared_ptr m_xDlg; -public: - explicit ScAsyncTabController_Impl(std::shared_ptr p) - : m_xDlg(std::move(p)) - { - } - virtual bool StartExecuteAsync(VclAbstractDialog::AsyncContext &rCtx) override; - virtual const SfxItemSet* GetOutputItemSet() const override; - virtual void SetCurPageId( const OUString &rName ) override; -}; //AbstractDialogFactory_Impl implementations class ScAbstractDialogFactory_Impl : public ScAbstractDialogFactory diff --git a/sc/source/ui/attrdlg/scuiexp.cxx b/sc/source/ui/attrdlg/scuiexp.cxx index 3da9d2ed7b42..97cd5299aedc 100644 --- a/sc/source/ui/attrdlg/scuiexp.cxx +++ b/sc/source/ui/attrdlg/scuiexp.cxx @@ -21,8 +21,13 @@ #include "scdlgfact.hxx" #include +#include #include +#include +#include +#include + /// anonymous implementation namespace namespace { -- cgit