/oox/

otropia/zeta-7-4 LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
path: root/sc/source/filter/excel/xeextlst.cxx
AgeCommit message (Collapse)Author
2024-10-27tdf#163486: PVS: Identical branchesBogdan Buzea
V1037 Two or more case-branches perform the same actions. Check lines: 331, 334 V1037 Two or more case-branches perform the same actions. Check lines: 529, 532 Change-Id: Id6ad82dd2cb570f7b9c04068e5f404077104a36e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175387 Reviewed-by: David Gilbert <freedesktop@treblig.org> Tested-by: Jenkins
2024-05-12replace createFromAscii with OUString literals in ScIconSetFormatNoel Grandin
Change-Id: I5af0128c55608bf6192af4dc46f9476393a15afa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167528 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2023-11-19Extended loplugin:ostr: scStephan Bergmann
Change-Id: I44536a13f4c31558671c1166d06b7f6216456641 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159680 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-08-07clang-tidy modernize-pass-by-value in scNoel Grandin
Change-Id: Ia7ff651d1cbc119b36a9f8052594d03650988f59 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137848 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-03-01use SfxItemSet::GetItemIfSet in sc/source/filterNoel Grandin
Change-Id: I8ba941cea8f3b8ed0f37d2dc6b2520ae89652afe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130744 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-08tdf#130104 - FILESAVE XLSX: cell indent increased on each saveKevin Suo
In OOXML, 1 indent = 3 space char width. ----- The Old Method: ----- XLSX Import: As per the line: sal_Int32 nIndent = getUnitConverter().scaleToMm100( 3.0 * maModel.mnIndent, Unit::Space ); assume the width of space char is 88, then: If the OOXML indent is 1, then nIndent would be 264.5, and casted to 264. If the OOXML indent is 2, then nIndent would be 528.5, and casted to 528. If the OOXML indent is 3, then nIndent would be 792.5, and casted to 792. ... Also, as Mike Kaganski has pointed out, we use twips in sc indent internally, thus it is wrong to convert to Mm100 unit here. XLSX Export: As per the line: nTmpIndent = (nTmpIndent + 100) / 200; Assume we did not edit the document upon open, and simply save it. Now: If our indent is 264, then the calculated OOXML indent would be 1.82, and then casted to 1, while the expected value is 1. If our indent is 528, then the calculated OOXML indent would be 3.14, and then casted to 3, while the expected value is 2. If our indent is 792, then the calculated OOXML indent would be 4.46, and then casted to 4, while the expected value is 3. ... Then if you reopen the saved xlsx file with Calc, the increament of indent continues on each save which causes serious format loss. Most importantly, if you change the indent of cells using the Calc toolbar indent icon, one-click would be 10pt = 200 twips, see defined macro SC_INDENT_STEP. This causes a mess when you change the indent in an xlsx document. ----- The New Method ----- In this patch, I have changed the XLSX import to convert the excel indent unit to 3-spaces-width *in twips*. Then, per code advice from Mike Kaganski, as a mirror operation, I have changed the XLSX export logic to detect the width of the space char (which *should* be the same as the one detected at the time of xlsx import), and use this width to convert the indent in twips unit to excel unit. This way, the indent will remain the same on xlsx export. ----- TODO: ----- 1. On xlsx import of the file tdf130104_indent.xlsx, the default font (i.e. font for the "Normal" style) is "Times New Roman". However, when the UI locale is set to Simplified Chinese and "Asian" option is enabled in Tools->Options->Language Settigns-> Languages->"Default Languages for Documents", upon resave as xlsx, the default font for the document is changed to "Noto Sans CJK SC" on my system, which causes the space-width detected to be different from the width detected on xlsx import. This seems to be another bug, see tdf#131349. (Luckily the unit test in this patch passes, this is because the change of space width resulted from the change in default font is very small thus the conversion is not impacted.) 2. The UI part need to be improved, so that after xlsx import, if the user hit the "Increase Indent" or "Decrease Indent" toolar icon to change the indent, Calc should be able to detect that we are operating in an xlsx file, thus the "increment" should be 3 * width of space char, rather than the current SC_INDENT_STEP. Also, the if the user changes the default font of the xlsx document, the Calc should recalculate the indent for each cell to reflect the possible change in width of space char. Change-Id: I5f7a4ecbcd93079d1c19db3b0b641dda949f6fbf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123111 Tested-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-01-05tdf#139394 XLSX export: remove extra quotation marksTibor Nagy
This fixes commit 583e2bfba2d72ac8afe7261c23f380daf5486889 (tdf#139021 XLSX export: fix "contains" conditional formatting). Change-Id: Idae3190b5f87dac551251da19c511f501bdaaa21 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108452 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org> Reviewed-by: Eike Rathke <erack@redhat.com>
2020-12-30loplugin:stringviewparam: operator +, reduxStephan Bergmann
Change-Id: I0790e09f24512d7b205681127eb95ad7dc15a15f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108473 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2020-12-28tdf#139021 XLSX export: fix "contains" conditional formattingTibor Nagy
when using "Given text" type with cell reference instead of fixed string. Note: fix also "notContainsText", and prepare the fix for "beginsWith", "endsWith" and "expression" type conditions. Follow-up of commit 0101975f8eac650bb87c4af81157cb33a6309e0e (tdf#122102 XLSX import: fix "contains" conditional formatting). Co-authored-by: Attila Szűcs (NISZ) Change-Id: I46d80946f2b6cfaa2a9fe2438fae20e8aa9d50f4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108035 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2020-11-27tdf#42949 Fix new IWYU warnings in directory sc/Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I217817e2e4a42b096f5a7fb6344568c10d69aab2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106078 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-10-26std::unique_ptr -> std::optionalNoel
Change-Id: I25f8b337a3f9cecb4d7785c18d91dae89ba20799 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104797 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>