From e6f6db3b04ea5d829df29cacb46a00a7fd514ee9 Mon Sep 17 00:00:00 2001 From: Douglas Mencken Date: Sat, 26 Mar 2016 02:14:16 -0400 Subject: changes for code dealing with pictures e.g. QuickDraw "PICT" Change-Id: Ic09251a676360b29ee7750e931c7384e2c1e7b3c --- avmedia/source/quicktime/framegrabber.mm | 2 +- filter/Configuration_filter.mk | 8 +- .../filter/detection/typeDetection/files.csv | 2 +- filter/source/config/cache/typedetection.cxx | 2 +- .../config/fragments/filters/PCT___Mac_Pict.xcu | 30 ----- .../fragments/filters/PICT___QuickDraw_Picture.xcu | 30 +++++ .../internalgraphicfilters/pct_Import.xcu | 6 +- .../source/config/fragments/types/pct_Mac_Pict.xcu | 29 ----- .../fragments/types/pict_QuickDraw_Picture.xcu | 29 +++++ filter/source/flash/swfwriter1.cxx | 14 +-- filter/source/graphicfilter/eps/eps.cxx | 4 +- filter/source/graphicfilter/ieps/ieps.cxx | 2 +- filter/source/graphicfilter/ipict/ipict.cxx | 77 +++++++------ filter/source/msfilter/escherex.cxx | 8 +- include/vcl/gfxlink.hxx | 10 +- include/vcl/graphicfilter.hxx | 18 +-- include/vcl/pdfwriter.hxx | 2 +- include/vcl/salctype.hxx | 6 +- oox/source/export/drawingml.cxx | 6 +- svtools/source/graphic/descriptor.cxx | 14 +-- svtools/source/graphic/descriptor.hxx | 6 +- svtools/source/graphic/provider.cxx | 12 +- svx/source/core/graphichelper.cxx | 10 +- svx/source/dialog/compressgraphicdialog.cxx | 10 +- svx/source/dialog/compressgraphicdialog.hrc | 2 +- svx/source/dialog/compressgraphicdialog.src | 6 +- svx/source/gallery2/galtheme.cxx | 26 ++--- svx/source/xml/xmlgrhlp.cxx | 6 +- svx/source/xoutdev/_xoutbmp.cxx | 8 +- sw/source/core/doc/notxtfrm.cxx | 2 +- sw/source/filter/ww8/rtfattributeoutput.cxx | 2 +- vcl/source/filter/GraphicNativeMetadata.cxx | 2 +- vcl/source/filter/GraphicNativeTransform.cxx | 4 +- vcl/source/filter/graphicfilter.cxx | 54 ++++----- vcl/source/filter/graphicfilter2.cxx | 124 ++++++++++----------- vcl/source/filter/graphicfilter_internal.hxx | 2 +- vcl/source/gdi/gfxlink.cxx | 35 +++--- vcl/source/gdi/impgraph.cxx | 9 +- vcl/source/gdi/pdfextoutdevdata.cxx | 8 +- vcl/source/gdi/pdfwriter.cxx | 4 +- vcl/source/gdi/pdfwriter_impl.cxx | 24 ++-- vcl/source/gdi/pdfwriter_impl.hxx | 6 +- vcl/source/gdi/pdfwriter_impl2.cxx | 20 ++-- 43 files changed, 344 insertions(+), 337 deletions(-) delete mode 100644 filter/source/config/fragments/filters/PCT___Mac_Pict.xcu create mode 100644 filter/source/config/fragments/filters/PICT___QuickDraw_Picture.xcu delete mode 100644 filter/source/config/fragments/types/pct_Mac_Pict.xcu create mode 100644 filter/source/config/fragments/types/pict_QuickDraw_Picture.xcu diff --git a/avmedia/source/quicktime/framegrabber.mm b/avmedia/source/quicktime/framegrabber.mm index 9407b98061d8..6d3a4f298bf0 100644 --- a/avmedia/source/quicktime/framegrabber.mm +++ b/avmedia/source/quicktime/framegrabber.mm @@ -92,7 +92,7 @@ uno::Reference< graphic::XGraphic > SAL_CALL FrameGrabber::grabFrame( double fMe const void* pBitmapData = [pBitmap bytes]; SvMemoryStream aMemStm( const_cast(pBitmapData), nSize, StreamMode::READ | StreamMode::WRITE ); Graphic aGraphic; - if ( GraphicConverter::Import( aMemStm, aGraphic, ConvertDataFormat::TIF ) == ERRCODE_NONE ) + if ( GraphicConverter::Import( aMemStm, aGraphic, ConvertDataFormat::TIFF ) == ERRCODE_NONE ) { xRet = aGraphic.GetXGraphic(); } diff --git a/filter/Configuration_filter.mk b/filter/Configuration_filter.mk index cbb951f3fe28..4b261c33f6f4 100644 --- a/filter/Configuration_filter.mk +++ b/filter/Configuration_filter.mk @@ -677,7 +677,7 @@ $(eval $(call filter_Configuration_add_types,fcfg_langpack,fcfg_drawgraphics_typ pcd_Photo_CD_Base \ pcd_Photo_CD_Base16 \ pcd_Photo_CD_Base4 \ - pct_Mac_Pict \ + pict_QuickDraw_Picture \ pcx_Zsoft_Paintbrush \ pgm_Portable_Graymap \ png_Portable_Network_Graphic \ @@ -705,7 +705,7 @@ $(eval $(call filter_Configuration_add_filters,fcfg_langpack,fcfg_drawgraphics_f MET___OS_2_Metafile \ mov__MOV \ PBM___Portable_Bitmap \ - PCT___Mac_Pict \ + PICT___QuickDraw_Picture \ PCX___Zsoft_Paintbrush \ PGM___Portable_Graymap \ PNG___Portable_Network_Graphic \ @@ -749,7 +749,7 @@ $(eval $(call filter_Configuration_add_types,fcfg_langpack,fcfg_impressgraphics_ jpg_JPEG \ met_OS2_Metafile \ pbm_Portable_Bitmap \ - pct_Mac_Pict \ + pict_QuickDraw_Picture \ pgm_Portable_Graymap \ png_Portable_Network_Graphic \ ppm_Portable_Pixelmap \ @@ -810,7 +810,7 @@ $(eval $(call filter_Configuration_add_types,fcfg_langpack,fcfg_internalgraphics pcd_Photo_CD_Base \ pcd_Photo_CD_Base16 \ pcd_Photo_CD_Base4 \ - pct_Mac_Pict \ + pict_QuickDraw_Picture \ pcx_Zsoft_Paintbrush \ pgm_Portable_Graymap \ png_Portable_Network_Graphic \ diff --git a/filter/qa/complex/filter/detection/typeDetection/files.csv b/filter/qa/complex/filter/detection/typeDetection/files.csv index da0890fe3d8f..6faf14e43159 100644 --- a/filter/qa/complex/filter/detection/typeDetection/files.csv +++ b/filter/qa/complex/filter/detection/typeDetection/files.csv @@ -104,7 +104,7 @@ gif;Graphics/pic.gif;gif_Graphics_Interchange;gif_Graphics_Interchange jpg;Graphics/pic.jpg;jpg_JPEG;jpg_JPEG met;Graphics/pic.met;met_OS2_Metafile;met_OS2_Metafile:generic_Text pbm;Graphics/pic.pbm;pbm_Portable_Bitmap;pbm_Portable_Bitmap -pct;Graphics/pic.pct;pct_Mac_Pict;pct_Mac_Pict +pict;Graphics/pic.pict;pict_QuickDraw_Picture;pict_QuickDraw_Picture pgm;Graphics/pic.pgm;pgm_Portable_Graymap;pgm_Portable_Graymap png;Graphics/pic.png;png_Portable_Network_Graphic;png_Portable_Network_Graphic ppm;Graphics/pic.ppm;ppm_Portable_Pixelmap;ppm_Portable_Pixelmap diff --git a/filter/source/config/cache/typedetection.cxx b/filter/source/config/cache/typedetection.cxx index 4638e290e17f..bb4289d32736 100644 --- a/filter/source/config/cache/typedetection.cxx +++ b/filter/source/config/cache/typedetection.cxx @@ -225,7 +225,7 @@ int getFlatTypeRank(const OUString& rType) "gif_Graphics_Interchange", "bmp_MS_Windows", "pcx_Zsoft_Paintbrush", - "pct_Mac_Pict", + "pict_QuickDraw_Picture", "pcd_Photo_CD_Base", "pcd_Photo_CD_Base4", "pcd_Photo_CD_Base16", diff --git a/filter/source/config/fragments/filters/PCT___Mac_Pict.xcu b/filter/source/config/fragments/filters/PCT___Mac_Pict.xcu deleted file mode 100644 index 92ae6cd238e7..000000000000 --- a/filter/source/config/fragments/filters/PCT___Mac_Pict.xcu +++ /dev/null @@ -1,30 +0,0 @@ - - - IMPORT ALIEN - - - - - PCT - Mac Pict - - 0 - pct_Mac_Pict - - com.sun.star.drawing.DrawingDocument - diff --git a/filter/source/config/fragments/filters/PICT___QuickDraw_Picture.xcu b/filter/source/config/fragments/filters/PICT___QuickDraw_Picture.xcu new file mode 100644 index 000000000000..6ec44bc012b6 --- /dev/null +++ b/filter/source/config/fragments/filters/PICT___QuickDraw_Picture.xcu @@ -0,0 +1,30 @@ + + + IMPORT ALIEN + + + + + PICT - Macintosh QuickDraw Picture + + 0 + pict_QuickDraw_Picture + + com.sun.star.drawing.DrawingDocument + diff --git a/filter/source/config/fragments/internalgraphicfilters/pct_Import.xcu b/filter/source/config/fragments/internalgraphicfilters/pct_Import.xcu index 63048f9b4eb2..27fa29339633 100644 --- a/filter/source/config/fragments/internalgraphicfilters/pct_Import.xcu +++ b/filter/source/config/fragments/internalgraphicfilters/pct_Import.xcu @@ -16,12 +16,12 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . --> - pct_Mac_Pict + pict_QuickDraw_Picture ipt - PCT - Mac Pict + PICT - Macintosh QuickDraw Picture - PCT - Mac Pict + PICT - Macintosh QuickDraw Picture IMPORT diff --git a/filter/source/config/fragments/types/pct_Mac_Pict.xcu b/filter/source/config/fragments/types/pct_Mac_Pict.xcu deleted file mode 100644 index d2abc377d4d9..000000000000 --- a/filter/source/config/fragments/types/pct_Mac_Pict.xcu +++ /dev/null @@ -1,29 +0,0 @@ - - - com.sun.star.comp.draw.FormatDetector - - pct pict - image/x-pict - false - PCT - Mac Pict - - PCT - Mac Pict - - - diff --git a/filter/source/config/fragments/types/pict_QuickDraw_Picture.xcu b/filter/source/config/fragments/types/pict_QuickDraw_Picture.xcu new file mode 100644 index 000000000000..6915609bc84e --- /dev/null +++ b/filter/source/config/fragments/types/pict_QuickDraw_Picture.xcu @@ -0,0 +1,29 @@ + + + com.sun.star.comp.draw.FormatDetector + + pct pict + image/x-pict + false + PICT - Macintosh QuickDraw Picture + + PICT - Macintosh QuickDraw Picture + + + diff --git a/filter/source/flash/swfwriter1.cxx b/filter/source/flash/swfwriter1.cxx index ef3bbf5118bf..e52258f301ed 100644 --- a/filter/source/flash/swfwriter1.cxx +++ b/filter/source/flash/swfwriter1.cxx @@ -774,8 +774,8 @@ sal_uInt16 Writer::defineBitmap( const BitmapEx &bmpSource, sal_Int32 nJPEGQuali sal_uInt16 nBitmapId = createID(); mBitmapCache[bmpChecksum] = nBitmapId; - // AS: OK, we have a good image, so now we decide whether or not to JPEG it or - // or Lossless compress it. + // AS: OK, we have a good image, so now we decide whether or not to JPEG it + // or Lossless compress it // Figure out lossless size sal_uInt8 *pImageData, *pAlphaData; @@ -789,7 +789,7 @@ sal_uInt16 Writer::defineBitmap( const BitmapEx &bmpSource, sal_Int32 nJPEGQuali #ifdef DBG_UTIL if(compress2(pCompressed.get(), &compressed_size, pImageData, raw_size, Z_BEST_COMPRESSION) != Z_OK) { - SAL_WARN( "filter.flash", "compress2 failed!" ); ((void)0); + SAL_WARN( "filter.flash", "compress2 failed" ); ((void)0); } #else compress2(pCompressed.get(), &compressed_size, pImageData, raw_size, Z_BEST_COMPRESSION); @@ -807,7 +807,7 @@ sal_uInt16 Writer::defineBitmap( const BitmapEx &bmpSource, sal_Int32 nJPEGQuali #ifdef DBG_UTIL if(compress2(pAlphaCompressed.get(), &alpha_compressed_size, pAlphaData, width * height, Z_BEST_COMPRESSION) != Z_OK) { - SAL_WARN( "filter.flash", "compress2 failed!" ); ((void)0); + SAL_WARN( "filter.flash", "compress2 failed" ); ((void)0); } #else compress2(pAlphaCompressed.get(), &alpha_compressed_size, pAlphaData, width * height, Z_BEST_COMPRESSION); @@ -819,11 +819,11 @@ sal_uInt16 Writer::defineBitmap( const BitmapEx &bmpSource, sal_Int32 nJPEGQuali sal_uInt32 nJpgDataLength = 0xffffffff; Graphic aGraphic( bmpSource ); - SvMemoryStream aDstStm( 65535, 65535 ); + SvMemoryStream aDstStm( ( 1 << 16 ) - 1, ( 1 << 16 ) - 1 ); GraphicFilter aFilter; - Sequence< PropertyValue > aFilterData(sal_Int32(nJPEGQualityLevel != -1)); + Sequence< PropertyValue > aFilterData( ( nJPEGQualityLevel != -1 ) ? 1 : 0 ); if( nJPEGQualityLevel != -1 ) { aFilterData[0].Name = "Quality"; @@ -831,7 +831,7 @@ sal_uInt16 Writer::defineBitmap( const BitmapEx &bmpSource, sal_Int32 nJPEGQuali } if( aFilter.ExportGraphic( aGraphic, OUString(), aDstStm, - aFilter.GetExportFormatNumberForShortName( JPG_SHORTNAME ), &aFilterData ) == ERRCODE_NONE ) + aFilter.GetExportFormatNumberForShortName( JPEG_SHORTNAME ), &aFilterData ) == ERRCODE_NONE ) { pJpgData = static_cast(aDstStm.GetData()); nJpgDataLength = aDstStm.Seek( STREAM_SEEK_TO_END ); diff --git a/filter/source/graphicfilter/eps/eps.cxx b/filter/source/graphicfilter/eps/eps.cxx index 46a5ebf28b3b..cf789037198e 100644 --- a/filter/source/graphicfilter/eps/eps.cxx +++ b/filter/source/graphicfilter/eps/eps.cxx @@ -360,10 +360,10 @@ bool PSWriter::WritePS( const Graphic& rGraphic, SvStream& rTargetStream, Filter { BitmapEx aTempBitmapEx( rGraphic.GetBitmapEx() ); aTempBitmapEx.Convert( BMP_CONVERSION_8BIT_GREYS ); - nErrCode = GraphicConverter::Export( rTargetStream, aTempBitmapEx, ConvertDataFormat::TIF ) ; + nErrCode = GraphicConverter::Export( rTargetStream, aTempBitmapEx, ConvertDataFormat::TIFF ) ; } else - nErrCode = GraphicConverter::Export( rTargetStream, rGraphic, ConvertDataFormat::TIF ) ; + nErrCode = GraphicConverter::Export( rTargetStream, rGraphic, ConvertDataFormat::TIFF ) ; if ( nErrCode == ERRCODE_NONE ) { diff --git a/filter/source/graphicfilter/ieps/ieps.cxx b/filter/source/graphicfilter/ieps/ieps.cxx index f50f9968cab0..f167d8431a4f 100644 --- a/filter/source/graphicfilter/ieps/ieps.cxx +++ b/filter/source/graphicfilter/ieps/ieps.cxx @@ -565,7 +565,7 @@ ipsGraphicImport( SvStream & rStream, Graphic & rGraphic, FilterConfigItem* ) if ( nPosTIFF && nSizeTIFF ) { rStream.Seek( nOrigPos + nPosTIFF ); - if ( GraphicConverter::Import( rStream, aGraphic, ConvertDataFormat::TIF ) == ERRCODE_NONE ) + if ( GraphicConverter::Import( rStream, aGraphic, ConvertDataFormat::TIFF ) == ERRCODE_NONE ) { MakeAsMeta(aGraphic); rStream.Seek( nOrigPos + nPosTIFF ); diff --git a/filter/source/graphicfilter/ipict/ipict.cxx b/filter/source/graphicfilter/ipict/ipict.cxx index 916258c344c2..9681a1000658 100644 --- a/filter/source/graphicfilter/ipict/ipict.cxx +++ b/filter/source/graphicfilter/ipict/ipict.cxx @@ -34,46 +34,51 @@ // complete FilterConfigItem for GraphicImport under -fsanitize=function namespace PictReaderInternal { - //! utilitary class to store a pattern, ... + + enum class PenStyle { PEN_NULL, PEN_SOLID, PEN_DOT, PEN_DASH, PEN_DASHDOT }; + + enum class BrushStyle { BRUSH_NULL, BRUSH_SOLID, BRUSH_HORZ, BRUSH_VERT, + BRUSH_CROSS, BRUSH_DIAGCROSS, BRUSH_UPDIAG, BRUSH_DOWNDIAG, + BRUSH_25, BRUSH_50, BRUSH_75, + BRUSH_BITMAP }; + + // utility class to store a pattern class Pattern { public: - //! constructor - Pattern() : penStyle(PEN_SOLID), - brushStyle(BRUSH_SOLID), - nBitCount(64), - isColor(false), - isRead(false) + // constructor + Pattern() : penStyle( PenStyle::PEN_SOLID ), + brushStyle( BrushStyle::BRUSH_SOLID ), + nBitCount( 64 ), + isColor( false ), + isRead( false ) {} - //! reads black/white pattern from SvStream + // reads black/white pattern from SvStream sal_uLong read(SvStream &stream); - //! sets the color + + // sets the color void setColor(Color &col) { isColor = true; color = col; } + /** returns a color which can be "used" to replace the pattern, - * created from ForeColor and BackColor, ... + * created from ForeColor and BackColor * - * note: maybe, we must also use some mode PatCopy, ... to define the color + * note: maybe use some PatCopy to define the color */ Color getColor(Color bkColor, Color fgColor) const { if (isColor) return color; - // we create a gray pattern from nBitCount + // create a gray pattern from nBitCount double alpha = nBitCount / 64.0; return Color(sal_uInt8(alpha*fgColor.GetRed()+(1.0-alpha)*bkColor.GetRed()), sal_uInt8(alpha*fgColor.GetGreen()+(1.0-alpha)*bkColor.GetGreen()), sal_uInt8(alpha*fgColor.GetBlue()+(1.0-alpha)*bkColor.GetBlue())); } - //! returns true if this is the default pattern + // returns true if this is the default pattern bool isDefault() const { return !isRead; } - enum PenStyle { PEN_NULL, PEN_SOLID, PEN_DOT, PEN_DASH, PEN_DASHDOT }; - enum BrushStyle { BRUSH_NULL, BRUSH_SOLID, BRUSH_HORZ, BRUSH_VERT, - BRUSH_CROSS, BRUSH_DIAGCROSS, BRUSH_UPDIAG, BRUSH_DOWNDIAG, - BRUSH_25, BRUSH_50, BRUSH_75, - BRUSH_BITMAP }; // Data - enum PenStyle penStyle; - enum BrushStyle brushStyle; + PenStyle penStyle; + BrushStyle brushStyle; short nBitCount; bool isColor; // true if it is a color pattern @@ -109,24 +114,24 @@ namespace PictReaderInternal { (sal_uLong)nbyte[7]; // create a PenStyle: - if (nBitCount<=0) penStyle=PEN_NULL; - else if (nBitCount<=16) penStyle=PEN_DOT; - else if (nBitCount<=32) penStyle=PEN_DASHDOT; - else if (nBitCount<=48) penStyle=PEN_DASH; - else penStyle=PEN_SOLID; + if (nBitCount<=0) penStyle = PenStyle::PEN_NULL; + else if (nBitCount<=16) penStyle = PenStyle::PEN_DOT; + else if (nBitCount<=32) penStyle = PenStyle::PEN_DASHDOT; + else if (nBitCount<=48) penStyle = PenStyle::PEN_DASH; + else penStyle = PenStyle::PEN_SOLID; // create a BrushStyle: - if (nHiBytes==0xffffffff && nLoBytes==0xffffffff) brushStyle=BRUSH_SOLID; - else if (nHiBytes==0xff000000 && nLoBytes==0x00000000) brushStyle=BRUSH_HORZ; - else if (nHiBytes==0x80808080 && nLoBytes==0x80808080) brushStyle=BRUSH_VERT; - else if (nHiBytes==0xff808080 && nLoBytes==0x80808080) brushStyle=BRUSH_CROSS; - else if (nHiBytes==0x01824428 && nLoBytes==0x10284482) brushStyle=BRUSH_DIAGCROSS; - else if (nHiBytes==0x80402010 && nLoBytes==0x08040201) brushStyle=BRUSH_UPDIAG; - else if (nHiBytes==0x01020408 && nLoBytes==0x10204080) brushStyle=BRUSH_DOWNDIAG; - else if (nBitCount<=24) brushStyle=BRUSH_25; - else if (nBitCount<=40) brushStyle=BRUSH_50; - else if (nBitCount<=56) brushStyle=BRUSH_75; - else brushStyle=BRUSH_SOLID; + if (nHiBytes==0xffffffff && nLoBytes==0xffffffff) brushStyle = BrushStyle::BRUSH_SOLID; + else if (nHiBytes==0xff000000 && nLoBytes==0x00000000) brushStyle = BrushStyle::BRUSH_HORZ; + else if (nHiBytes==0x80808080 && nLoBytes==0x80808080) brushStyle = BrushStyle::BRUSH_VERT; + else if (nHiBytes==0xff808080 && nLoBytes==0x80808080) brushStyle = BrushStyle::BRUSH_CROSS; + else if (nHiBytes==0x01824428 && nLoBytes==0x10284482) brushStyle = BrushStyle::BRUSH_DIAGCROSS; + else if (nHiBytes==0x80402010 && nLoBytes==0x08040201) brushStyle = BrushStyle::BRUSH_UPDIAG; + else if (nHiBytes==0x01020408 && nLoBytes==0x10204080) brushStyle = BrushStyle::BRUSH_DOWNDIAG; + else if (nBitCount<=24) brushStyle = BrushStyle::BRUSH_25; + else if (nBitCount<=40) brushStyle = BrushStyle::BRUSH_50; + else if (nBitCount<=56) brushStyle = BrushStyle::BRUSH_75; + else brushStyle = BrushStyle::BRUSH_SOLID; isRead = true; diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx index 575cb6e18ff8..a2d54ea53ed8 100644 --- a/filter/source/msfilter/escherex.cxx +++ b/filter/source/msfilter/escherex.cxx @@ -1574,10 +1574,10 @@ bool EscherPropertyContainer::CreateGraphicProperties( if ( bMirrored || nAngle || nTransparency || nRed || nGreen || nBlue || (1.0 != fGamma) || (nFormat != GraphicFileFormat::BMP && nFormat != GraphicFileFormat::GIF && - nFormat != GraphicFileFormat::JPG && + nFormat != GraphicFileFormat::JPEG && nFormat != GraphicFileFormat::PNG && - nFormat != GraphicFileFormat::TIF && - nFormat != GraphicFileFormat::PCT && + nFormat != GraphicFileFormat::TIFF && + nFormat != GraphicFileFormat::PICT && nFormat != GraphicFileFormat::WMF && nFormat != GraphicFileFormat::EMF) ) { @@ -4230,7 +4230,7 @@ sal_uInt32 EscherGraphicProvider::GetBlibID( SvStream& rPicOutStrm, const OStrin { switch ( aGraphicLink.GetType() ) { - case GfxLinkType::NativeJpg : p_EscherBlibEntry->meBlibType = PEG; break; + case GfxLinkType::NativeJpeg : p_EscherBlibEntry->meBlibType = PEG; break; case GfxLinkType::NativePng : p_EscherBlibEntry->meBlibType = PNG; break; // #i15508# added BMP type for better exports; need to check this diff --git a/include/vcl/gfxlink.hxx b/include/vcl/gfxlink.hxx index 3632b66d23f3..53c4a881d507 100644 --- a/include/vcl/gfxlink.hxx +++ b/include/vcl/gfxlink.hxx @@ -34,12 +34,12 @@ enum class GfxLinkType NONE = 0, EpsBuffer = 1, NativeGif = 2, // Don't forget to update the following defines - NativeJpg = 3, // Don't forget to update the following defines + NativeJpeg = 3, // Don't forget to update the following defines NativePng = 4, // Don't forget to update the following defines - NativeTif = 5, // Don't forget to update the following defines + NativeTiff = 5, // Don't forget to update the following defines NativeWmf = 6, // Don't forget to update the following defines NativeMet = 7, // Don't forget to update the following defines - NativePct = 8, // Don't forget to update the following defines + NativePict = 8, // Don't forget to update the following defines NativeSvg = 9, // Don't forget to update the following defines NativeMov = 10, // Don't forget to update the following defines NativeBmp = 11, @@ -64,7 +64,7 @@ private: }; - GfxLinkType meType = GfxLinkType::NONE; + GfxLinkType myType = GfxLinkType::NONE; sal_uInt32 mnUserId = 0; std::shared_ptr mpSwapInData; @@ -85,7 +85,7 @@ public: bool IsEqual( const GfxLink& ) const; - GfxLinkType GetType() const { return meType;} + GfxLinkType GetType() const { return myType; } void SetUserId( sal_uInt32 nUserId ) { mnUserId = nUserId; } sal_uInt32 GetUserId() const { return mnUserId; } diff --git a/include/vcl/graphicfilter.hxx b/include/vcl/graphicfilter.hxx index c0bbb3d62a77..cfe7d8c280f6 100644 --- a/include/vcl/graphicfilter.hxx +++ b/include/vcl/graphicfilter.hxx @@ -87,12 +87,12 @@ namespace o3tl #define BMP_SHORTNAME "BMP" #define GIF_SHORTNAME "GIF" -#define JPG_SHORTNAME "JPG" +#define JPEG_SHORTNAME "JPEG" #define MET_SHORTNAME "MET" -#define PCT_SHORTNAME "PCT" +#define PICT_SHORTNAME "PICT" #define PNG_SHORTNAME "PNG" #define SVM_SHORTNAME "SVM" -#define TIF_SHORTNAME "TIF" +#define TIFF_SHORTNAME "TIFF" #define WMF_SHORTNAME "WMF" #define EMF_SHORTNAME "EMF" #define SVG_SHORTNAME "SVG" @@ -104,11 +104,11 @@ enum class GraphicFileFormat NOT = 0x0000, BMP = 0x0001, GIF = 0x0002, - JPG = 0x0003, + JPEG = 0x0003, PCD = 0x0004, PCX = 0x0005, PNG = 0x0006, - TIF = 0x0007, + TIFF = 0x0007, XBM = 0x0008, XPM = 0x0009, PBM = 0x000a, @@ -120,7 +120,7 @@ enum class GraphicFileFormat EPS = 0x0010, DXF = 0x00f1, MET = 0x00f2, - PCT = 0x00f3, + PICT = 0x00f3, SGF = 0x00f4, SVM = 0x00f5, WMF = 0x00f6, @@ -147,11 +147,11 @@ class VCL_DLLPUBLIC GraphicDescriptor final bool ImpDetectBMP( SvStream& rStm, bool bExtendedInfo ); bool ImpDetectGIF( SvStream& rStm, bool bExtendedInfo ); - bool ImpDetectJPG( SvStream& rStm, bool bExtendedInfo ); + bool ImpDetectJPEG( SvStream& rStm, bool bExtendedInfo ); bool ImpDetectPCD( SvStream& rStm, bool bExtendedInfo ); bool ImpDetectPCX( SvStream& rStm, bool bExtendedInfo ); bool ImpDetectPNG( SvStream& rStm, bool bExtendedInfo ); - bool ImpDetectTIF( SvStream& rStm, bool bExtendedInfo ); + bool ImpDetectTIFF( SvStream& rStm, bool bExtendedInfo ); bool ImpDetectXBM( SvStream& rStm, bool bExtendedInfo ); bool ImpDetectXPM( SvStream& rStm, bool bExtendedInfo ); bool ImpDetectPBM( SvStream& rStm, bool bExtendedInfo ); @@ -163,7 +163,7 @@ class VCL_DLLPUBLIC GraphicDescriptor final bool ImpDetectEPS( SvStream& rStm, bool bExtendedInfo ); bool ImpDetectDXF( SvStream& rStm, bool bExtendedInfo ); bool ImpDetectMET( SvStream& rStm, bool bExtendedInfo ); - bool ImpDetectPCT( SvStream& rStm, bool bExtendedInfo ); + bool ImpDetectPICT( SvStream& rStm, bool bExtendedInfo ); bool ImpDetectSGF( SvStream& rStm, bool bExtendedInfo ); bool ImpDetectSVM( SvStream& rStm, bool bExtendedInfo ); bool ImpDetectWMF( SvStream& rStm, bool bExtendedInfo ); diff --git a/include/vcl/pdfwriter.hxx b/include/vcl/pdfwriter.hxx index 29aecc7ce749..983ef852d998 100644 --- a/include/vcl/pdfwriter.hxx +++ b/include/vcl/pdfwriter.hxx @@ -872,7 +872,7 @@ The following structure describes the permissions used in PDF security the same pixel size as the image and be either 1 bit black&white or 8 bit grey */ - void DrawJPGBitmap( SvStream& rJPGData, bool bIsTrueColor, const Size& rSrcSizePixel, const Rectangle& rTargetArea, const Bitmap& rMask ); + void DrawJPEG( SvStream& rJPGData, bool bIsTrueColor, const Size& rSrcSizePixel, const Rectangle& rTargetArea, const Bitmap& rMask ); /** Create a new named destination to be used in a link from another PDF document diff --git a/include/vcl/salctype.hxx b/include/vcl/salctype.hxx index e7afbcb02b2e..3661e059ee61 100644 --- a/include/vcl/salctype.hxx +++ b/include/vcl/salctype.hxx @@ -29,12 +29,12 @@ enum class ConvertDataFormat Unknown, BMP, GIF, - JPG, + JPEG, MET, - PCT, + PICT, PNG, SVM, - TIF, + TIFF, WMF, EMF, SVG diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 262e8eebd72d..38414ea1731d 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -856,7 +856,7 @@ OUString DrawingML::WriteImage( const Graphic& rGraphic , bool bRelPathToMedia ) pExtension = ".bmp"; break; - case GfxLinkType::NativeJpg: + case GfxLinkType::NativeJpeg: sMediaType = "image/jpeg"; pExtension = ".jpeg"; break; @@ -864,7 +864,7 @@ OUString DrawingML::WriteImage( const Graphic& rGraphic , bool bRelPathToMedia ) sMediaType = "image/png"; pExtension = ".png"; break; - case GfxLinkType::NativeTif: + case GfxLinkType::NativeTiff: sMediaType = "image/tiff"; pExtension = ".tif"; break; @@ -876,7 +876,7 @@ OUString DrawingML::WriteImage( const Graphic& rGraphic , bool bRelPathToMedia ) sMediaType = "image/x-met"; pExtension = ".met"; break; - case GfxLinkType::NativePct: + case GfxLinkType::NativePict: sMediaType = "image/x-pict"; pExtension = ".pct"; break; diff --git a/svtools/source/graphic/descriptor.cxx b/svtools/source/graphic/descriptor.cxx index ca4b4346c5db..751ae4821cba 100644 --- a/svtools/source/graphic/descriptor.cxx +++ b/svtools/source/graphic/descriptor.cxx @@ -111,11 +111,11 @@ void GraphicDescriptor::implCreate( SvStream& rIStm, const OUString* pURL ) { case GraphicFileFormat::BMP: pMimeType = MIMETYPE_BMP; cType = graphic::GraphicType::PIXEL; break; case GraphicFileFormat::GIF: pMimeType = MIMETYPE_GIF; cType = graphic::GraphicType::PIXEL; break; - case GraphicFileFormat::JPG: pMimeType = MIMETYPE_JPG; cType = graphic::GraphicType::PIXEL; break; + case GraphicFileFormat::JPEG: pMimeType = MIMETYPE_JPEG; cType = graphic::GraphicType::PIXEL; break; case GraphicFileFormat::PCD: pMimeType = MIMETYPE_PCD; cType = graphic::GraphicType::PIXEL; break; case GraphicFileFormat::PCX: pMimeType = MIMETYPE_PCX; cType = graphic::GraphicType::PIXEL; break; case GraphicFileFormat::PNG: pMimeType = MIMETYPE_PNG; cType = graphic::GraphicType::PIXEL; break; - case GraphicFileFormat::TIF: pMimeType = MIMETYPE_TIF; cType = graphic::GraphicType::PIXEL; break; + case GraphicFileFormat::TIFF: pMimeType = MIMETYPE_TIFF; cType = graphic::GraphicType::PIXEL; break; case GraphicFileFormat::XBM: pMimeType = MIMETYPE_XBM; cType = graphic::GraphicType::PIXEL; break; case GraphicFileFormat::XPM: pMimeType = MIMETYPE_XPM; cType = graphic::GraphicType::PIXEL; break; case GraphicFileFormat::PBM: pMimeType = MIMETYPE_PBM; cType = graphic::GraphicType::PIXEL; break; @@ -128,7 +128,7 @@ void GraphicDescriptor::implCreate( SvStream& rIStm, const OUString* pURL ) case GraphicFileFormat::EPS: pMimeType = MIMETYPE_EPS; cType = graphic::GraphicType::VECTOR; break; case GraphicFileFormat::DXF: pMimeType = MIMETYPE_DXF; cType = graphic::GraphicType::VECTOR; break; case GraphicFileFormat::MET: pMimeType = MIMETYPE_MET; cType = graphic::GraphicType::VECTOR; break; - case GraphicFileFormat::PCT: pMimeType = MIMETYPE_PCT; cType = graphic::GraphicType::VECTOR; break; + case GraphicFileFormat::PICT: pMimeType = MIMETYPE_PICT; cType = graphic::GraphicType::VECTOR; break; case GraphicFileFormat::SGF: pMimeType = MIMETYPE_SGF; cType = graphic::GraphicType::VECTOR; break; case GraphicFileFormat::SVM: pMimeType = MIMETYPE_SVM; cType = graphic::GraphicType::VECTOR; break; case GraphicFileFormat::WMF: pMimeType = MIMETYPE_WMF; cType = graphic::GraphicType::VECTOR; break; @@ -303,19 +303,19 @@ void GraphicDescriptor::_getPropertyValues( const comphelper::PropertyMapEntry** if( mpGraphic->IsLink() ) { const char* pMimeType; - - switch( mpGraphic->GetLink().GetType() ) + GfxLinkType theType = mpGraphic->GetLink().GetType(); + switch( theType ) { case GfxLinkType::NativeGif: pMimeType = MIMETYPE_GIF; break; // #i15508# added BMP type for better exports (checked, works) case GfxLinkType::NativeBmp: pMimeType = MIMETYPE_BMP; break; - case GfxLinkType::NativeJpg: pMimeType = MIMETYPE_JPG; break; + case GfxLinkType::NativeJpeg: pMimeType = MIMETYPE_JPEG; break; case GfxLinkType::NativePng: pMimeType = MIMETYPE_PNG; break; case GfxLinkType::NativeWmf: pMimeType = MIMETYPE_WMF; break; case GfxLinkType::NativeMet: pMimeType = MIMETYPE_MET; break; - case GfxLinkType::NativePct: pMimeType = MIMETYPE_PCT; break; + case GfxLinkType::NativePict: pMimeType = MIMETYPE_PICT; break; // added Svg mimetype support case GfxLinkType::NativeSvg: pMimeType = MIMETYPE_SVG; break; diff --git a/svtools/source/graphic/descriptor.hxx b/svtools/source/graphic/descriptor.hxx index 029a1d8520f5..7b3f07cd50b7 100644 --- a/svtools/source/graphic/descriptor.hxx +++ b/svtools/source/graphic/descriptor.hxx @@ -28,11 +28,11 @@ #define MIMETYPE_BMP "image/x-MS-bmp" #define MIMETYPE_GIF "image/gif" -#define MIMETYPE_JPG "image/jpeg" +#define MIMETYPE_JPEG "image/jpeg" #define MIMETYPE_PCD "image/x-photo-cd" #define MIMETYPE_PCX "image/x-pcx" #define MIMETYPE_PNG "image/png" -#define MIMETYPE_TIF "image/tiff" +#define MIMETYPE_TIFF "image/tiff" #define MIMETYPE_XBM "image/x-xbitmap" #define MIMETYPE_XPM "image/x-xpixmap" #define MIMETYPE_PBM "image/x-portable-bitmap" @@ -44,7 +44,7 @@ #define MIMETYPE_EPS "image/x-eps" #define MIMETYPE_DXF "image/vnd.dxf" #define MIMETYPE_MET "image/x-met" -#define MIMETYPE_PCT "image/x-pict" +#define MIMETYPE_PICT "image/x-pict" #define MIMETYPE_SGF "image/x-sgf" #define MIMETYPE_SVM "image/x-svm" #define MIMETYPE_WMF "image/x-wmf" diff --git a/svtools/source/graphic/provider.cxx b/svtools/source/graphic/provider.cxx index 3666fdcc2c22..9c64d1ea1429 100644 --- a/svtools/source/graphic/provider.cxx +++ b/svtools/source/graphic/provider.cxx @@ -783,14 +783,14 @@ void SAL_CALL GraphicProvider::storeGraphic( const uno::Reference< ::graphic::XG pFilterShortName = "eps"; else if (aMimeType == MIMETYPE_GIF) pFilterShortName = "gif"; - else if (aMimeType == MIMETYPE_JPG) - pFilterShortName = "jpg"; + else if (aMimeType == MIMETYPE_JPEG) + pFilterShortName = "jpeg"; else if (aMimeType == MIMETYPE_MET) pFilterShortName = "met"; else if (aMimeType == MIMETYPE_PNG) pFilterShortName = "png"; - else if (aMimeType == MIMETYPE_PCT) - pFilterShortName = "pct"; + else if (aMimeType == MIMETYPE_PICT) + pFilterShortName = "pict"; else if (aMimeType == MIMETYPE_PBM) pFilterShortName = "pbm"; else if (aMimeType == MIMETYPE_PGM) @@ -801,8 +801,8 @@ void SAL_CALL GraphicProvider::storeGraphic( const uno::Reference< ::graphic::XG pFilterShortName = "ras"; else if (aMimeType == MIMETYPE_SVM) pFilterShortName = "svm"; - else if (aMimeType == MIMETYPE_TIF) - pFilterShortName = "tif"; + else if (aMimeType == MIMETYPE_TIFF) + pFilterShortName = "tiff"; else if (aMimeType == MIMETYPE_EMF) pFilterShortName = "emf"; else if (aMimeType == MIMETYPE_WMF) diff --git a/svx/source/core/graphichelper.cxx b/svx/source/core/graphichelper.cxx index 742e8cd0be7d..260222a6c521 100644 --- a/svx/source/core/graphichelper.cxx +++ b/svx/source/core/graphichelper.cxx @@ -66,8 +66,8 @@ void GraphicHelper::GetPreferredExtension( OUString& rExtension, const Graphic& case GfxLinkType::NativeGif: aExtension = "gif"; break; - case GfxLinkType::NativeTif: - aExtension = "tif"; + case GfxLinkType::NativeTiff: + aExtension = "tiff"; break; case GfxLinkType::NativeWmf: aExtension = "wmf"; @@ -75,10 +75,10 @@ void GraphicHelper::GetPreferredExtension( OUString& rExtension, const Graphic& case GfxLinkType::NativeMet: aExtension = "met"; break; - case GfxLinkType::NativePct: - aExtension = "pct"; + case GfxLinkType::NativePict: + aExtension = "pict"; break; - case GfxLinkType::NativeJpg: + case GfxLinkType::NativeJpeg: aExtension = "jpg"; break; case GfxLinkType::NativeBmp: diff --git a/svx/source/dialog/compressgraphicdialog.cxx b/svx/source/dialog/compressgraphicdialog.cxx index 17a577c91bff..dc1218c3cc72 100644 --- a/svx/source/dialog/compressgraphicdialog.cxx +++ b/svx/source/dialog/compressgraphicdialog.cxx @@ -145,18 +145,18 @@ void CompressGraphicsDialog::Update() { GfxLinkType aLinkType = m_aGraphic.GetLink().GetType(); OUString aGraphicTypeString; - switch(aLinkType) + switch( aLinkType ) { case GfxLinkType::NativeGif: aGraphicTypeString = SVX_RESSTR(STR_IMAGE_GIF); break; - case GfxLinkType::NativeJpg: + case GfxLinkType::NativeJpeg: aGraphicTypeString = SVX_RESSTR(STR_IMAGE_JPEG); break; case GfxLinkType::NativePng: aGraphicTypeString = SVX_RESSTR(STR_IMAGE_PNG); break; - case GfxLinkType::NativeTif: + case GfxLinkType::NativeTiff: aGraphicTypeString = SVX_RESSTR(STR_IMAGE_TIFF); break; case GfxLinkType::NativeWmf: @@ -165,8 +165,8 @@ void CompressGraphicsDialog::Update() case GfxLinkType::NativeMet: aGraphicTypeString = SVX_RESSTR(STR_IMAGE_MET); break; - case GfxLinkType::NativePct: - aGraphicTypeString = SVX_RESSTR(STR_IMAGE_PCT); + case GfxLinkType::NativePict: + aGraphicTypeString = SVX_RESSTR(STR_IMAGE_PICT); break; case GfxLinkType::NativeSvg: aGraphicTypeString = SVX_RESSTR(STR_IMAGE_SVG); diff --git a/svx/source/dialog/compressgraphicdialog.hrc b/svx/source/dialog/compressgraphicdialog.hrc index 2dd73ca251ac..85f91d1b3e0e 100644 --- a/svx/source/dialog/compressgraphicdialog.hrc +++ b/svx/source/dialog/compressgraphicdialog.hrc @@ -26,7 +26,7 @@ #define STR_IMAGE_TIFF 262 #define STR_IMAGE_WMF 263 #define STR_IMAGE_MET 264 -#define STR_IMAGE_PCT 265 +#define STR_IMAGE_PICT 265 #define STR_IMAGE_SVG 266 #define STR_IMAGE_BMP 267 #define STR_IMAGE_UNKNOWN 268 diff --git a/svx/source/dialog/compressgraphicdialog.src b/svx/source/dialog/compressgraphicdialog.src index b2377c814c14..1a9096dcd72a 100644 --- a/svx/source/dialog/compressgraphicdialog.src +++ b/svx/source/dialog/compressgraphicdialog.src @@ -41,7 +41,7 @@ String STR_IMAGE_GIF String STR_IMAGE_JPEG { - Text [ en-US ] = "Jpeg image"; + Text [ en-US ] = "JPEG image"; }; String STR_IMAGE_PNG @@ -64,9 +64,9 @@ String STR_IMAGE_MET Text [ en-US ] = "MET image"; }; -String STR_IMAGE_PCT +String STR_IMAGE_PICT { - Text [ en-US ] = "PCT image"; + Text [ en-US ] = "PICT image"; }; String STR_IMAGE_SVG diff --git a/svx/source/gallery2/galtheme.cxx b/svx/source/gallery2/galtheme.cxx index 02ea64cd7a2a..0560ecaa5ee9 100644 --- a/svx/source/gallery2/galtheme.cxx +++ b/svx/source/gallery2/galtheme.cxx @@ -266,16 +266,16 @@ INetURLObject GalleryTheme::ImplCreateUniqueURL( SgaObjKind eObjKind, ConvertDat { switch( nFormat ) { - case ConvertDataFormat::BMP: pExt = ".bmp"; break; - case ConvertDataFormat::GIF: pExt = ".gif"; break; - case ConvertDataFormat::JPG: pExt = ".jpg"; break; - case ConvertDataFormat::MET: pExt = ".met"; break; - case ConvertDataFormat::PCT: pExt = ".pct"; break; - case ConvertDataFormat::PNG: pExt = ".png"; break; - case ConvertDataFormat::SVM: pExt = ".svm"; break; - case ConvertDataFormat::TIF: pExt = ".tif"; break; - case ConvertDataFormat::WMF: pExt = ".wmf"; break; - case ConvertDataFormat::EMF: pExt = ".emf"; break; + case ConvertDataFormat::BMP: pExt = ".bmp"; break; + case ConvertDataFormat::GIF: pExt = ".gif"; break; + case ConvertDataFormat::JPEG: pExt = ".jpg"; break; + case ConvertDataFormat::MET: pExt = ".met"; break; + case ConvertDataFormat::PICT: pExt = ".pict"; break; + case ConvertDataFormat::PNG: pExt = ".png"; break; + case ConvertDataFormat::SVM: pExt = ".svm"; break; + case ConvertDataFormat::TIFF: pExt = ".tiff"; break; + case ConvertDataFormat::WMF: pExt = ".wmf"; break; + case ConvertDataFormat::EMF: pExt = ".emf"; break; default: pExt = ".grf"; @@ -859,12 +859,12 @@ bool GalleryTheme::InsertGraphic( const Graphic& rGraphic, sal_uIntPtr nInsertPo // could not find/trigger a call to this, but should do no harm case GfxLinkType::NativeBmp: nExportFormat = ConvertDataFormat::BMP; break; - case GfxLinkType::NativeJpg: nExportFormat = ConvertDataFormat::JPG; break; + case GfxLinkType::NativeJpeg: nExportFormat = ConvertDataFormat::JPEG; break; case GfxLinkType::NativePng: nExportFormat = ConvertDataFormat::PNG; break; - case GfxLinkType::NativeTif: nExportFormat = ConvertDataFormat::TIF; break; + case GfxLinkType::NativeTiff: nExportFormat = ConvertDataFormat::TIFF; break; case GfxLinkType::NativeWmf: nExportFormat = ConvertDataFormat::WMF; break; case GfxLinkType::NativeMet: nExportFormat = ConvertDataFormat::MET; break; - case GfxLinkType::NativePct: nExportFormat = ConvertDataFormat::PCT; break; + case GfxLinkType::NativePict: nExportFormat = ConvertDataFormat::PICT; break; case GfxLinkType::NativeSvg: nExportFormat = ConvertDataFormat::SVG; break; default: break; diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx index 4ef3bfe43dff..63cac903aa96 100644 --- a/svx/source/xml/xmlgrhlp.cxx +++ b/svx/source/xml/xmlgrhlp.cxx @@ -668,12 +668,12 @@ void SvXMLGraphicHelper::ImplInsertGraphicURL( const OUString& rURLStr, sal_uInt case GfxLinkType::NativeGif: aExtension = ".gif"; break; // #i15508# added BMP type for better exports (checked, works) case GfxLinkType::NativeBmp: aExtension = ".bmp"; break; - case GfxLinkType::NativeJpg: aExtension = ".jpg"; break; + case GfxLinkType::NativeJpeg: aExtension = ".jpg"; break; case GfxLinkType::NativePng: aExtension = ".png"; break; - case GfxLinkType::NativeTif: aExtension = ".tif"; break; + case GfxLinkType::NativeTiff: aExtension = ".tiff"; break; case GfxLinkType::NativeWmf: aExtension = ".wmf"; break; case GfxLinkType::NativeMet: aExtension = ".met"; break; - case GfxLinkType::NativePct: aExtension = ".pct"; break; + case GfxLinkType::NativePict: aExtension = ".pict"; break; case GfxLinkType::NativeSvg: // backward-compat kludge: since no released OOo // version to date can handle svg properly, wrap it up diff --git a/svx/source/xoutdev/_xoutbmp.cxx b/svx/source/xoutdev/_xoutbmp.cxx index 888482e19e99..f973c813b573 100644 --- a/svx/source/xoutdev/_xoutbmp.cxx +++ b/svx/source/xoutdev/_xoutbmp.cxx @@ -36,7 +36,7 @@ #define FORMAT_BMP "bmp" #define FORMAT_GIF "gif" -#define FORMAT_JPG "jpg" +#define FORMAT_JPEG "jpg" #define FORMAT_PNG "png" using namespace com::sun::star; @@ -209,7 +209,7 @@ sal_uInt16 XOutBitmap::WriteGraphic( const Graphic& rGraphic, OUString& rFileNam // #i15508# added BMP type for better exports (no call/trigger found, prob used in HTML export) case GfxLinkType::NativeBmp: aExt = FORMAT_BMP; break; - case GfxLinkType::NativeJpg: aExt = FORMAT_JPG; break; + case GfxLinkType::NativeJpeg: aExt = FORMAT_JPEG; break; case GfxLinkType::NativePng: aExt = FORMAT_PNG; break; default: @@ -356,8 +356,8 @@ bool XOutBitmap::GraphicToBase64(const Graphic& rGraphic, OUString& rOUString) ConvertDataFormat aCvtType; switch( aLink.GetType() ) { - case GfxLinkType::NativeJpg: - aCvtType = ConvertDataFormat::JPG; + case GfxLinkType::NativeJpeg: + aCvtType = ConvertDataFormat::JPEG; aMimeType = "image/jpeg"; break; case GfxLinkType::NativePng: diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx index 533ba658c4c0..80c12bad20d4 100644 --- a/sw/source/core/doc/notxtfrm.cxx +++ b/sw/source/core/doc/notxtfrm.cxx @@ -801,7 +801,7 @@ void paintGraphicUsingPrimitivesHelper(vcl::RenderContext & rOutputDevice, if (GRFILTER_OK == GraphicFilter::GetGraphicFilter().ImportGraphic(aTempGraphic, aURL)) { - if(aTempGraphic.IsLink() && GfxLinkType::NativeJpg == aTempGraphic.GetLink().GetType()) + if(aTempGraphic.IsLink() && GfxLinkType::NativeJpeg == aTempGraphic.GetLink().GetType()) { aContent[0] = new drawinglayer::primitive2d::GraphicPrimitive2D( aTargetTransform, diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index 615bcb6b6b48..08e2e1cdd02e 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -3863,7 +3863,7 @@ void RtfAttributeOutput::FlyFrameGraphic(const SwFlyFrameFormat* pFlyFrameFormat pGraphicAry = nullptr; break; - case GfxLinkType::NativeJpg: + case GfxLinkType::NativeJpeg: pBLIPType = OOO_STRING_SVTOOLS_RTF_JPEGBLIP; break; case GfxLinkType::NativePng: diff --git a/vcl/source/filter/GraphicNativeMetadata.cxx b/vcl/source/filter/GraphicNativeMetadata.cxx index aea930d7174f..0384f910f771 100644 --- a/vcl/source/filter/GraphicNativeMetadata.cxx +++ b/vcl/source/filter/GraphicNativeMetadata.cxx @@ -35,7 +35,7 @@ GraphicNativeMetadata::~GraphicNativeMetadata() bool GraphicNativeMetadata::read(Graphic& rGraphic) { GfxLink aLink = rGraphic.GetLink(); - if ( aLink.GetType() != GfxLinkType::NativeJpg ) + if ( aLink.GetType() != GfxLinkType::NativeJpeg ) return false; sal_uInt32 aDataSize = aLink.GetDataSize(); diff --git a/vcl/source/filter/GraphicNativeTransform.cxx b/vcl/source/filter/GraphicNativeTransform.cxx index fc6143296072..ef846146c796 100644 --- a/vcl/source/filter/GraphicNativeTransform.cxx +++ b/vcl/source/filter/GraphicNativeTransform.cxx @@ -44,7 +44,7 @@ bool GraphicNativeTransform::canBeRotated() return false; } - if ( aLink.GetType() == GfxLinkType::NativeJpg + if ( aLink.GetType() == GfxLinkType::NativeJpeg || aLink.GetType() == GfxLinkType::NativePng || aLink.GetType() == GfxLinkType::NativeGif || aLink.GetType() == GfxLinkType::NONE) @@ -70,7 +70,7 @@ bool GraphicNativeTransform::rotate(sal_uInt16 aInputRotation) } GfxLink aLink = mrGraphic.GetLink(); - if ( aLink.GetType() == GfxLinkType::NativeJpg ) + if ( aLink.GetType() == GfxLinkType::NativeJpeg ) { return rotateJPEG(aRotation); } diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx index 50506fe955a0..9c78ebb0a805 100644 --- a/vcl/source/filter/graphicfilter.cxx +++ b/vcl/source/filter/graphicfilter.cxx @@ -178,7 +178,7 @@ inline OUString ImpGetExtension( const OUString &rPath ) return aExt; } -bool isPCT(SvStream& rStream, sal_uLong nStreamPos, sal_uLong nStreamLen) +bool isPICT( SvStream& rStream, sal_uLong nStreamPos, sal_uLong nStreamLen ) { sal_uInt8 sBuf[3]; // store number format @@ -404,13 +404,13 @@ static bool ImpPeekGraphicFormat( SvStream& rStream, OUString& rFormatExtension, } } - //--------------------------- TIF ------------------------------------ - if( !bTest || rFormatExtension.startsWith( "TIF" ) ) + //--------------------------- TIFF ----------------------------------- + if( !bTest || rFormatExtension.startsWith( "TIFF" ) || rFormatExtension.startsWith( "TIF" ) ) { bSomethingTested=true; if ( nFirstLong==0x49492a00 || nFirstLong==0x4d4d002a ) { - rFormatExtension = "TIF"; + rFormatExtension = "TIFF"; return true; } } @@ -437,14 +437,14 @@ static bool ImpPeekGraphicFormat( SvStream& rStream, OUString& rFormatExtension, } } - //--------------------------- JPG ------------------------------------ - if( !bTest || rFormatExtension.startsWith( "JPG" ) ) + //--------------------------- JPEG ----------------------------------- + if( !bTest || rFormatExtension.startsWith( "JPEG" ) || rFormatExtension.startsWith( "JPG" ) ) { bSomethingTested=true; if ( ( nFirstLong==0xffd8ffe0 && sFirstBytes[6]==0x4a && sFirstBytes[7]==0x46 && sFirstBytes[8]==0x49 && sFirstBytes[9]==0x46 ) || ( nFirstLong==0xffd8fffe ) || ( 0xffd8ff00 == ( nFirstLong & 0xffffff00 ) ) ) { - rFormatExtension = "JPG"; + rFormatExtension = "JPEG"; return true; } } @@ -542,13 +542,13 @@ static bool ImpPeekGraphicFormat( SvStream& rStream, OUString& rFormatExtension, } - //--------------------------- PCT ------------------------------------ - if( !bTest || rFormatExtension.startsWith( "PCT" ) ) + //--------------------------- PICT ------------------------------------ + if( !bTest || rFormatExtension.startsWith( "PICT" ) || rFormatExtension.startsWith( "PCT" ) ) { bSomethingTested = true; - if (isPCT(rStream, nStreamPos, nStreamLen)) + if ( isPICT( rStream, nStreamPos, nStreamLen ) ) { - rFormatExtension = "PCT"; + rFormatExtension = "PICT"; return true; } } @@ -1497,7 +1497,7 @@ sal_uInt16 GraphicFilter::ImportGraphic( Graphic& rGraphic, const OUString& rPat if( !ImportJPEG( rIStream, rGraphic, nullptr, nImportFlags ) ) nStatus = GRFILTER_FILTERERROR; else - eLinkType = GfxLinkType::NativeJpg; + eLinkType = GfxLinkType::NativeJpeg; } else if( aFilterName.equalsIgnoreAsciiCase( IMP_SVG ) ) { @@ -1732,12 +1732,12 @@ sal_uInt16 GraphicFilter::ImportGraphic( Graphic& rGraphic, const OUString& rPat // try to set link type if format matches if( nFormat != GRFILTER_FORMAT_DONTKNOW ) { - if( aShortName.startsWith( TIF_SHORTNAME ) ) - eLinkType = GfxLinkType::NativeTif; + if( aShortName.startsWith( TIFF_SHORTNAME ) ) + eLinkType = GfxLinkType::NativeTiff; else if( aShortName.startsWith( MET_SHORTNAME ) ) eLinkType = GfxLinkType::NativeMet; - else if( aShortName.startsWith( PCT_SHORTNAME ) ) - eLinkType = GfxLinkType::NativePct; + else if( aShortName.startsWith( PICT_SHORTNAME ) ) + eLinkType = GfxLinkType::NativePict; } } } @@ -2140,17 +2140,17 @@ IMPL_LINK( GraphicFilter, FilterCallback, ConvertData&, rData, bool ) OString aShortName; switch( rData.mnFormat ) { - case( ConvertDataFormat::BMP ): aShortName = BMP_SHORTNAME; break; - case( ConvertDataFormat::GIF ): aShortName = GIF_SHORTNAME; break; - case( ConvertDataFormat::JPG ): aShortName = JPG_SHORTNAME; break; - case( ConvertDataFormat::MET ): aShortName = MET_SHORTNAME; break; - case( ConvertDataFormat::PCT ): aShortName = PCT_SHORTNAME; break; - case( ConvertDataFormat::PNG ): aShortName = PNG_SHORTNAME; break; - case( ConvertDataFormat::SVM ): aShortName = SVM_SHORTNAME; break; - case( ConvertDataFormat::TIF ): aShortName = TIF_SHORTNAME; break; - case( ConvertDataFormat::WMF ): aShortName = WMF_SHORTNAME; break; - case( ConvertDataFormat::EMF ): aShortName = EMF_SHORTNAME; break; - case( ConvertDataFormat::SVG ): aShortName = SVG_SHORTNAME; break; + case( ConvertDataFormat::BMP ): aShortName = BMP_SHORTNAME; break; + case( ConvertDataFormat::GIF ): aShortName = GIF_SHORTNAME; break; + case( ConvertDataFormat::JPEG ): aShortName = JPEG_SHORTNAME; break; + case( ConvertDataFormat::MET ): aShortName = MET_SHORTNAME; break; + case( ConvertDataFormat::PICT ): aShortName = PICT_SHORTNAME; break; + case( ConvertDataFormat::PNG ): aShortName = PNG_SHORTNAME; break; + case( ConvertDataFormat::SVM ): aShortName = SVM_SHORTNAME; break; + case( ConvertDataFormat::TIFF ): aShortName = TIFF_SHORTNAME; break; + case( ConvertDataFormat::WMF ): aShortName = WMF_SHORTNAME; break; + case( ConvertDataFormat::EMF ): aShortName = EMF_SHORTNAME; break; + case( ConvertDataFormat::SVG ): aShortName = SVG_SHORTNAME; break; default: break; diff --git a/vcl/source/filter/graphicfilter2.cxx b/vcl/source/filter/graphicfilter2.cxx index 9bb001ac06ef..a58f078467b9 100644 --- a/vcl/source/filter/graphicfilter2.cxx +++ b/vcl/source/filter/graphicfilter2.cxx @@ -62,31 +62,31 @@ bool GraphicDescriptor::Detect( bool bExtendedInfo ) SvStream& rStm = *pFileStm; SvStreamEndian nOldFormat = rStm.GetEndian(); - if ( ImpDetectGIF( rStm, bExtendedInfo ) ) bRet = true; - else if ( ImpDetectJPG( rStm, bExtendedInfo ) ) bRet = true; - else if ( ImpDetectBMP( rStm, bExtendedInfo ) ) bRet = true; - else if ( ImpDetectPNG( rStm, bExtendedInfo ) ) bRet = true; - else if ( ImpDetectTIF( rStm, bExtendedInfo ) ) bRet = true; - else if ( ImpDetectPCX( rStm, bExtendedInfo ) ) bRet = true; - else if ( ImpDetectDXF( rStm, bExtendedInfo ) ) bRet = true; - else if ( ImpDetectMET( rStm, bExtendedInfo ) ) bRet = true; - else if ( ImpDetectSGF( rStm, bExtendedInfo ) ) bRet = true; - else if ( ImpDetectSGV( rStm, bExtendedInfo ) ) bRet = true; - else if ( ImpDetectSVM( rStm, bExtendedInfo ) ) bRet = true; - else if ( ImpDetectWMF( rStm, bExtendedInfo ) ) bRet = true; - else if ( ImpDetectEMF( rStm, bExtendedInfo ) ) bRet = true; - else if ( ImpDetectSVG( rStm, bExtendedInfo ) ) bRet = true; - else if ( ImpDetectPCT( rStm, bExtendedInfo ) ) bRet = true; - else if ( ImpDetectXBM( rStm, bExtendedInfo ) ) bRet = true; - else if ( ImpDetectXPM( rStm, bExtendedInfo ) ) bRet = true; - else if ( ImpDetectPBM( rStm, bExtendedInfo ) ) bRet = true; - else if ( ImpDetectPGM( rStm, bExtendedInfo ) ) bRet = true; - else if ( ImpDetectPPM( rStm, bExtendedInfo ) ) bRet = true; - else if ( ImpDetectRAS( rStm, bExtendedInfo ) ) bRet = true; - else if ( ImpDetectTGA( rStm, bExtendedInfo ) ) bRet = true; - else if ( ImpDetectPSD( rStm, bExtendedInfo ) ) bRet = true; - else if ( ImpDetectEPS( rStm, bExtendedInfo ) ) bRet = true; - else if ( ImpDetectPCD( rStm, bExtendedInfo ) ) bRet = true; + if ( ImpDetectGIF( rStm, bExtendedInfo ) ) bRet = true; + else if ( ImpDetectJPEG( rStm, bExtendedInfo ) ) bRet = true; + else if ( ImpDetectBMP( rStm, bExtendedInfo ) ) bRet = true; + else if ( ImpDetectPNG( rStm, bExtendedInfo ) ) bRet = true; + else if ( ImpDetectTIFF( rStm, bExtendedInfo ) ) bRet = true; + else if ( ImpDetectPCX( rStm, bExtendedInfo ) ) bRet = true; + else if ( ImpDetectDXF( rStm, bExtendedInfo ) ) bRet = true; + else if ( ImpDetectMET( rStm, bExtendedInfo ) ) bRet = true; + else if ( ImpDetectSGF( rStm, bExtendedInfo ) ) bRet = true; + else if ( ImpDetectSGV( rStm, bExtendedInfo ) ) bRet = true; + else if ( ImpDetectSVM( rStm, bExtendedInfo ) ) bRet = true; + else if ( ImpDetectWMF( rStm, bExtendedInfo ) ) bRet = true; + else if ( ImpDetectEMF( rStm, bExtendedInfo ) ) bRet = true; + else if ( ImpDetectSVG( rStm, bExtendedInfo ) ) bRet = true; + else if ( ImpDetectPICT( rStm, bExtendedInfo ) ) bRet = true; + else if ( ImpDetectXBM( rStm, bExtendedInfo ) ) bRet = true; + else if ( ImpDetectXPM( rStm, bExtendedInfo ) ) bRet = true; + else if ( ImpDetectPBM( rStm, bExtendedInfo ) ) bRet = true; + else if ( ImpDetectPGM( rStm, bExtendedInfo ) ) bRet = true; + else if ( ImpDetectPPM( rStm, bExtendedInfo ) ) bRet = true; + else if ( ImpDetectRAS( rStm, bExtendedInfo ) ) bRet = true; + else if ( ImpDetectTGA( rStm, bExtendedInfo ) ) bRet = true; + else if ( ImpDetectPSD( rStm, bExtendedInfo ) ) bRet = true; + else if ( ImpDetectEPS( rStm, bExtendedInfo ) ) bRet = true; + else if ( ImpDetectPCD( rStm, bExtendedInfo ) ) bRet = true; rStm.SetEndian( nOldFormat ); } @@ -216,7 +216,7 @@ bool GraphicDescriptor::ImpDetectGIF( SvStream& rStm, bool bExtendedInfo ) } // returns the next jpeg marker, a return value of 0 represents an error -sal_uInt8 ImpDetectJPG_GetNextMarker( SvStream& rStm ) +sal_uInt8 ImpDetectJPEG_GetNextMarker( SvStream& rStm ) { sal_uInt8 nByte; do @@ -241,7 +241,7 @@ sal_uInt8 ImpDetectJPG_GetNextMarker( SvStream& rStm ) return nByte; } -bool GraphicDescriptor::ImpDetectJPG( SvStream& rStm, bool bExtendedInfo ) +bool GraphicDescriptor::ImpDetectJPEG( SvStream& rStm, bool bExtendedInfo ) { sal_uInt32 nTemp32 = 0; bool bRet = false; @@ -254,7 +254,7 @@ bool GraphicDescriptor::ImpDetectJPG( SvStream& rStm, bool bExtendedInfo ) // compare upper 24 bits if( 0xffd8ff00 == ( nTemp32 & 0xffffff00 ) ) { - nFormat = GraphicFileFormat::JPG; + nFormat = GraphicFileFormat::JPEG; bRet = true; if ( bExtendedInfo ) @@ -268,7 +268,7 @@ bool GraphicDescriptor::ImpDetectJPG( SvStream& rStm, bool bExtendedInfo ) while( !bScanFailure && !bScanFinished && !rStm.IsEof() && !rStm.GetError() ) { - sal_uInt8 nMarker = ImpDetectJPG_GetNextMarker( rStm ); + sal_uInt8 nMarker = ImpDetectJPEG_GetNextMarker( rStm ); switch( nMarker ) { // fixed size marker, not having a two byte length parameter @@ -605,7 +605,7 @@ bool GraphicDescriptor::ImpDetectPNG( SvStream& rStm, bool bExtendedInfo ) return bRet; } -bool GraphicDescriptor::ImpDetectTIF( SvStream& rStm, bool bExtendedInfo ) +bool GraphicDescriptor::ImpDetectTIFF( SvStream& rStm, bool bExtendedInfo ) { bool bRet = false; sal_uInt8 cByte1 = 0; @@ -636,7 +636,7 @@ bool GraphicDescriptor::ImpDetectTIF( SvStream& rStm, bool bExtendedInfo ) rStm.ReadUInt16( nTemp16 ); if ( nTemp16 == 0x2a ) { - nFormat = GraphicFileFormat::TIF; + nFormat = GraphicFileFormat::TIFF; bRet = true; if ( bExtendedInfo ) @@ -941,19 +941,19 @@ bool GraphicDescriptor::ImpDetectMET( SvStream&, bool ) return bRet; } -bool GraphicDescriptor::ImpDetectPCT( SvStream& rStm, bool ) +bool GraphicDescriptor::ImpDetectPICT( SvStream& rStm, bool ) { - bool bRet = aPathExt.startsWith( "pct" ); - if (bRet) - nFormat = GraphicFileFormat::PCT; + bool bRet = aPathExt.startsWith( "pic" ) || aPathExt.startsWith( "pct" ); + if ( bRet ) + nFormat = GraphicFileFormat::PICT; else { sal_uInt64 const nStreamPos = rStm.Tell(); sal_uInt64 const nStreamLen = rStm.remainingSize(); - if (isPCT(rStm, nStreamPos, nStreamLen)) + if ( isPICT( rStm, nStreamPos, nStreamLen ) ) { bRet = true; - nFormat = GraphicFileFormat::PCT; + nFormat = GraphicFileFormat::PICT; } rStm.Seek(nStreamPos); } @@ -1105,31 +1105,31 @@ OUString GraphicDescriptor::GetImportFormatShortName( GraphicFileFormat nFormat switch( nFormat ) { - case( GraphicFileFormat::BMP ) : pKeyName = "bmp"; break; - case( GraphicFileFormat::GIF ) : pKeyName = "gif"; break; - case( GraphicFileFormat::JPG ) : pKeyName = "jpg"; break; - case( GraphicFileFormat::PCD ) : pKeyName = "pcd"; break; - case( GraphicFileFormat::PCX ) : pKeyName = "pcx"; break; - case( GraphicFileFormat::PNG ) : pKeyName = "png"; break; - case( GraphicFileFormat::XBM ) : pKeyName = "xbm"; break; - case( GraphicFileFormat::XPM ) : pKeyName = "xpm"; break; - case( GraphicFileFormat::PBM ) : pKeyName = "pbm"; break; - case( GraphicFileFormat::PGM ) : pKeyName = "pgm"; break; - case( GraphicFileFormat::PPM ) : pKeyName = "ppm"; break; - case( GraphicFileFormat::RAS ) : pKeyName = "ras"; break; - case( GraphicFileFormat::TGA ) : pKeyName = "tga"; break; - case( GraphicFileFormat::PSD ) : pKeyName = "psd"; break; - case( GraphicFileFormat::EPS ) : pKeyName = "eps"; break; - case( GraphicFileFormat::TIF ) : pKeyName = "tif"; break; - case( GraphicFileFormat::DXF ) : pKeyName = "dxf"; break; - case( GraphicFileFormat::MET ) : pKeyName = "met"; break; - case( GraphicFileFormat::PCT ) : pKeyName = "pct"; break; - case( GraphicFileFormat::SGF ) : pKeyName = "sgf"; break; - case( GraphicFileFormat::SGV ) : pKeyName = "sgv"; break; - case( GraphicFileFormat::SVM ) : pKeyName = "svm"; break; - case( GraphicFileFormat::WMF ) : pKeyName = "wmf"; break; - case( GraphicFileFormat::EMF ) : pKeyName = "emf"; break; - case( GraphicFileFormat::SVG ) : pKeyName = "svg"; break; + case( GraphicFileFormat::BMP ) : pKeyName = "bmp"; break; + case( GraphicFileFormat::GIF ) : pKeyName = "gif"; break; + case( GraphicFileFormat::JPEG ) : pKeyName = "jpg"; break; + case( GraphicFileFormat::PCD ) : pKeyName = "pcd"; break; + case( GraphicFileFormat::PCX ) : pKeyName = "pcx"; break; + case( GraphicFileFormat::PNG ) : pKeyName = "png"; break; + case( GraphicFileFormat::XBM ) : pKeyName = "xbm"; break; + case( GraphicFileFormat::XPM ) : pKeyName = "xpm"; break; + case( GraphicFileFormat::PBM ) : pKeyName = "pbm"; break; + case( GraphicFileFormat::PGM ) : pKeyName = "pgm"; break; + case( GraphicFileFormat::PPM ) : pKeyName = "ppm"; break; + case( GraphicFileFormat::RAS ) : pKeyName = "ras"; break; + case( GraphicFileFormat::TGA ) : pKeyName = "tga"; break; + case( GraphicFileFormat::PSD ) : pKeyName = "psd"; break; + case( GraphicFileFormat::EPS ) : pKeyName = "eps"; break; + case( GraphicFileFormat::TIFF ) : pKeyName = "tiff"; break; + case( GraphicFileFormat::DXF ) : pKeyName = "dxf"; break; + case( GraphicFileFormat::MET ) : pKeyName = "met"; break; + case( GraphicFileFormat::PICT ) : pKeyName = "pict"; break; + case( GraphicFileFormat::SGF ) : pKeyName = "sgf"; break; + case( GraphicFileFormat::SGV ) : pKeyName = "sgv"; break; + case( GraphicFileFormat::SVM ) : pKeyName = "svm"; break; + case( GraphicFileFormat::WMF ) : pKeyName = "wmf"; break; + case( GraphicFileFormat::EMF ) : pKeyName = "emf"; break; + case( GraphicFileFormat::SVG ) : pKeyName = "svg"; break; default: assert(false); } diff --git a/vcl/source/filter/graphicfilter_internal.hxx b/vcl/source/filter/graphicfilter_internal.hxx index 8f3931ec2994..4e9b717e3bc0 100644 --- a/vcl/source/filter/graphicfilter_internal.hxx +++ b/vcl/source/filter/graphicfilter_internal.hxx @@ -24,7 +24,7 @@ sal_uInt8* ImplSearchEntry( sal_uInt8*, sal_uInt8 const *, sal_uLong, sal_uLong ); -extern bool isPCT(SvStream& rStream, sal_uLong nStreamPos, sal_uLong nStreamLen); +extern bool isPICT( SvStream& rStream, sal_uLong nStreamPos, sal_uLong nStreamLen ); #endif // INCLUDED_VCL_SOURCE_FILTER_GRAPHICFILTER_INTERNAL_HXX diff --git a/vcl/source/gdi/gfxlink.cxx b/vcl/source/gdi/gfxlink.cxx index 4fdd0e1398e9..ba48ab7e883c 100644 --- a/vcl/source/gdi/gfxlink.cxx +++ b/vcl/source/gdi/gfxlink.cxx @@ -40,7 +40,7 @@ GfxLink::GfxLink( std::unique_ptr pBuf, sal_uInt32 nSize, GfxLinkTy SAL_WARN_IF( pBuf == nullptr || !nSize, "vcl", "GfxLink::GfxLink(): empty/NULL buffer given" ); - meType = nType; + myType = nType; mnSwapInDataSize = nSize; mpSwapInData = std::shared_ptr(pBuf.release(), pBuf.get_deleter()); // std::move(pBuf) does not compile on Jenkins MacOSX (24 May 2016) } @@ -49,7 +49,7 @@ bool GfxLink::IsEqual( const GfxLink& rGfxLink ) const { bool bIsEqual = false; - if ( ( mnSwapInDataSize == rGfxLink.mnSwapInDataSize ) && ( meType == rGfxLink.meType ) ) + if ( ( mnSwapInDataSize == rGfxLink.mnSwapInDataSize ) && ( myType == rGfxLink.myType ) ) { const sal_uInt8* pSource = GetData(); const sal_uInt8* pDest = rGfxLink.GetData(); @@ -65,10 +65,9 @@ bool GfxLink::IsEqual( const GfxLink& rGfxLink ) const return bIsEqual; } - bool GfxLink::IsNative() const { - return( meType >= GFX_LINK_FIRST_NATIVE_ID && meType <= GFX_LINK_LAST_NATIVE_ID ); + return( myType >= GFX_LINK_FIRST_NATIVE_ID && myType <= GFX_LINK_LAST_NATIVE_ID ); } @@ -110,16 +109,16 @@ bool GfxLink::LoadNative( Graphic& rGraphic ) aMemStm.SetBuffer( const_cast(pData), mnSwapInDataSize, mnSwapInDataSize ); - switch( meType ) + switch( myType ) { case GfxLinkType::NativeGif: nCvtType = ConvertDataFormat::GIF; break; case GfxLinkType::NativeBmp: nCvtType = ConvertDataFormat::BMP; break; - case GfxLinkType::NativeJpg: nCvtType = ConvertDataFormat::JPG; break; + case GfxLinkType::NativeJpeg: nCvtType = ConvertDataFormat::JPEG; break; case GfxLinkType::NativePng: nCvtType = ConvertDataFormat::PNG; break; - case GfxLinkType::NativeTif: nCvtType = ConvertDataFormat::TIF; break; + case GfxLinkType::NativeTiff: nCvtType = ConvertDataFormat::TIFF; break; case GfxLinkType::NativeWmf: nCvtType = ConvertDataFormat::WMF; break; case GfxLinkType::NativeMet: nCvtType = ConvertDataFormat::MET; break; - case GfxLinkType::NativePct: nCvtType = ConvertDataFormat::PCT; break; + case GfxLinkType::NativePict: nCvtType = ConvertDataFormat::PICT; break; case GfxLinkType::NativeSvg: nCvtType = ConvertDataFormat::SVG; break; default: nCvtType = ConvertDataFormat::Unknown; break; @@ -211,16 +210,16 @@ SvStream& WriteGfxLink( SvStream& rOStream, const GfxLink& rGfxLink ) SvStream& ReadGfxLink( SvStream& rIStream, GfxLink& rGfxLink) { - Size aSize; - MapMode aMapMode; - sal_uInt32 nSize; - sal_uInt32 nUserId; - sal_uInt16 nType; - bool bMapAndSizeValid( false ); - std::unique_ptr pCompat(new VersionCompat( rIStream, StreamMode::READ )); - // Version 1 - rIStream.ReadUInt16( nType ).ReadUInt32( nSize ).ReadUInt32( nUserId ); + sal_uInt16 theType; + sal_uInt32 nSize; + sal_uInt32 nUserId; + rIStream.ReadUInt16( theType ).ReadUInt32( nSize ).ReadUInt32( nUserId ); + + Size aSize; + MapMode aMapMode; + bool bMapAndSizeValid( false ); + std::unique_ptr pCompat( new VersionCompat( rIStream, StreamMode::READ ) ); if( pCompat->GetVersion() >= 2 ) { @@ -234,7 +233,7 @@ SvStream& ReadGfxLink( SvStream& rIStream, GfxLink& rGfxLink) std::unique_ptr pBuf(new sal_uInt8[ nSize ]); rIStream.ReadBytes( pBuf.get(), nSize ); - rGfxLink = GfxLink( std::move(pBuf), nSize, (GfxLinkType) nType ); + rGfxLink = GfxLink( std::move(pBuf), nSize, (GfxLinkType) theType ); rGfxLink.SetUserId( nUserId ); if( bMapAndSizeValid ) diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx index 5689f27b0b96..e7565cc926fc 100644 --- a/vcl/source/gdi/impgraph.cxx +++ b/vcl/source/gdi/impgraph.cxx @@ -1005,9 +1005,12 @@ bool ImpGraphic::ImplReadEmbedded( SvStream& rIStm ) switch( sal::static_int_cast(meType) ) { case SYS_WINMETAFILE: - case SYS_WNTMETAFILE: nCvtType = ConvertDataFormat::WMF; break; - case SYS_OS2METAFILE: nCvtType = ConvertDataFormat::MET; break; - case SYS_MACMETAFILE: nCvtType = ConvertDataFormat::PCT; break; + case SYS_WNTMETAFILE: + nCvtType = ConvertDataFormat::WMF; break; + case SYS_OS2METAFILE: + nCvtType = ConvertDataFormat::MET; break; + case SYS_MACMETAFILE: + nCvtType = ConvertDataFormat::PICT; break; default: nCvtType = ConvertDataFormat::Unknown; diff --git a/vcl/source/gdi/pdfextoutdevdata.cxx b/vcl/source/gdi/pdfextoutdevdata.cxx index 386e6837c459..a7002c2d2b0a 100644 --- a/vcl/source/gdi/pdfextoutdevdata.cxx +++ b/vcl/source/gdi/pdfextoutdevdata.cxx @@ -440,7 +440,7 @@ bool PageSyncData::PlaySyncPageAct( PDFWriter& rWriter, sal_uInt32& rCurGDIMtfAc if ( rGraphic.IsLink() ) { GfxLinkType eType = rGraphic.GetLink().GetType(); - if ( eType == GfxLinkType::NativeJpg && mParaRects.size() >= 2 ) + if ( eType == GfxLinkType::NativeJpeg && mParaRects.size() >= 2 ) { mbGroupIgnoreGDIMtfActions = rOutDevData.HasAdequateCompression( @@ -483,7 +483,7 @@ bool PageSyncData::PlaySyncPageAct( PDFWriter& rWriter, sal_uInt32& rCurGDIMtfAc bool bClippingNeeded = ( aOutputRect != aVisibleOutputRect ) && !aVisibleOutputRect.IsEmpty(); GfxLink aGfxLink( aGraphic.GetLink() ); - if ( aGfxLink.GetType() == GfxLinkType::NativeJpg ) + if ( aGfxLink.GetType() == GfxLinkType::NativeJpeg ) { if ( bClippingNeeded ) { @@ -508,7 +508,7 @@ bool PageSyncData::PlaySyncPageAct( PDFWriter& rWriter, sal_uInt32& rCurGDIMtfAc if( pData && nBytes ) { aTmp.WriteBytes( pData, nBytes ); - rWriter.DrawJPGBitmap( aTmp, aGraphic.GetBitmap().GetBitCount() > 8, aGraphic.GetSizePixel(), aOutputRect, aMask ); + rWriter.DrawJPEG( aTmp, aGraphic.GetBitmap().GetBitCount() > 8, aGraphic.GetSizePixel(), aOutputRect, aMask ); } if ( bClippingNeeded ) @@ -862,7 +862,7 @@ bool PDFExtOutDevData::HasAdequateCompression( const Graphic &rGraphic, { bool bReduceResolution = false; - assert( rGraphic.IsLink() && (rGraphic.GetLink().GetType() == GfxLinkType::NativeJpg || rGraphic.GetLink().GetType() == GfxLinkType::NativePng)); + assert( rGraphic.IsLink() && ( rGraphic.GetLink().GetType() == GfxLinkType::NativeJpeg || rGraphic.GetLink().GetType() == GfxLinkType::NativePng ) ); // small items better off as PNG anyway if ( rGraphic.GetSizePixel().Width() < 32 && diff --git a/vcl/source/gdi/pdfwriter.cxx b/vcl/source/gdi/pdfwriter.cxx index cda66dd642db..04d5106c7bf9 100644 --- a/vcl/source/gdi/pdfwriter.cxx +++ b/vcl/source/gdi/pdfwriter.cxx @@ -334,9 +334,9 @@ void PDFWriter::SetTextAlign( ::TextAlign eAlign ) xImplementation->setTextAlign( eAlign ); } -void PDFWriter::DrawJPGBitmap( SvStream& rStreamData, bool bIsTrueColor, const Size& rSrcSizePixel, const Rectangle& rTargetArea, const Bitmap& rMask ) +void PDFWriter::DrawJPEG( SvStream& rStreamData, bool bIsTrueColor, const Size& rSrcSizePixel, const Rectangle& rTargetArea, const Bitmap& rMask ) { - xImplementation->drawJPGBitmap( rStreamData, bIsTrueColor, rSrcSizePixel, rTargetArea, rMask ); + xImplementation->drawJPEGBitmap( rStreamData, bIsTrueColor, rSrcSizePixel, rTargetArea, rMask ); } sal_Int32 PDFWriter::CreateLink( const Rectangle& rRect, sal_Int32 nPageNr ) diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index d1987dc3544e..2f7696b93abb 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -2317,11 +2317,11 @@ void PDFWriterImpl::endPage() it->m_aBitmap = BitmapEx(); } } - for( std::list::iterator jpeg = m_aJPGs.begin(); jpeg != m_aJPGs.end(); ++jpeg ) + for( std::list::iterator jpeg = m_aJPEGs.begin(); jpeg != m_aJPEGs.end(); ++jpeg ) { if( jpeg->m_pStream ) { - writeJPG( *jpeg ); + writeJPEG( *jpeg ); delete jpeg->m_pStream; jpeg->m_pStream = nullptr; jpeg->m_aMask = Bitmap(); @@ -10787,7 +10787,7 @@ bool PDFWriterImpl::writeGradientFunction( GradientEmit& rObject ) return true; } -void PDFWriterImpl::writeJPG( JPGEmit& rObject ) +void PDFWriterImpl::writeJPEG( JPGEmit& rObject ) { CHECK_RETURN2( rObject.m_pStream ); CHECK_RETURN2( updateObject( rObject.m_nObject ) ); @@ -10813,7 +10813,7 @@ void PDFWriterImpl::writeJPG( JPGEmit& rObject ) } #if OSL_DEBUG_LEVEL > 1 - emitComment( "PDFWriterImpl::writeJPG" ); + emitComment( "PDFWriterImpl::writeJPEG" ); #endif OStringBuffer aLine(200); @@ -11175,9 +11175,9 @@ bool PDFWriterImpl::writeBitmapObject( BitmapEmit& rObject, bool bMask ) return true; } -void PDFWriterImpl::drawJPGBitmap( SvStream& rDCTData, bool bIsTrueColor, const Size& rSizePixel, const Rectangle& rTargetArea, const Bitmap& rMask ) +void PDFWriterImpl::drawJPEGBitmap( SvStream& rDCTData, bool bIsTrueColor, const Size& rSizePixel, const Rectangle& rTargetArea, const Bitmap& rMask ) { - MARK( "drawJPGBitmap" ); + MARK( "drawJPEGBitmap" ); OStringBuffer aLine( 80 ); updateGraphicsState(); @@ -11194,7 +11194,7 @@ void PDFWriterImpl::drawJPGBitmap( SvStream& rDCTData, bool bIsTrueColor, const // need to convert to grayscale; // load stream to bitmap and draw the bitmap instead Graphic aGraphic; - GraphicConverter::Import( rDCTData, aGraphic, ConvertDataFormat::JPG ); + GraphicConverter::Import( rDCTData, aGraphic, ConvertDataFormat::JPEG ); Bitmap aBmp( aGraphic.GetBitmap() ); if( !!rMask && rMask.GetSizePixel() == aBmp.GetSizePixel() ) { @@ -11219,12 +11219,12 @@ void PDFWriterImpl::drawJPGBitmap( SvStream& rDCTData, bool bIsTrueColor, const aID.m_nMaskChecksum = rMask.GetChecksum(); std::list< JPGEmit >::const_iterator it; - for( it = m_aJPGs.begin(); it != m_aJPGs.end() && ! (aID == it->m_aID); ++it ) + for( it = m_aJPEGs.begin(); it != m_aJPEGs.end() && ! (aID == it->m_aID); ++it ) ; - if( it == m_aJPGs.end() ) + if( it == m_aJPEGs.end() ) { - m_aJPGs.push_front( JPGEmit() ); - JPGEmit& rEmit = m_aJPGs.front(); + m_aJPEGs.push_front( JPGEmit() ); + JPGEmit& rEmit = m_aJPEGs.front(); rEmit.m_nObject = createObject(); rEmit.m_aID = aID; rEmit.m_pStream = pStream; @@ -11232,7 +11232,7 @@ void PDFWriterImpl::drawJPGBitmap( SvStream& rDCTData, bool bIsTrueColor, const if( !! rMask && rMask.GetSizePixel() == rSizePixel ) rEmit.m_aMask = rMask; - it = m_aJPGs.begin(); + it = m_aJPEGs.begin(); } else delete pStream; diff --git a/vcl/source/gdi/pdfwriter_impl.hxx b/vcl/source/gdi/pdfwriter_impl.hxx index e6c28558f742..9a434f7774cc 100644 --- a/vcl/source/gdi/pdfwriter_impl.hxx +++ b/vcl/source/gdi/pdfwriter_impl.hxx @@ -592,7 +592,7 @@ private: * file stream as XObjects*/ std::list< BitmapEmit > m_aBitmaps; /* contains JPG streams until written to file */ - std::list m_aJPGs; + std::list m_aJPEGs; /*--->i56629 contains all named destinations ever set during the PDF creation, destination id is always the destination's position in this vector */ @@ -802,7 +802,7 @@ i12626 */ bool writeBitmapObject( BitmapEmit& rObject, bool bMask = false ); - void writeJPG( JPGEmit& rEmit ); + void writeJPEG( JPGEmit& rEmit ); /* tries to find the bitmap by its id and returns its emit data if exists, else creates a new emit data block */ @@ -1168,7 +1168,7 @@ public: void drawBitmap( const Point& rDestPoint, const Size& rDestSize, const Bitmap& rBitmap ); void drawBitmap( const Point& rDestPoint, const Size& rDestSize, const BitmapEx& rBitmap ); - void drawJPGBitmap( SvStream& rDCTData, bool bIsTrueColor, const Size& rSizePixel, const Rectangle& rTargetArea, const Bitmap& rMask ); + void drawJPEGBitmap( SvStream& rDCTData, bool bIsTrueColor, const Size& rSizePixel, const Rectangle& rTargetArea, const Bitmap& rMask ); void drawGradient( const Rectangle& rRect, const Gradient& rGradient ); void drawHatch( const tools::PolyPolygon& rPolyPoly, const Hatch& rHatch ); diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx index 8afd8b70cdc0..f6035d54b2ea 100644 --- a/vcl/source/gdi/pdfwriter_impl2.cxx +++ b/vcl/source/gdi/pdfwriter_impl2.cxx @@ -100,7 +100,7 @@ void PDFWriterImpl::implWriteBitmapEx( const Point& i_rPoint, const Size& i_rSiz if( i_Graphic.GetType() != GraphicType::NONE && i_Graphic.GetBitmapEx() == aBitmapEx ) { GfxLinkType eType = i_Graphic.GetLink().GetType(); - bIsJpeg = (eType == GfxLinkType::NativeJpg); + bIsJpeg = (eType == GfxLinkType::NativeJpeg); bIsPng = (eType == GfxLinkType::NativePng); } @@ -159,15 +159,15 @@ void PDFWriterImpl::implWriteBitmapEx( const Point& i_rPoint, const Size& i_rSiz if( nDepth > 1 ) aBitmapEx.Convert( eConv ); } - bool bUseJPGCompression = !i_rContext.m_bOnlyLosslessCompression; + bool bUseJPEGCompression = !i_rContext.m_bOnlyLosslessCompression; if ( bIsPng || ( aSizePixel.Width() < 32 ) || ( aSizePixel.Height() < 32 ) ) - bUseJPGCompression = false; + bUseJPEGCompression = false; SvMemoryStream aStrm; Bitmap aMask; - bool bTrueColorJPG = true; - if ( bUseJPGCompression ) + bool bTrueColorJPEG = true; + if ( bUseJPEGCompression ) { sal_uInt32 nZippedFileSize = 0; // sj: we will calculate the filesize of a zipped bitmap @@ -216,7 +216,7 @@ void PDFWriterImpl::implWriteBitmapEx( const Point& i_rPoint, const Size& i_rSiz xOut->flush(); if ( !bIsJpeg && xSeekable->getLength() > nZippedFileSize ) { - bUseJPGCompression = false; + bUseJPEGCompression = false; } else { @@ -232,18 +232,18 @@ void PDFWriterImpl::implWriteBitmapEx( const Point& i_rPoint, const Size& i_rSiz sal_Int16 nBitsPerPixel = 24; if ( xPropSet->getPropertyValue("BitsPerPixel") >>= nBitsPerPixel ) { - bTrueColorJPG = nBitsPerPixel != 8; + bTrueColorJPEG = nBitsPerPixel != 8; } } } } catch( uno::Exception& ) { - bUseJPGCompression = false; + bUseJPEGCompression = false; } } - if ( bUseJPGCompression ) - m_rOuterFace.DrawJPGBitmap( aStrm, bTrueColorJPG, aSizePixel, Rectangle( aPoint, aSize ), aMask ); + if ( bUseJPEGCompression ) + m_rOuterFace.DrawJPEG( aStrm, bTrueColorJPEG, aSizePixel, Rectangle( aPoint, aSize ), aMask ); else if ( aBitmapEx.IsTransparent() ) m_rOuterFace.DrawBitmapEx( aPoint, aSize, aBitmapEx ); else -- cgit