summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2020-10-31 13:42:15 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-11-01 16:10:13 +0100
commit6e11de09b3cce8cec0fc43b8fdb631ace0853a5a (patch)
treea0b2c7ad2fb8ceea86a455003d927b63d33e576c
parent090636a305e12538164217cdf7be49980088dc54 (diff)
use officecfg for UseSystemPrintDialog
Change-Id: I0e0bdc925f106884cbcede6405cc6ef7152ad405 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105139 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--cui/source/options/optgdlg.cxx8
-rw-r--r--include/svtools/miscopt.hxx3
-rw-r--r--svtools/source/config/miscopt.cxx57
3 files changed, 10 insertions, 58 deletions
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index 9685564187ea..487cff1f6883 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -337,8 +337,10 @@ bool OfaMiscTabPage::FillItemSet( SfxItemSet* rSet )
if ( m_xPrintDlgCB->get_state_changed_from_saved() )
{
- SvtMiscOptions aMiscOpt;
- aMiscOpt.SetUseSystemPrintDialog( !m_xPrintDlgCB->get_active() );
+ std::shared_ptr< comphelper::ConfigurationChanges > xChanges(
+ comphelper::ConfigurationChanges::create());
+ officecfg::Office::Common::Misc::UseSystemPrintDialog::set( !m_xPrintDlgCB->get_active(), xChanges );
+ xChanges->commit();
bModified = true;
}
@@ -393,7 +395,7 @@ void OfaMiscTabPage::Reset( const SfxItemSet* rSet )
SvtMiscOptions aMiscOpt;
m_xFileDlgCB->set_active( !aMiscOpt.UseSystemFileDialog() );
m_xFileDlgCB->save_state();
- m_xPrintDlgCB->set_active( !aMiscOpt.UseSystemPrintDialog() );
+ m_xPrintDlgCB->set_active( !officecfg::Office::Common::Misc::UseSystemPrintDialog::get() );
m_xPrintDlgCB->save_state();
m_xDocStatusCB->set_active(officecfg::Office::Common::Print::PrintingModifiesDocument::get());
diff --git a/include/svtools/miscopt.hxx b/include/svtools/miscopt.hxx
index 8fb276063a1b..5d1e24490417 100644
--- a/include/svtools/miscopt.hxx
+++ b/include/svtools/miscopt.hxx
@@ -79,9 +79,6 @@ class SVT_DLLPUBLIC SvtMiscOptions final : public utl::detail::Options
sal_Int16 GetToolboxStyle() const;
void SetToolboxStyle( sal_Int16 nStyle );
- bool UseSystemPrintDialog() const;
- void SetUseSystemPrintDialog( bool bSet );
-
bool ShowLinkWarningDialog() const;
void SetShowLinkWarningDialog( bool bSet );
bool IsShowLinkWarningDialogReadOnly() const;
diff --git a/svtools/source/config/miscopt.cxx b/svtools/source/config/miscopt.cxx
index dc01682d344e..bca5b5a760fb 100644
--- a/svtools/source/config/miscopt.cxx
+++ b/svtools/source/config/miscopt.cxx
@@ -54,18 +54,16 @@ using namespace ::com::sun::star;
#define PROPERTYHANDLE_USESYSTEMFILEDIALOG 3
#define PROPERTYNAME_ICONTHEME "SymbolStyle"
#define PROPERTYHANDLE_SYMBOLSTYLE 4
-#define PROPERTYNAME_USESYSTEMPRINTDIALOG "UseSystemPrintDialog"
-#define PROPERTYHANDLE_USESYSTEMPRINTDIALOG 5
#define PROPERTYNAME_SHOWLINKWARNINGDIALOG "ShowLinkWarningDialog"
-#define PROPERTYHANDLE_SHOWLINKWARNINGDIALOG 6
+#define PROPERTYHANDLE_SHOWLINKWARNINGDIALOG 5
#define PROPERTYNAME_DISABLEUICUSTOMIZATION "DisableUICustomization"
-#define PROPERTYHANDLE_DISABLEUICUSTOMIZATION 7
+#define PROPERTYHANDLE_DISABLEUICUSTOMIZATION 6
#define PROPERTYNAME_MACRORECORDERMODE "MacroRecorderMode"
-#define PROPERTYHANDLE_MACRORECORDERMODE 8
+#define PROPERTYHANDLE_MACRORECORDERMODE 7
#define PROPERTYNAME_SIDEBARICONSIZE "SidebarIconSize"
-#define PROPERTYHANDLE_SIDEBARICONSIZE 9
+#define PROPERTYHANDLE_SIDEBARICONSIZE 8
#define PROPERTYNAME_NOTEBOOKBARICONSIZE "NotebookbarIconSize"
-#define PROPERTYHANDLE_NOTEBOOKBARICONSIZE 10
+#define PROPERTYHANDLE_NOTEBOOKBARICONSIZE 9
class SvtMiscOptions_Impl : public ConfigItem
{
@@ -84,8 +82,6 @@ private:
bool m_bIsSymbolsStyleRO;
sal_Int16 m_nToolboxStyle;
bool m_bIsToolboxStyleRO;
- bool m_bUseSystemPrintDialog;
- bool m_bIsUseSystemPrintDialogRO;
bool m_bShowLinkWarningDialog;
bool m_bIsShowLinkWarningDialogRO;
bool m_bDisableUICustomization;
@@ -186,12 +182,6 @@ public:
// translate from VCL settings
void SetToolboxStyle( sal_Int16 nStyle );
- bool UseSystemPrintDialog() const
- { return m_bUseSystemPrintDialog; }
-
- void SetUseSystemPrintDialog( bool bSet )
- { m_bUseSystemPrintDialog = bSet; SetModified(); }
-
bool ShowLinkWarningDialog() const
{ return m_bShowLinkWarningDialog; }
@@ -241,8 +231,6 @@ SvtMiscOptions_Impl::SvtMiscOptions_Impl()
, m_bIsSymbolsStyleRO( false )
, m_nToolboxStyle( 1 )
, m_bIsToolboxStyleRO( false )
- , m_bUseSystemPrintDialog( false )
- , m_bIsUseSystemPrintDialogRO( false )
, m_bShowLinkWarningDialog( true )
, m_bIsShowLinkWarningDialogRO( false )
, m_bMacroRecorderMode( false )
@@ -331,16 +319,6 @@ SvtMiscOptions_Impl::SvtMiscOptions_Impl()
break;
}
- case PROPERTYHANDLE_USESYSTEMPRINTDIALOG :
- {
- if( !(seqValues[nProperty] >>= m_bUseSystemPrintDialog) )
- {
- OSL_FAIL("Wrong type of \"Misc\\UseSystemPrintDialog\"!" );
- }
- m_bIsUseSystemPrintDialogRO = seqRO[nProperty];
- break;
- }
-
case PROPERTYHANDLE_SHOWLINKWARNINGDIALOG :
{
if( !(seqValues[nProperty] >>= m_bShowLinkWarningDialog) )
@@ -455,13 +433,6 @@ void SvtMiscOptions_Impl::Load( const Sequence< OUString >& rPropertyNames )
}
}
break;
- case PROPERTYHANDLE_USESYSTEMPRINTDIALOG : {
- if( !(seqValues[nProperty] >>= m_bUseSystemPrintDialog) )
- {
- OSL_FAIL("Wrong type of \"Misc\\UseSystemPrintDialog\"!" );
- }
- }
- break;
case PROPERTYHANDLE_SHOWLINKWARNINGDIALOG : {
if( !(seqValues[nProperty] >>= m_bShowLinkWarningDialog) )
{
@@ -640,13 +611,6 @@ void SvtMiscOptions_Impl::ImplCommit()
break;
}
- case PROPERTYHANDLE_USESYSTEMPRINTDIALOG :
- {
- if ( !m_bIsUseSystemPrintDialogRO )
- seqValues[nProperty] <<= m_bUseSystemPrintDialog;
- break;
- }
-
case PROPERTYHANDLE_SHOWLINKWARNINGDIALOG :
{
if ( !m_bIsShowLinkWarningDialogRO )
@@ -682,7 +646,6 @@ Sequence< OUString > SvtMiscOptions_Impl::GetPropertyNames()
PROPERTYNAME_TOOLBOXSTYLE,
PROPERTYNAME_USESYSTEMFILEDIALOG,
PROPERTYNAME_ICONTHEME,
- PROPERTYNAME_USESYSTEMPRINTDIALOG,
PROPERTYNAME_SHOWLINKWARNINGDIALOG,
PROPERTYNAME_DISABLEUICUSTOMIZATION,
PROPERTYNAME_MACRORECORDERMODE,
@@ -819,16 +782,6 @@ void SvtMiscOptions::SetToolboxStyle( sal_Int16 nStyle )
m_pImpl->SetToolboxStyle( nStyle );
}
-bool SvtMiscOptions::UseSystemPrintDialog() const
-{
- return m_pImpl->UseSystemPrintDialog();
-}
-
-void SvtMiscOptions::SetUseSystemPrintDialog( bool bEnable )
-{
- m_pImpl->SetUseSystemPrintDialog( bEnable );
-}
-
bool SvtMiscOptions::ShowLinkWarningDialog() const
{
return m_pImpl->ShowLinkWarningDialog();