summaryrefslogtreecommitdiff
path: root/test/source/sheet
AgeCommit message (Collapse)Author
2023-10-20Extended loplugin:ostr: Automatic rewrite O[U]StringLiteral: testStephan Bergmann
Change-Id: I883d34c9562b48d987a16a0254272f3aeeb4bf5a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158242 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-19Presumed loplugin:cppunitassertequalsStephan Bergmann
Change-Id: Ib8de8835d7ceb214bbf87d7cebfbb56723e8fb28 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158135 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-06-29tdf#73537 - sc: show author and creation date in calc commentsBalazs Varga
in temporory mode. Show the author and creation/modification date of the the comment only in temporory mode. In edit mode, or visible mode, shows only the original text. Change-Id: I2c5856e4c6a813dbef4ad55de319f922daa57f67 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153358 Tested-by: Jenkins Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com> Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de>
2023-06-26new loplugin:constexprliteralNoel Grandin
OUStringLiteral should be declared constexpr, to enforce that it is initialised at compile-time and not runtime. This seems to make a different at least on Visual Studio Change-Id: I1698f5fa22ddb480347c2f4d444530c2e0e88d92 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153499 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-05-23Don't even bother to introduce unused variablesStephan Bergmann
With <https://gerrit.libreoffice.org/c/core/+/152157> "More conservative SAL_WARN_UNUSED to avoid -Werror,-Wunused-private-field", these two cases would have started to cause "unused variable declaration [loplugin:casttovoid]" (because the call to isWarnUnusedType in compilerplugins/clang/casttovoid.cxx would no longer return true). Just avoid that by not introducing the variables in the first place. Change-Id: I3d2b085082555d1765fbd32045b5157deb0af67e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152158 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-04-14loplugin:stringviewparam improvementsNoel Grandin
improve the check by checking for methods that exclude using string_view, rather than checking for methods that __can__ use string_view, which leads to exposing some holes in our o3tl/string_view.hxx coverage. Change-Id: Ic9dd60441c671f502692f9cd2a1bb67301c4b960 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150277 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-03-13Use a more reasonable type for XDataPilotDescriptor::checkName nIndex parameterStephan Bergmann
Change-Id: If9e6760a6b23c63d03d337d6b111493684d67c85 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148568 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-02-16Only specialize CppUnit::assetion_traits<T>::toString member functionsStephan Bergmann
...not the whole CppUnit::assetion_traits<T> classes (where applicable). That avoids spelling out the (identical) equals member functions, and also leaves around the less and lessEqual member functions, in case they want to be used after all. Change-Id: I18f8d6cff0353921ced4952b33a0c85ff8292923 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147165 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-10-24UnoApiTest: factor out common codeXisco Fauli
Change-Id: Ia8874d65ea8d7eb26d10b18e37ba2bac1a7d756b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141730 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-10-06[API CHANGE] Resolves tdf#131136 - Remove option "Use printer metrics"Heiko Tietze
Option is out-dated and access via UI confusing * UI access removed from Tools > Options > General (Impress, Calc) resp. > Compatibility (Writer) * Unit tests updated * Tip-Of-The-Day cleaned-up * remove UsePrtMetrics value Change-Id: Ib645f6e1f648455e0536a437be14c2c6a7b25a49 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139863 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
2022-05-03Just use Any ctor instead of makeAny in testStephan Bergmann
Change-Id: I926cabc8be39344ec254e87b429f4d1bc8cfc94f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133763 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-03tdf#99708 Save formula bar height to documentSamuel Mehrbrodt
Save the current state of the Calc formula bar to the document. Number of visible lines is saved into the document settings and restored when loading that document. Also adds a UNO property, so that the formula bar height can be changed via UNO. Change-Id: Ifef0c9e42cb4f7465516629d2c22974367e0eb33 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133499 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
2021-11-29tdf#132145: Synchronize ScAppCfg with configurationMike Kaganski
Change-Id: Iadf5ff86d043f63355fd30816a9e2011479465c0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125990 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-11-28tdf#132145: Synchronize ScPrintCfg with configurationMike Kaganski
Change-Id: I903e8277fea5c223081244ae30dff31bbda7d554 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125904 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-11-27tdf#132145: Synchronize ScInputCfg with configurationMike Kaganski
Change-Id: I45cc9b6c8cbd9205e185bebff97644f53f5cf0af Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125896 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-31Prepare for removal of non-const operator[] from Sequence in testMike Kaganski
Change-Id: I9f2c0deda676b10377b0a4572d26422cb0d8b807 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124399 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-15Remove non-const Sequence::begin()/end() in internal codeMike Kaganski
... to avoid hidden cost of multiple COW checks, because they call getArray() internally. This obsoletes [loplugin:sequenceloop]. Also rename toNonConstRange to asNonConstRange, to reflect that the result is a view of the sequence, not an independent object. TODO: also drop non-const operator[], but introduce operator[] in SequenceRange. Change-Id: Idd5fd7a3400fe65274d2a6343025e2ef8911635d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123518 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-14Avoid COW overhead using css::uno::SequenceMike Kaganski
The scenarios are: 1. Calling sequence's begin() and end() in pairs to pass to algorithms (both calls use getArray(), which does the COW checks) 2. In addition to #1, calling end() again when checking result of find algorithms, and/or begin() to calculate result's distance 3. Using non-const sequences in range-based for loops, which internally do #1 4. Assigning sequence to another sequence variable, and then modifying one of them In many cases, the sequences could be made const, or treated as const for the purposes of the algorithms (using std::as_const, std::cbegin, and std::cend). Where algorithm modifies the sequence, it was changed to only call getArray() once. For that, css::uno::toNonConstRange was introduced, which returns a struct (sublclass of std::pair) with two iterators [begin, end], that are calculated using one call to begin() and one call to getLength(). To handle #4, css::uno::Sequence::swap was introduced, that swaps the internal pointer to uno_Sequence. So when a local Sequence variable should be assigned to another variable, and the latter will be modified further, it's now possible to use swap instead, so the two sequences are kept independent. The modified places were found by temporarily removing non-const end(). Change-Id: I8fe2787f200eecb70744e8b77fbdf7a49653f628 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123542 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-09Typo: *adress* -> *address* (except from not translated German parts)Julien Nabet
Change-Id: I62e12aed5bc67119433c39ff333f69b79944dca3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123318 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-10-02tdf#144758: default value for 'table:orientation' attribute is 'row'Mike Kaganski
See [OpenDocument-v1.3-part3] section 19.690.3 <table:database-range>. Regression after commit ed88b144ce24b9a733d4a9ab6614307c96537baa. Also fixes relevant part of unit test first introduced in commit 6069ef7976c4455c1875afecf02c41c5731f6546, which was at that time testing that IsSortColumns property returned false; then in commit fc95d20500997a1a460be6f3553727299a5080eb, the correct value was changed to true, reflecting the regression fixed here. Change-Id: I6a12a0ad13405bc388efb7c2c3bbf31e89905620 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122955 Tested-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-07-11editengine-columns: tdf#143258 Fix handling rotated textMike Kaganski
This reverts modifications to existing unit tests made in commit d0a1616ccad0dd5f5a02c1b0204f537b57d0b4b5. My idea that those changes were required because of more correct calculations was wrong, and in fact they were caused by off-by-1 error in height calculations. Change-Id: Ib94878a911238c977c35a8f8e3e5694cedc79a89 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118705 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-06-08editengine-columns: Implement layoutMike Kaganski
This changes the way how different parts access positions of lines and paragraphs. Now there is ImpEditEngine::IterateLineAreas, which performs uniform iteration over all ParaPortions and lines in order, calling a user-provided callback function for each portion and line; it passes all information about current portion, line, area, and column to the callback, and checks the return from the callback, to decide if it needs to continue iteration (in case when callback indicated that if doesn't need further data), and if it needs calling the callback for the rest of current portion's lines. This allows to have the code that calculates and iterates dimensions of lines in one central place, without the need to have duplicating logic in several places. One important exception is ImpEditEngine::Paint, which iterates without ImpEditEngine::IterateLineAreas, because it does many atomic paint operations in different points of iteration process, and implementing ImpEditEngine::IterateLineAreas to call callback in the required places would require increased complexity, which is left for a future change. To make that possible, ImpEditEngine::IterFlag should be extended to indicate additional requirements. Note that in fact, ImpEditEngine::Paint was taken as the model for implementation of ImpEditEngine::IterateLineAreas, with its detailed handling of all the vertical offsets like additional line spacing and interparagraph spacings that depend on context. The notable result of the centralization of the iteration code is slight change of heights reported by ImpEditEngine::CalcTextHeight. Previously it simply added all pre-calculated heights of portions, and not taking into account all the spacing handling that ImpEditEngine::Paint did, which was inconsistent (calculated height was different from painted height). Now ImpEditEngine::CalcTextHeight should provide more accurate results, which required small changes in the unit tests. Change-Id: I33cbb978deb974b314d36fda8674186a03991107 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116034 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-04-09tdf#119457 - check for a valid range name and cell referenceAndreas Heinisch
Change-Id: If23eda52142ba5e59cfd354f2177b1ac1727efaa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113341 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2021-03-25const OUString -> const OUStringLiteralMike Kaganski
Mostly automated rewrite Change-Id: Ie020a083f898bc126b8fb039d4ecb2e687172da1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112965 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-03-05tdf#139734 Remove redundant asserts after functions loadFromDesktop and loadMoaz
MacrosTest::loadFromDesktop itself asserts on its return value. Thus, the additional checks in unit tests are redundant, and only create noise unrelated to the tested functionality. SwModelTestBase::load calls SwModelTestBase::loadURL which calls loadFromDesktop from within. Change-Id: I30061bbc6e13e05f0cfbf17a7910926070b996f3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111547 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-02-17loplugin:referencecasting in test..toolkitNoel
Change-Id: Ia290ff4849f4d7eda978c7b1e2c7f36de744056f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110997 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-08Improve loplugin:cppunitassertequal for CPPUNIT_ASSERT(a && b)Stephan Bergmann
...by re-enabling the code temporarily #if'ed-out in a528392e71bc70136021be4e3d83732fccbb885e "Fixed/improved loplugin:cppunitassertequals" (and which then triggers lots of other lopglugin:cppunitassertequal CPPUNIT_ASSERT -> CPPUNIT_ASSERT_EQUAL warnings). For two css::uno::Reference equality comparisons in cppu/qa/test_any.cxx, it was more straightforward to rewrite them with an explicit call to operator == (which silences loplugin:cppunitassertequal) than to adapt them to CPPUNIT_ASSERT_EQUAL's requirement for arguments of identical types. In sc/qa/unit/ucalc_pivottable.cxx, ScDPItemData needs toString, which has been implemented trivially for now, but might want to combine that with the DEBUG_PIVOT_TABLE-only ScDPItemData::Dump. Change-Id: Iae6d09cf69bd4e52fe4411bba9e50c48e696291c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110546 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-12-11Strength-reduce some OUStringToOString("..."+...)Stephan Bergmann
...to "..."+OUStringToOString(...), in preparation of making OUStringToOString take a std::u16string_view Change-Id: Ic01ca249d4d0eb58ac959ffdf96471308a3715dc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107600 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-11-18tdf#123936 Formatting files in module test with clang-formatPhilipp Hofer
Change-Id: I8b2cc4917564626432ce0219e24f253a534ce8e8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105719 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2020-11-17loplugin:stringviewparam check methods tooNoel
not just functions Change-Id: Icca295dd159002b428b73f2c95d40725434f04d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105789 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-10-31Improve 'resize with cell' handlingRegina Henschel
The patch contains a larger rework of RecalcPos and connected areas and covers several bugs. Essentials in short: Move initialization from RecalcPos to own method and use it in ScXMLImport::endDocument Do not change hidden objects, which includes not setting width or height to zero, and be consistent in using object visibility. Special handling of vertical flipped customshapes. Repair anchor on import of line and measure line. ODF conformance: Create logical rectangle from anchor instead using size. Details: tdf#137044 ScDrawLayer::SetPageSize is called several times while loading a document. It includes a call to ScDrawLayer::RecalcPos for all cell anchored objects. An object gets initialized with the first call. Problem was, that the row heights were not finished at that time and anchor cells and offsets were partly calculated based on default cell height. That results in wrong height and offset of objects. The solution separates initialization from RecalcPos and puts it into an own method ScDrawLayer::InitializeCellAnchoredObj. This is then called from ScXMLImport::endDocument when row height settings are finished. The call to RecalcPos is not totally removed from SetPageSize but only excluded while loading, because it is needed for size changes after the document is loaded. tdf#137576 partly For measure lines and ordinary lines, which were anchored 'To cell (resize with cell)', LibreOffice has written wrong end-cell info to file. So reopening results in wrong lines. The geometry of lines is based on two points. Fortunatelly the combination of position of the cell, which contains the shape, and start and end points gives correct absolute position of these points. Solution is, to regenerate the initial ScDrawObjData infos from these points and do not use the stored end-cell info. For a total fix implementation of NbcSetSnapRect for SdrMeasureObj is needed, which is not included here. tdf#137020 Cell anchored shapes are contained in a cell in file. To determine size and position of the shape a rectangle is used, so defined, that after applying transformation you get the desired shape. In case of custom shapes, a vertical flip is not contained in the transformation but it is an attribute inside the shape and flip is done at the shape center and will not change the rectangle. This rectangle determines start and end addresses and offsets in ScDrawObjData in rNoRotatedAnchor. The info is used directly in XML export. It is correctly build while loading the file. But in case of vertical flipped custom shapes the logical rectangle of the shape has an additional 180deg rotation. Changing that behavior is currently out of scope. Therefore special handling of vertical flipped custom shapes was added. tdf#99549 ODF specifies that in case of existence of end-cell attribute, size attributes have to be ignored. But LO has based the logical rectangle on size. In addition it has written zero width and height in case of hidden row and cols. Result was, that objects are 'lost' on opening although they still exists in the file. With the patch the object size is recalculated from anchor on opening. tdf#137355, tdf#137044, tdf#115655 The old solution has recalculated the snap rectangle based on current state of hidden row or column. That has produced shapes of zero width or height and loss of offset in case start or end cell of the shape was hidden. In running LO it was partly offset by using cached infos in ScDrawObjData. That failed in case of save and reload. Solution is, to only change visible shapes. It is enough to adapt the shape when it becomes visible. That is introduced in RecalcPos and SetCellAnchoredFromPosition. tdf#137216 Shapes anchored to cell were not hidden, if the column of its anchor was hidden, and undo of hiding an image in a cell by hiding its column didn't work. Reason was, that the shapes were not set to hidden in the shapes geometry. Solution is to copy a similar part from SetRowHidden to SetColHidden. without bugreport, but detected while debugging LO has used a cell reference with bHiddenAsZero as true in shape export. That has resulted in wrong offsets. Unittest changes: Test::testGraphicsInGroup() ScShapeTest::testCustomShapeCellAnchoredRotatedShape() Set expected values so, that they correspond to anchor in file. ScFiltersTest::testLegacyCellAnchoredRotatedShape() FIXME is solved now and the test is adaped to reflect that. XSheetAnnotationShapeSupplier::testGetAnnotationShape() Expected value is adapted to the fact, that now annotation shape gets its position after optimal row height is applied. Change-Id: Iffee996054ebf79e04044da5520f8d1a8a48b7c1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104643 Tested-by: Jenkins Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
2020-09-26Fix typo in codeAndrea Gelmini
It passed "make check" on Linux Change-Id: Ia508a9968a21fc8e316a3ec5bb1aa204c4dfc2c5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103453 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-09-22OUStringLiteral/OStringLiteral coverity PARSE_ERROR workaroundCaolán McNamara
do more like commit 121771e37f7e2de41cd5643475861062bf25627b Date: Mon Sep 21 09:17:54 2020 +0200 Make some OUStringLiteral vars constexpr cause coverity can live with that Change-Id: I9efd7f848289c4865997a44c6780373068422227 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103147 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-08-31Fix typo in codeAndrea Gelmini
It passed "make check" on Linux Change-Id: Ia1fbd635d7d13c69c9b8911eadaa86ee5f7aadb6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101707 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins
2020-08-28Change OUStringLiteral from char[] to char16_t[]Stephan Bergmann
This is a prerequisite for making conversion from OUStringLiteral to OUString more efficient at least for C++20 (by replacing its internals with a constexpr- generated sal_uString-compatible layout with a SAL_STRING_STATIC_FLAG refCount, conditionally for C++20 for now). For a configure-wise bare-bones build on Linux, size reported by `du -bs instdir` grew by 118792 bytes from 1155636636 to 1155755428. In most places just a u"..." string literal prefix had to be added. In some places char const a[] = "..."; variables have been changed to char16_t, and a few places required even further changes to code (which prompted the addition of include/o3tl/string_view.hxx helper function o3tl::equalsIgnoreAsciiCase and the additional OUString::createFromAscii overload). For all uses of macros expanding to string literals, the relevant uses have been rewritten as u"" MACRO instead of changing the macro definitions. It should be possible to change at least some of those macro definitions (and drop the u"" from their call sites) in follow-up commits. Change-Id: Iec4ef1a057d412d22443312d40c6a8a290dc6144 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101483 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-08-13loplugin:stringstatic also look for local staticsNoel Grandin
Add some API to O*StringLiteral, to make it easier to use in some places that were using O*String Change-Id: I1fb93bd47ac2065c9220d509aad3f4320326d99e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100270 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-11loplugin:flattenNoel Grandin
Change-Id: I6560756eb63856a22b43e3e65a7b7843cd2d5376 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100447 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-02Upcoming improved loplugin:staticanonymous -> redundantstatic: testStephan Bergmann
Change-Id: I7926d0fef411337e637bca6d0f18ea75a12dc522 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97704 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-06-05Upcoming loplugin:elidestringvar: testStephan Bergmann
Change-Id: Id28d83963443e85bf8309bf41fa28140c4070af8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95580 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-05-29Fix order of some CPPUNIT_ASSERT_EQUAL argumentsStephan Bergmann
"aExpectedContent" apparently denotes the expected value, which goes first. Change-Id: I3d902cb9bd4bbd19e466dd53e68130857b3be7c0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95151 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-05-10Fix typoAndrea Gelmini
Change-Id: I5fe3a2891a0af26ce17d8e151ce68df38cfcc824 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93938 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-04-26Fix typo in codeAndrea Gelmini
Change-Id: I4709f3fd11c8d5800efab65b6f9533cbad3ffe78 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92927 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-03-05Fix typoAndrea Gelmini
Change-Id: Id1adbd647f8be20fa3ccd4d07b879885e56ea776 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89958 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-03-03remove some dead codeNoel Grandin
GpgComponentFactory is unused since: commit 06d7dbb3568889aa50f46d6307a39fa53a17313b Date: Sun May 21 14:28:57 2017 +0200 gpg4libre: share static xmlsec lib between nss and gpg tableautoformatfield.cxx should have been removed in: commit 5990beed9aba690ea9487e2c4a64615b7504a0a1 Date: Fri Aug 29 16:37:43 2014 +0200 Dead code xmlRow is unused since initial import Change-Id: Ief186e9ef46238cc8cdb49f4adde52a45a98cbc4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89830 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-02-10cppcheck: redundantInitialization in XSheetCondition::testGetSetOperator()Muhammet Kara
Change-Id: I0895478ec5bbb69cc8a7d88d848755aeabe7b51d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88350 Tested-by: Jenkins Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
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>
2019-12-19tdf#42949 Fix IWYU warnings in test/Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Id1ee9b6d44315443d023bdfbf9ae8e5aa2158ab2 Reviewed-on: https://gerrit.libreoffice.org/85171 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-12-06Test results across all imported and inserted sheets.Eike Rathke
Change-Id: I573467a962a2835765cc5672b81cce4c7772ddff Reviewed-on: https://gerrit.libreoffice.org/84669 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2019-12-06Swap expected and actual valuesEike Rathke
in CPPUNIT_ASSERT... the first parameter is the expected value and the second the actual value. Passing them swapped is confusing if the test is failing. Change-Id: I06f8f345d52c3743d10441aae6d8c943f9b49b41 Reviewed-on: https://gerrit.libreoffice.org/84635 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2019-12-06Use correct destination sheet instead of arbitrary leftover of expected nameEike Rathke
Tests are executed in sequence, inserting a sheet with each importSheetToCopy(), ended up with 'SheetToCopy_4' as the first sheet (last sheet inserted), but obtained "destination" values from sheet 'SheetToCopy' (the first sheet inserted) whatever may have happened to its references during the previous tests or by inserting more sheets in front of it. Instead of obtaining the destination sheet by name 'SheetToCopy', obtain it by index 0 where it was inserted We could also remove the inserted sheet after each test, but likely a cleaner approach would be to setup a fresh document to be inserted into for each test to avoid any side effects like names already being present from a previous insertion. Change-Id: I38f35ccac7d656026b6fec8d3c5faa68d6f4a642 Reviewed-on: https://gerrit.libreoffice.org/84631 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins