summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2020-02-03 17:21:37 +0100
committerJan Holesovsky <kendy@collabora.com>2021-01-07 16:32:54 +0100
commitd59afaf9762f808333b3819649cd57b3326d45a7 (patch)
tree1600b357488e626fba81130f80f44c3ff6f2cc6e
parent765899c9408c0395ae5e02aaf6c2e068aae09a5e (diff)
deb#949754: unotools,officecfg: don't ODF export using ODFVER_UNKNOWN
The problem was that commit ef39938dea14666a5835b6ae85091c1010f8ae8d temporarily added ODF 1.3 version strings to the optsavepage.ui, just to get translations for them; unfortunately the dialog itself was not adapted to the new values, so when you select them the result is 0, or ODFVER_UNKNOWN... fortunately this was reverted before 6.4.0.3. The value ODFVER_UNKNOWN is very dubious and without an obvious purpose; http://specs.openoffice.org/appwide/odf/odf_1-2_migration.odt mentions it but provides no details. Hence let's interpret it the same as ODFVER_LATEST for export purposes. Also add the value ODFVER_012_EXT_COMPAT to the configuration, because this is actually used. Also fix a copypasta in SvtSaveOptions_Impl::IsReadOnly(), where the wrong flag is checked for OdfDefaultVersion. Change-Id: Ie276f0ef3cead3ffa016ba939aede74581fb0257 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87900 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com> Reviewed-by: Michael Stahl <michael.stahl@cib.de>
-rw-r--r--include/unotools/saveopt.hxx2
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/Common.xcs5
-rw-r--r--unotools/source/config/saveopt.cxx6
3 files changed, 10 insertions, 3 deletions
diff --git a/include/unotools/saveopt.hxx b/include/unotools/saveopt.hxx
index ca5cfcf8b05f..2f0460e21fbc 100644
--- a/include/unotools/saveopt.hxx
+++ b/include/unotools/saveopt.hxx
@@ -58,7 +58,7 @@ public:
*/
enum ODFDefaultVersion
{
- ODFVER_UNKNOWN = 0, // unknown
+ ODFVER_UNKNOWN = 0, // unknown - very dubious, avoid using
ODFVER_010 = 1, // ODF 1.0
ODFVER_011 = 2, // ODF 1.1
DO_NOT_USE = 3, // Do not use this, only here for compatibility with pre OOo 3.2 configuration
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index d52f445b1338..712feb2b5eea 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -2463,6 +2463,11 @@
<desc>ODFVER_012</desc>
</info>
</enumeration>
+ <enumeration oor:value="8">
+ <info>
+ <desc>ODFVER_012_EXT_COMPAT</desc>
+ </info>
+ </enumeration>
<enumeration oor:value="3">
<info>
<desc>ODFVER_LATEST</desc>
diff --git a/unotools/source/config/saveopt.cxx b/unotools/source/config/saveopt.cxx
index 6c8922edf706..169001b04f68 100644
--- a/unotools/source/config/saveopt.cxx
+++ b/unotools/source/config/saveopt.cxx
@@ -314,7 +314,7 @@ bool SvtSaveOptions_Impl::IsReadOnly( SvtSaveOptions::EOption eOption ) const
bReadOnly = bROLoadDocPrinter;
break;
case SvtSaveOptions::EOption::OdfDefaultVersion :
- bReadOnly = bROLoadDocPrinter;
+ bReadOnly = bROODFDefaultVersion;
break;
}
return bReadOnly;
@@ -920,7 +920,9 @@ void SvtSaveOptions::SetODFDefaultVersion( SvtSaveOptions::ODFDefaultVersion eVe
SvtSaveOptions::ODFDefaultVersion SvtSaveOptions::GetODFDefaultVersion() const
{
- return pImp->pSaveOpt->GetODFDefaultVersion();
+ auto const nRet = pImp->pSaveOpt->GetODFDefaultVersion();
+ SAL_WARN_IF(nRet == ODFVER_UNKNOWN, "unotools.config", "DefaultVersion is ODFVER_UNKNOWN?");
+ return (nRet == ODFVER_UNKNOWN) ? ODFVER_LATEST : nRet;
}
SvtSaveOptions::ODFSaneDefaultVersion SvtSaveOptions::GetODFSaneDefaultVersion() const