[Libreoffice-commits] core.git: vcl/generic vcl/unx

Stephan Bergmann sbergman at redhat.com
Tue Nov 17 04:34:42 PST 2015


 vcl/generic/fontmanager/fontmanager.cxx |    3 ++-
 vcl/generic/glyphs/gcach_layout.cxx     |    4 +++-
 vcl/generic/print/glyphset.cxx          |    2 +-
 vcl/generic/print/text_gfx.cxx          |    2 +-
 vcl/unx/kde4/KDE4FilePicker.cxx         |    3 ++-
 5 files changed, 9 insertions(+), 5 deletions(-)

New commits:
commit 0a73e77b65510b79b653ca13bcf5ebc9a9ddc6c4
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Nov 17 13:34:17 2015 +0100

    Don't assume sal_Unicode is unsigned short
    
    Change-Id: I3266bb049be3a9b558b68b40d741efdcab2eb759

diff --git a/vcl/generic/fontmanager/fontmanager.cxx b/vcl/generic/fontmanager/fontmanager.cxx
index 91d2bdd..f8cbc7d 100644
--- a/vcl/generic/fontmanager/fontmanager.cxx
+++ b/vcl/generic/fontmanager/fontmanager.cxx
@@ -2188,7 +2188,8 @@ std::list< OString > PrintFontManager::getAdobeNameFromUnicode( sal_Unicode aCha
     if( aRet.empty() && aChar != 0 )
     {
         sal_Char aBuf[8];
-        sal_Int32 nChars = snprintf( aBuf, sizeof( aBuf ), "uni%.4hX", aChar );
+        sal_Int32 nChars = snprintf(
+            aBuf, sizeof(aBuf), "uni%.4hX", sal_uInt16(aChar));
         aRet.push_back( OString( aBuf, nChars ) );
     }
 
diff --git a/vcl/generic/glyphs/gcach_layout.cxx b/vcl/generic/glyphs/gcach_layout.cxx
index 83498f6..38ea6ac 100644
--- a/vcl/generic/glyphs/gcach_layout.cxx
+++ b/vcl/generic/glyphs/gcach_layout.cxx
@@ -483,7 +483,9 @@ bool HbLayoutEngine::Layout(ServerFontLayout& rLayout, ImplLayoutArgs& rArgs)
             hb_buffer_set_script(pHbBuffer, maHbScript);
             hb_buffer_set_language(pHbBuffer, hb_language_from_string(sLanguage.getStr(), -1));
             hb_buffer_set_flags(pHbBuffer, (hb_buffer_flags_t) nHbFlags);
-            hb_buffer_add_utf16(pHbBuffer, pStr, nLength, nMinRunPos, nRunLen);
+            hb_buffer_add_utf16(
+                pHbBuffer, reinterpret_cast<uint16_t const *>(pStr), nLength,
+                nMinRunPos, nRunLen);
             hb_shape(pHbFont, pHbBuffer, nullptr, 0);
 
             int nRunGlyphCount = hb_buffer_get_length(pHbBuffer);
diff --git a/vcl/generic/print/glyphset.cxx b/vcl/generic/print/glyphset.cxx
index 2d6f221..b004a5e 100644
--- a/vcl/generic/print/glyphset.cxx
+++ b/vcl/generic/print/glyphset.cxx
@@ -749,7 +749,7 @@ GlyphSet::PSUploadFont (osl::File& rOutFile, PrinterGfx &rGfx, bool bAllowType42
         return false;
 
     // array of unicode source characters
-    sal_Unicode pUChars[256];
+    sal_uInt16 pUChars[256];
 
     // encoding vector maps character encoding to the ordinal number
     // of the glyph in the output file
diff --git a/vcl/generic/print/text_gfx.cxx b/vcl/generic/print/text_gfx.cxx
index 7531f3f..8f46d9c 100644
--- a/vcl/generic/print/text_gfx.cxx
+++ b/vcl/generic/print/text_gfx.cxx
@@ -633,7 +633,7 @@ PrinterGfx::getCharMetric (const Font2 &rFont, sal_Unicode n_char, CharacterMetr
 }
 
 sal_Int32
-PrinterGfx::GetCharWidth (sal_Unicode nFrom, sal_Unicode nTo, long *pWidthArray)
+PrinterGfx::GetCharWidth (sal_uInt16 nFrom, sal_uInt16 nTo, long *pWidthArray)
 {
     Font2 aFont(*this);
     if (aFont.IsSymbolFont() && (nFrom < 256) && (nTo < 256))
diff --git a/vcl/unx/kde4/KDE4FilePicker.cxx b/vcl/unx/kde4/KDE4FilePicker.cxx
index 5576c09..225f361 100644
--- a/vcl/unx/kde4/KDE4FilePicker.cxx
+++ b/vcl/unx/kde4/KDE4FilePicker.cxx
@@ -104,7 +104,8 @@ OUString toOUString(const QString& s)
 
 QString toQString(const OUString& s)
 {
-    return QString::fromUtf16(s.getStr(), s.getLength());
+    return QString::fromUtf16(
+        reinterpret_cast<ushort const *>(s.getStr()), s.getLength());
 }
 
 // KDE4FilePicker


More information about the Libreoffice-commits mailing list