Bug 144191 - LILO starbase macro give name to chart proved by xraytool but manually the chart name is empty string
Summary: LILO starbase macro give name to chart proved by xraytool but manually the ch...
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Chart (show other bugs)
Version:
(earliest affected)
7.3.0.0 alpha0+
Hardware: All Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: QA:needsComment
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-30 15:53 UTC by elias estatistics
Modified: 2021-09-14 05:21 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
calc file with macro code - chart name is empty even it is declared (17.11 KB, application/vnd.oasis.opendocument.spreadsheet)
2021-08-30 15:53 UTC, elias estatistics
Details

Note You need to log in before you can comment on or make changes to this bug.
Description elias estatistics 2021-08-30 15:53:24 UTC
Created attachment 174646 [details]
calc file with macro code - chart name is empty even it is declared

LILO starbase macro give name to chart proved by xraytool but manually the chart name is empty string

To reproduce: 
- Run the macro code in the attachment .ods file. 
- Check Chart Name property - an empty string
- Try manually to name the chart with the name defined in macro code 
- The"OK" button is grayed out.
- Try to set any other name. You can. 


- LILO starbase macro code (included in a cell in the attachment)

  Sub LoadingLibraries
   BasicLibraries.LoadLibrary("XrayTool")
  End Sub


  Sub CreateCalcWithSimpleChart

  ' Definitions of variables
  Dim oSheet    'Sheet containing the chart
  Dim oRect     'How big is the chart
  Dim oCharts   'Charts in the sheet
  Dim oChart    'Created chart
  Dim oAddress  'Address of data to plot
  Dim sName$    'Chart name
  Dim oChartDoc 'Embedded chart object
  Dim oTitle    'Chart title object 
  Dim oDiagram  'Inserted diagram (data).
  Dim sDataRng  'Where is the data
  Dim oCalcDoc  

  ' it is needed to define Point and Size in order to
  ' change Position and Size of Chart Objects
  Dim Pos_Chart       As New com.sun.star.awt.Point
  Dim Pos_Title       As New com.sun.star.awt.Point
  Dim Pos_SubTitle    As New com.sun.star.awt.Point
  Dim Pos_xTitle      As New com.sun.star.awt.Point
  Dim Pos_yTitle      As New com.sun.star.awt.Point
  Dim Pos_Legend      As New com.sun.star.awt.Point

  Dim Size_Chart      As New com.sun.star.awt.Size
  Dim Size_Title      As New com.sun.star.awt.Size
  Dim Size_SubTitle   As New com.sun.star.awt.Size
  Dim Size_xTitle     As New com.sun.star.awt.Size
  Dim Size_yTitle     As New com.sun.star.awt.Size
  Dim Size_Legend     As New com.sun.star.awt.Size



  'Dont Forget to Define "Name of Sheet
  oSheets     = ThisComponent.getSheets()
  oSheet      = oSheets.getbyName( "Graph_stat" ) 

      
          Chart_XPos       = 0
          Chart_YPos       = 17000
          Chart_Width      = 16000
          Chart_Height     = 10000
   		Chart_New_XPos   =  Chart_New_XPos + Chart_Width + 900
  		
  		'Creation of objects into variables
  		oCalcDoc    = CreateCalcForChart()
  		sName       = "stat1"
  		sDataRng    = "D17:F28"
  		oAddress    = oSheet.getCellRangeByName(sDataRng).getRangeAddress()
  		oCharts     = oSheet.getCharts()
  		oRange      = oSheet.getCellRangeByName( sDataRng )
  		
  		
  		'The size of the whole chart 
  		If NOT oCharts.hasByName(sName) Then
  		oRect       = createObject("com.sun.star.awt.Rectangle")
  		oRect.X     = Chart_New_XPos
  		oRect.Y     = Chart_YPos
  		oRect.width = Chart_Width
  		oRect.Height= Chart_Height
  			
  		oCharts.addNewByName(sName, oRect, Array(oAddress), True, True)
  		End If		

  		
  		' Getting the Chart for manipulations
  		oChart       = oCharts.getByName(sName)  
  		oChart.setRanges(Array(oAddress))
  		oChartDoc    = oChart.getEmbeddedObject()
  		oDiagram     = oChartDoc.createInstance("com.sun.star.chart.ChartDiagram")
  		oChartDoc.setDiagram(oDiagram)  
  		oDiagram     = oChartDoc.getDiagram()

  		
  		'Inside the Chart, Setting Position and Size of the Diagram
  		oChartDoc.RefreshAddInAllowed = True
  		Pos_Chart.X                   = 300
  		Pos_Chart.Y                   = 1200
  		Size_Chart.width              = Chart_Width  - 800
  		Size_Chart.height             = Chart_Height - 1500
  		oDiagram.setPosition( Pos_Chart )
  		oDiagram.setSize(     Size_Chart )
  	
         
  end sub
Comment 1 elias estatistics 2021-08-30 16:16:08 UTC
Same as here maybe? id=125252
Comment 2 elias estatistics 2021-08-30 16:16:22 UTC Comment hidden (obsolete)