xref: /aoo42x/main/sc/source/ui/optdlg/tpview.cxx (revision 056e29a5)
1b3f79822SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3b3f79822SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4b3f79822SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5b3f79822SAndrew Rist  * distributed with this work for additional information
6b3f79822SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7b3f79822SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8b3f79822SAndrew Rist  * "License"); you may not use this file except in compliance
9b3f79822SAndrew Rist  * with the License.  You may obtain a copy of the License at
10b3f79822SAndrew Rist  *
11b3f79822SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12b3f79822SAndrew Rist  *
13b3f79822SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14b3f79822SAndrew Rist  * software distributed under the License is distributed on an
15b3f79822SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16b3f79822SAndrew Rist  * KIND, either express or implied.  See the License for the
17b3f79822SAndrew Rist  * specific language governing permissions and limitations
18b3f79822SAndrew Rist  * under the License.
19b3f79822SAndrew Rist  *
20b3f79822SAndrew Rist  *************************************************************/
21b3f79822SAndrew Rist 
22b3f79822SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25b77af630Sdamjan #include "precompiled_scui.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir 
28cdf0e10cSrcweir //------------------------------------------------------------------
29cdf0e10cSrcweir 
30cdf0e10cSrcweir #include "scitems.hxx"
31cdf0e10cSrcweir #include "tpview.hxx"
32cdf0e10cSrcweir #include "global.hxx"
33cdf0e10cSrcweir #include "viewopti.hxx"
34cdf0e10cSrcweir #include "tabvwsh.hxx"
35cdf0e10cSrcweir #include "uiitems.hxx"
36cdf0e10cSrcweir #include "scresid.hxx"
37cdf0e10cSrcweir #include "docsh.hxx"
38cdf0e10cSrcweir #include "sc.hrc"       // -> Slot-IDs
39cdf0e10cSrcweir #include "optdlg.hrc"
40cdf0e10cSrcweir #include "globstr.hrc"
41cdf0e10cSrcweir #include <appoptio.hxx>
42cdf0e10cSrcweir #include <scmod.hxx>
43cdf0e10cSrcweir #include <svx/dlgutil.hxx>
44cdf0e10cSrcweir #include <svx/drawitem.hxx>
45cdf0e10cSrcweir #include <svx/xtable.hxx>
46cdf0e10cSrcweir 
47cdf0e10cSrcweir 
48cdf0e10cSrcweir // STATIC DATA -----------------------------------------------------------
49cdf0e10cSrcweir 
50cdf0e10cSrcweir 
51cdf0e10cSrcweir 
52cdf0e10cSrcweir /*-----------------11.01.97 10.52-------------------
53cdf0e10cSrcweir 	Optionen Inhalte
54cdf0e10cSrcweir --------------------------------------------------*/
55cdf0e10cSrcweir 
ScTpContentOptions(Window * pParent,const SfxItemSet & rArgSet)56cdf0e10cSrcweir ScTpContentOptions::ScTpContentOptions( Window*			pParent,
57cdf0e10cSrcweir 							 const SfxItemSet&	rArgSet ) :
58cdf0e10cSrcweir 	SfxTabPage(pParent, ScResId( RID_SCPAGE_CONTENT ), rArgSet),
59cdf0e10cSrcweir 
60cdf0e10cSrcweir     aLinesGB( this,         ScResId(GB_LINES          )),
61cdf0e10cSrcweir 	aGridCB( this, 			ScResId(CB_GRID			)),
62cdf0e10cSrcweir 	aColorFT( this, 		ScResId(FT_COLOR			)),
63cdf0e10cSrcweir 	aColorLB( this, 		ScResId(LB_COLOR			)),
64cdf0e10cSrcweir 	aBreakCB( this,			ScResId(CB_PAGEBREAKS		)),
65cdf0e10cSrcweir 	aGuideLineCB( this, 	ScResId(CB_GUIDELINE		)),
66cdf0e10cSrcweir 	aBigHandleCB( this,	 	ScResId(CB_BIGHANDLES		)),
67cdf0e10cSrcweir 
68cdf0e10cSrcweir     aSeparator1FL    (this, ScResId(FL_SEPARATOR1 )),
69cdf0e10cSrcweir     aDisplayGB( this,   ScResId(GB_DISPLAY)),
70cdf0e10cSrcweir 	aFormulaCB( this, 	ScResId(CB_FORMULA)),
71cdf0e10cSrcweir 	aNilCB( this, 		ScResId(CB_NIL	)),
72cdf0e10cSrcweir 	aAnnotCB( this, 	ScResId(CB_ANNOT	)),
73cdf0e10cSrcweir 	aValueCB( this, 	ScResId(CB_VALUE	)),
74cdf0e10cSrcweir 	aAnchorCB( this, 	ScResId(CB_ANCHOR	)),
75cdf0e10cSrcweir 	aClipMarkCB( this, 	ScResId(CB_CLIP	)),
76cdf0e10cSrcweir     aRangeFindCB( this,     ScResId( CB_RFIND     )),
77cdf0e10cSrcweir 
78cdf0e10cSrcweir     aObjectGB( this,    ScResId(GB_OBJECT )),
79cdf0e10cSrcweir 	aObjGrfFT( this, 	ScResId(FT_OBJGRF	)),
80cdf0e10cSrcweir 	aObjGrfLB( this, 	ScResId(LB_OBJGRF	)),
81cdf0e10cSrcweir     aDiagramFT( this,   ScResId(FT_DIAGRAM)),
82cdf0e10cSrcweir 	aDiagramLB( this, 	ScResId(LB_DIAGRAM)),
83cdf0e10cSrcweir 	aDrawFT( this, 		ScResId(FT_DRAW	)),
84cdf0e10cSrcweir 	aDrawLB( this, 		ScResId(LB_DRAW	)),
85cdf0e10cSrcweir 
86cdf0e10cSrcweir     aZoomGB( this,      ScResId(GB_ZOOM) ),
87cdf0e10cSrcweir     aSyncZoomCB( this,  ScResId(CB_SYNCZOOM) ),
88cdf0e10cSrcweir 
89cdf0e10cSrcweir     aSeparator2FL    (this, ScResId(FL_SEPARATOR2)),
90cdf0e10cSrcweir     aWindowGB( this,        ScResId(GB_WINDOW         )),
91cdf0e10cSrcweir 	aRowColHeaderCB(this,	ScResId(CB_ROWCOLHEADER	)),
92cdf0e10cSrcweir 	aHScrollCB( this, 		ScResId(CB_HSCROLL		)),
93cdf0e10cSrcweir 	aVScrollCB( this, 		ScResId(CB_VSCROLL		)),
94cdf0e10cSrcweir 	aTblRegCB( this, 		ScResId(CB_TBLREG			)),
95cdf0e10cSrcweir 	aOutlineCB( this, 		ScResId(CB_OUTLINE		)),
96cdf0e10cSrcweir     pLocalOptions(0)
97cdf0e10cSrcweir {
98cdf0e10cSrcweir 	FreeResource();
99cdf0e10cSrcweir     aSeparator1FL.SetStyle( aSeparator1FL.GetStyle() | WB_VERT );
100cdf0e10cSrcweir     aSeparator2FL.SetStyle( aSeparator2FL.GetStyle() | WB_VERT );
101cdf0e10cSrcweir     SetExchangeSupport();
102cdf0e10cSrcweir     Link aSelObjHdl(LINK( this, ScTpContentOptions, SelLbObjHdl ) );
103cdf0e10cSrcweir     aObjGrfLB.  SetSelectHdl(aSelObjHdl);
104cdf0e10cSrcweir     aDiagramLB. SetSelectHdl(aSelObjHdl);
105cdf0e10cSrcweir     aDrawLB.    SetSelectHdl(aSelObjHdl);
106cdf0e10cSrcweir 
107cdf0e10cSrcweir     Link aCBHdl(LINK( this, ScTpContentOptions, CBHdl ) );
108cdf0e10cSrcweir     aFormulaCB  .SetClickHdl(aCBHdl);
109cdf0e10cSrcweir     aNilCB      .SetClickHdl(aCBHdl);
110cdf0e10cSrcweir     aAnnotCB    .SetClickHdl(aCBHdl);
111cdf0e10cSrcweir     aValueCB    .SetClickHdl(aCBHdl);
112cdf0e10cSrcweir     aAnchorCB   .SetClickHdl(aCBHdl);
113cdf0e10cSrcweir     aClipMarkCB .SetClickHdl(aCBHdl);
114cdf0e10cSrcweir 
115cdf0e10cSrcweir     aVScrollCB  .SetClickHdl(aCBHdl);
116cdf0e10cSrcweir     aHScrollCB  .SetClickHdl(aCBHdl);
117cdf0e10cSrcweir     aTblRegCB   .SetClickHdl(aCBHdl);
118cdf0e10cSrcweir     aOutlineCB  .SetClickHdl(aCBHdl);
119cdf0e10cSrcweir     aBreakCB    .SetClickHdl(aCBHdl);
120cdf0e10cSrcweir     aGuideLineCB.SetClickHdl(aCBHdl);
121cdf0e10cSrcweir     aBigHandleCB.SetClickHdl(aCBHdl);
122cdf0e10cSrcweir     aRowColHeaderCB.SetClickHdl(aCBHdl);
123cdf0e10cSrcweir 
124cdf0e10cSrcweir     aGridCB     .SetClickHdl( LINK( this, ScTpContentOptions, GridHdl ) );
125cdf0e10cSrcweir }
126cdf0e10cSrcweir /*-----------------11.01.97 10.52-------------------
127cdf0e10cSrcweir 
128cdf0e10cSrcweir --------------------------------------------------*/
129cdf0e10cSrcweir 
~ScTpContentOptions()130cdf0e10cSrcweir ScTpContentOptions::~ScTpContentOptions()
131cdf0e10cSrcweir {
132cdf0e10cSrcweir 	delete pLocalOptions;
133cdf0e10cSrcweir }
134cdf0e10cSrcweir /*-----------------11.01.97 10.52-------------------
135cdf0e10cSrcweir 
136cdf0e10cSrcweir --------------------------------------------------*/
137cdf0e10cSrcweir 
Create(Window * pParent,const SfxItemSet & rCoreSet)138cdf0e10cSrcweir SfxTabPage*	ScTpContentOptions::Create( Window*		pParent,
139cdf0e10cSrcweir 							  const SfxItemSet&		rCoreSet )
140cdf0e10cSrcweir {
141cdf0e10cSrcweir 	return new ScTpContentOptions(pParent, rCoreSet);
142cdf0e10cSrcweir }
143cdf0e10cSrcweir /*-----------------11.01.97 10.52-------------------
144cdf0e10cSrcweir 
145cdf0e10cSrcweir --------------------------------------------------*/
FillItemSet(SfxItemSet & rCoreSet)146cdf0e10cSrcweir sal_Bool	ScTpContentOptions::FillItemSet( SfxItemSet& rCoreSet )
147cdf0e10cSrcweir {
148cdf0e10cSrcweir 	sal_Bool bRet = sal_False;
149cdf0e10cSrcweir 	if(	aFormulaCB	.GetSavedValue() != aFormulaCB	.IsChecked() ||
150cdf0e10cSrcweir 		aNilCB		.GetSavedValue() != aNilCB		.IsChecked() ||
151cdf0e10cSrcweir 		aAnnotCB  	.GetSavedValue() != aAnnotCB	.IsChecked() ||
152cdf0e10cSrcweir 		aValueCB  	.GetSavedValue() != aValueCB  	.IsChecked() ||
153cdf0e10cSrcweir 		aAnchorCB 	.GetSavedValue() != aAnchorCB 	.IsChecked() ||
154cdf0e10cSrcweir 		aClipMarkCB	.GetSavedValue() != aClipMarkCB	.IsChecked() ||
155cdf0e10cSrcweir 		aObjGrfLB   .GetSavedValue() != aObjGrfLB  	.GetSelectEntryPos() ||
156cdf0e10cSrcweir 		aDiagramLB  .GetSavedValue() != aDiagramLB 	.GetSelectEntryPos() ||
157cdf0e10cSrcweir         aDrawLB     .GetSavedValue() != aDrawLB     .GetSelectEntryPos() ||
158cdf0e10cSrcweir         aGridCB         .GetSavedValue() != aGridCB.IsChecked() ||
159cdf0e10cSrcweir 		aRowColHeaderCB	.GetSavedValue() != aRowColHeaderCB.IsChecked() ||
160cdf0e10cSrcweir 		aHScrollCB      .GetSavedValue() != aHScrollCB     .IsChecked() ||
161cdf0e10cSrcweir 		aVScrollCB      .GetSavedValue() != aVScrollCB     .IsChecked() ||
162cdf0e10cSrcweir 		aTblRegCB       .GetSavedValue() != aTblRegCB      .IsChecked() ||
163cdf0e10cSrcweir 		aOutlineCB      .GetSavedValue() != aOutlineCB     .IsChecked() ||
164cdf0e10cSrcweir 		aColorLB        .GetSavedValue() != aColorLB       .GetSelectEntryPos() ||
165cdf0e10cSrcweir 		aBreakCB		.GetSavedValue() != aBreakCB	   .IsChecked() ||
166cdf0e10cSrcweir 		aGuideLineCB    .GetSavedValue() != aGuideLineCB   .IsChecked() ||
167cdf0e10cSrcweir         aBigHandleCB    .GetSavedValue() != aBigHandleCB   .IsChecked())
168cdf0e10cSrcweir 	{
169cdf0e10cSrcweir         pLocalOptions->SetGridColor( aColorLB.GetSelectEntryColor(),
170cdf0e10cSrcweir 									 aColorLB.GetSelectEntry() );
171cdf0e10cSrcweir         rCoreSet.Put(ScTpViewItem(SID_SCVIEWOPTIONS, *pLocalOptions));
172cdf0e10cSrcweir 		bRet = sal_True;
173cdf0e10cSrcweir 	}
174cdf0e10cSrcweir     if(aRangeFindCB.GetSavedValue() != aRangeFindCB.IsChecked())
175cdf0e10cSrcweir     {
176cdf0e10cSrcweir         rCoreSet.Put(SfxBoolItem(SID_SC_INPUT_RANGEFINDER, aRangeFindCB.IsChecked()));
177cdf0e10cSrcweir         bRet = sal_True;
178cdf0e10cSrcweir     }
179cdf0e10cSrcweir     if(aSyncZoomCB.GetSavedValue() != aSyncZoomCB.IsChecked())
180cdf0e10cSrcweir     {
181cdf0e10cSrcweir         rCoreSet.Put(SfxBoolItem(SID_SC_OPT_SYNCZOOM, aSyncZoomCB.IsChecked()));
182cdf0e10cSrcweir         bRet = sal_True;
183cdf0e10cSrcweir     }
184cdf0e10cSrcweir 
185cdf0e10cSrcweir 
186cdf0e10cSrcweir     return bRet;
187cdf0e10cSrcweir }
188cdf0e10cSrcweir /*-----------------11.01.97 10.53-------------------
189cdf0e10cSrcweir 
190cdf0e10cSrcweir --------------------------------------------------*/
191cdf0e10cSrcweir 
Reset(const SfxItemSet & rCoreSet)192cdf0e10cSrcweir void	ScTpContentOptions::Reset( const SfxItemSet& rCoreSet )
193cdf0e10cSrcweir {
194cdf0e10cSrcweir 	const SfxPoolItem* pItem;
195cdf0e10cSrcweir 	if(SFX_ITEM_SET == rCoreSet.GetItemState(SID_SCVIEWOPTIONS, sal_False , &pItem))
196cdf0e10cSrcweir 		pLocalOptions  = new ScViewOptions(
197cdf0e10cSrcweir 							((const ScTpViewItem*)pItem)->GetViewOptions() );
198cdf0e10cSrcweir 	else
199cdf0e10cSrcweir 		pLocalOptions = new ScViewOptions;
200cdf0e10cSrcweir 	aFormulaCB	.Check(pLocalOptions->GetOption(VOPT_FORMULAS));
201cdf0e10cSrcweir 	aNilCB		.Check(pLocalOptions->GetOption(VOPT_NULLVALS));
202cdf0e10cSrcweir 	aAnnotCB  	.Check(pLocalOptions->GetOption(VOPT_NOTES));
203cdf0e10cSrcweir 	aValueCB  	.Check(pLocalOptions->GetOption(VOPT_SYNTAX));
204cdf0e10cSrcweir 	aAnchorCB 	.Check(pLocalOptions->GetOption(VOPT_ANCHOR));
205cdf0e10cSrcweir 	aClipMarkCB	.Check(pLocalOptions->GetOption(VOPT_CLIPMARKS));
206cdf0e10cSrcweir 
207cdf0e10cSrcweir 	aObjGrfLB 	.SelectEntryPos( (sal_uInt16)pLocalOptions->GetObjMode(VOBJ_TYPE_OLE) );
208cdf0e10cSrcweir 	aDiagramLB  .SelectEntryPos( (sal_uInt16)pLocalOptions->GetObjMode(VOBJ_TYPE_CHART) );
209cdf0e10cSrcweir 	aDrawLB     .SelectEntryPos( (sal_uInt16)pLocalOptions->GetObjMode(VOBJ_TYPE_DRAW) );
210cdf0e10cSrcweir 
211cdf0e10cSrcweir 	aRowColHeaderCB.Check( pLocalOptions->GetOption(VOPT_HEADER) );
212cdf0e10cSrcweir 	aHScrollCB .Check( pLocalOptions->GetOption(VOPT_HSCROLL) );
213cdf0e10cSrcweir 	aVScrollCB .Check( pLocalOptions->GetOption(VOPT_VSCROLL) );
214cdf0e10cSrcweir 	aTblRegCB  .Check( pLocalOptions->GetOption(VOPT_TABCONTROLS) );
215cdf0e10cSrcweir 	aOutlineCB .Check( pLocalOptions->GetOption(VOPT_OUTLINER) );
216cdf0e10cSrcweir 
217cdf0e10cSrcweir 	InitGridOpt();
218cdf0e10cSrcweir 
219cdf0e10cSrcweir 	aBreakCB.Check( pLocalOptions->GetOption(VOPT_PAGEBREAKS) );
220cdf0e10cSrcweir 	aGuideLineCB.Check( pLocalOptions->GetOption(VOPT_HELPLINES) );
221cdf0e10cSrcweir 	aBigHandleCB.Check( pLocalOptions->GetOption(VOPT_BIGHANDLES) );
222cdf0e10cSrcweir 
223cdf0e10cSrcweir     if(SFX_ITEM_SET == rCoreSet.GetItemState(SID_SC_INPUT_RANGEFINDER, sal_False, &pItem))
224cdf0e10cSrcweir 		aRangeFindCB.Check(((const SfxBoolItem*)pItem)->GetValue());
225cdf0e10cSrcweir     if(SFX_ITEM_SET == rCoreSet.GetItemState(SID_SC_OPT_SYNCZOOM, sal_False, &pItem))
226cdf0e10cSrcweir 		aSyncZoomCB.Check(((const SfxBoolItem*)pItem)->GetValue());
227cdf0e10cSrcweir 
228cdf0e10cSrcweir     aRangeFindCB.SaveValue();
229cdf0e10cSrcweir     aSyncZoomCB.SaveValue();
230cdf0e10cSrcweir 
231cdf0e10cSrcweir     aFormulaCB  .SaveValue();
232cdf0e10cSrcweir 	aNilCB		.SaveValue();
233cdf0e10cSrcweir 	aAnnotCB  	.SaveValue();
234cdf0e10cSrcweir 	aValueCB  	.SaveValue();
235cdf0e10cSrcweir 	aAnchorCB 	.SaveValue();
236cdf0e10cSrcweir 	aClipMarkCB	.SaveValue();
237cdf0e10cSrcweir 	aObjGrfLB   .SaveValue();
238cdf0e10cSrcweir 	aDiagramLB  .SaveValue();
239cdf0e10cSrcweir 	aDrawLB     .SaveValue();
240cdf0e10cSrcweir     aRowColHeaderCB .SaveValue();
241cdf0e10cSrcweir 	aHScrollCB      .SaveValue();
242cdf0e10cSrcweir 	aVScrollCB      .SaveValue();
243cdf0e10cSrcweir 	aTblRegCB       .SaveValue();
244cdf0e10cSrcweir 	aOutlineCB      .SaveValue();
245cdf0e10cSrcweir 	aGridCB         .SaveValue();
246cdf0e10cSrcweir 	aColorLB        .SaveValue();
247cdf0e10cSrcweir 	aBreakCB		.SaveValue();
248cdf0e10cSrcweir 	aGuideLineCB    .SaveValue();
249cdf0e10cSrcweir 	aBigHandleCB	.SaveValue();
250cdf0e10cSrcweir }
251cdf0e10cSrcweir /*-----------------11.01.97 12.45-------------------
252cdf0e10cSrcweir 
253cdf0e10cSrcweir --------------------------------------------------*/
254cdf0e10cSrcweir 
ActivatePage(const SfxItemSet & rSet)255cdf0e10cSrcweir void ScTpContentOptions::ActivatePage( const SfxItemSet& rSet)
256cdf0e10cSrcweir {
257cdf0e10cSrcweir 	const SfxPoolItem* pItem;
258cdf0e10cSrcweir 	if(SFX_ITEM_SET == rSet.GetItemState(SID_SCVIEWOPTIONS, sal_False , &pItem))
259cdf0e10cSrcweir 		*pLocalOptions = ((const ScTpViewItem*)pItem)->GetViewOptions();
260cdf0e10cSrcweir }
261cdf0e10cSrcweir /*-----------------11.01.97 12.45-------------------
262cdf0e10cSrcweir 
263cdf0e10cSrcweir --------------------------------------------------*/
264cdf0e10cSrcweir 
DeactivatePage(SfxItemSet * pSetP)265cdf0e10cSrcweir int	ScTpContentOptions::DeactivatePage( SfxItemSet* pSetP )
266cdf0e10cSrcweir {
267cdf0e10cSrcweir     if(pSetP)
268cdf0e10cSrcweir         FillItemSet(*pSetP);
269cdf0e10cSrcweir 	return SfxTabPage::LEAVE_PAGE;
270cdf0e10cSrcweir }
271cdf0e10cSrcweir /*-----------------11.01.97 13.43-------------------
272cdf0e10cSrcweir 
273cdf0e10cSrcweir --------------------------------------------------*/
274cdf0e10cSrcweir 
IMPL_LINK(ScTpContentOptions,SelLbObjHdl,ListBox *,pLb)275cdf0e10cSrcweir IMPL_LINK( ScTpContentOptions, SelLbObjHdl, ListBox*, pLb )
276cdf0e10cSrcweir {
277cdf0e10cSrcweir 	sal_uInt16		nSelPos = pLb->GetSelectEntryPos();
278cdf0e10cSrcweir 	ScVObjMode	eMode	= ScVObjMode(nSelPos);
279cdf0e10cSrcweir 	ScVObjType	eType	= VOBJ_TYPE_OLE;
280cdf0e10cSrcweir 
281cdf0e10cSrcweir 	if ( pLb == &aDiagramLB )
282cdf0e10cSrcweir 		eType = VOBJ_TYPE_CHART;
283cdf0e10cSrcweir 	else if ( pLb == &aDrawLB )
284cdf0e10cSrcweir 		eType = VOBJ_TYPE_DRAW;
285cdf0e10cSrcweir 
286cdf0e10cSrcweir 	pLocalOptions->SetObjMode( eType, eMode );
287cdf0e10cSrcweir 
288cdf0e10cSrcweir 	return 0;
289cdf0e10cSrcweir }
290cdf0e10cSrcweir 
291cdf0e10cSrcweir /*-----------------11.01.97 14.25-------------------
292cdf0e10cSrcweir 
293cdf0e10cSrcweir --------------------------------------------------*/
294cdf0e10cSrcweir 
IMPL_LINK(ScTpContentOptions,CBHdl,CheckBox *,pBtn)295cdf0e10cSrcweir IMPL_LINK( ScTpContentOptions, CBHdl, CheckBox*, pBtn )
296cdf0e10cSrcweir {
297cdf0e10cSrcweir     ScViewOption eOption = VOPT_FORMULAS;
298cdf0e10cSrcweir 	sal_Bool		 bChecked = pBtn->IsChecked();
299cdf0e10cSrcweir 
300cdf0e10cSrcweir 	if ( 	  &aFormulaCB 	== pBtn )	eOption = VOPT_FORMULAS;
301cdf0e10cSrcweir 	else if ( &aNilCB 		== pBtn )	eOption = VOPT_NULLVALS;
302cdf0e10cSrcweir 	else if ( &aAnnotCB		== pBtn )	eOption = VOPT_NOTES;
303cdf0e10cSrcweir 	else if ( &aValueCB		== pBtn )	eOption = VOPT_SYNTAX;
304cdf0e10cSrcweir 	else if ( &aAnchorCB	== pBtn )   eOption = VOPT_ANCHOR;
305cdf0e10cSrcweir 	else if ( &aClipMarkCB	== pBtn )   eOption = VOPT_CLIPMARKS;
306cdf0e10cSrcweir     else if ( &aVScrollCB       == pBtn )   eOption = VOPT_VSCROLL;
307cdf0e10cSrcweir 	else if ( &aHScrollCB		== pBtn )	eOption = VOPT_HSCROLL;
308cdf0e10cSrcweir 	else if ( &aTblRegCB		== pBtn )	eOption = VOPT_TABCONTROLS;
309cdf0e10cSrcweir 	else if ( &aOutlineCB 		== pBtn )	eOption = VOPT_OUTLINER;
310cdf0e10cSrcweir 	else if ( &aBreakCB			== pBtn )	eOption = VOPT_PAGEBREAKS;
311cdf0e10cSrcweir 	else if ( &aGuideLineCB 	== pBtn )	eOption = VOPT_HELPLINES;
312cdf0e10cSrcweir 	else if ( &aBigHandleCB	 	== pBtn )	eOption = VOPT_BIGHANDLES;
313cdf0e10cSrcweir 	else if ( &aRowColHeaderCB 	== pBtn )	eOption = VOPT_HEADER;
314cdf0e10cSrcweir 
315*056e29a5Smseidel 	pLocalOptions->SetOption( eOption, bChecked );
316*056e29a5Smseidel 
317cdf0e10cSrcweir 	return 0;
318cdf0e10cSrcweir }
319cdf0e10cSrcweir /*-----------------11.01.97 13.13-------------------
320cdf0e10cSrcweir 
321cdf0e10cSrcweir --------------------------------------------------*/
322cdf0e10cSrcweir 
InitGridOpt()323cdf0e10cSrcweir void ScTpContentOptions::InitGridOpt()
324cdf0e10cSrcweir {
325cdf0e10cSrcweir 	sal_Bool bGrid = pLocalOptions->GetOption( VOPT_GRID );
326cdf0e10cSrcweir 
327cdf0e10cSrcweir 	aGridCB.Check( bGrid );
328cdf0e10cSrcweir 
329cdf0e10cSrcweir 	if ( bGrid )
330cdf0e10cSrcweir 		aColorFT.Enable(), aColorLB.Enable();
331cdf0e10cSrcweir 	else
332cdf0e10cSrcweir 		aColorFT.Disable(), aColorLB.Disable();
333cdf0e10cSrcweir 
334cdf0e10cSrcweir 	if ( aColorLB.GetEntryCount() == 0 )
335cdf0e10cSrcweir 	{
336cdf0e10cSrcweir 		SfxObjectShell*	pDocSh = SfxObjectShell::Current();
337cdf0e10cSrcweir 		// hier koennte auch eine andere DocShell kommen!
338cdf0e10cSrcweir 		pDocSh = PTR_CAST(ScDocShell, pDocSh);
339cdf0e10cSrcweir 
340c7be74b1SArmin Le Grand 		XColorListSharedPtr aColorTable;
341cdf0e10cSrcweir 
342cdf0e10cSrcweir 		if ( pDocSh  )
343cdf0e10cSrcweir 		{
344cdf0e10cSrcweir             const SfxPoolItem* pItem = pDocSh->GetItem( SID_COLOR_TABLE );
345cdf0e10cSrcweir 
346cdf0e10cSrcweir 			if ( pItem )
347c7be74b1SArmin Le Grand 				aColorTable = static_cast< const SvxColorTableItem* >(pItem)->GetColorTable();
348cdf0e10cSrcweir 		}
349cdf0e10cSrcweir 		else
350c7be74b1SArmin Le Grand 			aColorTable = XColorList::GetStdColorList();
351cdf0e10cSrcweir 
352c7be74b1SArmin Le Grand 		if ( !aColorTable.get() )
353cdf0e10cSrcweir 			return;
354cdf0e10cSrcweir 
355cdf0e10cSrcweir 		//------------------------------------------------------
356cdf0e10cSrcweir 
357cdf0e10cSrcweir 		aColorLB.SetUpdateMode( sal_False );
358cdf0e10cSrcweir 
359cdf0e10cSrcweir 		//	Eintraege aus der Colortable
360cdf0e10cSrcweir 
361c7be74b1SArmin Le Grand 		long nCount = aColorTable->Count();
362cdf0e10cSrcweir 		for ( long n=0; n<nCount; n++ )
363cdf0e10cSrcweir 		{
364c7be74b1SArmin Le Grand 			XColorEntry* pEntry = aColorTable->GetColor(n);
365cdf0e10cSrcweir 			aColorLB.InsertEntry( pEntry->GetColor(), pEntry->GetName() );
366cdf0e10cSrcweir 		}
367cdf0e10cSrcweir 
368cdf0e10cSrcweir 		//	Standard-Gitterfarbe
369cdf0e10cSrcweir 
370cdf0e10cSrcweir 		Color aStdCol( SC_STD_GRIDCOLOR );			// wie Default in ScViewOptions
371cdf0e10cSrcweir 		if ( LISTBOX_ENTRY_NOTFOUND ==
372cdf0e10cSrcweir 				aColorLB.GetEntryPos( aStdCol ) )
373cdf0e10cSrcweir 			aColorLB.InsertEntry( aStdCol, ScGlobal::GetRscString( STR_GRIDCOLOR ) );
374cdf0e10cSrcweir 
375cdf0e10cSrcweir 		aColorLB.SetUpdateMode( sal_True );
376cdf0e10cSrcweir 
377cdf0e10cSrcweir 		Invalidate();
378cdf0e10cSrcweir 	}
379cdf0e10cSrcweir 
380cdf0e10cSrcweir 	//	#79720# also select grid color entry on subsequent calls
381cdf0e10cSrcweir 
382cdf0e10cSrcweir 	String	aName;
383cdf0e10cSrcweir 	Color	aCol	= pLocalOptions->GetGridColor( &aName );
384cdf0e10cSrcweir 	sal_uInt16	nSelPos	= aColorLB.GetEntryPos( aCol );
385cdf0e10cSrcweir 
386cdf0e10cSrcweir 	if ( LISTBOX_ENTRY_NOTFOUND != nSelPos )
387cdf0e10cSrcweir 		aColorLB.SelectEntryPos( nSelPos );
388cdf0e10cSrcweir 	else
389cdf0e10cSrcweir 		aColorLB.SelectEntryPos( aColorLB.InsertEntry( aCol, aName ) );
390cdf0e10cSrcweir }
391cdf0e10cSrcweir /*-----------------11.01.97 13.40-------------------
392cdf0e10cSrcweir 
393cdf0e10cSrcweir --------------------------------------------------*/
394cdf0e10cSrcweir 
IMPL_LINK(ScTpContentOptions,GridHdl,CheckBox *,pBox)395cdf0e10cSrcweir IMPL_LINK( ScTpContentOptions, GridHdl, CheckBox*, pBox )
396cdf0e10cSrcweir {
397cdf0e10cSrcweir 	sal_Bool bChecked = pBox->IsChecked();
398cdf0e10cSrcweir 	aColorFT.Enable(bChecked);
399cdf0e10cSrcweir 	aColorLB.Enable(bChecked);
400cdf0e10cSrcweir 	pLocalOptions->SetOption( VOPT_GRID, bChecked );
401cdf0e10cSrcweir 	return 0;
402cdf0e10cSrcweir }
403cdf0e10cSrcweir /*-----------------11.01.97 10.53-------------------
404cdf0e10cSrcweir 
405cdf0e10cSrcweir --------------------------------------------------*/
406cdf0e10cSrcweir 
ScTpLayoutOptions(Window * pParent,const SfxItemSet & rArgSet)407cdf0e10cSrcweir ScTpLayoutOptions::ScTpLayoutOptions( 	Window*	pParent,
408cdf0e10cSrcweir 										const SfxItemSet&	rArgSet ) :
409cdf0e10cSrcweir 	SfxTabPage(pParent, ScResId( RID_SCPAGE_LAYOUT ), rArgSet),
410cdf0e10cSrcweir     aUnitGB( this,          ScResId(GB_UNIT           )),
411cdf0e10cSrcweir     aUnitFT( this,          ScResId(FT_UNIT           )),
412cdf0e10cSrcweir     aUnitLB( this,          ScResId(LB_UNIT           )),
413cdf0e10cSrcweir     aTabFT( this,           ScResId( FT_TAB           )),
414cdf0e10cSrcweir     aTabMF( this,           ScResId( MF_TAB           )),
415cdf0e10cSrcweir     aSeparatorFL( this,     ScResId( FL_SEPARATOR         )),
416cdf0e10cSrcweir 	aLinkGB		(this, ScResId(GB_LINK	)),
417cdf0e10cSrcweir     aLinkFT(this, ScResId(FT_UPDATE_LINKS )),
418cdf0e10cSrcweir 	aAlwaysRB	(this, ScResId(RB_ALWAYS	)),
419cdf0e10cSrcweir 	aRequestRB	(this, ScResId(RB_REQUEST	)),
420cdf0e10cSrcweir 	aNeverRB	(this, ScResId(RB_NEVER	)),
421cdf0e10cSrcweir 
422cdf0e10cSrcweir     aOptionsGB( this,       ScResId( GB_OPTIONS   )),
423cdf0e10cSrcweir 	aAlignCB  ( this, 		ScResId( CB_ALIGN		)),
424cdf0e10cSrcweir 	aAlignLB  ( this, 		ScResId( LB_ALIGN		)),
425cdf0e10cSrcweir 	aEditModeCB( this, 		ScResId( CB_EDITMODE	)),
426cdf0e10cSrcweir 	aFormatCB( this, 		ScResId( CB_FORMAT	)),
427cdf0e10cSrcweir     aExpRefCB( this,        ScResId( CB_EXPREF    )),
428cdf0e10cSrcweir     aMarkHdrCB( this,       ScResId( CB_MARKHDR   )),
429cdf0e10cSrcweir 	aTextFmtCB( this,       ScResId( CB_TEXTFMT   )),
430cdf0e10cSrcweir     aReplWarnCB( this,      ScResId( CB_REPLWARN  )),
431cdf0e10cSrcweir     aUnitArr(               ScResId(ST_UNIT           )),
432cdf0e10cSrcweir     pDoc(NULL)
433cdf0e10cSrcweir {
434cdf0e10cSrcweir 	FreeResource();
435cdf0e10cSrcweir     aSeparatorFL.SetStyle( aSeparatorFL.GetStyle() | WB_VERT );
436cdf0e10cSrcweir     SetExchangeSupport();
437cdf0e10cSrcweir 
438cdf0e10cSrcweir     aUnitLB.    SetSelectHdl( LINK( this, ScTpLayoutOptions, MetricHdl ) );
439cdf0e10cSrcweir 
440cdf0e10cSrcweir     aAlignCB.SetClickHdl(LINK(this, ScTpLayoutOptions, AlignHdl));
441cdf0e10cSrcweir 
442cdf0e10cSrcweir 
443cdf0e10cSrcweir 	for ( sal_uInt16 i = 0; i < aUnitArr.Count(); ++i )
444cdf0e10cSrcweir 	{
445cdf0e10cSrcweir 		String sMetric = aUnitArr.GetStringByPos( i );
446cdf0e10cSrcweir 		FieldUnit eFUnit = (FieldUnit)aUnitArr.GetValue( i );
447cdf0e10cSrcweir 
448cdf0e10cSrcweir 		switch ( eFUnit )
449cdf0e10cSrcweir 		{
450cdf0e10cSrcweir 			case FUNIT_MM:
451cdf0e10cSrcweir 			case FUNIT_CM:
452cdf0e10cSrcweir 			case FUNIT_POINT:
453cdf0e10cSrcweir 			case FUNIT_PICA:
454cdf0e10cSrcweir 			case FUNIT_INCH:
455cdf0e10cSrcweir 			{
456cdf0e10cSrcweir 				// nur diese Metriken benutzen
457cdf0e10cSrcweir 				sal_uInt16 nPos = aUnitLB.InsertEntry( sMetric );
458cdf0e10cSrcweir 				aUnitLB.SetEntryData( nPos, (void*)(long)eFUnit );
459cdf0e10cSrcweir 			}
460cdf0e10cSrcweir             break;
461cdf0e10cSrcweir             default:
462cdf0e10cSrcweir             {
463cdf0e10cSrcweir                 // added to avoid warnings
464cdf0e10cSrcweir             }
465cdf0e10cSrcweir 		}
466cdf0e10cSrcweir 	}
467cdf0e10cSrcweir 
468cdf0e10cSrcweir }
469cdf0e10cSrcweir /*-----------------11.01.97 10.53-------------------
470cdf0e10cSrcweir 
471cdf0e10cSrcweir --------------------------------------------------*/
472cdf0e10cSrcweir 
~ScTpLayoutOptions()473cdf0e10cSrcweir ScTpLayoutOptions::~ScTpLayoutOptions()
474cdf0e10cSrcweir {
475cdf0e10cSrcweir }
476cdf0e10cSrcweir /*-----------------11.01.97 10.53-------------------
477cdf0e10cSrcweir 
478cdf0e10cSrcweir --------------------------------------------------*/
479cdf0e10cSrcweir 
Create(Window * pParent,const SfxItemSet & rCoreSet)480cdf0e10cSrcweir SfxTabPage*	ScTpLayoutOptions::Create( Window*			pParent,
481cdf0e10cSrcweir 									const SfxItemSet&	rCoreSet )
482cdf0e10cSrcweir {
483cdf0e10cSrcweir     ScTpLayoutOptions* pNew = new ScTpLayoutOptions(pParent, rCoreSet);
484cdf0e10cSrcweir     ScDocShell* pDocSh = PTR_CAST(ScDocShell,SfxObjectShell::Current());
485cdf0e10cSrcweir 
486cdf0e10cSrcweir 	if(pDocSh!=NULL)
487cdf0e10cSrcweir 		pNew->SetDocument(pDocSh->GetDocument());
488cdf0e10cSrcweir     return pNew;
489cdf0e10cSrcweir }
490cdf0e10cSrcweir /*-----------------11.01.97 10.53-------------------
491cdf0e10cSrcweir 
492cdf0e10cSrcweir --------------------------------------------------*/
493cdf0e10cSrcweir 
FillItemSet(SfxItemSet & rCoreSet)494cdf0e10cSrcweir sal_Bool	ScTpLayoutOptions::FillItemSet( SfxItemSet& rCoreSet )
495cdf0e10cSrcweir {
496cdf0e10cSrcweir 	sal_Bool bRet = sal_True;
497cdf0e10cSrcweir     const sal_uInt16 nMPos = aUnitLB.GetSelectEntryPos();
498cdf0e10cSrcweir 	if ( nMPos != aUnitLB.GetSavedValue() )
499cdf0e10cSrcweir 	{
500cdf0e10cSrcweir 		sal_uInt16 nFieldUnit = (sal_uInt16)(long)aUnitLB.GetEntryData( nMPos );
501cdf0e10cSrcweir 		rCoreSet.Put( SfxUInt16Item( SID_ATTR_METRIC,
502cdf0e10cSrcweir 									 (sal_uInt16)nFieldUnit ) );
503cdf0e10cSrcweir 		bRet = sal_True;
504cdf0e10cSrcweir 	}
505cdf0e10cSrcweir 
506cdf0e10cSrcweir 	if(aTabMF.GetText() != aTabMF.GetSavedValue())
507cdf0e10cSrcweir 	{
508cdf0e10cSrcweir 		rCoreSet.Put(SfxUInt16Item(SID_ATTR_DEFTABSTOP,
509cdf0e10cSrcweir                     sal::static_int_cast<sal_uInt16>( aTabMF.Denormalize(aTabMF.GetValue(FUNIT_TWIP)) )));
510cdf0e10cSrcweir 		bRet = sal_True;
511cdf0e10cSrcweir 	}
512cdf0e10cSrcweir 
513cdf0e10cSrcweir     ScLkUpdMode nSet=LM_ALWAYS;
514cdf0e10cSrcweir 
515cdf0e10cSrcweir 	if(aRequestRB.IsChecked())
516cdf0e10cSrcweir 	{
517cdf0e10cSrcweir 		nSet=LM_ON_DEMAND;
518cdf0e10cSrcweir 	}
519cdf0e10cSrcweir 	else if(aNeverRB.IsChecked())
520cdf0e10cSrcweir 	{
521cdf0e10cSrcweir 		nSet=LM_NEVER;
522cdf0e10cSrcweir 	}
523cdf0e10cSrcweir 
524cdf0e10cSrcweir     if(aRequestRB.IsChecked() != aRequestRB.GetSavedValue() ||
525cdf0e10cSrcweir             aNeverRB.IsChecked() != aNeverRB.GetSavedValue() )
526cdf0e10cSrcweir 	{
527cdf0e10cSrcweir         if(pDoc)
528cdf0e10cSrcweir             pDoc->SetLinkMode(nSet);
529cdf0e10cSrcweir         ScAppOptions aAppOptions=SC_MOD()->GetAppOptions();
530cdf0e10cSrcweir 		aAppOptions.SetLinkMode(nSet );
531cdf0e10cSrcweir 		SC_MOD()->SetAppOptions(aAppOptions);
532cdf0e10cSrcweir         bRet = sal_True;
533cdf0e10cSrcweir     }
534cdf0e10cSrcweir     if(aAlignCB.GetSavedValue() != aAlignCB.IsChecked())
535cdf0e10cSrcweir     {
536cdf0e10cSrcweir 		rCoreSet.Put(SfxBoolItem(SID_SC_INPUT_SELECTION, aAlignCB.IsChecked()));
537cdf0e10cSrcweir         bRet = sal_True;
538cdf0e10cSrcweir     }
539cdf0e10cSrcweir 
540cdf0e10cSrcweir 	if(aAlignLB.GetSavedValue() != aAlignLB.GetSelectEntryPos())
541cdf0e10cSrcweir     {
542cdf0e10cSrcweir         rCoreSet.Put(SfxUInt16Item(SID_SC_INPUT_SELECTIONPOS, aAlignLB.GetSelectEntryPos()));
543cdf0e10cSrcweir         bRet = sal_True;
544cdf0e10cSrcweir     }
545cdf0e10cSrcweir 
546cdf0e10cSrcweir 	if(aEditModeCB.GetSavedValue() != aEditModeCB.IsChecked())
547cdf0e10cSrcweir     {
548cdf0e10cSrcweir         rCoreSet.Put(SfxBoolItem(SID_SC_INPUT_EDITMODE, aEditModeCB.IsChecked()));
549cdf0e10cSrcweir         bRet = sal_True;
550cdf0e10cSrcweir     }
551cdf0e10cSrcweir 
552cdf0e10cSrcweir 	if(aFormatCB.GetSavedValue() != aFormatCB.IsChecked())
553cdf0e10cSrcweir     {
554cdf0e10cSrcweir         rCoreSet.Put(SfxBoolItem(SID_SC_INPUT_FMT_EXPAND, aFormatCB.IsChecked()));
555cdf0e10cSrcweir         bRet = sal_True;
556cdf0e10cSrcweir     }
557cdf0e10cSrcweir 
558cdf0e10cSrcweir 
559cdf0e10cSrcweir     if(aExpRefCB.GetSavedValue() != aExpRefCB.IsChecked())
560cdf0e10cSrcweir     {
561cdf0e10cSrcweir         rCoreSet.Put(SfxBoolItem(SID_SC_INPUT_REF_EXPAND, aExpRefCB.IsChecked()));
562cdf0e10cSrcweir         bRet = sal_True;
563cdf0e10cSrcweir     }
564cdf0e10cSrcweir 
565cdf0e10cSrcweir 	if(aMarkHdrCB.GetSavedValue() != aMarkHdrCB.IsChecked())
566cdf0e10cSrcweir     {
567cdf0e10cSrcweir         rCoreSet.Put(SfxBoolItem(SID_SC_INPUT_MARK_HEADER, aMarkHdrCB.IsChecked()));
568cdf0e10cSrcweir         bRet = sal_True;
569cdf0e10cSrcweir     }
570cdf0e10cSrcweir 
571cdf0e10cSrcweir 	if(aTextFmtCB.GetSavedValue() != aTextFmtCB.IsChecked())
572cdf0e10cSrcweir     {
573cdf0e10cSrcweir         rCoreSet.Put(SfxBoolItem(SID_SC_INPUT_TEXTWYSIWYG, aTextFmtCB.IsChecked()));
574cdf0e10cSrcweir         bRet = sal_True;
575cdf0e10cSrcweir     }
576cdf0e10cSrcweir 
577cdf0e10cSrcweir     if( aReplWarnCB.GetSavedValue() != aReplWarnCB.IsChecked() )
578cdf0e10cSrcweir     {
579cdf0e10cSrcweir         rCoreSet.Put( SfxBoolItem( SID_SC_INPUT_REPLCELLSWARN, aReplWarnCB.IsChecked() ) );
580cdf0e10cSrcweir         bRet = sal_True;
581cdf0e10cSrcweir     }
582cdf0e10cSrcweir 
583cdf0e10cSrcweir     return bRet;
584cdf0e10cSrcweir }
585cdf0e10cSrcweir /*-----------------11.01.97 10.53-------------------
586cdf0e10cSrcweir 
587cdf0e10cSrcweir --------------------------------------------------*/
588cdf0e10cSrcweir 
Reset(const SfxItemSet & rCoreSet)589cdf0e10cSrcweir void	ScTpLayoutOptions::Reset( const SfxItemSet& rCoreSet )
590cdf0e10cSrcweir {
591cdf0e10cSrcweir 	aUnitLB.SetNoSelection();
592cdf0e10cSrcweir 	if ( rCoreSet.GetItemState( SID_ATTR_METRIC ) >= SFX_ITEM_AVAILABLE )
593cdf0e10cSrcweir 	{
594cdf0e10cSrcweir 		const SfxUInt16Item& rItem = (SfxUInt16Item&)rCoreSet.Get( SID_ATTR_METRIC );
595cdf0e10cSrcweir 		FieldUnit eFieldUnit = (FieldUnit)rItem.GetValue();
596cdf0e10cSrcweir 
597cdf0e10cSrcweir 		for ( sal_uInt16 i = 0; i < aUnitLB.GetEntryCount(); ++i )
598cdf0e10cSrcweir 		{
599cdf0e10cSrcweir 			if ( (FieldUnit)(long)aUnitLB.GetEntryData( i ) == eFieldUnit )
600cdf0e10cSrcweir 			{
601cdf0e10cSrcweir 				aUnitLB.SelectEntryPos( i );
602cdf0e10cSrcweir 				break;
603cdf0e10cSrcweir 			}
604cdf0e10cSrcweir 		}
605cdf0e10cSrcweir 		::SetFieldUnit(aTabMF, eFieldUnit);
606cdf0e10cSrcweir 	}
607cdf0e10cSrcweir 	aUnitLB.SaveValue();
608cdf0e10cSrcweir 
609cdf0e10cSrcweir     const SfxPoolItem* pItem;
610cdf0e10cSrcweir     if(SFX_ITEM_SET == rCoreSet.GetItemState(SID_ATTR_DEFTABSTOP, sal_False, &pItem))
611cdf0e10cSrcweir 		aTabMF.SetValue(aTabMF.Normalize(((SfxUInt16Item*)pItem)->GetValue()), FUNIT_TWIP);
612cdf0e10cSrcweir 	aTabMF.SaveValue();
613cdf0e10cSrcweir 
614cdf0e10cSrcweir     aUnitLB         .SaveValue();
615cdf0e10cSrcweir 	aTabMF			.SaveValue();
616cdf0e10cSrcweir 
617cdf0e10cSrcweir     ScLkUpdMode nSet=LM_UNKNOWN;
618cdf0e10cSrcweir 
619cdf0e10cSrcweir 	if(pDoc!=NULL)
620cdf0e10cSrcweir 	{
621cdf0e10cSrcweir 		nSet=pDoc->GetLinkMode();
622cdf0e10cSrcweir 	}
623cdf0e10cSrcweir 
624cdf0e10cSrcweir 	if(nSet==LM_UNKNOWN)
625cdf0e10cSrcweir 	{
626cdf0e10cSrcweir 		ScAppOptions aAppOptions=SC_MOD()->GetAppOptions();
627cdf0e10cSrcweir 		nSet=aAppOptions.GetLinkMode();
628cdf0e10cSrcweir 	}
629cdf0e10cSrcweir 
630cdf0e10cSrcweir 	switch(nSet)
631cdf0e10cSrcweir 	{
632cdf0e10cSrcweir 		case LM_ALWAYS:		aAlwaysRB.	Check();	break;
633cdf0e10cSrcweir 		case LM_NEVER:		aNeverRB.	Check();	break;
634cdf0e10cSrcweir 		case LM_ON_DEMAND:	aRequestRB.	Check();	break;
635cdf0e10cSrcweir         default:
636cdf0e10cSrcweir         {
637cdf0e10cSrcweir             // added to avoid warnings
638cdf0e10cSrcweir         }
639cdf0e10cSrcweir 	}
640cdf0e10cSrcweir     if(SFX_ITEM_SET == rCoreSet.GetItemState(SID_SC_INPUT_SELECTION, sal_False, &pItem))
641cdf0e10cSrcweir 		aAlignCB.Check(((const SfxBoolItem*)pItem)->GetValue());
642cdf0e10cSrcweir 
643cdf0e10cSrcweir 	if(SFX_ITEM_SET == rCoreSet.GetItemState(SID_SC_INPUT_SELECTIONPOS, sal_False, &pItem))
644cdf0e10cSrcweir 		aAlignLB.SelectEntryPos(((const SfxUInt16Item*)pItem)->GetValue());
645cdf0e10cSrcweir 
646cdf0e10cSrcweir 	if(SFX_ITEM_SET == rCoreSet.GetItemState(SID_SC_INPUT_EDITMODE, sal_False, &pItem))
647cdf0e10cSrcweir 		aEditModeCB.Check(((const SfxBoolItem*)pItem)->GetValue());
648cdf0e10cSrcweir 
649cdf0e10cSrcweir 	if(SFX_ITEM_SET == rCoreSet.GetItemState(SID_SC_INPUT_FMT_EXPAND, sal_False, &pItem))
650cdf0e10cSrcweir 		aFormatCB.Check(((const SfxBoolItem*)pItem)->GetValue());
651cdf0e10cSrcweir 
652cdf0e10cSrcweir 
653cdf0e10cSrcweir     if(SFX_ITEM_SET == rCoreSet.GetItemState(SID_SC_INPUT_REF_EXPAND, sal_False, &pItem))
654cdf0e10cSrcweir 		aExpRefCB.Check(((const SfxBoolItem*)pItem)->GetValue());
655cdf0e10cSrcweir 
656cdf0e10cSrcweir 	if(SFX_ITEM_SET == rCoreSet.GetItemState(SID_SC_INPUT_MARK_HEADER, sal_False, &pItem))
657cdf0e10cSrcweir 		aMarkHdrCB.Check(((const SfxBoolItem*)pItem)->GetValue());
658cdf0e10cSrcweir 
659cdf0e10cSrcweir 	if(SFX_ITEM_SET == rCoreSet.GetItemState(SID_SC_INPUT_TEXTWYSIWYG, sal_False, &pItem))
660cdf0e10cSrcweir 		aTextFmtCB.Check(((const SfxBoolItem*)pItem)->GetValue());
661cdf0e10cSrcweir 
662cdf0e10cSrcweir     if( SFX_ITEM_SET == rCoreSet.GetItemState( SID_SC_INPUT_REPLCELLSWARN, sal_False, &pItem ) )
663cdf0e10cSrcweir         aReplWarnCB.Check( ( (const SfxBoolItem*)pItem)->GetValue() );
664cdf0e10cSrcweir 
665cdf0e10cSrcweir     aAlignCB    .SaveValue();
666cdf0e10cSrcweir 	aAlignLB  	.SaveValue();
667cdf0e10cSrcweir 	aEditModeCB	.SaveValue();
668cdf0e10cSrcweir 	aFormatCB	.SaveValue();
669cdf0e10cSrcweir 
670cdf0e10cSrcweir     aExpRefCB   .SaveValue();
671cdf0e10cSrcweir 	aMarkHdrCB	.SaveValue();
672cdf0e10cSrcweir 	aTextFmtCB	.SaveValue();
673cdf0e10cSrcweir     aReplWarnCB .SaveValue();
674cdf0e10cSrcweir 	AlignHdl(&aAlignCB);
675cdf0e10cSrcweir 
676cdf0e10cSrcweir     aAlwaysRB.SaveValue();
677cdf0e10cSrcweir     aNeverRB.SaveValue();
678cdf0e10cSrcweir     aRequestRB.SaveValue();
679cdf0e10cSrcweir }
680cdf0e10cSrcweir 
681cdf0e10cSrcweir /*-----------------11.01.97 12.46-------------------
682cdf0e10cSrcweir 
683cdf0e10cSrcweir --------------------------------------------------*/
684cdf0e10cSrcweir 
ActivatePage(const SfxItemSet &)685cdf0e10cSrcweir void	ScTpLayoutOptions::ActivatePage( const SfxItemSet& /* rCoreSet */ )
686cdf0e10cSrcweir {
687cdf0e10cSrcweir }
688cdf0e10cSrcweir /*-----------------11.01.97 12.46-------------------
689cdf0e10cSrcweir 
690cdf0e10cSrcweir --------------------------------------------------*/
691cdf0e10cSrcweir 
DeactivatePage(SfxItemSet * pSetP)692cdf0e10cSrcweir int	ScTpLayoutOptions::DeactivatePage( SfxItemSet* pSetP )
693cdf0e10cSrcweir {
694cdf0e10cSrcweir     if(pSetP)
695cdf0e10cSrcweir         FillItemSet(*pSetP);
696cdf0e10cSrcweir 	return SfxTabPage::LEAVE_PAGE;
697cdf0e10cSrcweir }
698cdf0e10cSrcweir 
699cdf0e10cSrcweir 
700cdf0e10cSrcweir /*-----------------13.01.97 14.44-------------------
701cdf0e10cSrcweir 	Metric des Deftabstops umschalten
702cdf0e10cSrcweir --------------------------------------------------*/
703cdf0e10cSrcweir 
IMPL_LINK(ScTpLayoutOptions,MetricHdl,ListBox *,EMPTYARG)704cdf0e10cSrcweir IMPL_LINK(ScTpLayoutOptions, MetricHdl, ListBox*, EMPTYARG)
705cdf0e10cSrcweir {
706cdf0e10cSrcweir 	const sal_uInt16 nMPos = aUnitLB.GetSelectEntryPos();
707cdf0e10cSrcweir 	if(nMPos != USHRT_MAX)
708cdf0e10cSrcweir 	{
709cdf0e10cSrcweir 		FieldUnit eFieldUnit = (FieldUnit)(long)aUnitLB.GetEntryData( nMPos );
710cdf0e10cSrcweir         sal_Int64 nVal =
711cdf0e10cSrcweir 			aTabMF.Denormalize( aTabMF.GetValue( FUNIT_TWIP ) );
712cdf0e10cSrcweir 		::SetFieldUnit( aTabMF, eFieldUnit );
713cdf0e10cSrcweir 		aTabMF.SetValue( aTabMF.Normalize( nVal ), FUNIT_TWIP );
714cdf0e10cSrcweir 	}
715cdf0e10cSrcweir 
716cdf0e10cSrcweir 	return 0;
717cdf0e10cSrcweir }
718cdf0e10cSrcweir /*-----------------11.01.97 15.30-------------------
719cdf0e10cSrcweir 
720cdf0e10cSrcweir --------------------------------------------------*/
IMPL_LINK(ScTpLayoutOptions,AlignHdl,CheckBox *,pBox)721cdf0e10cSrcweir IMPL_LINK( ScTpLayoutOptions, AlignHdl, CheckBox*, pBox )
722cdf0e10cSrcweir {
723cdf0e10cSrcweir 	aAlignLB.Enable(pBox->IsChecked());
724cdf0e10cSrcweir 	return 0;
725cdf0e10cSrcweir }
726