From 887f0c1fc74c2a00ee47436c6ebb19e672159aee Mon Sep 17 00:00:00 2001 From: gerrit Date: Wed, 9 Jan 2019 19:32:09 +0100 Subject: [PATCH] fixed: auto_ptr -> unique_ptr --- Source/System/Text/OSGTextMacBackend.cpp | 16 ++++++++-------- Source/System/Text/OSGTextWIN32Backend.cpp | 28 ++++++++++++++-------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/Source/System/Text/OSGTextMacBackend.cpp b/Source/System/Text/OSGTextMacBackend.cpp index 830fc7290..eabc39949 100644 --- a/Source/System/Text/OSGTextMacBackend.cpp +++ b/Source/System/Text/OSGTextMacBackend.cpp @@ -90,7 +90,7 @@ public: protected: // Creates a new Glyph object - virtual auto_ptr createGlyph(TextGlyph::Index glyphIndex); + virtual unique_ptr createGlyph(TextGlyph::Index glyphIndex); private: @@ -149,7 +149,7 @@ public: protected: // Creates a new Glyph object - virtual auto_ptr createGlyph(TextGlyph::Index glyphIndex); + virtual unique_ptr createGlyph(TextGlyph::Index glyphIndex); private: @@ -953,14 +953,14 @@ static OSStatus cubicClosePathCallback(void *callBackDataPtr) // Creates a new Glyph object // Author: pdaehne //---------------------------------------------------------------------- -auto_ptr TextMacVectorFace::createGlyph(TextGlyph::Index glyphIndex) +unique_ptr TextMacVectorFace::createGlyph(TextGlyph::Index glyphIndex) { // We cannot create glyphs for invalid glyph indices if (glyphIndex == TextGlyph::INVALID_INDEX) - return auto_ptr(); + return unique_ptr(); // Create and return the new glyph object - return auto_ptr(new TextMacVectorGlyph(glyphIndex, _scale, _horiFontStyle, _vertFontStyle)); + return unique_ptr(new TextMacVectorGlyph(glyphIndex, _scale, _horiFontStyle, _vertFontStyle)); } @@ -1200,9 +1200,9 @@ void TextMacPixmapFace::layout(const wstring &text, const TextLayoutParam ¶m // Creates a new Glyph object // Author: pdaehne //---------------------------------------------------------------------- -auto_ptr TextMacPixmapFace::createGlyph(TextGlyph::Index glyphIndex) +unique_ptr TextMacPixmapFace::createGlyph(TextGlyph::Index glyphIndex) { - return auto_ptr(); + return unique_ptr(); } @@ -1341,7 +1341,7 @@ const TextPixmapGlyph &TextMacPixmapFace::getPixmapGlyph(const ATSLayoutRecord & drawGlyph(textLayout, layoutRecord, xPos, yPos, width, height, pixmap, 0); } - auto_ptr glyph(new TextMacPixmapGlyph(glyphID, width, height, horiAdvance, horiBearingX, horiBearingY, vertAdvance, vertBearingX, vertBearingY, pixmap)); + unique_ptr glyph(new TextMacPixmapGlyph(glyphID, width, height, horiAdvance, horiBearingX, horiBearingY, vertAdvance, vertBearingX, vertBearingY, pixmap)); // Put the glyph into the glyph cache _glyphMap.insert(GlyphMap::value_type(glyphID, glyph.get())); diff --git a/Source/System/Text/OSGTextWIN32Backend.cpp b/Source/System/Text/OSGTextWIN32Backend.cpp index 76d05bda8..75ff29a7e 100644 --- a/Source/System/Text/OSGTextWIN32Backend.cpp +++ b/Source/System/Text/OSGTextWIN32Backend.cpp @@ -90,7 +90,7 @@ public: protected: // Creates a new Glyph object - virtual auto_ptr createGlyph(TextGlyph::Index glyphIndex); + virtual unique_ptr createGlyph(TextGlyph::Index glyphIndex); private: @@ -152,7 +152,7 @@ public: protected: // Creates a new Glyph object - virtual auto_ptr createGlyph(TextGlyph::Index glyphIndex); + virtual unique_ptr createGlyph(TextGlyph::Index glyphIndex); private: @@ -671,11 +671,11 @@ void TextWIN32VectorFace::layout(const wstring &text, const TextLayoutParam &par // Creates a new Glyph object // Author: pdaehne //---------------------------------------------------------------------- -auto_ptr TextWIN32VectorFace::createGlyph(TextGlyph::Index glyphIndex) +unique_ptr TextWIN32VectorFace::createGlyph(TextGlyph::Index glyphIndex) { // We cannot create glyphs for invalid glyph indices if (glyphIndex == TextGlyph::INVALID_INDEX) - return auto_ptr(); + return unique_ptr(); // Select the vertical font into the device context HGDIOBJ oldFont = SelectObject(_backend->_hDC, _hVertFont); @@ -688,7 +688,7 @@ auto_ptr TextWIN32VectorFace::createGlyph(TextGlyph::Index glyp if (size == GDI_ERROR) { SelectObject(_backend->_hDC, oldFont); - return auto_ptr(); + return unique_ptr(); } // Select the horizontal font into the device context @@ -700,7 +700,7 @@ auto_ptr TextWIN32VectorFace::createGlyph(TextGlyph::Index glyp if (size == GDI_ERROR) { SelectObject(_backend->_hDC, oldFont); - return auto_ptr(); + return unique_ptr(); } LPTTPOLYGONHEADER lpHeader = (LPTTPOLYGONHEADER) new char[size]; size = GetGlyphOutlineW(_backend->_hDC, glyphIndex, GGO_NATIVE | GGO_GLYPH_INDEX, &hpgm, size, lpHeader, &mat2); @@ -711,11 +711,11 @@ auto_ptr TextWIN32VectorFace::createGlyph(TextGlyph::Index glyp if (size == GDI_ERROR) { delete [] lpHeader; - return auto_ptr(); + return unique_ptr(); } // Create and return the new glyph object - auto_ptr glyph(new TextWIN32VectorGlyph(glyphIndex, _scale, + unique_ptr glyph(new TextWIN32VectorGlyph(glyphIndex, _scale, hpgm, vpgm, lpHeader, size)); delete [] lpHeader; return glyph; @@ -1047,11 +1047,11 @@ void TextWIN32PixmapFace::layout(const wstring &text, const TextLayoutParam &par // Creates a new Glyph object // Author: pdaehne //---------------------------------------------------------------------- -auto_ptr TextWIN32PixmapFace::createGlyph(TextGlyph::Index glyphIndex) +unique_ptr TextWIN32PixmapFace::createGlyph(TextGlyph::Index glyphIndex) { // We cannot create glyphs for invalid glyph indices if (glyphIndex == TextGlyph::INVALID_INDEX) - return auto_ptr(); + return unique_ptr(); // Select the vertical font into the device context HGDIOBJ oldFont = SelectObject(_backend->_hDC, _hVertFont); @@ -1064,7 +1064,7 @@ auto_ptr TextWIN32PixmapFace::createGlyph(TextGlyph::Index glyp if (size == GDI_ERROR) { SelectObject(_backend->_hDC, oldFont); - return auto_ptr(); + return unique_ptr(); } // Select the horizontal font into the device context @@ -1076,7 +1076,7 @@ auto_ptr TextWIN32PixmapFace::createGlyph(TextGlyph::Index glyp if (size == GDI_ERROR) { SelectObject(_backend->_hDC, oldFont); - return auto_ptr(); + return unique_ptr(); } UInt8 *buffer; if (size == 0) @@ -1091,7 +1091,7 @@ auto_ptr TextWIN32PixmapFace::createGlyph(TextGlyph::Index glyp { delete [] buffer; SelectObject(_backend->_hDC, oldFont); - return auto_ptr(); + return unique_ptr(); } // The gray values in the buffer are between 0 and 64, inclusively. @@ -1107,7 +1107,7 @@ auto_ptr TextWIN32PixmapFace::createGlyph(TextGlyph::Index glyp SelectObject(_backend->_hDC, oldFont); // Create and return the new glyph object - return auto_ptr(new TextWIN32PixmapGlyph(glyphIndex, hpgm, vpgm, buffer)); + return unique_ptr(new TextWIN32PixmapGlyph(glyphIndex, hpgm, vpgm, buffer)); } -- 2.11.4.GIT