summaryrefslogtreecommitdiff
path: root/sc/inc/conditio.hxx
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2017-11-23 20:53:42 +0200
committerTor Lillqvist <tml@collabora.com>2017-11-26 09:04:29 +0100
commite2277ac677103255e4b2a79ccb32cb819f41d175 (patch)
tree507db9114aff10f21f4f684b9ee9455946833566 /sc/inc/conditio.hxx
parent10593acac0bc42878fea34fe7da3f389f256c317 (diff)
Add debug output operator<< for ScConditionMode
Change-Id: I031d080dc8cbfcc5619bf7d5ee6112dde0a2ef04 Reviewed-on: https://gerrit.libreoffice.org/45277 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tor Lillqvist <tml@collabora.com>
Diffstat (limited to 'sc/inc/conditio.hxx')
-rw-r--r--sc/inc/conditio.hxx92
1 files changed, 92 insertions, 0 deletions
diff --git a/sc/inc/conditio.hxx b/sc/inc/conditio.hxx
index bad7b3dba18c..7ca023a801f5 100644
--- a/sc/inc/conditio.hxx
+++ b/sc/inc/conditio.hxx
@@ -86,6 +86,98 @@ enum class ScConditionMode
NONE
};
+// 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 ScConditionMode& rMode)
+{
+ switch (rMode)
+ {
+ case ScConditionMode::Equal:
+ stream << "EQUAL";
+ break;
+ case ScConditionMode::Less:
+ stream << "LESS";
+ break;
+ case ScConditionMode::Greater:
+ stream << "GREATER";
+ break;
+ case ScConditionMode::EqLess:
+ stream << "EQLESS";
+ break;
+ case ScConditionMode::EqGreater:
+ stream << "EQGREATER";
+ break;
+ case ScConditionMode::NotEqual:
+ stream << "NOTEQUAL";
+ break;
+ case ScConditionMode::Between:
+ stream << "BETWEEN";
+ break;
+ case ScConditionMode::NotBetween:
+ stream << "NOTBETWEEN";
+ break;
+ case ScConditionMode::Duplicate:
+ stream << "DUPLICATE";
+ break;
+ case ScConditionMode::NotDuplicate:
+ stream << "NOTDUPLICATE";
+ break;
+ case ScConditionMode::Direct:
+ stream << "DIRECT";
+ break;
+ case ScConditionMode::Top10:
+ stream << "TOP10";
+ break;
+ case ScConditionMode::Bottom10:
+ stream << "BOTTOM10";
+ break;
+ case ScConditionMode::TopPercent:
+ stream << "TOPPERCENT";
+ break;
+ case ScConditionMode::BottomPercent:
+ stream << "BOTTOMPERCENT";
+ break;
+ case ScConditionMode::AboveAverage:
+ stream << "ABOVEAVERAGE";
+ break;
+ case ScConditionMode::BelowAverage:
+ stream << "BELOWAVERAGE";
+ break;
+ case ScConditionMode::AboveEqualAverage:
+ stream << "ABOVEEQUALAVERAGE";
+ break;
+ case ScConditionMode::BelowEqualAverage:
+ stream << "BELOWEQUALAVERAGE";
+ break;
+ case ScConditionMode::Error:
+ stream << "ERROR";
+ break;
+ case ScConditionMode::NoError:
+ stream << "NOERROR";
+ break;
+ case ScConditionMode::BeginsWith:
+ stream << "BEGINSWITH";
+ break;
+ case ScConditionMode::EndsWith:
+ stream << "ENDSWITH";
+ break;
+ case ScConditionMode::ContainsText:
+ stream << "CONTAINSTEXT";
+ break;
+ case ScConditionMode::NotContainsText:
+ stream << "NOTCONTAINSTEXT";
+ break;
+ case ScConditionMode::NONE:
+ stream << "NONE";
+ break;
+ default:
+ stream << "?(" << (int)rMode << ")";
+ break;
+ }
+
+ return stream;
+}
+
class ScFormulaListener : public SvtListener
{
private: