Skip to content

Commit

Permalink
add workbookPr
Browse files Browse the repository at this point in the history
  • Loading branch information
JanMarvin committed Aug 22, 2023
1 parent fa31f91 commit 74e4da1
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 1 deletion.
31 changes: 30 additions & 1 deletion src/xlsb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1424,7 +1424,36 @@ int workbook_bin(std::string filePath, std::string outPath, bool debug) {
case BrtWbProp:
{
if (debug) Rcpp::Rcout << "<workbookProperties>" << 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 <<
"<workbookPr" <<
// " allowRefreshQuery=\"" << << "\" " <<
" autoCompressPictures=\"" << fields->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;
}

Expand Down
24 changes: 24 additions & 0 deletions src/xlsb_defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -166,6 +187,9 @@ enum RgbExtra
RevExtern = 6
};




// https://github.com/DidierStevens/Beta/blob/master/xlsbdump.py
enum RecordTypes
{
Expand Down

0 comments on commit 74e4da1

Please sign in to comment.