summaryrefslogtreecommitdiff
path: root/sfx2/source/doc/docfile.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sfx2/source/doc/docfile.cxx')
-rw-r--r--sfx2/source/doc/docfile.cxx15
1 files changed, 9 insertions, 6 deletions
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 2d8290a6476a..ff0380f72b6a 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -4388,6 +4388,8 @@ void SfxMedium::SignContents_Impl(weld::Window* pDialogParent,
throw uno::RuntimeException();
}
+ auto xModelSigner = dynamic_cast<sfx2::DigitalSignatures*>(xSigner.get());
+ assert(xModelSigner);
if ( bSignScriptingContent )
{
// If the signature has already the document signature it will be removed
@@ -4401,8 +4403,10 @@ void SfxMedium::SignContents_Impl(weld::Window* pDialogParent,
// xWriteableZipStor because a writable storage can't have 2
// instances of sub-storage for the same directory open, but with
// independent storages it somehow works
- if (xSigner->signScriptingContent(GetScriptingStorageToSign_Impl(), xStream))
- {
+ xModelSigner->SignScriptingContentAsync(
+ GetScriptingStorageToSign_Impl(), xStream,
+ [this, xSigner, xMetaInf, xWriteableZipStor,
+ onSignDocumentContentFinished](bool bRet) {
// remove the document signature if any
OUString aDocSigName = xSigner->getDocumentContentSignatureDefaultStreamName();
if ( !aDocSigName.isEmpty() && xMetaInf->hasByName( aDocSigName ) )
@@ -4429,13 +4433,12 @@ void SfxMedium::SignContents_Impl(weld::Window* pDialogParent,
|| !uno::Reference<util::XModifiable>(pImpl->xStorage, uno::UNO_QUERY_THROW)->isModified());
// the temporary file has been written, commit it to the original file
Commit();
- bChanges = true;
- }
+ onSignDocumentContentFinished(bRet);
+ });
+ return;
}
else
{
- auto xModelSigner = dynamic_cast<sfx2::DigitalSignatures*>(xSigner.get());
- assert(xModelSigner);
if (xMetaInf.is())
{
// ODF.