Commits

Anonymous committed b2f123a

toolsfixes: #115441# review GetTempFile(): trying to work with a std::string as return value since full path is of interest everywhere this function is called. No DirEntry necessary.

Comments (0)

Files changed (2)

l10ntools/inc/export.hxx

     static std::string GetTimeStamp();
 	static bool ConvertLineEnds( std::string sSource, std::string sDestination );
 	static std::string GetNativeFile( std::string sSource );
-	static DirEntry GetTempFile();
+	//static DirEntry GetTempFile();
+    static std::string GetTempFile();
 	
 	static void DumpExportList( std::string& sListName , ExportList& aList );
 	static std::string DumpMap( std::string& sMapName , stringHashMap& aMap );

l10ntools/source/export2.cxx

 	}
 	printf("\n");
 }
+
 ByteString Export::DumpMap( ByteString& sMapName , ByteStringHashMap& aMap ){
 	ByteStringHashMap::const_iterator idbg;
     ByteString sReturn;
 {
 	return !isAllowed( sLanguage );
 }
-bool Export::isAllowed( const ByteString &sLanguage ){
-    return ! ( sLanguage.EqualsIgnoreCaseAscii("en-US") );
+bool Export::isAllowed( const string &sLanguage ){
+    return ! ( toLowerAscii(sLanguage) == "en-us" );
 }
 /*****************************************************************************/
 bool Export::LanguageAllowed( const ByteString &nLanguage )
 void Export::FillInFallbacks( ResData *pResData )
 /*****************************************************************************/
 {
-    ByteString sCur;
+    string sCur;
     for( unsigned int n = 0; n < aLanguages.size(); n++ ){
         sCur = aLanguages[ n ];
         if( isAllowed( sCur )  ){
 }
 
 /*****************************************************************************/
-DirEntry Export::GetTempFile()
+std::string Export::GetTempFile()
 /*****************************************************************************/
 {
-    rtl::OUString* sTempFilename = new rtl::OUString();
+    rtl::OUString sTempFilename;
     
     // Create a temp file
-    int nRC = osl::FileBase::createTempFile( 0 , 0 , sTempFilename );
+    int nRC = osl::FileBase::createTempFile( 0 , 0 , &sTempFilename );
     if( nRC ) printf(" osl::FileBase::createTempFile RC = %d",nRC);
+
+    return string(rtl::OUStringToOString( sTempFilename, RTL_TEXTENCODING_UTF8 ).pData->buffer);
+
+    /*
     
     String strTmp( *sTempFilename  );
     
     DirEntry aDirEntry( sTmp );
     delete sTempFilename;
     return aDirEntry;
+    */
 }
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.