diff options
author | Noel Power <noel.power@novell.com> | 2011-11-16 16:38:31 +0000 |
---|---|---|
committer | Noel Power <noel.power@novell.com> | 2011-11-16 16:40:13 +0000 |
commit | 6beeefab7698e86eb7864196a35c232ff84625fa (patch) | |
tree | f23e7d7e896c35d0ad0352dd0e4c5b0b9f26030b /sc | |
parent | f684c33c9188937c1665b428e705e0ef1673cb11 (diff) |
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
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/app/inputwin.cxx | 42 |
1 files changed, 41 insertions, 1 deletions
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 <svtools/miscopt.hxx> #include <comphelper/string.hxx> +#include <com/sun/star/frame/XLayoutManager.hpp> +#include <com/sun/star/frame/XModel.hpp> +#include <com/sun/star/frame/XController.hpp> #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; } |