summaryrefslogtreecommitdiff
path: root/sc
AgeCommit message (Collapse)Author
2025-02-05sc: Add test for the fill handle drag and dropXisco Fauli
Change-Id: I4625b989800b07bf94db07af0e3feb568e9f015a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181190 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2025-02-04tdf#149907: sc: Add UItestXisco Fauli
Change-Id: If21693a5e3cb92e0c465417f8989ad2fa9670432 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181128 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Tested-by: Jenkins
2025-02-04ofz#394329881 Integer-overflowCaolán McNamara
Change-Id: Ie1cd71c72a7a2159c9c4592f3e39e3efb8ac5b2f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181141 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2025-02-04make calc Display config listen for changesCaolán McNamara
Change-Id: I36a9118f8a29ccd543da9510e9ecf11ebf02b2f5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181131 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Jenkins
2025-02-04tdf#150867: Add support for VSTACK functionXisco Fauli
Change-Id: I76e3267f45a0d035f6a79af934b9ce2c606b4b89 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181120 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Tested-by: Jenkins
2025-02-04tdf#150868: Add support for HSTACK functionXisco Fauli
Change-Id: I105ffabc8dd1fa58bf3acec4a81c3217061d3a26 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181100 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Tested-by: Jenkins
2025-02-04Actually make wrapped_iterator a bidirectional_iteratorStephan Bergmann
...which it claims to be. Also, builds against recent LLVM 20 trunk libc++ (on macOS) had started to fail with > In file included from sc/source/core/tool/scmatrix.cxx:20: > In file included from sc/inc/scmatrix.hxx:22: > In file included from sc/inc/address.hxx:30: > In file included from sc/inc/types.hxx:14: > In file included from external/boost/include/boost/intrusive_ptr.hpp:30: > In file included from workdir/UnpackedTarball/boost/boost/intrusive_ptr.hpp:16: > In file included from workdir/UnpackedTarball/boost/boost/smart_ptr/intrusive_ptr.hpp:20: > In file included from ~/llvm/inst/bin/../include/c++/v1/functional:557: > In file included from ~/llvm/inst/bin/../include/c++/v1/__functional/boyer_moore_searcher.h:25: > ~/llvm/inst/bin/../include/c++/v1/__vector/vector.h:1043:20: error: no matching function for call to object of type 'const __copy_n' > 1043 | auto __mid = ranges::copy_n(std::move(__first), size(), this->__begin_).in; > | ^~~~~~~~~~~~~~ > ~/llvm/inst/bin/../include/c++/v1/__vector/vector.h:317:5: note: in instantiation of function template specialization 'std::vector<double>::__assign_with_size<(anonymous namespace)::wrapped_iterator<mdds::mtv::default_element_block<10, double>, matop::(anonymous namespace)::MatOp<(lambda at sc/source/core/tool/scmatrix.cxx:3596:17)>, double>, (anonymous namespace)::wrapped_iterator<mdds::mtv::default_element_block<10, double>, matop::(anonymous namespace)::MatOp<(lambda at sc/source/core/tool/scmatrix.cxx:3596:17)>, double>>' requested here > 317 | __assign_with_size(__first, __last, std::distance(__first, __last)); > | ^ > workdir/UnpackedTarball/mdds/include/mdds/multi_type_vector/soa/../types.hpp:335:15: note: in instantiation of function template specialization 'std::vector<double>::assign<(anonymous namespace)::wrapped_iterator<mdds::mtv::default_element_block<10, double>, matop::(anonymous namespace)::MatOp<(lambda at sc/source/core/tool/scmatrix.cxx:3596:17)>, double>, 0>' requested here > 335 | m_vec.assign(first, last); > | ^ > workdir/UnpackedTarball/mdds/include/mdds/multi_type_vector/soa/../types.hpp:718:11: note: in instantiation of function template specialization 'mdds::mtv::delayed_delete_vector<double>::assign<(anonymous namespace)::wrapped_iterator<mdds::mtv::default_element_block<10, double>, matop::(anonymous namespace)::MatOp<(lambda at sc/source/core/tool/scmatrix.cxx:3596:17)>, double>>' requested here > 718 | d.assign(it_begin, it_end); > | ^ > workdir/UnpackedTarball/mdds/include/mdds/multi_type_vector/soa/../standard_element_blocks.hpp:73:1: note: in instantiation of function template specialization 'mdds::mtv::element_block<mdds::mtv::default_element_block<10, double>, 10, double, mdds::mtv::delayed_delete_vector>::assign_values<(anonymous namespace)::wrapped_iterator<mdds::mtv::default_element_block<10, double>, matop::(anonymous namespace)::MatOp<(lambda at sc/source/core/tool/scmatrix.cxx:3596:17)>, double>>' requested here > 73 | MDDS_MTV_DEFINE_ELEMENT_CALLBACKS(double, element_type_double, 0.0, double_element_block) > | ^ > workdir/UnpackedTarball/mdds/include/mdds/multi_type_vector/macro.hpp:101:21: note: expanded from macro 'MDDS_MTV_DEFINE_ELEMENT_CALLBACKS' > 101 | block_type::assign_values(dest, it_begin, it_end); \ > | ^ > workdir/UnpackedTarball/mdds/include/mdds/multi_type_vector/soa/main_def.inl:2545:13: note: in instantiation of function template specialization 'mdds::mtv::mdds_mtv_assign_values<(anonymous namespace)::wrapped_iterator<mdds::mtv::default_element_block<10, double>, matop::(anonymous namespace)::MatOp<(lambda at sc/source/core/tool/scmatrix.cxx:3596:17)>, double>>' requested here > 2545 | mdds_mtv_assign_values(*blk_data, *it_begin, it_begin, it_end); > | ^ > workdir/UnpackedTarball/mdds/include/mdds/multi_type_vector/soa/main_def.inl:2519:16: note: (skipping 3 contexts in backtrace; use -ftemplate-backtrace-limit=0 to see all) > 2519 | return set_cells_to_single_block(row, end_row, block_index1, it_begin, it_end); > | ^ > sc/source/core/tool/scmatrix.cxx:2419:29: note: in instantiation of function template specialization 'mdds::multi_type_matrix<(anonymous namespace)::matrix_traits>::set<(anonymous namespace)::wrapped_iterator<mdds::mtv::default_element_block<10, double>, matop::(anonymous namespace)::MatOp<(lambda at sc/source/core/tool/scmatrix.cxx:3596:17)>, double>>' requested here > 2419 | pos = mrMat.set(pos,aFunc.begin(), aFunc.end()); > | ^ > workdir/UnpackedTarball/mdds/include/mdds/multi_type_matrix.hpp:191:13: note: in instantiation of member function '(anonymous namespace)::MatrixOpWrapper<matop::(anonymous namespace)::MatOp<(lambda at sc/source/core/tool/scmatrix.cxx:3596:17)>>::operator()' requested here > 191 | m_func(mtm_node); > | ^ > ~/llvm/inst/bin/../include/c++/v1/__algorithm/for_each.h:33:5: note: in instantiation of member function 'mdds::multi_type_matrix<(anonymous namespace)::matrix_traits>::walk_func<(anonymous namespace)::MatrixOpWrapper<matop::(anonymous namespace)::MatOp<(lambda at sc/source/core/tool/scmatrix.cxx:3596:17)>>>::operator()' requested here > 33 | __f(*__first); > | ^ > sc/source/core/tool/scmatrix.cxx:2468:11: note: in instantiation of function template specialization 'mdds::multi_type_matrix<(anonymous namespace)::matrix_traits>::walk<(anonymous namespace)::MatrixOpWrapper<matop::(anonymous namespace)::MatOp<(lambda at sc/source/core/tool/scmatrix.cxx:3596:17)>>>' requested here > 2468 | maMat.walk(aFunc); > | ^ > sc/source/core/tool/scmatrix.cxx:3598:12: note: in instantiation of function template specialization 'ScMatrixImpl::ApplyOperation<matop::(anonymous namespace)::MatOp<(lambda at sc/source/core/tool/scmatrix.cxx:3596:17)>>' requested here > 3598 | pImpl->ApplyOperation(aOp, *rMat.pImpl); > | ^ > ~/llvm/inst/bin/../include/c++/v1/__algorithm/ranges_copy_n.h:64:3: note: candidate template ignored: constraints not satisfied [with _Ip = __libcpp_remove_reference_t<wrapped_iterator<default_element_block<10, double, mdds::mtv::delayed_delete_vector>, MatOp<(lambda at sc/source/core/tool/scmatrix.cxx:3596:17)>, double> &>, _Op = pointer] > 64 | operator()(_Ip __first, iter_difference_t<_Ip> __n, _Op __result) const { > | ^ > ~/llvm/inst/bin/../include/c++/v1/__algorithm/ranges_copy_n.h:61:13: note: because '(anonymous namespace)::wrapped_iterator<mdds::mtv::default_element_block<10, double>, matop::(anonymous namespace)::MatOp<(lambda at sc/source/core/tool/scmatrix.cxx:3596:17)>, double>' does not satisfy 'input_iterator' > 61 | template <input_iterator _Ip, weakly_incrementable _Op> > | ^ > ~/llvm/inst/bin/../include/c++/v1/__iterator/concepts.h:154:26: note: because '(anonymous namespace)::wrapped_iterator<mdds::mtv::default_element_block<10, double>, matop::(anonymous namespace)::MatOp<(lambda at sc/source/core/tool/scmatrix.cxx:3596:17)>, double>' does not satisfy 'input_or_output_iterator' > 154 | concept input_iterator = input_or_output_iterator<_Ip> && indirectly_readable<_Ip> && requires { > | ^ > ~/llvm/inst/bin/../include/c++/v1/__iterator/concepts.h:135:6: note: because '(anonymous namespace)::wrapped_iterator<mdds::mtv::default_element_block<10, double>, matop::(anonymous namespace)::MatOp<(lambda at sc/source/core/tool/scmatrix.cxx:3596:17)>, double>' does not satisfy 'weakly_incrementable' > 135 | } && weakly_incrementable<_Ip>; > | ^ > ~/llvm/inst/bin/../include/c++/v1/__iterator/concepts.h:122:10: note: because '__i++' would be invalid: cannot increment value of type '(anonymous namespace)::wrapped_iterator<mdds::mtv::default_element_block<10, double>, matop::(anonymous namespace)::MatOp<(lambda at sc/source/core/tool/scmatrix.cxx:3596:17)>, double>' > 122 | __i++; // not required to be equality-preserving > | ^ etc. Change-Id: I1c49823d462c67bb73b16453ea44e5f2fe19d2e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181111 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2025-02-04cool#10533Gökay Şatır
LOK: Do not set the pasteMode when the view is read only. There is a chance to paste the copied content in read only view if user acts too fast. We need to set the pasteMode selectively to ensure that the action is not performed. Change-Id: I446469a2f1fa25c5cdf6c5958f664a46d6d1a741 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181085 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2025-02-04cid#1642560 COPY_INSTEAD_OF_MOVECaolán McNamara
Change-Id: If2abd138060ce97d2505c0a60f3cc3c6477dcbf9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181088 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2025-02-04crashtesting: SvBaseLink::Update can invalidate later entriesCaolán McNamara
e.g. load forum-mso-en4-62141.xls and update links #0 sfx2::LinkManager::Remove (this=0x270d720, pLink=0x27b5780) at core/sfx2/source/appl/linkmgr2.cxx:118 #1 0x00007fffa9813eef in ScDocument::UpdateRefAreaLinks (this=0x1f5d740, eUpdateRefMode=URM_INSDEL, rRange=..., nDx=0, nDy=-6, nDz=0) at core/sc/source/core/data/documen8.cxx:1141 #2 0x00007fffa97a8639 in ScDocument::UpdateReference (this=0x1f5d740, rCxt=..., pUndoDoc=0x0, bIncludeDraw=true, bUpdateNoteCaptionPos=false) at core/sc/source/core/data/documen3.cxx:1053 #3 0x00007fffa9829c9e in ScDocument::DeleteRow (this=0x1f5d740, nStartCol=1, nStartTab=0, nEndCol=7, nEndTab=0, nStartRow=3, nSize=6, pRefUndoDoc=0x0, pUndoOutline=0x0, pTabMark=0x0) at core/sc/source/core/data/document.cxx:1431 #4 0x00007fffa982a324 in ScDocument::DeleteRow (this=0x1f5d740, rRange=...) at core/sc/source/core/data/document.cxx:1484 #5 0x00007fffa982d1a4 in ScDocument::FitBlock (this=0x1f5d740, rOld=..., rNew=..., bClear=true) at core/sc/source/core/data/document.cxx:1883 #6 0x00007fffaa6c385d in ScAreaLink::Refresh (this=0x27b5780, rNewFile="http://stocks.tradingcharts.com/stocks/symbols/s/NYSE/Boeing", rNewFilter="calc_HTML_WebQuery", rNewArea="HTML_2", nNewRefreshDelaySeconds=0) at core/sc/source/ui/docshell/arealink.cxx:365 #7 0x00007fffaa6c5069 in ScAreaLink::DataChanged (this=0x27b5780) at core/sc/source/ui/docshell/arealink.cxx:128 #8 0x00007ffff3ac81e1 in sfx2::SvBaseLink::Update (this=0x27b5780) at core/sfx2/source/appl/lnkbase2.cxx:324 #9 0x00007fffa98137b6 in ScDocument::UpdateAreaLinks (this=0x1f5d740) at core/sc/source/core/data/documen8.cxx:1058 Change-Id: Ie6c59b240d9a24cbf427be9c5bfda1660fe888c6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181078 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Jenkins
2025-02-04tdf#165011 accept empty second parameter of WEEKNUM spreadsheet functionAndras Timar
and treat it like if it was the the default "1". Change-Id: I618575a7441a2a6650228fc1a29177e294933ce0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181048 Tested-by: Jenkins Reviewed-by: Andras Timar <andras.timar@collabora.com>
2025-02-04related: tdf#162601 UNIQUE function is case-insensitive also for non ASCIIXisco Fauli
Kudos to M. Kaganski for flagging it Change-Id: I061a66f2e58bc48025575f20f97479059d0f4453 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181077 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2025-02-04No longer use std::optional for SfxModule::CreateStyleFamiliesMichael Weghorn
Just return an empty std::vector instead of a std::optional that contains no value in the default implementation, and adjust the type of the local variables and class members that contain the result and their use accordingly. Change-Id: I4e25b3cbd96c6eb9f06b0ae44b36675bb11ab38a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181024 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2025-02-03Fix code typo: multiple ; in opencl/Bogdan Buzea
Change-Id: I03a1bfd03de7c3ff9b28456c2a6c8074a5ebd20c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179592 Reviewed-by: Hossein <hossein@libreoffice.org> Tested-by: Jenkins
2025-02-03tdf#145056 Delete autofilter settings when turning off autofilterSamuel Mehrbrodt
Otherwise when turning autofilter back on, colors will still be selected in the dropdown (while the filter is not active) Change-Id: I2bfeed08b187b3923e001d3b71658d5dc47556f1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181053 Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> Tested-by: Jenkins
2025-02-03Fixed WEEKNUMBER test sheet, ISERROR(a13ú) did not seem rightAndras Timar
Change-Id: I01ccd512d38c887bfcf834ef2fbfcf46a2e98246 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181047 Tested-by: Jenkins Reviewed-by: Andras Timar <andras.timar@collabora.com>
2025-02-03sc: a13ú -> A13Xisco Fauli
Change-Id: I7200ac41f6d2b66a5320dc7fcd0f845e2b315ca8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181055 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2025-02-03tdf#162601: UNIQUE function is case-insensitiveXisco Fauli
Change-Id: I12d67cb926c1e6dc8b7863529639dc252385b8e3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181035 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Tested-by: Jenkins
2025-02-03tdf#164843 - sc optimize "SubTotal" function's reference rangesBalazs Varga
Double references from relative named ranges can point to large ranges (MAXCOL/MAXROW) and because of that some function evaluation like SubTotal can be extreamly slow when we call ScTable::CompileHybridFormula with these large ranges. Since all the SubTotal functions ignore empty cells its worth to optimize and trim the double references in SubTotal functions. Change-Id: I9340b520cd3ac333b63b4aec35a3c647f5d9a119 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180773 Tested-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de> Tested-by: Jenkins Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
2025-02-03tdf#149907 Update results when changing conditionSamuel Mehrbrodt
Regression from d9dd003f63a781e63bfbe380ea737e080c21881f Change-Id: I9373be1f77ba13049a91816f57c5ae6b8913f071 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181028 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
2025-02-02Drop some needless mappings to identical stringsMike Kaganski
Change-Id: Ia9aac22c8bf6872636bd225f693950f9924071c3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181013 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-02-02Use OUString instead of run-time conversion from char arraysMike Kaganski
Change-Id: I94bd75121796b84b8ea44f5e3bed1893d0b02edf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181012 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
2025-02-02The first entry must not be the default best matchMike Kaganski
This is based on code reading; I see no reason to assume that the front has the best match, that should be used when the following iterations didn't choose it explicitly. Change-Id: I2f90e56d00c25737c58e1e90642618a88f1fa2ca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181011 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
2025-02-02Inline cellkeywords.inl, and drop its generating machineryMike Kaganski
Now that we have UTF-8-encoded CXX, we can simplify the initialization of ScCellKeywordTranslator, by inlining all the translation pairs. Change-Id: I5dedf71d5694c919f09c8c538bd4dba6cce391ee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181010 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-02-02Simplify cellkeywords.inlMike Kaganski
It was autogenerated once; likely, it was needed when the encoding of all CXX files was undefined. These days, the encoding is fixed to UTF-8, so no meed to encode the literals like this. Change-Id: I0a181075360a28e79c1a2e67548eebc970832a85 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181009 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-02-01tdf#151000: Add support for CHOOSECOLS functionXisco Fauli
Change-Id: Id183f79a148080adebe652f63e29716910c638b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180992 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2025-01-30tdf#150999: Add support for CHOOSEROWS functionXisco Fauli
Change-Id: If7de1b243a6040424a5712ba28017176b7e36101 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180955 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2025-01-30tdf#158867 offapi,i18npool,starmath: fix "," in Math againMichael Stahl
This is essentially the same bug that was fixed in commit 2caa9d7ddcff3f6e380c306b737e9b5e9cdaf4c2 "Resolves: tdf#127873 accept ',' comma group separator in number entities again". The problem is that sw wants to recognize group separators only if there are 3 digits following so it really looks like a number (see bug tdf#42518), but starmath really wants to recognize either comma or dot as a decimal separator and uses the GROUP_SEPARATOR_IN_NUMBER as a hack to get this behaviour, so the same parser can work in any locale. Introduce new constant GROUP_SEPARATOR_IN_NUMBER_3 so that sw and starmath can request different parsing. sc/source/core/tool/compiler.cxx also uses GROUP_SEPARATOR_IN_NUMBER and it's unclear to me what is desired there, but there are no known regression reports so leave the behaviour there unchanged. (regression from commit 1bd9a51b826015746069fcc0d02a30a2ddc7e7f5) Change-Id: Icb7662f26d89677cf84ccad07a2ea4c380587ab4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180920 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2025-01-30cid#1641649 COPY_INSTEAD_OF_MOVECaolán McNamara
Change-Id: I247fffbf6058e395ab5c1d5968d3f0ae63be9e3f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180931 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2025-01-30More appealing design for alientformat warn dialogHeiko Tietze
Change-Id: I575f24e6b8f9dd08bd8797343a86ac25b49f19b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180713 Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org> Tested-by: Jenkins
2025-01-29tdf#164900 table text in different columns no longer lined upNoel Grandin
Revert "tdf#161846 use unordered_map in SfxItemPropertyMap" This reverts commit c39978f41dccbeb2e973c919a67d9b1d974f8f3c. Change-Id: I26cadb32b426fd3b48179b67c677213a78b4999c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180903 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2025-01-29sc: convert data validity dialog asyncPranam Lashkari
Change-Id: Ifef985c15a58c1c081f9a011e174e3b2547f3ea2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179402 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180704 Tested-by: Jenkins
2025-01-27Resolves: cool#10952 use existing ComponentContextCaolán McNamara
instead of unnecessarily bootstrapping an entirely new one See: https://github.com/CollaboraOnline/online/issues/10952 Change-Id: I625c539eb7272e152ee84a568f235751128bd96a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180776 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Jenkins
2025-01-25Resolves: tdf#164853 find_if causing copyCaolán McNamara
the pred param of: const std::pair<QueryKey, QueryCriteriaAndResult>& doesn't exactly match what the arg should be, which is const std::pair<const QueryKey, QueryCriteriaAndResult>& so an unecessary copy is silently created, add and use some typedefs to make this more straightforward. seen with: perf record -e mem_load_l3_hit_retired.xsnp_fwd -e mem_load_l3_hit_retired.xsnp_miss on profiling specifically for contested accesses, see tma_contested_accesses in perf -v Change-Id: I1d1a57e49a0f2af8bc57ca22ac4572c0246c719b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180753 Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2025-01-25sc: factor out some more codeXisco Fauli
Change-Id: I604bf182e9ac6f34298f7193cfffd1cc818132b0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180738 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2025-01-25tdf#164844: handle colorscale and friends specially when deduplicating CFMike Kaganski
The conditional formats like colorscale, databar and iconset may take their whole range to calculate their maximum / minimum, and each cell format would depend on the CF range. Thus, automatic merge of ranges of similar CFs when copying/pasting could create unexpected results. E.g., merging CFs of two distinct color scales - one for a range from 1 to 10, and another from 100 to 500 - would change colors on both of them, which is usually not what user wants, even when these ranges are side by side in adjacent columns. On the other hand, users still may want to have a way to expand the range automatically. E.g., when there is a column from A1 to A10 with a colorscale, and the user copies a cell from that range to A11, it is very likely that the intention is to expand the existing CF, not to create a separate colorscale individually for the cell A11. This makes it necessary to create some complexity in deciding when to deduplicate, and when not. This change introduces a function for that, called isRangeDependentFormatNeedDeduplication; and implements some simple algorithm that currently only depends on analysis of the two CFs' ranges. If both ranges are one-dimensional vectors, and the new CF range "continues" the existing range (the edges of the two vectors are adjacent), then it decides to combine them into one expanded CF. Also, if the new range is completely inside the old one (which may easily happen, when a user copies a cell from one place to another inside the same range), it also allows deduplication. In other cases, it rejects deduplication, requiring creation of a new CF. It may be extended as needed. One possible improvement could be e.g. when a user has a two-dimensional colorscale block, and copies some of its rows below, then it would be likely that the intention is to expand the range of existing CF, rather than creating a new one for the expanded range. This would need some specification how to tell this case from others that must not deduplicate. I must note that this problem is indeed difficult: e.g., in Excel, there is also no simple logic around copying such CF. I saw very odd cases, where the copy resulted in merging ranges of existing CF, or in creation of new CF; also, it could even magically add cells to existing CFs without copy - just by entering data below existing CF (and even when there was some gap between the existing CF range and the newly entered data - but not when there was two gaps). So there likely will always be some corner cases where users expect something else. This changes the behavior established in commits 3f614f431475e1bf3bb3bbeac59b0681309628b7 (tdf#95295: don't add duplicate conditional formats, 2017-12-11), 3fa15dd614bd72ddb36dbe033abeef5609d31f38 (tdf#154906 tdf#129813 tdf#129814 sc: fix conditional format color scale, 2023-04-26) and 8af6c46a9c0e86bbbd908e96ff236ad1d6c4ddab (tdf#155319 sc: fix conditional format data bar after copying, 2023-05-22) regarding the mentioned types of CF. Change-Id: Ie94167bbf66e448a6b56ad0962cb38221aa7d4b7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180735 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
2025-01-25Mark some visible strings in ui files as translatableGabor Kelemen
found with bin/ui-translatable.sh Change-Id: Ibe74635abc54a898c6040d4e62427f749f842474 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180722 Tested-by: Jenkins Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
2025-01-24sc: factor out common codeXisco Fauli
Change-Id: Ie76ee43b4fd00d5a1e152532017b3a30581252cf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180715 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Tested-by: Jenkins
2025-01-24tdf#151001: Add support for EXPAND functionXisco Fauli
Change-Id: I4eabd526d656c13da7792d3c195f036ce78bd0d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180706 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2025-01-24tdf#150998: Add support for DROP functionXisco Fauli
Change-Id: Id84cbf25e655410c3fac655cd88f1d74dc98defd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180673 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2025-01-23Avoid matching the 'if' with an empty referenceMike Kaganski
Commit d833992e7e06f7d385fca6ffe35ce66b79360a63 (Avoid checking exact interface type of Any value, 2024-11-08) had modified an 'if' condition in ScFunctionAccess::callFunction, so an Any with a reference to an object implementing the requested interface could be matched, even if the Any points to another interface of the object. However, it made an empty XInterface reference match, too, which is unexpected. It is not a real problem now: both no match, and a match of an empty reference set the error; but in the future, a new "else" branch could be added after this one, and then it could behave unexpectedly, so fix it here. Change-Id: I43375fc34fe01665e7984ea6ad7052f7969c13c0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180636 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-01-23sc: these new functions are from 2024Xisco Fauli
While at it, fix FunctionData of WRAPCOLS and WRAPROWS caused by a copy&paste mistake Change-Id: I2061ae89e42665b606aacb5dd40fdfb0f99ddee1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180624 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2025-01-23tdf#150997: Add support for TAKE functionXisco Fauli
Change-Id: I2e7d223707941d31db0330282f783e845497130b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180622 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2025-01-22tdf#150880: Add support for WRAPROWS functionXisco Fauli
Change-Id: I44341835403c068a61cfb79185aeabe6daf32f70 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180598 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2025-01-22Drop unneeded additional checkMike Kaganski
The two inner blocks inside the outer 'bWidth || bHeight' condition check the same bWidth and bHeight, so will execute exactly the same way without that outer check. Change-Id: If6b4c94ab47f2495c0a69473907c541ac9ffe524 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180581 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-01-22Introduce ScConditionalFormatList::Clone and use it to simplifyMike Kaganski
Potentialy could also return a unique_ptr, would need to change the methods where the result is passed. Change-Id: I9cbd876e446094b93e2d6f72b16aefe58327e7d2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180572 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-01-22tdf#164785: make sure to not modify CF list in undo/redoMike Kaganski
Commit 21830c58f27977ca4a1dbacd2f41583c9f3ae775 added a call to CopyToDocument to CF undo/redo. But that could modify the CF list (calling its DeleteArea method, and tab's CopyConditionalFormat). This change prevents that by using document's AddCondFormatData instead of CopyToDocument. Change-Id: Ic59a6724b5cc70ef16ec1ef3b3e2674cb3cc83f1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180570 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-01-22tdf#150881: Add support for WRAPCOLS functionXisco Fauli
Change-Id: Ie152a83dcb7bf16f7a92ab55fd801270658a2e9e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180365 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2025-01-22tdf#164785: restore saving/reapplying of CF keys in cellsMike Kaganski
Commit c492de66a077f3a2a960209b0b8b278b3901f361 (tdf#160149: save and restore the whole set of tab's conditional formats, 2024-03-17) had replaced copying of the affected cell ranges (including respective CF) with copying of the whole CF list. That allowed to replace the list as a whole, and be sure that it is in the same state as before the undone operation (not merged in any way because of re-application of CF). But the previous code made sure to set the CF keys in affected cells. New code didn't do that, and so, the changes to the cell attributes with CF keys were not cleared on undo. Applying new CF to another cell range created the same key that was already referenced in those old cells, so they behaved as if they belong to the new CF range. This change keeps the "save/restore whole CF list" idea, so tdf#160149 is kept fixed. But additionally, it restores saving/reapplying of cell attributes (but not other data) in the areas affected by CF. Change-Id: I4ff844ca1345322e231df605fb019b9613a6b123 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180555 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-01-21fix ubsan in UITest_manual_testsNoel Grandin
after commit 72bbb0dd4a368dab2b1bd99917cd07d23a92a3f0 Author: Pranam Lashkari <lpranam@collabora.com> Date: Mon Dec 30 02:20:22 2024 +0530 sc: make data validy error dialog async (invalid value error) Change-Id: I885e470c6585df038f12bf5834fba005f5a072da Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180535 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>