r23779 by jghali - Use QString::fromWCharArray() to convert wchar_t buffer filled by lcms2 to QString

scribus-commit scribus-commit at lists.scribus.net
Mon May 11 21:43:59 UTC 2020


Author: jghali
Date: Mon May 11 21:43:58 2020
New Revision: 23779

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23779
Log:
Use QString::fromWCharArray() to convert wchar_t buffer filled by lcms2 to QString

Modified:
    trunk/Scribus/scribus/colormgmt/sclcms2colormgmtengineimpl.cpp
    trunk/Scribus/scribus/colormgmt/sclcms2colorprofileimpl.cpp

Modified: trunk/Scribus/scribus/colormgmt/sclcms2colormgmtengineimpl.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23779&path=/trunk/Scribus/scribus/colormgmt/sclcms2colormgmtengineimpl.cpp
==============================================================================
--- trunk/Scribus/scribus/colormgmt/sclcms2colormgmtengineimpl.cpp	(original)
+++ trunk/Scribus/scribus/colormgmt/sclcms2colormgmtengineimpl.cpp	Mon May 11 21:43:58 2020
@@ -94,11 +94,7 @@
 				{
 					uint stringLen = descSize / sizeof(wchar_t);
 					descData[stringLen] = 0;
-					if (sizeof(wchar_t) == sizeof(QChar)) {
-						profileInfo.description = QString::fromUtf16((ushort *) descData);
-					} else {
-						profileInfo.description = QString::fromUcs4((uint *) descData);
-					}
+					profileInfo.description = QString::fromWCharArray(descData);
 				}
 				free(descData);
 			}

Modified: trunk/Scribus/scribus/colormgmt/sclcms2colorprofileimpl.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23779&path=/trunk/Scribus/scribus/colormgmt/sclcms2colorprofileimpl.cpp
==============================================================================
--- trunk/Scribus/scribus/colormgmt/sclcms2colorprofileimpl.cpp	(original)
+++ trunk/Scribus/scribus/colormgmt/sclcms2colorprofileimpl.cpp	Mon May 11 21:43:58 2020
@@ -69,11 +69,7 @@
 				{
 					uint stringLen = descSize / sizeof(wchar_t);
 					descData[stringLen] = 0;
-					if (sizeof(wchar_t) == sizeof(QChar)) {
-						m_productDescription = QString::fromUtf16((ushort *) descData);
-					} else {
-						m_productDescription = QString::fromUcs4((uint *) descData);
-					}
+					m_productDescription = QString::fromWCharArray(descData);
 				}
 				free(descData);
 			}




More information about the scribus-commit mailing list