extra/libreoffice-fresh to 7.3.2-1

This commit is contained in:
David Beauchamp 2022-03-31 13:10:17 -04:00
parent c598956c83
commit 40dba555bc
2 changed files with 5 additions and 166 deletions

View file

@ -1,155 +0,0 @@
From e85d2140ae5e9a611754c29aa4e5cdb6ad7fcab0 Mon Sep 17 00:00:00 2001
From: Mike Kaganski <mike.kaganski@collabora.com>
Date: Wed, 23 Feb 2022 18:14:38 +0300
Subject: tdf#147611: fix indices
The maKeyState vector in ScSortParam is initialized with three elements,
and they are never removed. The code in ScVbaRange::Sort incorrectly used
1-based indices into that vector.
This was broken since commit a02b445c39d969fedc554fc2c500b88a27a13906
Author: Albert Thuswaldner <albert.thuswaldner@gmail.com>
Date: Tue Mar 20 19:38:29 2012 +0100
fdo#45747 remove the limitation to 3 sort entries in calc part1
It was fixed in commit 568d3912bf8ced76ecb9506bccc3bd361daba082
Author: Kohei Yoshida <kohei.yoshida@gmail.com>
Date: Wed Apr 04 15:30:35 2012 -0400
Cleanup. ScPivot(Collection) is no more.
but was restored by commit 3e887edcaacc5b0f5e35d682a259124648e84229
Author: Markus Mohrhard <markus.mohrhard@googlemail.com>
Date: Thu Apr 5 05:05:40 2012 +0200
Revert "Cleanup. ScPivot(Collection) is no more."
Change-Id: I009252e794c9365f0aef8a61daf9cbd40eca8b75
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130441
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130476
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
---
sc/qa/extras/macros-test.cxx | 64 +++++++++++++++++++++++++++++++++++++++++++
sc/source/ui/vba/vbarange.cxx | 6 ++--
2 files changed, 67 insertions(+), 3 deletions(-)
diff --git a/sc/qa/extras/macros-test.cxx b/sc/qa/extras/macros-test.cxx
index 559dd903e4eb..cd4d15f16e8d 100644
--- a/sc/qa/extras/macros-test.cxx
+++ b/sc/qa/extras/macros-test.cxx
@@ -22,6 +22,7 @@
#include <document.hxx>
#include <attrib.hxx>
#include <scitems.hxx>
+#include <sortparam.hxx>
#include <com/sun/star/sheet/XSpreadsheet.hpp>
@@ -74,6 +75,7 @@ public:
void testTdf130307();
void testTdf146742();
void testMacroButtonFormControlXlsxExport();
+ void testVbaRangeSort();
CPPUNIT_TEST_SUITE(ScMacrosTest);
CPPUNIT_TEST(testStarBasic);
@@ -107,6 +109,7 @@ public:
CPPUNIT_TEST(testTdf130307);
CPPUNIT_TEST(testTdf146742);
CPPUNIT_TEST(testMacroButtonFormControlXlsxExport);
+ CPPUNIT_TEST(testVbaRangeSort);
CPPUNIT_TEST_SUITE_END();
};
@@ -1333,6 +1336,67 @@ void ScMacrosTest::testTdf90278()
xDocSh->DoClose();
}
+void ScMacrosTest::testVbaRangeSort()
+{
+ auto xComponent = loadFromDesktop("private:factory/scalc");
+
+ css::uno::Reference<css::document::XEmbeddedScripts> xDocScr(xComponent, UNO_QUERY_THROW);
+ auto xLibs = xDocScr->getBasicLibraries();
+ auto xLibrary = xLibs->createLibrary("TestLibrary");
+ xLibrary->insertByName(
+ "TestModule",
+ uno::Any(OUString("Option VBASupport 1\n"
+ "Sub TestRangeSort\n"
+ " Range(Cells(1, 1), Cells(3, 1)).Select\n"
+ " Selection.Sort Key1:=Range(\"A1\"), Header:=False\n"
+ "End Sub\n")));
+
+ Any aRet;
+ Sequence<sal_Int16> aOutParamIndex;
+ Sequence<Any> aOutParam;
+
+ SfxObjectShell* pFoundShell = SfxObjectShell::GetShellFromComponent(xComponent);
+ ScDocShell* pDocSh = static_cast<ScDocShell*>(pFoundShell);
+ CPPUNIT_ASSERT(pDocSh);
+ ScDocument& rDoc = pDocSh->GetDocument();
+
+ rDoc.SetValue(ScAddress(0, 0, 0), 1.0);
+ rDoc.SetValue(ScAddress(0, 1, 0), 0.5);
+ rDoc.SetValue(ScAddress(0, 2, 0), 2.0);
+
+ // Without the fix in place, this call would have crashed in debug builds with failed assertion
+ ErrCode result = SfxObjectShell::CallXScript(
+ xComponent,
+ "vnd.sun.Star.script:TestLibrary.TestModule.TestRangeSort?language=Basic&location=document",
+ {}, aRet, aOutParamIndex, aOutParam);
+ CPPUNIT_ASSERT_EQUAL(ERRCODE_NONE, result);
+
+ CPPUNIT_ASSERT_EQUAL(0.5, rDoc.GetValue(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(1.0, rDoc.GetValue(ScAddress(0, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(2.0, rDoc.GetValue(ScAddress(0, 2, 0)));
+
+ // Change sheet's first param sorting order
+ ScSortParam aParam;
+ rDoc.GetSortParam(aParam, 0);
+ aParam.maKeyState[0].bAscending = false;
+ rDoc.SetSortParam(aParam, 0);
+
+ result = SfxObjectShell::CallXScript(
+ xComponent,
+ "vnd.sun.Star.script:TestLibrary.TestModule.TestRangeSort?language=Basic&location=document",
+ {}, aRet, aOutParamIndex, aOutParam);
+ CPPUNIT_ASSERT_EQUAL(ERRCODE_NONE, result);
+
+ // Without the fix in place, this test would have failed in non-debug builds with
+ // - Expected: 2
+ // - Actual : 0.5
+ CPPUNIT_ASSERT_EQUAL(2.0, rDoc.GetValue(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(1.0, rDoc.GetValue(ScAddress(0, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(0.5, rDoc.GetValue(ScAddress(0, 2, 0)));
+
+ pDocSh->DoClose();
+}
+
ScMacrosTest::ScMacrosTest()
: UnoApiTest("/sc/qa/extras/testdocuments")
{
diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx
index 75ae115ce9d4..28019615eb9d 100644
--- a/sc/source/ui/vba/vbarange.cxx
+++ b/sc/source/ui/vba/vbarange.cxx
@@ -3412,9 +3412,9 @@ ScVbaRange::Sort( const uno::Any& Key1, const uno::Any& Order1, const uno::Any&
// set up defaults
- sal_Int16 nOrder1 = aSortParam.maKeyState[1].bAscending ? excel::XlSortOrder::xlAscending : excel::XlSortOrder::xlDescending;
- sal_Int16 nOrder2 = aSortParam.maKeyState[2].bAscending ? excel::XlSortOrder::xlAscending : excel::XlSortOrder::xlDescending;
- sal_Int16 nOrder3 = aSortParam.maKeyState[3].bAscending ? excel::XlSortOrder::xlAscending : excel::XlSortOrder::xlDescending;
+ sal_Int16 nOrder1 = aSortParam.maKeyState[0].bAscending ? excel::XlSortOrder::xlAscending : excel::XlSortOrder::xlDescending;
+ sal_Int16 nOrder2 = aSortParam.maKeyState[1].bAscending ? excel::XlSortOrder::xlAscending : excel::XlSortOrder::xlDescending;
+ sal_Int16 nOrder3 = aSortParam.maKeyState[2].bAscending ? excel::XlSortOrder::xlAscending : excel::XlSortOrder::xlDescending;
sal_Int16 nCustom = aSortParam.nUserIndex;
sal_Int16 nSortMethod = excel::XlSortMethod::xlPinYin;
--
cgit v1.2.1

View file

@ -18,8 +18,8 @@ _google_default_client_secret=0ZChLK6AxeA3Isu96MkwqDR4
pkgbase=libreoffice-fresh
pkgname=('libreoffice-fresh-sdk' 'libreoffice-fresh')
_LOver=7.3.1.3
pkgver=7.3.1
_LOver=7.3.2.2
pkgver=7.3.2
pkgrel=1
arch=('x86_64')
license=('LGPL3')
@ -69,7 +69,6 @@ source=(${_mirror}/libreoffice{,-help,-translations}-${_LOver}.tar.xz{,.asc}
${_additional_source_url2}/185d60944ea767075d27247c3162b3bc-unowinreg.dll
poppler-22.03.0.patch
make-pyuno-work-with-system-wide-module-install.diff
0003_tdf147611_fix_indices.patch
soffice-template.desktop.in
libreoffice-fresh.sh libreoffice-fresh.csh)
noextract=(35c94d2df8893241173de1d16b6034c0-swingExSrc.zip
@ -92,11 +91,11 @@ noextract=(35c94d2df8893241173de1d16b6034c0-swingExSrc.zip
185d60944ea767075d27247c3162b3bc-unowinreg.dll
)
validpgpkeys=('C2839ECAD9408FBE9531C3E9F434A1EFAFEEAEA3') # LibreOffice Build Team (CODE SIGNING KEY) <build@documentfoundation.org>
sha256sums=('6b57f6822a8571a8bd984b4dc048f519c2143c769714dbd491f60b8cc71f51a2'
sha256sums=('be96b0c9c7af7e24564729281ca6cef4eadfb06c9b30131a6fc94fa3e43b46a8'
'SKIP'
'34fb4c3f5ba76deefe409d14c027899a1014fd8ffff057238ba37c1dd17baaaa'
'addb19304e3330f49614eb979541cf1bdf93b481dcce22fdee20fbb193066aec'
'SKIP'
'e9b4b8ccf89ba92ad031ab909cd1dc2419aa83948ed7bf4694215a247535124e'
'c2588507b425bc7047b6325fcde8a2fcc9a927cee5b76065f42ddb68bad0fd71'
'SKIP'
'64585ac36a81291a58269ec5347e7e3e2e8596dbacb9221015c208191333c6e1'
'1fb458d6aab06932693cc8a9b6e4e70944ee1ff052fa63606e3131df34e21753'
@ -118,7 +117,6 @@ sha256sums=('6b57f6822a8571a8bd984b4dc048f519c2143c769714dbd491f60b8cc71f51a2'
'eafde646a7dbe46d20c291685b0beac2382174d78d66ee990e229a1bf6e6cec6'
'e61e2a266c7a4374377475254a2f095c1ce2376980b301955a4e5a0d32d3c25b'
'c463654a73ecfbc242ff109726fb4faecdbfb3d91affafe919b24bea65afb563'
'a825f71f71658d18a31f2331351e9310d8996501cab79f411a0c7b9c1b53c70c'
'd0be8099cbee3c9dfda694a828149b881c345b204ab68826f317580aafb50879'
'cd1b25ff390e436c6bffa65c6e12382236e3ccbf8d3aae51b1b59bcaed79fd8a'
'de20f36d45f0fecc2d94176dd3ec7226ab07fa8ffb9b0bc73c200349a9273de1')
@ -144,10 +142,6 @@ prepare() {
# fix not upstreamable pyuno paths - FS#54250
patch -Np1 -i "${srcdir}"/make-pyuno-work-with-system-wide-module-install.diff
# https://bugs.archlinux.org/task/73987
# https://cgit.freedesktop.org/libreoffice/core/commit/?h=libreoffice-7-3&id=e85d2140ae5e9a611754c29aa4e5cdb6ad7fcab0
patch -Np1 -i "${srcdir}"/0003_tdf147611_fix_indices.patch
#use the CFLAGS but remove the LibO overridden ones
for i in $CFLAGS; do
case "$i" in