mirror of
https://github.com/gnustep/libs-gsweb.git
synced 2025-02-21 02:41:04 +00:00
Small fixes and optimizations
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@21155 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
7fa7771df6
commit
c1c4332dc8
11 changed files with 158 additions and 69 deletions
28
ChangeLog
28
ChangeLog
|
@ -1,3 +1,31 @@
|
|||
2005-04-24 Manuel Guesdon <mguesdon@orange-concept.com>
|
||||
* GSWeb.framework/GSWMessage.m:
|
||||
o fixed indentation and double ;;
|
||||
* GSWeb.framework/GSWPopUpButton.m:
|
||||
o fix in comments
|
||||
o fix output in -appendToResponse:inContext:
|
||||
o avoid string formatting
|
||||
* GSWeb.framework/GSWSessionTimeOut.m:
|
||||
o improved logs
|
||||
* GSWeb.framework/GSWTemplateParser.h
|
||||
o added +templateWithHTMLString:declarationString:languages:
|
||||
declaration
|
||||
* GSWeb.framework/GSWURLValuedElementData.m:
|
||||
o avoid string formatting
|
||||
* GSWeb.framework/GSWUtils.h:
|
||||
o replaced ClassIsKindOfClass() by GSObjCIsKindOf()
|
||||
* GSWeb.framework/GSWUtils.m:
|
||||
o removed ClassIsKindOfClass
|
||||
o fixed GSWTime_format()
|
||||
o implemented missing methods in NSFooNumberFormatter
|
||||
o avoid string formatting
|
||||
* GSWeb.framework/GSWSessionTimeOutManager.m:
|
||||
o use +logString: instead of +logWithFormat:
|
||||
* GSWeb.framework/NSString+HTML.m:
|
||||
o commented debug logs
|
||||
* GSWeb.framework/GSWResourceManager.m:
|
||||
o fixes for warnings
|
||||
|
||||
2005-04-24 Manuel Guesdon <mguesdon@orange-concept.com>
|
||||
* GSWeb.framework/GSWHyperlink.m:
|
||||
o removed -hrefInContext:
|
||||
|
|
|
@ -910,10 +910,10 @@ static __inline__ NSMutableData *_checkBody(GSWMessage *self) {
|
|||
// checking [aValue length] takes too long!
|
||||
if (aValue)
|
||||
{
|
||||
NSData* ad=[aValue dataUsingEncoding:NSASCIIStringEncoding
|
||||
allowLossyConversion:YES];;
|
||||
NSData* ad=[aValue dataUsingEncoding:NSASCIIStringEncoding
|
||||
allowLossyConversion:YES];
|
||||
|
||||
(*_contentDataADImp)(_contentData,appendDataSel,ad);
|
||||
(*_contentDataADImp)(_contentData,appendDataSel,ad);
|
||||
|
||||
#ifndef NO_GNUSTEP
|
||||
// Caching management
|
||||
|
@ -929,7 +929,7 @@ NSData* ad=[aValue dataUsingEncoding:NSASCIIStringEncoding
|
|||
int length = 0;
|
||||
int i = 0;
|
||||
int ch = 0;
|
||||
********
|
||||
|
||||
lossyCString = [aValue lossyCString];
|
||||
length = strlen(lossyCString);
|
||||
|
||||
|
|
|
@ -49,7 +49,10 @@ Bindings
|
|||
selection Selected object (used to pre-select item and modified to reflect user choice)
|
||||
It contains object from list, not value binding evaluated one !
|
||||
|
||||
selectedValue Array of pre selected values (not objects !)
|
||||
selectedValue Pre selected value (not object !)
|
||||
|
||||
selectionValue Selected value (used to pre-select item and modified to reflect user choice)
|
||||
It contains object from list, not value binding evaluated one !
|
||||
|
||||
name Name of the element in the form (should be unique). If not specified, GSWeb assign one.
|
||||
|
||||
|
@ -295,9 +298,9 @@ static SEL valueInComponentSEL = NULL;
|
|||
{
|
||||
GSWResponse_appendContentAsciiString(aResponse,@"\n<OPTION");
|
||||
if (_selectedValue && !selectedValueValue)
|
||||
GSWResponse_appendContentAsciiString(aResponse,@" selected>");//TODO
|
||||
GSWResponse_appendContentAsciiString(aResponse,@" selected value=\"\">");
|
||||
else
|
||||
GSWResponse_appendContentCharacter(aResponse,'>');
|
||||
GSWResponse_appendContentAsciiString(aResponse,@" value=\"\">");
|
||||
|
||||
if (escapeHTMLBoolValue)
|
||||
noSelectionStringValue=GSWResponse_stringByEscapingHTMLString(aResponse,noSelectionStringValue);
|
||||
|
@ -439,7 +442,8 @@ static SEL valueInComponentSEL = NULL;
|
|||
#ifndef ENABLE_OPTGROUP
|
||||
if (optGroupLabel)
|
||||
{
|
||||
displayStringValue=[NSString stringWithFormat:@"%@ --",displayStringValue];
|
||||
displayStringValue=NSStringWithObject(displayStringValue);
|
||||
displayStringValue=[displayStringValue stringByAppendingString:@" --"];
|
||||
};
|
||||
#endif
|
||||
GSWResponse_appendContentString(aResponse,displayStringValue);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/** GSWResourceManager.m - <title>GSWeb: Class GSWResourceManager</title>
|
||||
|
||||
Copyright (C) 1999-2004 Free Software Foundation, Inc.
|
||||
Copyright (C) 1999-2005 Free Software Foundation, Inc.
|
||||
|
||||
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||
Date: Jan 1999
|
||||
|
@ -711,12 +711,18 @@ NSString* localNotFoundMarker=@"NOTFOUND";
|
|||
inFramework:(NSString*)aFrameworkName
|
||||
language:(NSString*)aLanguage
|
||||
{
|
||||
//OK
|
||||
NSDictionary* stringsTable=nil;
|
||||
NSDictionary* stringsTablesForFramework=nil;
|
||||
NSDictionary* stringsTablesForFrameworkAndLanguage=nil;
|
||||
|
||||
LOGObjectFnStart();
|
||||
stringsTable=[[[_stringsTablesByFrameworkByLanguageByName objectForKey:aFrameworkName]
|
||||
objectForKey:aLanguage]
|
||||
objectForKey:aTableName];
|
||||
stringsTablesForFramework=[_stringsTablesByFrameworkByLanguageByName
|
||||
objectForKey:aFrameworkName];
|
||||
stringsTablesForFrameworkAndLanguage=[stringsTablesForFramework
|
||||
objectForKey:aLanguage];
|
||||
stringsTable=[stringsTablesForFrameworkAndLanguage
|
||||
objectForKey:aTableName];
|
||||
|
||||
if (!stringsTable)
|
||||
stringsTable=[self lockedStringsTableWithName:aTableName
|
||||
inFramework:aFrameworkName
|
||||
|
@ -739,12 +745,21 @@ NSString* localNotFoundMarker=@"NOTFOUND";
|
|||
inFramework:(NSString*)aFrameworkName
|
||||
language:(NSString*)aLanguage
|
||||
{
|
||||
//OK
|
||||
NSArray* stringsTableArray=nil;
|
||||
NSDictionary* stringsTableArraysForFramework=nil;
|
||||
NSDictionary* stringsTableArraysForFrameworkAndLanguage=nil;
|
||||
LOGObjectFnStart();
|
||||
stringsTableArray=[[[_stringsTableArraysByFrameworkByLanguageByName objectForKey:aFrameworkName]
|
||||
objectForKey:aLanguage]
|
||||
objectForKey:aTableName];
|
||||
|
||||
stringsTableArraysForFramework=
|
||||
[_stringsTableArraysByFrameworkByLanguageByName
|
||||
objectForKey:aFrameworkName];
|
||||
|
||||
stringsTableArraysForFrameworkAndLanguage=
|
||||
[stringsTableArraysForFramework objectForKey:aLanguage];
|
||||
|
||||
stringsTableArray=[stringsTableArraysForFrameworkAndLanguage
|
||||
objectForKey:aTableName];
|
||||
|
||||
if (!stringsTableArray)
|
||||
stringsTableArray=[self lockedStringsTableArrayWithName:aTableName
|
||||
inFramework:aFrameworkName
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/** GSWSessionTimeOut.m - <title>GSWeb: Class GSWSessionTimeOut</title>
|
||||
|
||||
Copyright (C) 1999-2003 Free Software Foundation, Inc.
|
||||
Copyright (C) 1999-2004 Free Software Foundation, Inc.
|
||||
|
||||
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||
Date: Mar 1999
|
||||
|
@ -48,8 +48,11 @@ RCS_ID("$Id$")
|
|||
ASSIGN(_sessionID,aSessionID);
|
||||
_lastAccessTime=aTime;
|
||||
_timeOut=aTimeOutInterval;
|
||||
NSDebugMLog(@"_lastAccessTime=%f",_lastAccessTime);
|
||||
NSDebugMLog(@"_timeOut=%f",_timeOut);
|
||||
NSDebugMLLog(@"sessions",@"_lastAccessTime=%f (%@)",
|
||||
_lastAccessTime,
|
||||
[NSDate dateWithTimeIntervalSinceReferenceDate:_lastAccessTime]);
|
||||
NSDebugMLLog(@"sessions",@"_timeOut=%f s",
|
||||
_timeOut);
|
||||
};
|
||||
return self;
|
||||
};
|
||||
|
@ -116,7 +119,8 @@ RCS_ID("$Id$")
|
|||
-(void)setSessionTimeOut:(NSTimeInterval)aTimeOutInterval
|
||||
{
|
||||
_timeOut=aTimeOutInterval;
|
||||
NSDebugMLog(@"_timeOut=%f",_timeOut);
|
||||
NSDebugMLLog(@"sessions",@"_timeOut=%f s",
|
||||
_timeOut);
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
@ -129,7 +133,9 @@ RCS_ID("$Id$")
|
|||
-(void)setLastAccessTime:(NSTimeInterval)aTime
|
||||
{
|
||||
_lastAccessTime=aTime;
|
||||
NSDebugMLog(@"_lastAccessTime=%f",_lastAccessTime);
|
||||
NSDebugMLLog(@"sessions",@"_lastAccessTime=%f (%@)",
|
||||
_lastAccessTime,
|
||||
[NSDate dateWithTimeIntervalSinceReferenceDate:_lastAccessTime]);
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
@ -156,11 +162,13 @@ RCS_ID("$Id$")
|
|||
return [NSDate dateWithTimeIntervalSinceReferenceDate:_lastAccessTime+_timeOut];
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
-(BOOL)isCheckedOut
|
||||
{
|
||||
return _isCheckedOut;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
-(void)setIsCheckedOut:(BOOL)isCheckOut
|
||||
{
|
||||
_isCheckedOut=isCheckOut;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/** GSWSessionTimeOutManager.m - <title>GSWeb: Class GSWSessionTimeOutManager</title>
|
||||
|
||||
Copyright (C) 1999-2004 Free Software Foundation, Inc.
|
||||
Copyright (C) 1999-2005 Free Software Foundation, Inc.
|
||||
|
||||
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||
Date: Mar 1999
|
||||
|
@ -130,17 +130,26 @@ RCS_ID("$Id$")
|
|||
{
|
||||
NSTimer* timer=nil;
|
||||
GSWSessionTimeOut* sessionTimeOut=nil;
|
||||
NSDebugMLLog(@"sessions",@"timeOut=%ld",(long)timeOut);
|
||||
|
||||
NSDebugMLLog(@"sessions",@"timeOut=%ld s",
|
||||
(long)timeOut);
|
||||
|
||||
sessionTimeOut=[self _sessionTimeOutForSessionID:sessionID];
|
||||
|
||||
NSDebugMLLog(@"sessions",@"sessionTimeOut=%@",sessionTimeOut);
|
||||
NSDebugMLLog(@"sessions",@"self=%p _sessionOrderedTimeOuts %p=%@",
|
||||
self,_sessionOrderedTimeOuts,_sessionOrderedTimeOuts);
|
||||
|
||||
NSAssert(sessionTimeOut,@"No sessionTimeOut");
|
||||
|
||||
[_sessionOrderedTimeOuts removeObject:sessionTimeOut];
|
||||
[sessionTimeOut setLastAccessTime:[NSDate timeIntervalSinceReferenceDate]];
|
||||
|
||||
[sessionTimeOut setLastAccessTime:
|
||||
[NSDate timeIntervalSinceReferenceDate]];
|
||||
|
||||
if (timeOut!=[sessionTimeOut sessionTimeOut])
|
||||
[sessionTimeOut setSessionTimeOut:timeOut];
|
||||
|
||||
[_sessionOrderedTimeOuts addObject:sessionTimeOut];
|
||||
|
||||
NSDebugMLLog(@"sessions",@"self=%p sessionOrderedTimeOuts %p=%@",
|
||||
|
@ -561,7 +570,7 @@ RCS_ID("$Id$")
|
|||
NSDebugMLLog(@"sessions",@"Start startHandleTimerRefusingSessions");
|
||||
|
||||
//NSLog(@"---Start startHandleTimerRefusingSessions");
|
||||
//[GSWApplication statusLogWithFormat:@"Start startHandleTimerRefusingSessions"];
|
||||
//[GSWApplication statusLogString:@"Start startHandleTimerRefusingSessions"];
|
||||
//LOGObjectFnStart();
|
||||
[self lock];
|
||||
/*
|
||||
|
@ -587,7 +596,7 @@ RCS_ID("$Id$")
|
|||
|
||||
[self unlock];
|
||||
//LOGObjectFnStop();
|
||||
//[GSWApplication statusLogWithFormat:@"Stop startHandleTimerRefusingSessions"];
|
||||
//[GSWApplication statusLogString:@"Stop startHandleTimerRefusingSessions"];
|
||||
//NSLog(@"---Stop startHandleTimerRefusingSessions");
|
||||
}
|
||||
|
||||
|
@ -611,7 +620,7 @@ RCS_ID("$Id$")
|
|||
NSDebugMLLog(@"sessions",@"timer tisn=%f",[[aTimer fireDate]timeIntervalSinceNow]);
|
||||
//OK
|
||||
//NSLog(@"-Start HandleTimerRefusingSessions");
|
||||
//[GSWApplication statusLogWithFormat:@"-Start HandleTimerRefusingSessions"];
|
||||
//[GSWApplication statusLogString:@"-Start HandleTimerRefusingSessions"];
|
||||
//[GSWApp lockRequestHandling];
|
||||
if ([self tryLockBeforeTimeIntervalSinceNow:1])//Try locking before 1s
|
||||
{
|
||||
|
@ -739,7 +748,7 @@ RCS_ID("$Id$")
|
|||
};
|
||||
|
||||
//[GSWApp unlockRequestHandling];
|
||||
//[GSWApplication statusLogWithFormat:@"-Stop HandleTimerRefusingSessions"];
|
||||
//[GSWApplication statusLogString:@"-Stop HandleTimerRefusingSessions"];
|
||||
//NSLog(@"-Stop HandleTimerRefusingSessions");
|
||||
};
|
||||
|
||||
|
|
|
@ -174,6 +174,11 @@ Creates a GSWHTMLComment with the comment text
|
|||
declarationsPath:(NSString*)aDeclarationsPath;
|
||||
+(GSWTemplateParserType)templateParserTypeFromString:(NSString*)string;
|
||||
+(GSWTemplateParserType)defaultTemplateParserType;
|
||||
|
||||
+(GSWElement*)templateWithHTMLString:(NSString *)HTMLString
|
||||
declarationString:(NSString *)declarationsString
|
||||
languages:(NSArray *)languages;
|
||||
|
||||
-(id)initWithTemplateName:(NSString*)aName
|
||||
inFrameworkName:(NSString*)aFrameworkName
|
||||
withString:(NSString*)HTMLString
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/** GSWURLValuedElementData.m - <title>GSWeb: Class GSWURLValuedElementData</title>
|
||||
|
||||
Copyright (C) 1999-2003 Free Software Foundation, Inc.
|
||||
Copyright (C) 1999-2005 Free Software Foundation, Inc.
|
||||
|
||||
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||
Date: Jan 1999
|
||||
|
@ -110,7 +110,7 @@ RCS_ID("$Id$")
|
|||
}
|
||||
else
|
||||
[response setContent:data];
|
||||
[response setHeader:[NSString stringWithFormat:@"%u",[data length]]
|
||||
[response setHeader:GSWIntToNSString((int)[data length])
|
||||
forKey:@"content-length"];
|
||||
|
||||
[response setHeader:_mimeType
|
||||
|
|
|
@ -85,7 +85,7 @@ GSWEB_EXPORT char* GSWIntToString(char* buffer,unsigned int bufferSize,int value
|
|||
GSWEB_EXPORT NSString* GSWIntToNSString(int value);
|
||||
GSWEB_EXPORT NSNumber* GSWIntNumber(int value);
|
||||
|
||||
GSWEB_EXPORT BOOL ClassIsKindOfClass(Class classA,Class classB);
|
||||
#define ClassIsKindOfClass(classA,classB) GSObjCIsKindOf(classA,classB)
|
||||
|
||||
typedef long long GSWTime; // usec since Epoch
|
||||
|
||||
|
|
|
@ -254,20 +254,6 @@ NSNumber* GSWIntNumber(int value)
|
|||
return (*numberWithIntIMP)(nsNumberClass,numberWithIntSEL,value);
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
BOOL ClassIsKindOfClass(Class classA,Class classB)
|
||||
{
|
||||
Class class;
|
||||
for (class = classA;
|
||||
class != Nil;
|
||||
class = class_get_super_class (class))
|
||||
{
|
||||
if (class == classB)
|
||||
return YES;
|
||||
}
|
||||
return NO;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
GSWTime GSWTime_now()
|
||||
{
|
||||
|
@ -332,9 +318,9 @@ NSString* GSWTime_format(GSWTime t)
|
|||
sDate[17] = stTM.tm_sec / 10 + '0';
|
||||
sDate[18] = stTM.tm_sec % 10 + '0';
|
||||
sDate[19] = '.';
|
||||
sDate[20] = (timeMSecPart/1000) / 100 + '0';
|
||||
sDate[21] = ((timeMSecPart/1000) % 100) / 10 + '0';
|
||||
sDate[22] = (timeMSecPart/1000) % 10 + '0';
|
||||
sDate[20] = timeMSecPart / 100 + '0';
|
||||
sDate[21] = (timeMSecPart % 100) / 10 + '0';
|
||||
sDate[22] = timeMSecPart % 10 + '0';
|
||||
|
||||
sDate[23] = 0;
|
||||
return (*nsString_stringWithCString_lengthIMP)(nsStringClass,stringWithCString_lengthSEL,
|
||||
|
@ -1861,6 +1847,34 @@ NSString* GSWGetDefaultDocRoot()
|
|||
return self;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
-(id)copyWithZone:(NSZone*)zone
|
||||
{
|
||||
NSFooNumberFormatter* clone = [[isa allocWithZone:zone] init];
|
||||
if (clone)
|
||||
{
|
||||
clone->_type=_type;
|
||||
};
|
||||
return clone;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
-(void)encodeWithCoder:(NSCoder*)coder
|
||||
{
|
||||
[super encodeWithCoder:coder];
|
||||
[coder encodeValueOfObjCType: @encode(int) at: &_type];
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
-(id)initWithCoder: (NSCoder*)coder
|
||||
{
|
||||
if (([super initWithCoder:coder]))
|
||||
{
|
||||
[coder decodeValueOfObjCType: @encode(int) at: &_type];
|
||||
};
|
||||
return self;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
-(NSString*)stringForObjectValue:(id)anObject
|
||||
{
|
||||
|
@ -1909,7 +1923,7 @@ NSString* GSWGetDefaultDocRoot()
|
|||
else if ([anObject respondsToSelector:@selector(intValue)])
|
||||
{
|
||||
int value=[anObject intValue];
|
||||
string=(*nsString_stringWithFormatIMP)(nsStringClass,stringWithFormatSEL,@"%d.00",value);
|
||||
string=[GSWIntToNSString(value) stringByAppendingString:@".00"];
|
||||
}
|
||||
else if ([anObject respondsToSelector:@selector(floatValue)])
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/** NSString+HTML.m - <title>GSWeb: NSString / HTML</title>
|
||||
|
||||
Copyright (C) 1999-2004 Free Software Foundation, Inc.
|
||||
Copyright (C) 1999-2005 Free Software Foundation, Inc.
|
||||
|
||||
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||
Date: Jan 1999
|
||||
|
@ -368,12 +368,12 @@ NSString* baseStringByConvertingToHTML(NSString* string,GSWHTMLConvertingStruct*
|
|||
int allocMargin=max(128,length/2);
|
||||
allocOrReallocUnicharString(&pString,&capacity,0,length+1+allocMargin);
|
||||
[string getCharacters:pString];
|
||||
NSDebugFLog(@"string=%@",string);
|
||||
//NSDebugFLog(@"string=%@",string);
|
||||
while(i<length)
|
||||
{
|
||||
srcLen=0;
|
||||
unichar c=pString[i];
|
||||
NSDebugFLog(@"i=%d: c=%c",i,(char)c);
|
||||
//NSDebugFLog(@"i=%d: c=%c",i,(char)c);
|
||||
if (includeCRLF && c=='\r')
|
||||
{
|
||||
if (i<(length-1)
|
||||
|
@ -411,25 +411,25 @@ NSString* baseStringByConvertingToHTML(NSString* string,GSWHTMLConvertingStruct*
|
|||
};
|
||||
if (srcLen>0)
|
||||
{
|
||||
NSDebugFLog(@"i=%d j=%d: srcLen=%d dstLen=%d by '%@'",i,j,srcLen,dstLen,[NSString stringWithCharacters:dstChars
|
||||
length:dstLen]);
|
||||
/*NSDebugFLog(@"i=%d j=%d: srcLen=%d dstLen=%d by '%@'",i,j,srcLen,dstLen,[NSString stringWithCharacters:dstChars
|
||||
length:dstLen]);*/
|
||||
changed=YES;
|
||||
NSDebugFLog(@"-1==> %@",[NSString stringWithCharacters:pString
|
||||
length:length]);
|
||||
/*NSDebugFLog(@"-1==> %@",[NSString stringWithCharacters:pString
|
||||
length:length]);*/
|
||||
if (length+1+dstLen-srcLen>capacity)
|
||||
allocOrReallocUnicharString(&pString,&capacity,length,capacity+allocMargin);
|
||||
NSDebugFLog(@"0==> %@",[NSString stringWithCharacters:pString
|
||||
/*NSDebugFLog(@"0==> %@",[NSString stringWithCharacters:pString
|
||||
length:length]);
|
||||
NSDebugFLog(@"Copy %d characters from pos %d to pos %d",(length-i-srcLen),i+srcLen,i+dstLen);
|
||||
NSDebugFLog(@"Copy %d characters from pos %d to pos %d",(length-i-srcLen),i+srcLen,i+dstLen);*/
|
||||
GSWMemMove(pString+i+dstLen,pString+i+srcLen,sizeof(unichar)*(length-i-srcLen));
|
||||
NSDebugFLog(@"1==> %@",[NSString stringWithCharacters:pString
|
||||
/*NSDebugFLog(@"1==> %@",[NSString stringWithCharacters:pString
|
||||
length:length+dstLen-srcLen]);
|
||||
NSDebugFLog(@"Copy %d characters to pos %d",dstLen,i);
|
||||
NSDebugFLog(@"Copy %d characters to pos %d",dstLen,i);*/
|
||||
GSWMemMove(pString+i,dstChars,sizeof(unichar)*dstLen);
|
||||
i+=dstLen;
|
||||
length+=dstLen-srcLen;
|
||||
NSDebugFLog(@"2==> i=%d length=%d %@",i,length,[NSString stringWithCharacters:pString
|
||||
length:length]);
|
||||
/*NSDebugFLog(@"2==> i=%d length=%d %@",i,length,[NSString stringWithCharacters:pString
|
||||
length:length]);*/
|
||||
|
||||
}
|
||||
else
|
||||
|
@ -532,12 +532,12 @@ NSString* baseStringByConvertingFromHTML(NSString* string,GSWHTMLConvertingStruc
|
|||
int i=0;
|
||||
int j=0;
|
||||
[string getCharacters:pString];
|
||||
NSDebugFLog(@"string=%@",string);
|
||||
//NSDebugFLog(@"string=%@",string);
|
||||
while(i<(length-2)) // at least 2 characters for html coded
|
||||
{
|
||||
srcLen=0;
|
||||
NSDebugFLog(@"i=%d: c=%@",i,[NSString stringWithCharacters:pString+i
|
||||
length:length-i]);
|
||||
/*NSDebugFLog(@"i=%d: c=%@",i,[NSString stringWithCharacters:pString+i
|
||||
length:length-i]);*/
|
||||
if (includeBR
|
||||
&& length-i>=unicodeBRLen
|
||||
&& areUnicharEquals(pString+i,unicodeBR,unicodeBRLen))
|
||||
|
@ -562,23 +562,29 @@ NSString* baseStringByConvertingFromHTML(NSString* string,GSWHTMLConvertingStruc
|
|||
};
|
||||
if (srcLen>0)
|
||||
{
|
||||
NSDebugFLog(@"i=%d j=%d: srcLen=%d dstLen=%d by '%@'",i,j,srcLen,dstLen,[NSString stringWithCharacters:&dstUnichar
|
||||
length:dstLen]);
|
||||
/*NSDebugFLog(@"i=%d j=%d: srcLen=%d dstLen=%d by '%@'",i,j,srcLen,dstLen,[NSString stringWithCharacters:&dstUnichar
|
||||
length:dstLen]);*/
|
||||
changed=YES;
|
||||
/*
|
||||
NSDebugFLog(@"-1==> %@",[NSString stringWithCharacters:pString
|
||||
length:length]);
|
||||
NSDebugFLog(@"0==> %@",[NSString stringWithCharacters:pString
|
||||
length:length]);
|
||||
NSDebugFLog(@"Copy %d characters from pos %d to pos %d",(length-i-srcLen),i+srcLen,i+dstLen);
|
||||
*/
|
||||
GSWMemMove(pString+i+dstLen,pString+i+srcLen,sizeof(unichar)*(length-i-srcLen));
|
||||
/*
|
||||
NSDebugFLog(@"1==> %@",[NSString stringWithCharacters:pString
|
||||
length:length+dstLen-srcLen]);
|
||||
NSDebugFLog(@"Copy %d characters to pos %d",dstLen,i);
|
||||
*/
|
||||
GSWMemMove(pString+i,&dstUnichar,sizeof(unichar)*dstLen);
|
||||
i+=dstLen;
|
||||
length+=dstLen-srcLen;
|
||||
/*
|
||||
NSDebugFLog(@"2==> i=%d %@",i,[NSString stringWithCharacters:pString
|
||||
length:length]);
|
||||
length:length]);
|
||||
*/
|
||||
};
|
||||
if (srcLen==0)
|
||||
i++;
|
||||
|
|
Loading…
Reference in a new issue