diff options
author | Noel <noelgrandin@gmail.com> | 2020-10-15 14:26:35 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-10-16 11:12:31 +0200 |
commit | 87c90cec38c43efbbd9cbfad1f0f607f428043d4 (patch) | |
tree | b65b6ccc78a4a922c027f98e4d8ab5251fdf33bb /framework | |
parent | 9b34dc20b6946698ae6ce2d5d859885bfb444633 (diff) |
fix some *printf which are using "%l" ie. long specifiers
which are not portable between Linux and Windows because long
is not portable.
In preparation for converting long -> tools::Long
Change-Id: I8bf1aa1570946ca887a6c83dd5f99c024d437336
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104374
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'framework')
4 files changed, 4 insertions, 20 deletions
diff --git a/framework/source/fwe/xml/menudocumenthandler.cxx b/framework/source/fwe/xml/menudocumenthandler.cxx index d6d459b01453..2509ffa981c7 100644 --- a/framework/source/fwe/xml/menudocumenthandler.cxx +++ b/framework/source/fwe/xml/menudocumenthandler.cxx @@ -183,11 +183,7 @@ void SAL_CALL ReadMenuDocumentHandlerBase::setDocumentLocator( OUString ReadMenuDocumentHandlerBase::getErrorLineString() { if ( m_xLocator.is() ) - { - char buffer[32]; - snprintf( buffer, sizeof(buffer), "Line: %ld - ", static_cast<long>( m_xLocator->getLineNumber() )); - return OUString::createFromAscii( buffer ); - } + return "Line: " + OUString::number( m_xLocator->getLineNumber() ) + " - "; else return OUString(); } diff --git a/framework/source/fwe/xml/saxnamespacefilter.cxx b/framework/source/fwe/xml/saxnamespacefilter.cxx index 6649ed21b98d..fa66360ce334 100644 --- a/framework/source/fwe/xml/saxnamespacefilter.cxx +++ b/framework/source/fwe/xml/saxnamespacefilter.cxx @@ -155,11 +155,7 @@ void SAL_CALL SaxNamespaceFilter::setDocumentLocator( OUString SaxNamespaceFilter::getErrorLineString() { if ( m_xLocator.is() ) - { - char buffer[32]; - snprintf( buffer, sizeof(buffer), "Line: %ld - ", static_cast<long>( m_xLocator->getLineNumber() )); - return OUString::createFromAscii( buffer ); - } + return "Line: " + OUString::number( m_xLocator->getLineNumber() ) + " - "; else return OUString(); } diff --git a/framework/source/fwe/xml/statusbardocumenthandler.cxx b/framework/source/fwe/xml/statusbardocumenthandler.cxx index 5dac16e429fd..2306f4f46737 100644 --- a/framework/source/fwe/xml/statusbardocumenthandler.cxx +++ b/framework/source/fwe/xml/statusbardocumenthandler.cxx @@ -465,11 +465,7 @@ OUString OReadStatusBarDocumentHandler::getErrorLineString() SolarMutexGuard g; if ( m_xLocator.is() ) - { - char buffer[32]; - snprintf( buffer, sizeof(buffer), "Line: %ld - ", static_cast<long>( m_xLocator->getLineNumber() )); - return OUString::createFromAscii( buffer ); - } + return "Line: " + OUString::number( m_xLocator->getLineNumber() ) + " - "; else return OUString(); } diff --git a/framework/source/fwe/xml/toolboxdocumenthandler.cxx b/framework/source/fwe/xml/toolboxdocumenthandler.cxx index 1828dc550190..02999b5cf902 100644 --- a/framework/source/fwe/xml/toolboxdocumenthandler.cxx +++ b/framework/source/fwe/xml/toolboxdocumenthandler.cxx @@ -566,11 +566,7 @@ OUString OReadToolBoxDocumentHandler::getErrorLineString() SolarMutexGuard g; if ( m_xLocator.is() ) - { - char buffer[32]; - snprintf( buffer, sizeof(buffer), "Line: %ld - ", static_cast<long>( m_xLocator->getLineNumber() )); - return OUString::createFromAscii( buffer ); - } + return "Line: " + OUString::number( m_xLocator->getLineNumber() ) + " - "; else return OUString(); } |