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

(1.0.1.173): ASCOfficeOdfFile

22840 (fix размеров картинки)
22844 (fix внешних ссылок картинок)

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@53961 954022d7-b5bf-4e40-9824-e11837661b57
parent cfeef5dc
......@@ -2,6 +2,6 @@
//1
//0
//1
//170
#define INTVER 1,0,1,170
#define STRVER "1,0,1,170\0"
//174
#define INTVER 1,0,1,174
#define STRVER "1,0,1,174\0"
......@@ -30,8 +30,9 @@ int PresentationEditor(int argc, _TCHAR* argv[])
HR_RET(officeEditor.CoCreateInstance(__uuidof(Editor::CAVSPresentationEditor)));
boost::timer t1;
hr = officeEditor->ConvertToPPTY(ATL::CComBSTR(argv[1]),ATL::CComBSTR(argv[2]));
//hr = officeEditor->OpenFile(ATL::CComBSTR(argv[1]));
//hr = officeEditor->ConvertToPPTY(ATL::CComBSTR(argv[1]),ATL::CComBSTR(argv[2]));
hr = officeEditor->OpenFile(ATL::CComBSTR(argv[1]));
officeEditor->Save(1,ATL::CComBSTR(argv[2]));
std::cout << "\n\nTime : " << t1.elapsed() << "\n";
return 0;
}
......
......@@ -332,6 +332,14 @@ std::wstring odf2oox_converter::Impl::convert_chart_distance(const std::wstring&
cells_out.append(c);
cells_out.append(L":");
}
int res1 = sheet.find(L"-");
int res2 = sheet.find(L"'");
if (res1>=0 && !(res2==0))
{
sheet = L"'" + sheet + L"'";
}
distance_out.push_back(sheet+L"!"+cells_out.substr(0, cells_out.size()-1));
}
std::wstring result;
......
......@@ -60,7 +60,7 @@ std::pair<float,float> GetMaxDigitSizePixelsImpl(const wchar_t * fontName, float
return std::pair<float,float>(7,8);
}
if (width> maxWidth)
maxWidth = width;
if (height>maxHeight)
......
......@@ -84,12 +84,12 @@ void oox_serialize_bitmap_fill(std::wostream & strm, const _oox_fill & val)
{
if (val.bitmap->rotate) CP_XML_ATTR(L"a:rotWithShape",*(val.bitmap->rotate));
else CP_XML_ATTR(L"a:rotWithShape",1);
if (val.bitmap->dpi) CP_XML_ATTR(L"a:dpi",*val.bitmap->dpi);
CP_XML_NODE(L"a:blip")
{
if (val.bitmap->isInternal)
if (val.bitmap->isInternal)
{
CP_XML_ATTR(L"r:embed",val.bitmap->rId );
CP_XML_ATTR(L"xmlns:r", L"http://schemas.openxmlformats.org/officeDocument/2006/relationships");
......
......@@ -400,8 +400,20 @@ void pptx_slide_context::process_images()
std::wstring ref;///
bool isMediaInternal = false;
drawing.fill.bitmap->rId = impl_->get_mediaitems().add_or_find(pic.xlink_href_, drawing.type, isMediaInternal, ref);
impl_->add_drawing(drawing, isMediaInternal, drawing.fill.bitmap->rId , ref, drawing.type);
drawing.fill.bitmap->rId = impl_->get_mediaitems().add_or_find(pic.xlink_href_, mediaitems::typeImage, isMediaInternal, ref);
if (drawing.type == mediaitems::typeShape)
{
impl_->add_additional_rels(isMediaInternal, drawing.fill.bitmap->rId, ref, mediaitems::typeImage);// , ref
isMediaInternal=true;
std::wstring rId = impl_->get_mediaitems().add_or_find(L"", mediaitems::typeShape, isMediaInternal, ref);
impl_->add_drawing(drawing, isMediaInternal, rId, ref, mediaitems::typeShape);//
}else
{
impl_->add_drawing(drawing, isMediaInternal, drawing.fill.bitmap->rId , ref, drawing.type);//
}
}
}
......
......@@ -23,11 +23,14 @@ std::wostream & operator << (std::wostream & strm, xlsx_drawing_position::type_t
}
void xlsx_serialize_text(std::wostream & strm, const std::vector<odf::_property> & properties)
{
CP_XML_WRITER(strm)
{
_CP_OPT(std::wstring) strTextContent;
odf::GetProperty(properties,L"text-content",strTextContent);
_CP_OPT(std::wstring) strTextContent;
odf::GetProperty(properties,L"text-content",strTextContent);
if (!strTextContent)return;
if (strTextContent.get().length()<1)return;
CP_XML_WRITER(strm)
{
CP_XML_NODE(L"xdr:txBody")
{
oox_serialize_bodyPr(CP_XML_STREAM(),properties);
......
......@@ -323,9 +323,20 @@ void xlsx_drawing_context::process_images(xlsx_table_metrics & table_metrics)
drawing.fill.bitmap->bCrop = odf::parse_clipping(pic.clipping_string_,fileName,drawing.fill.bitmap->cropRect);
drawing.fill.bitmap->bStretch = true;
drawing.fill.bitmap->rId = impl_->get_mediaitems().add_or_find(pic.xlink_href_, drawing.type, isMediaInternal, ref);
impl_->add_drawing(drawing, isMediaInternal, drawing.fill.bitmap->rId , ref, drawing.type);
drawing.fill.bitmap->rId = impl_->get_mediaitems().add_or_find(pic.xlink_href_, mediaitems::typeImage, isMediaInternal, ref);
if (drawing.type == mediaitems::typeShape)
{
impl_->add_drawing(isMediaInternal, drawing.fill.bitmap->rId, ref, mediaitems::typeImage);// , ref
isMediaInternal=true;
std::wstring rId = impl_->get_mediaitems().add_or_find(L"", mediaitems::typeShape, isMediaInternal, ref);
impl_->add_drawing(drawing, isMediaInternal, rId, ref, mediaitems::typeShape);//
}else
{
impl_->add_drawing(drawing, isMediaInternal, drawing.fill.bitmap->rId , ref, mediaitems::typeImage);//
}
}
}
}
......
......@@ -24,6 +24,7 @@
#include "xlink.h"
#include "drawfill.h"
#include "clockvalue.h"
#include "stylerepeat.h"
#define _CP_APPLY_PROP(A, B) \
if (B) \
......@@ -59,7 +60,7 @@ public:
_CP_OPT(std::wstring) draw_opacity_name_;
_CP_OPT(bool) draw_fill_hatch_solid_;
_CP_OPT(std::wstring) style_repeat_;//no-repeat,repeat,stretch
_CP_OPT(style_repeat) style_repeat_;
};
// common-horizontal-margin-attlist
......
......@@ -216,7 +216,7 @@ void Compute_HatchFill(draw_hatch * image_style,oox::oox_hatch_fill_ptr fill)
else fill->preset = L"openDmnd";
break;
case hatch_style::triple:
fill->preset = L"pkt5";
fill->preset = L"pct5";
break;
}
}
......@@ -359,10 +359,19 @@ void Compute_GraphicFill(const common_draw_fill_attlist & props, styles_lite_con
}
}
}
if (props.style_repeat_ && fill.bitmap)
if (fill.bitmap)
{
if (*props.style_repeat_== L"repeat") fill.bitmap->bTile = true;
if (*props.style_repeat_== L"stretch") fill.bitmap->bStretch = true;
if (props.style_repeat_)
{
switch(props.style_repeat_->get_type())
{
case style_repeat::Repeat : fill.bitmap->bTile = true;
break;
case style_repeat::Stretch :fill.bitmap->bStretch = true;
break;
}
}else
fill.bitmap->bTile = true;
}
if (props.draw_fill_gradient_name_)
{
......
......@@ -66,13 +66,17 @@ void draw_frame::pptx_convert(oox::pptx_conversion_context & Context)
const _CP_OPT(length) svg_widthVal = common_draw_attlists_.rel_size_.common_draw_size_attlist_.svg_width_;
const _CP_OPT(length) svg_heightVal = common_draw_attlists_.rel_size_.common_draw_size_attlist_.svg_height_;
double width_pt=0, height_pt =0;
if (svg_widthVal && svg_heightVal)
{
const double width_pt = svg_widthVal.get_value_or(length(0)).get_value_unit(length::pt);
const double height_pt = svg_heightVal.get_value_or(length(0)).get_value_unit(length::pt);
const double x_pt = common_draw_attlists_.position_.svg_x_.get_value_or(length(0)).get_value_unit(length::pt);
const double y_pt = common_draw_attlists_.position_.svg_y_.get_value_or(length(0)).get_value_unit(length::pt);
double x_pt = common_draw_attlists_.position_.svg_x_.get_value_or(length(0)).get_value_unit(length::pt);
double y_pt = common_draw_attlists_.position_.svg_y_.get_value_or(length(0)).get_value_unit(length::pt);
if (x_pt <0) x_pt =0;
if (y_pt <0) y_pt =0;
Context.get_slide_context().set_rect(width_pt, height_pt, x_pt, y_pt);
}
......
......@@ -29,7 +29,6 @@
#include "style_ref.h"
#include "dropcaplength.h"
#include "fobreak.h"
#include "stylerepeat.h"
#include "styleposition.h"
#include "borderwidths.h"
......
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