sc/qa/unit/data/functions/spreadsheet/fods/getpivotdata.fods | 14 ++++++++--- sc/source/core/data/dpobject.cxx | 6 +++- sc/source/core/data/dpsave.cxx | 3 +- svl/source/items/stylepool.cxx | 2 - sw/source/filter/ww8/writerhelper.cxx | 2 - sw/source/filter/ww8/wrtw8nds.cxx | 2 - 6 files changed, 20 insertions(+), 9 deletions(-)
New commits: commit 86039563de87149a01ffb980b5ec99074b98fd5e Author: Luboš Luňák <[email protected]> AuthorDate: Sat May 14 16:52:09 2022 +0200 Commit: Luboš Luňák <[email protected]> CommitDate: Mon May 16 09:05:00 2022 +0200 std::stable_sort() where libc++ debug mode breaks a unittest Libc++ debug has a feature that randomizes equal elements during sort, which normally wouldn't make a difference, but some tests rely on specific order of tested data. The ones failing without this include: CppunitTest_sw_ooxmlexport testMsoPosition CppunitTest_sw_xhtmlexport testTdf66305 CppunitTest_sw_ww8export testCommentExport Change-Id: Id49846939a264150cc82091718ffe6b904d7130e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134337 Tested-by: Jenkins Reviewed-by: Luboš Luňák <[email protected]> diff --git a/svl/source/items/stylepool.cxx b/svl/source/items/stylepool.cxx index b74d0cb94729..dc992a6ede72 100644 --- a/svl/source/items/stylepool.cxx +++ b/svl/source/items/stylepool.cxx @@ -261,7 +261,7 @@ namespace { // Sort the parents using their name, if they have one. if (!rParentNames.empty()) { - std::sort(maParents.begin(), maParents.end(), + std::stable_sort(maParents.begin(), maParents.end(), [&rParentNames](const SfxItemSet* pA, const SfxItemSet* pB) { OUString aA; OUString aB; diff --git a/sw/source/filter/ww8/writerhelper.cxx b/sw/source/filter/ww8/writerhelper.cxx index 6c62af767ab0..9c3bae38f14d 100644 --- a/sw/source/filter/ww8/writerhelper.cxx +++ b/sw/source/filter/ww8/writerhelper.cxx @@ -838,7 +838,7 @@ namespace sw RedlineStack::~RedlineStack() { - std::sort(maStack.begin(), maStack.end(), CompareRedlines()); + std::stable_sort(maStack.begin(), maStack.end(), CompareRedlines()); std::for_each(maStack.begin(), maStack.end(), SetInDocAndDelete(mrDoc)); } diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index 3ff1326c24a7..da9c73099dae 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -220,7 +220,7 @@ SwWW8AttrIter::SwWW8AttrIter(MSWordExportBase& rWr, const SwTextNode& rTextNd) : Get list of any graphics which may be anchored from this paragraph. */ maFlyFrames = GetFramesInNode(rWr.m_aFrames, m_rNode); - std::sort(maFlyFrames.begin(), maFlyFrames.end(), sortswflys()); + std::stable_sort(maFlyFrames.begin(), maFlyFrames.end(), sortswflys()); /* #i18480# commit ca8614fc44e66308b846d01b8c0ab6a63cc93eb9 Author: Luboš Luňák <[email protected]> AuthorDate: Sun May 15 06:36:44 2022 +0200 Commit: Luboš Luňák <[email protected]> CommitDate: Mon May 16 09:04:46 2022 +0200 fix GETPIVOTDATA() field name lookup Field names are case-insensitive, so the lookup was failing if the name wasn't typed in a way that matched exactly as case-sensitive. The A29 field in getpivotdata.fods test was passing only because the fields were typed in the same order as present in the pivot table, and std::sort() was accidentally stable. But reordering the fields in the formula makes it fail, and so does using libc++ with debug mode (which randomizes equal fields in std::sort()). Change-Id: I88d078da435685c3557f24dc5f4a0bfc4d563aa6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134336 Tested-by: Jenkins Reviewed-by: Luboš Luňák <[email protected]> diff --git a/sc/qa/unit/data/functions/spreadsheet/fods/getpivotdata.fods b/sc/qa/unit/data/functions/spreadsheet/fods/getpivotdata.fods index 7ea70d7b3acf..b392f066bc2b 100644 --- a/sc/qa/unit/data/functions/spreadsheet/fods/getpivotdata.fods +++ b/sc/qa/unit/data/functions/spreadsheet/fods/getpivotdata.fods @@ -7906,9 +7906,17 @@ <table:table-cell table:number-columns-repeated="18"/> </table:table-row> <table:table-row table:style-name="ro2"> - <table:table-cell table:number-columns-repeated="2"/> - <table:table-cell table:style-name="ce14"/> - <table:table-cell table:number-columns-repeated="6"/> + <table:table-cell table:formula="of:=GETPIVOTDATA("Value";[.I30];"name";"mary";"type";"f") +" office:value-type="float" office:value="34" calcext:value-type="float"> + <text:p>34</text:p> + </table:table-cell> + <table:table-cell office:value-type="float" office:value="34" calcext:value-type="float"> + <text:p>34</text:p> + </table:table-cell> + <table:table-cell table:style-name="ce13" table:formula="of:=[.A41]=[.B41]" office:value-type="boolean" office:boolean-value="true" calcext:value-type="boolean"> + <text:p>TRUE</text:p> + </table:table-cell> + <table:table-cell table:number-columns-repeated="5"/> <table:table-cell table:style-name="ce21" table:number-columns-repeated="5"/> <table:table-cell table:number-columns-repeated="8"/> </table:table-row> diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx index efa77beb3377..b74fc5d7dfe5 100644 --- a/sc/source/core/data/dpobject.cxx +++ b/sc/source/core/data/dpobject.cxx @@ -1341,11 +1341,13 @@ public: { size_t nRank1 = mrDimOrder.size(); size_t nRank2 = mrDimOrder.size(); - ScDPSaveData::DimOrderType::const_iterator it1 = mrDimOrder.find(r1.FieldName); + ScDPSaveData::DimOrderType::const_iterator it1 = mrDimOrder.find( + ScGlobal::getCharClass().uppercase(r1.FieldName)); if (it1 != mrDimOrder.end()) nRank1 = it1->second; - ScDPSaveData::DimOrderType::const_iterator it2 = mrDimOrder.find(r2.FieldName); + ScDPSaveData::DimOrderType::const_iterator it2 = mrDimOrder.find( + ScGlobal::getCharClass().uppercase(r2.FieldName)); if (it2 != mrDimOrder.end()) nRank2 = it2->second; diff --git a/sc/source/core/data/dpsave.cxx b/sc/source/core/data/dpsave.cxx index d9bc8d722a8b..0f8bfbf11712 100644 --- a/sc/source/core/data/dpsave.cxx +++ b/sc/source/core/data/dpsave.cxx @@ -30,6 +30,7 @@ #include <sal/log.hxx> #include <osl/diagnose.h> #include <comphelper/stl_types.hxx> +#include <unotools/charclass.hxx> #include <com/sun/star/sheet/XDimensionsSupplier.hpp> #include <com/sun/star/sheet/DataPilotFieldAutoShowInfo.hpp> @@ -783,7 +784,7 @@ public: void operator() (const ScDPSaveDimension* pDim) { size_t nRank = mrNames.size(); - mrNames.emplace(pDim->GetName(), nRank); + mrNames.emplace(ScGlobal::getCharClass().uppercase(pDim->GetName()), nRank); } };
