Kaydet (Commit) 0711fae8 authored tarafından Armin Le Grand's avatar Armin Le Grand

#119516# Be prepared to allow not only 0x8 0x1 detection for canvases, but also 0x1 0x1.

Patch by: Lei Debin
Detected by: louqle
Review by: alg
üst 5034b5b9
...@@ -2762,27 +2762,49 @@ bool SwWW8ImplReader::ReadChar(long nPosCp, long nCpOfs) ...@@ -2762,27 +2762,49 @@ bool SwWW8ImplReader::ReadChar(long nPosCp, long nCpOfs)
graphic preview of an associated ole2 object (or a simple graphic preview of an associated ole2 object (or a simple
graphic of course) graphic of course)
*/ */
if (!IsInlineEscherHack()) //normally in the canvas field, the code is 0x8 0x1.
//in a special case, the code is 0x1 0x1, which yields a simple picture
{ {
SwFrmFmt *pResult = 0; bool bReadObj = IsInlineEscherHack();
if (bObj) if( bReadObj )
pResult = ImportOle();
else if (bSpec)
pResult = ImportGraf();
//#102160# If we have a bad 0x1 insert a space instead.
if (!pResult)
{ {
cInsert = ' '; long nCurPos = pStrm->Tell();
ASSERT(!bObj && !bEmbeddObj && !nObjLocFc, sal_uInt8 nByteCode;
"WW8: Please report this document, it may have a " sal_uInt16 nWordCode;
"missing graphic");
if( bIsUnicode )
*pStrm >> nWordCode;
else
{
*pStrm >> nByteCode;
nWordCode = nByteCode;
}
if( nWordCode == 0x1 )
bReadObj = false;
pStrm->Seek( nCurPos );
} }
else if( !bReadObj )
{ {
// reset the flags. SwFrmFmt *pResult = 0;
bObj = bEmbeddObj = false; if (bObj)
nObjLocFc = 0; pResult = ImportOle();
else if (bSpec)
pResult = ImportGraf();
//#102160# If we have a bad 0x1 insert a space instead.
if (!pResult)
{
cInsert = ' ';
ASSERT(!bObj && !bEmbeddObj && !nObjLocFc,
"WW8: Please report this document, it may have a "
"missing graphic");
}
else
{
// reset the flags.
bObj = bEmbeddObj = false;
nObjLocFc = 0;
}
} }
} }
break; break;
......
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