[Libreoffice-commits] core.git: 4 commits - include/unotools sc/inc sc/source
Tor Lillqvist
tml at collabora.com
Fri Aug 4 11:24:14 UTC 2017
include/unotools/textsearch.hxx | 28 ++++++++++++++++++++++
sc/inc/address.hxx | 14 +++++++++++
sc/inc/queryparam.hxx | 49 ++++++++++++++++++++++++++++++++++++++++
sc/source/core/inc/interpre.hxx | 15 ++++++++++++
4 files changed, 106 insertions(+)
New commits:
commit 3dd30f7ec568852ffd95932b486d0a09a2021d71
Author: Tor Lillqvist <tml at collabora.com>
Date: Fri Aug 4 13:47:39 2017 +0300
Add debug output operator<< for ParamIfsResult
Change-Id: I82cfed0d86c42feabb646301b399695ed71308ed
diff --git a/sc/source/core/inc/interpre.hxx b/sc/source/core/inc/interpre.hxx
index 7fa41cb9a561..113cf6aa4ec6 100644
--- a/sc/source/core/inc/interpre.hxx
+++ b/sc/source/core/inc/interpre.hxx
@@ -40,6 +40,7 @@
#include <memory>
#include <vector>
#include <limits>
+#include <ostream>
class ScDocument;
class SbxVariable;
@@ -72,6 +73,20 @@ struct ParamIfsResult
double mfMax = std::numeric_limits<double>::lowest();
};
+template<typename charT, typename traits>
+inline std::basic_ostream<charT, traits> & operator <<(std::basic_ostream<charT, traits> & stream, const ParamIfsResult& rRes)
+{
+ stream << "{" <<
+ "sum=" << rRes.mfSum << "," <<
+ "mem=" << rRes.mfMem << "," <<
+ "count=" << rRes.mfCount << "," <<
+ "min=" << rRes.mfMin << "," <<
+ "max=" << rRes.mfMax << "," <<
+ "}";
+
+ return stream;
+}
+
}
namespace svl {
commit 1717f57705770ebbfac625945478d0e07e816965
Author: Tor Lillqvist <tml at collabora.com>
Date: Fri Aug 4 13:07:46 2017 +0300
Add debug output operator<< for ScQueryParam and its base classes
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 };
commit e34df1a0607f51b8e1168fdfeb8703c9e4e9dd6b
Author: Tor Lillqvist <tml at collabora.com>
Date: Fri Aug 4 13:00:41 2017 +0300
Add debug output operator<< for ScAddress
diff --git a/sc/inc/address.hxx b/sc/inc/address.hxx
index a13f3e9ddb62..3aab8862ecbd 100644
--- a/sc/inc/address.hxx
+++ b/sc/inc/address.hxx
@@ -24,6 +24,8 @@
#include <rtl/strbuf.hxx>
#include <limits>
+#include <ostream>
+
#include "scdllapi.h"
#include "types.hxx"
#include <formula/grammar.hxx>
@@ -355,6 +357,18 @@ public:
OUString GetColRowString() 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 ScAddress& rAddress)
+{
+ stream <<
+ rAddress.Tab() << "!" <<
+ "R" << rAddress.Row() <<
+ "C" << rAddress.Col();
+
+ return stream;
+}
+
inline void ScAddress::PutInOrder( ScAddress& rAddress )
{
if ( rAddress.Col() < Col() )
commit bf234dc9cd0481c241bbb0f755264562ee89d568
Author: Tor Lillqvist <tml at collabora.com>
Date: Fri Aug 4 12:58:33 2017 +0300
Add debug output operator<< for SearchParam::SearchType
diff --git a/include/unotools/textsearch.hxx b/include/unotools/textsearch.hxx
index 46cc358584df..dfe563d831d0 100644
--- a/include/unotools/textsearch.hxx
+++ b/include/unotools/textsearch.hxx
@@ -27,6 +27,8 @@
#include <com/sun/star/lang/Locale.hpp>
#include <com/sun/star/util/XTextSearch2.hpp>
+#include <ostream>
+
class CharClass;
namespace com {
@@ -133,6 +135,32 @@ public:
TransliterationFlags GetTransliterationFlags() const { return nTransliterationFlags; }
};
+// 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 SearchParam::SearchType& eType)
+{
+ switch (eType)
+ {
+ case SearchParam::SearchType::Normal:
+ stream << "N";
+ break;
+ case SearchParam::SearchType::Regexp:
+ stream << "RE";
+ break;
+ case SearchParam::SearchType::Wildcard:
+ stream << "WC";
+ break;
+ case SearchParam::SearchType::Unknown:
+ stream << "UNK";
+ break;
+ default:
+ stream << static_cast<int>(eType) << '?';
+ break;
+ }
+
+ return stream;
+}
+
// Utility class for searching a substring in a string.
// The following metrics are supported
// - ordinary text (Bayer/Moore)
More information about the Libreoffice-commits
mailing list