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>
diff --git a/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx b/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx
index d7d4895..362907e 100644
--- a/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx
+++ b/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx
@@ -1322,6 +1322,12 @@ void ObjectInspectorTreeHandler::inspectObject(uno::Reference<uno::XInterface> c
// Set implementation name
OUString aImplementationName = getInterfaceImplementationClass(xInterface);
mpObjectInspectorWidgets->mpClassNameLabel->set_label(aImplementationName);
sal_Int32 nStrLen = aImplementationName.getLength();
sal_Int32 nDigitWidth
= mpObjectInspectorWidgets->mpClassNameLabel->get_approximate_digit_width();
//get_about_digit_width() returns an approximate value. To always see the full class name (nStrLen+2)
mpObjectInspectorWidgets->mpClassNameLabel->set_size_request((nStrLen + 2) * nDigitWidth, -1);
// Fire entering the current opened page manually
auto rPageId = mpObjectInspectorWidgets->mpNotebook->get_current_page_ident();