[Libreoffice-commits] .: 2 commits - patches/dev300
Cédric Bosdonnat
cbosdo at kemper.freedesktop.org
Wed May 4 08:59:29 PDT 2011
patches/dev300/apply | 5
patches/dev300/external-apm-header.diff | 257 --------------------------------
patches/dev300/wmf-mm-text-1.diff | 43 -----
patches/dev300/wmf-mm-text.diff | 95 -----------
4 files changed, 400 deletions(-)
New commits:
commit 44ff982a28d811736a0005216a512d8e38902118
Author: Cédric Bosdonnat <cedric.bosdonnat.ooo at free.fr>
Date: Wed May 4 17:39:51 2011 +0200
wmf-mm-text*.diff, moved to git repos
diff --git a/patches/dev300/apply b/patches/dev300/apply
index 9317ad1..e6e3d0a 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -1400,10 +1400,6 @@ base64.diff, i#100620, hmth
# hack to ignore writerfilter when odf-converter is present
odf-converter-ignore-writerfilter.diff, n#348471, n#502173, jholesov
-[ Fixes ]
-wmf-mm-text.diff, n#417818, rodo
-wmf-mm-text-1.diff, n#417818, rodo
-
[ UbuntuHardyOnly ]
# Add patch to only show local files needed when gnome-vfs/gio is disabled
# FIXME: update for LO
diff --git a/patches/dev300/wmf-mm-text-1.diff b/patches/dev300/wmf-mm-text-1.diff
deleted file mode 100644
index 9d8f1d7..0000000
--- a/patches/dev300/wmf-mm-text-1.diff
+++ /dev/null
@@ -1,43 +0,0 @@
----
- svtools/source/filter.vcl/wmf/winmtf.cxx | 14 ++++++++++++--
- 1 files changed, 12 insertions(+), 2 deletions(-)
-
-diff --git svtools/source/filter.vcl/wmf/winmtf.cxx svtools/source/filter.vcl/wmf/winmtf.cxx
-index a7910d6..bfc23b4 100644
---- svtools/source/filter.vcl/wmf/winmtf.cxx
-+++ svtools/source/filter.vcl/wmf/winmtf.cxx
-@@ -423,10 +423,15 @@ Point WinMtfOutput::ImplMap( const Point& rPt )
- case MM_TEXT:
- fX2 -= mnWinOrgX;
- fY2 -= mnWinOrgY;
-- fX2 *= 2540.0/mnUnitsPerInch;
-- fY2 *= 2540.0/mnUnitsPerInch;
-+ if( mnDevWidth != 1 || mnDevHeight != 1 ) {
-+ fX2 *= 2540.0/mnUnitsPerInch;
-+ fY2 *= 2540.0/mnUnitsPerInch;
-+ }
- fX2 += mnDevOrgX;
- fY2 += mnDevOrgY;
-+ fX2 *= (double)mnMillX * 100.0 / (double)mnPixX;
-+ fY2 *= (double)mnMillY * 100.0 / (double)mnPixY;
-+
- break;
- case MM_LOENGLISH :
- {
-@@ -504,8 +509,13 @@ Size WinMtfOutput::ImplMap( const Size& rSz )
- switch( mnMapMode )
- {
- case MM_TEXT:
-+ if( mnDevWidth != 1 && mnDevHeight != 1 ) {
- fWidth *= 2540.0/mnUnitsPerInch;
- fHeight*= 2540.0/mnUnitsPerInch;
-+ } else {
-+ fWidth *= (double)mnMillX * 100 / (double)mnPixX;
-+ fHeight *= (double)mnMillY * 100 / (double)mnPixY;
-+ }
- break;
- case MM_LOENGLISH :
- {
---
-1.7.0.1
-
diff --git a/patches/dev300/wmf-mm-text.diff b/patches/dev300/wmf-mm-text.diff
deleted file mode 100644
index 6f997b3..0000000
--- a/patches/dev300/wmf-mm-text.diff
+++ /dev/null
@@ -1,95 +0,0 @@
----
- svtools/source/filter.vcl/wmf/winmtf.cxx | 21 +++++++++++++++++++++
- svtools/source/filter.vcl/wmf/winmtf.hxx | 3 +++
- svtools/source/filter.vcl/wmf/winwmf.cxx | 1 +
- 3 files changed, 25 insertions(+), 0 deletions(-)
-
-diff --git svtools/source/filter.vcl/wmf/winmtf.cxx svtools/source/filter.vcl/wmf/winmtf.cxx
-index 9360277..a7910d6 100644
---- svtools/source/filter.vcl/wmf/winmtf.cxx
-+++ svtools/source/filter.vcl/wmf/winmtf.cxx
-@@ -420,6 +420,14 @@ Point WinMtfOutput::ImplMap( const Point& rPt )
- {
- switch( mnMapMode )
- {
-+ case MM_TEXT:
-+ fX2 -= mnWinOrgX;
-+ fY2 -= mnWinOrgY;
-+ fX2 *= 2540.0/mnUnitsPerInch;
-+ fY2 *= 2540.0/mnUnitsPerInch;
-+ fX2 += mnDevOrgX;
-+ fY2 += mnDevOrgY;
-+ break;
- case MM_LOENGLISH :
- {
- fX2 -= mnWinOrgX;
-@@ -495,6 +503,10 @@ Size WinMtfOutput::ImplMap( const Size& rSz )
- {
- switch( mnMapMode )
- {
-+ case MM_TEXT:
-+ fWidth *= 2540.0/mnUnitsPerInch;
-+ fHeight*= 2540.0/mnUnitsPerInch;
-+ break;
- case MM_LOENGLISH :
- {
- fWidth *= 25.40;
-@@ -931,6 +943,7 @@ WinMtfOutput::WinMtfOutput( GDIMetaFile& rGDIMetaFile ) :
- mbComplexClip ( false ),
- mnGfxMode ( GM_COMPATIBLE ),
- mnMapMode ( MM_TEXT ),
-+ mnUnitsPerInch ( 96 ),
- mnDevOrgX ( 0 ),
- mnDevOrgY ( 0 ),
- mnDevWidth ( 1 ),
-@@ -2057,6 +2070,14 @@ void WinMtfOutput::SetMapMode( sal_uInt32 nMapMode )
-
- //-----------------------------------------------------------------------------------
-
-+void WinMtfOutput::SetUnitsPerInch( UINT16 nUnitsPerInch )
-+{
-+ if( nUnitsPerInch != 0 )
-+ mnUnitsPerInch = nUnitsPerInch;
-+}
-+
-+//-----------------------------------------------------------------------------------
-+
- void WinMtfOutput::SetWorldTransform( const XForm& rXForm )
- {
- maXForm.eM11 = rXForm.eM11;
-diff --git svtools/source/filter.vcl/wmf/winmtf.hxx svtools/source/filter.vcl/wmf/winmtf.hxx
-index 51ec483..541fbef 100644
---- svtools/source/filter.vcl/wmf/winmtf.hxx
-+++ svtools/source/filter.vcl/wmf/winmtf.hxx
-@@ -588,6 +588,8 @@ class WinMtfOutput
-
- sal_uInt32 mnGfxMode;
- sal_uInt32 mnMapMode;
-+ UINT16 mnUnitsPerInch;
-+
- XForm maXForm;
- sal_Int32 mnDevOrgX, mnDevOrgY;
- sal_Int32 mnDevWidth, mnDevHeight;
-@@ -634,6 +636,7 @@ class WinMtfOutput
-
- sal_uInt32 GetMapMode() const { return mnMapMode; };
- void SetMapMode( sal_uInt32 mnMapMode );
-+ void SetUnitsPerInch( UINT16 nUnitsPerInch );
- void SetWorldTransform( const XForm& rXForm );
- void ModifyWorldTransform( const XForm& rXForm, UINT32 nMode );
-
-diff --git svtools/source/filter.vcl/wmf/winwmf.cxx svtools/source/filter.vcl/wmf/winwmf.cxx
-index 1a70555..9f86995 100644
---- svtools/source/filter.vcl/wmf/winwmf.cxx
-+++ svtools/source/filter.vcl/wmf/winwmf.cxx
-@@ -1043,6 +1043,7 @@ BOOL WMFReader::ReadHeader(WMF_APMFILEHEADER *pAPMHeader)
- }
- }
-
-+ pOut->SetUnitsPerInch( nUnitsPerInch );
- pOut->SetWinOrg( aPlaceableBound.TopLeft() );
- aWMFSize = Size( labs( aPlaceableBound.GetWidth() ), labs( aPlaceableBound.GetHeight() ) );
- pOut->SetWinExt( aWMFSize );
---
-1.7.0.1
-
commit 27c7b0dbc72269fd4bb440fe3cce36926c2bd0b1
Author: Cédric Bosdonnat <cedric.bosdonnat.ooo at free.fr>
Date: Wed May 4 17:39:09 2011 +0200
external-apm-header.diff, moved to git repos
diff --git a/patches/dev300/apply b/patches/dev300/apply
index dc1817b..9317ad1 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -1401,7 +1401,6 @@ base64.diff, i#100620, hmth
odf-converter-ignore-writerfilter.diff, n#348471, n#502173, jholesov
[ Fixes ]
-external-apm-header.diff, freuter
wmf-mm-text.diff, n#417818, rodo
wmf-mm-text-1.diff, n#417818, rodo
diff --git a/patches/dev300/external-apm-header.diff b/patches/dev300/external-apm-header.diff
deleted file mode 100644
index 740a332..0000000
--- a/patches/dev300/external-apm-header.diff
+++ /dev/null
@@ -1,257 +0,0 @@
----
- editeng/source/rtf/rtfgrf.cxx | 11 +++++++++--
- svtools/inc/svtools/filter.hxx | 7 +++++--
- svtools/inc/svtools/wmf.hxx | 25 ++++++++++++++++++++++++-
- svtools/source/filter.vcl/filter/filter.cxx | 10 +++++-----
- svtools/source/filter.vcl/wmf/winmtf.hxx | 5 +++--
- svtools/source/filter.vcl/wmf/winwmf.cxx | 22 +++++++++++++++-------
- svtools/source/filter.vcl/wmf/wmf.cxx | 4 ++--
- 7 files changed, 63 insertions(+), 21 deletions(-)
-
-diff --git editeng/source/rtf/rtfgrf.cxx editeng/source/rtf/rtfgrf.cxx
-index d4c50fe..808d70d 100644
---- editeng/source/rtf/rtfgrf.cxx
-+++ editeng/source/rtf/rtfgrf.cxx
-@@ -36,6 +36,7 @@
- #include <svtools/rtfkeywd.hxx>
- #include <svtools/rtftoken.h>
- #include <svtools/filter.hxx>
-+#include <svtools/wmf.hxx>
-
- #include <editeng/svxrtf.hxx>
-
-@@ -504,9 +505,15 @@ BOOL SvxRTFParser::ReadBmpData( Graphic& rGrf, SvxRTFPictureType& rPicType )
- }
-
- String sTmpStr;
-+ WMF_APMFILEHEADER aAPMHeader;
-+ aAPMHeader.left=0;
-+ aAPMHeader.top=0;
-+ aAPMHeader.right=rPicType.nWidth;
-+ aAPMHeader.bottom=rPicType.nHeight;
-+
-+ WMF_APMFILEHEADER *pAPMHeader=(aAPMHeader.right>0 && aAPMHeader.bottom>0?&aAPMHeader:NULL);
- pTmpFile->Seek( STREAM_SEEK_TO_BEGIN );
-- bValidBmp = 0 == pGF->ImportGraphic( rGrf, sTmpStr, *pTmpFile,
-- nImportFilter );
-+ bValidBmp = 0 == pGF->ImportGraphic( rGrf, sTmpStr, *pTmpFile, nImportFilter, NULL, 0, pAPMHeader );
- }
- delete pTmpFile;
- }
-diff --git svtools/inc/svtools/filter.hxx svtools/inc/svtools/filter.hxx
-index 43bd280..c113d53 100644
---- svtools/inc/svtools/filter.hxx
-+++ svtools/inc/svtools/filter.hxx
-@@ -38,6 +38,7 @@
- #include <com/sun/star/uno/Sequence.h>
- #include <com/sun/star/beans/PropertyValue.hpp>
-
-+struct WMF_APMFILEHEADER;
- // -----------------------
- // - GraphicFilter-Types -
- // -----------------------
-@@ -393,13 +394,15 @@ public:
- USHORT ImportGraphic( Graphic& rGraphic, const String& rPath,
- SvStream& rStream,
- USHORT nFormat = GRFILTER_FORMAT_DONTKNOW,
-- USHORT * pDeterminedFormat = NULL, sal_uInt32 nImportFlags = 0 );
-+ USHORT * pDeterminedFormat = NULL, sal_uInt32 nImportFlags = 0
-+ , WMF_APMFILEHEADER *pAPMHeader = NULL);
-
- USHORT ImportGraphic( Graphic& rGraphic, const String& rPath,
- SvStream& rStream,
- USHORT nFormat,
- USHORT * pDeterminedFormat, sal_uInt32 nImportFlags,
-- com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >* pFilterData );
-+ com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >* pFilterData
-+ , WMF_APMFILEHEADER *pAPMHeader = NULL);
-
- BOOL Setup( USHORT nFormat );
-
-diff --git svtools/inc/svtools/wmf.hxx svtools/inc/svtools/wmf.hxx
-index 9d536d5..45a0f1f 100644
---- svtools/inc/svtools/wmf.hxx
-+++ svtools/inc/svtools/wmf.hxx
-@@ -31,7 +31,30 @@
- #include "svtools/svtdllapi.h"
- #include <svtools/fltcall.hxx>
-
--BOOL ConvertWMFToGDIMetaFile( SvStream & rStreamWMF, GDIMetaFile & rGDIMetaFile, FilterConfigItem* pConfigItem = NULL );
-+struct WMF_APMFILEHEADER {
-+ sal_uInt32 key;
-+ sal_uInt16 hmf;
-+ sal_uInt16 left;
-+ sal_uInt16 top;
-+ sal_uInt16 right;
-+ sal_uInt16 bottom;
-+ sal_uInt16 inch;
-+ sal_uInt32 reserved;
-+ sal_uInt16 checksum;
-+
-+ WMF_APMFILEHEADER() : key(0x9ac6cdd7L),
-+ hmf(0),
-+ left(0),
-+ top(0),
-+ right(0),
-+ bottom(0),
-+ inch(96),
-+ reserved(0),
-+ checksum(0) {
-+ }
-+};
-+
-+BOOL ConvertWMFToGDIMetaFile( SvStream & rStreamWMF, GDIMetaFile & rGDIMetaFile, FilterConfigItem* pConfigItem = NULL, WMF_APMFILEHEADER *pAPMHeader = NULL );
-
- SVT_DLLPUBLIC BOOL ReadWindowMetafile( SvStream& rStream, GDIMetaFile& rMTF, FilterConfigItem* pConfigItem );
-
-diff --git svtools/source/filter.vcl/filter/filter.cxx svtools/source/filter.vcl/filter/filter.cxx
-index 7caea58..a919ab9 100644
---- svtools/source/filter.vcl/filter/filter.cxx
-+++ svtools/source/filter.vcl/filter/filter.cxx
-@@ -1279,17 +1279,17 @@ USHORT GraphicFilter::ImportGraphic( Graphic& rGraphic, const INetURLObject& rPa
- return nRetValue;
- }
-
--USHORT GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, SvStream& rIStream,
-- USHORT nFormat, USHORT* pDeterminedFormat, sal_uInt32 nImportFlags )
-+USHORT GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, SvStream& rIStream, USHORT nFormat, USHORT* pDeterminedFormat, sal_uInt32 nImportFlags, WMF_APMFILEHEADER *pAPMHeader )
- {
-- return ImportGraphic( rGraphic, rPath, rIStream, nFormat, pDeterminedFormat, nImportFlags, NULL );
-+ return ImportGraphic( rGraphic, rPath, rIStream, nFormat, pDeterminedFormat, nImportFlags, NULL, pAPMHeader );
- }
-
- //-------------------------------------------------------------------------
-
- USHORT GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, SvStream& rIStream,
- USHORT nFormat, USHORT* pDeterminedFormat, sal_uInt32 nImportFlags,
-- com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >* pFilterData )
-+ com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >* pFilterData
-+ , WMF_APMFILEHEADER *pAPMHeader)
- {
- String aFilterName;
- ULONG nStmBegin;
-@@ -1486,7 +1486,7 @@ USHORT GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, SvS
- aFilterName.EqualsIgnoreCaseAscii( IMP_EMF ) )
- {
- GDIMetaFile aMtf;
-- if( !ConvertWMFToGDIMetaFile( rIStream, aMtf, NULL ) )
-+ if( !ConvertWMFToGDIMetaFile( rIStream, aMtf, NULL, pAPMHeader ) )
- nStatus = GRFILTER_FORMATERROR;
- else
- {
-diff --git svtools/source/filter.vcl/wmf/winmtf.hxx svtools/source/filter.vcl/wmf/winmtf.hxx
-index 019f968..51ec483 100644
---- svtools/source/filter.vcl/wmf/winmtf.hxx
-+++ svtools/source/filter.vcl/wmf/winmtf.hxx
-@@ -159,6 +159,7 @@ struct LOGFONTW
- BYTE lfPitchAndFamily;
- String alfFaceName;
- };
-+struct WMF_APMFILEHEADER;
-
- #define TA_NOUPDATECP 0x0000
- #define TA_UPDATECP 0x0001
-@@ -773,7 +774,7 @@ private:
- sal_uInt32 nUnicodeEscapeAction;
-
- // Liesst den Kopf der WMF-Datei
-- BOOL ReadHeader();
-+ BOOL ReadHeader(WMF_APMFILEHEADER *pAPMHeader);
-
- // Liesst die Parameter des Rocords mit der Funktionsnummer nFunction.
- void ReadRecordParams( USHORT nFunction );
-@@ -792,7 +793,7 @@ public:
- ~WMFReader();
-
- // Liesst aus dem Stream eine WMF-Datei und fuellt das GDIMetaFile
-- void ReadWMF();
-+ void ReadWMF(WMF_APMFILEHEADER *pAPMHeader=NULL);
- };
-
- #endif
-diff --git svtools/source/filter.vcl/wmf/winwmf.cxx svtools/source/filter.vcl/wmf/winwmf.cxx
-index be7a15e..1a70555 100644
---- svtools/source/filter.vcl/wmf/winwmf.cxx
-+++ svtools/source/filter.vcl/wmf/winwmf.cxx
-@@ -30,6 +30,7 @@
-
- #include "winmtf.hxx"
- #include <vcl/gdimtf.hxx>
-+#include <svtools/wmf.hxx>
- #include <rtl/crc.h>
- #include <rtl/tencinfo.h>
- #include <osl/endian.h>
-@@ -996,7 +997,7 @@ void WMFReader::ReadRecordParams( USHORT nFunc )
-
- // ------------------------------------------------------------------------
-
--BOOL WMFReader::ReadHeader()
-+BOOL WMFReader::ReadHeader(WMF_APMFILEHEADER *pAPMHeader)
- {
- Rectangle aPlaceableBound;
- sal_uInt32 nl, nStrmPos = pWMF->Tell();
-@@ -1029,10 +1030,17 @@ BOOL WMFReader::ReadHeader()
- }
- else
- {
-- nUnitsPerInch = 96;
-- pWMF->Seek( nStrmPos + 18 ); // set the streampos to the start of the the metaactions
-- GetPlaceableBound( aPlaceableBound, pWMF );
-- pWMF->Seek( nStrmPos );
-+ nUnitsPerInch = (pAPMHeader!=NULL?pAPMHeader->inch:96);
-+ pWMF->Seek( nStrmPos + 18 ); // set the streampos to the start of the the metaactions
-+ GetPlaceableBound( aPlaceableBound, pWMF );
-+ pWMF->Seek( nStrmPos );
-+ if (pAPMHeader!=NULL) {
-+ // #n417818#: If we have an external header then overwrite the bounds!
-+ aPlaceableBound=Rectangle(pAPMHeader->left*567*nUnitsPerInch/1440/1000,
-+ pAPMHeader->top*567*nUnitsPerInch/1440/1000,
-+ pAPMHeader->right*567*nUnitsPerInch/1440/1000,
-+ pAPMHeader->bottom*567*nUnitsPerInch/1440/1000);
-+ }
- }
-
- pOut->SetWinOrg( aPlaceableBound.TopLeft() );
-@@ -1067,7 +1075,7 @@ BOOL WMFReader::ReadHeader()
- return TRUE;
- }
-
--void WMFReader::ReadWMF()
-+void WMFReader::ReadWMF(WMF_APMFILEHEADER *pAPMHeader)
- {
- USHORT nFunction;
- ULONG nPos, nPercent, nLastPercent;
-@@ -1090,7 +1098,7 @@ void WMFReader::ReadWMF()
- pWMF->Seek( nStartPos );
- Callback( (USHORT) ( nLastPercent = 0 ) );
-
-- if ( ReadHeader() )
-+ if ( ReadHeader( pAPMHeader ) )
- {
-
- nPos = pWMF->Tell();
-diff --git svtools/source/filter.vcl/wmf/wmf.cxx svtools/source/filter.vcl/wmf/wmf.cxx
-index ab9bee2..3658a1e 100644
---- svtools/source/filter.vcl/wmf/wmf.cxx
-+++ svtools/source/filter.vcl/wmf/wmf.cxx
-@@ -35,7 +35,7 @@
-
- // -----------------------------------------------------------------------------
-
--BOOL ConvertWMFToGDIMetaFile( SvStream & rStreamWMF, GDIMetaFile & rGDIMetaFile, FilterConfigItem* pConfigItem )
-+BOOL ConvertWMFToGDIMetaFile( SvStream & rStreamWMF, GDIMetaFile & rGDIMetaFile, FilterConfigItem* pConfigItem, WMF_APMFILEHEADER *pAPMHeader )
- {
- UINT32 nMetaType;
- UINT32 nOrgPos = rStreamWMF.Tell();
-@@ -51,7 +51,7 @@ BOOL ConvertWMFToGDIMetaFile( SvStream & rStreamWMF, GDIMetaFile & rGDIMetaFile,
- }
- else
- {
-- WMFReader( rStreamWMF, rGDIMetaFile, pConfigItem ).ReadWMF();
-+ WMFReader( rStreamWMF, rGDIMetaFile, pConfigItem ).ReadWMF( pAPMHeader );
- }
- rStreamWMF.SetNumberFormatInt( nOrigNumberFormat );
- return !rStreamWMF.GetError();
---
-1.7.0.1
-
More information about the Libreoffice-commits
mailing list