diff options
Diffstat (limited to 'cui/source/dialogs/zoom.cxx')
-rw-r--r-- | cui/source/dialogs/zoom.cxx | 102 |
1 files changed, 33 insertions, 69 deletions
diff --git a/cui/source/dialogs/zoom.cxx b/cui/source/dialogs/zoom.cxx index 42eda26ff2ff..89d0fa9f7483 100644 --- a/cui/source/dialogs/zoom.cxx +++ b/cui/source/dialogs/zoom.cxx @@ -56,30 +56,23 @@ // static ---------------------------------------------------------------- -static USHORT pRanges[] = -{ - SID_ATTR_ZOOM, - SID_ATTR_ZOOM, - 0 -}; - -#define SPECIAL_FACTOR ((USHORT)0xFFFF) +#define SPECIAL_FACTOR ((sal_uInt16)0xFFFF) // class SvxZoomDialog --------------------------------------------------- -USHORT SvxZoomDialog::GetFactor() const +sal_uInt16 SvxZoomDialog::GetFactor() const { if ( a100Btn.IsChecked() ) return 100; if ( aUserBtn.IsChecked() ) - return (USHORT)aUserEdit.GetValue(); + return (sal_uInt16)aUserEdit.GetValue(); else return SPECIAL_FACTOR; } // ----------------------------------------------------------------------- -void SvxZoomDialog::SetFactor( USHORT nNewFactor, USHORT nBtnId ) +void SvxZoomDialog::SetFactor( sal_uInt16 nNewFactor, sal_uInt16 nBtnId ) { aUserEdit.Disable(); @@ -122,30 +115,7 @@ void SvxZoomDialog::SetFactor( USHORT nNewFactor, USHORT nBtnId ) // ----------------------------------------------------------------------- -void SvxZoomDialog::SetButtonText( USHORT nBtnId, const String& rNewTxt ) -{ - switch ( nBtnId ) - { - case ZOOMBTN_OPTIMAL: // Optimal-Button - aOptimalBtn.SetText( rNewTxt ); - break; - - case ZOOMBTN_PAGEWIDTH: // Seitenbreite-Button - aPageWidthBtn.SetText( rNewTxt ); - break; - - case ZOOMBTN_WHOLEPAGE: // Ganze Seite-Button - aWholePageBtn.SetText( rNewTxt ); - break; - - default: - OSL_FAIL( "wrong button number" ); - } -} - -// ----------------------------------------------------------------------- - -void SvxZoomDialog::HideButton( USHORT nBtnId ) +void SvxZoomDialog::HideButton( sal_uInt16 nBtnId ) { switch ( nBtnId ) { @@ -168,7 +138,7 @@ void SvxZoomDialog::HideButton( USHORT nBtnId ) // ----------------------------------------------------------------------- -void SvxZoomDialog::SetLimits( USHORT nMin, USHORT nMax ) +void SvxZoomDialog::SetLimits( sal_uInt16 nMin, sal_uInt16 nMax ) { DBG_ASSERT( nMin < nMax, "invalid limits" ); aUserEdit.SetMin( nMin ); @@ -179,13 +149,6 @@ void SvxZoomDialog::SetLimits( USHORT nMin, USHORT nMax ) // ----------------------------------------------------------------------- -void SvxZoomDialog::SetSpinSize( USHORT nNewSpin ) -{ - aUserEdit.SetSpinSize( nNewSpin ); -} - -// ----------------------------------------------------------------------- - SvxZoomDialog::SvxZoomDialog( Window* pParent, const SfxItemSet& rCoreSet ) : SfxModalDialog( pParent, CUI_RES( RID_SVXDLG_ZOOM ) ), @@ -212,11 +175,11 @@ SvxZoomDialog::SvxZoomDialog( Window* pParent, const SfxItemSet& rCoreSet ) : rSet ( rCoreSet ), pOutSet ( NULL ), - bModified ( FALSE ) + bModified ( sal_False ) { #if ENABLE_LAYOUT - SetHelpId (SID_ATTR_ZOOM); + SetHelpId (".uno:Zoom"); #endif /* ENABLE_LAYOUT */ Link aLink = LINK( this, SvxZoomDialog, UserHdl ); a100Btn.SetClickHdl( aLink ); @@ -240,9 +203,9 @@ SvxZoomDialog::SvxZoomDialog( Window* pParent, const SfxItemSet& rCoreSet ) : aUserEdit.SetModifyHdl( LINK( this, SvxZoomDialog, SpinHdl ) ); // Default-Werte - USHORT nValue = 100; - USHORT nMin = 10; - USHORT nMax = 1000; + sal_uInt16 nValue = 100; + sal_uInt16 nMin = 10; + sal_uInt16 nMax = 1000; // ggf. erst den alten Wert besorgen const SfxUInt16Item* pOldUserItem = 0; @@ -265,15 +228,23 @@ SvxZoomDialog::SvxZoomDialog( Window* pParent, const SfxItemSet& rCoreSet ) : aUserEdit.SetLast( nMax ); aUserEdit.SetValue( nValue ); + aUserEdit.SetAccessibleRelationLabeledBy( &aUserBtn ); + aUserEdit.SetAccessibleName(aUserBtn.GetText()); + aColumnsEdit.SetAccessibleRelationLabeledBy(&aColumnsBtn); + aColumnsEdit.SetAccessibleName(aColumnsBtn.GetText()); + aColumnsEdit.SetAccessibleRelationMemberOf(&aColumnsBtn); + aBookModeChk.SetAccessibleRelationLabeledBy(&aColumnsBtn); + aBookModeChk.SetAccessibleRelationMemberOf(&aColumnsBtn); + const SfxPoolItem& rItem = rSet.Get( rSet.GetPool()->GetWhich( SID_ATTR_ZOOM ) ); if ( rItem.ISA(SvxZoomItem) ) { const SvxZoomItem& rZoomItem = (const SvxZoomItem&)rItem; - const USHORT nZoom = rZoomItem.GetValue(); + const sal_uInt16 nZoom = rZoomItem.GetValue(); const SvxZoomType eType = rZoomItem.GetType(); - const USHORT nValSet = rZoomItem.GetValueSet(); - USHORT nBtnId = 0; + const sal_uInt16 nValSet = rZoomItem.GetValueSet(); + sal_uInt16 nBtnId = 0; switch ( eType ) { @@ -304,14 +275,14 @@ SvxZoomDialog::SvxZoomDialog( Window* pParent, const SfxItemSet& rCoreSet ) : } else { - const USHORT nZoom = ( (const SfxUInt16Item&)rItem ).GetValue(); + const sal_uInt16 nZoom = ( (const SfxUInt16Item&)rItem ).GetValue(); SetFactor( nZoom ); } const SfxPoolItem* pViewLayoutItem = 0; - if ( SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_VIEWLAYOUT, FALSE, &pViewLayoutItem ) ) + if ( SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_VIEWLAYOUT, sal_False, &pViewLayoutItem ) ) { - const USHORT nColumns = static_cast<const SvxViewLayoutItem*>(pViewLayoutItem)->GetValue(); + const sal_uInt16 nColumns = static_cast<const SvxViewLayoutItem*>(pViewLayoutItem)->GetValue(); const bool bBookMode = static_cast<const SvxViewLayoutItem*>(pViewLayoutItem)->IsBookMode(); if ( 0 == nColumns ) @@ -368,16 +339,9 @@ SvxZoomDialog::~SvxZoomDialog() // ----------------------------------------------------------------------- -USHORT* SvxZoomDialog::GetRanges() -{ - return pRanges; -} - -// ----------------------------------------------------------------------- - IMPL_LINK( SvxZoomDialog, UserHdl, RadioButton *, pBtn ) { - bModified |= TRUE; + bModified |= sal_True; if ( pBtn == &aUserBtn ) { @@ -395,7 +359,7 @@ IMPL_LINK( SvxZoomDialog, SpinHdl, MetricField *, EMPTYARG ) { if ( !aUserBtn.IsChecked() ) return 0; - bModified |= TRUE; + bModified |= sal_True; return 0; } @@ -403,7 +367,7 @@ IMPL_LINK( SvxZoomDialog, SpinHdl, MetricField *, EMPTYARG ) IMPL_LINK( SvxZoomDialog, ViewLayoutUserHdl, RadioButton *, pBtn ) { - bModified |= TRUE; + bModified |= sal_True; if ( pBtn == &aAutomaticBtn ) { @@ -446,7 +410,7 @@ IMPL_LINK( SvxZoomDialog, ViewLayoutSpinHdl, MetricField *, pEdt ) aBookModeChk.Disable(); } - bModified |= TRUE; + bModified |= sal_True; return 0; } @@ -458,7 +422,7 @@ IMPL_LINK( SvxZoomDialog, ViewLayoutCheckHdl, CheckBox *, pChk ) if ( pChk == &aBookModeChk && !aColumnsBtn.IsChecked() ) return 0; - bModified |= TRUE; + bModified |= sal_True; return 0; } @@ -474,7 +438,7 @@ IMPL_LINK( SvxZoomDialog, OKHdl, Button *, pBtn ) if ( &aOKBtn == pBtn ) { - USHORT nFactor = GetFactor(); + sal_uInt16 nFactor = GetFactor(); if ( SPECIAL_FACTOR == nFactor ) { @@ -500,7 +464,7 @@ IMPL_LINK( SvxZoomDialog, OKHdl, Button *, pBtn ) } else if ( aColumnsBtn.IsChecked() ) { - aViewLayoutItem.SetValue( static_cast<USHORT>(aColumnsEdit.GetValue()) ); + aViewLayoutItem.SetValue( static_cast<sal_uInt16>(aColumnsEdit.GetValue()) ); aViewLayoutItem.SetBookMode( aBookModeChk.IsChecked() ); } } @@ -521,7 +485,7 @@ IMPL_LINK( SvxZoomDialog, OKHdl, Button *, pBtn ) if ( pSh ) pSh->PutItem( SfxUInt16Item( SID_ATTR_ZOOM_USER, - (UINT16)aUserEdit.GetValue() ) ); + (sal_uInt16)aUserEdit.GetValue() ) ); EndDialog( RET_OK ); } else |