xref: /aoo4110/main/sw/source/ui/frmdlg/colex.cxx (revision b1cdbd2c)
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 
28 
29 
30 #include "cmdid.h"
31 #include "hintids.hxx"
32 #include <algorithm>
33 
34 
35 #include <svl/eitem.hxx>
36 #include <editeng/lrspitem.hxx>
37 #include <editeng/ulspitem.hxx>
38 #include <editeng/sizeitem.hxx>
39 #include <svx/pageitem.hxx>
40 #include <editeng/brshitem.hxx>
41 #include <editeng/frmdiritem.hxx>
42 #include <vcl/bitmap.hxx>
43 #include <vcl/graph.hxx>
44 #include <tgrditem.hxx>
45 #include <viewopt.hxx>
46 #include "colex.hxx"
47 #include "colmgr.hxx"
48 
49 /*-----------------------------------------------------------------------
50 	Beschreibung: Uebernahme der aktualisierten Werte aus dem Set
51  -----------------------------------------------------------------------*/
UpdateExample(const SfxItemSet & rSet)52 void SwPageExample::UpdateExample( const SfxItemSet& rSet )
53 {
54 	const SvxPageItem* pPage = 0;
55 	SfxItemPool* pPool = rSet.GetPool();
56 	sal_uInt16 nWhich = pPool->GetWhich( SID_ATTR_PAGE );
57 
58 	if ( rSet.GetItemState( nWhich, sal_False ) == SFX_ITEM_SET )
59 	{
60 		// Ausrichtung
61 		pPage = (const SvxPageItem*)&rSet.Get( nWhich );
62 
63 		if ( pPage )
64 			SetUsage( pPage->GetPageUsage() );
65 	}
66 
67 	nWhich = pPool->GetWhich( SID_ATTR_PAGE_SIZE );
68 
69 	if ( rSet.GetItemState( nWhich, sal_False ) == SFX_ITEM_SET )
70 	{
71 		// Orientation und Size aus dem PageItem
72 		const SvxSizeItem& rSize = (const SvxSizeItem&)rSet.Get( nWhich );
73         SetSize( rSize.GetSize() );
74 	}
75 	nWhich = RES_LR_SPACE;
76 	if ( rSet.GetItemState( nWhich, sal_False ) == SFX_ITEM_SET )
77 	{
78 		// linken und rechten Rand einstellen
79 		const SvxLRSpaceItem& rLRSpace = (const SvxLRSpaceItem&)rSet.Get( nWhich );
80 
81 		SetLeft( rLRSpace.GetLeft() );
82 		SetRight( rLRSpace.GetRight() );
83 	}
84 	else
85 	{
86 		SetLeft( 0 );
87 		SetRight( 0 );
88 	}
89 
90 	nWhich = RES_UL_SPACE;
91 
92 	if ( rSet.GetItemState( nWhich, sal_False ) == SFX_ITEM_SET )
93 	{
94 		// oberen und unteren Rand einstellen
95 		const SvxULSpaceItem& rULSpace = (const SvxULSpaceItem&)rSet.Get( nWhich );
96 
97 		SetTop( rULSpace.GetUpper() );
98 		SetBottom( rULSpace.GetLower() );
99 	}
100 	else
101 	{
102 		SetTop( 0 );
103 		SetBottom( 0 );
104 	}
105 
106 
107 	// Kopfzeilen-Attribute auswerten
108 	const SfxPoolItem* pItem;
109 	if( SFX_ITEM_SET == rSet.GetItemState( pPool->GetWhich( SID_ATTR_PAGE_HEADERSET),
110 			sal_False, &pItem ) )
111 	{
112 		const SfxItemSet& rHeaderSet = ((SvxSetItem*)pItem)->GetItemSet();
113 		const SfxBoolItem& rHeaderOn =
114 			(const SfxBoolItem&)rHeaderSet.Get( pPool->GetWhich( SID_ATTR_PAGE_ON ) );
115 
116 		if ( rHeaderOn.GetValue() )
117 		{
118 			const SvxSizeItem& rSize =
119 				(const SvxSizeItem&)rHeaderSet.Get(pPool->GetWhich(SID_ATTR_PAGE_SIZE));
120 
121 			const SvxULSpaceItem& rUL = (const SvxULSpaceItem&)rHeaderSet.Get(
122 										pPool->GetWhich(SID_ATTR_ULSPACE));
123 			const SvxLRSpaceItem& rLR = (const SvxLRSpaceItem&)rHeaderSet.Get(
124 										pPool->GetWhich(SID_ATTR_LRSPACE));
125 
126 			SetHdHeight( rSize.GetSize().Height() - rUL.GetLower());
127 			SetHdDist( rUL.GetLower() );
128 			SetHdLeft( rLR.GetLeft() );
129 			SetHdRight( rLR.GetRight() );
130 			SetHeader( sal_True );
131             if ( rHeaderSet.GetItemState( RES_BACKGROUND ) == SFX_ITEM_SET )
132 			{
133 				const SvxBrushItem& rItem =
134                     (const SvxBrushItem&)rHeaderSet.Get( RES_BACKGROUND );
135                 SetHdColor( rItem.GetColor() );
136 			}
137             if ( rHeaderSet.GetItemState( RES_BOX ) == SFX_ITEM_SET )
138 			{
139 				const SvxBoxItem& rItem =
140                     (const SvxBoxItem&)rHeaderSet.Get( RES_BOX );
141                 SetHdBorder( rItem );
142 			}
143         }
144 		else
145 			SetHeader( sal_False );
146 	}
147 
148 	if( SFX_ITEM_SET == rSet.GetItemState( pPool->GetWhich( SID_ATTR_PAGE_FOOTERSET),
149 			sal_False, &pItem ) )
150 	{
151 		const SfxItemSet& rFooterSet = ((SvxSetItem*)pItem)->GetItemSet();
152 		const SfxBoolItem& rFooterOn =
153 			(const SfxBoolItem&)rFooterSet.Get( SID_ATTR_PAGE_ON );
154 
155 		if ( rFooterOn.GetValue() )
156 		{
157 			const SvxSizeItem& rSize =
158 				(const SvxSizeItem&)rFooterSet.Get( pPool->GetWhich( SID_ATTR_PAGE_SIZE ) );
159 
160 			const SvxULSpaceItem& rUL = (const SvxULSpaceItem&)rFooterSet.Get(
161 										pPool->GetWhich( SID_ATTR_ULSPACE ) );
162 			const SvxLRSpaceItem& rLR = (const SvxLRSpaceItem&)rFooterSet.Get(
163 										pPool->GetWhich( SID_ATTR_LRSPACE ) );
164 
165 			SetFtHeight( rSize.GetSize().Height() - rUL.GetUpper());
166 			SetFtDist( rUL.GetUpper() );
167 			SetFtLeft( rLR.GetLeft() );
168 			SetFtRight( rLR.GetRight() );
169 			SetFooter( sal_True );
170             if( rFooterSet.GetItemState( RES_BACKGROUND ) == SFX_ITEM_SET )
171 			{
172 				const SvxBrushItem& rItem =
173                     (const SvxBrushItem&)rFooterSet.Get( RES_BACKGROUND );
174                 SetFtColor( rItem.GetColor() );
175 			}
176             if( rFooterSet.GetItemState( RES_BOX ) == SFX_ITEM_SET )
177 			{
178 				const SvxBoxItem& rItem =
179                     (const SvxBoxItem&)rFooterSet.Get( RES_BOX );
180                 SetFtBorder( rItem );
181 			}
182         }
183 		else
184 			SetFooter( sal_False );
185 	}
186     if( SFX_ITEM_SET == rSet.GetItemState( RES_BACKGROUND,
187 			sal_False, &pItem ) )
188 	{
189         SetColor( ( (const SvxBrushItem*)pItem )->GetColor() );
190 		const Graphic* pGrf = ( (const SvxBrushItem*)pItem )->GetGraphic();
191 
192 		if ( pGrf )
193 		{
194 			Bitmap aBitmap = pGrf->GetBitmap();
195             SetBitmap( &aBitmap );
196 		}
197 		else
198             SetBitmap( NULL );
199 	}
200 
201 	Invalidate();
202 }
203 /*-----------------------------------------------------------------------
204 	Beschreibung:
205  -----------------------------------------------------------------------*/
206 
207 
DrawPage(const Point & rOrg,const sal_Bool bSecond,const sal_Bool bEnabled)208 void SwColExample::DrawPage( const Point& rOrg,
209 							const sal_Bool bSecond,
210 							const sal_Bool bEnabled )
211 {
212     SwPageExample::DrawPage( rOrg, bSecond, bEnabled );
213     sal_uInt16 nColumnCount;
214     if( pColMgr && 0 != (nColumnCount = pColMgr->GetCount()))
215 	{
216 		long nL = GetLeft();
217 		long nR = GetRight();
218 
219 		if ( GetUsage() == SVX_PAGE_MIRROR && !bSecond )
220 		{
221 			// fuer gespiegelt drehen
222 			nL = GetRight();
223 			nR = GetLeft();
224 		}
225 
226         SetFillColor( Color( COL_LIGHTGRAY ) );
227         Rectangle aRect;
228         aRect.Right() = rOrg.X() + GetSize().Width() - nR;
229         aRect.Left()  = rOrg.X() + nL;
230         aRect.Top()   = rOrg.Y() + GetTop()
231                         + GetHdHeight() + GetHdDist();
232         aRect.Bottom()= rOrg.Y() + GetSize().Height() - GetBottom()
233                         - GetFtHeight() - GetFtDist();
234         DrawRect(aRect);
235 
236         if(GetColor() == Color(COL_TRANSPARENT))
237         {
238             const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
239             const Color& rFieldColor = rStyleSettings.GetFieldColor();
240             SetFillColor( rFieldColor );
241         }
242         else
243             SetFillColor( GetColor() );
244 
245         // #97495# make sure that the automatic column widht's are always equal
246         sal_Bool bAutoWidth = pColMgr->IsAutoWidth();
247         sal_Int32 nAutoColWidth = 0;
248         if(bAutoWidth)
249         {
250             sal_Int32 nColumnWidthSum = 0;
251             sal_uInt16 i;
252             for(i = 0; i < nColumnCount; ++i)
253                 nColumnWidthSum += pColMgr->GetColWidth( i );
254             nAutoColWidth = nColumnWidthSum / nColumnCount;
255         }
256 
257         sal_uInt16 i;
258         for( i = 0; i < nColumnCount; i++)
259         {
260             if(!bAutoWidth)
261                 nAutoColWidth = pColMgr->GetColWidth( i );
262             aRect.Right() = aRect.Left() + nAutoColWidth;
263             DrawRect(aRect);
264             if(i < nColumnCount - 1)
265                 aRect.Left() = aRect.Right() + pColMgr->GetGutterWidth(i);
266         }
267         if(pColMgr->HasLine())
268         {
269             Point aUp( rOrg.X() + nL, rOrg.Y() + GetTop() );
270             Point aDown( rOrg.X() + nL, rOrg.Y() + GetSize().Height()
271                         - GetBottom() - GetFtHeight() - GetFtDist() );
272 
273             if( pColMgr->GetLineHeightPercent() != 100 )
274             {
275                 long nLength = aDown.Y() - aUp.Y();
276                 nLength -= nLength * pColMgr->GetLineHeightPercent() / 100;
277                 switch(pColMgr->GetAdjust())
278                 {
279                     case COLADJ_BOTTOM: aUp.Y() += nLength; break;
280                     case COLADJ_TOP: aDown.Y() -= nLength; break;
281                     case COLADJ_CENTER:
282                         aUp.Y() += nLength / 2;
283                         aDown.Y() -= nLength / 2;
284                     break;
285                     default:; // prevent warning
286                 }
287             }
288 
289             int nDist;
290             for( i = 0; i < nColumnCount -  1; i++)
291             {
292                 int nGutter = pColMgr->GetGutterWidth(i);
293                 nDist = pColMgr->GetColWidth( i ) + nGutter;
294                 nDist -= (i == 0) ?
295                     nGutter/2 :
296                         0;
297                 aUp.X() += nDist;
298                 aDown.X() += nDist;
299                 DrawLine( aUp, aDown );
300 
301             }
302         }
303 	}
304 }
305 
306 /*-----------------25.10.96 09.15-------------------
307 
308 --------------------------------------------------*/
309 
310 
SwColumnOnlyExample(Window * pParent,const ResId & rResId)311 SwColumnOnlyExample::SwColumnOnlyExample( Window* pParent, const ResId& rResId) :
312 	Window(pParent, rResId),
313     m_aFrmSize(1,1)
314 {
315 	SetMapMode( MapMode( MAP_TWIP ) );
316     m_aWinSize = GetOutputSizePixel();
317     m_aWinSize.Height() -= 4;
318     m_aWinSize.Width() -= 4;
319 
320     m_aWinSize = PixelToLogic( m_aWinSize );
321 
322     SetBorderStyle( WINDOW_BORDER_MONO );
323 
324     m_aFrmSize  = SvxPaperInfo::GetPaperSize(PAPER_A4);// DIN A4
325     ::FitToActualSize(m_aCols, (sal_uInt16)m_aFrmSize.Width());
326 
327     long nHeight = m_aFrmSize.Height();
328     Fraction aScale( m_aWinSize.Height(), nHeight );
329     MapMode aMapMode( GetMapMode() );
330     aMapMode.SetScaleX( aScale );
331     aMapMode.SetScaleY( aScale );
332     SetMapMode( aMapMode );
333 }
334 
335 /*-----------------25.10.96 09.16-------------------
336 
337 --------------------------------------------------*/
338 
339 
Paint(const Rectangle &)340 void SwColumnOnlyExample::Paint( const Rectangle& /*rRect*/ )
341 {
342     const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
343     const Color& rFieldColor = rStyleSettings.GetFieldColor();
344     const Color& rDlgColor = rStyleSettings.GetDialogColor();
345     const Color& rFieldTextColor = SwViewOption::GetFontColor();
346     Color aGrayColor(COL_LIGHTGRAY);
347     if(rFieldColor == aGrayColor)
348         aGrayColor.Invert();
349 
350     Size aLogSize(PixelToLogic(GetOutputSizePixel()));
351     Rectangle aCompleteRect(Point(0,0), aLogSize);
352     SetLineColor(rDlgColor);
353     SetFillColor(rDlgColor);
354     DrawRect(aCompleteRect);
355 
356     SetLineColor( rFieldTextColor );
357     Point aTL(  (aLogSize.Width() - m_aFrmSize.Width()) / 2,
358                 (aLogSize.Height() - m_aFrmSize.Height()) / 2);
359     Rectangle aRect(aTL, m_aFrmSize);
360 
361     //draw a shadow rectangle
362     SetFillColor( Color(COL_GRAY) );
363     Rectangle aShadowRect(aRect);
364     aShadowRect.Move(aTL.Y(), aTL.Y());
365     DrawRect(aShadowRect);
366 
367     SetFillColor( rFieldColor );
368     DrawRect(aRect);
369 
370     SetFillColor( aGrayColor );
371 
372     //Spaltentrenner?
373     long nLength = aLogSize.Height() - 2 * aTL.Y();
374     Point aUp( aTL );
375     Point aDown( aTL.X(), nLength );
376     sal_Bool bLines = sal_False;
377     if(m_aCols.GetLineAdj() != COLADJ_NONE)
378     {
379         bLines = sal_True;
380 
381         sal_uInt16 nPercent = m_aCols.GetLineHeight();
382         if( nPercent != 100 )
383         {
384             nLength -= nLength * nPercent / 100;
385             switch(m_aCols.GetLineAdj())
386             {
387                 case COLADJ_BOTTOM: aUp.Y() += nLength; break;
388                 case COLADJ_TOP: aDown.Y() -= nLength; break;
389                 case COLADJ_CENTER:
390                         aUp.Y() += nLength / 2;
391                         aDown.Y() -= nLength / 2;
392                 break;
393                 default:; //prevent warning
394             }
395         }
396 
397     }
398     const SwColumns& rCols = m_aCols.GetColumns();
399     sal_uInt16 nColCount = rCols.Count();
400     if( nColCount )
401     {
402         DrawRect(aRect);
403         SetFillColor( rFieldColor );
404         Rectangle aFrmRect(aTL, m_aFrmSize);
405         long nSum = aTL.X();
406         for(sal_uInt16 i = 0; i < nColCount; i++)
407         {
408             SwColumn* pCol = rCols[i];
409             aFrmRect.Left()    = nSum + pCol->GetLeft();//nSum + pCol->GetLeft() + aTL.X();
410             nSum              += pCol->GetWishWidth();
411             aFrmRect.Right()   = nSum - pCol->GetRight();
412             DrawRect(aFrmRect);
413         }
414         if(bLines )
415         {
416             nSum = aTL.X();
417             for(sal_uInt16 i = 0; i < nColCount - 1; i++)
418             {
419                 nSum += rCols[i]->GetWishWidth();
420                 aUp.X() = nSum;
421                 aDown.X() = nSum;
422                 DrawLine(aUp, aDown);
423             }
424         }
425     }
426 }
427 
428 /*-----------------25.10.96 12.05-------------------
429 
430 --------------------------------------------------*/
431 
432 
SetColumns(const SwFmtCol & rCol)433 void  SwColumnOnlyExample::SetColumns(const SwFmtCol& rCol)
434 {
435     m_aCols = rCol;
436     sal_uInt16 nWishSum = m_aCols.GetWishWidth();
437     long nFrmWidth = m_aFrmSize.Width();
438     SwColumns& rCols = m_aCols.GetColumns();
439     sal_uInt16 nColCount = rCols.Count();
440 
441     for(sal_uInt16 i = 0; i < nColCount; i++)
442     {
443         SwColumn* pCol = rCols[i];
444         long nWish = pCol->GetWishWidth();
445         nWish *= nFrmWidth;
446         nWish /= nWishSum;
447         pCol->SetWishWidth((sal_uInt16)nWish);
448         long nLeft = pCol->GetLeft();
449         nLeft *= nFrmWidth;
450         nLeft /= nWishSum;
451         pCol->SetLeft((sal_uInt16)nLeft);
452         long nRight = pCol->GetRight();
453         nRight *= nFrmWidth;
454         nRight /= nWishSum;
455         pCol->SetRight((sal_uInt16)nRight);
456     }
457     // #97495# make sure that the automatic column width's are always equal
458     if(nColCount && m_aCols.IsOrtho())
459     {
460         sal_Int32 nColumnWidthSum = 0;
461         sal_uInt16 i;
462         for(i = 0; i < nColCount; ++i)
463         {
464             SwColumn* pCol = rCols[i];
465             nColumnWidthSum += pCol->GetWishWidth();
466             nColumnWidthSum -= (pCol->GetRight() + pCol->GetLeft());
467         }
468         nColumnWidthSum /= nColCount;
469         for(i = 0; i < nColCount; ++i)
470         {
471             SwColumn* pCol = rCols[i];
472             pCol->SetWishWidth( static_cast< sal_uInt16 >(nColumnWidthSum + pCol->GetRight() + pCol->GetLeft()));
473         }
474     }
475 }
476 /* -----------------------------08.02.2002 11:44------------------------------
477 
478  ---------------------------------------------------------------------------*/
~SwPageGridExample()479 SwPageGridExample::~SwPageGridExample()
480 {
481     delete pGridItem;
482 }
483 /* -----------------------------08.02.2002 11:48------------------------------
484 
485  ---------------------------------------------------------------------------*/
486 #define MAX_ROWS    10
487 #define MAX_LINES   15
DrawPage(const Point & rOrg,const sal_Bool bSecond,const sal_Bool bEnabled)488 void SwPageGridExample::DrawPage( const Point& rOrg,
489 						   const sal_Bool bSecond,
490                            const sal_Bool bEnabled )
491 {
492     SwPageExample::DrawPage(rOrg, bSecond, bEnabled);
493     if(pGridItem && pGridItem->GetGridType())
494     {
495         //paint the grid now
496         Color aLineColor = pGridItem->GetColor();
497         if(aLineColor.GetColor() == COL_AUTO)
498         {
499             aLineColor = GetFillColor();
500             aLineColor.Invert();
501         }
502         SetLineColor(aLineColor);
503         long nL = GetLeft();
504 		long nR = GetRight();
505 
506 		if ( GetUsage() == SVX_PAGE_MIRROR && !bSecond )
507 		{
508 			// fuer gespiegelt drehen
509 			nL = GetRight();
510 			nR = GetLeft();
511 		}
512 
513         Rectangle aRect;
514 		aRect.Right() = rOrg.X() + GetSize().Width() - nR;
515 		aRect.Left()  = rOrg.X() + nL;
516 		aRect.Top()	  = rOrg.Y() + GetTop()
517 						+ GetHdHeight() + GetHdDist();
518 		aRect.Bottom()= rOrg.Y() + GetSize().Height() - GetBottom()
519 						- GetFtHeight() - GetFtDist();
520 
521         //increase the values to get a 'viewable' preview
522         sal_Int32 nBaseHeight = pGridItem->GetBaseHeight() * 3;
523         sal_Int32 nRubyHeight = pGridItem->GetRubyHeight() * 3;
524 
525         //detect height of rectangles
526         Rectangle aRubyRect(aRect.TopLeft(),
527                     m_bVertical ?
528                     Size(nRubyHeight, aRect.GetHeight()) :
529                     Size(aRect.GetWidth(), nRubyHeight));
530         Rectangle aCharRect(aRect.TopLeft(),
531                     m_bVertical ?
532                     Size(nBaseHeight, aRect.GetHeight()) :
533                     Size(aRect.GetWidth(), nBaseHeight));
534 
535         sal_Int32 nLineHeight = nBaseHeight + nRubyHeight;
536 
537         //detect count of rectangles
538         sal_Int32 nLines = (m_bVertical ? aRect.GetWidth(): aRect.GetHeight()) / nLineHeight;
539         if(nLines > pGridItem->GetLines())
540             nLines = pGridItem->GetLines();
541 
542         // determine start position
543         if(m_bVertical)
544         {
545             sal_Int16 nXStart = static_cast< sal_Int16 >(aRect.GetWidth() / 2 - nLineHeight * nLines /2);
546             aRubyRect.Move(nXStart, 0);
547             aCharRect.Move(nXStart, 0);
548         }
549         else
550         {
551             sal_Int16 nYStart = static_cast< sal_Int16 >(aRect.GetHeight() / 2 - nLineHeight * nLines /2);
552             aRubyRect.Move(0, nYStart);
553             aCharRect.Move(0, nYStart);
554         }
555 
556         if(pGridItem->IsRubyTextBelow())
557             m_bVertical ? aRubyRect.Move(nBaseHeight, 0) : aRubyRect.Move(0, nBaseHeight);
558         else
559             m_bVertical ? aCharRect.Move(nRubyHeight, 0) : aCharRect.Move(0, nRubyHeight);
560 
561         //vertical lines
562         sal_Bool bBothLines = pGridItem->GetGridType() == GRID_LINES_CHARS;
563         SetFillColor( Color( COL_TRANSPARENT ) );
564         sal_Int32 nXMove = m_bVertical ? nLineHeight : 0;
565 		sal_Int32 nYMove = m_bVertical ? 0 : nLineHeight;
566 		for(sal_Int32 nLine = 0; nLine < nLines; nLine++)
567         {
568             DrawRect(aRubyRect);
569             DrawRect(aCharRect);
570             if(bBothLines)
571             {
572                 Point aStart = aCharRect.TopLeft();
573                 Point aEnd = m_bVertical ? aCharRect.TopRight() : aCharRect.BottomLeft();
574                 while(m_bVertical ? aStart.Y() < aRect.Bottom(): aStart.X() < aRect.Right())
575                 {
576                     DrawLine(aStart, aEnd);
577                     if(m_bVertical)
578                         aStart.Y() = aEnd.Y() += nBaseHeight;
579                     else
580                         aStart.X() = aEnd.X() += nBaseHeight;
581                 }
582             }
583             aRubyRect.Move(nXMove, nYMove);
584             aCharRect.Move(nXMove, nYMove);
585         }
586     }
587 }
588 /* -----------------------------08.02.2002 11:48------------------------------
589 
590  ---------------------------------------------------------------------------*/
UpdateExample(const SfxItemSet & rSet)591 void SwPageGridExample::UpdateExample( const SfxItemSet& rSet )
592 {
593     DELETEZ(pGridItem);
594     //get the grid information
595     if(SFX_ITEM_AVAILABLE <= rSet.GetItemState(RES_TEXTGRID, sal_True))
596         pGridItem = (SwTextGridItem*)((const SwTextGridItem&)rSet.Get(RES_TEXTGRID)).Clone();
597     if( SFX_ITEM_AVAILABLE <= rSet.GetItemState( RES_FRAMEDIR, sal_True ))
598 	{
599         const SvxFrameDirectionItem& rDirItem =
600                     (const SvxFrameDirectionItem&)rSet.Get(RES_FRAMEDIR);
601         m_bVertical = rDirItem.GetValue() == FRMDIR_VERT_TOP_RIGHT||
602                     rDirItem.GetValue() == FRMDIR_VERT_TOP_LEFT;
603     }
604     SwPageExample::UpdateExample(rSet);
605 }
606 
607