diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2013-04-07 12:06:47 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2013-04-07 14:23:11 +0200 |
commit | 1946794ae09ba732022fe6a74ea45e304ab70b84 (patch) | |
tree | e32bd7ba61fa021ecc7f8c85959df8ca837d6e81 /helpcompiler/source | |
parent | 5b08c6e7a21dda94d5b755eea0b1ed1e9c199bec (diff) |
mass removal of rtl:: prefixes for O(U)String*
Modules sal, salhelper, cppu, cppuhelper, codemaker (selectively) and odk
have kept them, in order not to break external API (the automatic using declaration
is LO-internal).
Change-Id: I588fc9e0c45b914f824f91c0376980621d730f09
Diffstat (limited to 'helpcompiler/source')
-rw-r--r-- | helpcompiler/source/HelpCompiler.cxx | 2 | ||||
-rw-r--r-- | helpcompiler/source/HelpIndexer.cxx | 44 | ||||
-rw-r--r-- | helpcompiler/source/HelpIndexer_main.cxx | 12 | ||||
-rw-r--r-- | helpcompiler/source/HelpLinker.cxx | 56 | ||||
-rw-r--r-- | helpcompiler/source/HelpSearch.cxx | 10 | ||||
-rw-r--r-- | helpcompiler/source/LuceneHelper.cxx | 8 | ||||
-rw-r--r-- | helpcompiler/source/LuceneHelper.hxx | 4 |
7 files changed, 68 insertions, 68 deletions
diff --git a/helpcompiler/source/HelpCompiler.cxx b/helpcompiler/source/HelpCompiler.cxx index e679d60e739b..628560508910 100644 --- a/helpcompiler/source/HelpCompiler.cxx +++ b/helpcompiler/source/HelpCompiler.cxx @@ -497,7 +497,7 @@ namespace fs { HCDBG( std::cerr << "creating " << - rtl::OUStringToOString(indexDirName.data, RTL_TEXTENCODING_UTF8).getStr() + OUStringToOString(indexDirName.data, RTL_TEXTENCODING_UTF8).getStr() << std::endl ); osl::Directory::createPath(indexDirName.data); diff --git a/helpcompiler/source/HelpIndexer.cxx b/helpcompiler/source/HelpIndexer.cxx index 06e542a57c61..325a9840ce78 100644 --- a/helpcompiler/source/HelpIndexer.cxx +++ b/helpcompiler/source/HelpIndexer.cxx @@ -41,14 +41,14 @@ using namespace lucene::document; -HelpIndexer::HelpIndexer(rtl::OUString const &lang, rtl::OUString const &module, - rtl::OUString const &srcDir, rtl::OUString const &outDir) +HelpIndexer::HelpIndexer(OUString const &lang, OUString const &module, + OUString const &srcDir, OUString const &outDir) : d_lang(lang), d_module(module) { - d_indexDir = rtl::OUStringBuffer(outDir).append('/'). + d_indexDir = OUStringBuffer(outDir).append('/'). append(module).appendAscii(RTL_CONSTASCII_STRINGPARAM(".idxl")).toString(); - d_captionDir = srcDir + rtl::OUString("/caption"); - d_contentDir = srcDir + rtl::OUString("/content"); + d_captionDir = srcDir + OUString("/caption"); + d_contentDir = srcDir + OUString("/content"); } bool HelpIndexer::indexDocuments() @@ -58,7 +58,7 @@ bool HelpIndexer::indexDocuments() try { - rtl::OUString sLang = d_lang.getToken(0, '-'); + OUString sLang = d_lang.getToken(0, '-'); bool bUseCJK = sLang == "ja" || sLang == "ko" || sLang == "zh"; // Construct the analyzer appropriate for the given language @@ -68,10 +68,10 @@ bool HelpIndexer::indexDocuments() else analyzer.reset(new lucene::analysis::standard::StandardAnalyzer()); - rtl::OUString ustrSystemPath; + OUString ustrSystemPath; osl::File::getSystemPathFromFileURL(d_indexDir, ustrSystemPath); - rtl::OString indexDirStr = rtl::OUStringToOString(ustrSystemPath, osl_getThreadTextEncoding()); + OString indexDirStr = OUStringToOString(ustrSystemPath, osl_getThreadTextEncoding()); lucene::index::IndexWriter writer(indexDirStr.getStr(), analyzer.get(), true); //Double limit of tokens allowed, otherwise we'll get a too-many-tokens //exception for ja help. Could alternative ignore the exception and get @@ -80,7 +80,7 @@ bool HelpIndexer::indexDocuments() // Index the identified help files Document doc; - for (std::set<rtl::OUString>::iterator i = d_files.begin(); i != d_files.end(); ++i) { + for (std::set<OUString>::iterator i = d_files.begin(); i != d_files.end(); ++i) { helpDocument(*i, &doc); writer.addDocument(&doc); doc.clear(); @@ -92,14 +92,14 @@ bool HelpIndexer::indexDocuments() } catch (CLuceneError &e) { - d_error = rtl::OUString::createFromAscii(e.what()); + d_error = OUString::createFromAscii(e.what()); return false; } return true; } -rtl::OUString const & HelpIndexer::getErrorMessage() { +OUString const & HelpIndexer::getErrorMessage() { return d_error; } @@ -113,11 +113,11 @@ bool HelpIndexer::scanForFiles() { return true; } -bool HelpIndexer::scanForFiles(rtl::OUString const & path) { +bool HelpIndexer::scanForFiles(OUString const & path) { osl::Directory dir(path); if (osl::FileBase::E_None != dir.open()) { - d_error = rtl::OUString("Error reading directory ") + path; + d_error = OUString("Error reading directory ") + path; return true; } @@ -133,36 +133,36 @@ bool HelpIndexer::scanForFiles(rtl::OUString const & path) { return true; } -bool HelpIndexer::helpDocument(rtl::OUString const & fileName, Document *doc) { +bool HelpIndexer::helpDocument(OUString const & fileName, Document *doc) { // Add the help path as an indexed, untokenized field. - rtl::OUString path = rtl::OUString("#HLP#") + - d_module + rtl::OUString("/") + fileName; + OUString path = OUString("#HLP#") + + d_module + OUString("/") + fileName; std::vector<TCHAR> aPath(OUStringToTCHARVec(path)); doc->add(*_CLNEW Field(_T("path"), &aPath[0], Field::STORE_YES | Field::INDEX_UNTOKENIZED)); - rtl::OUString sEscapedFileName = + OUString sEscapedFileName = rtl::Uri::encode(fileName, rtl_UriCharClassUric, rtl_UriEncodeIgnoreEscapes, RTL_TEXTENCODING_UTF8); // Add the caption as a field. - rtl::OUString captionPath = d_captionDir + rtl::OUString("/") + sEscapedFileName; + OUString captionPath = d_captionDir + OUString("/") + sEscapedFileName; doc->add(*_CLNEW Field(_T("caption"), helpFileReader(captionPath), Field::STORE_NO | Field::INDEX_TOKENIZED)); // Add the content as a field. - rtl::OUString contentPath = d_contentDir + rtl::OUString("/") + sEscapedFileName; + OUString contentPath = d_contentDir + OUString("/") + sEscapedFileName; doc->add(*_CLNEW Field(_T("content"), helpFileReader(contentPath), Field::STORE_NO | Field::INDEX_TOKENIZED)); return true; } -lucene::util::Reader *HelpIndexer::helpFileReader(rtl::OUString const & path) { +lucene::util::Reader *HelpIndexer::helpFileReader(OUString const & path) { osl::File file(path); if (osl::FileBase::E_None == file.open(osl_File_OpenFlag_Read)) { file.close(); - rtl::OUString ustrSystemPath; + OUString ustrSystemPath; osl::File::getSystemPathFromFileURL(path, ustrSystemPath); - rtl::OString pathStr = rtl::OUStringToOString(ustrSystemPath, osl_getThreadTextEncoding()); + OString pathStr = OUStringToOString(ustrSystemPath, osl_getThreadTextEncoding()); return _CLNEW lucene::util::FileReader(pathStr.getStr(), "UTF-8"); } else { return _CLNEW lucene::util::StringReader(L""); diff --git a/helpcompiler/source/HelpIndexer_main.cxx b/helpcompiler/source/HelpIndexer_main.cxx index e5ff2aaf9a90..a384bb68243f 100644 --- a/helpcompiler/source/HelpIndexer_main.cxx +++ b/helpcompiler/source/HelpIndexer_main.cxx @@ -79,24 +79,24 @@ int main(int argc, char **argv) { return 1; } - rtl::OUString sDir; + OUString sDir; osl::File::getFileURLFromSystemPath( - rtl::OUString(dir.c_str(), dir.size(), osl_getThreadTextEncoding()), + OUString(dir.c_str(), dir.size(), osl_getThreadTextEncoding()), sDir); - rtl::OUString cwd; + OUString cwd; osl_getProcessWorkingDir(&cwd.pData); osl::File::getAbsoluteFileURL(cwd, sDir, sDir); HelpIndexer indexer( - rtl::OUString(lang.c_str(), lang.size(), osl_getThreadTextEncoding()), - rtl::OUString(module.c_str(), module.size(), osl_getThreadTextEncoding()), + OUString(lang.c_str(), lang.size(), osl_getThreadTextEncoding()), + OUString(module.c_str(), module.size(), osl_getThreadTextEncoding()), sDir, sDir); if (!indexer.indexDocuments()) { - std::cerr << rtl::OUStringToOString(indexer.getErrorMessage(), osl_getThreadTextEncoding()).getStr() << std::endl; + std::cerr << OUStringToOString(indexer.getErrorMessage(), osl_getThreadTextEncoding()).getStr() << std::endl; return 2; } return 0; diff --git a/helpcompiler/source/HelpLinker.cxx b/helpcompiler/source/HelpLinker.cxx index 15061f30384e..cf5ef12b6dba 100644 --- a/helpcompiler/source/HelpLinker.cxx +++ b/helpcompiler/source/HelpLinker.cxx @@ -65,12 +65,12 @@ IndexerPreProcessor::~IndexerPreProcessor() std::string getEncodedPath( const std::string& Path ) { - rtl::OString aOStr_Path( Path.c_str() ); - rtl::OUString aOUStr_Path( rtl::OStringToOUString + OString aOStr_Path( Path.c_str() ); + OUString aOUStr_Path( OStringToOUString ( aOStr_Path, fs::getThreadTextEncoding() ) ); - rtl::OUString aPathURL; + OUString aPathURL; osl::File::getFileURLFromSystemPath( aOUStr_Path, aPathURL ); - rtl::OString aOStr_PathURL( rtl::OUStringToOString + OString aOStr_PathURL( OUStringToOString ( aPathURL, fs::getThreadTextEncoding() ) ); std::string aStdStr_PathURL( aOStr_PathURL.getStr() ); return aStdStr_PathURL; @@ -550,7 +550,7 @@ void HelpLinker::link() throw( HelpProcessingException ) void HelpLinker::main( std::vector<std::string> &args, std::string* pExtensionPath, std::string* pDestination, - const rtl::OUString* pOfficeHelpPath ) + const OUString* pOfficeHelpPath ) throw( HelpProcessingException ) { bExtensionMode = false; @@ -809,10 +809,10 @@ void HelpLinker::main( std::vector<std::string> &args, { //This part is used when compileExtensionHelp is called from the extensions manager. //If extension help is compiled using helplinker in the build process - rtl::OUString aIdxCaptionPathFileURL( *pOfficeHelpPath ); - aIdxCaptionPathFileURL += rtl::OUString("/idxcaption.xsl"); + OUString aIdxCaptionPathFileURL( *pOfficeHelpPath ); + aIdxCaptionPathFileURL += OUString("/idxcaption.xsl"); - rtl::OString aOStr_IdxCaptionPathFileURL( rtl::OUStringToOString + OString aOStr_IdxCaptionPathFileURL( OUStringToOString ( aIdxCaptionPathFileURL, fs::getThreadTextEncoding() ) ); std::string aStdStr_IdxCaptionPathFileURL( aOStr_IdxCaptionPathFileURL.getStr() ); @@ -834,10 +834,10 @@ void HelpLinker::main( std::vector<std::string> &args, //If extension help is compiled using helplinker in the build process //then -idxcontent must be supplied //This part is used when compileExtensionHelp is called from the extensions manager. - rtl::OUString aIdxContentPathFileURL( *pOfficeHelpPath ); - aIdxContentPathFileURL += rtl::OUString("/idxcontent.xsl"); + OUString aIdxContentPathFileURL( *pOfficeHelpPath ); + aIdxContentPathFileURL += OUString("/idxcontent.xsl"); - rtl::OString aOStr_IdxContentPathFileURL( rtl::OUStringToOString + OString aOStr_IdxContentPathFileURL( OUStringToOString ( aIdxContentPathFileURL, fs::getThreadTextEncoding() ) ); std::string aStdStr_IdxContentPathFileURL( aOStr_IdxContentPathFileURL.getStr() ); @@ -899,10 +899,10 @@ extern "C" void StructuredXMLErrorFunction(void *userData, xmlErrorPtr error) HelpProcessingErrorInfo& HelpProcessingErrorInfo::operator=( const struct HelpProcessingException& e ) { m_eErrorClass = e.m_eErrorClass; - rtl::OString tmpErrorMsg( e.m_aErrorMsg.c_str() ); - m_aErrorMsg = rtl::OStringToOUString( tmpErrorMsg, fs::getThreadTextEncoding() ); - rtl::OString tmpXMLParsingFile( e.m_aXMLParsingFile.c_str() ); - m_aXMLParsingFile = rtl::OStringToOUString( tmpXMLParsingFile, fs::getThreadTextEncoding() ); + OString tmpErrorMsg( e.m_aErrorMsg.c_str() ); + m_aErrorMsg = OStringToOUString( tmpErrorMsg, fs::getThreadTextEncoding() ); + OString tmpXMLParsingFile( e.m_aXMLParsingFile.c_str() ); + m_aXMLParsingFile = OStringToOUString( tmpXMLParsingFile, fs::getThreadTextEncoding() ); m_nXMLParsingLine = e.m_nXMLParsingLine; return *this; } @@ -911,11 +911,11 @@ HelpProcessingErrorInfo& HelpProcessingErrorInfo::operator=( const struct HelpPr // Returns true in case of success, false in case of error HELPLINKER_DLLPUBLIC bool compileExtensionHelp ( - const rtl::OUString& aOfficeHelpPath, - const rtl::OUString& aExtensionName, - const rtl::OUString& aExtensionLanguageRoot, - sal_Int32 nXhpFileCount, const rtl::OUString* pXhpFiles, - const rtl::OUString& aDestination, + const OUString& aOfficeHelpPath, + const OUString& aExtensionName, + const OUString& aExtensionLanguageRoot, + sal_Int32 nXhpFileCount, const OUString* pXhpFiles, + const OUString& aDestination, HelpProcessingErrorInfo& o_rHelpProcessingErrorInfo ) { @@ -924,21 +924,21 @@ HELPLINKER_DLLPUBLIC bool compileExtensionHelp std::vector<std::string> args; args.reserve(nXhpFileCount + 2); args.push_back(std::string("-mod")); - rtl::OString aOExtensionName = rtl::OUStringToOString( aExtensionName, fs::getThreadTextEncoding() ); + OString aOExtensionName = OUStringToOString( aExtensionName, fs::getThreadTextEncoding() ); args.push_back(std::string(aOExtensionName.getStr())); for( sal_Int32 iXhp = 0 ; iXhp < nXhpFileCount ; ++iXhp ) { - rtl::OUString aXhpFile = pXhpFiles[iXhp]; + OUString aXhpFile = pXhpFiles[iXhp]; - rtl::OString aOXhpFile = rtl::OUStringToOString( aXhpFile, fs::getThreadTextEncoding() ); + OString aOXhpFile = OUStringToOString( aXhpFile, fs::getThreadTextEncoding() ); args.push_back(std::string(aOXhpFile.getStr())); } - rtl::OString aOExtensionLanguageRoot = rtl::OUStringToOString( aExtensionLanguageRoot, fs::getThreadTextEncoding() ); + OString aOExtensionLanguageRoot = OUStringToOString( aExtensionLanguageRoot, fs::getThreadTextEncoding() ); const char* pExtensionPath = aOExtensionLanguageRoot.getStr(); std::string aStdStrExtensionPath = pExtensionPath; - rtl::OString aODestination = rtl::OUStringToOString(aDestination, fs::getThreadTextEncoding()); + OString aODestination = OUStringToOString(aDestination, fs::getThreadTextEncoding()); const char* pDestination = aODestination.getStr(); std::string aStdStrDestination = pDestination; @@ -968,8 +968,8 @@ HELPLINKER_DLLPUBLIC bool compileExtensionHelp xmlSetStructuredErrorFunc( NULL, NULL ); // i83624: Tree files - ::rtl::OUString aTreeFileURL = aExtensionLanguageRoot; - aTreeFileURL += rtl::OUString("/help.tree"); + OUString aTreeFileURL = aExtensionLanguageRoot; + aTreeFileURL += OUString("/help.tree"); osl::DirectoryItem aTreeFileItem; osl::FileBase::RC rcGet = osl::DirectoryItem::get( aTreeFileURL, aTreeFileItem ); osl::FileStatus aFileStatus( osl_FileStatus_Mask_FileSize ); @@ -991,7 +991,7 @@ HELPLINKER_DLLPUBLIC bool compileExtensionHelp { XML_Error nError = XML_GetErrorCode( parser ); o_rHelpProcessingErrorInfo.m_eErrorClass = HELPPROCESSING_XMLPARSING_ERROR; - o_rHelpProcessingErrorInfo.m_aErrorMsg = rtl::OUString::createFromAscii( XML_ErrorString( nError ) );; + o_rHelpProcessingErrorInfo.m_aErrorMsg = OUString::createFromAscii( XML_ErrorString( nError ) );; o_rHelpProcessingErrorInfo.m_aXMLParsingFile = aTreeFileURL; // CRAHSES!!! o_rHelpProcessingErrorInfo.m_nXMLParsingLine = XML_GetCurrentLineNumber( parser ); bSuccess = false; diff --git a/helpcompiler/source/HelpSearch.cxx b/helpcompiler/source/HelpSearch.cxx index 40022c22b505..cb33d8afd9d2 100644 --- a/helpcompiler/source/HelpSearch.cxx +++ b/helpcompiler/source/HelpSearch.cxx @@ -33,16 +33,16 @@ #include "LuceneHelper.hxx" -HelpSearch::HelpSearch(rtl::OUString const &lang, rtl::OUString const &indexDir) +HelpSearch::HelpSearch(OUString const &lang, OUString const &indexDir) : d_lang(lang) { - rtl::OUString ustrSystemPath; + OUString ustrSystemPath; osl::File::getSystemPathFromFileURL(indexDir, ustrSystemPath); - d_indexDir = rtl::OUStringToOString(ustrSystemPath, osl_getThreadTextEncoding()); + d_indexDir = OUStringToOString(ustrSystemPath, osl_getThreadTextEncoding()); } -bool HelpSearch::query(rtl::OUString const &queryStr, bool captionOnly, - std::vector<rtl::OUString> &rDocuments, std::vector<float> &rScores) { +bool HelpSearch::query(OUString const &queryStr, bool captionOnly, + std::vector<OUString> &rDocuments, std::vector<float> &rScores) { lucene::index::IndexReader *reader = lucene::index::IndexReader::open(d_indexDir.getStr()); lucene::search::IndexSearcher searcher(reader); diff --git a/helpcompiler/source/LuceneHelper.cxx b/helpcompiler/source/LuceneHelper.cxx index bee9090cc2b7..e11eecad10a4 100644 --- a/helpcompiler/source/LuceneHelper.cxx +++ b/helpcompiler/source/LuceneHelper.cxx @@ -29,7 +29,7 @@ #include "LuceneHelper.hxx" -std::vector<TCHAR> OUStringToTCHARVec(rtl::OUString const &rStr) +std::vector<TCHAR> OUStringToTCHARVec(OUString const &rStr) { //UTF-16 if (sizeof(TCHAR) == sizeof(sal_Unicode)) @@ -46,14 +46,14 @@ std::vector<TCHAR> OUStringToTCHARVec(rtl::OUString const &rStr) return aRet; } -rtl::OUString TCHARArrayToOUString(TCHAR const *str) +OUString TCHARArrayToOUString(TCHAR const *str) { // UTF-16 if (sizeof(TCHAR) == sizeof(sal_Unicode)) - return rtl::OUString((const sal_Unicode*)(str)); + return OUString((const sal_Unicode*)(str)); // UTF-32 - return rtl::OUString((const sal_uInt32*)str, wcslen(str)); + return OUString((const sal_uInt32*)str, wcslen(str)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/helpcompiler/source/LuceneHelper.hxx b/helpcompiler/source/LuceneHelper.hxx index a0248f836a1f..59a21965fda8 100644 --- a/helpcompiler/source/LuceneHelper.hxx +++ b/helpcompiler/source/LuceneHelper.hxx @@ -53,8 +53,8 @@ #include <rtl/ustring.hxx> #include <vector> -std::vector<TCHAR> OUStringToTCHARVec(rtl::OUString const &rStr); -rtl::OUString TCHARArrayToOUString(TCHAR const *str); +std::vector<TCHAR> OUStringToTCHARVec(OUString const &rStr); +OUString TCHARArrayToOUString(TCHAR const *str); #endif |