xref: /aoo4110/main/vcl/source/gdi/graphictools.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_vcl.hxx"
26 #include <tools/vcompat.hxx>
27 
28 #include <vcl/graphictools.hxx>
29 
polyToString(const Polygon & rPoly)30 static ::rtl::OString polyToString( const Polygon& rPoly )
31 {
32     ::rtl::OString aStr;
33     sal_uInt16 nVertex;
34     for(nVertex=0; nVertex<rPoly.GetSize(); ++nVertex)
35     {
36         aStr += "(";
37         switch( rPoly.GetFlags(nVertex) )
38         {
39             case POLY_NORMAL:
40             case POLY_SMOOTH:
41             case POLY_SYMMTR:
42                 aStr += "n: ";
43                 break;
44 
45             case POLY_CONTROL:
46                 aStr += "c: ";
47                 break;
48 
49             default:
50                 DBG_ERROR( "SvtGraphicStroke::polyToString invalid flag");
51                 break;
52         }
53         aStr += ::rtl::OString::valueOf( static_cast< double >( rPoly[nVertex].getX() ) );
54         aStr += ",";
55         aStr += ::rtl::OString::valueOf( static_cast< double >( rPoly[nVertex].getY() ) );
56         aStr += ") ";
57     }
58 
59     return aStr;
60 }
61 
polyPolyToString(const PolyPolygon & rPolyPoly)62 static ::rtl::OString polyPolyToString( const PolyPolygon& rPolyPoly )
63 {
64     ::rtl::OString aStr;
65     sal_uInt16 nPoly;
66     for(nPoly=0; nPoly<rPolyPoly.Count(); ++nPoly)
67     {
68         const Polygon& rPoly = rPolyPoly[nPoly];
69 
70         aStr += "{ ";
71         aStr += polyToString( rPoly );
72         aStr += "} ";
73     }
74 
75     return aStr;
76 }
77 
dashToString(const SvtGraphicStroke::DashArray & rDashArray)78 static ::rtl::OString dashToString( const SvtGraphicStroke::DashArray& rDashArray )
79 {
80     ::rtl::OString aStr;
81 
82     aStr += "dash: [ ";
83 
84     int i, nDashes( rDashArray.size() );
85     for(i=0; i<nDashes; ++i)
86     {
87         aStr += ::rtl::OString::valueOf( rDashArray[i] );
88         aStr += " ";
89     }
90 
91     aStr += "] ";
92 
93     return aStr;
94 }
95 
colorToString(Color aColor)96 static ::rtl::OString colorToString( Color aColor )
97 {
98     ::rtl::OString aStr;
99 
100     aStr += "color: [ ";
101     aStr += ::rtl::OString::valueOf( aColor.GetRed() );
102     aStr += " ";
103     aStr += ::rtl::OString::valueOf( aColor.GetGreen() );
104     aStr += " ";
105     aStr += ::rtl::OString::valueOf( aColor.GetBlue() );
106     aStr += " ] ";
107 
108     return aStr;
109 }
110 
111 ////////////////////////////////////////////////////////////////////////////
112 
Transform()113 SvtGraphicFill::Transform::Transform()
114 {
115     matrix[0] = 1.0; matrix[1] = 0.0; matrix[2] = 0.0;
116     matrix[3] = 0.0; matrix[4] = 1.0; matrix[5] = 0.0;
117 }
118 
119 ////////////////////////////////////////////////////////////////////////////
120 
SvtGraphicStroke()121 SvtGraphicStroke::SvtGraphicStroke() :
122     maPath(),
123     maStartArrow(),
124     maEndArrow(),
125     mfTransparency(),
126     mfStrokeWidth(),
127     maCapType(),
128     maJoinType(),
129     mfMiterLimit( 3.0 ),
130     maDashArray()
131 {
132 }
133 
SvtGraphicStroke(const Polygon & rPath,const PolyPolygon & rStartArrow,const PolyPolygon & rEndArrow,double fTransparency,double fStrokeWidth,CapType aCap,JoinType aJoin,double fMiterLimit,const DashArray & rDashArray)134 SvtGraphicStroke::SvtGraphicStroke( const Polygon& 		rPath,
135                                     const PolyPolygon&	rStartArrow,
136                                     const PolyPolygon&	rEndArrow,
137                                     double				fTransparency,
138                                     double 				fStrokeWidth,
139                                     CapType				aCap,
140                                     JoinType			aJoin,
141                                     double				fMiterLimit,
142                                     const DashArray&	rDashArray	) :
143     maPath( rPath ),
144     maStartArrow( rStartArrow ),
145     maEndArrow( rEndArrow ),
146     mfTransparency( fTransparency ),
147     mfStrokeWidth( fStrokeWidth ),
148     maCapType( aCap ),
149     maJoinType( aJoin ),
150     mfMiterLimit( fMiterLimit ),
151     maDashArray( rDashArray )
152 {
153 }
154 
getPath(Polygon & rPath) const155 void SvtGraphicStroke::getPath( Polygon& rPath ) const
156 {
157     rPath = maPath;
158 }
159 
getStartArrow(PolyPolygon & rPath) const160 void SvtGraphicStroke::getStartArrow( PolyPolygon& rPath ) const
161 {
162     rPath = maStartArrow;
163 }
164 
getEndArrow(PolyPolygon & rPath) const165 void SvtGraphicStroke::getEndArrow( PolyPolygon& rPath ) const
166 {
167     rPath = maEndArrow;
168 }
169 
getTransparency() const170 double SvtGraphicStroke::getTransparency() const
171 {
172     return mfTransparency;
173 }
174 
getStrokeWidth() const175 double SvtGraphicStroke::getStrokeWidth() const
176 {
177     return mfStrokeWidth;
178 }
179 
getCapType() const180 SvtGraphicStroke::CapType SvtGraphicStroke::getCapType() const
181 {
182     return maCapType;
183 }
184 
getJoinType() const185 SvtGraphicStroke::JoinType SvtGraphicStroke::getJoinType() const
186 {
187     return maJoinType;
188 }
189 
getMiterLimit() const190 double SvtGraphicStroke::getMiterLimit() const
191 {
192     return mfMiterLimit;
193 }
194 
getDashArray(DashArray & rDashArray) const195 void SvtGraphicStroke::getDashArray( DashArray& rDashArray ) const
196 {
197     rDashArray = maDashArray;
198 }
199 
toString() const200 ::rtl::OString SvtGraphicStroke::toString() const
201 {
202     ::rtl::OString aStr;
203 
204     aStr += polyToString( maPath );
205     aStr += "trans: ";
206     aStr += ::rtl::OString::valueOf( static_cast< double >(getTransparency()) );
207     aStr += " width: ";
208     aStr += ::rtl::OString::valueOf( static_cast< double >(getStrokeWidth()) );
209     aStr += " cap: ";
210     switch( getCapType() )
211     {
212         case capButt:
213             aStr += "butt";
214             break;
215 
216         case capRound:
217             aStr += "round";
218             break;
219 
220         case capSquare:
221             aStr += "square";
222             break;
223 
224         default:
225             DBG_ERROR( "SvtGraphicStroke::toString missing cap type");
226             break;
227     }
228     aStr += " join: ";
229     switch( getJoinType() )
230     {
231         case joinMiter:
232             aStr += "miter";
233             break;
234 
235         case joinRound:
236             aStr += "round";
237             break;
238 
239         case joinBevel:
240             aStr += "bevel";
241             break;
242 
243         case joinNone:
244             aStr += "none";
245             break;
246 
247         default:
248             DBG_ERROR( "SvtGraphicStroke::toString missing join type");
249             break;
250     }
251     aStr += " ";
252 
253     if( maStartArrow.Count() )
254     {
255         aStr += "start: ";
256         aStr += polyPolyToString( maStartArrow );
257         aStr += " ";
258     }
259 
260     if( maEndArrow.Count() )
261     {
262         aStr += "end: ";
263         aStr += polyPolyToString( maEndArrow );
264         aStr += " ";
265     }
266 
267     aStr += dashToString( maDashArray );
268 
269     return aStr;
270 }
271 
setPath(const Polygon & rPoly)272 void SvtGraphicStroke::setPath( const Polygon& rPoly )
273 {
274     maPath = rPoly;
275 }
276 
setStartArrow(const PolyPolygon & rPoly)277 void SvtGraphicStroke::setStartArrow( const PolyPolygon& rPoly )
278 {
279     maStartArrow = rPoly;
280 }
281 
setEndArrow(const PolyPolygon & rPoly)282 void SvtGraphicStroke::setEndArrow( const PolyPolygon& rPoly )
283 {
284     maEndArrow = rPoly;
285 }
286 
setTransparency(double fTrans)287 void SvtGraphicStroke::setTransparency( double fTrans )
288 {
289     mfTransparency = fTrans;
290 }
291 
setStrokeWidth(double fWidth)292 void SvtGraphicStroke::setStrokeWidth( double fWidth )
293 {
294     mfStrokeWidth = fWidth;
295 }
296 
setCapType(CapType eType)297 void SvtGraphicStroke::setCapType( CapType eType )
298 {
299     maCapType = eType;
300 }
301 
setJoinType(JoinType eType)302 void SvtGraphicStroke::setJoinType( JoinType eType )
303 {
304     maJoinType = eType;
305 }
306 
setMiterLimit(double fMiterLimit)307 void SvtGraphicStroke::setMiterLimit( double fMiterLimit )
308 {
309     mfMiterLimit = fMiterLimit;
310 }
311 
setDashArray(const DashArray & rDashArray)312 void SvtGraphicStroke::setDashArray( const DashArray& rDashArray )
313 {
314     maDashArray = rDashArray;
315 }
316 
operator <<(SvStream & rOStm,const SvtGraphicStroke & rClass)317 SvStream& operator<<( SvStream& rOStm, const SvtGraphicStroke& rClass )
318 {
319 	VersionCompat aCompat( rOStm, STREAM_WRITE, 1 );
320 
321     rClass.maPath.Write( rOStm );
322     rClass.maStartArrow.Write( rOStm );
323     rClass.maEndArrow.Write( rOStm );
324     rOStm << rClass.mfTransparency;
325     rOStm << rClass.mfStrokeWidth;
326     sal_uInt16 nTmp = sal::static_int_cast<sal_uInt16>( rClass.maCapType );
327     rOStm << nTmp;
328     nTmp = sal::static_int_cast<sal_uInt16>( rClass.maJoinType );
329     rOStm << nTmp;
330     rOStm << rClass.mfMiterLimit;
331 
332     rOStm << static_cast<sal_uInt32>(rClass.maDashArray.size());
333     size_t i;
334     for(i=0; i<rClass.maDashArray.size(); ++i)
335         rOStm << rClass.maDashArray[i];
336 
337 	return rOStm;
338 }
339 
operator >>(SvStream & rIStm,SvtGraphicStroke & rClass)340 SvStream& operator>>( SvStream& rIStm, SvtGraphicStroke& rClass )
341 {
342 	VersionCompat aCompat( rIStm, STREAM_READ );
343 
344     rClass.maPath.Read( rIStm );
345     rClass.maStartArrow.Read( rIStm );
346     rClass.maEndArrow.Read( rIStm );
347     rIStm >> rClass.mfTransparency;
348     rIStm >> rClass.mfStrokeWidth;
349     sal_uInt16 nTmp;
350     rIStm >> nTmp;
351     rClass.maCapType = SvtGraphicStroke::CapType(nTmp);
352     rIStm >> nTmp;
353     rClass.maJoinType = SvtGraphicStroke::JoinType(nTmp);
354     rIStm >> rClass.mfMiterLimit;
355 
356     sal_uInt32 nSize;
357     rIStm >> nSize;
358     rClass.maDashArray.resize(nSize);
359     size_t i;
360     for(i=0; i<rClass.maDashArray.size(); ++i)
361         rIStm >> rClass.maDashArray[i];
362 
363 	return rIStm;
364 }
365 
366 
367 /////////////////////////////////////////////////////////////////////////////
368 
SvtGraphicFill()369 SvtGraphicFill::SvtGraphicFill() :
370     maPath(),
371     maFillColor( COL_BLACK ),
372     mfTransparency(),
373     maFillRule(),
374     maFillType(),
375     maFillTransform(),
376     maHatchType(),
377     maHatchColor( COL_BLACK ),
378     maGradientType(),
379     maGradient1stColor( COL_BLACK ),
380     maGradient2ndColor( COL_BLACK ),
381     maGradientStepCount( gradientStepsInfinite ),
382     maFillGraphic()
383 {
384 }
385 
SvtGraphicFill(const PolyPolygon & rPath,Color aFillColor,double fTransparency,FillRule aFillRule,FillType aFillType,const Transform & aFillTransform,bool bTiling,HatchType aHatchType,Color aHatchColor,GradientType aGradientType,Color aGradient1stColor,Color aGradient2ndColor,int aGradientStepCount,const Graphic & aFillGraphic)386 SvtGraphicFill::SvtGraphicFill( const PolyPolygon& 	rPath,
387                                 Color				aFillColor,
388                                 double				fTransparency,
389                                 FillRule			aFillRule,
390                                 FillType			aFillType,
391                                 const Transform&	aFillTransform,
392                                 bool				bTiling,
393                                 HatchType			aHatchType,
394                                 Color				aHatchColor,
395                                 GradientType		aGradientType,
396                                 Color				aGradient1stColor,
397                                 Color				aGradient2ndColor,
398                                 int					aGradientStepCount,
399                                 const Graphic&		aFillGraphic ) :
400     maPath( rPath ),
401     maFillColor( aFillColor ),
402     mfTransparency( fTransparency ),
403     maFillRule( aFillRule ),
404     maFillType( aFillType ),
405     maFillTransform( aFillTransform ),
406     mbTiling( bTiling ),
407     maHatchType( aHatchType ),
408     maHatchColor( aHatchColor ),
409     maGradientType( aGradientType ),
410     maGradient1stColor( aGradient1stColor ),
411     maGradient2ndColor( aGradient2ndColor ),
412     maGradientStepCount( aGradientStepCount ),
413     maFillGraphic( aFillGraphic )
414 {
415 }
416 
getPath(PolyPolygon & rPath) const417 void SvtGraphicFill::getPath( PolyPolygon& rPath ) const
418 {
419     rPath = maPath;
420 }
421 
getFillColor() const422 Color SvtGraphicFill::getFillColor() const
423 {
424     return maFillColor;
425 }
426 
getTransparency() const427 double SvtGraphicFill::getTransparency() const
428 {
429     return mfTransparency;
430 }
431 
getFillRule() const432 SvtGraphicFill::FillRule SvtGraphicFill::getFillRule() const
433 {
434     return maFillRule;
435 }
436 
getFillType() const437 SvtGraphicFill::FillType SvtGraphicFill::getFillType() const
438 {
439     return maFillType;
440 }
441 
getTransform(Transform & rTrans) const442 void SvtGraphicFill::getTransform( Transform& rTrans ) const
443 {
444     rTrans = maFillTransform;
445 }
446 
IsTiling() const447 bool SvtGraphicFill::IsTiling() const
448 {
449     return mbTiling;
450 }
451 
isTiling() const452 bool SvtGraphicFill::isTiling() const
453 {
454     return mbTiling;
455 }
456 
getHatchType() const457 SvtGraphicFill::HatchType SvtGraphicFill::getHatchType() const
458 {
459     return maHatchType;
460 }
461 
getHatchColor() const462 Color SvtGraphicFill::getHatchColor() const
463 {
464     return maHatchColor;
465 }
466 
getGradientType() const467 SvtGraphicFill::GradientType SvtGraphicFill::getGradientType() const
468 {
469     return maGradientType;
470 }
471 
getGradient1stColor() const472 Color SvtGraphicFill::getGradient1stColor() const
473 {
474     return maGradient1stColor;
475 }
476 
getGradient2ndColor() const477 Color SvtGraphicFill::getGradient2ndColor() const
478 {
479     return maGradient2ndColor;
480 }
481 
getGradientStepCount() const482 int SvtGraphicFill::getGradientStepCount() const
483 {
484     return maGradientStepCount;
485 }
486 
getGraphic(Graphic & rGraphic) const487 void SvtGraphicFill::getGraphic( Graphic& rGraphic ) const
488 {
489     rGraphic = maFillGraphic;
490 }
491 
toString() const492 ::rtl::OString SvtGraphicFill::toString() const
493 {
494     ::rtl::OString aStr;
495 
496     aStr += polyPolyToString( maPath );
497     aStr += "fill";
498     aStr += colorToString( getFillColor() );
499     aStr += " trans: ";
500     aStr += ::rtl::OString::valueOf( static_cast< double >(getTransparency()) );
501     aStr += " rule: ";
502     switch( getFillRule() )
503     {
504         case fillNonZero:
505             aStr += "nonzero";
506             break;
507 
508         case fillEvenOdd:
509             aStr += "evenodd";
510             break;
511 
512         default:
513             DBG_ERROR( "SvtGraphicFill::toString missing fill rule");
514             break;
515     }
516     aStr += " type: ";
517     switch( getFillType() )
518     {
519         case fillSolid:
520             aStr += "solid";
521             break;
522 
523         case fillGradient:
524             aStr += "gradient";
525             break;
526 
527         case fillHatch:
528             aStr += "hatch";
529             break;
530 
531         case fillTexture:
532             aStr += "bitmap";
533             break;
534 
535         default:
536             DBG_ERROR( "SvtGraphicStroke::toString missing fill type");
537             break;
538     }
539 
540     aStr += " transform: [ ";
541     int i;
542     for(i=0; i<Transform::MatrixSize; ++i)
543         aStr += ::rtl::OString::valueOf( maFillTransform.matrix[i] );
544     aStr += " ] ";
545 
546     aStr += " hatch: ";
547     switch( getHatchType() )
548     {
549         case hatchSingle:
550             aStr += "single";
551             break;
552 
553         case hatchDouble:
554             aStr += "double";
555             break;
556 
557         case hatchTriple:
558             aStr += "triple";
559             break;
560 
561         default:
562             DBG_ERROR( "SvtGraphicStroke::toString missing hatch type");
563             break;
564     }
565 
566     aStr += " hatch";
567     aStr += colorToString( getHatchColor() );
568 
569     aStr += " gradient: ";
570     switch( getGradientType() )
571     {
572         case gradientLinear:
573             aStr += "linear";
574             break;
575 
576         case gradientRadial:
577             aStr += "radial";
578             break;
579 
580         case gradientRectangular:
581             aStr += "rectangular";
582             break;
583 
584         default:
585             DBG_ERROR( "SvtGraphicStroke::toString missing gradient type");
586             break;
587     }
588 
589     aStr += " grad1st";
590     aStr += colorToString( getGradient1stColor() );
591 
592     aStr += " grad2nd";
593     aStr += colorToString( getGradient2ndColor() );
594 
595     aStr += " gradstep";
596     aStr += ::rtl::OString::valueOf( (sal_Int32)getGradientStepCount() );
597 
598     if( maFillGraphic.GetType() != GRAPHIC_NONE )
599     {
600         aStr += " fillgraphic: ";
601         switch( maFillGraphic.GetType() )
602         {
603             case GRAPHIC_BITMAP:
604                 aStr += "bitmap";
605                 break;
606 
607             case GRAPHIC_GDIMETAFILE:
608                 aStr += "metafile";
609                 break;
610 
611             case GRAPHIC_DEFAULT:
612                 aStr += "default";
613                 break;
614 
615             default:
616                 DBG_ERROR( "SvtGraphicStroke::toString missing graphic type");
617                 break;
618         }
619 
620         aStr += " of ";
621         aStr += ::rtl::OString::valueOf( static_cast< sal_Int32 >(maFillGraphic.GetSizeBytes()) );
622         aStr += " bytes";
623     }
624 
625     return aStr;
626 }
627 
setPath(const PolyPolygon & rPath)628 void SvtGraphicFill::setPath( const PolyPolygon& rPath )
629 {
630     maPath = rPath;
631 }
632 
setFillColor(Color aFillColor)633 void SvtGraphicFill::setFillColor( Color aFillColor )
634 {
635     maFillColor = aFillColor;
636 }
637 
setTransparency(double fTransparency)638 void SvtGraphicFill::setTransparency( double fTransparency )
639 {
640     mfTransparency = fTransparency;
641 }
642 
setFillRule(FillRule aFillRule)643 void SvtGraphicFill::setFillRule( FillRule aFillRule )
644 {
645     maFillRule = aFillRule;
646 }
647 
setFillType(FillType aFillType)648 void SvtGraphicFill::setFillType( FillType aFillType )
649 {
650     maFillType = aFillType;
651 }
652 
setTransform(const Transform & rTransform)653 void SvtGraphicFill::setTransform( const Transform& rTransform )
654 {
655     maFillTransform = rTransform;
656 }
657 
setTiling(bool bTiling)658 void SvtGraphicFill::setTiling( bool bTiling )
659 {
660     mbTiling = bTiling;
661 }
662 
setHatchType(HatchType aHatchType)663 void SvtGraphicFill::setHatchType( HatchType aHatchType )
664 {
665     maHatchType = aHatchType;
666 }
667 
setHatchColor(Color aHatchColor)668 void SvtGraphicFill::setHatchColor( Color aHatchColor )
669 {
670     maHatchColor = aHatchColor;
671 }
672 
setGradientType(GradientType aGradType)673 void SvtGraphicFill::setGradientType( GradientType aGradType )
674 {
675     maGradientType = aGradType;
676 }
677 
setGradient1stColor(Color aColor)678 void SvtGraphicFill::setGradient1stColor( Color aColor )
679 {
680     maGradient1stColor = aColor;
681 }
682 
setGradient2ndColor(Color aColor)683 void SvtGraphicFill::setGradient2ndColor( Color aColor )
684 {
685     maGradient2ndColor = aColor;
686 }
687 
setGradientStepCount(int aCount)688 void SvtGraphicFill::setGradientStepCount( int aCount )
689 {
690     maGradientStepCount = aCount;
691 }
692 
setGraphic(const Graphic & rGraphic)693 void SvtGraphicFill::setGraphic( const Graphic& rGraphic )
694 {
695     maFillGraphic = rGraphic;
696 }
697 
operator <<(SvStream & rOStm,const SvtGraphicFill & rClass)698 SvStream& operator<<( SvStream& rOStm, const SvtGraphicFill& rClass )
699 {
700 	VersionCompat aCompat( rOStm, STREAM_WRITE, 1 );
701 
702     rClass.maPath.Write( rOStm );
703     rOStm << rClass.maFillColor;
704     rOStm << rClass.mfTransparency;
705     sal_uInt16 nTmp = sal::static_int_cast<sal_uInt16>( rClass.maFillRule );
706     rOStm << nTmp;
707     nTmp = sal::static_int_cast<sal_uInt16>( rClass.maFillType );
708     rOStm << nTmp;
709     int i;
710     for(i=0; i<SvtGraphicFill::Transform::MatrixSize; ++i)
711         rOStm << rClass.maFillTransform.matrix[i];
712     nTmp = rClass.mbTiling;
713     rOStm << nTmp;
714     nTmp = sal::static_int_cast<sal_uInt16>( rClass.maHatchType );
715     rOStm << nTmp;
716     rOStm << rClass.maHatchColor;
717     nTmp = sal::static_int_cast<sal_uInt16>( rClass.maGradientType );
718     rOStm << nTmp;
719     rOStm << rClass.maGradient1stColor;
720     rOStm << rClass.maGradient2ndColor;
721     rOStm << rClass.maGradientStepCount;
722     rOStm << rClass.maFillGraphic;
723 
724 	return rOStm;
725 }
726 
operator >>(SvStream & rIStm,SvtGraphicFill & rClass)727 SvStream& operator>>( SvStream& rIStm, SvtGraphicFill& rClass )
728 {
729 	VersionCompat aCompat( rIStm, STREAM_READ );
730 
731     rClass.maPath.Read( rIStm );
732     rIStm >> rClass.maFillColor;
733     rIStm >> rClass.mfTransparency;
734     sal_uInt16 nTmp;
735     rIStm >> nTmp;
736     rClass.maFillRule = SvtGraphicFill::FillRule( nTmp );
737     rIStm >> nTmp;
738     rClass.maFillType = SvtGraphicFill::FillType( nTmp );
739     int i;
740     for(i=0; i<SvtGraphicFill::Transform::MatrixSize; ++i)
741         rIStm >> rClass.maFillTransform.matrix[i];
742     rIStm >> nTmp;
743     rClass.mbTiling = nTmp;
744     rIStm >> nTmp;
745     rClass.maHatchType = SvtGraphicFill::HatchType( nTmp );
746     rIStm >> rClass.maHatchColor;
747     rIStm >> nTmp;
748     rClass.maGradientType = SvtGraphicFill::GradientType( nTmp );
749     rIStm >> rClass.maGradient1stColor;
750     rIStm >> rClass.maGradient2ndColor;
751     rIStm >> rClass.maGradientStepCount;
752     rIStm >> rClass.maFillGraphic;
753 
754 	return rIStm;
755 }
756