From 8ccd98643a3b88aaa3245b76202666900a2cd401 Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Sun, 15 May 2016 14:28:21 +0200 Subject: Bug 675165 - Uses instead of html tag for SVG images --- src/htmldocvisitor.cpp | 42 ++++++++++++++++++++++++++++++++++-------- 1 file changed, 34 insertions(+), 8 deletions(-) diff --git a/src/htmldocvisitor.cpp b/src/htmldocvisitor.cpp index c6e0dee..b589f71 100644 --- a/src/htmldocvisitor.cpp +++ b/src/htmldocvisitor.cpp @@ -1312,7 +1312,7 @@ void HtmlDocVisitor::visitPre(DocHtmlTable *t) } else { - m_t << "attribs()) << ">\n"; + m_t << "attribs()) << ">\n"; } } @@ -1429,17 +1429,43 @@ void HtmlDocVisitor::visitPre(DocImage *img) } m_t << "
" << endl; QCString url = img->url(); + QCString sizeAttribs; + if (!img->width().isEmpty()) + { + sizeAttribs+=" width=\""+img->width()+"\""; + } + if (!img->height().isEmpty()) + { + sizeAttribs+=" height=\""+img->height()+"\""; + } if (url.isEmpty()) { - m_t << "relPath() << img->name() << "\" alt=\"" - << baseName << "\"" << htmlAttribsToString(img->attribs()) - << "/>" << endl; + if (img->name().right(4)==".svg") + { + m_t << "relPath() << img->name() + << "\"" << sizeAttribs << htmlAttribsToString(img->attribs()) << ">" << baseName + << "" << endl; + } + else + { + m_t << "relPath() << img->name() << "\" alt=\"" + << baseName << "\"" << sizeAttribs << htmlAttribsToString(img->attribs()) + << "/>" << endl; + } } else { - m_t << "relPath()) << "\" " - << htmlAttribsToString(img->attribs()) - << "/>" << endl; + if (url.right(4)==".svg") + { + m_t << "relPath()) + << "\"" << sizeAttribs << htmlAttribsToString(img->attribs()) << ">" << endl; + } + else + { + m_t << "relPath()) << "\"" + << sizeAttribs << htmlAttribsToString(img->attribs()) + << "/>" << endl; + } } if (img->hasCaption()) { @@ -1810,7 +1836,7 @@ void HtmlDocVisitor::visitPre(DocHtmlBlockQuote *b) } else { - m_t << "
attribs()) << ">\n"; + m_t << "attribs()) << ">\n"; } } -- cgit v0.12