Kaydet (Commit) 91aaceb7 authored tarafından Andras Timar's avatar Andras Timar

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

Change-Id: Iee0812ee098c3b7c12d297461907a2923bad2cc5
üst 2895b0ef
...@@ -73,7 +73,6 @@ ...@@ -73,7 +73,6 @@
#include <svl/inettype.hxx> #include <svl/inettype.hxx>
#include <tools/debug.hxx> #include <tools/debug.hxx>
#include <tools/diagnose_ex.h> #include <tools/diagnose_ex.h>
#include <tools/fsys.hxx>
#include <tools/inetmsg.hxx> #include <tools/inetmsg.hxx>
#include <tools/urlobj.hxx> #include <tools/urlobj.hxx>
#include <unotools/ucblockbytes.hxx> #include <unotools/ucblockbytes.hxx>
...@@ -1058,18 +1057,15 @@ sal_Bool ODatabaseForm::InsertFilePart( INetMIMEMessage& rParent, const ::rtl::O ...@@ -1058,18 +1057,15 @@ sal_Bool ODatabaseForm::InsertFilePart( INetMIMEMessage& rParent, const ::rtl::O
if( INET_PROT_FILE == aURL.GetProtocol() ) if( INET_PROT_FILE == aURL.GetProtocol() )
{ {
aFileName = INetURLObject::decode(aURL.PathToFileName(), '%', INetURLObject::DECODE_UNAMBIGUOUS); aFileName = INetURLObject::decode(aURL.PathToFileName(), '%', INetURLObject::DECODE_UNAMBIGUOUS);
DirEntry aDirEntry( aFileName ); pStream = ::utl::UcbStreamHelper::CreateStream(aFileName, STREAM_READ);
if( aDirEntry.Exists() ) if (!pStream || (pStream->GetError() != ERRCODE_NONE))
{ {
pStream = ::utl::UcbStreamHelper::CreateStream(aFileName, STREAM_READ); delete pStream;
if (!pStream || (pStream->GetError() != ERRCODE_NONE)) pStream = 0;
{
delete pStream;
pStream = 0;
}
} }
INetContentType eContentType = INetContentTypes::GetContentType4Extension( sal_Int32 nSepInd = aFileName.lastIndexOf(".");
aDirEntry.GetExtension() ); OUString aExtension = aFileName.copy( nSepInd + 1, aFileName.getLength() - nSepInd - 1 );
INetContentType eContentType = INetContentTypes::GetContentType4Extension( aExtension );
if (eContentType != CONTENT_TYPE_UNKNOWN) if (eContentType != CONTENT_TYPE_UNKNOWN)
aContentType = INetContentTypes::GetContentType(eContentType); aContentType = INetContentTypes::GetContentType(eContentType);
} }
......
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