From e292d659e125a59af720d50f2700e9b767c2cada Mon Sep 17 00:00:00 2001 From: Jan Marvin Garbuszus Date: Wed, 16 Aug 2023 00:47:03 +0200 Subject: [PATCH] add workbookPr --- src/xlsb.cpp | 31 ++++++++++++++++++++++++++++++- src/xlsb_defines.h | 24 ++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 1 deletion(-) diff --git a/src/xlsb.cpp b/src/xlsb.cpp index 5050e9e9a..8c6843a5c 100644 --- a/src/xlsb.cpp +++ b/src/xlsb.cpp @@ -1424,7 +1424,36 @@ int workbook_bin(std::string filePath, std::string outPath, bool debug) { case BrtWbProp: { if (debug) Rcpp::Rcout << "" << std::endl; - bin.seekg(size, bin.cur); + uint32_t flags = 0, dwThemeVersion = 0; + + flags = readbin(flags, bin, swapit); + dwThemeVersion = readbin(dwThemeVersion, bin, swapit); + std::string strName = XLWideString(bin, swapit); + + BrtWbPropFields *fields = (BrtWbPropFields *)&flags; + + out << + "fAutoCompressPictures << "\" " << + " backupFile=\"" << fields->fBackup << "\" " << + " checkCompatibility=\"" << fields->fCheckCompat << "\" " << + " codeName=\"" << strName << "\" " << + " date1904=\"" << fields->f1904 << "\" " << + " defaultThemeVersion=\"" << dwThemeVersion << "\" " << + " filterPrivacy=\"" << fields->fFilterPrivacy << "\" " << + " hidePivotFieldList=\"" << fields->fHidePivotTableFList << "\" " << + " promptedSolutions=\"" << fields->fBuggedUserAboutSolution << "\" " << + " publishItems=\"" << fields->fPublishedBookItems << "\" " << + " refreshAllConnections=\"" << fields->fRefreshAll << "\" " << + " saveExternalLinkValues=\"" << fields->fNoSaveSup << "\" " << + // " showBorderUnselectedTables=\"" << << "\" " << + " showInkAnnotation=\"" << fields->fShowInkAnnotation << "\" " << + " showObjects=\"" << (uint32_t)fields->mdDspObj << "\" " << + " showPivotChartFilter=\"" << fields->fShowPivotChartFilter << "\" " << + " updateLinks=\"" << (uint32_t)fields->grbitUpdateLinks << "\" " << + "/>" << std::endl; + break; } diff --git a/src/xlsb_defines.h b/src/xlsb_defines.h index e998e7eeb..4f158215b 100644 --- a/src/xlsb_defines.h +++ b/src/xlsb_defines.h @@ -155,6 +155,27 @@ typedef struct { uint16_t reserved4 : 11; } BrtBeginCFRuleFields; +typedef struct { + bool f1904 : 1; + bool reserved1 : 1; + bool fHideBorderUnselLists : 1; + bool fFilterPrivacy : 1; + bool fBuggedUserAboutSolution : 1; + bool fShowInkAnnotation : 1; + bool fBackup : 1; + bool fNoSaveSup : 1; + uint8_t grbitUpdateLinks : 2; + bool fHidePivotTableFList : 1; + bool fPublishedBookItems : 1; + bool fCheckCompat : 1; + uint8_t mdDspObj : 2; + bool fShowPivotChartFilter : 1; + bool fAutoCompressPictures : 1; + bool reserved2 : 1; + bool fRefreshAll : 1; + uint16_t unused : 13; +} BrtWbPropFields; + enum RgbExtra { PtgExtraArray = 0, @@ -166,6 +187,9 @@ enum RgbExtra RevExtern = 6 }; + + + // https://github.com/DidierStevens/Beta/blob/master/xlsbdump.py enum RecordTypes {