mirror of
https://github.com/aseprite/aseprite.git
synced 2024-12-27 03:16:58 +00:00
Change ColorMap::m_remap to UniquePtr
This commit is contained in:
parent
85d638097b
commit
5fc3b06e8e
@ -109,7 +109,6 @@ ColorBar::ColorBar(int align)
|
||||
, m_bgColor(app::Color::fromRgb(0, 0, 0), IMAGE_RGB)
|
||||
, m_lock(false)
|
||||
, m_syncingWithPref(false)
|
||||
, m_remap(nullptr)
|
||||
, m_lastDocument(nullptr)
|
||||
, m_ascending(true)
|
||||
{
|
||||
@ -406,7 +405,7 @@ void ColorBar::onPaletteViewRemapColors(const Remap& remap, const Palette* newPa
|
||||
void ColorBar::applyRemap(const doc::Remap& remap, const doc::Palette* newPalette, const std::string& actionText)
|
||||
{
|
||||
if (!m_remap) {
|
||||
m_remap = new doc::Remap(remap);
|
||||
m_remap.reset(new doc::Remap(remap));
|
||||
m_remapButton.setVisible(true);
|
||||
layout();
|
||||
}
|
||||
@ -681,9 +680,7 @@ void ColorBar::destroyRemap()
|
||||
if (!m_remap)
|
||||
return;
|
||||
|
||||
delete m_remap;
|
||||
m_remap = nullptr;
|
||||
|
||||
m_remap.reset();
|
||||
m_remapButton.setVisible(false);
|
||||
layout();
|
||||
}
|
||||
|
@ -117,7 +117,7 @@ namespace app {
|
||||
ColorButton m_bgColor;
|
||||
bool m_lock;
|
||||
bool m_syncingWithPref;
|
||||
doc::Remap* m_remap;
|
||||
base::UniquePtr<doc::Remap> m_remap;
|
||||
const doc::Document* m_lastDocument;
|
||||
bool m_ascending;
|
||||
ScopedConnection m_conn;
|
||||
|
Loading…
Reference in New Issue
Block a user