[API CHANGE] Replace VCL Settings (PrintDialog/HasPreview)
in order to simplify code. The flexibility provided by the ConfigurableSettings template is not really necessary for the simple settings VCL has Change-Id: I53a5930572a81e9e8ed33846b33c6f5e7a6d01e1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185183 Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de> Tested-by: Jenkins
This commit is contained in:
@@ -130,6 +130,9 @@
|
||||
<prop oor:name="CollateSingleJobs" oor:type="xs:boolean" oor:nillable="false">
|
||||
<value>false</value>
|
||||
</prop>
|
||||
<prop oor:name="HasPreview" oor:type="xs:boolean" oor:nillable="false">
|
||||
<value>true</value>
|
||||
</prop>
|
||||
<prop oor:name="LastPage" oor:type="xs:string" oor:nillable="false">
|
||||
<value/>
|
||||
</prop>
|
||||
|
||||
@@ -41,7 +41,6 @@
|
||||
#include <vcl/windowstate.hxx>
|
||||
|
||||
#include <bitmaps.hlst>
|
||||
#include <configsettings.hxx>
|
||||
#include <printdlg.hxx>
|
||||
#include <strings.hrc>
|
||||
#include <svdata.hxx>
|
||||
@@ -746,7 +745,6 @@ void PrintDialog::setupPaperSidesBox()
|
||||
|
||||
void PrintDialog::storeToSettings()
|
||||
{
|
||||
SettingsConfigItem* pItem = SettingsConfigItem::get();
|
||||
std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create());
|
||||
|
||||
officecfg::VCL::VCLSettings::PrintDialog::LastPrinter::set(
|
||||
@@ -764,19 +762,13 @@ void PrintDialog::storeToSettings()
|
||||
officecfg::VCL::VCLSettings::PrintDialog::CollateSingleJobs::set(
|
||||
mxSingleJobsBox->get_active(), batch );
|
||||
|
||||
pItem->setValue( u"PrintDialog"_ustr,
|
||||
u"HasPreview"_ustr,
|
||||
hasPreview() ? u"true"_ustr :
|
||||
u"false"_ustr );
|
||||
officecfg::VCL::VCLSettings::PrintDialog::HasPreview::set( hasPreview(), batch);
|
||||
|
||||
batch->commit();
|
||||
pItem->Commit();
|
||||
}
|
||||
|
||||
void PrintDialog::readFromSettings()
|
||||
{
|
||||
SettingsConfigItem* pItem = SettingsConfigItem::get();
|
||||
|
||||
// read last selected tab page; if it exists, activate it
|
||||
OUString aValue = officecfg::VCL::VCLSettings::PrintDialog::LastPage::get();
|
||||
sal_uInt16 nCount = mxTabCtrl->get_n_pages();
|
||||
@@ -812,12 +804,7 @@ void PrintDialog::readFromSettings()
|
||||
mxSingleJobsBox->set_active( officecfg::VCL::VCLSettings::PrintDialog::CollateSingleJobs::get() );
|
||||
|
||||
// preview box
|
||||
aValue = pItem->getValue( u"PrintDialog"_ustr,
|
||||
u"HasPreview"_ustr );
|
||||
if ( aValue.equalsIgnoreAsciiCase("false") )
|
||||
mxPreviewBox->set_active( false );
|
||||
else
|
||||
mxPreviewBox->set_active( true );
|
||||
mxPreviewBox->set_active( officecfg::VCL::VCLSettings::PrintDialog::HasPreview::get() );
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user