From ff366f0ec2bcc3fc716a1d8c12d26e205825491b Mon Sep 17 00:00:00 2001 From: defnax Date: Thu, 7 Aug 2014 23:07:16 +0000 Subject: [PATCH] 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 --- retroshare-gui/src/util/HandleRichText.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/retroshare-gui/src/util/HandleRichText.cpp b/retroshare-gui/src/util/HandleRichText.cpp index 86ae22a50..6ef9ebc81 100644 --- a/retroshare-gui/src/util/HandleRichText.cpp +++ b/retroshare-gui/src/util/HandleRichText.cpp @@ -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')) { - if(!echapChar && i>0) outBrackets=true; - } else if(cursChar==QLatin1Char('\t')) { - if(outBrackets && (keyName!="style")) savedSpaceText.replace(i, 1, "  "); + if(!echapChar && i>0) {outBrackets=true; firstOutBracket=true;} + } else if(cursChar==QLatin1Char('\t')) { + if(outBrackets && firstOutBracket && (keyName!="style")) savedSpaceText.replace(i, 1, "  "); } else if(cursChar==QLatin1Char(' ')) { - if(outBrackets && (keyName!="style")) savedSpaceText.replace(i, 1, " "); + if(outBrackets && firstOutBracket && (keyName!="style")) savedSpaceText.replace(i, 1, " "); } else if(cursChar==QChar(0xA0)) { - if(outBrackets && (keyName!="style")) savedSpaceText.replace(i, 1, " "); + if(outBrackets && firstOutBracket && (keyName!="style")) savedSpaceText.replace(i, 1, " "); } else if(cursChar==QLatin1Char('<')) { if(!echapChar) {outBrackets=false; getKeyName=true; keyName.clear();} - } + } else firstOutBracket=false; echapChar=(cursChar==QLatin1Char('\\')); - + } return savedSpaceText;