Compare commits

..

14 Commits

29 changed files with 1837 additions and 1659 deletions

View File

@ -1353,6 +1353,7 @@ namespace DocFileFormat
fEndNestingLevel = ( iter->Arguments[0] == 1 ) ? (true) : (false);
}break;
case sprmOldPFInTable:
case sprmPItap:
{
iTap_current = FormatUtils::BytesToUInt32( iter->Arguments, 0, iter->argumentsSize );

View File

@ -354,7 +354,7 @@ namespace DocFileFormat
int nComputedCellWidthsGrid = 0;
for (size_t ccc = 0; ccc <= _gridIndex; ccc++)
for (size_t ccc = 0; ccc < _grid->size() && ccc <= _gridIndex; ccc++)
{
nComputedCellWidthsGrid += _grid->at(ccc);
}

View File

@ -232,6 +232,7 @@ void docx_serialize_image_child(std::wostream & strm, _docx_drawing & val)
}
oox_serialize_ln(CP_XML_STREAM(), val.additional);
oox_serialize_effects(CP_XML_STREAM(), val.additional);
}
}
}
@ -267,6 +268,7 @@ void docx_serialize_shape_child(std::wostream & strm, _docx_drawing & val)
val.serialize_shape (CP_XML_STREAM());
oox_serialize_ln(CP_XML_STREAM(), val.additional);
oox_serialize_effects(CP_XML_STREAM(), val.additional);
}
val.serialize_text(CP_XML_STREAM());
}

View File

@ -141,6 +141,67 @@ static const std::wstring _vmlDashStyle[]=
L"dashdot",
L"shortdashdotdot"
};
void oox_serialize_effects(std::wostream & strm, const std::vector<odf_reader::_property> & prop)
{
_CP_OPT(bool) bShadow;
_CP_OPT(std::wstring) strShadowColor;
_CP_OPT(double) dShadowOpacity;
_CP_OPT(double) dShadowOffsetX;
_CP_OPT(double) dShadowOffsetY;
odf_reader::GetProperty(prop, L"shadow", bShadow);
odf_reader::GetProperty(prop, L"shadow-color", strShadowColor);
odf_reader::GetProperty(prop, L"shadow-opacity", dShadowOpacity);
odf_reader::GetProperty(prop, L"shadow-offset-x", dShadowOffsetX);
odf_reader::GetProperty(prop, L"shadow-offset-y", dShadowOffsetY);
CP_XML_WRITER(strm)
{
CP_XML_NODE(L"a:effectLst")
{
if ((bShadow) && (*bShadow))
{
CP_XML_NODE(L"a:outerShdw")
{
//CP_XML_ATTR(L"blurRad", 0);
double offsetX = dShadowOffsetX.get_value_or(0);
double offsetY = dShadowOffsetY.get_value_or(0);
double dist = sqrt(offsetX * offsetX + offsetY * offsetY);
double dir = (offsetX > 0 ? atan(offsetY / offsetX) : 0) * 180. / 3.1415926;
CP_XML_ATTR(L"dist", (int)(dist));
CP_XML_ATTR(L"dir", (int)(dir * 60000));
CP_XML_ATTR(L"rotWithShape", L"0");
CP_XML_ATTR(L"algn", L"tl");
CP_XML_NODE(L"a:srgbClr")
{
if (strShadowColor)
{
CP_XML_ATTR(L"val", *strShadowColor);
}
else
{
CP_XML_ATTR(L"val", L"000000");
}
if (dShadowOpacity)
{
CP_XML_NODE(L"a:alpha")
{
CP_XML_ATTR(L"val", *dShadowOpacity * 1000);
}
}
}
}
}
}
}
}
void oox_serialize_ln(std::wostream & strm, const std::vector<odf_reader::_property> & prop, bool always_draw, const std::wstring &ns)
{
std::wstring ns_att = (ns == L"a" ? L"" : ns + L":");
@ -199,7 +260,7 @@ void oox_serialize_ln(std::wostream & strm, const std::vector<odf_reader::_prope
CP_XML_NODE(ns + L":srgbClr")
{
CP_XML_ATTR2(ns_att + L"val",color);
CP_XML_ATTR2(ns_att + L"val", color);
if (dStrokeOpacity)
{

View File

@ -124,6 +124,7 @@ namespace oox {
void oox_serialize_ln (std::wostream & strm, const std::vector<odf_reader::_property> & val, bool always_draw = false, const std::wstring &ns = L"a");
void oox_serialize_aLst (std::wostream & strm, const std::vector<odf_reader::_property> & val, const std::wstring & shapeGeomPreset, const std::wstring &ns = L"a");
void oox_serialize_action (std::wostream & strm, const _action_desc & val);
void oox_serialize_effects (std::wostream & strm, const std::vector<odf_reader::_property> & val);
void vml_serialize_ln (std::wostream & strm, const std::vector<odf_reader::_property> & val);
}

View File

@ -101,6 +101,7 @@ void pptx_serialize_image(std::wostream & strm, _pptx_drawing & val)
CP_XML_NODE(L"a:avLst");
}
oox_serialize_ln(CP_XML_STREAM(), val.additional);
oox_serialize_effects(CP_XML_STREAM(), val.additional);
}
//_CP_OPT(std::wstring) strTextContent;
//odf::GetProperty(properties,L"text-content",strTextContent);
@ -186,7 +187,8 @@ void pptx_serialize_media(std::wostream & strm, _pptx_drawing & val)
}
oox_serialize_fill (CP_XML_STREAM(), val.fill);
oox_serialize_ln (CP_XML_STREAM(), val.additional);
}
oox_serialize_effects(CP_XML_STREAM(), val.additional);
}
//_CP_OPT(std::wstring) strTextContent;
//odf::GetProperty(properties,L"text-content",strTextContent);
//pptx_serialize_text(CP_XML_STREAM(),val.additional);
@ -248,6 +250,7 @@ void pptx_serialize_shape(std::wostream & strm, _pptx_drawing & val)
val.serialize_shape(CP_XML_STREAM());
oox_serialize_ln(CP_XML_STREAM(), val.additional);
oox_serialize_effects(CP_XML_STREAM(), val.additional);
}
}
pptx_serialize_text(CP_XML_STREAM(), val);
@ -307,6 +310,7 @@ void pptx_serialize_connector(std::wostream & strm, _pptx_drawing & val)
val.serialize_shape(CP_XML_STREAM());
oox_serialize_ln(CP_XML_STREAM(), val.additional);
oox_serialize_effects(CP_XML_STREAM(), val.additional);
}
}
pptx_serialize_text(CP_XML_STREAM(), val);

View File

@ -301,14 +301,32 @@ void common_background_color_attlist::serialize(CP_ATTR_NODE)
void common_shadow_attlist::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
CP_APPLY_ATTR(L"style:shadow", style_shadow_);
CP_APPLY_ATTR(L"draw:shadow", draw_shadow_);
CP_APPLY_ATTR(L"draw:shadow-opacity", draw_shadow_opacity_);
CP_APPLY_ATTR(L"draw:shadow-color", draw_shadow_color_);
CP_APPLY_ATTR(L"draw:shadow-offset-y", draw_shadow_offset_y_);
CP_APPLY_ATTR(L"draw:shadow-offset-x", draw_shadow_offset_x_);
}
void common_shadow_attlist::apply_from(const common_shadow_attlist & Other)
{
_CP_APPLY_PROP(style_shadow_, Other.style_shadow_);
_CP_APPLY_PROP(style_shadow_, Other.style_shadow_);
_CP_APPLY_PROP(draw_shadow_, Other.draw_shadow_);
_CP_APPLY_PROP(draw_shadow_opacity_, Other.draw_shadow_opacity_);
_CP_APPLY_PROP(draw_shadow_color_, Other.draw_shadow_color_);
_CP_APPLY_PROP(draw_shadow_offset_y_, Other.draw_shadow_offset_y_);
_CP_APPLY_PROP(draw_shadow_offset_x_, Other.draw_shadow_offset_x_);
}
void common_shadow_attlist::serialize(CP_ATTR_NODE)
{
CP_XML_ATTR_OPT(L"style:shadow", style_shadow_);
CP_XML_ATTR_OPT(L"draw:shadow", draw_shadow_);
CP_XML_ATTR_OPT(L"draw:shadow-opacity", draw_shadow_opacity_);
CP_XML_ATTR_OPT(L"draw:shadow-color", draw_shadow_color_);
CP_XML_ATTR_OPT(L"draw:shadow-offset-y", draw_shadow_offset_y_);
CP_XML_ATTR_OPT(L"draw:shadow-offset-x", draw_shadow_offset_x_);
}
//////////////////////////////////////////////////////////////////////////////////////////////////

View File

@ -214,8 +214,13 @@ public:
void apply_from(const common_shadow_attlist & Other);
void serialize(CP_ATTR_NODE);
_CP_OPT(shadow_type) style_shadow_;
_CP_OPT(shadow_type) style_shadow_;
_CP_OPT(odf_types::shadow_type1) draw_shadow_;
_CP_OPT(odf_types::percent) draw_shadow_opacity_;
_CP_OPT(odf_types::color) draw_shadow_color_;
_CP_OPT(odf_types::length) draw_shadow_offset_y_;
_CP_OPT(odf_types::length) draw_shadow_offset_x_;
};
// common-keep-with-next-attlist

View File

@ -913,9 +913,9 @@ void common_draw_docx_convert(oox::docx_conversion_context & Context, union_comm
{
drawing->posOffsetV = (int)(length(0.01, length::cm).get_value_unit(length::emu));
}
//////////////////////////////////////////////
//----------------------------------------------------
graphicProperties.apply_to(drawing->additional);
//////////////////////////////////////////
//----------------------------------------------------
bool bTxbx = (drawing->sub_type == 1);
Compute_GraphicFill(graphicProperties.common_draw_fill_attlist_, graphicProperties.style_background_image_, Context.root()->odf_context().drawStyles(),drawing->fill, bTxbx);
@ -926,7 +926,7 @@ void common_draw_docx_convert(oox::docx_conversion_context & Context, union_comm
drawing->fill.bitmap->rId = Context.get_mediaitems()->add_or_find(href, oox::typeImage, drawing->fill.bitmap->isInternal, href);
}
////////////////////////////////////////////////////
//----------------------------------------------------
drawing->additional.push_back(odf_reader::_property(L"border_width_left", Compute_BorderWidth(graphicProperties, sideLeft)));
drawing->additional.push_back(odf_reader::_property(L"border_width_top", Compute_BorderWidth(graphicProperties, sideTop)));
drawing->additional.push_back(odf_reader::_property(L"border_width_right", Compute_BorderWidth(graphicProperties, sideRight)));
@ -941,7 +941,8 @@ void common_draw_docx_convert(oox::docx_conversion_context & Context, union_comm
}
}
///////////////////////////
//----------------------------------------------------
//----------------------------------------------------
if (attlists_.rel_size_.common_draw_size_attlist_.svg_width_)
{
double w_shape = attlists_.rel_size_.common_draw_size_attlist_.svg_width_->get_value_unit(length::pt);

View File

@ -158,13 +158,22 @@ void graphic_format_properties::apply_to(std::vector<_property> & properties)
{
properties.push_back(_property(L"contrast", common_draw_fill_attlist_.draw_contrast_->get_value()));
}
if (common_shadow_attlist_.draw_shadow_.get_value_or(shadow_type1::Hidden).get_type() == shadow_type1::Visible)
{
properties.push_back(_property(L"shadow", true));
if (common_shadow_attlist_.draw_shadow_color_) properties.push_back(_property(L"shadow-color", common_shadow_attlist_.draw_shadow_color_->get_hex_value()));
if (common_shadow_attlist_.draw_shadow_opacity_) properties.push_back(_property(L"shadow-opacity", common_shadow_attlist_.draw_shadow_opacity_->get_value()));
if (common_shadow_attlist_.draw_shadow_offset_x_) properties.push_back(_property(L"shadow-offset-x", common_shadow_attlist_.draw_shadow_offset_x_->get_value_unit(length::emu)));
if (common_shadow_attlist_.draw_shadow_offset_y_) properties.push_back(_property(L"shadow-offset-y", common_shadow_attlist_.draw_shadow_offset_y_->get_value_unit(length::emu)));
}
if (common_padding_attlist_.fo_padding_)
{
properties.push_back(_property(L"text-padding-left", common_padding_attlist_.fo_padding_->get_value_unit(length::emu)));
properties.push_back(_property(L"text-padding-right", common_padding_attlist_.fo_padding_->get_value_unit(length::emu)));
properties.push_back(_property(L"text-padding-top", common_padding_attlist_.fo_padding_->get_value_unit(length::emu)));
properties.push_back(_property(L"text-padding-bottom", common_padding_attlist_.fo_padding_->get_value_unit(length::emu)));
}else
}
else
{
if (common_padding_attlist_.fo_padding_left_)
properties.push_back(_property(L"text-padding-left", common_padding_attlist_.fo_padding_left_->get_value_unit(length::emu)));

View File

@ -1343,17 +1343,17 @@ void odf_drawing_context::set_shadow(int type, std::wstring hexColor, _CP_OPT(do
if (std::wstring::npos == res)
hexColor = std::wstring(L"#") + hexColor;
impl_->current_graphic_properties->draw_shadow_offset_x_ = length(length(dist_pt,length::pt).get_value_unit(length::cm),length::cm);
impl_->current_graphic_properties->common_shadow_attlist_.draw_shadow_offset_x_ = length(length(dist_pt, length::pt).get_value_unit(length::cm), length::cm);
if (dist_pt_y > 0)
impl_->current_graphic_properties->draw_shadow_offset_y_ = length(length(dist_pt_y,length::pt).get_value_unit(length::cm),length::cm);
impl_->current_graphic_properties->common_shadow_attlist_.draw_shadow_offset_y_ = length(length(dist_pt_y, length::pt).get_value_unit(length::cm), length::cm);
else
impl_->current_graphic_properties->draw_shadow_offset_y_ = length(length(dist_pt,length::pt).get_value_unit(length::cm),length::cm);
impl_->current_graphic_properties->common_shadow_attlist_.draw_shadow_offset_y_ = length(length(dist_pt, length::pt).get_value_unit(length::cm), length::cm);
impl_->current_graphic_properties->draw_shadow_ = shadow_type1(shadow_type1::Visible);
if (opacity) impl_->current_graphic_properties->draw_shadow_opacity_ = *opacity;
impl_->current_graphic_properties->common_shadow_attlist_.draw_shadow_ = shadow_type1(shadow_type1::Visible);
if (opacity) impl_->current_graphic_properties->common_shadow_attlist_.draw_shadow_opacity_ = *opacity;
impl_->current_graphic_properties->draw_shadow_color_ = hexColor;
impl_->current_graphic_properties->common_shadow_attlist_.draw_shadow_color_ = hexColor;
}
void odf_drawing_context::set_placeholder_id (std::wstring val)
@ -2936,25 +2936,25 @@ void odf_drawing_context::end_text_box()
impl_->current_graphic_properties->common_border_attlist_.fo_border_ = ss.str();
}
if (impl_->current_graphic_properties->draw_shadow_)
if (impl_->current_graphic_properties->common_shadow_attlist_.draw_shadow_)
{
std::wstringstream shadow_style;
if (impl_->current_graphic_properties->draw_shadow_color_)
shadow_style << *impl_->current_graphic_properties->draw_shadow_color_;
if (impl_->current_graphic_properties->common_shadow_attlist_.draw_shadow_color_)
shadow_style << *impl_->current_graphic_properties->common_shadow_attlist_.draw_shadow_color_;
else shadow_style << L"#000000";
shadow_style << L" ";
shadow_style << *impl_->current_graphic_properties->draw_shadow_offset_x_;
shadow_style << *impl_->current_graphic_properties->common_shadow_attlist_.draw_shadow_offset_x_;
shadow_style << L" ";
shadow_style << *impl_->current_graphic_properties->draw_shadow_offset_y_;
shadow_style << *impl_->current_graphic_properties->common_shadow_attlist_.draw_shadow_offset_y_;
impl_->current_graphic_properties->common_shadow_attlist_.style_shadow_ = shadow_style.str();
impl_->current_graphic_properties->draw_shadow_offset_x_ = boost::none;
impl_->current_graphic_properties->draw_shadow_offset_y_ = boost::none;
impl_->current_graphic_properties->draw_shadow_color_ = boost::none;
impl_->current_graphic_properties->draw_shadow_ = boost::none;
impl_->current_graphic_properties->common_shadow_attlist_.draw_shadow_offset_x_ = boost::none;
impl_->current_graphic_properties->common_shadow_attlist_.draw_shadow_offset_y_ = boost::none;
impl_->current_graphic_properties->common_shadow_attlist_.draw_shadow_color_ = boost::none;
impl_->current_graphic_properties->common_shadow_attlist_.draw_shadow_ = boost::none;
if (!impl_->current_graphic_properties->common_border_attlist_.fo_border_)
impl_->current_graphic_properties->common_border_attlist_.fo_border_ = std::wstring(L"#000000 solid 0.06pt");

View File

@ -157,13 +157,7 @@ void graphic_format_properties::serialize(std::wostream & _Wostream ,const wchar
CP_XML_ATTR_OPT(L"style:overflow-behavior", style_overflow_behavior_);
CP_XML_ATTR_OPT(L"style:mirror", style_mirror_);
//common_shadow_attlist_.serialize(CP_GET_XML_NODE());
CP_XML_ATTR_OPT(L"draw:shadow", draw_shadow_);
CP_XML_ATTR_OPT(L"draw:shadow-opacity", draw_shadow_opacity_);
CP_XML_ATTR_OPT(L"draw:shadow-color", draw_shadow_color_);
CP_XML_ATTR_OPT(L"draw:shadow-offset-y", draw_shadow_offset_y_);
CP_XML_ATTR_OPT(L"draw:shadow-offset-x", draw_shadow_offset_x_);
common_shadow_attlist_.serialize(CP_GET_XML_NODE());
common_draw_rel_size_attlist_.serialize(CP_GET_XML_NODE());
common_horizontal_margin_attlist_.serialize(CP_GET_XML_NODE());
@ -176,7 +170,6 @@ void graphic_format_properties::serialize(std::wostream & _Wostream ,const wchar
common_text_anchor_attlist_.serialize(CP_GET_XML_NODE());
common_border_attlist_.serialize(CP_GET_XML_NODE());
common_border_line_width_attlist_.serialize(CP_GET_XML_NODE());
common_shadow_attlist_.serialize(CP_GET_XML_NODE());
common_padding_attlist_.serialize(CP_GET_XML_NODE());
common_background_color_attlist_.serialize(CP_GET_XML_NODE());
}

View File

@ -97,12 +97,6 @@ public:
_CP_OPT(odf_types::Bool) draw_fit_to_contour_;
_CP_OPT(std::wstring) draw_wrap_influence_on_position_;
//odf_types::common_shadow_attlist common_shadow_attlist_;
_CP_OPT(odf_types::shadow_type1) draw_shadow_;
_CP_OPT(odf_types::percent) draw_shadow_opacity_;
_CP_OPT(odf_types::color) draw_shadow_color_;
_CP_OPT(odf_types::length) draw_shadow_offset_y_;
_CP_OPT(odf_types::length) draw_shadow_offset_x_;
_CP_OPT(unsigned int) draw_ole_draw_aspect_;
odf_types::common_draw_fill_attlist common_draw_fill_attlist_;

View File

@ -1026,7 +1026,13 @@ void OoxConverter::convert(PPTX::Logic::InnerShdw *oox_shadow, DWORD ARGB)
convert(&oox_shadow->Color, hexColor, opacity, ARGB);
odf_context()->drawing_context()->set_shadow(2, hexColor, opacity, oox_shadow->dist.IsInit() ? oox_shadow->dist.get() / 12700. : 0);
double dist = oox_shadow->dist.IsInit() ? oox_shadow->dist.get() / 12700. : 0;
double dir = oox_shadow->dir.IsInit() ? oox_shadow->dir.get() / 60000. : 0;
double offset_x = dist * cos(dir * M_PI / 180);
double offset_y = dist * sin(dir * M_PI / 180);
odf_context()->drawing_context()->set_shadow(2, hexColor, opacity, offset_x, offset_y);
}
void OoxConverter::convert(PPTX::Logic::OuterShdw *oox_shadow, DWORD ARGB)
{
@ -1037,8 +1043,13 @@ void OoxConverter::convert(PPTX::Logic::OuterShdw *oox_shadow, DWORD ARGB)
convert(&oox_shadow->Color, hexColor, opacity, ARGB);
odf_context()->drawing_context()->set_shadow(1, hexColor, opacity, oox_shadow->dist.IsInit() ? oox_shadow->dist.get() / 12700. : 0);
double dist = oox_shadow->dist.IsInit() ? oox_shadow->dist.get() / 12700. : 0;
double dir = oox_shadow->dir.IsInit() ? oox_shadow->dir.get() / 60000. : 0;
double offset_x = dist * cos(dir * M_PI / 180);
double offset_y = dist * sin(dir * M_PI / 180);
odf_context()->drawing_context()->set_shadow(1, hexColor, opacity, offset_x, offset_y);
}
void OoxConverter::convert(PPTX::Logic::PrstShdw *oox_shadow, DWORD ARGB)
{

File diff suppressed because it is too large Load Diff

View File

@ -81,7 +81,7 @@ namespace PPTX
}
std::wstring EffectLst::toXML() const
{
std::wstring str = _T("<a:effectLst>");
std::wstring str;
if (blur.IsInit()) str += blur->toXML();
if (fillOverlay.IsInit()) str += fillOverlay->toXML();
if (glow.IsInit()) str += glow->toXML();
@ -91,11 +91,20 @@ namespace PPTX
if (reflection.IsInit()) str += reflection->toXML();
if (softEdge.IsInit()) str += softEdge->toXML();
str += _T("</a:effectLst>");
if (false == str.empty())
{
str += L"<a:effectLst>" + str + L"</a:effectLst>";
}
return str;
}
void EffectLst::toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
{
if (!blur.IsInit() && !fillOverlay.IsInit() && !glow.IsInit() && !innerShdw.IsInit() &&
!outerShdw.IsInit() && !prstShdw.IsInit() && !reflection.IsInit() && !softEdge.IsInit())
{
return;
}
pWriter->StartNode(L"a:effectLst");
pWriter->EndAttributes();
@ -131,14 +140,6 @@ namespace PPTX
BYTE _type = pReader->GetUChar();
LONG _end_rec = pReader->GetPos() + pReader->GetLong() + 4;
pReader->Skip(1);
while (true)
{
BYTE _at = pReader->GetUChar_TypeNode();
if (_at == NSBinPptxRW::g_nodeAttributeEnd)
break;
}
while (pReader->GetPos() < _end_rec)
{
BYTE _at = pReader->GetUChar();

View File

@ -35,7 +35,31 @@ namespace PPTX
{
namespace Logic
{
void EffectProperties::fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
{
LONG pos = pReader->GetPos();
ULONG rec_len = pReader->GetULong();
if (0 == rec_len)
return;
BYTE rec = pReader->GetUChar();
switch(rec)
{
case EFFECTPROPERTIES_TYPE_LIST: List = new PPTX::Logic::EffectLst(); break;
case EFFECT_TYPE_DAG: List = new PPTX::Logic::EffectDag(); break;
}
pReader->Seek(pos);
if (List.is_init())
{
List->fromPPTY(pReader);
}
else
{
pReader->SkipRecord();
}
}
} // namespace Logic
} // namespace PPTX

View File

@ -116,6 +116,7 @@ namespace PPTX
if (List.is_init())
List->toPPTY(pWriter);
}
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader);
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
{
if (List.is_init())
@ -135,4 +136,4 @@ namespace PPTX
} // namespace Logic
} // namespace PPTX
#endif // PPTX_LOGIC_EFFECTPROPERTIES_INCLUDE_H
#endif // PPTX_LOGIC_EFFECTPROPERTIES_INCLUDE_H

View File

@ -122,7 +122,20 @@ namespace PPTX
pWriter->WriteAttribute(L"prst", prst.get());
pWriter->EndAttributes();
Color.toXmlWriter(pWriter);
if (Color.is_init())
{
Color.toXmlWriter(pWriter);
}
else
{
pWriter->StartNode(L"a:scrgbClr");
pWriter->StartAttributes();
pWriter->WriteAttribute(L"r", 0);
pWriter->WriteAttribute(L"g", 0);
pWriter->WriteAttribute(L"b", 0);
pWriter->EndAttributes();
pWriter->EndNode(L"a:scrgbClr");
}
pWriter->EndNode(L"a:prstShdw");
}

View File

@ -2615,7 +2615,7 @@ bool RtfParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfRead
}
}
COMMAND_RTF_INT ( "uc", oReader.m_oState->m_nUD, sCommand, hasParameter, parameter)
COMMAND_RTF_INT ( "uc", oReader.m_oState->m_nUnicodeClean, sCommand, hasParameter, parameter)
//Tab todoooo перенести в ParagrProps (trackchanges)
COMMAND_RTF_INT ( "tldot", m_oCurTab.m_eLeader, sCommand, true, RtfTab::tl_dot )
COMMAND_RTF_INT ( "tlmdot", m_oCurTab.m_eLeader, sCommand, true, RtfTab::tl_mdot )

View File

@ -51,7 +51,7 @@ bool RtfReader::Load()
void RtfReader::PushState()
{
ReaderStatePtr psaveNew = ReaderStatePtr(new ReaderState());
psaveNew -> m_nUD = m_oState->m_nUD;
psaveNew -> m_nUnicodeClean = m_oState->m_nUnicodeClean;
psaveNew -> m_oCharProp = m_oState->m_oCharProp;
psaveNew -> m_oParagraphProp = m_oState->m_oParagraphProp;
psaveNew -> m_oRowProperty = m_oState->m_oRowProperty;

View File

@ -47,7 +47,7 @@ public:
class ReaderState
{
public:
int m_nUD; // количество символов игнорируемых за юникодом
int m_nUnicodeClean; // количество символов игнорируемых за юникодом
RtfCharProperty m_oCharProp;
RtfParagraphProperty m_oParagraphProp;
RtfRowProperty m_oRowProperty;
@ -61,7 +61,7 @@ public:
ReaderState()
{
m_bControlPresent = false;
m_nUD = 1;
m_nUnicodeClean = 1;
m_oCharProp.SetDefaultRtf();
m_oParagraphProp.SetDefaultRtf();
m_oRowProperty.SetDefaultRtf();
@ -129,14 +129,18 @@ public:
switch (m_oTok.Type)
{
case RtfToken::GroupStart:
ExecuteTextInternal2(oDocument, oReader, m_oTok.Key, m_nSkipChars);
PushState(oReader);
break;
{
ExecuteTextInternal2(oDocument, oReader, m_oTok.Key, m_nSkipChars);
PushState(oReader);
}break;
case RtfToken::GroupEnd:
ExecuteTextInternal2(oDocument, oReader, m_oTok.Key, m_nSkipChars);
PopState(oDocument, oReader);
break;
{
ExecuteTextInternal2(oDocument, oReader, m_oTok.Key, m_nSkipChars);
PopState(oDocument, oReader);
}break;
case RtfToken::Keyword:
{
ExecuteTextInternal2(oDocument, oReader, m_oTok.Key, m_nSkipChars);
if( m_oTok.Key == "u")
{
@ -156,8 +160,9 @@ public:
}
if( true == m_bCanStartNewReader )
m_bCanStartNewReader = false;
break;
}break;
case RtfToken::Control:
{
if( m_oTok.Key == "42" )
m_bSkip = true;
if( m_oTok.Key == "39" && true == m_oTok.HasParameter )
@ -165,10 +170,12 @@ public:
oReader.m_oState->m_sCurText += m_oTok.Parameter ;
oReader.m_oState->m_bControlPresent = true;
}
break;
}break;
case RtfToken::Text:
oReader.m_oState->m_sCurText += m_oTok.Key;
break;
{
oReader.m_oState->m_sCurText += m_oTok.Key;
}break;
}
if( false == m_bStopReader)
m_oTok = oReader.m_oLex.NextToken();
@ -272,10 +279,10 @@ public:
std::wstring sResult = ExecuteTextInternalCodePage(oReader.m_oState->m_sCurText, oDocument, oReader);
oReader.m_oState->m_sCurText.erase();
oReader.m_oState->m_bControlPresent = false;
if(sResult.length() > 0)
if(false == sResult.empty())
{
std::string str;
// ExecuteTextInternalSkipChars (sResult, oReader, str, nSkipChars); //vedomost.rtf
ExecuteTextInternalSkipChars (sResult, oReader, str, nSkipChars);
ExecuteText ( oDocument, oReader, sResult);
}
}
@ -288,8 +295,9 @@ public:
int nLength = (int)sResult.length();
if( nSkipChars >= nLength )
{
nSkipChars -= nLength;
sResult.clear();
nSkipChars = 0; //vedomost.rtf
//nSkipChars -= nLength;
sResult.clear();
}
else
{
@ -300,7 +308,7 @@ public:
if( "u" == sKey )
{
//надо правильно установить m_nSkipChars по значению \ucN
nSkipChars = oReader.m_oState->m_nUD;
nSkipChars = oReader.m_oState->m_nUnicodeClean;
}
}
/*static */std::wstring ExecuteTextInternalCodePage( std::string & sCharString, RtfDocument & oDocument, RtfReader & oReader);

View File

@ -1,241 +1,245 @@
/*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
#include "CFRecordType.h"
#include "CFStream.h"
#include "BinSmartPointers.h"
#include "../Logic/GlobalWorkbookInfo.h"
#include "../../Common/common.h"
#include "../Auxiliary/HelpFunc.h"
#include "../../../../ASCOfficeDocFile/DocDocxConverter/OfficeDrawing/Record.h"
namespace XLS
{
class CFRecord
{
public:
CFRecord(CFStreamPtr stream, GlobalWorkbookInfoPtr global_info); // Create a record an read its data from the stream
CFRecord(CFRecordType::TypeId type_id, GlobalWorkbookInfoPtr global_info); // Create an empty record
~CFRecord();
void save(CFStreamPtr stream);
void commitData();
const CFRecordType::TypeId getTypeId() const;
const CFRecordType::TypeString& getTypeString() const;
const unsigned int getStreamPointer() const;
// Pointer to the beginning of the cached data
const char* getData() const ;
const size_t getDataSize() const;
const size_t getMaxRecordSize() const;
void appendRawData(CFRecordPtr where_from);
void appendRawData(const char* raw_data, const size_t size);
void insertDataFromRecordToBeginning(CFRecordPtr where_from);
const bool isEOF() const; // whether all the data have bean read
// Checks whether the specified number of unsigned chars present in the non-read part of the buffer
// Doesn't generate an exception
const bool checkFitReadSafe(const size_t size) const;
// Checks whether the specified number of unsigned chars present in the non-read part of the buffer
// Generates an exception
bool checkFitRead(const size_t size) const;
// Checks whether the specified number of unsigned chars fits in max size of the buffer
// Doesn't generate an exception
const bool checkFitWriteSafe(const size_t size) const;
// Checks whether the specified number of unsigned chars fits in max size of the buffer
// Generates an exception
void checkFitWrite(const size_t size) const;
void skipNunBytes(const size_t n); // Skip the specified number of unsigned chars without reading
void RollRdPtrBack(const size_t n); // Move read pointer back to reread some data
void resetPointerToBegin();
void reserveNunBytes(const size_t n); // Skip the specified number of unsigned chars filled them in with zeros
template<class DataType>
void reserveNunBytes(const size_t n, const DataType fill_data) // Skip the specified number of unsigned chars filled them in with specified data
{
checkFitWrite(n);
size_t odd_size = n / sizeof(DataType) * sizeof(DataType);
for(size_t offset = 0; offset < odd_size; offset += sizeof(DataType))
{
reinterpret_cast<DataType*>(&intData[size_ + offset])[0] = fill_data;
}
for(size_t i = 0; i < n % sizeof(DataType); ++i)
{
intData[size_ + odd_size + i] = 0;
}
size_ += n;
}
void registerDelayedDataReceiver(CFStream::DELAYED_DATA_SAVER fn, const size_t n, const CFRecordType::TypeId receiver_id = rt_NONE);
void registerDelayedDataSource(const unsigned int data, const CFRecordType::TypeId receiver_id);
void registerDelayedFilePointerSource(const CFRecordType::TypeId receiver_id);
void registerDelayedFilePointerAndOffsetSource(const unsigned int offset, const CFRecordType::TypeId receiver_id);
template<class T>
const T* getCurData() const
{
return reinterpret_cast<T*>(&data_[rdPtr]);
}
// Obtain the current rdPtr
const size_t getRdPtr() const;
template<class T>
bool loadAnyData(T& val)
{
////ASSERT(data_); // This throws if we use >> instead of <<
if (checkFitRead(sizeof(T)))
{
val = * getCurData<T>();
rdPtr += sizeof(T);
return true;
}
return false;
}
bool loadAnyData(wchar_t & val);
template<class T>
void storeAnyData(const T& val)
{
checkFitWrite(sizeof(T));
*reinterpret_cast<T*>(&intData[size_]) = val;
size_ += sizeof(T);
}
void storeLongData(const char* buf, const size_t size);
GlobalWorkbookInfoPtr getGlobalWorkbookInfo() { return global_info_; }
CFRecord& operator>>(unsigned char& val) { loadAnyData(val); return *this; }
CFRecord& operator>>(unsigned short& val) { loadAnyData(val); return *this; }
CFRecord& operator>>(unsigned int& val) { loadAnyData(val); return *this; }
CFRecord& operator>>(int& val) { loadAnyData(val); return *this; }
CFRecord& operator>>(double& val) { loadAnyData(val); return *this; }
CFRecord& operator>>(_GUID_& val) { loadAnyData(val); return *this; }
CFRecord& operator>>(short& val) { loadAnyData(val); return *this; }
CFRecord& operator>>(char& val) { loadAnyData(val); return *this; }
CFRecord& operator>>(bool& val);
private:
static const size_t MAX_RECORD_SIZE = 8224;
CFStream::ReceiverItems receiver_items;
CFStream::SourceItems source_items;
unsigned int file_ptr;
CFRecordType::TypeId type_id_;
size_t size_;
char* data_;
size_t rdPtr;
static char intData[MAX_RECORD_SIZE];
GlobalWorkbookInfoPtr global_info_;
};
template<class T>
CFRecord& operator>>(CFRecord& record, std::vector<T>& vec)
{
while(!record.isEOF())
{
T element;
record >> element;
vec.push_back(element);
}
return record;
}
template<class T>
CFRecord& operator<<(CFRecord& record, std::vector<T>& vec)
{
for(typename std::vector<T>::iterator it = vec.begin(), itEnd = vec.end(); it != itEnd; ++it)
{
record << *it;
}
return record;
}
#if defined(_WIN32) || defined(_WIN64)
template<class T>
CFRecord& operator>>(CFRecord & record, std::basic_string<T, std::char_traits<T>, std::allocator<T> >& str)
{
str.clear();
T symbol;
do
{
if (record.loadAnyData(symbol) == false)
break;
str += symbol;
} while (symbol);
return record;
}
#else
CFRecord& operator>>(CFRecord & record, std::string & str);
CFRecord& operator>>(CFRecord & record, std::wstring & str);
#endif
template<class T>
CFRecord& operator>>(CFRecord & record, _CP_OPT(T)& val)
{
T temp_val;
if (record.loadAnyData(temp_val))
{
val = temp_val;
}
return record;
}
// moved out of the class to be higher in priority than the universal operator
template<class T>
CFRecord& operator<<(CFRecord & record, _CP_OPT(T)& val)
{
if (!val) return record;
T temp_val(*val);
record.storeAnyData(temp_val);
return record;
}
#define DET_TYPE(num_bits) num_bits <= 8 ? unsigned char : num_bits <=16 ? unsigned short : unsigned int
#define GETBIT(from, num) ((from & (1 << num)) != 0)
#define GETBITS(from, numL, numH) ((from & (((1 << (numH - numL + 1)) - 1) << numL)) >> numL)
#define SETBIT(to, num, setorclear) {setorclear ? to |= (1 << num) : to &= ~(1 << num);}
#define SETBITS(to, numL, numH, val) {to &= ~(((1 << (numH - numL + 1)) - 1) << numL); to |= ((val & ((1 << (numH - numL + 1)) - 1)) << numL);}
} // namespace XLS
/*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
#include "CFRecordType.h"
#include "CFStream.h"
#include "BinSmartPointers.h"
#include "../Logic/GlobalWorkbookInfo.h"
#include "../../Common/common.h"
#include "../Auxiliary/HelpFunc.h"
#include "../../../../ASCOfficeDocFile/DocDocxConverter/OfficeDrawing/Record.h"
namespace XLS
{
class CFRecord
{
public:
CFRecord(CFStreamPtr stream, GlobalWorkbookInfoPtr global_info); // Create a record an read its data from the stream
CFRecord(CFRecordType::TypeId type_id, GlobalWorkbookInfoPtr global_info); // Create an empty record
~CFRecord();
void save(CFStreamPtr stream);
void commitData();
const CFRecordType::TypeId getTypeId() const;
const CFRecordType::TypeString& getTypeString() const;
const unsigned int getStreamPointer() const;
// Pointer to the beginning of the cached data
const char* getData() const ;
const size_t getDataSize() const;
const size_t getMaxRecordSize() const;
void appendRawData(CFRecordPtr where_from);
void appendRawData(const char* raw_data, const size_t size);
void insertDataFromRecordToBeginning(CFRecordPtr where_from);
const bool isEOF() const; // whether all the data have bean read
// Checks whether the specified number of unsigned chars present in the non-read part of the buffer
// Doesn't generate an exception
const bool checkFitReadSafe(const size_t size) const;
// Checks whether the specified number of unsigned chars present in the non-read part of the buffer
// Generates an exception
bool checkFitRead(const size_t size) const;
// Checks whether the specified number of unsigned chars fits in max size of the buffer
// Doesn't generate an exception
const bool checkFitWriteSafe(const size_t size) const;
// Checks whether the specified number of unsigned chars fits in max size of the buffer
// Generates an exception
void checkFitWrite(const size_t size) const;
void skipNunBytes(const size_t n); // Skip the specified number of unsigned chars without reading
void RollRdPtrBack(const size_t n); // Move read pointer back to reread some data
void resetPointerToBegin();
void reserveNunBytes(const size_t n); // Skip the specified number of unsigned chars filled them in with zeros
template<class DataType>
void reserveNunBytes(const size_t n, const DataType fill_data) // Skip the specified number of unsigned chars filled them in with specified data
{
checkFitWrite(n);
size_t odd_size = n / sizeof(DataType) * sizeof(DataType);
for(size_t offset = 0; offset < odd_size; offset += sizeof(DataType))
{
reinterpret_cast<DataType*>(&intData[size_ + offset])[0] = fill_data;
}
for(size_t i = 0; i < n % sizeof(DataType); ++i)
{
intData[size_ + odd_size + i] = 0;
}
size_ += n;
}
void registerDelayedDataReceiver(CFStream::DELAYED_DATA_SAVER fn, const size_t n, const CFRecordType::TypeId receiver_id = rt_NONE);
void registerDelayedDataSource(const unsigned int data, const CFRecordType::TypeId receiver_id);
void registerDelayedFilePointerSource(const CFRecordType::TypeId receiver_id);
void registerDelayedFilePointerAndOffsetSource(const unsigned int offset, const CFRecordType::TypeId receiver_id);
template<class T>
const T* getCurData() const
{
return reinterpret_cast<T*>(&data_[rdPtr]);
}
// Obtain the current rdPtr
const size_t getRdPtr() const;
template<class T>
bool loadAnyData(T& val)
{
////ASSERT(data_); // This throws if we use >> instead of <<
if (checkFitRead(sizeof(T)))
{
#ifdef __ANDROID__
memcpy(&val, &data_[rdPtr], sizeof(T));
#else
val = * getCurData<T>();
#endif
rdPtr += sizeof(T);
return true;
}
return false;
}
bool loadAnyData(wchar_t & val);
template<class T>
void storeAnyData(const T& val)
{
checkFitWrite(sizeof(T));
*reinterpret_cast<T*>(&intData[size_]) = val;
size_ += sizeof(T);
}
void storeLongData(const char* buf, const size_t size);
GlobalWorkbookInfoPtr getGlobalWorkbookInfo() { return global_info_; }
CFRecord& operator>>(unsigned char& val) { loadAnyData(val); return *this; }
CFRecord& operator>>(unsigned short& val) { loadAnyData(val); return *this; }
CFRecord& operator>>(unsigned int& val) { loadAnyData(val); return *this; }
CFRecord& operator>>(int& val) { loadAnyData(val); return *this; }
CFRecord& operator>>(double& val) { loadAnyData(val); return *this; }
CFRecord& operator>>(_GUID_& val) { loadAnyData(val); return *this; }
CFRecord& operator>>(short& val) { loadAnyData(val); return *this; }
CFRecord& operator>>(char& val) { loadAnyData(val); return *this; }
CFRecord& operator>>(bool& val);
private:
static const size_t MAX_RECORD_SIZE = 8224;
CFStream::ReceiverItems receiver_items;
CFStream::SourceItems source_items;
unsigned int file_ptr;
CFRecordType::TypeId type_id_;
size_t size_;
char* data_;
size_t rdPtr;
static char intData[MAX_RECORD_SIZE];
GlobalWorkbookInfoPtr global_info_;
};
template<class T>
CFRecord& operator>>(CFRecord& record, std::vector<T>& vec)
{
while(!record.isEOF())
{
T element;
record >> element;
vec.push_back(element);
}
return record;
}
template<class T>
CFRecord& operator<<(CFRecord& record, std::vector<T>& vec)
{
for(typename std::vector<T>::iterator it = vec.begin(), itEnd = vec.end(); it != itEnd; ++it)
{
record << *it;
}
return record;
}
#if defined(_WIN32) || defined(_WIN64)
template<class T>
CFRecord& operator>>(CFRecord & record, std::basic_string<T, std::char_traits<T>, std::allocator<T> >& str)
{
str.clear();
T symbol;
do
{
if (record.loadAnyData(symbol) == false)
break;
str += symbol;
} while (symbol);
return record;
}
#else
CFRecord& operator>>(CFRecord & record, std::string & str);
CFRecord& operator>>(CFRecord & record, std::wstring & str);
#endif
template<class T>
CFRecord& operator>>(CFRecord & record, _CP_OPT(T)& val)
{
T temp_val;
if (record.loadAnyData(temp_val))
{
val = temp_val;
}
return record;
}
// moved out of the class to be higher in priority than the universal operator
template<class T>
CFRecord& operator<<(CFRecord & record, _CP_OPT(T)& val)
{
if (!val) return record;
T temp_val(*val);
record.storeAnyData(temp_val);
return record;
}
#define DET_TYPE(num_bits) num_bits <= 8 ? unsigned char : num_bits <=16 ? unsigned short : unsigned int
#define GETBIT(from, num) ((from & (1 << num)) != 0)
#define GETBITS(from, numL, numH) ((from & (((1 << (numH - numL + 1)) - 1) << numL)) >> numL)
#define SETBIT(to, num, setorclear) {setorclear ? to |= (1 << num) : to &= ~(1 << num);}
#define SETBITS(to, numL, numH, val) {to &= ~(((1 << (numH - numL + 1)) - 1) << numL); to |= ((val & ((1 << (numH - numL + 1)) - 1)) << numL);}
} // namespace XLS

View File

@ -212,7 +212,7 @@ namespace OOX
}
return nLen;
}
_UINT16 CFormulaXLSB::toXLSB(NSBinPptxRW::CXlsbBinaryWriter& oStream)
_UINT16 CFormulaXLSB::toXLSB(NSBinPptxRW::CXlsbBinaryWriter& oStream, bool bIsBlankFormula)
{
_UINT16 nFlags = 0;
if(m_oCa.ToBool())
@ -266,6 +266,10 @@ namespace OOX
{
nFlagsExt |= 0x1000;
}
if(bIsBlankFormula)
{
nFlagsExt |= 0x4000;
}
return nFlagsExt;
}
void CFormulaXLSB::toXLSBExt(NSBinPptxRW::CXlsbBinaryWriter& oStream)
@ -369,9 +373,11 @@ namespace OOX
case SimpleTypes::Spreadsheet::celltypeStr: nType = XLSB::rt_CELL_ST; break;
}
}
bool bIsBlankFormula = false;
if(XLSB::rt_CELL_BLANK == nType && bWriteFormula)
{
nType = XLSB::rt_CELL_ST;
bIsBlankFormula = true;
}
_UINT32 nLen = 4+4+2;
@ -446,7 +452,7 @@ namespace OOX
_UINT16 nFlags = 0;
if(bWriteFormula)
{
nFlags = m_oFormula.toXLSB(oStream);
nFlags = m_oFormula.toXLSB(oStream, bIsBlankFormula);
}
if(m_oRichText.IsInit())
@ -990,6 +996,11 @@ namespace OOX
m_oFormula.Init();
}
m_oFormula->fromXLSBExt(oStream, nFlags);
if(0 != (nFlags & 0x4000))
{
m_oType.reset(NULL);
m_oValue.reset(NULL);
}
}
if(0 != (nFlags & 0x2000))
{

View File

@ -62,7 +62,7 @@ namespace OOX
void Clean();
void fromXML(XmlUtils::CXmlLiteReader& oReader);
_UINT32 getXLSBSize() const;
_UINT16 toXLSB(NSBinPptxRW::CXlsbBinaryWriter& oStream);
_UINT16 toXLSB(NSBinPptxRW::CXlsbBinaryWriter& oStream, bool bIsBlankFormula);
void toXLSBExt(NSBinPptxRW::CXlsbBinaryWriter& oStream);
public:
bool m_bIsInit;

View File

@ -840,14 +840,14 @@ namespace OOX
{
m_oTabColor->toXML2(writer, _T("tabColor"));
}
if (m_oPageSetUpPr.IsInit())
{
m_oPageSetUpPr->toXML(writer);
}
if (m_oOutlinePr.IsInit())
{
m_oOutlinePr->toXML(writer);
}
if (m_oPageSetUpPr.IsInit())
{
m_oPageSetUpPr->toXML(writer);
}
writer.WriteString(_T("</sheetPr>"));
}

File diff suppressed because it is too large Load Diff

View File

@ -189,7 +189,12 @@ namespace NSMemoryStream
inline void WriteStringA(const char* pData, int nLen)
{
CheckBufferSize(nLen + sizeof(USHORT));
#ifdef __ANDROID__
memcpy(m_pBufferMem, &nLen, sizeof(USHORT));
#else
*((USHORT*)(m_pBufferMem)) = (USHORT)nLen;
#endif
m_pBufferMem += sizeof(USHORT);
memcpy(m_pBufferMem, pData, nLen);
@ -198,7 +203,12 @@ namespace NSMemoryStream
inline void WriteStringA2(const char* pData, int nLen)
{
CheckBufferSize(nLen + sizeof(INT));
*((INT*)(m_pBufferMem)) = (INT)nLen;
#ifdef __ANDROID__
memcpy(m_pBufferMem, &nLen, sizeof(INT));
#else
*((INT*)(m_pBufferMem)) = (INT)nLen;
#endif
m_pBufferMem += sizeof(INT);
memcpy(m_pBufferMem, pData, nLen);

View File

@ -1000,7 +1000,7 @@ namespace NExtractTools
}
else
{
nRes = dir2zip(sFrom, sTo);
nRes = dir2zip(sResultPptxDir, sTo);
}
}
return nRes;