void Selection::closeShape() { if(!m_closedPolygon) { m_closedPolygon = true; saveShape(); emit closed(); } }
bool SvgWriter::save(QIODevice &outputDevice) { if (m_toplevelShapes.isEmpty()) return false; QTextStream svgStream(&outputDevice); // standard header: svgStream << "<?xml version=\"1.0\" standalone=\"no\"?>" << endl; svgStream << "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 20010904//EN\" "; svgStream << "\"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd\">" << endl; // add some PR. one line is more than enough. svgStream << "<!-- Created using Karbon, part of Calligra: http://www.calligra.org/karbon -->" << endl; svgStream << "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\""; svgStream << " width=\"" << m_pageSize.width() << "pt\""; svgStream << " height=\"" << m_pageSize.height() << "pt\">" << endl; { SvgSavingContext savingContext(outputDevice, m_writeInlineImages); // top level shapes Q_FOREACH (KoShape *shape, m_toplevelShapes) { KoShapeLayer *layer = dynamic_cast<KoShapeLayer*>(shape); if(layer) { saveLayer(layer, savingContext); } else { KoShapeGroup *group = dynamic_cast<KoShapeGroup*>(shape); if (group) saveGroup(group, savingContext); else saveShape(shape, savingContext); } } }