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
21012285
Commit
21012285
authored
Sep 20, 2016
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OdfFormatWriter - fix border page (type = none)
parent
29167713
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
29 deletions
+61
-29
ASCOfficeOdfFileW/source/OdfFormat/odf_page_layout_context.cpp
...ficeOdfFileW/source/OdfFormat/odf_page_layout_context.cpp
+15
-4
ASCOfficeOdfFileW/source/OdfFormat/odf_page_layout_context.h
ASCOfficeOdfFileW/source/OdfFormat/odf_page_layout_context.h
+18
-17
ASCOfficeOdfFileW/source/Oox2OdfConverter/DocxConverter.cpp
ASCOfficeOdfFileW/source/Oox2OdfConverter/DocxConverter.cpp
+28
-8
No files found.
ASCOfficeOdfFileW/source/OdfFormat/odf_page_layout_context.cpp
View file @
21012285
...
...
@@ -385,6 +385,9 @@ bool odf_page_layout_context::add_header(int type)
create_element
(
L"style"
,
L"header"
,
elm
,
odf_context_
);
if
(
!
elm
)
return
false
;
if
(
master_state_list_
.
empty
())
start_master_page
(
L""
);
master_state_list_
.
back
().
add_header
(
elm
);
////////////////////////////////////////////////////////////////////////
...
...
@@ -425,8 +428,10 @@ bool odf_page_layout_context::add_header(int type)
return
true
;
}
void
odf_page_layout_context
::
set_page_border_padding_bottom
(
int
offset_type
,
double
length_pt
)
void
odf_page_layout_context
::
set_page_border_padding_bottom
(
int
offset_type
,
int
type
,
double
length_pt
)
{
if
(
type
<
1
)
return
;
style_page_layout_properties
*
props
=
get_properties
();
if
(
!
props
)
return
;
...
...
@@ -443,8 +448,10 @@ void odf_page_layout_context::set_page_border_padding_bottom(int offset_type, do
}
void
odf_page_layout_context
::
set_page_border_padding_top
(
int
offset_type
,
double
length_pt
)
void
odf_page_layout_context
::
set_page_border_padding_top
(
int
offset_type
,
int
type
,
double
length_pt
)
{
if
(
type
<
1
)
return
;
style_page_layout_properties
*
props
=
get_properties
();
if
(
!
props
)
return
;
...
...
@@ -461,8 +468,10 @@ void odf_page_layout_context::set_page_border_padding_top(int offset_type, doubl
}
void
odf_page_layout_context
::
set_page_border_padding_left
(
int
offset_type
,
double
length_pt
)
void
odf_page_layout_context
::
set_page_border_padding_left
(
int
offset_type
,
int
type
,
double
length_pt
)
{
if
(
type
<
1
)
return
;
style_page_layout_properties
*
props
=
get_properties
();
if
(
!
props
)
return
;
...
...
@@ -479,8 +488,10 @@ void odf_page_layout_context::set_page_border_padding_left(int offset_type, doub
}
void
odf_page_layout_context
::
set_page_border_padding_right
(
int
offset_type
,
double
length_pt
)
void
odf_page_layout_context
::
set_page_border_padding_right
(
int
offset_type
,
int
type
,
double
length_pt
)
{
if
(
type
<
1
)
return
;
style_page_layout_properties
*
props
=
get_properties
();
if
(
!
props
)
return
;
...
...
ASCOfficeOdfFileW/source/OdfFormat/odf_page_layout_context.h
View file @
21012285
...
...
@@ -76,33 +76,34 @@ public:
odf_style_context
*
get_local_styles_context
()
//для автоматических стилей самих стилей
{
return
local_style_context_
.
get
();}
void
set_page_margin
(
_CP_OPT
(
double
)
top
,
_CP_OPT
(
double
)
left
,
_CP_OPT
(
double
)
bottom
,
_CP_OPT
(
double
)
right
,
_CP_OPT
(
double
)
header
,
_CP_OPT
(
double
)
footer
);
void
set_page_margin
(
_CP_OPT
(
odf_types
::
length
)
top
,
_CP_OPT
(
odf_types
::
length
)
left
,
_CP_OPT
(
odf_types
::
length
)
bottom
,
_CP_OPT
(
odf_types
::
length
)
right
);
void
set_page_gutter
(
_CP_OPT
(
odf_types
::
length
)
length_
);
void
set_page_margin
(
_CP_OPT
(
double
)
top
,
_CP_OPT
(
double
)
left
,
_CP_OPT
(
double
)
bottom
,
_CP_OPT
(
double
)
right
,
_CP_OPT
(
double
)
header
,
_CP_OPT
(
double
)
footer
);
void
set_page_margin
(
_CP_OPT
(
odf_types
::
length
)
top
,
_CP_OPT
(
odf_types
::
length
)
left
,
_CP_OPT
(
odf_types
::
length
)
bottom
,
_CP_OPT
(
odf_types
::
length
)
right
);
void
set_page_gutter
(
_CP_OPT
(
odf_types
::
length
)
length_
);
void
set_page_border
(
std
::
wstring
top
,
std
::
wstring
left
,
std
::
wstring
bottom
,
std
::
wstring
right
);
void
set_page_border_shadow
(
bool
val
);
void
set_page_border
(
std
::
wstring
top
,
std
::
wstring
left
,
std
::
wstring
bottom
,
std
::
wstring
right
);
void
set_page_border_shadow
(
bool
val
);
void
set_page_border_padding_bottom
(
int
offset_
type
,
double
length_pt
);
void
set_page_border_padding_top
(
int
offset_
type
,
double
length_pt
);
void
set_page_border_padding_left
(
int
offset_
type
,
double
length_pt
);
void
set_page_border_padding_right
(
int
offset_
type
,
double
length_pt
);
void
set_page_border_padding_bottom
(
int
offset_type
,
int
type
,
double
length_pt
);
void
set_page_border_padding_top
(
int
offset_type
,
int
type
,
double
length_pt
);
void
set_page_border_padding_left
(
int
offset_type
,
int
type
,
double
length_pt
);
void
set_page_border_padding_right
(
int
offset_type
,
int
type
,
double
length_pt
);
void
set_page_orientation
(
int
type
);
void
set_page_size
(
_CP_OPT
(
odf_types
::
length
)
width
,
_CP_OPT
(
odf_types
::
length
)
height
);
void
set_page_orientation
(
int
type
);
void
set_page_size
(
_CP_OPT
(
odf_types
::
length
)
width
,
_CP_OPT
(
odf_types
::
length
)
height
);
void
set_title_page_enable
(
bool
val
);
void
set_pages_mirrored
(
bool
val
);
void
set_even_and_left_headers
(
bool
val
);
void
set_title_page_enable
(
bool
val
);
void
set_pages_mirrored
(
bool
val
);
void
set_even_and_left_headers
(
bool
val
);
bool
add_footer
(
int
type
);
void
set_footer_size
(
_CP_OPT
(
odf_types
::
length
)
length_
);
bool
add_header
(
int
type
);
bool
add_header
(
int
type
);
void
set_header_size
(
_CP_OPT
(
odf_types
::
length
)
length_
);
void
set_background
(
_CP_OPT
(
odf_types
::
color
)
&
color
,
int
type
);
void
set_background
(
_CP_OPT
(
odf_types
::
color
)
&
color
,
int
type
);
void
set_page_number_format
(
_CP_OPT
(
int
)
&
type
,
_CP_OPT
(
int
)
&
start
);
void
set_page_number_format
(
_CP_OPT
(
int
)
&
type
,
_CP_OPT
(
int
)
&
start
);
double
current_page_width_
;
private:
...
...
ASCOfficeOdfFileW/source/Oox2OdfConverter/DocxConverter.cpp
View file @
21012285
...
...
@@ -1053,14 +1053,34 @@ void DocxConverter::convert(OOX::Logic::CSectionProperty *oox_section_pr, bool r
if
(
oox_section_pr
->
m_oPgBorders
->
m_oOffsetFrom
.
IsInit
()
&&
(
oox_section_pr
->
m_oPgBorders
->
m_oOffsetFrom
->
GetValue
()
==
SimpleTypes
::
pageborderoffsetPage
))
border_offset
=
2
;
if
(
oox_section_pr
->
m_oPgBorders
->
m_oBottom
.
IsInit
()
&&
oox_section_pr
->
m_oPgBorders
->
m_oBottom
->
m_oSpace
.
IsInit
())
odt_context
->
page_layout_context
()
->
set_page_border_padding_bottom
(
border_offset
,
oox_section_pr
->
m_oPgBorders
->
m_oBottom
->
m_oSpace
->
ToPoints
());
if
(
oox_section_pr
->
m_oPgBorders
->
m_oTop
.
IsInit
()
&&
oox_section_pr
->
m_oPgBorders
->
m_oTop
->
m_oSpace
.
IsInit
())
odt_context
->
page_layout_context
()
->
set_page_border_padding_top
(
border_offset
,
oox_section_pr
->
m_oPgBorders
->
m_oTop
->
m_oSpace
->
ToPoints
());
if
(
oox_section_pr
->
m_oPgBorders
->
m_oLeft
.
IsInit
()
&&
oox_section_pr
->
m_oPgBorders
->
m_oLeft
->
m_oSpace
.
IsInit
())
odt_context
->
page_layout_context
()
->
set_page_border_padding_left
(
border_offset
,
oox_section_pr
->
m_oPgBorders
->
m_oLeft
->
m_oSpace
->
ToPoints
());
if
(
oox_section_pr
->
m_oPgBorders
->
m_oRight
.
IsInit
()
&&
oox_section_pr
->
m_oPgBorders
->
m_oRight
->
m_oSpace
.
IsInit
())
odt_context
->
page_layout_context
()
->
set_page_border_padding_right
(
border_offset
,
oox_section_pr
->
m_oPgBorders
->
m_oRight
->
m_oSpace
->
ToPoints
());
if
(
oox_section_pr
->
m_oPgBorders
->
m_oBottom
.
IsInit
())
{
int
type
=
(
oox_section_pr
->
m_oPgBorders
->
m_oBottom
->
m_oVal
.
IsInit
()
?
oox_section_pr
->
m_oPgBorders
->
m_oBottom
->
m_oVal
->
GetValue
()
:
SimpleTypes
::
bordervalueSingle
);
if
(
oox_section_pr
->
m_oPgBorders
->
m_oBottom
->
m_oSpace
.
IsInit
())
odt_context
->
page_layout_context
()
->
set_page_border_padding_bottom
(
border_offset
,
type
,
oox_section_pr
->
m_oPgBorders
->
m_oBottom
->
m_oSpace
->
ToPoints
());
}
if
(
oox_section_pr
->
m_oPgBorders
->
m_oTop
.
IsInit
())
{
int
type
=
(
oox_section_pr
->
m_oPgBorders
->
m_oBottom
->
m_oVal
.
IsInit
()
?
oox_section_pr
->
m_oPgBorders
->
m_oTop
->
m_oVal
->
GetValue
()
:
SimpleTypes
::
bordervalueSingle
);
if
(
oox_section_pr
->
m_oPgBorders
->
m_oTop
->
m_oSpace
.
IsInit
())
odt_context
->
page_layout_context
()
->
set_page_border_padding_top
(
border_offset
,
type
,
oox_section_pr
->
m_oPgBorders
->
m_oTop
->
m_oSpace
->
ToPoints
());
}
if
(
oox_section_pr
->
m_oPgBorders
->
m_oLeft
.
IsInit
())
{
int
type
=
(
oox_section_pr
->
m_oPgBorders
->
m_oBottom
->
m_oVal
.
IsInit
()
?
oox_section_pr
->
m_oPgBorders
->
m_oLeft
->
m_oVal
->
GetValue
()
:
SimpleTypes
::
bordervalueSingle
);
if
(
oox_section_pr
->
m_oPgBorders
->
m_oLeft
->
m_oSpace
.
IsInit
())
odt_context
->
page_layout_context
()
->
set_page_border_padding_left
(
border_offset
,
type
,
oox_section_pr
->
m_oPgBorders
->
m_oLeft
->
m_oSpace
->
ToPoints
());
}
if
(
oox_section_pr
->
m_oPgBorders
->
m_oRight
.
IsInit
())
{
int
type
=
(
oox_section_pr
->
m_oPgBorders
->
m_oBottom
->
m_oVal
.
IsInit
()
?
oox_section_pr
->
m_oPgBorders
->
m_oRight
->
m_oVal
->
GetValue
()
:
SimpleTypes
::
bordervalueSingle
);
if
(
oox_section_pr
->
m_oPgBorders
->
m_oRight
->
m_oSpace
.
IsInit
())
odt_context
->
page_layout_context
()
->
set_page_border_padding_right
(
border_offset
,
type
,
oox_section_pr
->
m_oPgBorders
->
m_oRight
->
m_oSpace
->
ToPoints
());
}
bool
shadow
=
false
;
...
...
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