summaryrefslogtreecommitdiffstats
path: root/src/libnrtype
diff options
context:
space:
mode:
authorKrzysztof Kosi??ski <tweenk.pl@gmail.com>2010-03-27 16:15:23 +0000
committerKrzysztof KosiƄski <tweenk.pl@gmail.com>2010-03-27 16:15:23 +0000
commit77e16bbd9d4681532e4630de42871c265803aa37 (patch)
tree982c8c32207f809bba3c2c1b6ffe296f03038092 /src/libnrtype
parentPhase 2 - remove duplicated code and leave a single copy of each function. (diff)
downloadinkscape-77e16bbd9d4681532e4630de42871c265803aa37.tar.gz
inkscape-77e16bbd9d4681532e4630de42871c265803aa37.zip
Fix incorrect use of std::auto_ptr<char> in FontInstance.cpp (LP #549317)
Fixed bugs: - https://launchpad.net/bugs/549317 (bzr r9240)
Diffstat (limited to 'src/libnrtype')
-rw-r--r--src/libnrtype/FontInstance.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/libnrtype/FontInstance.cpp b/src/libnrtype/FontInstance.cpp
index be5eb86c8..50dbec61d 100644
--- a/src/libnrtype/FontInstance.cpp
+++ b/src/libnrtype/FontInstance.cpp
@@ -493,15 +493,15 @@ void font_instance::LoadGlyph(int glyph_id)
// character has no visual representation, but is valid (eg whitespace)
doAdd=true;
} else {
- std::auto_ptr<char> buffer(new char[bufferSize]);
- if ( GetGlyphOutline (daddy->hScreenDC, glyph_id, GGO_GLYPH_INDEX | GGO_NATIVE | GGO_UNHINTED, &metrics, bufferSize, buffer.get(), &identity) <= 0 ) {
+ char *buffer = new char[bufferSize];
+ if ( GetGlyphOutline (daddy->hScreenDC, glyph_id, GGO_GLYPH_INDEX | GGO_NATIVE | GGO_UNHINTED, &metrics, bufferSize, buffer, &identity) <= 0 ) {
// shit happened
} else {
// Platform SDK is rubbish, read KB87115 instead
n_g.outline=new Path;
DWORD polyOffset=0;
while ( polyOffset < bufferSize ) {
- TTPOLYGONHEADER const *polyHeader=(TTPOLYGONHEADER const *)(buffer.get()+polyOffset);
+ TTPOLYGONHEADER const *polyHeader=(TTPOLYGONHEADER const *)(buffer+polyOffset);
if (polyOffset+polyHeader->cb > bufferSize) break;
if (polyHeader->dwType == TT_POLYGON_TYPE) {
@@ -509,7 +509,7 @@ void font_instance::LoadGlyph(int glyph_id)
DWORD curveOffset=polyOffset+sizeof(TTPOLYGONHEADER);
while ( curveOffset < polyOffset+polyHeader->cb ) {
- TTPOLYCURVE const *polyCurve=(TTPOLYCURVE const *)(buffer.get()+curveOffset);
+ TTPOLYCURVE const *polyCurve=(TTPOLYCURVE const *)(buffer+curveOffset);
POINTFX const *p=polyCurve->apfx;
POINTFX const *endp=p+polyCurve->cpfx;
@@ -554,6 +554,7 @@ void font_instance::LoadGlyph(int glyph_id)
}
doAdd=true;
}
+ delete [] buffer;
}
#else
if (FT_Load_Glyph (theFace, glyph_id, FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP)) {