Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


Thans Eike for the enlighment.

I am not  skilled in C++ (thanks for your patience), but scslots.hxx looks
different for GoUpSel and GoDownSel, if that matters, around the line that
starts with "73/*Offset*/" and "74/*Offset*/"


// Slot Nr. 145 : 26521
    SFX_NEW_SLOT_ARG(
ScCellShell,SID_CURSORDOWN_SEL,SID_CURSORDOWN_SEL,GID_NAVIGATOR,
                0 ,&aScCellShellSlots_Impl[146] /*Offset Next*/,

SFX_STUB_PTR(ScCellShell,ExecuteCursorSel),SFX_STUB_PTR(ScCellShell,GetStateCursor),

SFX_SLOT_CACHABLE|SFX_SLOT_SYNCHRON|SFX_SLOT_RECORDPERSET|SFX_SLOT_ACCELCONFIG|SFX_SLOT_READONLYDOC|0,
                0,
                SfxVoidItem,
                73/*Offset*/, 1/*Count*/, 0, SFX_SLOT_METHOD|0,"GoDownSel"
),
// Slot Nr. 146 : 26522
    SFX_NEW_SLOT_ARG(
ScCellShell,SID_CURSORUP_SEL,SID_CURSORUP_SEL,GID_NAVIGATOR,
                0 ,&aScCellShellSlots_Impl[147] /*Offset Next*/,

SFX_STUB_PTR(ScCellShell,ExecuteCursorSel),SFX_STUB_PTR(ScCellShell,GetStateCursor),

SFX_SLOT_CACHABLE|SFX_SLOT_SYNCHRON|SFX_SLOT_RECORDPERSET|SFX_SLOT_ACCELCONFIG|SFX_SLOT_READONLYDOC|0,
                0,
                SfxVoidItem,
                74/*Offset*/,
1/*Count*/,".GoUpSel",SFX_SLOT_METHOD|0,"GoUpSel" ),


Anyway,  the whole thing is that GoDownSel (/UpSel/LeftSel/RightSel) has
thus a property value  FN_PARAM_1 which represent a repetition of the
command named ("By"), I guess..

1) So the following code

rem ----------------------------------------------------------------------
dim args1(1) as new com.sun.star.beans.PropertyValue
args1(0).Name = "By"
args1(0).Value = 10
args1(1).Name = "Sel"
args1(1).Value = True

dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, args1())

should select 10 lines downward, no?

But it don't as far as I can see. It moves 10 lines and select one more, the
11th.

I think the issue is in sc/source/ui/view/cellsh4.cxx, where the repetition
nRepeat

       if( IS_AVAILABLE( FN_PARAM_1, &pItem ) )
            nRepeat = static_cast<SCsCOLROW>(((const
SfxInt16Item*)pItem)->GetValue());

is not used as loop or passed properly when bSel is true, just below...

2) And the code

rem ----------------------------------------------------------------------
dim args2(0) as new com.sun.star.beans.PropertyValue
args2(0).Name = "By"
args2(0).Value = 10

dispatcher.executeDispatch(document, ".uno:GoDownSel", "", 0, args2())

does not select more than 2 cells, probably because the loop nRepeat is
missing, it is not taken from rReq in method

void ScCellShell::ExecuteCursorSel( SfxRequest& rReq )

and besides, the recent fix of bug
https://bugs.freedesktop.org/show_bug.cgi?id=38955
fixes the recording but does not return the "By" property, as it may miss a
line like

rReq.AppendItem( SfxInt16Item(FN_PARAM_1, static_cast<sal_Int16>(nRepeat))
);

thus the recorded macro does not show the "By" property

Again sorry for bothering, but isn't this a defect? I am not sure with
respect to the specifications.

Kind regards

Olivier

2011/7/27 Eike Rathke <ooo@erack.de>

Hi Olivier,

On Wednesday, 2011-07-27 14:50:33 -0300, Olivier Hallot wrote:

Investigating sc/sdi/cellsh.sdi
[...]
So it looks like GoDownSel has an argument "By", which seems to be
"select
FN_PARAM_1 cells down", but GoUpSel (GoRightSel and GoLeftSel) does not
have
this parameter.

Which one is the correct?

Tricky.. both ;-)  The slot parameters of the first definition of an
ExecMethod are inherited by following definitions with the same
ExecMethod. So actually SID_CURSORUP_SEL inherits By from the first
definition of ExecuteCursorSel that happens to be SID_CURSORDOWN_SEL.
Compare with the generated sc/$INPATH/inc/scslots.hxx

 Eike

--
 PGP/OpenPGP/GnuPG encrypted mail preferred in all private communication.
 Key ID: 0x293C05FD - 997A 4C60 CE41 0149 0DB3  9E96 2F1A D073 293C 05FD

_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice




-- 
Olivier Hallot
Founder and Steering Commitee Member
The Document Foundation

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.