summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-04-25tdf#135978 sw_redlinehide: recreate fly frames anchored to subsequent nodesMichael Stahl
... in SwTextNode::JoinNext(). The 2nd node is deleted, so its frame is deleted, and if it is the start of a merged frame, fly frames on the node itself will be recreated already, but those on subseqent nodes need an extra call. Change-Id: I18999946334f5560b720d3d275610bc8b07973f6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133335 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-04-25ofz#46905 Null-dereferenceCaolán McNamara
Change-Id: I26427ee1e010ce79e40c550459d9f53598570a7b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133360 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-04-25sw: prefix members of WW8_WrPct, WW8_WrPlc1, WW8_WrPlcField and ...Miklos Vajna
... WW8_WrPlcFootnoteEdn See tdf#94879 for motivation. Change-Id: Ie49a167ca443216322a2038d4d6568d43736019a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133361 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-04-25find-unneeded-includes: bail out early if no files are found with --recursiveGabor Kelemen
Change-Id: I5bd726b33e4fc7068baad91ff185763274307b35 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133308 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-04-24Remove brittle test from WmfTestHossein
The WmfTest::testStockObject() contained test for the number of children in the metafile dump. This can be changed when unimplemented records are implemented. The problem was revelead while implementing SetPolyFillMode record: <https://ci.libreoffice.org/job/gerrit_linux_clang_dbgutil/112114/> xmltesttools.cxx:234:WmfTest::testStockObject equality assertion failed - Expected: 42 - Actual : 47 - In <>, XPath '/metafile/push[2]' number of child-nodes is incorrect Change-Id: I627801b7ac535a2f0c736880d9675f3d0136136a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133353 Tested-by: Jenkins Reviewed-by: Hossein - <hossein@libreoffice.org>
2022-04-24Do not start a:path with lnTo in export to OOXMLRegina Henschel
This is a follow up to commit 2029b2f6dd0109c5892e5ac5640022b31fe42fd2 The commands A, W, T or L of a draw:enhanced-path draw a line from current point to start of the arc or end of line, respectivly. If there is no current point the path is faulty and behavior is not defined in ODF. LibreOffice is tolerant and makes a move to the start point of the arc or to the end point of the line. With this patch we do the same now in export to OOXML, so the user gets the same shape geometry as in LO. If a path starts with lnTo, MS Office will show nothing. I wouldn't care about user-created faulty paths, but LO produces such faulty path when an EllipseRibbon shape from binary MS Office is imported. Even when that will be fixed, we need the fix here, because the faulty path had been written to document markup and will be used when such document is opened. Change-Id: Ic52ec3bc78231b26efb592ddadee2e3042fdc065 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133349 Tested-by: Jenkins Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
2022-04-24tdf#103859 EMF+ Use variable types according to EMFPLUS documentationBartosz Kosiorek
With this commit, the types of variable for Brush and Pen were aligned to documentation: [MS-EMFPLUS] - Enhanced Metafile Format Plus Extensions As a side effect the code was simplified a bit Change-Id: Ibabad628d0aaef510f61ee8b3d881c3f024cebef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133327 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2022-04-24Fix typoAndrea Gelmini
Change-Id: I85013e2fc1150b1830fa21da7ed77ac95ff7452e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133352 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins
2022-04-23find-unneeded-includes: add --noexclude argumentGabor Kelemen
To ignore the excludelist, thereby checking if its exclusions are still valid. It may happen that some refactorings make an exclusion obsolete. In this case the IWYU suggestion to remove a now-really-unnecessary header would be ignored forever. It makes sense to use it after a full cleanup of a module in normal mode. Change-Id: I8216a79ea2354ab428d6ce7a56a49e5cf67056fe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133307 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2022-04-23Recheck module chart2 with IWYUGabor Kelemen
See tdf#42949 for motivation Change-Id: Id4cdca3eed8618c289f30913d506f8f2bd46f0bb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133112 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2022-04-23Fix typoAndrea Gelmini
Change-Id: If2bc62044609ef173ac147196a9f78363db002eb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133345 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-04-23tdf#148591 rename two Vertical positioning regionsSeth Chaiklin
Page text area top --> Above page text area Page text area bottom --> Below page text area Change-Id: I3a63ec09e6a3dfbd51385139ea89454bd1792a8f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133288 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2022-04-22external/libassuan: Fix fallout of defining __STDC__ on WindowsStephan Bergmann
...since 1bb0e177124d5d6661b72df6c7d848fb23639652 "Fix autoconf>=2.70 gcc-wrapper breakage", which had the side effect of preventing various deprecated function declarations in system headers (e.g., isascii in addition to __isascii). This went unnoticed so far due to the traditionally lax handling of missing function declarations in C, and only now started to cause > conversion.c(94,9): error: call to undeclared function 'isascii'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] > if ((isascii (*istr) && isprint (*istr)) || (*istr >= 0x80)) > ^ etc. with clang-cl 15 trunk after <https://github.com/llvm/llvm-project/commit/7d644e1215b376ec5e915df9ea2eeb56e2d94626> "[C11/C2x] Change the behavior of the implicit function declaration warning". Where undeclared functions have been used in Windows-only code, they have been replaced with their __STDC__-declared counterparts, and for occurrences in shared code Windows-only macro definitions have been introduced (as would have done in the system headers too, if __STDC__ was not defined) to not clutter the shared code with #ifdefs. Also, for getpid (resp. _getpid), the #include <process.h> was apparently missing from the upstream code, even without our __STDC__ hack in external/libassuan/ExternalProject_libassuan.mk (but never caused errors until now, either). Change-Id: I7442394d0c6e633bca1f6c7331d7ee51651179a4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133339 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-04-22external/gpgmepp: Missing includes (Windows)Stephan Bergmann
> gpgme-w32spawn.c(288,8): error: call to undeclared function 'open'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] > fd = open (trans_file, O_RDONLY); > ^ etc. with clang-cl 15 trunk after <https://github.com/llvm/llvm-project/commit/7d644e1215b376ec5e915df9ea2eeb56e2d94626> "[C11/C2x] Change the behavior of the implicit function declaration warning", which went unnoticed so far due to the traditionally lax handling of missing function declarations in C. Change-Id: I805ab10d2b0aae3f8b1f46ffeda57aff2bbcef2f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133340 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-04-22external/libgpg-error: Missing include (getpid, Windows)Stephan Bergmann
This was apparently missing from d400009e7c74d13f01fda923d7399eac11b83b66 "gpg4libre: update gpgme, libassuan and libgpg-error" but went unnoticed so far due to the traditionally lax handling of missing function declarations in C, and only now started to cause > logging.c(845,57): error: call to undeclared function 'getpid'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] > (unsigned int)getpid (), pidsuf); > ^ with clang-cl 15 trunk after <https://github.com/llvm/llvm-project/commit/7d644e1215b376ec5e915df9ea2eeb56e2d94626> "[C11/C2x] Change the behavior of the implicit function declaration warning". Change-Id: I66dc409f629d9bda807bc9cca21a8a5ecdda79be Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133338 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-04-22LibreLogo: add basic HTML formatting support to LABELLászló Németh
It's possible to format character spans in text of LABEL, as bold, italic and underline text using HTML tags <B>, <I> and <U> and their lowercase equivalents. For example, LABEL '<i>Italic, <b>also bold</b></i> and <u>underline</u>.' Use HTML "&lt;" to avoid of the replacement. For example, LABEL 'some &lt;i>text&lt;/i>' prints "some <i>text</i>" instead of "some text" with italic "text" in it. Change-Id: I70fd97763c6c488eba23c168a541b84cff0c90e4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132786 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2022-04-22tdf#148685: Unset CharUnderlineColor and CharUnderlineHasColor propertiesXisco Fauli
Change-Id: Iebf482434cd393f55ae3e4690580b573624d78b1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133219 Tested-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-04-22tdf#147453 sw: disable Delete Table functions on tracked deletionsLászló Németh
In Show Changes mode, disable "Delete Selected Rows" icons and the same menu options in the following cases: - no table selection, but the text cursor in a deleted table row; - with table selection, all selected cells in deleted table rows. Disable also "Deleted Selected Columns" and "Delete Table" icons and the same menu options, when the cursor is there in a deleted table. Follow-up to commit c4f6fee3bea0d8618b5815e60304ff9359ccd21c "tdf#147435 sw: enable Accept Change for table selection". Change-Id: Ic6781ccee794c7458e6979f2e981840339cd3883 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133320 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2022-04-22Update context names to match EnumContext::ProvideContextContainersMike Kaganski
Change-Id: Id9bb806ba526a7557cda91ebdeb649578e64517c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133281 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-04-22tdf#55058 tdf#143875 EMF+ Don't change line weight while rotatingBartosz Kosiorek
Previously when TranfromationMatrix was used with rotation, the line weight and dashed line shapes were changed. In worst case if angle was larger than 90 degrees, the lines just disappear. This patch fixes that. The line looks exactly after rotation (with TranfromationMatrix). The tests were updated (added some additional rotation), to prove that now it is working correctly. Change-Id: Ic2382fa8d1b711a6bf06c94b2d0b9da9e7d396f0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133329 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2022-04-22Access2Base - (access2base.py) Don't use bare except: statementJean-Pierre Ledure
The exception hierarchy described on page https://docs.python.org/3.5/library/exceptions.html#exception-hierarchy indicates that the default exception in bare except: statements is BaseException. This induces that the SystemExit, KeyboardInterrupt and GeneratorExit are also handled by the user script. This is a not recommended practice. Better is to use the explicit Exception built-in exception except Exception: Bug reported by Paul M on Telegram Change-Id: Ie1ae1f732ebc60a881e7d40ba8141aa704e9cd5c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133328 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2022-04-22do not duplicate code for ScCountIfCellIteratorLuboš Luňák
d468958331f36310d11265ba55d7c27366ab58ab improved COUNTIF performance by copy&pasting the generic query iterator and then basically removing what was not necessary. Which is in general a good way to improve the performance, except for the copy&paste part, as the code has already started to diverge (e.g. fc3b904b671a71266db2e8b30cbeeef4f79). So instead make the shared code into a template and reuse that from specific code. This has exactly the same performance as the copy&paste way. Change-Id: I168319a1f4273bafc8c0742a114dafbf433968bb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133324 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-04-22move query-related iterators to a new separate fileLuboš Luňák
dociter.cxx/hxx are already quite big as it is, and the query iterators are more about queries than about iterating the document. Change-Id: I49e3a5636e4f366efb8b4968f54567d2716ade35 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133323 Tested-by: Luboš Luňák <l.lunak@collabora.com> Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-04-22Drop a bit more special-casing for Chart's sidebar property deckMike Kaganski
Introduced in commit 2d01ed9e8be543460e41e009fa992103a7c8d4c0 Author Muhammet Kara <muhammet.kara@collabora.com> Date Mon Nov 25 21:55:31 2019 +0300 tdf#94288: Show chart props sidebar on activation The problem was that ChartController::attachFrame, that called SelectionChangeHandler::selectionChanged notification, did that *prior* to setting its m_xFrame - and the notification failed in ContextChangeEventMultiplexer::NotifyContextChange, that checks the frame first. That prevented the proper context (with correct application and context names) to arrive to listeners, and the sidebar didn't update properly. Changing the order of the calls should fix the original problem. Change-Id: I9da8465af2ee4ed1f8eabed1c65d1c318f81a3f9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133326 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-04-22tdf#123381: sw: add table formula INTXisco Fauli
for DOCX interoperability. Change-Id: I4e63e213ef0a6f3a775bdf3bedfb7aca8853b479 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133091 Tested-by: Jenkins Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2022-04-22fix master after string_view patches..Noel Grandin
crossed paths Change-Id: I066b357dc10e2109658194b3b3682b7083ebbbbf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133322 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-22try to limit cell interpreting to only visible cells when drawingLuboš Luňák
If there's a document with a huge formula group, InterpretDirtyCells() on load will only interpret the range needed for drawing. But then scrolling just a bit could result in e.g. IsValue() call on a cell, and that could result in unrestricted Interpret() on the whole huge formula group, which could be slow. So explicitly interpret just the drawn cells in the hope that it'll avoid any further Interpret() calls. Change-Id: I01c9f95cf8a1cf240b798feef27d21010957030c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133306 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-04-22limit Interpret() for dirty cells only to the given row range (bsc#1197497)Luboš Luňák
ScColumn::InterpretDirtyCells() already takes a row range, and Interpret() can take a range inside a formula group, so don't lose the information in DirtyCellInterpreter, otherwise a whole large formula could be interpreted when just a subset would be enough. Change-Id: I93e5a7a212976be6fd588de6f68204cd1a271348 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133305 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-04-22Fix typo in codeAndrea Gelmini
Change-Id: I289162ed8adf93139bbc69e8f5f4a1444dd52199 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133231 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-04-22remove nonsensical 'over and out' commentsLuboš Luňák
First of all, it's very obvious that a return statement returns, so there's little point in commenting that. Second, 'over' and 'out' together is Hollywood nonsense, 'over' means "talk, I'm listening" and 'out' means "I'm not listening anymore" ... so 'over and out' I guess means "talk, I'm not listening" ? Change-Id: I60a202c78b33bd063c40ef4cd51514f7a2e6c95d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133321 Tested-by: Luboš Luňák <l.lunak@collabora.com> Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-04-22tdf#132475 writerfilter: connect PRINTDATE with DocInfo.PrintDateTimeJustin Luth
NOTE: This patch depends on a follow-up patch to handle the case where no date formating instructions are provided. NOTE: The time part might be considered a regression by some since Word displays as local time while LO seems to display GMT time. Although the date was being imported as a generic field, it wasn't associated with the last printed date. PRINTDATE is about the only field that MS Word automatically updates without the user having to press F9 on it, so that shows we should NOT mark it as fixed on import. On the other hand, it doesn't update very often, so if a user hand-modifies the result, then (without marking it as fixed) LO will display differently from MS Word. Hey, its a last-printed-date field I say. Who cares what it looks like on someone else's computer. It only matters if it is accurate and visible on yours. This caused a unit test failure with make CppunitTest_sw_ooxmlfieldexport CPPUNIT_TESt_NAME=testGenericTextField because contents.match(" PRINTDATE ") NOTE: we are losing \* MERGEFORMAT on all of supported fields on export, but that might be OK because we don't do MERGEFORMAT anyway. Change-Id: I7cb79ce7470cd55090a61be63848ce328d48be06 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132446 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-04-22use more string_view in unotoolsNoel Grandin
Change-Id: If32767647d3fba22a8e4a2b10fc57f47efca01d2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133270 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-22use more string_view in comphelperNoel Grandin
Change-Id: Ib186d2c9aa8458ddbdd14dd44e2d3938f0f26ad2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133269 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-22use more string_view in bridgesNoel Grandin
Change-Id: I842668655dec102e1595dcbac6413fe2b49d8515 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133268 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-22use more string_view in cppuhelperNoel Grandin
Change-Id: I846a1201b1b4fb8ca694a0b78b7d4cc2973dfbd2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133258 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-22address review comments on "use more string in unoidl.."Noel Grandin
on commit 2d9291b9433c9645b0870525211f74bfb1151555 Author: Noel Grandin <noel.grandin@collabora.co.uk> Date: Thu Apr 21 12:53:15 2022 +0200 use more string_view in unoidl,codemaker Primarily reverting the findEntity call-chain to use OUString instead of std::u16string_view. Change-Id: Ib01b9473c859bba3791563df753823bbf0a87ce0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133302 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-22sw content controls: add LOK APIMiklos Vajna
This is somewhat similar to LOK_CALLBACK_FORM_FIELD_BUTTON: if the cursor enters or leaves a content control, then we send this message, so the LOK client can render some kind of shading and/or border around the content control to indicate the boundaries of the object. Similar to selections, this can be multiple rectangles in case the string is long enough that the layout breaks it into multiple lines. Change-Id: I0641a19503b7a1d4cade8fe9b510605cab49f258 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133314 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-04-22fix an off-by-one error in GetEmptyLinesInBlock()Luboš Luňák
The function has been there since the initial commit and is not documented, but I think it counts the shortest amount of empty cells in the given area starting from the direction given. And AFAICT the off-by-one error was there since the initial commit, when it returned one less if the entire area was empty and the direction was vertical (horizontal was fine). And ScHTMLExport::FillGraphList() even was adjusted for this until my recent commit changing that code). But then ad2bc869bfe2d34bde added a shortcut for unallocated columns that didn't have the error. And the error even got corrected during the rewrite in c008dc483f8c6840803983e7e351cec6fdd32070, but then 01de94471c20a8b9c36d6080638d70e57eac55bf reverted that. Anyway, so fix this, I think all the relevant code should(?) now work properly. Change-Id: I194691f7276a1cea75945de05cb0dda2cdca859a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133319 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-04-22CppunitTest_sw_layoutwriter: use more SwParaPortion::dumpAsXml()Miklos Vajna
See commit feeed3e762cf077fbd9cf48f82e949365108ccc1 (CppunitTest_sw_layoutwriter: avoid some a11y-based layout testing, 2022-04-07) for motivation. Change-Id: Ib4887fb471665cc03fbf0420b9cd05da1a3641fd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133313 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-04-22sd theme: add rendering for shape fill color effectsMiklos Vajna
Only the no-effects variant was working previously. Change-Id: I50811a4c49d19dc801f0d1c841cbbdb2fae1ad60 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133297 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-04-22Colibre: Update Paragraph Style iconsRizal Muttaqin
Change-Id: Ie9380913d760fb23fe7f28a415cf7ffd2f1053fe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133310 Tested-by: Jenkins Reviewed-by: Rizal Muttaqin <rizmut@libreoffice.org>
2022-04-22fix checking whether a block of cells is emptyLuboš Luňák
The GetEmptyLinesInBlock() call has unclear semantics and it appears that it has an off-by-one error. Use a simple clear function for the check. Change-Id: I45d9b73428aedababc1ad93c202daa1de945b5bf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133303 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-04-22use range-checked GetCellValue()Luboš Luňák
Change-Id: Ie02b6be79d1be7481ebcfbc6862295a34e38f7db Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133304 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-04-22cleanup writerfilter lcl_ParseFormatJustin Luth
If there is no \@, then we will never match what util::findQuotedText is looking for, so don't bother. Change-Id: I0a6709046673d98d00d74e921d7f502c9df54b46 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133265 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2022-04-21simply return from a loopLuboš Luňák
Change-Id: I4e10945f32dfb535663ea7392f19532e45ca9ee3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133301 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-04-21fix off-by-one errorLuboš Luňák
Change-Id: Ic58a896a7a2edf5ba602ab9cfc5a4578fd5d0a56 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133296 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-04-21rework GetColumnsRange() and ScColumnsRangeLuboš Luňák
The problem with GetColumnsRange() was that it was clamping the range to the number of allocated columns, but that's not always wanted, e.g. ScDocument::InsertMatrixFormula() needs to iterate over the whole range and allocate columns if necessary instead of ignoring them. From an API point of view it's also not very obvious that something called GetColumnsRange() actually does something more than just returning the given range. Handle this by making GetColumnsRange() return the actual given range, and add GetWriteableColumnsRange() and GetAllocatedColumnsRange() for the specific cases. This also required changing ScColumnsRange to work simply on SCCOL value instead of using std::vector iterator (since the vector may not have all the elements in the range). Change-Id: I9b645459461efe6b282e8ac5d7a29549830f46c1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133295 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-04-21android: Show file chooser despite package visibility filtering in API 30Michael Weghorn
While it was working just fine in my x86_64 AVD with API level 31, opening the the file chooser on a real HW aarch64 device running Android 12 no longer worked by tapping on the TextView in `LibreOfficeUIActivity` after updating target API from 28 to 31 in commit 2ab389b251744fa7f3f6b060c09746e59d87f3b1 Date: Tue Apr 19 10:33:27 2022 +0200 android: Update compileSdkVersion/targetSdkVersion to 31 The intent.resolveActivity(getPackageManager()) != null check was failing there, so the Activity with `Intent.ACTION_OPEN_DOCUMENT` wasn't started there. This looks like an issue due to package visibility filtering introduced in target API level 30. Quoting from [1]: > When an app targets Android 11 (API level 30) or higher and queries for > information about the other apps that are installed on a device, the > system filters this information by default. The limited package > visibility reduces the number of apps that appear to be installed on a > device, from your app's perspective. > > [...] > > The limited app visibility affects the return results of methods that > give information about other apps, such as queryIntentActivities(), > getPackageInfo(), and getInstalledApplications(). The limited > visibility also affects explicit interactions with other apps, such > as starting another app's service. From how I understand it, the check is used to make sure that there is an app that can handle the Intent, as e.g. the "Android fundamentals 02.3: Implicit intents" tutorial [2] mentions it for the example using an `Intent.ACTION_VIEW`: > Use the resolveActivity() method and the Android package manager to find > an Activity that can handle your implicit Intent. Make sure that the > request resolved successfully. > > if (intent.resolveActivity(getPackageManager()) != null) { > } > > This request matches your Intent action and data with the Intent filters > for installed apps on the device. You use it to make sure there is at > least one Activity that can handle your requests. While that sounds reasonable to make sure there is an app that can view specific data passed *from* the app (and [3] describes how to add a corresponding `<queries>` element to make this use case work), it seems to be unnecessary for `Intent.ACTION_OPEN_DOCUMENT`, since that causes the system to "display the various DocumentsProvider instances installed on the device, letting the user navigate through them" and Android presumably at least provides a provider for handling local files by itself in any case. The `Intent.ACTION_GET_CONTENT` case used instead of `Intent.ACTION_OPEN_DOCUMENT` for API level < 19 should presumably be similar. Anyway, in case there should still be any case where the Intent cannot be handled: `startActivityForResult` "throws ActivityNotFoundException if there was no Activity found to run the given Intent." [4], so add a try-catch block handling that exception instead of the previous check. [1] https://developer.android.com/training/package-visibility [2] https://developer.android.com/codelabs/android-training-activity-with-implicit-intent?index=..%2F..android-training#3 [3] https://developer.android.com/training/package-visibility/use-cases#open-a-file [4] https://developer.android.com/reference/android/app/Activity#startActivityForResult(android.content.Intent,%20int) Change-Id: I7702b100d71333be2d78df1bc81ef2e5a7e016bd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133272 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2022-04-21android: Slightly improve style in use of arraysMichael Weghorn
Addresses these warnings shown in Android Studio for class `LibreOfficeUIActivity`: * "Unnecessary 'Arrays.asList()' call" * "Raw use of parameterized class 'ArrayList'" * "Explicit type argument ShortcutInfo can be replaced with <>" Change-Id: I083e5fcf804209fae704b19643ce80bc92126ca8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133271 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2022-04-21android: Drop unused import and extra semicolonMichael Weghorn
Change-Id: I19557b0b1d63698a31dac61ce9fde3ce07f86451 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133267 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>