You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by al...@apache.org on 2014/02/27 21:19:23 UTC
svn commit: r1572717 - in /openoffice/branches/AOO410/main: ./
filter/source/msfilter/ oox/source/export/ svtools/source/filter/
svtools/source/graphic/ svx/source/gallery2/ svx/source/xml/
svx/source/xoutdev/ sw/source/filter/ww8/ sw/source/ui/docvw/ ...
Author: alg
Date: Thu Feb 27 20:19:22 2014
New Revision: 1572717
URL: http://svn.apache.org/r1572717
Log:
i15508 Added support for BMP file type
Modified:
openoffice/branches/AOO410/main/ (props changed)
openoffice/branches/AOO410/main/filter/source/msfilter/escherex.cxx
openoffice/branches/AOO410/main/oox/source/export/drawingml.cxx
openoffice/branches/AOO410/main/svtools/source/filter/filter.cxx
openoffice/branches/AOO410/main/svtools/source/graphic/descriptor.cxx
openoffice/branches/AOO410/main/svx/source/gallery2/galtheme.cxx
openoffice/branches/AOO410/main/svx/source/xml/xmlgrhlp.cxx
openoffice/branches/AOO410/main/svx/source/xoutdev/_xoutbmp.cxx
openoffice/branches/AOO410/main/sw/source/filter/ww8/rtfattributeoutput.cxx
openoffice/branches/AOO410/main/sw/source/ui/docvw/romenu.cxx
openoffice/branches/AOO410/main/vcl/inc/vcl/gfxlink.hxx
openoffice/branches/AOO410/main/vcl/source/gdi/gfxlink.cxx
Propchange: openoffice/branches/AOO410/main/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Thu Feb 27 20:19:22 2014
@@ -0,0 +1,5 @@
+/openoffice/branches/AOO400/main:1503684
+/openoffice/branches/ia2/main:1417739-1541842
+/openoffice/branches/ooxml-osba/main:1546391,1546395,1546574,1546934,1547030,1547392,1551920,1551954,1551958,1552283
+/openoffice/branches/rejuvenate01/main:1480411,1534063,1534098,1536312,1549902,1560617
+/openoffice/trunk/main:1571617,1571677,1572569,1572577
Modified: openoffice/branches/AOO410/main/filter/source/msfilter/escherex.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/AOO410/main/filter/source/msfilter/escherex.cxx?rev=1572717&r1=1572716&r2=1572717&view=diff
==============================================================================
--- openoffice/branches/AOO410/main/filter/source/msfilter/escherex.cxx (original)
+++ openoffice/branches/AOO410/main/filter/source/msfilter/escherex.cxx Thu Feb 27 20:19:22 2014
@@ -4373,6 +4373,15 @@ sal_uInt32 EscherGraphicProvider::GetBli
{
case GFX_LINK_TYPE_NATIVE_JPG : p_EscherBlibEntry->meBlibType = PEG; break;
case GFX_LINK_TYPE_NATIVE_PNG : p_EscherBlibEntry->meBlibType = PNG; break;
+
+ // #15508# added BMP type for better exports; need to check this
+ // checked - does not work that way, so keep out for now. It may
+ // work somehow with direct DIB data, but that would need to be checked
+ // carefully
+ // for more comments please check RtfAttributeOutput::FlyFrameGraphic
+ //
+ // case GFX_LINK_TYPE_NATIVE_BMP : p_EscherBlibEntry->meBlibType = DIB; break;
+
case GFX_LINK_TYPE_NATIVE_WMF :
{
if ( pGraphicAry && ( p_EscherBlibEntry->mnSize > 0x2c ) )
@@ -4472,11 +4481,30 @@ sal_uInt32 EscherGraphicProvider::GetBli
else if ( eBlibType == PEG )
rPicOutStrm << (sal_uInt16)0x0505;
}
- if ( ( eBlibType == PEG ) || ( eBlibType == PNG ) )
+ if ( ( eBlibType == PEG ) || ( eBlibType == PNG ) ) // || ( eBlibType == DIB )) // #15508#
{
nExtra = 17;
p_EscherBlibEntry->mnSizeExtra = nExtra + 8;
- nInstance = ( eBlibType == PNG ) ? 0xf01e6e00 : 0xf01d46a0;
+
+ // #15508# type see SvxMSDffManager::GetBLIPDirect (checked, does not work this way)
+ // see RtfAttributeOutput::FlyFrameGraphic for more comments
+ // maybe it would work with direct DIB data, but that would need thorough testing
+ if( eBlibType == PNG )
+ {
+ nInstance = 0xf01e6e00;
+ }
+ else // if( eBlibType == PEG )
+ {
+ nInstance = 0xf01d46a0;
+ }
+ //else // eBlibType == DIB
+ //{
+ // nInstance = 0xf01d7A80;
+ //}
+
+ // #15508#
+ //nInstance = ( eBlibType == PNG ) ? 0xf01e6e00 : 0xf01d46a0;
+
rPicOutStrm << nInstance << (sal_uInt32)( p_EscherBlibEntry->mnSize + nExtra );
rPicOutStrm.Write( p_EscherBlibEntry->mnIdentifier, 16 );
rPicOutStrm << (sal_uInt8)0xff;
Modified: openoffice/branches/AOO410/main/oox/source/export/drawingml.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/AOO410/main/oox/source/export/drawingml.cxx?rev=1572717&r1=1572716&r2=1572717&view=diff
==============================================================================
--- openoffice/branches/AOO410/main/oox/source/export/drawingml.cxx (original)
+++ openoffice/branches/AOO410/main/oox/source/export/drawingml.cxx Thu Feb 27 20:19:22 2014
@@ -426,6 +426,14 @@ OUString DrawingML::WriteImage( const Gr
sMediaType = US( "image/gif" );
sExtension = ".gif";
break;
+
+ // #15508# added BMP type for better exports
+ // export not yet active, so adding for reference (not checked)
+ case GFX_LINK_TYPE_NATIVE_BMP:
+ sMediaType = US( "image/bmp" );
+ sExtension = ".bmp";
+ break;
+
case GFX_LINK_TYPE_NATIVE_JPG:
sMediaType = US( "image/jpeg" );
sExtension = ".jpeg";
Modified: openoffice/branches/AOO410/main/svtools/source/filter/filter.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/AOO410/main/svtools/source/filter/filter.cxx?rev=1572717&r1=1572716&r2=1572717&view=diff
==============================================================================
--- openoffice/branches/AOO410/main/svtools/source/filter/filter.cxx (original)
+++ openoffice/branches/AOO410/main/svtools/source/filter/filter.cxx Thu Feb 27 20:19:22 2014
@@ -1630,15 +1630,23 @@ sal_uInt16 GraphicFilter::ImportGraphic(
if( !ImportXPM( rIStream, rGraphic ) )
nStatus = GRFILTER_FILTERERROR;
}
- else if( aFilterName.EqualsIgnoreCaseAscii( IMP_BMP ) ||
- aFilterName.EqualsIgnoreCaseAscii( IMP_SVMETAFILE ) )
- {
- // SV interne Importfilter fuer Bitmaps und MetaFiles
- rIStream >> rGraphic;
- if( rIStream.GetError() )
- nStatus = GRFILTER_FORMATERROR;
- }
- else if( aFilterName.EqualsIgnoreCaseAscii( IMP_WMF ) ||
+ else if( aFilterName.EqualsIgnoreCaseAscii( IMP_BMP ) ||
+ aFilterName.EqualsIgnoreCaseAscii( IMP_SVMETAFILE ) )
+ {
+ // SV interne Importfilter fuer Bitmaps und MetaFiles
+ rIStream >> rGraphic;
+
+ if( rIStream.GetError() )
+ {
+ nStatus = GRFILTER_FORMATERROR;
+ }
+ else
+ {
+ // #15508# added BMP type (checked, works)
+ eLinkType = GFX_LINK_TYPE_NATIVE_BMP;
+ }
+ }
+ else if( aFilterName.EqualsIgnoreCaseAscii( IMP_WMF ) ||
aFilterName.EqualsIgnoreCaseAscii( IMP_EMF ) )
{
GDIMetaFile aMtf;
Modified: openoffice/branches/AOO410/main/svtools/source/graphic/descriptor.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/AOO410/main/svtools/source/graphic/descriptor.cxx?rev=1572717&r1=1572716&r2=1572717&view=diff
==============================================================================
--- openoffice/branches/AOO410/main/svtools/source/graphic/descriptor.cxx (original)
+++ openoffice/branches/AOO410/main/svtools/source/graphic/descriptor.cxx Thu Feb 27 20:19:22 2014
@@ -389,6 +389,10 @@ void GraphicDescriptor::_getPropertyValu
switch( const_cast< Graphic* >( mpGraphic )->GetLink().GetType() )
{
case( GFX_LINK_TYPE_NATIVE_GIF ): pMimeType = MIMETYPE_GIF; break;
+
+ // #15508# added BMP type for better exports (checked, works)
+ case( GFX_LINK_TYPE_NATIVE_BMP ): pMimeType = MIMETYPE_BMP; break;
+
case( GFX_LINK_TYPE_NATIVE_JPG ): pMimeType = MIMETYPE_JPG; break;
case( GFX_LINK_TYPE_NATIVE_PNG ): pMimeType = MIMETYPE_PNG; break;
case( GFX_LINK_TYPE_NATIVE_WMF ): pMimeType = MIMETYPE_WMF; break;
Modified: openoffice/branches/AOO410/main/svx/source/gallery2/galtheme.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/AOO410/main/svx/source/gallery2/galtheme.cxx?rev=1572717&r1=1572716&r2=1572717&view=diff
==============================================================================
--- openoffice/branches/AOO410/main/svx/source/gallery2/galtheme.cxx (original)
+++ openoffice/branches/AOO410/main/svx/source/gallery2/galtheme.cxx Thu Feb 27 20:19:22 2014
@@ -935,6 +935,11 @@ sal_Bool GalleryTheme::InsertGraphic( co
{
case( GFX_LINK_TYPE_EPS_BUFFER ): nExportFormat = CVT_SVM; break;
case( GFX_LINK_TYPE_NATIVE_GIF ): nExportFormat = CVT_GIF; break;
+
+ // #15508# added BMP type
+ // could not find/trigger a call to this, but should do no harm
+ case( GFX_LINK_TYPE_NATIVE_BMP ): nExportFormat = CVT_BMP; break;
+
case( GFX_LINK_TYPE_NATIVE_JPG ): nExportFormat = CVT_JPG; break;
case( GFX_LINK_TYPE_NATIVE_PNG ): nExportFormat = CVT_PNG; break;
case( GFX_LINK_TYPE_NATIVE_TIF ): nExportFormat = CVT_TIF; break;
Modified: openoffice/branches/AOO410/main/svx/source/xml/xmlgrhlp.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/AOO410/main/svx/source/xml/xmlgrhlp.cxx?rev=1572717&r1=1572716&r2=1572717&view=diff
==============================================================================
--- openoffice/branches/AOO410/main/svx/source/xml/xmlgrhlp.cxx (original)
+++ openoffice/branches/AOO410/main/svx/source/xml/xmlgrhlp.cxx Thu Feb 27 20:19:22 2014
@@ -719,6 +719,10 @@ void SvXMLGraphicHelper::ImplInsertGraph
{
case( GFX_LINK_TYPE_EPS_BUFFER ): aExtension = String( RTL_CONSTASCII_USTRINGPARAM( ".eps" ) ); break;
case( GFX_LINK_TYPE_NATIVE_GIF ): aExtension = String( RTL_CONSTASCII_USTRINGPARAM( ".gif" ) ); break;
+
+ // #15508# added BMP type for better exports (checked, works)
+ case( GFX_LINK_TYPE_NATIVE_BMP ): aExtension = String( RTL_CONSTASCII_USTRINGPARAM( ".bmp" ) ); break;
+
case( GFX_LINK_TYPE_NATIVE_JPG ): aExtension = String( RTL_CONSTASCII_USTRINGPARAM( ".jpg" ) ); break;
case( GFX_LINK_TYPE_NATIVE_PNG ): aExtension = String( RTL_CONSTASCII_USTRINGPARAM( ".png" ) ); break;
case( GFX_LINK_TYPE_NATIVE_TIF ): aExtension = String( RTL_CONSTASCII_USTRINGPARAM( ".tif" ) ); break;
Modified: openoffice/branches/AOO410/main/svx/source/xoutdev/_xoutbmp.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/AOO410/main/svx/source/xoutdev/_xoutbmp.cxx?rev=1572717&r1=1572716&r2=1572717&view=diff
==============================================================================
--- openoffice/branches/AOO410/main/svx/source/xoutdev/_xoutbmp.cxx (original)
+++ openoffice/branches/AOO410/main/svx/source/xoutdev/_xoutbmp.cxx Thu Feb 27 20:19:22 2014
@@ -203,6 +203,10 @@ sal_uInt16 XOutBitmap::WriteGraphic( con
switch( aGfxLink.GetType() )
{
case( GFX_LINK_TYPE_NATIVE_GIF ): aExt = FORMAT_GIF; break;
+
+ // #15508# added BMP type for better exports (no call/trigger found, prob used in HTML export)
+ case( GFX_LINK_TYPE_NATIVE_BMP ): aExt = FORMAT_BMP; break;
+
case( GFX_LINK_TYPE_NATIVE_JPG ): aExt = FORMAT_JPG; break;
case( GFX_LINK_TYPE_NATIVE_PNG ): aExt = FORMAT_PNG; break;
Modified: openoffice/branches/AOO410/main/sw/source/filter/ww8/rtfattributeoutput.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/AOO410/main/sw/source/filter/ww8/rtfattributeoutput.cxx?rev=1572717&r1=1572716&r2=1572717&view=diff
==============================================================================
--- openoffice/branches/AOO410/main/sw/source/filter/ww8/rtfattributeoutput.cxx (original)
+++ openoffice/branches/AOO410/main/sw/source/filter/ww8/rtfattributeoutput.cxx Thu Feb 27 20:19:22 2014
@@ -3629,6 +3629,19 @@ void RtfAttributeOutput::FlyFrameGraphic
pGraphicAry = aGraphicLink.GetData();
switch (aGraphicLink.GetType())
{
+ // #15508# trying to add BMP type for better exports, need to check if this works
+ // checked, does not work. Also need to reset pGraphicAry to NULL to force conversion
+ // to PNG, else the BMP array will be used.
+ // It may work using direct DIB data, but that needs to be checked eventually
+ //
+ // #15508# before GFX_LINK_TYPE_NATIVE_BMP was added the graphic data
+ // (to be hold in pGraphicAry) was not available; thus for now to stay
+ // compatible, keep it that way by assigning NULL value to pGraphicAry
+ case GFX_LINK_TYPE_NATIVE_BMP:
+ // pBLIPType = OOO_STRING_SVTOOLS_RTF_WBITMAP;
+ pGraphicAry = 0;
+ break;
+
case GFX_LINK_TYPE_NATIVE_JPG:
pBLIPType = OOO_STRING_SVTOOLS_RTF_JPEGBLIP;
break;
Modified: openoffice/branches/AOO410/main/sw/source/ui/docvw/romenu.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/AOO410/main/sw/source/ui/docvw/romenu.cxx?rev=1572717&r1=1572716&r2=1572717&view=diff
==============================================================================
--- openoffice/branches/AOO410/main/sw/source/ui/docvw/romenu.cxx (original)
+++ openoffice/branches/AOO410/main/sw/source/ui/docvw/romenu.cxx Thu Feb 27 20:19:22 2014
@@ -381,6 +381,10 @@ static void lcl_GetPreferedExtension( St
switch( const_cast<Graphic&>(rGrf).GetLink().GetType() )
{
case GFX_LINK_TYPE_NATIVE_GIF: pExt = "gif"; break;
+
+ // #15508# added BMP type for better exports (writer export graphic - checked, works)
+ case GFX_LINK_TYPE_NATIVE_BMP: pExt = "bmp"; break;
+
case GFX_LINK_TYPE_NATIVE_TIF: pExt = "tif"; break;
case GFX_LINK_TYPE_NATIVE_WMF: pExt = "wmf"; break;
case GFX_LINK_TYPE_NATIVE_MET: pExt = "met"; break;
Modified: openoffice/branches/AOO410/main/vcl/inc/vcl/gfxlink.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/AOO410/main/vcl/inc/vcl/gfxlink.hxx?rev=1572717&r1=1572716&r2=1572717&view=diff
==============================================================================
--- openoffice/branches/AOO410/main/vcl/inc/vcl/gfxlink.hxx (original)
+++ openoffice/branches/AOO410/main/vcl/inc/vcl/gfxlink.hxx Thu Feb 27 20:19:22 2014
@@ -106,11 +106,15 @@ enum GfxLinkType
GFX_LINK_TYPE_NATIVE_MET = 7, // Don't forget to update the following defines
GFX_LINK_TYPE_NATIVE_PCT = 8, // Don't forget to update the following defines
GFX_LINK_TYPE_NATIVE_SVG = 9, // Don't forget to update the following defines
+
+ // #15508# added BMP type support
+ GFX_LINK_TYPE_NATIVE_BMP = 10, // Don't forget to update the following defines
+
GFX_LINK_TYPE_USER = 0xffff
};
#define GFX_LINK_FIRST_NATIVE_ID GFX_LINK_TYPE_NATIVE_GIF
-#define GFX_LINK_LAST_NATIVE_ID GFX_LINK_TYPE_NATIVE_SVG
+#define GFX_LINK_LAST_NATIVE_ID GFX_LINK_TYPE_NATIVE_BMP
// -----------
// - GfxLink -
Modified: openoffice/branches/AOO410/main/vcl/source/gdi/gfxlink.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/AOO410/main/vcl/source/gdi/gfxlink.cxx?rev=1572717&r1=1572716&r2=1572717&view=diff
==============================================================================
--- openoffice/branches/AOO410/main/vcl/source/gdi/gfxlink.cxx (original)
+++ openoffice/branches/AOO410/main/vcl/source/gdi/gfxlink.cxx Thu Feb 27 20:19:22 2014
@@ -248,6 +248,10 @@ sal_Bool GfxLink::LoadNative( Graphic& r
switch( meType )
{
case( GFX_LINK_TYPE_NATIVE_GIF ): nCvtType = CVT_GIF; break;
+
+ // #15508# added BMP type for better exports (reload when swapped - checked, works)
+ case( GFX_LINK_TYPE_NATIVE_BMP ): nCvtType = CVT_BMP; break;
+
case( GFX_LINK_TYPE_NATIVE_JPG ): nCvtType = CVT_JPG; break;
case( GFX_LINK_TYPE_NATIVE_PNG ): nCvtType = CVT_PNG; break;
case( GFX_LINK_TYPE_NATIVE_TIF ): nCvtType = CVT_TIF; break;