summaryrefslogtreecommitdiff
path: root/xmlsecurity
diff options
context:
space:
mode:
authorKatarina Behrens <Katarina.Behrens@cib.de>2017-06-19 15:08:20 +0200
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2017-06-23 09:15:30 +0200
commit7be0d5490517d41c20f99a006edb9fa651ce3d85 (patch)
tree405c4a280e7ae3ea5d711871b954921a77fa931f /xmlsecurity
parent72f84c1a0efbce8da02cbf6d5947d2ddfd45c533 (diff)
gpg4libre: Warn before removing document signatures
simple version, no "do not show this message again" checkbox Change-Id: Iba8ac8cda51acac748174c864aa5c205f2efcc8f Reviewed-on: https://gerrit.libreoffice.org/38962 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'xmlsecurity')
-rw-r--r--xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx13
-rw-r--r--xmlsecurity/source/dialogs/digitalsignaturesdialog.hrc1
-rw-r--r--xmlsecurity/source/dialogs/digitalsignaturesdialog.src5
3 files changed, 18 insertions, 1 deletions
diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
index f52b65dc9917..5f4464b8b957 100644
--- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
+++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
@@ -263,6 +263,8 @@ void DigitalSignaturesDialog::SetSignatureStream( const css::uno::Reference < cs
bool DigitalSignaturesDialog::canAddRemove()
{
+ //FIXME: this func needs some cleanup, such as real split between
+ //'canAdd' and 'canRemove' case
bool ret = true;
if (!maSignatureManager.mxStore.is())
@@ -317,7 +319,16 @@ bool DigitalSignaturesDialog::canAdd()
bool DigitalSignaturesDialog::canRemove()
{
- return canAddRemove();
+ bool bRet = true;
+
+ if ( maSignatureManager.meSignatureMode == DocumentSignatureMode::Content )
+ {
+ short nDlgRet = ScopedVclPtrInstance<MessageDialog>(
+ nullptr, XsResId(STR_XMLSECDLG_QUERY_REALLYREMOVE), VclMessageType::Question, VclButtonsType::YesNo)->Execute();
+ bRet = ( nDlgRet == RET_YES );
+ }
+
+ return (bRet && canAddRemove());
}
short DigitalSignaturesDialog::Execute()
diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.hrc b/xmlsecurity/source/dialogs/digitalsignaturesdialog.hrc
index 25aa5cc6a6ea..5409029f4033 100644
--- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.hrc
+++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.hrc
@@ -25,6 +25,7 @@
#define STR_XMLSECDLG_OLD_ODF_FORMAT RID_DIGITALSIGNATUREDLG_START
#define STR_XMLSECDLG_QUERY_REMOVEDOCSIGNBEFORESIGN (RID_DIGITALSIGNATUREDLG_START + 1)
+#define STR_XMLSECDLG_QUERY_REALLYREMOVE (RID_DIGITALSIGNATUREDLG_START + 2)
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.src b/xmlsecurity/source/dialogs/digitalsignaturesdialog.src
index 11af1e18aac2..448d297d72e3 100644
--- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.src
+++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.src
@@ -35,4 +35,9 @@ String STR_XMLSECDLG_QUERY_REMOVEDOCSIGNBEFORESIGN
"Do you really want to continue?";
};
+String STR_XMLSECDLG_QUERY_REALLYREMOVE
+{
+ Text [ en-US ] = "Document signature cannot be restored, once removed.\n"
+ "Do you really want to remove selected signature?";
+};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */