Commit b7504145 authored by jean-pierre charras's avatar jean-pierre charras

Pcbnew: fix bug Bug #1184362 (Pcbnew losing user (custom) sheet size )

Fix minor issues in print/plot: filename not printed, sheetname incorrect in eeschema
parent 8ccf0320
......@@ -328,8 +328,8 @@ void PAGE_INFO::Format( OUTPUTFORMATTER* aFormatter, int aNestLevel, int aContro
// Internally, the page size is in mils
if( GetType() == PAGE_INFO::Custom )
aFormatter->Print( 0, " %g %g",
GetCustomWidthMils() * 25.4 / 1000.0,
GetCustomHeightMils() * 25.4 / 1000.0 );
GetWidthMils() * 25.4 / 1000.0,
GetHeightMils() * 25.4 / 1000.0 );
if( !IsCustom() && IsPortrait() )
aFormatter->Print( 0, " portrait" );
......
......@@ -98,8 +98,8 @@ void PlotWorkSheet( PLOTTER* plotter, const TITLE_BLOCK& aTitleBlock,
drawList.SetSheetNumber( aSheetNumber );
drawList.SetSheetCount( aNumberOfSheets );
drawList.BuildWorkSheetGraphicList( aPageInfo.GetType(), aFilename,
aSheetDesc, aTitleBlock, plotColor, plotColor );
drawList.BuildWorkSheetGraphicList( aPageInfo.GetType(), aSheetDesc,
aFilename, aTitleBlock, plotColor, plotColor );
// Draw item list
for( WS_DRAW_ITEM_BASE* item = drawList.GetFirst(); item;
......
......@@ -198,11 +198,9 @@ const wxString EDA_DRAW_FRAME::GetXYSheetReferences( const wxPoint& aPosition )
wxString EDA_DRAW_FRAME::GetScreenDesc()
{
wxString msg;
msg << GetScreen()->m_ScreenNumber << wxT( "/" )
<< GetScreen()->m_NumberOfScreens;
return msg;
// Virtual function, in basic function, returns
// an empty string.
return wxEmptyString;
}
// returns the full text corresponding to the aTextbase,
......
......@@ -403,7 +403,7 @@ void SCH_PRINTOUT::DrawPage( SCH_SCREEN* aScreen )
if( printReference )
parent->DrawWorkSheet( dc, aScreen, GetDefaultLineThickness(),
IU_PER_MILS, parent->GetScreenDesc() );
IU_PER_MILS, aScreen->GetFileName() );
g_DrawBgColor = bg_color;
aScreen->m_IsPrinting = false;
......
......@@ -163,10 +163,15 @@ void BOARD_PRINTOUT_CONTROLLER::DrawPage()
wxBusyCursor dummy;
#ifdef PCBNEW
boardBoundingBox =((PCB_BASE_FRAME*) m_Parent)->GetBoard()->ComputeBoundingBox();
#else
#if defined (PCBNEW)
BOARD * brd = ((PCB_BASE_FRAME*) m_Parent)->GetBoard();
boardBoundingBox = brd->ComputeBoundingBox();
wxString titleblockFilename = brd->GetFileName();
#elif defined (GERBVIEW)
boardBoundingBox = ((GERBVIEW_FRAME*) m_Parent)->GetLayoutBoundingBox();
wxString titleblockFilename; // TODO see if we uses the gerber file name
#else
#error BOARD_PRINTOUT_CONTROLLER::DrawPage() works only for PCBNEW or GERBVIEW
#endif
// Use the page size as the drawing area when the board is shown or the user scale
......@@ -359,7 +364,7 @@ void BOARD_PRINTOUT_CONTROLLER::DrawPage()
if( m_PrintParams.PrintBorderAndTitleBlock() )
m_Parent->DrawWorkSheet( dc, screen, m_PrintParams.m_PenDefaultSize,
IU_PER_MILS, m_Parent->GetScreenDesc() );
IU_PER_MILS, titleblockFilename );
m_Parent->PrintPage( dc, m_PrintParams.m_PrintMaskLayer, printMirror, &m_PrintParams );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment