[Libreoffice-commits] core.git: sc/CppunitTest_sc_ucalc.mk sc/qa

2021-05-16 Thread Xisco Fauli (via logerrit)
 sc/CppunitTest_sc_ucalc.mk  |1 
 sc/qa/unit/ucalc.cxx|  167 
 sc/qa/unit/ucalc_column.cxx |  183 
 3 files changed, 167 insertions(+), 184 deletions(-)

New commits:
commit 39270f32a2d93df691f61ed6a38854d611196e87
Author: Xisco Fauli 
AuthorDate: Sun May 16 20:31:46 2021 +0200
Commit: Xisco Fauli 
CommitDate: Sun May 16 23:41:28 2021 +0200

sc_ucalc: no need to have one cxx file for just 3 tests

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

diff --git a/sc/CppunitTest_sc_ucalc.mk b/sc/CppunitTest_sc_ucalc.mk
index fde0bf350eb3..16dfcf0e1d55 100644
--- a/sc/CppunitTest_sc_ucalc.mk
+++ b/sc/CppunitTest_sc_ucalc.mk
@@ -15,7 +15,6 @@ $(eval $(call 
gb_Library_use_common_precompiled_header,sc_ucalc))
 
 $(eval $(call gb_CppunitTest_add_exception_objects,sc_ucalc, \
 sc/qa/unit/ucalc \
-sc/qa/unit/ucalc_column \
 sc/qa/unit/ucalc_formula \
 ))
 
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index baf25789d64b..8b0a231f09c9 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -12021,6 +12021,173 @@ void Test::testFormulaToValue2()
 m_pDoc->DeleteTab(0);
 }
 
+void Test::testColumnFindEditCells()
+{
+m_pDoc->InsertTab(0, "Test");
+
+// Test the basics with real edit cells, using Column A.
+
+SCROW nResRow = m_pDoc->GetFirstEditTextRow(ScRange(0,0,0,0,MAXROW,0));
+CPPUNIT_ASSERT_EQUAL_MESSAGE("There should be no edit cells.", SCROW(-1), 
nResRow);
+nResRow = m_pDoc->GetFirstEditTextRow(ScRange(0,0,0,0,0,0));
+CPPUNIT_ASSERT_EQUAL_MESSAGE("There should be no edit cells.", SCROW(-1), 
nResRow);
+nResRow = m_pDoc->GetFirstEditTextRow(ScRange(0,0,0,0,10,0));
+CPPUNIT_ASSERT_EQUAL_MESSAGE("There should be no edit cells.", SCROW(-1), 
nResRow);
+
+ScFieldEditEngine& rEE = m_pDoc->GetEditEngine();
+rEE.SetTextCurrentDefaults("Test");
+m_pDoc->SetEditText(ScAddress(0,0,0), rEE.CreateTextObject());
+const EditTextObject* pObj = m_pDoc->GetEditText(ScAddress(0,0,0));
+CPPUNIT_ASSERT_MESSAGE("There should be an edit cell here.", pObj);
+
+ScRange aRange(0,0,0,0,0,0);
+nResRow = m_pDoc->GetFirstEditTextRow(aRange);
+CPPUNIT_ASSERT_EQUAL_MESSAGE("There is an edit cell here.", SCROW(0), 
nResRow);
+
+aRange.aStart.SetRow(1);
+aRange.aEnd.SetRow(1);
+nResRow = m_pDoc->GetFirstEditTextRow(aRange);
+CPPUNIT_ASSERT_EQUAL_MESSAGE("There shouldn't be an edit cell in specified 
range.", SCROW(-1), nResRow);
+
+aRange.aStart.SetRow(2);
+aRange.aEnd.SetRow(4);
+nResRow = m_pDoc->GetFirstEditTextRow(aRange);
+CPPUNIT_ASSERT_EQUAL_MESSAGE("There shouldn't be an edit cell in specified 
range.", SCROW(-1), nResRow);
+
+aRange.aStart.SetRow(0);
+aRange.aEnd.SetRow(MAXROW);
+nResRow = m_pDoc->GetFirstEditTextRow(aRange);
+CPPUNIT_ASSERT_EQUAL_MESSAGE("There should be an edit cell in specified 
range.", SCROW(0), nResRow);
+
+m_pDoc->SetString(ScAddress(0,0,0), "Test");
+m_pDoc->SetValue(ScAddress(0,2,0), 1.0);
+ScRefCellValue aCell;
+aCell.assign(*m_pDoc, ScAddress(0,0,0));
+CPPUNIT_ASSERT_EQUAL_MESSAGE("This should be a string cell.", 
CELLTYPE_STRING, aCell.meType);
+aCell.assign(*m_pDoc, ScAddress(0,1,0));
+CPPUNIT_ASSERT_EQUAL_MESSAGE("This should be an empty cell.", 
CELLTYPE_NONE, aCell.meType);
+aCell.assign(*m_pDoc, ScAddress(0,2,0));
+CPPUNIT_ASSERT_EQUAL_MESSAGE("This should be a numeric cell.", 
CELLTYPE_VALUE, aCell.meType);
+aCell.assign(*m_pDoc, ScAddress(0,3,0));
+CPPUNIT_ASSERT_EQUAL_MESSAGE("This should be an empty cell.", 
CELLTYPE_NONE, aCell.meType);
+
+aRange.aStart.SetRow(1);
+aRange.aEnd.SetRow(1);
+nResRow = m_pDoc->GetFirstEditTextRow(aRange);
+CPPUNIT_ASSERT_EQUAL_MESSAGE("There shouldn't be an edit cell in specified 
range.", SCROW(-1), nResRow);
+
+// Test with non-edit cell but with ambiguous script type.
+
+m_pDoc->SetString(ScAddress(1,11,0), "Some text");
+m_pDoc->SetString(ScAddress(1,12,0), "Some text");
+m_pDoc->SetString(ScAddress(1,13,0), "Other text");
+
+m_pDoc->SetScriptType(ScAddress(1,11,0), (SvtScriptType::LATIN | 
SvtScriptType::ASIAN));
+m_pDoc->SetScriptType(ScAddress(1,12,0), (SvtScriptType::LATIN | 
SvtScriptType::ASIAN));
+m_pDoc->SetScriptType(ScAddress(1,13,0), (SvtScriptType::LATIN | 
SvtScriptType::ASIAN));
+
+nResRow = m_pDoc->GetFirstEditTextRow(ScAddress(1,11,0));
+CPPUNIT_ASSERT_EQUAL(static_cast(11), nResRow);
+nResRow = m_pDoc->GetFirstEditTextRow(ScAddress(1,12,0));
+CPPUNIT_ASSERT_EQUAL(static_cast(12), nResRow);
+
+for (SCROW i = 0; i <= 5; ++i)
+m_pDoc->SetString(ScAddress(2,i,0), "Text");
+
+m_pDoc->SetScriptType(ScAddress(2,5,0), (SvtScriptType::LATIN | 

[Libreoffice-commits] core.git: sc/CppunitTest_sc_ucalc.mk sc/CppunitTest_sc_ucalc_pivottable.mk sc/Module_sc.mk sc/qa

2021-05-14 Thread Xisco Fauli (via logerrit)
 sc/CppunitTest_sc_ucalc.mk|1 
 sc/CppunitTest_sc_ucalc_pivottable.mk |  119 +++
 sc/Module_sc.mk   |1 
 sc/qa/unit/ucalc.hxx  |  107 -
 sc/qa/unit/ucalc_pivottable.cxx   |  206 ++
 5 files changed, 302 insertions(+), 132 deletions(-)

New commits:
commit 08905cea24f8f60f7774f10a7877a6311ff0001d
Author: Xisco Fauli 
AuthorDate: Thu May 13 18:50:27 2021 +0200
Commit: Xisco Fauli 
CommitDate: Fri May 14 12:45:20 2021 +0200

sc_ucalc: move pivot table tests to their own module

in order to split sc_ucalc monster into smaller
modules

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

diff --git a/sc/CppunitTest_sc_ucalc.mk b/sc/CppunitTest_sc_ucalc.mk
index bdf28c70a8be..ad4d96735b9f 100644
--- a/sc/CppunitTest_sc_ucalc.mk
+++ b/sc/CppunitTest_sc_ucalc.mk
@@ -18,7 +18,6 @@ $(eval $(call gb_CppunitTest_add_exception_objects,sc_ucalc, \
 sc/qa/unit/ucalc_column \
 sc/qa/unit/ucalc_condformat \
 sc/qa/unit/ucalc_formula \
-sc/qa/unit/ucalc_pivottable \
 ))
 
 $(eval $(call gb_CppunitTest_use_library_objects,sc_ucalc, \
diff --git a/sc/CppunitTest_sc_ucalc_pivottable.mk 
b/sc/CppunitTest_sc_ucalc_pivottable.mk
new file mode 100644
index ..fbf88762bd78
--- /dev/null
+++ b/sc/CppunitTest_sc_ucalc_pivottable.mk
@@ -0,0 +1,119 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#*
+#
+# This file is part of the LibreOffice project.
+#
+# 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/.
+#
+#*
+
+$(eval $(call gb_CppunitTest_CppunitTest,sc_ucalc_pivottable))
+
+$(eval $(call gb_Library_use_common_precompiled_header,sc_ucalc_pivottable))
+
+$(eval $(call gb_CppunitTest_add_exception_objects,sc_ucalc_pivottable, \
+   sc/qa/unit/ucalc_pivottable \
+))
+
+$(eval $(call gb_CppunitTest_use_library_objects,sc_ucalc_pivottable, \
+   sc \
+   scqahelper \
+))
+
+$(eval $(call gb_CppunitTest_use_externals,sc_ucalc_pivottable,\
+   boost_headers \
+$(call gb_Helper_optional,OPENCL, \
+clew) \
+icu_headers \
+icui18n \
+icuuc \
+   libxml2 \
+   mdds_headers \
+   orcus \
+   orcus-parser \
+))
+
+$(eval $(call gb_CppunitTest_use_libraries,sc_ucalc_pivottable, \
+   $(call gb_Helper_optional,AVMEDIA,avmedia) \
+basegfx \
+comphelper \
+cppu \
+cppuhelper \
+dbtools \
+drawinglayer \
+editeng \
+for \
+forui \
+i18nlangtag \
+i18nutil \
+   $(call gb_Helper_optional,OPENCL, \
+   opencl) \
+sal \
+salhelper \
+sax \
+sb \
+sfx \
+sot \
+svl \
+svt \
+svx \
+svxcore \
+   test \
+tk \
+tl \
+ucbhelper \
+   unotest \
+utl \
+vbahelper \
+vcl \
+xo \
+))
+
+$(eval $(call gb_CppunitTest_set_include,sc_ucalc_pivottable,\
+-I$(SRCDIR)/sc/source/ui/inc \
+-I$(SRCDIR)/sc/source/core/inc \
+-I$(SRCDIR)/sc/inc \
+$$(INCLUDE) \
+))
+
+$(eval $(call gb_CppunitTest_use_api,sc_ucalc_pivottable,\
+   udkapi \
+   offapi \
+   oovbaapi \
+))
+
+$(eval $(call gb_CppunitTest_use_custom_headers,sc_ucalc_pivottable,\
+   officecfg/registry \
+))
+
+$(eval $(call gb_CppunitTest_use_ure,sc_ucalc_pivottable))
+$(eval $(call gb_CppunitTest_use_vcl,sc_ucalc_pivottable))
+
+$(eval $(call gb_CppunitTest_use_components,sc_ucalc_pivottable,\
+configmgr/source/configmgr \
+framework/util/fwk \
+i18npool/source/search/i18nsearch \
+i18npool/util/i18npool \
+sax/source/expatwrap/expwrap \
+scaddins/source/analysis/analysis \
+scaddins/source/datefunc/date \
+scaddins/source/pricing/pricing \
+sfx2/util/sfx \
+ucb/source/core/ucb1 \
+ucb/source/ucp/file/ucpfile1 \
+unoxml/source/service/unoxml \
+uui/util/uui \
+vcl/vcl.common \
+))
+
+ifeq ($(OS),LINUX)
+$(eval $(call gb_CppunitTest_add_libs,sc_ucalc_pivottable,\
+ -lrt \
+))
+endif
+
+$(eval $(call gb_CppunitTest_use_configuration,sc_ucalc_pivottable))
+
+# vim: set noet sw=4 ts=4:
diff --git a/sc/Module_sc.mk b/sc/Module_sc.mk
index 1c9d8989ad01..f2428ded2919 100644
--- a/sc/Module_sc.mk
+++ b/sc/Module_sc.mk
@@ -39,6 +39,7 @@ $(eval $(call gb_Module_add_check_targets,sc,\
Library_scqahelper \
$(if $(and $(filter $(COM),MSC),$(MERGELIBS)),, \
CppunitTest_sc_ucalc) \
+   CppunitTest_sc_ucalc_pivottable \
CppunitTest_sc_ucalc_sharedformula \
CppunitTest_sc_ucalc_sort \
 

[Libreoffice-commits] core.git: sc/CppunitTest_sc_ucalc.mk sc/CppunitTest_sc_ucalc_sort.mk sc/inc sc/Module_sc.mk sc/qa

2021-05-14 Thread Xisco Fauli (via logerrit)
 sc/CppunitTest_sc_ucalc.mk  |1 
 sc/CppunitTest_sc_ucalc_sort.mk |  119 +++
 sc/Module_sc.mk |1 
 sc/inc/document.hxx |4 
 sc/qa/unit/helper/qahelper.cxx  |   92 +
 sc/qa/unit/helper/qahelper.hxx  |   19 
 sc/qa/unit/ucalc.cxx|   93 -
 sc/qa/unit/ucalc.hxx|   59 -
 sc/qa/unit/ucalc_formula.cxx|   20 ++--
 sc/qa/unit/ucalc_pivottable.cxx |2 
 sc/qa/unit/ucalc_sort.cxx   |  174 ++--
 11 files changed, 378 insertions(+), 206 deletions(-)

New commits:
commit 1f23231c56cf33deacab3083f1ed771f10f91b00
Author: Xisco Fauli 
AuthorDate: Wed May 12 22:16:34 2021 +0200
Commit: Xisco Fauli 
CommitDate: Fri May 14 12:44:03 2021 +0200

sc_ucalc: move sort tests to their own module

in order to split sc_ucalc monster into smaller
modules
Change-Id: Ib041d1fbce51230dcc46320939257771eac0faea

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

diff --git a/sc/CppunitTest_sc_ucalc.mk b/sc/CppunitTest_sc_ucalc.mk
index 8943de7ab4c3..4f20bb1c598e 100644
--- a/sc/CppunitTest_sc_ucalc.mk
+++ b/sc/CppunitTest_sc_ucalc.mk
@@ -20,7 +20,6 @@ $(eval $(call gb_CppunitTest_add_exception_objects,sc_ucalc, \
 sc/qa/unit/ucalc_formula \
 sc/qa/unit/ucalc_pivottable \
 sc/qa/unit/ucalc_sharedformula \
-sc/qa/unit/ucalc_sort \
 ))
 
 $(eval $(call gb_CppunitTest_use_library_objects,sc_ucalc, \
diff --git a/sc/CppunitTest_sc_ucalc_sort.mk b/sc/CppunitTest_sc_ucalc_sort.mk
new file mode 100644
index ..4e598889817a
--- /dev/null
+++ b/sc/CppunitTest_sc_ucalc_sort.mk
@@ -0,0 +1,119 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#*
+#
+# This file is part of the LibreOffice project.
+#
+# 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/.
+#
+#*
+
+$(eval $(call gb_CppunitTest_CppunitTest,sc_ucalc_sort))
+
+$(eval $(call gb_Library_use_common_precompiled_header,sc_ucalc_sort))
+
+$(eval $(call gb_CppunitTest_add_exception_objects,sc_ucalc_sort, \
+sc/qa/unit/ucalc_sort \
+))
+
+$(eval $(call gb_CppunitTest_use_library_objects,sc_ucalc_sort, \
+   sc \
+   scqahelper \
+))
+
+$(eval $(call gb_CppunitTest_use_externals,sc_ucalc_sort,\
+   boost_headers \
+$(call gb_Helper_optional,OPENCL, \
+clew) \
+icu_headers \
+icui18n \
+icuuc \
+   libxml2 \
+   mdds_headers \
+   orcus \
+   orcus-parser \
+))
+
+$(eval $(call gb_CppunitTest_use_libraries,sc_ucalc_sort, \
+   $(call gb_Helper_optional,AVMEDIA,avmedia) \
+basegfx \
+comphelper \
+cppu \
+cppuhelper \
+dbtools \
+drawinglayer \
+editeng \
+for \
+forui \
+i18nlangtag \
+i18nutil \
+   $(call gb_Helper_optional,OPENCL, \
+   opencl) \
+sal \
+salhelper \
+sax \
+sb \
+sfx \
+sot \
+svl \
+svt \
+svx \
+svxcore \
+   test \
+tk \
+tl \
+ucbhelper \
+   unotest \
+utl \
+vbahelper \
+vcl \
+xo \
+))
+
+$(eval $(call gb_CppunitTest_set_include,sc_ucalc_sort,\
+-I$(SRCDIR)/sc/source/ui/inc \
+-I$(SRCDIR)/sc/source/core/inc \
+-I$(SRCDIR)/sc/inc \
+$$(INCLUDE) \
+))
+
+$(eval $(call gb_CppunitTest_use_api,sc_ucalc_sort,\
+   udkapi \
+   offapi \
+   oovbaapi \
+))
+
+$(eval $(call gb_CppunitTest_use_custom_headers,sc_ucalc_sort,\
+   officecfg/registry \
+))
+
+$(eval $(call gb_CppunitTest_use_ure,sc_ucalc_sort))
+$(eval $(call gb_CppunitTest_use_vcl,sc_ucalc_sort))
+
+$(eval $(call gb_CppunitTest_use_components,sc_ucalc_sort,\
+configmgr/source/configmgr \
+framework/util/fwk \
+i18npool/source/search/i18nsearch \
+i18npool/util/i18npool \
+sax/source/expatwrap/expwrap \
+scaddins/source/analysis/analysis \
+scaddins/source/datefunc/date \
+scaddins/source/pricing/pricing \
+sfx2/util/sfx \
+ucb/source/core/ucb1 \
+ucb/source/ucp/file/ucpfile1 \
+unoxml/source/service/unoxml \
+uui/util/uui \
+vcl/vcl.common \
+))
+
+ifeq ($(OS),LINUX)
+$(eval $(call gb_CppunitTest_add_libs,sc_ucalc_sort,\
+ -lrt \
+))
+endif
+
+$(eval $(call gb_CppunitTest_use_configuration,sc_ucalc_sort))
+
+# vim: set noet sw=4 ts=4:
diff --git a/sc/Module_sc.mk b/sc/Module_sc.mk
index ea4fc94b8e9e..78d28fba4ded 100644
--- a/sc/Module_sc.mk
+++ b/sc/Module_sc.mk
@@ -39,6 +39,7 @@ $(eval $(call gb_Module_add_check_targets,sc,\
Library_scqahelper \
  

[Libreoffice-commits] core.git: sc/CppunitTest_sc_ucalc.mk sc/inc sc/Library_sc.mk sc/source

2017-06-05 Thread Kohei Yoshida
 sc/CppunitTest_sc_ucalc.mk   |6 
 sc/Library_sc.mk |6 
 sc/inc/dpcache.hxx   |   10 -
 sc/source/core/data/dpcache.cxx  |  376 ++-
 sc/source/core/data/dpobject.cxx |4 
 5 files changed, 317 insertions(+), 85 deletions(-)

New commits:
commit a078328e91ab9cbd78a92608c1abdc2c57ff9ac5
Author: Kohei Yoshida 
Date:   Tue May 23 22:09:40 2017 -0400

tdf#107945: prepare for future multi-threading of pivot cache...

It's disabled for now. We need to first make the edit engine and
a few other places thread-safe before we can parallelize this code.

Change-Id: Ie09536964ece42d43f505afc5e2611d469cc5c95
Reviewed-on: https://gerrit.libreoffice.org/38424
Tested-by: Jenkins 
Reviewed-by: Kohei Yoshida 

diff --git a/sc/CppunitTest_sc_ucalc.mk b/sc/CppunitTest_sc_ucalc.mk
index 5e91862f416c..d918182a0c4f 100644
--- a/sc/CppunitTest_sc_ucalc.mk
+++ b/sc/CppunitTest_sc_ucalc.mk
@@ -112,6 +112,12 @@ $(eval $(call gb_CppunitTest_add_libs,sc_ucalc,\
 ))
 endif
 
+ifeq ($(OS), $(filter LINUX %BSD SOLARIS, $(OS)))
+$(eval $(call gb_CppunitTest_add_libs,sc_ucalc,\
+-lpthread \
+))
+endif
+
 $(eval $(call gb_CppunitTest_use_configuration,sc_ucalc))
 
 # vim: set noet sw=4 ts=4:
diff --git a/sc/Library_sc.mk b/sc/Library_sc.mk
index e72c61546f05..5b7d2fcf9275 100644
--- a/sc/Library_sc.mk
+++ b/sc/Library_sc.mk
@@ -696,6 +696,12 @@ $(eval $(call gb_Library_add_libs,sc,\
 ))
 endif
 
+ifeq ($(OS), $(filter LINUX %BSD SOLARIS, $(OS)))
+$(eval $(call gb_Library_add_libs,sc,\
+-lpthread \
+))
+endif
+
 $(eval $(call gb_SdiTarget_SdiTarget,sc/sdi/scslots,sc/sdi/scalc))
 
 $(eval $(call gb_SdiTarget_set_include,sc/sdi/scslots,\
diff --git a/sc/inc/dpcache.hxx b/sc/inc/dpcache.hxx
index 515a3fae6a19..3bac2751600d 100644
--- a/sc/inc/dpcache.hxx
+++ b/sc/inc/dpcache.hxx
@@ -42,9 +42,9 @@ struct ScDPNumGroupInfo;
  */
 class SC_DLLPUBLIC ScDPCache
 {
-typedef std::unordered_set StringSetType;
-
 public:
+typedef std::unordered_set StringSetType;
+typedef mdds::flat_segment_tree EmptyRowsType;
 typedef std::vector ScDPItemDataVec;
 typedef std::set ScDPObjectSet;
 typedef std::vector IndexArrayType;
@@ -117,17 +117,17 @@ private:
 
 FieldsType maFields;
 GroupFieldsType maGroupFields;
-StringSetType maStringPool;
+std::vector maStringPools; // one for each field.
 
 std::vector maLabelNames; // Stores dimension names and the data 
layout dimension name at position 0.
-mdds::flat_segment_tree maEmptyRows;
+EmptyRowsType maEmptyRows;
 SCROW mnDataSize;
 SCROW mnRowCount;
 
 bool mbDisposing;
 
 public:
-rtl_uString* InternString( const OUString& rStr );
+rtl_uString* InternString( size_t nDim, const OUString& rStr );
 void AddReference(ScDPObject* pObj) const;
 void RemoveReference(ScDPObject* pObj) const;
 const ScDPObjectSet& GetAllReferences() const;
diff --git a/sc/source/core/data/dpcache.cxx b/sc/source/core/data/dpcache.cxx
index 0383108bf81b..2064d840496d 100644
--- a/sc/source/core/data/dpcache.cxx
+++ b/sc/source/core/data/dpcache.cxx
@@ -43,6 +43,17 @@
 #include 
 #endif
 
+// TODO : Threaded pivot cache operation is disabled until we can figure out
+// ways to make the edit engine and number formatter codes thread-safe in a
+// proper fashion.
+#define ENABLE_THREADED_PIVOT_CACHE 0
+
+#if ENABLE_THREADED_PIVOT_CACHE
+#include 
+#include 
+#include 
+#endif
+
 using namespace ::com::sun::star;
 
 using ::com::sun::star::uno::Exception;
@@ -106,6 +117,17 @@ private:
 ScDocument* mpDoc;
 };
 
+rtl_uString* internString( ScDPCache::StringSetType& rPool, const OUString& 
rStr )
+{
+ScDPCache::StringSetType::iterator it = rPool.find(rStr);
+if (it != rPool.end())
+// In the pool.
+return (*it).pData;
+
+std::pair r = rPool.insert(rStr);
+return r.second ? (*r.first).pData : nullptr;
+}
+
 OUString createLabelString( const ScDocument* pDoc, SCCOL nCol, const 
ScRefCellValue& rCell )
 {
 OUString aDocStr = rCell.getRawString(pDoc);
@@ -125,16 +147,15 @@ OUString createLabelString( const ScDocument* pDoc, SCCOL 
nCol, const ScRefCellV
 }
 
 void initFromCell(
-ScDPCache& rCache, ScDocument* pDoc, const ScAddress& rPos,
-const ScRefCellValue& rCell,
-ScDPItemData& rData, sal_uInt32& rNumFormat)
+ScDPCache::StringSetType& rStrPool, ScDocument* pDoc, const ScAddress& 
rPos,
+const ScRefCellValue& rCell, ScDPItemData& rData, sal_uInt32& rNumFormat)
 {
 OUString aDocStr = rCell.getRawString(pDoc);
 rNumFormat = 0;
 
 if (rCell.hasError())
 {
-rData.SetErrorStringInterned(rCache.InternString(aDocStr));
+

[Libreoffice-commits] core.git: sc/CppunitTest_sc_ucalc.mk sc/qa starmath/qa

2016-01-26 Thread Markus Mohrhard
 sc/CppunitTest_sc_ucalc.mk  |1 
 sc/qa/unit/ucalc.cxx|  607 ---
 sc/qa/unit/ucalc_condformat.cxx |  630 
 starmath/qa/cppunit/test_nodetotextvisitors.cxx |3 
 4 files changed, 634 insertions(+), 607 deletions(-)

New commits:
commit f4544d3c95bac8f3203235f8482ecb435545b887
Author: Markus Mohrhard 
Date:   Tue Jan 26 16:50:22 2016 +0100

extract all cond format tests in ucalc to own file

Change-Id: Ia4773e81e7d3c23404090f5cf5d9d35038c24cd7
Reviewed-on: https://gerrit.libreoffice.org/21817
Tested-by: Jenkins 
Reviewed-by: Markus Mohrhard 

diff --git a/sc/CppunitTest_sc_ucalc.mk b/sc/CppunitTest_sc_ucalc.mk
index 07c74e5..cbdf4fd 100644
--- a/sc/CppunitTest_sc_ucalc.mk
+++ b/sc/CppunitTest_sc_ucalc.mk
@@ -14,6 +14,7 @@ $(eval $(call gb_CppunitTest_CppunitTest,sc_ucalc))
 $(eval $(call gb_CppunitTest_add_exception_objects,sc_ucalc, \
 sc/qa/unit/ucalc \
 sc/qa/unit/ucalc_column \
+sc/qa/unit/ucalc_condformat \
 sc/qa/unit/ucalc_formula \
 sc/qa/unit/ucalc_pivottable \
 sc/qa/unit/ucalc_sharedformula \
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index cbd3193..121977a 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -45,8 +45,6 @@
 #include "interpre.hxx"
 #include "columniterator.hxx"
 #include "types.hxx"
-#include "conditio.hxx"
-#include "colorscale.hxx"
 #include "fillinfo.hxx"
 #include "globstr.hrc"
 #include "tokenarray.hxx"
@@ -3722,73 +3720,6 @@ void Test::testCopyPasteSkipEmpty2()
 m_pDoc->DeleteTab(0);
 }
 
-void Test::testCopyPasteSkipEmptyConditionalFormatting()
-{
-m_pDoc->InsertTab(0, "Test");
-
-ScRange aDestRange(0,0,0,1,2,0);
-ScRange aSrcRange(3,3,0,5,4,0);
-
-ScMarkData aMark;
-aMark.SetMarkArea(aDestRange);
-
-m_pDoc->SetValue(0,0,0,1);
-m_pDoc->SetValue(1,0,0,1);
-m_pDoc->SetValue(0,1,0,1);
-m_pDoc->SetValue(0,2,0,1);
-m_pDoc->SetValue(1,2,0,1);
-
-//create conditional formatting for A1:B3
-ScConditionalFormatList* pCondFormatList = new ScConditionalFormatList();
-m_pDoc->SetCondFormList(pCondFormatList, 0);
-
-ScConditionalFormat* pFormat = new ScConditionalFormat(1, m_pDoc);
-pFormat->SetRange(aDestRange);
-sal_uLong nCondFormatKey = m_pDoc->AddCondFormat(pFormat, 0);
-
-// Prepare a clipboard content interleaved with empty cells.
-ScDocument aClipDoc(SCDOCMODE_CLIP);
-aClipDoc.ResetClip(m_pDoc, );
-ScClipParam aParam(aSrcRange, false);
-aClipDoc.SetClipParam(aParam);
-aClipDoc.SetValue(3,3,0,2);
-aClipDoc.SetValue(4,3,0,2);
-aClipDoc.SetValue(4,4,0,2);
-aClipDoc.SetValue(3,5,0,2);
-aClipDoc.SetValue(4,5,0,2);
-
-ScConditionalFormat* pClipFormat = new ScConditionalFormat(2, );
-pClipFormat->SetRange(aSrcRange);
-aClipDoc.AddCondFormat(pClipFormat, 0);
-
-// Create undo document.
-ScDocument* pUndoDoc = new ScDocument(SCDOCMODE_UNDO);
-pUndoDoc->InitUndo(m_pDoc, 0, 0);
-m_pDoc->CopyToDocument(aDestRange, InsertDeleteFlags::CONTENTS, false, 
pUndoDoc, );
-
-// Paste clipboard content onto A1:A5 but skip empty cells.
-bool bSkipEmpty = true;
-m_pDoc->CopyFromClip(aDestRange, aMark, InsertDeleteFlags::CONTENTS, 
pUndoDoc, , true, false, false, bSkipEmpty);
-
-ScConditionalFormatList* pList = m_pDoc->GetCondFormList(0);
-CPPUNIT_ASSERT_EQUAL(size_t(2), pList->size());
-CPPUNIT_ASSERT(m_pDoc->GetCondFormat(1,1,0));
-// empty cell in copy area does not overwrite conditional formatting
-CPPUNIT_ASSERT_EQUAL(sal_uInt32(nCondFormatKey), 
m_pDoc->GetCondFormat(1,1,0)->GetKey());
-for(SCCOL nCol = 0; nCol <= 1; ++nCol)
-{
-for(SCROW nRow = 0; nRow <= 2; ++nRow)
-{
-if(nRow == 1 && nCol == 1)
-continue;
-
-CPPUNIT_ASSERT(m_pDoc->GetCondFormat(nCol, nRow, 0));
-CPPUNIT_ASSERT(nCondFormatKey != m_pDoc->GetCondFormat(nCol, nRow, 
0)->GetKey());
-}
-}
-m_pDoc->DeleteTab(0);
-}
-
 void Test::testCutPasteRefUndo()
 {
 // Testing scenario: A2 references B2, and B2 gets cut and pasted onto C2,
@@ -5622,544 +5553,6 @@ void Test::testEditTextIterator()
 m_pDoc->DeleteTab(0);
 }
 
-void Test::testCondFormatINSDEL()
-{
-// fdo#62206
-m_pDoc->InsertTab(0, "Test");
-ScConditionalFormatList* pList = m_pDoc->GetCondFormList(0);
-
-ScConditionalFormat* pFormat = new ScConditionalFormat(1, m_pDoc);
-ScRangeList aRangeList(ScRange(0,0,0,0,3,0));
-pFormat->SetRange(aRangeList);
-ScCondFormatEntry* pEntry = new 
ScCondFormatEntry(SC_COND_DIRECT,"=B2","",m_pDoc,ScAddress(0,0,0),ScGlobal::GetRscString(STR_STYLENAME_RESULT));
-pFormat->AddEntry(pEntry);
-
-m_pDoc->AddCondFormatData(pFormat->GetRange(), 0, 1);
-pList->InsertNew(pFormat);
-
-

[Libreoffice-commits] core.git: sc/CppunitTest_sc_ucalc.mk

2014-11-25 Thread Tor Lillqvist
 sc/CppunitTest_sc_ucalc.mk |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit e7ac7ba7de64068f0264b71bc4d9ff182e278338
Author: Tor Lillqvist t...@collabora.com
Date:   Tue Nov 25 20:47:13 2014 +0200

Need -lrt for clock_gettime() with older glibc versions

Change-Id: I6ccd990ba71867f0ff96ad06cf5a9e7c98c93657

diff --git a/sc/CppunitTest_sc_ucalc.mk b/sc/CppunitTest_sc_ucalc.mk
index ead35fa..86795e8 100644
--- a/sc/CppunitTest_sc_ucalc.mk
+++ b/sc/CppunitTest_sc_ucalc.mk
@@ -106,6 +106,12 @@ $(eval $(call gb_CppunitTest_use_components,sc_ucalc,\
 uui/util/uui \
 ))
 
+ifeq ($(OS),LINUX)
+$(eval $(call gb_CppunitTest_add_libs,sc_ucalc,\
+ -lrt \
+))
+endif
+
 $(eval $(call gb_CppunitTest_use_configuration,sc_ucalc))
 
 # vim: set noet sw=4 ts=4:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sc/CppunitTest_sc_ucalc.mk

2014-05-07 Thread Tor Lillqvist
 sc/CppunitTest_sc_ucalc.mk |1 +
 1 file changed, 1 insertion(+)

New commits:
commit c63e2919ea1a1327e1f45abff964d981927cda23
Author: Tor Lillqvist t...@collabora.com
Date:   Wed May 7 23:06:11 2014 +0300

Need vclopengl now

Change-Id: I6f0aca371212fc51eefa29e526ccb646bdac70c3

diff --git a/sc/CppunitTest_sc_ucalc.mk b/sc/CppunitTest_sc_ucalc.mk
index f46622d..9b3c498 100644
--- a/sc/CppunitTest_sc_ucalc.mk
+++ b/sc/CppunitTest_sc_ucalc.mk
@@ -69,6 +69,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sc_ucalc, \
 utl \
 vbahelper \
 vcl \
+vclopengl \
 xo \
$(gb_UWINAPI) \
 ))
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits