Compare commits

..

21 Commits

Author SHA1 Message Date
eb29cee9ad Merge branch 'hotfix/v4.2.3' 2016-12-23 14:22:04 +03:00
6e3b7b1146 thumbnail error with aspect 2016-12-16 12:17:10 +03:00
80d95d41c5 save to pdf (only first page support) 2016-12-14 16:56:56 +03:00
13d57361e4 Merge branch 'hotfix/v4.2.1' 2016-12-06 14:52:20 +03:00
e6c334199f DocFormatReader - fix users file 2016-12-05 15:51:49 +03:00
a639fc9eaf Revert "Merge branch 'develop' into hotfix/v4.2.1"
This reverts commit 9cc54393a0, reversing
changes made to 29b4a10435.
2016-12-05 15:37:35 +03:00
9cc54393a0 Merge branch 'develop' into hotfix/v4.2.1 2016-12-05 15:31:00 +03:00
16386f4b5c DocFormatReaer - users file fix
OdfFormatReader - fix alphabetic text index
2016-12-05 15:17:40 +03:00
149c0ae72a Merge tag 'v4.2.0' into develop
v4.2.0 v4.2.0
2016-12-05 11:39:08 +03:00
29b4a10435 Merge branch 'release/v4.2.0' 2016-12-05 11:39:06 +03:00
1cf9401e0a Removed version number 2016-12-02 18:43:51 +03:00
c6a05e493f OdfFormatReader - .. 2016-12-01 20:06:19 +03:00
82e82971d0 Changed architecture detection for linux and macos 2016-12-01 18:00:15 +03:00
4b8c2b4f6d Update Makefile 2016-12-01 16:09:25 +03:00
a7e3158c06 Merge branch 'release/v4.2.0' into develop 2016-11-30 16:18:25 +03:00
b75495c4ba write tableStyle without tableStyleElement 2016-11-30 12:21:01 +03:00
49939a7f19 build error (macOS, clang) 2016-11-25 18:00:33 +03:00
e690aa0c53 . 2016-11-25 16:01:03 +03:00
bb4483fd7d Merge branch 'develop' of https://github.com/ONLYOFFICE/core into develop
* 'develop' of https://github.com/ONLYOFFICE/core:
  OdfFormatReader - fix errors ...
2016-11-25 12:08:47 +03:00
b93c7a2620 mobile-coautoring 2016-11-25 12:08:42 +03:00
42c94d5cd0 OdfFormatReader - fix errors ... 2016-11-24 18:23:41 +03:00
8 changed files with 32 additions and 24 deletions

View File

@ -87,19 +87,19 @@ namespace DocFileFormat
case sprmOldTDefTable:
case sprmTDefTable:
{ //table definition
{
//table definition
SprmTDefTable tDef( iter->Arguments, iter->argumentsSize );
//Workaround for retrieving the indent of the table:
//In some files there is a indent but no sprmTWidthIndent is set.
//For this cases we can calculate the indent of the table by getting the
//first boundary of the TDef and adding the padding of the cells
tblIndent = FormatUtils::BytesToInt16( iter->Arguments, 1, iter->argumentsSize );
//add the gabHalf
tblIndent += gabHalf;
//If there follows a real sprmTWidthIndent, this value will be overwritten
tblIndent = (std::max)((int)tblIndent,0);
//tblIndent = (std::max)((int)tblIndent,0); //cerere.doc
}
break;

View File

@ -865,13 +865,17 @@ void common_draw_docx_convert(oox::docx_conversion_context & Context, const unio
if (attlists_.rel_size_.style_rel_width_)
{
int type = attlists_.rel_size_.style_rel_width_->get_type();
drawing.pctWidth = attlists_.rel_size_.style_rel_width_->get_percent().get_value();
int type = attlists_.rel_size_.style_rel_width_->get_type();
if (type == odf_types::percent_or_scale::Percent)
drawing.pctWidth = attlists_.rel_size_.style_rel_width_->get_percent().get_value();
}
if (attlists_.rel_size_.style_rel_height_ )
{
int type = attlists_.rel_size_.style_rel_height_->get_type();
drawing.pctHeight = attlists_.rel_size_.style_rel_height_->get_percent().get_value();
int type = attlists_.rel_size_.style_rel_height_->get_type();
if (type == odf_types::percent_or_scale::Percent)
drawing.pctHeight = attlists_.rel_size_.style_rel_height_->get_percent().get_value();
}
}
@ -1286,7 +1290,10 @@ void draw_text_box::docx_convert(oox::docx_conversion_context & Context)
if (drawing.cx > max_x) drawing.cy = max_x;
}
if (auto_fit_shape)
{
drawing.additional.push_back(_property(L"text-wrap" , 0));
drawing.additional.push_back(_property(L"auto-grow-height", auto_fit_shape));
}
else if (auto_fit_text)
drawing.additional.push_back(_property(L"fit-to-size", auto_fit_text));

View File

@ -115,13 +115,13 @@ void table_format_properties::docx_convert(oox::docx_conversion_context & Contex
if (style_rel_width_)
{
int w_w = (int)(0.5 + 50.0 * style_rel_width_->get_value());
_tblPr << L"<w:tblW w:type=\"pct\" w:w=\"" << w_w << "\" />";
_tblPr << L"<w:tblW w:type=\"pct\" w:w=\"" << w_w << "\"/>";
}
else if (style_width_)
{
int w_w = (int)(0.5 + 20.0 * style_width_->get_value_unit(length::pt));
if (w_w > 31680)w_w = 31680;
_tblPr << L"<w:tblW w:type=\"dxa\" w:w=\"" << w_w << "\" />";
_tblPr << L"<w:tblW w:type=\"dxa\" w:w=\"" << w_w << "\"/>";
}
else
{
@ -137,7 +137,7 @@ void table_format_properties::docx_convert(oox::docx_conversion_context & Contex
if (table_align_)
{
std::wstring w_val = L"left";
if (table_align_->get_type() == table_align::Margins)
if (table_align_->get_type() == table_align::Margins || table_align_->get_type() == table_align::Left)
{
if (common_horizontal_margin_attlist_.fo_margin_left_ && common_horizontal_margin_attlist_.fo_margin_right_)
{
@ -147,19 +147,15 @@ void table_format_properties::docx_convert(oox::docx_conversion_context & Contex
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\" />";
_tblPr << L"<w:tblInd w:w=\"" << indent.get_value_unit(odf_types::length::pt) * 20 << "\" w:type=\"dxa\" />";
}
}
else
else //if (table_align_->get_type() == table_align::Center)
w_val = boost::lexical_cast<std::wstring>(*table_align_);
_tblPr << L"<w:jc w:val=\"" << w_val << "\" />";
}
if (table_align_ && table_align_->get_type() == table_align::Center)
{
// TODO ()
}
_tblPr << "<w:tblLayout w:type=\"fixed\" />";
if (common_background_color_attlist_.fo_background_color_)

View File

@ -529,10 +529,11 @@ namespace NSDoctRenderer
if (js_func_get_file_s->IsFunction())
{
v8::Handle<v8::Function> func_get_file_s = v8::Handle<v8::Function>::Cast(js_func_get_file_s);
int nArgument = pParams->m_nSaveToPDFParams;
if (pParams->m_bIsOnlyOnePage)
args[0] = v8::Int32::New(isolate, pParams->m_nSaveToPDFParams);
else
args[0] = v8::Int32::New(isolate, 0x0100);
nArgument |= 0x0100;
args[0] = v8::Int32::New(isolate, nArgument);
v8::Local<v8::Value> js_result2 = func_get_file_s->Call(global_js, 1, args);
if (try_catch.HasCaught())

View File

@ -218,7 +218,7 @@ namespace NSOnlineOfficeBinToPdf
double h = oInfo.arSizes[nPageIndex].height;
double dKoef1 = nRasterW / w;
double dKoef2 = nRasterW / h;
double dKoef2 = nRasterH / h;
if (dKoef1 > dKoef2)
dKoef1 = dKoef2;

View File

@ -288,8 +288,12 @@ namespace PdfReader
oFrame.put_Height(nHeight);
oFrame.put_Stride(-4 * nWidth);
oRenderer.CreateFromBgraFrame(&oFrame);
oRenderer.CreateFromBgraFrame(&oFrame);
oRenderer.SetSwapRGB(false);
dWidth *= 25.4 / dDpiX;
dHeight *= 25.4 / dDpiY;
oRenderer.put_Width(dWidth);
oRenderer.put_Height(dHeight);

View File

@ -1,5 +1,5 @@
[![License](https://img.shields.io/badge/License-GNU%20AGPL%20V3-green.svg?style=flat)](http://www.gnu.org/licenses/agpl-3.0.ru.html) ![Release](https://img.shields.io/badge/Release-v4.1.2-blue.svg?style=flat) ![x2tconverter](https://img.shields.io/badge/x2tconverter-v2.0.2.376-blue.svg?style=flat) ![Platforms Windows | OS X | Linux](https://img.shields.io/badge/Platforms-Windows%20%7C%20OS%20X%20%7C%20Linux%20-lightgray.svg?style=flat)
[![License](https://img.shields.io/badge/License-GNU%20AGPL%20V3-green.svg?style=flat)](http://www.gnu.org/licenses/agpl-3.0.ru.html) ![x2tconverter](https://img.shields.io/badge/x2tconverter-v2.0.2.376-blue.svg?style=flat) ![Platforms Windows | OS X | Linux](https://img.shields.io/badge/Platforms-Windows%20%7C%20OS%20X%20%7C%20Linux%20-lightgray.svg?style=flat)
## Core
Server core components which are a part of [ONLYOFFICE Document Server][2]. Enable the conversion between the most popular office document formats: DOC, DOCX, ODT, RTF, TXT, PDF, HTML, EPUB, XPS, DjVu, XLS, XLSX, ODS, CSV, PPT, PPTX, ODP.

View File

@ -1796,7 +1796,7 @@ namespace NExtractTools
pReader->GetPageInfo(i, &dWidth, &dHeight, &dPageDpiX, &dPageDpiY);
double dKoef1 = nRasterWCur / dWidth;
double dKoef2 = nRasterWCur / dHeight;
double dKoef2 = nRasterHCur / dHeight;
if (dKoef1 > dKoef2)
dKoef1 = dKoef2;