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