diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-02-06 12:27:45 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-02-06 17:07:23 +0100 |
commit | 0a5d4dc25c5521de221f63dbc47c6ba79a51f8fb (patch) | |
tree | c076915c9fef892c3e9e14c55b8c1593d09f6b43 /vcl/unx | |
parent | b9a46c1ec295fe3227a5adb864c849e55838e89e (diff) |
elide some OString temporaries
Change-Id: I2ecb6af11c95605c84e935b850fe94a1831a1497
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163043
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/unx')
-rw-r--r-- | vcl/unx/generic/app/saldisp.cxx | 4 | ||||
-rw-r--r-- | vcl/unx/generic/gdi/salgdi.cxx | 4 | ||||
-rw-r--r-- | vcl/unx/gtk3/salnativewidgets-gtk.cxx | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/vcl/unx/generic/app/saldisp.cxx b/vcl/unx/generic/app/saldisp.cxx index 6733e483239a..a5f9c2f42e5d 100644 --- a/vcl/unx/generic/app/saldisp.cxx +++ b/vcl/unx/generic/app/saldisp.cxx @@ -60,6 +60,7 @@ #include <unx/sm.hxx> #include <unx/wmadaptor.hxx> #include <unx/glyphcache.hxx> +#include <o3tl/string_view.hxx> #include <poll.h> #include <memory> @@ -503,8 +504,7 @@ void SalDisplay::Init() const char* pValStr = XGetDefault( pDisp_, "Xft", "dpi" ); if( pValStr != nullptr ) { - const OString aValStr( pValStr ); - const tools::Long nDPI = static_cast<tools::Long>(aValStr.toDouble()); + const tools::Long nDPI = static_cast<tools::Long>(o3tl::toDouble(std::string_view(pValStr))); // guard against insane resolution if( sal_ValidDPI(nDPI) ) { diff --git a/vcl/unx/generic/gdi/salgdi.cxx b/vcl/unx/generic/gdi/salgdi.cxx index f296e3cf34a4..39ded2207cd3 100644 --- a/vcl/unx/generic/gdi/salgdi.cxx +++ b/vcl/unx/generic/gdi/salgdi.cxx @@ -38,6 +38,7 @@ #include <vcl/sysdata.hxx> #include <vcl/virdev.hxx> #include <sal/log.hxx> +#include <o3tl/string_view.hxx> #include <unx/salunx.h> #include <unx/saldisp.hxx> @@ -157,8 +158,7 @@ void X11SalGraphics::GetResolution( sal_Int32 &rDPIX, sal_Int32 &rDPIY ) // cons char* pForceDpi; if ((pForceDpi = getenv("SAL_FORCEDPI"))) { - OString sForceDPI(pForceDpi); - rDPIX = rDPIY = sForceDPI.toInt32(); + rDPIX = rDPIY = o3tl::toInt32(std::string_view(pForceDpi)); return; } diff --git a/vcl/unx/gtk3/salnativewidgets-gtk.cxx b/vcl/unx/gtk3/salnativewidgets-gtk.cxx index bfdeed423846..5dfaf24420c2 100644 --- a/vcl/unx/gtk3/salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk3/salnativewidgets-gtk.cxx @@ -22,6 +22,7 @@ #include <vcl/decoview.hxx> #include <vcl/settings.hxx> #include <unx/fontmanager.hxx> +#include <o3tl/string_view.hxx> #include "gtkcairo.hxx" #include <optional> @@ -3061,8 +3062,7 @@ void GtkSalGraphics::GetResolution(sal_Int32& rDPIX, sal_Int32& rDPIY) char* pForceDpi; if ((pForceDpi = getenv("SAL_FORCEDPI"))) { - OString sForceDPI(pForceDpi); - rDPIX = rDPIY = sForceDPI.toInt32(); + rDPIX = rDPIY = o3tl::toInt32(std::string_view(pForceDpi)); return; } |