Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


Le 06/03/2011 10:31, Xavier ALT a écrit :
Hi,

This patch series fix make the color palette size consistent everywhere.
Related to bug fdo#34896 (https://bugs.freedesktop.org//show_bug.cgi?id=34896)

It's my first patch for LibreOffice, so don't hesitate to correct me if
something is wrong.

Hi guys,

If someone still have time to review those two patches for the 3.3.2RC1 ?

Cheers,
Xavier


Cheers,
--
Xavier ALT



_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice

From f053a65fe610f77926f5b07288f346b0b901500f Mon Sep 17 00:00:00 2001
From: Xavier ALT <dex@phoenix-ind.net>
Date: Sun, 6 Mar 2011 10:02:54 +0100
Subject: [PATCH] fdo#34896 color palette size (8x13), only show scrollbar when needed

---
 cui/source/options/optchart.cxx  |    7 +++++--
 cui/source/tabpages/backgrnd.cxx |    8 ++++----
 cui/source/tabpages/tpcolor.cxx  |    5 ++++-
 3 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/cui/source/options/optchart.cxx b/cui/source/options/optchart.cxx
index 4046db1..eddf334 100644
--- a/cui/source/options/optchart.cxx
+++ b/cui/source/options/optchart.cxx
@@ -69,9 +69,9 @@ SvxDefaultColorOptPage::SvxDefaultColorOptPage( Window* pParent, const SfxItemSe
     aValSetColorBox.SetSelectHdl( LINK( this, SvxDefaultColorOptPage, BoxClickedHdl ) );
 
     aValSetColorBox.SetStyle( aValSetColorBox.GetStyle()
-                                    | WB_VSCROLL | WB_ITEMBORDER | WB_NAMEFIELD );
+                                    | WB_ITEMBORDER | WB_NAMEFIELD );
     aValSetColorBox.SetColCount( 8 );
-    aValSetColorBox.SetLineCount( 12 );
+    aValSetColorBox.SetLineCount( 13 );
     aValSetColorBox.SetExtraSpacing( 0 );
     aValSetColorBox.Show();
 
@@ -143,6 +143,9 @@ void SvxDefaultColorOptPage::FillColorBox()
     long nCount = pColorTab->Count();
     XColorEntry* pColorEntry;
 
+    if( nCount > 104 )
+        aValSetColorBox.SetStyle( aValSetColorBox.GetStyle() | WB_VSCROLL );
+
     for( long i = 0; i < nCount; i++ )
     {
         pColorEntry = pColorTab->GetColor( i );
diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx
index 9aabee4..44a93a7 100644
--- a/cui/source/tabpages/backgrnd.cxx
+++ b/cui/source/tabpages/backgrnd.cxx
@@ -1154,13 +1154,13 @@ void SvxBackgroundTabPage::FillColorValueSets_Impl()
             aBackgroundColorSet.InsertItem(    i + 1, pEntry->GetColor(), pEntry->GetName() );
         }
 
-        while ( i < 80 )
+        while ( i < 104 )
         {
             aBackgroundColorSet.InsertItem( i + 1, aColWhite, aStrWhite );
             i++;
         }
 
-        if ( nCount > 80 )
+        if ( nCount > 104 )
         {
             aBackgroundColorSet.SetStyle( nBits | WB_VSCROLL );
         }
@@ -1169,8 +1169,8 @@ void SvxBackgroundTabPage::FillColorValueSets_Impl()
     if ( bOwn )
         delete pColorTable;
 
-    aBackgroundColorSet.SetColCount( 10 );
-    aBackgroundColorSet.SetLineCount( 10 );
+    aBackgroundColorSet.SetColCount( 8 );
+    aBackgroundColorSet.SetLineCount( 13 );
     aBackgroundColorSet.CalcWindowSizePixel( aSize15x15 );
 
 }
diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx
index 984e97f..603849b 100644
--- a/cui/source/tabpages/tpcolor.cxx
+++ b/cui/source/tabpages/tpcolor.cxx
@@ -162,7 +162,7 @@ SvxColorTabPage::SvxColorTabPage
     // ValueSet
     aValSetColorTable.SetStyle( aValSetColorTable.GetStyle() | WB_VSCROLL | WB_ITEMBORDER );
     aValSetColorTable.SetColCount( 8 );
-    aValSetColorTable.SetLineCount( 10 );
+    aValSetColorTable.SetLineCount( 13 );
     aValSetColorTable.SetExtraSpacing( 0 );
     aValSetColorTable.Show();
 
@@ -1142,6 +1142,9 @@ void SvxColorTabPage::FillValueSet_Impl( ValueSet& rVs )
     long nCount = pColorTab->Count();
     XColorEntry* pColorEntry;
 
+    if( nCount > 104 )
+        rVs.SetStyle( rVs.GetStyle() | WB_VSCROLL );
+
     for( long i = 0; i < nCount; i++ )
     {
         pColorEntry = pColorTab->GetColor( i );
-- 
1.7.1

From 92dee34f55738f241dc832fcf9b0a8021f82af9c Mon Sep 17 00:00:00 2001
From: Xavier ALT <dex@phoenix-ind.net>
Date: Sun, 6 Mar 2011 10:00:50 +0100
Subject: [PATCH] fdo#34896 make color palette size consistent (8x13)

---
 svx/source/tbxctrls/tbcontrl.cxx |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 41662cc..14c45e4 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -813,8 +813,8 @@ void SvxFontNameBox_Impl::Select()
 #define WB_NO_DIRECTSELECT      ((WinBits)0x04000000)
 #endif
 
-#define PALETTE_X 10
-#define PALETTE_Y 11
+#define PALETTE_X 8
+#define PALETTE_Y 13
 #define PALETTE_SIZE (PALETTE_X * PALETTE_Y)
 
 SvxColorWindow_Impl::SvxColorWindow_Impl( const OUString&            rCommand,
-- 
1.7.1


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.