CollapseToMergedArea (LibreOffice Basic): verschil tussen versies

Uit De Vliegende Brigade
Ga naar: navigatie, zoeken
(Simpel beginnen)
(Programmeercode)
 
(Een tussenliggende versie door dezelfde gebruiker niet weergegeven)
Regel 20: Regel 20:
 
== Programmeercode ==
 
== Programmeercode ==
  
=== Simpel beginnen ===
+
=== Inspecteer cursor-object ===
 +
 
 
[[file:20191106-1932.png|thumb|Objecttype o_cursor is en blijft ''ScCellCursorObj'']]
 
[[file:20191106-1932.png|thumb|Objecttype o_cursor is en blijft ''ScCellCursorObj'']]
Dit geeft in ieder geval geen foutmelding:
+
Simpel beginnen: Dit geeft ten minste geen foutmelding + allerlei info omtrent object:
  
 
<pre>
 
<pre>
sub test_01()
+
sub test_01_inspect_cursor_object()
 +
 
 +
o_cursor = ThisComponent.Sheets(0).createCursor()
 +
o_cursor.collapseToMergedArea()
 +
 
 +
Print IsObject(o_cursor)      'True
 +
Print IsNull(o_cursor)        'False
 +
Print IsEmpty(o_cursor)      'False
 +
Print IsArray(o_cursor)      'False
 +
Print IsUnoStruct(o_cursor)  'False
 +
Print TypeName(o_cursor)      'Object
 +
msgbox o_cursor.dbg_methods  'This property is discussed later
 +
 
 +
end sub</pre>
  
  o_cursor = ThisComponent.Sheets(0).createCursor()
+
<pre>
  o_cursor.collapseToMergedArea()
+
Methods of object "ScCellCursorObj":
  
end sub
+
SbxARRAY  createImportDescriptor (SbxBOOL)
 +
SbxARRAY  createSortDescriptor (void)
 +
SbxARRAY  getArrayTokens (void)
 +
SbxARRAY  getColumnDescriptions (void)
 +
SbxARRAY  getData (void)
 +
SbxARRAY  getDataArray (void)
 +
SbxARRAY  getFormulaArray (void)
 +
SbxARRAY  getImplementationId (void)
 +
SbxARRAY  getPropertyStates (SbxARRAY)
 +
SbxARRAY  getPropertyValues (SbxARRAY)
 +
SbxARRAY  getRowDescriptions (void)
 +
SbxARRAY  getSupportedServiceNames (void)
 +
SbxARRAY  getTypes (void)
 +
SbxBOOL  getIsMerged (void)
 +
SbxBOOL  isNotANumber (SbxDOUBLE)
 +
SbxBOOL  supportsService (SbxSTRING)
 +
SbxDOUBLE computeFunction (SbxLONG)
 +
SbxDOUBLE getNotANumber (void)
 +
SbxEMPTY  getPropertyDefault (SbxSTRING)
 +
SbxEMPTY  getPropertyValue (SbxSTRING)
 +
SbxEMPTY  queryInterface (SbxOBJECT)
 +
SbxINT64  getSomething (SbxARRAY)
 +
SbxLONG  getPropertyState (SbxSTRING)
 +
SbxLONG  replaceAll (SbxOBJECT)
 +
SbxOBJECT createFilterDescriptor (SbxBOOL)
 +
SbxOBJECT createFilterDescriptorByObject (SbxOBJECT)
 +
SbxOBJECT createReplaceDescriptor (void)
 +
SbxOBJECT createSearchDescriptor (void)
 +
SbxOBJECT createSubTotalDescriptor (SbxBOOL)
 +
SbxOBJECT findAll (SbxOBJECT)
 +
SbxOBJECT findFirst (SbxOBJECT)
 +
SbxOBJECT findNext (SbxOBJECT, SbxOBJECT)
 +
SbxOBJECT getCellByPosition (SbxLONG, SbxLONG)
 +
SbxOBJECT getCellFormatRanges (void)
 +
SbxOBJECT getCellRangeByName (SbxSTRING)
 +
SbxOBJECT getCellRangeByPosition (SbxLONG, SbxLONG, SbxLONG, SbxLONG)
 +
SbxOBJECT getColumns (void)
 +
SbxOBJECT getPropertySetInfo (void)
 +
SbxOBJECT getPropertySetInfo (void)
 +
SbxOBJECT getRangeAddress (void)
 +
SbxOBJECT getRows (void)
 +
SbxOBJECT getSpreadsheet (void)
 +
SbxOBJECT getUniqueCellFormatRanges (void)
 +
SbxOBJECT queryColumnDifferences (SbxOBJECT)
 +
SbxOBJECT queryContentCells (SbxINTEGER)
 +
SbxOBJECT queryDependents (SbxBOOL)
 +
SbxOBJECT queryEmptyCells (void)
 +
SbxOBJECT queryFormulaCells (SbxLONG)
 +
SbxOBJECT queryIntersection (SbxOBJECT)
 +
SbxOBJECT queryPrecedents (SbxBOOL)
 +
SbxOBJECT queryRowDifferences (SbxOBJECT)
 +
SbxOBJECT queryVisibleCells (void)
 +
SbxSTRING getArrayFormula (void)
 +
SbxSTRING getImplementationName (void)
 +
SbxVOID  addChartDataChangeEventListener (SbxOBJECT)
 +
SbxVOID  addModifyListener (SbxOBJECT)
 +
SbxVOID  addPropertiesChangeListener (SbxARRAY, SbxOBJECT)
 +
SbxVOID  addPropertyChangeListener (SbxSTRING, SbxOBJECT)
 +
SbxVOID  addVetoableChangeListener (SbxSTRING, SbxOBJECT)
 +
SbxVOID  applySubTotals (SbxOBJECT, SbxBOOL)
 +
SbxVOID  autoFormat (SbxSTRING)
 +
SbxVOID  clearContents (SbxLONG)
 +
SbxVOID  collapseToCurrentArray (void)
 +
SbxVOID  collapseToCurrentRegion (void)
 +
SbxVOID  collapseToMergedArea (void)
 +
SbxVOID  collapseToSize (SbxLONG, SbxLONG)
 +
SbxVOID  decrementIndent (void)
 +
SbxVOID  doImport (SbxARRAY)
 +
SbxVOID  expandToEntireColumns (void)
 +
SbxVOID  expandToEntireRows (void)
 +
SbxVOID  fillAuto (SbxLONG, SbxLONG)
 +
SbxVOID  fillSeries (SbxLONG, SbxLONG, SbxLONG, SbxDOUBLE, SbxDOUBLE)
 +
SbxVOID  filter (SbxOBJECT)
 +
SbxVOID  firePropertiesChangeEvent (SbxARRAY, SbxOBJECT)
 +
SbxVOID  gotoEnd (void)
 +
SbxVOID  gotoEndOfUsedArea (SbxBOOL)
 +
SbxVOID  gotoNext (void)
 +
SbxVOID  gotoOffset (SbxLONG, SbxLONG)
 +
SbxVOID  gotoPrevious (void)
 +
SbxVOID  gotoStart (void)
 +
SbxVOID  gotoStartOfUsedArea (SbxBOOL)
 +
SbxVOID  incrementIndent (void)
 +
SbxVOID  merge (SbxBOOL)
 +
SbxVOID  removeChartDataChangeEventListener (SbxOBJECT)
 +
SbxVOID  removeModifyListener (SbxOBJECT)
 +
SbxVOID  removePropertiesChangeListener (SbxOBJECT)
 +
SbxVOID  removePropertyChangeListener (SbxSTRING, SbxOBJECT)
 +
SbxVOID  removeSubTotals (void)
 +
SbxVOID  removeVetoableChangeListener (SbxSTRING, SbxOBJECT)
 +
SbxVOID  setArrayFormula (SbxSTRING)
 +
SbxVOID  setArrayTokens (SbxARRAY)
 +
SbxVOID  setColumnDescriptions (SbxARRAY)
 +
SbxVOID  setData (SbxARRAY)
 +
SbxVOID  setDataArray (SbxARRAY)
 +
SbxVOID  setFormulaArray (SbxARRAY)
 +
SbxVOID  setPropertyToDefault (SbxSTRING)
 +
SbxVOID  setPropertyValue (SbxSTRING, SbxVARIANT)
 +
SbxVOID  setPropertyValues (SbxARRAY, SbxARRAY)
 +
SbxVOID  setRowDescriptions (SbxARRAY)
 +
SbxVOID  setTableOperation (SbxOBJECT, SbxLONG, SbxOBJECT, SbxOBJECT)
 +
SbxVOID  sort (SbxARRAY)
 
</pre>
 
</pre>
 +
 +
== Zie ook ==

Huidige versie van 6 nov 2019 om 19:55

collapseToMergedArea zou de centrale functie zijn om cellen in Calc te unmergen (nov. 2019). Toch lijkt de praktijk weerbarstiger te zijn dan de theorie...

API-documentatie

Beschrijving

[1]:

  • Expands the cursor to merged cell ranges
  • Expands the current cursor range in a way so that all merged cell ranges intersecting the current range will fit completely. If the cursor does not point to any range with merged cells, it is left unchanged.

Opmerkingen

  • Onderdeel van com.sun.star.sheet - Belangrijk, want vergelijkbare functies zitten in com.sun.star.table en dat heef betrekking op tabellen in Writer en niet in Calc.

Bronnen

Programmeercode

Inspecteer cursor-object

Objecttype o_cursor is en blijft ScCellCursorObj

Simpel beginnen: Dit geeft ten minste geen foutmelding + allerlei info omtrent object:

sub test_01_inspect_cursor_object()

	o_cursor = ThisComponent.Sheets(0).createCursor()
	o_cursor.collapseToMergedArea()

	Print IsObject(o_cursor)      'True
	Print IsNull(o_cursor)        'False
	Print IsEmpty(o_cursor)       'False
	Print IsArray(o_cursor)       'False
	Print IsUnoStruct(o_cursor)   'False
	Print TypeName(o_cursor)      'Object
	msgbox o_cursor.dbg_methods   'This property is discussed later

end sub
Methods of object "ScCellCursorObj":

SbxARRAY  createImportDescriptor (SbxBOOL)
SbxARRAY  createSortDescriptor (void)
SbxARRAY  getArrayTokens (void)
SbxARRAY  getColumnDescriptions (void)
SbxARRAY  getData (void)
SbxARRAY  getDataArray (void)
SbxARRAY  getFormulaArray (void)
SbxARRAY  getImplementationId (void)
SbxARRAY  getPropertyStates (SbxARRAY)
SbxARRAY  getPropertyValues (SbxARRAY)
SbxARRAY  getRowDescriptions (void)
SbxARRAY  getSupportedServiceNames (void)
SbxARRAY  getTypes (void)
SbxBOOL   getIsMerged (void)
SbxBOOL   isNotANumber (SbxDOUBLE)
SbxBOOL   supportsService (SbxSTRING)
SbxDOUBLE computeFunction (SbxLONG)
SbxDOUBLE getNotANumber (void)
SbxEMPTY  getPropertyDefault (SbxSTRING)
SbxEMPTY  getPropertyValue (SbxSTRING)
SbxEMPTY  queryInterface (SbxOBJECT)
SbxINT64  getSomething (SbxARRAY)
SbxLONG   getPropertyState (SbxSTRING)
SbxLONG   replaceAll (SbxOBJECT)
SbxOBJECT createFilterDescriptor (SbxBOOL)
SbxOBJECT createFilterDescriptorByObject (SbxOBJECT)
SbxOBJECT createReplaceDescriptor (void)
SbxOBJECT createSearchDescriptor (void)
SbxOBJECT createSubTotalDescriptor (SbxBOOL)
SbxOBJECT findAll (SbxOBJECT)
SbxOBJECT findFirst (SbxOBJECT)
SbxOBJECT findNext (SbxOBJECT, SbxOBJECT)
SbxOBJECT getCellByPosition (SbxLONG, SbxLONG)
SbxOBJECT getCellFormatRanges (void)
SbxOBJECT getCellRangeByName (SbxSTRING)
SbxOBJECT getCellRangeByPosition (SbxLONG, SbxLONG, SbxLONG, SbxLONG)
SbxOBJECT getColumns (void)
SbxOBJECT getPropertySetInfo (void)
SbxOBJECT getPropertySetInfo (void)
SbxOBJECT getRangeAddress (void)
SbxOBJECT getRows (void)
SbxOBJECT getSpreadsheet (void)
SbxOBJECT getUniqueCellFormatRanges (void)
SbxOBJECT queryColumnDifferences (SbxOBJECT)
SbxOBJECT queryContentCells (SbxINTEGER)
SbxOBJECT queryDependents (SbxBOOL)
SbxOBJECT queryEmptyCells (void)
SbxOBJECT queryFormulaCells (SbxLONG)
SbxOBJECT queryIntersection (SbxOBJECT)
SbxOBJECT queryPrecedents (SbxBOOL)
SbxOBJECT queryRowDifferences (SbxOBJECT)
SbxOBJECT queryVisibleCells (void)
SbxSTRING getArrayFormula (void)
SbxSTRING getImplementationName (void)
SbxVOID   addChartDataChangeEventListener (SbxOBJECT)
SbxVOID   addModifyListener (SbxOBJECT)
SbxVOID   addPropertiesChangeListener (SbxARRAY, SbxOBJECT)
SbxVOID   addPropertyChangeListener (SbxSTRING, SbxOBJECT)
SbxVOID   addVetoableChangeListener (SbxSTRING, SbxOBJECT)
SbxVOID   applySubTotals (SbxOBJECT, SbxBOOL)
SbxVOID   autoFormat (SbxSTRING)
SbxVOID   clearContents (SbxLONG)
SbxVOID   collapseToCurrentArray (void)
SbxVOID   collapseToCurrentRegion (void)
SbxVOID   collapseToMergedArea (void)
SbxVOID   collapseToSize (SbxLONG, SbxLONG)
SbxVOID   decrementIndent (void)
SbxVOID   doImport (SbxARRAY)
SbxVOID   expandToEntireColumns (void)
SbxVOID   expandToEntireRows (void)
SbxVOID   fillAuto (SbxLONG, SbxLONG)
SbxVOID   fillSeries (SbxLONG, SbxLONG, SbxLONG, SbxDOUBLE, SbxDOUBLE)
SbxVOID   filter (SbxOBJECT)
SbxVOID   firePropertiesChangeEvent (SbxARRAY, SbxOBJECT)
SbxVOID   gotoEnd (void)
SbxVOID   gotoEndOfUsedArea (SbxBOOL)
SbxVOID   gotoNext (void)
SbxVOID   gotoOffset (SbxLONG, SbxLONG) 
SbxVOID   gotoPrevious (void)
SbxVOID   gotoStart (void)
SbxVOID   gotoStartOfUsedArea (SbxBOOL)
SbxVOID   incrementIndent (void)
SbxVOID   merge (SbxBOOL)
SbxVOID   removeChartDataChangeEventListener (SbxOBJECT)
SbxVOID   removeModifyListener (SbxOBJECT)
SbxVOID   removePropertiesChangeListener (SbxOBJECT)
SbxVOID   removePropertyChangeListener (SbxSTRING, SbxOBJECT)
SbxVOID   removeSubTotals (void)
SbxVOID   removeVetoableChangeListener (SbxSTRING, SbxOBJECT)
SbxVOID   setArrayFormula (SbxSTRING)
SbxVOID   setArrayTokens (SbxARRAY)
SbxVOID   setColumnDescriptions (SbxARRAY)
SbxVOID   setData (SbxARRAY)
SbxVOID   setDataArray (SbxARRAY)
SbxVOID   setFormulaArray (SbxARRAY)
SbxVOID   setPropertyToDefault (SbxSTRING)
SbxVOID   setPropertyValue (SbxSTRING, SbxVARIANT)
SbxVOID   setPropertyValues (SbxARRAY, SbxARRAY)
SbxVOID   setRowDescriptions (SbxARRAY)
SbxVOID   setTableOperation (SbxOBJECT, SbxLONG, SbxOBJECT, SbxOBJECT)
SbxVOID   sort (SbxARRAY)

Zie ook