From 2976b53ff8c815f5f6a5deba1763fba153bd528f Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Sat, 16 Mar 2013 22:33:14 +0200 Subject: Bin more pointless comments and ASCII graphics Suggested Easy Hack: Replace all instances of // -------- comments including surrounding newlines with a single newline. Another Easy Hack, slightly harder to automate: Remove all the pointless comments that just tell the class name right before the declaration of that class. Change-Id: Ia890ed613b53c5d719988697e20a983d62334123 --- filter/source/svg/svgfilter.hxx | 49 --------------- filter/source/svg/svgwriter.cxx | 135 ---------------------------------------- 2 files changed, 184 deletions(-) (limited to 'filter') diff --git a/filter/source/svg/svgfilter.hxx b/filter/source/svg/svgfilter.hxx index df54c7e52250..ce315b55db59 100644 --- a/filter/source/svg/svgfilter.hxx +++ b/filter/source/svg/svgfilter.hxx @@ -95,26 +95,12 @@ using namespace ::com::sun::star::xml::sax; using namespace ::std; -// ----------- -// - Defines - -// ----------- - #define SVG_EXPORT_ALLPAGES ((sal_Int32)-1) -// ----------- -// - statics - -// ----------- - // Placeholder tag used into the ImplWriteActions method to filter text placeholder fields static const ::rtl::OUString sPlaceholderTag = ::rtl::OUString::createFromAscii( "<[:isPlaceholder:]>" ); - -// ------------- -// - SVGExport - -// ------------- - -// #110680# class SVGExport : public SvXMLExport { typedef ::std::list< ::basegfx::B2DPolyPolygon > B2DPolyPolygonList; @@ -148,10 +134,6 @@ private: SVGExport(); }; -// ------------------------ -// - ObjectRepresentation - -// ------------------------ - class ObjectRepresentation { private: @@ -175,10 +157,6 @@ public: const GDIMetaFile& GetRepresentation() const { return *mpMtf; } }; -// ------------------- -// - PagePropertySet - -// ------------------- - struct PagePropertySet { sal_Bool bIsBackgroundVisible; @@ -196,12 +174,6 @@ struct PagePropertySet ::rtl::OUString sHeaderText; }; - - -// --------------------------- -// - HashReferenceXInterface - -// --------------------------- - struct HashReferenceXInterface { size_t operator()( const Reference< XInterface >& rxIf ) const @@ -210,48 +182,27 @@ struct HashReferenceXInterface } }; -// --------------------------- -// - HashOUString - -// --------------------------- - struct HashOUString { size_t operator()( const ::rtl::OUString& oustr ) const { return static_cast< size_t >( oustr.hashCode() ); } }; -// --------------------------- -// - HashUChar - -// --------------------------- - struct HashUChar { size_t operator()( const sal_Unicode uchar ) const { return static_cast< size_t >( uchar ); } }; -// --------------------------- -// - HashBitmap - -// --------------------------- - struct HashBitmap { size_t operator()( const ObjectRepresentation& rObjRep ) const; }; -// --------------------------- -// - EqualityBitmap - -// --------------------------- - struct EqualityBitmap { bool operator()( const ObjectRepresentation& rObjRep1, const ObjectRepresentation& rObjRep2 ) const; }; - -// ------------- -// - SVGFilter - -// ------------- - class SVGFontExport; class SVGActionWriter; class EditFieldInfo; diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx index 243d511079ea..588207b0bd86 100644 --- a/filter/source/svg/svgwriter.cxx +++ b/filter/source/svg/svgwriter.cxx @@ -31,10 +31,6 @@ using ::rtl::OUString; -// ----------- -// - statics - -// ----------- - static const char aXMLElemG[] = "g"; static const char aXMLElemDefs[] = "defs"; static const char aXMLElemLine[] = "line"; @@ -50,8 +46,6 @@ static const char aXMLElemLinearGradient[] = "linearGradient"; static const char aXMLElemRadialGradient[] = "radialGradient"; static const char aXMLElemStop[] = "stop"; -// ----------------------------------------------------------------------------- - static const char aXMLAttrTransform[] = "transform"; static const char aXMLAttrStyle[] = "style"; static const char aXMLAttrId[] = "id"; @@ -98,12 +92,6 @@ static const char aOOOAttrNumberingType[] = NSPREFIX "numbering-type"; static sal_Char const XML_UNO_NAME_NRULE_NUMBERINGTYPE[] = "NumberingType"; static sal_Char const XML_UNO_NAME_NRULE_BULLET_CHAR[] = "BulletChar"; -// ----------------------------------------------------------------------------- - - -// ---------------------- -// - SVGAttributeWriter - -// ---------------------- SVGAttributeWriter::SVGAttributeWriter( SVGExport& rExport, SVGFontExport& rFontExport ) : mrExport( rExport ), @@ -113,8 +101,6 @@ SVGAttributeWriter::SVGAttributeWriter( SVGExport& rExport, SVGFontExport& rFont { } -// ----------------------------------------------------------------------------- - SVGAttributeWriter::~SVGAttributeWriter() { if( mpElemPaint ) @@ -123,15 +109,11 @@ SVGAttributeWriter::~SVGAttributeWriter() delete mpElemFont; } -// ----------------------------------------------------------------------------- - double SVGAttributeWriter::ImplRound( double fValue, sal_Int32 nDecs ) { return( floor( fValue * pow( 10.0, (int)nDecs ) + 0.5 ) / pow( 10.0, (int)nDecs ) ); } -// ----------------------------------------------------------------------------- - void SVGAttributeWriter::ImplGetColorStr( const Color& rColor, ::rtl::OUString& rColorStr ) { if( rColor.GetTransparency() == 255 ) @@ -143,8 +125,6 @@ void SVGAttributeWriter::ImplGetColorStr( const Color& rColor, ::rtl::OUString& } } -// ----------------------------------------------------------------------------- - void SVGAttributeWriter::AddColorAttr( const char* pColorAttrName, const char* pColorOpacityAttrName, const Color& rColor ) @@ -162,8 +142,6 @@ void SVGAttributeWriter::AddColorAttr( const char* pColorAttrName, mrExport.AddAttribute( XML_NAMESPACE_NONE, pColorOpacityAttrName, aColorOpacity ); } -// ----------------------------------------------------------------------------- - void SVGAttributeWriter::AddPaintAttr( const Color& rLineColor, const Color& rFillColor, const Rectangle* pObjBoundRect, const Gradient* pFillGradient ) { @@ -187,8 +165,6 @@ void SVGAttributeWriter::AddPaintAttr( const Color& rLineColor, const Color& rFi AddColorAttr( aXMLAttrStroke, aXMLAttrStrokeOpacity, rLineColor ); } -// ----------------------------------------------------------------------------- - void SVGAttributeWriter::AddGradientDef( const Rectangle& rObjRect, const Gradient& rGradient, ::rtl::OUString& rGradientId ) { if( rObjRect.GetWidth() && rObjRect.GetHeight() && @@ -310,8 +286,6 @@ void SVGAttributeWriter::AddGradientDef( const Rectangle& rObjRect, const Gradie rGradientId = ::rtl::OUString(); } -// ----------------------------------------------------------------------------- - void SVGAttributeWriter::SetFontAttr( const Font& rFont ) { if( rFont != maCurFont ) @@ -429,10 +403,6 @@ void SVGAttributeWriter::setFontFamily() } } -// ------------------- -// - SVGTextWriter - -// ------------------- - SVGTextWriter::SVGTextWriter( SVGExport& rExport ) : mrExport( rExport ), mpContext( NULL ), @@ -466,30 +436,22 @@ SVGTextWriter::SVGTextWriter( SVGExport& rExport ) { } -// ----------------------------------------------------------------------------- - SVGTextWriter::~SVGTextWriter() { endTextParagraph(); } -// ----------------------------------------------------------------------------- - void SVGTextWriter::implRegisterInterface( const Reference< XInterface >& rxIf ) { if( rxIf.is() ) (mrExport.getInterfaceToIdentifierMapper()).registerReference( rxIf ); } -// ----------------------------------------------------------------------------- - const ::rtl::OUString & SVGTextWriter::implGetValidIDFromInterface( const Reference< XInterface >& rxIf ) { return (mrExport.getInterfaceToIdentifierMapper()).getIdentifier( rxIf ); } -// ----------------------------------------------------------------------------- - void SVGTextWriter::implMap( const Size& rSz, Size& rDstSz ) const { if( mpVDev && mpTargetMapMode ) @@ -498,8 +460,6 @@ void SVGTextWriter::implMap( const Size& rSz, Size& rDstSz ) const OSL_FAIL( "SVGTextWriter::implMap: invalid virtual device or map mode." ); } -// ----------------------------------------------------------------------------- - void SVGTextWriter::implMap( const Point& rPt, Point& rDstPt ) const { if( mpVDev && mpTargetMapMode ) @@ -508,8 +468,6 @@ void SVGTextWriter::implMap( const Point& rPt, Point& rDstPt ) const OSL_FAIL( "SVGTextWriter::implMap: invalid virtual device or map mode." ); } -// ----------------------------------------------------------------------------- - void SVGTextWriter::implSetCurrentFont() { if( mpVDev ) @@ -526,7 +484,6 @@ void SVGTextWriter::implSetCurrentFont() OSL_FAIL( "SVGTextWriter::implSetCorrectFontHeight: invalid virtual device." ); } } -// ----------------------------------------------------------------------------- template< typename SubType > sal_Bool SVGTextWriter::implGetTextPosition( const MetaAction* pAction, Point& raPos, sal_Bool& rbEmpty ) @@ -542,8 +499,6 @@ sal_Bool SVGTextWriter::implGetTextPosition( const MetaAction* pAction, Point& r return sal_False; } -// ----------------------------------------------------------------------------- - template<> sal_Bool SVGTextWriter::implGetTextPosition( const MetaAction* pAction, Point& raPos, sal_Bool& rbEmpty ) { @@ -558,8 +513,6 @@ sal_Bool SVGTextWriter::implGetTextPosition( const MetaActio return sal_False; } -// ----------------------------------------------------------------------------- - template< typename SubType > sal_Bool SVGTextWriter::implGetTextPositionFromBitmap( const MetaAction* pAction, Point& raPos, sal_Bool& rbEmpty ) { @@ -569,8 +522,6 @@ sal_Bool SVGTextWriter::implGetTextPositionFromBitmap( const MetaAction* pAction return sal_True; } -// ----------------------------------------------------------------------------- - /** setTextPosition * Set the start position of the next line of text. In case no text is found * the current action index is updated to the index value we reached while @@ -703,8 +654,6 @@ sal_Int32 SVGTextWriter::setTextPosition( const GDIMetaFile& rMtf, sal_uLong& nC } } -// ----------------------------------------------------------------------------- - void SVGTextWriter::setTextProperties( const GDIMetaFile& rMtf, sal_uLong nCurAction ) { sal_uLong nCount = rMtf.GetActionSize(); @@ -772,8 +721,6 @@ void SVGTextWriter::setTextProperties( const GDIMetaFile& rMtf, sal_uLong nCurAc } } -// ----------------------------------------------------------------------------- - void SVGTextWriter::addFontAttributes( sal_Bool bIsTextContainer ) { implSetCurrentFont(); @@ -872,8 +819,6 @@ void SVGTextWriter::addFontAttributes( sal_Bool bIsTextContainer ) } } -// ----------------------------------------------------------------------------- - void SVGTextWriter::implSetFontFamily() { sal_Int32 nNextTokenPos( 0 ); @@ -895,8 +840,6 @@ void SVGTextWriter::implSetFontFamily() mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrFontFamily, sFontFamily ); } -// ----------------------------------------------------------------------------- - sal_Bool SVGTextWriter::createParagraphEnumeration() { if( mrTextShape.is() ) @@ -923,8 +866,6 @@ sal_Bool SVGTextWriter::createParagraphEnumeration() return sal_False; } -// ----------------------------------------------------------------------------- - sal_Bool SVGTextWriter::nextParagraph() { mrTextPortionEnumeration.clear(); @@ -1188,8 +1129,6 @@ sal_Bool SVGTextWriter::nextParagraph() return sal_False; } -// ----------------------------------------------------------------------------- - sal_Bool SVGTextWriter::nextTextPortion() { mrCurrentTextPortion.clear(); @@ -1394,8 +1333,6 @@ sal_Bool SVGTextWriter::nextTextPortion() return sal_False; } -// ----------------------------------------------------------------------------- - void SVGTextWriter::startTextShape() { if( mpTextShapeElem ) @@ -1412,8 +1349,6 @@ void SVGTextWriter::startTextShape() } } -// ----------------------------------------------------------------------------- - void SVGTextWriter::endTextShape() { endTextParagraph(); @@ -1436,8 +1371,6 @@ void SVGTextWriter::endTextShape() } -// ----------------------------------------------------------------------------- - void SVGTextWriter::startTextParagraph() { endTextParagraph(); @@ -1473,8 +1406,6 @@ void SVGTextWriter::startTextParagraph() } } -// ----------------------------------------------------------------------------- - void SVGTextWriter::endTextParagraph() { mrCurrentTextPortion.clear(); @@ -1491,8 +1422,6 @@ void SVGTextWriter::endTextParagraph() } -// ----------------------------------------------------------------------------- - void SVGTextWriter::startTextPosition( sal_Bool bExportX, sal_Bool bExportY ) { endTextPosition(); @@ -1521,8 +1450,6 @@ void SVGTextWriter::startTextPosition( sal_Bool bExportX, sal_Bool bExportY ) mpTextPositionElem = new SvXMLElementExport( mrExport, XML_NAMESPACE_NONE, aXMLElemTspan, mbIWS, mbIWS ); } -// ----------------------------------------------------------------------------- - void SVGTextWriter::endTextPosition() { if( mpTextPositionElem ) @@ -1532,8 +1459,6 @@ void SVGTextWriter::endTextPosition() } } -// ----------------------------------------------------------------------------- - void SVGTextWriter::implExportHyperlinkIds() { if( !msHyperlinkIdList.isEmpty() ) @@ -1545,8 +1470,6 @@ void SVGTextWriter::implExportHyperlinkIds() } } -// ----------------------------------------------------------------------------- - void SVGTextWriter::implWriteBulletChars() { if( maBulletListItemMap.empty() ) @@ -1607,8 +1530,6 @@ void SVGTextWriter::implWriteBulletChars() maBulletListItemMap.clear(); } -// ----------------------------------------------------------------------------- - template< typename MetaBitmapActionType > void SVGTextWriter::writeBitmapPlaceholder( const MetaBitmapActionType* pAction ) { @@ -1636,8 +1557,6 @@ void SVGTextWriter::writeBitmapPlaceholder( const MetaBitmapActionType* pAction endTextPosition(); } -// ----------------------------------------------------------------------------- - void SVGTextWriter::implWriteEmbeddedBitmaps() { if( mpTextEmbeddedBitmapMtf && mpTextEmbeddedBitmapMtf->GetActionSize() ) @@ -1715,8 +1634,6 @@ void SVGTextWriter::implWriteEmbeddedBitmaps() } } -// ----------------------------------------------------------------------------- - void SVGTextWriter::writeTextPortion( const Point& rPos, const String& rText, sal_Bool bApplyMapping ) @@ -1787,8 +1704,6 @@ void SVGTextWriter::writeTextPortion( const Point& rPos, } -// ----------------------------------------------------------------------------- - void SVGTextWriter::implWriteTextPortion( const Point& rPos, const String& rText, Color aTextColor, @@ -1897,10 +1812,6 @@ void SVGTextWriter::implWriteTextPortion( const Point& rPos, mnTextWidth += mpVDev->GetTextWidth( sTextContent ); } -// ------------------- -// - SVGActionWriter - -// ------------------- - SVGActionWriter::SVGActionWriter( SVGExport& rExport, SVGFontExport& rFontExport ) : mnCurGradientId( 1 ), mnCurMaskId( 1 ), @@ -1918,16 +1829,12 @@ SVGActionWriter::SVGActionWriter( SVGExport& rExport, SVGFontExport& rFontExport maTextWriter.setVirtualDevice( mpVDev, maTargetMapMode ); } -// ----------------------------------------------------------------------------- - SVGActionWriter::~SVGActionWriter() { DBG_ASSERT( !mpContext, "Not all contexts are closed" ); delete mpVDev; } -// ----------------------------------------------------------------------------- - long SVGActionWriter::ImplMap( sal_Int32 nVal ) const { Size aSz( nVal, nVal ); @@ -1935,22 +1842,16 @@ long SVGActionWriter::ImplMap( sal_Int32 nVal ) const return( ImplMap( aSz, aSz ).Width() ); } -// ----------------------------------------------------------------------------- - Point& SVGActionWriter::ImplMap( const Point& rPt, Point& rDstPt ) const { return( rDstPt = mpVDev->LogicToLogic( rPt, mpVDev->GetMapMode(), maTargetMapMode ) ); } -// ----------------------------------------------------------------------------- - Size& SVGActionWriter::ImplMap( const Size& rSz, Size& rDstSz ) const { return( rDstSz = mpVDev->LogicToLogic( rSz, mpVDev->GetMapMode(), maTargetMapMode ) ); } -// ----------------------------------------------------------------------------- - Rectangle& SVGActionWriter::ImplMap( const Rectangle& rRect, Rectangle& rDstRect ) const { Point aTL( rRect.TopLeft() ); @@ -1959,9 +1860,6 @@ Rectangle& SVGActionWriter::ImplMap( const Rectangle& rRect, Rectangle& rDstRect return( rDstRect = Rectangle( ImplMap( aTL, aTL ), ImplMap( aSz, aSz ) ) ); } - -// ----------------------------------------------------------------------------- - Polygon& SVGActionWriter::ImplMap( const Polygon& rPoly, Polygon& rDstPoly ) const { rDstPoly = Polygon( rPoly.GetSize() ); @@ -1975,8 +1873,6 @@ Polygon& SVGActionWriter::ImplMap( const Polygon& rPoly, Polygon& rDstPoly ) con return( rDstPoly ); } -// ----------------------------------------------------------------------------- - PolyPolygon& SVGActionWriter::ImplMap( const PolyPolygon& rPolyPoly, PolyPolygon& rDstPolyPoly ) const { Polygon aPoly; @@ -1991,8 +1887,6 @@ PolyPolygon& SVGActionWriter::ImplMap( const PolyPolygon& rPolyPoly, PolyPolygon return( rDstPolyPoly ); } -// ----------------------------------------------------------------------------- - ::rtl::OUString SVGActionWriter::GetPathString( const PolyPolygon& rPolyPoly, sal_Bool bLine ) { OUString aPathData; @@ -2058,8 +1952,6 @@ PolyPolygon& SVGActionWriter::ImplMap( const PolyPolygon& rPolyPoly, PolyPolygon return aPathData; } -// ----------------------------------------------------------------------------- - sal_uLong SVGActionWriter::GetChecksum( const MetaAction* pAction ) { GDIMetaFile aMtf; @@ -2069,8 +1961,6 @@ sal_uLong SVGActionWriter::GetChecksum( const MetaAction* pAction ) return aMtf.GetChecksum(); } -// ----------------------------------------------------------------------------- - void SVGActionWriter::ImplWriteLine( const Point& rPt1, const Point& rPt2, const Color* pLineColor, sal_Bool bApplyMapping ) { @@ -2103,8 +1993,6 @@ void SVGActionWriter::ImplWriteLine( const Point& rPt1, const Point& rPt2, } } -// ----------------------------------------------------------------------------- - void SVGActionWriter::ImplWriteRect( const Rectangle& rRect, long nRadX, long nRadY, sal_Bool bApplyMapping ) { @@ -2131,8 +2019,6 @@ void SVGActionWriter::ImplWriteRect( const Rectangle& rRect, long nRadX, long nR } } -// ----------------------------------------------------------------------------- - void SVGActionWriter::ImplWriteEllipse( const Point& rCenter, long nRadX, long nRadY, sal_Bool bApplyMapping ) { @@ -2153,8 +2039,6 @@ void SVGActionWriter::ImplWriteEllipse( const Point& rCenter, long nRadX, long n } } -// ----------------------------------------------------------------------------- - void SVGActionWriter::ImplWritePolyPolygon( const PolyPolygon& rPolyPoly, sal_Bool bLineOnly, sal_Bool bApplyMapping ) { @@ -2174,8 +2058,6 @@ void SVGActionWriter::ImplWritePolyPolygon( const PolyPolygon& rPolyPoly, sal_Bo } } -// ----------------------------------------------------------------------------- - void SVGActionWriter::ImplWriteShape( const SVGShapeDescriptor& rShape, sal_Bool bApplyMapping ) { PolyPolygon aPolyPoly; @@ -2267,8 +2149,6 @@ void SVGActionWriter::ImplWriteShape( const SVGShapeDescriptor& rShape, sal_Bool ImplWritePolyPolygon( aPolyPoly, bLineOnly, sal_False ); } -// ----------------------------------------------------------------------------- - void SVGActionWriter::ImplWritePattern( const PolyPolygon& rPolyPoly, const Hatch* pHatch, const Gradient* pGradient, @@ -2326,8 +2206,6 @@ void SVGActionWriter::ImplWritePattern( const PolyPolygon& rPolyPoly, } } -// ----------------------------------------------------------------------------- - void SVGActionWriter::ImplWriteGradientEx( const PolyPolygon& rPolyPoly, const Gradient& rGradient, sal_uInt32 nWriteFlags, sal_Bool bApplyMapping ) { @@ -2349,8 +2227,6 @@ void SVGActionWriter::ImplWriteGradientEx( const PolyPolygon& rPolyPoly, const G } } -// ----------------------------------------------------------------------------- - void SVGActionWriter::ImplWriteGradientLinear( const PolyPolygon& rPolyPoly, const Gradient& rGradient ) { @@ -2501,8 +2377,6 @@ Color SVGActionWriter::ImplGetGradientColor( const Color& rStartColor, return Color( (sal_uInt8)nNewRed, (sal_uInt8)nNewGreen, (sal_uInt8)nNewBlue ); } -// ----------------------------------------------------------------------------- - void SVGActionWriter::ImplWriteMask( GDIMetaFile& rMtf, const Point& rDestPt, const Size& rDestSize, @@ -2562,8 +2436,6 @@ void SVGActionWriter::ImplWriteMask( GDIMetaFile& rMtf, } } -// ----------------------------------------------------------------------------- - void SVGActionWriter::ImplWriteText( const Point& rPos, const String& rText, const sal_Int32* pDXArray, long nWidth, sal_Bool bApplyMapping ) @@ -2838,8 +2710,6 @@ void SVGActionWriter::ImplWriteText( const Point& rPos, const String& rText, } } -// ----------------------------------------------------------------------------- - void SVGActionWriter::ImplWriteBmp( const BitmapEx& rBmpEx, const Point& rPt, const Size& rSz, const Point& rSrcPt, const Size& rSrcSz, @@ -2891,8 +2761,6 @@ void SVGActionWriter::ImplWriteBmp( const BitmapEx& rBmpEx, } } -// ----------------------------------------------------------------------------- - void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf, sal_uInt32 nWriteFlags, const ::rtl::OUString* pElementId, @@ -3784,7 +3652,6 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf, } } -// ----------------------------------------------------------------------------- Font SVGActionWriter::ImplSetCorrectFontHeight() const { Font aFont( mpVDev->GetFont() ); @@ -3797,8 +3664,6 @@ Font SVGActionWriter::ImplSetCorrectFontHeight() const return aFont; } -// ----------------------------------------------------------------------------- - void SVGActionWriter::WriteMetaFile( const Point& rPos100thmm, const Size& rSize100thmm, const GDIMetaFile& rMtf, -- cgit /option> LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff