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
48f95bd9
Commit
48f95bd9
authored
Dec 14, 2016
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug #33684
parent
42fb6583
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
23 deletions
+21
-23
ASCOfficeRtfFile/RtfFormatLib/source/RtfSection.cpp
ASCOfficeRtfFile/RtfFormatLib/source/RtfSection.cpp
+13
-13
ASCOfficeRtfFile/RtfFormatTest/RtfFormatTest.cpp
ASCOfficeRtfFile/RtfFormatTest/RtfFormatTest.cpp
+8
-10
No files found.
ASCOfficeRtfFile/RtfFormatLib/source/RtfSection.cpp
View file @
48f95bd9
...
...
@@ -93,9 +93,9 @@ CString RtfDocumentProperty::RenderToRtf(RenderParameter oRenderParameter)
{
switch
(
m_eFootnoteRestart
)
{
case
fr_EachPage
:
sResult
+=
L"ftnrstpg"
;
break
;
case
fr_EachSection
:
sResult
+=
L"ftnrestart"
;
break
;
case
fr_Continuous
:
sResult
+=
L"ftnrstcont"
;
break
;
case
fr_EachPage
:
sResult
+=
L"
\\
ftnrstpg"
;
break
;
case
fr_EachSection
:
sResult
+=
L"
\\
ftnrestart"
;
break
;
case
fr_Continuous
:
sResult
+=
L"
\\
ftnrstcont"
;
break
;
}
}
...
...
@@ -103,10 +103,10 @@ CString RtfDocumentProperty::RenderToRtf(RenderParameter oRenderParameter)
{
switch
(
m_eFootnoteRestart
)
{
case
fp_EndSection
:
sResult
+=
L"endnotes"
;
break
;
case
fp_EndDocument
:
sResult
+=
L"enddoc"
;
break
;
case
fp_BeneathText
:
sResult
+=
L"ftntj"
;
break
;
case
fp_BottomPage
:
sResult
+=
L"ftnbj"
;
break
;
case
fp_EndSection
:
sResult
+=
L"
\\
endnotes"
;
break
;
case
fp_EndDocument
:
sResult
+=
L"
\\
enddoc"
;
break
;
case
fp_BeneathText
:
sResult
+=
L"
\\
ftntj"
;
break
;
case
fp_BottomPage
:
sResult
+=
L"
\\
ftnbj"
;
break
;
}
}
...
...
@@ -119,18 +119,18 @@ CString RtfDocumentProperty::RenderToRtf(RenderParameter oRenderParameter)
{
switch
(
m_eEndnoteRestart
)
{
case
er_EachSection
:
sResult
+=
L"aftnrestart"
;
break
;
case
er_Continuous
:
sResult
+=
L"aftnrstcont"
;
break
;
case
er_EachSection
:
sResult
+=
L"
\\
aftnrestart"
;
break
;
case
er_Continuous
:
sResult
+=
L"
\\
aftnrstcont"
;
break
;
}
}
if
(
PROP_DEF
!=
m_eEndnotePlacement
)
{
switch
(
m_eEndnotePlacement
)
{
case
ep_EndSection
:
sResult
+=
L"aendnotes"
;
break
;
case
ep_EndDocument
:
sResult
+=
L"aenddoc"
;
break
;
case
ep_BeneathText
:
sResult
+=
L"aftntj"
;
break
;
case
ep_BottomPage
:
sResult
+=
L"aftnbj"
;
break
;
case
ep_EndSection
:
sResult
+=
L"
\\
aendnotes"
;
break
;
case
ep_EndDocument
:
sResult
+=
L"
\\
aenddoc"
;
break
;
case
ep_BeneathText
:
sResult
+=
L"
\\
aftntj"
;
break
;
case
ep_BottomPage
:
sResult
+=
L"
\\
aftnbj"
;
break
;
}
}
...
...
ASCOfficeRtfFile/RtfFormatTest/RtfFormatTest.cpp
View file @
48f95bd9
...
...
@@ -43,16 +43,13 @@
int
_tmain
(
int
argc
,
_TCHAR
*
argv
[])
{
std
::
wstring
srcFileName
=
argv
[
1
];
std
::
wstring
dstFileName
=
argv
[
2
];
std
::
wstring
outputDir
=
FileSystem
::
Directory
::
GetFolderPath
(
dstFileName
);
std
::
wstring
dstTempPath
=
FileSystem
::
Directory
::
CreateDirectoryWithUniqueName
(
outputDir
);
int
n1
=
srcFileName
.
rfind
(
_T
(
'.'
));
int
n2
=
dstFileName
.
rfind
(
_T
(
'.'
)
);
std
::
wstring
ext_1
=
n1
>=
0
?
srcFileName
.
substr
(
n1
+
1
,
srcFileName
.
length
()
-
n1
)
:
_T
(
""
);
//ext_1.MakeLower(
);
std
::
wstring
ext_1
=
n1
>=
0
?
srcFileName
.
substr
(
n1
+
1
,
srcFileName
.
length
()
-
n1
)
:
_T
(
""
);
//ext_1.MakeLower();
std
::
wstring
ext_2
=
n2
>=
0
?
dstFileName
.
substr
(
n2
+
1
,
dstFileName
.
length
()
-
n2
)
:
_T
(
""
);
//ext_2.MakeLower();
std
::
wstring
dstFileName
=
argc
>
2
?
argv
[
2
]
:
srcFileName
+
L"_my."
+
(
ext_1
==
L"rtf"
?
L"docx"
:
L"rtf"
);
std
::
wstring
outputDir
=
FileSystem
::
Directory
::
GetFolderPath
(
dstFileName
);
std
::
wstring
dstTempPath
=
FileSystem
::
Directory
::
CreateDirectoryWithUniqueName
(
outputDir
);
std
::
transform
(
ext_1
.
begin
(),
ext_1
.
end
(),
ext_1
.
begin
(),
::
tolower
);
...
...
@@ -61,7 +58,8 @@ int _tmain(int argc, _TCHAR* argv[])
rtfConvert
.
m_sTempFolder
=
dstTempPath
;
COfficeUtils
oCOfficeUtils
(
NULL
);
if
(
ext_1
==
_T
(
"rtf"
))
if
(
ext_1
==
L"rtf"
)
{
// rtf->docx
rtfConvert
.
ConvertRtfToOOX
(
srcFileName
,
dstTempPath
);
...
...
@@ -69,7 +67,7 @@ int _tmain(int argc, _TCHAR* argv[])
if
(
S_OK
!=
oCOfficeUtils
.
CompressFileOrDirectory
(
dstTempPath
.
c_str
(),
dstFileName
.
c_str
(),
-
1
))
return
S_FALSE
;
}
if
(
ext_2
==
_T
(
"rtf"
))
else
{
// docx->rtf
if
(
S_OK
!=
oCOfficeUtils
.
ExtractToDirectory
(
srcFileName
.
c_str
(),
dstTempPath
.
c_str
(),
NULL
,
0
))
...
...
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