diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2017-03-19 21:25:23 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2017-03-19 22:33:10 +0000 |
commit | 2356bfdb1b99a93fcb35fefc0f587158e7d160c2 (patch) | |
tree | 578e2040143754410314b4721743eba6387cc5bf /sfx2 | |
parent | 382f9f744652d6ae1482910ec62513d6ea94863c (diff) |
uitest: add a way to log the UNO commands
Change-Id: Ibbf7fd8e44b0be82e496eab6d98468f03038e60f
Reviewed-on: https://gerrit.libreoffice.org/35441
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/control/unoctitm.cxx | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx index f82460af8160..3d84cc05edab 100644 --- a/sfx2/source/control/unoctitm.cxx +++ b/sfx2/source/control/unoctitm.cxx @@ -18,6 +18,7 @@ */ #include <config_features.h> +#include <config_folders.h> #include <tools/debug.hxx> #include <svl/eitem.hxx> @@ -52,6 +53,7 @@ #include <osl/mutex.hxx> #include <uno/current_context.hxx> #include <vcl/svapp.hxx> +#include <rtl/bootstrap.hxx> #include <sfx2/app.hxx> #include <sfx2/unoctitm.hxx> @@ -601,6 +603,24 @@ void collectUsageInformation(const util::URL& rURL, const uno::Sequence<beans::P theUsageInfo::get().increment(aCommand); } +void collectUIInformation(const util::URL& rURL, const uno::Sequence<beans::PropertyValue>& /*rArgs*/) +{ + static const char* pFile = std::getenv("LO_COLLECT_UIINFO"); + if (!pFile) + return; + + OUString aCommand = rURL.Protocol + rURL.Path; + + OUString aDirPath("${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("bootstrap") ":UserInstallation}/uitest/"); + rtl::Bootstrap::expandMacros(aDirPath); + osl::Directory::createPath(aDirPath); + OUString aFilePath = aDirPath + OUString::fromUtf8(pFile); + + SvFileStream aFile(aFilePath, StreamMode::STD_READWRITE); + aFile.Seek(aFile.Tell() + aFile.remainingSize()); + aFile.WriteLine(OUStringToOString(aCommand, RTL_TEXTENCODING_UTF8)); +} + } void SAL_CALL SfxDispatchController_Impl::dispatch( const css::util::URL& aURL, @@ -608,6 +628,7 @@ void SAL_CALL SfxDispatchController_Impl::dispatch( const css::util::URL& aURL, const css::uno::Reference< css::frame::XDispatchResultListener >& rListener ) { collectUsageInformation(aURL, aArgs); + collectUIInformation(aURL, aArgs); SolarMutexGuard aGuard; if ( |