Compare commits

..

20 Commits

Author SHA1 Message Date
102db77f55 [ios][x2t] fixed build 2019-01-11 14:50:28 +03:00
0181cf493f Merge remote-tracking branch 'origin/hotfix/v5.2.5' into develop 2019-01-09 15:22:40 +03:00
25f20877df OdfFormat - fix users file (add new text field) 2019-01-09 15:20:08 +03:00
37889217cd Add v8 files to .gitignore 2019-01-09 14:10:25 +03:00
89d6a7ec7e Makefile refactoring 2019-01-09 14:09:16 +03:00
310b8605f0 . 2019-01-09 13:01:11 +03:00
c515c2bf00 Merge branch 'develop' of https://github.com/ONLYOFFICE/core into develop 2019-01-09 11:37:53 +03:00
bea475a3cd . 2019-01-09 11:36:57 +03:00
a2454e78d4 [android][x2t] fix build script 2019-01-09 10:31:17 +03:00
c0bb704ed9 [x2t] Fix for 1b49f53f03 2018-12-27 15:37:34 +03:00
1b49f53f03 [x2t] For bug 40124 2018-12-27 12:50:48 +03:00
abbbda090d Merge remote-tracking branch 'origin/hotfix/v5.2.5' into develop 2018-12-26 14:30:50 +03:00
38e82f0414 PptFormatReader - fix bug #40116 2018-12-25 17:49:46 +03:00
25574aff48 PptFormatReader - fix bug #40115 2018-12-25 16:21:44 +03:00
f4d9901576 [ios] Math in menu 2018-12-25 15:48:54 +03:00
ebaa8b9769 add rpath to x2t 2018-12-24 12:59:48 +03:00
855442c1c9 . 2018-12-23 15:38:42 +03:00
30008873fe OdfFormatReader - fix after testing 2018-12-22 19:22:55 +03:00
8d247dfb6e OdfFormatReader - fix bug #40106, ... 2018-12-22 15:21:34 +03:00
a9f32fd7d0 Remove v8 object files from core.zip 2018-12-21 14:29:50 +03:00
87 changed files with 1201 additions and 352 deletions

3
.gitignore vendored
View File

@ -18,6 +18,9 @@ Common/3dParty/curl/win_32
Common/3dParty/curl/linux_64
Common/3dParty/curl/linux_32
Common/3dParty/curl/mac_64
Common/3dParty/v8/.cipd
Common/3dParty/v8/.gclient
Common/3dParty/v8/.gclient_entries
Common/3dParty/v8/v8
Common/3dParty/v8/depot_tools
Common/3dParty/v8/win_64

View File

@ -18,7 +18,8 @@ DEFINES += UNICODE \
_UNICODE \
SOLUTION_ASCOFFICEDOCXFILE2 \
#DISABLE_FILE_DOWNLOADER \
DONT_WRITE_EMBEDDED_FONTS
DONT_WRITE_EMBEDDED_FONTS \
AVS_USE_CONVERT_PPTX_TOCUSTOM_VML
SOURCES += \

View File

@ -383,6 +383,7 @@
GCC_PREPROCESSOR_DEFINITIONS = (
UNICODE,
_UNICODE,
AVS_USE_CONVERT_PPTX_TOCUSTOM_VML,
SOLUTION_ASCOFFICEDOCXFILE2,
DONT_WRITE_EMBEDDED_FONTS,
MAC,
@ -415,6 +416,7 @@
GCC_PREPROCESSOR_DEFINITIONS = (
UNICODE,
_UNICODE,
AVS_USE_CONVERT_PPTX_TOCUSTOM_VML,
SOLUTION_ASCOFFICEDOCXFILE2,
DONT_WRITE_EMBEDDED_FONTS,
MAC,

View File

@ -131,6 +131,7 @@ text_tracked_context::_state & text_tracked_context::get_tracked_change(std::wst
//----------------------------------------------------------------------------------------------------------------
docx_conversion_context::docx_conversion_context(odf_reader::odf_document * OdfDocument) :
last_dump_page_properties_ (true),
next_dump_page_properties_ (false),
page_break_ (false),
page_break_after_ (false),
@ -1425,14 +1426,22 @@ void docx_conversion_context::next_dump_page_properties(bool val)
if (process_headers_footers_ && val) return;
next_dump_page_properties_ = val;
if (val)
last_dump_page_properties(true);
}
bool docx_conversion_context::is_next_dump_page_properties()
{
return next_dump_page_properties_;
}
void docx_conversion_context::last_dump_page_properties(bool val)
{
last_dump_page_properties_ = val;
}
bool docx_conversion_context::is_last_dump_page_properties()
{
return last_dump_page_properties_;
}
void docx_conversion_context::start_text_list_style(const std::wstring & StyleName)
{
text_list_style_name_ = StyleName;

View File

@ -793,6 +793,7 @@ public:
bool next_dump_page_properties_;
bool next_dump_section_;
bool last_dump_page_properties_;
odf_reader::odf_document *root()
{
@ -862,6 +863,8 @@ public:
void next_dump_page_properties (bool val);
bool is_next_dump_page_properties ();
void last_dump_page_properties (bool val);
bool is_last_dump_page_properties ();
void set_master_page_name(const std::wstring & MasterPageName);
const std::wstring & get_master_page_name() const;

View File

@ -172,6 +172,8 @@ std::wstring mediaitems::create_file_name(const std::wstring & uri, RelsType typ
if (type == typeOleObject && sExt.empty())
sExt = L".bin";
else if ( type == typeChart)
sExt = L".xml";
return get_default_file_name(type) + std::to_wstring(Num) + sExt;
}
@ -240,8 +242,6 @@ std::wstring mediaitems::add_or_find(const std::wstring & href, RelsType type, b
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";
std::wstring id;
for (size_t i = 0 ; i < items_.size(); i++)

View File

@ -137,7 +137,8 @@ xlsx_table_state::xlsx_table_state(xlsx_conversion_context * Context, std::wstri
in_cell(false),
bEndTable(false),
bRTL(false),
bHidden(false)
bHidden(false),
bProtected(false)
{
odf_reader::style_table_properties * table_prop = NULL;
odf_reader::style_instance * tableStyle = context_->root()->odf_context().styleContainer().style_by_name(table_style_, odf_types::style_family::Table, false);

View File

@ -338,6 +338,38 @@ void xlsx_table_context::serialize_tableParts(std::wostream & _Wostream, rels &
{
if (false == xlsx_data_ranges_[it->second]->bTablePart) continue;
// из за дебелизма мсофис которому ОБЯЗАТЕЛЬНО нужно прописывать имена колонок таблицы (и они должны быть еще
// прописаны и в самих данных таблицы !!
int i = xlsx_data_ranges_[it->second]->header_values.size() - 1;
for (; i >= 0; i--)
{
if (false == xlsx_data_ranges_[it->second]->header_values[i].empty())
{
break;
}
}
if (i == -1)
{
xlsx_data_ranges_[it->second]->bTablePart = false;
continue;
}
else
{
size_t erase = xlsx_data_ranges_[it->second]->header_values.size() - 1 - i;
if (erase > 0)
{
xlsx_data_ranges_[it->second]->header_values.erase(xlsx_data_ranges_[it->second]->header_values.begin() + i + 1, xlsx_data_ranges_[it->second]->header_values.end());
xlsx_data_ranges_[it->second]->cell_end.first -= erase;
std::wstring ref1 = getCellAddress(xlsx_data_ranges_[it->second]->cell_start.first, xlsx_data_ranges_[it->second]->cell_start.second);
std::wstring ref2 = getCellAddress(xlsx_data_ranges_[it->second]->cell_end.first, xlsx_data_ranges_[it->second]->cell_end.second);
xlsx_data_ranges_[it->second]->ref = ref1 + L":" + ref2;
}
}
//--------------------------------------------------------
size_t id = xlsx_conversion_context_->get_table_parts_size() + 1;
std::wstring rId = L"tprtId" + std::to_wstring(id);
@ -351,10 +383,10 @@ void xlsx_table_context::serialize_tableParts(std::wostream & _Wostream, rels &
}
}
Rels.add( relationship(rId, L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/table", ref));
//--------------------------------------------------------
std::wstringstream strm;
CP_XML_WRITER(strm)
{
{
CP_XML_NODE(L"table")
{
CP_XML_ATTR(L"xmlns", L"http://schemas.openxmlformats.org/spreadsheetml/2006/main");

View File

@ -151,7 +151,10 @@ void office_body::docx_convert(oox::docx_conversion_context & Context)
{
if (page_layout_instance *lastPageLayout = Context.root()->odf_context().pageLayoutContainer().page_layout_by_name(Context.get_page_properties()))
{
Context.next_dump_page_properties(true);
if (Context.is_last_dump_page_properties())
{
Context.next_dump_page_properties(true);
}
lastPageLayout->docx_serialize(Context.output_stream(), Context);
//Context.remove_page_properties();

View File

@ -129,6 +129,16 @@ void office_text::add_child_element( xml::sax * Reader, const std::wstring & Ns,
else if (is_text_content(Ns, Name))
{
CP_CREATE_ELEMENT(content_);
if (!first_element_style_name && (content_.back()->get_type() == typeTextP ||
content_.back()->get_type() == typeTextH))
{//bus-modern_l.ott
if (content_.back()->element_style_name)
first_element_style_name = content_.back()->element_style_name;
else
first_element_style_name = L""; //default
}
}
else
CP_NOT_APPLICABLE_ELM();
@ -155,6 +165,26 @@ void office_text::docx_convert(oox::docx_conversion_context & Context)
//forms_->docx_convert(Context);
Context.start_office_text();
if ((first_element_style_name) && (!first_element_style_name->empty()))
{
std::wstring text___ = *first_element_style_name;
const _CP_OPT(std::wstring) masterPageName = Context.root()->odf_context().styleContainer().master_page_name_by_name(text___);
if (masterPageName)
{
std::wstring masterPageNameLayout = Context.root()->odf_context().pageLayoutContainer().page_layout_name_by_style(*masterPageName);
if (false == masterPageNameLayout.empty())
{
Context.set_master_page_name(*masterPageName); //проверка на то что тема действительно существует????
Context.remove_page_properties();
Context.add_page_properties(masterPageNameLayout);
}
}
}
for (size_t i = 0; i < content_.size(); i++)
{
if (content_[i]->element_style_name)

View File

@ -70,6 +70,8 @@ private:
//office_element_ptr forms_; -> content
office_element_ptr_array content_;
_CP_OPT(std::wstring) first_element_style_name;
};
CP_REGISTER_OFFICE_ELEMENT2(office_text);
//----------------------------------------------------------------------------------------------------

View File

@ -1320,6 +1320,67 @@ void sequence::pptx_convert(oox::pptx_conversion_context & Context)
text_[i]->pptx_convert(Context);
}
}
//------------------------------------------------------------------------------------------------------------
const wchar_t * expression::ns = L"text";
const wchar_t * expression::name = L"expression";
void expression::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
office_value_.add_attributes(Attributes);
CP_APPLY_ATTR(L"style:data-style-name", style_data_style_name_);
CP_APPLY_ATTR(L"text:display", text_display_);
CP_APPLY_ATTR(L"text:formula", text_formula_);
}
std::wostream & expression::text_to_stream(std::wostream & _Wostream) const
{
_Wostream << xml::utils::replace_text_to_xml( text_ );
return _Wostream;
}
void expression::add_text(const std::wstring & Text)
{
text_ = Text;
}
void expression::docx_convert(oox::docx_conversion_context & Context)
{//???
std::wostream & strm = Context.output_stream();
Context.finish_run();
strm << L"<w:r><w:fldChar w:fldCharType=\"begin\"></w:fldChar></w:r>";
strm << L"<w:r><w:instrText>FORMTEXT</w:instrText></w:r>";
strm << L"<w:r><w:fldChar w:fldCharType=\"separate\"/></w:r>";
strm << L"<w:r><w:t>" << text_ << L"</w:t></w:r>";
strm << L"<w:r><w:fldChar w:fldCharType=\"end\"/></w:r>";
}
//------------------------------------------------------------------------------------------------------------
const wchar_t * text_input::ns = L"text";
const wchar_t * text_input::name = L"text-input";
void text_input::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
CP_APPLY_ATTR(L"text:description", text_description_);
}
std::wostream & text_input::text_to_stream(std::wostream & _Wostream) const
{
_Wostream << xml::utils::replace_text_to_xml( text_ );
return _Wostream;
}
void text_input::add_text(const std::wstring & Text)
{
text_ = Text;
}
void text_input::docx_convert(oox::docx_conversion_context & Context)
{
std::wostream & strm = Context.output_stream();
Context.finish_run();
strm << L"<w:r><w:fldChar w:fldCharType=\"begin\"></w:fldChar></w:r>";
strm << L"<w:r><w:instrText>FORMTEXT</w:instrText></w:r>";
strm << L"<w:r><w:fldChar w:fldCharType=\"separate\"/></w:r>";
strm << L"<w:r><w:t>" << text_ << L"</w:t></w:r>";
strm << L"<w:r><w:fldChar w:fldCharType=\"end\"/></w:r>";
}
//-------------------------------------------------------------------------------------------------------------------
const wchar_t * text_drop_down::ns = L"text";
const wchar_t * text_drop_down::name = L"drop-down";

View File

@ -875,6 +875,58 @@ private:
};
CP_REGISTER_OFFICE_ELEMENT2(sequence);
//-------------------------------------------------------------------------------------------------------------------
// text:expression
//-------------------------------------------------------------------------------------------------------------------
class expression: public paragraph_content_element<expression>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextExpression;
CPDOCCORE_DEFINE_VISITABLE();
void docx_convert(oox::docx_conversion_context & Context);
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
_CP_OPT(std::wstring) style_data_style_name_;
_CP_OPT(std::wstring) text_display_;
_CP_OPT(std::wstring) text_formula_;
odf_types::common_value_and_type_attlist office_value_;
std::wstring text_;
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name){}
virtual void add_text(const std::wstring & Text);
};
CP_REGISTER_OFFICE_ELEMENT2(expression);
//-------------------------------------------------------------------------------------------------------------------
// text:text-input
//-------------------------------------------------------------------------------------------------------------------
class text_input: public paragraph_content_element<text_input>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextTextInput;
CPDOCCORE_DEFINE_VISITABLE();
void docx_convert(oox::docx_conversion_context & Context);
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
_CP_OPT(std::wstring) text_description_;
std::wstring text_;
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name){}
virtual void add_text(const std::wstring & Text);
};
CP_REGISTER_OFFICE_ELEMENT2(text_input);
//-------------------------------------------------------------------------------------------------------------------
// text:sequence_ref
//-------------------------------------------------------------------------------------------------------------------
class sequence_ref : public paragraph_content_element<sequence_ref>

View File

@ -344,14 +344,14 @@ void style_table_row_properties_attlist::docx_convert(oox::docx_conversion_conte
if (style_row_height_)
{
int val = (int)( 0.5 + 20.0 *style_row_height_->get_value_unit(length::pt) );
int val = (int)( 0.5 + 20.0 * style_row_height_->get_value_unit(length::pt) );
if (val < 0)
val = 0;
strm << L"<w:trHeight w:hRule=\"exact\" w:val=\"" << val << L"\" />";
}
else if (style_min_row_height_)
{
int val = (int)( 0.5 + 20.0 *style_min_row_height_->get_value_unit(length::pt) );
int val = (int)( 0.5 + 20.0 * style_min_row_height_->get_value_unit(length::pt) );
if (val < 0)
val = 0;
strm << L"<w:trHeight w:hRule=\"atLeast\" w:val=\"" << val << L"\" />";

View File

@ -72,8 +72,9 @@ void table_table_row::docx_convert(oox::docx_conversion_context & Context)
const style_instance * inst =
Context.root()->odf_context().styleContainer().style_by_name( styleName , style_family::TableRow,Context.process_headers_footers_);
style_table_cell_properties* cell_props = NULL;
style_table_row_properties* row_props = NULL;
style_table_cell_properties *cell_props = NULL;
style_table_row_properties *row_props = NULL;
if (inst && inst->content())
{
cell_props = inst->content()->get_style_table_cell_properties(true);
@ -89,8 +90,32 @@ void table_table_row::docx_convert(oox::docx_conversion_context & Context)
{
_Wostream << L"<w:tr>";
_Wostream << L"<w:trPr>";
_Wostream << L"<w:cantSplit w:val=\"false\" />";
_Wostream << L"<w:trPr>";
bool bCantSplit = false;
if (row_props)
{
if (row_props->attlist_.fo_keep_together_ && row_props->attlist_.fo_keep_together_->get_type() == keep_together::Always)
{
_Wostream << L"<w:cantSplit w:val=\"true\"/>";
}
if (row_props->attlist_.style_row_height_)
{
int val = (int)( 0.5 + 20.0 * row_props->attlist_.style_row_height_->get_value_unit(length::pt) );
if (val < 0)
val = 0;
_Wostream << L"<w:trHeight w:val=\"" << val << L"\" w:hRule=\"exact\"/>";
}
else if (row_props->attlist_.style_min_row_height_)
{
int val = (int)( 0.5 + 20.0 * row_props->attlist_.style_min_row_height_->get_value_unit(length::pt) );
if (val < 0)
val = 0;
_Wostream << L"<w:trHeight w:val=\"" << val << L"\" w:hRule=\"atLeast\"/>";
}
}
if (cell_props)
cell_props->docx_convert(Context);

View File

@ -83,14 +83,14 @@ void table_table_row::pptx_convert(oox::pptx_conversion_context & Context)
style_table_row_properties_attlist & row_attlist = inst->content()->get_style_table_row_properties()->attlist_;
if (row_attlist.style_row_height_)
{
height = (int)( 0.5 +row_attlist.style_row_height_->get_value_unit(length::emu) );
height = (int)( 0.5 + row_attlist.style_row_height_->get_value_unit(length::emu) );
}
else if (row_attlist.style_min_row_height_)
{
height = (int)( 0.5 + row_attlist.style_min_row_height_->get_value_unit(length::emu));
}
}
if (height<1) height = 100000;
if (height < 1) height = 100000;
_Wostream << L"<a:tr h=\"" << height << L"\">";

View File

@ -443,6 +443,8 @@ namespace {
double pixToSize(double pixels, double maxDigitSize)
{
if (pixels < 8) pixels = 8; //УВЕДОМЛЕНИЕ О ПРИБЫТИИ ИНОСТРАННОГО ГРАЖДАНИНА.ods
return (int(( pixels /*/ 0.75*/ - 5)/ maxDigitSize * 100. + 0.5)) /100. * 0.9; // * 9525. * 72.0 / (360000.0 * 2.54);
}
double cmToChars (double cm)
@ -772,10 +774,10 @@ void table_table_cell::xlsx_convert(oox::xlsx_conversion_context & Context)
double s;
if (oox::parseTime(tv, h, m, s))
{
boost::int64_t intTime = (boost::int64_t)oox::convertTime(h, m, s);
if (intTime > 0)
double dTime = oox::convertTime(h, m, s);
if (dTime >= 0)
{
number_val = boost::lexical_cast<std::wstring>(intTime);
number_val = boost::lexical_cast<std::wstring>(dTime);
}
else
{

View File

@ -308,7 +308,7 @@ void paragraph::docx_convert(oox::docx_conversion_context & Context)
}
}
}
if (next_section_/* || next_end_section_*/)
if (next_section_/* || next_end_section_*/)//remove in text::section
{
Context.get_section_context().get().is_dump_ = true;
is_empty = false;
@ -675,6 +675,7 @@ void section::add_child_element( xml::sax * Reader, const std::wstring & Ns, con
void section::docx_convert(oox::docx_conversion_context & Context)
{
bool bAddSection = false;
if ( false == Context.get_drawing_state_content())
{
std::wstring current_page_properties = Context.get_page_properties();
@ -682,6 +683,8 @@ void section::docx_convert(oox::docx_conversion_context & Context)
Context.get_section_context().add_section (section_attr_.name_, section_attr_.style_name_.get_value_or(L""), current_page_properties);
Context.add_page_properties(current_page_properties);
bAddSection = true;
}
else
{
@ -729,6 +732,11 @@ void section::docx_convert(oox::docx_conversion_context & Context)
}
content_[i]->docx_convert(Context);
}
if (bAddSection)
{
Context.get_section_context().get().is_dump_ = true;
Context.last_dump_page_properties(false);
}
}
// text-section-source-attr

View File

@ -44,7 +44,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../../DesktopEditor/xml/libxml2/include;../../DesktopEditor/xml/build/vs2005;../../DesktopEditor/freetype-2.5.2/include"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;USE_LITE_READER;_USE_XMLLITE_READER_;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;__WORDSIZE=32;DONT_WRITE_EMBEDDED_FONTS"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;USE_LITE_READER;_USE_XMLLITE_READER_;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;__WORDSIZE=32;DONT_WRITE_EMBEDDED_FONTS;AVS_USE_CONVERT_PPTX_TOCUSTOM_VML"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"

View File

@ -1903,11 +1903,13 @@ void odf_drawing_context::set_group_position(_CP_OPT(double) x, _CP_OPT(double)
if ( !x || !y ) return;
impl_->current_group_->x = *change_x ;
impl_->current_group_->y = *change_y ;
if (change_x && impl_->current_group_->x)
impl_->current_group_->x = *change_x;
if (change_y && impl_->current_group_->y)
impl_->current_group_->y = *change_y;
impl_->current_group_->shift_x = (*x /impl_->current_group_->scale_cx - *change_x) ;
impl_->current_group_->shift_y = (*y /impl_->current_group_->scale_cy - *change_y) ;
impl_->current_group_->shift_x = (*x /impl_->current_group_->scale_cx - change_x.get_value_or(0)) ;
impl_->current_group_->shift_y = (*y /impl_->current_group_->scale_cy - change_y.get_value_or(0)) ;
}
void odf_drawing_context::set_group_size( _CP_OPT(double) cx, _CP_OPT(double) cy, _CP_OPT(double) change_cx, _CP_OPT(double) change_cy)
@ -1920,8 +1922,10 @@ void odf_drawing_context::set_group_size( _CP_OPT(double) cx, _CP_OPT(double) cy
if (change_cy && cy)
impl_->current_group_->scale_cy = *cy / *change_cy;
impl_->current_group_->cx = *change_cx;
impl_->current_group_->cy = *change_cy;
if (change_cx && impl_->current_group_->cx)
impl_->current_group_->cx = *change_cx;
if (change_cy && impl_->current_group_->cy)
impl_->current_group_->cy = *change_cy;
}
void odf_drawing_context::set_group_flip_V(bool bVal)

View File

@ -507,6 +507,10 @@ bool odf_text_context::start_field(int type, const std::wstring& value)
{
create_element(L"text", L"date", elm, odf_context_);
}break;
case fieldTextInput:
{
create_element(L"text", L"text-input", elm, odf_context_);
}break;
}
if (elm)

View File

@ -53,6 +53,8 @@ namespace odf_writer
fieldPageRef,
fieldSeq,
fieldXE,
fieldTextInput,
fieldExpression,
fieldBibliography = 0xff + 1,
fieldIndex,

View File

@ -292,25 +292,25 @@ void ods_conversion_context::set_comment_rect(double l, double t, double w, doub
current_table().set_comment_rect(l,t,w,h);
}
/////////////////////////////
void ods_conversion_context::add_hyperlink(std::wstring & ref, std::wstring & link, std::wstring & display)
void ods_conversion_context::add_hyperlink(const std::wstring & ref, const std::wstring & link, const std::wstring & display, bool bLocation)
{
//////////////////////////////////////////////////////////////////
std::vector<std::wstring> ref_cells;
boost::algorithm::split(ref_cells,ref, boost::algorithm::is_any_of(L":"), boost::algorithm::token_compress_on);
if (ref_cells.size()>1)
boost::algorithm::split(ref_cells, ref, boost::algorithm::is_any_of(L":"), boost::algorithm::token_compress_on);
if (ref_cells.size() > 1)
{
//в ооx можно воткнуть на диапазон одну ссылку, в оо нельзя - ссылку вствляем, текст не меням
int start_col = -1, start_row = -1;
int end_col = -1, end_row = -1;
utils::parsing_ref (ref_cells[0], start_col, start_row);
utils::parsing_ref (ref_cells[1], end_col, end_row);
utils::parsing_ref (ref_cells[1], end_col, end_row);
for (long col = start_col; col <= end_col; col++)
{
for (long row = start_row; row <= end_row; row++)
{
current_table().add_hyperlink(ref,col,row,link);
current_table().add_hyperlink(ref, col, row, link, bLocation);
//ссылка одна, а вот отображаемый текст - разный
}
}
@ -319,7 +319,7 @@ void ods_conversion_context::add_hyperlink(std::wstring & ref, std::wstring & li
{
int col = -1, row = -1;
utils::parsing_ref (ref_cells[0], col, row);
current_table().add_hyperlink(ref,col,row,link);
current_table().add_hyperlink(ref, col, row, link, bLocation);
}
}

View File

@ -93,7 +93,7 @@ public:
void add_external_reference(const std::wstring & ref);
void add_merge_cells(const std::wstring & ref);
void add_hyperlink(std::wstring & ref, std::wstring & link, std::wstring & display);
void add_hyperlink(const std::wstring & ref, const std::wstring & link, const std::wstring & display, bool external = true);
void start_comment (int col, int row, std::wstring & author);
void set_comment_rect (double l, double t, double w, double h);

View File

@ -73,8 +73,6 @@ void ods_table_context::start_table_part(std::wstring name, std::wstring ref)
ref = table_state_list_.back().office_table_name_ + L"!" + ref;
}
std::wstring odf_range = formulas_converter.convert_named_ref(ref);
XmlUtils::replace_all( odf_range, L"[", L"");
XmlUtils::replace_all( odf_range, L"]", L"");
d_range->table_target_range_address_ = odf_range;
d_range->table_name_ = name;
@ -141,8 +139,6 @@ void ods_table_context::add_autofilter(std::wstring ref)
formulasconvert::oox2odf_converter formulas_converter;
std::wstring odf_range = formulas_converter.convert_named_ref(ref);
XmlUtils::replace_all( odf_range, L"[", L"");
XmlUtils::replace_all( odf_range, L"]", L"");
d_range->table_target_range_address_ = odf_range;
d_range->table_display_filter_buttons_= true;
@ -167,8 +163,6 @@ void ods_table_context::add_defined_range(const std::wstring & name, const std::
formulasconvert::oox2odf_converter formulas_converter;
std::wstring odf_range = formulas_converter.convert_named_ref(cell_range);//todo - разделить конвертацию диапазонов/рэнжей на c [] и без
XmlUtils::replace_all( odf_range, L"[", L"");
XmlUtils::replace_all( odf_range, L"]", L"");
std::wstring odf_base_cell = formulas_converter.get_table_name() + L".$A$1";

View File

@ -582,7 +582,7 @@ office_element_ptr & ods_table_state::current_cell_element()
}
ods_hyperlink_state & ods_table_state::current_hyperlink()
{
if ((cells_size_ >0 && !hyperlinks_.empty()) && (cells_.back().hyperlink_idx >= 0) )
if ((cells_size_ > 0 && !hyperlinks_.empty()) && (cells_.back().hyperlink_idx >= 0) )
{
return hyperlinks_[cells_.back().hyperlink_idx];
}
@ -683,12 +683,19 @@ void ods_table_state::add_definded_expression(office_element_ptr & elm)
if (!table_defined_expressions_)return;
table_defined_expressions_->add_child_element(elm);
}
void ods_table_state::add_hyperlink(std::wstring & ref,int col, int row, std::wstring & link)
void ods_table_state::add_hyperlink(const std::wstring & ref,int col, int row, const std::wstring & link, bool bLocation)
{
ods_hyperlink_state state;
state.row = row; state.col = col; state.ref = ref; state.bLocation = bLocation;
state.row=row; state.col =col; state.ref = ref, state.link = link;
if (state.bLocation)
{
state.link = L"#" + formulas_converter_table.convert_named_ref(link);
}
else
{
state.link = link;
}
hyperlinks_.push_back(state);
}
@ -696,7 +703,7 @@ void ods_table_state::start_comment(int col, int row, std::wstring & author)
{
ods_comment_state state;
state.row=row; state.col =col; state.author = author;
state.row = row; state.col = col; state.author = author;
create_element(L"office", L"annotation", state.elm, context_);
comments_.push_back(state);
@ -1424,7 +1431,7 @@ void ods_table_state::add_default_cell( unsigned int repeated)
///////////////////////////////////////////////////
void ods_table_state::start_conditional_formats()
{
office_element_ptr elm;
office_element_ptr elm;
create_element(L"calcext", L"conditional-formats",elm,context_);
current_level_.back()->add_child_element(elm);
@ -1437,7 +1444,7 @@ void ods_table_state::end_conditional_formats()
}
void ods_table_state::start_conditional_format(std::wstring ref)
{
office_element_ptr elm;
office_element_ptr elm;
create_element(L"calcext", L"conditional-format", elm, context_);
current_level_.back()->add_child_element(elm);

View File

@ -179,8 +179,8 @@ struct ods_element_state
struct ods_cell_state : ods_element_state
{
int col;
int row;
int col = -1;
int row = -1;
int hyperlink_idx = -1;
int comment_idx = -1;
@ -191,14 +191,16 @@ struct ods_cell_state : ods_element_state
struct ods_hyperlink_state
{
std::wstring ref;
int col;
int row;
int col = -1;
int row = -1;
std::wstring link;
bool bLocation = false;
};
struct ods_comment_state
{
int col;
int row;
int col = -1;
int row = -1;
std::wstring author;
office_element_ptr elm;
@ -326,7 +328,8 @@ public:
void end_conditional_formats();
///////////////////////////////
void add_hyperlink(std::wstring & ref,int col, int row, std::wstring & link);
void add_hyperlink(const std::wstring & ref,int col, int row, const std::wstring & link, bool bLocation = false);
void add_definded_expression(office_element_ptr & elm);
void start_comment(int col, int row, std::wstring & author);

View File

@ -706,6 +706,11 @@ void odt_conversion_context::set_field_instr()
{
current_fields.back().type = fieldTime;
}
res1 = instr.find(L"FORMTEXT");
if (std::wstring::npos != res1 && current_fields.back().type == 0)
{
current_fields.back().type = fieldTextInput;
}
res1 = instr.find(L"SEQ");
if (std::wstring::npos != res1 && current_fields.back().type == 0)
{

View File

@ -814,7 +814,40 @@ void text_sequence::add_text(const std::wstring & Text)
office_element_ptr elm = text_text::create(Text) ;
text_.push_back( elm );
}
//----------------------------------------------------------------------------------
// text:sequence
//----------------------------------------------------------------------------------
const wchar_t * text_text_input::ns = L"text";
const wchar_t * text_text_input::name = L"text-input";
void text_text_input::serialize(std::wostream & _Wostream)
{
CP_XML_WRITER(_Wostream)
{
CP_XML_NODE_SIMPLE()
{
CP_XML_ATTR_OPT(L"text:description", text_description_);
for (size_t i = 0; i < text_.size(); i++)
{
text_[i]->text_to_stream(CP_XML_STREAM());
}
}
}
}
void text_text_input::create_child_element(const std::wstring & Ns, const std::wstring & Name)
{
CP_CREATE_ELEMENT(text_);
}
void text_text_input::add_child_element( const office_element_ptr & child_element)
{
text_.push_back(child_element);
}
void text_text_input::add_text(const std::wstring & Text)
{
office_element_ptr elm = text_text::create(Text) ;
text_.push_back( elm );
}
//----------------------------------------------------------------------------------
// text:sequesheet-namence
//----------------------------------------------------------------------------------

View File

@ -689,9 +689,30 @@ public:
_CP_OPT(std::wstring) template_;
office_element_ptr_array text_;
};
CP_REGISTER_OFFICE_ELEMENT2(text_sequence);
// text:text-input
//---------------------------------------------------------------------------------------------------
class text_text_input : public office_element_impl<text_text_input>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextTextInput;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
virtual void add_text(const std::wstring & Text);
_CP_OPT(std::wstring) text_description_;
office_element_ptr_array text_;
};
CP_REGISTER_OFFICE_ELEMENT2(text_text_input);
// text:sheet-name
//---------------------------------------------------------------------------------------------------
class text_sheet_name : public office_element_impl<text_sheet_name>

View File

@ -274,7 +274,7 @@ void OoxConverter::convert(PPTX::Logic::Pic *oox_picture)
pathImage = oox_picture->blipFill.blip->oleFilepathImage;
}
std::wstring pathOle;
if (oox_picture->oleObject->m_oId.IsInit())
{
pathOle = find_link_by_id(oox_picture->oleObject->m_oId->get(), 4);
@ -1030,10 +1030,11 @@ void OoxConverter::convert(PPTX::Logic::BlipFill *oox_bitmap_fill)
if (oox_bitmap_fill->blip.IsInit())
{
std::wstring sID, pathImage;
if (oox_bitmap_fill->blip->embed.IsInit())
if (oox_bitmap_fill->blip->embed.IsInit())
{
sID = oox_bitmap_fill->blip->embed->get();
pathImage = find_link_by_id(sID,1);
pathImage = find_link_by_id(sID, 1);
if (!pathImage.empty())
{
@ -1505,6 +1506,7 @@ void OoxConverter::convert_list_level(PPTX::Logic::TextParagraphPr *oox_para_pro
if (buBlip.blip.embed.IsInit())
{
std::wstring sID = buBlip.blip.embed->get();
std::wstring pathImage = find_link_by_id(sID, 1);
if (pathImage.empty())
@ -2166,6 +2168,7 @@ void OoxConverter::convert(PPTX::Logic::Run *oox_run)
text_properties->content_.style_text_underline_style_ = odf_types::line_style::Solid;
std::wstring hlink = find_link_by_id(oox_run->rPr->hlinkClick->id.get(), 2);
text_context->add_hyperlink(hlink, oox_run->GetText());
}
else
@ -2200,6 +2203,7 @@ void OoxConverter::convert(PPTX::Logic::Fld *oox_fld)
if ((oox_fld->rPr.IsInit()) && (oox_fld->rPr->hlinkClick.IsInit()) && (oox_fld->rPr->hlinkClick->id.IsInit()))
{
std::wstring hlink = find_link_by_id(oox_fld->rPr->hlinkClick->id.get(), 2);
odf_context()->text_context()->add_hyperlink(hlink, oox_fld->GetText());
}

View File

@ -352,10 +352,9 @@ void OoxConverter::convert(OOX::Vml::CImageData *vml_image_data)
if (vml_image_data == NULL) return;
std::wstring pathImage;
double Width=0, Height = 0;
double Width = 0, Height = 0;
std::wstring sID;
if (vml_image_data->m_rId.IsInit()) sID = vml_image_data->m_rId->GetValue();
else if (vml_image_data->m_oRelId.IsInit()) sID = vml_image_data->m_oRelId->GetValue();
else if (vml_image_data->m_rPict.IsInit()) sID = vml_image_data->m_rPict->GetValue();
@ -448,10 +447,10 @@ void OoxConverter::convert(OOX::Vml::CFill *vml_fill)
if (!sID.empty())
{
//bitmap fill
//bitmap fill
odf_context()->drawing_context()->start_bitmap_style();
{
double Width=0, Height = 0;
double Width = 0, Height = 0;
sImagePath = find_link_by_id(sID, 1);

View File

@ -570,28 +570,36 @@ std::wstring OoxConverter::find_link_by (smart_ptr<OOX::File> & oFile, int type)
OOX::Image* pImage = dynamic_cast<OOX::Image*>(oFile.operator->());
if (pImage)
{
ref = pImage->filename().GetPath();
}
}
if (type == 2 && OOX::FileTypes::HyperLink == oFile->type())
{
OOX::HyperLink* pHyperlink = dynamic_cast<OOX::HyperLink*>(oFile.operator->());
if (pHyperlink && pHyperlink->bHyperlink)
{
ref = pHyperlink->Uri().GetPath();
}
}
if (type == 3)
{
OOX::Media* pMedia = dynamic_cast<OOX::Media*>(oFile.operator->());
if (pMedia)
{
ref = pMedia->filename().GetPath();
}
}
if (type == 4)
{
OOX::OleObject* pOleObject = dynamic_cast<OOX::OleObject*>(oFile.operator->());
if (pOleObject)
{
ref = pOleObject->filename().GetPath();
}
}
return ref;
}

View File

@ -379,11 +379,11 @@ public:
cpdoccore::odf_writer::package::odf_document *output_document;
std::wstring find_link_by (NSCommon::smart_ptr<OOX::File> & oFile, int type);
virtual std::wstring find_link_by_id(std::wstring sId, int t) = 0;
virtual NSCommon::smart_ptr<OOX::File> find_file_by_id(std::wstring sId) = 0;
std::wstring find_link_by (NSCommon::smart_ptr<OOX::File> & oFile, int type);
virtual std::wstring find_link_by_id(const std::wstring & sId, int type) = 0;
virtual NSCommon::smart_ptr<OOX::File> find_file_by_id(const std::wstring & sId) = 0;
OOX::IFileContainer *oox_current_child_document;
OOX::IFileContainer *oox_current_child_document;
void convert (OOX::JsaProject *jsaProject);
void convert (double oox_font_size, _CP_OPT(cpdoccore::odf_types::font_size) & odf_font_size);

View File

@ -146,7 +146,7 @@ OOX::IFileContainer* DocxConverter::current_document()
return dynamic_cast<OOX::IFileContainer*>(docx_document->m_pDocument);
}
}
NSCommon::smart_ptr<OOX::File> DocxConverter::find_file_by_id(std::wstring sId)
NSCommon::smart_ptr<OOX::File> DocxConverter::find_file_by_id(const std::wstring &sId)
{
smart_ptr<OOX::File> oFile;
@ -158,7 +158,7 @@ NSCommon::smart_ptr<OOX::File> DocxConverter::find_file_by_id(std::wstring sId)
return oFile;
}
std::wstring DocxConverter::find_link_by_id (std::wstring sId, int type)
std::wstring DocxConverter::find_link_by_id (const std::wstring & sId, int type)
{
if (!docx_document) return L"";
@ -2911,6 +2911,8 @@ void DocxConverter::convert(OOX::Drawing::CAnchor *oox_anchor)
_CP_OPT(int) anchor_type_x, anchor_type_y;
bool bThrough = oox_anchor->m_oBehindDoc.IsInit() ? oox_anchor->m_oBehindDoc->ToBool(): false;
if (oox_anchor->m_oPositionV.IsInit() && oox_anchor->m_oPositionV->m_oRelativeFrom.IsInit())
{
int vert_rel = oox_anchor->m_oPositionV->m_oRelativeFrom->GetValue();
@ -3005,6 +3007,12 @@ void DocxConverter::convert(OOX::Drawing::CAnchor *oox_anchor)
{
odt_context->drawing_context()->set_wrap_style(odf_types::style_wrap::None);
wrap_set = true;
if (bThrough)
{//эффект_штурмовика.docx
odt_context->drawing_context()->set_wrap_style(odf_types::style_wrap::RunThrough);
odt_context->drawing_context()->set_object_background(true);
}
}
else if (oox_anchor->m_oAllowOverlap.IsInit())
{
@ -3134,6 +3142,9 @@ void DocxConverter::convert_settings()
if (!docx_document->m_pSettings) return;
if (docx_document->m_pSettings->m_oWriteProtection.IsInit())
{
}
if (docx_document->m_pSettings->m_oZoom.IsInit())
{
}
@ -3265,7 +3276,7 @@ void DocxConverter::convert(OOX::Logic::CHyperlink *oox_hyperlink)
if (oox_hyperlink->m_oId.IsInit()) //гиперлинк
{
ref = find_link_by_id(oox_hyperlink->m_oId->GetValue(),2);
ref = find_link_by_id(oox_hyperlink->m_oId->GetValue(), 2);
}
else if (oox_hyperlink->m_sAnchor.IsInit())
{

View File

@ -148,12 +148,12 @@ namespace Oox2Odf
virtual void convertDocument();
virtual OOX::IFileContainer *current_document();
virtual odf_writer::odf_conversion_context *odf_context();
virtual PPTX::Theme *oox_theme();
virtual PPTX::Logic::ClrMap *oox_clrMap();
virtual std::wstring find_link_by_id (std::wstring sId, int t);
virtual NSCommon::smart_ptr<OOX::File> find_file_by_id(std::wstring sId);
virtual OOX::IFileContainer *current_document();
virtual odf_writer::odf_conversion_context *odf_context();
virtual PPTX::Theme *oox_theme();
virtual PPTX::Logic::ClrMap *oox_clrMap();
virtual std::wstring find_link_by_id (const std::wstring & sId, int t);
virtual NSCommon::smart_ptr<OOX::File> find_file_by_id (const std::wstring & sId);
void convert(OOX::WritingElement *oox_unknown);
void convert(OOX::Logic::CSdtContent *oox_sdt);

View File

@ -143,7 +143,7 @@ OOX::IFileContainer* PptxConverter::current_document()
else
return pptx_document;
}
NSCommon::smart_ptr<OOX::File> PptxConverter::find_file_by_id(std::wstring sId)
NSCommon::smart_ptr<OOX::File> PptxConverter::find_file_by_id(const std::wstring & sId)
{
smart_ptr<OOX::File> oFile;
if (pptx_document)
@ -159,7 +159,7 @@ NSCommon::smart_ptr<OOX::File> PptxConverter::find_file_by_id(std::wstring sId)
return oFile;
}
std::wstring PptxConverter::find_link_by_id (std::wstring sId, int type)
std::wstring PptxConverter::find_link_by_id (const std::wstring & sId, int type)
{
if(!pptx_document) return L"";
@ -555,10 +555,11 @@ void PptxConverter::convert( PPTX::Logic::Transition *oox_transition )
if (oox_transition->sndAc.is_init() && oox_transition->sndAc->stSnd.is_init())
{
std::wstring sID = oox_transition->sndAc->stSnd->embed.get();
std::wstring pathAudio = find_link_by_id(sID, 3);
std::wstring sID = oox_transition->sndAc->stSnd->embed.get();
std::wstring odf_ref = odf_context()->add_media(pathAudio);
std::wstring pathAudio = find_link_by_id(sID, 3);
std::wstring odf_ref = odf_context()->add_media(pathAudio);
odp_context->current_slide().set_transition_sound(odf_ref, oox_transition->sndAc->stSnd->loop.get_value_or(false));
}

View File

@ -120,8 +120,8 @@ namespace Oox2Odf
virtual PPTX::Theme *oox_theme();
virtual PPTX::Logic::ClrMap *oox_clrMap();
virtual std::wstring find_link_by_id (std::wstring sId, int t);
virtual NSCommon::smart_ptr<OOX::File> find_file_by_id (std::wstring sId);
virtual std::wstring find_link_by_id (const std::wstring & sId, int t);
virtual NSCommon::smart_ptr<OOX::File> find_file_by_id (const std::wstring & sId);
void convert(OOX::WritingElement *oox_unknown);

View File

@ -106,7 +106,7 @@ OOX::IFileContainer* XlsxConverter::current_document()
else
return NULL;
}
smart_ptr<OOX::File> XlsxConverter::find_file_by_id(std::wstring sId)
smart_ptr<OOX::File> XlsxConverter::find_file_by_id(const std::wstring & sId)
{
smart_ptr<OOX::File> oFile;
@ -117,7 +117,7 @@ smart_ptr<OOX::File> XlsxConverter::find_file_by_id(std::wstring sId)
return oFile;
}
std::wstring XlsxConverter::find_link_by_id (std::wstring sId, int type)
std::wstring XlsxConverter::find_link_by_id (const std::wstring & sId, int type)
{
smart_ptr<OOX::File> oFile;
std::wstring ref;
@ -441,8 +441,8 @@ void XlsxConverter::convert(OOX::Spreadsheet::CPictureWorksheet *oox_background)
if (!oox_background) return;
if (!oox_background->m_oId.IsInit())return;
std::wstring sID, pathImage, href;
sID = oox_background->m_oId->GetValue();
std::wstring pathImage, href, sID = oox_background->m_oId->GetValue();
pathImage = find_link_by_id(sID, 1);
href = ods_context->add_image(pathImage);
@ -539,8 +539,9 @@ void XlsxConverter::convert(OOX::Spreadsheet::CHyperlink *oox_hyperlink,OOX::Spr
if (oox_sheet == NULL)return;
std::wstring ref = oox_hyperlink->m_oRef.IsInit() ? oox_hyperlink->m_oRef.get() : L"";
std::wstring link;
std::wstring link;
std::wstring display = oox_hyperlink->m_oDisplay.IsInit() ? oox_hyperlink->m_oDisplay.get() : L"";
if (oox_hyperlink->m_oRid.IsInit() && oox_sheet->m_pCurRels.IsInit())
{
OOX::Rels::CRelationShip* oRels = NULL;
@ -550,10 +551,13 @@ void XlsxConverter::convert(OOX::Spreadsheet::CHyperlink *oox_hyperlink,OOX::Spr
if(oRels->IsExternal())
link= oRels->Target().GetPath();
}
ods_context->add_hyperlink(ref, link, display, false);
}
else if (oox_hyperlink->m_oLocation.IsInit())
{
link = oox_hyperlink->m_oLocation.get();
ods_context->add_hyperlink(ref, link, display, true);
}
std::wstring display = oox_hyperlink->m_oDisplay.IsInit() ? oox_hyperlink->m_oDisplay.get() : L"";
ods_context->add_hyperlink(ref, link, display);
}
void XlsxConverter::convert(OOX::Spreadsheet::CRow *oox_row, OOX::Spreadsheet::CRow *oox_row_prev)
@ -1745,23 +1749,23 @@ void XlsxConverter::convert(OOX::Spreadsheet::CBorder *oox_border, odf_writer::s
convert(oox_border->m_oStart.GetPointer() , left);
convert(oox_border->m_oEnd.GetPointer() , right);
if (bottom == top && top == left && left== right && bottom.length() > 0)
if (bottom == top && top == left && left == right && !bottom.empty())
{
table_cell_properties->style_table_cell_properties_attlist_.common_border_attlist_.fo_border_ = left;
}
else
{
if (bottom.length() >0 )table_cell_properties->style_table_cell_properties_attlist_.common_border_attlist_.fo_border_bottom_ = bottom;
if (top.length() >0 ) table_cell_properties->style_table_cell_properties_attlist_.common_border_attlist_.fo_border_top_ = top;
if (left.length() >0 ) table_cell_properties->style_table_cell_properties_attlist_.common_border_attlist_.fo_border_left_ = left;
if (right.length() >0 ) table_cell_properties->style_table_cell_properties_attlist_.common_border_attlist_.fo_border_right_ = right;
if (!bottom.empty())table_cell_properties->style_table_cell_properties_attlist_.common_border_attlist_.fo_border_bottom_ = bottom;
if (!top.empty()) table_cell_properties->style_table_cell_properties_attlist_.common_border_attlist_.fo_border_top_ = top;
if (!left.empty()) table_cell_properties->style_table_cell_properties_attlist_.common_border_attlist_.fo_border_left_ = left;
if (!right.empty()) table_cell_properties->style_table_cell_properties_attlist_.common_border_attlist_.fo_border_right_ = right;
}
convert(oox_border->m_oDiagonal.GetPointer(), other);
if (oox_border->m_oDiagonalDown.IsInit() && other.length()>0) //and true???
if (oox_border->m_oDiagonalDown.IsInit() && !other.empty()) //and true???
table_cell_properties->style_table_cell_properties_attlist_.style_diagonal_tl_br_= other;
if (oox_border->m_oDiagonalUp.IsInit() && other.length()>0) //and true???
if (oox_border->m_oDiagonalUp.IsInit() && !other.empty()) //and true???
table_cell_properties->style_table_cell_properties_attlist_.style_diagonal_bl_tr_= other;
//nullable<CBorderProp> m_oHorizontal;
//nullable<CBorderProp> m_oVertical;
@ -2205,19 +2209,17 @@ void XlsxConverter::convert(OOX::Spreadsheet::COleObjects *oox_objects, OOX::Spr
}
if (object->m_oRid.IsInit())
{
std::wstring pathOle;
std::wstring sID = object->m_oRid->GetValue();
pathOle = find_link_by_id(sID, 4);
std::wstring pathOle = find_link_by_id(sID, 4);
odf_ref_object = odf_context()->add_oleobject(pathOle);
}
if ((object->m_oObjectPr.IsInit()) && (object->m_oObjectPr->m_oRid.IsInit()))
{
std::wstring pathImage;
std::wstring sID = object->m_oObjectPr->m_oRid->GetValue();
pathImage = find_link_by_id(sID, 1);
std::wstring pathImage = find_link_by_id(sID, 1);
odf_ref_image = odf_context()->add_imageobject(pathImage);
}

View File

@ -140,11 +140,11 @@ namespace Oox2Odf
virtual void convertDocument();
virtual OOX::IFileContainer *current_document();
virtual odf_writer::odf_conversion_context *odf_context();
virtual PPTX::Theme *oox_theme();
virtual std::wstring find_link_by_id (std::wstring sId, int t);
virtual NSCommon::smart_ptr<OOX::File> find_file_by_id(std::wstring sId);
virtual OOX::IFileContainer *current_document();
virtual odf_writer::odf_conversion_context *odf_context();
virtual PPTX::Theme *oox_theme();
virtual std::wstring find_link_by_id (const std::wstring & sId, int t);
virtual NSCommon::smart_ptr<OOX::File> find_file_by_id (const std::wstring & sId);
void convert(OOX::Spreadsheet::WritingElement *oox_unknown);
private:

View File

@ -40,6 +40,8 @@
#include "../../../ASCOfficePPTXFile/PPTXFormat/Logic/Shape.h"
#include "../../../ASCOfficePPTXFile/PPTXFormat/Logic/SpTree.h"
#include <iostream>
CStylesWriter::CStylesWriter() : m_pTheme(NULL) {}
CStylesWriter::CStylesWriter(NSPresentationEditor::CTheme* pTheme) : m_pTheme(pTheme) {}
@ -889,6 +891,208 @@ void NSPresentationEditor::CShapeWriter::WriteShapeInfo()
std::wstring str2 = _T("</p:nvSpPr>");
m_oWriter.WriteString(str2);
}
void NSPresentationEditor::CShapeWriter::Write3dShape()
{
CShapeElement* pShapeElement = dynamic_cast<CShapeElement*>(m_pElement.get());
if (!pShapeElement) return;
CPPTShape *pPPTShape = dynamic_cast<CPPTShape *>(pShapeElement->m_pShape->getBaseShape().get());
if (!pPPTShape) return;
if (!pPPTShape->m_o3dOptions.bEnabled) return;
//{
// std::cout << "........................................................................\n";
// std::wcout << pShapeElement->m_sName << L"\n";
// if (pPPTShape->m_o3dOptions.dSpecularAmt)
// {
// std::cout << "SpecularAmt\t" << (*pPPTShape->m_o3dOptions.dSpecularAmt) << "\n";
// }
// if (pPPTShape->m_o3dOptions.dDiffuseAmt)
// {
// std::cout << "iffuseAmt\t" << (*pPPTShape->m_o3dOptions.dDiffuseAmt) << "\n";
// }
// if (pPPTShape->m_o3dOptions.dShininess)
// {
// std::cout << "Shininess\t" << (*pPPTShape->m_o3dOptions.dShininess) << "\n";
// }
// if (pPPTShape->m_o3dOptions.dXRotationAngle)
// {
// std::cout << "XRotationAngle\t" << (*pPPTShape->m_o3dOptions.dXRotationAngle) << "\n";
// }
// if (pPPTShape->m_o3dOptions.dYRotationAngle)
// {
// std::cout << "YRotationAngle\t" << (*pPPTShape->m_o3dOptions.dYRotationAngle) << "\n";
// }
// if (pPPTShape->m_o3dOptions.dRotationAxisX)
// {
// std::cout << "RotationAxisX\t" << (*pPPTShape->m_o3dOptions.dRotationAxisX) << "\n";
// }
// if (pPPTShape->m_o3dOptions.dRotationAxisY)
// {
// std::cout << "RotationAxisY\t" << (*pPPTShape->m_o3dOptions.dRotationAxisY) << "\n";
// }
// if (pPPTShape->m_o3dOptions.dRotationAxisZ)
// {
// std::cout << "RotationAxisZ\t" << (*pPPTShape->m_o3dOptions.dRotationAxisZ) << "\n";
// }
// if (pPPTShape->m_o3dOptions.dRotationAngle)
// {
// std::cout << "RotationAngle\t" << (*pPPTShape->m_o3dOptions.dRotationAngle) << "\n";
// }
// if (pPPTShape->m_o3dOptions.dRotationCenterX)
// {
// std::cout << "RotationCenterX\t" << (*pPPTShape->m_o3dOptions.dRotationCenterX) << "\n";
// }
// if (pPPTShape->m_o3dOptions.dRotationCenterY)
// {
// std::cout << "RotationCenterY\t" << (*pPPTShape->m_o3dOptions.dRotationCenterY) << "\n";
// }
// if (pPPTShape->m_o3dOptions.dRotationCenterZ)
// {
// std::cout << "RotationCenterZ\t" << (*pPPTShape->m_o3dOptions.dRotationCenterZ) << "\n";
// }
// if (pPPTShape->m_o3dOptions.dTolerance)
// {
// std::cout << "Tolerance\t" << (*pPPTShape->m_o3dOptions.dTolerance) << "\n";
// }
// std::cout << "XViewpoint\t" << (pPPTShape->m_o3dOptions.dXViewpoint) << "\n";
// std::cout << "YViewpoint\t" << (pPPTShape->m_o3dOptions.dYViewpoint) << "\n";
// if (pPPTShape->m_o3dOptions.dZViewpoint)
// {
// std::cout << "ZViewpoint\t" << (*pPPTShape->m_o3dOptions.dZViewpoint) << "\n";
// }
// std::cout << "OriginX\t" << (pPPTShape->m_o3dOptions.dOriginX) << "\n";
// std::cout << "OriginY\t" << (pPPTShape->m_o3dOptions.dOriginY) << "\n";
// std::cout << "SkewAngle\t" << (pPPTShape->m_o3dOptions.dSkewAngle) << "\n";
// std::cout << "SkewAmount\t" << (pPPTShape->m_o3dOptions.nSkewAmount) << "\n";
// if (pPPTShape->m_o3dOptions.dAmbientIntensity)
// {
// std::cout << "AmbientIntensity\t" << (*pPPTShape->m_o3dOptions.dAmbientIntensity) << "\n";
// }
// if (pPPTShape->m_o3dOptions.dKeyIntensity)
// {
// std::cout << "KeyIntensity\t" << (*pPPTShape->m_o3dOptions.dKeyIntensity) << "\n";
// }
// std::cout << "KeyX\t" << (pPPTShape->m_o3dOptions.dKeyX) << "\n";
// std::cout << "KeyY\t" << (pPPTShape->m_o3dOptions.dKeyY) << "\n";
// if (pPPTShape->m_o3dOptions.dKeyZ)
// {
// std::cout << "KeyZ\t" << (*pPPTShape->m_o3dOptions.dKeyZ) << "\n";
// }
// std::cout << "FillIntensity\t" << (pPPTShape->m_o3dOptions.dFillIntensity) << "\n";
// std::cout << "FillX\t" << (pPPTShape->m_o3dOptions.dFillX) << "\n";
// std::cout << "FillY\t" << (pPPTShape->m_o3dOptions.dFillY) << "\n";
// if (pPPTShape->m_o3dOptions.dFillZ)
// {
// std::cout << "FillZ\t" << (*pPPTShape->m_o3dOptions.dFillZ) << "\n";
// }
// std::cout << "........................................................................\n";
//}
m_oWriter.WriteString(std::wstring(L"<a:scene3d>"));
m_oWriter.WriteString(std::wstring(L"<a:camera"));
std::wstring sAngle;
if (pPPTShape->m_o3dOptions.dSkewAngle < 10) sAngle = L"Left";
else if (pPPTShape->m_o3dOptions.dSkewAngle >= 10 && pPPTShape->m_o3dOptions.dSkewAngle < 80) sAngle = L"BottomLeft";
else if (pPPTShape->m_o3dOptions.dSkewAngle >= 80 && pPPTShape->m_o3dOptions.dSkewAngle < 100) sAngle = L"Bottom";
else if (pPPTShape->m_o3dOptions.dSkewAngle >= 100 && pPPTShape->m_o3dOptions.dSkewAngle < 145) sAngle = L"BottomRight";
else if (pPPTShape->m_o3dOptions.dSkewAngle >= 145 && pPPTShape->m_o3dOptions.dSkewAngle < 190) sAngle = L"Right";
else if (pPPTShape->m_o3dOptions.dSkewAngle >= 190 && pPPTShape->m_o3dOptions.dSkewAngle < 235) sAngle = L"TopRight";
else if (pPPTShape->m_o3dOptions.dSkewAngle >= 235 && pPPTShape->m_o3dOptions.dSkewAngle < 280) sAngle = L"Top";
else if (pPPTShape->m_o3dOptions.dSkewAngle >= 280 && pPPTShape->m_o3dOptions.dSkewAngle < 325) sAngle = L"TopLeft";
else sAngle = L"Front";
if (pPPTShape->m_o3dOptions.bParallel)
m_oWriter.WriteString(std::wstring(L" prst=\"legacyOblique" + sAngle + L"\""));
else
m_oWriter.WriteString(std::wstring(L" prst=\"legacyPerspective" + sAngle + L"\""));
m_oWriter.WriteString(std::wstring(L">"));
if (pPPTShape->m_o3dOptions.bConstrainRotation)
{
m_oWriter.WriteString(std::wstring(L"<a:rot"));
m_oWriter.WriteString(std::wstring(L" lat=\"" + std::to_wstring((int)(60000 * pPPTShape->m_o3dOptions.dXRotationAngle.get_value_or(0))) + L"\""));
m_oWriter.WriteString(std::wstring(L" lon=\"" + std::to_wstring((int)(60000 * pPPTShape->m_o3dOptions.dYRotationAngle.get_value_or(0))) + L"\""));
m_oWriter.WriteString(std::wstring(L" rev=\"" + std::to_wstring((int)(60000 * pPPTShape->m_o3dOptions.dRotationAngle.get_value_or(0))) + L"\""));
m_oWriter.WriteString(std::wstring(L"/>"));
}
m_oWriter.WriteString(std::wstring(L"</a:camera>"));
m_oWriter.WriteString(std::wstring(L"<a:lightRig"));
if (pPPTShape->m_o3dOptions.dFillIntensity < 0.3)
m_oWriter.WriteString(std::wstring(L" rig=\"legacyHarsh3\""));
else if (pPPTShape->m_o3dOptions.dFillIntensity < 0.4)
m_oWriter.WriteString(std::wstring(L" rig=\"legacyFlat4\""));
else if (pPPTShape->m_o3dOptions.dFillIntensity > 0.6 ||
(pPPTShape->m_o3dOptions.dKeyX < 0.1 && pPPTShape->m_o3dOptions.dFillX < 0.1 &&
pPPTShape->m_o3dOptions.dKeyY < 0.1 && pPPTShape->m_o3dOptions.dFillY < 0.1))
m_oWriter.WriteString(std::wstring(L" rig=\"legacyFlat1\""));
else
m_oWriter.WriteString(std::wstring(L" rig=\"legacyFlat3\""));
if (pPPTShape->m_o3dOptions.dKeyX < 0.1 && pPPTShape->m_o3dOptions.dFillX < 0.1)
{
if (pPPTShape->m_o3dOptions.dKeyY < 0.1 && pPPTShape->m_o3dOptions.dFillY < 0.1)
m_oWriter.WriteString(std::wstring(L" dir=\"t\""));
else if (pPPTShape->m_o3dOptions.dKeyY < 0) m_oWriter.WriteString(std::wstring(L" dir=\"r\""));
else m_oWriter.WriteString(std::wstring(L" dir=\"l\""));
}
else
{
if (pPPTShape->m_o3dOptions.dKeyX < 0) m_oWriter.WriteString(std::wstring(L" dir=\"t\""));
else m_oWriter.WriteString(std::wstring(L" dir=\"b\""));
}
m_oWriter.WriteString(std::wstring(L"/>"));
m_oWriter.WriteString(std::wstring(L"</a:scene3d>"));
m_oWriter.WriteString(std::wstring(L"<a:sp3d"));
m_oWriter.WriteString(std::wstring(L" extrusionH=\"" + std::to_wstring(pPPTShape->m_o3dOptions.nExtrudeBackward) + L"\""));
switch(pPPTShape->m_o3dOptions.nRenderMode)
{
case 0x00000000://solid
{
if (pPPTShape->m_o3dOptions.bMetallic)
m_oWriter.WriteString(std::wstring(L" prstMaterial=\"legacyMetal\""));
else
m_oWriter.WriteString(std::wstring(L" prstMaterial=\"legacyMatte\""));
}break;
case 0x00000001: m_oWriter.WriteString(std::wstring(L" prstMaterial=\"legacyWireframe\"")); break; //wireframe
case 0x00000002: m_oWriter.WriteString(std::wstring(L" prstMaterial=\"legacyWireframe\"")); break; //bounding cube ????
}
m_oWriter.WriteString(std::wstring(L">"));
m_oWriter.WriteString(std::wstring(L"<a:bevelT w=\"13500\" h=\"13500\" prst=\"angle\"/>"));
m_oWriter.WriteString(std::wstring(L"<a:bevelB w=\"13500\" h=\"13500\" prst=\"angle\"/>"));
std::wstring strExtrusionClr;
if (pPPTShape->m_o3dOptions.oExtrusionColor)
{
strExtrusionClr = ConvertColor(*pPPTShape->m_o3dOptions.oExtrusionColor);
}
else
{
if (pShapeElement->m_oBrush.Type != c_BrushTypeNoFill)
{
strExtrusionClr = ConvertColor(pShapeElement->m_oBrush.Color1, pShapeElement->m_oBrush.Alpha1);
}
else
{
strExtrusionClr = ConvertColor(pShapeElement->m_oPen.Color, pShapeElement->m_oPen.Alpha);
}
}
m_oWriter.WriteString(std::wstring(L"<a:extrusionClr>"));
m_oWriter.WriteString(strExtrusionClr);
m_oWriter.WriteString(std::wstring(L"</a:extrusionClr>"));
m_oWriter.WriteString(std::wstring(L"<a:contourClr>"));
m_oWriter.WriteString(strExtrusionClr);
m_oWriter.WriteString(std::wstring(L"</a:contourClr>"));
m_oWriter.WriteString(std::wstring(L"</a:sp3d>"));
}
void NSPresentationEditor::CShapeWriter::WriteTextInfo()
{
//if (false == m_xmlTxBodyAlternative.empty())
@ -1552,6 +1756,7 @@ std::wstring NSPresentationEditor::CShapeWriter::ConvertShape()
}
m_oWriter.WriteString(ConvertShadow(pShapeElement->m_oShadow));
}
Write3dShape();
m_oWriter.WriteString(std::wstring(L"</p:spPr>"));

View File

@ -181,7 +181,7 @@ namespace NSPresentationEditor
std::wstring ConvertShadow (CShadow & shadow);
std::wstring ConvertBrush (CBrush & brush);
std::wstring ConvertLineEnd (unsigned char cap, unsigned char length, unsigned char width);
static std::wstring ConvertColor (CColor & color, long alpha);
static std::wstring ConvertColor (CColor & color, long alpha = 255);
void ParseXmlAlternative(const std::wstring & xml);
// тип рендерера-----------------------------------------------------------------------------
@ -453,5 +453,6 @@ namespace NSPresentationEditor
void WriteShapeInfo();
void WriteImageInfo();
void WriteTextInfo();
void Write3dShape();
};
}

View File

@ -261,7 +261,7 @@ void CPPTElement::SetUpProperties(CElementPtr pElement, CTheme* pTheme, CSlideIn
{
pElement->m_oBrush.Type = c_BrushTypeNoFill;
}
else if (pElement->m_oBrush.Type == c_BrushTypeNoFill )
else if (pElement->m_oBrush.Type == c_BrushTypeNotSet )
{
pElement->m_oBrush.Type = c_BrushTypeSolid;
}
@ -420,7 +420,7 @@ void CPPTElement::SetUpProperty(CElementPtr pElement, CTheme* pTheme, CSlideInfo
else
oAtom.ToColor(&pElement->m_oBrush.Color1);
if (pElement->m_oBrush.Type == c_BrushTypeNoFill )
if (pElement->m_oBrush.Type == c_BrushTypeNotSet )
pElement->m_oBrush.Type = c_BrushTypeSolid;
}break;
@ -434,7 +434,7 @@ void CPPTElement::SetUpProperty(CElementPtr pElement, CTheme* pTheme, CSlideInfo
else
oAtom.ToColor(&pElement->m_oBrush.Color2);
if (pElement->m_bIsBackground && pElement->m_oBrush.Type == c_BrushTypeNoFill )
if (pElement->m_bIsBackground && pElement->m_oBrush.Type == c_BrushTypeNotSet )
{
pElement->m_oBrush.Type = c_BrushTypeSolid;
}
@ -563,23 +563,23 @@ void CPPTElement::SetUpProperty(CElementPtr pElement, CTheme* pTheme, CSlideInfo
// line --------------------------------------------------------
case lineBoolean: //Line Style Boolean Properties
{
bool bNoLineDrawDash = GETBIT(pProperty->m_lValue, 0);
bool bLineFillShape = GETBIT(pProperty->m_lValue, 1);
bool bHitTestLine = GETBIT(pProperty->m_lValue, 2);
bool bLine = GETBIT(pProperty->m_lValue, 3);
bool bArrowheadsOK = GETBIT(pProperty->m_lValue, 4);
bool bInsetPenOK = GETBIT(pProperty->m_lValue, 5);
bool bInsetPen = GETBIT(pProperty->m_lValue, 6);
bool bLineOpaqueBackColor = GETBIT(pProperty->m_lValue, 9);
bool bUsefNoLineDrawDash = GETBIT(pProperty->m_lValue, 16);
bool bUsefLineFillShape = GETBIT(pProperty->m_lValue, 17);
bool bUsefHitTestLine = GETBIT(pProperty->m_lValue, 18);
bool bUsefLine = GETBIT(pProperty->m_lValue, 19);
bool bUsefArrowheadsOK = GETBIT(pProperty->m_lValue, 20);
bool bUsefInsetPenOK = GETBIT(pProperty->m_lValue, 21);
bool bUsefInsetPen = GETBIT(pProperty->m_lValue, 22);
bool bUsefLineOpaqueBackColor = GETBIT(pProperty->m_lValue, 25);
bool bUsefInsetPen = GETBIT(pProperty->m_lValue, 22);
bool bUsefInsetPenOK = GETBIT(pProperty->m_lValue, 21);
bool bUsefArrowheadsOK = GETBIT(pProperty->m_lValue, 20);
bool bUsefLine = GETBIT(pProperty->m_lValue, 19);
bool bUsefHitTestLine = GETBIT(pProperty->m_lValue, 18);
bool bUsefLineFillShape = GETBIT(pProperty->m_lValue, 17);
bool bUsefNoLineDrawDash = GETBIT(pProperty->m_lValue, 16);
bool bLineOpaqueBackColor = GETBIT(pProperty->m_lValue, 9);
bool bInsetPen = GETBIT(pProperty->m_lValue, 6);
bool bInsetPenOK = GETBIT(pProperty->m_lValue, 5);
bool bArrowheadsOK = GETBIT(pProperty->m_lValue, 4);
bool bLine = GETBIT(pProperty->m_lValue, 3);
bool bHitTestLine = GETBIT(pProperty->m_lValue, 2);
bool bLineFillShape = GETBIT(pProperty->m_lValue, 1);
bool bNoLineDrawDash = GETBIT(pProperty->m_lValue, 0);
if (bUsefLine)
pElement->m_bLine = bLine;
@ -738,41 +738,63 @@ void CPPTElement::SetUpProperty(CElementPtr pElement, CTheme* pTheme, CSlideInfo
pElement->m_oShadow.Visible = fshadowObscured;
}
}break;
case shapeBoolean:
{
bool fUsefPolicyLabel = GETBIT(pProperty->m_lValue, 25);
bool fUsefPolicyBarcode = GETBIT(pProperty->m_lValue, 24);
bool fUsefFlipHOverride = GETBIT(pProperty->m_lValue, 23);
bool fUsefFlipVOverride = GETBIT(pProperty->m_lValue, 22);
bool fUsefOleIcon = GETBIT(pProperty->m_lValue, 21);
bool fUsefPreferRelativeResize = GETBIT(pProperty->m_lValue, 20);
bool fUsefLockShapeType = GETBIT(pProperty->m_lValue, 19);
bool fUsefInitiator = GETBIT(pProperty->m_lValue, 18);
bool fUsefBackground = GETBIT(pProperty->m_lValue, 16);
bool fPolicyLabel = fUsefPolicyLabel ? GETBIT(pProperty->m_lValue, 9) : false;
bool fPolicyBarcode = fUsefPolicyBarcode ? GETBIT(pProperty->m_lValue, 8) : false;
bool fFlipHOverride = fUsefFlipHOverride ? GETBIT(pProperty->m_lValue, 7) : false;
bool fFlipVOverride = fUsefFlipVOverride ? GETBIT(pProperty->m_lValue, 6) : false;
bool fOleIcon = fUsefOleIcon ? GETBIT(pProperty->m_lValue, 5) : false;
bool fPreferRelativeResize = fUsefPreferRelativeResize ? GETBIT(pProperty->m_lValue, 4) : false;
bool fLockShapeType = fUsefLockShapeType ? GETBIT(pProperty->m_lValue, 3) : false;
bool fInitiator = fUsefInitiator ? GETBIT(pProperty->m_lValue, 2) : false;
bool fBackground = fUsefBackground ? GETBIT(pProperty->m_lValue, 0) : false;
}break;
case groupShapeBoolean:
{
bool fUsefLayoutInCell = GETBIT(pProperty->m_lValue, 0);
bool fUsefIsBullet = GETBIT(pProperty->m_lValue, 1);
bool fUsefStandardHR = GETBIT(pProperty->m_lValue, 2);
bool fUsefNoshadeHR = GETBIT(pProperty->m_lValue, 3);
bool fUsefHorizRule = GETBIT(pProperty->m_lValue, 4);
bool fUsefUserDrawn = GETBIT(pProperty->m_lValue, 5);
bool fUsefAllowOverlap = GETBIT(pProperty->m_lValue, 6);
bool fUsefReallyHidden = GETBIT(pProperty->m_lValue, 7);
bool fUsefScriptAnchor = GETBIT(pProperty->m_lValue, 8);
bool fUsefEditedWrap = GETBIT(pProperty->m_lValue, 9);
bool fUsefBehindDocument = GETBIT(pProperty->m_lValue, 10);
bool fUsefOnDblClickNotify = GETBIT(pProperty->m_lValue, 11);
bool fUsefIsButton = GETBIT(pProperty->m_lValue, 12);
bool fUsefOneD = GETBIT(pProperty->m_lValue, 13);
bool fUsefHidden = GETBIT(pProperty->m_lValue, 14);
bool fUsefPrint = GETBIT(pProperty->m_lValue, 15);
bool fUsefLayoutInCell = GETBIT(pProperty->m_lValue, 31);
bool fUsefIsBullet = GETBIT(pProperty->m_lValue, 30);
bool fUsefStandardHR = GETBIT(pProperty->m_lValue, 29);
bool fUsefNoshadeHR = GETBIT(pProperty->m_lValue, 28);
bool fUsefHorizRule = GETBIT(pProperty->m_lValue, 27);
bool fUsefUserDrawn = GETBIT(pProperty->m_lValue, 26);
bool fUsefAllowOverlap = GETBIT(pProperty->m_lValue, 25);
bool fUsefReallyHidden = GETBIT(pProperty->m_lValue, 24);
bool fUsefScriptAnchor = GETBIT(pProperty->m_lValue, 23);
bool fUsefEditedWrap = GETBIT(pProperty->m_lValue, 22);
bool fUsefBehindDocument = GETBIT(pProperty->m_lValue, 21);
bool fUsefOnDblClickNotify = GETBIT(pProperty->m_lValue, 20);
bool fUsefIsButton = GETBIT(pProperty->m_lValue, 19);
bool fUsefOneD = GETBIT(pProperty->m_lValue, 18);
bool fUsefHidden = GETBIT(pProperty->m_lValue, 17);
bool fUsefPrint = GETBIT(pProperty->m_lValue, 16);
bool fLayoutInCell = fUsefLayoutInCell ? GETBIT(pProperty->m_lValue, 16) : true;
bool fIsBullet = fUsefIsBullet ? GETBIT(pProperty->m_lValue, 17) : false;
bool fStandardHR = fUsefStandardHR ? GETBIT(pProperty->m_lValue, 18) : false;
bool fNoshadeHR = fUsefNoshadeHR ? GETBIT(pProperty->m_lValue, 19) : false;
bool fHorizRule = fUsefHorizRule ? GETBIT(pProperty->m_lValue, 20) : false;
bool fUserDrawn = fUsefUserDrawn ? GETBIT(pProperty->m_lValue, 21) : false;
bool fAllowOverlap = fUsefAllowOverlap ? GETBIT(pProperty->m_lValue, 22) : true;
bool fReallyHidden = fUsefReallyHidden ? GETBIT(pProperty->m_lValue, 23) : false;
bool fScriptAnchor = fUsefScriptAnchor ? GETBIT(pProperty->m_lValue, 24) : false;
bool fEditedWrap = fUsefEditedWrap ? GETBIT(pProperty->m_lValue, 25) : false;
bool fBehindDocument = fUsefBehindDocument ? GETBIT(pProperty->m_lValue, 26) : false;
bool fOnDblClickNotify = fUsefOnDblClickNotify ? GETBIT(pProperty->m_lValue, 27) : false;
bool fIsButton = fUsefIsButton ? GETBIT(pProperty->m_lValue, 28) : false;
bool fOneD = fUsefOneD ? GETBIT(pProperty->m_lValue, 29) : false;
bool fHidden = fUsefHidden ? GETBIT(pProperty->m_lValue, 30) : false;
bool fPrint = fUsefPrint ? GETBIT(pProperty->m_lValue, 31) : true;
bool fLayoutInCell = fUsefLayoutInCell ? GETBIT(pProperty->m_lValue, 15) : true;
bool fIsBullet = fUsefIsBullet ? GETBIT(pProperty->m_lValue, 14) : false;
bool fStandardHR = fUsefStandardHR ? GETBIT(pProperty->m_lValue, 13) : false;
bool fNoshadeHR = fUsefNoshadeHR ? GETBIT(pProperty->m_lValue, 12) : false;
bool fHorizRule = fUsefHorizRule ? GETBIT(pProperty->m_lValue, 11) : false;
bool fUserDrawn = fUsefUserDrawn ? GETBIT(pProperty->m_lValue, 10) : false;
bool fAllowOverlap = fUsefAllowOverlap ? GETBIT(pProperty->m_lValue, 9) : true;
bool fReallyHidden = fUsefReallyHidden ? GETBIT(pProperty->m_lValue, 8) : false;
bool fScriptAnchor = fUsefScriptAnchor ? GETBIT(pProperty->m_lValue, 7) : false;
bool fEditedWrap = fUsefEditedWrap ? GETBIT(pProperty->m_lValue, 6) : false;
bool fBehindDocument = fUsefBehindDocument ? GETBIT(pProperty->m_lValue, 5) : false;
bool fOnDblClickNotify = fUsefOnDblClickNotify ? GETBIT(pProperty->m_lValue, 4) : false;
bool fIsButton = fUsefIsButton ? GETBIT(pProperty->m_lValue, 3) : false;
bool fOneD = fUsefOneD ? GETBIT(pProperty->m_lValue, 2) : false;
bool fHidden = fUsefHidden ? GETBIT(pProperty->m_lValue, 1) : false;
bool fPrint = fUsefPrint ? GETBIT(pProperty->m_lValue, 0) : true;
pElement->m_bHidden = fHidden || fIsBullet;
//presentation_ticio_20100610.ppt
@ -1092,23 +1114,20 @@ void CPPTElement::SetUpPropertyShape(CElementPtr pElement, CTheme* pTheme, CSlid
{
case NSOfficeDrawing::alignTextLeft:
{
pParentShape->m_oText.m_oAttributes.m_nTextAlignHorizontal = 0;
break;
}
pParentShape->m_oText.m_oAttributes.m_nTextAlignHorizontal = 0;
}break;
case NSOfficeDrawing::alignTextCenter:
{
pParentShape->m_oText.m_oAttributes.m_nTextAlignHorizontal = 1;
break;
}
pParentShape->m_oText.m_oAttributes.m_nTextAlignHorizontal = 1;
}break;
case NSOfficeDrawing::alignTextRight:
{
pParentShape->m_oText.m_oAttributes.m_nTextAlignHorizontal = 2;
break;
}
pParentShape->m_oText.m_oAttributes.m_nTextAlignHorizontal = 2;
}break;
default:
{
pParentShape->m_oText.m_oAttributes.m_nTextAlignHorizontal = 1;
}
}break;
};
break;
}
@ -1211,9 +1230,239 @@ void CPPTElement::SetUpPropertyShape(CElementPtr pElement, CTheme* pTheme, CSlid
pParentShape->m_oText.m_bAutoFit = bFitShapeToText;
}break;
case NSOfficeDrawing::c3DSpecularAmt:
{
pShape->m_o3dOptions.dSpecularAmt = FixedPointToDouble(pProperty->m_lValue);
}break;
case NSOfficeDrawing::c3DDiffuseAmt:
{
pShape->m_o3dOptions.dDiffuseAmt = FixedPointToDouble(pProperty->m_lValue);
}break;
case NSOfficeDrawing::c3DShininess:
{
pShape->m_o3dOptions.dShininess = FixedPointToDouble(pProperty->m_lValue);
}break;
case NSOfficeDrawing::c3DEdgeThickness:
{
pShape->m_o3dOptions.nEdgeThickness = pProperty->m_lValue;
}break;
case NSOfficeDrawing::C3DExtrudeForward:
{
pShape->m_o3dOptions.nExtrudeForward = pProperty->m_lValue;
}break;
case NSOfficeDrawing::c3DExtrudeBackward:
{
pShape->m_o3dOptions.nExtrudeBackward = pProperty->m_lValue;
}break;
case NSOfficeDrawing::c3DExtrudePlane:
{
//ExtrudePlane = 0;
}break;
case NSOfficeDrawing::c3DExtrusionColor:
{
SColorAtom oAtom;
oAtom.FromValue(pProperty->m_lValue);
CColor tmp;
if(oAtom.bSysIndex) tmp = CorrectSysColor(pProperty->m_lValue, pElement, pTheme);
else oAtom.ToColor(&tmp);
pShape->m_o3dOptions.oExtrusionColor = tmp;
}break;
case NSOfficeDrawing::c3DCrMod:
{
SColorAtom oAtom;
oAtom.FromValue(pProperty->m_lValue);
CColor tmp;
if(oAtom.bSysIndex) tmp = CorrectSysColor(pProperty->m_lValue, pElement, pTheme);
else oAtom.ToColor(&tmp);
pShape->m_o3dOptions.oCrMod = tmp;
}break;
case NSOfficeDrawing::c3DExtrusionColorExt:
{
SColorAtom oAtom;
oAtom.FromValue(pProperty->m_lValue);
CColor tmp;
if(oAtom.bSysIndex) tmp = CorrectSysColor(pProperty->m_lValue, pElement, pTheme);
else oAtom.ToColor(&tmp);
pShape->m_o3dOptions.oExtrusionColorExt = tmp;
}break;
case NSOfficeDrawing::c3DExtrusionColorExtMod:
{
pShape->m_o3dOptions.nTypeExtrusionColorExt = (pProperty->m_lValue & 0x00000300) >> 8;
}break;
case NSOfficeDrawing::c3DBottomBevelWidth:
{
pShape->m_o3dOptions.dBottomBevelWidth = FixedPointToDouble(pProperty->m_lValue);
}break;
case NSOfficeDrawing::c3DBottomBevelHeight:
{
pShape->m_o3dOptions.dBottomBevelHeight = FixedPointToDouble(pProperty->m_lValue);
}break;
case NSOfficeDrawing::c3DBottomBevelType:
{
pShape->m_o3dOptions.nBottomBevelType = pProperty->m_lValue;
}break;
case NSOfficeDrawing::c3DTopBevelWidth:
{
pShape->m_o3dOptions.dTopBevelWidth = FixedPointToDouble(pProperty->m_lValue);
}break;
case NSOfficeDrawing::c3DTopBevelHeight:
{
pShape->m_o3dOptions.dTopBevelHeight = FixedPointToDouble(pProperty->m_lValue);
}break;
case NSOfficeDrawing::c3DTopBevelType:
{
pShape->m_o3dOptions.nTopBevelType = pProperty->m_lValue;
}break;
case NSOfficeDrawing::c3DBoolean:
{
bool fUsef3D = GETBIT(pProperty->m_lValue, 19);
bool fUsefc3DMetallic = GETBIT(pProperty->m_lValue, 18);
bool fUsefc3DUseExtrusionColor = GETBIT(pProperty->m_lValue, 17);
bool fUsefc3DLightFace = GETBIT(pProperty->m_lValue, 16);
pShape->m_o3dOptions.bEnabled = fUsef3D ? GETBIT(pProperty->m_lValue, 3) : false;
pShape->m_o3dOptions.bMetallic = fUsefc3DMetallic ? GETBIT(pProperty->m_lValue, 2) : false;
pShape->m_o3dOptions.bExtrusionColor= fUsefc3DUseExtrusionColor ? GETBIT(pProperty->m_lValue, 1) : false;
pShape->m_o3dOptions.bLightFace = fUsefc3DLightFace ? GETBIT(pProperty->m_lValue, 0) : true;
}break;
case NSOfficeDrawing::c3DYRotationAngle:
{
double val = FixedPointToDouble(pProperty->m_lValue);
if (val < 0) val += 360;
pShape->m_o3dOptions.dYRotationAngle = val;
}break;
case NSOfficeDrawing::c3DXRotationAngle:
{
double val = FixedPointToDouble(pProperty->m_lValue);
if (val < 0) val += 360;
pShape->m_o3dOptions.dXRotationAngle = val;
}break;
case NSOfficeDrawing::c3DRotationAxisX:
{
pShape->m_o3dOptions.dRotationAxisX = FixedPointToDouble(pProperty->m_lValue);
}break;
case NSOfficeDrawing::c3DRotationAxisY:
{
pShape->m_o3dOptions.dRotationAxisY = FixedPointToDouble(pProperty->m_lValue);
}break;
case NSOfficeDrawing::c3DRotationAxisZ:
{
pShape->m_o3dOptions.dRotationAxisZ = FixedPointToDouble(pProperty->m_lValue);
}break;
case NSOfficeDrawing::c3DRotationAngle:
{
pShape->m_o3dOptions.dRotationAngle = FixedPointToDouble(pProperty->m_lValue);
}break;
case NSOfficeDrawing::c3DRotationCenterX:
{
pShape->m_o3dOptions.dRotationCenterX = FixedPointToDouble(pProperty->m_lValue);
}break;
case NSOfficeDrawing::c3DRotationCenterY:
{
pShape->m_o3dOptions.dRotationCenterY = FixedPointToDouble(pProperty->m_lValue);
}break;
case NSOfficeDrawing::c3DRotationCenterZ:
{
pShape->m_o3dOptions.dRotationCenterZ = FixedPointToDouble(pProperty->m_lValue);
}break;
case NSOfficeDrawing::c3DRenderMode:
{
pShape->m_o3dOptions.nRenderMode = pProperty->m_lValue;
}break;
case NSOfficeDrawing::c3DTolerance:
{
pShape->m_o3dOptions.dTolerance = FixedPointToDouble(pProperty->m_lValue);
}break;
case NSOfficeDrawing::c3DXViewpoint:
{
pShape->m_o3dOptions.dXViewpoint = FixedPointToDouble(pProperty->m_lValue);
}break;
case NSOfficeDrawing::c3DYViewpoint:
{
pShape->m_o3dOptions.dYViewpoint = FixedPointToDouble(pProperty->m_lValue);
}break;
case NSOfficeDrawing::c3DZViewpoint:
{
pShape->m_o3dOptions.dZViewpoint = FixedPointToDouble(pProperty->m_lValue);
}break;
case NSOfficeDrawing::c3DOriginX:
{
pShape->m_o3dOptions.dOriginX = FixedPointToDouble(pProperty->m_lValue);
}break;
case NSOfficeDrawing::c3DOriginY:
{
pShape->m_o3dOptions.dOriginY = FixedPointToDouble(pProperty->m_lValue);
}break;
case NSOfficeDrawing::c3DSkewAngle:
{
double val = FixedPointToDouble(pProperty->m_lValue);
if (val <= 0) val += 360;
pShape->m_o3dOptions.dSkewAngle = val;
}break;
case NSOfficeDrawing::c3DSkewAmount:
{
pShape->m_o3dOptions.nSkewAmount = pProperty->m_lValue;
}break;
case NSOfficeDrawing::c3DAmbientIntensity:
{
pShape->m_o3dOptions.dAmbientIntensity = FixedPointToDouble(pProperty->m_lValue);
}break;
case NSOfficeDrawing::c3DKeyX:
{
pShape->m_o3dOptions.dKeyX = FixedPointToDouble(pProperty->m_lValue);
}break;
case NSOfficeDrawing::c3DKeyY:
{
pShape->m_o3dOptions.dKeyY = FixedPointToDouble(pProperty->m_lValue);
}break;
case NSOfficeDrawing::c3DKeyZ:
{
pShape->m_o3dOptions.dKeyZ = FixedPointToDouble(pProperty->m_lValue);
}break;
case NSOfficeDrawing::c3DKeyIntensity:
{
pShape->m_o3dOptions.dKeyIntensity = FixedPointToDouble(pProperty->m_lValue);
}break;
case NSOfficeDrawing::c3DFillX:
{
pShape->m_o3dOptions.dFillX = FixedPointToDouble(pProperty->m_lValue);
}break;
case NSOfficeDrawing::c3DFillY:
{
pShape->m_o3dOptions.dFillY = FixedPointToDouble(pProperty->m_lValue);
}break;
case NSOfficeDrawing::c3DFillZ:
{
pShape->m_o3dOptions.dFillZ = FixedPointToDouble(pProperty->m_lValue);
}break;
case NSOfficeDrawing::c3DFillIntensity:
{
pShape->m_o3dOptions.dFillIntensity = FixedPointToDouble(pProperty->m_lValue);
}break;
case NSOfficeDrawing::c3DStyleBoolean:
{
bool fUsefc3DConstrainRotation = GETBIT(pProperty->m_lValue, 20);
bool fUsefc3DRotationCenterAuto = GETBIT(pProperty->m_lValue, 19);
bool fUsefc3DParallel = GETBIT(pProperty->m_lValue, 18);
bool fUsefc3DKeyHarsh = GETBIT(pProperty->m_lValue, 17);
bool fUsefc3DFillHarsh = GETBIT(pProperty->m_lValue, 16);
pShape->m_o3dOptions.bConstrainRotation = fUsefc3DConstrainRotation ? GETBIT(pProperty->m_lValue, 4) : true;
pShape->m_o3dOptions.bRotationCenterAuto= fUsefc3DRotationCenterAuto? GETBIT(pProperty->m_lValue, 3) : false;
pShape->m_o3dOptions.bParallel = fUsefc3DParallel ? GETBIT(pProperty->m_lValue, 2) : true;
pShape->m_o3dOptions.bKeyHarsh = fUsefc3DKeyHarsh ? GETBIT(pProperty->m_lValue, 1) : true;
pShape->m_o3dOptions.bFillHarsh = fUsefc3DFillHarsh ? GETBIT(pProperty->m_lValue, 0) : true;
}break;
default:
{
int unknown_value = pProperty->m_lValue;
unknown_value = unknown_value;
}break;
}
}
@ -2203,7 +2452,7 @@ void CRecordShapeContainer::SetUpTextStyle(std::wstring& strText, CTheme* pTheme
pShape->m_pShape->m_oText.m_oAttributes.m_oTextBrush = pShape->m_oBrush;
pShape->m_pShape->m_oText.m_oAttributes.m_nTextAlignHorizontal = 1;
pShape->m_pShape->m_oText.m_oAttributes.m_nTextAlignVertical = 1;
pShape->m_pShape->m_oText.m_oAttributes.m_nTextAlignVertical = 1;
pShape->m_pShape->m_lDrawType = c_ShapeDrawType_Text;
break;

View File

@ -63,14 +63,6 @@ using namespace NSPresentationEditor;
class CPPTElement
{
public:
inline double FixedPointToDouble(unsigned int op)
{
short Integral = op >> 16;
unsigned short Fractional = op - (Integral << 16);
return Integral + (Fractional / 65536.0);
}
bool ChangeBlack2ColorImage(std::wstring image_path, int rgbColor1, int rgbColor2);
CColor CorrectSysColor(int nColorCode, CElementPtr pElement, CTheme* pTheme);

View File

@ -735,7 +735,7 @@ namespace NSPresentationEditor
void SetDefaultParams()
{
Type = c_BrushTypeNoFill;
Type = c_BrushTypeNotSet;
Color1 = 0xFFFFFFFF;
Alpha1 = 255;

View File

@ -1239,19 +1239,24 @@ namespace NSOfficeDrawing
perspectiveBoolean=639,
//3D Object
c3DSpecularAmt=640,
c3DDiffuseAmt=641,
c3DShininess=642,
c3DEdgeThickness=643,
C3DExtrudeForward=644,
c3DExtrudeBackward=645,
c3DExtrudePlane=646,
c3DExtrusionColor=647,
c3DCrMod=648,
f3D=700,
fc3DMetallic=701,
fc3DUseExtrusionColor=702,
fc3DLightFace=703,
c3DSpecularAmt = 640,
c3DDiffuseAmt = 641,
c3DShininess = 642,
c3DEdgeThickness = 643,
C3DExtrudeForward = 644,
c3DExtrudeBackward = 645,
c3DExtrudePlane = 646,
c3DExtrusionColor = 647,
c3DCrMod = 648,
c3DExtrusionColorExt = 649,
c3DExtrusionColorExtMod = 651,
c3DBottomBevelWidth = 661,
c3DBottomBevelHeight = 662,
c3DBottomBevelType = 663,
c3DTopBevelWidth = 664,
c3DTopBevelHeight = 665,
c3DTopBevelType = 666,
c3DBoolean = 703,
//3D Style
c3DYRotationAngle=704,
@ -1280,52 +1285,34 @@ namespace NSOfficeDrawing
c3DFillX=727,
c3DFillY=728,
c3DFillZ=729,
c3DFillIntensity=730,
fc3DConstrainRotation=763,
fc3DRotationCenterAuto=764,
fc3DParallel=765,
fc3DKeyHarsh=766,
fc3DFillHarsh=767,
c3DFillIntensity = 730,
c3DStyleBoolean = 767,
//Shape
hspMaster=769,
cxstyle=771,
bWMode=772,
bWModePureBW=773,
bWModeBW=774,
idDiscussAnchor=775,
dgmLayout=777,
dgmNodeKind=778,
dgmLayoutMRU=779,
wzEquationXML=780,
fPolicyLabel=822,
fPolicyBarcode=823,
fFlipHQFE5152=824,
fFlipVQFE5152=825,
fPreferRelativeResize=827,
fLockShapeType=828,
fInitiator=829,
fDeleteAttachedObject=830,
fBackground=831,
hspMaster = 769,
cxstyle = 771,
bWMode = 772,
bWModePureBW = 773,
bWModeBW = 774,
idDiscussAnchor = 775,
dgmLayout = 777,
dgmNodeKind = 778,
dgmLayoutMRU = 779,
wzEquationXML = 780,
shapeBoolean = 831,
//Callout
spcot=832,
dxyCalloutGap=833,
spcoa=834,
spcod=835,
dxyCalloutDropSpecified=836,
dxyCalloutLengthSpecified=837,
fCallout=889,
fCalloutAccentBar=890,
fCalloutTextBorder=891,
fCalloutMinusX=892,
fCalloutMinusY=893,
fCalloutDropAuto=894,
fCalloutLengthSpecified=895,
spcot = 832,
dxyCalloutGap = 833,
spcoa = 834,
spcod = 835,
dxyCalloutDropSpecified = 836,
dxyCalloutLengthSpecified = 837,
calloutBoolean = 895,
//Groupe Shape
wzName=896,
wzDescription=897,
wzName = 896,
wzDescription = 897,
pihlShape=898,
pWrapPolygonVertices=899,
dxWrapDistLeft=900,
@ -1363,9 +1350,9 @@ namespace NSOfficeDrawing
wzWebBot=933,
wzAppletArg=934,
wzAccessBlob=936,
metroBlob=937,
dhgt=938,
groupShapeBoolean=959,
metroBlob = 937,
dhgt = 938,
groupShapeBoolean = 959,
//Unknown HTML
wzLineId=1026,

View File

@ -38,15 +38,110 @@
using namespace NSOfficeDrawing;
using namespace NSPresentationEditor;
static double FixedPointToDouble(unsigned int op)
{
short Integral = op >> 16;
unsigned short Fractional = op - (Integral << 16);
return Integral + (Fractional / 65536.0);
}
namespace PPTShapes
{
struct _3dOptions
{
_3dOptions() : bEnabled(false), bMetallic(false), bExtrusionColor(false), bLightFace(true),
bConstrainRotation(true), bRotationCenterAuto(false), bParallel(true), bFillHarsh(true), bKeyHarsh(true),
nRenderMode(0), dSpecularAmt(0), nEdgeThickness(0x0000319C), nExtrudeForward(0), nExtrudeBackward(0x0006F9F0),
nSkewAmount(0x32)
{
dFillIntensity = FixedPointToDouble(0x00009470);
dKeyX = FixedPointToDouble(0x0000C350);
dKeyY = FixedPointToDouble(0x00000000);
dFillX = FixedPointToDouble(0xFFFF3CB0);
dFillY = FixedPointToDouble(0x00000000);
dOriginX = FixedPointToDouble(0x00008000);
dOriginY = FixedPointToDouble(0xFFFF8000);
dSkewAngle = 225;//FixedPointToDouble(0xFF790000);
dXViewpoint = FixedPointToDouble(0x001312D0);
dYViewpoint = FixedPointToDouble(0xFFECED30);
}
bool bEnabled;
bool bMetallic;
bool bExtrusionColor;
bool bLightFace;
bool bConstrainRotation;
bool bRotationCenterAuto;
bool bParallel;
bool bKeyHarsh;
bool bFillHarsh;
boost::optional<double> dSpecularAmt;
boost::optional<double> dDiffuseAmt;
boost::optional<double> dShininess;
_INT32 nEdgeThickness;
_INT32 nExtrudeForward;
_INT32 nExtrudeBackward;
boost::optional<double> dBottomBevelWidth;
boost::optional<double> dBottomBevelHeight;
boost::optional<_INT32> nBottomBevelType;
boost::optional<double> dTopBevelWidth;
boost::optional<double> dTopBevelHeight;
boost::optional<_INT32> nTopBevelType;
boost::optional<double> dXRotationAngle;
boost::optional<double> dYRotationAngle;
boost::optional<double> dRotationAxisX;
boost::optional<double> dRotationAxisY;
boost::optional<double> dRotationAxisZ;
boost::optional<double> dRotationAngle;
boost::optional<double> dRotationCenterX;
boost::optional<double> dRotationCenterY;
boost::optional<double> dRotationCenterZ;
boost::optional<double> dTolerance;
double dXViewpoint;
double dYViewpoint;
boost::optional<double> dZViewpoint;
boost::optional<CColor> oExtrusionColor;
boost::optional<CColor> oCrMod;
boost::optional<CColor> oExtrusionColorExt;
boost::optional<_INT32> nTypeExtrusionColorExt;
_INT32 nRenderMode;
double dOriginX;
double dOriginY;
double dSkewAngle;
_INT32 nSkewAmount;
boost::optional<double> dAmbientIntensity;
boost::optional<double> dKeyIntensity;
double dKeyX;
double dKeyY;
double dFillIntensity;
double dFillX;
double dFillY;
boost::optional<double> dKeyZ;
boost::optional<double> dFillZ;
};
}
class CPPTShape : public CBaseShape
{
public:
PPTShapes::ShapeType m_eType;
PPTShapes::ShapeType m_eType;
NSGuidesVML::CFormulasManager m_oManager;
NSCustomVML::CCustomVML m_oCustomVML;
NSCustomVML::CCustomVML m_oCustomVML;
PPTShapes::_3dOptions m_o3dOptions;
std::wstring m_strPathLimoX;
std::wstring m_strPathLimoX;
std::wstring m_strPathLimoY;
std::vector<std::wstring> m_arStringTextRects;
@ -54,6 +149,7 @@ public:
bool m_bIsFilled;
bool m_bIsStroked;
nullable<OOX::VmlOffice::CSignatureLine> m_oSignatureLine;
CPPTShape();

View File

@ -278,6 +278,9 @@ namespace NSPresentationEditor
{
m_oStyles.m_pLevels[i] = pTheme->m_pStyles[0].m_pLevels[i];
}
if (m_oStyles.m_pLevels[i].is_init() == false) continue;
if (m_oRuler.tabsStops.size() > 0)
{
m_oStyles.m_pLevels[i]->m_oPFRun.tabStops = m_oRuler.tabsStops;

View File

@ -612,7 +612,7 @@ namespace PPTX
spPr.Geometry.ConvertToCustomVML(pWriter->m_pOOXToVMLRenderer, strPath, strTextRect, lW, lH);
std::wstring strId = L"shape " + std::to_wstring(pWriter->m_lObjectIdVML);
std::wstring strSpid = L"_x0000_s" + XmlUtils::IntToString(0xFFFF & (pWriter->m_lObjectIdVML >> 16), L"%04d");
std::wstring strSpid = L"_x0000_s" + std::to_wstring(pWriter->m_lObjectIdVML);
pWriter->m_lObjectIdVML++;

View File

@ -1 +1 @@
2.5.556.0
2.5.562.0

View File

@ -2390,6 +2390,39 @@ namespace NSEditorApi
};
}
namespace NSEditorApi
{
class CAscMath : public IMenuEventDataBase
{
private:
js_wrapper<int> m_nType;
js_wrapper<int> m_nAction;
js_wrapper<bool> m_bCanIncreaseArgumentSize;
js_wrapper<bool> m_bCanDecreaseArgumentSize;
js_wrapper<bool> m_bCanInsertForcedBreak;
js_wrapper<bool> m_bCanDeleteForcedBreak;
js_wrapper<bool> m_bCanAlignToCharacter;
public:
CAscMath()
{
}
virtual ~CAscMath()
{
}
LINK_PROPERTY_INT_JS(Type)
LINK_PROPERTY_INT_JS(Action)
LINK_PROPERTY_BOOL_JS(CanIncreaseArgumentSize)
LINK_PROPERTY_BOOL_JS(CanDecreaseArgumentSize);
LINK_PROPERTY_BOOL_JS(CanInsertForcedBreak);
LINK_PROPERTY_BOOL_JS(CanDeleteForcedBreak);
LINK_PROPERTY_BOOL_JS(CanAlignToCharacter);
};
}
namespace NSEditorApi
{
class CAscMenuEvent : public IMenuEventDataBase

View File

@ -491,6 +491,7 @@
#define c_oAscTypeSelectElement_Shape 6
#define c_oAscTypeSelectElement_Slide 7
#define c_oAscTypeSelectElement_Chart 8
#define c_oAscTypeSelectElement_Math 9
#define c_oAscTableBordersType_LEFT 0
#define c_oAscTableBordersType_TOP 1
@ -695,6 +696,7 @@
#define ASC_MENU_EVENT_TYPE_SHAPE 18
#define ASC_MENU_EVENT_TYPE_SLIDE 20
#define ASC_MENU_EVENT_TYPE_CHART 21
#define ASC_MENU_EVENT_TYPE_MATH 22
// insert commands
#define ASC_MENU_EVENT_TYPE_INSERT_IMAGE 50

View File

@ -97,6 +97,7 @@ const long c_BrushTypePattern = 3009;
const long c_BrushTypeHatch1 = 4009;
const long c_BrushTypeHatch53 = 4061;
const long c_BrushTypeNoFill = 5000;
const long c_BrushTypeNotSet = 5001;
const long c_BrushTextureModeStretch = 0;
const long c_BrushTextureModeTile = 1;

View File

@ -224,12 +224,21 @@ ARTIFACTS += Common/3dParty/*/$(TARGET)/build/*
ifeq ($(OS),Windows_NT)
ARTIFACTS += Common/3dParty/v8/v8/out.gn/$(TARGET)/release/*.dat
ARTIFACTS += Common/3dParty/v8/v8/out.gn/$(TARGET)/release/obj/*
else
ARTIFACTS += Common/3dParty/v8/v8/out.gn/$(TARGET)/*.dat
ARTIFACTS += Common/3dParty/v8/v8/out.gn/$(TARGET)/obj/*
endif
CORE_TARGET += $(ALLFONTSGEN)
CORE_TARGET += $(DOCTRENDERER)
CORE_TARGET += $(DJVUFILE)
CORE_TARGET += $(HTMLFILE)
CORE_TARGET += $(HTMLRENDERER)
CORE_TARGET += $(PDFREADER)
CORE_TARGET += $(PDFWRITER)
CORE_TARGET += $(UNICODECONVERTER)
CORE_TARGET += $(X2T)
CORE_TARGET += $(XPSFILE)
EXT_TARGET += $(DOCBUILDER)
ifneq ($(PLATFORM),mac)
@ -248,14 +257,10 @@ $$(value $(1)): $$(value $(1)_MAKE)
cd $$(dir $$(value $(1)_MAKE)) && $(MAKE);
endef
.PHONY : all bin lib clean deploy
.PHONY : all clean deploy
.NOTPARALLEL:
all: lib bin
bin: $(X2T) $(ALLFONTSGEN)
lib: $(PDFWRITER) $(DOCTRENDERER) $(HTMLRENDERER) $(PDFREADER) $(DJVUFILE) $(XPSFILE) $(HTMLFILE) $(UNICODECONVERTER)
all: $(CORE_TARGET)
ext: $(EXT_TARGET)

View File

@ -29,13 +29,8 @@ core_windows {
QMAKE_CXXFLAGS += -Wall -Wno-ignored-qualifiers
}
#CONFIG += build_for_centos6
build_for_centos6 {
core_linux_64 {
QMAKE_LFLAGS += -Wl,--dynamic-linker=./ld-linux-x86-64.so.2
} else {
QMAKE_LFLAGS += -Wl,--dynamic-linker=./ld-linux.so.2
}
core_linux {
QMAKE_LFLAGS += -Wl,--rpath=./:./system
}
DEFINES += UNICODE \

View File

@ -1,11 +1,11 @@
# README #
Android x2t app example.
Android x2t app example. 3d party build under linux only!
For run app you must:
1) Download all 3party libraries from folder ../core/Common/3dParty
2) Once! Run gradle task preBuildTask().
That task download last NDK 17c with deprecated GCC.
That task download last NDK 17c with deprecated GCC (GCC needed only for openssl).
Build all 3d party dependencies with that NDK
3) Build app
3) Build tests

View File

@ -23,9 +23,9 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:3.2.0'
classpath 'io.fabric.tools:gradle:1.25.1'
classpath 'io.fabric.tools:gradle:1.25.4'
classpath 'de.undercouch:gradle-download-task:3.4.3'
}
}

View File

@ -59,7 +59,7 @@ def BOOST_LIBS_INSTALL = "$BOOST_LIBS_PATH/install"
android {
buildToolsVersion '27.0.3'
buildToolsVersion '28.0.3'
compileSdkVersion 28
defaultConfig {

View File

@ -28,6 +28,6 @@ target_link_libraries(${LIB_NAME_CRYPTO_READER}
# Add include files .h
target_include_directories(${LIB_NAME_CRYPTO_READER}
PUBLIC
PRIVATE
${CRYPTO_READER_DIR}source/
)

View File

@ -22,7 +22,7 @@ add_library(${LIB_NAME_DOCX_RENDER} STATIC ${DOCX_RENDER_CPP})
# Add include files .h
target_include_directories(${LIB_NAME_DOCX_RENDER}
PUBLIC
PRIVATE
${DOCX_RENDER_DIR}
${DOCX_RENDER_DIR}src/logic/
)

View File

@ -32,6 +32,6 @@ target_link_libraries(${LIB_NAME_DOWNLOADER}
# Add include files .h
target_include_directories(${LIB_NAME_DOWNLOADER}
PUBLIC
PRIVATE
${DOWNLOADER_DIR}
)

View File

@ -32,10 +32,9 @@ add_library(${LIB_NAME_OFFICE_UTILS} STATIC ${OFFICE_UTILS_CPP})
# Add include files .h
target_include_directories(${LIB_NAME_OFFICE_UTILS}
PUBLIC
PRIVATE
${OFFICE_UTILS_DIR}
${OFFICE_UTILS_DIR}${ZLIB_NAME}/
PRIVATE
${OFFICE_UTILS_DIR}${ZLIB_NAME}/contrib/minizip/
)

View File

@ -20,6 +20,6 @@ add_library(${LIB_NAME_POLE} STATIC ${POLE_CPP})
# Add include files .h
target_include_directories(${LIB_NAME_POLE}
PUBLIC
PRIVATE
${POLE_DIR}
)

View File

@ -19,11 +19,14 @@ file(GLOB UNICODE_CONVERTER_CPP ${UNICODE_CONVERTER_DIR}*.cpp)
add_library(${LIB_NAME_UNICODE_CONVERTER} STATIC ${UNICODE_CONVERTER_CPP})
# Add include files .h
target_include_directories(${LIB_NAME_UNICODE_CONVERTER} PUBLIC ${UNICODE_CONVERTER_DIR})
target_include_directories(${LIB_NAME_UNICODE_CONVERTER}
PRIVATE
${UNICODE_CONVERTER_DIR}
)
# Add dependency library
target_link_libraries(${LIB_NAME_UNICODE_CONVERTER}
PUBLIC
PRIVATE
${LIB_NAME_ICU_UC}
${LIB_NAME_ICU_DATA}
${LIB_NAME_ICU_i18n}

View File

@ -1,48 +0,0 @@
cmake_minimum_required(VERSION 3.4.1)
set(CMAKE_VERBOSE_MAKEFILE on)
# Lib src path
if (NOT DEFINED UNICODE_CONVERTER_DIR)
message(FATAL_ERROR "You must set path in \"UNICODE_CONVERTER_DIR\"!")
endif()
# Lib name
if (NOT DEFINED LIB_NAME_UNICODE_CONVERTER)
message(FATAL_ERROR "You must set library name in \"LIB_NAME_UNICODE_CONVERTER\"!")
endif()
# Library source .h .cpp
file(GLOB UNICODE_CONVERTER_CPP ${UNICODE_CONVERTER_DIR}*.cpp)
file(GLOB_RECURSE UNICODE_CONVERTER_ICU_CPP
${UNICODE_CONVERTER_DIR}icubuilds-mac/icu/icu/*.c
${UNICODE_CONVERTER_DIR}icubuilds-mac/icu/icu/*.cpp)
# Concatenate with freetype resource
set(UNICODE_CONVERTER_CPP ${UNICODE_CONVERTER_CPP} ${UNICODE_CONVERTER_ICU_CPP})
# Set targer as static library
add_library(${LIB_NAME_UNICODE_CONVERTER} STATIC ${UNICODE_CONVERTER_CPP})
# Add include files .h
target_include_directories(${LIB_NAME_UNICODE_CONVERTER}
PUBLIC
${UNICODE_CONVERTER_DIR}
PRIVATE
${UNICODE_CONVERTER_DIR}icubuilds-mac/icu/
${UNICODE_CONVERTER_DIR}icubuilds-mac/icu/unicode/
${UNICODE_CONVERTER_DIR}icubuilds-mac/icu/icu/common/
${UNICODE_CONVERTER_DIR}icubuilds-mac/icu/icu/i18n/
${UNICODE_CONVERTER_DIR}icubuilds-mac/icu/icu/io/
${UNICODE_CONVERTER_DIR}icubuilds-mac/icu/icu/layout/
${UNICODE_CONVERTER_DIR}icubuilds-mac/icu/icu/stubdata/
)
# Set target definition
target_compile_definitions(${LIB_NAME_UNICODE_CONVERTER}
PRIVATE
UNICODECONVERTER_USE_DYNAMIC_LIBRARY
U_COMMON_IMPLEMENTATION
U_I18N_IMPLEMENTATION
U_IO_IMPLEMENTATION
)

View File

@ -24,13 +24,13 @@ add_library(${LIB_NAME_XLSX_SERIALIZE} STATIC ${XLSX_SERIALIZE_CPP})
# Add dependency library
target_link_libraries(${LIB_NAME_XLSX_SERIALIZE}
PUBLIC
PRIVATE
${LIB_NAME_FONT_ENGINE}
)
# Add include files .h
target_include_directories(${LIB_NAME_XLSX_SERIALIZE}
PUBLIC
PRIVATE
${XLSX_SERIALIZE_DIR}Common/
${XLSX_SERIALIZE_DIR}Reader/
${XLSX_SERIALIZE_DIR}Writer/

View File

@ -18,12 +18,6 @@ file(GLOB COMMON_EDITOR_CPP ${COMMON_EDITOR_DIR}*.cpp)
# Set targer as static library
add_library(${LIB_NAME_EDITOR_COMMON} STATIC ${COMMON_EDITOR_CPP})
# Add include files .h
target_include_directories(${LIB_NAME_EDITOR_COMMON}
INTERFACE
${COMMON_EDITOR_DIR}../
)
# Set target definition
target_compile_definitions(${LIB_NAME_EDITOR_COMMON}
PRIVATE _LINUX

View File

@ -32,7 +32,7 @@ target_link_libraries(${LIB_NAME_DOCT_RENDER}
# Add include files .h
target_include_directories(${LIB_NAME_DOCT_RENDER}
PUBLIC
PRIVATE
${DOCT_RENDER_DIR}
)

View File

@ -89,7 +89,7 @@ target_link_libraries(${LIB_NAME_FONT_ENGINE}
# Add include files .h
target_include_directories(${LIB_NAME_FONT_ENGINE}
PUBLIC
PRIVATE
${FONT_ENGINE_DIR}
${FONT_ENGINE_DIR}fontconverter
${GRAPHICS_EDITOR_DIR}

View File

@ -26,6 +26,7 @@ add_library(${LIB_NAME_EDITOR_XML} STATIC ${XML_EDITOR_CPP})
target_include_directories(${LIB_NAME_EDITOR_XML}
PUBLIC
${XML_EDITOR_DIR}include/
PRIVATE
${XML_EDITOR_DIR}build/qt/
${XML_EDITOR_DIR}libxml2/
${XML_EDITOR_DIR}libxml2/include/

View File

@ -31,9 +31,8 @@ target_link_libraries(${LIB_NAME_DJVU}
# Add include files .h
target_include_directories(${LIB_NAME_DJVU}
PUBLIC
${DJVU_DIR}
PRIVATE
${DJVU_DIR}
${DJVU_DIR}libdjvu/
${WORKAROUND_DIR}/mblen/
)

View File

@ -33,9 +33,8 @@ target_link_libraries(${LIB_NAME_DOC}
# Add include files .h
target_include_directories(${LIB_NAME_DOC}
PUBLIC
${DOC_FILE_DIR}DocFormatLib/
PRIVATE
${DOC_FILE_DIR}DocFormatLib/
${DOC_FILE_DIR}DocFormatLib/Linux/
${DOC_FILE_DIR}Common/
${DOC_FILE_DIR}DocDocxConverter/

View File

@ -34,7 +34,7 @@ target_link_libraries(${LIB_NAME_DOCX}
# Add include files .h
target_include_directories(${LIB_NAME_DOCX}
PUBLIC
PRIVATE
${DOCX_FILE_DIR}DocWrapper/
${DOCX_FILE_DIR}BinReader/
${DOCX_FILE_DIR}BinWriter/

View File

@ -34,9 +34,8 @@ target_link_libraries(${LIB_NAME_DOCXFORMAT}
# Add include files .h
target_include_directories(${LIB_NAME_DOCXFORMAT}
PUBLIC
${DOCXFORMAT_DIR}DocxFormatLib/
PRIVATE
${DOCXFORMAT_DIR}DocxFormatLib/
${WORKAROUND_DIR}/gcvt/
${DOCXFORMAT_DIR}Source/
${DOCXFORMAT_DIR}Source/Base/

View File

@ -22,7 +22,7 @@ add_library(${LIB_NAME_HTML_FILE} STATIC ${HTML_FILE_CPP})
# Add include files .h
target_include_directories(${LIB_NAME_HTML_FILE}
PUBLIC
PRIVATE
${HTML_FILE_DIR}
)

View File

@ -29,7 +29,7 @@ target_link_libraries(${LIB_NAME_HTML_RENDER}
# Add include files .h
target_include_directories(${LIB_NAME_HTML_RENDER}
PUBLIC
PRIVATE
${HTML_RENDER_DIR}src/
${HTML_RENDER_DIR}include/
)

View File

@ -43,7 +43,7 @@ target_link_libraries(${LIB_NAME_ODF_READER}
# Add include files .h
target_include_directories(${LIB_NAME_ODF_READER}
PUBLIC
PRIVATE
${ODF_READER_FILE_DIR}include/
${ODF_READER_FILE_DIR}linux/
${ODF_READER_FILE_DIR}formulasconvert/

View File

@ -41,13 +41,12 @@ target_link_libraries(${LIB_NAME_ODF_WRITER}
# Add include files .h
target_include_directories(${LIB_NAME_ODF_WRITER}
PUBLIC
PRIVATE
${ODF_WRITER_FILE_DIR}linux/
${ODF_WRITER_FILE_DIR}source/
${ODF_WRITER_FILE_DIR}source/OdfFormat/
${ODF_WRITER_FILE_DIR}source/OdfFormat/Shapes/
${ODF_WRITER_FILE_DIR}source/Oox2OdfConverter/
PRIVATE
${ODF_READER_FILE_DIR}include/
${ODF_READER_FILE_DIR}linux/
${ODF_READER_FILE_DIR}formulasconvert/

View File

@ -29,9 +29,8 @@ target_link_libraries(${LIB_NAME_PDF_READER}
# Add include files .h
target_include_directories(${LIB_NAME_PDF_READER}
PUBLIC
${PDF_READER_DIR}
PRIVATE
${PDF_READER_DIR}
${PDF_READER_DIR}Src/
${PDF_READER_DIR}Resources/
)

View File

@ -31,9 +31,8 @@ target_link_libraries(${LIB_NAME_PDF_WRITER}
# Add include files .h
target_include_directories(${LIB_NAME_PDF_WRITER}
PUBLIC
${PDF_WRITER_DIR}
PRIVATE
${PDF_WRITER_DIR}
${PDF_WRITER_DIR}Src/
)

View File

@ -30,7 +30,7 @@ target_link_libraries(${LIB_NAME_PPT}
# Add include files .h
target_include_directories(${LIB_NAME_PPT}
PUBLIC
PRIVATE
${PPT_FILE_DIR}PPTFormatLib/
${PPT_FILE_DIR}PPTFormatLib/Linux/
${PPT_FILE_DIR}PPTFormatLib/Reader/

View File

@ -43,7 +43,7 @@ target_link_libraries(${LIB_NAME_PPTX}
# Add include files .h
target_include_directories(${LIB_NAME_PPTX}
PUBLIC
PRIVATE
${PPTX_FILE_DIR}
${PPTX_FILE_DIR}PPTXLib/Linux/PPTXFormatLib/
${PPTX_FILE_DIR}Editor/

View File

@ -31,7 +31,7 @@ target_link_libraries(${LIB_NAME_RTF}
# Add include files .h
target_include_directories(${LIB_NAME_RTF}
PUBLIC
PRIVATE
${RTF_FILE_DIR}RtfFormatLib/Linux/
${RTF_FILE_DIR}source/
${RTF_FILE_DIR}source/Reader/

View File

@ -34,7 +34,7 @@ target_link_libraries(${LIB_NAME_TXT}
# Add include files .h
target_include_directories(${LIB_NAME_TXT}
PUBLIC
PRIVATE
${TXT_DIR}TxtXmlFormatLib/Source/
${TXT_DIR}TxtXmlFormatLib/Source/Common/
${TXT_DIR}TxtXmlFormatLib/Source/TxtFormat/

View File

@ -75,7 +75,7 @@ target_link_libraries(${LIB_NAME_XLS}
# Add include files .h
target_include_directories(${LIB_NAME_XLS}
PUBLIC
PRIVATE
${XLS_FILE_DIR}source/Common/
${XLS_FILE_DIR}source/XlsFormat/
${XLS_FILE_DIR}source/XlsFormat/Auxiliary/

View File

@ -34,7 +34,7 @@ target_link_libraries(${LIB_NAME_XPS}
# Add include files .h
target_include_directories(${LIB_NAME_XPS}
PUBLIC
PRIVATE
${XPS_FILE_DIR}
${XPS_FILE_DIR}XpsLib/
)

View File

@ -49,6 +49,7 @@
#include "../../ASCOfficeDocxFile2/BinReader/DefaultThemeWriter.h"
#include "../../ASCOfficePPTXFile/PPTXFormat/Theme.h"
#include "../../ASCOfficePPTXFile/Editor/Drawing/Shapes/BaseShape/Common.h"
#include "../../Common/DocxFormat/Source/XlsxFormat/Workbook/Workbook.h"
#include "../../Common/DocxFormat/Source/XlsxFormat/Worksheets/Worksheet.h"
@ -3618,6 +3619,8 @@ namespace BinXlsxRW
oPic.m_sClientDataXml = oClientData.toXML();
NSBinPptxRW::CXmlWriter oWriter(XMLWRITER_DOC_TYPE_XLSX);
COOXToVMLGeometry oOOXToVMLRenderer;
oWriter.m_pOOXToVMLRenderer = &oOOXToVMLRenderer;
NSCommon::smart_ptr<PPTX::Logic::ClrMap> oClrMap;
oWriter.m_lObjectIdVML = m_pCurVmlDrawing->m_lObjectIdVML;
@ -3881,6 +3884,8 @@ namespace BinXlsxRW
{
PPTX::Logic::SpTreeElem* pSpTree = static_cast<PPTX::Logic::SpTreeElem*>(oVmlShape.pElement);
NSBinPptxRW::CXmlWriter oWriter(XMLWRITER_DOC_TYPE_XLSX);
COOXToVMLGeometry oOOXToVMLRenderer;
oWriter.m_pOOXToVMLRenderer = &oOOXToVMLRenderer;
NSCommon::smart_ptr<PPTX::Logic::ClrMap> oClrMap;
oWriter.m_lObjectIdVML = pVmlDrawing->m_lObjectIdVML;
pSpTree->toXmlWriterVML(&oWriter, m_oSaveParams.pTheme, oClrMap, oVmlShape.sXml.c_str());