summaryrefslogtreecommitdiff
path: root/sfx2/source/dialog/templdlg.cxx
AgeCommit message (Collapse)Author
2024-05-10loplugin:ostr in sfx2Noel Grandin
Change-Id: I6306260d03c1208ec250c2f9a3860fa569f6d9c8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167448 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-05-01WaE: C6011 Dereferencing NULL pointer warningsCaolán McNamara
Change-Id: Ic2231df89b900c17beac4627e3573b45aef0bc26 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166954 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-28Added boolean op's to SfxPoolItemHolderArmin Le Grand (allotropia)
...and adapted code to make use of it. This makes checking if the SfxPoolItemHolder instance contains an Item or not simpler and thus more readable, no need to access the Item* every time using getItem() - is okay, but not intuitive. Change-Id: I8042267cce670aca2641a91cd36285058f17ffbb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161380 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-12-21Remove DeleteItemOnIdlexArmin Le Grand (allotropia)
There are some CrashReports in 7.6 which have DeleteItemOnIdle on the stack, but there is nothing reproducable. So I took a look... I first thought it's a MCGR regression, due to classes on the stack. But the Item involved is just random, can happen with any Item. Then I thought it may have to do with ITEM refactorings, but it happens with DeleteItemOnIdle involved, so also not the case. I already saw DeleteItemOnIdle when doing these and qualified as 'hack' in the way. already It is only on Windows and DeleteItemOnIdle is involved. This again (took a deeper look now) is an old hack to keep an SfxPoolItem 'alive' for some 'time'. For that, it triggers an async reschedule which then deletes the Item when being called. If the Item will be used after that is pure coincidence - seems to work in most cases. It seems as if for Windows the timing slightly changed for some scenarios, so a reschedule is too early. This can happen with this hack anytime. DeleteItemOnIdle is used in scenarios where SfxPoolItem* is e.g. returned, but is *not* anchored, so e.g. not member of an SfxItemSet. Or in short: Lifetime is not safe. DeleteItemOnIdle exists since 1st import, but was changed to AsyncEvent ca. 4 months ago (see 57145acf9ec47c23e307b7a5c0029d21d937cc35), so that may have caused it. It is possible that these errors happen on Windows since then. Before something more complicated was used to delete it late, but surely also not really safe. Due to ITEM refactor I have the knowledge/tooling to solve this. It will not be a 1-5 lines fix, but it is a hack and in the way for further ITEM refactor anyways. What we have nowadays is a SfxPoolItemHolder -> it's like an SfxItemSet for a single Item. It safely holds/ controls the lifetime of an SfxPoolItem. It is already used in quite some places. It helps to solve many hacks, also the ones putting Items directly to the Pool - due to there never was an alternative for that. In principle the ItemPool/ItemSet/Item paradigm was never complete without SfxPoolItemHolder. Thus I started to fix that (and remove that hack for good, sooo many changes over the years, sigh), but as said is not straightforward. Will have to change retvals of involved stuff to SfxPoolItemHolder - it's just two pointers and designed to be copied (one is a Pool, needed to cleanup when destructing). CopyConstruct/destroy just counts the RefCnt up/down, so cheap. 1st version compiling, let's check on gerrit... Corrected one error in QueryState for securitypage, also added some security features/asserts. Change-Id: Ida49fd35ca88ead84b11d93e18b978cb9e395090 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161083 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-10-18tdf#156114 UNO commands / menu entries to enable PS/CS spotlightJim Raykowski
Change-Id: I2796b595ef961c477dea85c337ad343599aea7cf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158055 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
2023-07-05loplugin:constantparamNoel Grandin
Change-Id: I1925234e3f82adfa1f82755e9cef7e3e3bc00d04 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153981 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-04-25tdf#38194 tdf#106556 Enhancement to highlight direct formatting,Jim Raykowski
paragraph style, and character style use in Writer documents Initial commit to realize direct formatting, paragraph style, and character style highlighting enhancement requests. Highlighting of character direct formatting is turned on/off using .uno:HighlightCharDF. Highlighting of paragraph styles and character styles is turned on/off using a check box in the Sidebar Styles panel. Closing the Sidebar also turns paragraph and character style highlighting off. Paragraph direct formatting is indicated by a hatch pattern over the paragraph style highlight bar and also by "+ Paragraph Direct Formatting" appended to the tooltip that appears showing the name of the paragraph style when the mouse pointer is over the style highlight bar. Colors used for styles highlighting are determined by a hash of the style name. Lightgray is used for character direct formatting. Known issue: Tooltip doesn't show for paragraph style highlighting in tables and in frames where the highlighting bar is drawn outside of the frame. Change-Id: I6e00ee38c1c169bc7c6542a1782c03b2593e1891 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150451 Tested-by: Jenkins Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
2023-04-02Avoid conversions between OUString and OString in VCLMike Kaganski
Standardize on OUString, which is the main internal string class. Convert from/to OUString only when communicating with respective external APIs. Removes about 200 conversions from the code. Change-Id: I96ecee7c6fd271bb76639220e96d69d2964bed26 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149930 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-11-22loplugin:unusedfieldsNoel Grandin
Change-Id: I4a7276ffc36b4f954fe1fa39fb5666fa184e66e1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143016 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-10-25Address a constexpr template point of instantiation issueStephan Bergmann
...that hits at least when building with Clang and --with-latest-c++ against recent libc++ or MSVC standard library (where C++20 and esp. C++23 made more and more class template member functions constexpr). My understanding is that there is some leeway at what point a compiler should instantiate such function specializations, and Clang decides to instantiate constexpr ones early (cf. <https://github.com/llvm/llvm-project/commit/242ad89a15d5466d166d47978bfff983d40ab511> "C++11 half of r147023: In C++11, additionally eagerly instantiate:" and its "Do not defer instantiations of constexpr functions" comment, and the discussion at <https://discourse.llvm.org/t/point-of-instantiation-of-constexpr-function-template/65129>). > In file included from sfx2/source/dialog/templdlg.cxx:20: > In file included from ~/llvm/inst/bin/../include/c++/v1/memory:881: > In file included from ~/llvm/inst/bin/../include/c++/v1/__memory/shared_ptr.h:30: > ~/llvm/inst/bin/../include/c++/v1/__memory/unique_ptr.h:47:19: error: invalid application of 'sizeof' to an incomplete type 'ToolbarDropTarget' > static_assert(sizeof(_Tp) >= 0, "cannot delete an incomplete type"); > ^~~~~~~~~~~ > ~/llvm/inst/bin/../include/c++/v1/__memory/unique_ptr.h:281:7: note: in instantiation of member function 'std::default_delete<ToolbarDropTarget>::operator()' requested here > __ptr_.second()(__tmp); > ^ > ~/llvm/inst/bin/../include/c++/v1/__memory/unique_ptr.h:247:75: note: in instantiation of member function 'std::unique_ptr<ToolbarDropTarget>::reset' requested here > _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 ~unique_ptr() { reset(); } > ^ > sfx2/source/dialog/templdlg.cxx:665:25: note: in instantiation of member function 'std::unique_ptr<ToolbarDropTarget>::~unique_ptr' requested here > SfxTemplateDialog_Impl::SfxTemplateDialog_Impl(SfxBindings* pB, SfxTemplatePanelControl* pDlgWindow) > ^ > sfx2/source/inc/templdgi.hxx:198:7: note: forward declaration of 'ToolbarDropTarget' > class ToolbarDropTarget; > ^ Change-Id: I360f35e01e301bca6fa801a889b6d107f67faf15 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141818 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-08-18Move tools/diagnose_ex.h to comphelper/diagnose_ex.hxxStephan Bergmann
...so that its TOOLS_WARN_EXCEPTION can be used in comphelper/source/misc/logging.cxx in a follow-up commit. (And while at it, rename from diangose_ex.h to the more appropriate diagnose_ex.hxx. The comphelper module is sufficiently low-level for this immediate use case, so use that at least for now; o3tl might be even more suitable but doesn't have a Library until now. Also, for the immediate use case it would have sufficed to only break DbgGetCaughtException, exceptionToString, TOOLS_WARN_EXCEPTION, TOOLS_WARN_EXCEPTION_IF, and TOOLS_INFO_EXCEPTION out of include/tools/diagnose_ex.h into an additional new include/comphelper/diagnose_ex.hxx, but its probably easier overall to just move the complete include file as is.) Change-Id: I9f3222d4ccf1a9ac29d7eb9ba1530d53e2affaee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138451 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-04Just use Any ctor instead of makeAny in sfx2Stephan Bergmann
Change-Id: Ie707881d6f4cd4a2f92f4f5a89aa9e0b051db8a7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133783 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-03-24loplugin:constantparamNoel Grandin
Change-Id: I86592be0717c062a918108bf4437074b0f70b372 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132029 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-03-01Recheck modules s[f-t]* with IWYUGabor Kelemen
See tdf#42949 for motivation Change-Id: I1f520aad1b1c942ad5616d96851016fc366ac58f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130203 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-12-07loplugin:unusedfieldsNoel Grandin
Change-Id: Id39c3f484a364fb5163444febe99aee79daf1a76 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126418 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-26tdf#145814 fill format mode is mostly disabledCaolán McNamara
when it shouldn't Change-Id: Ic282c313a6986d7d08f54b475c5d2ce32098ada1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125851 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-10-31Prepare for removal of non-const operator[] from Sequence in sfx2Mike Kaganski
Change-Id: I0cdce64983901a6cc3b50dc9873a370ff08b9eb2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124387 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-09-30loplugin:constparams improve handling of pointer paramsNoel Grandin
Change-Id: I4c0002e72703eded435bfe4985f5b0121bf8524b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122843 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-24Refactoring PatchAnshu
Change-Id: Ia1fbc8cbdb1e055273e0a9058e11b43b4e0ac62f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120849 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-08-20loplugin:unusedmethodsNoel Grandin
Change-Id: I9ce1ae787b735200cd57b0f470a6e5e3146657fc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120777 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-20loplugin:unusedfieldsNoel Grandin
Change-Id: Ie27afe4c2438c44baece4b926572584c6695dc39 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120774 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-18loplugin:constparamsNoel Grandin
Change-Id: Ic7410f836e584df45101e78e345c8b3c8d355e09 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120680 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-17RefactoringAnshu
Change-Id: I0863c4afb5dfce549dbcbdae4b8a63068e5d7331 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119878 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-07-31cid#1489714 Unused valueCaolán McNamara
Change-Id: I265946afb52e20f0eac0348fdb692b6e38f0f90a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119763 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-07-30tdf#38194 related: introduce StylesList controlAnshu
Change-Id: I31202c213e034ab96f28e16d1f6a59b52f47507d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117918 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-05-28no need to allocate SfxStyleFamilies on the heapNoel Grandin
Change-Id: Ibedb36dec14c61927ef594ddf47fda94728530a8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116319 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-21add Toggleable as a separate thing to a ButtonCaolán McNamara
and inherit ToggleButton from both it and Button Change-Id: If0e500aca8d0ffa087cb5e2bfc1786372fbff4eb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115921 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-05-19use toggle instead of click for ToggleButtonCaolán McNamara
Change-Id: I8a1c6620cf009807cc43766b0cc972523e87e9c6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115811 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-04-27loplugin:stringadd convert chained append to +Noel Grandin
which can use the more efficient *StringConcat Also fix a crash in stringview plugin which started happening while I working on this. Change-Id: I91a5b9b7707d1594d27d80b73930f5afac8ae608 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114568 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-03-29tdf#101965 : Add No List default in Styles deck in sidebarAnshu
Change-Id: I167b379f31809bc252d3c091d0f545f8c2a3f13e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112143 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com> Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-03-11remove intermediate containers in sidebarsCaolán McNamara
tested extension sidebars of: a) Wollmux extension sidebars b) Analog Clock Extension demo https://wiki.openoffice.org/wiki/Sidebar_for_Developers#Example:_Analog_Clock_Extension Change-Id: If9729e20526681928137989f01a8ae733a9b0cb5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112035 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-02-16tdf#140387 grab focus to first panel widget on panel gaining focusCaolán McNamara
otherwise focus is getting lost in these currently mixed vcl+gtk widget panels. Change-Id: I6488ddfc98afdedb55bb3217f3877e96258dd65a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110955 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-12-01tdf#42949 Fix new IWYU warnings in directories s*Gabor Kelemen
Except recently checked sc, sd, svx, sw Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Ice1b86628e4f22a39f307b9c5fa567b6ab9d5acb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106917 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-12-01OSL_FAIL.*exception -> TOOLS_WARN_EXCEPTIONNoel
Change-Id: I6800e23ead2767d245d5da71d2d40e0f8a6d7e1f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106859 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-24loplugin:stringviewparam extend to comparison operatorsNoel
which means that some call sites have to change to use unicode string literals i.e. u"foo" instead of "foo" Change-Id: Ie51c3adf56d343dd1d1710777f9d2a43ee66221c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106125 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-11loplugin:stringviewNoel
Add new methods "subView" to O(U)String to return substring views of the underlying data. Add a clang plugin to warn when replacing existing calls to copy() would be better to use subView(). Change-Id: I03a5732431ce60808946f2ce2c923b22845689ca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105420 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-10-29tdf#137754 Crash in styles tree in sidebar in impressNoel Grandin
this is a timing bug - easier to hit on a slow machine, or with a debug build - it happens when mouse movement triggers a request for a tooltip in the tree, but the tree is in a transition state. Change-Id: Ibed7ffd01483b26f2debb1aa9cc99e23b38ba950 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105025 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-10-06loplugin:const& make some params and methods constNoel
Change-Id: I2973128a9c6c53187e1da400d1a5df763d515596 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104020 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-09-17factor out the special FmtSelect with nullptr arg caseCaolán McNamara
as its own separate thing Change-Id: If7d576f9617e76d530f74d36a033431a1f2b0c7b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102919 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-17tdf#134598 call FmtSelect to update watercanCaolán McNamara
Change-Id: Idd88acfdaac66b999b0bcd8cf0a4fe69f7ae6ac5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102917 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-02remove SfxCommonTemplateDialog_Impl vcl::Window memberCaolán McNamara
Change-Id: Ib1ab0e76cb56c909f1e16f58b61ce29d1a70a893 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101911 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-08-14loplugin:simplifybool moreNoel Grandin
look for expressions like !(a && !b) which can be expanded out Change-Id: I72515a9638762b050f9a258c08da39ebfa2ef8e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100579 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-06-18distinguish active dnd-operation case from simple query caseCaolán McNamara
Change-Id: I1d8e95e46b45c71c0c83316ab4f19ba85eddcf75 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96598 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-06-05have just one way to set expander imageCaolán McNamara
Change-Id: Ic07709a864620c6146616c8e0a1417343c0937de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95590 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-05-27Related: tdf#133385 set cursor in row on right clickCaolán McNamara
if the target row is not already selected Change-Id: I7cb39118f4a695546d8d2251390d6d3279e82bc3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94947 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-05-26make highlight of get_dest_row_at_pos optionalCaolán McNamara
Change-Id: I280e1a49e938f45402f373896669fd6f7e8a66fc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94876 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-05-22Resolves: tdf#133183 select style under mouse on right click context menuCaolán McNamara
Change-Id: I4317f6702b7a0e172d059fe83614aab94845b201 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94690 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-05-22Resolves: tdf#133180 use full width of canvas for preview renderCaolán McNamara
Change-Id: I1fa3f0fd8505712155c72c25b67da1ab6d4753e4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94660 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-05-21drop some unnecessary includesCaolán McNamara
Change-Id: Idf507ea5a9790bf54ef98ed4f0cc89e2c01cc8eb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94606 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-05-14loplugin:unusedfieldsNoel Grandin
Change-Id: I0ec89b56b339f26bb236887c904e6b5d14ceecea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94136 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>