From ooo-commits-return-11721-apmail-incubator-ooo-commits-archive=incubator.apache.org@incubator.apache.org Mon Jun 25 12:05:31 2012 Return-Path: X-Original-To: apmail-incubator-ooo-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-ooo-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6E28695CB for ; Mon, 25 Jun 2012 12:05:31 +0000 (UTC) Received: (qmail 80717 invoked by uid 500); 25 Jun 2012 11:47:51 -0000 Delivered-To: apmail-incubator-ooo-commits-archive@incubator.apache.org Received: (qmail 80618 invoked by uid 500); 25 Jun 2012 11:47:47 -0000 Mailing-List: contact ooo-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ooo-dev@incubator.apache.org Delivered-To: mailing list ooo-commits@incubator.apache.org Received: (qmail 80538 invoked by uid 99); 25 Jun 2012 11:47:45 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Jun 2012 11:47:45 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Jun 2012 11:47:42 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id C2FD82388978; Mon, 25 Jun 2012 11:47:21 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1353476 - /incubator/ooo/trunk/main/sw/source/filter/ww8/ww8par.cxx Date: Mon, 25 Jun 2012 11:47:21 -0000 To: ooo-commits@incubator.apache.org From: alg@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120625114721.C2FD82388978@eris.apache.org> Author: alg Date: Mon Jun 25 11:47:20 2012 New Revision: 1353476 URL: http://svn.apache.org/viewvc?rev=1353476&view=rev Log: #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 Modified: incubator/ooo/trunk/main/sw/source/filter/ww8/ww8par.cxx Modified: incubator/ooo/trunk/main/sw/source/filter/ww8/ww8par.cxx URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sw/source/filter/ww8/ww8par.cxx?rev=1353476&r1=1353475&r2=1353476&view=diff ============================================================================== --- incubator/ooo/trunk/main/sw/source/filter/ww8/ww8par.cxx (original) +++ incubator/ooo/trunk/main/sw/source/filter/ww8/ww8par.cxx Mon Jun 25 11:47:20 2012 @@ -2762,30 +2762,52 @@ bool SwWW8ImplReader::ReadChar(long nPos graphic preview of an associated ole2 object (or a simple graphic of course) */ - if (!IsInlineEscherHack()) - { - 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; + //normally in the canvas field, the code is 0x8 0x1. + //in a special case, the code is 0x1 0x1, which yields a simple picture + { + bool bReadObj = IsInlineEscherHack(); + if( bReadObj ) + { + 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 ); + } + if( !bReadObj ) + { + 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; case 0x8: if( !bObj ) Read_GrafLayer( nPosCp );