1 --- sc/inc/ViewSettingsSequenceDefines.hxx.old 2009-04-06 16:42:05.000000000 +0000
2 +++ sc/inc/ViewSettingsSequenceDefines.hxx 2009-04-06 16:42:06.000000000 +0000
4 // this are the defines for the position of the settings in the
5 // TableViewSettingsSequence
7 -#define SC_TABLE_VIEWSETTINGS_COUNT 15
8 +#define SC_TABLE_VIEWSETTINGS_COUNT 16
13 #define SC_TABLE_ZOOM_VALUE 12
14 #define SC_TABLE_PAGE_VIEW_ZOOM_VALUE 13
15 #define SC_TABLE_SHOWGRID 14
16 +#define SC_TABLE_TAB_BG_COLOR 15
18 #define SC_CURSORPOSITIONX "CursorPositionX"
19 #define SC_CURSORPOSITIONY "CursorPositionY"
20 --- sc/inc/globstr.hrc.old 2009-04-06 16:41:59.000000000 +0000
21 +++ sc/inc/globstr.hrc 2009-04-06 16:42:06.000000000 +0000
23 #define STR_FORM_DROPDOWN 446
24 #define STR_FORM_SPINNER 447
25 #define STR_FORM_SCROLLBAR 448
27 -#define STR_COUNT 449
29 +#define STR_UNDO_SET_TAB_BG_COLOR 449
30 +#define STR_UNDO_SET_MULTI_TAB_BG_COLOR 450
32 +#define STR_COUNT 451
36 --- sc/inc/sc.hrc.old 2009-04-06 16:42:05.000000000 +0000
37 +++ sc/inc/sc.hrc 2009-04-06 16:42:06.000000000 +0000
38 @@ -1664,6 +1664,15 @@
39 #define RID_SCPAGE_FORMULA (SC_OOO_BUILD_START + 5)
40 #define HID_SCPAGE_FORMULA (SC_OOO_BUILD_START + 6)
43 +#define FID_TAB_MENU_SET_TAB_BG_COLOR (SC_OOO_BUILD_START + 7)
44 +#define FID_TAB_SET_TAB_BG_COLOR (SC_OOO_BUILD_START + 8)
46 +#define SCSTR_SET_TAB_BG_COLOR (SC_OOO_BUILD_START + 9)
47 +#define SCSTR_NO_TAB_BG_COLOR (SC_OOO_BUILD_START + 10)
49 +#define RID_SCDLG_TAB_BG_COLOR (SC_OOO_BUILD_START + 11)
54 --- sc/inc/scabstdlg.hxx.old 2009-04-06 16:41:39.000000000 +0000
55 +++ sc/inc/scabstdlg.hxx 2009-04-06 16:42:06.000000000 +0000
56 @@ -292,6 +292,12 @@ public:
57 virtual void GetInputString( String& rString ) const = 0;
60 +class AbstractScTabBgColorDlg : public VclAbstractDialog //add for ScTabBgColorDlg
63 + virtual void GetSelectedColor( Color& rColor ) const = 0;
66 class AbstractScImportOptionsDlg : public VclAbstractDialog //add for ScImportOptionsDlg
69 @@ -433,6 +439,14 @@ public:
70 const String& rDefault,
74 + virtual AbstractScTabBgColorDlg * CreateScTabBgColorDlg ( Window* pParent, //add for ScTabBgColorDlg
75 + const String& rTitle, //Dialog Title
76 + const String& rTabBgColorNoColorText, //Label for no tab color
77 + const Color& rDefaultColor, //Currently selected Color
81 virtual AbstractScImportOptionsDlg * CreateScImportOptionsDlg ( Window* pParent, //add for ScImportOptionsDlg
84 --- sc/inc/scextopt.hxx.old 2009-04-06 16:42:05.000000000 +0000
85 +++ sc/inc/scextopt.hxx 2009-04-06 16:42:06.000000000 +0000
86 @@ -81,6 +81,8 @@ struct ScExtTabSettings
87 bool mbFrozenPanes; /// true = Frozen panes; false = Normal splits.
88 bool mbPageMode; /// true = Pagebreak mode; false = Normal view mode.
89 bool mbShowGrid; /// Whether or not to display gridlines.
90 + Color maTabBgColor; /// Tab Bg Color
91 + bool IsDefaultTabBgColor() const { return maTabBgColor == Color(COL_AUTO) ? TRUE : FALSE; };
93 explicit ScExtTabSettings();
95 --- sc/inc/tabbgcolor.hxx.old 1970-01-01 00:00:00.000000000 +0000
96 +++ sc/inc/tabbgcolor.hxx 2009-04-06 16:42:06.000000000 +0000
98 +/*************************************************************************
100 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
102 + * Copyright 2008 by Sun Microsystems, Inc.
104 + * OpenOffice.org - a multi-platform office productivity suite
106 + * $RCSfile: tabbgcolor.hxx,v $
107 + * $Revision: 1.00 $
109 + * This file is part of OpenOffice.org.
111 + * OpenOffice.org is free software: you can redistribute it and/or modify
112 + * it under the terms of the GNU Lesser General Public License version 3
113 + * only, as published by the Free Software Foundation.
115 + * OpenOffice.org is distributed in the hope that it will be useful,
116 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
117 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
118 + * GNU Lesser General Public License version 3 for more details
119 + * (a copy is included in the LICENSE file that accompanied this code).
121 + * You should have received a copy of the GNU Lesser General Public License
122 + * version 3 along with OpenOffice.org. If not, see
123 + * <http://www.openoffice.org/license.html>
124 + * for a copy of the LGPLv3 License.
126 + ************************************************************************/
127 +#ifndef SC_TABBGCOLOR_HXX
128 +#define SC_TABBGCOLOR_HXX
130 +#include <tools/color.hxx>
131 +#include <tools/list.hxx>
133 +struct ScUndoSetTabBgColorInfo
137 + Color aOldTabBgColor;
138 + Color aNewTabBgColor;
139 + BOOL IsDefaultOldTabBgColor() const {return aOldTabBgColor == Color( COL_AUTO ) ? TRUE : FALSE ;};
140 + BOOL IsDefaultNewTabBgColor() const {return aOldTabBgColor == Color( COL_AUTO ) ? TRUE : FALSE ;};
142 +DECLARE_LIST( ScUndoSetTabBgColorInfoList, ScUndoSetTabBgColorInfo* )
144 --- sc/inc/unonames.hxx.old 2009-04-06 16:41:59.000000000 +0000
145 +++ sc/inc/unonames.hxx 2009-04-06 16:42:06.000000000 +0000
147 #define SC_UNO_ZOOMVALUE "ZoomValue"
148 #define SC_UNO_UPDTEMPL "UpdateFromTemplate"
149 #define SC_UNO_FILTERED_RANGE_SELECTION "FilteredRangeSelection"
150 +#define SC_UNO_TABCOLOR "TabColor"
152 /*Stampit enable/disable print cancel */
153 #define SC_UNO_ALLOWPRINTJOBCANCEL "AllowPrintJobCancel"
155 --- sc/sdi/docsh.sdi.old 2009-04-06 16:42:05.000000000 +0000
156 +++ sc/sdi/docsh.sdi 2009-04-06 16:42:06.000000000 +0000
157 @@ -64,6 +64,7 @@ interface TableSelection
158 FID_TAB_RENAME [ ExecMethod = ExecuteTable; StateMethod = GetStateTable; ]
159 FID_TAB_RTL [ ExecMethod = ExecuteTable; StateMethod = GetStateTable; ]
160 FID_TAB_TOGGLE_GRID [ ExecMethod = ExecuteTable; StateMethod = GetStateTable; ]
161 + FID_TAB_SET_TAB_BG_COLOR [ ExecMethod = ExecuteTable; StateMethod = GetStateTable; ]
163 SID_TABLE_ACTIVATE [ ExecMethod = Execute; ]
165 --- sc/sdi/scalc.sdi.old 2009-04-06 16:42:05.000000000 +0000
166 +++ sc/sdi/scalc.sdi 2009-04-06 16:42:06.000000000 +0000
167 @@ -7851,6 +7851,58 @@ SfxVoidItem ShareDocument SID_SHARE_DOC
170 //--------------------------------------------------------------------------
171 +SvxColorItem TabBgColor FID_TAB_SET_TAB_BG_COLOR
175 + AutoUpdate = FALSE,
176 + Cachable = Cachable,
180 + ReadOnlyDoc = TRUE,
183 + RecordAbsolute = FALSE,
190 + AccelConfig = TRUE,
192 + StatusBarConfig = FALSE,
193 + ToolBoxConfig = FALSE,
194 + GroupId = GID_FORMAT;
197 +//--------------------------------------------------------------------------
198 +SfxVoidItem SetTabBgColor FID_TAB_MENU_SET_TAB_BG_COLOR
199 +(SvxColorItem TabBgColor FID_TAB_SET_TAB_BG_COLOR)
202 + AutoUpdate = FALSE,
203 + Cachable = Cachable,
207 + ReadOnlyDoc = TRUE,
210 + RecordAbsolute = FALSE,
215 + AccelConfig = TRUE,
217 + StatusBarConfig = FALSE,
218 + ToolBoxConfig = FALSE,
219 + GroupId = GID_FORMAT;
222 +//--------------------------------------------------------------------------
223 SfxBoolItem ToggleSheetGrid FID_TAB_TOGGLE_GRID
226 --- sc/sdi/tabvwsh.sdi.old 2009-04-02 10:44:54.000000000 +0000
227 +++ sc/sdi/tabvwsh.sdi 2009-04-06 16:42:06.000000000 +0000
228 @@ -60,6 +60,7 @@ interface Tables
229 FID_TABLE_HIDE [ ExecMethod = ExecuteTable; StateMethod = GetStateTable; ]
230 FID_TABLE_SHOW [ ExecMethod = ExecuteTable; StateMethod = GetStateTable; ]
231 SID_SELECT_TABLES [ ExecMethod = Execute; StateMethod = GetState; ]
232 + FID_TAB_MENU_SET_TAB_BG_COLOR [ ExecMethod = ExecuteTable; StateMethod = GetStateTable; ]
235 // ===========================================================================
236 --- sc/source/filter/excel/read.cxx.old 2009-04-06 16:42:05.000000000 +0000
237 +++ sc/source/filter/excel/read.cxx 2009-04-06 16:42:06.000000000 +0000
238 @@ -1157,6 +1157,9 @@ FltError ImportExcel8::Read( void )
239 case EXC_ID_SXVDEX: rPTableMgr.ReadSxvdex( maStrm ); break;
240 case EXC_ID_SXEX: rPTableMgr.ReadSxex( maStrm ); break;
241 case EXC_ID_SXVIEWEX9: rPTableMgr.ReadSxViewEx9( maStrm ); break;
243 + // 0x0862 (SHEETEXT)
244 + case EXC_ID_SHEETEXT: rTabViewSett.ReadTabBgColor( maStrm, rPal ); break;
248 --- sc/source/filter/excel/xestyle.cxx.old 2009-04-06 16:41:50.000000000 +0000
249 +++ sc/source/filter/excel/xestyle.cxx 2009-04-06 16:42:06.000000000 +0000
250 @@ -77,6 +77,7 @@ sal_uInt32 lclGetWeighting( XclExpColorT
251 case EXC_COLOR_CELLTEXT:
252 case EXC_COLOR_CHARTTEXT:
253 case EXC_COLOR_CTRLTEXT: return 10;
254 + case EXC_COLOR_TABBG:
255 case EXC_COLOR_CELLAREA: return 20;
256 case EXC_COLOR_GRID: return 50;
257 default: DBG_ERRORFILE( "lclGetWeighting - unknown color type" );
258 --- sc/source/filter/excel/xeview.cxx.old 2009-04-06 16:42:05.000000000 +0000
259 +++ sc/source/filter/excel/xeview.cxx 2009-04-06 16:42:06.000000000 +0000
260 @@ -259,6 +259,35 @@ void XclExpSelection::WriteBody( XclExpS
261 maSelData.maXclSelection.Write( rStrm, false );
264 +// ----------------------------------------------------------------------------
266 +XclExpTabBgColor::XclExpTabBgColor( const XclTabViewData& rTabViewData ) :
267 + XclExpRecord( EXC_ID_SHEETEXT, 18 ),
268 + mrTabViewData( rTabViewData )
271 +//TODO Fix savexml...
272 +/*void XclExpTabBgColor::SaveXml( XclExpXmlStream& rStrm )
276 +void XclExpTabBgColor::WriteBody( XclExpStream& rStrm )
278 + if ( mrTabViewData.IsDefaultTabBgColor() )
280 + sal_uInt16 rt = 0x0862; //rt
281 + sal_uInt16 grbitFrt = 0x0000; //grbit must be set to 0
282 + sal_uInt32 unused = 0x00000000; //Use twice...
283 + sal_uInt32 cb = 0x00000014; // Record Size, may be larger in future...
284 + sal_uInt16 reserved = 0x0000; //trailing bits are 0
285 + sal_uInt16 TabBgColorIndex;
286 + XclExpPalette& rPal = rStrm.GetRoot().GetPalette();
287 + TabBgColorIndex = rPal.GetColorIndex(mrTabViewData.mnTabBgColorId);
288 + if (TabBgColorIndex < 8 || TabBgColorIndex > 63 ) // only numbers 8 - 63 are valid numbers
289 + TabBgColorIndex = 127; //Excel specs: 127 makes excel ignore tab color information.
290 + rStrm << rt << grbitFrt << unused << unused << cb << TabBgColorIndex << reserved;
293 // Sheet view settings ========================================================
296 @@ -368,6 +397,14 @@ XclExpTabViewSettings::XclExpTabViewSett
297 maData.mnNormalZoom = lclGetXclZoom( rTabSett.mnNormalZoom, EXC_WIN2_NORMALZOOM_DEF );
298 maData.mnPageZoom = lclGetXclZoom( rTabSett.mnPageZoom, EXC_WIN2_PAGEZOOM_DEF );
299 maData.mnCurrentZoom = maData.mbPageMode ? maData.mnPageZoom : maData.mnNormalZoom;
302 + if ( GetBiff() == EXC_BIFF8 && !rTabSett.IsDefaultTabBgColor() )
304 + XclExpPalette& rPal = GetPalette();
305 + maData.maTabBgColor = rTabSett.maTabBgColor;
306 + maData.mnTabBgColorId = rPal.InsertColor(maData.maTabBgColor, EXC_COLOR_TABBG, EXC_COLOR_NOTABBG );
311 @@ -380,6 +417,7 @@ void XclExpTabViewSettings::Save( XclExp
312 WriteSelection( rStrm, EXC_PANE_TOPRIGHT );
313 WriteSelection( rStrm, EXC_PANE_BOTTOMLEFT );
314 WriteSelection( rStrm, EXC_PANE_BOTTOMRIGHT );
315 + WriteTabBgColor( rStrm );
318 static void lcl_WriteSelection( XclExpXmlStream& rStrm, const XclTabViewData& rData, sal_uInt8 nPane )
319 @@ -494,5 +532,10 @@ void XclExpTabViewSettings::WriteSelecti
320 XclExpSelection( maData, nPane ).Save( rStrm );
323 +void XclExpTabViewSettings::WriteTabBgColor( XclExpStream& rStrm ) const
325 + if ( !maData.IsDefaultTabBgColor() )
326 + XclExpTabBgColor( maData ).Save( rStrm );
328 // ============================================================================
330 --- sc/source/filter/excel/xichart.cxx.old 2009-04-06 16:41:51.000000000 +0000
331 +++ sc/source/filter/excel/xichart.cxx 2009-04-06 16:42:06.000000000 +0000
332 @@ -3610,6 +3610,12 @@ void XclImpChart::ReadChartSubStream( Xc
334 case EXC_ID_WINDOW2: rTabViewSett.ReadWindow2( rStrm, true );break;
335 case EXC_ID_SCL: rTabViewSett.ReadScl( rStrm ); break;
336 + case EXC_ID_SHEETEXT: //0x0862
338 + XclImpPalette& rPal = GetPalette();
339 + rTabViewSett.ReadTabBgColor( rStrm, rPal);
344 switch( rStrm.GetRecId() )
345 --- sc/source/filter/excel/xiview.cxx.old 2009-04-06 16:42:05.000000000 +0000
346 +++ sc/source/filter/excel/xiview.cxx 2009-04-06 16:42:06.000000000 +0000
347 @@ -109,6 +109,24 @@ void XclImpTabViewSettings::Initialize()
348 maData.SetDefaults();
351 +void XclImpTabViewSettings::ReadTabBgColor( XclImpStream& rStrm, XclImpPalette& rPal )
353 + DBG_ASSERT_BIFF( GetBiff() >= EXC_BIFF8 );
354 + if( GetBiff() < EXC_BIFF8 )
357 + sal_uInt8 ColorIndex;
360 + rStrm.Ignore( 16 );
361 + ColorIndex = rStrm.ReaduInt8() & EXC_SHEETEXT_TABCOLOR; //0x7F
362 + if ( ColorIndex >= 8 && ColorIndex <= 63 ) //only accept valid index values
364 + TabBgColor = rPal.GetColor( ColorIndex );
365 + maData.maTabBgColor = TabBgColor;
369 void XclImpTabViewSettings::ReadWindow2( XclImpStream& rStrm, bool bChart )
371 if( GetBiff() == EXC_BIFF2 )
372 @@ -281,6 +299,10 @@ void XclImpTabViewSettings::Finalize()
373 aViewOpt.SetOption( VOPT_OUTLINER, maData.mbShowOutline );
374 rDoc.SetViewOptions( aViewOpt );
377 + // *** set tab bg color
378 + if ( !maData.IsDefaultTabBgColor() )
379 + rTabSett.maTabBgColor = maData.maTabBgColor;
382 // ============================================================================
383 --- sc/source/filter/excel/xlview.cxx.old 2009-04-02 10:44:55.000000000 +0000
384 +++ sc/source/filter/excel/xlview.cxx 2009-04-06 16:42:06.000000000 +0000
385 @@ -79,6 +79,7 @@ void XclTabViewData::SetDefaults()
386 mbDefGridColor = true;
387 mbShowFormulas = false;
388 mbShowGrid = mbShowHeadings = mbShowZeros = mbShowOutline = true;
389 + maTabBgColor.SetColor( COL_AUTO );
392 bool XclTabViewData::IsSplit() const
393 --- sc/source/filter/inc/xestyle.hxx.old 2009-04-06 16:41:50.000000000 +0000
394 +++ sc/source/filter/inc/xestyle.hxx 2009-04-06 16:42:06.000000000 +0000
395 @@ -61,7 +61,8 @@ enum XclExpColorType
396 EXC_COLOR_CHARTLINE, /// Line in a chart.
397 EXC_COLOR_CHARTAREA, /// Area in a chart.
398 EXC_COLOR_CTRLTEXT, /// Text color in a form control.
399 - EXC_COLOR_GRID /// Spreadsheet grid color.
400 + EXC_COLOR_GRID, /// Spreadsheet grid color.
401 + EXC_COLOR_TABBG /// Spreadsheet tab bg color.
404 // ----------------------------------------------------------------------------
405 --- sc/source/filter/inc/xeview.hxx.old 2009-04-02 10:44:58.000000000 +0000
406 +++ sc/source/filter/inc/xeview.hxx 2009-04-06 16:42:06.000000000 +0000
407 @@ -134,6 +134,20 @@ private:
408 sal_uInt8 mnPane; /// Pane identifier of this selection.
411 +class XclExpTabBgColor : public XclExpRecord
414 + explicit XclExpTabBgColor( const XclTabViewData& rTabViewData );
416 + /* virtual void SaveXml( XclExpXmlStream& rStrm ); TODO Fix XML Saving Stream */
418 + /** Writes the contents of the SHEETEXT record. */
419 + virtual void WriteBody( XclExpStream& rStrm );
422 + const XclTabViewData& mrTabViewData; /// view settings data of current sheet.
425 // View settings ==============================================================
427 /** Contains all view settings records for a single sheet. */
428 @@ -156,6 +170,7 @@ private:
429 void WriteScl( XclExpStream& rStrm ) const;
430 void WritePane( XclExpStream& rStrm ) const;
431 void WriteSelection( XclExpStream& rStrm, sal_uInt8 nPane ) const;
432 + void WriteTabBgColor( XclExpStream& rStrm ) const;
435 XclTabViewData maData; /// All view settings for a sheet.
436 --- sc/source/filter/inc/xiview.hxx.old 2009-04-02 10:44:58.000000000 +0000
437 +++ sc/source/filter/inc/xiview.hxx 2009-04-06 16:42:06.000000000 +0000
438 @@ -83,7 +83,8 @@ public:
439 void ReadPane( XclImpStream& rStrm );
440 /** Reads a SELECTION record. */
441 void ReadSelection( XclImpStream& rStrm );
443 + /** Reads a SHEETEXT record (Tab Color). */
444 + void ReadTabBgColor( XclImpStream& rStrm, XclImpPalette& rPal );
445 /** Sets the view settings at the current sheet or the extended sheet options object. */
448 --- sc/source/filter/inc/xlview.hxx.old 2009-04-02 10:44:58.000000000 +0000
449 +++ sc/source/filter/inc/xlview.hxx 2009-04-06 16:42:06.000000000 +0000
450 @@ -89,6 +89,11 @@ const sal_uInt8 EXC_PANE_TOPLEFT
452 const sal_uInt16 EXC_ID_SCL = 0x00A0;
454 +// (0x0862) SHEETEXT ----------------------------------------------------------
456 +const sal_uInt16 EXC_ID_SHEETEXT = 0x0862; /// header id for sheetext
457 +const sal_uInt8 EXC_SHEETEXT_TABCOLOR = 0x7F; /// mask for tab color
458 +const sal_uInt16 EXC_COLOR_NOTABBG = 0x7F; /// Excel ignores Tab color when set to this value...
459 // Structs ====================================================================
461 /** Contains all view settings for the entire document. */
462 @@ -149,6 +154,9 @@ struct XclTabViewData
463 bool mbShowHeadings; /// true = Show column/row headings.
464 bool mbShowZeros; /// true = Show zero value zells.
465 bool mbShowOutline; /// true = Show outlines.
466 + Color maTabBgColor; /// Tab Color default = (COL_AUTO )
467 + bool IsDefaultTabBgColor() const { return maTabBgColor == Color(COL_AUTO) ? TRUE : FALSE; };
468 + sal_uInt32 mnTabBgColorId; /// pallette color id
470 explicit XclTabViewData();
472 --- sc/source/ui/attrdlg/scdlgfact.cxx.old 2009-04-06 16:42:05.000000000 +0000
473 +++ sc/source/ui/attrdlg/scdlgfact.cxx 2009-04-06 16:42:06.000000000 +0000
475 #include "scendlg.hxx" //add for ScNewScenarioDlg
476 #include "shtabdlg.hxx" //add for ScShowTabDlg
477 #include "strindlg.hxx" //add for ScStringInputDlg
478 +#include "tabbgcolordlg.hxx"//add for ScTabBgColorDlg
479 #include "scuiimoptdlg.hxx" //add for ScImportOptionsDlg
480 #include "attrdlg.hxx" //add for ScAttrDlg
481 #include "hfedtdlg.hxx" //add for ScHFEditDlg
482 @@ -114,6 +115,7 @@ IMPL_ABSTDLG_BASE(AbstractScDPShowDetail
483 IMPL_ABSTDLG_BASE(AbstractScNewScenarioDlg_Impl); //add for ScNewScenarioDlg
484 IMPL_ABSTDLG_BASE(AbstractScShowTabDlg_Impl); //add for ScShowTabDlg
485 IMPL_ABSTDLG_BASE(AbstractScStringInputDlg_Impl); //add for ScStringInputDlg
486 +IMPL_ABSTDLG_BASE(AbstractScTabBgColorDlg_Impl); //add for ScTabBgColorDlg
487 IMPL_ABSTDLG_BASE(AbstractScImportOptionsDlg_Impl); //add for ScImportOptionsDlg
488 IMPL_ABSTDLG_BASE(AbstractTabDialog_Impl); //add for ScAttrDlg, ScHFEditDlg, ScStyleDlg, ScSubTotalDlg,ScCharDlg, ScParagraphDlg, ScValidationDlg, ScSortDlg
490 @@ -578,6 +580,14 @@ void AbstractScStringInputDlg_Impl::GetI
492 //add for AbstractScStringInputDlg_Impl end
494 +//add for AbstractScTabBgColorDlg_Impl begin
495 +void AbstractScTabBgColorDlg_Impl::GetSelectedColor( Color& rColor ) const //add for ScTabBgColorDlg
497 + pDlg->GetSelectedColor( rColor );
499 +//add for AbstractScTabBgColorDlg_Impl end
502 //add for AbstractScImportOptionsDlg_Impl begin
503 void AbstractScImportOptionsDlg_Impl::GetImportOptions( ScImportOptions& rOptions ) const //add for ScImportOptionsDlg
505 @@ -1226,6 +1236,31 @@ AbstractScShowTabDlg * ScAbstractDialogF
507 //add for ScStringInputDlg end
509 +//add for ScTabBgColorDlg begin
510 +AbstractScTabBgColorDlg * ScAbstractDialogFactory_Impl::CreateScTabBgColorDlg (
512 + const String& rTitle,
513 + const String& rTabBgColorNoColorText,
514 + const Color& rDefaultColor,
518 +ScTabBgColorDlg * pDlg=NULL;
521 + case RID_SCDLG_TAB_BG_COLOR :
522 + pDlg = new ScTabBgColorDlg( pParent, rTitle, rTabBgColorNoColorText, rDefaultColor, nHelpId );
529 + return new AbstractScTabBgColorDlg_Impl( pDlg );
532 +//add for ScTabBgColorDlg end
534 //add for ScImportOptionsDlg begin
535 AbstractScImportOptionsDlg * ScAbstractDialogFactory_Impl::CreateScImportOptionsDlg ( Window* pParent,
537 --- sc/source/ui/attrdlg/scdlgfact.hxx.old 2009-04-06 16:41:39.000000000 +0000
538 +++ sc/source/ui/attrdlg/scdlgfact.hxx 2009-04-06 16:42:06.000000000 +0000
539 @@ -62,6 +62,7 @@ class ScDPShowDetailDlg;
540 class ScNewScenarioDlg;
542 class ScStringInputDlg;
543 +class ScTabBgColorDlg;
544 class ScImportOptionsDlg;
547 @@ -343,6 +344,12 @@ class AbstractScStringInputDlg_Impl : p
548 virtual void GetInputString( String& rString ) const;
551 +class AbstractScTabBgColorDlg_Impl : public AbstractScTabBgColorDlg //add for ScTabBgColorDlg
553 + DECL_ABSTDLG_BASE( AbstractScTabBgColorDlg_Impl, ScTabBgColorDlg )
554 + virtual void GetSelectedColor( Color& rColor ) const;
557 class AbstractScImportOptionsDlg_Impl : public AbstractScImportOptionsDlg //add for ScImportOptionsDlg
559 DECL_ABSTDLG_BASE( AbstractScImportOptionsDlg_Impl, ScImportOptionsDlg)
560 @@ -500,6 +507,14 @@ public:
561 const String& rDefault,
565 + virtual AbstractScTabBgColorDlg * CreateScTabBgColorDlg ( Window* pParent, //add for ScStringInputDlg
566 + const String& rTitle, //Dialog Title
567 + const String& rTabBgColorNoColorText, //Label for no tab color
568 + const Color& rDefaultColor, //Currently selected Color
572 virtual AbstractScImportOptionsDlg * CreateScImportOptionsDlg ( Window* pParent, //add for ScImportOptionsDlg
575 --- sc/source/ui/docshell/docfunc.cxx.old 2009-04-06 16:41:59.000000000 +0000
576 +++ sc/source/ui/docshell/docfunc.cxx 2009-04-06 16:42:06.000000000 +0000
577 @@ -2682,6 +2682,104 @@ BOOL ScDocFunc::RenameTable( SCTAB nTab,
581 +BOOL ScDocFunc::SetTabBgColor( SCTAB nTab, const Color& rColor, BOOL bRecord, BOOL bApi )
584 + ScDocument* pDoc = rDocShell.GetDocument();
585 + if (bRecord && !pDoc->IsUndoEnabled())
587 + if ( !pDoc->IsDocEditable() || pDoc->IsTabProtected(nTab) )
590 + rDocShell.ErrorMessage(STR_PROTECTIONERR); //TODO Check to see what this string is...
594 + ScViewData* pViewData = rDocShell.GetViewData();
596 + Color aOldTabBgColor;
597 + aOldTabBgColor = pViewData->GetTabBgColor(nTab);
599 + BOOL bSuccess = FALSE;
600 + pViewData->SetTabBgColor(rColor, nTab);
601 + if ( pViewData->GetTabBgColor( nTab ) == rColor)
607 + rDocShell.GetUndoManager()->AddUndoAction(
608 + new ScUndoSetTabBgColor( &rDocShell, nTab, aOldTabBgColor, rColor));
610 + rDocShell.PostPaintExtras();
611 + ScDocShellModificator aModificator( rDocShell );
612 + aModificator.SetDocumentModified();
613 + SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );
620 +BOOL ScDocFunc::SetTabBgColor( ScUndoSetTabBgColorInfoList* rUndoSetTabBgColorInfoList, BOOL bRecord, BOOL bApi )
622 + ScDocument* pDoc = rDocShell.GetDocument();
623 + if (bRecord && !pDoc->IsUndoEnabled())
625 + if ( !pDoc->IsDocEditable() )
628 + rDocShell.ErrorMessage(STR_PROTECTIONERR); //TODO Get a better String Error...
632 + ScViewData* pViewData = rDocShell.GetViewData();
634 + Color aNewTabBgColor;
635 + ScUndoSetTabBgColorInfo* rUndoSetTabBgColorInfo;
636 + BOOL bSuccess = TRUE;
637 + USHORT nTabProtectCount = 0;
638 + for ( USHORT i=0; i < rUndoSetTabBgColorInfoList->Count(); i++ )
640 + rUndoSetTabBgColorInfo = rUndoSetTabBgColorInfoList->GetObject(i);
641 + nTab = rUndoSetTabBgColorInfo->nTabId;
642 + if ( !pDoc->IsTabProtected(nTab) )
644 + aNewTabBgColor = rUndoSetTabBgColorInfo->aNewTabBgColor;
645 + rUndoSetTabBgColorInfo->aOldTabBgColor = pViewData->GetTabBgColor(nTab);
646 + pViewData->SetTabBgColor(aNewTabBgColor, nTab);
647 + if ( pViewData->GetTabBgColor( nTab ) != aNewTabBgColor)
655 + nTabProtectCount++;
658 + if ( nTabProtectCount == rUndoSetTabBgColorInfoList->Count() )
661 + rDocShell.ErrorMessage(STR_PROTECTIONERR); //TODO Get a better String Error...
668 + rDocShell.GetUndoManager()->AddUndoAction(
669 + new ScUndoSetTabBgColor( &rDocShell, rUndoSetTabBgColorInfoList));
671 + rDocShell.PostPaintExtras();
672 + ScDocShellModificator aModificator( rDocShell );
673 + aModificator.SetDocumentModified();
674 + SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );
679 //------------------------------------------------------------------------
681 //! SetWidthOrHeight - noch doppelt zu ViewFunc !!!!!!
682 --- sc/source/ui/inc/docfunc.hxx.old 2009-04-06 16:41:59.000000000 +0000
683 +++ sc/source/ui/inc/docfunc.hxx 2009-04-06 16:42:06.000000000 +0000
685 #include "global.hxx"
686 #include "postit.hxx"
687 #include "formula/grammar.hxx"
688 +#include "tabbgcolor.hxx"
690 class ScEditEngineDefaulter;
692 @@ -120,6 +121,10 @@ public:
693 BOOL RenameTable( SCTAB nTab, const String& rName, BOOL bRecord, BOOL bApi );
694 BOOL DeleteTable( SCTAB nTab, BOOL bRecord, BOOL bApi );
696 + BOOL SetTabBgColor( SCTAB nTab, const Color& rColor, BOOL bRecord, BOOL bApi );
697 + BOOL SetTabBgColor( ScUndoSetTabBgColorInfoList* rUndoSetTabBgColorInfoList,
698 + BOOL bRecord, BOOL bApi );
700 BOOL SetTableVisible( SCTAB nTab, BOOL bVisible, BOOL bApi );
702 BOOL SetLayoutRTL( SCTAB nTab, BOOL bRTL, BOOL bApi );
703 --- sc/source/ui/inc/miscdlgs.hrc.old 2009-04-02 10:45:37.000000000 +0000
704 +++ sc/source/ui/inc/miscdlgs.hrc 2009-04-06 16:42:06.000000000 +0000
706 #define BTN_GROUP_ROWS 3
708 #define STR_UNGROUP 2
711 +#define TAB_BG_COLOR_CT_BORDER 1
712 +#define TAB_BG_COLOR_SET_BGDCOLOR 2
713 +#define TAB_BG_COLOR_GB_BGDCOLOR 3
715 --- sc/source/ui/inc/tabbgcolordlg.hxx.old 1970-01-01 00:00:00.000000000 +0000
716 +++ sc/source/ui/inc/tabbgcolordlg.hxx 2009-04-06 16:42:06.000000000 +0000
718 +/*************************************************************************
720 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
722 + * Copyright 2008 by Sun Microsystems, Inc.
724 + * OpenOffice.org - a multi-platform office productivity suite
726 + * $RCSfile: tabbgcolordlg.hxx,v $
729 + * This file is part of OpenOffice.org.
731 + * OpenOffice.org is free software: you can redistribute it and/or modify
732 + * it under the terms of the GNU Lesser General Public License version 3
733 + * only, as published by the Free Software Foundation.
735 + * OpenOffice.org is distributed in the hope that it will be useful,
736 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
737 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
738 + * GNU Lesser General Public License version 3 for more details
739 + * (a copy is included in the LICENSE file that accompanied this code).
741 + * You should have received a copy of the GNU Lesser General Public License
742 + * version 3 along with OpenOffice.org. If not, see
743 + * <http://www.openoffice.org/license.html>
744 + * for a copy of the LGPLv3 License.
746 + ************************************************************************/
748 +#ifndef SC_TABBGCOLORDLG_HXX
749 +#define SC_TABBGCOLORDLG_HXX
751 +#include <vcl/dialog.hxx>
752 +#include <vcl/fixed.hxx>
753 +#include <vcl/imagebtn.hxx>
754 +#include <svtools/valueset.hxx>
756 +//------------------------------------------------------------------------
758 +class ScTabBgColorDlg : public ModalDialog
761 + ScTabBgColorDlg( Window* pParent,
762 + const String& rTitle,
763 + const String& rTabBgColorNoColorText,
764 + const Color& rDefaultColor,
766 + ~ScTabBgColorDlg();
768 + void GetSelectedColor( Color& rColor ) const;
769 + //void SelectColor( const Color& rColor2 ) const;
771 + class ScTabBgColorValueSet : public ValueSet
775 + ScTabBgColorValueSet(Control* pParent, const ResId& rResId, ScTabBgColorDlg* pTabBgColorDlg);
777 + virtual void KeyInput( const KeyEvent& rKEvt );
779 + ScTabBgColorDlg* aTabBgColorDlg;
781 + Control aBorderWin;
782 + ScTabBgColorValueSet aTabBgColorSet;
783 + FixedLine aTabBgColorBox;
785 + CancelButton aBtnCancel;
786 + HelpButton aBtnHelp;
788 + const String aTabBgColorNoColorText;
791 + void FillColorValueSets_Impl();
793 + DECL_LINK( TabBgColorDblClickHdl_Impl, ValueSet* );
794 + DECL_LINK( TabBgColorOKHdl_Impl, OKButton* pBtn );
797 +#endif // SC_TABBGCOLORDLG_HXX
798 --- sc/source/ui/inc/undotab.hxx.old 2009-04-06 16:41:49.000000000 +0000
799 +++ sc/source/ui/inc/undotab.hxx 2009-04-06 16:42:06.000000000 +0000
801 #include "markdata.hxx"
802 #include "formula/grammar.hxx"
803 #include <tools/color.hxx>
804 +#include "tabbgcolor.hxx"
806 #ifndef _SVSTDARR_SHORTS
808 @@ -226,6 +227,37 @@ private:
809 void DoChange() const;
812 +class ScUndoSetTabBgColor: public ScSimpleUndo
816 + ScUndoSetTabBgColor(
817 + ScDocShell* pNewDocShell,
819 + const Color& aOTabBgColor,
820 + const Color& aNTabBgColor);
821 + ScUndoSetTabBgColor(
822 + ScDocShell* pNewDocShell,
823 + ScUndoSetTabBgColorInfoList* pUndoSetTabBgColorInfoList);
824 + virtual ~ScUndoSetTabBgColor();
826 + virtual void Undo();
827 + virtual void Redo();
828 + virtual void Repeat(SfxRepeatTarget& rTarget);
829 + virtual BOOL CanRepeat(SfxRepeatTarget& rTarget) const;
831 +virtual String GetComment() const;
835 + Color aOldTabBgColor;
836 + Color aNewTabBgColor;
837 + ScUndoSetTabBgColorInfoList* aUndoSetTabBgColorInfoList;
838 + BOOL bIsMultipleUndo;
840 + void DoChange( SCTAB nTab, const Color& rTabBgColor ) const;
841 + void DoChange( BOOL bUndoType ) const;
844 class ScUndoMakeScenario: public ScSimpleUndo
846 --- sc/source/ui/inc/viewdata.hxx.old 2009-04-06 16:42:05.000000000 +0000
847 +++ sc/source/ui/inc/viewdata.hxx 2009-04-06 16:42:06.000000000 +0000
848 @@ -153,6 +153,9 @@ private:
850 BOOL bOldCurValid; // "virtuelle" Cursorpos. bei zusammengefassten
853 + BOOL IsDefaultTabBgColor() const {return aTabBgColor == Color( COL_AUTO ) ? TRUE : FALSE ;};
858 @@ -287,6 +290,10 @@ public:
859 void CopyTab( SCTAB nSrcTab, SCTAB nDestTab );
860 void MoveTab( SCTAB nSrcTab, SCTAB nDestTab );
862 + void SetTabBgColor( Color rTabBgColor, SCTAB nTab );
863 + BOOL IsDefaultTabBgColor( SCTAB nTab ) const;
864 + Color GetTabBgColor( SCTAB nTab ) const;
866 SCTAB GetRefTabNo() const { return nRefTabNo; }
867 void SetRefTabNo( SCTAB nNewTab ) { nRefTabNo = nNewTab; }
869 --- sc/source/ui/inc/viewfunc.hxx.old 2009-04-06 16:41:50.000000000 +0000
870 +++ sc/source/ui/inc/viewfunc.hxx 2009-04-06 16:42:06.000000000 +0000
873 #include "tabview.hxx"
875 +#include "tabbgcolor.hxx"
877 #ifndef _SVSTDARR_SHORTS
878 #define _SVSTDARR_SHORTS
879 #include <svtools/svstdarr.hxx>
880 @@ -276,6 +278,9 @@ public:
881 SCTAB nCount, const SCTAB* pSrcTabs,
882 BOOL bLink,SCTAB nTab);
884 + BOOL SetTabBgColor( const Color& rColor, SCTAB nTabNr );
885 + BOOL SetTabBgColor( ScUndoSetTabBgColorInfoList* rUndoSetTabBgColorInfoList );
887 void InsertTableLink( const String& rFile,
888 const String& rFilter, const String& rOptions,
889 const String& rTabName );
890 --- sc/source/ui/miscdlgs/makefile.mk.old 2009-04-06 16:41:49.000000000 +0000
891 +++ sc/source/ui/miscdlgs/makefile.mk 2009-04-06 16:42:06.000000000 +0000
892 @@ -51,6 +51,7 @@ SLOFILES = \
893 $(SLO)$/delcodlg.obj \
894 $(SLO)$/inscodlg.obj \
895 $(SLO)$/strindlg.obj \
896 + $(SLO)$/tabbgcolordlg.obj \
897 $(SLO)$/mtrindlg.obj \
898 $(SLO)$/lbseldlg.obj \
899 $(SLO)$/filldlg.obj \
900 --- sc/source/ui/miscdlgs/tabbgcolordlg.cxx.old 1970-01-01 00:00:00.000000000 +0000
901 +++ sc/source/ui/miscdlgs/tabbgcolordlg.cxx 2009-04-06 16:42:06.000000000 +0000
903 +/*************************************************************************
905 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
907 + * Copyright 2008 by Sun Microsystems, Inc.
909 + * OpenOffice.org - a multi-platform office productivity suite
911 + * $RCSfile: tabbgcolordlg.cxx,v $
914 + * This file is part of OpenOffice.org.
916 + * OpenOffice.org is free software: you can redistribute it and/or modify
917 + * it under the terms of the GNU Lesser General Public License version 3
918 + * only, as published by the Free Software Foundation.
920 + * OpenOffice.org is distributed in the hope that it will be useful,
921 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
922 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
923 + * GNU Lesser General Public License version 3 for more details
924 + * (a copy is included in the LICENSE file that accompanied this code).
926 + * You should have received a copy of the GNU Lesser General Public License
927 + * version 3 along with OpenOffice.org. If not, see
928 + * <http://www.openoffice.org/license.html>
929 + * for a copy of the LGPLv3 License.
931 + ************************************************************************/
933 +// MARKER(update_precomp.py): autogen include statement, do not remove
934 +#include "precompiled_sc.hxx"
936 +#undef SC_DLLIMPLEMENTATION
938 +//------------------------------------------------------------------
940 +#include <tools/debug.hxx>
941 +#include <tools/color.hxx>
942 +#include <sfx2/objsh.hxx>
943 +#include <svx/xtable.hxx>
944 +#include <svx/drawitem.hxx>
945 +#include <svtools/pathoptions.hxx>
946 +#include <tools/resid.hxx>
947 +#include "tabbgcolordlg.hxx"
948 +#include "scresid.hxx"
949 +#include "miscdlgs.hrc"
950 +#include <svx/svxitems.hrc>
952 +//==================================================================
954 +#define HDL(hdl) LINK(this,ScTabBgColorDlg,hdl)
956 +__EXPORT ScTabBgColorDlg::ScTabBgColorDlg( Window* pParent,
957 + const String& rTitle,
958 + const String& rTabBgColorNoColorText,
959 + const Color& rDefaultColor,
961 + ModalDialog ( pParent, ScResId( RID_SCDLG_TAB_BG_COLOR ) ),
962 + aBorderWin ( this, ScResId( TAB_BG_COLOR_CT_BORDER ) ),
963 + aTabBgColorSet ( &aBorderWin, ScResId( TAB_BG_COLOR_SET_BGDCOLOR ), this ),
964 + aTabBgColorBox ( this, ScResId( TAB_BG_COLOR_GB_BGDCOLOR ) ),
965 + aBtnOk ( this, ScResId( BTN_OK ) ),
966 + aBtnCancel ( this, ScResId( BTN_CANCEL ) ),
967 + aBtnHelp ( this, ScResId( BTN_HELP ) ),
968 + aTabBgColorNoColorText ( rTabBgColorNoColorText ),
969 + aTabBgColor ( rDefaultColor ),
970 + aHelpId ( nHelpId )
973 + SetHelpId( nHelpId );
974 + this->SetText( rTitle );
975 + this->SetStyle(GetStyle() | WB_BORDER | WB_STDFLOATWIN | WB_3DLOOK | WB_DIALOGCONTROL | WB_SYSTEMWINDOW | WB_STANDALONE | WB_HIDE);
976 + //TODO: Assign Help ID's to all controls...
977 + aTabBgColorBox.SetText(rTitle);
978 + FillColorValueSets_Impl();
979 + aTabBgColorSet.SetDoubleClickHdl( HDL(TabBgColorDblClickHdl_Impl) );
980 + aBtnOk.SetClickHdl( HDL(TabBgColorOKHdl_Impl) );
984 +//------------------------------------------------------------------------
986 +void ScTabBgColorDlg::GetSelectedColor( Color& rColor ) const
988 + rColor = this->aTabBgColor;
991 +__EXPORT ScTabBgColorDlg::~ScTabBgColorDlg()
995 +void ScTabBgColorDlg::FillColorValueSets_Impl()
997 + SfxObjectShell* pDocSh = SfxObjectShell::Current();
998 + const SfxPoolItem* pItem = NULL;
999 + XColorTable* pColorTable = NULL;
1000 + const Size aSize15x15 = Size( 15, 15 );
1001 + const Size aSize10x10 = Size( 10, 10 );
1002 + const Size aSize5x5 = Size( 5, 5 );
1003 + USHORT nSelectedItem = 0;
1004 + FASTBOOL bOwn = FALSE;
1006 + DBG_ASSERT( pDocSh, "DocShell not found!" );
1008 + if ( pDocSh && ( 0 != ( pItem = pDocSh->GetItem( SID_COLOR_TABLE ) ) ) )
1009 + pColorTable = ( (SvxColorTableItem*)pItem )->GetColorTable();
1010 + if ( !pColorTable )
1013 + pColorTable = new XColorTable( SvtPathOptions().GetPalettePath() );
1015 + if ( pColorTable )
1018 + long nCount = pColorTable->Count();
1019 + XColorEntry* pEntry = NULL;
1020 + Color aColWhite( COL_WHITE );
1021 + String aStrWhite( ScResId( RID_SVXITEMS_COLOR_WHITE ) );
1022 + WinBits nBits = ( aTabBgColorSet.GetStyle() | WB_NAMEFIELD | WB_ITEMBORDER | WB_NONEFIELD | WB_3DLOOK | WB_NO_DIRECTSELECT | WB_NOPOINTERFOCUS);
1023 + aTabBgColorSet.SetText( aTabBgColorNoColorText );
1024 + aTabBgColorSet.SetStyle( nBits );
1025 + for ( i = 0; i < nCount; i++ )
1027 + pEntry = pColorTable->GetColor(i);
1028 + aTabBgColorSet.InsertItem( i + 1, pEntry->GetColor(), pEntry->GetName() );
1029 + if (pEntry->GetColor() == aTabBgColor)
1030 + nSelectedItem = (i + 1);
1035 + aTabBgColorSet.InsertItem( i + 1, aColWhite, aStrWhite );
1039 + if ( nCount > 80 )
1041 + aTabBgColorSet.SetStyle( nBits | WB_VSCROLL );
1044 + aTabBgColorSet.SetColCount( 10 );
1045 + aTabBgColorSet.SetLineCount( 10 );
1046 + aTabBgColorSet.CalcWindowSizePixel( aSize15x15 );
1047 + aTabBgColorSet.Format();
1048 + aTabBgColorSet.SelectItem(nSelectedItem);
1049 + aTabBgColorSet.Resize();
1051 + delete pColorTable;
1054 +IMPL_LINK( ScTabBgColorDlg, TabBgColorDblClickHdl_Impl, ValueSet*, EMPTYARG )
1056 + Handler, called when color selection is changed
1059 + USHORT nItemId = aTabBgColorSet.GetSelectItemId();
1060 + Color aColor = nItemId ? ( aTabBgColorSet.GetItemColor( nItemId ) ) : Color( COL_AUTO );
1061 + aTabBgColor = aColor;
1062 + EndDialog( TRUE );
1066 +IMPL_LINK( ScTabBgColorDlg, TabBgColorOKHdl_Impl, OKButton*, EMPTYARG )
1069 +// Handler, called when the OK button is pushed
1071 + USHORT nItemId = aTabBgColorSet.GetSelectItemId();
1072 + Color aColor = nItemId ? ( aTabBgColorSet.GetItemColor( nItemId ) ) : Color( COL_AUTO );
1073 + aTabBgColor = aColor;
1074 + EndDialog( TRUE );
1078 +__EXPORT ScTabBgColorDlg::ScTabBgColorValueSet::ScTabBgColorValueSet( Control* pParent, const ResId& rResId, ScTabBgColorDlg* pTabBgColorDlg ) :
1079 + ValueSet(pParent, rResId)
1081 + aTabBgColorDlg = pTabBgColorDlg;
1084 +void ScTabBgColorDlg::ScTabBgColorValueSet::KeyInput( const KeyEvent& rKEvt )
1086 + switch ( rKEvt.GetKeyCode().GetCode() )
1091 + USHORT nItemId = GetSelectItemId();
1092 + const Color& aColor = nItemId ? ( GetItemColor( nItemId ) ) : Color( COL_AUTO );
1093 + aTabBgColorDlg->aTabBgColor = aColor;
1094 + aTabBgColorDlg->EndDialog(TRUE);
1098 + ValueSet::KeyInput(rKEvt);
1100 --- sc/source/ui/src/globstr.src.old 2009-04-06 16:41:59.000000000 +0000
1101 +++ sc/source/ui/src/globstr.src 2009-04-06 16:42:06.000000000 +0000
1102 @@ -1134,6 +1134,14 @@ Resource RID_GLOBSTR
1104 Text [ en-US ] = "Rename Sheet" ;
1106 + String STR_UNDO_SET_TAB_BG_COLOR
1108 + Text [ en-US ] = "Color Tab" ;
1110 + String STR_UNDO_SET_MULTI_TAB_BG_COLOR
1112 + Text [ en-US ] = "Color Tabs" ;
1114 String STR_UNDO_MOVE_TAB
1116 Text [ en-US ] = "Move Sheets" ;
1117 --- sc/source/ui/src/miscdlgs.src.old 2009-04-02 10:45:23.000000000 +0000
1118 +++ sc/source/ui/src/miscdlgs.src 2009-04-06 16:42:06.000000000 +0000
1119 @@ -546,6 +546,96 @@ ModalDialog RID_SCDLG_STRINPUT
1120 Size = MAP_APPFONT ( 110 , 8 ) ;
1123 +ModalDialog RID_SCDLG_TAB_BG_COLOR
1125 + OutputSize = TRUE ;
1127 + Size = MAP_APPFONT ( 118 , 167 ) ;
1129 + Closeable = TRUE ;
1130 + Control TAB_BG_COLOR_CT_BORDER
1133 + Pos = MAP_APPFONT ( 1 , 1 ) ; //12, 32
1134 + Size = MAP_APPFONT ( 116+2 , 145+2 ) ;
1135 + DialogControl = TRUE;
1137 + Control TAB_BG_COLOR_SET_BGDCOLOR
1139 + // * HelpId = HID_BACKGROUND_CTL_BGDCOLORSET ;
1141 + Pos = MAP_APPFONT ( 0 , 0 ) ;
1142 + Size = MAP_APPFONT ( 116 , 145 ) ;
1145 + CancelButton BTN_CANCEL
1147 + Pos = MAP_APPFONT ( 82 , 151 ) ;
1148 + Size = MAP_APPFONT ( 35 , 14 ) ;
1150 + DefButton = FALSE ;
1154 + Pos = MAP_APPFONT ( 45 , 151 ) ;
1155 + Size = MAP_APPFONT ( 35 , 14 ) ;
1157 + DefButton = TRUE ;
1159 + HelpButton BTN_HELP
1161 + Pos = MAP_APPFONT ( 2 , 151 ) ;
1162 + Size = MAP_APPFONT ( 35 , 14 ) ;
1164 + DefButton = FALSE ;
1168 +ModalDialog RID_SCDLG_TAB_BG_COLOR
1170 + OutputSize = TRUE ;
1172 + Size = MAP_APPFONT ( 180 , 150 ) ;
1174 + Closeable = TRUE ;
1175 + Control TAB_BG_COLOR_CT_BORDER
1178 + Pos = MAP_APPFONT ( 1 , 1 ) ; //12, 32
1179 + Size = MAP_APPFONT ( 116+2 , 145+2 ) ;
1180 + DialogControl = TRUE;
1182 + Control TAB_BG_COLOR_SET_BGDCOLOR
1184 + // * HelpId = HID_BACKGROUND_CTL_BGDCOLORSET ;
1186 + Pos = MAP_APPFONT ( 0 , 0 ) ;
1187 + Size = MAP_APPFONT ( 116 , 145 ) ;
1192 + Pos = MAP_APPFONT ( 125 , 50 ) ;
1193 + Size = MAP_APPFONT ( 50 , 14 ) ;
1195 + DefButton = TRUE ;
1197 + CancelButton BTN_CANCEL
1199 + Pos = MAP_APPFONT ( 125 , 67 ) ;
1200 + Size = MAP_APPFONT ( 50 , 14 ) ;
1202 + DefButton = FALSE ;
1204 + HelpButton BTN_HELP
1206 + Pos = MAP_APPFONT ( 125 , 84 ) ;
1207 + Size = MAP_APPFONT ( 50 , 14 ) ;
1209 + DefButton = FALSE ;
1214 ModalDialog RID_SCDLG_MTRINPUT
1216 --- sc/source/ui/src/popup.src.old 2009-04-06 16:41:48.000000000 +0000
1217 +++ sc/source/ui/src/popup.src 2009-04-06 16:42:06.000000000 +0000
1218 @@ -187,6 +187,15 @@ Menu RID_POPUP_TAB
1219 HelpId = FID_TAB_RTL ;
1220 Text [ en-US ] = "S~heet Right-To-Left" ;
1222 + //------------------------------
1223 + MenuItem { Separator = TRUE ; };
1224 + //------------------------------
1227 + Identifier = FID_TAB_MENU_SET_TAB_BG_COLOR ;
1228 + HelpId = FID_TAB_MENU_SET_TAB_BG_COLOR ;
1229 + Text [ en-US ] = "~Tab Color..." ;
1234 --- sc/source/ui/src/scstring.src.old 2009-04-02 10:45:23.000000000 +0000
1235 +++ sc/source/ui/src/scstring.src 2009-04-06 16:42:06.000000000 +0000
1236 @@ -283,6 +283,14 @@ String SCSTR_RENAMETAB
1238 Text [ en-US ] = "Rename Sheet" ;
1240 +String SCSTR_SET_TAB_BG_COLOR
1242 + Text [ en-US ] = "Tab Color" ;
1244 +String SCSTR_NO_TAB_BG_COLOR
1246 + Text [ en-US ] = "Default" ;
1248 String SCSTR_RENAMEOBJECT
1250 Text [ en-US ] = "Name Object";
1251 --- sc/source/ui/undo/undotab.cxx.old 2009-04-06 16:41:49.000000000 +0000
1252 +++ sc/source/ui/undo/undotab.cxx 2009-04-06 16:42:06.000000000 +0000
1254 #include "drwlayer.hxx"
1255 #include "scresid.hxx"
1257 +// for set tab bg color
1258 +#include "viewdata.hxx"
1260 extern BOOL bDrawIsInUndo; //! irgendwo als Member !!!
1262 using namespace com::sun::star;
1263 @@ -93,6 +96,7 @@ TYPEINIT1(ScUndoScenarioFlags, SfxUndoAc
1264 TYPEINIT1(ScUndoRenameObject, SfxUndoAction);
1265 TYPEINIT1(ScUndoLayoutRTL, SfxUndoAction);
1266 TYPEINIT1(ScUndoSetGrammar, SfxUndoAction);
1267 +TYPEINIT1(ScUndoSetTabBgColor, SfxUndoAction);
1270 // -----------------------------------------------------------------------
1271 @@ -779,6 +783,113 @@ BOOL ScUndoCopyTab::CanRepeat(SfxRepeatT
1275 +//---------------------------------------------------------------------------------
1280 +ScUndoSetTabBgColor::ScUndoSetTabBgColor( ScDocShell* pNewDocShell,
1282 + const Color& aOTabBgColor,
1283 + const Color& aNTabBgColor) :
1284 + ScSimpleUndo( pNewDocShell ),
1286 + bIsMultipleUndo ( FALSE ),
1287 + aUndoSetTabBgColorInfoList ( NULL )
1289 + aOldTabBgColor = aOTabBgColor;
1290 + aNewTabBgColor = aNTabBgColor;
1293 +ScUndoSetTabBgColor::ScUndoSetTabBgColor( ScDocShell* pNewDocShell,
1294 + ScUndoSetTabBgColorInfoList* pUndoSetTabBgColorInfoList) :
1295 + ScSimpleUndo( pNewDocShell ),
1296 + bIsMultipleUndo ( TRUE )
1298 + aUndoSetTabBgColorInfoList = pUndoSetTabBgColorInfoList;
1301 +__EXPORT ScUndoSetTabBgColor::~ScUndoSetTabBgColor()
1305 +String __EXPORT ScUndoSetTabBgColor::GetComment() const
1307 + if (bIsMultipleUndo && aUndoSetTabBgColorInfoList && aUndoSetTabBgColorInfoList->Count() > 1)
1308 + return ScGlobal::GetRscString( STR_UNDO_SET_MULTI_TAB_BG_COLOR );
1309 + return ScGlobal::GetRscString( STR_UNDO_SET_TAB_BG_COLOR );
1312 +void ScUndoSetTabBgColor::DoChange( SCTAB nTabP, const Color& rTabBgColor ) const
1314 + if (bIsMultipleUndo)
1316 + ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
1319 + ScViewData* pViewData = pViewShell->GetViewData();
1322 + pViewData->SetTabBgColor( rTabBgColor, nTabP );
1323 + pDocShell->PostPaintExtras();
1324 + pDocShell->PostDataChanged();
1325 + SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );
1326 + pViewShell->UpdateInputHandler();
1331 +void ScUndoSetTabBgColor::DoChange(BOOL bUndoType) const
1333 + if (!bIsMultipleUndo)
1335 + ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
1338 + ScViewData* pViewData = pViewShell->GetViewData();
1341 + ScUndoSetTabBgColorInfo* aUndoSetTabBgColorInfo=NULL;
1342 + for (USHORT i=0; i < aUndoSetTabBgColorInfoList->Count(); i++)
1344 + aUndoSetTabBgColorInfo = aUndoSetTabBgColorInfoList->GetObject(i);
1345 + pViewData->SetTabBgColor(
1346 + bUndoType ? aUndoSetTabBgColorInfo->aOldTabBgColor : aUndoSetTabBgColorInfo->aNewTabBgColor,
1347 + aUndoSetTabBgColorInfo->nTabId);
1349 + pDocShell->PostPaintExtras();
1350 + pDocShell->PostDataChanged();
1351 + SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );
1352 + pViewShell->UpdateInputHandler();
1357 +void __EXPORT ScUndoSetTabBgColor::Undo()
1359 + if ( bIsMultipleUndo )
1362 + DoChange(nTab, aOldTabBgColor);
1365 +void __EXPORT ScUndoSetTabBgColor::Redo()
1367 + if ( bIsMultipleUndo )
1370 + DoChange(nTab, aNewTabBgColor);
1373 +void __EXPORT ScUndoSetTabBgColor::Repeat(SfxRepeatTarget& /* rTarget */)
1378 +BOOL __EXPORT ScUndoSetTabBgColor::CanRepeat(SfxRepeatTarget& /* rTarget */) const
1383 // -----------------------------------------------------------------------
1385 --- sc/source/ui/view/scextopt.cxx.old 2009-04-06 16:42:05.000000000 +0000
1386 +++ sc/source/ui/view/scextopt.cxx 2009-04-06 16:42:06.000000000 +0000
1387 @@ -62,7 +62,8 @@ ScExtTabSettings::ScExtTabSettings() :
1388 mbSelected( false ),
1389 mbFrozenPanes( false ),
1390 mbPageMode( false ),
1391 - mbShowGrid( true )
1392 + mbShowGrid( true ),
1393 + maTabBgColor( COL_AUTO)
1397 --- sc/source/ui/view/tabcont.cxx.old 2009-04-02 10:45:40.000000000 +0000
1398 +++ sc/source/ui/view/tabcont.cxx 2009-04-06 16:42:06.000000000 +0000
1399 @@ -68,6 +68,7 @@ ScTabControl::ScTabControl( Window* pPar
1400 ScDocument* pDoc = pViewData->GetDocument();
1403 + Color aTabBgColor;
1404 SCTAB nCount = pDoc->GetTableCount();
1405 for (SCTAB i=0; i<nCount; i++)
1407 @@ -79,6 +80,12 @@ ScTabControl::ScTabControl( Window* pPar
1408 InsertPage( static_cast<sal_uInt16>(i)+1, aString, TPB_SPECIAL );
1410 InsertPage( static_cast<sal_uInt16>(i)+1, aString );
1411 + if ( !pViewData->IsDefaultTabBgColor(i) )
1413 + aTabBgColor = pViewData->GetTabBgColor(i);
1414 + /*SetTabBgColor(static_cast<sal_uInt16>(i)+1, aTabBgColor, pViewData->IsDefaultTabBgColor(i) );*/
1415 + SetTabBgColor( static_cast<sal_uInt16>(i)+1, aTabBgColor );
1420 @@ -259,6 +266,7 @@ void ScTabControl::Select()
1421 rBind.Invalidate( FID_DELETE_TABLE );
1422 rBind.Invalidate( FID_TABLE_SHOW );
1423 rBind.Invalidate( FID_TABLE_HIDE );
1424 + rBind.Invalidate( FID_TAB_SET_TAB_BG_COLOR );
1426 // SetReference nur wenn der Konsolidieren-Dialog offen ist
1427 // (fuer Referenzen ueber mehrere Tabellen)
1428 @@ -285,16 +293,22 @@ void ScTabControl::UpdateStatus()
1431 SCTAB nMaxCnt = Max( nCount, static_cast<SCTAB>(GetMaxId()) );
1432 + Color aTabBgColor;
1434 BOOL bModified = FALSE; // Tabellen-Namen
1435 for (i=0; i<nMaxCnt && !bModified; i++)
1437 if (pDoc->IsVisible(i))
1439 pDoc->GetName(i,aString);
1440 + aTabBgColor = pViewData->GetTabBgColor(i);
1447 - if (GetPageText(static_cast<sal_uInt16>(i)+1) != aString)
1448 + if ( (GetPageText(static_cast<sal_uInt16>(i)+1) != aString) || (GetTabBgColor(static_cast<sal_uInt16>(i)+1) != aTabBgColor) )
1452 @@ -311,6 +325,11 @@ void ScTabControl::UpdateStatus()
1453 InsertPage( static_cast<sal_uInt16>(i)+1, aString, TPB_SPECIAL );
1455 InsertPage( static_cast<sal_uInt16>(i)+1, aString );
1456 + if ( !pViewData->IsDefaultTabBgColor(i) )
1458 + aTabBgColor = pViewData->GetTabBgColor(i);
1459 + SetTabBgColor( static_cast<sal_uInt16>(i)+1, aTabBgColor );
1464 --- sc/source/ui/view/tabvwshf.cxx.old 2009-04-06 16:42:05.000000000 +0000
1465 +++ sc/source/ui/view/tabvwshf.cxx 2009-04-06 16:42:06.000000000 +0000
1468 #include "scabstdlg.hxx" //CHINA001
1470 +#include "tabbgcolor.hxx" //DBW
1471 +#include "tabbgcolordlg.hxx" //DBW
1472 +#include <svx/colritem.hxx> //DBW
1474 #define IS_AVAILABLE(WhichId,ppItem) \
1475 (pReqArgs->GetItemState((WhichId), TRUE, ppItem ) == SFX_ITEM_SET)
1477 @@ -690,17 +694,131 @@ void ScTabViewShell::ExecuteTable( SfxRe
1478 rBindings.Invalidate( FID_TAB_TOGGLE_GRID );
1484 + case FID_TAB_SET_TAB_BG_COLOR:
1485 + case FID_TAB_MENU_SET_TAB_BG_COLOR:
1487 + if ( nSlot == FID_TAB_MENU_SET_TAB_BG_COLOR )
1488 + nSlot = FID_TAB_SET_TAB_BG_COLOR;
1490 + SCTAB nTabNr = pViewData->GetTabNo();
1491 + ScMarkData& rMark = pViewData->GetMarkData();
1492 + SCTAB nTabSelCount = rMark.GetSelectCount();
1494 + ScUndoSetTabBgColorInfo* aTabBgColorUndoInfo=NULL;
1495 + ScUndoSetTabBgColorInfoList* aTabBgColorUndoInfoList =NULL;
1497 + if ( !pDoc->IsDocEditable() )
1500 + if ( pDoc->IsTabProtected( nTabNr ) ) // ||nTabSelCount > 1
1503 + if( pReqArgs != NULL )
1505 + BOOL bDone = FALSE;
1506 + const SfxPoolItem* pItem;
1508 + if( IS_AVAILABLE( FN_PARAM_1, &pItem ) )
1509 + nTabNr = ((const SfxUInt16Item*)pItem)->GetValue();
1511 + if( IS_AVAILABLE( nSlot, &pItem ) )
1512 + aColor = ((const SvxColorItem*)pItem)->GetValue();
1514 + if ( nTabSelCount > 1 )
1516 + aTabBgColorUndoInfoList = new ScUndoSetTabBgColorInfoList();
1517 + for (SCTAB nTab=0; nTab<nTabCount; nTab++)
1519 + if ( rMark.GetTableSelect(nTab) && !pDoc->IsTabProtected(nTab) )
1521 + aTabBgColorUndoInfo = new ScUndoSetTabBgColorInfo();
1522 + aTabBgColorUndoInfo->nTabId = nTab;
1523 + aTabBgColorUndoInfo->aNewTabBgColor = aColor;
1524 + aTabBgColorUndoInfoList->Insert(aTabBgColorUndoInfo);
1527 + bDone = SetTabBgColor( aTabBgColorUndoInfoList );
1531 + bDone = SetTabBgColor( aColor, nCurrentTab ); //ScViewFunc.SetTabBgColor
1535 + rReq.Done( *pReqArgs );
1540 + USHORT nRet = RET_OK; /// temp
1541 + BOOL bDone = FALSE; /// temp
1542 + Color aTabBgColor;
1543 + Color aNewTabBgColor;
1545 + aTabBgColor = pViewData->GetTabBgColor( nCurrentTab );
1546 + ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
1547 + DBG_ASSERT(pFact, "ScAbstractFactory create fail!");
1548 + AbstractScTabBgColorDlg* pDlg = pFact->CreateScTabBgColorDlg(
1549 + GetDialogParent(),
1550 + String(ScResId(SCSTR_SET_TAB_BG_COLOR)),
1551 + String(ScResId(SCSTR_NO_TAB_BG_COLOR)),
1553 + nSlot,RID_SCDLG_TAB_BG_COLOR);
1554 + while ( !bDone && nRet == RET_OK )
1556 + nRet = pDlg->Execute();
1557 + if( nRet == RET_OK )
1559 + Color aSelectedColor;
1560 + pDlg->GetSelectedColor(aSelectedColor);
1561 + aTabBgColorUndoInfoList = new ScUndoSetTabBgColorInfoList();
1562 + if ( nTabSelCount > 1 )
1564 + for (SCTAB nTab=0; nTab<nTabCount; nTab++)
1566 + if ( rMark.GetTableSelect(nTab) && !pDoc->IsTabProtected(nTab) )
1568 + aTabBgColorUndoInfo = new ScUndoSetTabBgColorInfo();
1569 + aTabBgColorUndoInfo->nTabId = nTab;
1570 + aTabBgColorUndoInfo->aNewTabBgColor = aSelectedColor;
1571 + aTabBgColorUndoInfoList->Insert(aTabBgColorUndoInfo);
1574 + bDone = SetTabBgColor( aTabBgColorUndoInfoList );
1578 + bDone = SetTabBgColor( aSelectedColor, nCurrentTab ); //ScViewFunc.SetTabBgColor
1582 + rReq.AppendItem( SvxColorItem( aTabBgColor, nSlot ) );
1587 + if( rReq.IsAPI() )
1589 + StarBASIC::Error( SbERR_SETPROP_FAILED );
1600 - DBG_ERROR("Unbekannte Message bei ViewShell");
1604 + DBG_ERROR("Unbekannte Message bei ViewShell");
1609 //------------------------------------------------------------------
1611 void ScTabViewShell::GetStateTable( SfxItemSet& rSet )
1613 ScViewData* pViewData = GetViewData();
1614 @@ -815,6 +933,23 @@ void ScTabViewShell::GetStateTable( SfxI
1615 case FID_TAB_TOGGLE_GRID:
1616 rSet.Put( SfxBoolItem(nWhich, pViewData->GetShowGrid()) );
1619 + case FID_TAB_MENU_SET_TAB_BG_COLOR:
1621 + if ( !pDoc->IsDocEditable()
1622 + || ( pDocShell && pDocShell->IsDocShared() )
1623 + || pDoc->IsTabProtected(nTab) )
1624 + rSet.DisableItem( nWhich );
1628 + case FID_TAB_SET_TAB_BG_COLOR:
1631 + aColor = pViewData->GetTabBgColor( nTab );
1632 + rSet.Put( SvxColorItem( aColor, nWhich ) );
1636 nWhich = aIter.NextWhich();
1638 --- sc/source/ui/view/viewdata.cxx.old 2009-04-06 16:42:05.000000000 +0000
1639 +++ sc/source/ui/view/viewdata.cxx 2009-04-06 16:42:06.000000000 +0000
1640 @@ -105,7 +105,8 @@ ScViewDataTable::ScViewDataTable() :
1644 - bOldCurValid( FALSE )
1645 + bOldCurValid( FALSE ),
1646 + aTabBgColor( Color(COL_AUTO) )
1648 nPosX[0]=nPosX[1]=0;
1649 nPosY[0]=nPosY[1]=0;
1650 @@ -168,6 +169,11 @@ void ScViewDataTable::WriteUserDataSeque
1651 pSettings[SC_TABLE_SHOWGRID].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNO_SHOWGRID));
1652 pSettings[SC_TABLE_SHOWGRID].Value <<= static_cast<sal_Bool>(bShowGrid);
1654 + if ( !IsDefaultTabBgColor() )
1656 + pSettings[SC_TABLE_TAB_BG_COLOR].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNO_TABCOLOR));
1657 + pSettings[SC_TABLE_TAB_BG_COLOR].Value <<= static_cast<sal_Int32>(aTabBgColor.GetColor());
1659 // pSettings[SC_TABLE_SELECTED].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_TABLESELECTED));
1660 // pSettings[SC_TABLE_SELECTED].Value <<= bool(rViewData.GetMarkData().GetTableSelect( nTab ));
1662 @@ -284,6 +290,13 @@ void ScViewDataTable::ReadUserDataSequen
1663 aSettings[i].Value >>= bSelected;
1664 rViewData.GetMarkData().SelectTable( nTab, bSelected );
1666 + else if (sName.compareToAscii(SC_UNO_TABCOLOR) == 0)
1668 + sal_Int32 nColor = COL_AUTO;
1669 + aSettings[i].Value >>= nColor;
1670 + if (nColor != COL_AUTO)
1671 + aTabBgColor.SetColor(static_cast<ColorData>(nColor));
1674 if (eHSplitMode == SC_SPLIT_FIX)
1675 nFixPosX = SanitizeCol( static_cast<SCCOL>( bHasHSplitInTwips ? nTempPosHTw : nTempPosH ));
1676 @@ -589,6 +602,36 @@ void ScViewData::MoveTab( SCTAB nSrcTab,
1677 aMarkData.InsertTab( nInsTab ); // ggf. angepasst
1680 +void ScViewData::SetTabBgColor( Color rTabBgColor, SCTAB nTab )
1682 + if ( rTabBgColor != Color(COL_AUTO) )
1684 + if ( !pTabData[nTab] )
1685 + CreateTabData( nTab );
1686 + pTabData[nTab]->aTabBgColor = rTabBgColor;
1690 + if ( pTabData[nTab] )
1691 + pTabData[nTab]->aTabBgColor = Color( COL_AUTO );
1695 +Color ScViewData::GetTabBgColor( SCTAB nTab ) const
1697 + if ( !pTabData[nTab] )
1698 + return Color(COL_AUTO);
1699 + return pTabData[nTab]->aTabBgColor;
1702 +BOOL ScViewData::IsDefaultTabBgColor( SCTAB nTab ) const
1704 + if ( !pTabData[nTab] )
1706 + BOOL bResult = pTabData[nTab]->aTabBgColor==Color( COL_AUTO ) ? TRUE : FALSE;
1710 //UNUSED2008-05 void ScViewData::UpdateOle( ScSplitPos /* eWhich */ )
1712 //UNUSED2008-05 GetDocShell()->UpdateOle(this);
1713 @@ -2477,6 +2520,9 @@ void ScViewData::WriteExtOptions( ScExtD
1714 rTabSett.mbPageMode = bPagebreak;
1715 rTabSett.mnNormalZoom = static_cast< long >( pViewTab->aZoomY * Fraction( 100.0 ) );
1716 rTabSett.mnPageZoom = static_cast< long >( pViewTab->aPageZoomY * Fraction( 100.0 ) );
1719 + rTabSett.maTabBgColor = pViewTab->aTabBgColor;
1723 @@ -2633,6 +2679,10 @@ void ScViewData::ReadExtOptions( const S
1724 update map modes that are needed to draw text correctly. */
1725 SetPagebreakMode( rTabSett.mbPageMode );
1729 + if( !rTabSett.IsDefaultTabBgColor() )
1730 + rViewTab.aTabBgColor = rTabSett.maTabBgColor;
1734 --- sc/source/ui/view/viewfun2.cxx.old 2009-04-06 16:41:59.000000000 +0000
1735 +++ sc/source/ui/view/viewfun2.cxx 2009-04-06 16:42:06.000000000 +0000
1736 @@ -94,6 +94,7 @@ using namespace com::sun::star;
1737 #include "funcdesc.hxx"
1738 #include "docuno.hxx"
1740 +#include "tabbgcolor.hxx" //DBW
1742 // STATIC DATA ---------------------------------------------------------------
1744 @@ -2318,6 +2319,28 @@ BOOL ScViewFunc::RenameTable( const Stri
1746 //----------------------------------------------------------------------------
1748 +BOOL ScViewFunc::SetTabBgColor( const Color& rColor, SCTAB nTab )
1750 + BOOL bSuccess = GetViewData()->GetDocShell()->GetDocFunc().SetTabBgColor( nTab, rColor, TRUE, FALSE );
1753 + GetViewData()->GetViewShell()->UpdateInputHandler();
1758 +BOOL ScViewFunc::SetTabBgColor( ScUndoSetTabBgColorInfoList* rUndoSetTabBgColorInfoList )
1760 + BOOL bSuccess = GetViewData()->GetDocShell()->GetDocFunc().SetTabBgColor( rUndoSetTabBgColorInfoList, TRUE, FALSE );
1763 + GetViewData()->GetViewShell()->UpdateInputHandler();
1768 +//----------------------------------------------------------------------------
1770 void ScViewFunc::InsertAreaLink( const String& rFile,
1771 const String& rFilter, const String& rOptions,
1772 const String& rSource, ULONG nRefresh )
1773 --- sc/uiconfig/scalc/menubar/menubar.xml.old 2009-04-06 16:41:55.000000000 +0000
1774 +++ sc/uiconfig/scalc/menubar/menubar.xml 2009-04-06 16:42:06.000000000 +0000
1776 <menu:menuitem menu:id=".uno:Hide"/>
1777 <menu:menuitem menu:id=".uno:Show"/>
1778 <menu:menuitem menu:id=".uno:SheetRightToLeft"/>
1779 + <menu:menuseparator/>
1780 + <menu:menuitem menu:id=".uno:SetTabBgColor"/>
1783 <menu:menuitem menu:id=".uno:ToggleMergeCells"/>
1784 --- sc/util/makefile.mk.old 2009-04-06 16:42:01.000000000 +0000
1785 +++ sc/util/makefile.mk 2009-04-06 16:42:06.000000000 +0000
1786 @@ -258,6 +258,7 @@ LIB8OBJFILES = \
1787 $(SLO)$/attrdlg.obj \
1788 $(SLO)$/scuiimoptdlg.obj \
1789 $(SLO)$/strindlg.obj \
1790 + $(SLO)$/tabbgcolordlg.obj \
1791 $(SLO)$/shtabdlg.obj \
1792 $(SLO)$/scendlg.obj \
1793 $(SLO)$/pvfundlg.obj \