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-27 09:15:21 +0200
commit766674f61461cd304aa5e58d53e6271c5ce96862 (patch)
treef2c8c1e74edfe0c45c6e15c06f76032cefe5b2d1 /xmlsecurity
parent5119d81e41e9c7199d3f419e24cba81537edff55 (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> (cherry picked from commit 7be0d5490517d41c20f99a006edb9fa651ce3d85) Reviewed-on: https://gerrit.libreoffice.org/39147 Reviewed-by: Heiko Tietze <tietze.heiko@googlemail.com> Reviewed-by: Sophie Gautier <gautier.sophie@gmail.com>
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: */