https://issues.apache.org/ooo/show_bug.cgi?id=122840

Clarence GUO <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #14 from Clarence GUO <[email protected]> ---
Hi~ I find a problem in 120478 which cause this defect.
In 120478, zhaoshzh added support for scope of name range. MS Excel can define
a same name to a range on different sheets. For example defines "MyRange" to
"Sheet1.A1:A4" with scope in sheet1 and defines "MyRange" again to
"Sheet2.A1:A4" with scope in sheet2.
In order to add this support, he changed code in ScXMLImport::SetNamedRanges(),
from
xNamedRanges->addNewByName((*aItr)->sName, sTempContent, aCellAddress,
GetRangeType((*aItr)->sRangeType));
to
xNamedRanges->addNewByScopeName( sTabName, (*aItr)->sName, (*aItr)->sContent,
aCellAddress, GetRangeType((*aItr)->sRangeType) );
addNewByScopeName is a new method, the difference with addNewByName is it added
a new parameter sTabName in order to distinguish the scope. Others are same.
But note he also changed the third parameter of the new method. In the old
method, that parameter is sTempContent, it is string "0". However, in the new
method he passed (*aItr)->sContent into, (*aItr)->sContent is the real content
of the name. For example, for above illustration, "Sheet1.A1:A4" is the content
of range name "MyRange".
I'm not sure whether it is his pen mistake, but from logic, as he only add a
new parameter for scope identification, the old parameters should not be
changed. So I just change (*aItr)->sContent back to sTempContent, then it
works.
And there's no problem on 120478 sample file with the fix. I did some test,
haven't find problem.
But I don't know why we need to pass a "0" string as content into the method.
Does anybody knows that?

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.
You are watching all bug changes.

Reply via email to