[Libreoffice-commits] core.git: 2 commits - vcl/inc vcl/unx
Caolán McNamara
caolanm at redhat.com
Thu Feb 19 04:34:03 PST 2015
vcl/inc/cairotextrender.hxx | 3 +--
vcl/unx/generic/gdi/cairotextrender.cxx | 19 +++++++------------
vcl/unx/generic/gdi/openglx11cairotextrender.cxx | 4 ++--
vcl/unx/generic/gdi/openglx11cairotextrender.hxx | 2 +-
vcl/unx/generic/gdi/salgdi.cxx | 4 ++--
vcl/unx/generic/gdi/x11cairotextrender.cxx | 5 ++---
vcl/unx/generic/gdi/x11cairotextrender.hxx | 2 +-
vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx | 8 ++------
8 files changed, 18 insertions(+), 29 deletions(-)
New commits:
commit 8d9365ba5ac2aa0ce47fe46615c23b6e70ae8f60
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Feb 19 12:33:10 2015 +0000
gdk_screen_get_font_options is always available in gtk3
Change-Id: I680ed37995b12abf54526b9205b131a62b5cf734
diff --git a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
index 1f906c5..db08c02 100644
--- a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
@@ -1328,7 +1328,7 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
psp::PrintFontManager::get().matchFont( aInfo, rSettings.GetUILanguageTag().getLocale() );
fprintf( stderr, "font match %s, name AFTER: \"%s\"\n",
aInfo.m_nID != 0 ? "succeeded" : "failed",
- OUStringToOString( aInfo.m_aStyleName, RTL_TEXTENCODING_ISO_8859_1 ).getStr() );
+ OUStringToOString( aInfo.m_aFamilyName, RTL_TEXTENCODING_ISO_8859_1 ).getStr() );
int nPointHeight = 0;
/*sal_Int32 nDispDPIY = GetDisplay()->GetResolution().B();
@@ -1428,11 +1428,7 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
aStyleSet.SetToolbarIconSize( STYLE_TOOLBAR_ICONSIZE_LARGE );
- const cairo_font_options_t* pNewOptions = NULL;
- static cairo_font_options_t* (*gdk_screen_get_font_options)(GdkScreen*) =
- reinterpret_cast<cairo_font_options_t*(*)(GdkScreen*)>(osl_getAsciiFunctionSymbol( GetSalData()->m_pPlugin, "gdk_screen_get_font_options" ));
- if( gdk_screen_get_font_options != NULL )
- pNewOptions = gdk_screen_get_font_options( pScreen );
+ const cairo_font_options_t* pNewOptions = gdk_screen_get_font_options(pScreen);
aStyleSet.SetCairoFontOptions( pNewOptions );
// finally update the collected settings
rSettings.SetStyleSettings( aStyleSet );
commit a33fcd1dbcb458002d6e52244bb4f7de41df2d30
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Feb 19 12:31:47 2015 +0000
bPrinter is always false, simplify
Change-Id: If40d1ccdec77c1bf0753411da71ac5c0b42c2765
diff --git a/vcl/inc/cairotextrender.hxx b/vcl/inc/cairotextrender.hxx
index e47b7b3..fce14aa 100644
--- a/vcl/inc/cairotextrender.hxx
+++ b/vcl/inc/cairotextrender.hxx
@@ -70,7 +70,6 @@ public:
class CairoTextRender : public TextRenderImpl
{
- bool mbPrinter;
ServerFont* mpServerFont[ MAX_FALLBACK ];
SalColor mnTextColor;
@@ -89,7 +88,7 @@ protected:
virtual void clipRegion(cairo_t* cr) = 0;
public:
- CairoTextRender(bool bPrinter);
+ CairoTextRender();
virtual void SetTextColor( SalColor nSalColor ) SAL_OVERRIDE;
diff --git a/vcl/unx/generic/gdi/cairotextrender.cxx b/vcl/unx/generic/gdi/cairotextrender.cxx
index 12fce1d..edc0c02 100644
--- a/vcl/unx/generic/gdi/cairotextrender.cxx
+++ b/vcl/unx/generic/gdi/cairotextrender.cxx
@@ -40,9 +40,8 @@
#include <cairo-xlib.h>
#include <cairo-xlib-xrender.h>
-CairoTextRender::CairoTextRender(bool bPrinter):
- mbPrinter(bPrinter),
- mnTextColor(MAKE_SALCOLOR(0x00, 0x00, 0x00)) //black
+CairoTextRender::CairoTextRender()
+ : mnTextColor(MAKE_SALCOLOR(0x00, 0x00, 0x00)) //black
{
for( int i = 0; i < MAX_FALLBACK; ++i )
mpServerFont[i] = NULL;
@@ -89,13 +88,9 @@ bool CairoTextRender::setFont( const FontSelectPattern *pEntry, int nFallbackLev
// register to use the font
mpServerFont[ nFallbackLevel ] = pServerFont;
- // apply font specific-hint settings if needed
- // TODO: also disable it for reference devices
- if( !mbPrinter )
- {
- ImplServerFontEntry* pSFE = static_cast<ImplServerFontEntry*>( pEntry->mpFontEntry );
- pSFE->HandleFontOptions();
- }
+ // apply font specific-hint settings
+ ImplServerFontEntry* pSFE = static_cast<ImplServerFontEntry*>( pEntry->mpFontEntry );
+ pSFE->HandleFontOptions();
return true;
}
@@ -370,9 +365,9 @@ bool CairoTextRender::GetFontCapabilities(vcl::FontCapabilities &rGetImplFontCap
sal_uInt16 CairoTextRender::SetFont( FontSelectPattern *pEntry, int nFallbackLevel )
{
sal_uInt16 nRetVal = 0;
- if( !setFont( pEntry, nFallbackLevel ) )
+ if (!setFont(pEntry, nFallbackLevel))
nRetVal |= SAL_SETFONT_BADFONT;
- if( mbPrinter || (mpServerFont[ nFallbackLevel ] != NULL) )
+ if (mpServerFont[nFallbackLevel])
nRetVal |= SAL_SETFONT_USEDRAWTEXTARRAY;
return nRetVal;
}
diff --git a/vcl/unx/generic/gdi/openglx11cairotextrender.cxx b/vcl/unx/generic/gdi/openglx11cairotextrender.cxx
index 64bf196..57cae49 100644
--- a/vcl/unx/generic/gdi/openglx11cairotextrender.cxx
+++ b/vcl/unx/generic/gdi/openglx11cairotextrender.cxx
@@ -15,8 +15,8 @@
#include <cairo-svg.h>
-OpenGLX11CairoTextRender::OpenGLX11CairoTextRender(bool bPrinter, X11SalGraphics& rParent):
- X11CairoTextRender(bPrinter, rParent)
+OpenGLX11CairoTextRender::OpenGLX11CairoTextRender(X11SalGraphics& rParent)
+ : X11CairoTextRender(rParent)
{
}
diff --git a/vcl/unx/generic/gdi/openglx11cairotextrender.hxx b/vcl/unx/generic/gdi/openglx11cairotextrender.hxx
index 1719496..7336021 100644
--- a/vcl/unx/generic/gdi/openglx11cairotextrender.hxx
+++ b/vcl/unx/generic/gdi/openglx11cairotextrender.hxx
@@ -15,7 +15,7 @@
class OpenGLX11CairoTextRender : public X11CairoTextRender
{
public:
- OpenGLX11CairoTextRender(bool bPrinter, X11SalGraphics& rParent);
+ OpenGLX11CairoTextRender(X11SalGraphics& rParent);
virtual cairo_surface_t* getCairoSurface() SAL_OVERRIDE;
virtual void getSurfaceOffset(double& nDX, double& nDY) SAL_OVERRIDE;
diff --git a/vcl/unx/generic/gdi/salgdi.cxx b/vcl/unx/generic/gdi/salgdi.cxx
index 8bd4073..375a9dd 100644
--- a/vcl/unx/generic/gdi/salgdi.cxx
+++ b/vcl/unx/generic/gdi/salgdi.cxx
@@ -86,11 +86,11 @@ X11SalGraphics::X11SalGraphics():
if (OpenGLHelper::isVCLOpenGLEnabled())
{
mxImpl.reset(new X11OpenGLSalGraphicsImpl(*this));
- mxTextRenderImpl.reset((new OpenGLX11CairoTextRender(false, *this)));
+ mxTextRenderImpl.reset((new OpenGLX11CairoTextRender(*this)));
}
else
{
- mxTextRenderImpl.reset((new X11CairoTextRender(false, *this)));
+ mxTextRenderImpl.reset((new X11CairoTextRender(*this)));
mxImpl.reset(new X11SalGraphicsImpl(*this));
}
diff --git a/vcl/unx/generic/gdi/x11cairotextrender.cxx b/vcl/unx/generic/gdi/x11cairotextrender.cxx
index f3aa47d..30549ba 100644
--- a/vcl/unx/generic/gdi/x11cairotextrender.cxx
+++ b/vcl/unx/generic/gdi/x11cairotextrender.cxx
@@ -42,9 +42,8 @@ struct _XRegion
BOX extents;
};
-X11CairoTextRender::X11CairoTextRender(bool bPrinter, X11SalGraphics& rParent):
- CairoTextRender(bPrinter),
- mrParent(rParent)
+X11CairoTextRender::X11CairoTextRender(X11SalGraphics& rParent)
+ : mrParent(rParent)
{
}
diff --git a/vcl/unx/generic/gdi/x11cairotextrender.hxx b/vcl/unx/generic/gdi/x11cairotextrender.hxx
index 1449b3a..28470c39 100644
--- a/vcl/unx/generic/gdi/x11cairotextrender.hxx
+++ b/vcl/unx/generic/gdi/x11cairotextrender.hxx
@@ -37,7 +37,7 @@ protected:
size_t GetHeight() const;
public:
- X11CairoTextRender(bool bPrinter, X11SalGraphics& rParent);
+ X11CairoTextRender(X11SalGraphics& rParent);
virtual GlyphCache& getPlatformGlyphCache() SAL_OVERRIDE;
virtual cairo_surface_t* getCairoSurface() SAL_OVERRIDE;
More information about the Libreoffice-commits
mailing list