summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKatarina Behrens <Katarina.Behrens@cib.de>2017-05-31 18:26:07 +0200
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2017-06-08 14:44:25 +0200
commit2e11bbd288ec59d0ff3368cc5c5ef83e2f5133a2 (patch)
tree9115b59dd5c354a8bf3148a59a01707e61780024
parent0632208977a204195a4f5b9e727aed511ece075f (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>
-rw-r--r--include/sfx2/sfx.hrc9
-rw-r--r--sfx2/source/doc/objserv.cxx36
-rw-r--r--sfx2/source/view/view.src5
3 files changed, 27 insertions, 23 deletions
diff --git a/include/sfx2/sfx.hrc b/include/sfx2/sfx.hrc
index 0cab808bd06e..c9de431bd10a 100644
--- a/include/sfx2/sfx.hrc
+++ b/include/sfx2/sfx.hrc
@@ -117,10 +117,11 @@
#define STR_READONLY_SIGN (RID_SFX_START+137)
#define STR_READONLY_PDF (RID_SFX_START+138)
#define STR_SIGNATURE_BROKEN (RID_SFX_START+139)
-#define STR_SIGNATURE_SHOW (RID_SFX_START+140)
-#define STR_SIGNATURE_NOTVALIDATED (RID_SFX_START+141)
-#define STR_SIGNATURE_PARTIAL_OK (RID_SFX_START+142)
-#define STR_SIGNATURE_OK (RID_SFX_START+143)
+#define STR_SIGNATURE_INVALID (RID_SFX_START+140)
+#define STR_SIGNATURE_SHOW (RID_SFX_START+141)
+#define STR_SIGNATURE_NOTVALIDATED (RID_SFX_START+142)
+#define STR_SIGNATURE_PARTIAL_OK (RID_SFX_START+143)
+#define STR_SIGNATURE_OK (RID_SFX_START+144)
// group ids
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.";