summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-10-30 08:41:43 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-10-31 07:02:09 +0100
commitab35d2ded153b0129fed16f9a7e882c8600933e6 (patch)
tree13f1776117f743c34761b6a31ca93f80020e20d3 /include
parent877d0c2c211067e8c1b5fdff0f6d9703c94767e9 (diff)
tdf#125688 speed up load of change-tracking ODS
by 10%, by avoiding an OUString construction in a hot path through XMLTextColumnContext_Impl::XMLTextColumnContext_Impl -> sax::Convert::convertNumber Also changed XMLTextAnimationStepPropertyHdl::importXML to take advantage of the modified convertNumber passing convention. Change-Id: I4e5503dbb094c88a09af8b6dc8c22b6c53f9eb75 Reviewed-on: https://gerrit.libreoffice.org/81726 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include')
-rw-r--r--include/rtl/string.h25
-rw-r--r--include/rtl/ustring.h25
-rw-r--r--include/sax/tools/converter.hxx4
3 files changed, 52 insertions, 2 deletions
diff --git a/include/rtl/string.h b/include/rtl/string.h
index 4996e1d07b4d..81322b186875 100644
--- a/include/rtl/string.h
+++ b/include/rtl/string.h
@@ -783,6 +783,31 @@ SAL_DLLPUBLIC sal_uInt32 SAL_CALL rtl_str_toUInt32(
SAL_DLLPUBLIC sal_Int64 SAL_CALL rtl_str_toInt64(
const sal_Char * str, sal_Int16 radix ) SAL_THROW_EXTERN_C();
+/** Interpret a string as a long integer.
+
+ This function cannot be used for language-specific conversion. The string
+ must be null-terminated.
+
+ @param str
+ a null-terminated string.
+
+ @param radix
+ the radix. Must be between RTL_STR_MIN_RADIX (2) and RTL_STR_MAX_RADIX
+ (36), inclusive.
+
+ @param nStrLength
+ number of sal_Chars to process
+
+ @return
+ the long integer value represented by the string, or 0 if the string does
+ not represent a long integer.
+
+ @internal
+ @since LibreOffice 6.4
+*/
+SAL_DLLPUBLIC sal_Int64 SAL_CALL rtl_str_toInt64_WithLength(
+ const sal_Char * str, sal_Int16 radix, sal_Int32 nStrLength ) SAL_THROW_EXTERN_C();
+
/** Interpret a string as an unsigned long integer.
This function cannot be used for language-specific conversion. The string
diff --git a/include/rtl/ustring.h b/include/rtl/ustring.h
index 35e4a7d4ad67..5e481c21c4c4 100644
--- a/include/rtl/ustring.h
+++ b/include/rtl/ustring.h
@@ -1113,6 +1113,31 @@ SAL_DLLPUBLIC sal_uInt32 SAL_CALL rtl_ustr_toUInt32(
SAL_DLLPUBLIC sal_Int64 SAL_CALL rtl_ustr_toInt64(
const sal_Unicode * str, sal_Int16 radix ) SAL_THROW_EXTERN_C();
+/** Interpret a string as a long integer.
+
+ This function cannot be used for language-specific conversion. The string
+ must be null-terminated.
+
+ @param str
+ a null-terminated string.
+
+ @param radix
+ the radix. Must be between RTL_USTR_MIN_RADIX (2) and RTL_USTR_MAX_RADIX
+ (36), inclusive.
+
+ @param nStrLength
+ number of chars to process
+
+ @return
+ the long integer value represented by the string, or 0 if the string does
+ not represent a long integer.
+
+ @internal
+ @since LibreOffice 6.4
+*/
+SAL_DLLPUBLIC sal_Int64 SAL_CALL rtl_ustr_toInt64_WithLength(
+ const sal_Unicode * str, sal_Int16 radix, sal_Int32 nStrLength ) SAL_THROW_EXTERN_C();
+
/** Interpret a string as an unsigned long integer.
This function cannot be used for language-specific conversion. The string
diff --git a/include/sax/tools/converter.hxx b/include/sax/tools/converter.hxx
index d1dbdac62d54..a372360f6d8d 100644
--- a/include/sax/tools/converter.hxx
+++ b/include/sax/tools/converter.hxx
@@ -112,13 +112,13 @@ public:
/** convert string to number with optional min and max values */
static bool convertNumber( sal_Int32& rValue,
- const OUString& rString,
+ std::u16string_view aString,
sal_Int32 nMin = SAL_MIN_INT32,
sal_Int32 nMax = SAL_MAX_INT32 );
/** convert string to number with optional min and max values */
static bool convertNumber64(sal_Int64& rValue,
- const OUString& rString,
+ std::u16string_view aString,
sal_Int64 nMin = SAL_MIN_INT64,
sal_Int64 nMax = SAL_MAX_INT64);