summaryrefslogtreecommitdiff
path: root/sc/source/filter/excel
AgeCommit message (Collapse)Author
2020-01-28New loplugin:unsignedcompareStephan Bergmann
"Find explicit casts from signed to unsigned integer in comparison against unsigned integer, where the cast is presumably used to avoid warnings about signed vs. unsigned comparisons, and could thus be replaced with o3tl::make_unsigned for clairty." (compilerplugins/clang/unsignedcompare.cxx) o3tl::make_unsigned requires its argument to be non-negative, and there is a chance that some original code like static_cast<sal_uInt32>(n) >= c used the explicit cast to actually force a (potentially negative) value of sal_Int32 to be interpreted as an unsigned sal_uInt32, rather than using the cast to avoid a false "signed vs. unsigned comparison" warning in a case where n is known to be non-negative. It appears that restricting this plugin to non- equality comparisons (<, >, <=, >=) and excluding equality comparisons (==, !=) is a useful heuristic to avoid such false positives. The only remainging false positive I found was 0288c8ffecff4956a52b9147d441979941e8b87f "Rephrase cast from sal_Int32 to sal_uInt32". But which of course does not mean that there were no further false positivies that I missed. So this commit may accidentally introduce some false hits of the assert in o3tl::make_unsigned. At least, it passed a full (Linux ASan+UBSan --enable-dbgutil) `make check && make screenshot`. It is by design that o3tl::make_unsigned only accepts signed integer parameter types (and is not defined as a nop for unsigned ones), to avoid unnecessary uses which would in general be suspicious. But the STATIC_ARRAY_SELECT macro in include/oox/helper/helper.hxx is used with both signed and unsigned types, so needs a little oox::detail::make_unsigned helper function for now. (The ultimate fix being to get rid of the macro in the first place.) Change-Id: Ia4adc9f44c70ad1dfd608784cac39ee922c32175 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87556 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-01-26Use properly typed variable for iterationStephan Bergmann
Change-Id: Ifb81145c7238ef6b4916e0ef0984c9b868319aec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87451 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-01-26remove some unused local varsNoel Grandin
found by a more aggressive variant of loplugin:unusedvariables. This is my first pass, committing the simplest and most obviously unnecessary vars Change-Id: I9676a6e39a101937097788548764506c93811c57 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87414 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-24loplugin:makeshared in scNoel Grandin
Change-Id: Ie287b5c11a1276c56f416f17ea69cddd5992b4a2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87326 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-15tweak GetBitmap methods in BitmapExNoel Grandin
so we return a const& for the normal case, just like other methods, which reduces copying. This revealed that CreateDisplayBitmap in Bitmap can be const. Change-Id: I9f9b9ff0c52d7e95eaae62af152218be8847dd63 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86836 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-15clang-tidy modernize-concat-nested-namespace in scNoel Grandin
Change-Id: I6a9b2b912434c053e20ce06ef03e52451e506693 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86804 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-10use more std::make_sharedNoel Grandin
found using 'git grep', I tried using clang-tidy, but it only successfully found a tiny fraction of these Change-Id: I61c7d85105ff7a911722750e759d6641d578da33 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86526 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-06Removed redundant semicolonsAndrea Gelmini
Change-Id: Ife14b8c3f7d121deb390deb5f405dd42d3016acf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86156 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-12-31tdf#120502: Excel doesn't increment max column for OOXMLMike Kaganski
This is obviously a result of copy-paste from XclExpColinfo::WriteBody (where that increment existed at least since commit 92d8c6d6c4dc2a2824a0e24e22485361c3b65b54 from 2004). Implementing OOXML export, authors of commit 64274b38f6cc50a8bb49f114f1ac9e7c1c3b3c4f likely forgot to remove this after copying the code to XclExpColinfo::SaveXml. This change removes the copy-pasted code incrementing column number for the last possible column. Change-Id: Ie2f043c4910568731cac90d89ec791ecbc8565b5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86046 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-12-30Document what is discovered about XclTools::GetXclDefColWidthCorrectionMike Kaganski
This is based only on "reverse-engineering" of the formula, and is not necessarily correct. Change-Id: I2fa09e07e38de6c706cc6bf4ede7da4f04cb7c54 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85994 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-12-22sal_Char->char in scNoel Grandin
Change-Id: I7e212a36898e71b03db88053647bfeee12a49cb5 Reviewed-on: https://gerrit.libreoffice.org/85690 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-14sc: rowcol: tdf#50916 convert Valid* methodsNoel Grandin
which means we end up passing around ScDocument* __everywhere__ Change-Id: I44d235ca5e9d57519f068b6880ee7d66f3ceb529 Reviewed-on: https://gerrit.libreoffice.org/83548 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-13sc: rowcol: tdf#50916 pass ScDocument* around in filter/Noel Grandin
Change-Id: Id328ee85b852eddf755876d2cde9ef75b40cfca1 Reviewed-on: https://gerrit.libreoffice.org/85090 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-12sc: rowcol: tdf#50916 pass ScDocument to the token classesNoel Grandin
needed to create a fake ScDocument for the external ref manager, since it has no ScDocument at all Change-Id: Ia786ac291133e3c438694e81ecfb2590729a853d Reviewed-on: https://gerrit.libreoffice.org/85050 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-12This shall presumably be ScVerticalStackCellStephan Bergmann
(changed from SfxBoolItem(ATTR_STACKED,...) in 2579895f2c18fd7d606715f91b1463900f6d6937 "Related: tdf#129300 add ScVerticalStackCell to provide a description") Change-Id: I665f5c0a7f5059721e38330e06ce52bd18eae362 Reviewed-on: https://gerrit.libreoffice.org/85062 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-12-12Remove some redundant user-provided dtorsStephan Bergmann
...which silences various -Wdeprecated-copy-dtor warnings from Clang 10 trunk about copy functions being implicitly defined as non-deleted even though the class has a user-declared dtor Change-Id: I3409d403c3c709de4ad94eccbc2d7869e41847cc Reviewed-on: https://gerrit.libreoffice.org/85032 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-12-11Related: tdf#129300 add ScIndentItem to provide a descriptionCaolán McNamara
Change-Id: Ieb1a12f35cf8974c557c6e52eac0cd9fb7f80914 Reviewed-on: https://gerrit.libreoffice.org/84945 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-12-11Related: tdf#129300 add ScLineBreakCell to provide a descriptionCaolán McNamara
Change-Id: Ief739616163c68e0e30d6287fdac90c1bcc9d13f Reviewed-on: https://gerrit.libreoffice.org/84879 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-12-11Related: tdf#129300 add ScVerticalStackCell to provide a descriptionCaolán McNamara
Change-Id: I8ed99f19ff6f4751c0867147fc1a60ac917f083b Reviewed-on: https://gerrit.libreoffice.org/84876 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-12-10Fix typoAndrea Gelmini
Change-Id: Ie01e25b3fd2eac9b3902febc2b584b9517bd6f3d Reviewed-on: https://gerrit.libreoffice.org/84897 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2019-12-10Related: tdf#129300 add ScShrinkToFitCell to provide a descriptionCaolán McNamara
Change-Id: I628562f1013825e5ba3c0daaf5ee6b098616b6d0 Reviewed-on: https://gerrit.libreoffice.org/84866 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-12-10Related: tdf#129300 add ScRotateValueItem description in degreesCaolán McNamara
by inheriting from SdrAngleItem Change-Id: Ifcaf46b12d685e683984e15ba2264c191c0d1e5f Reviewed-on: https://gerrit.libreoffice.org/84847 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-12-07rename ScEditEngineDefaulter::SetTextCaolán McNamara
so its clear that it is not an override of baseclass EditEngine::SetText Change-Id: I85ee9c9b212fe9248fb7e5fcb1ec83679ffb633d Reviewed-on: https://gerrit.libreoffice.org/84553 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-12-01Introduce o3tl::optional as an alias for std::optionalStephan Bergmann
...with a boost::optional fallback for Xcode < 10 (as std::optional is only available starting with Xcode 10 according to <https://en.cppreference.com/w/cpp/compiler_support>, and our baseline for iOS and macOS is still Xcode 9.3 according to README.md). And mechanically rewrite all code to use o3tl::optional instead of boost::optional. One immediate benefit is that disabling -Wmaybe-uninitialized for GCC as per fed7c3deb3f4ec81f78967c2d7f3c4554398cb9d "Slience bogus -Werror=maybe-uninitialized" should no longer be necessary (and whose check happened to no longer trigger for GCC 10 trunk, even though that compiler would still emit bogus -Wmaybe-uninitialized for uses of boost::optional under --enable-optimized, which made me ponder whether this switch from boost::optional to std::optional would be a useful thing to do; I keep that configure.ac check for now, though, and will only remove it in a follow up commit). Another longer-term benefit is that the code is now already in good shape for an eventual switch to std::optional (a switch we would have done anyway once we no longer need to support Xcode < 10). Only desktop/qa/desktop_lib/test_desktop_lib.cxx heavily uses boost::property_tree::ptree::get_child_optional returning boost::optional, so let it keep using boost::optional for now. After a number of preceding commits have paved the way for this change, this commit is completely mechanical, done with > git ls-files -z | grep -vz -e '^bin/find-unneeded-includes$' -e '^configure.ac$' -e '^desktop/qa/desktop_lib/test_desktop_lib.cxx$' -e '^dictionaries$' -e '^external/' -e '^helpcontent2$' -e '^include/IwyuFilter_include.yaml$' -e '^sc/IwyuFilter_sc.yaml$' -e '^solenv/gdb/boost/optional.py$' -e '^solenv/vs/LibreOffice.natvis$' -e '^translations$' -e '\.svg$' | xargs -0 sed -i -E -e 's|\<boost(/optional)?/optional\.hpp\>|o3tl/optional.hxx|g' -e 's/\<boost(\s*)::(\s*)(make_)?optional\>/o3tl\1::\2\3optional/g' -e 's/\<boost(\s*)::(\s*)none\>/o3tl\1::\2nullopt/g' (before committing include/o3tl/optional.hxx, and relying on some GNU features). It excludes some files where mention of boost::optional et al should apparently not be changed (and the sub-repo directory stubs). It turned out that all uses of boost::none across the code base were in combination with boost::optional, so had all to be rewritten as o3tl::nullopt. Change-Id: Ibfd9f4b3d5a8aee6e6eed310b988c4e5ffd8b11b Reviewed-on: https://gerrit.libreoffice.org/84128 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-11-30Rewrite uses of boost::optionalStephan Bergmann
...to only use functions that are also available for std::optional (in preparation for changing from boost::optional to std::optional): * uses of get are replaced with operator * or operator -> * uses of is_initialized are replaced with operator bool * uses of reset with an argument are replace with operator = (All of the replacements are also available for boost::optional "since forever", so this change should not break builds against old --with-system-boost. An alternative replacement for is_initialized would have been has_value, but that is only available since Boost 1.68.) Change-Id: I532687b6a5ee37dab28befb8e0eb05c22cbecf0f Reviewed-on: https://gerrit.libreoffice.org/84124 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-11-28merge LOTUS_ROOT into LotusContextNoel Grandin
since they are serving the same purpose. In the process getting rid of a duplicate ScDocument* that was sometimes set and sometimes not, causing trouble for me in another patch Change-Id: I2ceeb6d6e34b62616065bf4840a87bd87d2c3844 Reviewed-on: https://gerrit.libreoffice.org/83990 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-11-24tdf#128976: properly calculate default value when writing XLSMike Kaganski
XLS stores default column width as 16-bit unsigned integer in the range from 0 to 255 inclusive ([MS-XLS] 2.4.89 DefColWidth), unlike in OOXML where any floating-point value is valid. Additionally, some correction is used, introduced in commit 555d702903fb0857122024e1ab78a72d122d3f16 (basis of empirical formula in XclTools::GetXclDefColWidthCorrection is unclear). So in XLS, when the default is calculated, we need to take into account if the resulting stored value will actually represent our calculated value. If not, then just ignore the calculated value, and use arbitrary 8 as the default. With that, following IsDefWidth will correctly check if passed width is represented by the stored default or not. All widths that can't be represented as integral count chars in DefColWidth will have fUserSet set in corresponding ColInfo records, thus correctly keeping widths. Change-Id: Iedcc5583c861f5b18a422a9b279c48cff729cbc5 Reviewed-on: https://gerrit.libreoffice.org/83613 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-11-22Extend loplugin:external to warn about classesStephan Bergmann
...following up on 314f15bff08b76bf96acf99141776ef64d2f1355 "Extend loplugin:external to warn about enums". Cases where free functions were moved into an unnamed namespace along with a class, to not break ADL, are in: filter/source/svg/svgexport.cxx sc/source/filter/excel/xelink.cxx sc/source/filter/excel/xilink.cxx svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx All other free functions mentioning moved classes appear to be harmless and not give rise to (silent, even) ADL breakage. (One remaining TODO in compilerplugins/clang/external.cxx is that derived classes are not covered by computeAffectedTypes, even though they could also be affected by ADL-breakage--- but don't seem to be in any acutal case across the code base.) For friend declarations using elaborate type specifiers, like class C1 {}; class C2 { friend class C1; }; * If C2 (but not C1) is moved into an unnamed namespace, the friend declaration must be changed to not use an elaborate type specifier (i.e., "friend C1;"; see C++17 [namespace.memdef]/3: "If the name in a friend declaration is neither qualified nor a template-id and the declaration is a function or an elaborated-type-specifier, the lookup to determine whether the entity has been previously declared shall not consider any scopes outside the innermost enclosing namespace.") * If C1 (but not C2) is moved into an unnamed namespace, the friend declaration must be changed too, see <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71882> "elaborated-type-specifier friend not looked up in unnamed namespace". Apart from that, to keep changes simple and mostly mechanical (which should help avoid regressions), out-of-line definitions of class members have been left in the enclosing (named) namespace. But explicit specializations of class templates had to be moved into the unnamed namespace to appease <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92598> "explicit specialization of template from unnamed namespace using unqualified-id in enclosing namespace". Also, accompanying declarations (of e.g. typedefs or static variables) that could arguably be moved into the unnamed namespace too have been left alone. And in some cases, mention of affected types in blacklists in other loplugins needed to be adapted. And sc/qa/unit/mark_test.cxx uses a hack of including other .cxx, one of which is sc/source/core/data/segmenttree.cxx where e.g. ScFlatUInt16SegmentsImpl is not moved into an unnamed namespace (because it is declared in sc/inc/segmenttree.hxx), but its base ScFlatSegmentsImpl is. GCC warns about such combinations with enabled-by-default -Wsubobject-linkage, but "The compiler doesn’t give this warning for types defined in the main .C file, as those are unlikely to have multiple definitions." (<https://gcc.gnu.org/onlinedocs/gcc-9.2.0/gcc/Warning-Options.html>) The warned-about classes also don't have multiple definitions in the given test, so disable the warning when including the .cxx. Change-Id: Ib694094c0d8168be68f8fe90dfd0acbb66a3f1e4 Reviewed-on: https://gerrit.libreoffice.org/83239 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-11-19cid#1448453 Untrusted value as argumentCaolán McNamara
Change-Id: I41a2f30df22b54e51acb593f340cb1ecf1c497b6 Reviewed-on: https://gerrit.libreoffice.org/83037 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-11-16cid#1448453 Untrusted value as argumentCaolán McNamara
coverity doesn't warn about XclImpString::ReadFormats Change-Id: Ide6285f39fed09a1767c2a2272f30ec213a20106 Reviewed-on: https://gerrit.libreoffice.org/82993 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-11-14coverity#1242892 Untrusted value as argumentCaolán McNamara
Change-Id: Ia4fd0a270d42fc2da233da18d4122f786c79dc3d Reviewed-on: https://gerrit.libreoffice.org/82697 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-11-14cid#1455325 establish that pDoc cannot be null thereCaolán McNamara
Change-Id: Ia7bca1e74a8ede90e29ec6cbd63c7fdcaf25b072 Reviewed-on: https://gerrit.libreoffice.org/82696 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-11-11sc: rowcol: tdf#50916 convert mark data structuresNoel Grandin
Change-Id: I9b706c9bcc2925f72cc024142ffe72af5ddea82a Reviewed-on: https://gerrit.libreoffice.org/82419 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-11-06loplugin:indentation find broken if statementsNoel Grandin
so I don't read the "then" block as being a sequential statements Change-Id: Ib2004acd3518bd4ebd2246f02a26c2c0a8bbab4c Reviewed-on: https://gerrit.libreoffice.org/82069 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-11-03size some stringbuffer to prevent re-allocNoel Grandin
I started with 32 and kept doubling the size until the site did not need re-alloc, but clamped it at 512. Change-Id: I55fe36b31cd3d40f86e5729337a927cf920f2af6 Reviewed-on: https://gerrit.libreoffice.org/81960 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-11-02New loplugin:conditionalstringStephan Bergmann
Change-Id: I2eab990c15f845b44a3b598571aca361dadf9ff3 Reviewed-on: https://gerrit.libreoffice.org/81946 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-31crashtesting: null deref on import of fdo48634-1.xlsCaolán McNamara
Change-Id: If718c39d31ae214f02cbb747f0ceafd35b297521 Reviewed-on: https://gerrit.libreoffice.org/81843 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-10-29sc: rowcol: tdf#50916 convert core/toolNoel Grandin
Change-Id: I0fe5a7ef4a79d0832802945ce1b9da4752f1d5fc Reviewed-on: https://gerrit.libreoffice.org/81598 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-29remove XclRoot::GetDocRefNoel Grandin
duplicate of GetDoc Change-Id: I4b4d261684cbff4513a797b9b5af76f11737b980 Reviewed-on: https://gerrit.libreoffice.org/81635 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-25sc: rowcol: tdf#50916 convert filter/excel for the most partAron Budea
Change-Id: I8ae255de6fcd9d7fd379a48fb7e84adcbf7fa4ff TODO: pieces in frmbase.cxx, xestream.cxx and xistyle.cxx Reviewed-on: https://gerrit.libreoffice.org/81486 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-25tdf#126021 speed up saving xls with lots of stylesNoel Grandin
extend the find-map so we can do partial-match searching. Makes it 10x faster for me. Change-Id: I1952a221a919707af078fac9fd1eb63781d9188d Reviewed-on: https://gerrit.libreoffice.org/81488 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-21loplugin:virtualdead unused param in ProcessClientAnchor2Noel Grandin
Change-Id: Ic766fcc1bfd33d891edc1da87e1b35a8efba169a Reviewed-on: https://gerrit.libreoffice.org/81217 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-20ofz#18301 Timeout in xlsfuzzerCaolán McNamara
Change-Id: I7e18899fe2c0ef2d1b553bbbaab383e7ea9f1451 Reviewed-on: https://gerrit.libreoffice.org/81171 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-10-17loplugin:buffereadd find stuff involving adding *StringBufferNoel Grandin
and create conversion methods on *StringBuffer to make this work Change-Id: I3cf5ee3e139826168894b46eff8ee4bcde00cb7e Reviewed-on: https://gerrit.libreoffice.org/80949 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-17Don't use uninitialized memory when reading from the stream failsStephan Bergmann
Valgrind'ing CppunitTest_sc_filters_test failed with > Conditional jump or move depends on uninitialised value(s) > at 0x21175CE0: XclRange::GetColCount() const (/sc/source/filter/inc/xladdress.hxx:73) > by 0x2117048D: ImportExcel::ReadDimensions() (/sc/source/filter/excel/impop.cxx:248) > by 0x21188E78: ImportExcel8::Read() (/sc/source/filter/excel/read.cxx:1108) > by 0x21123C3F: ScFormatFilterPluginImpl::ScImportExcel(SfxMedium&, ScDocument*, EXCIMPFORMAT) (/sc/source/filter/excel/excel.cxx:137) [...] when loading sc/qa/unit/data/xls/pass/CVE-2006-3086-1.xls. As there appears to be no error-handling concept in ImportExcel::ReadDimensions, at least zero-initialize the relevant variables. Change-Id: I11dbd2a1032ecc723f65a563ef022d7eb3c970ff Reviewed-on: https://gerrit.libreoffice.org/80948 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-17Remove some memset callsMike Kaganski
Replace them with default initialization or calloc Change-Id: I747f53c2ced2d0473fd5a5ede4f8520a0633dcc1 Reviewed-on: https://gerrit.libreoffice.org/80805 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-17Rename OUStringLiteral1 to OUStringCharStephan Bergmann
It started out as a wrapper around character literals, but has by now become a wrapper around arbitrary single characters. Besides updating the documentation, this change is a mechanical for i in $(git grep -Fl OUStringLiteral1); do sed -i -e s/OUStringLiteral1/OUStringChar/g "$i"; done Change-Id: I1b9eaa4b3fbc9025ce4a4bffea3db1c16188b76f Reviewed-on: https://gerrit.libreoffice.org/80892 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-16loplugin:bufferadd loosen some constraintsNoel Grandin
and extend O*StringView to have a constructor that takes a pointer and a length Change-Id: I6120e96280f030757e855a6596efdae438b7e1e8 Reviewed-on: https://gerrit.libreoffice.org/80872 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-15new loplugin:bufferaddNoel Grandin
look for OUStringBuffer append sequences that can be turned into creating an OUString with + operations Change-Id: Ica840dc096000307b4a105fb4d9ec7588a15ade6 Reviewed-on: https://gerrit.libreoffice.org/80809 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-11ofz#15997 TimeoutCaolán McNamara
Change-Id: Ib7f4649bcaeb35a7eb756e35e1f9656fdc4d3df6 Reviewed-on: https://gerrit.libreoffice.org/80645 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>