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
bf33aed8
Commit
bf33aed8
authored
Feb 06, 2017
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix convert oox group shape to vml group shape
parent
5869c7a0
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
255 additions
and
348 deletions
+255
-348
ASCOfficePPTXFile/Editor/Drawing/Shapes/Shape.h
ASCOfficePPTXFile/Editor/Drawing/Shapes/Shape.h
+13
-14
ASCOfficePPTXFile/PPTXFormat/Logic/Pic.cpp
ASCOfficePPTXFile/PPTXFormat/Logic/Pic.cpp
+76
-67
ASCOfficePPTXFile/PPTXFormat/Logic/Pic.h
ASCOfficePPTXFile/PPTXFormat/Logic/Pic.h
+1
-1
ASCOfficePPTXFile/PPTXFormat/Logic/Shape.cpp
ASCOfficePPTXFile/PPTXFormat/Logic/Shape.cpp
+119
-228
ASCOfficePPTXFile/PPTXFormat/Logic/Shape.h
ASCOfficePPTXFile/PPTXFormat/Logic/Shape.h
+1
-1
ASCOfficePPTXFile/PPTXFormat/Logic/SpTree.cpp
ASCOfficePPTXFile/PPTXFormat/Logic/SpTree.cpp
+33
-36
ASCOfficePPTXFile/PPTXFormat/Logic/SpTree.h
ASCOfficePPTXFile/PPTXFormat/Logic/SpTree.h
+1
-1
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXDrawingGraphicReader.cpp
...le/RtfFormatLib/source/Reader/OOXDrawingGraphicReader.cpp
+11
-0
No files found.
ASCOfficePPTXFile/Editor/Drawing/Shapes/Shape.h
View file @
bf33aed8
...
...
@@ -395,7 +395,6 @@ public:
SetPen
(
root
);
SetBrush
(
root
);
//return m_pShape->LoadFromXML(xml);
return
((
CPPTShape
*
)
m_pShape
)
->
LoadFromXML
(
root
);
}
#endif
...
...
@@ -439,20 +438,20 @@ public:
XmlUtils
::
CXmlNode
oNodeTemplate
;
if
(
oNodePict
.
GetNode
(
_T
(
"stroke"
),
oNodeTemplate
))
{
std
::
wstring
strColor
=
oNodeTemplate
.
GetAttributeOrValue
(
_T
(
"strokecolor"
));
std
::
wstring
strColor
=
oNodeTemplate
.
GetAttributeOrValue
(
_T
(
"strokecolor"
));
//if (strColor != _T(""))
// m_oPen.Color.FromString(strColor);
//std::wstring strSize = oNodeTemplate.GetAttributeOrValue(_T("strokeweight"));
//std::wstring strSize = oNodeTemplate.GetAttributeOrValue(_T("strokeweight"));
//if (strSize != _T(""))
// m_oPen.Size = XmlUtils::GetDouble(strSize);
//std::wstring strStroke = oNodeTemplate.GetAttributeOrValue(_T("stroked"));
//std::wstring strStroke = oNodeTemplate.GetAttributeOrValue(_T("stroked"));
//if (strStroke != _T(""))
// m_oPen.Alpha = 0;
}
if
(
oNodePict
.
GetNode
(
_T
(
"v:stroke"
),
oNodeTemplate
))
{
std
::
wstring
strColor
=
oNodeTemplate
.
GetAttributeOrValue
(
_T
(
"dashstyle"
));
std
::
wstring
strColor
=
oNodeTemplate
.
GetAttributeOrValue
(
_T
(
"dashstyle"
));
//if (strColor != _T(""))
// m_oPen.DashStyle = XmlUtils::GetInteger(strColor);
}
...
...
@@ -463,7 +462,7 @@ public:
XmlUtils
::
CXmlNode
oNodeTemplate
;
if
(
oNodePict
.
GetNode
(
_T
(
"fillcolor"
),
oNodeTemplate
))
{
std
::
wstring
strColor
=
oNodeTemplate
.
GetAttributeOrValue
(
_T
(
"val"
));
std
::
wstring
strColor
=
oNodeTemplate
.
GetAttributeOrValue
(
_T
(
"val"
));
//if (strColor != _T(""))
// m_oBrush.Color1.FromString(strColor);
}
...
...
@@ -476,19 +475,19 @@ public:
XmlUtils
::
CXmlNode
oNodeTemplate
;
if
(
oNodePict
.
GetNode
(
_T
(
"coordsize"
),
oNodeTemplate
))
{
std
::
wstring
strCoordSize
=
oNodeTemplate
.
GetAttributeOrValue
(
_T
(
"val"
));
std
::
wstring
strCoordSize
=
oNodeTemplate
.
GetAttributeOrValue
(
_T
(
"val"
));
if
(
strCoordSize
!=
_T
(
""
))
{
std
::
vector
<
std
::
wstring
>
oArray
;
boost
::
algorithm
::
split
(
oArray
,
strCoordSize
,
boost
::
algorithm
::
is_any_of
(
L","
),
boost
::
algorithm
::
token_compress_on
);
std
::
vector
<
std
::
wstring
>
oArray
;
boost
::
algorithm
::
split
(
oArray
,
strCoordSize
,
boost
::
algorithm
::
is_any_of
(
L","
),
boost
::
algorithm
::
token_compress_on
);
m_dWidthLogic
=
XmlUtils
::
GetInteger
(
oArray
[
0
]);
m_dWidthLogic
=
XmlUtils
::
GetInteger
(
oArray
[
0
]);
m_dHeightLogic
=
XmlUtils
::
GetInteger
(
oArray
[
1
]);
}
}
else
{
std
::
wstring
id
=
oNodePict
.
GetAttributeOrValue
(
_T
(
"type"
));
std
::
wstring
id
=
oNodePict
.
GetAttributeOrValue
(
_T
(
"type"
));
if
(
id
!=
_T
(
""
))
{
m_dWidthLogic
=
21600
;
...
...
@@ -499,11 +498,11 @@ public:
XmlUtils
::
CXmlNode
oNodeTemplate
;
if
(
oNodePict
.
GetNode
(
_T
(
"template"
),
oNodeTemplate
))
{
std
::
wstring
strCoordSize
=
oNodeTemplate
.
GetAttributeOrValue
(
_T
(
"coordsize"
));
std
::
wstring
strCoordSize
=
oNodeTemplate
.
GetAttributeOrValue
(
_T
(
"coordsize"
));
if
(
strCoordSize
!=
_T
(
""
))
{
std
::
vector
<
std
::
wstring
>
oArray
;
boost
::
algorithm
::
split
(
oArray
,
strCoordSize
,
boost
::
algorithm
::
is_any_of
(
L","
),
boost
::
algorithm
::
token_compress_on
);
std
::
vector
<
std
::
wstring
>
oArray
;
boost
::
algorithm
::
split
(
oArray
,
strCoordSize
,
boost
::
algorithm
::
is_any_of
(
L","
),
boost
::
algorithm
::
token_compress_on
);
m_dWidthLogic
=
XmlUtils
::
GetInteger
(
oArray
[
0
]);
m_dHeightLogic
=
XmlUtils
::
GetInteger
(
oArray
[
1
]);
...
...
ASCOfficePPTXFile/PPTXFormat/Logic/Pic.cpp
View file @
bf33aed8
This diff is collapsed.
Click to expand it.
ASCOfficePPTXFile/PPTXFormat/Logic/Pic.h
View file @
bf33aed8
...
...
@@ -399,7 +399,7 @@ namespace PPTX
pReader
->
Seek
(
_end_rec
);
}
void
toXmlWriterVML
(
NSBinPptxRW
::
CXmlWriter
*
pWriter
,
smart_ptr
<
PPTX
::
WrapperFile
>&
oTheme
,
smart_ptr
<
PPTX
::
WrapperWritingElement
>&
oClrMap
);
void
toXmlWriterVML
(
NSBinPptxRW
::
CXmlWriter
*
pWriter
,
smart_ptr
<
PPTX
::
WrapperFile
>&
oTheme
,
smart_ptr
<
PPTX
::
WrapperWritingElement
>&
oClrMap
,
bool
in_group
=
false
);
void
fromXMLOle
(
XmlUtils
::
CXmlNode
&
node
);
public:
...
...
ASCOfficePPTXFile/PPTXFormat/Logic/Shape.cpp
View file @
bf33aed8
This diff is collapsed.
Click to expand it.
ASCOfficePPTXFile/PPTXFormat/Logic/Shape.h
View file @
bf33aed8
...
...
@@ -136,7 +136,7 @@ namespace PPTX
pWriter
->
EndRecord
();
}
void
toXmlWriterVML
(
NSBinPptxRW
::
CXmlWriter
*
pWriter
,
smart_ptr
<
PPTX
::
WrapperFile
>&
oTheme
,
smart_ptr
<
PPTX
::
WrapperWritingElement
>&
oClrMap
);
void
toXmlWriterVML
(
NSBinPptxRW
::
CXmlWriter
*
pWriter
,
smart_ptr
<
PPTX
::
WrapperFile
>&
oTheme
,
smart_ptr
<
PPTX
::
WrapperWritingElement
>&
oClrMap
,
bool
in_group
=
false
);
void
toXmlWriterVMLBackground
(
NSBinPptxRW
::
CXmlWriter
*
pWriter
,
NSCommon
::
smart_ptr
<
PPTX
::
WrapperFile
>&
oTheme
,
NSCommon
::
smart_ptr
<
PPTX
::
WrapperWritingElement
>&
oClrMap
);
virtual
void
toXmlWriter
(
NSBinPptxRW
::
CXmlWriter
*
pWriter
)
const
...
...
ASCOfficePPTXFile/PPTXFormat/Logic/SpTree.cpp
View file @
bf33aed8
...
...
@@ -41,7 +41,7 @@ namespace PPTX
{
namespace
Logic
{
void
SpTree
::
toXmlWriterVML
(
NSBinPptxRW
::
CXmlWriter
*
pWriter
,
NSCommon
::
smart_ptr
<
PPTX
::
WrapperFile
>&
_oTheme
,
NSCommon
::
smart_ptr
<
PPTX
::
WrapperWritingElement
>&
_oClrMap
)
void
SpTree
::
toXmlWriterVML
(
NSBinPptxRW
::
CXmlWriter
*
pWriter
,
NSCommon
::
smart_ptr
<
PPTX
::
WrapperFile
>&
_oTheme
,
NSCommon
::
smart_ptr
<
PPTX
::
WrapperWritingElement
>&
_oClrMap
,
bool
in_group
)
{
smart_ptr
<
PPTX
::
Theme
>
oTheme
=
_oTheme
.
smart_dynamic_cast
<
PPTX
::
Theme
>
();
smart_ptr
<
PPTX
::
Logic
::
ClrMap
>
oClrMap
=
oTheme
.
smart_dynamic_cast
<
PPTX
::
Logic
::
ClrMap
>
();
...
...
@@ -95,28 +95,31 @@ namespace PPTX
}
else
{
int
dL
=
0
;
int
dT
=
0
;
int
dW
=
0
;
int
dH
=
0
;
int
dL
=
0
,
dT
=
0
,
dW
=
0
,
dH
=
0
;
if
(
grpSpPr
.
xfrm
.
is_init
())
{
if
(
grpSpPr
.
xfrm
->
offX
.
is_init
())
dL
=
(
*
grpSpPr
.
xfrm
->
offX
)
/
12700.
;
if
(
grpSpPr
.
xfrm
->
offY
.
is_init
())
dT
=
(
*
grpSpPr
.
xfrm
->
offY
)
/
12700.
;
if
(
grpSpPr
.
xfrm
->
extX
.
is_init
())
dW
=
(
*
grpSpPr
.
xfrm
->
extX
)
/
12700.
;
if
(
grpSpPr
.
xfrm
->
extY
.
is_init
())
dH
=
(
*
grpSpPr
.
xfrm
->
extY
)
/
12700.
;
if
(
grpSpPr
.
xfrm
->
offX
.
is_init
())
dL
=
*
grpSpPr
.
xfrm
->
offX
;
if
(
grpSpPr
.
xfrm
->
offY
.
is_init
())
dT
=
*
grpSpPr
.
xfrm
->
offY
;
if
(
grpSpPr
.
xfrm
->
extX
.
is_init
())
dW
=
*
grpSpPr
.
xfrm
->
extX
;
if
(
grpSpPr
.
xfrm
->
extY
.
is_init
())
dH
=
*
grpSpPr
.
xfrm
->
extY
;
}
oStylesWriter
.
ClearNoAttack
();
oStylesWriter
.
WriteAttributeCSS
(
L"position"
,
L"absolute"
);
oStylesWriter
.
WriteAttributeCSS_int_pt
(
L"left"
,
dL
);
oStylesWriter
.
WriteAttributeCSS_int_pt
(
L"top"
,
dT
);
oStylesWriter
.
WriteAttributeCSS_int_pt
(
L"width"
,
dW
);
oStylesWriter
.
WriteAttributeCSS_int_pt
(
L"height"
,
dH
);
if
(
in_group
)
{
oStylesWriter
.
WriteAttributeCSS_int
(
L"left"
,
dL
/
100.
);
oStylesWriter
.
WriteAttributeCSS_int
(
L"top"
,
dT
/
100.
);
oStylesWriter
.
WriteAttributeCSS_int
(
L"width"
,
dW
/
100.
);
oStylesWriter
.
WriteAttributeCSS_int
(
L"height"
,
dH
/
100.
);
}
else
{
oStylesWriter
.
WriteAttributeCSS_int_pt
(
L"left"
,
dL
/
12700.
);
oStylesWriter
.
WriteAttributeCSS_int_pt
(
L"top"
,
dT
/
12700.
);
oStylesWriter
.
WriteAttributeCSS_int_pt
(
L"width"
,
dW
/
12700.
);
oStylesWriter
.
WriteAttributeCSS_int_pt
(
L"height"
,
dH
/
12700.
);
}
if
(
grpSpPr
.
xfrm
.
is_init
())
{
...
...
@@ -150,33 +153,27 @@ namespace PPTX
pWriter
->
m_strAttributesMain
.
clear
();
}
int
dL
=
0
;
int
dT
=
0
;
int
dW
=
0
;
int
dH
=
0
;
int
dL
=
0
,
dT
=
0
,
dW
=
0
,
dH
=
0
;
if
(
grpSpPr
.
xfrm
.
is_init
())
{
if
(
grpSpPr
.
xfrm
->
chOffX
.
is_init
())
dL
=
(
*
grpSpPr
.
xfrm
->
chOffX
)
/
12700.
;
if
(
grpSpPr
.
xfrm
->
chOffY
.
is_init
())
dT
=
(
*
grpSpPr
.
xfrm
->
chOffY
)
/
12700.
;
if
(
grpSpPr
.
xfrm
->
chExtX
.
is_init
())
dW
=
(
*
grpSpPr
.
xfrm
->
chExtX
)
/
12700.
;
if
(
grpSpPr
.
xfrm
->
chExtY
.
is_init
())
dH
=
(
*
grpSpPr
.
xfrm
->
chExtY
)
/
12700.
;
if
(
grpSpPr
.
xfrm
->
chOffX
.
is_init
())
dL
=
*
grpSpPr
.
xfrm
->
chOffX
;
if
(
grpSpPr
.
xfrm
->
chOffY
.
is_init
())
dT
=
*
grpSpPr
.
xfrm
->
chOffY
;
if
(
grpSpPr
.
xfrm
->
chExtX
.
is_init
())
dW
=
*
grpSpPr
.
xfrm
->
chExtX
;
if
(
grpSpPr
.
xfrm
->
chExtY
.
is_init
())
dH
=
*
grpSpPr
.
xfrm
->
chExtY
;
}
oStylesWriter
.
ClearNoAttack
();
oStylesWriter
.
m_oWriter
.
AddSize
(
30
);
oStylesWriter
.
m_oWriter
.
AddIntNoCheck
(
dL
);
oStylesWriter
.
m_oWriter
.
AddIntNoCheck
(
dL
/
100.
);
oStylesWriter
.
m_oWriter
.
AddCharNoCheck
(
WCHAR
(
','
));
oStylesWriter
.
m_oWriter
.
AddIntNoCheck
(
dT
);
oStylesWriter
.
m_oWriter
.
AddIntNoCheck
(
dT
/
100.
);
pWriter
->
WriteAttribute
(
_T
(
"coordorigin"
),
oStylesWriter
.
GetXmlString
());
oStylesWriter
.
ClearNoAttack
();
oStylesWriter
.
m_oWriter
.
AddSize
(
30
);
oStylesWriter
.
m_oWriter
.
AddIntNoCheck
(
dW
);
oStylesWriter
.
m_oWriter
.
AddIntNoCheck
(
dW
/
100.
);
oStylesWriter
.
m_oWriter
.
AddCharNoCheck
(
WCHAR
(
','
));
oStylesWriter
.
m_oWriter
.
AddIntNoCheck
(
dH
);
oStylesWriter
.
m_oWriter
.
AddIntNoCheck
(
dH
/
100.
);
pWriter
->
WriteAttribute
(
_T
(
"coordsize"
),
oStylesWriter
.
GetXmlString
());
pWriter
->
EndAttributes
();
...
...
@@ -186,15 +183,15 @@ namespace PPTX
{
if
(
SpTreeElems
[
i
].
is
<
PPTX
::
Logic
::
Shape
>
())
{
SpTreeElems
[
i
].
as
<
PPTX
::
Logic
::
Shape
>
().
toXmlWriterVML
(
pWriter
,
_oTheme
,
_oClrMap
);
SpTreeElems
[
i
].
as
<
PPTX
::
Logic
::
Shape
>
().
toXmlWriterVML
(
pWriter
,
_oTheme
,
_oClrMap
,
true
);
}
else
if
(
SpTreeElems
[
i
].
is
<
PPTX
::
Logic
::
Pic
>
())
{
SpTreeElems
[
i
].
as
<
PPTX
::
Logic
::
Pic
>
().
toXmlWriterVML
(
pWriter
,
_oTheme
,
_oClrMap
);
SpTreeElems
[
i
].
as
<
PPTX
::
Logic
::
Pic
>
().
toXmlWriterVML
(
pWriter
,
_oTheme
,
_oClrMap
,
true
);
}
else
if
(
SpTreeElems
[
i
].
is
<
PPTX
::
Logic
::
SpTree
>
())
{
SpTreeElems
[
i
].
as
<
PPTX
::
Logic
::
SpTree
>
().
toXmlWriterVML
(
pWriter
,
_oTheme
,
_oClrMap
);
SpTreeElems
[
i
].
as
<
PPTX
::
Logic
::
SpTree
>
().
toXmlWriterVML
(
pWriter
,
_oTheme
,
_oClrMap
,
true
);
}
}
...
...
ASCOfficePPTXFile/PPTXFormat/Logic/SpTree.h
View file @
bf33aed8
...
...
@@ -121,7 +121,7 @@ namespace PPTX
return
XmlUtils
::
CreateNode
(
m_name
,
oValue
);
}
void
toXmlWriterVML
(
NSBinPptxRW
::
CXmlWriter
*
pWriter
,
smart_ptr
<
PPTX
::
WrapperFile
>&
oTheme
,
smart_ptr
<
PPTX
::
WrapperWritingElement
>&
oClrMap
);
void
toXmlWriterVML
(
NSBinPptxRW
::
CXmlWriter
*
pWriter
,
smart_ptr
<
PPTX
::
WrapperFile
>&
oTheme
,
smart_ptr
<
PPTX
::
WrapperWritingElement
>&
oClrMap
,
bool
in_group
=
false
);
virtual
void
toXmlWriter
(
NSBinPptxRW
::
CXmlWriter
*
pWriter
)
const
{
...
...
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXDrawingGraphicReader.cpp
View file @
bf33aed8
...
...
@@ -34,6 +34,7 @@
#include "OOXDrawingGraphicReader.h"
#include "../../../../ASCOfficePPTXFile/ASCOfficeDrawingConverter.h"
#include "../../../../ASCOfficePPTXFile/PPTXFormat/Theme.h"
bool
OOXPictureGraphicReader
::
Parse
(
ReaderParameter
oParam
,
RtfShape
&
oOutput
)
{
...
...
@@ -89,6 +90,16 @@ OOX::Logic::CPicture * OOXDrawingGraphicReader::Parse( ReaderParameter oParam ,
{
NSBinPptxRW
::
CDrawingConverter
drawingConverter
;
OOX
::
CTheme
*
pTheme
=
oParam
.
oDocx
->
GetTheme
();
if
(
pTheme
)
{
NSCommon
::
smart_ptr
<
PPTX
::
Theme
>
theme
(
new
PPTX
::
Theme
());
PPTX
::
FileMap
map
;
theme
->
read
(
pTheme
->
m_oReadPath
,
map
);
(
*
drawingConverter
.
m_pTheme
)
=
theme
.
smart_dynamic_cast
<
PPTX
::
WrapperFile
>
();
}
drawingConverter
.
SetRelsPath
(
oParam
.
oDocx
->
m_pDocument
->
m_oReadPath
.
GetPath
());
std
::
wstring
sVmlXml
=
drawingConverter
.
ConvertObjectToVml
(
m_sXml
);
...
...
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