summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2020-04-28 13:56:58 +0200
committerMichael Stahl <michael.stahl@cib.de>2020-05-15 17:50:56 +0200
commit1a60d388b566754d5fe6cee12adf7252a3206167 (patch)
tree815d43b9c2d2f91b30a5729923f8b76cacf78173 /sfx2
parent23a1b7bad5147ee48d7f920085426d8846559af7 (diff)
comphelper,sfx2,dbaccess: add ODFVER_013_TEXT constant
This is used for Version of package in API. Change-Id: I23d162c4dfff2f56c541a7c6c2e21c87ed7d8213 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93087 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/doc/objserv.cxx4
-rw-r--r--sfx2/source/doc/objstor.cxx11
2 files changed, 11 insertions, 4 deletions
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 8212bc25241a..e0b6bf5a4a39 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -1621,7 +1621,7 @@ bool SfxObjectShell::PrepareForSigning(weld::Window* pDialogParent)
OUString aODFVersion(comphelper::OStorageHelper::GetODFVersionFromStorage(GetStorage()));
if ( IsModified() || !GetMedium() || GetMedium()->GetName().isEmpty()
- || (GetMedium()->GetFilter()->IsOwnFormat() && aODFVersion != ODFVER_012_TEXT && !bHasSign) )
+ || (GetMedium()->GetFilter()->IsOwnFormat() && aODFVersion.compareTo(ODFVER_012_TEXT) < 0 && !bHasSign))
{
// the document might need saving ( new, modified or in ODF1.1 format without signature )
@@ -1803,7 +1803,7 @@ bool SfxObjectShell::SignDocumentContentUsingCertificate(const Reference<XCertif
OUString aODFVersion(comphelper::OStorageHelper::GetODFVersionFromStorage(GetStorage()));
if (IsModified() || !GetMedium() || GetMedium()->GetName().isEmpty()
- || (GetMedium()->GetFilter()->IsOwnFormat() && aODFVersion != ODFVER_012_TEXT && !bHasSign))
+ || (GetMedium()->GetFilter()->IsOwnFormat() && aODFVersion.compareTo(ODFVER_012_TEXT) < 0 && !bHasSign))
{
if (nVersion >= SvtSaveOptions::ODFSVER_012)
{
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index d86ace8bba4b..8e04639905ef 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -335,7 +335,14 @@ void SfxObjectShell::SetupStorage( const uno::Reference< embed::XStorage >& xSto
try
{
// older versions can not have this property set, it exists only starting from ODF1.2
- xProps->setPropertyValue("Version", uno::makeAny<OUString>( ODFVER_012_TEXT ) );
+ if (SvtSaveOptions::ODFSVER_013 <= nDefVersion)
+ {
+ xProps->setPropertyValue("Version", uno::makeAny<OUString>(ODFVER_013_TEXT));
+ }
+ else
+ {
+ xProps->setPropertyValue("Version", uno::makeAny<OUString>(ODFVER_012_TEXT));
+ }
}
catch( uno::Exception& )
{
@@ -1163,7 +1170,7 @@ bool SfxObjectShell::SaveTo_Impl
// document, but technically this is not correct, so this prevents old
// signatures to be copied over to a version 1.2 document
bNoPreserveForOasis = (
- (aODFVersion == ODFVER_012_TEXT && nVersion < SvtSaveOptions::ODFSVER_012) ||
+ (0 <= aODFVersion.compareTo(ODFVER_012_TEXT) && nVersion < SvtSaveOptions::ODFSVER_012) ||
(aODFVersion.isEmpty() && nVersion >= SvtSaveOptions::ODFSVER_012)
);
}