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
07562a95
Commit
07562a95
authored
Nov 13, 2017
by
Alexey Golubev
Browse files
Options
Browse Files
Download
Plain Diff
v5.0.4
parents
e69c1677
f53c3d9f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
45 additions
and
37 deletions
+45
-37
ASCOfficeDocxFile2/BinReader/Readers.h
ASCOfficeDocxFile2/BinReader/Readers.h
+15
-14
ASCOfficeDocxFile2/DocWrapper/ChartWriter.cpp
ASCOfficeDocxFile2/DocWrapper/ChartWriter.cpp
+2
-3
ASCOfficeDocxFile2/DocWrapper/XlsxSerializer.cpp
ASCOfficeDocxFile2/DocWrapper/XlsxSerializer.cpp
+25
-19
ASCOfficeDocxFile2/DocWrapper/XlsxSerializer.h
ASCOfficeDocxFile2/DocWrapper/XlsxSerializer.h
+1
-1
PdfReader/Src/GFont.cpp
PdfReader/Src/GFont.cpp
+2
-0
No files found.
ASCOfficeDocxFile2/BinReader/Readers.h
View file @
07562a95
...
...
@@ -7064,21 +7064,22 @@ public:
std
::
wstring
sXlsxFilename
=
L"Microsoft_Excel_Worksheet"
+
std
::
to_wstring
(
nChartIndex
)
+
L".xlsx"
;
std
::
wstring
sXlsxPath
=
pathChartsWorksheetDir
.
GetPath
()
+
FILE_SEPARATOR_STR
+
sXlsxFilename
;
BinXlsxRW
::
CXlsxSerializer
oXlsxSerializer
;
oXlsxSerializer
.
writeChartXlsx
(
sXlsxPath
,
*
pChartSpace
);
if
(
oXlsxSerializer
.
writeChartXlsx
(
sXlsxPath
,
*
pChartSpace
))
{
std
::
wstring
sChartsWorksheetRelsName
=
L"../embeddings/"
+
sXlsxFilename
;
long
rIdXlsx
;
std
::
wstring
bstrChartsWorksheetRelType
=
OOX
::
FileTypes
::
MicrosoftOfficeExcelWorksheet
.
RelationType
();
std
::
wstring
sChartsWorksheetRelsName
=
L"../embeddings/"
+
sXlsxFilename
;
long
rIdXlsx
;
std
::
wstring
bstrChartsWorksheetRelType
=
OOX
::
FileTypes
::
MicrosoftOfficeExcelWorksheet
.
RelationType
();
m_oFileWriter
.
m_pDrawingConverter
->
WriteRels
(
bstrChartsWorksheetRelType
,
sChartsWorksheetRelsName
,
std
::
wstring
(),
&
rIdXlsx
);
m_oFileWriter
.
m_pDrawingConverter
->
m_pImageManager
->
m_pContentTypes
->
AddDefault
(
L"xlsx"
);
pChartSpace
->
m_oChartSpace
.
m_externalData
=
new
OOX
::
Spreadsheet
::
CT_ExternalData
();
pChartSpace
->
m_oChartSpace
.
m_externalData
->
m_id
=
new
std
::
wstring
();
pChartSpace
->
m_oChartSpace
.
m_externalData
->
m_id
->
append
(
L"rId"
);
pChartSpace
->
m_oChartSpace
.
m_externalData
->
m_id
->
append
(
std
::
to_wstring
(
rIdXlsx
));
pChartSpace
->
m_oChartSpace
.
m_externalData
->
m_autoUpdate
=
new
OOX
::
Spreadsheet
::
CT_Boolean
();
pChartSpace
->
m_oChartSpace
.
m_externalData
->
m_autoUpdate
->
m_val
=
new
bool
(
false
);
m_oFileWriter
.
m_pDrawingConverter
->
WriteRels
(
bstrChartsWorksheetRelType
,
sChartsWorksheetRelsName
,
std
::
wstring
(),
&
rIdXlsx
);
m_oFileWriter
.
m_pDrawingConverter
->
m_pImageManager
->
m_pContentTypes
->
AddDefault
(
L"xlsx"
);
pChartSpace
->
m_oChartSpace
.
m_externalData
=
new
OOX
::
Spreadsheet
::
CT_ExternalData
();
pChartSpace
->
m_oChartSpace
.
m_externalData
->
m_id
=
new
std
::
wstring
();
pChartSpace
->
m_oChartSpace
.
m_externalData
->
m_id
->
append
(
L"rId"
);
pChartSpace
->
m_oChartSpace
.
m_externalData
->
m_id
->
append
(
std
::
to_wstring
(
rIdXlsx
));
pChartSpace
->
m_oChartSpace
.
m_externalData
->
m_autoUpdate
=
new
OOX
::
Spreadsheet
::
CT_Boolean
();
pChartSpace
->
m_oChartSpace
.
m_externalData
->
m_autoUpdate
->
m_val
=
new
bool
(
false
);
}
//save chart.xml
NSStringUtils
::
CStringBuilder
sw
;
...
...
ASCOfficeDocxFile2/DocWrapper/ChartWriter.cpp
View file @
07562a95
...
...
@@ -658,8 +658,7 @@ namespace BinXlsxRW{
std
::
wstring
wb
,
sheetFrom
,
sheetTo
;
int
nRow1
,
nCol1
,
nRow2
,
nCol2
;
if
(
OOX
::
Spreadsheet
::
CCell
::
parse3DRef
(
*
pStrRef
->
m_f
,
wb
,
sheetFrom
,
sheetTo
,
nRow1
,
nCol1
,
nRow2
,
nCol2
)
&&
sheetFrom
.
length
()
>
0
&&
0
==
wb
.
length
()
&&
0
==
sheetTo
.
length
()
&&
NULL
!=
pStrRef
->
m_strCache
)
sheetFrom
.
length
()
>
0
&&
0
==
sheetTo
.
length
()
&&
NULL
!=
pStrRef
->
m_strCache
)
{
bool
bRow
=
nRow1
==
nRow2
;
if
(
bUpdateRange
)
...
...
@@ -727,7 +726,7 @@ namespace BinXlsxRW{
std
::
wstring
wb
,
sheetFrom
,
sheetTo
;
int
nRow1
,
nCol1
,
nRow2
,
nCol2
;
if
(
OOX
::
Spreadsheet
::
CCell
::
parse3DRef
(
*
pNumRef
->
m_f
,
wb
,
sheetFrom
,
sheetTo
,
nRow1
,
nCol1
,
nRow2
,
nCol2
)
&&
sheetFrom
.
length
()
>
0
&&
0
==
wb
.
length
()
&&
0
==
sheetTo
.
length
()
&&
NULL
!=
pNumRef
->
m_numCache
)
sheetFrom
.
length
()
>
0
&&
0
==
sheetTo
.
length
()
&&
NULL
!=
pNumRef
->
m_numCache
)
{
bool
bRow
=
nRow1
==
nRow2
;
if
(
bUpdateRange
)
...
...
ASCOfficeDocxFile2/DocWrapper/XlsxSerializer.cpp
View file @
07562a95
...
...
@@ -181,20 +181,22 @@ namespace BinXlsxRW{
std
::
wstring
sXlsxFilename
=
L"Microsoft_Excel_Worksheet"
+
std
::
to_wstring
(
lChartNumber
)
+
L".xlsx"
;
std
::
wstring
sXlsxPath
=
sEmbedingPath
+
FILE_SEPARATOR_STR
+
sXlsxFilename
;
writeChartXlsx
(
sXlsxPath
,
oChartSpace
);
pReader
->
m_pRels
->
m_pManager
->
m_pContentTypes
->
AddDefault
(
L"xlsx"
);
std
::
wstring
sChartsWorksheetRelsName
=
L"../embeddings/"
+
sXlsxFilename
;
long
rId
;
std
::
wstring
bstrChartsWorksheetRelType
=
OOX
::
FileTypes
::
MicrosoftOfficeExcelWorksheet
.
RelationType
();
m_pExternalDrawingConverter
->
WriteRels
(
bstrChartsWorksheetRelType
,
sChartsWorksheetRelsName
,
std
::
wstring
(),
&
rId
);
oChartSpace
.
m_oChartSpace
.
m_externalData
=
new
OOX
::
Spreadsheet
::
CT_ExternalData
();
oChartSpace
.
m_oChartSpace
.
m_externalData
->
m_id
=
new
std
::
wstring
();
oChartSpace
.
m_oChartSpace
.
m_externalData
->
m_id
->
append
(
L"rId"
);
oChartSpace
.
m_oChartSpace
.
m_externalData
->
m_id
->
append
(
std
::
to_wstring
(
rId
));
oChartSpace
.
m_oChartSpace
.
m_externalData
->
m_autoUpdate
=
new
OOX
::
Spreadsheet
::
CT_Boolean
();
oChartSpace
.
m_oChartSpace
.
m_externalData
->
m_autoUpdate
->
m_val
=
new
bool
(
false
);
if
(
writeChartXlsx
(
sXlsxPath
,
oChartSpace
))
{
pReader
->
m_pRels
->
m_pManager
->
m_pContentTypes
->
AddDefault
(
L"xlsx"
);
std
::
wstring
sChartsWorksheetRelsName
=
L"../embeddings/"
+
sXlsxFilename
;
long
rId
;
std
::
wstring
bstrChartsWorksheetRelType
=
OOX
::
FileTypes
::
MicrosoftOfficeExcelWorksheet
.
RelationType
();
m_pExternalDrawingConverter
->
WriteRels
(
bstrChartsWorksheetRelType
,
sChartsWorksheetRelsName
,
std
::
wstring
(),
&
rId
);
oChartSpace
.
m_oChartSpace
.
m_externalData
=
new
OOX
::
Spreadsheet
::
CT_ExternalData
();
oChartSpace
.
m_oChartSpace
.
m_externalData
->
m_id
=
new
std
::
wstring
();
oChartSpace
.
m_oChartSpace
.
m_externalData
->
m_id
->
append
(
L"rId"
);
oChartSpace
.
m_oChartSpace
.
m_externalData
->
m_id
->
append
(
std
::
to_wstring
(
rId
));
oChartSpace
.
m_oChartSpace
.
m_externalData
->
m_autoUpdate
=
new
OOX
::
Spreadsheet
::
CT_Boolean
();
oChartSpace
.
m_oChartSpace
.
m_externalData
->
m_autoUpdate
->
m_val
=
new
bool
(
false
);
}
}
std
::
wstring
strFilepath
=
sFilepath
;
...
...
@@ -233,7 +235,7 @@ namespace BinXlsxRW{
m_bIsNoBase64
=
bIsNoBase64
;
}
void
CXlsxSerializer
::
writeChartXlsx
(
const
std
::
wstring
&
sDstFile
,
const
OOX
::
Spreadsheet
::
CChartSpace
&
oChart
)
bool
CXlsxSerializer
::
writeChartXlsx
(
const
std
::
wstring
&
sDstFile
,
const
OOX
::
Spreadsheet
::
CChartSpace
&
oChart
)
{
//анализируем chart
BinXlsxRW
::
ChartWriter
helper
;
...
...
@@ -252,11 +254,15 @@ namespace BinXlsxRW{
helper
.
toXlsx
(
oXlsx
);
//write
OOX
::
CContentTypes
oContentTypes
;
oXlsx
.
Write
(
oPath
,
oContentTypes
);
//zip
COfficeUtils
oOfficeUtils
(
NULL
);
oOfficeUtils
.
CompressFileOrDirectory
(
sTempDir
,
sDstFile
,
true
);
bool
res
=
oXlsx
.
Write
(
oPath
,
oContentTypes
);
if
(
res
)
{
//zip
COfficeUtils
oOfficeUtils
(
NULL
);
oOfficeUtils
.
CompressFileOrDirectory
(
sTempDir
,
sDstFile
,
true
);
}
//clean
NSDirectory
::
DeleteDirectory
(
sTempDir
);
return
res
;
}
};
ASCOfficeDocxFile2/DocWrapper/XlsxSerializer.h
View file @
07562a95
...
...
@@ -72,7 +72,7 @@ namespace BinXlsxRW {
void
setDrawingConverter
(
NSBinPptxRW
::
CDrawingConverter
*
pDrawingConverter
);
void
setIsNoBase64
(
bool
bIsNoBase64
);
void
writeChartXlsx
(
const
std
::
wstring
&
sDstFile
,
const
OOX
::
Spreadsheet
::
CChartSpace
&
oChart
);
bool
writeChartXlsx
(
const
std
::
wstring
&
sDstFile
,
const
OOX
::
Spreadsheet
::
CChartSpace
&
oChart
);
};
}
#endif // #ifndef XLSX_SERIALIZER
PdfReader/Src/GFont.cpp
View file @
07562a95
...
...
@@ -158,6 +158,8 @@ namespace PdfReader
}
else
{
if
(
!
seName
)
seName
=
new
StringExt
(
""
);
// TO DO: Error "Unknown font type"
pFont
=
new
Gr8BitFont
(
pXref
,
sTag
,
oID
,
seName
,
fontUnknownType
,
pFontDict
,
pGlobalParams
);
}
...
...
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