sc/source/ui/attrdlg/attrdlg.cxx |    9 +++++++++
 1 file changed, 9 insertions(+)

New commits:
commit c1893df42567c260ca5fb069038d1a55616e7b7f
Author:     Andreas Heinisch <andreas.heini...@yahoo.de>
AuthorDate: Thu Jun 1 09:08:05 2023 +0200
Commit:     Andreas Heinisch <andreas.heini...@yahoo.de>
CommitDate: Thu Jun 1 10:55:41 2023 +0200

    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 <andreas.heini...@yahoo.de>

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 <editeng/flstitem.hxx>
 #include <osl/diagnose.h>
 #include <comphelper/lok.hxx>
+#include <unotools/viewoptions.hxx>
 
 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)

Reply via email to