summaryrefslogtreecommitdiff
path: root/sc/inc/mtvelements.hxx
AgeCommit message (Collapse)Author
2022-04-03sc: support deleting a Sparkline with 'Clear Content' functionTomaž Vajngerl
Change-Id: Ida61b402170238fb0505c777e49954c15d376cf0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132467 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-03-29sc: refactor sparkline struture to store a list of sparklinesTomaž Vajngerl
We need to access a list of sparklines and sparkline groups for a sheet. To preven going through all the columns of a sheet, we need to store all the created sparklines in a list. For this it is necessary to change the model structrue a bit. A cell now has a container that stores a shared_ptr to the sparkline instead of storing the sparkline directly. With this we can store a list of weak_ptr to the sparklines in a list (vector), which can be accessed at any time and is quite fast. This is needed by the OOXML export. Change-Id: Iaca0a41e20912775f072ea6e8cab9c44367d6f30 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131919 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-03-08sc: add Sparkline to the model as a column multi_type_vectorTomaž Vajngerl
This adds a Sparkline class and a SparklineGroup class. The Sparkline class is added to a cell, and the SparklineGroup is referenced by the Sparkline, so multiple Sparklines can share the same properties. Change-Id: Id309ded34bfa7a35c1be43f7c0543d88594e66ff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131162 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-02-26tdf#147298: Add a simple test case for formula cell tracking by column.Kohei Yoshida
Change-Id: Ibdd72c08f8660ade511fdce8b3fb7cd3ed97f4b7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130511 Tested-by: Jenkins Reviewed-by: Kohei Yoshida <kohei@libreoffice.org>
2022-02-25tdf#147298: When swapping the cell stores, swap back the event handlers.Kohei Yoshida
Swapping the cell stores also swap the event handlers stored therein. But we do want the event handlers to stay with the original column instances as they store pointers to their host column instances. Change-Id: Id35b89db641e94dbaa341b33d0b64dce19a99465 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130510 Reviewed-by: Kohei Yoshida <kohei@libreoffice.org> Tested-by: Kohei Yoshida <kohei@libreoffice.org>
2021-11-05Blind fix for ubusan errorKohei Yoshida
from https://ci.libreoffice.org/job/lo_ubsan/2189/ [_RUN_____] Test::testCellBroadcaster [...] ==24129==ERROR: AddressSanitizer: heap-use-after-free on address 0x61700006c470 at pc 0x2ab6e05145e4 bp 0x7ffecaa28d70 sp 0x7ffecaa28d68 READ of size 8 at 0x61700006c470 thread T0 #0 0x2ab6e05145e3 in sc::CellStoreEvent::element_block_released(mdds::mtv::base_element_block const*) /sc/source/core/data/mtvelements.cxx:47:13 #1 0x2ab6de749427 in mdds::mtv::soa::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52, svl::SharedString>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell> >, sc::CellStoreTrait>::delete_element_block(unsigned long) /workdir/UnpackedTarball/mdds/include/mdds/multi_type_vector/soa/main_def.inl:403:17 #2 0x2ab6de74921b in mdds::mtv::soa::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52, svl::SharedString>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell> >, sc::CellStoreTrait>::delete_element_blocks(unsigned long, unsigned long) /workdir/UnpackedTarball/mdds/include/mdds/multi_type_vector/soa/main_def.inl:412:9 #3 0x2ab6de733225 in mdds::mtv::soa::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52, svl::SharedString>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell> >, sc::CellStoreTrait>::clear() /workdir/UnpackedTarball/mdds/include/mdds/multi_type_vector/soa/main_def.inl:1088:5 #4 0x2ab6df024987 in ScColumn::FreeAll() /sc/source/core/data/column3.cxx:161:13 #5 0x2ab6decff134 in ScColumn::~ScColumn() /sc/source/core/data/column.cxx:97:5 #6 0x2ab6decf708a in o3tl::default_delete<ScColumn>::operator()(ScColumn*) /include/o3tl/deleter.hxx:55:38 #7 0x2ab6decf5999 in std::unique_ptr<ScColumn, o3tl::default_delete<ScColumn> >::reset(ScColumn*) /home/tdf/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/unique_ptr.h:376:4 #8 0x2ab6decf4c8e in ScColContainer::Clear() /sc/source/core/data/colcontainer.cxx:42:21 #9 0x2ab6decf4a84 in ScColContainer::~ScColContainer() /sc/source/core/data/colcontainer.cxx:33:5 #10 0x2ab6e070e3c6 in ScTable::~ScTable() /sc/source/core/data/table1.cxx:344:1 #11 0x2ab6df50abba in o3tl::default_delete<ScTable>::operator()(ScTable*) /include/o3tl/deleter.hxx:55:38 #12 0x2ab6df4c3483 in std::unique_ptr<ScTable, o3tl::default_delete<ScTable> >::~unique_ptr() /home/tdf/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/unique_ptr.h:268:4 #13 0x2ab6df4dc87c in void std::_Destroy<std::unique_ptr<ScTable, o3tl::default_delete<ScTable> > >(std::unique_ptr<ScTable, o3tl::default_delete<ScTable> >*) /home/tdf/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/stl_construct.h:98:19 #14 0x2ab6df4dc7c6 in void std::_Destroy_aux<false>::__destroy<std::unique_ptr<ScTable, o3tl::default_delete<ScTable> >*>(std::unique_ptr<ScTable, o3tl::default_delete<ScTable> >*, std::unique_ptr<ScTable, o3tl::default_delete<ScTable> >*) /home/tdf/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/stl_construct.h:108:6 #15 0x2ab6df4dc744 in void std::_Destroy<std::unique_ptr<ScTable, o3tl::default_delete<ScTable> >*>(std::unique_ptr<ScTable, o3tl::default_delete<ScTable> >*, std::unique_ptr<ScTable, o3tl::default_delete<ScTable> >*) /home/tdf/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/stl_construct.h:136:7 #16 0x2ab6df4dc488 in void std::_Destroy<std::unique_ptr<ScTable, o3tl::default_delete<ScTable> >*, std::unique_ptr<ScTable, o3tl::default_delete<ScTable> > >(std::unique_ptr<ScTable, o3tl::default_delete<ScTable> >*, std::unique_ptr<ScTable, o3tl::default_delete<ScTable> >*, std::allocator<std::unique_ptr<ScTable, o3tl::default_delete<ScTable> > >&) /home/tdf/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/stl_construct.h:206:7 #17 0x2ab6df50df73 in std::__cxx1998::vector<std::unique_ptr<ScTable, o3tl::default_delete<ScTable> >, std::allocator<std::unique_ptr<ScTable, o3tl::default_delete<ScTable> > > >::_M_erase_at_end(std::unique_ptr<ScTable, o3tl::default_delete<ScTable> >*) /home/tdf/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/stl_vector.h:1513:2 #18 0x2ab6df70f5b0 in std::__cxx1998::vector<std::unique_ptr<ScTable, o3tl::default_delete<ScTable> >, std::allocator<std::unique_ptr<ScTable, o3tl::default_delete<ScTable> > > >::clear() /home/tdf/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/stl_vector.h:1248:9 #19 0x2ab6df70b5d4 in std::__debug::vector<std::unique_ptr<ScTable, o3tl::default_delete<ScTable> >, std::allocator<std::unique_ptr<ScTable, o3tl::default_delete<ScTable> > > >::clear() /home/tdf/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/debug/vector:699:9 #20 0x2ab6df704cb2 in ScDocument::Clear(bool) /sc/source/core/data/documen9.cxx:506:12 #21 0x2ab6df490652 in ScDocument::~ScDocument() /sc/source/core/data/documen2.cxx:363:5 #22 0x2ab6e363315d in ScDocShell::~ScDocShell() /sc/source/ui/docshell/docsh.cxx:2925:1 #23 0x2ab6e363333b in ScDocShell::~ScDocShell() /sc/source/ui/docshell/docsh.cxx:2894:1 #24 0x2ab6e3633514 in ScDocShell::~ScDocShell() /sc/source/ui/docshell/docsh.cxx:2894:1 #25 0x2ab6de4f105d in SvRefBase::ReleaseRef() /include/tools/ref.hxx:163:29 #26 0x2ab6de4a6259 in tools::SvRef<ScDocShell>::clear() /include/tools/ref.hxx:64:22 #27 0x2ab6de2b1aaa in Test::closeDocShell(tools::SvRef<ScDocShell>&) /sc/qa/unit/ucalc.cxx:365:18 #28 0x2ab6de2b2102 in Test::tearDown() /sc/qa/unit/ucalc.cxx:380:5 #29 0x2ab6de543787 in CppUnit::TestCaller<Test>::tearDown() /workdir/UnpackedTarball/cppunit/include/cppunit/TestCaller.h:185:15 #30 0x2ab69335765a in CppUnit::TestCaseMethodFunctor::operator()() const /workdir/UnpackedTarball/cppunit/src/cppunit/TestCase.cpp:32:5 #31 0x2ab6ae4f3957 in (anonymous namespace)::Protector::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) /test/source/vclbootstrapprotector.cxx:46:14 #32 0x2ab693328cd7 in CppUnit::ProtectorChain::ProtectFunctor::operator()() const /workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20:25 #33 0x2ab6a2974ff7 in (anonymous namespace)::Prot::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) /unotest/source/cpp/unobootstrapprotector/unobootstrapprotector.cxx:78:12 #34 0x2ab693328cd7 in CppUnit::ProtectorChain::ProtectFunctor::operator()() const /workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20:25 #35 0x2ab69f4479c2 in (anonymous namespace)::Prot::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) /unotest/source/cpp/unoexceptionprotector/unoexceptionprotector.cxx:62:16 #36 0x2ab693328cd7 in CppUnit::ProtectorChain::ProtectFunctor::operator()() const /workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20:25 #37 0x2ab6932bfff4 in CppUnit::DefaultProtector::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) /workdir/UnpackedTarball/cppunit/src/cppunit/DefaultProtector.cpp:15:12 #38 0x2ab693328cd7 in CppUnit::ProtectorChain::ProtectFunctor::operator()() const /workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20:25 #39 0x2ab69332272c in CppUnit::ProtectorChain::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) /workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:86:18 #40 0x2ab6933c1b39 in CppUnit::TestResult::protect(CppUnit::Functor const&, CppUnit::Test*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) /workdir/UnpackedTarball/cppunit/src/cppunit/TestResult.cpp:182:28 #41 0x2ab693356092 in CppUnit::TestCase::run(CppUnit::TestResult*) /workdir/UnpackedTarball/cppunit/src/cppunit/TestCase.cpp:95:11 #42 0x2ab693359af2 in CppUnit::TestComposite::doRunChildTests(CppUnit::TestResult*) /workdir/UnpackedTarball/cppunit/src/cppunit/TestComposite.cpp:64:30 #43 0x2ab693358cea in CppUnit::TestComposite::run(CppUnit::TestResult*) /workdir/UnpackedTarball/cppunit/src/cppunit/TestComposite.cpp:23:3 #44 0x2ab693359af2 in CppUnit::TestComposite::doRunChildTests(CppUnit::TestResult*) /workdir/UnpackedTarball/cppunit/src/cppunit/TestComposite.cpp:64:30 #45 0x2ab693358cea in CppUnit::TestComposite::run(CppUnit::TestResult*) /workdir/UnpackedTarball/cppunit/src/cppunit/TestComposite.cpp:23:3 #46 0x2ab6933ef6ce in CppUnit::TestRunner::WrappingSuite::run(CppUnit::TestResult*) /workdir/UnpackedTarball/cppunit/src/cppunit/TestRunner.cpp:47:27 #47 0x2ab6933c059e in CppUnit::TestResult::runTest(CppUnit::Test*) /workdir/UnpackedTarball/cppunit/src/cppunit/TestResult.cpp:149:9 #48 0x2ab6933f062b in CppUnit::TestRunner::run(CppUnit::TestResult&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) /workdir/UnpackedTarball/cppunit/src/cppunit/TestRunner.cpp:96:14 #49 0x4ff1d5 in (anonymous namespace)::ProtectedFixtureFunctor::run() const /sal/cppunittester/cppunittester.cxx:329:20 #50 0x4fbbc5 in main2() /sal/cppunittester/cppunittester.cxx:478:16 #51 0x4fa052 in sal_main() /sal/cppunittester/cppunittester.cxx:614:14 #52 0x4f9e9e in main /sal/cppunittester/cppunittester.cxx:609:1 #53 0x2ab69517d554 in __libc_start_main (/lib64/libc.so.6+0x22554) #54 0x425894 in _start (/workdir/LinkTarget/Executable/cppunittester+0x425894) 0x61700006c470 is located 752 bytes inside of 768-byte region [0x61700006c180,0x61700006c480) freed by thread T0 here: #0 0x4f7548 in operator delete(void*, unsigned long) /home/tdf/lode/packages/llvm-llvmorg-9.0.1.src/compiler-rt/lib/asan/asan_new_delete.cc:172 #1 0x2ab6decf709b in o3tl::default_delete<ScColumn>::operator()(ScColumn*) /include/o3tl/deleter.hxx:55:38 #2 0x2ab6decf5999 in std::unique_ptr<ScColumn, o3tl::default_delete<ScColumn> >::reset(ScColumn*) /home/tdf/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/unique_ptr.h:376:4 #3 0x2ab6decf4c8e in ScColContainer::Clear() /sc/source/core/data/colcontainer.cxx:42:21 #4 0x2ab6decf4a84 in ScColContainer::~ScColContainer() /sc/source/core/data/colcontainer.cxx:33:5 #5 0x2ab6e070e3c6 in ScTable::~ScTable() /sc/source/core/data/table1.cxx:344:1 #6 0x2ab6df50abba in o3tl::default_delete<ScTable>::operator()(ScTable*) /include/o3tl/deleter.hxx:55:38 #7 0x2ab6df4c3483 in std::unique_ptr<ScTable, o3tl::default_delete<ScTable> >::~unique_ptr() /home/tdf/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/unique_ptr.h:268:4 #8 0x2ab6df4dc87c in void std::_Destroy<std::unique_ptr<ScTable, o3tl::default_delete<ScTable> > >(std::unique_ptr<ScTable, o3tl::default_delete<ScTable> >*) /home/tdf/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/stl_construct.h:98:19 #9 0x2ab6df4dc7c6 in void std::_Destroy_aux<false>::__destroy<std::unique_ptr<ScTable, o3tl::default_delete<ScTable> >*>(std::unique_ptr<ScTable, o3tl::default_delete<ScTable> >*, std::unique_ptr<ScTable, o3tl::default_delete<ScTable> >*) /home/tdf/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/stl_construct.h:108:6 #10 0x2ab6df4dc744 in void std::_Destroy<std::unique_ptr<ScTable, o3tl::default_delete<ScTable> >*>(std::unique_ptr<ScTable, o3tl::default_delete<ScTable> >*, std::unique_ptr<ScTable, o3tl::default_delete<ScTable> >*) /home/tdf/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/stl_construct.h:136:7 #11 0x2ab6df4dc488 in void std::_Destroy<std::unique_ptr<ScTable, o3tl::default_delete<ScTable> >*, std::unique_ptr<ScTable, o3tl::default_delete<ScTable> > >(std::unique_ptr<ScTable, o3tl::default_delete<ScTable> >*, std::unique_ptr<ScTable, o3tl::default_delete<ScTable> >*, std::allocator<std::unique_ptr<ScTable, o3tl::default_delete<ScTable> > >&) /home/tdf/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/stl_construct.h:206:7 #12 0x2ab6df50df73 in std::__cxx1998::vector<std::unique_ptr<ScTable, o3tl::default_delete<ScTable> >, std::allocator<std::unique_ptr<ScTable, o3tl::default_delete<ScTable> > > >::_M_erase_at_end(std::unique_ptr<ScTable, o3tl::default_delete<ScTable> >*) /home/tdf/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/stl_vector.h:1513:2 #13 0x2ab6df70f5b0 in std::__cxx1998::vector<std::unique_ptr<ScTable, o3tl::default_delete<ScTable> >, std::allocator<std::unique_ptr<ScTable, o3tl::default_delete<ScTable> > > >::clear() /home/tdf/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/stl_vector.h:1248:9 #14 0x2ab6df70b5d4 in std::__debug::vector<std::unique_ptr<ScTable, o3tl::default_delete<ScTable> >, std::allocator<std::unique_ptr<ScTable, o3tl::default_delete<ScTable> > > >::clear() /home/tdf/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/debug/vector:699:9 #15 0x2ab6df704cb2 in ScDocument::Clear(bool) /sc/source/core/data/documen9.cxx:506:12 #16 0x2ab6df490652 in ScDocument::~ScDocument() /sc/source/core/data/documen2.cxx:363:5 #17 0x2ab6e363315d in ScDocShell::~ScDocShell() /sc/source/ui/docshell/docsh.cxx:2925:1 #18 0x2ab6e363333b in ScDocShell::~ScDocShell() /sc/source/ui/docshell/docsh.cxx:2894:1 #19 0x2ab6e3633514 in ScDocShell::~ScDocShell() /sc/source/ui/docshell/docsh.cxx:2894:1 #20 0x2ab6de4f105d in SvRefBase::ReleaseRef() /include/tools/ref.hxx:163:29 #21 0x2ab6de4a6259 in tools::SvRef<ScDocShell>::clear() /include/tools/ref.hxx:64:22 #22 0x2ab6de2b1aaa in Test::closeDocShell(tools::SvRef<ScDocShell>&) /sc/qa/unit/ucalc.cxx:365:18 #23 0x2ab6de2b2102 in Test::tearDown() /sc/qa/unit/ucalc.cxx:380:5 #24 0x2ab6de543787 in CppUnit::TestCaller<Test>::tearDown() /workdir/UnpackedTarball/cppunit/include/cppunit/TestCaller.h:185:15 #25 0x2ab69335765a in CppUnit::TestCaseMethodFunctor::operator()() const /workdir/UnpackedTarball/cppunit/src/cppunit/TestCase.cpp:32:5 #26 0x2ab6ae4f3957 in (anonymous namespace)::Protector::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) /test/source/vclbootstrapprotector.cxx:46:14 #27 0x2ab693328cd7 in CppUnit::ProtectorChain::ProtectFunctor::operator()() const /workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20:25 #28 0x2ab6a2974ff7 in (anonymous namespace)::Prot::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) /unotest/source/cpp/unobootstrapprotector/unobootstrapprotector.cxx:78:12 #29 0x2ab693328cd7 in CppUnit::ProtectorChain::ProtectFunctor::operator()() const /workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20:25 during CppunitTest_sc_ucalc Change-Id: I778984beb9d1e355d3b8f9617b193424f332a32e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124709 Tested-by: Jenkins Reviewed-by: Kohei Yoshida <kohei@libreoffice.org>
2021-11-03Upgrade mdds and liborcus to 2.0.0 and 0.17.0, respectively.Kohei Yoshida
Change-Id: I9e856fc2d61f1789a6f1702514837860539a0f49 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124573 Tested-by: Jenkins Tested-by: René Engelhard <rene@debian.org> Reviewed-by: Kohei Yoshida <kohei@libreoffice.org>
2021-07-29osl::Mutex->std::mutex in ColumnBlockPositionSetNoel Grandin
Change-Id: Ib9232f3b8f78a0a72a2eb1e743451a9f66e80979 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119671 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-03-23tdf#124176 Use pragma once in s*Vincent LE GARREC
sc, scaddins, sccomp, scripting Change-Id: Ia99fec9e238033821cb784810edd4762c09bd5db Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112049 Tested-by: Jenkins Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2020-07-01don't add a cell to a non-existent column (tdf#104865)Luboš Luňák
This change also needs invalidating column position hints if the columns get changed by the copying of the cells. Change-Id: I4793e25f253c0197d88b313bc9336435cef649f4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97603 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-08-23Mark move ctors/assignments noexceptMike Kaganski
This should enable using move semantics where possible e.g. in standard containers. According to https://en.cppreference.com/w/cpp/language/move_constructor: To make strong exception guarantee possible, user-defined move constructors should not throw exceptions. For example, std::vector relies on std::move_if_noexcept to choose between move and copy when the elements need to be relocated. Change-Id: I6e1e1cdd5cd430b139ffa2fa7031fb0bb625decb Reviewed-on: https://gerrit.libreoffice.org/77957 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-08-15Switch mdds to 1.5.0 and liborcus to 0.15.0.Kohei Yoshida
Change-Id: Ibff9a5e0f0771e4cf12b4dc3985661a01195e265 Reviewed-on: https://gerrit.libreoffice.org/77482 Tested-by: Jenkins Reviewed-by: Kohei Yoshida <kohei@libreoffice.org>
2019-02-23loplugin:unusedfields in scNoel Grandin
Change-Id: I5e9842970821d0ae61e06e3ad35c9f571b43632c Reviewed-on: https://gerrit.libreoffice.org/68224 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-05-29tdf#42949 Fix IWYU warnings in sc/inc/m*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I43882919048c23e9b8d305f8cbba8f120207bb93 Reviewed-on: https://gerrit.libreoffice.org/54824 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-11-03Resolves: tdf#111428 swap (only) ScColumn::mnBlkCountFormulaEike Rathke
commit 423df1fa929784c14e3a133c06468589fe9269cd Date: Thu Nov 2 12:53:14 2017 +0100 Resolves: tdf#111428 implement CellStoreEvent::swap() in ScColumn::SwapCol() erroneously swapped also the CellStoreEvent's ScColumn* but of course the CellStoreEvent stays at its ScColumn and is not swapped with the CellStoreType. So swap only the mnBlkCountFormula that CellStoreEvent::mpCol accesses. ASAN rightly complained about heap-use-after-free. Change-Id: Ic44fed96c49bea7365bf1200e06788860966795c
2017-11-02Resolves: tdf#111428 implement CellStoreEvent::swap() in ScColumn::SwapCol()Eike Rathke
CellStoreEvent remembered the original ScColumn* and corresponding ScColumn::mnBlkCountFormula, hence after inserting a column to the left the quick check of ScColumn::HasFormulaCell() whether there are any formula cells worked on the swapped in column (originally the one to the right) that happens to be empty in the scenario. Things worked correctly by accident if the next column to the right already contained a formula cell. Regression from commit e57a5905fb2975307af654710430d0a876dbd061 Date: Sat Jul 16 20:01:48 2016 -0400 Change-Id: If993856ceee657736f516a81c293506041a6b7eb
2017-10-23loplugin:includeform: scStephan Bergmann
Change-Id: I2ed763e0584a188032c80fde60890de3c6985cbd
2016-12-23tdf#97597: Make the document import state more multi-thread friendly.Kohei Yoshida
Change-Id: Iee9ff5e5d3471f7357a1f2eaf75abbef2d90effa Reviewed-on: https://gerrit.libreoffice.org/32322 Reviewed-by: Kohei Yoshida <libreoffice@kohei.us> Tested-by: Kohei Yoshida <libreoffice@kohei.us>
2016-07-17Use mdds' event callback to count formula blocks in each column.Kohei Yoshida
And use it to speed up certain formula related operations. Change-Id: I43b1d860d6b665556624ba7bc716826799919015 Reviewed-on: https://gerrit.libreoffice.org/27261 Reviewed-by: Kohei Yoshida <libreoffice@kohei.us> Tested-by: Kohei Yoshida <libreoffice@kohei.us>
2016-05-13Update mdds to 1.2.0. Note that the API version is also up.Kohei Yoshida
liborcus-0.11.2 is out only to make it buildable with mdds-1.2. Change-Id: I9648d827b008da252c57be0ebfd2efccb008ac70 Reviewed-on: https://gerrit.libreoffice.org/24944 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Kohei Yoshida <libreoffice@kohei.us>
2015-11-10loplugin:nullptr (automatic rewrite)Stephan Bergmann
Change-Id: I765d2a600f9c57da50c85354688e3ae796750d94
2015-01-03boost::unordered_map->std::unordered_mapCaolán McNamara
Change-Id: I2c65709cda6f10810452dfb8aa1a247cb3a5564f
2014-12-10Deteremine the script type of source cell during paste replication.Kohei Yoshida
Doing this ahead of time eliminates the need to update script types of all replicated cells after the paste. This makes significant performance impact. Change-Id: Ic4f7d7b2fe152bd5640ddb1dae01cc2ed757657e
2014-06-25remove whitespaceMarkus Mohrhard
Change-Id: Ib15413e73409cc33de01fa92a47b9d1237cfc4b2
2014-05-11fix-includes.pl: scThomas Arnhold
Change-Id: Iade3fedac5d2f8e978b7dd9c30f001d7d1564946
2014-04-19fixincludeguards.sh: scThomas Arnhold
sorry, huge one...
2014-03-03remove unused code in sc::CellTextAttrNoel Grandin
sc::CellTextAttr::CellTextAttr(unsigned short, unsigned char) Change-Id: I39f893714866f69b7928cee980cb1505c9b2be06
2014-01-25Stop leaking all ScPostIt instances.Kohei Yoshida
And re-implement correct swapping of two ScPostIt instances during sort. Change-Id: Ifbf120aae594342ae0b7c5760f771c53092c8022
2013-12-18Use orcus csv parser to streamd data which has much less overhead.Kohei Yoshida
Also, use DocumentStreamAccess to modify ScDocument's content. Change-Id: I516260cff1f2315267afcff05e36e620798a1aed
2013-11-11Make this thread safe too.Kohei Yoshida
Change-Id: Ic8508f693f8a6e9bae513d6b5b6eaaaae618194b
2013-10-23Re-implement cell note storage using mdds::multi_type_vector.Laurent Godard
Change-Id: I34ea91e360e2a6b85d65f970c6e43db687d213ca
2013-10-08Store svl::SharedString in document cell storage instead of OUString.Kohei Yoshida
With this, both ScColumn and ScMatrix store svl::SharedString as their string values, instead of OUString. Change-Id: I3faece94d98f774881fd72b3ed5f6143504cd350
2013-09-12Change so that we won't have to include mtvelements.hxx in cellvalue.hxx.Kohei Yoshida
Because mtvelements.hxx is very slow to parse by the compiler, and cellvalue.hxx is included everywhere. Hopefully this will speed up the compilation time of sc... Change-Id: Ic9a9b8483c8325e4a91021f071f2391db8b57806
2013-08-13Ensure iterators are value-initializedStephan Bergmann
...instead of merely default-initialized, to avoid undefined behavior in enclosing classes' copy ctors/assignment ops. (Cf. resolution of <http://www.open-std.org/JTC1/SC22/WG21/docs/lwg-closed.html#408> DR 408 "Is vector<reverse_iterator<char*> > forbidden?") In return, remove the enclosing classes' user defined assignment ops that do explicitly exactly what the default ones would do anyway. Change-Id: If1bb1aea56dd48da873a92a8fa30dedea844740c
2013-07-09Modifying comments to meet Doxygen standardsNourah.AlShoeibi
Change-Id: I9c498c8c2147a19c5f97e48bc8a0e149e6858e23 Reviewed-on: https://gerrit.libreoffice.org/4769 Reviewed-by: Petr Mladek <pmladek@suse.cz> Tested-by: Petr Mladek <pmladek@suse.cz>
2013-07-01Start moving all these DEBUG_FOO into calcmacros.hxx.Kohei Yoshida
This header was formerly dpmacros.hxx, now renamed to calcmacros.hxx. Change-Id: I2ed768b7c5678f5216b1e93df2c0cede0c548be4
2013-06-27Turn off column debug and remove warnings.Kohei Yoshida
Change-Id: Ic7dd79c1e420e87dcaff4126d60763ff8cbe9344
2013-06-27Initial version of dynamic grouping of formula cells.Kohei Yoshida
And tests to go along with it. Change-Id: Idf5ff3b819aa557a1ae31dfb4d0b2c3a8216ed75
2013-06-24Turn off column storage debugging.Kohei Yoshida
Change-Id: I5d88c94a9cf0bbd194c8c505de7cc34bb9e20500
2013-06-24Leave the RowInfo's for empty cells unfilled.Kohei Yoshida
Else empty cell regions would get skipped and the non-empty cells would get displayed at incorrect row positions. Change-Id: Ica8d1c654458e0ea508e8f00846180d89bfe8804
2013-06-24Switch to using multi_type_vector for cell storage.Kohei Yoshida
The old style cell storage is no more. Currently the code is buildable, but crashes during unit test. Change-Id: Ie688e22e95c7fb02b9e97b23df0fc1883a97945f
2013-06-24Define block types for string, edit text and formula cell elements.Kohei Yoshida
Also, remove the custom_ prefix from block names. Change-Id: If3dfdbdacc2d0113fa8d631bec7a914b51668115
2013-05-20Keep track of column block positions in ScDocumentImport too.Kohei Yoshida
This currently only affects document import via orcus, but it'll be good to put this in place. Change-Id: I8cc6d54aba6fab1f2774127f92c2a764f7b690fb
2013-05-20Keep track of current block position when pasting a range of cells.Kohei Yoshida
This avoids re-starting the search for insertion position in the cell text attribute array, on every single cell insertion. Instead of always searching from the first position, it starts the seaarch from the previous insertion position. This reduces the paste time from the previous 3.5 seconds to 1.7 seconds on my machine. Here is the scenario. 1) Put =A1 in B1, and leave B2 empty. 2) Select B1:B2 and copy it via Ctrl-C. 3) Select B3:B50000, and paste via Ctrl-V. Because of the empty cells interspersing the destination range, this makes the data array highly partitioned, which makes the position lookup very very expensive without the position hint. Still, I was hoping the duration would become a fraction of a second. 1.7 seconds still seems a bit too slow... Change-Id: I7742ce7e22935b6d0e082e4569d53dbd2072c4e5
2013-05-20Move the column element block definitions out of ScColumn.Kohei Yoshida
so that I can reference it in another class. Change-Id: I035cc1d37ec219c3e3da2e180a0337fb3c6fba8a
2013-05-20Block definition for CellTextAttr.Kohei Yoshida
This block will be used to merge the text width and script type vectors that are currently separate. Text widths and script types should really be stored together. Change-Id: I6783769cc03180b513319e0a98a0773bd20ba941
2013-05-20Rename header: mtvelement -> multi_type_vector (mtv) elements.Kohei Yoshida
This header hosts custom element types and blocks used in multi_type_vector. Change-Id: I32481a2354d8c66eb877b4005a260a79183cd714