Commit f15bee8e authored by Elen.Subbotina's avatar Elen.Subbotina Committed by Alexander Trofimov

(1.2.0.158): ASCOfficeOdfFileW


git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@58374 954022d7-b5bf-4e40-9824-e11837661b57
parent 3ade76f3
......@@ -297,7 +297,7 @@ std::wstring odf2oox_converter::Impl::convert(const std::wstring& expr)
replace_vertical(workstr);
return workstr;
}
//Sheet2.C3:Sheet2.C19 Sheet2.L29:Sheet2.L36
//
......
......@@ -4,7 +4,7 @@
/* File created by MIDL compiler version 7.00.0555 */
/* at Wed Aug 13 19:13:58 2014
/* at Fri Sep 19 18:46:02 2014
*/
/* Compiler settings for .\ASCOfficeOdfFileW.idl:
Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 7.00.0555
......
......@@ -1289,13 +1289,19 @@ void odf_drawing_context::set_group_size( _CP_OPT(double) cx, _CP_OPT(double) cy
double first_scale_x = 1;
double first_scale_y = 1;
if (impl_->width > 0) first_scale_x = impl_->width / *change_cx;
if (impl_->height > 0)first_scale_y = impl_->height / *change_cy;
impl_->current_group_->scale_cx *= first_scale_x;
impl_->current_group_->scale_cy *= first_scale_y;
if (impl_->width > 0)
{
first_scale_x = impl_->width / *change_cx;
impl_->current_group_->scale_cx = first_scale_x;
}
if (impl_->height > 0)
{
first_scale_y = impl_->height / *change_cy;
impl_->current_group_->scale_cy = first_scale_y;
}
}
impl_->current_group_->cx = *change_cx * impl_->current_group_->scale_cx;
impl_->current_group_->cy = *change_cy * impl_->current_group_->scale_cy;
......@@ -1770,8 +1776,8 @@ void odf_drawing_context::set_text_box_min_size(double w_pt, double h_pt)
if (draw)
{
if (h_pt >=0) draw->draw_text_box_attlist_.fo_min_height_= length(length(h_pt,length::pt).get_value_unit(length::cm), length::cm);
if (w_pt >=0) draw->draw_text_box_attlist_.fo_min_width_= length(length(w_pt,length::pt).get_value_unit(length::cm), length::cm);
if (h_pt >0) draw->draw_text_box_attlist_.fo_min_height_= length(length(h_pt,length::pt).get_value_unit(length::cm), length::cm);
if (w_pt >0) draw->draw_text_box_attlist_.fo_min_width_= length(length(w_pt,length::pt).get_value_unit(length::cm), length::cm);
}
}
......@@ -1806,6 +1812,7 @@ void odf_drawing_context::end_text_box()
{
draw->draw_text_box_attlist_.fo_min_height_= impl_->current_drawing_state_.svg_height_;
}
impl_->current_drawing_state_.svg_height_ = boost::none;///????
end_element();
......
......@@ -178,8 +178,8 @@ void OoxConverter::convert(SimpleTypes::Vml::CCssStyle *vml_style, bool group)
}
}break;
case SimpleTypes::Vml::cssptVTextAnchor:
switch(vml_style->m_arrProperties[i]->get_Value().eVTextAnchor)
{
switch(vml_style->m_arrProperties[i]->get_Value().eVTextAnchor)
{
case SimpleTypes::Vml::cssvtextanchorTop : odf_context()->drawing_context()->set_textarea_vertical_align(4); break;
case SimpleTypes::Vml::cssvtextanchorMiddle : odf_context()->drawing_context()->set_textarea_vertical_align(1); break;
case SimpleTypes::Vml::cssvtextanchorBottom : odf_context()->drawing_context()->set_textarea_vertical_align(0); break;
......@@ -190,8 +190,12 @@ void OoxConverter::convert(SimpleTypes::Vml::CCssStyle *vml_style, bool group)
case SimpleTypes::Vml::cssvtextanchorBottomBaseline : odf_context()->drawing_context()->set_textarea_vertical_align(0); break;
case SimpleTypes::Vml::cssvtextanchorTopCenterBaseline : odf_context()->drawing_context()->set_textarea_vertical_align(4); break;
case SimpleTypes::Vml::cssvtextanchorBottomCenterBaseline : odf_context()->drawing_context()->set_textarea_vertical_align(0); break;
}
break;
}break;
case SimpleTypes::Vml::cssptMsoFitShapeToText:
if (vml_style->m_arrProperties[i]->get_Value().bValue == true)
{
odf_context()->drawing_context()->set_text_box_min_size(0,0);
}break;
}
}
if (group)
......@@ -556,11 +560,13 @@ void OoxConverter::convert(OOX::Vml::CTextbox *vml_textbox)
DocxConverter *docx_converter = dynamic_cast<DocxConverter*>(this);
odf_context()->start_text_context();
for (unsigned int i=0 ; i < vml_textbox->m_oTxtbxContent->m_arrItems.size();i++)
{
if (docx_converter)docx_converter->convert(vml_textbox->m_oTxtbxContent->m_arrItems[i]);
for (unsigned int i=0 ; i < vml_textbox->m_oTxtbxContent->m_arrItems.size();i++)
{
if (docx_converter)docx_converter->convert(vml_textbox->m_oTxtbxContent->m_arrItems[i]);
}
odf_context()->drawing_context()->set_text( odf_context()->text_context());
}
odf_context()->drawing_context()->set_text( odf_context()->text_context());
odf_context()->end_text_context();
}
......
......@@ -546,11 +546,7 @@ void OoxConverter::convert(OOX::Drawing::CNonVisualDrawingProps * oox_cnvPr)
std::wstring name = string2std_string(oox_cnvPr->m_sName.get());
odf_context()->drawing_context()->set_name(name);
}
if (oox_cnvPr->m_oId.IsInit())
{
int id =oox_cnvPr->m_oId->GetValue();
odf_context()->drawing_context()->set_z_order(id);
}
//nullable<CString> m_sDescr;
//nullable<SimpleTypes::COnOff<>> m_oHidden;
//nullable<CString> m_sTitle;
......
......@@ -8,10 +8,7 @@
#include "..\progressCallback.h"
static std::wstring string2std_string(CString val)
{
return std::wstring(val.GetBuffer());
}
namespace cpdoccore
{
namespace odf
......
......@@ -1873,13 +1873,26 @@ void DocxConverter::convert(OOX::Logic::CPicture* oox_pic)
}
else if (oox_pic->m_oShapeRect.IsInit())
{
odf_context()->drawing_context()->set_name(L"Rect");
odf_context()->drawing_context()->start_shape(SimpleTypes::shapetypeRect);
OoxConverter::convert(oox_pic->m_oShape.GetPointer());
OoxConverter::convert(oox_pic->m_oShapeRect.GetPointer());
odf_context()->drawing_context()->end_shape();
if ((oox_pic->m_oShapeRect->m_oFilled.IsInit() && oox_pic->m_oShapeRect->m_oFilled->GetValue() == SimpleTypes::booleanFalse) &&
(oox_pic->m_oShapeRect->m_oStroked.IsInit() && oox_pic->m_oShapeRect->m_oStroked->GetValue() == SimpleTypes::booleanFalse))
{
odf_context()->drawing_context()->start_text_box();
OoxConverter::convert(oox_pic->m_oShape.GetPointer());
OoxConverter::convert(oox_pic->m_oShapeRect.GetPointer());
odf_context()->drawing_context()->end_text_box();
}
else
{
odf_context()->drawing_context()->set_name(L"Rect");
odf_context()->drawing_context()->start_shape(SimpleTypes::shapetypeRect);
OoxConverter::convert(oox_pic->m_oShape.GetPointer());
OoxConverter::convert(oox_pic->m_oShapeRect.GetPointer());
odf_context()->drawing_context()->end_shape();
}
}
else if (oox_pic->m_oShapeRoundRect.IsInit())
{
......@@ -2009,7 +2022,7 @@ void DocxConverter::convert(OOX::Logic::CDrawing *oox_drawing)
convert(oox_drawing->m_oInline.GetPointer());
odt_context->end_drawings();
}
void DocxConverter::convert(OOX::Drawing::CAnchor *oox_anchor)
void DocxConverter::convert(OOX::Drawing::CAnchor *oox_anchor)
{
if (oox_anchor == NULL)return;
......@@ -2053,12 +2066,15 @@ void DocxConverter::convert(OOX::Drawing::CAnchor *oox_anchor)
odt_context->drawing_context()->set_horizontal_pos(SimpleTypes::alignhLeft);
}
bool wrap_set = false;
if (oox_anchor->m_oWrapSquare.IsInit())
{
if (oox_anchor->m_oWrapSquare->m_oWrapText.IsInit() && oox_anchor->m_oWrapSquare->m_oWrapText->GetValue() == SimpleTypes::wraptextLargest)
odt_context->drawing_context()->set_wrap_style(odf::style_wrap::Dynamic);
else
odt_context->drawing_context()->set_wrap_style(odf::style_wrap::Parallel);
wrap_set = true;
}
else if (oox_anchor->m_oWrapThrough.IsInit())//style:wrap="run-through" draw:wrap-influence-on-position style:wrap-contour
{
......@@ -2067,16 +2083,18 @@ void DocxConverter::convert(OOX::Drawing::CAnchor *oox_anchor)
else if (oox_anchor->m_oWrapTight.IsInit())
{
odt_context->drawing_context()->set_wrap_style(odf::style_wrap::Parallel);
wrap_set = true;
}
else if (oox_anchor->m_oWrapTopAndBottom.IsInit())
{
odt_context->drawing_context()->set_wrap_style(odf::style_wrap::Parallel);
wrap_set = true;
}
else if (oox_anchor->m_oAllowOverlap.IsInit())
{
odt_context->drawing_context()->set_overlap(oox_anchor->m_oAllowOverlap->ToBool());
}
if (oox_anchor->m_oBehindDoc.IsInit())
if (oox_anchor->m_oBehindDoc.IsInit() && !wrap_set)
{
if (oox_anchor->m_oBehindDoc->ToBool())
{
......@@ -2089,6 +2107,11 @@ void DocxConverter::convert(OOX::Drawing::CAnchor *oox_anchor)
odt_context->drawing_context()->set_object_foreground(true);
}
}
if (oox_anchor->m_oRelativeHeight.IsInit())
{
int id = oox_anchor->m_oRelativeHeight->GetValue();
odf_context()->drawing_context()->set_z_order(id);
}
OoxConverter::convert(oox_anchor->m_oDocPr.GetPointer());
convert(oox_anchor->m_oGraphic.GetPointer());
}
......@@ -3599,15 +3622,15 @@ void DocxConverter::convert(OOX::Logic::CTableRowProperties *oox_table_row_pr, o
switch(oox_table_row_pr->m_oTblHeight->m_oHRule->GetValue())
{
case SimpleTypes::heightruleAtLeast:
table_row_properties->style_table_row_properties_attlist_.style_min_row_height_ = length; break;
table_row_properties->style_table_row_properties_attlist_.style_min_row_height_ = odf::length(length->get_value_unit(odf::length::cm),odf::length::cm); break;
case SimpleTypes::heightruleExact:
table_row_properties->style_table_row_properties_attlist_.style_row_height_ = length; break;
table_row_properties->style_table_row_properties_attlist_.style_row_height_ = odf::length(length->get_value_unit(odf::length::cm),odf::length::cm); break;
case SimpleTypes::heightruleAuto:
table_row_properties->style_table_row_properties_attlist_.style_use_optimal_row_height_ = true; break;
}
}
else
table_row_properties->style_table_row_properties_attlist_.style_min_row_height_ = length;
table_row_properties->style_table_row_properties_attlist_.style_min_row_height_ = odf::length(length->get_value_unit(odf::length::cm),odf::length::cm);
}
}
......
......@@ -25,7 +25,7 @@ using namespace cpdoccore;
namespace Oox2Odf
{
XlsxConverter::XlsxConverter(const std::wstring & path, const ProgressCallback* CallBack)
{
const OOX::CPath oox_path(CString(path.c_str()));
......@@ -132,7 +132,7 @@ void XlsxConverter::convert_sheets()
const OOX::Spreadsheet::CWorkbook *Workbook= xlsx_document->GetWorkbook();
if (!Workbook) return;
CAtlMap<CString, OOX::Spreadsheet::CWorksheet*> &arrWorksheets = xlsx_document->GetWorksheets();
std::map<CString, OOX::Spreadsheet::CWorksheet*> &arrWorksheets = xlsx_document->GetWorksheets();
if(Workbook->m_oSheets.IsInit())
{
......@@ -143,9 +143,9 @@ void XlsxConverter::convert_sheets()
if(pSheet->m_oRid.IsInit())
{
CString sSheetRId = pSheet->m_oRid.get2().ToString();
CAtlMap<CString, OOX::Spreadsheet::CWorksheet*>::CPair* pPairWorksheet = arrWorksheets.Lookup(sSheetRId);
std::map<CString, OOX::Spreadsheet::CWorksheet*>::iterator pItWorksheet = arrWorksheets.find(sSheetRId);
if ((pPairWorksheet) && (pPairWorksheet->m_value))
if (pItWorksheet->second)
{
ods_context->start_sheet();
ods_context->current_table().set_table_name(string2std_string(pSheet->m_oName.get2()));
......@@ -153,7 +153,7 @@ void XlsxConverter::convert_sheets()
pSheet->m_oState->GetValue() == SimpleTypes::Spreadsheet::visibleVeryHidden))
ods_context->current_table().set_table_hidden(true);
convert(pPairWorksheet->m_value);
convert(pItWorksheet->second);
ods_context->end_sheet();
}
}
......@@ -207,14 +207,11 @@ void XlsxConverter::convert(OOX::Spreadsheet::CWorksheet *oox_sheet)
convert(oox_sheet->m_oHyperlinks->m_arrItems[hyp],oox_sheet);
}
//
if(oox_sheet->m_mapComments.GetCount() > 0)
std::map<CString, OOX::Spreadsheet::CCommentItem*>::iterator pos = oox_sheet->m_mapComments.begin();
while ( oox_sheet->m_mapComments.end() != pos )
{
POSITION pos = oox_sheet->m_mapComments.GetStartPosition();
while ( NULL != pos )
{
CAtlMap<CString, OOX::Spreadsheet::CCommentItem*>::CPair* pPair = oox_sheet->m_mapComments.GetNext( pos );
if(pPair->m_value->IsValid())convert(pPair->m_value);
}
convert(pos->second);
pos++;
}
//todooo -
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
......
......@@ -2,6 +2,6 @@
//1
//2
//0
//155
#define INTVER 1,2,0,155
#define STRVER "1,2,0,155\0"
//159
#define INTVER 1,2,0,159
#define STRVER "1,2,0,159\0"
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