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
717b6280
Commit
717b6280
authored
Dec 05, 2017
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
e4f94646
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
56 additions
and
60 deletions
+56
-60
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/DataFormat.h
...XlsFile2/source/XlsFormat/Logic/Biff_records/DataFormat.h
+1
-5
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/TxO.cpp
...fficeXlsFile2/source/XlsFormat/Logic/Biff_records/TxO.cpp
+4
-5
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/StyleXF.cpp
...sFile2/source/XlsFormat/Logic/Biff_structures/StyleXF.cpp
+2
-2
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/XLUnicodeRichExtendedString.cpp
...mat/Logic/Biff_structures/XLUnicodeRichExtendedString.cpp
+2
-3
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/ATTACHEDLABEL_bu.cpp
...2/source/XlsFormat/Logic/Biff_unions/ATTACHEDLABEL_bu.cpp
+2
-3
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/AXS.cpp
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/AXS.cpp
+3
-4
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/CRT.cpp
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/CRT.cpp
+7
-5
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/DFTTEXT.cpp
...ceXlsFile2/source/XlsFormat/Logic/Biff_unions/DFTTEXT.cpp
+6
-4
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/DROPBAR.h
...ficeXlsFile2/source/XlsFormat/Logic/Biff_unions/DROPBAR.h
+0
-2
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/DROPBAR_bu.cpp
...lsFile2/source/XlsFormat/Logic/Biff_unions/DROPBAR_bu.cpp
+13
-12
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/FORMATTING.cpp
...lsFile2/source/XlsFormat/Logic/Biff_unions/FORMATTING.cpp
+12
-10
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/FORMATTING.h
...eXlsFile2/source/XlsFormat/Logic/Biff_unions/FORMATTING.h
+1
-1
ASCOfficeXlsFile2/source/XlsFormat/Logic/GlobalWorkbookInfo.cpp
...iceXlsFile2/source/XlsFormat/Logic/GlobalWorkbookInfo.cpp
+2
-2
ASCOfficeXlsFile2/source/XlsFormat/Logic/GlobalWorkbookInfo.h
...fficeXlsFile2/source/XlsFormat/Logic/GlobalWorkbookInfo.h
+1
-1
ASCOfficeXlsFile2/source/XlsFormat/Logic/GlobalsSubstream.cpp
...fficeXlsFile2/source/XlsFormat/Logic/GlobalsSubstream.cpp
+0
-1
No files found.
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/DataFormat.h
View file @
717b6280
...
...
@@ -35,9 +35,6 @@
namespace
XLS
{
// Logical representation of DataFormat record in BIFF8
class
DataFormat
:
public
BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO
(
DataFormat
)
...
...
@@ -47,11 +44,10 @@ public:
~
DataFormat
();
BaseObjectPtr
clone
();
void
readFields
(
CFRecord
&
record
);
static
const
ElementType
type
=
typeDataFormat
;
static
const
ElementType
type
=
typeDataFormat
;
_UINT16
xi
;
_UINT16
yi
;
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/TxO.cpp
View file @
717b6280
...
...
@@ -184,9 +184,9 @@ int TxO::serialize_vml (std::wostream & _stream)
{
iFmt
=
run
->
formatRun
.
ifnt
;
Font
*
font
=
NULL
;
if
(
(
global_info
->
m_arFonts
)
&&
(
iFmt
>=
0
&&
iFmt
<
global_info
->
m_arFonts
->
size
()
))
if
(
iFmt
>=
0
&&
iFmt
<
global_info
->
m_arFonts
.
size
(
))
{
font
=
dynamic_cast
<
Font
*>
(
global_info
->
m_arFonts
->
at
(
iFmt
)
.
get
());
font
=
dynamic_cast
<
Font
*>
(
global_info
->
m_arFonts
[
iFmt
]
.
get
());
}
if
(
font
)
{
...
...
@@ -281,12 +281,11 @@ int TxO::serialize (std::wostream & _stream)
int
TxO
::
serialize_rPr
(
std
::
wostream
&
_stream
,
int
iFmt
,
std
::
wstring
namespace_
)
{
if
(
!
global_info
)
return
0
;
if
(
!
global_info
->
m_arFonts
)
return
0
;
int
sz
=
global_info
->
m_arFonts
->
size
();
int
sz
=
global_info
->
m_arFonts
.
size
();
if
(
iFmt
-
1
>=
sz
||
iFmt
<
1
)
return
0
;
Font
*
font
=
dynamic_cast
<
Font
*>
(
global_info
->
m_arFonts
->
at
(
iFmt
-
1
)
.
get
());
Font
*
font
=
dynamic_cast
<
Font
*>
(
global_info
->
m_arFonts
[
iFmt
-
1
]
.
get
());
if
(
!
font
)
return
0
;
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/StyleXF.cpp
View file @
717b6280
...
...
@@ -240,9 +240,9 @@ void StyleXF::Update(XFProp* xfProp)
case
0x0025
:
{
font_id
=
*
byte_
->
value
();
if
(
(
global_info
->
m_arFonts
)
&&
(
font_id
>=
0
&&
font_id
<
global_info
->
m_arFonts
->
size
()
))
if
(
font_id
>=
0
&&
font_id
<
global_info
->
m_arFonts
.
size
(
))
{
font
=
dynamic_cast
<
Font
*>
(
global_info
->
m_arFonts
->
at
(
font_id
)
.
get
());
font
=
dynamic_cast
<
Font
*>
(
global_info
->
m_arFonts
[
font_id
]
.
get
());
}
}
break
;
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/XLUnicodeRichExtendedString.cpp
View file @
717b6280
...
...
@@ -150,16 +150,15 @@ int XLUnicodeRichExtendedString::serialize (std::wostream & _stream)
int
XLUnicodeRichExtendedString
::
serialize_rPr
(
std
::
wostream
&
_stream
,
int
iFmt
)
{
if
(
!
pGlobalWorkbookInfoPtr
)
return
0
;
if
(
!
pGlobalWorkbookInfoPtr
->
m_arFonts
)
return
0
;
int
sz
=
pGlobalWorkbookInfoPtr
->
m_arFonts
->
size
();
int
sz
=
pGlobalWorkbookInfoPtr
->
m_arFonts
.
size
();
if
(
iFmt
-
1
>
sz
||
iFmt
<
1
)
return
0
;
CP_XML_WRITER
(
_stream
)
{
CP_XML_NODE
(
L"rPr"
)
{
Font
*
font
=
dynamic_cast
<
Font
*>
(
pGlobalWorkbookInfoPtr
->
m_arFonts
->
at
(
iFmt
-
1
)
.
get
());
Font
*
font
=
dynamic_cast
<
Font
*>
(
pGlobalWorkbookInfoPtr
->
m_arFonts
[
iFmt
-
1
]
.
get
());
if
(
font
)
font
->
serialize_properties
(
CP_XML_STREAM
(),
true
);
}
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/ATTACHEDLABEL_bu.cpp
View file @
717b6280
...
...
@@ -347,12 +347,11 @@ int ATTACHEDLABEL::serialize(std::wostream & _stream, bool isPosition)
int
ATTACHEDLABEL
::
serialize_rPr
(
std
::
wostream
&
_stream
,
int
iFmt
,
bool
rtl
,
bool
defRPr
)
{
if
(
!
pGlobalWorkbookInfoPtr
)
return
0
;
if
(
!
pGlobalWorkbookInfoPtr
->
m_arFonts
)
return
0
;
int
sz
=
pGlobalWorkbookInfoPtr
->
m_arFonts
->
size
();
int
sz
=
pGlobalWorkbookInfoPtr
->
m_arFonts
.
size
();
if
(
iFmt
-
1
>
sz
||
iFmt
<
1
)
return
0
;
Font
*
font
=
dynamic_cast
<
Font
*>
(
pGlobalWorkbookInfoPtr
->
m_arFonts
->
at
(
iFmt
-
1
)
.
get
());
Font
*
font
=
dynamic_cast
<
Font
*>
(
pGlobalWorkbookInfoPtr
->
m_arFonts
[
iFmt
-
1
]
.
get
());
Text
*
text_props
=
dynamic_cast
<
Text
*>
(
m_TextProperties
.
get
());
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/AXS.cpp
View file @
717b6280
...
...
@@ -259,14 +259,13 @@ int AXS::serialize(std::wostream & _stream)
int
AXS
::
serialize_rPr
(
std
::
wostream
&
_stream
,
int
iFmt
,
_CP_OPT
(
unsigned
int
)
color
,
bool
rtl
,
bool
defRPr
)
{
if
(
!
pGlobalWorkbookInfoPtr
)
return
0
;
if
(
!
pGlobalWorkbookInfoPtr
->
m_arFonts
)
return
0
;
if
(
!
pGlobalWorkbookInfoPtr
)
return
0
;
Font
*
font
=
NULL
;
int
sz
=
pGlobalWorkbookInfoPtr
->
m_arFonts
->
size
();
int
sz
=
pGlobalWorkbookInfoPtr
->
m_arFonts
.
size
();
if
(
iFmt
>
0
&&
iFmt
<=
sz
)
font
=
dynamic_cast
<
Font
*>
(
pGlobalWorkbookInfoPtr
->
m_arFonts
->
at
(
iFmt
-
1
).
get
());
font
=
dynamic_cast
<
Font
*>
(
pGlobalWorkbookInfoPtr
->
m_arFonts
.
at
(
iFmt
-
1
).
get
());
if
(
font
)
{
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/CRT.cpp
View file @
717b6280
...
...
@@ -31,6 +31,12 @@
*/
#include "CRT.h"
#include "LD.h"
#include "DROPBAR.h"
#include "SS.h"
#include "SHAPEPROPS.h"
#include "DFTTEXT.h"
#include "../Biff_records/ChartFormat.h"
#include "../Biff_records/Begin.h"
#include "../Biff_records/Bar.h"
...
...
@@ -46,14 +52,9 @@
#include "../Biff_records/CrtLink.h"
#include "../Biff_records/SeriesList.h"
#include "../Biff_records/Chart3d.h"
#include "../Biff_unions/LD.h"
#include "../Biff_unions/DROPBAR.h"
#include "../Biff_records/CrtLine.h"
#include "../Biff_records/LineFormat.h"
#include "../Biff_unions/DFTTEXT.h"
#include "../Biff_records/DataLabExtContents.h"
#include "../Biff_unions/SS.h"
#include "../Biff_unions/SHAPEPROPS.h"
#include "../Biff_records/End.h"
#include "../Biff_records/ValueRange.h"
#include "../Biff_records/Tick.h"
...
...
@@ -65,6 +66,7 @@
#include "../Biff_records/PlotArea.h"
#include "../Biff_records/DropBar.h"
#include "../Biff_records/CrtMlFrt.h"
#include "../Biff_records/DataFormat.h"
#include "../Biff_records/StartObject.h"
#include "../Biff_records/EndObject.h"
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/DFTTEXT.cpp
View file @
717b6280
...
...
@@ -76,11 +76,16 @@ const bool DFTTEXT::loadContent(BinProcessor& proc)
m_DefaultText
=
elements_
.
back
();
elements_
.
pop_back
();
}
if
(
proc
.
optional
<
DataLabExtContents
>
())
{
m_DataLabExtContents
=
elements_
.
back
();
elements_
.
pop_back
();
}
if
(
!
m_DefaultText
&&
!
m_DataLabExtContents
)
return
false
;
if
(
proc
.
mandatory
<
ATTACHEDLABEL
>
())
{
m_ATTACHEDLABEL
=
elements_
.
back
();
...
...
@@ -89,10 +94,7 @@ const bool DFTTEXT::loadContent(BinProcessor& proc)
if
(
proc
.
optional
<
EndObject
>
())
elements_
.
pop_back
();
if
(
m_DefaultText
||
m_DataLabExtContents
)
return
true
;
else
return
false
;
return
true
;
}
}
// namespace XLS
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/DROPBAR.h
View file @
717b6280
...
...
@@ -36,8 +36,6 @@
namespace
XLS
{
// Logical representation of DROPBAR union of records
class
DROPBAR
:
public
CompositeObject
{
BASE_OBJECT_DEFINE_CLASS_NAME
(
DROPBAR
)
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/DROPBAR_bu.cpp
View file @
717b6280
...
...
@@ -31,15 +31,17 @@
*/
#include "DROPBAR.h"
#include <Logic/Biff_records/DropBar.h>
#include <Logic/Biff_records/Begin.h>
#include <Logic/Biff_records/LineFormat.h>
#include <Logic/Biff_records/AreaFormat.h>
#include <Logic/Biff_unions/GELFRAME.h>
#include <Logic/Biff_unions/SHAPEPROPS.h>
#include <Logic/Biff_records/End.h>
#include <Logic/Biff_records/StartObject.h>
#include <Logic/Biff_records/EndObject.h>
#include "GELFRAME.h"
#include "SHAPEPROPS.h"
#include "../Biff_records/DropBar.h"
#include "../Biff_records/LineFormat.h"
#include "../Biff_records/AreaFormat.h"
#include "../Biff_records/Begin.h"
#include "../Biff_records/End.h"
#include "../Biff_records/StartObject.h"
#include "../Biff_records/EndObject.h"
namespace
XLS
{
...
...
@@ -72,7 +74,7 @@ const bool DROPBAR::loadContent(BinProcessor& proc)
if
(
proc
.
mandatory
<
Begin
>
())
elements_
.
pop_back
();
if
(
proc
.
mandatory
<
LineFormat
>
())
if
(
proc
.
optional
<
LineFormat
>
())
{
m_LineFormat
=
elements_
.
back
();
elements_
.
pop_back
();
}
...
...
@@ -81,11 +83,10 @@ const bool DROPBAR::loadContent(BinProcessor& proc)
elements_
.
pop_back
();
if
(
proc
.
mandatory
<
EndObject
>
())
elements_
.
pop_back
();
}
if
(
proc
.
mandatory
<
AreaFormat
>
())
if
(
proc
.
optional
<
AreaFormat
>
())
{
m_AreaFormat
=
elements_
.
back
();
elements_
.
pop_back
();
}
if
(
proc
.
optional
<
GELFRAME
>
())
{
m_GELFRAME
=
elements_
.
back
();
elements_
.
pop_back
();
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/FORMATTING.cpp
View file @
717b6280
...
...
@@ -71,7 +71,6 @@ BaseObjectPtr FORMATTING::clone()
const
bool
FORMATTING
::
loadContent
(
BinProcessor
&
proc
)
{
global_info
=
proc
.
getGlobalWorkbookInfo
();
global_info
->
m_arFonts
=
&
m_arFonts
;
int
count
=
0
;
count
=
proc
.
repeated
<
Font
>
(
0
,
510
);
// Wrong records sequence workaround (originally at least one Font is mandatory)
...
...
@@ -80,7 +79,7 @@ const bool FORMATTING::loadContent(BinProcessor& proc)
Font
*
font
=
dynamic_cast
<
Font
*>
(
elements_
.
front
().
get
());
if
((
font
)
&&
(
font
->
correct
))
{
m_arFonts
.
push_back
(
elements_
.
front
());
global_info
->
m_arFonts
.
push_back
(
elements_
.
front
());
}
elements_
.
pop_front
();
count
--
;
...
...
@@ -95,10 +94,10 @@ const bool FORMATTING::loadContent(BinProcessor& proc)
}
//----------------------------------------------------------------------------------------------------
count
=
proc
.
repeated
<
Font
>
(
0
,
510
);
// Wrong records sequence workaround (originally Font follows by Format)
int
countFonts
=
m_arFonts
.
size
();
int
countFonts
=
global_info
->
m_arFonts
.
size
();
while
(
count
>
0
)
{
m_arFonts
.
insert
(
m_arFonts
.
begin
()
+
countFonts
,
elements_
.
back
());
global_info
->
m_arFonts
.
insert
(
global_info
->
m_arFonts
.
begin
()
+
countFonts
,
elements_
.
back
());
elements_
.
pop_back
();
count
--
;
}
...
...
@@ -235,20 +234,23 @@ int FORMATTING::serialize1(std::wostream & stream)
}
}
}
if
(
m_arFonts
.
size
()
>
0
)
if
(
!
global_info
->
m_arFonts
.
empty
()
)
{
CP_XML_NODE
(
L"fonts"
)
{
CP_XML_ATTR
(
L"count"
,
m_arFonts
.
size
());
for
(
size_t
i
=
0
;
i
<
m_arFonts
.
size
();
i
++
)
CP_XML_ATTR
(
L"count"
,
global_info
->
m_arFonts
.
size
());
for
(
size_t
i
=
0
;
i
<
global_info
->
m_arFonts
.
size
();
i
++
)
{
Font
*
font
=
dynamic_cast
<
Font
*>
(
m_arFonts
[
i
].
get
());
Font
*
font
=
dynamic_cast
<
Font
*>
(
global_info
->
m_arFonts
[
i
].
get
());
std
::
map
<
int
,
FillInfoExt
>::
iterator
it
=
global_info
->
fonts_color_ext
.
find
(
i
);
if
(
font
&&
(
it
!=
global_info
->
fonts_color_ext
.
end
()))
if
(
font
&&
(
it
!=
global_info
->
fonts_color_ext
.
end
()))
{
font
->
set_color_ext
(
it
->
second
);
}
m_arFonts
[
i
]
->
serialize
(
CP_XML_STREAM
());
global_info
->
m_arFonts
[
i
]
->
serialize
(
CP_XML_STREAM
());
}
}
}
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/FORMATTING.h
View file @
717b6280
...
...
@@ -60,7 +60,7 @@ public:
BaseObjectPtr
m_Styles
;
BaseObjectPtr
m_XFS
;
std
::
vector
<
BaseObjectPtr
>
m_arFormats
;
std
::
vector
<
BaseObjectPtr
>
m_arFonts
;
//std::vector<BaseObjectPtr> m_arFonts; in global
BaseObjectPtr
m_Palette
;
BaseObjectPtr
m_ClrtClient
;
std
::
vector
<
BaseObjectPtr
>
m_arDXF
;
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/GlobalWorkbookInfo.cpp
View file @
717b6280
...
...
@@ -186,9 +186,9 @@ void GlobalWorkbookInfo::GetDigitFontSizePixels()
}
defaultDigitFontSize
=
std
::
pair
<
float
,
float
>
(
7
,
8
);
if
(
m_arFonts
->
size
()
<
1
)
return
;
if
(
m_arFonts
.
empty
()
)
return
;
Font
*
font
=
dynamic_cast
<
Font
*>
(
m_arFonts
->
at
(
0
)
.
get
());
Font
*
font
=
dynamic_cast
<
Font
*>
(
m_arFonts
[
0
]
.
get
());
if
(
!
font
)
return
;
std
::
wstring
fontName
=
font
->
fontName
.
value
();
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/GlobalWorkbookInfo.h
View file @
717b6280
...
...
@@ -97,7 +97,7 @@ public:
std
::
map
<
int
,
int
>
fonts_charsets
;
std
::
map
<
int
,
std
::
wstring
>
colors_palette
;
std
::
vector
<
BaseObjectPtr
>
*
m_arFonts
;
std
::
vector
<
BaseObjectPtr
>
m_arFonts
;
unsigned
int
current_sheet
;
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/GlobalsSubstream.cpp
View file @
717b6280
...
...
@@ -333,7 +333,6 @@ const bool GlobalsSubstream::loadContent(BinProcessor& proc)
if
(
fmts
)
{
global_info_
->
cellStyleDxfs_count
=
fmts
->
m_arDXF
.
size
();
global_info_
->
m_arFonts
=
&
fmts
->
m_arFonts
;
}
}
//else
...
...
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