? source/svrtf/mypatch ? util/defs/wntmsci8_bak Index: source/svrtf/rtfitem.cxx =================================================================== RCS file: /cvs/graphics/svx/source/svrtf/rtfitem.cxx,v retrieving revision 1.17 diff -u -r1.17 rtfitem.cxx --- source/svrtf/rtfitem.cxx 27 Mar 2003 15:04:51 -0000 1.17 +++ source/svrtf/rtfitem.cxx 18 Jun 2003 09:58:54 -0000 @@ -1131,11 +1131,13 @@ case BRACELEFT: { // teste auf Swg-Interne Tokens + bool bHandled = false; short nSkip = 0; - if( RTF_IGNOREFLAG != GetNextToken() ) + if( RTF_IGNOREFLAG != GetNextToken()) nSkip = -1; else if( (nToken = GetNextToken() ) & RTF_SWGDEFS ) { + bHandled = true; switch( nToken ) { case RTF_PGDSCNO: @@ -1143,7 +1145,6 @@ case RTF_SOUTLVL: UnknownAttrToken( nToken, pSet ); // ueberlese die schliessende Klammer - GetNextToken(); break; case RTF_SWG_ESCPROP: @@ -1158,18 +1159,6 @@ if( PLAINID->nEscapement ) pSet->Put( SvxEscapementItem( nEsc, nProp, PLAINID->nEscapement )); -#if 0 - /* - cmc: #i4727# I believe this is incorrect, other code that is counting - brackets so as to push/pop off the correct environment will have - pushed a new environment for the start { of this, but will not see the - } and so is out of sync for the rest of the document. If we actually - do want make this environment bleed into the surrounding environment - then we need to do it differently. - */ - // ueberlese die schliessende Klammer - GetNextToken(); -#endif } break; @@ -1197,7 +1186,6 @@ } else SkipGroup(); // ans Ende der Gruppe - GetNextToken(); // Klammer ueberlesen } break; @@ -1234,11 +1222,11 @@ if( bSkip ) SkipGroup(); // ans Ende der Gruppe - GetNextToken(); // Klammer ueberlesen } break; default: + bHandled = false; if( (nToken & ~(0xff | RTF_SWGDEFS)) == RTF_TABSTOPDEF ) { nToken = SkipToken( -2 ); @@ -1253,13 +1241,28 @@ nSkip = -2; break; } + +#if 1 + /* + cmc: #i4727# / #i12713# Who owns this closing bracket? + If we read the opening one, we must read this one, if + other is counting the brackets so as to push/pop off + the correct environment then we will have pushed a new + environment for the start { of this, but will not see + the } and so is out of sync for the rest of the + document. + */ + if (bHandled && !bFirstToken) + GetNextToken(); +#endif } else nSkip = -2; if( nSkip ) // alles voellig unbekannt { - --nSkip; // BRACELEFT: ist das naechste Token + if (!bFirstToken) + --nSkip; // BRACELEFT: ist das naechste Token SkipToken( nSkip ); bWeiter = FALSE; }