summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2020-04-22 16:18:10 +0200
committerMichael Stahl <michael.stahl@cib.de>2020-05-08 18:38:01 +0200
commite43ad1a8ae20cbd00c5c3346e1810196af6669a6 (patch)
tree6d4a7134edec7f4f302cbbbf546443aaabcf4d06 /xmloff
parent3a0a88083dc992015a64216bac94822af8eef6c1 (diff)
xmloff: GetEarliestODFVersionForExport(-1) is impossible
Remove defensive programming nonsense to deal with situation that has apparently never been possible in git history. Change-Id: I3788cdcec5e1b4afa27e294ed91825bb33e8e633 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92729 Reviewed-by: Michael Stahl <michael.stahl@cib.de> Tested-by: Jenkins
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/style/xmlexppr.cxx5
-rw-r--r--xmloff/source/style/xmlprmap.cxx8
2 files changed, 5 insertions, 8 deletions
diff --git a/xmloff/source/style/xmlexppr.cxx b/xmloff/source/style/xmlexppr.cxx
index 2ca0e49df077..e94f6744b12d 100644
--- a/xmloff/source/style/xmlexppr.cxx
+++ b/xmloff/source/style/xmlexppr.cxx
@@ -586,10 +586,9 @@ vector<XMLPropertyState> SvXMLExportPropertyMapper::Filter_(
( (0 != (nFlags & MID_FLAG_MUST_EXIST)) ||
xInfo->hasPropertyByName( rAPIName ) ) )
{
- const std::optional<SvtSaveOptions::ODFSaneDefaultVersion> oEarliestODFVersionForExport(
+ const SvtSaveOptions::ODFSaneDefaultVersion nEarliestODFVersionForExport(
mpImpl->mxPropMapper->GetEarliestODFVersionForExport(i));
- if (!oEarliestODFVersionForExport
- || nCurrentVersion >= *oEarliestODFVersionForExport)
+ if (nEarliestODFVersionForExport <= nCurrentVersion)
{
pFilterInfo->AddProperty(rAPIName, i);
}
diff --git a/xmloff/source/style/xmlprmap.cxx b/xmloff/source/style/xmlprmap.cxx
index 905b068dff01..b3111441ef6a 100644
--- a/xmloff/source/style/xmlprmap.cxx
+++ b/xmloff/source/style/xmlprmap.cxx
@@ -192,13 +192,11 @@ sal_Int16 XMLPropertySetMapper::GetEntryContextId( sal_Int32 nIndex ) const
return nIndex == -1 ? 0 : mpImpl->maMapEntries[nIndex].nContextId;
}
-std::optional<SvtSaveOptions::ODFSaneDefaultVersion>
+SvtSaveOptions::ODFSaneDefaultVersion
XMLPropertySetMapper::GetEarliestODFVersionForExport(sal_Int32 const nIndex) const
{
- assert((-1 <= nIndex) && (nIndex < static_cast<sal_Int32>(mpImpl->maMapEntries.size())));
- return nIndex == -1
- ? std::optional<SvtSaveOptions::ODFSaneDefaultVersion>()
- : std::optional<SvtSaveOptions::ODFSaneDefaultVersion>(mpImpl->maMapEntries[nIndex].nEarliestODFVersionForExport);
+ assert((0 <= nIndex) && (nIndex < static_cast<sal_Int32>(mpImpl->maMapEntries.size())));
+ return mpImpl->maMapEntries[nIndex].nEarliestODFVersionForExport;
}
const XMLPropertyHandler* XMLPropertySetMapper::GetPropertyHandler( sal_Int32 nIndex ) const