From: Miquel G. <gbm...@gm...> - 2010-11-12 13:58:04
|
Instead of breaking out of parse process, skip sections that cannot be handled. --- Origin610Parser.cpp | 29 +++++++++++++++++++++++++++-- 1 files changed, 27 insertions(+), 2 deletions(-) diff --git a/Origin610Parser.cpp b/Origin610Parser.cpp index 2b83d58..eb24861 100644 --- a/Origin610Parser.cpp +++ b/Origin610Parser.cpp @@ -1013,8 +1013,33 @@ bool Origin610Parser::readGraphInfo() //if (!QString(sec_name.c_str()).trimmed().isEmpty()) if (!sec_name.empty()) sectionNames.push_back(sec_name); - else - break; + else { + // section has no name, just skip it + LAYER += size + 0x01; + // skip header data + file.seekg(LAYER, ios_base::beg); + // get size of block_1 data + file >> size; + LAYER += 0x5 + size + 0x1; + // skip block_1 + file.seekg(LAYER, ios_base::beg); + // get size of block_2 data + file >> size; + LAYER += 0x5 + size + (size > 0 ? 0x1 : 0); + // skip block_2 + file.seekg(LAYER, ios_base::beg); + // get size of block_3 data + file >> size; + LAYER += 0x5 + size + (size > 0 ? 0x1 : 0); + // skip block_3 + file.seekg(LAYER, ios_base::beg); + file >> size; + // if it is last section jump out + if (!size || size != sectionSize) + break; + // if not, continue with next section + continue; + } unsigned int sectionNamePos = LAYER + 0x46; LOG_PRINT(logfile, " SECTION NAME: %s (@ 0x%X)\n", sec_name.c_str(), (LAYER + 0x46)) -- 1.7.3 |
From: Miquel G. <gbm...@gm...> - 2010-11-12 13:58:09
|
Get a shared library with higher version than last released. --- CMakeLists.txt | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c321500..7aa3712 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,7 +28,7 @@ set (devel-headers # dynamic library add_library (origin2 SHARED ${sources}) -set_target_properties(origin2 PROPERTIES VERSION 0.0.1 SOVERSION 0 ) +set_target_properties(origin2 PROPERTIES VERSION 1.0.1 SOVERSION 1 ) # static library add_library (origin2-static STATIC ${sources}) -- 1.7.3 |
From: Miquel G. <gbm...@gm...> - 2010-11-12 13:58:10
|
With these changes the obtained opjfile.log file is (almost) identical to that obtained by release liborigin2-13092010.zip. --- Origin700Parser.cpp | 6 ++-- Origin750Parser.cpp | 54 +++++++++++++++++++++++++------------------------- Origin800Parser.cpp | 32 +++++++++++++++--------------- OriginFile.cpp | 2 +- 4 files changed, 47 insertions(+), 47 deletions(-) diff --git a/Origin700Parser.cpp b/Origin700Parser.cpp index 029e8ca..33627be 100644 --- a/Origin700Parser.cpp +++ b/Origin700Parser.cpp @@ -55,7 +55,7 @@ bool Origin700Parser::parse() file >> size; file.seekg(1, ios_base::cur); - LOG_PRINT(logfile, " [column found = %d/0x%X @ 0x%X]\n", size, size, (unsigned int) file.tellg()) + LOG_PRINT(logfile, " [column found = %d/0x%X @ 0x%X]\n", size, size, (unsigned int) file.tellg()) unsigned int colpos = file.tellg(); unsigned int current_col = 1, nr = 0, nbytes = 0; @@ -387,7 +387,7 @@ bool Origin700Parser::parse() unsigned int POS = (unsigned int)file.tellg()-11; LOG_PRINT(logfile, "\nHEADER SECTION\n") - LOG_PRINT(logfile, " nr_spreads = %d", speadSheets.size()) + LOG_PRINT(logfile, " nr_spreads = %d\n", speadSheets.size()) LOG_PRINT(logfile, " [position @ 0x%X]\n", POS) //////////////////////// OBJECT INFOS ////////////////////////////////////// @@ -476,7 +476,7 @@ void Origin700Parser::readMatrixInfo() // LAYER section LAYER += 0x5; - + unsigned short width; file.seekg(LAYER + 0x27, ios_base::beg); file >> width; diff --git a/Origin750Parser.cpp b/Origin750Parser.cpp index 7b3052b..2a29b53 100644 --- a/Origin750Parser.cpp +++ b/Origin750Parser.cpp @@ -1,7 +1,7 @@ /*************************************************************************** File : Origin750Parser.cpp -------------------------------------------------------------------- - Copyright : (C) 2007-2008 Alex Kargovsky, Stefan Gerlach, + Copyright : (C) 2007-2008 Alex Kargovsky, Stefan Gerlach, Ion Vasilief Email (use @ for *) : kargovsky*yumr.phys.msu.su, ion_vasilief*yahoo.fr Description : Origin 7.5 file parser class @@ -61,11 +61,11 @@ bool Origin750Parser::parse() file >> size; file.seekg(1, ios_base::cur); - LOG_PRINT(logfile, " [column found = %d/0x%X @ 0x%X]\n", size, size, (unsigned int) file.tellg()) + LOG_PRINT(logfile, " [column found = %d/0x%X @ 0x%X]\n", size, size, (unsigned int) file.tellg()) unsigned int colpos = file.tellg(); unsigned int current_col = 1, nr = 0, nbytes = 0; - + while(size > 0 && size < 0x84) { // should be 0x72, 0x73 or 0x83 //////////////////////////////// COLUMN HEADER ///////////////////////////////////////////// short data_type; @@ -77,7 +77,7 @@ bool Origin750Parser::parse() file.seekg(oldpos + 0x3F, ios_base::beg); file >> data_type_u; - + char valuesize; file.seekg(oldpos + 0x3D, ios_base::beg); file >> valuesize; @@ -151,7 +151,7 @@ bool Origin750Parser::parse() case 0x6001://double for(unsigned int i = 0; i < size; ++i) { - double value; + double value; file >> value; matrixes.back().data.push_back((double)value); if (size < 100) @@ -161,7 +161,7 @@ bool Origin750Parser::parse() case 0x6003://float for(unsigned int i = 0; i < size; ++i) { - float value; + float value; file >> value; matrixes.back().data.push_back((double)value); if (size < 100) @@ -173,7 +173,7 @@ bool Origin750Parser::parse() { for(unsigned int i = 0; i < size; ++i) { - unsigned int value; + unsigned int value; file >> value; matrixes.back().data.push_back((double)value); if (size < 100) @@ -184,7 +184,7 @@ bool Origin750Parser::parse() { for(unsigned int i = 0; i < size; ++i) { - int value; + int value; file >> value; matrixes.back().data.push_back((double)value); if (size < 100) @@ -197,7 +197,7 @@ bool Origin750Parser::parse() { for(unsigned int i = 0; i < size; ++i) { - unsigned short value; + unsigned short value; file >> value; matrixes.back().data.push_back((double)value); if (size < 100) @@ -208,7 +208,7 @@ bool Origin750Parser::parse() { for(unsigned int i = 0; i < size; ++i) { - short value; + short value; file >> value; matrixes.back().data.push_back((double)value); if (size < 100) @@ -221,7 +221,7 @@ bool Origin750Parser::parse() { for(unsigned int i = 0; i < size; ++i) { - unsigned char value; + unsigned char value; file >> value; matrixes.back().data.push_back((double)value); if (size < 100) @@ -232,7 +232,7 @@ bool Origin750Parser::parse() { for(unsigned int i = 0; i < size; ++i) { - char value; + char value; file >> value; matrixes.back().data.push_back((double)value); if (size < 100) @@ -409,7 +409,7 @@ bool Origin750Parser::parse() unsigned int POS = (unsigned int)file.tellg()-11; LOG_PRINT(logfile, "\nHEADER SECTION\n") - LOG_PRINT(logfile, " nr_spreads = %d", speadSheets.size()) + LOG_PRINT(logfile, " nr_spreads = %d\n", speadSheets.size()) LOG_PRINT(logfile, " [position @ 0x%X]\n", POS) //////////////////////// OBJECT INFOS ////////////////////////////////////// @@ -443,12 +443,12 @@ bool Origin750Parser::parse() } file.seekg(1, ios_base::cur); - LOG_PRINT(logfile, "Some Origin params @ 0x%X:", (unsigned int)file.tellg()) + LOG_PRINT(logfile, "Some Origin params @ 0x%X:\n", (unsigned int)file.tellg()) file >> c; while(c != 0) { - LOG_PRINT(logfile, " ") + LOG_PRINT(logfile, " ") while(c != '\n') { LOG_PRINT(logfile, "%c", c) @@ -456,7 +456,7 @@ bool Origin750Parser::parse() } double parvalue; file >> parvalue; - LOG_PRINT(logfile, ": %g", parvalue); + LOG_PRINT(logfile, ": %g\n", parvalue); file.seekg(1, ios_base::cur); file >> c; @@ -525,7 +525,7 @@ bool Origin750Parser::parse() notes.back().frameRect = rect; notes.back().creationDate = doubleToPosixTime(creationDate); notes.back().modificationDate = doubleToPosixTime(modificationDate); - + if(c & 0x01) notes.back().title = Window::Label; else if(c & 0x02) @@ -650,7 +650,7 @@ void Origin750Parser::readSpreadInfo() } /////////////// COLUMN Types /////////////////////////////////////////// - LOG_PRINT(logfile, " Spreadsheet has %d columns", speadSheets[spread].columns.size()) + LOG_PRINT(logfile, " Spreadsheet has %d columns\n", speadSheets[spread].columns.size()) vector<SpreadColumn> header; while(1) @@ -868,7 +868,7 @@ void Origin750Parser::readExcelInfo() LAYER += 0x5; /////////////// COLUMN Types /////////////////////////////////////////// - LOG_PRINT(logfile, " Excel sheet %d has %d columns", isheet, excels[iexcel].sheets[isheet].columns.size()) + LOG_PRINT(logfile, " Excel sheet %d has %d columns\n", isheet, excels[iexcel].sheets[isheet].columns.size()) while(1) { @@ -1048,7 +1048,7 @@ void Origin750Parser::readMatrixInfo() // LAYER section LAYER += 0x5; - + file.seekg(LAYER + 0x2B, ios_base::beg); file >> matrixes[idx].columnCount; @@ -1155,7 +1155,7 @@ void Origin750Parser::readMatrixInfo() } LAYER += 0x1E7 + 0x1; - + file.seekg(LAYER, ios_base::beg); file >> size; @@ -1871,7 +1871,7 @@ void Origin750Parser::readGraphInfo() file.seekg(LAYER + 0x13, ios_base::beg); file >> h; - curve.surface.backColorEnabled = (h & 0x08); + curve.surface.backColorEnabled = (h & 0x08); file.seekg(LAYER + 0x15A, ios_base::beg); file >> curve.surface.backColor; file >> curve.surface.xSideWallColor; @@ -1965,7 +1965,7 @@ void Origin750Parser::readGraphInfo() file >> size; LAYER += size + (size > 0 ? 0x1 : 0) + 0x5; - + file.seekg(LAYER, ios_base::beg); file >> size; @@ -2034,7 +2034,7 @@ void Origin750Parser::readGraphInfo() void Origin750Parser::readGraphGridInfo(GraphGrid& grid) { unsigned int POS = file.tellg(); - + unsigned char h; short w; @@ -2065,7 +2065,7 @@ void Origin750Parser::readGraphAxisBreakInfo(GraphAxisBreak& axis_break) file >> axis_break.to; file >> axis_break.scaleIncrementAfter; - + file >> axis_break.position; unsigned char h; @@ -2141,7 +2141,7 @@ void Origin750Parser::readGraphAxisTickLabelsInfo(GraphAxisTick& tick) file.seekg(POS + 0x1A, ios_base::beg); file >> h; tick.fontBold = (h & 0x08); - + file.seekg(POS + 0x23, ios_base::beg); file >> w; file >> h; @@ -2363,7 +2363,7 @@ void Origin750Parser::readWindowProperties(Window& window, unsigned int size) { LOG_PRINT(logfile, " WINDOW %d NAME : %s is hidden\n", objectIndex, window.name.c_str()) } - + double creationDate, modificationDate; file.seekg(POS + 0x73, ios_base::beg); file >> creationDate; diff --git a/Origin800Parser.cpp b/Origin800Parser.cpp index 7a0e869..708ee6c 100644 --- a/Origin800Parser.cpp +++ b/Origin800Parser.cpp @@ -61,11 +61,11 @@ bool Origin800Parser::parse() file >> size; file.seekg(1, ios_base::cur); - LOG_PRINT(logfile, " [column found = %d/0x%X @ 0x%X]\n", size, size, (unsigned int) file.tellg()) + LOG_PRINT(logfile, " [column found = %d/0x%X @ 0x%X]\n", size, size, (unsigned int) file.tellg()) unsigned int colpos = file.tellg(); unsigned int current_col = 1, nr = 0, nbytes = 0; - + while(size > 0 && size <= 0x8C){// should be 0x72, 0x73 or 0x83 ? //////////////////////////////// COLUMN HEADER ///////////////////////////////////////////// @@ -78,7 +78,7 @@ bool Origin800Parser::parse() file.seekg(oldpos + 0x3F, ios_base::beg); file >> data_type_u; - + char valuesize; file.seekg(oldpos + 0x3D, ios_base::beg); file >> valuesize; @@ -161,7 +161,7 @@ bool Origin800Parser::parse() case 0x6001://double for(unsigned int i = 0; i < size; ++i) { - double value; + double value; file >> value; matrixes.back().data.push_back((double)value); //if (size < 100) @@ -171,7 +171,7 @@ bool Origin800Parser::parse() case 0x6003://float for(unsigned int i = 0; i < size; ++i) { - float value; + float value; file >> value; matrixes.back().data.push_back((double)value); if (size < 100) @@ -183,7 +183,7 @@ bool Origin800Parser::parse() { for(unsigned int i = 0; i < size; ++i) { - unsigned int value; + unsigned int value; file >> value; matrixes.back().data.push_back((double)value); if (size < 100) @@ -194,7 +194,7 @@ bool Origin800Parser::parse() { for(unsigned int i = 0; i < size; ++i) { - int value; + int value; file >> value; matrixes.back().data.push_back((double)value); if (size < 100) @@ -207,7 +207,7 @@ bool Origin800Parser::parse() { for(unsigned int i = 0; i < size; ++i) { - unsigned short value; + unsigned short value; file >> value; matrixes.back().data.push_back((double)value); if (size < 100) @@ -218,7 +218,7 @@ bool Origin800Parser::parse() { for(unsigned int i = 0; i < size; ++i) { - short value; + short value; file >> value; matrixes.back().data.push_back((double)value); if (size < 100) @@ -231,7 +231,7 @@ bool Origin800Parser::parse() { for(unsigned int i = 0; i < size; ++i) { - unsigned char value; + unsigned char value; file >> value; matrixes.back().data.push_back((double)value); if (size < 100) @@ -242,7 +242,7 @@ bool Origin800Parser::parse() { for(unsigned int i = 0; i < size; ++i) { - char value; + char value; file >> value; matrixes.back().data.push_back((double)value); if (size < 100) @@ -416,7 +416,7 @@ bool Origin800Parser::parse() unsigned int POS = (unsigned int)file.tellg()-11; LOG_PRINT(logfile, "\nHEADER SECTION\n") - LOG_PRINT(logfile, " nr_spreads = %d", speadSheets.size()) + LOG_PRINT(logfile, " nr_spreads = %d\n", speadSheets.size()) LOG_PRINT(logfile, " [position @ 0x%X]\n", POS) POS += 0xB; @@ -1008,7 +1008,7 @@ void Origin800Parser::readMatrixInfo() // LAYER section LAYER += 0x5; - + file.seekg(LAYER + 0x2B, ios_base::beg); file >> matrixes[idx].columnCount; LOG_PRINT(logfile, " Columns: %d (@ 0x%X)\n", matrixes[idx].columnCount, (LAYER + 0x2B)) @@ -1798,7 +1798,7 @@ void Origin800Parser::readGraphInfo() file.seekg(LAYER + 0x13, ios_base::beg); file >> h; - curve.surface.backColorEnabled = (h & 0x08); + curve.surface.backColorEnabled = (h & 0x08); file.seekg(LAYER + 0x15A, ios_base::beg); file >> curve.surface.backColor; file >> curve.surface.xSideWallColor; @@ -1894,7 +1894,7 @@ void Origin800Parser::readGraphInfo() file >> newSize; LAYER += newSize + (newSize > 0 ? 0x1 : 0) + 0x5; - + file.seekg(LAYER, ios_base::beg); file >> newSize; @@ -1977,7 +1977,7 @@ void Origin800Parser::skipObjectInfo() file >> size; POS = file.tellg(); } - + unsigned int nextSize = size; LOG_PRINT(logfile, " skipObjectInfo() size: %d (0x%X) @ 0x%X\n", size, size, POS) while (POS < d_file_size && nextSize == size){ diff --git a/OriginFile.cpp b/OriginFile.cpp index e1928a3..b3fee60 100644 --- a/OriginFile.cpp +++ b/OriginFile.cpp @@ -60,7 +60,7 @@ OriginFile::OriginFile(const string& fileName) fileVersion = atoi(vers.c_str()); file.close(); - LOG_PRINT(logfile, " [version = %d]\n", fileVersion) + LOG_PRINT(logfile, " [version = %d]\n", fileVersion) buildVersion = fileVersion; // translate version -- 1.7.3 |
From: Knut F. <Knu...@gm...> - 2010-11-14 23:04:34
|
Committed up to here. |
From: Knut F. <Knu...@gm...> - 2010-11-14 22:54:32
|
[2010-11-12 14:56] Miquel Garriga <gbm...@gm...>: > Get a shared library with higher version than last released. [...] > -set_target_properties(origin2 PROPERTIES VERSION 0.0.1 SOVERSION 0 ) > +set_target_properties(origin2 PROPERTIES VERSION 1.0.1 SOVERSION 1 ) Since the API is not backwards-compatible with the last version released on proindependent.com (not to mention liborigin1), we already should have bumped the major version of the last release. See http://semver.org/. I think we should do that at least now, i.e. jump to 2.0.0 and do any further API- incompatible changes on a separate development branch to be released as liborigin3. Knut |
From: Knut F. <Knu...@gm...> - 2010-11-24 07:21:07
|
[2010-11-14 23:54] Knut Franke <Knu...@gm...>: > Since the API is not backwards-compatible with the last version released on > proindependent.com (not to mention liborigin1), we already should have > bumped the major version of the last release. See http://semver.org/. I > think we should do that at least now, i.e. jump to 2.0.0 and do any > further API- incompatible changes on a separate development branch to be > released as liborigin3. Failing to receive any feedback on this, I've gone forward and adjusted the versioning scheme accordingly. Last chance to complain before it ends up in a release. ;-) Also, I've added a mailing list liborigin-git which will (if I set everything up correctly) receive automatic notifications about changes to the Git repository. Knut |