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
d76b1897
Commit
d76b1897
authored
Jan 25, 2017
by
konovalovsergey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save conditionalFormating to xlsx
parent
857b79ee
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
263 additions
and
13 deletions
+263
-13
ASCOfficeOdfFileW/source/Oox2OdfConverter/XlsxConverter.cpp
ASCOfficeOdfFileW/source/Oox2OdfConverter/XlsxConverter.cpp
+1
-1
Common/DocxFormat/Source/XlsxFormat/Worksheets/ConditionalFormatting.h
...rmat/Source/XlsxFormat/Worksheets/ConditionalFormatting.h
+19
-6
Common/DocxFormat/Source/XlsxFormat/Worksheets/Worksheet.h
Common/DocxFormat/Source/XlsxFormat/Worksheets/Worksheet.h
+5
-1
XlsxSerializerCom/Reader/BinaryWriter.h
XlsxSerializerCom/Reader/BinaryWriter.h
+2
-2
XlsxSerializerCom/Writer/BinaryReader.h
XlsxSerializerCom/Writer/BinaryReader.h
+236
-3
No files found.
ASCOfficeOdfFileW/source/Oox2OdfConverter/XlsxConverter.cpp
View file @
d76b1897
...
@@ -2077,7 +2077,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CConditionalFormatting *oox_cond_f
...
@@ -2077,7 +2077,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CConditionalFormatting *oox_cond_f
if
(
oox_cond_fmt
->
m_oSqRef
.
IsInit
())
if
(
oox_cond_fmt
->
m_oSqRef
.
IsInit
())
{
{
ods_context
->
current_table
().
start_conditional_format
(
oox_cond_fmt
->
m_oSqRef
->
GetValue
());
ods_context
->
current_table
().
start_conditional_format
(
oox_cond_fmt
->
m_oSqRef
.
get
());
for
(
unsigned
int
i
=
0
;
i
<
oox_cond_fmt
->
m_arrItems
.
size
();
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
oox_cond_fmt
->
m_arrItems
.
size
();
i
++
)
convert
(
oox_cond_fmt
->
m_arrItems
[
i
]);
//rule
convert
(
oox_cond_fmt
->
m_arrItems
[
i
]);
//rule
...
...
Common/DocxFormat/Source/XlsxFormat/Worksheets/ConditionalFormatting.h
View file @
d76b1897
...
@@ -386,7 +386,7 @@ namespace OOX
...
@@ -386,7 +386,7 @@ namespace OOX
}
}
virtual
void
toXML
(
NSStringUtils
::
CStringBuilder
&
writer
)
const
virtual
void
toXML
(
NSStringUtils
::
CStringBuilder
&
writer
)
const
{
{
if
(
m_oType
.
IsInit
()
&&
m_oPriority
.
IsInit
()
&&
0
<
m_arrItems
.
size
())
if
(
isValid
())
{
{
writer
.
WriteString
(
L"<cfRule"
);
writer
.
WriteString
(
L"<cfRule"
);
WritingStringAttrString
(
L"type"
,
m_oType
->
ToString
());
WritingStringAttrString
(
L"type"
,
m_oType
->
ToString
());
...
@@ -398,7 +398,7 @@ namespace OOX
...
@@ -398,7 +398,7 @@ namespace OOX
WritingStringNullableAttrInt
(
L"dxfId"
,
m_oDxfId
,
m_oDxfId
->
GetValue
());
WritingStringNullableAttrInt
(
L"dxfId"
,
m_oDxfId
,
m_oDxfId
->
GetValue
());
if
(
m_oEqualAverage
.
IsInit
()
&&
true
==
m_oEqualAverage
->
ToBool
())
if
(
m_oEqualAverage
.
IsInit
()
&&
true
==
m_oEqualAverage
->
ToBool
())
writer
.
WriteString
(
_T
(
" equalAverage=
\"
1
\"
"
));
writer
.
WriteString
(
_T
(
" equalAverage=
\"
1
\"
"
));
WritingStringNullableAttrString
(
L"
text
"
,
m_oOperator
,
m_oOperator
->
ToString
());
WritingStringNullableAttrString
(
L"
operator
"
,
m_oOperator
,
m_oOperator
->
ToString
());
if
(
m_oPercent
.
IsInit
()
&&
true
==
m_oPercent
->
ToBool
())
if
(
m_oPercent
.
IsInit
()
&&
true
==
m_oPercent
->
ToBool
())
writer
.
WriteString
(
_T
(
" percent=
\"
1
\"
"
));
writer
.
WriteString
(
_T
(
" percent=
\"
1
\"
"
));
WritingStringNullableAttrInt
(
L"rank"
,
m_oRank
,
m_oRank
->
GetValue
());
WritingStringNullableAttrInt
(
L"rank"
,
m_oRank
,
m_oRank
->
GetValue
());
...
@@ -443,6 +443,11 @@ namespace OOX
...
@@ -443,6 +443,11 @@ namespace OOX
return
et_ConditionalFormattingRule
;
return
et_ConditionalFormattingRule
;
}
}
bool
isValid
()
const
{
return
m_oType
.
IsInit
()
&&
m_oPriority
.
IsInit
();
}
private:
private:
void
ReadAttributes
(
XmlUtils
::
CXmlLiteReader
&
oReader
)
void
ReadAttributes
(
XmlUtils
::
CXmlLiteReader
&
oReader
)
...
@@ -503,11 +508,19 @@ namespace OOX
...
@@ -503,11 +508,19 @@ namespace OOX
}
}
virtual
void
toXML
(
NSStringUtils
::
CStringBuilder
&
writer
)
const
virtual
void
toXML
(
NSStringUtils
::
CStringBuilder
&
writer
)
const
{
{
if
(
m_oSqRef
.
IsInit
()
&&
0
<
m_arrItems
.
size
())
bool
isValid
=
false
;
for
(
int
i
=
0
;
i
<
m_arrItems
.
size
();
++
i
)
{
if
(
m_arrItems
[
i
]
->
isValid
())
{
isValid
=
true
;
break
;
}
}
if
(
m_oSqRef
.
IsInit
()
&&
isValid
)
{
{
std
::
wstring
sRoot
;
writer
.
WriteString
(
L"<conditionalFormatting"
);
writer
.
WriteString
(
L"<conditionalFormatting"
);
WritingStringAttrString
(
L"sqref"
,
m_oSqRef
->
ToString
());
WritingStringAttrString
(
L"sqref"
,
m_oSqRef
.
get
());
if
(
m_oPivot
.
IsInit
()
&&
true
==
m_oPivot
->
ToBool
())
if
(
m_oPivot
.
IsInit
()
&&
true
==
m_oPivot
->
ToBool
())
{
{
...
@@ -557,7 +570,7 @@ namespace OOX
...
@@ -557,7 +570,7 @@ namespace OOX
}
}
public:
public:
nullable
<
SimpleTypes
::
COnOff
<>>
m_oPivot
;
nullable
<
SimpleTypes
::
COnOff
<>>
m_oPivot
;
nullable
<
SimpleTypes
::
CRelationshipId
>
m_oSqRef
;
// ToDo переделать на тип "sqref" (18.18.76) - последовательность "ref", разделенные пробелом
nullable
<
std
::
wstring
>
m_oSqRef
;
// ToDo переделать на тип "sqref" (18.18.76) - последовательность "ref", разделенные пробелом
};
};
}
//Spreadsheet
}
//Spreadsheet
}
// namespace OOX
}
// namespace OOX
...
...
Common/DocxFormat/Source/XlsxFormat/Worksheets/Worksheet.h
View file @
d76b1897
...
@@ -348,7 +348,7 @@ namespace OOX
...
@@ -348,7 +348,7 @@ namespace OOX
if
(
m_oSheetData
.
IsInit
())
if
(
m_oSheetData
.
IsInit
())
m_oSheetData
->
toXML
(
sXml
);
m_oSheetData
->
toXML
(
sXml
);
for
(
unsigned
int
nIndex
=
0
,
nLength
=
m_arrConditionalFormatting
.
size
();
nIndex
<
nLength
;
++
nIndex
)
for
(
unsigned
int
nIndex
=
0
,
nLength
=
m_arrConditionalFormatting
.
size
();
nIndex
<
nLength
;
++
nIndex
)
m_arrConditionalFormatting
[
nIndex
]
->
toXML
();
m_arrConditionalFormatting
[
nIndex
]
->
toXML
(
sXml
);
if
(
m_oAutofilter
.
IsInit
())
if
(
m_oAutofilter
.
IsInit
())
m_oAutofilter
->
toXML
(
sXml
);
m_oAutofilter
->
toXML
(
sXml
);
if
(
m_oMergeCells
.
IsInit
())
if
(
m_oMergeCells
.
IsInit
())
...
@@ -425,6 +425,10 @@ namespace OOX
...
@@ -425,6 +425,10 @@ namespace OOX
m_mapComments
.
clear
();
m_mapComments
.
clear
();
// delete Conditional Formatting
// delete Conditional Formatting
for
(
unsigned
int
nIndex
=
0
,
nLength
=
m_arrConditionalFormatting
.
size
();
nIndex
<
nLength
;
++
nIndex
)
{
delete
m_arrConditionalFormatting
[
nIndex
];
}
m_arrConditionalFormatting
.
clear
();
m_arrConditionalFormatting
.
clear
();
}
}
private:
private:
...
...
XlsxSerializerCom/Reader/BinaryWriter.h
View file @
d76b1897
...
@@ -3287,7 +3287,7 @@ namespace BinXlsxRW {
...
@@ -3287,7 +3287,7 @@ namespace BinXlsxRW {
if
(
oConditionalFormatting
.
m_oSqRef
.
IsInit
())
if
(
oConditionalFormatting
.
m_oSqRef
.
IsInit
())
{
{
m_oBcw
.
m_oStream
.
WriteBYTE
(
c_oSer_ConditionalFormatting
::
SqRef
);
m_oBcw
.
m_oStream
.
WriteBYTE
(
c_oSer_ConditionalFormatting
::
SqRef
);
m_oBcw
.
m_oStream
.
WriteStringW
(
oConditionalFormatting
.
m_oSqRef
->
ToString
());
m_oBcw
.
m_oStream
.
WriteStringW
(
oConditionalFormatting
.
m_oSqRef
.
get
());
}
}
if
(
0
<
oConditionalFormatting
.
m_arrItems
.
size
())
if
(
0
<
oConditionalFormatting
.
m_arrItems
.
size
())
...
@@ -3323,7 +3323,7 @@ namespace BinXlsxRW {
...
@@ -3323,7 +3323,7 @@ namespace BinXlsxRW {
}
}
if
(
oConditionalFormattingRule
.
m_oDxfId
.
IsInit
())
if
(
oConditionalFormattingRule
.
m_oDxfId
.
IsInit
())
{
{
nCurPos
=
m_oBcw
.
WriteItemStart
(
c_oSer_
TableColumns
::
Data
DxfId
);
nCurPos
=
m_oBcw
.
WriteItemStart
(
c_oSer_
ConditionalFormattingRule
::
DxfId
);
m_oBcw
.
m_oStream
.
WriteLONG
(
oConditionalFormattingRule
.
m_oDxfId
->
GetValue
());
m_oBcw
.
m_oStream
.
WriteLONG
(
oConditionalFormattingRule
.
m_oDxfId
->
GetValue
());
m_oBcw
.
WriteItemEnd
(
nCurPos
);
m_oBcw
.
WriteItemEnd
(
nCurPos
);
}
}
...
...
XlsxSerializerCom/Writer/BinaryReader.h
View file @
d76b1897
This diff is collapsed.
Click to expand it.
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