slackbuilds_ponce/academic/scidavis/fix-sf383-offset-and-spacing-of-bar-graphs.patch
Fellype do Nascimento 88571d5b1d academic/scidavis: Add patches.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
2019-08-10 06:58:55 +07:00

81 lines
5.4 KiB
Diff

diff --git a/libscidavis/src/ApplicationWindow.cpp b/libscidavis/src/ApplicationWindow.cpp
index a140d46..f13e8ff 100644
--- a/libscidavis/src/ApplicationWindow.cpp
+++ b/libscidavis/src/ApplicationWindow.cpp
@@ -9595,6 +9595,7 @@ Graph* ApplicationWindow::openGraph(ApplicationWindow* app, MultiLayer *plot,
{
bool curve_loaded = false; // Graph::insertCurve may fail
QStringList curve = s.split("\t", QString::KeepEmptyParts);
+ int s_offset = 0;
if (curve.count()>14)
{
if (!app->renamedTables.isEmpty())
@@ -9647,19 +9648,23 @@ Graph* ApplicationWindow::openGraph(ApplicationWindow* app, MultiLayer *plot,
cl.penWidth = curve[15].toInt();
else
cl.penWidth = cl.lWidth;
- // custom dash pattern
- cl.lCapStyle = curve[16].toInt();
- cl.lJoinStyle = curve[17].toInt();
- cl.lCustomDash = curve[18];
+ if (d_file_version >= 0x011800) // 1.24.0
+ {
+ // custom dash pattern
+ cl.lCapStyle = curve[15].toInt();
+ cl.lJoinStyle = curve[16].toInt();
+ cl.lCustomDash = curve[17];
+ s_offset += 3;
+ }
Table *w = app->table(curve[2]);
if (w)
{
int plotType = curve[3].toInt();
- if(curve.count()>21 && (plotType == Graph::VectXYXY || plotType == Graph::VectXYAM))
+ if(curve.count()>(21+s_offset) && (plotType == Graph::VectXYXY || plotType == Graph::VectXYAM))
{
QStringList colsList;
- colsList<<curve[2]; colsList<<curve[20]; colsList<<curve[21];
+ colsList<<curve[2]; colsList<<curve[20+s_offset]; colsList<<curve[21+s_offset];
if (d_file_version < 72)
colsList.prepend(w->colName(curve[1].toInt()));
else
@@ -9685,11 +9690,11 @@ Graph* ApplicationWindow::openGraph(ApplicationWindow* app, MultiLayer *plot,
else
{
if(plotType == Graph::VectXYXY)
- ag->updateVectorsLayout(curveID, curve[15], curve[16].toInt(),
- curve[17].toInt(), curve[18].toInt(), curve[19].toInt(), 0);
- else if (curve.count()>22)
- ag->updateVectorsLayout(curveID, curve[15], curve[16].toInt(), curve[17].toInt(),
- curve[18].toInt(), curve[19].toInt(), curve[22].toInt());
+ ag->updateVectorsLayout(curveID, curve[15+s_offset], curve[16+s_offset].toInt(),
+ curve[17+s_offset].toInt(), curve[18+s_offset].toInt(), curve[19+s_offset].toInt(), 0);
+ else if (curve.count()>22+s_offset)
+ ag->updateVectorsLayout(curveID, curve[15+s_offset], curve[16+s_offset].toInt(), curve[17+s_offset].toInt(),
+ curve[18+s_offset].toInt(), curve[19+s_offset].toInt(), curve[22+s_offset].toInt());
}
}
else if(plotType == Graph::Box) {
@@ -9705,8 +9710,8 @@ Graph* ApplicationWindow::openGraph(ApplicationWindow* app, MultiLayer *plot,
QwtHistogram *h = (QwtHistogram *)ag->curve(curveID);
if (d_file_version <= 76)
h->setBinning(curve[16].toInt(),curve[17].toDouble(),curve[18].toDouble(),curve[19].toDouble());
- else if (curve.count()>20)
- h->setBinning(curve[17].toInt(),curve[18].toDouble(),curve[19].toDouble(),curve[20].toDouble());
+ else if (curve.count()>20+s_offset)
+ h->setBinning(curve[17+s_offset].toInt(),curve[18+s_offset].toDouble(),curve[19+s_offset].toDouble(),curve[20+s_offset].toDouble());
h->loadData();
}
} else {
@@ -9727,8 +9732,8 @@ Graph* ApplicationWindow::openGraph(ApplicationWindow* app, MultiLayer *plot,
{
if (d_file_version <= 76 && curve.count()>15)
ag->setBarsGap(curveID, curve[15].toInt(), 0);
- else if (curve.count()>16)
- ag->setBarsGap(curveID, curve[15].toInt(), curve[16].toInt());
+ else if (curve.count()>(16+s_offset))
+ ag->setBarsGap(curveID, curve[15+s_offset].toInt(), curve[16+s_offset].toInt());
}
if (curve_loaded)
ag->updateCurveLayout(curveID, &cl);