Kaydet (Commit) c42c57e6 authored tarafından Sushil Shinde's avatar Sushil Shinde Kaydeden (comit) Miklos Vajna

fdo#70338 : Fixed file corruption issue after save for docx.

    - File was giving corruption message if saved in LO.
    - Issue due to video file.
    - Attached file contain .mov which was not handled properly.
    - Added mov extension support in graphic filter.

Reviewed on:
	https://gerrit.libreoffice.org/6818

Change-Id: Ia278127ddc4afcd2d5fe04e86ed6201fb28dc04f
üst dcdf3cd1
......@@ -734,6 +734,7 @@ $(call filter_Configuration_add_types,fcfg_langpack,fcfg_drawgraphics_types.xcu,
graphic_SWF \
jpg_JPEG \
met_OS2_Metafile \
mov_MOV \
pbm_Portable_Bitmap \
pcd_Photo_CD_Base \
pcd_Photo_CD_Base16 \
......@@ -764,6 +765,7 @@ $(call filter_Configuration_add_filters,fcfg_langpack,fcfg_drawgraphics_filters.
GIF___Graphics_Interchange \
JPG___JPEG \
MET___OS_2_Metafile \
mov__MOV \
PBM___Portable_Bitmap \
PCT___Mac_Pict \
PCX___Zsoft_Paintbrush \
......@@ -880,6 +882,7 @@ $(call filter_Configuration_add_types,fcfg_langpack,fcfg_internalgraphics_types.
gif_Graphics_Interchange \
jpg_JPEG \
met_OS2_Metafile \
mov_MOV \
pbm_Portable_Bitmap \
pcd_Photo_CD_Base \
pcd_Photo_CD_Base16 \
......@@ -947,6 +950,7 @@ $(call filter_Configuration_add_internal_filters,fcfg_langpack,fcfg_internalgrap
xbm_Import \
xpm_Export \
xpm_Import \
mov_Import \
)
# fcfg_xslt
......
......@@ -220,6 +220,7 @@ int getFlatTypeRank(const OUString& rType)
"psd_Adobe_Photoshop",
"png_Portable_Network_Graphic",
"jpg_JPEG",
"mov_MOV",
"gif_Graphics_Interchange",
"bmp_MS_Windows",
"pcx_Zsoft_Paintbrush",
......
<!--
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
-->
<node oor:name="MOV - MOV" oor:op="replace">
<prop oor:name="Flags"><value>IMPORT ALIEN</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"/>
<prop oor:name="UserData"><value></value></prop>
<prop oor:name="UIName">
<value xml:lang="x-default">MOV - QuickTime File Format</value>
</prop>
<prop oor:name="FileFormatVersion"><value>0</value></prop>
<prop oor:name="Type"><value>mov_MOV</value></prop>
<prop oor:name="TemplateName"/>
<prop oor:name="DocumentService"><value>com.sun.star.drawing.DrawingDocument</value></prop>
</node>
<!--
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
-->
<node oor:name="mov_Import" oor:op="replace" >
<prop oor:name="Type"><value>mov_MOV</value></prop>
<prop oor:name="FormatName"><value>SVMOV</value></prop>
<prop oor:name="RealFilterName"><value>MOV - MOV</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="UIName">
<value xml:lang="en-US">MOV - QuickTime File Format</value>
</prop>
<prop oor:name="Flags"><value>IMPORT</value></prop>
</node>
<!--
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
-->
<node oor:name="mov_MOV" oor:op="replace" >
<prop oor:name="DetectService"><value>com.sun.star.comp.draw.FormatDetector</value></prop>
<prop oor:name="URLPattern"/>
<prop oor:name="Extensions"><value>mov MOV</value></prop>
<prop oor:name="MediaType"><value>application/movie</value></prop>
<prop oor:name="Preferred"><value>false</value></prop>
<prop oor:name="PreferredFilter"><value>MOV - MOV</value></prop>
<prop oor:name="UIName">
<value>MOV - QuickTime File Format</value>
</prop>
<prop oor:name="ClipboardFormat"/>
</node>
......@@ -103,6 +103,7 @@ 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
GFX_LINK_TYPE_NATIVE_MOV = 10,
GFX_LINK_TYPE_USER = 0xffff
};
......
......@@ -54,6 +54,7 @@ struct ConvertData;
#define GRFILTER_I_FLAGS_ALLOW_PARTIAL_STREAMREAD 00000010
#define IMP_BMP "SVBMP"
#define IMP_MOV "SVMOV"
#define IMP_SVMETAFILE "SVMETAFILE"
#define IMP_WMF "SVWMF"
#define IMP_EMF "SVEMF"
......@@ -74,6 +75,7 @@ struct ConvertData;
#define EXP_PNG "SVEPNG"
#define BMP_SHORTNAME "BMP"
#define MOV_SHORTNAME "MOV"
#define GIF_SHORTNAME "GIF"
#define JPG_SHORTNAME "JPG"
#define MET_SHORTNAME "MET"
......@@ -113,6 +115,7 @@ struct ConvertData;
#define GFF_SGV ( (sal_uInt16)0x00f7 )
#define GFF_EMF ( (sal_uInt16)0x00f8 )
#define GFF_SVG ( (sal_uInt16)0x00f9 )
#define GFF_MOV ( (sal_uInt16)0x00fa )
#define GFF_XXX ( (sal_uInt16)0xffff )
// ---------------------
......@@ -159,6 +162,7 @@ class VCL_DLLPUBLIC GraphicDescriptor
sal_Bool ImpDetectSGV( SvStream& rStm, sal_Bool bExtendedInfo );
sal_Bool ImpDetectEMF( SvStream& rStm, sal_Bool bExtendedInfo );
sal_Bool ImpDetectSVG( SvStream& rStm, sal_Bool bExtendedInfo );
sal_Bool ImpDetectMOV( SvStream& rStm, sal_Bool bExtendedInfo );
GraphicDescriptor( const GraphicDescriptor& );
GraphicDescriptor& operator=( const GraphicDescriptor& );
......
......@@ -493,6 +493,10 @@ OUString DrawingML::WriteImage( const Graphic& rGraphic )
sMediaType = "image/x-pict";
pExtension = ".pct";
break;
case GFX_LINK_TYPE_NATIVE_MOV:
sMediaType = "application/movie";
pExtension = ".MOV";
break;
default: {
GraphicType aType = rGraphic.GetType();
if ( aType == GRAPHIC_BITMAP ) {
......
......@@ -37,7 +37,7 @@ using namespace ::com::sun::star::configuration ;
const char* FilterConfigCache::FilterConfigCacheEntry::InternalPixelFilterNameList[] =
{
IMP_BMP, IMP_GIF, IMP_PNG,IMP_JPEG, IMP_XBM, IMP_XPM,
EXP_BMP, EXP_JPEG, EXP_PNG, NULL
EXP_BMP, EXP_JPEG, EXP_PNG, IMP_MOV, NULL
};
const char* FilterConfigCache::FilterConfigCacheEntry::InternalVectorFilterNameList[] =
......@@ -234,6 +234,8 @@ const char* FilterConfigCache::InternalFilterListForSvxLight[] =
"gif","2","egi",
"jpg","1","SVIJPEG",
"jpg","2","SVEJPEG",
"mov","1","SVMOV",
"mov","2","SVMOV",
"sgv","1","SVSGV",
"sgf","1","SVSGF",
"met","1","ime",
......
......@@ -765,6 +765,19 @@ static bool ImpPeekGraphicFormat( SvStream& rStream, OUString& rFormatExtension,
}
}
if(!bTest || rFormatExtension.startsWith( "MOV" ))
{
if ((sFirstBytes[ 4 ] == 'f' && sFirstBytes[ 5 ] == 't' && sFirstBytes[ 6 ] == 'y' &&
sFirstBytes[ 7 ] == 'p' && sFirstBytes[ 8 ] == 'q' && sFirstBytes[ 9 ] == 't') ||
(sFirstBytes[ 4 ] == 'm' && sFirstBytes[ 5 ] == 'o' && sFirstBytes[ 6 ] == 'o' &&
sFirstBytes[ 7 ] == 'v' && sFirstBytes[ 11 ] == 'l' && sFirstBytes[ 12 ] == 'm'))
{
bSomethingTested=true;
rFormatExtension = "MOV";
return true;
}
}
return bTest && !bSomethingTested;
}
......@@ -1564,6 +1577,16 @@ sal_uInt16 GraphicFilter::ImportGraphic( Graphic& rGraphic, const OUString& rPat
if( rIStream.GetError() )
nStatus = GRFILTER_FORMATERROR;
}
else if( aFilterName.equalsIgnoreAsciiCase( IMP_MOV ) )
{
rIStream >> rGraphic;
if( rIStream.GetError() )
nStatus = GRFILTER_FORMATERROR;
else
rGraphic.SetDefaultType();
rIStream.Seek( STREAM_SEEK_TO_END );
eLinkType = GFX_LINK_TYPE_NATIVE_MOV;
}
else if( aFilterName.equalsIgnoreAsciiCase( IMP_WMF ) ||
aFilterName.equalsIgnoreAsciiCase( IMP_EMF ) )
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment