officecfg/registry/schema/org/openoffice/VCL.xcs |    3 +++
 vcl/source/window/printdlg.cxx                   |    8 +++-----
 2 files changed, 6 insertions(+), 5 deletions(-)

New commits:
commit 4e83aef2f7ebe54547f8602ccdef9d35afd285f1
Author:     Gabor Kelemen <gabor.kelemen.ext...@allotropia.de>
AuthorDate: Sun May 11 11:16:49 2025 +0200
Commit:     Gabor Kelemen <gabor.kelemen.ext...@allotropia.de>
CommitDate: Sun Jun 22 12:27:22 2025 +0200

    [API CHANGE] Replace VCL Settings (PrintDialog/LastPage)
    
    in order to simplify code.
    
    The flexibility provided by the ConfigurableSettings template
    is not really necessary for the simple settings VCL has
    
    Change-Id: I8babe75085d54a1657f3071d07cfd995320715b7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185179
    Tested-by: Jenkins
    Reviewed-by: Gabor Kelemen <gabor.kelemen.ext...@allotropia.de>

diff --git a/officecfg/registry/schema/org/openoffice/VCL.xcs 
b/officecfg/registry/schema/org/openoffice/VCL.xcs
index 2323bca1340c..cb2d76944a13 100644
--- a/officecfg/registry/schema/org/openoffice/VCL.xcs
+++ b/officecfg/registry/schema/org/openoffice/VCL.xcs
@@ -127,6 +127,9 @@
                 <prop oor:name="Collate" oor:type="xs:boolean" 
oor:nillable="false">
                     <value>true</value>
                 </prop>
+                <prop oor:name="LastPage" oor:type="xs:string" 
oor:nillable="false">
+                    <value/>
+                </prop>
                 <prop oor:name="LastPrinter" oor:type="xs:string" 
oor:nillable="false">
                     <value/>
                 </prop>
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index 6a8b02626849..78fbada59c1f 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -753,9 +753,8 @@ void PrintDialog::storeToSettings()
                       isPrintToFile() ? Printer::GetDefaultPrinterName()
                                       : mxPrinters->get_active_text(), batch );
 
-    pItem->setValue( u"PrintDialog"_ustr,
-                     u"LastPage"_ustr,
-                     
mxTabCtrl->get_tab_label_text(mxTabCtrl->get_current_page_ident()));
+    officecfg::VCL::VCLSettings::PrintDialog::LastPage::set(
+                     
mxTabCtrl->get_tab_label_text(mxTabCtrl->get_current_page_ident()), batch);
 
     pItem->setValue( u"PrintDialog"_ustr,
                      u"WindowState"_ustr,
@@ -786,8 +785,7 @@ void PrintDialog::readFromSettings()
     SettingsConfigItem* pItem = SettingsConfigItem::get();
 
     // read last selected tab page; if it exists, activate it
-    OUString aValue = pItem->getValue( u"PrintDialog"_ustr,
-                              u"LastPage"_ustr );
+    OUString aValue = 
officecfg::VCL::VCLSettings::PrintDialog::LastPage::get();
     sal_uInt16 nCount = mxTabCtrl->get_n_pages();
     for (sal_uInt16 i = 0; i < nCount; ++i)
     {

Reply via email to