Commit 8bf41615 authored by ElenaSubbotina's avatar ElenaSubbotina

x2t fix bugs

parent 2af6c6c8
......@@ -423,8 +423,11 @@ namespace DocFileFormat
}break;
case lineWidth:
{
EmuValue eLineWidth ((int)iter->op );
m_pXmlWriter->WriteAttribute(_T("strokeweight"), FormatUtils::DoubleToWideString(eLineWidth.ToPoints()) + _T("pt"));
if (iter->op > 0)
{
EmuValue eLineWidth ((int)iter->op );
m_pXmlWriter->WriteAttribute(_T("strokeweight"), FormatUtils::DoubleToWideString(eLineWidth.ToPoints()) + _T("pt"));
}
}break;
case lineDashing:
{
......@@ -1530,6 +1533,11 @@ namespace DocFileFormat
{
appendStyleProperty(oStyle, _T("mso-position-vertical-relative"), mapVerticalPositionRelative(m_pSpa->bx));
}
if (!m_isInlineShape && !bZIndex)
{
appendStyleProperty( oStyle, _T( "z-index" ), FormatUtils::IntToWideString(zIndex + 0x7ffff));
bZIndex = true;
}
//if (!bPosH)
//{
......
......@@ -20,7 +20,7 @@
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
......@@ -49,7 +49,7 @@
RuntimeLibrary="3"
UsePrecompiledHeader="2"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="4"
/>
<Tool
......@@ -124,7 +124,7 @@
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="2"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
......
......@@ -1162,12 +1162,12 @@ void draw_image::docx_convert(oox::docx_conversion_context & Context)
void draw_text_box::docx_convert(oox::docx_conversion_context & Context)
{
if (Context.get_drawing_context().get_current_level() >1 )
{
if(Context.delayed_converting_ == false)
Context.add_delayed_element(Context.get_drawing_context().get_current_frame());
return;
}
// if (Context.get_drawing_context().get_current_level() > 1 )
//{
// if(Context.delayed_converting_ == false)
// Context.add_delayed_element(Context.get_drawing_context().get_current_frame());
// return;
//}
//тут может быть не только текст , но и таблицы, другие объекты ...
oox::docx_conversion_context::StreamsManPtr prev = Context.get_stream_man();
......@@ -1377,7 +1377,8 @@ void draw_g::docx_convert(oox::docx_conversion_context & Context)
}
void draw_frame::docx_convert(oox::docx_conversion_context & Context)
{
if ((!Context.get_paragraph_state() && !Context.get_drawing_context().in_group()) && !Context.delayed_converting_)
//if ((!Context.get_paragraph_state() && !Context.get_drawing_context().in_group()) && !Context.delayed_converting_)
if (Context.get_drawing_context().get_current_level() > 0 && !Context.get_drawing_context().in_group() )
{
Context.add_delayed_element(this);
return;
......
......@@ -343,7 +343,7 @@ void draw_polyline::reset_polyline_path()
std::vector<svg_path::_polyline> o_Polyline_pt;
std::vector<svg_path::_polyline> o_Polyline_cm;
bool res = svg_path::parsePolygon(o_Polyline_cm, draw_polyline_attlist_.draw_points_.get(), false, false);
bool res = svg_path::parsePolygon(o_Polyline_cm, draw_polyline_attlist_.draw_points_.get(), false, true);
_CP_OPT(double) start_x, start_y;
......
......@@ -144,6 +144,11 @@ void table_format_properties::docx_convert(oox::docx_conversion_context & Contex
if (common_horizontal_margin_attlist_.fo_margin_left_->get_length() == common_horizontal_margin_attlist_.fo_margin_right_->get_length())
w_val = L"center";
}
if (w_val != L"center" && common_horizontal_margin_attlist_.fo_margin_left_ )
{
odf_types::length indent = common_horizontal_margin_attlist_.fo_margin_left_->get_length();
_tblPr << L"<w:tblInd w:w=\"" << indent.get_value_unit(odf_types::length::pt) * 20<< "\" w:type=\"dxa\" />";
}
}
else
w_val = boost::lexical_cast<std::wstring>(*table_align_);
......@@ -151,7 +156,7 @@ void table_format_properties::docx_convert(oox::docx_conversion_context & Contex
_tblPr << L"<w:jc w:val=\"" << w_val << "\" />";
}
if (table_align_ && table_align_->get_type() == table_align::Center)
if (table_align_ && table_align_->get_type() == table_align::Center)
{
// TODO ()
}
......
......@@ -220,13 +220,16 @@ namespace svg_path
bIsClosed = true;
// update current point - we're back at the start
if( aCurrPoly.points.size()>0 && !bWrongPositionAfterZ)
if( aCurrPoly.points.size() > 0 && !bWrongPositionAfterZ)
{
const _point aFirst( aCurrPoly.points[0]);
nLastX = aFirst.x.get();
nLastY = aFirst.y.get();
}
aCurrPoly.command=L"a:close";
aCurrPoly.command=L"a:close";
Polyline.push_back(aCurrPoly);
} break;
case 'm' :
case 'M' :
......@@ -751,13 +754,9 @@ namespace svg_path
}
}
if ((aCurrPoly.points.size() > 0 || bIsClosed) && !aCurrPoly.command.empty())
if ((aCurrPoly.points.size() > 0 || !bIsClosed) && !aCurrPoly.command.empty())
{
// end-process last poly
if(bIsClosed)
//{
// closeWithGeometryChange(aCurrPoly);
//}
Polyline.push_back(aCurrPoly);
}
......@@ -798,6 +797,13 @@ namespace svg_path
Polyline.push_back(Polyline[0]);
Polyline.back().command = L"a:lnTo";
}
if (closed)
{
aCurrPoly.points.clear();
aCurrPoly.command = L"a:close";
Polyline.push_back(aCurrPoly);
}
return true;
}
......
This diff is collapsed.
......@@ -51,7 +51,7 @@
UsePrecompiledHeader="0"
PrecompiledHeaderThrough=""
WarningLevel="3"
Detect64BitPortabilityProblems="true"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="4"
DisableSpecificWarnings="4311;4267;4996;4172"
/>
......
......@@ -1098,11 +1098,16 @@ void odf_drawing_context::add_path_element(std::wstring command, std::wstring &
{
if (command != impl_->current_drawing_state_.path_last_command_)
{
impl_->current_drawing_state_.path_ += command + L" ";
impl_->current_drawing_state_.path_ += command;
if (!strE.empty())
impl_->current_drawing_state_.path_ += L" ";
impl_->current_drawing_state_.path_last_command_ = command;
}
impl_->current_drawing_state_.path_ += strE + L" ";
if (command != L"N")
impl_->current_drawing_state_.path_ += strE + L" ";
else
impl_->current_drawing_state_.path_ += strE;
}
void odf_drawing_context::add_modifier(std::wstring modifier)
{
......
......@@ -609,10 +609,6 @@ void OoxConverter::convert(OOX::Drawing::CCustomGeometry2D *oox_cust_geom)
{
convert(oox_cust_geom->m_oPthLst.m_arrPath[i]);
}
for (unsigned int i=0; i< oox_cust_geom->m_oPthLst.m_arrPath.size();i++)
{
convert(oox_cust_geom->m_oPthLst.m_arrPath[i]);
}
}
void OoxConverter::convert(OOX::Drawing::CLineProperties *oox_line_prop, CString *change_sheme_color )
{
......@@ -699,6 +695,10 @@ void OoxConverter::convert(OOX::Drawing::CPath2D *oox_geom_path)
{
convert(oox_geom_path->m_arrItems[i]);
}
std::wstring path_elm ;
odf_context()->drawing_context()->add_path_element(std::wstring(L"N"), path_elm);
}
//-----------------------------------------------------------------------------------------------------------------
void OoxConverter::convert(OOX::Drawing::CEffectList *oox_effect_list, CString *change_sheme_color)
......@@ -1096,6 +1096,7 @@ void OoxConverter::convert(OOX::Drawing::CPath2DMoveTo *oox_geom_path)
std::wstring(L" ")+ boost::lexical_cast<std::wstring> ((int)pt2emu(oox_geom_path->m_oPt.m_oY.GetValue()));
odf_context()->drawing_context()->add_path_element(std::wstring(L"M"), path_elm);
}
void OoxConverter::convert(OOX::Drawing::CPath2DArcTo *oox_geom_path)
{
if (!oox_geom_path) return;
......@@ -1113,6 +1114,7 @@ void OoxConverter::convert(OOX::Drawing::CPath2DQuadBezierTo *oox_geom_path)
std::wstring(L" ") + boost::lexical_cast<std::wstring> ((int)pt2emu(oox_geom_path->m_oCtrl.m_oY.GetValue())) +
std::wstring(L" ") + boost::lexical_cast<std::wstring> ((int)pt2emu(oox_geom_path->m_oEnd.m_oX.GetValue())) +
std::wstring(L" ") + boost::lexical_cast<std::wstring> ((int)pt2emu(oox_geom_path->m_oEnd.m_oY.GetValue())) ;
odf_context()->drawing_context()->add_path_element(std::wstring(L"S"), path_elm);
}
......@@ -1126,6 +1128,7 @@ void OoxConverter::convert(OOX::Drawing::CPath2DCubicBezierTo *oox_geom_path)
std::wstring(L" ") + boost::lexical_cast<std::wstring> ((int)pt2emu(oox_geom_path->m_oCtrl2.m_oY.GetValue())) +
std::wstring(L" ") + boost::lexical_cast<std::wstring> ((int)pt2emu(oox_geom_path->m_oEnd.m_oX.GetValue())) +
std::wstring(L" ") + boost::lexical_cast<std::wstring> ((int)pt2emu(oox_geom_path->m_oEnd.m_oY.GetValue())) ;
odf_context()->drawing_context()->add_path_element(std::wstring(L"C"), path_elm);
}
void OoxConverter::convert(OOX::Drawing::CPath2DClose *oox_geom_path)
......@@ -1133,7 +1136,7 @@ void OoxConverter::convert(OOX::Drawing::CPath2DClose *oox_geom_path)
if (!oox_geom_path) return;
std::wstring path_elm ;
odf_context()->drawing_context()->add_path_element(std::wstring(L"N"), path_elm);
odf_context()->drawing_context()->add_path_element(std::wstring(L"Z"), path_elm);
}
void OoxConverter::convert(OOX::Drawing::CTextBodyProperties *oox_bodyPr)
{
......
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