Kaydet (Commit) b9796d00 authored tarafından Luboš Luňák's avatar Luboš Luňák

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: 's avatarLuboš Luňák <l.lunak@collabora.com>
üst e6c998bd
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment