[Libreoffice-commits] core.git: 2 commits - include/sfx2 sw/qa xmlsecurity/source xmlsecurity/uiconfig
Xisco Fauli (via logerrit)
logerrit at kemper.freedesktop.org
Wed Sep 2 13:58:28 UTC 2020
include/sfx2/strings.hrc | 4 +-
sw/qa/uitest/writer_tests/data/tdf135018.odt |binary
sw/qa/uitest/writer_tests/trackedChanges.py | 32 +++++++++++++++++
xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx | 15 +++++--
xmlsecurity/uiconfig/ui/digitalsignaturesdialog.ui | 4 +-
5 files changed, 46 insertions(+), 9 deletions(-)
New commits:
commit b6ab2330d97672936edc56de8d6f5b6f772908ff
Author: Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Tue Sep 1 17:30:44 2020 +0200
Commit: Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Wed Sep 2 15:57:56 2020 +0200
tdf#135018: sw: Add UItest
Change-Id: Ia88e28b1569ea69df81d905cb76a6791a887ef3f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101883
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>
diff --git a/sw/qa/uitest/writer_tests/data/tdf135018.odt b/sw/qa/uitest/writer_tests/data/tdf135018.odt
new file mode 100644
index 000000000000..2dc9e2a4da0d
Binary files /dev/null and b/sw/qa/uitest/writer_tests/data/tdf135018.odt differ
diff --git a/sw/qa/uitest/writer_tests/trackedChanges.py b/sw/qa/uitest/writer_tests/trackedChanges.py
index 1fb999e6309f..53a3e2f356a3 100644
--- a/sw/qa/uitest/writer_tests/trackedChanges.py
+++ b/sw/qa/uitest/writer_tests/trackedChanges.py
@@ -226,4 +226,36 @@ class trackedchanges(UITestCase):
xcloseBtn.executeAction("CLICK", tuple())
self.ui_test.close_doc()
+
+ def test_tdf135018(self):
+ self.ui_test.load_file(get_url_for_data_file("tdf135018.odt"))
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
+ document = self.ui_test.get_component()
+
+ self.assertEqual(5, document.CurrentController.PageCount)
+
+ self.ui_test.execute_modeless_dialog_through_command(".uno:AcceptTrackedChanges")
+ xTrackDlg = self.xUITest.getTopFocusWindow()
+ changesList = xTrackDlg.getChild("writerchanges")
+ self.assertEqual(147, len(changesList.getChildren()))
+
+ # Without the fix in place, it would have crashed here
+ xAccBtn = xTrackDlg.getChild("acceptall")
+ xAccBtn.executeAction("CLICK", tuple())
+
+ self.assertEqual(0, len(changesList.getChildren()))
+
+ xUndoBtn = xTrackDlg.getChild("undo")
+ xUndoBtn.executeAction("CLICK", tuple())
+
+ self.assertEqual(147, len(changesList.getChildren()))
+
+ xcloseBtn = xTrackDlg.getChild("close")
+ xcloseBtn.executeAction("CLICK", tuple())
+
+ self.assertEqual(18, document.CurrentController.PageCount)
+
+ self.ui_test.close_doc()
+
# vim: set shiftwidth=4 softtabstop=4 expandtab:
commit e76d021ac44e7bf4de05899dc2694a96470bc707
Author: Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Wed Sep 2 12:37:18 2020 +0200
Commit: Miklos Vajna <vmiklos at collabora.com>
CommitDate: Wed Sep 2 15:57:41 2020 +0200
xmlsecurity: avoid saying OK when the signature is partial
That's reserved for valid signatures (digest match, certificate
validates and the signature covers the whole document).
Also avoid "invalid" in the dialog when the digest matches and the
signature is just incomplete.
This now uses wording which is closer to Acrobat and also uses the same
wording on the infobar and in the dialog.
Change-Id: I26e4781d555b65cf29aa8df2232e286917235dc1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101926
Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
Tested-by: Jenkins
diff --git a/include/sfx2/strings.hrc b/include/sfx2/strings.hrc
index 796418e4cefb..7930e5bbe24e 100644
--- a/include/sfx2/strings.hrc
+++ b/include/sfx2/strings.hrc
@@ -287,8 +287,8 @@
#define STR_READONLY_FINISH_SIGN NC_("STR_READONLY_FINISH_SIGN", "Finish Signing")
#define STR_SIGNATURE_BROKEN NC_("STR_SIGNATURE_BROKEN", "This document has an invalid signature.")
#define STR_SIGNATURE_INVALID NC_("STR_SIGNATURE_INVALID", "The signature was valid, but the document has been modified")
-#define STR_SIGNATURE_NOTVALIDATED NC_("STR_SIGNATURE_NOTVALIDATED", "The signature is OK, but the certificate could not be validated.")
-#define STR_SIGNATURE_PARTIAL_OK NC_("STR_SIGNATURE_PARTIAL_OK", "The signature is OK, but the document is only partially signed.")
+#define STR_SIGNATURE_NOTVALIDATED NC_("STR_SIGNATURE_NOTVALIDATED", "At least one signature has problems: the certificate could not be validated.")
+#define STR_SIGNATURE_PARTIAL_OK NC_("STR_SIGNATURE_PARTIAL_OK", "At least one signature has problems: the document is only partially signed.")
#define STR_SIGNATURE_NOTVALIDATED_PARTIAL_OK NC_("STR_SIGNATURE_NOTVALIDATED_PARTIAL_OK", "The certificate could not be validated and the document is only partially signed.")
#define STR_SIGNATURE_OK NC_("STR_SIGNATURE_OK", "This document is digitally signed and the signature is valid.")
#define STR_SIGNATURE_SHOW NC_("STR_SIGNATURE_SHOW", "Show Signatures")
diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
index 512df9a17460..e90734ed6b08 100644
--- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
+++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
@@ -531,6 +531,7 @@ void DigitalSignaturesDialog::ImplFillSignaturesBox()
size_t nInfos = maSignatureManager.getCurrentSignatureInformations().size();
size_t nValidSigs = 0, nValidCerts = 0;
bool bAllNewSignatures = true;
+ bool bSomePartial = false;
if( nInfos )
{
@@ -607,7 +608,7 @@ void DigitalSignaturesDialog::ImplFillSignaturesBox()
{
if (maSignatureManager.getStore().is())
{
- // XML based.
+ // ZIP based.
bSigValid = DocumentSignatureHelper::checkIfAllFilesAreSigned(
aElementsToBeVerified, rInfo, mode);
}
@@ -619,6 +620,10 @@ void DigitalSignaturesDialog::ImplFillSignaturesBox()
if( bSigValid )
nValidSigs++;
+ else
+ {
+ bSomePartial = true;
+ }
}
OUString sImage;
@@ -672,8 +677,8 @@ void DigitalSignaturesDialog::ImplFillSignaturesBox()
bool bShowInvalidState = nInfos && !bAllSigsValid;
- m_xSigsInvalidImg->set_visible( bShowInvalidState );
- m_xSigsInvalidFI->set_visible( bShowInvalidState );
+ m_xSigsInvalidImg->set_visible( bShowInvalidState && !bSomePartial);
+ m_xSigsInvalidFI->set_visible( bShowInvalidState && !bSomePartial);
bool bShowNotValidatedState = nInfos && bAllSigsValid && !bAllCertsValid;
@@ -682,8 +687,8 @@ void DigitalSignaturesDialog::ImplFillSignaturesBox()
//bAllNewSignatures is always true if we are not in document mode
bool bShowOldSignature = nInfos && bAllSigsValid && bAllCertsValid && !bAllNewSignatures;
- m_xSigsOldSignatureImg->set_visible(bShowOldSignature);
- m_xSigsOldSignatureFI->set_visible(bShowOldSignature);
+ m_xSigsOldSignatureImg->set_visible(bShowOldSignature || bSomePartial);
+ m_xSigsOldSignatureFI->set_visible(bShowOldSignature || bSomePartial);
SignatureHighlightHdl(*m_xSignaturesLB);
}
diff --git a/xmlsecurity/uiconfig/ui/digitalsignaturesdialog.ui b/xmlsecurity/uiconfig/ui/digitalsignaturesdialog.ui
index c72dc96e4895..cf878a21ca4b 100644
--- a/xmlsecurity/uiconfig/ui/digitalsignaturesdialog.ui
+++ b/xmlsecurity/uiconfig/ui/digitalsignaturesdialog.ui
@@ -420,7 +420,7 @@
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="hexpand">True</property>
- <property name="label" translatable="yes" context="digitalsignaturesdialog|oldsignatureft">Not all parts of the document are signed</property>
+ <property name="label" translatable="yes" context="digitalsignaturesdialog|oldsignatureft">At least one signature has problems: the document is only partially signed.</property>
<property name="xalign">0</property>
</object>
<packing>
@@ -433,7 +433,7 @@
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="hexpand">True</property>
- <property name="label" translatable="yes" context="digitalsignaturesdialog|notvalidatedft">Certificate could not be validated</property>
+ <property name="label" translatable="yes" context="digitalsignaturesdialog|notvalidatedft">At least one signature has problems: the certificate could not be validated.</property>
<property name="xalign">0</property>
</object>
<packing>
More information about the Libreoffice-commits
mailing list