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
a75daf9d
Commit
a75daf9d
authored
Apr 10, 2017
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x2t binary - dont write unsupported graphicData (sle:slicer)
parent
dc81f97b
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
57 additions
and
31 deletions
+57
-31
ASCOfficeDocxFile2/BinWriter/BinWriters.h
ASCOfficeDocxFile2/BinWriter/BinWriters.h
+4
-4
ASCOfficeOdfFileW/source/Oox2OdfConverter/ConvertDrawing.cpp
ASCOfficeOdfFileW/source/Oox2OdfConverter/ConvertDrawing.cpp
+6
-6
ASCOfficePPTXFile/PPTXFormat/Logic/GraphicFrame.cpp
ASCOfficePPTXFile/PPTXFormat/Logic/GraphicFrame.cpp
+21
-7
ASCOfficePPTXFile/PPTXFormat/Logic/GraphicFrame.h
ASCOfficePPTXFile/PPTXFormat/Logic/GraphicFrame.h
+4
-1
ASCOfficePPTXFile/PPTXFormat/Logic/SpTreeElem.cpp
ASCOfficePPTXFile/PPTXFormat/Logic/SpTreeElem.cpp
+8
-1
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXDrawingGraphicReader.cpp
...le/RtfFormatLib/source/Reader/OOXDrawingGraphicReader.cpp
+4
-4
Common/DocxFormat/Source/XlsxFormat/Drawing/CellAnchor.h
Common/DocxFormat/Source/XlsxFormat/Drawing/CellAnchor.h
+3
-1
XlsxSerializerCom/Reader/BinaryWriter.h
XlsxSerializerCom/Reader/BinaryWriter.h
+7
-7
No files found.
ASCOfficeDocxFile2/BinWriter/BinWriters.h
View file @
a75daf9d
...
@@ -5506,18 +5506,18 @@ namespace BinDocxRW
...
@@ -5506,18 +5506,18 @@ namespace BinDocxRW
m_oBcw
.
m_oStream
.
StartRecord
(
0
);
m_oBcw
.
m_oStream
.
StartRecord
(
0
);
m_oBcw
.
m_oStream
.
StartRecord
(
1
);
m_oBcw
.
m_oStream
.
StartRecord
(
1
);
if
(
pGraphic
->
olePic
.
IsI
nit
())
if
(
pGraphic
->
olePic
.
is_i
nit
())
{
{
pGraphic
->
olePic
->
toPPTY
(
&
m_oBcw
.
m_oStream
);
pGraphic
->
olePic
->
toPPTY
(
&
m_oBcw
.
m_oStream
);
}
}
else
if
(
pGraphic
->
smartArt
.
IsI
nit
())
else
if
(
pGraphic
->
smartArt
.
is_i
nit
())
{
{
pGraphic
->
smartArt
->
LoadDrawing
(
&
m_oBcw
.
m_oStream
);
pGraphic
->
smartArt
->
LoadDrawing
(
&
m_oBcw
.
m_oStream
);
pGraphic
->
smartArt
->
toPPTY
(
&
m_oBcw
.
m_oStream
);
pGraphic
->
smartArt
->
toPPTY
(
&
m_oBcw
.
m_oStream
);
}
}
else
if
(
pGraphic
->
element
.
IsI
nit
())
else
if
(
pGraphic
->
element
.
is_i
nit
())
{
{
pGraphic
->
element
->
toPPTY
(
&
m_oBcw
.
m_oStream
);
pGraphic
->
element
.
toPPTY
(
&
m_oBcw
.
m_oStream
);
}
}
m_oBcw
.
m_oStream
.
EndRecord
();
m_oBcw
.
m_oStream
.
EndRecord
();
m_oBcw
.
m_oStream
.
EndRecord
();
m_oBcw
.
m_oStream
.
EndRecord
();
...
...
ASCOfficeOdfFileW/source/Oox2OdfConverter/ConvertDrawing.cpp
View file @
a75daf9d
...
@@ -85,27 +85,27 @@ void OoxConverter::convert(PPTX::Logic::GraphicFrame *oox_graphic_frame)
...
@@ -85,27 +85,27 @@ void OoxConverter::convert(PPTX::Logic::GraphicFrame *oox_graphic_frame)
convert
(
&
oox_graphic_frame
->
nvGraphicFramePr
);
convert
(
&
oox_graphic_frame
->
nvGraphicFramePr
);
convert
(
oox_graphic_frame
->
xfrm
.
GetPointer
());
convert
(
oox_graphic_frame
->
xfrm
.
GetPointer
());
if
(
oox_graphic_frame
->
chartRec
.
IsI
nit
())
if
(
oox_graphic_frame
->
chartRec
.
is_i
nit
())
{
{
convert
(
oox_graphic_frame
->
chartRec
.
GetPointer
());
convert
(
oox_graphic_frame
->
chartRec
.
GetPointer
());
}
}
else
if
(
oox_graphic_frame
->
smartArt
.
IsI
nit
())
else
if
(
oox_graphic_frame
->
smartArt
.
is_i
nit
())
{
{
OoxConverter
::
convert
(
oox_graphic_frame
->
smartArt
.
GetPointer
());
OoxConverter
::
convert
(
oox_graphic_frame
->
smartArt
.
GetPointer
());
}
}
else
if
(
oox_graphic_frame
->
olePic
.
IsI
nit
())
else
if
(
oox_graphic_frame
->
olePic
.
is_i
nit
())
{
{
OoxConverter
::
convert
(
oox_graphic_frame
->
olePic
.
GetPointer
());
OoxConverter
::
convert
(
oox_graphic_frame
->
olePic
.
GetPointer
());
}
}
else
if
(
oox_graphic_frame
->
table
.
IsI
nit
())
else
if
(
oox_graphic_frame
->
table
.
is_i
nit
())
{
{
PptxConverter
*
pptx_converter
=
dynamic_cast
<
PptxConverter
*>
(
this
);
PptxConverter
*
pptx_converter
=
dynamic_cast
<
PptxConverter
*>
(
this
);
if
(
pptx_converter
)
if
(
pptx_converter
)
pptx_converter
->
convert
(
oox_graphic_frame
->
table
.
GetPointer
());
pptx_converter
->
convert
(
oox_graphic_frame
->
table
.
GetPointer
());
}
}
else
if
(
oox_graphic_frame
->
element
.
IsI
nit
())
else
if
(
oox_graphic_frame
->
element
.
is_i
nit
())
{
{
OoxConverter
::
convert
(
oox_graphic_frame
->
element
->
GetElem
().
operator
->
());
OoxConverter
::
convert
(
oox_graphic_frame
->
element
.
GetElem
().
operator
->
());
}
}
odf_context
()
->
drawing_context
()
->
end_drawing
();
odf_context
()
->
drawing_context
()
->
end_drawing
();
}
}
...
...
ASCOfficePPTXFile/PPTXFormat/Logic/GraphicFrame.cpp
View file @
a75daf9d
...
@@ -219,8 +219,8 @@ namespace PPTX
...
@@ -219,8 +219,8 @@ namespace PPTX
}
}
else
else
{
{
element
=
oReader
;
element
.
fromXML
(
oReader
)
;
if
(
element
.
IsI
nit
())
if
(
element
.
is_i
nit
())
result
=
true
;
result
=
true
;
}
}
}
}
...
@@ -359,15 +359,21 @@ namespace PPTX
...
@@ -359,15 +359,21 @@ namespace PPTX
pWriter
->
EndNode
(
namespace_
+
L":graphicFrame"
);
pWriter
->
EndNode
(
namespace_
+
L":graphicFrame"
);
}
}
bool
GraphicFrame
::
IsEmpty
()
const
{
return
!
olePic
.
is_init
()
&&
!
smartArt
.
is_init
()
&&
!
table
.
is_init
()
&&
!
chartRec
.
is_init
()
&&
!
oleSpid
.
is_init
()
&&
!
element
.
is_init
();
}
void
GraphicFrame
::
toPPTY
(
NSBinPptxRW
::
CBinaryFileWriter
*
pWriter
)
const
void
GraphicFrame
::
toPPTY
(
NSBinPptxRW
::
CBinaryFileWriter
*
pWriter
)
const
{
{
if
(
IsEmpty
())
return
;
if
(
olePic
.
is_init
())
if
(
olePic
.
is_init
())
{
{
olePic
->
toPPTY
(
pWriter
);
olePic
->
toPPTY
(
pWriter
);
return
;
return
;
}
}
if
(
!
smartArt
.
is_init
()
&&
!
table
.
is_init
()
&&
!
chartRec
.
is_init
()
&&
!
oleSpid
.
is_init
()
)
return
;
std
::
wstring
xml_object_vml
;
std
::
wstring
xml_object_vml
;
std
::
wstring
xml_object_rels
;
std
::
wstring
xml_object_rels
;
...
@@ -465,14 +471,22 @@ namespace PPTX
...
@@ -465,14 +471,22 @@ namespace PPTX
pWriter
->
WriteRecord1
(
0
,
nvGraphicFramePr
);
pWriter
->
WriteRecord1
(
0
,
nvGraphicFramePr
);
pWriter
->
WriteRecord2
(
1
,
xfrm
);
pWriter
->
WriteRecord2
(
1
,
xfrm
);
pWriter
->
WriteRecord2
(
2
,
table
);
if
(
chartRec
.
is_init
())
if
(
table
.
is_init
())
{
pWriter
->
WriteRecord2
(
2
,
table
);
}
else
if
(
chartRec
.
is_init
())
{
{
pWriter
->
WriteRecord2
(
3
,
chartRec
);
pWriter
->
WriteRecord2
(
3
,
chartRec
);
}
}
else
if
(
xml_object_vml
.
empty
()
==
false
)
else
if
(
element
.
is_init
())
{
pWriter
->
WriteRecord1
(
4
,
element
);
}
else
{
{
//????
}
}
pWriter
->
EndRecord
();
pWriter
->
EndRecord
();
...
...
ASCOfficePPTXFile/PPTXFormat/Logic/GraphicFrame.h
View file @
a75daf9d
...
@@ -82,6 +82,8 @@ namespace PPTX
...
@@ -82,6 +82,8 @@ namespace PPTX
virtual
void
toPPTY
(
NSBinPptxRW
::
CBinaryFileWriter
*
pWriter
)
const
;
virtual
void
toPPTY
(
NSBinPptxRW
::
CBinaryFileWriter
*
pWriter
)
const
;
virtual
void
fromPPTY
(
NSBinPptxRW
::
CBinaryFileReader
*
pReader
);
virtual
void
fromPPTY
(
NSBinPptxRW
::
CBinaryFileReader
*
pReader
);
bool
IsEmpty
()
const
;
std
::
wstring
m_namespace
;
std
::
wstring
m_namespace
;
NvGraphicFramePr
nvGraphicFramePr
;
NvGraphicFramePr
nvGraphicFramePr
;
...
@@ -94,7 +96,8 @@ namespace PPTX
...
@@ -94,7 +96,8 @@ namespace PPTX
nullable
<
Table
>
table
;
nullable
<
Table
>
table
;
nullable
<
SmartArt
>
smartArt
;
nullable
<
SmartArt
>
smartArt
;
nullable
<
ChartRec
>
chartRec
;
nullable
<
ChartRec
>
chartRec
;
nullable
<
SpTreeElem
>
element
;
SpTreeElem
element
;
std
::
wstring
GetVmlXmlBySpid
(
std
::
wstring
&
rels
)
const
;
std
::
wstring
GetVmlXmlBySpid
(
std
::
wstring
&
rels
)
const
;
protected:
protected:
...
...
ASCOfficePPTXFile/PPTXFormat/Logic/SpTreeElem.cpp
View file @
a75daf9d
...
@@ -244,7 +244,14 @@ namespace PPTX
...
@@ -244,7 +244,14 @@ namespace PPTX
else
if
(
name
==
_T
(
"grpSp"
)
||
name
==
_T
(
"wgp"
)
||
name
==
_T
(
"spTree"
)
||
name
==
_T
(
"lockedCanvas"
))
else
if
(
name
==
_T
(
"grpSp"
)
||
name
==
_T
(
"wgp"
)
||
name
==
_T
(
"spTree"
)
||
name
==
_T
(
"lockedCanvas"
))
m_elem
.
reset
(
new
Logic
::
SpTree
(
oReader
));
m_elem
.
reset
(
new
Logic
::
SpTree
(
oReader
));
else
if
(
name
==
_T
(
"graphicFrame"
))
else
if
(
name
==
_T
(
"graphicFrame"
))
m_elem
.
reset
(
new
Logic
::
GraphicFrame
(
oReader
));
{
Logic
::
GraphicFrame
*
pGraphic
=
new
Logic
::
GraphicFrame
(
oReader
);
if
(
pGraphic
&&
pGraphic
->
IsEmpty
()
==
false
)
m_elem
.
reset
(
pGraphic
);
else
RELEASEOBJECT
(
pGraphic
);
}
else
if
(
name
==
_T
(
"AlternateContent"
))
else
if
(
name
==
_T
(
"AlternateContent"
))
{
{
if
(
oReader
.
IsEmptyNode
()
)
if
(
oReader
.
IsEmptyNode
()
)
...
...
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXDrawingGraphicReader.cpp
View file @
a75daf9d
...
@@ -40,16 +40,16 @@ int OOXGraphicReader::Parse( ReaderParameter oParam , RtfShapePtr & pOutput)
...
@@ -40,16 +40,16 @@ int OOXGraphicReader::Parse( ReaderParameter oParam , RtfShapePtr & pOutput)
{
{
if
(
m_ooxGraphic
==
NULL
)
return
0
;
if
(
m_ooxGraphic
==
NULL
)
return
0
;
if
(
m_ooxGraphic
->
element
.
IsI
nit
())
if
(
m_ooxGraphic
->
element
.
is_i
nit
())
{
{
if
(
m_ooxGraphic
->
element
->
getType
()
==
OOX
::
et_p_ShapeTree
)
if
(
m_ooxGraphic
->
element
.
getType
()
==
OOX
::
et_p_ShapeTree
)
{
{
OOXShapeReader
shapeReader
(
m_ooxGraphic
->
element
->
GetElem
().
operator
->
());
OOXShapeReader
shapeReader
(
m_ooxGraphic
->
element
.
GetElem
().
operator
->
());
return
(
shapeReader
.
Parse
(
oParam
,
pOutput
)
?
1
:
0
);
return
(
shapeReader
.
Parse
(
oParam
,
pOutput
)
?
1
:
0
);
}
}
else
else
{
{
OOXShapeGroupReader
groupReader
(
dynamic_cast
<
PPTX
::
Logic
::
SpTree
*>
(
m_ooxGraphic
->
element
->
GetElem
().
operator
->
()));
OOXShapeGroupReader
groupReader
(
dynamic_cast
<
PPTX
::
Logic
::
SpTree
*>
(
m_ooxGraphic
->
element
.
GetElem
().
operator
->
()));
return
(
groupReader
.
Parse
(
oParam
,
pOutput
)
?
1
:
0
);
return
(
groupReader
.
Parse
(
oParam
,
pOutput
)
?
1
:
0
);
}
}
}
}
...
...
Common/DocxFormat/Source/XlsxFormat/Drawing/CellAnchor.h
View file @
a75daf9d
...
@@ -190,7 +190,9 @@ namespace OOX
...
@@ -190,7 +190,9 @@ namespace OOX
SimpleTypes
::
Spreadsheet
::
ECellAnchorType
eAnchorType
=
m_oAnchorType
.
GetValue
();
SimpleTypes
::
Spreadsheet
::
ECellAnchorType
eAnchorType
=
m_oAnchorType
.
GetValue
();
if
(
!
((
m_oFrom
.
IsInit
()
&&
m_oTo
.
IsInit
())
||
(
m_oFrom
.
IsInit
()
&&
m_oExt
.
IsInit
())
||
(
m_oPos
.
IsInit
()
&&
m_oExt
.
IsInit
())))
if
(
!
((
m_oFrom
.
IsInit
()
&&
m_oTo
.
IsInit
())
||
(
m_oFrom
.
IsInit
()
&&
m_oExt
.
IsInit
())
||
(
m_oPos
.
IsInit
()
&&
m_oExt
.
IsInit
())))
return
false
;
return
false
;
if
(
false
==
m_oElement
.
IsInit
())
if
(
false
==
m_oElement
.
is_init
())
return
false
;
if
(
false
==
m_oElement
->
is_init
())
return
false
;
return
false
;
return
true
;
return
true
;
}
}
...
...
XlsxSerializerCom/Reader/BinaryWriter.h
View file @
a75daf9d
...
@@ -2779,6 +2779,9 @@ namespace BinXlsxRW
...
@@ -2779,6 +2779,9 @@ namespace BinXlsxRW
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
)
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
)
{
{
if
(
!
pCellAnchor
)
return
;
if
(
!
pCellAnchor
)
return
;
if
(
pCellAnchor
->
m_oElement
.
IsInit
()
==
false
&&
pCellAnchor
->
m_sSpId
.
IsInit
()
==
false
)
return
;
//Type
//Type
int
nCurPos
;
int
nCurPos
;
nCurPos
=
m_oBcw
.
WriteItemStart
(
c_oSer_DrawingType
::
Type
);
nCurPos
=
m_oBcw
.
WriteItemStart
(
c_oSer_DrawingType
::
Type
);
...
@@ -2819,13 +2822,12 @@ namespace BinXlsxRW
...
@@ -2819,13 +2822,12 @@ namespace BinXlsxRW
if
(
pFind
!=
pVmlDrawing
->
m_mapShapes
.
end
()
&&
!
pFind
->
second
.
bUsed
)
if
(
pFind
!=
pVmlDrawing
->
m_mapShapes
.
end
()
&&
!
pFind
->
second
.
bUsed
)
{
{
pFind
->
second
.
bUsed
=
true
;
pFind
->
second
.
bUsed
=
true
;
std
::
wstring
sVmlXml
;
std
::
wstring
sVmlXml
=
L"<v:object>"
;
sVmlXml
+=
pFind
->
second
.
sXml
;
//add vml shape xml
if
(
pCellAnchor
->
m_bShapeOle
&&
NULL
!=
pOleObject
)
if
(
pCellAnchor
->
m_bShapeOle
&&
NULL
!=
pOleObject
)
{
{
sVmlXml
+=
L"<v:object>"
;
sVmlXml
+=
pFind
->
second
.
sXml
;
//add vml shape xml
//ищем физический файл, потому что rId относительно sheet.xml, а SetRelsPath(pVmlDrawing
//ищем физический файл, потому что rId относительно sheet.xml, а SetRelsPath(pVmlDrawing
smart_ptr
<
OOX
::
File
>
pFile
=
oWorksheet
.
Find
(
OOX
::
RId
(
pOleObject
->
m_oRid
->
GetValue
()));
smart_ptr
<
OOX
::
File
>
pFile
=
oWorksheet
.
Find
(
OOX
::
RId
(
pOleObject
->
m_oRid
->
GetValue
()));
pOleObject
->
m_OleObjectFile
=
pFile
.
smart_dynamic_cast
<
OOX
::
OleObject
>
();
pOleObject
->
m_OleObjectFile
=
pFile
.
smart_dynamic_cast
<
OOX
::
OleObject
>
();
...
@@ -2834,10 +2836,8 @@ namespace BinXlsxRW
...
@@ -2834,10 +2836,8 @@ namespace BinXlsxRW
pOleObject
->
toXMLPptx
(
writer
,
L""
);
pOleObject
->
toXMLPptx
(
writer
,
L""
);
sVmlXml
+=
writer
.
GetData
();
sVmlXml
+=
writer
.
GetData
();
sVmlXml
+=
L"</v:object>"
;
}
}
else
sVmlXml
+=
L"</v:object>"
;
sVmlXml
=
pFind
->
second
.
sXml
;
//add vml shape xml
std
::
wstring
keepRels
=
m_pOfficeDrawingConverter
->
GetRelsPath
();
std
::
wstring
keepRels
=
m_pOfficeDrawingConverter
->
GetRelsPath
();
m_pOfficeDrawingConverter
->
SetRelsPath
(
pVmlDrawing
->
GetReadPath
().
GetPath
());
m_pOfficeDrawingConverter
->
SetRelsPath
(
pVmlDrawing
->
GetReadPath
().
GetPath
());
...
...
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