From 91aaceb7275fe8aa163629646de4c3dc7c1c02b3 Mon Sep 17 00:00:00 2001 From: Andras Timar Date: Wed, 27 Mar 2013 08:30:38 -0700 Subject: fdo#39445 writing out tools/fsys.hxx (forms) Change-Id: Iee0812ee098c3b7c12d297461907a2923bad2cc5 --- forms/source/component/DatabaseForm.cxx | 18 +++++++----------- 1 file 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 #include #include -#include #include #include #include @@ -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); } -- cgit v1.2.3