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

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
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -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" );
+2 −2
Original line number Original line Diff line number Diff line
@@ -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;
+3 −5
Original line number Original line Diff line number Diff line
@@ -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,
+1 −1
Original line number Original line Diff line number Diff line
@@ -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;
+9 −4
Original line number Original line Diff line number Diff line
@@ -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()


    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 );