include/rtl/ustrbuf.hxx       |   15 +++++++++++++++
 vcl/inc/salframe.hxx          |    1 +
 vcl/source/app/salvtables.cxx |   24 ++++++++++++++++++++++++
 3 files changed, 40 insertions(+)

New commits:
commit bf35c2b7f4b9fa18e387e2ee8df518303696e13c
Author:     Jan-Marek Glogowski <glo...@fbihome.de>
AuthorDate: Mon Jun 13 03:53:54 2022 +0200
Commit:     Jan-Marek Glogowski <glo...@fbihome.de>
CommitDate: Tue Jun 21 13:39:40 2022 +0200

    OUStringBuffer: add append via operator<<(T&&)
    
    ... and use it to implement SalFrame::DumpSetPosSize.
    
    Change-Id: I82301f7e1f6641d6167c9577ce9ef44ef8067297
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135808
    Tested-by: Jenkins
    Reviewed-by: Jan-Marek Glogowski <glo...@fbihome.de>

diff --git a/include/rtl/ustrbuf.hxx b/include/rtl/ustrbuf.hxx
index 8c8cc54f8f01..605fb1efb6d0 100644
--- a/include/rtl/ustrbuf.hxx
+++ b/include/rtl/ustrbuf.hxx
@@ -34,6 +34,7 @@
 #if defined LIBO_INTERNAL_ONLY
 #include <string_view>
 #include <type_traits>
+#include <utility>
 #endif
 
 #include "rtl/ustrbuf.h"
@@ -974,6 +975,20 @@ public:
         return pData->buffer + n;
     }
 
+#if defined LIBO_INTERNAL_ONLY
+    /**
+       "Stream" operator to append a value to this OUStringBuffer.
+
+       @internal
+       @since LibreOffice 7.5
+     */
+    template<typename T>
+    OUStringBuffer& operator<<(T&& rValue)
+    {
+        return append(std::forward<T>(rValue));
+    }
+#endif
+
     /**
         Inserts the string into this string buffer.
 
diff --git a/vcl/inc/salframe.hxx b/vcl/inc/salframe.hxx
index 45ed72956656..552d88eb2519 100644
--- a/vcl/inc/salframe.hxx
+++ b/vcl/inc/salframe.hxx
@@ -156,6 +156,7 @@ public:
     virtual void            SetMinClientSize( tools::Long nWidth, tools::Long 
nHeight ) = 0;
     virtual void            SetMaxClientSize( tools::Long nWidth, tools::Long 
nHeight ) = 0;
     virtual void            SetPosSize( tools::Long nX, tools::Long nY, 
tools::Long nWidth, tools::Long nHeight, sal_uInt16 nFlags ) = 0;
+    static OUString DumpSetPosSize(tools::Long nX, tools::Long nY, tools::Long 
nWidth, tools::Long nHeight, sal_uInt16 nFlags);
     virtual void            GetClientSize( tools::Long& rWidth, tools::Long& 
rHeight ) = 0;
     virtual void            GetWorkArea( tools::Rectangle& rRect ) = 0;
     virtual SalFrame*       GetParent() const = 0;
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index b6db52c8b87d..40c04421b8d5 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -111,6 +111,30 @@ void SalFrame::SetRepresentedURL(const OUString&)
     // currently this is Mac only functionality
 }
 
+OUString SalFrame::DumpSetPosSize(tools::Long nX, tools::Long nY, tools::Long 
nWidth,
+                                  tools::Long nHeight, sal_uInt16 nFlags)
+{
+    // assuming the 4 integers normally don't have more then 4 digits, but 
might be negative
+    OUStringBuffer aBuffer(4 * 5 + 5);
+    if (nFlags & SAL_FRAME_POSSIZE_WIDTH)
+        aBuffer << nWidth << "x";
+    else
+        aBuffer << "?x";
+    if (nFlags & SAL_FRAME_POSSIZE_HEIGHT)
+        aBuffer << nHeight << "@(";
+    else
+        aBuffer << "?@(";
+    if (nFlags & SAL_FRAME_POSSIZE_X)
+        aBuffer << nX << ",";
+    else
+        aBuffer << "?,";
+    if (nFlags & SAL_FRAME_POSSIZE_Y)
+        aBuffer << nY << ")";
+    else
+        aBuffer << "?)";
+    return aBuffer.makeStringAndClear();
+}
+
 SalInstance::SalInstance(std::unique_ptr<comphelper::SolarMutex> pMutex)
     : m_pYieldMutex(std::move(pMutex))
 {

Reply via email to