lvyue schrieb:
hi Daniel,

Sorry to disturb you again.
I have added some functions in the classes you mentioned
in last mail( you can see them in the patch 4 of issue 93789 ).
http://www.openoffice.org/issues/show_bug.cgi?id=93789

but it works stranger, now, after export,
and when open again, the formula appears "=NA()".

can you tell me what is wrong in my patch?
and I wonder what is nRecSize, nRecPos, and nRec... used for.
I must miss many things in exporting, but I can not
find out, please offer me some help.
thank you very much.

Looks as if the URL misses the leading encoding byte 0x01. Additionally, there is a potential crash in XclExpSupbookBuffer::InsertEuroTool:

+bool XclExpSupbookBuffer::InsertEuroTool(
+        sal_uInt16& rnSupbook, sal_uInt16& rnExtName, const String& rName )
+{
+    XclExpSupbookRef xSupbook;
+    if( rName.EqualsIgnoreCaseAscii( "EUROCONVERT" ) )
+    {
+        String aUrl( RTL_CONSTASCII_USTRINGPARAM("\010EUROTOOL.XLA"));
+        if( !GetSupbookUrl( xSupbook, rnSupbook, aUrl ) )
+        {
+ xSupbook.reset( new XclExpSupbook( GetRoot(), aUrl, EXC_SBTYPE_EUROTOOL ) );
+            rnSupbook = Append( xSupbook );
+        }
+    }
+    rnExtName = xSupbook->InsertEuroTool( rName );
+    return rnExtName > 0;
+}
+

What happens if the passed string is not "EUROCONVERT"? Then the null-pointer xSupbook will be dereferenced below -> crash. Please do not check the rName, but always execute the "if( !GetSupbookUrl ... )" call.

Next, the string aUrl misses the leading URL encoding byte. Seems that XclExpUrlHelper::EncodeUrl is not able to handle this special URL format. Please remove the call to XclExpUrlHelper::EncodeUrl from the new XclExpSupbook::XclExpSupbook constructor, and pass the unchanged URL to both members maUrl and maUrlEncoded. Then, in the function above, change the URL to "\001\010EUROTOOL.XLA" (note the leading byte 0x01).

The function XclExpLinkManagerImpl5::InsertEuroTool is wrong (it looks for the Analysis add-in structures). It is used to export to the old Excel 5.0/95 format. I think we should not support this format (we do not do it in import anyway). Please remove the body of this function and return a "false" unconditionally. This will tell the formula export that EUROCONVERT is not supported for this file format.

I see that the function is not exported at all, but the N/A error instead. This indicates that there may be something else wrong in the formula export. Please try first if it will work with my suggested changes. If not we will have to look again for problems in formula export.


Regards
Daniel

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to