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



Author: kyoshida
Date: Wed Feb 11 04:50:13 2009
New Revision: 15317
URL: http://svn.gnome.org/viewvc/ooo-build?rev=15317&view=rev

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

	* patches/dev300/calc-sheet-tab-color-sc.diff:
	* patches/dev300/calc-sheet-tab-color-svtools.diff: add support for 
	setting color multiple tabs.


Modified:
   trunk/ChangeLog
   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-sc.diff
==============================================================================
--- trunk/patches/dev300/calc-sheet-tab-color-sc.diff	(original)
+++ trunk/patches/dev300/calc-sheet-tab-color-sc.diff	Wed Feb 11 04:50:13 2009
@@ -20,31 +20,32 @@
  #define SC_CURSORPOSITIONX					"CursorPositionX"
  #define SC_CURSORPOSITIONY					"CursorPositionY"
 diff --git sc/inc/globstr.hrc sc/inc/globstr.hrc
-index fbf7540..b824628 100644
+index fbf7540..e952afa 100644
 --- sc/inc/globstr.hrc
 +++ sc/inc/globstr.hrc
-@@ -589,8 +589,10 @@
+@@ -589,8 +589,11 @@
  #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_COUNT                   450
++
++#define STR_UNDO_SET_TAB_BG_COLOR       449
++#define STR_UNDO_SET_MULTI_TAB_BG_COLOR 450
++
++#define STR_COUNT                   451
  
  #endif
  
 diff --git sc/inc/sc.hrc sc/inc/sc.hrc
-index 2eba0d8..95590a8 100644
+index ed37f66..3771901 100644
 --- sc/inc/sc.hrc
 +++ sc/inc/sc.hrc
-@@ -1664,6 +1664,19 @@
+@@ -1667,6 +1667,16 @@
  #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)
 +
@@ -54,8 +55,6 @@
 +
 +#define RID_SCDLG_TAB_BG_COLOR          (SC_OOO_BUILD_START + 12)
 +
-+
-+
  #endif
  
  
@@ -105,18 +104,71 @@
  
      explicit            ScExtTabSettings();
  };
+diff --git sc/inc/tabbgcolor.hxx sc/inc/tabbgcolor.hxx
+new file mode 100644
+index 0000000..d9f47ed
+--- /dev/null
++++ sc/inc/tabbgcolor.hxx
+@@ -0,0 +1,46 @@
++/*************************************************************************
++ *
++ * 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: tabbgcolor.hxx,v $
++ * $Revision: 1.00 $
++ *
++ * 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_TABBGCOLOR_HXX
++#define SC_TABBGCOLOR_HXX
++
++#include <tools/color.hxx>
++#include <tools/list.hxx>
++
++struct ScUndoSetTabBgColorInfo
++{
++public:
++    SCTAB nTabId;
++    Color aOldTabBgColor;
++    Color aNewTabBgColor;
++    BOOL IsDefaultOldTabBgColor() const {return aOldTabBgColor == Color( COL_AUTO ) ? TRUE : FALSE ;};
++    BOOL IsDefaultNewTabBgColor() const {return aOldTabBgColor == Color( COL_AUTO ) ? TRUE : FALSE ;};
++};
++DECLARE_LIST( ScUndoSetTabBgColorInfoList, ScUndoSetTabBgColorInfo* )
++#endif
+\ No newline at end of file
 diff --git sc/inc/unonames.hxx sc/inc/unonames.hxx
-index 253c197..90d20ba 100644
+index 253c197..a348e69 100644
 --- sc/inc/unonames.hxx
 +++ sc/inc/unonames.hxx
-@@ -531,6 +531,7 @@
+@@ -529,6 +529,7 @@
+ #define SC_UNO_ZOOMVALUE            "ZoomValue"
+ #define SC_UNO_UPDTEMPL             "UpdateFromTemplate"
  #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..829a70b 100644
 --- sc/sdi/docsh.sdi
@@ -130,10 +182,10 @@
  	SID_TABLE_ACTIVATE	[ ExecMethod = Execute; ]
  }
 diff --git sc/sdi/scalc.sdi sc/sdi/scalc.sdi
-index 254442f..2e1ec8c 100644
+index e1df51b..430d474 100644
 --- sc/sdi/scalc.sdi
 +++ sc/sdi/scalc.sdi
-@@ -7851,6 +7851,58 @@ SfxVoidItem ShareDocument SID_SHARE_DOC
+@@ -7901,6 +7901,58 @@ SfxVoidItem ShareDocument SID_SHARE_DOC
  ]
  
  //--------------------------------------------------------------------------
@@ -193,7 +245,7 @@
  
  [
 diff --git sc/sdi/tabvwsh.sdi sc/sdi/tabvwsh.sdi
-index bd51c83..8cc0ac4 100644
+index f8346aa..13ae659 100644
 --- sc/sdi/tabvwsh.sdi
 +++ sc/sdi/tabvwsh.sdi
 @@ -60,6 +60,7 @@ interface Tables
@@ -231,18 +283,17 @@
          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..9a93776 100644
+index 1ee104c..d15634b 100644
 --- sc/source/filter/excel/xeview.cxx
 +++ sc/source/filter/excel/xeview.cxx
-@@ -259,6 +259,36 @@ void XclExpSelection::WriteBody( XclExpStream& rStrm )
+@@ -259,6 +259,35 @@ void XclExpSelection::WriteBody( XclExpStream& rStrm )
      maSelData.maXclSelection.Write( rStrm, false );
  }
  
 +// ----------------------------------------------------------------------------
 +
 +XclExpTabBgColor::XclExpTabBgColor( const XclTabViewData& rTabViewData ) :
-+//    XclExpRecord( 0x0862, 18 ), //TODO Use Real ID!
-+    XclExpRecord( EXC_ID_SHEETEXT, 18 ), //TODO Use Real ID!
++    XclExpRecord( EXC_ID_SHEETEXT, 18 ),
 +    mrTabViewData( rTabViewData )
 +{
 +}
@@ -271,7 +322,7 @@
  // Sheet view settings ========================================================
  
  namespace {
-@@ -368,6 +398,14 @@ XclExpTabViewSettings::XclExpTabViewSettings( const XclExpRoot& rRoot, SCTAB nSc
+@@ -368,6 +397,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;
@@ -286,7 +337,7 @@
      }
  }
  
-@@ -380,6 +418,7 @@ void XclExpTabViewSettings::Save( XclExpStream& rStrm )
+@@ -380,6 +417,7 @@ void XclExpTabViewSettings::Save( XclExpStream& rStrm )
      WriteSelection( rStrm, EXC_PANE_TOPRIGHT );
      WriteSelection( rStrm, EXC_PANE_BOTTOMLEFT );
      WriteSelection( rStrm, EXC_PANE_BOTTOMRIGHT );
@@ -294,7 +345,7 @@
  }
  
  static void lcl_WriteSelection( XclExpXmlStream& rStrm, const XclTabViewData& rData, sal_uInt8 nPane )
-@@ -494,5 +533,10 @@ void XclExpTabViewSettings::WriteSelection( XclExpStream& rStrm, sal_uInt8 nPane
+@@ -494,5 +532,10 @@ void XclExpTabViewSettings::WriteSelection( XclExpStream& rStrm, sal_uInt8 nPane
          XclExpSelection( maData, nPane ).Save( rStrm );
  }
  
@@ -571,10 +622,10 @@
  																	int nId,
  																	BOOL                    bAscii = TRUE,
 diff --git sc/source/ui/docshell/docfunc.cxx sc/source/ui/docshell/docfunc.cxx
-index 5da446b..3c9b947 100644
+index 5da446b..4936634 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
+@@ -2612,6 +2612,104 @@ BOOL ScDocFunc::RenameTable( SCTAB nTab, const String& rName, BOOL bRecord, BOOL
  	return bSuccess;
  }
  
@@ -584,7 +635,7 @@
 +    ScDocument* pDoc = rDocShell.GetDocument();
 +    if (bRecord && !pDoc->IsUndoEnabled())
 +        bRecord = FALSE;
-+    if ( !pDoc->IsDocEditable() )
++    if ( !pDoc->IsDocEditable() || pDoc->IsTabProtected(nTab) )
 +    {
 +        if (!bApi)
 +            rDocShell.ErrorMessage(STR_PROTECTIONERR); //TODO Check to see what this string is...
@@ -617,18 +668,87 @@
 +    return bSuccess;
 +}
 +
++BOOL ScDocFunc::SetTabBgColor( ScUndoSetTabBgColorInfoList* rUndoSetTabBgColorInfoList, BOOL bRecord, BOOL bApi )
++{
++    ScDocument* pDoc = rDocShell.GetDocument();
++    if (bRecord && !pDoc->IsUndoEnabled())
++        bRecord = FALSE;
++    if ( !pDoc->IsDocEditable() )
++    {
++        if (!bApi)
++            rDocShell.ErrorMessage(STR_PROTECTIONERR); //TODO Get a better String Error...
++        return FALSE;
++    }
++
++    ScViewData* pViewData = rDocShell.GetViewData();
++    USHORT nTab;
++    Color aNewTabBgColor;
++    ScUndoSetTabBgColorInfo* rUndoSetTabBgColorInfo;
++    BOOL bSuccess = TRUE;
++    USHORT nTabProtectCount = 0;
++    for ( USHORT i=0; i < rUndoSetTabBgColorInfoList->Count(); i++ )
++    {
++        rUndoSetTabBgColorInfo = rUndoSetTabBgColorInfoList->GetObject(i);
++        nTab = rUndoSetTabBgColorInfo->nTabId;
++        if ( !pDoc->IsTabProtected(nTab) )
++        {
++            aNewTabBgColor = rUndoSetTabBgColorInfo->aNewTabBgColor;
++            rUndoSetTabBgColorInfo->aOldTabBgColor = pViewData->GetTabBgColor(nTab);
++            pViewData->SetTabBgColor(aNewTabBgColor, nTab);
++            if ( pViewData->GetTabBgColor( nTab ) != aNewTabBgColor)
++            {
++                bSuccess = FALSE;
++                break;
++            }
++        }
++        else
++        {
++            nTabProtectCount++;
++        }
++    }
++    if ( nTabProtectCount == rUndoSetTabBgColorInfoList->Count() )
++    {
++        if (!bApi)
++            rDocShell.ErrorMessage(STR_PROTECTIONERR); //TODO Get a better String Error...
++        return FALSE;
++    }
++    if (bSuccess)
++    {
++        if (bRecord)
++        {
++            rDocShell.GetUndoManager()->AddUndoAction(
++                new ScUndoSetTabBgColor( &rDocShell, rUndoSetTabBgColorInfoList));
++        }
++        rDocShell.PostPaintExtras();
++        ScDocShellModificator aModificator( rDocShell );
++        aModificator.SetDocumentModified();
++        SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );
++    }
++    return bSuccess;
++}
++
  //------------------------------------------------------------------------
  
  //!	SetWidthOrHeight - noch doppelt zu ViewFunc !!!!!!
 diff --git sc/source/ui/inc/docfunc.hxx sc/source/ui/inc/docfunc.hxx
-index d2bbeaf..21d770d 100644
+index d2bbeaf..cf19ea2 100644
 --- sc/source/ui/inc/docfunc.hxx
 +++ sc/source/ui/inc/docfunc.hxx
-@@ -116,6 +116,8 @@ public:
+@@ -35,6 +35,7 @@
+ #include "global.hxx"
+ #include "postit.hxx"
+ #include "formula/grammar.hxx"
++#include "tabbgcolor.hxx"
+ 
+ class ScEditEngineDefaulter;
+ class SfxUndoAction;
+@@ -116,6 +117,10 @@ public:
  	BOOL			RenameTable( SCTAB nTab, const String& rName, BOOL bRecord, BOOL bApi );
  	BOOL			DeleteTable( SCTAB nTab, BOOL bRecord, BOOL bApi );
  
 +    BOOL            SetTabBgColor( SCTAB nTab, const Color& rColor, BOOL bRecord, BOOL bApi );
++    BOOL            SetTabBgColor( ScUndoSetTabBgColorInfoList* rUndoSetTabBgColorInfoList,
++                                    BOOL bRecord, BOOL bApi );
 +
  	BOOL			SetTableVisible( SCTAB nTab, BOOL bVisible, BOOL bApi );
  
@@ -649,10 +769,10 @@
 +#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..523a210
+index 0000000..ab0b704
 --- /dev/null
 +++ sc/source/ui/inc/tabbgcolordlg.hxx
-@@ -0,0 +1,77 @@
+@@ -0,0 +1,93 @@
 +/*************************************************************************
 + *
 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -686,16 +806,23 @@
 +#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 ScTabBgColorValueSet : public ValueSet
++{
++
++public:
++        ScTabBgColorValueSet(Control* pParent, const ResId& rResId, ScTabBgColorDlg* pTabBgColorDlg);
++        //~ScTabBgColorValueSet();
++
++        virtual void KeyInput( const KeyEvent& rKEvt );
++private:
++    ScTabBgColorDlg* aTabBgColorDlg;
++};*/
 +
 +class ScTabBgColorDlg : public ModalDialog
 +{
@@ -709,32 +836,49 @@
 +        ~ScTabBgColorDlg();
 +
 +        void GetSelectedColor( Color& rColor ) const;
++        //void SelectColor( const Color& rColor2 ) 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;
++    class ScTabBgColorValueSet : public ValueSet
++    {
++
++    public:
++            ScTabBgColorValueSet(Control* pParent, const ResId& rResId, ScTabBgColorDlg* pTabBgColorDlg);
++
++            virtual void KeyInput( const KeyEvent& rKEvt );
++    private:
++        ScTabBgColorDlg* aTabBgColorDlg;
++    };
++        Control                 aBorderWin;
++        ScTabBgColorValueSet    aTabBgColorSet;
++        FixedLine               aTabBgColorBox;
++        OKButton                aBtnOk;
++        CancelButton            aBtnCancel;
++        HelpButton              aBtnHelp;
++        Color                   aTabBgColor;
++        const String            aTabBgColorNoColorText;
++        const String            aTabBgColorMoreText;
++        ULONG                   aHelpId;
 +
 +        void            FillColorValueSets_Impl();
 +
-+        DECL_LINK( TabBgColorSetHdl_Impl, ValueSet* );
-+        /*DECL_LINK( TabBgColorMoreHdl_Impl, PushButton* pBtn );*/
++        DECL_LINK( TabBgColorDblClickHdl_Impl, ValueSet* );
 +        DECL_LINK( TabBgColorOKHdl_Impl, OKButton* pBtn );
 +};
 +
 +#endif // SC_TABBGCOLORDLG_HXX
 diff --git sc/source/ui/inc/undotab.hxx sc/source/ui/inc/undotab.hxx
-index c2d4eb9..af05ade 100644
+index c2d4eb9..6c7cf94 100644
 --- sc/source/ui/inc/undotab.hxx
 +++ sc/source/ui/inc/undotab.hxx
-@@ -226,6 +226,31 @@ private:
+@@ -35,6 +35,7 @@
+ #include "markdata.hxx"
+ #include "formula/grammar.hxx"
+ #include <tools/color.hxx>
++#include "tabbgcolor.hxx"
+ 
+ #ifndef _SVSTDARR_SHORTS
+ 
+@@ -226,6 +227,37 @@ private:
  	void DoChange() const;
  };
  
@@ -747,6 +891,9 @@
 +                            SCTAB nT,
 +                            const Color& aOTabBgColor,
 +                            const Color& aNTabBgColor);
++                    ScUndoSetTabBgColor(
++                            ScDocShell* pNewDocShell,
++                            ScUndoSetTabBgColorInfoList* pUndoSetTabBgColorInfoList);
 +    virtual         ~ScUndoSetTabBgColor();
 +
 +    virtual void    Undo();
@@ -760,8 +907,11 @@
 +    SCTAB   nTab;
 +    Color   aOldTabBgColor;
 +    Color   aNewTabBgColor;
++    ScUndoSetTabBgColorInfoList* aUndoSetTabBgColorInfoList;
++    BOOL    bIsMultipleUndo;
 +
 +    void DoChange( SCTAB nTab, const Color& rTabBgColor ) const;
++    void DoChange( BOOL bUndoType ) const;
 +};
  
  class ScUndoMakeScenario: public ScSimpleUndo
@@ -792,14 +942,24 @@
  	void			SetRefTabNo( SCTAB nNewTab )			{ nRefTabNo = nNewTab; }
  
 diff --git sc/source/ui/inc/viewfunc.hxx sc/source/ui/inc/viewfunc.hxx
-index 72e2d96..e886dac 100644
+index 72e2d96..6b12460 100644
 --- sc/source/ui/inc/viewfunc.hxx
 +++ sc/source/ui/inc/viewfunc.hxx
-@@ -276,6 +276,8 @@ public:
+@@ -32,6 +32,8 @@
+ 
+ #include "tabview.hxx"
+ 
++#include "tabbgcolor.hxx"
++
+ #ifndef _SVSTDARR_SHORTS
+ #define _SVSTDARR_SHORTS
+ #include <svtools/svstdarr.hxx>
+@@ -276,6 +278,9 @@ public:
  									SCTAB nCount, const SCTAB* pSrcTabs,
  									BOOL bLink,SCTAB nTab);
  
 +    BOOL            SetTabBgColor( const Color& rColor, SCTAB nTabNr );
++    BOOL            SetTabBgColor( ScUndoSetTabBgColorInfoList* rUndoSetTabBgColorInfoList );
 +
  	void			InsertTableLink( const String& rFile,
  										const String& rFilter, const String& rOptions,
@@ -818,10 +978,10 @@
  	$(SLO)$/filldlg.obj			\
 diff --git sc/source/ui/miscdlgs/tabbgcolordlg.cxx sc/source/ui/miscdlgs/tabbgcolordlg.cxx
 new file mode 100644
-index 0000000..5e2be9b
+index 0000000..18087cd
 --- /dev/null
 +++ sc/source/ui/miscdlgs/tabbgcolordlg.cxx
-@@ -0,0 +1,254 @@
+@@ -0,0 +1,205 @@
 +/*************************************************************************
 + *
 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -861,35 +1021,14 @@
 +
 +#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 <tools/resid.hxx>
 +#include "tabbgcolordlg.hxx"
 +#include "scresid.hxx"
 +#include "miscdlgs.hrc"
-+
-+#include <svx/dialogs.hrc>
-+
 +#include <svx/svxitems.hrc>
 +
 +//==================================================================
@@ -904,9 +1043,8 @@
 +                                    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 ) ),
++    aTabBgColorSet          ( &aBorderWin, ScResId( TAB_BG_COLOR_SET_BGDCOLOR ), this ),
 +    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 ) ),
@@ -920,13 +1058,9 @@
 +    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 );*/
++    aTabBgColorBox.SetText(rTitle);
 +    FillColorValueSets_Impl();
-+    aTabBgColorSet.SetDoubleClickHdl( HDL(TabBgColorSetHdl_Impl) );
-+    /*aTabBgColorMore.SetClickHdl( HDL(TabBgColorMoreHdl_Impl) );*/
++    aTabBgColorSet.SetDoubleClickHdl( HDL(TabBgColorDblClickHdl_Impl) );
 +    aBtnOk.SetClickHdl( HDL(TabBgColorOKHdl_Impl) );
 +    FreeResource();
 +}
@@ -935,9 +1069,15 @@
 +
 +void ScTabBgColorDlg::GetSelectedColor( Color& rColor ) const
 +{
-+    rColor = aTabBgColor;
++    rColor = this->aTabBgColor;
 +}
 +
++/*void ScTabBgColorDlg::SelectColor( const Color& rColor2 ) const
++{
++    this->aTabBgColor = rColor2;
++    this->EndDialog( TRUE );
++}*/
++
 +__EXPORT ScTabBgColorDlg::~ScTabBgColorDlg()
 +{
 +}
@@ -951,7 +1091,6 @@
 +    const Size aSize10x10 = Size( 10, 10 );
 +    const Size aSize5x5 = Size( 5, 5 );
 +    USHORT nSelectedItem = 0;
-+
 +    FASTBOOL bOwn = FALSE;
 +
 +    DBG_ASSERT( pDocSh, "DocShell not found!" );
@@ -970,7 +1109,7 @@
 +        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, ...
++        WinBits nBits = ( aTabBgColorSet.GetStyle() | WB_NAMEFIELD | WB_ITEMBORDER | WB_NONEFIELD | WB_3DLOOK | WB_NO_DIRECTSELECT | WB_NOPOINTERFOCUS);
 +        aTabBgColorSet.SetText( aTabBgColorNoColorText );
 +        aTabBgColorSet.SetStyle( nBits );
 +        for ( i = 0; i < nCount; i++ )
@@ -991,19 +1130,18 @@
 +        {
 +            aTabBgColorSet.SetStyle( nBits | WB_VSCROLL );
 +        }
-+
 +    }
 +    aTabBgColorSet.SetColCount( 10 );
 +    aTabBgColorSet.SetLineCount( 10 );
 +    aTabBgColorSet.CalcWindowSizePixel( aSize15x15 );
 +    aTabBgColorSet.Format();
 +    aTabBgColorSet.SelectItem(nSelectedItem);
-+//    aTabBgColorSet.StartSelection();
 +    aTabBgColorSet.Resize();
 +    if ( bOwn )
 +        delete pColorTable;
 +}
-+IMPL_LINK( ScTabBgColorDlg, TabBgColorSetHdl_Impl, ValueSet*, EMPTYARG )
++
++IMPL_LINK( ScTabBgColorDlg, TabBgColorDblClickHdl_Impl, ValueSet*, EMPTYARG )
 +/*
 +    Handler, called when color selection is changed
 +*/
@@ -1014,6 +1152,7 @@
 +    EndDialog( TRUE );
 +    return 0;
 +}
++
 +IMPL_LINK( ScTabBgColorDlg, TabBgColorOKHdl_Impl, OKButton*, EMPTYARG )
 +{
 +/*
@@ -1026,67 +1165,43 @@
 +    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;
++__EXPORT ScTabBgColorDlg::ScTabBgColorValueSet::ScTabBgColorValueSet( Control* pParent, const ResId& rResId, ScTabBgColorDlg* pTabBgColorDlg ) :
++    ValueSet(pParent, rResId)
++{
++    aTabBgColorDlg = pTabBgColorDlg;
++}
 +
-+    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)
++void ScTabBgColorDlg::ScTabBgColorValueSet::KeyInput( const KeyEvent& rKEvt )
++{
++    switch ( rKEvt.GetKeyCode().GetCode() )
++    {
++        case KEY_RETURN:
 +        {
-+            XColorEntry* pNewEntry = new XColorEntry(aTabBgColor, String::CreateFromAscii(""));
-+            pColorTable->Insert( (pColorTable->Count()+1), pNewEntry );
-+	    aTabBgColorSet.InsertItem( aTabBgColorSet.GetItemCount()+1, pNewEntry->GetColor(), pNewEntry->GetName() );
-+	    aTabBgColorSet.SelectItem( aTabBgColorSet.GetItemCount() );
++            USHORT nItemId = GetSelectItemId();
++            const Color& aColor = nItemId ? ( GetItemColor( nItemId ) ) : Color( COL_AUTO );
++            aTabBgColorDlg->aTabBgColor = aColor;
++            aTabBgColorDlg->EndDialog(TRUE);
++            //aTabBgColorDlg->SelectColor(aColor);
 +        }
-+        //EndDialog( TRUE );
++        break;
 +    }
-+    return 0;
-+}*/
++    ValueSet::KeyInput(rKEvt);
++}
 diff --git sc/source/ui/src/globstr.src sc/source/ui/src/globstr.src
-index 6912e7a..bf4a147 100644
+index 6912e7a..647bf28 100644
 --- sc/source/ui/src/globstr.src
 +++ sc/source/ui/src/globstr.src
-@@ -1134,6 +1134,10 @@ Resource RID_GLOBSTR
+@@ -1134,6 +1134,14 @@ Resource RID_GLOBSTR
  	{
  		Text [ en-US ] = "Rename Sheet" ;
  	};
 +    String STR_UNDO_SET_TAB_BG_COLOR
 +    {
-+        Text [ en-US ] = "Tab Color" ;
++        Text [ en-US ] = "Color Tab" ;
++    };
++    String STR_UNDO_SET_MULTI_TAB_BG_COLOR
++    {
++        Text [ en-US ] = "Color Tabs" ;
 +    };
  	String STR_UNDO_MOVE_TAB
  	{
@@ -1175,7 +1290,7 @@
  };
  
 diff --git sc/source/ui/src/scstring.src sc/source/ui/src/scstring.src
-index ed03d74..a9e9f4b 100644
+index ed03d74..12ae0aa 100644
 --- sc/source/ui/src/scstring.src
 +++ sc/source/ui/src/scstring.src
 @@ -283,6 +283,18 @@ String SCSTR_RENAMETAB
@@ -1188,7 +1303,7 @@
 +};
 +String SCSTR_NO_TAB_BG_COLOR
 +{
-+    Text [ en-US ] = "No Tab Color" ;
++    Text [ en-US ] = "Default" ;
 +};
 +String SCSTR_TAB_BG_COLOR_MORE
 +{
@@ -1198,7 +1313,7 @@
  {
  	Text [ en-US ] = "Name Object";
 diff --git sc/source/ui/undo/undotab.cxx sc/source/ui/undo/undotab.cxx
-index df3ab6f..bf389d2 100644
+index df3ab6f..83a2949 100644
 --- sc/source/ui/undo/undotab.cxx
 +++ sc/source/ui/undo/undotab.cxx
 @@ -70,6 +70,9 @@
@@ -1219,7 +1334,7 @@
  
  
  // -----------------------------------------------------------------------
-@@ -779,6 +783,68 @@ BOOL ScUndoCopyTab::CanRepeat(SfxRepeatTarget& /* rTarget */) const
+@@ -779,6 +783,113 @@ BOOL ScUndoCopyTab::CanRepeat(SfxRepeatTarget& /* rTarget */) const
  	return FALSE;
  }
  
@@ -1233,23 +1348,37 @@
 +                                        const Color& aOTabBgColor,
 +                                        const Color& aNTabBgColor) :
 +    ScSimpleUndo( pNewDocShell ),
-+    nTab 	 ( nT )
++    nTab 	 ( nT ),
++    bIsMultipleUndo ( FALSE ),
++    aUndoSetTabBgColorInfoList ( NULL )
 +{
 +    aOldTabBgColor = aOTabBgColor;
 +    aNewTabBgColor = aNTabBgColor;
 +}
 +
++ScUndoSetTabBgColor::ScUndoSetTabBgColor( ScDocShell* pNewDocShell,
++                                        ScUndoSetTabBgColorInfoList* pUndoSetTabBgColorInfoList) :
++    ScSimpleUndo( pNewDocShell ),
++    bIsMultipleUndo ( TRUE )
++{
++    aUndoSetTabBgColorInfoList = pUndoSetTabBgColorInfoList;
++}
++
 +__EXPORT ScUndoSetTabBgColor::~ScUndoSetTabBgColor()
 +{
 +}
 +
 +String __EXPORT ScUndoSetTabBgColor::GetComment() const
 +{
++    if (bIsMultipleUndo && aUndoSetTabBgColorInfoList && aUndoSetTabBgColorInfoList->Count() > 1)
++        return ScGlobal::GetRscString( STR_UNDO_SET_MULTI_TAB_BG_COLOR );
 +    return ScGlobal::GetRscString( STR_UNDO_SET_TAB_BG_COLOR );
 +}
 +
 +void ScUndoSetTabBgColor::DoChange( SCTAB nTabP, const Color& rTabBgColor ) const
 +{
++    if (bIsMultipleUndo)
++        return;
 +    ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
 +    if (pViewShell)
 +    {
@@ -1257,10 +1386,35 @@
 +        if (pViewData)
 +        {
 +            pViewData->SetTabBgColor( rTabBgColor, nTabP );
++            pDocShell->PostPaintExtras();
++            pDocShell->PostDataChanged();
 +            SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );
-+            pDocShell->PostPaintGridAll();
++            pViewShell->UpdateInputHandler();
++        }
++    }
++}
++
++void ScUndoSetTabBgColor::DoChange(BOOL bUndoType) const
++{
++    if (!bIsMultipleUndo)
++        return;
++    ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
++    if (pViewShell)
++    {
++        ScViewData* pViewData = pViewShell->GetViewData();
++        if (pViewData)
++        {
++            ScUndoSetTabBgColorInfo* aUndoSetTabBgColorInfo=NULL;
++            for (USHORT i=0; i < aUndoSetTabBgColorInfoList->Count(); i++)
++            {
++                aUndoSetTabBgColorInfo = aUndoSetTabBgColorInfoList->GetObject(i);
++                pViewData->SetTabBgColor( 
++                    bUndoType ? aUndoSetTabBgColorInfo->aOldTabBgColor : aUndoSetTabBgColorInfo->aNewTabBgColor,
++                    aUndoSetTabBgColorInfo->nTabId);
++            }
 +            pDocShell->PostPaintExtras();
 +            pDocShell->PostDataChanged();
++            SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );
 +            pViewShell->UpdateInputHandler();
 +        }
 +    }
@@ -1268,12 +1422,18 @@
 +
 +void __EXPORT ScUndoSetTabBgColor::Undo()
 +{
-+    DoChange(nTab, aOldTabBgColor);
++    if ( bIsMultipleUndo )
++        DoChange(TRUE);
++    else
++        DoChange(nTab, aOldTabBgColor);
 +}
 +
 +void __EXPORT ScUndoSetTabBgColor::Redo()
 +{
-+    DoChange(nTab, aNewTabBgColor);
++    if ( bIsMultipleUndo )
++        DoChange(FALSE);
++    else
++        DoChange(nTab, aNewTabBgColor);
 +}
 +
 +void __EXPORT ScUndoSetTabBgColor::Repeat(SfxRepeatTarget& /* rTarget */)
@@ -1372,31 +1532,21 @@
  			}
  		}
 diff --git sc/source/ui/view/tabvwshf.cxx sc/source/ui/view/tabvwshf.cxx
-index 6987883..dce02b8 100644
+index 6987883..42724e6 100644
 --- sc/source/ui/view/tabvwshf.cxx
 +++ sc/source/ui/view/tabvwshf.cxx
-@@ -60,6 +60,20 @@
+@@ -60,6 +60,10 @@
  
  #include "scabstdlg.hxx" //CHINA001
  
-+//TODO CLEANUP ADDED INCLUDES!!
-+//#include <vcl/floatwin.hxx>
++#include "tabbgcolor.hxx" //DBW
 +#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 -----------------------------------------------------------------
++#include <svx/colritem.hxx> //DBW
 +
  #define IS_AVAILABLE(WhichId,ppItem) \
      (pReqArgs->GetItemState((WhichId), TRUE, ppItem ) == SFX_ITEM_SET)
  
-@@ -696,17 +710,127 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
+@@ -696,17 +700,132 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
                  rBindings.Invalidate( FID_TAB_TOGGLE_GRID );
                  PaintGrid();
                  rReq.Done();
@@ -1413,6 +1563,9 @@
 +                ScMarkData& rMark = pViewData->GetMarkData();
 +                SCTAB nTabSelCount = rMark.GetSelectCount();
 +
++                ScUndoSetTabBgColorInfo*     aTabBgColorUndoInfo=NULL;
++                ScUndoSetTabBgColorInfoList* aTabBgColorUndoInfoList =NULL;
++
 +                if ( !pDoc->IsDocEditable() )
 +                    break;
 +
@@ -1432,15 +1585,18 @@
 +
 +                    if ( nTabSelCount > 1 )
 +                    {
++                        aTabBgColorUndoInfoList = new ScUndoSetTabBgColorInfoList();
 +                        for (SCTAB nTab=0; nTab<nTabCount; nTab++)
 +                        {
-+                            if ( rMark.GetTableSelect(nTab) )
++                            if ( rMark.GetTableSelect(nTab) && !pDoc->IsTabProtected(nTab) )
 +                            {
-+                                bDone = SetTabBgColor( aColor, nTab );
-+                                if (!bDone)
-+                                    break;
++                                aTabBgColorUndoInfo = new ScUndoSetTabBgColorInfo();
++                                aTabBgColorUndoInfo->nTabId = nTab;
++                                aTabBgColorUndoInfo->aNewTabBgColor = aColor;
++                                aTabBgColorUndoInfoList->Insert(aTabBgColorUndoInfo);
 +                            }
 +                        }
++                        bDone = SetTabBgColor( aTabBgColorUndoInfoList );
 +                    }
 +                    else
 +                    {
@@ -1455,16 +1611,12 @@
 +                {
 +                    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)),
@@ -1472,7 +1624,6 @@
 +                                                                String(ScResId(SCSTR_TAB_BG_COLOR_MORE)),
 +                                                                aTabBgColor,
 +                                                                nSlot,RID_SCDLG_TAB_BG_COLOR);
-+
 +                    while ( !bDone && nRet == RET_OK )
 +                    {
 +                        nRet = pDlg->Execute();
@@ -1480,14 +1631,24 @@
 +                        {
 +                            Color aSelectedColor;
 +                            pDlg->GetSelectedColor(aSelectedColor);
-+                            for  (SCTAB nTab=0; nTab<nTabCount; nTab++)
++                            aTabBgColorUndoInfoList = new ScUndoSetTabBgColorInfoList();
++                            if ( nTabSelCount > 1 )
 +                            {
-+                                if ( rMark.GetTableSelect(nTab) )
++                                for  (SCTAB nTab=0; nTab<nTabCount; nTab++)
 +                                {
-+                                    bDone = SetTabBgColor( aSelectedColor, nTab );
-+                                    if (!bDone)
-+                                        break;
++                                    if ( rMark.GetTableSelect(nTab) && !pDoc->IsTabProtected(nTab) )
++                                    {
++                                        aTabBgColorUndoInfo = new ScUndoSetTabBgColorInfo();
++                                        aTabBgColorUndoInfo->nTabId = nTab;
++                                        aTabBgColorUndoInfo->aNewTabBgColor = aSelectedColor;
++                                        aTabBgColorUndoInfoList->Insert(aTabBgColorUndoInfo);
++                                    }
 +                                }
++                                bDone = SetTabBgColor( aTabBgColorUndoInfoList );
++                            }
++                            else
++                            {
++                                bDone = SetTabBgColor( aSelectedColor, nCurrentTab ); //ScViewFunc.SetTabBgColor
 +                            }
 +                            if ( bDone )
 +                            {
@@ -1500,12 +1661,6 @@
 +                                {
 +                                    StarBASIC::Error( SbERR_SETPROP_FAILED );
 +                                }
-+                                else
-+                                {
-+                                    nRet = ErrorBox(GetDialogParent(),
-+                                                    WinBits( WB_OK | WB_DEF_OK ),
-+                                                    aErrMsg).Execute();
-+                                }
 +                            }
 +                        }
 +                    }
@@ -1529,19 +1684,20 @@
  void ScTabViewShell::GetStateTable( SfxItemSet& rSet )
  {
  	ScViewData* pViewData	= GetViewData();
-@@ -821,6 +945,22 @@ void ScTabViewShell::GetStateTable( SfxItemSet& rSet )
+@@ -821,6 +940,23 @@ void ScTabViewShell::GetStateTable( SfxItemSet& rSet )
              case FID_TAB_TOGGLE_GRID:
                  rSet.Put( SfxBoolItem(nWhich, pViewData->GetShowGrid()) );
                  break;
 +
 +            case FID_TAB_MENU_SET_TAB_BG_COLOR:
 +                {
-+                    if ( !pDoc->IsDocEditable() ||
-+                            pDoc->IsTabProtected(nTab) || 
-+                            ( pDocShell && pDocShell->IsDocShared() ) )
++                    if ( !pDoc->IsDocEditable()
++                        || ( pDocShell && pDocShell->IsDocShared() )
++                        || pDoc->IsTabProtected(nTab) )
 +                        rSet.DisableItem( nWhich );
-+                    break;
 +                }
++                break;
++
 +            case FID_TAB_SET_TAB_BG_COLOR:
 +                {
 +                    Color aColor;
@@ -1553,7 +1709,7 @@
  		nWhich = aIter.NextWhich();
  	}
 diff --git sc/source/ui/view/viewdata.cxx sc/source/ui/view/viewdata.cxx
-index bba31fc..bfad0ba 100644
+index bba31fc..cdb70f2 100644
 --- sc/source/ui/view/viewdata.cxx
 +++ sc/source/ui/view/viewdata.cxx
 @@ -105,7 +105,8 @@ ScViewDataTable::ScViewDataTable() :
@@ -1566,7 +1722,7 @@
  {
  	nPosX[0]=nPosX[1]=0;
  	nPosY[0]=nPosY[1]=0;
-@@ -168,6 +169,13 @@ void ScViewDataTable::WriteUserDataSequence(uno::Sequence <beans::PropertyValue>
+@@ -168,6 +169,11 @@ 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);
  
@@ -1575,12 +1731,10 @@
 +            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,13 @@ void ScViewDataTable::ReadUserDataSequence(const uno::Sequence <beans::PropertyV
+@@ -284,6 +290,13 @@ void ScViewDataTable::ReadUserDataSequence(const uno::Sequence <beans::PropertyV
              aSettings[i].Value >>= bSelected;
              rViewData.GetMarkData().SelectTable( nTab, bSelected );
          }
@@ -1594,7 +1748,7 @@
  	}
  	if (eHSplitMode == SC_SPLIT_FIX)
  		nFixPosX = SanitizeCol( static_cast<SCCOL>( bHasHSplitInTwips ? nTempPosHTw : nTempPosH ));
-@@ -589,6 +604,36 @@ void ScViewData::MoveTab( SCTAB nSrcTab, SCTAB nDestTab )
+@@ -589,6 +602,36 @@ void ScViewData::MoveTab( SCTAB nSrcTab, SCTAB nDestTab )
  	aMarkData.InsertTab( nInsTab );			// ggf. angepasst
  }
  
@@ -1631,7 +1785,7 @@
  //UNUSED2008-05  void ScViewData::UpdateOle( ScSplitPos /* eWhich */ )
  //UNUSED2008-05  {
  //UNUSED2008-05      GetDocShell()->UpdateOle(this);
-@@ -2477,6 +2522,9 @@ void ScViewData::WriteExtOptions( ScExtDocOptions& rDocOpt ) const
+@@ -2477,6 +2520,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 ) );
@@ -1641,7 +1795,7 @@
  		}
  	}
  }
-@@ -2633,6 +2681,10 @@ void ScViewData::ReadExtOptions( const ScExtDocOptions& rDocOpt )
+@@ -2633,6 +2679,10 @@ void ScViewData::ReadExtOptions( const ScExtDocOptions& rDocOpt )
                      update map modes that are needed to draw text correctly. */
                  SetPagebreakMode( rTabSett.mbPageMode );
              }
@@ -1653,16 +1807,23 @@
  	}
  
 diff --git sc/source/ui/view/viewfun2.cxx sc/source/ui/view/viewfun2.cxx
-index 30f3976..badc96f 100644
+index 30f3976..050e3fb 100644
 --- sc/source/ui/view/viewfun2.cxx
 +++ sc/source/ui/view/viewfun2.cxx
-@@ -2271,6 +2271,20 @@ BOOL ScViewFunc::RenameTable( const String& rName, SCTAB nTab )
+@@ -93,6 +93,7 @@ using namespace com::sun::star;
+ #include "inputwin.hxx"
+ #include "funcdesc.hxx"
+ 
++#include "tabbgcolor.hxx" //DBW
+ 
+ // STATIC DATA ---------------------------------------------------------------
+ 
+@@ -2271,6 +2272,28 @@ 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)
 +    {
@@ -1671,6 +1832,15 @@
 +    return bSuccess;
 +}
 +
++BOOL ScViewFunc::SetTabBgColor( ScUndoSetTabBgColorInfoList* rUndoSetTabBgColorInfoList )
++{
++    BOOL bSuccess = GetViewData()->GetDocShell()->GetDocFunc().SetTabBgColor( rUndoSetTabBgColorInfoList, TRUE, FALSE );
++    if (bSuccess)
++    {
++        GetViewData()->GetViewShell()->UpdateInputHandler();
++    }
++    return bSuccess;
++}
 +
 +//----------------------------------------------------------------------------
 +

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	Wed Feb 11 04:50:13 2009
@@ -15,7 +15,7 @@
  
      void            EnablePage( USHORT nPageId, BOOL bEnable = TRUE );
 diff --git svtools/source/control/tabbar.cxx svtools/source/control/tabbar.cxx
-index 81795e7..66749cd 100644
+index 81795e7..ffe3fc7 100644
 --- svtools/source/control/tabbar.cxx
 +++ svtools/source/control/tabbar.cxx
 @@ -75,6 +75,10 @@ struct ImplTabBarItem
@@ -167,3 +167,25 @@
  void TabBar::RemovePage( USHORT nPageId )
  {
      USHORT nPos = GetPagePos( nPageId );
+@@ -2476,9 +2555,12 @@ USHORT TabBar::ShowDropPos( const Point& rPos )
+             nX--;
+         else
+             nX++;
++        if ( !pItem->IsDefaultTabBgColor() && !pItem->mbSelect)
++            SetLineColor( pItem->maTabTextColor );
+         DrawLine( Point( nX, nY ), Point( nX, nY ) );
+         DrawLine( Point( nX+1, nY-1 ), Point( nX+1, nY+1 ) );
+         DrawLine( Point( nX+2, nY-2 ), Point( nX+2, nY+2 ) );
++        SetLineColor( aBlackColor );
+     }
+     if ( (mnDropPos > 0) && (mnDropPos < nItemCount+1) )
+     {
+@@ -2486,6 +2568,8 @@ USHORT TabBar::ShowDropPos( const Point& rPos )
+         nX = pItem->maRect.Right()-TABBAR_OFFSET_X;
+         if ( mnDropPos == nCurPos )
+             nX++;
++        if ( !pItem->IsDefaultTabBgColor() && !pItem->mbSelect)
++            SetLineColor( pItem->maTabTextColor );
+         DrawLine( Point( nX, nY ), Point( nX, nY ) );
+         DrawLine( Point( nX-1, nY-1 ), Point( nX-1, nY+1 ) );
+         DrawLine( Point( nX-2, nY-2 ), Point( nX-2, nY+2 ) );



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