Blame SOURCES/0001-Pasting-from-a-pdf-from-a-fallback-font-doesn-t-give.patch

a9add1
From 924126df792915092ee6201d1f068e43ffb80b67 Mon Sep 17 00:00:00 2001
a9add1
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
a9add1
Date: Sun, 24 Apr 2016 21:24:41 +0100
a9add1
Subject: [PATCH] Pasting -- from a pdf from a fallback font doesn't give -- as
a9add1
 output
a9add1
a9add1
Type -- into a writer document, on a machine without Courier installed
a9add1
set that text to Courier. Export to pdf, select inside e.g. evince and
a9add1
paste to a terminal. You don't get --
a9add1
a9add1
0x2D is mapped from unicode 0x2D and unicode 0xAD in the adobe
a9add1
encoding. So the latter trumps the earlier one and <ADAD> is pasted
a9add1
instead of <2D2D>.
a9add1
a9add1
Reverse the order that the encoding is mapped from unicode so lower
a9add1
more "ascii" options are preferred over the higher more "unlikely"
a9add1
unicode options
a9add1
a9add1
Change-Id: I8f251253fca468d269493801e668617a935ee15d
a9add1
---
a9add1
 vcl/source/gdi/pdfwriter_impl.cxx | 2 +-
a9add1
 1 file changed, 1 insertion(+), 1 deletion(-)
a9add1
a9add1
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
a9add1
index ee9b0df..4ee0366 100644
a9add1
--- a/vcl/source/gdi/pdfwriter_impl.cxx
a9add1
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
a9add1
@@ -3096,7 +3096,7 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const Physical
a9add1
         memset( nEncodedCodes, 0, sizeof(nEncodedCodes) );
a9add1
         memset( pUnicodesPerGlyph, 0, sizeof(pUnicodesPerGlyph) );
a9add1
         memset( pEncToUnicodeIndex, 0, sizeof(pEncToUnicodeIndex) );
a9add1
-        for( Ucs2SIntMap::const_iterator it = pEncoding->begin(); it != pEncoding->end(); ++it )
a9add1
+        for( Ucs2SIntMap::const_reverse_iterator it = pEncoding->rbegin(); it != pEncoding->rend(); ++it )
a9add1
         {
a9add1
             if(it->second == -1)
a9add1
                 continue;
a9add1
-- 
a9add1
2.7.3
a9add1