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
4ab14c9c
Commit
4ab14c9c
authored
Apr 26, 2016
by
ElenaSubbotina
Committed by
Alexander Trofimov
May 21, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OdfFormatReader - правка багов по результатам тестирования
parent
0e37afed
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
53 additions
and
26 deletions
+53
-26
ASCOfficeOdfFile/Test/ASCOfficeOdfFileTest/ASCOfficeOdfFileTest.vcproj
...ile/Test/ASCOfficeOdfFileTest/ASCOfficeOdfFileTest.vcproj
+1
-1
ASCOfficeOdfFile/src/docx/oox_drawing.h
ASCOfficeOdfFile/src/docx/oox_drawing.h
+4
-2
ASCOfficeOdfFile/src/odf/draw_frame_docx.cpp
ASCOfficeOdfFile/src/odf/draw_frame_docx.cpp
+26
-15
ASCOfficeOdfFile/src/odf/draw_frame_pptx.cpp
ASCOfficeOdfFile/src/odf/draw_frame_pptx.cpp
+1
-0
ASCOfficeOdfFile/src/odf/draw_frame_xlsx.cpp
ASCOfficeOdfFile/src/odf/draw_frame_xlsx.cpp
+7
-6
ASCOfficeOdfFile/src/odf/style_paragraph_properties_docx.cpp
ASCOfficeOdfFile/src/odf/style_paragraph_properties_docx.cpp
+9
-1
ASCOfficeOdfFile/src/odf/text_elements.cpp
ASCOfficeOdfFile/src/odf/text_elements.cpp
+5
-1
No files found.
ASCOfficeOdfFile/Test/ASCOfficeOdfFileTest/ASCOfficeOdfFileTest.vcproj
View file @
4ab14c9c
...
...
@@ -20,7 +20,7 @@
<Configurations>
<Configuration
Name=
"Debug|Win32"
OutputDirectory=
"
$(ConfigurationName)
"
OutputDirectory=
"
WORD_EXAMPLE.odtWORD_EXAMPLE.odt
"
IntermediateDirectory=
"$(ConfigurationName)"
ConfigurationType=
"1"
CharacterSet=
"1"
...
...
ASCOfficeOdfFile/src/docx/oox_drawing.h
View file @
4ab14c9c
...
...
@@ -9,6 +9,8 @@
#include "mediaitems.h"
#include "oox_drawing_fills.h"
#include "../../../common/docxformat/source/base/types_32.h"
static
const
int
_odf_to_oox_ShapeType
[]
=
{
4
,
4
,
4
,
34
,};
...
...
@@ -45,8 +47,8 @@ namespace oox {
std
::
wstring
name
;
size_t
x
,
y
;
size_t
cx
,
cy
;
_INT32
x
,
y
;
_INT32
cx
,
cy
;
_oox_fill
fill
;
...
...
ASCOfficeOdfFile/src/odf/draw_frame_docx.cpp
View file @
4ab14c9c
...
...
@@ -857,6 +857,15 @@ void common_draw_docx_convert(oox::docx_conversion_context & Context, const unio
drawing
.
cx
=
get_value_emu
(
attlists_
.
rel_size_
.
common_draw_size_attlist_
.
svg_width_
);
drawing
.
cy
=
get_value_emu
(
attlists_
.
rel_size_
.
common_draw_size_attlist_
.
svg_height_
);
if
(
drawing
.
cx
<
0
)
//frame textbox int WORD_EXAMPLE.odt = 45 inch !!!!
{
drawing
.
cx
=
-
drawing
.
cx
;
drawing
.
additional
.
push_back
(
_property
(
L"fit-to-size"
,
true
));
}
if
(
drawing
.
cy
<
0
)
drawing
.
cy
=
0
;
////////////////////////////////////////////////////////////////////////////////////////////////////
if
((
drawing
.
styleWrap
)
&&
(
drawing
.
styleWrap
->
get_type
()
==
style_wrap
::
Dynamic
))
//
{
...
...
@@ -1231,25 +1240,27 @@ void draw_object::docx_convert(oox::docx_conversion_context & Context)
std
::
wstring
objectPath
=
folderPath
+
FILE_SEPARATOR_STR
+
href
;
//normalize path ??? todooo
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
);
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
office_element
*
contentSubDoc
=
objectSubDoc
.
get_impl
()
->
get_content
();
if
(
!
contentSubDoc
)
return
;
office_element
*
contentSubDoc
=
objectSubDoc
.
get_impl
()
->
get_content
();
draw_frame
*
frame
=
NULL
;
chart_build
objectBuild
;
if
(
contentSubDoc
)
//Diagramma.odt -
{
process_build_chart
process_build_object_
(
objectBuild
,
objectSubDoc
.
odf_context
().
styleContainer
(),
objectSubDoc
.
odf_context
().
drawStyles
());
contentSubDoc
->
accept
(
process_build_object_
);
chart_build
objectBuild
;
process_build_chart
process_build_object_
(
objectBuild
,
objectSubDoc
.
odf_context
().
styleContainer
(),
objectSubDoc
.
odf_context
().
drawStyles
());
contentSubDoc
->
accept
(
process_build_object_
);
objectBuild
.
docx_convert
(
Context
);
frame
=
Context
.
get_drawing_context
().
get_current_frame
();
//owner
}
objectBuild
.
docx_convert
(
Context
);
draw_frame
*
frame
=
Context
.
get_drawing_context
().
get_current_frame
();
//owner
if
(
!
frame
)
return
;
//------------------------------------------------------------------------------------------------------------
if
(
objectBuild
.
object_type_
==
1
)
//
if
(
objectBuild
.
object_type_
==
1
&&
frame
)
//
{
oox
::
_docx_drawing
drawing
=
oox
::
_docx_drawing
();
...
...
@@ -1278,7 +1289,7 @@ void draw_object::docx_convert(oox::docx_conversion_context & Context)
Context
.
set_run_state
(
runState
);
Context
.
set_paragraph_state
(
pState
);
}
else
if
(
objectBuild
.
object_type_
==
3
)
//
else
if
(
objectBuild
.
object_type_
==
3
&&
frame
)
//
{
oox
::
_docx_drawing
drawing
=
oox
::
_docx_drawing
();
...
...
@@ -1328,7 +1339,7 @@ void draw_object::docx_convert(oox::docx_conversion_context & Context)
}
else
if
(
objectBuild
.
object_type_
==
0
)
{
//
-
( )
// ( )
bool
&
use_image_replace
=
Context
.
get_drawing_context
().
get_use_image_replace
();
use_image_replace
=
true
;
...
...
ASCOfficeOdfFile/src/odf/draw_frame_pptx.cpp
View file @
4ab14c9c
...
...
@@ -252,6 +252,7 @@ void draw_object::pptx_convert(oox::pptx_conversion_context & Context)
std
::
wstring
objectPath
=
folderPath
+
FILE_SEPARATOR_STR
+
href
;
//normalize path ??? todooo
boost
::
algorithm
::
replace_all
(
objectPath
,
FILE_SEPARATOR_STR
+
std
::
wstring
(
L"./"
),
FILE_SEPARATOR_STR
);
cpdoccore
::
odf_reader
::
odf_document
objectSubDoc
(
objectPath
,
NULL
);
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
...
...
ASCOfficeOdfFile/src/odf/draw_frame_xlsx.cpp
View file @
4ab14c9c
...
...
@@ -220,6 +220,7 @@ void draw_object::xlsx_convert(oox::xlsx_conversion_context & Context)
std
::
wstring
objectPath
=
folderPath
+
FILE_SEPARATOR_STR
+
href
;
// normalize path ???? todooo
boost
::
algorithm
::
replace_all
(
objectPath
,
FILE_SEPARATOR_STR
+
std
::
wstring
(
L"./"
),
FILE_SEPARATOR_STR
);
cpdoccore
::
odf_reader
::
odf_document
objectSubDoc
(
objectPath
,
NULL
);
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
...
...
@@ -227,13 +228,13 @@ void draw_object::xlsx_convert(oox::xlsx_conversion_context & Context)
///////////////////////////////////////////////////////////////////////////
//
const
office_element
*
contentSubDoc
=
objectSubDoc
.
get_impl
()
->
get_content
();
if
(
!
contentSubDoc
)
return
;
chart_build
objectBuild
;
process_build_chart
process_build_object_
(
objectBuild
,
objectSubDoc
.
odf_context
().
styleContainer
(),
objectSubDoc
.
odf_context
().
drawStyles
()
);
contentSubDoc
->
accept
(
process_build_object_
);
if
(
contentSubDoc
)
{
process_build_chart
process_build_object_
(
objectBuild
,
objectSubDoc
.
odf_context
().
styleContainer
(),
objectSubDoc
.
odf_context
().
drawStyles
()
);
contentSubDoc
->
accept
(
process_build_object_
);
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
...
...
ASCOfficeOdfFile/src/odf/style_paragraph_properties_docx.cpp
View file @
4ab14c9c
...
...
@@ -100,6 +100,13 @@ std::wstring process_margin(const _CP_OPT(length_or_percent) & margin, double Mu
void
paragraph_format_properties
::
docx_convert
(
oox
::
docx_conversion_context
&
Context
)
{
bool
drawing
=
false
;
if
(
Context
.
get_drawing_context
().
get_current_shape
()
||
Context
.
get_drawing_context
().
get_current_frame
())
{
drawing
=
true
;
}
std
::
wstringstream
&
_pPr
=
Context
.
get_styles_context
().
paragraph_nodes
();
CP_XML_WRITER
(
_pPr
)
...
...
@@ -203,7 +210,8 @@ void paragraph_format_properties::docx_convert(oox::docx_conversion_context & Co
{
CP_XML_NODE
(
L"w:widowControl"
){
CP_XML_ATTR
(
L"w:val"
,
bool
(
*
fo_widows_
>
0
));}
}
if
(
fo_border_
||
fo_border_top_
||
fo_border_bottom_
||
fo_border_left_
||
fo_border_right_
)
if
((
fo_border_
||
fo_border_top_
||
fo_border_bottom_
||
fo_border_left_
||
fo_border_right_
)
&&
drawing
==
false
)
{
std
::
wstring
w_shadow
;
...
...
ASCOfficeOdfFile/src/odf/text_elements.cpp
View file @
4ab14c9c
...
...
@@ -381,7 +381,8 @@ void paragraph::docx_convert(oox::docx_conversion_context & Context)
{
if
(
Context
.
get_page_break
())
{
_Wostream
<<
L"<w:lastRenderedPageBreak/>"
;
if
(
Context
.
process_headers_footers_
==
false
)
_Wostream
<<
L"<w:lastRenderedPageBreak/>"
;
Context
.
set_page_break
(
false
);
}
elm
->
docx_convert
(
Context
);
...
...
@@ -448,6 +449,9 @@ void paragraph::pptx_convert(oox::pptx_conversion_context & Context)
///////////////////////////////////////////
void
soft_page_break
::
docx_convert
(
oox
::
docx_conversion_context
&
Context
)
{
if
(
Context
.
process_headers_footers_
)
return
;
if
(
!
Context
.
get_page_break_after
()
&&
!
Context
.
get_page_break_before
())
{
Context
.
output_stream
()
<<
L"<w:lastRenderedPageBreak/>"
;
...
...
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