Commit a52c1860 authored by Alexey.Musinov's avatar Alexey.Musinov

Merge branch 'develop' of https://github.com/ONLYOFFICE/core into develop

* 'develop' of https://github.com/ONLYOFFICE/core:
  for bug 33490
  RtfFormatReader - two and more levels in fields (contents, ...)
  fix bug 33488
parents 7824ce64 83bae8fa
......@@ -4404,6 +4404,17 @@ public:
if(m_oMath_rPr.IsNoEmpty())
m_oMath_rPr.Write(&GetRunStringWriter());
}
else if ( c_oSerRunType::arPr == type )
{
PPTX::Logic::RunProperties rPr;
m_oBufferedStream.Skip(1);//skip type
rPr.fromPPTY(&m_oBufferedStream);
rPr.m_name = L"a:rPr";
//todo use one writer
NSBinPptxRW::CXmlWriter oWriter;
rPr.toXmlWriter(&oWriter);
GetRunStringWriter().WriteString(oWriter.GetXmlString());
}
else if ( c_oSerRunType::del == type )
{
TrackRevision oRPrChange;
......
......@@ -503,7 +503,8 @@ extern int g_nCurFormatVersion;
footnoteRef = 24,
endnoteRef = 25,
footnoteReference = 26,
endnoteReference = 27
endnoteReference = 27,
arPr = 28
};}
namespace c_oSerImageType{enum c_oSerImageType
{
......
......@@ -3966,6 +3966,12 @@ namespace BinDocxRW
brPrs.Write_rPr(pCtrlPr.m_oRPr.get());
m_oBcw.WriteItemEnd(nCurPos2);
}
if ( pCtrlPr.m_oARPr.IsInit() )
{
int nCurPos2 = m_oBcw.WriteItemStart(c_oSerRunType::arPr);
m_oBcw.m_oStream.WriteRecord2(0, pCtrlPr.m_oARPr);
m_oBcw.WriteItemEnd(nCurPos2);
}
if ( pCtrlPr.m_oDel.IsInit() )
{
int nCurPos2 = m_oBcw.WriteItemStart(c_oSerRunType::del);
......
......@@ -1507,32 +1507,9 @@ namespace NSBinPptxRW
if (sizeof(wchar_t) == 4)
{
wchar_t * sBuffer = new wchar_t[lSize + 1];
memset(sBuffer, 0, lSize + 1);
std::wstring val = NSFile::CUtf8Converter::GetWStringFromUTF16((unsigned short*)m_pDataCur, lSize);
CString res(val.c_str(), val.length());
UTF16* pStrUtf16 = (UTF16 *) m_pDataCur;
UTF32 *pStrUtf32 = (UTF32 *) sBuffer;
// this values will be modificated
const UTF16 *pStrUtf16_Conv = pStrUtf16;
UTF32 *pStrUtf32_Conv = pStrUtf32;
ConversionResult eUnicodeConversionResult =
ConvertUTF16toUTF32 (&pStrUtf16_Conv
, &pStrUtf16[lSize]
, &pStrUtf32_Conv
, &pStrUtf32 [lSize]
, strictConversion);
if (conversionOK != eUnicodeConversionResult)
{
delete []sBuffer;
return _T("");
}
CString res((WCHAR*)sBuffer, lSize);
delete []sBuffer;
m_lPos += len;
m_pDataCur += len;
......@@ -1557,48 +1534,11 @@ namespace NSBinPptxRW
_UINT32 lSize = len >> 1; //string in char
if (sizeof(wchar_t) == 4)
{
wchar_t * sBuffer = new wchar_t[lSize + 1];
memset(sBuffer, 0, lSize + 1);
UTF16* pStrUtf16 = (UTF16 *)m_pDataCur;
UTF32 *pStrUtf32 = (UTF32 *)sBuffer;
// this values will be modificated
const UTF16 *pStrUtf16_Conv = pStrUtf16;
UTF32 *pStrUtf32_Conv = pStrUtf32;
ConversionResult eUnicodeConversionResult =
ConvertUTF16toUTF32(&pStrUtf16_Conv
, &pStrUtf16[lSize]
, &pStrUtf32_Conv
, &pStrUtf32[lSize]
, strictConversion);
if (conversionOK != eUnicodeConversionResult)
{
delete[]sBuffer;
return _T("");
}
std::wstring res((WCHAR*)sBuffer, lSize);
delete[]sBuffer;
m_lPos += len;
m_pDataCur += len;
return res;
}
else
{
std::wstring res((WCHAR*)m_pDataCur, lSize);
m_lPos += len;
m_pDataCur += len;
std::wstring res = NSFile::CUtf8Converter::GetWStringFromUTF16((unsigned short*)m_pDataCur, lSize);
m_lPos += len;
m_pDataCur += len;
return res;
}
return res;
}
bool CBinaryFileReader::GetArray(BYTE **pBuffer, _INT32 len)
......
......@@ -2380,6 +2380,14 @@ bool RtfParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfRead
{
m_oCurTab.m_eKind = RtfTab::tk_tqbar;
m_oCurTab.m_nTab = parameter;
if (!oReader.m_oState->m_oParagraphProp.m_oTabs.m_aTabs.empty())
{
if (oReader.m_oState->m_oParagraphProp.m_oTabs.m_aTabs.back().m_nTab > m_oCurTab.m_nTab)
{
oReader.m_oState->m_oParagraphProp.m_oTabs.m_aTabs.clear();
}
}
oReader.m_oState->m_oParagraphProp.m_oTabs.m_aTabs.push_back( m_oCurTab );
m_oCurTab.SetDefault();
}
......@@ -2389,6 +2397,14 @@ bool RtfParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfRead
if ( hasParameter )
{
m_oCurTab.m_nTab = parameter;
if (!oReader.m_oState->m_oParagraphProp.m_oTabs.m_aTabs.empty())
{
if (oReader.m_oState->m_oParagraphProp.m_oTabs.m_aTabs.back().m_nTab > m_oCurTab.m_nTab)
{
oReader.m_oState->m_oParagraphProp.m_oTabs.m_aTabs.clear();
}
}
oReader.m_oState->m_oParagraphProp.m_oTabs.m_aTabs.push_back( m_oCurTab );
m_oCurTab.SetDefault();
}
......
......@@ -49,7 +49,7 @@ CString RtfChar::RenderToOOX(RenderParameter oRenderParameter)
{
bInsert = true;
CString sAuthor = m_oProperty.m_nRevauth != PROP_DEF ? poRtfDocument->m_oRevisionTable[ m_oProperty.m_nRevauth] : L"";
CString sAuthor = poRtfDocument->m_oRevisionTable.GetAuthor(m_oProperty.m_nRevauth);
CString sDate(RtfUtility::convertDateTime(m_oProperty.m_nRevdttm).c_str());
sResult += L"<w:ins w:date=\"" + sDate + L"\" w:author=\"" + sAuthor + L"\" w:id=\"" + std::to_wstring(poOOXWriter->m_nCurTrackChangesId++).c_str() + L"\">";
......@@ -59,7 +59,7 @@ CString RtfChar::RenderToOOX(RenderParameter oRenderParameter)
{
bDelete = true;
CString sAuthor = m_oProperty.m_nRevauthDel != PROP_DEF ? poRtfDocument->m_oRevisionTable[ m_oProperty.m_nRevauthDel ] : L"";
CString sAuthor = poRtfDocument->m_oRevisionTable.GetAuthor(m_oProperty.m_nRevauthDel);
CString sDate(RtfUtility::convertDateTime(m_oProperty.m_nRevdttmDel).c_str());
sResult += L"<w:del w:date=\"" + sDate + L"\" w:author=\"" + sAuthor + L"\" w:id=\"" + std::to_wstring(poOOXWriter->m_nCurTrackChangesId++).c_str() + L"\">";
......@@ -89,7 +89,7 @@ CString RtfChar::RenderToOOX(RenderParameter oRenderParameter)
{
bInsert = true;
CString sAuthor = m_oProperty.m_nRevauth != PROP_DEF ? poRtfDocument->m_oRevisionTable[ m_oProperty.m_nRevauth] : L"";
CString sAuthor = poRtfDocument->m_oRevisionTable.GetAuthor(m_oProperty.m_nRevauth);
CString sDate(RtfUtility::convertDateTime(m_oProperty.m_nRevdttm).c_str());
sResult += L"<w:ins w:date=\"" + sDate + L"\" w:author=\"" + sAuthor + L"\" w:id=\"" + std::to_wstring(poOOXWriter->m_nCurTrackChangesId++).c_str() + L"\">";
......@@ -99,7 +99,7 @@ CString RtfChar::RenderToOOX(RenderParameter oRenderParameter)
{
bDelete = true;
CString sAuthor = m_oProperty.m_nRevauthDel != PROP_DEF ? poRtfDocument->m_oRevisionTable[ m_oProperty.m_nRevauthDel ] : L"";
CString sAuthor = poRtfDocument->m_oRevisionTable.GetAuthor(m_oProperty.m_nRevauthDel);
CString sDate(RtfUtility::convertDateTime(m_oProperty.m_nRevdttmDel).c_str());
sResult += L"<w:del w:date=\"" + sDate + L"\" w:author=\"" + sAuthor + L"\" w:id=\"" + std::to_wstring(poOOXWriter->m_nCurTrackChangesId++).c_str() + L"\">";
......@@ -356,7 +356,7 @@ CString RtfCharSpecial::RenderToOOX(RenderParameter oRenderParameter)
{
bInsert = true;
CString sAuthor = m_oProperty.m_nRevauth != PROP_DEF ? poRtfDocument->m_oRevisionTable[ m_oProperty.m_nRevauth] : L"";
CString sAuthor = poRtfDocument->m_oRevisionTable.GetAuthor(m_oProperty.m_nRevauth);
CString sDate(RtfUtility::convertDateTime(m_oProperty.m_nRevdttm).c_str());
sResult += L"<w:ins w:date=\"" + sDate + L"\" w:author=\"" + sAuthor + L"\" w:id=\"" + std::to_wstring(poOOXWriter->m_nCurTrackChangesId++).c_str() + L"\">";
......@@ -366,7 +366,7 @@ CString RtfCharSpecial::RenderToOOX(RenderParameter oRenderParameter)
{
bDelete = true;
CString sAuthor = m_oProperty.m_nRevauthDel != PROP_DEF ? poRtfDocument->m_oRevisionTable[ m_oProperty.m_nRevauthDel ] : L"";
CString sAuthor = poRtfDocument->m_oRevisionTable.GetAuthor(m_oProperty.m_nRevauthDel);
CString sDate(RtfUtility::convertDateTime(m_oProperty.m_nRevdttmDel).c_str());
sResult += L"<w:del w:date=\"" + sDate + L"\" w:author=\"" + sAuthor + L"\" w:id=\"" + std::to_wstring(poOOXWriter->m_nCurTrackChangesId++).c_str() + L"\">";
......
......@@ -164,7 +164,7 @@ CString RtfField::RenderToOOX(RenderParameter oRenderParameter)
{
bInsert = true;
sAuthor = m_pInsert->m_oCharProperty.m_nRevauth != PROP_DEF ? poRtfDocument->m_oRevisionTable[ m_pInsert->m_oCharProperty.m_nRevauth] : L"";
sAuthor = poRtfDocument->m_oRevisionTable.GetAuthor(m_pInsert->m_oCharProperty.m_nRevauth);
sDate = CString(RtfUtility::convertDateTime(m_pInsert->m_oCharProperty.m_nRevdttm).c_str());
sResult += L"<w:ins w:date=\"" + sDate + L"\" w:author=\"" + sAuthor + L"\" w:id=\"" + std::to_wstring(poOOXWriter->m_nCurTrackChangesId++).c_str() + L"\">";
......@@ -174,7 +174,7 @@ CString RtfField::RenderToOOX(RenderParameter oRenderParameter)
{
bDelete = true;
sAuthor = m_pInsert->m_oCharProperty.m_nRevauthDel != PROP_DEF ? poRtfDocument->m_oRevisionTable[ m_pInsert->m_oCharProperty.m_nRevauthDel ] : L"";
sAuthor = poRtfDocument->m_oRevisionTable.GetAuthor(m_pInsert->m_oCharProperty.m_nRevauthDel);
sDate = CString(RtfUtility::convertDateTime(m_pInsert->m_oCharProperty.m_nRevdttmDel).c_str());
sResult += L"<w:del w:date=\"" + sDate + L"\" w:author=\"" + sAuthor + L"\" w:id=\"" + std::to_wstring(poOOXWriter->m_nCurTrackChangesId++).c_str() + L"\">";
......@@ -229,13 +229,15 @@ CString RtfField::RenderToOOX(RenderParameter oRenderParameter)
sResult += props;
sResult += L"<w:fldChar w:fldCharType=\"begin\"/>";
sResult += L"</w:r>";
CString str = Utils::PrepareToXML( m_pInsert->m_pTextItems->RenderToOOX(oNewParametr) );
//-----------
sResult += L"<w:r>";
sResult += L"<w:instrText xml:space=\"preserve\">";
sResult += str;
if (m_pInsert->m_pTextItems)
{
sResult += Utils::PrepareToXML( m_pInsert->m_pTextItems->RenderToOOX(oNewParametr) );
}
sResult += L"</w:instrText></w:r>";
// разделитель
......@@ -243,11 +245,33 @@ CString RtfField::RenderToOOX(RenderParameter oRenderParameter)
sResult += L"<w:fldChar w:fldCharType=\"separate\"/></w:r>";
//пишем содержание-кэш
sResult += L"<w:r>";
if (!props.IsEmpty())
sResult += props;
sResult += m_pResult->m_pTextItems->RenderToOOX(oNewParametr);
sResult += L"</w:r>";
if ((m_pResult->m_pTextItems) && (m_pResult->m_pTextItems->GetCount() > 0))
{
oNewParametr.nType = RENDER_TO_OOX_PARAM_RUN;
sResult += m_pResult->m_pTextItems->m_aArray[0]->RenderToOOX(oNewParametr);
for (int i = 1; i < m_pResult->m_pTextItems->GetCount(); i++)
{
RtfParagraph *paragraph = dynamic_cast<RtfParagraph *>(m_pResult->m_pTextItems->m_aArray[i].get());
if (paragraph)
{
sResult += L"</w:p>";
sResult += L"<w:p>";
sResult += L"<w:pPr>";
sResult += paragraph->m_oProperty.RenderToOOX(oRenderParameter);
sResult += L"</w:pPr>";
}
sResult += m_pResult->m_pTextItems->m_aArray[i]->RenderToOOX(oNewParametr);
}
}
else
{
sResult += L"<w:r>";
if (!props.IsEmpty())
sResult += props;
sResult += L"</w:r>";
}
//заканчиваем Field
sResult += L"<w:r><w:fldChar w:fldCharType=\"end\"/></w:r>";
......
......@@ -466,6 +466,14 @@ public:
i = AddItem(author);
return i;
}
CString GetAuthor(int ind)
{
if (ind == PROP_DEF || ind > m_aArray.size())
return L"";
return m_aArray[ind];
}
};
//class RtfRSIDTable : public IDocumentElement, public ItemContainer<rsidString>
......
......@@ -60,7 +60,7 @@ CString RtfOle::RenderToOOX(RenderParameter oRenderParameter)
{
bInsert = true;
CString sAuthor = pCharProps->m_nRevauth != PROP_DEF ? poRtfDocument->m_oRevisionTable[ pCharProps->m_nRevauth] : L"";
CString sAuthor = poRtfDocument->m_oRevisionTable.GetAuthor(pCharProps->m_nRevauth);
CString sDate(RtfUtility::convertDateTime(pCharProps->m_nRevdttm).c_str());
sResult += L"<w:ins w:date=\"" + sDate + L"\" w:author=\"" + sAuthor + L"\" w:id=\"" + std::to_wstring(poOOXWriter->m_nCurTrackChangesId++).c_str() + L"\">";
......@@ -70,7 +70,7 @@ CString RtfOle::RenderToOOX(RenderParameter oRenderParameter)
{
bDelete = true;
CString sAuthor = pCharProps->m_nRevauthDel != PROP_DEF ? poRtfDocument->m_oRevisionTable[ pCharProps->m_nRevauthDel ] : L"";
CString sAuthor = poRtfDocument->m_oRevisionTable.GetAuthor(pCharProps->m_nRevauthDel);
CString sDate(RtfUtility::convertDateTime(pCharProps->m_nRevdttmDel).c_str());
sResult += L"<w:del w:date=\"" + sDate + L"\" w:author=\"" + sAuthor + L"\" w:id=\"" + std::to_wstring(poOOXWriter->m_nCurTrackChangesId++).c_str() + L"\">";
......
......@@ -747,7 +747,7 @@ CString RtfCharProperty::RenderToOOX(RenderParameter oRenderParameter)
{
bInsert = true;
CString sAuthor = m_nRevauth != PROP_DEF ? poRtfDocument->m_oRevisionTable[ m_nRevauth] : L"";
CString sAuthor = poRtfDocument->m_oRevisionTable.GetAuthor(m_nRevauth);
CString sDate(RtfUtility::convertDateTime( m_nRevdttm ).c_str());
sResult += L"<w:ins w:date=\"" + sDate + L"\" w:author=\"" + sAuthor + L"\" w:id=\"" + std::to_wstring(poOOXWriter->m_nCurTrackChangesId++).c_str() + L"\">";
......@@ -757,7 +757,7 @@ CString RtfCharProperty::RenderToOOX(RenderParameter oRenderParameter)
{
bDelete = true;
CString sAuthor = m_nRevauthDel != PROP_DEF ? poRtfDocument->m_oRevisionTable[ m_nRevauthDel ] : L"";
CString sAuthor = poRtfDocument->m_oRevisionTable.GetAuthor(m_nRevauthDel);
CString sDate(RtfUtility::convertDateTime( m_nRevdttmDel ).c_str());
sResult += L"<w:del w:date=\"" + sDate + L"\" w:author=\"" + sAuthor + L"\" w:id=\"" + std::to_wstring(poOOXWriter->m_nCurTrackChangesId++).c_str() + L"\">";
......@@ -768,14 +768,14 @@ CString RtfCharProperty::RenderToOOX(RenderParameter oRenderParameter)
if ( PROP_DEF != m_nDeleted )//для rPr в pPr
{
CString sAuthor = m_nRevauthDel != PROP_DEF ? poRtfDocument->m_oRevisionTable[ m_nRevauthDel] : L"";
CString sAuthor = poRtfDocument->m_oRevisionTable.GetAuthor(m_nRevauthDel);
CString sDate(RtfUtility::convertDateTime(m_nRevdttmDel).c_str());
sResult += L"<w:del w:date=\"" + sDate + L"\" w:author=\"" + sAuthor + L"\" w:id=\"" + std::to_wstring(poOOXWriter->m_nCurTrackChangesId++).c_str() + L"\"/>";
}
if ( PROP_DEF != m_nRevised )
{
CString sAuthor = m_nRevauth != PROP_DEF ? poRtfDocument->m_oRevisionTable[ m_nRevauth] : L"";
CString sAuthor = poRtfDocument->m_oRevisionTable.GetAuthor(m_nRevauth);
CString sDate(RtfUtility::convertDateTime(m_nRevdttm).c_str());
sResult += L"<w:ins w:date=\"" + sDate + L"\" w:author=\"" + sAuthor + L"\" w:id=\"" + std::to_wstring(poOOXWriter->m_nCurTrackChangesId++).c_str() + L"\"/>";
......@@ -962,7 +962,7 @@ CString RtfCharProperty::RenderToOOX(RenderParameter oRenderParameter)
if (m_pOldCharProp)
{
CString sAuthor = m_nCrAuth != PROP_DEF ? poRtfDocument->m_oRevisionTable[ m_nCrAuth] : L"";
CString sAuthor = poRtfDocument->m_oRevisionTable.GetAuthor(m_nCrAuth);
CString sDate(RtfUtility::convertDateTime(m_nCrDate).c_str());
RenderParameter oRenderParameterNew = oRenderParameter;
......@@ -2168,7 +2168,7 @@ CString RtfParagraphProperty::RenderToOOX(RenderParameter oRenderParameter)
}
if (m_pOldParagraphProp)
{
CString sAuthor = m_nPrAuth != PROP_DEF ? poRtfDocument->m_oRevisionTable[ m_nPrAuth] : L"";
CString sAuthor = poRtfDocument->m_oRevisionTable.GetAuthor(m_nPrAuth);
CString sDate(RtfUtility::convertDateTime(m_nPrDate).c_str());
RenderParameter oRenderParameterNew = oRenderParameter;
......@@ -2859,19 +2859,19 @@ CString RtfRowProperty::RenderToOOX(RenderParameter oRenderParameter)
m_pOldRowProperty;
//if ( PROP_DEF != oReader.m_oState->m_oCharProp.m_nDeleted )
//{
// CString sAuthor = oReader.m_oState->m_oCharProp.m_nRevauthDel != PROP_DEF ? poRtfDocument->m_oRevisionTable[ oReader.m_oState->m_oCharProp.m_nRevauthDel] : L"";
// CString sAuthor = poRtfDocument->m_oRevisionTable.GetAuthor(oReader.m_oState->m_oCharProp.m_nRevauthDel);
// CString sDate(RtfUtility::convertDateTime(oReader.m_oState->m_oCharProp.m_nRevdttmDel).c_str());
// sResult += L"<w:del w:date=\"" + sDate + L"\" w:author=\"" + sAuthor + L"\" w:id=\"" + std::to_wstring(poOOXWriter->m_nCurTrackChangesId++).c_str() + L"\"/>";
//}
//if ( PROP_DEF != oReader.m_oState->m_oCharProp.m_nRevised )
//{
// CString sAuthor = m_nRevauth != PROP_DEF ? poRtfDocument->m_oRevisionTable[ oReader.m_oState->m_oCharProp.m_nRevauth] : L"";
// CString sAuthor = poRtfDocument->m_oRevisionTable.GetAuthor(oReader.m_oState->m_oCharProp.m_nRevauth);
// CString sDate(RtfUtility::convertDateTime(oReader.m_oState->m_oCharProp.m_nRevdttm).c_str());
//
// sResult += L"<w:ins w:date=\"" + sDate + L"\" w:author=\"" + sAuthor + L"\" w:id=\"" + std::to_wstring(poOOXWriter->m_nCurTrackChangesId++).c_str() + L"\"/>";
//}
CString sAuthor = m_nTrAuth != PROP_DEF ? poRtfDocument->m_oRevisionTable[ m_nTrAuth] : L"";
CString sAuthor = poRtfDocument->m_oRevisionTable.GetAuthor(m_nTrAuth);
CString sDate(RtfUtility::convertDateTime(m_nTrDate).c_str());
RenderParameter oRenderParameterNew = oRenderParameter;
......
......@@ -823,7 +823,7 @@ CString RtfSectionProperty::RenderToOOX(RenderParameter oRenderParameter)
}
if (m_pOldSectionProp)
{
CString sAuthor = m_nSrAuth != PROP_DEF ? poRtfDocument->m_oRevisionTable[ m_nSrAuth] : L"";
CString sAuthor = poRtfDocument->m_oRevisionTable.GetAuthor(m_nSrAuth);
CString sDate(RtfUtility::convertDateTime(m_nSrDate).c_str());
RenderParameter oRenderParameterNew = oRenderParameter;
......
......@@ -753,7 +753,7 @@ CString RtfShape::RenderToOOXBegin(RenderParameter oRenderParameter)
{
m_bInsert = true;
CString sAuthor = m_oCharProperty.m_nRevauth != PROP_DEF ? poRtfDocument->m_oRevisionTable[ m_oCharProperty.m_nRevauth] : L"";
CString sAuthor = poRtfDocument->m_oRevisionTable.GetAuthor(m_oCharProperty.m_nRevauth);
CString sDate(RtfUtility::convertDateTime(m_oCharProperty.m_nRevdttm).c_str());
sResult += L"<w:ins w:date=\"" + sDate + L"\" w:author=\"" + sAuthor + L"\" w:id=\"" + std::to_wstring(poOOXWriter->m_nCurTrackChangesId++).c_str() + L"\">";
......@@ -763,7 +763,7 @@ CString RtfShape::RenderToOOXBegin(RenderParameter oRenderParameter)
{
m_bDelete = true;
CString sAuthor = m_oCharProperty.m_nRevauthDel != PROP_DEF ? poRtfDocument->m_oRevisionTable[ m_oCharProperty.m_nRevauthDel ] : L"";
CString sAuthor = poRtfDocument->m_oRevisionTable.GetAuthor(m_oCharProperty.m_nRevauthDel);
CString sDate(RtfUtility::convertDateTime(m_oCharProperty.m_nRevdttmDel).c_str());
sResult += L"<w:del w:date=\"" + sDate + L"\" w:author=\"" + sAuthor + L"\" w:id=\"" + std::to_wstring(poOOXWriter->m_nCurTrackChangesId++).c_str() + L"\">";
......
......@@ -600,6 +600,14 @@ namespace OOX
std::wstring sName = oReader.GetName();
if ( _T("w:rPr") == sName )
m_oRPr = oReader;
else if ( _T("a:rPr") == sName )
{
CString sXml = oReader.GetOuterXml();
XmlUtils::CXmlNode node;
node.FromXmlString(sXml.GetBuffer());
sXml.ReleaseBuffer();
m_oARPr = node;
}
else if ( _T("w:ins") == sName )
m_oIns = oReader;
else if ( _T("w:del") == sName )
......@@ -612,6 +620,8 @@ namespace OOX
if ( m_oRPr.IsInit() )
sResult += m_oRPr->toXML();
if ( m_oARPr.IsInit() )
sResult += m_oARPr->toXML();
if ( m_oIns.IsInit() )
sResult += m_oIns->toXML();
if ( m_oDel.IsInit() )
......@@ -629,6 +639,7 @@ namespace OOX
public:
//Childs
nullable<OOX::Logic::CRunProperty> m_oRPr;
nullable<PPTX::Logic::RunProperties> m_oARPr;
nullable<OOX::Logic::CRPrChange> m_oIns;
nullable<OOX::Logic::CRPrChange> m_oDel;
};
......
......@@ -542,7 +542,7 @@ namespace NSFile
int nCurrent = 0;
while (nCurrent < nCount)
{
if (*pShort < 0xD800 || *pShort > 0xDFFF)
if (*pShort < 0xD800 || *pShort > 0xDBFF)
{
*pWCurrent = (wchar_t)(*pShort);
++pShort;
......@@ -550,7 +550,7 @@ namespace NSFile
}
else
{
*pWCurrent = (wchar_t)((((pShort[0]) & 0x03FF) << 10) | ((pShort[1]) & 0x03FF));
*pWCurrent = (wchar_t)(((((pShort[0] - 0xD800) & 0x03FF) << 10) | ((pShort[1] - 0xDC00) & 0x03FF)) + 0x10000);
pShort += 2;
nCurrent += 2;
}
......
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