summaryrefslogtreecommitdiff
path: root/xmloff/source/core
diff options
context:
space:
mode:
authorNoel <noel.grandin@collabora.co.uk>2020-12-21 12:34:48 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-12-22 08:20:54 +0100
commitdb866805f3eee3a15bc96ffb5ba16aa77a02ddbd (patch)
tree48f8fe6da8cba68b0f4e262de519a42b355934bb /xmloff/source/core
parentdb9f13986fc7ef3d4b44d71459c58e9ea0ae8bcb (diff)
use string_view in ProcessAttribute
Change-Id: I81feb01bf6823d1d8fb5a7da08490959484ef533 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108095 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff/source/core')
-rw-r--r--xmloff/source/core/xmluconv.cxx24
1 files changed, 22 insertions, 2 deletions
diff --git a/xmloff/source/core/xmluconv.cxx b/xmloff/source/core/xmluconv.cxx
index 1517c7b8df86..6cda57185a3b 100644
--- a/xmloff/source/core/xmluconv.cxx
+++ b/xmloff/source/core/xmluconv.cxx
@@ -359,6 +359,13 @@ bool SvXMLUnitConverter::convertDateTime(double& fDateTime,
return convertDateTime(fDateTime, rString, m_pImpl->m_aNullDate);
}
+/** convert ISO Date Time String to double */
+bool SvXMLUnitConverter::convertDateTime(double& fDateTime,
+ std::string_view rString)
+{
+ return convertDateTime(fDateTime, rString, m_pImpl->m_aNullDate);
+}
+
/** convert double to ISO Date Time String */
void SvXMLUnitConverter::convertDateTime( OUStringBuffer& rBuffer,
const double& fDateTime,
@@ -447,8 +454,9 @@ void SvXMLUnitConverter::convertDateTime( OUStringBuffer& rBuffer,
}
/** convert ISO Date Time String to double */
-bool SvXMLUnitConverter::convertDateTime( double& fDateTime,
- std::u16string_view rString, const css::util::Date& aTempNullDate)
+template<typename V>
+static bool lcl_convertDateTime( double& fDateTime,
+ V rString, const css::util::Date& aTempNullDate)
{
css::util::DateTime aDateTime;
bool bSuccess = ::sax::Converter::parseDateTime(aDateTime, rString);
@@ -472,6 +480,18 @@ bool SvXMLUnitConverter::convertDateTime( double& fDateTime,
return bSuccess;
}
+bool SvXMLUnitConverter::convertDateTime( double& fDateTime,
+ std::u16string_view rString, const css::util::Date& aTempNullDate)
+{
+ return lcl_convertDateTime(fDateTime, rString, aTempNullDate);
+}
+/** convert ISO Date Time String to double */
+bool SvXMLUnitConverter::convertDateTime( double& fDateTime,
+ std::string_view rString, const css::util::Date& aTempNullDate)
+{
+ return lcl_convertDateTime(fDateTime, rString, aTempNullDate);
+}
+
SvXMLTokenEnumerator::SvXMLTokenEnumerator( std::u16string_view rString, sal_Unicode cSeparator /* = ' ' */ )
: maTokenString( rString ), mnNextTokenPos(0), mcSeparator( cSeparator )