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
3eeec8fc
Commit
3eeec8fc
authored
Dec 11, 2017
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
RtfFormat - fix users file
parent
41a21349
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
22 deletions
+30
-22
ASCOfficeRtfFile/RtfFormatLib/source/DestinationCommand.cpp
ASCOfficeRtfFile/RtfFormatLib/source/DestinationCommand.cpp
+25
-21
ASCOfficeRtfFile/RtfFormatTest/RtfFormatTest.vcproj
ASCOfficeRtfFile/RtfFormatTest/RtfFormatTest.vcproj
+5
-1
No files found.
ASCOfficeRtfFile/RtfFormatLib/source/DestinationCommand.cpp
View file @
3eeec8fc
...
...
@@ -54,12 +54,12 @@ HRESULT ConvertOle1ToOle2(BYTE *pData, int nSize, std::wstring sOle2Name)
_UINT32
name_size
=
name
.
length
()
+
1
;
//Ole
BYTE
dataOleInfo
[]
=
{
0x01
,
0x00
,
0x00
,
0x02
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
};
POLE
::
Stream
oStream3
(
storageOut
,
"
\001
Ole"
,
true
,
20
);
POLE
::
Stream
oStream3
(
storageOut
,
L
"
\001
Ole"
,
true
,
20
);
oStream3
.
write
(
dataOleInfo
,
20
);
oStream3
.
flush
();
//CompObj
BYTE
dataCompObjHeader
[
28
]
=
{
0x01
,
0x00
,
0xfe
,
0xff
,
0x03
,
0x0a
,
0x00
,
0x00
,
0xff
,
0xff
,
0xff
,
0xff
,
0x0a
,
0x00
,
0x03
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0xc0
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x46
};
POLE
::
Stream
oStream1
(
storageOut
,
"
\001
CompObj"
,
true
,
28
+
(
name_size
+
5
)
+
2
*
(
ole1Reader
.
Header
.
ClassName
.
size
+
4
)
+
4
*
4
);
POLE
::
Stream
oStream1
(
storageOut
,
L
"
\001
CompObj"
,
true
,
28
+
(
name_size
+
5
)
+
2
*
(
ole1Reader
.
Header
.
ClassName
.
size
+
4
)
+
4
*
4
);
oStream1
.
write
(
dataCompObjHeader
,
28
);
oStream1
.
write
((
BYTE
*
)
&
name_size
,
4
);
...
...
@@ -1027,7 +1027,14 @@ bool RtfParagraphPropsCommand::ExecuteCommand(RtfDocument& oDocument, RtfReader&
}
}
COMMAND_RTF_BOOL
(
"intbl"
,
paragraphProps
->
m_bInTable
,
sCommand
,
hasParameter
,
parameter
)
COMMAND_RTF_INT
(
"itap"
,
paragraphProps
->
m_nItap
,
sCommand
,
hasParameter
,
parameter
)
else
if
(
"itap"
==
sCommand
&&
hasParameter
)
{
paragraphProps
->
m_nItap
=
parameter
;
if
(
parameter
==
0
)
{
paragraphProps
->
m_bInTable
=
0
;
}
}
COMMAND_RTF_BOOL
(
"keep"
,
paragraphProps
->
m_bKeep
,
sCommand
,
hasParameter
,
parameter
)
COMMAND_RTF_BOOL
(
"keepn"
,
paragraphProps
->
m_bKeepNext
,
sCommand
,
hasParameter
,
parameter
)
COMMAND_RTF_BOOL
(
"pagebb"
,
paragraphProps
->
m_bPageBB
,
sCommand
,
hasParameter
,
parameter
)
...
...
@@ -2283,7 +2290,8 @@ void RtfParagraphPropDestination::AddItem( RtfParagraphPtr oItem, RtfReader& oRe
{
// 1 != oItem->m_oProperty.m_bInTable - параграф не в таблице
// PROP_DEF != nTargetItap && oItem->m_oProperty.m_nItap <= nTargetItap - выставлено свойство,что вложенность - nTargetItap - это не таблица( Нужно для чтения параграфов в таблицах )
if
(
1
!=
oItem
->
m_oProperty
.
m_bInTable
||
(
PROP_DEF
!=
nTargetItap
&&
oItem
->
m_oProperty
.
m_nItap
<=
nTargetItap
)
)
if
(
(
1
!=
oItem
->
m_oProperty
.
m_bInTable
||
0
==
oItem
->
m_oProperty
.
m_nItap
)
//Платежное_поручение.rtf
||
(
PROP_DEF
!=
nTargetItap
&&
oItem
->
m_oProperty
.
m_nItap
<=
nTargetItap
)
)
{
if
(
nCurItap
>
0
)
//Если до этого были только параграфы в таблицах - завершаем таблицу
{
...
...
@@ -2292,15 +2300,13 @@ void RtfParagraphPropDestination::AddItem( RtfParagraphPtr oItem, RtfReader& oRe
for
(
int
k
=
(
int
)
aRows
.
size
()
-
1
;
k
>=
0
;
k
--
)
{
if
(
aRowItaps
[
k
]
==
nCurItap
)
{
oNewTable
->
InsertItem
(
aRows
[
k
],
0
);
aRows
.
erase
(
aRows
.
begin
()
+
k
);
aRowItaps
.
erase
(
aRowItaps
.
begin
()
+
k
);
}
else
if
(
aRowItaps
[
k
]
!=
nCurItap
)
break
;
oNewTable
->
InsertItem
(
aRows
[
k
],
0
);
aRows
.
erase
(
aRows
.
begin
()
+
k
);
aRowItaps
.
erase
(
aRowItaps
.
begin
()
+
k
);
}
//вычисляем свойства для OOX
oNewTable
->
CalculateGridProp
();
...
...
@@ -2339,15 +2345,13 @@ void RtfParagraphPropDestination::AddItem( RtfParagraphPtr oItem, RtfReader& oRe
for
(
int
k
=
(
int
)
aRows
.
size
()
-
1
;
k
>=
0
;
k
--
)
{
if
(
aRowItaps
[
k
]
==
nCurItap
)
{
oNewTable
->
InsertItem
(
aRows
[
k
],
0
);
aRows
.
erase
(
aRows
.
begin
()
+
k
);
aRowItaps
.
erase
(
aRowItaps
.
begin
()
+
k
);
}
else
if
(
aRowItaps
[
k
]
!=
nCurItap
)
break
;
oNewTable
->
InsertItem
(
aRows
[
k
],
0
);
aRows
.
erase
(
aRows
.
begin
()
+
k
);
aRowItaps
.
erase
(
aRowItaps
.
begin
()
+
k
);
}
//вычисляем свойства для OOX
oNewTable
->
CalculateGridProp
();
...
...
@@ -2386,7 +2390,7 @@ void RtfParagraphPropDestination::AddItem( RtfParagraphPtr oItem, RtfReader& oRe
//добавляем параграф во временные cell
aCellRenderables
.
push_back
(
oItem
);
//содержит все параграфы, не разложенные по cell
aItaps
.
push_back
(
nCurItap
);
//содержит все номера вложенности параграфов
if
(
bEndCell
)
{
RtfTableCellPtr
oNewTableCell
(
new
RtfTableCell
()
);
...
...
ASCOfficeRtfFile/RtfFormatTest/RtfFormatTest.vcproj
View file @
3eeec8fc
...
...
@@ -65,7 +65,7 @@
/>
<Tool
Name=
"VCLinkerTool"
AdditionalDependencies=
"Urlmon.lib"
AdditionalDependencies=
"Urlmon.lib
Rpcrt4.lib
"
LinkIncremental=
"1"
IgnoreDefaultLibraryNames=
"LIBCMT.lib"
IgnoreEmbeddedIDL=
"true"
...
...
@@ -407,6 +407,10 @@
RelativePath=
"..\..\ASCOfficeOdfFile\src\odf\svg_parser.cpp"
>
</File>
<File
RelativePath=
"..\..\Common\DocxFormat\Source\Base\unicode_util.cpp"
>
</File>
<File
RelativePath=
"..\..\UnicodeConverter\UnicodeConverter.cpp"
>
...
...
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