Compare commits

...

10 Commits

6 changed files with 38 additions and 20 deletions

View File

@ -1068,25 +1068,28 @@ public:
{
case ODRAW::rtLineTo:
{
if (valuePointer + 1 > m_arPoints.size())
for (_UINT16 j = 0; j < m_arSegments[i].m_nCount; j++)
{
break;
if (valuePointer + 1 > m_arPoints.size())
{
break;
strVmlPath += L"l";
strVmlPath += std::to_wstring(m_arPoints[0].x);
strVmlPath += L",";
strVmlPath += std::to_wstring(m_arPoints[0].y);
strVmlPath += L"l";
strVmlPath += std::to_wstring(m_arPoints[0].x);
strVmlPath += L",";
strVmlPath += std::to_wstring(m_arPoints[0].y);
++valuePointer;
}
else
{
strVmlPath += L"l";
strVmlPath += std::to_wstring(m_arPoints[valuePointer].x );
strVmlPath += L",";
strVmlPath += std::to_wstring(m_arPoints[valuePointer].y );
++valuePointer;
}
else
{
strVmlPath += L"l";
strVmlPath += std::to_wstring(m_arPoints[valuePointer].x );
strVmlPath += L",";
strVmlPath += std::to_wstring(m_arPoints[valuePointer].y );
++valuePointer;
++valuePointer;
}
}
}break;
case ODRAW::rtCurveTo:

View File

@ -522,10 +522,10 @@ void docx_serialize_wps(std::wostream & strm, _docx_drawing & val, oox::docx_con
CP_XML_NODE(L"w:drawing")
{
std::wstring strWp = L"wp:anchor";
if (val.isInline)strWp = L"wp:inline";
if (val.isInline || val.m_isChar)strWp = L"wp:inline";
CP_XML_NODE(strWp)
{
if (val.isInline)
if (val.isInline || val.m_isChar)
{
CP_XML_NODE(L"wp:extent")
{

View File

@ -44,10 +44,11 @@ namespace oox {
class _docx_drawing : public _oox_drawing
{
public:
_docx_drawing() : _oox_drawing(), parallel(0), isInline(false), inFrame(false), number_wrapped_paragraphs(0), posOffsetV(0), posOffsetH(0)
_docx_drawing() : _oox_drawing(), parallel(0), isInline(false), m_isChar(false), inFrame(false), number_wrapped_paragraphs(0), posOffsetV(0), posOffsetH(0)
{
}
bool isInline;
bool m_isChar;
bool inFrame;
unsigned int parallel;

View File

@ -888,6 +888,10 @@ void common_draw_docx_convert(oox::docx_conversion_context & Context, union_comm
{
drawing->isInline = true;
}
if( anchor && anchor->get_type() == anchor_type::Char )
{
drawing->m_isChar = true;
}
if (attlists_.shape_with_text_and_styles_.common_shape_draw_attlist_.draw_transform_)
{
std::wstring transformStr = attlists_.shape_with_text_and_styles_.common_shape_draw_attlist_.draw_transform_.get();

View File

@ -5088,7 +5088,14 @@ bool DocxConverter::convert(OOX::Logic::CTableProperty *oox_table_pr, odf_writer
oox_table_pr->m_oTblW->m_oW->GetValue() > 0 )
{
if ( oox_table_pr->m_oTblW->m_oW->IsPercent() == false)
odt_context->table_context()->set_default_column_width(oox_table_pr->m_oTblW->m_oW->GetValue() / 20.);
{
const double PtPerCm = 72 / 2.54;
const double TwPerPt = 20.0;
const double TwPerCm = PtPerCm * TwPerPt;
const double WidthCm = oox_table_pr->m_oTblW->m_oW->GetValue() / TwPerCm;
odt_context->table_context()->set_default_column_width(WidthCm);
table_properties->content_.style_width_ = odf_types::length(WidthCm, odf_types::length::cm);
}
}
else if ( oox_table_pr->m_oTblW->m_oType->GetValue() == SimpleTypes::tblwidthAuto &&
oox_table_pr->m_oTblW->m_oW->GetValue() == 0 )

View File

@ -227,7 +227,10 @@ void odf_table_context::end_table()
style_table_properties * table_props = style_->content_.add_get_style_table_properties();
if (table_props)
{
table_props->content_.style_width_ = length(length(impl_->current_table().table_width,length::pt).get_value_unit(length::cm),length::cm);
if( !table_props->content_.style_width_ )
{
table_props->content_.style_width_ = length(length(impl_->current_table().table_width,length::pt).get_value_unit(length::cm),length::cm);
}
}
}
}