[Libreoffice-commits] core.git: Branch 'libreoffice-6-0' - include/test
Michael Stahl
mstahl at redhat.com
Tue Jan 16 20:52:28 UTC 2018
include/test/testinteractionhandler.hxx | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
New commits:
commit f638d889eb7e813d4ae6fe1df25e9269c6103022
Author: Michael Stahl <mstahl at redhat.com>
Date: Fri Jan 12 14:49:59 2018 +0100
test: cancel interaction on password *re-entry*
If the password was wrong the first time, it's not going to be
right if we return it a second time. Avoid infinite loops in tests.
Change-Id: Ie4bf92853d0789b0114250f6c8ded1b2c3ab184d
(cherry picked from commit 64592a19e5d512fb5cd09bf0a1726b9c78481e65)
Reviewed-on: https://gerrit.libreoffice.org/48000
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/include/test/testinteractionhandler.hxx b/include/test/testinteractionhandler.hxx
index df4316c18ef0..805d72ba0d0b 100644
--- a/include/test/testinteractionhandler.hxx
+++ b/include/test/testinteractionhandler.hxx
@@ -100,6 +100,7 @@ public:
{
bool bPasswordRequestFound = false;
bool bIsRequestPasswordToModify = false;
+ css::task::PasswordRequestMode mode{};
OString sUrl;
@@ -108,6 +109,7 @@ public:
{
bIsRequestPasswordToModify = passwordRequest2.IsRequestPasswordToModify;
sUrl = passwordRequest2.Name.toUtf8();
+ mode = passwordRequest2.Mode;
bPasswordRequestFound = true;
}
css::task::DocumentMSPasswordRequest2 passwordMSRequest2;
@@ -115,6 +117,7 @@ public:
{
bIsRequestPasswordToModify = passwordMSRequest2.IsRequestPasswordToModify;
sUrl = passwordMSRequest2.Name.toUtf8();
+ mode = passwordMSRequest2.Mode;
bPasswordRequestFound = true;
}
@@ -127,7 +130,13 @@ public:
for (sal_Int32 i = 0; i < rContinuations.getLength(); ++i)
{
- if (bIsRequestPasswordToModify)
+ if (mode == css::task::PasswordRequestMode_PASSWORD_REENTER)
+ { // cancel re-enter of wrong password, to avoid infinite loop
+ css::uno::Reference<css::task::XInteractionAbort> const xAbort(rContinuations[i], css::uno::UNO_QUERY);
+ if (xAbort.is())
+ xAbort->select();
+ }
+ else if (bIsRequestPasswordToModify)
{
css::uno::Reference<css::task::XInteractionPassword2> const xIPW2(rContinuations[i], css::uno::UNO_QUERY);
xIPW2->setPasswordToModify(msPassword);
More information about the Libreoffice-commits
mailing list