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
a63aa930
Commit
a63aa930
authored
Jan 20, 2017
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
XlsxFormat - fix users file with shape in VmlDrawing
parent
91cb5e89
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
129 additions
and
56 deletions
+129
-56
Common/DocxFormat/Source/DocxFormat/VmlDrawing.h
Common/DocxFormat/Source/DocxFormat/VmlDrawing.h
+57
-54
XlsxSerializerCom/Reader/BinaryWriter.h
XlsxSerializerCom/Reader/BinaryWriter.h
+72
-1
XlsxSerializerCom/Writer/BinaryReader.h
XlsxSerializerCom/Writer/BinaryReader.h
+0
-1
No files found.
Common/DocxFormat/Source/DocxFormat/VmlDrawing.h
View file @
a63aa930
This diff is collapsed.
Click to expand it.
XlsxSerializerCom/Reader/BinaryWriter.h
View file @
a63aa930
...
...
@@ -2668,7 +2668,8 @@ namespace BinXlsxRW {
std
::
map
<
std
::
wstring
,
std
::
wstring
>::
iterator
pFind
=
pVmlDrawing
->
m_mapShapesXml
.
find
(
sShapeId
);
if
(
pFind
!=
pVmlDrawing
->
m_mapShapesXml
.
end
())
{
//ищем shape как обьект, чтобы обработать ClientData
pVmlDrawing
->
m_mapUsesShapes
.
insert
(
std
::
make_pair
(
sShapeId
,
true
));
//ищем shape как обьект, чтобы обработать ClientData -todooo - переписасть на map !
for
(
size_t
i
=
0
;
i
<
pVmlDrawing
->
m_arrItems
.
size
();
++
i
)
{
OOX
::
WritingElement
*
pElem
=
pVmlDrawing
->
m_arrItems
[
i
];
...
...
@@ -2728,6 +2729,76 @@ namespace BinXlsxRW {
}
}
}
if
(
NULL
!=
pVmlDrawing
)
{
std
::
map
<
std
::
wstring
,
std
::
wstring
>::
iterator
it
=
pVmlDrawing
->
m_mapShapesXml
.
begin
();
for
(;
it
!=
pVmlDrawing
->
m_mapShapesXml
.
end
();
it
++
)
{
std
::
wstring
sShapeId
=
it
->
first
;
std
::
map
<
std
::
wstring
,
bool
>::
iterator
pFind
=
pVmlDrawing
->
m_mapUsesShapes
.
find
(
sShapeId
);
if
(
pFind
==
pVmlDrawing
->
m_mapUsesShapes
.
end
())
{
//Bonetti Martínez. cálculo estructural de pilotes y pilas.xlsx
for
(
size_t
i
=
0
;
i
<
pVmlDrawing
->
m_arrItems
.
size
();
++
i
)
{
OOX
::
WritingElement
*
pElem
=
pVmlDrawing
->
m_arrItems
[
i
];
if
(
OOX
::
et_v_shape
==
pElem
->
getType
())
{
OOX
::
Vml
::
CShape
*
pShape
=
static_cast
<
OOX
::
Vml
::
CShape
*>
(
pElem
);
if
((
pShape
->
m_sSpId
.
IsInit
()
&&
sShapeId
==
pShape
->
m_sSpId
.
get
())
||
(
pShape
->
m_sId
.
IsInit
()
&&
sShapeId
==
pShape
->
m_sId
.
get
()))
{
for
(
size_t
j
=
0
;
j
<
pShape
->
m_arrItems
.
size
();
++
j
)
{
OOX
::
WritingElement
*
pElemShape
=
pShape
->
m_arrItems
[
j
];
if
(
OOX
::
et_v_ClientData
==
pElemShape
->
getType
())
{
//преобразуем ClientData в CellAnchor
OOX
::
Vml
::
CClientData
*
pClientData
=
static_cast
<
OOX
::
Vml
::
CClientData
*>
(
pElemShape
);
std
::
vector
<
int
>
m_aAnchor
;
pClientData
->
getAnchorArray
(
m_aAnchor
);
if
(
8
==
m_aAnchor
.
size
())
{
SimpleTypes
::
Spreadsheet
::
CCellAnchorType
<>
eAnchorType
;
eAnchorType
.
SetValue
(
SimpleTypes
::
Spreadsheet
::
cellanchorTwoCell
);
OOX
::
Spreadsheet
::
CCellAnchor
oCellAnchor
=
OOX
::
Spreadsheet
::
CCellAnchor
(
eAnchorType
);
oCellAnchor
.
m_sSpId
.
Init
();
oCellAnchor
.
m_sSpId
->
append
(
sShapeId
);
oCellAnchor
.
m_oFrom
.
Init
();
oCellAnchor
.
m_oFrom
->
m_oCol
.
Init
();
oCellAnchor
.
m_oFrom
->
m_oCol
->
SetValue
(
m_aAnchor
[
0
]);
oCellAnchor
.
m_oFrom
->
m_oColOff
.
Init
();
oCellAnchor
.
m_oFrom
->
m_oColOff
->
FromPx
(
m_aAnchor
[
1
]);
oCellAnchor
.
m_oFrom
->
m_oRow
.
Init
();
oCellAnchor
.
m_oFrom
->
m_oRow
->
SetValue
(
m_aAnchor
[
2
]);
oCellAnchor
.
m_oFrom
->
m_oRowOff
.
Init
();
oCellAnchor
.
m_oFrom
->
m_oRowOff
->
FromPx
(
m_aAnchor
[
3
]);
oCellAnchor
.
m_oTo
.
Init
();
oCellAnchor
.
m_oTo
->
m_oCol
.
Init
();
oCellAnchor
.
m_oTo
->
m_oCol
->
SetValue
(
m_aAnchor
[
4
]);
oCellAnchor
.
m_oTo
->
m_oColOff
.
Init
();
oCellAnchor
.
m_oTo
->
m_oColOff
->
FromPx
(
m_aAnchor
[
5
]);
oCellAnchor
.
m_oTo
->
m_oRow
.
Init
();
oCellAnchor
.
m_oTo
->
m_oRow
->
SetValue
(
m_aAnchor
[
6
]);
oCellAnchor
.
m_oTo
->
m_oRowOff
.
Init
();
oCellAnchor
.
m_oTo
->
m_oRowOff
->
FromPx
(
m_aAnchor
[
7
]);
nCurPos
=
m_oBcw
.
WriteItemStart
(
c_oSerWorksheetsTypes
::
Drawing
);
WriteDrawing
(
oWorksheet
,
pDrawing
,
oCellAnchor
,
sDrawingRelsPath
,
pVmlDrawing
,
NULL
);
m_oBcw
.
WriteItemEnd
(
nCurPos
);
}
break
;
}
}
break
;
}
}
}
}
}
}
};
void
WriteDrawing
(
const
OOX
::
Spreadsheet
::
CWorksheet
&
oWorksheet
,
OOX
::
Spreadsheet
::
CDrawing
*
pDrawing
,
OOX
::
Spreadsheet
::
CCellAnchor
&
pCellAnchor
,
std
::
wstring
&
sDrawingRelsPath
,
OOX
::
CVmlDrawing
*
pVmlDrawing
=
NULL
,
OOX
::
Spreadsheet
::
COleObject
*
pOleObject
=
NULL
)
{
...
...
XlsxSerializerCom/Writer/BinaryReader.h
View file @
a63aa930
...
...
@@ -2635,7 +2635,6 @@ namespace BinXlsxRW {
//m_oBufferedStream.Seek(nCurPos + oTransport.m_nLength);
if
(
NULL
!=
m_pCurDrawing
)
{
m_pCurDrawing
->
SetGlobalNumberByType
(
OOX
::
Spreadsheet
::
FileTypes
::
Charts
.
OverrideType
(),
m_pOfficeDrawingConverter
->
GetDocumentChartsCount
());
m_pCurVmlDrawing
->
m_lObjectIdVML
=
m_pOfficeDrawingConverter
->
GetObjectIdVML
();
...
...
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