Handle non-latin1 chars in template

This commit is contained in:
WandererFan
2016-08-10 15:54:41 -04:00
committed by wmayer
parent 6ad50696b9
commit 3eb9037ada
5 changed files with 12 additions and 26 deletions

View File

@@ -65,7 +65,6 @@ QGISVGTemplate::QGISVGTemplate(QGraphicsScene *scene, QWidget* srWidget)
QGISVGTemplate::~QGISVGTemplate()
{
clearContents();
delete m_svgRender;
}
@@ -76,15 +75,6 @@ QVariant QGISVGTemplate::itemChange(GraphicsItemChange change,
}
void QGISVGTemplate::clearContents()
{
for (std::vector<TemplateTextField *>::iterator it = textFields.begin();
it != textFields.end(); ++it) {
delete *it;
}
textFields.clear();
}
void QGISVGTemplate::openFile(const QFile &file)
{
@@ -92,8 +82,6 @@ void QGISVGTemplate::openFile(const QFile &file)
void QGISVGTemplate::load(const QString &fileName)
{
clearContents();
if (fileName.isEmpty()){
return;
}
@@ -105,13 +93,11 @@ void QGISVGTemplate::load(const QString &fileName)
m_svgRender->load(file.fileName());
QSize size = m_svgRender->defaultSize();
//Base::Console().Log("size of svg document <%i,%i>", size.width(), size.height());
m_svgItem->setSharedRenderer(m_svgRender);
TechDraw::DrawSVGTemplate *tmplte = getSVGTemplate();
//std::string temp = tmplte->Template.getValue();
std::string temp = tmplte->PageResult.getValue(); //fixes non-drawing of restored template
if (temp.empty())
return;