aboutsummaryrefslogtreecommitdiff
path: root/src/courtroom.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/courtroom.cpp')
-rw-r--r--src/courtroom.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/courtroom.cpp b/src/courtroom.cpp
index ee744a8..e368a32 100644
--- a/src/courtroom.cpp
+++ b/src/courtroom.cpp
@@ -2023,19 +2023,28 @@ QString Courtroom::filter_ic_text(QString p_text, bool html, int target_pos, int
if (p_text.trimmed().startsWith("~~"))
{
p_text.remove(p_text.indexOf("~~"), 2);
- target_pos -= 2;
+ if (target_pos != -1)
+ {
+ target_pos = qMax(0, target_pos - 2);
+ }
align = "center";
}
else if (p_text.trimmed().startsWith("~>"))
{
p_text.remove(p_text.indexOf("~>"), 2);
- target_pos -= 2;
+ if (target_pos != -1)
+ {
+ target_pos = qMax(0, target_pos - 2);
+ }
align = "right";
}
else if (p_text.trimmed().startsWith("<>"))
{
p_text.remove(p_text.indexOf("<>"), 2);
- target_pos -= 2;
+ if (target_pos != -1)
+ {
+ target_pos = qMax(0, target_pos - 2);
+ }
align = "justify";
}