To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=46681
User er changed the following:
What |Old value |New value
================================================================================
Subcomponent|code |programming
--------------------------------------------------------------------------------
------- Additional comments from [EMAIL PROTECTED] Wed Aug 27 13:01:45 +0000
2008 -------
@lvyue: I'll attach a patch created against CWS odff05 based on
DEV300_m29, please checkout CWS odff05 and continue further work based
on the new patch. As discussed on IRC, please investigate interpreter
methods whether special handling similar to MatAdd() and such is needed
for other functions as well.
Changes I did in the patch:
In ScInterpreter::JumpMatrix() the conditions to check for replication
were overcomplicated, at least in the case of svMatrix that was wrong
and lead to access of invalid matrix positions. Btw, this was caught by
an assertion about a matrix dimension error, I strongly suggest you use
a non-product build to get assertions displayed, please invoke configure
with --enable-dbgutil before a clean build from scratch.
I changed the condition, for example, to
if ((nCols <= nC && nCols != 1) ||
(nRows <= nR && nRows != 1))
to catch the case for NOTAVAILABLE, also changed errNoValue to
NOTAVAILABLE for these cases to be consistent with MatRef() and Excel.
Similar for svDoubleRef, also the original range must not be changed by
using
ScAddress& rAdr = aRange.aStart;
rAdr.SetCol(...);
see also the comments I added there.
Introduced ScMatrix::ValidColRowOrReplicated(nCol,nRow) to replace
(ValidColRow(nCol,nRow) || ValidColRowReplicated(nCol,nRow))
for better readability and less typing effort ;-)
Simplified the conditionals in ValidColRowReplicated(), some checks were
done twice. Same in ScJumpMatrix::GetJump(), also added cleanup and an
assertion there for the case that invalid nCol/nRow was passed,
otherwise arbitrary memory could had been accessed in pJump[].
In interpr5.cxx introduced lcl_GetMinExtent() to not repeat all the
conditionals for nMinC=..., nMinR=... over and over again in MatAdd()
and the like.
Looking forward to your findings whether further changes are necessary
in other interpreter functions.
Thanks
Eike
---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]