xref: /trunk/main/sw/source/ui/misc/pggrid.cxx (revision c7be74b1)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_sw.hxx"
26 
27 #ifdef SW_DLLIMPLEMENTATION
28 #undef SW_DLLIMPLEMENTATION
29 #endif
30 
31 
32 
33 #include <sfx2/app.hxx>
34 
35 #ifndef _CMDID_H
36 #include <cmdid.h>
37 #endif
38 #include <hintids.hxx>
39 #include <swtypes.hxx>
40 #ifndef _GLOBALS_HRC
41 #include <globals.hrc>
42 #endif
43 #include <svx/xtable.hxx>
44 #include <uitool.hxx>
45 #include <editeng/sizeitem.hxx>
46 #include <editeng/lrspitem.hxx>
47 #include <editeng/ulspitem.hxx>
48 #include <editeng/boxitem.hxx>
49 #include <editeng/frmdiritem.hxx>
50 #include <pggrid.hxx>
51 #include <tgrditem.hxx>
52 #include <pggrid.hrc>
53 
54 #include "wrtsh.hxx"
55 #include "doc.hxx"
56 #include "uiitems.hxx"
57 #include "swmodule.hxx"
58 #include "view.hxx"
59 /*-- 06.02.2002 15:25:39---------------------------------------------------
60 
61   -----------------------------------------------------------------------*/
SwTextGridPage(Window * pParent,const SfxItemSet & rSet)62 SwTextGridPage::SwTextGridPage(Window *pParent, const SfxItemSet &rSet) :
63     SfxTabPage(pParent, SW_RES(TP_TEXTGRID_PAGE), rSet),
64     aGridTypeFL             (this, SW_RES(FL_GRID_TYPE       )),
65     aNoGridRB               (this, SW_RES(RB_NOGRID          )),
66     aLinesGridRB            (this, SW_RES(RB_LINESGRID       )),
67     aCharsGridRB            (this, SW_RES(RB_CHARSGRID       )),
68 	aSnapToCharsCB          (this, SW_RES(CB_SNAPTOCHARS      )),
69     aExampleWN              (this, SW_RES(WN_EXAMPLE         )),
70     aLayoutFL               (this, SW_RES(FL_LAYOUT          )),
71     aLinesPerPageFT         (this, SW_RES(FT_LINESPERPAGE    )),
72     aLinesPerPageNF         (this, SW_RES(NF_LINESPERPAGE    )),
73     aTextSizeFT             (this, SW_RES(FT_TEXTSIZE        )),
74     aTextSizeMF             (this, SW_RES(MF_TEXTSIZE        )),
75     aCharsPerLineFT         (this, SW_RES(FT_CHARSPERLINE    )),
76     aCharsPerLineNF         (this, SW_RES(NF_CHARSPERLINE    )),
77 	aCharWidthFT            (this, SW_RES(FT_CHARWIDTH        )),
78 	aCharWidthMF            (this, SW_RES(MF_CHARWIDTH        )),
79     aRubySizeFT             (this, SW_RES(FT_RUBYSIZE        )),
80     aRubySizeMF             (this, SW_RES(MF_RUBYSIZE        )),
81     aRubyBelowCB            (this, SW_RES(CB_RUBYBELOW       )),
82     aDisplayFL              (this, SW_RES(FL_DISPLAY         )),
83     aDisplayCB              (this, SW_RES(CB_DISPLAY         )),
84     aPrintCB                (this, SW_RES(CB_PRINT           )),
85     aColorFT                (this, SW_RES(FT_COLOR           )),
86     aColorLB                (this, SW_RES(LB_COLOR           )),
87     m_nRubyUserValue(0),
88     m_bRubyUserValue(sal_False),
89     m_aPageSize(MM50, MM50),
90     m_bVertical(sal_False),
91 	m_bSquaredMode(sal_False)
92 {
93     FreeResource();
94 
95     aControls[0] =&aLayoutFL;
96     aControls[1] =&aLinesPerPageFT;
97     aControls[2] =&aLinesPerPageNF;
98     aControls[3] =&aTextSizeFT;
99     aControls[4] =&aTextSizeMF;
100     aControls[5] =&aCharsPerLineFT;
101     aControls[6] =&aCharsPerLineNF;
102     aControls[7] =&aCharWidthFT;
103     aControls[8] =&aCharWidthMF;
104     aControls[9] =&aRubySizeFT;
105     aControls[10] =&aRubySizeMF;
106     aControls[11] =&aRubyBelowCB;
107     aControls[12] =&aDisplayFL;
108     aControls[13] =&aDisplayCB;
109     aControls[14] =&aPrintCB;
110     aControls[15] =&aColorFT;
111     aControls[16] =&aColorLB;
112     aControls[17] =0;
113 
114     Link aLink = LINK(this, SwTextGridPage, CharorLineChangedHdl);
115     aCharsPerLineNF.SetUpHdl(aLink);
116     aCharsPerLineNF.SetDownHdl(aLink);
117     aCharsPerLineNF.SetLoseFocusHdl(aLink);
118     aLinesPerPageNF.SetUpHdl(aLink);
119     aLinesPerPageNF.SetDownHdl(aLink);
120     aLinesPerPageNF.SetLoseFocusHdl(aLink);
121 
122     Link aSizeLink = LINK(this, SwTextGridPage, TextSizeChangedHdl);
123     aTextSizeMF.SetUpHdl(aSizeLink);
124     aTextSizeMF.SetDownHdl(aSizeLink);
125     aTextSizeMF.SetLoseFocusHdl(aSizeLink);
126     aRubySizeMF.SetUpHdl(aSizeLink);
127     aRubySizeMF.SetDownHdl(aSizeLink);
128     aRubySizeMF.SetLoseFocusHdl(aSizeLink);
129     aCharWidthMF.SetUpHdl(aSizeLink);
130     aCharWidthMF.SetDownHdl(aSizeLink);
131     aCharWidthMF.SetLoseFocusHdl(aSizeLink);
132 
133     Link aGridTypeHdl = LINK(this, SwTextGridPage, GridTypeHdl);
134     aNoGridRB   .SetClickHdl(aGridTypeHdl);
135     aLinesGridRB.SetClickHdl(aGridTypeHdl);
136     aCharsGridRB.SetClickHdl(aGridTypeHdl);
137 
138     Link aModifyLk = LINK(this, SwTextGridPage, GridModifyHdl);
139     aColorLB.SetSelectHdl(aModifyLk);
140     aPrintCB.SetClickHdl(aModifyLk);
141     aRubyBelowCB.SetClickHdl(aModifyLk);
142 
143 
144     aDisplayCB.SetClickHdl(LINK(this, SwTextGridPage, DisplayGridHdl));
145 
146     XColorListSharedPtr aColorTbl = XColorList::GetStdColorList();
147     aColorLB.InsertAutomaticEntry();
148 	for( sal_uInt16 i = 0; i < aColorTbl->Count(); ++i )
149 	{
150 		XColorEntry* pEntry = aColorTbl->GetColor( i );
151 		Color aColor = pEntry->GetColor();
152 		String sName = pEntry->GetName();
153 		aColorLB.InsertEntry( aColor, sName );
154 	}
155 	aColorLB.SetUpdateMode( sal_True );
156 	//Get the default paper mode
157 	SwView *pView   = ::GetActiveView();
158 	if( pView )
159 	{
160 		SwWrtShell* pSh = pView->GetWrtShellPtr();
161 		if( pSh )
162 		{
163 			m_bSquaredMode = pSh->GetDoc()->IsSquaredPageMode();
164 		}
165 	}
166 	if( m_bSquaredMode )
167 	{
168 		aRubySizeFT.Show();
169 		aRubySizeMF.Show();
170 		aRubyBelowCB.Show();
171 		aSnapToCharsCB.Hide();
172 		aCharWidthFT.Hide();
173 		aCharWidthMF.Hide();
174 	}
175 	else
176 	{
177 		aRubySizeFT.Hide();
178 		aRubySizeMF.Hide();
179 		aRubyBelowCB.Hide();
180 		aSnapToCharsCB.Show();
181 		aCharWidthFT.Show();
182 		aCharWidthMF.Show();
183 	}
184 }
185 /*-- 06.02.2002 15:25:40---------------------------------------------------
186 
187   -----------------------------------------------------------------------*/
~SwTextGridPage()188 SwTextGridPage::~SwTextGridPage()
189 {
190 }
191 /*-- 06.02.2002 15:25:40---------------------------------------------------
192 
193   -----------------------------------------------------------------------*/
Create(Window * pParent,const SfxItemSet & rSet)194 SfxTabPage *SwTextGridPage::Create(Window *pParent, const SfxItemSet &rSet)
195 {
196     return new SwTextGridPage(pParent, rSet);
197 }
198 /*-- 06.02.2002 15:25:40---------------------------------------------------
199 
200   -----------------------------------------------------------------------*/
FillItemSet(SfxItemSet & rSet)201 sal_Bool    SwTextGridPage::FillItemSet(SfxItemSet &rSet)
202 {
203     sal_Bool bRet = sal_False;
204     if(aNoGridRB.GetSavedValue() != aNoGridRB.IsChecked()||
205         aLinesGridRB.GetSavedValue() != aLinesGridRB.IsChecked()||
206         aLinesPerPageNF.GetSavedValue().ToInt32()
207            != aLinesPerPageNF.GetValue()||
208         aTextSizeMF.GetSavedValue().ToInt32() != aTextSizeMF.GetValue()||
209         aCharsPerLineNF.GetSavedValue().ToInt32()
210            != aCharsPerLineNF.GetValue()||
211         aSnapToCharsCB.GetSavedValue() != aSnapToCharsCB.IsChecked() ||
212         aRubySizeMF.GetSavedValue().ToInt32() != aRubySizeMF.GetValue()||
213         aCharWidthMF.GetSavedValue().ToInt32() != aCharWidthMF.GetValue()||
214         aRubyBelowCB.GetSavedValue() != aRubyBelowCB.IsChecked()||
215         aDisplayCB.GetSavedValue() != aDisplayCB.IsChecked()||
216         aPrintCB.GetSavedValue() != aPrintCB.IsChecked()||
217         aColorLB.GetSavedValue() != aColorLB.GetSelectEntryPos())
218     {
219         PutGridItem(rSet);
220         bRet = sal_True;
221     }
222 
223     return bRet;
224 }
225 /*-- 06.02.2002 15:25:40---------------------------------------------------
226 
227   -----------------------------------------------------------------------*/
Reset(const SfxItemSet & rSet)228 void    SwTextGridPage::Reset(const SfxItemSet &rSet)
229 {
230     if(SFX_ITEM_AVAILABLE <= rSet.GetItemState(RES_TEXTGRID, sal_True))
231     {
232         const SwTextGridItem& rGridItem = (const SwTextGridItem&)rSet.Get(RES_TEXTGRID);
233         RadioButton* pButton = 0;
234         switch(rGridItem.GetGridType())
235         {
236             case GRID_NONE :        pButton = &aNoGridRB;    break;
237             case GRID_LINES_ONLY  : pButton = &aLinesGridRB; break;
238             default:                pButton = &aCharsGridRB;
239         }
240         pButton->Check();
241         aDisplayCB.Check(rGridItem.IsDisplayGrid());
242         GridTypeHdl(pButton);
243         aSnapToCharsCB.Check(rGridItem.IsSnapToChars());
244         aLinesPerPageNF.SetValue(rGridItem.GetLines());
245         m_nRubyUserValue = rGridItem.GetBaseHeight();
246         m_bRubyUserValue = sal_True;
247         aTextSizeMF.SetValue(aTextSizeMF.Normalize(m_nRubyUserValue), FUNIT_TWIP);
248         aRubySizeMF.SetValue(aRubySizeMF.Normalize(rGridItem.GetRubyHeight()), FUNIT_TWIP);
249         aCharWidthMF.SetValue(aCharWidthMF.Normalize(rGridItem.GetBaseWidth()), FUNIT_TWIP);
250         aRubyBelowCB.Check(rGridItem.IsRubyTextBelow());
251         aPrintCB.Check(rGridItem.IsPrintGrid());
252         aColorLB.SelectEntry(rGridItem.GetColor());
253     }
254     UpdatePageSize(rSet);
255 
256     aNoGridRB.SaveValue();
257     aLinesGridRB.SaveValue();
258     aSnapToCharsCB.SaveValue();
259     aLinesPerPageNF.SaveValue();
260     aTextSizeMF.SaveValue();
261     aCharsPerLineNF.SaveValue();
262     aRubySizeMF.SaveValue();
263     aCharWidthMF.SaveValue();
264     aRubyBelowCB.SaveValue();
265     aDisplayCB.SaveValue();
266     aPrintCB.SaveValue();
267     aColorLB.SaveValue();
268 }
269 /*-- 06.02.2002 15:25:41---------------------------------------------------
270 
271   -----------------------------------------------------------------------*/
ActivatePage(const SfxItemSet & rSet)272 void    SwTextGridPage::ActivatePage( const SfxItemSet& rSet )
273 {
274     aExampleWN.Hide();
275     aExampleWN.UpdateExample( rSet );
276     UpdatePageSize(rSet);
277     aExampleWN.Show();
278     aExampleWN.Invalidate();
279 }
280 /*-- 06.02.2002 15:25:41---------------------------------------------------
281 
282   -----------------------------------------------------------------------*/
DeactivatePage(SfxItemSet *)283 int SwTextGridPage::DeactivatePage( SfxItemSet* )
284 {
285     return LEAVE_PAGE;
286 }
287 /* -----------------------------08.02.2002 11:57------------------------------
288 
289  ---------------------------------------------------------------------------*/
PutGridItem(SfxItemSet & rSet)290 void SwTextGridPage::PutGridItem(SfxItemSet& rSet)
291 {
292         SwTextGridItem aGridItem;
293         aGridItem.SetGridType(aNoGridRB.IsChecked() ? GRID_NONE :
294             aLinesGridRB.IsChecked() ? GRID_LINES_ONLY : GRID_LINES_CHARS );
295         aGridItem.SetSnapToChars(aSnapToCharsCB.IsChecked());
296         aGridItem.SetLines( static_cast< sal_uInt16 >(aLinesPerPageNF.GetValue()) );
297         aGridItem.SetBaseHeight( static_cast< sal_uInt16 >(
298             m_bRubyUserValue ? m_nRubyUserValue :
299                 aTextSizeMF.Denormalize(aTextSizeMF.GetValue(FUNIT_TWIP))) );
300         aGridItem.SetRubyHeight( static_cast< sal_uInt16 >(aRubySizeMF.Denormalize(aRubySizeMF.GetValue(FUNIT_TWIP))) );
301         aGridItem.SetBaseWidth( static_cast< sal_uInt16 >(aCharWidthMF.Denormalize(aCharWidthMF.GetValue(FUNIT_TWIP))) );
302         aGridItem.SetRubyTextBelow(aRubyBelowCB.IsChecked());
303         aGridItem.SetSquaredMode(m_bSquaredMode);
304         aGridItem.SetDisplayGrid(aDisplayCB.IsChecked());
305         aGridItem.SetPrintGrid(aPrintCB.IsChecked());
306         aGridItem.SetColor(aColorLB.GetSelectEntryColor());
307         rSet.Put(aGridItem);
308 }
309 /* -----------------------------08.02.2002 10:54------------------------------
310 
311  ---------------------------------------------------------------------------*/
UpdatePageSize(const SfxItemSet & rSet)312 void SwTextGridPage::UpdatePageSize(const SfxItemSet& rSet)
313 {
314     if( SFX_ITEM_UNKNOWN !=  rSet.GetItemState( RES_FRAMEDIR, sal_True ))
315     {
316         const SvxFrameDirectionItem& rDirItem =
317                     (const SvxFrameDirectionItem&)rSet.Get(RES_FRAMEDIR);
318         m_bVertical = rDirItem.GetValue() == FRMDIR_VERT_TOP_RIGHT||
319                     rDirItem.GetValue() == FRMDIR_VERT_TOP_LEFT;
320     }
321 
322     if( SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_PAGE_SIZE ))
323     {
324         const SvxSizeItem& rSize = (const SvxSizeItem&)rSet.Get(
325                                             SID_ATTR_PAGE_SIZE);
326         const SvxLRSpaceItem& rLRSpace = (const SvxLRSpaceItem&)rSet.Get(
327                                                             RES_LR_SPACE );
328         const SvxULSpaceItem& rULSpace = (const SvxULSpaceItem&)rSet.Get(
329                                                             RES_UL_SPACE );
330         const SvxBoxItem& rBox = (const SvxBoxItem&) rSet.Get(RES_BOX);
331         sal_Int32 nDistanceLR = rLRSpace.GetLeft() + rLRSpace.GetRight();
332         sal_Int32 nDistanceUL = rULSpace.GetUpper() + rULSpace.GetLower();
333 
334         sal_Int32 nValue1 = rSize.GetSize().Height() - nDistanceUL -
335                 rBox.GetDistance(BOX_LINE_TOP) -
336                                     rBox.GetDistance(BOX_LINE_BOTTOM);
337         sal_Int32 nValue2 = rSize.GetSize().Width() - nDistanceLR -
338                 rBox.GetDistance(BOX_LINE_LEFT) -
339                                     rBox.GetDistance(BOX_LINE_RIGHT);
340         if(m_bVertical)
341         {
342             m_aPageSize.Width() = nValue1;
343             m_aPageSize.Height() = nValue2;
344         }
345         else
346         {
347             m_aPageSize.Width() = nValue2;
348             m_aPageSize.Height() = nValue1;
349         }
350 
351         sal_Int32 nTextSize = static_cast< sal_Int32 >(m_bRubyUserValue ?
352                     m_nRubyUserValue :
353                         aTextSizeMF.Denormalize(aTextSizeMF.GetValue(FUNIT_TWIP)));
354 
355         if ( m_bSquaredMode )
356         {
357             aCharsPerLineNF.SetValue(m_aPageSize.Width() / nTextSize);
358         }
359         else
360         {
361             sal_Int32 nTextWidth = static_cast< sal_Int32 >(aCharWidthMF.Denormalize(aCharWidthMF.GetValue(FUNIT_TWIP)));
362             aLinesPerPageNF.SetValue(m_aPageSize.Height() / nTextSize);
363             if (nTextWidth)
364                 aCharsPerLineNF.SetValue(m_aPageSize.Width() / nTextWidth);
365             else
366                 aCharsPerLineNF.SetValue( 45 );
367         }
368     }
369 }
370 /* -----------------------------06.02.2002 15:24------------------------------
371 
372  ---------------------------------------------------------------------------*/
GetRanges()373 sal_uInt16* SwTextGridPage::GetRanges()
374 {
375     static sal_uInt16 __FAR_DATA aPageRg[] = {
376         RES_TEXTGRID, RES_TEXTGRID,
377         0};
378     return aPageRg;
379 }
380 /* -----------------------------08.02.2002 10:56------------------------------
381 
382  ---------------------------------------------------------------------------*/
IMPL_LINK(SwTextGridPage,CharorLineChangedHdl,SpinField *,pField)383 IMPL_LINK(SwTextGridPage, CharorLineChangedHdl, SpinField*, pField)
384 {
385     //if in squared mode
386     if ( m_bSquaredMode )
387     {
388         if(&aCharsPerLineNF == pField)
389         {
390             long nWidth = (long)(m_aPageSize.Width() / aCharsPerLineNF.GetValue());
391             aTextSizeMF.SetValue(aTextSizeMF.Normalize(nWidth), FUNIT_TWIP);
392             //prevent rounding errors in the MetricField by saving the used value
393             m_nRubyUserValue = nWidth;
394             m_bRubyUserValue = sal_True;
395 
396         }
397 		//set maximum line per page
398         {
399             sal_Int32 nMaxLines = static_cast< sal_Int32 >(m_aPageSize.Height() /
400                 (   aTextSizeMF.Denormalize(aTextSizeMF.GetValue(FUNIT_TWIP)) +
401                     aRubySizeMF.Denormalize(aRubySizeMF.GetValue(FUNIT_TWIP))));
402             aLinesPerPageNF.SetMax(nMaxLines);
403         }
404 	}
405     else//in normal mode
406     {
407         if(&aLinesPerPageNF == pField)
408         {
409             long nHeight = static_cast< sal_Int32 >(m_aPageSize.Height() / aLinesPerPageNF.GetValue());
410             aTextSizeMF.SetValue(aTextSizeMF.Normalize(nHeight), FUNIT_TWIP);
411             aRubySizeMF.SetValue(0, FUNIT_TWIP);
412 
413             m_nRubyUserValue = nHeight;
414             m_bRubyUserValue = sal_True;
415         }
416         else if (&aCharsPerLineNF == pField)
417         {
418             long nWidth = static_cast< sal_Int32 >(m_aPageSize.Width() / aCharsPerLineNF.GetValue());
419             aCharWidthMF.SetValue(aCharWidthMF.Normalize(nWidth), FUNIT_TWIP);
420         }
421     }
422     GridModifyHdl(0);
423     return 0;
424 }
425 /* -----------------------------04.09.2006 15:46------------------------------
426  ---------------------------------------------------------------------------*/
IMPL_LINK(SwTextGridPage,TextSizeChangedHdl,SpinField *,pField)427 IMPL_LINK(SwTextGridPage, TextSizeChangedHdl, SpinField*, pField)
428 {
429     //if in squared mode
430     if( m_bSquaredMode )
431     {
432         if (&aTextSizeMF == pField)
433         {
434             sal_Int32 nTextSize = static_cast< sal_Int32 >(aTextSizeMF.Denormalize(aTextSizeMF.GetValue(FUNIT_TWIP)));
435             aCharsPerLineNF.SetValue(m_aPageSize.Width() / nTextSize);
436             m_bRubyUserValue = sal_False;
437         }
438 		//set maximum line per page
439         {
440             sal_Int32 nMaxLines = static_cast< sal_Int32 >(m_aPageSize.Height() /
441                 (   aTextSizeMF.Denormalize(aTextSizeMF.GetValue(FUNIT_TWIP)) +
442                     aRubySizeMF.Denormalize(aRubySizeMF.GetValue(FUNIT_TWIP))));
443             aLinesPerPageNF.SetMax(nMaxLines);
444         }
445     }
446     else
447     {
448         if (&aTextSizeMF == pField)
449         {
450             sal_Int32 nTextSize = static_cast< sal_Int32 >(aTextSizeMF.Denormalize(aTextSizeMF.GetValue(FUNIT_TWIP)));
451             aLinesPerPageNF.SetValue(m_aPageSize.Height() / nTextSize);
452             m_bRubyUserValue = sal_False;
453         }
454         else if (&aCharWidthMF == pField)
455         {
456             sal_Int32 nTextWidth = static_cast< sal_Int32 >(aCharWidthMF.Denormalize(aCharWidthMF.GetValue(FUNIT_TWIP)));
457             if (nTextWidth)
458                 aCharsPerLineNF.SetValue(m_aPageSize.Width() / nTextWidth);
459             else
460                 aCharsPerLineNF.SetValue( 45 );
461         }
462         //rubySize is disabled
463     }
464     GridModifyHdl(0);
465     return 0;
466 }
467 /* -----------------------------22.04.2002 14:53------------------------------
468 
469  ---------------------------------------------------------------------------*/
IMPL_LINK(SwTextGridPage,GridTypeHdl,RadioButton *,pButton)470 IMPL_LINK(SwTextGridPage, GridTypeHdl, RadioButton*, pButton)
471 {
472     sal_Bool bEnable = &aNoGridRB != pButton;
473     sal_Int32 nIndex = 0;
474     while(aControls[nIndex])
475         aControls[nIndex++]->Enable(bEnable);
476     //one special case
477     if(bEnable)
478         DisplayGridHdl(&aDisplayCB);
479 
480 	bEnable = &aCharsGridRB == pButton;
481 	aSnapToCharsCB.Enable(bEnable);
482 
483 	bEnable = &aLinesGridRB == pButton;
484 	if(bEnable && !m_bSquaredMode )
485 	{
486 		aCharsPerLineFT.Enable(sal_False);
487 		aCharsPerLineNF.Enable(sal_False);
488 		aCharWidthFT.Enable(sal_False);
489 		aCharWidthMF.Enable(sal_False);
490 	}
491 
492     GridModifyHdl(0);
493     return 0;
494 }
495 /* -----------------------------22.04.2002 15:46------------------------------
496 
497  ---------------------------------------------------------------------------*/
IMPL_LINK(SwTextGridPage,DisplayGridHdl,CheckBox *,EMPTYARG)498 IMPL_LINK(SwTextGridPage, DisplayGridHdl, CheckBox*, EMPTYARG)
499 {
500     aPrintCB.Enable(aDisplayCB.IsChecked());
501     return 0;
502 }
503 /* -----------------------------08.02.2002 11:54------------------------------
504 
505  ---------------------------------------------------------------------------*/
IMPL_LINK(SwTextGridPage,GridModifyHdl,void *,EMPTYARG)506 IMPL_LINK(SwTextGridPage, GridModifyHdl, void*, EMPTYARG)
507 {
508     const SfxItemSet& rOldSet = GetItemSet();
509     SfxItemSet aSet(rOldSet);
510     const SfxItemSet* pExSet = GetTabDialog()->GetExampleSet();
511     if(pExSet)
512         aSet.Put(*pExSet);
513     PutGridItem(aSet);
514     aExampleWN.UpdateExample(aSet);
515     return 0;
516 }
517 
518