|
|
@@ -673,7 +673,8 @@ void TextFeld::addLineBreaks(const char* spacing)
|
|
|
setFormattedText(addLineBreaksToText(tm->text->getText(), spacing));
|
|
|
}
|
|
|
|
|
|
-Text TextFeld::addLineBreaksToText(const char* txt, const char* spacing) const
|
|
|
+Text TextFeld::addLineBreaksToText(
|
|
|
+ const char* txt, const char* spacing, bool includeFormat) const
|
|
|
{
|
|
|
int lastPos = -1;
|
|
|
int lastPos2 = -1;
|
|
|
@@ -695,48 +696,49 @@ Text TextFeld::addLineBreaksToText(const char* txt, const char* spacing) const
|
|
|
last.rendererIndex = 0;
|
|
|
for (int i = 0; i < len; ++i)
|
|
|
{
|
|
|
- if (last.fontSize != tm->current.fontSize)
|
|
|
+ if (last.fontSize != tm->current.fontSize && includeFormat)
|
|
|
{
|
|
|
Text param("\x2");
|
|
|
param.appendHex((char)tm->current.fontSize);
|
|
|
result += param;
|
|
|
last.fontSize = tm->current.fontSize;
|
|
|
}
|
|
|
- if (last.fontColor != tm->current.fontColor)
|
|
|
+ if (last.fontColor != tm->current.fontColor && includeFormat)
|
|
|
{
|
|
|
Text param("\x3");
|
|
|
param.appendHex(tm->current.fontColor);
|
|
|
result += param;
|
|
|
last.fontColor = tm->current.fontColor;
|
|
|
}
|
|
|
- if (last.selectedColor != tm->current.selectedColor)
|
|
|
+ if (last.selectedColor != tm->current.selectedColor && includeFormat)
|
|
|
{
|
|
|
Text param("\x4");
|
|
|
param.appendHex(tm->current.selectedColor);
|
|
|
result += param;
|
|
|
last.selectedColor = tm->current.selectedColor;
|
|
|
}
|
|
|
- if (last.selectedBackcroundColor != tm->current.selectedBackcroundColor)
|
|
|
+ if (last.selectedBackcroundColor != tm->current.selectedBackcroundColor
|
|
|
+ && includeFormat)
|
|
|
{
|
|
|
Text param("\x5");
|
|
|
param.appendHex(tm->current.selectedBackcroundColor);
|
|
|
result += param;
|
|
|
last.selectedBackcroundColor = tm->current.selectedBackcroundColor;
|
|
|
}
|
|
|
- if (last.underlined != tm->current.underlined)
|
|
|
+ if (last.underlined != tm->current.underlined && includeFormat)
|
|
|
{
|
|
|
char tmp[2] = {tm->current.underlined ? (char)1 : (char)7, 0};
|
|
|
result += tmp;
|
|
|
last.underlined = tm->current.underlined;
|
|
|
}
|
|
|
- if (last.interactParam != tm->current.interactParam)
|
|
|
+ if (last.interactParam != tm->current.interactParam && includeFormat)
|
|
|
{
|
|
|
Text param("\x8");
|
|
|
param.appendHex(tm->current.interactParam);
|
|
|
result += param;
|
|
|
last.interactParam = tm->current.interactParam;
|
|
|
}
|
|
|
- if (last.rendererIndex != tm->current.rendererIndex)
|
|
|
+ if (last.rendererIndex != tm->current.rendererIndex && includeFormat)
|
|
|
{
|
|
|
Text param("\x6");
|
|
|
param.appendHex((char)tm->current.rendererIndex);
|
|
|
@@ -1510,7 +1512,8 @@ void TextFeld::render(Bild& zRObj) // zeichenet nach zRObj
|
|
|
if (hatStyle(Style::AutoLineBreak))
|
|
|
{
|
|
|
txtWithLineBreaks = addLineBreaksToText(tm->text->getText(),
|
|
|
- autoLineBreakSpacing ? autoLineBreakSpacing->getText() : "");
|
|
|
+ autoLineBreakSpacing ? autoLineBreakSpacing->getText() : "",
|
|
|
+ 0);
|
|
|
text = txtWithLineBreaks;
|
|
|
len = txtWithLineBreaks.getLength();
|
|
|
}
|