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
c35dc399
Kaydet (Commit)
c35dc399
authored
May 16, 2015
tarafından
Markus Mohrhard
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
little refactoring in databar code
Change-Id: Icf2943604106440ff0b1979ebe10497f01fea784
üst
598f0e26
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
48 deletions
+46
-48
colorscale.cxx
sc/source/core/data/colorscale.cxx
+46
-48
No files found.
sc/source/core/data/colorscale.cxx
Dosyayı görüntüle @
c35dc399
...
@@ -890,66 +890,64 @@ ScDataBarInfo* ScDataBarFormat::GetDataBarInfo(const ScAddress& rAddr) const
...
@@ -890,66 +890,64 @@ ScDataBarInfo* ScDataBarFormat::GetDataBarInfo(const ScAddress& rAddr) const
}
}
pInfo
->
mnZero
=
0
;
pInfo
->
mnZero
=
0
;
}
}
else
else
if
(
mpFormatData
->
meAxisPosition
==
databar
::
AUTOMATIC
)
{
{
double
nMinPositive
=
0
;
double
nMaxNegative
=
0
;
double
nMaxNegative
=
0
;
double
nMinPositive
=
0
;
//calculate the zero position first
//calculate the zero position first
if
(
mpFormatData
->
meAxisPosition
==
databar
::
AUTOMATIC
)
if
(
nMin
<
0
)
{
{
if
(
nMin
<
0
)
if
(
nMax
<
0
)
pInfo
->
mnZero
=
100
;
else
{
{
if
(
nMax
<
0
)
pInfo
->
mnZero
=
-
100
*
nMin
/
(
nMax
-
nMin
);
pInfo
->
mnZero
=
100
;
else
{
pInfo
->
mnZero
=
-
100
*
nMin
/
(
nMax
-
nMin
);
}
}
}
else
}
pInfo
->
mnZero
=
0
;
else
pInfo
->
mnZero
=
0
;
// if max or min is used we may need to adjust it
// if max or min is used we may need to adjust it
// for the length calculation
// for the length calculation
if
(
mpFormatData
->
mpLowerLimit
->
GetType
()
==
COLORSCALE_MIN
&&
nMin
>
0
)
if
(
mpFormatData
->
mpLowerLimit
->
GetType
()
==
COLORSCALE_MIN
&&
nMin
>
0
)
nMinPositive
=
nMin
;
nMinPositive
=
nMin
;
if
(
mpFormatData
->
mpUpperLimit
->
GetType
()
==
COLORSCALE_MAX
&&
nMax
<
0
)
if
(
mpFormatData
->
mpUpperLimit
->
GetType
()
==
COLORSCALE_MAX
&&
nMax
<
0
)
nMaxNegative
=
nMax
;
nMaxNegative
=
nMax
;
//calculate the length
//calculate the length
if
(
nValue
<
0
)
if
(
nValue
<
0
)
{
{
if
(
nValue
<
nMin
)
if
(
nValue
<
nMin
)
pInfo
->
mnLength
=
-
100
;
pInfo
->
mnLength
=
-
100
;
else
pInfo
->
mnLength
=
-
100
*
(
nValue
-
nMaxNegative
)
/
(
nMin
-
nMaxNegative
);
}
else
else
{
pInfo
->
mnLength
=
-
100
*
(
nValue
-
nMaxNegative
)
/
(
nMin
-
nMaxNegative
);
if
(
nValue
>
nMax
)
pInfo
->
mnLength
=
100
;
else
pInfo
->
mnLength
=
(
nValue
-
nMinPositive
)
/
(
nMax
-
nMinPositive
)
*
100
;
}
}
}
else
if
(
mpFormatData
->
meAxisPosition
==
databar
::
MIDDLE
)
else
{
{
pInfo
->
mnZero
=
50
;
if
(
nValue
>
nMax
)
double
nAbsMax
=
std
::
max
(
std
::
abs
(
nMin
),
std
::
abs
(
nMax
));
pInfo
->
mnLength
=
100
;
if
(
nValue
<
0
)
{
if
(
nValue
<
nMin
)
pInfo
->
mnLength
=
-
nMaxLength
;
else
pInfo
->
mnLength
=
nMaxLength
*
(
nValue
/
nAbsMax
);
}
else
else
{
pInfo
->
mnLength
=
(
nValue
-
nMinPositive
)
/
(
nMax
-
nMinPositive
)
*
100
;
if
(
nValue
>
nMax
)
}
pInfo
->
mnLength
=
nMaxLength
;
}
else
else
if
(
mpFormatData
->
meAxisPosition
==
databar
::
MIDDLE
)
pInfo
->
mnLength
=
nMaxLength
*
(
nValue
/
nAbsMax
);
{
}
pInfo
->
mnZero
=
50
;
double
nAbsMax
=
std
::
max
(
std
::
abs
(
nMin
),
std
::
abs
(
nMax
));
if
(
nValue
<
0
)
{
if
(
nValue
<
nMin
)
pInfo
->
mnLength
=
-
nMaxLength
;
else
pInfo
->
mnLength
=
nMaxLength
*
(
nValue
/
nAbsMax
);
}
else
{
if
(
nValue
>
nMax
)
pInfo
->
mnLength
=
nMaxLength
;
else
pInfo
->
mnLength
=
nMaxLength
*
(
nValue
/
nAbsMax
);
}
}
}
}
...
...
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