mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-23 08:19:57 -05:00
Fix Indent in Chat Message
This commit is contained in:
parent
ad1672a0a4
commit
0a9f7882a5
@ -31,6 +31,8 @@
|
|||||||
#include "gui/RetroShareLink.h"
|
#include "gui/RetroShareLink.h"
|
||||||
#include "util/ObjectPainter.h"
|
#include "util/ObjectPainter.h"
|
||||||
#include "util/imageutil.h"
|
#include "util/imageutil.h"
|
||||||
|
|
||||||
|
#include "util/rsdebug.h"
|
||||||
#include "util/rstime.h"
|
#include "util/rstime.h"
|
||||||
|
|
||||||
#ifdef USE_CMARK
|
#ifdef USE_CMARK
|
||||||
@ -40,6 +42,8 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
//#define DEBUG_SAVESPACE 1
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The type of embedding we'd like to do
|
* The type of embedding we'd like to do
|
||||||
*/
|
*/
|
||||||
@ -554,17 +558,23 @@ static QString saveSpace(const QString text)
|
|||||||
if(cursChar==QLatin1Char('>')) {
|
if(cursChar==QLatin1Char('>')) {
|
||||||
if(!echapChar && i>0) {outBrackets=true; firstOutBracket=true;}
|
if(!echapChar && i>0) {outBrackets=true; firstOutBracket=true;}
|
||||||
} else if(cursChar==QLatin1Char('\t')) {
|
} else if(cursChar==QLatin1Char('\t')) {
|
||||||
if(outBrackets && firstOutBracket && (keyName!="style")) savedSpaceText.replace(i, 1, " ");
|
if(outBrackets && firstOutBracket && (keyName!="style")) { savedSpaceText.replace(i, 1, " "); i+= 11; }
|
||||||
} else if(cursChar==QLatin1Char(' ')) {
|
} else if(cursChar==QLatin1Char(' ')) {
|
||||||
if(outBrackets && firstOutBracket && (keyName!="style")) savedSpaceText.replace(i, 1, " ");
|
if(outBrackets && firstOutBracket && (keyName!="style")) { savedSpaceText.replace(i, 1, " "); i+= 5; }
|
||||||
} else if(cursChar==QChar(0xA0)) {
|
} else if(cursChar==QChar(0xA0)) {
|
||||||
if(outBrackets && firstOutBracket && (keyName!="style")) savedSpaceText.replace(i, 1, " ");
|
if(outBrackets && firstOutBracket && (keyName!="style")) { savedSpaceText.replace(i, 1, " "); i+= 5; }
|
||||||
} else if(cursChar==QLatin1Char('<')) {
|
} else if(cursChar==QLatin1Char('<')) {
|
||||||
if(!echapChar) {outBrackets=false; getKeyName=true; keyName.clear();}
|
if(!echapChar) {outBrackets=false; getKeyName=true; keyName.clear();}
|
||||||
} else firstOutBracket=false;
|
} else firstOutBracket=false;
|
||||||
echapChar=(cursChar==QLatin1Char('\\'));
|
echapChar=(cursChar==QLatin1Char('\\'));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
#ifdef DEBUG_SAVESPACE
|
||||||
|
RsDbg() << __PRETTY_FUNCTION__ << "Text to save:" << std::endl
|
||||||
|
<< text.toStdString() << std::endl
|
||||||
|
<< "---------------------- Saved Text:" << std::endl
|
||||||
|
<< savedSpaceText.toStdString() << std::endl;
|
||||||
|
#endif
|
||||||
|
|
||||||
return savedSpaceText;
|
return savedSpaceText;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user