Instead of having one for vcl in vcl/inc/qt5/QtTools.hxx
and one in avmedia/source/qt6/QtFrameGrabber.cxx,
move the existing implementation to
include/vcl/qt/QtUtils.hxx and use it everywhere.
Change-Id: I8576ab0fe2fd12bb25ae262e59acb8412ef8be0c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184057
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
(cherry picked from commit
d023035acf83ee1b61dfc03333bfc6e612bb58f6)
Gbp-Pq: Name qt-Consolidate-to-one-toOUString-helper.diff
#include <vcl/filter/PngImageReader.hxx>
#include <vcl/graph.hxx>
#include <vcl/image.hxx>
+#include <vcl/qt/QtUtils.hxx>
#include <vcl/scheduler.hxx>
#include "QtFrameGrabber.hxx"
namespace
{
-inline OUString toOUString(const QString& s)
-{
- return OUString(reinterpret_cast<const sal_Unicode*>(s.data()), s.length());
-}
-
uno::Reference<css::graphic::XGraphic> toXGraphic(const QImage& rImage)
{
QByteArray aData;
return QString::fromUtf16(rStr.getStr(), rStr.getLength());
}
+inline OUString toOUString(const QString& s)
+{
+ // QString stores UTF16, just like OUString
+ return OUString(reinterpret_cast<const sal_Unicode*>(s.data()), s.length());
+}
+
inline QPixmap toQPixmap(const BitmapEx& rBitmapEx)
{
SvMemoryStream aMemoryStream;
#include <tools/color.hxx>
#include <tools/gen.hxx>
#include <vcl/bitmap/BitmapTypes.hxx>
+#include <vcl/qt/QtUtils.hxx>
#include <vcl/vclenum.hxx>
#include <com/sun/star/uno/Sequence.hxx>
class Image;
class QImage;
-inline OUString toOUString(const QString& s)
-{
- // QString stores UTF16, just like OUString
- return OUString(reinterpret_cast<const sal_Unicode*>(s.data()), s.length());
-}
-
inline QRect toQRect(const tools::Rectangle& rRect)
{
return QRect(rRect.Left(), rRect.Top(), rRect.GetWidth(), rRect.GetHeight());