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
1e54cf26
Commit
1e54cf26
authored
Apr 08, 2016
by
ElenaSubbotina
Committed by
Alexander Trofimov
May 21, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DocFormatReader - странности при сохранении формул из docx в doc
parent
1a057290
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
37 deletions
+28
-37
ASCOfficeDocFile/DocDocxConverter/DocumentMapping.cpp
ASCOfficeDocFile/DocDocxConverter/DocumentMapping.cpp
+12
-5
ASCOfficeDocFile/DocFormatLib/DocFormatLib.h
ASCOfficeDocFile/DocFormatLib/DocFormatLib.h
+0
-19
ASCOfficeDocFile/DocFormatTest/DocFormatTest.cpp
ASCOfficeDocFile/DocFormatTest/DocFormatTest.cpp
+16
-9
ASCOfficeOdfFile/Test/ASCOfficeOdfFileTest/ASCOfficeOdfFileTest.cpp
...dfFile/Test/ASCOfficeOdfFileTest/ASCOfficeOdfFileTest.cpp
+0
-4
No files found.
ASCOfficeDocFile/DocDocxConverter/DocumentMapping.cpp
View file @
1e54cf26
...
...
@@ -506,6 +506,7 @@ namespace DocFileFormat
std
::
wstring
word
(
_T
(
" Word"
)
);
std
::
wstring
equation
(
_T
(
" Equation"
)
)
;
std
::
wstring
mergeformat
(
_T
(
" MERGEFORMAT"
)
);
std
::
wstring
quote
(
_T
(
" QUOTE"
)
);
if
(
search
(
f
.
begin
(),
f
.
end
(),
form
.
begin
(),
form
.
end
()
)
!=
f
.
end
()
)
{
...
...
@@ -530,9 +531,15 @@ namespace DocFileFormat
this
->
_fldCharCounter
++
;
}
else
if
((
search
(
f
.
begin
(),
f
.
end
(),
mergeformat
.
begin
(),
mergeformat
.
end
())
!=
f
.
end
())
||
((
search
(
f
.
begin
(),
f
.
end
(),
excel
.
begin
(),
excel
.
end
())
!=
f
.
end
()
||
search
(
f
.
begin
(),
f
.
end
(),
word
.
begin
(),
word
.
end
())
!=
f
.
end
())
else
if
(
search
(
f
.
begin
(),
f
.
end
(),
quote
.
begin
(),
quote
.
end
())
!=
f
.
end
())
{
//todooo сохранить docx с формулой мс офис в doc.
//todooo формула там где то храниться !! найти
this
->
_skipRuns
=
3
;
}
else
if
((
search
(
f
.
begin
(),
f
.
end
(),
mergeformat
.
begin
(),
mergeformat
.
end
())
!=
f
.
end
())
||
((
search
(
f
.
begin
(),
f
.
end
(),
excel
.
begin
(),
excel
.
end
())
!=
f
.
end
()
||
search
(
f
.
begin
(),
f
.
end
(),
word
.
begin
(),
word
.
end
())
!=
f
.
end
())
&&
(
search
(
f
.
begin
(),
f
.
end
(),
embed
.
begin
(),
embed
.
end
())
!=
f
.
end
()
||
search
(
f
.
begin
(),
f
.
end
(),
link
.
begin
(),
link
.
end
()
)
!=
f
.
end
())
))
...
...
@@ -549,8 +556,8 @@ namespace DocFileFormat
this
->
_fldCharCounter
++
;
}
else
if
(
search
(
f
.
begin
(),
f
.
end
(),
embed
.
begin
(),
embed
.
end
())
!=
f
.
end
()
||
search
(
f
.
begin
(),
f
.
end
(),
link
.
begin
(),
link
.
end
()
)
!=
f
.
end
())
else
if
(
search
(
f
.
begin
(),
f
.
end
(),
embed
.
begin
(),
embed
.
end
())
!=
f
.
end
()
||
search
(
f
.
begin
(),
f
.
end
(),
link
.
begin
(),
link
.
end
()
)
!=
f
.
end
())
{
int
cpPic
=
searchNextTextMark
(
m_document
->
Text
,
cpFieldStart
,
TextMark
::
Picture
);
int
cpFieldSep
=
searchNextTextMark
(
m_document
->
Text
,
cpFieldStart
,
TextMark
::
FieldSeparator
);
...
...
ASCOfficeDocFile/DocFormatLib/DocFormatLib.h
View file @
1e54cf26
...
...
@@ -16,31 +16,12 @@ class COfficeDocFile
public:
COfficeDocFile
()
{
m_strTempDirectory
=
L""
;
}
virtual
~
COfficeDocFile
()
{
}
private:
std
::
wstring
m_strTempDirectory
;
public:
HRESULT
put_TempDirectory
(
std
::
wstring
sDir
)
{
m_strTempDirectory
=
sDir
;
return
S_OK
;
}
std
::
wstring
get_TempDirectory
()
{
return
m_strTempDirectory
;
}
HRESULT
LoadFromFile
(
std
::
wstring
sSrcFileName
,
std
::
wstring
sDstFileName
,
ProgressCallback
*
ffCallBack
=
NULL
);
HRESULT
SaveToFile
(
std
::
wstring
sDstFileName
,
std
::
wstring
sSrcFileName
,
ProgressCallback
*
ffCallBack
=
NULL
);
...
...
ASCOfficeDocFile/DocFormatTest/DocFormatTest.cpp
View file @
1e54cf26
// DocFormatTest.cpp : Defines the entry point for the console application.
//
#include "../
../../../ASCOfficeDocFile/
DocFormatLib/DocFormatLib.h"
#include "../DocFormatLib/DocFormatLib.h"
#include "../../../../ASCOfficeDocFile/win32/ASCOfficeCriticalSection.h"
#include "../win32/ASCOfficeCriticalSection.h"
#include "../../OfficeUtils/src/OfficeUtils.h"
#include "../../Common/DocxFormat/Source/SystemUtility/FileSystem/Directory.h"
#include <string>
#include <tchar.h>
int
_tmain
(
int
argc
,
_TCHAR
*
argv
[])
{
std
::
wstring
sSrcDoc
=
_T
(
"d:
\\
test
\\
_doc
\\
PZ.doc"
)
;
std
::
wstring
s
ResBackDocx
=
_T
(
"d:
\\
test
\\
_doc
\\
PZ.doc-my.docx"
)
;
std
::
wstring
sSrcDoc
=
argv
[
1
]
;
std
::
wstring
s
DstDocx
=
argv
[
2
]
;
std
::
wstring
sTemp
=
_T
(
"d:
\\
home/lena/Documents/temp"
);
std
::
wstring
sXMLOptions
=
_T
(
""
);
std
::
wstring
outputDir
=
FileSystem
::
Directory
::
GetFolderPath
(
sDstDocx
);
std
::
wstring
dstTempPath
=
FileSystem
::
Directory
::
CreateDirectoryWithUniqueName
(
outputDir
);
// doc->docx
COfficeDocFile
docFile
;
docFile
.
put_TempDirectory
(
sTemp
);
HRESULT
hRes
=
docFile
.
LoadFromFile
(
sSrcDoc
,
sResBackDocx
,
NULL
);
HRESULT
hRes
=
docFile
.
LoadFromFile
(
sSrcDoc
,
dstTempPath
,
NULL
);
if
(
hRes
!=
S_OK
)
return
2
;
COfficeUtils
oCOfficeUtils
(
NULL
);
if
(
S_OK
!=
oCOfficeUtils
.
CompressFileOrDirectory
(
dstTempPath
.
c_str
(),
sDstDocx
,
-
1
))
return
1
;
FileSystem
::
Directory
::
DeleteDirectory
(
dstTempPath
);
return
0
;
}
...
...
ASCOfficeOdfFile/Test/ASCOfficeOdfFileTest/ASCOfficeOdfFileTest.cpp
View file @
1e54cf26
...
...
@@ -6,10 +6,6 @@
#include "../../../OfficeUtils/src/OfficeUtils.h"
#include <boost/algorithm/string/case_conv.hpp>
#include <boost/lexical_cast.hpp>
#include "../../../Common/DocxFormat/Source/Base/Base.h"
#include "../../../Common/DocxFormat/Source/SystemUtility/FileSystem/Directory.h"
#include "../../src/ConvertOO2OOX.h"
...
...
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