Compare commits

...

15 Commits

1275 changed files with 3607 additions and 11229 deletions

View File

@ -57,11 +57,11 @@ namespace XMLTools
class XMLAttribute
========================================================================================================*/
template <class T> class XMLAttribute
class XMLAttribute
{
private:
std::basic_string<T> m_Name;
std::basic_string<T> m_Value;
std::wstring m_Name;
std::wstring m_Value;
public:
@ -69,56 +69,40 @@ namespace XMLTools
{
}
/*========================================================================================================*/
XMLAttribute( const T* name ) : m_Name(name)
XMLAttribute( const std::wstring & name ) : m_Name(name)
{
}
/*========================================================================================================*/
XMLAttribute( const T* name, const T* value ) : m_Name(name), m_Value(value)
XMLAttribute( const std::wstring & name, const std::wstring & value ) : m_Name(name), m_Value(value)
{
}
~XMLAttribute()
{
}
/*========================================================================================================*/
~XMLAttribute()
void SetValue( const std::wstring & value )
{
m_Value = std::wstring( value );
}
/*========================================================================================================*/
void SetValue( const T* value )
{
m_Value = std::basic_string<T>( value );
}
/*========================================================================================================*/
std::basic_string<T> GetName() const
std::wstring GetName() const
{
return m_Name;
}
/*========================================================================================================*/
std::basic_string<T> GetValue() const
std::wstring GetValue() const
{
return m_Value;
}
/*========================================================================================================*/
std::basic_string<T> GetXMLString()
std::wstring GetXMLString()
{
std::basic_string<T> xmlString( L"" );
std::wstring xmlString( L"" );
xmlString += m_Name;
xmlString += std::basic_string<T>( L"=\"" );
xmlString += std::wstring( L"=\"" );
xmlString += m_Value;
xmlString += std::basic_string<T>( L"\"" );
xmlString += std::wstring( L"\"" );
return xmlString;
}
@ -128,86 +112,63 @@ namespace XMLTools
class XMLElement
========================================================================================================*/
template <class T> class XMLElement
class XMLElement
{
typedef std::pair< std::basic_string<T>, std::basic_string<T> > AttributeValuePair;
typedef std::pair< std::wstring, std::wstring> AttributeValuePair;
private:
std::basic_string<T> m_Name;
std::basic_string<T> m_ElementText;
std::map<std::basic_string<T>, std::basic_string<T>> m_AttributeMap;
std::map<std::basic_string<T>, int> m_ChildMap; //for uniq
std::list<XMLElement<T>> m_Elements;
std::wstring m_Name;
std::wstring m_ElementText;
std::map<std::wstring, std::wstring> m_AttributeMap;
std::map<std::wstring, int> m_ChildMap; //for uniq
std::list<XMLElement> m_Elements;
typedef typename std::list<XMLElement<T>>::iterator ElementsIterator;
typedef typename std::list<XMLElement<T>>::const_iterator ElementsIteratorConst;
typedef std::list<XMLElement>::iterator ElementsIterator;
typedef std::list<XMLElement>::const_iterator ElementsIteratorConst;
typedef typename std::map<std::basic_string<T>, std::basic_string<T>>::iterator AttMapIterator;
typedef typename std::map<std::basic_string<T>, std::basic_string<T>>::const_iterator AttMapIteratorConst;
typedef std::map<std::wstring, std::wstring>::iterator AttMapIterator;
typedef std::map<std::wstring, std::wstring>::const_iterator AttMapIteratorConst;
public:
XMLElement()
XMLElement() {}
XMLElement( const std::wstring & name ) : m_Name(name)
{
}
/*========================================================================================================*/
XMLElement( const T* name ) : m_Name(name)
XMLElement( const std::wstring & prefix, const std::wstring & localName ) :
m_Name( std::wstring( prefix ) + std::wstring( L":" ) + std::wstring( localName ) ), m_ElementText( L"" )
{
}
~XMLElement() {}
/*========================================================================================================*/
XMLElement( const T* prefix, const T* localName ) : m_Name( std::basic_string<T>( prefix ) + std::basic_string<T>( L":" ) + std::basic_string<T>( localName ) ), m_ElementText( L"" )
void AppendText( const std::wstring & text )
{
m_ElementText = std::wstring( text );
}
/*========================================================================================================*/
~XMLElement()
void AppendTextSymbol( const wchar_t symbol )
{
m_ElementText += std::wstring( &symbol );
}
/*========================================================================================================*/
void AppendText( const T* text )
{
m_ElementText = std::basic_string<T>( text );
}
/*========================================================================================================*/
void AppendTextSymbol( const T symbol )
{
m_ElementText += std::basic_string<T>( &symbol );
}
/*========================================================================================================*/
void AppendAttribute( const XMLAttribute<T>& attribute )
void AppendAttribute( const XMLAttribute& attribute )
{
AttributeValuePair p( attribute.GetName(), attribute.GetValue() );
m_AttributeMap.insert( p );
}
/*========================================================================================================*/
void AppendAttribute( const T* name, const T* value )
void AppendAttribute( const std::wstring & name, const std::wstring & value )
{
AttributeValuePair p( std::basic_string<T>( const_cast<T*>( name ) ), std::basic_string<T>( const_cast<T*>( value ) ) );
AttributeValuePair p( name , value );
m_AttributeMap.insert( p );
}
/*========================================================================================================*/
void AppendChild( const XMLElement<T>& element, bool uniq = false)
void AppendChild( const XMLElement& element, bool uniq = false)
{
if (m_ChildMap.find(element.GetName()) != m_ChildMap.end())
{
@ -215,21 +176,17 @@ namespace XMLTools
}
else
{
m_ChildMap.insert(m_ChildMap.end(), std::pair<std::basic_string<T>, int>(element.GetName(), 0));
m_ChildMap.insert(m_ChildMap.end(), std::pair<std::wstring, int>(element.GetName(), 0));
}
m_Elements.push_back( element );
}
/*========================================================================================================*/
void RemoveChild( const XMLElement<T>& element )
void RemoveChild( const XMLElement& element )
{
m_Elements.remove( element );
}
/*========================================================================================================*/
bool FindChild( const XMLElement<T>& element )
bool FindChild( const XMLElement& element )
{
bool result = false;
@ -246,15 +203,13 @@ namespace XMLTools
return result;
}
/*========================================================================================================*/
bool FindChildByName( const T* elementName ) const
bool FindChildByName( const std::wstring & elementName ) const
{
bool result = false;
for ( ElementsIterator iter = m_Elements.begin(); iter != m_Elements.end(); iter++ )
for ( ElementsIteratorConst iter = m_Elements.begin(); iter != m_Elements.end(); iter++ )
{
if ( iter->m_Name == std::basic_string<T>( elementName ) )
if ( iter->m_Name == std::wstring( elementName ) )
{
result = true;
@ -265,9 +220,7 @@ namespace XMLTools
return result;
}
/*========================================================================================================*/
bool RemoveChildByName( const std::basic_string<T>& elementName )
bool RemoveChildByName( const std::wstring& elementName )
{
bool result = false;
@ -286,9 +239,7 @@ namespace XMLTools
return result;
}
/*========================================================================================================*/
bool operator == ( const XMLElement<T>& element ) const
bool operator == ( const XMLElement& element ) const
{
bool result = false;
@ -319,7 +270,7 @@ namespace XMLTools
}
else
{
ElementsIteratorConst thisIter = m_Elements.begin();
ElementsIteratorConst thisIter = m_Elements.begin();
ElementsIteratorConst elementIter = element.m_Elements.begin();
for ( ; thisIter != m_Elements.end(); thisIter++, elementIter++ )
@ -336,34 +287,34 @@ namespace XMLTools
/*========================================================================================================*/
std::basic_string<T> GetName() const
std::wstring GetName() const
{
return m_Name;
}
/*========================================================================================================*/
std::basic_string<T> GetXMLString()
std::wstring GetXMLString()
{
std::basic_string<T> xmlString( L"");
std::wstring xmlString( L"");
bool bIsNameExists = ( m_Name != std::basic_string<T>( L"") );
bool bIsTextExists = ( m_ElementText != std::basic_string<T>( L"") );
bool bIsNameExists = ( m_Name != std::wstring( L"") );
bool bIsTextExists = ( m_ElementText != std::wstring( L"") );
if ( bIsNameExists )
{
xmlString += std::basic_string<T>( L"<" ) + m_Name;
xmlString += std::wstring( L"<" ) + m_Name;
}
if ( ( bIsNameExists ) && ( m_AttributeMap.size() > 0 ) )
{
for ( AttMapIterator iter = m_AttributeMap.begin(); iter != m_AttributeMap.end(); iter++ )
{
xmlString += std::basic_string<T>( L" " );
xmlString += std::wstring( L" " );
xmlString += iter->first;
xmlString += std::basic_string<T>( L"=\"" );
xmlString += std::wstring( L"=\"" );
xmlString += iter->second;
xmlString += std::basic_string<T>( L"\"" );
xmlString += std::wstring( L"\"" );
}
}
@ -371,7 +322,7 @@ namespace XMLTools
{
if ( bIsNameExists )
{
xmlString += std::basic_string<T>( L">" );
xmlString += std::wstring( L">" );
}
for ( ElementsIterator iter = m_Elements.begin(); iter != m_Elements.end(); iter++ )
@ -386,16 +337,16 @@ namespace XMLTools
if ( bIsNameExists )
{
xmlString += std::basic_string<T>( L"</" );
xmlString += std::wstring( L"</" );
xmlString += m_Name;
xmlString += std::basic_string<T>( L">" );
xmlString += std::wstring( L">" );
}
}
else
{
if ( bIsNameExists )
{
xmlString += std::basic_string<T>( L"/>" );
xmlString += std::wstring( L"/>" );
}
}

View File

@ -38,7 +38,7 @@ namespace DocFileFormat
: PropertiesMapping( writer ), _isRunStyleNeeded(isRunStyleNeeded), _isOwnRPr(true), _isRTL(false)
{
_doc = doc;
_rPr = new XMLTools::XMLElement<wchar_t>( _T( "w:rPr" ) );
_rPr = new XMLTools::XMLElement( _T( "w:rPr" ) );
_revisionData = rev;
_currentPapx = currentPapx;
_styleChpx = styleChpx;
@ -46,7 +46,7 @@ namespace DocFileFormat
_webHidden = false;
}
CharacterPropertiesMapping::CharacterPropertiesMapping( XMLTools::XMLElement<wchar_t>* rPr, WordDocument* doc, RevisionData* rev, ParagraphPropertyExceptions* currentPapx, bool styleChpx, bool isRunStyleNeeded )
CharacterPropertiesMapping::CharacterPropertiesMapping( XMLTools::XMLElement* rPr, WordDocument* doc, RevisionData* rev, ParagraphPropertyExceptions* currentPapx, bool styleChpx, bool isRunStyleNeeded )
: PropertiesMapping( NULL ), _isRunStyleNeeded(isRunStyleNeeded), _isOwnRPr(false), _isRTL(false)
{
_doc = doc;
@ -77,7 +77,7 @@ namespace DocFileFormat
// apend revision changes
if (_revisionData->Type == Changed)
{
XMLTools::XMLElement<wchar_t> rPrChange( _T( "w:rPrChange" ) );
XMLTools::XMLElement rPrChange( _T( "w:rPrChange" ) );
//todooo date - _revisionData->Dttm.Convert( new DateMapping( rPrChange ) );
@ -85,7 +85,7 @@ namespace DocFileFormat
if (author_str)
{
XMLTools::XMLAttribute<wchar_t> author( _T( "w:author" ), FormatUtils::XmlEncode(*author_str).c_str());
XMLTools::XMLAttribute author( _T( "w:author" ), FormatUtils::XmlEncode(*author_str).c_str());
rPrChange.AppendAttribute( author );
}
@ -116,16 +116,16 @@ namespace DocFileFormat
/*========================================================================================================*/
void CharacterPropertiesMapping::convertSprms( std::list<SinglePropertyModifier>* sprms, XMLTools::XMLElement<wchar_t>* parent )
void CharacterPropertiesMapping::convertSprms( std::list<SinglePropertyModifier>* sprms, XMLTools::XMLElement* parent )
{
XMLTools::XMLElement<wchar_t> * rFonts = new XMLTools::XMLElement<wchar_t> ( _T( "w:rFonts" ) );
XMLTools::XMLElement<wchar_t> * color = new XMLTools::XMLElement<wchar_t> ( _T( "w:color" ) );
XMLTools::XMLAttribute<wchar_t> * colorVal = new XMLTools::XMLAttribute<wchar_t> ( _T( "w:val" ) );
XMLTools::XMLElement<wchar_t> * lang = new XMLTools::XMLElement<wchar_t> ( _T( "w:lang" ) );
XMLTools::XMLElement * rFonts = new XMLTools::XMLElement ( _T( "w:rFonts" ) );
XMLTools::XMLElement * color = new XMLTools::XMLElement ( _T( "w:color" ) );
XMLTools::XMLAttribute * colorVal = new XMLTools::XMLAttribute ( _T( "w:val" ) );
XMLTools::XMLElement * lang = new XMLTools::XMLElement ( _T( "w:lang" ) );
if (_webHidden)
{
XMLTools::XMLElement<wchar_t> * webHidden = new XMLTools::XMLElement<wchar_t> ( _T( "w:webHidden" ) );
XMLTools::XMLElement * webHidden = new XMLTools::XMLElement ( _T( "w:webHidden" ) );
parent->AppendChild( *webHidden );
RELEASEOBJECT( webHidden );
}
@ -274,7 +274,7 @@ namespace DocFileFormat
case sprmCBrc80:
case sprmCBrc:
{ //borders
XMLTools::XMLElement<wchar_t> bdr( _T( "w:bdr" ) );
XMLTools::XMLElement bdr( _T( "w:bdr" ) );
BorderCode bc( iter->Arguments, iter->argumentsSize );
appendBorderAttributes( &bc, &bdr );
parent->AppendChild( bdr );
@ -300,10 +300,7 @@ namespace DocFileFormat
std::wstringstream sstream;
sstream << boost::wformat(L"%02x%02x%02x") % iter->Arguments[0] % /*G*/iter->Arguments[1] % /*B*/iter->Arguments[2];
colorVal->SetValue(sstream.str().c_str());
//CString rgbColor;
//rgbColor.Format( _T( "%02x%02x%02x" ), /*R*/iter->Arguments[0], /*G*/iter->Arguments[1], /*B*/iter->Arguments[2] );
//colorVal->SetValue( rgbColor.GetString() );
colorVal->SetValue(sstream.str());
}break;
case sprmCOldHighlight:
@ -379,7 +376,7 @@ namespace DocFileFormat
if( nIndex < _doc->FontTable->Data.size() )
{
XMLTools::XMLAttribute<wchar_t>* ascii = new XMLTools::XMLAttribute<wchar_t>( _T( "w:ascii" ) );
XMLTools::XMLAttribute* ascii = new XMLTools::XMLAttribute( _T( "w:ascii" ) );
FontFamilyName* ffn = static_cast<FontFamilyName*>( _doc->FontTable->operator [] ( nIndex ) );
m_sAsciiFont = ffn->xszFtn;
ascii->SetValue( FormatUtils::XmlEncode(m_sAsciiFont).c_str() );
@ -393,7 +390,7 @@ namespace DocFileFormat
int nIndex = FormatUtils::BytesToUInt16( iter->Arguments, 0, iter->argumentsSize );
if( nIndex >= 0 && nIndex < _doc->FontTable->Data.size() )
{
XMLTools::XMLAttribute<wchar_t>* eastAsia = new XMLTools::XMLAttribute<wchar_t>( _T( "w:eastAsia" ) );
XMLTools::XMLAttribute* eastAsia = new XMLTools::XMLAttribute( _T( "w:eastAsia" ) );
FontFamilyName* ffn = static_cast<FontFamilyName*>( _doc->FontTable->operator [] ( nIndex ) );
m_sEastAsiaFont = ffn->xszFtn;
eastAsia->SetValue( FormatUtils::XmlEncode(m_sEastAsiaFont).c_str() );
@ -408,7 +405,7 @@ namespace DocFileFormat
int nIndex = FormatUtils::BytesToUInt16( iter->Arguments, 0, iter->argumentsSize );
if( nIndex>=0 && nIndex < _doc->FontTable->Data.size() )
{
XMLTools::XMLAttribute<wchar_t>* ansi = new XMLTools::XMLAttribute<wchar_t>( _T( "w:hAnsi" ) );
XMLTools::XMLAttribute* ansi = new XMLTools::XMLAttribute( _T( "w:hAnsi" ) );
FontFamilyName* ffn = static_cast<FontFamilyName*>( _doc->FontTable->operator [] ( nIndex ) );
m_shAnsiFont = ffn->xszFtn;
ansi->SetValue( FormatUtils::XmlEncode(m_shAnsiFont).c_str() );
@ -485,7 +482,7 @@ namespace DocFileFormat
if (!m_sDefaultFont.empty() && m_sAsciiFont.empty() && m_sEastAsiaFont.empty() && m_shAnsiFont.empty())
{//????
XMLTools::XMLAttribute<wchar_t>* ascii = new XMLTools::XMLAttribute<wchar_t>( _T( "w:ascii" ) );
XMLTools::XMLAttribute* ascii = new XMLTools::XMLAttribute( _T( "w:ascii" ) );
ascii->SetValue( FormatUtils::XmlEncode(m_sDefaultFont).c_str() );
//rFonts->AppendAttribute( *ascii );
RELEASEOBJECT( ascii );
@ -520,14 +517,14 @@ namespace DocFileFormat
/// CHPX flags are special flags because the can be 0,1,128 and 129,
/// so this method overrides the appendFlagElement method.
void CharacterPropertiesMapping::appendFlagElement( XMLTools::XMLElement<wchar_t>* node, const SinglePropertyModifier& sprm, const wchar_t* elementName, bool unique )
void CharacterPropertiesMapping::appendFlagElement( XMLTools::XMLElement* node, const SinglePropertyModifier& sprm, const wchar_t* elementName, bool unique )
{
unsigned char flag = sprm.Arguments[0];
if( flag != 128 )
{
XMLTools::XMLElement<wchar_t>* ele = new XMLTools::XMLElement<wchar_t>( _T( "w" ), elementName );
XMLTools::XMLAttribute<wchar_t>* val = new XMLTools::XMLAttribute<wchar_t>( _T( "w:val" ) );
XMLTools::XMLElement* ele = new XMLTools::XMLElement( _T( "w" ), elementName );
XMLTools::XMLAttribute* val = new XMLTools::XMLAttribute( _T( "w:val" ) );
if ( unique )
{

View File

@ -55,7 +55,7 @@ namespace DocFileFormat
{
public:
CharacterPropertiesMapping( XMLTools::CStringXmlWriter* writer, WordDocument* doc, RevisionData* rev, ParagraphPropertyExceptions* currentPapx, bool styleChpx, bool isRunStyleNeeded = true );
CharacterPropertiesMapping( XMLTools::XMLElement<wchar_t>* rPr, WordDocument* doc, RevisionData* rev, ParagraphPropertyExceptions* currentPapx, bool styleChpx, bool isRunStyleNeeded = true );
CharacterPropertiesMapping( XMLTools::XMLElement* rPr, WordDocument* doc, RevisionData* rev, ParagraphPropertyExceptions* currentPapx, bool styleChpx, bool isRunStyleNeeded = true );
virtual ~CharacterPropertiesMapping();
void Apply( IVisitable* chpx );
bool CheckIsSymbolFont();
@ -63,7 +63,7 @@ namespace DocFileFormat
bool _webHidden;
bool _isRTL;
private:
void convertSprms( std::list<SinglePropertyModifier>* sprms, XMLTools::XMLElement<wchar_t>* parent );
void convertSprms( std::list<SinglePropertyModifier>* sprms, XMLTools::XMLElement* parent );
std::list<CharacterPropertyExceptions*> buildHierarchy( const StyleSheet* styleSheet, unsigned short istdStart );
bool applyToggleHierachy( const SinglePropertyModifier& sprm );
bool toogleValue( bool currentValue, unsigned char toggle );
@ -71,13 +71,13 @@ namespace DocFileFormat
protected:
/// CHPX flags are special flags because the can be 0,1,128 and 129,
/// so this method overrides the appendFlagElement method.
virtual void appendFlagElement( XMLTools::XMLElement<wchar_t>* node, const SinglePropertyModifier& sprm, const wchar_t* elementName, bool unique );
virtual void appendFlagElement( XMLTools::XMLElement* node, const SinglePropertyModifier& sprm, const wchar_t* elementName, bool unique );
private:
XMLTools::CStringXmlWriter pRunPr;
WordDocument* _doc;
XMLTools::XMLElement<wchar_t>* _rPr;
XMLTools::XMLElement* _rPr;
unsigned short _currentIstd;
RevisionData* _revisionData;
bool _styleChpx;

View File

@ -491,7 +491,7 @@ namespace DocFileFormat
text.clear();
XMLTools::XMLElement<wchar_t> elem(_T("w:tab"));
XMLTools::XMLElement elem(_T("w:tab"));
m_pXmlWriter->WriteString(elem.GetXMLString().c_str());
}
@ -501,7 +501,7 @@ namespace DocFileFormat
text.clear();
XMLTools::XMLElement<wchar_t> elem(_T("w:br"));
XMLTools::XMLElement elem(_T("w:br"));
elem.AppendAttribute(_T("w:type"), _T("textWrapping"));
elem.AppendAttribute(_T("w:clear"), _T("all"));
@ -520,7 +520,7 @@ namespace DocFileFormat
text.clear();
XMLTools::XMLElement<wchar_t> elem(_T("w:br"));
XMLTools::XMLElement elem(_T("w:br"));
elem.AppendAttribute(_T("w:type"), _T("page"));
m_pXmlWriter->WriteString(elem.GetXMLString().c_str());
@ -532,7 +532,7 @@ namespace DocFileFormat
text.clear();
XMLTools::XMLElement<wchar_t> elem(_T("w:br"));
XMLTools::XMLElement elem(_T("w:br"));
elem.AppendAttribute(_T("w:type"), _T("column"));
m_pXmlWriter->WriteString(elem.GetXMLString().c_str());
@ -777,7 +777,7 @@ namespace DocFileFormat
{
if (_fldCharCounter > 0)
{
XMLTools::XMLElement<wchar_t> elem( _T( "w:fldChar" ) );
XMLTools::XMLElement elem( _T( "w:fldChar" ) );
elem.AppendAttribute( _T( "w:fldCharType" ), _T( "separate" ) );
m_pXmlWriter->WriteString( elem.GetXMLString().c_str() );
@ -788,7 +788,7 @@ namespace DocFileFormat
{
if (_fldCharCounter > 0)
{
XMLTools::XMLElement<wchar_t> elem( _T( "w:fldChar" ) );
XMLTools::XMLElement elem( _T( "w:fldChar" ) );
elem.AppendAttribute( _T( "w:fldCharType" ), _T( "end" ) );
m_pXmlWriter->WriteString( elem.GetXMLString().c_str() );
@ -1570,7 +1570,7 @@ namespace DocFileFormat
if ((bookmarkName != NULL) && (*bookmarkName != _T("_PictureBullets")))
{
XMLTools::XMLElement<wchar_t> bookmarkElem(_T("w:bookmarkStart"));
XMLTools::XMLElement bookmarkElem(_T("w:bookmarkStart"));
bookmarkElem.AppendAttribute(_T("w:id"), FormatUtils::IntToWideString(id).c_str());
bookmarkElem.AppendAttribute(_T("w:name"), bookmarkName->c_str());
@ -1591,7 +1591,7 @@ namespace DocFileFormat
if ( ( bookmarkName != NULL ) && ( *bookmarkName != _T( "_PictureBullets" ) ) )
{
XMLTools::XMLElement<wchar_t> bookmarkElem( _T( "w:bookmarkEnd" ) );
XMLTools::XMLElement bookmarkElem( _T( "w:bookmarkEnd" ) );
bookmarkElem.AppendAttribute( _T( "w:id" ), FormatUtils::IntToWideString( id ).c_str() );

View File

@ -40,7 +40,7 @@ namespace DocFileFormat
_type = type;
}
LanguageIdMapping::LanguageIdMapping (XMLTools::XMLElement<wchar_t>* parentElement, LanguageType type) : PropertiesMapping(NULL)
LanguageIdMapping::LanguageIdMapping (XMLTools::XMLElement* parentElement, LanguageType type) : PropertiesMapping(NULL)
{
_parent = parentElement;
_type = type;
@ -59,31 +59,31 @@ namespace DocFileFormat
{
std::wstring langcode = getLanguageCode( dynamic_cast<LanguageId*>( lid ) );
XMLTools::XMLAttribute<wchar_t>* att = NULL;
XMLTools::XMLAttribute* att = NULL;
switch ( _type )
{
case Default:
{
att = new XMLTools::XMLAttribute<wchar_t>( L"w:val", langcode.c_str() );
att = new XMLTools::XMLAttribute( L"w:val", langcode.c_str() );
}
break;
case EastAsian:
{
att = new XMLTools::XMLAttribute<wchar_t>( L"w:eastAsia", langcode.c_str() );
att = new XMLTools::XMLAttribute( L"w:eastAsia", langcode.c_str() );
}
break;
case Complex:
{
att = new XMLTools::XMLAttribute<wchar_t>( L"w:bidi", langcode.c_str() );
att = new XMLTools::XMLAttribute( L"w:bidi", langcode.c_str() );
}
break;
default:
{
att = new XMLTools::XMLAttribute<wchar_t>( L"w:val", langcode.c_str() );
att = new XMLTools::XMLAttribute( L"w:val", langcode.c_str() );
}
break;
}

View File

@ -49,14 +49,14 @@ namespace DocFileFormat
{
public:
LanguageIdMapping( XMLTools::CStringXmlWriter* writer, LanguageType type );
LanguageIdMapping( XMLTools::XMLElement<wchar_t>* parentElement, LanguageType type );
LanguageIdMapping( XMLTools::XMLElement* parentElement, LanguageType type );
virtual ~LanguageIdMapping();
void Apply( IVisitable* lid );
static std::wstring getLanguageCode( LanguageId* lid );
private:
LanguageType _type;
XMLTools::XMLElement<wchar_t>* _parent;
LanguageType _type;
XMLTools::XMLElement* _parent;
};
}

View File

@ -42,8 +42,8 @@ namespace DocFileFormat
m_document = document;
m_context = context;
_pPr = new XMLTools::XMLElement<wchar_t>( _T( "w:pPr" ) );
_framePr = new XMLTools::XMLElement<wchar_t>( _T( "w:framePr" ) );
_pPr = new XMLTools::XMLElement( _T( "w:pPr" ) );
_framePr = new XMLTools::XMLElement( _T( "w:framePr" ) );
_paraEndChpx = paraEndChpx;
_isBidi = isBidi;
@ -57,8 +57,8 @@ namespace DocFileFormat
m_document = document;
m_context = context;
_pPr = new XMLTools::XMLElement<wchar_t>( _T( "w:pPr" ) );
_framePr = new XMLTools::XMLElement<wchar_t>( _T( "w:framePr" ) );
_pPr = new XMLTools::XMLElement( _T( "w:pPr" ) );
_framePr = new XMLTools::XMLElement( _T( "w:framePr" ) );
_paraEndChpx = paraEndChpx;
_isBidi = isBidi;
@ -82,17 +82,17 @@ namespace DocFileFormat
{
ParagraphPropertyExceptions* papx = static_cast<ParagraphPropertyExceptions*>( visited );
XMLTools::XMLElement<wchar_t> ind ( _T( "w:ind" ) );
XMLTools::XMLElement<wchar_t> numPr ( _T( "w:numPr" ) );
XMLTools::XMLElement<wchar_t> pBdr ( _T( "w:pBdr" ) );
XMLTools::XMLElement<wchar_t> spacing ( _T( "w:spacing" ) );
XMLTools::XMLElement<wchar_t>* jc = NULL;
XMLTools::XMLElement ind ( _T( "w:ind" ) );
XMLTools::XMLElement numPr ( _T( "w:numPr" ) );
XMLTools::XMLElement pBdr ( _T( "w:pBdr" ) );
XMLTools::XMLElement spacing ( _T( "w:spacing" ) );
XMLTools::XMLElement* jc = NULL;
if ( _isParagraphStyleNeeded )
{
//append style id , do not append "Normal" style (istd 0)
XMLTools::XMLElement<wchar_t> pStyle( _T( "w:pStyle" ) );
XMLTools::XMLAttribute<wchar_t> styleId( _T( "w:val" ), StyleIdentifierMap[0] );
XMLTools::XMLElement pStyle( _T( "w:pStyle" ) );
XMLTools::XMLAttribute styleId( _T( "w:val" ), StyleIdentifierMap[0] );
if ( papx->istd < m_document->Styles->Styles->size() )
{
@ -106,7 +106,7 @@ namespace DocFileFormat
//append formatting of paragraph end mark
if ( _paraEndChpx != NULL )
{
XMLTools::XMLElement<wchar_t>* rPr = new XMLTools::XMLElement<wchar_t>( _T( "w:rPr" ) );
XMLTools::XMLElement* rPr = new XMLTools::XMLElement( _T( "w:rPr" ) );
//append properties
RevisionData* rev = new RevisionData( _paraEndChpx );
@ -116,7 +116,7 @@ namespace DocFileFormat
//append delete infos
if ( rev->Type == Deleted )
{
XMLTools::XMLElement<wchar_t> del( _T( "w:del" ) );
XMLTools::XMLElement del( _T( "w:del" ) );
rPr->AppendChild( del );
}
@ -283,10 +283,10 @@ namespace DocFileFormat
{
LineSpacingDescriptor lspd( iter->Arguments, iter->argumentsSize );
XMLTools::XMLAttribute<wchar_t> line( _T( "w:line" ), FormatUtils::IntToWideString( abs( lspd.dyaLine ) ).c_str() );
XMLTools::XMLAttribute line( _T( "w:line" ), FormatUtils::IntToWideString( abs( lspd.dyaLine ) ).c_str() );
spacing.AppendAttribute( line );
XMLTools::XMLAttribute<wchar_t> lineRule( _T( "w:lineRule" ), _T( "auto" ) );
XMLTools::XMLAttribute lineRule( _T( "w:lineRule" ), _T( "auto" ) );
if( ( !lspd.fMultLinespace ) && ( lspd.dyaLine < 0 ) )
{
@ -311,10 +311,10 @@ namespace DocFileFormat
iter->Arguments[0] = (iter->Arguments[0] == 0 ? 2 : 0);
}
RELEASEOBJECT( jc );
jc = new XMLTools::XMLElement<wchar_t>( L"w:jc" );
jc = new XMLTools::XMLElement( L"w:jc" );
if ( jc )
{
XMLTools::XMLAttribute<wchar_t> jcVal( L"w:val", FormatUtils::MapValueToWideString( iter->Arguments[0], &Global::JustificationCode[0][0], 10, 15 ).c_str() );
XMLTools::XMLAttribute jcVal( L"w:val", FormatUtils::MapValueToWideString( iter->Arguments[0], &Global::JustificationCode[0][0], 10, 15 ).c_str() );
jc->AppendAttribute( jcVal );
}
}break;
@ -325,7 +325,7 @@ namespace DocFileFormat
//case 0x4424:
case sprmPBrcTop80:
{
XMLTools::XMLElement<wchar_t> topBorder( _T( "w:top" ) );
XMLTools::XMLElement topBorder( _T( "w:top" ) );
BorderCode bc( iter->Arguments, iter->argumentsSize );
@ -340,7 +340,7 @@ namespace DocFileFormat
//case 0x4425:
case sprmPBrcLeft80:
{
XMLTools::XMLElement<wchar_t> leftBorder( _T( "w:left" ) );
XMLTools::XMLElement leftBorder( _T( "w:left" ) );
BorderCode bc( iter->Arguments, iter->argumentsSize );
@ -355,7 +355,7 @@ namespace DocFileFormat
//case 0x4426:
case sprmPBrcBottom80:
{
XMLTools::XMLElement<wchar_t> bottomBorder( _T( "w:bottom" ) );
XMLTools::XMLElement bottomBorder( _T( "w:bottom" ) );
BorderCode bc( iter->Arguments, iter->argumentsSize );
@ -370,7 +370,7 @@ namespace DocFileFormat
//case 0x4427:
case sprmPBrcRight80:
{
XMLTools::XMLElement<wchar_t> rightBorder( _T( "w:right" ) );
XMLTools::XMLElement rightBorder( _T( "w:right" ) );
BorderCode bc( iter->Arguments, iter->argumentsSize );
@ -385,7 +385,7 @@ namespace DocFileFormat
//case 0x4428:
case sprmPBrcBetween80:
{
XMLTools::XMLElement<wchar_t> betweenBorder( _T( "w:between" ) );
XMLTools::XMLElement betweenBorder( _T( "w:between" ) );
BorderCode bc( iter->Arguments, iter->argumentsSize );
@ -400,7 +400,7 @@ namespace DocFileFormat
//case 0x4629:
case sprmPBrcBar80:
{
XMLTools::XMLElement<wchar_t> barBorder( _T( "w:bar" ) );
XMLTools::XMLElement barBorder( _T( "w:bar" ) );
BorderCode bc( iter->Arguments, iter->argumentsSize );
@ -438,10 +438,10 @@ namespace DocFileFormat
}break;
case sprmOldPNLvlAnm:
{
{ short level = FormatUtils::BytesToUChar( iter->Arguments, 0, iter->argumentsSize) - 1;
if (level > 0 && level < 10)
appendValueElement( _pPr, _T( "outlineLvl" ), level, false );
appendValueElement( _pPr, _T( "outlineLvl" ), level, false );
}break; case sprmOldPFNoLineNumb:
{
}break;
@ -480,7 +480,7 @@ namespace DocFileFormat
case sprmPChgTabsPapx:
case sprmPChgTabs:
{
case sprmPChgTabsPapx:
XMLTools::XMLElement tabs( _T( "w:tabs" ) );
int pos = 0;
@ -491,14 +491,14 @@ namespace DocFileFormat
for( int i=0; i < itbdDelMax; i++ )
{
XMLTools::XMLElement tab( _T( "w:tab" ) );
//clear
XMLTools::XMLElement<wchar_t> tab( _T( "w:tab" ) );
XMLTools::XMLAttribute tabsVal( _T( "w:val" ), _T( "clear" ) );
tab.AppendAttribute( tabsVal );
//position
tab.AppendAttribute( tabsVal );
XMLTools::XMLAttribute tabsPos( _T( "w:pos" ), FormatUtils::IntToWideString( FormatUtils::BytesToInt16( iter->Arguments, pos, iter->argumentsSize ) ).c_str() );
tab.AppendAttribute( tabsPos );
tabs.AppendChild( tab );
@ -523,18 +523,18 @@ namespace DocFileFormat
{
TabDescriptor tbd( iter->Arguments[pos + ( itbdAddMax * 2 ) + i] );
{
XMLTools::XMLElement tab( _T( "w:tab" ) );
//justification
XMLTools::XMLElement<wchar_t> tab( _T( "w:tab" ) );
XMLTools::XMLAttribute tabsVal( _T( "w:val" ), FormatUtils::MapValueToWideString( tbd.jc, &Global::TabStop[0][0], 7, 8 ).c_str() );
tab.AppendAttribute( tabsVal );
//tab leader type
tab.AppendAttribute( tabsVal );
XMLTools::XMLAttribute leader( _T( "w:leader" ), FormatUtils::MapValueToWideString( tbd.tlc, &Global::TabLeader[0][0], 8, 11 ).c_str() );
tab.AppendAttribute( leader );
//position
tab.AppendAttribute( leader );
XMLTools::XMLAttribute tabsPos( _T( "w:pos" ), FormatUtils::IntToWideString( FormatUtils::BytesToInt16( iter->Arguments, ( pos + (i * 2) ), iter->argumentsSize ) ).c_str() );
tab.AppendAttribute( tabsPos );
tabs.AppendChild( tab );
@ -632,7 +632,7 @@ namespace DocFileFormat
//append section properties
if ( _sepx != NULL )
{
//append section properties
XMLTools::XMLElement sectPr( _T( "w:sectPr" ) );
SectionPropertiesMapping* sectionPropertiesMapping = new SectionPropertiesMapping( &sectPr, m_context, _sectionNr );
_sepx->Convert( sectionPropertiesMapping );
@ -681,4 +681,4 @@ namespace DocFileFormat
m_pXmlWriter->WriteString( _pPr->GetXMLString().c_str() );
}
}
m_pXmlWriter->WriteString( _pPr->GetXMLString().c_str() );
}

View File

@ -57,8 +57,8 @@ namespace DocFileFormat
WordDocument* m_document;
ConversionContext* m_context;
XMLTools::XMLElement<wchar_t>* _pPr;
XMLTools::XMLElement<wchar_t>* _framePr;
XMLTools::XMLElement* _pPr;
XMLTools::XMLElement* _framePr;
SectionPropertyExceptions* _sepx;
CharacterPropertyExceptions* _paraEndChpx;
int _sectionNr;

View File

@ -244,22 +244,22 @@ namespace DocFileFormat
/*========================================================================================================*/
void PropertiesMapping::appendFlagAttribute( XMLTools::XMLElement<wchar_t>* node, const SinglePropertyModifier& sprm, const wchar_t* attributeName )
void PropertiesMapping::appendFlagAttribute( XMLTools::XMLElement* node, const SinglePropertyModifier& sprm, const wchar_t* attributeName )
{
XMLTools::XMLAttribute<wchar_t> att( attributeName, FormatUtils::IntToWideString( sprm.Arguments[0] ).c_str());
XMLTools::XMLAttribute att( attributeName, FormatUtils::IntToWideString( sprm.Arguments[0] ).c_str());
node->AppendAttribute( att );
}
/*========================================================================================================*/
void PropertiesMapping::appendFlagElement( XMLTools::XMLElement<wchar_t>* node, const SinglePropertyModifier& sprm, const wchar_t* elementName, bool unique )
void PropertiesMapping::appendFlagElement( XMLTools::XMLElement* node, const SinglePropertyModifier& sprm, const wchar_t* elementName, bool unique )
{
XMLTools::XMLElement<wchar_t> ele( L"w", elementName );
XMLTools::XMLElement ele( L"w", elementName );
if ( sprm.Arguments[0] == 0 )
{
XMLTools::XMLAttribute<wchar_t> val( L"w:val" , L"off" );
XMLTools::XMLAttribute val( L"w:val" , L"off" );
ele.AppendAttribute( val );
}
@ -274,58 +274,58 @@ namespace DocFileFormat
/*========================================================================================================*/
void PropertiesMapping::appendValueAttribute( XMLTools::XMLElement<wchar_t>* node, const wchar_t* attributeName, const wchar_t* attributeValue )
void PropertiesMapping::appendValueAttribute( XMLTools::XMLElement* node, const wchar_t* attributeName, const wchar_t* attributeValue )
{
XMLTools::XMLAttribute<wchar_t> att( attributeName, attributeValue );
XMLTools::XMLAttribute att( attributeName, attributeValue );
node->AppendAttribute( att );
}
/*========================================================================================================*/
void PropertiesMapping::appendValueAttribute( XMLTools::XMLElement<wchar_t>* node, const wchar_t* attributeName, int attributeValue )
void PropertiesMapping::appendValueAttribute( XMLTools::XMLElement* node, const wchar_t* attributeName, int attributeValue )
{
XMLTools::XMLAttribute<wchar_t> att( attributeName, FormatUtils::IntToWideString( attributeValue ).c_str());
XMLTools::XMLAttribute att( attributeName, FormatUtils::IntToWideString( attributeValue ).c_str());
node->AppendAttribute( att );
}
/*========================================================================================================*/
void PropertiesMapping::appendValueAttribute( XMLTools::XMLElement<wchar_t>* node, const wchar_t* attributeName, short attributeValue )
void PropertiesMapping::appendValueAttribute( XMLTools::XMLElement* node, const wchar_t* attributeName, short attributeValue )
{
XMLTools::XMLAttribute<wchar_t> att( attributeName, FormatUtils::IntToWideString( attributeValue ).c_str());
XMLTools::XMLAttribute att( attributeName, FormatUtils::IntToWideString( attributeValue ).c_str());
node->AppendAttribute( att );
}
/*========================================================================================================*/
void PropertiesMapping::appendValueAttribute( XMLTools::XMLElement<wchar_t>* node, const wchar_t* attributeName, unsigned short attributeValue )
void PropertiesMapping::appendValueAttribute( XMLTools::XMLElement* node, const wchar_t* attributeName, unsigned short attributeValue )
{
XMLTools::XMLAttribute<wchar_t> att( attributeName, FormatUtils::IntToWideString( attributeValue ).c_str());
XMLTools::XMLAttribute att( attributeName, FormatUtils::IntToWideString( attributeValue ).c_str());
node->AppendAttribute( att );
}
/*========================================================================================================*/
void PropertiesMapping::appendValueAttribute( XMLTools::XMLElement<wchar_t>* node, const wchar_t* attributeName, unsigned char attributeValue )
void PropertiesMapping::appendValueAttribute( XMLTools::XMLElement* node, const wchar_t* attributeName, unsigned char attributeValue )
{
XMLTools::XMLAttribute<wchar_t> att( attributeName, FormatUtils::IntToWideString( attributeValue ).c_str());
XMLTools::XMLAttribute att( attributeName, FormatUtils::IntToWideString( attributeValue ).c_str());
node->AppendAttribute( att );
}
/*========================================================================================================*/
void PropertiesMapping::appendValueElement( XMLTools::XMLElement<wchar_t>* node, const wchar_t* elementName, const wchar_t* elementValue, bool unique )
void PropertiesMapping::appendValueElement( XMLTools::XMLElement* node, const wchar_t* elementName, const wchar_t* elementValue, bool unique )
{
XMLTools::XMLElement<wchar_t>* ele = new XMLTools::XMLElement<wchar_t>( L"w" , elementName );
XMLTools::XMLElement* ele = new XMLTools::XMLElement( L"w" , elementName );
if( ( elementValue != NULL ) && ( wcscmp( elementValue, L"" ) != 0 ))
{
XMLTools::XMLAttribute<wchar_t>* val = new XMLTools::XMLAttribute<wchar_t>( L"w:val" );
XMLTools::XMLAttribute* val = new XMLTools::XMLAttribute( L"w:val" );
val->SetValue( elementValue );
@ -347,15 +347,15 @@ namespace DocFileFormat
/*========================================================================================================*/
void PropertiesMapping::appendValueElement( XMLTools::XMLElement<wchar_t>* node, const wchar_t* elementName, short elementValue, bool unique )
void PropertiesMapping::appendValueElement( XMLTools::XMLElement* node, const wchar_t* elementName, short elementValue, bool unique )
{
XMLTools::XMLElement<wchar_t>* ele = new XMLTools::XMLElement<wchar_t>( L"w" , elementName );
XMLTools::XMLElement* ele = new XMLTools::XMLElement( L"w" , elementName );
std::wstring strValue = FormatUtils::IntToWideString( elementValue );
if ( strValue != std::wstring( L""))
{
XMLTools::XMLAttribute<wchar_t>* val = new XMLTools::XMLAttribute<wchar_t>( L"w:val", strValue.c_str());
XMLTools::XMLAttribute* val = new XMLTools::XMLAttribute( L"w:val", strValue.c_str());
ele->AppendAttribute( *val );
RELEASEOBJECT( val );
}
@ -373,15 +373,15 @@ namespace DocFileFormat
/*========================================================================================================*/
void PropertiesMapping::appendValueElement( XMLTools::XMLElement<wchar_t>* node, const wchar_t* elementName, unsigned short elementValue, bool unique )
void PropertiesMapping::appendValueElement( XMLTools::XMLElement* node, const wchar_t* elementName, unsigned short elementValue, bool unique )
{
XMLTools::XMLElement<wchar_t>* ele = new XMLTools::XMLElement<wchar_t>( L"w" , elementName );
XMLTools::XMLElement* ele = new XMLTools::XMLElement( L"w" , elementName );
std::wstring strValue = FormatUtils::IntToWideString( elementValue );
if ( strValue != std::wstring( L"" ))
{
XMLTools::XMLAttribute<wchar_t>* val = new XMLTools::XMLAttribute<wchar_t>( L"w:val", strValue.c_str());
XMLTools::XMLAttribute* val = new XMLTools::XMLAttribute( L"w:val", strValue.c_str());
ele->AppendAttribute( *val );
RELEASEOBJECT( val );
}
@ -399,15 +399,15 @@ namespace DocFileFormat
/*========================================================================================================*/
void PropertiesMapping::appendValueElement( XMLTools::XMLElement<wchar_t>* node, const wchar_t* elementName, unsigned char elementValue, bool unique )
void PropertiesMapping::appendValueElement( XMLTools::XMLElement* node, const wchar_t* elementName, unsigned char elementValue, bool unique )
{
XMLTools::XMLElement<wchar_t>* ele = new XMLTools::XMLElement<wchar_t>( L"w", elementName );
XMLTools::XMLElement* ele = new XMLTools::XMLElement( L"w", elementName );
std::wstring strValue = FormatUtils::IntToWideString( elementValue );
if ( strValue != std::wstring( L"" ))
{
XMLTools::XMLAttribute<wchar_t>* val = new XMLTools::XMLAttribute<wchar_t>( L"w:val", strValue.c_str());
XMLTools::XMLAttribute* val = new XMLTools::XMLAttribute( L"w:val", strValue.c_str());
ele->AppendAttribute( *val );
RELEASEOBJECT( val );
}
@ -425,9 +425,9 @@ namespace DocFileFormat
/*========================================================================================================*/
void PropertiesMapping::appendBorderAttributes( BorderCode* brc, XMLTools::XMLElement<wchar_t>* border )
void PropertiesMapping::appendBorderAttributes( BorderCode* brc, XMLTools::XMLElement* border )
{
XMLTools::XMLAttribute<wchar_t> val( L"w:val" );
XMLTools::XMLAttribute val( L"w:val" );
if ( brc->fNil )
{
@ -439,19 +439,19 @@ namespace DocFileFormat
val.SetValue( getBorderType( brc->brcType ).c_str());
border->AppendAttribute( val );
XMLTools::XMLAttribute<wchar_t> color( L"w:color" );
XMLTools::XMLAttribute color( L"w:color" );
color.SetValue( RGBColor( brc->cv, RedFirst ).SixDigitHexCode.c_str());
border->AppendAttribute( color );
XMLTools::XMLAttribute<wchar_t> space( L"w:space" , FormatUtils::IntToWideString( brc->dptSpace ).c_str());
XMLTools::XMLAttribute space( L"w:space" , FormatUtils::IntToWideString( brc->dptSpace ).c_str());
border->AppendAttribute( space );
XMLTools::XMLAttribute<wchar_t> sz( L"w:sz", FormatUtils::IntToWideString( brc->dptLineWidth ).c_str());
XMLTools::XMLAttribute sz( L"w:sz", FormatUtils::IntToWideString( brc->dptLineWidth ).c_str());
border->AppendAttribute( sz );
if ( brc->fShadow )
{
XMLTools::XMLAttribute<wchar_t> shadow( L"w:shadow" );
XMLTools::XMLAttribute shadow( L"w:shadow" );
shadow.SetValue( L"1" );
border->AppendAttribute( shadow );
}
@ -460,14 +460,14 @@ namespace DocFileFormat
/*========================================================================================================*/
void PropertiesMapping::appendShading( XMLTools::XMLElement<wchar_t>* parent, const ShadingDescriptor& desc )
void PropertiesMapping::appendShading( XMLTools::XMLElement* parent, const ShadingDescriptor& desc )
{
if ( ( parent != NULL ) && ( desc.shadingSpecialValue == shadingSpecialValueNormal ))
{
XMLTools::XMLElement<wchar_t> shd( L"w:shd" );
XMLTools::XMLElement shd( L"w:shd" );
//fill color
XMLTools::XMLAttribute<wchar_t> fill( L"w:fill" );
XMLTools::XMLAttribute fill( L"w:fill" );
if ( desc.shadingType == shadingTypeShd )
{
@ -488,7 +488,7 @@ namespace DocFileFormat
shd.AppendAttribute( fill );
//foreground color
XMLTools::XMLAttribute<wchar_t> color( L"w:color" );
XMLTools::XMLAttribute color( L"w:color" );
if ( desc.shadingType == shadingTypeShd )
{
@ -509,7 +509,7 @@ namespace DocFileFormat
shd.AppendAttribute( color );
//pattern
XMLTools::XMLAttribute<wchar_t> val( L"w:val" );
XMLTools::XMLAttribute val( L"w:val" );
val.SetValue( getShadingPattern( desc ).c_str());
shd.AppendAttribute( val );
@ -759,12 +759,12 @@ namespace DocFileFormat
/*========================================================================================================*/
void PropertiesMapping::appendDxaElement( XMLTools::XMLElement<wchar_t>* node, const wchar_t* elementName, const wchar_t* elementValue, bool unique )
void PropertiesMapping::appendDxaElement( XMLTools::XMLElement* node, const wchar_t* elementName, const wchar_t* elementValue, bool unique )
{
XMLTools::XMLElement<wchar_t> ele( L"w", elementName );
XMLTools::XMLAttribute<wchar_t> val( L"w:w", elementValue );
XMLTools::XMLElement ele( L"w", elementName );
XMLTools::XMLAttribute val( L"w:w", elementValue );
ele.AppendAttribute( val );
XMLTools::XMLAttribute<wchar_t> type( L"w:type", L"dxa" );
XMLTools::XMLAttribute type( L"w:type", L"dxa" );
ele.AppendAttribute( type );
if ( unique )
@ -777,7 +777,7 @@ namespace DocFileFormat
/*========================================================================================================*/
void PropertiesMapping::addOrSetBorder( XMLTools::XMLElement<wchar_t>* pBdr, const XMLTools::XMLElement<wchar_t>* border )
void PropertiesMapping::addOrSetBorder( XMLTools::XMLElement* pBdr, const XMLTools::XMLElement* border )
{
if ( ( pBdr != NULL ) && ( border != NULL ))
{

View File

@ -51,23 +51,23 @@ namespace DocFileFormat
protected:
static void init();
void appendFlagAttribute( XMLTools::XMLElement<wchar_t>* node, const SinglePropertyModifier& sprm, const wchar_t* attributeName );
virtual void appendFlagElement( XMLTools::XMLElement<wchar_t>* node, const SinglePropertyModifier& sprm, const wchar_t* elementName, bool unique );
void appendValueAttribute( XMLTools::XMLElement<wchar_t>* node, const wchar_t* attributeName, const wchar_t* attributeValue );
void appendValueAttribute( XMLTools::XMLElement<wchar_t>* node, const wchar_t* attributeName, int attributeValue );
void appendValueAttribute( XMLTools::XMLElement<wchar_t>* node, const wchar_t* attributeName, short attributeValue );
void appendValueAttribute( XMLTools::XMLElement<wchar_t>* node, const wchar_t* attributeName, unsigned short attributeValue );
void appendValueAttribute( XMLTools::XMLElement<wchar_t>* node, const wchar_t* attributeName, unsigned char attributeValue );
void appendValueElement( XMLTools::XMLElement<wchar_t>* node, const wchar_t* elementName, const wchar_t* elementValue, bool unique );
void appendValueElement( XMLTools::XMLElement<wchar_t>* node, const wchar_t* elementName, short elementValue, bool unique );
void appendValueElement( XMLTools::XMLElement<wchar_t>* node, const wchar_t* elementName, unsigned short elementValue, bool unique );
void appendValueElement( XMLTools::XMLElement<wchar_t>* node, const wchar_t* elementName, unsigned char elementValue, bool unique );
void appendBorderAttributes( BorderCode* brc, XMLTools::XMLElement<wchar_t>* border );
void appendShading( XMLTools::XMLElement<wchar_t>* parent, const ShadingDescriptor& desc );
void appendFlagAttribute( XMLTools::XMLElement* node, const SinglePropertyModifier& sprm, const wchar_t* attributeName );
virtual void appendFlagElement( XMLTools::XMLElement* node, const SinglePropertyModifier& sprm, const wchar_t* elementName, bool unique );
void appendValueAttribute( XMLTools::XMLElement* node, const wchar_t* attributeName, const wchar_t* attributeValue );
void appendValueAttribute( XMLTools::XMLElement* node, const wchar_t* attributeName, int attributeValue );
void appendValueAttribute( XMLTools::XMLElement* node, const wchar_t* attributeName, short attributeValue );
void appendValueAttribute( XMLTools::XMLElement* node, const wchar_t* attributeName, unsigned short attributeValue );
void appendValueAttribute( XMLTools::XMLElement* node, const wchar_t* attributeName, unsigned char attributeValue );
void appendValueElement( XMLTools::XMLElement* node, const wchar_t* elementName, const wchar_t* elementValue, bool unique );
void appendValueElement( XMLTools::XMLElement* node, const wchar_t* elementName, short elementValue, bool unique );
void appendValueElement( XMLTools::XMLElement* node, const wchar_t* elementName, unsigned short elementValue, bool unique );
void appendValueElement( XMLTools::XMLElement* node, const wchar_t* elementName, unsigned char elementValue, bool unique );
void appendBorderAttributes( BorderCode* brc, XMLTools::XMLElement* border );
void appendShading( XMLTools::XMLElement* parent, const ShadingDescriptor& desc );
std::wstring getBorderType( unsigned char type );
std::wstring getShadingPattern( const ShadingDescriptor& shd );
void appendDxaElement( XMLTools::XMLElement<wchar_t>* node, const wchar_t* elementName, const wchar_t* elementValue, bool unique );
void addOrSetBorder( XMLTools::XMLElement<wchar_t>* pBdr, const XMLTools::XMLElement<wchar_t>* border );
void appendDxaElement( XMLTools::XMLElement* node, const wchar_t* elementName, const wchar_t* elementValue, bool unique );
void addOrSetBorder( XMLTools::XMLElement* pBdr, const XMLTools::XMLElement* border );
protected:

View File

@ -59,28 +59,15 @@ namespace DocFileFormat
{
unsigned char* bytes = FormatUtils::GetBytes( cv );
// wchar_t rgbColor6[7];
// wchar_t rgbColor8[9];
//CString rgbColor6;
//CString rgbColor8;
std::wstringstream rgbColor6, rgbColor8;
if( order == RedFirst )
{
//R
this->Red = bytes[0];
//G
this->Green = bytes[1];
//B
this->Green = bytes[1];
this->Blue = bytes[2];
//Alpha
this->Alpha = bytes[3];
this->Alpha = bytes[3];
//rgbColor6.Format( _T( "%02x%02x%02x" ), /*R*/this->Red, /*G*/this->Green, /*B*/this->Blue );
//rgbColor8.Format( _T( "%02x%02x%02x%02x" ), /*R*/this->Red, /*G*/this->Green, /*B*/this->Blue, /*A*/this->Alpha );
//SixDigitHexCode = rgbColor6;
//EightDigitHexCode = rgbColor8;
rgbColor6 << boost::wformat( L"%02x%02x%02x" ) % /*R*/this->Red % /*G*/this->Green % /*B*/this->Blue;
rgbColor8 << boost::wformat( L"%02x%02x%02x%02x" ) % /*R*/this->Red % /*G*/this->Green % /*B*/this->Blue % /*A*/this->Alpha;
@ -89,20 +76,11 @@ namespace DocFileFormat
}
else if ( order == RedLast )
{
//R
this->Red = bytes[2];
//G
this->Green = bytes[1];
//B
this->Blue = bytes[0];
//Alpha
this->Alpha = bytes[3];
this->Alpha = bytes[3];
//rgbColor6.Format( _T( "%02x%02x%02x" ), /*R*/this->Red, /*G*/this->Green, /*B*/this->Blue );
//rgbColor8.Format( _T( "%02x%02x%02x%02x" ), /*R*/this->Red, /*G*/this->Green, /*B*/this->Blue, /*A*/this->Alpha );
//SixDigitHexCode = rgbColor6;
//EightDigitHexCode = rgbColor8;
rgbColor6 << boost::wformat( L"%02x%02x%02x" ) % /*R*/this->Red % /*G*/this->Green % /*B*/this->Blue;
rgbColor8 << boost::wformat( L"%02x%02x%02x%02x" ) % /*R*/this->Red % /*G*/this->Green % /*B*/this->Blue % /*A*/this->Alpha;

View File

@ -38,7 +38,7 @@ namespace DocFileFormat
SectionPropertiesMapping::SectionPropertiesMapping (XMLTools::CStringXmlWriter* pWriter, ConversionContext* pContext, int nSelectProperties) : PropertiesMapping (pWriter)
{
m_bDeleteNode = TRUE;
m_pXmlNode = new XMLTools::XMLElement<wchar_t> (_T("w:sectPr"));
m_pXmlNode = new XMLTools::XMLElement (_T("w:sectPr"));
m_nColumns = 0;
m_arrWidth = NULL;
@ -53,7 +53,7 @@ namespace DocFileFormat
_type = std::wstring (_T("nextPage"));
}
SectionPropertiesMapping::SectionPropertiesMapping (XMLTools::XMLElement<wchar_t>* pBaseNode, ConversionContext* pContext, int nSelectProperties) : PropertiesMapping(NULL)
SectionPropertiesMapping::SectionPropertiesMapping (XMLTools::XMLElement* pBaseNode, ConversionContext* pContext, int nSelectProperties) : PropertiesMapping(NULL)
{
m_bDeleteNode = FALSE;
m_pXmlNode = pBaseNode;
@ -87,16 +87,16 @@ namespace DocFileFormat
{
SectionPropertyExceptions* sepx = static_cast<SectionPropertyExceptions*>(visited);
XMLTools::XMLElement<wchar_t> pgSz (_T("w:pgSz"));
XMLTools::XMLElement<wchar_t> pgMar (_T("w:pgMar"));
XMLTools::XMLElement<wchar_t> lnNumType (_T("w:lnNumType"));
XMLTools::XMLElement<wchar_t> cols (_T("w:cols"));
XMLTools::XMLElement<wchar_t> docGrid (_T("w:docGrid"));
XMLTools::XMLElement<wchar_t> pgBorders (_T("w:pgBorders"));
XMLTools::XMLElement<wchar_t> paperSrc (_T("w:paperSrc"));
XMLTools::XMLElement<wchar_t> footnotePr(_T("w:footnotePr"));
XMLTools::XMLElement<wchar_t> endnotePr (_T("w:endnotePr"));
XMLTools::XMLElement<wchar_t> pgNumType (_T("w:pgNumType"));
XMLTools::XMLElement pgSz (_T("w:pgSz"));
XMLTools::XMLElement pgMar (_T("w:pgMar"));
XMLTools::XMLElement lnNumType (_T("w:lnNumType"));
XMLTools::XMLElement cols (_T("w:cols"));
XMLTools::XMLElement docGrid (_T("w:docGrid"));
XMLTools::XMLElement pgBorders (_T("w:pgBorders"));
XMLTools::XMLElement paperSrc (_T("w:paperSrc"));
XMLTools::XMLElement footnotePr(_T("w:footnotePr"));
XMLTools::XMLElement endnotePr (_T("w:endnotePr"));
XMLTools::XMLElement pgNumType (_T("w:pgNumType"));
HeaderAndFooterTable* pTable = _ctx->_doc->headerAndFooterTable;
@ -235,7 +235,7 @@ namespace DocFileFormat
case sprmSBrcTop:
{
//top
XMLTools::XMLElement<wchar_t> topBorder( _T( "w:top" ) );
XMLTools::XMLElement topBorder( _T( "w:top" ) );
BorderCode bc( iter->Arguments, iter->argumentsSize );
appendBorderAttributes( &bc, &topBorder );
addOrSetBorder( &pgBorders, &topBorder);
@ -245,7 +245,7 @@ namespace DocFileFormat
case sprmSBrcLeft80:
case sprmSBrcLeft:
{
XMLTools::XMLElement<wchar_t> leftBorder( _T( "w:left" ) );
XMLTools::XMLElement leftBorder( _T( "w:left" ) );
BorderCode bc( iter->Arguments, iter->argumentsSize );
appendBorderAttributes( &bc, &leftBorder);
addOrSetBorder( &pgBorders, &leftBorder);
@ -256,7 +256,7 @@ namespace DocFileFormat
case sprmSBrcBottom:
{
//left
XMLTools::XMLElement<wchar_t> bottomBorder( _T( "w:bottom" ) );
XMLTools::XMLElement bottomBorder( _T( "w:bottom" ) );
BorderCode bc( iter->Arguments, iter->argumentsSize );
appendBorderAttributes( &bc, &bottomBorder );
addOrSetBorder( &pgBorders, &bottomBorder);
@ -267,7 +267,7 @@ namespace DocFileFormat
case sprmSBrcRight:
{
//left
XMLTools::XMLElement<wchar_t> rightBorder( _T( "w:right" ) );
XMLTools::XMLElement rightBorder( _T( "w:right" ) );
BorderCode bc( iter->Arguments, iter->argumentsSize );
appendBorderAttributes( &bc, &rightBorder);
addOrSetBorder( &pgBorders, &rightBorder);
@ -466,7 +466,7 @@ namespace DocFileFormat
// build the columns
if (m_arrWidth)
{
XMLTools::XMLAttribute<wchar_t> equalWidth( _T( "w:equalWidth" ), _T( "0" ) );
XMLTools::XMLAttribute equalWidth( _T( "w:equalWidth" ), _T( "0" ) );
cols.AppendAttribute( equalWidth );
//calculate the width of the last column:
@ -486,9 +486,9 @@ namespace DocFileFormat
for (int i = 0; i < m_nColumns; ++i)
{
XMLTools::XMLElement<wchar_t> col (_T( "w:col" ));
XMLTools::XMLAttribute<wchar_t> w (_T( "w:w" ), FormatUtils::IntToWideString (m_arrWidth[i]).c_str());
XMLTools::XMLAttribute<wchar_t> space (_T( "w:space" ), FormatUtils::IntToWideString (m_arrSpace[i]).c_str());
XMLTools::XMLElement col (_T( "w:col" ));
XMLTools::XMLAttribute w (_T( "w:w" ), FormatUtils::IntToWideString (m_arrWidth[i]).c_str());
XMLTools::XMLAttribute space (_T( "w:space" ), FormatUtils::IntToWideString (m_arrSpace[i]).c_str());
col.AppendAttribute (w);
col.AppendAttribute (space);
@ -532,9 +532,9 @@ namespace DocFileFormat
m_pXmlWriter->WriteString (m_pXmlNode->GetXMLString().c_str() );
}
void SectionPropertiesMapping::AppendRef (XMLTools::XMLElement<wchar_t> *parent, const wchar_t* element, const wchar_t* refType, const wchar_t* refId)
void SectionPropertiesMapping::AppendRef (XMLTools::XMLElement *parent, const wchar_t* element, const wchar_t* refType, const wchar_t* refId)
{
XMLTools::XMLElement<wchar_t> headerRef (_T("w"), element);
XMLTools::XMLElement headerRef (_T("w"), element);
headerRef.AppendAttribute (_T("w:type"), refType);
headerRef.AppendAttribute (_T("r:id"), refId);

View File

@ -158,7 +158,7 @@ namespace DocFileFormat
// Creates a new SectionPropertiesMapping which writes the properties to the given writer
SectionPropertiesMapping (XMLTools::CStringXmlWriter* writer, ConversionContext* ctx, int nSelectProperties);
// Creates a new SectionPropertiesMapping which appends the properties to a given node.
SectionPropertiesMapping (XMLTools::XMLElement<wchar_t>* sectPr, ConversionContext* ctx, int nSelectProperties);
SectionPropertiesMapping (XMLTools::XMLElement* sectPr, ConversionContext* ctx, int nSelectProperties);
virtual ~SectionPropertiesMapping();
// Converts the given SectionPropertyExceptions
@ -167,11 +167,11 @@ namespace DocFileFormat
const std::wstring & get_section_type();
private:
void AppendRef (XMLTools::XMLElement<wchar_t>* pBaseNode, const wchar_t* element, const wchar_t* refType, const wchar_t* refId);
void AppendRef (XMLTools::XMLElement* pBaseNode, const wchar_t* element, const wchar_t* refType, const wchar_t* refId);
bool WriteSectionStory (CharacterRange* pRange, const std::wstring& StoryType, const std::wstring& Story);
XMLTools::XMLElement<wchar_t>* m_pXmlNode;
XMLTools::XMLElement* m_pXmlNode;
bool m_bDeleteNode;
int m_nColumns;

View File

@ -95,7 +95,7 @@ namespace DocFileFormat
}
//proof state
XMLTools::XMLElement<wchar_t> proofState( L"w:proofState" );
XMLTools::XMLElement proofState( L"w:proofState" );
if ( dop->fGramAllClean )
{
@ -149,7 +149,7 @@ namespace DocFileFormat
}
//footnote properties
XMLTools::XMLElement<wchar_t> footnotePr( L"w:footnotePr" );
XMLTools::XMLElement footnotePr( L"w:footnotePr" );
if ( dop->nFtn != 0 )
{
@ -549,4 +549,4 @@ namespace DocFileFormat
m_oXmlWriter.WriteNodeEnd( L"w:compat" );
}
}
}

View File

@ -49,9 +49,9 @@ namespace DocFileFormat
_brcRight = NULL;
_brcBottom = NULL;
_tcPr = new XMLTools::XMLElement<wchar_t>(L"w:tcPr");
_tcMar = new XMLTools::XMLElement<wchar_t>(L"w:tcMar");
_tcBorders = new XMLTools::XMLElement<wchar_t>(L"w:tcBorders");
_tcPr = new XMLTools::XMLElement(L"w:tcPr");
_tcMar = new XMLTools::XMLElement(L"w:tcMar");
_tcBorders = new XMLTools::XMLElement(L"w:tcBorders");
_ftsWidth = Global::nil;
}
@ -271,10 +271,11 @@ namespace DocFileFormat
}
//width
XMLTools::XMLElement<wchar_t> tcW( L"w:tcW" );
XMLTools::XMLAttribute<wchar_t> tcWType( L"w:type", FormatUtils::MapValueToWideString( _ftsWidth, &Global::CellWidthTypeMap[0][0], 4, 5 ).c_str() );
XMLTools::XMLAttribute<wchar_t> tcWVal( L"w:w", FormatUtils::IntToWideString( _width ).c_str() );
tcW.AppendAttribute( tcWType );
XMLTools::XMLElement tcW ( L"w:tcW" );
XMLTools::XMLAttribute tcWType ( L"w:type", FormatUtils::MapValueToWideString( _ftsWidth, &Global::CellWidthTypeMap[0][0], 4, 5 ) );
XMLTools::XMLAttribute tcWVal ( L"w:w", FormatUtils::IntToWideString( _width ) );
tcW.AppendAttribute( tcWType );
tcW.AppendAttribute( tcWVal );
_tcPr->AppendChild( tcW );
@ -310,28 +311,28 @@ namespace DocFileFormat
//append borders
if (_brcTop)
{
XMLTools::XMLElement<wchar_t> topBorder( L"w:top" );
XMLTools::XMLElement topBorder( L"w:top" );
appendBorderAttributes(_brcTop, &topBorder);
addOrSetBorder(_tcBorders, &topBorder );
}
if (_brcLeft )
{
XMLTools::XMLElement<wchar_t> leftBorder( L"w:left" );
XMLTools::XMLElement leftBorder( L"w:left" );
appendBorderAttributes(_brcLeft, &leftBorder);
addOrSetBorder(_tcBorders, &leftBorder);
}
if (_brcBottom)
{
XMLTools::XMLElement<wchar_t> bottomBorder( L"w:bottom" );
XMLTools::XMLElement bottomBorder( L"w:bottom" );
appendBorderAttributes(_brcBottom, &bottomBorder);
addOrSetBorder(_tcBorders, &bottomBorder);
}
if (_brcRight)
{
XMLTools::XMLElement<wchar_t> rightBorder( L"w:right" );
XMLTools::XMLElement rightBorder( L"w:right" );
appendBorderAttributes( _brcRight, &rightBorder );
addOrSetBorder( _tcBorders, &rightBorder );
}

View File

@ -77,9 +77,9 @@ namespace DocFileFormat
int _gridIndex;
int _cellIndex;
XMLTools::XMLElement<wchar_t>* _tcPr;
XMLTools::XMLElement<wchar_t>* _tcMar;
XMLTools::XMLElement<wchar_t>* _tcBorders;
XMLTools::XMLElement* _tcPr;
XMLTools::XMLElement* _tcMar;
XMLTools::XMLElement* _tcBorders;
const std::vector<short>* _grid;
std::vector<short> _tGrid;

View File

@ -40,8 +40,8 @@ namespace DocFileFormat
_isTableStyleNeeded(isTableStyleNeeded)
{
_styles = styles;
_tblPr = new XMLTools::XMLElement<wchar_t>( _T( "w:tblPr" ) );
_tblBorders = new XMLTools::XMLElement<wchar_t>( _T( "w:tblBorders" ) );
_tblPr = new XMLTools::XMLElement( _T( "w:tblPr" ) );
_tblBorders = new XMLTools::XMLElement( _T( "w:tblBorders" ) );
_grid = grid;
}
TablePropertiesMapping::~TablePropertiesMapping()
@ -63,10 +63,10 @@ namespace DocFileFormat
{
TablePropertyExceptions* tapx = static_cast<TablePropertyExceptions*>( visited );
XMLTools::XMLElement<wchar_t> tblCellMar ( _T( "w:tblCellMar" ) );
XMLTools::XMLElement<wchar_t> tblLayout ( _T( "w:tblLayout" ) );
XMLTools::XMLElement<wchar_t> tblpPr ( _T( "w:tblpPr" ) );
XMLTools::XMLAttribute<wchar_t> layoutType ( _T( "w:type" ), _T( "fixed" ) );
XMLTools::XMLElement tblCellMar ( _T( "w:tblCellMar" ) );
XMLTools::XMLElement tblLayout ( _T( "w:tblLayout" ) );
XMLTools::XMLElement tblpPr ( _T( "w:tblpPr" ) );
XMLTools::XMLAttribute layoutType ( _T( "w:type" ), _T( "fixed" ) );
bool bLayoutFixed = true;
short tblIndent = 0;
@ -109,10 +109,10 @@ namespace DocFileFormat
unsigned char fts = iter->Arguments[0];
short width = FormatUtils::BytesToInt16( iter->Arguments, 1, iter->argumentsSize );
XMLTools::XMLElement<wchar_t> tblW( _T( "w:tblW" ) );
XMLTools::XMLElement tblW( _T( "w:tblW" ) );
XMLTools::XMLAttribute<wchar_t> w( _T( "w:w" ), FormatUtils::IntToWideString( width ).c_str() );
XMLTools::XMLAttribute<wchar_t> type( _T( "w:type" ), FormatUtils::MapValueToWideString( fts, &WidthType[0][0], 4, 5 ).c_str() );
XMLTools::XMLAttribute w( _T( "w:w" ), FormatUtils::IntToWideString( width ).c_str() );
XMLTools::XMLAttribute type( _T( "w:type" ), FormatUtils::MapValueToWideString( fts, &WidthType[0][0], 4, 5 ).c_str() );
tblW.AppendAttribute( type );
tblW.AppendAttribute( w );
@ -381,12 +381,12 @@ namespace DocFileFormat
//indent
if ( tblIndent != 0 )
{
XMLTools::XMLElement<wchar_t> tblInd( _T( "w:tblInd" ) );
XMLTools::XMLElement tblInd( _T( "w:tblInd" ) );
XMLTools::XMLAttribute<wchar_t> tblIndW( _T( "w:w" ),FormatUtils::IntToWideString( tblIndent ).c_str() );
XMLTools::XMLAttribute tblIndW( _T( "w:w" ),FormatUtils::IntToWideString( tblIndent ).c_str() );
tblInd.AppendAttribute( tblIndW );
XMLTools::XMLAttribute<wchar_t> tblIndType( _T( "w:type" ), _T( "dxa" ) );
XMLTools::XMLAttribute tblIndType( _T( "w:type" ), _T( "dxa" ) );
tblInd.AppendAttribute( tblIndType );
_tblPr->AppendChild( tblInd );
@ -401,42 +401,42 @@ namespace DocFileFormat
//set borders
if ( brcTop != NULL )
{
XMLTools::XMLElement<wchar_t> topBorder( _T( "w:top" ) );
XMLTools::XMLElement topBorder( _T( "w:top" ) );
appendBorderAttributes( brcTop, &topBorder );
addOrSetBorder( _tblBorders, &topBorder );
}
if ( brcLeft != NULL )
{
XMLTools::XMLElement<wchar_t> leftBorder( _T( "w:left" ) );
XMLTools::XMLElement leftBorder( _T( "w:left" ) );
appendBorderAttributes( brcLeft, &leftBorder );
addOrSetBorder( _tblBorders, &leftBorder );
}
if ( brcBottom != NULL )
{
XMLTools::XMLElement<wchar_t> bottomBorder( _T( "w:bottom" ) );
XMLTools::XMLElement bottomBorder( _T( "w:bottom" ) );
appendBorderAttributes( brcBottom, &bottomBorder );
addOrSetBorder( _tblBorders, &bottomBorder );
}
if ( brcRight != NULL )
{
XMLTools::XMLElement<wchar_t> rightBorder( _T( "w:right" ) );
XMLTools::XMLElement rightBorder( _T( "w:right" ) );
appendBorderAttributes( brcRight, &rightBorder );
addOrSetBorder( _tblBorders, &rightBorder );
}
if ( brcHorz != NULL )
{
XMLTools::XMLElement<wchar_t> insideHBorder( _T( "w:insideH" ) );
XMLTools::XMLElement insideHBorder( _T( "w:insideH" ) );
appendBorderAttributes( brcHorz, &insideHBorder );
addOrSetBorder( _tblBorders, &insideHBorder );
}
if ( brcVert != NULL )
{
XMLTools::XMLElement<wchar_t> insideVBorder( _T( "w:insideV" ) );
XMLTools::XMLElement insideVBorder( _T( "w:insideV" ) );
appendBorderAttributes( brcVert, &insideVBorder );
addOrSetBorder( _tblBorders, &insideVBorder );
}
@ -478,7 +478,7 @@ namespace DocFileFormat
}
//append the grid
_tblGrid = new XMLTools::XMLElement<wchar_t>( _T( "w:tblGrid" ) );
_tblGrid = new XMLTools::XMLElement( _T( "w:tblGrid" ) );
//Если _grid состоит из одних DocFormatUtils::gc_nZeroWidth и layout != "fixed", значит это doc полученный нами при конвертации из html. Таблицу размеров писать не нужно
bool bWriteGridCol = false;
@ -499,8 +499,8 @@ namespace DocFileFormat
{
for ( unsigned int i = 0; i < _grid->size(); i++ )
{
XMLTools::XMLElement<wchar_t> gridCol( _T( "w:gridCol" ) );
XMLTools::XMLAttribute<wchar_t> gridColW( _T( "w:w" ), FormatUtils::IntToWideString( _grid->at( i ) ).c_str() );
XMLTools::XMLElement gridCol( _T( "w:gridCol" ) );
XMLTools::XMLAttribute gridColW( _T( "w:w" ), FormatUtils::IntToWideString( _grid->at( i ) ).c_str() );
gridCol.AppendAttribute( gridColW );
_tblGrid->AppendChild( gridCol );
}

View File

@ -77,9 +77,9 @@ namespace DocFileFormat
private:
XMLTools::XMLElement<wchar_t>* _tblPr;
XMLTools::XMLElement<wchar_t>* _tblGrid;
XMLTools::XMLElement<wchar_t>* _tblBorders;
XMLTools::XMLElement* _tblPr;
XMLTools::XMLElement* _tblGrid;
XMLTools::XMLElement* _tblBorders;
StyleSheet* _styles;
std::vector<short>* _grid;

View File

@ -37,9 +37,9 @@ namespace DocFileFormat
{
TableRowPropertiesMapping::TableRowPropertiesMapping (XMLTools::CStringXmlWriter* pWriter, CharacterPropertyExceptions* rowEndChpx) : PropertiesMapping(pWriter), _trPr(NULL), _tblPrEx(NULL), _rowEndChpx(NULL)
{
_trPr = new XMLTools::XMLElement<wchar_t>(L"w:trPr");
_tblPrEx = new XMLTools::XMLElement<wchar_t>(L"w:tblPrEx");
//_tblBorders = new XMLTools::XMLElement<wchar_t>(L"w:tblBorders");
_trPr = new XMLTools::XMLElement(L"w:trPr");
_tblPrEx = new XMLTools::XMLElement(L"w:tblPrEx");
//_tblBorders = new XMLTools::XMLElement(L"w:tblBorders");
_rowEndChpx = rowEndChpx;
}
@ -58,7 +58,7 @@ namespace DocFileFormat
if ( ( _rowEndChpx != NULL ) && ( rev.Type == Deleted ) )
{
XMLTools::XMLElement<wchar_t> del( L"w:del" );
XMLTools::XMLElement del( L"w:del" );
_trPr->AppendChild( del );
}
@ -81,7 +81,7 @@ namespace DocFileFormat
if ( fHeader )
{
XMLTools::XMLElement<wchar_t> header( L"w:tblHeader" );
XMLTools::XMLElement header( L"w:tblHeader" );
_trPr->AppendChild( header );
}
}
@ -89,11 +89,11 @@ namespace DocFileFormat
case sprmTWidthAfter:
{ //width after
XMLTools::XMLElement<wchar_t> wAfter( L"w:wAfter" );
XMLTools::XMLAttribute<wchar_t> wAfterValue( L"w:w", FormatUtils::IntToWideString( FormatUtils::BytesToInt16( iter->Arguments, 1, iter->argumentsSize ) ).c_str() );
XMLTools::XMLElement wAfter( L"w:wAfter" );
XMLTools::XMLAttribute wAfterValue( L"w:w", FormatUtils::IntToWideString( FormatUtils::BytesToInt16( iter->Arguments, 1, iter->argumentsSize ) ).c_str() );
wAfter.AppendAttribute( wAfterValue );
XMLTools::XMLAttribute<wchar_t> wAfterType( L"w:type", L"dxa" );
XMLTools::XMLAttribute wAfterType( L"w:type", L"dxa" );
wAfter.AppendAttribute( wAfterType );
_trPr->AppendChild( wAfter, true );
}
@ -105,11 +105,11 @@ namespace DocFileFormat
if ( before != 0 )
{
XMLTools::XMLElement<wchar_t> wBefore( L"w:wBefore" );
XMLTools::XMLAttribute<wchar_t> wBeforeValue( L"w:w", FormatUtils::IntToWideString( before ).c_str() );
XMLTools::XMLElement wBefore( L"w:wBefore" );
XMLTools::XMLAttribute wBeforeValue( L"w:w", FormatUtils::IntToWideString( before ).c_str() );
wBefore.AppendAttribute( wBeforeValue );
XMLTools::XMLAttribute<wchar_t> wBeforeType( L"w:type", L"dxa" );
XMLTools::XMLAttribute wBeforeType( L"w:type", L"dxa" );
wBefore.AppendAttribute( wBeforeType );
_trPr->AppendChild( wBefore, true );
}
@ -119,9 +119,9 @@ namespace DocFileFormat
case sprmOldTDyaRowHeight:
case sprmTDyaRowHeight:
{ //row height
XMLTools::XMLElement<wchar_t> rowHeight( L"w:trHeight" );
XMLTools::XMLAttribute<wchar_t> rowHeightVal( L"w:val" );
XMLTools::XMLAttribute<wchar_t> rowHeightRule( L"w:hRule" );
XMLTools::XMLElement rowHeight( L"w:trHeight" );
XMLTools::XMLAttribute rowHeightVal( L"w:val" );
XMLTools::XMLAttribute rowHeightRule( L"w:hRule" );
short rH = FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize );

View File

@ -44,9 +44,9 @@ namespace DocFileFormat
class TableRowPropertiesMapping: public PropertiesMapping, public IMapping
{
private:
XMLTools::XMLElement<wchar_t>* _trPr;
XMLTools::XMLElement<wchar_t>* _tblPrEx;
//XMLTools::XMLElement<wchar_t>* _tblBorders;
XMLTools::XMLElement* _trPr;
XMLTools::XMLElement* _tblPrEx;
//XMLTools::XMLElement* _tblBorders;
//BorderCode brcLeft, brcTop, brcBottom, brcRight, brcHorz, brcVert;
CharacterPropertyExceptions* _rowEndChpx;
@ -55,4 +55,4 @@ namespace DocFileFormat
virtual ~TableRowPropertiesMapping();
virtual void Apply( IVisitable* visited );
};
}
}

View File

@ -213,7 +213,7 @@ namespace DocFileFormat
m_isEquation = false;
m_isEmbedded = false;
m_imageData = new XMLTools::XMLElement<wchar_t>( _T( "v:imagedata" ) );
m_imageData = new XMLTools::XMLElement( _T( "v:imagedata" ) );
}
VMLPictureMapping::~VMLPictureMapping()

View File

@ -84,7 +84,7 @@ namespace DocFileFormat
bool m_isOlePreview;
bool m_isInlinePicture;
XMLTools::XMLElement<wchar_t>* m_imageData;
XMLTools::XMLElement* m_imageData;
};
}

View File

@ -73,12 +73,12 @@ namespace DocFileFormat
m_pict = pPicture;
m_nImageId = 0;
m_imagedata = XMLTools::XMLElement<wchar_t>(L"v:imagedata");
m_fill = XMLTools::XMLElement<wchar_t>(L"v:fill");
m_stroke = XMLTools::XMLElement<wchar_t>(L"v:stroke");
m_shadow = XMLTools::XMLElement<wchar_t>(L"v:shadow");
m_3dstyle = XMLTools::XMLElement<wchar_t>(L"o:extrusion");
m_textpath = XMLTools::XMLElement<wchar_t>(L"v:textpath");
m_imagedata = XMLTools::XMLElement(L"v:imagedata");
m_fill = XMLTools::XMLElement(L"v:fill");
m_stroke = XMLTools::XMLElement(L"v:stroke");
m_shadow = XMLTools::XMLElement(L"v:shadow");
m_3dstyle = XMLTools::XMLElement(L"o:extrusion");
m_textpath = XMLTools::XMLElement(L"v:textpath");
Record* recBs = NULL;
if ((m_context) && (m_context->_doc))

View File

@ -133,11 +133,11 @@ namespace DocFileFormat
ConversionContext* m_context;
PictureDescriptor* m_pict;
XMLTools::XMLElement<wchar_t> m_fill;
XMLTools::XMLElement<wchar_t> m_stroke;
XMLTools::XMLElement<wchar_t> m_shadow;
XMLTools::XMLElement<wchar_t> m_imagedata;
XMLTools::XMLElement<wchar_t> m_3dstyle;
XMLTools::XMLElement<wchar_t> m_textpath;
XMLTools::XMLElement m_fill;
XMLTools::XMLElement m_stroke;
XMLTools::XMLElement m_shadow;
XMLTools::XMLElement m_imagedata;
XMLTools::XMLElement m_3dstyle;
XMLTools::XMLElement m_textpath;
};
}

View File

@ -38,7 +38,7 @@ namespace DocFileFormat
{
VMLShapeTypeMapping::VMLShapeTypeMapping (XMLTools::CStringXmlWriter* pWriter, bool isInlineShape) : PropertiesMapping(pWriter), _lock(NULL), _isInlineShape(isInlineShape)
{
this->_lock = new XMLTools::XMLElement<wchar_t>( L"o:lock");
this->_lock = new XMLTools::XMLElement( L"o:lock");
appendValueAttribute( this->_lock, L"v:ext", L"edit");
}

View File

@ -42,8 +42,8 @@ namespace DocFileFormat
class VMLShapeTypeMapping: public PropertiesMapping, public IMapping
{
private:
XMLTools::XMLElement<wchar_t> *_lock;
bool _isInlineShape;
XMLTools::XMLElement * _lock;
bool _isInlineShape;
public:
VMLShapeTypeMapping(XMLTools::CStringXmlWriter* writer, bool isInlineShape = false );

View File

@ -43,10 +43,12 @@ SOURCES += \
../../DocDocxConverter/Spa.cpp \
../../DocDocxConverter/OleObject.cpp
build_fast {
core_release {
SOURCES += \
docformatlib_converter.cpp
} else {
}
core_debug {
SOURCES += \
../../DocDocxConverter/AnnotationReferenceDescriptor.cpp \
../../DocDocxConverter/CharacterPropertiesMapping.cpp \

View File

@ -29,6 +29,7 @@
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#include "../../DocDocxConverter/AnnotationReferenceDescriptor.cpp"
#include "../../DocDocxConverter/CharacterPropertiesMapping.cpp"
#include "../../DocDocxConverter/Converter.cpp"

View File

@ -42,16 +42,16 @@ namespace Writers
{
public:
std::wstring content;
CString filename;
std::wstring filename;
int index;
};
std::vector<ChartElem*> m_aCharts;
ContentTypesWriter& m_oContentTypesWriter;
ContentTypesWriter& m_oContentTypesWriter;
int nChartCount;
public:
CString m_sDir;
std::wstring m_sDir;
public:
ChartWriter(CString sDir, ContentTypesWriter& oContentTypesWriter):m_sDir(sDir),m_oContentTypesWriter(oContentTypesWriter)
ChartWriter(std::wstring sDir, ContentTypesWriter& oContentTypesWriter):m_sDir(sDir),m_oContentTypesWriter(oContentTypesWriter)
{
nChartCount = 0;
}
@ -86,8 +86,8 @@ namespace Writers
oFile.CloseFile();
//Content_Types
CString sRelPath = _T("/word/charts/") + elem->filename;
m_oContentTypesWriter.AddOverride(sRelPath, CString(_T("application/vnd.openxmlformats-officedocument.drawingml.chart+xml")));
std::wstring sRelPath = L"/word/charts/" + elem->filename;
m_oContentTypesWriter.AddOverride(sRelPath, L"application/vnd.openxmlformats-officedocument.drawingml.chart+xml");
}
}
}
@ -97,7 +97,7 @@ namespace Writers
pChartElem->content = content;
pChartElem->index = nChartCount + 1;
nChartCount++;
pChartElem->filename.Format(L"chart%d.xml", pChartElem->index);
pChartElem->filename = L"chart" + std::to_wstring(pChartElem->index) + L".xml";
sRelsName = L"charts/" + pChartElem->filename;
sFileName = pChartElem->filename;

View File

@ -36,18 +36,18 @@
namespace Writers
{
static CString g_string_ct_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Types xmlns=\"http://schemas.openxmlformats.org/package/2006/content-types\">");
static CString g_string_ct_Ext = _T("<Default Extension=\"bin\" ContentType=\"application/vnd.openxmlformats-officedocument.oleObject\"/><Default Extension=\"bmp\" ContentType=\"image/bmp\"/><Default Extension=\"jpg\" ContentType=\"image/jpeg\"/><Default Extension=\"jpeg\" ContentType=\"image/jpeg\"/><Default Extension=\"jpe\" ContentType=\"image/jpeg\"/><Default Extension=\"png\" ContentType=\"image/png\"/><Default Extension=\"gif\" ContentType=\"image/gif\"/><Default Extension=\"emf\" ContentType=\"image/x-emf\"/><Default Extension=\"wmf\" ContentType=\"image/x-wmf\"/><Default Extension=\"rels\" ContentType=\"application/vnd.openxmlformats-package.relationships+xml\"/><Default Extension=\"xml\" ContentType=\"application/xml\"/><Default Extension=\"xlsx\" ContentType=\"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\"/>");
static CString g_string_ct_Override = _T("<Override PartName=\"/word/document.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml\"/><Override PartName=\"/word/styles.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml\"/><Override PartName=\"/word/settings.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml\"/><Override PartName=\"/word/webSettings.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.wordprocessingml.webSettings+xml\"/><Override PartName=\"/word/fontTable.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml\"/><Override PartName=\"/word/theme/theme1.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.theme+xml\"/><Override PartName=\"/docProps/core.xml\" ContentType=\"application/vnd.openxmlformats-package.core-properties+xml\"/><Override PartName=\"/docProps/app.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.extended-properties+xml\"/>");
static CString g_string_ct_End = _T("</Types>");
static std::wstring g_string_ct_Start = L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Types xmlns=\"http://schemas.openxmlformats.org/package/2006/content-types\">";
static std::wstring g_string_ct_Ext = L"<Default Extension=\"bin\" ContentType=\"application/vnd.openxmlformats-officedocument.oleObject\"/><Default Extension=\"bmp\" ContentType=\"image/bmp\"/><Default Extension=\"jpg\" ContentType=\"image/jpeg\"/><Default Extension=\"jpeg\" ContentType=\"image/jpeg\"/><Default Extension=\"jpe\" ContentType=\"image/jpeg\"/><Default Extension=\"png\" ContentType=\"image/png\"/><Default Extension=\"gif\" ContentType=\"image/gif\"/><Default Extension=\"emf\" ContentType=\"image/x-emf\"/><Default Extension=\"wmf\" ContentType=\"image/x-wmf\"/><Default Extension=\"rels\" ContentType=\"application/vnd.openxmlformats-package.relationships+xml\"/><Default Extension=\"xml\" ContentType=\"application/xml\"/><Default Extension=\"xlsx\" ContentType=\"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\"/>";
static std::wstring g_string_ct_Override = L"<Override PartName=\"/word/document.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml\"/><Override PartName=\"/word/styles.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml\"/><Override PartName=\"/word/settings.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml\"/><Override PartName=\"/word/webSettings.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.wordprocessingml.webSettings+xml\"/><Override PartName=\"/word/fontTable.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml\"/><Override PartName=\"/word/theme/theme1.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.theme+xml\"/><Override PartName=\"/docProps/core.xml\" ContentType=\"application/vnd.openxmlformats-package.core-properties+xml\"/><Override PartName=\"/docProps/app.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.extended-properties+xml\"/>";
static std::wstring g_string_ct_End = L"</Types>";
class ContentTypesWriter
{
XmlUtils::CStringWriter m_oWriter;
CString m_sDir;
std::wstring m_sDir;
XmlUtils::CStringWriter m_oAdditional;
public:
ContentTypesWriter(CString sDir):m_sDir(sDir)
ContentTypesWriter(std::wstring sDir) : m_sDir(sDir)
{
}
void Write()
@ -58,7 +58,7 @@ namespace Writers
m_oWriter.Write(m_oAdditional);
m_oWriter.WriteString(g_string_ct_End);
OOX::CPath filePath = m_sDir + _T("/[Content_Types].xml");
OOX::CPath filePath = m_sDir + L"/[Content_Types].xml";
CFile oFile;
oFile.CreateFile(filePath.GetPath());
@ -66,12 +66,12 @@ namespace Writers
oFile.WriteStringUTF8(m_oWriter.GetData());
oFile.CloseFile();
}
void AddOverride(const CString& PartName, const CString& ContentType)
void AddOverride(const std::wstring& PartName, const std::wstring& ContentType)
{
CString sOverride;sOverride.Format(_T("<Override PartName=\"%ls\" ContentType=\"%ls\"/>"),PartName , ContentType);
std::wstring sOverride = L"<Override PartName=\"" + PartName+ L"\ ContentType=\"" + ContentType + L"\"/>";
m_oAdditional.WriteString(sOverride);
}
void AddOverrideRaw(const CString& sXml)
void AddOverrideRaw(const std::wstring& sXml)
{
m_oAdditional.WriteString(sXml);
}

View File

@ -39,26 +39,26 @@ namespace Writers
class MediaWriter
{
XmlUtils::CStringWriter m_oWriter;
CString m_sDir;
CString m_sMediaDir;
std::wstring m_sDir;
std::wstring m_sMediaDir;
public:
std::vector<CString> m_aImageNames;
std::vector<std::wstring> m_aImageNames;
long nImageCount;
public:
MediaWriter(CString sDir):m_sDir(sDir)
MediaWriter(std::wstring sDir):m_sDir(sDir)
{
nImageCount = 0;
OOX::CPath filePath = m_sDir + FILE_SEPARATOR_STR + _T("word") + FILE_SEPARATOR_STR + _T("media");
OOX::CPath filePath = m_sDir + FILE_SEPARATOR_STR + L"word" + FILE_SEPARATOR_STR + L"media";
m_sMediaDir = filePath.GetPath();
}
CString AddImageGetNewPath()
std::wstring AddImageGetNewPath()
{
OOX::CSystemUtility::CreateDirectories(m_sMediaDir);
CString sNewImgName;sNewImgName.Format(_T("image%d.jpg"), (nImageCount + 1));
CString sNewImg = m_sMediaDir + FILE_SEPARATOR_STR + sNewImgName;
std::wstring sNewImgName = L"image" + std::to_wstring(nImageCount + 1) + L".jpg";
std::wstring sNewImg = m_sMediaDir + FILE_SEPARATOR_STR + sNewImgName;
nImageCount++;
return sNewImg;
}
@ -72,23 +72,23 @@ namespace Writers
DWORD dwSizeRead = (DWORD)fread((void*)pData, 1, size, pFile);
if(dwSizeRead > 0)
{
CString sNewImagePath = AddImageGetNewPath();
std::wstring sNewImagePath = AddImageGetNewPath();
NSFile::CFileBinary oFile;
oFile.CreateFileW(sNewImagePath);
oFile.WriteFile(pData, dwSizeRead);
oFile.CloseFile();
CString sFilename = NSSystemPath::GetFileName(sNewImagePath);
std::wstring sFilename = NSSystemPath::GetFileName(sNewImagePath);
m_aImageNames.push_back(sFilename);
}
RELEASEARRAYOBJECTS(pData);
}
}
void AddImage(const CString& sImg)
void AddImage(const std::wstring& sImg)
{
OOX::CPath pathNewImg = AddImageGetNewPath();
NSFile::CFileBinary::Copy(sImg, pathNewImg.GetPath());
CString sFilename = NSSystemPath::GetFileName(pathNewImg.GetPath()).c_str();
std::wstring sFilename = NSSystemPath::GetFileName(pathNewImg.GetPath()).c_str();
m_aImageNames.push_back(sFilename);
}
};

View File

@ -98,11 +98,11 @@ public:
long nMHeader = SerializeCommon::Round(Header * g_dKoef_mm_to_twips);
long nMFooter = SerializeCommon::Round(Footer * g_dKoef_mm_to_twips);
if(!sHeaderFooterReference.IsEmpty())
sRes.Append(sHeaderFooterReference);
sRes += sHeaderFooterReference;
if(!footnotePr.IsEmpty())
sRes.Append(footnotePr);
sRes += footnotePr;
if(!endnotePr.IsEmpty())
sRes.Append(endnotePr);
sRes += endnotePr;
if(bSectionType)
{
CString sType;
@ -126,18 +126,18 @@ public:
sRes.AppendFormat(_T(" w:header=\"%d\""), nMHeader);
if(bFooter)
sRes.AppendFormat(_T(" w:footer=\"%d\""), nMFooter);
sRes.Append(_T("/>"));
sRes += L"/>";
if(!pgBorders.IsEmpty())
sRes.Append(pgBorders);
sRes += pgBorders;
if(bPageNumStart)
sRes.AppendFormat(_T("<w:pgNumType w:start=\"%d\"/>"), PageNumStart);
if(!cols.IsEmpty())
sRes.Append(cols);
sRes.Append(_T("<w:docGrid w:linePitch=\"360\"/>"));
sRes += cols;
sRes += L"<w:docGrid w:linePitch=\"360\"/>";
if(bTitlePg && TitlePg)
sRes.Append(_T("<w:titlePg/>"));
sRes += L"<w:titlePg/>";
if(!sectPrChange.IsEmpty())
sRes.Append(sectPrChange);
sRes += sectPrChange;
return sRes;
}
};
@ -292,9 +292,9 @@ public:
if(ThemeColor.bColor)
sBackground += L" w:themeColor=\"" + ThemeColor.ToStringColor() + L"\"";
if(ThemeColor.bTint)
sBackground += L" w:themeColorTint=\"" + ThemeColor.ToStringTint() + L"\"";
sBackground += L" w:themeTint=\"" + ThemeColor.ToStringTint() + L"\"";
if(ThemeColor.bShade)
sBackground += L" w:themeColorShade=\"" + ThemeColor.ToStringShade() + L"\"";
sBackground += L" w:themeShade=\"" + ThemeColor.ToStringShade() + L"\"";
}
if (!bColor && !bThemeColor)
@ -330,13 +330,13 @@ public:
CString sShd;
if(bColor || (bThemeColor && ThemeColor.IsNoEmpty()))
{
sShd.Append(_T("<w:shd w:val=\"clear\" w:color=\"auto\""));
sShd += L"<w:shd w:val=\"clear\" w:color=\"auto\"";
if(bColor)
sShd.AppendFormat(_T(" w:fill=\"%ls\""), (const TCHAR *) Color.ToString());
if(bThemeColor && ThemeColor.IsNoEmpty())
{
if(ThemeColor.Auto && !bColor)
sShd.Append(_T(" w:fill=\"auto\""));
sShd += L" w:fill=\"auto\"";
if(ThemeColor.bColor)
sShd.AppendFormat(_T(" w:themeFill=\"%ls\""), (const TCHAR *) ThemeColor.ToStringColor());
if(ThemeColor.bTint)
@ -344,7 +344,7 @@ public:
if(ThemeColor.bShade)
sShd.AppendFormat(_T(" w:themeFillShade=\"%ls\""), (const TCHAR *) ThemeColor.ToStringShade());
}
sShd.Append(_T("/>"));
sShd += (_T("/>"));
}
return sShd;
}
@ -533,9 +533,9 @@ public:
{
switch(FontHint)
{
case 0: sFont.Append(_T(" w:hint=\"cs\""));break;
case 2: sFont.Append(_T(" w:hint=\"eastAsia\""));break;
default:sFont.Append(_T(" w:hint=\"default\""));break;
case 0: sFont += L" w:hint=\"cs\""; break;
case 2: sFont += L" w:hint=\"eastAsia\""; break;
default:sFont += L" w:hint=\"default\""; break;
}
}
sFont += _T("/>");
@ -612,7 +612,7 @@ public:
if(bThemeColor && ThemeColor.IsNoEmpty())
{
if(ThemeColor.Auto && !bColor)
sColor.Append(_T(" w:val=\"auto\""));
sColor += L" w:val=\"auto\"";
if(ThemeColor.bColor)
sColor.AppendFormat(_T(" w:themeColor=\"%ls\""), (const TCHAR *) ThemeColor.ToStringColor());
if(ThemeColor.bTint)
@ -620,7 +620,7 @@ public:
if(ThemeColor.bShade)
sColor.AppendFormat(_T(" w:themeShade=\"%ls\""), (const TCHAR *) ThemeColor.ToStringShade());
}
sColor.Append(_T("/>"));
sColor += L"/>";
pCStringWriter->WriteString(sColor);
}
if(bSpacing)
@ -1316,7 +1316,7 @@ public:
docLvlText* item = Text[i];
if(item->bText)
{
sText.Append(item->Text);
sText += (item->Text);
}
else if(item->bNumber)
{
@ -1543,20 +1543,20 @@ public:
sStart.Format(_T("<w:hyperlink r:id=\"%ls\""), (const TCHAR *) sCorrect_rId);
if(false == tooltip.IsEmpty())
{
sStart.Append(_T(" w:tooltip=\""));
sStart.Append(sCorrect_tooltip);
sStart.Append(_T("\""));
sStart += L" w:tooltip=\"";
sStart += sCorrect_tooltip;
sStart += L"\"";
}
if(false == anchor.IsEmpty())
{
sStart.Append(_T(" w:anchor=\""));
sStart.Append(sCorrect_anchor);
sStart.Append(_T("\""));
sStart += L" w:anchor=\"";
sStart += sCorrect_anchor;
sStart += L"\"";
}
sStart.Append(_T(" w:history=\"1\">"));
sStart += L" w:history=\"1\">";
wr.WriteString(sStart);
wr.Write(writer);
wr.WriteString(CString(_T("</w:hyperlink>")));
wr.WriteString(L"</w:hyperlink>");
}
}
};
@ -1629,17 +1629,17 @@ public:
CString writeRef(const CString& sBefore, const CString& sRef, const CString& sAfter)
{
CString sRes;
sRes.Append(writeRef(this, sBefore, sRef, sAfter));
sRes += (writeRef(this, sBefore, sRef, sAfter));
for(int i = 0, length = replies.size(); i < length; ++i)
sRes.Append(writeRef(replies[i], sBefore, sRef, sAfter));
sRes += (writeRef(replies[i], sBefore, sRef, sAfter));
return sRes;
}
CString writeTemplates(funcArg fReadFunction)
{
CString sRes;
sRes.Append(fReadFunction(this));
sRes += (fReadFunction(this));
for(int i = 0, length = replies.size(); i < length; ++i)
sRes.Append(fReadFunction(replies[i]));
sRes += (fReadFunction(replies[i]));
return sRes;
}
static CString writeRef(CComment* pComment, const CString& sBefore, const CString& sRef, const CString& sAfter)
@ -1650,9 +1650,9 @@ public:
pComment->bIdFormat = true;
pComment->IdFormat = pComment->m_oFormatIdCounter.getNextId();
}
sRes.Append(sBefore);
sRes += (sBefore);
sRes.AppendFormat(_T("<%ls w:id=\"%d\"/>"), (const TCHAR *) sRef, pComment->IdFormat);
sRes.Append(sAfter);
sRes += (sAfter);
return sRes;
}
static bool writeContentWritePart(CComment* pComment, CString& sText, int nPrevIndex, int nCurIndex, bool bFirst, CString& sRes)
@ -1672,8 +1672,8 @@ public:
}
CString sFormat = _T("<w:p w14:paraId=\"%ls\" w14:textId=\"%ls\"><w:pPr><w:spacing w:line=\"240\" w:after=\"0\" w:lineRule=\"auto\" w:before=\"0\"/><w:ind w:firstLine=\"0\" w:left=\"0\" w:right=\"0\"/><w:jc w:val=\"left\"/></w:pPr><w:r><w:rPr><w:rFonts w:eastAsia=\"Arial\" w:ascii=\"Arial\" w:hAnsi=\"Arial\" w:cs=\"Arial\"/><w:sz w:val=\"22\"/></w:rPr><w:t xml:space=\"preserve\">");
sRes.AppendFormat((const TCHAR *) sFormat, (const TCHAR *) sId, (const TCHAR *) sId);
sRes.Append(sPart);
sRes.Append(_T("</w:t></w:r></w:p>"));
sRes += (sPart);
sRes += (_T("</w:t></w:r></w:p>"));
return bFirst;
}
static CString writeContent(CComment* pComment)
@ -1689,9 +1689,9 @@ public:
if(false == pComment->UserName.IsEmpty())
{
CString sUserName = XmlUtils::EncodeXmlString(pComment->UserName);
sRes.Append(_T(" w:author=\""));
sRes.Append(sUserName);
sRes.Append(_T("\""));
sRes += (_T(" w:author=\""));
sRes += (sUserName);
sRes += (_T("\""));
//делаем initials
int nTokenPos = 0;
CString strToken = pComment->UserName.Tokenize(_T(" "), nTokenPos);
@ -1706,18 +1706,18 @@ public:
if(false == pComment->Date.IsEmpty())
{
CString sDate = XmlUtils::EncodeXmlString(pComment->Date);
sRes.Append(_T(" w:date=\""));
sRes.Append(sDate);
sRes.Append(_T("\""));
sRes += (_T(" w:date=\""));
sRes += (sDate);
sRes += (_T("\""));
}
if(false == sInitials.IsEmpty())
{
sInitials = XmlUtils::EncodeXmlString(sInitials);
sRes.Append(_T(" w:initials=\""));
sRes.Append(sInitials);
sRes.Append(_T("\""));
sRes += (_T(" w:initials=\""));
sRes += (sInitials);
sRes += (_T("\""));
}
sRes.Append(_T(">"));
sRes += (_T(">"));
if(false == pComment->Text.IsEmpty())
{
CString sText = pComment->Text;
@ -1735,7 +1735,7 @@ public:
}
writeContentWritePart(pComment, sText, nPrevIndex, sText.GetLength(), bFirst, sRes);
}
sRes.Append(_T("</w:comment>"));
sRes += (_T("</w:comment>"));
return sRes;
}
static CString writeContentExt(CComment* pComment)
@ -1763,11 +1763,11 @@ public:
{
CString sUserName = XmlUtils::EncodeXmlString(pComment->UserName);
CString sUserId = XmlUtils::EncodeXmlString(pComment->UserId);
sRes.Append(_T("<w15:person w15:author=\""));
sRes.Append(sUserName);
sRes.Append(_T("\"><w15:presenceInfo w15:providerId=\"Teamlab\" w15:userId=\""));
sRes.Append(sUserId);
sRes.Append(_T("\"/></w15:person>"));
sRes += (_T("<w15:person w15:author=\""));
sRes += (sUserName);
sRes += (_T("\"><w15:presenceInfo w15:providerId=\"Teamlab\" w15:userId=\""));
sRes += (sUserId);
sRes += (_T("\"/></w15:person>"));
}
return sRes;
}
@ -1823,7 +1823,7 @@ public:
CString sRes;
for (std::map<int, CComment*>::const_iterator it = m_mapComments.begin(); it != m_mapComments.end(); ++it)
{
sRes.Append(it->second->writeTemplates(CComment::writeContent));
sRes += (it->second->writeTemplates(CComment::writeContent));
}
return sRes;
}
@ -1832,7 +1832,7 @@ public:
CString sRes;
for (std::map<int, CComment*>::const_iterator it = m_mapComments.begin(); it != m_mapComments.end(); ++it)
{
sRes.Append(it->second->writeTemplates(CComment::writeContentExt));
sRes += (it->second->writeTemplates(CComment::writeContentExt));
}
return sRes;
}
@ -1841,7 +1841,7 @@ public:
CString sRes;
for (std::map<CString, CComment*>::const_iterator it = m_mapAuthors.begin(); it != m_mapAuthors.end(); ++it)
{
sRes.Append(it->second->writePeople(it->second));
sRes += (it->second->writePeople(it->second));
}
return sRes;
}
@ -1921,6 +1921,7 @@ public:
CString sSizeRelV;
int m_nDocPr;
CString sGraphicFramePr;
CString sDocPr;
CDrawingPropertyWrap DrawingPropertyWrap;
@ -2015,9 +2016,9 @@ public:
sXml.AppendFormat(_T("<wp:effectExtent l=\"%lld\" t=\"%lld\" r=\"%lld\" b=\"%lld\"/>"), emuEffectExtentL, emuEffectExtentT, emuEffectExtentR, emuEffectExtentB);
}
if(bChart)
if(!sDocPr.IsEmpty())
{
sXml.AppendFormat(_T("<wp:docPr id=\"%d\" name=\"Chart %d\"/>"), m_nDocPr, m_nDocPr);
sXml += (sDocPr);
}
else
{
@ -2025,11 +2026,11 @@ public:
}
if(!sGraphicFramePr.IsEmpty())
{
sXml.Append(sGraphicFramePr);
sXml += (sGraphicFramePr);
}
else
{
sXml.Append(_T("<wp:cNvGraphicFramePr/>"));
sXml += (_T("<wp:cNvGraphicFramePr/>"));
}
if(bChart)
{
@ -2037,7 +2038,7 @@ public:
}
else
{
sXml.Append(_T("</wp:inline>"));
sXml += (_T("</wp:inline>"));
}
}
}
@ -2074,7 +2075,7 @@ public:
nLayoutInCell = 0;
if(bChart)
sXml.Append(_T("<w:drawing>"));
sXml += (_T("<w:drawing>"));
sXml.AppendFormat(_T("<wp:anchor xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" distT=\"%lld\" distB=\"%lld\" distL=\"%lld\" distR=\"%lld\" simplePos=\"%d\" relativeHeight=\"%u\" behindDoc=\"%d\" locked=\"0\" layoutInCell=\"%d\" allowOverlap=\"1\">"), emuDistT, emuDistB, emuDistL, emuDistR, nSimplePos, nRelativeHeight, nBehindDoc, nLayoutInCell);
__int64 emuX = 0;
@ -2214,7 +2215,7 @@ public:
sXml.AppendFormat(_T("<wp:lineTo x=\"%lld\" y=\"%lld\"/>"), emuX, emuY);
}
}
sXml.Append(_T("</wp:wrapPolygon>"));
sXml += (_T("</wp:wrapPolygon>"));
sXml.AppendFormat(_T("</wp:%ls>"), (const TCHAR *) sTagName);
}
else
@ -2224,30 +2225,30 @@ public:
c_oSerImageType2::WrapThrough == DrawingPropertyWrap.WrappingType ||
c_oSerImageType2::WrapTight == DrawingPropertyWrap.WrappingType)
{
sXml.Append(_T("<wp:wrapSquare wrapText=\"bothSides\"/>"));
sXml += (_T("<wp:wrapSquare wrapText=\"bothSides\"/>"));
}
else
sXml.AppendFormat(_T("<wp:%ls/>"), (const TCHAR *) sTagName);
}
}
else
sXml.Append(_T("<wp:wrapNone/>"));
sXml += (_T("<wp:wrapNone/>"));
if(bChart)
{
sXml.AppendFormat(_T("<wp:docPr id=\"%d\" name=\"Chart %d\"/>"), m_nDocPr, m_nDocPr);
}
if(!sDocPr.IsEmpty())
{
sXml += (sDocPr);
}
else
{
sXml.AppendFormat(_T("<wp:docPr id=\"%d\" name=\"\"/>"), m_nDocPr);
}
if(!sGraphicFramePr.IsEmpty())
{
sXml.Append(sGraphicFramePr);
sXml += (sGraphicFramePr);
}
else
{
sXml.Append(_T("<wp:cNvGraphicFramePr/>"));
sXml += (_T("<wp:cNvGraphicFramePr/>"));
}
if(bChart)
{
@ -2256,17 +2257,17 @@ public:
if(!sSizeRelH.IsEmpty())
{
sXml.Append(sSizeRelH);
sXml += (sSizeRelH);
}
if(!sSizeRelV.IsEmpty())
{
sXml.Append(sSizeRelV);
sXml += (sSizeRelV);
}
sXml.Append(_T("</wp:anchor>"));
sXml += (_T("</wp:anchor>"));
if(bChart)
sXml.Append(_T("</w:drawing>"));
sXml += (_T("</w:drawing>"));
}
}
return sXml;
@ -2296,41 +2297,41 @@ public:
CString Write(bool bBandSize, bool bLayout)
{
CString sRes;
sRes.Append(_T("<w:tblPr>"));
sRes += (_T("<w:tblPr>"));
if(false == Style.IsEmpty())
sRes.Append(Style);
sRes += (Style);
if(false == tblpPr.IsEmpty())
sRes.Append(tblpPr);
sRes += (tblpPr);
if(!RowBandSize.IsEmpty())
sRes.Append(RowBandSize);
sRes += (RowBandSize);
if(!ColBandSize.IsEmpty())
sRes.Append(ColBandSize);
sRes += (ColBandSize);
if(false == TableW.IsEmpty())
sRes.Append(TableW);
sRes += (TableW);
if(false == Jc.IsEmpty())
sRes.Append(Jc);
sRes += (Jc);
if(false == TableCellSpacing.IsEmpty())
sRes.Append(TableCellSpacing);
sRes += (TableCellSpacing);
if(false == TableInd.IsEmpty())
sRes.Append(TableInd);
sRes += (TableInd);
if(false == TableBorders.IsEmpty())
sRes.Append(TableBorders);
sRes += (TableBorders);
if(false == Shd.IsEmpty())
sRes.Append(Shd);
sRes += (Shd);
if(bLayout)
{
if(false == Layout.IsEmpty())
sRes.Append(Layout);
sRes += (Layout);
else if(g_nCurFormatVersion < 4)
sRes.Append(_T("<w:tblLayout w:type=\"fixed\"/>"));
sRes += (_T("<w:tblLayout w:type=\"fixed\"/>"));
}
if(false == TableCellMar.IsEmpty())
sRes.Append(TableCellMar);
sRes += (TableCellMar);
if(false == Look.IsEmpty())
sRes.Append(Look);
sRes += (Look);
if(!tblPrChange.IsEmpty())
sRes.Append(tblPrChange);
sRes.Append(_T("</w:tblPr>"));
sRes += (tblPrChange);
sRes += (_T("</w:tblPr>"));
return sRes;
}
};
@ -2548,17 +2549,17 @@ public:
sStart.Format(_T("<w:hyperlink r:id=\"%ls\""), (const TCHAR *) sCorrect_rId);
if(false == sTooltip.IsEmpty())
{
sStart.Append(_T(" w:tooltip=\""));
sStart.Append(sCorrect_tooltip);
sStart.Append(_T("\""));
sStart += (_T(" w:tooltip=\""));
sStart += (sCorrect_tooltip);
sStart += (_T("\""));
}
if(false == sAnchor.IsEmpty())
{
sStart.Append(_T(" w:anchor=\""));
sStart.Append(sCorrect_anchor);
sStart.Append(_T("\""));
sStart += (_T(" w:anchor=\""));
sStart += (sCorrect_anchor);
sStart += (_T("\""));
}
sStart.Append(_T(" w:history=\"1\">"));
sStart += (_T(" w:history=\"1\">"));
wr.WriteString(sStart);
wr.Write(writer);
wr.WriteString(CString(_T("</w:hyperlink>")));
@ -2579,8 +2580,8 @@ public:
{
CString sCorrect_Instr = XmlUtils::EncodeXmlString(sInstr);
CString sStart(_T("<w:fldSimple w:instr=\""));
sStart.Append(sCorrect_Instr);
sStart.Append(_T("\">"));
sStart += (sCorrect_Instr);
sStart += (_T("\">"));
wr.WriteString(sStart);
wr.Write(writer);
wr.WriteString(CString(_T("</w:fldSimple>")));

View File

@ -792,9 +792,9 @@ public:
CString sStyleName(m_oBufferedStream.GetString3(length));
sStyleName = XmlUtils::EncodeXmlString(sStyleName);
CString sStyle;
sStyle.Append(_T("<w:pStyle w:val=\""));
sStyle.Append(sStyleName);
sStyle.Append(_T("\" />"));
sStyle += L"<w:pStyle w:val=\"";
sStyle += sStyleName;
sStyle += L"\" />";
pCStringWriter->WriteString(sStyle);
}break;
case c_oSerProp_pPrType::numPr:
@ -1678,9 +1678,9 @@ public:
res = Read1(length, &Binary_tblPrReader::ReadCellMargins, this, &oTempWriter);
if(oTempWriter.GetCurSize() > 0)
{
pWiterTblPr->TableCellMar.Append(CString(_T("<w:tblCellMar>")));
pWiterTblPr->TableCellMar.Append(oTempWriter.GetData());
pWiterTblPr->TableCellMar.Append(CString(_T("</w:tblCellMar>")));
pWiterTblPr->TableCellMar += L"<w:tblCellMar>";
pWiterTblPr->TableCellMar += oTempWriter.GetData();
pWiterTblPr->TableCellMar += L"</w:tblCellMar>";
}
}
else if( c_oSerProp_tblPrType::TableBorders == type )
@ -1691,9 +1691,9 @@ public:
{
XmlUtils::CStringWriter oTempWriter;
odocBorders.Write(&oTempWriter, false);
pWiterTblPr->TableBorders.Append(CString(_T("<w:tblBorders>")));
pWiterTblPr->TableBorders.Append(oTempWriter.GetData());
pWiterTblPr->TableBorders.Append(CString(_T("</w:tblBorders>")));
pWiterTblPr->TableBorders += L"<w:tblBorders>";
pWiterTblPr->TableBorders += oTempWriter.GetData();
pWiterTblPr->TableBorders += L"</w:tblBorders>";
}
}
else if( c_oSerProp_tblPrType::Shd == type )
@ -1710,17 +1710,17 @@ public:
{
XmlUtils::CStringWriter oTempWriter;
res = Read2(length, &Binary_tblPrReader::Read_tblpPr, this, &oTempWriter);
pWiterTblPr->tblpPr.Append(CString(_T("<w:tblpPr w:vertAnchor=\"page\" w:horzAnchor=\"page\"")));
pWiterTblPr->tblpPr.Append(oTempWriter.GetData());
pWiterTblPr->tblpPr.Append(CString(_T("/>")));
pWiterTblPr->tblpPr += L"<w:tblpPr w:vertAnchor=\"page\" w:horzAnchor=\"page\"";
pWiterTblPr->tblpPr += oTempWriter.GetData();
pWiterTblPr->tblpPr += L"/>";
}
else if( c_oSerProp_tblPrType::tblpPr2 == type )
{
XmlUtils::CStringWriter oTempWriter;
res = Read2(length, &Binary_tblPrReader::Read_tblpPr2, this, &oTempWriter);
pWiterTblPr->tblpPr.Append(CString(_T("<w:tblpPr")));
pWiterTblPr->tblpPr.Append(oTempWriter.GetData());
pWiterTblPr->tblpPr.Append(CString(_T("/>")));
pWiterTblPr->tblpPr += L"<w:tblpPr";
pWiterTblPr->tblpPr += oTempWriter.GetData();
pWiterTblPr->tblpPr += L"/>";
}
else if( c_oSerProp_tblPrType::Style == type )
{
@ -1888,10 +1888,10 @@ public:
CString sXml;
switch(m_oBufferedStream.GetUChar())
{
case 0:sXml.Append(_T(" w:horzAnchor=\"margin\""));break;
case 1:sXml.Append(_T(" w:horzAnchor=\"page\""));break;
case 2:sXml.Append(_T(" w:horzAnchor=\"text\""));break;
default:sXml.Append(_T(" w:horzAnchor=\"text\""));break;
case 0:sXml += (_T(" w:horzAnchor=\"margin\""));break;
case 1:sXml += (_T(" w:horzAnchor=\"page\""));break;
case 2:sXml += (_T(" w:horzAnchor=\"text\""));break;
default:sXml += (_T(" w:horzAnchor=\"text\""));break;
}
pCStringWriter->WriteString(sXml);
}
@ -1907,12 +1907,12 @@ public:
CString sXml;
switch(m_oBufferedStream.GetUChar())
{
case 0:sXml.Append(_T(" w:tblpXSpec=\"center\""));break;
case 1:sXml.Append(_T(" w:tblpXSpec=\"inside\""));break;
case 2:sXml.Append(_T(" w:tblpXSpec=\"left\""));break;
case 3:sXml.Append(_T(" w:tblpXSpec=\"outside\""));break;
case 4:sXml.Append(_T(" w:tblpXSpec=\"right\""));break;
default:sXml.Append(_T(" w:tblpXSpec=\"left\""));break;
case 0:sXml += (_T(" w:tblpXSpec=\"center\""));break;
case 1:sXml += (_T(" w:tblpXSpec=\"inside\""));break;
case 2:sXml += (_T(" w:tblpXSpec=\"left\""));break;
case 3:sXml += (_T(" w:tblpXSpec=\"outside\""));break;
case 4:sXml += (_T(" w:tblpXSpec=\"right\""));break;
default:sXml += (_T(" w:tblpXSpec=\"left\""));break;
}
pCStringWriter->WriteString(sXml);
}
@ -1921,10 +1921,10 @@ public:
CString sXml;
switch(m_oBufferedStream.GetUChar())
{
case 0:sXml.Append(_T(" w:vertAnchor=\"margin\""));break;
case 1:sXml.Append(_T(" w:vertAnchor=\"page\""));break;
case 2:sXml.Append(_T(" w:vertAnchor=\"text\""));break;
default:sXml.Append(_T(" w:vertAnchor=\"text\""));break;
case 0:sXml += (_T(" w:vertAnchor=\"margin\""));break;
case 1:sXml += (_T(" w:vertAnchor=\"page\""));break;
case 2:sXml += (_T(" w:vertAnchor=\"text\""));break;
default:sXml += (_T(" w:vertAnchor=\"text\""));break;
}
pCStringWriter->WriteString(sXml);
}
@ -1940,13 +1940,13 @@ public:
CString sXml;
switch(m_oBufferedStream.GetUChar())
{
case 0:sXml.Append(_T(" w:tblpYSpec=\"bottom\""));break;
case 1:sXml.Append(_T(" w:tblpYSpec=\"center\""));break;
case 2:sXml.Append(_T(" w:tblpYSpec=\"inline\""));break;
case 3:sXml.Append(_T(" w:tblpYSpec=\"inside\""));break;
case 4:sXml.Append(_T(" w:tblpYSpec=\"outside\""));break;
case 5:sXml.Append(_T(" w:tblpYSpec=\"top\""));break;
default:sXml.Append(_T(" w:tblpYSpec=\"top\""));break;
case 0:sXml += (_T(" w:tblpYSpec=\"bottom\""));break;
case 1:sXml += (_T(" w:tblpYSpec=\"center\""));break;
case 2:sXml += (_T(" w:tblpYSpec=\"inline\""));break;
case 3:sXml += (_T(" w:tblpYSpec=\"inside\""));break;
case 4:sXml += (_T(" w:tblpYSpec=\"outside\""));break;
case 5:sXml += (_T(" w:tblpYSpec=\"top\""));break;
default:sXml += (_T(" w:tblpYSpec=\"top\""));break;
}
pCStringWriter->WriteString(sXml);
}
@ -3058,36 +3058,36 @@ public:
{
switch(i)
{
case 0: sSchemeMapping.Append(_T(" w:accent1"));break;
case 1: sSchemeMapping.Append(_T(" w:accent2"));break;
case 2: sSchemeMapping.Append(_T(" w:accent3"));break;
case 3: sSchemeMapping.Append(_T(" w:accent4"));break;
case 4: sSchemeMapping.Append(_T(" w:accent5"));break;
case 5: sSchemeMapping.Append(_T(" w:accent6"));break;
case 6: sSchemeMapping.Append(_T(" w:bg1"));break;
case 7: sSchemeMapping.Append(_T(" w:bg2"));break;
case 8: sSchemeMapping.Append(_T(" w:followedHyperlink"));break;
case 9: sSchemeMapping.Append(_T(" w:hyperlink"));break;
case 10: sSchemeMapping.Append(_T(" w:t1"));break;
case 11: sSchemeMapping.Append(_T(" w:t2"));break;
case 0: sSchemeMapping += (_T(" w:accent1"));break;
case 1: sSchemeMapping += (_T(" w:accent2"));break;
case 2: sSchemeMapping += (_T(" w:accent3"));break;
case 3: sSchemeMapping += (_T(" w:accent4"));break;
case 4: sSchemeMapping += (_T(" w:accent5"));break;
case 5: sSchemeMapping += (_T(" w:accent6"));break;
case 6: sSchemeMapping += (_T(" w:bg1"));break;
case 7: sSchemeMapping += (_T(" w:bg2"));break;
case 8: sSchemeMapping += (_T(" w:followedHyperlink"));break;
case 9: sSchemeMapping += (_T(" w:hyperlink"));break;
case 10: sSchemeMapping += (_T(" w:t1"));break;
case 11: sSchemeMapping += (_T(" w:t2"));break;
}
switch(aSchemeMapping[i])
{
case 0: sSchemeMapping.Append(_T("=\"accent1\""));break;
case 1: sSchemeMapping.Append(_T("=\"accent2\""));break;
case 2: sSchemeMapping.Append(_T("=\"accent3\""));break;
case 3: sSchemeMapping.Append(_T("=\"accent4\""));break;
case 4: sSchemeMapping.Append(_T("=\"accent5\""));break;
case 5: sSchemeMapping.Append(_T("=\"accent6\""));break;
case 6: sSchemeMapping.Append(_T("=\"dark1\""));break;
case 7: sSchemeMapping.Append(_T("=\"dark2\""));break;
case 8: sSchemeMapping.Append(_T("=\"followedHyperlink\""));break;
case 9: sSchemeMapping.Append(_T("=\"hyperlink\""));break;
case 10: sSchemeMapping.Append(_T("=\"light1\""));break;
case 11: sSchemeMapping.Append(_T("=\"light2\""));break;
case 0: sSchemeMapping += (_T("=\"accent1\""));break;
case 1: sSchemeMapping += (_T("=\"accent2\""));break;
case 2: sSchemeMapping += (_T("=\"accent3\""));break;
case 3: sSchemeMapping += (_T("=\"accent4\""));break;
case 4: sSchemeMapping += (_T("=\"accent5\""));break;
case 5: sSchemeMapping += (_T("=\"accent6\""));break;
case 6: sSchemeMapping += (_T("=\"dark1\""));break;
case 7: sSchemeMapping += (_T("=\"dark2\""));break;
case 8: sSchemeMapping += (_T("=\"followedHyperlink\""));break;
case 9: sSchemeMapping += (_T("=\"hyperlink\""));break;
case 10: sSchemeMapping += (_T("=\"light1\""));break;
case 11: sSchemeMapping += (_T("=\"light2\""));break;
}
}
sSchemeMapping.Append(_T("/>"));
sSchemeMapping += (_T("/>"));
m_oSettingWriter.AddSetting(sSchemeMapping);
m_oFileWriter.m_pDrawingConverter->LoadClrMap(sSchemeMapping);
}
@ -3436,9 +3436,9 @@ public:
sFontName = XmlUtils::EncodeXmlString(sFontName);
CString sVal;
sVal.Append(_T("<m:mathFont m:val=\""));
sVal.Append(sFontName);
sVal.Append(_T("\" />"));
sVal += (_T("<m:mathFont m:val=\""));
sVal += (sFontName);
sVal += (_T("\" />"));
m_oFileWriter.m_oSettingWriter.AddSetting(sVal);
}
else
@ -4081,9 +4081,9 @@ public:
if (lVal)
{
CString sXml; sXml.Format(_T(" m:val=\"%d\""), lVal);
sVal.Append(sXml);
sVal += (sXml);
}
sVal.Append(_T(" />"));
sVal += (_T(" />"));
GetRunStringWriter().WriteString(sVal);
}
else
@ -4157,9 +4157,9 @@ public:
{
CString sChr = GetMathText (length);
CString sVal;
sVal.Append(_T("<m:begChr m:val=\""));
sVal.Append(sChr);
sVal.Append(_T("\" />"));
sVal += (_T("<m:begChr m:val=\""));
sVal += (sChr);
sVal += (_T("\" />"));
GetRunStringWriter().WriteString(sVal);
}
@ -4294,9 +4294,9 @@ public:
if (lVal)
{
CString sXml; sXml.Format(_T(" m:alnAt=\"%d\""), lVal);
sVal.Append(sXml);
sVal += (sXml);
}
sVal.Append(_T(" />"));
sVal += (_T(" />"));
GetRunStringWriter().WriteString(sVal);
}
else if ( c_oSer_OMathBottomNodesValType::Val == type )
@ -4320,9 +4320,9 @@ public:
if (lVal)
{
CString sXml; sXml.Format(_T(" m:val=\"%d\""), lVal);
sVal.Append(sXml);
sVal += (sXml);
}
sVal.Append(_T(" />"));
sVal += (_T(" />"));
GetRunStringWriter().WriteString(sVal);
}
else
@ -4341,9 +4341,9 @@ public:
if (lVal)
{
CString sXml; sXml.Format(_T(" m:val=\"%d\""), lVal);
sVal.Append(sXml);
sVal += (sXml);
}
sVal.Append(_T(" />"));
sVal += (_T(" />"));
GetRunStringWriter().WriteString(sVal);
}
else
@ -4358,9 +4358,9 @@ public:
{
CString sChr = GetMathText (length);
CString sVal;
sVal.Append(_T("<m:chr m:val=\""));
sVal.Append(sChr);
sVal.Append(_T("\" />"));
sVal += (_T("<m:chr m:val=\""));
sVal += (sChr);
sVal += (_T("\" />"));
GetRunStringWriter().WriteString(sVal);
}
else
@ -4378,9 +4378,9 @@ public:
if (lVal)
{
CString sXml; sXml.Format(_T(" m:val=\"%d\""), lVal);
sVal.Append(sXml);
sVal += (sXml);
}
sVal.Append(_T(" />"));
sVal += (_T(" />"));
GetRunStringWriter().WriteString(sVal);
}
else
@ -4398,9 +4398,9 @@ public:
if (lVal)
{
CString sXml; sXml.Format(_T(" m:val=\"%d\""), lVal);
sVal.Append(sXml);
sVal += (sXml);
}
sVal.Append(_T(" />"));
sVal += (_T(" />"));
GetRunStringWriter().WriteString(sVal);
}
else
@ -4546,9 +4546,9 @@ public:
{
CString sChr = GetMathText (length);
CString sVal;
sVal.Append(_T("<m:endChr m:val=\""));
sVal.Append(sChr);
sVal.Append(_T("\" />"));
sVal += (_T("<m:endChr m:val=\""));
sVal += (sChr);
sVal += (_T("\" />"));
GetRunStringWriter().WriteString(sVal);
}
else
@ -5566,9 +5566,9 @@ public:
if (lVal)
{
CString sXml; sXml.Format(_T(" m:val=\"%d\""), lVal);
sVal.Append(sXml);
sVal += (sXml);
}
sVal.Append(_T(" />"));
sVal += (_T(" />"));
GetRunStringWriter().WriteString(sVal);
}
else
@ -5586,9 +5586,9 @@ public:
if (lVal)
{
CString sXml; sXml.Format(_T(" m:val=\"%d\""), lVal);
sVal.Append(sXml);
sVal += (sXml);
}
sVal.Append(_T(" />"));
sVal += (_T(" />"));
GetRunStringWriter().WriteString(sVal);
}
else
@ -5626,9 +5626,9 @@ public:
{
CString sChr = GetMathText (length);
CString sVal;
sVal.Append(_T("<m:sepChr m:val=\""));
sVal.Append(sChr);
sVal.Append(_T("\" />"));
sVal += (_T("<m:sepChr m:val=\""));
sVal += (sChr);
sVal += (_T("\" />"));
GetRunStringWriter().WriteString(sVal);
}
else
@ -6572,30 +6572,15 @@ public:
}
else if( c_oSerBackgroundType::pptxDrawing == type )
{
CDrawingProperty oCDrawingProperty(m_oFileWriter.getNextDocPr());
oCDrawingProperty.bType = oCDrawingProperty.bHeight = oCDrawingProperty.bWidth = true;
oCDrawingProperty.Type = c_oAscWrapStyle::Inline;
CDrawingProperty oCDrawingProperty(m_oFileWriter.getNextDocPr());
res = Read2(length, &Binary_DocumentTableReader::ReadPptxDrawing, this, &oCDrawingProperty);
CString sDrawingProperty = oCDrawingProperty.Write();
BYTE type = m_oBufferedStream.GetUChar();
long lenType = m_oBufferedStream.GetUChar();
int nRealLen = m_oBufferedStream.GetLong();
CString* bstrDrawingXml = NULL;
long nCurPos = m_oBufferedStream.GetPos();
m_oFileWriter.m_pDrawingConverter->SaveObjectEx(nCurPos, nRealLen, sDrawingProperty, XMLWRITER_DOC_TYPE_DOCX, &bstrDrawingXml);
if(NULL != bstrDrawingXml && false == bstrDrawingXml->IsEmpty())
{
pBackground->sObject = *bstrDrawingXml;
}
RELEASEOBJECT(bstrDrawingXml);
m_oBufferedStream.Seek(nCurPos + nRealLen);
if (oCDrawingProperty.bDataPos && oCDrawingProperty.bDataLength)
{
long nCurPos = m_oBufferedStream.GetPos();
pBackground->sObject = m_oFileWriter.m_pDrawingConverter->SaveObjectBackground(oCDrawingProperty.DataPos, oCDrawingProperty.DataLength);
m_oBufferedStream.Seek(nCurPos);
}
}
else
res = c_oSerConstants::ReadUnknown;
@ -6814,6 +6799,13 @@ public:
oGraphicFramePr.m_oGraphicFrameLocks.reset(pLocking);
pDrawingProperty->sGraphicFramePr = oGraphicFramePr.toXML();
}
else if ( c_oSerImageType2::DocPr == type )
{
OOX::Drawing::CNonVisualDrawingProps pNonVisualDrawingProps;
pNonVisualDrawingProps.m_eType = OOX::et_wp_docPr;
res = Read1(length, &Binary_DocumentTableReader::ReadDocPr, this, &pNonVisualDrawingProps);
pDrawingProperty->sDocPr = pNonVisualDrawingProps.toXML();
}
else
res = c_oSerConstants::ReadUnknown;
return res;
@ -6856,6 +6848,39 @@ public:
res = c_oSerConstants::ReadUnknown;
return res;
}
int ReadDocPr(BYTE type, long length, void* poResult)
{
int res = c_oSerConstants::ReadOk;
OOX::Drawing::CNonVisualDrawingProps* pNonVisualDrawingProps = static_cast<OOX::Drawing::CNonVisualDrawingProps*>(poResult);
if ( c_oSerDocPr::Id == type )
{
pNonVisualDrawingProps->m_oId.Init();
pNonVisualDrawingProps->m_oId->SetValue(m_oBufferedStream.GetLong());
}
else if ( c_oSerDocPr::Name == type )
{
pNonVisualDrawingProps->m_sName.Init();
pNonVisualDrawingProps->m_sName->Append(m_oBufferedStream.GetString3(length));
}
else if ( c_oSerDocPr::Hidden == type )
{
pNonVisualDrawingProps->m_oHidden.Init();
pNonVisualDrawingProps->m_oHidden->FromBool(m_oBufferedStream.GetBool());
}
else if ( c_oSerDocPr::Title == type )
{
pNonVisualDrawingProps->m_sTitle.Init();
pNonVisualDrawingProps->m_sTitle->Append(m_oBufferedStream.GetString3(length));
}
else if ( c_oSerDocPr::Descr == type )
{
pNonVisualDrawingProps->m_sDescr.Init();
pNonVisualDrawingProps->m_sDescr->Append(m_oBufferedStream.GetString3(length));
}
else
res = c_oSerConstants::ReadUnknown;
return res;
}
int ReadEffectExtent(BYTE type, long length, void* poResult)
{
int res = c_oSerConstants::ReadOk;

View File

@ -198,7 +198,7 @@ namespace MathEquation
// nCurPos = WriteItemStart(BinDocxRW::c_oSerRunType::rPr);
CString sFontName;
//sFontName.Format(_T("%lS"), pFont->sName.c_str());
sFontName.Insert(0, _T("Cambria Math"));
if (sFontName)
{

View File

@ -557,7 +557,8 @@ extern int g_nCurFormatVersion;
SizeRelH = 27,
SizeRelV = 28,
Embedded = 29,
GraphicFramePr = 30
GraphicFramePr = 30,
DocPr = 31
};}
namespace c_oSerEffectExtent{enum c_oSerEffectExtent
{
@ -986,6 +987,14 @@ extern int g_nCurFormatVersion;
PrEndPos = 10,
PrRef = 11
};}
namespace c_oSerDocPr{enum c_oSerDocPr
{
Id = 0,
Name = 1,
Hidden = 2,
Title = 3,
Descr = 4
};}
}
#endif // #ifndef DOCX_BIN_READER_WRITER_DEFINES

View File

@ -5538,6 +5538,14 @@ namespace BinDocxRW
WriteNvGraphicFramePr(pInline.m_oCNvGraphicFramePr.get());
m_oBcw.WriteItemWithLengthEnd(nCurPos);
}
if(pInline.m_oDocPr.IsInit())
{
m_oBcw.m_oStream.WriteBYTE(c_oSerImageType2::DocPr);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Variable);
nCurPos = m_oBcw.WriteItemWithLengthStart();
WriteDocPr(pInline.m_oDocPr.get());
m_oBcw.WriteItemWithLengthEnd(nCurPos);
}
}
}
else if(img.m_oAnchor.IsInit() )
@ -5713,6 +5721,14 @@ namespace BinDocxRW
WriteNvGraphicFramePr(pAnchor.m_oCNvGraphicFramePr.get());
m_oBcw.WriteItemWithLengthEnd(nCurPos);
}
if(pAnchor.m_oDocPr.IsInit())
{
m_oBcw.m_oStream.WriteBYTE(c_oSerImageType2::DocPr);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Variable);
nCurPos = m_oBcw.WriteItemWithLengthStart();
WriteDocPr(pAnchor.m_oDocPr.get());
m_oBcw.WriteItemWithLengthEnd(nCurPos);
}
}
}
if(bDeleteDrawing)
@ -5761,6 +5777,40 @@ namespace BinDocxRW
}
}
}
void WriteDocPr(const OOX::Drawing::CNonVisualDrawingProps& oDocPr)
{
int nCurPos;
if(oDocPr.m_oId.IsInit())
{
nCurPos = m_oBcw.WriteItemStart(c_oSerDocPr::Id);
m_oBcw.m_oStream.WriteLONG(oDocPr.m_oId->GetValue());
m_oBcw.WriteItemWithLengthEnd(nCurPos);
}
if(oDocPr.m_sName.IsInit())
{
nCurPos = m_oBcw.WriteItemStart(c_oSerDocPr::Name);
m_oBcw.m_oStream.WriteStringW3(oDocPr.m_sName.get());
m_oBcw.WriteItemWithLengthEnd(nCurPos);
}
if(oDocPr.m_oHidden.IsInit())
{
nCurPos = m_oBcw.WriteItemStart(c_oSerDocPr::Hidden);
m_oBcw.m_oStream.WriteBOOL(oDocPr.m_oHidden->ToBool());
m_oBcw.WriteItemWithLengthEnd(nCurPos);
}
if(oDocPr.m_sTitle.IsInit())
{
nCurPos = m_oBcw.WriteItemStart(c_oSerDocPr::Title);
m_oBcw.m_oStream.WriteStringW3(oDocPr.m_sTitle.get());
m_oBcw.WriteItemWithLengthEnd(nCurPos);
}
if(oDocPr.m_sDescr.IsInit())
{
nCurPos = m_oBcw.WriteItemStart(c_oSerDocPr::Descr);
m_oBcw.m_oStream.WriteStringW3(oDocPr.m_sDescr.get());
m_oBcw.WriteItemWithLengthEnd(nCurPos);
}
}
void WriteEffectExtent(const OOX::Drawing::CEffectExtent& oEffectExtent)
{
m_oBcw.m_oStream.WriteBYTE(c_oSerEffectExtent::Left);
@ -6350,6 +6400,7 @@ namespace BinDocxRW
for(int i = 0, length = Content.size(); i < length; i++)
{
OOX::WritingElement* item = Content[i];
if(OOX::et_w_tc == item->getType())
{
OOX::Logic::CTc* tc = static_cast<OOX::Logic::CTc*>(item);

View File

@ -231,7 +231,7 @@ namespace BinXlsxRW{
m_pExternalDrawingConverter->SaveDstContentRels(pathRelsFile.GetPath());
CString sContentType(sContentTypePath);
sContentType.Append(strFilename);
sContentType += strFilename;
std::wstring sContent = L"<Override PartName=\"" + sContentType + L"\" ContentType=\"application/vnd.openxmlformats-officedocument.drawingml.chart+xml\"/>";
sContent += oSaveParams.sAdditionalContentTypes;

View File

@ -31,16 +31,17 @@ INCLUDEPATH += \
../../DesktopEditor/xml/libxml2/include \
SOURCES += ../DocWrapper/DocxSerializer.cpp \
SOURCES += \
../DocWrapper/DocxSerializer.cpp \
../DocWrapper/FontProcessor.cpp \
../DocWrapper/XlsxSerializer.cpp \
../BinWriter/BinWriters.cpp \
../DocWrapper/ChartWriter.cpp \
../BinWriter/BinWriters.cpp \
../../XlsxSerializerCom/Common/Common.cpp \
../../XlsxSerializerCom/Reader/ChartFromToBinary.cpp \
../../XlsxSerializerCom/Reader/CommonWriter.cpp \
../../XlsxSerializerCom/Reader/CSVReader.cpp \
../../XlsxSerializerCom/Writer/CSVWriter.cpp \
../DocWrapper/ChartWriter.cpp \
../../OfficeCryptReader/source/ECMACryptReader.cpp \
../../OfficeCryptReader/source/CryptTransform.cpp

View File

@ -34,21 +34,15 @@ CONFIG(debug, debug|release){
DEFINES += _DEBUG
}
build_fast {
core_release {
SOURCES += \
odffilereaderlib_odf_datatypes.cpp \
odffilereaderlib_odf.cpp \
odffilereaderlib_docx.cpp \
odffilereaderlib_pptx.cpp \
odffilereaderlib_xlsx.cpp \
odffilereaderlib_converter.cpp
} else {
odffilereaderlib_oox.cpp
}
core_debug {
SOURCES += \
../src/conversionelement.cpp \
../src/xml/attributes.cpp \
../src/xml/sax.cpp \
../src/xml/sax_xmllite.cpp \
../src/xml/utils.cpp \
../src/xml/xmlchar.cpp \
../src/odf/abstract_xml.cpp \
../src/odf/anim_elements.cpp \
../src/odf/calcs_styles.cpp \
@ -114,6 +108,15 @@ SOURCES += \
../src/odf/templates.cpp \
../src/odf/text_content.cpp \
../src/odf/text_elements.cpp \
../src/odf/math_elementaries.cpp \
../src/odf/math_layout_elements.cpp \
../src/odf/math_limit_elements.cpp \
../src/odf/math_table_elements.cpp \
../src/odf/math_token_elements.cpp \
../src/odf/datatypes/mathvariant.cpp \
../src/odf/calcext_elements.cpp \
../src/odf/table_database_ranges.cpp \
../src/odf/math_elements.cpp \
../src/odf/datatypes/anchortype.cpp \
../src/odf/datatypes/backgroundcolor.cpp \
../src/odf/datatypes/bool.cpp \
@ -204,6 +207,8 @@ SOURCES += \
../src/odf/datatypes/wrapoption.cpp \
../src/odf/datatypes/writingmode.cpp \
../src/odf/datatypes/xlink.cpp \
../src/docx/xlsx_conditionalFormatting.cpp \
../src/docx/xlsx_dxfs.cpp \
../src/docx/docx_content_type.cpp \
../src/docx/docx_conversion_context.cpp \
../src/docx/docx_drawing.cpp \
@ -272,27 +277,22 @@ SOURCES += \
../src/docx/xlsx_table_state.cpp \
../src/docx/xlsx_textcontext.cpp \
../src/docx/xlsx_utils.cpp \
../src/docx/xlsx_xf.cpp \
../src/common/CPColorUtils.cpp \
../src/common/CPString.cpp \
../src/common/readdocelement.cpp \
../src/ConvertOO2OOX.cpp \
../src/odf/math_elements.cpp
../src/docx/xlsx_xf.cpp
}
SOURCES += \
../formulasconvert/formulasconvert_oox.cpp \
../src/odf/math_elementaries.cpp \
../src/odf/math_layout_elements.cpp \
../src/odf/math_limit_elements.cpp \
../src/odf/math_table_elements.cpp \
../src/odf/math_token_elements.cpp \
../src/odf/datatypes/mathvariant.cpp \
../formulasconvert/formulasconvert_odf.cpp \
../src/odf/calcext_elements.cpp \
../src/odf/table_database_ranges.cpp \
../src/docx/xlsx_conditionalFormatting.cpp \
../src/docx/xlsx_dxfs.cpp
../src/conversionelement.cpp \
../src/xml/attributes.cpp \
../src/xml/sax.cpp \
../src/xml/sax_xmllite.cpp \
../src/xml/utils.cpp \
../src/xml/xmlchar.cpp \
../src/common/CPColorUtils.cpp \
../src/common/CPString.cpp \
../src/common/readdocelement.cpp \
../src/ConvertOO2OOX.cpp
HEADERS += \
../formulasconvert/formulasconvert.h \
@ -357,6 +357,16 @@ HEADERS += \
../src/odf/text_content.h \
../src/odf/text_elements.h \
../src/odf/visitor.h \
../src/ConvertOO2OOX.h \
../src/odf/math_elements.h \
../src/odf/math_elementaries.h \
../src/odf/math_layout_elements.h \
../src/odf/math_limit_elements.h \
../src/odf/math_table_elements.h \
../src/odf/math_token_elements.h \
../src/odf/datatypes/mathvariant.h \
../src/odf/calcext_elements.h \
../src/odf/table_database_ranges.h \
../src/odf/datatypes/anchortype.h \
../src/odf/datatypes/backgroundcolor.h \
../src/odf/datatypes/bool.h \
@ -456,6 +466,8 @@ HEADERS += \
../src/docx/docx_drawing.h \
../src/docx/docx_package.h \
../src/docx/docx_table_context.h \
../src/docx/xlsx_conditionalFormatting.h \
../src/docx/xlsx_dxfs.h \
../src/docx/drawing_object_description.h \
../src/docx/headers_footers.h \
../src/docx/hyperlinks.h \
@ -551,16 +563,5 @@ HEADERS += \
../include/cpdoccore/xml/simple_xml_writer.h \
../include/cpdoccore/xml/utils.h \
../include/cpdoccore/xml/xmlchar.h \
../include/cpdoccore/xml/xmlelement.h \
../src/ConvertOO2OOX.h \
../src/odf/math_elements.h \
../src/odf/math_elementaries.h \
../src/odf/math_layout_elements.h \
../src/odf/math_limit_elements.h \
../src/odf/math_table_elements.h \
../src/odf/math_token_elements.h \
../src/odf/datatypes/mathvariant.h \
../src/odf/calcext_elements.h \
../src/odf/table_database_ranges.h \
../src/docx/xlsx_conditionalFormatting.h \
../src/docx/xlsx_dxfs.h
../include/cpdoccore/xml/xmlelement.h

View File

@ -1,41 +0,0 @@
/*
* (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
*
*/
#include "../src/conversionelement.cpp"
#include "../src/xml/attributes.cpp"
#include "../src/xml/sax.cpp"
#include "../src/xml/sax_xmllite.cpp"
#include "../src/xml/utils.cpp"
#include "../src/xml/xmlchar.cpp"
#include "../src/common/CPColorUtils.cpp"
#include "../src/common/CPString.cpp"
#include "../src/common/readdocelement.cpp"
#include "../src/ConvertOO2OOX.cpp"

View File

@ -1,61 +0,0 @@
/*
* (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
*
*/
#include "../src/docx/docx_content_type.cpp"
#include "../src/docx/docx_conversion_context.cpp"
#include "../src/docx/docx_drawing.cpp"
#include "../src/docx/docx_package.cpp"
#include "../src/docx/docx_rels.cpp"
#include "../src/docx/docx_table_context.cpp"
#include "../src/docx/headers_footers.cpp"
#include "../src/docx/hyperlinks.cpp"
#include "../src/docx/measuredigits.cpp"
#include "../src/docx/mediaitems.cpp"
#include "../src/docx/mediaitems_utils.cpp"
#include "../src/docx/namespaces.cpp"
#include "../src/docx/oox_chart_axis.cpp"
#include "../src/docx/oox_chart_context.cpp"
#include "../src/docx/oox_chart_legend.cpp"
#include "../src/docx/oox_chart_series.cpp"
#include "../src/docx/oox_chart_shape.cpp"
#include "../src/docx/oox_conversion_context.cpp"
#include "../src/docx/oox_data_labels.cpp"
#include "../src/docx/oox_drawing.cpp"
#include "../src/docx/oox_drawing_fills.cpp"
#include "../src/docx/oox_layout.cpp"
#include "../src/docx/oox_package.cpp"
#include "../src/docx/oox_plot_area.cpp"
#include "../src/docx/oox_title.cpp"
#include "../src/docx/oox_types_chart.cpp"
#include "../src/odf/draw_frame_docx.cpp"
#include "../src/odf/draw_shapes_docx.cpp"
#include "../src/odf/style_paragraph_properties_docx.cpp"
#include "../src/odf/table_docx.cpp"

View File

@ -37,8 +37,14 @@
#include "../src/odf/documentcontext.cpp"
#include "../src/odf/draw_common.cpp"
#include "../src/odf/draw_frame.cpp"
#include "../src/odf/draw_frame_docx.cpp"
#include "../src/odf/draw_frame_pptx.cpp"
#include "../src/odf/draw_frame_xlsx.cpp"
#include "../src/odf/draw_page.cpp"
#include "../src/odf/draw_shapes.cpp"
#include "../src/odf/draw_shapes_docx.cpp"
#include "../src/odf/draw_shapes_pptx.cpp"
#include "../src/odf/draw_shapes_xlsx.cpp"
#include "../src/odf/font_face.cpp"
#include "../src/odf/header_footer.cpp"
#include "../src/odf/list.cpp"
@ -48,7 +54,6 @@
#include "../src/odf/odf_content_xml.cpp"
#include "../src/odf/odfcontext.cpp"
#include "../src/odf/odf_document.cpp"
#include "../src/odf/odf_document_impl.cpp"
#include "../src/odf/office_annotation.cpp"
#include "../src/odf/office_binary_data.cpp"
#include "../src/odf/office_body.cpp"
@ -69,6 +74,8 @@
#include "../src/odf/style_graphic_properties.cpp"
#include "../src/odf/style_map.cpp"
#include "../src/odf/style_paragraph_properties.cpp"
#include "../src/odf/style_paragraph_properties_docx.cpp"
#include "../src/odf/style_paragraph_properties_pptx.cpp"
#include "../src/odf/style_presentation.cpp"
#include "../src/odf/style_regions.cpp"
#include "../src/odf/styles.cpp"
@ -79,98 +86,20 @@
#include "../src/odf/svg_parser.cpp"
#include "../src/odf/table.cpp"
#include "../src/odf/table_calculation_settings.cpp"
#include "../src/odf/table_docx.cpp"
#include "../src/odf/table_named_expressions.cpp"
#include "../src/odf/table_pptx.cpp"
#include "../src/odf/table_xlsx.cpp"
#include "../src/odf/templates.cpp"
#include "../src/odf/text_content.cpp"
#include "../src/odf/text_elements.cpp"
#include "../src/odf/datatypes/anchortype.cpp"
#include "../src/odf/datatypes/backgroundcolor.cpp"
#include "../src/odf/datatypes/bool.cpp"
#include "../src/odf/datatypes/bordermodel.cpp"
#include "../src/odf/datatypes/borderstyle.cpp"
#include "../src/odf/datatypes/borderwidths.cpp"
#include "../src/odf/datatypes/calcext_type.cpp"
#include "../src/odf/datatypes/chartdatalabelnumber.cpp"
#include "../src/odf/datatypes/charterrorcategory.cpp"
#include "../src/odf/datatypes/chartinterpolation.cpp"
#include "../src/odf/datatypes/chartlabelarrangement.cpp"
#include "../src/odf/datatypes/chartregressiontype.cpp"
#include "../src/odf/datatypes/chartseriessource.cpp"
#include "../src/odf/datatypes/chartsolidtype.cpp"
#include "../src/odf/datatypes/chartsymbol.cpp"
#include "../src/odf/datatypes/clockvalue.cpp"
#include "../src/odf/datatypes/color.cpp"
#include "../src/odf/datatypes/common_attlists.cpp"
#include "../src/odf/datatypes/direction.cpp"
#include "../src/odf/datatypes/drawfill.cpp"
#include "../src/odf/datatypes/dropcaplength.cpp"
#include "../src/odf/datatypes/fillimagerefpoint.cpp"
#include "../src/odf/datatypes/fobreak.cpp"
#include "../src/odf/datatypes/fontfamilygeneric.cpp"
#include "../src/odf/datatypes/fontpitch.cpp"
#include "../src/odf/datatypes/fontrelief.cpp"
#include "../src/odf/datatypes/fontsize.cpp"
#include "../src/odf/datatypes/fontstretch.cpp"
#include "../src/odf/datatypes/fontstyle.cpp"
#include "../src/odf/datatypes/fontvariant.cpp"
#include "../src/odf/datatypes/fontweight.cpp"
#include "../src/odf/datatypes/gradientstyle.cpp"
#include "../src/odf/datatypes/hatchstyle.cpp"
#include "../src/odf/datatypes/hyphenationkeep.cpp"
#include "../src/odf/datatypes/hyphenationladdercount.cpp"
#include "../src/odf/datatypes/iconset_type.cpp"
#include "../src/odf/datatypes/keeptogether.cpp"
#include "../src/odf/datatypes/layoutgridmode.cpp"
#include "../src/odf/datatypes/length.cpp"
#include "../src/odf/datatypes/lengthorpercent.cpp"
#include "../src/odf/datatypes/letterspacing.cpp"
#include "../src/odf/datatypes/linebreak.cpp"
#include "../src/odf/datatypes/linemode.cpp"
#include "../src/odf/datatypes/linestyle.cpp"
#include "../src/odf/datatypes/linetype.cpp"
#include "../src/odf/datatypes/linewidth.cpp"
#include "../src/odf/datatypes/markerstyle.cpp"
#include "../src/odf/datatypes/noteclass.cpp"
#include "../src/odf/datatypes/officevaluetype.cpp"
#include "../src/odf/datatypes/pageusage.cpp"
#include "../src/odf/datatypes/percent.cpp"
#include "../src/odf/datatypes/percentorscale.cpp"
#include "../src/odf/datatypes/presentationclass.cpp"
#include "../src/odf/datatypes/punctuationwrap.cpp"
#include "../src/odf/datatypes/rotationalign.cpp"
#include "../src/odf/datatypes/runthrough.cpp"
#include "../src/odf/datatypes/scripttype.cpp"
#include "../src/odf/datatypes/shadowtype.cpp"
#include "../src/odf/datatypes/smil_transitiontype.cpp"
#include "../src/odf/datatypes/stylefamily.cpp"
#include "../src/odf/datatypes/stylehorizontalpos.cpp"
#include "../src/odf/datatypes/stylehorizontalrel.cpp"
#include "../src/odf/datatypes/styleleadercolor.cpp"
#include "../src/odf/datatypes/styleposition.cpp"
#include "../src/odf/datatypes/style_ref.cpp"
#include "../src/odf/datatypes/stylerepeat.cpp"
#include "../src/odf/datatypes/styletype.cpp"
#include "../src/odf/datatypes/styleverticalpos.cpp"
#include "../src/odf/datatypes/styleverticalrel.cpp"
#include "../src/odf/datatypes/stylewrap.cpp"
#include "../src/odf/datatypes/stylewrapcontourmode.cpp"
#include "../src/odf/datatypes/tablealign.cpp"
#include "../src/odf/datatypes/tablecentering.cpp"
#include "../src/odf/datatypes/tablemode.cpp"
#include "../src/odf/datatypes/tablevisibility.cpp"
#include "../src/odf/datatypes/targetframename.cpp"
#include "../src/odf/datatypes/textalign.cpp"
#include "../src/odf/datatypes/textalignsource.cpp"
#include "../src/odf/datatypes/textautospace.cpp"
#include "../src/odf/datatypes/textcombine.cpp"
#include "../src/odf/datatypes/textdisplay.cpp"
#include "../src/odf/datatypes/textemphasize.cpp"
#include "../src/odf/datatypes/textposition.cpp"
#include "../src/odf/datatypes/textrotationscale.cpp"
#include "../src/odf/datatypes/texttransform.cpp"
#include "../src/odf/datatypes/underlinecolor.cpp"
#include "../src/odf/datatypes/verticalalign.cpp"
#include "../src/odf/datatypes/wrapoption.cpp"
#include "../src/odf/datatypes/writingmode.cpp"
#include "../src/odf/datatypes/xlink.cpp"
#include "../src/odf/math_elementaries.cpp"
#include "../src/odf/math_layout_elements.cpp"
#include "../src/odf/math_limit_elements.cpp"
#include "../src/odf/math_table_elements.cpp"
#include "../src/odf/math_token_elements.cpp"
#include "../src/odf/datatypes/mathvariant.cpp"
#include "../src/odf/calcext_elements.cpp"
#include "../src/odf/table_database_ranges.cpp"
#include "../src/odf/math_elements.cpp"
#include "../src/odf/odf_document_impl.cpp"

View File

@ -0,0 +1,121 @@
/*
* (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
*
*/
#include "../src/odf/datatypes/anchortype.cpp"
#include "../src/odf/datatypes/backgroundcolor.cpp"
#include "../src/odf/datatypes/bool.cpp"
#include "../src/odf/datatypes/bordermodel.cpp"
#include "../src/odf/datatypes/borderstyle.cpp"
#include "../src/odf/datatypes/borderwidths.cpp"
#include "../src/odf/datatypes/calcext_type.cpp"
#include "../src/odf/datatypes/chartdatalabelnumber.cpp"
#include "../src/odf/datatypes/charterrorcategory.cpp"
#include "../src/odf/datatypes/chartinterpolation.cpp"
#include "../src/odf/datatypes/chartlabelarrangement.cpp"
#include "../src/odf/datatypes/chartregressiontype.cpp"
#include "../src/odf/datatypes/chartseriessource.cpp"
#include "../src/odf/datatypes/chartsolidtype.cpp"
#include "../src/odf/datatypes/chartsymbol.cpp"
#include "../src/odf/datatypes/clockvalue.cpp"
#include "../src/odf/datatypes/color.cpp"
#include "../src/odf/datatypes/common_attlists.cpp"
#include "../src/odf/datatypes/direction.cpp"
#include "../src/odf/datatypes/drawfill.cpp"
#include "../src/odf/datatypes/dropcaplength.cpp"
#include "../src/odf/datatypes/fillimagerefpoint.cpp"
#include "../src/odf/datatypes/fobreak.cpp"
#include "../src/odf/datatypes/fontfamilygeneric.cpp"
#include "../src/odf/datatypes/fontpitch.cpp"
#include "../src/odf/datatypes/fontrelief.cpp"
#include "../src/odf/datatypes/fontsize.cpp"
#include "../src/odf/datatypes/fontstretch.cpp"
#include "../src/odf/datatypes/fontstyle.cpp"
#include "../src/odf/datatypes/fontvariant.cpp"
#include "../src/odf/datatypes/fontweight.cpp"
#include "../src/odf/datatypes/gradientstyle.cpp"
#include "../src/odf/datatypes/hatchstyle.cpp"
#include "../src/odf/datatypes/hyphenationkeep.cpp"
#include "../src/odf/datatypes/hyphenationladdercount.cpp"
#include "../src/odf/datatypes/iconset_type.cpp"
#include "../src/odf/datatypes/keeptogether.cpp"
#include "../src/odf/datatypes/layoutgridmode.cpp"
#include "../src/odf/datatypes/length.cpp"
#include "../src/odf/datatypes/lengthorpercent.cpp"
#include "../src/odf/datatypes/letterspacing.cpp"
#include "../src/odf/datatypes/linebreak.cpp"
#include "../src/odf/datatypes/linemode.cpp"
#include "../src/odf/datatypes/linestyle.cpp"
#include "../src/odf/datatypes/linetype.cpp"
#include "../src/odf/datatypes/linewidth.cpp"
#include "../src/odf/datatypes/markerstyle.cpp"
#include "../src/odf/datatypes/noteclass.cpp"
#include "../src/odf/datatypes/officevaluetype.cpp"
#include "../src/odf/datatypes/pageusage.cpp"
#include "../src/odf/datatypes/percent.cpp"
#include "../src/odf/datatypes/percentorscale.cpp"
#include "../src/odf/datatypes/presentationclass.cpp"
#include "../src/odf/datatypes/punctuationwrap.cpp"
#include "../src/odf/datatypes/rotationalign.cpp"
#include "../src/odf/datatypes/runthrough.cpp"
#include "../src/odf/datatypes/scripttype.cpp"
#include "../src/odf/datatypes/shadowtype.cpp"
#include "../src/odf/datatypes/smil_transitiontype.cpp"
#include "../src/odf/datatypes/stylefamily.cpp"
#include "../src/odf/datatypes/stylehorizontalpos.cpp"
#include "../src/odf/datatypes/stylehorizontalrel.cpp"
#include "../src/odf/datatypes/styleleadercolor.cpp"
#include "../src/odf/datatypes/styleposition.cpp"
#include "../src/odf/datatypes/style_ref.cpp"
#include "../src/odf/datatypes/stylerepeat.cpp"
#include "../src/odf/datatypes/styletype.cpp"
#include "../src/odf/datatypes/styleverticalpos.cpp"
#include "../src/odf/datatypes/styleverticalrel.cpp"
#include "../src/odf/datatypes/stylewrap.cpp"
#include "../src/odf/datatypes/stylewrapcontourmode.cpp"
#include "../src/odf/datatypes/tablealign.cpp"
#include "../src/odf/datatypes/tablecentering.cpp"
#include "../src/odf/datatypes/tablemode.cpp"
#include "../src/odf/datatypes/tablevisibility.cpp"
#include "../src/odf/datatypes/targetframename.cpp"
#include "../src/odf/datatypes/textalign.cpp"
#include "../src/odf/datatypes/textalignsource.cpp"
#include "../src/odf/datatypes/textautospace.cpp"
#include "../src/odf/datatypes/textcombine.cpp"
#include "../src/odf/datatypes/textdisplay.cpp"
#include "../src/odf/datatypes/textemphasize.cpp"
#include "../src/odf/datatypes/textposition.cpp"
#include "../src/odf/datatypes/textrotationscale.cpp"
#include "../src/odf/datatypes/texttransform.cpp"
#include "../src/odf/datatypes/underlinecolor.cpp"
#include "../src/odf/datatypes/verticalalign.cpp"
#include "../src/odf/datatypes/wrapoption.cpp"
#include "../src/odf/datatypes/writingmode.cpp"
#include "../src/odf/datatypes/xlink.cpp"

View File

@ -1,68 +1,102 @@
/*
* (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
*
*/
#include "../src/docx/xlsx_utils.cpp"
#include "../src/odf/draw_frame_xlsx.cpp"
#include "../src/odf/draw_shapes_xlsx.cpp"
#include "../src/odf/table_xlsx.cpp"
#include "../src/docx/xlsx_alignment.cpp"
#include "../src/docx/xlsx_border.cpp"
#include "../src/docx/xlsx_borders.cpp"
#include "../src/docx/xlsx_cell_format.cpp"
#include "../src/docx/xlsx_cell_style.cpp"
#include "../src/docx/xlsx_cell_styles.cpp"
#include "../src/docx/xlsx_color.cpp"
#include "../src/docx/xlsx_comments.cpp"
#include "../src/docx/xlsx_comments_context.cpp"
#include "../src/docx/xlsx_complex_number_format.cpp"
#include "../src/docx/xlsxconversioncontext.cpp"
#include "../src/docx/xlsx_defined_names.cpp"
#include "../src/docx/xlsx_drawing.cpp"
#include "../src/docx/xlsx_drawing_context.cpp"
#include "../src/docx/xlsx_drawings.cpp"
#include "../src/docx/xlsx_fill.cpp"
#include "../src/docx/xlsx_fills.cpp"
#include "../src/docx/xlsx_font.cpp"
#include "../src/docx/xlsx_fonts.cpp"
#include "../src/docx/xlsx_hyperlinks.cpp"
#include "../src/docx/xlsx_merge_cells.cpp"
#include "../src/docx/xlsx_numFmts.cpp"
#include "../src/docx/xlsx_num_format_context.cpp"
#include "../src/docx/xlsx_output_xml.cpp"
#include "../src/docx/xlsx_package.cpp"
#include "../src/docx/xlsx_protection.cpp"
#include "../src/docx/xlsx_sharedstrings.cpp"
#include "../src/docx/xlsx_styles.cpp"
#include "../src/docx/xlsx_tablecontext.cpp"
#include "../src/docx/xlsx_table_metrics.cpp"
#include "../src/docx/xlsx_table_state.cpp"
#include "../src/docx/xlsx_textcontext.cpp"
#include "../src/docx/xlsx_xf.cpp"
/*
* (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
*
*/
#include "../src/docx/xlsx_conditionalFormatting.cpp"
#include "../src/docx/xlsx_dxfs.cpp"
#include "../src/docx/docx_content_type.cpp"
#include "../src/docx/docx_conversion_context.cpp"
#include "../src/docx/docx_drawing.cpp"
#include "../src/docx/docx_package.cpp"
#include "../src/docx/docx_table_context.cpp"
#include "../src/docx/headers_footers.cpp"
#include "../src/docx/hyperlinks.cpp"
#include "../src/docx/measuredigits.cpp"
#include "../src/docx/mediaitems.cpp"
#include "../src/docx/namespaces.cpp"
#include "../src/docx/oox_chart_axis.cpp"
#include "../src/docx/oox_chart_context.cpp"
#include "../src/docx/oox_chart_legend.cpp"
#include "../src/docx/oox_chart_series.cpp"
#include "../src/docx/oox_chart_shape.cpp"
#include "../src/docx/oox_conversion_context.cpp"
#include "../src/docx/oox_data_labels.cpp"
#include "../src/docx/oox_drawing.cpp"
#include "../src/docx/oox_drawing_fills.cpp"
#include "../src/docx/oox_layout.cpp"
#include "../src/docx/oox_package.cpp"
#include "../src/docx/oox_plot_area.cpp"
#include "../src/docx/oox_title.cpp"
#include "../src/docx/oox_types_chart.cpp"
#include "../src/docx/oox_rels.cpp"
#include "../src/docx/pptx_comments.cpp"
#include "../src/docx/pptx_comments_context.cpp"
#include "../src/docx/pptx_conversion_context.cpp"
#include "../src/docx/pptx_drawing.cpp"
#include "../src/docx/pptx_drawings.cpp"
#include "../src/docx/pptx_output_xml.cpp"
#include "../src/docx/pptx_package.cpp"
#include "../src/docx/pptx_slide_context.cpp"
#include "../src/docx/pptx_table_context.cpp"
#include "../src/docx/pptx_text_context.cpp"
#include "../src/docx/xlsx_alignment.cpp"
#include "../src/docx/xlsx_border.cpp"
#include "../src/docx/xlsx_borders.cpp"
#include "../src/docx/xlsx_cell_format.cpp"
#include "../src/docx/xlsx_cell_style.cpp"
#include "../src/docx/xlsx_cell_styles.cpp"
#include "../src/docx/xlsx_color.cpp"
#include "../src/docx/xlsx_comments.cpp"
#include "../src/docx/xlsx_comments_context.cpp"
#include "../src/docx/xlsx_complex_number_format.cpp"
#include "../src/docx/xlsxconversioncontext.cpp"
#include "../src/docx/xlsx_defined_names.cpp"
#include "../src/docx/xlsx_drawing.cpp"
#include "../src/docx/xlsx_drawing_context.cpp"
#include "../src/docx/xlsx_drawings.cpp"
#include "../src/docx/xlsx_fill.cpp"
#include "../src/docx/xlsx_fills.cpp"
#include "../src/docx/xlsx_font.cpp"
#include "../src/docx/xlsx_fonts.cpp"
#include "../src/docx/xlsx_hyperlinks.cpp"
#include "../src/docx/xlsx_merge_cells.cpp"
#include "../src/docx/xlsx_numFmts.cpp"
#include "../src/docx/xlsx_num_format_context.cpp"
#include "../src/docx/xlsx_output_xml.cpp"
#include "../src/docx/xlsx_package.cpp"
#include "../src/docx/xlsx_protection.cpp"
#include "../src/docx/xlsx_sharedstrings.cpp"
#include "../src/docx/xlsx_styles.cpp"
#include "../src/docx/xlsx_tablecontext.cpp"
#include "../src/docx/xlsx_table_metrics.cpp"
#include "../src/docx/xlsx_table_state.cpp"
#include "../src/docx/xlsx_textcontext.cpp"
#include "../src/docx/xlsx_utils.cpp"
#include "../src/docx/xlsx_xf.cpp"

View File

@ -1,45 +0,0 @@
/*
* (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
*
*/
#include "../src/odf/draw_frame_pptx.cpp"
#include "../src/odf/draw_shapes_pptx.cpp"
#include "../src/odf/style_paragraph_properties_pptx.cpp"
#include "../src/odf/table_pptx.cpp"
#include "../src/docx/pptx_comments.cpp"
#include "../src/docx/pptx_comments_context.cpp"
#include "../src/docx/pptx_conversion_context.cpp"
#include "../src/docx/pptx_drawing.cpp"
#include "../src/docx/pptx_drawings.cpp"
#include "../src/docx/pptx_output_xml.cpp"
#include "../src/docx/pptx_package.cpp"
#include "../src/docx/pptx_slide_context.cpp"
#include "../src/docx/pptx_table_context.cpp"
#include "../src/docx/pptx_text_context.cpp"

View File

@ -38,24 +38,9 @@ namespace cpdoccore {
namespace oox {
static const int _odf_to_docx_ShapeType[]=
{ 4,4,4,34,};
static const std::wstring _docxShapeType[]=
{
L"rect",
L"rect",
L"rect",
L"ellipse",
L"ellipse",
L"line",
L"custGeom"
};
namespace {
}
void serialize_wrap_top_bottom(std::wostream & strm, _docx_drawing const & val)
{

View File

@ -38,20 +38,6 @@ namespace cpdoccore {
namespace oox {
static const int _odf_to_docx_ShapeType[]=
{ 4,4,4,34,};
static const std::wstring _docxShapeType[]=
{
L"rect",
L"rect",
L"rect",
L"ellipse",
L"ellipse",
L"line",
L"custGeom"
};
void pptx_serialize_text(std::wostream & strm, _pptx_drawing & val)
{
_CP_OPT(std::wstring) strTextContent;

View File

@ -188,9 +188,7 @@ std::wstring cellType2Str(XlsxCellType::type type)
boost::int64_t convertDate(int Year, int Month, int Day)
{
using namespace boost::gregorian;
boost::int64_t daysFrom1900 = date_duration(date(Year, Month, Day) - date(1900, 1, 1)).days() + 1;
boost::int64_t daysFrom1900 = boost::gregorian::date_duration(boost::gregorian::date(Year, Month, Day) - boost::gregorian::date(1900, 1, 1)).days() + 1;
if (Year <= 1900 &&
Month <= 2 &&
@ -225,9 +223,9 @@ bool parseDate(const std::wstring & Date, int & Year, int & Month, int & Day)
boost::match_results<std::wstring::const_iterator> res;
if (boost::regex_match(Date, res, r))
{
Year = boost::lexical_cast<int>(res[1].str());
Month = boost::lexical_cast<int>(res[2].str());
Day = boost::lexical_cast<int>(res[3].str());
Year = boost::lexical_cast<int>(res[1].str());
Month = boost::lexical_cast<int>(res[2].str());
Day = boost::lexical_cast<int>(res[3].str());
int Hours, Minutes, Sec, FSec;
if (res[4].matched)
@ -259,7 +257,7 @@ bool parseTime(const std::wstring & Time, int & Hours, int & Minutes, double & s
boost::match_results<std::wstring::const_iterator> res;
if (boost::regex_match(Time, res, r))
{
Hours = boost::lexical_cast<int>(res[1].str());
Hours = boost::lexical_cast<int>(res[1].str());
Minutes = boost::lexical_cast<int>(res[2].str());
seconds = boost::lexical_cast<int>(res[3].str());

View File

@ -85,6 +85,7 @@
#include "documentcontext.h"
#include "../progressCallback.h"
#define PROGRESSEVENT_ID 0
namespace cpdoccore {
@ -146,6 +147,7 @@ odf_document::Impl::Impl(const std::wstring & folderPath, const ProgressCallback
UpdateProgress(400000);
}
bool odf_document::Impl::UpdateProgress(long nComplete)
{
if (pCallBack)
@ -160,6 +162,7 @@ bool odf_document::Impl::UpdateProgress(long nComplete)
return false;
}
void odf_document::Impl::parse_fonts()
{
do

View File

@ -110,7 +110,7 @@ std::wstring process_border(const border_style & borderStyle,
return res;
}
std::wstring process_margin(const _CP_OPT(length_or_percent) & margin, double Mul)
std::wstring docx_process_margin(const _CP_OPT(length_or_percent) & margin, double Mul)
{
if (margin)
{
@ -288,8 +288,8 @@ void paragraph_format_properties::docx_convert(oox::docx_conversion_context & Co
std::wstring w_after, w_before;
std::wstring w_line, w_lineRule;
w_after = process_margin(fo_margin_bottom_, 20.0);
w_before = process_margin(fo_margin_top_, 20.0);
w_after = docx_process_margin(fo_margin_bottom_, 20.0);
w_before = docx_process_margin(fo_margin_top_, 20.0);
// TODO : здесь 240 берется из корневого стиля? надо не константу использовать а брать оттуда
// в xsl преобразованиях так же написано
@ -341,9 +341,9 @@ void paragraph_format_properties::docx_convert(oox::docx_conversion_context & Co
// TODO auto indent
std::wstring w_left, w_right, w_hanging, w_firstLine;
w_left = process_margin(fo_margin_left_, 20.0);
w_right = process_margin(fo_margin_right_, 20.0);
w_firstLine = process_margin(fo_text_indent_, 20.0);
w_left = docx_process_margin(fo_margin_left_, 20.0);
w_right = docx_process_margin(fo_margin_right_, 20.0);
w_firstLine = docx_process_margin(fo_text_indent_, 20.0);
if (w_left.empty()) w_left = L"0";
if (w_right.empty()) w_right = L"0";

View File

@ -106,7 +106,7 @@ std::wstring process_border(border_style & borderStyle,
return res;
}
std::wstring process_margin(const _CP_OPT(length_or_percent) & margin, length::unit unit, double Mul)
std::wstring pptx_process_margin(const _CP_OPT(length_or_percent) & margin, length::unit unit, double Mul)
{
if (margin)
{
@ -156,9 +156,9 @@ void paragraph_format_properties::xlsx_convert(std::wostream & strm, bool in_dra
// TODO auto indent
std::wstring w_left, w_right, w_firstLine;
w_left = process_margin(fo_margin_left_, length::emu, 1.);
w_right = process_margin(fo_margin_right_, length::emu, 1.);
w_firstLine = process_margin(fo_text_indent_,length::emu, 1.);
w_left = pptx_process_margin(fo_margin_left_, length::emu, 1.);
w_right = pptx_process_margin(fo_margin_right_, length::emu, 1.);
w_firstLine = pptx_process_margin(fo_text_indent_,length::emu, 1.);
//if (w_left.empty()) w_left = L"0";
//if (w_right.empty()) w_right = L"0";
@ -227,7 +227,7 @@ void paragraph_format_properties::xlsx_convert(std::wostream & strm, bool in_dra
{
if (fo_margin_bottom_->get_type() == length_or_percent::Length)
{
std::wstring w_before = process_margin(fo_margin_top_, length::pt, 100.0);
std::wstring w_before = pptx_process_margin(fo_margin_top_, length::pt, 100.0);
CP_XML_NODE(L"a:spcPts")
{
CP_XML_ATTR(L"val",w_before);
@ -250,7 +250,7 @@ void paragraph_format_properties::xlsx_convert(std::wostream & strm, bool in_dra
{
if (fo_margin_bottom_->get_type() == length_or_percent::Length)
{
std::wstring w_after = process_margin(fo_margin_bottom_, length::pt, 100.0);
std::wstring w_after = pptx_process_margin(fo_margin_bottom_, length::pt, 100.0);
CP_XML_NODE(L"a:spcPts")
{
CP_XML_ATTR(L"val",w_after);
@ -281,9 +281,9 @@ void paragraph_format_properties::pptx_convert(oox::pptx_conversion_context & Co
// TODO auto indent
std::wstring w_left, w_right, w_firstLine;
w_left = process_margin(fo_margin_left_, length::emu, 1.);
w_right = process_margin(fo_margin_right_, length::emu, 1.);
w_firstLine = process_margin(fo_text_indent_,length::emu, 1.);
w_left = pptx_process_margin(fo_margin_left_, length::emu, 1.);
w_right = pptx_process_margin(fo_margin_right_, length::emu, 1.);
w_firstLine = pptx_process_margin(fo_text_indent_,length::emu, 1.);
//if (w_left.empty()) w_left = L"0";
//if (w_right.empty()) w_right = L"0";
@ -460,7 +460,7 @@ void paragraph_format_properties::pptx_convert(oox::pptx_conversion_context & Co
{
if (fo_margin_bottom_->get_type() == length_or_percent::Length)
{
std::wstring w_before = process_margin(fo_margin_top_, length::pt, 100.0);
std::wstring w_before = pptx_process_margin(fo_margin_top_, length::pt, 100.0);
CP_XML_NODE(L"a:spcPts")
{
CP_XML_ATTR(L"val",w_before);
@ -483,7 +483,7 @@ void paragraph_format_properties::pptx_convert(oox::pptx_conversion_context & Co
{
if (fo_margin_bottom_->get_type() == length_or_percent::Length)
{
std::wstring w_after = process_margin(fo_margin_bottom_, length::pt, 100.0);
std::wstring w_after = pptx_process_margin(fo_margin_bottom_, length::pt, 100.0);
CP_XML_NODE(L"a:spcPts")
{
CP_XML_ATTR(L"val",w_after);

View File

@ -29,14 +29,16 @@
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
typedef void (*OnProgressCallback)( void* lpParam, long nID, long nPercent );
typedef void (*OnProgressExCallback)( void* lpParam, long nID, long nPercent, short* Cancel );
typedef void (*OnProgressCallbackOdf) ( void* lpParam, long nID, long nPercent );
typedef void (*OnProgressExCallbackOdf)( void* lpParam, long nID, long nPercent, short* Cancel ) ;
struct ProgressCallback
{
OnProgressCallback OnProgress;
OnProgressExCallback OnProgressEx;
OnProgressCallbackOdf OnProgress;
OnProgressExCallbackOdf OnProgressEx;
void* caller;
};

View File

@ -35,10 +35,12 @@ CONFIG(debug, debug|release){
DEFINES += _DEBUG
}
build_fast {
core_release {
SOURCES += \
odffilewriterlib_all.cpp
} else {
odffilewriterlib_odf.cpp
}
core_debug {
SOURCES += \
../source/OdfFormat/abstract_xml.cpp \
../source/OdfFormat/calcext_elements.cpp \
@ -93,17 +95,18 @@ SOURCES += \
../source/OdfFormat/table_database_ranges.cpp \
../source/OdfFormat/table_named_expressions.cpp \
../source/OdfFormat/text_elements.cpp \
../source/Oox2OdfConverter/ConvertDiagram.cpp \
../source/Oox2OdfConverter/Converter.cpp \
../source/Oox2OdfConverter/ConverterChart.cpp \
../source/Oox2OdfConverter/ConvertVml.cpp \
../source/Oox2OdfConverter/DocxConverter.cpp \
../source/Oox2OdfConverter/XlsxConverter.cpp \
../source/OdfFormat/odf_settings_context.cpp \
../source/OdfFormat/office_settings.cpp \
../source/OdfFormat/mediaitems_utils.cpp
}
SOURCES += \
../source/Oox2OdfConverter/ConvertDiagram.cpp \
../source/Oox2OdfConverter/Converter.cpp \
../source/Oox2OdfConverter/ConverterChart.cpp \
../source/Oox2OdfConverter/ConvertVml.cpp \
../source/Oox2OdfConverter/DocxConverter.cpp \
../source/Oox2OdfConverter/XlsxConverter.cpp
HEADERS += \
../source/OdfFormat/abstract_xml.h \

View File

@ -1,90 +1,86 @@
/*
* (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
*
*/
//#include "../source/OdfFormat/abstract_xml.cpp"
#include "../source/OdfFormat/calcext_elements.cpp"
#include "../source/OdfFormat/draw_base.cpp"
#include "../source/OdfFormat/draw_frame.cpp"
#include "../source/OdfFormat/draw_shapes.cpp"
#include "../source/OdfFormat/header_footer.cpp"
#include "../source/OdfFormat/list.cpp"
#include "../source/OdfFormat/mediaitems.cpp"
#include "../source/OdfFormat/mediaitems_utils.cpp"
#include "../source/OdfFormat/number_style.cpp"
#include "../source/OdfFormat/object_package.cpp"
#include "../source/OdfFormat/odf_chart_context.cpp"
#include "../source/OdfFormat/odf_comment_context.cpp"
#include "../source/OdfFormat/odf_conversion_context.cpp"
#include "../source/OdfFormat/odf_drawing_context.cpp"
#include "../source/OdfFormat/odf_lists_styles_context.cpp"
#include "../source/OdfFormat/odf_number_styles_context.cpp"
#include "../source/OdfFormat/odf_page_layout_context.cpp"
#include "../source/OdfFormat/odf_page_layout_state.cpp"
#include "../source/OdfFormat/odf_rels.cpp"
#include "../source/OdfFormat/odf_style_context.cpp"
#include "../source/OdfFormat/odf_style_state.cpp"
#include "../source/OdfFormat/odf_table_context.cpp"
#include "../source/OdfFormat/odf_table_styles_context.cpp"
#include "../source/OdfFormat/odf_text_context.cpp"
#include "../source/OdfFormat/ods_conversion_context.cpp"
#include "../source/OdfFormat/ods_table_context.cpp"
#include "../source/OdfFormat/ods_table_state.cpp"
#include "../source/OdfFormat/odt_conversion_context.cpp"
#include "../source/OdfFormat/office_annotation.cpp"
#include "../source/OdfFormat/office_body.cpp"
#include "../source/OdfFormat/office_chart.cpp"
#include "../source/OdfFormat/office_elements_create.cpp"
#include "../source/OdfFormat/office_spreadsheet.cpp"
#include "../source/OdfFormat/office_text.cpp"
#include "../source/OdfFormat/oox_shape_defines.cpp"
#include "../source/OdfFormat/paragraph_elements.cpp"
#include "../source/OdfFormat/style_chart_properties.cpp"
#include "../source/OdfFormat/style_graphic_properties.cpp"
#include "../source/OdfFormat/style_map.cpp"
#include "../source/OdfFormat/style_page_layout_properties.cpp"
#include "../source/OdfFormat/style_paragraph_properties.cpp"
#include "../source/OdfFormat/styles.cpp"
#include "../source/OdfFormat/style_section_properties.cpp"
#include "../source/OdfFormat/styles_list.cpp"
#include "../source/OdfFormat/styles_lite_container.cpp"
#include "../source/OdfFormat/style_table_properties.cpp"
#include "../source/OdfFormat/style_text_properties.cpp"
#include "../source/OdfFormat/svg_creator.cpp"
#include "../source/OdfFormat/table.cpp"
#include "../source/OdfFormat/table_database_ranges.cpp"
#include "../source/OdfFormat/table_named_expressions.cpp"
#include "../source/OdfFormat/text_elements.cpp"
#include "../source/Oox2OdfConverter/ConvertDiagram.cpp"
#include "../source/Oox2OdfConverter/Converter.cpp"
#include "../source/Oox2OdfConverter/ConverterChart.cpp"
#include "../source/Oox2OdfConverter/ConvertVml.cpp"
#include "../source/Oox2OdfConverter/DocxConverter.cpp"
#include "../source/Oox2OdfConverter/XlsxConverter.cpp"
/*
* (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
*
*/
#include "../source/OdfFormat/calcext_elements.cpp"
#include "../source/OdfFormat/draw_base.cpp"
#include "../source/OdfFormat/draw_frame.cpp"
#include "../source/OdfFormat/draw_shapes.cpp"
#include "../source/OdfFormat/header_footer.cpp"
#include "../source/OdfFormat/list.cpp"
#include "../source/OdfFormat/mediaitems.cpp"
#include "../source/OdfFormat/number_style.cpp"
#include "../source/OdfFormat/object_package.cpp"
#include "../source/OdfFormat/odf_chart_context.cpp"
#include "../source/OdfFormat/odf_comment_context.cpp"
#include "../source/OdfFormat/odf_notes_context.cpp"
#include "../source/OdfFormat/odf_conversion_context.cpp"
#include "../source/OdfFormat/odf_drawing_context.cpp"
#include "../source/OdfFormat/odf_lists_styles_context.cpp"
#include "../source/OdfFormat/odf_number_styles_context.cpp"
#include "../source/OdfFormat/odf_page_layout_context.cpp"
#include "../source/OdfFormat/odf_page_layout_state.cpp"
#include "../source/OdfFormat/odf_rels.cpp"
#include "../source/OdfFormat/odf_style_context.cpp"
#include "../source/OdfFormat/odf_style_state.cpp"
#include "../source/OdfFormat/odf_table_context.cpp"
#include "../source/OdfFormat/odf_table_styles_context.cpp"
#include "../source/OdfFormat/odf_text_context.cpp"
#include "../source/OdfFormat/ods_conversion_context.cpp"
#include "../source/OdfFormat/ods_table_context.cpp"
#include "../source/OdfFormat/ods_table_state.cpp"
#include "../source/OdfFormat/odt_conversion_context.cpp"
#include "../source/OdfFormat/office_annotation.cpp"
#include "../source/OdfFormat/office_body.cpp"
#include "../source/OdfFormat/office_chart.cpp"
#include "../source/OdfFormat/office_elements_create.cpp"
#include "../source/OdfFormat/office_spreadsheet.cpp"
#include "../source/OdfFormat/office_text.cpp"
#include "../source/OdfFormat/oox_shape_defines.cpp"
#include "../source/OdfFormat/paragraph_elements.cpp"
#include "../source/OdfFormat/style_chart_properties.cpp"
#include "../source/OdfFormat/style_graphic_properties.cpp"
#include "../source/OdfFormat/style_map.cpp"
#include "../source/OdfFormat/style_page_layout_properties.cpp"
#include "../source/OdfFormat/style_paragraph_properties.cpp"
#include "../source/OdfFormat/styles.cpp"
#include "../source/OdfFormat/style_section_properties.cpp"
#include "../source/OdfFormat/styles_list.cpp"
#include "../source/OdfFormat/styles_lite_container.cpp"
#include "../source/OdfFormat/style_table_properties.cpp"
#include "../source/OdfFormat/style_text_properties.cpp"
#include "../source/OdfFormat/svg_creator.cpp"
#include "../source/OdfFormat/table.cpp"
#include "../source/OdfFormat/table_database_ranges.cpp"
#include "../source/OdfFormat/table_named_expressions.cpp"
#include "../source/OdfFormat/text_elements.cpp"
#include "../source/OdfFormat/odf_settings_context.cpp"
#include "../source/OdfFormat/office_settings.cpp"
#include "../source/OdfFormat/mediaitems_utils.cpp"

View File

@ -170,12 +170,13 @@ HEADERS += \
../../../ASCOfficePPTXFile/Editor/Drawing/Theme.h \
../../../Common/3dParty/pole/pole.h
build_fast {
core_release {
SOURCES += \
pptformatlib_logic.cpp
} else {
}
core_debug {
SOURCES += \
../PPTFormatLib.cpp \
../Reader/ReadStructures.cpp \
../Reader/PPTDocumentInfoOneUser.cpp \
../Reader/Records.cpp \
@ -183,13 +184,14 @@ SOURCES += \
../Records/Animations/AnimationTypes.cpp \
../Records/Drawing/ArtBlip.cpp \
../PPTXWriter/Converter.cpp \
../PPTXWriter/ShapeWriter.cpp \
../../../ASCOfficePPTXFile/Editor/Drawing/Elements.cpp \
../../../ASCOfficePPTXFile/Editor/Drawing/Layout.cpp \
../../../ASCOfficePPTXFile/Editor/Drawing/TextAttributesEx.cpp
../PPTXWriter/ShapeWriter.cpp
}
SOURCES += \
../PPTFormatLib.cpp \
../../../ASCOfficePPTXFile/Editor/Drawing/Elements.cpp \
../../../ASCOfficePPTXFile/Editor/Drawing/Layout.cpp \
../../../ASCOfficePPTXFile/Editor/Drawing/TextAttributesEx.cpp \
../../../Common/3dParty/pole/pole.cpp
core_windows {

View File

@ -29,15 +29,13 @@
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#include "../PPTFormatLib.cpp"
#include "../Reader/ReadStructures.cpp"
#include "../Reader/PPTDocumentInfoOneUser.cpp"
#include "../Reader/Records.cpp"
#include "../Reader/SlidePersist.cpp"
#include "../Records/Animations/AnimationTypes.cpp"
#include "../Records/Drawing/ArtBlip.cpp"
#include "../PPTXWriter/Converter.cpp"
#include "../PPTXWriter/ShapeWriter.cpp"
#include "../../../ASCOfficePPTXFile/Editor/Drawing/Elements.cpp"
#include "../../../ASCOfficePPTXFile/Editor/Drawing/Layout.cpp"
#include "../../../ASCOfficePPTXFile/Editor/Drawing/TextAttributesEx.cpp"

View File

@ -89,7 +89,7 @@ namespace NSPresentationEditor
// теперь нужно скопировать картинку
if (strOutput != strInput)
{
if (CDirectory::CopyFile(strInput, strOutput, NULL, NULL) == false)
if (CDirectory::CopyFile(strInput, strOutput) == false)
{
return L"";
}

View File

@ -113,7 +113,7 @@ public:
oPersist.m_nPsrRef = pAtom->m_arSlides[index]->m_nPsrRef;
oPersist.m_nSlideID = pAtom->m_arSlides[index]->m_nSlideID;
oPersist.m_arTextAttrs.Append(pAtom->m_arTextPlaceHolders[index]);
oPersist.m_arTextAttrs += pAtom->m_arTextPlaceHolders[index];
pArray->Add(oPersist);
}
@ -189,4 +189,4 @@ public:
}
}
}
};
};

View File

@ -1233,10 +1233,8 @@ rIns=\"91440\" bIns=\"45720\" numCol=\"1\" spcCol=\"0\" rtlCol=\"0\" fromWordArt
}
else if (strName == L"background")
{
m_pBinaryWriter->StartRecord(1);
PPTX::Logic::SpTreeElem oElem = doc_LoadShape(oParseNode, pMainProps, false);
m_pBinaryWriter->WriteRecord1(1, oElem);
m_pBinaryWriter->EndRecord();
PPTX::Logic::SpTreeElem oElem = doc_LoadShape(oParseNode, pMainProps, false);
m_pBinaryWriter->WriteRecord1(1, oElem);
break;
}
else if (strName == L"pict" || strName == L"object")
@ -1366,7 +1364,18 @@ rIns=\"91440\" bIns=\"45720\" numCol=\"1\" spcCol=\"0\" rtlCol=\"0\" fromWordArt
break;
}
else if (strName == L"AlternateContent")
else if (strName == L"oleObj")
{
nullable<PPTX::Logic::Pic> pic = oParseNode.ReadNode(_T("p:pic"));
if (pic.is_init())
{
pic->fromXMLOle(oParseNode);
m_pBinaryWriter->WriteRecord2(1, pic);
}
break;
}
else if (strName == L"AlternateContent")
{
XmlUtils::CXmlNode oNodeDr;
if (oParseNode.GetNode(L"w:drawing", oNodeDr))
@ -4304,7 +4313,26 @@ HRESULT CDrawingConverter::SaveObject(LONG lStart, LONG lLength, const CString&
m_pReader->Seek(_e);
return S_OK;
}
void CDrawingConverter::SaveObjectExWriterInit(NSBinPptxRW::CXmlWriter& oXmlWriter, LONG lDocType)
{
oXmlWriter.m_lObjectIdVML = m_pXmlWriter->m_lObjectIdVML;
oXmlWriter.m_lObjectIdOle = m_pXmlWriter->m_lObjectIdOle;
oXmlWriter.m_lDocType = (BYTE)lDocType;
oXmlWriter.m_bIsUseOffice2007 = false;
oXmlWriter.m_bIsTop = (1 == m_nCurrentIndexObject) ? true : false;
#if defined(BUILD_CONFIG_FULL_VERSION) && defined(AVS_USE_CONVERT_PPTX_TOCUSTOM_VML)
if (NULL == m_pOOXToVMLRenderer)
m_pOOXToVMLRenderer = new COOXToVMLGeometry();
oXmlWriter.m_pOOXToVMLRenderer = m_pOOXToVMLRenderer;
#endif
}
void CDrawingConverter::SaveObjectExWriterRelease(NSBinPptxRW::CXmlWriter& oXmlWriter)
{
m_pXmlWriter->m_lObjectIdVML = oXmlWriter.m_lObjectIdVML;
m_pXmlWriter->m_lObjectIdOle = oXmlWriter.m_lObjectIdOle;
}
HRESULT CDrawingConverter::SaveObjectEx(LONG lStart, LONG lLength, const CString& bsMainProps, LONG lDocType, CString** bsXml)
{
if (XMLWRITER_DOC_TYPE_DOCX == lDocType)
@ -4353,18 +4381,7 @@ HRESULT CDrawingConverter::SaveObjectEx(LONG lStart, LONG lLength, const CString
m_pReader->m_lDocumentType = XMLWRITER_DOC_TYPE_PPTX;
NSBinPptxRW::CXmlWriter oXmlWriter;
oXmlWriter.m_lObjectIdVML = m_pXmlWriter->m_lObjectIdVML;
oXmlWriter.m_lObjectIdOle = m_pXmlWriter->m_lObjectIdOle;
oXmlWriter.m_lDocType = (BYTE)lDocType;
oXmlWriter.m_bIsUseOffice2007 = false;
oXmlWriter.m_bIsTop = (1 == m_nCurrentIndexObject) ? true : false;
#if defined(BUILD_CONFIG_FULL_VERSION) && defined(AVS_USE_CONVERT_PPTX_TOCUSTOM_VML)
if (NULL == m_pOOXToVMLRenderer)
m_pOOXToVMLRenderer = new COOXToVMLGeometry();
oXmlWriter.m_pOOXToVMLRenderer = m_pOOXToVMLRenderer;
#endif
SaveObjectExWriterInit(oXmlWriter, lDocType);
if(bOle)
{
@ -4377,11 +4394,15 @@ HRESULT CDrawingConverter::SaveObjectEx(LONG lStart, LONG lLength, const CString
--m_nCurrentIndexObject;
m_pXmlWriter->m_lObjectIdVML = oXmlWriter.m_lObjectIdVML;
m_pXmlWriter->m_lObjectIdOle = oXmlWriter.m_lObjectIdOle;
SaveObjectExWriterRelease(oXmlWriter);
if (XMLWRITER_DOC_TYPE_XLSX == lDocType)
{
m_pXmlWriter->m_strOleXlsx = oXmlWriter.m_strOleXlsx;
NSBinPptxRW::CXmlWriter oXmlWriterXlsx;
SaveObjectExWriterInit(oXmlWriterXlsx, lDocType);
oElem.toXmlWriter(&oXmlWriterXlsx);
m_pXmlWriter->m_strOleDrawing = oXmlWriterXlsx.GetXmlString();
SaveObjectExWriterRelease(oXmlWriterXlsx);
}
CString ret = oXmlWriter.GetXmlString();
@ -4391,6 +4412,39 @@ HRESULT CDrawingConverter::SaveObjectEx(LONG lStart, LONG lLength, const CString
m_pReader->Seek(_e);
return S_OK;
}
std::wstring CDrawingConverter::SaveObjectBackground(LONG lStart, LONG lLength)
{
m_pReader->Seek(lStart);
++m_nCurrentIndexObject;
BYTE typeRec1 = m_pReader->GetUChar(); // must be 0;
LONG _e = m_pReader->GetPos() + m_pReader->GetLong() + 4;
m_pReader->Skip(5); // type record (must be 1) + 4 byte - len record
PPTX::Logic::SpTreeElem oElem;
m_pReader->m_lDocumentType = XMLWRITER_DOC_TYPE_DOCX;
oElem.fromPPTY(m_pReader);
m_pReader->m_lDocumentType = XMLWRITER_DOC_TYPE_PPTX;
NSBinPptxRW::CXmlWriter oXmlWriter;
SaveObjectExWriterInit(oXmlWriter, XMLWRITER_DOC_TYPE_DOCX);
oXmlWriter.m_bIsTop = true; // не забыть скинуть в самом шейпе
PPTX::Logic::Shape& oShape = oElem.as<PPTX::Logic::Shape>();
oShape.toXmlWriterVMLBackground(&oXmlWriter, *m_pTheme, *m_pClrMap);
--m_nCurrentIndexObject;
SaveObjectExWriterRelease(oXmlWriter);
m_pReader->Seek(_e);
return oXmlWriter.GetXmlString();
}
void CDrawingConverter::ConvertPicVML(PPTX::Logic::SpTreeElem& oElem, const CString& bsMainProps, NSBinPptxRW::CXmlWriter& oWriter)
{
@ -5093,6 +5147,10 @@ std::wstring CDrawingConverter::GetOleXlsx()
{
return m_pXmlWriter->m_strOleXlsx;
}
std::wstring CDrawingConverter::GetOleDrawing()
{
return m_pXmlWriter->m_strOleDrawing;
}
void CDrawingConverter::SetSourceFileDir(std::wstring path, int type)
{

View File

@ -219,6 +219,9 @@ namespace NSBinPptxRW
HRESULT SaveThemeXml (long lStart, long lLength, const CString& bsThemePath);
HRESULT SaveObject (long lStart, long lLength, const CString& bsMainProps, CString** bsXml);
HRESULT SaveObjectEx (long lStart, long lLength, const CString& bsMainProps, long lDocType, CString** bsXml);
void SaveObjectExWriterInit(NSBinPptxRW::CXmlWriter& oXmlWriter, LONG lDocType);
void SaveObjectExWriterRelease(NSBinPptxRW::CXmlWriter& oXmlWriter);
std::wstring SaveObjectBackground(LONG lStart, LONG lLength);
HRESULT GetRecordBinary (long lRecordType, const CString& bsXml);
HRESULT GetRecordXml (long lStart, long lLength, long lRecType, long lDocType, CString** bsXml);
@ -249,6 +252,7 @@ namespace NSBinPptxRW
std::wstring GetContentTypes();
std::wstring GetOleXlsx();
std::wstring GetOleDrawing();
protected:
nullable<PPTX::Logic::Xfrm> m_oxfrm_override;

View File

@ -281,7 +281,7 @@ namespace NSBinPptxRW
pathOutput = m_strDstMedia + FILE_SEPARATOR_STR + strImage + strExts;
// теперь нужно скопировать картинку
if (pathOutput.GetPath() != strInput)
CDirectory::CopyFile(strInput, pathOutput.GetPath(), NULL, NULL);
CDirectory::CopyFile(strInput, pathOutput.GetPath());
}
else
{
@ -308,7 +308,7 @@ namespace NSBinPptxRW
}
else
{
CDirectory::CopyFile(strOleImage, strOleImageOut, NULL, NULL);
CDirectory::CopyFile(strOleImage, strOleImageOut);
}
if (!m_bIsWord)

File diff suppressed because it is too large Load Diff

View File

@ -35,138 +35,138 @@ namespace NSOfficePPT
{
enum SlideSizeType
{
OnScreen = 0,
OnScreen = 0,
LetterSizedPaper = 1,
A4Paper = 2,
Size35mm = 3,
Overhead = 4,
Banner = 5,
Overhead = 4,
Banner = 5,
Custom = 6
};
enum StyleMask
{
None = 0,
None = 0,
IsBold = 1 << 0,
IsItalic = 1 << 1,
IsBold = 1 << 0,
IsItalic = 1 << 1,
IsUnderlined = 1 << 2,
HasShadow = 1 << 4,
HasShadow = 1 << 4,
HasAsianSmartQuotes = 1 << 5,
HasHorizonNumRendering = 1 << 7,
HasHorizonNumRendering = 1 << 7,
IsEmbossed = 1 << 9,
IsEmbossed = 1 << 9,
ExtensionNibble = 0xF << 10
};
enum CharacterMask
{
_None = 0,
_None = 0,
StyleFlagsFieldPresent = 0xFFFF,
TypefacePresent = 1 << 16,
SizePresent = 1 << 17,
ColorPresent = 1 << 18,
PositionPresent = 1 << 19,
TypefacePresent = 1 << 16,
SizePresent = 1 << 17,
ColorPresent = 1 << 18,
PositionPresent = 1 << 19,
FEOldTypefacePresent = 1 << 21,
ANSITypefacePresent = 1 << 22,
ANSITypefacePresent = 1 << 22,
SymbolTypefacePresent = 1 << 23
};
enum PlaceholderEnum
{
__None = 0,
MasterTitle = 1,
MasterBody = 2,
MasterCenteredTitle = 3,
MasterSubtitle = 4,
__None = 0,
MasterTitle = 1,
MasterBody = 2,
MasterCenteredTitle = 3,
MasterSubtitle = 4,
MasterNotesSlideImage = 5,
MasterNotesBody = 6,
MasterDate = 7,
MasterSlideNumber = 8,
MasterFooter = 9,
MasterHeader = 10,
NotesSlideImage = 11,
NotesBody = 12,
Title = 13,
Body = 14,
CenteredTitle = 15,
Subtitle = 16,
VerticalTextTitle = 17,
VerticalTextBody = 18,
Object = 19,
Graph = 20,
Table = 21,
ClipArt = 22,
OrganizationChart = 23,
MediaClip = 24
MasterNotesBody = 6,
MasterDate = 7,
MasterSlideNumber = 8,
MasterFooter = 9,
MasterHeader = 10,
NotesSlideImage = 11,
NotesBody = 12,
Title = 13,
Body = 14,
CenteredTitle = 15,
Subtitle = 16,
VerticalTextTitle = 17,
VerticalTextBody = 18,
Object = 19,
Graph = 20,
Table = 21,
ClipArt = 22,
OrganizationChart = 23,
MediaClip = 24
};
enum ParagraphMask
{
___None = 0,
HasBullet = 1 << 0,
BulletHasFont = 1 << 1,
BulletHasColor = 1 << 2,
BulletHasSize = 1 << 3,
___None = 0,
HasBullet = 1 << 0,
BulletHasFont = 1 << 1,
BulletHasColor = 1 << 2,
BulletHasSize = 1 << 3,
BulletFlagsFieldExists = HasBullet | BulletHasFont | BulletHasColor | BulletHasSize,
BulletFont = 1 << 4,
BulletColor = 1 << 5,
BulletSize = 1 << 6,
BulletChar = 1 << 7,
LeftMargin = 1 << 8,
Indent = 1 << 10,
Align = 1 << 11,
LineSpacing = 1 << 12,
SpaceBefore = 1 << 13,
SpaceAfter = 1 << 14,
DefaultTabSize = 1 << 15,
FontAlign = 1 << 16,
CharWrap = 1 << 17,
WordWrap = 1 << 18,
Overflow = 1 << 19,
BulletFont = 1 << 4,
BulletColor = 1 << 5,
BulletSize = 1 << 6,
BulletChar = 1 << 7,
LeftMargin = 1 << 8,
Indent = 1 << 10,
Align = 1 << 11,
LineSpacing = 1 << 12,
SpaceBefore = 1 << 13,
SpaceAfter = 1 << 14,
DefaultTabSize = 1 << 15,
FontAlign = 1 << 16,
CharWrap = 1 << 17,
WordWrap = 1 << 18,
Overflow = 1 << 19,
WrapFlagsFieldExists = CharWrap | WordWrap | Overflow,
TabStops = 1 << 20,
TextDirection = 1 << 21,
BulletBlip = 1 << 23,
BulletScheme = 1 << 24,
BulletHasScheme = 1 << 25
TabStops = 1 << 20,
TextDirection = 1 << 21,
BulletBlip = 1 << 23,
BulletScheme = 1 << 24,
BulletHasScheme = 1 << 25
};
enum Instances
{
CollectionOfSlides = 0,
CollectionOfSlides = 0,
CollectionOfMasterSlides = 1,
CollectionOfNotesSlides = 2
};
enum SlideLayoutType
{
TitleSlide = 0,
TitleAndBody = 1,
TitleMaster = 2,
TitleSlide = 0,
TitleAndBody = 1,
TitleMaster = 2,
MasterNotes = 4,
NotesTitleAndBody = 5,
Handout = 6,
TitleOnly = 7,
TwoColumnsAndTitle = 8,
TwoRowsAndTitle = 9,
TwoColumnsRightTwoRows = 10,
TwoColumnsLeftTwoRows = 11,
TwoRowsBottomTwoColumns = 12,
TwoRowsTopTwoColumns = 13,
FourObjects = 14,
BigObject = 15,
Blank = 16,
VerticalTitleRightBodyLeft = 17,
VerticalTitleRightBodyLeftTwoRows = 18
MasterNotes = 4,
NotesTitleAndBody = 5,
Handout = 6,
TitleOnly = 7,
TwoColumnsAndTitle = 8,
TwoRowsAndTitle = 9,
TwoColumnsRightTwoRows = 10,
TwoColumnsLeftTwoRows = 11,
TwoRowsBottomTwoColumns = 12,
TwoRowsTopTwoColumns = 13,
FourObjects = 14,
BigObject = 15,
Blank = 16,
VerticalTitleRightBodyLeft = 17,
VerticalTitleRightBodyLeftTwoRows= 18
};
enum TextType

View File

@ -272,6 +272,7 @@ namespace NSBinPptxRW
std::wstring m_strAttributesMain;
std::wstring m_strNodes;
std::wstring m_strOleXlsx;
std::wstring m_strOleDrawing;
IRenderer* m_pOOXToVMLRenderer;

View File

@ -65,9 +65,7 @@ namespace NSShapeImageGen
static bool _CopyFile(std::wstring strExists, std::wstring strNew, LPVOID lpFunc, LPVOID lpData)
{
//::DeleteFile(strNew);
//return ::CopyFileEx(strExists, strNew, lpFunc, lpData, false, 0);
return CDirectory::CopyFile (strExists, strNew, lpFunc, lpData);
return CDirectory::CopyFile (strExists, strNew);
}
enum ImageType
@ -369,7 +367,7 @@ namespace NSShapeImageGen
oInfo.m_eType = itJPG;
OOX::CPath pathSaveItem = m_strDstMedia + FILE_SEPARATOR_STR + oInfo.GetPath2();
CDirectory::CopyFile(strFileSrc, pathSaveItem.GetPath(), NULL, NULL);
CDirectory::CopyFile(strFileSrc, pathSaveItem.GetPath());
return true;
}
@ -382,7 +380,7 @@ namespace NSShapeImageGen
oInfo.m_eType = itPNG;
OOX::CPath pathSaveItem = m_strDstMedia + FILE_SEPARATOR_STR + oInfo.GetPath2();
CDirectory::CopyFile(strFileSrc, pathSaveItem.GetPath(), NULL, NULL);
CDirectory::CopyFile(strFileSrc, pathSaveItem.GetPath());
return true;
}
@ -408,7 +406,7 @@ namespace NSShapeImageGen
strSaveItem = m_strDstMedia + FILE_SEPARATOR_STR + strSaveItem + pathOriginal.GetExtention();
CDirectory::CopyFile(strFileSrc, strSaveItem, NULL, NULL);
CDirectory::CopyFile(strFileSrc, strSaveItem);
}
}
void SaveImage(CBgraFrame& oBgraFrame, CImageInfo& oInfo, LONG __width, LONG __height)
@ -524,14 +522,14 @@ namespace NSShapeImageGen
if(bOle)
{
std::wstring sCopyOlePath = strSaveItemWE + L".bin";
CDirectory::CopyFile(strOleFile, sCopyOlePath, NULL, NULL);
CDirectory::CopyFile(strOleFile, sCopyOlePath);
}
if (bVector)
{
//copy source vector image
OOX::CPath pathSaveItem = strSaveDir + oInfo.GetPath2();
CDirectory::CopyFile(strFileName, pathSaveItem.GetPath(), NULL, NULL);
CDirectory::CopyFile(strFileName, pathSaveItem.GetPath());
::MetaFile::CMetaFile oMetafile(m_pFontManager->m_pApplication);
if (oMetafile.LoadFromFile(strFileName.c_str()))

View File

@ -169,8 +169,8 @@ namespace PPTX
CString strXml = _T("<xml xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" \
xmlns:p=\"urn:schemas-microsoft-com:office:powerpoint\" xmlns:x=\"urn:schemas-microsoft-com:office:excel\" xmlns:oa=\"urn:schemas-microsoft-com:office:activation\">");
strXml.Append(NodeContent);
strXml.Append(_T("</xml>"));
strXml += NodeContent;
strXml += L"</xml>";
XmlUtils::CXmlLiteReader oSubReader;//нам нужны xml //и сами объекты

View File

@ -100,7 +100,7 @@ namespace PPTX
oWriter.WriteNodeEnd(_T("Relationship"));
CDirectory::SaveToFile(file.GetPath(), oWriter.GetXmlString());
NSFile::CFileBinary::SaveToFile(file.GetPath(), oWriter.GetXmlString());
}
}
const bool isValid() const

View File

@ -73,8 +73,8 @@ namespace PPTX
if (xml.GetLength() > 0)
{
CString temp = _T("<v:object>");
temp.Append(xml);
temp.Append(_T("</v:object>"));
temp += xml;
temp += L"</v:object>";
NSBinPptxRW::CDrawingConverter oDrawingConverter;
oDrawingConverter.SetAdditionalParam(_T("parent_spTree"), (BYTE*)spTreeElements, 0);
@ -103,8 +103,8 @@ namespace PPTX
if (xml.GetLength() > 0)
{
CString temp = _T("<v:object>");
temp.Append(xml);
temp.Append(_T("</v:object>"));
temp += xml;
temp += L"</v:object>";
NSBinPptxRW::CDrawingConverter oDrawingConverter;
//oDrawingConverter.SetFontManager(pFontManager);

View File

@ -93,12 +93,12 @@ namespace PPTX
XmlUtils::CXmlNode oNode2 = oNodeData.ReadNodeNoNS(_T("oleObj"));
if (oNode2.IsValid())
{
fromXMLOle(oNode2);
oNode2.ReadAttributeBase(L"spid", spid);
pic = oNode2.ReadNode(_T("p:pic"));
if (pic.is_init())
{
pic->fromXMLOle(oNode2);
xfrm.Merge(pic->spPr.xfrm);
}
}
@ -121,11 +121,11 @@ namespace PPTX
XmlUtils::CXmlNode oNodeO;
if (oNodeFallback.GetNode(_T("p:oleObj"), oNodeO))
{
fromXMLOle(oNodeO);
pic = oNodeO.ReadNode(_T("p:pic"));
if (pic.is_init())
{
pic->fromXMLOle(oNode2);
xfrm.Merge(pic->spPr.xfrm);
}
}
@ -150,30 +150,9 @@ namespace PPTX
}
}
}
if(pic.IsInit() && oleObject.IsInit())
{
pic->oleObject = oleObject;
pic->blipFill.blip->oleRid = oleObject->m_oId.get().ToString();
}
FillParentPointersForChilds();
}
void GraphicFrame::fromXMLOle(XmlUtils::CXmlNode& node)
{
oleObject.Init();
node.ReadAttributeBase(L"progId", oleObject->m_sProgId);
node.ReadAttributeBase(L"r:id", oleObject->m_oId);
int imgW = node.GetAttributeInt(CString(L"imgW"), 0);
if(imgW > 0)
{
oleObject->m_oDxaOrig = Emu_To_Twips(imgW);
}
int imgH = node.GetAttributeInt(CString(L"imgH"), 0);
if(imgH > 0)
{
oleObject->m_oDyaOrig = Emu_To_Twips(imgH);
}
}
void GraphicFrame::toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
{
@ -291,8 +270,9 @@ namespace PPTX
if (!table.is_init() && !chartRec.is_init() && xml_object_vml.IsEmpty() == false)
{
CString temp = _T("<v:object>");
temp.Append(xml_object_vml);
temp.Append(_T("</v:object>"));
temp += xml_object_vml;
temp += L"</v:object>";
NSBinPptxRW::CDrawingConverter oDrawingConverter;
//oDrawingConverter.SetFontManager(pFontManager);

View File

@ -57,7 +57,6 @@ namespace PPTX
public:
virtual void fromXML(XmlUtils::CXmlNode& node);
void fromXMLOle(XmlUtils::CXmlNode& node);
virtual CString toXML() const;
virtual void GetRect(Aggplus::RECT& pRect)const;
@ -79,7 +78,6 @@ namespace PPTX
nullable<SmartArt> smartArt;
nullable<ChartRec> chartRec;
nullable<Pic> pic;
nullable<COLEObject> oleObject;
CString GetVmlXmlBySpid(CString & rels) const;
protected:

View File

@ -565,17 +565,14 @@ namespace PPTX
int dH = 0;
int nShapeId = pWriter->m_lObjectIdVML;
CString strId = _T("");
strId.Format(_T("_x0000_i%04d"), nShapeId);
CString strSpid = _T("");
strSpid.Format(_T("_x%04d_s%04d"), 0xFFFF & (pWriter->m_lObjectIdVML >> 16), 0xFFFF & pWriter->m_lObjectIdVML);
CString strObjectid = _T("");
strObjectid.Format(_T("_152504%04d"), pWriter->m_lObjectIdVML);
std::wstring strId = L"_x0000_i" + std::to_wstring(nShapeId);
std::wstring strSpid = L"_x" + std::to_wstring(0xFFFF & (pWriter->m_lObjectIdVML >> 16)) + L"_s" + std::to_wstring(0xFFFF & pWriter->m_lObjectIdVML);
CString strObjectid = L"_152504" + std::to_wstring(pWriter->m_lObjectIdVML);
pWriter->m_lObjectIdVML++;
NSBinPptxRW::CXmlWriter oStylesWriter;
if(_T("") == pWriter->m_strStyleMain)
if(pWriter->m_strStyleMain.empty())
{
if (spPr.xfrm.is_init())
{
@ -589,11 +586,11 @@ namespace PPTX
dH = (*spPr.xfrm->extY);
}
oStylesWriter.WriteAttributeCSS(_T("position"), _T("absolute"));
oStylesWriter.WriteAttributeCSS_int(_T("left"), dL);
oStylesWriter.WriteAttributeCSS_int(_T("top"), dT);
oStylesWriter.WriteAttributeCSS_int(_T("width"), dW);
oStylesWriter.WriteAttributeCSS_int(_T("height"), dH);
oStylesWriter.WriteAttributeCSS (_T("position"), _T("absolute"));
oStylesWriter.WriteAttributeCSS_int (_T("left"), dL);
oStylesWriter.WriteAttributeCSS_int (_T("top"), dT);
oStylesWriter.WriteAttributeCSS_int (_T("width"), dW);
oStylesWriter.WriteAttributeCSS_int (_T("height"), dH);
}
if (spPr.xfrm.is_init())
@ -621,8 +618,8 @@ namespace PPTX
if (spPr.Geometry.is_init())
{
CString strPath = _T("");
CString strTextRect = _T("");
CString strPath;
CString strTextRect;
LONG lW = 43200;
LONG lH = 43200;
@ -780,5 +777,25 @@ namespace PPTX
pWriter->EndNode(sOleNodeName);
}
}
void Pic::fromXMLOle(XmlUtils::CXmlNode& node)
{
oleObject.Init();
node.ReadAttributeBase(L"progId", oleObject->m_sProgId);
node.ReadAttributeBase(L"r:id", oleObject->m_oId);
int imgW = node.GetAttributeInt(CString(L"imgW"), 0);
if(imgW > 0)
{
oleObject->m_oDxaOrig = Emu_To_Twips(imgW);
}
int imgH = node.GetAttributeInt(CString(L"imgH"), 0);
if(imgH > 0)
{
oleObject->m_oDyaOrig = Emu_To_Twips(imgH);
}
if(oleObject->m_oId.IsInit())
{
blipFill.blip->oleRid = oleObject->m_oId.get().ToString();
}
}
} // namespace Logic
} // namespace PPTX

View File

@ -400,7 +400,7 @@ namespace PPTX
}
void toXmlWriterVML(NSBinPptxRW::CXmlWriter* pWriter, smart_ptr<PPTX::WrapperFile>& oTheme, smart_ptr<PPTX::WrapperWritingElement>& oClrMap);
void fromXMLOle(XmlUtils::CXmlNode& node);
public:
NvPicPr nvPicPr;

View File

@ -412,27 +412,26 @@ namespace PPTX
spPr.Geometry.ConvertToCustomVML(pWriter->m_pOOXToVMLRenderer, strPath, strTextRect, lW, lH);
#endif
CString strId = _T("");
strId.Format(_T("shape %d"), pWriter->m_lObjectIdVML);
CString strSpid = _T("");
strSpid.Format(_T("_x%04d_s%04d"), 0xFFFF & (pWriter->m_lObjectIdVML >> 16), 0xFFFF & pWriter->m_lObjectIdVML);
std::wstring strId = L"shape " + std::to_wstring(pWriter->m_lObjectIdVML);
std::wstring strSpid = L"_x" + std::to_wstring(0xFFFF & (pWriter->m_lObjectIdVML >> 16)) + L"_s" + std::to_wstring(0xFFFF & pWriter->m_lObjectIdVML);
pWriter->m_lObjectIdVML++;
CString strFillAttr = _T("");
CString strStrokeAttr = _T("");
CString strFillNode = _T("");
CString strStrokeNode = _T("");
CalculateFill(spPr, style, oTheme, oClrMap, strFillAttr, strFillNode, bOle);
std::wstring strFillAttr;
std::wstring strStrokeAttr;
std::wstring strFillNode;
std::wstring strStrokeNode;;
CalculateFill(spPr, style, oTheme, oClrMap, strFillAttr, strFillNode, bOle);
CalculateLine(spPr, style, oTheme, oClrMap, strStrokeAttr, strStrokeNode, bOle);
if (pWriter->m_strStyleMain != _T(""))
if (!pWriter->m_strStyleMain.empty())
{
pWriter->StartNode(_T("v:shape"));
pWriter->StartNode(L"v:shape");
pWriter->StartAttributes();
pWriter->WriteAttribute(_T("id"), strId);
pWriter->WriteAttribute(_T("o:spid"), strSpid);
pWriter->WriteAttribute(L"id", strId);
pWriter->WriteAttribute(L"o:spid", strSpid);
NSBinPptxRW::CXmlWriter oStylesWriter;
if (spPr.xfrm.is_init())
@ -654,5 +653,31 @@ namespace PPTX
pWriter->EndNode(_T("v:shape"));
}
}
void Shape::toXmlWriterVMLBackground(NSBinPptxRW::CXmlWriter *pWriter, NSCommon::smart_ptr<PPTX::WrapperFile>& oTheme, NSCommon::smart_ptr<PPTX::WrapperWritingElement>& oClrMap)
{
CString strFillAttr = _T("");
CString strFillNode = _T("");
CalculateFill(spPr, style, oTheme, oClrMap, strFillAttr, strFillNode, false);
pWriter->StartNode(_T("v:background"));
pWriter->StartAttributes();
pWriter->WriteString(L" id=\"_x0000_s1025\"");
if (!pWriter->m_strAttributesMain.empty())
{
pWriter->WriteString(pWriter->m_strAttributesMain);
pWriter->m_strAttributesMain.clear();
}
pWriter->WriteString(strFillAttr);
pWriter->EndAttributes();
pWriter->WriteString(strFillNode);
pWriter->EndNode(_T("v:background"));
}
} // namespace Logic
} // namespace PPTX

View File

@ -134,6 +134,7 @@ namespace PPTX
}
void toXmlWriterVML(NSBinPptxRW::CXmlWriter* pWriter, smart_ptr<PPTX::WrapperFile>& oTheme, smart_ptr<PPTX::WrapperWritingElement>& oClrMap);
void toXmlWriterVMLBackground(NSBinPptxRW::CXmlWriter *pWriter, NSCommon::smart_ptr<PPTX::WrapperFile>& oTheme, NSCommon::smart_ptr<PPTX::WrapperWritingElement>& oClrMap);
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
{

View File

@ -49,14 +49,12 @@ namespace PPTX
pWriter->StartNode(_T("v:group"));
pWriter->StartAttributes();
CString strId = _T("");
strId.Format(_T("group %d"), pWriter->m_lObjectIdVML);
CString strSpid = _T("");
strSpid.Format(_T("_x%04d_s%04d"), 0xFFFF & (pWriter->m_lObjectIdVML >> 16), 0xFFFF & pWriter->m_lObjectIdVML);
std::wstring strId = L"group " + std::to_wstring(pWriter->m_lObjectIdVML);
std::wstring strSpid = L"_x" + std::to_wstring(0xFFFF & (pWriter->m_lObjectIdVML >> 16)) + L"_s" + std::to_wstring(0xFFFF & pWriter->m_lObjectIdVML);
pWriter->m_lObjectIdVML++;
pWriter->WriteAttribute(_T("id"), strId);
pWriter->WriteAttribute(_T("o:spid"), strSpid);
pWriter->WriteAttribute(L"id", strId);
pWriter->WriteAttribute(L"o:spid", strSpid);
NSBinPptxRW::CXmlWriter oStylesWriter;
if (_T("") != pWriter->m_strStyleMain)
@ -204,4 +202,4 @@ namespace PPTX
pWriter->EndNode(_T("v:group"));
}
}
}
}

View File

@ -54,7 +54,8 @@ namespace PPTX
return sC;
}
void CalculateFill(PPTX::Logic::SpPr& oSpPr, nullable<ShapeStyle>& pShapeStyle, NSCommon::smart_ptr<PPTX::WrapperFile>& _oTheme, NSCommon::smart_ptr<PPTX::WrapperWritingElement>& _oClrMap, CString& strAttr, CString& strNode, bool bOle)
void CalculateFill(PPTX::Logic::SpPr& oSpPr, nullable<ShapeStyle>& pShapeStyle, NSCommon::smart_ptr<PPTX::WrapperFile>& _oTheme,
NSCommon::smart_ptr<PPTX::WrapperWritingElement>& _oClrMap, std::wstring& strAttr, std::wstring& strNode, bool bOle)
{
smart_ptr<PPTX::Theme> oTheme = _oTheme.smart_dynamic_cast<PPTX::Theme>();
smart_ptr<PPTX::Logic::ClrMap> oClrMap = _oClrMap.smart_dynamic_cast<PPTX::Logic::ClrMap>();
@ -173,14 +174,14 @@ namespace PPTX
BYTE alpha = (BYTE)((ARGB >> 24) & 0xFF);
if (alpha < 255)
{
CString strA = _T("");
strA.Format(_T("%d"), alpha);
CString strA = = std::to_string( alpha);
strAttr += _T(" opacity=\"") + strA + _T("\"");
}
*/
}
void CalculateLine(PPTX::Logic::SpPr& oSpPr, nullable<ShapeStyle>& pShapeStyle, NSCommon::smart_ptr<PPTX::WrapperFile>& _oTheme, NSCommon::smart_ptr<PPTX::WrapperWritingElement>& _oClrMap, CString& strAttr, CString& strNode, bool bOle)
void CalculateLine(PPTX::Logic::SpPr& oSpPr, nullable<ShapeStyle>& pShapeStyle, NSCommon::smart_ptr<PPTX::WrapperFile>& _oTheme,
NSCommon::smart_ptr<PPTX::WrapperWritingElement>& _oClrMap, std::wstring& strAttr, std::wstring& strNode, bool bOle)
{
smart_ptr<PPTX::Theme> oTheme = _oTheme.smart_dynamic_cast<PPTX::Theme>();
smart_ptr<PPTX::Logic::ClrMap> oClrMap = _oClrMap.smart_dynamic_cast<PPTX::Logic::ClrMap>();

View File

@ -41,8 +41,10 @@ namespace PPTX
{
namespace Logic
{
void CalculateFill(PPTX::Logic::SpPr& oSpPr, nullable<ShapeStyle>& pShapeStyle, smart_ptr<PPTX::WrapperFile>& oTheme, smart_ptr<PPTX::WrapperWritingElement>& oClrMap, CString& strAttr, CString& strNode, bool bOle = false);
void CalculateLine(PPTX::Logic::SpPr& oSpPr, nullable<ShapeStyle>& pShapeStyle, smart_ptr<PPTX::WrapperFile>& oTheme, smart_ptr<PPTX::WrapperWritingElement>& oClrMap, CString& strAttr, CString& strNode, bool bOle = false);
void CalculateFill(PPTX::Logic::SpPr& oSpPr, nullable<ShapeStyle>& pShapeStyle, smart_ptr<PPTX::WrapperFile>& oTheme,
smart_ptr<PPTX::WrapperWritingElement>& oClrMap, std::wstring& strAttr, std::wstring& strNode, bool bOle = false);
void CalculateLine(PPTX::Logic::SpPr& oSpPr, nullable<ShapeStyle>& pShapeStyle,
smart_ptr<PPTX::WrapperFile>& oTheme, smart_ptr<PPTX::WrapperWritingElement>& oClrMap, std::wstring& strAttr, std::wstring& strNode, bool bOle = false);
class SpTreeElem : public WrapperWritingElement
{

View File

@ -53,14 +53,13 @@ INCLUDEPATH += \
SOURCES += pptxformatlib.cpp
build_fast {
core_release {
SOURCES += \
pptxformatlib_logic.cpp \
pptxformatlib_converter.cpp
} else {
pptxformatlib_logic.cpp
}
core_debug {
SOURCES += \
../../../ASCOfficeDrawingConverter.cpp \
../../../ASCOfficePPTXFileRealization.cpp \
../../../PPTXFormat/DocxFormat/IFileContainer.cpp \
../../../PPTXFormat/Logic/Colors/SchemeClr.cpp \
../../../PPTXFormat/Logic/Fills/Blip.cpp \
@ -94,19 +93,23 @@ SOURCES += \
../../../PPTXFormat/Logic/TxBody.cpp \
../../../PPTXFormat/Logic/UniColor.cpp \
../../../PPTXFormat/Logic/UniEffect.cpp \
../../../PPTXFormat/Logic/Runs/MathParaWrapper.cpp \
../../../PPTXFormat/Logic/Runs/MathParaWrapper.cpp \
../../../PPTXFormat/Logic/Controls.cpp \
../../../PPTXFormat/FileContainer.cpp \
../../../PPTXFormat/FileFactory.cpp \
../../../PPTXFormat/FileMap.cpp \
../../../PPTXFormat/Folder.cpp \
../../../PPTXFormat/Folder.cpp
}
SOURCES += \
../../../ASCOfficeDrawingConverter.cpp \
../../../ASCOfficePPTXFileRealization.cpp \
../../../Editor/BinaryFileReaderWriter.cpp \
../../../Editor/FontPicker.cpp \
../../../Editor/Drawing/Layout.cpp \
../../../Editor/Drawing/TextAttributesEx.cpp \
../../../Editor/Drawing/Elements.cpp \
../../../PPTXFormat/Logic/Controls.cpp \
../../../../HtmlRenderer/src/ASCSVGWriter.cpp
}
HEADERS += pptxformatlib.h \
../../../ASCOfficeDrawingConverter.h \

View File

@ -1,36 +0,0 @@
/*
* (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
*
*/
#include "../../../Editor/FontPicker.cpp"
#include "../../../../HtmlRenderer/src/ASCSVGWriter.cpp"
#include "../../../ASCOfficeDrawingConverter.cpp"
#include "../../../ASCOfficePPTXFileRealization.cpp"
#include "../../../Editor/BinaryFileReaderWriter.cpp"

View File

@ -62,8 +62,9 @@
#include "../../../PPTXFormat/Logic/TxBody.cpp"
#include "../../../PPTXFormat/Logic/UniColor.cpp"
#include "../../../PPTXFormat/Logic/UniEffect.cpp"
#include "../../../PPTXFormat/Logic/Runs/MathParaWrapper.cpp"
#include "../../../PPTXFormat/Logic/Controls.cpp"
#include "../../../PPTXFormat/FileContainer.cpp"
#include "../../../PPTXFormat/FileFactory.cpp"
#include "../../../PPTXFormat/FileMap.cpp"
#include "../../../PPTXFormat/Folder.cpp"
#include "../../../PPTXFormat/Logic/Controls.cpp"

View File

@ -34,12 +34,12 @@ core_mac {
LIBS += $$DESTDIR -lUnicodeConverter
}
build_fast {
core_release {
SOURCES += \
rtfformatlib_source.cpp
} else {
}
core_debug {
SOURCES += \
../source/DestinationCommand.cpp \
../source/RtfBookmark.cpp \
../source/RtfChar.cpp \
../source/RtfDocument.cpp \
@ -63,10 +63,13 @@ SOURCES += \
../source/Reader/OOXShapeReader.cpp \
../source/Reader/OOXTableReader.cpp \
../source/Writer/OOXDocumentWriter.cpp \
../source/Writer/OOXWriter.cpp \
../source/ConvertationManager.cpp
../source/Writer/OOXWriter.cpp
}
SOURCES += \
../source/DestinationCommand.cpp \
../source/ConvertationManager.cpp
HEADERS += \
../source/Basic.h \
../source/ConvertationManager.h \

View File

@ -29,19 +29,25 @@
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#include "../source/DestinationCommand.cpp"
#include "../source/RtfBookmark.cpp"
#include "../source/RtfChar.cpp"
#include "../source/RtfDocument.cpp"
#include "../source/RtfGlobalTables.cpp"
#include "../source/RtfOldList.cpp"
#include "../source/RtfOle.cpp"
#include "../source/RtfPicture.cpp"
#include "../source/RtfOle.cpp"
#include "../source/RtfField.cpp"
#include "../source/RtfParagraph.cpp"
#include "../source/RtfProperty.cpp"
#include "../source/RtfReader.cpp"
#include "../source/RtfSection.cpp"
#include "../source/RtfShape.cpp"
#include "../source/RtfWriter.cpp"
#include "../source/RtfMath.cpp"
#include "../source/Reader/OOXMathReader.cpp"
#include "../source/Reader/OOXDrawingGraphicReader.cpp"
#include "../source/Reader/OOXHeaderReader.cpp"
#include "../source/Reader/OOXParagraphElementReaders.cpp"
#include "../source/Reader/OOXReader.cpp"
@ -49,4 +55,3 @@
#include "../source/Reader/OOXTableReader.cpp"
#include "../source/Writer/OOXDocumentWriter.cpp"
#include "../source/Writer/OOXWriter.cpp"
#include "../source/ConvertationManager.cpp"

View File

@ -35,7 +35,6 @@
#include "Ole1FormatReader.h"
#include "ConvertationManager.h"
#include "../../../ASCOfficePPTXFile/Editor/Drawing/Enums.h"
#include <boost/algorithm/string.hpp>

View File

@ -44,7 +44,7 @@
#include "Writer/OOXWriter.h"
#include "Writer/OOXRelsWriter.h"
#include "../../../ASCOfficePPTXFile/Editor/Drawing/Enums.h"
#include "../../../ASCOfficePPTXFile/Editor/Drawing/Shapes/BaseShape/PPTShape/Enums.h"
#define COMMAND_RTF_BOOL( pattern, target, command, hasParameter, parameter )\
else if( pattern == command )\

View File

@ -52,9 +52,9 @@ public: bool GetByType(CString sType, std::vector<CString>& aOutArray)
{
if(oParam.oReader->ReadNodeAttribute(i,"Type") == sType)
{
CString sResult = oParam.oReader->ReadNodeAttribute(i,"Target");
CString sResult = oParam.oReader->ReadNodeAttribute(i, "Target");
sResult = sResult.Replace('/','\\');
aOutArray.Append( sResult );
aOutArray += sResult;
}
}
return aOutArray.size() > 0;
@ -72,4 +72,4 @@ public: CString GetByID(CString sId)
}
return "";
}
};
};

View File

@ -117,7 +117,10 @@ public:
class RtfFieldInst : public IDocumentElement
{
public:
RtfFieldInst()
{
SetDefault();
}
void SetDefaultRtf()
{
SetDefault();

View File

@ -281,7 +281,7 @@ private:
{
token.Type = RtfToken::Control;
CStringA s; s.Format("%i", c);
CStringA s = std::to_string( c);
token.Key = s.GetBuffer();

View File

@ -691,11 +691,11 @@ CString RtfSectionProperty::RenderToOOX(RenderParameter oRenderParameter)
//Page Information
CString sPageSize;
if( PROP_DEF != m_nPageWidth )
sPageSize.AppendFormat(L" w:w=\"%d\"",m_nPageWidth);
sPageSize += L" w:w=\"" + std::to_wstring(m_nPageWidth) + L"\"";
if( PROP_DEF != m_nPageHeight )
sPageSize.AppendFormat(L" w:h=\"%d\"",m_nPageHeight);
sPageSize += L" w:h=\"" + std::to_wstring(m_nPageHeight) + L"\"";
if( 1 == m_bLandscapeFormat )
sPageSize.Append(L" w:orient=\"landscape\"");
sPageSize += L" w:orient=\"landscape\"";
if( false == sPageSize.IsEmpty() )
sResult += L"<w:pgSz " + sPageSize + L"/>";

View File

@ -1310,7 +1310,7 @@ CString RtfShape::RenderToOOXBegin(RenderParameter oRenderParameter)
if ( PROP_DEF != m_nFillOpacity)
{
CString sOpacity; sOpacity.Format(L"%d", /*100 - */m_nFillOpacity);
CString sOpacity = std::to_wstring( /*100 - */m_nFillOpacity);
sResult += L" opacity=\"" + sOpacity +L"%\"";
//sResult.AppendFormat( L" opacity=\"%df\"", m_nFillOpacity );
}

View File

@ -46,7 +46,7 @@ public:
return 1;
//копируем
CDirectory::CopyFile(sSource, sDestination, NULL, NULL);
CDirectory::CopyFile(sSource, sDestination);
return 0;
}

View File

@ -141,17 +141,13 @@ namespace Strings
static CString FromInteger(int Value, int Base = 10)
{
CString str;
str.Format(L"%d", Value);
CString str = std::to_wstring(Value);
return str;
}
static CString FromDouble(double Value)
{
CString str;
str.Format(L"%lf", Value);
CString str = std::to_wstring(Value);
return str;
}
@ -170,8 +166,7 @@ class Convert
public:
static CString ToString(int i)
{
CString result;
result.Format( L"%i", i);
CString result = std::to_wstring( i);
return result;
}
static CString ToStringHex( int i, int nLen )

View File

@ -50,14 +50,7 @@ SOURCES += \
../Source/Common/Encoding.cpp \
../Source/Common/ToString.cpp \
../Source/TxtFormat/File.cpp \
../Source/TxtFormat/TxtFile.cpp
build_fast {
SOURCES += \
txtxmlformatlib_converter.cpp
} else {
SOURCES += \
../Source/TxtFormat/TxtFile.cpp \
../Source/TxtXmlFile.cpp \
../Source/ConvertDocx2Txt.cpp \
../Source/ConvertTxt2Docx.cpp
}

View File

@ -1,34 +0,0 @@
/*
* (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
*
*/
#include "../Source/TxtXmlFile.cpp"
#include "../Source/ConvertDocx2Txt.cpp"
#include "../Source/ConvertTxt2Docx.cpp"

View File

@ -42,6 +42,9 @@
#include "../../OfficeUtils/src/OfficeUtils.h"
#pragma comment(lib,"Shell32.lib")
#pragma comment(lib,"Advapi32.lib")
int _tmain(int argc, _TCHAR* argv[])
{
HRESULT hr = S_OK;
@ -52,7 +55,7 @@ int _tmain(int argc, _TCHAR* argv[])
std::wstring outputDir = FileSystem::Directory::GetFolderPath(dstPath);
std::wstring dstTempPath = FileSystem::Directory::CreateDirectoryWithUniqueName(outputDir);
hr = ConvertXls2Xlsx(srcFileName, dstTempPath, L"", L"C:\\Windows\\Fonts", NULL);
hr = ConvertXls2Xlsx(srcFileName, dstTempPath, L"password", L"C:\\Windows\\Fonts", NULL);
if (hr == S_OK)
{

View File

@ -326,13 +326,6 @@ CFRecord& CFRecord::operator>>(bool& val)
CFRecord& CFRecord::operator<<(bool& val)
{
throw;// EXCEPT::LE::WrongAPIUsage("This function may only be called by mistake.", __FUNCTION__);
}
void CFRecord::registerDelayedDataReceiver(CFStream::DELAYED_DATA_SAVER fn, const size_t n, const CFRecordType::TypeId receiver_id)
{
//ASSERT(!data_); // This throws if used after Commit or while reading of binary

View File

@ -72,21 +72,20 @@ static std::wstring convertUtf16ToWString(const UTF16 * Data, int nLength)
return wstr;
}
// Binary representation of a record in BIFF8
class CFRecord
{
public:
CFRecord(CFStreamPtr stream, GlobalWorkbookInfoPtr global_info); // Create a record an read its data from the stream
CFRecord(CFRecordType::TypeId type_id, GlobalWorkbookInfoPtr global_info); // Create an empty record
~CFRecord();
void save(CFStreamPtr stream);
void commitData();
/* ID */
const CFRecordType::TypeId getTypeId() const;
const CFRecordType::TypeId getTypeId() const;
const CFRecordType::TypeString& getTypeString() const;
// File Pointer to the start of the record in file
const unsigned int getStreamPointer() const;
/* Data */
// Pointer to the beginning of the cached data
const char* getData() const ;
const size_t getDataSize() const;
@ -95,7 +94,6 @@ public:
void appendRawData(const char* raw_data, const size_t size);
void insertDataFromRecordToBeginning(CFRecordPtr where_from);
/* Pointers */
const bool isEOF() const; // whether all the data have bean read
// Checks whether the specified number of unsigned chars present in the non-read part of the buffer
// Doesn't generate an exception
@ -129,20 +127,11 @@ public:
size_ += n;
}
/* Markup delayed data */
// Registers data receiver place and reserves n unsigned chars for it
void registerDelayedDataReceiver(CFStream::DELAYED_DATA_SAVER fn, const size_t n, const CFRecordType::TypeId receiver_id = rt_NONE);
// Registers delayed source data as any user-defined unsigned int
void registerDelayedDataSource(const unsigned int data, const CFRecordType::TypeId receiver_id);
// Registers delayed source data as file pointer of the start of the record
void registerDelayedFilePointerSource(const CFRecordType::TypeId receiver_id);
// Registers delayed source data as file pointer of the start of the record and the specified offset added
void registerDelayedFilePointerAndOffsetSource(const unsigned int offset, const CFRecordType::TypeId receiver_id);
// Extract the specified type of data without moving rdPtr
template<class T>
const T* getCurData() const
{
@ -187,25 +176,12 @@ public:
CFRecord& operator>>(char& val) { loadAnyData(val); return *this; }
CFRecord& operator>>(bool& val);
CFRecord& operator<<(unsigned char& val) { storeAnyData(val); return *this; }
CFRecord& operator<<(unsigned short& val) { storeAnyData(val); return *this; }
CFRecord& operator<<(unsigned int& val) { storeAnyData(val); return *this; }
CFRecord& operator<<(int& val) { storeAnyData(val); return *this; }
CFRecord& operator<<(double& val) { storeAnyData(val); return *this; }
CFRecord& operator<<(_GUID_& val) { storeAnyData(val); return *this; }
CFRecord& operator<<(short& val) { storeAnyData(val); return *this; }
CFRecord& operator<<(char& val) { storeAnyData(val); return *this; }
CFRecord& operator<<(wchar_t& val) { storeAnyData(val); return *this; }
CFRecord& operator<<(bool& val);
private:
static const size_t MAX_RECORD_SIZE = 8224;
private:
CFStream::ReceiverItems receiver_items;
CFStream::SourceItems source_items;
private: // parts of the record
unsigned int file_ptr;
CFRecordType::TypeId type_id_;
size_t size_;
@ -213,7 +189,6 @@ private: // parts of the record
size_t rdPtr;
static char intData[MAX_RECORD_SIZE];
private:
GlobalWorkbookInfoPtr global_info_;
};
@ -262,16 +237,6 @@ CFRecord& operator<<(CFRecord& record, std::vector<T>& vec)
CFRecord& operator>>(CFRecord & record, std::wstring & str);
#endif
template<class T>
CFRecord& operator<<(CFRecord & record, std::basic_string<T, std::char_traits<T>, std::allocator<T> >& str)
{
for(typename std::basic_string<T, std::char_traits<T>, std::allocator<T> >::iterator it = str.begin(), itEnd = str.end(); it != itEnd; ++it)
{
record << *it;
}
record.storeAnyData(static_cast<T>(0));
return record;
}
template<class T>
CFRecord& operator>>(CFRecord & record, _CP_OPT(T)& val)

View File

@ -37,11 +37,11 @@
namespace CRYPT
{
RC4Decryptor::RC4Decryptor(CryptRC4Data & header, std::wstring password, int type) :
crypt (new RC4Crypt(header, password, type)),
type (Crypt::RC4)
RC4Decryptor::RC4Decryptor(CryptRC4Data & header, std::wstring _password, int _type) :
crypt(new RC4Crypt(header, _password, _type))
{
crypt_data = header;
crypt_data = header;
type = _type;
}
void RC4Decryptor::Decrypt(char* data, const size_t size, const unsigned long stream_pos)
@ -54,7 +54,7 @@ namespace CRYPT
return crypt->IsVerify();
}
bool RC4Decryptor::SetPassword(std::wstring password, int type)
bool RC4Decryptor::SetPassword(std::wstring password)
{
crypt.reset();
crypt = CryptPtr(new RC4Crypt(crypt_data, password, type));

View File

@ -43,18 +43,16 @@ namespace CRYPT
RC4Decryptor(CryptRC4Data & header, std::wstring password, int type);
virtual void Decrypt(char* data, const size_t size, const unsigned long stream_pos);
virtual bool SetPassword(std::wstring password);
bool IsVerify();
bool SetPassword(std::wstring password, int type = 1);
virtual bool IsVerify();
private:
int type;
CryptPtr crypt;
Crypt::crypt_type type;
CryptRC4Data crypt_data;
};
typedef boost::shared_ptr<RC4Decryptor> RC4DecryptorPtr;
} // namespace CRYPT

View File

@ -51,15 +51,6 @@ BaseObjectPtr AnyObject::clone()
return BaseObjectPtr(new AnyObject(*this));
}
void AnyObject::writeFields(CFRecord& record)
{
#pragma message("####################### AnyObject record is not implemented")
Log::info("AnyObject record is not implemented.");
//record << some_value;
}
void AnyObject::readFields(CFRecord& record)
{
tag_name = record.getTypeString();

View File

@ -48,7 +48,7 @@ public:
~AnyObject();
BaseObjectPtr clone();
virtual void writeFields(CFRecord& record);
virtual void readFields(CFRecord& record);
std::string tag_name;

Some files were not shown because too many files have changed in this diff Show More