main/sw/source/core/layout/paintfrm.cxx
// Finds the lines that join the line defined by (StartPoint, EndPoint) in either
// StartPoint or Endpoint. The styles of these lines are required for DR's magic
// line painting functions.
Finds the lines that join the line defined by (StartPoint, EndPoint) in either
StartPoint or Endpoint. The styles of these lines are required for DR's magic
line painting functions.
Finds the lines that join the line defined by ( StartPoint EndPoint ) in either StartPoint or Endpoint . The styles of these lines are required for DR ' s magic line painting functions .
void SwTabFrmPainter::FindStylesForLine( const Point& rStartPoint,
                                         const Point& rEndPoint,
                                         svx::frame::Style* pStyles,
                                         bool bHori ) const
{
    SwLineEntryMapConstIter aMapIter = maVertLines.find( rStartPoint.X() );
    ASSERT( aMapIter != maVertLines.end(), "FindStylesForLine: Error" )
    const SwLineEntrySet& rVertSet = (*aMapIter).second;
    SwLineEntrySetConstIter aIter = rVertSet.begin();
    while ( aIter != rVertSet.end() )
    {
        const SwLineEntry& rEntry = *aIter;
        if ( bHori )
        {
            if ( rStartPoint.Y() == rEntry.mnStartPos )
                pStyles[ 3 ] = rEntry.maAttribute;
            else if ( rStartPoint.Y() == rEntry.mnEndPos )
                pStyles[ 1 ] = rEntry.maAttribute;
        }
        else
        {
            if ( rStartPoint.Y() == rEntry.mnEndPos )
                pStyles[ 2 ] = rEntry.maAttribute;
            else if ( rEndPoint.Y() == rEntry.mnStartPos )
                pStyles[ 5 ] = rEntry.maAttribute;
        }
        ++aIter;
    }
    aMapIter = maHoriLines.find( rStartPoint.Y() );
    ASSERT( aMapIter != maHoriLines.end(), "FindStylesForLine: Error" )
    const SwLineEntrySet& rHoriSet = (*aMapIter).second;
    aIter = rHoriSet.begin();
    while ( aIter != rHoriSet.end() )
    {
        const SwLineEntry& rEntry = *aIter;
        if ( bHori )
        {
            if ( rStartPoint.X() == rEntry.mnEndPos )
                pStyles[ 2 ] = rEntry.maAttribute;
            else if ( rEndPoint.X() == rEntry.mnStartPos )
                pStyles[ 5 ] = rEntry.maAttribute;
        }
        else
        {
            if ( rStartPoint.X() == rEntry.mnEndPos )
                pStyles[ 1 ] = rEntry.maAttribute;
            else if ( rStartPoint.X() == rEntry.mnStartPos )
                pStyles[ 3 ] = rEntry.maAttribute;
        }
        ++aIter;
    }
    if ( bHori )
    {
        aMapIter = maVertLines.find( rEndPoint.X() );
        ASSERT( aMapIter != maVertLines.end(), "FindStylesForLine: Error" )
        const SwLineEntrySet& rVertSet2 = (*aMapIter).second;
        aIter = rVertSet2.begin();
        while ( aIter != rVertSet2.end() )
        {
            const SwLineEntry& rEntry = *aIter;
            if ( rEndPoint.Y() == rEntry.mnStartPos )
                pStyles[ 6 ] = rEntry.maAttribute;
            else if ( rEndPoint.Y() == rEntry.mnEndPos )
                pStyles[ 4 ] = rEntry.maAttribute;
            ++aIter;
        }
    }
    else
    {
        aMapIter = maHoriLines.find( rEndPoint.Y() );
        ASSERT( aMapIter != maHoriLines.end(), "FindStylesForLine: Error" )
        const SwLineEntrySet& rHoriSet2 = (*aMapIter).second;
        aIter = rHoriSet2.begin();
        while ( aIter != rHoriSet2.end() )
        {
            const SwLineEntry& rEntry = *aIter;
            if ( rEndPoint.X() == rEntry.mnEndPos )
                pStyles[ 4 ] = rEntry.maAttribute;
            else if ( rEndPoint.X() == rEntry.mnStartPos )
                pStyles[ 6 ] = rEntry.maAttribute;
            ++aIter;
        }
    }
}
void SwTabFrmPainter :: FindStylesForLine ( const Point & rStartPoint , const Point & rEndPoint , svx :: frame :: Style * pStyles , bool bHori ) const { SwLineEntryMapConstIter aMapIter = maVertLines . find ( rStartPoint . X ( ) ) ; ASSERT ( aMapIter != maVertLines . end ( ) , " " ) const SwLineEntrySet & rVertSet = ( * aMapIter ) . second ; SwLineEntrySetConstIter aIter = rVertSet . begin ( ) ; while ( aIter != rVertSet . end ( ) ) { const SwLineEntry & rEntry = * aIter ; if ( bHori ) { if ( rStartPoint . Y ( ) == rEntry . mnStartPos ) pStyles [ 3 ] = rEntry . maAttribute ; else if ( rStartPoint . Y ( ) == rEntry . mnEndPos ) pStyles [ 1 ] = rEntry . maAttribute ; } else { if ( rStartPoint . Y ( ) == rEntry . mnEndPos ) pStyles [ 2 ] = rEntry . maAttribute ; else if ( rEndPoint . Y ( ) == rEntry . mnStartPos ) pStyles [ 5 ] = rEntry . maAttribute ; } ++ aIter ; } aMapIter = maHoriLines . find ( rStartPoint . Y ( ) ) ; ASSERT ( aMapIter != maHoriLines . end ( ) , " " ) const SwLineEntrySet & rHoriSet = ( * aMapIter ) . second ; aIter = rHoriSet . begin ( ) ; while ( aIter != rHoriSet . end ( ) ) { const SwLineEntry & rEntry = * aIter ; if ( bHori ) { if ( rStartPoint . X ( ) == rEntry . mnEndPos ) pStyles [ 2 ] = rEntry . maAttribute ; else if ( rEndPoint . X ( ) == rEntry . mnStartPos ) pStyles [ 5 ] = rEntry . maAttribute ; } else { if ( rStartPoint . X ( ) == rEntry . mnEndPos ) pStyles [ 1 ] = rEntry . maAttribute ; else if ( rStartPoint . X ( ) == rEntry . mnStartPos ) pStyles [ 3 ] = rEntry . maAttribute ; } ++ aIter ; } if ( bHori ) { aMapIter = maVertLines . find ( rEndPoint . X ( ) ) ; ASSERT ( aMapIter != maVertLines . end ( ) , " " ) const SwLineEntrySet & rVertSet2 = ( * aMapIter ) . second ; aIter = rVertSet2 . begin ( ) ; while ( aIter != rVertSet2 . end ( ) ) { const SwLineEntry & rEntry = * aIter ; if ( rEndPoint . Y ( ) == rEntry . mnStartPos ) pStyles [ 6 ] = rEntry . maAttribute ; else if ( rEndPoint . Y ( ) == rEntry . mnEndPos ) pStyles [ 4 ] = rEntry . maAttribute ; ++ aIter ; } } else { aMapIter = maHoriLines . find ( rEndPoint . Y ( ) ) ; ASSERT ( aMapIter != maHoriLines . end ( ) , " " ) const SwLineEntrySet & rHoriSet2 = ( * aMapIter ) . second ; aIter = rHoriSet2 . begin ( ) ; while ( aIter != rHoriSet2 . end ( ) ) { const SwLineEntry & rEntry = * aIter ; if ( rEndPoint . X ( ) == rEntry . mnEndPos ) pStyles [ 4 ] = rEntry . maAttribute ; else if ( rEndPoint . X ( ) == rEntry . mnStartPos ) pStyles [ 6 ] = rEntry . maAttribute ; ++ aIter ; } } }
Finds the lines that join the line defined by (StartPoint, EndPoint) in either
StartPoint or Endpoint.
Finds the lines that join the line defined by ( StartPoint EndPoint ) in either StartPoint or Endpoint .
// pStyles[ 1 ] = bHori ? aLFromT : TFromL // pStyles[ 2 ] = bHori ? aLFromL : TFromT, // pStyles[ 3 ] = bHori ? aLFromB : TFromR, // pStyles[ 4 ] = bHori ? aRFromT : BFromL, // pStyles[ 5 ] = bHori ? aRFromR : BFromB, // pStyles[ 6 ] = bHori ? aRFromB : BFromR,