diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2023-01-16 09:29:14 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2023-01-16 10:30:59 +0000 |
commit | e5b86ec34da98d92a749885a06e9093c0f64af80 (patch) | |
tree | 48e5a287d567c37df81aa840973613ee68fd37d5 /oox/source/drawingml/textfield.cxx | |
parent | f025dcc44cffc38720ea1b39c456cf562f1d144d (diff) |
Use o3tl::toInt32 in oox/source/drawingml/textfield.cxx
rtl_ustr_toInt32 was incorrectly used, relying on null-terminated
content of string views.
Change-Id: Ia3e4bb04a029149e5945274f592252704c34f3eb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145549
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Jenkins
Diffstat (limited to 'oox/source/drawingml/textfield.cxx')
-rw-r--r-- | oox/source/drawingml/textfield.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/oox/source/drawingml/textfield.cxx b/oox/source/drawingml/textfield.cxx index 2640aa52ce12..ce38159c5e99 100644 --- a/oox/source/drawingml/textfield.cxx +++ b/oox/source/drawingml/textfield.cxx @@ -121,7 +121,7 @@ void lclCreateTextFields( std::vector< Reference< XTextField > > & aFields, } else if ( o3tl::starts_with(sType, u"file") ) { - int idx = rtl_ustr_toInt32(sType.data() + 4, 10); + int idx = o3tl::toInt32(sType.substr(4)); xIface = xFactory->createInstance( "com.sun.star.text.TextField.FileName" ); aFields.emplace_back( xIface, UNO_QUERY ); Reference< XPropertySet > xProps( xIface, UNO_QUERY_THROW ); @@ -215,7 +215,7 @@ SvxDateFormat TextField::getLODateFormat(std::u16string_view rDateTimeType) if( aDateTimeNum.empty() ) // "datetime" return SvxDateFormat::StdSmall; - int nDateTimeNum = rtl_ustr_toInt32(aDateTimeNum.data(), 10); + int nDateTimeNum = o3tl::toInt32(aDateTimeNum); switch( nDateTimeNum ) { @@ -244,7 +244,7 @@ SvxDateFormat TextField::getLODateFormat(std::u16string_view rDateTimeType) SvxTimeFormat TextField::getLOTimeFormat(std::u16string_view rDateTimeType) { auto aDateTimeNum = rDateTimeType.substr(8); - int nDateTimeNum = rtl_ustr_toInt32(aDateTimeNum.data(), 10); + int nDateTimeNum = o3tl::toInt32(aDateTimeNum); switch( nDateTimeNum ) { |