Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


Hi,

See
http://cgit.freedesktop.org/libreoffice/core/commit/?id=f8bda24

Regression from 3.4; backported patch attached.

(Requesting -3-5 only, not critical enough to mess ith -3-5-3.)

Thanks,

Miklos
From 3951b63724f5a965903de522361926d190e9bcf8 Mon Sep 17 00:00:00 2001
From: Miklos Vajna <vmiklos@suse.cz>
Date: Sat, 21 Apr 2012 11:25:18 +0200
Subject: [PATCH] fdo#48023 fix RTF import of Russian characters without an
 encoding specified

lcl_GetDefaultTextEncodingForRTF() in editeng did the same.
---
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 023b6c6..f482077 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -549,13 +549,26 @@ sal_uInt32 RTFDocumentImpl::getColorTable(sal_uInt32 nIndex)
     return 0;
 }
 
+rtl_TextEncoding lcl_getDefaultTextEncoding()
+{
+
+    const OUString& rLanguage = Application::GetSettings().GetLocale().Language;
+
+    if (rLanguage == "ru" || rLanguage == "uk")
+        return RTL_TEXTENCODING_MS_1251;
+    if (rLanguage == "tr")
+        return RTL_TEXTENCODING_MS_1254;
+    else
+        return RTL_TEXTENCODING_MS_1252;
+}
+
 rtl_TextEncoding RTFDocumentImpl::getEncoding(sal_uInt32 nFontIndex)
 {
     if (!m_pSuperstream)
     {
         if (nFontIndex < m_aFontEncodings.size())
             return m_aFontEncodings[nFontIndex];
-        return 0;
+        return lcl_getDefaultTextEncoding();
     }
     else
         return m_pSuperstream->getEncoding(nFontIndex);
-- 
1.7.7


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.