diff options
Diffstat (limited to 'svx/source/msfilter/svxmsbas.cxx')
-rw-r--r-- | svx/source/msfilter/svxmsbas.cxx | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/svx/source/msfilter/svxmsbas.cxx b/svx/source/msfilter/svxmsbas.cxx index 17674c4254ca..48823640af61 100644 --- a/svx/source/msfilter/svxmsbas.cxx +++ b/svx/source/msfilter/svxmsbas.cxx @@ -403,53 +403,4 @@ BOOL SvxImportMSVBasic::ImportCode_Impl( const String& rStorageName, return bRet; } -ULONG SvxImportMSVBasic::SaveOrDelMSVBAStorage( BOOL bSaveInto, - const String& rStorageName ) -{ - ULONG nRet = ERRCODE_NONE; - uno::Reference < embed::XStorage > xSrcRoot( rDocSh.GetStorage() ); - String aDstStgName( GetMSBasicStorageName() ); - SotStorageRef xVBAStg( SotStorage::OpenOLEStorage( xSrcRoot, aDstStgName, - STREAM_READWRITE | STREAM_NOCREATE | STREAM_SHARE_DENYALL ) ); - if( xVBAStg.Is() && !xVBAStg->GetError() ) - { - xVBAStg = 0; - if( bSaveInto ) - { - BasicManager *pBasicMan = rDocSh.GetBasicManager(); - if( pBasicMan && pBasicMan->IsBasicModified() ) - nRet = ERRCODE_SVX_MODIFIED_VBASIC_STORAGE; - - SotStorageRef xSrc = SotStorage::OpenOLEStorage( xSrcRoot, aDstStgName, STREAM_STD_READ ); - SotStorageRef xDst = xRoot->OpenSotStorage( rStorageName, STREAM_READWRITE | STREAM_TRUNC ); - xSrc->CopyTo( xDst ); - xDst->Commit(); - ErrCode nError = xDst->GetError(); - if ( nError == ERRCODE_NONE ) - nError = xSrc->GetError(); - if ( nError != ERRCODE_NONE ) - xRoot->SetError( nError ); - } - } - - return nRet; -} - -// check if the MS-VBA-Storage exists in the RootStorage of the DocShell. -// If it exists, then return the WarningId for losing the information. -ULONG SvxImportMSVBasic::GetSaveWarningOfMSVBAStorage( SfxObjectShell &rDocSh) -{ - uno::Reference < embed::XStorage > xSrcRoot( rDocSh.GetStorage() ); - SvStorageRef xVBAStg( SotStorage::OpenOLEStorage( xSrcRoot, GetMSBasicStorageName(), - STREAM_READ | STREAM_NOCREATE | STREAM_SHARE_DENYALL )); - return ( xVBAStg.Is() && !xVBAStg->GetError() ) - ? ERRCODE_SVX_VBASIC_STORAGE_EXIST - : ERRCODE_NONE; -} - -String SvxImportMSVBasic::GetMSBasicStorageName() -{ - return String( RTL_CONSTASCII_USTRINGPARAM( "_MS_VBA_Macros" ) ); -} - /* vi:set tabstop=4 shiftwidth=4 expandtab: */ |