bin/find-mergedlib-can-be-private-symbols.functions.results |    1 
 include/vcl/uitest/logger.hxx                               |    3 
 sfx2/source/control/unoctitm.cxx                            |   46 +++++++++++-
 vcl/source/uitest/logger.cxx                                |   45 -----------
 4 files changed, 43 insertions(+), 52 deletions(-)

New commits:
commit c8e3f582a343aceb95f5f4fcc92c82e69127e1fc
Author:     Xisco Fauli <[email protected]>
AuthorDate: Tue Sep 10 10:30:32 2024 +0200
Commit:     Caolán McNamara <[email protected]>
CommitDate: Wed Sep 25 22:31:34 2024 +0200

    Add arguments to Last 4 UNO Commands in CrashReport Dump
    
    Change-Id: I8ea1e95abb62374b51de7b1d37055c216b29e04c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173125
    Reviewed-by: Xisco Fauli <[email protected]>
    Tested-by: Jenkins
    (cherry picked from commit 763b86a5fac81783525442d5ec262e91ca1047ac)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173102
    Reviewed-by: Caolán McNamara <[email protected]>

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

Reply via email to