diff options
Diffstat (limited to 'sci-visualization/labplot/files/labplot-1.6.0.1-liborigin.patch')
-rw-r--r-- | sci-visualization/labplot/files/labplot-1.6.0.1-liborigin.patch | 136 |
1 files changed, 136 insertions, 0 deletions
diff --git a/sci-visualization/labplot/files/labplot-1.6.0.1-liborigin.patch b/sci-visualization/labplot/files/labplot-1.6.0.1-liborigin.patch new file mode 100644 index 000000000000..5be4aec9e9c5 --- /dev/null +++ b/sci-visualization/labplot/files/labplot-1.6.0.1-liborigin.patch @@ -0,0 +1,136 @@ +diff --git a/src/ImportOPJ.cc b/src/ImportOPJ.cc +index 2b625d4..c49752f 100644 +--- a/src/ImportOPJ.cc ++++ b/src/ImportOPJ.cc +@@ -12,6 +12,44 @@ + + #include <liborigin/OPJFile.h> + ++// The declaration of liborigin's OPJFile::colType() changed from ++// const char *OPJFile::colType(int, int) const; ++// in version 20071119 to ++// ColumnType OPJFile::colType(int, int) const; ++// in version 20080225. This function can be used to get the string ++// that colType() returned in liborigin/20071119 from the ColumnType ++// that colType() returns in liborigin/20080225. The use of this ++// function requires a build-dependency on liborigin (>= 20080225). ++QString colTypeToString(const ColumnType type) { ++ QString type_str = ""; ++ ++ switch (type) { ++ case X: ++ type_str = "X"; ++ break; ++ case Y: ++ type_str = "Y"; ++ break; ++ case Z: ++ type_str = "Z"; ++ break; ++ case XErr: ++ type_str = "DX"; ++ break; ++ case YErr: ++ type_str = "DY"; ++ break; ++ case Label: ++ type_str = "LABEL"; ++ break; ++ case NONE: ++ type_str = "NONE"; ++ break; ++ } ++ ++ return type_str; ++} ++ + ImportOPJ::ImportOPJ(MainWin *mw, QString filename) + : mw(mw),filename(filename) + {} +@@ -44,13 +82,13 @@ int ImportOPJ::import() { + for (int j=0;j<nr_cols;j++) { + QString name(opj.colName(s,j)); + spread->setColumnTitle(j,name.replace(QRegExp(".*_"),"")); +- spread->setColumnType(j,opj.colType(s,j)); ++ spread->setColumnType(j,colTypeToString(opj.colType(s,j))); + + for (int i=0;i<opj.numRows(s,j);i++) { + double *v = (double *) opj.oData(s,j,i,true); + + LTableItem *item; +- if(strcmp(opj.colType(s,j),"LABEL")) { // number ++ if(strcmp(colTypeToString(opj.colType(s,j)),"LABEL")) { // number + if(fabs(*v)>0 && fabs(*v)<2.0e-300) // empty entry + continue; + item = new LTableItem( table, QTableItem::OnTyping,QString::number(*v)); +@@ -62,7 +100,7 @@ int ImportOPJ::import() { + } + } + for (int s=0;s<opj.numMatrices();s++) { +- kdDebug()<<" Matrix "<<s+1<<" : "<<opj.matrixName(s)<<" (ParentFolder : "<<opj.matrixParentFolder(s)<<")"<<endl; ++ kdDebug()<<" Matrix "<<s+1<<" : "<<opj.matrixName(s)<<endl; //" (ParentFolder : "<<opj.matrixParentFolder(s)<<")"<<endl; + kdDebug()<<" Label : "<<opj.matrixLabel(s)<<" Cols/Rows : "<<opj.numMatrixCols(s)<<'/'<<opj.numMatrixRows(s)<<endl; + kdDebug()<<" Formula : "<<opj.matrixFormula(s)<<" DisplayType : "<<opj.matrixNumDisplayType(s)<<endl; + +@@ -99,7 +137,7 @@ int ImportOPJ::import() { + + QString notes = mw->getProject()->Notes(); + for (int s=0;s<opj.numNotes();s++) { +- kdDebug()<<" Note "<<s+1<<" : "<<opj.noteName(s)<<" (ParentFolder : "<<opj.noteParentFolder(s)<<")"<<endl; ++ kdDebug()<<" Note "<<s+1<<" : "<<opj.noteName(s)<<endl; //" (ParentFolder : "<<opj.noteParentFolder(s)<<")"<<endl; + kdDebug()<<" Label : "<<opj.noteLabel(s)<<" Text : "<<opj.noteText(s)<<endl; + notes.append(QString(opj.noteLabel(s))+":\n"); + notes.append(opj.noteText(s)); +@@ -115,7 +153,7 @@ int ImportOPJ::import() { + } + + for (int s=0;s<opj.numGraphs();s++) { +- kdDebug()<<" Graph "<<s+1<<" : "<<opj.graphName(s)<<" (ParentFolder : "<<opj.graphParentFolder(s)<<")"<<endl; ++ kdDebug()<<" Graph "<<s+1<<" : "<<opj.graphName(s)<<endl; //" (ParentFolder : "<<opj.graphParentFolder(s)<<")"<<endl; + kdDebug()<<" Label : "<<opj.graphLabel(s)<<" Layers : "<<opj.numLayers(s)<<endl; + + Worksheet *work = mw->newWorksheet(); +@@ -139,8 +177,10 @@ int ImportOPJ::import() { + #else + kdDebug()<<"Layer x axis : "<<opj.layerXAxisTitle(s,l).txt<<endl; + kdDebug()<<"Layer y axis : "<<opj.layerYAxisTitle(s,l).txt<<endl; +- Label *xlabel = new Label(parseOriginText(opj.layerXAxisTitle(s,l).txt)); +- Label *ylabel = new Label(parseOriginText(opj.layerYAxisTitle(s,l).txt)); ++ ++ // The name Label is ambiguous, therefore use LPLabel here. ++ LPLabel *xlabel = new LPLabel(parseOriginText(opj.layerXAxisTitle(s,l).txt)); ++ LPLabel *ylabel = new LPLabel(parseOriginText(opj.layerYAxisTitle(s,l).txt)); + kdDebug()<<"Layer legend : "<<opj.layerLegend(s,l).txt<<endl; + #endif + plot->getAxis(0)->setLabel(xlabel); +@@ -342,11 +382,11 @@ int ImportOPJ::import() { + } + + // axis range +- vector<double> xrange=opj.layerXRange(s,l); +- vector<double> yrange=opj.layerYRange(s,l); ++ graphLayerRange xrange=opj.layerXRange(s,l); ++ graphLayerRange yrange=opj.layerYRange(s,l); + LRange range[2]; +- range[0] = LRange(xrange[0],xrange[1]); +- range[1] = LRange(yrange[0],yrange[1]); ++ range[0] = LRange(xrange.min,xrange.max); ++ range[1] = LRange(yrange.min,yrange.max); + plot->setActRanges(range); + + // axis scale +diff --git a/src/Label.h b/src/Label.h +index b61c55b..5aa7097 100644 +--- a/src/Label.h ++++ b/src/Label.h +@@ -66,4 +66,10 @@ private: + bool is_texlabel; // if it is a tex label + }; + ++// <liborigin/OPJFile.h> defines an enumerator of the type ColumnType with ++// the name Label in the global namespace. Since the class Label defined in ++// this file ("Label.h") collides with the aforementioned enumerator in ++// "ImportOPJ.cc" we define a synonym for Label here to avoid the ambiguity. ++typedef Label LPLabel; ++ + #endif //LABEL_H |