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
5d8dda02
Commit
5d8dda02
authored
Mar 04, 2017
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pptx extended reading fix
parent
bc346114
Changes
14
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
147 additions
and
70 deletions
+147
-70
ASCOfficePPTXFile/PPTXFormat/Logic/CNvGraphicFramePr.h
ASCOfficePPTXFile/PPTXFormat/Logic/CNvGraphicFramePr.h
+19
-18
ASCOfficePPTXFile/PPTXFormat/Logic/CNvPicPr.h
ASCOfficePPTXFile/PPTXFormat/Logic/CNvPicPr.h
+1
-1
ASCOfficePPTXFile/PPTXFormat/Logic/CustGeom.h
ASCOfficePPTXFile/PPTXFormat/Logic/CustGeom.h
+15
-0
ASCOfficePPTXFile/PPTXFormat/Logic/Fills/Blip.h
ASCOfficePPTXFile/PPTXFormat/Logic/Fills/Blip.h
+1
-1
ASCOfficePPTXFile/PPTXFormat/Logic/Fills/BlipFill.h
ASCOfficePPTXFile/PPTXFormat/Logic/Fills/BlipFill.h
+4
-16
ASCOfficePPTXFile/PPTXFormat/Logic/Fills/GradFill.h
ASCOfficePPTXFile/PPTXFormat/Logic/Fills/GradFill.h
+3
-0
ASCOfficePPTXFile/PPTXFormat/Logic/GrpSpPr.h
ASCOfficePPTXFile/PPTXFormat/Logic/GrpSpPr.h
+39
-0
ASCOfficePPTXFile/PPTXFormat/Logic/NvPr.h
ASCOfficePPTXFile/PPTXFormat/Logic/NvPr.h
+3
-0
ASCOfficePPTXFile/PPTXFormat/Logic/Paragraph.h
ASCOfficePPTXFile/PPTXFormat/Logic/Paragraph.h
+3
-0
ASCOfficePPTXFile/PPTXFormat/Logic/PrstGeom.h
ASCOfficePPTXFile/PPTXFormat/Logic/PrstGeom.h
+4
-1
ASCOfficePPTXFile/PPTXFormat/Logic/PrstTxWarp.h
ASCOfficePPTXFile/PPTXFormat/Logic/PrstTxWarp.h
+3
-0
ASCOfficePPTXFile/PPTXFormat/Logic/SpTree.h
ASCOfficePPTXFile/PPTXFormat/Logic/SpTree.h
+1
-1
ASCOfficePPTXFile/PPTXFormat/Logic/Table/Table.h
ASCOfficePPTXFile/PPTXFormat/Logic/Table/Table.h
+3
-0
ASCOfficePPTXFile/PPTXFormat/Logic/TextFit.h
ASCOfficePPTXFile/PPTXFormat/Logic/TextFit.h
+48
-32
No files found.
ASCOfficePPTXFile/PPTXFormat/Logic/CNvGraphicFramePr.h
View file @
5d8dda02
...
...
@@ -75,9 +75,9 @@ namespace PPTX
int
nParentDepth
=
oReader
.
GetDepth
();
while
(
oReader
.
ReadNextSiblingNode
(
nParentDepth
)
)
{
std
::
wstring
strName
=
oReader
.
GetName
(
);
std
::
wstring
strName
=
XmlUtils
::
GetNameNoNS
(
oReader
.
GetName
()
);
if
(
strName
==
L"
a:
graphicFrameLocks"
)
if
(
strName
==
L"graphicFrameLocks"
)
{
ReadAttributesLocks
(
oReader
);
}
...
...
@@ -98,8 +98,8 @@ namespace PPTX
{
m_namespace
=
XmlUtils
::
GetNamespace
(
node
.
GetName
());
XmlUtils
::
CXmlNode
oNode
;
if
(
node
.
GetNode
(
_T
(
"a:graphicFrameLocks"
),
oNode
))
XmlUtils
::
CXmlNode
oNode
=
node
.
ReadNodeNoNS
(
L"graphicFrameLocks"
);
if
(
oNode
.
IsValid
(
))
{
oNode
.
ReadAttributeBase
(
L"noChangeAspect"
,
noChangeAspect
);
oNode
.
ReadAttributeBase
(
L"noDrilldown"
,
noDrilldown
);
...
...
@@ -120,7 +120,7 @@ namespace PPTX
oAttr
.
Write
(
_T
(
"noResize"
),
noResize
);
oAttr
.
Write
(
_T
(
"noSelect"
),
noSelect
);
return
XmlUtils
::
CreateNode
(
m_namespace
+
L":cNvGraphicFramePr
>"
,
XmlUtils
::
CreateNode
(
_T
(
"a:graphicFrameLocks"
)
,
oAttr
));
return
XmlUtils
::
CreateNode
(
m_namespace
+
L":cNvGraphicFramePr
"
,
oAttr
.
m_strValue
.
empty
()
?
L""
:
XmlUtils
::
CreateNode
(
L"a:graphicFrameLocks"
,
oAttr
));
}
virtual
void
toXmlWriter
(
NSBinPptxRW
::
CXmlWriter
*
pWriter
)
const
...
...
@@ -128,6 +128,7 @@ namespace PPTX
std
::
wstring
namespace_
=
m_namespace
;
if
(
pWriter
->
m_lDocType
==
XMLWRITER_DOC_TYPE_XLSX
)
namespace_
=
L"xdr"
;
if
(
pWriter
->
m_lDocType
==
XMLWRITER_DOC_TYPE_DOCX
)
namespace_
=
L"wp"
;
pWriter
->
StartNode
(
namespace_
+
L":cNvGraphicFramePr"
);
...
...
ASCOfficePPTXFile/PPTXFormat/Logic/CNvPicPr.h
View file @
5d8dda02
...
...
@@ -94,7 +94,7 @@ namespace PPTX
{
std
::
wstring
strName
=
XmlUtils
::
GetNameNoNS
(
oReader
.
GetName
());
if
(
_T
(
"
a:
picLocks"
)
==
strName
)
if
(
_T
(
"picLocks"
)
==
strName
)
{
ReadAttributesLocks
(
oReader
);
}
...
...
ASCOfficePPTXFile/PPTXFormat/Logic/CustGeom.h
View file @
5d8dda02
...
...
@@ -82,6 +82,9 @@ namespace PPTX
if
(
sName
==
L"a:avLst"
)
{
if
(
oReader
.
IsEmptyNode
()
)
continue
;
int
nParentDepth1
=
oReader
.
GetDepth
();
while
(
oReader
.
ReadNextSiblingNode
(
nParentDepth1
)
)
{
...
...
@@ -97,6 +100,9 @@ namespace PPTX
}
else
if
(
sName
==
L"a:gdLst"
)
{
if
(
oReader
.
IsEmptyNode
()
)
continue
;
int
nParentDepth1
=
oReader
.
GetDepth
();
while
(
oReader
.
ReadNextSiblingNode
(
nParentDepth1
)
)
{
...
...
@@ -114,6 +120,9 @@ namespace PPTX
rect
=
oReader
;
else
if
(
sName
==
L"a:pathLst"
)
{
if
(
oReader
.
IsEmptyNode
()
)
continue
;
int
nParentDepth1
=
oReader
.
GetDepth
();
while
(
oReader
.
ReadNextSiblingNode
(
nParentDepth1
)
)
{
...
...
@@ -129,6 +138,9 @@ namespace PPTX
}
else
if
(
sName
==
L"a:ahLst"
)
{
if
(
oReader
.
IsEmptyNode
()
)
continue
;
int
nParentDepth1
=
oReader
.
GetDepth
();
while
(
oReader
.
ReadNextSiblingNode
(
nParentDepth1
)
)
{
...
...
@@ -150,6 +162,9 @@ namespace PPTX
}
else
if
(
sName
==
L"a:cxnLst"
)
{
if
(
oReader
.
IsEmptyNode
()
)
continue
;
int
nParentDepth1
=
oReader
.
GetDepth
();
while
(
oReader
.
ReadNextSiblingNode
(
nParentDepth1
)
)
{
...
...
ASCOfficePPTXFile/PPTXFormat/Logic/Fills/Blip.h
View file @
5d8dda02
...
...
@@ -77,7 +77,7 @@ namespace PPTX
virtual
void
fromXML
(
XmlUtils
::
CXmlLiteReader
&
oReader
);
void
ReadAttributes
(
XmlUtils
::
CXmlLiteReader
&
oReader
)
{
WritingElement_ReadAttributes_Start
_No_NS
(
oReader
)
WritingElement_ReadAttributes_Start
(
oReader
)
WritingElement_ReadAttributes_Read_if
(
oReader
,
_T
(
"r:embed"
),
embed
)
WritingElement_ReadAttributes_Read_else_if
(
oReader
,
_T
(
"r:link"
),
link
)
WritingElement_ReadAttributes_Read_else_if
(
oReader
,
_T
(
"cstate"
),
cstate
)
...
...
ASCOfficePPTXFile/PPTXFormat/Logic/Fills/BlipFill.h
View file @
5d8dda02
...
...
@@ -84,27 +84,15 @@ namespace PPTX
{
std
::
wstring
strName
=
XmlUtils
::
GetNameNoNS
(
oReader
.
GetName
());
if
(
_T
(
"blip"
)
==
strName
)
{
if
(
!
blip
.
IsInit
())
blip
=
oReader
;
}
else
if
(
_T
(
"srcRect"
)
==
strName
)
{
if
(
!
srcRect
.
IsInit
())
srcRect
=
oReader
;
}
else
if
(
_T
(
"tile"
)
==
strName
)
{
if
(
!
tile
.
IsInit
())
tile
=
oReader
;
}
else
if
(
_T
(
"stretch"
)
==
strName
)
{
if
(
!
stretch
.
IsInit
())
stretch
=
oReader
;
}
}
}
virtual
OOX
::
EElementType
getType
()
const
{
return
OOX
::
et_a_blipFill
;
...
...
ASCOfficePPTXFile/PPTXFormat/Logic/Fills/GradFill.h
View file @
5d8dda02
...
...
@@ -98,6 +98,9 @@ namespace PPTX
tileRect
=
oReader
;
else
if
(
_T
(
"gsLst"
)
==
strName
)
{
if
(
oReader
.
IsEmptyNode
()
)
continue
;
int
nCurDepth1
=
oReader
.
GetDepth
();
while
(
oReader
.
ReadNextSiblingNode
(
nCurDepth1
)
)
{
...
...
ASCOfficePPTXFile/PPTXFormat/Logic/GrpSpPr.h
View file @
5d8dda02
...
...
@@ -72,9 +72,48 @@ namespace PPTX
}
virtual
void
fromXML
(
XmlUtils
::
CXmlLiteReader
&
oReader
)
{
m_namespace
=
XmlUtils
::
GetNamespace
(
oReader
.
GetName
());
ReadAttributes
(
oReader
);
if
(
oReader
.
IsEmptyNode
()
)
return
;
int
nParentDepth
=
oReader
.
GetDepth
();
while
(
oReader
.
ReadNextSiblingNode
(
nParentDepth
)
)
{
std
::
wstring
sName
=
XmlUtils
::
GetNameNoNS
(
oReader
.
GetName
());
if
(
L"xfrm"
==
sName
)
xfrm
=
oReader
;
else
if
(
L"blipFill"
==
sName
||
L"gradFill"
==
sName
||
L"grpFill"
==
sName
||
L"noFill"
==
sName
||
L"pattFill"
==
sName
||
L"solidFill"
==
sName
)
{
Fill
.
fromXML
(
oReader
);
}
else
if
(
L"effectDag"
==
sName
||
L"effectLst"
==
sName
||
L"extLst"
==
sName
)
{
EffectList
.
fromXML
(
oReader
);
}
}
FillParentPointersForChilds
();
}
void
ReadAttributes
(
XmlUtils
::
CXmlLiteReader
&
oReader
)
{
WritingElement_ReadAttributes_Start
(
oReader
)
WritingElement_ReadAttributes_ReadSingle
(
oReader
,
_T
(
"bwMode"
),
bwMode
)
WritingElement_ReadAttributes_End
(
oReader
)
}
virtual
void
fromXML
(
XmlUtils
::
CXmlNode
&
node
)
{
m_namespace
=
XmlUtils
::
GetNamespace
(
node
.
GetName
());
node
.
ReadAttributeBase
(
L"bwMode"
,
bwMode
);
XmlUtils
::
CXmlNodes
oNodes
;
...
...
ASCOfficePPTXFile/PPTXFormat/Logic/NvPr.h
View file @
5d8dda02
...
...
@@ -80,6 +80,9 @@ namespace PPTX
ph
=
oReader
;
else
if
(
strName
==
L"extLst"
)
{
if
(
oReader
.
IsEmptyNode
()
)
continue
;
int
nParentDepth1
=
oReader
.
GetDepth
();
while
(
oReader
.
ReadNextSiblingNode
(
nParentDepth1
)
)
{
...
...
ASCOfficePPTXFile/PPTXFormat/Logic/Paragraph.h
View file @
5d8dda02
...
...
@@ -138,6 +138,9 @@ namespace PPTX
RunElems
.
push_back
(
RunElem
(
oReader
));
else
if
(
_T
(
"AlternateContent"
)
==
strName
)
{
if
(
oReader
.
IsEmptyNode
()
)
continue
;
int
nParentDepth1
=
oReader
.
GetDepth
();
while
(
oReader
.
ReadNextSiblingNode
(
nParentDepth1
)
)
{
...
...
ASCOfficePPTXFile/PPTXFormat/Logic/PrstGeom.h
View file @
5d8dda02
...
...
@@ -75,6 +75,9 @@ namespace PPTX
if
(
sName
==
L"a:avLst"
)
{
if
(
oReader
.
IsEmptyNode
()
)
continue
;
int
nParentDepth1
=
oReader
.
GetDepth
();
while
(
oReader
.
ReadNextSiblingNode
(
nParentDepth1
)
)
{
...
...
@@ -95,7 +98,7 @@ namespace PPTX
void
ReadAttributes
(
XmlUtils
::
CXmlLiteReader
&
oReader
)
{
WritingElement_ReadAttributes_Start
(
oReader
)
WritingElement_ReadAttributes_ReadSingle
(
oReader
,
_T
(
"
r:
prst"
),
prst
)
WritingElement_ReadAttributes_ReadSingle
(
oReader
,
_T
(
"prst"
),
prst
)
WritingElement_ReadAttributes_End
(
oReader
)
}
virtual
void
fromXML
(
XmlUtils
::
CXmlNode
&
node
)
...
...
ASCOfficePPTXFile/PPTXFormat/Logic/PrstTxWarp.h
View file @
5d8dda02
...
...
@@ -75,6 +75,9 @@ namespace PPTX
if
(
_T
(
"a:avLst"
)
==
strName
)
{
if
(
oReader
.
IsEmptyNode
()
)
continue
;
int
nCurDepth1
=
oReader
.
GetDepth
();
while
(
oReader
.
ReadNextSiblingNode
(
nCurDepth1
)
)
{
...
...
ASCOfficePPTXFile/PPTXFormat/Logic/SpTree.h
View file @
5d8dda02
...
...
@@ -171,7 +171,7 @@ namespace PPTX
virtual
std
::
wstring
toXML
()
const
{
std
::
wstring
name_
;
if
(
m_namespace
==
L"wp
g
"
)
if
(
m_namespace
==
L"wp"
)
{
if
(
m_lGroupIndex
==
0
)
name_
=
L"wpg:wgp"
;
else
name_
=
L"wpg:grpSp"
;
...
...
ASCOfficePPTXFile/PPTXFormat/Logic/Table/Table.h
View file @
5d8dda02
...
...
@@ -86,6 +86,9 @@ namespace PPTX
if
(
strName
==
L"tblGrid"
)
{
if
(
oReader
.
IsEmptyNode
()
)
continue
;
int
nParentDepth1
=
oReader
.
GetDepth
();
while
(
oReader
.
ReadNextSiblingNode
(
nParentDepth1
)
)
{
...
...
ASCOfficePPTXFile/PPTXFormat/Logic/TextFit.h
View file @
5d8dda02
...
...
@@ -107,25 +107,36 @@ namespace PPTX
}
virtual
void
fromXML
(
XmlUtils
::
CXmlLiteReader
&
oReader
)
{
ReadAttributes
(
oReader
);
std
::
wstring
strName
=
oReader
.
GetName
(
);
int
nCurDepth
=
oReader
.
GetDepth
();
while
(
oReader
.
ReadNextSiblingNode
(
nCurDepth
)
)
if
(
_T
(
"a:noAutofit"
)
==
strName
)
type
=
FitNo
;
else
if
(
_T
(
"a:spAutoFit"
)
==
strName
)
type
=
FitSpAuto
;
else
if
(
_T
(
"a:normAutofit"
)
==
strName
)
{
std
::
wstring
sName
=
oReader
.
GetName
()
;
type
=
FitNormAuto
;
ReadAttributes
(
oReader
);
}
}
void
ReadAttributes
(
XmlUtils
::
CXmlLiteReader
&
oReader
)
{
nullable_string
sFontScale
;
nullable_string
sLnSpcRed
;
WritingElement_ReadAttributes_Start
(
oReader
)
WritingElement_ReadAttributes_Read_if
(
oReader
,
_T
(
"fontScale"
),
sFontScale
)
WritingElement_ReadAttributes_Read_else_if
(
oReader
,
_T
(
"lnSpcReduction"
),
sLnSpcRed
)
WritingElement_ReadAttributes_End
(
oReader
)
Normalize
(
sFontScale
,
sLnSpcRed
);
}
virtual
void
fromXML
(
XmlUtils
::
CXmlNode
&
node
)
{
type
=
FitEmpty
;
std
::
wstring
strName
=
XmlUtils
::
GetNameNoNS
(
node
.
GetName
()
);
std
::
wstring
strName
=
node
.
GetName
(
);
if
(
_T
(
"a:noAutofit"
)
==
strName
)
type
=
FitNo
;
...
...
@@ -141,33 +152,7 @@ namespace PPTX
node
.
ReadAttributeBase
(
L"fontScale"
,
sFontScale
);
node
.
ReadAttributeBase
(
L"lnSpcReduction"
,
sLnSpcRed
);
if
(
sFontScale
.
is_init
())
{
int
nFound
=
(
int
)
sFontScale
->
rfind
(
wchar_t
(
'%'
));
if
(
nFound
<
0
)
fontScale
=
*
sFontScale
;
else
{
std
::
wstring
sRet
=
sFontScale
->
substr
(
0
,
nFound
);
double
dRet
=
XmlUtils
::
GetDouble
(
sRet
);
int
val
=
(
int
)(
dRet
*
1000
);
fontScale
=
val
;
}
}
if
(
sLnSpcRed
.
is_init
())
{
int
nFound
=
(
int
)
sLnSpcRed
->
rfind
(
wchar_t
(
'%'
));
if
(
nFound
<
0
)
lnSpcReduction
=
*
sLnSpcRed
;
else
{
std
::
wstring
sRet
=
sLnSpcRed
->
substr
(
0
,
nFound
);
double
dRet
=
XmlUtils
::
GetDouble
(
sRet
);
int
val
=
(
int
)(
dRet
*
1000
);
lnSpcReduction
=
val
;
}
}
Normalize
(
sFontScale
,
sLnSpcRed
);
}
}
virtual
std
::
wstring
toXML
()
const
...
...
@@ -287,6 +272,37 @@ namespace PPTX
nullable_int
lnSpcReduction
;
protected:
virtual
void
FillParentPointersForChilds
(){}
void
Normalize
(
nullable_string
&
sFontScale
,
nullable_string
&
sLnSpcRed
)
{
if
(
sFontScale
.
is_init
())
{
int
nFound
=
(
int
)
sFontScale
->
rfind
(
wchar_t
(
'%'
));
if
(
nFound
<
0
)
fontScale
=
*
sFontScale
;
else
{
std
::
wstring
sRet
=
sFontScale
->
substr
(
0
,
nFound
);
double
dRet
=
XmlUtils
::
GetDouble
(
sRet
);
int
val
=
(
int
)(
dRet
*
1000
);
fontScale
=
val
;
}
}
if
(
sLnSpcRed
.
is_init
())
{
int
nFound
=
(
int
)
sLnSpcRed
->
rfind
(
wchar_t
(
'%'
));
if
(
nFound
<
0
)
lnSpcReduction
=
*
sLnSpcRed
;
else
{
std
::
wstring
sRet
=
sLnSpcRed
->
substr
(
0
,
nFound
);
double
dRet
=
XmlUtils
::
GetDouble
(
sRet
);
int
val
=
(
int
)(
dRet
*
1000
);
lnSpcReduction
=
val
;
}
}
}
};
}
// namespace Logic
}
// namespace PPTX
...
...
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