officecfg/registry/data/org/openoffice/VCL.xcu   |    3 ---
 officecfg/registry/schema/org/openoffice/VCL.xcs |    5 +++++
 vcl/source/window/printdlg.cxx                   |   12 +++++-------
 3 files changed, 10 insertions(+), 10 deletions(-)

New commits:
commit b3334b2dad6d8d3ebaedd0a637a58fd5e5443635
Author:     Gabor Kelemen <gabor.kelemen.ext...@allotropia.de>
AuthorDate: Sat May 10 21:54:00 2025 +0200
Commit:     Gabor Kelemen <gabor.kelemen.ext...@allotropia.de>
CommitDate: Fri Jun 20 10:33:39 2025 +0200

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

diff --git a/officecfg/registry/data/org/openoffice/VCL.xcu 
b/officecfg/registry/data/org/openoffice/VCL.xcu
index 634cc0efdb31..bfe5f94f6aec 100644
--- a/officecfg/registry/data/org/openoffice/VCL.xcu
+++ b/officecfg/registry/data/org/openoffice/VCL.xcu
@@ -20,9 +20,6 @@
 <oor:component-data xmlns:oor="http://openoffice.org/2001/registry"; 
xmlns:install="http://openoffice.org/2004/installation"; 
xmlns:xs="http://www.w3.org/2001/XMLSchema"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; oor:name="VCL" 
oor:package="org.openoffice">
   <node oor:name="Settings">
     <node oor:name="PrintDialog" oor:op="replace">
-      <prop oor:name="Collate" oor:op="replace" oor:type="xs:string">
-        <value>true</value>
-      </prop>
       <prop oor:name="CollateBox" oor:op="replace" oor:type="xs:string">
         <value>Default</value>
       </prop>
diff --git a/officecfg/registry/schema/org/openoffice/VCL.xcs 
b/officecfg/registry/schema/org/openoffice/VCL.xcs
index aefd6c9cfc55..4b0a4f35aba9 100644
--- a/officecfg/registry/schema/org/openoffice/VCL.xcs
+++ b/officecfg/registry/schema/org/openoffice/VCL.xcs
@@ -123,6 +123,11 @@
                     <value>false</value>
                 </prop>
             </group>
+            <group oor:name="PrintDialog">
+                <prop oor:name="Collate" oor:type="xs:boolean" 
oor:nillable="false">
+                    <value>true</value>
+                </prop>
+            </group>
             <group oor:name="WM">
                 <prop oor:name="ShouldSwitchWorkspace" oor:type="xs:boolean" 
oor:nillable="false">
                     <value>false</value>
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index 83c874c91457..5d5539ade673 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -23,6 +23,7 @@
 #include <rtl/ustrbuf.hxx>
 #include <unotools/localedatawrapper.hxx>
 #include <officecfg/Office/Common.hxx>
+#include <officecfg/VCL.hxx>
 
 #include <utility>
 #include <vcl/QueueInfo.hxx>
@@ -748,6 +749,7 @@ void PrintDialog::setupPaperSidesBox()
 void PrintDialog::storeToSettings()
 {
     SettingsConfigItem* pItem = SettingsConfigItem::get();
+    std::shared_ptr<comphelper::ConfigurationChanges> 
batch(comphelper::ConfigurationChanges::create());
 
     pItem->setValue( u"PrintDialog"_ustr,
                      u"LastPrinter"_ustr,
@@ -766,10 +768,7 @@ void PrintDialog::storeToSettings()
                      u"CopyCount"_ustr,
                      mxCopyCountField->get_text() );
 
-    pItem->setValue( u"PrintDialog"_ustr,
-                     u"Collate"_ustr,
-                     mxCollateBox->get_active() ? u"true"_ustr :
-                                                 u"false"_ustr );
+    officecfg::VCL::VCLSettings::PrintDialog::Collate::set( 
mxCollateBox->get_active(), batch );
 
     pItem->setValue( u"PrintDialog"_ustr,
                      u"CollateSingleJobs"_ustr,
@@ -781,6 +780,7 @@ void PrintDialog::storeToSettings()
                      hasPreview() ? u"true"_ustr :
                                     u"false"_ustr );
 
+    batch->commit();
     pItem->Commit();
 }
 
@@ -820,9 +820,7 @@ void PrintDialog::readFromSettings()
     else
     {
         mbCollateAlwaysOff = false;
-        aValue = pItem->getValue( u"PrintDialog"_ustr,
-                                  u"Collate"_ustr );
-        mxCollateBox->set_active( aValue.equalsIgnoreAsciiCase("true") );
+        mxCollateBox->set_active( 
officecfg::VCL::VCLSettings::PrintDialog::Collate::get() );
     }
 
     // collate single jobs

Reply via email to