Commit 95dcf366 authored by ElenaSubbotina's avatar ElenaSubbotina

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

parents 29ae0bdc 717d91a1
...@@ -766,18 +766,11 @@ namespace DocFormatUtils ...@@ -766,18 +766,11 @@ namespace DocFormatUtils
static inline std::wstring IntToWideString(int value) static inline std::wstring IntToWideString(int value)
{ {
#if defined(_WIN32) || defined (_WIN64)
wchar_t buff[33] ={};
_itow(value, buff, 10);
return std::wstring(buff);
#else
return (std::to_wstring(value)); return (std::to_wstring(value));
#endif
} }
static inline std::wstring DoubleToWideString(double value) static inline std::wstring DoubleToWideString(double value)
{ {
std::wstringstream src; std::wstringstream src;
src << value; src << value;
return std::wstring(src.str()); return std::wstring(src.str());
...@@ -785,8 +778,7 @@ namespace DocFormatUtils ...@@ -785,8 +778,7 @@ namespace DocFormatUtils
static inline std::string DoubleToString(double value) static inline std::string DoubleToString(double value)
{ {
std::stringstream src; std::stringstream src;
src << value; src << value;
return std::string(src.str()); return std::string(src.str());
...@@ -813,36 +805,16 @@ namespace DocFormatUtils ...@@ -813,36 +805,16 @@ namespace DocFormatUtils
static inline std::wstring IntToFormattedWideString( int value, const wchar_t* format ) static inline std::wstring IntToFormattedWideString( int value, const wchar_t* format )
{ {
// const int size = 33;
// wchar_t strValue[size] = L"\0";
if ( format == NULL ) return L""; if ( format == NULL ) return L"";
// swprintf_s( strValue, size, format, value );
//// }
// CString format_str;
// format_str.Format(format , value);
std::wstringstream sstream; std::wstringstream sstream;
sstream << boost::wformat(format) % value; sstream << boost::wformat(format) % value;
return sstream.str(); return sstream.str();
//return string2std_string( format_str );
} }
static inline std::wstring DoubleToFormattedWideString( double value, wchar_t* format ) static inline std::wstring DoubleToFormattedWideString( double value, wchar_t* format )
{ {
if ( format == NULL ) return L""; if ( format == NULL ) return L"";
//std::wstring wstr;
//if ( format != NULL )
//{
// CString strValue;
// strValue.Format(format, value);
// wstr = string2std_string( strValue );
//}
//return wstr;
std::wstringstream sstream; std::wstringstream sstream;
sstream << boost::wformat(format) % value; sstream << boost::wformat(format) % value;
return sstream.str(); return sstream.str();
......
...@@ -81,12 +81,8 @@ namespace DocFileFormat ...@@ -81,12 +81,8 @@ namespace DocFileFormat
RELEASEOBJECT(m_pXmlWriter); RELEASEOBJECT(m_pXmlWriter);
} }
} }
}
namespace DocFileFormat
{
// Looks into the section table to find out if this CP is the end & current of a sections // Looks into the section table to find out if this CP is the end & current of a sections
int DocumentMapping::getCurrentSection(int cp) int DocumentMapping::getCurrentSection(int cp)
{ {
//if cp is the last char of a section, the next section will start at cp +1 //if cp is the last char of a section, the next section will start at cp +1
...@@ -198,7 +194,7 @@ namespace DocFileFormat ...@@ -198,7 +194,7 @@ namespace DocFileFormat
// start paragraph // start paragraph
m_pXmlWriter->WriteNodeBegin(_T("w:p"), TRUE); m_pXmlWriter->WriteNodeBegin(_T("w:p"), true);
writeParagraphRsid(papx); writeParagraphRsid(papx);
// ----------- check for section properties // ----------- check for section properties
...@@ -339,7 +335,7 @@ namespace DocFileFormat ...@@ -339,7 +335,7 @@ namespace DocFileFormat
} }
} }
m_pXmlWriter->WriteNodeEnd(_T(""), TRUE, FALSE); m_pXmlWriter->WriteNodeEnd(_T(""), true, false);
} }
// Writes a run with the given characters and CHPX // Writes a run with the given characters and CHPX
...@@ -356,23 +352,23 @@ namespace DocFileFormat ...@@ -356,23 +352,23 @@ namespace DocFileFormat
if (Deleted == rev.Type) if (Deleted == rev.Type)
{ {
//If it's a deleted run //If it's a deleted run
m_pXmlWriter->WriteNodeBegin(_T("w:del"), TRUE); m_pXmlWriter->WriteNodeBegin(_T("w:del"), true);
m_pXmlWriter->WriteAttribute(_T("w:author"), _T("[b2x: could not retrieve author]")); m_pXmlWriter->WriteAttribute(_T("w:author"), _T("[b2x: could not retrieve author]"));
m_pXmlWriter->WriteAttribute(_T("w:date"), _T("[b2x: could not retrieve date]")); m_pXmlWriter->WriteAttribute(_T("w:date"), _T("[b2x: could not retrieve date]"));
m_pXmlWriter->WriteNodeEnd(_T(""), TRUE, FALSE); m_pXmlWriter->WriteNodeEnd(_T(""), true, false);
} }
else if ( rev.Type == Inserted ) else if ( rev.Type == Inserted )
{ {
WideString* author = dynamic_cast<WideString*>(m_document->RevisionAuthorTable->operator[](rev.Isbt)); WideString* author = dynamic_cast<WideString*>(m_document->RevisionAuthorTable->operator[](rev.Isbt));
//if it's a inserted run //if it's a inserted run
m_pXmlWriter->WriteNodeBegin(_T("w:ins"), TRUE); m_pXmlWriter->WriteNodeBegin(_T("w:ins"), true);
m_pXmlWriter->WriteAttribute(_T("w:author"), FormatUtils::XmlEncode(*author).c_str()); m_pXmlWriter->WriteAttribute(_T("w:author"), FormatUtils::XmlEncode(*author).c_str());
m_pXmlWriter->WriteNodeEnd(_T(""), TRUE, FALSE); m_pXmlWriter->WriteNodeEnd(_T(""), true, false);
//rev.Dttm.Convert(new DateMapping(m_pXmlWriter)); //rev.Dttm.Convert(new DateMapping(m_pXmlWriter));
} }
//start run //start run
m_pXmlWriter->WriteNodeBegin(_T("w:r"), TRUE); m_pXmlWriter->WriteNodeBegin(_T("w:r"), true);
//append rsids //append rsids
if (0 != rev.Rsid) if (0 != rev.Rsid)
...@@ -396,7 +392,7 @@ namespace DocFileFormat ...@@ -396,7 +392,7 @@ namespace DocFileFormat
m_context->AddRsid(rsidProp); m_context->AddRsid(rsidProp);
} }
m_pXmlWriter->WriteNodeEnd(_T(""), TRUE, FALSE); m_pXmlWriter->WriteNodeEnd(_T(""), true, false);
/// <w:rPr> /// <w:rPr>
CharacterPropertiesMapping* rPr = new CharacterPropertiesMapping(m_pXmlWriter, m_document, &rev, _lastValidPapx, false); CharacterPropertiesMapping* rPr = new CharacterPropertiesMapping(m_pXmlWriter, m_document, &rev, _lastValidPapx, false);
...@@ -564,9 +560,9 @@ namespace DocFileFormat ...@@ -564,9 +560,9 @@ namespace DocFileFormat
if ( bFORM ) if ( bFORM )
{ {
m_pXmlWriter->WriteNodeBegin( _T( "w:fldChar" ), TRUE ); m_pXmlWriter->WriteNodeBegin( _T( "w:fldChar" ), true );
m_pXmlWriter->WriteAttribute( _T( "w:fldCharType" ), _T( "begin" ) ); m_pXmlWriter->WriteAttribute( _T( "w:fldCharType" ), _T( "begin" ) );
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE ); m_pXmlWriter->WriteNodeEnd( _T( "" ), true, false );
int cpPic = searchNextTextMark( m_document->Text, cpFieldStart, TextMark::Picture ); int cpPic = searchNextTextMark( m_document->Text, cpFieldStart, TextMark::Picture );
...@@ -589,9 +585,9 @@ namespace DocFileFormat ...@@ -589,9 +585,9 @@ namespace DocFileFormat
&& &&
( ( bEMBED || bLINK ) && bChart) ) ( ( bEMBED || bLINK ) && bChart) )
{ {
m_pXmlWriter->WriteNodeBegin( _T( "w:fldChar" ), TRUE ); m_pXmlWriter->WriteNodeBegin( _T( "w:fldChar" ), true );
m_pXmlWriter->WriteAttribute( _T( "w:fldCharType" ), _T( "begin" ) ); m_pXmlWriter->WriteAttribute( _T( "w:fldCharType" ), _T( "begin" ) );
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE ); m_pXmlWriter->WriteNodeEnd( _T( "" ), true, false );
int cpPic = searchNextTextMark( m_document->Text, cpFieldStart, TextMark::Picture ); int cpPic = searchNextTextMark( m_document->Text, cpFieldStart, TextMark::Picture );
...@@ -608,9 +604,9 @@ namespace DocFileFormat ...@@ -608,9 +604,9 @@ namespace DocFileFormat
if ((search( f.begin(), f.end(), TOC.begin(), TOC.end()) != f.end()) || bPAGE) if ((search( f.begin(), f.end(), TOC.begin(), TOC.end()) != f.end()) || bPAGE)
{ {
m_pXmlWriter->WriteNodeBegin( _T( "w:fldChar" ), TRUE ); m_pXmlWriter->WriteNodeBegin( _T( "w:fldChar" ), true );
m_pXmlWriter->WriteAttribute( _T( "w:fldCharType" ), _T( "begin" ) ); m_pXmlWriter->WriteAttribute( _T( "w:fldCharType" ), _T( "begin" ) );
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE ); m_pXmlWriter->WriteNodeEnd( _T( "" ), true );
_writeInstrText = true; _writeInstrText = true;
_fldCharCounter++; _fldCharCounter++;
...@@ -638,9 +634,9 @@ namespace DocFileFormat ...@@ -638,9 +634,9 @@ namespace DocFileFormat
//if (_writeInstrText == true) //if (_writeInstrText == true)
//{ //{
// m_pXmlWriter->WriteNodeBegin( _T( "w:fldChar" ), TRUE ); // m_pXmlWriter->WriteNodeBegin( _T( "w:fldChar" ), true );
// m_pXmlWriter->WriteAttribute( _T( "w:fldCharType" ), _T( "separate" ) ); // m_pXmlWriter->WriteAttribute( _T( "w:fldCharType" ), _T( "separate" ) );
// m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE ); // m_pXmlWriter->WriteNodeEnd( _T( "" ), true );
//} //}
_writeInstrText = false; _writeInstrText = false;
...@@ -671,31 +667,38 @@ namespace DocFileFormat ...@@ -671,31 +667,38 @@ namespace DocFileFormat
chpxObj->Convert(rPr); chpxObj->Convert(rPr);
RELEASEOBJECT(rPr); RELEASEOBJECT(rPr);
} }
XMLTools::CStringXmlWriter OleWriter; XMLTools::CStringXmlWriter oleWriter;
VMLPictureMapping oVmlMapper (m_context, &OleWriter, true, _caller); XMLTools::CStringXmlWriter oleObjectWriter;
VMLPictureMapping oVmlMapper (m_context, &oleWriter, true, _caller);
if (!m_shapeIdOwner.empty()) //4571833.doc
oVmlMapper.m_shapeId = m_shapeIdOwner;
if (m_document->bOlderVersion) if (m_document->bOlderVersion)
{ {
OleObject ole ( chpxObj, m_document->GetStorage(), m_document->bOlderVersion); OleObject ole ( chpxObj, m_document->GetStorage(), m_document->bOlderVersion);
OleWriter.WriteNodeBegin (_T( "w:object" ), TRUE); oleWriter.WriteNodeBegin (_T( "w:object" ), true);
OleWriter.WriteAttribute( _T( "w:dxaOrig" ), FormatUtils::IntToWideString( ( ole.pictureDesciptor.dxaGoal + ole.pictureDesciptor.dxaOrigin ) ).c_str() ); oleWriter.WriteAttribute( _T( "w:dxaOrig" ), FormatUtils::IntToWideString( ( ole.pictureDesciptor.dxaGoal + ole.pictureDesciptor.dxaOrigin ) ).c_str() );
OleWriter.WriteAttribute( _T( "w:dyaOrig" ), FormatUtils::IntToWideString( ( ole.pictureDesciptor.dyaGoal + ole.pictureDesciptor.dyaOrigin ) ).c_str() ); oleWriter.WriteAttribute( _T( "w:dyaOrig" ), FormatUtils::IntToWideString( ( ole.pictureDesciptor.dyaGoal + ole.pictureDesciptor.dyaOrigin ) ).c_str() );
OleWriter.WriteNodeEnd( _T( "" ), TRUE, FALSE ); oleWriter.WriteNodeEnd( _T( "" ), true, false );
ole.pictureDesciptor.Convert(&oVmlMapper); ole.pictureDesciptor.Convert(&oVmlMapper);
OleObjectMapping oleObjectMapping( &OleWriter, m_context, &ole.pictureDesciptor, _caller, oVmlMapper.GetShapeId() ); OleObjectMapping oleObjectMapping( &oleObjectWriter, m_context, &ole.pictureDesciptor, _caller, oVmlMapper.m_shapeId);
ole.Convert( &oleObjectMapping ); ole.Convert( &oleObjectMapping );
_lastOLEObject = oleObjectWriter.GetXmlString();
} }
else else
{ {
PictureDescriptor pic(chpxObj, m_document->DataStream, 0x7fffffff, m_document->bOlderVersion); PictureDescriptor pic(chpxObj, m_document->DataStream, 0x7fffffff, m_document->bOlderVersion);
OleWriter.WriteNodeBegin (_T( "w:object" ), TRUE); oleWriter.WriteNodeBegin (_T( "w:object" ), true);
OleWriter.WriteAttribute( _T( "w:dxaOrig" ), FormatUtils::IntToWideString( ( pic.dxaGoal + pic.dxaOrigin ) ).c_str() ); oleWriter.WriteAttribute( _T( "w:dxaOrig" ), FormatUtils::IntToWideString( ( pic.dxaGoal + pic.dxaOrigin ) ).c_str() );
OleWriter.WriteAttribute( _T( "w:dyaOrig" ), FormatUtils::IntToWideString( ( pic.dyaGoal + pic.dyaOrigin ) ).c_str() ); oleWriter.WriteAttribute( _T( "w:dyaOrig" ), FormatUtils::IntToWideString( ( pic.dyaGoal + pic.dyaOrigin ) ).c_str() );
OleWriter.WriteNodeEnd( _T( "" ), TRUE, FALSE ); oleWriter.WriteNodeEnd( _T( "" ), true, false );
pic.Convert(&oVmlMapper); pic.Convert(&oVmlMapper);
RELEASEOBJECT(chpxs); RELEASEOBJECT(chpxs);
...@@ -709,7 +712,7 @@ namespace DocFileFormat ...@@ -709,7 +712,7 @@ namespace DocFileFormat
CharacterPropertyExceptions* chpxSep = chpxs->front(); CharacterPropertyExceptions* chpxSep = chpxs->front();
OleObject ole ( chpxSep, m_document->GetStorage(), m_document->bOlderVersion); OleObject ole ( chpxSep, m_document->GetStorage(), m_document->bOlderVersion);
OleObjectMapping oleObjectMapping( &OleWriter, m_context, &pic, _caller, oVmlMapper.GetShapeId() ); OleObjectMapping oleObjectMapping( &oleObjectWriter, m_context, &pic, _caller, oVmlMapper.m_shapeId );
if (oVmlMapper.m_isEmbedded) if (oVmlMapper.m_isEmbedded)
{ {
...@@ -718,11 +721,14 @@ namespace DocFileFormat ...@@ -718,11 +721,14 @@ namespace DocFileFormat
ole.emeddedData = oVmlMapper.m_embeddedData; ole.emeddedData = oVmlMapper.m_embeddedData;
} }
ole.Convert( &oleObjectMapping ); ole.Convert( &oleObjectMapping );
_lastOLEObject = oleObjectWriter.GetXmlString();
RELEASEOBJECT( chpxs ); RELEASEOBJECT( chpxs );
} }
} }
OleWriter.WriteNodeEnd( _T( "w:object" ) ); oleWriter.WriteString( _lastOLEObject );
oleWriter.WriteNodeEnd( _T( "w:object" ) );
if (!oVmlMapper.m_isEmbedded && oVmlMapper.m_isEquation) if (!oVmlMapper.m_isEmbedded && oVmlMapper.m_isEquation)
{ {
...@@ -732,7 +738,7 @@ namespace DocFileFormat ...@@ -732,7 +738,7 @@ namespace DocFileFormat
} }
else else
{ {
m_pXmlWriter->WriteString(OleWriter.GetXmlString()); m_pXmlWriter->WriteString(oleWriter.GetXmlString());
} }
} }
...@@ -741,9 +747,9 @@ namespace DocFileFormat ...@@ -741,9 +747,9 @@ namespace DocFileFormat
} }
else else
{ {
m_pXmlWriter->WriteNodeBegin( _T( "w:fldChar" ), TRUE ); m_pXmlWriter->WriteNodeBegin( _T( "w:fldChar" ), true );
m_pXmlWriter->WriteAttribute( _T( "w:fldCharType" ), _T( "begin" ) ); m_pXmlWriter->WriteAttribute( _T( "w:fldCharType" ), _T( "begin" ) );
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE ); m_pXmlWriter->WriteNodeEnd( _T( "" ), true );
_writeInstrText = true; _writeInstrText = true;
_fldCharCounter++; _fldCharCounter++;
...@@ -787,10 +793,10 @@ namespace DocFileFormat ...@@ -787,10 +793,10 @@ namespace DocFileFormat
{ {
Symbol s = getSymbol( chpx ); Symbol s = getSymbol( chpx );
m_pXmlWriter->WriteNodeBegin(_T("w:sym"), TRUE); m_pXmlWriter->WriteNodeBegin(_T("w:sym"), true);
m_pXmlWriter->WriteAttribute(_T("w:font"), FormatUtils::XmlEncode(s.FontName).c_str()); m_pXmlWriter->WriteAttribute(_T("w:font"), FormatUtils::XmlEncode(s.FontName).c_str());
m_pXmlWriter->WriteAttribute(_T("w:char"), FormatUtils::XmlEncode(s.HexValue).c_str()); m_pXmlWriter->WriteAttribute(_T("w:char"), FormatUtils::XmlEncode(s.HexValue).c_str());
m_pXmlWriter->WriteNodeEnd(_T(""), TRUE); m_pXmlWriter->WriteNodeEnd(_T(""), true);
} }
else if ((TextMark::DrawnObject == code) && fSpec) else if ((TextMark::DrawnObject == code) && fSpec)
{ {
...@@ -807,20 +813,23 @@ namespace DocFileFormat ...@@ -807,20 +813,23 @@ namespace DocFileFormat
if (pSpa) if (pSpa)
{ {
PictureDescriptor pictDiscr(chpx, m_document->WordDocumentStream, 0x7fffffff, m_document->bOlderVersion);
ShapeContainer* pShape = m_document->GetOfficeArt()->GetShapeContainer(pSpa->GetShapeID()); ShapeContainer* pShape = m_document->GetOfficeArt()->GetShapeContainer(pSpa->GetShapeID());
if (pShape) if (pShape)
{ {
m_pXmlWriter->WriteNodeBegin (_T("w:pict")); VMLShapeMapping oVmlWriter (m_context, m_pXmlWriter, pSpa, &pictDiscr, _caller);
VMLShapeMapping oVmlWriter (m_context, m_pXmlWriter, pSpa, NULL, _caller);
m_pXmlWriter->WriteNodeBegin (L"w:pict");
pShape->Convert(&oVmlWriter); pShape->Convert(&oVmlWriter);
m_pXmlWriter->WriteNodeEnd (_T("w:pict")); m_pXmlWriter->WriteNodeEnd (L"w:pict");
} }
if (!pSpa->primitives.empty()) if (!pSpa->primitives.empty())
{ {
m_pXmlWriter->WriteNodeBegin (_T("w:pict")); m_pXmlWriter->WriteNodeBegin (_T("w:pict"));
VMLShapeMapping oVmlWriter (m_context, m_pXmlWriter, pSpa, NULL, _caller); VMLShapeMapping oVmlWriter (m_context, m_pXmlWriter, pSpa, &pictDiscr, _caller);
pSpa->primitives.Convert(&oVmlWriter); pSpa->primitives.Convert(&oVmlWriter);
m_pXmlWriter->WriteNodeEnd (_T("w:pict")); m_pXmlWriter->WriteNodeEnd (_T("w:pict"));
} }
...@@ -865,7 +874,7 @@ namespace DocFileFormat ...@@ -865,7 +874,7 @@ namespace DocFileFormat
if (oVmlMapper.m_isEmbedded) if (oVmlMapper.m_isEmbedded)
{ {
OleObject ole ( chpx, m_document->GetStorage(), m_document->bOlderVersion); OleObject ole ( chpx, m_document->GetStorage(), m_document->bOlderVersion);
OleObjectMapping oleObjectMapping( &pictWriter, m_context, &oPicture, _caller, oVmlMapper.GetShapeId() ); OleObjectMapping oleObjectMapping( &pictWriter, m_context, &oPicture, _caller, oVmlMapper.m_shapeId );
ole.isEquation = oVmlMapper.m_isEquation; ole.isEquation = oVmlMapper.m_isEquation;
ole.isEmbedded = oVmlMapper.m_isEmbedded; ole.isEmbedded = oVmlMapper.m_isEmbedded;
...@@ -897,40 +906,40 @@ namespace DocFileFormat ...@@ -897,40 +906,40 @@ namespace DocFileFormat
{ {
if ((m_document->FootnoteReferenceCharactersPlex != NULL) && (m_document->FootnoteReferenceCharactersPlex->IsCpExists(cp))) if ((m_document->FootnoteReferenceCharactersPlex != NULL) && (m_document->FootnoteReferenceCharactersPlex->IsCpExists(cp)))
{ {
m_pXmlWriter->WriteNodeBegin( _T( "w:footnoteReference" ), TRUE ); m_pXmlWriter->WriteNodeBegin( _T( "w:footnoteReference" ), true );
m_pXmlWriter->WriteAttribute( _T( "w:id" ), FormatUtils::IntToWideString(_footnoteNr++ ).c_str() ); m_pXmlWriter->WriteAttribute( _T( "w:id" ), FormatUtils::IntToWideString(_footnoteNr++ ).c_str() );
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE ); m_pXmlWriter->WriteNodeEnd( _T( "" ), true );
} }
else if ((m_document->IndividualFootnotesPlex != NULL) && (m_document->IndividualFootnotesPlex->IsCpExists(cp - m_document->FIB->m_RgLw97.ccpText))) else if ((m_document->IndividualFootnotesPlex != NULL) && (m_document->IndividualFootnotesPlex->IsCpExists(cp - m_document->FIB->m_RgLw97.ccpText)))
{ {
m_pXmlWriter->WriteNodeBegin( _T( "w:footnoteRef" ), TRUE ); m_pXmlWriter->WriteNodeBegin( _T( "w:footnoteRef" ), true );
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE ); m_pXmlWriter->WriteNodeEnd( _T( "" ), true );
} }
else if ((m_document->EndnoteReferenceCharactersPlex != NULL) && (m_document->EndnoteReferenceCharactersPlex->IsCpExists(cp))) else if ((m_document->EndnoteReferenceCharactersPlex != NULL) && (m_document->EndnoteReferenceCharactersPlex->IsCpExists(cp)))
{ {
m_pXmlWriter->WriteNodeBegin( _T( "w:endnoteReference" ), TRUE ); m_pXmlWriter->WriteNodeBegin( _T( "w:endnoteReference" ), true );
m_pXmlWriter->WriteAttribute( _T( "w:id" ), FormatUtils::IntToWideString(_endnoteNr++ ).c_str() ); m_pXmlWriter->WriteAttribute( _T( "w:id" ), FormatUtils::IntToWideString(_endnoteNr++ ).c_str() );
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE ); m_pXmlWriter->WriteNodeEnd( _T( "" ), true );
} }
else if ((m_document->IndividualEndnotesPlex != NULL) && else if ((m_document->IndividualEndnotesPlex != NULL) &&
(m_document->IndividualEndnotesPlex->IsCpExists(cp - m_document->FIB->m_RgLw97.ccpAtn - m_document->FIB->m_RgLw97.ccpHdr - m_document->FIB->m_RgLw97.ccpFtn - m_document->FIB->m_RgLw97.ccpText))) (m_document->IndividualEndnotesPlex->IsCpExists(cp - m_document->FIB->m_RgLw97.ccpAtn - m_document->FIB->m_RgLw97.ccpHdr - m_document->FIB->m_RgLw97.ccpFtn - m_document->FIB->m_RgLw97.ccpText)))
{ {
m_pXmlWriter->WriteNodeBegin( _T( "w:endnoteRef" ), TRUE ); m_pXmlWriter->WriteNodeBegin( _T( "w:endnoteRef" ), true );
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE ); m_pXmlWriter->WriteNodeEnd( _T( "" ), true );
} }
} }
else if (TextMark::AnnotationReference == code) else if (TextMark::AnnotationReference == code)
{ {
if (typeid(*this) != typeid(CommentsMapping)) if (typeid(*this) != typeid(CommentsMapping))
{ {
m_pXmlWriter->WriteNodeBegin( _T( "w:commentReference" ), TRUE ); m_pXmlWriter->WriteNodeBegin( _T( "w:commentReference" ), true );
m_pXmlWriter->WriteAttribute( _T( "w:id" ), FormatUtils::IntToWideString( _commentNr ).c_str() ); m_pXmlWriter->WriteAttribute( _T( "w:id" ), FormatUtils::IntToWideString( _commentNr ).c_str() );
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE ); m_pXmlWriter->WriteNodeEnd( _T( "" ), true );
} }
else else
{ {
m_pXmlWriter->WriteNodeBegin( _T( "w:annotationRef" ), TRUE ); m_pXmlWriter->WriteNodeBegin( _T( "w:annotationRef" ), true );
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE ); m_pXmlWriter->WriteNodeEnd( _T( "" ), true );
} }
_commentNr++; _commentNr++;
...@@ -976,12 +985,12 @@ namespace DocFileFormat ...@@ -976,12 +985,12 @@ namespace DocFileFormat
{ {
std::wstring str = ( std::wstring( _T( "w:" ) ) + textType ); std::wstring str = ( std::wstring( _T( "w:" ) ) + textType );
m_pXmlWriter->WriteNodeBegin( str.c_str(), TRUE ); m_pXmlWriter->WriteNodeBegin( str.c_str(), true );
if (preserve_space) if (preserve_space)
{ {
m_pXmlWriter->WriteAttribute( _T( "xml:space" ), _T( "preserve" ) ); m_pXmlWriter->WriteAttribute( _T( "xml:space" ), _T( "preserve" ) );
} }
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE ); m_pXmlWriter->WriteNodeEnd( _T( "" ), true, false );
} }
void DocumentMapping::writeTextEnd(const std::wstring& textType) void DocumentMapping::writeTextEnd(const std::wstring& textType)
......
...@@ -70,68 +70,70 @@ namespace DocFileFormat ...@@ -70,68 +70,70 @@ namespace DocFileFormat
public: public:
DocumentMapping(ConversionContext* context, IMapping* caller); DocumentMapping(ConversionContext* context, IMapping* caller);
DocumentMapping(ConversionContext* context, XMLTools::CStringXmlWriter* writer, IMapping* caller); DocumentMapping(ConversionContext* context, XMLTools::CStringXmlWriter* writer, IMapping* caller);
virtual ~DocumentMapping(); virtual ~DocumentMapping();
virtual void Apply( IVisitable* visited ) = 0; virtual void Apply( IVisitable* visited ) = 0;
//--------------------------------- 4571833.doc
std::wstring m_shapeIdOwner;
std::wstring getOLEObject() { return _lastOLEObject; }
protected: protected:
/// Looks into the section table to find out if this CP is the current of a section // Looks into the section table to find out if this CP is the current of a section
int getCurrentSection(int cp); int getCurrentSection(int cp);
/// Looks into the section table to find out if this CP is the end of a section // Looks into the section table to find out if this CP is the end of a section
bool isSectionEnd( int cp ); bool isSectionEnd( int cp );
/// Writes a Paragraph that starts at the given cp and // Writes a Paragraph that starts at the given cp and
/// ends at the next paragraph end mark or section end mark // ends at the next paragraph end mark or section end mark
int writeParagraph( int cp ); int writeParagraph( int cp );
/// Writes a Paragraph that starts at the given cpStart and // Writes a Paragraph that starts at the given cpStart and
/// ends at the given cpEnd // ends at the given cpEnd
int writeParagraph( int initialCp, int cpEnd, bool sectionEnd, bool lastBad = false ); int writeParagraph( int initialCp, int cpEnd, bool sectionEnd, bool lastBad = false );
/// Writes a Paragraph RSID // Writes a Paragraph RSID
void writeParagraphRsid( const ParagraphPropertyExceptions* papx ); void writeParagraphRsid( const ParagraphPropertyExceptions* papx );
/// Writes a run with the given characters and CHPX // Writes a run with the given characters and CHPX
int writeRun( std::vector<wchar_t>* chars, CharacterPropertyExceptions* chpx, int initialCp ); int writeRun( std::vector<wchar_t>* chars, CharacterPropertyExceptions* chpx, int initialCp );
/// Writes the given text to the document // Writes the given text to the document
int writeText( std::vector<wchar_t>* chars, int initialCp, CharacterPropertyExceptions* chpx, bool writeDeletedText ); int writeText( std::vector<wchar_t>* chars, int initialCp, CharacterPropertyExceptions* chpx, bool writeDeletedText );
void writeTextElement( const std::wstring& text, const std::wstring& textType ); void writeTextElement( const std::wstring& text, const std::wstring& textType );
void writeTextStart( const std::wstring& textType, bool preserve_space); void writeTextStart( const std::wstring& textType, bool preserve_space);
void writeTextEnd( const std::wstring& textType ); void writeTextEnd( const std::wstring& textType );
/// Searches for bookmarks in the list of characters. // Searches for bookmarks in the list of characters.
std::vector<int> searchBookmarks( std::vector<wchar_t>* chars, int initialCp ); std::vector<int> searchBookmarks( std::vector<wchar_t>* chars, int initialCp );
ParagraphPropertyExceptions* findValidPapx( int fc ); ParagraphPropertyExceptions* findValidPapx( int fc );
/// Splits a list of characters into several lists // Splits a list of characters into several lists
std::list<std::vector<wchar_t> >* splitCharList( std::vector<wchar_t>* chars, std::vector<int>* splitIndices ); std::list<std::vector<wchar_t> >* splitCharList( std::vector<wchar_t>* chars, std::vector<int>* splitIndices );
/// Writes the table starts at the given cp value // Writes the table starts at the given cp value
int writeTable( int initialCp, unsigned int nestingLevel ); int writeTable( int initialCp, unsigned int nestingLevel );
/// Builds a list that contains the width of the several columns of the table. // Builds a list that contains the width of the several columns of the table.
std::vector<short>* buildTableGrid( int initialCp, unsigned int nestingLevel ); std::vector<short>* buildTableGrid( int initialCp, unsigned int nestingLevel );
/// Finds the FC of the next row end mark. // Finds the FC of the next row end mark.
int findRowEndFc( int initialCp, int& rowEndCp, unsigned int nestingLevel ); int findRowEndFc( int initialCp, int& rowEndCp, unsigned int nestingLevel );
/// Finds the FC of the next row end mark. // Finds the FC of the next row end mark.
int findRowEndFc( int initialCp, unsigned int nestingLevel ); int findRowEndFc( int initialCp, unsigned int nestingLevel );
/// Writes the table row that starts at the given cp value and ends at the next row end mark // Writes the table row that starts at the given cp value and ends at the next row end mark
int writeTableRow( int initialCp, std::vector<short>* grid, unsigned int nestingLevel ); int writeTableRow( int initialCp, std::vector<short>* grid, unsigned int nestingLevel );
/// Writes the table cell that starts at the given cp value and ends at the next cell end mark // Writes the table cell that starts at the given cp value and ends at the next cell end mark
int writeTableCell( int initialCp, TablePropertyExceptions* tapx, std::vector<short>* grid, int& gridIndex, int cellIndex, unsigned int nestingLevel ); int writeTableCell( int initialCp, TablePropertyExceptions* tapx, std::vector<short>* grid, int& gridIndex, int cellIndex, unsigned int nestingLevel );
int findCellEndCp( int initialCp, unsigned int nestingLevel ); int findCellEndCp( int initialCp, unsigned int nestingLevel );
bool writeBookmarks( int cp ); bool writeBookmarks( int cp );
bool writeBookmarkStart( short id ); bool writeBookmarkStart( short id );
bool writeBookmarkEnd( short id ); bool writeBookmarkEnd( short id );
/// Checks if the CHPX is special // Checks if the CHPX is special
bool isSpecial( CharacterPropertyExceptions* chpx ); bool isSpecial( CharacterPropertyExceptions* chpx );
/// Finds the SEPX that is valid for the given CP. // Finds the SEPX that is valid for the given CP.
SectionPropertyExceptions* findValidSepx( int cp ); SectionPropertyExceptions* findValidSepx( int cp );
/// Searches the given vector for the next FieldEnd character. // Searches the given vector for the next FieldEnd character.
int searchNextTextMark( std::vector<wchar_t>* chars, int initialCp, wchar_t mark ); int searchNextTextMark( std::vector<wchar_t>* chars, int initialCp, wchar_t mark );
Symbol getSymbol ( const CharacterPropertyExceptions* chpx );
private: //----------------------------------------------------------------------------------------------------------------------
Symbol getSymbol( const CharacterPropertyExceptions* chpx );
bool m_bInternalXmlWriter; bool m_bInternalXmlWriter;
protected:
WordDocument* m_document; WordDocument* m_document;
ConversionContext* m_context; ConversionContext* m_context;
IMapping* _caller; IMapping* _caller;
ParagraphPropertyExceptions* _lastValidPapx; ParagraphPropertyExceptions* _lastValidPapx;
...@@ -149,5 +151,6 @@ namespace DocFileFormat ...@@ -149,5 +151,6 @@ namespace DocFileFormat
bool _writeWebHidden; bool _writeWebHidden;
unsigned int _fldCharCounter; unsigned int _fldCharCounter;
std::wstring _writeAfterRun; std::wstring _writeAfterRun;
std::wstring _lastOLEObject;
}; };
} }
...@@ -67,7 +67,7 @@ namespace DocFileFormat ...@@ -67,7 +67,7 @@ namespace DocFileFormat
virtual ~Shape() virtual ~Shape()
{ {
RELEASEOBJECT( this->shapeType ); RELEASEOBJECT( shapeType );
} }
Shape( IBinaryReader* _reader, unsigned int size, unsigned int typeCode, unsigned int version, unsigned int instance ): Shape( IBinaryReader* _reader, unsigned int size, unsigned int typeCode, unsigned int version, unsigned int instance ):
...@@ -107,12 +107,12 @@ namespace DocFileFormat ...@@ -107,12 +107,12 @@ namespace DocFileFormat
inline int GetShapeID() const inline int GetShapeID() const
{ {
return this->spid; return spid;
} }
inline ShapeType* GetShapeType() const inline ShapeType* GetShapeType() const
{ {
return this->shapeType; return shapeType;
} }
template<class T> bool is() const template<class T> bool is() const
......
...@@ -83,6 +83,20 @@ namespace DocFileFormat ...@@ -83,6 +83,20 @@ namespace DocFileFormat
} }
return false; return false;
} }
bool isOLE()
{
int ret = 0;
for ( std::vector<Record*>::const_iterator iter = this->Children.begin(); iter != this->Children.end(); iter++ )
{
Shape* sh = dynamic_cast<Shape*>( *iter );
if (sh)
{
return sh->fOleShape;
}
}
return false;
}
virtual ~ShapeContainer() virtual ~ShapeContainer()
{ {
} }
......
/*
* (c) Copyright Ascensio System SIA 2010-2016
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
#include "OleObject.h"
namespace DocFileFormat
{
OleObject::OleObject( const CharacterPropertyExceptions* chpx, StructuredStorageReader* docStorage, bool bOlderVersion_ )
: bLinked(false), updateMode(NoLink), bOlderVersion(bOlderVersion_), isEquation(false), isEmbedded (false)
{
if (!docStorage) return;
if (!chpx) return;
oleStorage = docStorage->GetStorage();
if (!oleStorage) return;
HRESULT res = S_OK;
POLE::Stream* ObjectPoolStorage = new POLE::Stream(oleStorage, "ObjectPool");
if (ObjectPoolStorage)
{
ObjectId = getOleEntryName( chpx );
std::string sObjectId( ObjectId.begin(), ObjectId.end() );
{
std::string name = "ObjectPool/" + sObjectId + "/";
processOleStream( name + "Ole" );
if ( bLinked )
{
processLinkInfoStream( name + "LinkInfo" );
}
else
{
processCompObjStream( name + "CompObj" );
}
processPICStream( name + "PIC" );
processEquationNativeStream( name + "Equation Native" );
}
delete ObjectPoolStorage;
}
}
void OleObject::processLinkInfoStream( const std::string& linkStream )
{
try
{
POLE::Stream* pLinkStream = NULL;
HRESULT res = S_OK;
pLinkStream = //oleStorage->stream(linkStream);
new POLE::Stream(oleStorage, linkStream);
if ( pLinkStream )
{
VirtualStreamReader reader( pLinkStream, 0, false);
//there are two versions of the Link string, one contains ANSI characters, the other contains
//unicode characters.
//Both strings seem not to be standardized:
//The length prefix is a character count EXCLUDING the terminating zero
//Read the ANSI version
short cch = reader.ReadInt16();
unsigned char* str = reader.ReadBytes( cch, true );
FormatUtils::GetSTLCollectionFromBytes<std::wstring>( &this->Link, str, cch, ENCODING_WINDOWS_1250 );
RELEASEARRAYOBJECTS( str );
//skip the terminating zero of the ANSI string
//even if the characters are ANSI chars, the terminating zero has 2 bytes
reader.ReadBytes( 2, false );
//skip the next 4 bytes (flags?)
reader.ReadBytes( 4, false );
//Read the Unicode version
this->Link.clear();
cch = reader.ReadInt16();
str = reader.ReadBytes( ( cch * 2 ), true );
FormatUtils::GetSTLCollectionFromBytes<std::wstring>( &this->Link, str, ( cch * 2 ), ENCODING_UTF16 );
RELEASEARRAYOBJECTS( str );
//skip the terminating zero of the Unicode string
reader.ReadBytes( 2, false );
delete pLinkStream;
}
}
catch (...)
{
}
}
void OleObject::processEquationNativeStream( const std::string& eqStream )
{
try
{
POLE::Stream* pCompStream = NULL;
HRESULT res = S_OK;
pCompStream = new POLE::Stream(oleStorage, eqStream);
if ( pCompStream )
{
VirtualStreamReader reader( pCompStream, 0, false);
int sz = reader.GetSize();
unsigned char *Buffer = reader.ReadBytes( sz, true );
if (Buffer && sz > 0)
{
isEquation = true;
delete []Buffer;
}
delete pCompStream;
}
}
catch (...)
{
}
}
void OleObject::processPICStream( const std::string& picStream )
{
try
{
HRESULT res = S_OK;
POLE::Stream* pPICStream = new POLE::Stream(oleStorage, picStream);
if ( pPICStream )
{
VirtualStreamReader reader( pPICStream, 0, false);
int sz = reader.GetSize();
int cbHeader = reader.ReadUInt32();
reader.ReadBytes(4, false);
int x = reader.ReadUInt32();
int y = reader.ReadUInt32();
pictureDesciptor.dyaGoal = reader.ReadUInt32();
pictureDesciptor.dxaGoal = reader.ReadUInt32();
reader.ReadBytes(20, false);
pictureDesciptor.mx = reader.ReadUInt32();
pictureDesciptor.my = reader.ReadUInt32();
}
}
catch (...)
{
}
}
void OleObject::processCompObjStream( const std::string& compStream )
{
try
{
HRESULT res = S_OK;
POLE::Stream* pCompStream = new POLE::Stream(oleStorage, compStream);
if ( pCompStream )
{
VirtualStreamReader reader( pCompStream, 0, false);
//skip the CompObjHeader
reader.ReadBytes( 28, false );
int sz_obj = reader.GetSize() - reader.GetPosition();
if (sz_obj > 4)
{
UserType = reader.ReadLengthPrefixedAnsiString(sz_obj);
sz_obj = reader.GetSize() - reader.GetPosition();
if (sz_obj > 4)
ClipboardFormat = reader.ReadLengthPrefixedAnsiString(sz_obj);
sz_obj = reader.GetSize() - reader.GetPosition();
if (sz_obj > 4)
Program = reader.ReadLengthPrefixedAnsiString(sz_obj);
}
delete pCompStream;
}
}
catch (...)
{
}
}
void OleObject::processOleStream( const std::string& oleStreamName )
{
try
{
POLE::Stream* pOleStream;
HRESULT res = S_OK;
pOleStream = new POLE::Stream(oleStorage, oleStreamName);
if ( pOleStream )
{
VirtualStreamReader reader( pOleStream, 0, false );
//skip version
reader.ReadBytes( 4, false );
//read the embedded/linked flag
int flag = reader.ReadInt32();
bLinked = FormatUtils::BitmaskToBool( flag, 0x1 );
//Link update option
this->updateMode = (LinkUpdateOption)reader.ReadInt32();
switch ( this->updateMode )
{
case NoLink:
{
this->UpdateMode = L"NoLink";
}
break;
case Always:
{
this->UpdateMode = L"Always";
}
break;
case OnCall:
{
this->UpdateMode = L"OnCall";
}
break;
}
delete pOleStream;
}
}
catch (...)
{
}
}
std::wstring OleObject::getOleEntryName( const CharacterPropertyExceptions* chpx )
{
std::wstring ret;
if ( chpx != NULL )
{
for ( std::list<SinglePropertyModifier>::const_iterator iter = chpx->grpprl->begin(); iter != chpx->grpprl->end(); iter++ )
{
if ( iter->OpCode == sprmCPicLocation || iter->OpCode == sprmOldCPicLocation)
{
ret = ( L"_" + FormatUtils::IntToWideString( FormatUtils::BytesToUInt32( iter->Arguments, 0, iter->argumentsSize ) ) );
break;
}
}
}
return ret;
}
}
...@@ -68,276 +68,18 @@ namespace DocFileFormat ...@@ -68,276 +68,18 @@ namespace DocFileFormat
PictureDescriptor pictureDesciptor; PictureDescriptor pictureDesciptor;
OleObject( const CharacterPropertyExceptions* chpx, StructuredStorageReader* docStorage, bool bOlderVersion_ ) OleObject( const CharacterPropertyExceptions* chpx, StructuredStorageReader* docStorage, bool bOlderVersion_ );
: bLinked(false), updateMode(NoLink), bOlderVersion(bOlderVersion_) virtual ~OleObject() {}
{
isEquation = isEmbedded = false;
oleStorage = docStorage->GetStorage();
if ( ( chpx != NULL ) && ( docStorage != NULL ) )
{
HRESULT res = S_OK;
POLE::Stream* ObjectPoolStorage = new POLE::Stream(oleStorage, "ObjectPool");
if (ObjectPoolStorage)
{
ObjectId = getOleEntryName( chpx );
std::string sObjectId( ObjectId.begin(), ObjectId.end() );
{
std::string name = "ObjectPool/" + sObjectId + "/";
processOleStream( name + "Ole" );
if ( bLinked )
{
processLinkInfoStream( name + "LinkInfo" );
}
else
{
processCompObjStream( name + "CompObj" );
}
processPICStream( name + "PIC" );
processEquationNativeStream( name + "Equation Native" );
}
delete ObjectPoolStorage;
}
}
}
virtual ~OleObject()
{
}
private: private:
POLE::Storage *oleStorage; POLE::Storage *oleStorage;
void processLinkInfoStream( const std::string& linkStream ) void processLinkInfoStream ( const std::string& linkStream );
{ void processEquationNativeStream( const std::string& eqStream );
try void processPICStream ( const std::string& picStream );
{ void processCompObjStream ( const std::string& compStream );
POLE::Stream* pLinkStream = NULL; void processOleStream ( const std::string& oleStreamName );
HRESULT res = S_OK;
std::wstring getOleEntryName ( const CharacterPropertyExceptions* chpx );
pLinkStream = //oleStorage->stream(linkStream); };
new POLE::Stream(oleStorage, linkStream);
if ( pLinkStream )
{
VirtualStreamReader reader( pLinkStream, 0, false);
//there are two versions of the Link string, one contains ANSI characters, the other contains
//unicode characters.
//Both strings seem not to be standardized:
//The length prefix is a character count EXCLUDING the terminating zero
//Read the ANSI version
short cch = reader.ReadInt16();
unsigned char* str = reader.ReadBytes( cch, true );
FormatUtils::GetSTLCollectionFromBytes<std::wstring>( &this->Link, str, cch, ENCODING_WINDOWS_1250 );
RELEASEARRAYOBJECTS( str );
//skip the terminating zero of the ANSI string
//even if the characters are ANSI chars, the terminating zero has 2 bytes
reader.ReadBytes( 2, false );
//skip the next 4 bytes (flags?)
reader.ReadBytes( 4, false );
//Read the Unicode version
this->Link.clear();
cch = reader.ReadInt16();
str = reader.ReadBytes( ( cch * 2 ), true );
FormatUtils::GetSTLCollectionFromBytes<std::wstring>( &this->Link, str, ( cch * 2 ), ENCODING_UTF16 );
RELEASEARRAYOBJECTS( str );
//skip the terminating zero of the Unicode string
reader.ReadBytes( 2, false );
delete pLinkStream;
}
}
catch (...)
{
}
}
void processEquationNativeStream( const std::string& eqStream )
{
try
{
POLE::Stream* pCompStream = NULL;
HRESULT res = S_OK;
pCompStream = new POLE::Stream(oleStorage, eqStream);
if ( pCompStream )
{
VirtualStreamReader reader( pCompStream, 0, false);
int sz = reader.GetSize();
unsigned char *Buffer = reader.ReadBytes( sz, true );
if (Buffer && sz > 0)
{
isEquation = true;
delete []Buffer;
}
delete pCompStream;
}
}
catch (...)
{
}
}
void processPICStream( const std::string& picStream )
{
try
{
HRESULT res = S_OK;
POLE::Stream* pPICStream = new POLE::Stream(oleStorage, picStream);
if ( pPICStream )
{
VirtualStreamReader reader( pPICStream, 0, false);
int sz = reader.GetSize();
int cbHeader = reader.ReadUInt32();
reader.ReadBytes(4, false);
int x = reader.ReadUInt32();
int y = reader.ReadUInt32();
pictureDesciptor.dyaGoal = reader.ReadUInt32();
pictureDesciptor.dxaGoal = reader.ReadUInt32();
reader.ReadBytes(20, false);
pictureDesciptor.mx = reader.ReadUInt32();
pictureDesciptor.my = reader.ReadUInt32();
}
}
catch (...)
{
}
}
void processCompObjStream( const std::string& compStream )
{
try
{
HRESULT res = S_OK;
POLE::Stream* pCompStream = new POLE::Stream(oleStorage, compStream);
if ( pCompStream )
{
VirtualStreamReader reader( pCompStream, 0, false);
//skip the CompObjHeader
reader.ReadBytes( 28, false );
int sz_obj = reader.GetSize() - reader.GetPosition();
if (sz_obj > 4)
{
UserType = reader.ReadLengthPrefixedAnsiString(sz_obj);
sz_obj = reader.GetSize() - reader.GetPosition();
if (sz_obj > 4)
ClipboardFormat = reader.ReadLengthPrefixedAnsiString(sz_obj);
sz_obj = reader.GetSize() - reader.GetPosition();
if (sz_obj > 4)
Program = reader.ReadLengthPrefixedAnsiString(sz_obj);
}
delete pCompStream;
}
}
catch (...)
{
}
}
void processOleStream( const std::string& oleStreamName )
{
try
{
POLE::Stream* pOleStream;
HRESULT res = S_OK;
pOleStream = new POLE::Stream(oleStorage, oleStreamName);
if ( pOleStream )
{
VirtualStreamReader reader( pOleStream, 0, false );
//skip version
reader.ReadBytes( 4, false );
//read the embedded/linked flag
int flag = reader.ReadInt32();
bLinked = FormatUtils::BitmaskToBool( flag, 0x1 );
//Link update option
this->updateMode = (LinkUpdateOption)reader.ReadInt32();
switch ( this->updateMode )
{
case NoLink:
{
this->UpdateMode = _T( "NoLink" );
}
break;
case Always:
{
this->UpdateMode = _T( "Always" );
}
break;
case OnCall:
{
this->UpdateMode = _T( "OnCall" );
}
break;
}
delete pOleStream;
}
}
catch (...)
{
}
}
std::wstring getOleEntryName( const CharacterPropertyExceptions* chpx )
{
std::wstring ret;
if ( chpx != NULL )
{
for ( std::list<SinglePropertyModifier>::const_iterator iter = chpx->grpprl->begin(); iter != chpx->grpprl->end(); iter++ )
{
if ( iter->OpCode == sprmCPicLocation || iter->OpCode == sprmOldCPicLocation)
{
ret = ( _T( "_" ) + FormatUtils::IntToWideString( FormatUtils::BytesToUInt32( iter->Arguments, 0, iter->argumentsSize ) ) );
break;
}
}
}
return ret;
}
};
} }
...@@ -67,7 +67,6 @@ namespace DocFileFormat ...@@ -67,7 +67,6 @@ namespace DocFileFormat
} }
m_pXmlWriter->WriteNodeBegin( _T( "o:OLEObject" ), TRUE ); m_pXmlWriter->WriteNodeBegin( _T( "o:OLEObject" ), TRUE );
//type
if ( ole->bLinked ) if ( ole->bLinked )
{ {
int relID = m_context->_docx->RegisterExternalOLEObject(_caller, ole->ClipboardFormat, ole->Link); int relID = m_context->_docx->RegisterExternalOLEObject(_caller, ole->ClipboardFormat, ole->Link);
...@@ -88,22 +87,13 @@ namespace DocFileFormat ...@@ -88,22 +87,13 @@ namespace DocFileFormat
m_pXmlWriter->WriteAttribute( _T( "r:id" ), ( std::wstring( _T( "rId" ) ) + FormatUtils::IntToWideString( relID ) ).c_str() ); m_pXmlWriter->WriteAttribute( _T( "r:id" ), ( std::wstring( _T( "rId" ) ) + FormatUtils::IntToWideString( relID ) ).c_str() );
m_pXmlWriter->WriteAttribute( _T( "Type" ), _T( "Embed" ) ); m_pXmlWriter->WriteAttribute( _T( "Type" ), _T( "Embed" ) );
//copy the object
copyEmbeddedObject( ole ); copyEmbeddedObject( ole );
} }
//ProgID
m_pXmlWriter->WriteAttribute( _T( "ProgID" ), ole->Program.c_str() ); m_pXmlWriter->WriteAttribute( _T( "ProgID" ), ole->Program.c_str() );
//ShapeId
m_pXmlWriter->WriteAttribute( _T( "ShapeID" ), _shapeId.c_str() ); m_pXmlWriter->WriteAttribute( _T( "ShapeID" ), _shapeId.c_str() );
//DrawAspect
m_pXmlWriter->WriteAttribute( _T( "DrawAspect" ), _T( "Content" ) ); m_pXmlWriter->WriteAttribute( _T( "DrawAspect" ), _T( "Content" ) );
//ObjectID
m_pXmlWriter->WriteAttribute( _T( "ObjectID" ), ole->ObjectId.c_str() ); m_pXmlWriter->WriteAttribute( _T( "ObjectID" ), ole->ObjectId.c_str() );
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE ); m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
m_pXmlWriter->WriteNodeEnd( _T( "o:OLEObject" ) ); m_pXmlWriter->WriteNodeEnd( _T( "o:OLEObject" ) );
...@@ -165,20 +155,15 @@ namespace DocFileFormat ...@@ -165,20 +155,15 @@ namespace DocFileFormat
} }
private: private:
// Writes the embedded OLE object from the ObjectPool of the binary file to the OpenXml Package.
inline void copyEmbeddedObject( const OleObject* ole ) inline void copyEmbeddedObject( const OleObject* ole )
{ {
if ( ole != NULL ) if ( ole != NULL )
{ {
//!!!TODO: There is issue with some Office OLE Objects. Word can't open *.xls object (Excel.Chart) with set CLSID and
//some Power Point Presentations, and Word Documents. Open Office CAN start this objects!!!
std::wstring clsid; std::wstring clsid;
std::wstring exelChart = _T( "Excel.Chart" ); std::wstring exelChart = _T( "Excel.Chart" );
if ( std::search( ole->Program.begin(), ole->Program.end(), exelChart.begin(), exelChart.end() ) == ole->Program.end() ) if ( std::search( ole->Program.begin(), ole->Program.end(), exelChart.begin(), exelChart.end() ) == ole->Program.end() )
{//?? {
clsid = ole->ClassId; clsid = ole->ClassId;
} }
OleObjectFileStructure object_descr(OleObjectMapping::GetTargetExt( ole->ClipboardFormat ), ole->ObjectId, clsid); OleObjectFileStructure object_descr(OleObjectMapping::GetTargetExt( ole->ClipboardFormat ), ole->ObjectId, clsid);
......
...@@ -96,6 +96,8 @@ namespace DocFileFormat ...@@ -96,6 +96,8 @@ namespace DocFileFormat
{ {
friend class TextboxMapping; friend class TextboxMapping;
public: public:
static const int STRUCTURE_SIZE = 22;
struct FTXBXSReusable struct FTXBXSReusable
{ {
int iNextReuse; int iNextReuse;
...@@ -108,8 +110,6 @@ namespace DocFileFormat ...@@ -108,8 +110,6 @@ namespace DocFileFormat
int cTxbxEdit; // This value MUST be zero and MUST be ignored. int cTxbxEdit; // This value MUST be zero and MUST be ignored.
}; };
static const int STRUCTURE_SIZE = 22;
FTXBXS () FTXBXS ()
{ {
......
...@@ -50,9 +50,8 @@ namespace DocFileFormat ...@@ -50,9 +50,8 @@ namespace DocFileFormat
void SetTextboxStyle(const std::wstring & style); void SetTextboxStyle(const std::wstring & style);
private: private:
static int TextboxCount;
static int TextboxCount;
int m_nTBIndex; int m_nTBIndex;
double m_dxTextLeft; double m_dxTextLeft;
......
...@@ -189,7 +189,6 @@ namespace DocFileFormat ...@@ -189,7 +189,6 @@ namespace DocFileFormat
return res; return res;
} }
//--------------------------------------------------------------- //---------------------------------------------------------------
static int count_vml_objects = 0;
void VMLPictureMapping::appendStyleProperty(std::wstring* b, const std::wstring& propName, const std::wstring& propValue) const void VMLPictureMapping::appendStyleProperty(std::wstring* b, const std::wstring& propName, const std::wstring& propValue) const
{ {
if ( b != NULL ) if ( b != NULL )
...@@ -215,8 +214,6 @@ namespace DocFileFormat ...@@ -215,8 +214,6 @@ namespace DocFileFormat
m_isEmbedded = false; m_isEmbedded = false;
m_imageData = new XMLTools::XMLElement<wchar_t>( _T( "v:imagedata" ) ); m_imageData = new XMLTools::XMLElement<wchar_t>( _T( "v:imagedata" ) );
m_ShapeId = std::wstring(L"_x0000_i") + FormatUtils::IntToWideString(1024 + (count_vml_objects++));
} }
VMLPictureMapping::~VMLPictureMapping() VMLPictureMapping::~VMLPictureMapping()
...@@ -263,7 +260,12 @@ namespace DocFileFormat ...@@ -263,7 +260,12 @@ namespace DocFileFormat
m_pXmlWriter->WriteAttribute( _T( "type" ), std::wstring( _T( "#" ) + VMLShapeTypeMapping::GenerateTypeId(&type)).c_str()); m_pXmlWriter->WriteAttribute( _T( "type" ), std::wstring( _T( "#" ) + VMLShapeTypeMapping::GenerateTypeId(&type)).c_str());
m_pXmlWriter->WriteAttribute( _T( "id" ), m_ShapeId.c_str() ); count_vml_objects++;
if (m_shapeId.empty())
m_shapeId = std::wstring(L"_x0000_s") + FormatUtils::IntToWideString(1024 + count_vml_objects);
m_pXmlWriter->WriteAttribute( _T( "id" ), m_shapeId.c_str() );
if (m_isOlePreview) if (m_isOlePreview)
{ {
...@@ -426,11 +428,6 @@ namespace DocFileFormat ...@@ -426,11 +428,6 @@ namespace DocFileFormat
m_pXmlWriter->WriteNodeEnd( _T( "v:shape" ) ); m_pXmlWriter->WriteNodeEnd( _T( "v:shape" ) );
} }
std::wstring VMLPictureMapping::GetShapeId () const
{
return m_ShapeId;
}
void VMLPictureMapping::writePictureBorder( const std::wstring & name, const BorderCode* brc ) void VMLPictureMapping::writePictureBorder( const std::wstring & name, const BorderCode* brc )
{ {
if (!brc || name.empty()) return; if (!brc || name.empty()) return;
......
...@@ -54,8 +54,6 @@ namespace DocFileFormat ...@@ -54,8 +54,6 @@ namespace DocFileFormat
VMLPictureMapping( ConversionContext* ctx, XMLTools::CStringXmlWriter* writer, bool olePreview, IMapping* caller, bool isInlinePicture = false ); VMLPictureMapping( ConversionContext* ctx, XMLTools::CStringXmlWriter* writer, bool olePreview, IMapping* caller, bool isInlinePicture = false );
virtual ~VMLPictureMapping(); virtual ~VMLPictureMapping();
virtual void Apply( IVisitable* visited ); virtual void Apply( IVisitable* visited );
std::wstring GetShapeId() const;
private: private:
/// Writes a border element /// Writes a border element
void writePictureBorder (const std::wstring & name, const BorderCode* brc); void writePictureBorder (const std::wstring & name, const BorderCode* brc);
...@@ -75,12 +73,13 @@ namespace DocFileFormat ...@@ -75,12 +73,13 @@ namespace DocFileFormat
bool m_isEmbedded; bool m_isEmbedded;
std::string m_embeddedData; std::string m_embeddedData;
std::wstring m_equationXml; std::wstring m_equationXml;
std::wstring m_shapeId;
private: private:
ConversionContext* m_ctx; ConversionContext* m_ctx;
IMapping* m_caller; IMapping* m_caller;
int m_nImageId; int m_nImageId;
std::wstring m_ShapeId;
bool m_isOlePreview; bool m_isOlePreview;
bool m_isInlinePicture; bool m_isInlinePicture;
......
...@@ -69,7 +69,7 @@ namespace DocFileFormat ...@@ -69,7 +69,7 @@ namespace DocFileFormat
m_pCaller = pCaller; m_pCaller = pCaller;
m_pBlipStore = NULL; m_pBlipStore = NULL;
m_ctx = pConv; m_context = pConv;
m_pict = pPicture; m_pict = pPicture;
m_nImageId = 0; m_nImageId = 0;
...@@ -81,9 +81,9 @@ namespace DocFileFormat ...@@ -81,9 +81,9 @@ namespace DocFileFormat
m_textpath = XMLTools::XMLElement<wchar_t>(L"v:textpath"); m_textpath = XMLTools::XMLElement<wchar_t>(L"v:textpath");
Record* recBs = NULL; Record* recBs = NULL;
if ((m_ctx) && (m_ctx->_doc)) if ((m_context) && (m_context->_doc))
{ {
OfficeArtContent* officeArt = m_ctx->_doc->GetOfficeArt(); OfficeArtContent* officeArt = m_context->_doc->GetOfficeArt();
if (officeArt) if (officeArt)
{ {
const DrawingGroup* group = officeArt->GetDrawingGroup(); const DrawingGroup* group = officeArt->GetDrawingGroup();
...@@ -146,8 +146,10 @@ namespace DocFileFormat ...@@ -146,8 +146,10 @@ namespace DocFileFormat
std::list<OptionEntry> options = groupShape->ExtractOptions(); std::list<OptionEntry> options = groupShape->ExtractOptions();
ChildAnchor* anchor = groupShape->FirstChildWithType<ChildAnchor>(); ChildAnchor* anchor = groupShape->FirstChildWithType<ChildAnchor>();
m_shapeId = GetShapeID(shape);
m_pXmlWriter->WriteNodeBegin( L"v:group", true ); m_pXmlWriter->WriteNodeBegin( L"v:group", true );
m_pXmlWriter->WriteAttribute( L"id", GetShapeID(shape).c_str()); m_pXmlWriter->WriteAttribute( L"id", m_shapeId .c_str());
m_pXmlWriter->WriteAttribute( L"style", FormatUtils::XmlEncode(buildStyle(shape, anchor, options, container->Index)).c_str() ); m_pXmlWriter->WriteAttribute( L"style", FormatUtils::XmlEncode(buildStyle(shape, anchor, options, container->Index)).c_str() );
m_pXmlWriter->WriteAttribute( L"coordorigin", ( FormatUtils::IntToWideString(gsr->rcgBounds.topLeftAngle.x) + L"," + FormatUtils::IntToWideString( gsr->rcgBounds.topLeftAngle.y)).c_str() ); m_pXmlWriter->WriteAttribute( L"coordorigin", ( FormatUtils::IntToWideString(gsr->rcgBounds.topLeftAngle.x) + L"," + FormatUtils::IntToWideString( gsr->rcgBounds.topLeftAngle.y)).c_str() );
m_pXmlWriter->WriteAttribute( L"coordsize", ( FormatUtils::IntToWideString(gsr->rcgBounds.size.cx) + L"," + FormatUtils::IntToWideString(gsr->rcgBounds.size.cy)).c_str() ); m_pXmlWriter->WriteAttribute( L"coordsize", ( FormatUtils::IntToWideString(gsr->rcgBounds.size.cx) + L"," + FormatUtils::IntToWideString(gsr->rcgBounds.size.cy)).c_str() );
...@@ -182,7 +184,7 @@ namespace DocFileFormat ...@@ -182,7 +184,7 @@ namespace DocFileFormat
ShapeContainer* pChildShape = static_cast<ShapeContainer*>(container->Children[i]); ShapeContainer* pChildShape = static_cast<ShapeContainer*>(container->Children[i]);
if (pChildShape) if (pChildShape)
{ {
VMLShapeMapping vmlShapeMapping(m_ctx, m_pXmlWriter, m_pSpa, NULL, m_pCaller); VMLShapeMapping vmlShapeMapping(m_context, m_pXmlWriter, m_pSpa, NULL, m_pCaller);
pChildShape->Convert(&vmlShapeMapping); pChildShape->Convert(&vmlShapeMapping);
} }
} }
...@@ -215,806 +217,839 @@ namespace DocFileFormat ...@@ -215,806 +217,839 @@ namespace DocFileFormat
/// Converts a single shape /// Converts a single shape
void VMLShapeMapping::WriteShape(const ShapeContainer* pContainer) void VMLShapeMapping::WriteShape(const ShapeContainer* pContainer)
{ {
if ((NULL != pContainer) && (!pContainer->Children.empty())) if ((NULL == pContainer) || (pContainer->Children.empty())) return;
{
Shape* pShape = static_cast<Shape*>(pContainer->Children[0]);
if (pShape)
{
bool freeform = true;
std::list<OptionEntry> options = pContainer->ExtractOptions();
ChildAnchor* pAnchor = pContainer->FirstChildWithType<ChildAnchor>();
ClientAnchor* clientAnchor = pContainer->FirstChildWithType<ClientAnchor>();
WriteBeginShapeNode (pShape); Shape* pShape = static_cast<Shape*>(pContainer->Children[0]);
if (!pShape) return;
m_pXmlWriter->WriteAttribute ( L"id", GetShapeID(pShape).c_str());
int indexOLE = -1;
if (pShape->GetShapeType() && !pShape->fBackground ) bool freeform = true;
{ std::wstring sShapeId;
freeform = false;
m_pXmlWriter->WriteAttribute( L"type", (std::wstring(L"#") + VMLShapeTypeMapping::GenerateTypeId(pShape->GetShapeType())).c_str());
}
m_pXmlWriter->WriteAttribute( L"style", FormatUtils::XmlEncode(buildStyle(pShape, pAnchor, options, pContainer->Index)).c_str());
if (pShape->is<LineType>())
{
//append "from" and "to" attributes
m_pXmlWriter->WriteAttribute(L"from", GetLineFrom(pAnchor).c_str());
m_pXmlWriter->WriteAttribute(L"to", GetLineTo(pAnchor).c_str());
}
if (m_isBullete)
{
m_pXmlWriter->WriteAttribute(L"o:bullet", L"t");
}
std::list<OptionEntry> options = pContainer->ExtractOptions();
EmuValue ShadowOffsetX; ChildAnchor* pAnchor = pContainer->FirstChildWithType<ChildAnchor>();
EmuValue ShadowOffsetY; ClientAnchor* clientAnchor = pContainer->FirstChildWithType<ClientAnchor>();
EmuValue SecondShadowOffsetX;
EmuValue SecondShadowOffsetY;
EmuValue ViewPointX;
EmuValue ViewPointY;
EmuValue ViewPointZ;
double viewPointOriginX = 0;
double viewPointOriginY = 0;
double ShadowOriginX = 0;
double ShadowOriginY = 0;
unsigned int xCoord = 0;
unsigned int yCoord = 0;
bool stroked = true;
bool filled = true;
bool hasTextbox = false;
bool layoutInCell = true; //anmeldebogenfos.doc
int ndxTextLeft = -1;
int ndyTextTop = -1;
int ndxTextRight = -1;
int ndyTextBottom = -1;
bool bHavePath = false; WriteBeginShapeNode (pShape);
int nAdjValues = 0;
int nLTxID = -1;
std::wstring sTextboxStyle; m_shapeId = GetShapeID(pShape);
std::wstring adjValues[8];
ShadowStyleBooleanProperties shadowBoolean(0);
std::vector<std::wstring> arrInscribe;
std::list<OptionEntry>::const_iterator end = options.end(); count_vml_objects++;
for (std::list<OptionEntry>::const_iterator iter = options.begin(); iter != end; ++iter)
{
switch (iter->pid)
{
//BOOLEANS
case geometryBooleans:
{
GeometryBooleanProperties booleans(iter->op);
if (booleans.fUsefLineOK && !booleans.fLineOK)
{
stroked = false;
}
if (booleans.fUsefFillOK && !booleans.fFillOK)
{
filled = false;
}
}
break;
case fillStyleBooleanProperties:
{
FillStyleBooleanProperties booleans(iter->op);
if (booleans.fUsefFilled && !booleans.fFilled)
{
filled = false;
}
}break;
case lineStyleBooleans:
{
LineStyleBooleanProperties booleans(iter->op);
if (booleans.fUsefLine && !booleans.fLine)
{
stroked = false;
}
}
break;
case protectionBooleans: if (m_shapeId.empty())
{ m_shapeId = std::wstring(L"_x0000_s") + FormatUtils::IntToWideString(1024 + count_vml_objects);
ProtectionBooleanProperties booleans(iter->op);
} m_pXmlWriter->WriteAttribute ( L"id", m_shapeId );
break;
case diagramBooleans:
{
DiagramBooleanProperties booleans(iter->op);
}
break;
case groupShapeBooleans:
{
GroupShapeBooleanProperties booleans(iter->op);
if (booleans.fUsefLayoutInCell)
{
layoutInCell = booleans.fLayoutInCell;
}
}
break;
// GEOMETRY if ( !pShape->fBackground )
{
if (pShape->GetShapeType())
{
freeform = false;
m_pXmlWriter->WriteAttribute( L"type", (std::wstring(L"#") + VMLShapeTypeMapping::GenerateTypeId(pShape->GetShapeType())).c_str());
case adjustValue: m_pXmlWriter->WriteAttribute( L"style", FormatUtils::XmlEncode(buildStyle(pShape, pAnchor, options, pContainer->Index)).c_str());
{ }
adjValues[0] = FormatUtils::IntToWideString( (int)iter->op );
nAdjValues = (std::max)(nAdjValues,1);
}
break;
case adjust2Value: if (pShape->is<LineType>())
{ {
adjValues[1] = FormatUtils::IntToWideString( (int)iter->op ); //append "from" and "to" attributes
nAdjValues = (std::max)(nAdjValues,2); m_pXmlWriter->WriteAttribute(L"from", GetLineFrom(pAnchor).c_str());
} m_pXmlWriter->WriteAttribute(L"to", GetLineTo(pAnchor).c_str());
break; }
case adjust3Value: if (m_isBullete)
{ {
adjValues[2] = FormatUtils::IntToWideString( (int)iter->op ); m_pXmlWriter->WriteAttribute(L"o:bullet", L"t");
nAdjValues = (std::max)(nAdjValues,3); }
}break; }
case adjust4Value:
{
adjValues[3] = FormatUtils::IntToWideString( (int)iter->op );
nAdjValues = (std::max)(nAdjValues,4);
}break;
case adjust5Value:
{
adjValues[4] = FormatUtils::IntToWideString( (int)iter->op );
nAdjValues = (std::max)(nAdjValues,5);
}break;
case adjust6Value:
{
adjValues[5] = FormatUtils::IntToWideString( (int)iter->op );
nAdjValues = (std::max)(nAdjValues,6);
}break;
case adjust7Value:
{
adjValues[6] = FormatUtils::IntToWideString( (int)iter->op );
nAdjValues = (std::max)(nAdjValues,7);
}break;
case adjust8Value:
{
adjValues[7] = FormatUtils::IntToWideString( (int)iter->op );
nAdjValues = (std::max)(nAdjValues,8);
}break;
case pWrapPolygonVertices:
{
std::wstring wrapCoords = getWrapCoords(*iter);
if (!wrapCoords.empty())
{
m_pXmlWriter->WriteAttribute( L"wrapcoords", wrapCoords.c_str() );
}
}break;
case geoRight:
{
xCoord = iter->op;
}break;
case geoBottom:
{
yCoord = iter->op;
}break;
case pGuides:
{
}break;
case pInscribe:
{
arrInscribe = GetTextRectangles(*iter);
}break;
// OUTLINE
case lineColor:
{
RGBColor lineColor((int)iter->op, RedFirst);
m_pXmlWriter->WriteAttribute( L"strokecolor", (std::wstring(L"#") + lineColor.SixDigitHexCode).c_str());
}break;
case lineWidth:
{
if (iter->op > 0)
{
EmuValue eLineWidth ((int)iter->op );
m_pXmlWriter->WriteAttribute(L"strokeweight", FormatUtils::DoubleToWideString(eLineWidth.ToPoints()) + L"pt");
}
}break;
case lineDashing:
{
appendValueAttribute(&m_stroke, L"dashstyle", FormatUtils::MapValueToWideString( iter->op, &Global::DashStyleMap[0][0], 11, 16 ).c_str() );
}break;
case lineStyle:
{
appendValueAttribute(&m_stroke, L"linestyle", getLineStyle( iter->op ).c_str());
}break;
case lineEndArrowhead:
{
appendValueAttribute(&m_stroke, L"endarrow", getArrowStyle( iter->op ).c_str());
}break;
case lineEndArrowLength:
{
appendValueAttribute(&m_stroke, L"endarrowlength", getArrowLength( iter->op ).c_str());
}break;
case lineEndArrowWidth:
{
appendValueAttribute(&m_stroke, L"endarrowwidth", getArrowWidth( iter->op ).c_str());
}break;
case lineStartArrowhead:
{
appendValueAttribute(&m_stroke, L"startarrow", getArrowStyle( iter->op ).c_str());
}break;
case lineStartArrowLength:
{
appendValueAttribute(&m_stroke, L"startarrowlength", getArrowLength( iter->op ).c_str());
}break;
case lineStartArrowWidth:
{
appendValueAttribute(&m_stroke, L"startarrowwidth", getArrowWidth( iter->op ).c_str());
}break;
// FILL
case fillColor:
{
RGBColor fillColor((int)iter->op, RedFirst);
m_pXmlWriter->WriteAttribute(L"fillcolor", ( std::wstring( L"#" ) + fillColor.SixDigitHexCode ).c_str());
}break;
case fillBackColor:
{
RGBColor fillBackColor( (int)iter->op, RedFirst );
appendValueAttribute(&m_fill, L"color2", ( std::wstring( L"#" ) + fillBackColor.SixDigitHexCode ).c_str());
}break;
case fillAngle:
{
FixedPointNumber fllAngl( iter->op );
appendValueAttribute(&m_fill, L"angle", FormatUtils::DoubleToWideString( fllAngl.ToAngle() ).c_str());
}break;
case fillShadeType:
{
appendValueAttribute(&m_fill, L"method", getFillMethod( iter->op ).c_str());
}break;
case fillShadeColors:
{
appendValueAttribute(&m_fill, L"colors", getFillColorString( iter->opComplex, iter->op ).c_str());
}break;
case fillFocus:
{
appendValueAttribute(&m_fill, L"focus", ( FormatUtils::IntToWideString( iter->op ) + L"%" ).c_str());
}break;
case fillType:
{
appendValueAttribute(&m_fill, L"type", getFillType( iter->op ).c_str());
}break;
case fillBlip:
{
BlipStoreEntry* pFillBlip = NULL;
if ((m_pict != NULL ) && (m_pict->blipStoreEntry != NULL ))
{
// Word Art Texture
//fillBlip = this->_pict->BlipStoreEntry;
}
else if ( (m_pBlipStore != NULL) && ( (iter->op - 1) < m_pBlipStore->Children.size() ) )
{
pFillBlip = static_cast<BlipStoreEntry*>(m_pBlipStore->Children[iter->op - 1]);
}
if ( (pFillBlip != NULL) && copyPicture(pFillBlip) )
{
appendValueAttribute(&m_fill, L"r:id", std::wstring(( L"rId" ) + FormatUtils::IntToWideString(m_nImageId) ).c_str());
}
}break;
case fillOpacity:
{
appendValueAttribute(&m_fill, L"opacity", ( FormatUtils::IntToWideString( iter->op ) + L"f" ).c_str());
}
break;
case fillBackOpacity:
{
appendValueAttribute(&m_fill, L"opacity2", (FormatUtils::IntToWideString(iter->op) + L"f").c_str());
}break;
// SHADOW
case shadowType:
{
appendValueAttribute(&m_shadow, L"type", getShadowType(iter->op).c_str());
}break;
case shadowColor: EmuValue ShadowOffsetX;
{ EmuValue ShadowOffsetY;
RGBColor shadowColor((int)iter->op, RedFirst); EmuValue SecondShadowOffsetX;
appendValueAttribute(&m_shadow, L"color", ( std::wstring( L"#" ) + shadowColor.SixDigitHexCode ).c_str()); EmuValue SecondShadowOffsetY;
}break; EmuValue ViewPointX;
case shadowOffsetX: EmuValue ViewPointY;
{ EmuValue ViewPointZ;
ShadowOffsetX = EmuValue( (int)iter->op );
}break; double viewPointOriginX = 0;
case shadowSecondOffsetX: double viewPointOriginY = 0;
{ double ShadowOriginX = 0;
SecondShadowOffsetX = EmuValue( (int)iter->op ); double ShadowOriginY = 0;
}break; unsigned int xCoord = 0;
case shadowOffsetY: unsigned int yCoord = 0;
{ bool stroked = true;
ShadowOffsetY = EmuValue( (int)iter->op ); bool filled = true;
}break; bool hasTextbox = false;
case shadowSecondOffsetY: bool layoutInCell = true; //anmeldebogenfos.doc
{
SecondShadowOffsetY = EmuValue( (int)iter->op ); int ndxTextLeft = -1;
}break; int ndyTextTop = -1;
case shadowOriginX: int ndxTextRight = -1;
{ int ndyTextBottom = -1;
ShadowOriginX = ( iter->op / pow( (double)2, (double)16 ) );
}break;
case shadowOriginY:
{
ShadowOriginY = (iter->op / pow( (double)2, (double)16));
}break;
case shadowOpacity:
{
double shadowOpa = (iter->op / pow( (double)2, (double)16));
appendValueAttribute(&m_shadow, L"opacity", FormatUtils::DoubleToFormattedWideString( shadowOpa, L"%.2f" ).c_str()); bool bHavePath = false;
}break; int nAdjValues = 0;
case shadowStyleBooleanProperties: int nLTxID = -1;
{
shadowBoolean = ShadowStyleBooleanProperties(iter->op);
}break;
// PICTURE
case Pib:
{
int index = (int)( iter->op - 1 );
if ((m_pBlipStore != NULL) && (index < (int)m_pBlipStore->Children.size()))
{
BlipStoreEntry* oBlip = static_cast<BlipStoreEntry*>(m_pBlipStore->Children[index]);
if (copyPicture(oBlip))
{
appendValueAttribute(&m_imagedata, L"r:id", ( std::wstring( L"rId" ) + FormatUtils::IntToWideString(m_nImageId) ).c_str());
}
}
}break;
case pibName:
{
std::wstring name;
FormatUtils::GetSTLCollectionFromBytes<std::wstring>(&name, iter->opComplex, iter->op, ENCODING_UTF16);
if (!name.empty())
appendValueAttribute(&m_imagedata, L"o:title", FormatUtils::XmlEncode(name).c_str());
}break;
// 3D STYLE
case f3D:
case threeDStyleBooleanProperties:
case threeDObjectBooleanProperties:
break;
case c3DExtrudeBackward: std::wstring sTextboxStyle;
{
EmuValue backwardValue( (int)iter->op ); std::wstring adjValues[8];
std::wstring depth = FormatUtils::DoubleToWideString( backwardValue.ToPoints() ) + L"pt"; ShadowStyleBooleanProperties shadowBoolean(0);
appendValueAttribute(&m_3dstyle, L"backdepth", depth.c_str()); std::vector<std::wstring> arrInscribe;
}break;
case c3DAmbientIntensity:
{
std::wstring intens = FormatUtils::IntToWideString((int)iter->op) + L"f";
appendValueAttribute(&m_3dstyle, L"brightness", intens.c_str());
}break;
case c3DSpecularAmt:
{
std::wstring amt = FormatUtils::IntToWideString((int)iter->op) + L"f";
appendValueAttribute(&m_3dstyle, L"specularity", amt.c_str());
}break;
case c3DDiffuseAmt:
{
std::wstring amt = FormatUtils::IntToWideString((int)iter->op) + L"f";
appendValueAttribute(&m_3dstyle, L"diffusity", amt.c_str());
}break;
case c3DKeyIntensity:
{
std::wstring amt = FormatUtils::IntToWideString((int)iter->op);
appendValueAttribute(&m_3dstyle, L"lightlevel", amt.c_str());
}break;
case c3DExtrusionColor:
{
std::wstring color = FormatUtils::IntToFormattedWideString(iter->op, L"#%06x");
appendValueAttribute(&m_3dstyle, L"color", color.c_str());
}break;
case c3DSkewAngle:
{
FixedPointNumber skewAngle( iter->op );
appendValueAttribute(&m_3dstyle, L"skewangle", FormatUtils::DoubleToWideString( skewAngle.ToAngle() ).c_str());
}break;
case c3DXViewpoint:
{
ViewPointX = EmuValue( FixedPointNumber( iter->op ).Integral );
}break;
case c3DYViewpoint:
{
ViewPointY = EmuValue( FixedPointNumber( iter->op ).Integral );
}break;
case c3DZViewpoint:
{
ViewPointZ = EmuValue( FixedPointNumber( iter->op ).Integral );
}break;
case c3DOriginX:
{
FixedPointNumber dOriginX( iter->op );
viewPointOriginX = ( dOriginX.Integral / 65536.0 );
}break;
case c3DOriginY:
{
FixedPointNumber dOriginY( iter->op );
viewPointOriginY = (dOriginY.Integral / 65536.0 );
}break;
// TEXTBOX
case lTxid:
{
hasTextbox = true;
nLTxID = (((iter->op) >> 16) & 0xFFFF);
}break;
case dxTextLeft: {ndxTextLeft = (int)iter->op;break;}
case dyTextTop: {ndyTextTop = (int)iter->op;break;}
case dxTextRight: {ndxTextRight = (int)iter->op;break;}
case dyTextBottom: {ndyTextBottom = (int)iter->op;break;}
case txflTextFlow:
{
switch(iter->op)
{
case 0:
case 4://обычный
break;
case 1:
case 5://верт (склони голову направо)
appendStyleProperty(&sTextboxStyle, L"layout-flow", L"vertical");
break;
case 2://верт (склони голову налево)
appendStyleProperty(&sTextboxStyle, L"layout-flow", L"vertical");
appendStyleProperty(&sTextboxStyle, L"mso-layout-flow-alt", L"bottom-to-top");
break;
}
}break;
// Word Art
case gtextUNICODE:
{
std::wstring text = NSStringExt::CConverter::GetUnicodeFromUTF16((unsigned short*)iter->opComplex, (iter->op)/2);
text = FormatUtils::XmlEncode(text);
if (0 <= text.find(L"\n"))
{
m_textpath.AppendText(text.c_str());
}
text = ReplaceString(text, L"\n", L"&#xA;");
appendValueAttribute(&m_textpath, L"string", text.c_str());
}break;
case gtextFont:
{
std::wstring font = NSStringExt::CConverter::GetUnicodeFromUTF16((unsigned short*)iter->opComplex, (iter->op)/2);
int i = font.size();
while (i > 0)
{
if (font[i-1] != 0) break;
i--;
}
if (i < font.size()) font.erase(font.begin() + i, font.end());
font = std::wstring(L"\"") + font + std::wstring(L"\"");
appendStyleProperty(&m_textPathStyle, L"font-family", font);
}break;
case gtextSize:
{
std::wstring fontSize = FormatUtils::IntToWideString(iter->op/65535);
appendStyleProperty(&m_textPathStyle, L"font-size", fontSize + L"pt");
}break;
case gtextSpacing:
{
std::wstring spacing = FormatUtils::IntToWideString(iter->op);
appendStyleProperty(&m_textPathStyle, L"v-text-spacing", spacing + L"f");
}break;
case geometryTextBooleanProperties:
{
GeometryTextBooleanProperties props(iter->op);
if (props.fUsegtextFBestFit && props.gtextFBestFit)
{
appendValueAttribute(&m_textpath, L"fitshape", L"t");
}
if (props.fUsegtextFShrinkFit && props.gtextFShrinkFit)
{
appendValueAttribute(&m_textpath, L"trim", L"t");
}
if (props.fUsegtextFVertical && props.gtextFVertical)
{
appendStyleProperty(&m_textPathStyle, L"v-rotate-letters", L"t");
//_twistDimension = true;
}
if (props.fUsegtextFKern && props.gtextFKern)
{
appendStyleProperty(&m_textPathStyle, L"v-text-kern", L"t");
}
if (props.fUsegtextFItalic && props.gtextFItalic)
{
appendStyleProperty(&m_textPathStyle, L"font-style", L"italic");
}
if (props.fUsegtextFBold && props.gtextFBold)
{
appendStyleProperty(&m_textPathStyle, L"font-weight", L"bold");
}
}break;
// PATH
case shapePath :
{
bHavePath = true;
std::wstring path = ParsePath(options); std::list<OptionEntry>::const_iterator end = options.end();
for (std::list<OptionEntry>::const_iterator iter = options.begin(); iter != end; ++iter)
{
switch (iter->pid)
{
//BOOLEANS
case geometryBooleans:
{
GeometryBooleanProperties booleans(iter->op);
if (booleans.fUsefLineOK && !booleans.fLineOK)
{
stroked = false;
}
if (false == path.empty()) if (booleans.fUsefFillOK && !booleans.fFillOK)
m_pXmlWriter->WriteAttribute (L"path", path.c_str()); {
}break; filled = false;
default:
{
int val = iter->op;
}break;
} }
} }
break;
if (false == bHavePath) // фигура может быть задана только наборами вершин и индексов case fillStyleBooleanProperties:
{ {
std::wstring path = ParsePath(options); FillStyleBooleanProperties booleans(iter->op);
if (booleans.fUsefFilled && !booleans.fFilled)
if (false == path.empty()) {
m_pXmlWriter->WriteAttribute (L"path", path.c_str()); filled = false;
}
}break;
case lineStyleBooleans:
{
LineStyleBooleanProperties booleans(iter->op);
if (booleans.fUsefLine && !booleans.fLine)
{
stroked = false;
}
} }
break;
if ( !filled ) case protectionBooleans:
{ {
m_pXmlWriter->WriteAttribute( L"filled", L"f" ); ProtectionBooleanProperties booleans(iter->op);
} }
break;
if ( !stroked ) case diagramBooleans:
{ {
m_pXmlWriter->WriteAttribute( L"stroked", L"f" ); DiagramBooleanProperties booleans(iter->op);
} }
break;
if (!layoutInCell) case groupShapeBooleans:
{ {
m_pXmlWriter->WriteAttribute(L"o:allowincell", L"f"); GroupShapeBooleanProperties booleans(iter->op);
if (booleans.fUsefLayoutInCell)
{
layoutInCell = booleans.fLayoutInCell;
}
} }
break;
if ( ( xCoord > 0 ) && ( yCoord > 0 ) ) // GEOMETRY
case adjustValue:
{ {
m_pXmlWriter->WriteAttribute( L"coordsize", ( FormatUtils::IntToWideString( xCoord ) + L"," + FormatUtils::IntToWideString( yCoord ) ).c_str() ); adjValues[0] = FormatUtils::IntToWideString( (int)iter->op );
nAdjValues = (std::max)(nAdjValues,1);
} }
break;
int nCode = 0; case adjust2Value:
if (pShape->GetShapeType())
{ {
nCode = pShape->GetShapeType()->GetTypeCode(); adjValues[1] = FormatUtils::IntToWideString( (int)iter->op );
nAdjValues = (std::max)(nAdjValues,2);
} }
break;
if (DocFileFormat::msosptRoundRectangle == nCode) case adjust3Value:
{
adjValues[2] = FormatUtils::IntToWideString( (int)iter->op );
nAdjValues = (std::max)(nAdjValues,3);
}break;
case adjust4Value:
{ {
if (nAdjValues) adjValues[3] = FormatUtils::IntToWideString( (int)iter->op );
nAdjValues = (std::max)(nAdjValues,4);
}break;
case adjust5Value:
{
adjValues[4] = FormatUtils::IntToWideString( (int)iter->op );
nAdjValues = (std::max)(nAdjValues,5);
}break;
case adjust6Value:
{
adjValues[5] = FormatUtils::IntToWideString( (int)iter->op );
nAdjValues = (std::max)(nAdjValues,6);
}break;
case adjust7Value:
{
adjValues[6] = FormatUtils::IntToWideString( (int)iter->op );
nAdjValues = (std::max)(nAdjValues,7);
}break;
case adjust8Value:
{
adjValues[7] = FormatUtils::IntToWideString( (int)iter->op );
nAdjValues = (std::max)(nAdjValues,8);
}break;
case pWrapPolygonVertices:
{
std::wstring wrapCoords = getWrapCoords(*iter);
if (!wrapCoords.empty())
{ {
m_pXmlWriter->WriteAttribute(L"arcsize", adjValues[0].c_str()); m_pXmlWriter->WriteAttribute( L"wrapcoords", wrapCoords.c_str() );
} }
} }break;
else case geoRight:
{ {
if (nAdjValues) xCoord = iter->op;
}break;
case geoBottom:
{
yCoord = iter->op;
}break;
case pGuides:
{
}break;
case pInscribe:
{
arrInscribe = GetTextRectangles(*iter);
}break;
// OUTLINE
case lineColor:
{
RGBColor lineColor((int)iter->op, RedFirst);
if ( !pShape->fBackground )
m_pXmlWriter->WriteAttribute( L"strokecolor", (std::wstring(L"#") + lineColor.SixDigitHexCode).c_str());
}break;
case lineWidth:
{
if (iter->op > 0)
{ {
std::wstring adjTag = adjValues[0]; EmuValue eLineWidth ((int)iter->op );
m_pXmlWriter->WriteAttribute(L"strokeweight", FormatUtils::DoubleToWideString(eLineWidth.ToPoints()) + L"pt");
for (int i = 1; i < nAdjValues; ++i)
adjTag += std::wstring(L",") + adjValues[i];
m_pXmlWriter->WriteAttribute(L"adj", adjTag.c_str());
} }
} }break;
case lineDashing:
m_pXmlWriter->WriteNodeEnd( L"", true, false ); {
appendValueAttribute(&m_stroke, L"dashstyle", FormatUtils::MapValueToWideString( iter->op, &Global::DashStyleMap[0][0], 11, 16 ).c_str() );
}break;
case lineStyle:
{
appendValueAttribute(&m_stroke, L"linestyle", getLineStyle( iter->op ).c_str());
}break;
case lineEndArrowhead:
{
appendValueAttribute(&m_stroke, L"endarrow", getArrowStyle( iter->op ).c_str());
}break;
case lineEndArrowLength:
{
appendValueAttribute(&m_stroke, L"endarrowlength", getArrowLength( iter->op ).c_str());
}break;
case lineEndArrowWidth:
{
appendValueAttribute(&m_stroke, L"endarrowwidth", getArrowWidth( iter->op ).c_str());
}break;
case lineStartArrowhead:
{
appendValueAttribute(&m_stroke, L"startarrow", getArrowStyle( iter->op ).c_str());
}break;
case lineStartArrowLength:
{
appendValueAttribute(&m_stroke, L"startarrowlength", getArrowLength( iter->op ).c_str());
}break;
case lineStartArrowWidth:
{
appendValueAttribute(&m_stroke, L"startarrowwidth", getArrowWidth( iter->op ).c_str());
}break;
// FILL
case fillColor:
{
RGBColor fillColor((int)iter->op, RedFirst);
m_pXmlWriter->WriteAttribute(L"fillcolor", ( std::wstring( L"#" ) + fillColor.SixDigitHexCode ).c_str());
}break;
case fillBackColor:
{
RGBColor fillBackColor( (int)iter->op, RedFirst );
appendValueAttribute(&m_fill, L"color2", ( std::wstring( L"#" ) + fillBackColor.SixDigitHexCode ).c_str());
}break;
case fillAngle:
{
FixedPointNumber fllAngl( iter->op );
appendValueAttribute(&m_fill, L"angle", FormatUtils::DoubleToWideString( fllAngl.ToAngle() ).c_str());
}break;
case fillShadeType:
{
appendValueAttribute(&m_fill, L"method", getFillMethod( iter->op ).c_str());
}break;
case fillShadeColors:
{
appendValueAttribute(&m_fill, L"colors", getFillColorString( iter->opComplex, iter->op ).c_str());
}break;
case fillFocus:
{
appendValueAttribute(&m_fill, L"focus", ( FormatUtils::IntToWideString( iter->op ) + L"%" ).c_str());
}break;
case fillType:
{
appendValueAttribute(&m_fill, L"type", getFillType( iter->op ).c_str());
}break;
case fillBlip:
{
BlipStoreEntry* pFillBlip = NULL;
//build shadow offsets if ((m_pict != NULL ) && (m_pict->blipStoreEntry != NULL ))
std::wstring offset; {
// Word Art Texture
//fillBlip = this->_pict->BlipStoreEntry;
}
else if ( (m_pBlipStore != NULL) && ( (iter->op - 1) < m_pBlipStore->Children.size() ) )
{
pFillBlip = static_cast<BlipStoreEntry*>(m_pBlipStore->Children[iter->op - 1]);
}
if ( ShadowOffsetX != 0 ) if ( (pFillBlip != NULL) && copyPicture(pFillBlip) )
{
appendValueAttribute(&m_fill, L"r:id", std::wstring(( L"rId" ) + FormatUtils::IntToWideString(m_nImageId) ).c_str());
}
}break;
case fillOpacity:
{ {
offset += FormatUtils::DoubleToWideString( ShadowOffsetX.ToPoints() ); appendValueAttribute(&m_fill, L"opacity", ( FormatUtils::IntToWideString( iter->op ) + L"f" ).c_str());
offset += L"pt";
} }
if ( ShadowOffsetY != 0 ) break;
case fillBackOpacity:
{ {
offset += L","; appendValueAttribute(&m_fill, L"opacity2", (FormatUtils::IntToWideString(iter->op) + L"f").c_str());
offset += FormatUtils::DoubleToWideString( ShadowOffsetY.ToPoints() ); }break;
offset += L"pt"; // SHADOW
} case shadowType:
if ( !offset.empty() )
{ {
appendValueAttribute(&m_shadow, L"offset", offset.c_str()); appendValueAttribute(&m_shadow, L"type", getShadowType(iter->op).c_str());
} }break;
std::wstring offset2; case shadowColor:
{
RGBColor shadowColor((int)iter->op, RedFirst);
appendValueAttribute(&m_shadow, L"color", ( std::wstring( L"#" ) + shadowColor.SixDigitHexCode ).c_str());
}break;
case shadowOffsetX:
{
ShadowOffsetX = EmuValue( (int)iter->op );
}break;
case shadowSecondOffsetX:
{
SecondShadowOffsetX = EmuValue( (int)iter->op );
}break;
case shadowOffsetY:
{
ShadowOffsetY = EmuValue( (int)iter->op );
}break;
case shadowSecondOffsetY:
{
SecondShadowOffsetY = EmuValue( (int)iter->op );
}break;
case shadowOriginX:
{
ShadowOriginX = ( iter->op / pow( (double)2, (double)16 ) );
}break;
case shadowOriginY:
{
ShadowOriginY = (iter->op / pow( (double)2, (double)16));
}break;
case shadowOpacity:
{
double shadowOpa = (iter->op / pow( (double)2, (double)16));
if ( SecondShadowOffsetX != 0 ) appendValueAttribute(&m_shadow, L"opacity", FormatUtils::DoubleToFormattedWideString( shadowOpa, L"%.2f" ).c_str());
}break;
case shadowStyleBooleanProperties:
{ {
offset2 += FormatUtils::DoubleToWideString( SecondShadowOffsetX.ToPoints() ); shadowBoolean = ShadowStyleBooleanProperties(iter->op);
offset2 += L"pt"; }break;
} // OLE
case pictureId:
{
indexOLE = iter->op;
}break;
// PICTURE
case Pib:
{
int index = (int)( iter->op - 1 );
if ( SecondShadowOffsetY != 0 ) if ((m_pBlipStore != NULL) && (index < (int)m_pBlipStore->Children.size()))
{
BlipStoreEntry* oBlip = static_cast<BlipStoreEntry*>(m_pBlipStore->Children[index]);
if (copyPicture(oBlip))
{
appendValueAttribute(&m_imagedata, L"r:id", ( std::wstring( L"rId" ) + FormatUtils::IntToWideString(m_nImageId) ).c_str());
}
}
}break;
case pibName:
{ {
offset2 += L","; std::wstring name;
offset2 += FormatUtils::DoubleToWideString(SecondShadowOffsetY.ToPoints()); FormatUtils::GetSTLCollectionFromBytes<std::wstring>(&name, iter->opComplex, iter->op, ENCODING_UTF16);
offset2 += L"pt"; if (!name.empty())
} appendValueAttribute(&m_imagedata, L"o:title", FormatUtils::XmlEncode(name).c_str());
}break;
// 3D STYLE
case f3D:
case threeDStyleBooleanProperties:
case threeDObjectBooleanProperties:
break;
if (!offset2.empty()) case c3DExtrudeBackward:
{ {
appendValueAttribute(&m_shadow, L"offset2", offset2.c_str()); EmuValue backwardValue( (int)iter->op );
} std::wstring depth = FormatUtils::DoubleToWideString( backwardValue.ToPoints() ) + L"pt";
appendValueAttribute(&m_3dstyle, L"backdepth", depth.c_str());
}break;
case c3DAmbientIntensity:
{
std::wstring intens = FormatUtils::IntToWideString((int)iter->op) + L"f";
appendValueAttribute(&m_3dstyle, L"brightness", intens.c_str());
}break;
case c3DSpecularAmt:
{
std::wstring amt = FormatUtils::IntToWideString((int)iter->op) + L"f";
appendValueAttribute(&m_3dstyle, L"specularity", amt.c_str());
}break;
case c3DDiffuseAmt:
{
std::wstring amt = FormatUtils::IntToWideString((int)iter->op) + L"f";
appendValueAttribute(&m_3dstyle, L"diffusity", amt.c_str());
}break;
case c3DKeyIntensity:
{
std::wstring amt = FormatUtils::IntToWideString((int)iter->op);
appendValueAttribute(&m_3dstyle, L"lightlevel", amt.c_str());
}break;
case c3DExtrusionColor:
{
std::wstring color = FormatUtils::IntToFormattedWideString(iter->op, L"#%06x");
appendValueAttribute(&m_3dstyle, L"color", color.c_str());
}break;
case c3DSkewAngle:
{
FixedPointNumber skewAngle( iter->op );
appendValueAttribute(&m_3dstyle, L"skewangle", FormatUtils::DoubleToWideString( skewAngle.ToAngle() ).c_str());
}break;
case c3DXViewpoint:
{
ViewPointX = EmuValue( FixedPointNumber( iter->op ).Integral );
}break;
case c3DYViewpoint:
{
ViewPointY = EmuValue( FixedPointNumber( iter->op ).Integral );
}break;
case c3DZViewpoint:
{
ViewPointZ = EmuValue( FixedPointNumber( iter->op ).Integral );
}break;
case c3DOriginX:
{
FixedPointNumber dOriginX( iter->op );
viewPointOriginX = ( dOriginX.Integral / 65536.0 );
}break;
case c3DOriginY:
{
FixedPointNumber dOriginY( iter->op );
viewPointOriginY = (dOriginY.Integral / 65536.0 );
}break;
// TEXTBOX
case lTxid:
{
hasTextbox = true;
nLTxID = (((iter->op) >> 16) & 0xFFFF);
}break;
case dxTextLeft: {ndxTextLeft = (int)iter->op;break;}
case dyTextTop: {ndyTextTop = (int)iter->op;break;}
case dxTextRight: {ndxTextRight = (int)iter->op;break;}
case dyTextBottom: {ndyTextBottom = (int)iter->op;break;}
case txflTextFlow:
{
switch(iter->op)
{
case 0:
case 4://обычный
break;
case 1:
case 5://верт (склони голову направо)
appendStyleProperty(&sTextboxStyle, L"layout-flow", L"vertical");
break;
case 2://верт (склони голову налево)
appendStyleProperty(&sTextboxStyle, L"layout-flow", L"vertical");
appendStyleProperty(&sTextboxStyle, L"mso-layout-flow-alt", L"bottom-to-top");
break;
}
}break;
// Word Art
case gtextUNICODE:
{
std::wstring text = NSStringExt::CConverter::GetUnicodeFromUTF16((unsigned short*)iter->opComplex, (iter->op)/2);
text = FormatUtils::XmlEncode(text);
//build shadow origin if (0 <= text.find(L"\n"))
if ( ( ShadowOriginX != 0 ) && ( ShadowOriginY != 0 ) ) {
m_textpath.AppendText(text.c_str());
}
text = ReplaceString(text, L"\n", L"&#xA;");
appendValueAttribute(&m_textpath, L"string", text.c_str());
}break;
case gtextFont:
{ {
appendValueAttribute(&m_shadow, L"origin", (FormatUtils::DoubleToWideString(shadowOriginX) + std::wstring(L"," ) + FormatUtils::DoubleToWideString(shadowOriginY)).c_str()); std::wstring font = NSStringExt::CConverter::GetUnicodeFromUTF16((unsigned short*)iter->opComplex, (iter->op)/2);
} int i = font.size();
while (i > 0)
{
if (font[i-1] != 0) break;
i--;
}
if (i < font.size()) font.erase(font.begin() + i, font.end());
// write shadow font = std::wstring(L"\"") + font + std::wstring(L"\"");
if (m_shadow.GetAttributeCount() > 0) appendStyleProperty(&m_textPathStyle, L"font-family", font);
}break;
case gtextSize:
{
std::wstring fontSize = FormatUtils::IntToWideString(iter->op/65535);
appendStyleProperty(&m_textPathStyle, L"font-size", fontSize + L"pt");
}break;
case gtextSpacing:
{ {
if (shadowBoolean.fShadow) std::wstring spacing = FormatUtils::IntToWideString(iter->op);
appendStyleProperty(&m_textPathStyle, L"v-text-spacing", spacing + L"f");
}break;
case geometryTextBooleanProperties:
{
GeometryTextBooleanProperties props(iter->op);
if (props.fUsegtextFBestFit && props.gtextFBestFit)
{
appendValueAttribute(&m_textpath, L"fitshape", L"t");
}
if (props.fUsegtextFShrinkFit && props.gtextFShrinkFit)
{
appendValueAttribute(&m_textpath, L"trim", L"t");
}
if (props.fUsegtextFVertical && props.gtextFVertical)
{
appendStyleProperty(&m_textPathStyle, L"v-rotate-letters", L"t");
//_twistDimension = true;
}
if (props.fUsegtextFKern && props.gtextFKern)
{
appendStyleProperty(&m_textPathStyle, L"v-text-kern", L"t");
}
if (props.fUsegtextFItalic && props.gtextFItalic)
{ {
appendValueAttribute(&m_shadow, L"on", L"t" ); appendStyleProperty(&m_textPathStyle, L"font-style", L"italic");
} }
if (props.fUsegtextFBold && props.gtextFBold)
{
appendStyleProperty(&m_textPathStyle, L"font-weight", L"bold");
}
}break;
// PATH
case shapePath :
{
bHavePath = true;
m_pXmlWriter->WriteString(m_shadow.GetXMLString().c_str()); std::wstring path = ParsePath(options);
}
//write 3d style if (false == path.empty())
if (m_3dstyle.GetAttributeCount() > 0) m_pXmlWriter->WriteAttribute (L"path", path.c_str());
}break;
default:
{ {
appendValueAttribute(&m_3dstyle, L"v:ext", L"view" ); int val = iter->op;
appendValueAttribute(&m_3dstyle, L"on", L"t" ); }break;
}
}
//write the viewpoint if (false == bHavePath) // фигура может быть задана только наборами вершин и индексов
if ( ( ViewPointX != 0 ) || ( ViewPointY != 0 ) || ( ViewPointZ != 0 ) ) {
{ std::wstring path = ParsePath(options);
std::wstring viewPoint;
if ( ViewPointX != 0 ) if (false == path.empty())
{ m_pXmlWriter->WriteAttribute (L"path", path.c_str());
viewPoint += FormatUtils::IntToWideString( ViewPointX ) + L"pt"; }
}
viewPoint += L",";
if ( ViewPointY != 0 )
{
viewPoint += FormatUtils::IntToWideString( ViewPointY ) + L"pt";
}
viewPoint += L",";
if ( ViewPointZ != 0 )
{
viewPoint += FormatUtils::IntToWideString( ViewPointZ ) + L"pt";
}
appendValueAttribute(&m_3dstyle, L"viewpoint", viewPoint.c_str()); if ( !filled )
} {
// write the viewpointorigin m_pXmlWriter->WriteAttribute( L"filled", L"f" );
if ( ( viewPointOriginX != 0 ) || ( viewPointOriginY != 0 ) ) }
{
std::wstring viewPointOrigin;
if ( viewPointOriginX != 0 ) if ( !stroked )
{ {
viewPointOrigin += FormatUtils::DoubleToFormattedWideString( viewPointOriginX, L"%.2f" ); m_pXmlWriter->WriteAttribute( L"stroked", L"f" );
} }
if ( viewPointOriginY != 0 ) if (!layoutInCell)
{ {
viewPointOrigin += L","; m_pXmlWriter->WriteAttribute(L"o:allowincell", L"f");
viewPointOrigin += FormatUtils::DoubleToFormattedWideString( viewPointOriginY, L"%.2f" ); }
}
appendValueAttribute(&m_3dstyle, L"viewpointorigin", viewPointOrigin.c_str()); if ( ( xCoord > 0 ) && ( yCoord > 0 ) )
} {
m_pXmlWriter->WriteAttribute( L"coordsize", ( FormatUtils::IntToWideString( xCoord ) + L"," + FormatUtils::IntToWideString( yCoord ) ).c_str() );
}
m_pXmlWriter->WriteString(m_3dstyle.GetXMLString().c_str()); int nCode = 0;
} if (pShape->GetShapeType())
// write wrap {
if (m_pSpa) nCode = pShape->GetShapeType()->GetTypeCode();
{ }
std::wstring wrap = getWrapType(m_pSpa);
if (wrap != L"through") if (DocFileFormat::msosptRoundRectangle == nCode)
{ {
m_pXmlWriter->WriteNodeBegin( L"w10:wrap", true ); if (nAdjValues)
m_pXmlWriter->WriteAttribute( L"type", wrap.c_str() ); {
m_pXmlWriter->WriteNodeEnd ( L"w10:wrap", true ); m_pXmlWriter->WriteAttribute(L"arcsize", adjValues[0].c_str());
} }
} }
// write stroke else
if (m_stroke.GetAttributeCount()) {
if (nAdjValues)
{
std::wstring adjTag = adjValues[0];
for (int i = 1; i < nAdjValues; ++i)
adjTag += std::wstring(L",") + adjValues[i];
m_pXmlWriter->WriteAttribute(L"adj", adjTag.c_str());
}
}
m_pXmlWriter->WriteNodeEnd( L"", true, false );
//build shadow offsets
std::wstring offset;
if ( ShadowOffsetX != 0 )
{
offset += FormatUtils::DoubleToWideString( ShadowOffsetX.ToPoints() );
offset += L"pt";
}
if ( ShadowOffsetY != 0 )
{
offset += L",";
offset += FormatUtils::DoubleToWideString( ShadowOffsetY.ToPoints() );
offset += L"pt";
}
if ( !offset.empty() )
{
appendValueAttribute(&m_shadow, L"offset", offset.c_str());
}
std::wstring offset2;
if ( SecondShadowOffsetX != 0 )
{
offset2 += FormatUtils::DoubleToWideString( SecondShadowOffsetX.ToPoints() );
offset2 += L"pt";
}
if ( SecondShadowOffsetY != 0 )
{
offset2 += L",";
offset2 += FormatUtils::DoubleToWideString(SecondShadowOffsetY.ToPoints());
offset2 += L"pt";
}
if (!offset2.empty())
{
appendValueAttribute(&m_shadow, L"offset2", offset2.c_str());
}
//build shadow origin
if ( ( ShadowOriginX != 0 ) && ( ShadowOriginY != 0 ) )
{
appendValueAttribute(&m_shadow, L"origin", (FormatUtils::DoubleToWideString(shadowOriginX) + std::wstring(L"," ) + FormatUtils::DoubleToWideString(shadowOriginY)).c_str());
}
// write shadow
if (m_shadow.GetAttributeCount() > 0)
{
if (shadowBoolean.fShadow)
{
appendValueAttribute(&m_shadow, L"on", L"t" );
}
m_pXmlWriter->WriteString(m_shadow.GetXMLString().c_str());
}
//write 3d style
if (m_3dstyle.GetAttributeCount() > 0)
{
appendValueAttribute(&m_3dstyle, L"v:ext", L"view" );
appendValueAttribute(&m_3dstyle, L"on", L"t" );
//write the viewpoint
if ( ( ViewPointX != 0 ) || ( ViewPointY != 0 ) || ( ViewPointZ != 0 ) )
{
std::wstring viewPoint;
if ( ViewPointX != 0 )
{ {
m_pXmlWriter->WriteString(m_stroke.GetXMLString().c_str()); viewPoint += FormatUtils::IntToWideString( ViewPointX ) + L"pt";
} }
// write fill viewPoint += L",";
if (m_fill.GetAttributeCount()) if ( ViewPointY != 0 )
{ {
m_pXmlWriter->WriteString(m_fill.GetXMLString().c_str()); viewPoint += FormatUtils::IntToWideString( ViewPointY ) + L"pt";
} }
// text path viewPoint += L",";
if (m_textpath.GetAttributeCount()) if ( ViewPointZ != 0 )
{ {
appendValueAttribute(&m_textpath, L"style", FormatUtils::XmlEncode(m_textPathStyle).c_str()); viewPoint += FormatUtils::IntToWideString( ViewPointZ ) + L"pt";
m_pXmlWriter->WriteString(m_textpath.GetXMLString().c_str());
} }
// write imagedata
if (m_imagedata.GetAttributeCount()) appendValueAttribute(&m_3dstyle, L"viewpoint", viewPoint.c_str());
}
// write the viewpointorigin
if ( ( viewPointOriginX != 0 ) || ( viewPointOriginY != 0 ) )
{
std::wstring viewPointOrigin;
if ( viewPointOriginX != 0 )
{ {
m_pXmlWriter->WriteString(m_imagedata.GetXMLString().c_str()); viewPointOrigin += FormatUtils::DoubleToFormattedWideString( viewPointOriginX, L"%.2f" );
} }
if (freeform) if ( viewPointOriginY != 0 )
{ {
if (arrInscribe.size()) viewPointOrigin += L",";
{ viewPointOrigin += FormatUtils::DoubleToFormattedWideString( viewPointOriginY, L"%.2f" );
m_pXmlWriter->WriteNodeBegin(L"v:path", true);
m_pXmlWriter->WriteAttribute(L"textboxrect", arrInscribe[0]);
m_pXmlWriter->WriteNodeEnd(L"", true);
}
} }
// TEXTBOX
OfficeArtClientTextbox* pTextBox = pContainer->FirstChildWithType<OfficeArtClientTextbox>();
if (pTextBox)
{
// Word text box
//Word appends a OfficeArtClientTextbox record to the container. appendValueAttribute(&m_3dstyle, L"viewpointorigin", viewPointOrigin.c_str());
//This record stores the index of the textbox. }
int nIndex = pTextBox->GetIndex(); m_pXmlWriter->WriteString(m_3dstyle.GetXMLString().c_str());
if (nIndex) }
{ // write wrap
TextboxMapping textboxMapping(m_ctx, nIndex - 1, m_pXmlWriter, m_pCaller); if (m_pSpa)
textboxMapping.SetInset(ndxTextLeft, ndyTextTop, ndxTextRight, ndyTextBottom); {
textboxMapping.SetTextboxStyle(sTextboxStyle); std::wstring wrap = getWrapType(m_pSpa);
m_ctx->_doc->Convert(&textboxMapping); if (wrap != L"through")
} {
} m_pXmlWriter->WriteNodeBegin( L"w10:wrap", true );
else if( hasTextbox ) m_pXmlWriter->WriteAttribute( L"type", wrap.c_str() );
{ m_pXmlWriter->WriteNodeEnd ( L"w10:wrap", true );
//Open Office textbox }
}
// write fill
if (m_fill.GetAttributeCount())
{
m_pXmlWriter->WriteString(m_fill.GetXMLString().c_str());
}
// write imagedata
if (m_imagedata.GetAttributeCount())
{
m_pXmlWriter->WriteString(m_imagedata.GetXMLString().c_str());
}
if ( pShape->fBackground )
{
WriteEndShapeNode(pShape);
return;
}
// write stroke
if (m_stroke.GetAttributeCount())
{
m_pXmlWriter->WriteString(m_stroke.GetXMLString().c_str());
}
// text path
if (m_textpath.GetAttributeCount())
{
appendValueAttribute(&m_textpath, L"style", FormatUtils::XmlEncode(m_textPathStyle).c_str());
m_pXmlWriter->WriteString(m_textpath.GetXMLString().c_str());
}
if (freeform)
{
if (arrInscribe.size())
{
m_pXmlWriter->WriteNodeBegin(L"v:path", true);
m_pXmlWriter->WriteAttribute(L"textboxrect", arrInscribe[0]);
m_pXmlWriter->WriteNodeEnd(L"", true);
}
}
// TEXTBOX
OfficeArtClientTextbox* pTextBox = pContainer->FirstChildWithType<OfficeArtClientTextbox>();
if (pTextBox)
{
// Word text box
//Open Office doesn't append a OfficeArtClientTextbox record to the container. //Word appends a OfficeArtClientTextbox record to the container.
//We don't know how Word gets the relation to the text, but we assume that the first textbox in the document //This record stores the index of the textbox.
//get the index 0, the second textbox gets the index 1 (and so on).
if (-1 != nLTxID) int nIndex = pTextBox->GetIndex();
{ if (nIndex)
TextboxMapping textboxMapping(m_ctx, nLTxID - 1, m_pXmlWriter, m_pCaller); {
textboxMapping.SetInset(ndxTextLeft, ndyTextTop, ndxTextRight, ndyTextBottom); TextboxMapping textboxMapping(m_context, nIndex - 1, m_pXmlWriter, m_pCaller);
m_ctx->_doc->Convert(&textboxMapping); textboxMapping.SetInset(ndxTextLeft, ndyTextTop, ndxTextRight, ndyTextBottom);
} textboxMapping.SetTextboxStyle(sTextboxStyle);
else
{
TextboxMapping textboxMapping(m_ctx, m_pXmlWriter, m_pCaller);
textboxMapping.SetInset(ndxTextLeft, ndyTextTop, ndxTextRight, ndyTextBottom);
m_ctx->_doc->Convert(&textboxMapping);
}
}
WriteEndShapeNode(pShape); m_context->_doc->Convert(&textboxMapping);
//ShapeType }
if (NULL != pShape->GetShapeType() && !pShape->fBackground /* && !m_isInlineShape*/) //bullete only??? }
{ else if( hasTextbox )
VMLShapeTypeMapping oXmlMapper(m_pXmlWriter); {
pShape->GetShapeType()->Convert(&oXmlMapper); //Open Office textbox
}
//Open Office doesn't append a OfficeArtClientTextbox record to the container.
//We don't know how Word gets the relation to the text, but we assume that the first textbox in the document
//get the index 0, the second textbox gets the index 1 (and so on).
if (-1 != nLTxID)
{
TextboxMapping textboxMapping(m_context, nLTxID - 1, m_pXmlWriter, m_pCaller);
textboxMapping.SetInset(ndxTextLeft, ndyTextTop, ndxTextRight, ndyTextBottom);
m_context->_doc->Convert(&textboxMapping);
}
else
{
TextboxMapping textboxMapping(m_context, m_pXmlWriter, m_pCaller);
textboxMapping.SetInset(ndxTextLeft, ndyTextTop, ndxTextRight, ndyTextBottom);
m_context->_doc->Convert(&textboxMapping);
} }
} }
WriteEndShapeNode(pShape);
// OLE
if (indexOLE >= 0 && pShape->fOleShape) //4571833.doc
{
XMLTools::CStringXmlWriter txtBoxWrapper;
TextboxMapping textboxMapping(m_context, (indexOLE >> 16) - 1, &txtBoxWrapper, m_pCaller);
textboxMapping.m_shapeIdOwner = m_shapeId;
m_context->_doc->Convert(&textboxMapping);
m_pXmlWriter->WriteString(textboxMapping.getOLEObject());
}
//ShapeType
if (NULL != pShape->GetShapeType() /* && !m_isInlineShape*/) //bullete only???
{
VMLShapeTypeMapping oXmlMapper(m_pXmlWriter);
pShape->GetShapeType()->Convert(&oXmlMapper);
}
} }
// //
...@@ -1028,22 +1063,18 @@ namespace DocFileFormat ...@@ -1028,22 +1063,18 @@ namespace DocFileFormat
} }
else if (pShape->is<OvalType>()) else if (pShape->is<OvalType>())
{ {
//OVAL
m_pXmlWriter->WriteNodeBegin( L"v:oval", true ); m_pXmlWriter->WriteNodeBegin( L"v:oval", true );
} }
else if (pShape->is<RoundedRectangleType>()) else if (pShape->is<RoundedRectangleType>())
{ {
//ROUNDED RECT
m_pXmlWriter->WriteNodeBegin( L"v:roundrect", true ); m_pXmlWriter->WriteNodeBegin( L"v:roundrect", true );
} }
else if (pShape->is<RectangleType>()) else if (pShape->is<RectangleType>())
{ {
//RECT
m_pXmlWriter->WriteNodeBegin( L"v:rect", true ); m_pXmlWriter->WriteNodeBegin( L"v:rect", true );
} }
else if (pShape->is<LineType>()) else if (pShape->is<LineType>())
{ {
//LINE
m_pXmlWriter->WriteNodeBegin(L"v:line", true); m_pXmlWriter->WriteNodeBegin(L"v:line", true);
} }
else else
...@@ -1192,7 +1223,7 @@ namespace DocFileFormat ...@@ -1192,7 +1223,7 @@ namespace DocFileFormat
//write the blip //write the blip
if (oBlip) if (oBlip)
{ {
VirtualStreamReader reader(m_ctx->_doc->WordDocumentStream, oBlip->foDelay, m_ctx->_doc->FIB->m_bOlderVersion); VirtualStreamReader reader(m_context->_doc->WordDocumentStream, oBlip->foDelay, m_context->_doc->FIB->m_bOlderVersion);
switch (oBlip->btWin32) switch (oBlip->btWin32)
{ {
...@@ -1210,7 +1241,7 @@ namespace DocFileFormat ...@@ -1210,7 +1241,7 @@ namespace DocFileFormat
decompressedSize = metaBlip->Decompress(&decompressed); decompressedSize = metaBlip->Decompress(&decompressed);
if (0 != decompressedSize && NULL != decompressed) if (0 != decompressedSize && NULL != decompressed)
{ {
m_ctx->_docx->ImagesList.push_back(ImageFileStructure(GetTargetExt(oBlip->btWin32), std::vector<unsigned char>(decompressed, (decompressed + decompressedSize)))); m_context->_docx->ImagesList.push_back(ImageFileStructure(GetTargetExt(oBlip->btWin32), std::vector<unsigned char>(decompressed, (decompressed + decompressedSize))));
RELEASEARRAYOBJECTS(decompressed); RELEASEARRAYOBJECTS(decompressed);
} }
...@@ -1229,7 +1260,7 @@ namespace DocFileFormat ...@@ -1229,7 +1260,7 @@ namespace DocFileFormat
BitmapBlip* bitBlip = static_cast<BitmapBlip*>(RecordFactory::ReadRecord(&reader, 0)); BitmapBlip* bitBlip = static_cast<BitmapBlip*>(RecordFactory::ReadRecord(&reader, 0));
if ((bitBlip) && (bitBlip->m_pvBits)) if ((bitBlip) && (bitBlip->m_pvBits))
{ {
m_ctx->_docx->ImagesList.push_back(ImageFileStructure(GetTargetExt(oBlip->btWin32), m_context->_docx->ImagesList.push_back(ImageFileStructure(GetTargetExt(oBlip->btWin32),
std::vector<unsigned char>(bitBlip->m_pvBits, (bitBlip->m_pvBits + bitBlip->pvBitsSize)), oBlip->btWin32)); std::vector<unsigned char>(bitBlip->m_pvBits, (bitBlip->m_pvBits + bitBlip->pvBitsSize)), oBlip->btWin32));
RELEASEOBJECT (bitBlip); RELEASEOBJECT (bitBlip);
} }
...@@ -1244,7 +1275,7 @@ namespace DocFileFormat ...@@ -1244,7 +1275,7 @@ namespace DocFileFormat
break; break;
} }
m_nImageId = m_ctx->_docx->RegisterImage (m_pCaller, oBlip->btWin32); m_nImageId = m_context->_docx->RegisterImage (m_pCaller, oBlip->btWin32);
result = true; result = true;
} }
...@@ -1889,7 +1920,6 @@ namespace DocFileFormat ...@@ -1889,7 +1920,6 @@ namespace DocFileFormat
return rectangles; return rectangles;
} }
//------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------
static int count_vml_objects = 0;
void VMLShapeMapping::ApplyPrimitives(DrawingPrimitives * primitives) void VMLShapeMapping::ApplyPrimitives(DrawingPrimitives * primitives)
{ {
...@@ -1957,9 +1987,9 @@ namespace DocFileFormat ...@@ -1957,9 +1987,9 @@ namespace DocFileFormat
if (-1 != nLTxID) if (-1 != nLTxID)
{ {
TextboxMapping textboxMapping(m_ctx, nLTxID - 1, m_pXmlWriter, m_pCaller); TextboxMapping textboxMapping(m_context, nLTxID - 1, m_pXmlWriter, m_pCaller);
//textboxMapping.SetInset(ndxTextLeft, ndyTextTop, ndxTextRight, ndyTextBottom); //textboxMapping.SetInset(ndxTextLeft, ndyTextTop, ndxTextRight, ndyTextBottom);
m_ctx->_doc->Convert(&textboxMapping); m_context->_doc->Convert(&textboxMapping);
} }
} }
...@@ -1976,7 +2006,9 @@ namespace DocFileFormat ...@@ -1976,7 +2006,9 @@ namespace DocFileFormat
TwipsValue w( primitive->dxa ); TwipsValue w( primitive->dxa );
TwipsValue h( primitive->dya ); TwipsValue h( primitive->dya );
std::wstring strId = std::wstring(L"_x0000_s") + FormatUtils::IntToWideString(1024 + (count_vml_objects++)); std::wstring strId = std::wstring(L"_x0000_s") + FormatUtils::IntToWideString(1024 + count_vml_objects);
count_vml_objects++;
//m_pXmlWriter->WriteAttribute ( L"id") , strId.c_str()); //m_pXmlWriter->WriteAttribute ( L"id") , strId.c_str());
m_pXmlWriter->WriteAttribute ( L"o:spid", strId.c_str()); m_pXmlWriter->WriteAttribute ( L"o:spid", strId.c_str());
......
...@@ -68,7 +68,8 @@ namespace DocFileFormat ...@@ -68,7 +68,8 @@ namespace DocFileFormat
static std::wstring mapHorizontalPosition (PositionHorizontal hPos ); static std::wstring mapHorizontalPosition (PositionHorizontal hPos );
static std::wstring mapHorizontalPositionRelative(int hRel ); static std::wstring mapHorizontalPositionRelative(int hRel );
bool m_isBullete; bool m_isBullete;
std::wstring m_shapeId;
private: private:
void ApplyPrimitives (DrawingPrimitives * primitives ); void ApplyPrimitives (DrawingPrimitives * primitives );
...@@ -129,7 +130,7 @@ namespace DocFileFormat ...@@ -129,7 +130,7 @@ namespace DocFileFormat
BlipStoreContainer* m_pBlipStore; BlipStoreContainer* m_pBlipStore;
int m_nImageId; int m_nImageId;
std::wstring m_textPathStyle; std::wstring m_textPathStyle;
ConversionContext* m_ctx; ConversionContext* m_context;
PictureDescriptor* m_pict; PictureDescriptor* m_pict;
XMLTools::XMLElement<wchar_t> m_fill; XMLTools::XMLElement<wchar_t> m_fill;
......
...@@ -37,6 +37,8 @@ ...@@ -37,6 +37,8 @@
namespace DocFileFormat namespace DocFileFormat
{ {
static int count_vml_objects = 0;
class VMLShapeTypeMapping: public PropertiesMapping, public IMapping class VMLShapeTypeMapping: public PropertiesMapping, public IMapping
{ {
private: private:
......
...@@ -268,7 +268,7 @@ namespace DocFileFormat ...@@ -268,7 +268,7 @@ namespace DocFileFormat
OfficeDrawingPlex = new Plex<Spa> (Spa::GetSize(bOlderVersion), TableStream, FIB->m_FibWord97.fcPlcSpaMom, FIB->m_FibWord97.lcbPlcSpaMom, bOlderVersion); OfficeDrawingPlex = new Plex<Spa> (Spa::GetSize(bOlderVersion), TableStream, FIB->m_FibWord97.fcPlcSpaMom, FIB->m_FibWord97.lcbPlcSpaMom, bOlderVersion);
OfficeDrawingPlexHeader = new Plex<Spa> (Spa::GetSize(bOlderVersion), TableStream, FIB->m_FibWord97.fcPlcSpaHdr, FIB->m_FibWord97.lcbPlcSpaHdr, bOlderVersion); OfficeDrawingPlexHeader = new Plex<Spa> (Spa::GetSize(bOlderVersion), TableStream, FIB->m_FibWord97.fcPlcSpaHdr, FIB->m_FibWord97.lcbPlcSpaHdr, bOlderVersion);
TextboxIndividualPlex = new Plex<EmptyStructure> (EmptyStructure::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcftxbxTxt, FIB->m_FibWord97.lcbPlcftxbxTxt, bOlderVersion); TextboxIndividualPlex = new Plex<FTXBXS> (FTXBXS::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcftxbxTxt, FIB->m_FibWord97.lcbPlcftxbxTxt, bOlderVersion);
SectionPlex = new Plex<SectionDescriptor> (SectionDescriptor::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcfSed, FIB->m_FibWord97.lcbPlcfSed, bOlderVersion); SectionPlex = new Plex<SectionDescriptor> (SectionDescriptor::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcfSed, FIB->m_FibWord97.lcbPlcfSed, bOlderVersion);
BookmarkStartPlex = new Plex<BookmarkFirst> (BookmarkFirst::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcfBkf, FIB->m_FibWord97.lcbPlcfBkf, bOlderVersion); BookmarkStartPlex = new Plex<BookmarkFirst> (BookmarkFirst::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcfBkf, FIB->m_FibWord97.lcbPlcfBkf, bOlderVersion);
......
...@@ -187,7 +187,7 @@ namespace DocFileFormat ...@@ -187,7 +187,7 @@ namespace DocFileFormat
Plex<EmptyStructure> *HeaderStoriesPlex; //A plex of the header document Plex<EmptyStructure> *HeaderStoriesPlex; //A plex of the header document
Plex<EmptyStructure> *IndividualCommentsPlex; // A plex with all ATRDPre10 structs Plex<EmptyStructure> *IndividualCommentsPlex; // A plex with all ATRDPre10 structs
Plex<EmptyStructure> *TextboxIndividualPlex; Plex<FTXBXS> *TextboxIndividualPlex;
Plex<Tbkd> *TextboxBreakPlex; // Describes the breaks inside the textbox subdocument Plex<Tbkd> *TextboxBreakPlex; // Describes the breaks inside the textbox subdocument
Plex<Tbkd> *TextboxBreakPlexHeader; // Describes the breaks inside the header textbox subdocument Plex<Tbkd> *TextboxBreakPlexHeader; // Describes the breaks inside the header textbox subdocument
......
...@@ -555,6 +555,10 @@ ...@@ -555,6 +555,10 @@
RelativePath="..\..\DocDocxConverter\OfficeArtContent.h" RelativePath="..\..\DocDocxConverter\OfficeArtContent.h"
> >
</File> </File>
<File
RelativePath="..\..\DocDocxConverter\OleObject.cpp"
>
</File>
<File <File
RelativePath="..\..\DocDocxConverter\OleObject.h" RelativePath="..\..\DocDocxConverter\OleObject.h"
> >
......
...@@ -48,7 +48,6 @@ SOURCES += \ ...@@ -48,7 +48,6 @@ SOURCES += \
../source/OdfFormat/header_footer.cpp \ ../source/OdfFormat/header_footer.cpp \
../source/OdfFormat/list.cpp \ ../source/OdfFormat/list.cpp \
../source/OdfFormat/mediaitems.cpp \ ../source/OdfFormat/mediaitems.cpp \
../source/OdfFormat/mediaitems_utils.cpp \
../source/OdfFormat/number_style.cpp \ ../source/OdfFormat/number_style.cpp \
../source/OdfFormat/object_package.cpp \ ../source/OdfFormat/object_package.cpp \
../source/OdfFormat/odf_chart_context.cpp \ ../source/OdfFormat/odf_chart_context.cpp \
...@@ -99,7 +98,10 @@ SOURCES += \ ...@@ -99,7 +98,10 @@ SOURCES += \
../source/Oox2OdfConverter/ConverterChart.cpp \ ../source/Oox2OdfConverter/ConverterChart.cpp \
../source/Oox2OdfConverter/ConvertVml.cpp \ ../source/Oox2OdfConverter/ConvertVml.cpp \
../source/Oox2OdfConverter/DocxConverter.cpp \ ../source/Oox2OdfConverter/DocxConverter.cpp \
../source/Oox2OdfConverter/XlsxConverter.cpp ../source/Oox2OdfConverter/XlsxConverter.cpp \
../source/OdfFormat/odf_settings_context.cpp \
../source/OdfFormat/office_settings.cpp \
../source/OdfFormat/mediaitems_utils.cpp
} }
...@@ -112,7 +114,6 @@ HEADERS += \ ...@@ -112,7 +114,6 @@ HEADERS += \
../source/OdfFormat/header_footer.h \ ../source/OdfFormat/header_footer.h \
../source/OdfFormat/list.h \ ../source/OdfFormat/list.h \
../source/OdfFormat/mediaitems.h \ ../source/OdfFormat/mediaitems.h \
../source/OdfFormat/mediaitems_utils.h \
../source/OdfFormat/number_style.h \ ../source/OdfFormat/number_style.h \
../source/OdfFormat/object_package.h \ ../source/OdfFormat/object_package.h \
../source/OdfFormat/odf_chart_context.h \ ../source/OdfFormat/odf_chart_context.h \
...@@ -185,7 +186,3 @@ HEADERS += \ ...@@ -185,7 +186,3 @@ HEADERS += \
../source/OdfFormat/Shapes/oox_shapeWordArt.h \ ../source/OdfFormat/Shapes/oox_shapeWordArt.h \
../source/OdfFormat/odf_settings_context.h \ ../source/OdfFormat/odf_settings_context.h \
../source/OdfFormat/office_settings.h ../source/OdfFormat/office_settings.h
SOURCES += \
../source/OdfFormat/odf_settings_context.cpp \
../source/OdfFormat/office_settings.cpp
...@@ -1218,7 +1218,7 @@ CString RtfStyle::RenderToOOXBegin(RenderParameter oRenderParameter) ...@@ -1218,7 +1218,7 @@ CString RtfStyle::RenderToOOXBegin(RenderParameter oRenderParameter)
if( PROP_DEF != m_bPersonal ) sResult += L"<w:personal w:val=\"true\" />"; if( PROP_DEF != m_bPersonal ) sResult += L"<w:personal w:val=\"true\" />";
if( PROP_DEF != m_bCompose ) sResult += L"<w:personalCompose w:val=\"true\" />"; if( PROP_DEF != m_bCompose ) sResult += L"<w:personalCompose w:val=\"true\" />";
if( PROP_DEF != m_bReply ) sResult += L"<w:personalReply w:val=\"true\" />"; if( PROP_DEF != m_bReply ) sResult += L"<w:personalReply w:val=\"true\" />";
if( PROP_DEF == m_nSemiHidden ) sResult += L"<w:semiHidden/>"; if( 1 == m_nSemiHidden ) sResult += L"<w:semiHidden/>";
if( PROP_DEF != m_bQFormat ) sResult += L"<w:qformat/>"; if( PROP_DEF != m_bQFormat ) sResult += L"<w:qformat/>";
if( PROP_DEF != m_nPriority ) sResult.AppendFormat(L"<w:uiPriority w:val=\"%d\"/>",m_nPriority); if( PROP_DEF != m_nPriority ) sResult.AppendFormat(L"<w:uiPriority w:val=\"%d\"/>",m_nPriority);
if( PROP_DEF != m_bUnhiddenWhenUse ) sResult += L"<w:unhideWhenUsed/>"; if( PROP_DEF != m_bUnhiddenWhenUse ) sResult += L"<w:unhideWhenUsed/>";
......
...@@ -9,9 +9,6 @@ ...@@ -9,9 +9,6 @@
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
1732414A1BBEC90000E67992 /* pole.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 173241431BBEC90000E67992 /* pole.cpp */; }; 1732414A1BBEC90000E67992 /* pole.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 173241431BBEC90000E67992 /* pole.cpp */; };
1732414C1BBEC90000E67992 /* pole.h in Headers */ = {isa = PBXBuildFile; fileRef = 173241441BBEC90000E67992 /* pole.h */; }; 1732414C1BBEC90000E67992 /* pole.h in Headers */ = {isa = PBXBuildFile; fileRef = 173241441BBEC90000E67992 /* pole.h */; };
1732463D1BBEDC2C00E67992 /* UnicodeConverter_Encodings.h in Headers */ = {isa = PBXBuildFile; fileRef = 173246391BBEDC2C00E67992 /* UnicodeConverter_Encodings.h */; };
1732463F1BBEDC2C00E67992 /* UnicodeConverter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1732463A1BBEDC2C00E67992 /* UnicodeConverter.cpp */; };
173246411BBEDC2C00E67992 /* UnicodeConverter.h in Headers */ = {isa = PBXBuildFile; fileRef = 1732463B1BBEDC2C00E67992 /* UnicodeConverter.h */; };
17C1FB941ACC4250006B99B3 /* Hyperlink.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 17E6A0621AC4262700F28F8B /* Hyperlink.cpp */; }; 17C1FB941ACC4250006B99B3 /* Hyperlink.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 17E6A0621AC4262700F28F8B /* Hyperlink.cpp */; };
17C1FB951ACC4250006B99B3 /* Sdt.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 17E6A06D1AC4262700F28F8B /* Sdt.cpp */; }; 17C1FB951ACC4250006B99B3 /* Sdt.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 17E6A06D1AC4262700F28F8B /* Sdt.cpp */; };
17C1FB961ACC4250006B99B3 /* oMathContent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 17E6A0801AC4262700F28F8B /* oMathContent.cpp */; }; 17C1FB961ACC4250006B99B3 /* oMathContent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 17E6A0801AC4262700F28F8B /* oMathContent.cpp */; };
...@@ -264,9 +261,6 @@ ...@@ -264,9 +261,6 @@
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
173241431BBEC90000E67992 /* pole.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = pole.cpp; sourceTree = "<group>"; }; 173241431BBEC90000E67992 /* pole.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = pole.cpp; sourceTree = "<group>"; };
173241441BBEC90000E67992 /* pole.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pole.h; sourceTree = "<group>"; }; 173241441BBEC90000E67992 /* pole.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pole.h; sourceTree = "<group>"; };
173246391BBEDC2C00E67992 /* UnicodeConverter_Encodings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UnicodeConverter_Encodings.h; path = ../../../UnicodeConverter/UnicodeConverter_Encodings.h; sourceTree = "<group>"; };
1732463A1BBEDC2C00E67992 /* UnicodeConverter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = UnicodeConverter.cpp; path = ../../../UnicodeConverter/UnicodeConverter.cpp; sourceTree = "<group>"; };
1732463B1BBEDC2C00E67992 /* UnicodeConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UnicodeConverter.h; path = ../../../UnicodeConverter/UnicodeConverter.h; sourceTree = "<group>"; };
17C1FC9C1ACC4250006B99B3 /* libDocxFormatLib_ios.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libDocxFormatLib_ios.a; sourceTree = BUILT_PRODUCTS_DIR; }; 17C1FC9C1ACC4250006B99B3 /* libDocxFormatLib_ios.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libDocxFormatLib_ios.a; sourceTree = BUILT_PRODUCTS_DIR; };
17E69FED1AC4262700F28F8B /* ASCString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASCString.h; sourceTree = "<group>"; }; 17E69FED1AC4262700F28F8B /* ASCString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASCString.h; sourceTree = "<group>"; };
17E69FEE1AC4262700F28F8B /* ASCWinAPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASCWinAPI.h; sourceTree = "<group>"; }; 17E69FEE1AC4262700F28F8B /* ASCWinAPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASCWinAPI.h; sourceTree = "<group>"; };
...@@ -545,16 +539,6 @@ ...@@ -545,16 +539,6 @@
path = ../../3dParty/pole; path = ../../3dParty/pole;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
173246361BBEDC2300E67992 /* UnicodeConverter */ = {
isa = PBXGroup;
children = (
173246391BBEDC2C00E67992 /* UnicodeConverter_Encodings.h */,
1732463B1BBEDC2C00E67992 /* UnicodeConverter.h */,
1732463A1BBEDC2C00E67992 /* UnicodeConverter.cpp */,
);
name = UnicodeConverter;
sourceTree = "<group>";
};
17E69FD31AC4259800F28F8B = { 17E69FD31AC4259800F28F8B = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
...@@ -583,7 +567,6 @@ ...@@ -583,7 +567,6 @@
17E69FEB1AC4262700F28F8B /* Source */ = { 17E69FEB1AC4262700F28F8B /* Source */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
173246361BBEDC2300E67992 /* UnicodeConverter */,
173241401BBEC90000E67992 /* pole */, 173241401BBEC90000E67992 /* pole */,
17E69FEC1AC4262700F28F8B /* Base */, 17E69FEC1AC4262700F28F8B /* Base */,
17E69FF51AC4262700F28F8B /* Common */, 17E69FF51AC4262700F28F8B /* Common */,
...@@ -1133,7 +1116,6 @@ ...@@ -1133,7 +1116,6 @@
17C1FBFC1ACC4250006B99B3 /* SimpleTypes_Shared.h in Headers */, 17C1FBFC1ACC4250006B99B3 /* SimpleTypes_Shared.h in Headers */,
17C1FBFD1ACC4250006B99B3 /* DefinedNames.h in Headers */, 17C1FBFD1ACC4250006B99B3 /* DefinedNames.h in Headers */,
17C1FBFE1ACC4250006B99B3 /* File.h in Headers */, 17C1FBFE1ACC4250006B99B3 /* File.h in Headers */,
1732463D1BBEDC2C00E67992 /* UnicodeConverter_Encodings.h in Headers */,
17C1FBFF1ACC4250006B99B3 /* Pic.h in Headers */, 17C1FBFF1ACC4250006B99B3 /* Pic.h in Headers */,
69415F541CB51D9E003E771B /* DrawingGraphic.h in Headers */, 69415F541CB51D9E003E771B /* DrawingGraphic.h in Headers */,
17C1FC001ACC4250006B99B3 /* Worksheet.h in Headers */, 17C1FC001ACC4250006B99B3 /* Worksheet.h in Headers */,
...@@ -1239,7 +1221,6 @@ ...@@ -1239,7 +1221,6 @@
17C1FC681ACC4250006B99B3 /* Fonts.h in Headers */, 17C1FC681ACC4250006B99B3 /* Fonts.h in Headers */,
17C1FC691ACC4250006B99B3 /* Footnote.h in Headers */, 17C1FC691ACC4250006B99B3 /* Footnote.h in Headers */,
69415F5B1CB51D9E003E771B /* DrawingShared.h in Headers */, 69415F5B1CB51D9E003E771B /* DrawingShared.h in Headers */,
173246411BBEDC2C00E67992 /* UnicodeConverter.h in Headers */,
17C1FC6A1ACC4250006B99B3 /* ComplexTypes.h in Headers */, 17C1FC6A1ACC4250006B99B3 /* ComplexTypes.h in Headers */,
17C1FC6C1ACC4250006B99B3 /* RunContent.h in Headers */, 17C1FC6C1ACC4250006B99B3 /* RunContent.h in Headers */,
17C1FC6D1ACC4250006B99B3 /* External.h in Headers */, 17C1FC6D1ACC4250006B99B3 /* External.h in Headers */,
...@@ -1367,7 +1348,6 @@ ...@@ -1367,7 +1348,6 @@
17C1FBAB1ACC4250006B99B3 /* FileFactory_Spreadsheet.cpp in Sources */, 17C1FBAB1ACC4250006B99B3 /* FileFactory_Spreadsheet.cpp in Sources */,
17C1FBAC1ACC4250006B99B3 /* AlternateContent.cpp in Sources */, 17C1FBAC1ACC4250006B99B3 /* AlternateContent.cpp in Sources */,
17C1FBAD1ACC4250006B99B3 /* SmartTag.cpp in Sources */, 17C1FBAD1ACC4250006B99B3 /* SmartTag.cpp in Sources */,
1732463F1BBEDC2C00E67992 /* UnicodeConverter.cpp in Sources */,
17C1FBAE1ACC4250006B99B3 /* oMath.cpp in Sources */, 17C1FBAE1ACC4250006B99B3 /* oMath.cpp in Sources */,
17C1FBAF1ACC4250006B99B3 /* ChartSerialize.cpp in Sources */, 17C1FBAF1ACC4250006B99B3 /* ChartSerialize.cpp in Sources */,
17C1FBB01ACC4250006B99B3 /* IFileContainer_Spreadsheet.cpp in Sources */, 17C1FBB01ACC4250006B99B3 /* IFileContainer_Spreadsheet.cpp in Sources */,
......
...@@ -83,6 +83,7 @@ public: ...@@ -83,6 +83,7 @@ public:
v8::Local<v8::Context> m_context; v8::Local<v8::Context> m_context;
int m_nFileType; int m_nFileType;
std::string m_sUtf8ArgumentJSON;
public: public:
...@@ -211,6 +212,31 @@ public: ...@@ -211,6 +212,31 @@ public:
} }
LOGGER_SPEED_LAP("run") LOGGER_SPEED_LAP("run")
if (true)
{
std::string sArg = m_sUtf8ArgumentJSON;
if (sArg.empty())
sArg = "{}";
NSCommon::string_replaceA(sArg, "\\", "\\\\");
NSCommon::string_replaceA(sArg, "\"", "\\\"");
std::string sArgument = "var Argument = JSON.parse(\"" + sArg + "\");";
v8::Local<v8::String> _sourceArg = v8::String::NewFromUtf8(m_isolate, sArgument.c_str());
v8::Local<v8::Script> _scriptArg = v8::Script::Compile(_sourceArg);
_scriptArg->Run();
if (try_catch.HasCaught())
{
std::wstring strCode = to_cstring(try_catch.Message()->GetSourceLine());
std::wstring strException = to_cstring(try_catch.Message()->Get());
_LOGGING_ERROR_(L"sdk_argument_code", strCode);
_LOGGING_ERROR_(L"sdk_argument", strException);
return false;
}
}
CNativeControl* pNative = NULL; CNativeControl* pNative = NULL;
bool bIsBreak = false; bool bIsBreak = false;
...@@ -401,12 +427,14 @@ namespace NSDoctRenderer ...@@ -401,12 +427,14 @@ namespace NSDoctRenderer
m_bCheckFonts = false; m_bCheckFonts = false;
m_sWorkDir = L""; m_sWorkDir = L"";
m_bSaveWithDoctrendererMode = false; m_bSaveWithDoctrendererMode = false;
m_sArgumentJSON = "";
} }
public: public:
bool m_bCheckFonts; bool m_bCheckFonts;
std::wstring m_sWorkDir; std::wstring m_sWorkDir;
bool m_bSaveWithDoctrendererMode; bool m_bSaveWithDoctrendererMode;
std::string m_sArgumentJSON;
}; };
class CDocBuilder_Private class CDocBuilder_Private
...@@ -1095,6 +1123,7 @@ namespace NSDoctRenderer ...@@ -1095,6 +1123,7 @@ namespace NSDoctRenderer
{ {
m_pWorker = new CV8RealTimeWorker(); m_pWorker = new CV8RealTimeWorker();
m_pWorker->m_nFileType = m_nFileType; m_pWorker->m_nFileType = m_nFileType;
m_pWorker->m_sUtf8ArgumentJSON = m_oParams.m_sArgumentJSON;
bool bOpen = m_pWorker->OpenFile(m_sX2tPath, m_sFileDir, GetScript()); bool bOpen = m_pWorker->OpenFile(m_sX2tPath, m_sFileDir, GetScript());
if (!bOpen) if (!bOpen)
...@@ -1419,6 +1448,11 @@ namespace NSDoctRenderer ...@@ -1419,6 +1448,11 @@ namespace NSDoctRenderer
m_pInternal->m_oParams.m_bCheckFonts = true; m_pInternal->m_oParams.m_bCheckFonts = true;
else if (sParam == "--work-directory") else if (sParam == "--work-directory")
m_pInternal->m_oParams.m_sWorkDir = std::wstring(value); m_pInternal->m_oParams.m_sWorkDir = std::wstring(value);
else if (sParam == "--argument")
{
std::wstring sArg(value);
m_pInternal->m_oParams.m_sArgumentJSON = U_TO_UTF8(sArg);
}
} }
void CDocBuilder::SetPropertyW(const wchar_t* param, const wchar_t* value) void CDocBuilder::SetPropertyW(const wchar_t* param, const wchar_t* value)
{ {
......
...@@ -212,6 +212,8 @@ ASCDOCUMENTSCORE_DEP += $(LIBXML) ...@@ -212,6 +212,8 @@ ASCDOCUMENTSCORE_DEP += $(LIBXML)
PDFREADER_DEP += $(HTMLRENDERER) PDFREADER_DEP += $(HTMLRENDERER)
PDFWRITER_DEP += $(UNICODECONVERTER)
#Template for next statment: #Template for next statment:
#FOO_MAKE := $(basename $(FOO_PRO)).build/Makefile #FOO_MAKE := $(basename $(FOO_PRO)).build/Makefile
#$(FOO): $(FOO_MAKE) #$(FOO): $(FOO_MAKE)
...@@ -256,6 +258,8 @@ $(ASCDOCUMENTSCORE): $(ASCDOCUMENTSCORE_DEP) ...@@ -256,6 +258,8 @@ $(ASCDOCUMENTSCORE): $(ASCDOCUMENTSCORE_DEP)
$(PDFREADER): $(PDFREADER_DEP) $(PDFREADER): $(PDFREADER_DEP)
$(PDFWRITER): $(PDFWRITER_DEP)
%.build/Makefile: %.pro %.build/Makefile: %.pro
mkdir -p $(dir $@) && cd $(dir $@) && qmake -r $< mkdir -p $(dir $@) && cd $(dir $@) && qmake -r $<
......
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
69EC66D61E017729003527E2 /* UnicodeConverter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 69EC66D41E017729003527E2 /* UnicodeConverter.cpp */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
69EC66BF1E0176F2003527E2 /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "include/$(PRODUCT_NAME)";
dstSubfolderSpec = 16;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
69EC66C11E0176F2003527E2 /* libUnicodeConverter.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libUnicodeConverter.a; sourceTree = BUILT_PRODUCTS_DIR; };
69EC66D31E017729003527E2 /* UnicodeConverter_Encodings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UnicodeConverter_Encodings.h; path = ../../../UnicodeConverter_Encodings.h; sourceTree = "<group>"; };
69EC66D41E017729003527E2 /* UnicodeConverter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = UnicodeConverter.cpp; path = ../../../UnicodeConverter.cpp; sourceTree = "<group>"; };
69EC66D51E017729003527E2 /* UnicodeConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UnicodeConverter.h; path = ../../../UnicodeConverter.h; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
69EC66BE1E0176F2003527E2 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
69EC66B81E0176F2003527E2 = {
isa = PBXGroup;
children = (
69EC66C31E0176F2003527E2 /* UnicodeConverter */,
69EC66C21E0176F2003527E2 /* Products */,
);
sourceTree = "<group>";
};
69EC66C21E0176F2003527E2 /* Products */ = {
isa = PBXGroup;
children = (
69EC66C11E0176F2003527E2 /* libUnicodeConverter.a */,
);
name = Products;
sourceTree = "<group>";
};
69EC66C31E0176F2003527E2 /* UnicodeConverter */ = {
isa = PBXGroup;
children = (
69EC66D31E017729003527E2 /* UnicodeConverter_Encodings.h */,
69EC66D41E017729003527E2 /* UnicodeConverter.cpp */,
69EC66D51E017729003527E2 /* UnicodeConverter.h */,
);
path = UnicodeConverter;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
69EC66C01E0176F2003527E2 /* UnicodeConverter */ = {
isa = PBXNativeTarget;
buildConfigurationList = 69EC66CA1E0176F2003527E2 /* Build configuration list for PBXNativeTarget "UnicodeConverter" */;
buildPhases = (
69EC66BD1E0176F2003527E2 /* Sources */,
69EC66BE1E0176F2003527E2 /* Frameworks */,
69EC66BF1E0176F2003527E2 /* CopyFiles */,
);
buildRules = (
);
dependencies = (
);
name = UnicodeConverter;
productName = UnicodeConverter;
productReference = 69EC66C11E0176F2003527E2 /* libUnicodeConverter.a */;
productType = "com.apple.product-type.library.static";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
69EC66B91E0176F2003527E2 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0820;
ORGANIZATIONNAME = OnlyOffce;
TargetAttributes = {
69EC66C01E0176F2003527E2 = {
CreatedOnToolsVersion = 8.2;
DevelopmentTeam = 2WH24U26GJ;
ProvisioningStyle = Automatic;
};
};
};
buildConfigurationList = 69EC66BC1E0176F2003527E2 /* Build configuration list for PBXProject "UnicodeConverter" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = 69EC66B81E0176F2003527E2;
productRefGroup = 69EC66C21E0176F2003527E2 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
69EC66C01E0176F2003527E2 /* UnicodeConverter */,
);
};
/* End PBXProject section */
/* Begin PBXSourcesBuildPhase section */
69EC66BD1E0176F2003527E2 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
69EC66D61E017729003527E2 /* UnicodeConverter.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
69EC66C81E0176F2003527E2 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 10.2;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
};
name = Debug;
};
69EC66C91E0176F2003527E2 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 10.2;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
};
name = Release;
};
69EC66CB1E0176F2003527E2 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
DEVELOPMENT_TEAM = 2WH24U26GJ;
GCC_PREPROCESSOR_DEFINITIONS = (
UNICODE,
_UNICODE,
_USE_LIBXML2_READER_,
_USE_XMLLITE_READER_,
USE_LITE_READER,
MAC,
unix,
_IOS,
);
HEADER_SEARCH_PATHS = (
"$(inherited)",
/usr/include/,
"$(PROJECT_DIR)/../../../UnicodeConverter/icubuilds/mac/icu/**",
"$(PROJECT_DIR)/../../../UnicodeConverter/icubuilds/mac/icu/icu/common",
"$(PROJECT_DIR)/../../../UnicodeConverter/icubuilds/mac/icu/icu/i18n",
"$(PROJECT_DIR)/../../../UnicodeConverter/icubuilds/mac/icu/icu/io",
);
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
};
name = Debug;
};
69EC66CC1E0176F2003527E2 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
DEVELOPMENT_TEAM = 2WH24U26GJ;
GCC_PREPROCESSOR_DEFINITIONS = (
UNICODE,
_UNICODE,
_USE_LIBXML2_READER_,
_USE_XMLLITE_READER_,
USE_LITE_READER,
MAC,
unix,
_IOS,
);
HEADER_SEARCH_PATHS = (
"$(inherited)",
/usr/include/,
"$(PROJECT_DIR)/../../../UnicodeConverter/icubuilds/mac/icu/**",
"$(PROJECT_DIR)/../../../UnicodeConverter/icubuilds/mac/icu/icu/common",
"$(PROJECT_DIR)/../../../UnicodeConverter/icubuilds/mac/icu/icu/i18n",
"$(PROJECT_DIR)/../../../UnicodeConverter/icubuilds/mac/icu/icu/io",
);
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
69EC66BC1E0176F2003527E2 /* Build configuration list for PBXProject "UnicodeConverter" */ = {
isa = XCConfigurationList;
buildConfigurations = (
69EC66C81E0176F2003527E2 /* Debug */,
69EC66C91E0176F2003527E2 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
69EC66CA1E0176F2003527E2 /* Build configuration list for PBXNativeTarget "UnicodeConverter" */ = {
isa = XCConfigurationList;
buildConfigurations = (
69EC66CB1E0176F2003527E2 /* Debug */,
69EC66CC1E0176F2003527E2 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 69EC66B91E0176F2003527E2 /* Project object */;
}
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:UnicodeConverter.xcodeproj">
</FileRef>
</Workspace>
DO NOT REMOVE FOLDER FOR XCODE
\ No newline at end of file
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
69DA32F71CEE100E00E10AF0 /* libmetafile_ios.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 69DA32311CEE08DD00E10AF0 /* libmetafile_ios.a */; }; 69DA32F71CEE100E00E10AF0 /* libmetafile_ios.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 69DA32311CEE08DD00E10AF0 /* libmetafile_ios.a */; };
69DA32F81CEE100E00E10AF0 /* libPPTXFormatLib_ios.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 69DA32611CEE09BB00E10AF0 /* libPPTXFormatLib_ios.a */; }; 69DA32F81CEE100E00E10AF0 /* libPPTXFormatLib_ios.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 69DA32611CEE09BB00E10AF0 /* libPPTXFormatLib_ios.a */; };
69DA32F91CEE100E00E10AF0 /* libraster_ios.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 69DA32491CEE094A00E10AF0 /* libraster_ios.a */; }; 69DA32F91CEE100E00E10AF0 /* libraster_ios.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 69DA32491CEE094A00E10AF0 /* libraster_ios.a */; };
69EC66D91E01775B003527E2 /* libUnicodeConverter.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 69EC66D21E01770D003527E2 /* libUnicodeConverter.a */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */ /* Begin PBXContainerItemProxy section */
...@@ -341,6 +342,20 @@ ...@@ -341,6 +342,20 @@
remoteGlobalIDString = 17C1FB8E1ACC4250006B99B3; remoteGlobalIDString = 17C1FB8E1ACC4250006B99B3;
remoteInfo = DocxFormatLib; remoteInfo = DocxFormatLib;
}; };
69EC66D11E01770D003527E2 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 69EC66CD1E01770C003527E2 /* UnicodeConverter.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 69EC66C11E0176F2003527E2;
remoteInfo = UnicodeConverter;
};
69EC66D71E01774D003527E2 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 69EC66CD1E01770C003527E2 /* UnicodeConverter.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = 69EC66C01E0176F2003527E2;
remoteInfo = UnicodeConverter;
};
/* End PBXContainerItemProxy section */ /* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
...@@ -368,6 +383,7 @@ ...@@ -368,6 +383,7 @@
69DA32501CEE095900E10AF0 /* freetype.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = freetype.xcodeproj; path = ../../../../DesktopEditor/mac_build/freetype/freetype.xcodeproj; sourceTree = "<group>"; }; 69DA32501CEE095900E10AF0 /* freetype.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = freetype.xcodeproj; path = ../../../../DesktopEditor/mac_build/freetype/freetype.xcodeproj; sourceTree = "<group>"; };
69DA32561CEE099000E10AF0 /* DocxFormatLib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = DocxFormatLib.xcodeproj; path = ../../../../Common/DocxFormat/Mac/DocxFormatLib.xcodeproj; sourceTree = "<group>"; }; 69DA32561CEE099000E10AF0 /* DocxFormatLib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = DocxFormatLib.xcodeproj; path = ../../../../Common/DocxFormat/Mac/DocxFormatLib.xcodeproj; sourceTree = "<group>"; };
69DA325C1CEE09BB00E10AF0 /* PPTXFormatLib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = PPTXFormatLib.xcodeproj; path = ../../../../ASCOfficePPTXFile/PPTXLib/Mac/PPTXFormatLib.xcodeproj; sourceTree = "<group>"; }; 69DA325C1CEE09BB00E10AF0 /* PPTXFormatLib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = PPTXFormatLib.xcodeproj; path = ../../../../ASCOfficePPTXFile/PPTXLib/Mac/PPTXFormatLib.xcodeproj; sourceTree = "<group>"; };
69EC66CD1E01770C003527E2 /* UnicodeConverter.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = UnicodeConverter.xcodeproj; path = ../../../../UnicodeConverter/build/UnicodeConverter/UnicodeConverter.xcodeproj; sourceTree = "<group>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */ /* Begin PBXFrameworksBuildPhase section */
...@@ -375,6 +391,7 @@ ...@@ -375,6 +391,7 @@
isa = PBXFrameworksBuildPhase; isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
69EC66D91E01775B003527E2 /* libUnicodeConverter.a in Frameworks */,
69DA32F11CEE100E00E10AF0 /* libagg_ios.a in Frameworks */, 69DA32F11CEE100E00E10AF0 /* libagg_ios.a in Frameworks */,
69DA32F21CEE100E00E10AF0 /* libcximage_ios.a in Frameworks */, 69DA32F21CEE100E00E10AF0 /* libcximage_ios.a in Frameworks */,
69DA32F31CEE100E00E10AF0 /* libDocxFormatLib_ios.a in Frameworks */, 69DA32F31CEE100E00E10AF0 /* libDocxFormatLib_ios.a in Frameworks */,
...@@ -413,6 +430,7 @@ ...@@ -413,6 +430,7 @@
17C27A0B1AC2DB3C00E1D003 = { 17C27A0B1AC2DB3C00E1D003 = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
69EC66CD1E01770C003527E2 /* UnicodeConverter.xcodeproj */,
69415FAE1CB5243F003E771B /* mng.xcodeproj */, 69415FAE1CB5243F003E771B /* mng.xcodeproj */,
69415FB11CB5243F003E771B /* png.xcodeproj */, 69415FB11CB5243F003E771B /* png.xcodeproj */,
69415FB41CB5243F003E771B /* raw.xcodeproj */, 69415FB41CB5243F003E771B /* raw.xcodeproj */,
...@@ -617,6 +635,14 @@ ...@@ -617,6 +635,14 @@
name = Products; name = Products;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
69EC66CE1E01770C003527E2 /* Products */ = {
isa = PBXGroup;
children = (
69EC66D21E01770D003527E2 /* libUnicodeConverter.a */,
);
name = Products;
sourceTree = "<group>";
};
/* End PBXGroup section */ /* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */ /* Begin PBXHeadersBuildPhase section */
...@@ -642,11 +668,11 @@ ...@@ -642,11 +668,11 @@
buildRules = ( buildRules = (
); );
dependencies = ( dependencies = (
69EC66D81E01774D003527E2 /* PBXTargetDependency */,
69DA32F01CEE100700E10AF0 /* PBXTargetDependency */, 69DA32F01CEE100700E10AF0 /* PBXTargetDependency */,
69DA32EE1CEE100400E10AF0 /* PBXTargetDependency */, 69DA32E81CEE0FFD00E10AF0 /* PBXTargetDependency */,
69DA32EC1CEE100200E10AF0 /* PBXTargetDependency */, 69DA32EC1CEE100200E10AF0 /* PBXTargetDependency */,
69DA32EA1CEE0FFF00E10AF0 /* PBXTargetDependency */, 69DA32EA1CEE0FFF00E10AF0 /* PBXTargetDependency */,
69DA32E81CEE0FFD00E10AF0 /* PBXTargetDependency */,
69DA32E61CEE0FFB00E10AF0 /* PBXTargetDependency */, 69DA32E61CEE0FFB00E10AF0 /* PBXTargetDependency */,
69DA32E41CEE0FF800E10AF0 /* PBXTargetDependency */, 69DA32E41CEE0FF800E10AF0 /* PBXTargetDependency */,
69DA32E21CEE0FF600E10AF0 /* PBXTargetDependency */, 69DA32E21CEE0FF600E10AF0 /* PBXTargetDependency */,
...@@ -662,6 +688,7 @@ ...@@ -662,6 +688,7 @@
69415F261CB51C32003E771B /* PBXTargetDependency */, 69415F261CB51C32003E771B /* PBXTargetDependency */,
698AF4C21C0745930080D889 /* PBXTargetDependency */, 698AF4C21C0745930080D889 /* PBXTargetDependency */,
177C43311AD7C0E400055DD7 /* PBXTargetDependency */, 177C43311AD7C0E400055DD7 /* PBXTargetDependency */,
69DA32EE1CEE100400E10AF0 /* PBXTargetDependency */,
17C8DEDC1ACD6A3900902C85 /* PBXTargetDependency */, 17C8DEDC1ACD6A3900902C85 /* PBXTargetDependency */,
); );
name = x2tconverter; name = x2tconverter;
...@@ -773,6 +800,10 @@ ...@@ -773,6 +800,10 @@
ProductGroup = 69415FB81CB5243F003E771B /* Products */; ProductGroup = 69415FB81CB5243F003E771B /* Products */;
ProjectRef = 69415FB71CB5243F003E771B /* tiff.xcodeproj */; ProjectRef = 69415FB71CB5243F003E771B /* tiff.xcodeproj */;
}, },
{
ProductGroup = 69EC66CE1E01770C003527E2 /* Products */;
ProjectRef = 69EC66CD1E01770C003527E2 /* UnicodeConverter.xcodeproj */;
},
); );
projectRoot = ""; projectRoot = "";
targets = ( targets = (
...@@ -930,6 +961,13 @@ ...@@ -930,6 +961,13 @@
remoteRef = 69DA32601CEE09BB00E10AF0 /* PBXContainerItemProxy */; remoteRef = 69DA32601CEE09BB00E10AF0 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR; sourceTree = BUILT_PRODUCTS_DIR;
}; };
69EC66D21E01770D003527E2 /* libUnicodeConverter.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libUnicodeConverter.a;
remoteRef = 69EC66D11E01770D003527E2 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
/* End PBXReferenceProxy section */ /* End PBXReferenceProxy section */
/* Begin PBXShellScriptBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */
...@@ -1065,6 +1103,11 @@ ...@@ -1065,6 +1103,11 @@
name = DocxFormatLib; name = DocxFormatLib;
targetProxy = 69DA32EF1CEE100700E10AF0 /* PBXContainerItemProxy */; targetProxy = 69DA32EF1CEE100700E10AF0 /* PBXContainerItemProxy */;
}; };
69EC66D81E01774D003527E2 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = UnicodeConverter;
targetProxy = 69EC66D71E01774D003527E2 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */ /* End PBXTargetDependency section */
/* Begin XCBuildConfiguration section */ /* Begin XCBuildConfiguration section */
......
...@@ -17,20 +17,20 @@ ...@@ -17,20 +17,20 @@
17DAB6891ACC371F005AF479 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 17DAB6881ACC371F005AF479 /* Images.xcassets */; }; 17DAB6891ACC371F005AF479 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 17DAB6881ACC371F005AF479 /* Images.xcassets */; };
17DAB68C1ACC371F005AF479 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 17DAB68A1ACC371F005AF479 /* LaunchScreen.xib */; }; 17DAB68C1ACC371F005AF479 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 17DAB68A1ACC371F005AF479 /* LaunchScreen.xib */; };
17DAB70E1ACC3B96005AF479 /* Demo-Hayden-Management-v2.docx in Resources */ = {isa = PBXBuildFile; fileRef = 17DAB70D1ACC3B90005AF479 /* Demo-Hayden-Management-v2.docx */; }; 17DAB70E1ACC3B96005AF479 /* Demo-Hayden-Management-v2.docx in Resources */ = {isa = PBXBuildFile; fileRef = 17DAB70D1ACC3B90005AF479 /* Demo-Hayden-Management-v2.docx */; };
6965353A1D9E85BB0093C60D /* libX2tConverter.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 696535371D9E85B00093C60D /* libX2tConverter.a */; }; 69920A431E016FAB00E7E6EE /* libX2tConverter.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 69920A401E016F9700E7E6EE /* libX2tConverter.a */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */ /* Begin PBXContainerItemProxy section */
696535361D9E85B00093C60D /* PBXContainerItemProxy */ = { 69920A3F1E016F9700E7E6EE /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy; isa = PBXContainerItemProxy;
containerPortal = 696535311D9E85B00093C60D /* X2tConverter.xcodeproj */; containerPortal = 69920A3A1E016F9700E7E6EE /* X2tConverter.xcodeproj */;
proxyType = 2; proxyType = 2;
remoteGlobalIDString = 17C8DED01ACD696100902C85; remoteGlobalIDString = 17C8DED01ACD696100902C85;
remoteInfo = x2tconverter; remoteInfo = x2tconverter;
}; };
696535381D9E85B40093C60D /* PBXContainerItemProxy */ = { 69920A411E016F9F00E7E6EE /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy; isa = PBXContainerItemProxy;
containerPortal = 696535311D9E85B00093C60D /* X2tConverter.xcodeproj */; containerPortal = 69920A3A1E016F9700E7E6EE /* X2tConverter.xcodeproj */;
proxyType = 1; proxyType = 1;
remoteGlobalIDString = 17C8DEC11ACD696100902C85; remoteGlobalIDString = 17C8DEC11ACD696100902C85;
remoteInfo = x2tconverter; remoteInfo = x2tconverter;
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
17DAB68B1ACC371F005AF479 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; }; 17DAB68B1ACC371F005AF479 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; };
17DAB70D1ACC3B90005AF479 /* Demo-Hayden-Management-v2.docx */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Demo-Hayden-Management-v2.docx"; sourceTree = "<group>"; }; 17DAB70D1ACC3B90005AF479 /* Demo-Hayden-Management-v2.docx */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Demo-Hayden-Management-v2.docx"; sourceTree = "<group>"; };
6905975F1CA137D000000D4D /* X2tConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = X2tConverter.h; path = ../../../build/Mac/X2tConverter/X2tConverter/X2tConverter.h; sourceTree = "<group>"; }; 6905975F1CA137D000000D4D /* X2tConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = X2tConverter.h; path = ../../../build/Mac/X2tConverter/X2tConverter/X2tConverter.h; sourceTree = "<group>"; };
696535311D9E85B00093C60D /* X2tConverter.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = X2tConverter.xcodeproj; path = /Users/amusinov/sources/core/X2tConverter/build/Mac/TestMacX2tConverter/../X2tConverter/X2tConverter.xcodeproj; sourceTree = "<absolute>"; }; 69920A3A1E016F9700E7E6EE /* X2tConverter.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = X2tConverter.xcodeproj; path = ../../build/Mac/X2tConverter/X2tConverter.xcodeproj; sourceTree = "<group>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */ /* Begin PBXFrameworksBuildPhase section */
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
isa = PBXFrameworksBuildPhase; isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
6965353A1D9E85BB0093C60D /* libX2tConverter.a in Frameworks */, 69920A431E016FAB00E7E6EE /* libX2tConverter.a in Frameworks */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
17DAB66F1ACC371E005AF479 = { 17DAB66F1ACC371E005AF479 = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
696535311D9E85B00093C60D /* X2tConverter.xcodeproj */, 69920A3A1E016F9700E7E6EE /* X2tConverter.xcodeproj */,
17DAB67A1ACC371E005AF479 /* iosTest */, 17DAB67A1ACC371E005AF479 /* iosTest */,
17DAB6791ACC371E005AF479 /* Products */, 17DAB6791ACC371E005AF479 /* Products */,
); );
...@@ -131,10 +131,10 @@ ...@@ -131,10 +131,10 @@
name = Files; name = Files;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
696535321D9E85B00093C60D /* Products */ = { 69920A3B1E016F9700E7E6EE /* Products */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
696535371D9E85B00093C60D /* libX2tConverter.a */, 69920A401E016F9700E7E6EE /* libX2tConverter.a */,
); );
name = Products; name = Products;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -153,7 +153,7 @@ ...@@ -153,7 +153,7 @@
buildRules = ( buildRules = (
); );
dependencies = ( dependencies = (
696535391D9E85B40093C60D /* PBXTargetDependency */, 69920A421E016F9F00E7E6EE /* PBXTargetDependency */,
); );
name = iosTest; name = iosTest;
productName = TestIOSX2tConverter; productName = TestIOSX2tConverter;
...@@ -171,7 +171,8 @@ ...@@ -171,7 +171,8 @@
TargetAttributes = { TargetAttributes = {
17DAB6771ACC371E005AF479 = { 17DAB6771ACC371E005AF479 = {
CreatedOnToolsVersion = 6.2; CreatedOnToolsVersion = 6.2;
ProvisioningStyle = Manual; DevelopmentTeam = 2WH24U26GJ;
ProvisioningStyle = Automatic;
}; };
}; };
}; };
...@@ -188,8 +189,8 @@ ...@@ -188,8 +189,8 @@
projectDirPath = ""; projectDirPath = "";
projectReferences = ( projectReferences = (
{ {
ProductGroup = 696535321D9E85B00093C60D /* Products */; ProductGroup = 69920A3B1E016F9700E7E6EE /* Products */;
ProjectRef = 696535311D9E85B00093C60D /* X2tConverter.xcodeproj */; ProjectRef = 69920A3A1E016F9700E7E6EE /* X2tConverter.xcodeproj */;
}, },
); );
projectRoot = ""; projectRoot = "";
...@@ -200,11 +201,11 @@ ...@@ -200,11 +201,11 @@
/* End PBXProject section */ /* End PBXProject section */
/* Begin PBXReferenceProxy section */ /* Begin PBXReferenceProxy section */
696535371D9E85B00093C60D /* libX2tConverter.a */ = { 69920A401E016F9700E7E6EE /* libX2tConverter.a */ = {
isa = PBXReferenceProxy; isa = PBXReferenceProxy;
fileType = archive.ar; fileType = archive.ar;
path = libX2tConverter.a; path = libX2tConverter.a;
remoteRef = 696535361D9E85B00093C60D /* PBXContainerItemProxy */; remoteRef = 69920A3F1E016F9700E7E6EE /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR; sourceTree = BUILT_PRODUCTS_DIR;
}; };
/* End PBXReferenceProxy section */ /* End PBXReferenceProxy section */
...@@ -240,10 +241,10 @@ ...@@ -240,10 +241,10 @@
/* End PBXSourcesBuildPhase section */ /* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */ /* Begin PBXTargetDependency section */
696535391D9E85B40093C60D /* PBXTargetDependency */ = { 69920A421E016F9F00E7E6EE /* PBXTargetDependency */ = {
isa = PBXTargetDependency; isa = PBXTargetDependency;
name = x2tconverter; name = x2tconverter;
targetProxy = 696535381D9E85B40093C60D /* PBXContainerItemProxy */; targetProxy = 69920A411E016F9F00E7E6EE /* PBXContainerItemProxy */;
}; };
/* End PBXTargetDependency section */ /* End PBXTargetDependency section */
...@@ -350,10 +351,11 @@ ...@@ -350,10 +351,11 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
DEVELOPMENT_TEAM = 2WH24U26GJ;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
INFOPLIST_FILE = TestIOSX2tConverter/Info.plist; INFOPLIST_FILE = TestIOSX2tConverter/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0; IPHONEOS_DEPLOYMENT_TARGET = 9.3;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
OTHER_LDFLAGS = ( OTHER_LDFLAGS = (
"-lstdc++", "-lstdc++",
...@@ -369,10 +371,11 @@ ...@@ -369,10 +371,11 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
DEVELOPMENT_TEAM = 2WH24U26GJ;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
INFOPLIST_FILE = TestIOSX2tConverter/Info.plist; INFOPLIST_FILE = TestIOSX2tConverter/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0; IPHONEOS_DEPLOYMENT_TARGET = 9.3;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
OTHER_LDFLAGS = ( OTHER_LDFLAGS = (
"-lstdc++", "-lstdc++",
......
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