Bug 70380 - [1] BASIC: Unable to set cell cross border using macro
Summary: [1] BASIC: Unable to set cell cross border using macro
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.1.2.3 release
Hardware: x86 (IA32) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Macro-Recording
  Show dependency treegraph
 
Reported: 2013-10-11 16:07 UTC by ZioTibia81
Modified: 2019-04-18 06:55 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ZioTibia81 2013-10-11 16:07:01 UTC
- Open an empty spreadsheet
- Select a cell
- Start a macro recording
- open cell format and add a cross border
- apply, stop recording macro and save macro.

Generated code is:

sub Main
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(3) as new com.sun.star.beans.PropertyValue
args1(0).Name = "BorderBLTR.LineFGColor"
args1(0).Value = 0
args1(1).Name = "BorderBLTR.LineOutWidth"
args1(1).Value = 1
args1(2).Name = "BorderBLTR.LineInWidth"
args1(2).Value = 0
args1(3).Name = "BorderBLTR.LineDistance"
args1(3).Value = 0

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


end sub


Now select another cell, execute macro and the cross border is not set.
Executing the same procedure with any other border (top, bottom....) the resulting macro is functionally.
Comment 1 afonit 2014-06-25 13:42:15 UTC
setting status:New,
As I was able to reproduce this on
4.2.5.2
Fedora 20


Comparing the code to the original posters, a regular border follows this pattern:
args1(0).Name = "BorderOuter.LeftBorder"
args1(0).Value = Array(0,0,2,0,0,2)


however in the cross border macro the .Value is a single integer - does it need some array to work?
Comment 2 afonit 2014-06-25 15:00:04 UTC
I see the array is necessary in the outer border because of the way the attributes are being laid out, however for the cross border it is calling these out individually, so I assume that is why it does not need an array:
args1(0).Name = "BorderBLTR.LineFGColor"
args1(0).Value = 0
args1(1).Name = "BorderBLTR.LineOutWidth"
args1(1).Value = 1
args1(2).Name = "BorderBLTR.LineInWidth"
args1(2).Value = 0
args1(3).Name = "BorderBLTR.LineDistance
Comment 3 QA Administrators 2015-07-18 17:44:44 UTC Comment hidden (obsolete)
Comment 4 ZioTibia81 2015-07-18 18:10:05 UTC
Still on 5.0.0.3
Comment 5 QA Administrators 2016-09-20 10:18:47 UTC Comment hidden (obsolete)
Comment 6 ZioTibia81 2016-09-20 10:43:12 UTC
Still in 5.2.1.2
Comment 7 ZioTibia81 2017-02-17 17:27:35 UTC
In version 5.3.0.3 the following macro do result as expected:

    dim myLine as new com.sun.star.table.BorderLine
    myDoc = thisComponent
    myCell = myDoc.CurrentSelection
    myLine.Color = RGB(0,0,0)
    myLine.OuterLineWidth = 26
    myCell.DiagonalBLTR = myLine  'Bottom Left Top Right
    myCell.DiagonalTLBR = myLine  'Top Left Bottom Right


macro registration still producing wrong code.
Comment 8 QA Administrators 2018-02-18 03:38:15 UTC Comment hidden (obsolete)
Comment 9 ZioTibia81 2018-02-19 13:16:55 UTC
Versione: 6.0.1.1 (x64)
Build ID: 60bfb1526849283ce2491346ed2aa51c465abfe6
Thread CPU: 12; SO: Windows 10.0; Resa interfaccia: predefinito; 
Versione locale: it-IT (it_IT); Calc: group

Macro recording still producing wrong code.
Comment 10 QA Administrators 2019-02-20 03:47:51 UTC Comment hidden (obsolete)
Comment 11 ZioTibia81 2019-02-20 10:53:51 UTC
Versione: 6.2.0.3 (x64)
Build ID: 98c6a8a1c6c7b144ce3cc729e34964b47ce25d62
Thread CPU: 12; SO: Windows 10.0; Resa interfaccia: predefinito; VCL: win; 
Versione locale: it-IT (it_IT); Lingua interfaccia: it-IT
Calc: threaded

Macro recording still producing wrong code.