[Libreoffice-commits] core.git: include/unotools sfx2/source unotools/source
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Fri Jul 23 20:19:47 UTC 2021
include/unotools/saveopt.hxx | 4 --
sfx2/source/appl/appcfg.cxx | 6 +--
unotools/source/config/saveopt.cxx | 56 ++++---------------------------------
3 files changed, 10 insertions(+), 56 deletions(-)
New commits:
commit 04389e2e5563ae5d771a78e439dfe7ccdcd8b904
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Fri Jul 23 13:59:23 2021 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri Jul 23 22:19:09 2021 +0200
use officecfg to retrieve SaveDocView
Change-Id: I1a758137000359d2448f8c5877d7b2e75f3869b1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119416
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/include/unotools/saveopt.hxx b/include/unotools/saveopt.hxx
index 0e16b683e914..e8b6aed4e448 100644
--- a/include/unotools/saveopt.hxx
+++ b/include/unotools/saveopt.hxx
@@ -38,7 +38,6 @@ public:
AutoSavePrompt,
DocInfSave,
SaveWorkingSet,
- SaveDocView,
SaveRelInet,
SaveRelFsys,
DoPrettyPrinting,
@@ -115,9 +114,6 @@ public:
void SetSaveWorkingSet( bool b );
bool IsSaveWorkingSet() const;
- void SetSaveDocView( bool b );
- bool IsSaveDocView() const;
-
void SetSaveRelINet( bool b );
bool IsSaveRelINet() const;
diff --git a/sfx2/source/appl/appcfg.cxx b/sfx2/source/appl/appcfg.cxx
index 2aa0a8e22047..01820c08adb7 100644
--- a/sfx2/source/appl/appcfg.cxx
+++ b/sfx2/source/appl/appcfg.cxx
@@ -207,8 +207,8 @@ void SfxApplication::GetOptions( SfxItemSet& rSet )
case SID_ATTR_SAVEDOCVIEW :
{
bRet = true;
- if (!aSaveOptions.IsReadOnly(SvtSaveOptions::EOption::SaveDocView))
- if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_SAVEDOCVIEW ), aSaveOptions.IsSaveDocView())))
+ if (!officecfg::Office::Common::Save::Document::ViewInfo::isReadOnly())
+ if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_SAVEDOCVIEW ), officecfg::Office::Common::Save::Document::ViewInfo::get())))
bRet = false;
}
break;
@@ -489,7 +489,7 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet )
if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_SAVEDOCVIEW), true, &pItem))
{
DBG_ASSERT(dynamic_cast< const SfxBoolItem *>( pItem ) != nullptr, "BoolItem expected");
- aSaveOptions.SetSaveDocView(static_cast<const SfxBoolItem *>(pItem)->GetValue());
+ officecfg::Office::Common::Save::Document::ViewInfo::set(static_cast<const SfxBoolItem *>(pItem)->GetValue(), batch);
}
// Metric
diff --git a/unotools/source/config/saveopt.cxx b/unotools/source/config/saveopt.cxx
index 58040c2eafae..76c7e34f3673 100644
--- a/unotools/source/config/saveopt.cxx
+++ b/unotools/source/config/saveopt.cxx
@@ -66,7 +66,6 @@ class SvtSaveOptions_Impl : public utl::ConfigItem
bUserAutoSave,
bDocInfSave,
bSaveWorkingSet,
- bSaveDocView,
bSaveRelINet,
bSaveRelFSys,
bDoPrettyPrinting,
@@ -83,7 +82,6 @@ class SvtSaveOptions_Impl : public utl::ConfigItem
bROUserAutoSave,
bRODocInfSave,
bROSaveWorkingSet,
- bROSaveDocView,
bROSaveRelINet,
bROSaveRelFSys,
bROWarnAlienFormat,
@@ -106,7 +104,6 @@ public:
bool IsUserAutoSave() const { return bUserAutoSave; }
bool IsDocInfoSave() const { return bDocInfSave; }
bool IsSaveWorkingSet() const { return bSaveWorkingSet; }
- bool IsSaveDocView() const { return bSaveDocView; }
bool IsSaveRelINet() const { return bSaveRelINet; }
bool IsSaveRelFSys() const { return bSaveRelFSys; }
bool IsPrettyPrintingEnabled( ) const { return bDoPrettyPrinting; }
@@ -124,7 +121,6 @@ public:
void SetUserAutoSave( bool b );
void SetDocInfoSave( bool b );
void SetSaveWorkingSet( bool b );
- void SetSaveDocView( bool b );
void SetSaveRelINet( bool b );
void SetSaveRelFSys( bool b );
void EnablePrettyPrinting( bool _bDoPP );
@@ -212,15 +208,6 @@ void SvtSaveOptions_Impl::SetSaveWorkingSet( bool b )
}
}
-void SvtSaveOptions_Impl::SetSaveDocView( bool b )
-{
- if (!bROSaveDocView && bSaveDocView!=b)
- {
- bSaveDocView = b;
- SetModified();
- }
-}
-
void SvtSaveOptions_Impl::SetSaveRelINet( bool b )
{
if (!bROSaveRelINet && bSaveRelINet!=b)
@@ -304,9 +291,6 @@ bool SvtSaveOptions_Impl::IsReadOnly( SvtSaveOptions::EOption eOption ) const
case SvtSaveOptions::EOption::SaveWorkingSet :
bReadOnly = bROSaveWorkingSet;
break;
- case SvtSaveOptions::EOption::SaveDocView :
- bReadOnly = bROSaveDocView;
- break;
case SvtSaveOptions::EOption::SaveRelInet :
bReadOnly = bROSaveRelINet;
break;
@@ -336,14 +320,13 @@ bool SvtSaveOptions_Impl::IsReadOnly( SvtSaveOptions::EOption eOption ) const
#define AUTOSAVE 4
#define PROMPT 5
#define EDITPROPERTY 6
-#define SAVEVIEWINFO 7
-#define PRETTYPRINTING 8
-#define WARNALIENFORMAT 9
-#define LOADDOCPRINTER 10
-#define FILESYSTEM 11
-#define INTERNET 12
-#define SAVEWORKINGSET 13
-#define ODFDEFAULTVERSION 14
+#define PRETTYPRINTING 7
+#define WARNALIENFORMAT 8
+#define LOADDOCPRINTER 9
+#define FILESYSTEM 10
+#define INTERNET 11
+#define SAVEWORKINGSET 12
+#define ODFDEFAULTVERSION 13
static Sequence< OUString > GetPropertyNames()
{
@@ -356,7 +339,6 @@ static Sequence< OUString > GetPropertyNames()
"Document/AutoSave",
"Document/AutoSavePrompt",
"Document/EditProperty",
- "Document/ViewInfo",
"Document/PrettyPrinting",
"Document/WarnAlienFormat",
"Document/LoadPrinter",
@@ -385,7 +367,6 @@ SvtSaveOptions_Impl::SvtSaveOptions_Impl()
, bUserAutoSave( false )
, bDocInfSave( false )
, bSaveWorkingSet( false )
- , bSaveDocView( false )
, bSaveRelINet( false )
, bSaveRelFSys( false )
, bDoPrettyPrinting( false )
@@ -400,7 +381,6 @@ SvtSaveOptions_Impl::SvtSaveOptions_Impl()
, bROUserAutoSave( CFG_READONLY_DEFAULT )
, bRODocInfSave( CFG_READONLY_DEFAULT )
, bROSaveWorkingSet( CFG_READONLY_DEFAULT )
- , bROSaveDocView( CFG_READONLY_DEFAULT )
, bROSaveRelINet( CFG_READONLY_DEFAULT )
, bROSaveRelFSys( CFG_READONLY_DEFAULT )
, bROWarnAlienFormat( CFG_READONLY_DEFAULT )
@@ -486,10 +466,6 @@ SvtSaveOptions_Impl::SvtSaveOptions_Impl()
bSaveWorkingSet = bTemp;
bROSaveWorkingSet = pROStates[nProp];
break;
- case SAVEVIEWINFO :
- bSaveDocView = bTemp;
- bROSaveDocView = pROStates[nProp];
- break;
case FILESYSTEM :
bSaveRelFSys = bTemp;
bROSaveRelFSys = pROStates[nProp];
@@ -617,14 +593,6 @@ void SvtSaveOptions_Impl::ImplCommit()
++nRealCount;
}
break;
- case SAVEVIEWINFO :
- if (!bROSaveDocView)
- {
- pValues[nRealCount] <<= bSaveDocView;
- pNames[nRealCount] = pOrgNames[i];
- ++nRealCount;
- }
- break;
case FILESYSTEM :
if (!bROSaveRelFSys)
{
@@ -856,16 +824,6 @@ bool SvtSaveOptions::IsSaveWorkingSet() const
return pImp->pSaveOpt->IsSaveWorkingSet();
}
-void SvtSaveOptions::SetSaveDocView( bool b )
-{
- pImp->pSaveOpt->SetSaveDocView( b );
-}
-
-bool SvtSaveOptions::IsSaveDocView() const
-{
- return pImp->pSaveOpt->IsSaveDocView();
-}
-
void SvtSaveOptions::SetSaveRelINet( bool b )
{
pImp->pSaveOpt->SetSaveRelINet( b );
More information about the Libreoffice-commits
mailing list