summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2017-11-23 16:59:06 +0200
committerTor Lillqvist <tml@collabora.com>2017-11-23 21:38:34 +0100
commit6a8c781df0b4e7760a52693b83e5cd903acd30d4 (patch)
treedccd7e5452db3d489f7335ce793ba76fb5ed2f25 /sc
parent07027b5b8557d8a19bc2d25a3fcfa2b0e180e2ef (diff)
Add debug output operator<< for ScRangeList
Change-Id: I55f16428bbadd45d302ac31df9c1a691730c4a49 Reviewed-on: https://gerrit.libreoffice.org/45158 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tor Lillqvist <tml@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/rangelst.hxx17
1 files changed, 17 insertions, 0 deletions
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