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
08399f16
Commit
08399f16
authored
May 13, 2016
by
ElenaSubbotina
Committed by
Alexander Trofimov
May 21, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DocFormatReader - конвертация объекта автосодержание
parent
ed5e68c9
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
383 additions
and
337 deletions
+383
-337
ASCOfficeDocFile/DocDocxConverter/CharacterPropertiesMapping.cpp
...ceDocFile/DocDocxConverter/CharacterPropertiesMapping.cpp
+21
-13
ASCOfficeDocFile/DocDocxConverter/CharacterPropertiesMapping.h
...ficeDocFile/DocDocxConverter/CharacterPropertiesMapping.h
+10
-9
ASCOfficeDocFile/DocDocxConverter/DocumentMapping.cpp
ASCOfficeDocFile/DocDocxConverter/DocumentMapping.cpp
+349
-314
ASCOfficeDocFile/DocDocxConverter/DocumentMapping.h
ASCOfficeDocFile/DocDocxConverter/DocumentMapping.h
+3
-1
No files found.
ASCOfficeDocFile/DocDocxConverter/CharacterPropertiesMapping.cpp
View file @
08399f16
...
...
@@ -6,23 +6,25 @@ namespace DocFileFormat
CharacterPropertiesMapping
::
CharacterPropertiesMapping
(
XmlUtils
::
CXmlWriter
*
writer
,
WordDocument
*
doc
,
RevisionData
*
rev
,
ParagraphPropertyExceptions
*
currentPapx
,
bool
styleChpx
,
bool
isRunStyleNeeded
)
:
PropertiesMapping
(
writer
),
_isRunStyleNeeded
(
isRunStyleNeeded
),
_isOwnRPr
(
true
),
_isRTL
(
false
)
{
this
->
_doc
=
doc
;
this
->
_rPr
=
new
XMLTools
::
XMLElement
<
wchar_t
>
(
_T
(
"w:rPr"
)
);
this
->
_revisionData
=
rev
;
this
->
_currentPapx
=
currentPapx
;
this
->
_styleChpx
=
styleChpx
;
this
->
_currentIstd
=
USHRT_MAX
;
_doc
=
doc
;
_rPr
=
new
XMLTools
::
XMLElement
<
wchar_t
>
(
_T
(
"w:rPr"
)
);
_revisionData
=
rev
;
_currentPapx
=
currentPapx
;
_styleChpx
=
styleChpx
;
_currentIstd
=
USHRT_MAX
;
_webHidden
=
false
;
}
CharacterPropertiesMapping
::
CharacterPropertiesMapping
(
XMLTools
::
XMLElement
<
wchar_t
>*
rPr
,
WordDocument
*
doc
,
RevisionData
*
rev
,
ParagraphPropertyExceptions
*
currentPapx
,
bool
styleChpx
,
bool
isRunStyleNeeded
)
:
PropertiesMapping
(
NULL
),
_isRunStyleNeeded
(
isRunStyleNeeded
),
_isOwnRPr
(
false
),
_isRTL
(
false
)
{
this
->
_doc
=
doc
;
this
->
_rPr
=
rPr
;
this
->
_revisionData
=
rev
;
this
->
_currentPapx
=
currentPapx
;
this
->
_styleChpx
=
styleChpx
;
this
->
_currentIstd
=
USHRT_MAX
;
_doc
=
doc
;
_rPr
=
rPr
;
_revisionData
=
rev
;
_currentPapx
=
currentPapx
;
_styleChpx
=
styleChpx
;
_currentIstd
=
USHRT_MAX
;
_webHidden
=
false
;
}
CharacterPropertiesMapping
::~
CharacterPropertiesMapping
()
...
...
@@ -89,6 +91,12 @@ namespace DocFileFormat
XMLTools
::
XMLAttribute
<
wchar_t
>
*
colorVal
=
new
XMLTools
::
XMLAttribute
<
wchar_t
>
(
_T
(
"w:val"
)
);
XMLTools
::
XMLElement
<
wchar_t
>
*
lang
=
new
XMLTools
::
XMLElement
<
wchar_t
>
(
_T
(
"w:lang"
)
);
if
(
_webHidden
)
{
XMLTools
::
XMLElement
<
wchar_t
>
*
webHidden
=
new
XMLTools
::
XMLElement
<
wchar_t
>
(
_T
(
"w:webHidden"
)
);
parent
->
AppendChild
(
*
webHidden
);
RELEASEOBJECT
(
webHidden
);
}
std
::
list
<
SinglePropertyModifier
>::
iterator
end
=
sprms
->
end
();
for
(
std
::
list
<
SinglePropertyModifier
>::
iterator
iter
=
sprms
->
begin
();
iter
!=
end
;
++
iter
)
{
...
...
@@ -96,7 +104,7 @@ namespace DocFileFormat
{
case
0x4A30
:
// style id
{
if
(
_isRunStyleNeeded
)
if
(
_isRunStyleNeeded
&&
!
_webHidden
)
{
_currentIstd
=
FormatUtils
::
BytesToUInt16
(
iter
->
Arguments
,
0
,
iter
->
argumentsSize
);
if
(
_currentIstd
<
this
->
_doc
->
Styles
->
Styles
->
size
())
...
...
ASCOfficeDocFile/DocDocxConverter/CharacterPropertiesMapping.h
View file @
08399f16
...
...
@@ -29,7 +29,8 @@ namespace DocFileFormat
void
Apply
(
IVisitable
*
chpx
);
bool
CheckIsSymbolFont
();
bool
_isRTL
;
bool
_webHidden
;
bool
_isRTL
;
private:
void
convertSprms
(
list
<
SinglePropertyModifier
>*
sprms
,
XMLTools
::
XMLElement
<
wchar_t
>*
parent
);
list
<
CharacterPropertyExceptions
*>
buildHierarchy
(
const
StyleSheet
*
styleSheet
,
unsigned
short
istdStart
);
...
...
@@ -42,17 +43,17 @@ namespace DocFileFormat
virtual
void
appendFlagElement
(
XMLTools
::
XMLElement
<
wchar_t
>*
node
,
const
SinglePropertyModifier
&
sprm
,
const
wchar_t
*
elementName
,
bool
unique
);
private:
XmlUtils
::
CXmlWriter
pRunPr
;
WordDocument
*
_doc
;
XMLTools
::
XMLElement
<
wchar_t
>*
_rPr
;
unsigned
short
_currentIstd
;
RevisionData
*
_revisionData
;
bool
_styleChpx
;
WordDocument
*
_doc
;
XMLTools
::
XMLElement
<
wchar_t
>*
_rPr
;
unsigned
short
_currentIstd
;
RevisionData
*
_revisionData
;
bool
_styleChpx
;
XmlUtils
::
CXmlWriter
pRunPr
;
ParagraphPropertyExceptions
*
_currentPapx
;
list
<
CharacterPropertyExceptions
*>
_hierarchy
;
ParagraphPropertyExceptions
*
_currentPapx
;
list
<
CharacterPropertyExceptions
*>
_hierarchy
;
bool
_isRunStyleNeeded
;
bool
_isOwnRPr
;
...
...
ASCOfficeDocFile/DocDocxConverter/DocumentMapping.cpp
View file @
08399f16
This diff is collapsed.
Click to expand it.
ASCOfficeDocFile/DocDocxConverter/DocumentMapping.h
View file @
08399f16
...
...
@@ -99,9 +99,11 @@ namespace DocFileFormat
WordDocument
*
m_document
;
ConversionContext
*
m_context
;
IMapping
*
_caller
;
ParagraphPropertyExceptions
*
_lastValidPapx
;
SectionPropertyExceptions
*
_lastValidSepx
;
int
_skipRuns
;
int
_sectionNr
;
int
_footnoteNr
;
...
...
@@ -109,8 +111,8 @@ namespace DocFileFormat
int
_commentNr
;
int
_isSectionPageBreak
;
//0 - not set, 1 -page break, 2 - continues
bool
_writeInstrText
;
bool
_writeWebHidden
;
unsigned
int
_fldCharCounter
;
IMapping
*
_caller
;
std
::
wstring
_writeAfterRun
;
};
}
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