// Regarding visibility (or in terms of accessibility: regarding the showing // state): A frame is visible and therefore contained in the tree if its frame // size overlaps with the visible area. The bounding box however is the // frame's paint area.
sal_Int32 SwAccessibleFrame::GetChildCount( SwAccessibleMap& rAccMap, const SwRect& rVisArea, const SwFrame *pFrame, bool bInPagePreview )
{
sal_Int32 nCount = 0;
if( SwAccessibleChildMap::IsSortingRequired( rFrame ) )
{ // We need a sorted list here, and we have to reverse iterate, // because objects in front should be returned. const SwAccessibleChildMap aVisMap( rVisArea, rFrame, rAccMap );
SwAccessibleChildMap::const_reverse_iterator aRIter( aVisMap.crbegin() ); while( aRIter != aVisMap.crend() && !aRet.IsValid() )
{ const SwAccessibleChild& rLower = (*aRIter).second; // A frame is returned if it's frame size is inside the visarea // and the position is inside the frame's paint area. if( rLower.IsAccessible( bInPagePreview ) )
{
SwRect aLogBounds( rLower.GetBounds( rAccMap ) ); if( !aLogBounds.IsEmpty() )
{
tools::Rectangle aPixBounds( rAccMap.CoreToPixel( aLogBounds ) ); if( aPixBounds.Contains( rPixPos ) )
aRet = rLower;
}
} elseif( rLower.GetSwFrame() )
{ // There are no unaccessible SdrObjects that count
aRet = GetChildAtPixel( rVisArea, *(rLower.GetSwFrame()), rPixPos,
bInPagePreview, rAccMap );
}
++aRIter;
}
} else
{ // The unsorted list is sorted enough, because it returns lower // frames in the correct order. Moreover, we can iterate forward, // because the lowers don't overlap! const SwAccessibleChildSList aVisList( rVisArea, rFrame, rAccMap );
SwAccessibleChildSList::const_iterator aIter( aVisList.begin() ); while( aIter != aVisList.end() && !aRet.IsValid() )
{ const SwAccessibleChild& rLower = *aIter; // A frame is returned if it's frame size is inside the visarea // and the position is inside the frame's paint area. if( rLower.IsAccessible( bInPagePreview ) )
{
SwRect aLogBounds( rLower.GetBounds( rAccMap ) ); if( !aLogBounds.IsEmpty() )
{
tools::Rectangle aPixBounds( rAccMap.CoreToPixel( aLogBounds ) ); if( aPixBounds.Contains( rPixPos ) )
aRet = rLower;
}
} elseif( rLower.GetSwFrame() )
{ // There are no unaccessible SdrObjects that count
aRet = GetChildAtPixel( rVisArea, *(rLower.GetSwFrame()), rPixPos,
bInPagePreview, rAccMap );
}
++aIter;
}
}
return aRet;
}
void SwAccessibleFrame::GetChildren( SwAccessibleMap& rAccMap, const SwRect& rVisArea, const SwFrame& rFrame,
std::list< SwAccessibleChild >& rChildren, bool bInPagePreview )
{ if( SwAccessibleChildMap::IsSortingRequired( rFrame ) )
{ // We need a sorted list here const SwAccessibleChildMap aVisMap( rVisArea, rFrame, rAccMap );
SwAccessibleChildMap::const_iterator aIter( aVisMap.cbegin() ); while( aIter != aVisMap.cend() )
{ const SwAccessibleChild& rLower = (*aIter).second; if( rLower.IsAccessible( bInPagePreview ) )
{
rChildren.push_back( rLower );
} elseif( rLower.GetSwFrame() )
{ // There are no unaccessible SdrObjects that count
GetChildren( rAccMap, rVisArea, *(rLower.GetSwFrame()),
rChildren, bInPagePreview );
}
++aIter;
}
} else
{ // The unsorted list is sorted enough, because it returns lower // frames in the correct order. const SwAccessibleChildSList aVisList( rVisArea, rFrame, rAccMap );
SwAccessibleChildSList::const_iterator aIter( aVisList.begin() ); while( aIter != aVisList.end() )
{ const SwAccessibleChild& rLower = *aIter; if( rLower.IsAccessible( bInPagePreview ) )
{
rChildren.push_back( rLower );
} elseif( rLower.GetSwFrame() )
{ // There are no unaccessible SdrObjects that count
GetChildren( rAccMap, rVisArea, *(rLower.GetSwFrame()),
rChildren, bInPagePreview );
}
++aIter;
}
}
}
// If a fly frame has a transparent background color, we have to consider the background. // But a background color "no fill"/"auto fill" should *not* be considered. if( pFrame->IsFlyFrame() &&
rBack.GetColor().IsTransparent() &&
rBack.GetColor() != COL_TRANSPARENT
) returntrue;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.