Turn wavelet.Lmethod into an integer (by @heckflosse, #4397)

This commit is contained in:
Flössie
2018-02-14 20:09:17 +01:00
parent 04cef998a2
commit cf3ea4f451
5 changed files with 22 additions and 14 deletions

View File

@@ -1,11 +1,13 @@
#pragma once
// This number has to be incremented whenever the PP3 file format is modified or the behaviour of a tool changes
#define PPVERSION 330
#define PPVERSION 331
#define PPVERSION_AEXP 301 //value of PPVERSION when auto exposure algorithm was modified
/*
Log of version changes
331 2018-14-02
changed wavelet.Lmethod to int
330 2018-20-01
Added 'Auto-matched Tone Curve' button, performing histogram matching
329 2017-12-09

View File

@@ -1096,7 +1096,7 @@ void Wavelet::read (const ProcParams* pp, const ParamsEdited* pedited)
Dirmethod->set_active (3);
}
int selectedLevel = atoi(pp->wavelet.Lmethod.data()) - 1;
int selectedLevel = pp->wavelet.Lmethod - 1;
Lmethod->set_active (selectedLevel == -1 ? 4 : selectedLevel);
ccshape->setCurve (pp->wavelet.ccwcurve);
@@ -1735,9 +1735,7 @@ void Wavelet::write (ProcParams* pp, ParamsEdited* pedited)
pp->wavelet.Dirmethod = "all";
}
char lMethod[3]; // one additional char to avoid buffer overrun if someone increases number of levels > 9
sprintf(lMethod, "%d", Lmethod->get_active_row_number() + 1);
pp->wavelet.Lmethod = lMethod;
pp->wavelet.Lmethod = Lmethod->get_active_row_number() + 1;
}
void Wavelet::curveChanged (CurveEditor* ce)