core.git: external/mdds

2024-01-17 Thread Aron Budea (via logerrit)
 external/mdds/gcc-12-silence-use-after-free.patch.1 |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 5d52d7dcdf07e5d117e9854af5956b2e93ad3e46
Author: Aron Budea 
AuthorDate: Wed Jan 17 02:54:34 2024 +1030
Commit: Aron Budea 
CommitDate: Thu Jan 18 00:42:16 2024 +0100

silence use-after-free warning in mdds for gcc12.3 in optimized build

Follow-up to e7c4166f1e150b10bc2ac52e93f8ad7503db09dc as GCC 12.3
seems to be affected, too.

Change-Id: I8e5ba9be64625ffd21d43e627996a9ea8602ce9e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162181
Tested-by: Jenkins
Reviewed-by: Aron Budea 

diff --git a/external/mdds/gcc-12-silence-use-after-free.patch.1 
b/external/mdds/gcc-12-silence-use-after-free.patch.1
index 3f8dd0afe0f3..94f7ba979e61 100644
--- a/external/mdds/gcc-12-silence-use-after-free.patch.1
+++ b/external/mdds/gcc-12-silence-use-after-free.patch.1
@@ -28,13 +28,13 @@ diff -ur mdds.org/include/mdds/node.hpp 
mdds/include/mdds/node.hpp
  {
 ---p->refcount;
 -if (!p->refcount)
-+#if defined __GNUC__ && __GNUC__ == 12 && __GNUC_MINOR__ < 3 && !defined 
__clang__
++#if defined __GNUC__ && __GNUC__ == 12 && __GNUC_MINOR__ <= 3 && !defined 
__clang__
 +#pragma GCC diagnostic push
 +#pragma GCC diagnostic ignored "-Wuse-after-free"
 +#endif
 +if(--p->refcount == 0)
  delete p;
-+#if defined __GNUC__ && __GNUC__ == 12 && __GNUC_MINOR__ < 3 && !defined 
__clang__
++#if defined __GNUC__ && __GNUC__ == 12 && __GNUC_MINOR__ <= 3 && !defined 
__clang__
 +#pragma GCC diagnostic pop
 +#endif
  }


[Libreoffice-commits] core.git: external/mdds

2023-07-31 Thread Christian Lohmaier (via logerrit)
 external/mdds/UnpackedTarball_mdds.mk   |1 
 external/mdds/gcc-12-silence-use-after-free.patch.1 |   42 
 2 files changed, 43 insertions(+)

New commits:
commit e7c4166f1e150b10bc2ac52e93f8ad7503db09dc
Author: Christian Lohmaier 
AuthorDate: Tue Jul 25 10:47:07 2023 +0200
Commit: Christian Lohmaier 
CommitDate: Mon Jul 31 16:50:10 2023 +0200

silence use-after-free warning in mdds for gcc12 in optimized build

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

diff --git a/external/mdds/UnpackedTarball_mdds.mk 
b/external/mdds/UnpackedTarball_mdds.mk
index 271d20b0f4d1..5745da0b11c5 100644
--- a/external/mdds/UnpackedTarball_mdds.mk
+++ b/external/mdds/UnpackedTarball_mdds.mk
@@ -15,6 +15,7 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,mdds,0))
 
 $(eval $(call gb_UnpackedTarball_add_patches,mdds,\
 external/mdds/use-after-free.patch \
+external/mdds/gcc-12-silence-use-after-free.patch.1 \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/external/mdds/gcc-12-silence-use-after-free.patch.1 
b/external/mdds/gcc-12-silence-use-after-free.patch.1
new file mode 100644
index ..3f8dd0afe0f3
--- /dev/null
+++ b/external/mdds/gcc-12-silence-use-after-free.patch.1
@@ -0,0 +1,42 @@
+Workaround for gcc-toolset-12 on almalinux8 on a release/optimized build:
+[build CXX] sc/source/core/data/column2.cxx
+In file included from 
/home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_gcc_release_64/workdir/UnpackedTarball/mdds/include/mdds/flat_segment_tree.hpp:37,
+ from 
/home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_gcc_release_64/sc/inc/columnspanset.hxx:16,
+ from 
/home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_gcc_release_64/sc/inc/column.hxx:25,
+ from 
/home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_gcc_release_64/sc/source/core/data/column2.cxx:20:
+In function ‘void mdds::__st::intrusive_ptr_release(node*) [with T = 
mdds::flat_segment_tree]’,
+inlined from ‘boost::intrusive_ptr::~intrusive_ptr() [with T = 
mdds::__st::node >]’ at 
/home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_gcc_release_64/workdir/UnpackedTarball/boost/boost/smart_ptr/intrusive_ptr.hpp:100:44,
+inlined from ‘std::pair::const_iterator, bool> mdds::flat_segment_tree::insert_segment_impl(key_type, key_type, value_type, bool) [with Key = 
int; Value = bool]’ at 
/home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_gcc_release_64/workdir/UnpackedTarball/mdds/include/mdds/flat_segment_tree_def.inl:225:1:
+/home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_gcc_release_64/workdir/UnpackedTarball/mdds/include/mdds/node.hpp:247:10:
 error: pointer used after ‘void operator delete(void*, std::size_t)’ 
[-Werror=use-after-free]
+  247 | --p->refcount;
+  |   ~~~^~~~
+In function ‘void mdds::__st::intrusive_ptr_release(node*) [with T = 
mdds::flat_segment_tree]’,
+inlined from ‘void mdds::__st::intrusive_ptr_release(node*) [with T = 
mdds::flat_segment_tree]’ at 
/home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_gcc_release_64/workdir/UnpackedTarball/mdds/include/mdds/node.hpp:245:13,
+inlined from ‘boost::intrusive_ptr::~intrusive_ptr() [with T = 
mdds::__st::node >]’ at 
/home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_gcc_release_64/workdir/UnpackedTarball/boost/boost/smart_ptr/intrusive_ptr.hpp:100:44,
+inlined from ‘std::pair::const_iterator, bool> mdds::flat_segment_tree::insert_segment_impl(key_type, key_type, value_type, bool) [with Key = 
int; Value = bool]’ at 
/home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_gcc_release_64/workdir/UnpackedTarball/mdds/include/mdds/flat_segment_tree_def.inl:224:93:
+/home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_gcc_release_64/workdir/UnpackedTarball/mdds/include/mdds/node.hpp:249:9:
 note: call to ‘void operator delete(void*, std::size_t)’ here
+  249 | delete p;
+  | ^~~~
+cc1plus: all warnings being treated as errors
+
+diff -ur mdds.org/include/mdds/node.hpp mdds/include/mdds/node.hpp
+--- mdds.org/include/mdds/node.hpp 2023-07-24 18:27:14.427139325 +
 mdds/include/mdds/node.hpp 2023-07-24 18:26:54.554461294 +
+@@ -244,9 +244,15 @@
+ template
+ inline void intrusive_ptr_release(node* p)
+ {
+---p->refcount;
+-if (!p->refcount)
++#if defined __GNUC__ && __GNUC__ == 12 && __GNUC_MINOR__ < 3 && !defined 
__clang__
++#pragma GCC diagnostic push
++#pragma GCC diagnostic ignored "-Wuse-after-free"
++#endif
++if(--p->refcount == 0)
+ delete p;
++#if defined __GNUC__ && __GNUC__ == 12 && __GNUC_MINOR__ < 3 && !defined 
__clang__
++#pragma GCC diagnostic pop
++#endif
+ }
+ 
+ template


[Libreoffice-commits] core.git: external/mdds sc/inc sc/qa sc/source

2022-09-05 Thread Noel Grandin (via logerrit)
 external/mdds/UnpackedTarball_mdds.mk  |1 +
 external/mdds/speedup-erase-2.patch|   18 ++
 sc/inc/document.hxx|2 +-
 sc/inc/strings.hrc |1 +
 sc/inc/table.hxx   |4 ++--
 sc/qa/unit/ucalc.cxx   |   27 ++-
 sc/source/core/data/documen3.cxx   |8 
 sc/source/core/data/table6.cxx |   13 +
 sc/source/ui/dialogs/searchresults.cxx |   21 +++--
 sc/source/ui/inc/searchresults.hxx |4 +++-
 sc/source/ui/unoobj/cellsuno.cxx   |9 ++---
 sc/source/ui/view/viewfun2.cxx |8 +---
 12 files changed, 71 insertions(+), 45 deletions(-)

New commits:
commit a740176009411d21e20d7c11097af1d8812d251d
Author: Noel Grandin 
AuthorDate: Mon Sep 5 09:06:10 2022 +0200
Commit: Noel Grandin 
CommitDate: Mon Sep 5 13:45:36 2022 +0200

tdf#150749 Find and replace on very large sheet

This requires 2 fixes

(*) First, we are deleting from the front of a block in the mdds
storage, so apply a similar patch to mdds to the previous improvement,

(*) Then, we end up with an O(n^2) situation in ScRangesList::Join.
But we are only displaying this data, and in fact, we only display the
first 1000 ranges anyway, so just clamp the list to 1000 entries, and
pass a flag up to the dialog so that we can report that we stopped
counting.

(*) I had to tweak the testSharedStringPool unit test, since
we are not actually clearing the underlying mdds storage, the
reference counts do not drop until we have removed all the
elements in that block of mdds storage (because then the entire
block is destructed, including the not-yet destructed elements)

Change-Id: I2c998f81dfb46453a48fce1254fd253d299d12b8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139400
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/external/mdds/UnpackedTarball_mdds.mk 
b/external/mdds/UnpackedTarball_mdds.mk
index b1eff049710b..5465fd418a47 100644
--- a/external/mdds/UnpackedTarball_mdds.mk
+++ b/external/mdds/UnpackedTarball_mdds.mk
@@ -16,6 +16,7 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,mdds,0))
 $(eval $(call gb_UnpackedTarball_add_patches,mdds,\
 external/mdds/use-after-free.patch \
external/mdds/speedup-erase-begin.patch \
+   external/mdds/speedup-erase-2.patch \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/external/mdds/speedup-erase-2.patch 
b/external/mdds/speedup-erase-2.patch
new file mode 100644
index ..2affa4813420
--- /dev/null
+++ b/external/mdds/speedup-erase-2.patch
@@ -0,0 +1,18 @@
+diff -ur include/mdds/multi_type_vector/types.hpp 
include/mdds/multi_type_vector/types.hpp
+--- include/mdds/multi_type_vector/types.hpp   2022-09-02 15:16:14.811400565 
+0200
 include/mdds/multi_type_vector/types.hpp   2022-09-02 15:18:26.951249322 
+0200
+@@ -253,7 +253,13 @@
+ 
+ iterator erase( iterator first, iterator last )
+ {
+-return m_vec.erase( first, last );
++if (first == m_vec.begin() + m_removedFront)
++{
++m_removedFront = last - m_vec.begin();
++return m_vec.begin() + m_removedFront;
++}
++else
++return m_vec.erase( first, last );
+ }
+ 
+ size_type capacity() const
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 1767f8c4e5f0..810a21e0de6f 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -1934,7 +1934,7 @@ public:
 bool SearchAndReplace( const SvxSearchItem& rSearchItem,
SCCOL& rCol, SCROW& rRow, SCTAB& 
rTab,
const ScMarkData& rMark, 
ScRangeList& rMatchedRanges,
-   OUString& rUndoStr, ScDocument* 
pUndoDoc = nullptr );
+   OUString& rUndoStr, ScDocument* 
pUndoDoc, bool& bMatchedRangesWereClamped );
 static bool  IsEmptyCellSearch( const SvxSearchItem& rSearchItem );
 
 // determine Col/Row of subsequent calls
diff --git a/sc/inc/strings.hrc b/sc/inc/strings.hrc
index 9f9dfb454502..1d45fc0d7647 100644
--- a/sc/inc/strings.hrc
+++ b/sc/inc/strings.hrc
@@ -59,6 +59,7 @@
 #define STR_INSERTGRAPHIC   NC_("STR_INSERTGRAPHIC", 
"Insert Image")
 #define SCSTR_TOTAL NNC_("SCSTR_TOTAL", "One 
result found", "%1 results found")
 #define SCSTR_SKIPPED   NC_("SCSTR_SKIPPED", 
"(only %1 are listed)")
+#define SCSTR_RESULTS_CLAMPED   
NC_("SCSTR_RESULTS_CLAMPED", "More than %1 results found (stopped counting)")
 // Attribute
 #define SCSTR_PROTECTDOCNC_("SCSTR_PROTECTDOC", 
"Protect Spreadsheet Structure")
 #define SCSTR_UNPROTECTDOC

[Libreoffice-commits] core.git: external/mdds

2022-06-20 Thread Noel Grandin (via logerrit)
 external/mdds/UnpackedTarball_mdds.mk   |1 
 external/mdds/speedup-erase-begin.patch |  140 
 2 files changed, 141 insertions(+)

New commits:
commit 3be3fb9bafc4c2bf17ef3fe4eba0a059199abe24
Author: Noel Grandin 
AuthorDate: Mon Jun 20 12:28:36 2022 +0200
Commit: Noel Grandin 
CommitDate: Tue Jun 21 08:49:41 2022 +0200

tdf#126109 calc slow when replacing string to number

Normally, the answer to repeated erase(begin()) is to walk backwards
through the array.
However, sometimes (like here), doing so will mean that we end up
inserting at the front of a different array, which means we don't gain
anything.

So, store an extra field in the mdds block, which implements a kind
of very simple approximation of a circular array.

This gives me a 50% speedup for this bug.

This is the simplest possible thing that could work.
It could probably be made a lot more sophisticated in terms of not
wasting space.

Change-Id: I036349786896f28b617dfd0924f5743db6a57695
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135896
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/external/mdds/UnpackedTarball_mdds.mk 
b/external/mdds/UnpackedTarball_mdds.mk
index 271d20b0f4d1..b1eff049710b 100644
--- a/external/mdds/UnpackedTarball_mdds.mk
+++ b/external/mdds/UnpackedTarball_mdds.mk
@@ -15,6 +15,7 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,mdds,0))
 
 $(eval $(call gb_UnpackedTarball_add_patches,mdds,\
 external/mdds/use-after-free.patch \
+   external/mdds/speedup-erase-begin.patch \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/external/mdds/speedup-erase-begin.patch 
b/external/mdds/speedup-erase-begin.patch
new file mode 100644
index ..686d72f232c9
--- /dev/null
+++ b/external/mdds/speedup-erase-begin.patch
@@ -0,0 +1,140 @@
+diff -ur include/mdds/multi_type_vector/types.hpp 
include/mdds/multi_type_vector/types.hpp
+--- include/mdds/multi_type_vector/types.hpp   2022-06-20 12:13:12.199156464 
+0200
 include/mdds/multi_type_vector/types.hpp   2022-06-20 12:25:13.675660259 
+0200
+@@ -180,6 +180,127 @@
+ {}
+ };
+ 
++/**
++ * Vector that delays deleting from the front of the vector, which avoids 
O(n^2) memory move
++ * operations when code needs to deletes items from one mdds block and add to 
another mdds block.
++ */
++template
++class enhanced_vector
++{
++typedef std::vector store_type;
++mutable store_type m_vec;
++mutable size_t m_removedFront = 0; // number of elements removed from 
front of array
++public:
++typedef typename store_type::value_type value_type;
++typedef typename store_type::size_type size_type;
++typedef typename store_type::difference_type difference_type;
++typedef typename store_type::reference reference;
++typedef typename store_type::const_reference const_reference;
++typedef typename store_type::pointer pointer;
++typedef typename store_type::const_pointer const_pointer;
++typedef typename store_type::iterator iterator;
++typedef typename store_type::reverse_iterator reverse_iterator;
++typedef typename store_type::const_iterator const_iterator;
++typedef typename store_type::const_reverse_iterator 
const_reverse_iterator;
++
++enhanced_vector(size_t n, const T& val) : m_vec(n, val) {}
++enhanced_vector(size_t n) : m_vec(n) {}
++template< class InputIt >
++enhanced_vector( InputIt first, InputIt last ) : m_vec(first, last) {}
++
++iterator begin() noexcept { return m_vec.begin() + m_removedFront; }
++iterator end() noexcept { return m_vec.end(); }
++const_iterator begin() const noexcept { return m_vec.begin() + 
m_removedFront; }
++const_iterator end() const noexcept { return m_vec.end(); }
++
++reverse_iterator rbegin() { return m_vec.rbegin(); }
++const_reverse_iterator rbegin() const { return m_vec.rbegin(); }
++reverse_iterator rend() { return m_vec.rend() - m_removedFront; }
++const_reverse_iterator rend() const { return m_vec.rend() - 
m_removedFront; }
++
++reference operator[]( size_type pos ) { return m_vec[pos + 
m_removedFront]; }
++const_reference operator[]( size_type pos ) const { return m_vec[pos + 
m_removedFront]; }
++
++reference at( size_type pos ) { return m_vec.at(pos + m_removedFront); }
++const_reference at( size_type pos ) const { return m_vec.at(pos + 
m_removedFront); }
++
++void push_back( const T& value ) { m_vec.push_back(value); }
++
++iterator insert( iterator pos, const T& value ) { return 
m_vec.insert(pos, value); }
++iterator insert( const_iterator pos, T&& value ) { return 
m_vec.insert(pos, std::move(value)); }
++template< class InputIt >
++void insert( iterator pos, InputIt first, InputIt last )
++{
++m_vec.insert(pos, first, last);
++}
++
++void resize( size_type count )
++{
++clear_removed();

[Libreoffice-commits] core.git: external/mdds

2022-01-26 Thread Stephan Bergmann (via logerrit)
 external/mdds/UnpackedTarball_mdds.mk |1 +
 external/mdds/use-after-free.patch|   12 
 2 files changed, 13 insertions(+)

New commits:
commit a6f21bc32e746fd89ce963b1567ef78315612669
Author: Stephan Bergmann 
AuthorDate: Wed Jan 26 20:16:02 2022 +0100
Commit: Stephan Bergmann 
CommitDate: Thu Jan 27 08:00:48 2022 +0100

external/mdds: Avoid -Werror=use-after-free (GCC 12 trunk)

> In file included from 
workdir/UnpackedTarball/mdds/include/mdds/flat_segment_tree.hpp:37,
>  from sc/inc/columnspanset.hxx:16,
>  from sc/source/core/data/columnspanset.cxx:10:
> In function ‘void mdds::__st::intrusive_ptr_add_ref(node*) [with T = 
mdds::flat_segment_tree]’,
> inlined from ‘boost::intrusive_ptr::intrusive_ptr(const 
boost::intrusive_ptr&) [with T = 
mdds::__st::node >]’ at 
workdir/UnpackedTarball/boost/boost/smart_ptr/intrusive_ptr.hpp:93:44,
> inlined from ‘boost::intrusive_ptr& 
boost::intrusive_ptr::operator=(const boost::intrusive_ptr&) [with T = 
mdds::__st::node >]’ at 
workdir/UnpackedTarball/boost/boost/smart_ptr/intrusive_ptr.hpp:154:9,
> inlined from ‘mdds::flat_segment_tree<_Key, 
_Value>::flat_segment_tree(const mdds::flat_segment_tree<_Key, _Value>&) [with 
_Key = int; _Value = bool]’ at 
workdir/UnpackedTarball/mdds/include/mdds/flat_segment_tree_def.inl:88:25:
> workdir/UnpackedTarball/mdds/include/mdds/node.hpp:244:10: error: pointer 
used after ‘void operator delete(void*, std::size_t)’ [-Werror=use-after-free]
>   244 | ++p->refcount;
>   |   ~~~^~~~
> In function ‘void mdds::__st::intrusive_ptr_release(node*) [with T = 
mdds::flat_segment_tree]’,
> inlined from ‘void mdds::__st::intrusive_ptr_release(node*) [with 
T = mdds::flat_segment_tree]’ at 
workdir/UnpackedTarball/mdds/include/mdds/node.hpp:248:13,
> inlined from ‘boost::intrusive_ptr::~intrusive_ptr() [with T = 
mdds::__st::node >]’ at 
workdir/UnpackedTarball/boost/boost/smart_ptr/intrusive_ptr.hpp:98:44,
> inlined from ‘boost::intrusive_ptr& 
boost::intrusive_ptr::operator=(const boost::intrusive_ptr&) [with T = 
mdds::__st::node >]’ at 
workdir/UnpackedTarball/boost/boost/smart_ptr/intrusive_ptr.hpp:154:9,
> inlined from ‘mdds::flat_segment_tree<_Key, 
_Value>::flat_segment_tree(const mdds::flat_segment_tree<_Key, _Value>&) [with 
_Key = int; _Value = bool]’ at 
workdir/UnpackedTarball/mdds/include/mdds/flat_segment_tree_def.inl:87:19:
> workdir/UnpackedTarball/mdds/include/mdds/node.hpp:252:9: note: call to 
‘void operator delete(void*, std::size_t)’ here
>   252 | delete p;
>   | ^~~~

etc.  The warning is apparently new in GCC 12 trunk (see


"Add -Wuse-after-free [PR80532]"), and I'm not entirely sure whether this
is a true or false positive, but the fix looks somewhat plausible, and at 
least
also my (Clang) ASan+UBSan build does a successful `make check` with (and
without) this change.

Change-Id: I63fafceba8d1b4e0ddd7cf2e58403a3bc763e53c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129008
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/external/mdds/UnpackedTarball_mdds.mk 
b/external/mdds/UnpackedTarball_mdds.mk
index c015f4c13f5a..271d20b0f4d1 100644
--- a/external/mdds/UnpackedTarball_mdds.mk
+++ b/external/mdds/UnpackedTarball_mdds.mk
@@ -14,6 +14,7 @@ $(eval $(call 
gb_UnpackedTarball_set_tarball,mdds,$(MDDS_TARBALL)))
 $(eval $(call gb_UnpackedTarball_set_patchlevel,mdds,0))
 
 $(eval $(call gb_UnpackedTarball_add_patches,mdds,\
+external/mdds/use-after-free.patch \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/external/mdds/use-after-free.patch 
b/external/mdds/use-after-free.patch
new file mode 100644
index ..981c945821a7
--- /dev/null
+++ b/external/mdds/use-after-free.patch
@@ -0,0 +1,12 @@
+--- include/mdds/flat_segment_tree_def.inl
 include/mdds/flat_segment_tree_def.inl
+@@ -84,8 +84,8 @@
+ // Move on to the next destination node, and have the next node point
+ // back to the previous node.
+ node_ptr old_node = dest_node;
++dest_node->next->prev = old_node;
+ dest_node = dest_node->next;
+-dest_node->prev = old_node;
+ 
+ if (src_node == r.m_right_leaf.get())
+ {


[Libreoffice-commits] core.git: external/mdds

2021-06-10 Thread Stephan Bergmann (via logerrit)
 external/mdds/UnpackedTarball_mdds.mk |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 105ad5dc174d9e894b0c4f9e24d068090ca8c3aa
Author: Stephan Bergmann 
AuthorDate: Thu Jun 10 09:49:18 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Jun 10 10:29:25 2021 +0200

external/mdds: Mark patch as upstreamed

Change-Id: Id61fbaafb575a8c745e5b3cc5b2ff8ae4526d94c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116960
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/external/mdds/UnpackedTarball_mdds.mk 
b/external/mdds/UnpackedTarball_mdds.mk
index 225e5d8938d3..3c664336430b 100644
--- a/external/mdds/UnpackedTarball_mdds.mk
+++ b/external/mdds/UnpackedTarball_mdds.mk
@@ -13,6 +13,9 @@ $(eval $(call 
gb_UnpackedTarball_set_tarball,mdds,$(MDDS_TARBALL)))
 
 $(eval $(call gb_UnpackedTarball_set_patchlevel,mdds,0))
 
+# * external/mdds/Wunused-but-set-variable.patch upstream at
+#    
"-Werror,-Wunused-but-set-variable (Clang 13
+#   trunk)":
 $(eval $(call gb_UnpackedTarball_add_patches,mdds,\
 external/mdds/Wunused-but-set-variable.patch \
 ))
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: external/mdds

2021-06-08 Thread Stephan Bergmann (via logerrit)
 external/mdds/UnpackedTarball_mdds.mk|3 +
 external/mdds/Wunused-but-set-variable.patch |   46 +++
 2 files changed, 48 insertions(+), 1 deletion(-)

New commits:
commit 13666bb9e5d5a45210322c339efef776dbc59f3f
Author: Stephan Bergmann 
AuthorDate: Tue Jun 8 08:48:51 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Wed Jun 9 08:39:09 2021 +0200

external/mdds: -Werror,-Wunused-but-set-variable (Clang 13 trunk)

> In file included from svl/source/misc/gridprinter.cxx:16:
> In file included from 
workdir/UnpackedTarball/mdds/include/mdds/multi_type_matrix.hpp:37:
> In file included from 
workdir/UnpackedTarball/mdds/include/mdds/multi_type_vector.hpp:1358:
> 
workdir/UnpackedTarball/mdds/include/mdds/multi_type_vector_def.inl:851:15: 
error: variable 'start_pos' set but not used [-Werror,-Wunused-but-set-variable]
> size_type start_pos = m_cur_size;
>   ^
> 
workdir/UnpackedTarball/mdds/include/mdds/multi_type_vector_def.inl:3926:15: 
error: variable 'start_row_itr' set but not used 
[-Werror,-Wunused-but-set-variable]
> size_type start_row_itr = start_row_in_block1;
>   ^

Change-Id: I1f5e7e1f6a2b8457eb6d65dbd65336d3684c2b89
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116808
Tested-by: Jenkins
Reviewed-by: Kohei Yoshida 

diff --git a/external/mdds/UnpackedTarball_mdds.mk 
b/external/mdds/UnpackedTarball_mdds.mk
index 65dd0109e972..225e5d8938d3 100644
--- a/external/mdds/UnpackedTarball_mdds.mk
+++ b/external/mdds/UnpackedTarball_mdds.mk
@@ -11,9 +11,10 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,mdds))
 
 $(eval $(call gb_UnpackedTarball_set_tarball,mdds,$(MDDS_TARBALL)))
 
-$(eval $(call gb_UnpackedTarball_set_patchlevel,mdds,1))
+$(eval $(call gb_UnpackedTarball_set_patchlevel,mdds,0))
 
 $(eval $(call gb_UnpackedTarball_add_patches,mdds,\
+external/mdds/Wunused-but-set-variable.patch \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/external/mdds/Wunused-but-set-variable.patch 
b/external/mdds/Wunused-but-set-variable.patch
new file mode 100644
index ..ba28cb18eded
--- /dev/null
+++ b/external/mdds/Wunused-but-set-variable.patch
@@ -0,0 +1,46 @@
+--- include/mdds/multi_type_vector_def.inl
 include/mdds/multi_type_vector_def.inl
+@@ -843,18 +843,12 @@
+ typename multi_type_vector<_CellBlockFunc, _EventFunc>::iterator
+ multi_type_vector<_CellBlockFunc, _EventFunc>::push_back_empty()
+ {
+-size_type last_block_size = 0;
+-if (!m_blocks.empty())
+-last_block_size = m_blocks.back().m_size;
+-
+ size_type block_index = m_blocks.size();
+-size_type start_pos = m_cur_size;
+ 
+ if (!append_empty(1))
+ {
+ // Last empty block has been extended.
+ --block_index;
+-start_pos -= last_block_size;
+ }
+ 
+ // Get the iterator of the last block.
+@@ -3923,8 +3917,6 @@
+ size_type offset = start_row - start_row_in_block1;
+ size_type end_row_in_block2 = start_row_in_block2 + blk2->m_size - 1;
+ 
+-size_type start_row_itr = start_row_in_block1;
+-
+ // Initially set to erase blocks between block 1 and block 2 
non-inclusive at either end.
+ typename blocks_type::iterator it_erase_begin = m_blocks.begin() + 
block_index1 + 1;
+ typename blocks_type::iterator it_erase_end = m_blocks.begin() + 
block_index2;
+@@ -3948,7 +3940,6 @@
+ data_blk.mp_data = blk0->mp_data;
+ blk0->mp_data = nullptr;
+ 
+-start_row_itr -= blk0->m_size;
+ data_blk.m_size += blk0->m_size;
+ data_blk.m_position = blk0->m_position;
+ 
+@@ -3967,7 +3958,6 @@
+ element_block_func::resize_block(*blk1->mp_data, offset);
+ }
+ blk1->m_size = offset;
+-start_row_itr += offset;
+ }
+ 
+ if (blk0_copied)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: external/mdds

2019-11-26 Thread Stephan Bergmann (via logerrit)
 external/mdds/UnpackedTarball_mdds.mk |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit fc2d2e0d83620cb2779d22694ab45189acf7afd8
Author: Stephan Bergmann 
AuthorDate: Tue Nov 26 14:01:35 2019 +0100
Commit: Stephan Bergmann 
CommitDate: Tue Nov 26 16:45:47 2019 +0100

Mark external/mdds/Wdeprecated-copy.patch as upstreamed

Change-Id: Idfcf192dd93df3809b5da195356747a7d3ae3d3d
Reviewed-on: https://gerrit.libreoffice.org/83761
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/external/mdds/UnpackedTarball_mdds.mk 
b/external/mdds/UnpackedTarball_mdds.mk
index c5ca78bd368c..2e456712704a 100644
--- a/external/mdds/UnpackedTarball_mdds.mk
+++ b/external/mdds/UnpackedTarball_mdds.mk
@@ -13,6 +13,8 @@ $(eval $(call 
gb_UnpackedTarball_set_tarball,mdds,$(MDDS_TARBALL)))
 
 $(eval $(call gb_UnpackedTarball_set_patchlevel,mdds,0))
 
+# external/mdds/Wdeprecated-copy.patch upstream at 

+# "Remove redundantly user-declared private_data copy constructor":
 $(eval $(call gb_UnpackedTarball_add_patches,mdds,\
 external/mdds/Wdeprecated-copy.patch \
 ))
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: external/mdds sc/inc sc/source

2019-05-20 Thread Luboš Luňák (via logerrit)
 external/mdds/UnpackedTarball_mdds.mk   |1 
 external/mdds/use-position-hint-also-back.patch |   50 
 sc/inc/clipcontext.hxx  |1 
 sc/inc/column.hxx   |2 
 sc/inc/refupdatecontext.hxx |8 +++
 sc/source/core/data/column.cxx  |8 ++-
 sc/source/core/data/document.cxx|1 
 sc/source/core/data/refupdatecontext.cxx|   13 +-
 8 files changed, 80 insertions(+), 4 deletions(-)

New commits:
commit b81004e95638da19cbcaa7a61f9edd094a9eac31
Author: Luboš Luňák 
AuthorDate: Thu May 16 17:50:09 2019 +0200
Commit: Luboš Luňák 
CommitDate: Mon May 20 10:04:13 2019 +0200

cache mdds positions during ScDocument::CopyBlockFromClip() (tdf#112000)

Make RefUpdateContext and ScColumn::UpdateReferenceOnCopy() use the same
sc::ColumnBlockPositionSet that CopyFromClipContext uses. Without it
pathological cases like in tdf#112000 trigger quadratic cost because
of repeated mdds searches from the start.
Includes also an mdds patch that allows it to search backwards
from a position hint. Without it, this would be very difficult to fix
otherwise, as CopyFromClip() in ScDocument::CopyBlockFromClip()
moves the position hint past the area that UpdateReferenceOnCopy()
would use. It also just plain makes sense to try to go backwards
in an std::vector.

Change-Id: I985e3a40e4abf1a824e55c76d82579882fa75cc2
Reviewed-on: https://gerrit.libreoffice.org/72424
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/external/mdds/UnpackedTarball_mdds.mk 
b/external/mdds/UnpackedTarball_mdds.mk
index c015f4c13f5a..625204d29619 100644
--- a/external/mdds/UnpackedTarball_mdds.mk
+++ b/external/mdds/UnpackedTarball_mdds.mk
@@ -14,6 +14,7 @@ $(eval $(call 
gb_UnpackedTarball_set_tarball,mdds,$(MDDS_TARBALL)))
 $(eval $(call gb_UnpackedTarball_set_patchlevel,mdds,0))
 
 $(eval $(call gb_UnpackedTarball_add_patches,mdds,\
+   external/mdds/use-position-hint-also-back.patch \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/external/mdds/use-position-hint-also-back.patch 
b/external/mdds/use-position-hint-also-back.patch
new file mode 100644
index ..0b38c38d5536
--- /dev/null
+++ b/external/mdds/use-position-hint-also-back.patch
@@ -0,0 +1,50 @@
+From 726e2f02d14833bde2f7eef9677f5564c485a992 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= 
+Date: Fri, 17 May 2019 13:55:20 +0200
+Subject: [PATCH] use position hint also when it is past the actual position
+
+The m_blocks data structure is a vector. It means that it can be
+also walked back, instead of resetting and starting from the very
+start.
+
+Allows a noticeable performance improvement in
+https://gerrit.libreoffice.org/#/c/72424/ .
+---
+ include/mdds/multi_type_vector_def.inl | 21 -
+ 1 file changed, 20 insertions(+), 1 deletion(-)
+
+diff --git a/include/mdds/multi_type_vector_def.inl 
b/include/mdds/multi_type_vector_def.inl
+index 22a0ee2..09894e6 100644
+--- include/mdds/multi_type_vector_def.inl
 include/mdds/multi_type_vector_def.inl
+@@ -861,7 +861,26 @@ void multi_type_vector<_CellBlockFunc, 
_EventFunc>::get_block_position(
+ 
+ if (pos < start_row)
+ {
+-// Position hint is past the insertion position. Reset.
++// Position hint is past the insertion position.
++// Walk back if that seems efficient.
++if (pos > start_row / 2)
++{
++for (size_type i = block_index; i > 0;)
++{
++--i;
++const block& blk = m_blocks[i];
++start_row -= blk.m_size;
++if (pos >= start_row)
++{
++// Row is in this block.
++block_index = i;
++return;
++}
++// Specified row is not in this block.
++}
++assert(start_row == 0);
++}
++// Otherwise reset.
+ start_row = 0;
+ block_index = 0;
+ }
+-- 
+2.16.4
+
diff --git a/sc/inc/clipcontext.hxx b/sc/inc/clipcontext.hxx
index f2a7af56818b..6752104fb34c 100644
--- a/sc/inc/clipcontext.hxx
+++ b/sc/inc/clipcontext.hxx
@@ -40,6 +40,7 @@ public:
 virtual ~ClipContextBase();
 
 ColumnBlockPosition* getBlockPosition(SCTAB nTab, SCCOL nCol);
+ColumnBlockPositionSet* getBlockPositionSet() { return mpSet.get(); }
 };
 
 class CopyFromClipContext : public ClipContextBase
diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx
index 340b5628faf6..e7e40fd528bf 100644
--- a/sc/inc/column.hxx
+++ b/sc/inc/column.hxx
@@ -417,7 +417,7 @@ public:
 
 voidResetChanged( SCROW nStartRow, SCROW nEndRow );
 
-bool UpdateReferenceOnCopy( const sc::RefUpdateContext& rCxt, ScDocument* 
pUndoDoc = nullptr );
+bool UpdateReferenceOnCopy( sc::RefUpdateContext& rCxt, ScDo

[Libreoffice-commits] core.git: external/mdds

2018-08-07 Thread Libreoffice Gerrit user
 external/mdds/UnpackedTarball_mdds.mk |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit d0425778eef7ea20ccc19834c07d0b265f58baf0
Author: Stephan Bergmann 
AuthorDate: Tue Aug 7 15:49:46 2018 +0200
Commit: Stephan Bergmann 
CommitDate: Tue Aug 7 22:50:15 2018 +0200

Mark external/mdds/gcc9.patch as upstreamed

Change-Id: I146dd8926e5e93a57162558286168e963f402f59
Reviewed-on: https://gerrit.libreoffice.org/58689
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/external/mdds/UnpackedTarball_mdds.mk 
b/external/mdds/UnpackedTarball_mdds.mk
index 9480bb8273af..69285d758c7c 100644
--- a/external/mdds/UnpackedTarball_mdds.mk
+++ b/external/mdds/UnpackedTarball_mdds.mk
@@ -14,7 +14,9 @@ $(eval $(call 
gb_UnpackedTarball_set_tarball,mdds,$(MDDS_TARBALL)))
 $(eval $(call gb_UnpackedTarball_set_patchlevel,mdds,0))
 
 # c++17.patch upstreamed as  
"Remove some
-# unnecessary uses of obsolete std::unary_function":
+#  unnecessary uses of obsolete std::unary_function";
+# gcc9.patch upstreamed at  
"Remove unnecessary
+#  user-provided special members that cause -Wdeprecated-copy":
 $(eval $(call gb_UnpackedTarball_add_patches,mdds,\
 external/mdds/c++17.patch \
 external/mdds/gcc9.patch \
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: external/mdds

2018-07-26 Thread Libreoffice Gerrit user
 external/mdds/UnpackedTarball_mdds.mk |1 
 external/mdds/gcc9.patch  |   42 ++
 2 files changed, 43 insertions(+)

New commits:
commit daa2fd4a81efaea35f18b53b65407464ba57eeaa
Author: Stephan Bergmann 
AuthorDate: Thu Jul 26 10:39:30 2018 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Jul 26 13:34:20 2018 +0200

external/mdds: avoid -Werror=deprecated-copy (GCC trunk towards GCC 9)

...by removing explicitly user-provided functions that do the same as their
implicitly-defined counterparts, but whose presence may prevent implicitly
declared copy functions from being defined as non-deleted in the future

Change-Id: Ie9b943af57bd8081c06a531fb3c634e52f0a99b6
Reviewed-on: https://gerrit.libreoffice.org/58048
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/external/mdds/UnpackedTarball_mdds.mk 
b/external/mdds/UnpackedTarball_mdds.mk
index 4f6db6b24e7b..9480bb8273af 100644
--- a/external/mdds/UnpackedTarball_mdds.mk
+++ b/external/mdds/UnpackedTarball_mdds.mk
@@ -17,6 +17,7 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,mdds,0))
 # unnecessary uses of obsolete std::unary_function":
 $(eval $(call gb_UnpackedTarball_add_patches,mdds,\
 external/mdds/c++17.patch \
+external/mdds/gcc9.patch \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/external/mdds/gcc9.patch b/external/mdds/gcc9.patch
new file mode 100644
index ..c7d19e99437d
--- /dev/null
+++ b/external/mdds/gcc9.patch
@@ -0,0 +1,42 @@
+--- include/mdds/multi_type_vector_itr.hpp
 include/mdds/multi_type_vector_itr.hpp
+@@ -54,9 +54,6 @@
+ iterator_value_node(size_type start_pos, size_type block_index) :
+ type(mdds::mtv::element_type_empty), position(start_pos), size(0), 
data(nullptr), __private_data(block_index) {}
+ 
+-iterator_value_node(const iterator_value_node& other) :
+-type(other.type), position(other.position), size(other.size), 
data(other.data), __private_data(other.__private_data) {}
+-
+ void swap(iterator_value_node& other)
+ {
+ std::swap(type, other.type);
+@@ -272,9 +269,6 @@
+ size_type start_pos, size_type block_index) :
+ common_base(pos, end, start_pos, block_index) {}
+ 
+-iterator_base(const iterator_base& other) :
+-common_base(other) {}
+-
+ value_type& operator*()
+ {
+ return m_cur_node;
+@@ -345,9 +339,6 @@
+ size_type start_pos, size_type block_index) :
+ common_base(pos, end, start_pos, block_index) {}
+ 
+-const_iterator_base(const const_iterator_base& other) :
+-common_base(other) {}
+-
+ /**
+  * Take the non-const iterator counterpart to create a const iterator.
+  */
+--- include/mdds/multi_type_vector_types.hpp
 include/mdds/multi_type_vector_types.hpp
+@@ -90,7 +90,6 @@
+ protected:
+ element_t type;
+ base_element_block(element_t _t) : type(_t) {}
+-~base_element_block() {}
+ };
+ 
+ template
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: external/mdds

2017-12-18 Thread Stephan Bergmann
 external/mdds/UnpackedTarball_mdds.mk |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit b8de27a2a92cf8a3d125720d2f22645c3ae2d1d9
Author: Stephan Bergmann 
Date:   Mon Dec 18 15:47:28 2017 +0100

Mark external/mdds/c++17.patch upstreamed

Change-Id: I5cce6fd2438323149c723408f0f599ca7c688eab

diff --git a/external/mdds/UnpackedTarball_mdds.mk 
b/external/mdds/UnpackedTarball_mdds.mk
index 93eb3e6214fd..4f6db6b24e7b 100644
--- a/external/mdds/UnpackedTarball_mdds.mk
+++ b/external/mdds/UnpackedTarball_mdds.mk
@@ -13,6 +13,8 @@ $(eval $(call 
gb_UnpackedTarball_set_tarball,mdds,$(MDDS_TARBALL)))
 
 $(eval $(call gb_UnpackedTarball_set_patchlevel,mdds,0))
 
+# c++17.patch upstreamed as  
"Remove some
+# unnecessary uses of obsolete std::unary_function":
 $(eval $(call gb_UnpackedTarball_add_patches,mdds,\
 external/mdds/c++17.patch \
 ))
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: external/mdds

2017-11-04 Thread Caolán McNamara
 external/mdds/UnpackedTarball_mdds.mk |1 
 external/mdds/ofz-4048.patch.1|   48 ++
 2 files changed, 49 insertions(+)

New commits:
commit c637e34da807b82aebca82f7c82eb01e2ddb0f02
Author: Caolán McNamara 
Date:   Sat Nov 4 10:14:33 2017 +

ofz#4048 Null-dereference

Change-Id: I52db987ac3f11e318e2adf1ee797054f49c31f98
Reviewed-on: https://gerrit.libreoffice.org/44293
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/external/mdds/UnpackedTarball_mdds.mk 
b/external/mdds/UnpackedTarball_mdds.mk
index c015f4c13f5a..1958b32c2cb4 100644
--- a/external/mdds/UnpackedTarball_mdds.mk
+++ b/external/mdds/UnpackedTarball_mdds.mk
@@ -14,6 +14,7 @@ $(eval $(call 
gb_UnpackedTarball_set_tarball,mdds,$(MDDS_TARBALL)))
 $(eval $(call gb_UnpackedTarball_set_patchlevel,mdds,0))
 
 $(eval $(call gb_UnpackedTarball_add_patches,mdds,\
+   external/mdds/ofz-4048.patch.1 \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/external/mdds/ofz-4048.patch.1 b/external/mdds/ofz-4048.patch.1
new file mode 100644
index ..887a53ef9e28
--- /dev/null
+++ b/external/mdds/ofz-4048.patch.1
@@ -0,0 +1,48 @@
+diff --git a/include/mdds/flat_segment_tree_def.inl 
b/include/mdds/flat_segment_tree_def.inl
+index 58de366..00cc1c6 100644
+--- a/include/mdds/flat_segment_tree_def.inl
 b/include/mdds/flat_segment_tree_def.inl
+@@ -778,7 +778,7 @@ bool flat_segment_tree<_Key, 
_Value>::adjust_segment_range(key_type& start_key, 
+ // Invalid order of segment range.
+ return false;
+ 
+-if (end_key < m_left_leaf->value_leaf.key || start_key > 
m_right_leaf->value_leaf.key)
++if (end_key < m_left_leaf->value_leaf.key || start_key >= 
m_right_leaf->value_leaf.key)
+ // The new segment does not overlap the current interval.
+ return false;
+ 
+diff --git a/src/flat_segment_tree_test.cpp b/src/flat_segment_tree_test.cpp
+index bb29918..b94f0fd 100644
+--- a/src/flat_segment_tree_test.cpp
 b/src/flat_segment_tree_test.cpp
+@@ -1986,6 +1986,22 @@ void fst_test_insert_out_of_bound()
+ pos = ret.first;
+ }
+ 
++void fst_test_insert_out_of_bound_2()
++{
++stack_printer __stack_printer__("::fst_test_insert_out_of_bound_2");
++
++typedef flat_segment_tree db_type;
++db_type db(0, 256, false);
++
++// The range is entirely out-of-bound, but the start range equals the
++// upper bound of the valid range.
++auto ret = db.insert_back(256, 1024, true);
++
++// Insertion never took place.
++assert(ret.first == db.end());
++assert(!ret.second);
++}
++
+ void fst_test_segment_iterator()
+ {
+ stack_printer __stack_printer__("::fst_test_segment_iterator");
+@@ -2115,6 +2131,7 @@ int main (int argc, char **argv)
+ fst_test_assignment();
+ fst_test_non_numeric_value();
+ fst_test_insert_out_of_bound();
++fst_test_insert_out_of_bound_2();
+ fst_test_segment_iterator();
+ }
+ 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: external/mdds

2016-06-17 Thread Caolán McNamara
 external/mdds/UnpackedTarball_mdds.mk |1 +
 external/mdds/tdf90579.patch.0|   23 +++
 2 files changed, 24 insertions(+)

New commits:
commit 9ec54e92407cd632c4e38317f914edd557835a86
Author: Caolán McNamara 
Date:   Fri Jun 17 14:37:17 2016 +0100

Resolves: tdf#90579 swap_single_to_multi_blocks seems broken

when there is associated data in the src. Its copies those pointers
into the block that will appear in the destination. Then can destroy
the source block, which deletes the contents of those pointers, and
then inserts the new block which has dangling pointers to the deleted
data.

https://gitlab.com/mdds/mdds/merge_requests/2

Change-Id: Id9614d95652c8032b03cb5748a284917043d8d21

diff --git a/external/mdds/UnpackedTarball_mdds.mk 
b/external/mdds/UnpackedTarball_mdds.mk
index c015f4c..bd57593 100644
--- a/external/mdds/UnpackedTarball_mdds.mk
+++ b/external/mdds/UnpackedTarball_mdds.mk
@@ -14,6 +14,7 @@ $(eval $(call 
gb_UnpackedTarball_set_tarball,mdds,$(MDDS_TARBALL)))
 $(eval $(call gb_UnpackedTarball_set_patchlevel,mdds,0))
 
 $(eval $(call gb_UnpackedTarball_add_patches,mdds,\
+external/mdds/tdf90579.patch.0 \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/external/mdds/tdf90579.patch.0 b/external/mdds/tdf90579.patch.0
new file mode 100644
index 000..5ef1bc7
--- /dev/null
+++ b/external/mdds/tdf90579.patch.0
@@ -0,0 +1,23 @@
+diff --git a/include/mdds/multi_type_vector_def.inl 
b/include/mdds/multi_type_vector_def.inl
+index 0e2a15a..fe9c767 100644
+--- include/mdds/multi_type_vector_def.inl
 include/mdds/multi_type_vector_def.inl
+@@ -2306,6 +2306,9 @@ void multi_type_vector<_CellBlockFunc, 
_EventFunc>::swap_single_to_multi_blocks(
+ {
+ // Source range is at the top of a block.
+ 
++// Shrink the current block by erasing the top part.
++element_block_func::erase(*blk_src->mp_data, 0, len);
++
+ if (src_tail_len == 0)
+ {
+ // the whole block needs to be replaced.
+@@ -2314,8 +2317,6 @@ void multi_type_vector<_CellBlockFunc, 
_EventFunc>::swap_single_to_multi_blocks(
+ }
+ else
+ {
+-// Shrink the current block by erasing the top part.
+-element_block_func::erase(*blk_src->mp_data, 0, len);
+ blk_src->m_size -= len;
+ }
+ 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: external/mdds

2016-06-17 Thread Caolán McNamara
 external/mdds/README |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit a72b705ec232d2d3abd4c4dcff994751591e1135
Author: Caolán McNamara 
Date:   Fri Jun 17 15:09:24 2016 +0100

update mdds README for new home

Change-Id: I2641abe8e049361d5eb92e19b9ed57b8e7209386

diff --git a/external/mdds/README b/external/mdds/README
index bd635ee..140f07b 100644
--- a/external/mdds/README
+++ b/external/mdds/README
@@ -1,4 +1,4 @@
-Multi-dimensional data structure (mdds) library, available from 
[http://code.google.com/p/multidimalgorithm/].
+Multi-dimensional data structure (mdds) library, available from 
[https://gitlab.com/mdds/mdds].
 
 mdds primarily provides data structures that are used by the calc
-core.
\ No newline at end of file
+core.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: external/mdds

2016-02-12 Thread David Tardon
 external/mdds/mdds-c++98.patch.0 |   84 ---
 1 file changed, 84 deletions(-)

New commits:
commit f1bb29ff34ef7a8adf3d4cdfba1108db6df87da2
Author: David Tardon 
Date:   Fri Feb 12 14:04:52 2016 +0100

drop unused patch

Change-Id: Id81a7c5ace2a5ae0edfb61a1ebc82b84f1cbc527

diff --git a/external/mdds/mdds-c++98.patch.0 b/external/mdds/mdds-c++98.patch.0
deleted file mode 100644
index eaf1d60..000
--- a/external/mdds/mdds-c++98.patch.0
+++ /dev/null
@@ -1,84 +0,0 @@
 include/mdds/multi_type_vector_itr.hpp
-+++ include/mdds/multi_type_vector_itr.hpp
-@@ -139,14 +139,15 @@
- typedef typename parent_type::size_type size_type;
- typedef iterator_value_node node;
- 
--iterator_common_base() : m_cur_node(0, 0) {}
-+iterator_common_base() : m_cur_node(0, 0), m_singular(true) {}
- 
- iterator_common_base(
- const base_iterator_type& pos, const base_iterator_type& end,
- size_type start_pos, size_type block_index) :
- m_cur_node(start_pos, block_index),
- m_pos(pos),
--m_end(end)
-+m_end(end),
-+m_singular(false)
- {
- if (m_pos != m_end)
- update_node();
-@@ -154,9 +155,13 @@
- 
- iterator_common_base(const iterator_common_base& other) :
- m_cur_node(other.m_cur_node),
--m_pos(other.m_pos),
--m_end(other.m_end)
-+m_singular(other.m_singular)
- {
-+if (!m_singular)
-+{
-+m_pos = other.m_pos;
-+m_end = other.m_end;
-+}
- }
- 
- void update_node()
-@@ -196,6 +201,7 @@
- node m_cur_node;
- base_iterator_type m_pos;
- base_iterator_type m_end;
-+bool m_singular;
- 
- public:
- bool operator== (const iterator_common_base& other) const
-@@ -218,8 +224,12 @@
- iterator_common_base& operator= (const iterator_common_base& other)
- {
- m_cur_node = other.m_cur_node;
--m_pos = other.m_pos;
--m_end = other.m_end;
-+m_singular = other.m_singular;
-+if (!m_singular)
-+{
-+m_pos = other.m_pos;
-+m_end = other.m_end;
-+}
- return *this;
- }
- 
-@@ -226,8 +236,22 @@
- void swap(iterator_common_base& other)
- {
- m_cur_node.swap(other.m_cur_node);
--std::swap(m_pos, other.m_pos);
--std::swap(m_end, other.m_end);
-+std::swap(m_singular, other.m_singular);
-+if (!(m_singular || other.m_singular))
-+{
-+std::swap(m_pos, other.m_pos);
-+std::swap(m_end, other.m_end);
-+}
-+else if (!m_singular)
-+{
-+m_pos = other.m_pos;
-+m_end = other.m_end;
-+}
-+else if (!other.m_singular)
-+{
-+other.m_pos = m_pos;
-+other.m_end = m_end;
-+}
- }
- 
- const node& get_node() const { return m_cur_node; }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: external/mdds

2015-06-29 Thread Tor Lillqvist
 external/mdds/0001-another-step-to-allow-fst-to-use-any-value-type.patch.1 |   
 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit e05fbf07bb8dd0094b9e7f20cebfb88678f1e676
Author: Tor Lillqvist 
Date:   Mon Jun 29 16:20:22 2015 +0300

Make the patch actually apply

Change-Id: I23537399cbf325a7049f67654439714c3dc1421e

diff --git 
a/external/mdds/0001-another-step-to-allow-fst-to-use-any-value-type.patch.1 
b/external/mdds/0001-another-step-to-allow-fst-to-use-any-value-type.patch.1
index 0c5b928..bed9c9c 100644
--- a/external/mdds/0001-another-step-to-allow-fst-to-use-any-value-type.patch.1
+++ b/external/mdds/0001-another-step-to-allow-fst-to-use-any-value-type.patch.1
@@ -49,7 +49,7 @@ index 81858f5..f7aead7 100644
 +assert(db == db2);
  }
  
- int main (int argc, char **argv)
+ void fst_test_non_numeric_key()
 -- 
 2.4.2
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: external/mdds

2015-06-29 Thread David Tardon
 external/mdds/0001-another-step-to-allow-fst-to-use-any-value-type.patch.1 |   
55 ++
 external/mdds/UnpackedTarball_mdds.mk  |   
 1 
 2 files changed, 56 insertions(+)

New commits:
commit bead58cb4042ac42dee890e2f21ab7ea81136e54
Author: David Tardon 
Date:   Mon Jun 29 14:31:57 2015 +0200

fix build of libetonyek with older versions of gcc

Change-Id: I19586eaae36fac7fa750614e6e31eff1a1e8440c

diff --git 
a/external/mdds/0001-another-step-to-allow-fst-to-use-any-value-type.patch.1 
b/external/mdds/0001-another-step-to-allow-fst-to-use-any-value-type.patch.1
new file mode 100644
index 000..0c5b928
--- /dev/null
+++ b/external/mdds/0001-another-step-to-allow-fst-to-use-any-value-type.patch.1
@@ -0,0 +1,55 @@
+From 5fc9214fb94595e1a2c0b9e0285037f5a2fa59bf Mon Sep 17 00:00:00 2001
+From: David Tardon 
+Date: Mon, 29 Jun 2015 14:28:42 +0200
+Subject: [PATCH] another step to allow fst to use any value type
+
+For some reason this is not a problem on modern compilers...
+---
+ include/mdds/flat_segment_tree.hpp | 1 -
+ include/mdds/flat_segment_tree_def.inl | 2 +-
+ src/flat_segment_tree_test.cpp | 4 
+ 3 files changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/include/mdds/flat_segment_tree.hpp 
b/include/mdds/flat_segment_tree.hpp
+index b656bc3..02cf87e 100644
+--- a/include/mdds/flat_segment_tree.hpp
 b/include/mdds/flat_segment_tree.hpp
+@@ -32,7 +32,6 @@
+ #include 
+ #include 
+ #include 
+-#include 
+ 
+ #include "mdds/node.hpp"
+ #include "mdds/flat_segment_tree_itr.hpp"
+diff --git a/include/mdds/flat_segment_tree_def.inl 
b/include/mdds/flat_segment_tree_def.inl
+index ebfee99..5fef1c3 100644
+--- a/include/mdds/flat_segment_tree_def.inl
 b/include/mdds/flat_segment_tree_def.inl
+@@ -46,7 +46,7 @@ flat_segment_tree<_Key, _Value>::flat_segment_tree(key_type 
min_val, key_type ma
+ // We don't ever use the value of the right leaf node, but we need the
+ // value to be always the same, to make it easier to check for
+ // equality.
+-m_right_leaf->value_leaf.value = ::std::numeric_limits::max();
++m_right_leaf->value_leaf.value = init_val;
+ }
+ 
+ template
+diff --git a/src/flat_segment_tree_test.cpp b/src/flat_segment_tree_test.cpp
+index 81858f5..f7aead7 100644
+--- a/src/flat_segment_tree_test.cpp
 b/src/flat_segment_tree_test.cpp
+@@ -1943,6 +1943,10 @@ void fst_test_non_numeric_value()
+ db.search(1, result);
+ 
+ assert(result == "hello world");
++
++db_type db2(db);
++
++assert(db == db2);
+ }
+ 
+ int main (int argc, char **argv)
+-- 
+2.4.2
+
diff --git a/external/mdds/UnpackedTarball_mdds.mk 
b/external/mdds/UnpackedTarball_mdds.mk
index 974a8e1..504406b 100644
--- a/external/mdds/UnpackedTarball_mdds.mk
+++ b/external/mdds/UnpackedTarball_mdds.mk
@@ -16,6 +16,7 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,mdds,3))
 $(eval $(call gb_UnpackedTarball_add_patches,mdds,\
external/mdds/mdds_0.6.0.patch \
external/mdds/mdds-c++98.patch.0 \
+   
external/mdds/0001-another-step-to-allow-fst-to-use-any-value-type.patch.1 \
 ))
 
 # 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: external/mdds

2014-01-07 Thread Kohei Yoshida
 external/mdds/0001-Add-a-method-to-set-empty-to-a-span-of-elements.patch |   
54 ++
 external/mdds/UnpackedTarball_mdds.mk|
1 
 2 files changed, 55 insertions(+)

New commits:
commit 47a7565315dcfc4271c2b2c205225d914a1a5094
Author: Kohei Yoshida 
Date:   Tue Jan 7 15:47:43 2014 -0500

Patch mdds to make available a method to empty multiple elements in one 
call.

This is for multi_type_matrix.

Change-Id: I7b1fcf6b16b5addbb76078506536542cddede25f

diff --git 
a/external/mdds/0001-Add-a-method-to-set-empty-to-a-span-of-elements.patch 
b/external/mdds/0001-Add-a-method-to-set-empty-to-a-span-of-elements.patch
new file mode 100644
index 000..c905cea
--- /dev/null
+++ b/external/mdds/0001-Add-a-method-to-set-empty-to-a-span-of-elements.patch
@@ -0,0 +1,54 @@
+From d0a006ad2fcabd1e785787b9a5c84b32edbab780 Mon Sep 17 00:00:00 2001
+From: Kohei Yoshida 
+Date: Tue, 7 Jan 2014 15:43:36 -0500
+Subject: [PATCH] Add a method to set empty to a span of elements.
+
+---
+ include/mdds/multi_type_matrix.hpp |  9 +
+ include/mdds/multi_type_matrix_def.inl | 10 ++
+ 2 files changed, 19 insertions(+)
+
+diff --git a/include/mdds/multi_type_matrix.hpp 
b/include/mdds/multi_type_matrix.hpp
+index a30393f..0574466 100644
+--- a/include/mdds/multi_type_matrix.hpp
 b/c/d/include/mdds/multi_type_matrix.hpp
+@@ -377,6 +377,15 @@ public:
+ void set_empty(size_type row, size_type col);
+ 
+ /**
++ * Set specified range of elements empty.
++ *
++ * @param row row position of the first element.
++ * @param col column position of the first element.
++ * @param length length of the range to set empty.
++ */
++void set_empty(size_type row, size_type col, size_type length);
++
++/**
+  * Set element referenced by the position object empty.
+  *
+  * @param pos position object that references element.
+diff --git a/include/mdds/multi_type_matrix_def.inl 
b/include/mdds/multi_type_matrix_def.inl
+index 21fe866..36f5448 100644
+--- a/include/mdds/multi_type_matrix_def.inl
 b/c/d/include/mdds/multi_type_matrix_def.inl
+@@ -240,6 +240,16 @@ void multi_type_matrix<_String>::set_empty(size_type row, 
size_type col)
+ }
+ 
+ template
++void multi_type_matrix<_String>::set_empty(size_type row, size_type col, 
size_type length)
++{
++if (length == 0)
++throw general_error("multi_type_matrix::set_empty: length of zero is 
not permitted.");
++
++size_type pos1 = get_pos(row, col);
++m_store.set_empty(pos1, pos1+length-1);
++}
++
++template
+ typename multi_type_matrix<_String>::position_type
+ multi_type_matrix<_String>::set_empty(const position_type& pos)
+ {
+-- 
+1.8.1.4
+
diff --git a/external/mdds/UnpackedTarball_mdds.mk 
b/external/mdds/UnpackedTarball_mdds.mk
index 1ccfc2a..6e9185b 100644
--- a/external/mdds/UnpackedTarball_mdds.mk
+++ b/external/mdds/UnpackedTarball_mdds.mk
@@ -16,6 +16,7 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,mdds,3))
 $(eval $(call gb_UnpackedTarball_add_patches,mdds,\
external/mdds/mdds_0.6.0.patch \
external/mdds/0001-Workaround-for-an-old-gcc-bug.patch \
+   
external/mdds/0001-Add-a-method-to-set-empty-to-a-span-of-elements.patch \
 ))
 
 # 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: external/mdds external/Module_external.mk mdds/0001-Workaround-for-an-old-gcc-bug.patch mdds/Makefile mdds/mdds_0.6.0.patch mdds/Module_mdds.mk mdds/README mdds/Unpacke

2013-10-19 Thread Khaled Hosny
 RepositoryModule_host.mk   |1 
 external/Module_external.mk|1 
 external/mdds/0001-Workaround-for-an-old-gcc-bug.patch |   27 
 external/mdds/Makefile |7 ++
 external/mdds/Module_mdds.mk   |   16 +
 external/mdds/README   |4 +
 external/mdds/UnpackedTarball_mdds.mk  |   21 ++
 external/mdds/mdds_0.6.0.patch |   54 +
 mdds/0001-Workaround-for-an-old-gcc-bug.patch  |   27 
 mdds/Makefile  |7 --
 mdds/Module_mdds.mk|   20 --
 mdds/README|4 -
 mdds/UnpackedTarball_mdds.mk   |   21 --
 mdds/mdds_0.6.0.patch  |   54 -
 14 files changed, 130 insertions(+), 134 deletions(-)

New commits:
commit 97d1923b6ccdef86f3d794b12e625ef0a7d88095
Author: Khaled Hosny 
Date:   Fri Oct 18 22:47:47 2013 +0200

fdo#70393: move mdds to a subdir of external

Change-Id: Idfb327f7217e459ab0328f8692e1f73aef248d32
Reviewed-on: https://gerrit.libreoffice.org/6343
Reviewed-by: David Tardon 
Tested-by: David Tardon 

diff --git a/RepositoryModule_host.mk b/RepositoryModule_host.mk
index 99b24e1..5c33730 100644
--- a/RepositoryModule_host.mk
+++ b/RepositoryModule_host.mk
@@ -76,7 +76,6 @@ $(eval $(call gb_Module_add_moduledirs,libreoffice,\
linguistic \
lotuswordpro \
$(call gb_Helper_optional,DESKTOP,l10ntools) \
-   $(call gb_Helper_optional,MDDS,mdds) \
$(call gb_Helper_optional,MORE_FONTS,more_fonts) \
$(call gb_Helper_optional,MOZ,moz) \
$(call gb_Helper_optional,MARIADBC,mysqlc) \
diff --git a/external/Module_external.mk b/external/Module_external.mk
index 988d477..f4abc76 100644
--- a/external/Module_external.mk
+++ b/external/Module_external.mk
@@ -50,6 +50,7 @@ $(eval $(call gb_Module_add_moduledirs,external,\
$(call gb_Helper_optional,LIBXSLT,libxslt) \
$(call gb_Helper_optional,LPSOLVE,lpsolve) \
$(call gb_Helper_optional,MARIADB,libmariadb) \
+   $(call gb_Helper_optional,MDDS,mdds) \
$(call gb_Helper_optional,MSPUB,libmspub) \
$(call gb_Helper_optional,MWAW,libmwaw) \
$(call gb_Helper_optional,MYSQLCPPCONN,mysqlcppconn) \
diff --git a/mdds/0001-Workaround-for-an-old-gcc-bug.patch 
b/external/mdds/0001-Workaround-for-an-old-gcc-bug.patch
similarity index 100%
rename from mdds/0001-Workaround-for-an-old-gcc-bug.patch
rename to external/mdds/0001-Workaround-for-an-old-gcc-bug.patch
diff --git a/mdds/Makefile b/external/mdds/Makefile
similarity index 71%
rename from mdds/Makefile
rename to external/mdds/Makefile
index ccb1c85..e4968cf 100644
--- a/mdds/Makefile
+++ b/external/mdds/Makefile
@@ -2,6 +2,6 @@
 
 module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST
 
-include $(module_directory)/../solenv/gbuild/partial_build.mk
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
 
 # vim: set noet sw=4 ts=4:
diff --git a/mdds/Module_mdds.mk b/external/mdds/Module_mdds.mk
similarity index 93%
rename from mdds/Module_mdds.mk
rename to external/mdds/Module_mdds.mk
index ac0f8a6..4774594 100644
--- a/mdds/Module_mdds.mk
+++ b/external/mdds/Module_mdds.mk
@@ -9,12 +9,8 @@
 
 $(eval $(call gb_Module_Module,mdds))
 
-ifeq ($(SYSTEM_MDDS),NO)
-
 $(eval $(call gb_Module_add_targets,mdds,\
UnpackedTarball_mdds \
 ))
 
-endif
-
 # vim: set noet sw=4 ts=4:
diff --git a/mdds/README b/external/mdds/README
similarity index 100%
rename from mdds/README
rename to external/mdds/README
diff --git a/mdds/UnpackedTarball_mdds.mk 
b/external/mdds/UnpackedTarball_mdds.mk
similarity index 86%
rename from mdds/UnpackedTarball_mdds.mk
rename to external/mdds/UnpackedTarball_mdds.mk
index 69fbf18..1ccfc2a 100644
--- a/mdds/UnpackedTarball_mdds.mk
+++ b/external/mdds/UnpackedTarball_mdds.mk
@@ -14,8 +14,8 @@ $(eval $(call 
gb_UnpackedTarball_set_tarball,mdds,$(MDDS_TARBALL)))
 $(eval $(call gb_UnpackedTarball_set_patchlevel,mdds,3))
 
 $(eval $(call gb_UnpackedTarball_add_patches,mdds,\
-   mdds/mdds_0.6.0.patch \
-   mdds/0001-Workaround-for-an-old-gcc-bug.patch \
+   external/mdds/mdds_0.6.0.patch \
+   external/mdds/0001-Workaround-for-an-old-gcc-bug.patch \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/mdds/mdds_0.6.0.patch b/external/mdds/mdds_0.6.0.patch
similarity index 100%
rename from mdds/mdds_0.6.0.patch
rename to external/mdds/mdds_0.6.0.patch
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits