diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-12-01 20:35:28 +0000 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2016-05-16 14:57:00 +0200 |
commit | b17ddfd50d9daf87b7128768419ff87634d6507c (patch) | |
tree | 397016c08e1ac5afb9303c27c3a26a4aae378044 | |
parent | bfaeaeeed2cc61ff92acc8330b8dc776d77e3b8c (diff) |
valgrind: scary warning that the cairo font options were deleted before use
Change-Id: I58427aafb30eca64a67bcf7dd9a7738d8da3e085
-rw-r--r-- | include/vcl/settings.hxx | 3 | ||||
-rw-r--r-- | vcl/inc/salinst.hxx | 4 | ||||
-rw-r--r-- | vcl/inc/unx/gtk/gtkinst.hxx | 2 | ||||
-rw-r--r-- | vcl/source/app/settings.cxx | 16 | ||||
-rw-r--r-- | vcl/unx/gtk/app/gtkinst.cxx | 5 | ||||
-rw-r--r-- | vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx | 4 | ||||
-rw-r--r-- | vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx | 3 |
7 files changed, 11 insertions, 26 deletions
diff --git a/include/vcl/settings.hxx b/include/vcl/settings.hxx index 006e758be579..6df8b0de7457 100644 --- a/include/vcl/settings.hxx +++ b/include/vcl/settings.hxx @@ -442,9 +442,6 @@ public: void SetPrimaryButtonWarpsSlider( bool bPrimaryButtonWarpsSlider ); bool GetPrimaryButtonWarpsSlider() const; - void SetCairoFontOptions( const void *pOptions ); - const void* GetCairoFontOptions() const; - void SetAppFont( const vcl::Font& rFont ); const vcl::Font& GetAppFont() const; diff --git a/vcl/inc/salinst.hxx b/vcl/inc/salinst.hxx index b04b4ca237a1..30ea53a83fb6 100644 --- a/vcl/inc/salinst.hxx +++ b/vcl/inc/salinst.hxx @@ -59,6 +59,8 @@ struct SystemWindowData; class Menu; enum class VclInputFlags; +typedef struct _cairo_font_options cairo_font_options_t; + class VCL_PLUGIN_PUBLIC SalInstance { private: @@ -177,6 +179,8 @@ public: virtual void updatePrinterUpdate() {} virtual void jobStartedPrinterUpdate() {} virtual void jobEndedPrinterUpdate() {} + + virtual const cairo_font_options_t* GetCairoFontOptions() { return nullptr; } }; // called from SVMain diff --git a/vcl/inc/unx/gtk/gtkinst.hxx b/vcl/inc/unx/gtk/gtkinst.hxx index bf506c361a45..bbacab640262 100644 --- a/vcl/inc/unx/gtk/gtkinst.hxx +++ b/vcl/inc/unx/gtk/gtkinst.hxx @@ -98,6 +98,8 @@ public: virtual css::uno::Reference< css::uno::XInterface > CreateClipboard( const css::uno::Sequence< css::uno::Any >& i_rArguments ) SAL_OVERRIDE; #endif + virtual const cairo_font_options_t* GetCairoFontOptions() override; + void RemoveTimer (SalTimer *pTimer); // for managing a mirror of the in-flight un-dispatched gdk event queue diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx index 664f755411f9..2f457c5afa6c 100644 --- a/vcl/source/app/settings.cxx +++ b/vcl/source/app/settings.cxx @@ -191,7 +191,6 @@ struct ImplStyleData bool mbPrimaryButtonWarpsSlider; DialogStyle maDialogStyle; FrameStyle maFrameStyle; - const void* mpFontOptions; sal_uInt16 mnEdgeBlending; Color maEdgeBlendingTopLeftColor; @@ -546,7 +545,6 @@ ImplStyleData::ImplStyleData() : mbAutoMnemonic = true; mnToolbarIconSize = ToolbarIconSize::Unknown; meUseImagesInMenus = TRISTATE_INDET; - mpFontOptions = NULL; mnEdgeBlending = 35; maEdgeBlendingTopLeftColor = RGB_COLORDATA(0xC0, 0xC0, 0xC0); maEdgeBlendingBottomRightColor = RGB_COLORDATA(0x40, 0x40, 0x40); @@ -667,7 +665,6 @@ ImplStyleData::ImplStyleData( const ImplStyleData& rData ) : mnToolbarIconSize = rData.mnToolbarIconSize; mIconThemeScanner.reset(new vcl::IconThemeScanner(*rData.mIconThemeScanner)); mIconThemeSelector.reset(new vcl::IconThemeSelector(*rData.mIconThemeSelector)); - mpFontOptions = rData.mpFontOptions; mnEdgeBlending = rData.mnEdgeBlending; maEdgeBlendingTopLeftColor = rData.maEdgeBlendingTopLeftColor; maEdgeBlendingBottomRightColor = rData.maEdgeBlendingBottomRightColor; @@ -1547,19 +1544,6 @@ StyleSettings::GetPrimaryButtonWarpsSlider() const } void -StyleSettings::SetCairoFontOptions( const void *pOptions ) -{ - CopyData(); - mxData->mpFontOptions = pOptions; -} - -const void* -StyleSettings::GetCairoFontOptions() const -{ - return mxData->mpFontOptions; -} - -void StyleSettings::SetAppFont( const vcl::Font& rFont ) { CopyData(); diff --git a/vcl/unx/gtk/app/gtkinst.cxx b/vcl/unx/gtk/app/gtkinst.cxx index 00a92618987a..d124da687730 100644 --- a/vcl/unx/gtk/app/gtkinst.cxx +++ b/vcl/unx/gtk/app/gtkinst.cxx @@ -468,4 +468,9 @@ GtkInstance::getPrintWrapper() const return m_xPrintWrapper; } +const cairo_font_options_t* GtkInstance::GetCairoFontOptions() +{ + return gdk_screen_get_font_options(gdk_screen_get_default()); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx index c4913b532bae..14e7541d249b 100644 --- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx @@ -3937,7 +3937,6 @@ void GtkSalGraphics::refreshFontconfig( GtkSettings *pSettings ) void GtkSalGraphics::updateSettings( AllSettings& rSettings ) { - GdkScreen* pScreen = gtk_widget_get_screen( m_pWindow ); gtk_widget_ensure_style( m_pWindow ); GtkStyle* pStyle = gtk_widget_get_style( m_pWindow ); GtkSettings* pSettings = gtk_widget_get_settings( m_pWindow ); @@ -4266,9 +4265,6 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings ) aStyleSet.SetToolbarIconSize( ToolbarIconSize::Large ); - const cairo_font_options_t* pNewOptions = gdk_screen_get_font_options( pScreen ); - aStyleSet.SetCairoFontOptions( pNewOptions ); - // finally update the collected settings rSettings.SetStyleSettings( aStyleSet ); } diff --git a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx index 4a71442b4901..e844c9dee558 100644 --- a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx @@ -1452,7 +1452,6 @@ static inline ::Color getColorFromColor( const GdkColor& rCol ) void GtkSalGraphics::updateSettings( AllSettings& rSettings ) { - GdkScreen* pScreen = gtk_widget_get_screen( mpWindow ); GtkStyleContext* pStyle = gtk_widget_get_style_context( mpWindow ); GtkSettings* pSettings = gtk_widget_get_settings( mpWindow ); StyleSettings aStyleSet = rSettings.GetStyleSettings(); @@ -1801,8 +1800,6 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings ) aStyleSet.SetToolbarIconSize( ToolbarIconSize::Large ); - const cairo_font_options_t* pNewOptions = gdk_screen_get_font_options(pScreen); - aStyleSet.SetCairoFontOptions( pNewOptions ); // finally update the collected settings rSettings.SetStyleSettings( aStyleSet ); gchar* pThemeName = NULL; |