Kaydet (Commit) eec2eb05 authored tarafından Krisztian Pinter's avatar Krisztian Pinter Kaydeden (comit) Andras Timar

fdo#39445 writing out tools/fsys.hxx (idl)

Removed uses of fsys from database.cxx, command.cxx, module.cxx, svidl.cxx.
Also removed a lot of cruft from svidl.cxx and command.hxx; unused variables
and code relating to them, eg. variables aCxxFile, aHxxFile, aSrcFile, aODLFile.
Changed some Strings to OUStrings in svidl.cxx and command.hxx.

Change-Id: I708284f70435c8f65cdcfc954af43976e28b8c9d
Reviewed-on: https://gerrit.libreoffice.org/2935Reviewed-by: 's avatarAndras Timar <atimar@suse.com>
Tested-by: 's avatarAndras Timar <atimar@suse.com>
üst 56a52889
......@@ -30,25 +30,18 @@ typedef ::std::vector< rtl::OString* > ByteStringList;
class SvCommand
{
public:
String aDataBaseFile;
OUString aDataBaseFile;
StringList aInFileList;
String aListFile;
String aSlotMapFile;
String aSfxItemFile;
String aODLFile;
String aCallingFile;
String aCxxFile;
String aHxxFile;
String aSrcFile;
OUString aListFile;
OUString aSlotMapFile;
OUString aSfxItemFile;
String aPath;
String aCHeaderFile;
String aCSourceFile;
String aTargetFile;
String aHelpIdFile;
String aCSVFile;
String aExportFile;
String aDocuFile;
::rtl::OUString m_DepFile;
OUString aHelpIdFile;
OUString aCSVFile;
OUString aExportFile;
OUString aDocuFile;
OUString m_DepFile;
sal_uInt32 nVerbosity;
sal_uInt32 nFlags;
......
......@@ -24,8 +24,8 @@
#include <module.hxx>
#include <globals.hxx>
#include <database.hxx>
#include <tools/fsys.hxx>
#include <tools/debug.hxx>
#include <osl/file.hxx>
SV_IMPL_META_FACTORY1( SvMetaModule, SvMetaExtern );
......@@ -222,12 +222,16 @@ void SvMetaModule::ReadContextSvIdl( SvIdlDataBase & rBase,
SvToken * pTok = rInStm.GetToken_Next();
if( pTok->IsString() )
{
DirEntry aFullName( rtl::OStringToOUString(pTok->GetString(), RTL_TEXTENCODING_ASCII_US) );
rBase.StartNewFile( aFullName.GetFull() );
if( aFullName.Find( rBase.GetPath() ) )
OUString aFullName(rtl::OStringToOUString(pTok->GetString(), RTL_TEXTENCODING_ASCII_US));
rBase.StartNewFile( aFullName );
osl::FileBase::RC searchError = osl::File::searchFileURL(aFullName, rBase.GetPath(), aFullName);
osl::FileBase::getSystemPathFromFileURL( aFullName, aFullName );
if( osl::FileBase::E_None == searchError )
{
rBase.AddDepFile(aFullName.GetFull());
SvTokenStream aTokStm( aFullName.GetFull() );
rBase.AddDepFile( aFullName );
SvTokenStream aTokStm( aFullName );
if( SVSTREAM_OK == aTokStm.GetStream().GetError() )
{
// rescue error from old file
......@@ -252,19 +256,15 @@ void SvMetaModule::ReadContextSvIdl( SvIdlDataBase & rBase,
}
else
{
rtl::OStringBuffer aStr(RTL_CONSTASCII_STRINGPARAM(
"cannot open file: "));
aStr.append(rtl::OUStringToOString(aFullName.GetFull(),
RTL_TEXTENCODING_UTF8));
rtl::OStringBuffer aStr(RTL_CONSTASCII_STRINGPARAM("cannot open file: "));
aStr.append(rtl::OUStringToOString(aFullName, RTL_TEXTENCODING_UTF8));
rBase.SetError(aStr.makeStringAndClear(), pTok);
}
}
else
{
rtl::OStringBuffer aStr(RTL_CONSTASCII_STRINGPARAM(
"cannot find file:"));
aStr.append(rtl::OUStringToOString(aFullName.GetFull(),
RTL_TEXTENCODING_UTF8));
rtl::OStringBuffer aStr(RTL_CONSTASCII_STRINGPARAM("cannot find file:"));
aStr.append(rtl::OUStringToOString(aFullName, RTL_TEXTENCODING_UTF8));
rBase.SetError(aStr.makeStringAndClear(), pTok);
}
}
......
......@@ -26,7 +26,7 @@
#include <command.hxx>
#include <globals.hxx>
#include <database.hxx>
#include <tools/fsys.hxx>
#include "sal/config.h"
char const * SyntaxStrings[] = {
"basic-type:",
......@@ -320,7 +320,7 @@ SvCommand::SvCommand( int argc, char ** argv )
{ // define include paths
String aName( aParam.Copy( 1 ) );
if( aPath.Len() )
aPath += DirEntry::GetSearchDelimiter();
aPath += OUString( SAL_PATHSEPARATOR );
aPath += aName;
}
else if( aParam.EqualsIgnoreCaseAscii( "rsc", 0, 3 ) )
......@@ -361,7 +361,7 @@ SvCommand::SvCommand( int argc, char ** argv )
if( aInc.getLength() )
{
if( aPath.Len() )
aPath += DirEntry::GetSearchDelimiter();
aPath += OUString( SAL_PATHSEPARATOR );
aPath += rtl::OStringToOUString(aInc, RTL_TEXTENCODING_ASCII_US);
}
}
......
......@@ -21,11 +21,11 @@
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <tools/fsys.hxx>
#include <tools/debug.hxx>
#include <database.hxx>
#include <globals.hxx>
#include <rtl/strbuf.hxx>
#include <osl/file.hxx>
SvIdlDataBase::SvIdlDataBase( const SvCommand& rCmd )
: bExport( sal_False )
......@@ -205,17 +205,17 @@ sal_Bool SvIdlDataBase::InsertId( const rtl::OString& rIdName, sal_uLong nVal )
sal_Bool SvIdlDataBase::ReadIdFile( const String & rFileName )
{
DirEntry aFullName( rFileName );
aFullName.Find( GetPath() );
OUString aFullName;
osl::File::searchFileURL( rFileName, GetPath(), aFullName);
osl::FileBase::getSystemPathFromFileURL( aFullName, aFullName );
for ( size_t i = 0, n = aIdFileList.size(); i < n; ++i )
if ( *aIdFileList[ i ] == rFileName )
return sal_True;
aIdFileList.push_back( new String( rFileName ) );
this->AddDepFile(aFullName.GetFull());
SvTokenStream aTokStm( aFullName.GetFull() );
this->AddDepFile( aFullName );
SvTokenStream aTokStm( aFullName );
if( aTokStm.GetStream().GetError() == SVSTREAM_OK )
{
SvToken * pTok = aTokStm.GetToken_Next();
......@@ -634,20 +634,22 @@ sal_Bool SvIdlWorkingBase::ReadSvIdl( SvTokenStream & rInStm, sal_Bool bImported
pTok = rInStm.GetToken_Next();
if( pTok->IsString() )
{
DirEntry aFullName(rtl::OStringToOUString(pTok->GetString(), RTL_TEXTENCODING_ASCII_US));
if( aFullName.Find( rPath ) )
OUString aFullName;
if( osl::FileBase::E_None == osl::File::searchFileURL(
rtl::OStringToOUString(pTok->GetString(), RTL_TEXTENCODING_ASCII_US),
rPath,
aFullName) )
{
this->AddDepFile(aFullName.GetFull());
SvFileStream aStm( aFullName.GetFull(),
STREAM_STD_READ | STREAM_NOCREATE );
osl::FileBase::getSystemPathFromFileURL( aFullName, aFullName );
this->AddDepFile(aFullName);
SvFileStream aStm( aFullName, STREAM_STD_READ | STREAM_NOCREATE );
Load( aStm );
if( aStm.GetError() != SVSTREAM_OK )
{
if( aStm.GetError() == SVSTREAM_WRONGVERSION )
{
rtl::OStringBuffer aStr("wrong version, file ");
aStr.append(rtl::OUStringToOString(
aFullName.GetFull(), RTL_TEXTENCODING_UTF8));
aStr.append(rtl::OUStringToOString( aFullName, RTL_TEXTENCODING_UTF8));
SetError(aStr.makeStringAndClear(), pTok);
WriteError( rInStm );
bOk = sal_False;
......@@ -656,7 +658,7 @@ sal_Bool SvIdlWorkingBase::ReadSvIdl( SvTokenStream & rInStm, sal_Bool bImported
{
aStm.Seek( 0 );
aStm.ResetError();
SvTokenStream aTokStm( aStm, aFullName.GetFull() );
SvTokenStream aTokStm( aStm, aFullName );
bOk = ReadSvIdl( aTokStm, sal_True, rPath );
}
}
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment