include/vcl/WindowPosSize.hxx |    5 +++--
 include/vcl/windowstate.hxx   |   29 +++++++++++++++++++++++++++++
 vcl/inc/salgeom.hxx           |    2 +-
 3 files changed, 33 insertions(+), 3 deletions(-)

New commits:
commit e2a8b4a420ab0f726c43ec6c609d17211cd6ed11
Author:     Jan-Marek Glogowski <glo...@fbihome.de>
AuthorDate: Sun Jun 12 08:01:32 2022 +0200
Commit:     Jan-Marek Glogowski <glo...@fbihome.de>
CommitDate: Fri Jun 17 20:27:50 2022 +0200

    Fix and add ostreams for vcl::WindowPosSize
    
    ... and inheriting classes.
    
    Follow-up on commit ea5a0918c8c32309821ab239c4b95f4d6a3b5c12
    ("VCL add vcl::WindowPosSize abstract class").
    
    Change-Id: I4733cd4619f91fe1ba05c208a650be591ecf5d8e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135806
    Tested-by: Jenkins
    Reviewed-by: Jan-Marek Glogowski <glo...@fbihome.de>

diff --git a/include/vcl/WindowPosSize.hxx b/include/vcl/WindowPosSize.hxx
index ed52488be33a..6c5484c47b30 100644
--- a/include/vcl/WindowPosSize.hxx
+++ b/include/vcl/WindowPosSize.hxx
@@ -124,9 +124,10 @@ public:
     void setPosSize(const Point& rPos, const Size& rSize) { setPosSize({ rPos, 
rSize }); }
 };
 
-inline std::ostream& operator<<(std::ostream& s, const WindowPosSize& rGeom)
+inline std::ostream& operator<<(std::ostream& s, const WindowPosSize& rPosSize)
 {
-    s << rGeom.width() << "x" << rGeom.height() << "@(" << rGeom.x() << "," << 
rGeom.y() << ")";
+    s << rPosSize.width() << "x" << rPosSize.height() << "@(" << rPosSize.x() 
<< "," << rPosSize.y()
+      << ")";
     return s;
 }
 
diff --git a/include/vcl/windowstate.hxx b/include/vcl/windowstate.hxx
index 772d5c397f76..ed3cbf1a7f6e 100644
--- a/include/vcl/windowstate.hxx
+++ b/include/vcl/windowstate.hxx
@@ -115,6 +115,35 @@ template <> struct typed_flags<vcl::WindowDataMask> : 
is_typed_flags<vcl::Window
 };
 }
 
+namespace vcl
+{
+inline std::ostream& operator<<(std::ostream& s, const WindowData& rData)
+{
+    if (rData.mask() & WindowDataMask::Width)
+        s << rData.width() << "x";
+    else
+        s << "?x";
+    if (rData.mask() & WindowDataMask::Height)
+        s << rData.height() << "@(";
+    else
+        s << "?@(";
+    if (rData.mask() & WindowDataMask::X)
+        s << rData.x() << ",";
+    else
+        s << "?,";
+    if (rData.mask() & WindowDataMask::Y)
+        s << rData.y() << ")^";
+    else
+        s << "?)^";
+    if (rData.mask() & WindowDataMask::State)
+        s << "0x" << std::hex << static_cast<unsigned>(rData.state()) << 
std::dec;
+    else
+        s << "?";
+    return s;
+}
+
+} // namespace vcl
+
 #endif // INCLUDED_VCL_WINDOWSTATE_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/salgeom.hxx b/vcl/inc/salgeom.hxx
index 63675b6d9ceb..1b19931c5c50 100644
--- a/vcl/inc/salgeom.hxx
+++ b/vcl/inc/salgeom.hxx
@@ -98,7 +98,7 @@ public:
 
 inline std::ostream& operator<<(std::ostream& s, const SalFrameGeometry& rGeom)
 {
-    s << static_cast<const vcl::WindowPosSize*>(&rGeom) << ":{" << 
rGeom.leftDecoration() << ","
+    s << *static_cast<const vcl::WindowPosSize*>(&rGeom) << ":{" << 
rGeom.leftDecoration() << ","
       << rGeom.topDecoration() << "," << rGeom.rightDecoration() << "," << 
rGeom.bottomDecoration()
       << "}s" << rGeom.screen();
     return s;

Reply via email to