On Thu, 2011-03-03 at 09:42 -0500, Kevin Hunter wrote:
So, the reason for the negative value is in the following line
484: sal_Int32 nIntervalCount = static_cast<sal_Int32>( fSub /
m_rIncrement.Distance );
where fSub / m_rIncrement.Distance value (which is double divided by
double) is still positive *but* way above the numeric limit of
sal_Int32, which causes the casted value nIntervalCount to become
negative (probably) by way of bitwise re-interpretation.
Capping the value of fSub / m_rIncrement.Distance to
std::numeric_limits<sal_Int32>::max() keeps the value of nIntervalCount
positive.
Even with this change, though, the displayed graph showed on difference.
So, no data loss here.
Now, can someone please sign off of this, or is this change still too
risky or questionable? :-)
Thanks,
Kohei
--
Kohei Yoshida, LibreOffice hacker, Calc
<kyoshida@novell.com>
Context
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.