diff options
Diffstat (limited to 'svtools/source/filter.vcl')
-rw-r--r-- | svtools/source/filter.vcl/filter/SvFilterOptionsDialog.cxx | 4 | ||||
-rw-r--r-- | svtools/source/filter.vcl/filter/dlgejpg.hrc | 2 | ||||
-rw-r--r-- | svtools/source/filter.vcl/filter/dlgepng.hrc | 2 | ||||
-rw-r--r-- | svtools/source/filter.vcl/filter/dlgexpor.hrc | 2 | ||||
-rw-r--r-- | svtools/source/filter.vcl/filter/filter.cxx | 2 | ||||
-rw-r--r-- | svtools/source/filter.vcl/filter/makefile.mk | 2 | ||||
-rw-r--r-- | svtools/source/filter.vcl/filter/strings.hrc | 2 | ||||
-rw-r--r-- | svtools/source/filter.vcl/igif/decode.cxx | 3 | ||||
-rw-r--r-- | svtools/source/filter.vcl/igif/makefile.mk | 1 | ||||
-rw-r--r-- | svtools/source/filter.vcl/ixbm/makefile.mk | 1 | ||||
-rw-r--r-- | svtools/source/filter.vcl/ixpm/makefile.mk | 1 | ||||
-rw-r--r-- | svtools/source/filter.vcl/ixpm/xpmread.cxx | 21 | ||||
-rw-r--r-- | svtools/source/filter.vcl/jpeg/makefile.mk | 2 | ||||
-rw-r--r-- | svtools/source/filter.vcl/wmf/emfwr.cxx | 94 | ||||
-rw-r--r-- | svtools/source/filter.vcl/wmf/emfwr.hxx | 4 | ||||
-rw-r--r-- | svtools/source/filter.vcl/wmf/wmfwr.cxx | 92 | ||||
-rw-r--r-- | svtools/source/filter.vcl/wmf/wmfwr.hxx | 4 |
17 files changed, 201 insertions, 38 deletions
diff --git a/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.cxx b/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.cxx index 1bc83575ec38..584814dd9e92 100644 --- a/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.cxx +++ b/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.cxx @@ -37,7 +37,7 @@ #include "FilterConfigCache.hxx" #include <osl/file.hxx> #include <osl/module.hxx> -#include <svtools/solar.hrc> +#include <svl/solar.hrc> #include <svtools/fltcall.hxx> #include "dlgexpor.hxx" #include "dlgejpg.hxx" @@ -49,7 +49,7 @@ #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/uno/Sequence.h> #include <com/sun/star/uno/Any.h> -#include <svtools/syslocale.hxx> +#include <unotools/syslocale.hxx> #include "vcl/svapp.hxx" #if defined WIN || (defined OS2 && !defined ICC) diff --git a/svtools/source/filter.vcl/filter/dlgejpg.hrc b/svtools/source/filter.vcl/filter/dlgejpg.hrc index 4342a89d1d24..67ac915df367 100644 --- a/svtools/source/filter.vcl/filter/dlgejpg.hrc +++ b/svtools/source/filter.vcl/filter/dlgejpg.hrc @@ -27,7 +27,7 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -#include <svtools/svtools.hrc> +#include <svl/svtools.hrc> #define BTN_OK 1 #define BTN_CANCEL 1 diff --git a/svtools/source/filter.vcl/filter/dlgepng.hrc b/svtools/source/filter.vcl/filter/dlgepng.hrc index 79d4b189aa5a..d687141abf56 100644 --- a/svtools/source/filter.vcl/filter/dlgepng.hrc +++ b/svtools/source/filter.vcl/filter/dlgepng.hrc @@ -27,7 +27,7 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -#include <svtools/svtools.hrc> +#include <svl/svtools.hrc> #define BTN_OK 1 #define BTN_CANCEL 1 diff --git a/svtools/source/filter.vcl/filter/dlgexpor.hrc b/svtools/source/filter.vcl/filter/dlgexpor.hrc index 28921b5f178c..cae15d7276d2 100644 --- a/svtools/source/filter.vcl/filter/dlgexpor.hrc +++ b/svtools/source/filter.vcl/filter/dlgexpor.hrc @@ -27,7 +27,7 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -#include <svtools/svtools.hrc> +#include <svl/svtools.hrc> #define BTN_OK_PIX 1 #define BTN_CANCEL_PIX 1 diff --git a/svtools/source/filter.vcl/filter/filter.cxx b/svtools/source/filter.vcl/filter/filter.cxx index 3586ddd02ddd..306307a0bf91 100644 --- a/svtools/source/filter.vcl/filter/filter.cxx +++ b/svtools/source/filter.vcl/filter/filter.cxx @@ -54,7 +54,7 @@ #include "jpeg.hxx" #include "xbmread.hxx" #include "xpmread.hxx" -#include <svtools/solar.hrc> +#include <svl/solar.hrc> #include "strings.hrc" #include "sgffilt.hxx" #include "osl/module.hxx" diff --git a/svtools/source/filter.vcl/filter/makefile.mk b/svtools/source/filter.vcl/filter/makefile.mk index 2229f8f05546..ecdf48ba5671 100644 --- a/svtools/source/filter.vcl/filter/makefile.mk +++ b/svtools/source/filter.vcl/filter/makefile.mk @@ -40,6 +40,8 @@ LIBTARGET=NO .INCLUDE : settings.mk .INCLUDE : $(PRJ)$/util$/svt.pmk +SOLARINC+=-I../../inc + # --- Files -------------------------------------------------------- SRS1NAME=$(TARGET) diff --git a/svtools/source/filter.vcl/filter/strings.hrc b/svtools/source/filter.vcl/filter/strings.hrc index 0cfa4e6bf7c4..a3356982609a 100644 --- a/svtools/source/filter.vcl/filter/strings.hrc +++ b/svtools/source/filter.vcl/filter/strings.hrc @@ -27,4 +27,4 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -#include <svtools/svtools.hrc> +#include <svl/svtools.hrc> diff --git a/svtools/source/filter.vcl/igif/decode.cxx b/svtools/source/filter.vcl/igif/decode.cxx index 960a91845bf8..9babc02665a3 100644 --- a/svtools/source/filter.vcl/igif/decode.cxx +++ b/svtools/source/filter.vcl/igif/decode.cxx @@ -51,7 +51,6 @@ GIFLZWDecompressor::GIFLZWDecompressor( BYTE cDataSize ) : bEOIFound ( FALSE ), nDataSize ( cDataSize ) { - pTable = new GIFLZWTableEntry[ 4096 ]; pOutBuf = new BYTE[ 4096 ]; nClearCode = 1 << nDataSize; @@ -61,6 +60,8 @@ GIFLZWDecompressor::GIFLZWDecompressor( BYTE cDataSize ) : nOldCode = 0xffff; pOutBufData = pOutBuf + 4096; + pTable = new GIFLZWTableEntry[ 4098 ]; + for( USHORT i = 0; i < nTableSize; i++ ) { pTable[i].pPrev = NULL; diff --git a/svtools/source/filter.vcl/igif/makefile.mk b/svtools/source/filter.vcl/igif/makefile.mk index 0562813c00cc..49e2461bd7a8 100644 --- a/svtools/source/filter.vcl/igif/makefile.mk +++ b/svtools/source/filter.vcl/igif/makefile.mk @@ -38,6 +38,7 @@ TARGET=igif .INCLUDE : settings.mk .INCLUDE : $(PRJ)$/util$/svt.pmk +SOLARINC+=-I../../inc # --- Files -------------------------------------------------------- diff --git a/svtools/source/filter.vcl/ixbm/makefile.mk b/svtools/source/filter.vcl/ixbm/makefile.mk index 9c090e1de04a..41d6f7425474 100644 --- a/svtools/source/filter.vcl/ixbm/makefile.mk +++ b/svtools/source/filter.vcl/ixbm/makefile.mk @@ -38,6 +38,7 @@ TARGET=ixbm .INCLUDE : settings.mk .INCLUDE : $(PRJ)$/util$/svt.pmk +SOLARINC+=-I../../inc # --- Files -------------------------------------------------------- diff --git a/svtools/source/filter.vcl/ixpm/makefile.mk b/svtools/source/filter.vcl/ixpm/makefile.mk index 2e5cb851ebbf..10792f41ab3a 100644 --- a/svtools/source/filter.vcl/ixpm/makefile.mk +++ b/svtools/source/filter.vcl/ixpm/makefile.mk @@ -38,6 +38,7 @@ TARGET=ixpm .INCLUDE : settings.mk .INCLUDE : $(PRJ)$/util$/svt.pmk +SOLARINC+=-I../../inc # --- Files -------------------------------------------------------- diff --git a/svtools/source/filter.vcl/ixpm/xpmread.cxx b/svtools/source/filter.vcl/ixpm/xpmread.cxx index 0aa070e41596..1a667908f2f1 100644 --- a/svtools/source/filter.vcl/ixpm/xpmread.cxx +++ b/svtools/source/filter.vcl/ixpm/xpmread.cxx @@ -109,6 +109,10 @@ ReadState XPMReader::ReadXPM( Graphic& rGraphic ) mnColors = ImplGetULONG( 2 ); mnCpp = ImplGetULONG( 3 ); } + if ( mnColors > ( SAL_MAX_UINT32 / ( 4 + mnCpp ) ) ) + mbStatus = sal_False; + if ( ( mnWidth * mnCpp ) >= XPMSTRINGBUF ) + mbStatus = sal_False; if ( mbStatus && mnWidth && mnHeight && mnColors && mnCpp ) { mnIdentifier = XPMCOLORS; @@ -118,15 +122,20 @@ ReadState XPMReader::ReadXPM( Graphic& rGraphic ) // 1 Byte -> 0xff wenn Farbe transparent ist // 3 Bytes -> RGB Wert der Farbe mpColMap = new BYTE[ mnColors * ( 4 + mnCpp ) ]; - - for ( ULONG i = 0; i < mnColors; i++ ) + if ( mpColMap ) { - if ( ImplGetColor( i ) == FALSE ) + for ( ULONG i = 0; i < mnColors; i++ ) { - mbStatus = FALSE; - break; + if ( ImplGetColor( i ) == FALSE ) + { + mbStatus = FALSE; + break; + } } } + else + mbStatus = sal_False; + if ( mbStatus ) { // bei mehr als 256 Farben wird eine 24 Bit Grafik erstellt @@ -630,7 +639,7 @@ BOOL XPMReader::ImplGetString( void ) mnStatus &=~XPMSTRING; // end of parameter by eol break; } - if ( mnStringSize >= XPMSTRINGBUF ) + if ( mnStringSize >= ( XPMSTRINGBUF - 1 ) ) { mbStatus = FALSE; break; diff --git a/svtools/source/filter.vcl/jpeg/makefile.mk b/svtools/source/filter.vcl/jpeg/makefile.mk index 86c9c89c8bf0..7a9b5fc509c9 100644 --- a/svtools/source/filter.vcl/jpeg/makefile.mk +++ b/svtools/source/filter.vcl/jpeg/makefile.mk @@ -43,6 +43,8 @@ TARGET=jpeg CFLAGS+=-DSYSTEM_JPEG .ENDIF +SOLARINC+=-I../../inc + # --- Files -------------------------------------------------------- SLOFILES= $(SLO)$/jpegc.obj \ diff --git a/svtools/source/filter.vcl/wmf/emfwr.cxx b/svtools/source/filter.vcl/wmf/emfwr.cxx index df56afc4a250..e011dde1a0e8 100644 --- a/svtools/source/filter.vcl/wmf/emfwr.cxx +++ b/svtools/source/filter.vcl/wmf/emfwr.cxx @@ -33,6 +33,9 @@ #include "emfwr.hxx" #include <vcl/salbtype.hxx> +#include <basegfx/polygon/b2dpolygon.hxx> +#include <basegfx/polygon/b2dpolypolygon.hxx> +#include <vcl/lineinfo.hxx> // ----------- // - Defines - @@ -829,6 +832,46 @@ void EMFWriter::ImplWriteTextRecord( const Point& rPos, const String rText, cons // ----------------------------------------------------------------------------- +void EMFWriter::Impl_handleLineInfoPolyPolygons(const LineInfo& rInfo, const basegfx::B2DPolygon& rLinePolygon) +{ + if(rLinePolygon.count()) + { + basegfx::B2DPolyPolygon aLinePolyPolygon(rLinePolygon); + basegfx::B2DPolyPolygon aFillPolyPolygon; + + rInfo.applyToB2DPolyPolygon(aLinePolyPolygon, aFillPolyPolygon); + + if(aLinePolyPolygon.count()) + { + for(sal_uInt32 a(0); a < aLinePolyPolygon.count(); a++) + { + const basegfx::B2DPolygon aCandidate(aLinePolyPolygon.getB2DPolygon(a)); + ImplWritePolygonRecord( Polygon(aCandidate), FALSE ); + } + } + + if(aFillPolyPolygon.count()) + { + const Color aOldLineColor(maVDev.GetLineColor()); + const Color aOldFillColor(maVDev.GetFillColor()); + + maVDev.SetLineColor(); + maVDev.SetFillColor(aOldLineColor); + + for(sal_uInt32 a(0); a < aFillPolyPolygon.count(); a++) + { + const Polygon aPolygon(aFillPolyPolygon.getB2DPolygon(a)); + ImplWritePolyPolygonRecord(PolyPolygon(Polygon(aPolygon))); + } + + maVDev.SetLineColor(aOldLineColor); + maVDev.SetFillColor(aOldFillColor); + } + } +} + +// ----------------------------------------------------------------------------- + void EMFWriter::ImplWrite( const GDIMetaFile& rMtf ) { for( ULONG j = 0, nActionCount = rMtf.GetActionCount(); j < nActionCount; j++ ) @@ -871,20 +914,31 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf ) { const MetaLineAction* pA = (const MetaLineAction*) pAction; - ImplCheckLineAttr(); + if(pA->GetLineInfo().IsDefault()) + { + ImplCheckLineAttr(); - ImplBeginRecord( WIN_EMR_MOVETOEX ); - ImplWritePoint( pA->GetStartPoint() ); - ImplEndRecord(); + ImplBeginRecord( WIN_EMR_MOVETOEX ); + ImplWritePoint( pA->GetStartPoint() ); + ImplEndRecord(); - ImplBeginRecord( WIN_EMR_LINETO ); - ImplWritePoint( pA->GetEndPoint() ); - ImplEndRecord(); + ImplBeginRecord( WIN_EMR_LINETO ); + ImplWritePoint( pA->GetEndPoint() ); + ImplEndRecord(); - ImplBeginRecord( WIN_EMR_SETPIXELV ); - ImplWritePoint( pA->GetEndPoint() ); - ImplWriteColor( maVDev.GetLineColor() ); - ImplEndRecord(); + ImplBeginRecord( WIN_EMR_SETPIXELV ); + ImplWritePoint( pA->GetEndPoint() ); + ImplWriteColor( maVDev.GetLineColor() ); + ImplEndRecord(); + } + else + { + // LineInfo used; handle Dash/Dot and fat lines + basegfx::B2DPolygon aPolygon; + aPolygon.append(basegfx::B2DPoint(pA->GetStartPoint().X(), pA->GetStartPoint().Y())); + aPolygon.append(basegfx::B2DPoint(pA->GetEndPoint().X(), pA->GetEndPoint().Y())); + Impl_handleLineInfoPolyPolygons(pA->GetLineInfo(), aPolygon); + } } } break; @@ -983,7 +1037,23 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf ) case( META_POLYLINE_ACTION ): { if( maVDev.IsLineColor() ) - ImplWritePolygonRecord( ( (const MetaPolyLineAction*) pAction )->GetPolygon(), FALSE ); + { + const MetaPolyLineAction* pA = (const MetaPolyLineAction*) pAction; + const Polygon& rPoly = pA->GetPolygon(); + + if( rPoly.GetSize() ) + { + if(pA->GetLineInfo().IsDefault()) + { + ImplWritePolygonRecord( rPoly, FALSE ); + } + else + { + // LineInfo used; handle Dash/Dot and fat lines + Impl_handleLineInfoPolyPolygons(pA->GetLineInfo(), rPoly.getB2DPolygon()); + } + } + } } break; diff --git a/svtools/source/filter.vcl/wmf/emfwr.hxx b/svtools/source/filter.vcl/wmf/emfwr.hxx index 150aa1692ade..2d3c8801ba49 100644 --- a/svtools/source/filter.vcl/wmf/emfwr.hxx +++ b/svtools/source/filter.vcl/wmf/emfwr.hxx @@ -42,6 +42,9 @@ // - EMFWriter - // ------------- +class LineInfo; +namespace basegfx { class B2DPolygon; } + class EMFWriter { private: @@ -86,6 +89,7 @@ private: void ImplWriteBmpRecord( const Bitmap& rBmp, const Point& rPt, const Size& rSz, UINT32 nROP ); void ImplWriteTextRecord( const Point& rPos, const String rText, const sal_Int32* pDXArray, sal_uInt32 nWidth ); + void Impl_handleLineInfoPolyPolygons(const LineInfo& rInfo, const basegfx::B2DPolygon& rLinePolygon); void ImplWrite( const GDIMetaFile& rMtf ); public: diff --git a/svtools/source/filter.vcl/wmf/wmfwr.cxx b/svtools/source/filter.vcl/wmf/wmfwr.cxx index ee3a71c51f9d..30d4ff06c0d2 100644 --- a/svtools/source/filter.vcl/wmf/wmfwr.cxx +++ b/svtools/source/filter.vcl/wmf/wmfwr.cxx @@ -33,7 +33,7 @@ #include <vcl/salbtype.hxx> #include "wmfwr.hxx" -#include <vcl/fontcvt.hxx> +#include <unotools/fontcvt.hxx> #include <rtl/crc.h> #include <rtl/tencinfo.h> #include <tools/tenccvt.hxx> @@ -42,8 +42,9 @@ #include <i18nutil/unicode.hxx> //unicode::getUnicodeScriptType #endif - #include <vcl/metric.hxx> +#include <basegfx/polygon/b2dpolygon.hxx> +#include <basegfx/polygon/b2dpolypolygon.hxx> //====================== MS-Windows-defines =============================== @@ -755,7 +756,7 @@ void WMFWriter::WMFRecord_Polygon(const Polygon & rPoly) Polygon aSimplePoly; if ( rPoly.HasFlags() ) - rPoly.GetSimple( aSimplePoly ); + rPoly.AdaptiveSubdivide( aSimplePoly ); else aSimplePoly = rPoly; nSize = aSimplePoly.GetSize(); @@ -770,7 +771,7 @@ void WMFWriter::WMFRecord_PolyLine(const Polygon & rPoly) USHORT nSize,i; Polygon aSimplePoly; if ( rPoly.HasFlags() ) - rPoly.GetSimple( aSimplePoly ); + rPoly.AdaptiveSubdivide( aSimplePoly ); else aSimplePoly = rPoly; nSize=aSimplePoly.GetSize(); @@ -792,7 +793,7 @@ void WMFWriter::WMFRecord_PolyPolygon(const PolyPolygon & rPolyPoly) if ( aSimplePolyPoly[ i ].HasFlags() ) { Polygon aSimplePoly; - aSimplePolyPoly[ i ].GetSimple( aSimplePoly ); + aSimplePolyPoly[ i ].AdaptiveSubdivide( aSimplePoly ); aSimplePolyPoly[ i ] = aSimplePoly; } } @@ -1136,6 +1137,49 @@ void WMFWriter::SetAllAttr() } +void WMFWriter::HandleLineInfoPolyPolygons(const LineInfo& rInfo, const basegfx::B2DPolygon& rLinePolygon) +{ + if(rLinePolygon.count()) + { + basegfx::B2DPolyPolygon aLinePolyPolygon(rLinePolygon); + basegfx::B2DPolyPolygon aFillPolyPolygon; + + rInfo.applyToB2DPolyPolygon(aLinePolyPolygon, aFillPolyPolygon); + + if(aLinePolyPolygon.count()) + { + aSrcLineInfo = rInfo; + SetLineAndFillAttr(); + + for(sal_uInt32 a(0); a < aLinePolyPolygon.count(); a++) + { + const basegfx::B2DPolygon aCandidate(aLinePolyPolygon.getB2DPolygon(a)); + WMFRecord_PolyLine(Polygon(aCandidate)); + } + } + + if(aFillPolyPolygon.count()) + { + const Color aOldLineColor(aSrcLineColor); + const Color aOldFillColor(aSrcFillColor); + + aSrcLineColor = Color( COL_TRANSPARENT ); + aSrcFillColor = aOldLineColor; + SetLineAndFillAttr(); + + for(sal_uInt32 a(0); a < aFillPolyPolygon.count(); a++) + { + const Polygon aPolygon(aFillPolyPolygon.getB2DPolygon(a)); + WMFRecord_Polygon(Polygon(aPolygon)); + } + + aSrcLineColor = aOldLineColor; + aSrcFillColor = aOldFillColor; + SetLineAndFillAttr(); + } + } +} + void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) { ULONG nA, nACount; @@ -1176,10 +1220,21 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) case META_LINE_ACTION: { const MetaLineAction* pA = (const MetaLineAction *) pMA; - aSrcLineInfo = pA->GetLineInfo(); - SetLineAndFillAttr(); - WMFRecord_MoveTo( pA->GetStartPoint() ); - WMFRecord_LineTo( pA->GetEndPoint() ); + if(pA->GetLineInfo().IsDefault()) + { + aSrcLineInfo = pA->GetLineInfo(); + SetLineAndFillAttr(); + WMFRecord_MoveTo( pA->GetStartPoint() ); + WMFRecord_LineTo( pA->GetEndPoint() ); + } + else + { + // LineInfo used; handle Dash/Dot and fat lines + basegfx::B2DPolygon aPolygon; + aPolygon.append(basegfx::B2DPoint(pA->GetStartPoint().X(), pA->GetStartPoint().Y())); + aPolygon.append(basegfx::B2DPoint(pA->GetEndPoint().X(), pA->GetEndPoint().Y())); + HandleLineInfoPolyPolygons(pA->GetLineInfo(), aPolygon); + } } break; @@ -1241,9 +1296,22 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) case META_POLYLINE_ACTION: { const MetaPolyLineAction* pA = (const MetaPolyLineAction*) pMA; - aSrcLineInfo = pA->GetLineInfo(); - SetLineAndFillAttr(); - WMFRecord_PolyLine( pA->GetPolygon() ); + const Polygon& rPoly = pA->GetPolygon(); + + if( rPoly.GetSize() ) + { + if(pA->GetLineInfo().IsDefault()) + { + aSrcLineInfo = pA->GetLineInfo(); + SetLineAndFillAttr(); + WMFRecord_PolyLine( rPoly ); + } + else + { + // LineInfo used; handle Dash/Dot and fat lines + HandleLineInfoPolyPolygons(pA->GetLineInfo(), rPoly.getB2DPolygon()); + } + } } break; diff --git a/svtools/source/filter.vcl/wmf/wmfwr.hxx b/svtools/source/filter.vcl/wmf/wmfwr.hxx index 48986a280404..03ca14e7633f 100644 --- a/svtools/source/filter.vcl/wmf/wmfwr.hxx +++ b/svtools/source/filter.vcl/wmf/wmfwr.hxx @@ -65,6 +65,9 @@ struct WMFWriterAttrStackMember // ------------- class StarSymbolToMSMultiFont; +class LineInfo; +namespace basegfx { class B2DPolygon; } + class WMFWriter { private: @@ -202,6 +205,7 @@ private: void SetLineAndFillAttr(); void SetAllAttr(); + void HandleLineInfoPolyPolygons(const LineInfo& rInfo, const basegfx::B2DPolygon& rLinePolygon); void WriteRecords(const GDIMetaFile & rMTF); void WriteHeader(const GDIMetaFile & rMTF, BOOL bPlaceable); |