[Libreoffice-commits] core.git: 2 commits - include/svx sc/uiconfig svx/source

Jan Holesovsky kendy at suse.cz
Tue Jun 11 07:13:19 PDT 2013


 include/svx/sidebar/SidebarDialControl.hxx        |    2 --
 sc/uiconfig/scalc/ui/sidebaralignment.ui          |    2 +-
 svx/source/dialog/dialcontrol.cxx                 |    7 +++++--
 svx/source/sidebar/possize/SidebarDialControl.cxx |   15 ++-------------
 4 files changed, 8 insertions(+), 18 deletions(-)

New commits:
commit 9e851b69d13935a055ffcf08b9171330bbf5ebbb
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Tue Jun 11 16:02:55 2013 +0200

    sidebar: Remove the setPosSizePixel hack.
    
    Change-Id: I3c074f0860bf9cb384a7189038a214199a2d7222

diff --git a/include/svx/sidebar/SidebarDialControl.hxx b/include/svx/sidebar/SidebarDialControl.hxx
index 68293e6..a3e53d3 100644
--- a/include/svx/sidebar/SidebarDialControl.hxx
+++ b/include/svx/sidebar/SidebarDialControl.hxx
@@ -32,8 +32,6 @@ public:
     virtual ~SidebarDialControl (void);
 
     virtual Size GetOptimalSize() const;
-    virtual void setPosSizePixel(long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags = WINDOW_POSSIZE_ALL);
-
     virtual void MouseButtonDown (const MouseEvent& rMEvt);
 
 protected:
diff --git a/sc/uiconfig/scalc/ui/sidebaralignment.ui b/sc/uiconfig/scalc/ui/sidebaralignment.ui
index 0a14810..c437636 100644
--- a/sc/uiconfig/scalc/ui/sidebaralignment.ui
+++ b/sc/uiconfig/scalc/ui/sidebaralignment.ui
@@ -294,7 +294,7 @@
                 <property name="use_action_appearance">False</property>
               </object>
               <packing>
-                <property name="expand">False</property>
+                <property name="expand">True</property>
                 <property name="fill">True</property>
                 <property name="position">0</property>
               </packing>
diff --git a/svx/source/sidebar/possize/SidebarDialControl.cxx b/svx/source/sidebar/possize/SidebarDialControl.cxx
index a0c1024..82163dd 100644
--- a/svx/source/sidebar/possize/SidebarDialControl.cxx
+++ b/svx/source/sidebar/possize/SidebarDialControl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /*
  * This file is part of the LibreOffice project.
  *
@@ -40,9 +41,6 @@ SidebarDialControl::SidebarDialControl (
     Init(GetOutputSizePixel());
 }
 
-
-
-
 SidebarDialControl::~SidebarDialControl (void)
 {
 }
@@ -52,12 +50,6 @@ Size SidebarDialControl::GetOptimalSize() const
     return LogicToPixel(Size(10, 10), MAP_APPFONT);
 }
 
-void SidebarDialControl::setPosSizePixel(long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags)
-{
-    long nMax = std::max(nWidth, nHeight);
-    DialControl::setPosSizePixel(nX, nY, nMax, nMax, nFlags);
-}
-
 void SidebarDialControl::MouseButtonDown( const MouseEvent& rMEvt )
 {
     if( rMEvt.IsLeft() )
@@ -69,9 +61,6 @@ void SidebarDialControl::MouseButtonDown( const MouseEvent& rMEvt )
     }
 }
 
-
-
-
 void SidebarDialControl::HandleMouseEvent( const Point& rPos, bool bInitial )
 {
     long nX = rPos.X() - mpImpl->mnCenterX;
@@ -94,4 +83,4 @@ void SidebarDialControl::HandleMouseEvent( const Point& rPos, bool bInitial )
 
 } } // end of namespace svx::sidebar
 
-// eof
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 3d0a22e8c3a848f7413d6bd090106371227260d0
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Tue Jun 11 15:56:24 2013 +0200

    dialcontrol: Make it always fit a square.
    
    Change-Id: I37e1d694a5e92b75bd68310f74671897887a60e1

diff --git a/svx/source/dialog/dialcontrol.cxx b/svx/source/dialog/dialcontrol.cxx
index 5ebb396..3c9ce68 100644
--- a/svx/source/dialog/dialcontrol.cxx
+++ b/svx/source/dialog/dialcontrol.cxx
@@ -248,8 +248,11 @@ void DialControl::DialControl_Impl::Init( const Size& rWinSize, const Font& rWin
 
 void DialControl::DialControl_Impl::SetSize( const Size& rWinSize )
 {
-    // "(x - 1) | 1" creates odd value <= x, to have a well-defined center pixel position
-    maWinSize = Size( (rWinSize.Width() - 1) | 1, (rWinSize.Height() - 1) | 1 );
+    // make the control squared, and adjusted so that we have a well-defined
+    // center ["(x - 1) | 1" creates odd value <= x]
+    long nMin = (std::min(rWinSize.Width(), rWinSize.Height()) - 1) | 1;
+
+    maWinSize = Size( nMin, nMin );
 
     mnCenterX = maWinSize.Width() / 2;
     mnCenterY = maWinSize.Height() / 2;


More information about the Libreoffice-commits mailing list