Commit a57f423c authored by ElenaSubbotina's avatar ElenaSubbotina Committed by Alexander Trofimov

RtfFormatReader - конвертация embedd объектов - Test_Объекты.rtf

parent d3f5dd3d
...@@ -228,6 +228,7 @@ bool OleReader::ExecuteCommand(RtfDocument& oDocument, RtfReader& oReader,CStrin ...@@ -228,6 +228,7 @@ bool OleReader::ExecuteCommand(RtfDocument& oDocument, RtfReader& oReader,CStrin
{ {
if( _T("object") == sCommand ) if( _T("object") == sCommand )
return true; return true;
COMMAND_RTF_INT( _T("objw"), m_oOle.m_nWidth, sCommand, hasParameter, parameter ) COMMAND_RTF_INT( _T("objw"), m_oOle.m_nWidth, sCommand, hasParameter, parameter )
COMMAND_RTF_INT( _T("objh"), m_oOle.m_nHeight, sCommand, hasParameter, parameter ) COMMAND_RTF_INT( _T("objh"), m_oOle.m_nHeight, sCommand, hasParameter, parameter )
COMMAND_RTF_INT( _T("objemb"), m_oOle.m_eOleType, sCommand, true, RtfOle::ot_emb ) COMMAND_RTF_INT( _T("objemb"), m_oOle.m_eOleType, sCommand, true, RtfOle::ot_emb )
...@@ -260,14 +261,19 @@ bool OleReader::ExecuteCommand(RtfDocument& oDocument, RtfReader& oReader,CStrin ...@@ -260,14 +261,19 @@ bool OleReader::ExecuteCommand(RtfDocument& oDocument, RtfReader& oReader,CStrin
//oStream.nCurPos = 0; //oStream.nCurPos = 0;
CString sOleStorageName = Utils::CreateTempFile( oReader.m_sTempFolder ); CString sOleStorageName = Utils::CreateTempFile( oReader.m_sTempFolder );
NSFile::CFileBinary file;
file.CreateFileW(sOleStorageName.GetBuffer());
file.WriteFile(pData, nSize);
file.CloseFile();
POLE::Storage * piRootStorage = new POLE::Storage(string2std_string(sOleStorageName).c_str()); POLE::Storage * piRootStorage = new POLE::Storage(string2std_string(sOleStorageName).c_str());
if( piRootStorage) if( piRootStorage)
{ {
//hRes = OleConvertOLESTREAMToIStorage( &oStream, piRootStorage, NULL ); //hRes = OleConvertOLESTREAMToIStorage( &oStream, piRootStorage, NULL );
//m_oOle.SetFilename( sOleStorageName ); m_oOle.SetFilename( sOleStorageName );
//m_oOle.SetOle( piRootStorage ); m_oOle.SetOle( piRootStorage );
RELEASEOBJECT( piRootStorage ); //RELEASEOBJECT( piRootStorage );
hRes = S_OK; hRes = S_OK;
} }
......
...@@ -351,7 +351,9 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap ...@@ -351,7 +351,9 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
{ {
CString sValue; CString sValue;
if ((ooxText->m_oSpace.IsInit()) && (ooxText->m_oSpace->GetValue() == SimpleTypes::xmlspacePreserve)) if ((ooxText->m_oSpace.IsInit()) && (ooxText->m_oSpace->GetValue() == SimpleTypes::xmlspacePreserve))
{
sValue = RtfUtility::Preserve(ooxText->m_sText); sValue = RtfUtility::Preserve(ooxText->m_sText);
}
else else
sValue = ooxText->m_sText; sValue = ooxText->m_sText;
......
...@@ -57,7 +57,7 @@ public: ...@@ -57,7 +57,7 @@ public:
//изменяем scale в соответсявии с выходным размером //изменяем scale в соответсявии с выходным размером
if( PROP_DEF != nWidth && PROP_DEF != oOutput.m_oPicture->m_nWidthGoal ) if( PROP_DEF != nWidth && PROP_DEF != oOutput.m_oPicture->m_nWidthGoal )
{ {
double dNewScale = 100 * ( 1.0 * nWidth / oOutput.m_oPicture->m_nWidthGoal ); double dNewScale = 100 * ( 1.0 * nWidth / oOutput.m_oPicture->m_nWidthGoal ) ;
oOutput.m_oPicture->m_dScaleX = dNewScale; oOutput.m_oPicture->m_dScaleX = dNewScale;
} }
if( PROP_DEF != nHeight && PROP_DEF != oOutput.m_oPicture->m_nHeightGoal ) if( PROP_DEF != nHeight && PROP_DEF != oOutput.m_oPicture->m_nHeightGoal )
......
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