summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2020-04-28 13:56:58 +0200
committerJan Holesovsky <kendy@collabora.com>2021-01-07 16:32:53 +0100
commit3b20e43f78a72c13290d8e4202fa9f5034cf40a8 (patch)
tree88fa5f65aaea7599d8e6283342cb080cf20e2052 /sfx2
parent3e0b32251cb43521c5d20f5d1af540919562d3e5 (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 206efc5cf53d..619054815bff 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -1752,7 +1752,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 )
@@ -1934,7 +1934,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 b8ed4797ff3a..92101e989ccc 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -357,7 +357,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& )
{
@@ -1185,7 +1192,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)
);
}