diff --git a/Common/DocxFormat/Source/XlsxFormat/Styles/NumFmts.h b/Common/DocxFormat/Source/XlsxFormat/Styles/NumFmts.h index 90232a9ba6..9e68840399 100644 --- a/Common/DocxFormat/Source/XlsxFormat/Styles/NumFmts.h +++ b/Common/DocxFormat/Source/XlsxFormat/Styles/NumFmts.h @@ -72,6 +72,7 @@ namespace OOX writer.StartAttributes(); WritingStringNullableAttrInt(L"numFmtId", m_oNumFmtId, m_oNumFmtId->GetValue()); WritingStringNullableAttrEncodeXmlString(L"formatCode", m_oFormatCode, *m_oFormatCode); + WritingStringNullableAttrEncodeXmlString(L"x16r2:formatCode16", m_oFormatCode16, *m_oFormatCode16); WritingStringNullableAttrBool(L"sourceLinked", m_oSourceLinked); writer.EndAttributesAndNode(); } @@ -98,6 +99,7 @@ namespace OOX { WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, _T("formatCode"), m_oFormatCode ) + WritingElement_ReadAttributes_Read_if ( oReader, _T("x16r2:formatCode16"), m_oFormatCode16 ) WritingElement_ReadAttributes_Read_if ( oReader, _T("numFmtId"), m_oNumFmtId ) WritingElement_ReadAttributes_Read_if ( oReader, _T("sourceLinked"), m_oSourceLinked ) @@ -117,6 +119,7 @@ namespace OOX public: nullable_string m_oFormatCode; + nullable_string m_oFormatCode16; nullable> m_oNumFmtId; nullable> m_oSourceLinked; }; diff --git a/XlsxSerializerCom/Common/BinReaderWriterDefines.h b/XlsxSerializerCom/Common/BinReaderWriterDefines.h index 2a7a6b1371..6c89b433cf 100755 --- a/XlsxSerializerCom/Common/BinReaderWriterDefines.h +++ b/XlsxSerializerCom/Common/BinReaderWriterDefines.h @@ -195,7 +195,8 @@ namespace BinXlsxRW namespace c_oSerNumFmtTypes{enum c_oSerNumFmtTypes { FormatCode = 0, - NumFmtId = 1 + NumFmtId = 1, + FormatCode16 = 2 };} namespace c_oSerSharedStringTypes{enum c_oSerSharedStringTypes { diff --git a/XlsxSerializerCom/Reader/BinaryWriter.cpp b/XlsxSerializerCom/Reader/BinaryWriter.cpp index 05fe7bddc7..b11d209a4e 100644 --- a/XlsxSerializerCom/Reader/BinaryWriter.cpp +++ b/XlsxSerializerCom/Reader/BinaryWriter.cpp @@ -1663,6 +1663,16 @@ void BinaryStyleTableWriter::WriteNumFmt(const OOX::Spreadsheet::CNumFmt& numFmt if(NULL != m_pEmbeddedFontsManager) m_pEmbeddedFontsManager->CheckString(sFormatCode); } + if(numFmt.m_oFormatCode16.IsInit()) + { + std::wstring& sFormatCode = *numFmt.m_oFormatCode16; + m_oBcw.m_oStream.WriteBYTE(c_oSerNumFmtTypes::FormatCode16); + m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Variable); + m_oBcw.m_oStream.WriteStringW(sFormatCode); + + if(NULL != m_pEmbeddedFontsManager) + m_pEmbeddedFontsManager->CheckString(sFormatCode); + } //NumFmtId if(numFmt.m_oNumFmtId.IsInit()) { diff --git a/XlsxSerializerCom/Writer/BinaryReader.cpp b/XlsxSerializerCom/Writer/BinaryReader.cpp index df06ff7435..77aa8857c9 100644 --- a/XlsxSerializerCom/Writer/BinaryReader.cpp +++ b/XlsxSerializerCom/Writer/BinaryReader.cpp @@ -1672,6 +1672,10 @@ int BinaryStyleTableReader::ReadNumFmt(BYTE type, long length, void* poResult) { pNumFmt->m_oFormatCode = m_oBufferedStream.GetString4(length); } + else if(c_oSerNumFmtTypes::FormatCode16 == type) + { + pNumFmt->m_oFormatCode16 = m_oBufferedStream.GetString4(length); + } else if(c_oSerNumFmtTypes::NumFmtId == type) { pNumFmt->m_oNumFmtId.Init();