Browse Source

PANEL_SETUP_BOARD_STACKUP: fix a wxassert due to a "C" locale test in a format function.

A call to FormatInternalUnits() was made without switching to "C" locale.
In this case it was not necessary, but FormatInternalUnits() expects in some tests
this locale, thus creating issues (assert and incorrect conversion)

Fixes #8177
https://gitlab.com/kicad/code/kicad/issues/8177
6.0.7
jean-pierre charras 5 years ago
parent
commit
675ec70f0f
  1. 8
      pcbnew/board_stackup_manager/panel_board_stackup.cpp

8
pcbnew/board_stackup_manager/panel_board_stackup.cpp

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2019 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2019-2020 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2019-2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -44,6 +44,8 @@
#include <wx/choicdlg.h>
#include <wx/dcclient.h>
#include <locale_io.h>
// Some wx widget ID to know what widget has fired a event:
#define ID_INCREMENT 256 // space between 2 ID type. Bigger than the layer count max
@ -1054,6 +1056,10 @@ bool PANEL_SETUP_BOARD_STACKUP::TransferDataFromWindow()
BOARD_STACKUP& brd_stackup = m_brdSettings->GetStackupDescriptor();
STRING_FORMATTER old_stackup;
// FormatBoardStackup() (using FormatInternalUnits()) expects a "C" locale
// to execute some tests. So switch to the suitable locale
LOCALE_IO dummy;
brd_stackup.FormatBoardStackup( &old_stackup, m_board, 0 );
brd_stackup.m_FinishType = m_stackup.m_FinishType;

Loading…
Cancel
Save