summaryrefslogtreecommitdiff
path: root/xmlhelp
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-04-07 17:53:00 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-04-09 16:28:13 +0200
commit3fbadf2801f4c13f086d76a3ed566180cc0693dc (patch)
tree6ec41f5a137122ce803bb4aa82d2548fe60e337b /xmlhelp
parentf707834e8538c0a183716b26ebdf04381482ca6d (diff)
use more OUStringToOString
which makes it easier to pass around string_view in a few places. Change-Id: Icbbb7f56494986582f1c3272404775bd98031240 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150129 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmlhelp')
-rw-r--r--xmlhelp/source/cxxhelp/provider/databases.cxx6
-rw-r--r--xmlhelp/source/cxxhelp/provider/databases.hxx2
-rw-r--r--xmlhelp/source/cxxhelp/provider/urlparameter.cxx4
-rw-r--r--xmlhelp/source/cxxhelp/test/searchdemo.cxx2
4 files changed, 7 insertions, 7 deletions
diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx
index 23ea6db661ee..be5f964ca292 100644
--- a/xmlhelp/source/cxxhelp/provider/databases.cxx
+++ b/xmlhelp/source/cxxhelp/provider/databases.cxx
@@ -626,7 +626,7 @@ void KeywordInfo::KeywordElement::init( Databases const *pDatabases,helpdatafile
if( pHdf )
{
- OString idi( id[i].getStr(),id[i].getLength(),RTL_TEXTENCODING_UTF8 );
+ OString idi = OUStringToOString( id[i], RTL_TEXTENCODING_UTF8 );
bool bSuccess = pHdf->getValueForKey( idi, aHDFData );
if( bSuccess )
pData = aHDFData.getData();
@@ -1041,13 +1041,13 @@ void Databases::cascadingStylesheet( const OUString& Language,
void Databases::setActiveText( const OUString& Module,
const OUString& Language,
- const OUString& Id,
+ std::u16string_view Id,
OStringBuffer& buffer )
{
DataBaseIterator aDbIt( m_xContext, *this, Module, Language, true );
// #i84550 Cache information about failed ids
- OString id( Id.getStr(),Id.getLength(),RTL_TEXTENCODING_UTF8 );
+ OString id = OUStringToOString( Id, RTL_TEXTENCODING_UTF8 );
EmptyActiveTextSet::iterator it = m_aEmptyActiveTextSet.find( id );
bool bFoundAsEmpty = ( it != m_aEmptyActiveTextSet.end() );
helpdatafileproxy::HDFData aHDFData;
diff --git a/xmlhelp/source/cxxhelp/provider/databases.hxx b/xmlhelp/source/cxxhelp/provider/databases.hxx
index dbf38e022e70..1711cba5278c 100644
--- a/xmlhelp/source/cxxhelp/provider/databases.hxx
+++ b/xmlhelp/source/cxxhelp/provider/databases.hxx
@@ -186,7 +186,7 @@ namespace chelp {
void setActiveText( const OUString& Module,
const OUString& Language,
- const OUString& Id,
+ std::u16string_view Id,
OStringBuffer& buffer );
/**
diff --git a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx
index 493618621c46..6f92fae77db8 100644
--- a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx
+++ b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx
@@ -102,7 +102,7 @@ OString URLParameter::getByName( const char* par )
else if( strcmp( par,"HelpPrefix" ) == 0 )
val = m_aPrefix;
- return OString( val.getStr(),val.getLength(),RTL_TEXTENCODING_UTF8 );
+ return OUStringToOString( val, RTL_TEXTENCODING_UTF8 );
}
@@ -255,7 +255,7 @@ void URLParameter::readHelpDataFile()
if( !pHdf )
break;
- OString keyStr( m_aId.getStr(),m_aId.getLength(),RTL_TEXTENCODING_UTF8 );
+ OString keyStr = OUStringToOString( m_aId,RTL_TEXTENCODING_UTF8 );
bSuccess = pHdf->getValueForKey( keyStr, aHDFData );
if( bSuccess )
{
diff --git a/xmlhelp/source/cxxhelp/test/searchdemo.cxx b/xmlhelp/source/cxxhelp/test/searchdemo.cxx
index cfe1a51ee369..1300e68e6126 100644
--- a/xmlhelp/source/cxxhelp/test/searchdemo.cxx
+++ b/xmlhelp/source/cxxhelp/test/searchdemo.cxx
@@ -41,7 +41,7 @@ extern RandomAccessStream* theFile();
void print_rtl_OUString( const OUString bla )
{
- OString bluber = OString( bla.getStr(),bla.getLength(),RTL_TEXTENCODING_UTF8 );
+ OString bluber = OUStringToOString( bla,RTL_TEXTENCODING_UTF8 );
char* bluberChr = new char[ 1+bluber.getLength() ];
const char* jux = bluber.getStr();