summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/kahan.hxx123
-rw-r--r--sc/qa/uitest/calc_tests/columns.py20
-rw-r--r--sc/qa/uitest/calc_tests/rows.py12
-rw-r--r--sc/qa/uitest/calc_tests8/tdf144940.py72
-rw-r--r--sc/qa/unit/data/fods/tdf126116.fods170
-rw-r--r--sc/qa/unit/data/functions/array/dubious/fods/linest.fods (renamed from sc/qa/unit/data/functions/array/fods/linest.fods)0
-rw-r--r--sc/qa/unit/data/functions/array/dubious/fods/minverse.fods (renamed from sc/qa/unit/data/functions/array/fods/minverse.fods)0
-rw-r--r--sc/qa/unit/data/ods/tdf126116.odsbin7813 -> 0 bytes
-rw-r--r--sc/qa/unit/data/ods/tdf128895_emptyHiddenCols.odsbin0 -> 7210 bytes
-rw-r--r--sc/qa/unit/functions_array.cxx16
-rw-r--r--sc/qa/unit/scshapetest.cxx4
-rw-r--r--sc/qa/unit/subsequent_export-test.cxx18
-rw-r--r--sc/qa/unit/subsequent_filters-test2.cxx13
-rw-r--r--sc/source/core/data/column4.cxx12
-rw-r--r--sc/source/core/data/documen3.cxx6
-rw-r--r--sc/source/core/data/drwlayer.cxx16
-rw-r--r--sc/source/core/data/validat.cxx6
-rw-r--r--sc/source/core/tool/compiler.cxx3
-rw-r--r--sc/source/core/tool/interpr1.cxx6
-rw-r--r--sc/source/filter/html/htmlpars.cxx10
-rw-r--r--sc/source/filter/xml/XMLTableHeaderFooterContext.cxx11
-rw-r--r--sc/source/filter/xml/xmlcoli.cxx1
-rw-r--r--sc/source/ui/StatisticsDialogs/RegressionDialog.cxx11
-rw-r--r--sc/source/ui/app/inputhdl.cxx4
-rw-r--r--sc/source/ui/cctrl/checklistmenu.cxx9
-rw-r--r--sc/source/ui/dbgui/PivotLayoutDialog.cxx3
-rw-r--r--sc/source/ui/drawfunc/fuins1.cxx4
-rw-r--r--sc/source/ui/inc/checklistmenu.hxx2
-rw-r--r--sc/source/ui/optdlg/tpcalc.cxx8
-rw-r--r--sc/source/ui/unoobj/cellsuno.cxx16
-rw-r--r--sc/source/ui/unoobj/viewuno.cxx24
-rw-r--r--sc/source/ui/view/cellsh3.cxx8
-rw-r--r--sc/source/ui/view/gridwin.cxx20
-rw-r--r--sc/source/ui/view/output.cxx41
-rw-r--r--sc/source/ui/xmlsource/xmlsourcedlg.cxx2
-rw-r--r--sc/uiconfig/scalc/ui/filterdropdown.ui1
36 files changed, 513 insertions, 159 deletions
diff --git a/sc/inc/kahan.hxx b/sc/inc/kahan.hxx
index 49c7922b3c79..a85295d87914 100644
--- a/sc/inc/kahan.hxx
+++ b/sc/inc/kahan.hxx
@@ -9,13 +9,17 @@
#pragma once
+#include <rtl/math.hxx>
#include <cmath>
/**
* This class provides LO with Kahan summation algorithm
* About this algorithm: https://en.wikipedia.org/wiki/Kahan_summation_algorithm
* For general purpose software we assume first order error is enough.
- * This class could be made constexpr if needed.
+ *
+ * Additionally queue and remember the last recent non-zero value and add it
+ * similar to approxAdd() when obtaining the final result to further eliminate
+ * accuracy errors. (e.g. for the dreaded 0.1 + 0.2 - 0.3 != 0.0)
*/
class KahanSum
@@ -37,12 +41,22 @@ public:
*/
void add(double x_i)
{
- double t = m_fSum + x_i;
- if (std::abs(m_fSum) >= std::abs(x_i))
- m_fError += (m_fSum - t) + x_i;
+ if (x_i == 0.0)
+ return;
+
+ if (!m_fMem)
+ {
+ m_fMem = x_i;
+ return;
+ }
+
+ double t = m_fSum + m_fMem;
+ if (std::abs(m_fSum) >= std::abs(m_fMem))
+ m_fError += (m_fSum - t) + m_fMem;
else
- m_fError += (x_i - t) + m_fSum;
+ m_fError += (m_fMem - t) + m_fSum;
m_fSum = t;
+ m_fMem = x_i;
}
/**
@@ -53,6 +67,7 @@ public:
{
add(fSum.m_fSum);
add(fSum.m_fError);
+ add(fSum.m_fMem);
}
/**
@@ -63,6 +78,7 @@ public:
{
add(-fSum.m_fSum);
add(-fSum.m_fError);
+ add(-fSum.m_fMem);
}
public:
@@ -71,6 +87,7 @@ public:
KahanSum fKahanSum;
fKahanSum.m_fSum = -m_fSum;
fKahanSum.m_fError = -m_fError;
+ fKahanSum.m_fMem = -m_fMem;
return fKahanSum;
}
@@ -78,6 +95,7 @@ public:
{
m_fSum = fSum;
m_fError = 0;
+ m_fMem = 0;
return *this;
}
@@ -125,73 +143,92 @@ public:
*/
constexpr void operator*=(double fTimes)
{
- m_fSum *= fTimes;
- m_fError *= fTimes;
+ if (m_fMem)
+ {
+ m_fSum = get() * fTimes;
+ m_fMem = 0.0;
+ }
+ else
+ {
+ m_fSum = (m_fSum + m_fError) * fTimes;
+ }
+ m_fError = 0.0;
}
constexpr void operator/=(double fDivides)
{
- m_fSum /= fDivides;
- m_fError /= fDivides;
+ if (m_fMem)
+ {
+ m_fSum = get() / fDivides;
+ m_fMem = 0.0;
+ }
+ else
+ {
+ m_fSum = (m_fSum + m_fError) / fDivides;
+ }
+ m_fError = 0.0;
}
- inline KahanSum operator*(const KahanSum& fTimes) const
- {
- return *this * fTimes.m_fSum + *this * fTimes.m_fError;
- }
+ inline KahanSum operator*(const KahanSum& fTimes) const { return get() * fTimes.get(); }
- constexpr KahanSum operator*(double fTimes) const
- {
- KahanSum fSum(*this);
- fSum *= fTimes;
- return fSum;
- }
+ inline KahanSum operator*(double fTimes) const { return get() * fTimes; }
- inline KahanSum operator/(const KahanSum& fDivides) const { return *this / fDivides.get(); }
+ inline KahanSum operator/(const KahanSum& fDivides) const { return get() / fDivides.get(); }
- constexpr KahanSum operator/(double fTimes) const
- {
- KahanSum fSum(*this);
- fSum /= fTimes;
- return fSum;
- }
+ inline KahanSum operator/(double fDivides) const { return get() / fDivides; }
- constexpr bool operator<(const KahanSum& fSum) const { return get() < fSum.get(); }
+ inline bool operator<(const KahanSum& fSum) const { return get() < fSum.get(); }
- constexpr bool operator<(double fSum) const { return get() < fSum; }
+ inline bool operator<(double fSum) const { return get() < fSum; }
- constexpr bool operator>(const KahanSum& fSum) const { return get() > fSum.get(); }
+ inline bool operator>(const KahanSum& fSum) const { return get() > fSum.get(); }
- constexpr bool operator>(double fSum) const { return get() > fSum; }
+ inline bool operator>(double fSum) const { return get() > fSum; }
- constexpr bool operator<=(const KahanSum& fSum) const { return get() <= fSum.get(); }
+ inline bool operator<=(const KahanSum& fSum) const { return get() <= fSum.get(); }
- constexpr bool operator<=(double fSum) const { return get() <= fSum; }
+ inline bool operator<=(double fSum) const { return get() <= fSum; }
- constexpr bool operator>=(const KahanSum& fSum) const { return get() >= fSum.get(); }
+ inline bool operator>=(const KahanSum& fSum) const { return get() >= fSum.get(); }
- constexpr bool operator>=(double fSum) const { return get() >= fSum; }
+ inline bool operator>=(double fSum) const { return get() >= fSum; }
- constexpr bool operator==(const KahanSum& fSum) const
- {
- return fSum.m_fSum == m_fSum && fSum.m_fError == m_fError;
- }
+ inline bool operator==(const KahanSum& fSum) const { return get() == fSum.get(); }
- constexpr bool operator!=(const KahanSum& fSum) const
- {
- return fSum.m_fSum != m_fSum || fSum.m_fError != m_fError;
- }
+ inline bool operator!=(const KahanSum& fSum) const { return get() != fSum.get(); }
public:
/**
* Returns the final sum.
* @return final sum
*/
- constexpr double get() const { return m_fSum + m_fError; }
+ double get() const
+ {
+ const double fTotal = m_fSum + m_fError;
+ if (!m_fMem)
+ return fTotal;
+
+ // Check the same condition as rtl::math::approxAdd() and if true
+ // return 0.0, if false use another Kahan summation adding m_fMem.
+ if (((m_fMem < 0.0 && fTotal > 0.0) || (fTotal < 0.0 && m_fMem > 0.0))
+ && rtl::math::approxEqual(m_fMem, -fTotal))
+ {
+ /* TODO: should we reset all values to zero here for further
+ * summation, or is it better to keep them as they are? */
+ return 0.0;
+ }
+
+ // The actual argument passed to add() here does not matter as long as
+ // it is not 0, m_fMem is not 0 and will be added anyway, see add().
+ const_cast<KahanSum*>(this)->add(m_fMem);
+ const_cast<KahanSum*>(this)->m_fMem = 0.0;
+ return m_fSum + m_fError;
+ }
private:
double m_fSum = 0;
double m_fError = 0;
+ double m_fMem = 0;
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/sc/qa/uitest/calc_tests/columns.py b/sc/qa/uitest/calc_tests/columns.py
index 28649d07f3c2..a03ebda37ae2 100644
--- a/sc/qa/uitest/calc_tests/columns.py
+++ b/sc/qa/uitest/calc_tests/columns.py
@@ -46,7 +46,7 @@ class CalcColumns(UITestCase):
self.ui_test.execute_dialog_through_command(".uno:ColumnWidth")
xDialog = self.xUITest.getTopFocusWindow()
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")
xCancel = xDialog.getChild("cancel")
self.ui_test.close_dialog_through_button(xCancel)
@@ -79,7 +79,7 @@ class CalcColumns(UITestCase):
self.ui_test.execute_dialog_through_command(".uno:ColumnWidth")
xDialog = self.xUITest.getTopFocusWindow()
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")
xOK = xDialog.getChild("ok")
self.ui_test.close_dialog_through_button(xOK)
@@ -87,7 +87,7 @@ class CalcColumns(UITestCase):
self.ui_test.execute_dialog_through_command(".uno:ColumnWidth")
xDialog = self.xUITest.getTopFocusWindow()
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")
xOK = xDialog.getChild("ok")
self.ui_test.close_dialog_through_button(xOK)
@@ -126,7 +126,7 @@ class CalcColumns(UITestCase):
self.ui_test.execute_dialog_through_command(".uno:ColumnWidth")
xDialog = self.xUITest.getTopFocusWindow()
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")
xOK = xDialog.getChild("ok")
self.ui_test.close_dialog_through_button(xOK)
@@ -236,7 +236,7 @@ class CalcColumns(UITestCase):
self.ui_test.execute_dialog_through_command(".uno:ColumnWidth")
xDialog = self.xUITest.getTopFocusWindow()
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")
xOK = xDialog.getChild("ok")
self.ui_test.close_dialog_through_button(xOK)
@@ -244,7 +244,7 @@ class CalcColumns(UITestCase):
self.ui_test.execute_dialog_through_command(".uno:ColumnWidth")
xDialog = self.xUITest.getTopFocusWindow()
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")
xOK = xDialog.getChild("ok")
self.ui_test.close_dialog_through_button(xOK)
@@ -252,7 +252,7 @@ class CalcColumns(UITestCase):
self.ui_test.execute_dialog_through_command(".uno:ColumnWidth")
xDialog = self.xUITest.getTopFocusWindow()
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")
xOK = xDialog.getChild("ok")
self.ui_test.close_dialog_through_button(xOK)
@@ -260,7 +260,7 @@ class CalcColumns(UITestCase):
self.ui_test.execute_dialog_through_command(".uno:ColumnWidth")
xDialog = self.xUITest.getTopFocusWindow()
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")
xOK = xDialog.getChild("ok")
self.ui_test.close_dialog_through_button(xOK)
@@ -268,7 +268,7 @@ class CalcColumns(UITestCase):
self.ui_test.execute_dialog_through_command(".uno:ColumnWidth")
xDialog = self.xUITest.getTopFocusWindow()
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")
xOK = xDialog.getChild("ok")
self.ui_test.close_dialog_through_button(xOK)
@@ -276,7 +276,7 @@ class CalcColumns(UITestCase):
self.ui_test.execute_dialog_through_command(".uno:ColumnWidth")
xDialog = self.xUITest.getTopFocusWindow()
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")
xOK = xDialog.getChild("ok")
self.ui_test.close_dialog_through_button(xOK)
diff --git a/sc/qa/uitest/calc_tests/rows.py b/sc/qa/uitest/calc_tests/rows.py
index b5e40fa1e327..f1ee519ba09a 100644
--- a/sc/qa/uitest/calc_tests/rows.py
+++ b/sc/qa/uitest/calc_tests/rows.py
@@ -46,7 +46,7 @@ class CalcRows(UITestCase):
self.ui_test.execute_dialog_through_command(".uno:RowHeight")
xDialog = self.xUITest.getTopFocusWindow()
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")
xCancel = xDialog.getChild("cancel")
self.ui_test.close_dialog_through_button(xCancel)
@@ -79,7 +79,7 @@ class CalcRows(UITestCase):
self.ui_test.execute_dialog_through_command(".uno:RowHeight")
xDialog = self.xUITest.getTopFocusWindow()
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")
xOK = xDialog.getChild("ok")
self.ui_test.close_dialog_through_button(xOK)
@@ -87,7 +87,7 @@ class CalcRows(UITestCase):
self.ui_test.execute_dialog_through_command(".uno:RowHeight")
xDialog = self.xUITest.getTopFocusWindow()
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")
xOK = xDialog.getChild("ok")
self.ui_test.close_dialog_through_button(xOK)
@@ -127,7 +127,7 @@ class CalcRows(UITestCase):
self.ui_test.execute_dialog_through_command(".uno:RowHeight")
xDialog = self.xUITest.getTopFocusWindow()
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")
xOK = xDialog.getChild("ok")
self.ui_test.close_dialog_through_button(xOK)
@@ -214,7 +214,7 @@ class CalcRows(UITestCase):
self.ui_test.execute_dialog_through_command(".uno:RowHeight")
xDialog = self.xUITest.getTopFocusWindow()
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")
xOK = xDialog.getChild("ok")
self.ui_test.close_dialog_through_button(xOK)
@@ -222,7 +222,7 @@ class CalcRows(UITestCase):
self.ui_test.execute_dialog_through_command(".uno:RowHeight")
xDialog = self.xUITest.getTopFocusWindow()
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")
xOK = xDialog.getChild("ok")
self.ui_test.close_dialog_through_button(xOK)
diff --git a/sc/qa/uitest/calc_tests8/tdf144940.py b/sc/qa/uitest/calc_tests8/tdf144940.py
new file mode 100644
index 000000000000..1f3d34b51219
--- /dev/null
+++ b/sc/qa/uitest/calc_tests8/tdf144940.py
@@ -0,0 +1,72 @@
+# -*- 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")
+
+ calc_doc = self.ui_test.create_doc_in_start_center("calc")
+
+ self.ui_test.execute_dialog_through_command(".uno:PageFormatDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ 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"])
+
+ xOkBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOkBtn)
+
+ self.ui_test.execute_dialog_through_command(".uno:Save")
+ xSaveDialog = self.xUITest.getTopFocusWindow()
+ xFileName = xSaveDialog.getChild("file_name")
+ xFileName.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xFileName.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xFileName.executeAction("TYPE", mkPropertyValues({"TEXT": xFilePath}))
+
+ xOkBtn = xSaveDialog.getChild("open")
+ self.ui_test.close_dialog_through_button(xOkBtn)
+
+ self.ui_test.close_doc()
+
+ self.ui_test.load_file(systemPathToFileUrl(xFilePath))
+ document = self.ui_test.get_component()
+
+ 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)
+
+ self.ui_test.close_doc()
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/unit/data/fods/tdf126116.fods b/sc/qa/unit/data/fods/tdf126116.fods
new file mode 100644
index 000000000000..2db351642f73
--- /dev/null
+++ b/sc/qa/unit/data/fods/tdf126116.fods
@@ -0,0 +1,170 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<office:document xmlns:presentation="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0" xmlns:css3t="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:names: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:form: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">
+ <office:styles>
+ <style:default-style style:family="table-cell">
+ <style:paragraph-properties style:tab-stop-distance="0.5in"/>
+ <style:text-properties style:font-name="Liberation Sans" fo:font-size="10pt" fo:language="en" fo:country="US" style:font-name-asian="Noto Sans CJK SC Regular" style:font-size-asian="10pt" style:language-asian="zh" style:country-asian="CN" style:font-name-complex="Lohit Devanagari" style:font-size-complex="10pt" style:language-complex="hi" style:country-complex="IN"/>
+ </style:default-style>
+ <number:number-style style:name="N0">
+ <number:number number:min-integer-digits="1"/>
+ </number:number-style>
+ <number:date-style style:name="N121">
+ <number:year/>
+ </number:date-style>
+ <style:style style:name="Default" style:family="table-cell"/>
+ <style:style style:name="Heading" style:family="table-cell" style:parent-style-name="Default">
+ <style:text-properties fo:color="#000000" fo:font-size="24pt" fo:font-style="normal" fo:font-weight="bold"/>
+ </style:style>
+ <style:style style:name="Heading_20_1" style:display-name="Heading 1" style:family="table-cell" style:parent-style-name="Heading">
+ <style:text-properties fo:color="#000000" fo:font-size="18pt" fo:font-style="normal" fo:font-weight="normal"/>
+ </style:style>
+ <style:style style:name="Heading_20_2" style:display-name="Heading 2" style:family="table-cell" style:parent-style-name="Heading">
+ <style:text-properties fo:color="#000000" fo:font-size="12pt" fo:font-style="normal" fo:font-weight="normal"/>
+ </style:style>
+ <style:style style:name="Text" style:family="table-cell" style:parent-style-name="Default"/>
+ <style:style style:name="Note" style:family="table-cell" style:parent-style-name="Text">
+ <style:table-cell-properties fo:background-color="#ffffcc" style:diagonal-bl-tr="none" style:diagonal-tl-br="none" fo:border="0.74pt solid #808080"/>
+ <style:text-properties fo:color="#333333" fo:font-size="10pt" fo:font-style="normal" fo:font-weight="normal"/>
+ </style:style>
+ <style:style style:name="Footnote" style:family="table-cell" style:parent-style-name="Text">
+ <style:text-properties fo:color="#808080" fo:font-size="10pt" fo:font-style="italic" fo:font-weight="normal"/>
+ </style:style>
+ <style:style style:name="Hyperlink" style:family="table-cell" style:parent-style-name="Text">
+ <style:text-properties fo:color="#0000ee" fo:font-size="10pt" fo:font-style="normal" style:text-underline-style="solid" style:text-underline-width="auto" style:text-underline-color="#0000ee" fo:font-weight="normal"/>
+ </style:style>
+ <style:style style:name="Status" style:family="table-cell" style:parent-style-name="Default"/>
+ <style:style style:name="Good" style:family="table-cell" style:parent-style-name="Status">
+ <style:table-cell-properties fo:background-color="#ccffcc"/>
+ <style:text-properties fo:color="#006600" fo:font-size="10pt" fo:font-style="normal" fo:font-weight="normal"/>
+ </style:style>
+ <style:style style:name="Neutral" style:family="table-cell" style:parent-style-name="Status">
+ <style:table-cell-properties fo:background-color="#ffffcc"/>
+ <style:text-properties fo:color="#996600" fo:font-size="10pt" fo:font-style="normal" fo:font-weight="normal"/>
+ </style:style>
+ <style:style style:name="Bad" style:family="table-cell" style:parent-style-name="Status">
+ <style:table-cell-properties fo:background-color="#ffcccc"/>
+ <style:text-properties fo:color="#cc0000" fo:font-size="10pt" fo:font-style="normal" fo:font-weight="normal"/>
+ </style:style>
+ <style:style style:name="Warning" style:family="table-cell" style:parent-style-name="Status">
+ <style:text-properties fo:color="#cc0000" fo:font-size="10pt" fo:font-style="normal" fo:font-weight="normal"/>
+ </style:style>
+ <style:style style:name="Error" style:family="table-cell" style:parent-style-name="Status">
+ <style:table-cell-properties fo:background-color="#cc0000"/>
+ <style:text-properties fo:color="#ffffff" fo:font-size="10pt" fo:font-style="normal" fo:font-weight="bold"/>
+ </style:style>
+ <style:style style:name="Accent" style:family="table-cell" style:parent-style-name="Default">
+ <style:text-properties fo:color="#000000" fo:font-size="10pt" fo:font-style="normal" fo:font-weight="bold"/>
+ </style:style>
+ <style:style style:name="Accent_20_1" style:display-name="Accent 1" style:family="table-cell" style:parent-style-name="Accent">
+ <style:table-cell-properties fo:background-color="#000000"/>
+ <style:text-properties fo:color="#ffffff" fo:font-size="10pt" fo:font-style="normal" fo:font-weight="normal"/>
+ </style:style>
+ <style:style style:name="Accent_20_2" style:display-name="Accent 2" style:family="table-cell" style:parent-style-name="Accent">
+ <style:table-cell-properties fo:background-color="#808080"/>
+ <style:text-properties fo:color="#ffffff" fo:font-size="10pt" fo:font-style="normal" fo:font-weight="normal"/>
+ </style:style>
+ <style:style style:name="Accent_20_3" style:display-name="Accent 3" style:family="table-cell" style:parent-style-name="Accent">
+ <style:table-cell-properties fo:background-color="#dddddd"/>
+ </style:style>
+ <style:style style:name="Result" style:family="table-cell" style:parent-style-name="Default">
+ <style:text-properties fo:color="#000000" fo:font-size="10pt" fo:font-style="italic" style:text-underline-style="solid" style:text-underline-width="auto" style:text-underline-color="#000000" fo:font-weight="bold"/>
+ </style:style>
+ </office:styles>
+ <office:automatic-styles>
+ <style:style style:name="co1" style:family="table-column">
+ <style:table-column-properties fo:break-before="auto" style:column-width="0.889in"/>
+ </style:style>
+ <style:style style:name="ro1" style:family="table-row">
+ <style:table-row-properties style:row-height="0.178in" fo:break-before="auto" style:use-optimal-row-height="true"/>
+ </style:style>
+ <style:style style:name="ta1" style:family="table" style:master-page-name="Default">
+ <style:table-properties table:display="true" style:writing-mode="lr-tb"/>
+ </style:style>
+ <number:number-style style:name="N2">
+ <number:number number:decimal-places="2" number:min-decimal-places="2" number:min-integer-digits="1"/>
+ </number:number-style>
+ <number:date-style style:name="N37" number:automatic-order="true">
+ <number:month number:style="long"/>
+ <number:text>/</number:text>
+ <number:day number:style="long"/>
+ <number:text>/</number:text>
+ <number:year/>
+ </number:date-style>
+ <style:style style:name="ce1" style:family="table-cell" style:parent-style-name="Default" style:data-style-name="N37"/>
+ <style:style style:name="ce3" style:family="table-cell" style:parent-style-name="Default" style:data-style-name="N121"/>
+ <style:style style:name="ce5" style:family="table-cell" style:parent-style-name="Default" style:data-style-name="N37"/>
+ <style:style style:name="ce6" style:family="table-cell" style:parent-style-name="Default" style:data-style-name="N121"/>
+ <style:page-layout style:name="pm1">
+ <style:page-layout-properties style:writing-mode="lr-tb"/>
+ <style:header-style>
+ <style:header-footer-properties fo:min-height="0.2953in" fo:margin-left="0in" fo:margin-right="0in" fo:margin-bottom="0.0984in"/>
+ </style:header-style>
+ <style:footer-style>
+ <style:header-footer-properties fo:min-height="0.2953in" fo:margin-left="0in" fo:margin-right="0in" fo:margin-top="0.0984in"/>
+ </style:footer-style>
+ </style:page-layout>
+ <style:page-layout style:name="pm2">
+ <style:page-layout-properties style:writing-mode="lr-tb"/>
+ <style:header-style>
+ <style:header-footer-properties fo:min-height="0.2953in" fo:margin-left="0in" fo:margin-right="0in" fo:margin-bottom="0.0984in" fo:border="2.49pt solid #000000" fo:padding="0.0071in" fo:background-color="#c0c0c0">
+ <style:background-image/>
+ </style:header-footer-properties>
+ </style:header-style>
+ <style:footer-style>
+ <style:header-footer-properties fo:min-height="0.2953in" fo:margin-left="0in" fo:margin-right="0in" fo:margin-top="0.0984in" fo:border="2.49pt solid #000000" fo:padding="0.0071in" fo:background-color="#c0c0c0">
+ <style:background-image/>
+ </style:header-footer-properties>
+ </style:footer-style>
+ </style:page-layout>
+ </office:automatic-styles>
+ <office:master-styles>
+ <style:master-page style:name="Default" style:page-layout-name="pm1">
+ <style:header>
+ <text:p><text:sheet-name>???</text:sheet-name></text:p>
+ </style:header>
+ <style:header-left style:display="false"/>
+ <style:header-first style:display="false"/>
+ <style:footer>
+ <text:p>Page <text:page-number>1</text:page-number></text:p>
+ </style:footer>
+ <style:footer-left style:display="false"/>
+ <style:footer-first style:display="false"/>
+ </style:master-page>
+ <style:master-page style:name="Report" style:page-layout-name="pm2">
+ <style:header>
+ <style:region-left>
+ <text:p><text:sheet-name>???</text:sheet-name><text:s/>(<text:title>???</text:title>)</text:p>
+ </style:region-left>
+ <style:region-right>
+ <text:p><text:date style:data-style-name="N2" text:date-value="2021-12-23">00/00/0000</text:date>, <text:time style:data-style-name="N2" text:time-value="15:58:01.703768631">00:00:00</text:time></text:p>
+ </style:region-right>
+ </style:header>
+ <style:header-left style:display="false"/>
+ <style:header-first style:display="false"/>
+ <style:footer>
+ <text:p>Page <text:page-number>1</text:page-number><text:s/>/ <text:page-count>99</text:page-count></text:p>
+ </style:footer>
+ <style:footer-left style:display="false"/>
+ <style:footer-first style:display="false"/>
+ </style:master-page>
+ </office:master-styles>
+ <office:body>
+ <office:spreadsheet>
+ <table:calculation-settings table:automatic-find-labels="false" table:use-regular-expressions="false" table:use-wildcards="true"/>
+ <table:table table:name="Sheet1" table:style-name="ta1">
+ <table:table-column table:style-name="co1" table:default-cell-style-name="ce5"/>
+ <table:table-column table:style-name="co1" table:default-cell-style-name="ce6"/>
+ <table:table-row table:style-name="ro1">
+ <table:table-cell office:value-type="date" office:date-value="2021-02-02" calcext:value-type="date">
+ <text:p>02/02/21</text:p>
+ </table:table-cell>
+ <table:table-cell table:formula="of:=TODAY()" office:value-type="date" office:date-value="2021-12-23" calcext:value-type="date">
+ <text:p>21</text:p>
+ </table:table-cell>
+ </table:table-row>
+ </table:table>
+ <table:named-expressions/>
+ </office:spreadsheet>
+ </office:body>
+</office:document>
diff --git a/sc/qa/unit/data/functions/array/fods/linest.fods b/sc/qa/unit/data/functions/array/dubious/fods/linest.fods
index 130a4a1c0dcd..130a4a1c0dcd 100644
--- a/sc/qa/unit/data/functions/array/fods/linest.fods
+++ b/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
index ec578801b841..ec578801b841 100644
--- a/sc/qa/unit/data/functions/array/fods/minverse.fods
+++ b/sc/qa/unit/data/functions/array/dubious/fods/minverse.fods
diff --git a/sc/qa/unit/data/ods/tdf126116.ods b/sc/qa/unit/data/ods/tdf126116.ods
deleted file mode 100644
index c9fb2816e21c..000000000000
--- a/sc/qa/unit/data/ods/tdf126116.ods
+++ /dev/null
Binary files differ
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 000000000000..fa016369f206
--- /dev/null
+++ b/sc/qa/unit/data/ods/tdf128895_emptyHiddenCols.ods
Binary files differ
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/")
{
diff --git a/sc/qa/unit/scshapetest.cxx b/sc/qa/unit/scshapetest.cxx
index 5586cdb954f2..cc5a04ea63e4 100644
--- a/sc/qa/unit/scshapetest.cxx
+++ b/sc/qa/unit/scshapetest.cxx
@@ -245,7 +245,7 @@ void ScShapeTest::testTdf144242_OpenBezier_noSwapWH()
pObj = lcl_getSdrObjectWithAssert(rDoc2, 0);
tools::Rectangle aSnapRect(pObj->GetSnapRect());
// Without fix in place width and height were swapped
- lcl_AssertRectEqualWithTolerance("Reload: wrong pos and size", aExpectRect, aSnapRect, 30);
+ lcl_AssertRectEqualWithTolerance("Reload: wrong pos and size", aExpectRect, aSnapRect, 40);
pDocSh->DoClose();
}
@@ -285,7 +285,7 @@ void ScShapeTest::testTdf144242_Line_noSwapWH()
pObj = lcl_getSdrObjectWithAssert(rDoc2, 0);
tools::Rectangle aSnapRect(pObj->GetSnapRect());
// Without fix in place width and height were swapped
- lcl_AssertRectEqualWithTolerance("Reload: wrong pos and size", aExpectRect, aSnapRect, 30);
+ lcl_AssertRectEqualWithTolerance("Reload: wrong pos and size", aExpectRect, aSnapRect, 40);
pDocSh->DoClose();
}
diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx
index 31c0aae3dd71..431a03ebca65 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -142,6 +142,7 @@ public:
#endif
void testOutlineExportXLSX();
void testHiddenEmptyRowsXLSX();
+ void testHiddenEmptyColsODS();
void testAllRowsHiddenXLSX();
void testLandscapeOrientationXLSX();
@@ -258,6 +259,7 @@ public:
#endif
CPPUNIT_TEST(testOutlineExportXLSX);
CPPUNIT_TEST(testHiddenEmptyRowsXLSX);
+ CPPUNIT_TEST(testHiddenEmptyColsODS);
CPPUNIT_TEST(testAllRowsHiddenXLSX);
CPPUNIT_TEST(testLandscapeOrientationXLSX);
CPPUNIT_TEST(testInlineArrayXLS);
@@ -1411,6 +1413,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<utl::TempFile> 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/qa/unit/subsequent_filters-test2.cxx b/sc/qa/unit/subsequent_filters-test2.cxx
index 9c15eebfff0a..35ad23deba54 100644
--- a/sc/qa/unit/subsequent_filters-test2.cxx
+++ b/sc/qa/unit/subsequent_filters-test2.cxx
@@ -1357,7 +1357,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();
@@ -1365,10 +1365,15 @@ void ScFiltersTest2::testTdf126116()
rDoc.SetString(ScAddress(0, 0, 0), "03/03");
+ sal_uInt32 nNumberFormat;
+ rDoc.GetNumberFormat(0, 0, 0, nNumberFormat);
+ 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/21"), rDoc.GetString(ScAddress(0, 0, 0)));
+ // - Expected: MM/DD/YY
+ // - Actual : MM/DD/YYYY
+ CPPUNIT_ASSERT_EQUAL(OUString("MM/DD/YY"), rFormatStr);
xDocSh->DoClose();
}
diff --git a/sc/source/core/data/column4.cxx b/sc/source/core/data/column4.cxx
index 54213f2cd582..14781f74d22e 100644
--- a/sc/source/core/data/column4.cxx
+++ b/sc/source/core/data/column4.cxx
@@ -566,11 +566,15 @@ void ScColumn::CloneFormulaCell(
ScAddress aPos(nCol, nRow1, nTab);
- if (nLen == 1)
+ if (nLen == 1 || !rSrc.GetCode()->IsShareable())
{
- // Single, ungrouped formula cell.
- ScFormulaCell* pCell = new ScFormulaCell(rSrc, rDocument, aPos);
- aFormulas.push_back(pCell);
+ // Single, ungrouped formula cell, or create copies for
+ // non-shareable token arrays.
+ for (size_t i = 0; i < nLen; ++i, aPos.IncRow())
+ {
+ ScFormulaCell* pCell = new ScFormulaCell(rSrc, rDocument, aPos);
+ aFormulas.push_back(pCell);
+ }
}
else
{
diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx
index 92c721fa48ca..a1e7a2d9e73b 100644
--- a/sc/source/core/data/documen3.cxx
+++ b/sc/source/core/data/documen3.cxx
@@ -1669,7 +1669,7 @@ void ScDocument::GetFormulaEntries( ScTypedCaseStrSet& rStrings )
if ( pRangeName )
{
for (const auto& rEntry : *pRangeName)
- rStrings.insert(ScTypedStrData(rEntry.second->GetName(), 0.0, ScTypedStrData::Name));
+ rStrings.insert(ScTypedStrData(rEntry.second->GetName(), 0.0, 0.0, ScTypedStrData::Name));
}
// Database collection
@@ -1677,7 +1677,7 @@ void ScDocument::GetFormulaEntries( ScTypedCaseStrSet& rStrings )
{
const ScDBCollection::NamedDBs& rDBs = pDBCollection->getNamedDBs();
for (const auto& rxDB : rDBs)
- rStrings.insert(ScTypedStrData(rxDB->GetName(), 0.0, ScTypedStrData::DbName));
+ rStrings.insert(ScTypedStrData(rxDB->GetName(), 0.0, 0.0, ScTypedStrData::DbName));
}
// Content of name ranges
@@ -1700,7 +1700,7 @@ void ScDocument::GetFormulaEntries( ScTypedCaseStrSet& rStrings )
continue;
OUString aStr = aIter.getString();
- rStrings.insert(ScTypedStrData(aStr, 0.0, ScTypedStrData::Header));
+ rStrings.insert(ScTypedStrData(aStr, 0.0, 0.0, ScTypedStrData::Header));
}
}
}
diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx
index 1ead0b8fe872..ab70efe5a7ce 100644
--- a/sc/source/core/data/drwlayer.cxx
+++ b/sc/source/core/data/drwlayer.cxx
@@ -547,10 +547,18 @@ void ScDrawLayer::MoveCells( SCTAB nTab, SCCOL nCol1,SCROW nRow1, SCCOL nCol2,SC
ScDrawObjData* pNoRotatedAnchor = GetNonRotatedObjData( pObj );
if ( pNoRotatedAnchor )
{
- pNoRotatedAnchor->maStart.IncCol(nDx);
- pNoRotatedAnchor->maStart.IncRow(nDy);
- pNoRotatedAnchor->maEnd.IncCol(nDx);
- pNoRotatedAnchor->maEnd.IncRow(nDy);
+ const ScAddress aOldSttNoRotatedAnchor = pNoRotatedAnchor->maStart;
+ const ScAddress aOldEndNoRotatedAnchor = pNoRotatedAnchor->maEnd;
+ if ( aOldSttNoRotatedAnchor.IsValid() && IsInBlock( aOldSttNoRotatedAnchor, nCol1,nRow1, nCol2,nRow2 ) )
+ {
+ pNoRotatedAnchor->maStart.IncCol(nDx);
+ pNoRotatedAnchor->maStart.IncRow(nDy);
+ }
+ if ( aOldEndNoRotatedAnchor.IsValid() && IsInBlock( aOldEndNoRotatedAnchor, nCol1,nRow1, nCol2,nRow2 ) )
+ {
+ pNoRotatedAnchor->maEnd.IncCol(nDx);
+ pNoRotatedAnchor->maEnd.IncRow(nDy);
+ }
}
AddCalcUndo( std::make_unique<ScUndoObjData>( pObj, aOldStt, aOldEnd, pData->maStart, pData->maEnd ) );
diff --git a/sc/source/core/data/validat.cxx b/sc/source/core/data/validat.cxx
index d467db7ccf0f..6f578402309d 100644
--- a/sc/source/core/data/validat.cxx
+++ b/sc/source/core/data/validat.cxx
@@ -843,7 +843,7 @@ bool ScValidationData::GetSelectionFromFormula(
}
if( nullptr != pStrings )
- pEntry.reset(new ScTypedStrData( aValStr, 0.0, ScTypedStrData::Standard));
+ pEntry.reset(new ScTypedStrData(aValStr, 0.0, 0.0, ScTypedStrData::Standard));
if (!rCell.isEmpty() && rMatch < 0)
aCondTokArr.AddString(rSPool.intern(aValStr));
@@ -880,7 +880,7 @@ bool ScValidationData::GetSelectionFromFormula(
aCondTokArr.AddDouble( nMatVal.fVal );
}
if( nullptr != pStrings )
- pEntry.reset(new ScTypedStrData( aValStr, nMatVal.fVal, ScTypedStrData::Value));
+ pEntry.reset(new ScTypedStrData(aValStr, nMatVal.fVal, nMatVal.fVal, ScTypedStrData::Value));
}
if (rMatch < 0 && !rCell.isEmpty() && IsEqualToTokenArray(rCell, rPos, aCondTokArr))
@@ -923,7 +923,7 @@ bool ScValidationData::FillSelectionList(std::vector<ScTypedStrData>& rStrColl,
OUString aStr(pString);
bool bIsValue = GetDocument()->GetFormatTable()->IsNumberFormat(aStr, nFormat, fValue);
rStrColl.emplace_back(
- aStr, fValue, bIsValue ? ScTypedStrData::Value : ScTypedStrData::Standard);
+ aStr, fValue, fValue, bIsValue ? ScTypedStrData::Value : ScTypedStrData::Standard);
}
bOk = aIt.Ok();
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 628465e0d085..cde3c16f4f4e 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -4325,7 +4325,8 @@ bool ScCompiler::NextNewToken( bool bInArray )
* handled by IsPredetectedReference(), this case here remains for
* manual/API input. */
OUString aBad( aFormula.copy( nSrcPos-1 ) );
- eLastOp = pArr->AddBad( aBad )->GetOpCode();
+ const FormulaToken* pBadToken = pArr->AddBad(aBad);
+ eLastOp = pBadToken ? pBadToken->GetOpCode() : ocNone;
return false;
}
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 94923f75c255..cc710efc353e 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -1347,7 +1347,7 @@ void ScInterpreter::ScAnd()
}
break;
default:
- Pop();
+ PopError();
SetError( FormulaError::IllegalParameter);
}
}
@@ -1446,7 +1446,7 @@ void ScInterpreter::ScOr()
}
break;
default:
- Pop();
+ PopError();
SetError( FormulaError::IllegalParameter);
}
}
@@ -1548,7 +1548,7 @@ void ScInterpreter::ScXor()
}
break;
default:
- Pop();
+ PopError();
SetError( FormulaError::IllegalParameter);
}
}
diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx
index 5ea874ac8841..7e735054a9db 100644
--- a/sc/source/filter/html/htmlpars.cxx
+++ b/sc/source/filter/html/htmlpars.cxx
@@ -755,6 +755,16 @@ void ScHTMLLayoutParser::SetWidths()
sal_uInt16 nMax = static_cast<sal_uInt16>(pLocalColOffset->back());
if ( aPageSize.Width() < nMax )
aPageSize.setWidth( nMax );
+ if (nTableLevel == 0)
+ {
+ // Local table is very outer table, create missing offsets.
+ for (auto it = pLocalColOffset->begin(); it != pLocalColOffset->end(); ++it)
+ {
+ // Only exact offsets, do not use MakeColNoRef().
+ if (maColOffset.find(*it) == maColOffset.end())
+ maColOffset.insert(*it);
+ }
+ }
}
for ( size_t i = nFirstTableCell, nListSize = maList.size(); i < nListSize; ++i )
{
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 ? sShareContent : sShareFirstContent;
if( bOn && bDisplay )
{
- if( ::cppu::any2bool(xPropSet->getPropertyValue( sShareContent )) )
+ if( ::cppu::any2bool(xPropSet->getPropertyValue( sShare )) )
// Don't share headers any longer
- xPropSet->setPropertyValue( sShareContent, uno::makeAny(false) );
+ xPropSet->setPropertyValue( sShare, uno::makeAny(false) );
}
else
{
- if( !::cppu::any2bool(xPropSet->getPropertyValue( sShareContent )) )
+ if( !::cppu::any2bool(xPropSet->getPropertyValue( sShare )) )
// share headers
- xPropSet->setPropertyValue( sShareContent, uno::makeAny(true) );
+ xPropSet->setPropertyValue( sShare, uno::makeAny(true) );
}
}
else
diff --git a/sc/source/filter/xml/xmlcoli.cxx b/sc/source/filter/xml/xmlcoli.cxx
index 8bec39546541..0e4af7bb9a9a 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<table::XColumnRowRange> xColumnRowRange (xSheet->getCellRangeByPosition(nCurrentColumn, 0, nLastColumn, 0), uno::UNO_QUERY);
if (xColumnRowRange.is())
{
diff --git a/sc/source/ui/StatisticsDialogs/RegressionDialog.cxx b/sc/source/ui/StatisticsDialogs/RegressionDialog.cxx
index 5a4002f97d62..153640d75920 100644
--- a/sc/source/ui/StatisticsDialogs/RegressionDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/RegressionDialog.cxx
@@ -513,7 +513,12 @@ void ScRegressionDialog::WriteRegressionEstimatesWithCI(AddressWalkerWriter& rOu
bool bTakeLogX)
{
rOutput.newLine();
- SCROW nLastRow = rOutput.current(0, 1 + mnNumIndependentVars).Row();
+ ScAddress aEnd( rOutput.current(0, 1 + mnNumIndependentVars));
+ ScRefFlags eAddrFlag = mbUse3DAddresses ? ScRefFlags::ADDR_ABS_3D : ScRefFlags::ADDR_ABS;
+ aEnd.IncCol();
+ const OUString aCoeffAddr( aEnd.Format( eAddrFlag, &mDocument, mDocument.GetAddressConvention()));
+ aEnd.IncCol();
+ const OUString aStErrAddr( aEnd.Format( eAddrFlag, &mDocument, mDocument.GetAddressConvention()));
// Coefficients & Std.Errors ranges (column vectors) in this table (yet to populate).
rTemplate.autoReplaceRange("%COEFFICIENTS_RANGE%",
@@ -553,9 +558,9 @@ void ScRegressionDialog::WriteRegressionEstimatesWithCI(AddressWalkerWriter& rOu
{
"",
// This puts the coefficients in the reverse order compared to that in LINEST output.
- "=INDEX(%COEFFICIENTS_REV_RANGE%; 1 ; " + OUString::number(nLastRow + 2) + " - ROW())",
+ "=INDEX(%COEFFICIENTS_REV_RANGE%; 1 ; ROW(" + aCoeffAddr + ")+1 - ROW())",
// This puts the standard errors in the reverse order compared to that in LINEST output.
- "=INDEX(%SERRORSX_REV_RANGE%; 1 ; " + OUString::number(nLastRow + 2) + " - ROW())",
+ "=INDEX(%SERRORSX_REV_RANGE%; 1 ; ROW(" + aStErrAddr + ")+1 - ROW())",
// t-Statistic
"=%COEFFICIENTS_RANGE% / %SERRORSX_RANGE%",
// p-Value
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index f3f672d23d42..7d16794db8b1 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -993,10 +993,10 @@ void ScInputHandler::GetFormulaData()
maFormulaChar.insert( c );
}
OUString aFuncName = *pDesc->mxFuncName + aParenthesesReplacement;
- pFormulaData->insert(ScTypedStrData(aFuncName, 0.0, ScTypedStrData::Standard));
+ pFormulaData->insert(ScTypedStrData(aFuncName, 0.0, 0.0, ScTypedStrData::Standard));
pDesc->initArgumentInfo();
OUString aEntry = pDesc->getSignature();
- pFormulaDataPara->insert(ScTypedStrData(aEntry, 0.0, ScTypedStrData::Standard));
+ pFormulaDataPara->insert(ScTypedStrData(aEntry, 0.0, 0.0, ScTypedStrData::Standard));
}
}
miAutoPosFormula = pFormulaData->end();
diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx
index 7e4f1b9fbfdc..6eca1fbbdf94 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -124,7 +124,7 @@ IMPL_LINK_NOARG(ScCheckListMenuControl, SelectHdl, weld::TreeView&, void)
setSelectedMenuItem(nSelectedMenu, true);
}
-void ScCheckListMenuControl::addMenuItem(const OUString& rText, Action* pAction)
+void ScCheckListMenuControl::addMenuItem(const OUString& rText, Action* pAction, bool bIndicateSubMenu)
{
MenuItemData aItem;
aItem.mbEnabled = true;
@@ -134,7 +134,12 @@ void ScCheckListMenuControl::addMenuItem(const OUString& rText, Action* pAction)
mxMenu->show();
mxMenu->append_text(rText);
if (mbCanHaveSubMenu)
- mxMenu->set_image(mxMenu->n_children() - 1, css::uno::Reference<css::graphic::XGraphic>(), 1);
+ {
+ if (bIndicateSubMenu)
+ mxMenu->set_image(mxMenu->n_children() - 1, *mxDropDown, 1);
+ else
+ mxMenu->set_image(mxMenu->n_children() - 1, css::uno::Reference<css::graphic::XGraphic>(), 1);
+ }
}
void ScCheckListMenuControl::addSeparator()
diff --git a/sc/source/ui/dbgui/PivotLayoutDialog.cxx b/sc/source/ui/dbgui/PivotLayoutDialog.cxx
index 39357771105d..a496b9a6efb4 100644
--- a/sc/source/ui/dbgui/PivotLayoutDialog.cxx
+++ b/sc/source/ui/dbgui/PivotLayoutDialog.cxx
@@ -627,7 +627,8 @@ void ScPivotLayoutDialog::PushDataFieldNames(std::vector<ScDPName>& rDataFieldNa
void ScPivotLayoutDialog::Close()
{
- DoClose( ScPivotLayoutWrapper::GetChildWindowId() );
+ DoClose(ScPivotLayoutWrapper::GetChildWindowId());
+ SfxDialogController::Close();
}
IMPL_LINK_NOARG( ScPivotLayoutDialog, OKClicked, weld::Button&, void )
diff --git a/sc/source/ui/drawfunc/fuins1.cxx b/sc/source/ui/drawfunc/fuins1.cxx
index 31b597e9ea19..5c7bac6ce2a6 100644
--- a/sc/source/ui/drawfunc/fuins1.cxx
+++ b/sc/source/ui/drawfunc/fuins1.cxx
@@ -113,7 +113,9 @@ static void lcl_InsertGraphic( const Graphic& rGraphic,
if (aRotation)
{
std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(nullptr, VclMessageType::Question,VclButtonsType::YesNo,ScResId(STR_QUERYROTATION)));
- if (xQueryBox->run() == RET_YES)
+ // tdf#145819 Apply the rotation information if the user does NOT want to unrotate the image
+ // If they chose Yes we ignore the rotation
+ if (xQueryBox->run() == RET_NO)
{
GraphicNativeTransform aTransform( rGraphic1 );
aTransform.rotate( aRotation );
diff --git a/sc/source/ui/inc/checklistmenu.hxx b/sc/source/ui/inc/checklistmenu.hxx
index 427f29c3f7d3..1043fe771d6a 100644
--- a/sc/source/ui/inc/checklistmenu.hxx
+++ b/sc/source/ui/inc/checklistmenu.hxx
@@ -124,7 +124,7 @@ public:
bool bCanHaveSubMenu, bool bTreeMode, int nWidth);
~ScCheckListMenuControl();
- void addMenuItem(const OUString& rText, Action* pAction);
+ void addMenuItem(const OUString& rText, Action* pAction, bool bIndicateSubMenu = false);
void addSeparator();
ScCheckListMenuWindow* addSubMenuItem(const OUString& rText, bool bEnabled);
void resizeToFitMenuItems();
diff --git a/sc/source/ui/optdlg/tpcalc.cxx b/sc/source/ui/optdlg/tpcalc.cxx
index 92570ea9653f..53517d81a0f0 100644
--- a/sc/source/ui/optdlg/tpcalc.cxx
+++ b/sc/source/ui/optdlg/tpcalc.cxx
@@ -82,12 +82,16 @@ std::unique_ptr<SfxTabPage> ScTpCalcOptions::Create( weld::Container* pPage, wel
return std::make_unique<ScTpCalcOptions>( pPage, pController, *rAttrSet );
}
-void ScTpCalcOptions::Reset( const SfxItemSet* /* rCoreAttrs */ )
+void ScTpCalcOptions::Reset(const SfxItemSet* rCoreAttrs)
{
sal_uInt16 d,m;
sal_Int16 y;
- *pLocalOptions = *pOldOptions;
+ pOldOptions.reset(new ScDocOptions(
+ static_cast<const ScTpCalcItem&>(rCoreAttrs->Get(
+ GetWhich(SID_SCDOCOPTIONS))).GetDocOptions()));
+
+ *pLocalOptions = *pOldOptions;
m_xBtnCase->set_active( !pLocalOptions->IsIgnoreCase() );
m_xBtnCase->set_sensitive( !officecfg::Office::Calc::Calculate::Other::CaseSensitive::isReadOnly() );
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index 29d3b29086da..9d280b35213e 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -1098,7 +1098,7 @@ static bool lcl_PutDataArray( ScDocShell& rDocShell, const ScRange& rRange,
const uno::Sequence< uno::Sequence<uno::Any> >& aData )
{
ScDocument& rDoc = rDocShell.GetDocument();
- ScDocFunc& rDocFunc = rDocShell.GetDocFunc();
+ ScFieldEditEngine& rEngine = rDoc.GetEditEngine();
SCTAB nTab = rRange.aStart.Tab();
SCCOL nStartCol = rRange.aStart.Col();
SCROW nStartRow = rRange.aStart.Row();
@@ -1175,7 +1175,19 @@ static bool lcl_PutDataArray( ScDocShell& rDocShell, const ScRange& rRange,
rElement >>= aUStr;
if ( !aUStr.isEmpty() )
{
- rDocFunc.SetStringOrEditCell(aPos, aUStr, false);
+ // tdf#146454 - check for a multiline string since setting an edit
+ // or string cell is in magnitudes slower than setting a plain string
+ if (ScStringUtil::isMultiline(aUStr))
+ {
+ rEngine.SetTextCurrentDefaults(aUStr);
+ rDoc.SetEditText(aPos, rEngine.CreateTextObject());
+ }
+ else
+ {
+ ScSetStringParam aParam;
+ aParam.setTextInput();
+ rDoc.SetString(aPos, aUStr, &aParam);
+ }
}
}
break;
diff --git a/sc/source/ui/unoobj/viewuno.cxx b/sc/source/ui/unoobj/viewuno.cxx
index a758a9054600..2085d217a1f3 100644
--- a/sc/source/ui/unoobj/viewuno.cxx
+++ b/sc/source/ui/unoobj/viewuno.cxx
@@ -545,16 +545,16 @@ void ScTabViewObj::SheetChanged( bool bSameTabButMoved )
uno::Reference< uno::XInterface > xSource(xView, uno::UNO_QUERY);
aEvent.Source = xSource;
aEvent.ActiveSheet = new ScTableSheetObj(pDocSh, rViewData.GetTabNo());
- for (auto it = aActivationListeners.begin(); it != aActivationListeners.end(); )
+ // Listener's handler may remove it from the listeners list
+ for (size_t i = aActivationListeners.size(); i > 0; --i)
{
try
{
- (*it)->activeSpreadsheetChanged( aEvent );
- ++it;
+ aActivationListeners[i - 1]->activeSpreadsheetChanged( aEvent );
}
catch( uno::Exception& )
{
- it = aActivationListeners.erase( it);
+ aActivationListeners.erase(aActivationListeners.begin() + (i - 1));
}
}
}
@@ -1150,17 +1150,17 @@ bool ScTabViewObj::MousePressed( const awt::MouseEvent& e )
aMouseEvent.Target = xTarget;
aMouseEvent.Modifiers = e.Modifiers;
- for (auto it = aMouseClickHandlers.begin(); it != aMouseClickHandlers.end(); )
+ // Listener's handler may remove it from the listeners list
+ for (size_t i = aMouseClickHandlers.size(); i > 0; --i)
{
try
{
- if (!(*it)->mousePressed( aMouseEvent ))
+ if (!aMouseClickHandlers[i - 1]->mousePressed(aMouseEvent))
bReturn = true;
- ++it;
}
catch ( uno::Exception& )
{
- it = aMouseClickHandlers.erase(it);
+ aMouseClickHandlers.erase(aMouseClickHandlers.begin() + (i - 1));
}
}
}
@@ -1260,17 +1260,17 @@ bool ScTabViewObj::MouseReleased( const awt::MouseEvent& e )
aMouseEvent.Target = xTarget;
aMouseEvent.Modifiers = e.Modifiers;
- for (auto it = aMouseClickHandlers.begin(); it != aMouseClickHandlers.end(); )
+ // Listener's handler may remove it from the listeners list
+ for (size_t i = aMouseClickHandlers.size(); i > 0; --i)
{
try
{
- if (!(*it)->mouseReleased( aMouseEvent ))
+ if (!aMouseClickHandlers[i - 1]->mouseReleased( aMouseEvent ))
bReturn = true;
- ++it;
}
catch ( uno::Exception& )
{
- it = aMouseClickHandlers.erase(it);
+ aMouseClickHandlers.erase(aMouseClickHandlers.begin() + (i - 1));
}
}
}
diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx
index 0bf79d6d108b..e77475d499b0 100644
--- a/sc/source/ui/view/cellsh3.cxx
+++ b/sc/source/ui/view/cellsh3.cxx
@@ -699,9 +699,7 @@ void ScCellShell::Execute( SfxRequest& rReq )
ScopedVclPtr<AbstractScMetricInputDlg> pDlg(pFact->CreateScMetricInputDlg(
pTabViewShell->GetFrameWeld(), "RowHeightDialog",
nCurHeight, ScGlobal::nStdRowHeight,
- eMetric,
- nCurHeight == ScGlobal::nStdRowHeight ? 2 : 4, //use 4 digits for user-defined values
- MAX_ROW_HEIGHT));
+ eMetric, 2, MAX_ROW_HEIGHT));
if ( pDlg->Execute() == RET_OK )
{
@@ -799,9 +797,7 @@ void ScCellShell::Execute( SfxRequest& rReq )
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
ScopedVclPtr<AbstractScMetricInputDlg> pDlg(pFact->CreateScMetricInputDlg(
pTabViewShell->GetFrameWeld(), "ColWidthDialog", nCurHeight,
- STD_COL_WIDTH, eMetric,
- nCurHeight == STD_COL_WIDTH ? 2 : 4, //use 4 digits for user-defined values
- MAX_COL_WIDTH));
+ STD_COL_WIDTH, eMetric, 2, MAX_COL_WIDTH));
if ( pDlg->Execute() == RET_OK )
{
tools::Long nVal = pDlg->GetInputValue();
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 05d75755aecb..e42a6eac94b8 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -602,7 +602,7 @@ void ScGridWindow::LaunchAutoFilterMenu(SCCOL nCol, SCROW nRow)
pNotifier = SfxViewShell::Current();
int nColWidth = ScViewData::ToPixel(rDoc.GetColWidth(nCol, nTab), mrViewData.GetPPTX());
- mpAutoFilterPopup.reset(VclPtr<ScCheckListMenuWindow>::Create(this, &rDoc, false,
+ mpAutoFilterPopup.reset(VclPtr<ScCheckListMenuWindow>::Create(this, &rDoc, true,
aFilterEntries.mbHasDates, nColWidth,
nullptr, pNotifier));
ScCheckListMenuControl& rControl = mpAutoFilterPopup->get_widget();
@@ -746,9 +746,9 @@ void ScGridWindow::LaunchAutoFilterMenu(SCCOL nCol, SCROW nRow)
ScResId(SCSTR_FILTER_NOTEMPTY), new AutoFilterAction(this, AutoFilterMode::NonEmpty));
rControl.addSeparator();
rControl.addMenuItem(
- ScResId(SCSTR_FILTER_TEXT_COLOR), new AutoFilterAction(this, AutoFilterMode::TextColor));
+ ScResId(SCSTR_FILTER_TEXT_COLOR), new AutoFilterAction(this, AutoFilterMode::TextColor), true);
rControl.addMenuItem(
- ScResId(SCSTR_FILTER_BACKGROUND_COLOR), new AutoFilterAction(this, AutoFilterMode::BackgroundColor));
+ ScResId(SCSTR_FILTER_BACKGROUND_COLOR), new AutoFilterAction(this, AutoFilterMode::BackgroundColor), true);
rControl.addSeparator();
rControl.addMenuItem(
ScResId(SCSTR_STDFILTER), new AutoFilterAction(this, AutoFilterMode::Custom));
@@ -1266,10 +1266,10 @@ void ScGridWindow::LaunchDataSelectMenu( SCCOL nCol, SCROW nRow )
if ( rDoc.HasValueData( nCol, nRow, nTab ) )
{
double fVal = rDoc.GetValue(ScAddress(nCol, nRow, nTab));
- pNew.reset(new ScTypedStrData(aDocStr, fVal, ScTypedStrData::Value));
+ pNew.reset(new ScTypedStrData(aDocStr, fVal, fVal, ScTypedStrData::Value));
}
else
- pNew.reset(new ScTypedStrData(aDocStr, 0.0, ScTypedStrData::Standard));
+ pNew.reset(new ScTypedStrData(aDocStr, 0.0, 0.0, ScTypedStrData::Standard));
if (pData->GetListType() == css::sheet::TableValidationVisibility::SORTEDASCENDING)
{
@@ -1296,12 +1296,16 @@ void ScGridWindow::LaunchDataSelectMenu( SCCOL nCol, SCROW nRow )
{
rFilterBox.grab_focus();
+ if (rFilterBox.n_children())
+ {
+ if (nSelPos != -1)
+ rFilterBox.set_cursor(nSelPos);
+ else
+ rFilterBox.set_cursor(0);
+ }
// Select only after GrabFocus, so that the focus rectangle gets correct
if (nSelPos != -1)
- {
- rFilterBox.set_cursor(nSelPos);
rFilterBox.select(nSelPos);
- }
else
rFilterBox.unselect_all();
diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
index 93b542b2c851..9a3174720dbe 100644
--- a/sc/source/ui/view/output.cxx
+++ b/sc/source/ui/view/output.cxx
@@ -291,7 +291,7 @@ void ScOutputData::SetSyntaxMode( bool bNewMode )
void ScOutputData::DrawGrid(vcl::RenderContext& rRenderContext, bool bGrid, bool bPage, bool bMergeCover)
{
// bMergeCover : Draw lines in sheet bgcolor to cover lok client grid lines in merged cell areas.
- // (Used when scNoGridBackground is set in lok mode.)
+ // When scNoGridBackground is set in lok mode, bMergeCover is set to true and bGrid to false.
SCCOL nX;
SCROW nY;
@@ -355,10 +355,7 @@ void ScOutputData::DrawGrid(vcl::RenderContext& rRenderContext, bool bGrid, bool
tools::Long nLayoutSign = bLayoutRTL ? -1 : 1;
tools::Long nSignedOneX = nOneX * nLayoutSign;
- if (bGrid)
- rRenderContext.SetLineColor(aGridColor);
- else if (bMergeCover)
- rRenderContext.SetLineColor(aSheetBGColor);
+ rRenderContext.SetLineColor(bMergeCover ? aSheetBGColor : aGridColor);
ScGridMerger aGrid(&rRenderContext, nOneX, nOneY);
@@ -401,14 +398,9 @@ void ScOutputData::DrawGrid(vcl::RenderContext& rRenderContext, bool bGrid, bool
aPageColor );
bDashed = true;
}
- else if (bGrid)
- {
- rRenderContext.SetLineColor( aGridColor );
- bDashed = false;
- }
- else if (bMergeCover)
+ else
{
- rRenderContext.SetLineColor(aSheetBGColor);
+ rRenderContext.SetLineColor(bMergeCover ? aSheetBGColor : aGridColor);
bDashed = false;
}
@@ -466,18 +458,14 @@ void ScOutputData::DrawGrid(vcl::RenderContext& rRenderContext, bool bGrid, bool
}
}
- if (pThisRowInfo->bChanged && !bHOver && bGrid)
- {
- aGrid.AddVerLine(bWorksInPixels, nPosX-nSignedOneX, nPosY, nNextY-nOneY, bDashed);
- }
- else if (bHOver && bMergeCover)
+ if ((pThisRowInfo->bChanged && !bHOver && !bMergeCover) || (bHOver && bMergeCover))
{
aGrid.AddVerLine(bWorksInPixels, nPosX-nSignedOneX, nPosY, nNextY-nOneY, bDashed);
}
nPosY = nNextY;
}
}
- else if (bGrid)
+ else if (!bMergeCover)
{
aGrid.AddVerLine(bWorksInPixels, nPosX-nSignedOneX, nScrY, nScrY+nScrH-nOneY, bDashed);
}
@@ -527,14 +515,9 @@ void ScOutputData::DrawGrid(vcl::RenderContext& rRenderContext, bool bGrid, bool
aPageColor );
bDashed = true;
}
- else if (bGrid)
- {
- rRenderContext.SetLineColor( aGridColor );
- bDashed = false;
- }
- else if (bMergeCover)
+ else
{
- rRenderContext.SetLineColor(aSheetBGColor);
+ rRenderContext.SetLineColor(bMergeCover ? aSheetBGColor : aGridColor);
bDashed = false;
}
@@ -581,11 +564,7 @@ void ScOutputData::DrawGrid(vcl::RenderContext& rRenderContext, bool bGrid, bool
//! nVisY from Array ??
}
- if (!bVOver && bGrid)
- {
- aGrid.AddHorLine(bWorksInPixels, nPosX, nNextX-nSignedOneX, nPosY-nOneY, bDashed);
- }
- else if (bVOver && bMergeCover)
+ if ((!bVOver && !bMergeCover) || (bVOver && bMergeCover))
{
aGrid.AddHorLine(bWorksInPixels, nPosX, nNextX-nSignedOneX, nPosY-nOneY, bDashed);
}
@@ -593,7 +572,7 @@ void ScOutputData::DrawGrid(vcl::RenderContext& rRenderContext, bool bGrid, bool
nPosX = nNextX;
}
}
- else if (bGrid)
+ else if (!bMergeCover)
{
aGrid.AddHorLine(bWorksInPixels, nScrX, nScrX+nScrW-nOneX, nPosY-nOneY, bDashed);
}
diff --git a/sc/source/ui/xmlsource/xmlsourcedlg.cxx b/sc/source/ui/xmlsource/xmlsourcedlg.cxx
index 0bbfa9d200b8..8a9bac6be412 100644
--- a/sc/source/ui/xmlsource/xmlsourcedlg.cxx
+++ b/sc/source/ui/xmlsource/xmlsourcedlg.cxx
@@ -553,7 +553,9 @@ void ScXMLSourceDlg::RefEditModified()
OUString aRefStr = mxRefEdit->GetText();
// Check if the address is valid.
+ // Preset current sheet in case only address was entered.
ScAddress aLinkedPos;
+ aLinkedPos.SetTab( ScDocShell::GetCurTab());
ScRefFlags nRes = aLinkedPos.Parse(aRefStr, *mpDoc, mpDoc->GetAddressConvention());
bool bValid = ( (nRes & ScRefFlags::VALID) == ScRefFlags::VALID );
diff --git a/sc/uiconfig/scalc/ui/filterdropdown.ui b/sc/uiconfig/scalc/ui/filterdropdown.ui
index fccc56e8b5b3..6ad9f0ae6797 100644
--- a/sc/uiconfig/scalc/ui/filterdropdown.ui
+++ b/sc/uiconfig/scalc/ui/filterdropdown.ui
@@ -87,6 +87,7 @@
</child>
<child>
<object class="GtkTreeViewColumn" id="treeviewcolumn1">
+ <property name="expand">True</property>
<child>
<object class="GtkCellRendererText" id="cellrenderertext1"/>
<attributes>