sc/qa/unit/helper/qahelper.cxx | 38 ++++++++++++++++++++++++++++++++++++++ sc/source/core/data/dpoutput.cxx | 6 +++++- sc/source/ui/view/viewfun3.cxx | 2 ++ 3 files changed, 45 insertions(+), 1 deletion(-)
New commits: commit 3a51b402f243eb32b544c16813f682617d88c0b9 Author: luigiiucci <luigi.iu...@collabora.com> AuthorDate: Wed May 17 11:02:37 2023 +0200 Commit: Aron Budea <aron.bu...@collabora.com> CommitDate: Wed Jul 5 01:23:40 2023 +0200 Header columns can disappear with filtered data in pivot tables When we set on a pivot table a filter that filters all the rows, the pivot table showed only the first header columns and computed column, but all the columns headers should still be shown so we can adjust the filter for the column. This fixes this issue. Also add more debug output and prevent a crash when running pivot table tests. Change-Id: I30b4ee72cf8436c4522ab4ba0781462b214816dd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151871 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <qui...@gmail.com> (cherry picked from commit 3551d18404cb19cdaa8edb170a549f5c5405d0cb) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153686 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> diff --git a/sc/qa/unit/helper/qahelper.cxx b/sc/qa/unit/helper/qahelper.cxx index 9a5c5124cb08..99a8492ce87d 100644 --- a/sc/qa/unit/helper/qahelper.cxx +++ b/sc/qa/unit/helper/qahelper.cxx @@ -43,6 +43,7 @@ #include <scitems.hxx> #include <stringutil.hxx> #include <tokenarray.hxx> +#include <o3tl/safeint.hxx> #include <orcus/csv_parser.hpp> @@ -527,6 +528,43 @@ bool checkOutput( svl::GridPrinter printer(e.Row() - s.Row() + 1, e.Col() - s.Col() + 1, CALC_DEBUG_OUTPUT != 0); SCROW nOutRowSize = e.Row() - s.Row() + 1; SCCOL nOutColSize = e.Col() - s.Col() + 1; + + // Check if expected size iz smaller than actual size (and prevent a crash) + if (aCheck.size() < o3tl::make_unsigned(nOutRowSize) || aCheck[0].size() < o3tl::make_unsigned(nOutColSize)) + { + // Dump the arrays to console, so we can compare + std::cout << "Expected data:" << std::endl; + for (size_t nRow = 0; nRow < aCheck.size(); ++nRow) + { + for (size_t nCol = 0; nCol < aCheck[nRow].size(); ++nCol) + { + const char* p = aCheck[nRow][nCol]; + if (p) + { + OUString aCheckVal = OUString::createFromAscii(p); + std::cout << "'" << aCheckVal << "', "; + } + else + std::cout << "null, "; + } + std::cout << std::endl; + } + + std::cout << "Actual data:" << std::endl; + for (SCROW nRow = 0; nRow < nOutRowSize; ++nRow) + { + for (SCCOL nCol = 0; nCol < nOutColSize; ++nCol) + { + OUString aVal = pDoc->GetString(nCol + s.Col(), nRow + s.Row(), s.Tab()); + std::cout << "'" << aVal << "', "; + } + std::cout << std::endl; + } + std::cout << std::endl; + + return false; + } + for (SCROW nRow = 0; nRow < nOutRowSize; ++nRow) { for (SCCOL nCol = 0; nCol < nOutColSize; ++nCol) diff --git a/sc/source/core/data/dpoutput.cxx b/sc/source/core/data/dpoutput.cxx index bf2109b300a3..b8565852d511 100644 --- a/sc/source/core/data/dpoutput.cxx +++ b/sc/source/core/data/dpoutput.cxx @@ -600,7 +600,11 @@ ScDPOutput::ScDPOutput( ScDocument* pD, const uno::Reference<sheet::XDimensionsS case sheet::DataPilotFieldOrientation_ROW: { uno::Sequence<sheet::MemberResult> aResult = xLevRes->getResults(); - if (!lcl_MemberEmpty(aResult)) + // We want only to remove the DATA column if it is empty + // and not any other empty columns (to still show the + // header columns) + bool bSkip = lcl_MemberEmpty(aResult) && bIsDataLayout; + if (!bSkip) { ScDPOutLevelData tmp(nDim, nHierarchy, nLev, nDimPos, nNumFmt, aResult, aName, aCaption, bHasHiddenMember, bIsDataLayout, false); commit 0d38ec8443312398f81aa1eac57e97211018022d Author: Luigi Iucci <luigi.iu...@collabora.com> AuthorDate: Wed Jun 21 10:16:16 2023 +0200 Commit: Aron Budea <aron.bu...@collabora.com> CommitDate: Tue Jul 4 12:52:47 2023 +0200 problem pasting to calc an image copied from firefox (windows) Calc tries to paste the image as html. In case both HTML_SIMPLE and BITMAP flavors are present in the clipboard, we paste as BITMAP Change-Id: I2527bedf11eb6986b58329acaf360a397af03101 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153614 Tested-by: Jenkins Reviewed-by: Henry Castro <hcas...@collabora.com> (cherry picked from commit 46fa17b70db0d543518dde52908f46c85838ac12) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153668 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> (cherry picked from commit adaae622b67f525e0fb58af848a7cece8ac65f45) diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx index 6f9807755d0a..f2edeb4667f0 100644 --- a/sc/source/ui/view/viewfun3.cxx +++ b/sc/source/ui/view/viewfun3.cxx @@ -599,6 +599,8 @@ void ScViewFunc::PasteFromSystem() PasteFromSystem(SotClipboardFormatId::RICHTEXT); else if (aDataHelper.HasFormat(SotClipboardFormatId::HTML)) PasteFromSystem(SotClipboardFormatId::HTML); + else if (aDataHelper.HasFormat(SotClipboardFormatId::BITMAP)) + PasteFromSystem(SotClipboardFormatId::BITMAP); else if (aDataHelper.HasFormat(SotClipboardFormatId::HTML_SIMPLE)) PasteFromSystem(SotClipboardFormatId::HTML_SIMPLE); else if (aDataHelper.HasFormat(SotClipboardFormatId::SYLK))