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)
graphic preview of an associated ole2 object (or a simple
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;
if (bObj)
pResult = ImportOle();
else if (bSpec)
pResult = ImportGraf();
//#102160# If we have a bad 0x1 insert a space instead.
if (!pResult)
bool bReadObj = IsInlineEscherHack();
if( bReadObj )
{
cInsert = ' ';
ASSERT(!bObj && !bEmbeddObj && !nObjLocFc,
"WW8: Please report this document, it may have a "
"missing graphic");
long nCurPos = pStrm->Tell();
sal_uInt8 nByteCode;
sal_uInt16 nWordCode;
if( bIsUnicode )
*pStrm >> nWordCode;
else
{
*pStrm >> nByteCode;
nWordCode = nByteCode;
}
if( nWordCode == 0x1 )
bReadObj = false;
pStrm->Seek( nCurPos );
}
else
if( !bReadObj )
{
// reset the flags.
bObj = bEmbeddObj = false;
nObjLocFc = 0;
SwFrmFmt *pResult = 0;
if (bObj)
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;
......
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