[Libreoffice-commits] .: 2 commits - rsc/source vcl/unx
Caolán McNamara
caolan at kemper.freedesktop.org
Wed Mar 16 07:21:31 PDT 2011
rsc/source/parser/rscyacc.cxx | 2
vcl/unx/source/fontmanager/fontconfig.cxx | 63 +++++++++++++-----------------
2 files changed, 29 insertions(+), 36 deletions(-)
New commits:
commit cc8f350a5829405832af1177fd32de7c41c30724
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Mar 16 14:18:42 2011 +0000
Related: rhbz#680460 don't bother with an interim FontSet
I can't see why bother adding it to a FontSet and then
throw away the fontset, why not just use the pattern
directly and throw it away afterwards directly.
diff --git a/vcl/unx/source/fontmanager/fontconfig.cxx b/vcl/unx/source/fontmanager/fontconfig.cxx
index 3c2f636..92632c7 100644
--- a/vcl/unx/source/fontmanager/fontconfig.cxx
+++ b/vcl/unx/source/fontmanager/fontconfig.cxx
@@ -1130,43 +1130,36 @@ ImplFontOptions* PrintFontManager::getFontOptions(
FcPattern* pResult = rWrapper.FcFontSetMatch( pConfig, &pFontSet, 1, pPattern, &eResult );
if( pResult )
{
- FcFontSet* pSet = rWrapper.FcFontSetCreate();
- rWrapper.FcFontSetAdd( pSet, pResult );
- if( pSet->nfont > 0 )
+ FcResult eEmbeddedBitmap = rWrapper.FcPatternGetBool(pResult,
+ FC_EMBEDDED_BITMAP, 0, &embitmap);
+ FcResult eAntialias = rWrapper.FcPatternGetBool(pResult,
+ FC_ANTIALIAS, 0, &antialias);
+ FcResult eAutoHint = rWrapper.FcPatternGetBool(pResult,
+ FC_AUTOHINT, 0, &autohint);
+ FcResult eHinting = rWrapper.FcPatternGetBool(pResult,
+ FC_HINTING, 0, &hinting);
+ /*FcResult eHintStyle =*/ rWrapper.FcPatternGetInteger(pResult,
+ FC_HINT_STYLE, 0, &hintstyle);
+ rWrapper.FcPatternDestroy(pResult);
+
+ pOptions = new ImplFontOptions;
+
+ if( eEmbeddedBitmap == FcResultMatch )
+ pOptions->meEmbeddedBitmap = embitmap ? EMBEDDEDBITMAP_TRUE : EMBEDDEDBITMAP_FALSE;
+ if( eAntialias == FcResultMatch )
+ pOptions->meAntiAlias = antialias ? ANTIALIAS_TRUE : ANTIALIAS_FALSE;
+ if( eAutoHint == FcResultMatch )
+ pOptions->meAutoHint = autohint ? AUTOHINT_TRUE : AUTOHINT_FALSE;
+ if( eHinting == FcResultMatch )
+ pOptions->meHinting = hinting ? HINTING_TRUE : HINTING_FALSE;
+ switch (hintstyle)
{
- FcResult eEmbeddedBitmap = rWrapper.FcPatternGetBool(pSet->fonts[0],
- FC_EMBEDDED_BITMAP, 0, &embitmap);
- FcResult eAntialias = rWrapper.FcPatternGetBool(pSet->fonts[0],
- FC_ANTIALIAS, 0, &antialias);
- FcResult eAutoHint = rWrapper.FcPatternGetBool(pSet->fonts[0],
- FC_AUTOHINT, 0, &autohint);
- FcResult eHinting = rWrapper.FcPatternGetBool(pSet->fonts[0],
- FC_HINTING, 0, &hinting);
- /*FcResult eHintStyle =*/ rWrapper.FcPatternGetInteger( pSet->fonts[0],
- FC_HINT_STYLE, 0, &hintstyle);
-
- pOptions = new ImplFontOptions;
-
- if( eEmbeddedBitmap == FcResultMatch )
- pOptions->meEmbeddedBitmap = embitmap ? EMBEDDEDBITMAP_TRUE : EMBEDDEDBITMAP_FALSE;
- if( eAntialias == FcResultMatch )
- pOptions->meAntiAlias = antialias ? ANTIALIAS_TRUE : ANTIALIAS_FALSE;
- if( eAutoHint == FcResultMatch )
- pOptions->meAutoHint = autohint ? AUTOHINT_TRUE : AUTOHINT_FALSE;
- if( eHinting == FcResultMatch )
- pOptions->meHinting = hinting ? HINTING_TRUE : HINTING_FALSE;
- switch (hintstyle)
- {
- case FC_HINT_NONE: pOptions->meHintStyle = HINT_NONE; break;
- case FC_HINT_SLIGHT: pOptions->meHintStyle = HINT_SLIGHT; break;
- case FC_HINT_MEDIUM: pOptions->meHintStyle = HINT_MEDIUM; break;
- default: // fall through
- case FC_HINT_FULL: pOptions->meHintStyle = HINT_FULL; break;
- }
+ case FC_HINT_NONE: pOptions->meHintStyle = HINT_NONE; break;
+ case FC_HINT_SLIGHT: pOptions->meHintStyle = HINT_SLIGHT; break;
+ case FC_HINT_MEDIUM: pOptions->meHintStyle = HINT_MEDIUM; break;
+ default: // fall through
+ case FC_HINT_FULL: pOptions->meHintStyle = HINT_FULL; break;
}
- // info: destroying the pSet destroys pResult implicitly
- // since pResult was "added" to pSet
- rWrapper.FcFontSetDestroy( pSet );
}
// cleanup
commit 649614448ce9807b95d49bc1388c09c3366a8e5c
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Mar 16 13:04:13 2011 +0000
disable this warning for yacc code too
diff --git a/rsc/source/parser/rscyacc.cxx b/rsc/source/parser/rscyacc.cxx
index 61b17b0..10ef5c7 100644
--- a/rsc/source/parser/rscyacc.cxx
+++ b/rsc/source/parser/rscyacc.cxx
@@ -264,7 +264,7 @@ RSCINST GetFirstTupelEle( const RSCINST & rTop )
#if defined _MSC_VER
#pragma warning(push, 1)
-#pragma warning(disable:4129 4273 4701)
+#pragma warning(disable:4129 4273 4701 4702)
#endif
#include "yyrscyacc.cxx"
#if defined _MSC_VER
More information about the Libreoffice-commits
mailing list