diff options
Diffstat (limited to 'ucb/source/ucp/file')
36 files changed, 61 insertions, 74 deletions
diff --git a/ucb/source/ucp/file/bc.cxx b/ucb/source/ucp/file/bc.cxx index 8242276ad604..8242276ad604 100644..100755 --- a/ucb/source/ucp/file/bc.cxx +++ b/ucb/source/ucp/file/bc.cxx diff --git a/ucb/source/ucp/file/bc.hxx b/ucb/source/ucp/file/bc.hxx index 9b2571beeaf7..9b2571beeaf7 100644..100755 --- a/ucb/source/ucp/file/bc.hxx +++ b/ucb/source/ucp/file/bc.hxx diff --git a/ucb/source/ucp/file/exports2.dxp b/ucb/source/ucp/file/exports2.dxp index 6c42314f228b..4804c8d0ae57 100644..100755 --- a/ucb/source/ucp/file/exports2.dxp +++ b/ucb/source/ucp/file/exports2.dxp @@ -1,5 +1,4 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory _ZTIN3com3sun4star3ucb31InteractiveAugmentedIOExceptionE diff --git a/ucb/source/ucp/file/filcmd.cxx b/ucb/source/ucp/file/filcmd.cxx index 3e3d76133bad..3e3d76133bad 100644..100755 --- a/ucb/source/ucp/file/filcmd.cxx +++ b/ucb/source/ucp/file/filcmd.cxx diff --git a/ucb/source/ucp/file/filcmd.hxx b/ucb/source/ucp/file/filcmd.hxx index 2a9ed8b163d8..2a9ed8b163d8 100644..100755 --- a/ucb/source/ucp/file/filcmd.hxx +++ b/ucb/source/ucp/file/filcmd.hxx diff --git a/ucb/source/ucp/file/filerror.hxx b/ucb/source/ucp/file/filerror.hxx index 7fcdc8a4b34d..7fcdc8a4b34d 100644..100755 --- a/ucb/source/ucp/file/filerror.hxx +++ b/ucb/source/ucp/file/filerror.hxx diff --git a/ucb/source/ucp/file/filglob.cxx b/ucb/source/ucp/file/filglob.cxx index 1f073e81d157..1f073e81d157 100644..100755 --- a/ucb/source/ucp/file/filglob.cxx +++ b/ucb/source/ucp/file/filglob.cxx diff --git a/ucb/source/ucp/file/filglob.hxx b/ucb/source/ucp/file/filglob.hxx index 783a802a9af2..783a802a9af2 100644..100755 --- a/ucb/source/ucp/file/filglob.hxx +++ b/ucb/source/ucp/file/filglob.hxx diff --git a/ucb/source/ucp/file/filid.cxx b/ucb/source/ucp/file/filid.cxx index 58062bc164a2..58062bc164a2 100644..100755 --- a/ucb/source/ucp/file/filid.cxx +++ b/ucb/source/ucp/file/filid.cxx diff --git a/ucb/source/ucp/file/filid.hxx b/ucb/source/ucp/file/filid.hxx index 8e8d501e1708..8e8d501e1708 100644..100755 --- a/ucb/source/ucp/file/filid.hxx +++ b/ucb/source/ucp/file/filid.hxx diff --git a/ucb/source/ucp/file/filinl.hxx b/ucb/source/ucp/file/filinl.hxx index 5a353168c87a..5a353168c87a 100644..100755 --- a/ucb/source/ucp/file/filinl.hxx +++ b/ucb/source/ucp/file/filinl.hxx diff --git a/ucb/source/ucp/file/filinpstr.cxx b/ucb/source/ucp/file/filinpstr.cxx index 1299b33284ae..1299b33284ae 100644..100755 --- a/ucb/source/ucp/file/filinpstr.cxx +++ b/ucb/source/ucp/file/filinpstr.cxx diff --git a/ucb/source/ucp/file/filinpstr.hxx b/ucb/source/ucp/file/filinpstr.hxx index 69c996ae8b54..69c996ae8b54 100644..100755 --- a/ucb/source/ucp/file/filinpstr.hxx +++ b/ucb/source/ucp/file/filinpstr.hxx diff --git a/ucb/source/ucp/file/filinsreq.cxx b/ucb/source/ucp/file/filinsreq.cxx index 66ac700013e6..66ac700013e6 100644..100755 --- a/ucb/source/ucp/file/filinsreq.cxx +++ b/ucb/source/ucp/file/filinsreq.cxx diff --git a/ucb/source/ucp/file/filinsreq.hxx b/ucb/source/ucp/file/filinsreq.hxx index 03c2ab758f58..03c2ab758f58 100644..100755 --- a/ucb/source/ucp/file/filinsreq.hxx +++ b/ucb/source/ucp/file/filinsreq.hxx diff --git a/ucb/source/ucp/file/filnot.cxx b/ucb/source/ucp/file/filnot.cxx index f78e0c5ec6d1..f78e0c5ec6d1 100644..100755 --- a/ucb/source/ucp/file/filnot.cxx +++ b/ucb/source/ucp/file/filnot.cxx diff --git a/ucb/source/ucp/file/filnot.hxx b/ucb/source/ucp/file/filnot.hxx index 789455af7602..789455af7602 100644..100755 --- a/ucb/source/ucp/file/filnot.hxx +++ b/ucb/source/ucp/file/filnot.hxx diff --git a/ucb/source/ucp/file/filprp.cxx b/ucb/source/ucp/file/filprp.cxx index f96144b5c986..f96144b5c986 100644..100755 --- a/ucb/source/ucp/file/filprp.cxx +++ b/ucb/source/ucp/file/filprp.cxx diff --git a/ucb/source/ucp/file/filprp.hxx b/ucb/source/ucp/file/filprp.hxx index 9cb0727d4cb7..9cb0727d4cb7 100644..100755 --- a/ucb/source/ucp/file/filprp.hxx +++ b/ucb/source/ucp/file/filprp.hxx diff --git a/ucb/source/ucp/file/filrec.cxx b/ucb/source/ucp/file/filrec.cxx index 0986e3a738ab..0986e3a738ab 100644..100755 --- a/ucb/source/ucp/file/filrec.cxx +++ b/ucb/source/ucp/file/filrec.cxx diff --git a/ucb/source/ucp/file/filrec.hxx b/ucb/source/ucp/file/filrec.hxx index d1ba2e2ea7b4..d1ba2e2ea7b4 100644..100755 --- a/ucb/source/ucp/file/filrec.hxx +++ b/ucb/source/ucp/file/filrec.hxx diff --git a/ucb/source/ucp/file/filrow.cxx b/ucb/source/ucp/file/filrow.cxx index 5a49ed16dd0d..5a49ed16dd0d 100644..100755 --- a/ucb/source/ucp/file/filrow.cxx +++ b/ucb/source/ucp/file/filrow.cxx diff --git a/ucb/source/ucp/file/filrow.hxx b/ucb/source/ucp/file/filrow.hxx index 353489194d3f..353489194d3f 100644..100755 --- a/ucb/source/ucp/file/filrow.hxx +++ b/ucb/source/ucp/file/filrow.hxx diff --git a/ucb/source/ucp/file/filrset.cxx b/ucb/source/ucp/file/filrset.cxx index 88b78ff61a1d..88b78ff61a1d 100644..100755 --- a/ucb/source/ucp/file/filrset.cxx +++ b/ucb/source/ucp/file/filrset.cxx diff --git a/ucb/source/ucp/file/filrset.hxx b/ucb/source/ucp/file/filrset.hxx index 401bd8aae97b..401bd8aae97b 100644..100755 --- a/ucb/source/ucp/file/filrset.hxx +++ b/ucb/source/ucp/file/filrset.hxx diff --git a/ucb/source/ucp/file/filstr.cxx b/ucb/source/ucp/file/filstr.cxx index 6ecf53620377..6ecf53620377 100644..100755 --- a/ucb/source/ucp/file/filstr.cxx +++ b/ucb/source/ucp/file/filstr.cxx diff --git a/ucb/source/ucp/file/filstr.hxx b/ucb/source/ucp/file/filstr.hxx index aa49830b63cb..aa49830b63cb 100644..100755 --- a/ucb/source/ucp/file/filstr.hxx +++ b/ucb/source/ucp/file/filstr.hxx diff --git a/ucb/source/ucp/file/filtask.cxx b/ucb/source/ucp/file/filtask.cxx index 6629749c82b8..6629749c82b8 100644..100755 --- a/ucb/source/ucp/file/filtask.cxx +++ b/ucb/source/ucp/file/filtask.cxx diff --git a/ucb/source/ucp/file/filtask.hxx b/ucb/source/ucp/file/filtask.hxx index f34ef10c88d2..f34ef10c88d2 100644..100755 --- a/ucb/source/ucp/file/filtask.hxx +++ b/ucb/source/ucp/file/filtask.hxx diff --git a/ucb/source/ucp/file/makefile.mk b/ucb/source/ucp/file/makefile.mk index 8007a2492399..3d97cb23873c 100644..100755 --- a/ucb/source/ucp/file/makefile.mk +++ b/ucb/source/ucp/file/makefile.mk @@ -78,3 +78,11 @@ DEF1NAME=$(SHL1TARGET) .INCLUDE: target.mk + +ALLTAR : $(MISC)/ucpfile1.component + +$(MISC)/ucpfile1.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + ucpfile1.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt ucpfile1.component diff --git a/ucb/source/ucp/file/prov.cxx b/ucb/source/ucp/file/prov.cxx index 4292c5fefe87..bb14f176532d 100644..100755 --- a/ucb/source/ucp/file/prov.cxx +++ b/ucb/source/ucp/file/prov.cxx @@ -32,7 +32,6 @@ #include <osl/file.hxx> #include <osl/socket.h> #include <cppuhelper/factory.hxx> -#include <com/sun/star/registry/XRegistryKey.hpp> #include <com/sun/star/beans/PropertyAttribute.hpp> #include <com/sun/star/ucb/FileSystemNotation.hpp> #include <com/sun/star/beans/PropertyState.hpp> @@ -52,45 +51,6 @@ using namespace com::sun::star::ucb; using namespace com::sun::star::container; //========================================================================= -static sal_Bool writeInfo( void * pRegistryKey, - const rtl::OUString & rImplementationName, - Sequence< rtl::OUString > const & rServiceNames ) -{ - rtl::OUString aKeyName( RTL_CONSTASCII_USTRINGPARAM("/") ); - aKeyName += rImplementationName; - aKeyName += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); - - Reference< registry::XRegistryKey > xKey; - try - { - xKey = static_cast< registry::XRegistryKey * >( - pRegistryKey )->createKey( aKeyName ); - } - catch ( registry::InvalidRegistryException const & ) - { - } - - if ( !xKey.is() ) - return sal_False; - - sal_Bool bSuccess = sal_True; - - for ( sal_Int32 n = 0; n < rServiceNames.getLength(); ++n ) - { - try - { - xKey->createKey( rServiceNames[ n ] ); - } - catch ( registry::InvalidRegistryException const & ) - { - bSuccess = sal_False; - break; - } - } - return bSuccess; -} - -//========================================================================= extern "C" void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** ) { @@ -98,20 +58,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment( } //========================================================================= -extern "C" sal_Bool SAL_CALL component_writeInfo( void *, void * pRegistryKey ) -{ - return pRegistryKey && - - ////////////////////////////////////////////////////////////////////// - // File Content Provider. - ////////////////////////////////////////////////////////////////////// - - writeInfo( pRegistryKey, - fileaccess::shell::getImplementationName_static(), - fileaccess::shell::getSupportedServiceNames_static() ); -} - -//========================================================================= extern "C" void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * ) { diff --git a/ucb/source/ucp/file/prov.hxx b/ucb/source/ucp/file/prov.hxx index 5f24ab8b3921..5f24ab8b3921 100644..100755 --- a/ucb/source/ucp/file/prov.hxx +++ b/ucb/source/ucp/file/prov.hxx diff --git a/ucb/source/ucp/file/shell.cxx b/ucb/source/ucp/file/shell.cxx index 6e6f9931ef8e..c4131cab233b 100644..100755 --- a/ucb/source/ucp/file/shell.cxx +++ b/ucb/source/ucp/file/shell.cxx @@ -1806,14 +1806,26 @@ shell::write( sal_Int32 CommandId, { aFile.close(); err = aFile.open( osl_File_OpenFlag_Write ); - } - if( err != osl::FileBase::E_None ) - { - installError( CommandId, - TASKHANDLING_NO_OPEN_FILE_FOR_OVERWRITE, - err ); - return sal_False; + if( err != osl::FileBase::E_None ) + { + installError( CommandId, + TASKHANDLING_NO_OPEN_FILE_FOR_OVERWRITE, + err ); + return sal_False; + } + + // the existing file was just opened and should be overwritten now, + // truncate it first + + err = aFile.setSize( 0 ); + if( err != osl::FileBase::E_None ) + { + installError( CommandId, + TASKHANDLING_FILESIZE_FOR_WRITE, + err ); + return sal_False; + } } } else @@ -1845,7 +1857,6 @@ shell::write( sal_Int32 CommandId, sal_Bool bSuccess = sal_True; - sal_uInt64 nTotalNumberOfBytes = 0; sal_uInt64 nWrittenBytes; sal_Int32 nReadBytes = 0, nRequestedBytes = 32768 /*32k*/; uno::Sequence< sal_Int8 > seq( nRequestedBytes ); @@ -1902,20 +1913,9 @@ shell::write( sal_Int32 CommandId, bSuccess = sal_False; break; } - - nTotalNumberOfBytes += nWrittenBytes; } } while( nReadBytes == nRequestedBytes ); - err = aFile.setSize( nTotalNumberOfBytes ); - if( err != osl::FileBase::E_None ) - { - installError( CommandId, - TASKHANDLING_FILESIZE_FOR_WRITE, - err ); - bSuccess = sal_False; - } - err = aFile.close(); if( err != osl::FileBase::E_None ) { diff --git a/ucb/source/ucp/file/shell.hxx b/ucb/source/ucp/file/shell.hxx index 2660fa119bfa..2660fa119bfa 100644..100755 --- a/ucb/source/ucp/file/shell.hxx +++ b/ucb/source/ucp/file/shell.hxx diff --git a/ucb/source/ucp/file/ucpfile.xml b/ucb/source/ucp/file/ucpfile.xml index bd205639f476..bd205639f476 100644..100755 --- a/ucb/source/ucp/file/ucpfile.xml +++ b/ucb/source/ucp/file/ucpfile.xml diff --git a/ucb/source/ucp/file/ucpfile1.component b/ucb/source/ucp/file/ucpfile1.component new file mode 100755 index 000000000000..28032451220a --- /dev/null +++ b/ucb/source/ucp/file/ucpfile1.component @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.comp.ucb.FileProvider"> + <service name="com.sun.star.ucb.FileContentProvider"/> + </implementation> +</component> |