Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
onlyoffice_core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
onlyoffice_core
Commits
4cf55208
Commit
4cf55208
authored
Dec 09, 2016
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OdfFormat - embedded office text (against text box)
parent
fe1d4863
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
75 additions
and
64 deletions
+75
-64
ASCOfficeOdfFile/src/docx/oox_package.cpp
ASCOfficeOdfFile/src/docx/oox_package.cpp
+1
-0
ASCOfficeOdfFile/src/docx/pptx_slide_context.cpp
ASCOfficeOdfFile/src/docx/pptx_slide_context.cpp
+4
-3
ASCOfficeOdfFile/src/docx/pptx_slide_context.h
ASCOfficeOdfFile/src/docx/pptx_slide_context.h
+3
-3
ASCOfficeOdfFile/src/docx/xlsx_drawing.cpp
ASCOfficeOdfFile/src/docx/xlsx_drawing.cpp
+1
-1
ASCOfficeOdfFile/src/docx/xlsx_drawing_context.cpp
ASCOfficeOdfFile/src/docx/xlsx_drawing_context.cpp
+8
-3
ASCOfficeOdfFile/src/docx/xlsx_drawing_context.h
ASCOfficeOdfFile/src/docx/xlsx_drawing_context.h
+3
-2
ASCOfficeOdfFile/src/docx/xlsx_drawings.cpp
ASCOfficeOdfFile/src/docx/xlsx_drawings.cpp
+1
-1
ASCOfficeOdfFile/src/odf/chart_build_oox.cpp
ASCOfficeOdfFile/src/odf/chart_build_oox.cpp
+12
-4
ASCOfficeOdfFile/src/odf/draw_frame.cpp
ASCOfficeOdfFile/src/odf/draw_frame.cpp
+19
-0
ASCOfficeOdfFile/src/odf/draw_frame_docx.cpp
ASCOfficeOdfFile/src/odf/draw_frame_docx.cpp
+1
-2
ASCOfficeOdfFile/src/odf/draw_frame_pptx.cpp
ASCOfficeOdfFile/src/odf/draw_frame_pptx.cpp
+12
-23
ASCOfficeOdfFile/src/odf/draw_frame_xlsx.cpp
ASCOfficeOdfFile/src/odf/draw_frame_xlsx.cpp
+10
-22
No files found.
ASCOfficeOdfFile/src/docx/oox_package.cpp
View file @
4cf55208
...
@@ -74,6 +74,7 @@ static std::wstring get_mime_type(const std::wstring & extension)
...
@@ -74,6 +74,7 @@ static std::wstring get_mime_type(const std::wstring & extension)
else
if
(
L"wav"
==
extension
)
return
L"audio/wav"
;
else
if
(
L"wav"
==
extension
)
return
L"audio/wav"
;
else
if
(
L"bin"
==
extension
)
return
L"application/vnd.openxmlformats-officedocument.oleObject"
;
else
if
(
L"bin"
==
extension
)
return
L"application/vnd.openxmlformats-officedocument.oleObject"
;
else
if
(
L"xlsx"
==
extension
)
return
L"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
;
else
if
(
L"xlsx"
==
extension
)
return
L"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
;
else
if
(
L"docx"
==
extension
)
return
L"application/vnd.openxmlformats-officedocument.wordprocessingml.document"
;
else
if
(
L"doc"
==
extension
)
return
L"application/msword"
;
else
if
(
L"doc"
==
extension
)
return
L"application/msword"
;
else
return
L"application/octet-stream"
;
else
return
L"application/octet-stream"
;
...
...
ASCOfficeOdfFile/src/docx/pptx_slide_context.cpp
View file @
4cf55208
...
@@ -378,7 +378,7 @@ void pptx_slide_context::set_text_box()
...
@@ -378,7 +378,7 @@ void pptx_slide_context::set_text_box()
impl_
->
object_description_
.
type_
=
typeShape
;
impl_
->
object_description_
.
type_
=
typeShape
;
impl_
->
object_description_
.
shape_type_
=
2
;
//2,3...
impl_
->
object_description_
.
shape_type_
=
2
;
//2,3...
}
}
void
pptx_slide_context
::
set_object
(
const
std
::
wstring
&
path
,
const
std
::
wstring
&
progId
)
void
pptx_slide_context
::
set_
ms_
object
(
const
std
::
wstring
&
path
,
const
std
::
wstring
&
progId
)
{
{
impl_
->
object_description_
.
type_
=
typeMsObject
;
impl_
->
object_description_
.
type_
=
typeMsObject
;
impl_
->
object_description_
.
xlink_href_
=
path
;
impl_
->
object_description_
.
xlink_href_
=
path
;
...
@@ -391,7 +391,7 @@ void pptx_slide_context::set_ole_object(const std::wstring & path, const std::ws
...
@@ -391,7 +391,7 @@ void pptx_slide_context::set_ole_object(const std::wstring & path, const std::ws
impl_
->
object_description_
.
descriptor_
=
progId
;
impl_
->
object_description_
.
descriptor_
=
progId
;
}
}
void
pptx_slide_context
::
set_image
(
std
::
wstring
const
&
path
)
void
pptx_slide_context
::
set_image
(
const
std
::
wstring
&
path
)
{
{
if
(
impl_
->
object_description_
.
type_
==
typeUnknown
)
if
(
impl_
->
object_description_
.
type_
==
typeUnknown
)
{
{
...
@@ -403,6 +403,7 @@ void pptx_slide_context::set_image(std::wstring const & path)
...
@@ -403,6 +403,7 @@ void pptx_slide_context::set_image(std::wstring const & path)
impl_
->
object_description_
.
fill_
.
type
=
2
;
impl_
->
object_description_
.
fill_
.
type
=
2
;
impl_
->
object_description_
.
fill_
.
bitmap
=
oox
::
oox_bitmap_fill
::
create
();
impl_
->
object_description_
.
fill_
.
bitmap
=
oox
::
oox_bitmap_fill
::
create
();
impl_
->
object_description_
.
fill_
.
bitmap
->
xlink_href_
=
path
;
impl_
->
object_description_
.
fill_
.
bitmap
->
xlink_href_
=
path
;
impl_
->
object_description_
.
fill_
.
bitmap
->
bStretch
=
true
;
}
}
}
}
...
@@ -411,7 +412,7 @@ void pptx_slide_context::start_frame()
...
@@ -411,7 +412,7 @@ void pptx_slide_context::start_frame()
impl_
->
object_description_
.
type_
=
typeUnknown
;
impl_
->
object_description_
.
type_
=
typeUnknown
;
}
}
void
pptx_slide_context
::
set_chart
(
std
::
wstring
const
&
path
)
void
pptx_slide_context
::
set_chart
(
const
std
::
wstring
&
path
)
{
{
impl_
->
object_description_
.
type_
=
typeChart
;
impl_
->
object_description_
.
type_
=
typeChart
;
impl_
->
object_description_
.
xlink_href_
=
path
;
impl_
->
object_description_
.
xlink_href_
=
path
;
...
...
ASCOfficeOdfFile/src/docx/pptx_slide_context.h
View file @
4cf55208
...
@@ -78,9 +78,9 @@ public:
...
@@ -78,9 +78,9 @@ public:
std
::
wstring
add_hyperlink
(
std
::
wstring
const
&
ref
,
bool
object
);
std
::
wstring
add_hyperlink
(
std
::
wstring
const
&
ref
,
bool
object
);
void
start_frame
();
void
start_frame
();
void
set_image
(
std
::
wstring
const
&
path
);
void
set_image
(
const
std
::
wstring
&
path
);
void
set_chart
(
std
::
wstring
const
&
path
);
void
set_chart
(
const
std
::
wstring
&
path
);
void
set_
object
(
const
std
::
wstring
&
path
,
const
std
::
wstring
&
progId
);
void
set_
ms_object
(
const
std
::
wstring
&
path
,
const
std
::
wstring
&
progId
);
void
set_ole_object
(
const
std
::
wstring
&
path
,
const
std
::
wstring
&
progId
);
void
set_ole_object
(
const
std
::
wstring
&
path
,
const
std
::
wstring
&
progId
);
void
set_text_box
();
void
set_text_box
();
void
end_frame
();
void
end_frame
();
...
...
ASCOfficeOdfFile/src/docx/xlsx_drawing.cpp
View file @
4cf55208
...
@@ -340,7 +340,7 @@ void _xlsx_drawing::serialize(std::wostream & strm)
...
@@ -340,7 +340,7 @@ void _xlsx_drawing::serialize(std::wostream & strm)
void
_xlsx_drawing
::
serialize_object
(
std
::
wostream
&
strm
)
void
_xlsx_drawing
::
serialize_object
(
std
::
wostream
&
strm
)
{
{
if
(
type
!=
typeOleObject
)
return
;
if
(
type
!=
typeOleObject
&&
type
!=
typeMsObject
)
return
;
CP_XML_WRITER
(
strm
)
CP_XML_WRITER
(
strm
)
{
{
...
...
ASCOfficeOdfFile/src/docx/xlsx_drawing_context.cpp
View file @
4cf55208
...
@@ -288,8 +288,13 @@ void xlsx_drawing_context::set_ole_object(const std::wstring & path, const std::
...
@@ -288,8 +288,13 @@ void xlsx_drawing_context::set_ole_object(const std::wstring & path, const std::
impl_
->
object_description_
.
xlink_href_
=
path
;
impl_
->
object_description_
.
xlink_href_
=
path
;
impl_
->
object_description_
.
descriptor_
=
progId
;
impl_
->
object_description_
.
descriptor_
=
progId
;
}
}
void
xlsx_drawing_context
::
set_ms_object
(
const
std
::
wstring
&
path
,
const
std
::
wstring
&
progId
)
void
xlsx_drawing_context
::
set_image
(
std
::
wstring
const
&
path
)
{
impl_
->
object_description_
.
type_
=
typeMsObject
;
impl_
->
object_description_
.
xlink_href_
=
path
;
impl_
->
object_description_
.
descriptor_
=
progId
;
}
void
xlsx_drawing_context
::
set_image
(
const
std
::
wstring
&
path
)
{
{
if
(
impl_
->
object_description_
.
type_
==
typeUnknown
)
if
(
impl_
->
object_description_
.
type_
==
typeUnknown
)
{
{
...
@@ -312,7 +317,7 @@ void xlsx_drawing_context::end_frame()
...
@@ -312,7 +317,7 @@ void xlsx_drawing_context::end_frame()
impl_
->
current_level_
->
push_back
(
impl_
->
object_description_
);
impl_
->
current_level_
->
push_back
(
impl_
->
object_description_
);
}
}
void
xlsx_drawing_context
::
set_chart
(
std
::
wstring
const
&
path
)
void
xlsx_drawing_context
::
set_chart
(
const
std
::
wstring
&
path
)
{
{
impl_
->
object_description_
.
type_
=
typeChart
;
impl_
->
object_description_
.
type_
=
typeChart
;
impl_
->
object_description_
.
xlink_href_
=
path
;
impl_
->
object_description_
.
xlink_href_
=
path
;
...
...
ASCOfficeOdfFile/src/docx/xlsx_drawing_context.h
View file @
4cf55208
...
@@ -91,9 +91,10 @@ public:
...
@@ -91,9 +91,10 @@ public:
void
end_shape
();
void
end_shape
();
void
start_frame
();
void
start_frame
();
void
set_image
(
std
::
wstring
const
&
path
);
void
set_image
(
const
std
::
wstring
&
path
);
void
set_chart
(
std
::
wstring
const
&
path
);
void
set_chart
(
const
std
::
wstring
&
path
);
void
set_ole_object
(
const
std
::
wstring
&
path
,
const
std
::
wstring
&
progId
);
void
set_ole_object
(
const
std
::
wstring
&
path
,
const
std
::
wstring
&
progId
);
void
set_ms_object
(
const
std
::
wstring
&
path
,
const
std
::
wstring
&
progId
);
void
set_text_box
();
void
set_text_box
();
void
end_frame
();
void
end_frame
();
...
...
ASCOfficeOdfFile/src/docx/xlsx_drawings.cpp
View file @
4cf55208
...
@@ -114,7 +114,7 @@ public:
...
@@ -114,7 +114,7 @@ public:
{
{
for
(
int
i
=
0
;
i
<
xlsx_drawings_
.
size
();
i
++
)
for
(
int
i
=
0
;
i
<
xlsx_drawings_
.
size
();
i
++
)
{
{
if
(
xlsx_drawings_
[
i
].
type
!=
typeOleObject
)
continue
;
if
(
xlsx_drawings_
[
i
].
type
!=
typeOleObject
&&
xlsx_drawings_
[
i
].
type
!=
typeMsObject
)
continue
;
xlsx_drawings_
[
i
].
serialize_object
(
strm
);
xlsx_drawings_
[
i
].
serialize_object
(
strm
);
}
}
...
...
ASCOfficeOdfFile/src/odf/chart_build_oox.cpp
View file @
4cf55208
...
@@ -175,7 +175,7 @@ void object_odf_context::xlsx_convert(oox::xlsx_conversion_context & Context)
...
@@ -175,7 +175,7 @@ void object_odf_context::xlsx_convert(oox::xlsx_conversion_context & Context)
}
}
else
if
(
object_type_
==
2
&&
office_text_
)
else
if
(
object_type_
==
2
&&
office_text_
)
{
{
office_text_
->
xlsx_convert
(
Context
);
//embedded
}
}
else
if
(
object_type_
==
3
&&
office_math_
)
else
if
(
object_type_
==
3
&&
office_math_
)
{
{
...
@@ -183,6 +183,10 @@ void object_odf_context::xlsx_convert(oox::xlsx_conversion_context & Context)
...
@@ -183,6 +183,10 @@ void object_odf_context::xlsx_convert(oox::xlsx_conversion_context & Context)
Context
.
get_math_context
().
start
();
Context
.
get_math_context
().
start
();
office_math_
->
oox_convert
(
Context
.
get_math_context
());
office_math_
->
oox_convert
(
Context
.
get_math_context
());
}
}
else
if
(
object_type_
==
4
&&
office_spreadsheet_
)
{
//embedded
}
}
}
void
object_odf_context
::
docx_convert
(
oox
::
docx_conversion_context
&
Context
)
void
object_odf_context
::
docx_convert
(
oox
::
docx_conversion_context
&
Context
)
{
{
...
@@ -199,7 +203,7 @@ void object_odf_context::docx_convert(oox::docx_conversion_context & Context)
...
@@ -199,7 +203,7 @@ void object_odf_context::docx_convert(oox::docx_conversion_context & Context)
}
}
else
if
(
object_type_
==
2
&&
office_text_
)
else
if
(
object_type_
==
2
&&
office_text_
)
{
{
office_text_
->
docx_convert
(
Context
);
//embedded
}
}
else
if
(
object_type_
==
3
&&
office_math_
)
else
if
(
object_type_
==
3
&&
office_math_
)
{
{
...
@@ -227,7 +231,7 @@ void object_odf_context::docx_convert(oox::docx_conversion_context & Context)
...
@@ -227,7 +231,7 @@ void object_odf_context::docx_convert(oox::docx_conversion_context & Context)
}
}
else
if
(
object_type_
==
4
&&
office_spreadsheet_
)
else
if
(
object_type_
==
4
&&
office_spreadsheet_
)
{
{
//
office_spreadsheet_
//
embedded
}
}
}
}
void
object_odf_context
::
pptx_convert
(
oox
::
pptx_conversion_context
&
Context
)
void
object_odf_context
::
pptx_convert
(
oox
::
pptx_conversion_context
&
Context
)
...
@@ -244,7 +248,7 @@ void object_odf_context::pptx_convert(oox::pptx_conversion_context & Context)
...
@@ -244,7 +248,7 @@ void object_odf_context::pptx_convert(oox::pptx_conversion_context & Context)
}
}
else
if
(
object_type_
==
2
&&
office_text_
)
else
if
(
object_type_
==
2
&&
office_text_
)
{
{
office_text_
->
pptx_convert
(
Context
);
//embedded
}
}
else
if
(
object_type_
==
3
&&
office_math_
)
else
if
(
object_type_
==
3
&&
office_math_
)
{
{
...
@@ -252,6 +256,10 @@ void object_odf_context::pptx_convert(oox::pptx_conversion_context & Context)
...
@@ -252,6 +256,10 @@ void object_odf_context::pptx_convert(oox::pptx_conversion_context & Context)
Context
.
get_math_context
().
start
();
Context
.
get_math_context
().
start
();
office_math_
->
oox_convert
(
Context
.
get_math_context
());
office_math_
->
oox_convert
(
Context
.
get_math_context
());
}
}
else
if
(
object_type_
==
4
&&
office_spreadsheet_
)
{
//embedded
}
}
}
void
object_odf_context
::
calc_cache_series
(
std
::
wstring
adress
,
std
::
vector
<
std
::
wstring
>
&
cash
)
void
object_odf_context
::
calc_cache_series
(
std
::
wstring
adress
,
std
::
vector
<
std
::
wstring
>
&
cash
)
{
{
...
...
ASCOfficeOdfFile/src/odf/draw_frame.cpp
View file @
4cf55208
...
@@ -339,6 +339,25 @@ std::wstring draw_object::office_convert(odf_document * odfDocument, int type)
...
@@ -339,6 +339,25 @@ std::wstring draw_object::office_convert(odf_document * odfDocument, int type)
std
::
wstring
folderPath
=
odfDocument
->
get_folder
();
std
::
wstring
folderPath
=
odfDocument
->
get_folder
();
std
::
wstring
objectOutPath
=
FileSystem
::
Directory
::
CreateDirectoryWithUniqueName
(
folderPath
);
std
::
wstring
objectOutPath
=
FileSystem
::
Directory
::
CreateDirectoryWithUniqueName
(
folderPath
);
if
(
type
==
1
)
{
oox
::
package
::
docx_document
outputDocx
;
oox
::
docx_conversion_context
conversionDocxContext
(
odfDocument
);
conversionDocxContext
.
set_output_document
(
&
outputDocx
);
//conversionContext.set_font_directory (fontsPath);
if
(
odfDocument
->
docx_convert
(
conversionDocxContext
))
{
outputDocx
.
write
(
objectOutPath
);
href_result
=
common_xlink_attlist_
.
href_
.
get_value_or
(
L"Object"
);
int
pos
=
href_result
.
find
(
L"./"
);
if
(
pos
>=
0
)
href_result
=
href_result
.
substr
(
2
);
href_result
=
L"docx"
+
href_result
+
L".docx"
;
}
}
if
(
type
==
2
)
if
(
type
==
2
)
{
{
oox
::
package
::
xlsx_document
outputXlsx
;
oox
::
package
::
xlsx_document
outputXlsx
;
...
...
ASCOfficeOdfFile/src/odf/draw_frame_docx.cpp
View file @
4cf55208
...
@@ -1433,7 +1433,7 @@ void draw_object::docx_convert(oox::docx_conversion_context & Context)
...
@@ -1433,7 +1433,7 @@ void draw_object::docx_convert(oox::docx_conversion_context & Context)
boost
::
algorithm
::
replace_all
(
objectPath
,
FILE_SEPARATOR_STR
+
std
::
wstring
(
L"./"
),
FILE_SEPARATOR_STR
);
boost
::
algorithm
::
replace_all
(
objectPath
,
FILE_SEPARATOR_STR
+
std
::
wstring
(
L"./"
),
FILE_SEPARATOR_STR
);
cpdoccore
::
odf_reader
::
odf_document
objectSubDoc
(
objectPath
,
NULL
);
cpdoccore
::
odf_reader
::
odf_document
objectSubDoc
(
objectPath
,
NULL
);
//
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
---------------------------------------------------------------------------------------------------------------------
draw_frame
*
frame
=
NULL
;
draw_frame
*
frame
=
NULL
;
oox
::
_docx_drawing
*
drawing
=
NULL
;
oox
::
_docx_drawing
*
drawing
=
NULL
;
office_element
*
contentSubDoc
=
objectSubDoc
.
get_impl
()
->
get_content
();
office_element
*
contentSubDoc
=
objectSubDoc
.
get_impl
()
->
get_content
();
...
@@ -1450,7 +1450,6 @@ void draw_object::docx_convert(oox::docx_conversion_context & Context)
...
@@ -1450,7 +1450,6 @@ void draw_object::docx_convert(oox::docx_conversion_context & Context)
if
(
frame
)
if
(
frame
)
drawing
=
dynamic_cast
<
oox
::
_docx_drawing
*>
(
frame
->
oox_drawing_
.
get
());
drawing
=
dynamic_cast
<
oox
::
_docx_drawing
*>
(
frame
->
oox_drawing_
.
get
());
}
}
//------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------
if
(
!
frame
||
!
drawing
)
if
(
!
frame
||
!
drawing
)
{
{
...
...
ASCOfficeOdfFile/src/odf/draw_frame_pptx.cpp
View file @
4cf55208
...
@@ -273,11 +273,7 @@ void draw_object::pptx_convert(oox::pptx_conversion_context & Context)
...
@@ -273,11 +273,7 @@ void draw_object::pptx_convert(oox::pptx_conversion_context & Context)
boost
::
algorithm
::
replace_all
(
objectPath
,
FILE_SEPARATOR_STR
+
std
::
wstring
(
L"./"
),
FILE_SEPARATOR_STR
);
boost
::
algorithm
::
replace_all
(
objectPath
,
FILE_SEPARATOR_STR
+
std
::
wstring
(
L"./"
),
FILE_SEPARATOR_STR
);
cpdoccore
::
odf_reader
::
odf_document
objectSubDoc
(
objectPath
,
NULL
);
cpdoccore
::
odf_reader
::
odf_document
objectSubDoc
(
objectPath
,
NULL
);
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//---------------------------------------------------------------------------------------------------------------------
//в отдельных embd объектах чаще всего диаграммы, уравнения... но МОГУТ быть и обычные объекты подтипа frame!!!
//пример RemanejamentoOrcamentario.ods
///////////////////////////////////////////////////////////////////////////
//функциональная часть
office_element
*
contentSubDoc
=
objectSubDoc
.
get_impl
()
->
get_content
();
office_element
*
contentSubDoc
=
objectSubDoc
.
get_impl
()
->
get_content
();
if
(
!
contentSubDoc
)
if
(
!
contentSubDoc
)
{
{
...
@@ -290,9 +286,7 @@ void draw_object::pptx_convert(oox::pptx_conversion_context & Context)
...
@@ -290,9 +286,7 @@ void draw_object::pptx_convert(oox::pptx_conversion_context & Context)
process_build_object
process_build_object_
(
objectBuild
,
objectSubDoc
.
odf_context
());
process_build_object
process_build_object_
(
objectBuild
,
objectSubDoc
.
odf_context
());
contentSubDoc
->
accept
(
process_build_object_
);
contentSubDoc
->
accept
(
process_build_object_
);
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//---------------------------------------------------------------------------------------------------------------------
//отображательная часть
if
(
objectBuild
.
object_type_
==
1
)
//диаграмма
if
(
objectBuild
.
object_type_
==
1
)
//диаграмма
{
{
const
std
::
wstring
href_draw
=
common_xlink_attlist_
.
href_
.
get_value_or
(
L""
);
const
std
::
wstring
href_draw
=
common_xlink_attlist_
.
href_
.
get_value_or
(
L""
);
...
@@ -300,25 +294,20 @@ void draw_object::pptx_convert(oox::pptx_conversion_context & Context)
...
@@ -300,25 +294,20 @@ void draw_object::pptx_convert(oox::pptx_conversion_context & Context)
Context
.
get_slide_context
().
set_chart
(
href_draw
);
// в рисовательной части только место объекта, рамочки ... и релсы
Context
.
get_slide_context
().
set_chart
(
href_draw
);
// в рисовательной части только место объекта, рамочки ... и релсы
}
}
else
if
(
objectBuild
.
object_type_
==
2
)
//odt
текст
else
if
(
objectBuild
.
object_type_
==
2
)
//odt
text
{
{
Context
.
get_slide_context
().
set_text_box
();
Context
.
get_slide_context
().
set_use_image_replacement
();
Context
.
get_text_context
().
start_object
();
//сменить контекст с главного на другой ... проблема со стилями!!
Context
.
get_text_context
().
set_local_styles_container
(
&
objectSubDoc
.
odf_context
().
styleContainer
());
objectBuild
.
pptx_convert
(
Context
);
std
::
wstring
href_new
=
office_convert
(
&
objectSubDoc
,
1
);
std
::
wstring
text_content_
=
Context
.
get_text_context
().
end_object
();
if
(
!
href_new
.
empty
())
Context
.
get_text_context
().
set_local_styles_container
(
NULL
);
//вытираем вручную ...
if
(
!
text_content_
.
empty
())
{
{
Context
.
get_slide_context
().
set_property
(
_property
(
L"text-content"
,
text_content_
));
bool
isMediaInternal
=
true
;
href
+=
FILE_SEPARATOR_STR
+
href_new
;
Context
.
get_slide_context
().
set_ms_object
(
href
,
L"Word.Document"
);
}
}
}
}
else
if
(
objectBuild
.
object_type_
==
3
)
//
мат формулы
else
if
(
objectBuild
.
object_type_
==
3
)
//
math
{
{
Context
.
get_slide_context
().
set_text_box
();
Context
.
get_slide_context
().
set_text_box
();
...
@@ -339,7 +328,7 @@ void draw_object::pptx_convert(oox::pptx_conversion_context & Context)
...
@@ -339,7 +328,7 @@ void draw_object::pptx_convert(oox::pptx_conversion_context & Context)
Context
.
get_slide_context
().
set_property
(
_property
(
L"text-content"
,
text_content
));
Context
.
get_slide_context
().
set_property
(
_property
(
L"text-content"
,
text_content
));
}
}
}
}
else
if
(
objectBuild
.
object_type_
==
4
)
//
embedded
sheet
else
if
(
objectBuild
.
object_type_
==
4
)
//
ods
sheet
{
{
Context
.
get_slide_context
().
set_use_image_replacement
();
Context
.
get_slide_context
().
set_use_image_replacement
();
...
@@ -349,7 +338,7 @@ void draw_object::pptx_convert(oox::pptx_conversion_context & Context)
...
@@ -349,7 +338,7 @@ void draw_object::pptx_convert(oox::pptx_conversion_context & Context)
{
{
bool
isMediaInternal
=
true
;
bool
isMediaInternal
=
true
;
href
+=
FILE_SEPARATOR_STR
+
href_new
;
href
+=
FILE_SEPARATOR_STR
+
href_new
;
Context
.
get_slide_context
().
set_
object
(
href
,
L"Excel.Sheet.12
"
);
Context
.
get_slide_context
().
set_
ms_object
(
href
,
L"Excel.Sheet
"
);
}
}
}
}
else
else
...
...
ASCOfficeOdfFile/src/odf/draw_frame_xlsx.cpp
View file @
4cf55208
...
@@ -257,21 +257,16 @@ void draw_text_box::xlsx_convert(oox::xlsx_conversion_context & Context)
...
@@ -257,21 +257,16 @@ void draw_text_box::xlsx_convert(oox::xlsx_conversion_context & Context)
void
draw_object
::
xlsx_convert
(
oox
::
xlsx_conversion_context
&
Context
)
void
draw_object
::
xlsx_convert
(
oox
::
xlsx_conversion_context
&
Context
)
{
{
try
{
try
{
const
std
::
wstring
href
=
common_xlink_attlist_
.
href_
.
get_value_or
(
L""
);
std
::
wstring
href
=
common_xlink_attlist_
.
href_
.
get_value_or
(
L""
);
odf_reader
::
odf_document
*
odf_reader
=
Context
.
root
();
std
::
wstring
folderPath
=
Context
.
root
()
->
get_folder
();
std
::
wstring
folderPath
=
odf_reader
->
get_folder
();
std
::
wstring
objectPath
=
folderPath
+
FILE_SEPARATOR_STR
+
href
;
std
::
wstring
objectPath
=
folderPath
+
FILE_SEPARATOR_STR
+
href
;
// normalize path ???? todooo
// normalize path ???? todooo
boost
::
algorithm
::
replace_all
(
objectPath
,
FILE_SEPARATOR_STR
+
std
::
wstring
(
L"./"
),
FILE_SEPARATOR_STR
);
boost
::
algorithm
::
replace_all
(
objectPath
,
FILE_SEPARATOR_STR
+
std
::
wstring
(
L"./"
),
FILE_SEPARATOR_STR
);
cpdoccore
::
odf_reader
::
odf_document
objectSubDoc
(
objectPath
,
NULL
);
cpdoccore
::
odf_reader
::
odf_document
objectSubDoc
(
objectPath
,
NULL
);
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//---------------------------------------------------------------------------------------------------------------------
//в отдельных embd объектах чаще всего диаграммы... но МОГУТ быть и обычные объекты подтипа frame!!! пример RemanejamentoOrcamentario.ods
///////////////////////////////////////////////////////////////////////////
//функциональная часть
office_element
*
contentSubDoc
=
objectSubDoc
.
get_impl
()
->
get_content
();
office_element
*
contentSubDoc
=
objectSubDoc
.
get_impl
()
->
get_content
();
object_odf_context
objectBuild
(
href
);
object_odf_context
objectBuild
(
href
);
...
@@ -280,9 +275,7 @@ void draw_object::xlsx_convert(oox::xlsx_conversion_context & Context)
...
@@ -280,9 +275,7 @@ void draw_object::xlsx_convert(oox::xlsx_conversion_context & Context)
process_build_object
process_build_object_
(
objectBuild
,
objectSubDoc
.
odf_context
());
process_build_object
process_build_object_
(
objectBuild
,
objectSubDoc
.
odf_context
());
contentSubDoc
->
accept
(
process_build_object_
);
contentSubDoc
->
accept
(
process_build_object_
);
}
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//---------------------------------------------------------------------------------------------------------------------
//отображательная часть
if
(
objectBuild
.
object_type_
==
1
)
//диаграмма
if
(
objectBuild
.
object_type_
==
1
)
//диаграмма
{
{
const
std
::
wstring
href_draw
=
common_xlink_attlist_
.
href_
.
get_value_or
(
L""
);
const
std
::
wstring
href_draw
=
common_xlink_attlist_
.
href_
.
get_value_or
(
L""
);
...
@@ -292,20 +285,15 @@ void draw_object::xlsx_convert(oox::xlsx_conversion_context & Context)
...
@@ -292,20 +285,15 @@ void draw_object::xlsx_convert(oox::xlsx_conversion_context & Context)
}
}
else
if
(
objectBuild
.
object_type_
==
2
)
//текст (odt text)
else
if
(
objectBuild
.
object_type_
==
2
)
//текст (odt text)
{
{
Context
.
get_drawing_context
().
set_text_box
();
Context
.
get_drawing_context
().
set_use_image_replacement
();
Context
.
get_text_context
().
start_drawing_content
();
//сменить контекст с главного на другой ... проблема со стилями!!
Context
.
get_text_context
().
set_local_styles_container
(
&
objectSubDoc
.
odf_context
().
styleContainer
());
objectBuild
.
xlsx_convert
(
Context
);
std
::
wstring
href_new
=
office_convert
(
&
objectSubDoc
,
1
);
std
::
wstring
text_content
=
Context
.
get_text_context
().
end_drawing_content
();
if
(
!
href_new
.
empty
())
Context
.
get_text_context
().
set_local_styles_container
(
NULL
);
//вытираем вручную ...
if
(
!
text_content
.
empty
())
{
{
Context
.
get_drawing_context
().
set_property
(
_property
(
L"text-content"
,
text_content
));
bool
isMediaInternal
=
true
;
href
+=
FILE_SEPARATOR_STR
+
href_new
;
Context
.
get_drawing_context
().
set_ms_object
(
href
,
L"Word.Document"
);
}
}
}
}
else
if
(
objectBuild
.
object_type_
==
3
)
//мат формулы
else
if
(
objectBuild
.
object_type_
==
3
)
//мат формулы
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment