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 +#include #include #include @@ -52,6 +53,7 @@ #include #include #include +#include #include #include @@ -601,6 +603,24 @@ void collectUsageInformation(const util::URL& rURL, const uno::Sequence& /*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 (