summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2017-08-04 13:07:46 +0300
committerTor Lillqvist <tml@collabora.com>2017-08-04 13:07:46 +0300
commit1717f57705770ebbfac625945478d0e07e816965 (patch)
tree8c980540a433a5454333b79ddb3e8331df15f9a8
parente34df1a0607f51b8e1168fdfeb8703c9e4e9dd6b (diff)
Add debug output operator<< for ScQueryParam and its base classes
-rw-r--r--sc/inc/queryparam.hxx49
1 files changed, 49 insertions, 0 deletions
diff --git a/sc/inc/queryparam.hxx b/sc/inc/queryparam.hxx
index 16b4573c9fa6..a96375a8002e 100644
--- a/sc/inc/queryparam.hxx
+++ b/sc/inc/queryparam.hxx
@@ -26,6 +26,7 @@
#include <memory>
#include <vector>
+#include <ostream>
class SvNumberFormatter;
@@ -79,6 +80,23 @@ protected:
EntriesType m_Entries;
};
+// 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 ScQueryParamBase& rParam)
+{
+ stream << "{" <<
+ "searchType=" << rParam.eSearchType <<
+ ",hasHeader=" << (rParam.bHasHeader?"YES":"NO") <<
+ ",byRow=" << (rParam.bByRow?"YES":"NO") <<
+ ",inplace=" << (rParam.bInplace?"YES":"NO") <<
+ ",caseSens=" << (rParam.bCaseSens?"YES":"NO") <<
+ ",duplicate=" << (rParam.bDuplicate?"YES":"NO") <<
+ ",rangeLookup=" << (rParam.mbRangeLookup?"YES":"NO") <<
+ "}";
+
+ return stream;
+}
+
struct ScQueryParamTable
{
SCCOL nCol1;
@@ -92,6 +110,21 @@ struct ScQueryParamTable
virtual ~ScQueryParamTable();
};
+// 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 ScQueryParamTable& rParam)
+{
+ stream << "{" <<
+ "col1=" << rParam.nCol1 <<
+ ",row1=" << rParam.nRow1 <<
+ ",col2=" << rParam.nCol2 <<
+ ",row2=" << rParam.nRow2 <<
+ ",tab=" << rParam.nTab <<
+ "}";
+
+ return stream;
+}
+
struct SC_DLLPUBLIC ScQueryParam : public ScQueryParamBase, public ScQueryParamTable
{
bool bDestPers; // not saved
@@ -111,6 +144,22 @@ struct SC_DLLPUBLIC ScQueryParam : public ScQueryParamBase, public ScQueryParamT
void MoveToDest();
};
+// 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 ScQueryParam& rParam)
+{
+ stream << "{" <<
+ "base=" << *(static_cast<const ScQueryParamBase*>(&rParam)) <<
+ ",table=" << *(static_cast<const ScQueryParamTable*>(&rParam)) <<
+ ",destPers=" << (rParam.bDestPers?"YES":"NO") <<
+ ",destTab=" << rParam.nDestTab <<
+ ",destCol=" << rParam.nDestCol <<
+ ",destRow=" << rParam.nDestRow <<
+ "}";
+
+ return stream;
+}
+
struct ScDBQueryParamBase : public ScQueryParamBase
{
enum DataType { INTERNAL, MATRIX };