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

Jan Holesovsky kendy at kemper.freedesktop.org
Tue Dec 27 06:44:41 PST 2011


 sw/source/ui/index/cnttab.src |    2 +-
 vcl/source/window/tabdlg.cxx  |    7 +++----
 2 files changed, 4 insertions(+), 5 deletions(-)

New commits:
commit 114b4806e9233140fc42cba0b174a8f21e323a79
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Tue Dec 27 15:41:22 2011 +0100

    Thanks to Ivan Timofeev, fix the 'Preview' checkbox in 'Indexes and Tables...'

diff --git a/sw/source/ui/index/cnttab.src b/sw/source/ui/index/cnttab.src
index 71f034d..c2ce533 100644
--- a/sw/source/ui/index/cnttab.src
+++ b/sw/source/ui/index/cnttab.src
@@ -106,7 +106,7 @@ TabDialog DLG_MULTI_TOX
     };
     CheckBox CB_SHOWEXAMPLE
     {
-        Size = MAP_APPFONT (  200, 10 ) ;
+        Size = MAP_APPFONT ( 45, 10 ) ;
         Text [ en-US ] = "Preview";
     };
     Text [ en-US ] = "Insert Index/Table";
diff --git a/vcl/source/window/tabdlg.cxx b/vcl/source/window/tabdlg.cxx
index eaf4a14..9313211 100644
--- a/vcl/source/window/tabdlg.cxx
+++ b/vcl/source/window/tabdlg.cxx
@@ -61,12 +61,11 @@ void TabDialog::ImplPosControls()
                 pTabControl = (TabControl*)pChild;
             else if ( pTabControl )
             {
-                long nTxtWidth = pChild->GetCtrlTextWidth( pChild->GetText() );
-                nTxtWidth += IMPL_EXTRA_BUTTON_WIDTH;
+                Size aOptimalSize( pChild->GetOptimalSize( WINDOWSIZE_PREFERRED ) );
+                long nTxtWidth = aOptimalSize.Width();
                 if ( nTxtWidth > aCtrlSize.Width() )
                     aCtrlSize.Width() = nTxtWidth;
-                long nTxtHeight = pChild->GetTextHeight();
-                nTxtHeight += IMPL_EXTRA_BUTTON_HEIGHT;
+                long nTxtHeight = aOptimalSize.Height();
                 if ( nTxtHeight > aCtrlSize.Height() )
                     aCtrlSize.Height() = nTxtHeight;
                 nDownCtrl++;


More information about the Libreoffice-commits mailing list