diff options
-rw-r--r-- | bin/find-mergedlib-can-be-private-symbols.functions.results | 1 | ||||
-rw-r--r-- | include/vcl/uitest/logger.hxx | 3 | ||||
-rw-r--r-- | sfx2/source/control/unoctitm.cxx | 46 | ||||
-rw-r--r-- | vcl/source/uitest/logger.cxx | 45 |
4 files changed, 43 insertions, 52 deletions
diff --git a/bin/find-mergedlib-can-be-private-symbols.functions.results b/bin/find-mergedlib-can-be-private-symbols.functions.results index 3ceead740e10..dde2c8867d9c 100644 --- a/bin/find-mergedlib-can-be-private-symbols.functions.results +++ b/bin/find-mergedlib-can-be-private-symbols.functions.results @@ -9842,7 +9842,6 @@ UITestLogger::UITestLogger() UITestLogger::log(std::basic_string_view<char16_t, std::char_traits<char16_t> >) UITestLogger::logAction(VclPtr<Control> const&, VclEventId) UITestLogger::logAction(vcl::Window* const&, VclEventId) -UITestLogger::logCommand(std::basic_string_view<char16_t, std::char_traits<char16_t> >, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) UITestLogger::logKeyInput(VclPtr<vcl::Window> const&, KeyEvent const&) URIHelper::SetMaybeFileHdl(Link<rtl::OUString*, bool> const&) UnoControl::GetComponentServiceName() const diff --git a/include/vcl/uitest/logger.hxx b/include/vcl/uitest/logger.hxx index bc353ad4ea11..9888fab60493 100644 --- a/include/vcl/uitest/logger.hxx +++ b/include/vcl/uitest/logger.hxx @@ -43,9 +43,6 @@ private: public: UITestLogger(); - void logCommand(std::u16string_view rAction, - const css::uno::Sequence<css::beans::PropertyValue>& rArgs); - void logAction(VclPtr<Control> const& xUIElement, VclEventId nEvent); void logAction(vcl::Window* const& xUIWin, VclEventId nEvent); diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx index 7e82656ab178..484d81cc54bd 100644 --- a/sfx2/source/control/unoctitm.cxx +++ b/sfx2/source/control/unoctitm.cxx @@ -508,14 +508,54 @@ OUString SfxDispatchController_Impl::getSlaveCommand( const css::util::URL& rURL namespace { +OUString parseArguments(std::u16string_view rAction, + const css::uno::Sequence<css::beans::PropertyValue>& rArgs) +{ + OUStringBuffer aBuffer(rAction); + + if (rArgs.hasElements()) + { + aBuffer.append(" {"); + for (const css::beans::PropertyValue& rProp : rArgs) + { + OUString aTypeName = rProp.Value.getValueTypeName(); + + if (aTypeName == "long" || aTypeName == "short") + { + sal_Int32 nValue = 0; + rProp.Value >>= nValue; + aBuffer.append("\"" + rProp.Name + "\": " + OUString::number(nValue) + ", "); + } + else if (aTypeName == "unsigned long") + { + sal_uInt32 nValue = 0; + rProp.Value >>= nValue; + aBuffer.append("\"" + rProp.Name + "\": " + OUString::number(nValue) + ", "); + } + else if (aTypeName == "boolean") + { + bool bValue = false; + rProp.Value >>= bValue; + aBuffer.append("\"" + rProp.Name + "\": "); + if (bValue) + aBuffer.append("True, "); + else + aBuffer.append("False, "); + } + } + aBuffer.append("}"); + } + + return aBuffer.makeStringAndClear(); +} + void collectUIInformation(const util::URL& rURL, const css::uno::Sequence< css::beans::PropertyValue >& rArgs) { static const char* pFile = std::getenv("LO_COLLECT_UIINFO"); if (!pFile) return; - UITestLogger::getInstance().logCommand( - Concat2View("Send UNO Command (\"" + rURL.Complete + "\") "), rArgs); + UITestLogger::getInstance().log(parseArguments(Concat2View("Send UNO Command (\"" + rURL.Complete + "\") "), rArgs)); } } @@ -526,7 +566,7 @@ void SfxDispatchController_Impl::dispatch( const css::util::URL& aURL, { if ( aURL.Protocol == ".uno:") { - CrashReporter::logUnoCommand(aURL.Path); + CrashReporter::logUnoCommand(parseArguments(aURL.Path, aArgs)); } collectUIInformation(aURL, aArgs); diff --git a/vcl/source/uitest/logger.cxx b/vcl/source/uitest/logger.cxx index 3920fcd39061..a034e4da1d5b 100644 --- a/vcl/source/uitest/logger.cxx +++ b/vcl/source/uitest/logger.cxx @@ -79,51 +79,6 @@ UITestLogger::UITestLogger() } } -void UITestLogger::logCommand(std::u16string_view rAction, - const css::uno::Sequence<css::beans::PropertyValue>& rArgs) -{ - if (!mbValid) - return; - - OUStringBuffer aBuffer(rAction); - - if (rArgs.hasElements()) - { - aBuffer.append(" {"); - for (const css::beans::PropertyValue& rProp : rArgs) - { - OUString aTypeName = rProp.Value.getValueTypeName(); - - if (aTypeName == "long" || aTypeName == "short") - { - sal_Int32 nValue = 0; - rProp.Value >>= nValue; - aBuffer.append("\"" + rProp.Name + "\": " + OUString::number(nValue) + ", "); - } - else if (aTypeName == "unsigned long") - { - sal_uInt32 nValue = 0; - rProp.Value >>= nValue; - aBuffer.append("\"" + rProp.Name + "\": " + OUString::number(nValue) + ", "); - } - else if (aTypeName == "boolean") - { - bool bValue = false; - rProp.Value >>= bValue; - aBuffer.append("\"" + rProp.Name + "\": "); - if (bValue) - aBuffer.append("True, "); - else - aBuffer.append("False, "); - } - } - aBuffer.append("}"); - } - - OUString aCommand(aBuffer.makeStringAndClear()); - maStream.WriteLine(OUStringToOString(aCommand, RTL_TEXTENCODING_UTF8)); -} - namespace { // most likely this should be recursive |