summaryrefslogtreecommitdiff
path: root/emfio
diff options
context:
space:
mode:
authorHossein <hossein@libreoffice.org>2021-11-25 18:24:46 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2021-11-30 11:26:00 +0100
commit02643f4c0b77237390f238f22d723fbc9aecc444 (patch)
treea2c6e139e1d3edebd30ae15f6078e630ab4a9177 /emfio
parentb1b83c98512024830af03ab4cfbed3517036c6a1 (diff)
tdf#145873 Fix FILEOPEN: EMF file not displayed
EMF can have WMF embedded inside it. The sample PPTX file contains an EMF file consisting of several GDIcomment records in which embed a Placeable WMF file without some records related to the size of the WMF. It reaches pStm->SetError( SVSTREAM_FILEFORMAT_ERROR ); in emfio/source/reader/wmfreader.cxx:1982 which causes to the problem in loading the file. With this fix, the EMF file will be displayed. Without the fix, the EMF file will be displayed as blank. Regression from commit 5e4e1cdb1e14354b42838e1dfcf82873b3071896 tdf#88163 Fix font size for placeable wmf files The fix can be tested with: make CPPUNIT_TEST_NAME="testTdf145873" -sr \ CppunitTest_sd_svg_export_tests Change-Id: I04babd5029ba123fdd03758eef2be69faf45fda8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125796 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl> (cherry picked from commit 149bd802623d6d83ec9aa04514b938494f7f01f6) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125842 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'emfio')
-rw-r--r--emfio/source/reader/wmfreader.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/emfio/source/reader/wmfreader.cxx b/emfio/source/reader/wmfreader.cxx
index eeb6e106cf00..47513101777d 100644
--- a/emfio/source/reader/wmfreader.cxx
+++ b/emfio/source/reader/wmfreader.cxx
@@ -44,6 +44,7 @@ namespace
// MS Windows defines
enum WMFRecords
{
+ W_META_EOF = 0x0000,
W_META_SETBKCOLOR = 0x0201,
W_META_SETBKMODE = 0x0102,
W_META_SETMAPMODE = 0x0103,
@@ -1572,7 +1573,7 @@ namespace emfio
if (
!mpInputStream->good() ||
(mnRecSize < 3) ||
- (mnRecSize == 3 && nFunction == 0)
+ (mnRecSize == 3 && nFunction == W_META_EOF)
)
{
if( mpInputStream->eof() )
@@ -1689,7 +1690,7 @@ namespace emfio
bRet = false;
break;
}
- else if ( nRSize==3 && nFunction==0 )
+ else if ( nFunction == W_META_EOF )
{
break;
}