diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-04-24 11:37:48 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-04-24 18:04:50 +0200 |
commit | 5c1561561a859c561fb2321420f1abb7f1cedde3 (patch) | |
tree | 7a96cf8b32bd4c088298df3c4067f0d81f549057 /helpcompiler | |
parent | 5e6d8efbf3fb456ca370df04b21d2e340d9831ad (diff) |
loplugin:unnecessarygetstr extend to more std::string checking
suggested by mike kaganski
Change-Id: I5f5f254142767aca45a6101abdd84a0163ca6a34
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150936
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'helpcompiler')
-rw-r--r-- | helpcompiler/inc/HelpCompiler.hxx | 4 | ||||
-rw-r--r-- | helpcompiler/source/HelpLinker.cxx | 18 |
2 files changed, 10 insertions, 12 deletions
diff --git a/helpcompiler/inc/HelpCompiler.hxx b/helpcompiler/inc/HelpCompiler.hxx index 04562e9c41a7..985d207529d0 100644 --- a/helpcompiler/inc/HelpCompiler.hxx +++ b/helpcompiler/inc/HelpCompiler.hxx @@ -72,7 +72,7 @@ namespace fs osl::File::getSystemPathFromFileURL(data, ustrSystemPath); OString tmp(OUStringToOString(ustrSystemPath, FileNameEnc())); HCDBG(std::cerr << "native_file_string is " << tmp.getStr() << std::endl); - return std::string(tmp.getStr()); + return std::string(tmp); } #ifdef _WIN32 std::wstring native_file_string_w() const @@ -85,7 +85,7 @@ namespace fs std::string toUTF8() const { OString tmp(OUStringToOString(data, RTL_TEXTENCODING_UTF8)); - return std::string(tmp.getStr()); + return std::string(tmp); } bool empty() const { return data.isEmpty(); } path operator/(const std::string &in) const diff --git a/helpcompiler/source/HelpLinker.cxx b/helpcompiler/source/HelpLinker.cxx index 708f12a64114..3d52834dbe6b 100644 --- a/helpcompiler/source/HelpLinker.cxx +++ b/helpcompiler/source/HelpLinker.cxx @@ -71,14 +71,14 @@ IndexerPreProcessor::~IndexerPreProcessor() static std::string getEncodedPath( const std::string& Path ) { - std::string_view aOStr_Path( Path.c_str() ); + std::string_view aOStr_Path( Path ); OUString aOUStr_Path( OStringToOUString ( aOStr_Path, osl_getThreadTextEncoding() ) ); OUString aPathURL; osl::File::getFileURLFromSystemPath( aOUStr_Path, aPathURL ); OString aOStr_PathURL( OUStringToOString ( aPathURL, osl_getThreadTextEncoding() ) ); - std::string aStdStr_PathURL( aOStr_PathURL.getStr() ); + std::string aStdStr_PathURL( aOStr_PathURL ); return aStdStr_PathURL; } @@ -749,7 +749,7 @@ void HelpLinker::main( std::vector<std::string> &args, OString aOStr_IdxCaptionPathFileURL( OUStringToOString ( aIdxCaptionPathFileURL, osl_getThreadTextEncoding() ) ); - std::string aStdStr_IdxCaptionPathFileURL( aOStr_IdxCaptionPathFileURL.getStr() ); + std::string aStdStr_IdxCaptionPathFileURL( aOStr_IdxCaptionPathFileURL ); idxCaptionStylesheet = fs::path( aStdStr_IdxCaptionPathFileURL ); } @@ -773,7 +773,7 @@ void HelpLinker::main( std::vector<std::string> &args, OString aOStr_IdxContentPathFileURL( OUStringToOString ( aIdxContentPathFileURL, osl_getThreadTextEncoding() ) ); - std::string aStdStr_IdxContentPathFileURL( aOStr_IdxContentPathFileURL.getStr() ); + std::string aStdStr_IdxContentPathFileURL( aOStr_IdxContentPathFileURL ); idxContentStylesheet = fs::path( aStdStr_IdxContentPathFileURL ); } @@ -834,10 +834,8 @@ static void StructuredXMLErrorFunction(SAL_UNUSED_PARAMETER void *, xmlErrorPtr HelpProcessingErrorInfo& HelpProcessingErrorInfo::operator=( const struct HelpProcessingException& e ) { m_eErrorClass = e.m_eErrorClass; - std::string_view tmpErrorMsg( e.m_aErrorMsg.c_str() ); - m_aErrorMsg = OStringToOUString( tmpErrorMsg, osl_getThreadTextEncoding() ); - std::string_view tmpXMLParsingFile( e.m_aXMLParsingFile.c_str() ); - m_aXMLParsingFile = OStringToOUString( tmpXMLParsingFile, osl_getThreadTextEncoding() ); + m_aErrorMsg = OStringToOUString( std::string_view(e.m_aErrorMsg), osl_getThreadTextEncoding() ); + m_aXMLParsingFile = OStringToOUString( std::string_view(e.m_aXMLParsingFile), osl_getThreadTextEncoding() ); m_nXMLParsingLine = e.m_nXMLParsingLine; return *this; } @@ -860,14 +858,14 @@ bool compileExtensionHelp args.reserve(nXhpFileCount + 2); args.push_back(std::string("-mod")); OString aOExtensionName = OUStringToOString( aExtensionName, osl_getThreadTextEncoding() ); - args.push_back(std::string(aOExtensionName.getStr())); + args.push_back(std::string(aOExtensionName)); for( sal_Int32 iXhp = 0 ; iXhp < nXhpFileCount ; ++iXhp ) { OUString aXhpFile = pXhpFiles[iXhp]; OString aOXhpFile = OUStringToOString( aXhpFile, osl_getThreadTextEncoding() ); - args.push_back(std::string(aOXhpFile.getStr())); + args.push_back(std::string(aOXhpFile)); } OString aOExtensionLanguageRoot = OUStringToOString( aExtensionLanguageRoot, osl_getThreadTextEncoding() ); |