Commit 0770d113 authored by Alexey.Musinov's avatar Alexey.Musinov

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

* 'develop' of https://github.com/ONLYOFFICE/core:
  _T"" -> L""
  fix bug 33326
  OdfFormat..
  remove base.h dependency
  fix bug 33323
  bug with disable hinting after first symbol
parents 7eb4f5d0 f9795a5d
...@@ -49,9 +49,9 @@ namespace DocFileFormat ...@@ -49,9 +49,9 @@ namespace DocFileFormat
_brcRight = NULL; _brcRight = NULL;
_brcBottom = NULL; _brcBottom = NULL;
_tcPr = new XMLTools::XMLElement<wchar_t>(_T("w:tcPr")); _tcPr = new XMLTools::XMLElement<wchar_t>(L"w:tcPr");
_tcMar = new XMLTools::XMLElement<wchar_t>(_T("w:tcMar")); _tcMar = new XMLTools::XMLElement<wchar_t>(L"w:tcMar");
_tcBorders = new XMLTools::XMLElement<wchar_t>(_T("w:tcBorders")); _tcBorders = new XMLTools::XMLElement<wchar_t>(L"w:tcBorders");
_ftsWidth = Global::nil; _ftsWidth = Global::nil;
} }
...@@ -89,27 +89,27 @@ namespace DocFileFormat ...@@ -89,27 +89,27 @@ namespace DocFileFormat
_tGrid = tdef.rgdxaCenter; _tGrid = tdef.rgdxaCenter;
_tcDef = tdef.rgTc80[(std::min)(_cellIndex, (int)tdef.rgTc80.size() - 1)]; // NOTE: fix for crash _tcDef = tdef.rgTc80[(std::min)(_cellIndex, (int)tdef.rgTc80.size() - 1)]; // NOTE: fix for crash
appendValueElement( _tcPr, _T( "textDirection" ), FormatUtils::MapValueToWideString( _tcDef.textFlow, &Global::TextFlowMap[0][0], 6, 6 ).c_str(), false ); appendValueElement( _tcPr, L"textDirection", FormatUtils::MapValueToWideString( _tcDef.textFlow, &Global::TextFlowMap[0][0], 6, 6 ).c_str(), false );
if ( _tcDef.vertMerge == Global::fvmMerge ) if ( _tcDef.vertMerge == Global::fvmMerge )
{ {
appendValueElement( _tcPr, _T( "vMerge" ), _T( "continue" ), false ); appendValueElement( _tcPr, L"vMerge", L"continue", false );
} }
else if ( _tcDef.vertMerge == Global::fvmRestart ) else if ( _tcDef.vertMerge == Global::fvmRestart )
{ {
appendValueElement( _tcPr, _T( "vMerge" ), _T( "restart" ), false ); appendValueElement( _tcPr, L"vMerge", L"restart", false );
} }
appendValueElement( _tcPr, _T( "vAlign" ), FormatUtils::MapValueToWideString( _tcDef.vertAlign, &Global::VerticalAlignMap[0][0], 3, 7 ).c_str(), false ); appendValueElement( _tcPr, L"vAlign", FormatUtils::MapValueToWideString( _tcDef.vertAlign, &Global::VerticalAlignMap[0][0], 3, 7 ).c_str(), false );
if ( _tcDef.fFitText ) if ( _tcDef.fFitText )
{ {
appendValueElement( _tcPr, _T( "tcFitText" ), _T( "" ), false ); appendValueElement( _tcPr, L"tcFitText", L"", false );
} }
if ( _tcDef.fNoWrap ) if ( _tcDef.fNoWrap )
{ {
appendValueElement( _tcPr, _T( "noWrap" ), _T( "" ), true ); appendValueElement( _tcPr, L"noWrap", L"", true );
} }
nComputedCellWidth = (short)( tdef.rgdxaCenter[(size_t)(std::min)(_cellIndex, (int)tdef.rgTc80.size() - 1) + 1] - nComputedCellWidth = (short)( tdef.rgdxaCenter[(size_t)(std::min)(_cellIndex, (int)tdef.rgTc80.size() - 1) + 1] -
...@@ -145,22 +145,22 @@ namespace DocFileFormat ...@@ -145,22 +145,22 @@ namespace DocFileFormat
{ {
if ( FormatUtils::GetBitFromInt( iter->Arguments[2], 0 ) == true ) if ( FormatUtils::GetBitFromInt( iter->Arguments[2], 0 ) == true )
{ {
appendDxaElement( _tcMar, _T( "top" ), FormatUtils::IntToWideString( wMargin ).c_str(), true ); appendDxaElement( _tcMar, L"top", FormatUtils::IntToWideString( wMargin ).c_str(), true );
} }
if ( FormatUtils::GetBitFromInt( iter->Arguments[2], 1 ) == true ) if ( FormatUtils::GetBitFromInt( iter->Arguments[2], 1 ) == true )
{ {
appendDxaElement( _tcMar, _T( "left" ), FormatUtils::IntToWideString( wMargin ).c_str(), true ); appendDxaElement( _tcMar, L"left", FormatUtils::IntToWideString( wMargin ).c_str(), true );
} }
if ( FormatUtils::GetBitFromInt( iter->Arguments[2], 2 ) == true ) if ( FormatUtils::GetBitFromInt( iter->Arguments[2], 2 ) == true )
{ {
appendDxaElement( _tcMar, _T( "bottom" ), FormatUtils::IntToWideString( wMargin ).c_str(), true ); appendDxaElement( _tcMar, L"bottom", FormatUtils::IntToWideString( wMargin ).c_str(), true );
} }
if ( FormatUtils::GetBitFromInt( iter->Arguments[2], 3 ) == true ) if ( FormatUtils::GetBitFromInt( iter->Arguments[2], 3 ) == true )
{ {
appendDxaElement( _tcMar, _T( "right" ), FormatUtils::IntToWideString( wMargin ).c_str(), true ); appendDxaElement( _tcMar, L"right", FormatUtils::IntToWideString( wMargin ).c_str(), true );
} }
} }
} }
...@@ -210,7 +210,7 @@ namespace DocFileFormat ...@@ -210,7 +210,7 @@ namespace DocFileFormat
if ((_cellIndex >= first) && (_cellIndex < lim)) if ((_cellIndex >= first) && (_cellIndex < lim))
{ {
appendValueElement(_tcPr, _T( "vAlign" ), FormatUtils::MapValueToWideString( (VerticalCellAlignment)iter->Arguments[2], &VerticalCellAlignmentMap[0][0], 3, 7 ).c_str(), true ); appendValueElement(_tcPr, L"vAlign", FormatUtils::MapValueToWideString( (VerticalCellAlignment)iter->Arguments[2], &VerticalCellAlignmentMap[0][0], 3, 7 ).c_str(), true );
} }
} }
break; break;
...@@ -222,7 +222,7 @@ namespace DocFileFormat ...@@ -222,7 +222,7 @@ namespace DocFileFormat
if ( ( _cellIndex >= first ) && ( _cellIndex < lim ) ) if ( ( _cellIndex >= first ) && ( _cellIndex < lim ) )
{ {
appendValueElement( _tcPr, _T( "tcFitText" ), FormatUtils::IntToWideString( iter->Arguments[2] ).c_str(), true ); appendValueElement( _tcPr, L"tcFitText", FormatUtils::IntToWideString( iter->Arguments[2] ).c_str(), true );
} }
} }
break; break;
...@@ -271,9 +271,9 @@ namespace DocFileFormat ...@@ -271,9 +271,9 @@ namespace DocFileFormat
} }
//width //width
XMLTools::XMLElement<wchar_t> tcW( _T( "w:tcW" ) ); XMLTools::XMLElement<wchar_t> tcW( L"w:tcW" );
XMLTools::XMLAttribute<wchar_t> tcWType( _T( "w:type" ), FormatUtils::MapValueToWideString( _ftsWidth, &Global::CellWidthTypeMap[0][0], 4, 5 ).c_str() ); XMLTools::XMLAttribute<wchar_t> tcWType( L"w:type", FormatUtils::MapValueToWideString( _ftsWidth, &Global::CellWidthTypeMap[0][0], 4, 5 ).c_str() );
XMLTools::XMLAttribute<wchar_t> tcWVal( _T( "w:w" ), FormatUtils::IntToWideString( _width ).c_str() ); XMLTools::XMLAttribute<wchar_t> tcWVal( L"w:w", FormatUtils::IntToWideString( _width ).c_str() );
tcW.AppendAttribute( tcWType ); tcW.AppendAttribute( tcWType );
tcW.AppendAttribute( tcWVal ); tcW.AppendAttribute( tcWVal );
_tcPr->AppendChild( tcW ); _tcPr->AppendChild( tcW );
...@@ -298,7 +298,7 @@ namespace DocFileFormat ...@@ -298,7 +298,7 @@ namespace DocFileFormat
} }
} }
appendValueElement( _tcPr, _T( "gridSpan" ), FormatUtils::IntToWideString( _gridSpan ).c_str(), true ); appendValueElement( _tcPr, L"gridSpan", FormatUtils::IntToWideString( _gridSpan ).c_str(), true );
} }
//append margins //append margins
...@@ -310,28 +310,28 @@ namespace DocFileFormat ...@@ -310,28 +310,28 @@ namespace DocFileFormat
//append borders //append borders
if (_brcTop) if (_brcTop)
{ {
XMLTools::XMLElement<wchar_t> topBorder(_T("w:top")); XMLTools::XMLElement<wchar_t> topBorder( L"w:top" );
appendBorderAttributes(_brcTop, &topBorder); appendBorderAttributes(_brcTop, &topBorder);
addOrSetBorder(_tcBorders, &topBorder ); addOrSetBorder(_tcBorders, &topBorder );
} }
if (_brcLeft ) if (_brcLeft )
{ {
XMLTools::XMLElement<wchar_t> leftBorder(_T("w:left")); XMLTools::XMLElement<wchar_t> leftBorder( L"w:left" );
appendBorderAttributes(_brcLeft, &leftBorder); appendBorderAttributes(_brcLeft, &leftBorder);
addOrSetBorder(_tcBorders, &leftBorder); addOrSetBorder(_tcBorders, &leftBorder);
} }
if (_brcBottom) if (_brcBottom)
{ {
XMLTools::XMLElement<wchar_t> bottomBorder(_T("w:bottom")); XMLTools::XMLElement<wchar_t> bottomBorder( L"w:bottom" );
appendBorderAttributes(_brcBottom, &bottomBorder); appendBorderAttributes(_brcBottom, &bottomBorder);
addOrSetBorder(_tcBorders, &bottomBorder); addOrSetBorder(_tcBorders, &bottomBorder);
} }
if (_brcRight) if (_brcRight)
{ {
XMLTools::XMLElement<wchar_t> rightBorder( _T( "w:right" ) ); XMLTools::XMLElement<wchar_t> rightBorder( L"w:right" );
appendBorderAttributes( _brcRight, &rightBorder ); appendBorderAttributes( _brcRight, &rightBorder );
addOrSetBorder( _tcBorders, &rightBorder ); addOrSetBorder( _tcBorders, &rightBorder );
} }
......
...@@ -48,9 +48,9 @@ namespace DocFileFormat ...@@ -48,9 +48,9 @@ namespace DocFileFormat
static const wchar_t VerticalCellAlignmentMap[3][7] = static const wchar_t VerticalCellAlignmentMap[3][7] =
{ {
_T( "top" ), L"top",
_T( "center" ), L"center",
_T( "bottom" ) L"bottom"
}; };
class TableCellPropertiesMapping : public PropertiesMapping, public IMapping class TableCellPropertiesMapping : public PropertiesMapping, public IMapping
...@@ -96,4 +96,4 @@ namespace DocFileFormat ...@@ -96,4 +96,4 @@ namespace DocFileFormat
/// The grind span of this cell /// The grind span of this cell
int _gridSpan; int _gridSpan;
}; };
} }
\ No newline at end of file
...@@ -44,10 +44,10 @@ namespace DocFileFormat ...@@ -44,10 +44,10 @@ namespace DocFileFormat
{ {
static const wchar_t WidthType[4][5] = static const wchar_t WidthType[4][5] =
{ {
_T( "nil" ), L"nil",
_T( "auto" ), L"auto",
_T( "pct" ), L"pct",
_T( "dxa" ) L"dxa"
}; };
struct FtsWWidth_Indent struct FtsWWidth_Indent
......
...@@ -37,9 +37,9 @@ namespace DocFileFormat ...@@ -37,9 +37,9 @@ namespace DocFileFormat
{ {
TableRowPropertiesMapping::TableRowPropertiesMapping (XMLTools::CStringXmlWriter* pWriter, CharacterPropertyExceptions* rowEndChpx) : PropertiesMapping(pWriter), _trPr(NULL), _tblPrEx(NULL), _rowEndChpx(NULL) TableRowPropertiesMapping::TableRowPropertiesMapping (XMLTools::CStringXmlWriter* pWriter, CharacterPropertyExceptions* rowEndChpx) : PropertiesMapping(pWriter), _trPr(NULL), _tblPrEx(NULL), _rowEndChpx(NULL)
{ {
_trPr = new XMLTools::XMLElement<wchar_t>(_T( "w:trPr")); _trPr = new XMLTools::XMLElement<wchar_t>(L"w:trPr");
_tblPrEx = new XMLTools::XMLElement<wchar_t>(_T( "w:tblPrEx")); _tblPrEx = new XMLTools::XMLElement<wchar_t>(L"w:tblPrEx");
//_tblBorders = new XMLTools::XMLElement<wchar_t>(_T( "w:tblBorders")); //_tblBorders = new XMLTools::XMLElement<wchar_t>(L"w:tblBorders");
_rowEndChpx = rowEndChpx; _rowEndChpx = rowEndChpx;
} }
...@@ -58,7 +58,7 @@ namespace DocFileFormat ...@@ -58,7 +58,7 @@ namespace DocFileFormat
if ( ( _rowEndChpx != NULL ) && ( rev.Type == Deleted ) ) if ( ( _rowEndChpx != NULL ) && ( rev.Type == Deleted ) )
{ {
XMLTools::XMLElement<wchar_t> del( _T( "w:del" ) ); XMLTools::XMLElement<wchar_t> del( L"w:del" );
_trPr->AppendChild( del ); _trPr->AppendChild( del );
} }
...@@ -81,7 +81,7 @@ namespace DocFileFormat ...@@ -81,7 +81,7 @@ namespace DocFileFormat
if ( fHeader ) if ( fHeader )
{ {
XMLTools::XMLElement<wchar_t> header( _T( "w:tblHeader" ) ); XMLTools::XMLElement<wchar_t> header( L"w:tblHeader" );
_trPr->AppendChild( header ); _trPr->AppendChild( header );
} }
} }
...@@ -89,11 +89,11 @@ namespace DocFileFormat ...@@ -89,11 +89,11 @@ namespace DocFileFormat
case sprmTWidthAfter: case sprmTWidthAfter:
{ //width after { //width after
XMLTools::XMLElement<wchar_t> wAfter( _T( "w:wAfter" ) ); XMLTools::XMLElement<wchar_t> wAfter( L"w:wAfter" );
XMLTools::XMLAttribute<wchar_t> wAfterValue( _T( "w:w" ), FormatUtils::IntToWideString( FormatUtils::BytesToInt16( iter->Arguments, 1, iter->argumentsSize ) ).c_str() ); XMLTools::XMLAttribute<wchar_t> wAfterValue( L"w:w", FormatUtils::IntToWideString( FormatUtils::BytesToInt16( iter->Arguments, 1, iter->argumentsSize ) ).c_str() );
wAfter.AppendAttribute( wAfterValue ); wAfter.AppendAttribute( wAfterValue );
XMLTools::XMLAttribute<wchar_t> wAfterType( _T( "w:type" ), _T( "dxa" ) ); XMLTools::XMLAttribute<wchar_t> wAfterType( L"w:type", L"dxa" );
wAfter.AppendAttribute( wAfterType ); wAfter.AppendAttribute( wAfterType );
_trPr->AppendChild( wAfter, true ); _trPr->AppendChild( wAfter, true );
} }
...@@ -105,11 +105,11 @@ namespace DocFileFormat ...@@ -105,11 +105,11 @@ namespace DocFileFormat
if ( before != 0 ) if ( before != 0 )
{ {
XMLTools::XMLElement<wchar_t> wBefore( _T( "w:wBefore" ) ); XMLTools::XMLElement<wchar_t> wBefore( L"w:wBefore" );
XMLTools::XMLAttribute<wchar_t> wBeforeValue( _T( "w:w" ), FormatUtils::IntToWideString( before ).c_str() ); XMLTools::XMLAttribute<wchar_t> wBeforeValue( L"w:w", FormatUtils::IntToWideString( before ).c_str() );
wBefore.AppendAttribute( wBeforeValue ); wBefore.AppendAttribute( wBeforeValue );
XMLTools::XMLAttribute<wchar_t> wBeforeType( _T( "w:type" ), _T( "dxa" ) ); XMLTools::XMLAttribute<wchar_t> wBeforeType( L"w:type", L"dxa" );
wBefore.AppendAttribute( wBeforeType ); wBefore.AppendAttribute( wBeforeType );
_trPr->AppendChild( wBefore, true ); _trPr->AppendChild( wBefore, true );
} }
...@@ -119,25 +119,25 @@ namespace DocFileFormat ...@@ -119,25 +119,25 @@ namespace DocFileFormat
case sprmOldTDyaRowHeight: case sprmOldTDyaRowHeight:
case sprmTDyaRowHeight: case sprmTDyaRowHeight:
{ //row height { //row height
XMLTools::XMLElement<wchar_t> rowHeight( _T( "w:trHeight" ) ); XMLTools::XMLElement<wchar_t> rowHeight( L"w:trHeight" );
XMLTools::XMLAttribute<wchar_t> rowHeightVal( _T( "w:val" ) ); XMLTools::XMLAttribute<wchar_t> rowHeightVal( L"w:val" );
XMLTools::XMLAttribute<wchar_t> rowHeightRule( _T( "w:hRule" ) ); XMLTools::XMLAttribute<wchar_t> rowHeightRule( L"w:hRule" );
short rH = FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ); short rH = FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize );
if ( rH > 0 ) if ( rH > 0 )
{ {
rowHeightRule.SetValue( _T( "atLeast" ) ); rowHeightRule.SetValue( L"atLeast" );
rowHeightVal.SetValue( FormatUtils::IntToWideString( rH ).c_str() ); rowHeightVal.SetValue( FormatUtils::IntToWideString( rH ).c_str() );
rowHeight.AppendAttribute( rowHeightVal ); rowHeight.AppendAttribute( rowHeightVal );
} }
else if( rH == 0 ) else if( rH == 0 )
{ {
rowHeightRule.SetValue( _T("auto") ); rowHeightRule.SetValue( L"auto" );
} }
else else
{ {
rowHeightRule.SetValue( _T( "exact" ) ); rowHeightRule.SetValue( L"exact" );
rH *= -1; rH *= -1;
rowHeightVal.SetValue( FormatUtils::IntToWideString( rH ).c_str() ); rowHeightVal.SetValue( FormatUtils::IntToWideString( rH ).c_str() );
rowHeight.AppendAttribute( rowHeightVal ); rowHeight.AppendAttribute( rowHeightVal );
...@@ -152,13 +152,13 @@ namespace DocFileFormat ...@@ -152,13 +152,13 @@ namespace DocFileFormat
case sprmTFCantSplit: case sprmTFCantSplit:
case sprmTFCantSplit90: case sprmTFCantSplit90:
{ //can't split { //can't split
appendFlagElement( _trPr, *iter, _T( "cantSplit" ), true ); appendFlagElement( _trPr, *iter, L"cantSplit", true );
}break; }break;
//div id //div id
case sprmTIpgp: case sprmTIpgp:
{ {
appendValueElement( _trPr, _T( "divId" ), FormatUtils::IntToWideString( FormatUtils::BytesToInt32( iter->Arguments, 0, iter->argumentsSize ) ).c_str(), true ); appendValueElement( _trPr, L"divId", FormatUtils::IntToWideString( FormatUtils::BytesToInt32( iter->Arguments, 0, iter->argumentsSize ) ).c_str(), true );
}break; }break;
//borders 80 exceptions //borders 80 exceptions
...@@ -263,4 +263,4 @@ namespace DocFileFormat ...@@ -263,4 +263,4 @@ namespace DocFileFormat
m_pXmlWriter->WriteString( _trPr->GetXMLString().c_str() ); m_pXmlWriter->WriteString( _trPr->GetXMLString().c_str() );
} }
} }
} }
\ No newline at end of file
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
#include "../odf/odfcontext.h" #include "../odf/odfcontext.h"
#include "../odf/style_paragraph_properties.h" #include "../odf/style_paragraph_properties.h"
#include "../odf/style_text_properties.h" #include "../odf/style_text_properties.h"
#include "../odf/style_table_properties.h"
#include "../odf/style_graphic_properties.h" #include "../odf/style_graphic_properties.h"
#include "../odf/datatypes/style_ref.h" #include "../odf/datatypes/style_ref.h"
...@@ -1301,6 +1302,8 @@ void docx_conversion_context::start_changes() ...@@ -1301,6 +1302,8 @@ void docx_conversion_context::start_changes()
text_tracked_context_.dumpPPr_.clear(); text_tracked_context_.dumpPPr_.clear();
text_tracked_context_.dumpRPr_.clear(); text_tracked_context_.dumpRPr_.clear();
text_tracked_context_.dumpRPrInsDel_.clear(); text_tracked_context_.dumpRPrInsDel_.clear();
text_tracked_context_.dumpTcPr_.clear();
text_tracked_context_.dumpTblPr_.clear();
for (map_changes_iterator it = map_current_changes_.begin(); it != map_current_changes_.end(); it++) for (map_changes_iterator it = map_current_changes_.begin(); it != map_current_changes_.end(); it++)
{ {
...@@ -1329,45 +1332,63 @@ void docx_conversion_context::start_changes() ...@@ -1329,45 +1332,63 @@ void docx_conversion_context::start_changes()
odf_reader::style_instance * styleInst = root()->odf_context().styleContainer().style_by_name(state.style_name, odf_types::style_family::Paragraph, false); odf_reader::style_instance * styleInst = root()->odf_context().styleContainer().style_by_name(state.style_name, odf_types::style_family::Paragraph, false);
if (styleInst) if (styleInst)
{ {
odf_reader::style_paragraph_properties * props = NULL; odf_reader::style_paragraph_properties * props = styleInst->content()->get_style_paragraph_properties();
props = styleInst->content()->get_style_paragraph_properties(); odf_reader::style_text_properties * props_text = styleInst->content()->get_style_text_properties();
text_tracked_context_.dumpPPr_ += L"<w:pPrChange" + change_attr;
if (props) if (props)
{ {
props->docx_convert(*this); props->docx_convert(*this);
odf_reader::style_text_properties * t_props = NULL; text_tracked_context_.dumpPPr_ += get_styles_context().paragraph_attr().str();
t_props = styleInst->content()->get_style_text_properties(); }
if (t_props) text_tracked_context_.dumpPPr_ += L">";
props->docx_convert(*this);
std::wstring attr = get_styles_context().paragraph_attr().str(); if (props) text_tracked_context_.dumpPPr_ += get_styles_context().paragraph_nodes().str();
if (props_text)
text_tracked_context_.dumpPPr_ += L"<w:pPrChange" + change_attr + (attr.empty() ? L">" : (L" " + attr + L">")); {
text_tracked_context_.dumpPPr_ += get_styles_context().paragraph_nodes().str(); props_text->docx_convert(*this);
if (t_props)
{ text_tracked_context_.dumpPPr_ += L"<w:rPr>";
text_tracked_context_.dumpPPr_ += L"<w:rPr>"; text_tracked_context_.dumpPPr_ += get_styles_context().text_style().str();
text_tracked_context_.dumpPPr_ += get_styles_context().text_style().str(); text_tracked_context_.dumpPPr_ += L"</w:rPr>";
text_tracked_context_.dumpPPr_ += L"</w:rPr>";
}
text_tracked_context_.dumpPPr_ += L"</w:pPrChange>";
} }
else text_tracked_context_.dumpPPr_ += L"</w:pPrChange>";
text_tracked_context_.dumpPPr_ = L"<w:pPrChange/>";
} }
else if (styleInst = root()->odf_context().styleContainer().style_by_name(state.style_name, odf_types::style_family::Text, false)) else if (styleInst = root()->odf_context().styleContainer().style_by_name(state.style_name, odf_types::style_family::Text, false))
{ {
text_tracked_context_.dumpRPr_ = L"<w:rPrChange" + change_attr + L">";
odf_reader::style_text_properties * props = NULL; odf_reader::style_text_properties * props = NULL;
props = styleInst->content()->get_style_text_properties(); props = styleInst->content()->get_style_text_properties();
if (props) if (props)
{ {
props->docx_convert(*this); props->docx_convert(*this);
text_tracked_context_.dumpRPr_ = L"<w:rPrChange" + change_attr + L">";
text_tracked_context_.dumpRPr_ += get_styles_context().text_style().str(); text_tracked_context_.dumpRPr_ += get_styles_context().text_style().str();
text_tracked_context_.dumpRPr_ += L"</w:rPrChange>"; }
}else text_tracked_context_.dumpRPr_ += L"</w:rPrChange>";
text_tracked_context_.dumpRPr_ = L"<w:rPrChange/>";
} }
else else if (styleInst = root()->odf_context().styleContainer().style_by_name(state.style_name, odf_types::style_family::Table, false))
{ {
text_tracked_context_.dumpTblPr_ = L"<w:TblPrChange" + change_attr + L">";
odf_reader::style_table_properties * props = styleInst->content()->get_style_table_properties();
odf_reader::style_table_cell_properties * props_cell = styleInst->content()->get_style_table_cell_properties();
if (props)
{
props->docx_convert(*this);
text_tracked_context_.dumpTblPr_ += get_styles_context().table_style().str();
}
text_tracked_context_.dumpTblPr_ += L"</w:TblPrChange>";
}
else if (styleInst = root()->odf_context().styleContainer().style_by_name(state.style_name, odf_types::style_family::TableCell, false))
{
text_tracked_context_.dumpTcPr_ = L"<w:TcPrChange" + change_attr + L">";
odf_reader::style_table_cell_properties * props = styleInst->content()->get_style_table_cell_properties();
if (props)
{
props->docx_convert(*this);
text_tracked_context_.dumpTcPr_ += get_styles_context().table_style().str();
}
text_tracked_context_.dumpTcPr_ += L"</w:TcPrChange>";
} }
} }
} }
...@@ -1386,6 +1407,8 @@ void docx_conversion_context::end_changes() ...@@ -1386,6 +1407,8 @@ void docx_conversion_context::end_changes()
// if (state.type == 2) output_stream() << L"</w:del>"; // if (state.type == 2) output_stream() << L"</w:del>";
//} //}
text_tracked_context_.dumpTcPr_.clear();
text_tracked_context_.dumpTblPr_.clear();
text_tracked_context_.dumpRPrInsDel_.clear(); text_tracked_context_.dumpRPrInsDel_.clear();
text_tracked_context_.dumpPPr_.clear(); text_tracked_context_.dumpPPr_.clear();
text_tracked_context_.dumpRPr_.clear(); text_tracked_context_.dumpRPr_.clear();
......
...@@ -509,6 +509,8 @@ public: ...@@ -509,6 +509,8 @@ public:
std::wstring dumpPPr_; std::wstring dumpPPr_;
std::wstring dumpRPr_; std::wstring dumpRPr_;
std::wstring dumpRPrInsDel_; std::wstring dumpRPrInsDel_;
std::wstring dumpTblPr_;
std::wstring dumpTcPr_;
text_tracked_context(docx_conversion_context & context); text_tracked_context(docx_conversion_context & context);
...@@ -719,6 +721,9 @@ public: ...@@ -719,6 +721,9 @@ public:
bool delayed_converting_; bool delayed_converting_;
bool convert_delayed_enabled_; bool convert_delayed_enabled_;
void start_changes();
void end_changes();
private: private:
std::wstringstream document_xml_; std::wstringstream document_xml_;
std::wstringstream styles_xml_; std::wstringstream styles_xml_;
...@@ -791,10 +796,6 @@ private: ...@@ -791,10 +796,6 @@ private:
// цепочки переименований нумераций // цепочки переименований нумераций
boost::unordered_map<std::wstring, std::wstring> list_style_renames_; boost::unordered_map<std::wstring, std::wstring> list_style_renames_;
void start_changes();
void end_changes();
}; };
} }
......
...@@ -124,7 +124,7 @@ void styles_context::docx_serialize_text_style(std::wostream & strm, std::wstrin ...@@ -124,7 +124,7 @@ void styles_context::docx_serialize_text_style(std::wostream & strm, std::wstrin
} }
} }
void styles_context::docx_serialize_table_style(std::wostream & strm) void styles_context::docx_serialize_table_style(std::wostream & strm, std::wstring & strChange)
{ {
if (!table_style_.str().empty()) if (!table_style_.str().empty())
{ {
...@@ -133,6 +133,11 @@ void styles_context::docx_serialize_table_style(std::wostream & strm) ...@@ -133,6 +133,11 @@ void styles_context::docx_serialize_table_style(std::wostream & strm)
CP_XML_NODE(L"w:tblPr") CP_XML_NODE(L"w:tblPr")
{ {
CP_XML_STREAM() << table_style_.str(); CP_XML_STREAM() << table_style_.str();
if (!strChange.empty())//tblPrChange
{
CP_XML_STREAM() << strChange;
strChange.clear();
}
} }
} }
} }
......
...@@ -58,10 +58,10 @@ public: ...@@ -58,10 +58,10 @@ public:
std::wstringstream & table_style(); std::wstringstream & table_style();
std::wstringstream & list_style(); std::wstringstream & list_style();
void docx_serialize_text_style(std::wostream & strm, std::wstring parenStyleId, std::wstring & strChange); void docx_serialize_text_style (std::wostream & strm, std::wstring parenStyleId, std::wstring & strChange);
void docx_serialize_table_style(std::wostream & strm); void docx_serialize_table_style (std::wostream & strm, std::wstring & strChange);
void pptx_serialize_table_style(std::wostream & strm); void pptx_serialize_table_style (std::wostream & strm);
std::wstring & extern_node(){return extern_node_;} std::wstring & extern_node(){return extern_node_;}
std::wstring & hlinkClick(){return hlinkClick_;} std::wstring & hlinkClick(){return hlinkClick_;}
......
...@@ -154,6 +154,8 @@ void table_table::docx_convert(oox::docx_conversion_context & Context) ...@@ -154,6 +154,8 @@ void table_table::docx_convert(oox::docx_conversion_context & Context)
_Wostream << L"<w:tbl>"; _Wostream << L"<w:tbl>";
Context.start_changes(); //TblPrChange
Context.get_table_context().start_table(tableStyleName); Context.get_table_context().start_table(tableStyleName);
style_instance * inst = style_instance * inst =
...@@ -164,7 +166,8 @@ void table_table::docx_convert(oox::docx_conversion_context & Context) ...@@ -164,7 +166,8 @@ void table_table::docx_convert(oox::docx_conversion_context & Context)
if (inst && inst->content()) if (inst && inst->content())
inst->content()->docx_convert(Context); inst->content()->docx_convert(Context);
Context.get_styles_context().docx_serialize_table_style(_Wostream);
Context.get_styles_context().docx_serialize_table_style(_Wostream, Context.get_text_tracked_context().dumpTblPr_);
_Wostream << L"<w:tblGrid>"; _Wostream << L"<w:tblGrid>";
table_columns_and_groups_.docx_convert(Context); table_columns_and_groups_.docx_convert(Context);
......
...@@ -56,6 +56,7 @@ namespace OOX ...@@ -56,6 +56,7 @@ namespace OOX
class CTrPrChange; class CTrPrChange;
class CTcPrChange; class CTcPrChange;
class CTblPrChange; class CTblPrChange;
class CTblGridChange;
class CParagraph; class CParagraph;
class CParagraphProperty; class CParagraphProperty;
class CPTab; class CPTab;
...@@ -208,6 +209,7 @@ namespace Oox2Odf ...@@ -208,6 +209,7 @@ namespace Oox2Odf
int convert(OOX::Logic::CTrPrChange *oox_tr_prop_change); int convert(OOX::Logic::CTrPrChange *oox_tr_prop_change);
int convert(OOX::Logic::CTcPrChange *oox_tc_prop_change); int convert(OOX::Logic::CTcPrChange *oox_tc_prop_change);
int convert(OOX::Logic::CTblPrChange *oox_table_prop_change); int convert(OOX::Logic::CTblPrChange *oox_table_prop_change);
int convert(OOX::Logic::CTblGridChange *oox_table_grid_prop_change);
void convert(OOX::Logic::CAlternateContent *oox_alt_content); void convert(OOX::Logic::CAlternateContent *oox_alt_content);
void convert(OOX::Logic::CDrawing *oox_drawing); void convert(OOX::Logic::CDrawing *oox_drawing);
...@@ -261,7 +263,7 @@ namespace Oox2Odf ...@@ -261,7 +263,7 @@ namespace Oox2Odf
bool convert(OOX::Logic::CTableCellProperties *oox_table_cell_pr, int col = -1); bool convert(OOX::Logic::CTableCellProperties *oox_table_cell_pr, int col = -1);
bool convert(OOX::Logic::CTableCellProperties *oox_table_cell_pr, odf_writer::style_table_cell_properties *table_cell_properties/*,odf_writer::style_table_cell_properties * table_cell_properties = NULL*/); bool convert(OOX::Logic::CTableCellProperties *oox_table_cell_pr, odf_writer::style_table_cell_properties *table_cell_properties/*,odf_writer::style_table_cell_properties * table_cell_properties = NULL*/);
bool convert(OOX::Logic::CTableProperty *oox_table_pr, bool base_styled); bool convert(OOX::Logic::CTableProperty *oox_table_pr, bool base_styled);
bool convert(OOX::Logic::CTableProperty *oox_table_pr, odf_writer::style_table_properties *table_properties); bool convert(OOX::Logic::CTableProperty *oox_table_pr, odf_writer::style_table_properties *table_properties);
void convert(OOX::Logic::CTableProperty *oox_table_pr, odf_writer::style_table_cell_properties *table_cell_properties); void convert(OOX::Logic::CTableProperty *oox_table_pr, odf_writer::style_table_cell_properties *table_cell_properties);
void convert(OOX::Logic::CTableRowProperties *oox_table_row_pr); void convert(OOX::Logic::CTableRowProperties *oox_table_row_pr);
......
...@@ -30,7 +30,6 @@ ...@@ -30,7 +30,6 @@
* *
*/ */
#pragma once #pragma once
#include "Base.h"
#include "../../../../DesktopEditor/common/Types.h" #include "../../../../DesktopEditor/common/Types.h"
namespace NSCommon namespace NSCommon
...@@ -64,7 +63,7 @@ namespace NSCommon ...@@ -64,7 +63,7 @@ namespace NSCommon
Release(); Release();
} }
AVSINLINE void Release() inline void Release()
{ {
if (!IsInit() || (NULL == m_pCountRef)) if (!IsInit() || (NULL == m_pCountRef))
return; return;
...@@ -78,7 +77,7 @@ namespace NSCommon ...@@ -78,7 +77,7 @@ namespace NSCommon
m_pData = NULL; m_pData = NULL;
m_pCountRef = NULL; m_pCountRef = NULL;
} }
AVSINLINE void AddRef() inline void AddRef()
{ {
if (!IsInit() || (NULL == m_pCountRef)) if (!IsInit() || (NULL == m_pCountRef))
return; return;
...@@ -118,42 +117,42 @@ namespace NSCommon ...@@ -118,42 +117,42 @@ namespace NSCommon
public: public:
AVSINLINE bool IsInit() const inline bool IsInit() const
{ {
return (NULL != m_pData); return (NULL != m_pData);
} }
AVSINLINE bool is_init() const inline bool is_init() const
{ {
return IsInit(); return IsInit();
} }
template<class T> AVSINLINE const bool is()const template<class T> inline const bool is()const
{ {
if (!IsInit()) if (!IsInit())
return false; return false;
T* pResult = dynamic_cast<T*>(const_cast<Type*>(m_pData)); T* pResult = dynamic_cast<T*>(const_cast<Type*>(m_pData));
return (NULL != pResult); return (NULL != pResult);
} }
template<class T> AVSINLINE const T& as()const template<class T> inline const T& as()const
{ {
T* pResult = dynamic_cast<T*>(const_cast<Type*>(m_pData)); T* pResult = dynamic_cast<T*>(const_cast<Type*>(m_pData));
return *pResult; return *pResult;
} }
template<class T> AVSINLINE T& as() template<class T> inline T& as()
{ {
T* pResult = dynamic_cast<T*>(const_cast<Type*>(m_pData)); T* pResult = dynamic_cast<T*>(const_cast<Type*>(m_pData));
return *pResult; return *pResult;
} }
template <typename T> template <typename T>
AVSINLINE void Attach(T* pCast, const LONG* pCountRef) inline void Attach(T* pCast, const LONG* pCountRef)
{ {
m_pData = pCast; m_pData = pCast;
m_pCountRef = const_cast<LONG*>(pCountRef); m_pCountRef = const_cast<LONG*>(pCountRef);
} }
template<typename T> template<typename T>
AVSINLINE smart_ptr<T> smart_dynamic_cast()const inline smart_ptr<T> smart_dynamic_cast()const
{ {
smart_ptr<T> new_type; smart_ptr<T> new_type;
...@@ -172,22 +171,22 @@ namespace NSCommon ...@@ -172,22 +171,22 @@ namespace NSCommon
return new_type; return new_type;
} }
AVSINLINE Type& operator*() { return *m_pData; } inline Type& operator*() { return *m_pData; }
AVSINLINE Type* operator->() { return m_pData; } inline Type* operator->() { return m_pData; }
AVSINLINE const Type& operator*() const { return *m_pData; } inline const Type& operator*() const { return *m_pData; }
AVSINLINE const Type* operator->() const { return m_pData; } inline const Type* operator->() const { return m_pData; }
AVSINLINE const Type& get() { return *m_pData; } const inline const Type& get() { return *m_pData; } const
AVSINLINE void reset(Type* pPointer = NULL) inline void reset(Type* pPointer = NULL)
{ {
*this = pPointer; *this = pPointer;
} }
}; };
template <typename T> template <typename T>
static AVSINLINE void normalize_value(T& value, const T& min, const T& max) static inline void normalize_value(T& value, const T& min, const T& max)
{ {
if (value < min) if (value < min)
value = min; value = min;
......
...@@ -3,122 +3,26 @@ CONFIG += console ...@@ -3,122 +3,26 @@ CONFIG += console
CONFIG -= app_bundle CONFIG -= app_bundle
CONFIG -= qt CONFIG -= qt
CONFIG += c++11 CORE_ROOT_DIR = $$PWD/../..
PWD_ROOT_DIR = $$PWD
include($$CORE_ROOT_DIR/Common/base.pri)
############### destination path ###############
DESTDIR = $$PWD/../../build/bin/AllFontsGen DESTDIR = $$PWD/../../build/bin/AllFontsGen
# WINDOWS TARGET = $$CORE_BUILDS_PLATFORM_PREFIX
win32:contains(QMAKE_TARGET.arch, x86_64):{
TARGET = win_64
}
win32:!contains(QMAKE_TARGET.arch, x86_64):{
TARGET = win_32
}
linux-g++{
linux-g++:contains(QMAKE_HOST.arch, x86_64):{
TARGET = linux_64
}
linux-g++:!contains(QMAKE_HOST.arch, x86_64):{
TARGET = linux_32
}
}
linux-g++-64{
TARGET = linux_64
}
linux-g++-32{
TARGET = linux_32
}
mac {
TARGET = mac_64
}
################################################
################# dependencies #################
DESTINATION_SDK_PATH = $$PWD/../../build/lib
win32:contains(QMAKE_TARGET.arch, x86_64):{
CONFIG(debug, debug|release) {
DESTINATION_SDK_PATH = $$DESTINATION_SDK_PATH/win_64/DEBUG
} else {
DESTINATION_SDK_PATH = $$DESTINATION_SDK_PATH/win_64
}
}
win32:!contains(QMAKE_TARGET.arch, x86_64):{
CONFIG(debug, debug|release) {
DESTINATION_SDK_PATH = $$DESTINATION_SDK_PATH/win_32/DEBUG
} else {
DESTINATION_SDK_PATH = $$DESTINATION_SDK_PATH/win_32
}
}
linux-g++{
linux-g++:contains(QMAKE_HOST.arch, x86_64):{
DESTINATION_SDK_PATH = $$DESTINATION_SDK_PATH/linux_64
}
linux-g++:!contains(QMAKE_HOST.arch, x86_64):{
DESTINATION_SDK_PATH = $$DESTINATION_SDK_PATH/linux_32
}
}
linux-g++-64{
DESTINATION_SDK_PATH = $$DESTINATION_SDK_PATH/linux_64
}
linux-g++-32{
DESTINATION_SDK_PATH = $$DESTINATION_SDK_PATH/linux_32
}
mac {
DESTINATION_SDK_PATH = $$DESTINATION_SDK_PATH/mac_64
}
LIBS += -L$$DESTINATION_SDK_PATH -lgraphics LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lgraphics -lOfficeUtils
LIBS += -L$$DESTINATION_SDK_PATH -lOfficeUtils
linux-g++ | linux-g++-64 | linux-g++-32 {
LIBS += -lz
}
################################################
DEFINES += \ DEFINES += \
_QT \ _QT \
FT2_BUILD_LIBRARY \ FT2_BUILD_LIBRARY
EXCLUDE_JPG_SUPPORT \
MNG_SUPPORT_DISPLAY \
MNG_SUPPORT_READ \
MNG_SUPPORT_WRITE \
MNG_ACCESS_CHUNKS \
MNG_STORE_CHUNKS\
MNG_ERROR_TELLTALE
linux-g++ | linux-g++-64 | linux-g++-32 {
DEFINES += \
HAVE_UNISTD_H \
LINUX \
_LINUX \
_LINUX_QT
message(linux)
QMAKE_CXXFLAGS += -std=c++0x -pthread INCLUDEPATH += \
LIBS += -pthread ../agg-2.4/include \
} ../freetype-2.5.2/include
mac {
DEFINES += \
HAVE_UNISTD_H \
_LINUX \
_LINUX_QT \
_MAC \
QT_MAC
message(mac)
}
win32 { core_windows {
DEFINES += \ DEFINES += \
JAS_WIN_MSVC_BUILD \ JAS_WIN_MSVC_BUILD \
WIN32 WIN32
...@@ -134,8 +38,8 @@ win32 { ...@@ -134,8 +38,8 @@ win32 {
LIBS += -lUser32 LIBS += -lUser32
} }
SOURCES += main.cpp core_linux {
LIBS += -lz
}
INCLUDEPATH += \ SOURCES += main.cpp
../agg-2.4/include \
../freetype-2.5.2/include
...@@ -47,7 +47,7 @@ FT_Error FT_Load_Glyph_Wrapper( FT_Face face, ...@@ -47,7 +47,7 @@ FT_Error FT_Load_Glyph_Wrapper( FT_Face face,
FT_UInt glyph_index, FT_UInt glyph_index,
FT_Int32& load_flags, INT& bHintsSupport ) FT_Int32& load_flags, INT& bHintsSupport )
{ {
int nErr = FT_Load_Glyph(face, glyph_index, load_flags); int nErr = FT_Load_Glyph(face, glyph_index, load_flags);
/* /*
FT_Err_Invalid_Glyph_Index = 0x10; FT_Err_Invalid_Glyph_Index = 0x10;
...@@ -70,7 +70,7 @@ FT_Error FT_Load_Glyph_Wrapper( FT_Face face, ...@@ -70,7 +70,7 @@ FT_Error FT_Load_Glyph_Wrapper( FT_Face face,
FT_Err_Invalid_Stream_Handle = 0x28; FT_Err_Invalid_Stream_Handle = 0x28;
*/ */
if ((bHintsSupport == TRUE) && (nErr < 0x10 || nErr > 0x28)) if ((bHintsSupport == TRUE) && (nErr > 0x10 && nErr < 0x28))
{ {
int nErr2 = FT_Load_Glyph(face, glyph_index, 40970); int nErr2 = FT_Load_Glyph(face, glyph_index, 40970);
......
...@@ -2319,7 +2319,7 @@ namespace NExtractTools ...@@ -2319,7 +2319,7 @@ namespace NExtractTools
RELEASEOBJECT(pReader); RELEASEOBJECT(pReader);
} }
} }
else if(AVS_OFFICESTUDIO_FILE_CANVAS_WORD == nFormatTo) else if(0 != (AVS_OFFICESTUDIO_FILE_CANVAS & nFormatTo))
{ {
std::wstring sToDir = NSSystemPath::GetDirectoryName(sTo); std::wstring sToDir = NSSystemPath::GetDirectoryName(sTo);
if(!params.getDontSaveAdditional()) if(!params.getDontSaveAdditional())
......
...@@ -209,6 +209,8 @@ namespace CSVWriter ...@@ -209,6 +209,8 @@ namespace CSVWriter
if (pCell->isInitRef()) if (pCell->isInitRef())
{ {
pCell->getRowCol(nRowTmp, nCol); pCell->getRowCol(nRowTmp, nCol);
nRowTmp++;
nCol++;
} }
else else
{ {
......
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