Use wxSwap() function to swap values of variables
This commit is contained in:
@@ -1623,9 +1623,7 @@ void wxPostScriptDCImpl::DoGetSize(int* width, int* height) const
|
|||||||
|
|
||||||
if (m_printData.GetOrientation() == wxLANDSCAPE)
|
if (m_printData.GetOrientation() == wxLANDSCAPE)
|
||||||
{
|
{
|
||||||
int tmp = w;
|
wxSwap(w, h);
|
||||||
w = h;
|
|
||||||
h = tmp;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (width)
|
if (width)
|
||||||
@@ -1653,9 +1651,7 @@ void wxPostScriptDCImpl::DoGetSizeMM(int *width, int *height) const
|
|||||||
|
|
||||||
if (m_printData.GetOrientation() == wxLANDSCAPE)
|
if (m_printData.GetOrientation() == wxLANDSCAPE)
|
||||||
{
|
{
|
||||||
int tmp = w;
|
wxSwap(w, h);
|
||||||
w = h;
|
|
||||||
h = tmp;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (width) *width = w;
|
if (width) *width = w;
|
||||||
@@ -1789,8 +1785,8 @@ void wxPostScriptDCImpl::EndDoc ()
|
|||||||
wxCoord maxY = (wxCoord) YLOG2DEV(m_maxY);
|
wxCoord maxY = (wxCoord) YLOG2DEV(m_maxY);
|
||||||
|
|
||||||
// LOG2DEV may have changed the minimum to maximum vice versa
|
// LOG2DEV may have changed the minimum to maximum vice versa
|
||||||
if ( minX > maxX ) { wxCoord tmp = minX; minX = maxX; maxX = tmp; }
|
if ( minX > maxX ) { wxSwap(minX, maxX); }
|
||||||
if ( minY > maxY ) { wxCoord tmp = minY; minY = maxY; maxY = tmp; }
|
if ( minY > maxY ) { wxSwap(minY, maxY); }
|
||||||
|
|
||||||
// account for used scaling (boundingbox is before scaling in ps-file)
|
// account for used scaling (boundingbox is before scaling in ps-file)
|
||||||
double scale_x = m_printData.GetPrinterScaleX() / ms_PSScaleFactor;
|
double scale_x = m_printData.GetPrinterScaleX() / ms_PSScaleFactor;
|
||||||
@@ -1807,9 +1803,8 @@ void wxPostScriptDCImpl::EndDoc ()
|
|||||||
// If we're landscape, our sense of "x" and "y" is reversed.
|
// If we're landscape, our sense of "x" and "y" is reversed.
|
||||||
if (m_printData.GetOrientation() == wxLANDSCAPE)
|
if (m_printData.GetOrientation() == wxLANDSCAPE)
|
||||||
{
|
{
|
||||||
wxCoord tmp;
|
wxSwap(llx, lly);
|
||||||
tmp = llx; llx = lly; lly = tmp;
|
wxSwap(urx, ury);
|
||||||
tmp = urx; urx = ury; ury = tmp;
|
|
||||||
|
|
||||||
// We need either the two lines that follow, or we need to subtract
|
// We need either the two lines that follow, or we need to subtract
|
||||||
// min_x from real_translate_y, which is commented out below.
|
// min_x from real_translate_y, which is commented out below.
|
||||||
|
Reference in New Issue
Block a user