summaryrefslogtreecommitdiff
path: root/svx
AgeCommit message (Collapse)Author
2023-08-26Remove duplicated includeAndrea Gelmini
Change-Id: Ife90baef2ceff442f51c03805eda945b2b2baf34 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156118 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-08-25svx: refactor text color theme changing and add undo supportTomaž Vajngerl
This refactors text theme color changing to use editeng directly and also makes it possible to add undo support. Some refactoring changes were also needed in Writer and Calc ThemeColorChanger implementations. Change-Id: I5cc21205aa3866f65f5b2132ecaa760292401263 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155819 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-08-25Revert "use more Reference::query instead of UNO_QUERY_THROW"Noel Grandin
This reverts commit 7fc6063914432d58d86cfcbd728d967e7c86ebfd. sberg noticed that there is a difference now: there's a subtle difference now, in that if y was null originally, it would have thrown a (caught) exception, whereas now it will crash in the y.query<X>() call. Change-Id: Idbb5a08d635d15b5ca63f4822eddf05fb0a5afa0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156002 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-08-25Use std::optional instead of out argumentsMike Kaganski
Change-Id: I6dde7d602695d44488f7debf65d8ef278fa8704c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156087 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-08-25Resolves tdf#155926 - Rename "Line Style 9"Heiko Tietze
Sparse dash Change-Id: Ia676358ea0de4437dd2e5f210b26a4e97f8d8758 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156090 Tested-by: Jenkins Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
2023-08-24Fix typoAndrea Gelmini
Change-Id: I9d1b0bbd99caa53515b8d8bf7d86723cd51aca6d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156059 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-08-24Reset buffered GridOffset(s) for suspicious valuesArmin Le Grand (allotropia)
Huge offsets of GridOffset(s) are a hint for error -> usually the conditions for calculation have changed. E.g. - I saw errors with +/-5740, that was in the environment of massive external UNO API using LO as target. If condtions for this calculation change, it is usually required to call - ViewObjectContact::resetGridOffset(), or - ObjectContact::resetAllGridOffsets() or - ScDrawView::resetGridOffsetsForAllSdrPageViews() as it is done e.g. when zoom changes (see ScDrawView::RecalcScale()). Theoretically these resets have to be done for any precondition changed that is used in the calculation of that value (see ScDrawView::calculateGridOffsetForSdrObject). This is not complete and would be hard to do so. Since it is just a buffered value and re-calculation is not expensive (linear O(n)) we can just reset suspicious values here what fixes the problem. Hopefully - when that non-linear ViewTransformation problem for the calc-view gets solved one day - all this can be removed again. For now, let's just reset here and force re-calculation. Added a SAL_WARN to inform about this, too. Change-Id: I09137f7703fd00c2351a288a40bf87a2691ba6e3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155983 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-08-23sd: add ThemeDialog to Impress/Draw, refactor ThemeColorChangerTomaž Vajngerl
Add "Theme" menu action, which starts the common ThemeDialog. Add Impress/Draw specific ThemeColorChanger and remove the one in svx, so that only the interface and common function remain. Rename the svx ThemeColorChanger files to THemeColorChangerCommon. Change-Id: Ibf07a443cadf0452747ab6685f65df37b145c984 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155682 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-08-23crashreporting: crash seen in FormNavigatorCaolán McNamara
set_text(rVclIter.iter, rText, col); ... m_xTreeView->set_text(*xEntry, pNameChangedHint->GetNewName()); ... m_pNavModel->Broadcast( aNameChangedHint ); Change-Id: I31275dd37de0146eae2ebb0931a5450e34fd21fb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155985 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-08-23Fix typoAndrea Gelmini
Change-Id: Iaa9fbb1545a2dbe373ba0f71eaf10fe067888ab9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155982 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-08-23move theme test from svx to sd - so we can use ThemeColorChangeTomaž Vajngerl
Change-Id: I39cdc3baf81d3cb75d21ec963c05be57b97f30ef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155865 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-08-22tdf#98367 implement rendering of draw/impress small capitalsCaolán McNamara
arising out of Þe old tdf#91932 Change-Id: I953aabc280bc31ef1297dc79d483eb3d28a542f3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155846 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-08-21spellchecking wave doesn't extend to the full width of superscript textCaolán McNamara
or subscript, e.g. enter tmalltmalltmalltmalltmalltmalltmall in impress, format character, position, superscript, ok and without this change the wave extends only 80% of the width of the misspelt text Change-Id: I5d3ad61541152199809c950349533ca3fa7ed1c5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155890 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-08-21svx: prefix members of SdrEdgeObjMiklos Vajna
See tdf#94879 for motivation. Change-Id: I5236f1d6d2294172640ec671424fbcd78a866d22 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155883 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2023-08-21move BGradient to awt::Gradient2 UNO conversion into docmodelTomaž Vajngerl
This is needed because the module dependencies are an issues if the conversion is done in basegfx. The bigger issue will come when the ComplexColor conversion will be done as basegfx can't depend on docmodel because of circular dependencies. The BGradient is also more suitable for docmodel anyway as the previously it was part of the model and is not a basic (gfx) type - however this doesn't move the whole BGradient into docmodel yet. Change-Id: Id91ce52232f89f00e09b451c13da36e2854ae14b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155674 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-08-19loplugin: new global analysis locking2Noel Grandin
look for methods where we don't need to guard access to the field, because the field is never modified Change-Id: I62c33cc3f52881557515765d3733c4afc78547aa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155836 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-08-18svx: Use FRAMEBORDERTYPE_COUNT instead of magic numberMichael Weghorn
... just as is used for `maAllBorders` below. Change-Id: I0741a039cc0ee9ad01055414f471dab45f420ed6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155849 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-08-18related tdf#156683 a11y: Dispose FrameSelectorImpl a11y childrenMichael Weghorn
Don't just invalidate, but also dispose the a11y children in `FrameSelectorImpl::~FrameSelectorImpl`. This fixes a crash on exit that's reproducible with the gtk3 VCL plugin e.g. like this (maybe some steps aren't even needed): 1) start LO Writer with the gtk3 VCL plugin 2) right-click, select "Character" > "Character" in context menu 3) switch to "Font Effects" tab 4) press space key with focus in the font color combobox to open the popup 5) use Tab key to get to the view of colors 6) move around with arrow keys a bit 7) close the dialog and Writer Reverse-continuing to `atk_object_wrapper_dispose` (frame #10 in the below backtrace) in rr showed the involved a11y object: uno::Reference to (svx::a11y::AccFrameSelectorChild *) 0x5557832b9150 Backtrace (somewhat similar to the one in tdf#156683): #0 0x00007ffff6b15cd6 in comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener>::disposeAndClear(std::unique_lock<std::mutex>&, com::sun::star::lang::EventObject const&) (this=0x7fffffffca88, rGuard=..., rEvt=...) at .../include/comphelper/interfacecontainer4.hxx:397 #1 0x00007ffff6b13c6f in comphelper::AccessibleEventNotifier::revokeClientNotifyDisposing(unsigned int, com::sun::star::uno::Reference<com::sun::star::uno::XInterface> const&) (_nClient=1058, _rxEventSource=uno::Reference to (svx::a11y::AccFrameSelectorChild *) 0x55555cecfdf0) at .../comphelper/source/misc/accessibleeventnotifier.cxx:204 #2 0x00007ffff6b1028a in comphelper::OCommonAccessibleComponent::disposing() (this=0x55555cecfdf0) at .../comphelper/source/misc/accessiblecomponenthelper.cxx:61 #3 0x00007ffff6674aeb in cppu::WeakComponentImplHelperBase::dispose() (this=0x55555cecfdf0) at .../cppuhelper/source/implbase.cxx:104 #4 0x00007ffff2ddf0e0 in cppu::PartialWeakComponentImplHelper<com::sun::star::accessibility::XAccessibleContext2, com::sun::star::accessibility::XAccessibleEventBroadcaster>::dispose() (this=0x55555cecfdf0) at .../include/cppuhelper/compbase.hxx:90 #5 0x00007ffff6674834 in cppu::WeakComponentImplHelperBase::release() (this=0x55555cecfdf0) at .../cppuhelper/source/implbase.cxx:79 #6 0x00007ffff2ddf642 in cppu::PartialWeakComponentImplHelper<com::sun::star::accessibility::XAccessibleContext2, com::sun::star::accessibility::XAccessibleEventBroadcaster>::release() (this=0x55555cecfdf0) at .../include/cppuhelper/compbase.hxx:86 #7 0x00007ffff2ddf378 in cppu::ImplInheritanceHelper<comphelper::OCommonAccessibleComponent, com::sun::star::accessibility::XAccessibleComponent>::release() (this=0x55555cecfdf0) at .../include/cppuhelper/implbase.hxx:171 #8 0x00007ffff2ddf0a0 in cppu::ImplInheritanceHelper<comphelper::OAccessibleComponentHelper, com::sun::star::accessibility::XAccessible>::release() (this=0x55555cecfdf0) at .../include/cppuhelper/implbase.hxx:171 #9 0x00007fffe3f29535 in com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleContext>::clear() (this=0x55555d40a010) at .../include/com/sun/star/uno/Reference.hxx:231 #10 0x00007fffe3f288de in atk_object_wrapper_dispose(AtkObjectWrapper*) (wrapper=0x55555d409fa0) at .../vcl/unx/gtk3/a11y/atkwrapper.cxx:1078 #11 0x00007fffe3f27527 in atk_object_wrapper_finalize(GObject*) (obj=0x55555d409fa0) at .../vcl/unx/gtk3/a11y/atkwrapper.cxx:674 #12 0x00007ffff138c48c in g_object_unref () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0 #13 0x00007fffe3f003f7 in AtkListener::~AtkListener() (this=0x55555ce6ecb0, __in_chrg=<optimized out>) at .../vcl/unx/gtk3/a11y/atklistener.cxx:57 #14 0x00007fffe3f0042e in AtkListener::~AtkListener() (this=0x55555ce6ecb0, __in_chrg=<optimized out>) at .../vcl/unx/gtk3/a11y/atklistener.cxx:58 #15 0x00007ffff6756838 in cppu::OWeakObject::release() (this=0x55555ce6ecb0) at .../cppuhelper/source/weak.cxx:230 #16 0x00007fffe3f0a7de in cppu::WeakImplHelper<com::sun::star::accessibility::XAccessibleEventListener>::release() (this=0x55555ce6ecb0) at .../include/cppuhelper/implbase.hxx:115 #17 0x00007ffff6b21b99 in com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>::~Reference() (this=0x55555d40a0c0, __in_chrg=<optimized out>) at .../include/com/sun/star/uno/Reference.hxx:114 #18 0x00007ffff6b217a9 in std::_Destroy<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener> >(com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*) (__pointer=0x55555d40a0c0) at /usr/include/c++/13/bits/stl_construct.h:151 #19 0x00007ffff6b20bcf in std::_Destroy_aux<false>::__destroy<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*>(com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*, com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*) (__first=0x55555d40a0c0, __last=0x55555d40a0c8) at /usr/include/c++/13/bits/stl_construct.h:163 #20 0x00007ffff6b1f105 in std::_Destroy<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*>(com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*, com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*) (__first=0x55555d40a0c0, __last=0x55555d40a0c8) at /usr/include/c++/13/bits/stl_construct.h:196 #21 0x00007ffff6b197aa in std::_Destroy<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*, com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener> >(com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*, com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*, std::allocator<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener> >&) (__last=0x55555d40a0c8, __first=0x55555d40a0c0) at /usr/include/c++/13/bits/alloc_traits.h:947 #22 std::__cxx1998::vector<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>, std::allocator<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener> > >::~vector() (this=0x55555cf22af8, __in_chrg=<optimized out>) at /usr/include/c++/13/bits/stl_vector.h:732 #23 0x00007ffff6b17402 in std::__debug::vector<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>, std::allocator<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener> > >::~vector() (this=0x55555cf22ae0, __in_chrg=<optimized out>) at /usr/include/c++/13/debug/vector:230 #24 0x00007ffff6b1742a in o3tl::cow_wrapper<std::__debug::vector<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>, std::allocator<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener> > >, o3tl::ThreadSafeRefCountingPolicy>::impl_t::~impl_t() (this=0x55555cf22ae0, __in_chrg=<optimized out>) at .../include/o3tl/cow_wrapper.hxx:176 #25 0x00007ffff6b17485 in o3tl::cow_wrapper<std::__debug::vector<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>, std::allocator<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener> > >, o3tl::ThreadSafeRefCountingPolicy>::release() (this=0x55555d40a0b0) at .../include/o3tl/cow_wrapper.hxx:207 #26 0x00007ffff6b15700 in o3tl::cow_wrapper<std::__debug::vector<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>, std::allocator<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener> > >, o3tl::ThreadSafeRefCountingPolicy>::~cow_wrapper() (this=0x55555d40a0b0, __in_chrg=<optimized out>) at .../include/o3tl/cow_wrapper.hxx:271 #27 0x00007ffff6b145b4 in comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener>::~OInterfaceContainerHelper4() (this=0x55555d40a0b0, __in_chrg=<optimized out>) at .../include/comphelper/interfacecontainer4.hxx:126 #28 0x00007ffff6b206c6 in std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> >::~pair() (this=0x55555d40a0a8, __in_chrg=<optimized out>) at /usr/include/c++/13/bits/stl_pair.h:187 #29 0x00007ffff6b1aac4 in std::__new_allocator<std::__detail::_Hash_node<std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> >, false> >::destroy<std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> > >(std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> >*) (__p=0x55555d40a0a8, this=0x7ffff6f64988 <(anonymous namespace)::gaClients+40>) at /usr/include/c++/13/bits/new_allocator.h:194 #30 std::allocator_traits<std::allocator<std::__detail::_Hash_node<std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> >, false> > >::destroy<std::pair<unsigned i--Type <RET> for more, q to quit, c to continue without paging-- nt const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> > >(std::allocator<std::__detail::_Hash_node<std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> >, false> >&, std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> >*) (__p=0x55555d40a0a8, __a=...) at /usr/include/c++/13/bits/alloc_traits.h:557 #31 std::__detail::_Hashtable_alloc<std::allocator<std::__detail::_Hash_node<std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> >, false> > >::_M_deallocate_node(std::__detail::_Hash_node<std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> >, false>*) (this=0x7ffff6f64988 <(anonymous namespace)::gaClients+40>, __n=0x55555d40a0a0) at /usr/include/c++/13/bits/hashtable_policy.h:2020 #32 0x00007ffff6b188b7 in std::__detail::_Hashtable_alloc<std::allocator<std::__detail::_Hash_node<std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> >, false> > >::_M_deallocate_nodes(std::__detail::_Hash_node<std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> >, false>*) (this=0x7ffff6f64988 <(anonymous namespace)::gaClients+40>, __n=0x55555d409ef0) at /usr/include/c++/13/bits/hashtable_policy.h:2042 #33 0x00007ffff6b164e6 in std::_Hashtable<unsigned int, std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> >, std::allocator<std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> > >, std::__detail::_Select1st, std::equal_to<unsigned int>, std::hash<unsigned int>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, false, true> >::clear() (this=0x7ffff6f64988 <(anonymous namespace)::gaClients+40>) at /usr/include/c++/13/bits/hashtable.h:2509 #34 0x00007ffff6b187cc in std::__cxx1998::unordered_map<unsigned int, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener>, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> > > >::clear() (this=0x7ffff6f64988 <(anonymous namespace)::gaClients+40>) at /usr/include/c++/13/bits/unordered_map.h:798 #35 0x00007ffff6b164a0 in std::__debug::unordered_map<unsigned int, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener>, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> > > >::clear() (this=0x7ffff6f64960 <(anonymous namespace)::gaClients>) at /usr/include/c++/13/debug/unordered_map:234 #36 0x00007ffff6b14151 in comphelper::AccessibleEventNotifier::shutdown() () at .../comphelper/source/misc/accessibleeventnotifier.cxx:268 #37 0x00007fffee53fa20 in DeInitVCL() () at .../vcl/source/app/svmain.cxx:594 #38 0x00007fffee53e227 in ImplSVMain() () at .../vcl/source/app/svmain.cxx:229 #39 0x00007fffee53e283 in SVMain() () at .../vcl/source/app/svmain.cxx:236 #40 0x00007ffff7a9f51d in soffice_main() () at .../desktop/source/app/sofficemain.cxx:94 #41 0x00005555555549d4 in sal_main () at .../desktop/source/app/main.c:51 #42 0x00005555555549ba in main (argc=2, argv=0x7fffffffd8e8) at .../desktop/source/app/main.c:49 Change-Id: I22c665f3c41624f4916b956ea266ff1d39fbe507 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155848 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-08-18Add dots to "Fix" button to indicate it opens a dialogSamuel Mehrbrodt
Change-Id: Ibafcd3998396f4d763faad4296c3f7355cd90cf1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155718 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
2023-08-18use more Reference::query instead of UNO_QUERY_THROWNoel Grandin
since querying with exceptions is consideably more expensive Change-Id: I968a9a40766b2abb0d3058549b0ed44011fd5716 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155791 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-08-18ITEM: preparations for more/easier changesArmin Le Grand (allotropia)
This change is not about speed improvements but diverse preparations to make changes/reading/understanding easier. It does not change speed AFAIK. Added a global static debug-only counter to allow getting an overview over number of all allocated SfxPoolItem's and the still alloated ones at office shutdown. The values are used in Application::~Application to make a short info statement. It allows to be able to quickly detect if an error in future changes may lead to memory losses - these would show in dramaitically higher numbers then (hopefully) immediately. Moved SfxVoidItem to own source/header. Added container library interface support to SfxItemSet, adapted already some methods to use it - not all possible, I will commit & get status from gerrit 1st if all still works and then continue. Changed INVALID_POOL_ITEM from -1 to use a global unique incarnation of an isolated derivation from SfxPoolItem. It allows to avoid the (-1) pointer hack. Since still just pointers are compared it's not worse. NOTE: That way, more 'special' SfxPoolItem's may be used for more States - a candidate is e.g. SfxVoidItem(0) which represents ::DISABLED state -- unfortunately not only, it is also used (mainly for UI stuff) with 'real' WhichIDs - hard to sort out, will have to stay that way for now AFAIK. Changed INVALID_POOL_ITEM stuff to use a static extern incarnated item in combination with a inline method to return it, called GetGlobalStaticInvalidItemInstance(). Isolated create/cleanup of a SfxPoolItem entry in SfxItemSet to further modularize/simplify that. It is currently from constructor & destructor but already shows that PoolDefaults are handled differently - probably an error. Still, for now, do no change in behaviour (yet). Got regular 'killed by the Kill-Wrapper' messages from gerrit, seems to have to do with UITest_sw_findReplace. That python/c++ scripting stuff is hard to debug, but finally I identified the problem has to do with the INVALID_POOL_ITEM change. It was in SfxItemSet::InvalidateAllItems() where still a (-1) was used -> chaos in detecting invalid items. Change-Id: I595e1f25ab660c35c4f2d19c233d1dfadfe25214 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155675 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-08-15ComplexColor various clean-up and (trivial) refactoringsTomaž Vajngerl
Don't allow access to member variables of ComplexColor and makes them private. Needs a lot of changes. Change "scheme" to "theme" to be more consistent. In LO we usually call the "theme color" what is usually refered to as "scheme color" in OOXML, where it is sometimes refered to as "scheme" and other times as theme color. Remove ThemeColor class which was replaced with CmplexColor some time ago. Remove un-needed includes and un-needed components. Use isValidThemeColor in many places where we check that the ComplexColor is of "Theme" type and that ThemeColorType is set to a valid value. Change-Id: I325595fa65b8e56a4707e9d22acc6330aac28961 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155359 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-08-11autorecovery: DLG_RET_OK_AUTOLUNCH => DLG_RET_OK_AUTOLAUNCHJustin Luth
Change-Id: I3f1436fa1b8ff5b34c65b103b0dd26dffc0e558d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155566 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2023-08-10tdf#156630 eliminate opaque parts when drawing animated PNG imagesPatrick Luby
Due to the switch from transparency to alpha in commit 81994cb2b8b32453a92bcb011830fcb884f22ff3, flip the background colors for the VirtualDevices and invert an alpha mask. On macOS, with Skia/Raster with a Retina display (i.e. 2.0 window scale), the alpha mask gets upscaled. Also, when Skia is enabled, the alpha mask gets inverted in the first export to PDF after launching the application. These two bugs appear to be caused by asynchronous rendering of the returned bitmap. So, we force a copy of the alpha mask in case it changes before the bitmap is actually drawn. Lastly, respect system animation settings when determining if the image should be animated. Change-Id: I8144691a6c99bf8361b301b88d22172991463f26 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155429 Tested-by: Jenkins Reviewed-by: Patrick Luby <plubius@neooffice.org>
2023-08-07ITEM: speedup WhichRanges access by bufferingArmin Le Grand (allotropia)
I checked for was to speedup SfxItemSet stuff, so had (besides other things) a look at WhichRangesContainer and it's usage(s). Problem with the WhichRanges is that a WhichID which you try to find is usually inside that range, so binary search is no option. You have to detect in which range the WhichID is hosted and can the directly calculate the index into the array of Items at the SfxtemSet. Currently when needing to transform a WhichID to an index into the array of Items in SfxItemSet the array of the WhichRangesContainer is searched linearly from the start every time. This can be a little bit speed up by buffering the last successful 'hit' and trying to re-use it. Also the special case of a single WhichPair (e.g. UI stuff) is worth having a look. All acesses to that transformation are changed to use the tooling method getOffsetFromWhich() at the WhichRangesContainer which does the transformation. This also needed cleanup of ItemOffsetHint instances & stuff around it. It does not more than before but also profits from the single entry buffer. I added some DBG_UTIL-based stuff to watch the hit/miss ratio, which is heavily changing from app to app & usage, but varies around 1.5 to 3.5, also saw 6.5 and more at document import. NOTE: I already checked if sorting the WhichPair(s) in WhichRangesContainer by their 'width' (highest WhichID mnius lowest WhichID helps. The idea was when the Items would be used in a regular manner that when having the widest WhichPairs at the start, the buffer would even be better used - but doing tests in all apps shows nearly no gain, so I left that out. NOTE: Not too much speedup, but faster... Had to deep-debug due to CppunitTest_sw_odfexport failing, found a slight diff between GetItemState impls, corrected. Also added more changes, e.g. TotalCount is now a member to not always have to calculate it from the WhichRangesContainer. Extended GetWhichByPos to 1st try to find a set Item, else iterate over WhichRangesContainer. This is due to SfxItemIter's implementations of GetItemState and ClearItem which both up to now just accessed the SfxPoolItem array of the SfxItemSet, ignoring that no Item (nullptr) or state DONTCARE (-1) may have been set there (no item is prevented by ite Iterator, but better be careful). Added WhichRangesContainer::getWhichFromOffset and made SfxItemSet::GetWhichByOffset use it. Addedd optimizations there for single-entry WhichPair and using the buffer at WhichRangesContainer which is possible. Removed debug comparing stuff (had a test that used the former adapted GetItemStateImpl method in SfxItemSet::GetItemState and compared with the changed GetItemState_ForWhichID). Added some comments and assertions where useful. Made ClearSingleItem_ForOffset work without handing over WhichID, that makes calls using it simpler and avoids calculating the WhichID just for that call. Change-Id: I54de552368b654f00f115978715f8241eb603752 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155316 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-08-07tdf#156629 Font,highlighting color buttons in sidebar have white background...Noel Grandin
..after transparency -> alpha change regression from commit 81994cb2b8b32453a92bcb011830fcb884f22ff3 Author: Noel Grandin Date: Fri Apr 16 20:33:10 2021 +0200 Convert internal vcl bitmap formats transparency->alpha (II) Change-Id: Id1a578fcd30a9315fd5910ccdbff5d759cba77fa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155425 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-08-07svx: prefix members of SdrEdgeInfoRecMiklos Vajna
See tdf#94879 for motivation. Change-Id: Ia1f0f7016217f17d45e863484bdb176e7d47a594 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155389 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2023-08-06tdf#145606 autorecover: skip "Finish" button if all recovered OK.Justin Luth
Change-Id: I59036b98b33d85305b13430113a3a3d399dea27d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155379 Reviewed-by: Justin Luth <jluth@mail.com> Tested-by: Jenkins
2023-08-03Related: cool#6911 opt to skip SdrObject::GetViewContent() when possibleCaolán McNamara
as seen in: https://user-images.githubusercontent.com/122848/253732636-3dfeddad-f146-4268-bde5-85788b72d539.svg SdrPageView::DrawLayer takes ~11% of the time when scrolling with many comments in calc, but none of these comments actually get drawn, all this effort is to find that they are not to be drawn. optimize ViewContactOfPageHierarchy impl over its parent impl to skip SdrObject::GetViewContent(), etc if the SdrObject isn't shown on the target layer. ViewObjectContactOfSdrobject::getPrimitive2DSequenceHierarchy does the same check, but after a set of allocations which is expensive in the case of SdrCaptions in a calc internal layer where there can be thousands of such objects. Change-Id: Iad86c77e8fa71ec90f54ce06d5a27c0380fb03ab Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155269 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-08-03Related: cool#6911 refactor for an optimizationCaolán McNamara
no change intended here Change-Id: I34b72776b1a05979fbe3a02ff1548b6aa8a183df Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155268 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-08-03tdf#153102: use given RedrawArea in DoProcessDisplayArmin Le Grand (allotropia)
In ObjectContactOfPageView::DoProcessDisplay someone changed (seven years ago) to ignore the given RedrawArea if comphelper::LibreOfficeKit::isActive(). Using and setting that RedrawArea is needed to get the visual clipping against e.g. PageBounds in Writer paint working. Adding that again. Change-Id: If628039379c2756aac8865c3632e37c19993d0da Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155262 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2023-08-02Prevent to open multiple Theme Color Edit dialogGülşah Köse
When we do super fast clicks to Add button prevent to open multiple dialog. Follow-up commit e73b2bc4e6fdaba3098fa2c701342e1df112514c Signed-off-by: Gülşah Köse <gulsah.kose@collabora.com> Change-Id: If40c4982b873d41984bea298284eae062742b057 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155083 Tested-by: Jenkins
2023-08-02split Point/Size/Rectangle into AbsoluteScreenPixel* typesNoel Grandin
to attempt to make it obvious in code what kind of coordinate system we are dealing with. The idea is that by doing this, the compile-time type checking will flush out inconsistencies between different code. I started with vcl::Window::OutputToAbsoluteScreenPixel and worked outwards from there. Change-Id: Ia967d7a0bb38886695f3a761b85c8b9340ddb1c0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154676 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-08-02Add translator comment to clarify meaning of the Fix buttonGabor Kelemen
Change-Id: I9e792bb27523a2daf6afca00ad1c210e6b274573 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155087 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2023-08-01Revert "tdf#144072 prevent use of a deleted pointer"Patrick Luby
This reverts commit 01a1d2a84992973b8a0e5f1ae99fd32f5913b58f. That commit appeared to fix tdf#144072 but it only delays the crash as the reportdesign module will keep reusing the same SdHdl pointer that has already been deleted. Change-Id: I8e416b0376aa8724b697f54ed45f58341b47dc2a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155181 Tested-by: Patrick Luby <plubius@neooffice.org> Reviewed-by: Patrick Luby <plubius@neooffice.org>
2023-08-01tdf#144072 prevent use of a deleted pointerPatrick Luby
BegDragObj_createInvisibleObjectAtPosition() may clear the handle list and that will delete the SdrHdl instances owned by this section view so set _pHdl to null if it has been deleted during the call. Change-Id: I89606958f8a76a2c35685d1aff6b0159739a464a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155119 Tested-by: Jenkins Reviewed-by: Patrick Luby <plubius@neooffice.org>
2023-07-31svx: prefix members of E3dVolumeMarker, ImpEdgeHdl, NameOrIndex and ...Miklos Vajna
... SdrObjUserData See tdf#94879 for motivation. Change-Id: I4d330b0f8e08a3bdfc2c256c2ee86ac584947fc0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155080 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2023-07-28Resolves tdf#156504 - Strings in media player made translatableHeiko Tietze
Change-Id: I2798d0becf7075bd0f484b4e96b44fa29c551415 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155013 Tested-by: Jenkins Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
2023-07-28make the themeeditdialog and themedialog ui modalCaolán McNamara
doesn't affect that they are run async Change-Id: I7336e64258f5042ee80acb7295b1ed7370be54b8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154992 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-07-28SfxMedium::GetItemSet never returns nullptrMike Kaganski
Change-Id: Ibfc98a49022aa09ebf5315e5d3328308c1e51d66 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154997 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-07-27gtk: silence gtk_label_set_label: assertion 'GTK_IS_LABEL (label)' failedCaolán McNamara
Change-Id: I7c6a4add9fe11ed123ce81302998ad246538c7fb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154991 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-07-26tdf#151902 Doc themes - place Help button on the leftOlivier Hallot
This patch places the Help button of the 2 dialogs on the left Change-Id: I11bc0c220fa15fd78dbd789d71f5f0268f08d089 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154942 Tested-by: Jenkins Reviewed-by: Olivier Hallot <olivier.hallot@libreoffice.org>
2023-07-26Resolves: tdf#156411 listen to "value-changed" not "changed"Caolán McNamara
we were listening to "changed" and querying the "value", but the value isn't guaranteed to have changed while the contents are being edited, only when "value-changed" arrives. Change-Id: I077051555813df48adae4259aa9a93d39c360dc3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154907 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-07-26Related: tdf#156137 allow GtkLinkButton to wrapCaolán McNamara
Change-Id: I00ca5a9056b64389f1d55aa8ca6a9d5fd8a16372 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154899 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-07-25Revert "tdf#156137 - A11Y - Fix Long object names need to proper handling"Thorsten Behrens
This reverts commit d89dc4ac09d3c2bd55174f09485173057cc1403b. Reason for revert: GtkLinkButton.wrap is not available for native gtk widgets. Change-Id: Ie1634691996fb6d54b69013a585914d123d5e195 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154913 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2023-07-25Convert internal vcl bitmap formats transparency->alpha (II)Noel Grandin
(Second attempt at landing this) Image formats and graphics APIs use alpha, not transparency, so change our internal formats and data structures to work directly with alpha, so we don't need to modify data before we push it to graphics APIs. Add a couple of new Color constants to make the intention of the vcl code clearer. Notes (*) On macOS, tweaking the logic in CreateWithSalBitmapAndMask to more accurately reflect the requirements of the CGImageCreateWithMask function seems to fix some tests. (*) The vcl code does not properly support gradients with transparency. So the previous code was wrong, and this change is going to result in slightly different wrongness. Change-Id: I9e21c2e98d88ecfdc5f75db13bd1ffff7c38db98 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114168 Tested-by: Jenkins Reviewed-by: Patrick Luby <plubius@neooffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-07-24fix COOL crash in theme dialogNoel Grandin
==3975==ERROR: AddressSanitizer: heap-use-after-free /opt/collaboraoffice/program/libmergedlo.so std::vector<model::ColorSet, std::allocator<model::ColorSet> >::clear() /home/collabora/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 /opt/collaboraoffice/program/libmergedlo.so operator() /home/collabora/online-buildscripts/staging/builddir/libreoffice/svx/source/dialog/ThemeDialog.cxx:96 /opt/collaboraoffice/program/libmergedlo.so std::function<void (int)>::operator()(int) const /home/collabora/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/std_function.h:706 /opt/collaboraoffice/program/libmergedlo.so Dialog::EndDialog(long) /home/collabora/online-buildscripts/staging/builddir/libreoffice/vcl/source/window/dialog.cxx:1192 /opt/collaboraoffice/program/libmergedlo.so jsdialog::ExecuteAction(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, rtl::OString const&, std::map<rtl::OUString, rtl::OUString, std::less<rtl::OUString>, std::allocator<std::pair<rtl::OUString const, rtl::OUString> > >&) /home/collabora/online-buildscripts/staging/builddir/libreoffice/vcl/jsdialog/executor.cxx:566 /opt/collaboraoffice/program/libmergedlo.so lcl_sendDialogEvent(unsigned long long, char const*) /home/collabora/online-buildscripts/staging/builddir/libreoffice/desktop/source/lib/init.cxx:4735 /usr/bin/coolforkit lok::Document::sendDialogEvent(unsigned long long, char const*) /home/collabora/online-buildscripts/staging/builddir/libreoffice/include/LibreOfficeKit/LibreOfficeKit.hxx:323 /usr/bin/coolforkit Change-Id: I7b34c9649c96f6745c2230ac347644fb45ec7f6e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154836 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> (cherry picked from commit 2ee535bfdb089511261daff20e515714ed2c0563) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154851 Tested-by: Jenkins
2023-07-23tdf#154038 tdf#83618 fix wrong line spacing valueJim Raykowski
Impress and Writer seem to require different MapUnit values for fixed line spacing metric values to be correctly calculated. This patch initially sets the MapUnit unit value to Map100thMM, which is what it was before commit 849b837d1a3b185a8dd893a8f6eaed53605bcab1, which works for Impress. For Writer, the value is set to MapTwip. Change-Id: I49e9b80aa4d3fbda1f19101903d2a4459089024c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154665 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
2023-07-23tdf#156234: Don’t round glyph coordinates when doing subpixel positioningKhaled Hosny
When doing subpixel positioning (i.e. OutputDevice is in map mode), delay the rounding of the glyph coordinates after converting from pixel to logical units to minimize the loss of precision as much as possible. Some test expectations, expectedly, changes due to the improved positioning precision. Change-Id: I2591e3c7d4923ba7886a35bf53db759273354e24 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154292 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-07-22tdf#156137 - A11Y - Fix Long object names need to proper handlingBalazs Varga
Add text wrap option (long names ends with '...') for in case of proper handling of long GOTO GtkLinkButton objects in case of accessibility sidebar. Change-Id: I3c4af522fc34289ca57b1a7878134c34353bbc47 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154726 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>