[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sc/qa sc/source

2022-06-07 Thread Eike Rathke (via logerrit)
 sc/qa/unit/ucalc_formula.cxx|4 ++--
 sc/source/core/tool/refdata.cxx |2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit ea91f8f9b1bccce73a22af8b4c1626ccb834b9d1
Author: Eike Rathke 
AuthorDate: Mon Jun 6 14:34:34 2022 +0200
Commit: Xisco Fauli 
CommitDate: Tue Jun 7 19:22:35 2022 +0200

Resolves: tdf#148163 Preserve names of bad cell reference input again

A regression of

commit e247262327d04ad9933f4af354050f4420c6e303
CommitDate: Tue Jul 30 23:49:55 2013 -0400

More on avoiding direct access to data members.

that changed, for example, invalid sheet references

-aRef.nTab = MAXTAB+3;
+aRef.SetTabDeleted(true);

The then following

commit 8a19af57bbcc57a02a7d87c6408d1e3212a6deba
CommitDate: Tue Jul 30 23:50:03 2013 -0400

Now nobody accesses reference members directly. Make them private.

changed ScSingleRefData::Valid()

-return  nCol >= 0 && nCol <= MAXCOL &&
-nRow >= 0 && nRow <= MAXROW &&
-nTab >= 0 && nTab <= MAXTAB;
+return ColValid() && RowValid() && TabValid();

without taking the deleted flags into account, where previous to
commit e247262327d04ad9933f4af354050f4420c6e303 nTab > MAXTAB
fulfilled the condition of not valid.

This makes it necessary to adjust the
TestFormula::testFuncRangeOp() test case that relied on the broken
behaviour.

Change-Id: I42e769ca0d56a2eb786bb6f65917f0c15d082763
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135453
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 104596d005b32bd2bba15554e8c9ae740327aa46)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135379
Reviewed-by: Xisco Fauli 

diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx
index 551834284f76..dce22b2c25a4 100644
--- a/sc/qa/unit/ucalc_formula.cxx
+++ b/sc/qa/unit/ucalc_formula.cxx
@@ -7363,8 +7363,8 @@ void TestFormula::testFuncRangeOp()
 // have to be adapted.
 aPos.IncRow();
 m_pDoc->SetString( aPos, "=SUM(B1:Sheet2.B2:Sheet3.B3)");
-ASSERT_FORMULA_EQUAL(*m_pDoc, aPos, "SUM(#REF!.B2:#REF!.B3)", "Wrong 
formula.");
-CPPUNIT_ASSERT_EQUAL( OUString("#REF!"), m_pDoc->GetString(aPos));
+ASSERT_FORMULA_EQUAL(*m_pDoc, aPos, "SUM(b1:sheet2.b2:Sheet3.B3)", "Wrong 
formula.");
+CPPUNIT_ASSERT_EQUAL( OUString("#NAME?"), m_pDoc->GetString(aPos));
 
 aPos.IncRow();
 m_pDoc->SetString( aPos, "=SUM(Sheet1.B1:Sheet3.B2:Sheet2.B3)");
diff --git a/sc/source/core/tool/refdata.cxx b/sc/source/core/tool/refdata.cxx
index 59a224dbcfbd..9cdadc57da10 100644
--- a/sc/source/core/tool/refdata.cxx
+++ b/sc/source/core/tool/refdata.cxx
@@ -129,7 +129,7 @@ bool ScSingleRefData::IsDeleted() const
 
 bool ScSingleRefData::Valid(const ScDocument& rDoc) const
 {
-return ColValid(rDoc) && RowValid(rDoc) && TabValid();
+return !IsDeleted() && ColValid(rDoc) && RowValid(rDoc) && TabValid();
 }
 
 bool ScSingleRefData::ColValid(const ScDocument& rDoc) const


[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sc/qa sc/source sfx2/source

2022-05-11 Thread Andreas Heinisch (via logerrit)
 sc/qa/unit/bugfix-test.cxx  |   21 
 sc/qa/unit/data/ods/tdf108188_pagestyle.ods |binary
 sc/source/core/data/stlsheet.cxx|   35 +++-
 sfx2/source/dialog/StyleList.cxx|   15 
 4 files changed, 45 insertions(+), 26 deletions(-)

New commits:
commit 10c07e001da992cff4078c1cb1f49fdb16673ac3
Author: Andreas Heinisch 
AuthorDate: Sun May 8 14:31:00 2022 +0200
Commit: Xisco Fauli 
CommitDate: Wed May 11 09:56:12 2022 +0200

tdf#108188, tdf#131190 - Verify that the page style is actually used

Change-Id: I007d26c6fcaf60d2a2378cc00e630da447f95a8a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134022
Tested-by: Andreas Heinisch 
Reviewed-by: Andreas Heinisch 
(cherry picked from commit ad79900cd62c487bda9d2515892d62b3b08a5dfa)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134067
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/sc/qa/unit/bugfix-test.cxx b/sc/qa/unit/bugfix-test.cxx
index 7fd56122216e..d2a4f71f3087 100644
--- a/sc/qa/unit/bugfix-test.cxx
+++ b/sc/qa/unit/bugfix-test.cxx
@@ -29,6 +29,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
@@ -63,6 +64,7 @@ public:
 void testTdf129789();
 void testTdf130725();
 void testTdf104502_hiddenColsCountedInPageCount();
+void testTdf108188_pagestyle();
 
 CPPUNIT_TEST_SUITE(ScFiltersTest);
 CPPUNIT_TEST(testTdf137576_Measureline);
@@ -87,6 +89,7 @@ public:
 CPPUNIT_TEST(testTdf129789);
 CPPUNIT_TEST(testTdf130725);
 CPPUNIT_TEST(testTdf104502_hiddenColsCountedInPageCount);
+CPPUNIT_TEST(testTdf108188_pagestyle);
 CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -748,6 +751,24 @@ void 
ScFiltersTest::testTdf104502_hiddenColsCountedInPageCount()
 
 xShell->DoClose();
 }
+void ScFiltersTest::testTdf108188_pagestyle()
+{
+ScDocShellRef xDocSh = loadDoc(u"tdf108188_pagestyle.", FORMAT_ODS);
+CPPUNIT_ASSERT(xDocSh);
+
+// Check if the user defined page style is present
+const OUString aTestPageStyle = "TestPageStyle";
+ScDocument& rDoc = xDocSh->GetDocument();
+CPPUNIT_ASSERT_EQUAL(aTestPageStyle, rDoc.GetPageStyle(0));
+
+// Without the accompanying fix in place, the page styles are always used
+ScStyleSheetPool* pStylePool = rDoc.GetStyleSheetPool();
+CPPUNIT_ASSERT(pStylePool->Find(aTestPageStyle, 
SfxStyleFamily::Page)->IsUsed());
+CPPUNIT_ASSERT(!pStylePool->Find("Default", 
SfxStyleFamily::Page)->IsUsed());
+
+xDocSh->DoClose();
+}
+
 
 ScFiltersTest::ScFiltersTest()
   : ScBootstrapFixture( "sc/qa/unit/data" )
diff --git a/sc/qa/unit/data/ods/tdf108188_pagestyle.ods 
b/sc/qa/unit/data/ods/tdf108188_pagestyle.ods
new file mode 100644
index ..d0ecf9f88453
Binary files /dev/null and b/sc/qa/unit/data/ods/tdf108188_pagestyle.ods differ
diff --git a/sc/source/core/data/stlsheet.cxx b/sc/source/core/data/stlsheet.cxx
index 5712bf883c78..ae113cc82e91 100644
--- a/sc/source/core/data/stlsheet.cxx
+++ b/sc/source/core/data/stlsheet.cxx
@@ -250,19 +250,32 @@ SfxItemSet& ScStyleSheet::GetItemSet()
 
 bool ScStyleSheet::IsUsed() const
 {
-if ( GetFamily() == SfxStyleFamily::Para )
+switch (GetFamily())
 {
-// Always query the document to let it decide if a rescan is necessary,
-// and store the state.
-ScDocument* pDoc = 
static_cast(m_pPool)->GetDocument();
-if ( pDoc && pDoc->IsStyleSheetUsed( *this ) )
-eUsage = Usage::USED;
-else
-eUsage = Usage::NOTUSED;
-return eUsage == Usage::USED;
+case SfxStyleFamily::Para:
+{
+// Always query the document to let it decide if a rescan is 
necessary,
+// and store the state.
+ScDocument* pDoc = 
static_cast(m_pPool)->GetDocument();
+if ( pDoc && pDoc->IsStyleSheetUsed( *this ) )
+eUsage = Usage::USED;
+else
+eUsage = Usage::NOTUSED;
+return eUsage == Usage::USED;
+}
+case SfxStyleFamily::Page:
+{
+// tdf#108188 - verify that the page style is actually used
+ScDocument* pDoc = 
static_cast(m_pPool)->GetDocument();
+if (pDoc && pDoc->IsPageStyleInUse(GetName(), nullptr))
+eUsage = Usage::USED;
+else
+eUsage = Usage::NOTUSED;
+return eUsage == Usage::USED;
+}
+default:
+return true;
 }
-else
-return true;
 }
 
 void ScStyleSheet::Notify( SfxBroadcaster&, const SfxHint& rHint )
diff --git a/sfx2/source/dialog/StyleList.cxx b/sfx2/source/dialog/StyleList.cxx
index 5b86a1033c49..f8bcf6ee1799 100644
--- a/sfx2/source/dialog/StyleList.cxx
+++ b/sfx2/source/dialog/StyleList.cxx
@@ -1335,21 +1335,6 @@ IMPL_LINK_NOARG(StyleList, EnableDelete, void*, 

[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sc/qa

2022-04-12 Thread Dennis Francis (via logerrit)
 sc/qa/unit/tiledrendering/tiledrendering.cxx |   30 +++
 1 file changed, 26 insertions(+), 4 deletions(-)

New commits:
commit cc1013e2c6b806226c888d980f56d13767998546
Author: Dennis Francis 
AuthorDate: Tue Apr 12 10:43:00 2022 +0530
Commit: Christian Lohmaier 
CommitDate: Tue Apr 12 20:31:03 2022 +0200

unit test: use temp copy in testInvalidEntrySave()

Use a temporary copy of the source file to run this test otherwise it
will execute a .uno:Save on the original document in the git tree!

Change-Id: I673aad64453e72a9140efcad2b0ff9c0ceabc038

diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx 
b/sc/qa/unit/tiledrendering/tiledrendering.cxx
index dbad2535fb1d..699e0c687130 100644
--- a/sc/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx
@@ -37,6 +37,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #include 
 #include 
@@ -182,10 +184,11 @@ public:
 CPPUNIT_TEST_SUITE_END();
 
 private:
-ScModelObj* createDoc(const char* pName);
+ScModelObj* createDoc(const char* pName, bool bMakeTempCopy = false);
 void setupLibreOfficeKitViewCallback(SfxViewShell* pViewShell);
 static void callback(int nType, const char* pPayload, void* pData);
 void callbackImpl(int nType, const char* pPayload);
+void makeTempCopy(const OUString& rOrigURL);
 
 /// document size changed callback.
 osl::Condition m_aDocSizeCondition;
@@ -193,6 +196,7 @@ private:
 
 uno::Reference mxComponent;
 TestLokCallbackWrapper m_callbackWrapper;
+std::unique_ptr mpTempFile;
 };
 
 ScTiledRenderingTest::ScTiledRenderingTest()
@@ -231,11 +235,29 @@ void ScTiledRenderingTest::tearDown()
 test::BootstrapFixture::tearDown();
 }
 
-ScModelObj* ScTiledRenderingTest::createDoc(const char* pName)
+void ScTiledRenderingTest::makeTempCopy(const OUString& rOrigURL)
+{
+mpTempFile.reset(new utl::TempFile());
+mpTempFile->EnableKillingFile();
+auto const aError = osl::File::copy(rOrigURL, mpTempFile->GetURL());
+CPPUNIT_ASSERT_EQUAL_MESSAGE(
+OUString("<" + rOrigURL + "> -> <" + mpTempFile->GetURL() + 
">").toUtf8().getStr(),
+osl::FileBase::E_None, aError);
+}
+
+ScModelObj* ScTiledRenderingTest::createDoc(const char* pName, bool 
bMakeTempCopy)
 {
 if (mxComponent.is())
 mxComponent->dispose();
-mxComponent = loadFromDesktop(m_directories.getURLFromSrc(DATA_DIRECTORY) 
+ OUString::createFromAscii(pName), "com.sun.star.sheet.SpreadsheetDocument");
+
+OUString aOriginalSrc = m_directories.getURLFromSrc(DATA_DIRECTORY) + 
OUString::createFromAscii(pName);
+if (bMakeTempCopy)
+makeTempCopy(aOriginalSrc);
+
+mxComponent = loadFromDesktop(
+bMakeTempCopy ? mpTempFile->GetURL() : aOriginalSrc,
+"com.sun.star.sheet.SpreadsheetDocument");
+
 ScModelObj* pModelObj = dynamic_cast(mxComponent.get());
 CPPUNIT_ASSERT(pModelObj);
 
pModelObj->initializeForTiledRendering(uno::Sequence());
@@ -2911,7 +2933,7 @@ void ScTiledRenderingTest::testInvalidEntrySave()
 // Load a document
 comphelper::LibreOfficeKit::setActive();
 
-ScModelObj* pModelObj = createDoc("validity.xlsx");
+ScModelObj* pModelObj = createDoc("validity.xlsx", true /* bMakeTempCopy 
*/);
 const ScDocument* pDoc = pModelObj->GetDocument();
 ViewCallback aView;
 int nView = SfxLokHelper::getView();


[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sc/qa

2022-04-12 Thread Dennis Francis (via logerrit)
 sc/qa/unit/tiledrendering/data/validity.xlsx |binary
 sc/qa/unit/tiledrendering/tiledrendering.cxx |   57 ---
 2 files changed, 52 insertions(+), 5 deletions(-)

New commits:
commit 31167c542b6b9b6482dffee1a253a388ff3c0e2c
Author: Dennis Francis 
AuthorDate: Thu Apr 7 13:14:59 2022 +0530
Commit: Christian Lohmaier 
CommitDate: Tue Apr 12 20:28:44 2022 +0200

lok: unit test for invalid entry save

Unit test related to the fix

lok: avoid validation-dialog yield when saving
e0175ee821eaff56c4b8e0a1b7afa1cabe0ab593

The test ensures that the document is marked unmodified after save has
been executed in the middle of entering partial data to a validation
cell.

Conflicts:
sc/qa/unit/tiledrendering/tiledrendering.cxx

Change-Id: Idffd6d647034e128d0d800fe8e29efc333c03db6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132657
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier 

diff --git a/sc/qa/unit/tiledrendering/data/validity.xlsx 
b/sc/qa/unit/tiledrendering/data/validity.xlsx
new file mode 100644
index ..54a92acd5979
Binary files /dev/null and b/sc/qa/unit/tiledrendering/data/validity.xlsx differ
diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx 
b/sc/qa/unit/tiledrendering/tiledrendering.cxx
index 6c6cd5990c3c..dbad2535fb1d 100644
--- a/sc/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx
@@ -122,6 +122,7 @@ public:
 void testTextSelectionBounds();
 void testSheetViewDataCrash();
 void testTextBoxInsert();
+void testInvalidEntrySave();
 
 CPPUNIT_TEST_SUITE(ScTiledRenderingTest);
 CPPUNIT_TEST(testRowColumnHeaders);
@@ -177,6 +178,7 @@ public:
 CPPUNIT_TEST(testTextSelectionBounds);
 CPPUNIT_TEST(testSheetViewDataCrash);
 CPPUNIT_TEST(testTextBoxInsert);
+CPPUNIT_TEST(testInvalidEntrySave);
 CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -2643,18 +2645,25 @@ void ScTiledRenderingTest::testSortAscendingDescending()
 CPPUNIT_ASSERT_EQUAL(OString("rows"), aView.m_sInvalidateSheetGeometry);
 }
 
-void lcl_typeCharsInCell(const std::string& aStr, SCCOL nCol, SCROW nRow, 
ScTabViewShell* pView, ScModelObj* pModelObj)
+void lcl_typeCharsInCell(const std::string& aStr, SCCOL nCol, SCROW nRow, 
ScTabViewShell* pView,
+ScModelObj* pModelObj, bool bInEdit = false, bool bCommit = true)
 {
-pView->SetCursor(nCol, nRow);
+if (!bInEdit)
+pView->SetCursor(nCol, nRow);
+
 for (const char& cChar : aStr)
 {
 pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, cChar, 0);
 pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, cChar, 0);
 Scheduler::ProcessEventsToIdle();
 }
-pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::RETURN);
-pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::RETURN);
-Scheduler::ProcessEventsToIdle();
+
+if (bCommit)
+{
+pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::RETURN);
+pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::RETURN);
+Scheduler::ProcessEventsToIdle();
+}
 }
 
 void ScTiledRenderingTest::testAutoInputStringBlock()
@@ -2897,6 +2906,44 @@ void ScTiledRenderingTest::testTextBoxInsert()
 Scheduler::ProcessEventsToIdle();
 }
 
+void ScTiledRenderingTest::testInvalidEntrySave()
+{
+// Load a document
+comphelper::LibreOfficeKit::setActive();
+
+ScModelObj* pModelObj = createDoc("validity.xlsx");
+const ScDocument* pDoc = pModelObj->GetDocument();
+ViewCallback aView;
+int nView = SfxLokHelper::getView();
+
+SfxLokHelper::setView(nView);
+
+ScDocShell* pDocSh = dynamic_cast< ScDocShell* >( 
pModelObj->GetEmbeddedObject() );
+ScTabViewShell* pTabViewShell = 
dynamic_cast(SfxViewShell::Current());
+CPPUNIT_ASSERT(pTabViewShell);
+
+// Type partial date "7/8" of "7/8/2013" that
+// the validation cell at A8 can accept
+lcl_typeCharsInCell("7/8", 0, 7, pTabViewShell, pModelObj,
+false /* bInEdit */, false /* bCommit */); // Type "7/8" in A8
+
+uno::Sequence aArgs;
+comphelper::dispatchCommand(".uno:Save", aArgs);
+Scheduler::ProcessEventsToIdle();
+
+CPPUNIT_ASSERT_MESSAGE("Should not be marked modified after save", 
!pDocSh->IsModified());
+
+// Complete the date in A8 by appending "/2013" and commit.
+lcl_typeCharsInCell("/2013", 0, 7, pTabViewShell, pModelObj,
+true /* bInEdit */, true /* bCommit */);
+
+// This would hang if the date entered "7/8/2013" is not acceptable.
+Scheduler::ProcessEventsToIdle();
+
+// Ensure that the correct date is recorded in the document.
+CPPUNIT_ASSERT_EQUAL(double(41463), pDoc->GetValue(ScAddress(0, 7, 0)));
+}
+
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(ScTiledRenderingTest);


[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sc/qa sc/source

2022-03-28 Thread Aron Budea (via logerrit)
 sc/qa/unit/data/xlsx/tdf147014.xlsx  |binary
 sc/qa/unit/subsequent_filters_test2.cxx  |   18 ++
 sc/source/filter/oox/worksheethelper.cxx |   25 +++--
 3 files changed, 37 insertions(+), 6 deletions(-)

New commits:
commit 4a614ad8c32ad09f4085980e49dce251358a0a46
Author: Aron Budea 
AuthorDate: Sun Feb 13 06:57:16 2022 +0100
Commit: Xisco Fauli 
CommitDate: Mon Mar 28 14:04:11 2022 +0200

tdf#147014 Image missing due to integer overflow

32-bit awt::Point/Size/Rectangle cannot fit size of 1M rows with
larger (eg. 5x the usual) height, and could overflow.

This causes problems in 64-bit Linux builds and, since the
following commit, in 64-bit Windows builds:
3d90997fb6f232d8008df4d166d7b97b869c200f

For now, clamp possibly overflowing values to 32-bit.

Change-Id: Ifda7265703388abdfb47f523da4f0c5822358404
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129876
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 
Reviewed-by: Aron Budea 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132168

diff --git a/sc/qa/unit/data/xlsx/tdf147014.xlsx 
b/sc/qa/unit/data/xlsx/tdf147014.xlsx
new file mode 100644
index ..df4428795d9d
Binary files /dev/null and b/sc/qa/unit/data/xlsx/tdf147014.xlsx differ
diff --git a/sc/qa/unit/subsequent_filters_test2.cxx 
b/sc/qa/unit/subsequent_filters_test2.cxx
index c40f26dfc78d..ac0b8d8d82e9 100644
--- a/sc/qa/unit/subsequent_filters_test2.cxx
+++ b/sc/qa/unit/subsequent_filters_test2.cxx
@@ -204,6 +204,7 @@ public:
 void testTdf129940();
 void testTdf139612();
 void testTdf144740();
+void testTdf147014();
 void testTdf139763ShapeAnchor();
 void testAutofilterNamedRangesXLSX();
 void testInvalidBareBiff5();
@@ -312,6 +313,7 @@ public:
 CPPUNIT_TEST(testTdf129940);
 CPPUNIT_TEST(testTdf139612);
 CPPUNIT_TEST(testTdf144740);
+CPPUNIT_TEST(testTdf147014);
 CPPUNIT_TEST(testTdf139763ShapeAnchor);
 CPPUNIT_TEST(testAutofilterNamedRangesXLSX);
 CPPUNIT_TEST(testInvalidBareBiff5);
@@ -2873,6 +2875,22 @@ void ScFiltersTest2::testTdf144740()
 xDocSh->DoClose();
 }
 
+void ScFiltersTest2::testTdf147014()
+{
+ScDocShellRef xDocSh = loadDoc(u"tdf147014.", FORMAT_XLSX);
+CPPUNIT_ASSERT_MESSAGE("Failed to load tdf147014.xlsx", xDocSh.is());
+uno::Reference xModel = xDocSh->GetModel();
+uno::Reference xDoc(xModel, 
uno::UNO_QUERY_THROW);
+uno::Reference xIA(xDoc->getSheets(), 
uno::UNO_QUERY_THROW);
+uno::Reference 
xDrawPageSupplier(xIA->getByIndex(0),
+ 
uno::UNO_QUERY_THROW);
+xIA.set(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY_THROW);
+// The sheet has a single shape, without the fix it was not imported, 
except in 32-bit builds
+CPPUNIT_ASSERT_EQUAL_MESSAGE("Shape not imported", 
static_cast(1), xIA->getCount());
+
+xDocSh->DoClose();
+}
+
 void ScFiltersTest2::testTdf139763ShapeAnchor()
 {
 ScDocShellRef xDocSh = loadDoc(u"tdf139763ShapeAnchor.", FORMAT_XLSX);
diff --git a/sc/source/filter/oox/worksheethelper.cxx 
b/sc/source/filter/oox/worksheethelper.cxx
index 40a99cdb444b..95625751d4a0 100644
--- a/sc/source/filter/oox/worksheethelper.cxx
+++ b/sc/source/filter/oox/worksheethelper.cxx
@@ -75,7 +75,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 namespace oox::xls {
 
@@ -96,6 +96,18 @@ void lclUpdateProgressBar( const ISegmentProgressBarRef& 
rxProgressBar, double f
 rxProgressBar->setPosition( fPosition );
 }
 
+// TODO Needed because input might be >32-bit (in 64-bit builds),
+//  or a negative, already overflown value (in 32-bit builds)
+sal_Int32 lclClampToNonNegativeInt32( tools::Long aVal )
+{
+if ( aVal > SAL_MAX_INT32 || aVal < 0 )
+{
+SAL_WARN( "sc.filter", "Overflow detected, " << aVal << " does not fit 
into sal_Int32, or is negative." );
+return SAL_MAX_INT32;
+}
+return static_cast( aVal );
+}
+
 } // namespace
 
 ColumnModel::ColumnModel() :
@@ -538,9 +550,9 @@ const awt::Size& WorksheetGlobals::getDrawPageSize() const
 
 awt::Point WorksheetGlobals::getCellPosition( sal_Int32 nCol, sal_Int32 nRow ) 
const
 {
-awt::Point aPoint;
-PropertySet aCellProp( getCell( ScAddress( nCol, nRow, getSheetIndex() ) ) 
);
-aCellProp.getProperty( aPoint, PROP_Position );
+const tools::Rectangle aMMRect( getScDocument().GetMMRect( nCol, nRow, 
nCol, nRow, getSheetIndex() ) );
+awt::Point aPoint( lclClampToNonNegativeInt32( aMMRect.Left() ),
+   lclClampToNonNegativeInt32( aMMRect.Top() ) );
 return aPoint;
 }
 
@@ -1360,8 +1372,9 @@ void WorksheetGlobals::groupColumnsOrRows( sal_Int32 
nFirstColRow, sal_Int32 nLa
 void WorksheetGlobals::finalizeDrawings()
 {
 // calculate the current drawing page size (after rows/columns are 
imported)
-PropertySet 

[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sc/qa sc/source

2022-03-24 Thread Luboš Luňák (via logerrit)
 sc/qa/unit/data/ods/too-many-cols-rows.ods |binary
 sc/qa/unit/subsequent_filters_test2.cxx|   17 ++---
 sc/source/filter/xml/xmlcelli.cxx  |6 ++
 3 files changed, 20 insertions(+), 3 deletions(-)

New commits:
commit ccad7357b983294ba2f0d8e18f3c2955d7a6d41d
Author: Luboš Luňák 
AuthorDate: Tue Mar 22 16:46:55 2022 +0100
Commit: Eike Rathke 
CommitDate: Thu Mar 24 19:11:11 2022 +0100

warn on too many rows/column when loading ODS

There's a warning when loading XLSX, but not when loading ODS.
Now that 7.4 is going to support 16k columns, that would be a useful
warning, either if we raise the limits again, or backported to
7.2/7.3 .

Change-Id: I204bca32e1ff37332b86361d3d81d3fee29c15ec
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131944
Tested-by: Jenkins
Reviewed-by: Eike Rathke 

diff --git a/sc/qa/unit/data/ods/too-many-cols-rows.ods 
b/sc/qa/unit/data/ods/too-many-cols-rows.ods
new file mode 100644
index ..fcf1a0bc9ea8
Binary files /dev/null and b/sc/qa/unit/data/ods/too-many-cols-rows.ods differ
diff --git a/sc/qa/unit/subsequent_filters_test2.cxx 
b/sc/qa/unit/subsequent_filters_test2.cxx
index 75db57388f41..c40f26dfc78d 100644
--- a/sc/qa/unit/subsequent_filters_test2.cxx
+++ b/sc/qa/unit/subsequent_filters_test2.cxx
@@ -71,9 +71,7 @@
 #include 
 #include 
 #include 
-
-#include 
-#include 
+#include 
 
 #include 
 #include 
@@ -209,6 +207,7 @@ public:
 void testTdf139763ShapeAnchor();
 void testAutofilterNamedRangesXLSX();
 void testInvalidBareBiff5();
+void testTooManyColsRows();
 
 CPPUNIT_TEST_SUITE(ScFiltersTest2);
 
@@ -316,6 +315,7 @@ public:
 CPPUNIT_TEST(testTdf139763ShapeAnchor);
 CPPUNIT_TEST(testAutofilterNamedRangesXLSX);
 CPPUNIT_TEST(testInvalidBareBiff5);
+CPPUNIT_TEST(testTooManyColsRows);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -3025,6 +3025,17 @@ void ScFiltersTest2::testInvalidBareBiff5()
 xDocSh->DoClose();
 }
 
+void ScFiltersTest2::testTooManyColsRows()
+{
+// The intentionally doc has cells beyond our MAXROW/MAXCOL, so there
+// should be a warning on load.
+ScDocShellRef xDocSh = loadDoc(u"too-many-cols-rows.", FORMAT_ODS);
+CPPUNIT_ASSERT(xDocSh.is());
+CPPUNIT_ASSERT(xDocSh->GetErrorCode() == SCWARN_IMPORT_ROW_OVERFLOW
+   || xDocSh->GetErrorCode() == SCWARN_IMPORT_COLUMN_OVERFLOW);
+xDocSh->DoClose();
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(ScFiltersTest2);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sc/source/filter/xml/xmlcelli.cxx 
b/sc/source/filter/xml/xmlcelli.cxx
index a31a7659cc76..d27b076e1ad6 100644
--- a/sc/source/filter/xml/xmlcelli.cxx
+++ b/sc/source/filter/xml/xmlcelli.cxx
@@ -1170,7 +1170,10 @@ void ScXMLTableRowCellContext::AddTextAndValueCell( 
const ScAddress& rCellPos,
 // it makes no sense to import data after the last supported column
 // fdo#58539 & gnome#627150
 if(rCurrentPos.Col() > pDoc->MaxCol())
+{
+rXMLImport.SetRangeOverflowType(SCWARN_IMPORT_COLUMN_OVERFLOW);
 break;
+}
 
 if (i > 0)
 rTables.AddColumn(false);
@@ -1183,7 +1186,10 @@ void ScXMLTableRowCellContext::AddTextAndValueCell( 
const ScAddress& rCellPos,
 // it makes no sense to import data after last supported row
 // fdo#58539 & gnome#627150
 if(rCurrentPos.Row() > pDoc->MaxRow())
+{
+
rXMLImport.SetRangeOverflowType(SCWARN_IMPORT_ROW_OVERFLOW);
 break;
+}
 
 if( (rCurrentPos.Col() == 0) && (j > 0) )
 {


[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sc/qa

2022-03-15 Thread Xisco Fauli (via logerrit)
 sc/qa/unit/parallelism.cxx |   30 ++
 1 file changed, 30 insertions(+)

New commits:
commit 111b6d6c0421f78e383df24d05442b9fe943424a
Author: Xisco Fauli 
AuthorDate: Mon Mar 14 16:23:57 2022 +0100
Commit: Xisco Fauli 
CommitDate: Tue Mar 15 10:23:23 2022 +0100

tdf#147905: sc_parallelism: Add unittest

Change-Id: Ib71a30d7ef8d907c1fd86e35d3e6cae5c15218bf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131549
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 
(cherry picked from commit bee6568ae5d49f5b697740a23c5a1c6775f64d52)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131483

diff --git a/sc/qa/unit/parallelism.cxx b/sc/qa/unit/parallelism.cxx
index 37dcd79e546c..5fc47c23304d 100644
--- a/sc/qa/unit/parallelism.cxx
+++ b/sc/qa/unit/parallelism.cxx
@@ -35,6 +35,7 @@ public:
 void testVLOOKUP();
 void testVLOOKUPSUM();
 void testSingleRef();
+void testTdf147905();
 void testSUMIFImplicitRange();
 void testFGCycleWithPlainFormulaCell1();
 void testFGCycleWithPlainFormulaCell2();
@@ -54,6 +55,7 @@ public:
 CPPUNIT_TEST(testVLOOKUP);
 CPPUNIT_TEST(testVLOOKUPSUM);
 CPPUNIT_TEST(testSingleRef);
+CPPUNIT_TEST(testTdf147905);
 CPPUNIT_TEST(testSUMIFImplicitRange);
 CPPUNIT_TEST(testFGCycleWithPlainFormulaCell1);
 CPPUNIT_TEST(testFGCycleWithPlainFormulaCell2);
@@ -400,6 +402,34 @@ void ScParallelismTest::testSingleRef()
 m_pDoc->DeleteTab(0);
 }
 
+void ScParallelismTest::testTdf147905()
+{
+m_pDoc->InsertTab(0, "1");
+
+OUString aFormula;
+const size_t nNumRows = 500;
+for (size_t i = 0; i < nNumRows; ++i)
+{
+m_pDoc->SetString(0, i, 0, "");
+aFormula = "=PROPER($A" + OUString::number(i+1) + ")";
+m_pDoc->SetFormula(ScAddress(1, i, 0),
+   aFormula,
+   formula::FormulaGrammar::GRAM_NATIVE_UI);
+}
+
+m_xDocShell->DoHardRecalc();
+
+for (size_t i = 0; i < nNumRows; ++i)
+{
+OString aMsg = "At row " + OString::number(i);
+CPPUNIT_ASSERT_EQUAL_MESSAGE(aMsg.getStr(), OUString(""), 
m_pDoc->GetString(0, i, 0));
+
+// Without the fix in place, this test would have failed here
+CPPUNIT_ASSERT_EQUAL_MESSAGE(aMsg.getStr(), OUString("Aaaa"), 
m_pDoc->GetString(1, i, 0));
+}
+m_pDoc->DeleteTab(0);
+}
+
 // Common test setup steps for testSUMIFImplicitRange*()
 static void lcl_setupCommon(ScDocument* pDoc, size_t nNumRows, size_t 
nConstCellValue)
 {


[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sc/qa sw/qa

2022-03-07 Thread Xisco Fauli (via logerrit)
 sc/qa/uitest/calc_tests3/insertQrCodeGen.py   |   15 ---
 sc/qa/uitest/signatureLine/insertSignatureLine.py |   22 --
 sw/qa/uitest/writer_tests3/insertQrCodeGen.py |   15 ---
 sw/qa/uitest/writer_tests3/insertSignatureLine.py |7 ---
 4 files changed, 16 insertions(+), 43 deletions(-)

New commits:
commit 9299617531ada46650d3a6855870aea13db161c4
Author: Xisco Fauli 
AuthorDate: Mon Feb 28 20:36:38 2022 +0100
Commit: Xisco Fauli 
CommitDate: Mon Mar 7 14:11:57 2022 +0100

uitest: simplify tests even more

- No need to open the dialog to click the cancel button
- Avoid repeated calls to document.DrawPage.getByIndex(0).
Similar to 26298f29e9d36313be527b785a9bb96089582037
this might fix the different failures these tests sometimes
have

Change-Id: I4e175b6c5d48c4651e5877ec2a72c4858b590321
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130727
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131102

diff --git a/sc/qa/uitest/calc_tests3/insertQrCodeGen.py 
b/sc/qa/uitest/calc_tests3/insertQrCodeGen.py
index 50cb75641027..0fe70f1febc0 100644
--- a/sc/qa/uitest/calc_tests3/insertQrCodeGen.py
+++ b/sc/qa/uitest/calc_tests3/insertQrCodeGen.py
@@ -6,7 +6,6 @@
 
 from uitest.framework import UITestCase
 from uitest.uihelper.common import type_text
-from com.sun.star.lang import IndexOutOfBoundsException
 
 class insertQrCode(UITestCase):
 
@@ -15,13 +14,6 @@ class insertQrCode(UITestCase):
 xCalcDoc = self.xUITest.getTopFocusWindow()
 gridwin = xCalcDoc.getChild("grid_window")
 
-# cancel the dialog without doing anything
-with 
self.ui_test.execute_dialog_through_command(".uno:InsertQrCode", 
close_button="cancel") as xDialog:
-
-xURL = xDialog.getChild("edit_text")
-type_text(xURL, "www.libreoffice.org")
-
-# Reopen the dialog box
 with 
self.ui_test.execute_dialog_through_command(".uno:InsertQrCode") as xDialog:
 
 # Get elements in the Dialog Box
@@ -35,8 +27,9 @@ class insertQrCode(UITestCase):
 xBorder.executeAction("DOWN", tuple())
 
 # check the QR code in the document
-
self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).BarCodeProperties.Payload,
 "www.libreoffice.org")
-
self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).BarCodeProperties.ErrorCorrection,
 1)
-
self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).BarCodeProperties.Border,
 1)
+element = document.Sheets.getByIndex(0).DrawPage.getByIndex(0)
+self.assertEqual(element.BarCodeProperties.Payload, 
"www.libreoffice.org")
+self.assertEqual(element.BarCodeProperties.ErrorCorrection, 1)
+self.assertEqual(element.BarCodeProperties.Border, 1)
 
 # vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/signatureLine/insertSignatureLine.py 
b/sc/qa/uitest/signatureLine/insertSignatureLine.py
index 28d9c4e29fcc..8dde04e1c875 100644
--- a/sc/qa/uitest/signatureLine/insertSignatureLine.py
+++ b/sc/qa/uitest/signatureLine/insertSignatureLine.py
@@ -8,7 +8,6 @@ from uitest.framework import UITestCase
 from libreoffice.uno.propertyvalue import mkPropertyValues
 from uitest.uihelper.common import get_state_as_dict, type_text
 from libreoffice.uno.propertyvalue import mkPropertyValues
-from com.sun.star.lang import IndexOutOfBoundsException
 
 #Bug 117903 - Allow signature lines in Calc
 
@@ -19,12 +18,6 @@ class insertSignatureLineCalc(UITestCase):
 xCalcDoc = self.xUITest.getTopFocusWindow()
 gridwin = xCalcDoc.getChild("grid_window")
 
-# cancel the dialog without doing anything
-with 
self.ui_test.execute_dialog_through_command(".uno:InsertSignatureLine", 
close_button="cancel") as xDialog:
-
-xName = xDialog.getChild("edit_name")
-xName.executeAction("TYPE", mkPropertyValues({"TEXT":"Name"})) 
#set the signature line
-
 # set the signature line
 with 
self.ui_test.execute_dialog_through_command(".uno:InsertSignatureLine") as 
xDialog:
 
@@ -41,12 +34,13 @@ class insertSignatureLineCalc(UITestCase):
 xInstructions.executeAction("TYPE", 
mkPropertyValues({"TEXT":"Instructions"}))
 
 #check the signature Line in the document
-
self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).SignatureLineSuggestedSignerName,
 "Name")
-
self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).SignatureLineSuggestedSignerTitle,
 "Title")
-
self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).SignatureLineSuggestedSignerEmail,
 "Email")
-

[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sc/qa sw/qa

2022-03-07 Thread Xisco Fauli (via logerrit)
 sc/qa/uitest/calc_tests3/insertQrCodeGen.py   |   25 
 sc/qa/uitest/signatureLine/insertSignatureLine.py |   34 --
 sw/qa/uitest/writer_tests3/insertQrCodeGen.py |   24 ---
 sw/qa/uitest/writer_tests3/insertSignatureLine.py |   34 --
 4 files changed, 117 deletions(-)

New commits:
commit 6439ee65bdfc4151d96ff2aeb3958949996cbc77
Author: Xisco Fauli 
AuthorDate: Mon Feb 28 18:28:30 2022 +0100
Commit: Xisco Fauli 
CommitDate: Mon Mar 7 14:11:34 2022 +0100

uitest: remove duplicated tests

They are pretty much the same as the other one in the
same file

Besides, the 'with self.assertRaises(IndexOutOfBoundsException)'
nonsense

Change-Id: I0ad9aaf80721eb49080d94a34deb43b0bc39724c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130718
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131101

diff --git a/sc/qa/uitest/calc_tests3/insertQrCodeGen.py 
b/sc/qa/uitest/calc_tests3/insertQrCodeGen.py
index ffc2dd37047f..50cb75641027 100644
--- a/sc/qa/uitest/calc_tests3/insertQrCodeGen.py
+++ b/sc/qa/uitest/calc_tests3/insertQrCodeGen.py
@@ -21,9 +21,6 @@ class insertQrCode(UITestCase):
 xURL = xDialog.getChild("edit_text")
 type_text(xURL, "www.libreoffice.org")
 
-with self.assertRaises(IndexOutOfBoundsException):
-document.Sheets.getByIndex(0).DrawPage.getByIndex(0)
-
 # Reopen the dialog box
 with 
self.ui_test.execute_dialog_through_command(".uno:InsertQrCode") as xDialog:
 
@@ -42,26 +39,4 @@ class insertQrCode(UITestCase):
 
self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).BarCodeProperties.ErrorCorrection,
 1)
 
self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).BarCodeProperties.Border,
 1)
 
-
-   def test_insert_qr_code_gen2(self):
-with self.ui_test.create_doc_in_start_center("calc") as document:
-xCalcDoc = self.xUITest.getTopFocusWindow()
-gridwin = xCalcDoc.getChild("grid_window")
-
-with 
self.ui_test.execute_dialog_through_command(".uno:InsertQrCode") as xDialog:
-
-xURL = xDialog.getChild("edit_text")
-xECC_Low = xDialog.getChild("button_low")
-xBorder = xDialog.getChild("edit_margin")
-
-type_text(xURL, "www.libreoffice.org") #set the QR code
-xECC_Low.executeAction("CLICK", tuple())
-xBorder.executeAction("UP", tuple())
-xBorder.executeAction("DOWN", tuple())
-
-#check the QR Code in the document
-
self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).BarCodeProperties.Payload,
 "www.libreoffice.org")
-
self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).BarCodeProperties.ErrorCorrection,
 1)
-
self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).BarCodeProperties.Border,
 1)
-
 # vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/signatureLine/insertSignatureLine.py 
b/sc/qa/uitest/signatureLine/insertSignatureLine.py
index 26e259a5d2f1..28d9c4e29fcc 100644
--- a/sc/qa/uitest/signatureLine/insertSignatureLine.py
+++ b/sc/qa/uitest/signatureLine/insertSignatureLine.py
@@ -25,9 +25,6 @@ class insertSignatureLineCalc(UITestCase):
 xName = xDialog.getChild("edit_name")
 xName.executeAction("TYPE", mkPropertyValues({"TEXT":"Name"})) 
#set the signature line
 
-with self.assertRaises(IndexOutOfBoundsException):
-document.Sheets.getByIndex(0).DrawPage.getByIndex(0)
-
 # set the signature line
 with 
self.ui_test.execute_dialog_through_command(".uno:InsertSignatureLine") as 
xDialog:
 
@@ -52,35 +49,4 @@ class insertSignatureLineCalc(UITestCase):
 
self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).SignatureLineShowSignDate,
 True)
 
self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).SignatureLineSigningInstructions,
 "Instructions")
 
-
-   def test_insert_signature_line2_calc(self):
-with self.ui_test.create_doc_in_start_center("calc") as document:
-xCalcDoc = self.xUITest.getTopFocusWindow()
-gridwin = xCalcDoc.getChild("grid_window")
-
-with 
self.ui_test.execute_dialog_through_command(".uno:InsertSignatureLine") as 
xDialog:
-
-xName = xDialog.getChild("edit_name")
-xTitle = xDialog.getChild("edit_title")
-xEmail = xDialog.getChild("edit_email")
-xComment = xDialog.getChild("checkbox_can_add_comments")
-xDate = xDialog.getChild("checkbox_show_sign_date")
-xInstructions = 

[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sc/qa sc/source

2022-03-02 Thread Justin Luth (via logerrit)
 sc/qa/unit/data/xlsb/pivottable_error_item_filter.xlsb |binary
 sc/qa/unit/data/xlsx/tdf122471.xlsx|binary
 sc/qa/unit/pivottable_filters_test.cxx |   56 +
 sc/source/filter/inc/pivotcachebuffer.hxx  |2 
 sc/source/filter/oox/pivotcachebuffer.cxx  |   10 +--
 sc/source/filter/oox/pivotcachefragment.cxx|2 
 6 files changed, 63 insertions(+), 7 deletions(-)

New commits:
commit 789fbf732ad6db002fd83b307385940c392cc457
Author: Justin Luth 
AuthorDate: Mon Feb 28 15:36:08 2022 +0200
Commit: Eike Rathke 
CommitDate: Wed Mar 2 18:58:17 2022 +0100

tdf#122471 xlsx import: pivottable error OUString, not uInt8

This fixes a LO 6.0 regression from
commit 9fa34e9f2cebe2cfc551668f2a67ddcb799d3fb8
which only half-way changed to OUString from uInt8.

An exception was raised because in XLSX, an INT was written
while the corresponding read function was expecting an OUString.

However, doing this runs into problems with binary files (xlsb),
which were still setting the value to an int.
Unit test shows the need to use OUString for xlsb too,
which now matches what I see in Excel 2003.

make CppunitTest_sc_pivottable_filters_test \
  CPPUNIT_TEST_NAME=testPivotTableErrorItem2FilterXLSX

Change-Id: I399c9e34984bb1ff71695a87aa56f53063d37b3d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130714
Tested-by: Jenkins
Reviewed-by: Justin Luth 
(cherry picked from commit 6961f6732954742415413fa53bdeebd1b03d9ec5)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130678
Reviewed-by: Eike Rathke 

diff --git a/sc/qa/unit/data/xlsb/pivottable_error_item_filter.xlsb 
b/sc/qa/unit/data/xlsb/pivottable_error_item_filter.xlsb
new file mode 100644
index ..c32b8f3743e6
Binary files /dev/null and 
b/sc/qa/unit/data/xlsb/pivottable_error_item_filter.xlsb differ
diff --git a/sc/qa/unit/data/xlsx/tdf122471.xlsx 
b/sc/qa/unit/data/xlsx/tdf122471.xlsx
new file mode 100644
index ..febac5c73506
Binary files /dev/null and b/sc/qa/unit/data/xlsx/tdf122471.xlsx differ
diff --git a/sc/qa/unit/pivottable_filters_test.cxx 
b/sc/qa/unit/pivottable_filters_test.cxx
index 80557c5b12aa..f6507d6cfccf 100644
--- a/sc/qa/unit/pivottable_filters_test.cxx
+++ b/sc/qa/unit/pivottable_filters_test.cxx
@@ -79,6 +79,8 @@ public:
 void testPivotTableBoolFieldFilterXLSX();
 void testPivotTableRowColPageFieldFilterXLSX();
 void testPivotTableErrorItemFilterXLSX();
+void testPivotTableErrorItemFilterXLSB();
+void testPivotTableErrorItem2FilterXLSX();
 void testPivotTableOutlineModeXLSX();
 void testPivotTableDuplicatedMemberFilterXLSX();
 void testPivotTableTabularModeXLSX();
@@ -130,6 +132,8 @@ public:
 CPPUNIT_TEST(testPivotTableBoolFieldFilterXLSX);
 CPPUNIT_TEST(testPivotTableRowColPageFieldFilterXLSX);
 CPPUNIT_TEST(testPivotTableErrorItemFilterXLSX);
+CPPUNIT_TEST(testPivotTableErrorItemFilterXLSB);
+CPPUNIT_TEST(testPivotTableErrorItem2FilterXLSX);
 CPPUNIT_TEST(testPivotTableOutlineModeXLSX);
 CPPUNIT_TEST(testPivotTableDuplicatedMemberFilterXLSX);
 CPPUNIT_TEST(testPivotTableTabularModeXLSX);
@@ -2370,6 +2374,58 @@ void 
ScPivotTableFiltersTest::testPivotTableErrorItemFilterXLSX()
 xDocSh->DoClose();
 }
 
+void ScPivotTableFiltersTest::testPivotTableErrorItemFilterXLSB()
+{
+ScDocShellRef xDocSh = loadDoc(u"pivottable_error_item_filter.", 
FORMAT_XLSB);
+CPPUNIT_ASSERT_MESSAGE("Failed to load file", xDocSh.is());
+ScDocument& rDoc = xDocSh->GetDocument();
+ScDPCollection* pDPs = rDoc.GetDPCollection();
+CPPUNIT_ASSERT_EQUAL(static_cast(1), pDPs->GetCount());
+const ScDPObject* pDPObj = &(*pDPs)[0];
+CPPUNIT_ASSERT(pDPObj);
+ScDPSaveData* pSaveData = pDPObj->GetSaveData();
+CPPUNIT_ASSERT(pSaveData);
+
+ScDPSaveDimension* pSaveDim = pSaveData->GetExistingDimensionByName(u"b");
+CPPUNIT_ASSERT(pSaveDim);
+const ScDPSaveDimension::MemberList& rMembers = pSaveDim->GetMembers();
+CPPUNIT_ASSERT_EQUAL(size_t(4), rMembers.size());
+ScDPSaveMember* pMember = pSaveDim->GetExistingMemberByName("#DIV/0!");
+CPPUNIT_ASSERT(pMember);
+CPPUNIT_ASSERT(pMember->HasIsVisible());
+CPPUNIT_ASSERT(!pMember->GetIsVisible());
+
+xDocSh->DoClose();
+}
+
+void ScPivotTableFiltersTest::testPivotTableErrorItem2FilterXLSX()
+{
+ScDocShellRef xDocSh = loadDoc(u"tdf122471.", FORMAT_XLSX);
+CPPUNIT_ASSERT_MESSAGE("Failed to load file", xDocSh.is());
+ScDocument& rDoc = xDocSh->GetDocument();
+ScDPCollection* pDPs = rDoc.GetDPCollection();
+CPPUNIT_ASSERT_EQUAL(static_cast(1), pDPs->GetCount());
+
+// Reload and check whether filtering is preserved
+xDocSh = saveAndReload(&(*xDocSh), FORMAT_XLSX);
+CPPUNIT_ASSERT_MESSAGE("Failed to load file", xDocSh.is());
+ScDocument& rLoadedDoc = 

[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sc/qa sc/source

2022-03-02 Thread Justin Luth (via logerrit)
 sc/qa/unit/pivottable_filters_test.cxx |5 +++--
 sc/source/filter/excel/xestream.cxx|5 -
 sc/source/filter/oox/formulabuffer.cxx |7 +++
 3 files changed, 14 insertions(+), 3 deletions(-)

New commits:
commit e4f76cd9a4814ce6cc4795e5e1a5c74d54cb7513
Author: Justin Luth 
AuthorDate: Wed Feb 23 10:34:29 2022 +0200
Commit: Eike Rathke 
CommitDate: Wed Mar 2 13:05:22 2022 +0100

tdf#122098 xlsx im/export: let formulas guess their number format

SQUASHED backport: includes followup
  commit 5a64b618d84edb65465950d54e3b4afc952a301c

This fixes the import side of a LO 4.2 regression
from commit 07b66cd3ac1a9f6c7b61a1d7da6e9d266e6de92d
and the export side of a LO 4.3 regression
from commit 69ecdad805281b2cb6ec2437da18daa19576deae

make CppunitTest_sc_pivottable_filters_test \
  CPPUNIT_TEST_NAME=testPivotTableBoolFieldFilterXLSX

Change-Id: I4c680dbff844cf1eca52de641856daafa032eeb4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130406
Tested-by: Justin Luth 
Reviewed-by: Justin Luth 
(cherry picked from commit 8f5d8669ca74fed8608e438a8436c173e35d43a6)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130386
Tested-by: Jenkins
Reviewed-by: Eike Rathke 

diff --git a/sc/qa/unit/pivottable_filters_test.cxx 
b/sc/qa/unit/pivottable_filters_test.cxx
index 8ad8fbffee81..80557c5b12aa 100644
--- a/sc/qa/unit/pivottable_filters_test.cxx
+++ b/sc/qa/unit/pivottable_filters_test.cxx
@@ -2201,6 +2201,7 @@ void 
ScPivotTableFiltersTest::testPivotTableBoolFieldFilterXLSX()
 ScDocument& rDoc = xDocSh->GetDocument();
 ScDPCollection* pDPs = rDoc.GetDPCollection();
 CPPUNIT_ASSERT_EQUAL(static_cast(1), pDPs->GetCount());
+CPPUNIT_ASSERT_EQUAL(OUString("TRUE"), rDoc.GetString(ScAddress(0, 1, 
0))); //A2
 
 // Reload and check filtering of row dimensions
 xDocSh = saveAndReload(&(*xDocSh), FORMAT_XLSX);
@@ -2218,11 +2219,11 @@ void 
ScPivotTableFiltersTest::testPivotTableBoolFieldFilterXLSX()
 
 const ScDPSaveDimension::MemberList& rMembers = pSaveDim->GetMembers();
 CPPUNIT_ASSERT_EQUAL(size_t(2), rMembers.size());
-ScDPSaveMember* pMember = pSaveDim->GetExistingMemberByName("0");
+ScDPSaveMember* pMember = pSaveDim->GetExistingMemberByName("FALSE");
 CPPUNIT_ASSERT(pMember);
 CPPUNIT_ASSERT(pMember->HasIsVisible());
 CPPUNIT_ASSERT(!pMember->GetIsVisible());
-pMember = pSaveDim->GetExistingMemberByName("1");
+pMember = pSaveDim->GetExistingMemberByName("TRUE");
 CPPUNIT_ASSERT(pMember);
 CPPUNIT_ASSERT(pMember->HasIsVisible());
 CPPUNIT_ASSERT(pMember->GetIsVisible());
diff --git a/sc/source/filter/excel/xestream.cxx 
b/sc/source/filter/excel/xestream.cxx
index 17395145bbab..3b49c5d6b9e2 100644
--- a/sc/source/filter/excel/xestream.cxx
+++ b/sc/source/filter/excel/xestream.cxx
@@ -670,7 +670,10 @@ void XclXmlUtils::GetFormulaTypeAndValue( ScFormulaCell& 
rCell, const char*& rsT
 rsValue = ToOUString(lcl_GetErrorString(aResValue.mnError));
 break;
 case sc::FormulaResultValue::Value:
-rsType = "n";
+rsType = rCell.GetFormatType() == SvNumFormatType::LOGICAL
+ && (aResValue.mfValue == 0.0 || aResValue.mfValue 
== 1.0)
+ ? "b"
+ : "n";
 rsValue = OUString::number(aResValue.mfValue);
 break;
 case sc::FormulaResultValue::String:
diff --git a/sc/source/filter/oox/formulabuffer.cxx 
b/sc/source/filter/oox/formulabuffer.cxx
index 2aeccb1b37b7..7fcc4f5e259f 100644
--- a/sc/source/filter/oox/formulabuffer.cxx
+++ b/sc/source/filter/oox/formulabuffer.cxx
@@ -153,6 +153,9 @@ void applySharedFormulas(
 pCell = new ScFormulaCell(rDoc.getDoc(), aPos, *pArray);
 
 rDoc.setFormulaCell(aPos, pCell);
+if (rDoc.getDoc().GetNumberFormat(aPos.Col(), aPos.Row(), 
aPos.Tab()) % SV_COUNTRY_LANGUAGE_OFFSET == 0)
+pCell->SetNeedNumberFormat(true);
+
 if (rDesc.maCellValue.isEmpty())
 {
 // No cached cell value. Mark it for re-calculation.
@@ -227,6 +230,8 @@ void applyCellFormulas(
 pCell = new ScFormulaCell(rDoc.getDoc(), aPos, 
p->mpCell->GetCode()->Clone());
 
 rDoc.setFormulaCell(aPos, pCell);
+if (rDoc.getDoc().GetNumberFormat(aPos.Col(), aPos.Row(), 
aPos.Tab()) % SV_COUNTRY_LANGUAGE_OFFSET == 0)
+pCell->SetNeedNumberFormat(true);
 
 // Update the cache.
 p->mnRow = aPos.Row();
@@ -245,6 +250,8 @@ void applyCellFormulas(
 
 ScFormulaCell* pCell = new ScFormulaCell(rDoc.getDoc(), aPos, 
std::move(pCode));
 rDoc.setFormulaCell(aPos, pCell);
+if (rDoc.getDoc().GetNumberFormat(aPos.Col(), aPos.Row(), aPos.Tab()) 
% SV_COUNTRY_LANGUAGE_OFFSET == 0)
+pCell->SetNeedNumberFormat(true);
 

[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sc/qa sc/source

2022-02-24 Thread Mike Kaganski (via logerrit)
 sc/qa/extras/macros-test.cxx  |   64 ++
 sc/source/ui/vba/vbarange.cxx |6 +--
 2 files changed, 67 insertions(+), 3 deletions(-)

New commits:
commit e85d2140ae5e9a611754c29aa4e5cdb6ad7fcab0
Author: Mike Kaganski 
AuthorDate: Wed Feb 23 18:14:38 2022 +0300
Commit: Michael Stahl 
CommitDate: Thu Feb 24 11:31:29 2022 +0100

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 
  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 
  Date:   Wed Apr 04 15:30:35 2012 -0400

Cleanup. ScPivot(Collection) is no more.

but was restored by commit 3e887edcaacc5b0f5e35d682a259124648e84229
  Author: Markus Mohrhard 
  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 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130476
Reviewed-by: Michael Stahl 

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 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -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 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 aOutParamIndex;
+Sequence aOutParam;
+
+SfxObjectShell* pFoundShell = 
SfxObjectShell::GetShellFromComponent(xComponent);
+ScDocShell* pDocSh = static_cast(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=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=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 

[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sc/qa sc/source

2022-02-15 Thread Andreas Heinisch (via logerrit)
 sc/qa/extras/macros-test.cxx |   40 +++
 sc/qa/extras/testdocuments/tdf104902.ods |binary
 sc/source/ui/view/viewfunc.cxx   |   17 -
 3 files changed, 56 insertions(+), 1 deletion(-)

New commits:
commit 7f220aeae695e06c5e5dfed6ccf1d8b8f8a13e6e
Author: Andreas Heinisch 
AuthorDate: Thu Dec 30 19:57:10 2021 +0100
Commit: Xisco Fauli 
CommitDate: Tue Feb 15 21:28:51 2022 +0100

tdf#104902 - Handle embedded newline in Calc's .uno:EnterString

Change-Id: I6377aebb06b6e6873ce61984a887d9e16eecd361
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127766
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 
(cherry picked from commit 44d237c375b7ef9a5a61a2f752bd19b57649ffbd)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129932
Reviewed-by: Xisco Fauli 

diff --git a/sc/qa/extras/macros-test.cxx b/sc/qa/extras/macros-test.cxx
index cf732e2dd294..559dd903e4eb 100644
--- a/sc/qa/extras/macros-test.cxx
+++ b/sc/qa/extras/macros-test.cxx
@@ -51,6 +51,7 @@ public:
 void testTdf114427();
 void testTdf107885();
 void testRowColumn();
+void testTdf104902();
 void testTdf142033();
 void testTdf131562();
 void testPasswordProtectedUnicodeString();
@@ -82,6 +83,7 @@ public:
 CPPUNIT_TEST(testTdf114427);
 CPPUNIT_TEST(testTdf107885);
 CPPUNIT_TEST(testRowColumn);
+CPPUNIT_TEST(testTdf104902);
 CPPUNIT_TEST(testTdf142033);
 CPPUNIT_TEST(testTdf131562);
 CPPUNIT_TEST(testPasswordProtectedUnicodeString);
@@ -552,6 +554,44 @@ void ScMacrosTest::testMacroButtonFormControlXlsxExport()
 assertXPath(pWorkbookDoc, "//x:workbook/definedNames", 0);
 }
 
+void ScMacrosTest::testTdf104902()
+{
+OUString aFileName;
+createFileURL(u"tdf104902.ods", aFileName);
+uno::Reference xComponent = 
loadFromDesktop(aFileName, "com.sun.star.sheet.SpreadsheetDocument");
+
+Any aRet;
+Sequence aOutParamIndex;
+Sequence aOutParam;
+Sequence aParams;
+
+SfxObjectShell::CallXScript(
+xComponent,
+
"vnd.sun.Star.script:Standard.Module1.display_bug?language=Basic=document",
+aParams, aRet, aOutParamIndex, aOutParam);
+
+// Export to ODS
+saveAndReload(xComponent, "calc8");
+CPPUNIT_ASSERT(xComponent);
+
+SfxObjectShell* pFoundShell = 
SfxObjectShell::GetShellFromComponent(xComponent);
+
+CPPUNIT_ASSERT_MESSAGE("Failed to access document shell", pFoundShell);
+ScDocShell* pDocSh = static_cast(pFoundShell);
+ScDocument& rDoc = pDocSh->GetDocument();
+
+CPPUNIT_ASSERT_EQUAL(OUString("string no newlines"), 
rDoc.GetString(ScAddress(0, 0, 0)));
+
+// Without the fix in place, this test would have failed with
+// - Expected: string with
+// newlines
+// - Actual  : string withnewlines
+CPPUNIT_ASSERT_EQUAL(OUString(u"string with" + OUStringChar(u'\xA') + 
u"newlines"), rDoc.GetString(ScAddress(0, 1, 0)));
+
+css::uno::Reference xCloseable(xComponent, 
css::uno::UNO_QUERY_THROW);
+xCloseable->close(true);
+}
+
 void ScMacrosTest::testTdf142033()
 {
 OUString aFileName;
diff --git a/sc/qa/extras/testdocuments/tdf104902.ods 
b/sc/qa/extras/testdocuments/tdf104902.ods
new file mode 100644
index ..8524522fdcd3
Binary files /dev/null and b/sc/qa/extras/testdocuments/tdf104902.ods differ
diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index ecaa0a2cdf8a..95020795aceb 100644
--- a/sc/source/ui/view/viewfunc.cxx
+++ b/sc/source/ui/view/viewfunc.cxx
@@ -77,6 +77,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -578,10 +579,24 @@ void ScViewFunc::EnterData( SCCOL nCol, SCROW nRow, SCTAB 
nTab,
 }
 else
 {
+ScFieldEditEngine& rEngine = rDoc.GetEditEngine();
 for (const auto& rTab : rMark)
 {
 bool bNumFmtSet = false;
-rFunc.SetNormalString( bNumFmtSet, ScAddress( nCol, nRow, rTab ), 
rString, false );
+const ScAddress aScAddress(nCol, nRow, rTab);
+
+// tdf#104902 - handle embedded newline
+if (ScStringUtil::isMultiline(rString))
+{
+rEngine.SetTextCurrentDefaults(rString);
+rDoc.SetEditText(aScAddress, rEngine.CreateTextObject());
+pDocSh->AdjustRowHeight(nRow, nRow, rTab);
+}
+else
+{
+rFunc.SetNormalString(bNumFmtSet, aScAddress, rString, false);
+}
+
 if (bNumFmtSet)
 {
 /* FIXME: if set on any sheet results in changed only on


[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sc/qa sc/source

2022-02-10 Thread Justin Luth (via logerrit)
 sc/qa/uitest/calc_tests/autofill.py |   30 ++
 sc/qa/uitest/data/autofill.ods  |binary
 sc/source/core/data/table2.cxx  |7 +--
 3 files changed, 35 insertions(+), 2 deletions(-)

New commits:
commit 35302c773ab352f2a9681839c6c11c67d765fbe8
Author: Justin Luth 
AuthorDate: Wed Feb 9 20:17:53 2022 +0200
Commit: Eike Rathke 
CommitDate: Thu Feb 10 16:02:11 2022 +0100

tdf#113785 sc: IsDataFiltered must be normalized

I can't believe this hasn't caused major issues
and has survived as a bug for so long.

Due to the way IsDataFiltered is coded,
it is required that the range is normalized
in order to get any kind of meaningful result,
so lets ensure that.

Change-Id: I2ede77f738fbaeb05a0f1425a2e88e59fca08e9e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129735
Tested-by: Jenkins
Reviewed-by: Justin Luth 
(cherry picked from commit bda200a5e9c4592bd61b7924fa171ec3265bfd24)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129761
Reviewed-by: Eike Rathke 

diff --git a/sc/qa/uitest/calc_tests/autofill.py 
b/sc/qa/uitest/calc_tests/autofill.py
index cdd92ea30947..594d29872a47 100644
--- a/sc/qa/uitest/calc_tests/autofill.py
+++ b/sc/qa/uitest/calc_tests/autofill.py
@@ -47,6 +47,36 @@ class CalcAutofill(UITestCase):
 self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 
10).getValue(), 17.34)
 self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 
11).getValue(), 18.34)
 
+#Test that hidden cells are not affected / skipped in the 
increment process.
+#Simulate selecting cell A26 and dragging the fill handle in the 
bottom right corner of the cell down to A32
+gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": 
"A26:A32"}))
+with 
self.ui_test.execute_dialog_through_command(".uno:FillSeries"):
+pass
+self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 
25).getValue(), 18.34)
+self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 
26).getValue(), 19.34)
+self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 
27).getValue(), 5.0) #hidden
+self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 
28).getValue(), 5.0) #hidden
+self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 
29).getString(), "hiddenA30")
+self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 
30).getValue(), 20.34) #overwrite "rows"
+self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 
31).getValue(), 21.34)
+#Simulate selecting cell A26 and dragging the fill handle in the 
bottom right corner of the cell up to A19
+#   Note: start at empty cell A19 so Sheet - Fill Cells - Fill 
Series has good defaults
+gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": 
"A19:A26"}))
+with 
self.ui_test.execute_dialog_through_command(".uno:FillSeries") as xDialog:
+xup = xDialog.getChild("up")
+xincrement = xDialog.getChild("increment")
+xup.executeAction("CLICK", tuple())
+xincrement.executeAction("TYPE", 
mkPropertyValues({"KEYCODE":"CTRL+A"}))
+xincrement.executeAction("TYPE", 
mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+xincrement.executeAction("TYPE", 
mkPropertyValues({"TEXT":"-1"}))
+self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 
19).getString(), "hiddenA20")
+self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 
20).getValue(), 15.34)
+self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 
21).getValue(), 5.0) #hidden
+self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 
22).getValue(), 16.34) #overwrite "testing"
+self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 
23).getValue(), 5.0) #hidden
+self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 
24).getValue(), 17.34) #overwrite "hidden"
+self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 
25).getValue(), 18.34)
+
 #Continue with the next cells with grey background
 gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": 
"M12:M18"}))
 with 
self.ui_test.execute_dialog_through_command(".uno:FillSeries"):
diff --git a/sc/qa/uitest/data/autofill.ods b/sc/qa/uitest/data/autofill.ods
index 4456e8c8..90bf933c0c26 100644
Binary files a/sc/qa/uitest/data/autofill.ods and 
b/sc/qa/uitest/data/autofill.ods differ
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 40c515b9b10b..f78a17fe3eed 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -3671,6 +3671,8 @@ void ScTable::ShowRows(SCROW nRow1, SCROW nRow2, bool 
bShow)
 
 bool ScTable::IsDataFiltered(SCCOL nColStart, SCROW nRowStart, SCCOL nColEnd, 
SCROW nRowEnd) const
 {
+assert(nColStart <= 

[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sc/qa sc/source

2022-01-11 Thread Vasily Melenchuk (via logerrit)
 sc/qa/unit/data/ods/tdf145059.ods  |binary
 sc/qa/unit/subsequent_export_test2.cxx |   31 +++
 sc/source/filter/excel/excrecds.cxx|4 
 sc/source/filter/excel/xestyle.cxx |   16 
 sc/source/filter/inc/xestyle.hxx   |5 +++--
 5 files changed, 50 insertions(+), 6 deletions(-)

New commits:
commit d73cf0abc3d1bfd7e3a1d3d1b41c63bbb17d61bb
Author: Vasily Melenchuk 
AuthorDate: Thu Dec 30 15:32:37 2021 +0300
Commit: Thorsten Behrens 
CommitDate: Tue Jan 11 09:11:54 2022 +0100

tdf#145059: sc: always write dxf node for color filter for XLSX

If there is no dxf reference to color filter (for example if selected
color is not in range of available colors for current range) Excel
is not able to show color filter correctly: it is not marked as used
filter, no ability to reset, etc.

Change-Id: I65378ddd6f8f8233cda147ff9dcd28f455a58225
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127745
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
(cherry picked from commit f0ad6ec2a23a36ade407db8cda36655ba2f144c1)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128159

diff --git a/sc/qa/unit/data/ods/tdf145059.ods 
b/sc/qa/unit/data/ods/tdf145059.ods
new file mode 100644
index ..a76da3b5cb4e
Binary files /dev/null and b/sc/qa/unit/data/ods/tdf145059.ods differ
diff --git a/sc/qa/unit/subsequent_export_test2.cxx 
b/sc/qa/unit/subsequent_export_test2.cxx
index 20be9da85bfb..f035efba1aac 100644
--- a/sc/qa/unit/subsequent_export_test2.cxx
+++ b/sc/qa/unit/subsequent_export_test2.cxx
@@ -214,6 +214,7 @@ public:
 void testTdf142264ManyChartsToXLSX();
 void testTdf143929MultiColumnToODS();
 void testTdf142578();
+void testTdf145059();
 void testTdf130104_XLSXIndent();
 
 CPPUNIT_TEST_SUITE(ScExportTest2);
@@ -328,6 +329,7 @@ public:
 CPPUNIT_TEST(testTdf142264ManyChartsToXLSX);
 CPPUNIT_TEST(testTdf143929MultiColumnToODS);
 CPPUNIT_TEST(testTdf142578);
+CPPUNIT_TEST(testTdf145059);
 CPPUNIT_TEST(testTdf130104_XLSXIndent);
 
 CPPUNIT_TEST_SUITE_END();
@@ -2993,6 +2995,35 @@ void ScExportTest2::testTdf142578()
 xDocSh->DoClose();
 }
 
+void ScExportTest2::testTdf145059()
+{
+ScDocShellRef xDocSh = loadDoc(u"tdf145059.", FORMAT_ODS);
+CPPUNIT_ASSERT(xDocSh);
+
+// Export to xlsx.
+std::shared_ptr pXPathFile
+= ScBootstrapFixture::exportTo(&(*xDocSh), FORMAT_XLSX);
+xmlDocUniquePtr pSheet
+= XPathHelper::parseExport(pXPathFile, m_xSFactory, 
"xl/worksheets/sheet1.xml");
+CPPUNIT_ASSERT(pSheet);
+xmlDocUniquePtr pStyle = XPathHelper::parseExport(pXPathFile, m_xSFactory, 
"xl/styles.xml");
+CPPUNIT_ASSERT(pStyle);
+
+sal_Int32 nColorFilterDxdId
+= getXPath(pSheet, 
"/x:worksheet/x:autoFilter/x:filterColumn/x:colorFilter", "dxfId")
+  .toInt32();
+
+// Ensure that dxf id is not -1
+CPPUNIT_ASSERT(nColorFilterDxdId >= 0);
+
+// Find color by this dxfid
+OString sDxfIdPath = "/x:styleSheet/x:dxfs/x:dxf[" + 
OString::number(nColorFilterDxdId + 1)
+ + "]/x:fill/x:patternFill/x:fgColor";
+assertXPath(pStyle, sDxfIdPath, "rgb", "FF4472C4");
+
+xDocSh->DoClose();
+}
+
 void ScExportTest2::testTdf130104_XLSXIndent()
 {
 ScDocShellRef xDocSh = loadDoc(u"tdf130104_indent.", FORMAT_XLSX);
diff --git a/sc/source/filter/excel/excrecds.cxx 
b/sc/source/filter/excel/excrecds.cxx
index 65edd87ee5bc..570167b8014b 100644
--- a/sc/source/filter/excel/excrecds.cxx
+++ b/sc/source/filter/excel/excrecds.cxx
@@ -796,6 +796,10 @@ void XclExpAutofilter::AddColorEntry(const ScQueryEntry& 
rEntry)
 {
 maColorValues.push_back(
 std::make_pair(rItem.maColor, rItem.meType == 
ScQueryEntry::ByBackgroundColor));
+// Ensure that selected color(s) will be added to dxf: selection can 
be not in list
+// of already added to dfx colors taken from filter range
+if (GetDxfs().GetDxfByColor(rItem.maColor) == -1)
+GetDxfs().AddColor(rItem.maColor);
 }
 }
 
diff --git a/sc/source/filter/excel/xestyle.cxx 
b/sc/source/filter/excel/xestyle.cxx
index 3898c5cad9b6..291b51c6c83e 100644
--- a/sc/source/filter/excel/xestyle.cxx
+++ b/sc/source/filter/excel/xestyle.cxx
@@ -3176,22 +3176,30 @@ XclExpDxfs::XclExpDxfs( const XclExpRoot& rRoot )
 }
 }
 
-sal_Int32 XclExpDxfs::GetDxfId( const OUString& rStyleName )
+sal_Int32 XclExpDxfs::GetDxfId( const OUString& rStyleName ) const
 {
-std::map::iterator itr = 
maStyleNameToDxfId.find(rStyleName);
+std::map::const_iterator itr = 
maStyleNameToDxfId.find(rStyleName);
 if(itr!= maStyleNameToDxfId.end())
 return itr->second;
 return -1;
 }
 
-sal_Int32 XclExpDxfs::GetDxfByColor(Color aColor)
+sal_Int32 XclExpDxfs::GetDxfByColor(Color aColor) const
 {
-std::map::iterator itr = maColorToDxfId.find(aColor);
+

[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sc/qa

2022-01-04 Thread Stephan Bergmann (via logerrit)
 sc/qa/unit/functions_array.cxx |   16 
 1 file changed, 16 insertions(+)

New commits:
commit 665131cf4be77594e4a8352f2d4a38446b69906a
Author: Stephan Bergmann 
AuthorDate: Mon Dec 13 11:29:56 2021 +0100
Commit: Eike Rathke 
CommitDate: Tue Jan 4 15:49:35 2022 +0100

For now, disable tests giving dubious results on AArch64

when built with -ffp-contract enabled (-ffp-contract=on default on Clang 14
trunk since


"Making the code compliant to the documentation about Floating Point", cf.
19559ebbee160d1625d06feec7e6566772dad231 "Allow for a presumably more 
precise
result of BESSELY(80,9)"; and -ffp-contract=fast default when building with
optimizations on GCC) on both Linux (with
6cb20e0b298f41fe88984aebfe5454f936a0ae3a "Disable
CppunitTset_sc_*_functions_test for linux_aarch64 for now, too" reverted) 
and
macOS.

Change-Id: Ie867d999173410ec9868bd14c0ee04bbba371920
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126727
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 
(cherry picked from commit 72b25619960cdaa829c8ea10e27d9c0b20a2c26f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127784
Reviewed-by: Eike Rathke 

diff --git a/sc/qa/unit/data/functions/array/fods/linest.fods 
b/sc/qa/unit/data/functions/array/dubious/fods/linest.fods
similarity index 100%
rename from sc/qa/unit/data/functions/array/fods/linest.fods
rename to sc/qa/unit/data/functions/array/dubious/fods/linest.fods
diff --git a/sc/qa/unit/data/functions/array/fods/minverse.fods 
b/sc/qa/unit/data/functions/array/dubious/fods/minverse.fods
similarity index 100%
rename from sc/qa/unit/data/functions/array/fods/minverse.fods
rename to sc/qa/unit/data/functions/array/dubious/fods/minverse.fods
diff --git a/sc/qa/unit/functions_array.cxx b/sc/qa/unit/functions_array.cxx
index 00a17de34fd6..88a4b70d7c29 100644
--- a/sc/qa/unit/functions_array.cxx
+++ b/sc/qa/unit/functions_array.cxx
@@ -6,9 +6,11 @@ public:
 ArrayFunctionsTest();
 
 void testArrayFormulasFODS();
+void testDubiousArrayFormulasFODS();
 
 CPPUNIT_TEST_SUITE(ArrayFunctionsTest);
 CPPUNIT_TEST(testArrayFormulasFODS);
+CPPUNIT_TEST(testDubiousArrayFormulasFODS);
 CPPUNIT_TEST_SUITE_END();
 
 };
@@ -21,6 +23,20 @@ void ArrayFunctionsTest::testArrayFormulasFODS()
 FODS_FORMAT_TYPE, SotClipboardFormatId::NONE, 0, false);
 }
 
+void ArrayFunctionsTest::testDubiousArrayFormulasFODS()
+{
+//TODO: sc/qa/unit/data/functions/array/dubious/fods/linest.fods produces 
widely different
+// values when built with -ffp-contract enabled (-ffp-contract=on default 
on Clang 14,
+// -ffp-contract=fast default when building with optimizations on GCC) on 
at least aarch64:
+#if !((defined __clang__ || defined __GNUC__) && defined __aarch64__)
+OUString aDirectoryURL
+= 
m_directories.getURLFromSrc(u"/sc/qa/unit/data/functions/array/dubious/fods/");
+recursiveScan(test::pass, "OpenDocument Spreadsheet Flat XML", 
aDirectoryURL,
+
"com.sun.star.comp.filter.OdfFlatXml,,com.sun.star.comp.Calc.XMLOasisImporter,com.sun.star.comp.Calc.XMLOasisExporter,,,true",
+FODS_FORMAT_TYPE, SotClipboardFormatId::NONE, 0, false);
+#endif
+}
+
 ArrayFunctionsTest::ArrayFunctionsTest():
 FunctionsTest("sc/qa/unit/data/functions/array/fods/")
 {


[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sc/qa

2022-01-03 Thread Xisco Fauli (via logerrit)
 sc/qa/unit/subsequent_filters_test2.cxx |   12 +++-
 1 file changed, 7 insertions(+), 5 deletions(-)

New commits:
commit cceb1e07569261d1828ce1fc08861b407486930b
Author: Xisco Fauli 
AuthorDate: Mon Jan 3 11:16:40 2022 +0100
Commit: Xisco Fauli 
CommitDate: Mon Jan 3 15:32:49 2022 +0100

CppunitTest_sc_subsequent_filters_test2: check format instead of string

Otherwise, this might fail. See 660e538ee77109bc3e7dff4491164d696e503abc
< Disable broken part of ScFiltersTest2::testTdf126116 >

Change-Id: I40534b70fc19ee163d9e6cb0c081fae40b81fdb9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127774
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/sc/qa/unit/subsequent_filters_test2.cxx 
b/sc/qa/unit/subsequent_filters_test2.cxx
index ca69e1f6e3b3..75db57388f41 100644
--- a/sc/qa/unit/subsequent_filters_test2.cxx
+++ b/sc/qa/unit/subsequent_filters_test2.cxx
@@ -21,6 +21,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1363,13 +1364,14 @@ void ScFiltersTest2::testTdf126116()
 
 rDoc.SetString(ScAddress(0, 0, 0), "03/03");
 
-// Get the current year from B1 with format YY
-OUString aYear = rDoc.GetString(ScAddress(1, 0, 0));
+sal_uInt32 nNumberFormat = rDoc.GetNumberFormat(0, 0, 0);
+const SvNumberformat* pNumberFormat = 
rDoc.GetFormatTable()->GetEntry(nNumberFormat);
+const OUString& rFormatStr = pNumberFormat->GetFormatstring();
 
 // Without the fix in place, this test would have failed with
-// - Expected: 03/03/21
-// - Actual  : 03/03/2021
-CPPUNIT_ASSERT_EQUAL(OUString("03/03/" + aYear), 
rDoc.GetString(ScAddress(0, 0, 0)));
+// - Expected: MM/DD/YY
+// - Actual  : MM/DD/
+CPPUNIT_ASSERT_EQUAL(OUString("MM/DD/YY"), rFormatStr);
 
 xDocSh->DoClose();
 }


[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sc/qa scripting/source

2021-12-23 Thread Mike Kaganski (via logerrit)
 sc/qa/extras/macros-test.cxx |6 +++---
 sc/qa/extras/testdocuments/tdf143582.ods |binary
 scripting/source/basprov/basscript.cxx   |3 +++
 3 files changed, 6 insertions(+), 3 deletions(-)

New commits:
commit 29ec800034211194f9e2ab1748e0b6a1011dcf3f
Author: Mike Kaganski 
AuthorDate: Wed Dec 22 14:55:01 2021 +0300
Commit: Xisco Fauli 
CommitDate: Thu Dec 23 21:30:24 2021 +0100

tdf#143582: Avoid error on clearing leftover return value of a method

SbxValue::Clear happens to not error out on clearing string and some
other types of objects, but for the rest, it calls SbxValue::Put, and
the latter errors out if not CanWrite(). The original test implemented
in commit 24d24debef4cda7de702c4b470a3707f1aae3ea3 only checked string
return value, so happened to miss this problem.

See similar code in SbiRuntime::FindElement.

Change-Id: I7c17137cc9e7ee3133ee86a9f701559df66e53b6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127248
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit 822998f1dc202aba7a558767f641687aef0c1148)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127257
Reviewed-by: Xisco Fauli 

diff --git a/sc/qa/extras/macros-test.cxx b/sc/qa/extras/macros-test.cxx
index a68b39ce1cbc..b18bb7ab52a1 100644
--- a/sc/qa/extras/macros-test.cxx
+++ b/sc/qa/extras/macros-test.cxx
@@ -1061,9 +1061,9 @@ void ScMacrosTest::testTdf143582()
 aRet >>= aReturnValue;
 
 // Without the fix in place, this test would have failed with
-// - Expected: Test
-// - Actual  : TeTest
-CPPUNIT_ASSERT_EQUAL(OUString("Test"), aReturnValue);
+// - Expected: Test6
+// - Actual  : TeTest8
+CPPUNIT_ASSERT_EQUAL(OUString("Test6"), aReturnValue);
 
 css::uno::Reference xCloseable(xComponent, 
css::uno::UNO_QUERY_THROW);
 xCloseable->close(true);
diff --git a/sc/qa/extras/testdocuments/tdf143582.ods 
b/sc/qa/extras/testdocuments/tdf143582.ods
index 05f4f07cea2c..1375bf5b9565 100644
Binary files a/sc/qa/extras/testdocuments/tdf143582.ods and 
b/sc/qa/extras/testdocuments/tdf143582.ods differ
diff --git a/scripting/source/basprov/basscript.cxx 
b/scripting/source/basprov/basscript.cxx
index 0b411c83f180..2cc67d4feb05 100644
--- a/scripting/source/basprov/basscript.cxx
+++ b/scripting/source/basprov/basscript.cxx
@@ -245,7 +245,10 @@ constexpr OUStringLiteral BASSCRIPT_PROPERTY_CALLER = 
u"Caller";
 aOldThisComponent = 
m_documentBasicManager->SetGlobalUNOConstant( "ThisComponent", makeAny( 
m_xDocumentScriptContext ) );
 
 // tdf#143582 - clear return value of the method before calling it
+const SbxFlagBits nSavFlags = m_xMethod->GetFlags();
+m_xMethod->SetFlag(SbxFlagBits::ReadWrite | 
SbxFlagBits::NoBroadcast);
 m_xMethod->Clear();
+m_xMethod->SetFlags(nSavFlags);
 if ( m_caller.hasElements() && m_caller[ 0 ].hasValue()  )
 {
 SbxVariableRef xCallerVar = new SbxVariable( SbxVARIANT );


[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sc/qa

2021-12-23 Thread Xisco Fauli (via logerrit)
 dev/null|binary
 sc/qa/unit/data/fods/tdf126116.fods |  170 
 sc/qa/unit/subsequent_filters_test2.cxx |7 -
 3 files changed, 175 insertions(+), 2 deletions(-)

New commits:
commit d5c8e1e0ddda213b3d4d64510259dba45315518e
Author: Xisco Fauli 
AuthorDate: Fri Dec 23 15:43:27 2022 +0100
Commit: Xisco Fauli 
CommitDate: Thu Dec 23 19:52:57 2021 +0100

CppunitTest_sc_subsequent_filters_test2: fix test depending on current year

While at it, move the file from ods to fods
for better tracking in git

Change-Id: I16df221e3a7341dc7c53de6130158c3887c472a6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127361
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 
(cherry picked from commit f4ab9cf69c3b1e9f17fc3873f160ddebd5f812fb)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127370
Reviewed-by: Eike Rathke 

diff --git a/sc/qa/unit/data/fods/tdf126116.fods 
b/sc/qa/unit/data/fods/tdf126116.fods
new file mode 100644
index ..2db351642f73
--- /dev/null
+++ b/sc/qa/unit/data/fods/tdf126116.fods
@@ -0,0 +1,170 @@
+
+
+http://www.w3.org/TR/css3-text/; 
xmlns:grddl="http://www.w3.org/2003/g/data-view#; 
xmlns:xhtml="http://www.w3.org/1999/xhtml; 
xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema; 
xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" 
xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" 
xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" 
xmlns:oooc="http://openoffice.org/2004/calc; 
xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" 
xmlns:ooow="http://openoffice.org/2004/writer; 
xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" 
xmlns:dc="http://purl.org/dc/elements/1.1/; 
xmlns:rpt="http://openoffice.org/2005/report; 
xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" 
xmlns:config="urn:oasis:nam
 es:tc:opendocument:xmlns:config:1.0" 
xmlns:xlink="http://www.w3.org/1999/xlink; 
xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" 
xmlns:ooo="http://openoffice.org/2004/office; 
xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" 
xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" 
xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" 
xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" 
xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" 
xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0"
 xmlns:tableooo="http://openoffice.org/2009/table; 
xmlns:drawooo="http://openoffice.org/2010/draw; 
xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0"
 xmlns:dom="http://www.w3.org/2001/xml-events; 
xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" 
xmlns:math="http://www.w3.org/1998/Math/MathML; 
xmlns:form="urn:oasis:names:tc:opendocument:xmlns:fo
 rm:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" 
xmlns:xforms="http://www.w3.org/2002/xforms; office:version="1.3" 
office:mimetype="application/vnd.oasis.opendocument.spreadsheet">
+ 
+  
+   
+   
+  
+  
+   
+  
+  
+   
+  
+  
+  
+   
+  
+  
+   
+  
+  
+   
+  
+  
+  
+   
+   
+  
+  
+   
+  
+  
+   
+  
+  
+  
+   
+   
+  
+  
+   
+   
+  
+  
+   
+   
+  
+  
+   
+  
+  
+   
+   
+  
+  
+   
+  
+  
+   
+   
+  
+  
+   
+   
+  
+  
+   
+  
+  
+   
+  
+ 
+ 
+  
+   
+  
+  
+   
+  
+  
+   
+  
+  
+   
+  
+  
+   
+   /
+   
+   /
+   
+  
+  
+  
+  
+  
+  
+   
+   
+
+   
+   
+
+   
+  
+  
+   
+   
+
+ 
+
+   
+   
+
+ 
+
+   
+  
+ 
+ 
+  
+   
+???
+   
+   
+   
+   
+Page 1
+   
+   
+   
+  
+  
+   
+
+ 
???(???)
+
+
+ 00/00/, 00:00:00
+
+   
+   
+   
+   
+Page 1/ 
99
+   
+   
+   
+  
+ 
+ 
+  
+   
+   
+
+
+
+ 
+  02/02/21
+ 
+ 
+  21
+ 
+
+   
+   
+  
+ 
+
diff --git a/sc/qa/unit/data/ods/tdf126116.ods 
b/sc/qa/unit/data/ods/tdf126116.ods
deleted file mode 100644
index c9fb2816e21c..
Binary files a/sc/qa/unit/data/ods/tdf126116.ods and /dev/null differ
diff --git a/sc/qa/unit/subsequent_filters_test2.cxx 
b/sc/qa/unit/subsequent_filters_test2.cxx
index 87186e3443e8..ca69e1f6e3b3 100644
--- a/sc/qa/unit/subsequent_filters_test2.cxx
+++ b/sc/qa/unit/subsequent_filters_test2.cxx
@@ -1355,7 +1355,7 @@ void ScFiltersTest2::testTdf103734()
 
 void ScFiltersTest2::testTdf126116()
 {
-ScDocShellRef xDocSh = loadDoc(u"tdf126116.", FORMAT_ODS);
+ScDocShellRef xDocSh = loadDoc(u"tdf126116.", FORMAT_FODS);
 CPPUNIT_ASSERT_MESSAGE("Failed to open doc", xDocSh.is());
 ScDocument& rDoc = xDocSh->GetDocument();
 
@@ -1363,10 +1363,13 @@ void ScFiltersTest2::testTdf126116()
 
 

[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sc/qa sc/source

2021-12-11 Thread Justin Luth (via logerrit)
 sc/qa/unit/data/ods/tdf128895_emptyHiddenCols.ods |binary
 sc/qa/unit/subsequent_export_test.cxx |   18 ++
 sc/source/filter/xml/xmlcoli.cxx  |1 +
 3 files changed, 19 insertions(+)

New commits:
commit ea229b09c3de7edb8fcb01a727b656f4d35821d4
Author: Justin Luth 
AuthorDate: Wed Dec 8 14:22:01 2021 +0200
Commit: Justin Luth 
CommitDate: Sat Dec 11 16:56:17 2021 +0100

tdf#128895 sc xmlimport: create enough dynamic cols if props

Since LO 6.3, only 64 columns are created by default,
where previously it was a fixed 1024.

A common user practice is to hide all columns not used,
but this collapsed property was lost because
only part of the columns were actually created and thus exported.

In this example, import specifies 1017 hidden columns (H-AMJ),
but since only 64 columns are created, export only specified 57.

So ensure that on import, any column with defined properties
is created - even if they don't contain any content.

Change-Id: If928880baf5585613715a1f4361a9059584d1ad2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126540
Tested-by: Jenkins
Reviewed-by: Justin Luth 
Reviewed-by: Bartosz Kosiorek 
(cherry picked from commit 297ab561c6754f89326a1e8ce1751233669578d7)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126668

diff --git a/sc/qa/unit/data/ods/tdf128895_emptyHiddenCols.ods 
b/sc/qa/unit/data/ods/tdf128895_emptyHiddenCols.ods
new file mode 100644
index ..fa016369f206
Binary files /dev/null and b/sc/qa/unit/data/ods/tdf128895_emptyHiddenCols.ods 
differ
diff --git a/sc/qa/unit/subsequent_export_test.cxx 
b/sc/qa/unit/subsequent_export_test.cxx
index 8fbe40a10ac9..32f94549325b 100644
--- a/sc/qa/unit/subsequent_export_test.cxx
+++ b/sc/qa/unit/subsequent_export_test.cxx
@@ -143,6 +143,7 @@ public:
 #endif
 void testOutlineExportXLSX();
 void testHiddenEmptyRowsXLSX();
+void testHiddenEmptyColsODS();
 void testAllRowsHiddenXLSX();
 void testLandscapeOrientationXLSX();
 
@@ -259,6 +260,7 @@ public:
 #endif
 CPPUNIT_TEST(testOutlineExportXLSX);
 CPPUNIT_TEST(testHiddenEmptyRowsXLSX);
+CPPUNIT_TEST(testHiddenEmptyColsODS);
 CPPUNIT_TEST(testAllRowsHiddenXLSX);
 CPPUNIT_TEST(testLandscapeOrientationXLSX);
 CPPUNIT_TEST(testInlineArrayXLS);
@@ -1525,6 +1527,22 @@ void ScExportTest::testHiddenEmptyRowsXLSX()
 xShell->DoClose();
 }
 
+void ScExportTest::testHiddenEmptyColsODS()
+{
+//tdf#98106 FILESAVE: Hidden and empty rows became visible when export to 
.XLSX
+ScDocShellRef xShell = loadDoc(u"tdf128895_emptyHiddenCols.", FORMAT_ODS);
+CPPUNIT_ASSERT(xShell.is());
+
+std::shared_ptr pXPathFile
+= ScBootstrapFixture::exportTo(&(*xShell), FORMAT_ODS);
+xmlDocUniquePtr pSheet = XPathHelper::parseExport(pXPathFile, m_xSFactory, 
"content.xml");
+CPPUNIT_ASSERT(pSheet);
+assertXPath(pSheet, "//table:table/table:table-column[2]");
+assertXPath(pSheet, "//table:table/table:table-column[2]", 
"number-columns-repeated", "1017");
+
+xShell->DoClose();
+}
+
 void ScExportTest::testLandscapeOrientationXLSX()
 {
 //tdf#48767 - Landscape page orientation is not loaded from .xlsx format 
with MS Excel, after export with Libre Office
diff --git a/sc/source/filter/xml/xmlcoli.cxx b/sc/source/filter/xml/xmlcoli.cxx
index 09224bb757a3..fc40a6f63c6b 100644
--- a/sc/source/filter/xml/xmlcoli.cxx
+++ b/sc/source/filter/xml/xmlcoli.cxx
@@ -93,6 +93,7 @@ void SAL_CALL ScXMLTableColContext::endFastElement( sal_Int32 
/*nElement*/ )
 nLastColumn = pDoc->MaxCol();
 if (nCurrentColumn > pDoc->MaxCol())
 nCurrentColumn = pDoc->MaxCol();
+pDoc->CreateColumnIfNotExists(nSheet, nLastColumn);
 uno::Reference xColumnRowRange 
(xSheet->getCellRangeByPosition(nCurrentColumn, 0, nLastColumn, 0), 
uno::UNO_QUERY);
 if (xColumnRowRange.is())
 {


[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sc/qa sc/source

2021-12-10 Thread Winfried Donkers (via logerrit)
 sc/qa/unit/data/functions/database/fods/dcount.fods  |   21 +++
 sc/qa/unit/data/functions/database/fods/dcounta.fods |   21 +++
 sc/source/core/data/funcdesc.cxx |4 +--
 3 files changed, 36 insertions(+), 10 deletions(-)

New commits:
commit 1db4d3c869dbd4d68c0ab7b15c60bb2dad0a9f67
Author: Winfried Donkers 
AuthorDate: Thu Dec 9 17:39:58 2021 +0100
Commit: Xisco Fauli 
CommitDate: Fri Dec 10 13:52:37 2021 +0100

tdf#133353, Make 2nd argument optional for DCOUNT and DCOUNTA.

The functions accept empty second arguments, but the function
wizard and hints stated that it was required.

Change-Id: I74fcfcc31492ed776085d1bc6ee6a9ff22a87818
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126620
Tested-by: Eike Rathke 
Reviewed-by: Eike Rathke 
(cherry picked from commit 885465bc0ae6029d8adad57015fb0ff6c26a6ba6)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126594
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/sc/qa/unit/data/functions/database/fods/dcount.fods 
b/sc/qa/unit/data/functions/database/fods/dcount.fods
index 392bc86d017d..4e2b792e08f2 100644
--- a/sc/qa/unit/data/functions/database/fods/dcount.fods
+++ b/sc/qa/unit/data/functions/database/fods/dcount.fods
@@ -2183,9 +2183,22 @@
  
 
 
- 
- 
- 
+ 
+  2
+ 
+ 
+  2
+ 
+ 
+  TRUE
+ 
+ 
+  =DCOUNT(J1:N11,,J41:N42)
+ 
+ 
+  Tdf#13353
+ 
+ 
  
   =I
  
@@ -2940,4 +2953,4 @@

   
  
-
\ No newline at end of file
+
diff --git a/sc/qa/unit/data/functions/database/fods/dcounta.fods 
b/sc/qa/unit/data/functions/database/fods/dcounta.fods
index 1080e2cf64a5..c95c1472d713 100644
--- a/sc/qa/unit/data/functions/database/fods/dcounta.fods
+++ b/sc/qa/unit/data/functions/database/fods/dcounta.fods
@@ -864,9 +864,22 @@
  
 
 
- 
- 
- 
+ 
+  2
+ 
+ 
+  2
+ 
+ 
+  TRUE
+ 
+ 
+  =DCOUNTA(J1:N10,,J41:N42)
+ 
+ 
+  Tdf#13353
+ 
+ 
  
   Greta
  
@@ -1491,4 +1504,4 @@

   
  
-
\ No newline at end of file
+
diff --git a/sc/source/core/data/funcdesc.cxx b/sc/source/core/data/funcdesc.cxx
index 51f03a4e4bf4..01d8143a16f8 100644
--- a/sc/source/core/data/funcdesc.cxx
+++ b/sc/source/core/data/funcdesc.cxx
@@ -576,8 +576,8 @@ ScFunctionList::ScFunctionList()
 { SC_OPCODE_NOMINAL, ENTRY(SC_OPCODE_NOMINAL_ARY), 0, 
ID_FUNCTION_GRP_FINANCIAL, HID_FUNC_NOMINAL, 2, { 0, 0 }, 0 },
 { SC_OPCODE_SUB_TOTAL, ENTRY(SC_OPCODE_SUB_TOTAL_ARY), 0, 
ID_FUNCTION_GRP_MATH, HID_FUNC_TEILERGEBNIS, 2, { 0, 0 }, 0 },
 { SC_OPCODE_DB_SUM, ENTRY(SC_OPCODE_DB_SUM_ARY), 0, 
ID_FUNCTION_GRP_DATABASE, HID_FUNC_DBSUMME, 3, { 0, 0, 0 }, 0 },
-{ SC_OPCODE_DB_COUNT, ENTRY(SC_OPCODE_DB_COUNT_ARY), 0, 
ID_FUNCTION_GRP_DATABASE, HID_FUNC_DBANZAHL, 3, { 0, 0, 0 }, 0 },
-{ SC_OPCODE_DB_COUNT_2, ENTRY(SC_OPCODE_DB_COUNT_2_ARY), 0, 
ID_FUNCTION_GRP_DATABASE, HID_FUNC_DBANZAHL2, 3, { 0, 0, 0 }, 0 },
+{ SC_OPCODE_DB_COUNT, ENTRY(SC_OPCODE_DB_COUNT_ARY), 0, 
ID_FUNCTION_GRP_DATABASE, HID_FUNC_DBANZAHL, 3, { 0, 1, 0 }, 0 },
+{ SC_OPCODE_DB_COUNT_2, ENTRY(SC_OPCODE_DB_COUNT_2_ARY), 0, 
ID_FUNCTION_GRP_DATABASE, HID_FUNC_DBANZAHL2, 3, { 0, 1, 0 }, 0 },
 { SC_OPCODE_DB_AVERAGE, ENTRY(SC_OPCODE_DB_AVERAGE_ARY), 0, 
ID_FUNCTION_GRP_DATABASE, HID_FUNC_DBMITTELWERT, 3, { 0, 0, 0 }, 0 },
 { SC_OPCODE_DB_GET, ENTRY(SC_OPCODE_DB_GET_ARY), 0, 
ID_FUNCTION_GRP_DATABASE, HID_FUNC_DBAUSZUG, 3, { 0, 0, 0 }, 0 },
 { SC_OPCODE_DB_MAX, ENTRY(SC_OPCODE_DB_MAX_ARY), 0, 
ID_FUNCTION_GRP_DATABASE, HID_FUNC_DBMAX, 3, { 0, 0, 0 }, 0 },


[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sc/qa sc/source

2021-11-26 Thread Attila Bakos (NISZ) (via logerrit)
 sc/qa/uitest/calc_tests8/tdf144940.py|   59 +++
 sc/source/filter/xml/XMLTableHeaderFooterContext.cxx |   11 +--
 2 files changed, 65 insertions(+), 5 deletions(-)

New commits:
commit 241733d1d91233b2f3bb996fc55302fb55b6c036
Author: Attila Bakos (NISZ) 
AuthorDate: Wed Nov 17 09:15:23 2021 +0100
Commit: Xisco Fauli 
CommitDate: Fri Nov 26 21:35:47 2021 +0100

tdf#144940 sc: fix disabled header/footer regression

Setting "Same content on first page" in the Page Style
dialog on either the Header or Footer tab resulted
disabled header/footer after reload. This was due to
flawed logic when assigning SC_UNO_PAGE_HDRON/FTRON
value: "leftness" was checked for but not "first pageness".

Regression from commit b9993369b4011cd8f367e439f5248096827f1efc
"tdf#121715 XLSX: support custom first page header/footer".

Co-authored-by: Daniel Arato (NISZ)

Change-Id: I8ee4c9f8145913d9dc5f4b66cdbc2352f2e405f0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125367
Tested-by: László Németh 
Reviewed-by: László Németh 
(cherry picked from commit 5db9b33dadda67c7f97d8c23df17211fae380919)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125840
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/sc/qa/uitest/calc_tests8/tdf144940.py 
b/sc/qa/uitest/calc_tests8/tdf144940.py
new file mode 100644
index ..6b118c7602c2
--- /dev/null
+++ b/sc/qa/uitest/calc_tests8/tdf144940.py
@@ -0,0 +1,59 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+from uitest.framework import UITestCase
+from uitest.uihelper.common import get_state_as_dict
+from uitest.uihelper.common import select_pos
+from libreoffice.uno.propertyvalue import mkPropertyValues
+from tempfile import TemporaryDirectory
+from org.libreoffice.unotest import systemPathToFileUrl
+import os.path
+
+class tdf144940(UITestCase):
+
+def test_tdf144940(self):
+
+with TemporaryDirectory() as tempdir:
+xFilePath = os.path.join(tempdir, "tdf144940-tmp.ods")
+
+with self.ui_test.create_doc_in_start_center("calc"):
+
+with 
self.ui_test.execute_dialog_through_command(".uno:PageFormatDialog") as xDialog:
+xTabs = xDialog.getChild("tabcontrol")
+select_pos(xTabs, "4")
+
+xCheckHeaderOn = xDialog.getChild("checkHeaderOn")
+xCheckSameFP = xDialog.getChild("checkSameFP")
+xCheckSameLR = xDialog.getChild("checkSameLR")
+
+self.assertEqual("true", 
get_state_as_dict(xCheckHeaderOn)["Selected"])
+self.assertEqual("true", 
get_state_as_dict(xCheckSameLR)["Selected"])
+self.assertEqual("false", 
get_state_as_dict(xCheckSameFP)["Selected"])
+
+xCheckSameFP.executeAction("CLICK", tuple())
+
+self.assertEqual("true", 
get_state_as_dict(xCheckSameFP)["Selected"])
+
+with self.ui_test.execute_dialog_through_command(".uno:Save", 
close_button="open") as xSaveDialog:
+xFileName = xSaveDialog.getChild("file_name")
+xFileName.executeAction("TYPE", 
mkPropertyValues({"KEYCODE":"CTRL+A"}))
+xFileName.executeAction("TYPE", 
mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+xFileName.executeAction("TYPE", mkPropertyValues({"TEXT": 
xFilePath}))
+
+with self.ui_test.load_file(systemPathToFileUrl(xFilePath)) as 
document:
+
+xPageStyles = document.StyleFamilies.getByIndex(1)
+xDefaultPageStyle = xPageStyles.getByIndex(0)
+
+# Without the fix in place, this test would have failed with
+# AssertionError: False is not true
+self.assertTrue(xDefaultPageStyle.HeaderOn)
+self.assertTrue(xDefaultPageStyle.FooterOn)
+self.assertTrue(xDefaultPageStyle.FirstPageHeaderIsShared)
+self.assertTrue(xDefaultPageStyle.FirstPageFooterIsShared)
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/source/filter/xml/XMLTableHeaderFooterContext.cxx 
b/sc/source/filter/xml/XMLTableHeaderFooterContext.cxx
index c0b5c6eb6cc1..773eb12da88b 100644
--- a/sc/source/filter/xml/XMLTableHeaderFooterContext.cxx
+++ b/sc/source/filter/xml/XMLTableHeaderFooterContext.cxx
@@ -63,19 +63,20 @@ XMLTableHeaderFooterContext::XMLTableHeaderFooterContext( 
SvXMLImport& rImport,
 XMLOFF_WARN_UNKNOWN("sc", aIter);
 }
 bool bOn(::cppu::any2bool(xPropSet->getPropertyValue( sOn )));
-if( bLeft )
+if( bLeft || bFirst )
 {
+const OUString sShare = bLeft ? 

[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sc/qa sc/source

2021-11-26 Thread Heiko Tietze (via logerrit)
 sc/qa/uitest/calc_tests/columns.py|   20 ++--
 sc/qa/uitest/calc_tests/rows.py   |   12 ++--
 sc/qa/uitest/calc_tests9/tdf126673.py |2 +-
 sc/source/ui/view/cellsh3.cxx |8 ++--
 4 files changed, 19 insertions(+), 23 deletions(-)

New commits:
commit d808f4f6df7fc987a918670c21162b21a0f8bd9f
Author: Heiko Tietze 
AuthorDate: Fri Nov 26 11:30:26 2021 +0100
Commit: Xisco Fauli 
CommitDate: Fri Nov 26 18:25:43 2021 +0100

Reverts tdf#144247 tdf#101217 - 4 digits in row height/col width

Reverts patch I29d90b413e6f6f6e8b73d30ac47d644a69d15046,
ad8edac43e73555bc2055514300c5b81a1bb04ea and partially
Ibdee348d84a8b96d8f698e7fc6db89eb24422f5d

Change-Id: Iba5fd2d2a65d813c2d5ba85e66a7c3e07b726ca5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125871
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 
Reviewed-by: Heiko Tietze 
(cherry picked from commit f82f6a2714fbf7882eb1d77351574392ae8e4c27)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125888

diff --git a/sc/qa/uitest/calc_tests/columns.py 
b/sc/qa/uitest/calc_tests/columns.py
index dafd825c76c8..19033f86ea7e 100644
--- a/sc/qa/uitest/calc_tests/columns.py
+++ b/sc/qa/uitest/calc_tests/columns.py
@@ -42,7 +42,7 @@ class CalcColumns(UITestCase):
 #verify
 with 
self.ui_test.execute_dialog_through_command(".uno:ColumnWidth", 
close_button="cancel") as xDialog:
 xvalue = xDialog.getChild("value")
-self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.0001 
cm")
+self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.00 cm")
 
 
 def test_column_width_two_columns(self):
@@ -67,12 +67,12 @@ class CalcColumns(UITestCase):
 gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
 with 
self.ui_test.execute_dialog_through_command(".uno:ColumnWidth") as xDialog:
 xvalue = xDialog.getChild("value")
-self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.0001 
cm")
+self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.00 cm")
 
 gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C1"}))
 with 
self.ui_test.execute_dialog_through_command(".uno:ColumnWidth") as xDialog:
 xvalue = xDialog.getChild("value")
-self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.0001 
cm")
+self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.00 cm")
 
 
 def test_column_width_copy(self):
@@ -103,7 +103,7 @@ class CalcColumns(UITestCase):
 gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C1"}))
 with 
self.ui_test.execute_dialog_through_command(".uno:ColumnWidth") as xDialog:
 xvalue = xDialog.getChild("value")
-self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.0001 
cm")
+self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.00 cm")
 
 
 def test_column_hide_show(self):
@@ -195,32 +195,32 @@ class CalcColumns(UITestCase):
 gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C1"}))
 with 
self.ui_test.execute_dialog_through_command(".uno:ColumnWidth") as xDialog:
 xvalue = xDialog.getChild("value")
-self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.0001 
cm")
+self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.00 cm")
 
 gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "D1"}))
 with 
self.ui_test.execute_dialog_through_command(".uno:ColumnWidth") as xDialog:
 xvalue = xDialog.getChild("value")
-self.assertEqual(get_state_as_dict(xvalue)["Text"], "2.0003 
cm")
+self.assertEqual(get_state_as_dict(xvalue)["Text"], "2.00 cm")
 
 gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "E1"}))
 with 
self.ui_test.execute_dialog_through_command(".uno:ColumnWidth") as xDialog:
 xvalue = xDialog.getChild("value")
-self.assertEqual(get_state_as_dict(xvalue)["Text"], "3.0004 
cm")
+self.assertEqual(get_state_as_dict(xvalue)["Text"], "3.00 cm")
 
 gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "F1"}))
 with 
self.ui_test.execute_dialog_through_command(".uno:ColumnWidth") as xDialog:
 xvalue = xDialog.getChild("value")
-self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.0001 
cm")
+self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.00 cm")
 
 gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "G1"}))
 with 
self.ui_test.execute_dialog_through_command(".uno:ColumnWidth") as xDialog:
 xvalue = xDialog.getChild("value")
-