Mercurial > hg > orthanc-stone
comparison Framework/Fonts/GlyphAlphabet.cpp @ 1298:8a0a62189f46
replacing std::auto_ptr by std::unique_ptr
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 02 Mar 2020 16:31:30 +0100 |
parents | 2d8ab34c8c91 |
children | 30deba7bc8e2 |
comparison
equal
deleted
inserted
replaced
1296:86400fa16091 | 1298:8a0a62189f46 |
---|---|
41 | 41 |
42 void GlyphAlphabet::Register(uint32_t unicode, | 42 void GlyphAlphabet::Register(uint32_t unicode, |
43 const Glyph& glyph, | 43 const Glyph& glyph, |
44 Orthanc::IDynamicObject* payload) | 44 Orthanc::IDynamicObject* payload) |
45 { | 45 { |
46 std::auto_ptr<Orthanc::IDynamicObject> protection(payload); | 46 std::unique_ptr<Orthanc::IDynamicObject> protection(payload); |
47 | 47 |
48 // Don't add twice the same character | 48 // Don't add twice the same character |
49 if (content_.find(unicode) == content_.end()) | 49 if (content_.find(unicode) == content_.end()) |
50 { | 50 { |
51 std::auto_ptr<Glyph> raii(new Glyph(glyph)); | 51 std::unique_ptr<Glyph> raii(new Glyph(glyph)); |
52 | 52 |
53 if (payload != NULL) | 53 if (payload != NULL) |
54 { | 54 { |
55 raii->SetPayload(protection.release()); | 55 raii->SetPayload(protection.release()); |
56 } | 56 } |
63 | 63 |
64 | 64 |
65 void GlyphAlphabet::Register(FontRenderer& renderer, | 65 void GlyphAlphabet::Register(FontRenderer& renderer, |
66 uint32_t unicode) | 66 uint32_t unicode) |
67 { | 67 { |
68 std::auto_ptr<Glyph> glyph(renderer.Render(unicode)); | 68 std::unique_ptr<Glyph> glyph(renderer.Render(unicode)); |
69 | 69 |
70 if (glyph.get() != NULL) | 70 if (glyph.get() != NULL) |
71 { | 71 { |
72 Register(unicode, *glyph, glyph->ReleasePayload()); | 72 Register(unicode, *glyph, glyph->ReleasePayload()); |
73 } | 73 } |