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 ...@@ -328,8 +328,8 @@ void PAGE_INFO::Format( OUTPUTFORMATTER* aFormatter, int aNestLevel, int aContro
// Internally, the page size is in mils // Internally, the page size is in mils
if( GetType() == PAGE_INFO::Custom ) if( GetType() == PAGE_INFO::Custom )
aFormatter->Print( 0, " %g %g", aFormatter->Print( 0, " %g %g",
GetCustomWidthMils() * 25.4 / 1000.0, GetWidthMils() * 25.4 / 1000.0,
GetCustomHeightMils() * 25.4 / 1000.0 ); GetHeightMils() * 25.4 / 1000.0 );
if( !IsCustom() && IsPortrait() ) if( !IsCustom() && IsPortrait() )
aFormatter->Print( 0, " portrait" ); aFormatter->Print( 0, " portrait" );
......
...@@ -98,8 +98,8 @@ void PlotWorkSheet( PLOTTER* plotter, const TITLE_BLOCK& aTitleBlock, ...@@ -98,8 +98,8 @@ void PlotWorkSheet( PLOTTER* plotter, const TITLE_BLOCK& aTitleBlock,
drawList.SetSheetNumber( aSheetNumber ); drawList.SetSheetNumber( aSheetNumber );
drawList.SetSheetCount( aNumberOfSheets ); drawList.SetSheetCount( aNumberOfSheets );
drawList.BuildWorkSheetGraphicList( aPageInfo.GetType(), aFilename, drawList.BuildWorkSheetGraphicList( aPageInfo.GetType(), aSheetDesc,
aSheetDesc, aTitleBlock, plotColor, plotColor ); aFilename, aTitleBlock, plotColor, plotColor );
// Draw item list // Draw item list
for( WS_DRAW_ITEM_BASE* item = drawList.GetFirst(); item; for( WS_DRAW_ITEM_BASE* item = drawList.GetFirst(); item;
......
...@@ -198,11 +198,9 @@ const wxString EDA_DRAW_FRAME::GetXYSheetReferences( const wxPoint& aPosition ) ...@@ -198,11 +198,9 @@ const wxString EDA_DRAW_FRAME::GetXYSheetReferences( const wxPoint& aPosition )
wxString EDA_DRAW_FRAME::GetScreenDesc() wxString EDA_DRAW_FRAME::GetScreenDesc()
{ {
wxString msg; // Virtual function, in basic function, returns
// an empty string.
msg << GetScreen()->m_ScreenNumber << wxT( "/" ) return wxEmptyString;
<< GetScreen()->m_NumberOfScreens;
return msg;
} }
// returns the full text corresponding to the aTextbase, // returns the full text corresponding to the aTextbase,
......
...@@ -403,7 +403,7 @@ void SCH_PRINTOUT::DrawPage( SCH_SCREEN* aScreen ) ...@@ -403,7 +403,7 @@ void SCH_PRINTOUT::DrawPage( SCH_SCREEN* aScreen )
if( printReference ) if( printReference )
parent->DrawWorkSheet( dc, aScreen, GetDefaultLineThickness(), parent->DrawWorkSheet( dc, aScreen, GetDefaultLineThickness(),
IU_PER_MILS, parent->GetScreenDesc() ); IU_PER_MILS, aScreen->GetFileName() );
g_DrawBgColor = bg_color; g_DrawBgColor = bg_color;
aScreen->m_IsPrinting = false; aScreen->m_IsPrinting = false;
......
...@@ -163,10 +163,15 @@ void BOARD_PRINTOUT_CONTROLLER::DrawPage() ...@@ -163,10 +163,15 @@ void BOARD_PRINTOUT_CONTROLLER::DrawPage()
wxBusyCursor dummy; wxBusyCursor dummy;
#ifdef PCBNEW #if defined (PCBNEW)
boardBoundingBox =((PCB_BASE_FRAME*) m_Parent)->GetBoard()->ComputeBoundingBox(); BOARD * brd = ((PCB_BASE_FRAME*) m_Parent)->GetBoard();
#else boardBoundingBox = brd->ComputeBoundingBox();
wxString titleblockFilename = brd->GetFileName();
#elif defined (GERBVIEW)
boardBoundingBox = ((GERBVIEW_FRAME*) m_Parent)->GetLayoutBoundingBox(); 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 #endif
// Use the page size as the drawing area when the board is shown or the user scale // 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() ...@@ -359,7 +364,7 @@ void BOARD_PRINTOUT_CONTROLLER::DrawPage()
if( m_PrintParams.PrintBorderAndTitleBlock() ) if( m_PrintParams.PrintBorderAndTitleBlock() )
m_Parent->DrawWorkSheet( dc, screen, m_PrintParams.m_PenDefaultSize, 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 ); 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