changeset: 275238:9c631316b583 user: Thomas Benisch date: Fri Dec 10 11:57:28 2010 +0100 summary: #i116037# Don't toggle the calc formula bar when activating and deactivating a chart diff -r e52488e48bd6 -r 9c631316b583 sc/source/ui/app/client.cxx --- a/sc/source/ui/app/client.cxx Tue Nov 23 18:24:20 2010 +0100 +++ b/sc/source/ui/app/client.cxx Fri Dec 10 11:57:28 2010 +0100 @@ -254,3 +254,13 @@ } } +void ScClient::DeactivateObj() +{ + DeactivateObject(); + + ScTabViewShell* pViewSh = dynamic_cast< ScTabViewShell* >( GetViewShell() ); + if ( pViewSh ) + { + pViewSh->UpdateInputHandler(); + } +} diff -r e52488e48bd6 -r 9c631316b583 sc/source/ui/app/scdll.cxx --- a/sc/source/ui/app/scdll.cxx Tue Nov 23 18:24:20 2010 +0100 +++ b/sc/source/ui/app/scdll.cxx Fri Dec 10 11:57:28 2010 +0100 @@ -287,8 +287,7 @@ // Child-Windows - // Hack: Eingabezeile mit 42 registrieren, damit sie im PlugIn immer sichtbar ist - ScInputWindowWrapper ::RegisterChildWindow(42, pMod, SFX_CHILDWIN_TASK|SFX_CHILDWIN_FORCEDOCK); + ScInputWindowWrapper ::RegisterChildWindow( TRUE, pMod, SFX_CHILDWIN_TASK|SFX_CHILDWIN_FORCEDOCK|SFX_CHILDWIN_NEVERHIDEACTIVEOLE ); ScNavigatorDialogWrapper ::RegisterChildWindowContext( sal::static_int_cast(ScTabViewShell::GetInterfaceId()), pMod); ScSolverDlgWrapper ::RegisterChildWindow(FALSE, pMod); diff -r e52488e48bd6 -r 9c631316b583 sc/source/ui/drawfunc/fusel.cxx --- a/sc/source/ui/drawfunc/fusel.cxx Tue Nov 23 18:24:20 2010 +0100 +++ b/sc/source/ui/drawfunc/fusel.cxx Fri Dec 10 11:57:28 2010 +0100 @@ -56,6 +56,7 @@ #include "drwlayer.hxx" #include "userdat.hxx" #include "scmod.hxx" +#include "client.hxx" // ----------------------------------------------------------------------- @@ -462,15 +463,16 @@ /************************************************************************** * Ggf. OLE-Objekt beruecksichtigen **************************************************************************/ - SfxInPlaceClient* pIPClient = pViewShell->GetIPClient(); - if (pIPClient) + ScClient* pClient = static_cast< ScClient* >( pViewShell->GetIPClient() ); + if ( pClient ) { ScModule* pScMod = SC_MOD(); bool bUnoRefDialog = pScMod->IsRefDialogOpen() && pScMod->GetCurRefDlgId() == WID_SIMPLE_REF; - - if ( pIPClient->IsObjectInPlaceActive() && !bUnoRefDialog ) - pIPClient->DeactivateObject(); + if ( pClient->IsObjectInPlaceActive() && !bUnoRefDialog ) + { + pClient->DeactivateObj(); + } } USHORT nClicks = rMEvt.GetClicks(); diff -r e52488e48bd6 -r 9c631316b583 sc/source/ui/inc/client.hxx --- a/sc/source/ui/inc/client.hxx Tue Nov 23 18:24:20 2010 +0100 +++ b/sc/source/ui/inc/client.hxx Fri Dec 10 11:57:28 2010 +0100 @@ -56,6 +56,7 @@ SdrGrafObj* GetGrafEdit() const { return pGrafEdit; } void SetGrafEdit(SdrGrafObj* pNew) { pGrafEdit = pNew; } SdrOle2Obj* GetDrawObj(); + void DeactivateObj(); }; diff -r e52488e48bd6 -r 9c631316b583 sc/source/ui/view/drawview.cxx --- a/sc/source/ui/view/drawview.cxx Tue Nov 23 18:24:20 2010 +0100 +++ b/sc/source/ui/view/drawview.cxx Fri Dec 10 11:57:28 2010 +0100 @@ -416,7 +416,7 @@ { // #41730# beim ViewShell::Activate aus dem Reset2Open nicht die Handles anzeigen //HMHbDisableHdl = TRUE; - pClient->DeactivateObject(); + pClient->DeactivateObj(); //HMHbDisableHdl = FALSE; // Image-Ole wieder durch Grafik ersetzen passiert jetzt in ScClient::UIActivate } diff -r e52488e48bd6 -r 9c631316b583 sc/source/ui/view/tabvwshb.cxx --- a/sc/source/ui/view/tabvwshb.cxx Tue Nov 23 18:24:20 2010 +0100 +++ b/sc/source/ui/view/tabvwshb.cxx Fri Dec 10 11:57:28 2010 +0100 @@ -76,6 +76,7 @@ #include "chartarr.hxx" #include "drawview.hxx" #include "ChartRangeSelectionListener.hxx" +#include "inputhdl.hxx" using namespace com::sun::star; @@ -179,6 +180,12 @@ bErrorShown = TRUE; // SfxViewShell::DoVerb zeigt seine Fehlermeldungen selber an + ScInputHandler* pInputHdl = SC_MOD()->GetInputHdl( this ); + if ( pInputHdl ) + { + pInputHdl->NotifyChange( NULL ); + } + // attach listener to selection changes in chart that affect cell // ranges, so those can be highlighted // note: do that after DoVerb, so that the chart controller exists @@ -263,7 +270,7 @@ ScClient* pClient = (ScClient*) GetIPClient(); if ( pClient && pClient->IsObjectInPlaceActive() && !bUnoRefDialog ) - pClient->DeactivateObject(); + pClient->DeactivateObj(); } void ScTabViewShell::ExecDrawIns(SfxRequest& rReq) diff -r e52488e48bd6 -r 9c631316b583 sfx2/inc/sfx2/childwin.hxx --- a/sfx2/inc/sfx2/childwin.hxx Tue Nov 23 18:24:20 2010 +0100 +++ b/sfx2/inc/sfx2/childwin.hxx Fri Dec 10 11:57:28 2010 +0100 @@ -60,6 +60,7 @@ #define SFX_CHILDWIN_CANTGETFOCUS 0x20 // ChildWindow kann keinen Focus bekommen #define SFX_CHILDWIN_ALWAYSAVAILABLE 0x40 // ChildWindow is never disabled #define SFX_CHILDWIN_NEVERHIDE 0x80 // ChildWindow is can always made visible/is visible +#define SFX_CHILDWIN_NEVERHIDEACTIVEOLE 0x0100 // ChildWindow is visible with active inplace client #define CHILDWIN_NOPOS USHRT_MAX // Konfiguration eines ChildWindows diff -r e52488e48bd6 -r 9c631316b583 sfx2/source/appl/childwin.cxx --- a/sfx2/source/appl/childwin.cxx Tue Nov 23 18:24:20 2010 +0100 +++ b/sfx2/source/appl/childwin.cxx Fri Dec 10 11:57:28 2010 +0100 @@ -467,12 +467,9 @@ if ( nNextPos != STRING_NOTFOUND ) { // es gibt noch Extra-Information - rInfo.nFlags = (sal_uInt16)aWinData.Copy( nPos+1, nNextPos - nPos - 1 ).ToInt32(); aWinData.Erase( nPos, nNextPos-nPos+1 ); rInfo.aExtraString = aWinData; } - else - rInfo.nFlags = (sal_uInt16)aWinData.Copy( nPos+1 ).ToInt32(); } } } diff -r e52488e48bd6 -r 9c631316b583 sfx2/source/appl/workwin.cxx --- a/sfx2/source/appl/workwin.cxx Tue Nov 23 18:24:20 2010 +0100 +++ b/sfx2/source/appl/workwin.cxx Fri Dec 10 11:57:28 2010 +0100 @@ -822,7 +822,19 @@ if ( pF && pF->GetViewShell() ) pClient = pF->GetViewShell()->GetIPClient(); - if ( pClient ) + bool bForceArrange( false ); + for ( USHORT n = 0; n < pChildWins->Count(); ++n ) + { + SfxChildWin_Impl* pCW = (*pChildWins)[ n ]; + SfxChildWindow* pChild = pCW->pWin; + if ( pChild && ( pCW->aInfo.nFlags & SFX_CHILDWIN_NEVERHIDEACTIVEOLE ) && pCW->aInfo.bVisible ) + { + bForceArrange = true; + break; + } + } + + if ( pClient && !bForceArrange ) return; aClientArea = GetTopRect_Impl(); @@ -832,7 +844,7 @@ SvBorder aBorder; if ( nChilds ) { - if ( IsVisible_Impl() ) + if ( IsVisible_Impl() || bForceArrange ) aBorder = Arrange_Impl(); } @@ -1143,6 +1155,13 @@ DBG_CHKTHIS(SfxWorkWindow, 0); bool bInvisible = ( !IsVisible_Impl() || ( !pWorkWin->IsReallyVisible() && !pWorkWin->IsReallyShown() )); + + SfxInPlaceClient* pClient = 0; + SfxViewFrame* pViewFrame = pBindings->GetDispatcher_Impl()->GetFrame(); + if ( pViewFrame && pViewFrame->GetViewShell() ) + { + pClient = pViewFrame->GetViewShell()->GetIPClient(); + } SfxChild_Impl *pCli = 0; for ( USHORT nPos = 0; nPos < pChilds->Count(); ++nPos ) @@ -1173,6 +1192,7 @@ // visible. sal_uInt16 nFlags = pCW->aInfo.nFlags; bVisible = !bInvisible || ( bInvisible & (( nFlags & SFX_CHILDWIN_NEVERHIDE ) != 0 )); + bVisible = bVisible || ( pClient && ( nFlags & SFX_CHILDWIN_NEVERHIDEACTIVEOLE ) ); } if ( CHILD_VISIBLE == (pCli->nVisible & CHILD_VISIBLE) && bVisible ) @@ -1645,8 +1665,7 @@ void SfxWorkWindow::CreateChildWin_Impl( SfxChildWin_Impl *pCW, BOOL bSetFocus ) { - if ( pCW->aInfo.bVisible != 42 ) - pCW->aInfo.bVisible = TRUE; + pCW->aInfo.bVisible = TRUE; SfxChildWindow *pChildWin = SfxChildWindow::CreateChildWindow( pCW->nId, pWorkWin, &GetBindings(), pCW->aInfo); if (pChildWin)