Update of /cvsroot/libwpg/libwpg/src/conv/svg
In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv3653/svg
Modified Files:
Tag: STABLE-0-1-0
wpg2svg.cpp
Log Message:
avoid allocating objects on the heap when not necessary
Index: wpg2svg.cpp
===================================================================
RCS file: /cvsroot/libwpg/libwpg/src/conv/svg/wpg2svg.cpp,v
retrieving revision 1.1
retrieving revision 1.1.4.1
diff -u -d -r1.1 -r1.1.4.1
--- wpg2svg.cpp 24 May 2007 08:06:49 -0000 1.1
+++ wpg2svg.cpp 7 Dec 2007 16:12:16 -0000 1.1.4.1
@@ -38,25 +38,16 @@
}
const char* filename = argv[1];
- WPXInputStream* input = new libwpg::WPGFileStream(filename);
- if (input->isOLEStream())
- {
- WPXInputStream* olestream = input->getDocumentOLEStream();
- if (olestream)
- {
- delete input;
- input = olestream;
- }
- }
+ libwpg::WPGFileStream input(filename);
- if (!libwpg::WPGraphics::isSupported(input))
+ if (!libwpg::WPGraphics::isSupported(&input))
{
std::cerr << "ERROR: Unsupported file format (unsupported version) or file is encrypted!" << std::endl;
return 1;
}
libwpg::WPGString output;
- if (!libwpg::WPGraphics::generateSVG(input, output))
+ if (!libwpg::WPGraphics::generateSVG(&input, output))
{
std::cerr << "ERROR: SVG Generation failed!" << std::endl;
return 1;
|