[Libreoffice-commits] core.git: rsc/source sd/source svx/source

Krisztian Pinter pin.terminator at gmail.com
Thu Mar 14 03:36:43 PDT 2013


 rsc/source/rsc/rsc.cxx           |    3 +--
 rsc/source/tools/rsctools.cxx    |   13 ++++++-------
 sd/source/filter/html/htmlex.cxx |   19 ++++++++-----------
 sd/source/filter/html/htmlex.hxx |    2 +-
 svx/source/gengal/gengal.cxx     |    1 -
 5 files changed, 16 insertions(+), 22 deletions(-)

New commits:
commit de99bcde8a66a410287c7fb9c4ae6d6c9b7f05a6
Author: Krisztian Pinter <pin.terminator at gmail.com>
Date:   Wed Mar 6 20:30:30 2013 +0100

    fdo#39445 writing out tools/fsys.hxx
    
    removed unused <tools/fsys.hxx> include from gengal.cxx
    changed file copying to sal version in htmlex.cxx
    rewrote OutputFile in rsctools.cxx
    very minor change in rsc.cxx - instead of creating an empty DirEntry
    	and getting its path, just used "."
    
    Change-Id: Ifd57d73847ff271bcb64b12a26a564acc051fcef
    Reviewed-on: https://gerrit.libreoffice.org/2680
    Reviewed-by: Andras Timar <atimar at suse.com>
    Tested-by: Andras Timar <atimar at suse.com>

diff --git a/rsc/source/rsc/rsc.cxx b/rsc/source/rsc/rsc.cxx
index 007f426..393e2e0 100644
--- a/rsc/source/rsc/rsc.cxx
+++ b/rsc/source/rsc/rsc.cxx
@@ -92,8 +92,7 @@ void RscCmdLine::Init()
     nCommands       = 0;
     nByteOrder      = RSC_BIGENDIAN;
 
-    DirEntry aEntry;
-    aPath = rtl::OUStringToOString(aEntry.GetFull(), RTL_TEXTENCODING_ASCII_US); //Immer im Aktuellen Pfad suchen
+    aPath = OString(".");
     m_aOutputFiles.clear();
     m_aOutputFiles.push_back( OutputFile() );
 }
diff --git a/rsc/source/tools/rsctools.cxx b/rsc/source/tools/rsctools.cxx
index 857f663..7e94c6e 100644
--- a/rsc/source/tools/rsctools.cxx
+++ b/rsc/source/tools/rsctools.cxx
@@ -28,8 +28,6 @@
 #include <string.h>
 #include <ctype.h>
 
-#include <tools/fsys.hxx>
-
 // Include
 #include <rscdef.hxx>
 #include <rsctools.hxx>
@@ -174,13 +172,14 @@ sal_Bool Append(const rtl::OString &rOutputSrs, const rtl::OString &rTmpFile)
 *************************************************************************/
 rtl::OString OutputFile(const rtl::OString &rInput, const char * pExt)
 {
-    rtl::OUString aUniInput(rtl::OStringToOUString(rInput, RTL_TEXTENCODING_ASCII_US));
-    DirEntry aFileName(aUniInput);
+    sal_Int32 nSepInd = rInput.lastIndexOf(".");
 
-    OUString aExt = OStringToOUString( pExt, RTL_TEXTENCODING_ASCII_US );
-    aFileName.SetExtension( aExt );
+    if( nSepInd != -1 )
+    {
+        return rInput.copy(0, rInput.getLength() - nSepInd).concat(OString(pExt));
+    }
 
-    return rtl::OUStringToOString(aFileName.GetFull(), RTL_TEXTENCODING_ASCII_US);
+    return rInput.concat(OString(".")).concat(OString(pExt));
 }
 
 /*************************************************************************
diff --git a/sd/source/filter/html/htmlex.cxx b/sd/source/filter/html/htmlex.cxx
index 9988797..92690d0 100644
--- a/sd/source/filter/html/htmlex.cxx
+++ b/sd/source/filter/html/htmlex.cxx
@@ -27,7 +27,6 @@
 #include <rtl/uri.hxx>
 #include <comphelper/processfactory.hxx>
 #include <osl/file.hxx>
-#include <tools/fsys.hxx>
 #include <unotools/pathoptions.hxx>
 #include <vcl/FilterConfigItem.hxx>
 #include <unotools/ucbstreamhelper.hxx>
@@ -3054,30 +3053,28 @@ String HtmlExport::InsertSound( const String& rSoundFile )
 
     String      aStr( RTL_CONSTASCII_USTRINGPARAM("<embed src=\"") );
     INetURLObject   aURL( rSoundFile );
+    String aSoundFileName = String(aURL.getName());
 
     DBG_ASSERT( aURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" );
 
-    aStr += String(aURL.getName());
+    aStr += aSoundFileName;
     aStr.AppendAscii( "\" hidden=\"true\" autostart=\"true\">" );
 
-    CopyFile( rSoundFile, maExportPath );
+    CopyFile( OUString(rSoundFile), OUString(maExportPath) + OUString(aSoundFileName) );
 
     return aStr;
 }
 
 // =====================================================================
 
-bool HtmlExport::CopyFile( const String& rSourceFile, const String& rDestPath )
+bool HtmlExport::CopyFile( const OUString& rSourceFile, const OUString& rDestFile )
 {
-    DirEntry aSourceEntry( rSourceFile );
-    DirEntry aDestEntry( rDestPath );
+    meEC.SetContext( STR_HTMLEXP_ERROR_COPY_FILE, rSourceFile, rDestFile );
+    osl::FileBase::RC Error = osl::File::copy( rSourceFile, rDestFile );
 
-    meEC.SetContext( STR_HTMLEXP_ERROR_COPY_FILE, aSourceEntry.GetName(), rDestPath );
-    FSysError nError = aSourceEntry.CopyTo( aDestEntry, FSYS_ACTION_COPYFILE );
-
-    if( nError != FSYS_ERR_OK )
+    if( Error != osl::FileBase::E_None )
     {
-        ErrorHandler::HandleError(nError);
+        ErrorHandler::HandleError(Error);
         return false;
     }
     else
diff --git a/sd/source/filter/html/htmlex.hxx b/sd/source/filter/html/htmlex.hxx
index 6993cdb..8d4a578 100644
--- a/sd/source/filter/html/htmlex.hxx
+++ b/sd/source/filter/html/htmlex.hxx
@@ -195,7 +195,7 @@ class HtmlExport
     String  CreatePageURL( sal_uInt16 nPgNum );
 
     String InsertSound( const String& rSoundFile );
-    bool CopyFile( const String& rSourceFile, const String& rDestPath );
+    bool CopyFile( const OUString& rSourceFile, const OUString& rDestFile );
     bool CopyScript( const String& rPath, const String& rSource, const String& rDest, bool bUnix = false );
 
     void InitProgress( sal_uInt16 nProgrCount );
diff --git a/svx/source/gengal/gengal.cxx b/svx/source/gengal/gengal.cxx
index 7653678..346ace0 100644
--- a/svx/source/gengal/gengal.cxx
+++ b/svx/source/gengal/gengal.cxx
@@ -44,7 +44,6 @@
 #include <com/sun/star/ucb/UniversalContentBroker.hpp>
 
 #include <tools/urlobj.hxx>
-#include <tools/fsys.hxx>
 
 #include <vcl/vclmain.hxx>
 #include <vcl/window.hxx>


More information about the Libreoffice-commits mailing list