diff options
author | Katarina Behrens <Katarina.Behrens@cib.de> | 2017-05-31 18:26:07 +0200 |
---|---|---|
committer | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2017-06-16 16:00:39 +0200 |
commit | 9c48f130ed3d5ed8e1e76231052df28553d399cd (patch) | |
tree | df6bda56c3671c1f82f24d15907e188c17d3a62f /sfx2 | |
parent | 66ef0206967c5b0452fafe4fe75aa8d7f439f5f4 (diff) |
tdf#105566: Account for 'signature used to be ok but isn't anymore'
because the user has modified the document
Change-Id: Ib32ea2ff41f41a81c9a382585f6afbec12fe6a35
Reviewed-on: https://gerrit.libreoffice.org/38284
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
(cherry picked from commit 2e11bbd288ec59d0ff3368cc5c5ef83e2f5133a2)
Reviewed-on: https://gerrit.libreoffice.org/38876
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/doc/objserv.cxx | 36 | ||||
-rw-r--r-- | sfx2/source/view/view.src | 5 |
2 files changed, 22 insertions, 19 deletions
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index edebf6a3cae5..6b5374a694b0 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -1048,6 +1048,11 @@ void SfxObjectShell::GetState_Impl(SfxItemSet &rSet) sMessage = SfxResId(STR_SIGNATURE_BROKEN); aInfoBarType = InfoBarType::Danger; break; + case SignatureState::INVALID: + sMessage = SfxResId(STR_SIGNATURE_INVALID); + // Warning only, I've tried Danger and it looked too scary + aInfoBarType = InfoBarType::Warning; + break; case SignatureState::NOTVALIDATED: sMessage = SfxResId(STR_SIGNATURE_NOTVALIDATED); aInfoBarType = InfoBarType::Warning; @@ -1060,31 +1065,24 @@ void SfxObjectShell::GetState_Impl(SfxItemSet &rSet) sMessage = SfxResId(STR_SIGNATURE_OK); aInfoBarType = InfoBarType::Info; break; + //FIXME SignatureState::Unknown, own message? default: break; } - // new info bar - if ( !pFrame->HasInfoBarWithID("signature") ) - { + if ( pFrame->HasInfoBarWithID("signature") ) + pFrame->RemoveInfoBar("signature"); - if (!sMessage.isEmpty()) - { - auto pInfoBar = pFrame->AppendInfoBar("signature", sMessage, aInfoBarType); - if (pInfoBar == nullptr) - return; - VclPtrInstance<PushButton> xBtn(&(pFrame->GetWindow())); - xBtn->SetText(SfxResId(STR_SIGNATURE_SHOW)); - xBtn->SetSizePixel(xBtn->GetOptimalSize()); - xBtn->SetClickHdl(LINK(this, SfxObjectShell, SignDocumentHandler)); - pInfoBar->addButton(xBtn); - } - } - else // signature info bar exists already + if ( eState != SignatureState::NOSIGNATURES ) { - if (eState == SignatureState::NOSIGNATURES ) - pFrame->RemoveInfoBar("signature"); - //FIXME: Update existing info bar + auto pInfoBar = pFrame->AppendInfoBar("signature", sMessage, aInfoBarType); + if (pInfoBar == nullptr) + return; + VclPtrInstance<PushButton> xBtn(&(pFrame->GetWindow())); + xBtn->SetText(SfxResId(STR_SIGNATURE_SHOW)); + xBtn->SetSizePixel(xBtn->GetOptimalSize()); + xBtn->SetClickHdl(LINK(this, SfxObjectShell, SignDocumentHandler)); + pInfoBar->addButton(xBtn); } } diff --git a/sfx2/source/view/view.src b/sfx2/source/view/view.src index 307e21415784..94f8a5ecbd1f 100644 --- a/sfx2/source/view/view.src +++ b/sfx2/source/view/view.src @@ -137,6 +137,11 @@ String STR_SIGNATURE_BROKEN Text[ en-US ] = "This document has an invalid signature."; }; +String STR_SIGNATURE_INVALID +{ + Text[ en-US ] = "The signature was valid, but the document has been modified"; +}; + String STR_SIGNATURE_NOTVALIDATED { Text[ en-US ] = "The signature is OK, but the certificate could not be validated."; |