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
b41b5edb
Commit
b41b5edb
authored
Oct 11, 2016
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DocxFormatRead - fix vml shape
parent
695c38c8
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
468 additions
and
337 deletions
+468
-337
ASCOfficeOdfFileW/source/OdfFormat/odf_drawing_context.h
ASCOfficeOdfFileW/source/OdfFormat/odf_drawing_context.h
+83
-77
ASCOfficeOdfFileW/source/Oox2OdfConverter/ConvertVml.cpp
ASCOfficeOdfFileW/source/Oox2OdfConverter/ConvertVml.cpp
+13
-1
ASCOfficeOdfFileW/source/Oox2OdfConverter/DocxConverter.cpp
ASCOfficeOdfFileW/source/Oox2OdfConverter/DocxConverter.cpp
+36
-2
ASCOfficeOdfFileW/win32/ASCOfficeOdfFileW.sln
ASCOfficeOdfFileW/win32/ASCOfficeOdfFileW.sln
+82
-15
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXBorderReader.h
...fficeRtfFile/RtfFormatLib/source/Reader/OOXBorderReader.h
+222
-218
ASCOfficeRtfFile/RtfFormatLib/source/RtfSection.cpp
ASCOfficeRtfFile/RtfFormatLib/source/RtfSection.cpp
+21
-20
Common/DocxFormat/Source/Common/SimpleTypes_Vml.h
Common/DocxFormat/Source/Common/SimpleTypes_Vml.h
+9
-2
Common/DocxFormat/Source/DocxFormat/Logic/Vml.h
Common/DocxFormat/Source/DocxFormat/Logic/Vml.h
+2
-2
No files found.
ASCOfficeOdfFileW/source/OdfFormat/odf_drawing_context.h
View file @
b41b5edb
This diff is collapsed.
Click to expand it.
ASCOfficeOdfFileW/source/Oox2OdfConverter/ConvertVml.cpp
View file @
b41b5edb
...
@@ -55,7 +55,19 @@ void OoxConverter::convert(OOX::Vml::CShapeType *vml_shape_type)
...
@@ -55,7 +55,19 @@ void OoxConverter::convert(OOX::Vml::CShapeType *vml_shape_type)
if
(
vml_shape_type
==
NULL
)
return
;
if
(
vml_shape_type
==
NULL
)
return
;
//custom shape
//custom shape
//save cash to other shape with this type
if
(
vml_shape_type
->
m_sId
.
IsInit
())
{
std
::
wstring
sId
(
vml_shape_type
->
m_sId
.
get
());
if
(
odf_context
()
->
drawing_context
()
->
m_mapVmlShapeTypes
.
find
(
sId
)
==
odf_context
()
->
drawing_context
()
->
m_mapVmlShapeTypes
.
end
())
{
odf_context
()
->
drawing_context
()
->
m_mapVmlShapeTypes
.
insert
(
odf_context
()
->
drawing_context
()
->
m_mapVmlShapeTypes
.
begin
(),
std
::
pair
<
std
::
wstring
,
OOX
::
Vml
::
CShapeType
*>
(
sId
,
vml_shape_type
));
}
}
//m_oPreferRelative//типо можно менять размер
//m_oPreferRelative//типо можно менять размер
for
(
unsigned
int
i
=
0
;
i
<
vml_shape_type
->
m_arrItems
.
size
();
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
vml_shape_type
->
m_arrItems
.
size
();
i
++
)
...
...
ASCOfficeOdfFileW/source/Oox2OdfConverter/DocxConverter.cpp
View file @
b41b5edb
...
@@ -2042,10 +2042,13 @@ void DocxConverter::convert(OOX::Logic::CPicture* oox_pic)
...
@@ -2042,10 +2042,13 @@ void DocxConverter::convert(OOX::Logic::CPicture* oox_pic)
else
// and oox_pic->m_oShapeRect
else
// and oox_pic->m_oShapeRect
{
{
bool
bSet
=
false
;
bool
bSet
=
false
;
OOX
::
Vml
::
CShapeType
*
shape_type
=
NULL
;
if
(
oox_pic
->
m_oShape
.
IsInit
())
if
(
oox_pic
->
m_oShape
.
IsInit
())
{
{
OOX
::
Vml
::
SptType
sptType
=
oox_pic
->
m_oShapeType
->
m_oSpt
.
IsInit
()
?
static_cast
<
OOX
::
Vml
::
SptType
>
(
oox_pic
->
m_oShapeType
->
m_oSpt
->
GetValue
())
:
OOX
::
Vml
::
sptNotPrimitive
;
OOX
::
Vml
::
SptType
sptType
=
oox_pic
->
m_oShape
->
m_oSpt
.
IsInit
()
?
static_cast
<
OOX
::
Vml
::
SptType
>
(
oox_pic
->
m_oShape
->
m_oSpt
->
GetValue
())
:
OOX
::
Vml
::
sptNotPrimitive
;
if
(
sptType
!=
OOX
::
Vml
::
SptType
::
sptNotPrimitive
)
if
(
sptType
!=
OOX
::
Vml
::
SptType
::
sptNotPrimitive
)
{
{
odf_context
()
->
drawing_context
()
->
set_name
(
std
::
wstring
(
L"Custom"
)
+
boost
::
lexical_cast
<
std
::
wstring
>
(
sptType
));
odf_context
()
->
drawing_context
()
->
set_name
(
std
::
wstring
(
L"Custom"
)
+
boost
::
lexical_cast
<
std
::
wstring
>
(
sptType
));
odf_context
()
->
drawing_context
()
->
start_shape
(
OOX
::
Spt2ShapeType
(
sptType
));
odf_context
()
->
drawing_context
()
->
start_shape
(
OOX
::
Spt2ShapeType
(
sptType
));
...
@@ -2065,12 +2068,43 @@ void DocxConverter::convert(OOX::Logic::CPicture* oox_pic)
...
@@ -2065,12 +2068,43 @@ void DocxConverter::convert(OOX::Logic::CPicture* oox_pic)
odf_context
()
->
drawing_context
()
->
set_line_width
(
1.
);
odf_context
()
->
drawing_context
()
->
set_line_width
(
1.
);
bSet
=
true
;
bSet
=
true
;
}
}
if
(
oox_pic
->
m_oShape
->
m_sType
.
IsInit
())
{
std
::
wstring
type
(
oox_pic
->
m_oShape
->
m_sType
.
get
());
type
=
type
.
substr
(
1
);
//without #
std
::
map
<
std
::
wstring
,
OOX
::
Vml
::
CShapeType
*>::
iterator
it
=
odf_context
()
->
drawing_context
()
->
m_mapVmlShapeTypes
.
find
(
type
);
if
(
it
!=
odf_context
()
->
drawing_context
()
->
m_mapVmlShapeTypes
.
end
())
{
shape_type
=
it
->
second
;
sptType
=
shape_type
->
m_oSpt
.
IsInit
()
?
static_cast
<
OOX
::
Vml
::
SptType
>
(
shape_type
->
m_oSpt
->
GetValue
())
:
OOX
::
Vml
::
sptNotPrimitive
;
if
(
!
bSet
&&
sptType
!=
OOX
::
Vml
::
SptType
::
sptNotPrimitive
)
{
odf_context
()
->
drawing_context
()
->
start_shape
(
OOX
::
Spt2ShapeType
(
sptType
));
bSet
=
true
;
}
}
if
(
!
bSet
)
{
int
pos
=
oox_pic
->
m_oShape
->
m_sType
->
Find
(
_T
(
"#_x0000_t"
));
if
(
pos
>=
0
)
{
sptType
=
(
OOX
::
Vml
::
SptType
)
_wtoi
(
oox_pic
->
m_oShape
->
m_sType
->
Mid
(
pos
+
9
,
oox_pic
->
m_oShape
->
m_sType
->
GetLength
()
-
pos
-
9
).
GetString
());
odf_context
()
->
drawing_context
()
->
start_shape
(
OOX
::
Spt2ShapeType
(
sptType
));
bSet
=
true
;
}
}
}
}
}
if
(
!
bSet
)
if
(
!
bSet
)
{
{
odf_context
()
->
drawing_context
()
->
set_name
(
L"Rect"
);
odf_context
()
->
drawing_context
()
->
set_name
(
L"Rect"
);
odf_context
()
->
drawing_context
()
->
start_shape
(
SimpleTypes
::
shapetypeRect
);
odf_context
()
->
drawing_context
()
->
start_shape
(
SimpleTypes
::
shapetypeRect
);
}
}
OoxConverter
::
convert
(
shape_type
);
OoxConverter
::
convert
(
oox_pic
->
m_oShape
.
GetPointer
());
OoxConverter
::
convert
(
oox_pic
->
m_oShape
.
GetPointer
());
odf_context
()
->
drawing_context
()
->
end_shape
();
odf_context
()
->
drawing_context
()
->
end_shape
();
}
}
...
...
ASCOfficeOdfFileW/win32/ASCOfficeOdfFileW.sln
View file @
b41b5edb
This diff is collapsed.
Click to expand it.
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXBorderReader.h
View file @
b41b5edb
This diff is collapsed.
Click to expand it.
ASCOfficeRtfFile/RtfFormatLib/source/RtfSection.cpp
View file @
b41b5edb
...
@@ -395,27 +395,28 @@ CString RtfSectionProperty::RenderToRtf(RenderParameter oRenderParameter)
...
@@ -395,27 +395,28 @@ CString RtfSectionProperty::RenderToRtf(RenderParameter oRenderParameter)
if
(
RENDER_TO_OOX_PARAM_FIRST_SECTION
!=
oRenderParameter
.
nType
)
//Пишем как свойства секции
if
(
RENDER_TO_OOX_PARAM_FIRST_SECTION
!=
oRenderParameter
.
nType
)
//Пишем как свойства секции
{
{
//Page Information
//Page Information
RENDER_RTF_INT
(
m_nPageWidth
,
sResult
,
_T
(
"pgwsxn"
)
)
RENDER_RTF_INT
(
m_nPageWidth
,
sResult
,
_T
(
"pgwsxn"
)
)
RENDER_RTF_INT
(
m_nPageHeight
,
sResult
,
_T
(
"pghsxn"
)
)
RENDER_RTF_INT
(
m_nPageHeight
,
sResult
,
_T
(
"pghsxn"
)
)
RENDER_RTF_INT
(
m_nMarginLeft
,
sResult
,
_T
(
"marglsxn"
)
)
RENDER_RTF_INT
(
m_nMarginLeft
,
sResult
,
_T
(
"marglsxn"
)
)
RENDER_RTF_INT
(
m_nMarginRight
,
sResult
,
_T
(
"margrsxn"
)
)
RENDER_RTF_INT
(
m_nMarginRight
,
sResult
,
_T
(
"margrsxn"
)
)
RENDER_RTF_INT
(
m_nMarginTop
,
sResult
,
_T
(
"margtsxn"
)
)
RENDER_RTF_INT
(
m_nMarginTop
,
sResult
,
_T
(
"margtsxn"
)
)
RENDER_RTF_INT
(
m_nMarginBottom
,
sResult
,
_T
(
"margbsxn"
)
)
RENDER_RTF_INT
(
m_nMarginBottom
,
sResult
,
_T
(
"margbsxn"
)
)
RENDER_RTF_INT
(
m_nGutterMarginWidth
,
sResult
,
_T
(
"guttersxn"
)
)
RENDER_RTF_INT
(
m_nGutterMarginWidth
,
sResult
,
_T
(
"guttersxn"
)
)
RENDER_RTF_BOOL
(
m_bSwitchMargin
,
sResult
,
_T
(
"margmirsxn"
)
)
RENDER_RTF_BOOL
(
m_bSwitchMargin
,
sResult
,
_T
(
"margmirsxn"
)
)
RENDER_RTF_BOOL
(
m_bLandscapeFormat
,
sResult
,
_T
(
"lndscpsxn"
)
)
RENDER_RTF_BOOL
(
m_bLandscapeFormat
,
sResult
,
_T
(
"lndscpsxn"
)
)
}
}
RENDER_RTF_BOOL
(
m_bTitlePage
,
sResult
,
_T
(
"titlepg"
)
)
RENDER_RTF_BOOL
(
m_bTitlePage
,
sResult
,
_T
(
"titlepg"
)
)
RENDER_RTF_INT
(
m_nHeaderTop
,
sResult
,
_T
(
"headery"
)
)
RENDER_RTF_INT
(
m_nHeaderTop
,
sResult
,
_T
(
"headery"
)
)
RENDER_RTF_INT
(
m_nFooterBottom
,
sResult
,
_T
(
"footery"
)
)
RENDER_RTF_INT
(
m_nFooterBottom
,
sResult
,
_T
(
"footery"
)
)
//Page Numbers
//Page Numbers
RENDER_RTF_INT
(
m_nPageNumberStart
,
sResult
,
_T
(
"pgnstarts"
)
)
RENDER_RTF_INT
(
m_nPageNumberStart
,
sResult
,
_T
(
"pgnstarts"
)
)
RENDER_RTF_BOOL
(
m_bPageNumberContinuos
,
sResult
,
_T
(
"pgncont"
)
)
RENDER_RTF_BOOL
(
m_bPageNumberContinuos
,
sResult
,
_T
(
"pgncont"
)
)
RENDER_RTF_BOOL
(
m_bPageNumberRestart
,
sResult
,
_T
(
"pgnrestart"
)
)
RENDER_RTF_BOOL
(
m_bPageNumberRestart
,
sResult
,
_T
(
"pgnrestart"
)
)
RENDER_RTF_INT
(
m_nPageNumberX
,
sResult
,
_T
(
"pgnx"
)
)
RENDER_RTF_INT
(
m_nPageNumberX
,
sResult
,
_T
(
"pgnx"
)
)
RENDER_RTF_INT
(
m_nPageNumberY
,
sResult
,
_T
(
"pgny"
)
)
RENDER_RTF_INT
(
m_nPageNumberY
,
sResult
,
_T
(
"pgny"
)
)
switch
(
m_ePageNumberFormat
)
switch
(
m_ePageNumberFormat
)
{
{
case
pnf_pgndec
:
sResult
+=
_T
(
"
\\
pgndec"
);
break
;
case
pnf_pgndec
:
sResult
+=
_T
(
"
\\
pgndec"
);
break
;
...
@@ -456,9 +457,9 @@ CString RtfSectionProperty::RenderToRtf(RenderParameter oRenderParameter)
...
@@ -456,9 +457,9 @@ CString RtfSectionProperty::RenderToRtf(RenderParameter oRenderParameter)
sResult
+=
_T
(
"
\\
pgbrdrb"
);
sResult
+=
_T
(
"
\\
pgbrdrb"
);
sResult
+=
m_oBorderBottom
.
RenderToRtf
(
oRenderParameter
);
sResult
+=
m_oBorderBottom
.
RenderToRtf
(
oRenderParameter
);
}
}
RENDER_RTF_INT
(
m_nBorderArt
,
sResult
,
_T
(
"brdrart"
)
)
RENDER_RTF_INT
(
m_nBorderArt
,
sResult
,
_T
(
"brdrart"
)
)
RENDER_RTF_INT
(
m_nBorderMeasure
,
sResult
,
_T
(
"pgbrdropt"
)
)
RENDER_RTF_INT
(
m_nBorderMeasure
,
sResult
,
_T
(
"pgbrdropt"
)
)
RENDER_RTF_INT
(
m_nBorderAlign
,
sResult
,
_T
(
"pgbrdrsnap"
)
)
RENDER_RTF_INT
(
m_nBorderAlign
,
sResult
,
_T
(
"pgbrdrsnap"
)
)
//footer - header
//footer - header
if
(
0
!=
m_oHeaderRight
)
if
(
0
!=
m_oHeaderRight
)
...
...
Common/DocxFormat/Source/Common/SimpleTypes_Vml.h
View file @
b41b5edb
...
@@ -2970,9 +2970,15 @@ namespace SimpleTypes
...
@@ -2970,9 +2970,15 @@ namespace SimpleTypes
return
0
;
return
0
;
int
nPos
=
sValue
.
Find
(
_T
(
","
)
);
int
nPos
=
sValue
.
Find
(
_T
(
","
)
);
if
(
-
1
==
nPos
)
if
(
-
1
==
nPos
)
return
0
;
{
//only x coord
sValue
.
Replace
(
_T
(
"@"
),
_T
(
""
));
m_nX
=
sValue
.
IsEmpty
()
?
0
:
_wtoi
(
sValue
);
}
else
{
CString
strX
=
sValue
.
Mid
(
0
,
nPos
);
CString
strX
=
sValue
.
Mid
(
0
,
nPos
);
CString
strY
=
sValue
.
Mid
(
nPos
+
1
,
nLen
-
nPos
-
1
)
;
CString
strY
=
sValue
.
Mid
(
nPos
+
1
,
nLen
-
nPos
-
1
)
;
...
@@ -2981,6 +2987,7 @@ namespace SimpleTypes
...
@@ -2981,6 +2987,7 @@ namespace SimpleTypes
m_nX
=
strX
.
IsEmpty
()
?
0
:
_wtoi
(
strX
);
m_nX
=
strX
.
IsEmpty
()
?
0
:
_wtoi
(
strX
);
m_nY
=
strY
.
IsEmpty
()
?
0
:
_wtoi
(
strY
);
m_nY
=
strY
.
IsEmpty
()
?
0
:
_wtoi
(
strY
);
}
return
0
;
return
0
;
}
}
...
...
Common/DocxFormat/Source/DocxFormat/Logic/Vml.h
View file @
b41b5edb
...
@@ -98,7 +98,7 @@ namespace OOX
...
@@ -98,7 +98,7 @@ namespace OOX
SimpleTypes
::
CTrueFalse
<
SimpleTypes
::
booleanFalse
>
m_oHrNoShade
;
SimpleTypes
::
CTrueFalse
<
SimpleTypes
::
booleanFalse
>
m_oHrNoShade
;
SimpleTypes
::
CDouble
m_oHrPct
;
SimpleTypes
::
CDouble
m_oHrPct
;
SimpleTypes
::
CHrAlign
<
SimpleTypes
::
hralignLeft
>
m_oHrAlign
;
SimpleTypes
::
CHrAlign
<
SimpleTypes
::
hralignLeft
>
m_oHrAlign
;
SimpleTypes
::
CTrueFalse
<
SimpleTypes
::
boolean
Tru
e
>
m_oAllowInCell
;
SimpleTypes
::
CTrueFalse
<
SimpleTypes
::
boolean
Fals
e
>
m_oAllowInCell
;
SimpleTypes
::
CTrueFalse
<
SimpleTypes
::
booleanTrue
>
m_oAllowOverlap
;
SimpleTypes
::
CTrueFalse
<
SimpleTypes
::
booleanTrue
>
m_oAllowOverlap
;
SimpleTypes
::
CTrueFalse
<
SimpleTypes
::
booleanFalse
>
m_oUserDrawn
;
SimpleTypes
::
CTrueFalse
<
SimpleTypes
::
booleanFalse
>
m_oUserDrawn
;
nullable
<
SimpleTypes
::
CColorType
<>>
m_oBorderTopColor
;
nullable
<
SimpleTypes
::
CColorType
<>>
m_oBorderTopColor
;
...
@@ -2897,7 +2897,7 @@ namespace OOX
...
@@ -2897,7 +2897,7 @@ namespace OOX
SimpleTypes
::
CDouble
m_oHrPct
;
SimpleTypes
::
CDouble
m_oHrPct
;
SimpleTypes
::
CHrAlign
<
SimpleTypes
::
hralignLeft
>
m_oHrAlign
;
SimpleTypes
::
CHrAlign
<
SimpleTypes
::
hralignLeft
>
m_oHrAlign
;
SimpleTypes
::
CTrueFalse
<
SimpleTypes
::
booleanFalse
>
m_oAllowInCell
;
SimpleTypes
::
CTrueFalse
<
SimpleTypes
::
booleanFalse
>
m_oAllowInCell
;
SimpleTypes
::
CTrueFalse
<
SimpleTypes
::
boolean
False
>
m_oAllowOverlap
;
SimpleTypes
::
CTrueFalse
<
SimpleTypes
::
boolean
True
>
m_oAllowOverlap
;
SimpleTypes
::
CTrueFalse
<
SimpleTypes
::
booleanFalse
>
m_oUserDrawn
;
SimpleTypes
::
CTrueFalse
<
SimpleTypes
::
booleanFalse
>
m_oUserDrawn
;
nullable
<
SimpleTypes
::
CColorType
<>>
m_oBorderTopColor
;
nullable
<
SimpleTypes
::
CColorType
<>>
m_oBorderTopColor
;
nullable
<
SimpleTypes
::
CColorType
<>>
m_oBorderLeftColor
;
nullable
<
SimpleTypes
::
CColorType
<>>
m_oBorderLeftColor
;
...
...
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