110 Commits
Author SHA1 Message Date
Michael Weghorn dd26d06b7c sfx2: Return concrete type in SfxObjectShell::GetBaseModel
Instead of returning a reference to the abstract
XModel3 interface, return the more concrete
SfxBaseModel.

Drop some now unnecessary casting/UNO querying in callers.

More simplification to avoid UNO querying elsewhere
will follow in upcoming commits.

Change-Id: I05ad3a4bccfb080ccbee3af956451def3bcc94fc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211053
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2026-09-17 14:51:31 +02:00
Michael Weghorn a92113ba34 sfx2 devtools: Switch DocumentModelTreeHandler::mxDocument to XModel3
Use the XModel3 interface instead of only the very
basic XInterface base interface for the document
as the object that is passed is known to implement
this more specific interface.

The DevelopmentToolDockingWindow ctor passes the
result of calling SfxObjectShell::GetBaseModel
(which returns XModel3) for the param.

This also prepares for switching the return type
of SfxObjectShell::GetBaseModel to a reference of
the concrete SfxBaseModel in an upcoming commit (without
introducing ambiguity due to multi-inheritance from
XInterface in places using only an XInterface
reference).

Change-Id: I61f531caea266286fe51b5231c13f56e5b9d82b8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211050
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-09-17 14:51:07 +02:00
Michael Weghorn a81cc28ba6 sfx2: Pass SfxDockingWindow's SfxBindings param by ref
With the refactoring from previous commits in place, it's
clear that all callers pass a non-null SfxBindings*
param.
Switch the param to a reference, to make that clear
and prepare for further refactoring.

Change-Id: Id9f1487dba4b84860f9afa52ff9ffb4dd7b1d2c6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208387
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-07-23 23:21:34 +02:00
Michael Weghorn 552ea86469 sfx2: Pass DevelopmentToolDockingWindow's SfxBindings param by ref
Change-Id: Ie6476b0bbe99612ce544b884b51c222a3b57e25f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208377
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2026-07-23 15:39:23 +02:00
Michael Weghorn 08d5c60a02 sfx2: Pass SfxDockingWindow::Initialize param by ref
With refactoring from previous commits in place, it's
now clear that all callers pass a non-null
SfxChildWinInfo*. Pass by reference instead to make
that clear, which also allows to drop some null
checks.

Change-Id: I39bfe179c68afecf9b7aa209feb69d33e57e5388
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208371
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-07-23 15:38:45 +02:00
Michael Weghorn 2aeb583c16 Switch SfxChildWinCtor's SfxBindings param to ref
Switch the parameter from a pointer to a reference.

The only 2 callers in SfxChildWindow::CreateChildWindow
always pass a non-null param.

Using a reference makes clear that the param is always
non-null and makes clear that those implementations previously
unconditionally dereferencing the pointer were unproblematic.

Change-Id: Ia2b893aac6c94c3b0e1024cc5500da2463bf9996
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208312
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2026-07-23 09:23:23 +02:00
Michael Weghorn 00a19be1dc Switch SfxChildWinCtor's SfxChildWinInfo param to ref
Switch the parameter from a pointer to a reference.

The only 2 callers in SfxChildWindow::CreateChildWindow
always pass a non-null param.

Using a reference makes clear that the param is always
non-null, allows dropping some null checks and makes
clear that those implementations previously unconditionally
dereferencing the pointer were unproblematic.

Change-Id: I6734dfe6fe4fa1cb6aa80f4e67eb69603e8d86fc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208300
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-07-22 07:48:29 +02:00
Michael Weghorn 2dca1c0f02 weld: Rename TreeView *_column_clicked methods to *_column_header_clicked
Rename weld::TreeView::connect_column_clicked
and weld::TreeView::signal_column_clicked to make
clear that they are not about a click anywhere in a
column, but about the column *header* being clicked.

The GTK 4 doc for the corresponding
GtkTreeViewColumn::clicked signal [1] by which the API
was apparently inspired is clear about this:

> Emitted when the column’s header has been clicked.

[1] https://docs.gtk.org/gtk4/signal.TreeViewColumn.clicked.html

Change-Id: I0b4b337b5ca938bb1526d9857ed2b0b244daf23c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207591
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-07-03 22:26:00 +02:00
Michael Weghorn 8b5a46a0e0 weld: Move weld::toId and weld::fromId to weldutils.hxx
In the past, weld.hxx used to contain the class
definitions for weld::Widget and all subclasses,
as well as a few helpers.

By now, weld::Widget and almost all subclasses have
been moved to separate headers, to make it easier
to keep the overview and to avoid having to
recompile ~all UI code when anything in weld.hxx
changes.

Move the weld::toId and weld::fromId helpers from
weld.hxx to weldutils.hxx, in preparation of getting
rid of weld.hxx altogether in an upcomcing commit.

Change-Id: I408fe20a74ff104cbfe07bde3105317a1922ff61
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205936
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-06-04 14:37:13 +02:00
Michael Weghorn 336f70f966 weld: Move weld::Label to own header
Move the class out of weld.hxx into its own header, in
order to make it easier to keep an overview and to avoid
having to recompile ~all UI code when the class is
modified.

Change-Id: Ide86f35543468a88288a068cc9f89eaf381ac52f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205763
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-05-27 22:24:37 +02:00
Michael Weghorn 03d5d803c4 weld: Switch TreeView selection changed signal param to ItemView
Switch the param for the signal and handlers used when
the selection in a weld::TreeView changes from weld::TreeView&
to the base class, weld::ItemView&.

This is in preparation of moving the logic to the weld::ItemView
base class in an upcoming commit.

Handler implementations that require a weld::TreeView
instance can use the one that the signal is connected
to, e.g. use the class member directly inside of the
implementation instead of using the param (as is done
in most of the places anyway).

Change-Id: I0bbf8fe1dbd95906a5224155d48d832bcd144532
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/203366
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-04-10 06:36:08 +02:00
Gabor Kelemen a9e9175ba6 tdf#146619 Use more forward declarations in include/sfx2
This shaves off some 300M of input
Change-Id: I2fae9ff6c6dab31010986e55365676d4a01f402d

Change-Id: I3b2551a1937929100f25c01c0c416a419e7fbb51
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199388
Reviewed-by: Gabor Kelemen <gabor.kelemen@collabora.com>
Tested-by: Jenkins
2026-02-23 12:19:48 +01:00
Michael Weghorn 2866ba3e83 weld: Move weld::Menu to own header
Move the class out of weld.hxx into its own header, in
order to make it easier to keep an overview and to avoid
having to recompile ~all UI code when the class is
modified.

Change-Id: I86edb8abe2178862269f2fc2a1629fb682a6a752
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198790
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2026-02-06 10:14:33 +01:00
Michael Weghorn 78461f9db0 tdf#130857 weld: Reuse existing weld::Widget command logic for TreeView
Drop the weld::TreeView-specific logic for signalling
CommandEvent of type ContextMenu and reuse the existing
logic implemented in the weld::Widget base class instead,
which was moved there in previous commit

    Change-Id: I9367bdbb8be7994057667fab539aaf135751e063
    Author: Michael Weghorn <m.weghorn@posteo.de>
    Date:   Wed Dec 10 23:08:21 2025 +0100

        tdf#130857 weld: Move CommandEvent handling to weld::Widget base

Make weld::Widget::connect_command virtual to override
it in GtkInstanceTreeView, as was previously the case
for the now dropped weld::TreeView::connect_popup_menu.

The existing handlers previously connected using
weld::TreeView::connect_popup_menu already check whether the type
of the event is CommandEventId::ContextMenu, so no change in behavior
is expected.

In a quick test, the sample scenario of the template dialog as
described in

    commit 5d28767654
    Author: Michael Weghorn <m.weghorn@posteo.de>
    Date:   Tue Dec 9 20:13:07 2025 +0100

        tdf#130857 qt weld: Forward TreeView context menu event

still worked as expected with gtk3 and gen as well as with
an experimental branch for qt6 where support for using native
Qt widgets for that dialog is declared.

Change-Id: I13baf51eda2c9f0adc9c167ab50e920d23ada07e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195415
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-12-12 13:25:45 +01:00
Noel Grandin 4e2b089020 loplugin:stringloop
resurrect the plugin and run it over the codebase

Change-Id: I443a75961124aabd1e62b3c4bc166d52e4621b52
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194870
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2025-12-01 14:25:01 +01:00
Mike Kaganski 1250533489 tdf#167599: check the result of UNO_QUERY
Not all objects implement XServiceInfo. Any query must either be
UNO_QUERY_THROW, or check its result after UNO_QUERY.

Change-Id: I8b1d7c719c4a43a4d658957ad5a91181dc265186
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188080
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-07-20 12:39:30 +02:00
Noel Grandin 5e42599f91 loplugin:constparam in sfx2
Change-Id: I3980c28f0b3c024d7c7648db51a69fdf804f54b5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183145
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2025-03-20 16:44:05 +01:00
Michael Weghorn 57d532057b weld: Rename weld::Treeview selection signal/connect
Rename weld::TreeView member + methods to clarify
that these are about selection changes:

* m_aChangeHdl to m_aSelectionChangedHdl,
* signal_changed to signal_selection_changed
* connect_changed to connect_selection_changed

In GtkInstanceTreeview, also rename the
related methods calling signal_selection_changed
accordingly for consistency.

Change-Id: I299d7930484677395a0bdd0ff105df18688f2e04
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178023
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-12-07 11:15:03 +01:00
Xisco Fauli f6a539cb5f sfx2: unused returns
Change-Id: I0ab14e51d10cf67c956624710d1f82c69662e586
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176784
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-11-19 21:13:17 +01:00
Noel Grandin ccb96251ea loplugin:reftotemp in sfx2
Change-Id: I0ec28fe2c0737b71ff18c4efbc99c896339f5062
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176474
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-11-12 13:55:55 +01:00
Mike Kaganski 56f3dbffdf Simplify a bit
Change-Id: I618b0f8bcb2e8032ee12367c73e1136685f66b3e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176183
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-11-08 05:34:20 +01:00
Noel Grandin ca5c9591ba loplugin:ostr in sfx2
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-10 18:42:35 +02:00
Noel Grandin 15d19cb69d Move ObjectInspectorWidgets code into cxx file
having this much code in a header file is not a good idea

Change-Id: Ic21eca651335bb282ebbf9434811ae591b7e0b18
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166620
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-04-25 20:36:19 +02:00
Noel Grandin e2cacf0456 move this header inside the module
it is not used anywhere else

Change-Id: I46cc42397cf56237818e6e58268a856e826a9985
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163818
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-02-24 10:13:19 +01:00
Mike Kaganski 0fa827dbb2 Drop std::as_const from css::uno::Sequence iterations
Obsoleted by commit 2484de6728 (Remove
non-const Sequence::begin()/end() in internal code, 2021-10-15) and
commit fb3c04bd19 (Drop non-const
Sequence::operator[] in internal code, 2021-11-05).

Change-Id: Idbafef5d34c0d4771cbbf75b9db9712e504164cd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162640
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-01-27 12:43:48 +01:00
Stephan Bergmann dcea29c283 Make NC_ constexpr-friendly
...by moving the char8_t -> char reinterpret_cast out of any potential constexpr
paths into a new TranslateId::getId.  And demonstrate constexpr'ability by
making the aCategories var in OApplicationIconControl::Fill
(dbaccess/source/ui/app/AppIconControl.cxx) constexpr.  (And there might be more
such cases that could now be made constexpr.)

Change-Id: I0b4e3292faf8f6b901f9b9e934e1aa6bf0f583ff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157862
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-12 18:17:49 +02:00
Noel Grandin e810bd2b99 merge some stringadds
found with a lightly tweaked version of the loplugin:stringadd
and some hand-holding.

Change-Id: I146aadcaf665e98fea89a9cad2df4dc3935622f4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152275
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-05-25 18:43:52 +02:00
Mike Kaganski 116b9d6ddf Avoid conversions between OUString and OString in VCL
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>
2023-04-02 18:46:47 +02:00
Stephan Bergmann 19691c3b68 Revert all the recent loplugin:unocast changes
...as obsoleted by ef53355355 "Rudimentary support
for dynamic_cast on UNO proxy objects".

This reverts all of:
4cfcc9ac37 "loplugin:unocast (framework::Desktop)"
03efbf72f4 "loplugin:unocast
 (vclcanvas::TextLayout)"
80099fdd51 "loplugin:unocast (SalGtkXWindow)"
cc147f576d "loplugin:unocast
 (sdext::presenter::CachablePresenterView)"
40db42be1d "loplugin:unocast
 (vclcanvas::CanvasFont)"
2d1e7995ea "loplugin:unocast (CairoColorSpace)"
4c0bbe4bd9 "loplugin:unocast
 (canvas::ParametricPolyPolygon)"
8980366662 "loplugin:unocast
 (vclcanas::CanvasBitmap)"
d5e0c2c8db "loplugin:unocast
 (sfx2::DigitalSignatures)"
c0c4519e0d "loplugin:unocast
 (VCLXAccessibleComponent)"
feb8b833a6 "loplugin:unocast (VCLXDialog)"
1fa58cc6cc "loplugin:unocast (VCLXMultiPage)"
f481f036de "loplugin:unocast
 (DocumentSettingsSerializer)"
73df933f5f "loplugin:unocast
 (css::embed::EmbeddedUpdate)"
420165ab0e "loplugin:unocast
 (canvas::tools' StandardColorSpace, StandardNoAlphaColorSpace)"
9abe8ee067 "loplugin:unocast (MutableTreeNode)"
9f3022ceb0 "loplugin:unocast (VCLXTabPage)"
1be70dda02 "loplugin:unocast
 (vcl::unotools::VclCanvasBitmap)"
d6a70bb641 "loplugin:unocast
 (basegfx::unotools::UnoPolyPolygon)"
5a14f009e6 "loplugin:unocast
 (xmlsecurity::Certificate)"
99009c9535 "loplugin:unocast (sd::Annotation)"
0c7585c5fa "loplugin:unocast (sd::TextApiObject)"
24e14afd1b "loplugin:unocast
 (SignatureVerifierImpl)"
1a7ad0c10d "loplugin:unocast
 (pcr::PropertyEventTranslation)"
a97e2d2702 "loplugin:unocast (RangePageBreaks)"
19dfdf86ad "iloplugin:unocast
 (pcr::OFormattedNumericControl)"
f9785ea595 "loplugin:unocast
 (frm::OInterfaceContainer)"
5e5f40a4a9 "loplugin:unocast (ScVbaShapes)"
27b35b2c21 "loplugin:unocast (ScVbaShapeRange)"
cb3108f860 "cid#1517812 Dereference null return
 value"
feba0ddb15 "loplugin:unocast
 (weld::TransportAsXWindow)"
4d6c232165 "loplugin:unocast
 (oox::ForumlaImExportBase)"
4844c096a8 "loplugin:unocast
 (cairocanvas::SurfaceProvider)"
9a0b523e0a "loplugin:unocast
 (cairocanvas::CanvasBitmap)"
8a5648d8e5 "loplugin:unocast
 (cairocanvas::TextLayout)"
28c27a0623 "loplugin:unocast
 (cairocanvas::CanvasFont)"
53bc223cb3 "loplugin:unocast
 (cairocanvas::RepaintTarget)"
5f70b0b9f6 "loplugin:unocast (SvXMLImport)"
068187a898 "loplugin:unocast (VCLXWindow)"
88b4f96620 "loplugin:unocast
 (sfx2::sidebar::SidebarController)"
f1b7a69b28 "loplugin:unocast
 (SvxLineStyleToolBoxControl)"
ba76f0ba7e "loplugin:unocast
 (i18npool::Calendar_gregorian)"
840154daf9 "loplugin:unocast
 (framework::AddonsToolBarWrapper)"
b0e9c4c5f0 "loplugin:unocast
 (GrammarCheckingIterator)"
8ee6cfc965 "loplugin:unocast
 (ucb::ucp::ext::Content)"
5b8cd77c11 "loplugin:unocast
 (basic::SfxScriptLibraryContainer)"
9e73ff9fce "loplugin:unocast
 (sdext::presenter::PresenterNotesView)"
a98acca8fb "loplugin:unocast
 (SelectionChangeHandler)"
c0b59ad6e3 "Consistently use
 comphelper::getSomethingImpl<I>(aIdentifier, this)"
276e3ccbdd "loplugin:unocast
 (vclcanvas::RepaintTarget)"

Change-Id: I37c73e3422a5154bf6cb647640d2d3f23db8bc34
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145063
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-01-05 11:45:51 +00:00
Stephan Bergmann a98acca8fb loplugin:unocast (SelectionChangeHandler)
(See the upcoming commit introducing that loplugin:unocast on why such
dynamic_casts from UNO types are dangerous.)

Change-Id: Ibc2511c8521923c854e4b450649ea616581af2fa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144141
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-12-14 08:55:19 +00:00
Amarjargal Gundjalam 670fa33edd tdf#143641 Fix UNO Object Inspector window title
When detaching the "UNO Object Inspector" window, the title is "LibreOfficeDev 7.x",
and not anything related to the window. This change fixes the window title.

Change-Id: I3b7c3b547e59acd108b62a537ce7ff24162d745b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142053
Tested-by: Jenkins
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Tested-by: Hossein <hossein@libreoffice.org>
Reviewed-by: Hossein <hossein@libreoffice.org>
2022-11-04 09:57:56 +01:00
Noel Grandin 8c15ccc267 clang-tidy modernize-pass-by-value in sfx2
Change-Id: I7984f0b52809091511dc01005fdbfeafd521b4bf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137048
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-07-14 15:38:12 +02:00
Tomaž Vajngerl 66d8951df3 sfx2: use natural string sort for sorting in object inspector
Use a natural string sort for all strings in the object inspector
tree view. This is more useful for properties as those can have
indices, which are shown as numbers, so having them in natural
order makes the tree view easier to digest.

Change-Id: I7d036cd755f6595fa302c7a28a005684897f2963
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134541
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-05-20 06:19:16 +02:00
Gabor Kelemen 144057a54a Recheck modules s[f-t]* with IWYU
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>
2022-03-01 08:21:00 +01:00
Caolán McNamara e00032ba6a add toId/fromId to tidy up some ugly casting
Change-Id: I70f34ac5e9b5d2f2d6c0375e823908eaa2e540b2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129487
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-02-04 15:02:03 +01:00
Julien Nabet 5e3ee8a1ff Typo: documet->document
Change-Id: I0eda84ea313029311c81782abe7157b06de3a2cc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128786
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-01-22 17:30:22 +01:00
Noel Grandin 260ea19fb5 use comphelper::WeakComponentImplHelper in SelectionChangeHandler
Change-Id: Iab23271e69b9ae703444387ecca172361f67dfd5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127527
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-27 07:37:48 +01:00
Noel Grandin a214369f14 loplugin:unusedvariablecheck improve
to find unused smart pointer variables

Change-Id: I200bdd8949032a0e061de61f7903a156651793e2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127006
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-17 15:02:00 +01:00
Mike Kaganski 8a017d25a6 Avoid COW overhead using css::uno::Sequence
The scenarios are:

1. Calling sequence's begin() and end() in pairs to pass to algorithms
   (both calls use getArray(), which does the COW checks)
2. In addition to #1, calling end() again when checking result of find
   algorithms, and/or begin() to calculate result's distance
3. Using non-const sequences in range-based for loops, which internally
   do #1
4. Assigning sequence to another sequence variable, and then modifying
   one of them

In many cases, the sequences could be made const, or treated as const
for the purposes of the algorithms (using std::as_const, std::cbegin,
and std::cend). Where algorithm modifies the sequence, it was changed
to only call getArray() once. For that, css::uno::toNonConstRange was
introduced, which returns a struct (sublclass of std::pair) with two
iterators [begin, end], that are calculated using one call to begin()
and one call to getLength().

To handle #4, css::uno::Sequence::swap was introduced, that swaps the
internal pointer to uno_Sequence. So when a local Sequence variable
should be assigned to another variable, and the latter will be modified
further, it's now possible to use swap instead, so the two sequences
are kept independent.

The modified places were found by temporarily removing non-const end().

Change-Id: I8fe2787f200eecb70744e8b77fbdf7a49653f628
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123542
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-14 06:00:49 +02:00
Noel Grandin 18f2020116 loplugin:constparams
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-18 21:18:29 +02:00
Noel Grandin 14cfff500e Pass context and resource string down to boost::locale separately
because this is often on a hot path, and we can avoid the splitting and
joining of strings like this.

Change-Id: Ia36047209368ca53431178c2e8723a18cfe8260a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119220
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-05 09:39:11 +02:00
Gizem Ozgun 1c8483d217 tdf#142459 Fixed long class names are truncated(gen)
Change-Id: I9c88beb3fc83c23b2e866824985d50567b056f7f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118035
Tested-by: Jenkins
Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com>
2021-07-06 07:22:21 +02:00
Gülşah Köse b1c0734ffe tdf#141677 Make columns sortable
Change-Id: Ib4cb8aaba4c59a7afa347f8010deef41477b77f9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115688
Tested-by: Jenkins
Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com>
2021-05-17 23:57:17 +02:00
Julien Nabet 2668f93205 Fix regression in "Directly initialize vectors in sfx2/ObjectInsp..."
Change-Id: Ibd975c4da8ccfd44f5c2b779774a3834918603b0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115591
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-05-15 10:00:48 +02:00
Julien Nabet c76e184ca1 Directly initialize vectors in sfx2/ObjectInspectorTreeHandler
since we've got all the information from the beginning.

The static_cast is to fix this error:
/home/julien/lo/libreoffice/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx:976:39: error: type 'float' cannot be narrowed to 'int' in initializer list [-Wc++11-narrowing]
    std::vector<int> aMethodsWidths { nMethodsDigitWidth * 30, nMethodsDigitWidth * 15,
                                      ^~~~~~~~~~~~~~~~~~~~~~~
/home/julien/lo/libreoffice/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx:976:39: note: insert an explicit cast to silence this issue
    std::vector<int> aMethodsWidths { nMethodsDigitWidth * 30, nMethodsDigitWidth * 15,
                                      ^~~~~~~~~~~~~~~~~~~~~~~
                                      static_cast<int>(      )

Change-Id: I7d59d947bd54bf97dd559b6813cabd3ea4216efe
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115582
Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
2021-05-14 11:07:17 +02:00
Gülşah Köse b1099568ff tdf#141458 Set inital column width of Properties and Methods tabs.
Change-Id: I60a51de849d332bbf4579eac3d60834f17cb4fb8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115482
Tested-by: Jenkins
Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com>
2021-05-14 08:59:08 +02:00
Gülşah Köse db35b90864 tdf#141426 Remove GtkPaned struct unnecessary tabs.
In development tool we need GtkPaned for only properties tab.
Unnecessary hide() show() calls for the other tabs(Interfaces, Services,
Methods) causes complex problems about inital height of the second pane
with gen plugin.

Change-Id: I7523ef0bc425d7fc97ec5bd9e30e874f88e354f7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115450
Tested-by: Jenkins
Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com>
2021-05-12 11:19:25 +02:00
Noel Grandin e859bf8c4d loplugin:constmethod
Change-Id: I7913fd8144d521b8293ac43036d0fad82e457cd1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115145
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-05 18:50:51 +02:00
Gülşah Köse 3c6692f88d tdf#141422 Set inital height of the develepment tool window.
Change-Id: I703edc227ee163e2a7b8fb9b03c71f055c6e0a3b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114775
Tested-by: Jenkins
Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com>
2021-04-29 20:07:55 +02:00
Gabor Kelemen 2633d5f97f Recheck include/ with IWYU
See tdf#42949 for motivation

Change-Id: Ifc253bf800bb1468b5774663a93f4fb30bec81d3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113657
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-04-09 11:56:36 +02:00