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
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>
This doesn't correctly read the IndexAccess if we remember it into
a member variable, because we can't rely that the input object is
cast to XIndexAccess, but use a getMainObject method to get a
different object and cast that to XIndexAccess. So the instance
of the object can change (object can be removed or and a new one
added) and we have no way of knowing what the implementation does.
It is possible to cache the XIndexAccess object into a member
variable (if done carefully), but it is prone to the described
problems so let's not remember any intermediate objects for
all DocumentModelTreeEntry subclasses unless we actually have a
performance problem.
Change-Id: I9d9d30d2b43846d473d118d419d407e34d0b1666
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112836
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
STR_SHEETS value "Sheets %1" was used to name one particular sheet
and souldn't be plural. This changes it to STR_SHEET and the value
to "Sheet %1".
Change-Id: I29390fa19b0d6e1edaea76c6f3fe60ee25ba50f7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112835
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Some calls to UNO objects throw a RuntimeException if they aren't
implemented, so this makes it necessary to enclose calls to with
try/catch to prevent that exceptions propagate all the way to the
top (crashing the application).
Change-Id: I321171052906c4fe531377949a906689d2182771
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112787
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Change "Current Selection" toggle button and add it to the toolbar
instead.
Change-Id: Id891c4a324832f23f52449328d0f7eda6a862993
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112639
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
This changes DocumentModelTreeEntry and its subclasses to handle
when to show the expander on the tree view and when not, and to
hold the string of the tree view node, which is passed as a
input parameter. This simplifies the code and makes it easier
to handle. Most of the ideas are from ObjectInspectorNodeInterface
and it subclasses, where this works really good.
Change-Id: I076f80a7c64abd0eb67af7ac0144082611d10076
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112578
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
The change improves the display of values by shortening the string
value when showing it in the tree view. Also improve representation
of the object and sequence.
In addition add strings in object inspector for translation.
Change-Id: I502556f11e4c5c83de7174db8b22b2c83d55ce8e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112552
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
This conversion is not that trivial, as it needs to access some
reflection UNO classes, so extract it to its own function.
Change-Id: Iafd1aa7443f21d90efe60c70f725c07f6638feb0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112549
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Sometimes the property value in textual form can take a lot of
space, which can't be shown completely in the tree view. To solve
this problem, this change adds a text view at the bottom of the
tree view, that shows the complete value of currently selected
property.
The text view can be expanded if necessary, but to not require
constant changing of the pane, the position of the text view is
always reset to 90% of the total height.
Change-Id: I209ee29c7b60ecaa15227cc4966f19a063a7dc0a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112548
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
This is needed so they can be shared between ObjectInspectorHandler
and DevelopmentToolDockingWindow, otherwise we have to add each
widget as a parameter to the constructor and for each make a
referenced member. This worked for a while but with more a nd
ore widgets it is becoming ugly.
Change-Id: I8f17e4593b04efaf85ef50d0639c306c204ce92a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112547
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
This documents DevTools classes and methods. In addition it also
removes some methods that aren't needed anymore.
Change-Id: I550e2ce197d1565b4f770eb7dd59b2195f2230a3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112379
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Adds additional column "info" for properties, where additional
property attributes are written. Currently these are mostly
constants from beans::PropertyAttribute, but they can be others
too (anything that is useful to the users for the current property,
struct, sequence).
Change-Id: I12d21ebdfb9352bca79def98d5aa65aa48cfe2aa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112117
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
XIntrospection is not needed as XInvocation can provide a list of
available properties by itself and we need XInvocation to get the
property value. So this change removes XIntrospection and
simplifies the code a bit.
Change-Id: Ic274c87c9c274a05537715b5f19662a7ceaeb2b8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112116
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
This change modifies the type names to a shorter form by replacing
"com.sun.star" with "css". Sequence type names are also changed
so that it shows the number of elements in the type name.
Change-Id: I4b3b3d0917478d1e5ce0e7443e9b5118672cb12b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112114
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
If an Any doesn't have a value, still create the object so it will
be added to the object inspector, but with "NULL" string as the
value. This is needed to show that the property is available in
this object, but it hasn't been set to a value.
Change-Id: I986ceac436434af34709bdfc0588e4d15748c20e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112111
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
It can happen that xIntrospectionAccess object or xIntrospetion
object can't be created. The app crashed in those cases so add a
check.
Change-Id: I9cd2d05a11419a918f16cbacaf4b133d3759c5c0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112110
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Similar like XIndexAccess is XEnumerationAccess, which is like
an iterator over elements, but unlike XIndexAccess the elements
can't be accessed direclty by an index.
In the object inspector the elements of a XEnumeration are
presented as @{number} at the top of the properties.
Change-Id: I61d71859ed065d4e72f8dff99b1aa0fda3546800
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112108
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Until now all the tree views in each tab page were populated at
once when the object was inspected.
With this change, the tree views are filled on demand when the
user enters a tab page, and is cleaned when the user leaves a
tab page.
Change-Id: I7f2ff89ab4c09412563b71e6524d4529318dee85
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111533
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
This change adds a toolbar to the object inspector with buttons
for inspect (which just links to the same action added to the
context menu) and back. Back uses the newly added object stack
to return to the previously inspected object. Only the objects
which we used the "inspect" command in the object inspector tree
are added to the object stack.
Change-Id: Icb5b6e841200d6e0e41e260092a195fc84729d0f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111532
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
With this change it is possible to inspect an object that is
listed in the properties (instead of expanding the tree view
node).
Change-Id: I8b2229af650b46064c82bdd3fe93192d352d32e3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111530
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
If the current object in the object inspector is an container
that supports XNameAccess or XIndexAccess, we now show the named
or index values in the property view. This way the user can
navigate to sub-objects, which is sometimes needed because we get
an object supporting this intefaces, but can't navigate further.
Best example would be XShapeCollection, which is what you get when
selecting a shape (because with a selection we can select multiple
shapes), but it is not possible to navigate to the shape without
this change.
Change-Id: I6a18723eccbc41519e3eacf68bc5b6488e02fe22
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111529
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>