diff options
author | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2010-01-08 22:50:33 +0100 |
---|---|---|
committer | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2010-01-08 22:50:33 +0100 |
commit | 980ad53327be1da380d473389cf3c7e74726d56a (patch) | |
tree | 1efd8f269b60ba1c7d70846be4b1315787491621 /sfx2/source/view/frame.cxx | |
parent | b0c799c7fbaa93f707bf18a87eb9aef5d86be52c (diff) | |
parent | 4380167e1451a1372dcbfa0e839235a46455dabc (diff) |
autorecovery: merge after rebase to m69
Diffstat (limited to 'sfx2/source/view/frame.cxx')
-rw-r--r-- | sfx2/source/view/frame.cxx | 684 |
1 files changed, 63 insertions, 621 deletions
diff --git a/sfx2/source/view/frame.cxx b/sfx2/source/view/frame.cxx index c88297e477f7..7ae0f9d8cf39 100644 --- a/sfx2/source/view/frame.cxx +++ b/sfx2/source/view/frame.cxx @@ -80,7 +80,7 @@ #include <sfx2/fcontnr.hxx> #include "impframe.hxx" #include <sfx2/appuno.hxx> -#include <sfx2/topfrm.hxx> +#include <sfx2/viewfrm.hxx> #include "workwin.hxx" #include <sfx2/sfxuno.hxx> #include <sfx2/msgpool.hxx> @@ -103,41 +103,29 @@ using namespace ::com::sun::star::container; TYPEINIT1(SfxFrame, SfxListener); TYPEINIT1_AUTOFACTORY(SfxFrameItem, SfxPoolItem); TYPEINIT1(SfxUsrAnyItem, SfxPoolItem); - -SfxFrame::SfxFrame(SfxFrame* pParent): - pParentFrame( pParent ), - pChildArr(0), - pUnoImp(0) -{ - pImp = new SfxFrame_Impl( this ); - if ( pParent ) - pParent->InsertChildFrame_Impl( this ); - if ( !pFramesArr_Impl ) - pFramesArr_Impl = new SfxFrameArr_Impl; - pFramesArr_Impl->Insert( this, pFramesArr_Impl->Count() ); -} +TYPEINIT1_AUTOFACTORY(SfxUnoFrameItem, SfxPoolItem); SvCompatWeakHdl* SfxFrame::GetHdl() { return pImp->GetHdl(); } -SfxCancelManager* SfxFrame::GetCancelManager() const +//-------------------------------------------------------------------- +void SfxFrame::Construct_Impl() { - SfxFrame *pFrame = GetTopFrame(); - SfxCancelManager*& rpMgr = pFrame->pImp->pCancelMgr; - if ( !rpMgr ) - { - rpMgr = new SfxCancelManager( SFX_APP()->GetCancelManager() ); - pFrame->pImp->StartListening( *rpMgr ); - } - return rpMgr; + pImp = new SfxFrame_Impl( this ); + if ( !pFramesArr_Impl ) + pFramesArr_Impl = new SfxFrameArr_Impl; + pFramesArr_Impl->Insert( this, pFramesArr_Impl->Count() ); } //-------------------------------------------------------------------- SfxFrame::~SfxFrame() { + RemoveTopFrame_Impl( this ); + DELETEZ( pWindow ); + pFramesArr_Impl->Remove( pFramesArr_Impl->GetPos( this ) ); if ( pParentFrame ) @@ -217,53 +205,6 @@ sal_Bool SfxFrame::DoClose_Impl() return bRet; } -void SfxFrame::Clear_Impl() -{ - CancelTransfers(); - - // Bei FrameSets verhindern, da\s das Closen der Childs zu st"andigen - // ReCalcs im SplitWindow f"uhrt; SetUpdateMode am FrameWindow wirkt - // leider nicht auf dem MAC - Window *pWin = NULL; - SfxViewShell *pViewSh; - if ( pImp->pCurrentViewFrame && - 0 != ( pViewSh = pImp->pCurrentViewFrame->GetViewShell() ) ) - { - pWin = pViewSh->GetWindow(); - if ( pWin ) - pWin->Hide(); - } - - sal_Bool bRet = sal_True; - SfxBindings* pBindings = NULL; - if ( pImp->pCurrentViewFrame ) - { - pBindings = &pImp->pCurrentViewFrame->GetBindings(); - pImp->bClosing = sal_True; - bRet = pImp->pCurrentViewFrame->Close(); - pImp->bClosing = sal_False; - } - - if ( bRet ) - { - // Bei internen Tasks m"ussen Controller und Tools abger"aumt werden - if ( pImp->pWorkWin ) - { - pImp->pWorkWin->DeleteControllers_Impl(); - DELETEZ( pImp->pWorkWin ); - } - - if ( pImp->bOwnsBindings ) - delete pBindings; - } - else - { - if ( pWin ) - pWin->Show(); - } -} - - sal_Bool SfxFrame::DocIsModified_Impl() { if ( pImp->pCurrentViewFrame && pImp->pCurrentViewFrame->GetObjectShell() && @@ -293,7 +234,7 @@ sal_uInt16 SfxFrame::PrepareClose_Impl( sal_Bool bUI, sal_Bool bForBrowsing ) for ( const SfxViewFrame *pFrame = SfxViewFrame::GetFirst( pCur ); !bOther && pFrame; pFrame = SfxViewFrame::GetNext( *pFrame, pCur ) ) { - bOther = ( pFrame->GetFrame() != this ); + bOther = ( &pFrame->GetFrame() != this ); } SFX_APP()->NotifyEvent( SfxEventHint(SFX_EVENT_PREPARECLOSEVIEW, GlobalEventConfig::GetEventName( STR_EVENT_PREPARECLOSEVIEW ), pCur) ); @@ -336,164 +277,19 @@ SfxFrame* SfxFrame::GetChildFrame( sal_uInt16 nPos ) const return 0L; } -void SfxFrame::InsertChildFrame_Impl( SfxFrame* pFrame, sal_uInt16 nPos ) -{ - if ( !pChildArr ) - pChildArr = new SfxFrameArr_Impl; - pChildArr->Insert( pFrame, nPos ); - pFrame->pParentFrame = this; -} - -void SfxFrame::RemoveChildFrame_Impl( sal_uInt16 nPos ) -{ - DBG_ASSERT( pChildArr, "Unbekannter Frame!"); - pChildArr->Remove( nPos ); -}; - void SfxFrame::RemoveChildFrame_Impl( SfxFrame* pFrame ) { DBG_ASSERT( pChildArr, "Unbekannter Frame!"); sal_uInt16 nPos = pChildArr->GetPos(pFrame); - RemoveChildFrame_Impl( nPos ); + pChildArr->Remove( nPos ); }; -sal_Bool SfxFrame::CloseChildFrames() -{ - sal_Bool bRet = sal_True; - if ( pChildArr ) - { - // Childs closen - sal_uInt16 nCount = pChildArr->Count(); - for ( sal_uInt16 n=nCount; n>0; n--) - { - SfxFrame* pFrame = (*pChildArr)[n-1]; - // pFrame removed sich selbst - bRet = pFrame->DoClose(); - if ( !bRet ) - break; - } - } - - return bRet; -} - -SfxFrame* SfxFrame::SearchChildrenForName_Impl( const String& rName, sal_Bool bDeep ) const -{ - if ( pChildArr ) - { - sal_uInt16 nCount = pChildArr->Count(); - for ( sal_uInt16 n=nCount; n>0; n--) - { - SfxFrame* pFrame = (*pChildArr)[n-1]; - if ( rName.CompareIgnoreCaseToAscii( pFrame->GetFrameName() ) == COMPARE_EQUAL ) - return pFrame; - if( bDeep ) - { - pFrame = pFrame->SearchChildrenForName_Impl( rName ); - if ( pFrame ) - return pFrame; - } - } - } - - return NULL; -} - -SfxFrame* SfxFrame::GetTopFrame() const +SfxFrame& SfxFrame::GetTopFrame() const { - SfxFrame *pParent = (SfxFrame*) this; + const SfxFrame* pParent = this; while ( pParent->pParentFrame ) pParent = pParent->pParentFrame; - return pParent; -} - -SfxFrame* SfxFrame::SearchFrame( const String& rName, SfxMedium* /*pMedium*/ ) -{ - // Weil Netscape f"uhrende BLANKS "uberliest, m"ussen wir das wohl auch - // Sollte besser auch bei den FrameNames gemacht werden! - String aFrameName( rName ); - aFrameName.EraseLeadingChars(); - - SfxFrame *pFrame = this; - if( !aFrameName.Len() || aFrameName.CompareIgnoreCaseToAscii("_self") == COMPARE_EQUAL ) - { - return pFrame; - } - else if ( aFrameName.CompareIgnoreCaseToAscii("_smartself") == COMPARE_EQUAL ) - { - DBG_ERROR("Not supported!"); - return pFrame; - } - else if ( aFrameName.CompareIgnoreCaseToAscii( GetFrameName() ) == COMPARE_EQUAL) - { - // Eigener Name, kein Name oder Selbstbezug - return pFrame; - } - else if ( aFrameName.CompareIgnoreCaseToAscii("_parent") == COMPARE_EQUAL ) - { - // Gesucht ist das Parent Frameset - return pParentFrame ? pParentFrame : this; - } - else if ( aFrameName.CompareIgnoreCaseToAscii("_blank") == COMPARE_EQUAL ) - { - return NULL; - } - else if ( aFrameName.CompareIgnoreCaseToAscii("_top") == COMPARE_EQUAL ) - { - while ( pFrame->GetParentFrame() ) - pFrame = pFrame->GetParentFrame(); - return pFrame; - } - else - { - // Zuerst unterhalb dieses Frames absuchen - pFrame = SearchChildrenForName_Impl( aFrameName ); - } - - if ( !pFrame && GetParentFrame() ) - { - // Noch nichts gefunden, nach oben weitergehen - // Eigentlich m"u\sten Frames, die schon abgesucht wurden, aus - // Performance-Gr"unden markiert werden - SfxFrame *pParent = GetParentFrame(); - do - { - // Ist es der Parent ? - if ( aFrameName.CompareIgnoreCaseToAscii( pParent->GetFrameName() ) == COMPARE_EQUAL ) - return pParent; - - // Weiter nach oben - pParent = pParent->GetParentFrame(); - } - while ( pParent ); - } - - if( !pFrame ) - { - SfxFrameArr_Impl& rArr = *SFX_APP()->Get_Impl()->pTopFrames; - // keinen Frame im MDI-Fenster gefunden. Jetzt die anderen - // Toplevel Frames checken. - SfxFrame *pTop = GetTopFrame(); - for( sal_uInt16 nPos = rArr.Count(); nPos--; ) - { - // Unser Topframe wurde bereits durchsucht - SfxFrame* pCurFrame = rArr[ nPos ]; - if( pCurFrame != pTop ) - { - if( aFrameName.CompareIgnoreCaseToAscii( pCurFrame->GetFrameName() ) == - COMPARE_EQUAL ) - return pCurFrame; - else - { - pFrame = pCurFrame->SearchChildrenForName_Impl( aFrameName ); - if( pFrame ) - return pFrame; - } - } - } - } - - return pFrame; + return *const_cast< SfxFrame* >( pParent ); } sal_Bool SfxFrame::IsClosing_Impl() const @@ -506,21 +302,11 @@ void SfxFrame::SetIsClosing_Impl() pImp->bClosing = TRUE; } -void SfxFrame::DocumentInserted( SfxObjectShell* /*pDoc*/ ) -{ -} - sal_uInt16 SfxFrame::GetChildFrameCount() const { return pChildArr ? pChildArr->Count() : 0; } -sal_Bool SfxFrame::InsertDocument( SfxObjectShell* pDoc ) -{ - DocumentInserted( pDoc ); - return sal_True; -} - void SfxFrame::CancelTransfers( sal_Bool /*bCancelLoadEnv*/ ) { if( !pImp->bInCancelTransfers ) @@ -531,7 +317,7 @@ void SfxFrame::CancelTransfers( sal_Bool /*bCancelLoadEnv*/ ) { SfxViewFrame* pFrm; for( pFrm = SfxViewFrame::GetFirst( pObj ); - pFrm && pFrm->GetFrame() == this; + pFrm && &pFrm->GetFrame() == this; pFrm = SfxViewFrame::GetNext( *pFrm, pObj ) ) ; // Keine anderer Frame mehr auf Doc -> Cancel if( !pFrm ) @@ -569,12 +355,7 @@ SfxObjectShell* SfxFrame::GetCurrentDocument() const { return pImp->pCurrentViewFrame ? pImp->pCurrentViewFrame->GetObjectShell() : - pImp->pCurrentObjectShell; -} - -void SfxFrame::SetCurrentDocument_Impl( SfxObjectShell *pDoc ) -{ - pImp->pCurrentObjectShell = pDoc; + NULL; } void SfxFrame::SetCurrentViewFrame_Impl( SfxViewFrame *pFrame ) @@ -592,56 +373,10 @@ void SfxFrame::SetFrameType_Impl( sal_uInt32 n ) pImp->nType = n; } -void SfxFrame::CopyHistory_Impl( SfxFrame* /*pFrame*/ ) const -{ -} - - -void SfxFrame::ClearHistory() -{ -} - -sal_Bool SfxFrame::ExecuteHistoryMenu_Impl( sal_uInt16 /*nWhich*/, const Rectangle& /*rRect*/, sal_uInt16 /*nFlags*/ ) -{ - return sal_True; -} - -sal_Bool SfxFrame::Browse( sal_Bool /*bForward*/, sal_uInt16 /*nSteps*/, sal_Bool /*bNewFrame*/ ) -{ - return FALSE; -} - -void SfxFrame::UpdatePickEntries() -{ -} - -void SfxFrame::UpdatePickEntries( const ::com::sun::star::uno::Any& /*rValue*/ ) -{ -} - -void SfxFrame::UpdateUndoHistory_Impl( SfxObjectShell* /*pDocSh*/, const String* /*pNew*/, const String* /*pTitle*/ ) -{ -} - -void SfxFrame::UpdateCurrentHistory_Impl( SfxObjectShell* /*pDocSh*/, const String* /*pNew*/ ) -{ -} - -void SfxFrame::UpdateHistory( SfxObjectShell* /*pDocSh*/, const String* /*pNew*/ ) -{ -} - -void SfxFrame::UpdateHistory( - const ::rtl::OUString& /*aURL*/, - const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& /*aArgs*/, - const ::rtl::OUString& /*rTitle*/ ) -{ -} - void SfxFrame::GetViewData_Impl() { // Alle zwischen Laden und Entfernen "anderbaren Daten aktualisieren; die - // festen Daten werden nur einmal ( nach InsertDocument in UpdateDescriptor ) + // festen Daten werden nur einmal ( nach PrepareForDoc_Impl in UpdateDescriptor ) // geholt, um Zeit zu sparen. SfxViewFrame* pViewFrame = GetCurrentViewFrame(); if( pViewFrame && pViewFrame->GetViewShell() ) @@ -650,10 +385,7 @@ void SfxFrame::GetViewData_Impl() sal_Bool bReadOnly = pMed->GetOpenMode() == SFX_STREAM_READONLY; GetDescriptor()->SetReadOnly( bReadOnly ); - String aUserData; - pViewFrame->GetViewShell()->WriteUserData( aUserData, sal_True ); SfxItemSet *pSet = GetDescriptor()->GetArgs(); - pSet->Put( SfxStringItem( SID_USER_DATA, aUserData )); sal_Bool bGetViewData = sal_False; if ( GetController().is() && pSet->GetItemState( SID_VIEW_DATA ) != SFX_ITEM_SET ) { @@ -681,9 +413,9 @@ void SfxFrame::GetViewData_Impl() void SfxFrame::UpdateDescriptor( SfxObjectShell *pDoc ) { - // Beim InsertDocument wird der Descriptor des Frames aktualisiert + // Beim PrepareForDoc_Impl wird der Descriptor des Frames aktualisiert // und sein ItemSet neu initialisiert. Alle Daten, die f"ur ein sp"ateres - // Restaurieren der ::com::sun::star::sdbcx::View n"otig sind, sind damit festgehalten. + // Restaurieren der View n"otig sind, sind damit festgehalten. // Soll das Dokument ersetzt werden, wird durch GetViewData_Impl (s.o.) // die neueste Information hinzugef"ugt. Alles zusammen wird dann in der // Browse-History gesichert. Beim Aktivieren eines solchen FramePickEntry @@ -735,20 +467,6 @@ void SfxFrame::UpdateDescriptor( SfxObjectShell *pDoc ) //------------------------------------------------------------------------- -sal_Bool SfxFrame::CanBrowseBackward() const -{ - return FALSE; -} - -//------------------------------------------------------------------------- - -sal_Bool SfxFrame::CanBrowseForward() const -{ - return FALSE; -} - -//------------------------------------------------------------------------- - void SfxFrame::SetDescriptor( SfxFrameDescriptor *pD ) { DBG_ASSERT( pD, "Kein Descriptor!" ); @@ -796,14 +514,12 @@ void SfxFrame::GetTargetList( TargetList& rList ) const } SfxViewFrame* pView = GetCurrentViewFrame(); - if( pView && pView->GetViewShell() && !pView->GetViewShell()->IsImplementedAsFrameset_Impl() && pChildArr ) + if( pView && pView->GetViewShell() && pChildArr ) { sal_uInt16 nCount = pChildArr->Count(); for ( sal_uInt16 n=0; n<nCount; n++) { SfxFrame* pFrame = (*pChildArr)[n]; - if ( pFrame->GetFrameName().Len() ) - rList.Insert( new String (pFrame->GetFrameName()) ); pFrame->GetTargetList( rList ); } } @@ -811,147 +527,11 @@ void SfxFrame::GetTargetList( TargetList& rList ) const //------------------------------------------------------------------------- -void SfxFrame::SetFrameId_Impl( sal_uInt16 nId ) -{ - pImp->nFrameId = nId; - if ( GetCurrentViewFrame() ) - GetCurrentViewFrame()->UpdateTitle(); -} - -sal_uInt16 SfxFrame::GetFrameId_Impl() const -{ - return pImp->nFrameId; -} - -void SfxFrame::SetFrameIdName_Impl( const String& rName ) -{ - pImp->aFrameIdName = rName; -} - -//------------------------------------------------------------------------- - -SfxFrame* SfxFrame::SearchFrame_Impl( sal_uInt16 nId, sal_Bool bDeep ) -{ - if ( pImp->nFrameId == nId ) - return this; - - if ( pChildArr ) - { - sal_uInt16 nCount = pChildArr->Count(); - for ( sal_uInt16 n=0; n<nCount; n++) - { - SfxFrame* pFrame = (*pChildArr)[n]; - if ( pFrame->pImp->nFrameId == nId ) - return pFrame; - if ( bDeep ) - { - pFrame = pFrame->SearchFrame_Impl( nId, sal_True ); - if ( pFrame ) - return pFrame; - } - } - } - - return NULL; -} - -SfxFrame* SfxFrame::SearchFrame_Impl( const String& rName, sal_Bool bDeep ) -{ - if ( pImp->aFrameIdName == rName ) - return this; - - if ( pChildArr ) - { - sal_uInt16 nCount = pChildArr->Count(); - for ( sal_uInt16 n=0; n<nCount; n++) - { - SfxFrame* pFrame = (*pChildArr)[n]; - if ( pFrame->pImp->aFrameIdName == rName ) - return pFrame; - if ( bDeep ) - { - pFrame = pFrame->SearchFrame_Impl( rName ); - if ( pFrame ) - return pFrame; - } - } - } - - return NULL; -} - -//------------------------------------------------------------------------- - -//------------------------------------------------------------------------- - -void SfxFrame::Activate_Impl( sal_Bool bBeamerOn ) - -/* [Description] - - Internal Activate-Handler, called from derived classes which supports - Activate-Handling. -*/ - -{ - if ( GetParentFrame() ) - GetParentFrame()->Activate_Impl( bBeamerOn ); -} - SfxBroadcaster& SfxFrame::GetBroadcaster() const { return *pImp; } -//------------------------------------------------------------------------- - -void SfxFrame::Deactivate_Impl() - -/* [Description] - - Internal Deactivate-Handler, called from derived classes which supports - Activate-Handling. -*/ - -{ - if( GetParentFrame() ) - GetParentFrame()->Deactivate_Impl(); -} - -String SfxFrame::GetContent() const -{ - SfxObjectShell *pObj = GetCurrentDocument(); - if ( !pObj || !pObj->GetMedium() ) - return String(); - else - return pObj->GetMedium()->GetName(); -} - -sal_Bool SfxFrame::CheckContentForLoad_Impl() -{ - if ( GetCurrentDocument() ) - { - SfxMedium* pMedium = GetCurrentDocument()->GetMedium(); -#ifdef DEBUG - SfxItemSet* pSet; - pSet = pMedium->GetItemSet(); -#endif - SfxItemSet* pNew = GetDescriptor()->GetArgs(); - - // Falls URLs nicht uebereinstimmen - if ( INetURLObject( GetDescriptor()->GetActualURL() ) != INetURLObject( pMedium->GetOrigURL() ) ) - return sal_True; - - // Falls die Filter nicht uebereinstimmen - SFX_ITEMSET_ARG( pNew, pFilterItem, SfxStringItem, SID_FILTER_NAME, sal_False ); - if( pMedium->GetOrigFilter() && pFilterItem && pFilterItem->GetValue() != pMedium->GetOrigFilter()->GetFilterName() ) - return sal_True; - - return sal_False; - } - - return (GetDescriptor()->GetActualURL().GetMainURL( INetURLObject::NO_DECODE ).getLength() != 0); -} - sal_Bool SfxFrame::IsParent( SfxFrame *pFrame ) const { SfxFrame *pParent = pParentFrame; @@ -978,7 +558,7 @@ void SfxFrame::RemoveTopFrame_Impl( SfxFrame* pFrame ) } SfxFrameItem::SfxFrameItem( sal_uInt16 nWhichId, SfxViewFrame *p ) - : SfxPoolItem( nWhichId ), pFrame( p ? p->GetFrame() : NULL ) + : SfxPoolItem( nWhichId ), pFrame( p ? &p->GetFrame() : NULL ) { wFrame = pFrame; } @@ -1061,11 +641,6 @@ int SfxUsrAnyItem::operator==( const SfxPoolItem& /*rItem*/ ) const return sal_False; } -String SfxUsrAnyItem::GetValueText() const -{ - return String(); -} - SfxPoolItem* SfxUsrAnyItem::Clone( SfxItemPool *) const { return new SfxUsrAnyItem( Which(), aValue ); @@ -1083,9 +658,37 @@ sal_Bool SfxUsrAnyItem::PutValue( const com::sun::star::uno::Any& rVal, BYTE /*n return sal_True; } -sal_Bool SfxFrame::BrowseInFrame( int /*nDelta*/ ) +SfxUnoFrameItem::SfxUnoFrameItem() + : SfxPoolItem() + , m_xFrame() +{ +} + +SfxUnoFrameItem::SfxUnoFrameItem( sal_uInt16 nWhichId, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rFrame ) + : SfxPoolItem( nWhichId ) + , m_xFrame( i_rFrame ) { - return sal_False; +} + +int SfxUnoFrameItem::operator==( const SfxPoolItem& i_rItem ) const +{ + return i_rItem.ISA( SfxUnoFrameItem ) && static_cast< const SfxUnoFrameItem& >( i_rItem ).m_xFrame == m_xFrame; +} + +SfxPoolItem* SfxUnoFrameItem::Clone( SfxItemPool* ) const +{ + return new SfxUnoFrameItem( Which(), m_xFrame ); +} + +sal_Bool SfxUnoFrameItem::QueryValue( com::sun::star::uno::Any& rVal, BYTE /*nMemberId*/ ) const +{ + rVal <<= m_xFrame; + return sal_True; +} + +sal_Bool SfxUnoFrameItem::PutValue( const com::sun::star::uno::Any& rVal, BYTE /*nMemberId*/ ) +{ + return ( rVal >>= m_xFrame ); } SfxFrameIterator::SfxFrameIterator( const SfxFrame& rFrame, sal_Bool bRecur ) @@ -1132,116 +735,6 @@ SfxFrame* SfxFrameIterator::NextSibling_Impl( SfxFrame& rPrev ) return pRet; } -void SfxFrame::SetFrameName( const String& rName ) -{ - if ( pImp->pDescr ) - pImp->pDescr->SetName( rName ); - aName = rName; - if ( pImp->pCurrentViewFrame ) - pImp->pCurrentViewFrame->UpdateTitle(); - if ( GetFrameInterface().is() ) - GetFrameInterface()->setName( rName ); -} - -void SfxFrame::LoadFinished_Impl() -{ -} - -SfxFrame* SfxFrame::findFrame(const ::rtl::OUString& aTargetframename, sal_Int32 nSearchFlags) -{ - // Weil Netscape f"uhrende BLANKS "uberliest, m"ussen wir das wohl auch - // Sollte besser auch bei den FrameNames gemacht werden! - String aTargetName( aTargetframename ); - aTargetName.EraseLeadingChars(); - - SfxFrame *pFrame = this; - - if ( !aTargetName.Len() && GetParentFrame() && GetParentFrame()->GetCurrentViewFrame()->GetViewShell()->IsImplementedAsFrameset_Impl() ) - return GetParentFrame(); - - if( !aTargetName.Len() || aTargetName.CompareIgnoreCaseToAscii("_self") == COMPARE_EQUAL ) - return pFrame; - - if ( aTargetName.CompareIgnoreCaseToAscii("_smartself") == COMPARE_EQUAL ) - { - DBG_ERROR("Not supported!"); - return pFrame; - } - - if ( aTargetName.CompareIgnoreCaseToAscii("_parent") == COMPARE_EQUAL ) - { - // Gesucht ist das Parent Frameset - return pFrame->GetParentFrame(); - } - else if ( aTargetName.CompareIgnoreCaseToAscii("_blank") == COMPARE_EQUAL ) - { - return NULL; - - } - else if ( aTargetName.CompareIgnoreCaseToAscii("_top") == COMPARE_EQUAL ) - { - while ( pFrame->GetParentFrame() ) - pFrame = pFrame->GetParentFrame(); - return pFrame; - } - - if ( ( nSearchFlags & FRAME_SEARCH_SELF ) && aTargetName.CompareIgnoreCaseToAscii( GetFrameName() ) == COMPARE_EQUAL ) - { - // Eigener Name - return pFrame; - } - - if ( nSearchFlags & FRAME_SEARCH_CHILDREN ) - { - // Zuerst unterhalb dieses Frames absuchen - pFrame = SearchChildrenForName_Impl( aTargetName ); - } - - if ( ( nSearchFlags & FRAME_SEARCH_CHILDREN ) && !pFrame && GetParentFrame() ) - { - // Noch nichts gefunden, nach oben weitergehen - // Eigentlich m"u\sten Frames, die schon abgesucht wurden, aus - // Performance-Gr"unden markiert werden - SfxFrame *pParent = GetParentFrame(); - do - { - // Ist es der Parent ? - if ( aTargetName.CompareIgnoreCaseToAscii( pParent->GetFrameName() ) == COMPARE_EQUAL ) - return pParent; - - // Weiter nach oben - pParent = pParent->GetParentFrame(); - } - while ( pParent ); - } - - if( !pFrame ) - { - SfxFrameArr_Impl& rArr = *SFX_APP()->Get_Impl()->pTopFrames; - // keinen Frame im MDI-Fenster gefunden. Jetzt die anderen - // Toplevel Frames checken. - SfxFrame *pTop = GetTopFrame(); - for( sal_uInt16 nPos = rArr.Count(); nPos--; ) - { - // Unser Topframe wurde bereits durchsucht - SfxFrame* pCurFrame = rArr[ nPos ]; - if( pCurFrame != pTop ) - { - if( aTargetName.CompareIgnoreCaseToAscii( pCurFrame->GetFrameName() ) == COMPARE_EQUAL ) - return pCurFrame; - else - { - pFrame = pCurFrame->SearchChildrenForName_Impl( aTargetName ); - if( pFrame ) - return pFrame; - } - } - } - } - - return pFrame; -} - sal_Bool SfxFrame::IsTop() const { return GetFrameInterface().is() ? GetFrameInterface()->isTop() : sal_False; @@ -1265,7 +758,7 @@ sal_Bool SfxFrame::HasComponent() const return pImp->xFrame; } -void SfxFrame::SetFrameInterface_Impl( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame ) +void SfxFrame::SetFrameInterface_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame ) { pImp->xFrame = rFrame; com::sun::star::uno::Reference< com::sun::star::frame::XDispatchRecorder > xRecorder; @@ -1273,16 +766,6 @@ void SfxFrame::SetFrameInterface_Impl( ::com::sun::star::uno::Reference< ::com:: GetCurrentViewFrame()->GetBindings().SetRecorder_Impl( xRecorder ); } -void SfxFrame::SetItemSet_Impl( const SfxItemSet* pSet ) -{ - pImp->pSet = pSet; -} - -const SfxItemSet* SfxFrame::GetItemSet_Impl() -{ - return pImp->pSet; -} - void SfxFrame::Appear() { if ( GetCurrentViewFrame() ) @@ -1410,11 +893,6 @@ void SfxFrame::CreateWorkWindow_Impl() pImp->pWorkWin = new SfxFrameWorkWin_Impl( &pFrame->GetWindow(), this, pFrame ); } -const SvBorder& SfxFrame::GetBorder_Impl() const -{ - return pImp->aBorder; -} - void SfxFrame::GrabFocusOnComponent_Impl() { if ( pImp->bReleasingComponent ) @@ -1423,18 +901,12 @@ void SfxFrame::GrabFocusOnComponent_Impl() return; } - Window* pWindow = &GetWindow(); + Window* pFocusWindow = &GetWindow(); if ( GetCurrentViewFrame() && GetCurrentViewFrame()->GetViewShell() && GetCurrentViewFrame()->GetViewShell()->GetWindow() ) - pWindow = GetCurrentViewFrame()->GetViewShell()->GetWindow(); - - if( !pWindow->HasChildPathFocus() ) - pWindow->GrabFocus(); -} + pFocusWindow = GetCurrentViewFrame()->GetViewShell()->GetWindow(); -const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProviderInterceptor > SfxFrame::GetInterceptor_Impl() -{ -//(mba)/compview: hier fehlt der Zugriff auf den Interceptor !!!!! - return ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProviderInterceptor > (); + if( !pFocusWindow->HasChildPathFocus() ) + pFocusWindow->GrabFocus(); } void SfxFrame::ReleasingComponent_Impl( sal_Bool bSet ) @@ -1442,36 +914,6 @@ void SfxFrame::ReleasingComponent_Impl( sal_Bool bSet ) pImp->bReleasingComponent = bSet; } -sal_Bool SfxFrame::LoadSfxComponent( - const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > & /*aFrame*/, - const ::rtl::OUString& /*aURL*/, - const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& /*aArgs*/, - const SfxObjectFactory* /*pFact*/ ) -{ - // get Implementation of xComponents ... - DBG_ERROR( "Should not be called anymore!" ); - return sal_False; -} - -void SfxFrame::LockFocus_Impl( sal_Bool bLock ) -{ - if ( pChildArr && pChildArr->Count() ) - { - sal_uInt16 nCount = pChildArr->Count(); - for ( sal_uInt16 n=0; n<nCount; n++ ) - { - SfxFrame* pFrame = (*pChildArr)[n]; - pFrame->pImp->bFocusLocked = bLock; - pFrame->LockFocus_Impl( bLock ); - } - } -} - -sal_Bool SfxFrame::IsFocusLocked_Impl() const -{ - return pImp->bFocusLocked; -} - sal_Bool SfxFrame::IsInPlace() const { return pImp->bInPlace; @@ -1506,7 +948,7 @@ void SfxFrame::Resize() if ( nHandle ) { SfxObjectShell* pDoc = reinterpret_cast< SfxObjectShell* >( sal::static_int_cast< sal_IntPtr >( nHandle )); - pWork = SfxViewFrame::GetFirst( pDoc )->GetFrame()->GetWorkWindow_Impl(); + pWork = SfxViewFrame::GetFirst( pDoc )->GetFrame().GetWorkWindow_Impl(); } } @@ -1546,10 +988,10 @@ SfxFrame* SfxFrame::GetNext( SfxFrame& rFrame ) return NULL; } -const SfxPoolItem* SfxFrame::LoadDocumentSynchron( SfxItemSet& aSet ) +const SfxPoolItem* SfxFrame::OpenDocumentSynchron( SfxItemSet& i_rSet, const Reference< XFrame >& i_rTargetFrame ) { - aSet.Put( SfxFrameItem( SID_DOCFRAME, this ) ); - aSet.ClearItem( SID_TARGETNAME ); - return SFX_APP()->GetDispatcher_Impl()->Execute( SID_OPENDOC, SFX_CALLMODE_SYNCHRON, aSet ); + i_rSet.Put( SfxUnoFrameItem( SID_FILLFRAME, i_rTargetFrame ) ); + i_rSet.ClearItem( SID_TARGETNAME ); + return SFX_APP()->GetDispatcher_Impl()->Execute( SID_OPENDOC, SFX_CALLMODE_SYNCHRON, i_rSet ); } |