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
007a984c
Commit
007a984c
authored
Sep 13, 2017
by
konovalovsergey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
store Editor.xlsx without m_bSaveXFile flag
parent
d3d31804
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
32 deletions
+26
-32
X2tConverter/src/ASCConverters.cpp
X2tConverter/src/ASCConverters.cpp
+24
-21
X2tConverter/src/ASCConverters.h
X2tConverter/src/ASCConverters.h
+2
-2
X2tConverter/src/cextracttools.h
X2tConverter/src/cextracttools.h
+0
-9
No files found.
X2tConverter/src/ASCConverters.cpp
View file @
007a984c
...
@@ -487,10 +487,22 @@ namespace NExtractTools
...
@@ -487,10 +487,22 @@ namespace NExtractTools
}
}
else
return
AVS_FILEUTILS_ERROR_CONVERT
;
}
else
return
AVS_FILEUTILS_ERROR_CONVERT
;
}
return
xlsx_dir2xlst_bin
(
sTempUnpackedXLSX
,
sTo
,
params
,
true
);
return
xlsx_dir2xlst_bin
(
sTempUnpackedXLSX
,
sTo
,
params
,
true
,
sFrom
);
}
}
int
xlsx_dir2xlst_bin
(
const
std
::
wstring
&
sXlsxDir
,
const
std
::
wstring
&
sTo
,
InputParams
&
params
,
bool
bXmlOptions
)
int
xlsx_dir2xlst_bin
(
const
std
::
wstring
&
sXlsxDir
,
const
std
::
wstring
&
sTo
,
InputParams
&
params
,
bool
bXmlOptions
,
const
std
::
wstring
&
sXlsxFile
)
{
{
//save Editor.xlsx for pivot
std
::
wstring
sToDir
=
NSDirectory
::
GetFolderPath
(
sTo
);
std
::
wstring
sEditorXLSX
=
sToDir
+
FILE_SEPARATOR_STR
+
_T
(
"Editor.xlsx"
);
if
(
sXlsxFile
.
empty
())
{
dir2zip
(
sXlsxDir
,
sEditorXLSX
);
}
else
{
NSFile
::
CFileBinary
::
Copy
(
sXlsxFile
,
sEditorXLSX
);
}
// Save to file (from temp dir)
// Save to file (from temp dir)
BinXlsxRW
::
CXlsxSerializer
m_oCXlsxSerializer
;
BinXlsxRW
::
CXlsxSerializer
m_oCXlsxSerializer
;
...
@@ -3011,7 +3023,7 @@ namespace NExtractTools
...
@@ -3011,7 +3023,7 @@ namespace NExtractTools
return
nRes
;
return
nRes
;
}
}
int
fromXlsxDir
(
const
std
::
wstring
&
sFrom
,
const
std
::
wstring
&
sTo
,
int
nFormatTo
,
const
std
::
wstring
&
sTemp
,
const
std
::
wstring
&
sThemeDir
,
bool
bFromChanges
,
bool
bPaid
,
InputParams
&
params
,
bool
isSavedX
File
)
int
fromXlsxDir
(
const
std
::
wstring
&
sFrom
,
const
std
::
wstring
&
sTo
,
int
nFormatTo
,
const
std
::
wstring
&
sTemp
,
const
std
::
wstring
&
sThemeDir
,
bool
bFromChanges
,
bool
bPaid
,
InputParams
&
params
,
const
std
::
wstring
&
sXlsx
File
)
{
{
int
nRes
=
0
;
int
nRes
=
0
;
if
(
0
!=
(
AVS_OFFICESTUDIO_FILE_SPREADSHEET
&
nFormatTo
)
&&
AVS_OFFICESTUDIO_FILE_SPREADSHEET_CSV
!=
nFormatTo
)
if
(
0
!=
(
AVS_OFFICESTUDIO_FILE_SPREADSHEET
&
nFormatTo
)
&&
AVS_OFFICESTUDIO_FILE_SPREADSHEET_CSV
!=
nFormatTo
)
...
@@ -3042,11 +3054,11 @@ namespace NExtractTools
...
@@ -3042,11 +3054,11 @@ namespace NExtractTools
}
}
else
if
(
AVS_OFFICESTUDIO_FILE_OTHER_JSON
==
nFormatTo
)
else
if
(
AVS_OFFICESTUDIO_FILE_OTHER_JSON
==
nFormatTo
)
{
{
nRes
=
xlsx_dir2xlst_bin
(
sFrom
,
sTo
,
params
,
true
);
nRes
=
xlsx_dir2xlst_bin
(
sFrom
,
sTo
,
params
,
true
,
sXlsxFile
);
}
}
else
if
(
AVS_OFFICESTUDIO_FILE_CANVAS_SPREADSHEET
==
nFormatTo
)
else
if
(
AVS_OFFICESTUDIO_FILE_CANVAS_SPREADSHEET
==
nFormatTo
)
{
{
nRes
=
xlsx_dir2xlst_bin
(
sFrom
,
sTo
,
params
,
true
);
nRes
=
xlsx_dir2xlst_bin
(
sFrom
,
sTo
,
params
,
true
,
sXlsxFile
);
}
}
else
else
{
{
...
@@ -3054,19 +3066,14 @@ namespace NExtractTools
...
@@ -3054,19 +3066,14 @@ namespace NExtractTools
NSDirectory
::
CreateDirectory
(
sXlstDir
);
NSDirectory
::
CreateDirectory
(
sXlstDir
);
std
::
wstring
sTFile
=
sXlstDir
+
FILE_SEPARATOR_STR
+
_T
(
"Editor.bin"
);
std
::
wstring
sTFile
=
sXlstDir
+
FILE_SEPARATOR_STR
+
_T
(
"Editor.bin"
);
if
(
AVS_OFFICESTUDIO_FILE_SPREADSHEET_CSV
==
nFormatTo
)
if
(
AVS_OFFICESTUDIO_FILE_SPREADSHEET_CSV
==
nFormatTo
)
nRes
=
xlsx_dir2xlst_bin
(
sFrom
,
sTFile
,
params
,
false
);
nRes
=
xlsx_dir2xlst_bin
(
sFrom
,
sTFile
,
params
,
false
,
sXlsxFile
);
else
else
nRes
=
xlsx_dir2xlst_bin
(
sFrom
,
sTFile
,
params
,
true
);
nRes
=
xlsx_dir2xlst_bin
(
sFrom
,
sTFile
,
params
,
true
,
sXlsxFile
);
if
(
SUCCEEDED_X2T
(
nRes
))
if
(
SUCCEEDED_X2T
(
nRes
))
{
{
nRes
=
fromXlstBin
(
sTFile
,
sTo
,
nFormatTo
,
sTemp
,
sThemeDir
,
bFromChanges
,
bPaid
,
params
);
nRes
=
fromXlstBin
(
sTFile
,
sTo
,
nFormatTo
,
sTemp
,
sThemeDir
,
bFromChanges
,
bPaid
,
params
);
}
}
}
}
if
(
SUCCEEDED_X2T
(
nRes
)
&&
!
isSavedXFile
&&
params
.
getSaveXFile
())
{
std
::
wstring
sToDir
=
NSDirectory
::
GetFolderPath
(
sTo
);
nRes
=
dir2zip
(
sFrom
,
sToDir
+
FILE_SEPARATOR_STR
+
_T
(
"Editor.xlsx"
));
}
return
nRes
;
return
nRes
;
}
}
int
fromXlstBin
(
const
std
::
wstring
&
sFrom
,
const
std
::
wstring
&
sTo
,
int
nFormatTo
,
const
std
::
wstring
&
sTemp
,
const
std
::
wstring
&
sThemeDir
,
bool
bFromChanges
,
bool
bPaid
,
InputParams
&
params
)
int
fromXlstBin
(
const
std
::
wstring
&
sFrom
,
const
std
::
wstring
&
sTo
,
int
nFormatTo
,
const
std
::
wstring
&
sTemp
,
const
std
::
wstring
&
sThemeDir
,
bool
bFromChanges
,
bool
bPaid
,
InputParams
&
params
)
...
@@ -3098,7 +3105,8 @@ namespace NExtractTools
...
@@ -3098,7 +3105,8 @@ namespace NExtractTools
nRes
=
xlst_bin2xlsx_dir
(
sFrom
,
sTo
,
sXlsxDir
,
bFromChanges
,
sThemeDir
,
params
);
nRes
=
xlst_bin2xlsx_dir
(
sFrom
,
sTo
,
sXlsxDir
,
bFromChanges
,
sThemeDir
,
params
);
if
(
SUCCEEDED_X2T
(
nRes
))
if
(
SUCCEEDED_X2T
(
nRes
))
{
{
nRes
=
fromXlsxDir
(
sXlsxDir
,
sTo
,
nFormatTo
,
sTemp
,
sThemeDir
,
bFromChanges
,
bPaid
,
params
,
false
);
std
::
wstring
sXlsxFile
;
nRes
=
fromXlsxDir
(
sXlsxDir
,
sTo
,
nFormatTo
,
sTemp
,
sThemeDir
,
bFromChanges
,
bPaid
,
params
,
sXlsxFile
);
}
}
}
}
else
else
...
@@ -3146,18 +3154,13 @@ namespace NExtractTools
...
@@ -3146,18 +3154,13 @@ namespace NExtractTools
}
}
else
else
{
{
std
::
wstring
sXlsxFile
;
std
::
wstring
sXlsxDir
=
sTemp
+
FILE_SEPARATOR_STR
+
_T
(
"xlsx_unpacked"
);
std
::
wstring
sXlsxDir
=
sTemp
+
FILE_SEPARATOR_STR
+
_T
(
"xlsx_unpacked"
);
NSDirectory
::
CreateDirectory
(
sXlsxDir
);
NSDirectory
::
CreateDirectory
(
sXlsxDir
);
bool
isSavedXFile
=
false
;
if
((
AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSX
==
nFormatFrom
||
AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSM
==
nFormatFrom
||
AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLTX
==
nFormatFrom
||
AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLTM
==
nFormatFrom
)
&&
params
.
getSaveXFile
())
{
NSFile
::
CFileBinary
::
Copy
(
sFrom
,
NSSystemPath
::
GetDirectoryName
(
sTo
)
+
FILE_SEPARATOR_STR
+
_T
(
"Editor.xlsx"
));
isSavedXFile
=
true
;
}
if
(
AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSX
==
nFormatFrom
)
if
(
AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSX
==
nFormatFrom
)
{
{
nRes
=
zip2dir
(
sFrom
,
sXlsxDir
);
nRes
=
zip2dir
(
sFrom
,
sXlsxDir
);
sXlsxFile
=
sFrom
;
}
}
else
if
(
AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSM
==
nFormatFrom
)
else
if
(
AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSM
==
nFormatFrom
)
{
{
...
@@ -3197,7 +3200,7 @@ namespace NExtractTools
...
@@ -3197,7 +3200,7 @@ namespace NExtractTools
nRes
=
AVS_FILEUTILS_ERROR_CONVERT
;
nRes
=
AVS_FILEUTILS_ERROR_CONVERT
;
if
(
SUCCEEDED_X2T
(
nRes
))
if
(
SUCCEEDED_X2T
(
nRes
))
{
{
nRes
=
fromXlsxDir
(
sXlsxDir
,
sTo
,
nFormatTo
,
sTemp
,
sThemeDir
,
bFromChanges
,
bPaid
,
params
,
isSavedX
File
);
nRes
=
fromXlsxDir
(
sXlsxDir
,
sTo
,
nFormatTo
,
sTemp
,
sThemeDir
,
bFromChanges
,
bPaid
,
params
,
sXlsx
File
);
}
}
}
}
return
nRes
;
return
nRes
;
...
...
X2tConverter/src/ASCConverters.h
View file @
007a984c
...
@@ -65,7 +65,7 @@ namespace NExtractTools
...
@@ -65,7 +65,7 @@ namespace NExtractTools
int
dotm2docx_dir
(
const
std
::
wstring
&
sFrom
,
const
std
::
wstring
&
sTo
,
InputParams
&
params
);
int
dotm2docx_dir
(
const
std
::
wstring
&
sFrom
,
const
std
::
wstring
&
sTo
,
InputParams
&
params
);
int
xlsx2xlst_bin
(
const
std
::
wstring
&
sFrom
,
const
std
::
wstring
&
sTo
,
const
std
::
wstring
&
sTemp
,
InputParams
&
params
);
int
xlsx2xlst_bin
(
const
std
::
wstring
&
sFrom
,
const
std
::
wstring
&
sTo
,
const
std
::
wstring
&
sTemp
,
InputParams
&
params
);
int
xlsx_dir2xlst_bin
(
const
std
::
wstring
&
sFrom
,
const
std
::
wstring
&
sTo
,
InputParams
&
params
,
bool
bXmlOptions
);
int
xlsx_dir2xlst_bin
(
const
std
::
wstring
&
sFrom
,
const
std
::
wstring
&
sTo
,
InputParams
&
params
,
bool
bXmlOptions
,
const
std
::
wstring
&
sXlsxFile
);
int
xlsx2xlst
(
const
std
::
wstring
&
sFrom
,
const
std
::
wstring
&
sTo
,
const
std
::
wstring
&
sTemp
,
InputParams
&
params
);
int
xlsx2xlst
(
const
std
::
wstring
&
sFrom
,
const
std
::
wstring
&
sTo
,
const
std
::
wstring
&
sTemp
,
InputParams
&
params
);
int
xlst_bin2xlsx
(
const
std
::
wstring
&
sFrom
,
const
std
::
wstring
&
sTo
,
const
std
::
wstring
&
sTemp
,
bool
bFromChanges
,
const
std
::
wstring
&
sThemeDir
,
InputParams
&
params
);
int
xlst_bin2xlsx
(
const
std
::
wstring
&
sFrom
,
const
std
::
wstring
&
sTo
,
const
std
::
wstring
&
sTemp
,
bool
bFromChanges
,
const
std
::
wstring
&
sThemeDir
,
InputParams
&
params
);
int
xlst_bin2xlsx_dir
(
const
std
::
wstring
&
sFrom
,
const
std
::
wstring
&
sToResult
,
const
std
::
wstring
&
sTo
,
bool
bFromChanges
,
const
std
::
wstring
&
sThemeDir
,
InputParams
&
params
);
int
xlst_bin2xlsx_dir
(
const
std
::
wstring
&
sFrom
,
const
std
::
wstring
&
sToResult
,
const
std
::
wstring
&
sTo
,
bool
bFromChanges
,
const
std
::
wstring
&
sThemeDir
,
InputParams
&
params
);
...
@@ -177,7 +177,7 @@ namespace NExtractTools
...
@@ -177,7 +177,7 @@ namespace NExtractTools
int
fromDoctBin
(
const
std
::
wstring
&
sFrom
,
const
std
::
wstring
&
sTo
,
int
nFormatTo
,
const
std
::
wstring
&
sTemp
,
const
std
::
wstring
&
sThemeDir
,
bool
bFromChanges
,
bool
bPaid
,
InputParams
&
params
);
int
fromDoctBin
(
const
std
::
wstring
&
sFrom
,
const
std
::
wstring
&
sTo
,
int
nFormatTo
,
const
std
::
wstring
&
sTemp
,
const
std
::
wstring
&
sThemeDir
,
bool
bFromChanges
,
bool
bPaid
,
InputParams
&
params
);
int
fromDocument
(
const
std
::
wstring
&
sFrom
,
int
nFormatFrom
,
const
std
::
wstring
&
sTemp
,
InputParams
&
params
);
int
fromDocument
(
const
std
::
wstring
&
sFrom
,
int
nFormatFrom
,
const
std
::
wstring
&
sTemp
,
InputParams
&
params
);
int
fromXlsxDir
(
const
std
::
wstring
&
sFrom
,
const
std
::
wstring
&
sTo
,
int
nFormatTo
,
const
std
::
wstring
&
sTemp
,
const
std
::
wstring
&
sThemeDir
,
bool
bFromChanges
,
bool
bPaid
,
InputParams
&
params
,
bool
isSavedX
File
);
int
fromXlsxDir
(
const
std
::
wstring
&
sFrom
,
const
std
::
wstring
&
sTo
,
int
nFormatTo
,
const
std
::
wstring
&
sTemp
,
const
std
::
wstring
&
sThemeDir
,
bool
bFromChanges
,
bool
bPaid
,
InputParams
&
params
,
const
std
::
wstring
&
sXlsx
File
);
int
fromXlstBin
(
const
std
::
wstring
&
sFrom
,
const
std
::
wstring
&
sTo
,
int
nFormatTo
,
const
std
::
wstring
&
sTemp
,
const
std
::
wstring
&
sThemeDir
,
bool
bFromChanges
,
bool
bPaid
,
InputParams
&
params
);
int
fromXlstBin
(
const
std
::
wstring
&
sFrom
,
const
std
::
wstring
&
sTo
,
int
nFormatTo
,
const
std
::
wstring
&
sTemp
,
const
std
::
wstring
&
sThemeDir
,
bool
bFromChanges
,
bool
bPaid
,
InputParams
&
params
);
int
fromSpreadsheet
(
const
std
::
wstring
&
sFrom
,
int
nFormatFrom
,
const
std
::
wstring
&
sTemp
,
InputParams
&
params
);
int
fromSpreadsheet
(
const
std
::
wstring
&
sFrom
,
int
nFormatFrom
,
const
std
::
wstring
&
sTemp
,
InputParams
&
params
);
...
...
X2tConverter/src/cextracttools.h
View file @
007a984c
...
@@ -374,7 +374,6 @@ namespace NExtractTools
...
@@ -374,7 +374,6 @@ namespace NExtractTools
std
::
wstring
*
m_sPassword
;
std
::
wstring
*
m_sPassword
;
std
::
wstring
*
m_sTempDir
;
std
::
wstring
*
m_sTempDir
;
bool
*
m_bIsNoBase64
;
bool
*
m_bIsNoBase64
;
bool
*
m_bSaveXFile
;
//output params
//output params
mutable
bool
m_bOutputConvertCorrupted
;
mutable
bool
m_bOutputConvertCorrupted
;
public:
public:
...
@@ -401,7 +400,6 @@ namespace NExtractTools
...
@@ -401,7 +400,6 @@ namespace NExtractTools
m_sPassword
=
NULL
;
m_sPassword
=
NULL
;
m_sTempDir
=
NULL
;
m_sTempDir
=
NULL
;
m_bIsNoBase64
=
NULL
;
m_bIsNoBase64
=
NULL
;
m_bSaveXFile
=
NULL
;
m_bOutputConvertCorrupted
=
false
;
m_bOutputConvertCorrupted
=
false
;
}
}
...
@@ -428,7 +426,6 @@ namespace NExtractTools
...
@@ -428,7 +426,6 @@ namespace NExtractTools
RELEASEOBJECT
(
m_sPassword
);
RELEASEOBJECT
(
m_sPassword
);
RELEASEOBJECT
(
m_sTempDir
);
RELEASEOBJECT
(
m_sTempDir
);
RELEASEOBJECT
(
m_bIsNoBase64
);
RELEASEOBJECT
(
m_bIsNoBase64
);
RELEASEOBJECT
(
m_bSaveXFile
);
}
}
bool
FromXmlFile
(
const
std
::
wstring
&
sFilename
)
bool
FromXmlFile
(
const
std
::
wstring
&
sFilename
)
...
@@ -519,8 +516,6 @@ namespace NExtractTools
...
@@ -519,8 +516,6 @@ namespace NExtractTools
m_sTempDir
=
new
std
::
wstring
(
sValue
);
m_sTempDir
=
new
std
::
wstring
(
sValue
);
else
if
(
_T
(
"m_bIsNoBase64"
)
==
sName
)
else
if
(
_T
(
"m_bIsNoBase64"
)
==
sName
)
m_bIsNoBase64
=
new
bool
(
XmlUtils
::
GetBoolean2
(
sValue
));
m_bIsNoBase64
=
new
bool
(
XmlUtils
::
GetBoolean2
(
sValue
));
else
if
(
_T
(
"m_bSaveXFile"
)
==
sName
)
m_bSaveXFile
=
new
bool
(
XmlUtils
::
GetBoolean2
(
sValue
));
}
}
else
if
(
_T
(
"m_nCsvDelimiterChar"
)
==
sName
)
else
if
(
_T
(
"m_nCsvDelimiterChar"
)
==
sName
)
{
{
...
@@ -552,10 +547,6 @@ namespace NExtractTools
...
@@ -552,10 +547,6 @@ namespace NExtractTools
{
{
return
(
NULL
!=
m_bIsNoBase64
)
?
(
*
m_bIsNoBase64
)
:
true
;
return
(
NULL
!=
m_bIsNoBase64
)
?
(
*
m_bIsNoBase64
)
:
true
;
}
}
bool
getSaveXFile
()
const
{
return
(
NULL
!=
m_bSaveXFile
)
?
(
*
m_bSaveXFile
)
:
false
;
}
std
::
wstring
getXmlOptions
()
std
::
wstring
getXmlOptions
()
{
{
std
::
wstring
sRes
;
std
::
wstring
sRes
;
...
...
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