[Libreoffice-commits] .: sc/source

Noel Power noelp at kemper.freedesktop.org
Wed Nov 16 08:39:46 PST 2011


 sc/source/ui/app/inputwin.cxx |   42 +++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 41 insertions(+), 1 deletion(-)

New commits:
commit 6beeefab7698e86eb7864196a35c232ff84625fa
Author: Noel Power <noel.power at novell.com>
Date:   Wed Nov 16 16:38:31 2011 +0000

    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

diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 1ae6f33..128e3a6 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;
 }
 


More information about the Libreoffice-commits mailing list