mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-02-20 14:56:14 +08:00
Compare commits
16 Commits
core-windo
...
core-windo
| Author | SHA1 | Date | |
|---|---|---|---|
| ddb708eb62 | |||
| 429c0a5a37 | |||
| 4c12ba9c1a | |||
| eae048a8a3 | |||
| a52c18608d | |||
| 7824ce640c | |||
| 83bae8fabd | |||
| 623d89d197 | |||
| fb9d2cbf49 | |||
| 0d7c8ebc07 | |||
| 929252f681 | |||
| 2207cee065 | |||
| 467cb760f3 | |||
| 23718718c4 | |||
| 3c73f692d0 | |||
| 32d90264d3 |
@ -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;
|
||||
|
||||
@ -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
|
||||
{
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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".");
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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_;
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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()
|
||||
{
|
||||
|
||||
@ -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);//объект
|
||||
}
|
||||
|
||||
@ -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,18 +252,30 @@ 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";
|
||||
val = f.substr(11, f.size() - 12);
|
||||
|
||||
if (0 == (pos = val.find(L"\""))) //Raport_7A.ods или выкинуть ограждающие кавычки с формулы?
|
||||
{
|
||||
impl_->conditionalFormattings_.back().rules.back().text = val;
|
||||
val.clear();
|
||||
}
|
||||
|
||||
impl_->conditionalFormattings_.back().rules.back().formula = converter.convert(val);
|
||||
}
|
||||
else if (0 <= (pos = f.find(L"is-between(")))
|
||||
{
|
||||
impl_->conditionalFormattings_.back().rules.back().formula = converter.convert_named_expr(val);
|
||||
}
|
||||
else if (0 <= (pos = f.find(L"is-time(")))
|
||||
{
|
||||
impl_->conditionalFormattings_.back().rules.back().formula = converter.convert_named_expr(val);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -263,54 +283,78 @@ void xlsx_conditionalFormatting_context::set_formula(std::wstring f)
|
||||
|
||||
if (0 <= (pos = f.find(L"!empty")))
|
||||
{
|
||||
val = converter.convert_named_expr( f );
|
||||
}
|
||||
else if (0 <= (pos = f.find(L"empty")))
|
||||
{
|
||||
val = converter.convert_named_expr( f );
|
||||
}
|
||||
else if (0 <= (pos = f.find(L"bottom")))
|
||||
{
|
||||
val = converter.convert_named_expr( f );
|
||||
}
|
||||
else if (0 <= (pos = f.find(L"top")))
|
||||
{
|
||||
impl_->conditionalFormattings_.back().rules.back().formula_type = L"top10";
|
||||
val = converter.convert_named_expr( f );
|
||||
}
|
||||
else if (0 <= (pos = f.find(L"!=")))
|
||||
{
|
||||
impl_->conditionalFormattings_.back().rules.back().operator_ = L"notEqual";
|
||||
val = f.substr(2);
|
||||
val = converter.convert_named_expr( f.substr(2) );
|
||||
}
|
||||
else if (0 <= (pos = f.find(L"<=")))
|
||||
{
|
||||
impl_->conditionalFormattings_.back().rules.back().operator_ = L"lessThanOrEqual";
|
||||
val = f.substr(2);
|
||||
val = converter.convert_named_expr( f.substr(2) );
|
||||
}
|
||||
else if (0 <= (pos = f.find(L">=")))
|
||||
{
|
||||
impl_->conditionalFormattings_.back().rules.back().operator_ = L"greaterThanOrEqual";
|
||||
val = f.substr(2);
|
||||
val = converter.convert_named_expr( f.substr(2) );
|
||||
}
|
||||
else if (0 <= (pos = f.find(L"=")))
|
||||
{
|
||||
impl_->conditionalFormattings_.back().rules.back().operator_ = L"equal";
|
||||
val = f.substr(1);
|
||||
val = converter.convert_named_expr( f.substr(1) );
|
||||
}
|
||||
else if (0 <= (pos = f.find(L"<")))
|
||||
{
|
||||
impl_->conditionalFormattings_.back().rules.back().operator_ = L"lessThan";
|
||||
val = f.substr(1);
|
||||
val = converter.convert_named_expr( f.substr(1) );
|
||||
}
|
||||
else if (0 <= (pos = f.find(L">")))
|
||||
{
|
||||
impl_->conditionalFormattings_.back().rules.back().operator_ = L"greaterThan";
|
||||
val = f.substr(1);
|
||||
val = converter.convert_named_expr( 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);
|
||||
}
|
||||
val = converter.convert_named_expr( val );
|
||||
}
|
||||
else
|
||||
{
|
||||
val = f;
|
||||
val = converter.convert( f );
|
||||
}
|
||||
|
||||
if (!val.empty())
|
||||
impl_->conditionalFormattings_.back().rules.back().formula = val;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
|
||||
@ -471,6 +471,9 @@ void xlsx_drawing_context::process_position_properties(drawing_object_descriptio
|
||||
x = obj.anchor_x_ - cx;
|
||||
y = obj.anchor_y_ - cy;
|
||||
|
||||
if (x < 0) x = 0;
|
||||
if (y < 0) y = 0; // calcul dun MS.ods
|
||||
|
||||
to = pos_anchor;
|
||||
from = table_metrics.calc(x, y);
|
||||
|
||||
|
||||
@ -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) << "\" />";
|
||||
}
|
||||
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -40,15 +40,15 @@ namespace oox
|
||||
|
||||
struct region
|
||||
{
|
||||
region(size_t sCell, double sPos, size_t c, double l) : start_cell(sCell),
|
||||
region(int sCell, double sPos, int c, double l) : start_cell(sCell),
|
||||
start_pos(sPos),
|
||||
count(c),
|
||||
length(l)
|
||||
{}
|
||||
|
||||
size_t start_cell;
|
||||
int start_cell;
|
||||
double start_pos;
|
||||
size_t count;
|
||||
int count;
|
||||
double length;
|
||||
};
|
||||
|
||||
@ -59,17 +59,19 @@ public:
|
||||
{}
|
||||
|
||||
public:
|
||||
void add(size_t count, double length_pt)
|
||||
void add(int count, double length_pt)
|
||||
{
|
||||
region_.push_back(region(next_cell_, next_pos_, count, length_pt));
|
||||
next_cell_ += count;
|
||||
next_pos_ += count * length_pt;
|
||||
}
|
||||
double search(size_t cell)
|
||||
double search(int cell)
|
||||
{
|
||||
double length_pt =0;
|
||||
BOOST_FOREACH(region const & r, region_)
|
||||
|
||||
for (int i = 0; i < region_.size(); i++)
|
||||
{
|
||||
region & r = region_[i];
|
||||
if (cell <= r.start_cell + r.count)
|
||||
{
|
||||
length_pt += (cell-r.start_cell)*r.length;
|
||||
@ -87,34 +89,57 @@ public:
|
||||
{
|
||||
offset =0;
|
||||
}
|
||||
length_pt+= offset * region_.back().length;
|
||||
length_pt += offset * region_.back().length;
|
||||
}
|
||||
}
|
||||
|
||||
return length_pt;
|
||||
}
|
||||
|
||||
std::pair<size_t, double> search(size_t offset, double pos)
|
||||
std::pair<int, double> search(int offset, double pos)
|
||||
{
|
||||
double skip_length =0;
|
||||
BOOST_FOREACH(region const & r, region_)
|
||||
|
||||
if (pos < 0)//cs102.ods
|
||||
{
|
||||
int c_skip = 0, i = 0;
|
||||
for (i = 0; i < region_.size(); i++)
|
||||
{
|
||||
if (region_[i].count + c_skip > offset)
|
||||
break;
|
||||
c_skip += region_[i].count;
|
||||
}
|
||||
for (; i >= 0 && pos < 0; i--)
|
||||
{
|
||||
pos += region_[i].length * region_[i].count;
|
||||
offset--;
|
||||
}
|
||||
|
||||
if (offset < 0) offset = 0;
|
||||
if (pos < 0) pos = 0;
|
||||
|
||||
}
|
||||
|
||||
for (int i = 0; i < region_.size(); i++)
|
||||
{
|
||||
region & r = region_[i];
|
||||
if (r.start_cell + r.count <= offset)
|
||||
{
|
||||
skip_length = r.start_pos +r.count*r.length;
|
||||
skip_length = r.start_pos + r.count*r.length;
|
||||
continue;
|
||||
}
|
||||
if (pos+skip_length >= r.start_pos && pos+skip_length < (r.start_pos + r.count * r.length))
|
||||
if (pos + skip_length >= r.start_pos && pos + skip_length < (r.start_pos + r.count * r.length))
|
||||
{
|
||||
skip_length += (offset-r.start_cell) * r.length;
|
||||
const double diff = pos+skip_length - r.start_pos;
|
||||
const size_t cell = diff / r.length ;
|
||||
skip_length += (offset - r.start_cell) * r.length;
|
||||
const double diff = pos + skip_length - r.start_pos;
|
||||
|
||||
int cell = diff / r.length ;
|
||||
double offset_cell = diff - cell * r.length;
|
||||
if (offset_cell < 0)
|
||||
{
|
||||
offset_cell =0;
|
||||
}
|
||||
return std::pair<size_t, double>(r.start_cell + cell , offset_cell);
|
||||
return std::pair<int, double>(r.start_cell + cell, offset_cell);
|
||||
}
|
||||
}
|
||||
|
||||
@ -122,38 +147,47 @@ public:
|
||||
{
|
||||
if (region_.back().start_cell + region_.back().count < offset)
|
||||
{
|
||||
skip_length+= (offset-region_.back().start_cell-region_.back().count/*-1*/) * region_.back().length;
|
||||
skip_length += (offset - region_.back().start_cell - region_.back().count /*- 1*/) * region_.back().length;
|
||||
}
|
||||
|
||||
region const & last_r = region_[region_.size() - 1];
|
||||
const size_t last_cell = last_r.start_cell + last_r.count;
|
||||
const double last_pos = last_r.start_pos + last_r.count * last_r.length;
|
||||
double diff = pos+skip_length-last_r.start_pos-(last_r.count * last_r.length);
|
||||
const size_t cell = diff / last_r.length;
|
||||
double offset_cell = diff - cell * last_r.length;
|
||||
region const & last_r = region_[region_.size() - 1];
|
||||
const int last_cell = last_r.start_cell + last_r.count;
|
||||
|
||||
const double last_pos = last_r.start_pos + last_r.count * last_r.length;
|
||||
double diff = pos + skip_length - last_r.start_pos - (last_r.count * last_r.length);
|
||||
|
||||
if (diff < 0)
|
||||
diff = 0;
|
||||
|
||||
const int cell = diff / last_r.length;
|
||||
double offset_cell = diff - cell * last_r.length;
|
||||
|
||||
if (offset_cell < 0)
|
||||
{
|
||||
offset_cell =0;
|
||||
offset_cell = 0;
|
||||
}
|
||||
return std::pair<size_t, double>(last_cell + cell , offset_cell);
|
||||
return std::pair<int, double>(last_cell + cell , offset_cell);
|
||||
}
|
||||
else
|
||||
return std::pair<size_t, double>(offset, pos);
|
||||
return std::pair<int, double>(offset, pos);
|
||||
}
|
||||
std::pair<size_t, double> search(double pos)
|
||||
std::pair<int, double> search(double pos)
|
||||
{
|
||||
BOOST_FOREACH(region const & r, region_)
|
||||
for (int i = 0; i < region_.size(); i++)
|
||||
{
|
||||
region & r = region_[i];
|
||||
|
||||
if (pos >= r.start_pos && pos < (r.start_pos + r.count * r.length))
|
||||
{
|
||||
const double diff = pos - r.start_pos;
|
||||
const size_t cell = diff / r.length;
|
||||
double offset = diff - cell * r.length;
|
||||
const double diff = pos - r.start_pos;
|
||||
const int cell = diff / r.length;
|
||||
double offset = diff - cell * r.length;
|
||||
|
||||
if (offset < 0)
|
||||
{
|
||||
offset =0;
|
||||
}
|
||||
return std::pair<size_t, double>(r.start_cell + cell, offset);
|
||||
return std::pair<int, double>(r.start_cell + cell, offset);
|
||||
}
|
||||
}
|
||||
|
||||
@ -162,20 +196,21 @@ public:
|
||||
region const & last_r = region_[region_.size() - 1];
|
||||
const size_t last_cell = last_r.start_cell + last_r.count;
|
||||
const double last_pos = last_r.start_pos + last_r.count * last_r.length;
|
||||
const double diff = pos - last_pos;
|
||||
const size_t cell = diff / last_r.length;
|
||||
double offset = diff - cell * last_r.length;
|
||||
|
||||
const double diff = pos - last_pos;
|
||||
const int cell = diff / last_r.length;
|
||||
double offset = diff - cell * last_r.length;
|
||||
if (offset < 0)
|
||||
{
|
||||
offset =0;
|
||||
}
|
||||
return std::pair<size_t, double>(last_cell + cell, offset);
|
||||
return std::pair<int, double>(last_cell + cell, offset);
|
||||
}
|
||||
else
|
||||
return std::pair<size_t, double>(0, pos);
|
||||
return std::pair<int, double>(0, pos);
|
||||
}
|
||||
private:
|
||||
size_t next_cell_;
|
||||
int next_cell_;
|
||||
double next_pos_;
|
||||
std::vector<region> region_;
|
||||
};
|
||||
@ -185,48 +220,48 @@ class xlsx_table_metrics::Impl
|
||||
public:
|
||||
xlsx_table_position calc(double x_pt, double y_pt)
|
||||
{
|
||||
const std::pair<size_t, double> c = cols_.search(x_pt);
|
||||
const std::pair<size_t, double> r = rows_.search(y_pt);
|
||||
const std::pair<int, double> c = cols_.search (x_pt);
|
||||
const std::pair<int, double> r = rows_.search (y_pt);
|
||||
|
||||
xlsx_table_position res = {c.first, c.second, r.first, r.second};
|
||||
return res;
|
||||
}
|
||||
|
||||
xlsx_table_position calc(size_t offset_col,size_t offset_row,double x_pt, double y_pt)
|
||||
xlsx_table_position calc(int offset_col, int offset_row, double x_pt, double y_pt)
|
||||
{
|
||||
std::pair<size_t, double> c ;
|
||||
std::pair<size_t, double> r ;
|
||||
std::pair<int, double> c ;
|
||||
std::pair<int, double> r ;
|
||||
|
||||
c = cols_.search(offset_col,x_pt);
|
||||
c = cols_.search(offset_col, x_pt);
|
||||
|
||||
r = rows_.search(offset_row,y_pt);
|
||||
r = rows_.search(offset_row, y_pt);
|
||||
|
||||
xlsx_table_position res = {c.first, c.second, r.first, r.second};
|
||||
|
||||
return res;
|
||||
}
|
||||
xlsx_table_position calc(size_t last_col,size_t last_row)
|
||||
xlsx_table_position calc(int last_col,int last_row)
|
||||
{
|
||||
std::pair<size_t, double> c = cols_.search(last_col,0);
|
||||
std::pair<size_t, double> r = rows_.search(last_row,0);
|
||||
std::pair<int, double> c = cols_.search (last_col, 0);
|
||||
std::pair<int, double> r = rows_.search (last_row, 0);
|
||||
|
||||
|
||||
xlsx_table_position res = {c.first, c.second, r.first, r.second};
|
||||
|
||||
return res;
|
||||
}
|
||||
void update_pt(size_t offset_col,size_t offset_row,double &x_pt, double &y_pt)
|
||||
void update_pt(int offset_col,int offset_row,double &x_pt, double &y_pt)
|
||||
{
|
||||
x_pt += cols_.search(offset_col);
|
||||
y_pt += rows_.search(offset_row);
|
||||
x_pt += cols_.search (offset_col);
|
||||
y_pt += rows_.search (offset_row);
|
||||
}
|
||||
|
||||
void add_cols(size_t count, double widht_pt)
|
||||
void add_cols(int count, double widht_pt)
|
||||
{
|
||||
return cols_.add(count, widht_pt);
|
||||
}
|
||||
|
||||
void add_rows(size_t count, double height_pt)
|
||||
void add_rows(int count, double height_pt)
|
||||
{
|
||||
return rows_.add(count, height_pt);
|
||||
}
|
||||
@ -247,30 +282,30 @@ xlsx_table_metrics::~xlsx_table_metrics()
|
||||
|
||||
xlsx_table_position xlsx_table_metrics::calc(double x_pt, double y_pt)
|
||||
{
|
||||
return impl_->calc(x_pt, y_pt);
|
||||
return impl_->calc (x_pt, y_pt);
|
||||
}
|
||||
|
||||
xlsx_table_position xlsx_table_metrics::calc(size_t offset_col,size_t offset_row,double x_pt, double y_pt)
|
||||
xlsx_table_position xlsx_table_metrics::calc(int offset_col,int offset_row,double x_pt, double y_pt)
|
||||
{
|
||||
return impl_->calc(offset_col,offset_row,x_pt, y_pt);
|
||||
return impl_->calc(offset_col, offset_row, x_pt, y_pt);
|
||||
}
|
||||
xlsx_table_position xlsx_table_metrics::calc(size_t last_col,size_t last_row)
|
||||
xlsx_table_position xlsx_table_metrics::calc(int last_col,int last_row)
|
||||
{
|
||||
return impl_->calc(last_col,last_row);
|
||||
return impl_->calc (last_col, last_row);
|
||||
}
|
||||
|
||||
void xlsx_table_metrics::update_pt(size_t offset_col,size_t offset_row,double &x_pt, double &y_pt)
|
||||
void xlsx_table_metrics::update_pt(int offset_col,int offset_row,double &x_pt, double &y_pt)
|
||||
{
|
||||
return impl_->update_pt(offset_col,offset_row,x_pt, y_pt);
|
||||
return impl_->update_pt (offset_col, offset_row, x_pt, y_pt);
|
||||
}
|
||||
void xlsx_table_metrics::add_cols(size_t count, double width_pt)
|
||||
void xlsx_table_metrics::add_cols(int count, double width_pt)
|
||||
{
|
||||
return impl_->add_cols(count, width_pt);
|
||||
return impl_->add_cols (count, width_pt);
|
||||
}
|
||||
|
||||
void xlsx_table_metrics::add_rows(size_t count, double height_pt)
|
||||
void xlsx_table_metrics::add_rows(int count, double height_pt)
|
||||
{
|
||||
return impl_->add_rows(count, height_pt);
|
||||
return impl_->add_rows (count, height_pt);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -44,18 +44,18 @@ namespace oox
|
||||
class xlsx_table_metrics
|
||||
{
|
||||
public:
|
||||
xlsx_table_metrics();
|
||||
~xlsx_table_metrics();
|
||||
xlsx_table_metrics ();
|
||||
~xlsx_table_metrics ();
|
||||
|
||||
public:
|
||||
xlsx_table_position calc(double x_pt, double y_pt);
|
||||
xlsx_table_position calc(size_t offset_col,size_t offset_row,double x_pt, double y_pt);
|
||||
xlsx_table_position calc(size_t last_col,size_t last_row);
|
||||
xlsx_table_position calc (double x_pt, double y_pt);
|
||||
xlsx_table_position calc (int offset_col, int offset_row, double x_pt, double y_pt);
|
||||
xlsx_table_position calc (int last_col, int last_row);
|
||||
|
||||
void update_pt(size_t offset_col,size_t offset_row,double &x_pt, double &y_pt);
|
||||
void update_pt (int offset_col, int offset_row, double &x_pt, double &y_pt);
|
||||
|
||||
void add_cols(size_t count, double widht_pt);
|
||||
void add_rows(size_t count, double height_pt);
|
||||
void add_cols (int count, double widht_pt);
|
||||
void add_rows (int count, double height_pt);
|
||||
|
||||
private:
|
||||
class Impl;
|
||||
|
||||
@ -191,8 +191,8 @@ std::wstring xlsx_table_state::default_row_cell_style() const
|
||||
|
||||
std::wstring xlsx_table_state::default_column_cell_style() const
|
||||
{
|
||||
if (current_table_column_ < column_default_cell_style_name_.size())
|
||||
return column_default_cell_style_name_.at(current_table_column_);
|
||||
if (current_table_column_ + 1 < column_default_cell_style_name_.size())
|
||||
return column_default_cell_style_name_.at(current_table_column_ + 1);
|
||||
else
|
||||
{
|
||||
//непонятная хрень!! - неправильно сформирован ods???
|
||||
|
||||
@ -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);
|
||||
|
||||
}
|
||||
|
||||
@ -179,7 +179,7 @@ void xlsx_conversion_context::end_document()
|
||||
{
|
||||
CP_XML_NODE(L"sheet")
|
||||
{
|
||||
CP_XML_ATTR(L"name", sheet->name());
|
||||
CP_XML_ATTR(L"name", sheet->name()); // office 2010 ! ограничение на длину имени !!!
|
||||
CP_XML_ATTR(L"sheetId", count);
|
||||
CP_XML_ATTR(L"state", L"visible");
|
||||
CP_XML_ATTR(L"r:id", id);
|
||||
|
||||
@ -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 )
|
||||
{
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@ -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_;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -80,7 +80,7 @@ void table_table_row::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
///обработка чтилей для роу -
|
||||
size_t Default_Cell_style_in_row_ = 0;
|
||||
|
||||
const std::wstring rowStyleName = table_table_row_attlist_.table_style_name_.get_value_or(L"");
|
||||
const std::wstring rowStyleName = table_table_row_attlist_.table_style_name_.get_value_or(L"");
|
||||
const std::wstring defaultCellStyleName = table_table_row_attlist_.table_default_cell_style_name_.get_value_or( L"");
|
||||
|
||||
style_instance * instStyle_CellDefault =
|
||||
@ -604,45 +604,49 @@ void table_table_cell::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
std::wostream & strm = Context.current_sheet().sheetData();
|
||||
|
||||
const std::wstring formula = table_table_cell_attlist_.table_formula_.get_value_or(L"");
|
||||
const std::wstring styleName = table_table_cell_attlist_.table_style_name_.get_value_or(L"");
|
||||
const common_value_and_type_attlist & attr = table_table_cell_attlist_.common_value_and_type_attlist_;
|
||||
|
||||
office_value_type::type odf_value_type = office_value_type::Custom;
|
||||
oox::XlsxCellType::type t_val = oox::XlsxCellType::s;
|
||||
std::wstring number_val = L"";
|
||||
std::wstring formula = table_table_cell_attlist_.table_formula_.get_value_or(L"");
|
||||
|
||||
std::wstring number_val;
|
||||
_CP_OPT(bool) bool_val;
|
||||
_CP_OPT(std::wstring) str_val;
|
||||
|
||||
std::wstring num_format = L"";
|
||||
std::wstring num_format;
|
||||
|
||||
size_t xfId_last_set = 0;
|
||||
int empty_cell_count = 0;
|
||||
bool skip_next_cell = false;
|
||||
bool is_style_visible = true;
|
||||
bool is_data_visible = false;
|
||||
// вычислить стиль для ячейки
|
||||
|
||||
// вычислить стиль для ячейки
|
||||
odf_read_context & odfContext = Context.root()->odf_context();
|
||||
std::wstring cellStyleName = table_table_cell_attlist_.table_style_name_.get_value_or(L"");
|
||||
std::wstring columnStyleName = Context.get_table_context().default_column_cell_style();
|
||||
std::wstring rowStyleName = Context.get_table_context().default_row_cell_style();
|
||||
|
||||
if (table_table_cell_attlist_.table_number_columns_repeated_ > 1)
|
||||
columnStyleName.clear(); // могут быть разные стили колонок Book 24.ods
|
||||
|
||||
odf_read_context & odfContext = Context.root()->odf_context();
|
||||
|
||||
style_instance *defaultCellStyle=NULL, *defaultColumnCellStyle = NULL, *defaultRowCellStyle =NULL, *cellStyle = NULL;
|
||||
try
|
||||
{
|
||||
defaultCellStyle = odfContext.styleContainer().style_default_by_type(style_family::TableCell);
|
||||
defaultColumnCellStyle = odfContext.styleContainer().style_by_name(Context.get_table_context().default_column_cell_style(), style_family::TableCell,false);
|
||||
defaultRowCellStyle = odfContext.styleContainer().style_by_name(Context.get_table_context().default_row_cell_style(), style_family::TableCell,false);
|
||||
|
||||
cellStyle = odfContext.styleContainer().style_by_name(styleName, style_family::TableCell, false);
|
||||
|
||||
defaultColumnCellStyle = odfContext.styleContainer().style_by_name(columnStyleName, style_family::TableCell, false);
|
||||
defaultRowCellStyle = odfContext.styleContainer().style_by_name(rowStyleName, style_family::TableCell, false);
|
||||
cellStyle = odfContext.styleContainer().style_by_name(cellStyleName, style_family::TableCell, false);
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
_CP_LOG << L"[error]: style wrong\n";
|
||||
}
|
||||
|
||||
std::wstring data_style = CalcCellDataStyle(Context,
|
||||
Context.get_table_context().default_column_cell_style(),
|
||||
Context.get_table_context().default_row_cell_style(),
|
||||
styleName);
|
||||
std::wstring data_style = CalcCellDataStyle(Context, columnStyleName, rowStyleName, cellStyleName);
|
||||
|
||||
// стили не наследуются
|
||||
std::vector<const style_instance *> instances;
|
||||
@ -733,8 +737,8 @@ void table_table_cell::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
|
||||
if (!data_style.empty())
|
||||
{
|
||||
office_element_ptr elm = odfContext.numberStyles().find_by_style_name(data_style);
|
||||
number_style_base *num_style = dynamic_cast<number_style_base*>(elm.get());
|
||||
office_element_ptr elm = odfContext.numberStyles().find_by_style_name(data_style);
|
||||
number_style_base *num_style = dynamic_cast<number_style_base*>(elm.get());
|
||||
|
||||
if (num_style)
|
||||
{
|
||||
@ -751,10 +755,8 @@ void table_table_cell::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
cellFormat.set_cell_type(t_val);
|
||||
cellFormat.set_num_format(oox::odf_string_to_build_in(odf_value_type));
|
||||
|
||||
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);
|
||||
|
||||
is_style_visible = (!cellStyleName.empty() || defaultColumnCellStyle) ? true : false;
|
||||
|
||||
if ( table_table_cell_content_.elements_.size() > 0 ||
|
||||
!formula.empty() ||
|
||||
( t_val == oox::XlsxCellType::n && !number_val.empty()) ||
|
||||
@ -762,12 +764,26 @@ void table_table_cell::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
(( t_val == oox::XlsxCellType::str || oox::XlsxCellType::inlineStr) && str_val)) is_data_visible = true;
|
||||
|
||||
if (table_table_cell_attlist_.table_number_columns_repeated_ < 199 && last_cell_) last_cell_ = false;
|
||||
|
||||
int cell_repeated_max = Context.current_table_column() + table_table_cell_attlist_.table_number_columns_repeated_ + 1;
|
||||
|
||||
if (cell_repeated_max >= 1024 && cellStyleName.empty() && last_cell_ && !is_data_visible)
|
||||
{//Book 24.ods
|
||||
return;
|
||||
}
|
||||
|
||||
if (is_style_visible)
|
||||
{
|
||||
xfId_last_set = Context.get_style_manager().xfId(&textFormatProperties, &parFormatProperties, &cellFormatProperties, &cellFormat, num_format, false, is_style_visible);
|
||||
}
|
||||
|
||||
for (unsigned int r = 0; r < table_table_cell_attlist_.table_number_columns_repeated_; ++r)
|
||||
{
|
||||
Context.start_table_cell ( formula, table_table_cell_attlist_extra_.table_number_columns_spanned_ - 1 ,
|
||||
table_table_cell_attlist_extra_.table_number_rows_spanned_ - 1 );
|
||||
Context.set_current_cell_style_id(xfId_last_set);
|
||||
|
||||
if (is_style_visible)
|
||||
Context.set_current_cell_style_id(xfId_last_set);
|
||||
|
||||
const int sharedStringId = table_table_cell_content_.xlsx_convert(Context, &textFormatProperties);
|
||||
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -724,7 +724,7 @@
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\source\RtfParagraph .cpp"
|
||||
RelativePath="..\source\RtfParagraph.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
|
||||
@ -371,7 +371,7 @@ bool RtfNormalReader::ExecuteCommand( RtfDocument& oDocument, RtfReader& oReader
|
||||
section.props->m_oProperty = oReader.m_oCurSectionProp;
|
||||
}
|
||||
|
||||
RtfSectionPtr oNewSection = RtfSectionPtr( new RtfSection() );
|
||||
RtfSectionPtr oNewSection ( new RtfSection() );
|
||||
|
||||
_section new_section(oNewSection);
|
||||
oDocument.AddItem( new_section );
|
||||
@ -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
|
||||
@ -1710,7 +1710,7 @@ bool RtfOleReader::ExecuteCommand(RtfDocument& oDocument, RtfReader& oReader,CSt
|
||||
}
|
||||
else if ( L"result" == sCommand )
|
||||
{
|
||||
RtfShapePtr oNewShape = RtfShapePtr( new RtfShape() );
|
||||
RtfShapePtr oNewShape ( new RtfShape() );
|
||||
|
||||
RtfAllPictReader oAllPictReader( *oNewShape );
|
||||
StartSubReader( oAllPictReader, oDocument, oReader );
|
||||
@ -2092,9 +2092,10 @@ bool RtfOldListReader::ExecuteCommand( RtfDocument& oDocument, RtfReader& oReade
|
||||
CString sNumberingText;
|
||||
TextReader oTextReader( sNumberingText, false );
|
||||
StartSubReader( oTextReader, oDocument, oReader );
|
||||
RtfCharPtr oNewChar = RtfCharPtr( new RtfChar() );
|
||||
oNewChar->setText( sNumberingText );
|
||||
m_oTarget.m_oLevelText->AddItem( oNewChar );
|
||||
|
||||
RtfCharPtr pNewChar ( new RtfChar() );
|
||||
pNewChar->setText( sNumberingText );
|
||||
m_oTarget.m_oLevelText->AddItem( pNewChar );
|
||||
}
|
||||
else
|
||||
return false;
|
||||
@ -2110,7 +2111,7 @@ void RtfParagraphPropDestination::AddItem( RtfParagraphPtr oItem, RtfReader& oRe
|
||||
{
|
||||
if ( nCurItap > 0 ) //Если до этого были только параграфы в таблицах - завершаем таблицу
|
||||
{
|
||||
RtfTablePtr oNewTable( new RtfTable() );
|
||||
RtfTablePtr oNewTable ( new RtfTable() );
|
||||
oNewTable->m_oProperty = oCurRowProperty;
|
||||
|
||||
for( int k = (int)aRows.size() - 1; k >= 0 ; k-- )
|
||||
@ -2157,7 +2158,7 @@ void RtfParagraphPropDestination::AddItem( RtfParagraphPtr oItem, RtfReader& oRe
|
||||
//если вложенность текущего параграфа меньше - завершаем внутреннюю таблицу
|
||||
if ( nCurItap > oItem->m_oProperty.m_nItap )
|
||||
{
|
||||
RtfTablePtr oNewTable( new RtfTable() );
|
||||
RtfTablePtr oNewTable ( new RtfTable() );
|
||||
oNewTable->m_oProperty = oCurRowProperty;
|
||||
|
||||
for( int k = (int)aRows.size() - 1; k >= 0 ; k-- )
|
||||
@ -2182,7 +2183,7 @@ void RtfParagraphPropDestination::AddItem( RtfParagraphPtr oItem, RtfReader& oRe
|
||||
//закончилась строка
|
||||
if ( bEndRow )
|
||||
{
|
||||
RtfTableRowPtr oNewTableRow( new RtfTableRow() );
|
||||
RtfTableRowPtr oNewTableRow ( new RtfTableRow() );
|
||||
oNewTableRow->m_oProperty = oReader.m_oState->m_oRowProperty;
|
||||
|
||||
for( int k = (int)aCells.size() - 1; k >= 0 ; k-- )
|
||||
@ -2212,7 +2213,7 @@ void RtfParagraphPropDestination::AddItem( RtfParagraphPtr oItem, RtfReader& oRe
|
||||
|
||||
if ( bEndCell )
|
||||
{
|
||||
RtfTableCellPtr oNewTableCell( new RtfTableCell() );
|
||||
RtfTableCellPtr oNewTableCell ( new RtfTableCell() );
|
||||
for( int k = (int)aCellRenderables.size() - 1; k >= 0 ; k-- )
|
||||
{
|
||||
if ( aItaps[k] == nCurItap )
|
||||
@ -2237,11 +2238,11 @@ void RtfParagraphPropDestination::Finalize( RtfReader& oReader/*, RtfSectionPtr
|
||||
{
|
||||
if ( false == m_bPar )// потому что это не reader и нужно как-то загонять последний параграф
|
||||
{
|
||||
m_oCurParagraph->m_oProperty = oReader.m_oState->m_oParagraphProp;
|
||||
m_oCurParagraph->m_oProperty = oReader.m_oState->m_oParagraphProp;
|
||||
//m_oCurParagraph->m_oProperty.m_pSection = pSection;
|
||||
|
||||
m_oCurParagraph->m_oOldList = RtfOldListPtr( new RtfOldList() );
|
||||
*m_oCurParagraph->m_oOldList = oReader.m_oState->m_oCurOldList;
|
||||
m_oCurParagraph->m_oOldList = RtfOldListPtr ( new RtfOldList() );
|
||||
*m_oCurParagraph->m_oOldList = oReader.m_oState->m_oCurOldList;
|
||||
|
||||
m_oCurParagraph->m_oProperty.m_oCharProperty = oReader.m_oState->m_oCharProp;
|
||||
|
||||
@ -2355,7 +2356,8 @@ bool RtfParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfRead
|
||||
if ( false == bExist )
|
||||
{
|
||||
oReader.m_oState->m_oCurOldList.m_nLs = oDocument.m_oIdGenerator.Generate_PnId();
|
||||
RtfOldListPtr oNewOldList = RtfOldListPtr( new RtfOldList() );
|
||||
|
||||
RtfOldListPtr oNewOldList ( new RtfOldList() );
|
||||
*oNewOldList = oReader.m_oState->m_oCurOldList;
|
||||
oDocument.m_aOldLists.push_back( oNewOldList );
|
||||
}
|
||||
@ -2378,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();
|
||||
}
|
||||
@ -2387,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();
|
||||
}
|
||||
@ -2452,15 +2470,16 @@ bool RtfParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfRead
|
||||
//Math
|
||||
else if ( L"mmath" == sCommand )
|
||||
{
|
||||
RtfMathPtr oNewMath = RtfMathPtr( new RtfMath() );
|
||||
RtfMathReader oMathReader( *oNewMath );
|
||||
RtfMathPtr oNewMath ( new RtfMath() );
|
||||
RtfMathReader oMathReader ( *oNewMath );
|
||||
|
||||
oAbstrReader.StartSubReader( oMathReader, oDocument, oReader );
|
||||
m_oCurParagraph->AddItem( oNewMath );
|
||||
}
|
||||
//Drawing
|
||||
else if ( L"shp" == sCommand )
|
||||
{
|
||||
RtfShapePtr oNewShape( new RtfShape() );
|
||||
RtfShapePtr oNewShape ( new RtfShape() );
|
||||
oNewShape->m_oCharProperty = oReader.m_oState->m_oCharProp;
|
||||
|
||||
RtfShapeReader oShapeReader( *oNewShape );
|
||||
@ -2471,7 +2490,7 @@ bool RtfParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfRead
|
||||
}
|
||||
else if ( L"do" == sCommand )
|
||||
{
|
||||
RtfShapePtr oNewShape( new RtfShape() );
|
||||
RtfShapePtr oNewShape ( new RtfShape() );
|
||||
oNewShape->m_oCharProperty = oReader.m_oState->m_oCharProp;
|
||||
|
||||
RtfOldShapeReader oShapeReader( *oNewShape );
|
||||
@ -2482,7 +2501,7 @@ bool RtfParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfRead
|
||||
}
|
||||
else if ( L"shppict" == sCommand )
|
||||
{
|
||||
RtfShapePtr oNewShape( new RtfShape() );
|
||||
RtfShapePtr oNewShape ( new RtfShape() );
|
||||
oNewShape->m_oCharProperty = oReader.m_oState->m_oCharProp;
|
||||
|
||||
RtfShppictReader oShppictReader( *oNewShape );
|
||||
@ -2493,7 +2512,7 @@ bool RtfParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfRead
|
||||
}
|
||||
else if ( L"pict" == sCommand )
|
||||
{
|
||||
RtfShapePtr oNewShape( new RtfShape() );
|
||||
RtfShapePtr oNewShape ( new RtfShape() );
|
||||
oNewShape->m_oCharProperty = oReader.m_oState->m_oCharProp;
|
||||
oNewShape->m_nShapeType = NSOfficeDrawing::sptPictureFrame;
|
||||
oNewShape->m_nWrapType = 3; // none
|
||||
@ -2511,7 +2530,7 @@ bool RtfParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfRead
|
||||
}
|
||||
else if ( L"shpgrp" == sCommand )
|
||||
{
|
||||
RtfShapeGroupPtr oNewShape( new RtfShapeGroup() );
|
||||
RtfShapeGroupPtr oNewShape ( new RtfShapeGroup() );
|
||||
oNewShape->m_oCharProperty = oReader.m_oState->m_oCharProp;
|
||||
|
||||
RtfShapeGroupReader oShapeGroupReader( *oNewShape );
|
||||
@ -2526,8 +2545,9 @@ bool RtfParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfRead
|
||||
}
|
||||
else if ( L"field" == sCommand )
|
||||
{
|
||||
RtfFieldPtr oNewField = RtfFieldPtr(new RtfField());
|
||||
RtfFieldReader oFieldReader( *oNewField );
|
||||
RtfFieldPtr oNewField (new RtfField());
|
||||
RtfFieldReader oFieldReader ( *oNewField );
|
||||
|
||||
oAbstrReader.StartSubReader( oFieldReader, oDocument, oReader );
|
||||
|
||||
if ( oNewField->IsValid() )
|
||||
@ -2546,70 +2566,75 @@ bool RtfParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfRead
|
||||
}
|
||||
else if ( L"bkmkstart" == sCommand )
|
||||
{
|
||||
RtfBookmarkStartPtr oNewBookmarkStart = RtfBookmarkStartPtr( new RtfBookmarkStart() );
|
||||
RtfBookmarkStartReader oBookmarkStartReader( *oNewBookmarkStart );
|
||||
RtfBookmarkStartPtr pNewBookmarkStart ( new RtfBookmarkStart() );
|
||||
RtfBookmarkStartReader oBookmarkStartReader( *pNewBookmarkStart );
|
||||
|
||||
oAbstrReader.StartSubReader( oBookmarkStartReader, oDocument, oReader );
|
||||
if ( oNewBookmarkStart->IsValid() )
|
||||
m_oCurParagraph->AddItem( oNewBookmarkStart );
|
||||
if ( pNewBookmarkStart->IsValid() )
|
||||
m_oCurParagraph->AddItem( pNewBookmarkStart );
|
||||
}
|
||||
else if ( L"bkmkend" == sCommand )
|
||||
{
|
||||
RtfBookmarkEndPtr oNewBookmarkEnd = RtfBookmarkEndPtr( new RtfBookmarkEnd() );
|
||||
|
||||
RtfBookmarkEndReader oBookmarkEndReader( *oNewBookmarkEnd );
|
||||
RtfBookmarkEndPtr pNewBookmarkEnd ( new RtfBookmarkEnd() );
|
||||
RtfBookmarkEndReader oBookmarkEndReader ( *pNewBookmarkEnd );
|
||||
|
||||
oAbstrReader.StartSubReader( oBookmarkEndReader, oDocument, oReader );
|
||||
|
||||
if ( oNewBookmarkEnd->IsValid() )
|
||||
m_oCurParagraph->AddItem( oNewBookmarkEnd );
|
||||
if ( pNewBookmarkEnd->IsValid() )
|
||||
m_oCurParagraph->AddItem( pNewBookmarkEnd );
|
||||
}
|
||||
else if ( L"footnote" == sCommand )
|
||||
{
|
||||
RtfFootnotePtr oNewFootnote = RtfFootnotePtr( new RtfFootnote() );
|
||||
oNewFootnote->m_oCharProp = oReader.m_oState->m_oCharProp;
|
||||
RtfFootnotePtr pNewFootnote ( new RtfFootnote() );
|
||||
pNewFootnote->m_oCharProp = oReader.m_oState->m_oCharProp;
|
||||
|
||||
RtfFootnoteReader oFootnoteReader( *oNewFootnote );
|
||||
RtfFootnoteReader oFootnoteReader( *pNewFootnote );
|
||||
oAbstrReader.StartSubReader( oFootnoteReader, oDocument, oReader );
|
||||
|
||||
if ( oNewFootnote->IsValid() )
|
||||
m_oCurParagraph->AddItem( oNewFootnote );
|
||||
if ( pNewFootnote->IsValid() )
|
||||
m_oCurParagraph->AddItem( pNewFootnote );
|
||||
}
|
||||
else if ( L"chftn" == sCommand )
|
||||
{
|
||||
if ( 1 == oReader.m_nFootnote )
|
||||
{
|
||||
RtfCharSpecialPtr oNewChar( new RtfCharSpecial() );
|
||||
oNewChar->m_oProperty = oReader.m_oState->m_oCharProp;
|
||||
oNewChar->m_eType = RtfCharSpecial::rsc_chftn;
|
||||
m_oCurParagraph->AddItem( oNewChar );
|
||||
RtfCharSpecialPtr pNewChar ( new RtfCharSpecial() );
|
||||
|
||||
pNewChar->m_oProperty = oReader.m_oState->m_oCharProp;
|
||||
pNewChar->m_eType = RtfCharSpecial::rsc_chftn;
|
||||
m_oCurParagraph->AddItem( pNewChar );
|
||||
}
|
||||
else if ( 2 == oReader.m_nFootnote )
|
||||
{
|
||||
RtfCharSpecialPtr oNewChar( new RtfCharSpecial() );
|
||||
oNewChar->m_oProperty = oReader.m_oState->m_oCharProp;
|
||||
oNewChar->m_eType = RtfCharSpecial::rsc_chftnEnd;
|
||||
m_oCurParagraph->AddItem( oNewChar );
|
||||
RtfCharSpecialPtr pNewChar ( new RtfCharSpecial() );
|
||||
|
||||
pNewChar->m_oProperty = oReader.m_oState->m_oCharProp;
|
||||
pNewChar->m_eType = RtfCharSpecial::rsc_chftnEnd;
|
||||
m_oCurParagraph->AddItem( pNewChar );
|
||||
}
|
||||
}
|
||||
else if ( L"chftnsep" == sCommand || L"chftnsepc" == sCommand )
|
||||
{
|
||||
RtfCharSpecialPtr oNewChar( new RtfCharSpecial() );
|
||||
oNewChar->m_oProperty = oReader.m_oState->m_oCharProp;
|
||||
m_oCurParagraph->AddItem( oNewChar );
|
||||
RtfCharSpecialPtr pNewChar ( new RtfCharSpecial() );
|
||||
|
||||
if ( L"chftnsep" == sCommand ) oNewChar->m_eType = RtfCharSpecial::rsc_chftnsep;
|
||||
else if ( L"chftnsepc" == sCommand ) oNewChar->m_eType = RtfCharSpecial::rsc_chftnsepc;
|
||||
pNewChar->m_oProperty = oReader.m_oState->m_oCharProp;
|
||||
m_oCurParagraph->AddItem( pNewChar );
|
||||
|
||||
if ( L"chftnsep" == sCommand ) pNewChar->m_eType = RtfCharSpecial::rsc_chftnsep;
|
||||
else if ( L"chftnsepc" == sCommand ) pNewChar->m_eType = RtfCharSpecial::rsc_chftnsepc;
|
||||
}//specialChars
|
||||
else if ( L"page" == sCommand )
|
||||
{
|
||||
RtfCharSpecialPtr oNewChar = RtfCharSpecialPtr( new RtfCharSpecial() );
|
||||
oNewChar->m_eType = RtfCharSpecial::rsc_page;
|
||||
oNewChar->m_oProperty = oReader.m_oState->m_oCharProp;
|
||||
m_oCurParagraph->AddItem( oNewChar );
|
||||
RtfCharSpecialPtr pNewChar ( new RtfCharSpecial() );
|
||||
|
||||
pNewChar->m_eType = RtfCharSpecial::rsc_page;
|
||||
pNewChar->m_oProperty = oReader.m_oState->m_oCharProp;
|
||||
m_oCurParagraph->AddItem( pNewChar );
|
||||
//Microsoft (Demo-Hayden-Management-v2).docx
|
||||
//после разрыва могут быть и графические элементы .. их надо оставить в ЭТОМ же параграфе
|
||||
//разрыв страницы со следующего параграфа ..
|
||||
//m_oCurParagraph->m_oProperty = oReader.m_oState->m_oParagraphProp;
|
||||
//m_oCurParagraph->m_oOldList = RtfOldListPtr( new RtfOldList() );
|
||||
//m_oCurParagraph->m_oOldList ( new RtfOldList() );
|
||||
//*m_oCurParagraph->m_oOldList = oReader.m_oState->m_oCurOldList;
|
||||
//m_oCurParagraph->m_oProperty.m_oCharProperty = oReader.m_oState->m_oCharProp;
|
||||
//AddItem( m_oCurParagraph, oReader, false, false );
|
||||
@ -2622,10 +2647,11 @@ bool RtfParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfRead
|
||||
{
|
||||
if ( hasParameter )
|
||||
{
|
||||
RtfCharSpecialPtr oNewChar = RtfCharSpecialPtr( new RtfCharSpecial() );
|
||||
oNewChar->m_nTextWrapBreak = parameter;
|
||||
oNewChar->m_oProperty = oReader.m_oState->m_oCharProp;
|
||||
m_oCurParagraph->AddItem( oNewChar );
|
||||
RtfCharSpecialPtr pNewChar ( new RtfCharSpecial() );
|
||||
|
||||
pNewChar->m_nTextWrapBreak = parameter;
|
||||
pNewChar->m_oProperty = oReader.m_oState->m_oCharProp;
|
||||
m_oCurParagraph->AddItem( pNewChar );
|
||||
}
|
||||
}
|
||||
COMMAND_RTF_SPECIAL_CHAR( L"softpage", m_oCurParagraph, sCommand, hasParameter, RtfCharSpecial::rsc_softpage )
|
||||
@ -2636,10 +2662,10 @@ bool RtfParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfRead
|
||||
{
|
||||
if ( hasParameter )
|
||||
{
|
||||
RtfCharSpecialPtr oNewChar = RtfCharSpecialPtr( new RtfCharSpecial() );
|
||||
oNewChar->m_nSoftHeight = parameter;
|
||||
oNewChar->m_oProperty = oReader.m_oState->m_oCharProp;
|
||||
m_oCurParagraph->AddItem( oNewChar );
|
||||
RtfCharSpecialPtr pNewChar = RtfCharSpecialPtr( new RtfCharSpecial() );
|
||||
pNewChar->m_nSoftHeight = parameter;
|
||||
pNewChar->m_oProperty = oReader.m_oState->m_oCharProp;
|
||||
m_oCurParagraph->AddItem( pNewChar );
|
||||
}
|
||||
}
|
||||
COMMAND_RTF_SPECIAL_CHAR( L"tab", m_oCurParagraph, sCommand, hasParameter, RtfCharSpecial::rsc_tab )
|
||||
@ -2676,7 +2702,7 @@ bool RtfParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfRead
|
||||
|
||||
else if ( L"oldcprops" == sCommand )
|
||||
{
|
||||
RtfCharPropertyPtr props = RtfCharPropertyPtr( new RtfCharProperty() );
|
||||
RtfCharPropertyPtr props ( new RtfCharProperty() );
|
||||
RtfTrackerChangesReader oOldPropReader(props);
|
||||
|
||||
if (oAbstrReader.StartSubReader( oOldPropReader, oDocument, oReader ))
|
||||
@ -2686,7 +2712,7 @@ bool RtfParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfRead
|
||||
}
|
||||
else if ( L"oldpprops" == sCommand )
|
||||
{
|
||||
RtfParagraphPropertyPtr props = RtfParagraphPropertyPtr( new RtfParagraphProperty() );
|
||||
RtfParagraphPropertyPtr props ( new RtfParagraphProperty() );
|
||||
RtfTrackerChangesReader oOldPropReader(props);
|
||||
|
||||
if (oAbstrReader.StartSubReader( oOldPropReader, oDocument, oReader ))
|
||||
@ -2696,7 +2722,7 @@ bool RtfParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfRead
|
||||
}
|
||||
else if ( L"oldsprops" == sCommand )
|
||||
{
|
||||
RtfSectionPropertyPtr props = RtfSectionPropertyPtr( new RtfSectionProperty() );
|
||||
RtfSectionPropertyPtr props ( new RtfSectionProperty() );
|
||||
RtfTrackerChangesReader oOldPropReader(props);
|
||||
|
||||
if (oAbstrReader.StartSubReader( oOldPropReader, oDocument, oReader ))
|
||||
@ -2706,7 +2732,7 @@ bool RtfParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfRead
|
||||
}
|
||||
else if ( L"oldtprops" == sCommand )
|
||||
{
|
||||
RtfRowPropertyPtr props = RtfRowPropertyPtr( new RtfRowProperty() );
|
||||
RtfRowPropertyPtr props ( new RtfRowProperty() );
|
||||
RtfTrackerChangesReader oOldPropReader(props);
|
||||
|
||||
if (oAbstrReader.StartSubReader( oOldPropReader, oDocument, oReader ))
|
||||
|
||||
@ -63,10 +63,10 @@
|
||||
#define COMMAND_RTF_SPECIAL_CHAR( pattern, target, command, hasParameter, parameter )\
|
||||
else if( pattern == command )\
|
||||
{\
|
||||
RtfCharSpecialPtr oNewChar = RtfCharSpecialPtr( new RtfCharSpecial() );\
|
||||
oNewChar->m_eType = parameter;\
|
||||
oNewChar->m_oProperty = oReader.m_oState->m_oCharProp;\
|
||||
target->AddItem( oNewChar );\
|
||||
RtfCharSpecialPtr pNewChar ( new RtfCharSpecial() );\
|
||||
pNewChar->m_eType = parameter;\
|
||||
pNewChar->m_oProperty = oReader.m_oState->m_oCharProp;\
|
||||
target->AddItem( pNewChar );\
|
||||
}
|
||||
//Command не имеет состояний
|
||||
#include "math.h"
|
||||
@ -830,7 +830,7 @@ public:
|
||||
return true;
|
||||
else if( L"pict" == sCommand && ( L"pib" == m_sPropName || L"fillBlip" == m_sPropName))
|
||||
{
|
||||
m_oShape.m_oPicture = RtfPicturePtr( new RtfPicture() );
|
||||
m_oShape.m_oPicture = RtfPicturePtr ( new RtfPicture() );
|
||||
RtfPictureReader oPictureReader( oReader, m_oShape );
|
||||
StartSubReader( oPictureReader, oDocument, oReader );
|
||||
}
|
||||
@ -965,18 +965,20 @@ public:
|
||||
m_bHeader = false;
|
||||
else
|
||||
{
|
||||
RtfShapeGroupPtr oNewShape = RtfShapeGroupPtr( new RtfShapeGroup() );
|
||||
RtfShapeGroupReader oShapeGroupReader( *oNewShape );
|
||||
RtfShapeGroupPtr pNewShape ( new RtfShapeGroup() );
|
||||
RtfShapeGroupReader oShapeGroupReader ( *pNewShape );
|
||||
|
||||
StartSubReader( oShapeGroupReader, oDocument, oReader );
|
||||
m_oShapeGroup.AddItem( oNewShape );
|
||||
m_oShapeGroup.AddItem( pNewShape );
|
||||
}
|
||||
}
|
||||
else if( L"shp" == sCommand )
|
||||
{
|
||||
RtfShapePtr oNewShape = RtfShapePtr( new RtfShape() );
|
||||
RtfShapeReader oShapeReader( *oNewShape );
|
||||
RtfShapePtr pNewShape ( new RtfShape() );
|
||||
RtfShapeReader oShapeReader( *pNewShape );
|
||||
|
||||
StartSubReader( oShapeReader, oDocument, oReader );
|
||||
m_oShapeGroup.AddItem( oNewShape );
|
||||
m_oShapeGroup.AddItem( pNewShape );
|
||||
}
|
||||
else
|
||||
return RtfShapeReader::ExecuteCommand( oDocument, oReader, sCommand, hasParameter, parameter);
|
||||
@ -1183,7 +1185,7 @@ public:
|
||||
}
|
||||
else
|
||||
{
|
||||
RtfMathPtr oNewMath( new RtfMath() );
|
||||
RtfMathPtr oNewMath ( new RtfMath() );
|
||||
oNewMath->SetRtfName( sCommand );
|
||||
|
||||
oNewMath->m_bIsVal = isValMath;
|
||||
@ -1194,7 +1196,7 @@ public:
|
||||
|
||||
if (resParseSub && L"mctrlPr" == sCommand)
|
||||
{
|
||||
RtfCharPropertyPtr oNewCharProp( new RtfCharProperty() );
|
||||
RtfCharPropertyPtr oNewCharProp ( new RtfCharProperty() );
|
||||
oNewCharProp->Merge(oSubMathReader.m_oCharProp);
|
||||
oNewMath->AddItem( oNewCharProp );
|
||||
}
|
||||
@ -1226,11 +1228,11 @@ public:
|
||||
}
|
||||
void ExecuteText(RtfDocument& oDocument, RtfReader& oReader, CString sText)
|
||||
{
|
||||
RtfCharPtr oNewChar( new RtfChar() );
|
||||
oNewChar->m_oProperty.Merge(m_oCharProp);
|
||||
RtfCharPtr pNewChar ( new RtfChar() );
|
||||
pNewChar->m_oProperty.Merge(m_oCharProp);
|
||||
|
||||
oNewChar->setText( sText );
|
||||
m_oMath.AddItem( oNewChar );
|
||||
pNewChar->setText( sText );
|
||||
m_oMath.AddItem( pNewChar );
|
||||
}
|
||||
CString ExecuteMathProp(RtfDocument& oDocument, CString sCommand, int parameter)
|
||||
{//rtf math properties (int) to oox math properties (string)
|
||||
@ -1415,17 +1417,18 @@ private:
|
||||
RtfAbstractReader reader;
|
||||
|
||||
CString sResultSymbol = reader.ExecuteTextInternal( oDocument, oReader, sCharA, false, 0, nSkipChar );
|
||||
//свойства копировать ? ващето есть дубль - проверить
|
||||
m_oField.m_pResult = RtfFieldInstPtr ( new RtfFieldInst() );
|
||||
m_oField.m_pResult->SetDefault();
|
||||
|
||||
m_oField.m_pResult = RtfFieldInstPtr ( new RtfFieldInst() );
|
||||
RtfParagraphPtr pNewPar ( new RtfParagraph() );
|
||||
RtfCharPtr pNewChar( new RtfChar() );
|
||||
|
||||
RtfParagraphPtr oNewPar = RtfParagraphPtr ( new RtfParagraph() );
|
||||
RtfCharPtr oNewChar = RtfCharPtr ( new RtfChar() );
|
||||
|
||||
oNewChar->setText( sResultSymbol );
|
||||
oNewChar->m_oProperty = oReader.m_oState->m_oCharProp;
|
||||
pNewChar->setText( sResultSymbol );
|
||||
pNewChar->m_oProperty = oReader.m_oState->m_oCharProp;
|
||||
|
||||
oNewPar->AddItem( oNewChar );
|
||||
m_oField.m_pResult->m_pTextItems->AddItem( oNewPar );
|
||||
pNewPar->AddItem( pNewChar );
|
||||
m_oField.m_pResult->m_pTextItems->AddItem( pNewPar );
|
||||
m_oField.m_bTextOnly = true;
|
||||
}
|
||||
};
|
||||
@ -1511,19 +1514,19 @@ public:
|
||||
{
|
||||
nTargetItap = PROP_DEF;
|
||||
m_bPar = false;
|
||||
m_oTextItems = TextItemContainerPtr( new TextItemContainer() );
|
||||
nCurItap = 0; //main document
|
||||
m_eInternalState = is_normal;
|
||||
m_oCurParagraph = RtfParagraphPtr(new RtfParagraph());
|
||||
m_oCurParagraph = RtfParagraphPtr (new RtfParagraph());
|
||||
m_oTextItems = TextItemContainerPtr ( new TextItemContainer() );
|
||||
}
|
||||
bool ExecuteCommand(RtfDocument& oDocument, RtfReader& oReader,RtfAbstractReader& oAbstrReader,CString sCommand, bool hasParameter, int parameter);
|
||||
void ExecuteText(RtfDocument& oDocument, RtfReader& oReader, CString sText)
|
||||
{
|
||||
m_bPar = false;
|
||||
RtfCharPtr oNewChar( new RtfChar() );
|
||||
oNewChar->m_oProperty = oReader.m_oState->m_oCharProp;
|
||||
oNewChar->setText( sText );
|
||||
m_oCurParagraph->AddItem( oNewChar );
|
||||
RtfCharPtr pNewChar ( new RtfChar() );
|
||||
pNewChar->m_oProperty = oReader.m_oState->m_oCharProp;
|
||||
pNewChar->setText( sText );
|
||||
m_oCurParagraph->AddItem( pNewChar );
|
||||
}
|
||||
void AddItem( RtfParagraphPtr oItem, RtfReader& oReader, bool bEndCell, bool bEndRow );
|
||||
|
||||
@ -1740,7 +1743,7 @@ class RtfStyleTableReader: public RtfAbstractReader
|
||||
public:
|
||||
RtfStyleReader()
|
||||
{
|
||||
m_oCurStyle = RtfParagraphStylePtr( new RtfParagraphStyle() );
|
||||
m_oCurStyle = RtfParagraphStylePtr ( new RtfParagraphStyle() );
|
||||
m_eInternalState = is_normal;
|
||||
}
|
||||
bool ExecuteCommand(RtfDocument& oDocument, RtfReader& oReader,CString sCommand, bool hasParameter, int parameter)
|
||||
@ -1749,7 +1752,7 @@ class RtfStyleTableReader: public RtfAbstractReader
|
||||
{
|
||||
if( true == hasParameter )
|
||||
{
|
||||
m_oCurStyle = RtfParagraphStylePtr( new RtfParagraphStyle() );
|
||||
m_oCurStyle = RtfParagraphStylePtr ( new RtfParagraphStyle() );
|
||||
m_oCurStyle->m_nID = parameter;
|
||||
}
|
||||
}
|
||||
@ -1757,7 +1760,7 @@ class RtfStyleTableReader: public RtfAbstractReader
|
||||
{
|
||||
if( true == hasParameter )
|
||||
{
|
||||
m_oCurStyle = RtfCharStylePtr( new RtfCharStyle() );
|
||||
m_oCurStyle = RtfCharStylePtr ( new RtfCharStyle() );
|
||||
m_oCurStyle->m_nID = parameter;
|
||||
}
|
||||
}
|
||||
@ -1765,7 +1768,7 @@ class RtfStyleTableReader: public RtfAbstractReader
|
||||
{
|
||||
if( true == hasParameter )
|
||||
{
|
||||
m_oCurStyle = RtfTableStylePtr( new RtfTableStyle() );
|
||||
m_oCurStyle = RtfTableStylePtr ( new RtfTableStyle() );
|
||||
m_oCurStyle->m_nID = parameter;
|
||||
}
|
||||
}
|
||||
@ -2141,7 +2144,7 @@ public:
|
||||
}
|
||||
else if( L"shppict" == sCommand )
|
||||
{
|
||||
RtfShapePtr oNewPicture = RtfShapePtr( new RtfShape() );
|
||||
RtfShapePtr oNewPicture = RtfShapePtr ( new RtfShape() );
|
||||
|
||||
RtfShppictReader oShppictReader( *oNewPicture );
|
||||
StartSubReader( oShppictReader, oDocument, oReader );
|
||||
@ -2362,46 +2365,46 @@ public:
|
||||
|
||||
if( NULL == oDocument.m_oFootnoteCon )
|
||||
{
|
||||
oDocument.m_oFootnoteCon = TextItemContainerPtr( new TextItemContainer() );
|
||||
RtfParagraphPtr oNewPar = RtfParagraphPtr( new RtfParagraph() );
|
||||
RtfCharSpecialPtr oNewChar = RtfCharSpecialPtr( new RtfCharSpecial() );
|
||||
oNewChar->m_eType = RtfCharSpecial::rsc_chftnsepc;
|
||||
oDocument.m_oFootnoteCon = TextItemContainerPtr ( new TextItemContainer() );
|
||||
RtfParagraphPtr pNewPar ( new RtfParagraph() );
|
||||
RtfCharSpecialPtr pNewChar( new RtfCharSpecial() );
|
||||
pNewChar->m_eType = RtfCharSpecial::rsc_chftnsepc;
|
||||
|
||||
oNewPar->AddItem( oNewChar );
|
||||
oDocument.m_oFootnoteCon->AddItem( oNewPar );
|
||||
pNewPar->AddItem( pNewChar );
|
||||
oDocument.m_oFootnoteCon->AddItem( pNewPar );
|
||||
oDocument.m_oProperty.m_aSpecialFootnotes.push_back( 1 );
|
||||
}
|
||||
if( NULL == oDocument.m_oFootnoteSep )
|
||||
{
|
||||
oDocument.m_oFootnoteSep = TextItemContainerPtr( new TextItemContainer() );
|
||||
RtfParagraphPtr oNewPar = RtfParagraphPtr( new RtfParagraph() );
|
||||
RtfCharSpecialPtr oNewChar = RtfCharSpecialPtr( new RtfCharSpecial() );
|
||||
oNewChar->m_eType = RtfCharSpecial::rsc_chftnsep;
|
||||
RtfParagraphPtr pNewPar ( new RtfParagraph() );
|
||||
RtfCharSpecialPtr pNewChar( new RtfCharSpecial() );
|
||||
pNewChar->m_eType = RtfCharSpecial::rsc_chftnsep;
|
||||
|
||||
oNewPar->AddItem( oNewChar );
|
||||
oDocument.m_oFootnoteSep->AddItem( oNewPar );
|
||||
pNewPar->AddItem( pNewChar );
|
||||
oDocument.m_oFootnoteSep->AddItem( pNewPar );
|
||||
oDocument.m_oProperty.m_aSpecialFootnotes.push_back( 0 );
|
||||
}
|
||||
if( NULL == oDocument.m_oEndnoteCon )
|
||||
{
|
||||
oDocument.m_oEndnoteCon = TextItemContainerPtr( new TextItemContainer() );
|
||||
RtfParagraphPtr oNewPar = RtfParagraphPtr( new RtfParagraph() );
|
||||
RtfCharSpecialPtr oNewChar = RtfCharSpecialPtr( new RtfCharSpecial() );
|
||||
oNewChar->m_eType = RtfCharSpecial::rsc_chftnsepc;
|
||||
RtfParagraphPtr pNewPar ( new RtfParagraph() );
|
||||
RtfCharSpecialPtr pNewChar( new RtfCharSpecial() );
|
||||
pNewChar->m_eType = RtfCharSpecial::rsc_chftnsepc;
|
||||
|
||||
oNewPar->AddItem( oNewChar );
|
||||
oDocument.m_oEndnoteCon->AddItem( oNewPar );
|
||||
pNewPar->AddItem( pNewChar );
|
||||
oDocument.m_oEndnoteCon->AddItem( pNewPar );
|
||||
oDocument.m_oProperty.m_aSpecialEndnotes.push_back( 1 );
|
||||
}
|
||||
if( NULL == oDocument.m_oEndnoteSep )
|
||||
{
|
||||
oDocument.m_oEndnoteSep = TextItemContainerPtr( new TextItemContainer() );
|
||||
RtfParagraphPtr oNewPar = RtfParagraphPtr( new RtfParagraph() );
|
||||
RtfCharSpecialPtr oNewChar = RtfCharSpecialPtr( new RtfCharSpecial() );
|
||||
oNewChar->m_eType = RtfCharSpecial::rsc_chftnsep;
|
||||
RtfParagraphPtr pNewPar ( new RtfParagraph() );
|
||||
RtfCharSpecialPtr pNewChar( new RtfCharSpecial() );
|
||||
pNewChar->m_eType = RtfCharSpecial::rsc_chftnsep;
|
||||
|
||||
oNewPar->AddItem( oNewChar );
|
||||
oDocument.m_oEndnoteSep->AddItem( oNewPar );
|
||||
pNewPar->AddItem( pNewChar );
|
||||
oDocument.m_oEndnoteSep->AddItem( pNewPar );
|
||||
oDocument.m_oProperty.m_aSpecialEndnotes.push_back( 0 );
|
||||
}
|
||||
}
|
||||
|
||||
@ -85,15 +85,15 @@ bool OOXPictureGraphicReader::Parse( ReaderParameter oParam , RtfShape& oOutput)
|
||||
oOutput.m_nShapeType = 1;
|
||||
oOutput.m_bFilled = 0;
|
||||
oOutput.m_bLine = 1;
|
||||
|
||||
oOutput.m_aTextItems = TextItemContainerPtr( new TextItemContainer() );
|
||||
oOutput.m_aTextItems = TextItemContainerPtr( new TextItemContainer() );
|
||||
|
||||
RtfParagraphPtr oParagraph( new RtfParagraph() );
|
||||
RtfParagraphPtr oParagraph ( new RtfParagraph() );
|
||||
|
||||
oParagraph->m_oProperty = oParam.oRtf->m_oDefaultParagraphProp;
|
||||
oParagraph->m_oProperty.m_oCharProperty = oParam.oRtf->m_oDefaultCharProp;
|
||||
oParagraph->m_oProperty.m_nItap = 0;
|
||||
|
||||
RtfCharPtr oChar( new RtfChar() );
|
||||
RtfCharPtr oChar ( new RtfChar() );
|
||||
oChar->m_oProperty = oParam.oRtf->m_oDefaultCharProp;
|
||||
oChar->setText( L"The element is not supported in RTF format." );
|
||||
|
||||
|
||||
@ -139,7 +139,7 @@ public:
|
||||
{
|
||||
if( nSeparatorId == nId )
|
||||
{
|
||||
TextItemContainerPtr oNewTextItem( new TextItemContainer() );
|
||||
TextItemContainerPtr oNewTextItem ( new TextItemContainer() );
|
||||
oTextItemReader.m_oTextItems = oNewTextItem;
|
||||
|
||||
if( true == oTextItemReader.Parse( ooxFtnEdn->m_arrItems[i], oParam ) )
|
||||
@ -152,7 +152,7 @@ public:
|
||||
}
|
||||
else if( nContinueId == nId )
|
||||
{
|
||||
TextItemContainerPtr oNewTextItem( new TextItemContainer() );
|
||||
TextItemContainerPtr oNewTextItem ( new TextItemContainer() );
|
||||
oTextItemReader.m_oTextItems = oNewTextItem;
|
||||
|
||||
if( true == oTextItemReader.Parse( ooxFtnEdn->m_arrItems[i], oParam ) )
|
||||
@ -165,7 +165,7 @@ public:
|
||||
}
|
||||
else
|
||||
{
|
||||
TextItemContainerPtr oNewTextItem( new TextItemContainer() );
|
||||
TextItemContainerPtr oNewTextItem ( new TextItemContainer() );
|
||||
oTextItemReader.m_oTextItems = oNewTextItem;
|
||||
|
||||
if( true == oTextItemReader.Parse( ooxFtnEdn->m_arrItems[i], oParam ) )
|
||||
|
||||
@ -44,7 +44,7 @@ bool OOXHeaderReader::Parse( ReaderParameter oParam, CString sRID, TextItemConta
|
||||
oParam.oReader->m_currentContainer = dynamic_cast<OOX::IFileContainer*>(pHdrFtr);
|
||||
|
||||
OOXTextItemReader oOOXTextItemReader;
|
||||
oOutput = TextItemContainerPtr( new TextItemContainer() );
|
||||
oOutput = TextItemContainerPtr ( new TextItemContainer() );
|
||||
oOOXTextItemReader.m_oTextItems = oOutput;
|
||||
|
||||
for (long i=0; i < pHdrFtr->m_arrItems.size(); i++)
|
||||
|
||||
@ -41,7 +41,7 @@ bool OOXMathReader::ParseElement(ReaderParameter oParam , OOX::WritingElement *
|
||||
{
|
||||
if (!ooxMath) return false;
|
||||
|
||||
rtfMath = RtfMathPtr( new RtfMath() );
|
||||
if (!rtfMath) rtfMath = RtfMathPtr( new RtfMath() );
|
||||
if (!rtfMath) return false;
|
||||
|
||||
OOX::EElementType ooxTypeElement = ooxMath->getType();
|
||||
@ -814,20 +814,18 @@ bool OOXMathReader::ParseElement(ReaderParameter oParam , OOX::WritingElement *
|
||||
OOX::Logic::CCtrlPr *ooxSubMath = dynamic_cast<OOX::Logic::CCtrlPr *>(ooxMath);
|
||||
if (ooxSubMath)
|
||||
{
|
||||
RtfCharProperty oCurrentProp;
|
||||
oCurrentProp = m_oCharProperty;
|
||||
|
||||
RtfCharPtr oChar = RtfCharPtr(new RtfChar);
|
||||
oChar->m_oProperty = oCurrentProp;
|
||||
OOX::Logic::CRunProperty *ooxRPr = dynamic_cast<OOX::Logic::CRunProperty *>(ooxSubMath->m_oRPr.GetPointer());
|
||||
if (ooxRPr)
|
||||
{
|
||||
RtfCharProperty oCurrentProp;
|
||||
oCurrentProp.SetDefaultOOX();
|
||||
|
||||
OOXrPrReader orPrReader(ooxRPr);
|
||||
orPrReader.Parse( oParam, oCurrentProp );
|
||||
|
||||
RtfCharPtr oChar = RtfCharPtr(new RtfChar);
|
||||
|
||||
oChar->m_oProperty = oCurrentProp;
|
||||
rtfMath->AddItem( oChar );
|
||||
}
|
||||
rtfMath->AddItem( oChar );
|
||||
}
|
||||
}break;
|
||||
case OOX::et_m_jc:
|
||||
@ -908,28 +906,30 @@ bool OOXMathReader::ParseElement(ReaderParameter oParam , OOX::WritingElement *
|
||||
//----------------------------------
|
||||
nullable<CString> sVal;
|
||||
|
||||
if ((ooxElemBool) && (ooxElemBool->m_val.IsInit())) sVal = ooxElemBool->m_val->ToString2(SimpleTypes::onofftostringOn);
|
||||
else if ((ooxElemChar) && (ooxElemChar->m_val.IsInit())) sVal = ooxElemChar->m_val->GetValue();
|
||||
else if ((ooxElemMeasure) && (ooxElemMeasure->m_val.IsInit())) sVal = ooxElemMeasure->m_val->ToString();
|
||||
else if ((ooxElemInt255) && (ooxElemInt255->m_val.IsInit())) sVal = ooxElemInt255->m_val->ToString();
|
||||
else if ((ooxElemLim) && (ooxElemLim->m_val.IsInit())) sVal = ooxElemLim->m_val->ToString();
|
||||
else if ((ooxElemUnSignInt) && (ooxElemUnSignInt->m_val.IsInit())) sVal = ooxElemUnSignInt->m_val->ToString();
|
||||
else if ((ooxElemTopBot) && (ooxElemTopBot->m_val.IsInit())) sVal = ooxElemTopBot->m_val->ToString();
|
||||
else if ((ooxElemFType) && (ooxElemFType->m_val.IsInit())) sVal = ooxElemFType->m_val->ToString();
|
||||
else if ((ooxElemStyle) && (ooxElemStyle->m_val.IsInit())) sVal = ooxElemStyle->m_val->ToString();
|
||||
else if ((ooxElemShp) && (ooxElemShp->m_val.IsInit())) sVal = ooxElemShp->m_val->ToString();
|
||||
else if ((ooxElemScript) && (ooxElemScript->m_val.IsInit())) sVal = ooxElemScript->m_val->ToString();
|
||||
if ((ooxElemBool) && (ooxElemBool->m_val.IsInit())) sVal = ooxElemBool->m_val->ToString2(SimpleTypes::onofftostringOn);
|
||||
else if ((ooxElemChar) && (ooxElemChar->m_val.IsInit())) sVal = ooxElemChar->m_val->GetValue();
|
||||
else if ((ooxElemMeasure) && (ooxElemMeasure->m_val.IsInit())) sVal = ooxElemMeasure->m_val->ToString();
|
||||
else if ((ooxElemInt255) && (ooxElemInt255->m_val.IsInit())) sVal = ooxElemInt255->m_val->ToString();
|
||||
else if ((ooxElemLim) && (ooxElemLim->m_val.IsInit())) sVal = ooxElemLim->m_val->ToString();
|
||||
else if ((ooxElemUnSignInt) && (ooxElemUnSignInt->m_val.IsInit())) sVal = ooxElemUnSignInt->m_val->ToString();
|
||||
else if ((ooxElemTopBot) && (ooxElemTopBot->m_val.IsInit())) sVal = ooxElemTopBot->m_val->ToString();
|
||||
else if ((ooxElemFType) && (ooxElemFType->m_val.IsInit())) sVal = ooxElemFType->m_val->ToString();
|
||||
else if ((ooxElemStyle) && (ooxElemStyle->m_val.IsInit())) sVal = ooxElemStyle->m_val->ToString();
|
||||
else if ((ooxElemShp) && (ooxElemShp->m_val.IsInit())) sVal = ooxElemShp->m_val->ToString();
|
||||
else if ((ooxElemScript) && (ooxElemScript->m_val.IsInit())) sVal = ooxElemScript->m_val->ToString();
|
||||
else if ((ooxElemSpacingRule) && (ooxElemSpacingRule->m_val.IsInit())) sVal = ooxElemSpacingRule->m_val->ToString();
|
||||
else if ((ooxElemXAlign) && (ooxElemXAlign->m_val.IsInit())) sVal = ooxElemXAlign->m_val->ToString();
|
||||
else if ((ooxElemInteger2) && (ooxElemInteger2->m_val.IsInit())) sVal = ooxElemInteger2->m_val->ToString();
|
||||
else if ((ooxElemYAlign) && (ooxElemYAlign->m_val.IsInit())) sVal = ooxElemYAlign->m_val->ToString();
|
||||
else if ((ooxElemBreakBin) && (ooxElemBreakBin->m_val.IsInit())) sVal = ooxElemBreakBin->m_val->ToString();
|
||||
else if ((ooxElemXAlign) && (ooxElemXAlign->m_val.IsInit())) sVal = ooxElemXAlign->m_val->ToString();
|
||||
else if ((ooxElemInteger2) && (ooxElemInteger2->m_val.IsInit())) sVal = ooxElemInteger2->m_val->ToString();
|
||||
else if ((ooxElemYAlign) && (ooxElemYAlign->m_val.IsInit())) sVal = ooxElemYAlign->m_val->ToString();
|
||||
else if ((ooxElemBreakBin) && (ooxElemBreakBin->m_val.IsInit())) sVal = ooxElemBreakBin->m_val->ToString();
|
||||
else if ((ooxElemBreakBinSub) && (ooxElemBreakBinSub->m_val.IsInit())) sVal = ooxElemBreakBinSub->m_val->ToString();
|
||||
//----------------------------------------------
|
||||
|
||||
if (ooxElemArray)
|
||||
{
|
||||
OOXMathReader oMathReader(ooxElemArray);
|
||||
oMathReader.m_oCharProperty = m_oCharProperty;
|
||||
|
||||
bool res = oMathReader.Parse( oParam, (*rtfMath) );
|
||||
}
|
||||
else if (sVal.IsInit())
|
||||
|
||||
@ -59,10 +59,10 @@ public:
|
||||
|
||||
for(int i = 0; i < m_ooxElem->m_arrItems.size(); i++)
|
||||
{
|
||||
RtfMathPtr oNewMath;
|
||||
if (ParseElement(oParam, m_ooxElem->m_arrItems[i], oNewMath))
|
||||
RtfMathPtr pNewMath;
|
||||
if (ParseElement(oParam, m_ooxElem->m_arrItems[i], pNewMath))
|
||||
{
|
||||
oOutput.AddItem( oNewMath );
|
||||
oOutput.AddItem( pNewMath );
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
@ -57,7 +57,7 @@ public:
|
||||
{
|
||||
OOXShapeReader oShapeReader(m_ooxNumbering->m_arrNumPicBullet[i]->m_oVmlDrawing.GetPointer());
|
||||
|
||||
RtfShapePtr oNewShape( new RtfShape() );
|
||||
RtfShapePtr oNewShape ( new RtfShape() );
|
||||
if( true == oShapeReader.Parse( oParam, oNewShape ) )
|
||||
{
|
||||
oNewShape->m_eAnchorTypeShape = RtfShape::st_inline;
|
||||
|
||||
@ -49,9 +49,12 @@ bool OOXParagraphReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputPa
|
||||
RtfTableStylePtr oResultTableStyle;
|
||||
//сначала применяем default стиль (если это нужно)
|
||||
|
||||
oOutputParagraph.m_oProperty.m_oCharProperty = m_oCharProperty;
|
||||
|
||||
if (m_ooxParagraph->m_oParagraphProperty)
|
||||
{
|
||||
OOXpPrReader opPrReader(m_ooxParagraph->m_oParagraphProperty);
|
||||
|
||||
opPrReader.Parse( oParam, oOutputParagraph.m_oProperty, oConditionalTableStyle);
|
||||
oResultTableStyle = oConditionalTableStyle.ApplyTableStyle( oParam.poTableStyle );
|
||||
}
|
||||
@ -69,8 +72,10 @@ bool OOXParagraphReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputPa
|
||||
if( NULL != oResultTableStyle || PROP_DEF != oOutputParagraph.m_oProperty.m_nStyle )
|
||||
{
|
||||
poExternalStyle = RtfCharStylePtr( new RtfCharStyle() );
|
||||
|
||||
if( NULL != oResultTableStyle )
|
||||
poExternalStyle->Merge( oResultTableStyle );
|
||||
|
||||
if( PROP_DEF != oOutputParagraph.m_oProperty.m_nStyle )
|
||||
{
|
||||
RtfStylePtr oTempStyle;
|
||||
@ -82,6 +87,8 @@ bool OOXParagraphReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputPa
|
||||
}
|
||||
}
|
||||
|
||||
//m_oCharProperty = oOutputParagraph.m_oProperty.m_oCharProperty;
|
||||
|
||||
m_ooxElement = dynamic_cast<OOX::WritingElementWithChilds<OOX::WritingElement>*>(m_ooxParagraph);
|
||||
|
||||
bool res = Parse2(oParam ,oOutputParagraph, oConditionalTableStyle, poExternalStyle );
|
||||
@ -106,11 +113,12 @@ bool OOXParagraphReader::Parse2( ReaderParameter oParam , RtfParagraph& oOutputP
|
||||
case OOX::et_w_tbl:
|
||||
{
|
||||
oParam.oReader->m_nCurItap ++ ;
|
||||
RtfTablePtr oNewTable( new RtfTable() );
|
||||
RtfTablePtr oNewTable ( new RtfTable() );
|
||||
OOX::Logic::CTbl * pTbl = dynamic_cast<OOX::Logic::CTbl*>(m_ooxElement->m_arrItems[i]);
|
||||
|
||||
OOXTableReader oTableReader(pTbl);
|
||||
//oNewTable->m_oCharProperty = m_oCharProperty;
|
||||
//oNewTable->m_oCharProperty = oOutputParagraph.m_oProperty.m_oCharProperty;
|
||||
//Merge(oOutputParagraph.m_oProperty.m_oCharProperty)
|
||||
|
||||
oTableReader.Parse( oParam, *oNewTable);
|
||||
oOutputParagraph.AddItem( oNewTable );
|
||||
@ -120,7 +128,7 @@ bool OOXParagraphReader::Parse2( ReaderParameter oParam , RtfParagraph& oOutputP
|
||||
{
|
||||
OOX::Logic::CIns * pIns = dynamic_cast<OOX::Logic::CIns*>(m_ooxElement->m_arrItems[i]);
|
||||
|
||||
OOXParagraphReader oSubParReader(pIns);
|
||||
OOXParagraphReader oSubParReader(pIns);
|
||||
oSubParReader.m_oCharProperty = m_oCharProperty;
|
||||
oSubParReader.m_oCharProperty.m_nRevised = 1;
|
||||
|
||||
@ -167,18 +175,18 @@ bool OOXParagraphReader::Parse2( ReaderParameter oParam , RtfParagraph& oOutputP
|
||||
{
|
||||
OOX::Logic::CFldSimple * pFldSimple = dynamic_cast<OOX::Logic::CFldSimple*>(m_ooxElement->m_arrItems[i]);
|
||||
|
||||
RtfFieldPtr oCurField( new RtfField() );
|
||||
RtfFieldPtr oCurField ( new RtfField() );
|
||||
|
||||
oCurField->m_pInsert = RtfFieldInstPtr ( new RtfFieldInst() );
|
||||
oCurField->m_pResult = RtfFieldInstPtr ( new RtfFieldInst() );
|
||||
//добавляем insert
|
||||
RtfCharPtr pNewChar( new RtfChar() );
|
||||
RtfCharPtr pNewChar ( new RtfChar() );
|
||||
pNewChar->m_bRtfEncode = false;
|
||||
if (pFldSimple->m_sInstr.IsInit())
|
||||
{
|
||||
pNewChar->setText( pFldSimple->m_sInstr.get2() );
|
||||
}
|
||||
RtfParagraphPtr oNewInsertParagraph( new RtfParagraph() );
|
||||
RtfParagraphPtr oNewInsertParagraph ( new RtfParagraph() );
|
||||
oNewInsertParagraph->AddItem( pNewChar );
|
||||
oCurField->m_pInsert->m_pTextItems->AddItem( oNewInsertParagraph );
|
||||
|
||||
@ -240,8 +248,8 @@ bool OOXParagraphReader::Parse2( ReaderParameter oParam , RtfParagraph& oOutputP
|
||||
}
|
||||
RtfFieldPtr oCurField( new RtfField() );
|
||||
|
||||
oCurField->m_pInsert = RtfFieldInstPtr ( new RtfFieldInst() );
|
||||
oCurField->m_pResult = RtfFieldInstPtr ( new RtfFieldInst() );
|
||||
oCurField->m_pInsert = RtfFieldInstPtr ( new RtfFieldInst() );
|
||||
oCurField->m_pResult = RtfFieldInstPtr ( new RtfFieldInst() );
|
||||
//добавляем insert
|
||||
RtfCharPtr pNewChar( new RtfChar() );
|
||||
pNewChar->m_bRtfEncode = true;// false;
|
||||
@ -284,14 +292,14 @@ bool OOXParagraphReader::Parse2( ReaderParameter oParam , RtfParagraph& oOutputP
|
||||
{
|
||||
RtfFieldPtr oCurField( new RtfField() );
|
||||
|
||||
oCurField->m_pInsert = RtfFieldInstPtr ( new RtfFieldInst() );
|
||||
oCurField->m_pResult = RtfFieldInstPtr ( new RtfFieldInst() );
|
||||
oCurField->m_pInsert = RtfFieldInstPtr ( new RtfFieldInst() );
|
||||
oCurField->m_pResult = RtfFieldInstPtr ( new RtfFieldInst() );
|
||||
//добавляем insert
|
||||
RtfCharPtr pNewCharHYPER( new RtfChar() );
|
||||
RtfCharPtr pNewCharHYPER ( new RtfChar() );
|
||||
pNewCharHYPER->m_bRtfEncode = false;
|
||||
pNewCharHYPER->setText( L"HYPERLINK \\l \"" + pHyperlink->m_sAnchor.get() +L"\"");
|
||||
|
||||
RtfParagraphPtr oNewInsertParagraph( new RtfParagraph() );
|
||||
RtfParagraphPtr oNewInsertParagraph ( new RtfParagraph() );
|
||||
oNewInsertParagraph->AddItem( pNewCharHYPER );
|
||||
|
||||
oCurField->m_pInsert->m_pTextItems->AddItem( oNewInsertParagraph );
|
||||
@ -303,7 +311,7 @@ bool OOXParagraphReader::Parse2( ReaderParameter oParam , RtfParagraph& oOutputP
|
||||
//if( TRUE == bDirty )
|
||||
// oCurField->m_eMode = RtfField::fm_flddirty;
|
||||
|
||||
RtfParagraphPtr oNewResultParagraph( new RtfParagraph() );
|
||||
RtfParagraphPtr oNewResultParagraph ( new RtfParagraph() );
|
||||
//применяем к новому параграфу default property
|
||||
oNewResultParagraph->m_oProperty = oParam.oRtf->m_oDefaultParagraphProp;
|
||||
oNewResultParagraph->m_oProperty.m_oCharProperty = oParam.oRtf->m_oDefaultCharProp;
|
||||
@ -314,6 +322,7 @@ bool OOXParagraphReader::Parse2( ReaderParameter oParam , RtfParagraph& oOutputP
|
||||
{
|
||||
OOXParagraphReader oSubParReader(pHyperlink);
|
||||
oSubParReader.m_oCharProperty = m_oCharProperty;
|
||||
oSubParReader.m_oCharProperty.Merge(oOutputParagraph.m_oProperty.m_oCharProperty);
|
||||
|
||||
oSubParReader.Parse2( oParam, *oNewResultParagraph, CcnfStyle(), poExternalStyle);
|
||||
oCurField->m_pResult->m_pTextItems->AddItem( oNewResultParagraph );
|
||||
@ -324,7 +333,7 @@ bool OOXParagraphReader::Parse2( ReaderParameter oParam , RtfParagraph& oOutputP
|
||||
case OOX::et_w_bookmarkStart:
|
||||
{
|
||||
OOX::Logic::CBookmarkStart * pBookmarkStart = dynamic_cast<OOX::Logic::CBookmarkStart*>(m_ooxElement->m_arrItems[i]);
|
||||
RtfBookmarkStartPtr oNewBookmark( new RtfBookmarkStart() );
|
||||
RtfBookmarkStartPtr oNewBookmark ( new RtfBookmarkStart() );
|
||||
|
||||
oNewBookmark->m_sName = pBookmarkStart->m_sName.IsInit() ? pBookmarkStart->m_sName.get2() : L"";
|
||||
|
||||
@ -344,7 +353,7 @@ bool OOXParagraphReader::Parse2( ReaderParameter oParam , RtfParagraph& oOutputP
|
||||
{
|
||||
OOX::Logic::CBookmarkEnd * pBookmarkEnd = dynamic_cast<OOX::Logic::CBookmarkEnd*>(m_ooxElement->m_arrItems[i]);
|
||||
|
||||
RtfBookmarkEndPtr oNewBookmark( new RtfBookmarkEnd() );
|
||||
RtfBookmarkEndPtr oNewBookmark ( new RtfBookmarkEnd() );
|
||||
//oNewBookmark->m_sName = pBookmarkEnd->;
|
||||
|
||||
int nId = pBookmarkEnd->m_oId->GetValue();
|
||||
@ -374,21 +383,27 @@ bool OOXParagraphReader::Parse2( ReaderParameter oParam , RtfParagraph& oOutputP
|
||||
{
|
||||
OOX::Logic::COMath * pMath = dynamic_cast<OOX::Logic::COMath*>(m_ooxElement->m_arrItems[i]);
|
||||
|
||||
RtfMathPtr oNewMath( new RtfMath() );
|
||||
RtfMathPtr oNewMath ( new RtfMath() );
|
||||
oNewMath->SetOOXType( OOX::et_m_oMath );
|
||||
|
||||
OOXMathReader oMathRreader(pMath);
|
||||
if(true == oMathRreader.Parse( oParam, (*oNewMath) ) )
|
||||
|
||||
OOXMathReader oMathReader(pMath);
|
||||
oMathReader.m_oCharProperty = m_oCharProperty;
|
||||
oMathReader.m_oCharProperty.Merge(oOutputParagraph.m_oProperty.m_oCharProperty);
|
||||
|
||||
if(true == oMathReader.Parse( oParam, (*oNewMath) ) )
|
||||
oOutputParagraph.AddItem( oNewMath );
|
||||
}break;
|
||||
case OOX::et_m_oMathPara:
|
||||
{
|
||||
OOX::Logic::COMathPara * pMathPara = dynamic_cast<OOX::Logic::COMathPara*>(m_ooxElement->m_arrItems[i]);
|
||||
|
||||
RtfMathPtr oNewMath( new RtfMath() );
|
||||
RtfMathPtr oNewMath ( new RtfMath() );
|
||||
oNewMath->SetOOXType( OOX::et_m_oMathPara );
|
||||
|
||||
OOXMathReader oMathReader(pMathPara);
|
||||
oMathReader.m_oCharProperty = m_oCharProperty;
|
||||
oMathReader.m_oCharProperty.Merge(oOutputParagraph.m_oProperty.m_oCharProperty);
|
||||
|
||||
if(true == oMathReader.Parse( oParam, (*oNewMath) ) )
|
||||
oOutputParagraph.AddItem( oNewMath );
|
||||
}break;
|
||||
@ -434,7 +449,7 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
|
||||
//else
|
||||
sValue = ooxText->m_sText;
|
||||
|
||||
RtfCharPtr pNewChar( new RtfChar() );
|
||||
RtfCharPtr pNewChar ( new RtfChar() );
|
||||
|
||||
pNewChar->m_oProperty = oNewProperty;
|
||||
pNewChar->setText( sValue );
|
||||
@ -455,7 +470,7 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
|
||||
//else
|
||||
sValue = ooxText->m_sText;
|
||||
|
||||
RtfCharPtr pNewChar( new RtfChar() );
|
||||
RtfCharPtr pNewChar ( new RtfChar() );
|
||||
|
||||
pNewChar->m_oProperty = oNewProperty;
|
||||
pNewChar->setText( sValue );
|
||||
@ -472,7 +487,7 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
|
||||
{
|
||||
case SimpleTypes::fldchartypeBegin:
|
||||
{
|
||||
OOXFieldBeginPtr oNewField( new OOXFieldBegin() );
|
||||
OOXFieldBeginPtr oNewField ( new OOXFieldBegin() );
|
||||
if (ooxFldChar->m_oFldLock.IsInit())
|
||||
oNewField->m_bLock = ooxFldChar->m_oFldLock->ToBool();
|
||||
if (ooxFldChar->m_oDirty.IsInit())
|
||||
@ -483,12 +498,12 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
|
||||
}break;
|
||||
case SimpleTypes::fldchartypeEnd:
|
||||
{
|
||||
OOXFieldEndPtr oNewField( new OOXFieldEnd() );
|
||||
OOXFieldEndPtr oNewField ( new OOXFieldEnd() );
|
||||
oOutputParagraph.AddItem( oNewField );
|
||||
}break;
|
||||
case SimpleTypes::fldchartypeSeparate:
|
||||
{
|
||||
OOXFieldSeparatePtr oNewField( new OOXFieldSeparate() );
|
||||
OOXFieldSeparatePtr oNewField ( new OOXFieldSeparate() );
|
||||
oOutputParagraph.AddItem( oNewField );
|
||||
}break;
|
||||
}
|
||||
@ -497,9 +512,9 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
|
||||
case OOX::et_w_instrText:
|
||||
{
|
||||
OOX::Logic::CInstrText * ooxInstrText = dynamic_cast<OOX::Logic::CInstrText*>(ooxItem);
|
||||
OOXFieldInsertTextPtr oNewField( new OOXFieldInsertText() );
|
||||
OOXFieldInsertTextPtr oNewField ( new OOXFieldInsertText() );
|
||||
|
||||
RtfCharPtr pNewChar( new RtfChar() );
|
||||
RtfCharPtr pNewChar ( new RtfChar() );
|
||||
pNewChar->m_oProperty = oNewProperty;
|
||||
|
||||
if (ooxInstrText)
|
||||
@ -518,7 +533,7 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
|
||||
|
||||
if( oParam.oReader->m_mapFootnotes.end() != oPair )
|
||||
{
|
||||
RtfFootnotePtr oNewFootnote( new RtfFootnote() );
|
||||
RtfFootnotePtr oNewFootnote ( new RtfFootnote() );
|
||||
oNewFootnote->m_oCharProp = oNewProperty;
|
||||
oNewFootnote->m_oContent = oPair->second;
|
||||
|
||||
@ -536,7 +551,7 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
|
||||
|
||||
if( oParam.oReader->m_mapEndnotes.end() != oPair )
|
||||
{
|
||||
RtfFootnotePtr oNewEndnote( new RtfFootnote() );
|
||||
RtfFootnotePtr oNewEndnote ( new RtfFootnote() );
|
||||
oNewEndnote->m_oCharProp = oNewProperty;
|
||||
oNewEndnote->m_oContent = oPair->second;
|
||||
oNewEndnote->m_bEndNote = true;
|
||||
@ -558,7 +573,7 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
|
||||
|
||||
if (ooxObject->m_oShape.IsInit())
|
||||
{
|
||||
RtfShapePtr oNewShape( new RtfShape() );
|
||||
RtfShapePtr oNewShape ( new RtfShape() );
|
||||
|
||||
oNewShape->m_eAnchorTypeShape = RtfShape::st_inline;
|
||||
oNewShape->m_oCharProperty = oNewProperty;
|
||||
@ -570,14 +585,15 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
|
||||
|
||||
if (ooxObject->m_oOleObject.IsInit())
|
||||
{
|
||||
RtfOlePtr oNewOle( new RtfOle() );
|
||||
RtfOlePtr oNewOle ( new RtfOle() );
|
||||
|
||||
oNewOle->m_nWidth = nOleWidth; //?? todooo
|
||||
oNewOle->m_nHeight = nOleHeight;
|
||||
oNewOle->m_nWidth = nOleWidth; //?? todooo
|
||||
oNewOle->m_nHeight = nOleHeight;
|
||||
|
||||
int nShapeId = PROP_DEF;
|
||||
if (ooxObject->m_oOleObject->m_sShapeId.IsInit())
|
||||
nShapeId = oParam.oReader->m_oOOXIdGenerator.GetId(ooxObject->m_oOleObject->m_sShapeId.get2());
|
||||
|
||||
if( PROP_DEF != nShapeId )
|
||||
{
|
||||
oNewOle->m_nShapeId = nShapeId;
|
||||
@ -665,11 +681,11 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
|
||||
}
|
||||
}
|
||||
|
||||
TextItemContainerPtr oNewTextItemContainer( new TextItemContainer() );
|
||||
RtfParagraphPtr oNewPar( new RtfParagraph() );
|
||||
TextItemContainerPtr oNewTextItemContainer ( new TextItemContainer() );
|
||||
RtfParagraphPtr pNewPar ( new RtfParagraph() );
|
||||
|
||||
oNewPar->AddItem( oCurOle );
|
||||
oNewTextItemContainer->AddItem( oNewPar );
|
||||
pNewPar->AddItem( oCurOle );
|
||||
oNewTextItemContainer->AddItem( pNewPar );
|
||||
aPictShape->m_aTextItems = oNewTextItemContainer;
|
||||
|
||||
oCurOle->m_oResultPic = aPictShape;
|
||||
@ -680,7 +696,7 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
|
||||
case OOX::et_w_drawing:
|
||||
{
|
||||
OOX::Logic::CDrawing* ooxDrawing = dynamic_cast<OOX::Logic::CDrawing*>(ooxItem);
|
||||
RtfShapePtr pNewPicture( new RtfShape() );
|
||||
RtfShapePtr pNewPicture ( new RtfShape() );
|
||||
pNewPicture->m_oCharProperty = oNewProperty;
|
||||
|
||||
OOXPictureReader oPictureReader(ooxDrawing);
|
||||
@ -696,7 +712,7 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
|
||||
{
|
||||
if (ooxPicture->m_oShapeGroup.IsInit())
|
||||
{
|
||||
RtfShapeGroupPtr pNewShape( new RtfShapeGroup() );
|
||||
RtfShapeGroupPtr pNewShape ( new RtfShapeGroup() );
|
||||
pNewShape->m_oCharProperty = oNewProperty;
|
||||
|
||||
OOXShapeGroupReader oShapeGroupReader(ooxPicture->m_oShapeGroup.GetPointer());
|
||||
@ -705,7 +721,7 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
|
||||
}
|
||||
else
|
||||
{
|
||||
RtfShapePtr pNewShape( new RtfShape() );
|
||||
RtfShapePtr pNewShape ( new RtfShape() );
|
||||
pNewShape->m_oCharProperty = oNewProperty;
|
||||
|
||||
OOXShapeReader *pShapeReader = NULL;
|
||||
@ -731,7 +747,7 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
|
||||
}break;
|
||||
case OOX::et_w_nonBreakHyphen:
|
||||
{
|
||||
RtfCharSpecialPtr pNewChar( new RtfCharSpecial() );
|
||||
RtfCharSpecialPtr pNewChar ( new RtfCharSpecial() );
|
||||
pNewChar->m_oProperty = oNewProperty;
|
||||
pNewChar->m_eType = RtfCharSpecial::rsc_NonBrHyphen;
|
||||
|
||||
@ -739,7 +755,7 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
|
||||
}break;
|
||||
case OOX::et_w_softHyphen:
|
||||
{
|
||||
RtfCharSpecialPtr pNewChar( new RtfCharSpecial() );
|
||||
RtfCharSpecialPtr pNewChar ( new RtfCharSpecial() );
|
||||
pNewChar->m_oProperty = oNewProperty;
|
||||
pNewChar->m_eType = RtfCharSpecial::rsc_OptHyphen;
|
||||
|
||||
@ -747,7 +763,7 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
|
||||
}break;
|
||||
case OOX::et_w_pgNum:
|
||||
{
|
||||
RtfCharSpecialPtr pNewChar( new RtfCharSpecial() );
|
||||
RtfCharSpecialPtr pNewChar ( new RtfCharSpecial() );
|
||||
pNewChar->m_oProperty = oNewProperty;
|
||||
pNewChar->m_eType = RtfCharSpecial::rsc_chpgn;
|
||||
|
||||
@ -755,7 +771,7 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
|
||||
}break;
|
||||
case OOX::et_w_footnoteRef:
|
||||
{
|
||||
RtfCharSpecialPtr pNewChar( new RtfCharSpecial() );
|
||||
RtfCharSpecialPtr pNewChar ( new RtfCharSpecial() );
|
||||
pNewChar->m_oProperty = oNewProperty;
|
||||
pNewChar->m_eType = RtfCharSpecial::rsc_chftn;
|
||||
|
||||
@ -763,7 +779,7 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
|
||||
}break;
|
||||
case OOX::et_w_endnoteRef:
|
||||
{
|
||||
RtfCharSpecialPtr pNewChar( new RtfCharSpecial() );
|
||||
RtfCharSpecialPtr pNewChar ( new RtfCharSpecial() );
|
||||
pNewChar->m_oProperty = oNewProperty;
|
||||
pNewChar->m_eType = RtfCharSpecial::rsc_chftnEnd;
|
||||
|
||||
@ -771,7 +787,7 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
|
||||
}break;
|
||||
case OOX::et_w_separator:
|
||||
{
|
||||
RtfCharSpecialPtr pNewChar = RtfCharSpecialPtr( new RtfCharSpecial() );
|
||||
RtfCharSpecialPtr pNewChar ( new RtfCharSpecial() );
|
||||
pNewChar->m_oProperty = oNewProperty;
|
||||
pNewChar->m_eType = RtfCharSpecial::rsc_chftnsep;
|
||||
|
||||
@ -779,7 +795,7 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
|
||||
}break;
|
||||
case OOX::et_w_continuationSeparator:
|
||||
{
|
||||
RtfCharSpecialPtr pNewChar( new RtfCharSpecial() );
|
||||
RtfCharSpecialPtr pNewChar ( new RtfCharSpecial() );
|
||||
pNewChar->m_oProperty = oNewProperty;
|
||||
pNewChar->m_eType = RtfCharSpecial::rsc_chftnsepc;
|
||||
|
||||
@ -787,7 +803,7 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
|
||||
}break;
|
||||
case OOX::et_w_tab:
|
||||
{
|
||||
RtfCharSpecialPtr pNewChar( new RtfCharSpecial() );
|
||||
RtfCharSpecialPtr pNewChar ( new RtfCharSpecial() );
|
||||
pNewChar->m_oProperty = oNewProperty;
|
||||
pNewChar->m_eType = RtfCharSpecial::rsc_tab;
|
||||
|
||||
@ -797,7 +813,7 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
|
||||
{
|
||||
OOX::Logic::CBr *ooxBr = dynamic_cast<OOX::Logic::CBr*>(ooxItem);
|
||||
|
||||
RtfCharSpecialPtr pNewChar( new RtfCharSpecial() );
|
||||
RtfCharSpecialPtr pNewChar ( new RtfCharSpecial() );
|
||||
pNewChar->m_oProperty = oNewProperty;
|
||||
|
||||
if (ooxBr)
|
||||
@ -824,7 +840,7 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
|
||||
case OOX::et_mc_alternateContent:
|
||||
{//выбираем всегда более старую версию
|
||||
OOX::Logic::CAlternateContent *ooxAlt = dynamic_cast<OOX::Logic::CAlternateContent* >(ooxItem);
|
||||
if (ooxAlt->m_arrChoiceItems.size() > 0)
|
||||
if (!ooxAlt->m_arrChoiceItems.empty())
|
||||
{
|
||||
for (int i = 0; i < ooxAlt->m_arrFallbackItems.size(); i++)
|
||||
{
|
||||
@ -865,12 +881,12 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
|
||||
oCurFont.m_sName = sFont;
|
||||
oParam.oRtf->m_oFontTable.DirectAddItem( oCurFont );
|
||||
}
|
||||
RtfFieldPtr oNewField = RtfFieldPtr ( new RtfField() );
|
||||
RtfFieldPtr oNewField ( new RtfField() );
|
||||
|
||||
oNewField->m_pInsert = RtfFieldInstPtr( new RtfFieldInst() );
|
||||
oNewField->m_pResult = RtfFieldInstPtr( new RtfFieldInst() );
|
||||
oNewField->m_pInsert = RtfFieldInstPtr( new RtfFieldInst() );
|
||||
oNewField->m_pResult = RtfFieldInstPtr( new RtfFieldInst() );
|
||||
|
||||
RtfCharPtr pNewChar( new RtfChar() );
|
||||
RtfCharPtr pNewChar ( new RtfChar() );
|
||||
pNewChar->m_bRtfEncode = false;
|
||||
CString sFieldText;
|
||||
int nFontSize = 10;
|
||||
@ -884,7 +900,7 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
|
||||
|
||||
pNewChar->setText( sFieldText );
|
||||
|
||||
RtfParagraphPtr oNewInsertParagraph( new RtfParagraph() );
|
||||
RtfParagraphPtr oNewInsertParagraph ( new RtfParagraph() );
|
||||
oNewInsertParagraph->AddItem( pNewChar );
|
||||
oNewField->m_pInsert->m_pTextItems->AddItem( oNewInsertParagraph );
|
||||
|
||||
@ -904,7 +920,7 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
|
||||
oNewProperty = oParam.oRtf->m_oDefaultCharProp;
|
||||
|
||||
//применяем внешний стиль
|
||||
oNewProperty.Merge( oOutputParagraph.m_oProperty.m_oCharProperty );
|
||||
//oNewProperty.Merge( oOutputParagraph.m_oProperty.m_oCharProperty );
|
||||
oNewProperty.Merge( m_oCharProperty );
|
||||
|
||||
if( NULL != poStyle && TYPE_RTF_PROPERTY_STYLE_CHAR == poStyle->GetType() )
|
||||
@ -1257,7 +1273,7 @@ bool OOXpPrReader::Parse( ReaderParameter oParam ,RtfParagraphProperty& oOutputP
|
||||
oOutputProperty.m_nPrDate = RtfUtility::convertDateTime( sVal );
|
||||
}
|
||||
|
||||
RtfParagraphPropertyPtr props( new RtfParagraphProperty() );
|
||||
RtfParagraphPropertyPtr props ( new RtfParagraphProperty() );
|
||||
OOXpPrReader opPrReader(m_ooxParaProps->m_oPPrChange->m_pParPr.GetPointer());
|
||||
|
||||
CcnfStyle style;
|
||||
@ -1457,9 +1473,20 @@ bool OOXrPrReader::Parse( ReaderParameter oParam ,RtfCharProperty& oOutputProper
|
||||
}
|
||||
if(m_ooxRunProps->m_oShadow.IsInit())
|
||||
{
|
||||
oOutputProperty.m_poShading.m_nValue = m_ooxRunProps->m_oShadow->m_oVal.ToBool() ? 1 : 0;
|
||||
//OOXShadingReader oShadingReader(m_ooxRunProps->m_oShadow.GetPointer());
|
||||
//oShadingReader.Parse( oParam, oOutputProperty.m_poShading );
|
||||
}
|
||||
|
||||
if (m_ooxRunProps->m_oShd.IsInit())
|
||||
{
|
||||
if ((m_ooxRunProps->m_oShd->m_oFill.IsInit()) && (m_ooxRunProps->m_oShd->m_oFill->GetValue() == SimpleTypes::hexcolorRGB))
|
||||
{
|
||||
RtfColor oColor(m_ooxRunProps->m_oShd->m_oFill->Get_R(), m_ooxRunProps->m_oShd->m_oFill->Get_G(), m_ooxRunProps->m_oShd->m_oFill->Get_B());
|
||||
oOutputProperty.m_poShading.m_nBackColor = oParam.oRtf->m_oColorTable.AddItem( oColor );
|
||||
}
|
||||
|
||||
if (m_ooxRunProps->m_oShd->m_oColor.IsInit())
|
||||
{
|
||||
}
|
||||
{}//....
|
||||
}
|
||||
//--------------------------------------------------------------
|
||||
if (m_ooxRunProps->m_oIns.IsInit())
|
||||
@ -1501,7 +1528,7 @@ bool OOXrPrReader::Parse( ReaderParameter oParam ,RtfCharProperty& oOutputProper
|
||||
}
|
||||
|
||||
OOXrPrReader orPrReader(m_ooxRunProps->m_oRPrChange->m_pRunPr.GetPointer());
|
||||
RtfCharPropertyPtr props( new RtfCharProperty() );
|
||||
RtfCharPropertyPtr props ( new RtfCharProperty() );
|
||||
|
||||
if (orPrReader.Parse( oParam, *props.get() ))
|
||||
{
|
||||
@ -1951,7 +1978,7 @@ bool OOXSectionPropertyReader::Parse( ReaderParameter oParam , RtfSectionPropert
|
||||
oOutput.m_nSrDate = RtfUtility::convertDateTime( sVal );
|
||||
}
|
||||
|
||||
RtfSectionPropertyPtr props = RtfSectionPropertyPtr( new RtfSectionProperty() );
|
||||
RtfSectionPropertyPtr props ( new RtfSectionProperty() );
|
||||
OOXSectionPropertyReader opPrReader(m_ooxSectionProperty->m_oSectPrChange->m_pSecPr.GetPointer());
|
||||
|
||||
if (opPrReader.Parse( oParam, *props.get() ))
|
||||
|
||||
@ -45,7 +45,8 @@ public:
|
||||
{
|
||||
if (m_ooxInline == NULL) return false;
|
||||
|
||||
oOutput.m_oPicture = RtfPicturePtr( new RtfPicture() );
|
||||
oOutput.m_oPicture = RtfPicturePtr( new RtfPicture() );
|
||||
|
||||
oOutput.m_eAnchorTypeShape = RtfShape::st_inline;
|
||||
oOutput.m_nShapeType = 75;//NSOfficeDrawing::sptPictureFrame;
|
||||
oOutput.m_nLeft = 0;
|
||||
|
||||
@ -769,13 +769,13 @@ bool OOXShapeGroupReader::Parse( ReaderParameter oParam , RtfShapeGroupPtr& oOut
|
||||
|
||||
if (m_vmlGroup->m_arrItems[i]->getType() == OOX::et_v_group)
|
||||
{
|
||||
RtfShapeGroupPtr oNewShape( new RtfShapeGroup() );
|
||||
RtfShapeGroupPtr pNewShape( new RtfShapeGroup() );
|
||||
|
||||
OOXShapeGroupReader oShapeReader(dynamic_cast<OOX::Vml::CGroup*>(m_vmlGroup->m_arrItems[i]));
|
||||
|
||||
oNewShape->m_bInGroup = true;
|
||||
if( true == oShapeReader.Parse( oParam, oNewShape ) )
|
||||
oOutput->AddItem( oNewShape );
|
||||
pNewShape->m_bInGroup = true;
|
||||
if( true == oShapeReader.Parse( oParam, pNewShape ) )
|
||||
oOutput->AddItem( pNewShape );
|
||||
}
|
||||
else if ( m_vmlGroup->m_arrItems[i]->getType() == OOX::et_v_arc ||
|
||||
m_vmlGroup->m_arrItems[i]->getType() == OOX::et_v_line ||
|
||||
@ -786,13 +786,13 @@ bool OOXShapeGroupReader::Parse( ReaderParameter oParam , RtfShapeGroupPtr& oOut
|
||||
m_vmlGroup->m_arrItems[i]->getType() == OOX::et_v_polyline ||
|
||||
m_vmlGroup->m_arrItems[i]->getType() == OOX::et_v_shapetype)
|
||||
{
|
||||
RtfShapePtr oNewShape( new RtfShape() );//set type .. .todooo
|
||||
RtfShapePtr pNewShape ( new RtfShape() );//set type .. .todooo
|
||||
|
||||
OOXShapeReader oShapeReader(dynamic_cast<OOX::Vml::CVmlCommonElements*>(m_vmlGroup->m_arrItems[i]));
|
||||
|
||||
oNewShape->m_bInGroup = true;
|
||||
if( true == oShapeReader.Parse( oParam, oNewShape ) )
|
||||
oOutput->AddItem( oNewShape );
|
||||
pNewShape->m_bInGroup = true;
|
||||
if( true == oShapeReader.Parse( oParam, pNewShape ) )
|
||||
oOutput->AddItem( pNewShape );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -265,7 +265,7 @@ public:
|
||||
|
||||
if (oOutputStyle == NULL)
|
||||
{
|
||||
oOutputStyle = RtfStylePtr( new RtfTableStyle() );
|
||||
oOutputStyle = RtfStylePtr ( new RtfTableStyle() );
|
||||
oOutputStyle->m_nID = oParam.oRtf->m_oStyleTable.GetCount() + 1;
|
||||
}
|
||||
RtfStyle::_StyleType eStyleType = oOutputStyle->m_eType;//todooo проверить
|
||||
|
||||
@ -155,7 +155,7 @@ bool OOXTableReader::Parse( ReaderParameter oParam, RtfTable& oOutputTable )
|
||||
}
|
||||
else if( true == bExistTablPr )
|
||||
{
|
||||
RtfTableStylePtr poTableStyle = RtfTableStylePtr( new RtfTableStyle() );
|
||||
RtfTableStylePtr poTableStyle ( new RtfTableStyle() );
|
||||
poTableStyle->m_oTableProp.Merge( oOutputTable.m_oProperty ); // будут использованы ниже
|
||||
}
|
||||
|
||||
@ -178,7 +178,7 @@ bool OOXTableReader::Parse( ReaderParameter oParam, RtfTable& oOutputTable )
|
||||
ReaderParameter newParam = oParam;
|
||||
newParam.poTableStyle = poTableStyle;
|
||||
|
||||
RtfTableRowPtr oNewRow( new RtfTableRow() );
|
||||
RtfTableRowPtr oNewRow ( new RtfTableRow() );
|
||||
//применяем свойства таблицы к каждому row
|
||||
//т.к. в RTF нет свойств таблиц и все свойства записываются в свойства row
|
||||
(*((RtfTableProperty*)&oNewRow->m_oProperty)).Merge( oOutputTable.m_oProperty );
|
||||
|
||||
@ -47,7 +47,7 @@ public:
|
||||
|
||||
OOXTextItemReader( )
|
||||
{
|
||||
m_oTextItems = TextItemContainerPtr( new TextItemContainer() );
|
||||
m_oTextItems = TextItemContainerPtr ( new TextItemContainer() );
|
||||
}
|
||||
bool Parse( OOX::WritingElement* ooxElement, ReaderParameter oParam )
|
||||
{
|
||||
@ -58,7 +58,7 @@ public:
|
||||
OOX::Logic::CParagraph * pParagraph = dynamic_cast<OOX::Logic::CParagraph*>(ooxElement);
|
||||
|
||||
OOXParagraphReader m_oParagraphReader(pParagraph);
|
||||
RtfParagraphPtr oNewParagraph( new RtfParagraph() );
|
||||
RtfParagraphPtr oNewParagraph ( new RtfParagraph() );
|
||||
//применяем к новому параграфу default property
|
||||
oNewParagraph->m_oProperty = oParam.oRtf->m_oDefaultParagraphProp;
|
||||
oNewParagraph->m_oProperty.m_oCharProperty = oParam.oRtf->m_oDefaultCharProp;
|
||||
@ -81,9 +81,9 @@ public:
|
||||
case OOX::et_w_tbl:
|
||||
{
|
||||
OOX::Logic::CTbl * pTbl = dynamic_cast<OOX::Logic::CTbl*>(ooxElement);
|
||||
RtfTablePtr oNewTable( new RtfTable() );
|
||||
RtfTablePtr oNewTable ( new RtfTable() );
|
||||
|
||||
OOXTableReader oTableReader(pTbl);
|
||||
OOXTableReader oTableReader(pTbl);
|
||||
oParam.oReader->m_nCurItap = 1;
|
||||
if( true == oTableReader.Parse( oParam, (*oNewTable)) )
|
||||
{
|
||||
|
||||
@ -153,7 +153,9 @@ public:
|
||||
{
|
||||
if( NULL == oInputStyle )
|
||||
return oInputStyle;
|
||||
RtfTableStylePtr oOutputStyle = RtfTableStylePtr( new RtfTableStyle() );
|
||||
|
||||
RtfTableStylePtr oOutputStyle ( new RtfTableStyle() );
|
||||
|
||||
oOutputStyle->Merge( oInputStyle );
|
||||
if( true == bOddVBand && NULL != oInputStyle->m_oBandVerOdd )
|
||||
oOutputStyle->Merge( oInputStyle->m_oBandVerOdd );
|
||||
|
||||
@ -48,7 +48,8 @@ CString RtfBookmarkStart::RenderToRtf(RenderParameter oRenderParameter)
|
||||
sResult.AppendFormat(L"\\bkmkcoll%d", nLastColumn);
|
||||
|
||||
sResult += L" ";
|
||||
sResult += RtfChar::renderRtfText( m_sName, oRenderParameter.poDocument, NULL );
|
||||
RtfCharProperty* pCharProperty = NULL;
|
||||
sResult += RtfChar::renderRtfText( m_sName, oRenderParameter.poDocument, pCharProperty );
|
||||
sResult += L"}";
|
||||
return sResult;
|
||||
}
|
||||
@ -86,8 +87,11 @@ CString RtfBookmarkEnd::RenderToRtf(RenderParameter oRenderParameter)
|
||||
|
||||
sResult += L"{\\*\\bkmkend";
|
||||
sResult += L" ";
|
||||
sResult += RtfChar::renderRtfText( m_sName, oRenderParameter.poDocument, NULL );
|
||||
sResult += L"}";
|
||||
|
||||
RtfCharProperty* pCharProperty = NULL;
|
||||
sResult += RtfChar::renderRtfText( m_sName, oRenderParameter.poDocument, pCharProperty );
|
||||
|
||||
sResult += L"}";
|
||||
|
||||
return sResult;
|
||||
}
|
||||
|
||||
@ -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"\">";
|
||||
@ -146,14 +146,16 @@ CString RtfChar::renderTextToXML( CString sParam, bool bDelete )
|
||||
|
||||
CString RtfChar::renderRtfText( CString& sText, void* poDocument, RtfCharProperty* oCharProperty )
|
||||
{
|
||||
RtfDocument* oDocument = static_cast<RtfDocument*>(poDocument);
|
||||
CString sResult;
|
||||
RtfDocument* pDocument = static_cast<RtfDocument*>(poDocument);
|
||||
|
||||
int iFont = 0;
|
||||
if (oCharProperty) iFont = oCharProperty->m_nFont;
|
||||
|
||||
int nCodePage = -1;
|
||||
//применяем параметры codepage от текущего шрифта todo associated fonts.
|
||||
//todooo разобраться со шрифтами и их подбором
|
||||
RtfFont oFont;
|
||||
if( NULL != oCharProperty && true == oDocument->m_oFontTable.GetFont( oCharProperty->m_nFont, oFont ) )
|
||||
if( NULL != oCharProperty && true == pDocument->m_oFontTable.GetFont( oCharProperty->m_nFont, oFont ) )
|
||||
{
|
||||
if( PROP_DEF != oFont.m_nCharset )
|
||||
nCodePage = RtfUtility::CharsetToCodepage( oFont.m_nCharset );
|
||||
@ -161,15 +163,24 @@ CString RtfChar::renderRtfText( CString& sText, void* poDocument, RtfCharPropert
|
||||
nCodePage = oFont.m_nCodePage;
|
||||
}
|
||||
|
||||
return renderRtfText(sText, pDocument, nCodePage);
|
||||
|
||||
}
|
||||
|
||||
CString RtfChar::renderRtfText( CString& sText, void* poDocument, int nCodePage )
|
||||
{
|
||||
RtfDocument* pDocument = static_cast<RtfDocument*>(poDocument);
|
||||
CString sResult;
|
||||
|
||||
//от настроек документа
|
||||
if( -1 == nCodePage && RtfDocumentProperty::cp_none != oDocument->m_oProperty.m_eCodePage )
|
||||
if( -1 == nCodePage && RtfDocumentProperty::cp_none != pDocument->m_oProperty.m_eCodePage )
|
||||
{
|
||||
switch ( oDocument->m_oProperty.m_eCodePage )
|
||||
switch ( pDocument->m_oProperty.m_eCodePage )
|
||||
{
|
||||
case RtfDocumentProperty::cp_ansi:
|
||||
{
|
||||
if( PROP_DEF != oDocument->m_oProperty.m_nAnsiCodePage )
|
||||
nCodePage = oDocument->m_oProperty.m_nAnsiCodePage;
|
||||
if( PROP_DEF != pDocument->m_oProperty.m_nAnsiCodePage )
|
||||
nCodePage = pDocument->m_oProperty.m_nAnsiCodePage;
|
||||
else
|
||||
nCodePage = CP_ACP;
|
||||
break;
|
||||
@ -345,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"\">";
|
||||
@ -355,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"\">";
|
||||
|
||||
@ -209,7 +209,9 @@ public:
|
||||
return m_sChars;
|
||||
}
|
||||
CString RenderToOOX(RenderParameter oRenderParameter);
|
||||
static CString renderRtfText( CString& sText, void* poDocument, RtfCharProperty* oCharProperty = NULL );
|
||||
|
||||
static CString renderRtfText( CString& sText, void* poDocument, RtfCharProperty* oCharProperty = NULL );
|
||||
static CString renderRtfText( CString& sText, void* poDocument, int nCodePage );
|
||||
|
||||
CString RenderToRtf(RenderParameter oRenderParameter);
|
||||
private:
|
||||
|
||||
@ -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>";
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -94,6 +94,7 @@ public:
|
||||
}
|
||||
|
||||
void SetOOXType (int type);
|
||||
|
||||
CString RenderToRtf (RenderParameter oRenderParameter);
|
||||
CString RenderToOOX (RenderParameter oRenderParameter);
|
||||
};
|
||||
|
||||
@ -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"\">";
|
||||
|
||||
@ -725,6 +725,7 @@ CString RtfCharProperty::RenderToRtf(RenderParameter oRenderParameter)
|
||||
RENDER_RTF_INT( m_nCrDate, sResult, L"crdate" )
|
||||
|
||||
sResult += "{\\*\\oldcprops";
|
||||
sResult += L"\\plain";
|
||||
sResult += m_pOldCharProp->RenderToRtf(oRenderParameter);
|
||||
sResult += L"}";
|
||||
}
|
||||
@ -746,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"\">";
|
||||
@ -756,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"\">";
|
||||
@ -767,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"\"/>";
|
||||
@ -961,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;
|
||||
@ -1930,8 +1931,10 @@ CString RtfParagraphProperty::RenderToRtf(RenderParameter oRenderParameter)
|
||||
sResult += poLevelProp.m_oCharProp.RenderToRtf( oRenderParameter );
|
||||
//пишем текст
|
||||
CString strLevelProp = poLevelProp.GenerateListText();
|
||||
CString strChar = RtfChar::renderRtfText( strLevelProp, oRenderParameter.poDocument, NULL );
|
||||
sResult += strChar;
|
||||
|
||||
RtfCharProperty* pCharProperty = NULL;
|
||||
sResult += RtfChar::renderRtfText( strLevelProp, oRenderParameter.poDocument, pCharProperty );
|
||||
|
||||
//или картинку
|
||||
if( PROP_DEF != poLevelProp.m_nPictureIndex )
|
||||
{
|
||||
@ -2165,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;
|
||||
@ -2856,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;
|
||||
|
||||
@ -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;
|
||||
@ -858,10 +858,11 @@ CString RtfSectionProperty::SaveFile( TextItemContainerPtr oTarget, RenderParame
|
||||
sContent += sRootName;
|
||||
sContent += L" xmlns:ve=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\">";
|
||||
|
||||
RenderParameter oNewParameter = oRenderParameter;
|
||||
OOXRelsWriterPtr oNewRelsWr = OOXRelsWriterPtr( new OOXRelsWriter( sFilename, *poRtfDocument ) );
|
||||
RenderParameter oNewParameter = oRenderParameter;
|
||||
|
||||
OOXRelsWriterPtr oNewRelsWr ( new OOXRelsWriter( sFilename, *poRtfDocument ) );
|
||||
poOOXWriter->m_oCustomRelsWriter.push_back( oNewRelsWr );
|
||||
oNewParameter.poRels = oNewRelsWr.get();
|
||||
oNewParameter.poRels = oNewRelsWr.get();
|
||||
|
||||
sContent += oTarget->RenderToOOX(oNewParameter);
|
||||
sContent += L"</" + sRootName + L">";
|
||||
|
||||
@ -33,6 +33,8 @@
|
||||
#include "Writer/OOXWriter.h"
|
||||
#include "RtfOle.h"
|
||||
|
||||
#include "../../../UnicodeConverter/UnicodeConverter.h"
|
||||
|
||||
#include "../../../ASCOfficePPTXFile/Editor/Drawing/Shapes/BaseShape/PPTShape/PPTShape.h"
|
||||
|
||||
void RtfShape::SetDefault()
|
||||
@ -201,7 +203,7 @@ CString RtfShape::RenderToRtf(RenderParameter oRenderParameter)
|
||||
|
||||
sResult += m_oCharProperty.RenderToRtf( oRenderParameter );
|
||||
|
||||
if( st_inline == m_eAnchorTypeShape )
|
||||
if( st_inline == m_eAnchorTypeShape || st_none == m_eAnchorTypeShape)
|
||||
{
|
||||
if( NULL != m_oPicture && m_nShapeType == NSOfficeDrawing::sptPictureFrame)
|
||||
{
|
||||
@ -234,28 +236,50 @@ CString RtfShape::RenderToRtf(RenderParameter oRenderParameter)
|
||||
{
|
||||
sResult += L"{\\shp";
|
||||
sResult += L"{\\*\\shpinst";
|
||||
RENDER_RTF_INT( m_nID , sResult, L"shplid" );
|
||||
|
||||
RENDER_RTF_INT( m_nID , sResult, L"shplid" );
|
||||
|
||||
if (!m_bInGroup)
|
||||
{
|
||||
RENDER_RTF_INT( m_nLeft , sResult, L"shpleft" );
|
||||
RENDER_RTF_INT( m_nTop , sResult, L"shptop" );
|
||||
RENDER_RTF_INT( m_nBottom , sResult, L"shpbottom" );
|
||||
RENDER_RTF_INT( m_nRight , sResult, L"shpright" );
|
||||
RENDER_RTF_INT( m_nHeader , sResult, L"shpfhdr" );
|
||||
RENDER_RTF_INT( m_nWrapType , sResult, L"shpwr" );
|
||||
RENDER_RTF_INT( m_nWrapSideType , sResult, L"shpwrk" );
|
||||
RENDER_RTF_BOOL( m_bLockAnchor , sResult, L"shplockanchor" );
|
||||
m_bAllowOverlap = 1;
|
||||
m_bLayoutInCell = 1;
|
||||
m_nWrapType = 3;
|
||||
m_nWrapSideType = 0;
|
||||
m_bLockAnchor = 0;
|
||||
m_nZOrder = PROP_DEF;
|
||||
m_nZOrderRelative = PROP_DEF;
|
||||
m_nLeft = m_nTop = 0;
|
||||
m_nRelBottom = m_nRelRight = PROP_DEF;
|
||||
m_nPositionV = m_nPositionH = PROP_DEF;
|
||||
|
||||
RENDER_RTF_INT ( m_nLeft , sResult, L"shpleft" );
|
||||
RENDER_RTF_INT ( m_nTop , sResult, L"shptop" );
|
||||
RENDER_RTF_INT ( m_nRight , sResult, L"shpright" );
|
||||
RENDER_RTF_INT ( m_nBottom , sResult, L"shpbottom" );
|
||||
|
||||
RENDER_RTF_INT ( m_nHeader , sResult, L"shpfhdr" );
|
||||
|
||||
//sResult += L"\\shpbxcolumn";
|
||||
sResult += L"\\shpbxignore";
|
||||
//sResult += L"\\shpbypara";
|
||||
sResult += L"\\shpbyignore";
|
||||
|
||||
sResult.AppendFormat( L"{\\sp{\\sn fUseShapeAnchor}{\\sv %d}}", false);
|
||||
sResult.AppendFormat( L"{\\sp{\\sn fPseudoInline}{\\sv %d}}", true);
|
||||
RENDER_RTF_INT ( m_nWrapType , sResult, L"shpwr" );
|
||||
RENDER_RTF_INT ( m_nWrapSideType , sResult, L"shpwrk" );
|
||||
|
||||
//sResult += L"\\shpfblwtxt0";
|
||||
sResult += L"\\shplockanchor";
|
||||
|
||||
RENDER_RTF_INT ( m_nZOrder , sResult, L"shpz" );
|
||||
|
||||
sResult += L"{\\sp{\\sn fUseShapeAnchor}{\\sv 0}}";
|
||||
sResult += L"{\\sp{\\sn fPseudoInline}{\\sv 1}}";
|
||||
}
|
||||
|
||||
sResult += RenderToRtfShapeProperty( oRenderParameter );
|
||||
|
||||
|
||||
sResult += L"{\\sp{\\sn fLockPosition}{\\sv 1}}";
|
||||
sResult += L"{\\sp{\\sn fLockRotation}{\\sv 1}}";
|
||||
|
||||
//picture
|
||||
if( 0 != m_oPicture && m_nFillType == 1 || m_nFillType == 2 || m_nFillType == 9)
|
||||
{
|
||||
@ -271,33 +295,27 @@ CString RtfShape::RenderToRtf(RenderParameter oRenderParameter)
|
||||
sResult += L"}";
|
||||
}
|
||||
sResult += L"}";
|
||||
//if( 0 != m_oPicture )
|
||||
//{
|
||||
// sResult += L"{\\shprslt\\par\\plain";
|
||||
// sResult += m_oPicture->GenerateWMF( oRenderParameter ) );
|
||||
// sResult += L"\\par}";
|
||||
//}
|
||||
sResult += L"}";
|
||||
}
|
||||
}
|
||||
else
|
||||
else // anchor
|
||||
{
|
||||
sResult += L"{\\shp";
|
||||
sResult += L"{\\*\\shpinst";
|
||||
|
||||
RENDER_RTF_INT( m_nID , sResult, L"shplid" );
|
||||
RENDER_RTF_INT( m_nID , sResult, L"shplid" );
|
||||
|
||||
if (!m_bInGroup)
|
||||
{
|
||||
RENDER_RTF_INT( m_nLeft , sResult, L"shpleft" );
|
||||
RENDER_RTF_INT( m_nTop , sResult, L"shptop" );
|
||||
RENDER_RTF_INT( m_nBottom , sResult, L"shpbottom" );
|
||||
RENDER_RTF_INT( m_nRight , sResult, L"shpright" );
|
||||
RENDER_RTF_INT( m_nZOrder , sResult, L"shpz" );
|
||||
RENDER_RTF_INT( m_nHeader , sResult, L"shpfhdr" );
|
||||
RENDER_RTF_INT( m_nWrapType , sResult, L"shpwr" );
|
||||
RENDER_RTF_INT( m_nWrapSideType , sResult, L"shpwrk" );
|
||||
RENDER_RTF_BOOL( m_bLockAnchor , sResult, L"shplockanchor" );
|
||||
RENDER_RTF_INT ( m_nLeft , sResult, L"shpleft" );
|
||||
RENDER_RTF_INT ( m_nTop , sResult, L"shptop" );
|
||||
RENDER_RTF_INT ( m_nBottom , sResult, L"shpbottom" );
|
||||
RENDER_RTF_INT ( m_nRight , sResult, L"shpright" );
|
||||
RENDER_RTF_INT ( m_nZOrder , sResult, L"shpz" );
|
||||
RENDER_RTF_INT ( m_nHeader , sResult, L"shpfhdr" );
|
||||
RENDER_RTF_INT ( m_nWrapType , sResult, L"shpwr" );
|
||||
RENDER_RTF_INT ( m_nWrapSideType , sResult, L"shpwrk" );
|
||||
RENDER_RTF_BOOL ( m_bLockAnchor , sResult, L"shplockanchor" );
|
||||
|
||||
switch(m_eXAnchor)
|
||||
{
|
||||
@ -368,15 +386,17 @@ CString RtfShape::RenderToRtf(RenderParameter oRenderParameter)
|
||||
}
|
||||
CString RtfShape::RenderToRtfShapeProperty(RenderParameter oRenderParameter)
|
||||
{
|
||||
RtfDocument* pDocument = static_cast<RtfDocument*>(oRenderParameter.poDocument);
|
||||
|
||||
CString sResult;
|
||||
|
||||
//Position absolute
|
||||
if( PROP_DEF != m_nPositionH )
|
||||
sResult.AppendFormat( L"{\\sp{\\sn posh}{\\sv %d}}", m_nPositionH);
|
||||
sResult.AppendFormat( L"{\\sp{\\sn posh}{\\sv %d}}", m_nPositionH);
|
||||
if( PROP_DEF != m_nPositionHRelative )
|
||||
sResult.AppendFormat( L"{\\sp{\\sn posrelh}{\\sv %d}}", m_nPositionHRelative);
|
||||
if( PROP_DEF != m_nPositionV )
|
||||
sResult.AppendFormat( L"{\\sp{\\sn posv}{\\sv %d}}", m_nPositionV);
|
||||
sResult.AppendFormat( L"{\\sp{\\sn posv}{\\sv %d}}", m_nPositionV);
|
||||
|
||||
if( PROP_DEF != m_nPositionVRelative )
|
||||
sResult.AppendFormat( L"{\\sp{\\sn posrelv}{\\sv %d}}", m_nPositionVRelative);
|
||||
@ -391,15 +411,15 @@ CString RtfShape::RenderToRtfShapeProperty(RenderParameter oRenderParameter)
|
||||
if( PROP_DEF != m_nPositionVPct )
|
||||
sResult.AppendFormat( L"{\\sp{\\sn pctVertPos}{\\sv %d}}", m_nPositionVPct);
|
||||
if( PROP_DEF != m_nPctWidth )
|
||||
sResult.AppendFormat( L"{\\sp{\\sn pctHoriz}{\\sv %d}}", m_nPctWidth);
|
||||
sResult.AppendFormat( L"{\\sp{\\sn pctHoriz}{\\sv %d}}", m_nPctWidth);
|
||||
if( PROP_DEF != m_nPctHeight )
|
||||
sResult.AppendFormat( L"{\\sp{\\sn pctVert}{\\sv %d}}", m_nPctHeight);
|
||||
if( PROP_DEF != m_nPctWidthRelative )
|
||||
sResult.AppendFormat( L"{\\sp{\\sn sizerelh}{\\sv %d}}", m_nPctWidthRelative);
|
||||
sResult.AppendFormat( L"{\\sp{\\sn sizerelh}{\\sv %d}}", m_nPctWidthRelative);
|
||||
if( PROP_DEF != m_nPctHeightRelative )
|
||||
sResult.AppendFormat( L"{\\sp{\\sn sizerelv}{\\sv %d}}", m_nPctHeightRelative);
|
||||
sResult.AppendFormat( L"{\\sp{\\sn sizerelv}{\\sv %d}}", m_nPctHeightRelative);
|
||||
if( PROP_DEF != m_nColStart )
|
||||
sResult.AppendFormat( L"{\\sp{\\sn colStart}{\\sv %d}}", m_nColStart);
|
||||
sResult.AppendFormat( L"{\\sp{\\sn colStart}{\\sv %d}}", m_nColStart);
|
||||
if( PROP_DEF != m_nColSpan )
|
||||
sResult.AppendFormat( L"{\\sp{\\sn colSpan}{\\sv %d}}", m_nColSpan);
|
||||
//Rehydration
|
||||
@ -410,7 +430,7 @@ CString RtfShape::RenderToRtfShapeProperty(RenderParameter oRenderParameter)
|
||||
if( PROP_DEF != m_bIsBullet )
|
||||
sResult.AppendFormat( L"{\\sp{\\sn fIsBullet}{\\sv %d}}", m_bIsBullet);
|
||||
if( PROP_DEF != m_nRotation )
|
||||
sResult.AppendFormat( L"{\\sp{\\sn rotation}{\\sv %d}}", m_nRotation);
|
||||
sResult.AppendFormat( L"{\\sp{\\sn rotation}{\\sv %d}}", m_nRotation);
|
||||
if( PROP_DEF != m_bFlipV )
|
||||
sResult.AppendFormat( L"{\\sp{\\sn fFlipV}{\\sv %d}}", m_bFlipV);
|
||||
if( PROP_DEF != m_bFlipH )
|
||||
@ -431,7 +451,7 @@ CString RtfShape::RenderToRtfShapeProperty(RenderParameter oRenderParameter)
|
||||
if( PROP_DEF != m_nTexpRight)
|
||||
sResult.AppendFormat( L"{\\sp{\\sn dxTextRight}{\\sv %d}}", m_nTexpRight);
|
||||
if( PROP_DEF != m_nTexpBottom)
|
||||
sResult.AppendFormat( L"{\\sp{\\sn dyTextBottom}{\\sv %d}}", m_nTexpBottom);
|
||||
sResult.AppendFormat( L"{\\sp{\\sn dyTextBottom}{\\sv %d}}",m_nTexpBottom);
|
||||
|
||||
if( PROP_DEF != m_nAnchorText )
|
||||
sResult.AppendFormat( L"{\\sp{\\sn anchorText}{\\sv %d}}", m_nAnchorText);
|
||||
@ -451,14 +471,14 @@ CString RtfShape::RenderToRtfShapeProperty(RenderParameter oRenderParameter)
|
||||
if( PROP_DEF != m_bFitTextToShape )
|
||||
sResult.AppendFormat( L"{\\sp{\\sn fFitTextToShape}{\\sv %d}}", m_bFitTextToShape);
|
||||
if( PROP_DEF != m_nCcol )
|
||||
sResult.AppendFormat( L"{\\sp{\\sn ccol}{\\sv %d}}", m_nCcol);
|
||||
sResult.AppendFormat( L"{\\sp{\\sn ccol}{\\sv %d}}", m_nCcol);
|
||||
if( PROP_DEF != m_nTxdir )
|
||||
sResult.AppendFormat( L"{\\sp{\\sn txdir}{\\sv %d}}", m_nTxdir);
|
||||
if( PROP_DEF != m_nWrapText )
|
||||
sResult.AppendFormat( L"{\\sp{\\sn WrapText}{\\sv %d}}", m_nWrapText);
|
||||
sResult.AppendFormat( L"{\\sp{\\sn WrapText}{\\sv %d}}", m_nWrapText);
|
||||
//Geometry
|
||||
if( PROP_DEF != m_nAdjustValue[0] )
|
||||
sResult.AppendFormat( L"{\\sp{\\sn adjustValue}{\\sv %d}}", m_nAdjustValue[0] );
|
||||
sResult.AppendFormat( L"{\\sp{\\sn adjustValue}{\\sv %d}}", m_nAdjustValue[0] );
|
||||
if( PROP_DEF != m_nAdjustValue[1] )
|
||||
sResult.AppendFormat( L"{\\sp{\\sn adjust2Value}{\\sv %d}}", m_nAdjustValue[1] );
|
||||
if( PROP_DEF != m_nAdjustValue[2] )
|
||||
@ -476,14 +496,14 @@ CString RtfShape::RenderToRtfShapeProperty(RenderParameter oRenderParameter)
|
||||
if( PROP_DEF != m_nAdjustValue[8] )
|
||||
sResult.AppendFormat( L"{\\sp{\\sn adjust9Value}{\\sv %d}}", m_nAdjustValue[8] );
|
||||
if( PROP_DEF != m_nAdjustValue[9] )
|
||||
sResult.AppendFormat( L"{\\sp{\\sn adjust10Value}{\\sv %d}}", m_nAdjustValue[9] );
|
||||
sResult.AppendFormat( L"{\\sp{\\sn adjust10Value}{\\sv %d}}", m_nAdjustValue[9] );
|
||||
//custom
|
||||
if( PROP_DEF != m_nGeoLeft)
|
||||
sResult.AppendFormat( L"{\\sp{\\sn geoLeft}{\\sv %d}}", m_nGeoLeft );
|
||||
if( PROP_DEF != m_nGeoTop)
|
||||
sResult.AppendFormat( L"{\\sp{\\sn geoTop}{\\sv %d}}", m_nGeoTop);
|
||||
if( PROP_DEF != m_nGeoRight)
|
||||
sResult.AppendFormat( L"{\\sp{\\sn geoRight}{\\sv %d}}", m_nGeoRight );
|
||||
sResult.AppendFormat( L"{\\sp{\\sn geoRight}{\\sv %d}}", m_nGeoRight );
|
||||
if( PROP_DEF != m_nGeoBottom)
|
||||
sResult.AppendFormat( L"{\\sp{\\sn geoBottom}{\\sv %d}}", m_nGeoBottom );
|
||||
if( PROP_DEF != m_nShapePath)
|
||||
@ -514,7 +534,7 @@ CString RtfShape::RenderToRtfShapeProperty(RenderParameter oRenderParameter)
|
||||
if( PROP_DEF != m_nCropFromBottom )
|
||||
sResult.AppendFormat( L"{\\sp{\\sn cropFromBottom}{\\sv %d}}", m_nCropFromBottom );
|
||||
if( PROP_DEF != m_nCropFromLeft )
|
||||
sResult.AppendFormat( L"{\\sp{\\sn cropFromLeft}{\\sv %d}}", m_nCropFromLeft );
|
||||
sResult.AppendFormat( L"{\\sp{\\sn cropFromLeft}{\\sv %d}}", m_nCropFromLeft );
|
||||
if( PROP_DEF != m_nCropFromRight )
|
||||
sResult.AppendFormat( L"{\\sp{\\sn cropFromRight}{\\sv %d}}", m_nCropFromRight );
|
||||
//Grouped Shapes
|
||||
@ -525,24 +545,24 @@ CString RtfShape::RenderToRtfShapeProperty(RenderParameter oRenderParameter)
|
||||
if( PROP_DEF != m_nGroupRight )
|
||||
sResult.AppendFormat( L"{\\sp{\\sn groupRight}{\\sv %d}}", m_nGroupRight );
|
||||
if( PROP_DEF != m_nGroupTop )
|
||||
sResult.AppendFormat( L"{\\sp{\\sn groupTop}{\\sv %d}}", m_nGroupTop );
|
||||
sResult.AppendFormat( L"{\\sp{\\sn groupTop}{\\sv %d}}", m_nGroupTop );
|
||||
if( PROP_DEF != m_nRelBottom )
|
||||
sResult.AppendFormat( L"{\\sp{\\sn relBottom}{\\sv %d}}", m_nRelBottom );
|
||||
if( PROP_DEF != m_nRelLeft )
|
||||
sResult.AppendFormat( L"{\\sp{\\sn relLeft}{\\sv %d}}", m_nRelLeft );
|
||||
if( PROP_DEF != m_nRelRight )
|
||||
sResult.AppendFormat( L"{\\sp{\\sn relRight}{\\sv %d}}", m_nRelRight );
|
||||
sResult.AppendFormat( L"{\\sp{\\sn relRight}{\\sv %d}}", m_nRelRight );
|
||||
if( PROP_DEF != m_nRelTop )
|
||||
sResult.AppendFormat( L"{\\sp{\\sn relTop}{\\sv %d}}", m_nRelTop );
|
||||
if( PROP_DEF != m_nRelRotation)
|
||||
sResult.AppendFormat( L"{\\sp{\\sn relRotation}{\\sv %d}}", m_nRelRotation );
|
||||
if( PROP_DEF != m_nRelZOrder )
|
||||
sResult.AppendFormat( L"{\\sp{\\sn dhgt}{\\sv %d}}", m_nRelZOrder );
|
||||
sResult.AppendFormat( L"{\\sp{\\sn dhgt}{\\sv %d}}", m_nRelZOrder );
|
||||
//Fill
|
||||
if( 0 == m_bFilled )
|
||||
sResult += L"{\\sp{\\sn fFilled}{\\sv 0}}";
|
||||
if( PROP_DEF != m_nFillType )
|
||||
sResult.AppendFormat( L"{\\sp{\\sn fillType}{\\sv %d}}", m_nFillType );
|
||||
sResult.AppendFormat( L"{\\sp{\\sn fillType}{\\sv %d}}", m_nFillType );
|
||||
if( PROP_DEF != m_nFillColor )
|
||||
sResult.AppendFormat( L"{\\sp{\\sn fillColor}{\\sv %d}}", m_nFillColor );
|
||||
if( PROP_DEF != m_nFillColor2 )
|
||||
@ -550,7 +570,7 @@ CString RtfShape::RenderToRtfShapeProperty(RenderParameter oRenderParameter)
|
||||
if( PROP_DEF != m_nFillOpacity )
|
||||
sResult.AppendFormat( L"{\\sp{\\sn fillOpacity}{\\sv %d}}", ( m_nFillOpacity * 65536 /100 ) );
|
||||
if( PROP_DEF != m_nFillFocus )
|
||||
sResult.AppendFormat( L"{\\sp{\\sn fillFocus}{\\sv %d}}", m_nFillFocus );
|
||||
sResult.AppendFormat( L"{\\sp{\\sn fillFocus}{\\sv %d}}", m_nFillFocus );
|
||||
if( PROP_DEF != m_nFillAngle )
|
||||
sResult.AppendFormat( L"{\\sp{\\sn fillAngle}{\\sv %d}}", m_nFillAngle * 65536 );
|
||||
//Line
|
||||
@ -561,11 +581,11 @@ CString RtfShape::RenderToRtfShapeProperty(RenderParameter oRenderParameter)
|
||||
if( PROP_DEF != m_nLineStartArrow )
|
||||
sResult.AppendFormat( L"{\\sp{\\sn lineStartArrowhead}{\\sv %d}}", m_nLineStartArrow );
|
||||
if( PROP_DEF != m_nLineEndArrow )
|
||||
sResult.AppendFormat( L"{\\sp{\\sn lineEndArrowhead}{\\sv %d}}", m_nLineEndArrow );
|
||||
sResult.AppendFormat( L"{\\sp{\\sn lineEndArrowhead}{\\sv %d}}", m_nLineEndArrow );
|
||||
if( PROP_DEF != m_nLineStartArrowWidth )
|
||||
sResult.AppendFormat( L"{\\sp{\\sn lineStartArrowWidth}{\\sv %d}}", m_nLineStartArrowWidth );
|
||||
if( PROP_DEF != m_nLineStartArrowLength )
|
||||
sResult.AppendFormat( L"{\\sp{\\sn lineStartArrowLength}{\\sv %d}}", m_nLineStartArrowLength );
|
||||
sResult.AppendFormat( L"{\\sp{\\sn lineStartArrowLength}{\\sv %d}}",m_nLineStartArrowLength );
|
||||
if( PROP_DEF != m_nLineEndArrowWidth )
|
||||
sResult.AppendFormat( L"{\\sp{\\sn lineEndArrowWidth}{\\sv %d}}", m_nLineEndArrowWidth );
|
||||
if( PROP_DEF != m_nLineEndArrowLength )
|
||||
@ -588,16 +608,31 @@ CString RtfShape::RenderToRtfShapeProperty(RenderParameter oRenderParameter)
|
||||
{
|
||||
sResult.AppendFormat( L"{\\sp{\\sn fGtext}{\\sv %d}}", m_bGtext );
|
||||
|
||||
if( !m_sGtextUNICODE.IsEmpty() )
|
||||
{
|
||||
sResult += L"{\\sp{\\sn gtextUNICODE}{\\sv ";
|
||||
sResult += m_sGtextUNICODE + L"}}";
|
||||
}
|
||||
int nCodePage = -1;
|
||||
|
||||
if( !m_sGtextFont.IsEmpty() )
|
||||
{
|
||||
sResult += L"{\\sp{\\sn gtextFont}{\\sv ";
|
||||
sResult += m_sGtextFont + L"}}";
|
||||
|
||||
//---------------------------------
|
||||
RtfFont oFont;
|
||||
if( true == pDocument->m_oFontTable.GetFont( m_sGtextFont, oFont ) )
|
||||
{
|
||||
if( PROP_DEF != oFont.m_nCharset )
|
||||
nCodePage = RtfUtility::CharsetToCodepage( oFont.m_nCharset );
|
||||
else if( PROP_DEF != oFont.m_nCodePage )
|
||||
nCodePage = oFont.m_nCodePage;
|
||||
}
|
||||
}
|
||||
|
||||
if( !m_sGtextUNICODE.IsEmpty() )
|
||||
{
|
||||
sResult += L"{\\sp{\\sn gtextUNICODE}{\\sv ";
|
||||
sResult += RtfChar::renderRtfText(m_sGtextUNICODE, oRenderParameter.poDocument, nCodePage);
|
||||
sResult += L"}}";
|
||||
}
|
||||
|
||||
if( PROP_DEF != m_nGtextSize ) sResult.AppendFormat( L"{\\sp{\\sn gtextSize}{\\sv %d}}", m_nGtextSize );
|
||||
if( PROP_DEF != m_bGtextFVertical ) sResult.AppendFormat( L"{\\sp{\\sn gtextFVertical}{\\sv %d}}", m_bGtextFVertical);
|
||||
if( PROP_DEF != m_bGtextFKern ) sResult.AppendFormat( L"{\\sp{\\sn gtextFKern}{\\sv %d}}", m_bGtextFKern);
|
||||
@ -718,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"\">";
|
||||
@ -728,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"\">";
|
||||
@ -1371,7 +1406,7 @@ CString RtfShapeGroup::RenderToRtf(RenderParameter oRenderParameter)
|
||||
sResult += L"{\\shpgrp";
|
||||
sResult += L"{\\*\\shpinst";
|
||||
|
||||
RENDER_RTF_INT( m_nID , sResult, L"shplid" );
|
||||
RENDER_RTF_INT( m_nID , sResult, L"shplid" );
|
||||
|
||||
if (!m_bInGroup)
|
||||
{
|
||||
@ -1380,15 +1415,16 @@ CString RtfShapeGroup::RenderToRtf(RenderParameter oRenderParameter)
|
||||
RENDER_RTF_INT( m_nBottom , sResult, L"shpbottom" );
|
||||
RENDER_RTF_INT( m_nRight , sResult, L"shpright" );
|
||||
RENDER_RTF_INT( m_nHeader , sResult, L"shpfhdr" );
|
||||
RENDER_RTF_INT( m_nWrapType , sResult, L"shpwr" );
|
||||
RENDER_RTF_INT( m_nWrapSideType , sResult, L"shpwrk" );
|
||||
RENDER_RTF_BOOL( m_bLockAnchor , sResult, L"shplockanchor" );
|
||||
|
||||
sResult += L"\\shpbxignore";
|
||||
sResult += L"\\shpbyignore";
|
||||
|
||||
sResult.AppendFormat( L"{\\sp{\\sn fUseShapeAnchor}{\\sv %d}}", false);
|
||||
sResult.AppendFormat( L"{\\sp{\\sn fPseudoInline}{\\sv %d}}", true);
|
||||
|
||||
RENDER_RTF_INT( m_nWrapType , sResult, L"shpwr" );
|
||||
RENDER_RTF_INT( m_nWrapSideType , sResult, L"shpwrk" );
|
||||
RENDER_RTF_BOOL( m_bLockAnchor , sResult, L"shplockanchor" );
|
||||
|
||||
//sResult += L"{\\sp{\\sn fUseShapeAnchor}{\\sv 0}}";
|
||||
//sResult += L"{\\sp{\\sn fPseudoInline}{\\sv 1}}";
|
||||
}
|
||||
|
||||
|
||||
@ -1406,7 +1442,7 @@ CString RtfShapeGroup::RenderToRtf(RenderParameter oRenderParameter)
|
||||
sResult += L"{\\shpgrp";
|
||||
sResult += L"{\\*\\shpinst";
|
||||
|
||||
RENDER_RTF_INT( m_nID , sResult, L"shplid" );
|
||||
RENDER_RTF_INT( m_nID , sResult, L"shplid" );
|
||||
|
||||
if (!m_bInGroup)
|
||||
{
|
||||
|
||||
@ -302,7 +302,7 @@ namespace OOX
|
||||
if ( m_oSup.IsInit() )
|
||||
sResult += m_oSup->toXML();
|
||||
|
||||
sResult += _T("</m:oMathPara>");
|
||||
sResult += _T("</m:nary>");
|
||||
|
||||
return sResult;
|
||||
}
|
||||
|
||||
@ -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;
|
||||
};
|
||||
|
||||
@ -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())
|
||||
{
|
||||
|
||||
@ -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_
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -853,7 +853,10 @@ namespace NSHtmlRenderer
|
||||
{
|
||||
// stroke
|
||||
m_oDocument.WriteString(L"<path style=\"fill:none;stroke:", 30);
|
||||
m_oDocument.WriteHexColor3(m_pPen->Color);
|
||||
if (bStroke)
|
||||
m_oDocument.WriteHexColor3(m_pPen->Color);
|
||||
else
|
||||
m_oDocument.WriteString(L"none");
|
||||
m_oDocument.WriteString(L";stroke-width:", 14);
|
||||
m_oDocument.AddInt(nPenW);
|
||||
m_oDocument.WriteString(L";stroke-opacity:", 16);
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
QT -= core
|
||||
QT -= gui
|
||||
|
||||
VERSION = 2.0.2.408
|
||||
VERSION = 2.0.2.412
|
||||
DEFINES += INTVER=$$VERSION
|
||||
|
||||
TARGET = x2t
|
||||
|
||||
@ -2596,7 +2596,7 @@ namespace NExtractTools
|
||||
case TCD_PPT2PPTX:
|
||||
{
|
||||
result = ppt2pptx (sFileFrom, sFileTo, sTempDir, oInputParams);
|
||||
}
|
||||
}break;
|
||||
case TCD_PPT2PPTT:
|
||||
{
|
||||
result = ppt2pptt (sFileFrom, sFileTo, sTempDir, oInputParams);
|
||||
@ -2668,7 +2668,7 @@ namespace NExtractTools
|
||||
case TCD_ODF2OOT_BIN:
|
||||
{
|
||||
result = odf2oot_bin (sFileFrom, sFileTo, sTempDir, oInputParams);
|
||||
}
|
||||
}break;
|
||||
case TCD_DOCX2ODT:
|
||||
{
|
||||
result = docx2odt (sFileFrom, sFileTo, sTempDir, oInputParams);
|
||||
|
||||
Reference in New Issue
Block a user