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
Hide 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
...
@@ -75,9 +75,9 @@ namespace PPTX
int
nParentDepth
=
oReader
.
GetDepth
();
int
nParentDepth
=
oReader
.
GetDepth
();
while
(
oReader
.
ReadNextSiblingNode
(
nParentDepth
)
)
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
);
ReadAttributesLocks
(
oReader
);
}
}
...
@@ -98,29 +98,29 @@ namespace PPTX
...
@@ -98,29 +98,29 @@ namespace PPTX
{
{
m_namespace
=
XmlUtils
::
GetNamespace
(
node
.
GetName
());
m_namespace
=
XmlUtils
::
GetNamespace
(
node
.
GetName
());
XmlUtils
::
CXmlNode
oNode
;
XmlUtils
::
CXmlNode
oNode
=
node
.
ReadNodeNoNS
(
L"graphicFrameLocks"
);
if
(
node
.
GetNode
(
_T
(
"a:graphicFrameLocks"
),
oNode
))
if
(
oNode
.
IsValid
(
))
{
{
oNode
.
ReadAttributeBase
(
L"noChangeAspect"
,
noChangeAspect
);
oNode
.
ReadAttributeBase
(
L"noChangeAspect"
,
noChangeAspect
);
oNode
.
ReadAttributeBase
(
L"noDrilldown"
,
noDrilldown
);
oNode
.
ReadAttributeBase
(
L"noDrilldown"
,
noDrilldown
);
oNode
.
ReadAttributeBase
(
L"noGrp"
,
noGrp
);
oNode
.
ReadAttributeBase
(
L"noGrp"
,
noGrp
);
oNode
.
ReadAttributeBase
(
L"noMove"
,
noMove
);
oNode
.
ReadAttributeBase
(
L"noMove"
,
noMove
);
oNode
.
ReadAttributeBase
(
L"noResize"
,
noResize
);
oNode
.
ReadAttributeBase
(
L"noResize"
,
noResize
);
oNode
.
ReadAttributeBase
(
L"noSelect"
,
noSelect
);
oNode
.
ReadAttributeBase
(
L"noSelect"
,
noSelect
);
}
}
}
}
virtual
std
::
wstring
toXML
()
const
virtual
std
::
wstring
toXML
()
const
{
{
XmlUtils
::
CAttribute
oAttr
;
XmlUtils
::
CAttribute
oAttr
;
oAttr
.
Write
(
_T
(
"noChangeAspect"
),
noChangeAspect
);
oAttr
.
Write
(
_T
(
"noChangeAspect"
),
noChangeAspect
);
oAttr
.
Write
(
_T
(
"noDrilldown"
),
noDrilldown
);
oAttr
.
Write
(
_T
(
"noDrilldown"
),
noDrilldown
);
oAttr
.
Write
(
_T
(
"noGrp"
),
noGrp
);
oAttr
.
Write
(
_T
(
"noGrp"
),
noGrp
);
oAttr
.
Write
(
_T
(
"noMove"
),
noMove
);
oAttr
.
Write
(
_T
(
"noMove"
),
noMove
);
oAttr
.
Write
(
_T
(
"noResize"
),
noResize
);
oAttr
.
Write
(
_T
(
"noResize"
),
noResize
);
oAttr
.
Write
(
_T
(
"noSelect"
),
noSelect
);
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
virtual
void
toXmlWriter
(
NSBinPptxRW
::
CXmlWriter
*
pWriter
)
const
...
@@ -128,6 +128,7 @@ namespace PPTX
...
@@ -128,6 +128,7 @@ namespace PPTX
std
::
wstring
namespace_
=
m_namespace
;
std
::
wstring
namespace_
=
m_namespace
;
if
(
pWriter
->
m_lDocType
==
XMLWRITER_DOC_TYPE_XLSX
)
namespace_
=
L"xdr"
;
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"
);
pWriter
->
StartNode
(
namespace_
+
L":cNvGraphicFramePr"
);
...
...
ASCOfficePPTXFile/PPTXFormat/Logic/CNvPicPr.h
View file @
5d8dda02
...
@@ -94,7 +94,7 @@ namespace PPTX
...
@@ -94,7 +94,7 @@ namespace PPTX
{
{
std
::
wstring
strName
=
XmlUtils
::
GetNameNoNS
(
oReader
.
GetName
());
std
::
wstring
strName
=
XmlUtils
::
GetNameNoNS
(
oReader
.
GetName
());
if
(
_T
(
"
a:
picLocks"
)
==
strName
)
if
(
_T
(
"picLocks"
)
==
strName
)
{
{
ReadAttributesLocks
(
oReader
);
ReadAttributesLocks
(
oReader
);
}
}
...
...
ASCOfficePPTXFile/PPTXFormat/Logic/CustGeom.h
View file @
5d8dda02
...
@@ -82,6 +82,9 @@ namespace PPTX
...
@@ -82,6 +82,9 @@ namespace PPTX
if
(
sName
==
L"a:avLst"
)
if
(
sName
==
L"a:avLst"
)
{
{
if
(
oReader
.
IsEmptyNode
()
)
continue
;
int
nParentDepth1
=
oReader
.
GetDepth
();
int
nParentDepth1
=
oReader
.
GetDepth
();
while
(
oReader
.
ReadNextSiblingNode
(
nParentDepth1
)
)
while
(
oReader
.
ReadNextSiblingNode
(
nParentDepth1
)
)
{
{
...
@@ -97,6 +100,9 @@ namespace PPTX
...
@@ -97,6 +100,9 @@ namespace PPTX
}
}
else
if
(
sName
==
L"a:gdLst"
)
else
if
(
sName
==
L"a:gdLst"
)
{
{
if
(
oReader
.
IsEmptyNode
()
)
continue
;
int
nParentDepth1
=
oReader
.
GetDepth
();
int
nParentDepth1
=
oReader
.
GetDepth
();
while
(
oReader
.
ReadNextSiblingNode
(
nParentDepth1
)
)
while
(
oReader
.
ReadNextSiblingNode
(
nParentDepth1
)
)
{
{
...
@@ -114,6 +120,9 @@ namespace PPTX
...
@@ -114,6 +120,9 @@ namespace PPTX
rect
=
oReader
;
rect
=
oReader
;
else
if
(
sName
==
L"a:pathLst"
)
else
if
(
sName
==
L"a:pathLst"
)
{
{
if
(
oReader
.
IsEmptyNode
()
)
continue
;
int
nParentDepth1
=
oReader
.
GetDepth
();
int
nParentDepth1
=
oReader
.
GetDepth
();
while
(
oReader
.
ReadNextSiblingNode
(
nParentDepth1
)
)
while
(
oReader
.
ReadNextSiblingNode
(
nParentDepth1
)
)
{
{
...
@@ -129,6 +138,9 @@ namespace PPTX
...
@@ -129,6 +138,9 @@ namespace PPTX
}
}
else
if
(
sName
==
L"a:ahLst"
)
else
if
(
sName
==
L"a:ahLst"
)
{
{
if
(
oReader
.
IsEmptyNode
()
)
continue
;
int
nParentDepth1
=
oReader
.
GetDepth
();
int
nParentDepth1
=
oReader
.
GetDepth
();
while
(
oReader
.
ReadNextSiblingNode
(
nParentDepth1
)
)
while
(
oReader
.
ReadNextSiblingNode
(
nParentDepth1
)
)
{
{
...
@@ -150,6 +162,9 @@ namespace PPTX
...
@@ -150,6 +162,9 @@ namespace PPTX
}
}
else
if
(
sName
==
L"a:cxnLst"
)
else
if
(
sName
==
L"a:cxnLst"
)
{
{
if
(
oReader
.
IsEmptyNode
()
)
continue
;
int
nParentDepth1
=
oReader
.
GetDepth
();
int
nParentDepth1
=
oReader
.
GetDepth
();
while
(
oReader
.
ReadNextSiblingNode
(
nParentDepth1
)
)
while
(
oReader
.
ReadNextSiblingNode
(
nParentDepth1
)
)
{
{
...
...
ASCOfficePPTXFile/PPTXFormat/Logic/Fills/Blip.h
View file @
5d8dda02
...
@@ -77,7 +77,7 @@ namespace PPTX
...
@@ -77,7 +77,7 @@ namespace PPTX
virtual
void
fromXML
(
XmlUtils
::
CXmlLiteReader
&
oReader
);
virtual
void
fromXML
(
XmlUtils
::
CXmlLiteReader
&
oReader
);
void
ReadAttributes
(
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_if
(
oReader
,
_T
(
"r:embed"
),
embed
)
WritingElement_ReadAttributes_Read_else_if
(
oReader
,
_T
(
"r:link"
),
link
)
WritingElement_ReadAttributes_Read_else_if
(
oReader
,
_T
(
"r:link"
),
link
)
WritingElement_ReadAttributes_Read_else_if
(
oReader
,
_T
(
"cstate"
),
cstate
)
WritingElement_ReadAttributes_Read_else_if
(
oReader
,
_T
(
"cstate"
),
cstate
)
...
...
ASCOfficePPTXFile/PPTXFormat/Logic/Fills/BlipFill.h
View file @
5d8dda02
...
@@ -84,25 +84,13 @@ namespace PPTX
...
@@ -84,25 +84,13 @@ namespace PPTX
{
{
std
::
wstring
strName
=
XmlUtils
::
GetNameNoNS
(
oReader
.
GetName
());
std
::
wstring
strName
=
XmlUtils
::
GetNameNoNS
(
oReader
.
GetName
());
if
(
_T
(
"blip"
)
==
strName
)
if
(
_T
(
"blip"
)
==
strName
)
{
blip
=
oReader
;
if
(
!
blip
.
IsInit
())
blip
=
oReader
;
}
else
if
(
_T
(
"srcRect"
)
==
strName
)
else
if
(
_T
(
"srcRect"
)
==
strName
)
{
srcRect
=
oReader
;
if
(
!
srcRect
.
IsInit
())
srcRect
=
oReader
;
}
else
if
(
_T
(
"tile"
)
==
strName
)
else
if
(
_T
(
"tile"
)
==
strName
)
{
tile
=
oReader
;
if
(
!
tile
.
IsInit
())
tile
=
oReader
;
}
else
if
(
_T
(
"stretch"
)
==
strName
)
else
if
(
_T
(
"stretch"
)
==
strName
)
{
stretch
=
oReader
;
if
(
!
stretch
.
IsInit
())
stretch
=
oReader
;
}
}
}
}
}
virtual
OOX
::
EElementType
getType
()
const
virtual
OOX
::
EElementType
getType
()
const
...
...
ASCOfficePPTXFile/PPTXFormat/Logic/Fills/GradFill.h
View file @
5d8dda02
...
@@ -98,6 +98,9 @@ namespace PPTX
...
@@ -98,6 +98,9 @@ namespace PPTX
tileRect
=
oReader
;
tileRect
=
oReader
;
else
if
(
_T
(
"gsLst"
)
==
strName
)
else
if
(
_T
(
"gsLst"
)
==
strName
)
{
{
if
(
oReader
.
IsEmptyNode
()
)
continue
;
int
nCurDepth1
=
oReader
.
GetDepth
();
int
nCurDepth1
=
oReader
.
GetDepth
();
while
(
oReader
.
ReadNextSiblingNode
(
nCurDepth1
)
)
while
(
oReader
.
ReadNextSiblingNode
(
nCurDepth1
)
)
{
{
...
...
ASCOfficePPTXFile/PPTXFormat/Logic/GrpSpPr.h
View file @
5d8dda02
...
@@ -72,9 +72,48 @@ namespace PPTX
...
@@ -72,9 +72,48 @@ namespace PPTX
}
}
virtual
void
fromXML
(
XmlUtils
::
CXmlLiteReader
&
oReader
)
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
)
virtual
void
fromXML
(
XmlUtils
::
CXmlNode
&
node
)
{
{
m_namespace
=
XmlUtils
::
GetNamespace
(
node
.
GetName
());
node
.
ReadAttributeBase
(
L"bwMode"
,
bwMode
);
node
.
ReadAttributeBase
(
L"bwMode"
,
bwMode
);
XmlUtils
::
CXmlNodes
oNodes
;
XmlUtils
::
CXmlNodes
oNodes
;
...
...
ASCOfficePPTXFile/PPTXFormat/Logic/NvPr.h
View file @
5d8dda02
...
@@ -80,6 +80,9 @@ namespace PPTX
...
@@ -80,6 +80,9 @@ namespace PPTX
ph
=
oReader
;
ph
=
oReader
;
else
if
(
strName
==
L"extLst"
)
else
if
(
strName
==
L"extLst"
)
{
{
if
(
oReader
.
IsEmptyNode
()
)
continue
;
int
nParentDepth1
=
oReader
.
GetDepth
();
int
nParentDepth1
=
oReader
.
GetDepth
();
while
(
oReader
.
ReadNextSiblingNode
(
nParentDepth1
)
)
while
(
oReader
.
ReadNextSiblingNode
(
nParentDepth1
)
)
{
{
...
...
ASCOfficePPTXFile/PPTXFormat/Logic/Paragraph.h
View file @
5d8dda02
...
@@ -138,6 +138,9 @@ namespace PPTX
...
@@ -138,6 +138,9 @@ namespace PPTX
RunElems
.
push_back
(
RunElem
(
oReader
));
RunElems
.
push_back
(
RunElem
(
oReader
));
else
if
(
_T
(
"AlternateContent"
)
==
strName
)
else
if
(
_T
(
"AlternateContent"
)
==
strName
)
{
{
if
(
oReader
.
IsEmptyNode
()
)
continue
;
int
nParentDepth1
=
oReader
.
GetDepth
();
int
nParentDepth1
=
oReader
.
GetDepth
();
while
(
oReader
.
ReadNextSiblingNode
(
nParentDepth1
)
)
while
(
oReader
.
ReadNextSiblingNode
(
nParentDepth1
)
)
{
{
...
...
ASCOfficePPTXFile/PPTXFormat/Logic/PrstGeom.h
View file @
5d8dda02
...
@@ -75,6 +75,9 @@ namespace PPTX
...
@@ -75,6 +75,9 @@ namespace PPTX
if
(
sName
==
L"a:avLst"
)
if
(
sName
==
L"a:avLst"
)
{
{
if
(
oReader
.
IsEmptyNode
()
)
continue
;
int
nParentDepth1
=
oReader
.
GetDepth
();
int
nParentDepth1
=
oReader
.
GetDepth
();
while
(
oReader
.
ReadNextSiblingNode
(
nParentDepth1
)
)
while
(
oReader
.
ReadNextSiblingNode
(
nParentDepth1
)
)
{
{
...
@@ -95,7 +98,7 @@ namespace PPTX
...
@@ -95,7 +98,7 @@ namespace PPTX
void
ReadAttributes
(
XmlUtils
::
CXmlLiteReader
&
oReader
)
void
ReadAttributes
(
XmlUtils
::
CXmlLiteReader
&
oReader
)
{
{
WritingElement_ReadAttributes_Start
(
oReader
)
WritingElement_ReadAttributes_Start
(
oReader
)
WritingElement_ReadAttributes_ReadSingle
(
oReader
,
_T
(
"
r:
prst"
),
prst
)
WritingElement_ReadAttributes_ReadSingle
(
oReader
,
_T
(
"prst"
),
prst
)
WritingElement_ReadAttributes_End
(
oReader
)
WritingElement_ReadAttributes_End
(
oReader
)
}
}
virtual
void
fromXML
(
XmlUtils
::
CXmlNode
&
node
)
virtual
void
fromXML
(
XmlUtils
::
CXmlNode
&
node
)
...
...
ASCOfficePPTXFile/PPTXFormat/Logic/PrstTxWarp.h
View file @
5d8dda02
...
@@ -75,6 +75,9 @@ namespace PPTX
...
@@ -75,6 +75,9 @@ namespace PPTX
if
(
_T
(
"a:avLst"
)
==
strName
)
if
(
_T
(
"a:avLst"
)
==
strName
)
{
{
if
(
oReader
.
IsEmptyNode
()
)
continue
;
int
nCurDepth1
=
oReader
.
GetDepth
();
int
nCurDepth1
=
oReader
.
GetDepth
();
while
(
oReader
.
ReadNextSiblingNode
(
nCurDepth1
)
)
while
(
oReader
.
ReadNextSiblingNode
(
nCurDepth1
)
)
{
{
...
...
ASCOfficePPTXFile/PPTXFormat/Logic/SpTree.h
View file @
5d8dda02
...
@@ -171,7 +171,7 @@ namespace PPTX
...
@@ -171,7 +171,7 @@ namespace PPTX
virtual
std
::
wstring
toXML
()
const
virtual
std
::
wstring
toXML
()
const
{
{
std
::
wstring
name_
;
std
::
wstring
name_
;
if
(
m_namespace
==
L"wp
g
"
)
if
(
m_namespace
==
L"wp"
)
{
{
if
(
m_lGroupIndex
==
0
)
name_
=
L"wpg:wgp"
;
if
(
m_lGroupIndex
==
0
)
name_
=
L"wpg:wgp"
;
else
name_
=
L"wpg:grpSp"
;
else
name_
=
L"wpg:grpSp"
;
...
...
ASCOfficePPTXFile/PPTXFormat/Logic/Table/Table.h
View file @
5d8dda02
...
@@ -86,6 +86,9 @@ namespace PPTX
...
@@ -86,6 +86,9 @@ namespace PPTX
if
(
strName
==
L"tblGrid"
)
if
(
strName
==
L"tblGrid"
)
{
{
if
(
oReader
.
IsEmptyNode
()
)
continue
;
int
nParentDepth1
=
oReader
.
GetDepth
();
int
nParentDepth1
=
oReader
.
GetDepth
();
while
(
oReader
.
ReadNextSiblingNode
(
nParentDepth1
)
)
while
(
oReader
.
ReadNextSiblingNode
(
nParentDepth1
)
)
{
{
...
...
ASCOfficePPTXFile/PPTXFormat/Logic/TextFit.h
View file @
5d8dda02
...
@@ -107,25 +107,36 @@ namespace PPTX
...
@@ -107,25 +107,36 @@ namespace PPTX
}
}
virtual
void
fromXML
(
XmlUtils
::
CXmlLiteReader
&
oReader
)
virtual
void
fromXML
(
XmlUtils
::
CXmlLiteReader
&
oReader
)
{
{
ReadAttributes
(
oReader
);
std
::
wstring
strName
=
oReader
.
GetName
(
);
int
nCurDepth
=
oReader
.
GetDepth
();
if
(
_T
(
"a:noAutofit"
)
==
strName
)
while
(
oReader
.
ReadNextSiblingNode
(
nCurDepth
)
)
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
)
void
ReadAttributes
(
XmlUtils
::
CXmlLiteReader
&
oReader
)
{
{
nullable_string
sFontScale
;
nullable_string
sLnSpcRed
;
WritingElement_ReadAttributes_Start
(
oReader
)
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
)
WritingElement_ReadAttributes_End
(
oReader
)
Normalize
(
sFontScale
,
sLnSpcRed
);
}
}
virtual
void
fromXML
(
XmlUtils
::
CXmlNode
&
node
)
virtual
void
fromXML
(
XmlUtils
::
CXmlNode
&
node
)
{
{
type
=
FitEmpty
;
type
=
FitEmpty
;
std
::
wstring
strName
=
XmlUtils
::
GetNameNoNS
(
node
.
GetName
()
);
std
::
wstring
strName
=
node
.
GetName
(
);
if
(
_T
(
"a:noAutofit"
)
==
strName
)
if
(
_T
(
"a:noAutofit"
)
==
strName
)
type
=
FitNo
;
type
=
FitNo
;
...
@@ -141,33 +152,7 @@ namespace PPTX
...
@@ -141,33 +152,7 @@ namespace PPTX
node
.
ReadAttributeBase
(
L"fontScale"
,
sFontScale
);
node
.
ReadAttributeBase
(
L"fontScale"
,
sFontScale
);
node
.
ReadAttributeBase
(
L"lnSpcReduction"
,
sLnSpcRed
);
node
.
ReadAttributeBase
(
L"lnSpcReduction"
,
sLnSpcRed
);
if
(
sFontScale
.
is_init
())
Normalize
(
sFontScale
,
sLnSpcRed
);
{
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
;
}
}
}
}
}
}
virtual
std
::
wstring
toXML
()
const
virtual
std
::
wstring
toXML
()
const
...
@@ -287,6 +272,37 @@ namespace PPTX
...
@@ -287,6 +272,37 @@ namespace PPTX
nullable_int
lnSpcReduction
;
nullable_int
lnSpcReduction
;
protected:
protected:
virtual
void
FillParentPointersForChilds
(){}
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 Logic
}
// namespace PPTX
}
// 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