path: root/test/source/sheet
AgeCommit message (Collapse)AuthorFilesLines
2022-10-24UnoApiTest: factor out common codeXisco Fauli1-4/+1
Change-Id: Ia8874d65ea8d7eb26d10b18e37ba2bac1a7d756b Reviewed-on: Tested-by: Jenkins Reviewed-by: Xisco Fauli <>
2022-10-06[API CHANGE] Resolves tdf#131136 - Remove option "Use printer metrics"Heiko Tietze1-1/+0
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: Tested-by: Jenkins Reviewed-by: Michael Stahl <> Reviewed-by: Heiko Tietze <>
2022-05-03Just use Any ctor instead of makeAny in testStephan Bergmann1-1/+1
Change-Id: I926cabc8be39344ec254e87b429f4d1bc8cfc94f Reviewed-on: Tested-by: Jenkins Reviewed-by: Stephan Bergmann <>
2022-05-03tdf#99708 Save formula bar height to documentSamuel Mehrbrodt1-0/+10
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: Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <>
2021-11-29tdf#132145: Synchronize ScAppCfg with configurationMike Kaganski1-36/+13
Change-Id: Iadf5ff86d043f63355fd30816a9e2011479465c0 Reviewed-on: Tested-by: Jenkins Reviewed-by: Mike Kaganski <>
2021-11-28tdf#132145: Synchronize ScPrintCfg with configurationMike Kaganski1-44/+30
Change-Id: I903e8277fea5c223081244ae30dff31bbda7d554 Reviewed-on: Tested-by: Jenkins Reviewed-by: Mike Kaganski <>
2021-11-27tdf#132145: Synchronize ScInputCfg with configurationMike Kaganski1-103/+58
Change-Id: I45cc9b6c8cbd9205e185bebff97644f53f5cf0af Reviewed-on: Tested-by: Jenkins Reviewed-by: Mike Kaganski <>
2021-10-31Prepare for removal of non-const operator[] from Sequence in testMike Kaganski17-78/+76
Change-Id: I9f2c0deda676b10377b0a4572d26422cb0d8b807 Reviewed-on: Tested-by: Jenkins Reviewed-by: Mike Kaganski <>
2021-10-15Remove non-const Sequence::begin()/end() in internal codeMike Kaganski1-1/+1
... 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: Tested-by: Jenkins Reviewed-by: Stephan Bergmann <> Reviewed-by: Mike Kaganski <>
2021-10-14Avoid COW overhead using css::uno::SequenceMike Kaganski1-1/+1
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: Tested-by: Jenkins Reviewed-by: Mike Kaganski <>
2021-10-09Typo: *adress* -> *address* (except from not translated German parts)Julien Nabet1-21/+21
Change-Id: I62e12aed5bc67119433c39ff333f69b79944dca3 Reviewed-on: Tested-by: Jenkins Reviewed-by: Julien Nabet <>
2021-10-02tdf#144758: default value for 'table:orientation' attribute is 'row'Mike Kaganski1-1/+1
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: Tested-by: Mike Kaganski <> Reviewed-by: Mike Kaganski <>
2021-07-11editengine-columns: tdf#143258 Fix handling rotated textMike Kaganski1-1/+1
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: Tested-by: Jenkins Reviewed-by: Mike Kaganski <>
2021-06-08editengine-columns: Implement layoutMike Kaganski1-1/+1
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: Tested-by: Jenkins Reviewed-by: Mike Kaganski <>
2021-04-09tdf#119457 - check for a valid range name and cell referenceAndreas Heinisch1-0/+7
Change-Id: If23eda52142ba5e59cfd354f2177b1ac1727efaa Reviewed-on: Tested-by: Jenkins Reviewed-by: Andreas Heinisch <>
2021-03-25const OUString -> const OUStringLiteralMike Kaganski5-20/+20
Mostly automated rewrite Change-Id: Ie020a083f898bc126b8fb039d4ecb2e687172da1 Reviewed-on: Tested-by: Jenkins Reviewed-by: Mike Kaganski <>
2021-03-05tdf#139734 Remove redundant asserts after functions loadFromDesktop and loadMoaz1-3/+0
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: Tested-by: Jenkins Reviewed-by: Mike Kaganski <>
2021-02-17loplugin:referencecasting in test..toolkitNoel1-4/+2
Change-Id: Ia290ff4849f4d7eda978c7b1e2c7f36de744056f Reviewed-on: Tested-by: Jenkins Reviewed-by: Noel Grandin <>
2021-02-08Improve loplugin:cppunitassertequal for CPPUNIT_ASSERT(a && b)Stephan Bergmann1-2/+2 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: Tested-by: Jenkins Reviewed-by: Stephan Bergmann <>
2020-12-11Strength-reduce some OUStringToOString("..."+...)Stephan Bergmann1-1/+1 "..."+OUStringToOString(...), in preparation of making OUStringToOString take a std::u16string_view Change-Id: Ic01ca249d4d0eb58ac959ffdf96471308a3715dc Reviewed-on: Tested-by: Jenkins Reviewed-by: Stephan Bergmann <>
2020-11-18tdf#123936 Formatting files in module test with clang-formatPhilipp Hofer13-131/+111
Change-Id: I8b2cc4917564626432ce0219e24f253a534ce8e8 Reviewed-on: Tested-by: Jenkins Reviewed-by: Christian Lohmaier <>
2020-11-17loplugin:stringviewparam check methods tooNoel1-1/+1
not just functions Change-Id: Icca295dd159002b428b73f2c95d40725434f04d9 Reviewed-on: Tested-by: Jenkins Reviewed-by: Noel Grandin <>
2020-10-31Improve 'resize with cell' handlingRegina Henschel1-1/+1
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: Tested-by: Jenkins Reviewed-by: Regina Henschel <>
2020-09-26Fix typo in codeAndrea Gelmini1-2/+2
It passed "make check" on Linux Change-Id: Ia508a9968a21fc8e316a3ec5bb1aa204c4dfc2c5 Reviewed-on: Tested-by: Jenkins Reviewed-by: Julien Nabet <>
2020-09-22OUStringLiteral/OStringLiteral coverity PARSE_ERROR workaroundCaolán McNamara1-6/+6
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: Tested-by: Jenkins Reviewed-by: Caolán McNamara <>
2020-08-31Fix typo in codeAndrea Gelmini1-3/+3
It passed "make check" on Linux Change-Id: Ia1fbd635d7d13c69c9b8911eadaa86ee5f7aadb6 Reviewed-on: Reviewed-by: Julien Nabet <> Tested-by: Jenkins
2020-08-28Change OUStringLiteral from char[] to char16_t[]Stephan Bergmann2-9/+9
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: Tested-by: Jenkins Reviewed-by: Stephan Bergmann <>
2020-08-13loplugin:stringstatic also look for local staticsNoel Grandin1-12/+10
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: Tested-by: Jenkins Reviewed-by: Noel Grandin <>
2020-08-11loplugin:flattenNoel Grandin1-14/+12
Change-Id: I6560756eb63856a22b43e3e65a7b7843cd2d5376 Reviewed-on: Tested-by: Jenkins Reviewed-by: Noel Grandin <>
2020-07-02Upcoming improved loplugin:staticanonymous -> redundantstatic: testStephan Bergmann1-3/+3
Change-Id: I7926d0fef411337e637bca6d0f18ea75a12dc522 Reviewed-on: Tested-by: Jenkins Reviewed-by: Stephan Bergmann <>
2020-06-05Upcoming loplugin:elidestringvar: testStephan Bergmann5-34/+16
Change-Id: Id28d83963443e85bf8309bf41fa28140c4070af8 Reviewed-on: Tested-by: Jenkins Reviewed-by: Stephan Bergmann <>
2020-05-29Fix order of some CPPUNIT_ASSERT_EQUAL argumentsStephan Bergmann1-4/+4
"aExpectedContent" apparently denotes the expected value, which goes first. Change-Id: I3d902cb9bd4bbd19e466dd53e68130857b3be7c0 Reviewed-on: Tested-by: Jenkins Reviewed-by: Stephan Bergmann <>
2020-05-10Fix typoAndrea Gelmini1-1/+1
Change-Id: I5fe3a2891a0af26ce17d8e151ce68df38cfcc824 Reviewed-on: Tested-by: Jenkins Reviewed-by: Julien Nabet <>
2020-04-26Fix typo in codeAndrea Gelmini1-1/+1
Change-Id: I4709f3fd11c8d5800efab65b6f9533cbad3ffe78 Reviewed-on: Tested-by: Jenkins Reviewed-by: Julien Nabet <>
2020-03-05Fix typoAndrea Gelmini1-3/+3
Change-Id: Id1adbd647f8be20fa3ccd4d07b879885e56ea776 Reviewed-on: Tested-by: Jenkins Reviewed-by: Julien Nabet <>
2020-03-03remove some dead codeNoel Grandin1-65/+0
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: Tested-by: Jenkins Reviewed-by: Noel Grandin <>
2020-02-10cppcheck: redundantInitialization in XSheetCondition::testGetSetOperator()Muhammet Kara1-1/+1
Change-Id: I0895478ec5bbb69cc8a7d88d848755aeabe7b51d Reviewed-on: Tested-by: Jenkins Reviewed-by: Muhammet Kara <>
2020-01-28New loplugin:unsignedcompareStephan Bergmann1-1/+2
"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: Tested-by: Jenkins Reviewed-by: Stephan Bergmann <>
2019-12-19tdf#42949 Fix IWYU warnings in test/Gabor Kelemen101-176/+99
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Id1ee9b6d44315443d023bdfbf9ae8e5aa2158ab2 Reviewed-on: Tested-by: Jenkins Reviewed-by: Miklos Vajna <>
2019-12-06Test results across all imported and inserted sheets.Eike Rathke1-0/+54
Change-Id: I573467a962a2835765cc5672b81cce4c7772ddff Reviewed-on: Reviewed-by: Eike Rathke <> Tested-by: Jenkins
2019-12-06Swap expected and actual valuesEike Rathke1-8/+8
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: Reviewed-by: Eike Rathke <> Tested-by: Jenkins
2019-12-06Use correct destination sheet instead of arbitrary leftover of expected nameEike Rathke1-2/+2
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: Reviewed-by: Eike Rathke <> Tested-by: Jenkins
2019-12-03Silence false -Werror=maybe-uninitializedStephan Bergmann1-7/+7
...where success of >>= has already been checked with CPPUNIT_ASSERT Change-Id: I9aa553749988b6b2e26d9a5ac5b376cc5997aba7 Reviewed-on: Tested-by: Jenkins Reviewed-by: Stephan Bergmann <>
2019-11-22Extend loplugin:external to warn about classesStephan Bergmann1-0/+3
...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 <> "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 <> "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." (<>) 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: Tested-by: Jenkins Reviewed-by: Stephan Bergmann <>
2019-10-17Rename OUStringLiteral1 to OUStringCharStephan Bergmann1-1/+1
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: Tested-by: Jenkins Reviewed-by: Stephan Bergmann <>
2019-10-14loplugin:stringadd look for unnecessary temporariesNoel Grandin1-1/+2
which defeat the *StringConcat optimisation. Also make StringConcat conversions treat a nullptr as an empty string, to match the O*String(char*) constructors. Change-Id: If45f5b4b6a535c97bfeeacd9ec472a7603a52e5b Reviewed-on: Tested-by: Jenkins Reviewed-by: Noel Grandin <>
2019-09-10Fix typosAndrea Gelmini1-4/+4
Change-Id: I263a4348774051626f57547f3fdab00a18a92f75 Reviewed-on: Reviewed-by: Julien Nabet <> Tested-by: Jenkins
2019-08-20loplugin:constvars in test..unotoolsNoel Grandin2-4/+4
Change-Id: I087dc53ca5c18893974bbd9d959de56d5a4cdfa0 Reviewed-on: Tested-by: Jenkins Reviewed-by: Noel Grandin <>
2019-08-15loplugin:sequenceloop in test..toolkitNoel Grandin5-8/+8
Change-Id: Ic8dad06c535b0af713bfe7cd46e601c8ea7ba6c7 Reviewed-on: Tested-by: Jenkins Reviewed-by: Noel Grandin <>
2019-08-12Fix typosAndrea Gelmini1-1/+1
Change-Id: Iedac37e0e056815e64294c70a233242df6dbf110 Reviewed-on: Tested-by: Jenkins Reviewed-by: Julien Nabet <>