Commit 3d198bc2 authored by Sergey Konovalov's avatar Sergey Konovalov

for xlsx comments: Tahoma 9, User name in comment body

parent 05ff75ee
...@@ -245,7 +245,7 @@ namespace OOX ...@@ -245,7 +245,7 @@ namespace OOX
} }
for ( std::list<OOX::WritingElement*>::iterator it1 = pShape->m_arrItems.begin(); it1 != pShape->m_arrItems.end(); it1++) for ( std::list<OOX::WritingElement*>::iterator it1 = pShape->m_arrItems.begin(); it1 != pShape->m_arrItems.end(); it1++)
{ {
OOX::WritingElement* pElem = *it; OOX::WritingElement* pElem = *it1;
if ( !pElem ) continue; if ( !pElem ) continue;
if( OOX::et_v_ClientData == pElem->getType()) if( OOX::et_v_ClientData == pElem->getType())
......
...@@ -3617,15 +3617,15 @@ namespace BinXlsxRW ...@@ -3617,15 +3617,15 @@ namespace BinXlsxRW
void WriteCommentDataContent(OOX::Spreadsheet::CCommentItem* pComment, SerializeCommon::CommentData* pCommentData, nullable<OOX::Spreadsheet::CSi>* pCommentText) void WriteCommentDataContent(OOX::Spreadsheet::CCommentItem* pComment, SerializeCommon::CommentData* pCommentData, nullable<OOX::Spreadsheet::CSi>* pCommentText)
{ {
int nCurPos = 0; int nCurPos = 0;
if(NULL != pCommentText && pCommentText->IsInit()) if(NULL != pCommentData && !pCommentData->sText.empty())
{ {
m_oBcw.m_oStream.WriteBYTE(c_oSer_CommentData::Text); m_oBcw.m_oStream.WriteBYTE(c_oSer_CommentData::Text);
m_oBcw.m_oStream.WriteStringW((*pCommentText)->ToString()); m_oBcw.m_oStream.WriteStringW(pCommentData->sText);
} }
else if(NULL != pCommentData && !pCommentData->sText.empty()) else if(NULL != pCommentText && pCommentText->IsInit())
{ {
m_oBcw.m_oStream.WriteBYTE(c_oSer_CommentData::Text); m_oBcw.m_oStream.WriteBYTE(c_oSer_CommentData::Text);
m_oBcw.m_oStream.WriteStringW(pCommentData->sText); m_oBcw.m_oStream.WriteStringW((*pCommentText)->ToString());
} }
if(NULL != pCommentData) if(NULL != pCommentData)
{ {
......
...@@ -2340,22 +2340,32 @@ namespace BinXlsxRW { ...@@ -2340,22 +2340,32 @@ namespace BinXlsxRW {
{ {
if(NULL != pCommentData && false == pCommentData->sText.empty()) if(NULL != pCommentData && false == pCommentData->sText.empty())
{ {
OOX::Spreadsheet::CRun* pRun = new OOX::Spreadsheet::CRun(); addCommentRun(oSi, pCommentData->sUserName + _T(":"), true);
pRun->m_oRPr.Init(); addCommentRun(oSi, _T("\n") + pCommentData->sText, false);
OOX::Spreadsheet::CRPr& pRPr = pRun->m_oRPr.get2(); }
pRPr.m_oRFont.Init(); }
pRPr.m_oRFont->m_sVal.Init(); void addCommentRun(OOX::Spreadsheet::CSi& oSi, const std::wstring& text, bool isBold)
pRPr.m_oRFont->m_sVal->append(_T("Tahoma")); {
pRPr.m_oSz.Init(); OOX::Spreadsheet::CRun* pRun = new OOX::Spreadsheet::CRun();
pRPr.m_oSz->m_oVal.Init(); pRun->m_oRPr.Init();
pRPr.m_oSz->m_oVal->SetValue(8); OOX::Spreadsheet::CRPr& pRPr = pRun->m_oRPr.get2();
if(isBold)
{
pRPr.m_oBold.Init();
pRPr.m_oBold->m_oVal.FromBool(true);
}
pRPr.m_oRFont.Init();
pRPr.m_oRFont->m_sVal.Init();
pRPr.m_oRFont->m_sVal->append(_T("Tahoma"));
pRPr.m_oSz.Init();
pRPr.m_oSz->m_oVal.Init();
pRPr.m_oSz->m_oVal->SetValue(9);
OOX::Spreadsheet::CText* pText = new OOX::Spreadsheet::CText(); OOX::Spreadsheet::CText* pText = new OOX::Spreadsheet::CText();
pText->m_sText.append(pCommentData->sText); pText->m_sText.append(text);
pRun->m_arrItems.push_back(pText); pRun->m_arrItems.push_back(pText);
oSi.m_arrItems.push_back(pRun); oSi.m_arrItems.push_back(pRun);
}
} }
}; };
class BinaryWorksheetsTableReader : public Binary_CommonReader<BinaryWorksheetsTableReader> class BinaryWorksheetsTableReader : public Binary_CommonReader<BinaryWorksheetsTableReader>
...@@ -4097,7 +4107,7 @@ namespace BinXlsxRW { ...@@ -4097,7 +4107,7 @@ namespace BinXlsxRW {
pRPr.m_oRFont->m_sVal->append(_T("Tahoma")); pRPr.m_oRFont->m_sVal->append(_T("Tahoma"));
pRPr.m_oSz.Init(); pRPr.m_oSz.Init();
pRPr.m_oSz->m_oVal.Init(); pRPr.m_oSz->m_oVal.Init();
pRPr.m_oSz->m_oVal->SetValue(8); pRPr.m_oSz->m_oVal->SetValue(9);
pRPr.m_oBold.Init(); pRPr.m_oBold.Init();
pRPr.m_oBold->FromBool(true); pRPr.m_oBold->FromBool(true);
......
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