[Libreoffice-commits] .: extensions/source

Joseph Powers jpowers at kemper.freedesktop.org
Tue May 10 07:42:27 PDT 2011


 extensions/source/svg/svgaction.cxx |   98 ++++++++++++++++++------------------
 1 file changed, 49 insertions(+), 49 deletions(-)

New commits:
commit c9588040b5a220fd0ed95c52ae1a0e9b54e80c9b
Author: Joseph Powers <jpowers27 at cox.net>
Date:   Tue May 10 05:14:22 2011 -0700

    GDIMetaFile cleanup
    
    Plus trailing white space cleanup.

diff --git a/extensions/source/svg/svgaction.cxx b/extensions/source/svg/svgaction.cxx
index 0b46e2d..e171e0f 100644
--- a/extensions/source/svg/svgaction.cxx
+++ b/extensions/source/svg/svgaction.cxx
@@ -2,7 +2,7 @@
 /*************************************************************************
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
+ *
  * Copyright 2000, 2010 Oracle and/or its affiliates.
  *
  * OpenOffice.org - a multi-platform office productivity suite
@@ -75,7 +75,7 @@ static const char	aXMLAttrHeight[] = "height";
 static const char	aXMLAttrPoints[] = "points";
 static const char	aXMLAttrXLinkHRef[] = "xlink:href";
 
-static const sal_Unicode pBase64[] = 
+static const sal_Unicode pBase64[] =
 {
     //0   1   2   3   4   5   6   7
      'A','B','C','D','E','F','G','H', // 0
@@ -263,21 +263,21 @@ SVGAttributeWriter::~SVGAttributeWriter()
 NMSP_RTL::OUString SVGAttributeWriter::GetFontStyle( const Font& rFont )
 {
     FastString aStyle;
-    
+
     // font family
     aStyle += B2UCONST( "font-family:" );
-    aStyle += NMSP_RTL::OUString( rFont.GetName().GetToken( 0, ';' ) ); 
+    aStyle += NMSP_RTL::OUString( rFont.GetName().GetToken( 0, ';' ) );
 
     // font size
     aStyle += B2UCONST( ";" );
     aStyle += B2UCONST( "font-size:" );
     aStyle += mrParent.GetValueString( mrParent.ImplMap( Size( 0, rFont.GetHeight() ) ).Height(), mrParent.HasDoublePoints() );
-    
+
     // font style
     if( rFont.GetItalic() != ITALIC_NONE )
     {
         aStyle += B2UCONST( ";" );
-        aStyle += B2UCONST( "font-style:" ); 
+        aStyle += B2UCONST( "font-style:" );
 
         if( rFont.GetItalic() == ITALIC_OBLIQUE )
             aStyle += B2UCONST( "oblique" );
@@ -306,7 +306,7 @@ NMSP_RTL::OUString SVGAttributeWriter::GetFontStyle( const Font& rFont )
     aStyle += B2UCONST( ";" );
     aStyle += B2UCONST( "font-weight:" );
     aStyle += NMSP_RTL::OUString::valueOf( nFontWeight );
-            
+
     // !!!
     // font-variant
     // font-stretch
@@ -339,7 +339,7 @@ NMSP_RTL::OUString SVGAttributeWriter::GetPaintStyle( const Color& rLineColor, c
 
     // line color
     aStyle += B2UCONST( "stroke:" );
-    
+
     if( rLineColor.GetTransparency() == 255 )
         aStyle += B2UCONST( "none" );
     else
@@ -366,7 +366,7 @@ NMSP_RTL::OUString SVGAttributeWriter::GetPaintStyle( const Color& rLineColor, c
     // fill color
     aStyle += B2UCONST( ";" );
     aStyle += B2UCONST( "fill:" );
-    
+
     if( rFillColor.GetTransparency() == 255 )
         aStyle += B2UCONST( "none" );
     else
@@ -492,9 +492,9 @@ NMSP_RTL::OUString SVGActionWriter::GetValueString( sal_Int32 nVal, sal_Bool bDo
     {
         const double	fPoints = nVal * 72.0 / 2540.0;
         const sal_Int32	nInt = (sal_Int32) fPoints;
-        
-        return( ( NMSP_RTL::OUString::valueOf( nInt ) += 
-                NMSP_RTL::OUString::valueOf( (sal_Unicode) '.' ) ) += 
+
+        return( ( NMSP_RTL::OUString::valueOf( nInt ) +=
+                NMSP_RTL::OUString::valueOf( (sal_Unicode) '.' ) ) +=
                 NMSP_RTL::OUString::valueOf( labs( (sal_Int32) ( ( fPoints - nInt ) * 100.0 ) ) ) );
     }
 }
@@ -595,7 +595,7 @@ void SVGActionWriter::ImplWritePolygon( const Polygon& rPoly, sal_Bool bLineOnly
             while( i < nSize )
             {
                 const Point aPolyPoint( ImplMap( rPoly[ i ] ) );
-                
+
                 aPoints += GetValueString( aPolyPoint.X(), mbDoublePoints );
                 aPoints += B2UCONST( "," );
                 aPoints += GetValueString( aPolyPoint.Y(), mbDoublePoints );
@@ -620,7 +620,7 @@ void SVGActionWriter::ImplWritePolygon( const Polygon& rPoly, sal_Bool bLineOnly
 
             // add point attribute
             mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrPoints, aPoints.GetString() );
-                
+
             // add style attribute
             if( aStyle.GetLength() )
                 mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrStyle, aStyle.GetString() );
@@ -714,7 +714,7 @@ void SVGActionWriter::ImplWritePolyPolygon( const PolyPolygon& rPolyPoly, sal_Bo
                 mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrStyle, aStyle.GetString() );
 
             // add path data attribute
-            mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrD, aPathData.GetString() );				
+            mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrD, aPathData.GetString() );
             {
                 // write polyline/polygon element
                 SvXMLElementExport aElem( mrExport, XML_NAMESPACE_NONE, aXMLElemPath, sal_True, sal_True );
@@ -767,7 +767,7 @@ void SVGActionWriter::ImplWriteGradientEx( const PolyPolygon& rPolyPoly, const G
 
 // -----------------------------------------------------------------------------
 
-void SVGActionWriter::ImplWriteText( const Point& rPos, const String& rText, 
+void SVGActionWriter::ImplWriteText( const Point& rPos, const String& rText,
                                      const sal_Int32* pDXArray, long nWidth,
                                      const NMSP_RTL::OUString* pStyle )
 {
@@ -788,7 +788,7 @@ void SVGActionWriter::ImplWriteText( const Point& rPos, const String& rText,
             pDX = const_cast< sal_Int32* >( pDXArray );
         }
         else
-        {	
+        {
             pOwnArray = new sal_Int32[ nLen ];
             aNormSize = Size( mpVDev->GetTextArray( aText, pOwnArray ), 0 );
             pDX = pOwnArray;
@@ -938,7 +938,7 @@ void SVGActionWriter::ImplWriteText( const Point& rPos, const String& rText,
                 aPoly[ 1 ].X() = aBaseLinePos.X() + aNormSize.Width() - 1; aPoly[ 1 ].Y() = aPoly[ 0 ].Y();
                 aPoly[ 2 ].X() = aPoly[ 1 ].X(); aPoly[ 2 ].Y() = aPoly[ 0 ].Y() + nLineHeight - 1;
                 aPoly[ 3 ].X() = aPoly[ 0 ].X(); aPoly[ 3 ].Y() = aPoly[ 2 ].Y();
-                        
+
                 ImplWritePolygon( aPoly, sal_False );
             }
 
@@ -950,7 +950,7 @@ void SVGActionWriter::ImplWriteText( const Point& rPos, const String& rText,
                 aPoly[ 1 ].X() = aBaseLinePos.X() + aNormSize.Width() - 1; aPoly[ 1 ].Y() = aPoly[ 0 ].Y();
                 aPoly[ 2 ].X() = aPoly[ 1 ].X(); aPoly[ 2 ].Y() = aPoly[ 0 ].Y() + nLineHeight - 1;
                 aPoly[ 3 ].X() = aPoly[ 0 ].X(); aPoly[ 3 ].Y() = aPoly[ 2 ].Y();
-                        
+
                 ImplWritePolygon( aPoly, sal_False );
             }
         }
@@ -964,7 +964,7 @@ void SVGActionWriter::ImplWriteText( const Point& rPos, const String& rText,
 
 // -----------------------------------------------------------------------------
 
-void SVGActionWriter::ImplWriteBmp( const BitmapEx& rBmpEx, 
+void SVGActionWriter::ImplWriteBmp( const BitmapEx& rBmpEx,
                                     const Point& rPt, const Size& rSz,
                                     const Point& rSrcPt, const Size& rSrcSz,
                                     const NMSP_RTL::OUString* /*pStyle*/ )
@@ -972,7 +972,7 @@ void SVGActionWriter::ImplWriteBmp( const BitmapEx& rBmpEx,
     if( !!rBmpEx )
     {
         BitmapEx		aBmpEx( rBmpEx );
-         Point aPoint = Point(); 	
+         Point aPoint = Point();
         const Rectangle	aBmpRect( aPoint, rBmpEx.GetSizePixel() );
         const Rectangle aSrcRect( rSrcPt, rSrcSz );
 
@@ -1002,7 +1002,7 @@ void SVGActionWriter::ImplWriteBmp( const BitmapEx& rBmpEx,
                     aString +=  B2UCONST( "<" );
                     aString += NMSP_RTL::OUString::createFromAscii( aXMLElemImage );
                     aString += aSpace;
-                    
+
                     aString += NMSP_RTL::OUString::createFromAscii( aXMLAttrX );
                     aString += B2UCONST( "=\"" );
                     aString += GetValueString( aPt.X(), mbDoublePoints );
@@ -1050,7 +1050,7 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf, const NMSP_RTL:
 {
     ImplAcquireContext();
 
-    for( sal_uLong i = 0, nCount = rMtf.GetActionCount(); i < nCount; i++ )
+    for( size_t i = 0, nCount = rMtf.GetActionSize(); i < nCount; i++ )
     {
         const MetaAction*	pAction = rMtf.GetAction( i );
         const sal_uInt16		nType = pAction->GetType();
@@ -1078,7 +1078,7 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf, const NMSP_RTL:
             case( META_LINE_ACTION ):
             {
                 const MetaLineAction* pA = (const MetaLineAction*) pAction;
-                
+
                 mpContext->SetPaintAttr( mpVDev->GetLineColor(), mpVDev->GetLineColor() );
                 ImplWriteLine( pA->GetStartPoint(), pA->GetEndPoint(), NULL, pStyle );
             }
@@ -1139,7 +1139,7 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf, const NMSP_RTL:
                         aPoly = Polygon( pA->GetRect(), pA->GetStartPoint(), pA->GetEndPoint(), POLY_CHORD );
                     }
                     break;
-                    
+
                     case( META_POLYGON_ACTION ):
                         aPoly = ( (const MetaPolygonAction*) pAction )->GetPolygon();
                     break;
@@ -1254,17 +1254,17 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf, const NMSP_RTL:
                 const GDIMetaFile		aGDIMetaFile( pA->GetSubstitute() );
                 sal_Bool				bFound = sal_False;
 
-                for( sal_uLong j = 0, nCount2 = aGDIMetaFile.GetActionCount(); ( j < nCount2 ) && !bFound; j++ )
+                for( size_t j = 0, nCount2 = aGDIMetaFile.GetActionSize(); ( j < nCount2 ) && !bFound; j++ )
                 {
                     const MetaAction* pSubstAct = aGDIMetaFile.GetAction( j );
-                    
+
                     if( pSubstAct->GetType() == META_BMPSCALE_ACTION )
                     {
                         bFound = sal_True;
                         const MetaBmpScaleAction* pBmpScaleAction = (const MetaBmpScaleAction*) pSubstAct;
                         mpContext->SetPaintAttr( mpVDev->GetLineColor(), mpVDev->GetFillColor() );
-                        ImplWriteBmp( pBmpScaleAction->GetBitmap(), 
-                                      pA->GetPoint(), pA->GetSize(), 
+                        ImplWriteBmp( pBmpScaleAction->GetBitmap(),
+                                      pA->GetPoint(), pA->GetSize(),
                                       Point(), pBmpScaleAction->GetBitmap().GetSizePixel(), pStyle );
                     }
                 }
@@ -1287,7 +1287,7 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf, const NMSP_RTL:
 
                         if( pAction->GetType() == META_GRADIENTEX_ACTION )
                             pGradAction = (const MetaGradientExAction*) pAction;
-                        else if( ( pAction->GetType() == META_COMMENT_ACTION ) && 
+                        else if( ( pAction->GetType() == META_COMMENT_ACTION ) &&
                                  ( ( (const MetaCommentAction*) pAction )->GetComment().CompareIgnoreCaseToAscii( "XGRAD_SEQ_END" ) == COMPARE_EQUAL ) )
                         {
                             bDone = sal_True;
@@ -1303,10 +1303,10 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf, const NMSP_RTL:
             case( META_BMP_ACTION ):
             {
                 const MetaBmpAction* pA = (const MetaBmpAction*) pAction;
-                
+
                 mpContext->SetPaintAttr( mpVDev->GetLineColor(), mpVDev->GetFillColor() );
-                ImplWriteBmp( pA->GetBitmap(), 
-                              pA->GetPoint(), mpVDev->PixelToLogic( pA->GetBitmap().GetSizePixel() ), 
+                ImplWriteBmp( pA->GetBitmap(),
+                              pA->GetPoint(), mpVDev->PixelToLogic( pA->GetBitmap().GetSizePixel() ),
                               Point(), pA->GetBitmap().GetSizePixel(), pStyle );
             }
             break;
@@ -1314,10 +1314,10 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf, const NMSP_RTL:
             case( META_BMPSCALE_ACTION ):
             {
                 const MetaBmpScaleAction* pA = (const MetaBmpScaleAction*) pAction;
-            
+
                 mpContext->SetPaintAttr( mpVDev->GetLineColor(), mpVDev->GetFillColor() );
-                ImplWriteBmp( pA->GetBitmap(), 
-                              pA->GetPoint(), pA->GetSize(), 
+                ImplWriteBmp( pA->GetBitmap(),
+                              pA->GetPoint(), pA->GetSize(),
                               Point(), pA->GetBitmap().GetSizePixel(), pStyle );
             }
             break;
@@ -1325,10 +1325,10 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf, const NMSP_RTL:
             case( META_BMPSCALEPART_ACTION ):
             {
                 const MetaBmpScalePartAction* pA = (const MetaBmpScalePartAction*) pAction;
-                
+
                 mpContext->SetPaintAttr( mpVDev->GetLineColor(), mpVDev->GetFillColor() );
-                ImplWriteBmp( pA->GetBitmap(), 
-                              pA->GetDestPoint(), pA->GetDestSize(), 
+                ImplWriteBmp( pA->GetBitmap(),
+                              pA->GetDestPoint(), pA->GetDestSize(),
                               pA->GetSrcPoint(), pA->GetSrcSize(), pStyle );
             }
             break;
@@ -1336,10 +1336,10 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf, const NMSP_RTL:
             case( META_BMPEX_ACTION	):
             {
                 const MetaBmpExAction*	pA = (const MetaBmpExAction*) pAction;
-                
+
                 mpContext->SetPaintAttr( mpVDev->GetLineColor(), mpVDev->GetFillColor() );
-                ImplWriteBmp( pA->GetBitmapEx(), 
-                              pA->GetPoint(), mpVDev->PixelToLogic( pA->GetBitmapEx().GetSizePixel() ), 
+                ImplWriteBmp( pA->GetBitmapEx(),
+                              pA->GetPoint(), mpVDev->PixelToLogic( pA->GetBitmapEx().GetSizePixel() ),
                               Point(), pA->GetBitmapEx().GetSizePixel(), pStyle );
             }
             break;
@@ -1347,10 +1347,10 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf, const NMSP_RTL:
             case( META_BMPEXSCALE_ACTION ):
             {
                 const MetaBmpExScaleAction* pA = (const MetaBmpExScaleAction*) pAction;
-            
+
                 mpContext->SetPaintAttr( mpVDev->GetLineColor(), mpVDev->GetFillColor() );
-                ImplWriteBmp( pA->GetBitmapEx(), 
-                              pA->GetPoint(), pA->GetSize(), 
+                ImplWriteBmp( pA->GetBitmapEx(),
+                              pA->GetPoint(), pA->GetSize(),
                               Point(), pA->GetBitmapEx().GetSizePixel(), pStyle );
             }
             break;
@@ -1358,10 +1358,10 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf, const NMSP_RTL:
             case( META_BMPEXSCALEPART_ACTION ):
             {
                 const MetaBmpExScalePartAction* pA = (const MetaBmpExScalePartAction*) pAction;
-                
+
                 mpContext->SetPaintAttr( mpVDev->GetLineColor(), mpVDev->GetFillColor() );
-                ImplWriteBmp( pA->GetBitmapEx(), 
-                              pA->GetDestPoint(), pA->GetDestSize(), 
+                ImplWriteBmp( pA->GetBitmapEx(),
+                              pA->GetDestPoint(), pA->GetDestSize(),
                               pA->GetSrcPoint(), pA->GetSrcSize(), pStyle );
             }
             break;
@@ -1373,7 +1373,7 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf, const NMSP_RTL:
                 mpContext->SetFontAttr( mpVDev->GetFont() );
                 mpContext->SetPaintAttr( COL_TRANSPARENT, mpVDev->GetFont().GetColor() );
                 ImplWriteText( pA->GetPoint(), String( pA->GetText(), pA->GetIndex(), pA->GetLen() ), NULL, 0, pStyle );
-            }			
+            }
             break;
 
             case( META_TEXTRECT_ACTION ):


More information about the Libreoffice-commits mailing list