From 6beeefab7698e86eb7864196a35c232ff84625fa Mon Sep 17 00:00:00 2001 From: Noel Power Date: Wed, 16 Nov 2011 16:38:31 +0000 Subject: make experimental (calc) input bar update better probably there is a better way to do this ( to eg avoid the 'layout' call ) but right now I don't know what it is and at least this is an improvement --- sc/source/ui/app/inputwin.cxx | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index 1ae6f33a42c2..128e3a6a6760 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -79,6 +79,9 @@ #include "AccessibleText.hxx" #include #include +#include +#include +#include #define TEXT_STARTPOS 3 #define TEXT_MULTI_STARTPOS 5 @@ -86,6 +89,16 @@ #define TBX_WINDOW_HEIGHT 22 // in Pixeln - fuer alle Systeme gleich? #define LEFT_OFFSET 5 +using com::sun::star::uno::Reference; +using com::sun::star::uno::UNO_QUERY; + +using com::sun::star::frame::XLayoutManager; +using com::sun::star::frame::XModel; +using com::sun::star::frame::XFrame; +using com::sun::star::frame::XController; +using com::sun::star::beans::XPropertySet; + + enum ScNameInputType { SC_NAME_INPUT_CELL, @@ -903,8 +916,35 @@ IMPL_LINK( ScInputBarGroup, ClickHdl, PushButton*, EMPTYARG ) { pParent->SetMultiLineStatus(false); } - pParent->Resize(); //pParent->CalcWindowSizePixel(); // TODO: changed from RecalcItems(). check if this does the same thing. + SfxViewFrame* pViewFrm = SfxViewFrame::Current(); + if ( pViewFrm ) + { + Reference< com::sun::star::beans::XPropertySet > xPropSet( pViewFrm->GetFrame().GetFrameInterface(), UNO_QUERY ); + Reference< ::com::sun::star::frame::XLayoutManager > xLayoutManager; + + if ( xPropSet.is() ) + { + com::sun::star::uno::Any aValue = xPropSet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LayoutManager" ))); + aValue >>= xLayoutManager; + } + + if ( xLayoutManager.is() ) + { + xLayoutManager->lock(); // this will core + pParent->Resize(); + DataChangedEvent aFakeUpdate( DATACHANGED_SETTINGS, NULL, SETTINGS_STYLE ); + // this basically will trigger the reposititioning of the + // items in the toolbar from ImplFormat ( which is controlled by + // mnWinHeight ) which in turn is updated in ImplCalcItem which is + // controlled by mbCalc. Additionally the ImplFormat above is + // controlled via mbFormat. It seems the easiest way to get these + // booleans set is to send in the fake event below. + pParent->DataChanged( aFakeUpdate); + // unlock relayouts the toolbars in the 4 quadrants + xLayoutManager->unlock(); + } + } return 0; } -- cgit