diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-05-10 13:18:37 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-05-10 18:42:35 +0200 |
commit | ca5c9591ba38ad83415a2d4ced98bfc74d30b032 (patch) | |
tree | dcccbec3d99727cffe7debd21d3c40521383857b /sfx2/source/devtools | |
parent | e888503ee0aecbce8f3075b106243cf68b8dddc7 (diff) |
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>
Diffstat (limited to 'sfx2/source/devtools')
-rw-r--r-- | sfx2/source/devtools/DevelopmentToolDockingWindow.cxx | 16 | ||||
-rw-r--r-- | sfx2/source/devtools/DocumentModelTreeHandler.cxx | 10 | ||||
-rw-r--r-- | sfx2/source/devtools/ObjectInspectorTreeHandler.cxx | 25 | ||||
-rw-r--r-- | sfx2/source/devtools/ObjectInspectorWidgets.cxx | 18 |
4 files changed, 35 insertions, 34 deletions
diff --git a/sfx2/source/devtools/DevelopmentToolDockingWindow.cxx b/sfx2/source/devtools/DevelopmentToolDockingWindow.cxx index 4e3107a71ced..c3fb090ac752 100644 --- a/sfx2/source/devtools/DevelopmentToolDockingWindow.cxx +++ b/sfx2/source/devtools/DevelopmentToolDockingWindow.cxx @@ -27,11 +27,11 @@ using namespace css; DevelopmentToolDockingWindow::DevelopmentToolDockingWindow(SfxBindings* pInputBindings, SfxChildWindow* pChildWindow, vcl::Window* pParent) - : SfxDockingWindow(pInputBindings, pChildWindow, pParent, "DevelopmentTool", - "sfx/ui/developmenttool.ui") + : SfxDockingWindow(pInputBindings, pChildWindow, pParent, u"DevelopmentTool"_ustr, + u"sfx/ui/developmenttool.ui"_ustr) , mpObjectInspectorWidgets(new ObjectInspectorWidgets(m_xBuilder)) - , mpDocumentModelTreeView(m_xBuilder->weld_tree_view("leftside_treeview_id")) - , mpDomToolbar(m_xBuilder->weld_toolbar("dom_toolbar")) + , mpDocumentModelTreeView(m_xBuilder->weld_tree_view(u"leftside_treeview_id"_ustr)) + , mpDomToolbar(m_xBuilder->weld_toolbar(u"dom_toolbar"_ustr)) , maDocumentModelTreeHandler( mpDocumentModelTreeView, pInputBindings->GetDispatcher()->GetFrame()->GetObjectShell()->GetBaseModel()) @@ -60,7 +60,7 @@ DevelopmentToolDockingWindow::DevelopmentToolDockingWindow(SfxBindings* pInputBi IMPL_LINK(DevelopmentToolDockingWindow, DocumentModelTreeViewSelectionHandler, weld::TreeView&, rView, void) { - if (mpDomToolbar->get_item_active("dom_current_selection_toggle")) + if (mpDomToolbar->get_item_active(u"dom_current_selection_toggle"_ustr)) return; OUString sID = rView.get_selected_id(); @@ -108,7 +108,7 @@ void DevelopmentToolDockingWindow::dispose() void DevelopmentToolDockingWindow::updateSelection() { - bool bActive = mpDomToolbar->get_item_active("dom_current_selection_toggle"); + bool bActive = mpDomToolbar->get_item_active(u"dom_current_selection_toggle"_ustr); if (bActive) { maObjectInspectorTreeHandler.introspect(mxCurrentSelection); @@ -148,12 +148,12 @@ void DevelopmentToolDockingWindow::changeToCurrentSelection() if (xInterface.is()) { maObjectInspectorTreeHandler.introspect(xInterface); - mpDomToolbar->set_item_active("dom_current_selection_toggle", true); + mpDomToolbar->set_item_active(u"dom_current_selection_toggle"_ustr, true); return; } } } - mpDomToolbar->set_item_active("dom_current_selection_toggle", false); + mpDomToolbar->set_item_active(u"dom_current_selection_toggle"_ustr, false); maObjectInspectorTreeHandler.introspect(mxRoot); } diff --git a/sfx2/source/devtools/DocumentModelTreeHandler.cxx b/sfx2/source/devtools/DocumentModelTreeHandler.cxx index bbcb17a3f74c..a850b78e7ac4 100644 --- a/sfx2/source/devtools/DocumentModelTreeHandler.cxx +++ b/sfx2/source/devtools/DocumentModelTreeHandler.cxx @@ -799,14 +799,14 @@ void DocumentModelTreeHandler::inspectDocument() lclAppend(mpDocumentModelTree, new DocumentRootEntry(SfxResId(STR_DOCUMENT_ENTRY), mxDocument)); - if (xDocumentServiceInfo->supportsService("com.sun.star.sheet.SpreadsheetDocument")) + if (xDocumentServiceInfo->supportsService(u"com.sun.star.sheet.SpreadsheetDocument"_ustr)) { lclAppend(mpDocumentModelTree, new SheetsEntry(SfxResId(STR_SHEETS_ENTRY), mxDocument)); lclAppend(mpDocumentModelTree, new StylesFamiliesEntry(SfxResId(STR_STYLES_ENTRY), mxDocument)); } else if (xDocumentServiceInfo->supportsService( - "com.sun.star.presentation.PresentationDocument")) + u"com.sun.star.presentation.PresentationDocument"_ustr)) { lclAppend(mpDocumentModelTree, new SlidesEntry(SfxResId(STR_SLIDES_ENTRY), mxDocument)); lclAppend(mpDocumentModelTree, @@ -814,14 +814,14 @@ void DocumentModelTreeHandler::inspectDocument() lclAppend(mpDocumentModelTree, new StylesFamiliesEntry(SfxResId(STR_STYLES_ENTRY), mxDocument)); } - else if (xDocumentServiceInfo->supportsService("com.sun.star.drawing.DrawingDocument")) + else if (xDocumentServiceInfo->supportsService(u"com.sun.star.drawing.DrawingDocument"_ustr)) { lclAppend(mpDocumentModelTree, new PagesEntry(SfxResId(STR_PAGES_ENTRY), mxDocument)); lclAppend(mpDocumentModelTree, new StylesFamiliesEntry(SfxResId(STR_STYLES_ENTRY), mxDocument)); } - else if (xDocumentServiceInfo->supportsService("com.sun.star.text.TextDocument") - || xDocumentServiceInfo->supportsService("com.sun.star.text.WebDocument")) + else if (xDocumentServiceInfo->supportsService(u"com.sun.star.text.TextDocument"_ustr) + || xDocumentServiceInfo->supportsService(u"com.sun.star.text.WebDocument"_ustr)) { lclAppend(mpDocumentModelTree, new ParagraphsEntry(SfxResId(STR_PARAGRAPHS_ENTRY), mxDocument)); diff --git a/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx b/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx index 7fa207dc6585..83c6a4eb69c9 100644 --- a/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx +++ b/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx @@ -201,9 +201,9 @@ OUString getInterfaceName(uno::Reference<uno::XInterface> const& xInterface, if (xInvocationInterface.is()) { uno::Reference<script::XInvocation2> xInvocation(xInvocationInterface, uno::UNO_QUERY); - if (xInvocation.is() && xInvocation->hasProperty("Name")) + if (xInvocation.is() && xInvocation->hasProperty(u"Name"_ustr)) { - uno::Any aAny = xInvocation->getValue("Name"); + uno::Any aAny = xInvocation->getValue(u"Name"_ustr); if (aAny.hasValue() && aAny.getValueTypeClass() == uno::TypeClass_STRING) return aAny.get<OUString>(); } @@ -644,7 +644,7 @@ public: uno::Any aArrayValue = mxIdlArray->get(maAny, i); auto* pObjectInspectorNode - = createNodeObjectForAny(OUString::number(i), aArrayValue, ""); + = createNodeObjectForAny(OUString::number(i), aArrayValue, u""_ustr); if (pObjectInspectorNode) lclAppendNodeToParent(pTree, pParent, pObjectInspectorNode); } @@ -863,7 +863,7 @@ void StructNode::fillChildren(std::unique_ptr<weld::TreeView>& pTree, const weld OUString aFieldName = xField->getName(); uno::Any aFieldValue = xField->get(maAny); - auto* pObjectInspectorNode = createNodeObjectForAny(aFieldName, aFieldValue, ""); + auto* pObjectInspectorNode = createNodeObjectForAny(aFieldName, aFieldValue, u""_ustr); if (pObjectInspectorNode) { lclAppendNodeToParent(pTree, pParent, pObjectInspectorNode); @@ -976,8 +976,8 @@ ObjectInspectorTreeHandler::ObjectInspectorTreeHandler( mpObjectInspectorWidgets->mpToolbar->connect_clicked( LINK(this, ObjectInspectorTreeHandler, ToolbarButtonClicked)); - mpObjectInspectorWidgets->mpToolbar->set_item_sensitive("inspect", false); - mpObjectInspectorWidgets->mpToolbar->set_item_sensitive("back", false); + mpObjectInspectorWidgets->mpToolbar->set_item_sensitive(u"inspect"_ustr, false); + mpObjectInspectorWidgets->mpToolbar->set_item_sensitive(u"back"_ustr, false); mpObjectInspectorWidgets->mpNotebook->connect_leave_page( LINK(this, ObjectInspectorTreeHandler, NotebookLeavePage)); @@ -1062,7 +1062,7 @@ IMPL_LINK(ObjectInspectorTreeHandler, ExpandingHandlerMethods, weld::TreeIter co IMPL_LINK(ObjectInspectorTreeHandler, SelectionChanged, weld::TreeView&, rTreeView, void) { bool bHaveNodeWithObject = false; - mpObjectInspectorWidgets->mpTextView->set_text(""); + mpObjectInspectorWidgets->mpTextView->set_text(u""_ustr); if (mpObjectInspectorWidgets->mpPropertiesTreeView.get() == &rTreeView) { auto* pNode = getSelectedNode(rTreeView); @@ -1075,7 +1075,7 @@ IMPL_LINK(ObjectInspectorTreeHandler, SelectionChanged, weld::TreeView&, rTreeVi } } - mpObjectInspectorWidgets->mpToolbar->set_item_sensitive("inspect", bHaveNodeWithObject); + mpObjectInspectorWidgets->mpToolbar->set_item_sensitive(u"inspect"_ustr, bHaveNodeWithObject); } static void updateOrder(const std::unique_ptr<weld::TreeView>& pTreeView, sal_Int32 nColumn) @@ -1110,8 +1110,8 @@ IMPL_LINK(ObjectInspectorTreeHandler, PopupMenuHandler, const CommandEvent&, rCo if (xInterface.is()) { std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder( - mpObjectInspectorWidgets->mpPropertiesTreeView.get(), "sfx/ui/devtoolsmenu.ui")); - std::unique_ptr<weld::Menu> xMenu(xBuilder->weld_menu("inspect_menu")); + mpObjectInspectorWidgets->mpPropertiesTreeView.get(), u"sfx/ui/devtoolsmenu.ui"_ustr)); + std::unique_ptr<weld::Menu> xMenu(xBuilder->weld_menu(u"inspect_menu"_ustr)); OUString sCommand( xMenu->popup_at_rect(mpObjectInspectorWidgets->mpPropertiesTreeView.get(), @@ -1293,7 +1293,7 @@ void ObjectInspectorTreeHandler::appendProperties(uno::Reference<uno::XInterface { if (!xInterface.is()) return; - GenericPropertiesNode aNode("", uno::Any(xInterface), "", mxContext); + GenericPropertiesNode aNode(u""_ustr, uno::Any(xInterface), u""_ustr, mxContext); aNode.fillChildren(mpObjectInspectorWidgets->mpPropertiesTreeView, nullptr); } @@ -1316,7 +1316,8 @@ void ObjectInspectorTreeHandler::appendMethods(uno::Reference<uno::XInterface> c // Update the back button state depending if there are objects in the stack void ObjectInspectorTreeHandler::updateBackButtonState() { - mpObjectInspectorWidgets->mpToolbar->set_item_sensitive("back", maInspectionStack.size() > 1); + mpObjectInspectorWidgets->mpToolbar->set_item_sensitive(u"back"_ustr, + maInspectionStack.size() > 1); } // Clears all the objects from the stack diff --git a/sfx2/source/devtools/ObjectInspectorWidgets.cxx b/sfx2/source/devtools/ObjectInspectorWidgets.cxx index eef505ed9e2d..5c604b0ab847 100644 --- a/sfx2/source/devtools/ObjectInspectorWidgets.cxx +++ b/sfx2/source/devtools/ObjectInspectorWidgets.cxx @@ -11,15 +11,15 @@ #include <sfx2/devtools/ObjectInspectorWidgets.hxx> ObjectInspectorWidgets::ObjectInspectorWidgets(const std::unique_ptr<weld::Builder>& rxBuilder) - : mpClassNameLabel(rxBuilder->weld_label("class_name_value_id")) - , mpInterfacesTreeView(rxBuilder->weld_tree_view("interfaces_treeview_id")) - , mpServicesTreeView(rxBuilder->weld_tree_view("services_treeview_id")) - , mpPropertiesTreeView(rxBuilder->weld_tree_view("properties_treeview_id")) - , mpMethodsTreeView(rxBuilder->weld_tree_view("methods_treeview_id")) - , mpToolbar(rxBuilder->weld_toolbar("object_inspector_toolbar")) - , mpNotebook(rxBuilder->weld_notebook("object_inspector_notebookbar")) - , mpTextView(rxBuilder->weld_text_view("object_inspector_text_view")) - , mpPaned(rxBuilder->weld_paned("object_inspector_paned")) + : mpClassNameLabel(rxBuilder->weld_label(u"class_name_value_id"_ustr)) + , mpInterfacesTreeView(rxBuilder->weld_tree_view(u"interfaces_treeview_id"_ustr)) + , mpServicesTreeView(rxBuilder->weld_tree_view(u"services_treeview_id"_ustr)) + , mpPropertiesTreeView(rxBuilder->weld_tree_view(u"properties_treeview_id"_ustr)) + , mpMethodsTreeView(rxBuilder->weld_tree_view(u"methods_treeview_id"_ustr)) + , mpToolbar(rxBuilder->weld_toolbar(u"object_inspector_toolbar"_ustr)) + , mpNotebook(rxBuilder->weld_notebook(u"object_inspector_notebookbar"_ustr)) + , mpTextView(rxBuilder->weld_text_view(u"object_inspector_text_view"_ustr)) + , mpPaned(rxBuilder->weld_paned(u"object_inspector_paned"_ustr)) { } |