diff options
author | Tor Lillqvist <tml@collabora.com> | 2017-09-14 18:57:46 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2017-09-14 19:01:55 +0300 |
commit | 0b1c92bde2be59dffdfd801b2dbb8d9a68f68526 (patch) | |
tree | b5ea15cbbdd673ba616a748c7388ce920c0429ab | |
parent | 7fdf1663ed8e689e7fb154ab22a9dcb7fc7bf43c (diff) |
Add debugging output operator<< for ScRange
-rw-r--r-- | sc/inc/address.hxx | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/sc/inc/address.hxx b/sc/inc/address.hxx index bc585a359422..8f6ba1f32296 100644 --- a/sc/inc/address.hxx +++ b/sc/inc/address.hxx @@ -652,6 +652,25 @@ public: inline size_t hashStartColumn() const; }; +// 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 ScRange& rRange) +{ + stream << rRange.aStart; + if (rRange.aEnd != rRange.aStart) + { + stream << ":"; + if (rRange.aEnd.Tab() != rRange.aStart.Tab()) + stream << rRange.aEnd; + else + stream << + "R" << rRange.aEnd.Row()+1 << + "C" << rRange.aEnd.Col()+1; + } + + return stream; +} + inline void ScRange::GetVars( SCCOL& nCol1, SCROW& nRow1, SCTAB& nTab1, SCCOL& nCol2, SCROW& nRow2, SCTAB& nTab2 ) const { |