summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2018-09-14 15:47:24 +0200
committerLuboš Luňák <l.lunak@collabora.com>2018-09-18 16:26:49 +0200
commitb9796d00be8ac90b4e3b8cecbf34a3117bc92ce6 (patch)
treeb413f5ee1df399098cf494235410de8474cd223b /desktop
parente6c998bdc08b9eccaa43eca140efbcffd7b7c4fa (diff)
make sure testOpenCLCompute() doesn't fail because of a stale lockfile
If the lockfile for the testing .ods stays around, e.g. because of a crash, the next loading will fail (because no UI interaction is allowed at that point) and so the whole openCL test will fail. Change-Id: Ic193003f52e407e47cd634773b6eb4cdefcc2753 Reviewed-on: https://gerrit.libreoffice.org/60497 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/app/opencl.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/desktop/source/app/opencl.cxx b/desktop/source/app/opencl.cxx
index 5c991842b94f..f62c93e32e1f 100644
--- a/desktop/source/app/opencl.cxx
+++ b/desktop/source/app/opencl.cxx
@@ -24,6 +24,8 @@
#include <officecfg/Office/Calc.hxx>
#include <officecfg/Office/Common.hxx>
+#include <svl/documentlockfile.hxx>
+
#include <com/sun/star/table/XCell2.hpp>
#include <com/sun/star/sheet/XCalculatable.hpp>
#include <com/sun/star/sheet/XSpreadsheet.hpp>
@@ -54,6 +56,15 @@ static bool testOpenCLCompute(const Reference< XDesktop2 > &xDesktop, const OUSt
SAL_INFO("opencl", "Starting CL test spreadsheet");
+ // A stale lock file would make the loading fail, so make sure to remove it.
+ try {
+ ::svt::DocumentLockFile lockFile( rURL );
+ lockFile.RemoveFileDirectly();
+ }
+ catch (const css::uno::Exception&)
+ {
+ }
+
try {
css::uno::Reference< css::frame::XComponentLoader > xLoader(xDesktop, css::uno::UNO_QUERY_THROW);