Resolves: tdf#162597 'ok' in chart range dialog doesn't commit datarange

so nothing happens.

since:

commit 4965b055b5
CommitDate: Fri Feb 16 12:08:55 2024 +0100

    Chart: Make Data Range Dialog Async

async conversion missed that there is a DataSourceDialog::run
override so the use of asyncRun means the body of that isn't run.

To keep things simple we can add an explicit 'ok' handler and move
the special dialog ok code into that instead, so all the existing
asyncRun's used with this dialog run the same code originally called
in the previous non-async case.

Change-Id: Ibdb4b764b1a1e48c01ee1528bc260f694e840221
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172336
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
This commit is contained in:
Caolán McNamara
2024-08-23 21:36:59 +01:00
parent 96f3aeaa70
commit 8843081f91
2 changed files with 14 additions and 13 deletions

View File

@@ -94,6 +94,7 @@ DataSourceDialog::DataSourceDialog(weld::Window * pParent,
m_apDocTemplateProvider.get(), true /* bHideDescription */ );
m_xTabControl->connect_enter_page(LINK(this, DataSourceDialog, ActivatePageHdl));
m_xTabControl->connect_leave_page(LINK(this, DataSourceDialog, DeactivatePageHdl));
m_xBtnOK->connect_clicked(LINK(this, DataSourceDialog, OkHdl));
ActivatePageHdl(m_xTabControl->get_current_page_ident());
if (m_nLastPageId != 0)
{
@@ -109,17 +110,18 @@ DataSourceDialog::~DataSourceDialog()
m_nLastPageId = m_xTabControl->get_current_page();
}
short DataSourceDialog::run()
void DataSourceDialog::commitPages()
{
short nResult = GenericDialogController::run();
if( nResult == RET_OK )
{
if( m_xRangeChooserTabPage )
m_xRangeChooserTabPage->commitPage();
if( m_xDataSourceTabPage )
m_xDataSourceTabPage->commitPage();
}
return nResult;
if (m_xRangeChooserTabPage)
m_xRangeChooserTabPage->commitPage();
if (m_xDataSourceTabPage)
m_xDataSourceTabPage->commitPage();
}
IMPL_LINK_NOARG(DataSourceDialog, OkHdl, weld::Button&, void)
{
commitPages();
m_xDialog->response(RET_OK);
}
IMPL_LINK(DataSourceDialog, ActivatePageHdl, const OUString&, rPage, void)

View File

@@ -44,9 +44,6 @@ public:
const rtl::Reference<::chart::ChartModel> & xChartDocument );
virtual ~DataSourceDialog() override;
// from GenericDialogController base
virtual short run() override;
// TabPageNotifiable
virtual void setInvalidPage( BuilderPage * pTabPage ) override;
virtual void setValidPage( BuilderPage * pTabPage ) override;
@@ -54,6 +51,8 @@ public:
private:
DECL_LINK(ActivatePageHdl, const OUString&, void);
DECL_LINK(DeactivatePageHdl, const OUString&, bool);
DECL_LINK(OkHdl, weld::Button&, void);
void commitPages();
std::unique_ptr< ChartTypeTemplateProvider > m_apDocTemplateProvider;
std::unique_ptr< DialogModel > m_apDialogModel;