ooo-build r15299 - in trunk: . patches/dev300



Author: kyoshida
Date: Fri Feb  6 03:30:11 2009
New Revision: 15299
URL: http://svn.gnome.org/viewvc/ooo-build?rev=15299&view=rev

Log:
2009-02-05  Daniel Watson  <daniel watsonbros gmail com>

	* patches/dev300/calc-sheet-tab-color-officecfg.diff:
	* patches/dev300/calc-sheet-tab-color-sc.diff:
	* patches/dev300/calc-sheet-tab-color-svtools.diff: changed menu 
	strings, and replaced the color dialog.


Modified:
   trunk/ChangeLog
   trunk/patches/dev300/calc-sheet-tab-color-officecfg.diff
   trunk/patches/dev300/calc-sheet-tab-color-sc.diff
   trunk/patches/dev300/calc-sheet-tab-color-svtools.diff

Modified: trunk/patches/dev300/calc-sheet-tab-color-officecfg.diff
==============================================================================
--- trunk/patches/dev300/calc-sheet-tab-color-officecfg.diff	(original)
+++ trunk/patches/dev300/calc-sheet-tab-color-officecfg.diff	Fri Feb  6 03:30:11 2009
@@ -1,5 +1,5 @@
 diff --git officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu
-index d32c182..e7116ba 100644
+index d32c182..3df357d 100644
 --- officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu
 +++ officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu
 @@ -1252,6 +1252,19 @@
@@ -8,7 +8,7 @@
  			</node>
 +            <node oor:name=".uno:SetTabBgColor" oor:op="replace">
 +                <prop oor:name="Label" oor:type="xs:string">
-+                    <value xml:lang="en-US">Set ~Tab Color...</value>
++                    <value xml:lang="en-US">~Tab Color...</value>
 +                </prop>
 +                <prop oor:name="ContextLabel" oor:type="xs:string">
 +                    <value xml:lang="en-US">~Tab Color...</value>
@@ -16,7 +16,7 @@
 +            </node>
 +            <node oor:name=".uno:TabBgColor" oor:op="replace">
 +                <prop oor:name="Label" oor:type="xs:string">
-+                    <value xml:lang="en-US">Set Tab Color</value>
++                    <value xml:lang="en-US">Tab Color</value>
 +                </prop>
 +            </node>
  			<node oor:name=".uno:Move" oor:op="replace">

Modified: trunk/patches/dev300/calc-sheet-tab-color-sc.diff
==============================================================================
--- trunk/patches/dev300/calc-sheet-tab-color-sc.diff	(original)
+++ trunk/patches/dev300/calc-sheet-tab-color-sc.diff	Fri Feb  6 03:30:11 2009
@@ -20,73 +20,115 @@
  #define SC_CURSORPOSITIONX					"CursorPositionX"
  #define SC_CURSORPOSITIONY					"CursorPositionY"
 diff --git sc/inc/globstr.hrc sc/inc/globstr.hrc
-index fbf7540..d0a0e4a 100644
+index fbf7540..b824628 100644
 --- sc/inc/globstr.hrc
 +++ sc/inc/globstr.hrc
-@@ -590,7 +590,9 @@
+@@ -589,8 +589,10 @@
+ #define STR_FORM_DROPDOWN           446
  #define STR_FORM_SPINNER            447
  #define STR_FORM_SCROLLBAR          448
++
++#define STR_UNDO_SET_TAB_BG_COLOR   449
                                         
 -#define STR_COUNT                   449
-+#define STR_UNDO_SET_TAB_BG_COLOR   449
-+  
 +#define STR_COUNT                   450
  
  #endif
  
 diff --git sc/inc/sc.hrc sc/inc/sc.hrc
-index 2eba0d8..f646b4a 100644
+index 2eba0d8..95590a8 100644
 --- sc/inc/sc.hrc
 +++ sc/inc/sc.hrc
-@@ -1664,6 +1664,11 @@
+@@ -1664,6 +1664,19 @@
  #define RID_SCPAGE_FORMULA          (SC_OOO_BUILD_START + 5)
  #define HID_SCPAGE_FORMULA          (SC_OOO_BUILD_START + 6)
  
 +// Sheet tab color
++//FIXME Get an official FID for my stuff
 +#define FID_TAB_MENU_SET_TAB_BG_COLOR   (SC_OOO_BUILD_START + 7)
 +#define FID_TAB_SET_TAB_BG_COLOR        (SC_OOO_BUILD_START + 8)
++
 +#define SCSTR_SET_TAB_BG_COLOR          (SC_OOO_BUILD_START + 9)
++#define SCSTR_NO_TAB_BG_COLOR           (SC_OOO_BUILD_START + 10)
++#define SCSTR_TAB_BG_COLOR_MORE         (SC_OOO_BUILD_START + 11)
++
++#define RID_SCDLG_TAB_BG_COLOR          (SC_OOO_BUILD_START + 12)
++
++
 +
  #endif
  
  
+diff --git sc/inc/scabstdlg.hxx sc/inc/scabstdlg.hxx
+index 46c9dc9..c03ad9c 100644
+--- sc/inc/scabstdlg.hxx
++++ sc/inc/scabstdlg.hxx
+@@ -292,6 +292,12 @@ public:
+ 	virtual void GetInputString( String& rString ) const = 0;
+ };
+ 
++class AbstractScTabBgColorDlg : public VclAbstractDialog  //add for ScTabBgColorDlg
++{
++public:
++    virtual void GetSelectedColor( Color& rColor ) const = 0;
++};
++
+ class AbstractScImportOptionsDlg : public VclAbstractDialog  //add for ScImportOptionsDlg
+ {
+ public:
+@@ -433,6 +439,15 @@ public:
+ 																const String& rDefault,
+ 																ULONG nHelpId ,
+ 																int nId ) = 0;
++
++    virtual AbstractScTabBgColorDlg * CreateScTabBgColorDlg (  Window* pParent, //add for ScTabBgColorDlg
++                                                                const String& rTitle, //Dialog Title
++                                                                const String& rTabBgColorNoColorText, //Label for no tab color
++                                                                const String& rTabBgColorMoreText, //Text for the more button
++                                                                const Color& rDefaultColor, //Currently selected Color
++                                                                ULONG nHelpId ,
++                                                                int nId ) = 0;
++
+ 	virtual AbstractScImportOptionsDlg * CreateScImportOptionsDlg ( Window* 				pParent, //add for ScImportOptionsDlg
+ 																	int nId,
+ 																	BOOL                    bAscii = TRUE,
 diff --git sc/inc/scextopt.hxx sc/inc/scextopt.hxx
-index 3464fbb..37c6cb0 100644
+index 3464fbb..ba1eea2 100644
 --- sc/inc/scextopt.hxx
 +++ sc/inc/scextopt.hxx
 @@ -81,6 +81,8 @@ struct ScExtTabSettings
      bool                mbFrozenPanes;      /// true = Frozen panes; false = Normal splits.
      bool                mbPageMode;         /// true = Pagebreak mode; false = Normal view mode.
      bool                mbShowGrid;         /// Whether or not to display gridlines.
-+    bool                mbIsDefaultTabBgColor;  /// true = draw default tab color
-+    Color               maTabBgColor;           /// Tab Bg Color
++    Color               maTabBgColor;       /// Tab Bg Color
++    bool                IsDefaultTabBgColor() const { return maTabBgColor == Color(COL_AUTO) ? TRUE : FALSE; };
  
      explicit            ScExtTabSettings();
  };
 diff --git sc/inc/unonames.hxx sc/inc/unonames.hxx
-index 253c197..a348e69 100644
+index 253c197..90d20ba 100644
 --- sc/inc/unonames.hxx
 +++ sc/inc/unonames.hxx
-@@ -529,6 +529,7 @@
- #define SC_UNO_ZOOMVALUE            "ZoomValue"
- #define SC_UNO_UPDTEMPL             "UpdateFromTemplate"
+@@ -531,6 +531,7 @@
  #define SC_UNO_FILTERED_RANGE_SELECTION       "FilteredRangeSelection"
-+#define SC_UNO_TABCOLOR             "TabColor"
  /*Stampit enable/disable print cancel */
  #define SC_UNO_ALLOWPRINTJOBCANCEL  "AllowPrintJobCancel"
++#define SC_UNO_TABCOLOR             "TabColor"
  
+ //	old (5.2) property names for view options - for compatibility only!
+ #define OLD_UNO_COLROWHDR			"ColumnRowHeaders"
 diff --git sc/sdi/docsh.sdi sc/sdi/docsh.sdi
-index 16dff9a..4ee3d4c 100644
+index 16dff9a..829a70b 100644
 --- sc/sdi/docsh.sdi
 +++ sc/sdi/docsh.sdi
-@@ -62,6 +62,7 @@ interface TableSelection
- 	FID_TAB_MOVE		[ ExecMethod = ExecuteTable; StateMethod = GetStateTable; ]
- 	FID_DELETE_TABLE	[ ExecMethod = ExecuteTable; StateMethod = GetStateTable; ]
+@@ -64,6 +64,7 @@ interface TableSelection
  	FID_TAB_RENAME		[ ExecMethod = ExecuteTable; StateMethod = GetStateTable; ]
-+    FID_TAB_SET_TAB_BG_COLOR    [ ExecMethod = ExecuteTable; StateMethod = GetStateTable; ]
  	FID_TAB_RTL			[ ExecMethod = ExecuteTable; StateMethod = GetStateTable; ]
      FID_TAB_TOGGLE_GRID [ ExecMethod = ExecuteTable; StateMethod = GetStateTable; ]
++    FID_TAB_SET_TAB_BG_COLOR    [ ExecMethod = ExecuteTable; StateMethod = GetStateTable; ]
  
+ 	SID_TABLE_ACTIVATE	[ ExecMethod = Execute; ]
+ }
 diff --git sc/sdi/scalc.sdi sc/sdi/scalc.sdi
 index 254442f..2e1ec8c 100644
 --- sc/sdi/scalc.sdi
@@ -189,7 +231,7 @@
          case EXC_COLOR_GRID:        return 50;
          default:    DBG_ERRORFILE( "lclGetWeighting - unknown color type" );
 diff --git sc/source/filter/excel/xeview.cxx sc/source/filter/excel/xeview.cxx
-index 1ee104c..9f6daae 100644
+index 1ee104c..9a93776 100644
 --- sc/source/filter/excel/xeview.cxx
 +++ sc/source/filter/excel/xeview.cxx
 @@ -259,6 +259,36 @@ void XclExpSelection::WriteBody( XclExpStream& rStrm )
@@ -211,7 +253,7 @@
 +
 +void XclExpTabBgColor::WriteBody( XclExpStream& rStrm )
 +{
-+    if ( mrTabViewData.mbIsDefaultTabBgColor )
++    if ( mrTabViewData.IsDefaultTabBgColor() )
 +        return;
 +    sal_uInt16 rt = 0x0862; //rt
 +    sal_uInt16 grbitFrt = 0x0000; //grbit must be set to 0
@@ -229,23 +271,22 @@
  // Sheet view settings ========================================================
  
  namespace {
-@@ -368,6 +398,15 @@ XclExpTabViewSettings::XclExpTabViewSettings( const XclExpRoot& rRoot, SCTAB nSc
+@@ -368,6 +398,14 @@ XclExpTabViewSettings::XclExpTabViewSettings( const XclExpRoot& rRoot, SCTAB nSc
          maData.mnNormalZoom     = lclGetXclZoom( rTabSett.mnNormalZoom, EXC_WIN2_NORMALZOOM_DEF );
          maData.mnPageZoom       = lclGetXclZoom( rTabSett.mnPageZoom, EXC_WIN2_PAGEZOOM_DEF );
          maData.mnCurrentZoom    = maData.mbPageMode ? maData.mnPageZoom : maData.mnNormalZoom;
 +
 +        // Tab Bg Color
-+        if ( GetBiff() == EXC_BIFF8 && !rTabSett.mbIsDefaultTabBgColor )
++        if ( GetBiff() == EXC_BIFF8 && !rTabSett.IsDefaultTabBgColor() )
 +        {
 +            XclExpPalette& rPal = GetPalette();
-+            maData.mbIsDefaultTabBgColor = false;
 +            maData.maTabBgColor = rTabSett.maTabBgColor;
 +            maData.mnTabBgColorId = rPal.InsertColor(maData.maTabBgColor, EXC_COLOR_TABBG, EXC_COLOR_NOTABBG );
 +        }
      }
  }
  
-@@ -380,6 +419,7 @@ void XclExpTabViewSettings::Save( XclExpStream& rStrm )
+@@ -380,6 +418,7 @@ void XclExpTabViewSettings::Save( XclExpStream& rStrm )
      WriteSelection( rStrm, EXC_PANE_TOPRIGHT );
      WriteSelection( rStrm, EXC_PANE_BOTTOMLEFT );
      WriteSelection( rStrm, EXC_PANE_BOTTOMRIGHT );
@@ -253,13 +294,13 @@
  }
  
  static void lcl_WriteSelection( XclExpXmlStream& rStrm, const XclTabViewData& rData, sal_uInt8 nPane )
-@@ -494,5 +534,10 @@ void XclExpTabViewSettings::WriteSelection( XclExpStream& rStrm, sal_uInt8 nPane
+@@ -494,5 +533,10 @@ void XclExpTabViewSettings::WriteSelection( XclExpStream& rStrm, sal_uInt8 nPane
          XclExpSelection( maData, nPane ).Save( rStrm );
  }
  
 +void XclExpTabViewSettings::WriteTabBgColor( XclExpStream& rStrm ) const
 +{
-+    if ( !maData.mbIsDefaultTabBgColor )
++    if ( !maData.IsDefaultTabBgColor() )
 +        XclExpTabBgColor( maData ).Save( rStrm );
 +}
  // ============================================================================
@@ -282,10 +323,10 @@
  
          switch( rStrm.GetRecId() )
 diff --git sc/source/filter/excel/xiview.cxx sc/source/filter/excel/xiview.cxx
-index 55525ad..3d62836 100644
+index 55525ad..ce76483 100644
 --- sc/source/filter/excel/xiview.cxx
 +++ sc/source/filter/excel/xiview.cxx
-@@ -109,6 +109,25 @@ void XclImpTabViewSettings::Initialize()
+@@ -109,6 +109,24 @@ void XclImpTabViewSettings::Initialize()
      maData.SetDefaults();
  }
  
@@ -304,36 +345,31 @@
 +    {
 +        TabBgColor = rPal.GetColor( ColorIndex );
 +        maData.maTabBgColor = TabBgColor;
-+        maData.mbIsDefaultTabBgColor = false;
 +    }
 +}
 +
  void XclImpTabViewSettings::ReadWindow2( XclImpStream& rStrm, bool bChart )
  {
      if( GetBiff() == EXC_BIFF2 )
-@@ -281,6 +300,13 @@ void XclImpTabViewSettings::Finalize()
+@@ -281,6 +299,10 @@ void XclImpTabViewSettings::Finalize()
          aViewOpt.SetOption( VOPT_OUTLINER, maData.mbShowOutline );
          rDoc.SetViewOptions( aViewOpt );
      }
 +
 +    // *** set tab bg color
-+    if (!maData.mbIsDefaultTabBgColor)
-+    {
-+        rTabSett.mbIsDefaultTabBgColor = maData.mbIsDefaultTabBgColor;
++    if ( !maData.IsDefaultTabBgColor() )
 +        rTabSett.maTabBgColor = maData.maTabBgColor;
-+    }
  }
  
  // ============================================================================
 diff --git sc/source/filter/excel/xlview.cxx sc/source/filter/excel/xlview.cxx
-index 080075b..2b8c50d 100644
+index 080075b..8580d7a 100644
 --- sc/source/filter/excel/xlview.cxx
 +++ sc/source/filter/excel/xlview.cxx
-@@ -79,6 +79,8 @@ void XclTabViewData::SetDefaults()
+@@ -79,6 +79,7 @@ void XclTabViewData::SetDefaults()
      mbDefGridColor = true;
      mbShowFormulas = false;
      mbShowGrid = mbShowHeadings = mbShowZeros = mbShowOutline = true;
-+    mbIsDefaultTabBgColor = true;
 +    maTabBgColor.SetColor( COL_AUTO );
  }
  
@@ -400,7 +436,7 @@
      void                Finalize();
  
 diff --git sc/source/filter/inc/xlview.hxx sc/source/filter/inc/xlview.hxx
-index 4a3798e..c78979b 100644
+index 4a3798e..3070c28 100644
 --- sc/source/filter/inc/xlview.hxx
 +++ sc/source/filter/inc/xlview.hxx
 @@ -89,6 +89,11 @@ const sal_uInt8 EXC_PANE_TOPLEFT            = 3;        /// Single, top, left, o
@@ -419,14 +455,123 @@
      bool                mbShowHeadings;     /// true = Show column/row headings.
      bool                mbShowZeros;        /// true = Show zero value zells.
      bool                mbShowOutline;      /// true = Show outlines.
-+    bool                mbIsDefaultTabBgColor;	/// true = don't set tab color; false = set tab color;
-+    Color               maTabBgColor;           /// Tab Color default = (COL_AUTO )
++    Color               maTabBgColor;       /// Tab Color default = (COL_AUTO )
++    bool                IsDefaultTabBgColor() const { return maTabBgColor == Color(COL_AUTO) ? TRUE : FALSE; };
 +    sal_uInt32          mnTabBgColorId;         /// pallette color id
  
      explicit            XclTabViewData();
                          ~XclTabViewData();
+diff --git sc/source/ui/attrdlg/scdlgfact.cxx sc/source/ui/attrdlg/scdlgfact.cxx
+index ad0e25b..e631188 100644
+--- sc/source/ui/attrdlg/scdlgfact.cxx
++++ sc/source/ui/attrdlg/scdlgfact.cxx
+@@ -61,6 +61,7 @@
+ #include "scendlg.hxx" //add for ScNewScenarioDlg
+ #include "shtabdlg.hxx" //add for ScShowTabDlg
+ #include "strindlg.hxx" //add for ScStringInputDlg
++#include "tabbgcolordlg.hxx"//add for ScTabBgColorDlg
+ #include "scuiimoptdlg.hxx" //add for ScImportOptionsDlg
+ #include "attrdlg.hxx" //add for ScAttrDlg
+ #include "hfedtdlg.hxx" //add for ScHFEditDlg
+@@ -115,6 +116,7 @@ IMPL_ABSTDLG_BASE(AbstractScDPShowDetailDlg_Impl); //add for ScDPShowDetailDlg
+ IMPL_ABSTDLG_BASE(AbstractScNewScenarioDlg_Impl); //add for ScNewScenarioDlg
+ IMPL_ABSTDLG_BASE(AbstractScShowTabDlg_Impl); //add for ScShowTabDlg
+ IMPL_ABSTDLG_BASE(AbstractScStringInputDlg_Impl); //add for ScStringInputDlg
++IMPL_ABSTDLG_BASE(AbstractScTabBgColorDlg_Impl); //add for ScTabBgColorDlg
+ IMPL_ABSTDLG_BASE(AbstractScImportOptionsDlg_Impl); //add for ScImportOptionsDlg
+ IMPL_ABSTDLG_BASE(AbstractTabDialog_Impl); //add for ScAttrDlg, ScHFEditDlg, ScStyleDlg, ScSubTotalDlg,ScCharDlg, ScParagraphDlg, ScValidationDlg, ScSortDlg
+ 
+@@ -615,6 +617,14 @@ void AbstractScStringInputDlg_Impl::GetInputString( String& rString ) const  //a
+ }
+ //add for AbstractScStringInputDlg_Impl end
+ 
++//add for AbstractScTabBgColorDlg_Impl begin
++void AbstractScTabBgColorDlg_Impl::GetSelectedColor( Color& rColor ) const  //add for ScTabBgColorDlg
++{
++    pDlg->GetSelectedColor( rColor );
++}
++//add for AbstractScTabBgColorDlg_Impl end
++
++
+ //add for AbstractScImportOptionsDlg_Impl begin
+ void AbstractScImportOptionsDlg_Impl::GetImportOptions( ScImportOptions& rOptions ) const  //add for ScImportOptionsDlg
+ {
+@@ -1263,6 +1273,32 @@ AbstractScShowTabDlg * ScAbstractDialogFactory_Impl::CreateScShowTabDlg ( Window
+ }
+  //add for ScStringInputDlg end
+ 
++//add for ScTabBgColorDlg begin
++AbstractScTabBgColorDlg * ScAbstractDialogFactory_Impl::CreateScTabBgColorDlg (
++                                                            Window* pParent,
++                                                            const String& rTitle,
++                                                            const String& rTabBgColorNoColorText,
++                                                            const String& rTabBgColorMoreText,
++                                                            const Color& rDefaultColor,
++                                                            ULONG nHelpId ,
++                                                            int nId )
++{
++ScTabBgColorDlg * pDlg=NULL;
++switch ( nId )
++{
++    case RID_SCDLG_TAB_BG_COLOR :
++        pDlg = new ScTabBgColorDlg( pParent, rTitle, rTabBgColorNoColorText, rTabBgColorMoreText, rDefaultColor, nHelpId );
++        break;
++    default:
++        break;
++}
++
++if ( pDlg )
++    return new AbstractScTabBgColorDlg_Impl( pDlg );
++return 0;
++}
++//add for ScTabBgColorDlg end
++
+ //add for ScImportOptionsDlg begin
+ AbstractScImportOptionsDlg * ScAbstractDialogFactory_Impl::CreateScImportOptionsDlg ( Window* 				pParent,
+ 																	int nId,
+diff --git sc/source/ui/attrdlg/scdlgfact.hxx sc/source/ui/attrdlg/scdlgfact.hxx
+index 05864d1..dd59844 100644
+--- sc/source/ui/attrdlg/scdlgfact.hxx
++++ sc/source/ui/attrdlg/scdlgfact.hxx
+@@ -62,6 +62,7 @@ class ScDPShowDetailDlg;
+ class ScNewScenarioDlg;
+ class ScShowTabDlg;
+ class ScStringInputDlg;
++class ScTabBgColorDlg;
+ class ScImportOptionsDlg;
+ class SfxTabDialog;
+ 
+@@ -343,6 +344,12 @@ class AbstractScStringInputDlg_Impl :  public AbstractScStringInputDlg  //add fo
+ 	virtual void GetInputString( String& rString ) const;
+ };
+ 
++class AbstractScTabBgColorDlg_Impl :  public AbstractScTabBgColorDlg  //add for ScTabBgColorDlg
++{
++    DECL_ABSTDLG_BASE( AbstractScTabBgColorDlg_Impl, ScTabBgColorDlg )
++    virtual void GetSelectedColor( Color& rColor ) const;
++};
++
+ class AbstractScImportOptionsDlg_Impl : public AbstractScImportOptionsDlg  //add for ScImportOptionsDlg
+ {
+ 	DECL_ABSTDLG_BASE( AbstractScImportOptionsDlg_Impl, ScImportOptionsDlg)
+@@ -517,6 +524,15 @@ public:
+ 																const String& rDefault,
+ 																ULONG nHelpId ,
+ 																int nId );
++
++    virtual AbstractScTabBgColorDlg * CreateScTabBgColorDlg (  Window* pParent, //add for ScStringInputDlg
++                                                                const String& rTitle, //Dialog Title
++                                                                const String& rTabBgColorNoColorText, //Label for no tab color
++                                                                const String& rTabBgColorMoreText, //Label for more button
++                                                                const Color& rDefaultColor, //Currently selected Color
++                                                                ULONG nHelpId ,
++                                                                int nId );
++
+ 	virtual AbstractScImportOptionsDlg * CreateScImportOptionsDlg ( Window* 				pParent, //add for ScImportOptionsDlg
+ 																	int nId,
+ 																	BOOL                    bAscii = TRUE,
 diff --git sc/source/ui/docshell/docfunc.cxx sc/source/ui/docshell/docfunc.cxx
-index 5da446b..2e704fe 100644
+index 5da446b..3c9b947 100644
 --- sc/source/ui/docshell/docfunc.cxx
 +++ sc/source/ui/docshell/docfunc.cxx
 @@ -2612,6 +2612,45 @@ BOOL ScDocFunc::RenameTable( SCTAB nTab, const String& rName, BOOL bRecord, BOOL
@@ -460,7 +605,7 @@
 +        if (bRecord)
 +        {
 +            rDocShell.GetUndoManager()->AddUndoAction(
-+                            new ScUndoSetTabBgColor( &rDocShell, nTab, aOldTabBgColor, rColor));
++                new ScUndoSetTabBgColor( &rDocShell, nTab, aOldTabBgColor, rColor));
 +        }
 +        rDocShell.PostPaintExtras();
 +        ScDocShellModificator aModificator( rDocShell );
@@ -488,6 +633,102 @@
  	BOOL			SetTableVisible( SCTAB nTab, BOOL bVisible, BOOL bApi );
  
  	BOOL			SetLayoutRTL( SCTAB nTab, BOOL bRTL, BOOL bApi );
+diff --git sc/source/ui/inc/miscdlgs.hrc sc/source/ui/inc/miscdlgs.hrc
+index 0c35e7e..5fae557 100644
+--- sc/source/ui/inc/miscdlgs.hrc
++++ sc/source/ui/inc/miscdlgs.hrc
+@@ -184,3 +184,9 @@
+ #define BTN_GROUP_ROWS	3
+ #define STR_GROUP		1
+ #define STR_UNGROUP		2
++
++// Tab Bg Color
++#define TAB_BG_COLOR_CT_BORDER 1
++#define TAB_BG_COLOR_SET_BGDCOLOR 2
++#define TAB_BG_COLOR_GB_BGDCOLOR 3
++#define TAB_BG_COLOR_BTN_MORE 4
+diff --git sc/source/ui/inc/tabbgcolordlg.hxx sc/source/ui/inc/tabbgcolordlg.hxx
+new file mode 100644
+index 0000000..c302365
+--- /dev/null
++++ sc/source/ui/inc/tabbgcolordlg.hxx
+@@ -0,0 +1,76 @@
++/*************************************************************************
++ *
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ * 
++ * Copyright 2008 by Sun Microsystems, Inc.
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile: tabbgcolordlg.hxx,v $
++ * $Revision: 1.0 $
++ *
++ * This file is part of OpenOffice.org.
++ *
++ * OpenOffice.org is free software: you can redistribute it and/or modify
++ * it under the terms of the GNU Lesser General Public License version 3
++ * only, as published by the Free Software Foundation.
++ *
++ * OpenOffice.org is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU Lesser General Public License version 3 for more details
++ * (a copy is included in the LICENSE file that accompanied this code).
++ *
++ * You should have received a copy of the GNU Lesser General Public License
++ * version 3 along with OpenOffice.org.  If not, see
++ * <http://www.openoffice.org/license.html>
++ * for a copy of the LGPLv3 License.
++ *
++ ************************************************************************/
++
++#ifndef SC_TABBGCOLORDLG_HXX
++#define SC_TABBGCOLORDLG_HXX
++
++
++#include <vcl/dialog.hxx>
++#include <vcl/floatwin.hxx>
++#include <vcl/fixed.hxx>
++#include <vcl/imagebtn.hxx>
++#include <vcl/edit.hxx>
++
++#include <svtools/valueset.hxx>
++
++//------------------------------------------------------------------------
++
++class ScTabBgColorDlg : public ModalDialog
++{
++public:
++        ScTabBgColorDlg(    Window* pParent,
++                            const String& rTitle,
++                            const String& rTabBgColorNoColorText,
++                            const String& rNoTabBgColorText,
++                            const Color& rDefaultColor,
++                            ULONG nHelpId );
++        ~ScTabBgColorDlg();
++
++        void GetSelectedColor( Color& rColor ) const;
++private:
++        Control             aBorderWin;
++        ValueSet            aTabBgColorSet;
++        FixedLine           aTabBgColorBox;
++        PushButton          aTabBgColorMore;
++        OKButton            aBtnOk;
++        CancelButton        aBtnCancel;
++        HelpButton          aBtnHelp;
++        const String        aTabBgColorNoColorText;
++        const String        aTabBgColorMoreText;
++        Color               aTabBgColor;
++        ULONG               aHelpId;
++
++        void            FillColorValueSets_Impl();
++
++        DECL_LINK( TabBgColorSetHdl_Impl, ValueSet* );
++        DECL_LINK( TabBgColorMoreHdl_Impl, PushButton* pBtn );
++};
++
++#endif // SC_TABBGCOLORDLG_HXX
 diff --git sc/source/ui/inc/undotab.hxx sc/source/ui/inc/undotab.hxx
 index c2d4eb9..af05ade 100644
 --- sc/source/ui/inc/undotab.hxx
@@ -525,15 +766,15 @@
  class ScUndoMakeScenario: public ScSimpleUndo
  {
 diff --git sc/source/ui/inc/viewdata.hxx sc/source/ui/inc/viewdata.hxx
-index afc4b75..17e3148 100644
+index afc4b75..27e6821 100644
 --- sc/source/ui/inc/viewdata.hxx
 +++ sc/source/ui/inc/viewdata.hxx
 @@ -153,6 +153,9 @@ private:
  
  	BOOL			bOldCurValid;				// "virtuelle" Cursorpos. bei zusammengefassten
  
-+    BOOL            bIsDefaultTabBgColor;
 +    Color           aTabBgColor;
++    BOOL            IsDefaultTabBgColor() const {return aTabBgColor == Color( COL_AUTO ) ? TRUE : FALSE ;};
 +
  					ScViewDataTable();
  					~ScViewDataTable();
@@ -562,8 +803,260 @@
  	void			InsertTableLink( const String& rFile,
  										const String& rFilter, const String& rOptions,
  										const String& rTabName );
+diff --git sc/source/ui/miscdlgs/makefile.mk sc/source/ui/miscdlgs/makefile.mk
+index 8fe1d6d..dc19c05 100644
+--- sc/source/ui/miscdlgs/makefile.mk
++++ sc/source/ui/miscdlgs/makefile.mk
+@@ -51,6 +51,7 @@ SLOFILES =  \
+ 	$(SLO)$/delcodlg.obj		\
+ 	$(SLO)$/inscodlg.obj		\
+ 	$(SLO)$/strindlg.obj		\
++    $(SLO)$/tabbgcolordlg.obj   \
+ 	$(SLO)$/mtrindlg.obj		\
+ 	$(SLO)$/lbseldlg.obj		\
+ 	$(SLO)$/filldlg.obj			\
+diff --git sc/source/ui/miscdlgs/tabbgcolordlg.cxx sc/source/ui/miscdlgs/tabbgcolordlg.cxx
+new file mode 100644
+index 0000000..cc3ea40
+--- /dev/null
++++ sc/source/ui/miscdlgs/tabbgcolordlg.cxx
+@@ -0,0 +1,234 @@
++/*************************************************************************
++ *
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ * 
++ * Copyright 2008 by Sun Microsystems, Inc.
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile: tabbgcolordlg.cxx,v $
++ * $Revision: 1.0 $
++ *
++ * This file is part of OpenOffice.org.
++ *
++ * OpenOffice.org is free software: you can redistribute it and/or modify
++ * it under the terms of the GNU Lesser General Public License version 3
++ * only, as published by the Free Software Foundation.
++ *
++ * OpenOffice.org is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU Lesser General Public License version 3 for more details
++ * (a copy is included in the LICENSE file that accompanied this code).
++ *
++ * You should have received a copy of the GNU Lesser General Public License
++ * version 3 along with OpenOffice.org.  If not, see
++ * <http://www.openoffice.org/license.html>
++ * for a copy of the LGPLv3 License.
++ *
++ ************************************************************************/
++
++// MARKER(update_precomp.py): autogen include statement, do not remove
++#include "precompiled_sc.hxx"
++
++#undef SC_DLLIMPLEMENTATION
++
++//------------------------------------------------------------------
++
++#include <tools/debug.hxx>
++#include <tools/color.hxx>
++
++/// needed for color controls
++
++#include <sfx2/objsh.hxx>
++#include <svx/xtable.hxx>
++#include <svx/drawitem.hxx>
++#include <svtools/pathoptions.hxx>
++
++/// needed for the more button
++#include <vcl/button.hxx>
++/// needed for svcolordialog
++#include <svtools/colrdlg.hxx>
++#include <vcl/msgbox.hxx>
++
++#include <vcl/svapp.hxx>
++//#include <vcl/svdata.hxx>
++//#include <vcl/svdata.hxx>
++//#include <tools/resid.hxx>
++//#include <vcl/stdtext.hxx>
++//#include <vcl/svids.hrc>
++///
++
++/// needed for something...
++#include "tabbgcolordlg.hxx"
++#include "scresid.hxx"
++#include "miscdlgs.hrc"
++
++#include <svx/dialogs.hrc>
++
++#include <svx/svxitems.hrc>
++
++//==================================================================
++
++#define HDL(hdl) LINK(this,ScTabBgColorDlg,hdl)
++
++__EXPORT ScTabBgColorDlg::ScTabBgColorDlg( Window*         pParent,
++                                    const String&   rTitle,
++                                    const String&   rTabBgColorNoColorText,
++                                    const String&   rTabBgColorMoreText,
++                                    const Color&    rDefaultColor,
++                                    ULONG nHelpId ) :
++    ModalDialog    ( pParent, ScResId( RID_SCDLG_TAB_BG_COLOR ) ),
++    aBorderWin              ( this, ScResId( TAB_BG_COLOR_CT_BORDER ) ),
++    aTabBgColorSet          ( &aBorderWin, ScResId( TAB_BG_COLOR_SET_BGDCOLOR ) ),
++    aTabBgColorBox          ( this, ScResId( TAB_BG_COLOR_GB_BGDCOLOR ) ),
++    aTabBgColorMore         ( this, ScResId( TAB_BG_COLOR_BTN_MORE ) ),
++    aBtnOk                  ( this, ScResId( BTN_OK ) ),
++    aBtnCancel              ( this, ScResId( BTN_CANCEL ) ),
++    aBtnHelp                ( this, ScResId( BTN_HELP ) ),
++    aTabBgColorNoColorText  ( rTabBgColorNoColorText ),
++    aTabBgColorMoreText     ( rTabBgColorMoreText ),
++    aTabBgColor             ( rDefaultColor ),
++    aHelpId                 ( nHelpId )
++
++{
++    SetHelpId( nHelpId );
++    this->SetText( rTitle );
++    this->SetStyle(GetStyle() | WB_BORDER | WB_STDFLOATWIN | WB_3DLOOK | WB_DIALOGCONTROL | WB_SYSTEMWINDOW | WB_STANDALONE | WB_HIDE);
++    //TODO: Assign Help ID's to all controls...
++    aTabBgColorBox.SetText(rTitle);
++    WinBits nBits = ( aTabBgColorMore.GetStyle() | WB_3DLOOK | WB_CENTER | WB_VCENTER );
++    aTabBgColorMore.SetText( aTabBgColorMoreText ); 
++    aTabBgColorMore.SetStyle( nBits );
++    FillColorValueSets_Impl();
++    aTabBgColorSet.SetSelectHdl( HDL(TabBgColorSetHdl_Impl) );
++    aTabBgColorMore.SetClickHdl( HDL(TabBgColorMoreHdl_Impl) );
++    FreeResource();
++}
++
++//------------------------------------------------------------------------
++
++void ScTabBgColorDlg::GetSelectedColor( Color& rColor ) const
++{
++    rColor = aTabBgColor;
++}
++
++__EXPORT ScTabBgColorDlg::~ScTabBgColorDlg()
++{
++}
++
++void ScTabBgColorDlg::FillColorValueSets_Impl()
++{
++    SfxObjectShell* pDocSh = SfxObjectShell::Current();
++    const SfxPoolItem* pItem = NULL;
++    XColorTable* pColorTable = NULL;
++    const Size aSize15x15 = Size( 15, 15 );
++    FASTBOOL bOwn = FALSE;
++
++    DBG_ASSERT( pDocSh, "DocShell not found!" );
++
++    if ( pDocSh && ( 0 != ( pItem = pDocSh->GetItem( SID_COLOR_TABLE ) ) ) )
++        pColorTable = ( (SvxColorTableItem*)pItem )->GetColorTable();
++    if ( !pColorTable )
++    {
++        bOwn = TRUE;
++        pColorTable = new XColorTable( SvtPathOptions().GetPalettePath() );
++    }
++    if ( pColorTable )
++    {
++        short i = 0;
++        long nCount = pColorTable->Count();
++        XColorEntry* pEntry = NULL;
++        Color aColWhite( COL_WHITE );
++        String aStrWhite( ScResId( RID_SVXITEMS_COLOR_WHITE ) );
++        WinBits nBits = ( aTabBgColorSet.GetStyle() | WB_NAMEFIELD | WB_ITEMBORDER | WB_NONEFIELD | WB_3DLOOK | WB_NO_DIRECTSELECT ); //removed WB_NAMEFIELD...
++        aTabBgColorSet.SetText( aTabBgColorNoColorText );
++        aTabBgColorSet.SetStyle( nBits );
++        aTabBgColorSet.SelectItem(0);
++
++        for ( i = 0; i < nCount; i++ )
++        {
++            pEntry = pColorTable->GetColor(i);
++            aTabBgColorSet.InsertItem( i + 1, pEntry->GetColor(), pEntry->GetName() );
++            if (pEntry->GetColor() == aTabBgColor)
++                aTabBgColorSet.SelectItem(i + 1);
++        }
++
++        while ( i < 80 )
++        {
++            aTabBgColorSet.InsertItem( i + 1, aColWhite, aStrWhite );
++            i++;
++        }
++
++        if ( nCount > 80 )
++        {
++            aTabBgColorSet.SetStyle( nBits | WB_VSCROLL );
++        }
++    }
++    if ( bOwn )
++        delete pColorTable;
++    aTabBgColorSet.SetColCount( 10 );
++    aTabBgColorSet.SetLineCount( 10 );
++    aTabBgColorSet.CalcWindowSizePixel( aSize15x15 );
++    aTabBgColorSet.StartSelection();
++}
++IMPL_LINK( ScTabBgColorDlg, TabBgColorSetHdl_Impl, ValueSet*, EMPTYARG )
++/*
++    Handler, called when color selection is changed
++*/
++{
++    USHORT nItemId = aTabBgColorSet.GetSelectItemId();
++    Color aColor = nItemId ? ( aTabBgColorSet.GetItemColor( nItemId ) ) : Color( COL_AUTO );
++    aTabBgColor = aColor;
++    EndDialog( TRUE );
++    return 0;
++}
++
++IMPL_LINK( ScTabBgColorDlg, TabBgColorMoreHdl_Impl, PushButton*, EMPTYARG )
++/*
++    Handler, called when the more button is pushed
++*/
++{
++    USHORT      nRet    = RET_OK;
++    BOOL bOwn = FALSE;
++    BOOL bInColorTable = FALSE;
++    SfxObjectShell* pDocSh = SfxObjectShell::Current();
++    const SfxPoolItem* pItem = NULL;
++    XColorTable* pColorTable = NULL;
++    XColorEntry* pEntry = NULL;
++
++    SvColorDialog* pColorDlg = new SvColorDialog( this );
++    pColorDlg->SetColor( aTabBgColor );
++    nRet = pColorDlg->Execute();
++    if( nRet == RET_OK )
++    {
++        aTabBgColor = pColorDlg->GetColor();
++        if ( pDocSh && ( 0 != ( pItem = pDocSh->GetItem( SID_COLOR_TABLE ) ) ) )
++            pColorTable = ( (SvxColorTableItem*)pItem )->GetColorTable();
++        if ( !pColorTable )
++        {
++            bOwn = TRUE;
++            pColorTable = new XColorTable( SvtPathOptions().GetPalettePath() );
++        }
++        if ( pColorTable )
++        {
++            short i = 0;
++            long nCount = pColorTable->Count();
++            for ( i = 0; i < nCount; i++ )
++            {
++                pEntry = pColorTable->GetColor(i);
++                if (pEntry->GetColor() == aTabBgColor){
++                    bInColorTable = TRUE;
++                    break;
++                }
++            }
++        }
++        if (!bInColorTable)
++        {
++            XColorEntry* pNewEntry = new XColorEntry(aTabBgColor, String::CreateFromAscii(""));
++            pColorTable->Insert( (pColorTable->Count()+1), pNewEntry );
++        }
++        EndDialog( TRUE );
++    }
++    return 0;
++}
 diff --git sc/source/ui/src/globstr.src sc/source/ui/src/globstr.src
-index 6912e7a..77793d8 100644
+index 6912e7a..bf4a147 100644
 --- sc/source/ui/src/globstr.src
 +++ sc/source/ui/src/globstr.src
 @@ -1134,6 +1134,10 @@ Resource RID_GLOBSTR
@@ -572,45 +1065,119 @@
  	};
 +    String STR_UNDO_SET_TAB_BG_COLOR
 +    {
-+        Text [ en-US ] = "Set Tab Color" ;
++        Text [ en-US ] = "Tab Color" ;
 +    };
  	String STR_UNDO_MOVE_TAB
  	{
  		Text [ en-US ] = "Move Sheets" ;
+diff --git sc/source/ui/src/miscdlgs.src sc/source/ui/src/miscdlgs.src
+index fce9761..67ff9ec 100644
+--- sc/source/ui/src/miscdlgs.src
++++ sc/source/ui/src/miscdlgs.src
+@@ -546,6 +546,58 @@ ModalDialog RID_SCDLG_STRINPUT
+         Size = MAP_APPFONT ( 110 , 8 ) ;
+ 	};
+ };
++ModalDialog RID_SCDLG_TAB_BG_COLOR
++{
++    OutputSize = TRUE ;
++    SVLook = TRUE ;
++    Size = MAP_APPFONT ( 180 , 170 ) ;
++    Moveable = TRUE ;
++    Closeable = TRUE ;
++    Control TAB_BG_COLOR_CT_BORDER
++    {
++        Border = TRUE ;
++        Pos = MAP_APPFONT ( 1 , 1 ) ; //12, 32
++        Size = MAP_APPFONT ( 116+2 , 145+2 ) ;
++        DialogControl = TRUE;
++    };
++    Control TAB_BG_COLOR_SET_BGDCOLOR
++    {
++        /*HelpId = HID_BACKGROUND_CTL_BGDCOLORSET ;*/
++        Hide = FALSE ;
++        Pos = MAP_APPFONT ( 0 , 0 ) ;
++        Size = MAP_APPFONT ( 116 , 145 ) ;
++        TabStop = TRUE ;
++    };
++    PushButton TAB_BG_COLOR_BTN_MORE
++    {
++        Pos = MAP_APPFONT ( 34, 152 ) ;
++        Size = MAP_APPFONT ( 50 , 15 ) ;
++        //Text =  SCSTR_TAB_BG_COLOR_MORE;
++        TabStop = TRUE ;
++        DefButton = FALSE ;
++    };
++    OKButton BTN_OK
++    {
++        Pos = MAP_APPFONT ( 125 , 50 ) ;
++        Size = MAP_APPFONT ( 50 , 14 ) ;
++        TabStop = TRUE ;
++        DefButton = TRUE ;
++    };
++    CancelButton BTN_CANCEL
++    {
++        Pos = MAP_APPFONT ( 125 , 67 ) ;
++        Size = MAP_APPFONT ( 50 , 14 ) ;
++        TabStop = TRUE ;
++        DefButton = FALSE ;
++    };
++    HelpButton BTN_HELP
++    {
++        Pos = MAP_APPFONT ( 125 , 84 ) ;
++        Size = MAP_APPFONT ( 50 , 14 ) ;
++        TabStop = TRUE ;
++        DefButton = FALSE ;
++    };
++};
+ /*
+ ModalDialog RID_SCDLG_MTRINPUT
+ {
 diff --git sc/source/ui/src/popup.src sc/source/ui/src/popup.src
-index 25cd641..9e6fd0c 100644
+index 25cd641..6f23024 100644
 --- sc/source/ui/src/popup.src
 +++ sc/source/ui/src/popup.src
-@@ -169,6 +169,12 @@ Menu RID_POPUP_TAB
- 			HelpId = FID_TAB_MENU_RENAME ;
- 			Text [ en-US ] = "~Rename Sheet..." ;
+@@ -187,6 +187,15 @@ Menu RID_POPUP_TAB
+ 			HelpId = FID_TAB_RTL ;
+ 			Text [ en-US ] = "S~heet Right-To-Left" ;
  		};
++        //------------------------------
++        MenuItem { Separator = TRUE ; };
++        //------------------------------
 +        MenuItem
 +        {
 +            Identifier = FID_TAB_MENU_SET_TAB_BG_COLOR ;
 +            HelpId = FID_TAB_MENU_SET_TAB_BG_COLOR ;
-+            Text [ en-US ] = "Set Tab ~Color..." ;
++            Text [ en-US ] = "~Tab Color..." ;
 +        };
- 		MenuItem
- 		{
- 			Identifier = FID_TAB_MOVE ;
+ 	};
+ };
+ 
 diff --git sc/source/ui/src/scstring.src sc/source/ui/src/scstring.src
-index ed03d74..19f9087 100644
+index ed03d74..a9e9f4b 100644
 --- sc/source/ui/src/scstring.src
 +++ sc/source/ui/src/scstring.src
-@@ -283,6 +283,10 @@ String SCSTR_RENAMETAB
+@@ -283,6 +283,18 @@ String SCSTR_RENAMETAB
  {
  	Text [ en-US ] = "Rename Sheet" ;
  };
 +String SCSTR_SET_TAB_BG_COLOR
 +{
-+    Text [ en-US ] = "Set Tab Color" ;
++    Text [ en-US ] = "Tab Color" ;
++};
++String SCSTR_NO_TAB_BG_COLOR
++{
++    Text [ en-US ] = "No Tab Color" ;
++};
++String SCSTR_TAB_BG_COLOR_MORE
++{
++    Text [ en-US ] = "~More" ;
 +};
  String SCSTR_RENAMEOBJECT
  {
  	Text [ en-US ] = "Name Object";
 diff --git sc/source/ui/undo/undotab.cxx sc/source/ui/undo/undotab.cxx
-index df3ab6f..b185d9a 100644
+index df3ab6f..bf389d2 100644
 --- sc/source/ui/undo/undotab.cxx
 +++ sc/source/ui/undo/undotab.cxx
 @@ -70,6 +70,9 @@
@@ -631,7 +1198,7 @@
  
  
  // -----------------------------------------------------------------------
-@@ -779,6 +783,73 @@ BOOL ScUndoCopyTab::CanRepeat(SfxRepeatTarget& /* rTarget */) const
+@@ -779,6 +783,68 @@ BOOL ScUndoCopyTab::CanRepeat(SfxRepeatTarget& /* rTarget */) const
  	return FALSE;
  }
  
@@ -641,16 +1208,12 @@
 +//
 +
 +ScUndoSetTabBgColor::ScUndoSetTabBgColor( ScDocShell* pNewDocShell,
-+                                    SCTAB nT,
-+//                                      const BOOL& bOIsDefaultTabBgColor, 
-+//                                      const BOOL& bNIsDefaultTabBgColor,
-+                                        const Color& aOTabBgColor, 
++                                        SCTAB nT,
++                                        const Color& aOTabBgColor,
 +                                        const Color& aNTabBgColor) :
 +    ScSimpleUndo( pNewDocShell ),
 +    nTab 	 ( nT )
 +{
-+//  bOldIsDefaultTabBgColor = bOIsDefaultTabBgColor;
-+//  bNewIsDefaultTabBgColor = bNIsDefaultTabBgColor;
 +    aOldTabBgColor = aOTabBgColor;
 +    aNewTabBgColor = aNTabBgColor;
 +}
@@ -672,9 +1235,8 @@
 +        ScViewData* pViewData = pViewShell->GetViewData();
 +        if (pViewData)
 +        {
-+            pViewData->SetTabNo(nTabP);
 +            pViewData->SetTabBgColor( rTabBgColor, nTabP );
-+            SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );	// Navigator
++            SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );
 +            pDocShell->PostPaintGridAll();
 +            pDocShell->PostPaintExtras();
 +            pDocShell->PostDataChanged();
@@ -706,22 +1268,21 @@
  // -----------------------------------------------------------------------
  //
 diff --git sc/source/ui/view/scextopt.cxx sc/source/ui/view/scextopt.cxx
-index 3ab9e7b..fb7162f 100644
+index 3ab9e7b..8ca5fc2 100644
 --- sc/source/ui/view/scextopt.cxx
 +++ sc/source/ui/view/scextopt.cxx
-@@ -62,7 +62,9 @@ ScExtTabSettings::ScExtTabSettings() :
+@@ -62,7 +62,8 @@ ScExtTabSettings::ScExtTabSettings() :
      mbSelected( false ),
      mbFrozenPanes( false ),
      mbPageMode( false ),
 -    mbShowGrid( true )
 +    mbShowGrid( true ),
-+    mbIsDefaultTabBgColor( true ),
 +    maTabBgColor( COL_AUTO)
  {
  }
  
 diff --git sc/source/ui/view/tabcont.cxx sc/source/ui/view/tabcont.cxx
-index 5117f2b..30c7dcb 100644
+index 5117f2b..c601ef3 100644
 --- sc/source/ui/view/tabcont.cxx
 +++ sc/source/ui/view/tabcont.cxx
 @@ -68,6 +68,7 @@ ScTabControl::ScTabControl( Window* pParent, ScViewData* pData ) :
@@ -736,11 +1297,11 @@
  					InsertPage( static_cast<sal_uInt16>(i)+1, aString, TPB_SPECIAL );
  				else
  					InsertPage( static_cast<sal_uInt16>(i)+1, aString );
-+
 +                if ( !pViewData->IsDefaultTabBgColor(i) )
 +                {
 +                    aTabBgColor = pViewData->GetTabBgColor(i);
-+                    SetTabBgColor(static_cast<sal_uInt16>(i)+1, aTabBgColor, pViewData->IsDefaultTabBgColor(i) );
++                    /*SetTabBgColor(static_cast<sal_uInt16>(i)+1, aTabBgColor, pViewData->IsDefaultTabBgColor(i) );*/
++                    SetTabBgColor( static_cast<sal_uInt16>(i)+1, aTabBgColor );
 +                }
  			}
  		}
@@ -784,37 +1345,43 @@
 +                    if ( !pViewData->IsDefaultTabBgColor(i) )
 +                    {
 +                        aTabBgColor = pViewData->GetTabBgColor(i);
-+                        SetTabBgColor(static_cast<sal_uInt16>(i)+1, aTabBgColor, pViewData->IsDefaultTabBgColor(i));
++                        SetTabBgColor( static_cast<sal_uInt16>(i)+1, aTabBgColor );
 +                    }
  				}
  			}
  		}
 diff --git sc/source/ui/view/tabvwshf.cxx sc/source/ui/view/tabvwshf.cxx
-index 6987883..9f2f15b 100644
+index 6987883..dce02b8 100644
 --- sc/source/ui/view/tabvwshf.cxx
 +++ sc/source/ui/view/tabvwshf.cxx
-@@ -60,6 +60,13 @@
+@@ -60,6 +60,20 @@
  
  #include "scabstdlg.hxx" //CHINA001
  
++//TODO CLEANUP ADDED INCLUDES!!
++//#include <vcl/floatwin.hxx>
++#include "tabbgcolordlg.hxx" //DBW
++
 +// TabBgColor -----------------------------------------------------------------
 +//TODO Clean up includes...
 +#include <svtools/colrdlg.hxx>
 +#include <svx/svxdlg.hxx>
 +#include <svx/colritem.hxx>
++#include <svx/brshitem.hxx>
++#include <svx/tbcontrl.hxx>
++
 +// TabBgColor -----------------------------------------------------------------
 +
  #define IS_AVAILABLE(WhichId,ppItem) \
      (pReqArgs->GetItemState((WhichId), TRUE, ppItem ) == SFX_ITEM_SET)
  
-@@ -699,10 +706,111 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
-             }
-             break;
- 
--		default:
--			DBG_ERROR("Unbekannte Message bei ViewShell");
--			break;
--	}
+@@ -696,17 +710,127 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
+                 rBindings.Invalidate( FID_TAB_TOGGLE_GRID );
+                 PaintGrid();
+                 rReq.Done();
++			}
++			break;
++
 +        case FID_TAB_SET_TAB_BG_COLOR:
 +        case FID_TAB_MENU_SET_TAB_BG_COLOR:
 +            {
@@ -828,7 +1395,7 @@
 +                if ( !pDoc->IsDocEditable() )
 +                    break;
 +
-+                if ( pDoc->IsTabProtected( nTabNr ) || nTabSelCount > 1 )
++                if ( pDoc->IsTabProtected( nTabNr ) ) // ||nTabSelCount > 1
 +                    break;
 +
 +                if( pReqArgs != NULL )
@@ -836,15 +1403,28 @@
 +                    BOOL                bDone = FALSE;
 +                    const SfxPoolItem*  pItem;
 +                    Color               aColor;
-+
 +                    if( IS_AVAILABLE( FN_PARAM_1, &pItem ) )
 +                        nTabNr = ((const SfxUInt16Item*)pItem)->GetValue();
 +
 +                    if( IS_AVAILABLE( nSlot, &pItem ) )
 +                        aColor = ((const SvxColorItem*)pItem)->GetValue();
 +
-+                    bDone = SetTabBgColor( aColor, nTabNr ); //ScViewFunc.SetTabBgColor
-+
++                    if ( nTabSelCount > 1 )
++                    {
++                        for (SCTAB nTab=0; nTab<nTabCount; nTab++)
++                        {
++                            if ( rMark.GetTableSelect(nTab) )
++                            {
++                                bDone = SetTabBgColor( aColor, nTab );
++                                if (!bDone)
++                                    break;
++                            }
++                        }
++                    }
++                    else
++                    {
++                        bDone = SetTabBgColor( aColor, nCurrentTab ); //ScViewFunc.SetTabBgColor
++                    }
 +                    if( bDone )
 +                    {
 +                        rReq.Done( *pReqArgs );
@@ -852,27 +1432,42 @@
 +                }
 +                else
 +                {
-+                    USHORT      nRet    = RET_OK;
-+                    BOOL        bDone   = FALSE;
-+                    //TODO Use real dialog, but use this one in the meantime...
-+                    //TODO Create Resource...
-+                    String        aErrMsg = String::CreateFromAscii("Error selecting the color...");
-+                    Color        aTabBgColor;
-+                    String        aDlgTitle;
-+
-+                    aDlgTitle = String(ScResId(SCSTR_SET_TAB_BG_COLOR));
-+                    aTabBgColor = pViewData->GetTabBgColor( pViewData->GetTabNo() );
-+
-+                    SvColorDialog* pColorDlg = new SvColorDialog( GetDialogParent() );
-+                            pColorDlg->SetColor( aTabBgColor );
++                    USHORT      nRet    = RET_OK; /// temp
++                    BOOL        bDone   = FALSE; /// temp
++                    //TODO Create Error string Resource...
++                    String      aErrMsg = String::CreateFromAscii("Error selecting the color...");
++                    Color       aTabBgColor;
++                    Color       aNewTabBgColor;
++
++                    aTabBgColor = pViewData->GetTabBgColor( nCurrentTab );
++
++                    ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
++                    DBG_ASSERT(pFact, "ScAbstractFactory create fail!");
++
++                    AbstractScTabBgColorDlg* pDlg = pFact->CreateScTabBgColorDlg(
++                                                                GetDialogParent(),
++                                                                String(ScResId(SCSTR_SET_TAB_BG_COLOR)),
++                                                                String(ScResId(SCSTR_NO_TAB_BG_COLOR)),
++                                                                String(ScResId(SCSTR_TAB_BG_COLOR_MORE)),
++                                                                aTabBgColor,
++                                                                nSlot,RID_SCDLG_TAB_BG_COLOR);
 +
 +                    while ( !bDone && nRet == RET_OK )
 +                    {
-+                        nRet = pColorDlg->Execute();
++                        nRet = pDlg->Execute();
 +                        if( nRet == RET_OK )
 +                        {
-+                            Color aSelectedColor = pColorDlg->GetColor();
-+                            bDone = SetTabBgColor( aSelectedColor, nTabNr );
++                            Color aSelectedColor;
++                            pDlg->GetSelectedColor(aSelectedColor);
++                            for  (SCTAB nTab=0; nTab<nTabCount; nTab++)
++                            {
++                                if ( rMark.GetTableSelect(nTab) )
++                                {
++                                    bDone = SetTabBgColor( aSelectedColor, nTab );
++                                    if (!bDone)
++                                        break;
++                                }
++                            }
 +                            if ( bDone )
 +                            {
 +                                rReq.AppendItem( SvxColorItem( aTabBgColor, nSlot ) );
@@ -886,36 +1481,22 @@
 +                                }
 +                                else
 +                                {
-+                                    nRet = ErrorBox( GetDialogParent(),
-+                                                        WinBits( WB_OK | WB_DEF_OK ),
-+                                                        aErrMsg
-+                                                    ).Execute();
++                                    nRet = ErrorBox(GetDialogParent(),
++                                                    WinBits( WB_OK | WB_DEF_OK ),
++                                                    aErrMsg).Execute();
 +                                }
 +                            }
 +                        }
 +                    }
-+                    delete( pColorDlg );
++                    delete( pDlg );
 +                }
-+                /*DBW
-+                SvColorDialog* pColorDlg = new SvColorDialog( GetDialogParent() );
-+                            pColorDlg->SetColor( aTabBgColor );
-+
-+                            while ( !bDone && nRet == RET_OK )
-+                            {
-+                                nRet = pColorDlg->Execute();
-+                                if( nRet == RET_OK )
-+                                {
-+                                    Color aSelectedColor = pColorDlg->GetColor();
-+                                    SetTabBgColor( aSelectedColor, nTabNr );
-+                                    bDone = TRUE;
-+                                }
-+                            }
-+                            delete( pColorDlg );
-+                */
-+
-+            }
-+            break;
-+
+             }
+             break;
+ 
+-		default:
+-			DBG_ERROR("Unbekannte Message bei ViewShell");
+-			break;
+-	}
 +        default:
 +            DBG_ERROR("Unbekannte Message bei ViewShell");
 +            break;
@@ -923,7 +1504,11 @@
  }
  
  //------------------------------------------------------------------
-@@ -821,6 +929,22 @@ void ScTabViewShell::GetStateTable( SfxItemSet& rSet )
+-
+ void ScTabViewShell::GetStateTable( SfxItemSet& rSet )
+ {
+ 	ScViewData* pViewData	= GetViewData();
+@@ -821,6 +945,22 @@ void ScTabViewShell::GetStateTable( SfxItemSet& rSet )
              case FID_TAB_TOGGLE_GRID:
                  rSet.Put( SfxBoolItem(nWhich, pViewData->GetShowGrid()) );
                  break;
@@ -931,7 +1516,7 @@
 +            case FID_TAB_MENU_SET_TAB_BG_COLOR:
 +                {
 +                    if ( !pDoc->IsDocEditable() ||
-+                            pDoc->IsTabProtected(nTab) ||nTabSelCount > 1 ||
++                            pDoc->IsTabProtected(nTab) || 
 +                            ( pDocShell && pDocShell->IsDocShared() ) )
 +                        rSet.DisableItem( nWhich );
 +                    break;
@@ -947,34 +1532,34 @@
  		nWhich = aIter.NextWhich();
  	}
 diff --git sc/source/ui/view/viewdata.cxx sc/source/ui/view/viewdata.cxx
-index bba31fc..22526b2 100644
+index bba31fc..bfad0ba 100644
 --- sc/source/ui/view/viewdata.cxx
 +++ sc/source/ui/view/viewdata.cxx
-@@ -105,7 +105,9 @@ ScViewDataTable::ScViewDataTable() :
+@@ -105,7 +105,8 @@ ScViewDataTable::ScViewDataTable() :
  				nCurX( 0 ),
  				nCurY( 0 ),
                  bShowGrid( true ),
 -                bOldCurValid( FALSE )
 +                bOldCurValid( FALSE ),
-+                bIsDefaultTabBgColor( TRUE ),
 +                aTabBgColor( Color(COL_AUTO) )
  {
  	nPosX[0]=nPosX[1]=0;
  	nPosY[0]=nPosY[1]=0;
-@@ -168,6 +170,12 @@ void ScViewDataTable::WriteUserDataSequence(uno::Sequence <beans::PropertyValue>
+@@ -168,6 +169,13 @@ void ScViewDataTable::WriteUserDataSequence(uno::Sequence <beans::PropertyValue>
          pSettings[SC_TABLE_SHOWGRID].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNO_SHOWGRID));
          pSettings[SC_TABLE_SHOWGRID].Value <<= static_cast<sal_Bool>(bShowGrid);
  
-+        if (!bIsDefaultTabBgColor)
++        if ( !IsDefaultTabBgColor() )
 +        {
 +            pSettings[SC_TABLE_TAB_BG_COLOR].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNO_TABCOLOR));
 +            pSettings[SC_TABLE_TAB_BG_COLOR].Value <<= static_cast<sal_Int32>(aTabBgColor.GetColor());
 +        }
 +
++
  //        pSettings[SC_TABLE_SELECTED].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_TABLESELECTED));
  //        pSettings[SC_TABLE_SELECTED].Value <<= bool(rViewData.GetMarkData().GetTableSelect( nTab ));
  	}
-@@ -284,6 +292,16 @@ void ScViewDataTable::ReadUserDataSequence(const uno::Sequence <beans::PropertyV
+@@ -284,6 +292,13 @@ void ScViewDataTable::ReadUserDataSequence(const uno::Sequence <beans::PropertyV
              aSettings[i].Value >>= bSelected;
              rViewData.GetMarkData().SelectTable( nTab, bSelected );
          }
@@ -983,15 +1568,12 @@
 +            sal_Int32 nColor = COL_AUTO;
 +            aSettings[i].Value >>= nColor;
 +            if (nColor != COL_AUTO)
-+            {
 +                aTabBgColor.SetColor(static_cast<ColorData>(nColor));
-+                bIsDefaultTabBgColor = false;
-+            }
 +        }
  	}
  	if (eHSplitMode == SC_SPLIT_FIX)
  		nFixPosX = SanitizeCol( static_cast<SCCOL>( bHasHSplitInTwips ? nTempPosHTw : nTempPosH ));
-@@ -589,6 +607,39 @@ void ScViewData::MoveTab( SCTAB nSrcTab, SCTAB nDestTab )
+@@ -589,6 +604,36 @@ void ScViewData::MoveTab( SCTAB nSrcTab, SCTAB nDestTab )
  	aMarkData.InsertTab( nInsTab );			// ggf. angepasst
  }
  
@@ -1002,15 +1584,11 @@
 +        if ( !pTabData[nTab] )
 +            CreateTabData( nTab );
 +        pTabData[nTab]->aTabBgColor = rTabBgColor;
-+        pTabData[nTab]->bIsDefaultTabBgColor = FALSE;
 +    }
 +    else
 +    {
 +        if ( pTabData[nTab] )
-+        {
-+            pTabData[nTab]->bIsDefaultTabBgColor = TRUE;
 +            pTabData[nTab]->aTabBgColor = Color( COL_AUTO );
-+        }
 +    }
 +}
 +
@@ -1025,47 +1603,45 @@
 +{
 +    if ( !pTabData[nTab] )
 +        return true;
-+    return pTabData[nTab]->bIsDefaultTabBgColor;
++    BOOL bResult = pTabData[nTab]->aTabBgColor==Color( COL_AUTO ) ? TRUE : FALSE;
++    return bResult;
 +}
 +
  //UNUSED2008-05  void ScViewData::UpdateOle( ScSplitPos /* eWhich */ )
  //UNUSED2008-05  {
  //UNUSED2008-05      GetDocShell()->UpdateOle(this);
-@@ -2477,6 +2528,10 @@ void ScViewData::WriteExtOptions( ScExtDocOptions& rDocOpt ) const
+@@ -2477,6 +2522,9 @@ void ScViewData::WriteExtOptions( ScExtDocOptions& rDocOpt ) const
              rTabSett.mbPageMode = bPagebreak;
              rTabSett.mnNormalZoom = static_cast< long >( pViewTab->aZoomY * Fraction( 100.0 ) );
              rTabSett.mnPageZoom = static_cast< long >( pViewTab->aPageZoomY * Fraction( 100.0 ) );
 +
 +            // Tab Bg Color
-+            rTabSett.mbIsDefaultTabBgColor = pViewTab->bIsDefaultTabBgColor;
 +            rTabSett.maTabBgColor = pViewTab->aTabBgColor;
  		}
  	}
  }
-@@ -2633,6 +2688,13 @@ void ScViewData::ReadExtOptions( const ScExtDocOptions& rDocOpt )
+@@ -2633,6 +2681,10 @@ void ScViewData::ReadExtOptions( const ScExtDocOptions& rDocOpt )
                      update map modes that are needed to draw text correctly. */
                  SetPagebreakMode( rTabSett.mbPageMode );
              }
 +
 +            // Tab Bg Color
-+            if( !rTabSett.mbIsDefaultTabBgColor)
-+            {
-+                rViewTab.bIsDefaultTabBgColor = rTabSett.mbIsDefaultTabBgColor;
++            if( !rTabSett.IsDefaultTabBgColor() )
 +                rViewTab.aTabBgColor = rTabSett.maTabBgColor;
-+            }
  		}
  	}
  
 diff --git sc/source/ui/view/viewfun2.cxx sc/source/ui/view/viewfun2.cxx
-index 30f3976..b5e3c57 100644
+index 30f3976..badc96f 100644
 --- sc/source/ui/view/viewfun2.cxx
 +++ sc/source/ui/view/viewfun2.cxx
-@@ -2271,6 +2271,19 @@ BOOL ScViewFunc::RenameTable( const String& rName, SCTAB nTab )
+@@ -2271,6 +2271,20 @@ BOOL ScViewFunc::RenameTable( const String& rName, SCTAB nTab )
  
  //----------------------------------------------------------------------------
  
 +BOOL ScViewFunc::SetTabBgColor( const Color& rColor, SCTAB nTab )
 +{
++    //TODO Make sure this is passing the correct values...
 +    BOOL bSuccess = GetViewData()->GetDocShell()->GetDocFunc().SetTabBgColor( nTab, rColor, TRUE, FALSE );
 +    if (bSuccess)
 +    {
@@ -1081,14 +1657,27 @@
  									const String& rFilter, const String& rOptions,
  									const String& rSource, ULONG nRefresh )
 diff --git sc/uiconfig/scalc/menubar/menubar.xml sc/uiconfig/scalc/menubar/menubar.xml
-index 7c95dda..ed0e663 100644
+index 7c95dda..322d448 100644
 --- sc/uiconfig/scalc/menubar/menubar.xml
 +++ sc/uiconfig/scalc/menubar/menubar.xml
-@@ -211,6 +211,7 @@
-             <menu:menu menu:id=".uno:SheetMenu">
-                 <menu:menupopup>
-                     <menu:menuitem menu:id=".uno:RenameTable"/>
-+                    <menu:menuitem menu:id=".uno:SetTabBgColor"/>
+@@ -214,6 +214,8 @@
                      <menu:menuitem menu:id=".uno:Hide"/>
                      <menu:menuitem menu:id=".uno:Show"/>
                      <menu:menuitem menu:id=".uno:SheetRightToLeft"/>
++                    <menu:menuseparator/>
++                    <menu:menuitem menu:id=".uno:SetTabBgColor"/>
+                 </menu:menupopup>
+             </menu:menu>
+             <menu:menu menu:id=".uno:MergeCellsMenu">
+diff --git sc/util/makefile.mk sc/util/makefile.mk
+index 982d458..564882f 100644
+--- sc/util/makefile.mk
++++ sc/util/makefile.mk
+@@ -261,6 +261,7 @@ LIB8OBJFILES = \
+ 		$(SLO)$/attrdlg.obj	\
+ 		$(SLO)$/scuiimoptdlg.obj	\
+ 		$(SLO)$/strindlg.obj		\
++        $(SLO)$/tabbgcolordlg.obj   \
+ 		$(SLO)$/shtabdlg.obj		\
+ 		$(SLO)$/scendlg.obj		\
+ 		$(SLO)$/pvfundlg.obj	\

Modified: trunk/patches/dev300/calc-sheet-tab-color-svtools.diff
==============================================================================
--- trunk/patches/dev300/calc-sheet-tab-color-svtools.diff	(original)
+++ trunk/patches/dev300/calc-sheet-tab-color-svtools.diff	Fri Feb  6 03:30:11 2009
@@ -1,5 +1,5 @@
 diff --git svtools/inc/tabbar.hxx svtools/inc/tabbar.hxx
-index ee25537..fed6e1d 100644
+index ee25537..4b80e67 100644
 --- svtools/inc/tabbar.hxx
 +++ svtools/inc/tabbar.hxx
 @@ -430,6 +430,11 @@ public:
@@ -8,31 +8,31 @@
      void            MovePage( USHORT nPageId, USHORT nNewPos );
 +
 +    Color           GetTabBgColor( USHORT nPageId ) const;
-+    void            SetTabBgColor( USHORT nPageId, const Color& aTabBgColor, const BOOL& bIsDefaultTabBgColor );
++    void            SetTabBgColor( USHORT nPageId, const Color& aTabBgColor );
 +    BOOL            IsDefaultTabBgColor( USHORT nPageId );
 +
      void            Clear();
  
      void            EnablePage( USHORT nPageId, BOOL bEnable = TRUE );
 diff --git svtools/source/control/tabbar.cxx svtools/source/control/tabbar.cxx
-index 81795e7..9a03230 100644
+index 81795e7..66749cd 100644
 --- svtools/source/control/tabbar.cxx
 +++ svtools/source/control/tabbar.cxx
-@@ -75,6 +75,9 @@ struct ImplTabBarItem
+@@ -75,6 +75,10 @@ struct ImplTabBarItem
      BOOL            mbShort;
      BOOL            mbSelect;
      BOOL            mbEnable;
-+    BOOL            mbIsDefaultTabBgColor;
 +    Color           maTabBgColor;
++    bool            IsDefaultTabBgColor() const { return maTabBgColor == Color(COL_AUTO) ? TRUE : FALSE; };
 +    Color           maTabTextColor;
++    bool            IsDefaultTabTextColor() const { return maTabTextColor == Color(COL_AUTO) ? TRUE : FALSE; };
  
                      ImplTabBarItem( USHORT nItemId, const XubString& rText,
                                      TabBarPageBits nPageBits ) :
-@@ -87,6 +90,9 @@ struct ImplTabBarItem
+@@ -87,6 +91,8 @@ struct ImplTabBarItem
                          mbShort  = FALSE;
                          mbSelect = FALSE;
                          mbEnable = TRUE;
-+                        mbIsDefaultTabBgColor = TRUE;
 +                        maTabBgColor = Color( COL_AUTO );
 +                        maTabTextColor = Color( COL_AUTO );
                      }
@@ -43,8 +43,8 @@
      Font aFont = GetFont();
      Font aLightFont = aFont;
 -    aLightFont.SetWeight( WEIGHT_LIGHT );
-+    //aLightFont.SetWeight( WEIGHT_LIGHT );
-+	aLightFont.SetWeight( WEIGHT_NORMAL );
++    //aLightFont.SetWeight( WEIGHT_LIGHT ); //TODO Make font weight light on custom color only?
++    aLightFont.SetWeight( WEIGHT_NORMAL );
  
      // #i36013# exclude push buttons from painting area
      Rectangle aClipRect( Point( mnOffX, 0 ), Point( mnLastOffX, GetOutputHeightPixel() - 1 ) );
@@ -63,7 +63,7 @@
                  {
 -                    SetFillColor( aFaceColor );
 -                    SetTextColor( aFaceTextColor );
-+                    if ( !pItem->mbIsDefaultTabBgColor ) {
++                    if ( !pItem->IsDefaultTabBgColor() ) {
 +                        SetFillColor( pItem->maTabBgColor );
 +                        SetTextColor( pItem->maTabTextColor );
 +                    } else {
@@ -84,7 +84,7 @@
 +                if ( pItem->mbSelect || (pItem->mnId == mnCurPageId) ) {
 +                    SetLineColor( rStyleSettings.GetLightColor() );
 +                } else {
-+                    if ( !pItem->mbIsDefaultTabBgColor )
++                    if ( !pItem->IsDefaultTabBgColor() )
 +                    {
 +                        SetLineColor( pItem->maTabBgColor );
 +                    } else {
@@ -101,18 +101,20 @@
                      DrawLine( Point( aPos0.X(), aPos0.Y()+1 ),
                                  Point( aPos3.X(), aPos3.Y()+1 ) );
                  }
-@@ -1197,8 +1226,20 @@ void TabBar::Paint( const Rectangle& )
+@@ -1197,8 +1226,22 @@ void TabBar::Paint( const Rectangle& )
                  aPos1.X()--;
                  aPos1.Y()--;
                  aPos2.Y()--;
-+                if ( !pItem->mbIsDefaultTabBgColor && ( pItem->mbSelect || (pItem->mnId == mnCurPageId) ) )
++                if ( !pItem->IsDefaultTabBgColor() && ( pItem->mbSelect || (pItem->mnId == mnCurPageId) ) )
 +                {
 +                    SetLineColor( pItem->maTabBgColor );
++                    DrawLine( Point(aPos1.X()-1, aPos1.Y()-1), Point(aPos2.X(), aPos2.Y()-1) );
 +                }
                  DrawLine( aPos1, aPos2 );
  
 +                // draw a small 2px sliver of the original background color at the bottom of the selected tab
-+                if ( !pItem->mbIsDefaultTabBgColor )
++                     
++                if ( !pItem->IsDefaultTabBgColor() )
 +                {
 +                    if ( pItem->mbSelect || (pItem->mnId == mnCurPageId) ) {
 +                        SetLineColor( pItem->maTabBgColor );
@@ -122,15 +124,7 @@
                  // Da etwas uebermalt werden konnte, muessen wir die Polygon-
                  // umrandung nocheinmal ausgeben
                  SetLineColor( rStyleSettings.GetDarkShadowColor() );
-@@ -1549,6 +1590,7 @@ void TabBar::InsertPage( USHORT nPageId, const XubString& rText,
- 
-     // PageItem anlegen und in die Item-Liste eintragen
-     ImplTabBarItem* pItem = new ImplTabBarItem( nPageId, rText, nBits );
-+    
-     mpItemList->Insert( pItem, nPos );
-     mbSizeFormat = TRUE;
- 
-@@ -1565,6 +1607,46 @@ void TabBar::InsertPage( USHORT nPageId, const XubString& rText,
+@@ -1565,6 +1608,42 @@ void TabBar::InsertPage( USHORT nPageId, const XubString& rText,
  
  // -----------------------------------------------------------------------
  
@@ -141,22 +135,18 @@
 +    if ( nPos != TAB_PAGE_NOTFOUND )
 +        return mpItemList->GetObject( nPos )->maTabBgColor;
 +    else
-+        return Color( COL_AUTO ); //TODO Find a better way to report back error FIXME
++        return Color( COL_AUTO );
 +}
 +
-+void TabBar::SetTabBgColor( USHORT nPageId, const Color& aTabBgColor, 
-+                                            const BOOL& bIsDefaultTabBgColor )
++void TabBar::SetTabBgColor( USHORT nPageId, const Color& aTabBgColor )
 +{
 +    USHORT nPos = GetPagePos( nPageId );
 +    ImplTabBarItem* pItem;
 +    if ( nPos != TAB_PAGE_NOTFOUND )
 +    {
 +        pItem = mpItemList->GetObject( nPos );
-+        // TODO: Need to take the color specification out of this code!
-+        pItem->mbIsDefaultTabBgColor = bIsDefaultTabBgColor;
-+        if ( aTabBgColor == Color(COL_AUTO) )
-+            pItem->mbIsDefaultTabBgColor = TRUE;
-+        if ( !pItem->mbIsDefaultTabBgColor  )
++        // TODO: Need to take the text color specification out of this code!
++        if ( aTabBgColor != Color( COL_AUTO )  )
 +        {
 +            pItem->maTabBgColor = aTabBgColor;
 +            if ( aTabBgColor.GetLuminance() <= 128 ) //Do not use aTabBgColor.IsDark(), because that threshold is way too low...



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]