office-gobmx/sc
Caolán McNamara 3746195ff9 catch invalid ranges at export
log failure and continue to export the remainder of the document

 #0  0x0000733dda8ae4a1 in __cxa_throw () from target:/lib/x86_64-linux-gnu/libstdc++.so.6
 #1  0x0000733dc5d0bd43 in ScCellRangeObj::getCellRangeByPosition (this=0x2a753d60, nLeft=43, nTop=-7, nRight=43, nBottom=-7)
     at sc/source/ui/unoobj/cellsuno.cxx:4638
 #2  0x0000733dc66150d5 in ScTableSheetObj::getCellRangeByPosition (this=0x2a753d60, nLeft=43, nTop=-7, nRight=43, nBottom=-7)
     at sc/source/ui/unoobj/cellsuno.cxx:6711
 #3  0x0000733dc62d3e38 in ScXMLExport::GetMerged (this=0x1fc74160, pCellAddress=<optimized out>, xTable=...)
     at sc/source/filter/xml/xmlexprt.cxx:2750
 #4  0x0000733dc62d7104 in ScXMLExport::AddStyleFromCells (this=0x1fc74160, xProperties=..., xTable=..., nTable=0, pOldName=0x0)
     at sc/source/filter/xml/xmlexprt.cxx:2156
 #5  0x0000733dc62dfebb in ScXMLExport::collectAutoStyles (this=<optimized out>)
     at sc/source/filter/xml/xmlexprt.cxx:2559
 #6  0x0000733dc62d0fff in ScXMLExport::ExportAutoStyles_ (this=0x1fc74160)
     at sc/source/filter/xml/xmlexprt.cxx:2657
 #7  0x0000733dd833a7a4 in SvXMLExport::ImplExportAutoStyles (this=0x1fc74160)
     at xmloff/source/core/xmlexp.cxx:1123
 #8  0x0000733dd833d098 in SvXMLExport::exportDoc (this=0x1fc74160, eClass=<optimized out>)
     at xmloff/source/core/xmlexp.cxx:1389
 #9  0x0000733dd83386f6 in SvXMLExport::filter (this=this@entry=0x1fc74160, aDescriptor=...)
     at xmloff/source/core/xmlexp.cxx:815
 #10 0x0000733dc62e6452 in ScXMLExport::filter (this=0x1fc74160, aDescriptor=...)
     at sc/source/filter/xml/xmlexprt.cxx:5472
 #11 0x0000733dc63204a0 in ScXMLImportWrapper::ExportToComponent (this=0x7ffc11959890, xContext=..., xModel=..., xWriter=..., aDescriptor=..., sName=...,
     sMediaType=..., sComponentName=..., aArgs=..., pSharedData=...)
     at sc/source/filter/xml/xmlwrap.cxx:707
 #12 0x0000733dc632679a in ScXMLImportWrapper::Export (this=this@entry=0x7ffc11959890, bStylesOnly=bStylesOnly@entry=false)
     at sc/source/filter/xml/xmlwrap.cxx:943
 #13 0x0000733dc6465d5e in ScDocShell::SaveXML (this=0x11d1c440, pSaveMedium=0x138252f0, xStor=...)
     at sc/source/ui/docshell/docsh.cxx:653
 #14 0x0000733dc646a519 in ScDocShell::SaveAs (this=0x11d1c440, rMedium=...)
     at sc/source/ui/docshell/docsh.cxx:1913
 #15 0x0000733dd6ae7432 in SfxObjectShell::SaveAsOwnFormat (this=0x11d1c440, rMedium=...)
     at sfx2/source/doc/objstor.cxx:3378
 #16 0x0000733dd6af0ae6 in SfxObjectShell::SaveTo_Impl (this=0x11d1c440, rMedium=..., pSet=0x7ffc11959fe0)
     at sfx2/source/doc/objstor.cxx:1520
 #17 0x0000733dd6af2f08 in SfxObjectShell::DoSave_Impl (this=0x11d1c440, pArgs=0x7ffc11959fe0)
     at sfx2/source/doc/objstor.cxx:2760
 #18 0x0000733dd6b2b3aa in SfxBaseModel::storeSelf (this=0x5348c30, aSeqArgs=...) at /opt/rh/devtoolset-12/root/usr/include/c++/12/optional:306
 #19 0x0000733dd6ab2671 in SfxStoringHelper::GUIStoreModel (this=this@entry=0x2ba275b0, xModel=..., aSlotName=..., aArgsSequence=...,
     bPreselectPassword=bPreselectPassword@entry=false, nDocumentSignatureState=SignatureState::NOSIGNATURES, bIsAsync=false)

perhaps some relation to https://gerrit.libreoffice.org/c/core/+/160363
which is a somewhat similar situation

Change-Id: I6b28ef0e9df0f44641fa5c582b5827dbcfb4af8d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176765
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176792
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
2024-11-19 21:26:25 +01:00
..
inc improve loplugin passparamsbyref 2024-11-19 07:46:25 +01:00
qa improve loplugin passparamsbyref 2024-11-19 07:46:25 +01:00
res/xml
sdi
source catch invalid ranges at export 2024-11-19 21:26:25 +01:00
uiconfig/scalc tdf#136003 Change labels in the protect sheet dialog 2024-11-15 14:26:46 +01:00
util
workben
AllLangMoTarget_sc.mk
common_unoapi_tests.mk
CppunitTest_sc_a11y.mk
CppunitTest_sc_addin_functions_test.mk
CppunitTest_sc_anchor_test.mk
CppunitTest_sc_annotationobj.mk
CppunitTest_sc_annotationshapeobj.mk
CppunitTest_sc_annotationsobj.mk
CppunitTest_sc_arealinkobj.mk
CppunitTest_sc_arealinksobj.mk
CppunitTest_sc_array_functions_test.mk
CppunitTest_sc_autoformatobj.mk
CppunitTest_sc_autoformatsobj.mk
CppunitTest_sc_cache_test.mk
CppunitTest_sc_cellcursorobj.mk
CppunitTest_sc_cellfieldsobj.mk
CppunitTest_sc_cellformatsenumeration.mk
CppunitTest_sc_cellformatsobj.mk
CppunitTest_sc_cellobj.mk
CppunitTest_sc_cellrangeobj.mk
CppunitTest_sc_cellrangesobj.mk
CppunitTest_sc_cellsearchobj.mk
CppunitTest_sc_cellsenumeration.mk
CppunitTest_sc_cellsobj.mk
CppunitTest_sc_chart2dataprovider.mk
CppunitTest_sc_chartobj.mk
CppunitTest_sc_chartsobj.mk
CppunitTest_sc_check_data_pilot_field.mk
CppunitTest_sc_check_data_pilot_table.mk
CppunitTest_sc_check_xcell_ranges_query.mk
CppunitTest_sc_cond_format_merge.mk
CppunitTest_sc_consolidationdescriptorobj.mk
CppunitTest_sc_copypaste.mk
CppunitTest_sc_core.mk
CppunitTest_sc_database_functions_test.mk
CppunitTest_sc_databaserangeobj.mk
CppunitTest_sc_databaserangesobj.mk
CppunitTest_sc_datapilotfieldgroupitemobj.mk
CppunitTest_sc_datapilotfieldgroupobj.mk
CppunitTest_sc_datapilotfieldgroupsobj.mk
CppunitTest_sc_datapilotfieldobj.mk
CppunitTest_sc_datapilotfieldsobj.mk
CppunitTest_sc_datapilotitemobj.mk
CppunitTest_sc_datapilotitemsobj.mk
CppunitTest_sc_datapilottableobj.mk
CppunitTest_sc_datapilottablesobj.mk
CppunitTest_sc_dataprovider.mk
CppunitTest_sc_datetime_functions_test.mk
CppunitTest_sc_ddelinkobj.mk
CppunitTest_sc_ddelinksobj.mk
CppunitTest_sc_documentconfigurationobj.mk
CppunitTest_sc_drawpageobj.mk
CppunitTest_sc_drawpagesobj.mk
CppunitTest_sc_editfieldobj_cell.mk
CppunitTest_sc_editfieldobj_header.mk
CppunitTest_sc_filter_html.mk
CppunitTest_sc_filterdescriptorbase.mk
CppunitTest_sc_filters_test.mk
CppunitTest_sc_financial_functions_test.mk
CppunitTest_sc_functiondescriptionobj.mk
CppunitTest_sc_functionlistobj.mk
CppunitTest_sc_functions_test_old.mk
CppunitTest_sc_goal_seek_test.mk
CppunitTest_sc_headerfieldsobj.mk
CppunitTest_sc_headerfootercontentobj.mk
CppunitTest_sc_html_export_test.mk
CppunitTest_sc_importdescriptorbaseobj.mk
CppunitTest_sc_indexenumeration_cellannotationsenumeration.mk
CppunitTest_sc_indexenumeration_cellarealinksenumeration.mk
CppunitTest_sc_indexenumeration_databaserangesenumeration.mk
CppunitTest_sc_indexenumeration_datapilotfieldsenumeration.mk
CppunitTest_sc_indexenumeration_datapilotitemsenumeration.mk
CppunitTest_sc_indexenumeration_datapilottablesenumeration.mk
CppunitTest_sc_indexenumeration_ddelinksenumeration.mk
CppunitTest_sc_indexenumeration_functiondescriptionenumeration.mk
CppunitTest_sc_indexenumeration_labelrangesenumeration.mk
CppunitTest_sc_indexenumeration_namedrangesenumeration.mk
CppunitTest_sc_indexenumeration_scenariosenumeration.mk
CppunitTest_sc_indexenumeration_sheetcellrangesenumeration.mk
CppunitTest_sc_indexenumeration_sheetlinksenumeration.mk
CppunitTest_sc_indexenumeration_spreadsheetsenumeration.mk
CppunitTest_sc_indexenumeration_spreadsheetviewpanesenumeration.mk
CppunitTest_sc_indexenumeration_subtotalfieldsenumeration.mk
CppunitTest_sc_indexenumeration_tableautoformatenumeration.mk
CppunitTest_sc_indexenumeration_tablechartsenumeration.mk
CppunitTest_sc_indexenumeration_tablecolumnsenumeration.mk
CppunitTest_sc_indexenumeration_tableconditionalentryenumeration.mk
CppunitTest_sc_indexenumeration_tablerowsenumeration.mk
CppunitTest_sc_indexenumeration_textfieldenumeration.mk
CppunitTest_sc_information_functions_test.mk
CppunitTest_sc_jumbosheets_test.mk
CppunitTest_sc_labelrangeobj.mk
CppunitTest_sc_labelrangesobj.mk
CppunitTest_sc_logical_functions_test.mk
CppunitTest_sc_macros_test.mk
CppunitTest_sc_mark_test.mk
CppunitTest_sc_mathematical_functions_test.mk
CppunitTest_sc_modelobj.mk
CppunitTest_sc_namedrangeobj.mk
CppunitTest_sc_namedrangesobj.mk
CppunitTest_sc_new_cond_format_api.mk
CppunitTest_sc_opencl-1.mk
CppunitTest_sc_opencl-2.mk
CppunitTest_sc_outlineobj.mk
CppunitTest_sc_parallelism.mk
CppunitTest_sc_pdf_export.mk
CppunitTest_sc_perfobj.mk
CppunitTest_sc_pivottable_filters_test.mk
CppunitTest_sc_pivottable_formats_import_export_test.mk
CppunitTest_sc_recentfunctionsobj.mk
CppunitTest_sc_recordchanges.mk
CppunitTest_sc_scenariosobj.mk
CppunitTest_sc_screenshots.mk
CppunitTest_sc_scriptforge_test.mk
CppunitTest_sc_shapeobj.mk
CppunitTest_sc_shapetest.mk
CppunitTest_sc_sheetlinkobj.mk
CppunitTest_sc_sheetlinksobj.mk
CppunitTest_sc_solverobj.mk
CppunitTest_sc_sortdescriptorbaseobj.mk
CppunitTest_sc_sparkline_test.mk
CppunitTest_sc_spreadsheet_functions_test.mk
CppunitTest_sc_spreadsheetsettings.mk
CppunitTest_sc_spreadsheetsettingsobj.mk
CppunitTest_sc_statistical_functions_test.mk
CppunitTest_sc_stylefamiliesobj.mk
CppunitTest_sc_stylefamilyobj.mk
CppunitTest_sc_styleobj.mk
CppunitTest_sc_subsequent_export_test.mk
CppunitTest_sc_subsequent_export_test2.mk
CppunitTest_sc_subsequent_export_test3.mk
CppunitTest_sc_subsequent_export_test4.mk
CppunitTest_sc_subsequent_filters_test.mk
CppunitTest_sc_subsequent_filters_test2.mk
CppunitTest_sc_subsequent_filters_test3.mk
CppunitTest_sc_subsequent_filters_test4.mk
CppunitTest_sc_subsequent_filters_test5.mk
CppunitTest_sc_subtotaldescriptorbase.mk
CppunitTest_sc_subtotalfieldobj.mk
CppunitTest_sc_tablecolumnobj.mk
CppunitTest_sc_tablecolumnsobj.mk
CppunitTest_sc_tableconditionalentryobj.mk
CppunitTest_sc_tableconditionalformat.mk
CppunitTest_sc_tablerowobj.mk
CppunitTest_sc_tablerowsobj.mk
CppunitTest_sc_tablesheetobj.mk
CppunitTest_sc_tablesheetsobj.mk
CppunitTest_sc_tablevalidationobj.mk
CppunitTest_sc_tabviewobj.mk
CppunitTest_sc_text_functions_test.mk
CppunitTest_sc_theme_import_export_test.mk
CppunitTest_sc_tiledrendering.mk
CppunitTest_sc_tiledrendering2.mk
CppunitTest_sc_ucalc.mk
CppunitTest_sc_ucalc_condformat.mk
CppunitTest_sc_ucalc_copypaste.mk
CppunitTest_sc_ucalc_datatransformation.mk
CppunitTest_sc_ucalc_document_themes.mk
CppunitTest_sc_ucalc_formula.mk
CppunitTest_sc_ucalc_formula2.mk
CppunitTest_sc_ucalc_nanpayload.mk
CppunitTest_sc_ucalc_parallelism.mk
CppunitTest_sc_ucalc_pivottable.mk
CppunitTest_sc_ucalc_range.mk
CppunitTest_sc_ucalc_rangelst.mk
CppunitTest_sc_ucalc_sharedformula.mk
CppunitTest_sc_ucalc_solver.mk
CppunitTest_sc_ucalc_sort.mk
CppunitTest_sc_ucalc_sparkline.mk
CppunitTest_sc_uicalc.mk
CppunitTest_sc_uicalc2.mk
CppunitTest_sc_uniquecellformatsenumeration.mk
CppunitTest_sc_uniquecellformatsobj.mk
CppunitTest_sc_vba_macro_test.mk
CppunitTest_sc_viewpaneobj.mk
functions_setup.mk
IwyuFilter_sc.yaml
JunitTest_sc_complex.mk
JunitTest_sc_unoapi_1.mk
JunitTest_sc_unoapi_2.mk
JunitTest_sc_unoapi_3.mk
JunitTest_sc_unoapi_4.mk
JunitTest_sc_unoapi_6.mk
JunitTest_sc_unoapi_7.mk
Library_sc.mk
Library_scd.mk
Library_scfilt.mk
Library_scqahelper.mk
Library_scui.mk
Library_vbaobj.mk
Makefile
Module_sc.mk
Package_opencl.mk
Package_res_xml.mk
PythonTest_sc_python.mk
README.md
subsequent_setup.mk
ucalc_setup.mk
UIConfig_scalc.mk
UITest_autofilter.mk
UITest_autofilter2.mk
UITest_calc_dialogs.mk
UITest_calc_tests.mk
UITest_calc_tests2.mk
UITest_calc_tests3.mk
UITest_calc_tests4.mk
UITest_calc_tests6.mk
UITest_calc_tests7.mk
UITest_calc_tests8.mk
UITest_calc_tests9.mk
UITest_chart.mk
UITest_chart2.mk
UITest_conditional_format.mk
UITest_csv_dialog.mk
UITest_external_links.mk
UITest_function_wizard.mk
UITest_goalSeek.mk
UITest_inputLine.mk
UITest_key_f4.mk
UITest_manual_tests.mk
UITest_pageFormat.mk
UITest_pasteSpecial.mk
UITest_protect.mk
UITest_range_name.mk
UITest_sc_options.mk
UITest_search_replace.mk
UITest_signatureLine.mk
UITest_solver.mk
UITest_sort.mk
UITest_statistics.mk
UITest_textCase.mk
UITest_textToColumns.mk
UITest_validity.mk

Spreadsheet Application Code

You can dump some information in a dbgutil build:

Shortcuts

CTRL+SHIFT+F12

Dumps the column width of the first 20 columns.

CTRL+SHIFT+F11

Dumps the graphic objects and their position and size in pixel.

CTRL+SHIFT+F6

Dumps the SfxItemSet representing the cell properties' of the current selection as a xml file. The file will be named dump.xml

The Cache Format

ScDocument::StoreTabToCache allows storing the content (not the formatting) of a table to a binary cache format.

The format is column orientated which allows quick serialization of the table.

  • Header:

    • Number of Columns: 64 bit unsigned integer
  • Column:

    • Column Index: 64 bit unsigned integer
    • Column Size: 64 bit unsigned integer
    • For each cell type block a new ColumnBlock
  • ColumnBlock:

    • Start Row: 64 bit unsigned integer
    • Block Size: 64 bit unsigned integer
    • Type: 8 bit unsigned integer
      • 0 : empty
      • 1 : numeric
        • for each cell: 64 bit IEEE 754 double precision value
      • 2 : string
        • for each cell: 32 bit signed string length followed by string length bytes of the string (UTF-8)
      • 3 : formula
        • for each cell: 32 bit signed string length followed by the formula in R1C1 notation as a string

Functions Supporting Wildcards or Regular Expressions

As this comes up every now and then, and rather should be documented in an extra list of the Help system, functions that support Wildcards or Regular Expressions and depend on the setting under Tools -> Options -> Calc -> Calculate are those that in ODF OpenFormula (ODFF) are defined to depend on the HOST-USE-REGULAR-EXPRESSIONS or HOST-USE-WILDCARDS properties, see ODF v1.3 part4 3.4 Host-Defined Behaviors https://docs.oasis-open.org/office/OpenDocument/v1.3/os/part4-formula/OpenDocument-v1.3-os-part4-formula.html#__RefHeading__1017868_715980110

  • Database Functions
    • DAVERAGE
    • DCOUNT
    • DCOUNTA
    • DGET
    • DMAX
    • DMIN
    • DPRODUCT
    • DSTDEV
    • DSTDEVP
    • DSUM
    • DVAR
    • DVARP
  • Information Functions
    • COUNTIF
    • COUNTIFS
  • Lambda Functions
    • LET
  • Lookup Functions
    • HLOOKUP
    • LOOKUP
    • MATCH
    • XMATCH
    • VLOOKUP
    • XLOOKUP
    • FILTER
    • SORT
    • SORTBY
    • UNIQUE
  • Mathematical Functions
    • RANDARRAY
    • SEQUENCE
    • SUMIF
    • SUMIFS
  • Statistical Functions
    • AVERAGEIF
    • AVERAGEIFS
  • Text Functions
    • SEARCH