summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2021-10-19 19:21:29 +0200
committerMichael Stahl <michael.stahl@allotropia.de>2021-10-20 10:19:20 +0200
commita86b0e83177f15320c4fe2906a0a02486ba60d49 (patch)
tree040d209770869fa6a6a6e0c3d21f966786b600f6 /framework
parent569a389f977faa347ae472167769cdc1718a0118 (diff)
framework: allow tests to run with read-only $SRCDIR
SfxMedium constructor will call QuietInteraction::handle() which invokes abort(), so can't load any documents. (regression from commit 95eb088802562b75f8b299908160145c7e88d763) Change-Id: I7958ad30a06ffea299d70a9a8132eb9ffcf33f43 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123834 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'framework')
-rw-r--r--framework/source/interaction/quietinteraction.cxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/framework/source/interaction/quietinteraction.cxx b/framework/source/interaction/quietinteraction.cxx
index e9dc218576e0..feeecf7c6568 100644
--- a/framework/source/interaction/quietinteraction.cxx
+++ b/framework/source/interaction/quietinteraction.cxx
@@ -24,6 +24,7 @@
#include <com/sun/star/document/XInteractionFilterSelect.hpp>
#include <com/sun/star/document/XInteractionFilterOptions.hpp>
#include <com/sun/star/document/FilterOptionsRequest.hpp>
+#include <com/sun/star/document/ReadOnlyOpenRequest.hpp>
#include <com/sun/star/task/ErrorCodeRequest.hpp>
#include <com/sun/star/document/LockedDocumentRequest.hpp>
@@ -76,6 +77,7 @@ void SAL_CALL QuietInteraction::handle( const css::uno::Reference< css::task::XI
css::task::ErrorCodeRequest aErrorCodeRequest;
css::document::LockedDocumentRequest aLockedDocumentRequest;
css::document::FilterOptionsRequest aFilterOptionsRequest;
+ css::document::ReadOnlyOpenRequest aReadOnlyOpenRequest;
if( aRequest >>= aErrorCodeRequest )
{
@@ -108,6 +110,19 @@ void SAL_CALL QuietInteraction::handle( const css::uno::Reference< css::task::XI
}
}
else
+ if (aRequest >>= aReadOnlyOpenRequest)
+ {
+ // allow unit tests to run on read-only SRCDIR
+ if (xApprove.is())
+ {
+ xApprove->select();
+ }
+ else if (xAbort.is())
+ {
+ xAbort->select();
+ }
+ }
+ else
if (xAbort.is())
xAbort->select();
}