From 9654ec5613ff2b5c82136dff8a4881129292836e Mon Sep 17 00:00:00 2001 From: Bernhard Stegmaier Date: Mon, 16 Jun 2014 11:42:27 -0500 Subject: [PATCH] Fixes --- common/kiface_i.cpp | 11 +++++++---- pagelayout_editor/pl_editor_frame.h | 4 ++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/common/kiface_i.cpp b/common/kiface_i.cpp index 42d7799597..f7772a1e35 100644 --- a/common/kiface_i.cpp +++ b/common/kiface_i.cpp @@ -123,10 +123,13 @@ bool KIFACE_I::start_common( int aCtlBits ) void KIFACE_I::end_common() { - /* Save common preferences; the background still uses the old legacy - * color numbers, not the new names */ - m_bm.m_config->Write( showPageLimitsKey, g_ShowPageLimits ); - m_bm.m_config->Write( backgroundColorKey, int( g_DrawBgColor ) ); + if( m_bm.m_config ) + { + // Save common preferences; the background still uses the old legacy + // color numbers, not the new names + m_bm.m_config->Write( showPageLimitsKey, g_ShowPageLimits ); + m_bm.m_config->Write( backgroundColorKey, int( g_DrawBgColor ) ); + } m_bm.End(); } diff --git a/pagelayout_editor/pl_editor_frame.h b/pagelayout_editor/pl_editor_frame.h index e675cb9c9b..e266e1ca26 100644 --- a/pagelayout_editor/pl_editor_frame.h +++ b/pagelayout_editor/pl_editor_frame.h @@ -108,9 +108,9 @@ public: const PAGE_INFO& GetPageSettings () const; // overload EDA_DRAW_FRAME const wxSize GetPageSizeIU() const; // overload EDA_DRAW_FRAME - PL_EDITOR_SCREEN* GetScreen() + PL_EDITOR_SCREEN* GetScreen() const // overload EDA_DRAW_FRAME { - return (PL_EDITOR_SCREEN*) m_canvas->GetScreen(); + return (PL_EDITOR_SCREEN*) EDA_DRAW_FRAME::GetScreen(); } const wxPoint& GetAuxOrigin() const // overload EDA_DRAW_FRAME