From c1893df42567c260ca5fb069038d1a55616e7b7f Mon Sep 17 00:00:00 2001 From: Andreas Heinisch Date: Thu, 1 Jun 2023 09:08:05 +0200 Subject: tdf#149598 - Remember window state of the format cell dialog Change-Id: Ie3b468c674a9a811a5359155cda1d96ed44e50fc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152474 Tested-by: Jenkins Reviewed-by: Andreas Heinisch --- sc/source/ui/attrdlg/attrdlg.cxx | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'sc/source/ui/attrdlg/attrdlg.cxx') diff --git a/sc/source/ui/attrdlg/attrdlg.cxx b/sc/source/ui/attrdlg/attrdlg.cxx index ad0a82542c3e..7a80073d9da3 100644 --- a/sc/source/ui/attrdlg/attrdlg.cxx +++ b/sc/source/ui/attrdlg/attrdlg.cxx @@ -31,11 +31,17 @@ #include #include #include +#include ScAttrDlg::ScAttrDlg(weld::Window* pParent, const SfxItemSet* pCellAttrs) : SfxTabDialogController(pParent, "modules/scalc/ui/formatcellsdialog.ui", "FormatCellsDialog", pCellAttrs) { + // tdf#149598 - restore window state of the dialog + SvtViewOptions aDlgOpt(EViewType::Dialog, "FormatCellDialog"); + if (aDlgOpt.Exists()) + m_xDialog->set_window_state(aDlgOpt.GetWindowState()); + SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_NUMBERFORMAT ), "GetTabPageCreatorFunc fail!"); @@ -67,6 +73,9 @@ ScAttrDlg::ScAttrDlg(weld::Window* pParent, const SfxItemSet* pCellAttrs) ScAttrDlg::~ScAttrDlg() { + // tdf#149598 - remember window state of the dialog + SvtViewOptions aDlgOpt(EViewType::Dialog, "FormatCellDialog"); + aDlgOpt.SetWindowState(m_xDialog->get_window_state(vcl::WindowDataMask::PosSize)); } void ScAttrDlg::PageCreated(const OUString& rPageId, SfxTabPage& rTabPage) -- cgit