1 diff --git officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu
2 index d77187c..ab59975 100644
3 --- officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu
4 +++ officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu
6 <value xml:lang="en-US">S~hare Document...</value>
9 + <node oor:name=".uno:ToggleSheetGrid" oor:op="replace">
10 + <prop oor:name="Label" oor:type="xs:string">
11 + <value xml:lang="en-US">Toggle Grid Lines for Current Sheet</value>
13 + <prop oor:name="Properties" oor:type="xs:int">
18 <node oor:name="Popups">
19 <node oor:name=".uno:AuditMenu" oor:op="replace">
20 diff --git sc/inc/ViewSettingsSequenceDefines.hxx sc/inc/ViewSettingsSequenceDefines.hxx
21 index c720413..1143d9f 100644
22 --- sc/inc/ViewSettingsSequenceDefines.hxx
23 +++ sc/inc/ViewSettingsSequenceDefines.hxx
25 // this are the defines for the position of the settings in the
26 // TableViewSettingsSequence
28 -#define SC_TABLE_VIEWSETTINGS_COUNT 15
29 +#define SC_TABLE_VIEWSETTINGS_COUNT 16
34 #define SC_TABLE_ZOOM_VALUE 12
35 #define SC_TABLE_PAGE_VIEW_ZOOM_VALUE 13
36 #define SC_TABLE_TAB_BG_COLOR 14
37 +#define SC_TABLE_SHOWGRID 15
39 #define SC_CURSORPOSITIONX "CursorPositionX"
40 #define SC_CURSORPOSITIONY "CursorPositionY"
41 diff --git sc/inc/sc.hrc sc/inc/sc.hrc
42 index d7e1983..f7d4695 100644
46 // Autoformat for DataPilot
47 #define SID_PIVOT_AFMT (SC_OOO_BUILD_START + 4)
50 +#define FID_TAB_TOGGLE_GRID (SC_OOO_BUILD_START + 5)
55 diff --git sc/inc/scextopt.hxx sc/inc/scextopt.hxx
56 index 0e3866e..206ff20 100644
57 --- sc/inc/scextopt.hxx
58 +++ sc/inc/scextopt.hxx
59 @@ -80,6 +80,7 @@ struct ScExtTabSettings
60 bool mbSelected; /// true = Sheet is selected.
61 bool mbFrozenPanes; /// true = Frozen panes; false = Normal splits.
62 bool mbPageMode; /// true = Pagebreak mode; false = Normal view mode.
63 + bool mbShowGrid; /// Whether or not to display gridlines.
64 Color maTabBgColor; /// Tab Bg Color
65 bool IsDefaultTabBgColor() const { return maTabBgColor == Color(COL_AUTO) ? TRUE : FALSE; };
67 diff --git sc/sdi/docsh.sdi sc/sdi/docsh.sdi
68 index 4a773ab..e780e11 100644
71 @@ -64,6 +64,7 @@ interface TableSelection
72 FID_TAB_RENAME [ ExecMethod = ExecuteTable; StateMethod = GetStateTable; ]
73 FID_TAB_RTL [ ExecMethod = ExecuteTable; StateMethod = GetStateTable; ]
74 FID_TAB_SET_TAB_BG_COLOR [ ExecMethod = ExecuteTable; StateMethod = GetStateTable; ]
75 + FID_TAB_TOGGLE_GRID [ ExecMethod = ExecuteTable; StateMethod = GetStateTable; ]
77 SID_TABLE_ACTIVATE [ ExecMethod = Execute; ]
79 diff --git sc/sdi/scalc.sdi sc/sdi/scalc.sdi
80 index 11874e5..471ab26 100644
83 @@ -7875,6 +7875,33 @@ SfxVoidItem ShareDocument SID_SHARE_DOC
86 //--------------------------------------------------------------------------
87 +SfxBoolItem ToggleSheetGrid FID_TAB_TOGGLE_GRID
92 + Cachable = Cachable,
99 + RecordAbsolute = FALSE,
104 + AccelConfig = TRUE,
106 + StatusBarConfig = FALSE,
107 + ToolBoxConfig = TRUE,
108 + GroupId = GID_FORMAT;
113 +//--------------------------------------------------------------------------
114 SvxColorItem TabBgColor FID_TAB_SET_TAB_BG_COLOR
117 diff --git sc/source/filter/excel/xeview.cxx sc/source/filter/excel/xeview.cxx
118 index 81c5b9a..d15634b 100644
119 --- sc/source/filter/excel/xeview.cxx
120 +++ sc/source/filter/excel/xeview.cxx
121 @@ -316,7 +316,6 @@ XclExpTabViewSettings::XclExpTabViewSettings( const XclExpRoot& rRoot, SCTAB nSc
123 const ScViewOptions& rViewOpt = GetDoc().GetViewOptions();
124 maData.mbShowFormulas = rViewOpt.GetOption( VOPT_FORMULAS );
125 - maData.mbShowGrid = rViewOpt.GetOption( VOPT_GRID );
126 maData.mbShowHeadings = rViewOpt.GetOption( VOPT_HEADER );
127 maData.mbShowZeros = rViewOpt.GetOption( VOPT_NULLVALS );
128 maData.mbShowOutline = rViewOpt.GetOption( VOPT_OUTLINER );
129 @@ -391,6 +390,7 @@ XclExpTabViewSettings::XclExpTabViewSettings( const XclExpRoot& rRoot, SCTAB nSc
131 maData.maGridColor = rGridColor;
133 + maData.mbShowGrid = rTabSett.mbShowGrid;
135 // view mode and zoom
136 maData.mbPageMode = (GetBiff() == EXC_BIFF8) && rTabSett.mbPageMode;
137 diff --git sc/source/filter/excel/xiview.cxx sc/source/filter/excel/xiview.cxx
138 index fbd72d0..ce76483 100644
139 --- sc/source/filter/excel/xiview.cxx
140 +++ sc/source/filter/excel/xiview.cxx
141 @@ -277,6 +277,9 @@ void XclImpTabViewSettings::Finalize()
143 rTabSett.maGridColor = maData.maGridColor;
145 + // show grid option
146 + rTabSett.mbShowGrid = maData.mbShowGrid;
148 // view mode and zoom
149 if( maData.mnCurrentZoom != 0 )
150 (maData.mbPageMode ? maData.mnPageZoom : maData.mnNormalZoom) = maData.mnCurrentZoom;
151 @@ -291,7 +294,6 @@ void XclImpTabViewSettings::Finalize()
152 // set Excel sheet settings globally at Calc document, take settings from displayed sheet
153 ScViewOptions aViewOpt( rDoc.GetViewOptions() );
154 aViewOpt.SetOption( VOPT_FORMULAS, maData.mbShowFormulas );
155 - aViewOpt.SetOption( VOPT_GRID, maData.mbShowGrid );
156 aViewOpt.SetOption( VOPT_HEADER, maData.mbShowHeadings );
157 aViewOpt.SetOption( VOPT_NULLVALS, maData.mbShowZeros );
158 aViewOpt.SetOption( VOPT_OUTLINER, maData.mbShowOutline );
159 diff --git sc/source/ui/inc/viewdata.hxx sc/source/ui/inc/viewdata.hxx
160 index c66083f..c77088e 100644
161 --- sc/source/ui/inc/viewdata.hxx
162 +++ sc/source/ui/inc/viewdata.hxx
163 @@ -149,6 +149,8 @@ private:
167 + bool bShowGrid; // per-sheet show grid-lines option.
169 BOOL bOldCurValid; // "virtuelle" Cursorpos. bei zusammengefassten
172 @@ -339,6 +341,9 @@ public:
173 const Fraction& GetZoomX() const { return bPagebreak ? pThisTab->aPageZoomX : pThisTab->aZoomX; }
174 const Fraction& GetZoomY() const { return bPagebreak ? pThisTab->aPageZoomY : pThisTab->aZoomY; }
176 + void SetShowGrid( bool bShow );
177 + bool GetShowGrid() const { return pThisTab->bShowGrid; }
179 const MapMode& GetLogicMode( ScSplitPos eWhich );
180 const MapMode& GetLogicMode(); // Offset 0
182 diff --git sc/source/ui/view/gridwin4.cxx sc/source/ui/view/gridwin4.cxx
183 index 10db2f6..8a9d867 100644
184 --- sc/source/ui/view/gridwin4.cxx
185 +++ sc/source/ui/view/gridwin4.cxx
186 @@ -573,7 +573,8 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
187 aOutputData.SetEditObject( GetEditObject() );
188 aOutputData.SetViewShell( pViewData->GetViewShell() );
190 - BOOL bGrid = rOpts.GetOption( VOPT_GRID );
191 + BOOL bGrid = rOpts.GetOption( VOPT_GRID ) && pViewData->GetShowGrid();
193 BOOL bPage = rOpts.GetOption( VOPT_PAGEBREAKS );
195 if ( eMode == SC_UPDATE_CHANGED )
196 diff --git sc/source/ui/view/scextopt.cxx sc/source/ui/view/scextopt.cxx
197 index fd28d95..8ca5fc2 100644
198 --- sc/source/ui/view/scextopt.cxx
199 +++ sc/source/ui/view/scextopt.cxx
200 @@ -62,6 +62,7 @@ ScExtTabSettings::ScExtTabSettings() :
202 mbFrozenPanes( false ),
204 + mbShowGrid( true ),
205 maTabBgColor( COL_AUTO)
208 diff --git sc/source/ui/view/tabvwshf.cxx sc/source/ui/view/tabvwshf.cxx
209 index c65b62a..971e646 100644
210 --- sc/source/ui/view/tabvwshf.cxx
211 +++ sc/source/ui/view/tabvwshf.cxx
214 #include "scitems.hxx"
215 #include <sfx2/request.hxx>
216 +#include <sfx2/bindings.hxx>
217 +#include <sfx2/viewfrm.hxx>
218 #include <basic/sbstar.hxx>
219 #include <layout/layout.hxx>
220 #include <svtools/languageoptions.hxx>
221 @@ -690,6 +692,17 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
225 + case FID_TAB_TOGGLE_GRID:
227 + bool bShowGrid = pViewData->GetShowGrid();
228 + pViewData->SetShowGrid(!bShowGrid);
229 + SfxBindings& rBindings = GetViewFrame()->GetBindings();
230 + rBindings.Invalidate( FID_TAB_TOGGLE_GRID );
236 case FID_TAB_SET_TAB_BG_COLOR:
237 case FID_TAB_MENU_SET_TAB_BG_COLOR:
239 @@ -939,6 +952,10 @@ void ScTabViewShell::GetStateTable( SfxItemSet& rSet )
240 rSet.Put( SvxColorItem( aColor, nWhich ) );
244 + case FID_TAB_TOGGLE_GRID:
245 + rSet.Put( SfxBoolItem(nWhich, pViewData->GetShowGrid()) );
248 nWhich = aIter.NextWhich();
250 diff --git sc/source/ui/view/viewdata.cxx sc/source/ui/view/viewdata.cxx
251 index 23e0e59..8f458db 100644
252 --- sc/source/ui/view/viewdata.cxx
253 +++ sc/source/ui/view/viewdata.cxx
254 @@ -104,6 +104,7 @@ ScViewDataTable::ScViewDataTable() :
259 bOldCurValid( FALSE ),
260 aTabBgColor( Color(COL_AUTO) )
262 @@ -165,6 +166,10 @@ void ScViewDataTable::WriteUserDataSequence(uno::Sequence <beans::PropertyValue>
263 pSettings[SC_TABLE_PAGE_VIEW_ZOOM_VALUE].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_PAGEVIEWZOOMVALUE));
264 pSettings[SC_TABLE_PAGE_VIEW_ZOOM_VALUE].Value <<= nPageZoomValue;
266 + pSettings[SC_TABLE_SHOWGRID].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNO_SHOWGRID));
267 + pSettings[SC_TABLE_SHOWGRID].Value <<= static_cast<sal_Bool>(bShowGrid);
270 if ( !IsDefaultTabBgColor() )
272 pSettings[SC_TABLE_TAB_BG_COLOR].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNO_TABCOLOR));
273 @@ -276,6 +281,10 @@ void ScViewDataTable::ReadUserDataSequence(const uno::Sequence <beans::PropertyV
274 aPageZoomX = aPageZoomY = aZoom;
277 + else if (sName.compareToAscii(SC_UNO_SHOWGRID) == 0)
279 + aSettings[i].Value >>= bShowGrid;
281 else if (sName.compareToAscii(SC_TABLESELECTED) == 0)
283 bool bSelected = false;
284 @@ -704,6 +713,12 @@ void ScViewData::SetZoom( const Fraction& rNewX, const Fraction& rNewY, BOOL bAl
288 +void ScViewData::SetShowGrid( bool bShow )
290 + CreateSelectedTabData();
291 + pTabData[nTabNo]->bShowGrid = bShow;
294 void ScViewData::RefreshZoom()
296 // recalculate zoom-dependent values (only for current sheet)
297 @@ -2500,6 +2515,7 @@ void ScViewData::WriteExtOptions( ScExtDocOptions& rDocOpt ) const
298 if( rGridColor.GetColor() != SC_STD_GRIDCOLOR )
299 rTabSett.maGridColor = rGridColor;
301 + rTabSett.mbShowGrid = pViewTab->bShowGrid;
303 // view mode and zoom
304 rTabSett.mbPageMode = bPagebreak;
305 @@ -2635,6 +2651,8 @@ void ScViewData::ReadExtOptions( const ScExtDocOptions& rDocOpt )
306 if( rTabSett.mnPageZoom )
307 rViewTab.aPageZoomX = rViewTab.aPageZoomY = Fraction( rTabSett.mnPageZoom, 100L );
309 + rViewTab.bShowGrid = rTabSett.mbShowGrid;
311 // get some settings from displayed Excel sheet, set at Calc document
312 if( nTab == GetTabNo() )
314 diff --git sc/uiconfig/scalc/toolbar/formatobjectbar.xml sc/uiconfig/scalc/toolbar/formatobjectbar.xml
315 index 49c31d7..773befc 100644
316 --- sc/uiconfig/scalc/toolbar/formatobjectbar.xml
317 +++ sc/uiconfig/scalc/toolbar/formatobjectbar.xml
319 <toolbar:toolbaritem xlink:href=".uno:InsertColumns" toolbar:helpid="helpid:26268" toolbar:visible="false" />
320 <toolbar:toolbaritem xlink:href=".uno:DeleteRows" toolbar:helpid="helpid:26236" toolbar:visible="false" />
321 <toolbar:toolbaritem xlink:href=".uno:DeleteColumns" toolbar:helpid="helpid:26237" toolbar:visible="false" />
322 + <toolbar:toolbarseparator/>
323 + <toolbar:toolbaritem xlink:href=".uno:ToggleSheetGrid" toolbar:helpid="helpid:26238" toolbar:visible="true" />