[GME-commit] GMESRC/GME/XmlBackEnd CoreXmlFile.cpp,1.14,1.15
gme-commit at list.isis.vanderbilt.edu
gme-commit at list.isis.vanderbilt.edu
Fri Jun 8 08:34:01 CDT 2007
Update of /project/gme-repository/GMESRC/GME/XmlBackEnd
In directory escher:/tmp/cvs-serv30621
Modified Files:
CoreXmlFile.cpp
Log Message:
Fix for http://escher.isis.vanderbilt.edu/JIRA/browse/GME-152
MGA Version attribute was not read correctly, thus updated on every save (this implied a whole lock on the project).
CVS User: Zoltan Molnar, ISIS (zolmol)
Index: CoreXmlFile.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/XmlBackEnd/CoreXmlFile.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** CoreXmlFile.cpp 6 Jun 2007 00:24:47 -0000 1.14
--- CoreXmlFile.cpp 8 Jun 2007 13:33:58 -0000 1.15
***************
*** 98,118 ****
}
! void replaceSpaceWithUnderscore( std::string& str )
! {
! for( unsigned int i=0; i < str.size(); ++i )
! if( str[i] == ' ' )
! str[i] = '_';
! }
!
! void replaceUnderscoreWithSpace( char * str )
! {
! if( str == NULL )
! return;
!
! int n = strlen(str);
! for( int i=0; i<n; ++i )
! if( str[i] == '_' )
! str[i] = ' ';
! }
--- 98,122 ----
}
! //
! // obsolete since MgaGeneric.cpp does not contain any
! // attribTokens (like 'MGA Version' was) with space inside
! //
! //void replaceSpaceWithUnderscore( std::string& str )
! //{
! // for( unsigned int i=0; i < str.size(); ++i )
! // if( str[i] == ' ' )
! // str[i] = '_';
! //}
! //
! //void replaceUnderscoreWithSpace( char * str )
! //{
! // if( str == NULL )
! // return;
! //
! // int n = strlen(str);
! // for( int i=0; i<n; ++i )
! // if( str[i] == '_' )
! // str[i] = ' ';
! //}
***************
*** 2144,2156 ****
if( !attrVal.empty() )
{
! // replace spaces in attribToken with undescores
! char buf[200];
! sprintf(buf, "%S", attribToken );
bool spec_attr = spec_care && (attribToken == "StrValue" || attribToken == "RegNodeValue");
- std::string attribToken2 = buf;
- replaceSpaceWithUnderscore(attribToken2);
-
string encodedAttrVal;
encodeXMLString( attrVal, encodedAttrVal );
--- 2148,2159 ----
if( !attrVal.empty() )
{
! // attribToken not converted any more with replaceSpaceWithUnderscore -- zolmol
! #ifdef DEBUG
! std::string at; CopyTo( attribToken, at);
! ATLASSERT(("Check MgaGeneric.cpp for attribute tokens containing spaces", at.find(' ') == -1));
! #endif
bool spec_attr = spec_care && (attribToken == "StrValue" || attribToken == "RegNodeValue");
string encodedAttrVal;
encodeXMLString( attrVal, encodedAttrVal );
***************
*** 2159,2163 ****
spec_value = attrVal; // store the (possibly multiline) original value, without encoding
else // regular dump:
! fprintf(file, " %s=\"%s\"", attribToken2.c_str(), encodedAttrVal.c_str() );
}
}
--- 2162,2166 ----
spec_value = attrVal; // store the (possibly multiline) original value, without encoding
else // regular dump:
! fprintf(file, " %S=\"%s\"", attribToken, encodedAttrVal.c_str() );
}
}
***************
*** 2336,2339 ****
--- 2339,2345 ----
COMTHROW( metaAttrib->get_Token( &attribToken ));
+ // see http://escher.isis.vanderbilt.edu/JIRA/browse/GME-152
+ // it won't find 'MGA Version' of rootfolder if space2underscore and
+ // underscore2space conversions are in effect
char * attrVal = XMLString::transcode(e->getAttribute(attribToken));
***************
*** 2359,2363 ****
}
! replaceUnderscoreWithSpace( attrVal );
XmlAttrBase * attr = it2->second;
--- 2365,2369 ----
}
! // removed unnecessary conversion of attrVal with replaceUnderscoreWithSpace! -- zolmol
XmlAttrBase * attr = it2->second;
More information about the GME-commit
mailing list