[Libreoffice-commits] .: Branch 'libreoffice-3-5' - framework/source

Ivan Timofeev ivantimofeev at kemper.freedesktop.org
Sun Jan 15 10:09:06 PST 2012


 framework/source/services/backingwindow.cxx |   20 ++++++++++----------
 framework/source/services/backingwindow.hxx |    2 +-
 2 files changed, 11 insertions(+), 11 deletions(-)

New commits:
commit c4cd4ad8322acb36d73b3c2ba5b983156b5fa12c
Author: Tomcsik Bence <tomcsikbence at gmail.com>
Date:   Sat Jan 14 00:14:45 2012 +0100

    The "Open..." button's more room problem solved fdo#33794
    
    By adding a int i_nExtraWidth parameter to the layoutButton function
    there will be enough space for the open button and its black triangle.
    (cherry picked from commit 1f628c7bf8361086be2044d0d6aa8bbf3f128162)

diff --git a/framework/source/services/backingwindow.cxx b/framework/source/services/backingwindow.cxx
index abc85eb..290e7d3 100644
--- a/framework/source/services/backingwindow.cxx
+++ b/framework/source/services/backingwindow.cxx
@@ -572,33 +572,33 @@ void BackingWindow::initControls()
     }
 
     // layout the buttons
-    layoutButton( WRITER_URL, 0, aFileNewAppsAvailable,
+    layoutButton( WRITER_URL, 0, 0, aFileNewAppsAvailable,
                   aModuleOptions, SvtModuleOptions::E_SWRITER,
                   maWriterButton, aMnemns );
-    layoutButton( DRAW_URL, 1, aFileNewAppsAvailable,
+    layoutButton( DRAW_URL, 1, 0, aFileNewAppsAvailable,
                   aModuleOptions, SvtModuleOptions::E_SDRAW,
                   maDrawButton, aMnemns );
     nYPos += maButtonImageSize.Height() + 10;
-    layoutButton( CALC_URL, 0, aFileNewAppsAvailable,
+    layoutButton( CALC_URL, 0, 0, aFileNewAppsAvailable,
                   aModuleOptions, SvtModuleOptions::E_SCALC,
                   maCalcButton, aMnemns );
-    layoutButton( BASE_URL, 1, aFileNewAppsAvailable,
+    layoutButton( BASE_URL, 1, 0, aFileNewAppsAvailable,
                   aModuleOptions, SvtModuleOptions::E_SDATABASE,
                   maDBButton, aMnemns );
     nYPos += maButtonImageSize.Height() + 10;
-    layoutButton( IMPRESS_WIZARD_URL, 0, aFileNewAppsAvailable,
+    layoutButton( IMPRESS_WIZARD_URL, 0, 0, aFileNewAppsAvailable,
                   aModuleOptions, SvtModuleOptions::E_SIMPRESS,
                   maImpressButton, aMnemns );
-    layoutButton( MATH_URL, 1, aFileNewAppsAvailable,
+    layoutButton( MATH_URL, 1, 0, aFileNewAppsAvailable,
                   aModuleOptions, SvtModuleOptions::E_SMATH,
                   maMathButton, aMnemns );
 
     nYPos += 3*maButtonImageSize.Height() / 2;
 
-    layoutButton( NULL, 0, aFileNewAppsAvailable,
+    layoutButton( NULL, 0, 18, aFileNewAppsAvailable,
                   aModuleOptions, SvtModuleOptions::E_SWRITER,
                   maOpenButton, aMnemns, maOpenString );
-    layoutButton( NULL, 1, aFileNewAppsAvailable,
+    layoutButton( NULL, 1, 0, aFileNewAppsAvailable,
                   aModuleOptions, SvtModuleOptions::E_SWRITER,
                   maTemplateButton, aMnemns, maTemplateString );
     nYPos += 10;
@@ -664,7 +664,7 @@ void BackingWindow::loadImage( const ResId& i_rId, PushButton& i_rButton )
 }
 
 void BackingWindow::layoutButton(
-                          const char* i_pURL, int nColumn,
+                          const char* i_pURL, int nColumn, int i_nExtraWidth,
                           const std::set<rtl::OUString>& i_rURLS,
                           SvtModuleOptions& i_rOpt, SvtModuleOptions::EModule i_eMod,
                           PushButton& i_rBtn,
@@ -690,7 +690,7 @@ void BackingWindow::layoutButton(
 
     long nTextWidth = i_rBtn.GetTextWidth( i_rBtn.GetText() );
 
-    nTextWidth += maButtonImageSize.Width() + 8; // add some fuzz to be on the safe side
+    nTextWidth += maButtonImageSize.Width() + 8 + i_nExtraWidth; // add some fuzz to be on the safe side
     if( nColumn >= 0 && nColumn < static_cast<int>(SAL_N_ELEMENTS(mnColumnWidth)) )
     {
         if( nTextWidth > mnColumnWidth[nColumn] )
diff --git a/framework/source/services/backingwindow.hxx b/framework/source/services/backingwindow.hxx
index 410862f..179a632 100644
--- a/framework/source/services/backingwindow.hxx
+++ b/framework/source/services/backingwindow.hxx
@@ -144,7 +144,7 @@ namespace framework
 
         void loadImage( const ResId& i_rId, PushButton& i_rButton );
 
-        void layoutButton( const char* i_pURL, int nColumn, const std::set<rtl::OUString>& i_rURLS,
+        void layoutButton( const char* i_pURL, int nColumn, int i_nExtraWidth, const std::set<rtl::OUString>& i_rURLS,
                            SvtModuleOptions& i_rOpt, SvtModuleOptions::EModule i_eMod,
                            PushButton& i_rBtn,
                            MnemonicGenerator& i_rMnemonicGen,


More information about the Libreoffice-commits mailing list