[Libreoffice-commits] core.git: include/unotools unotools/source xmloff/source
Eike Rathke
erack at redhat.com
Tue Mar 15 12:49:35 UTC 2016
include/unotools/saveopt.hxx | 20 ++++++++++++--------
unotools/source/config/saveopt.cxx | 6 ++----
xmloff/source/core/xmlexp.cxx | 2 +-
3 files changed, 15 insertions(+), 13 deletions(-)
New commits:
commit 4d857425e0a149f88d3036bdb19b72c7f267efa4
Author: Eike Rathke <erack at redhat.com>
Date: Tue Mar 15 13:34:42 2016 +0100
define ODFSVER_LATEST at a central place
It's already enough to have to adapt the
SvtSaveOptions::GetODFSaneDefaultVersion() mapping for new
ODFDefaultVersion values, get rid of the
SvXMLExport::getSaneDefaultVersion() place.
In the hope that DO NOT USE is taken seriously..
Change-Id: I1eeae698249f68cc375b22cc4cc799107bc14e41
diff --git a/include/unotools/saveopt.hxx b/include/unotools/saveopt.hxx
index c9d793d..5567773 100644
--- a/include/unotools/saveopt.hxx
+++ b/include/unotools/saveopt.hxx
@@ -74,14 +74,18 @@ public:
/// Enums that allow a sane comparison of versions, without LATEST.
enum ODFSaneDefaultVersion
{
- ODFSVER_EXTENDED = 1, // bit designating extensions are allowed
- ODFSVER_010 = 2, // ODF 1.0
- ODFSVER_011 = 4, // ODF 1.1
- ODFSVER_012 = 6, // ODF 1.2
- ODFSVER_012_EXT_COMPAT = 9, // ODF 1.2 extended, but with compatibility fallbacks
- ODFSVER_012_EXTENDED = 11, // ODF 1.2 extended
- ODFSVER_013 = 12, // ODF 1.3
- ODFSVER_013_EXTENDED = 13 // ODF 1.3 extended
+ ODFSVER_EXTENDED = 1, ///< bit designating extensions are allowed
+ ODFSVER_010 = 2, ///< ODF 1.0
+ ODFSVER_011 = 4, ///< ODF 1.1
+ ODFSVER_012 = 6, ///< ODF 1.2
+ ODFSVER_012_EXT_COMPAT = 9, ///< ODF 1.2 extended, but with compatibility fallbacks
+ ODFSVER_012_EXTENDED = 11, ///< ODF 1.2 extended
+ ODFSVER_013 = 12, ///< ODF 1.3
+ ODFSVER_013_EXTENDED = 13, ///< ODF 1.3 extended
+
+ // The latest defined standard. Adapt when a new one is published.
+ ODFSVER_LATEST = ODFSVER_012, ///< @internal DO NOT USE in comparisons
+ ODFSVER_LATEST_EXTENDED = ODFSVER_LATEST | ODFSVER_EXTENDED ///< @internal DO NOT USE in comparisons
};
SvtSaveOptions();
diff --git a/unotools/source/config/saveopt.cxx b/unotools/source/config/saveopt.cxx
index 809522f..0b4f7a7 100644
--- a/unotools/source/config/saveopt.cxx
+++ b/unotools/source/config/saveopt.cxx
@@ -1017,8 +1017,6 @@ SvtSaveOptions::ODFDefaultVersion SvtSaveOptions::GetODFDefaultVersion() const
SvtSaveOptions::ODFSaneDefaultVersion SvtSaveOptions::GetODFSaneDefaultVersion() const
{
- const ODFSaneDefaultVersion NOW_CURRENT_LATEST = ODFSVER_012_EXTENDED;
-
switch (pImp->pSaveOpt->GetODFDefaultVersion())
{
default:
@@ -1026,7 +1024,7 @@ SvtSaveOptions::ODFSaneDefaultVersion SvtSaveOptions::GetODFSaneDefaultVersion()
break;
case ODFVER_UNKNOWN:
case ODFVER_LATEST:
- return NOW_CURRENT_LATEST;
+ return ODFSVER_LATEST_EXTENDED;
case ODFVER_010:
return ODFSVER_010;
case ODFVER_011:
@@ -1036,7 +1034,7 @@ SvtSaveOptions::ODFSaneDefaultVersion SvtSaveOptions::GetODFSaneDefaultVersion()
case ODFVER_012_EXT_COMPAT:
return ODFSVER_012_EXT_COMPAT;
}
- return NOW_CURRENT_LATEST;
+ return ODFSVER_LATEST_EXTENDED;
}
bool SvtSaveOptions::IsUseSHA1InODF12() const
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx
index 12f4a14..81f0656 100644
--- a/xmloff/source/core/xmlexp.cxx
+++ b/xmloff/source/core/xmlexp.cxx
@@ -2370,7 +2370,7 @@ SvtSaveOptions::ODFSaneDefaultVersion SvXMLExport::getSaneDefaultVersion() const
return mpImpl->maSaveOptions.GetODFSaneDefaultVersion();
// fatal error, use current version as default
- return SvtSaveOptions::ODFSVER_012;
+ return SvtSaveOptions::ODFSVER_LATEST;
}
OUString SvXMLExport::GetStreamName() const
More information about the Libreoffice-commits
mailing list