summaryrefslogtreecommitdiffstats
path: root/dbaccess
diff options
context:
space:
mode:
authorRĂ¼diger Timm <rt@openoffice.org>2008-09-04 06:07:03 +0000
committerRĂ¼diger Timm <rt@openoffice.org>2008-09-04 06:07:03 +0000
commitd316fb9de99e9e0e65f6d1ea37ec5fd5979653f8 (patch)
treeb0679df3e36d2af435d3feb8744716e478989605 /dbaccess
parent#i10000# Define namespace prefix 'install'. (diff)
downloadcore-d316fb9de99e9e0e65f6d1ea37ec5fd5979653f8.tar.gz
core-d316fb9de99e9e0e65f6d1ea37ec5fd5979653f8.zip
INTEGRATION: CWS mav38_DEV300 (1.36.24); FILE MERGED
2008/09/01 10:28:38 mav 1.36.24.1: #i93288# let database application open the stream itself for now
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/filter/xml/dbloader2.cxx21
1 files changed, 19 insertions, 2 deletions
diff --git a/dbaccess/source/filter/xml/dbloader2.cxx b/dbaccess/source/filter/xml/dbloader2.cxx
index e55b785764eb..81288ea39160 100644
--- a/dbaccess/source/filter/xml/dbloader2.cxx
+++ b/dbaccess/source/filter/xml/dbloader2.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: dbloader2.cxx,v $
- * $Revision: 1.37 $
+ * $Revision: 1.38 $
*
* This file is part of OpenOffice.org.
*
@@ -143,16 +143,19 @@ DBTypeDetection::DBTypeDetection(const Reference< XMultiServiceFactory >& _rxFac
try
{
::comphelper::NamedValueCollection aMedia( Descriptor );
+ sal_Bool bStreamFromDescr = sal_False;
+ ::rtl::OUString sURL = aMedia.getOrDefault( "URL", ::rtl::OUString() );
+
Reference< XInputStream > xInStream( aMedia.getOrDefault( "InputStream", Reference< XInputStream >() ) );
Reference< XPropertySet > xStorageProperties;
if ( xInStream.is() )
{
+ bStreamFromDescr = sal_True;
xStorageProperties.set( ::comphelper::OStorageHelper::GetStorageFromInputStream(
xInStream, m_aContext.getLegacyServiceFactory() ), UNO_QUERY );
}
else
{
- ::rtl::OUString sURL = aMedia.getOrDefault( "URL", ::rtl::OUString() );
::rtl::OUString sSalvagedURL( aMedia.getOrDefault( "SalvagedFile", ::rtl::OUString() ) );
::rtl::OUString sFileLocation( sSalvagedURL.getLength() ? sSalvagedURL : sURL );
@@ -168,7 +171,21 @@ DBTypeDetection::DBTypeDetection(const Reference< XMultiServiceFactory >& _rxFac
::rtl::OUString sMediaType;
xStorageProperties->getPropertyValue( INFO_MEDIATYPE ) >>= sMediaType;
if ( sMediaType.equalsAscii(MIMETYPE_OASIS_OPENDOCUMENT_DATABASE_ASCII) || sMediaType.equalsAscii(MIMETYPE_VND_SUN_XML_BASE_ASCII) )
+ {
+ if ( bStreamFromDescr && sURL.compareTo( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "private:stream" ) ), 14 ) != COMPARE_EQUAL );
+ {
+ // After fixing of the i88522 issue ( use the new file locking for database files ) the stream from the type detection can be used further
+ // for now the file should be reopened to have read/write access
+ aMedia.remove( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "InputStream" ) ) );
+ aMedia >>= Descriptor;
+ try {
+ if ( xInStream.is() )
+ xInStream->closeInput();
+ } catch( Exception& ) {}
+ }
+
return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("StarBase"));
+ }
::comphelper::disposeComponent(xStorageProperties);
}
} catch(Exception&){}