Changeset View
Changeset View
Standalone View
Standalone View
libs/flake/svg/SvgWriter.cpp
Show First 20 Lines • Show All 113 Lines • ▼ Show 20 Line(s) | 95 | { | |||
---|---|---|---|---|---|
114 | svgStream << " xmlns:sodipodi=\"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd\"\n"; | 114 | svgStream << " xmlns:sodipodi=\"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd\"\n"; | ||
115 | svgStream << " width=\"" << pageSize.width() << "pt\"\n"; | 115 | svgStream << " width=\"" << pageSize.width() << "pt\"\n"; | ||
116 | svgStream << " height=\"" << pageSize.height() << "pt\"\n"; | 116 | svgStream << " height=\"" << pageSize.height() << "pt\"\n"; | ||
117 | svgStream << " viewBox=\"0 0 " | 117 | svgStream << " viewBox=\"0 0 " | ||
118 | << pageSize.width() << " " << pageSize.height() | 118 | << pageSize.width() << " " << pageSize.height() | ||
119 | << "\""; | 119 | << "\""; | ||
120 | svgStream << ">" << endl; | 120 | svgStream << ">" << endl; | ||
121 | 121 | | |||
122 | if (!m_documentTitle.isNull() && !m_documentTitle.isEmpty()) { | ||||
123 | svgStream << "<title>" << m_documentTitle << "</title>" << endl; | ||||
124 | } | ||||
125 | | ||||
126 | if (!m_documentDescription.isNull() && !m_documentDescription.isEmpty()) { | ||||
127 | svgStream << "<desc>" << m_documentDescription << "</desc>" << endl; | ||||
128 | } | ||||
129 | | ||||
122 | { | 130 | { | ||
123 | SvgSavingContext savingContext(outputDevice, m_writeInlineImages); | 131 | SvgSavingContext savingContext(outputDevice, m_writeInlineImages); | ||
124 | saveShapes(m_toplevelShapes, savingContext); | 132 | saveShapes(m_toplevelShapes, savingContext); | ||
125 | } | 133 | } | ||
126 | 134 | | |||
127 | // end tag: | 135 | // end tag: | ||
128 | svgStream << endl << "</svg>" << endl; | 136 | svgStream << endl << "</svg>" << endl; | ||
129 | 137 | | |||
▲ Show 20 Lines • Show All 165 Lines • ▼ Show 20 Line(s) | 250 | { | |||
295 | 303 | | |||
296 | } else { | 304 | } else { | ||
297 | context.shapeWriter().addCompleteElement(&svgBuffer); | 305 | context.shapeWriter().addCompleteElement(&svgBuffer); | ||
298 | } | 306 | } | ||
299 | 307 | | |||
300 | // TODO: once we support saving single (flat) odf files | 308 | // TODO: once we support saving single (flat) odf files | ||
301 | // we can embed these here to have full support for generic shapes | 309 | // we can embed these here to have full support for generic shapes | ||
302 | } | 310 | } | ||
311 | | ||||
312 | void SvgWriter::setDocumentTitle(QString title) | ||||
313 | { | ||||
314 | m_documentTitle = title; | ||||
315 | } | ||||
316 | | ||||
317 | void SvgWriter::setDocumentDescription(QString description) | ||||
318 | { | ||||
319 | m_documentDescription = description; | ||||
320 | } | ||||
321 | |