LibreOffice Module scaddins (master) 1
|
Helper class for Any->double conversion, using current language settings. More...
#include <analysishelper.hxx>
Public Member Functions | |
ScaAnyConverter (const css::uno::Reference< css::uno::XComponentContext > &xContext) | |
~ScaAnyConverter () | |
void | init (const css::uno::Reference< css::beans::XPropertySet > &xPropSet) |
Initializing with current language settings. More... | |
bool | getDouble (double &rfResult, const css::uno::Any &rAny) const |
Converts an Any to double (without initialization). More... | |
bool | getDouble (double &rfResult, const css::uno::Reference< css::beans::XPropertySet > &xPropSet, const css::uno::Any &rAny) |
Converts an Any to double (with initialization). More... | |
double | getDouble (const css::uno::Reference< css::beans::XPropertySet > &xPropSet, const css::uno::Any &rAny, double fDefault) |
Converts an Any to double (with initialization). More... | |
bool | getInt32 (sal_Int32 &rnResult, const css::uno::Reference< css::beans::XPropertySet > &xPropSet, const css::uno::Any &rAny) |
Converts an Any to sal_Int32 (with initialization). More... | |
sal_Int32 | getInt32 (const css::uno::Reference< css::beans::XPropertySet > &xPropSet, const css::uno::Any &rAny, sal_Int32 nDefault) |
Converts an Any to sal_Int32 (with initialization). More... | |
Private Member Functions | |
double | convertToDouble (const OUString &rString) const |
Converts a string to double using the number formatter. More... | |
Private Attributes | |
css::uno::Reference< css::util::XNumberFormatter2 > | xFormatter |
sal_Int32 | nDefaultFormat |
bool | bHasValidFormat |
Helper class for Any->double conversion, using current language settings.
Definition at line 824 of file analysishelper.hxx.
|
explicit |
Definition at line 2669 of file analysishelper.cxx.
References xFormatter.
sca::analysis::ScaAnyConverter::~ScaAnyConverter | ( | ) |
Definition at line 2676 of file analysishelper.cxx.
|
private |
Converts a string to double using the number formatter.
If the formatter is not valid, ::rtl::math::stringToDouble() with english separators will be used.
css::lang::IllegalArgumentException | on strings not representing any double value. |
Definition at line 2704 of file analysishelper.cxx.
References bHasValidFormat, nDefaultFormat, and xFormatter.
double sca::analysis::ScaAnyConverter::getDouble | ( | const css::uno::Reference< css::beans::XPropertySet > & | xPropSet, |
const css::uno::Any & | rAny, | ||
double | fDefault | ||
) |
Converts an Any to double (with initialization).
The Any can be empty or contain a double or string.
css::lang::IllegalArgumentException | on other Any types or on invalid strings. |
bool sca::analysis::ScaAnyConverter::getDouble | ( | double & | rfResult, |
const css::uno::Any & | rAny | ||
) | const |
Converts an Any to double (without initialization).
The Any can be empty or contain a double or string.
css::lang::IllegalArgumentException | on other Any types or on invalid strings. |
Referenced by AnalysisAddIn::getAccrint(), AnalysisAddIn::getAccrintm(), AnalysisAddIn::getDelta(), AnalysisAddIn::getErf(), AnalysisAddIn::getGestep(), and AnalysisAddIn::getXirr().
bool sca::analysis::ScaAnyConverter::getDouble | ( | double & | rfResult, |
const css::uno::Reference< css::beans::XPropertySet > & | xPropSet, | ||
const css::uno::Any & | rAny | ||
) |
Converts an Any to double (with initialization).
The Any can be empty or contain a double or string.
css::lang::IllegalArgumentException | on other Any types or on invalid strings. |
sal_Int32 sca::analysis::ScaAnyConverter::getInt32 | ( | const css::uno::Reference< css::beans::XPropertySet > & | xPropSet, |
const css::uno::Any & | rAny, | ||
sal_Int32 | nDefault | ||
) |
Converts an Any to sal_Int32 (with initialization).
The Any can be empty or contain a double or string.
css::lang::IllegalArgumentException | on other Any types or on invalid values or strings. |
bool sca::analysis::ScaAnyConverter::getInt32 | ( | sal_Int32 & | rnResult, |
const css::uno::Reference< css::beans::XPropertySet > & | xPropSet, | ||
const css::uno::Any & | rAny | ||
) |
Converts an Any to sal_Int32 (with initialization).
The Any can be empty or contain a double or string.
css::lang::IllegalArgumentException | on other Any types or on invalid values or strings. |
Referenced by AnalysisAddIn::getBin2Hex(), AnalysisAddIn::getBin2Oct(), AnalysisAddIn::getDateMode(), AnalysisAddIn::getDec2Bin(), AnalysisAddIn::getDec2Hex(), AnalysisAddIn::getDec2Oct(), AnalysisAddIn::getHex2Bin(), AnalysisAddIn::getHex2Oct(), AnalysisAddIn::getOct2Bin(), and AnalysisAddIn::getOct2Hex().
void sca::analysis::ScaAnyConverter::init | ( | const css::uno::Reference< css::beans::XPropertySet > & | xPropSet | ) |
Initializing with current language settings.
css::uno::RuntimeException |
Definition at line 2680 of file analysishelper.cxx.
References bHasValidFormat, nDefaultFormat, and xFormatter.
|
private |
Definition at line 829 of file analysishelper.hxx.
Referenced by convertToDouble(), and init().
|
private |
Definition at line 828 of file analysishelper.hxx.
Referenced by convertToDouble(), and init().
|
private |
Definition at line 827 of file analysishelper.hxx.
Referenced by convertToDouble(), init(), and ScaAnyConverter().