Commit 0c97a400 authored by Sergey.Konovalov's avatar Sergey.Konovalov Committed by Alexander Trofimov

(2.0.0.257): ASCOfficeDocxFile2

Записать и чтение в бинарник fldSimple; Экранирование спецсимволов в комментариях pptx

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@60877 954022d7-b5bf-4e40-9824-e11837661b57
parent 036880c6
...@@ -2385,5 +2385,26 @@ public: ...@@ -2385,5 +2385,26 @@ public:
} }
} }
}; };
class CFldSimple{
public:
CString sInstr;
XmlUtils::CStringWriter writer;
public:
CFldSimple()
{
}
void Write(XmlUtils::CStringWriter& wr)
{
if(false == sInstr.IsEmpty())
{
CString sCorrect_Instr = XmlUtils::EncodeXmlString(sInstr);
CString sStart;
sStart.Format(_T("<w:fldSimple w:instr=\"%s\">"), (const TCHAR *) sCorrect_Instr);
wr.WriteString(sStart);
wr.Write(writer);
wr.WriteString(CString(_T("</w:fldSimple>")));
}
}
};
} }
#endif // #ifndef READER_CLASSES #endif // #ifndef READER_CLASSES
\ No newline at end of file
...@@ -2865,7 +2865,7 @@ class Binary_DocumentTableReader : public Binary_CommonReader<Binary_DocumentTab ...@@ -2865,7 +2865,7 @@ class Binary_DocumentTableReader : public Binary_CommonReader<Binary_DocumentTab
Binary_pPrReader oBinary_pPrReader; Binary_pPrReader oBinary_pPrReader;
Binary_rPrReader oBinary_rPrReader; Binary_rPrReader oBinary_rPrReader;
Binary_tblPrReader oBinary_tblPrReader; Binary_tblPrReader oBinary_tblPrReader;
CHyperlink* m_pCurHyperlink; XmlUtils::CStringWriter* m_pCurWriter;
rPr m_oCur_rPr; rPr m_oCur_rPr;
rPr m_oMath_rPr; rPr m_oMath_rPr;
XmlUtils::CStringWriter m_oCur_pPr; XmlUtils::CStringWriter m_oCur_pPr;
...@@ -2878,7 +2878,7 @@ public: ...@@ -2878,7 +2878,7 @@ public:
Binary_DocumentTableReader(NSBinPptxRW::CBinaryFileReader& poBufferedStream, Writers::FileWriter& oFileWriter, Writers::ContentWriter& oDocumentWriter, CComments* pComments):Binary_CommonReader(poBufferedStream),m_oDocumentWriter(oDocumentWriter),m_oFileWriter(oFileWriter),m_oMediaWriter(oFileWriter.m_oMediaWriter),m_oFontTableWriter(oFileWriter.m_oFontTableWriter),oBinary_pPrReader(poBufferedStream, oFileWriter),oBinary_rPrReader(poBufferedStream), oBinary_tblPrReader(poBufferedStream, oFileWriter),m_oCur_rPr(m_oFontTableWriter.m_mapFonts),m_oMath_rPr(m_oFontTableWriter.m_mapFonts),m_pComments(pComments) Binary_DocumentTableReader(NSBinPptxRW::CBinaryFileReader& poBufferedStream, Writers::FileWriter& oFileWriter, Writers::ContentWriter& oDocumentWriter, CComments* pComments):Binary_CommonReader(poBufferedStream),m_oDocumentWriter(oDocumentWriter),m_oFileWriter(oFileWriter),m_oMediaWriter(oFileWriter.m_oMediaWriter),m_oFontTableWriter(oFileWriter.m_oFontTableWriter),oBinary_pPrReader(poBufferedStream, oFileWriter),oBinary_rPrReader(poBufferedStream), oBinary_tblPrReader(poBufferedStream, oFileWriter),m_oCur_rPr(m_oFontTableWriter.m_mapFonts),m_oMath_rPr(m_oFontTableWriter.m_mapFonts),m_pComments(pComments)
{ {
m_byteLastElemType = c_oSerParType::Content; m_byteLastElemType = c_oSerParType::Content;
m_pCurHyperlink = NULL; m_pCurWriter = NULL;
} }
~Binary_DocumentTableReader() ~Binary_DocumentTableReader()
{ {
...@@ -2889,8 +2889,8 @@ public: ...@@ -2889,8 +2889,8 @@ public:
}; };
XmlUtils::CStringWriter& GetRunStringWriter() XmlUtils::CStringWriter& GetRunStringWriter()
{ {
if(NULL != m_pCurHyperlink) if(NULL != m_pCurWriter)
return m_pCurHyperlink->writer; return *m_pCurWriter;
else else
return m_oDocumentWriter.m_oContent; return m_oDocumentWriter.m_oContent;
} }
...@@ -3004,6 +3004,29 @@ public: ...@@ -3004,6 +3004,29 @@ public:
res = Read1(length, &Binary_DocumentTableReader::ReadHyperlink, this, &oHyperlink); res = Read1(length, &Binary_DocumentTableReader::ReadHyperlink, this, &oHyperlink);
oHyperlink.Write(GetRunStringWriter()); oHyperlink.Write(GetRunStringWriter());
} }
else if ( c_oSerParType::FldSimple == type )
{
CFldSimple oFldSimple;
res = Read1(length, &Binary_DocumentTableReader::ReadFldSimple, this, &oFldSimple);
oFldSimple.Write(GetRunStringWriter());
}
else
res = c_oSerConstants::ReadUnknown;
return res;
}
int ReadFldSimple(BYTE type, long length, void* poResult)
{
int res = c_oSerConstants::ReadOk;
CFldSimple* pFldSimple = static_cast<CFldSimple*>(poResult);
if ( c_oSer_HyperlinkType::Link == type )
pFldSimple->sInstr = m_oBufferedStream.GetString3(length);
else if ( c_oSer_HyperlinkType::Content == type )
{
XmlUtils::CStringWriter* pPrevWriter = m_pCurWriter;
m_pCurWriter = &pFldSimple->writer;
res = Read1(length, &Binary_DocumentTableReader::ReadParagraphContent, this, NULL);
m_pCurWriter = pPrevWriter;
}
else else
res = c_oSerConstants::ReadUnknown; res = c_oSerConstants::ReadUnknown;
return res; return res;
...@@ -3029,15 +3052,15 @@ public: ...@@ -3029,15 +3052,15 @@ public:
pHyperlink->sTgtFrame = m_oBufferedStream.GetString3(length); pHyperlink->sTgtFrame = m_oBufferedStream.GetString3(length);
else if ( c_oSer_HyperlinkType::Content == type ) else if ( c_oSer_HyperlinkType::Content == type )
{ {
CHyperlink* pPrevHyperlink = m_pCurHyperlink; XmlUtils::CStringWriter* pPrevWriter = m_pCurWriter;
m_pCurHyperlink = pHyperlink; m_pCurWriter = &pHyperlink->writer;
res = Read1(length, &Binary_DocumentTableReader::ReadParagraphContent, this, NULL); res = Read1(length, &Binary_DocumentTableReader::ReadParagraphContent, this, NULL);
long rId; long rId;
CString sHref = XmlUtils::EncodeXmlString(pHyperlink->sLink); CString sHref = XmlUtils::EncodeXmlString(pHyperlink->sLink);
m_oFileWriter.m_pDrawingConverter->WriteRels(CString(_T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink")), sHref, CString(_T("External")), &rId); m_oFileWriter.m_pDrawingConverter->WriteRels(CString(_T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink")), sHref, CString(_T("External")), &rId);
CString srId;srId.Format(_T("rId%d"), rId); CString srId;srId.Format(_T("rId%d"), rId);
pHyperlink->rId = srId; pHyperlink->rId = srId;
m_pCurHyperlink = pPrevHyperlink; m_pCurWriter = pPrevWriter;
} }
else else
res = c_oSerConstants::ReadUnknown; res = c_oSerConstants::ReadUnknown;
......
...@@ -84,9 +84,7 @@ const int styletype_Table = 0x04; ...@@ -84,9 +84,7 @@ const int styletype_Table = 0x04;
const int fieldstruct_none = 0; const int fieldstruct_none = 0;
const int fieldstruct_toc = 1; const int fieldstruct_toc = 1;
const int fieldstruct_pagenum = 2; const int fieldstruct_hyperlink = 2;
const int fieldstruct_hyperlink = 3;
const int fieldstruct_locallink = 4;
const double g_dKoef_mm_to_pt = 72 / (2.54 * 10); const double g_dKoef_mm_to_pt = 72 / (2.54 * 10);
const double g_dKoef_mm_to_twips = 20 * g_dKoef_mm_to_pt; const double g_dKoef_mm_to_twips = 20 * g_dKoef_mm_to_pt;
...@@ -393,7 +391,8 @@ extern int g_nCurFormatVersion; ...@@ -393,7 +391,8 @@ extern int g_nCurFormatVersion;
CommentEnd = 7, CommentEnd = 7,
OMathPara = 8, OMathPara = 8,
OMath = 9, OMath = 9,
Hyperlink = 10 Hyperlink = 10,
FldSimple = 11
};} };}
namespace c_oSerDocTableType{enum c_oSerDocTableType namespace c_oSerDocTableType{enum c_oSerDocTableType
{ {
...@@ -797,6 +796,11 @@ extern int g_nCurFormatVersion; ...@@ -797,6 +796,11 @@ extern int g_nCurFormatVersion;
DocLocation = 5, DocLocation = 5,
TgtFrame = 6 TgtFrame = 6
};} };}
namespace c_oSer_FldSimpleType{ enum c_oSer_FldSimpleType
{
Content = 0,
Instr = 1
};}
namespace c_oSer_ColorThemeType{ enum c_oSer_ColorThemeType namespace c_oSer_ColorThemeType{ enum c_oSer_ColorThemeType
{ {
Auto = 0, Auto = 0,
......
...@@ -2436,7 +2436,6 @@ namespace BinDocxRW ...@@ -2436,7 +2436,6 @@ namespace BinDocxRW
// fldChar // fldChar
//todo fldchartypeEnd, . //todo fldchartypeEnd, .
std::vector<FldStruct*> m_aFldChars; std::vector<FldStruct*> m_aFldChars;
int m_nSkipFldChar;
CString m_sFldChar; CString m_sFldChar;
SimpleTypes::EFldCharType m_eFldState; SimpleTypes::EFldCharType m_eFldState;
NSBinPptxRW::CDrawingConverter* m_pOfficeDrawingConverter; NSBinPptxRW::CDrawingConverter* m_pOfficeDrawingConverter;
...@@ -2451,7 +2450,6 @@ namespace BinDocxRW ...@@ -2451,7 +2450,6 @@ namespace BinDocxRW
{ {
pSectPr = NULL; pSectPr = NULL;
m_bWriteSectPr = false; m_bWriteSectPr = false;
m_nSkipFldChar = 0;
m_eFldState = SimpleTypes::fldchartypeEnd; m_eFldState = SimpleTypes::fldchartypeEnd;
}; };
~BinaryDocumentTableWriter() ~BinaryDocumentTableWriter()
...@@ -2562,74 +2560,13 @@ namespace BinDocxRW ...@@ -2562,74 +2560,13 @@ namespace BinDocxRW
FldStruct* pRes = NULL; FldStruct* pRes = NULL;
int nIndex = 0; int nIndex = 0;
if(-1 != (nIndex = sFld.Find(_T("TOC")))) if(-1 != (nIndex = sFld.Find(_T("TOC"))))
{
pRes = new FldStruct(sFld, fieldstruct_toc); pRes = new FldStruct(sFld, fieldstruct_toc);
}
else if(-1 != (nIndex = sFld.Find(_T("PAGE"))))
{
CString sFindStr(_T("PAGE"));
bool bPage = true;
// PAGEREF
if(nIndex + sFindStr.GetLength() < sFld.GetLength())
{
TCHAR cNextChar = sFld[nIndex + sFindStr.GetLength()];
if('A' <= cNextChar && cNextChar <= 'Z')
{
bPage = false;
}
}
if(bPage)
{
pRes = new FldStruct(sFld, fieldstruct_pagenum);
}
}
else if(-1 != (nIndex = sFld.Find(_T("HYPERLINK")))) else if(-1 != (nIndex = sFld.Find(_T("HYPERLINK"))))
{ pRes = new FldStruct(sFld, fieldstruct_hyperlink);
if(-1 == sFld.Find(_T("\\l"))) else
pRes = new FldStruct(sFld, fieldstruct_hyperlink);
else
pRes = new FldStruct(sFld, fieldstruct_locallink);// ,
}
if(NULL == pRes)
pRes = new FldStruct(sFld, fieldstruct_none); pRes = new FldStruct(sFld, fieldstruct_none);
return pRes; return pRes;
} }
bool WriteField(CString fld, FldStruct** ppFldStruct, bool bWrapRun)
{
bool bRes = false;
FldStruct* pFldStruct = ParseField(fld);
if(fieldstruct_pagenum == pFldStruct->GetType() || fieldstruct_hyperlink == pFldStruct->GetType())
{
int nCurPos = 0;
int nCurPos2 = 0;
if(bWrapRun)
{
nCurPos = m_oBcw.WriteItemStart(c_oSerParType::Run);
nCurPos2 = m_oBcw.WriteItemStart(c_oSerRunType::Content);
}
if(fieldstruct_pagenum == pFldStruct->GetType())
{
m_oBcw.m_oStream.WriteBYTE(c_oSerRunType::pagenum);
m_oBcw.m_oStream.WriteLONG(c_oSerPropLenType::Null);
bRes = true;
}
else if(fieldstruct_hyperlink == pFldStruct->GetType())
{
m_oBcw.m_oStream.WriteBYTE(c_oSerRunType::fldstart);
m_oBcw.m_oStream.WriteStringW(pFldStruct->m_sFld);
}
if(bWrapRun)
{
m_oBcw.WriteItemEnd(nCurPos2);
m_oBcw.WriteItemEnd(nCurPos);
}
}
if(NULL != ppFldStruct)
(*ppFldStruct) = pFldStruct;
else
RELEASEOBJECT(pFldStruct);
return bRes;
}
void WriteParagraphContent(const std::vector<OOX::WritingElement *>& Content, bool bHyperlink = false) void WriteParagraphContent(const std::vector<OOX::WritingElement *>& Content, bool bHyperlink = false)
{ {
int nCurPos = 0; int nCurPos = 0;
...@@ -2641,27 +2578,7 @@ namespace BinDocxRW ...@@ -2641,27 +2578,7 @@ namespace BinDocxRW
case OOX::et_w_fldSimple: case OOX::et_w_fldSimple:
{ {
OOX::Logic::CFldSimple* pFldSimple = static_cast<OOX::Logic::CFldSimple*>(item); OOX::Logic::CFldSimple* pFldSimple = static_cast<OOX::Logic::CFldSimple*>(item);
bool bUseFieldContent = false; WriteFldSimple(pFldSimple);
FldStruct* pFldStruct = NULL;
if(pFldSimple->m_sInstr.IsInit())
{
if(false == WriteField(pFldSimple->m_sInstr.get(), &pFldStruct, true))
bUseFieldContent = true;
}
if(true == bUseFieldContent)
{
WriteParagraphContent(pFldSimple->m_arrItems, NULL);
}
if( NULL != pFldStruct && fieldstruct_hyperlink == pFldStruct->GetType())
{
int nCurPos = m_oBcw.WriteItemStart(c_oSerParType::Run);
int nCurPos2 = m_oBcw.WriteItemStart(c_oSerRunType::Content);
m_oBcw.m_oStream.WriteBYTE(c_oSerRunType::fldend);
m_oBcw.m_oStream.WriteLONG(c_oSerPropLenType::Null);
m_oBcw.WriteItemEnd(nCurPos2);
m_oBcw.WriteItemEnd(nCurPos);
}
RELEASEOBJECT(pFldStruct);
break; break;
} }
case OOX::et_w_hyperlink: case OOX::et_w_hyperlink:
...@@ -2683,31 +2600,31 @@ namespace BinDocxRW ...@@ -2683,31 +2600,31 @@ namespace BinDocxRW
{ {
OOX::Logic::CSdt* pStd = static_cast<OOX::Logic::CSdt*>(item); OOX::Logic::CSdt* pStd = static_cast<OOX::Logic::CSdt*>(item);
if(pStd->m_oSdtContent.IsInit()) if(pStd->m_oSdtContent.IsInit())
WriteParagraphContent(pStd->m_oSdtContent.get().m_arrItems, NULL); WriteParagraphContent(pStd->m_oSdtContent.get().m_arrItems);
break; break;
} }
case OOX::et_w_smartTag: case OOX::et_w_smartTag:
{ {
OOX::Logic::CSmartTag* pSmartTag = static_cast<OOX::Logic::CSmartTag*>(item); OOX::Logic::CSmartTag* pSmartTag = static_cast<OOX::Logic::CSmartTag*>(item);
WriteParagraphContent(pSmartTag->m_arrItems, NULL); WriteParagraphContent(pSmartTag->m_arrItems);
break; break;
} }
case OOX::et_w_dir: case OOX::et_w_dir:
{ {
OOX::Logic::CDir* pDir = static_cast<OOX::Logic::CDir*>(item); OOX::Logic::CDir* pDir = static_cast<OOX::Logic::CDir*>(item);
WriteParagraphContent(pDir->m_arrItems, NULL); WriteParagraphContent(pDir->m_arrItems);
break; break;
} }
case OOX::et_w_bdo: case OOX::et_w_bdo:
{ {
OOX::Logic::CBdo* pBdo = static_cast<OOX::Logic::CBdo*>(item); OOX::Logic::CBdo* pBdo = static_cast<OOX::Logic::CBdo*>(item);
WriteParagraphContent(pBdo->m_arrItems, NULL); WriteParagraphContent(pBdo->m_arrItems);
break; break;
} }
case OOX::et_w_ins: case OOX::et_w_ins:
{ {
OOX::Logic::CIns* pIns = static_cast<OOX::Logic::CIns*>(item); OOX::Logic::CIns* pIns = static_cast<OOX::Logic::CIns*>(item);
WriteParagraphContent(pIns->m_arrItems, NULL); WriteParagraphContent(pIns->m_arrItems);
break; break;
} }
case OOX::et_w_commentRangeStart: case OOX::et_w_commentRangeStart:
...@@ -2760,6 +2677,32 @@ namespace BinDocxRW ...@@ -2760,6 +2677,32 @@ namespace BinDocxRW
m_oBcw.WriteItemEnd(nCurPos); m_oBcw.WriteItemEnd(nCurPos);
} }
} }
void WriteFldSimple(OOX::Logic::CFldSimple* pFldSimple)
{
int nCurPos = 0;
if(pFldSimple->m_sInstr.IsInit() && !pFldSimple->m_sInstr->IsEmpty())
{
nCurPos = m_oBcw.WriteItemStart(c_oSerParType::FldSimple);
WriteFldSimpleContent(pFldSimple);
m_oBcw.WriteItemWithLengthEnd(nCurPos);
}
else
WriteParagraphContent(pFldSimple->m_arrItems);
}
void WriteFldSimpleContent(OOX::Logic::CFldSimple* pFldSimple)
{
int nCurPos = 0;
//
//Instr
nCurPos = m_oBcw.WriteItemStart(c_oSer_FldSimpleType::Instr);
m_oBcw.m_oStream.WriteStringW3(pFldSimple->m_sInstr.get());
m_oBcw.WriteItemWithLengthEnd(nCurPos);
//Content
nCurPos = m_oBcw.WriteItemStart(c_oSer_FldSimpleType::Content);
WriteParagraphContent(pFldSimple->m_arrItems);
m_oBcw.WriteItemWithLengthEnd(nCurPos);
}
void WriteHyperlink(OOX::Logic::CHyperlink* pHyperlink) void WriteHyperlink(OOX::Logic::CHyperlink* pHyperlink)
{ {
int nCurPos = 0; int nCurPos = 0;
...@@ -4444,7 +4387,7 @@ namespace BinDocxRW ...@@ -4444,7 +4387,7 @@ namespace BinDocxRW
{ {
// Hyperlink field // Hyperlink field
for(int i = 0, length = m_aFldChars.size(); i < length; ++i) for(int i = 0, length = m_aFldChars.size(); i < length; ++i)
if(fieldstruct_hyperlink == m_aFldChars[i]->GetType() || fieldstruct_locallink == m_aFldChars[i]->GetType()) if(fieldstruct_hyperlink == m_aFldChars[i]->GetType())
{ {
bHyperlink = true; bHyperlink = true;
break; break;
...@@ -4522,8 +4465,6 @@ namespace BinDocxRW ...@@ -4522,8 +4465,6 @@ namespace BinDocxRW
{ {
case OOX::et_w_br: case OOX::et_w_br:
{ {
if(m_nSkipFldChar > 0)
break;
OOX::Logic::CBr* pBr = static_cast<OOX::Logic::CBr*>(item); OOX::Logic::CBr* pBr = static_cast<OOX::Logic::CBr*>(item);
int nBreakType = -1; int nBreakType = -1;
switch(pBr->m_oType.GetValue()) switch(pBr->m_oType.GetValue())
...@@ -4543,8 +4484,6 @@ namespace BinDocxRW ...@@ -4543,8 +4484,6 @@ namespace BinDocxRW
case OOX::et_w_pict: case OOX::et_w_pict:
case OOX::et_w_drawing: case OOX::et_w_drawing:
{ {
if(m_nSkipFldChar > 0)
break;
WriteDrawingPptx(item); WriteDrawingPptx(item);
break; break;
} }
...@@ -4557,42 +4496,35 @@ namespace BinDocxRW ...@@ -4557,42 +4496,35 @@ namespace BinDocxRW
{ {
m_eFldState = SimpleTypes::fldchartypeBegin; m_eFldState = SimpleTypes::fldchartypeBegin;
m_sFldChar.Empty(); m_sFldChar.Empty();
if(m_nSkipFldChar > 0)
m_nSkipFldChar++;
} }
else if(SimpleTypes::fldchartypeEnd == pFldChar->m_oFldCharType.get().GetValue()) else if(SimpleTypes::fldchartypeEnd == pFldChar->m_oFldCharType.get().GetValue())
{ {
m_eFldState = SimpleTypes::fldchartypeEnd; m_eFldState = SimpleTypes::fldchartypeEnd;
if(m_nSkipFldChar > 0)
m_nSkipFldChar--;
if(m_aFldChars.size() > 0) if(m_aFldChars.size() > 0)
{ {
int nIndex = m_aFldChars.size() - 1; int nIndex = m_aFldChars.size() - 1;
FldStruct* pFldStruct = m_aFldChars[nIndex]; FldStruct* pFldStruct = m_aFldChars[nIndex];
if( fieldstruct_hyperlink == pFldStruct->GetType())
{
m_oBcw.m_oStream.WriteBYTE(c_oSerRunType::fldend);
m_oBcw.m_oStream.WriteLONG(c_oSerPropLenType::Null);
}
RELEASEOBJECT(pFldStruct); RELEASEOBJECT(pFldStruct);
m_aFldChars.erase(m_aFldChars.begin() + nIndex); m_aFldChars.erase(m_aFldChars.begin() + nIndex);
m_oBcw.m_oStream.WriteBYTE(c_oSerRunType::fldend);
m_oBcw.m_oStream.WriteLONG(c_oSerPropLenType::Null);
} }
} }
else if(SimpleTypes::fldchartypeSeparate == pFldChar->m_oFldCharType.get().GetValue()) else if(SimpleTypes::fldchartypeSeparate == pFldChar->m_oFldCharType.get().GetValue())
{ {
m_eFldState = SimpleTypes::fldchartypeSeparate; m_eFldState = SimpleTypes::fldchartypeSeparate;
FldStruct* pFldStruct = NULL; FldStruct* pFldStruct = ParseField(m_sFldChar);
if(WriteField(m_sFldChar, &pFldStruct, false) )
m_nSkipFldChar++;
m_aFldChars.push_back(pFldStruct); m_aFldChars.push_back(pFldStruct);
m_oBcw.m_oStream.WriteBYTE(c_oSerRunType::fldstart);
m_oBcw.m_oStream.WriteStringW(m_sFldChar);
} }
} }
} }
break; break;
case OOX::et_w_instrText: case OOX::et_w_instrText:
{ {
if(m_nSkipFldChar > 0)
break;
OOX::Logic::CInstrText* pInstrText = static_cast<OOX::Logic::CInstrText*>(item); OOX::Logic::CInstrText* pInstrText = static_cast<OOX::Logic::CInstrText*>(item);
if(SimpleTypes::fldchartypeBegin == m_eFldState) if(SimpleTypes::fldchartypeBegin == m_eFldState)
m_sFldChar += pInstrText->m_sText; m_sFldChar += pInstrText->m_sText;
...@@ -4607,15 +4539,11 @@ namespace BinDocxRW ...@@ -4607,15 +4539,11 @@ namespace BinDocxRW
break; break;
case OOX::et_w_nonBreakHyphen: case OOX::et_w_nonBreakHyphen:
{ {
if(m_nSkipFldChar > 0)
break;
WriteText(CString(_T("-"))); WriteText(CString(_T("-")));
} }
break; break;
case OOX::et_w_pgNum: case OOX::et_w_pgNum:
{ {
if(m_nSkipFldChar > 0)
break;
m_oBcw.m_oStream.WriteBYTE(c_oSerRunType::pagenum); m_oBcw.m_oStream.WriteBYTE(c_oSerRunType::pagenum);
m_oBcw.m_oStream.WriteLONG(c_oSerPropLenType::Null); m_oBcw.m_oStream.WriteLONG(c_oSerPropLenType::Null);
} }
...@@ -4626,16 +4554,12 @@ namespace BinDocxRW ...@@ -4626,16 +4554,12 @@ namespace BinDocxRW
break; break;
case OOX::et_w_softHyphen: case OOX::et_w_softHyphen:
{ {
if(m_nSkipFldChar > 0)
break;
WriteText(CString(_T("-"))); WriteText(CString(_T("-")));
} }
break; break;
case OOX::et_w_sym: case OOX::et_w_sym:
{ {
OOX::Logic::CSym* oSym = static_cast<OOX::Logic::CSym*>(item); OOX::Logic::CSym* oSym = static_cast<OOX::Logic::CSym*>(item);
if(m_nSkipFldChar > 0)
break;
CString sText; CString sText;
sText.AppendChar(0x0FFF & oSym->m_oChar->GetValue()); sText.AppendChar(0x0FFF & oSym->m_oChar->GetValue());
WriteText(sText); WriteText(sText);
...@@ -4643,8 +4567,6 @@ namespace BinDocxRW ...@@ -4643,8 +4567,6 @@ namespace BinDocxRW
} }
case OOX::et_w_t: case OOX::et_w_t:
{ {
if(m_nSkipFldChar > 0)
break;
CString& sText = static_cast<OOX::Logic::CText*>(item)->m_sText; CString& sText = static_cast<OOX::Logic::CText*>(item)->m_sText;
if(!sText.IsEmpty()) if(!sText.IsEmpty())
{ {
...@@ -4654,8 +4576,6 @@ namespace BinDocxRW ...@@ -4654,8 +4576,6 @@ namespace BinDocxRW
break; break;
case OOX::et_w_tab: case OOX::et_w_tab:
{ {
if(m_nSkipFldChar > 0)
break;
m_oBcw.m_oStream.WriteBYTE(c_oSerRunType::tab); m_oBcw.m_oStream.WriteBYTE(c_oSerRunType::tab);
m_oBcw.m_oStream.WriteLONG(c_oSerPropLenType::Null); m_oBcw.m_oStream.WriteLONG(c_oSerPropLenType::Null);
} }
...@@ -4672,8 +4592,6 @@ namespace BinDocxRW ...@@ -4672,8 +4592,6 @@ namespace BinDocxRW
//write Picture //write Picture
if(m_nSkipFldChar > 0)
break;
CString* pXml = NULL; CString* pXml = NULL;
OOX::Logic::CObject* pObject = static_cast<OOX::Logic::CObject*>(item); OOX::Logic::CObject* pObject = static_cast<OOX::Logic::CObject*>(item);
......
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
//2 //2
//0 //0
//0 //0
//256 //257
#define INTVER 2,0,0,256 #define INTVER 2,0,0,257
#define STRVER "2,0,0,256\0" #define STRVER "2,0,0,257\0"
...@@ -124,7 +124,7 @@ namespace PPTX ...@@ -124,7 +124,7 @@ namespace PPTX
pWriter->StartAttributes(); pWriter->StartAttributes();
pWriter->WriteAttribute(_T("authorId"), authorId); pWriter->WriteAttribute(_T("authorId"), authorId);
pWriter->WriteAttribute(_T("dt"), dt); pWriter->WriteAttribute2(_T("dt"), dt);
pWriter->WriteAttribute(_T("idx"), idx); pWriter->WriteAttribute(_T("idx"), idx);
pWriter->EndAttributes(); pWriter->EndAttributes();
...@@ -137,7 +137,7 @@ namespace PPTX ...@@ -137,7 +137,7 @@ namespace PPTX
if (text.is_init()) if (text.is_init())
{ {
pWriter->WriteString(_T("<p:text>")); pWriter->WriteString(_T("<p:text>"));
pWriter->WriteString(*text); pWriter->WriteStringXML(*text);
pWriter->WriteString(_T("</p:text>")); pWriter->WriteString(_T("</p:text>"));
} }
......
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