[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - 2 commits - vcl/source
László Németh
nemeth at numbertext.org
Wed Apr 9 07:54:52 PDT 2014
vcl/source/glyphs/graphite_layout.cxx | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
New commits:
commit bffdb3eefe6ae5a6a758c5401d3558724fbaaa05
Author: László Németh <nemeth at numbertext.org>
Date: Wed Apr 9 12:10:15 2014 +0200
fdo#70666 avoid only bad Graphite ligature replacement
Change-Id: Ibd42c70edbd8a5ca5eba34bcb92e801c8dc97ba0
diff --git a/vcl/source/glyphs/graphite_layout.cxx b/vcl/source/glyphs/graphite_layout.cxx
index 58f9b23..9014669 100644
--- a/vcl/source/glyphs/graphite_layout.cxx
+++ b/vcl/source/glyphs/graphite_layout.cxx
@@ -594,12 +594,14 @@ gr_segment * GraphiteLayout::CreateSegment(ImplLayoutArgs& rArgs)
}
}
+ size_t numchars = gr_count_unicode_characters(gr_utf16, rArgs.mpStr + mnSegCharOffset,
+ rArgs.mpStr + (rArgs.mnLength > limit + 64 ? limit + 64 : rArgs.mnLength), NULL);
static com::sun::star::uno::Reference< com::sun::star::i18n::XCharacterClassification > xCharClass;
if ( !xCharClass.is() )
xCharClass = vcl::unohelper::CreateCharacterClassification();
- int numchars = rArgs.mnEndCharPos - mnSegCharOffset; // fdo#52540, fdo#68313, fdo#70666 avoid bad ligature replacement
- if (xCharClass->getType(rArgs.mpStr, numchars + 1) != ::com::sun::star::i18n::UnicodeType::LOWERCASE_LETTER)
- numchars += 64;
+ int numchars2 = rArgs.mnEndCharPos - mnSegCharOffset; // fdo#52540, fdo#68313, fdo#70666 avoid bad ligature replacement
+ if (numchars > numchars2 && xCharClass->getType(rArgs.mpStr, numchars2 + 1) == ::com::sun::star::i18n::UnicodeType::LOWERCASE_LETTER)
+ numchars = numchars2;
if (mpFeatures)
pSegment = gr_make_seg(mpFont, mpFace, 0, mpFeatures->values(), gr_utf16,
rArgs.mpStr + mnSegCharOffset, numchars, bRtl);
commit 9f132a147c5d0f92b66837bb5816eb2a2b700f2c
Author: László Németh <nemeth at numbertext.org>
Date: Tue Feb 4 19:10:44 2014 +0100
fdo#70666 fix Graphite ligature replacement at line breaks
Change-Id: I5b7c149f7f419ba18bd2cc59f4e77a0b61280caa
diff --git a/vcl/source/glyphs/graphite_layout.cxx b/vcl/source/glyphs/graphite_layout.cxx
index 348c4e3..58f9b23 100644
--- a/vcl/source/glyphs/graphite_layout.cxx
+++ b/vcl/source/glyphs/graphite_layout.cxx
@@ -48,6 +48,10 @@
#include <unicode/ubidi.h>
#include <unicode/uscript.h>
+#include <vcl/unohelp.hxx>
+#include <com/sun/star/i18n/XCharacterClassification.hpp>
+#include <com/sun/star/i18n/UnicodeType.hpp>
+
// Graphite Libraries (must be after vcl headers on windows)
#include <graphite2/Segment.h>
@@ -589,9 +593,13 @@ gr_segment * GraphiteLayout::CreateSegment(ImplLayoutArgs& rArgs)
nSegCharLimit - rArgs.mnEndCharPos, bRtl);
}
}
-// int numchars = gr_count_unicode_characters(gr_utf16, rArgs.mpStr + mnSegCharOffset,
-// rArgs.mpStr + (rArgs.mnLength > limit + 64 ? limit + 64 : rArgs.mnLength), NULL);
- int numchars = rArgs.mnEndCharPos - mnSegCharOffset; // fdo#52540, fdo#68313, FIXME
+
+ static com::sun::star::uno::Reference< com::sun::star::i18n::XCharacterClassification > xCharClass;
+ if ( !xCharClass.is() )
+ xCharClass = vcl::unohelper::CreateCharacterClassification();
+ int numchars = rArgs.mnEndCharPos - mnSegCharOffset; // fdo#52540, fdo#68313, fdo#70666 avoid bad ligature replacement
+ if (xCharClass->getType(rArgs.mpStr, numchars + 1) != ::com::sun::star::i18n::UnicodeType::LOWERCASE_LETTER)
+ numchars += 64;
if (mpFeatures)
pSegment = gr_make_seg(mpFont, mpFace, 0, mpFeatures->values(), gr_utf16,
rArgs.mpStr + mnSegCharOffset, numchars, bRtl);
More information about the Libreoffice-commits
mailing list