summaryrefslogtreecommitdiff
path: root/src/lib/PictImage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/PictImage.cpp')
-rw-r--r--src/lib/PictImage.cpp84
1 files changed, 42 insertions, 42 deletions
diff --git a/src/lib/PictImage.cpp b/src/lib/PictImage.cpp
index ad78e13..7b3e026 100644
--- a/src/lib/PictImage.cpp
+++ b/src/lib/PictImage.cpp
@@ -35,13 +35,13 @@ stream is a Macintosh Pict Image that libpict is able to parse
*/
bool libpict::PictImage::isSupported(WPXInputStream *input)
{
- input->seek(0, WPX_SEEK_SET);
+ input->seek(0, WPX_SEEK_SET);
- PictHeader header;
- if(!header.load(input))
- return false;
+ PictHeader header;
+ if(!header.load(input))
+ return false;
- return true;
+ return true;
}
/**
@@ -54,41 +54,41 @@ WPGPaintInterface class implementation when needed. This is often commonly calle
*/
bool libpict::PictImage::parse(::WPXInputStream *input, libwpg::WPGPaintInterface *painter)
{
- PictXParser *parser = 0;
+ PictXParser *parser = 0;
- input->seek(0, WPX_SEEK_SET);
+ input->seek(0, WPX_SEEK_SET);
- PICT_DEBUG_MSG(("Loading header...\n"));
- PictHeader header;
- if(!header.load(input))
- return false;
+ PICT_DEBUG_MSG(("Loading header...\n"));
+ PictHeader header;
+ if(!header.load(input))
+ return false;
- // seek to the start of document
- input->seek(header.startOfDocument(), WPX_SEEK_SET);
- unsigned char tmpVersion = header.getVersion();
+ // seek to the start of document
+ input->seek(header.startOfDocument(), WPX_SEEK_SET);
+ unsigned char tmpVersion = header.getVersion();
- bool retval;
- switch (tmpVersion)
- {
- case 0x01: // Pict1
- PICT_DEBUG_MSG(("Parsing Pict1\n"));
- parser = new Pict1Parser(input, painter);
- retval = parser->parse();
- break;
- case 0x02: // Pict2
- PICT_DEBUG_MSG(("Parsing Pict2\n"));
- parser = new Pict2Parser(input, painter);
- retval = parser->parse();
- break;
- default: // other :-)
- PICT_DEBUG_MSG(("Unknown format\n"));
- return false;
- }
+ bool retval;
+ switch (tmpVersion)
+ {
+ case 0x01: // Pict1
+ PICT_DEBUG_MSG(("Parsing Pict1\n"));
+ parser = new Pict1Parser(input, painter);
+ retval = parser->parse();
+ break;
+ case 0x02: // Pict2
+ PICT_DEBUG_MSG(("Parsing Pict2\n"));
+ parser = new Pict2Parser(input, painter);
+ retval = parser->parse();
+ break;
+ default: // other :-)
+ PICT_DEBUG_MSG(("Unknown format\n"));
+ return false;
+ }
- if (parser)
- delete parser;
+ if (parser)
+ delete parser;
- return retval;
+ return retval;
}
/**
@@ -100,12 +100,12 @@ Provided as a convenience function for applications that support SVG internally.
*/
bool libpict::PictImage::generateSVG(::WPXInputStream *input, WPXString &output)
{
- std::ostringstream tmpOutputStream;
- libpict::PictSVGGenerator generator(tmpOutputStream);
- bool result = libpict::PictImage::parse(input, &generator);
- if (result)
- output = WPXString(tmpOutputStream.str().c_str());
- else
- output = WPXString("");
- return result;
+ std::ostringstream tmpOutputStream;
+ libpict::PictSVGGenerator generator(tmpOutputStream);
+ bool result = libpict::PictImage::parse(input, &generator);
+ if (result)
+ output = WPXString(tmpOutputStream.str().c_str());
+ else
+ output = WPXString("");
+ return result;
}