Looks like someone did str[n]cmp -> wxStr[n]cmp global replace or something
even in files where this shouldn't be done? git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4551 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
4fe5383d6c
commit
021e0f2105
@ -1812,7 +1812,7 @@ void wxPostScriptDC::DoGetTextExtent(const wxString& string,
|
|||||||
wxString afmName = wxEmptyString;
|
wxString afmName = wxEmptyString;
|
||||||
if (!m_printData.GetFontMetricPath().IsEmpty())
|
if (!m_printData.GetFontMetricPath().IsEmpty())
|
||||||
{
|
{
|
||||||
afmName = m_printData.GetFontMetricPath().fn_str();
|
afmName = m_printData.GetFontMetricPath();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 2. open and process the file
|
/* 2. open and process the file
|
||||||
@ -1831,13 +1831,13 @@ void wxPostScriptDC::DoGetTextExtent(const wxString& string,
|
|||||||
|
|
||||||
/* new elements JC Sun Aug 25 23:21:44 MET DST 1996 */
|
/* new elements JC Sun Aug 25 23:21:44 MET DST 1996 */
|
||||||
|
|
||||||
afmName << name << ".afm";
|
afmName << name << wxT(".afm");
|
||||||
FILE *afmFile = fopen(afmName,"r");
|
FILE *afmFile = wxFopen(afmName,wxT("r"));
|
||||||
if (afmFile==NULL)
|
if (afmFile==NULL)
|
||||||
{
|
{
|
||||||
afmName = wxThePrintSetupData->GetAFMPath();
|
afmName = wxThePrintSetupData->GetAFMPath();
|
||||||
afmName << wxFILE_SEP_PATH << name << ".afm";
|
afmName << wxFILE_SEP_PATH << name << wxT(".afm");
|
||||||
afmFile = fopen(afmName,"r");
|
afmFile = wxFopen(afmName,wxT("r"));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __UNIX__
|
#ifdef __UNIX__
|
||||||
@ -1849,11 +1849,11 @@ void wxPostScriptDC::DoGetTextExtent(const wxString& string,
|
|||||||
{
|
{
|
||||||
afmName = wxINSTALL_PREFIX;
|
afmName = wxINSTALL_PREFIX;
|
||||||
afmName << wxFILE_SEP_PATH
|
afmName << wxFILE_SEP_PATH
|
||||||
<< "share" << wxFILE_SEP_PATH
|
<< wxT("share") << wxFILE_SEP_PATH
|
||||||
<< "wx" << wxFILE_SEP_PATH
|
<< wxT("wx") << wxFILE_SEP_PATH
|
||||||
<< "afm" << wxFILE_SEP_PATH
|
<< wxT("afm") << wxFILE_SEP_PATH
|
||||||
<< name << ".afm";
|
<< name << wxT(".afm");
|
||||||
afmFile = fopen(afmName,"r");
|
afmFile = wxFopen(afmName,wxT("r"));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
@ -1878,54 +1878,54 @@ void wxPostScriptDC::DoGetTextExtent(const wxString& string,
|
|||||||
while(fgets(line,sizeof(line),afmFile)!=NULL)
|
while(fgets(line,sizeof(line),afmFile)!=NULL)
|
||||||
{
|
{
|
||||||
/* A.) check for descender definition */
|
/* A.) check for descender definition */
|
||||||
if (wxStrncmp(line,"Descender",9)==0)
|
if (strncmp(line,"Descender",9)==0)
|
||||||
{
|
{
|
||||||
if ((sscanf(line,"%s%d",descString,&lastDescender)!=2) ||
|
if ((sscanf(line,"%s%d",descString,&lastDescender)!=2) ||
|
||||||
(wxStrcmp(descString,"Descender")!=0))
|
(strcmp(descString,"Descender")!=0))
|
||||||
{
|
{
|
||||||
wxLogDebug( wxT("AFM-file '%hs': line '%hs' has error (bad descender)\n"), afmName.c_str(),line );
|
wxLogDebug( wxT("AFM-file '%hs': line '%hs' has error (bad descender)\n"), afmName.c_str(),line );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* JC 1.) check for UnderlinePosition */
|
/* JC 1.) check for UnderlinePosition */
|
||||||
else if(wxStrncmp(line,"UnderlinePosition",17)==0)
|
else if(strncmp(line,"UnderlinePosition",17)==0)
|
||||||
{
|
{
|
||||||
if ((sscanf(line,"%s%lf",upString,&UnderlinePosition)!=2) ||
|
if ((sscanf(line,"%s%lf",upString,&UnderlinePosition)!=2) ||
|
||||||
(wxStrcmp(upString,"UnderlinePosition")!=0))
|
(strcmp(upString,"UnderlinePosition")!=0))
|
||||||
{
|
{
|
||||||
wxLogDebug( wxT("AFM-file '%hs': line '%hs' has error (bad UnderlinePosition)\n"), afmName.c_str(), line );
|
wxLogDebug( wxT("AFM-file '%hs': line '%hs' has error (bad UnderlinePosition)\n"), afmName.c_str(), line );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* JC 2.) check for UnderlineThickness */
|
/* JC 2.) check for UnderlineThickness */
|
||||||
else if(wxStrncmp(line,"UnderlineThickness",18)==0)
|
else if(strncmp(line,"UnderlineThickness",18)==0)
|
||||||
{
|
{
|
||||||
if ((sscanf(line,"%s%lf",utString,&UnderlineThickness)!=2) ||
|
if ((sscanf(line,"%s%lf",utString,&UnderlineThickness)!=2) ||
|
||||||
(wxStrcmp(utString,"UnderlineThickness")!=0))
|
(strcmp(utString,"UnderlineThickness")!=0))
|
||||||
{
|
{
|
||||||
wxLogDebug( wxT("AFM-file '%hs': line '%hs' has error (bad UnderlineThickness)\n"), afmName.c_str(), line );
|
wxLogDebug( wxT("AFM-file '%hs': line '%hs' has error (bad UnderlineThickness)\n"), afmName.c_str(), line );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* JC 3.) check for EncodingScheme */
|
/* JC 3.) check for EncodingScheme */
|
||||||
else if(wxStrncmp(line,"EncodingScheme",14)==0)
|
else if(strncmp(line,"EncodingScheme",14)==0)
|
||||||
{
|
{
|
||||||
if ((sscanf(line,"%s%s",utString,encString)!=2) ||
|
if ((sscanf(line,"%s%s",utString,encString)!=2) ||
|
||||||
(wxStrcmp(utString,"EncodingScheme")!=0))
|
(strcmp(utString,"EncodingScheme")!=0))
|
||||||
{
|
{
|
||||||
wxLogDebug( wxT("AFM-file '%hs': line '%hs' has error (bad EncodingScheme)\n"), afmName.c_str(), line );
|
wxLogDebug( wxT("AFM-file '%hs': line '%hs' has error (bad EncodingScheme)\n"), afmName.c_str(), line );
|
||||||
}
|
}
|
||||||
else if (wxStrncmp(encString, "AdobeStandardEncoding", 21))
|
else if (strncmp(encString, "AdobeStandardEncoding", 21))
|
||||||
{
|
{
|
||||||
wxLogDebug( wxT("AFM-file '%hs': line '%hs' has error (unsupported EncodingScheme %hs)\n"),
|
wxLogDebug( wxT("AFM-file '%hs': line '%hs' has error (unsupported EncodingScheme %hs)\n"),
|
||||||
afmName.c_str(),line, encString);
|
afmName.c_str(),line, encString);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* B.) check for char-width */
|
/* B.) check for char-width */
|
||||||
else if(wxStrncmp(line,"C ",2)==0)
|
else if(strncmp(line,"C ",2)==0)
|
||||||
{
|
{
|
||||||
if (sscanf(line,"%s%d%s%s%d",cString,&ascii,semiString,WXString,&cWidth)!=5)
|
if (sscanf(line,"%s%d%s%s%d",cString,&ascii,semiString,WXString,&cWidth)!=5)
|
||||||
{
|
{
|
||||||
wxLogDebug(wxT("AFM-file '%hs': line '%hs' has an error (bad character width)\n"),afmName.c_str(),line);
|
wxLogDebug(wxT("AFM-file '%hs': line '%hs' has an error (bad character width)\n"),afmName.c_str(),line);
|
||||||
}
|
}
|
||||||
if(wxStrcmp(cString,"C")!=0 || wxStrcmp(semiString,";")!=0 || wxStrcmp(WXString,"WX")!=0)
|
if(strcmp(cString,"C")!=0 || strcmp(semiString,";")!=0 || strcmp(WXString,"WX")!=0)
|
||||||
{
|
{
|
||||||
wxLogDebug(wxT("AFM-file '%hs': line '%hs' has a format error\n"),afmName.c_str(),line);
|
wxLogDebug(wxT("AFM-file '%hs': line '%hs' has a format error\n"),afmName.c_str(),line);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user