summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-07-29 09:48:51 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-07-29 16:16:04 +0200
commit153d9483c1e9ec3722447a2b43c43ec1b32193d6 (patch)
tree39cf74e56f3a1a52b21bfc95e04758d26396abb9 /sfx2
parentb1dc1c740e37639bb309f4aa6a1c2567f99083fc (diff)
replace and drop SvtPrintWarningOptions
Change-Id: I17fd4156eb940fbdc925d9761301096e5349135f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99674 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/dialog/printopt.cxx21
-rw-r--r--sfx2/source/view/viewprn.cxx5
2 files changed, 12 insertions, 14 deletions
diff --git a/sfx2/source/dialog/printopt.cxx b/sfx2/source/dialog/printopt.cxx
index 43f88786a292..5f4025fb57c0 100644
--- a/sfx2/source/dialog/printopt.cxx
+++ b/sfx2/source/dialog/printopt.cxx
@@ -19,7 +19,7 @@
#include <sal/macros.h>
-#include <unotools/printwarningoptions.hxx>
+#include <officecfg/Office/Common.hxx>
#include <svtools/printoptions.hxx>
#include <svtools/restartdialog.hxx>
@@ -91,17 +91,19 @@ std::unique_ptr<SfxTabPage> SfxCommonPrintOptionsTabPage::Create(weld::Container
bool SfxCommonPrintOptionsTabPage::FillItemSet( SfxItemSet* /*rSet*/ )
{
- SvtPrintWarningOptions aWarnOptions;
SvtPrinterOptions aPrinterOptions;
SvtPrintFileOptions aPrintFileOptions;
+ std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create());
if( m_xPaperSizeCB->get_state_changed_from_saved())
- aWarnOptions.SetPaperSize(m_xPaperSizeCB->get_active());
+ officecfg::Office::Common::Print::Warning::PaperSize::set(m_xPaperSizeCB->get_active(), batch);
if( m_xPaperOrientationCB->get_state_changed_from_saved() )
- aWarnOptions.SetPaperOrientation(m_xPaperOrientationCB->get_active());
+ officecfg::Office::Common::Print::Warning::PaperOrientation::set(m_xPaperOrientationCB->get_active(), batch);
if( m_xTransparencyCB->get_state_changed_from_saved() )
- aWarnOptions.SetTransparency( m_xTransparencyCB->get_active() );
+ officecfg::Office::Common::Print::Warning::Transparency::set(m_xTransparencyCB->get_active(), batch);
+
+ batch->commit();
ImplSaveControls( m_xPrinterOutputRB->get_active() ? &maPrinterOptions : &maPrintFileOptions );
@@ -113,12 +115,9 @@ bool SfxCommonPrintOptionsTabPage::FillItemSet( SfxItemSet* /*rSet*/ )
void SfxCommonPrintOptionsTabPage::Reset( const SfxItemSet* /*rSet*/ )
{
- SvtPrintWarningOptions aWarnOptions;
-
- m_xPaperSizeCB->set_active( aWarnOptions.IsPaperSize() );
- m_xPaperOrientationCB->set_active( aWarnOptions.IsPaperOrientation() );
-
- m_xTransparencyCB->set_active( aWarnOptions.IsTransparency() );
+ m_xPaperSizeCB->set_active(officecfg::Office::Common::Print::Warning::PaperSize::get());
+ m_xPaperOrientationCB->set_active(officecfg::Office::Common::Print::Warning::PaperOrientation::get());
+ m_xTransparencyCB->set_active(officecfg::Office::Common::Print::Warning::Transparency::get());
m_xPaperSizeCB->save_state();
m_xPaperOrientationCB->save_state();
diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx
index f0200f421b91..19b954d26fe6 100644
--- a/sfx2/source/view/viewprn.cxx
+++ b/sfx2/source/view/viewprn.cxx
@@ -22,7 +22,7 @@
#include <com/sun/star/document/XDocumentProperties.hpp>
#include <com/sun/star/view/XRenderable.hpp>
#include <com/sun/star/view/XSelectionSupplier.hpp>
-
+#include <officecfg/Office/Common.hxx>
#include <sal/log.hxx>
#include <svl/itempool.hxx>
#include <vcl/svapp.hxx>
@@ -33,7 +33,6 @@
#include <svl/eitem.hxx>
#include <sfx2/app.hxx>
#include <unotools/useroptions.hxx>
-#include <unotools/printwarningoptions.hxx>
#include <tools/datetime.hxx>
#include <sfx2/bindings.hxx>
#include <sfx2/objface.hxx>
@@ -303,7 +302,7 @@ void SfxPrinterController::jobStarted()
m_bOrigStatus = mpObjectShell->IsEnableSetModified();
// check configuration: shall update of printing information in DocInfo set the document to "modified"?
- if ( m_bOrigStatus && !SvtPrintWarningOptions().IsModifyDocumentOnPrintingAllowed() )
+ if (m_bOrigStatus && !officecfg::Office::Common::Print::PrintingModifiesDocument::get())
{
mpObjectShell->EnableSetModified( false );
m_bNeedsChange = true;