From 0e6ab013f7def9891c2e982bec76458a64953c20 Mon Sep 17 00:00:00 2001 From: Hans-Joachim Lankenau Date: Mon, 30 May 2011 18:09:09 +0200 Subject: ause130: #i117218# change .idl handling to gnu make --- sot/Library_sot.mk | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'sot') diff --git a/sot/Library_sot.mk b/sot/Library_sot.mk index 51679534763c..927fdc001045 100644 --- a/sot/Library_sot.mk +++ b/sot/Library_sot.mk @@ -36,7 +36,11 @@ $(eval $(call gb_Library_set_componentfile,sot,sot/util/sot)) $(eval $(call gb_Library_set_include,sot,\ -I$(realpath $(SRCDIR)/sot/inc/pch) \ $$(INCLUDE) \ - -I$(OUTDIR)/inc/offuh \ +)) + +$(eval $(call gb_Library_add_api,sot,\ + udkapi \ + offapi \ )) $(eval $(call gb_Library_set_defs,sot,\ -- cgit From ec2ba4881538f485ed17dd1c44c2a9fd0a5d971a Mon Sep 17 00:00:00 2001 From: Matus Kukan Date: Fri, 24 Jun 2011 14:56:31 +0100 Subject: update component factory methods to use new prefixes, to add lib merging --- sot/source/unoolestorage/register.cxx | 4 ++-- sot/util/sot.component | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'sot') diff --git a/sot/source/unoolestorage/register.cxx b/sot/source/unoolestorage/register.cxx index 696e0cefed93..30f417b29625 100644 --- a/sot/source/unoolestorage/register.cxx +++ b/sot/source/unoolestorage/register.cxx @@ -41,12 +41,12 @@ using namespace ::com::sun::star; extern "C" { -SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ ) +SAL_DLLPUBLIC_EXPORT void SAL_CALL sot_component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ ) { *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ ) +SAL_DLLPUBLIC_EXPORT void * SAL_CALL sot_component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ ) { void * pRet = 0; diff --git a/sot/util/sot.component b/sot/util/sot.component index 7d17c7d54475..44ca8cea7a9a 100644 --- a/sot/util/sot.component +++ b/sot/util/sot.component @@ -26,7 +26,7 @@ * **********************************************************************--> - -- cgit From ae25807a8462e71433798283f29b2ff82ba3a9df Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 30 Jun 2011 22:54:36 +0100 Subject: ByteString::CreateFromInt32 -> OString::valueOf --- sot/source/base/factory.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'sot') diff --git a/sot/source/base/factory.cxx b/sot/source/base/factory.cxx index 01d098e62a75..79393375138d 100644 --- a/sot/source/base/factory.cxx +++ b/sot/source/base/factory.cxx @@ -39,6 +39,7 @@ #include #include #include +#include /************** class SotData_Impl *********************************************/ /************************************************************************* @@ -78,9 +79,9 @@ void SotFactory::DeInit() if( pSotData->nSvObjCount ) { #ifdef DBG_UTIL - ByteString aStr( "Objects alive: " ); - aStr.Append( ByteString::CreateFromInt32( pSotData->nSvObjCount ) ); - DBG_WARNING( aStr.GetBuffer() ); + rtl::OStringBuffer aStr(RTL_CONSTASCII_STRINGPARAM("Objects alive: ")); + aStr.append(static_cast(pSotData->nSvObjCount)); + DBG_WARNING(aStr.getStr()); #endif return; } -- cgit From d8ba18651cdca6037ee187b586d3c309a9db3528 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 3 Jul 2011 12:30:00 +0100 Subject: Related: #i46388# busted ole2 wrapper --- sot/source/sdstor/stgstrms.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sot') diff --git a/sot/source/sdstor/stgstrms.cxx b/sot/source/sdstor/stgstrms.cxx index fe40be155b9e..48e8de3ede6d 100644 --- a/sot/source/sdstor/stgstrms.cxx +++ b/sot/source/sdstor/stgstrms.cxx @@ -798,7 +798,7 @@ void* StgDataStrm::GetPtr( sal_Int32 Pos, sal_Bool bForce, sal_Bool bDirty ) if( Pos2Page( Pos ) ) { StgPage* pPg = rIo.Get( nPage, bForce ); - if( pPg ) + if (pPg && nOffset < pPg->GetSize()) { pPg->SetOwner( pEntry ); if( bDirty ) -- cgit From 3b88fce03981b6c54ae545cece8bb3843be5143f Mon Sep 17 00:00:00 2001 From: Katarina Machalkova Date: Thu, 7 Jul 2011 16:14:30 +0300 Subject: Duplicate entries in Directory definition are no longer treated as errors Fixes a problem where cetain XLS documents open as blank in LibreOffice. Described in the non-public bnc#682484. --- sot/source/sdstor/stgdir.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sot') diff --git a/sot/source/sdstor/stgdir.cxx b/sot/source/sdstor/stgdir.cxx index 4951daa70a6c..fc9610a6af3b 100644 --- a/sot/source/sdstor/stgdir.cxx +++ b/sot/source/sdstor/stgdir.cxx @@ -853,7 +853,10 @@ void StgDirStrm::SetupEntry( sal_Int32 n, StgDirEntry* pUpper ) } else { - rIo.SetError( SVSTREAM_CANNOT_MAKE ); + // bnc#682484: There are some really broken docs out there + // that contain duplicate entries in 'Directory' section + // so don't set the error flag here and just skip those + // (was: rIo.SetError( SVSTREAM_CANNOT_MAKE );) delete pCur; pCur = NULL; return; } -- cgit From f2da6ac0fab2f2a990437e272a14b0e4c25e1a27 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 10 Jul 2011 22:31:10 +0100 Subject: callcatcher: drop ugly unused hack --- sot/inc/sot/storage.hxx | 3 -- sot/source/sdstor/storage.cxx | 123 ------------------------------------------ 2 files changed, 126 deletions(-) (limited to 'sot') diff --git a/sot/inc/sot/storage.hxx b/sot/inc/sot/storage.hxx index e1ce95158b12..00348429894b 100644 --- a/sot/inc/sot/storage.hxx +++ b/sot/inc/sot/storage.hxx @@ -242,9 +242,6 @@ public: static sal_Bool IsOLEStorage( const String & rFileName ); static sal_Bool IsOLEStorage( SvStream* pStream ); - // this is temporary HACK, _MUST_ be removed before release - ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > - GetUNOAPIDuplicate( const String& rEleName, sal_Int32 nUNOStorageMode ); void RemoveUNOStorageHolder( UNOStorageHolder* pHolder ); static SotStorage* OpenOLEStorage( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage, diff --git a/sot/source/sdstor/storage.cxx b/sot/source/sdstor/storage.cxx index ef398d081904..ae76765a5a3f 100644 --- a/sot/source/sdstor/storage.cxx +++ b/sot/source/sdstor/storage.cxx @@ -743,129 +743,6 @@ void SotStorage::RemoveUNOStorageHolder( UNOStorageHolder* pHolder ) } } -/************************************************************************* -|* SotStorage::GetUNOAPIDuplicate() -|* -|* Beschreibung -*************************************************************************/ -uno::Reference< embed::XStorage > SotStorage::GetUNOAPIDuplicate( const String& rEleName, sal_Int32 nUNOStorageMode ) -{ - // after we create a duplicate we will register wrapper - // for storage messages, the wrapper will control the real storage - // the real storage will be able to ask the duplicate to dispose if it's parent is disposed - - uno::Reference< embed::XStorage > xResult; - - UCBStorage* pStg = PTR_CAST( UCBStorage, m_pOwnStg ); - if ( !pStg ) - return xResult; - - UNOStorageHolderList* pUNOStorageHolderList = pStg->GetUNOStorageHolderList(); - if ( !pUNOStorageHolderList ) - return xResult; - - for ( UNOStorageHolderList::iterator aIter = pUNOStorageHolderList->begin(); - aIter != pUNOStorageHolderList->end(); ++aIter ) - if ( (*aIter) && (*aIter)->GetStorageName().Equals( rEleName ) ) - { - // the storage is already in use - return xResult; - } - - if ( IsStream( rEleName ) ) - return xResult; - - if ( GetError() == ERRCODE_NONE ) - { - StreamMode nMode = ( ( nUNOStorageMode & embed::ElementModes::WRITE ) == embed::ElementModes::WRITE ) ? - STREAM_WRITE : ( STREAM_READ | STREAM_NOCREATE ); - if ( nUNOStorageMode & embed::ElementModes::NOCREATE ) - nMode |= STREAM_NOCREATE; - - sal_Bool bStorageReady = !IsStorage( rEleName ); - SotStorageRef pChildStorage = OpenUCBStorage( rEleName, nMode, STORAGE_TRANSACTED ); - if ( pChildStorage->GetError() == ERRCODE_NONE && pChildStorage->m_pOwnStg ) - { - ::utl::TempFile* pTempFile = new ::utl::TempFile(); - if ( pTempFile->GetURL().Len() ) - { - if ( !bStorageReady ) - { - UCBStorage* pChildUCBStg = PTR_CAST( UCBStorage, pChildStorage->m_pOwnStg ); - if ( pChildUCBStg ) - { - UCBStorage* pTempStorage = new UCBStorage( pTempFile->GetURL(), STREAM_WRITE, sal_False, sal_True ); - if ( pTempStorage ) - { - pChildUCBStg->CopyTo( pTempStorage ); - - // CopyTo does not transport unknown media type - // just workaround it - uno::Any aMediaType; - - if ( pChildUCBStg->GetProperty( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")), aMediaType ) ) - pTempStorage->SetProperty( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")), aMediaType ); - - bStorageReady = !pChildUCBStg->GetError() && !pTempStorage->GetError() - && pTempStorage->Commit(); - - delete ((BaseStorage*)pTempStorage); - pTempStorage = NULL; - } - } - - OSL_ENSURE( bStorageReady, "Problem on storage copy!\n" ); - } - - if ( bStorageReady ) - { - try { - uno::Reference< lang::XSingleServiceFactory > xStorageFactory( - ::comphelper::getProcessServiceFactory()->createInstance( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.embed.StorageFactory")) ), - uno::UNO_QUERY ); - - OSL_ENSURE( xStorageFactory.is(), "Can't create storage factory!\n" ); - if ( xStorageFactory.is() ) - { - uno::Sequence< uno::Any > aArg( 2 ); - aArg[0] <<= ::rtl::OUString( pTempFile->GetURL() ); - aArg[1] <<= nUNOStorageMode; - uno::Reference< embed::XStorage > xDuplStorage( - xStorageFactory->createInstanceWithArguments( aArg ), - uno::UNO_QUERY ); - - OSL_ENSURE( xDuplStorage.is(), "Can't open storage!\n" ); - if ( xDuplStorage.is() ) - { - UNOStorageHolder* pHolder = - new UNOStorageHolder( *this, *pChildStorage, xDuplStorage, pTempFile ); - pHolder->acquire(); - pTempFile = NULL; - pUNOStorageHolderList->push_back( pHolder ); - xResult = xDuplStorage; - } - } - } - catch( uno::Exception& e ) - { - (void)e; - OSL_FAIL( ::rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ) ); - } - } - } - - if ( pTempFile != NULL ) - delete pTempFile; - } - else - SetError( pChildStorage->GetError() ); - } - - return xResult; -} - /************************************************************************* |* SotStorage::CreateMemoryStream() |* -- cgit From 9ebaee5987400331c4a8f65e44f2ef1b4c83932b Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 11 Jul 2011 13:44:07 +0100 Subject: callcatcher: remove unused SotStorage::OpenEncryptedSotStream --- sot/inc/sot/storage.hxx | 3 --- sot/source/sdstor/storage.cxx | 32 -------------------------------- 2 files changed, 35 deletions(-) (limited to 'sot') diff --git a/sot/inc/sot/storage.hxx b/sot/inc/sot/storage.hxx index 00348429894b..9913edaaa40f 100644 --- a/sot/inc/sot/storage.hxx +++ b/sot/inc/sot/storage.hxx @@ -208,9 +208,6 @@ public: SotStorageStream * OpenSotStream( const String & rEleName, StreamMode = STREAM_STD_READWRITE, StorageMode = 0 ); - SotStorageStream * OpenEncryptedSotStream( const String & rEleName, const ByteString& rKey, - StreamMode = STREAM_STD_READWRITE, - StorageMode = 0 ); SotStorage * OpenSotStorage( const String & rEleName, StreamMode = STREAM_STD_READWRITE, StorageMode = STORAGE_TRANSACTED ); diff --git a/sot/source/sdstor/storage.cxx b/sot/source/sdstor/storage.cxx index ae76765a5a3f..50a30d89b45e 100644 --- a/sot/source/sdstor/storage.cxx +++ b/sot/source/sdstor/storage.cxx @@ -987,38 +987,6 @@ sal_Bool SotStorage::Revert() return SVSTREAM_OK == GetError(); } -/************************************************************************* -|* SotStorage::OpenStream() -|* -|* Beschreibung -*************************************************************************/ -SotStorageStream * SotStorage::OpenEncryptedSotStream( const String & rEleName, const ByteString& rKey, - StreamMode nMode, - StorageMode nStorageMode ) -{ - DBG_ASSERT( !nStorageMode, "StorageModes ignored" ); - SotStorageStream * pStm = NULL; - DBG_ASSERT( Owner(), "must be owner" ); - if( m_pOwnStg ) - { - // volle Ole-Patches einschalten - // egal was kommt, nur exclusiv gestattet - nMode |= STREAM_SHARE_DENYALL; - ErrCode nE = m_pOwnStg->GetError(); - BaseStorageStream* p = m_pOwnStg->OpenStream( rEleName, nMode, - (nStorageMode & STORAGE_TRANSACTED) ? sal_False : sal_True, &rKey ); - pStm = new SotStorageStream( p ); - - if( !nE ) - m_pOwnStg->ResetError(); // kein Fehler setzen - if( nMode & STREAM_TRUNC ) - pStm->SetSize( 0 ); - } - else - SetError( SVSTREAM_GENERALERROR ); - return pStm; -} - SotStorageStream * SotStorage::OpenSotStream( const String & rEleName, StreamMode nMode, StorageMode nStorageMode ) -- cgit From a554c674d706f392ff9a073525ceec571072c60b Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 11 Jul 2011 13:55:44 +0100 Subject: callcatcher: remove unused UCBStorageStream ctor --- sot/inc/sot/stg.hxx | 1 - sot/source/sdstor/ucbstorage.cxx | 9 --------- 2 files changed, 10 deletions(-) (limited to 'sot') diff --git a/sot/inc/sot/stg.hxx b/sot/inc/sot/stg.hxx index 2d17974d0a2d..df43ca771e3c 100644 --- a/sot/inc/sot/stg.hxx +++ b/sot/inc/sot/stg.hxx @@ -262,7 +262,6 @@ protected: ~UCBStorageStream(); public: TYPEINFO(); - UCBStorageStream( const String& rName, StreamMode nMode, sal_Bool bDirect, const ByteString* pKey=0 ); UCBStorageStream( const String& rName, StreamMode nMode, sal_Bool bDirect, const ByteString* pKey, sal_Bool bRepair, ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XProgressHandler > xProgress ); UCBStorageStream( UCBStorageStream_Impl* ); diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx index 198a6572dec3..67b033c4415b 100644 --- a/sot/source/sdstor/ucbstorage.cxx +++ b/sot/source/sdstor/ucbstorage.cxx @@ -1336,15 +1336,6 @@ void UCBStorageStream_Impl::PrepareCachedForReopen( StreamMode nMode ) } } -UCBStorageStream::UCBStorageStream( const String& rName, StreamMode nMode, sal_Bool bDirect, const ByteString* pKey ) -{ - // pImp must be initialized in the body, because otherwise the vtable of the stream is not initialized - // to class UCBStorageStream ! - pImp = new UCBStorageStream_Impl( rName, nMode, this, bDirect, pKey ); - pImp->AddRef(); // use direct refcounting because in header file only a pointer should be used - StorageBase::m_nMode = pImp->m_nMode; -} - UCBStorageStream::UCBStorageStream( const String& rName, StreamMode nMode, sal_Bool bDirect, const ByteString* pKey, sal_Bool bRepair, Reference< XProgressHandler > xProgress ) { // pImp must be initialized in the body, because otherwise the vtable of the stream is not initialized -- cgit From 22f299b12e1c874a43b38f7efdda0d1b952d09a0 Mon Sep 17 00:00:00 2001 From: Matus Kukan Date: Sun, 3 Jul 2011 17:43:02 +0200 Subject: Remove component_getImplementationEnvironment methods --- sot/source/unoolestorage/register.cxx | 5 ----- 1 file changed, 5 deletions(-) (limited to 'sot') diff --git a/sot/source/unoolestorage/register.cxx b/sot/source/unoolestorage/register.cxx index 30f417b29625..2738a8054af3 100644 --- a/sot/source/unoolestorage/register.cxx +++ b/sot/source/unoolestorage/register.cxx @@ -41,11 +41,6 @@ using namespace ::com::sun::star; extern "C" { -SAL_DLLPUBLIC_EXPORT void SAL_CALL sot_component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ ) -{ - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - SAL_DLLPUBLIC_EXPORT void * SAL_CALL sot_component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ ) { void * pRet = 0; -- cgit From 3b7a12766361a1425566ea909e0003ec8c8ea73d Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 13 Jul 2011 00:49:10 +0100 Subject: init against short reads --- sot/source/sdstor/ucbstorage.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sot') diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx index 67b033c4415b..dfc5024889a3 100644 --- a/sot/source/sdstor/ucbstorage.cxx +++ b/sot/source/sdstor/ucbstorage.cxx @@ -3266,7 +3266,7 @@ sal_Bool UCBStorage::IsStorageFile( SvStream* pFile ) return sal_False; pFile->Seek(0); - sal_uInt32 nBytes; + sal_uInt32 nBytes(0); *pFile >> nBytes; // search for the magic bytes @@ -3277,6 +3277,7 @@ sal_Bool UCBStorage::IsStorageFile( SvStream* pFile ) bRet = ( nBytes == 0x08074b50 ); if ( bRet ) { + nBytes = 0; *pFile >> nBytes; bRet = ( nBytes == 0x04034b50 ); } -- cgit