diff options
-rw-r--r-- | oox/source/ole/axcontrol.cxx | 3 | ||||
-rw-r--r-- | toolkit/source/awt/scrollabledialog.cxx | 14 | ||||
-rw-r--r-- | toolkit/source/awt/vclxtoolkit.cxx | 6 | ||||
-rw-r--r-- | toolkit/source/controls/dialogcontrol.cxx | 19 |
4 files changed, 36 insertions, 6 deletions
diff --git a/oox/source/ole/axcontrol.cxx b/oox/source/ole/axcontrol.cxx index 89570b933a0e..cba97f575e23 100644 --- a/oox/source/ole/axcontrol.cxx +++ b/oox/source/ole/axcontrol.cxx @@ -328,6 +328,7 @@ void ControlConverter::convertScrollabilitySettings( PropertyMap& rPropMap, rPropMap.setProperty( PROP_ScrollLeft, tmpPos.X ); rPropMap.setProperty( PROP_HScroll, ( nScrollBars & 0x1 ) == 0x1 ); rPropMap.setProperty( PROP_VScroll, ( nScrollBars & 0x2 ) == 0x2 ); + printf("** imported hscroll %d vscroll %d\n", ( nScrollBars & 0x1 ) == 0x1, ( nScrollBars & 0x2 ) == 0x2); } void ControlConverter::convertScrollBar( PropertyMap& rPropMap, @@ -2445,6 +2446,7 @@ void AxFrameModel::convertProperties( PropertyMap& rPropMap, const ControlConver { rPropMap.setProperty( PROP_Label, maCaption ); rPropMap.setProperty( PROP_Enabled, getFlag( mnFlags, AX_CONTAINER_ENABLED ) ); + printf("Frame, converting scroll bits\n"); rConv.convertScrollabilitySettings( rPropMap, maScrollPos, maLogicalSize, mnScrollBars ); AxContainerModelBase::convertProperties( rPropMap, rConv ); } @@ -2508,6 +2510,7 @@ void AxUserFormModel::convertProperties( PropertyMap& rPropMap, const ControlCon rPropMap.setProperty( PROP_Title, maCaption ); rConv.convertColor( rPropMap, PROP_BackgroundColor, mnBackColor ); rConv.convertAxPicture( rPropMap, maPictureData, AX_PICPOS_CENTER ); + printf("UserForm, converting scroll bits\n"); rConv.convertScrollabilitySettings( rPropMap, maScrollPos, maLogicalSize, mnScrollBars ); AxContainerModelBase::convertProperties( rPropMap, rConv ); } diff --git a/toolkit/source/awt/scrollabledialog.cxx b/toolkit/source/awt/scrollabledialog.cxx index 74cabce2430d..1b35e8ea0f31 100644 --- a/toolkit/source/awt/scrollabledialog.cxx +++ b/toolkit/source/awt/scrollabledialog.cxx @@ -5,8 +5,14 @@ namespace toolkit { +// Using WB_AUTOHSCROLL, WB_AUTOVSCROLL here sucks big time, there is a +// problem in the toolkit class where there are some clashing IDs +// ( ::com::sun::star::awt::VclWindowPeerAttribute::VSCROLL has the same value +// as ::com::sun::star::awt::WindowAttribute::NODECORATION and they are used +// in the same bitmap :-( WB_VSCROLL & WB_HSCROLL apparently are only for +// child classes ( whole thing is a mess if you ask me ) template< class T> -ScrollableWrapper<T>::ScrollableWrapper( Window* pParent, WinBits nStyle ) : T( pParent, nStyle | ~( WB_HSCROLL | WB_VSCROLL ) ), maHScrollBar( this, WB_HSCROLL | WB_DRAG), maVScrollBar( this, WB_VSCROLL | WB_DRAG ), mbHasHoriBar( false ), mbHasVertBar( false ), maScrollVis( None ) +ScrollableWrapper<T>::ScrollableWrapper( Window* pParent, WinBits nStyle ) : T( pParent, nStyle & ~( WB_AUTOHSCROLL | WB_AUTOVSCROLL ) ), maHScrollBar( this, WB_HSCROLL | WB_DRAG), maVScrollBar( this, WB_VSCROLL | WB_DRAG ), mbHasHoriBar( false ), mbHasVertBar( false ), maScrollVis( None ) { Link aLink( LINK( this, ScrollableWrapper, ScrollBarHdl ) ); maVScrollBar.SetScrollHdl( aLink ); @@ -15,11 +21,11 @@ ScrollableWrapper<T>::ScrollableWrapper( Window* pParent, WinBits nStyle ) : T( Size aOutSz = T::GetOutputSizePixel(); ScrollBarVisibility aVis = None; - if ( nStyle & ( WB_HSCROLL | WB_VSCROLL ) ) + if ( nStyle & ( WB_AUTOHSCROLL | WB_AUTOVSCROLL ) ) { - if ( nStyle & WB_HSCROLL ) + if ( nStyle & WB_AUTOHSCROLL ) aVis = Hori; - if ( nStyle & WB_VSCROLL ) + if ( nStyle & WB_AUTOVSCROLL ) { if ( aVis == Hori ) aVis = Both; diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx index 64bffaa38756..225134d1d399 100644 --- a/toolkit/source/awt/vclxtoolkit.cxx +++ b/toolkit/source/awt/vclxtoolkit.cxx @@ -243,7 +243,7 @@ TOOLKIT_DLLPUBLIC WinBits ImplGetWinBits( sal_uInt32 nComponentAttribs, sal_uInt if( nComponentAttribs & ::com::sun::star::awt::VclWindowPeerAttribute::DEF_NO ) nWinBits |= WB_DEF_NO; } - if ( nCompType == WINDOW_MULTILINEEDIT ) + if ( nCompType == WINDOW_MULTILINEEDIT || nCompType == WINDOW_DIALOG ) { if( nComponentAttribs & ::com::sun::star::awt::VclWindowPeerAttribute::AUTOHSCROLL ) nWinBits |= WB_AUTOHSCROLL; @@ -725,7 +725,9 @@ Window* VCLXToolkit::ImplCreateWindow( VCLXWindow** ppNewComp, case WINDOW_GROUPBOX: { if ( bFrameControl ) - pNewWindow = new toolkit::ScrollableWrapper< GroupBox >( pParent, nWinBits ); + { + pNewWindow = new toolkit::ScrollableWrapper< GroupBox >( pParent, nWinBits | WB_VSCROLL ); + } else pNewWindow = new GroupBox( pParent, nWinBits ); if ( bFrameControl ) diff --git a/toolkit/source/controls/dialogcontrol.cxx b/toolkit/source/controls/dialogcontrol.cxx index 99c9d469f64b..106c7aad8fbc 100644 --- a/toolkit/source/controls/dialogcontrol.cxx +++ b/toolkit/source/controls/dialogcontrol.cxx @@ -60,6 +60,7 @@ #include <vcl/tabctrl.hxx> #include <toolkit/awt/vclxwindows.hxx> #include "toolkit/controls/unocontrols.hxx" +#include <com/sun/star/awt/VclWindowPeerAttribute.hpp> using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -372,6 +373,24 @@ void UnoDialogControl::createPeer( const Reference< XToolkit > & rxToolkit, cons void UnoDialogControl::PrepareWindowDescriptor( ::com::sun::star::awt::WindowDescriptor& rDesc ) { + // HACK due to the fact that we can't really use VSCROLL & HSCROLL + // for Dialog ( ::com::sun::star::awt::VclWindowPeerAttribute::VSCROLL + // has the same value as + // ::com::sun::star::awt::WindowAttribute::NODECORATION ) + // For convenience in the PropBrowse using HSCROLL and VSCROLL ensures + // the Correct text. We exchange them here and the control knows + // about this hack ( it sucks badly I know ) + if ( rDesc.WindowAttributes & ::com::sun::star::awt::VclWindowPeerAttribute::VSCROLL ) + { + rDesc.WindowAttributes &= ~::com::sun::star::awt::VclWindowPeerAttribute::VSCROLL; + rDesc.WindowAttributes |= ::com::sun::star::awt::VclWindowPeerAttribute::AUTOVSCROLL; + } + if ( rDesc.WindowAttributes & ::com::sun::star::awt::VclWindowPeerAttribute::HSCROLL ) + { + rDesc.WindowAttributes &= ~::com::sun::star::awt::VclWindowPeerAttribute::HSCROLL; + rDesc.WindowAttributes |= ::com::sun::star::awt::VclWindowPeerAttribute::AUTOHSCROLL; + } + sal_Bool bDecoration( sal_True ); ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_DECORATION )) >>= bDecoration; if ( !bDecoration ) |