diff options
author | Mathias Bauer <mba@openoffice.org> | 2001-11-01 10:14:16 +0000 |
---|---|---|
committer | Mathias Bauer <mba@openoffice.org> | 2001-11-01 10:14:16 +0000 |
commit | 9ca112cb37dadcd35c1cd9771c7b3f9bae1d228a (patch) | |
tree | 6afabf9b66bf005e7580b772d630a897e9fe6acc /sfx2/source | |
parent | 4e9dd51582cb8008fc964037ab7db007dae2ee56 (diff) |
#93478#: support for ViewData
Diffstat (limited to 'sfx2/source')
-rw-r--r-- | sfx2/source/appl/appuno.cxx | 17 | ||||
-rw-r--r-- | sfx2/source/view/viewsh.cxx | 46 |
2 files changed, 58 insertions, 5 deletions
diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx index e9f970eb4d03..999da6f7d55d 100644 --- a/sfx2/source/appl/appuno.cxx +++ b/sfx2/source/appl/appuno.cxx @@ -2,9 +2,9 @@ * * $RCSfile: appuno.cxx,v $ * - * $Revision: 1.32 $ + * $Revision: 1.33 $ * - * last change: $Author: mba $ $Date: 2001-10-02 07:26:15 $ + * last change: $Author: mba $ $Date: 2001-11-01 11:13:28 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -225,7 +225,8 @@ static const String sOrigURL = String::CreateFromAscii( "OriginalURL" static const String sSalvageURL = String::CreateFromAscii( "SalvagedFile" ); static const String sStatusInd = String::CreateFromAscii( "StatusIndicator" ); static const String sModel = String::CreateFromAscii( "Model" ); -static const String sFrame = String::CreateFromAscii("Frame"); +static const String sFrame = String::CreateFromAscii( "Frame" ); +static const String sViewData = String::CreateFromAscii( "ViewData" ); void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& rArgs, SfxAllItemSet& rSet, const SfxSlot* pSlot ) { @@ -288,6 +289,9 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque else if ( aName == sStatusInd ) rSet.Put( SfxUnoAnyItem( SID_PROGRESS_STATUSBAR_CONTROL, rProp.Value ) ); + else if ( aName == sViewData ) + rSet.Put( SfxUnoAnyItem( SID_VIEW_DATA, rProp.Value ) ); + else if ( aName == sInputStream && rProp.Value.getValueType() == ::getCppuType( (Reference < XInputStream >*)0 ) ) rSet.Put( SfxUnoAnyItem( SID_INPUTSTREAM, rProp.Value ) ); @@ -401,6 +405,8 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta nItems++; if ( rSet.GetItemState( SID_VIEW_ID ) == SFX_ITEM_SET ) nItems++; + if ( rSet.GetItemState( SID_VIEW_DATA ) == SFX_ITEM_SET ) + nItems++; if ( rSet.GetItemState( SID_PLUGIN_MODE ) == SFX_ITEM_SET ) nItems++; if ( rSet.GetItemState( SID_DOC_READONLY ) == SFX_ITEM_SET ) @@ -452,6 +458,11 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta pValue[nItems].Name = sStatusInd; pValue[nItems++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); } + if ( rSet.GetItemState( SID_VIEW_DATA, sal_False, &pItem ) == SFX_ITEM_SET ) + { + pValue[nItems].Name = sViewData; + pValue[nItems++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); + } if ( rSet.GetItemState( SID_DOCUMENT, sal_False, &pItem ) == SFX_ITEM_SET ) { pValue[nItems].Name = sModel; diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index b1f49fc37d39..e307d5bb88ff 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -2,9 +2,9 @@ * * $RCSfile: viewsh.cxx,v $ * - * $Revision: 1.22 $ + * $Revision: 1.23 $ * - * last change: $Author: cd $ $Date: 2001-09-24 12:37:39 $ + * last change: $Author: mba $ $Date: 2001-11-01 11:14:16 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -98,6 +98,8 @@ #endif #include <svtools/javaoptions.hxx> +#include <basic/basmgr.hxx> +#include <basic/sbuno.hxx> #pragma hdrstop @@ -125,6 +127,7 @@ #include "sfxbasecontroller.hxx" #include "topfrm.hxx" #include "mailmodel.hxx" +#include "event.hxx" using namespace ::com::sun::star::uno; using namespace ::com::sun::star::frame; @@ -573,6 +576,26 @@ void SfxViewShell::Activate( BOOL bMDI ) aObject.setFinalSlash(); INetURLObject::SetBaseURL( aObject.GetMainURL() ); } + + if ( SFX_APP()->IsInBasicCall() ) + { + BasicManager *pAppMgr = SFX_APP()->GetBasicManager(); + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xInterface ( pSh->GetModel() , ::com::sun::star::uno::UNO_QUERY ); + ::com::sun::star::uno::Any aComponent; + aComponent <<= xInterface; + SbxVariable *pCompVar = pAppMgr->GetLib(0)->Find( DEFINE_CONST_UNICODE("ThisComponent"), SbxCLASS_PROPERTY ); + if ( pCompVar ) + { + pCompVar->PutObject( GetSbUnoObject( DEFINE_CONST_UNICODE("ThisComponent"), aComponent ) ); + } + else + { + SbxObjectRef xUnoObj = GetSbUnoObject( DEFINE_CONST_UNICODE("ThisComponent"), aComponent ); + xUnoObj->SetFlag( SBX_DONTSTORE ); + StarBASIC *pBas = pAppMgr->GetLib(0); + pBas->Insert( xUnoObj ); + } + } } } @@ -1220,6 +1243,25 @@ void SfxViewShell::SFX_NOTIFY( SfxBroadcaster& rBC, SetPrinter_Impl( new SfxPrinter(pPrinter->GetOptions().Clone()) ); } #endif + + if ( rHint.IsA(TYPE(SfxEventHint)) ) + { + switch ( ((SfxEventHint&)rHint).GetEventId() ) + { + case SFX_EVENT_LOADFINISHED: + { + if ( GetController().is() ) + { + SfxItemSet* pSet = GetObjectShell()->GetMedium()->GetItemSet(); + SFX_ITEMSET_ARG( pSet, pItem, SfxUsrAnyItem, SID_VIEW_DATA, sal_False ); + if ( pItem ) + pImp->pController->restoreViewData( pItem->GetValue() ); + pSet->ClearItem( SID_VIEW_DATA ); + } + break; + } + } + } } //-------------------------------------------------------------------- |