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
51c8ab54
Commit
51c8ab54
authored
Dec 09, 2016
by
Oleg Korshul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add common method (GetFormatByExtension)
parent
4176176e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
0 deletions
+54
-0
Common/OfficeFileFormatChecker.h
Common/OfficeFileFormatChecker.h
+1
-0
Common/OfficeFileFormatChecker2.cpp
Common/OfficeFileFormatChecker2.cpp
+53
-0
No files found.
Common/OfficeFileFormatChecker.h
View file @
51c8ab54
...
...
@@ -59,6 +59,7 @@ public:
std
::
wstring
GetFormatExtension
(
const
std
::
wstring
&
fileName
);
std
::
wstring
GetExtensionByType
(
int
type
);
static
int
GetFormatByExtension
(
const
std
::
wstring
&
ext
);
private:
...
...
Common/OfficeFileFormatChecker2.cpp
View file @
51c8ab54
...
...
@@ -574,6 +574,59 @@ std::wstring COfficeFileFormatChecker::GetExtensionByType(int type)
return
L""
;
}
int
COfficeFileFormatChecker
::
GetFormatByExtension
(
const
std
::
wstring
&
ext
)
{
if
(
L".docx"
==
ext
)
return
AVS_OFFICESTUDIO_FILE_DOCUMENT_DOCX
;
if
(
L".doc"
==
ext
)
return
AVS_OFFICESTUDIO_FILE_DOCUMENT_DOC
;
if
(
L".odt"
==
ext
)
return
AVS_OFFICESTUDIO_FILE_DOCUMENT_ODT
;
if
(
L".rtf"
==
ext
)
return
AVS_OFFICESTUDIO_FILE_DOCUMENT_RTF
;
if
(
L".txt"
==
ext
)
return
AVS_OFFICESTUDIO_FILE_DOCUMENT_TXT
;
if
(
L".html"
==
ext
)
return
AVS_OFFICESTUDIO_FILE_DOCUMENT_HTML
;
if
(
L".mht"
==
ext
)
return
AVS_OFFICESTUDIO_FILE_DOCUMENT_MHT
;
if
(
L".epub"
==
ext
)
return
AVS_OFFICESTUDIO_FILE_DOCUMENT_EPUB
;
if
(
L".fb2"
==
ext
)
return
AVS_OFFICESTUDIO_FILE_DOCUMENT_FB2
;
if
(
L".mobi"
==
ext
)
return
AVS_OFFICESTUDIO_FILE_DOCUMENT_MOBI
;
if
(
L".pptx"
==
ext
)
return
AVS_OFFICESTUDIO_FILE_PRESENTATION_PPTX
;
if
(
L".ppt"
==
ext
)
return
AVS_OFFICESTUDIO_FILE_PRESENTATION_PPT
;
if
(
L".odp"
==
ext
)
return
AVS_OFFICESTUDIO_FILE_PRESENTATION_ODP
;
if
(
L".ppsx"
==
ext
)
return
AVS_OFFICESTUDIO_FILE_PRESENTATION_PPSX
;
if
(
L".xlsx"
==
ext
)
return
AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSX
;
if
(
L".xls"
==
ext
)
return
AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLS
;
if
(
L".ods"
==
ext
)
return
AVS_OFFICESTUDIO_FILE_SPREADSHEET_ODS
;
if
(
L".csv"
==
ext
)
return
AVS_OFFICESTUDIO_FILE_SPREADSHEET_CSV
;
if
(
L".pdf"
==
ext
)
return
AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_PDF
;
if
(
L".djvu"
==
ext
)
return
AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_DJVU
;
if
(
L".xps"
==
ext
)
return
AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_XPS
;
return
0
;
}
std
::
wstring
COfficeFileFormatChecker
::
GetFormatExtension
(
const
std
::
wstring
&
fileName
)
{
if
(
isOfficeFile
(
fileName
))
...
...
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