Added Phenom's Patch Fix_NonBreakingSpace_0.6_7480.patch

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7486 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2014-08-07 23:07:16 +00:00
parent 9f1f08b332
commit ff366f0ec2

View File

@ -345,7 +345,8 @@ static QString saveSpace(const QString text)
bool outBrackets=false, echapChar=false;
QString keyName = "";
bool getKeyName = false;
bool firstOutBracket = false;
for(int i=0;i<savedSpaceText.length();i++){
QChar cursChar=savedSpaceText.at(i);
@ -356,20 +357,20 @@ static QString saveSpace(const QString text)
keyName.append(cursChar.toLower());
}
}
if(cursChar==QLatin1Char('>')) {
if(!echapChar && i>0) outBrackets=true;
} else if(cursChar==QLatin1Char('\t')) {
if(outBrackets && (keyName!="style")) savedSpaceText.replace(i, 1, "&nbsp;&nbsp;");
if(!echapChar && i>0) {outBrackets=true; firstOutBracket=true;}
} else if(cursChar==QLatin1Char('\t')) {
if(outBrackets && firstOutBracket && (keyName!="style")) savedSpaceText.replace(i, 1, "&nbsp;&nbsp;");
} else if(cursChar==QLatin1Char(' ')) {
if(outBrackets && (keyName!="style")) savedSpaceText.replace(i, 1, "&nbsp;");
if(outBrackets && firstOutBracket && (keyName!="style")) savedSpaceText.replace(i, 1, "&nbsp;");
} else if(cursChar==QChar(0xA0)) {
if(outBrackets && (keyName!="style")) savedSpaceText.replace(i, 1, "&nbsp;");
if(outBrackets && firstOutBracket && (keyName!="style")) savedSpaceText.replace(i, 1, "&nbsp;");
} else if(cursChar==QLatin1Char('<')) {
if(!echapChar) {outBrackets=false; getKeyName=true; keyName.clear();}
}
} else firstOutBracket=false;
echapChar=(cursChar==QLatin1Char('\\'));
}
return savedSpaceText;