[Libreoffice-commits] core.git: forms/source

Andras Timar atimar at suse.com
Wed Mar 27 08:31:02 PDT 2013


 forms/source/component/DatabaseForm.cxx |   18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)

New commits:
commit 91aaceb7275fe8aa163629646de4c3dc7c1c02b3
Author: Andras Timar <atimar at suse.com>
Date:   Wed Mar 27 08:30:38 2013 -0700

    fdo#39445 writing out tools/fsys.hxx (forms)
    
    Change-Id: Iee0812ee098c3b7c12d297461907a2923bad2cc5

diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx
index dea3797..91cedf4 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);
         }


More information about the Libreoffice-commits mailing list