Kaydet (Commit) fec3a613 authored tarafından Ivo Hinkelmann's avatar Ivo Hinkelmann

INTEGRATION: CWS aw024 (1.19.8); FILE MERGED

2006/11/06 14:33:12 aw 1.19.8.1: #i71248# secured usage of XControl when importing html
üst 860e6d17
......@@ -4,9 +4,9 @@
*
* $RCSfile: htmlform.cxx,v $
*
* $Revision: 1.19 $
* $Revision: 1.20 $
*
* last change: $Author: obo $ $Date: 2006-09-16 22:10:07 $
* last change: $Author: ihi $ $Date: 2006-11-14 15:13:26 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
......@@ -873,33 +873,38 @@ void SwHTMLParser::SetControlSize( const Reference< drawing::XShape >& rShape,
awt::Size aSz( rShape->getSize() );
awt::Size aNewSz( 0, 0 );
if( bMinWidth || bMinHeight )
{
Reference< awt::XLayoutConstrains > xLC( xControl, UNO_QUERY );
awt::Size aTmpSz( xLC->getPreferredSize() );
if( bMinWidth )
aNewSz.Width = aTmpSz.Width;
if( bMinHeight )
aNewSz.Height = aTmpSz.Height;
}
if( rTextSz.Width() || rTextSz.Height())
// #i71248# ensure we got a XControl before apllying corrections
if(xControl.is())
{
Reference< awt::XTextLayoutConstrains > xLC( xControl, UNO_QUERY );
ASSERT( xLC.is(), "kein XTextLayoutConstrains" );
if( xLC.is() )
if( bMinWidth || bMinHeight )
{
awt::Size aTmpSz( rTextSz.Width(), rTextSz.Height() );
if( -1 == rTextSz.Width() )
{
aTmpSz.Width = 0;
aTmpSz.Height = nSelectEntryCnt;
}
aTmpSz = xLC->getMinimumSize( aTmpSz.Width, aTmpSz.Height );
if( rTextSz.Width() )
Reference< awt::XLayoutConstrains > xLC( xControl, UNO_QUERY );
awt::Size aTmpSz( xLC->getPreferredSize() );
if( bMinWidth )
aNewSz.Width = aTmpSz.Width;
if( rTextSz.Height() )
if( bMinHeight )
aNewSz.Height = aTmpSz.Height;
}
if( rTextSz.Width() || rTextSz.Height())
{
Reference< awt::XTextLayoutConstrains > xLC( xControl, UNO_QUERY );
ASSERT( xLC.is(), "kein XTextLayoutConstrains" );
if( xLC.is() )
{
awt::Size aTmpSz( rTextSz.Width(), rTextSz.Height() );
if( -1 == rTextSz.Width() )
{
aTmpSz.Width = 0;
aTmpSz.Height = nSelectEntryCnt;
}
aTmpSz = xLC->getMinimumSize( aTmpSz.Width, aTmpSz.Height );
if( rTextSz.Width() )
aNewSz.Width = aTmpSz.Width;
if( rTextSz.Height() )
aNewSz.Height = aTmpSz.Height;
}
}
}
if( Application::GetDefaultDevice() )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment