Commit f9a19bad authored by ElenaSubbotina's avatar ElenaSubbotina

DocFormatReader - fix embedded docx formula

parent d2630ea7
......@@ -136,14 +136,18 @@ namespace DocFileFormat
}
return btWin32;
}
bool ParseEmbeddedEquation( const std::string & xmlString, std::wstring & newXmlString)
bool VMLPictureMapping::ParseEmbeddedEquation( const std::string & xmlString, std::wstring & newXmlString)
{
newXmlString.clear();
std::wstring sTempXmlFile = NSDirectory::CreateTempFileWithUniqueName(
NSDirectory::GetTempPath(), L"emb");
sTempXmlFile += L".xml";
std::wstring sTempFolder = m_ctx->_doc->m_sTempFolder;
if (sTempFolder.empty())
{
sTempFolder = NSFile::CFileBinary::GetTempPath();
}
std::wstring sTempXmlFile = NSDirectory::CreateTempFileWithUniqueName(sTempFolder, L"emb");
NSFile::CFileBinary file;
file.CreateFileW(sTempXmlFile);
file.WriteFile((BYTE*)xmlString.c_str(), xmlString.size());
......@@ -186,6 +190,7 @@ namespace DocFileFormat
if (res) break;
}
}
NSFile::CFileBinary::Remove(sTempXmlFile);
return res;
}
//---------------------------------------------------------------
......
......@@ -46,7 +46,6 @@ namespace DocFileFormat
{
class OleObject;
bool ParseEmbeddedEquation( const std::string & xmlString, std::wstring & newXmlString );
class VMLPictureMapping: public PropertiesMapping, public IMapping
{
......@@ -58,6 +57,7 @@ namespace DocFileFormat
/// Writes a border element
void writePictureBorder (const std::wstring & name, const BorderCode* brc);
void appendStyleProperty( std::wstring* b, const std::wstring& propName, const std::wstring& propValue ) const;
bool ParseEmbeddedEquation( const std::string & xmlString, std::wstring & newXmlString );
protected:
/// Copies the picture from the binary stream to the zip archive
/// and creates the relationships for the image.
......
......@@ -86,6 +86,7 @@ namespace DocFileFormat
friend class Table;
friend class TableRow;
friend class VMLShapeMapping;
friend class VMLPictureMapping;
friend class OpenXmlPackage;
friend class TextboxMapping;
......
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