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>
This commit is contained in:
@@ -93,15 +93,15 @@ namespace dbtools
|
||||
}
|
||||
|
||||
|
||||
OCharsetMap::CharsetIterator OCharsetMap::findIanaName(const OUString& _rIanaName) const
|
||||
OCharsetMap::CharsetIterator OCharsetMap::findIanaName(std::u16string_view _rIanaName) const
|
||||
{
|
||||
ensureConstructed( );
|
||||
|
||||
rtl_TextEncoding eEncoding = RTL_TEXTENCODING_DONTKNOW;
|
||||
if ( !_rIanaName.isEmpty() )
|
||||
if ( !_rIanaName.empty() )
|
||||
{
|
||||
// byte string conversion
|
||||
OString sMimeByteString( _rIanaName.getStr(), _rIanaName.getLength(), RTL_TEXTENCODING_ASCII_US );
|
||||
OString sMimeByteString = OUStringToOString( _rIanaName, RTL_TEXTENCODING_ASCII_US );
|
||||
// look up
|
||||
eEncoding = rtl_getTextEncodingFromMimeCharset( sMimeByteString.getStr() );
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace dbaui
|
||||
}
|
||||
}
|
||||
|
||||
void CharSetListBox::SelectEntryByIanaName( const OUString& _rIanaName )
|
||||
void CharSetListBox::SelectEntryByIanaName( std::u16string_view _rIanaName )
|
||||
{
|
||||
OCharsetDisplay::const_iterator aFind = m_aCharSets.findIanaName( _rIanaName );
|
||||
if (aFind == m_aCharSets.end())
|
||||
|
||||
@@ -860,8 +860,7 @@ OString ODbDataSourceAdministrationHelper::translatePropertyId( sal_Int32 _nId )
|
||||
aString = indirectPos->second;
|
||||
}
|
||||
|
||||
OString aReturn( aString.getStr(), aString.getLength(), RTL_TEXTENCODING_ASCII_US );
|
||||
return aReturn;
|
||||
return OUStringToOString( aString, RTL_TEXTENCODING_ASCII_US );
|
||||
}
|
||||
template<class T> static bool checkItemType(const SfxPoolItem* pItem){ return dynamic_cast<const T*>(pItem) != nullptr;}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace dbaui
|
||||
public:
|
||||
CharSetListBox(std::unique_ptr<weld::ComboBox> xControl);
|
||||
|
||||
void SelectEntryByIanaName( const OUString& _rIanaName );
|
||||
void SelectEntryByIanaName( std::u16string_view _rIanaName );
|
||||
bool StoreSelectedCharSet( SfxItemSet& _rSet, const sal_uInt16 _nItemId );
|
||||
|
||||
weld::ComboBox* get_widget() { return m_xControl.get(); }
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace dbaui
|
||||
|
||||
// various find operations
|
||||
const_iterator findEncoding(const rtl_TextEncoding _eEncoding) const;
|
||||
const_iterator findIanaName(const OUString& _rIanaName) const;
|
||||
const_iterator findIanaName(std::u16string_view _rIanaName) const;
|
||||
const_iterator findDisplayName(const OUString& _rDisplayName) const;
|
||||
|
||||
/// get access to the first element of the charset collection
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace dbaui
|
||||
return const_iterator( this, aBaseIter );
|
||||
}
|
||||
|
||||
OCharsetDisplay::const_iterator OCharsetDisplay::findIanaName(const OUString& _rIanaName) const
|
||||
OCharsetDisplay::const_iterator OCharsetDisplay::findIanaName(std::u16string_view _rIanaName) const
|
||||
{
|
||||
OCharsetMap::const_iterator aBaseIter = OCharsetMap::findIanaName(_rIanaName);
|
||||
return const_iterator( this, aBaseIter );
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace dbtools
|
||||
/** find the given IANA name in the map.
|
||||
@return the <em>end</em> iterator if the IANA name could not be found.
|
||||
*/
|
||||
CharsetIterator findIanaName(const OUString& _rIanaName) const;
|
||||
CharsetIterator findIanaName(std::u16string_view _rIanaName) const;
|
||||
|
||||
/// get access to the first element of the charset collection
|
||||
CharsetIterator begin() const;
|
||||
|
||||
@@ -559,7 +559,7 @@ namespace svx
|
||||
else
|
||||
sUnoSlotName = "<unknown>";
|
||||
OString sUnoSlotNameAscii = "\"" +
|
||||
OString( sUnoSlotName.getStr(), sUnoSlotName.getLength(), RTL_TEXTENCODING_ASCII_US ) +
|
||||
OUStringToOString( sUnoSlotName, RTL_TEXTENCODING_ASCII_US ) +
|
||||
"\"";
|
||||
#endif
|
||||
|
||||
|
||||
@@ -25,10 +25,10 @@ using namespace com::sun::star::util;
|
||||
|
||||
using namespace http_dav_ucp;
|
||||
|
||||
bool DateTimeHelper::ISO8601_To_DateTime (const OUString& s,
|
||||
bool DateTimeHelper::ISO8601_To_DateTime (std::u16string_view s,
|
||||
DateTime& dateTime)
|
||||
{
|
||||
OString aDT (s.getStr(), s.getLength(), RTL_TEXTENCODING_ASCII_US);
|
||||
OString aDT = OUStringToOString(s, RTL_TEXTENCODING_ASCII_US);
|
||||
|
||||
int year, month, day, hours, minutes, off_hours, off_minutes, fix;
|
||||
double seconds;
|
||||
@@ -155,7 +155,7 @@ sal_Int32 DateTimeHelper::convertMonthToInt(std::u16string_view month)
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool DateTimeHelper::RFC2068_To_DateTime (const OUString& s,
|
||||
bool DateTimeHelper::RFC2068_To_DateTime (std::u16string_view s,
|
||||
DateTime& dateTime)
|
||||
{
|
||||
int year;
|
||||
@@ -166,10 +166,10 @@ bool DateTimeHelper::RFC2068_To_DateTime (const OUString& s,
|
||||
char string_month[3 + 1];
|
||||
char string_day[3 + 1];
|
||||
|
||||
sal_Int32 found = s.indexOf (',');
|
||||
if (found != -1)
|
||||
size_t found = s.find(',');
|
||||
if (found != std::u16string_view::npos)
|
||||
{
|
||||
OString aDT (s.getStr(), s.getLength(), RTL_TEXTENCODING_ASCII_US);
|
||||
OString aDT = OUStringToOString(s, RTL_TEXTENCODING_ASCII_US);
|
||||
|
||||
// RFC 1123
|
||||
found = sscanf (aDT.getStr(), "%3s, %2d %3s %4d %2d:%2d:%2d GMT",
|
||||
@@ -184,7 +184,7 @@ bool DateTimeHelper::RFC2068_To_DateTime (const OUString& s,
|
||||
}
|
||||
else
|
||||
{
|
||||
OString aDT (s.getStr(), s.getLength(), RTL_TEXTENCODING_ASCII_US);
|
||||
OString aDT = OUStringToOString(s, RTL_TEXTENCODING_ASCII_US);
|
||||
|
||||
// ANSI C's asctime () format
|
||||
found = sscanf (aDT.getStr(), "%3s %3s %d %2d:%2d:%2d %4d",
|
||||
@@ -245,7 +245,7 @@ bool DateTimeHelper::RFC2068_To_DateTime (const OUString& s,
|
||||
return found;
|
||||
}
|
||||
|
||||
bool DateTimeHelper::convert (const OUString& s, DateTime& dateTime)
|
||||
bool DateTimeHelper::convert (std::u16string_view s, DateTime& dateTime)
|
||||
{
|
||||
if (ISO8601_To_DateTime (s, dateTime))
|
||||
return true;
|
||||
|
||||
@@ -39,14 +39,14 @@ class DateTimeHelper
|
||||
private:
|
||||
static sal_Int32 convertMonthToInt(std::u16string_view month);
|
||||
|
||||
static bool ISO8601_To_DateTime (const OUString&,
|
||||
static bool ISO8601_To_DateTime (std::u16string_view,
|
||||
css::util::DateTime& );
|
||||
|
||||
static bool RFC2068_To_DateTime (const OUString&,
|
||||
static bool RFC2068_To_DateTime (std::u16string_view,
|
||||
css::util::DateTime& );
|
||||
|
||||
public:
|
||||
static bool convert (const OUString&,
|
||||
static bool convert (std::u16string_view,
|
||||
css::util::DateTime& );
|
||||
};
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ std::string XTextRangeToString(uno::Reference<text::XTextRange> const& textRange
|
||||
result += ")";
|
||||
}
|
||||
|
||||
OString aOStr(aOUStr.getStr(), aOUStr.getLength(), RTL_TEXTENCODING_ASCII_US);
|
||||
OString aOStr = OUStringToOString(aOUStr, RTL_TEXTENCODING_ASCII_US);
|
||||
|
||||
result = aOStr.getStr();
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -186,7 +186,7 @@ namespace chelp {
|
||||
|
||||
void setActiveText( const OUString& Module,
|
||||
const OUString& Language,
|
||||
const OUString& Id,
|
||||
std::u16string_view Id,
|
||||
OStringBuffer& buffer );
|
||||
|
||||
/**
|
||||
|
||||
@@ -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 )
|
||||
{
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ uno::Reference< cssxc::XXMLSecurityContext > SAL_CALL
|
||||
//Initialize the crypto engine
|
||||
if( sCertDB.getLength() > 0 )
|
||||
{
|
||||
sCertDir = OString(sCertDB.getStr(), sCertDB.getLength(), RTL_TEXTENCODING_ASCII_US);
|
||||
sCertDir = OUStringToOString(sCertDB, RTL_TEXTENCODING_ASCII_US);
|
||||
n_pCertStore = sCertDir.getStr();
|
||||
n_hStoreHandle = CertOpenSystemStoreW( 0, o3tl::toW(sCertDB.getStr())) ;
|
||||
if( n_hStoreHandle == nullptr )
|
||||
|
||||
Reference in New Issue
Block a user