From: Fridrich S. <str...@us...> - 2010-06-17 11:18:22
|
Update of /cvsroot/libwpg/perfectspot/src In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv16896/src Modified Files: renderer.cpp Log Message: Some more improvements of writerperfect Index: renderer.cpp =================================================================== RCS file: /cvsroot/libwpg/perfectspot/src/renderer.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- renderer.cpp 17 Jun 2010 10:51:00 -0000 1.22 +++ renderer.cpp 17 Jun 2010 11:18:13 -0000 1.23 @@ -63,23 +63,23 @@ d->stream = new ::WPXStringStream(data, size); if (d->stream && d->stream->isOLEStream()) { - WPXInputStream *tempStream = d->stream->getDocumentOLEStream("PerfectOffice_MAIN"); - if (tempStream) - { - delete d->stream; - d->stream = tempStream; - } - } - - // to know the default WPG size - QImage buffer(500, 500, QImage::Format_ARGB32); - QPainter bufp(&buffer); + WPXInputStream *tempStream = d->stream->getDocumentOLEStream("PerfectOffice_MAIN"); + if (tempStream) + { + delete d->stream; + d->stream = tempStream; + } + } - WPXString generatedSVG; - WPGraphics::generateSVG(d->stream, generatedSVG); - d->content = generatedSVG.cstr(); - QSvgRenderer tmpRenderer(d->content, parent); - d->defaultSize = tmpRenderer.defaultSize(); + if (d->stream) + { + // to know the default WPG size + WPXString generatedSVG; + WPGraphics::generateSVG(d->stream, generatedSVG); + d->content = generatedSVG.cstr(); + QSvgRenderer tmpRenderer(d->content, parent); + d->defaultSize = tmpRenderer.defaultSize(); + } } } @@ -93,8 +93,8 @@ { if(d->stream) { - QSvgRenderer tmpRenderer(d->content, this); - tmpRenderer.render(target); + QSvgRenderer tmpRenderer(d->content, this); + tmpRenderer.render(target); } } @@ -115,12 +115,12 @@ { const char* mimetype = "application/vnd.oasis.opendocument.graphics"; const char* manifest = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" - "<manifest:manifest xmlns:manifest=\"urn:oasis:names:tc:opendocument:xmlns:manifest:1.0\">" - " <manifest:file-entry manifest:media-type=\"application/vnd.oasis.opendocument.graphics\" manifest:version=\"1.0\" manifest:full-path=\"/\"/>" - " <manifest:file-entry manifest:media-type=\"text/xml\" manifest:full-path=\"content.xml\"/>" - " <manifest:file-entry manifest:media-type=\"text/xml\" manifest:full-path=\"settings.xml\"/>" - " <manifest:file-entry manifest:media-type=\"text/xml\" manifest:full-path=\"styles.xml\"/>" - "</manifest:manifest>"; + "<manifest:manifest xmlns:manifest=\"urn:oasis:names:tc:opendocument:xmlns:manifest:1.0\">" + " <manifest:file-entry manifest:media-type=\"application/vnd.oasis.opendocument.graphics\" manifest:version=\"1.0\" manifest:full-path=\"/\"/>" + " <manifest:file-entry manifest:media-type=\"text/xml\" manifest:full-path=\"content.xml\"/>" + " <manifest:file-entry manifest:media-type=\"text/xml\" manifest:full-path=\"settings.xml\"/>" + " <manifest:file-entry manifest:media-type=\"text/xml\" manifest:full-path=\"styles.xml\"/>" + "</manifest:manifest>"; FemtoZip zip(outputFile.toLocal8Bit().constData()); zip.createEntry("mimetype", 0); |