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 +// 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;jsetColumnTitle(j,name.replace(QRegExp(".*_"),"")); - spread->setColumnType(j,opj.colType(s,j)); + spread->setColumnType(j,colTypeToString(opj.colType(s,j))); for (int i=0;i0 && 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;sgetProject()->Notes(); for (int s=0;snewWorksheet(); @@ -139,8 +177,10 @@ int ImportOPJ::import() { #else kdDebug()<<"Layer x axis : "<getAxis(0)->setLabel(xlabel); @@ -342,11 +382,11 @@ int ImportOPJ::import() { } // axis range - vector xrange=opj.layerXRange(s,l); - vector 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 }; +// 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