support for the AllPages attribute, proper round trip and fixes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35397 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -262,8 +262,19 @@ void wxMacCarbonPrintData::TransferTo( wxPrintDialogData* data )
|
|||||||
UInt32 from , to ;
|
UInt32 from , to ;
|
||||||
PMGetFirstPage( m_macPrintSettings , &from ) ;
|
PMGetFirstPage( m_macPrintSettings , &from ) ;
|
||||||
PMGetLastPage( m_macPrintSettings , &to ) ;
|
PMGetLastPage( m_macPrintSettings , &to ) ;
|
||||||
data->SetFromPage( from ) ;
|
if ( to >= 0x7FFFFFFF ) // due to an OS Bug we don't get back kPMPrintAllPages
|
||||||
data->SetToPage( to ) ;
|
{
|
||||||
|
data->SetAllPages( true ) ;
|
||||||
|
// This means all pages, more or less
|
||||||
|
data->SetFromPage(1);
|
||||||
|
data->SetToPage(32000);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
data->SetFromPage( from ) ;
|
||||||
|
data->SetToPage( to ) ;
|
||||||
|
data->SetAllPages( false );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxMacCarbonPrintData::TransferFrom( wxPrintDialogData* data )
|
void wxMacCarbonPrintData::TransferFrom( wxPrintDialogData* data )
|
||||||
@@ -272,14 +283,13 @@ void wxMacCarbonPrintData::TransferFrom( wxPrintDialogData* data )
|
|||||||
PMSetCopies( m_macPrintSettings , data->GetNoCopies() , false ) ;
|
PMSetCopies( m_macPrintSettings , data->GetNoCopies() , false ) ;
|
||||||
PMSetFirstPage( m_macPrintSettings , data->GetFromPage() , false ) ;
|
PMSetFirstPage( m_macPrintSettings , data->GetFromPage() , false ) ;
|
||||||
|
|
||||||
int toPage = data->GetToPage();
|
if (data->GetAllPages() || data->GetFromPage() == 0)
|
||||||
if (toPage < 1)
|
|
||||||
{
|
{
|
||||||
PMSetLastPage( m_macPrintSettings , kPMPrintAllPages, true ) ;
|
PMSetLastPage( m_macPrintSettings , (UInt32) kPMPrintAllPages, true ) ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
PMSetLastPage( m_macPrintSettings , toPage , false ) ;
|
PMSetLastPage( m_macPrintSettings , (UInt32) data->GetToPage() , false ) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user