Commit 687d7d1e authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander Trofimov

(1.0.0.100) - XlsxSerializerCom.dll

Запись дефалтовых стилей с заголовком + для бордеров не пишем информацию, если нет стиля
Excel Serializer - подменил дефалтовые стили с учетом отсутствия информации о пустых бордерах

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@53706 954022d7-b5bf-4e40-9824-e11837661b57
parent 662b27e6
...@@ -23,6 +23,7 @@ namespace BinXlsxRW { ...@@ -23,6 +23,7 @@ namespace BinXlsxRW {
static TCHAR* gc_sMimeName = _T("mimetype"); static TCHAR* gc_sMimeName = _T("mimetype");
#ifdef DEFAULT_TABLE_STYLES #ifdef DEFAULT_TABLE_STYLES
CString WriteDefaultFileHeader(int nDataSize);
void getDefaultCellStyles(CString& sFileInput, CString& sFileOutput, NSFontCutter::CEmbeddedFontsManager* pEmbeddedFontsManager, OOX::Spreadsheet::CIndexedColors* oIndexedColors, OOX::CTheme* pTheme, BinXlsxRW::FontProcessor& oFontProcessor); void getDefaultCellStyles(CString& sFileInput, CString& sFileOutput, NSFontCutter::CEmbeddedFontsManager* pEmbeddedFontsManager, OOX::Spreadsheet::CIndexedColors* oIndexedColors, OOX::CTheme* pTheme, BinXlsxRW::FontProcessor& oFontProcessor);
void getDefaultTableStyles(CString& sFileInput, CString& sFileOutput, NSFontCutter::CEmbeddedFontsManager* pEmbeddedFontsManager, OOX::Spreadsheet::CIndexedColors* oIndexedColors, OOX::CTheme* pTheme, BinXlsxRW::FontProcessor& oFontProcessor); void getDefaultTableStyles(CString& sFileInput, CString& sFileOutput, NSFontCutter::CEmbeddedFontsManager* pEmbeddedFontsManager, OOX::Spreadsheet::CIndexedColors* oIndexedColors, OOX::CTheme* pTheme, BinXlsxRW::FontProcessor& oFontProcessor);
void writeTheme(LPSAFEARRAY pThemeData, CString& sFileOutput); void writeTheme(LPSAFEARRAY pThemeData, CString& sFileOutput);
...@@ -1212,49 +1213,49 @@ namespace BinXlsxRW { ...@@ -1212,49 +1213,49 @@ namespace BinXlsxRW {
{ {
int nCurPos = 0; int nCurPos = 0;
//Bottom //Bottom
if(false != border.m_oBottom.IsInit()) if(false != border.m_oBottom.IsInit() && false != border.m_oBottom->m_oStyle.IsInit())
{ {
nCurPos = m_oBcw.WriteItemStart(c_oSerBorderTypes::Bottom); nCurPos = m_oBcw.WriteItemStart(c_oSerBorderTypes::Bottom);
WriteBorderProp(border.m_oBottom.get(), pIndexedColors, pTheme); WriteBorderProp(border.m_oBottom.get(), pIndexedColors, pTheme);
m_oBcw.WriteItemEnd(nCurPos); m_oBcw.WriteItemEnd(nCurPos);
} }
//Diagonal //Diagonal
if(false != border.m_oDiagonal.IsInit()) if(false != border.m_oDiagonal.IsInit() && false != border.m_oDiagonal->m_oStyle.IsInit())
{ {
nCurPos = m_oBcw.WriteItemStart(c_oSerBorderTypes::Diagonal); nCurPos = m_oBcw.WriteItemStart(c_oSerBorderTypes::Diagonal);
WriteBorderProp(border.m_oDiagonal.get(), pIndexedColors, pTheme); WriteBorderProp(border.m_oDiagonal.get(), pIndexedColors, pTheme);
m_oBcw.WriteItemEnd(nCurPos); m_oBcw.WriteItemEnd(nCurPos);
} }
//End //End
if(false != border.m_oEnd.IsInit()) if(false != border.m_oEnd.IsInit() && false != border.m_oEnd->m_oStyle.IsInit())
{ {
nCurPos = m_oBcw.WriteItemStart(c_oSerBorderTypes::End); nCurPos = m_oBcw.WriteItemStart(c_oSerBorderTypes::End);
WriteBorderProp(border.m_oEnd.get(), pIndexedColors, pTheme); WriteBorderProp(border.m_oEnd.get(), pIndexedColors, pTheme);
m_oBcw.WriteItemEnd(nCurPos); m_oBcw.WriteItemEnd(nCurPos);
} }
//Horizontal //Horizontal
if(false != border.m_oHorizontal.IsInit()) if(false != border.m_oHorizontal.IsInit() && false != border.m_oHorizontal->m_oStyle.IsInit())
{ {
nCurPos = m_oBcw.WriteItemStart(c_oSerBorderTypes::Horizontal); nCurPos = m_oBcw.WriteItemStart(c_oSerBorderTypes::Horizontal);
WriteBorderProp(border.m_oHorizontal.get(), pIndexedColors, pTheme); WriteBorderProp(border.m_oHorizontal.get(), pIndexedColors, pTheme);
m_oBcw.WriteItemEnd(nCurPos); m_oBcw.WriteItemEnd(nCurPos);
} }
//Start //Start
if(false != border.m_oStart.IsInit()) if(false != border.m_oStart.IsInit() && false != border.m_oStart->m_oStyle.IsInit())
{ {
nCurPos = m_oBcw.WriteItemStart(c_oSerBorderTypes::Start); nCurPos = m_oBcw.WriteItemStart(c_oSerBorderTypes::Start);
WriteBorderProp(border.m_oStart.get(), pIndexedColors, pTheme); WriteBorderProp(border.m_oStart.get(), pIndexedColors, pTheme);
m_oBcw.WriteItemEnd(nCurPos); m_oBcw.WriteItemEnd(nCurPos);
} }
//Top //Top
if(false != border.m_oTop.IsInit()) if(false != border.m_oTop.IsInit() && false != border.m_oTop->m_oStyle.IsInit())
{ {
nCurPos = m_oBcw.WriteItemStart(c_oSerBorderTypes::Top); nCurPos = m_oBcw.WriteItemStart(c_oSerBorderTypes::Top);
WriteBorderProp(border.m_oTop.get(), pIndexedColors, pTheme); WriteBorderProp(border.m_oTop.get(), pIndexedColors, pTheme);
m_oBcw.WriteItemEnd(nCurPos); m_oBcw.WriteItemEnd(nCurPos);
} }
//Vertical //Vertical
if(false != border.m_oVertical.IsInit()) if(false != border.m_oVertical.IsInit() && false != border.m_oVertical->m_oStyle.IsInit())
{ {
nCurPos = m_oBcw.WriteItemStart(c_oSerBorderTypes::Vertical); nCurPos = m_oBcw.WriteItemStart(c_oSerBorderTypes::Vertical);
WriteBorderProp(border.m_oVertical.get(), pIndexedColors, pTheme); WriteBorderProp(border.m_oVertical.get(), pIndexedColors, pTheme);
...@@ -3841,8 +3842,8 @@ namespace BinXlsxRW { ...@@ -3841,8 +3842,8 @@ namespace BinXlsxRW {
if(NULL != pStyle && pStyle->m_oColors.IsInit() && pStyle->m_oColors->m_oIndexedColors.IsInit()) if(NULL != pStyle && pStyle->m_oColors.IsInit() && pStyle->m_oColors->m_oIndexedColors.IsInit())
pIndexedColors = pStyle->m_oColors->m_oIndexedColors.operator ->(); pIndexedColors = pStyle->m_oColors->m_oIndexedColors.operator ->();
#ifdef DEFAULT_TABLE_STYLES #ifdef DEFAULT_TABLE_STYLES
getDefaultCellStyles(CString(_T("D:\\Subversion\\AVS\\Sources\\TeamlabOffice\\trunk\\XlsxSerializerCom\\XlsxDefaults\\presetCellStylesNew.xml")), CString(_T("C:\\presetCellStyles_output.bin")), pEmbeddedFontsManager, pIndexedColors, oXlsx.GetTheme(), m_oFontProcessor); getDefaultCellStyles(CString(_T("D:\\Projects\\AVS\\Sources\\TeamlabOffice\\trunk\\ServerComponents\\XlsxSerializerCom\\XlsxDefaults\\presetCellStylesNew.xml")), CString(_T("C:\\presetCellStyles_output.bin")), pEmbeddedFontsManager, pIndexedColors, oXlsx.GetTheme(), m_oFontProcessor);
getDefaultTableStyles(CString(_T("D:\\Subversion\\AVS\\Sources\\TeamlabOffice\\trunk\\XlsxSerializerCom\\XlsxDefaults\\presetTableStyles.xml")), CString(_T("C:\\presetTableStyles_output.bin")), pEmbeddedFontsManager, pIndexedColors, oXlsx.GetTheme(), m_oFontProcessor); getDefaultTableStyles(CString(_T("D:\\Projects\\AVS\\Sources\\TeamlabOffice\\trunk\\ServerComponents\\XlsxSerializerCom\\XlsxDefaults\\presetTableStyles.xml")), CString(_T("C:\\presetTableStyles_output.bin")), pEmbeddedFontsManager, pIndexedColors, oXlsx.GetTheme(), m_oFontProcessor);
#endif #endif
if(NULL != pSharedStrings) if(NULL != pSharedStrings)
{ {
...@@ -3960,6 +3961,12 @@ namespace BinXlsxRW { ...@@ -3960,6 +3961,12 @@ namespace BinXlsxRW {
} }
}; };
#ifdef DEFAULT_TABLE_STYLES #ifdef DEFAULT_TABLE_STYLES
CString WriteDefaultFileHeader(int nDataSize)
{
CString sHeader;
sHeader.Format(_T("%s;;%d;"), g_sFormatSignature, nDataSize);
return sHeader;
}
void getDefaultCellStyles(CString& sFileInput, CString& sFileOutput, NSFontCutter::CEmbeddedFontsManager* pEmbeddedFontsManager, OOX::Spreadsheet::CIndexedColors* oIndexedColors, OOX::CTheme* pTheme, BinXlsxRW::FontProcessor& oFontProcessor) void getDefaultCellStyles(CString& sFileInput, CString& sFileOutput, NSFontCutter::CEmbeddedFontsManager* pEmbeddedFontsManager, OOX::Spreadsheet::CIndexedColors* oIndexedColors, OOX::CTheme* pTheme, BinXlsxRW::FontProcessor& oFontProcessor)
{ {
enum Types enum Types
...@@ -4143,6 +4150,7 @@ namespace BinXlsxRW { ...@@ -4143,6 +4150,7 @@ namespace BinXlsxRW {
{ {
CFile oFile; CFile oFile;
oFile.CreateFileW(sFileOutput); oFile.CreateFileW(sFileOutput);
oFile.WriteStringUTF8(WriteDefaultFileHeader(nBinBufferLen));
oFile.WriteFile(pbBase64Buffer, nBase64BufferLen); oFile.WriteFile(pbBase64Buffer, nBase64BufferLen);
oFile.CloseFile(); oFile.CloseFile();
} }
...@@ -4203,6 +4211,7 @@ namespace BinXlsxRW { ...@@ -4203,6 +4211,7 @@ namespace BinXlsxRW {
{ {
CFile oFile; CFile oFile;
oFile.CreateFileW(sFileOutput); oFile.CreateFileW(sFileOutput);
oFile.WriteStringUTF8(WriteDefaultFileHeader(nBinBufferLen));
oFile.WriteFile(pbBase64Buffer, nBase64BufferLen); oFile.WriteFile(pbBase64Buffer, nBase64BufferLen);
oFile.CloseFile(); oFile.CloseFile();
} }
...@@ -4218,6 +4227,7 @@ namespace BinXlsxRW { ...@@ -4218,6 +4227,7 @@ namespace BinXlsxRW {
{ {
CFile oFile; CFile oFile;
oFile.CreateFileW(sFileOutput); oFile.CreateFileW(sFileOutput);
oFile.WriteStringUTF8(WriteDefaultFileHeader(nBinBufferLen));
oFile.WriteFile(pbBase64Buffer, nBase64BufferLen); oFile.WriteFile(pbBase64Buffer, nBase64BufferLen);
oFile.CloseFile(); oFile.CloseFile();
} }
......
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
//1 //1
//0 //0
//0 //0
//99 //100
#define INTVER 1,0,0,99 #define INTVER 1,0,0,100
#define STRVER "1,0,0,99\0" #define STRVER "1,0,0,100\0"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment