[PATCH] Bug 48140 - [EasyHack] remove uno calls from xlsx import

Daniel Bankston [danthedev] daniel.dev.libreoffice at gmail.com
Tue Apr 17 15:01:51 PDT 2012


On 04/17/2012 02:05 PM, Markus Mohrhard wrote:
> Hey Daniel,
>
>>> On Tue, 2012-04-17 at 08:45 -0400, Kohei Yoshida wrote:
>>>> I'll look through your changes to see what change might have caused
>>>> the shared formula import issue.
>>> This change
>>>
>>> -    Reference<  XNamedRange>  xNamedRange = createNamedRangeObject( aName, rTokens, 0 );
>>> -    OSL_ENSURE( xNamedRange.is(), "SheetDataBuffer::createSharedFormula - cannot create shared formula" );
>>> -    PropertySet aNameProps( xNamedRange );
>>> -    aNameProps.setProperty( PROP_IsSharedFormula, true );
>>> +    ScRangeData* pScRangeData = createNamedRangeObject( aName, rTokens, 0 );
>>>
>>> in SheetDataBuffer::createSharedFormula() may be the culprit.  I haven't
>>> verified it with 100% certainty, but this change certainly smells.
>>>
>>> Refer to
>>>
>>> http://opengrok.libreoffice.org/xref/core/sc/source/ui/unoobj/nameuno.cxx#392
>>>
>>> for what actually takes place when setting a boolean "IsSharedFormula"
>>> property to the named range UNO object.
>>>
>> The diffderence between a shared formula and a normal range name is
>> that a shared formula has type RT_SHARED. You can change that in
>> ScRangeData by setting this with SetType or AddType.
>>
> I finally pushed you patch with the small correction that was
> necessary for the shared formula import. I also added a simple test
> case for shared formula import based on Kohei's test document. You
> find the commit at
> http://cgit.freedesktop.org/libreoffice/core/commit/?id=f892be678a036cd0fea665eda529e9cc906e0cfa
>
> Thanks a lot for this great work.
>
> Regards,
> Markus

Thank you, Noel, Kohei, and Markus for taking the time to address this 
patch!  I am embarrassed by that oversight with the shared formulas, and 
I will try to do better in the future.  Since you guys have fixed the 
shared formulas problem and pushed the patch, I will turn my attention 
to converting the database ranges unless you think my efforts should be 
directed elsewhere.  However, I must note that I have school assignment 
deadlines and finals in these next couple of weeks, so much of my time 
will be devoted to that.

--Daniel Bankston


More information about the LibreOffice mailing list