Compare commits

...

11 Commits

Author SHA1 Message Date
eae048a8a3 OdfFormatReader - fix bugs conditionalFormatting, number styles, ... 2016-11-22 20:15:30 +03:00
a52c18608d Merge branch 'develop' of https://github.com/ONLYOFFICE/core into develop
* 'develop' of https://github.com/ONLYOFFICE/core:
  for bug 33490
  RtfFormatReader - two and more levels in fields (contents, ...)
  fix bug 33488
2016-11-22 19:00:57 +03:00
7824ce640c up 2016-11-22 19:00:52 +03:00
83bae8fabd for bug 33490 2016-11-22 17:00:55 +03:00
623d89d197 RtfFormatReader - two and more levels in fields (contents, ...) 2016-11-22 14:28:04 +03:00
fb9d2cbf49 fix bug 33488 2016-11-22 14:16:48 +03:00
0d7c8ebc07 for bug 32797 2016-11-21 17:23:23 +03:00
929252f681 RtfFormatReader -fix read spec char in field 2016-11-21 17:17:44 +03:00
2207cee065 x2t version up 2016-11-21 16:10:22 +03:00
467cb760f3 OdfFormatReader - fix backgroud presentation 2016-11-21 16:08:55 +03:00
23718718c4 fix bug #33449 2016-11-21 11:35:56 +03:00
33 changed files with 355 additions and 223 deletions

View File

@ -4404,6 +4404,17 @@ public:
if(m_oMath_rPr.IsNoEmpty())
m_oMath_rPr.Write(&GetRunStringWriter());
}
else if ( c_oSerRunType::arPr == type )
{
PPTX::Logic::RunProperties rPr;
m_oBufferedStream.Skip(1);//skip type
rPr.fromPPTY(&m_oBufferedStream);
rPr.m_name = L"a:rPr";
//todo use one writer
NSBinPptxRW::CXmlWriter oWriter;
rPr.toXmlWriter(&oWriter);
GetRunStringWriter().WriteString(oWriter.GetXmlString());
}
else if ( c_oSerRunType::del == type )
{
TrackRevision oRPrChange;

View File

@ -503,7 +503,8 @@ extern int g_nCurFormatVersion;
footnoteRef = 24,
endnoteRef = 25,
footnoteReference = 26,
endnoteReference = 27
endnoteReference = 27,
arPr = 28
};}
namespace c_oSerImageType{enum c_oSerImageType
{

View File

@ -3966,6 +3966,12 @@ namespace BinDocxRW
brPrs.Write_rPr(pCtrlPr.m_oRPr.get());
m_oBcw.WriteItemEnd(nCurPos2);
}
if ( pCtrlPr.m_oARPr.IsInit() )
{
int nCurPos2 = m_oBcw.WriteItemStart(c_oSerRunType::arPr);
m_oBcw.m_oStream.WriteRecord2(0, pCtrlPr.m_oARPr);
m_oBcw.WriteItemEnd(nCurPos2);
}
if ( pCtrlPr.m_oDel.IsInit() )
{
int nCurPos2 = m_oBcw.WriteItemStart(c_oSerRunType::del);

View File

@ -50,7 +50,7 @@ public:
std::wstring convert(std::wstring const & expr);
// $Лист1.$A$1 -> Лист1!$A$1
std::wstring convert_named_ref(std::wstring const & expr, bool withTableName = true);
std::wstring convert_named_ref(std::wstring const & expr, bool withTableName = true, std::wstring separator = L" ");
//a-la convert without check formula
std::wstring convert_named_expr(std::wstring const & expr, bool withTableName = true);

View File

@ -69,16 +69,16 @@ namespace formulasconvert {
if (splitted.size()==3)
{
table = splitted[0];
ref_first = splitted[1];
ref_last = splitted[2];
table = splitted[0];
ref_first = splitted[1];
ref_last = splitted[2];
return true;
}
if (splitted.size()==4)
{
table = splitted[0];
ref_first = splitted[1];
ref_last = splitted[3];
table = splitted[0];
ref_first = splitted[1];
ref_last = splitted[3];
return true;
}
return false;
@ -300,7 +300,6 @@ namespace formulasconvert {
if (what[1].matched)
{
std::wstring inner = what[1].str();
boost::algorithm::replace_all(inner, L".", L"ТОСHKA");
boost::algorithm::replace_all(inner, L" ", L"PROBEL");
return inner;
}
@ -314,6 +313,7 @@ namespace formulasconvert {
if (what[1].matched)
{
std::wstring inner = what[1].str();
boost::algorithm::replace_all(inner, L".", L"ТОСHKA");
boost::algorithm::replace_all(inner, L"(", L"SCOBCAIN");
boost::algorithm::replace_all(inner, L")", L"SCOBCAOUT");
@ -327,6 +327,8 @@ namespace formulasconvert {
else if (what[2].matched)
{
std::wstring inner = what[2].str();
boost::algorithm::replace_all(inner, L".", L"ТОСHKA");
boost::algorithm::replace_all(inner, L"(", L"SCOBCAIN");
boost::algorithm::replace_all(inner, L")", L"SCOBCAOUT");
@ -407,47 +409,53 @@ namespace formulasconvert {
if (is_forbidden(expr))
return L"NULLFORMULA()";
boost::wregex complexRef(L"('(?!\\s\\'){0,1}.*?')");
std::wstring workstr = expr;
//boost::wregex complexRef(L"('(?!\\s\\'){0,1}.*?')");// Better_Donut.ods- cell(c27)
//std::wstring workstr = boost::regex_replace(
// expr,
// complexRef,
// &replace_point_space,
// boost::match_default | boost::format_all);
std::wstring workstr = boost::regex_replace(
expr,
complexRef,
&replace_point_space,
boost::match_default | boost::format_all);
check_formula(workstr);
bool isFormula = check_formula(workstr);
workstr = boost::regex_replace(
boost::regex_replace(
workstr,
boost::wregex(L"('.*?')|(\".*?\")"),
&convert_scobci, boost::match_default | boost::format_all);
//boost::algorithm::replace_all(workstr, L"'", L"APOSTROF");
replace_cells_range (workstr, true);
replace_semicolons (workstr);
replace_vertical (workstr);
int res_find=0;
if ((res_find = workstr.find(L"CONCATINATE")) > 0)
if (isFormula)
{
//могут быть частично заданы диапазоны
//todooo
boost::algorithm::replace_all(workstr, L"FDIST(", L"_xlfn.F.DIST(");
int res_find=0;
if ((res_find = workstr.find(L"CONCATINATE")) > 0)
{
//могут быть частично заданы диапазоны
//todooo
}
//todooo INDEX((A1:C6~A8:C11),2,2,2) - ???? - INDEX_emb.ods
}
//-----------------------------------------------------------
boost::algorithm::replace_all(workstr, L"PROBEL" , L" ");
boost::algorithm::replace_all(workstr, L"APOSTROF" , L"'");
boost::algorithm::replace_all(workstr, L"TOCHKA" , L".");
boost::algorithm::replace_all(workstr, L"ТОСHKA" , L".");
boost::algorithm::replace_all(workstr, L"SCOBCAIN", L"(");
boost::algorithm::replace_all(workstr, L"SCOBCAOUT", L")");
boost::algorithm::replace_all(workstr, L"SCOBCAIN" , L"(");
boost::algorithm::replace_all(workstr, L"SCOBCAOUT" , L")");
boost::algorithm::replace_all(workstr, L"KVADRATIN", L"[");
boost::algorithm::replace_all(workstr, L"KVADRATIN" , L"[");
boost::algorithm::replace_all(workstr, L"KVADRATOUT", L"]");
boost::algorithm::replace_all(workstr, L"PROBEL", L" ");
boost::algorithm::replace_all(workstr, L"KAVYCHKA", L"\"");
boost::algorithm::replace_all(workstr, L"PROBEL" , L" ");
boost::algorithm::replace_all(workstr, L"KAVYCHKA" , L"\"");
return workstr;
}
@ -535,7 +543,7 @@ namespace formulasconvert {
{
return impl_->convert_chart_distance(expr);
}
std::wstring odf2oox_converter::convert_named_ref(const std::wstring& expr, bool withTableName)
std::wstring odf2oox_converter::convert_named_ref(const std::wstring& expr, bool withTableName, std::wstring separator)
{
boost::wregex complexRef(L"('(?!\\s\\'){0,1}.*?')");// поиск того что в апострофах и замена там
@ -550,6 +558,11 @@ namespace formulasconvert {
impl_->replace_named_ref(workstr, withTableName);
if (separator != L" ")
{
boost::algorithm::replace_all(workstr, L" " , separator);
}
boost::algorithm::replace_all(workstr, L"PROBEL" , L" ");
boost::algorithm::replace_all(workstr, L"APOSTROF" , L"'");
boost::algorithm::replace_all(workstr, L"TOCHKA" , L".");

View File

@ -86,20 +86,28 @@ std::wstring static get_default_file_name(RelsType type)
return L"";
}
}
std::wstring mediaitems::create_file_name(const std::wstring & uri, RelsType type, size_t Num)
std::wstring mediaitems::create_file_name(const std::wstring & uri, RelsType type, bool & isInternal, size_t Num)
{
if (uri.empty()) return L"";
std::wstring sExt;
std::wstring f_name = odf_packet_ + FILE_SEPARATOR_STR + uri;
sExt = detectImageFileExtension(f_name); //4EA0AA6E-479D-4002-A6AA-6D6C88EC6D65.odt - image - "opentbs_added_1.phpxvkeg" = png
if (type == typeImage)
{
sExt = detectImageFileExtension(f_name); //4EA0AA6E-479D-4002-A6AA-6D6C88EC6D65.odt - image - "opentbs_added_1.phpxvkeg" = png
}
else
{
}
if (sExt.empty())
{
int n = uri.find(L"ObjectReplacements");
if (n >= 0)
{
if (!isInternal) return L"";
f_name = odf_packet_ + uri.substr(1, uri.length() - 1);
sExt = detectImageFileExtension(f_name);
}
@ -113,7 +121,7 @@ std::wstring mediaitems::create_file_name(const std::wstring & uri, RelsType typ
}
}
return get_default_file_name(type) + boost::lexical_cast<std::wstring>(Num) + sExt;
return get_default_file_name(type) + std::to_wstring(Num) + sExt;
}
std::wstring mediaitems::detectImageFileExtension(std::wstring &fileName)
@ -139,7 +147,7 @@ std::wstring mediaitems::detectImageFileExtension(std::wstring &fileName)
std::wstring mediaitems::add_or_find(const std::wstring & href, RelsType type, bool & isInternal, std::wstring & ref)
{
const bool isMediaInternal = utils::media::is_internal(href, odf_packet_);
bool isMediaInternal = utils::media::is_internal(href, odf_packet_);
std::wstring sub_path = L"media/";
@ -150,36 +158,41 @@ std::wstring mediaitems::add_or_find(const std::wstring & href, RelsType type, b
}
int number=0;
if ( type == typeChart) number= count_charts+1;
else if ( type == typeImage) number= count_image+1;
else if ( type == typeShape) number= count_shape+1;
else if ( type == typeMedia) number= count_media+1;
if ( type == typeChart) number = count_charts + 1;
else if ( type == typeImage) number = count_image + 1;
else if ( type == typeShape) number = count_shape + 1;
else if ( type == typeMedia) number = count_media + 1;
else
number= items_.size()+1;
number = items_.size()+1;
inputFileName = create_file_name(href, type, number);
inputFileName = create_file_name(href, type, isMediaInternal, number);
std::wstring inputPath = isMediaInternal ? odf_packet_ + FILE_SEPARATOR_STR + href : href;
std::wstring outputPath = isMediaInternal ? ( sub_path + inputFileName) : href;
std::wstring inputPath = isMediaInternal ? odf_packet_ + FILE_SEPARATOR_STR + href : href;
std::wstring outputPath = isMediaInternal ? ( sub_path + inputFileName) : href;
if ( type == typeChart)outputPath= outputPath + L".xml";
if ( type == typeChart) outputPath= outputPath + L".xml";
std::wstring id;
BOOST_FOREACH(item & elm, items_)
for (int i = 0 ; i < items_.size(); i++)
{
if (elm.href == inputPath)
if (items_[i].href == inputPath)
{
id = elm.Id;
outputPath = elm.outputName;
elm.count_add++;
id = items_[i].Id;
outputPath = items_[i].outputName;
items_[i].count_add++;
break;
}
}
if (id.length() < 1)
ref = outputPath;
isInternal = isMediaInternal;
if (id.empty())
{
if ( type == typeChart)
{
id = std::wstring(L"chId") + boost::lexical_cast<std::wstring>(count_charts+1);
id = std::wstring(L"chId") + std::to_wstring(count_charts+1);
count_charts++;
}
else if ( type == typeImage)
@ -190,12 +203,14 @@ std::wstring mediaitems::add_or_find(const std::wstring & href, RelsType type, b
outputPath = outputPath.substr(0, n_svm) + L".png";
}
//------------------------------------------------
id = std::wstring(L"picId") + boost::lexical_cast<std::wstring>(count_image+1);
if (inputFileName.empty()) return L"";
id = std::wstring(L"picId") + std::to_wstring(count_image+1);
count_image++;
}
else
{
id = std::wstring(L"rId") + boost::lexical_cast<std::wstring>(count_shape+1);
id = std::wstring(L"rId") + std::to_wstring(count_shape+1);
count_shape++;
}
@ -204,7 +219,7 @@ std::wstring mediaitems::add_or_find(const std::wstring & href, RelsType type, b
ref = outputPath;
isInternal = isMediaInternal;
return id;
return id;
}
void mediaitems::dump_rels(rels & Rels)

View File

@ -85,7 +85,7 @@ public:
items_array & items() { return items_; }
private:
std::wstring create_file_name (const std::wstring & uri, RelsType type, size_t Num);
std::wstring create_file_name (const std::wstring & uri, RelsType type, bool & isInternal, size_t Num);
std::wstring detectImageFileExtension (std::wstring &fileName);
items_array items_;

View File

@ -108,7 +108,8 @@ void oox_serialize_solid_fill(std::wostream & strm, const _oox_fill & val)
}
void oox_serialize_bitmap_fill(std::wostream & strm, const _oox_fill & val)
{
if (!val.bitmap)return;
if (!val.bitmap) return;
CP_XML_WRITER(strm)
{
CP_XML_NODE(std::wstring(val.bitmap->name_space + L":blipFill"))
@ -116,17 +117,17 @@ 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);
if (val.bitmap->dpi) CP_XML_ATTR(L"a:dpi", *val.bitmap->dpi);
CP_XML_NODE(L"a:blip")
{
if (val.bitmap->isInternal)
{
CP_XML_ATTR(L"xmlns:r", L"http://schemas.openxmlformats.org/officeDocument/2006/relationships");
CP_XML_ATTR(L"r:embed",val.bitmap->rId );
CP_XML_ATTR(L"r:embed", val.bitmap->rId );
}
else
CP_XML_ATTR(L"r:link",val.bitmap->rId );
CP_XML_ATTR(L"r:link", val.bitmap->rId );
if (val.opacity)
{
@ -151,8 +152,8 @@ void oox_serialize_bitmap_fill(std::wostream & strm, const _oox_fill & val)
CP_XML_NODE(L"a:tile")
{
//tx="0" ty="0" sx="100000" sy="100000"
CP_XML_ATTR(L"flip","none");
CP_XML_ATTR(L"algn",L"ctr");
CP_XML_ATTR(L"flip", "none");
CP_XML_ATTR(L"algn", L"ctr");
}
}
else if (val.bitmap->bStretch)
@ -173,7 +174,11 @@ void oox_serialize_bitmap_fill(std::wostream & strm, const _oox_fill & val)
}
void oox_serialize_gradient_fill(std::wostream & strm, const _oox_fill & val)
{
if (!val.gradient)return;
if (!val.gradient)
{
return;
}
CP_XML_WRITER(strm)
{
CP_XML_NODE(L"a:gradFill")
@ -186,8 +191,8 @@ void oox_serialize_gradient_fill(std::wostream & strm, const _oox_fill & val)
{
CP_XML_NODE(L"a:gs")
{
CP_XML_ATTR(L"pos",(int)(col.pos *1000));//%
oox_serialize_srgb(CP_XML_STREAM(),col.color_ref,col.opacity);
CP_XML_ATTR(L"pos", (int)(col.pos * 1000));//%
oox_serialize_srgb(CP_XML_STREAM(), col.color_ref, col.opacity);
}
}
}
@ -234,13 +239,13 @@ void oox_serialize_hatch_fill(std::wostream & strm, const _oox_fill & val)
CP_XML_ATTR(L"prst",val.hatch->preset);
CP_XML_NODE(L"a:fgClr")//опять для ms важно что этот цвет перед back
{
oox_serialize_srgb(CP_XML_STREAM(),val.hatch->color_ref,val.opacity);
oox_serialize_srgb(CP_XML_STREAM(), val.hatch->color_ref, val.opacity);
}
if (val.hatch->color_back_ref)
{
CP_XML_NODE(L"a:bgClr")
{
oox_serialize_srgb(CP_XML_STREAM(),*val.hatch->color_back_ref,val.opacity);
oox_serialize_srgb(CP_XML_STREAM(), *val.hatch->color_back_ref ,val.opacity);
}
}

View File

@ -44,17 +44,18 @@ namespace oox {
class oox_solid_fill;
typedef _CP_PTR(oox_solid_fill) oox_solid_fill_ptr;
class oox_solid_fill
{
public:
std::wstring color;
static oox_solid_fill_ptr create();
};
///////////////////////////////////
class oox_bitmap_fill;
typedef _CP_PTR(oox_bitmap_fill) oox_bitmap_fill_ptr;
class oox_bitmap_fill
{
public:
@ -78,6 +79,7 @@ namespace oox {
/////////////////////////////////////////////////////////
class oox_hatch_fill;
typedef _CP_PTR(oox_hatch_fill) oox_hatch_fill_ptr;
class oox_hatch_fill
{
public:
@ -92,25 +94,26 @@ namespace oox {
////////////////////////////////////////////////////////////
class oox_gradient_fill;
typedef _CP_PTR(oox_gradient_fill) oox_gradient_fill_ptr;
class oox_gradient_fill
{
public:
struct _color_position
{
double pos;
std::wstring color_ref;
double pos;
std::wstring color_ref;
_CP_OPT(double) opacity;
};
static oox_gradient_fill_ptr create();
oox_gradient_fill() : style(0), angle(0)
oox_gradient_fill() : style(0), angle(90)//from top to bottom
{
memset(rect,0,sizeof(double)*4);
memset(rect, 0, sizeof(double) * 4);
}
int style;
double rect[4];
double angle;
int style;
double rect[4];
double angle;
std::vector<_color_position> colors;
@ -119,14 +122,14 @@ namespace oox {
struct _oox_fill
{
_oox_fill() : type(-1){}
oox_gradient_fill_ptr gradient;
oox_hatch_fill_ptr hatch;
oox_bitmap_fill_ptr bitmap;
oox_solid_fill_ptr solid;
_CP_OPT(double) opacity;
int type;
int type;
void clear()
{

View File

@ -454,7 +454,7 @@ void pptx_slide_context::process_images()
std::wstring rId = impl_->get_mediaitems().add_or_find(L"", typeShape, isMediaInternal, ref);
impl_->add_drawing(drawing, isMediaInternal, rId, ref, typeShape);//объект
}else
}else if (!drawing.fill.bitmap->rId.empty())
{
impl_->add_drawing(drawing, isMediaInternal, drawing.fill.bitmap->rId , ref, drawing.type);//объект
}

View File

@ -82,6 +82,8 @@ namespace oox {
//expr
_CP_OPT(std::wstring) formula;
_CP_OPT(std::wstring) formula_type;
_CP_OPT(std::wstring) text;
_CP_OPT(std::wstring) formula2;
//color scale icon set data_bar
std::vector<_cfvo> cfvo;
//color scale data_bar(1 element)
@ -131,12 +133,11 @@ public:
{
CP_XML_ATTR(L"priority", priority++);
if (c.rules[j].dxfId) CP_XML_ATTR(L"dxfId", *c.rules[j].dxfId);
if (c.rules[j].percent) CP_XML_ATTR(L"percent", *c.rules[j].percent);
if (c.rules[j].operator_) CP_XML_ATTR(L"operator", *c.rules[j].operator_);
if (c.rules[j].stopIfTrue) CP_XML_ATTR(L"stopIfTrue", *c.rules[j].stopIfTrue);
//CP_XML_ATTR(L"text" , L"");
if (c.rules[j].dxfId) CP_XML_ATTR(L"dxfId", *c.rules[j].dxfId);
if (c.rules[j].percent) CP_XML_ATTR(L"percent", *c.rules[j].percent);
if (c.rules[j].operator_) CP_XML_ATTR(L"operator", *c.rules[j].operator_);
if (c.rules[j].stopIfTrue) CP_XML_ATTR(L"stopIfTrue", *c.rules[j].stopIfTrue);
if (c.rules[j].text) CP_XML_ATTR(L"text", *c.rules[j].text);
//CP_XML_ATTR(L"rank" , 0);
//CP_XML_ATTR(L"bottom" , 0);
//CP_XML_ATTR(L"equalAverage" , 0);
@ -144,13 +145,20 @@ public:
if (c.rules[j].type == 1)
{
CP_XML_ATTR(L"type", *c.rules[j].formula_type);
if (c.rules[j].formula)
if ((c.rules[j].formula) && (!c.rules[j].formula->empty()))
{
CP_XML_NODE(L"formula")
{
CP_XML_CONTENT(*c.rules[j].formula);
}
}
if ((c.rules[j].formula2) && (!c.rules[j].formula2->empty()))
{
CP_XML_NODE(L"formula")
{
CP_XML_CONTENT(*c.rules[j].formula2);
}
}
}
else if (c.rules[j].type == 2)
{
@ -233,7 +241,7 @@ void xlsx_conditionalFormatting_context::add(std::wstring ref)
formulasconvert::odf2oox_converter converter;
impl_->conditionalFormattings_.push_back(conditionalFormatting());
impl_->conditionalFormattings_.back().ref = converter.convert_named_ref(ref, false);
impl_->conditionalFormattings_.back().ref = converter.convert_named_ref(ref, false, L";");
}
void xlsx_conditionalFormatting_context::add_rule(int type)
@ -244,8 +252,10 @@ void xlsx_conditionalFormatting_context::add_rule(int type)
}
void xlsx_conditionalFormatting_context::set_formula(std::wstring f)
{
formulasconvert::odf2oox_converter converter;
int pos = -1;
std::wstring val;
if ( 0 <= (pos = f.find(L"formula-is(")))
{
impl_->conditionalFormattings_.back().rules.back().formula_type = L"expression";
@ -272,6 +282,7 @@ void xlsx_conditionalFormatting_context::set_formula(std::wstring f)
}
else if (0 <= (pos = f.find(L"top")))
{
impl_->conditionalFormattings_.back().rules.back().formula_type = L"top10";
}
else if (0 <= (pos = f.find(L"!=")))
{
@ -303,13 +314,29 @@ void xlsx_conditionalFormatting_context::set_formula(std::wstring f)
impl_->conditionalFormattings_.back().rules.back().operator_ = L"greaterThan";
val = f.substr(1);
}
else if (0 <= (pos = f.find(L"contains-text")))
{
impl_->conditionalFormattings_.back().rules.back().formula_type = L"containsText";
impl_->conditionalFormattings_.back().rules.back().text = f.substr(15, f.length() - 17);
val.clear();
}
else if (0 <= (pos = f.find(L"between")))
{
impl_->conditionalFormattings_.back().rules.back().operator_ = L"between";
val = f.substr(8, f.length() - 9);
if (0 <= (pos = val.find(L",")))
{
impl_->conditionalFormattings_.back().rules.back().formula2 = converter.convert_named_expr(val.substr(pos + 1));
val = val.substr(0, pos);
}
}
else
{
val = f;
}
}
formulasconvert::odf2oox_converter converter;
impl_->conditionalFormattings_.back().rules.back().formula = converter.convert_named_expr(val);
}
void xlsx_conditionalFormatting_context::set_dataBar(_CP_OPT(int) min, _CP_OPT(int) max)

View File

@ -30,6 +30,7 @@
*
*/
#include <vector>
#include <cpdoccore/xml/utils.h>
#include "xlsx_numFmts.h"
@ -77,7 +78,7 @@ void xlsx_num_fmts::serialize(std::wostream & _Wostream) const
_Wostream << L"<numFmts count=\"" << impl_->formats_.size() << L"\">";
for (size_t i = 0; i < impl_->formats_.size(); ++i)
{
_Wostream << L"<numFmt formatCode=\"" << impl_->formats_[i] <<
_Wostream << L"<numFmt formatCode=\"" << xml::utils::replace_text_to_xml(impl_->formats_[i]) <<
L"\" numFmtId=\"" << impl_->transform_id(i) << "\" />";
}

View File

@ -188,7 +188,12 @@ size_t xlsx_style_manager::Impl::xfId(const odf_reader::text_format_properties_c
void xlsx_style_manager::Impl::serialize(std::wostream & _Wostream)
{
_Wostream << L"<styleSheet xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\">";
_Wostream << L"<styleSheet";
_Wostream << L" xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\"";
_Wostream << L" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"";
_Wostream << L" mc:Ignorable=\"x14ac\"";
_Wostream << L" xmlns:x14ac=\"http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac\"";
_Wostream << L">";
numFmts_.serialize (_Wostream);
fonts_.serialize (_Wostream);
@ -201,8 +206,6 @@ void xlsx_style_manager::Impl::serialize(std::wostream & _Wostream)
cellStyles_.serialize(_Wostream);
dxfs_.serialize(_Wostream);
_Wostream << L"</styleSheet>";
}
@ -253,7 +256,7 @@ size_t xlsx_style_manager::xfId(const odf_reader::text_format_properties_content
const std::wstring &num_format, bool default_set)
{
bool is_visible;
return impl_->xfId(textProp, parProp, cellProp, xlxsCellFormat, num_format,default_set, is_visible);
return impl_->xfId(textProp, parProp, cellProp, xlxsCellFormat, num_format, default_set, is_visible);
}
size_t xlsx_style_manager::xfId(const odf_reader::text_format_properties_content * textProp,

View File

@ -113,7 +113,7 @@ void xlsx_conversion_context::start_document()
std::vector<const odf_reader::style_instance *> instances;
instances.push_back(odfContext.styleContainer().style_default_by_type(odf_types::style_family::TableCell));
instances.push_back(odfContext.styleContainer().style_by_name(L"Default",odf_types::style_family::TableCell,false));
instances.push_back(odfContext.styleContainer().style_by_name(L"Default", odf_types::style_family::TableCell, false));
odf_reader::text_format_properties_content textFormatProperties = calc_text_properties_content(instances);
odf_reader::paragraph_format_properties parFormatProperties = calc_paragraph_properties_content(instances);
@ -124,7 +124,7 @@ void xlsx_conversion_context::start_document()
cellFormat.set_cell_type(XlsxCellType::s);
cellFormat.set_num_format(oox::odf_string_to_build_in(0));
default_style_ = get_style_manager().xfId(&textFormatProperties, &parFormatProperties, &cellFormatProperties, &cellFormat, L"",true);
default_style_ = get_style_manager().xfId(&textFormatProperties, &parFormatProperties, &cellFormatProperties, &cellFormat, L"", true);
}

View File

@ -80,8 +80,8 @@ void calcext_date_is_attr::add_attributes( const xml::attributes_wc_ptr & Attrib
}
// calcext_conditional_formats
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * calcext_conditional_formats::ns = L"calcext";
const wchar_t * calcext_conditional_formats::name = L"conditional-formats";
const wchar_t * calcext_conditional_formats::ns = L"calcext";
const wchar_t * calcext_conditional_formats::name = L"conditional-formats";
void calcext_conditional_formats::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
@ -100,8 +100,8 @@ void calcext_conditional_formats::xlsx_convert(oox::xlsx_conversion_context & Co
// calcext_conditional_format
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * calcext_conditional_format::ns = L"calcext";
const wchar_t * calcext_conditional_format::name = L"conditional-format";
const wchar_t * calcext_conditional_format::ns = L"calcext";
const wchar_t * calcext_conditional_format::name = L"conditional-format";
void calcext_conditional_format::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
@ -126,8 +126,8 @@ void calcext_conditional_format::xlsx_convert(oox::xlsx_conversion_context & Con
// calcext_data_bar
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * calcext_data_bar::ns = L"calcext";
const wchar_t * calcext_data_bar::name = L"data-bar";
const wchar_t * calcext_data_bar::ns = L"calcext";
const wchar_t * calcext_data_bar::name = L"data-bar";
void calcext_data_bar::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
@ -158,8 +158,8 @@ void calcext_data_bar::xlsx_convert(oox::xlsx_conversion_context & Context)
}
// calcext_color_scale
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * calcext_color_scale::ns = L"calcext";
const wchar_t * calcext_color_scale::name = L"color-scale";
const wchar_t * calcext_color_scale::ns = L"calcext";
const wchar_t * calcext_color_scale::name = L"color-scale";
void calcext_color_scale::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
@ -179,8 +179,8 @@ void calcext_color_scale::xlsx_convert(oox::xlsx_conversion_context & Context)
}
// calcext_icon_set
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * calcext_icon_set::ns = L"calcext";
const wchar_t * calcext_icon_set::name = L"icon-set";
const wchar_t * calcext_icon_set::ns = L"calcext";
const wchar_t * calcext_icon_set::name = L"icon-set";
void calcext_icon_set::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
@ -206,8 +206,8 @@ void calcext_icon_set::xlsx_convert(oox::xlsx_conversion_context & Context)
// calcext_formatting_entry
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * calcext_formatting_entry::ns = L"calcext";
const wchar_t * calcext_formatting_entry::name = L"formatting-entry";
const wchar_t * calcext_formatting_entry::ns = L"calcext";
const wchar_t * calcext_formatting_entry::name = L"formatting-entry";
void calcext_formatting_entry::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
@ -226,11 +226,14 @@ void calcext_formatting_entry::xlsx_convert(oox::xlsx_conversion_context & Conte
// calcext_color_scale_entry
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * calcext_color_scale_entry::ns = L"calcext";
const wchar_t * calcext_color_scale_entry::name = L"color_scale_entry";
const wchar_t * calcext_color_scale_entry::ns = L"calcext";
const wchar_t * calcext_color_scale_entry::name = L"color-scale-entry";
void calcext_color_scale_entry::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
CP_APPLY_ATTR(L"calcext:value", calcext_value_);
CP_APPLY_ATTR(L"calcext:type", calcext_type_);
CP_APPLY_ATTR(L"calcext:color", calcext_color_);
}
void calcext_color_scale_entry::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
{
@ -248,7 +251,7 @@ void calcext_color_scale_entry::xlsx_convert(oox::xlsx_conversion_context & Cont
}
// calcext_condition
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * calcext_condition::ns = L"calcext";
const wchar_t * calcext_condition::ns = L"calcext";
const wchar_t * calcext_condition::name = L"condition";
void calcext_condition::add_attributes( const xml::attributes_wc_ptr & Attributes )
@ -286,8 +289,8 @@ void calcext_condition::xlsx_convert(oox::xlsx_conversion_context & Context)
}
// calcext_condition
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * calcext_date_is::ns = L"calcext";
const wchar_t * calcext_date_is::name = L"date-is";
const wchar_t * calcext_date_is::ns = L"calcext";
const wchar_t * calcext_date_is::name = L"date-is";
void calcext_date_is::add_attributes( const xml::attributes_wc_ptr & Attributes )
{

View File

@ -501,7 +501,34 @@ void Compute_GraphicFill(const common_draw_fill_attlist & props, const office_el
}
}
if (props.draw_fill_)
{
fill.type = props.draw_fill_->get_type();
}
switch(fill.type)
{
case 1:
if (!fill.solid) fill.type = -1;
case 2:
if (!fill.bitmap)
{
if (fill.solid) fill.type = 1;
else fill.type = -1;
}
break;
case 3:
if (!fill.gradient)
{
fill.gradient = oox::oox_gradient_fill::create();
}
break;
case 4:
if (!fill.hatch)
{
fill.hatch = oox::oox_hatch_fill::create();
}
break;
}
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

View File

@ -414,12 +414,23 @@ void number_number::oox_convert(oox::num_format_context & Context)
void number_text::oox_convert(oox::num_format_context & Context)
{
std::wostream & strm = Context.output();
std::wstringstream strm;
BOOST_FOREACH(const office_element_ptr & elm, text_)
{
elm->text_to_stream(strm);
}
std::wstring text_ = strm.str();
if (text_ == L"%")
{
}
else
{
text_ = L"\"" + text_ + L"\""; //Book 70.ods Design of Pile Cap.ods
}
Context.output() << text_;
}

View File

@ -753,7 +753,7 @@ void table_table_cell::xlsx_convert(oox::xlsx_conversion_context & Context)
is_style_visible = (styleName.length() > 0 || defaultColumnCellStyle) ? true : false;
xfId_last_set= Context.get_style_manager().xfId(&textFormatProperties, &parFormatProperties, &cellFormatProperties, &cellFormat, num_format,false, is_style_visible);
xfId_last_set= Context.get_style_manager().xfId(&textFormatProperties, &parFormatProperties, &cellFormatProperties, &cellFormat, num_format, false, is_style_visible);
if ( table_table_cell_content_.elements_.size() > 0 ||
!formula.empty() ||

View File

@ -1507,32 +1507,9 @@ namespace NSBinPptxRW
if (sizeof(wchar_t) == 4)
{
wchar_t * sBuffer = new wchar_t[lSize + 1];
memset(sBuffer, 0, lSize + 1);
std::wstring val = NSFile::CUtf8Converter::GetWStringFromUTF16((unsigned short*)m_pDataCur, lSize);
CString res(val.c_str(), val.length());
UTF16* pStrUtf16 = (UTF16 *) m_pDataCur;
UTF32 *pStrUtf32 = (UTF32 *) sBuffer;
// this values will be modificated
const UTF16 *pStrUtf16_Conv = pStrUtf16;
UTF32 *pStrUtf32_Conv = pStrUtf32;
ConversionResult eUnicodeConversionResult =
ConvertUTF16toUTF32 (&pStrUtf16_Conv
, &pStrUtf16[lSize]
, &pStrUtf32_Conv
, &pStrUtf32 [lSize]
, strictConversion);
if (conversionOK != eUnicodeConversionResult)
{
delete []sBuffer;
return _T("");
}
CString res((WCHAR*)sBuffer, lSize);
delete []sBuffer;
m_lPos += len;
m_pDataCur += len;
@ -1557,48 +1534,11 @@ namespace NSBinPptxRW
_UINT32 lSize = len >> 1; //string in char
if (sizeof(wchar_t) == 4)
{
wchar_t * sBuffer = new wchar_t[lSize + 1];
memset(sBuffer, 0, lSize + 1);
std::wstring res = NSFile::CUtf8Converter::GetWStringFromUTF16((unsigned short*)m_pDataCur, lSize);
m_lPos += len;
m_pDataCur += len;
UTF16* pStrUtf16 = (UTF16 *)m_pDataCur;
UTF32 *pStrUtf32 = (UTF32 *)sBuffer;
// this values will be modificated
const UTF16 *pStrUtf16_Conv = pStrUtf16;
UTF32 *pStrUtf32_Conv = pStrUtf32;
ConversionResult eUnicodeConversionResult =
ConvertUTF16toUTF32(&pStrUtf16_Conv
, &pStrUtf16[lSize]
, &pStrUtf32_Conv
, &pStrUtf32[lSize]
, strictConversion);
if (conversionOK != eUnicodeConversionResult)
{
delete[]sBuffer;
return _T("");
}
std::wstring res((WCHAR*)sBuffer, lSize);
delete[]sBuffer;
m_lPos += len;
m_pDataCur += len;
return res;
}
else
{
std::wstring res((WCHAR*)m_pDataCur, lSize);
m_lPos += len;
m_pDataCur += len;
return res;
}
return res;
}
bool CBinaryFileReader::GetArray(BYTE **pBuffer, _INT32 len)

View File

@ -1597,7 +1597,7 @@ bool RtfFieldReader::ExecuteCommand(RtfDocument& oDocument, RtfReader& oReader,C
if ( oNewFieldInst->IsValid() )
{
m_oField.m_pInsert = oNewFieldInst;
m_oField.m_pInsert = oNewFieldInst;
}
}
else if ( L"datafield" == sCommand )
@ -1611,7 +1611,7 @@ bool RtfFieldReader::ExecuteCommand(RtfDocument& oDocument, RtfReader& oReader,C
if ( oNewFieldInst->IsValid() )
{
m_oField.m_pResult = oNewFieldInst;
m_oField.m_pResult = oNewFieldInst;
}
oReader.m_oLex.putString( "}{" );//чтобы не терять после fldrslt
@ -2380,6 +2380,14 @@ bool RtfParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfRead
{
m_oCurTab.m_eKind = RtfTab::tk_tqbar;
m_oCurTab.m_nTab = parameter;
if (!oReader.m_oState->m_oParagraphProp.m_oTabs.m_aTabs.empty())
{
if (oReader.m_oState->m_oParagraphProp.m_oTabs.m_aTabs.back().m_nTab > m_oCurTab.m_nTab)
{
oReader.m_oState->m_oParagraphProp.m_oTabs.m_aTabs.clear();
}
}
oReader.m_oState->m_oParagraphProp.m_oTabs.m_aTabs.push_back( m_oCurTab );
m_oCurTab.SetDefault();
}
@ -2389,6 +2397,14 @@ bool RtfParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfRead
if ( hasParameter )
{
m_oCurTab.m_nTab = parameter;
if (!oReader.m_oState->m_oParagraphProp.m_oTabs.m_aTabs.empty())
{
if (oReader.m_oState->m_oParagraphProp.m_oTabs.m_aTabs.back().m_nTab > m_oCurTab.m_nTab)
{
oReader.m_oState->m_oParagraphProp.m_oTabs.m_aTabs.clear();
}
}
oReader.m_oState->m_oParagraphProp.m_oTabs.m_aTabs.push_back( m_oCurTab );
m_oCurTab.SetDefault();
}

View File

@ -1417,8 +1417,9 @@ private:
RtfAbstractReader reader;
CString sResultSymbol = reader.ExecuteTextInternal( oDocument, oReader, sCharA, false, 0, nSkipChar );
m_oField.m_pResult = RtfFieldInstPtr ( new RtfFieldInst() );
//свойства копировать ? ващето есть дубль - проверить
m_oField.m_pResult = RtfFieldInstPtr ( new RtfFieldInst() );
m_oField.m_pResult->SetDefault();
RtfParagraphPtr pNewPar ( new RtfParagraph() );
RtfCharPtr pNewChar( new RtfChar() );

View File

@ -49,7 +49,7 @@ CString RtfChar::RenderToOOX(RenderParameter oRenderParameter)
{
bInsert = true;
CString sAuthor = m_oProperty.m_nRevauth != PROP_DEF ? poRtfDocument->m_oRevisionTable[ m_oProperty.m_nRevauth] : L"";
CString sAuthor = poRtfDocument->m_oRevisionTable.GetAuthor(m_oProperty.m_nRevauth);
CString sDate(RtfUtility::convertDateTime(m_oProperty.m_nRevdttm).c_str());
sResult += L"<w:ins w:date=\"" + sDate + L"\" w:author=\"" + sAuthor + L"\" w:id=\"" + std::to_wstring(poOOXWriter->m_nCurTrackChangesId++).c_str() + L"\">";
@ -59,7 +59,7 @@ CString RtfChar::RenderToOOX(RenderParameter oRenderParameter)
{
bDelete = true;
CString sAuthor = m_oProperty.m_nRevauthDel != PROP_DEF ? poRtfDocument->m_oRevisionTable[ m_oProperty.m_nRevauthDel ] : L"";
CString sAuthor = poRtfDocument->m_oRevisionTable.GetAuthor(m_oProperty.m_nRevauthDel);
CString sDate(RtfUtility::convertDateTime(m_oProperty.m_nRevdttmDel).c_str());
sResult += L"<w:del w:date=\"" + sDate + L"\" w:author=\"" + sAuthor + L"\" w:id=\"" + std::to_wstring(poOOXWriter->m_nCurTrackChangesId++).c_str() + L"\">";
@ -89,7 +89,7 @@ CString RtfChar::RenderToOOX(RenderParameter oRenderParameter)
{
bInsert = true;
CString sAuthor = m_oProperty.m_nRevauth != PROP_DEF ? poRtfDocument->m_oRevisionTable[ m_oProperty.m_nRevauth] : L"";
CString sAuthor = poRtfDocument->m_oRevisionTable.GetAuthor(m_oProperty.m_nRevauth);
CString sDate(RtfUtility::convertDateTime(m_oProperty.m_nRevdttm).c_str());
sResult += L"<w:ins w:date=\"" + sDate + L"\" w:author=\"" + sAuthor + L"\" w:id=\"" + std::to_wstring(poOOXWriter->m_nCurTrackChangesId++).c_str() + L"\">";
@ -99,7 +99,7 @@ CString RtfChar::RenderToOOX(RenderParameter oRenderParameter)
{
bDelete = true;
CString sAuthor = m_oProperty.m_nRevauthDel != PROP_DEF ? poRtfDocument->m_oRevisionTable[ m_oProperty.m_nRevauthDel ] : L"";
CString sAuthor = poRtfDocument->m_oRevisionTable.GetAuthor(m_oProperty.m_nRevauthDel);
CString sDate(RtfUtility::convertDateTime(m_oProperty.m_nRevdttmDel).c_str());
sResult += L"<w:del w:date=\"" + sDate + L"\" w:author=\"" + sAuthor + L"\" w:id=\"" + std::to_wstring(poOOXWriter->m_nCurTrackChangesId++).c_str() + L"\">";
@ -356,7 +356,7 @@ CString RtfCharSpecial::RenderToOOX(RenderParameter oRenderParameter)
{
bInsert = true;
CString sAuthor = m_oProperty.m_nRevauth != PROP_DEF ? poRtfDocument->m_oRevisionTable[ m_oProperty.m_nRevauth] : L"";
CString sAuthor = poRtfDocument->m_oRevisionTable.GetAuthor(m_oProperty.m_nRevauth);
CString sDate(RtfUtility::convertDateTime(m_oProperty.m_nRevdttm).c_str());
sResult += L"<w:ins w:date=\"" + sDate + L"\" w:author=\"" + sAuthor + L"\" w:id=\"" + std::to_wstring(poOOXWriter->m_nCurTrackChangesId++).c_str() + L"\">";
@ -366,7 +366,7 @@ CString RtfCharSpecial::RenderToOOX(RenderParameter oRenderParameter)
{
bDelete = true;
CString sAuthor = m_oProperty.m_nRevauthDel != PROP_DEF ? poRtfDocument->m_oRevisionTable[ m_oProperty.m_nRevauthDel ] : L"";
CString sAuthor = poRtfDocument->m_oRevisionTable.GetAuthor(m_oProperty.m_nRevauthDel);
CString sDate(RtfUtility::convertDateTime(m_oProperty.m_nRevdttmDel).c_str());
sResult += L"<w:del w:date=\"" + sDate + L"\" w:author=\"" + sAuthor + L"\" w:id=\"" + std::to_wstring(poOOXWriter->m_nCurTrackChangesId++).c_str() + L"\">";

View File

@ -164,7 +164,7 @@ CString RtfField::RenderToOOX(RenderParameter oRenderParameter)
{
bInsert = true;
sAuthor = m_pInsert->m_oCharProperty.m_nRevauth != PROP_DEF ? poRtfDocument->m_oRevisionTable[ m_pInsert->m_oCharProperty.m_nRevauth] : L"";
sAuthor = poRtfDocument->m_oRevisionTable.GetAuthor(m_pInsert->m_oCharProperty.m_nRevauth);
sDate = CString(RtfUtility::convertDateTime(m_pInsert->m_oCharProperty.m_nRevdttm).c_str());
sResult += L"<w:ins w:date=\"" + sDate + L"\" w:author=\"" + sAuthor + L"\" w:id=\"" + std::to_wstring(poOOXWriter->m_nCurTrackChangesId++).c_str() + L"\">";
@ -174,7 +174,7 @@ CString RtfField::RenderToOOX(RenderParameter oRenderParameter)
{
bDelete = true;
sAuthor = m_pInsert->m_oCharProperty.m_nRevauthDel != PROP_DEF ? poRtfDocument->m_oRevisionTable[ m_pInsert->m_oCharProperty.m_nRevauthDel ] : L"";
sAuthor = poRtfDocument->m_oRevisionTable.GetAuthor(m_pInsert->m_oCharProperty.m_nRevauthDel);
sDate = CString(RtfUtility::convertDateTime(m_pInsert->m_oCharProperty.m_nRevdttmDel).c_str());
sResult += L"<w:del w:date=\"" + sDate + L"\" w:author=\"" + sAuthor + L"\" w:id=\"" + std::to_wstring(poOOXWriter->m_nCurTrackChangesId++).c_str() + L"\">";
@ -229,13 +229,15 @@ CString RtfField::RenderToOOX(RenderParameter oRenderParameter)
sResult += props;
sResult += L"<w:fldChar w:fldCharType=\"begin\"/>";
sResult += L"</w:r>";
CString str = Utils::PrepareToXML( m_pInsert->m_pTextItems->RenderToOOX(oNewParametr) );
//-----------
sResult += L"<w:r>";
sResult += L"<w:instrText xml:space=\"preserve\">";
sResult += str;
if (m_pInsert->m_pTextItems)
{
sResult += Utils::PrepareToXML( m_pInsert->m_pTextItems->RenderToOOX(oNewParametr) );
}
sResult += L"</w:instrText></w:r>";
// разделитель
@ -243,11 +245,33 @@ CString RtfField::RenderToOOX(RenderParameter oRenderParameter)
sResult += L"<w:fldChar w:fldCharType=\"separate\"/></w:r>";
//пишем содержание-кэш
sResult += L"<w:r>";
if (!props.IsEmpty())
sResult += props;
sResult += m_pResult->m_pTextItems->RenderToOOX(oNewParametr);
sResult += L"</w:r>";
if ((m_pResult->m_pTextItems) && (m_pResult->m_pTextItems->GetCount() > 0))
{
oNewParametr.nType = RENDER_TO_OOX_PARAM_RUN;
sResult += m_pResult->m_pTextItems->m_aArray[0]->RenderToOOX(oNewParametr);
for (int i = 1; i < m_pResult->m_pTextItems->GetCount(); i++)
{
RtfParagraph *paragraph = dynamic_cast<RtfParagraph *>(m_pResult->m_pTextItems->m_aArray[i].get());
if (paragraph)
{
sResult += L"</w:p>";
sResult += L"<w:p>";
sResult += L"<w:pPr>";
sResult += paragraph->m_oProperty.RenderToOOX(oRenderParameter);
sResult += L"</w:pPr>";
}
sResult += m_pResult->m_pTextItems->m_aArray[i]->RenderToOOX(oNewParametr);
}
}
else
{
sResult += L"<w:r>";
if (!props.IsEmpty())
sResult += props;
sResult += L"</w:r>";
}
//заканчиваем Field
sResult += L"<w:r><w:fldChar w:fldCharType=\"end\"/></w:r>";

View File

@ -466,6 +466,14 @@ public:
i = AddItem(author);
return i;
}
CString GetAuthor(int ind)
{
if (ind == PROP_DEF || ind > m_aArray.size())
return L"";
return m_aArray[ind];
}
};
//class RtfRSIDTable : public IDocumentElement, public ItemContainer<rsidString>

View File

@ -60,7 +60,7 @@ CString RtfOle::RenderToOOX(RenderParameter oRenderParameter)
{
bInsert = true;
CString sAuthor = pCharProps->m_nRevauth != PROP_DEF ? poRtfDocument->m_oRevisionTable[ pCharProps->m_nRevauth] : L"";
CString sAuthor = poRtfDocument->m_oRevisionTable.GetAuthor(pCharProps->m_nRevauth);
CString sDate(RtfUtility::convertDateTime(pCharProps->m_nRevdttm).c_str());
sResult += L"<w:ins w:date=\"" + sDate + L"\" w:author=\"" + sAuthor + L"\" w:id=\"" + std::to_wstring(poOOXWriter->m_nCurTrackChangesId++).c_str() + L"\">";
@ -70,7 +70,7 @@ CString RtfOle::RenderToOOX(RenderParameter oRenderParameter)
{
bDelete = true;
CString sAuthor = pCharProps->m_nRevauthDel != PROP_DEF ? poRtfDocument->m_oRevisionTable[ pCharProps->m_nRevauthDel ] : L"";
CString sAuthor = poRtfDocument->m_oRevisionTable.GetAuthor(pCharProps->m_nRevauthDel);
CString sDate(RtfUtility::convertDateTime(pCharProps->m_nRevdttmDel).c_str());
sResult += L"<w:del w:date=\"" + sDate + L"\" w:author=\"" + sAuthor + L"\" w:id=\"" + std::to_wstring(poOOXWriter->m_nCurTrackChangesId++).c_str() + L"\">";

View File

@ -747,7 +747,7 @@ CString RtfCharProperty::RenderToOOX(RenderParameter oRenderParameter)
{
bInsert = true;
CString sAuthor = m_nRevauth != PROP_DEF ? poRtfDocument->m_oRevisionTable[ m_nRevauth] : L"";
CString sAuthor = poRtfDocument->m_oRevisionTable.GetAuthor(m_nRevauth);
CString sDate(RtfUtility::convertDateTime( m_nRevdttm ).c_str());
sResult += L"<w:ins w:date=\"" + sDate + L"\" w:author=\"" + sAuthor + L"\" w:id=\"" + std::to_wstring(poOOXWriter->m_nCurTrackChangesId++).c_str() + L"\">";
@ -757,7 +757,7 @@ CString RtfCharProperty::RenderToOOX(RenderParameter oRenderParameter)
{
bDelete = true;
CString sAuthor = m_nRevauthDel != PROP_DEF ? poRtfDocument->m_oRevisionTable[ m_nRevauthDel ] : L"";
CString sAuthor = poRtfDocument->m_oRevisionTable.GetAuthor(m_nRevauthDel);
CString sDate(RtfUtility::convertDateTime( m_nRevdttmDel ).c_str());
sResult += L"<w:del w:date=\"" + sDate + L"\" w:author=\"" + sAuthor + L"\" w:id=\"" + std::to_wstring(poOOXWriter->m_nCurTrackChangesId++).c_str() + L"\">";
@ -768,14 +768,14 @@ CString RtfCharProperty::RenderToOOX(RenderParameter oRenderParameter)
if ( PROP_DEF != m_nDeleted )//для rPr в pPr
{
CString sAuthor = m_nRevauthDel != PROP_DEF ? poRtfDocument->m_oRevisionTable[ m_nRevauthDel] : L"";
CString sAuthor = poRtfDocument->m_oRevisionTable.GetAuthor(m_nRevauthDel);
CString sDate(RtfUtility::convertDateTime(m_nRevdttmDel).c_str());
sResult += L"<w:del w:date=\"" + sDate + L"\" w:author=\"" + sAuthor + L"\" w:id=\"" + std::to_wstring(poOOXWriter->m_nCurTrackChangesId++).c_str() + L"\"/>";
}
if ( PROP_DEF != m_nRevised )
{
CString sAuthor = m_nRevauth != PROP_DEF ? poRtfDocument->m_oRevisionTable[ m_nRevauth] : L"";
CString sAuthor = poRtfDocument->m_oRevisionTable.GetAuthor(m_nRevauth);
CString sDate(RtfUtility::convertDateTime(m_nRevdttm).c_str());
sResult += L"<w:ins w:date=\"" + sDate + L"\" w:author=\"" + sAuthor + L"\" w:id=\"" + std::to_wstring(poOOXWriter->m_nCurTrackChangesId++).c_str() + L"\"/>";
@ -962,7 +962,7 @@ CString RtfCharProperty::RenderToOOX(RenderParameter oRenderParameter)
if (m_pOldCharProp)
{
CString sAuthor = m_nCrAuth != PROP_DEF ? poRtfDocument->m_oRevisionTable[ m_nCrAuth] : L"";
CString sAuthor = poRtfDocument->m_oRevisionTable.GetAuthor(m_nCrAuth);
CString sDate(RtfUtility::convertDateTime(m_nCrDate).c_str());
RenderParameter oRenderParameterNew = oRenderParameter;
@ -2168,7 +2168,7 @@ CString RtfParagraphProperty::RenderToOOX(RenderParameter oRenderParameter)
}
if (m_pOldParagraphProp)
{
CString sAuthor = m_nPrAuth != PROP_DEF ? poRtfDocument->m_oRevisionTable[ m_nPrAuth] : L"";
CString sAuthor = poRtfDocument->m_oRevisionTable.GetAuthor(m_nPrAuth);
CString sDate(RtfUtility::convertDateTime(m_nPrDate).c_str());
RenderParameter oRenderParameterNew = oRenderParameter;
@ -2859,19 +2859,19 @@ CString RtfRowProperty::RenderToOOX(RenderParameter oRenderParameter)
m_pOldRowProperty;
//if ( PROP_DEF != oReader.m_oState->m_oCharProp.m_nDeleted )
//{
// CString sAuthor = oReader.m_oState->m_oCharProp.m_nRevauthDel != PROP_DEF ? poRtfDocument->m_oRevisionTable[ oReader.m_oState->m_oCharProp.m_nRevauthDel] : L"";
// CString sAuthor = poRtfDocument->m_oRevisionTable.GetAuthor(oReader.m_oState->m_oCharProp.m_nRevauthDel);
// CString sDate(RtfUtility::convertDateTime(oReader.m_oState->m_oCharProp.m_nRevdttmDel).c_str());
// sResult += L"<w:del w:date=\"" + sDate + L"\" w:author=\"" + sAuthor + L"\" w:id=\"" + std::to_wstring(poOOXWriter->m_nCurTrackChangesId++).c_str() + L"\"/>";
//}
//if ( PROP_DEF != oReader.m_oState->m_oCharProp.m_nRevised )
//{
// CString sAuthor = m_nRevauth != PROP_DEF ? poRtfDocument->m_oRevisionTable[ oReader.m_oState->m_oCharProp.m_nRevauth] : L"";
// CString sAuthor = poRtfDocument->m_oRevisionTable.GetAuthor(oReader.m_oState->m_oCharProp.m_nRevauth);
// CString sDate(RtfUtility::convertDateTime(oReader.m_oState->m_oCharProp.m_nRevdttm).c_str());
//
// sResult += L"<w:ins w:date=\"" + sDate + L"\" w:author=\"" + sAuthor + L"\" w:id=\"" + std::to_wstring(poOOXWriter->m_nCurTrackChangesId++).c_str() + L"\"/>";
//}
CString sAuthor = m_nTrAuth != PROP_DEF ? poRtfDocument->m_oRevisionTable[ m_nTrAuth] : L"";
CString sAuthor = poRtfDocument->m_oRevisionTable.GetAuthor(m_nTrAuth);
CString sDate(RtfUtility::convertDateTime(m_nTrDate).c_str());
RenderParameter oRenderParameterNew = oRenderParameter;

View File

@ -823,7 +823,7 @@ CString RtfSectionProperty::RenderToOOX(RenderParameter oRenderParameter)
}
if (m_pOldSectionProp)
{
CString sAuthor = m_nSrAuth != PROP_DEF ? poRtfDocument->m_oRevisionTable[ m_nSrAuth] : L"";
CString sAuthor = poRtfDocument->m_oRevisionTable.GetAuthor(m_nSrAuth);
CString sDate(RtfUtility::convertDateTime(m_nSrDate).c_str());
RenderParameter oRenderParameterNew = oRenderParameter;

View File

@ -753,7 +753,7 @@ CString RtfShape::RenderToOOXBegin(RenderParameter oRenderParameter)
{
m_bInsert = true;
CString sAuthor = m_oCharProperty.m_nRevauth != PROP_DEF ? poRtfDocument->m_oRevisionTable[ m_oCharProperty.m_nRevauth] : L"";
CString sAuthor = poRtfDocument->m_oRevisionTable.GetAuthor(m_oCharProperty.m_nRevauth);
CString sDate(RtfUtility::convertDateTime(m_oCharProperty.m_nRevdttm).c_str());
sResult += L"<w:ins w:date=\"" + sDate + L"\" w:author=\"" + sAuthor + L"\" w:id=\"" + std::to_wstring(poOOXWriter->m_nCurTrackChangesId++).c_str() + L"\">";
@ -763,7 +763,7 @@ CString RtfShape::RenderToOOXBegin(RenderParameter oRenderParameter)
{
m_bDelete = true;
CString sAuthor = m_oCharProperty.m_nRevauthDel != PROP_DEF ? poRtfDocument->m_oRevisionTable[ m_oCharProperty.m_nRevauthDel ] : L"";
CString sAuthor = poRtfDocument->m_oRevisionTable.GetAuthor(m_oCharProperty.m_nRevauthDel);
CString sDate(RtfUtility::convertDateTime(m_oCharProperty.m_nRevdttmDel).c_str());
sResult += L"<w:del w:date=\"" + sDate + L"\" w:author=\"" + sAuthor + L"\" w:id=\"" + std::to_wstring(poOOXWriter->m_nCurTrackChangesId++).c_str() + L"\">";

View File

@ -600,6 +600,14 @@ namespace OOX
std::wstring sName = oReader.GetName();
if ( _T("w:rPr") == sName )
m_oRPr = oReader;
else if ( _T("a:rPr") == sName )
{
CString sXml = oReader.GetOuterXml();
XmlUtils::CXmlNode node;
node.FromXmlString(sXml.GetBuffer());
sXml.ReleaseBuffer();
m_oARPr = node;
}
else if ( _T("w:ins") == sName )
m_oIns = oReader;
else if ( _T("w:del") == sName )
@ -612,6 +620,8 @@ namespace OOX
if ( m_oRPr.IsInit() )
sResult += m_oRPr->toXML();
if ( m_oARPr.IsInit() )
sResult += m_oARPr->toXML();
if ( m_oIns.IsInit() )
sResult += m_oIns->toXML();
if ( m_oDel.IsInit() )
@ -629,6 +639,7 @@ namespace OOX
public:
//Childs
nullable<OOX::Logic::CRunProperty> m_oRPr;
nullable<PPTX::Logic::RunProperties> m_oARPr;
nullable<OOX::Logic::CRPrChange> m_oIns;
nullable<OOX::Logic::CRPrChange> m_oDel;
};

View File

@ -373,7 +373,13 @@ namespace OOX
if(false == pFont->m_oRFont.IsInit())
{
pFont->m_oRFont.Init();
pFont->m_oRFont->m_sVal = _T("Arial");
pFont->m_oRFont->m_sVal = _T("Calibri");
}
if(false == pFont->m_oScheme.IsInit())
{
pFont->m_oScheme.Init();
pFont->m_oScheme->m_oFontScheme.Init();
pFont->m_oScheme->m_oFontScheme->SetValue(SimpleTypes::Spreadsheet::fontschemeMinor);
}
if(false == pFont->m_oSz.IsInit() || false == pFont->m_oSz->m_oVal.IsInit())
{

View File

@ -749,6 +749,6 @@
#define ASC_MENU_EVENT_TYPE_CHANGE_COLOR_SCHEME 2415 // SET(int)
#define ASC_MENU_EVENT_TYPE_AUTH_PARTICIPANTS_CHANGED 2416
#define ASC_MENU_EVENT_TYPE_LOST_CONNECTION 2420
#endif //_BUILD_EDITOR_DEFINES_CROSSPLATFORM_H_

View File

@ -542,7 +542,7 @@ namespace NSFile
int nCurrent = 0;
while (nCurrent < nCount)
{
if (*pShort < 0xD800 || *pShort > 0xDFFF)
if (*pShort < 0xD800 || *pShort > 0xDBFF)
{
*pWCurrent = (wchar_t)(*pShort);
++pShort;
@ -550,7 +550,7 @@ namespace NSFile
}
else
{
*pWCurrent = (wchar_t)((((pShort[0]) & 0x03FF) << 10) | ((pShort[1]) & 0x03FF));
*pWCurrent = (wchar_t)(((((pShort[0] - 0xD800) & 0x03FF) << 10) | ((pShort[1] - 0xDC00) & 0x03FF)) + 0x10000);
pShort += 2;
nCurrent += 2;
}

View File

@ -7,7 +7,7 @@
QT -= core
QT -= gui
VERSION = 2.0.2.409
VERSION = 2.0.2.410
DEFINES += INTVER=$$VERSION
TARGET = x2t