Commit 78b051c9 authored by ElenaSubbotina's avatar ElenaSubbotina

...

parent 6e409d2f
......@@ -406,34 +406,12 @@ namespace XMLTools
void WriteInteger(int Value, int Base = 10)
{
#if defined(_WIN32) || defined (_WIN64)
wchar_t buff[33] ={};
_itow(Value, buff, Base);
m_str += std::wstring(buff);
#else
m_str += std::to_wstring(Value);
#endif
}
void WriteDouble(double Value)
{
#if defined(_WIN32) || defined (_WIN64)
int *dec = NULL, *sign = NULL;
char *str = _fcvt( Value , 4, dec, sign);
if (str)
{
std::string sA(str);
delete []str;
m_str += std::wstring(sA.begin(), sA.end());
}
else
{
m_str += L"0";
}
#else
m_str += std::to_wstring(Value);
#endif
}
void WriteBoolean(bool Value)
{
......
......@@ -54,16 +54,16 @@ namespace DocFileFormat
int index = 0;
m_pXmlWriter->WriteNodeBegin( _T( "?xml version=\"1.0\" encoding=\"UTF-8\"?" ) );
m_pXmlWriter->WriteNodeBegin( _T( "w:comments" ), TRUE );
m_pXmlWriter->WriteNodeBegin( L"?xml version=\"1.0\" encoding=\"UTF-8\"?");
m_pXmlWriter->WriteNodeBegin( L"w:comments", TRUE );
//write namespaces
m_pXmlWriter->WriteAttribute( _T( "xmlns:w" ), OpenXmlNamespaces::WordprocessingML );
m_pXmlWriter->WriteAttribute( _T( "xmlns:v" ), OpenXmlNamespaces::VectorML );
m_pXmlWriter->WriteAttribute( _T( "xmlns:o" ), OpenXmlNamespaces::Office );
m_pXmlWriter->WriteAttribute( _T( "xmlns:w10" ), OpenXmlNamespaces::OfficeWord );
m_pXmlWriter->WriteAttribute( _T( "xmlns:r" ), OpenXmlNamespaces::Relationships );
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
m_pXmlWriter->WriteAttribute( L"xmlns:w", OpenXmlNamespaces::WordprocessingML );
m_pXmlWriter->WriteAttribute( L"xmlns:v", OpenXmlNamespaces::VectorML );
m_pXmlWriter->WriteAttribute( L"xmlns:o", OpenXmlNamespaces::Office );
m_pXmlWriter->WriteAttribute( L"xmlns:w10", OpenXmlNamespaces::OfficeWord );
m_pXmlWriter->WriteAttribute( L"xmlns:r", OpenXmlNamespaces::Relationships );
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
int cp = m_document->FIB->m_RgLw97.ccpText + m_document->FIB->m_RgLw97.ccpFtn + m_document->FIB->m_RgLw97.ccpHdr;
......@@ -72,11 +72,11 @@ namespace DocFileFormat
{
AnnotationReferenceDescriptor* atrdPre10 = static_cast<AnnotationReferenceDescriptor*>(m_document->AnnotationsReferencePlex->Elements[index]);
m_pXmlWriter->WriteNodeBegin( _T( "w:comment" ), TRUE );
m_pXmlWriter->WriteAttribute( _T( "w:id" ), FormatUtils::IntToWideString( index ));
m_pXmlWriter->WriteAttribute( _T( "w:author" ),
m_pXmlWriter->WriteNodeBegin( L"w:comment", TRUE );
m_pXmlWriter->WriteAttribute( L"w:id", FormatUtils::IntToWideString( index ));
m_pXmlWriter->WriteAttribute( L"w:author",
FormatUtils::XmlEncode(m_document->AnnotationOwners->at( atrdPre10->GetAuthorIndex() ) ));
m_pXmlWriter->WriteAttribute( _T( "w:initials" ), atrdPre10->GetUserInitials());
m_pXmlWriter->WriteAttribute( L"w:initials", atrdPre10->GetUserInitials());
//!!!TODO!!!
/*//ATRDpost10 is optional and not saved in all files
......@@ -87,7 +87,7 @@ namespace DocFileFormat
atrdPost10.Date.Convert(new DateMapping(_writer));
}*/
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
while ( ( cp - m_document->FIB->m_RgLw97.ccpText - m_document->FIB->m_RgLw97.ccpFtn - m_document->FIB->m_RgLw97.ccpHdr ) < (*m_document->IndividualCommentsPlex)[index + 1] )
{
......@@ -111,12 +111,12 @@ namespace DocFileFormat
}
}
m_pXmlWriter->WriteNodeEnd(_T( "w:comment" ));
m_pXmlWriter->WriteNodeEnd(L"w:comment" );
++index;
}
m_pXmlWriter->WriteNodeEnd( _T( "w:comments" ) );
m_pXmlWriter->WriteNodeEnd( L"w:comments" );
m_context->_docx->CommentsXML = std::wstring(m_pXmlWriter->GetXmlString());
}
}
......
......@@ -54,24 +54,24 @@ namespace DocFileFormat
int id = 0;
m_pXmlWriter->WriteNodeBegin( _T( "?xml version=\"1.0\" encoding=\"UTF-8\"?" ) );
m_pXmlWriter->WriteNodeBegin( _T( "w:endnotes" ), TRUE );
m_pXmlWriter->WriteNodeBegin( L"?xml version=\"1.0\" encoding=\"UTF-8\"?");
m_pXmlWriter->WriteNodeBegin( L"w:endnotes", TRUE );
//write namespaces
m_pXmlWriter->WriteAttribute( _T( "xmlns:w" ), OpenXmlNamespaces::WordprocessingML );
m_pXmlWriter->WriteAttribute( _T( "xmlns:v" ), OpenXmlNamespaces::VectorML );
m_pXmlWriter->WriteAttribute( _T( "xmlns:o" ), OpenXmlNamespaces::Office );
m_pXmlWriter->WriteAttribute( _T( "xmlns:w10" ), OpenXmlNamespaces::OfficeWord );
m_pXmlWriter->WriteAttribute( _T( "xmlns:r" ), OpenXmlNamespaces::Relationships );
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
m_pXmlWriter->WriteAttribute( L"xmlns:w", OpenXmlNamespaces::WordprocessingML );
m_pXmlWriter->WriteAttribute( L"xmlns:v", OpenXmlNamespaces::VectorML );
m_pXmlWriter->WriteAttribute( L"xmlns:o", OpenXmlNamespaces::Office );
m_pXmlWriter->WriteAttribute( L"xmlns:w10", OpenXmlNamespaces::OfficeWord );
m_pXmlWriter->WriteAttribute( L"xmlns:r", OpenXmlNamespaces::Relationships );
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
int cp = ( m_document->FIB->m_RgLw97.ccpText + m_document->FIB->m_RgLw97.ccpFtn + m_document->FIB->m_RgLw97.ccpHdr + m_document->FIB->m_RgLw97.ccpAtn );
while ( cp <= ( m_document->FIB->m_RgLw97.ccpText + m_document->FIB->m_RgLw97.ccpFtn + m_document->FIB->m_RgLw97.ccpHdr + m_document->FIB->m_RgLw97.ccpAtn + m_document->FIB->m_RgLw97.ccpEdn - 2 ) )
{
m_pXmlWriter->WriteNodeBegin( _T( "w:endnote" ), TRUE );
m_pXmlWriter->WriteAttribute( _T( "w:id" ), FormatUtils::IntToWideString( id ));
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
m_pXmlWriter->WriteNodeBegin( L"w:endnote", TRUE );
m_pXmlWriter->WriteAttribute( L"w:id", FormatUtils::IntToWideString( id ));
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
while ( ( cp - m_document->FIB->m_RgLw97.ccpText - m_document->FIB->m_RgLw97.ccpFtn - m_document->FIB->m_RgLw97.ccpHdr - m_document->FIB->m_RgLw97.ccpAtn ) < (*m_document->IndividualEndnotesPlex)[id + 1] )
{
......@@ -95,11 +95,11 @@ namespace DocFileFormat
}
}
m_pXmlWriter->WriteNodeEnd( _T( "w:endnote" ) );
m_pXmlWriter->WriteNodeEnd( L"w:endnote");
id++;
}
m_pXmlWriter->WriteNodeEnd( _T( "w:endnotes" ) );
m_pXmlWriter->WriteNodeEnd( L"w:endnotes");
m_context->_docx->EndnotesXML = std::wstring( m_pXmlWriter->GetXmlString() );
}
......
......@@ -54,10 +54,10 @@ namespace DocFileFormat
this->_ctx->_docx->RegisterFontTable();
m_pXmlWriter->WriteNodeBegin( _T( "?xml version=\"1.0\" encoding=\"UTF-8\"?" ) );
m_pXmlWriter->WriteNodeBegin( _T( "w:fonts" ), TRUE );
m_pXmlWriter->WriteAttribute( _T( "xmlns:w" ), OpenXmlNamespaces::WordprocessingML );
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
m_pXmlWriter->WriteNodeBegin( L"?xml version=\"1.0\" encoding=\"UTF-8\"?" );
m_pXmlWriter->WriteNodeBegin( L"w:fonts", TRUE );
m_pXmlWriter->WriteAttribute( L"xmlns:w", OpenXmlNamespaces::WordprocessingML );
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
int sz_fonts = table->Data.size();
int users_fonts = 0;
......@@ -66,79 +66,79 @@ namespace DocFileFormat
{
FontFamilyName* font = dynamic_cast<FontFamilyName*>( *iter );
m_pXmlWriter->WriteNodeBegin( _T( "w:font" ), TRUE );
m_pXmlWriter->WriteNodeBegin( L"w:font", TRUE );
std::wstring name_ = FormatUtils::XmlEncode(font->xszFtn, true);
if (name_.empty())
name_ = L"UserFont_" + std::to_wstring(++users_fonts);
m_pXmlWriter->WriteAttribute( _T( "w:name" ), name_);
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
m_pXmlWriter->WriteAttribute( L"w:name", name_);
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
//alternative name
if ( ( font->xszAlt != std::wstring( _T( "" ) ) ) && ( font->xszAlt.length() > 0 ) )
if ( ( font->xszAlt != std::wstring( L"" ) ) && ( font->xszAlt.length() > 0 ) )
{
m_pXmlWriter->WriteNodeBegin( _T( "w:altName" ), TRUE );
m_pXmlWriter->WriteAttribute( _T( "w:val" ), FormatUtils::XmlEncode(font->xszAlt, true));
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
m_pXmlWriter->WriteNodeEnd( _T( "w:altName" ) );
m_pXmlWriter->WriteNodeBegin( L"w:altName", TRUE );
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::XmlEncode(font->xszAlt, true));
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
m_pXmlWriter->WriteNodeEnd( L"w:altName" );
}
//charset
m_pXmlWriter->WriteNodeBegin( _T("w:charset" ), TRUE );
m_pXmlWriter->WriteAttribute( _T( "w:val" ), FormatUtils::IntToFormattedWideString( font->chs, _T( "%02x" ) ));
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
m_pXmlWriter->WriteNodeEnd( _T( "w:charset" ) );
m_pXmlWriter->WriteNodeBegin( L"w:charset", TRUE );
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::IntToFormattedWideString( font->chs, L"%02x" ));
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
m_pXmlWriter->WriteNodeEnd( L"w:charset" );
//font family
m_pXmlWriter->WriteNodeBegin( _T("w:family"), TRUE );
m_pXmlWriter->WriteAttribute( _T( "w:val" ), FormatUtils::MapValueToWideString( font->ff, &FontFamily[0][0], 6, 11 ));
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
m_pXmlWriter->WriteNodeEnd( _T( "w:family" ) );
m_pXmlWriter->WriteNodeBegin( L"w:family", TRUE );
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::MapValueToWideString( font->ff, &FontFamily[0][0], 6, 11 ));
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
m_pXmlWriter->WriteNodeEnd( L"w:family" );
//panose
m_pXmlWriter->WriteNodeBegin( _T("w:panose1"), TRUE );
m_pXmlWriter->WriteNodeBegin( L"w:panose1", TRUE );
std::wstring wstr( _T( "" ) );
std::wstring wstr( L"" );
for ( unsigned int i = 0; i < font->panoseSize; i++ )
{
wstr += FormatUtils::IntToFormattedWideString( font->panose[i], _T( "%02x" ) );
wstr += FormatUtils::IntToFormattedWideString( font->panose[i], L"%02x" );
}
m_pXmlWriter->WriteAttribute( _T( "w:val" ), wstr);
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
m_pXmlWriter->WriteNodeEnd( _T( "w:panose1" ) );
m_pXmlWriter->WriteAttribute( L"w:val", wstr);
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
m_pXmlWriter->WriteNodeEnd( L"w:panose1" );
//pitch
m_pXmlWriter->WriteNodeBegin( _T("w:pitch"), TRUE );
m_pXmlWriter->WriteAttribute( _T( "w:val" ), FormatUtils::MapValueToWideString( font->prq, &FontPitch[0][0], 3, 9 ));
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
m_pXmlWriter->WriteNodeEnd( _T( "w:pitch" ) );
m_pXmlWriter->WriteNodeBegin( L"w:pitch", TRUE );
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::MapValueToWideString( font->prq, &FontPitch[0][0], 3, 9 ));
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
m_pXmlWriter->WriteNodeEnd( L"w:pitch" );
//truetype
if ( !font->fTrueType )
{
m_pXmlWriter->WriteNodeBegin( _T("w:notTrueType"), TRUE );
m_pXmlWriter->WriteAttribute( _T( "w:val" ), _T( "true" ) );
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
m_pXmlWriter->WriteNodeEnd( _T( "w:notTrueType" ) );
m_pXmlWriter->WriteNodeBegin( L"w:notTrueType", TRUE );
m_pXmlWriter->WriteAttribute( L"w:val", L"true" );
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
m_pXmlWriter->WriteNodeEnd( L"w:notTrueType" );
}
//font signature
m_pXmlWriter->WriteNodeBegin( _T("w:sig"), TRUE );
m_pXmlWriter->WriteAttribute( _T( "w:usb0" ), FormatUtils::IntToFormattedWideString( font->fs.UnicodeSubsetBitfield0, _T( "%08x" ) ));
m_pXmlWriter->WriteAttribute( _T( "w:usb1" ), FormatUtils::IntToFormattedWideString( font->fs.UnicodeSubsetBitfield1, _T( "%08x" ) ));
m_pXmlWriter->WriteAttribute( _T( "w:usb2" ), FormatUtils::IntToFormattedWideString( font->fs.UnicodeSubsetBitfield2, _T( "%08x" ) ));
m_pXmlWriter->WriteAttribute( _T( "w:usb3" ), FormatUtils::IntToFormattedWideString( font->fs.UnicodeSubsetBitfield3, _T( "%08x" ) ));
m_pXmlWriter->WriteAttribute( _T( "w:csb0" ), FormatUtils::IntToFormattedWideString( font->fs.CodePageBitfield0, _T( "%08x" ) ));
m_pXmlWriter->WriteAttribute( _T( "w:csb1" ), FormatUtils::IntToFormattedWideString( font->fs.CodePageBitfield1, _T( "%08x" ) ));
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
m_pXmlWriter->WriteNodeEnd( _T( "w:sig" ) );
m_pXmlWriter->WriteNodeEnd( _T( "w:font" ) );
m_pXmlWriter->WriteNodeBegin( L"w:sig", TRUE );
m_pXmlWriter->WriteAttribute( L"w:usb0", FormatUtils::IntToFormattedWideString( font->fs.UnicodeSubsetBitfield0, L"%08x" ));
m_pXmlWriter->WriteAttribute( L"w:usb1", FormatUtils::IntToFormattedWideString( font->fs.UnicodeSubsetBitfield1, L"%08x" ));
m_pXmlWriter->WriteAttribute( L"w:usb2", FormatUtils::IntToFormattedWideString( font->fs.UnicodeSubsetBitfield2, L"%08x" ));
m_pXmlWriter->WriteAttribute( L"w:usb3", FormatUtils::IntToFormattedWideString( font->fs.UnicodeSubsetBitfield3, L"%08x" ));
m_pXmlWriter->WriteAttribute( L"w:csb0", FormatUtils::IntToFormattedWideString( font->fs.CodePageBitfield0, L"%08x" ));
m_pXmlWriter->WriteAttribute( L"w:csb1", FormatUtils::IntToFormattedWideString( font->fs.CodePageBitfield1, L"%08x" ));
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
m_pXmlWriter->WriteNodeEnd( L"w:sig" );
m_pXmlWriter->WriteNodeEnd( L"w:font" );
}
m_pXmlWriter->WriteNodeEnd( _T("w:fonts") );
m_pXmlWriter->WriteNodeEnd( L"w:fonts");
this->_ctx->_docx->FontTableXML = std::wstring( m_pXmlWriter->GetXmlString() );
}
......
......@@ -42,19 +42,19 @@ namespace DocFileFormat
{
static const wchar_t FontFamily[6][11] =
{
_T( "auto" ),
_T( "roman" ),
_T( "swiss" ),
_T( "modern" ),
_T( "script" ),
_T( "decorative" )
L"auto",
L"roman",
L"swiss",
L"modern",
L"script",
L"decorative"
};
static const wchar_t FontPitch[3][9] =
{
_T( "default" ),
_T( "fixed" ),
_T( "variable" )
L"default",
L"fixed",
L"variable"
};
class FontTableMapping: public AbstractOpenXmlMapping, public IMapping
......
......@@ -45,16 +45,16 @@ namespace DocFileFormat
m_document = static_cast<WordDocument*>( visited );
//start the document
m_pXmlWriter->WriteNodeBegin( _T( "?xml version=\"1.0\" encoding=\"UTF-8\"?" ) );
m_pXmlWriter->WriteNodeBegin( _T( "w:ftr" ), TRUE );
m_pXmlWriter->WriteNodeBegin( L"?xml version=\"1.0\" encoding=\"UTF-8\"?" );
m_pXmlWriter->WriteNodeBegin( L"w:ftr", TRUE );
//write namespaces
m_pXmlWriter->WriteAttribute( _T( "xmlns:w" ), OpenXmlNamespaces::WordprocessingML );
m_pXmlWriter->WriteAttribute( _T( "xmlns:v" ), OpenXmlNamespaces::VectorML );
m_pXmlWriter->WriteAttribute( _T( "xmlns:o" ), OpenXmlNamespaces::Office );
m_pXmlWriter->WriteAttribute( _T( "xmlns:w10" ), OpenXmlNamespaces::OfficeWord );
m_pXmlWriter->WriteAttribute( _T( "xmlns:r" ), OpenXmlNamespaces::Relationships );
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
m_pXmlWriter->WriteAttribute( L"xmlns:w", OpenXmlNamespaces::WordprocessingML );
m_pXmlWriter->WriteAttribute( L"xmlns:v", OpenXmlNamespaces::VectorML );
m_pXmlWriter->WriteAttribute( L"xmlns:o", OpenXmlNamespaces::Office );
m_pXmlWriter->WriteAttribute( L"xmlns:w10", OpenXmlNamespaces::OfficeWord );
m_pXmlWriter->WriteAttribute( L"xmlns:r", OpenXmlNamespaces::Relationships );
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
//convert the footer text
_lastValidPapx = (*(m_document->AllPapxFkps->begin()))->grppapx[0];
......@@ -93,7 +93,7 @@ namespace DocFileFormat
}
}
m_pXmlWriter->WriteNodeEnd( _T( "w:ftr" ) );
m_pXmlWriter->WriteNodeEnd( L"w:ftr" );
m_context->_docx->FooterXMLList.push_back( std::wstring( m_pXmlWriter->GetXmlString() ) );
}
......
......@@ -54,24 +54,24 @@ namespace DocFileFormat
int id = 0;
m_pXmlWriter->WriteNodeBegin( _T( "?xml version=\"1.0\" encoding=\"UTF-8\"?" ) );
m_pXmlWriter->WriteNodeBegin( _T( "w:footnotes" ), TRUE );
m_pXmlWriter->WriteNodeBegin( L"?xml version=\"1.0\" encoding=\"UTF-8\"?" );
m_pXmlWriter->WriteNodeBegin( L"w:footnotes", TRUE );
//write namespaces
m_pXmlWriter->WriteAttribute( _T( "xmlns:w" ), OpenXmlNamespaces::WordprocessingML );
m_pXmlWriter->WriteAttribute( _T( "xmlns:v" ), OpenXmlNamespaces::VectorML );
m_pXmlWriter->WriteAttribute( _T( "xmlns:o" ), OpenXmlNamespaces::Office );
m_pXmlWriter->WriteAttribute( _T( "xmlns:w10" ), OpenXmlNamespaces::OfficeWord );
m_pXmlWriter->WriteAttribute( _T( "xmlns:r" ), OpenXmlNamespaces::Relationships );
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
m_pXmlWriter->WriteAttribute( L"xmlns:w", OpenXmlNamespaces::WordprocessingML );
m_pXmlWriter->WriteAttribute( L"xmlns:v", OpenXmlNamespaces::VectorML );
m_pXmlWriter->WriteAttribute( L"xmlns:o", OpenXmlNamespaces::Office );
m_pXmlWriter->WriteAttribute( L"xmlns:w10", OpenXmlNamespaces::OfficeWord );
m_pXmlWriter->WriteAttribute( L"xmlns:r", OpenXmlNamespaces::Relationships );
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
int cp = m_document->FIB->m_RgLw97.ccpText;
while ( cp <= ( m_document->FIB->m_RgLw97.ccpText + m_document->FIB->m_RgLw97.ccpFtn - 2 ) )
{
m_pXmlWriter->WriteNodeBegin( _T( "w:footnote" ), TRUE );
m_pXmlWriter->WriteAttribute( _T( "w:id" ), FormatUtils::IntToWideString( id ));
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
m_pXmlWriter->WriteNodeBegin( L"w:footnote", TRUE );
m_pXmlWriter->WriteAttribute( L"w:id", FormatUtils::IntToWideString( id ));
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
while ( ( cp - m_document->FIB->m_RgLw97.ccpText ) < (*m_document->IndividualFootnotesPlex)[id + 1] )
{
......@@ -95,11 +95,11 @@ namespace DocFileFormat
}
}
m_pXmlWriter->WriteNodeEnd( _T( "w:footnote" ) );
m_pXmlWriter->WriteNodeEnd( L"w:footnote");
id++;
}
m_pXmlWriter->WriteNodeEnd( _T( "w:footnotes" ) );
m_pXmlWriter->WriteNodeEnd( L"w:footnotes");
m_context->_docx->FootnotesXML = std::wstring(m_pXmlWriter->GetXmlString());
}
......
......@@ -45,16 +45,16 @@ namespace DocFileFormat
m_document = static_cast<WordDocument*>( visited );
//start the document
m_pXmlWriter->WriteNodeBegin( _T( "?xml version=\"1.0\" encoding=\"UTF-8\"?" ) );
m_pXmlWriter->WriteNodeBegin( _T( "w:hdr" ), TRUE );
m_pXmlWriter->WriteNodeBegin( L"?xml version=\"1.0\" encoding=\"UTF-8\"?");
m_pXmlWriter->WriteNodeBegin( L"w:hdr", TRUE );
//write namespaces
m_pXmlWriter->WriteAttribute( _T( "xmlns:w" ), OpenXmlNamespaces::WordprocessingML );
m_pXmlWriter->WriteAttribute( _T( "xmlns:v" ), OpenXmlNamespaces::VectorML );
m_pXmlWriter->WriteAttribute( _T( "xmlns:o" ), OpenXmlNamespaces::Office );
m_pXmlWriter->WriteAttribute( _T( "xmlns:w10" ), OpenXmlNamespaces::OfficeWord );
m_pXmlWriter->WriteAttribute( _T( "xmlns:r" ), OpenXmlNamespaces::Relationships );
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
m_pXmlWriter->WriteAttribute( L"xmlns:w", OpenXmlNamespaces::WordprocessingML );
m_pXmlWriter->WriteAttribute( L"xmlns:v", OpenXmlNamespaces::VectorML );
m_pXmlWriter->WriteAttribute( L"xmlns:o", OpenXmlNamespaces::Office );
m_pXmlWriter->WriteAttribute( L"xmlns:w10", OpenXmlNamespaces::OfficeWord );
m_pXmlWriter->WriteAttribute( L"xmlns:r", OpenXmlNamespaces::Relationships );
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
//convert the header text
_lastValidPapx = (*(m_document->AllPapxFkps->begin()))->grppapx[0];
......@@ -88,7 +88,7 @@ namespace DocFileFormat
}
}
m_pXmlWriter->WriteNodeEnd( _T( "w:hdr" ) );
m_pXmlWriter->WriteNodeEnd( L"w:hdr");
m_context->_docx->HeaderXMLList.push_back( std::wstring( m_pXmlWriter->GetXmlString() ) );
}
......
......@@ -52,9 +52,9 @@ namespace DocFileFormat
static const wchar_t LevelJustificationMap[3][7] =
{
_T("left"),
_T("center"),
_T("right")
L"left",
L"center",
L"right"
};
class NumberingMapping: public AbstractOpenXmlMapping, public IMapping
......
......@@ -146,15 +146,15 @@ namespace DocFileFormat
{
for (size_t i = 0; i < m_arPoints.size(); ++i)
{
strVmlPath += _T( "l" );
strVmlPath += L"l";
strVmlPath += FormatUtils::IntToWideString(m_arPoints[i].x);
strVmlPath += _T( "," );
strVmlPath += L",";
strVmlPath += FormatUtils::IntToWideString(m_arPoints[i].y);
++valuePointer;
}
strVmlPath += _T( "xe" );
strVmlPath += L"xe";
return strVmlPath;
}
......@@ -175,9 +175,9 @@ namespace DocFileFormat
{
break;
strVmlPath += _T( "l" );
strVmlPath += L"l";
strVmlPath += FormatUtils::IntToWideString(m_arPoints[0].x);
strVmlPath += _T( "," );
strVmlPath += L",";
strVmlPath += FormatUtils::IntToWideString(m_arPoints[0].y);
++valuePointer;
......@@ -186,9 +186,9 @@ namespace DocFileFormat
}
else
{
strVmlPath += _T( "l" );
strVmlPath += L"l";
strVmlPath += FormatUtils::IntToWideString(m_arPoints[valuePointer].x );
strVmlPath += _T( "," );
strVmlPath += L",";
strVmlPath += FormatUtils::IntToWideString(m_arPoints[valuePointer].y );
++valuePointer;
......@@ -201,17 +201,17 @@ namespace DocFileFormat
{
for (int i = 0; i < iter->Count; ++i)
{
strVmlPath += _T( "c" );
strVmlPath += L"c";
strVmlPath += FormatUtils::IntToWideString(m_arPoints[valuePointer].x );
strVmlPath += _T( "," );
strVmlPath += L",";
strVmlPath += FormatUtils::IntToWideString(m_arPoints[valuePointer].y );
strVmlPath += _T( "," );
strVmlPath += L",";
strVmlPath += FormatUtils::IntToWideString(m_arPoints[valuePointer + 1].x );
strVmlPath += _T( "," );
strVmlPath += L",";
strVmlPath += FormatUtils::IntToWideString(m_arPoints[valuePointer + 1].y );
strVmlPath += _T( "," );
strVmlPath += L",";
strVmlPath += FormatUtils::IntToWideString(m_arPoints[valuePointer + 2].x );
strVmlPath += _T( "," );
strVmlPath += L",";
strVmlPath += FormatUtils::IntToWideString(m_arPoints[valuePointer + 2].y );
valuePointer += 3;
}
......@@ -220,9 +220,9 @@ namespace DocFileFormat
case PathSegment::msopathMoveTo:
{
strVmlPath += _T( "m" );
strVmlPath += L"m";
strVmlPath += FormatUtils::IntToWideString(m_arPoints[valuePointer].x );
strVmlPath += _T( "," );
strVmlPath += L",";
strVmlPath += FormatUtils::IntToWideString(m_arPoints[valuePointer].y );
++valuePointer;
......@@ -231,23 +231,23 @@ namespace DocFileFormat
case PathSegment::msopathClose:
{
strVmlPath += _T( "x" );
strVmlPath += L"x";
}
break;
case PathSegment::msopathEnd:
{
strVmlPath += _T( "e" );
strVmlPath += L"e";
}
break;
case PathSegment::msopathEscape:
{
if (PathSegment::msopathEscapeNoFill == iter->EscapeCode)
strVmlPath += _T( "nf" );
strVmlPath += L"nf";
if (PathSegment::msopathEscapeNoLine == iter->EscapeCode)
strVmlPath += _T( "ns" );
strVmlPath += L"ns";
}
case PathSegment::msopathClientEscape:
case PathSegment::msopathInvalid:
......@@ -266,8 +266,8 @@ namespace DocFileFormat
}
// end the path
if ( !strVmlPath.empty() && ( strVmlPath[strVmlPath.size() - 1] != _T( 'e' ) ) )
strVmlPath += _T("e");
if ( !strVmlPath.empty() && ( strVmlPath[strVmlPath.size() - 1] != L'e' ) )
strVmlPath +=L"e";
return strVmlPath;
}
......
......@@ -65,15 +65,15 @@ namespace DocFileFormat
ole->Program = L"Word.Document";
}
m_pXmlWriter->WriteNodeBegin( _T( "o:OLEObject" ), TRUE );
m_pXmlWriter->WriteNodeBegin( L"o:OLEObject", TRUE );
if ( ole->bLinked )
{
int relID = m_context->_docx->RegisterExternalOLEObject(_caller, ole->ClipboardFormat, ole->Link);
m_pXmlWriter->WriteAttribute( _T( "r:id" ), ( std::wstring( _T( "rId" ) ) + FormatUtils::IntToWideString( relID ) ));
m_pXmlWriter->WriteAttribute( _T( "Type" ), _T( "Link" ) );
m_pXmlWriter->WriteAttribute( _T( "UpdateMode" ), ole->UpdateMode);
m_pXmlWriter->WriteAttribute( L"r:id", ( std::wstring( L"rId" ) + FormatUtils::IntToWideString( relID ) ));
m_pXmlWriter->WriteAttribute( L"Type", L"Link" );
m_pXmlWriter->WriteAttribute( L"UpdateMode", ole->UpdateMode);
}
else
{
......@@ -84,45 +84,45 @@ namespace DocFileFormat
else
relID = m_context->_docx->RegisterOLEObject(_caller, ole->ClipboardFormat);
m_pXmlWriter->WriteAttribute( _T( "r:id" ), ( std::wstring( _T( "rId" ) ) + FormatUtils::IntToWideString( relID ) ));
m_pXmlWriter->WriteAttribute( _T( "Type" ), _T( "Embed" ) );
m_pXmlWriter->WriteAttribute( L"r:id", L"rId"+ FormatUtils::IntToWideString( relID ) );
m_pXmlWriter->WriteAttribute( L"Type", L"Embed" );
copyEmbeddedObject( ole );
}
m_pXmlWriter->WriteAttribute( _T( "ProgID" ), ole->Program);
m_pXmlWriter->WriteAttribute( _T( "ShapeID" ), _shapeId);
m_pXmlWriter->WriteAttribute( _T( "DrawAspect" ), _T( "Content" ) );
m_pXmlWriter->WriteAttribute( _T( "ObjectID" ), ole->ObjectId);
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
m_pXmlWriter->WriteAttribute( L"ProgID", ole->Program);
m_pXmlWriter->WriteAttribute( L"ShapeID", _shapeId);
m_pXmlWriter->WriteAttribute( L"DrawAspect", L"Content" );
m_pXmlWriter->WriteAttribute( L"ObjectID", ole->ObjectId);
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
m_pXmlWriter->WriteNodeEnd( _T( "o:OLEObject" ) );
m_pXmlWriter->WriteNodeEnd( L"o:OLEObject" );
}
}
static std::wstring GetTargetExt(const std::wstring& objectType)
{
std::wstring objectExt = _T( ".bin" );
std::wstring objectExt = L".bin";
if ( objectType == _T( "Biff8" ) )
if ( objectType == L"Biff8" )
{
objectExt = _T( ".xls" );
objectExt = L".xls";
}
else if ( objectType == _T( "MSWordDoc" ) )
else if ( objectType == L"MSWordDoc" )
{
objectExt = _T( ".doc" );
objectExt = L".doc";
}
else if ( objectType == _T( "MSPresentation" ) )
else if ( objectType == L"MSPresentation" )
{
objectExt = _T( ".ppt" );
objectExt = L".ppt";
}
else if ( objectType == _T( "MSWordDocx" ) )
else if ( objectType == L"MSWordDocx" )
{
objectExt = _T( ".docx" );
objectExt = L".docx";
}
else if ( objectType == _T( "Equation" ) )
else if ( objectType == L"Equation" )
{
objectExt = _T( ".xml" );
objectExt = L".xml";
}
return objectExt;
}
......@@ -131,23 +131,23 @@ namespace DocFileFormat
{
std::wstring objectContentType = OpenXmlContentTypes::OleObject;
if ( objectType == _T( "Biff8" ) )
if ( objectType == L"Biff8" )
{
objectContentType = OpenXmlContentTypes::MSExcel;
}
else if ( objectType == _T( "MSWordDoc" ) )
else if ( objectType == L"MSWordDoc" )
{
objectContentType = OpenXmlContentTypes::MSWord;
}
else if ( objectType == _T( "MSPresentation" ) )
else if ( objectType == L"MSPresentation" )
{
objectContentType = OpenXmlContentTypes::MSPowerpoint;
}
else if ( objectType == _T( "MSWordDocx" ) )
else if ( objectType == L"MSWordDocx" )
{
objectContentType = OpenXmlContentTypes::MSWordDocx;
}
else if ( objectType == _T( "Equation" ) )
else if ( objectType == L"Equation" )
{
objectContentType = OpenXmlContentTypes::Xml;
}
......@@ -160,7 +160,7 @@ namespace DocFileFormat
if ( ole != NULL )
{
std::wstring clsid;
std::wstring exelChart = _T( "Excel.Chart" );
std::wstring exelChart = L"Excel.Chart";
if ( std::search( ole->Program.begin(), ole->Program.end(), exelChart.begin(), exelChart.end() ) == ole->Program.end() )
{
......
......@@ -49,7 +49,7 @@ namespace DocFileFormat
{
}
Relationship( const std::wstring& id, const std::wstring& type, const std::wstring& target, const std::wstring& targetMode = _T( "" ) ):
Relationship( const std::wstring& id, const std::wstring& type, const std::wstring& target, const std::wstring& targetMode = L""):
Id( id ), Type( type ), Target( target ), TargetMode( targetMode )
{
}
......@@ -139,18 +139,18 @@ namespace DocFileFormat
const WordDocument* docFile;
int AddHeaderPart( const std::wstring& fileName, const std::wstring& relationshipType = _T( "" ), const std::wstring& targetMode = _T( "" ) );
int AddFooterPart( const std::wstring& fileName, const std::wstring& relationshipType = _T( "" ), const std::wstring& targetMode = _T( "" ) );
int AddFootnotesPart( const std::wstring& fileName, const std::wstring& relationshipType = _T( "" ), const std::wstring& targetMode = _T( "" ) );
int AddEndnotesPart( const std::wstring& fileName, const std::wstring& relationshipType = _T( "" ), const std::wstring& targetMode = _T( "" ) );
int AddCommentsPart( const std::wstring& fileName, const std::wstring& relationshipType = _T( "" ), const std::wstring& targetMode = _T( "" ) );
int AddNumberingPart( const std::wstring& fileName, const std::wstring& relationshipType = _T( "" ), const std::wstring& targetMode = _T( "" ) );
int AddHeaderPart( const std::wstring& fileName, const std::wstring& relationshipType = L"", const std::wstring& targetMode = L"" );
int AddFooterPart( const std::wstring& fileName, const std::wstring& relationshipType = L"", const std::wstring& targetMode = L"" );
int AddFootnotesPart( const std::wstring& fileName, const std::wstring& relationshipType = L"", const std::wstring& targetMode = L"" );
int AddEndnotesPart( const std::wstring& fileName, const std::wstring& relationshipType = L"", const std::wstring& targetMode = L"" );
int AddCommentsPart( const std::wstring& fileName, const std::wstring& relationshipType = L"", const std::wstring& targetMode = L"" );
int AddNumberingPart( const std::wstring& fileName, const std::wstring& relationshipType = L"", const std::wstring& targetMode = L"" );
void WriteRelsFile( const RelationshipsFile& relationshipsFile );
void WriteContentTypesFile( const ContentTypesFile& contentTypesFile );
int AddPart( const std::wstring& packageDir, const std::wstring& fileName, const std::wstring& contentType = _T( "" ), const std::wstring& relationshipType = _T( "" ), const std::wstring& targetMode = _T( "" ) );
int AddPart( const IMapping* mapping, const std::wstring& packageDir, const std::wstring& fileName, const std::wstring& contentType = _T( "" ), const std::wstring& relationshipType = _T( "" ), const std::wstring& targetMode = _T( "" ) );
int AddPart( const std::wstring& packageDir, const std::wstring& fileName, const std::wstring& contentType = L"", const std::wstring& relationshipType = L"", const std::wstring& targetMode = L"" );
int AddPart( const IMapping* mapping, const std::wstring& packageDir, const std::wstring& fileName, const std::wstring& contentType = L"", const std::wstring& relationshipType = L"", const std::wstring& targetMode = L"" );
protected:
......
......@@ -39,100 +39,98 @@
#include "IMapping.h"
#include "../Common/XmlTools.h"
#define WSTD(V) std::wstring(_T(#V))
namespace DocFileFormat
{
static const wchar_t SectionTypeMap[5][11] =
{
_T( "continuous" ),
_T( "nextColumn" ),
_T( "nextPage" ),
_T( "evenPage" ),
_T( "oddPage" )
L"continuous",
L"nextColumn",
L"nextPage",
L"evenPage",
L"oddPage"
};
static const wchar_t PageOrientationMap[3][10] =
{
_T( "0" ),
_T( "portrait" ),
_T( "landscape" )
L"0",
L"portrait",
L"landscape"
};
static const wchar_t DocGridTypeMap[4][14] =
{
_T( "Default" ),
_T( "linesAndChars" ),
_T( "lines" ),
_T( "snapToChars" )
L"Default",
L"linesAndChars",
L"lines",
L"snapToChars"
};
static const wchar_t FootnoteRestartCodeMap[3][11] =
{
_T( "continuous" ),
_T( "eachSect" ),
_T( "eachPage" )
L"continuous",
L"eachSect",
L"eachPage"
};
static const wchar_t EndnoteRestartCodeMap[3][11] =
{
_T( "continuous" ),
_T( "eachSect" ),
_T( "eachPage" )
L"continuous",
L"eachSect",
L"eachPage"
};
static const wchar_t PageNumberFormatCodeMap[42][29] =
{
_T( "Decimal" ),
_T( "upperRoman" ),
_T( "lowerRoman" ),
_T( "upperLetter" ),
_T( "lowerLetter" ),
_T( "ordinal" ),
_T( "cardinalText" ),
_T( "ordinalText" ),
_T( "hex" ),
_T( "chicago" ),
_T( "ideographDigital" ),
_T( "japaneseCounting" ),
_T( "Aiueo" ),
_T( "Iroha" ),
_T( "decimalFullWidth" ),
_T( "decimalHalfWidth" ),
_T( "japaneseLegal" ),
_T( "japaneseDigitalTenThousand" ),
_T( "decimalEnclosedCircle" ),
_T( "decimalFullWidth2" ),
_T( "aiueoFullWidth" ),
_T( "irohaFullWidth" ),
_T( "decimalZero" ),
_T( "bullet" ),
_T( "ganada" ),
_T( "chosung" ),
_T( "decimalEnclosedFullstop" ),
_T( "decimalEnclosedParen" ),
_T( "decimalEnclosedCircleChinese" ),
_T( "ideographEnclosedCircle" ),
_T( "ideographTraditional" ),
_T( "ideographZodiac" ),
_T( "ideographZodiacTraditional" ),
_T( "taiwaneseCounting" ),
_T( "ideographLegalTraditional" ),
_T( "taiwaneseCountingThousand" ),
_T( "taiwaneseDigital" ),
_T( "chineseCounting" ),
_T( "chineseLegalSimplified" ),
_T( "chineseCountingThousand" ),
_T( "Decimal2" ),
_T( "koreanDigital" ),
L"Decimal",
L"upperRoman",
L"lowerRoman",
L"upperLetter",
L"lowerLetter",
L"ordinal",
L"cardinalText",
L"ordinalText",
L"hex",
L"chicago",
L"ideographDigital",
L"japaneseCounting",
L"Aiueo",
L"Iroha",
L"decimalFullWidth",
L"decimalHalfWidth",
L"japaneseLegal",
L"japaneseDigitalTenThousand",
L"decimalEnclosedCircle",
L"decimalFullWidth2",
L"aiueoFullWidth",
L"irohaFullWidth",
L"decimalZero",
L"bullet",
L"ganada",
L"chosung",
L"decimalEnclosedFullstop",
L"decimalEnclosedParen",
L"decimalEnclosedCircleChinese",
L"ideographEnclosedCircle",
L"ideographTraditional",
L"ideographZodiac",
L"ideographZodiacTraditional",
L"taiwaneseCounting",
L"ideographLegalTraditional",
L"taiwaneseCountingThousand",
L"taiwaneseDigital",
L"chineseCounting",
L"chineseLegalSimplified",
L"chineseCountingThousand",
L"Decimal2",
L"koreanDigital",
};
static const wchar_t TextVerticalAlignment[4][7] =
{
_T( "top" ),
_T( "center" ),
_T( "both" ),
_T( "bottom" )
L"top",
L"center",
L"both",
L"bottom"
};
enum SLncOperand
......@@ -144,9 +142,9 @@ namespace DocFileFormat
static const std::wstring LineNumberRestart [] = // ST_LineNumberRestart
{
WSTD (newPage),
WSTD (newSection),
WSTD (continuous)
L"newPage",
L"newSection",
L"continuous"
};
}
......
......@@ -41,17 +41,17 @@ namespace DocFileFormat
{
static const wchar_t FootnotePositionMap[4][12] =
{
_T( "beneathText" ),
_T( "docEnd" ),
_T( "pageBottom" ),
_T( "sectEnd" )
L"beneathText",
L"docEnd",
L"pageBottom",
L"sectEnd"
};
static const wchar_t ZoomTypeMap[3][9] =
{
_T( "none" ),
_T( "fullPage" ),
_T( "bestFit" )
L"none",
L"fullPage",
L"bestFit"
};
class SettingsMapping: public PropertiesMapping, public IMapping
......
......@@ -117,7 +117,7 @@ namespace DocFileFormat
SectionPropertyExceptions* sepxBackup = documentMapping->_lastValidSepx;
//start w:tc
documentMapping->GetXMLWriter()->WriteNodeBegin( _T( "w:tc" ) );
documentMapping->GetXMLWriter()->WriteNodeBegin( L"w:tc" );
//find cell end
int cpCellEnd = documentMapping->findCellEndCp(cp, depth);
......@@ -141,7 +141,7 @@ namespace DocFileFormat
}
//end w:tc
documentMapping->GetXMLWriter()->WriteNodeEnd( _T( "w:tc" ) );
documentMapping->GetXMLWriter()->WriteNodeEnd( L"w:tc" );
}
}
......@@ -526,7 +526,7 @@ namespace DocFileFormat
documentMapping->m_document->FIB->m_bOlderVersion);
//start table
documentMapping->GetXMLWriter()->WriteNodeBegin( _T( "w:tbl" ) );
documentMapping->GetXMLWriter()->WriteNodeBegin( L"w:tbl" );
//Convert it
TablePropertiesMapping tpMapping( documentMapping->GetXMLWriter(), documentMapping->m_document->Styles, grid );
......@@ -542,7 +542,7 @@ namespace DocFileFormat
}
//close w:tbl
documentMapping->GetXMLWriter()->WriteNodeEnd( _T( "w:tbl" ) );
documentMapping->GetXMLWriter()->WriteNodeEnd( L"w:tbl" );
RELEASEOBJECT( grid );
}
......
......@@ -88,21 +88,21 @@ namespace DocFileFormat
//if (m_nTBIndex < m_document->TextboxBreakPlex->Elements.size())
// return;
m_pXmlWriter->WriteNodeBegin(_T("v:textbox"), true);
m_pXmlWriter->WriteNodeBegin(L"v:textbox", true);
if(m_dxTextLeft >= 0 && m_dyTextTop >= 0 && m_dxTextRight >= 0 && m_dyTextBottom >= 0)
{
m_pXmlWriter->WriteAttribute( _T( "inset" ), FormatUtils::DoubleToWideString(m_dxTextLeft) +
_T("pt,") + FormatUtils::DoubleToWideString(m_dyTextTop) +
_T("pt,") + FormatUtils::DoubleToWideString(m_dxTextRight) +
_T("pt,") + FormatUtils::DoubleToWideString(m_dyTextBottom) + _T("pt"));
m_pXmlWriter->WriteAttribute( L"inset" , FormatUtils::DoubleToWideString(m_dxTextLeft) + L"pt," +
FormatUtils::DoubleToWideString(m_dyTextTop) + L"pt," +
FormatUtils::DoubleToWideString(m_dxTextRight) + L"pt," +
FormatUtils::DoubleToWideString(m_dyTextBottom) + L"pt");
}
if (!m_sTextBoxStyle.empty())
{
m_pXmlWriter->WriteAttribute( _T( "style" ), m_sTextBoxStyle);
m_pXmlWriter->WriteAttribute( L"style", m_sTextBoxStyle);
}
m_pXmlWriter->WriteNodeEnd( _T( "" ), true, false );
m_pXmlWriter->WriteNodeEnd( L"", true, false );
m_pXmlWriter->WriteNodeBegin( _T( "w:txbxContent" ) );
m_pXmlWriter->WriteNodeBegin( L"w:txbxContent" );
int cp = 0;
int cpEnd = 0;
......@@ -178,8 +178,8 @@ namespace DocFileFormat
}
_isTextBoxContent = false;
m_pXmlWriter->WriteNodeEnd( _T( "w:txbxContent" ) );
m_pXmlWriter->WriteNodeEnd( _T( "v:textbox" ) );
m_pXmlWriter->WriteNodeEnd( L"w:txbxContent" );
m_pXmlWriter->WriteNodeEnd( L"v:textbox" );
}
}
}
......@@ -133,7 +133,7 @@ namespace ImageHelper
{
oFrame.put_Data((unsigned char*)data + offset);
if (!oFrame.SaveFile(file_name + _T(".png"), 4/*CXIMAGE_FORMAT_PNG*/))
if (!oFrame.SaveFile(file_name + L".png", 4/*CXIMAGE_FORMAT_PNG*/))
result = Global::msoblipERROR;
oFrame.put_Data(NULL);
......@@ -141,7 +141,7 @@ namespace ImageHelper
else if (result == Global::msoblipWMF)
{
NSFile::CFileBinary file;
if (file.CreateFileW(file_name + _T(".wmf")))
if (file.CreateFileW(file_name + L".wmf"))
{
file.WriteFile((BYTE*)data, size);
file.CloseFile();
......@@ -150,7 +150,7 @@ namespace ImageHelper
else if (biSizeImage > 0)
{
NSFile::CFileBinary file;
if (file.CreateFileW(file_name + _T(".bmp")))
if (file.CreateFileW(file_name + L".bmp"))
{
WORD vtType = 0x4D42; file.WriteFile((BYTE*)&vtType, 2);
DWORD dwLen = biSizeImage; file.WriteFile((BYTE*)&dwLen, 4);
......@@ -169,9 +169,9 @@ namespace DocFileFormat
{
WordprocessingDocument::WordprocessingDocument(const std::wstring & _pathOutput, const WordDocument* _docFile) :
OpenXmlPackage( _docFile ),
FontTableXML( _T( "" ) ), DocumentXML( _T( "" ) ),
StyleSheetXML( _T( "" ) ), FootnotesXML ( _T( "" ) ), NumberingXML( _T( "" ) ),
CommentsXML( _T( "" ) ), SettingsXML( _T( "" ) ), CommandTableXML ( _T( "" ) )
FontTableXML( L"" ), DocumentXML( L"" ),
StyleSheetXML( L"" ), FootnotesXML ( L"" ), NumberingXML( L"" ),
CommentsXML( L"" ), SettingsXML( L"" ), CommandTableXML ( L"" )
{
m_strOutputPath = _pathOutput;
}
......@@ -182,8 +182,8 @@ namespace DocFileFormat
void WordprocessingDocument::SaveDocument()
{
std::wstring pathWord = m_strOutputPath + FILE_SEPARATOR_STR + _T( "word" ) ;
//OOX::CPath pathWord = CString(m_strOutputPath) + FILE_SEPARATOR_STR + _T( "word" );
std::wstring pathWord = m_strOutputPath + FILE_SEPARATOR_STR + L"word" ;
//OOX::CPath pathWord = CString(m_strOutputPath) + FILE_SEPARATOR_STR + L"word" );
//FileSystem::Directory::CreateDirectory( pathWord.GetPath() );
NSDirectory::CreateDirectory( pathWord );
......@@ -191,20 +191,20 @@ namespace DocFileFormat
//Write main content. (word directory)
SaveToFile(pathWord, std::wstring( _T("document.xml" ) ), DocumentXML );
SaveToFile(pathWord, std::wstring( _T( "fontTable.xml" ) ), FontTableXML );
SaveToFile(pathWord, std::wstring( _T( "styles.xml" ) ), StyleSheetXML );
SaveToFile(pathWord, std::wstring( _T( "footnotes.xml" ) ), FootnotesXML );
SaveToFile(pathWord, std::wstring( _T( "endnotes.xml" ) ), EndnotesXML );
SaveToFile(pathWord, std::wstring( _T( "numbering.xml" ) ), NumberingXML );
SaveToFile(pathWord, std::wstring( _T( "comments.xml" ) ), CommentsXML );
SaveToFile(pathWord, std::wstring( _T( "settings.xml" ) ), SettingsXML );
SaveToFile(pathWord, std::wstring( _T( "customizations.xml" ) ),CommandTableXML );
SaveToFile(pathWord, std::wstring( L"document.xml" ), DocumentXML );
SaveToFile(pathWord, std::wstring( L"fontTable.xml" ), FontTableXML );
SaveToFile(pathWord, std::wstring( L"styles.xml" ), StyleSheetXML );
SaveToFile(pathWord, std::wstring( L"footnotes.xml" ), FootnotesXML );
SaveToFile(pathWord, std::wstring( L"endnotes.xml" ), EndnotesXML );
SaveToFile(pathWord, std::wstring( L"numbering.xml" ), NumberingXML );
SaveToFile(pathWord, std::wstring( L"comments.xml" ), CommentsXML );
SaveToFile(pathWord, std::wstring( L"settings.xml" ), SettingsXML );
SaveToFile(pathWord, std::wstring( L"customizations.xml" ), CommandTableXML );
if (!ImagesList.empty())
{
std::wstring pathMedia = pathWord + FILE_SEPARATOR_STR + _T( "media" );
//OOX::CPath pathMedia = pathWord + FILE_SEPARATOR_STR + _T( "media" );
std::wstring pathMedia = pathWord + FILE_SEPARATOR_STR + L"media";
//OOX::CPath pathMedia = pathWord + FILE_SEPARATOR_STR + L"media";
//FileSystem::Directory::CreateDirectory( pathMedia.GetPath() );
NSDirectory::CreateDirectory(pathMedia);
......@@ -221,12 +221,12 @@ namespace DocFileFormat
if (Global::msoblipDIB == iter->blipType)
{//user_manual_v52.doc
std::wstring file_name = pathMedia + FILE_SEPARATOR_STR + _T("image") + FormatUtils::IntToWideString(i++);
std::wstring file_name = pathMedia + FILE_SEPARATOR_STR + L"image" + FormatUtils::IntToWideString(i++);
iter->blipType = ImageHelper::SaveImageToFileFromDIB(bytes, iter->data.size(), file_name);
}
else
{
SaveToFile(pathMedia, std::wstring(_T("image" )) + FormatUtils::IntToWideString(i++) + iter->ext, (void*)bytes, (unsigned int)iter->data.size());
SaveToFile(pathMedia, std::wstring(L"image" ) + FormatUtils::IntToWideString(i++) + iter->ext, (void*)bytes, (unsigned int)iter->data.size());
}
RELEASEARRAYOBJECTS(bytes);
......@@ -236,15 +236,15 @@ namespace DocFileFormat
if (!OleObjectsList.empty())
{
std::wstring pathObjects = pathWord + FILE_SEPARATOR_STR + _T( "embeddings") ;
//OOX::CPath pathObjects = pathWord + FILE_SEPARATOR_STR + _T( "embeddings" );
std::wstring pathObjects = pathWord + FILE_SEPARATOR_STR + L"embeddings" ;
//OOX::CPath pathObjects = pathWord + FILE_SEPARATOR_STR + L"embeddings" ;
//FileSystem::Directory::CreateDirectory( pathObjects.GetPath());
NSDirectory::CreateDirectory( pathObjects );
int i = 1;
for (std::list<OleObjectFileStructure>::iterator iter = OleObjectsList.begin(); iter != OleObjectsList.end(); ++iter)
{
std::wstring fileName = pathObjects + FILE_SEPARATOR_STR + _T( "oleObject" ) + FormatUtils::IntToWideString(i++) + iter->ext;
std::wstring fileName = pathObjects + FILE_SEPARATOR_STR + L"oleObject" + FormatUtils::IntToWideString(i++) + iter->ext;
if (!iter->data.empty())
{
......@@ -262,12 +262,12 @@ namespace DocFileFormat
for (std::list<std::wstring>::iterator iter = HeaderXMLList.begin(); iter != HeaderXMLList.end(); ++iter)
{
SaveToFile(pathWord, ( std::wstring( _T( "header" ) ) + FormatUtils::IntToWideString(++headersCount) + std::wstring( _T( ".xml" ) ) ), *iter);
SaveToFile(pathWord, ( std::wstring( L"header" ) + FormatUtils::IntToWideString(++headersCount) + std::wstring( L".xml" ) ), *iter);
}
for (std::list<std::wstring>::iterator iter = FooterXMLList.begin(); iter != FooterXMLList.end(); ++iter)
{
SaveToFile(pathWord, ( std::wstring( _T( "footer" ) ) + FormatUtils::IntToWideString(++footersCount) + std::wstring( _T( ".xml" ) ) ), *iter);
SaveToFile(pathWord, ( std::wstring( L"footer" ) + FormatUtils::IntToWideString(++footersCount) + std::wstring( L".xml" ) ), *iter);
}
}
}
......@@ -1455,7 +1455,7 @@ public:
bool bDQuot = false;
for(int i = 0, length = fld.length(); i < length; ++i)
{
TCHAR sCurLetter = fld[i];
wchar_t sCurLetter = fld[i];
if('\"' == sCurLetter)
bDQuot = !bDQuot;
else if('\\' == sCurLetter && true == bDQuot && i + 1 < length && '\"' == fld[i + 1])
......@@ -1710,7 +1710,7 @@ public:
int nPrevIndex = 0;
for(int i = 0, length = sText.length(); i < length; i++)
{
TCHAR cToken = sText[i];
wchar_t cToken = sText[i];
if('\n' == cToken)
{
bFirst = writeContentWritePart(pComment, sText, nPrevIndex, i, bFirst, sRes);
......
......@@ -261,7 +261,7 @@ bool BinDocxRW::CDocxSerializer::loadFromFile(const std::wstring& sSrcFileName,
int nDataSize = atoi(dst_len.c_str());
BYTE* pData = new BYTE[nDataSize];
if(false != Base64::Base64Decode((LPCSTR)(pBase64Data + nIndex), nBase64DataSize - nIndex, pData, &nDataSize))
if(false != Base64::Base64Decode((const char*)(pBase64Data + nIndex), nBase64DataSize - nIndex, pData, &nDataSize))
{
NSBinPptxRW::CDrawingConverter oDrawingConverter;
NSBinPptxRW::CBinaryFileReader& oBufferedStream = *oDrawingConverter.m_pReader;
......
......@@ -29,16 +29,14 @@
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
//#include "stdafx.h"
#include "FontProcessor.h"
#include "../../Common/DocxFormat/Source/XlsxFormat/Xlsx.h"
#include "../../Common/DocxFormat/Source/DocxFormat/Docx.h"
#include "../../Common/ASCUtils.h"
namespace DocWrapper {
TCHAR* gc_sNoNameFont = _T("NoNameFont");
TCHAR* gc_sDefaultFontName = _T("Arial");
wchar_t* gc_sNoNameFont = _T("NoNameFont");
wchar_t* gc_sDefaultFontName = _T("Arial");
FontProcessor::FontProcessor() : m_pFontManager(NULL)
{
......
......@@ -75,7 +75,7 @@ namespace NSPresentationEditor
return DownloadImage(strInput);
std::wstring strExts = _T(".jpg");
int nIndexExt = strInput.rfind(TCHAR('.'));
int nIndexExt = strInput.rfind(wchar_t('.'));
if (-1 != nIndexExt)
strExts = strInput.substr(nIndexExt);
......
......@@ -953,8 +953,8 @@ void NSPresentationEditor::CShapeWriter::WriteTextInfo()
NSPresentationEditor::CTextCFRun* pCF = &pParagraph->m_arSpans[nSpan].m_oRun;
int span_sz = pParagraph->m_arSpans[nSpan].m_strText.length() ;
if ((span_sz==1 && ( pParagraph->m_arSpans[nSpan].m_strText[0] == (TCHAR)13 )) ||
((span_sz==2 && ( pParagraph->m_arSpans[nSpan].m_strText[0] == (TCHAR)13 ) && ( pParagraph->m_arSpans[nSpan].m_strText[1] == (TCHAR)13 ))))
if ((span_sz==1 && ( pParagraph->m_arSpans[nSpan].m_strText[0] == (wchar_t)13 )) ||
((span_sz==2 && ( pParagraph->m_arSpans[nSpan].m_strText[0] == (wchar_t)13 ) && ( pParagraph->m_arSpans[nSpan].m_strText[1] == (wchar_t)13 ))))
{
continue;
}
......
......@@ -1869,7 +1869,7 @@ public:
AVSINLINE std::wstring GetFileName(std::wstring strFilePath)
{
int nIndex = strFilePath.rfind(TCHAR('\\'));
int nIndex = strFilePath.rfind(wchar_t('\\'));
if (-1 != nIndex)
{
return strFilePath.substr(nIndex + 1);
......
......@@ -84,7 +84,7 @@ namespace PPTX
{
public:
std::vector<std::wstring> m_arParams;
TCHAR m_Separator;
wchar_t m_Separator;
public:
CStringTrimmer();
......
......@@ -164,7 +164,7 @@ namespace NSBinPptxRW
{
if(nIndex1 + sFind1.length() < strInput.length())
{
TCHAR cRes = strInput[nIndex1 + sFind1.length()];
wchar_t cRes = strInput[nIndex1 + sFind1.length()];
if('1' <= cRes && cRes <= '6')
{
int nImageIndex = nIndex1 + sFind1.length() + 1;
......@@ -187,7 +187,7 @@ namespace NSBinPptxRW
return pPair->second;
std::wstring strExts = _T(".jpg");
int nIndexExt = strInput.rfind(TCHAR('.'));
int nIndexExt = strInput.rfind(wchar_t('.'));
if (-1 != nIndexExt)
strExts = strInput.substr(nIndexExt);
......@@ -356,7 +356,7 @@ namespace NSBinPptxRW
return pPair->second;
std::wstring strExts = _T(".jpg");
int nIndexExt = strUrl.rfind(TCHAR('.'));
int nIndexExt = strUrl.rfind(wchar_t('.'));
if (-1 != nIndexExt)
strExts = strUrl.substr(nIndexExt);
......
......@@ -63,11 +63,11 @@ namespace NSStringUtils
#define IS_ALPHA(c) (((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z')))
#define IS_DIGIT(c) (((c >= '0') && (c <= '9')) || (c == '-'))
static bool IsDigit(const TCHAR& c)
static bool IsDigit(const wchar_t& c)
{
return (((c >= '0') && (c <= '9')) || (c == '-'));
}
static bool IsAlpha(const TCHAR& c)
static bool IsAlpha(const wchar_t& c)
{
return (((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z')));
}
......@@ -213,29 +213,29 @@ namespace NSStringUtils
std::wstring strPath = strSource;
int nLength = strPath.length();
//strPath.Replace(_T(" "), _T(","));
if (strPath.find(TCHAR('h')) != -1)
if (strPath.find(wchar_t('h')) != -1)
{
TCHAR* pBuff = new TCHAR[nLength + 1];
wchar_t* pBuff = new wchar_t[nLength + 1];
int nCur = 0;
for (int i = 1; i < nLength; ++i)
{
TCHAR _c = strPath[i - 1];
if (_c != TCHAR('h'))
wchar_t _c = strPath[i - 1];
if (_c != wchar_t('h'))
{
pBuff[nCur++] = _c;
}
else
{
TCHAR _c1 = strPath[i];
if (_c1 == TCHAR('a') ||
_c1 == TCHAR('b') ||
_c1 == TCHAR('c') ||
_c1 == TCHAR('d') ||
_c1 == TCHAR('e') ||
_c1 == TCHAR('f') ||
_c1 == TCHAR('g') ||
_c1 == TCHAR('h') ||
_c1 == TCHAR('i'))
wchar_t _c1 = strPath[i];
if (_c1 == wchar_t('a') ||
_c1 == wchar_t('b') ||
_c1 == wchar_t('c') ||
_c1 == wchar_t('d') ||
_c1 == wchar_t('e') ||
_c1 == wchar_t('f') ||
_c1 == wchar_t('g') ||
_c1 == wchar_t('h') ||
_c1 == wchar_t('i'))
{
++i;
}
......@@ -257,7 +257,7 @@ namespace NSStringUtils
}
}
if (nLength > 0 && strPath[nLength - 1] == TCHAR(','))
if (nLength > 0 && strPath[nLength - 1] == wchar_t(','))
{
strPath += _T("0");
++nLength;
......@@ -272,8 +272,8 @@ namespace NSStringUtils
//continue;
}
TCHAR _c = strPath[nIndex];
TCHAR _c1 = strPath[nIndex + 1];
wchar_t _c = strPath[nIndex];
wchar_t _c1 = strPath[nIndex + 1];
if (_c1 == ',')
{
......
......@@ -67,7 +67,7 @@ namespace NSGuidesVML
};
#define VML_GUIDE_COUNT 18
const LPWSTR VML_GUIDE_TYPE[VML_GUIDE_COUNT] = {
static const wchar_t* VML_GUIDE_TYPE[VML_GUIDE_COUNT] = {
L"sum",
L"prod",
L"mid",
......
......@@ -286,11 +286,11 @@ public:
virtual bool LoadAdjustValuesList(const std::wstring& xml)
{
std::wstring strXml = xml;
if (0 == strXml.find((TCHAR)','))
if (0 == strXml.find((wchar_t)','))
strXml = (_T("defaultAdj") + strXml);
LONG lLastIndex = strXml.length() - 1;
if (lLastIndex >= 0 && lLastIndex == strXml.rfind((TCHAR)','))
if (lLastIndex >= 0 && lLastIndex == strXml.rfind((wchar_t)','))
{
strXml = strXml + _T("defaultAdj");
}
......@@ -596,7 +596,7 @@ protected:
if (str.length() == 0)
return false;
TCHAR mem = str[0];
wchar_t mem = str[0];
bool bFormula = false;
if ('@' == mem)
......
......@@ -45,7 +45,7 @@ namespace NSPresentationEditor
int lCountCFs = m_arParagraphs[i].m_arSpans.size();
int s_size = m_arParagraphs[i].m_arSpans[j].m_strText.length();
int lFoundEnter = m_arParagraphs[i].m_arSpans[j].m_strText.find((TCHAR)13);
int lFoundEnter = m_arParagraphs[i].m_arSpans[j].m_strText.find((wchar_t)13);
if( !split_paragraph && lFoundEnter >= 0 && (s_size > 1 || (s_size == 1 && m_arParagraphs[i].m_arSpans.size() > 1)))
{
......@@ -73,7 +73,7 @@ namespace NSPresentationEditor
m_arParagraphs.insert(m_arParagraphs.begin() +i + 1, oNewPar);
}
int lFoundBreak = m_arParagraphs[i].m_arSpans[j].m_strText.find((TCHAR)11);
int lFoundBreak = m_arParagraphs[i].m_arSpans[j].m_strText.find((wchar_t)11);
if( lFoundBreak >= 0)
{
// разбиваем span
......
......@@ -848,7 +848,7 @@ namespace NSPresentationEditor
size_t nCountS = m_arSpans.size();
for (size_t i = 0; i < nCountS; ++i)
{
std::replace( m_arSpans[i].m_strText.begin(), m_arSpans[i].m_strText.end(), (TCHAR)(11), (TCHAR)(13));
std::replace( m_arSpans[i].m_strText.begin(), m_arSpans[i].m_strText.end(), (wchar_t)(11), (wchar_t)(13));
}
}
AVSINLINE bool IsEmpty()
......@@ -861,7 +861,7 @@ namespace NSPresentationEditor
if (nLen > 1)
return false;
if ((nLen == 1) && ((TCHAR)(13) != m_arSpans[i].m_strText[0]))
if ((nLen == 1) && ((wchar_t)(13) != m_arSpans[i].m_strText[0]))
return false;
}
return true;
......
......@@ -44,7 +44,7 @@ namespace PPTX
std::wstring m_strLink;
public:
Namespace(LPCWSTR sName, LPCWSTR sLink) : m_strName(sName), m_strLink(sLink)
Namespace(const wchar_t* sName, const wchar_t* sLink) : m_strName(sName), m_strLink(sLink)
{
}
};
......
......@@ -54,7 +54,7 @@ namespace PPTX
nullable_string sTmp;
node.ReadAttributeBase(L"val", sTmp);
if (val.is_init() && sTmp.is_init() && sTmp->find(TCHAR('%')) != -1)
if (val.is_init() && sTmp.is_init() && sTmp->find(wchar_t('%')) != -1)
*val = (*val) * 1000;
}
}
......
......@@ -36,7 +36,6 @@
#include "RunBase.h"
#include "./../RunProperties.h"
#include "./../TextParagraphPr.h"
//#include "../../../../Common/DocxFormat/Source/Utility/Encoding.h"
namespace PPTX
{
......
......@@ -35,7 +35,6 @@
#include "RunBase.h"
#include "./../RunProperties.h"
//#include "../../../../Common/DocxFormat/Source/Utility/Encoding.h"
namespace PPTX
{
......
......@@ -43,7 +43,6 @@
#include "UniFill.h"
#include "Ln.h"
//#include "../../../Common/DocxFormat/Source/Utility/Encoding.h"
#include "../../../ASCOfficeDocxFile2/DocWrapper/DocxSerializer.h"
namespace PPTX
......
......@@ -239,13 +239,13 @@ xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\"
oXlsxSerializer.setDrawingConverter(&oDrawingConverter);
std::wstring strDstChart = pReader->m_pRels->m_pManager->GetDstMedia();
int nPos = strDstChart.rfind(TCHAR('m'));
int nPos = strDstChart.rfind(wchar_t('m'));
if (-1 != nPos)
strDstChart = strDstChart.substr(0, nPos);
strDstChart += L"charts";
//на всякий случай всегда создаем, нет уверенности что 1 == m_lChartNumber для первого chart
NSDirectory::CreateDirectoryW(strDstChart);
NSDirectory::CreateDirectory(strDstChart);
std::wstring* sContentTypes = NULL;
......
......@@ -73,7 +73,7 @@ namespace PPTX
if (sFontScale.is_init())
{
int nFound = sFontScale->rfind(TCHAR('%'));
int nFound = sFontScale->rfind(wchar_t('%'));
if (nFound < 0)
fontScale = *sFontScale;
else
......@@ -87,7 +87,7 @@ namespace PPTX
if (sLnSpcRed.is_init())
{
int nFound = sLnSpcRed->rfind(TCHAR('%'));
int nFound = sLnSpcRed->rfind(wchar_t('%'));
if (nFound < 0)
lnSpcReduction = *sLnSpcRed;
else
......@@ -123,7 +123,7 @@ namespace PPTX
if (sFontScale.is_init())
{
int nFound = sFontScale->rfind(TCHAR('%'));
int nFound = sFontScale->rfind(wchar_t('%'));
if (nFound < 0)
fontScale = *sFontScale;
else
......@@ -137,7 +137,7 @@ namespace PPTX
if (sLnSpcRed.is_init())
{
int nFound = sLnSpcRed->rfind(TCHAR('%'));
int nFound = sLnSpcRed->rfind(wchar_t('%'));
if (nFound < 0)
lnSpcReduction = *sLnSpcRed;
else
......
......@@ -68,7 +68,7 @@
namespace Strings
{
static int ToDigit(TCHAR c)
static int ToDigit(wchar_t c)
{
if (c >= '0' && c <= '9')
return (int)(c - '0');
......@@ -618,7 +618,7 @@ public:
if (file.CreateFile(sFilename) != S_OK) return;
TCHAR * buf = (TCHAR *)sData.c_str();
wchar_t * buf = (wchar_t *)sData.c_str();
int nLengthText = sData.length();
int nLengthData = nLengthText/2;
BYTE * buf2 = new BYTE[ nLengthData];
......@@ -636,7 +636,7 @@ public:
}
static void WriteDataToBinary( std::wstring sData, BYTE** ppData, long& nSize)
{
TCHAR * buf = (TCHAR *)sData.c_str();
wchar_t * buf = (wchar_t *)sData.c_str();
int nLengthText = sData.length();
nSize = nLengthText/2;
BYTE * buf2 = new BYTE[ nSize];
......@@ -672,7 +672,7 @@ public:
}
return sText;
}
static BYTE ToByte( TCHAR cChar )
static BYTE ToByte( wchar_t cChar )
{
return (BYTE)(cChar > 'F' ? cChar - 0x57 : cChar > '9' ? cChar - 0x37 : cChar - 0x30);
}
......@@ -788,7 +788,7 @@ public:
size_t nconv = 0, avail = (insize) * sizeof(wchar_t);
wchar_t *out = new wchar_t[insize];
nconv = iconv (ic, &inptr, &insize, &out, &avail);
nconv = iconv (ic, &inptr, &insize, (char**)&out, &avail);
if (nconv == 0)
{
w_out = std::wstring(out);
......
This diff is collapsed.
......@@ -74,7 +74,6 @@ SOURCES += \
SOURCES += docxformatlib.cpp \
../Source/XML/libxml2/libxml2.cpp \
../Source/Utility/codecvt.cpp \
../Source/Utility/DateTime.cpp \
../Source/Utility/TxtFile.cpp \
......@@ -91,7 +90,6 @@ HEADERS += docxformatlib.h \
../Source/Common/Color.h \
../Source/Common/Common.h \
../Source/Common/ComplexTypes.h \
../Source/Common/Encoding.h \
../Source/Common/Index.h \
../Source/Common/NumFormat.h \
../Source/Common/Point.h \
......@@ -259,7 +257,6 @@ HEADERS += docxformatlib.h \
../Source/XlsxFormat/Workbook.h \
../Source/XlsxFormat/WritingElement.h \
../Source/XlsxFormat/Xlsx.h \
../Source/XML/libxml2/libxml2.h \
../Source/XML/StringWriter.h \
../Source/XML/Utils.h \
../Source/XML/XmlSimple.h \
......
......@@ -32,15 +32,20 @@
#pragma once
#include <string>
#include <stdlib.h>
#include <string.h>
#include <TCHAR.H>
#include <WTYPES.H>
#include "unicode_util.h"
#include "../../../DesktopEditor/common/File.h"
#define _T(x) __T(x)
#define __T(x) L##x
#if defined(_WIN32) || defined (_WIN64)
#include <WTYPES.H>
// windows-stype separator for paths i.e. 'c:\home\documents\file.ext'
#ifndef FILE_SEPARATOR
#define FILE_SEPARATOR
#define FILE_SEPARATOR_CHAR '\\'
......@@ -57,10 +62,8 @@
#define FILE_SEPARATOR_STR _T("/")
#endif
#ifndef _wtof
#define _wtof std::stod
//#define _wtoi std::stoi
#define _wtoi64(p) std::wcstoll((p),NULL,10)
static int _wtoi(std::wstring sVal)
......
This diff is collapsed.
......@@ -115,7 +115,7 @@ namespace OOX
#if defined(_WIN32) || defined (_WIN64)
CreateDirectoryW( oFilePath.GetPath().c_str(), NULL );
#else
std::string sFileParthUtf8 = stringWstingToUtf8String (oFilePath.GetPath());
std::string sFileParthUtf8 = NSFile::CUtf8Converter::GetUtf8StringFromUnicode(oFilePath.GetPath());
mkdir (sFileParthUtf8.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
#endif
......
......@@ -36,7 +36,6 @@
#include "../../Base/Nullable.h"
#include "../../Common/SimpleTypes_Drawing.h"
#include "../../Common/SimpleTypes_Shared.h"
#include "../../Common/Encoding.h"
#include "../WritingElement.h"
#include "../RId.h"
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment