21#include <ooo/vba/excel/XlFormatConditionOperator.hpp>
22#include <ooo/vba/excel/XFormatCondition.hpp>
23#include <com/sun/star/sheet/XCellRangeAddressable.hpp>
24#include <com/sun/star/sheet/XSheetCondition.hpp>
33template <
typename... Ifc>
35 const uno::Reference<uno::XComponentContext>& xContext,
36 uno::Reference<sheet::XSheetCondition> _xSheetCondition)
38 , mxSheetCondition(
std::move(_xSheetCondition))
43template <
typename... Ifc>
46 sheet::ConditionOperator aRetAPIOperator = sheet::ConditionOperator_NONE;
47 sal_Int32 nOperator = 0;
48 if (_aOperator >>= nOperator)
52 case excel::XlFormatConditionOperator::xlBetween:
53 aRetAPIOperator = sheet::ConditionOperator_BETWEEN;
55 case excel::XlFormatConditionOperator::xlNotBetween:
56 aRetAPIOperator = sheet::ConditionOperator_NOT_BETWEEN;
58 case excel::XlFormatConditionOperator::xlEqual:
59 aRetAPIOperator = sheet::ConditionOperator_EQUAL;
61 case excel::XlFormatConditionOperator::xlNotEqual:
62 aRetAPIOperator = sheet::ConditionOperator_NOT_EQUAL;
64 case excel::XlFormatConditionOperator::xlGreater:
65 aRetAPIOperator = sheet::ConditionOperator_GREATER;
67 case excel::XlFormatConditionOperator::xlLess:
68 aRetAPIOperator = sheet::ConditionOperator_LESS;
70 case excel::XlFormatConditionOperator::xlGreaterEqual:
71 aRetAPIOperator = sheet::ConditionOperator_GREATER_EQUAL;
73 case excel::XlFormatConditionOperator::xlLessEqual:
74 aRetAPIOperator = sheet::ConditionOperator_LESS_EQUAL;
77 aRetAPIOperator = sheet::ConditionOperator_NONE;
81 return aRetAPIOperator;
86 return mxSheetCondition->getFormula1();
91 return mxSheetCondition->getFormula2();
96 sal_Int32 retvalue = -1;
97 sheet::ConditionOperator aConditionalOperator = mxSheetCondition->getOperator();
98 switch (aConditionalOperator)
100 case sheet::ConditionOperator_EQUAL:
101 retvalue = excel::XlFormatConditionOperator::xlEqual;
103 case sheet::ConditionOperator_NOT_EQUAL:
104 retvalue = excel::XlFormatConditionOperator::xlNotEqual;
106 case sheet::ConditionOperator_GREATER:
107 retvalue = excel::XlFormatConditionOperator::xlGreater;
109 case sheet::ConditionOperator_GREATER_EQUAL:
110 retvalue = excel::XlFormatConditionOperator::xlGreaterEqual;
112 case sheet::ConditionOperator_LESS:
113 retvalue = excel::XlFormatConditionOperator::xlLess;
115 case sheet::ConditionOperator_LESS_EQUAL:
116 retvalue = excel::XlFormatConditionOperator::xlLessEqual;
118 case sheet::ConditionOperator_BETWEEN:
119 retvalue = excel::XlFormatConditionOperator::xlBetween;
121 case sheet::ConditionOperator_NOT_BETWEEN:
122 retvalue = excel::XlFormatConditionOperator::xlNotBetween;
124 case sheet::ConditionOperator_FORMULA:
125 if (_bIncludeFormulaValue)
133 case sheet::ConditionOperator_NONE:
static css::sheet::ConditionOperator retrieveAPIOperator(const css::uno::Any &_aOperator)
virtual OUString SAL_CALL Formula1() override
virtual OUString SAL_CALL Formula2() override
css::uno::Reference< css::sheet::XCellRangeAddressable > mxAddressable
virtual sal_Int32 SAL_CALL Operator() override=0
ScVbaCondition(const css::uno::Reference< ov::XHelperInterface > &xParent, const css::uno::Reference< css::uno::XComponentContext > &xContext, css::uno::Reference< css::sheet::XSheetCondition > _xSheetCondition)
#define ERRCODE_BASIC_METHOD_FAILED
const sal_Int32 ISFORMULA