Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
e6e1470c
Kaydet (Commit)
e6e1470c
authored
May 10, 2012
tarafından
Markus Mohrhard
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
import min, max and percent entries for color scales from xlsx
Change-Id: I Icebacfd711851c9223ed8f38d6445c82f575a47d
üst
f26bf2ba
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
66 additions
and
12 deletions
+66
-12
condformatbuffer.hxx
sc/source/filter/inc/condformatbuffer.hxx
+22
-3
condformatbuffer.cxx
sc/source/filter/oox/condformatbuffer.cxx
+43
-8
condformatcontext.cxx
sc/source/filter/oox/condformatcontext.cxx
+1
-1
No files found.
sc/source/filter/inc/condformatbuffer.hxx
Dosyayı görüntüle @
e6e1470c
...
...
@@ -76,20 +76,39 @@ struct CondFormatRuleModel
void
setBiff12TextType
(
sal_Int32
nOperator
);
};
struct
ColorScaleRuleModelEntry
{
::
Color
maColor
;
double
mnVal
;
bool
mbMin
;
bool
mbMax
;
bool
mbPercent
;
ColorScaleRuleModelEntry
()
:
maColor
(),
mnVal
(
0
),
mbMin
(
false
),
mbMax
(
false
),
mbPercent
(
false
)
{}
};
class
ColorScaleRule
:
public
WorksheetHelper
{
public
:
ColorScaleRule
(
const
CondFormat
&
rFormat
);
void
import
Value
(
const
AttributeList
&
rAttribs
);
void
import
Cfvo
(
const
AttributeList
&
rAttribs
);
void
importColor
(
const
AttributeList
&
rAttribs
);
void
AddEntries
(
ScColorScaleFormat
*
pFormat
);
private
:
const
CondFormat
&
mrCondFormat
;
std
::
vector
<
::
Color
>
maColors
;
std
::
vector
<
double
>
maValues
;
std
::
vector
<
ColorScaleRuleModelEntry
>
maColorScaleRuleEntries
;
sal_uInt32
mnCfvo
;
sal_uInt32
mnCol
;
};
...
...
sc/source/filter/oox/condformatbuffer.cxx
Dosyayı görüntüle @
e6e1470c
...
...
@@ -145,18 +145,39 @@ void lclAppendProperty( ::std::vector< PropertyValue >& orProps, const OUString&
ColorScaleRule
::
ColorScaleRule
(
const
CondFormat
&
rFormat
)
:
WorksheetHelper
(
rFormat
),
mrCondFormat
(
rFormat
)
mrCondFormat
(
rFormat
),
mnCfvo
(
0
),
mnCol
(
0
)
{
}
void
ColorScaleRule
::
import
Value
(
const
AttributeList
&
rAttribs
)
void
ColorScaleRule
::
import
Cfvo
(
const
AttributeList
&
rAttribs
)
{
if
(
mnCfvo
>=
maColorScaleRuleEntries
.
size
())
maColorScaleRuleEntries
.
push_back
(
ColorScaleRuleModelEntry
());
rtl
::
OUString
aType
=
rAttribs
.
getString
(
XML_type
,
rtl
::
OUString
()
);
double
nVal
=
rAttribs
.
getDouble
(
XML_val
,
0.0
);
maColorScaleRuleEntries
[
mnCfvo
].
mnVal
=
nVal
;
if
(
aType
==
"num"
)
{
double
nVal
=
rAttribs
.
getDouble
(
XML_val
,
0.0
);
maValues
.
push_back
(
nVal
);
// nothing to do
}
else
if
(
aType
==
"min"
)
{
maColorScaleRuleEntries
[
mnCfvo
].
mbMin
=
true
;
}
else
if
(
aType
==
"max"
)
{
maColorScaleRuleEntries
[
mnCfvo
].
mbMax
=
true
;
}
else
if
(
aType
==
"percent"
)
{
maColorScaleRuleEntries
[
mnCfvo
].
mbPercent
=
true
;
}
++
mnCfvo
;
}
namespace
{
...
...
@@ -177,17 +198,31 @@ void ColorScaleRule::importColor( const AttributeList& rAttribs )
sal_Int32
nColor
=
rAttribs
.
getIntegerHex
(
XML_rgb
,
API_RGB_TRANSPARENT
);
::
Color
aColor
=
RgbToRgbComponents
(
nColor
);
maColors
.
push_back
(
aColor
);
if
(
mnCol
>=
maColorScaleRuleEntries
.
size
())
maColorScaleRuleEntries
.
push_back
(
ColorScaleRuleModelEntry
());
maColorScaleRuleEntries
[
mnCol
].
maColor
=
aColor
;
++
mnCol
;
}
void
ColorScaleRule
::
AddEntries
(
ScColorScaleFormat
*
pFormat
)
{
//assume that both vectors contain the same entries
// TODO: check it
size_t
n
=
std
::
min
<
size_t
>
(
maColors
.
size
(),
maValues
.
size
());
for
(
size_t
i
=
0
;
i
<
n
;
++
i
)
for
(
size_t
i
=
0
;
i
<
maColorScaleRuleEntries
.
size
();
++
i
)
{
pFormat
->
AddEntry
(
new
ScColorScaleEntry
(
maValues
[
i
],
maColors
[
i
])
);
ScColorScaleEntry
*
pEntry
=
new
ScColorScaleEntry
(
maColorScaleRuleEntries
[
i
].
mnVal
,
maColorScaleRuleEntries
[
i
].
maColor
);
const
ColorScaleRuleModelEntry
&
rEntry
=
maColorScaleRuleEntries
[
i
];
if
(
rEntry
.
mbMin
)
pEntry
->
SetMin
(
true
);
if
(
rEntry
.
mbMax
)
pEntry
->
SetMax
(
true
);
if
(
rEntry
.
mbPercent
)
pEntry
->
SetPercent
(
true
);
pFormat
->
AddEntry
(
pEntry
);
}
}
...
...
sc/source/filter/oox/condformatcontext.cxx
Dosyayı görüntüle @
e6e1470c
...
...
@@ -66,7 +66,7 @@ void ColorScaleContext::onStartElement( const AttributeList& rAttribs )
switch
(
getCurrentElement
()
)
{
case
XLS_TOKEN
(
cfvo
):
mxRule
->
getColorScale
()
->
import
Value
(
rAttribs
);
mxRule
->
getColorScale
()
->
import
Cfvo
(
rAttribs
);
break
;
case
XLS_TOKEN
(
color
):
mxRule
->
getColorScale
()
->
importColor
(
rAttribs
);
...
...
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