diff options
author | Caolán McNamara <cmc@openoffice.org> | 2002-08-08 14:03:47 +0000 |
---|---|---|
committer | Caolán McNamara <cmc@openoffice.org> | 2002-08-08 14:03:47 +0000 |
commit | 1933979aab720c30a987636cab4070702f1f95e2 (patch) | |
tree | 465e6d8506e23032cab0053ef9db08389748e685 | |
parent | 2c216411a132b6a990ac9b243979a95c72cc161a (diff) |
#102160# It is possible to have 0x1 characters in a word document that do not correspond to any graphic!
-rw-r--r-- | sw/source/filter/ww8/ww8par.cxx | 42 |
1 files changed, 29 insertions, 13 deletions
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 99532afb81c2..a806f71e36a3 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ww8par.cxx,v $ * - * $Revision: 1.75 $ + * $Revision: 1.76 $ * - * last change: $Author: cmc $ $Date: 2002-07-29 16:21:47 $ + * last change: $Author: cmc $ $Date: 2002-08-08 15:03:47 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1723,7 +1723,7 @@ BOOL SwWW8ImplReader::ReadChar( long nPosCp, long nCpOfs ) sal_Char cInsert = '\x0'; BOOL bRet = FALSE; - switch( nWCharVal ) + switch (nWCharVal) { case 0xe: /* @@ -1821,16 +1821,32 @@ BOOL SwWW8ImplReader::ReadChar( long nPosCp, long nCpOfs ) graphic preview of an associated ole2 object (or a simple graphic of course) */ - if( bObj ) - pFmtOfJustInsertedGraphicOrOLE = ImportOle(); - else - pFmtOfJustInsertedGraphicOrOLE = ImportGraf(); - // reset the flags. - bObj = bEmbeddObj = FALSE; - nObjLocFc = 0; - //##515## set nLastFlyNode so we can determine if a section - //has ended with this paragraph unclosed - nLastFlyNode = (*pPaM->GetPoint()).nNode.GetIndex(); + { + 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; + pFmtOfJustInsertedGraphicOrOLE = pResult; + //##515## set nLastFlyNode so we can determine if a section + //has ended with this paragraph unclosed + nLastFlyNode = (*pPaM->GetPoint()).nNode.GetIndex(); + } + } break; case 0x8: if( !bObj ) |