[Libreoffice-commits] core.git: sc/inc

Tor Lillqvist tml at collabora.com
Thu Nov 23 20:39:00 UTC 2017


 sc/inc/rangelst.hxx |   17 +++++++++++++++++
 1 file changed, 17 insertions(+)

New commits:
commit 6a8c781df0b4e7760a52693b83e5cd903acd30d4
Author: Tor Lillqvist <tml at collabora.com>
Date:   Thu Nov 23 16:59:06 2017 +0200

    Add debug output operator<< for ScRangeList
    
    Change-Id: I55f16428bbadd45d302ac31df9c1a691730c4a49
    Reviewed-on: https://gerrit.libreoffice.org/45158
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Tor Lillqvist <tml at collabora.com>

diff --git a/sc/inc/rangelst.hxx b/sc/inc/rangelst.hxx
index 19d6d7701e0c..932a5ed52d6d 100644
--- a/sc/inc/rangelst.hxx
+++ b/sc/inc/rangelst.hxx
@@ -22,6 +22,7 @@
 
 #include "global.hxx"
 #include "address.hxx"
+#include <ostream>
 #include <vector>
 #include <sal/types.h>
 
@@ -100,6 +101,22 @@ private:
 };
 typedef tools::SvRef<ScRangeList> ScRangeListRef;
 
+// For use in SAL_DEBUG etc. Output format not guaranteed to be stable.
+template<typename charT, typename traits>
+inline std::basic_ostream<charT, traits> & operator <<(std::basic_ostream<charT, traits> & stream, const ScRangeList& rRangeList)
+{
+    stream << "(";
+    for (size_t i = 0; i < rRangeList.size(); ++i)
+    {
+        if (i > 0)
+            stream << ",";
+        stream << *(rRangeList[i]);
+    }
+    stream << ")";
+
+    return stream;
+}
+
 // RangePairList:
 //    aRange[0]: actual range,
 //    aRange[1]: data for that range, e.g. Rows belonging to a ColName


More information about the Libreoffice-commits mailing list