Kaydet (Commit) 2649cbd3 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

a few more databar length fixes

Change-Id: I29f27d3a84d16d9d6e9d51c4e86881fff6aa4b96
üst 2d09ea95
...@@ -936,19 +936,19 @@ ScDataBarInfo* ScDataBarFormat::GetDataBarInfo(const ScAddress& rAddr) const ...@@ -936,19 +936,19 @@ ScDataBarInfo* ScDataBarFormat::GetDataBarInfo(const ScAddress& rAddr) const
{ {
pInfo->mnZero = 50; pInfo->mnZero = 50;
double nAbsMax = std::max(std::abs(nMin), std::abs(nMax)); double nAbsMax = std::max(std::abs(nMin), std::abs(nMax));
if (nValue < 0) if (nValue < 0 && nMin < 0)
{ {
if (nValue < nMin) if (nValue < nMin)
pInfo->mnLength = -nMaxLength; pInfo->mnLength = nMaxLength * (nMin/nAbsMax);
else else
pInfo->mnLength = nMaxLength * (nValue/nAbsMax); pInfo->mnLength = nMaxLength * (nValue/nAbsMax);
} }
else else
{ {
if (nValue > nMax) if (nValue > nMax)
pInfo->mnLength = nMaxLength; pInfo->mnLength = nMaxLength * (nMax/nAbsMax);
else else
pInfo->mnLength = nMaxLength * (nValue/nAbsMax); pInfo->mnLength = nMaxLength * (std::max(nValue, nMin)/nAbsMax);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment