TechDraw - Fix Annotation and Symbol international characters mangling
This commit is contained in:
committed by
WandererFan
parent
f5768441a6
commit
d54633183c
@@ -39,6 +39,7 @@
|
||||
#include <Base/Exception.h>
|
||||
#include <Base/FileInfo.h>
|
||||
#include <Base/Console.h>
|
||||
#include <Base/Tools.h>
|
||||
|
||||
#include "QDomNodeModel.h"
|
||||
#include "DrawUtil.h"
|
||||
@@ -102,7 +103,7 @@ void DrawViewSymbol::onChanged(const App::Property* prop)
|
||||
while (!queryResult.next().isNull())
|
||||
{
|
||||
QDomElement tspanElement = model.toDomNode(queryResult.current().toNodeModelIndex()).toElement();
|
||||
editables.push_back(tspanElement.text().toStdString());
|
||||
editables.push_back(Base::Tools::escapedUnicodeFromUtf8(tspanElement.text().toStdString().c_str()));
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -162,7 +163,8 @@ App::DocumentObjectExecReturn *DrawViewSymbol::execute(void)
|
||||
}
|
||||
|
||||
// Finally append text node with editable replacement as the only <tspan> descendant
|
||||
tspanElement.appendChild(symbolDocument.createTextNode(QString::fromUtf8(editText[count].c_str())));
|
||||
tspanElement.appendChild(symbolDocument.createTextNode(
|
||||
QString::fromUtf8(Base::Tools::escapedUnicodeToUtf8(editText[count]).c_str())));
|
||||
++count;
|
||||
}
|
||||
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
#include <App/Material.h>
|
||||
#include <Base/Console.h>
|
||||
#include <Base/Parameter.h>
|
||||
#include <Base/Tools.h>
|
||||
|
||||
#include <Mod/TechDraw/App/DrawViewAnnotation.h>
|
||||
#include "Rez.h"
|
||||
@@ -151,11 +152,10 @@ void QGIViewAnnotation::drawAnnotation()
|
||||
ss << "color:" << c.asCSSString() << "; ";
|
||||
ss << "}\n</style>\n</head>\n<body>\n<p>";
|
||||
for(std::vector<std::string>::const_iterator it = annoText.begin(); it != annoText.end(); it++) {
|
||||
if (it == annoText.begin()) {
|
||||
ss << *it;
|
||||
} else {
|
||||
ss << "<br>" << *it ;
|
||||
if (it != annoText.begin()) {
|
||||
ss << "<br>";
|
||||
}
|
||||
ss << Base::Tools::escapedUnicodeToUtf8(*it);
|
||||
}
|
||||
ss << "<br></p>\n</body>\n</html> ";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user