diff options
author | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2009-11-23 14:20:13 +0100 |
---|---|---|
committer | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2009-11-23 14:20:13 +0100 |
commit | 6f1f154f9a48300285bbac3c191142db32bfc2f0 (patch) | |
tree | 1057588346ccd9d3efaf662574ba3b2b8891c664 /sfx2/source | |
parent | 70259f71b73997f8cf16a73ae1677ffa985717d0 (diff) |
[CWS autorecovery] #i65597# further refactored the loader code, cutting dead branches
Sadly, there's still one use case which calls InsertDocument_Impl on a frame which already
contains an SfxViewFrame: reloading the document (explicitly via SID_RELOAD, or implicitly
via SID_EDITDOC). If this weren't the case, the code would look even simpler.
On the medium run, the reload code should also be migrated to a ViewFactory usage.
Diffstat (limited to 'sfx2/source')
-rw-r--r-- | sfx2/source/doc/objcont.cxx | 62 | ||||
-rw-r--r-- | sfx2/source/doc/objxtor.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/inc/objshimp.hxx | 2 | ||||
-rw-r--r-- | sfx2/source/view/frmload.cxx | 71 | ||||
-rw-r--r-- | sfx2/source/view/topfrm.cxx | 162 | ||||
-rw-r--r-- | sfx2/source/view/viewfrm.cxx | 4 |
6 files changed, 117 insertions, 186 deletions
diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx index a7561b7dec37..99253fbce806 100644 --- a/sfx2/source/doc/objcont.cxx +++ b/sfx2/source/doc/objcont.cxx @@ -193,19 +193,12 @@ SfxObjectShell::CreatePreviewMetaFile_Impl( sal_Bool bFullContent, sal_Bool bHig //==================================================================== -bool SfxObjectShell::LoadView_Impl( SfxTopFrame& rPreferedFrame ) +bool SfxObjectShell::LoadView_Impl( SfxTopFrame& rTargetFrame ) { - if ( pImp->bLoadingWindows ) - return false; - DBG_ASSERT( GetMedium(), "A Medium should exist here!"); if ( !GetMedium() ) return false; - // get correct mode - SFX_APP(); - SfxViewFrame* pPreferedViewFrame = rPreferedFrame.GetCurrentViewFrame(); - // obtain view data Reference< XViewDataSupplier > xViewDataSupplier( GetModel(), UNO_QUERY ); Reference< XIndexAccess > xViewData; @@ -215,12 +208,7 @@ bool SfxObjectShell::LoadView_Impl( SfxTopFrame& rPreferedFrame ) if ( !xViewData.is() || ( xViewData->getCount() == 0 ) ) return false; - SfxItemSet* pSet = GetMedium()->GetItemSet(); - - pImp->bLoadingWindows = TRUE; - - // get saved information for all views - // get viewdata and look for the stored ViewId + // obtain the ViewID from the view data USHORT nViewId = 0; SEQUENCE < PROPERTYVALUE > aUserData; if ( xViewData->getByIndex( 0 ) >>= aUserData ) @@ -234,23 +222,29 @@ bool SfxObjectShell::LoadView_Impl( SfxTopFrame& rPreferedFrame ) } } + SfxItemSet* pSet = GetMedium()->GetItemSet(); pSet->ClearItem( SID_USER_DATA ); - SfxViewFrame* pTargetFrame = pPreferedViewFrame; - if ( pTargetFrame ) + pSet->Put( SfxUInt16Item( SID_VIEW_ID, nViewId ) ); + + if ( rTargetFrame.GetCurrentViewFrame() ) { + // TODO: the only client of this case is the Reload-implementation for SFX-based documents. This should be + // migrated to use UNO mechanisms, too. In this case, we can simplify the code here. + // use the frame from the arguments, but don't set a window size - if ( pTargetFrame->GetViewShell() || !pTargetFrame->GetObjectShell() ) + SfxViewFrame* pViewFrame = rTargetFrame.GetCurrentViewFrame(); + if ( pViewFrame->GetViewShell() || !pViewFrame->GetObjectShell() ) { pSet->ClearItem( SID_VIEW_POS_SIZE ); pSet->ClearItem( SID_WIN_POSSIZE ); - pSet->Put( SfxUInt16Item( SID_VIEW_ID, nViewId ) ); + pSet->ClearItem( SID_VIEW_ZOOM_MODE ); // avoid flickering controllers - SfxBindings &rBind = pTargetFrame->GetBindings(); + SfxBindings &rBind = pViewFrame->GetBindings(); rBind.ENTERREGISTRATIONS(); // set document into frame - rPreferedFrame.InsertDocument_Impl( *this ); + rTargetFrame.InsertDocument_Impl( *this ); // restart controller updating rBind.LEAVEREGISTRATIONS(); @@ -258,35 +252,31 @@ bool SfxObjectShell::LoadView_Impl( SfxTopFrame& rPreferedFrame ) else { // create new view - pTargetFrame->CreateView_Impl( nViewId ); + pViewFrame->CreateView_Impl( nViewId ); } } else { - pSet->Put( SfxUInt16Item( SID_VIEW_ID, nViewId ) ); - - // Frame "ubergeben, allerdings ist der noch leer - rPreferedFrame.InsertDocument_Impl( *this ); - pTargetFrame = rPreferedFrame.GetCurrentViewFrame(); - - // only temporary data, don't hold it in the itemset - pSet->ClearItem( SID_VIEW_POS_SIZE ); - pSet->ClearItem( SID_WIN_POSSIZE ); - pSet->ClearItem( SID_VIEW_ZOOM_MODE ); + rTargetFrame.InsertDocument_Impl( *this ); } + SfxViewFrame* pViewFrame = rTargetFrame.GetCurrentViewFrame(); + + // only temporary data, don't hold it in the itemset + pSet->ClearItem( SID_VIEW_POS_SIZE ); + pSet->ClearItem( SID_WIN_POSSIZE ); + pSet->ClearItem( SID_VIEW_ZOOM_MODE ); // UserData hier einlesen, da es ansonsten immer mit bBrowse=TRUE // aufgerufen wird, beim Abspeichern wurde aber bBrowse=FALSE verwendet - if ( pTargetFrame && pTargetFrame->GetViewShell() && aUserData.getLength() ) + if ( pViewFrame && pViewFrame->GetViewShell() && aUserData.getLength() ) { - pTargetFrame->GetViewShell()->ReadUserDataSequence( aUserData, TRUE ); + pViewFrame->GetViewShell()->ReadUserDataSequence( aUserData, TRUE ); } - if ( pTargetFrame && !pPreferedViewFrame ) + if ( pViewFrame ) // activate frame - pTargetFrame->MakeActive_Impl( TRUE ); + pViewFrame->MakeActive_Impl( TRUE ); - pImp->bLoadingWindows = FALSE; return true; } diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx index 950ecf9ea239..22b239a3c5da 100644 --- a/sfx2/source/doc/objxtor.cxx +++ b/sfx2/source/doc/objxtor.cxx @@ -219,9 +219,7 @@ SfxObjectShell_Impl::SfxObjectShell_Impl( SfxObjectShell& _rDocShell ) ,bForbidCaching( sal_False ) ,bForbidReload( sal_False ) ,bSupportsEventMacros( sal_True ) - ,bLoadingWindows( sal_False ) ,bBasicInitialized( sal_False ) -// ,bHidden( sal_False ) ,bIsPrintJobCancelable( sal_True ) ,bOwnsStorage( sal_True ) ,bNoBaseURL( sal_False ) diff --git a/sfx2/source/inc/objshimp.hxx b/sfx2/source/inc/objshimp.hxx index 77162423cabe..9e5bc0cc8ce1 100644 --- a/sfx2/source/inc/objshimp.hxx +++ b/sfx2/source/inc/objshimp.hxx @@ -103,9 +103,7 @@ struct SfxObjectShell_Impl : public ::sfx2::IMacroDocumentAccess bForbidCaching : 1, bForbidReload : 1, bSupportsEventMacros: 1, - bLoadingWindows: 1, bBasicInitialized :1, - //bHidden :1, // indicates a hidden view shell bIsPrintJobCancelable :1, // Stampit disable/enable cancel button for print jobs ... default = true = enable! bOwnsStorage:1, bNoBaseURL:1, diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx index 62830b47d0f5..8b4a035cb176 100644 --- a/sfx2/source/view/frmload.cxx +++ b/sfx2/source/view/frmload.cxx @@ -354,43 +354,15 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const css::uno::Sequence< PropertyV if ( !pRefererItem ) aSet.Put( SfxStringItem( SID_REFERER, String() ) ); - SfxFrame* pTargetFrame = NULL; - for ( pTargetFrame = SfxFrame::GetFirst(); pTargetFrame; pTargetFrame = SfxFrame::GetNext( *pTargetFrame ) ) - { - if ( pTargetFrame->GetFrameInterface() == _rTargetFrame ) - break; - } - - BOOL bFrameCreated = FALSE; - if ( !pTargetFrame ) - { - pTargetFrame = SfxTopFrame::Create( _rTargetFrame ); - bFrameCreated = TRUE; - } - + SfxTopFrame* pTargetFrame = SfxTopFrame::Create( _rTargetFrame ); if ( xModel.is() ) { - // !TODO: replace by ViewFactory - if ( _rTargetFrame->getController().is() ) - { - // remove old component - // if a frame was created already, it can't be an SfxComponent! - _rTargetFrame->setComponent( NULL, NULL ); - if ( !bFrameCreated ) - pTargetFrame = SfxTopFrame::Create( _rTargetFrame ); - } - aSet.Put( SfxFrameItem( SID_DOCFRAME, pTargetFrame ) ); for ( SfxObjectShell* pDoc = SfxObjectShell::GetFirst( NULL, FALSE ); pDoc; pDoc = SfxObjectShell::GetNext( *pDoc, NULL, FALSE ) ) { if ( xModel == pDoc->GetModel() ) { - SfxTopFrame* pTopFrame = dynamic_cast< SfxTopFrame* >( pTargetFrame ); - OSL_ENSURE( pTopFrame, "SfxFrameLoader_Impl::load: An SfxFrame which is no SfxTopFrame?!" ); - if ( !pTopFrame ) - return sal_False; - pTargetFrame->SetItemSet_Impl( &aSet ); aDescriptor.remove( "Model" ); @@ -398,7 +370,8 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const css::uno::Sequence< PropertyV xModel->attachResource( sURL, aDescriptor.getPropertyValues() ); - return pTopFrame->InsertDocument_Impl( *pDoc ); + // TODO: replace by ViewFactory + return pTargetFrame->InsertDocument_Impl( *pDoc ); } } @@ -430,7 +403,7 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const css::uno::Sequence< PropertyV if ( aParam.Len() ) { sal_Bool bSuccess = impl_createNewDocWithSlotParam( (sal_uInt16)aParam.ToInt32(), pTargetFrame ); - if ( !bSuccess && bFrameCreated && wFrame && !wFrame->GetCurrentDocument() ) + if ( !bSuccess && wFrame && !wFrame->GetCurrentDocument() ) { wFrame->SetFrameInterface_Impl( NULL ); wFrame->DoClose(); @@ -482,8 +455,8 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const css::uno::Sequence< PropertyV if ( !bUseTemplate ) { // execute "NewDocument" request - sal_Bool bSuccess = impl_createNewDoc( aSet, pTargetFrame, aFact );; - if ( !bSuccess && bFrameCreated && wFrame && !wFrame->GetCurrentDocument() ) + sal_Bool bSuccess = impl_createNewDoc( aSet, pTargetFrame, aFact ); + if ( !bSuccess && wFrame && !wFrame->GetCurrentDocument() ) { wFrame->SetFrameInterface_Impl( NULL ); wFrame->DoClose(); @@ -529,25 +502,20 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const css::uno::Sequence< PropertyV // !TODO: will be done by Framework! pDocMedium->SetUpdatePickList( !bHidden ); + /* + #121119# + We dont know why _pFrame can be corrupt here. + But if it was deleted it shouldnt exists inside our global list. + May be we can use the damaged pointer to detect if it was removed from + this global list. + */ impl_ensureValidFrame_throw( pTargetFrame ); - // !TODO: replace by ViewFactory - if ( pTargetFrame->GetFrameInterface()->getController().is() ) - { - // remove old component - // if a frame was created already, it can't be an SfxComponent! - //pTargetFrame->GetFrameInterface()->setComponent( 0, 0 ); - if ( !bFrameCreated ) - pTargetFrame = SfxTopFrame::Create( _rTargetFrame ); - } - - wFrame = pTargetFrame; aSet.Put( SfxFrameItem( SID_DOCFRAME, pTargetFrame ) ); - pTargetFrame->SetItemSet_Impl( &aSet ); - SfxTopFrame* pTopFrame = dynamic_cast< SfxTopFrame* >( pTargetFrame ); - OSL_ENSURE( pTopFrame, "SfxFrameLoader_Impl::load: An SfxFrame which is no SfxTopFrame?!" ); - if ( pTopFrame && pTopFrame->InsertDocument_Impl( *pDoc ) ) + // !TODO: replace by ViewFactory + pTargetFrame->SetItemSet_Impl( &aSet ); + if ( pTargetFrame->InsertDocument_Impl( *pDoc ) ) { pTargetFrame->GetCurrentViewFrame()->UpdateDocument_Impl(); String aURL = pDoc->GetMedium()->GetName(); @@ -590,13 +558,6 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const css::uno::Sequence< PropertyV void SfxFrameLoader_Impl::impl_ensureValidFrame_throw( const SfxFrame* _pFrame ) { - /* - #121119# - We dont know why pTargetFrame can be corrupt here. - But if it was deleted it shouldnt exists inside our global list. - May be we can use the damaged pointer to detect if it was removed from - this global list. - */ SfxFrame* pTmp = NULL; for ( pTmp = SfxFrame::GetFirst(); pTmp; pTmp = SfxFrame::GetNext( *pTmp ) ) { diff --git a/sfx2/source/view/topfrm.cxx b/sfx2/source/view/topfrm.cxx index b43ccae4aa2b..287c0783052f 100644 --- a/sfx2/source/view/topfrm.cxx +++ b/sfx2/source/view/topfrm.cxx @@ -781,21 +781,48 @@ String SfxTopFrame::GetWindowData() return aWinData; } +void SfxTopFrame::PositionWindow_Impl( const Rectangle& rWinArea ) const +{ + Window *pWin = pImp->pWindow; + + // Groesse setzen + const Size aAppWindow( pImp->pWindow->GetDesktopRectPixel().GetSize() ); + Point aPos( rWinArea.TopLeft() ); + Size aSz( rWinArea.GetSize() ); + if ( aSz.Width() && aSz.Height() ) + { + aPos.X() = Min(aPos.X(), + long(aAppWindow.Width() - aSz.Width() + aSz.Width() / 2) ); + aPos.Y() = Min(aPos.Y(), + long( aAppWindow.Height() - aSz.Height() + aSz.Height() / 2) ); + if ( aPos.X() + aSz.Width() < + aAppWindow.Width() + aSz.Width() / 2 && + aPos.Y() + aSz.Height() < + aAppWindow.Height() + aSz.Height() / 2 ) + { + pWin->SetPosPixel( aPos ); + pWin->SetOutputSizePixel( aSz ); + } + } +} + sal_Bool SfxTopFrame::InsertDocument_Impl( SfxObjectShell& rDoc ) /* [Beschreibung] */ { - SfxObjectShell *pOld = GetCurrentDocument(); + const SfxObjectShell* pOldDocument = GetCurrentDocument(); + OSL_PRECOND( pOldDocument == NULL, + "SfxTopFrame::InsertDocument_Impl: re-using an Sfx(Top)Frame is not supported anymore!" ); - // Position und Groesse testen - // Wenn diese schon gesetzt sind, soll offensichtlich nicht noch - // LoadView_Impl aufgerufen werden ( z.B. weil dieses ein CreateFrame() - // an einer Task aufgerufen hat! ) const SfxItemSet* pSet = GetItemSet_Impl(); if ( !pSet ) pSet = rDoc.GetMedium()->GetItemSet(); SetItemSet_Impl(0); + // Position und Groesse testen + // Wenn diese schon gesetzt sind, soll offensichtlich nicht noch + // LoadView_Impl aufgerufen werden ( z.B. weil dieses ein CreateFrame() + // an einer Task aufgerufen hat! ) SFX_ITEMSET_ARG( pSet, pAreaItem, SfxRectangleItem, SID_VIEW_POS_SIZE, sal_False ); // position and size SFX_ITEMSET_ARG( pSet, pViewIdItem, SfxUInt16Item, SID_VIEW_ID, sal_False ); // view ID SFX_ITEMSET_ARG( pSet, pModeItem, SfxUInt16Item, SID_VIEW_ZOOM_MODE, sal_False ); // zoom @@ -814,6 +841,8 @@ sal_Bool SfxTopFrame::InsertDocument_Impl( SfxObjectShell& rDoc ) if( !pImp->bHidden ) rDoc.OwnerLock( sal_True ); + const USHORT nViewId = pViewIdItem ? pViewIdItem->GetValue() : 0; + // Wenn z.B. eine Fenstergr"o\se gesetzt wurde, soll keine Fensterinformation // aus den Dokument geladen werden, z.B. weil InsertDocument_Impl seinerseits // aus LoadView_Impl aufgerufen wurde! @@ -831,42 +860,39 @@ sal_Bool SfxTopFrame::InsertDocument_Impl( SfxObjectShell& rDoc ) UpdateDescriptor( &rDoc ); - SfxViewFrame *pFrame = GetCurrentViewFrame(); - if ( pFrame ) + SfxViewFrame* pViewFrame = GetCurrentViewFrame(); + if ( pViewFrame ) { - sal_Bool bChildActivated = sal_False; - if ( pFrame->GetActiveChildFrame_Impl() && pFrame->GetActiveChildFrame_Impl() == SfxViewFrame::Current() ) + // TODO: the only client of this case is the Reload-implementation for SFX-based documents. This should be + // migrated to use UNO mechanisms, too. In this case, we can simplify the code here. + if ( pViewFrame->GetActiveChildFrame_Impl() && pViewFrame->GetActiveChildFrame_Impl() == SfxViewFrame::Current() ) { - pFrame->SetActiveChildFrame_Impl(0); - SfxViewFrame::SetViewFrame( pFrame ); - bChildActivated = sal_True; + pViewFrame->SetActiveChildFrame_Impl(0); + SfxViewFrame::SetViewFrame( pViewFrame ); } - if ( pFrame->GetObjectShell() ) + if ( pViewFrame->GetObjectShell() ) { - pFrame->ReleaseObjectShell_Impl( sal_False ); + pViewFrame->ReleaseObjectShell_Impl( sal_False ); } if ( pViewIdItem ) - pFrame->SetViewData_Impl( pViewIdItem->GetValue(), String() ); - pFrame->SetObjectShell_Impl( rDoc ); + pViewFrame->SetViewData_Impl( pViewIdItem->GetValue(), String() ); + pViewFrame->SetObjectShell_Impl( rDoc ); } else { - // 1: internal embedded object - // 2: external embedded object - // 3: OLE server if ( pPluginMode && pPluginMode->GetValue() != 2 ) SetInPlace_Impl( TRUE ); - pFrame = new SfxTopViewFrame( this, &rDoc, pViewIdItem ? pViewIdItem->GetValue() : 0 ); - if ( !pFrame->GetViewShell() ) + pViewFrame = new SfxTopViewFrame( this, &rDoc, nViewId ); + if ( !pViewFrame->GetViewShell() ) return sal_False; if ( pPluginMode && pPluginMode->GetValue() == 1 ) { - pFrame->ForceOuterResize_Impl( FALSE ); - pFrame->GetBindings().HidePopups(TRUE); + pViewFrame->ForceOuterResize_Impl( FALSE ); + pViewFrame->GetBindings().HidePopups(TRUE); // MBA: layoutmanager of inplace frame starts locked and invisible GetWorkWindow_Impl()->MakeVisible_Impl( FALSE ); @@ -878,77 +904,39 @@ sal_Bool SfxTopFrame::InsertDocument_Impl( SfxObjectShell& rDoc ) } } - String aMark; - if ( pJumpItem ) - aMark = pJumpItem->GetValue(); - - if ( rDoc.Get_Impl()->nLoadedFlags & SFX_LOADED_MAINDOCUMENT ) - { - if ( pViewDataItem ) - pFrame->GetViewShell()->ReadUserData( pViewDataItem->GetValue(), sal_True ); - else if( aMark.Len() ) - GetCurrentViewFrame()->GetViewShell()->JumpToMark( aMark ); - } - else - { - // Daten setzen, die in FinishedLoading ausgewertet werden - MarkData_Impl*& rpMark = rDoc.Get_Impl()->pMarkData; - if (!rpMark) - rpMark = new MarkData_Impl; - rpMark->pFrame = GetCurrentViewFrame(); - if ( pViewDataItem ) - rpMark->aUserData = pViewDataItem->GetValue(); - else - rpMark->aMark = aMark; - } + OSL_ENSURE( ( rDoc.Get_Impl()->nLoadedFlags & SFX_LOADED_MAINDOCUMENT ) == SFX_LOADED_MAINDOCUMENT, + "SfxTopFrame::InsertDocument_Impl: so this code wasn't dead?" ); + // Before CWS autorecovery, there was code which postponed setting the ViewData/Mark to a later time + // (SfxObjectShell::PositionView_Impl), but it seems this branch was never used, since loads this method + // here is never called before the load process finished. + if ( pViewDataItem ) + pViewFrame->GetViewShell()->ReadUserData( pViewDataItem->GetValue(), sal_True ); + else if( pJumpItem ) + pViewFrame->GetViewShell()->JumpToMark( pJumpItem->GetValue() ); // Position und Groesse setzen - //sal_uInt16 nWinMode = pModeItem ? pModeItem->GetValue() : 1; - if ( pAreaItem && !pOld ) - { - Window *pWin = pImp->pWindow; - - // Groesse setzen - const Rectangle aWinRect( pAreaItem->GetValue() ); - const Size aAppWindow( pImp->pWindow->GetDesktopRectPixel().GetSize() ); - Point aPos( aWinRect.TopLeft() ); - Size aSz(aWinRect.GetSize()); - if ( aSz.Width() && aSz.Height() ) - { - aPos.X() = Min(aPos.X(), - long(aAppWindow.Width() - aSz.Width() + aSz.Width() / 2) ); - aPos.Y() = Min(aPos.Y(), - long( aAppWindow.Height() - aSz.Height() + aSz.Height() / 2) ); - if ( aPos.X() + aSz.Width() < - aAppWindow.Width() + aSz.Width() / 2 && - aPos.Y() + aSz.Height() < - aAppWindow.Height() + aSz.Height() / 2 ) - { - pWin->SetPosPixel( aPos ); - pWin->SetOutputSizePixel( aSz ); - } - } - } + if ( pAreaItem && !pOldDocument ) + PositionWindow_Impl( pAreaItem->GetValue() ); if ( !pImp->bHidden ) { if ( rDoc.IsHelpDocument() || (pPluginMode && pPluginMode->GetValue() == 2) ) - pFrame->GetDispatcher()->HideUI( TRUE ); + pViewFrame->GetDispatcher()->HideUI( TRUE ); else - pFrame->GetDispatcher()->HideUI( FALSE ); + pViewFrame->GetDispatcher()->HideUI( FALSE ); if ( IsInPlace() ) - pFrame->LockAdjustPosSizePixel(); + pViewFrame->LockAdjustPosSizePixel(); if ( pPluginMode && pPluginMode->GetValue() == 3) GetWorkWindow_Impl()->SetInternalDockingAllowed(FALSE); if ( !IsInPlace() ) - pFrame->GetDispatcher()->Update_Impl(); - pFrame->Show(); + pViewFrame->GetDispatcher()->Update_Impl(); + pViewFrame->Show(); GetWindow().Show(); if ( !IsInPlace() || (pPluginMode && pPluginMode->GetValue() == 3) ) - pFrame->MakeActive_Impl( GetFrameInterface()->isActive() ); + pViewFrame->MakeActive_Impl( GetFrameInterface()->isActive() ); rDoc.OwnerLock( sal_False ); // Dont show container window! Its done by framework or directly @@ -956,11 +944,11 @@ sal_Bool SfxTopFrame::InsertDocument_Impl( SfxObjectShell& rDoc ) if ( IsInPlace() ) { - pFrame->UnlockAdjustPosSizePixel(); + pViewFrame->UnlockAdjustPosSizePixel(); // force resize for OLE server to fix layout problems of writer and math // see i53651 if ( pPluginMode && pPluginMode->GetValue() == 3 ) - pFrame->Resize(TRUE); + pViewFrame->Resize(TRUE); } } else @@ -970,19 +958,19 @@ sal_Bool SfxTopFrame::InsertDocument_Impl( SfxObjectShell& rDoc ) } // Jetzt UpdateTitle, hidden TopFrames haben sonst keinen Namen! - pFrame->UpdateTitle(); + pViewFrame->UpdateTitle(); if ( !IsInPlace() ) { - if ( pFrame->GetViewShell()->UseObjectSize() ) + if ( pViewFrame->GetViewShell()->UseObjectSize() ) { - GetCurrentViewFrame()->UnlockAdjustPosSizePixel(); - GetCurrentViewFrame()->Resize(TRUE); - GetCurrentViewFrame()->ForceInnerResize_Impl( FALSE ); - GetCurrentViewFrame()->Resize(TRUE); + pViewFrame->UnlockAdjustPosSizePixel(); + pViewFrame->Resize(TRUE); + pViewFrame->ForceInnerResize_Impl( FALSE ); + pViewFrame->Resize(TRUE); } else - GetCurrentViewFrame()->Resize(TRUE); + pViewFrame->Resize(TRUE); } SFX_APP()->NotifyEvent( SfxEventHint(SFX_EVENT_VIEWCREATED, GlobalEventConfig::GetEventName( STR_EVENT_VIEWCREATED ), &rDoc ) ); diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 2427b54a8c9a..160b594f38af 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -2269,10 +2269,6 @@ SfxViewShell* SfxViewFrame::CreateView_Impl( sal_uInt16 nViewId ) GetDispatcher()->Push( *pViewShell->GetSubShell() ); pViewShell->PushSubShells_Impl(); -#if defined SFX_HINT_VIEWCREATED - GetObjectShell()->Broadcast( SfxSimpleHint( SFX_HINT_VIEWCREATED ) ); -#endif - GetBindings().LEAVEREGISTRATIONS(); DBG_ASSERT( SFX_APP()->GetViewFrames_Impl().Count() == SFX_APP()->GetViewShells_Impl().Count(), "Inconsistent view arrays!" ); |