diff options
author | Michael Lutz <michi@icosahedron.de> | 2019-04-02 21:31:10 +0200 |
---|---|---|
committer | Michael Lutz <michi@icosahedron.de> | 2019-04-09 22:45:15 +0200 |
commit | baf9229931e4d5a3479892007e9bcc875bc9930b (patch) | |
tree | 5332e36f2427214f3cd63e11a69334692444e5ee /src/os/windows | |
parent | 329bb526134aca214a914f25006c805de78ec851 (diff) | |
download | openttd-baf9229931e4d5a3479892007e9bcc875bc9930b.tar.xz |
Codechange: Replace AutoDeleteSmallVector with direct std::vector use in text layout code.
Diffstat (limited to 'src/os/windows')
-rw-r--r-- | src/os/windows/string_uniscribe.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/os/windows/string_uniscribe.cpp b/src/os/windows/string_uniscribe.cpp index f47d9236a..5abe848bd 100644 --- a/src/os/windows/string_uniscribe.cpp +++ b/src/os/windows/string_uniscribe.cpp @@ -134,7 +134,7 @@ public: this->cur_range_offset = 0; } - const Line *NextLine(int max_width) override; + std::unique_ptr<const Line> NextLine(int max_width) override; }; void UniscribeResetScriptCache(FontSize size) @@ -318,7 +318,7 @@ static std::vector<SCRIPT_ITEM> UniscribeItemizeString(UniscribeParagraphLayoutF return new UniscribeParagraphLayout(ranges, buff); } -/* virtual */ const ParagraphLayouter::Line *UniscribeParagraphLayout::NextLine(int max_width) +/* virtual */ std::unique_ptr<const ParagraphLayouter::Line> UniscribeParagraphLayout::NextLine(int max_width) { std::vector<UniscribeRun>::iterator start_run = this->cur_range; std::vector<UniscribeRun>::iterator last_run = this->cur_range; @@ -404,7 +404,7 @@ static std::vector<SCRIPT_ITEM> UniscribeItemizeString(UniscribeParagraphLayoutF if (FAILED(ScriptLayout((int)bidi_level.size(), &bidi_level[0], &vis_to_log[0], NULL))) return NULL; /* Create line. */ - UniscribeLine *line = new UniscribeLine(); + std::unique_ptr<UniscribeLine> line(new UniscribeLine()); int cur_pos = 0; for (std::vector<INT>::iterator l = vis_to_log.begin(); l != vis_to_log.end(); l++) { |