diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-26 17:47:18 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-27 12:19:55 +0200 |
commit | d506ff97c25b5f433aa25d8b373f1a732af493d1 (patch) | |
tree | 600e211e3426a3b43407b01d6f93e5379d608b26 /include/sax | |
parent | 148f45253f75bc724804f3231a0b04b2d453e0c7 (diff) |
add string_view wrappers for rtl::math::stringToDouble
Change-Id: I114bec72cb933238675e539a8388a607226827cd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133455
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/sax')
-rw-r--r-- | include/sax/tools/converter.hxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/sax/tools/converter.hxx b/include/sax/tools/converter.hxx index f435244a9504..c4391a7893fd 100644 --- a/include/sax/tools/converter.hxx +++ b/include/sax/tools/converter.hxx @@ -27,6 +27,7 @@ #include <sax/saxdllapi.h> +#include <rtl/strbuf.hxx> #include <sal/types.h> #include <rtl/ustrbuf.hxx> #include <com/sun/star/util/MeasureUnit.hpp> @@ -184,6 +185,13 @@ public: sal_Int16 nSourceUnit, sal_Int16 nTargetUnit ); + /** convert string to double number (using ::rtl::math) and DO convert from + source unit to target unit. */ + static bool convertDouble( double& rValue, + std::string_view rString, + sal_Int16 nSourceUnit, + sal_Int16 nTargetUnit ); + /** convert string to double number (using ::rtl::math) without unit conversion */ static bool convertDouble(double& rValue, std::u16string_view rString); @@ -281,6 +289,7 @@ public: sal_Int32 nPos ); static double GetConversionFactor(OUStringBuffer& rUnit, sal_Int16 nSourceUnit, sal_Int16 nTargetUnit); + static double GetConversionFactor(OStringBuffer& rUnit, sal_Int16 nSourceUnit, sal_Int16 nTargetUnit); static sal_Int16 GetUnitFromString(std::u16string_view rString, sal_Int16 nDefaultUnit); static sal_Int16 GetUnitFromString(std::string_view rString, sal_Int16 nDefaultUnit); |