Re: [sc-dev] Questions about oox/source/xls/formulabase.cxx

2010-05-31 Thread Regina Henschel

Hi Daniel,

Regina Henschel schrieb:


== B ==

But I have still questions concerning the new imaginary functions.
Those functions have no op-code. Need I to add them to
saFuncTable_Odf? If yes, how can I do it?


Yes, the filters in sc are used for import/export of the XLS format. On
export, the current behaviour is:
If the function is an add-in function, the XCompatibilityNames interface
is used to retrieve its name used in the XLS file format (see in file
sc/source/filter/excel/xeformula.cxx, in function
XclExpFmlaCompImpl::AppendAddInCallToken(), call to GetExcelName()). So
I would suggest that this interface returns the "_xlfnodf.XYZ" function
names, to not get any name clashes with existing functions in Excel. The
import filter will try to convert these function names back to add-in
functions, again with the mentioned interface. But I do not know if this
will work out of the box. In file sc/source/filter/excel/xiroot.cxx,
there is a function XclImpRoot::GetScAddInName() that calls
GetCalcName() if you want to debug it.


I have added the imaginary functions to saFuncTable_Odf with opcode
ocNoName now. The prefix "_xlfnodf." is not set. It does not work "out
of the box". You do not notice the missing prefix in the test results,
when testing the round trip mybuild -> Excel -> mybuild. There the cell
entries are OK. But you see it in the round trip in xls format mybuild
-> OOo243 -> mybuild, which results in #MACRO?, and if you look into the
xls file with an editor.



If I use ocExternal the prefix is set, but the functions are not 
distinct, only one name is written and on import the whole function name 
is stripped, so only =(z) remains from =_xlfnodf.IMSECH(z).


I see no way to add the imaginary functions to list saFuncTable_Odf, 
because they have no op-code.


Do I understand you right, that I should try to add the prefix in 
function GetExcelName in /sc/.../addincol.cxx?


kind regards
Regina

-
To unsubscribe, e-mail: dev-unsubscr...@sc.openoffice.org
For additional commands, e-mail: dev-h...@sc.openoffice.org



Re: [sc-dev] Questions about oox/source/xls/formulabase.cxx

2010-05-31 Thread Regina Henschel

Hallo Daniel,

Daniel Rentz schrieb:

Hello,

Regina Henschel schrieb:


== A ==

I have added SEC, CSC, SECH, and CSCH, to saFuncTable_Odf. All four
new functions have op-codes. Tests look good:

Reloading directly is correct for ods, xls, sdc, and sxc.
Loading and resaving with StarOffice8 (for ods, sdc, and sxc) and
Excel2010 (for xls) and then loading in my build is correct too.


Good! Did you add them to the sc and oox modules?


I have added them only to saFuncTable_Odf in sc/.../xlformula.cxx. They 
get the prefix "_xlfnodf.", I see it in the xls file.






== B ==

But I have still questions concerning the new imaginary functions.
Those functions have no op-code. Need I to add them to
saFuncTable_Odf? If yes, how can I do it?


Yes, the filters in sc are used for import/export of the XLS format. On
export, the current behaviour is:
If the function is an add-in function, the XCompatibilityNames interface
is used to retrieve its name used in the XLS file format (see in file
sc/source/filter/excel/xeformula.cxx, in function
XclExpFmlaCompImpl::AppendAddInCallToken(), call to GetExcelName()). So
I would suggest that this interface returns the "_xlfnodf.XYZ" function
names, to not get any name clashes with existing functions in Excel. The
import filter will try to convert these function names back to add-in
functions, again with the mentioned interface. But I do not know if this
will work out of the box. In file sc/source/filter/excel/xiroot.cxx,
there is a function XclImpRoot::GetScAddInName() that calls
GetCalcName() if you want to debug it.


I have added the imaginary functions to saFuncTable_Odf with opcode 
ocNoName now. The prefix "_xlfnodf." is not set. It does not work "out 
of the box". You do not notice the missing prefix in the test results, 
when testing the round trip mybuild -> Excel -> mybuild. There the cell 
entries are OK. But you see it in the round trip in xls format mybuild 
-> OOo243 -> mybuild, which results in #MACRO?, and if you look into the 
xls file with an editor.



 if you want to debug it


There is no hurry to implement the new functions. So I will try to make 
it correct and learn a little bit about the filters.


kind regards
Regina

-
To unsubscribe, e-mail: dev-unsubscr...@sc.openoffice.org
For additional commands, e-mail: dev-h...@sc.openoffice.org



[sc-dev] Calc/Chart Project

2010-05-31 Thread Marina Plakalovic
Hello,

I have heard about the summer student internship and decided to apply for  Add
new spreadsheet functions and parameters according to ODFF.

I am interested to know a little bit more about this project. Where can I
get some additional documents or links if they exist to get myself more
familiar with the project.

Thanks in advance.

Best regards,
Marina Plakalovic


Re: [sc-dev] Questions about oox/source/xls/formulabase.cxx

2010-05-31 Thread Daniel Rentz

Hello,

Regina Henschel schrieb:


Daniel Rentz schrieb:



Right, fix has been integrated into m77
http://qa.openoffice.org/issues/show_bug.cgi?id=79854


Now I have a build based on m78. I made some import/export tests. 
Excel2003 xml is totally broken (issue 94261) and not mentioned below.


Yes, that filter is not in a good state.


== A ==

I have added SEC, CSC, SECH, and CSCH, to saFuncTable_Odf. All four new 
functions have op-codes. Tests look good:


Reloading directly is correct for ods, xls, sdc, and sxc.
Loading and resaving with StarOffice8 (for ods, sdc, and sxc) and 
Excel2010 (for xls) and then loading in my build is correct too.


Good! Did you add them to the sc and oox modules?



== B ==

But I have still questions concerning the new imaginary functions. Those 
functions have no op-code. Need I to add them to saFuncTable_Odf? If 
yes, how can I do it?


Yes, the filters in sc are used for import/export of the XLS format. On 
export, the current behaviour is:
If the function is an add-in function, the XCompatibilityNames interface 
is used to retrieve its name used in the XLS file format (see in file 
sc/source/filter/excel/xeformula.cxx, in function 
XclExpFmlaCompImpl::AppendAddInCallToken(), call to GetExcelName()). So 
I would suggest that this interface returns the "_xlfnodf.XYZ" function 
names, to not get any name clashes with existing functions in Excel. The 
import filter will try to convert these function names back to add-in 
functions, again with the mentioned interface. But I do not know if this 
will work out of the box. In file sc/source/filter/excel/xiroot.cxx, 
there is a function XclImpRoot::GetScAddInName() that calls 
GetCalcName() if you want to debug it.



I tried to add them to saFuncTableOdf in oox/source/xls/formulabase.cxx, 
but does not know, which values to use for eighth and ninth parameter. I 
have tried all combination of {RR},{VR} and FUNCFLAG_EXTERNAL, 
FUNCFLAG_MACROCALLODF. But it has no effect on my test results.


Currently, the filters in the oox modules are only used to import XLSX 
and XLSB file format. As we cannot export to these formats, the new 
functions should not appear in these files. (It is planned to move the 
old filters from sc to oox, but this is not finished yet.) So, it is 
more important to add them to the sc filters.


To answer the question:
- 8th parameter: The token class codes RR, VR, etc. are important for 
the function parameters, to let Excel distinguish reference, array, and 
value parameters. They do not affect how the function itself is handled. 
If you have "regular" value parameters, the code VR is sufficient in 
most cases.
- 9th parameter: Special flags. Are used to trigger some special 
behaviour in the filters. All functions unknown by Excel should get the 
FUNCFLAG_MACROCALLODF flag. This will cause the import filter to convert 
the function "_xlfnodf.FUNCNAME" to "FUNCNAME".




The test results are:

== B1 Directly reloading ==
Correct with general setting 'ODF 1.0' in ods, sdc, sxc, and xls
Correct with general setting 'ODF 1.2 extended' in ods, sdc, and xls. It 
fails for sxc (issue 95312).


== B2 Opening and resaving in StarOffice8 and Excel2010, reloading in my 
build ==

Correct with general setting 'ODF 1.0' in xls, sdc, and sxc.
Correct with general setting 'ODF 1.2 extended' in xls and sdc.

In the cases
 'ODF 1.0' with ods and
 'ODF 1.2 extended' with sxc and ods,
the new functions are reloaded with #NAME?, but the cells contain the 
formulas like '=imsech(z)'.
In contrast to issue 95312 the old imaginary functions are handled 
correctly in this round trip through StarOffice8 and Excel2010 
respectively.


Cannot say about the ODF filter, Eike should know better.



Do I miss something, or is that a general error with 'new' addin-functions?

Please have a look at issue 101386. Is it the same problem?


Again, something for Eike.



Regards
Daniel

-
To unsubscribe, e-mail: dev-unsubscr...@sc.openoffice.org
For additional commands, e-mail: dev-h...@sc.openoffice.org



Re: [sc-dev] Range Highlighter Anchor Handle

2010-05-31 Thread rashi dhing
I did mean that tiny rectangle that you see whenever a cell range in a
formula is highlighted on the spreadsheet when
the focus is in the inputline. But I think it is the same as when a cell
selections are made.
Thanks for the lead Niklas !

On Mon, May 31, 2010 at 11:10 AM, Niklas Nebel  wrote:

> On 05/30/10 10:54, rashi dhing wrote:
>
>> Whenever a range is referenced, there is this anchor handle that allows
>> one
>> to grow or resize the selected range.
>> Now the anchor only appears whenever the focus is in the inputline. I am
>> trying to find the function that is responsible
>> for the anchor to appear. I came across the  *
>> ScGridWindow::CreateAnchorHandle* function but don't think it is
>> really useful. Can you let me know which is the relevant function ?
>>
>
> Do you mean the rectangle at the lower right corner of a reference range?
> That is part of the range highlighting when you start editing an existing
> formula, not when you input a new reference. It doesn't matter if the focus
> is in the input line or the cell area. It's drawn in
> ScOutputData::DrawRefMark if bHandle is set (called from
> ScGridWindow::Draw).
>
> ScGridWindow::CreateAnchorHandle is for the anchors of drawing objects.
>
> Niklas
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@sc.openoffice.org
> For additional commands, e-mail: dev-h...@sc.openoffice.org
>
>


-- 
" Happiness makes up in height for what it lacks in length." (Robert Frost)


Re: [sc-dev] Range Highlighter Anchor Handle

2010-05-31 Thread Niklas Nebel

On 05/30/10 10:54, rashi dhing wrote:

Whenever a range is referenced, there is this anchor handle that allows one
to grow or resize the selected range.
Now the anchor only appears whenever the focus is in the inputline. I am
trying to find the function that is responsible
for the anchor to appear. I came across the  *
ScGridWindow::CreateAnchorHandle* function but don't think it is
really useful. Can you let me know which is the relevant function ?


Do you mean the rectangle at the lower right corner of a reference 
range? That is part of the range highlighting when you start editing an 
existing formula, not when you input a new reference. It doesn't matter 
if the focus is in the input line or the cell area. It's drawn in 
ScOutputData::DrawRefMark if bHandle is set (called from 
ScGridWindow::Draw).


ScGridWindow::CreateAnchorHandle is for the anchors of drawing objects.

Niklas

-
To unsubscribe, e-mail: dev-unsubscr...@sc.openoffice.org
For additional commands, e-mail: dev-h...@sc.openoffice.org