From d571a509aa324db9a425110a67ea142d157256b2 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Mon, 3 Feb 2020 17:21:37 +0100 Subject: 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 Reviewed-by: Michael Stahl --- unotools/source/config/saveopt.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'unotools/source/config/saveopt.cxx') diff --git a/unotools/source/config/saveopt.cxx b/unotools/source/config/saveopt.cxx index 650ec5586b8d..6d6b39743eb9 100644 --- a/unotools/source/config/saveopt.cxx +++ b/unotools/source/config/saveopt.cxx @@ -322,7 +322,7 @@ bool SvtSaveOptions_Impl::IsReadOnly( SvtSaveOptions::EOption eOption ) const bReadOnly = bROLoadDocPrinter; break; case SvtSaveOptions::EOption::OdfDefaultVersion : - bReadOnly = bROLoadDocPrinter; + bReadOnly = bROODFDefaultVersion; break; } return bReadOnly; @@ -932,7 +932,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 -- cgit