main/sw/source/core/layout/paintfrm.cxx
/** OD 19.05.2003 #109667# - helper method for twip adjustments on pixel base

    method compares the x- or y-pixel position of two twip-point. If the x-/y-pixel
    positions are the same, the x-/y-pixel position of the second twip point is
    adjusted by a given amount of pixels.

    @author OD
*/
OD 19.05.2003 #109667# - helper method for twip adjustments on pixel base
method compares the x- or y-pixel position of two twip-point. If the x-/y-pixel
positions are the same, the x-/y-pixel position of the second twip point is
adjusted by a given amount of pixels.
OD 19 . 05 . 2003 #109667# - helper method for twip adjustments on pixel base method compares the x - or y - pixel position of two twip - point . If the x - / y - pixel positions are the same the x - / y - pixel position of the second twip point is adjusted by a given amount of pixels .
void lcl_CompPxPosAndAdjustPos( const OutputDevice&  _rOut,
                                const Point&         _rRefPt,
                                Point&               _rCompPt,
                                const sal_Bool       _bChkXPos,
                                const sal_Int8       _nPxAdjustment )
{
    const Point aRefPxPt = _rOut.LogicToPixel( _rRefPt );
    Point aCompPxPt = _rOut.LogicToPixel( _rCompPt );
    if ( _bChkXPos )
    {
        if ( aCompPxPt.X() == aRefPxPt.X() )
        {
            aCompPxPt.X() += _nPxAdjustment ;
            const Point aAdjustedCompPt = _rOut.PixelToLogic( aCompPxPt );
            _rCompPt.X() = aAdjustedCompPt.X();
        }
    }
    else
    {
        if ( aCompPxPt.Y() == aRefPxPt.Y() )
        {
            aCompPxPt.Y() += _nPxAdjustment ;
            const Point aAdjustedCompPt = _rOut.PixelToLogic( aCompPxPt );
            _rCompPt.Y() = aAdjustedCompPt.Y();
        }
    }
}
void lcl_CompPxPosAndAdjustPos ( const OutputDevice & _rOut , const Point & _rRefPt , Point & _rCompPt , const sal_Bool _bChkXPos , const sal_Int8 _nPxAdjustment ) { const Point aRefPxPt = _rOut . LogicToPixel ( _rRefPt ) ; Point aCompPxPt = _rOut . LogicToPixel ( _rCompPt ) ; if ( _bChkXPos ) { if ( aCompPxPt . X ( ) == aRefPxPt . X ( ) ) { aCompPxPt . X ( ) += _nPxAdjustment ; const Point aAdjustedCompPt = _rOut . PixelToLogic ( aCompPxPt ) ; _rCompPt . X ( ) = aAdjustedCompPt . X ( ) ; } } else { if ( aCompPxPt . Y ( ) == aRefPxPt . Y ( ) ) { aCompPxPt . Y ( ) += _nPxAdjustment ; const Point aAdjustedCompPt = _rOut . PixelToLogic ( aCompPxPt ) ; _rCompPt . Y ( ) = aAdjustedCompPt . Y ( ) ; } } }
OD 19.05.2003 #109667# - helper method for twip adjustments on pixel base
method compares the x- or y-pixel position of two twip-point.
OD 19 . 05 . 2003 #109667# - helper method for twip adjustments on pixel base method compares the x - or y - pixel position of two twip - point .