update dev300-m58
[ooovba.git] / applied_patches / 0016-cws-calctabcolor-oox.diff
blob9e37e21878121531eb973f2713d7b1f8d28a57c7
1 diff --git oox/inc/oox/xls/viewsettings.hxx oox/inc/oox/xls/viewsettings.hxx
2 index fceb1bc..f1160a1 100644
3 --- oox/inc/oox/xls/viewsettings.hxx
4 +++ oox/inc/oox/xls/viewsettings.hxx
5 @@ -83,6 +83,7 @@ struct SheetViewModel
6 bool mbShowZeros; /// True = show zero value zells.
7 bool mbShowOutline; /// True = show outlines.
8 bool mbZoomToFit; /// True = zoom chart sheet to fit window.
9 + Color maTabColor; /// Sheet tab color. (TODO: Move to sheet settings later.)
11 explicit SheetViewModel();
13 @@ -112,6 +113,8 @@ public:
15 /** Imports the sheetView element containing sheet view settings. */
16 void importSheetView( const AttributeList& rAttribs );
17 + /** Imports the tabcolor element containing tab color settings. */
18 + void importTabColor( const AttributeList& rAttribs );
19 /** Imports the pane element containing sheet pane settings. */
20 void importPane( const AttributeList& rAttribs );
21 /** Imports the selection element containing selection settings for a pane. */
22 diff --git oox/source/token/properties.txt oox/source/token/properties.txt
23 index 958a9ac..89a65cd 100644
24 --- oox/source/token/properties.txt
25 +++ oox/source/token/properties.txt
26 @@ -355,6 +355,7 @@ Suffix
27 SwapXAndYAxis
28 Symbol
29 SymbolColor
30 +TabColor
31 TableBorder
32 TableLayout
33 TableSelected
34 diff --git oox/source/xls/viewsettings.cxx oox/source/xls/viewsettings.cxx
35 index caeacaf..ce8c009 100644
36 --- oox/source/xls/viewsettings.cxx
37 +++ oox/source/xls/viewsettings.cxx
38 @@ -245,6 +245,12 @@ void SheetViewSettings::importSheetView( const AttributeList& rAttribs )
39 rModel.mbShowOutline = rAttribs.getBool( XML_showOutlineSymbols, true );
42 +void SheetViewSettings::importTabColor( const AttributeList& rAttribs )
44 + SheetViewModel& rModel = maSheetViews.empty() ? *createSheetView() : *maSheetViews.back();
45 + rModel.maTabColor.importColor( rAttribs );
48 void SheetViewSettings::importPane( const AttributeList& rAttribs )
50 OSL_ENSURE( !maSheetViews.empty(), "SheetViewSettings::importPane - missing sheet view model" );
51 @@ -589,6 +595,9 @@ void SheetViewSettings::finalizeImport()
52 aPropMap[ PROP_ShowZeroValues ] <<= xModel->mbShowZeros;
53 aPropMap[ PROP_IsOutlineSymbolsSet ] <<= xModel->mbShowOutline;
55 + if (!xModel->maTabColor.isAuto())
56 + aPropMap[ PROP_TabColor ] <<= static_cast< sal_Int32 >(xModel->maTabColor.getColor(*this));
58 // store sheet view settings in global view settings object
59 getViewSettings().setSheetViewSettings( getSheetIndex(), xModel, Any( aPropMap.makePropertyValueSequence() ) );
61 diff --git oox/source/xls/worksheetfragment.cxx oox/source/xls/worksheetfragment.cxx
62 index 4b75411..d2bed72 100644
63 --- oox/source/xls/worksheetfragment.cxx
64 +++ oox/source/xls/worksheetfragment.cxx
65 @@ -297,7 +297,9 @@ ContextHandlerRef OoxWorksheetFragment::onCreateContext( sal_Int32 nElement, con
66 case XLS_TOKEN( sheetPr ):
67 switch( nElement )
69 - case XLS_TOKEN( tabColor ): getWorksheetSettings().importTabColor( rAttribs ); break;
70 +// TODO: Treat tab color as a sheet setting later.
71 +// case XLS_TOKEN( tabColor ): getWorksheetSettings().importTabColor( rAttribs ); break;
72 + case XLS_TOKEN( tabColor ): getSheetViewSettings().importTabColor( rAttribs ); break;
73 case XLS_TOKEN( outlinePr ): getWorksheetSettings().importOutlinePr( rAttribs ); break;
74 case XLS_TOKEN( pageSetUpPr ): importPageSetUpPr( rAttribs ); break;