diff options
author | Andras Timar <atimar@suse.com> | 2013-03-27 08:30:38 -0700 |
---|---|---|
committer | Andras Timar <atimar@suse.com> | 2013-03-27 08:31:16 -0700 |
commit | 91aaceb7275fe8aa163629646de4c3dc7c1c02b3 (patch) | |
tree | 28cca7a149ca437b72c32341a03aea4332207c64 /forms/source/component | |
parent | 2895b0ef692d5842636b3b026e76ceb6ac30d088 (diff) |
fdo#39445 writing out tools/fsys.hxx (forms)
Change-Id: Iee0812ee098c3b7c12d297461907a2923bad2cc5
Diffstat (limited to 'forms/source/component')
-rw-r--r-- | forms/source/component/DatabaseForm.cxx | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx index dea3797ddef6..91cedf46f933 100644 --- a/forms/source/component/DatabaseForm.cxx +++ b/forms/source/component/DatabaseForm.cxx @@ -73,7 +73,6 @@ #include <svl/inettype.hxx> #include <tools/debug.hxx> #include <tools/diagnose_ex.h> -#include <tools/fsys.hxx> #include <tools/inetmsg.hxx> #include <tools/urlobj.hxx> #include <unotools/ucblockbytes.hxx> @@ -1058,18 +1057,15 @@ sal_Bool ODatabaseForm::InsertFilePart( INetMIMEMessage& rParent, const ::rtl::O if( INET_PROT_FILE == aURL.GetProtocol() ) { aFileName = INetURLObject::decode(aURL.PathToFileName(), '%', INetURLObject::DECODE_UNAMBIGUOUS); - DirEntry aDirEntry( aFileName ); - if( aDirEntry.Exists() ) + pStream = ::utl::UcbStreamHelper::CreateStream(aFileName, STREAM_READ); + if (!pStream || (pStream->GetError() != ERRCODE_NONE)) { - pStream = ::utl::UcbStreamHelper::CreateStream(aFileName, STREAM_READ); - if (!pStream || (pStream->GetError() != ERRCODE_NONE)) - { - delete pStream; - pStream = 0; - } + delete pStream; + pStream = 0; } - INetContentType eContentType = INetContentTypes::GetContentType4Extension( - aDirEntry.GetExtension() ); + sal_Int32 nSepInd = aFileName.lastIndexOf("."); + OUString aExtension = aFileName.copy( nSepInd + 1, aFileName.getLength() - nSepInd - 1 ); + INetContentType eContentType = INetContentTypes::GetContentType4Extension( aExtension ); if (eContentType != CONTENT_TYPE_UNKNOWN) aContentType = INetContentTypes::GetContentType(eContentType); } |