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

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