Control apostrophe
Posted: Wed Mar 22, 2017 11:07 pm
CALC would be greatly improved if the EXCEL feature of the Control Apostrophe were added. This feature replicates the content of the cell above it.
User community support forum for Apache OpenOffice, LibreOffice and all the OpenOffice.org derivatives
https://forum.openoffice.org/en/forum/
A simple reference is not appropriate for you?CALC would be greatly improved if the EXCEL feature of the Control Apostrophe were added. This feature replicates the content of the cell above it.
Code: Select all
A2: "Hello world!"
A1: =A2
Oooops!LibreOffice provides this shortcut. It is very handy.
Edit: Ahhh, it works - with English keyboard layout - in my LO 5.3.0 Portable version... And the name of the function is: 'Fill single edit'. I can assign this function to a really available shortcut key now in my Hungarian LO 4.4.7 too. |
Code: Select all
sub Copy_Down
rem ----------------------------------------------------------------------
rem define variables
dim document as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
rem ----------------------------------------------------------------------
dim args1(1) as new com.sun.star.beans.PropertyValue
args1(0).Name = "By"
args1(0).Value = 1
args1(1).Name = "Sel"
args1(1).Value = false
dispatcher.executeDispatch(document, ".uno:GoUp", "", 0, args1())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:Copy", "", 0, Array())
rem ----------------------------------------------------------------------
dim args3(1) as new com.sun.star.beans.PropertyValue
args3(0).Name = "By"
args3(0).Value = 1
args3(1).Name = "Sel"
args3(1).Value = false
dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, args3())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:Paste", "", 0, Array())
end sub
Code: Select all
sub CopyDown
oSheet = thiscomponent.getcurrentcontroller.activesheet
oCellActual = ThisComponent.getCurrentSelection()
oCellAddress = oCellActual.getCellAddress()
iRow = oCellAddress.Row()
iCol = oCellAddress.Column()
oCellAbove = oSheet.getCellByPosition(iCol,iRow-1)
Select Case oCellAbove.Type
Case 0
oCellActual.ClearContents(1 OR 2 OR 4 OR 8 OR 16 OR 32 OR 64 OR 128 OR 256 OR 512)
Case 1
oCellActual.Value = oCellAbove.Value
Case 2
oCellActual.String = oCellAbove.String
Case 3
oCellActual.Formula = oCellAbove.Formula
End select
end sub