When I order a "List of entities" ("Plugins", "List entities"),
I´d like to see the text contents of a MTEXT or TEXT:
n 163: MTEXT
Layer: 0
Color: BYLAYER
Line type: BYLAYER
Line thickness: BYLAYER
Text : "THIS\r\nIS\r\nA\r\nTEST!" ID: 26405563
\r is CR
\n is LF
\t is TAB
\" is "
From what I´ve seen, changes should be made on "list.cpp":
case DPI::MTEXT:
strData.prepend( strEntity.arg(tr("MTEXT")));
strData.append( um... err..... strCommon.arg(tr("Text")).arg( safe_string(data.value(text).toString()) ); ????
break;
case DPI::TEXT:
strData.prepend( strEntity.arg(tr("TEXT")));
strData.append( um... err..... strCommon.arg(tr("Text")).arg( safe_string(data.value(text).toString()) ); ????
break;
QString safe_string(QString src)
{
QString result = "";
char tmp[8];
for (int i=0; i<src.length; i++)
{
char c = src[i];
if (c < 32)
{
switch (c)
{
case '\r':
result += "\\r"; // Add \r
break;
case '\n':
result += "\\n"; // Add \n
break;
case '\t':
result += "\\t"; // Add \t
break;
default:
sprintf(tmp, "\\%02X", c); // Add \00, \01, ...
result += tmp;
break;
}
}
else
{
switch (c)
{
case '\\':
result += "\\\\"; // Add \\
break;
case '"':
result += "\\\""; // Add \"
break;
default:
result += c;
break;
}
}
}
return result;
}
This suggestion is posted in:
https://sourceforge.net/p/librecad/feature-requests/http://librecad.org/cms/home/get-help/forum.html (suggestions & feedback)