diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-06-21 12:14:08 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-06-25 13:53:21 +0200 |
commit | 4583911575edf98ccd5b15af8eafa6a3a7b64034 (patch) | |
tree | f3f33e53c45dd870f19e7e42db9bb5b4bf1f23bf /vcl/unx | |
parent | 1942182a3d1817bc539229d7fda3af69f7e295b8 (diff) |
improve loplugin:simplifyconstruct
Change-Id: If863d28c6db470faa0d22273020888d4219e069e
Reviewed-on: https://gerrit.libreoffice.org/74559
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/unx')
-rw-r--r-- | vcl/unx/generic/desktopdetect/desktopdetector.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/generic/print/text_gfx.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/gtk/a11y/atkutil.cxx | 6 | ||||
-rw-r--r-- | vcl/unx/gtk3/gtk3gtkinst.cxx | 8 | ||||
-rw-r--r-- | vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx | 2 |
5 files changed, 9 insertions, 11 deletions
diff --git a/vcl/unx/generic/desktopdetect/desktopdetector.cxx b/vcl/unx/generic/desktopdetect/desktopdetector.cxx index 217ffdbb72cc..2c453e051b5c 100644 --- a/vcl/unx/generic/desktopdetect/desktopdetector.cxx +++ b/vcl/unx/generic/desktopdetect/desktopdetector.cxx @@ -164,7 +164,7 @@ DESKTOP_DETECTOR_PUBLIC DesktopType get_desktop_environment() const char *pDesktop = getenv( "XDG_CURRENT_DESKTOP" ); if ( pDesktop ) { - OString aCurrentDesktop = OString( pDesktop, strlen( pDesktop ) ); + OString aCurrentDesktop( pDesktop, strlen( pDesktop ) ); //it may be separated by colon ( e.g. unity:unity7:ubuntu ) std::vector<OUString> aSplitCurrentDesktop = comphelper::string::split( diff --git a/vcl/unx/generic/print/text_gfx.cxx b/vcl/unx/generic/print/text_gfx.cxx index 7099d0a5f57d..156f801cb8c9 100644 --- a/vcl/unx/generic/print/text_gfx.cxx +++ b/vcl/unx/generic/print/text_gfx.cxx @@ -111,7 +111,7 @@ void PrinterGfx::DrawGlyph(const Point& rPoint, nDescend = nDescend * nTextHeight / 1000; nAscend = nAscend * nTextHeight / 1000; - Point aRotPoint = Point( -nDescend*nTextWidth/nTextHeight, nAscend*nTextWidth/nTextHeight ); + Point aRotPoint( -nDescend*nTextWidth/nTextHeight, nAscend*nTextWidth/nTextHeight ); // transform matrix to new individual direction PSGSave (); diff --git a/vcl/unx/gtk/a11y/atkutil.cxx b/vcl/unx/gtk/a11y/atkutil.cxx index e76cf990228a..cac3ac6e4805 100644 --- a/vcl/unx/gtk/a11y/atkutil.cxx +++ b/vcl/unx/gtk/a11y/atkutil.cxx @@ -314,8 +314,7 @@ void DocumentFocusListener::attachRecursive( if( xStateSet->contains(accessibility::AccessibleStateType::FOCUSED ) ) atk_wrapper_focus_tracker_notify_when_idle( xAccessible ); - uno::Reference< accessibility::XAccessibleEventBroadcaster > xBroadcaster = - uno::Reference< accessibility::XAccessibleEventBroadcaster >(xContext, uno::UNO_QUERY); + uno::Reference< accessibility::XAccessibleEventBroadcaster > xBroadcaster(xContext, uno::UNO_QUERY); if (!xBroadcaster.is()) return; @@ -373,8 +372,7 @@ void DocumentFocusListener::detachRecursive( const uno::Reference< accessibility::XAccessibleStateSet >& xStateSet ) { - uno::Reference< accessibility::XAccessibleEventBroadcaster > xBroadcaster = - uno::Reference< accessibility::XAccessibleEventBroadcaster >(xContext, uno::UNO_QUERY); + uno::Reference< accessibility::XAccessibleEventBroadcaster > xBroadcaster(xContext, uno::UNO_QUERY); if( xBroadcaster.is() && 0 < m_aRefList.erase(xBroadcaster) ) { diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index 50ebb17367c1..41504bf55c65 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -6750,7 +6750,7 @@ private: gtk_tree_model_get_iter(pModel, &aGtkIter.iter, tree_path); gtk_tree_path_free(tree_path); - OUString sText = OUString(pNewText, pNewText ? strlen(pNewText) : 0, RTL_TEXTENCODING_UTF8); + OUString sText(pNewText, pNewText ? strlen(pNewText) : 0, RTL_TEXTENCODING_UTF8); if (signal_editing_done(std::pair<const weld::TreeIter&, OUString>(aGtkIter, sText))) { void* pData = g_object_get_data(G_OBJECT(pCell), "g-lo-CellIndex"); @@ -6939,7 +6939,7 @@ public: GtkTreeViewColumn* pColumn = GTK_TREE_VIEW_COLUMN(g_list_nth_data(m_pColumns, nColumn)); assert(pColumn && "wrong count"); const gchar* pTitle = gtk_tree_view_column_get_title(pColumn); - OUString sRet = OUString(pTitle, pTitle ? strlen(pTitle) : 0, RTL_TEXTENCODING_UTF8); + OUString sRet(pTitle, pTitle ? strlen(pTitle) : 0, RTL_TEXTENCODING_UTF8); return sRet; } @@ -8675,7 +8675,7 @@ public: GtkTextIter start, end; gtk_text_buffer_get_bounds(pBuffer, &start, &end); char* pStr = gtk_text_buffer_get_text(pBuffer, &start, &end, true); - OUString sRet = OUString(pStr, pStr ? strlen(pStr) : 0, RTL_TEXTENCODING_UTF8); + OUString sRet(pStr, pStr ? strlen(pStr) : 0, RTL_TEXTENCODING_UTF8); g_free(pStr); return sRet; } @@ -10326,7 +10326,7 @@ private: int nTextLen = pTextStr ? strlen(pTextStr) : 0; if (nTextLen) { - OUString sOldText = OUString(pTextStr, nTextLen, RTL_TEXTENCODING_UTF8); + OUString sOldText(pTextStr, nTextLen, RTL_TEXTENCODING_UTF8); OString sText(OUStringToOString((*m_pStringReplace)(sOldText), RTL_TEXTENCODING_UTF8)); gtk_text_buffer_set_text(pBuffer, sText.getStr(), sText.getLength()); } diff --git a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx index e7e194e50a62..689e19da83da 100644 --- a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx @@ -1193,7 +1193,7 @@ tools::Rectangle GtkSalGraphics::NWGetComboBoxButtonRect(ControlType nType, gint nButtonWidth = nArrowWidth + padding.left + padding.right; if( nPart == ControlPart::ButtonDown ) { - Point aPos = Point(aAreaRect.Left() + aAreaRect.GetWidth() - nButtonWidth, aAreaRect.Top()); + Point aPos(aAreaRect.Left() + aAreaRect.GetWidth() - nButtonWidth, aAreaRect.Top()); if (AllSettings::GetLayoutRTL()) aPos.setX( aAreaRect.Left() ); aButtonRect.SetSize( Size( nButtonWidth, aAreaRect.GetHeight() ) ); |