summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
6 dayscrashtesting: assert seen on importing forum-mso-en4-62805.xlsxCaolán McNamara11-357/+364
Change-Id: I1d1ab4539775c8c2fce591ca32fc15c3c0dd6060 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166024 Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-03-31crashtesting: crash seen with multiple threads calling GetTheCurrencyTableCaolán McNamara1-0/+1
seen with soffice --convert-to xlsx forum-mso-en4-207468.xls Change-Id: I89d16938b3f8780776f38b0e94ce3885d93ac252 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165585 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-03-14tdf#48140: Remove unused headers from xlsx importseturaj1-2/+0
Change-Id: I14fad4ccd06fe9c3340646efcf80e9209cbb1dc8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163962 Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de> Tested-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
2024-03-13tdf#123026: also use global config "RecalcOptimalRowHeightMode" for xlsxJustin Luth5-73/+63
24.8 commit 2d2974f22ab59ea7dab1aee778308c4f50ff5464 for tdf#124098 added a setting that prompts before recalculating optimal row height on file open. I can't think of any reason why that shouldn't apply to all formats. It defaults to "always - without asking". XLSX started optimal row height on file open for tdf#123026 with 24.2 commit d15c4caabaa21e0efe3a08ffbe145390e802bab9. So this patch just moves the code to a more accessible location, and then uses it for the XLSX case too. Change-Id: Ia0c672c3aec788857dea09ac88e4395dcf6c2242 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164721 Tested-by: Jenkins Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de> Reviewed-by: Justin Luth <jluth@mail.com>
2024-03-12tdf#156814 Remove sheet name if range belongs to the same sheet (Solver)Rafael Lima3-12/+87
When solver models are imported from XLSX, ranges come with sheet names even when they belong to the same sheet, which clutter the solver dialog. This patch checks when this happens and remove sheet names when the solver model is imported. Change-Id: I3994f1312667946aab330c734ff820e94673d018 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164610 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2024-03-05bin: Add initial script to replace missing fontsXisco Fauli1-0/+68
It already contains some replacements I found along the way For now it works with docx, xlsx and pptx files. I have to test it with odf formats. Change-Id: Ia68bc7561f0e41580ad1834a1a345b618f3e688c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164393 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-02-23crashtesting: isNaN as fUnitCircleWidthAngleDegreeCaolán McNamara1-0/+6
presumably since recent tdf#50934 work affect files are: forums/xlsx/forum-mso-en4-295952.xlsx forums/xlsx/forum-mso-en4-523214.xlsx forums/xlsx/forum-mso-en4-656086.xlsx forums/xlsx/forum-mso-en4-702681.xlsx Change-Id: Ifc436d382f9cda13d2ae4459d436a72c5e40d8aa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163784 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-02-10sc: pivot table not correct when data and PT cache is not in syncTomaž Vajngerl5-3/+78
It can happen that the pivot table is not updated and the sheet data is changed so much that it doesn't match the pivot table cached definitions. This is a perfectly valid scenario and nothing should be wrong (the pivot table can just be updated once loaded). At XLSX import we should always check the cached definitions, because the pivot table description is made using the cached data, not the actual data. The issue can occur when looking up the name of a PT field we however didn't check the cached definition but checked the sheet data, so because the indices changed so much (many columns were removed in the sheet data) we can not find the actual field name. The solution is simple - get the field name from the cached pivot table definition. Change-Id: I3b5b33f33f3c484f0b66b97ac97200d9913edcfe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163197 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2024-02-07tdf#159581 sc: fix multi-sheet ScDocRowHeightUpdaterJustin Luth3-1/+12
Apparently it was caching the first sheet's row height, and applying it to every other sheet. AFAICS, the only time this ever ran against multiple sheets was during import time, so that is why it wasn't easily noticed before 24.2 when XLSX started using it on import. make CppunitTest_sc_subsequent_filters_test2 \ CPPUNIT_TEST_NAME=testTdf159581_optimalRowHeight Change-Id: Ic4e4dd335fa48d02acbc85cfad35feb8eca7597b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163066 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2024-01-25crashtesting: crash seen on import of forum-mso-en4-278652.xlsxCaolán McNamara1-1/+2
probably an issue since: commit 135ce256ce9e879663d828ec6e699de521fad867 Date: Mon Aug 14 15:59:18 2023 +0200 tdf#146487 Don't show generic diagram title when there is an empty title given Change-Id: I12d8d6e78a8435b998084221402b6bdfc4a1a433 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162526 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-01-07LOK: disallow entering multiple hyperlinks in spreadsheet cellsAndras Timar1-4/+7
This is for UX consistency. Previously it was allowed to enter multiple hyperlinks in spreadsheet cells when the spreadsheet was in OpenDocument format. Only in case of XLS/XLSX it was not possible. But we got a feedback that it is desirable to have a similar user experience for all spreadsheet file formats in Online. In LibreOffice nothing changes, it works according to the setting in Options - LibreOffice Calc - Compatibility - Hyperlinks. Change-Id: I7eece4307289711e9c925c05085497afaafe600e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161667 Reviewed-by: Attila Szűcs <attila.szucs@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161729 Tested-by: Jenkins Reviewed-by: Andras Timar <andras.timar@collabora.com>
2023-12-06tdf#126084 import svg image from ooxml document that use svgBlip elem.Tomaž Vajngerl8-70/+100
In an OOXML document the svg image is defined in an svgBlip, which is an OOXML extension. This change checks for the svgBlip element and imports that instead the normal "blip" element that is still provided as a fallback (PNG image). Add roundtrip SVG image test for ODF and OOXML, Impress and Writer. testGraphicBlipXLSX test failed after this change, because some component was missing. Changed to enable use_rdb for all chart2 export tests, so issues like this won't happen anymore. Change-Id: Idf0e754775254d7dcfd0321dfca2ed6d00c42c09 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157238 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-10-29crashtesting: dependency tracking doesn't parse ocRangeCaolán McNamara1-0/+9
so only the args passed to ocRange are seen, not what range is created from those args, so the dependency detected is just the args and not the result seen with forum-mso-en4-457928.xlsx =SUMPRODUCT(--(LEFT(TRIM(Summary.Sections.Type),2)=F24)*Summary.Sections.QCount) Summary.Sections.Type is Summary.SectionType.Start:INDEX(Summary,,COLUMN(Summary.SectionType.EndCol)) Summary.SectionType.Start is $Summary.$BD$7 Summary.SectionType.EndCol is $Summary.$BG$7 So $BD$7 and $BG$7 are detected as dependencies, but we are really dependent on the $BD$7:$BG$7 range, so $BE$7:$BF$7 is not seen Change-Id: Ia06fe4cb0845994d0221f020cf26ba20866624ef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158625 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-10-10lok: fix getting SID_DOC_READONLY slot propertyHenry Castro1-10/+1
Unfortunately, the property is not always set when import XLSX documents. Signed-off-by: Henry Castro <hcastro@collabora.com> Change-Id: If501734704174b92b3589b61a019ba973592c331 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157259 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157736 Tested-by: Jenkins
2023-10-09tdf#100034 tdf#157318 XLSX export: fix lost named ranges associated to sheetsRafael Lima8-7/+56
The original fix for tdf#100034 (see commit [1]) consisted of explicitly not exporting to XLSX named ranges that are not built-in. This has a side-effect that user-defined named ranges associated with sheets are also not exported to XLSX. Hence, if the user creates a named range linked to a sheet and saves the file to XLSX, the named range is not exported (which is the issue reported in tdf#157318). This patch implements a new fix for tdf#100034, reverting the previous fix. When the Print Ranges are cleared by the user, the associated named ranges are also cleared, thus fixing the original problem. This new fix has the advantage that user-defined named ranges linked to sheets are again exported to XLSX files. Regression from commit 639519dc2bad058197b6ff73c9e3df622f979f97 "tdf#100034: Fix to persistently remove print-range". References: [1] 639519dc2bad058197b6ff73c9e3df622f979f97 Change-Id: Ic3b84365a6086e96f60b222cd6337991ac90f483 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157455 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2023-10-08make testCondFormatFormulaListenerXLSX reliableCaolán McNamara5-52/+92
Change-Id: Ibd8c9b7831af73967229c578b9dcf7217d800610 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157686 Tested-by: Jenkins Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-10-05crashtesting: crash seen on exit of chartCaolán McNamara3-2/+11
with soffice --headless --convert-to ods forum-mso-en4-569016.xlsx and other similar Change-Id: I908fa834c1072a9854055cad1ee6261800d76aea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157573 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-09-07lok: save to xlsx changes column sizeSzymon Kłos4-7/+10
When xlsx spreadsheet was opened in LOK on every save default column width was decreased. This doesn't happen in non-LOK case. Column width in Excel are defined by double value which specifies number of '0' characters which fit into the column. On export we use mnCharWidth from XclRootData to convert Calc twips size to number of characters. In LOK case it was 102 while in non-lok case 101. It was caused by different Reference Device used in ScDocument::GetRefDevice() because in LOK case we are in WYSWIG mode as introduced in ScModelObj::initializeForTiledRendering in commit c25062f: sc tiled rendering: Don't adjust the text width according to printer. Let's use for export purpose the GetVirtualDevice_100th_mm() Change-Id: I6709194d7924e8c7e0aaa75ff3901afbcc1f8c11 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156576 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> (cherry picked from commit 29f72210e92e0152d52b3a1d0253fbb5d8e2dead) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156604 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
2023-08-30tdf#156835 - FILEOPEN XLSX: add SHA-384 encryption support for ooxml importBalazs Varga8-1/+110
Password protected file with SHA-384 encryption does not open before this patch. Change-Id: I482233f788b8e9da210ad6d2a6c4ece18d05d248 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156282 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
2023-08-28Shared string shouldn't account preserve space propertyParis Oplopoios2-3/+2
XLSX documents opened in Excel don't seem to account for the xml:space="preserve" value for whether the string is single line or not The test that was changed seems to have more accurate behavior now, where the second cell does not have multiple lines (like in Excel) Change-Id: Iad8f351c19102249e2cb1e1d063c8690dfb3d753 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156206 Tested-by: Jenkins Reviewed-by: Paris Oplopoios <parisoplop@gmail.com>
2023-08-19crashtesting: parallel calc assert with LookupCaolán McNamara1-0/+52
seen in forum-mso-en4-55192.xlsx with a singlecell as the result vector which gets autoextended outside the range that the pre-parallel calc took into consideration on set up. For simplicity if there is a result vector assume that if it doesn't match the size of the search vector that we can't parallelize this. Change-Id: Ic67e1b5b35964760ac5b1608cd516a69e08d0540 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155862 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-08-14tdf#156677 if CheckComputeDependencies failed in expanded range...Caolán McNamara8-19/+54
it may have left a cell the original range needed in a dirty state, leading to an assert when the threaded calculation is attempted which would not have happened if the attempt to expand the range wasn't attempted. seen in crashtesting example: forum-mso-en4-784502.xlsx to reproduce this, load sample document after it has loaded: (gdb) break column4.cxx:1946 (gdb) break column4.cxx:1966 data, recalculate, recalculate hard, the first time breakpoint #1 gets hit: at column4.cxx:1946 NeedsInterpret is true, so cell {nRow = 1, nCol = 0, nTab = 3 } was dirty and is set not-dirty by Interpret. mxGroup->mbPartOfCycle is false so this returns successfully to allow threading. the bt to there was: #0 lcl_EvalDirty(mdds::mtv::soa::multi_type_vector<sc::CellStoreTraits>&, int, int, ScDocument&, boost::intrusive_ptr<ScFormulaCellGroup> const&, bool, bool, bool&, bool&) (rCells=..., nRow1=1, nRow2=4, rDoc=..., mxGroup=..., bThreadingDepEval=true, bSkipRunning=false, bIsDirty=@0x7fffffff4a16: true, bAllowThreading=@0x7fffffff4a17: true) at sc/source/core/data/column4.cxx:1963 #1 0x00007fff9eef70d1 in ScColumn::HandleRefArrayForParallelism(int, int, boost::intrusive_ptr<ScFormulaCellGroup> const&) (this=0x15ee480, nRow1=1, nRow2=4, mxGroup=...) at sc/source/core/data/column4.cxx:2012 #2 0x00007fff9f44448a in ScTable::HandleRefArrayForParallelism(short, int, int, boost::intrusive_ptr<ScFormulaCellGroup> const&) (this=0x1eebda0, nCol=0, nRow1=1, nRow2=4, mxGroup=...) at sc/source/core/data/table1.cxx:2567 #3 0x00007fff9f06b691 in ScDocument::HandleRefArrayForParallelism(ScAddress const&, int, boost::intrusive_ptr<ScFormulaCellGroup> const&) (this=0x1ba9a40, rPos=..., nLength=4, mxGroup=...) at sc/source/core/data/document.cxx:1792 #4 0x00007fff9f3018f7 in (anonymous namespace)::ScDependantsCalculator::DoIt() (this=0x7fffffff4eb8) at sc/source/core/data/formulacell.cxx:4585 #5 0x00007fff9f30085a in ScFormulaCell::CheckComputeDependencies(sc::FormulaLogger::GroupScope&, bool, int, int, bool) (this=0x2142cf0, rScope=..., fromFirstRow=false, nStartOffset=0, nEndOffset=3, bCalcDependencyOnly=false) at sc/source/core/data/formulacell.cxx:4720 #6 0x00007fff9f2ff392 in ScFormulaCell::InterpretFormulaGroupThreading(sc::FormulaLogger::GroupScope&, bool&, bool&, int, int) (this=0x2142cf0, aScope=..., bDependencyComputed=@0x7fffffff56d7: false, bDependencyCheckFailed=@0x7fffffff56d6: false, nStartOffset=0, nEndOffset=3) at sc/source/core/data/formulacell.cxx:4829 so the CheckComputeDependencies at the start of ScFormulaCell::InterpretFormulaGroupThreading is successful for aPos of {nRow = 1, nCol = 1, nTab = 3 } and the cell is not dirty at that point *however* in the following loop of for (SCCOL nCurrCol = nColStart; nCurrCol <= nColEnd; ++nCurrCol) in InterpretFormulaGroupThreading, CheckComputeDependencies for column 3 is called and the breakpoint #2 is hit, in this case mxGroup->mbPartOfCycle is true and the {nRow = 1, nCol = 0, nTab = 3 } cell is set dirty again. so later during the threaded calculation the cell is found dirty and the ScFormulaCell::MaybeInterpret() asserts that !rDocument.IsThreadedGroupCalcInProgress() Change-Id: I40385f5e8240680c220249dd2966b196efaf5e0f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155463 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-08-13defer turning xlsx notes into SdrCaptions until activatedCaolán McNamara7-76/+126
to improve import performance Change-Id: I8dd3483372d20cbbb8694bae02a7d8b062324ff0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155613 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-08-11xlsx with a lot of comments repeatedly calls OutputDevice::HasGlyphsCaolán McNamara3-38/+115
on the same font over and over again getting the same results Change-Id: I0c301e3fd4c1838645c25d4f6f7b330acc988135 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155569 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-07-28crashtesting: std::bad_alloc on load of forum-mso-en4-123509.xlsxCaolán McNamara1-1/+10
this appeared in crashtesting with: commit d15c4caabaa21e0efe3a08ffbe145390e802bab9 Date: Tue Sep 20 08:14:41 2022 -0400 tdf#123026 xlsx import: recalc optimal row height on import rut existed as a caught exception during load before that. Change-Id: I90405a7acb84c95bac350808b20482e5069e2fcf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154990 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-07-25tdf#142905 XLSX import: don't trim leading spaces in formula cellCzeber László Ádám3-1/+15
When importing an XLSX file, there was a discrepancy between the read and recalculated cell values if it contains leading/ending spaces. With this fix, trimming in worksheet files is only applied to elements that contain a parameter and do not have a space="preserved" parameter. Change-Id: I91e09eaa3cb79537ddbed36e1124e4afd124d8f0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154674 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2023-07-25crashtesting: a lot of crashes on exporting to odsCaolán McNamara1-4/+9
since: commit 1d2380516ac9871743c5a5455f0734d02be8eade Date: Thu Apr 20 20:33:56 2023 +0530 tdf#129847 Show "more content" red arrow along with ### indication e.g. soffice --headless --convert-to ods forums/xlsx/forum-mso-en4-566515.xlsx #3 0x00007ffff7b61662 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6 #4 0x00007fffe1f6cd02 in RowInfo::cellInfo (nCol=187, this=<optimized out>) at sc/inc/fillinfo.hxx:201 #5 ScOutputData::LayoutStrings (this=this@entry=0x7fffffffb0d0, bPixelToLogic=bPixelToLogic@entry=false) at sc/source/ui/view/output2.cxx:1908 #6 0x00007fffe1f6df21 in ScOutputData::DrawStrings (this=this@entry=0x7fffffffb0d0, bPixelToLogic=bPixelToLogic@entry=false) at sc/source/ui/view/output2.cxx:1478 #7 0x00007fffe1f9d52e in ScPrintFunc::DrawToDev (rDoc=..., pDev=pDev@entry=0x5555567d9890, rBound=..., pViewData=pViewData@entry=0x7fffffffb270, bMetaFile=bMetaFile@entry=true) at sc/source/ui/view/printfun.cxx:619 #8 0x00007fffe1a49150 in ScDocShell::Draw (this=0x55555652c630, pDev=0x5555567d9890, nAspect=<optimized out>) at sc/source/ui/docshell/docsh4.cxx:2205 #9 0x00007ffff5c66771 in SfxObjectShell::DoDraw_Impl (this=this@entry=0x55555652c630, pDev=pDev@entry=0x5555567d9890, rViewPos=Point = {...}, rScaleX=..., rScaleY=..., rSetup=..., nAspect=2, bOutputForScreen=false) at sfx2/source/doc/objembed.cxx:204 #10 0x00007ffff5c66976 in SfxObjectShell::DoDraw (this=this@entry=0x55555652c630, pDev=pDev@entry=0x5555567d9890, rObjPos=Point = {...}, rSize=Size = {...}, rSetup=..., nAspect=nAspect@entry=2, bOutputForScreen=false) at sfx2/source/doc/objembed.cxx:151 #11 0x00007ffff5c6207d in SfxObjectShell::CreatePreview_Impl (this=this@entry=0x55555652c630, bFullContent=bFullContent@entry=false, pDevice=0x5555567d9890, pFile=pFile@entry=0x0) at sfx2/source/doc/objcont.cxx:197 #12 0x00007ffff5c6412c in SfxObjectShell::GetPreviewBitmap (this=this@entry=0x55555652c630) at include/rtl/ref.hxx:206 #13 0x00007ffff5c9c5a4 in SfxObjectShell::WriteThumbnail (this=this@entry=0x55555652c630, bEncrypted=bEncrypted@entry=false, xStream= uno::Reference to (OWriteStream *) 0x555557e84818) at sfx2/source/doc/objstor.cxx:3748 use the same guard around accessing cellInfo as used elsewhere in this method Change-Id: If1fd5cff92655f8b51436f27a9b3d22fdc7a390b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154879 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-07-11tdf#123026 xlsx import: recalc optimal row height on importJustin Luth6-13/+21
This patch depends on the previous patch for this bug report, which allows each sheet to hold its own default row height. The given height for the row might not be enough to fit the content. If the row is set to use optimal height, that will be corrected as soon as the row is edited. Obviously, it should not require an edit to be correct on FILEOPEN, so this patch recalculates after loading the document. This might have a very negative effect on the time needed to open a file. I couldn't duplicate the XLS method because Library_scfilt.mk doesn't link to ScSizeDeviceProvider. The existing UpdateAllRowHeights wasn't designed to allow any performance improvements, so I made a new one. The new one is based on the newer ScDocRowHeightUpdater class - so perhaps the older method can be phased out. This new UpdateAllRowHeights could replace the XLS bSetRowHeights clause - with hopefully some performance benefit. I'm not sure I'm ready for the regression hate that would come from the inevitable performance implications. Testing however doesn't suggest a huge slowdown. I tested with time make sc.check before the fix I was getting 16m 4s +- 10s after the fix I was getting 16m 25s +- 10s Specific test showing the need for these patches: make CppunitTest_sc_subsequent_filters_test2 \ CPPUNIT_TEST_NAME=testTdf123026_optimalRowHeight Impacted unit tests (without the previous patch) are documented in earlier patchsets. make CppunitTest_sc_subsequent_export_test \ CPPUNIT_TEST_NAME=testMiscRowHeightExport make CppunitTest_sc_subsequent_export_test2 make CppunitTest_sc_jumbosheets_test CPPUNIT_TEST_NAME=testTdf134553 Change-Id: I6d020c1a5137dd4f05e20e82b1764a102b7f56d0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140260 Reviewed-by: Justin Luth <jluth@mail.com> Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-06-27tdf#123026 sc xlsx: provide per-sheet optimal row height settingJustin Luth14-30/+90
This patch is a pre-requisite for a follow-up patch which will run SetOptimalRowHeight on all un-sized rows on FILEOPEN. XLSX sheets can provide a default height for all rows on that sheet. That imported/round-tripped well. However, if Calc optimizes these rows, the undefined rows likely will change height - since the default XLSX row height tends to be 300 twips, while Calc uses 256 (in ScGlobal::nStdRowHeight). This patch allows a sheet to define its optimal row height, so that running .uno:SetOptimalRowHeight doesn't change any row heights, and doesn't cause all kinds of new row definitions. make CppunitTest_sc_subsequent_filters_test2 \ CPPUNIT_TEST_NAME=testTdf123026_optimalRowHeight Change-Id: I35008107d71f66375c7e9469e559f3836cf14df5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152909 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com> Reviewed-by: Dennis Francis <dennis.francis@collabora.com>
2023-06-25crashtesting: crash seen on exporting fdo66241-1.ods to xlsxCaolán McNamara2-1/+29
Change-Id: I730bd782ddf67555c40651aed1442465574a1c01 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153560 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-06-22sc: filter: oox: fix preserve space, single line caseHenry Castro3-3/+20
The unit test testPreserveTextWhitespace2XLSX fails when a single line is enabled Test name: ScExportTest::testPreserveTextWhitespace2XLSX equality assertion failed - Expected: 1 - Actual : 0 - In <>, XPath '/x:sst/x:si[2]/x:r[1]/x:t' number of nodes is incorrect In order to fix, the single line cell should not be enabled and import the attribute: <t xml:space="preserve">abc</t> Signed-off-by: Henry Castro <hcastro@collabora.com> Change-Id: I380ba8726c03abc40bdc745ea74eceb80fec6e54 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151599 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> (cherry picked from commit 2dd86aa3f365057494bf41f4da7f2f410ea3bf2e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151615 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153459 Tested-by: Jenkins
2023-05-30tdf#152037 XLSX import: fix false alarm data validation errorCzeber László Ádám1-0/+2
Fix validation error on valid input by adding missing SimplifyCompiledFormula() to the implementation of setFormula1() and setFormula2() of XSheetCondition UNO API, which used by the XLSX input filter. Change-Id: I8389227eb5a609c29e8d466cf62420bae36f7927 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152295 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2023-05-09tdf#152980 CSV import: Fix control character length in XLSX saveCzeber László Ádám3-111/+37
Converting from CSV to XLSX corrupts text that looks like a control character. Only 4 numeric length escape character allowed, in _x000D_ format, not _x0D_ for exampled. Change lcl_unEscapeUnicodeChars function to decodeXString. Delete not used functions and add multiple occurence for unit test. Change-Id: Id1d4bfcf7d27cf5005e7bea8e289303c5d9aca73 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151494 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2023-04-25tdf#91332 XLSX export: fix missing solidFillTünde Tóth3-1/+21
Background color of shape inherited from theme lost after export. Regression from commit bc0a9076aa43a0782bcf81e55d3f84f6af0f68e8 "ooxml: Preserve shape theme attribute for solid fill". Change-Id: I2d8298ac17332ba3ad6a627ce8b07c23087ac7b1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150674 Tested-by: Jenkins Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2023-04-25tdf#119565 XLSX export: fix lost line properties inherited from themeTünde Tóth3-2/+31
Line properties (LineWidth and LineJoint) of shape inherited from theme lost after export. Perhaps regression from commit 5391d4872e71d1edba7acc4ad2d2e3b5b97e1723 "ooxml: Preserve shape style and theme attributes for line". Change-Id: I9977bb20f16245f3c95ccbe2c5c8033b5b0c9cc4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150547 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2023-04-18sc drawstyles: Don't consider the default cell style formattingMaxim Monastirsky1-21/+11
We no longer use the text formatting of the default cell style for new comments, nor we follow that style changes, so there is no reason to do that on import. And this formatting will be overwritten anyway in most cases with the imported formatting. (There is currently a bug in xlsx import that makes the author name appear with the default font in visible comments, and that case will look differently after this commit. However, the truth is that *both* old and new looks are wrong. The correct font can be seen in the temp popup when hovering the comment marker, or after copying & pasting the cell with the comment to somewhere else. But even if this wasn't a bug, it was *our* decision to use the cell style font, not something imported or done by Excel, so I believe we're free to change something like this.) Change-Id: I92b95d7dfcfb747144eb710c76ec5f755f70400f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150490 Tested-by: Jenkins Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
2023-04-18sc drawstyles: Assign the Note style to imported commentsMaxim Monastirsky4-7/+21
... that don't have a style assignment. Typically in ods files created by older versions or by 3rd party. - For hidden comments this should make no difference, as we used to apply the default comment formatting as DF underneath their defined DF, just now we do that as a style assignment instead. - Same for comments from xlsx and xls files. - For visible comments from ods files created by OOo/LO, there should be no difference either, as such files typically include the shape formatting in them. - For visible comments from ods files created by Excel, there will be a difference, as Excel used to not include the full shape formatting (known to be the case with Excel 2007 and 2016; can't test any other version). This resulted with a weird look, e.g. a line instead of an arrow, a default blue fill color and too distant shadow, which clearly not how comments supposed to look. Moreover, the comment will turn to transparent after hiding or copying the cell, and will revert to the default look anyway with resaving. Given that we were already enforcing the default formatting for hidden comments and for foreign formats, I think it's reasonable to do that for visible comments too (and in general it's unclear to me why the ODF import treats visible comments differently than hidden ones). The main motivation of this change is to aid solving the shadow issue - see the next commits. Regarding the comment height change in the testCommentSize test: This does *not* mean there is a change in that comment's import. What this test does is to replace the existing comment with a new comment, and that use the default formatting instead of inheriting the formatting of the old one. But while the current default formatting is whatever defined in the Note style, the old default formatting was actually the draw pool defaults. This is because we used to apply the comment formatting as DF, and the relevant svx code (in SdrTextObj::NbcSetText) wasn't aware of the fact that part of the DF was considered as default in this case. Which means that this test was actually asserting a buggy behavior. Change-Id: I37723cce3c719ecaa9c57bef25bcb168e353c55c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150489 Tested-by: Jenkins Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
2023-04-18sc drawstyles: Fix xlsx export for text attributes in commentsMaxim Monastirsky2-1/+16
Change-Id: Ic5b6099460bd5e978c04aff3233537059ce711b9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150379 Tested-by: Jenkins Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
2023-03-25tdf#38948 Save solver settings to fileRafael Lima13-124/+1063
This patch implements the mechanism to save solver settings in LO Calc as well as export/import them from XLSX files. In MS Excel solver settings are saved as hidden named ranges, so in this patch I used the same strategy to save solver settings in Calc, i.e. by creating named ranges to store the solver settings using the same terminology used in Excel. With this we gain the ability to save solver settings by tab, as well as export/import since we already have "named ranges/expressions" import/export implemented in LO. Change-Id: Id41bca261dc3cd8e6888643f0ed6a97b26097876 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148112 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-03-08UnoApiXmlTest: remove workaround to handle chart file names in testsXisco Fauli9-195/+148
No longer needed after 269585d6b461b565fe75f77b6dbf219749edc5ab "oox, sd: fix ever-increasing chart IDs when exporting to PPTX" and b27b250f70f4651d387ef0646a9668950371e779 "sc: fix ever-increasing chart IDs when exporting to XLSX" Also restored the documents modified in d913584909c2e0a235546a5f800baf45c3446d8b "UnoApiXmlTest: merge parseExport from ChartTest" to ensure only one chart was possible per document. Sample documents in unittests can have more than one chart now, since the chart file name wouldn't change Kudos to Miklos Vajna for fixing the chart file names when exporting them Change-Id: I10e2c44e41953a2d0d08bbb2a813134861e74660 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148461 Tested-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-03-08sc: fix ever-increasing chart IDs when exporting to XLSXMiklos Vajna2-2/+2
Similar to what PPTX already did. Change-Id: I17d8ccf3fb7111e1cbf9dc019d1032ed7ed530fd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148460 Tested-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-03-08oox, sd: fix ever-increasing chart IDs when exporting to PPTXMiklos Vajna4-2/+5
Bring the static counter under the control of DrawingML::ResetMlCounters(), so the first chart is always chart1.xml, even if the same process already exported a chart previously. XLSX is a separate codepath, this fix doesn't help with that yet. Change-Id: Idf6e576ba94e254ae9782ef86e85542efd80127f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148457 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-02-27CppunitTest_chart2_import: re-enable test and adapt itXisco Fauli1-7/+4
Since f281d2d24c2a368c58d32b1b50acf83e0f056d90 "Actually we shouldn't always set Overlap flag on for all xlsx charts..." Change-Id: I3e68ff99b18033879d85e3b9d40afa5a3d25b14d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147878 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-02-24crashtesting: null-deref seen on loading forum-mso-en4-399427.xlsxCaolán McNamara1-4/+5
and others. A problem since: commit 8c9a6abf30e9ff1ebd5647f7c271e0d64643860a Date: Thu Feb 2 20:16:04 2023 +0100 tdf#138601 XLSX import: fix priority of conditional formatting rules Change-Id: I663b193c5bd7c5c92d3c423e70b0f7a24e3e5d76 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147592 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-02-19crashtesting: crash on import of forum-mso-en4-702161.xlsxCaolán McNamara1-15/+19
vConditions is empty at this point for row 5 git show -w Change-Id: I05d984d73d4dd5a0ece894f854263528c9c00be9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147303 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-02-17crashtesting: crash on export of forum-mso-en4-568138.xlsx to xlsCaolán McNamara1-4/+16
recurses to death warn:legacy.osl:186588:186588:sc/source/filter/excel/xeformula.cxx:518: XclExpFmlaCompImpl::CreateFormula - unknown garbage behind formula warn:legacy.osl:186588:186588:sc/source/filter/excel/xeformula.cxx:518: XclExpFmlaCompImpl::CreateFormula - unknown garbage behind formula warn:legacy.osl:186588:186588:sc/source/filter/excel/xeformula.cxx:2235: XclExpFmlaCompImpl::PopOperandPos - token stack broken Segmentation fault (core dumped) Change-Id: I17172be42c9992ceb3a90c5a92344a58328dc483 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147204 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-02-15tdf#138601 XLSX import: fix priority of conditional formatting rulesTibor Nagy3-0/+46
Multiple conditional formattings can intersect or have the same range of cell with different rules. Without sorting the rules by their priority, the cells got bad formatting, e.g. different colors than what was set in MSO. Change-Id: I619359877f1a3e55fc8f895d5ba6f0f4f30e07f2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146513 Tested-by: Jenkins Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2023-02-01crashtesting: threaded import crash seen in forum-mso-en4-802501.xlsxCaolán McNamara2-3/+4
sporadically reproducible with tsan and ./instdir/program/soffice.bin --headless --convert-to pdf ~/forum-mso-en4-802501.xlsx move getTables().applyAutoFilters(), which wants to query tab 1 while tab 1 is still getting imported, until after the threaded import has completed. This call was moved before in: commit edd51b813005c2159426d8f2917eede5b14a4577 Date: Thu Aug 15 16:23:46 2013 +0100 fix for bnc#834705 missing drop downs for autofilter ================== WARNING: ThreadSanitizer: data race (pid=3791886) Read of size 8 at 0x7b5000040f20 by thread T7 (mutexes: write M0, write M1): #0 __gnu_cxx::__normal_iterator<unsigned long const*, std::vector<unsigned long, std::allocator<unsigned long>>>::__normal_iterator(unsigned long const* const&) /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_iterator.h:1073:20 (libsclo.so+0x3d31c4) (BuildId: 4582437348063bd1c461478348ce37a0dbd28def) #1 std::vector<unsigned long, std::allocator<unsigned long>>::cend() const /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_vector.h:960:16 (libsclo.so+0x3d31c4) #2 mdds::mtv::soa::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52, svl::SharedString>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell>>, sc::CellStoreTrait>::cbegin() const core/workdir/UnpackedTarball/mdds/include/mdds/multi_type_vector/soa/main_def.inl:3771:34 (libsclo.so+0x3d31c4) #3 mdds::mtv::soa::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52, svl::SharedString>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell>>, sc::CellStoreTrait>::begin() const core/workdir/UnpackedTarball/mdds/include/mdds/multi_type_vector/soa/main_def.inl:3753:12 (libsclo.so+0x3d31c4) #4 ScColumn::InitBlockPosition(sc::ColumnBlockConstPosition&) const core/sc/source/core/data/column3.cxx:1135:35 (libsclo.so+0x3d31c4) #5 ScTable::GetDataArea(short&, int&, short&, int&, bool, bool) const core/sc/source/core/data/table1.cxx:908:19 (libsclo.so+0x637b39) (BuildId: 4582437348063bd1c461478348ce37a0dbd28def) #6 ScDocument::GetDataArea(short, short&, int&, short&, int&, bool, bool) const core/sc/source/core/data/document.cxx:1104:23 (libsclo.so+0x49b696) (BuildId: 4582437348063bd1c461478348ce37a0dbd28def) #7 ScDBData::ExtendDataArea(ScDocument const&) core/sc/source/core/tool/dbdata.cxx:654:10 (libsclo.so+0x741e77) (BuildId: 4582437348063bd1c461478348ce37a0dbd28def) #8 ScDocument::GetFilterEntries(short, int, short, ScFilterEntries&) core/sc/source/core/data/documen3.cxx:1577:14 (libsclo.so+0x46e7a6) (BuildId: 4582437348063bd1c461478348ce37a0dbd28def) #9 (anonymous namespace)::fillQueryParam(ScQueryParam&, ScDocument*, com::sun::star::uno::Sequence<com::sun::star::sheet::TableFilterField3> const&) core/sc/source/ui/unoobj/datauno.cxx:1164:27 (libsclo.so+0xf7dd72) (BuildId: 4582437348063bd1c461478348ce37a0dbd28def) #10 ScFilterDescriptorBase::setFilterFields3(com::sun::star::uno::Sequence<com::sun::star::sheet::TableFilterField3> const&) core/sc/source/ui/unoobj/datauno.cxx:1380:5 (libsclo.so+0xf7dd72) #11 non-virtual thunk to ScFilterDescriptorBase::setFilterFields3(com::sun::star::uno::Sequence<com::sun::star::sheet::TableFilterField3> const&) core/sc/source/ui/unoobj/datauno.cxx (libsclo.so+0xf7e2c2) (BuildId: 4582437348063bd1c461478348ce37a0dbd28def) #12 oox::xls::AutoFilter::finalizeImport(com::sun::star::uno::Reference<com::sun::star::sheet::XDatabaseRange> const&, short) core/sc/source/filter/oox/autofilterbuffer.cxx:803:22 (libscfiltlo.so+0x3cca2c) (BuildId: 798032f9cb60957d86e47827d9e882b8931326ba) #13 oox::xls::AutoFilterBuffer::finalizeImport(com::sun::star::uno::Reference<com::sun::star::sheet::XDatabaseRange> const&, short) core/sc/source/filter/oox/autofilterbuffer.cxx:950:22 (libscfiltlo.so+0x3cdc0b) (BuildId: 798032f9cb60957d86e47827d9e882b8931326ba) #14 oox::xls::Table::applyAutoFilters() core/sc/source/filter/oox/tablebuffer.cxx:143:23 (libscfiltlo.so+0x4b9268) (BuildId: 798032f9cb60957d86e47827d9e882b8931326ba) #15 void std::__invoke_impl<void, void (oox::xls::Table::*&)(), oox::xls::Table&>(std::__invoke_memfun_ref, void (oox::xls::Table::*&)(), oox::xls::Table&) /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/invoke.h:67:14 (libscfiltlo.so+0x4b9d96) (BuildId: 798032f9cb60957d86e47827d9e882b8931326ba) #16 std::__invoke_result<void (oox::xls::Table::*&)(), oox::xls::Table&>::type std::__invoke<void (oox::xls::Table::*&)(), oox::xls::Table&>(void (oox::xls::Table::*&)(), oox::xls::Table&) /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/invoke.h:96:14 (libscfiltlo.so+0x4b9d96) #17 void std::_Bind<void (oox::xls::Table::* (std::_Placeholder<1>))()>::__call<void, oox::xls::Table&, 0ul>(std::tuple<oox::xls::Table&>&&, std::_Index_tuple<0ul>) /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/functional:495:11 (libscfiltlo.so+0x4b9d96) #18 void std::_Bind<void (oox::xls::Table::* (std::_Placeholder<1>))()>::operator()<oox::xls::Table&, void>(oox::xls::Table&) /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/functional:580:17 (libscfiltlo.so+0x4b9d96) #19 oox::RefMap<int, oox::xls::Table, std::less<int>>::ForEachFunctor<std::_Bind<void (oox::xls::Table::* (std::_Placeholder<1>))()>>::operator()(std::pair<int const, std::shared_ptr<oox::xls::Table>> const&) core/include/oox/helper/refmap.hxx:122:89 (libscfiltlo.so+0x4b9d96) #20 oox::RefMap<int, oox::xls::Table, std::less<int>>::ForEachFunctor<std::_Bind<void (oox::xls::Table::* (std::_Placeholder<1>))()>> std::for_each<std::_Rb_tree_const_iterator<std::pair<int const, std::shared_ptr<oox::xls::Table>>>, oox::RefMap<int, oox::xls::Table, std::less<int>>::ForEachFunctor<std::_Bind<void (oox::xls::Table::* (std::_Placeholder<1>))()>>>(std::_Rb_tree_const_iterator<std::pair<int const, std::shared_ptr<oox::xls::Table>>>, std::_Rb_tree_const_iterator<std::pair<int const, std::shared_ptr<oox::xls::Table>>>, oox::RefMap<int, oox::xls::Table, std::less<int>>::ForEachFunctor<std::_Bind<void (oox::xls::Table::* (std::_Placeholder<1>))()>>) /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_algo.h:3787:2 (libscfiltlo.so+0x4b9d96) #21 void oox::RefMap<int, oox::xls::Table, std::less<int>>::forEach<std::_Bind<void (oox::xls::Table::* (std::_Placeholder<1>))()>>(std::_Bind<void (oox::xls::Table::* (std::_Placeholder<1>))()> const&) const core/include/oox/helper/refmap.hxx:71:29 (libscfiltlo.so+0x4b9d96) #22 void oox::RefMap<int, oox::xls::Table, std::less<int>>::forEachMem<void (oox::xls::Table::*)()>(void (oox::xls::Table::*)()) const core/include/oox/helper/refmap.hxx:79:29 (libscfiltlo.so+0x4b9d96) #23 oox::xls::TableBuffer::applyAutoFilters() core/sc/source/filter/oox/tablebuffer.cxx:179:16 (libscfiltlo.so+0x4b9d96) #24 oox::xls::WorksheetGlobals::finalizeWorksheetImport() core/sc/source/filter/oox/worksheethelper.cxx:943:17 (libscfiltlo.so+0x4ee58e) (BuildId: 798032f9cb60957d86e47827d9e882b8931326ba) #25 oox::xls::WorksheetHelper::finalizeWorksheetImport() core/sc/source/filter/oox/worksheethelper.cxx:1625:17 (libscfiltlo.so+0x4f2cff) (BuildId: 798032f9cb60957d86e47827d9e882b8931326ba) #26 oox::xls::WorksheetFragment::finalizeImport() core/sc/source/filter/oox/worksheetfragment.cxx:632:5 (libscfiltlo.so+0x4e91cc) (BuildId: 798032f9cb60957d86e47827d9e882b8931326ba) #27 oox::core::FragmentHandler2::endDocument() core/oox/source/core/fragmenthandler2.cxx:53:5 (libooxlo.so+0x1c20d9) (BuildId: eba40a8f6e1e986eafb2008b5a61a9060f9b6c0b) #28 non-virtual thunk to oox::core::FragmentHandler2::endDocument() core/oox/source/core/fragmenthandler2.cxx (libooxlo.so+0x1c20d9) #29 sax_fastparser::FastSaxParserImpl::parseStream(com::sun::star::xml::sax::InputSource const&) core/sax/source/fastparser/fastparser.cxx:910:36 (libexpwraplo.so+0x2a06a) (BuildId: 4c8d8739ce3b93f891afa1e160f975a2892a4af4) #30 sax_fastparser::FastSaxParser::parseStream(com::sun::star::xml::sax::InputSource const&) core/sax/source/fastparser/fastparser.cxx:1482:13 (libexpwraplo.so+0x31738) (BuildId: 4c8d8739ce3b93f891afa1e160f975a2892a4af4) #31 oox::core::FastParser::parseStream(com::sun::star::xml::sax::InputSource const&, bool) core/oox/source/core/fastparser.cxx:121:15 (libooxlo.so+0x1ae980) (BuildId: eba40a8f6e1e986eafb2008b5a61a9060f9b6c0b) #32 oox::core::FastParser::parseStream(com::sun::star::uno::Reference<com::sun::star::io::XInputStream> const&, rtl::OUString const&) core/oox/source/core/fastparser.cxx:129:5 (libooxlo.so+0x1aebdf) (BuildId: eba40a8f6e1e986eafb2008b5a61a9060f9b6c0b) #33 oox::core::XmlFilterBase::importFragment(rtl::Reference<oox::core::FragmentHandler> const&, oox::core::FastParser&) core/oox/source/core/xmlfilterbase.cxx:412:21 (libooxlo.so+0x1d01ac) (BuildId: eba40a8f6e1e986eafb2008b5a61a9060f9b6c0b) #34 oox::xls::WorkbookHelper::importOoxFragment(rtl::Reference<oox::core::FragmentHandler> const&, oox::core::FastParser&) core/sc/source/filter/oox/workbookhelper.cxx:1024:27 (libscfiltlo.so+0x4dbbd2) (BuildId: 798032f9cb60957d86e47827d9e882b8931326ba) #35 oox::xls::(anonymous namespace)::WorkerThread::doWork() core/sc/source/filter/oox/workbookfragment.cxx:249:27 (libscfiltlo.so+0x4d3347) (BuildId: 798032f9cb60957d86e47827d9e882b8931326ba) #36 comphelper::ThreadTask::exec() core/comphelper/source/misc/threadpool.cxx:319:9 (libcomphelper.so+0x17dbc1) (BuildId: 30a9bf106ea764f860a55d99b75dd87a0f268335) #37 comphelper::ThreadPool::ThreadWorker::execute() core/comphelper/source/misc/threadpool.cxx:85:24 (libcomphelper.so+0x17dbc1) #38 salhelper::Thread::run() core/salhelper/source/thread.cxx:39:5 (libuno_salhelpergcc3.so.3+0x5267) (BuildId: d146f721ac5d8da923b02df0d671788655b81eb6) #39 non-virtual thunk to salhelper::Thread::run() core/salhelper/source/thread.cxx (libuno_salhelpergcc3.so.3+0x5267) #40 threadFunc core/include/osl/thread.hxx:189:15 (libuno_salhelpergcc3.so.3+0x551e) (BuildId: d146f721ac5d8da923b02df0d671788655b81eb6) #41 osl_thread_start_Impl(void*) core/sal/osl/unx/thread.cxx:265:9 (libuno_sal.so.3+0x6a9d5) (BuildId: 767a6cd7c58bf820064a10cf0ab0f15b30c2f4ac) Previous write of size 8 at 0x7b5000040f20 by thread T6 (mutexes: write M2): #0 std::vector<unsigned long, std::allocator<unsigned long>>::_M_fill_insert(__gnu_cxx::__normal_iterator<unsigned long*, std::vector<unsigned long, std::allocator<unsigned long>>>, unsigned long, unsigned long const&) /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/vector.tcc:556:29 (libsclo.so+0x2f6766) (BuildId: 4582437348063bd1c461478348ce37a0dbd28def) #1 std::vector<unsigned long, std::allocator<unsigned long>>::insert(__gnu_cxx::__normal_iterator<unsigned long const*, std::vector<unsigned long, std::allocator<unsigned long>>>, unsigned long, unsigned long const&) /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_vector.h:1435:2 (libsclo.so+0x2ffd3a) (BuildId: 4582437348063bd1c461478348ce37a0dbd28def) #2 mdds::mtv::soa::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52, svl::SharedString>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell>>, sc::CellStoreTrait>::blocks_type::insert(unsigned long, unsigned long) core/workdir/UnpackedTarball/mdds/include/mdds/multi_type_vector/soa/main_def.inl:99:15 (libsclo.so+0x2ffd3a) #3 mdds::mtv::soa::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52, svl::SharedString>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell>>, sc::CellStoreTrait>::set_new_block_to_middle(unsigned long, unsigned long, unsigned long, bool) core/workdir/UnpackedTarball/mdds/include/mdds/multi_type_vector/soa/main_def.inl:4326:19 (libsclo.so+0x2ffd3a) #4 mdds::mtv::soa::detail::iterator_base<mdds::mtv::soa::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52, svl::SharedString>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell>>, sc::CellStoreTrait>::iterator_trait> mdds::mtv::soa::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52, svl::SharedString>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell>>, sc::CellStoreTrait>::set_cell_to_middle_of_block<double>(unsigned long, unsigned long, double const&) core/workdir/UnpackedTarball/mdds/include/mdds/multi_type_vector/soa/main_def.inl:3999:19 (libsclo.so+0x3259fe) (BuildId: 4582437348063bd1c461478348ce37a0dbd28def) #5 mdds::mtv::soa::detail::iterator_base<mdds::mtv::soa::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52, svl::SharedString>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell>>, sc::CellStoreTrait>::iterator_trait> mdds::mtv::soa::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52, svl::SharedString>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell>>, sc::CellStoreTrait>::set_cell_to_empty_block<double>(unsigned long, unsigned long, double const&) core/workdir/UnpackedTarball/mdds/include/mdds/multi_type_vector/soa/main_def.inl:3313:12 (libsclo.so+0x3259fe) #6 mdds::mtv::soa::detail::iterator_base<mdds::mtv::soa::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52, svl::SharedString>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell>>, sc::CellStoreTrait>::iterator_trait> mdds::mtv::soa::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52, svl::SharedString>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell>>, sc::CellStoreTrait>::set_impl<double>(unsigned long, unsigned long, double const&) core/workdir/UnpackedTarball/mdds/include/mdds/multi_type_vector/soa/main_def.inl:1260:16 (libsclo.so+0x32492f) (BuildId: 4582437348063bd1c461478348ce37a0dbd28def) #7 mdds::mtv::soa::detail::iterator_base<mdds::mtv::soa::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52, svl::SharedString>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell>>, sc::CellStoreTrait>::iterator_trait> mdds::mtv::soa::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52, svl::SharedString>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell>>, sc::CellStoreTrait>::set<double>(mdds::mtv::soa::detail::iterator_base<mdds::mtv::soa::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52, svl::SharedString>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell>>, sc::CellStoreTrait>::iterator_trait> const&, unsigned long, double const&) core/workdir/UnpackedTarball/mdds/include/mdds/multi_type_vector/soa/main_def.inl:754:20 (libsclo.so+0x4cc138) (BuildId: 4582437348063bd1c461478348ce37a0dbd28def) #8 ScDocumentImport::setNumericCell(ScAddress const&, double) core/sc/source/core/data/documentimport.cxx:259:35 (libsclo.so+0x4cc138) #9 oox::xls::SheetDataBuffer::setValueCell(oox::xls::CellModel const&, double) core/sc/source/filter/oox/sheetdatabuffer.cxx:107:20 (libscfiltlo.so+0x4833c0) (BuildId: 798032f9cb60957d86e47827d9e882b8931326ba) #10 oox::xls::SheetDataContext::onEndElement() core/sc/source/filter/oox/sheetdatacontext.cxx:185:25 (libscfiltlo.so+0x48fed2) (BuildId: 798032f9cb60957d86e47827d9e882b8931326ba) #11 non-virtual thunk to oox::xls::SheetDataContext::onEndElement() core/sc/source/filter/oox/sheetdatacontext.cxx (libscfiltlo.so+0x48fff9) (BuildId: 798032f9cb60957d86e47827d9e882b8931326ba) #12 oox::core::ContextHandler2Helper::implEndElement(int) core/oox/source/core/contexthandler2.cxx:125:9 (libooxlo.so+0x1ac82b) (BuildId: eba40a8f6e1e986eafb2008b5a61a9060f9b6c0b) #13 oox::core::ContextHandler2::endFastElement(int) core/oox/source/core/contexthandler2.cxx:220:5 (libooxlo.so+0x1ac82b) #14 non-virtual thunk to oox::core::ContextHandler2::endFastElement(int) core/oox/source/core/contexthandler2.cxx (libooxlo.so+0x1ac82b) #15 (anonymous namespace)::Entity::endElement() core/sax/source/fastparser/fastparser.cxx:515:27 (libexpwraplo.so+0x3042f) (BuildId: 4c8d8739ce3b93f891afa1e160f975a2892a4af4) #16 sax_fastparser::FastSaxParserImpl::consume((anonymous namespace)::EventList&) core/sax/source/fastparser/fastparser.cxx:1029:25 (libexpwraplo.so+0x29d37) (BuildId: 4c8d8739ce3b93f891afa1e160f975a2892a4af4) #17 sax_fastparser::FastSaxParserImpl::parseStream(com::sun::star::xml::sax::InputSource const&) core/sax/source/fastparser/fastparser.cxx:869:22 (libexpwraplo.so+0x29d37) #18 sax_fastparser::FastSaxParser::parseStream(com::sun::star::xml::sax::InputSource const&) core/sax/source/fastparser/fastparser.cxx:1482:13 (libexpwraplo.so+0x31738) (BuildId: 4c8d8739ce3b93f891afa1e160f975a2892a4af4) #19 oox::core::FastParser::parseStream(com::sun::star::xml::sax::InputSource const&, bool) core/oox/source/core/fastparser.cxx:121:15 (libooxlo.so+0x1ae980) (BuildId: eba40a8f6e1e986eafb2008b5a61a9060f9b6c0b) #20 oox::core::FastParser::parseStream(com::sun::star::uno::Reference<com::sun::star::io::XInputStream> const&, rtl::OUString const&) core/oox/source/core/fastparser.cxx:129:5 (libooxlo.so+0x1aebdf) (BuildId: eba40a8f6e1e986eafb2008b5a61a9060f9b6c0b) #21 oox::core::XmlFilterBase::importFragment(rtl::Reference<oox::core::FragmentHandler> const&, oox::core::FastParser&) core/oox/source/core/xmlfilterbase.cxx:412:21 (libooxlo.so+0x1d01ac) (BuildId: eba40a8f6e1e986eafb2008b5a61a9060f9b6c0b) #22 oox::xls::WorkbookHelper::importOoxFragment(rtl::Reference<oox::core::FragmentHandler> const&, oox::core::FastParser&) core/sc/source/filter/oox/workbookhelper.cxx:1024:27 (libscfiltlo.so+0x4dbbd2) (BuildId: 798032f9cb60957d86e47827d9e882b8931326ba) #23 oox::xls::(anonymous namespace)::WorkerThread::doWork() core/sc/source/filter/oox/workbookfragment.cxx:249:27 (libscfiltlo.so+0x4d3347) (BuildId: 798032f9cb60957d86e47827d9e882b8931326ba) #24 comphelper::ThreadTask::exec() core/comphelper/source/misc/threadpool.cxx:319:9 (libcomphelper.so+0x17dbc1) (BuildId: 30a9bf106ea764f860a55d99b75dd87a0f268335) #25 comphelper::ThreadPool::ThreadWorker::execute() core/comphelper/source/misc/threadpool.cxx:85:24 (libcomphelper.so+0x17dbc1) #26 salhelper::Thread::run() core/salhelper/source/thread.cxx:39:5 (libuno_salhelpergcc3.so.3+0x5267) (BuildId: d146f721ac5d8da923b02df0d671788655b81eb6) #27 non-virtual thunk to salhelper::Thread::run() core/salhelper/source/thread.cxx (libuno_salhelpergcc3.so.3+0x5267) #28 threadFunc core/include/osl/thread.hxx:189:15 (libuno_salhelpergcc3.so.3+0x551e) (BuildId: d146f721ac5d8da923b02df0d671788655b81eb6) #29 osl_thread_start_Impl(void*) core/sal/osl/unx/thread.cxx:265:9 (libuno_sal.so.3+0x6a9d5) (BuildId: 767a6cd7c58bf820064a10cf0ab0f15b30c2f4ac) Change-Id: I7542432749fded8ab5e35f79cb221ad712f7802d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146430 Tested-by: Jenkins Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-01-27crashtesting: crash on forum-mso-en4-719754.xlsx with fPercentile ~== 1Caolán McNamara1-1/+6
input is fPercentile of near 1 where approxFloor would give nIndex of nSize-1 resulting in a non-zero tiny negative fDiff, when the assumption is fDiff will be 0 or some positive value. Change-Id: I8fe5520f2b3c68f3204d435337df527185dcb0d3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146218 Tested-by: Jenkins Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-01-27crashtesting: assert seen in forum-mso-en4-192558.xlsxCaolán McNamara2-2/+2
assert is assert(rRange.aStart.Tab() == rRange.aEnd.Tab()); sheel 1 cell E6 contains =IFERROR(VLOOKUP(D6,a6:'sheet1'!b495,3,FALSE()),"") note: sheel 1 E7 is =IFERROR(VLOOKUP(D7,$Sheet1.A7:Search.B499,3,FALSE()),"") aRef.Ref1.Tab() and aRef.Ref2.Tab() are the same, but IsTabRel differs, so the input address with a tab 1 results in an output range with start and end of different tabs. do the comparison with the result range, by analogy do the same adjustment in ScGroupTokenConverter where the comparison was introduced for commit ca1f051972946b24cb6658143fb0d0ac3587a988 Date: Fri Mar 10 18:32:27 2017 +0100 Resolves: tdf#106459 3D reference can't be handled as vector reference and basically copied and pasted here. FWIW in forum-mso-en4-192558.xlsx the original formulas in xlsx are: IFERROR(VLOOKUP(D6,A6:'Sheet1'!B495,3,FALSE),"") IFERROR(VLOOKUP(D7,A7:B499:'Sheet1'!B496,3,FALSE),"") Change-Id: I69e3ca2f89008b81500789b1bca39b35685de8d5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146166 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>