diff options
Diffstat (limited to 'svx/source/stbctrls')
-rw-r--r-- | svx/source/stbctrls/insctrl.cxx | 12 | ||||
-rw-r--r-- | svx/source/stbctrls/makefile.mk | 75 | ||||
-rw-r--r-- | svx/source/stbctrls/modctrl.cxx | 10 | ||||
-rw-r--r-- | svx/source/stbctrls/pszctrl.cxx | 74 | ||||
-rw-r--r-- | svx/source/stbctrls/selctrl.cxx | 10 | ||||
-rw-r--r-- | svx/source/stbctrls/xmlsecctrl.cxx | 14 | ||||
-rw-r--r-- | svx/source/stbctrls/zoomctrl.cxx | 26 | ||||
-rw-r--r-- | svx/source/stbctrls/zoomsliderctrl.cxx | 52 |
8 files changed, 99 insertions, 174 deletions
diff --git a/svx/source/stbctrls/insctrl.cxx b/svx/source/stbctrls/insctrl.cxx index 157a9bd06f7e..34952b1deea9 100644 --- a/svx/source/stbctrls/insctrl.cxx +++ b/svx/source/stbctrls/insctrl.cxx @@ -50,12 +50,12 @@ SFX_IMPL_STATUSBAR_CONTROL(SvxInsertStatusBarControl, SfxBoolItem); // class SvxInsertStatusBarControl --------------------------------------- -SvxInsertStatusBarControl::SvxInsertStatusBarControl( USHORT _nSlotId, - USHORT _nId, +SvxInsertStatusBarControl::SvxInsertStatusBarControl( sal_uInt16 _nSlotId, + sal_uInt16 _nId, StatusBar& rStb ) : SfxStatusBarControl( _nSlotId, _nId, rStb ), - bInsert( TRUE ) + bInsert( sal_True ) { } @@ -67,7 +67,7 @@ SvxInsertStatusBarControl::~SvxInsertStatusBarControl() // ----------------------------------------------------------------------- -void SvxInsertStatusBarControl::StateChanged( USHORT , SfxItemState eState, +void SvxInsertStatusBarControl::StateChanged( sal_uInt16 , SfxItemState eState, const SfxPoolItem* pState ) { if ( SFX_ITEM_AVAILABLE != eState ) @@ -110,14 +110,14 @@ void SvxInsertStatusBarControl::Paint( const UserDrawEvent& ) void SvxInsertStatusBarControl::DrawItemText_Impl() { - USHORT _nId = RID_SVXSTR_OVERWRITE_TEXT; + sal_uInt16 _nId = RID_SVXSTR_OVERWRITE_TEXT; if ( bInsert ) _nId = RID_SVXSTR_INSERT_TEXT; GetStatusBar().SetItemText( GetId(), SVX_RESSTR( _nId ) ); } -ULONG SvxInsertStatusBarControl::GetDefItemWidth(const StatusBar& rStb) +sal_uIntPtr SvxInsertStatusBarControl::GetDefItemWidth(const StatusBar& rStb) { long nWidth1 = rStb.GetTextWidth(SVX_RESSTR(RID_SVXSTR_OVERWRITE_TEXT)); long nWidth2 = rStb.GetTextWidth(SVX_RESSTR(RID_SVXSTR_INSERT_TEXT)); diff --git a/svx/source/stbctrls/makefile.mk b/svx/source/stbctrls/makefile.mk deleted file mode 100644 index 71c639cecdd3..000000000000 --- a/svx/source/stbctrls/makefile.mk +++ /dev/null @@ -1,75 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* -PRJ=..$/.. - -PROJECTPCH4DLL=TRUE -PROJECTPCH=svxpch -PROJECTPCHSOURCE=$(PRJ)$/util$/svxpch - -PRJNAME=svx -TARGET=stbctrls -AUTOSEG=true - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk -.INCLUDE : $(PRJ)$/util$/makefile.pmk - -# --- Files -------------------------------------------------------- - -SRS1NAME=$(TARGET) -SRC1FILES = \ - stbctrls.src - -SLOFILES= \ - $(SLO)$/insctrl.obj \ - $(SLO)$/zoomctrl.obj \ - $(SLO)$/pszctrl.obj \ - $(SLO)$/selctrl.obj \ - $(SLO)$/modctrl.obj \ - $(SLO)$/xmlsecctrl.obj \ - $(SLO)$/zoomsliderctrl.obj - -EXCEPTIONSFILES= \ - $(SLO)$/zoomsliderctrl.obj - -HXX1TARGET=stbctrls -HXX1EXT= hxx -HXX1EXCL= -E:*include* -HXX1DEPN=\ - $(INC)$/svx/insctrl.hxx \ - $(INC)$/svx/zoomctrl.hxx \ - $(INC)$/svx/pszctrl.hxx \ - $(INC)$/svx/selctrl.hxx \ - $(INC)$/svx/modctrl.hxx \ - $(INC)$/svx/xmlsecctrl.hxx \ - $(INC)$/zoomsliderctrl.hxx \ - -# --- Targets ------------------------------------------------------- - -.INCLUDE : target.mk - diff --git a/svx/source/stbctrls/modctrl.cxx b/svx/source/stbctrls/modctrl.cxx index 986b84f7b8dc..87dce0e942df 100644 --- a/svx/source/stbctrls/modctrl.cxx +++ b/svx/source/stbctrls/modctrl.cxx @@ -47,18 +47,18 @@ SFX_IMPL_STATUSBAR_CONTROL(SvxModifyControl, SfxBoolItem); // class SvxModifyControl ------------------------------------------------ -SvxModifyControl::SvxModifyControl( USHORT _nSlotId, - USHORT _nId, +SvxModifyControl::SvxModifyControl( sal_uInt16 _nSlotId, + sal_uInt16 _nId, StatusBar& rStb ) : SfxStatusBarControl( _nSlotId, _nId, rStb ), - bState( TRUE ) + bState( sal_True ) { } // ----------------------------------------------------------------------- -void SvxModifyControl::StateChanged( USHORT, SfxItemState eState, +void SvxModifyControl::StateChanged( sal_uInt16, SfxItemState eState, const SfxPoolItem* pState ) { if ( SFX_ITEM_AVAILABLE != eState ) @@ -90,7 +90,7 @@ void SvxModifyControl::DrawItemText_Impl() GetStatusBar().SetItemText( GetId(), sMode ); } -ULONG SvxModifyControl::GetDefItemWidth(const StatusBar& rStb) +sal_uIntPtr SvxModifyControl::GetDefItemWidth(const StatusBar& rStb) { return rStb.GetTextWidth(String::CreateFromAscii("XX")); } diff --git a/svx/source/stbctrls/pszctrl.cxx b/svx/source/stbctrls/pszctrl.cxx index 43b563f78411..094cfbd96ee5 100644 --- a/svx/source/stbctrls/pszctrl.cxx +++ b/svx/source/stbctrls/pszctrl.cxx @@ -113,19 +113,19 @@ SFX_IMPL_STATUSBAR_CONTROL(SvxPosSizeStatusBarControl, SvxSizeItem); class FunctionPopup_Impl : public PopupMenu { public: - FunctionPopup_Impl( USHORT nCheck ); + FunctionPopup_Impl( sal_uInt16 nCheck ); - USHORT GetSelected() const { return nSelected; } + sal_uInt16 GetSelected() const { return nSelected; } private: - USHORT nSelected; + sal_uInt16 nSelected; virtual void Select(); }; // ----------------------------------------------------------------------- -FunctionPopup_Impl::FunctionPopup_Impl( USHORT nCheck ) : +FunctionPopup_Impl::FunctionPopup_Impl( sal_uInt16 nCheck ) : PopupMenu( ResId( RID_SVXMNU_PSZ_FUNC, DIALOG_MGR() ) ), nSelected( 0 ) { @@ -158,11 +158,11 @@ struct SvxPosSizeStatusBarControl_Impl Point aPos; // g"ultig, wenn eine Position angezeigt wird Size aSize; // g"ultig, wenn eine Gr"o/se angezeigt wird String aStr; // g"ultig, wenn ein Text angezeigt wird - BOOL bPos; // show position - BOOL bSize; // Gr"o/se anzeigen? - BOOL bTable; // Tabellenindex anzeigen? - BOOL bHasMenu; // StarCalc Popup-Menue anzeigen? - USHORT nFunction; // selektierte StarCalc Funktion + sal_Bool bPos; // show position + sal_Bool bSize; // Gr"o/se anzeigen? + sal_Bool bTable; // Tabellenindex anzeigen? + sal_Bool bHasMenu; // StarCalc Popup-Menue anzeigen? + sal_uInt16 nFunction; // selektierte StarCalc Funktion Image aPosImage; // Image f"ur die Positionsanzeige Image aSizeImage; // Image f"ur die Gr"o/senanzeige }; @@ -180,16 +180,16 @@ struct SvxPosSizeStatusBarControl_Impl #define STR_TABLECELL ".uno:StateTableCell" #define STR_FUNC ".uno:StatusBarFunc" -SvxPosSizeStatusBarControl::SvxPosSizeStatusBarControl( USHORT _nSlotId, - USHORT _nId, +SvxPosSizeStatusBarControl::SvxPosSizeStatusBarControl( sal_uInt16 _nSlotId, + sal_uInt16 _nId, StatusBar& rStb ) : SfxStatusBarControl( _nSlotId, _nId, rStb ), pImp( new SvxPosSizeStatusBarControl_Impl ) { - pImp->bPos = FALSE; - pImp->bSize = FALSE; - pImp->bTable = FALSE; - pImp->bHasMenu = FALSE; + pImp->bPos = sal_False; + pImp->bSize = sal_False; + pImp->bTable = sal_False; + pImp->bHasMenu = sal_False; pImp->nFunction = 0; pImp->aPosImage = Image( ResId( RID_SVXBMP_POSITION, DIALOG_MGR() ) ); pImp->aSizeImage = Image( ResId( RID_SVXBMP_SIZE, DIALOG_MGR() ) ); @@ -223,15 +223,15 @@ SvxPosSizeStatusBarControl::~SvxPosSizeStatusBarControl() NULL/Void SfxPointItem SvxSizeItem SfxStringItem ------------------------------------------------------------------------ - Zeit TRUE FALSE FALSE FALSE - Position FALSE FALSE + Zeit sal_True sal_False sal_False FALSE + Position sal_False FALSE Gro"sse FALSE TRUE FALSE - Text FALSE FALSE TRUE + Text sal_False sal_False TRUE Ein anderes Item bewirkt einen Assert, die Zeitanzeige wird enabled. */ -void SvxPosSizeStatusBarControl::StateChanged( USHORT nSID, SfxItemState eState, +void SvxPosSizeStatusBarControl::StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ) { // da Kombi-Controller, immer die aktuelle Id als HelpId setzen @@ -250,12 +250,12 @@ void SvxPosSizeStatusBarControl::StateChanged( USHORT nSID, SfxItemState eState, { if ( eState == SFX_ITEM_AVAILABLE ) { - pImp->bHasMenu = TRUE; + pImp->bHasMenu = sal_True; if ( pState && pState->ISA(SfxUInt16Item) ) pImp->nFunction = ((const SfxUInt16Item*)pState)->GetValue(); } else - pImp->bHasMenu = FALSE; + pImp->bHasMenu = sal_False; } else if ( SFX_ITEM_AVAILABLE != eState ) { @@ -263,11 +263,11 @@ void SvxPosSizeStatusBarControl::StateChanged( USHORT nSID, SfxItemState eState, // notified for all display types if ( nSID == SID_TABLE_CELL ) - pImp->bTable = FALSE; + pImp->bTable = sal_False; else if ( nSID == SID_ATTR_POSITION ) - pImp->bPos = FALSE; + pImp->bPos = sal_False; else if ( nSID == GetSlotId() ) // controller is registered for SID_ATTR_SIZE - pImp->bSize = FALSE; + pImp->bSize = sal_False; else { DBG_ERRORFILE("unknown slot id"); @@ -277,31 +277,31 @@ void SvxPosSizeStatusBarControl::StateChanged( USHORT nSID, SfxItemState eState, { // Position anzeigen pImp->aPos = ( (SfxPointItem*)pState )->GetValue(); - pImp->bPos = TRUE; - pImp->bTable = FALSE; + pImp->bPos = sal_True; + pImp->bTable = sal_False; } else if ( pState->ISA( SvxSizeItem ) ) { // Groesse anzeigen pImp->aSize = ( (SvxSizeItem*)pState )->GetSize(); - pImp->bSize = TRUE; - pImp->bTable = FALSE; + pImp->bSize = sal_True; + pImp->bTable = sal_False; } else if ( pState->ISA( SfxStringItem ) ) { // String anzeigen (Tabellen-Zelle oder anderes) pImp->aStr = ( (SfxStringItem*)pState )->GetValue(); - pImp->bTable = TRUE; - pImp->bPos = FALSE; - pImp->bSize = FALSE; + pImp->bTable = sal_True; + pImp->bPos = sal_False; + pImp->bSize = sal_False; } else { DBG_ERRORFILE( "invalid item type" ); // trotzdem Datum und Zeit anzeigen - pImp->bPos = FALSE; - pImp->bSize = FALSE; - pImp->bTable = FALSE; + pImp->bPos = sal_False; + pImp->bSize = sal_False; + pImp->bTable = sal_False; } if ( GetStatusBar().AreItemsVisible() ) @@ -326,7 +326,7 @@ void SvxPosSizeStatusBarControl::Command( const CommandEvent& rCEvt ) { if ( rCEvt.GetCommand() == COMMAND_CONTEXTMENU && pImp->bHasMenu ) { - USHORT nSelect = pImp->nFunction; + sal_uInt16 nSelect = pImp->nFunction; if (!nSelect) nSelect = PSZ_FUNC_NONE; FunctionPopup_Impl aMenu( nSelect ); @@ -432,12 +432,12 @@ void SvxPosSizeStatusBarControl::Paint( const UserDrawEvent& rUsrEvt ) // ----------------------------------------------------------------------- -ULONG SvxPosSizeStatusBarControl::GetDefItemWidth(const StatusBar& rStb) +sal_uIntPtr SvxPosSizeStatusBarControl::GetDefItemWidth(const StatusBar& rStb) { Image aTmpPosImage( ResId( RID_SVXBMP_POSITION, DIALOG_MGR() ) ); Image aTmpSizeImage( ResId( RID_SVXBMP_SIZE, DIALOG_MGR() ) ); - ULONG nWidth=PAINT_OFFSET+aTmpPosImage.GetSizePixel().Width(); + sal_uIntPtr nWidth=PAINT_OFFSET+aTmpPosImage.GetSizePixel().Width(); nWidth+=PAINT_OFFSET+aTmpSizeImage.GetSizePixel().Width(); nWidth+=2*(PAINT_OFFSET+rStb.GetTextWidth(String::CreateFromAscii("XXXX,XX / XXXX,XX"))); diff --git a/svx/source/stbctrls/selctrl.cxx b/svx/source/stbctrls/selctrl.cxx index e56ba9aeaef9..e216a4c204ba 100644 --- a/svx/source/stbctrls/selctrl.cxx +++ b/svx/source/stbctrls/selctrl.cxx @@ -50,8 +50,8 @@ SFX_IMPL_STATUSBAR_CONTROL(SvxSelectionModeControl, SfxUInt16Item); // class SvxSelectionModeControl ----------------------------------------- -SvxSelectionModeControl::SvxSelectionModeControl( USHORT _nSlotId, - USHORT _nId, +SvxSelectionModeControl::SvxSelectionModeControl( sal_uInt16 _nSlotId, + sal_uInt16 _nId, StatusBar& rStb ) : SfxStatusBarControl( _nSlotId, _nId, rStb ), nState( 0 ) @@ -60,7 +60,7 @@ SvxSelectionModeControl::SvxSelectionModeControl( USHORT _nSlotId, // ----------------------------------------------------------------------- -void SvxSelectionModeControl::StateChanged( USHORT, SfxItemState eState, +void SvxSelectionModeControl::StateChanged( sal_uInt16, SfxItemState eState, const SfxPoolItem* pState ) { if ( SFX_ITEM_AVAILABLE != eState ) @@ -108,7 +108,7 @@ void SvxSelectionModeControl::Paint( const UserDrawEvent& ) void SvxSelectionModeControl::DrawItemText_Impl() { String sTxt; - USHORT _nId = 0; + sal_uInt16 _nId = 0; switch ( nState ) { @@ -132,7 +132,7 @@ void SvxSelectionModeControl::DrawItemText_Impl() GetStatusBar().SetItemText( GetId(), sTxt ); } -ULONG SvxSelectionModeControl::GetDefItemWidth(const StatusBar& rStb) +sal_uIntPtr SvxSelectionModeControl::GetDefItemWidth(const StatusBar& rStb) { long nWidth1 = rStb.GetTextWidth(SVX_RESSTR(RID_SVXSTR_SELMODE_STD)); long nWidth2 = rStb.GetTextWidth(SVX_RESSTR(RID_SVXSTR_SELMODE_ER)); diff --git a/svx/source/stbctrls/xmlsecctrl.cxx b/svx/source/stbctrls/xmlsecctrl.cxx index 26daed799c6e..4a5062cc6645 100644 --- a/svx/source/stbctrls/xmlsecctrl.cxx +++ b/svx/source/stbctrls/xmlsecctrl.cxx @@ -80,19 +80,19 @@ struct XmlSecStatusBarControl::XmlSecStatusBarControl_Impl { Point maPos; Size maSize; - UINT16 mnState; + sal_uInt16 mnState; Image maImage; Image maImageBroken; Image maImageNotValidated; }; -XmlSecStatusBarControl::XmlSecStatusBarControl( USHORT _nSlotId, USHORT _nId, StatusBar& _rStb ) +XmlSecStatusBarControl::XmlSecStatusBarControl( sal_uInt16 _nSlotId, sal_uInt16 _nId, StatusBar& _rStb ) :SfxStatusBarControl( _nSlotId, _nId, _rStb ) ,mpImpl( new XmlSecStatusBarControl_Impl ) { - mpImpl->mnState = (UINT16)SIGNATURESTATE_UNKNOWN; + mpImpl->mnState = (sal_uInt16)SIGNATURESTATE_UNKNOWN; sal_Bool bHC = GetStatusBar().GetSettings().GetStyleSettings().GetHighContrastMode(); mpImpl->maImage = Image( SVX_RES( bHC ? RID_SVXBMP_SIGNET_H : RID_SVXBMP_SIGNET ) ); @@ -107,11 +107,11 @@ XmlSecStatusBarControl::~XmlSecStatusBarControl() delete mpImpl; } -void XmlSecStatusBarControl::StateChanged( USHORT, SfxItemState eState, const SfxPoolItem* pState ) +void XmlSecStatusBarControl::StateChanged( sal_uInt16, SfxItemState eState, const SfxPoolItem* pState ) { if( SFX_ITEM_AVAILABLE != eState ) { - mpImpl->mnState = (UINT16)SIGNATURESTATE_UNKNOWN; + mpImpl->mnState = (sal_uInt16)SIGNATURESTATE_UNKNOWN; } else if( pState->ISA( SfxUInt16Item ) ) { @@ -121,7 +121,7 @@ void XmlSecStatusBarControl::StateChanged( USHORT, SfxItemState eState, const Sf else { DBG_ERRORFILE( "+XmlSecStatusBarControl::StateChanged(): invalid item type" ); - mpImpl->mnState = (UINT16)SIGNATURESTATE_UNKNOWN; + mpImpl->mnState = (sal_uInt16)SIGNATURESTATE_UNKNOWN; } if( GetStatusBar().AreItemsVisible() ) // necessary ? @@ -129,7 +129,7 @@ void XmlSecStatusBarControl::StateChanged( USHORT, SfxItemState eState, const Sf GetStatusBar().SetItemText( GetId(), String() ); // necessary ? - USHORT nResId = RID_SVXSTR_XMLSEC_NO_SIG; + sal_uInt16 nResId = RID_SVXSTR_XMLSEC_NO_SIG; if ( mpImpl->mnState == SIGNATURESTATE_SIGNATURES_OK ) nResId = RID_SVXSTR_XMLSEC_SIG_OK; else if ( mpImpl->mnState == SIGNATURESTATE_SIGNATURES_BROKEN ) diff --git a/svx/source/stbctrls/zoomctrl.cxx b/svx/source/stbctrls/zoomctrl.cxx index fb9fc65583e3..9439df87d8b9 100644 --- a/svx/source/stbctrls/zoomctrl.cxx +++ b/svx/source/stbctrls/zoomctrl.cxx @@ -52,27 +52,27 @@ SFX_IMPL_STATUSBAR_CONTROL(SvxZoomStatusBarControl,SvxZoomItem); class ZoomPopup_Impl : public PopupMenu { public: - ZoomPopup_Impl( USHORT nZ, USHORT nValueSet ); + ZoomPopup_Impl( sal_uInt16 nZ, sal_uInt16 nValueSet ); - USHORT GetZoom() const { return nZoom; } - USHORT GetCurId() const { return nCurId; } + sal_uInt16 GetZoom() const { return nZoom; } + sal_uInt16 GetCurId() const { return nCurId; } private: - USHORT nZoom; - USHORT nCurId; + sal_uInt16 nZoom; + sal_uInt16 nCurId; virtual void Select(); }; // ----------------------------------------------------------------------- -ZoomPopup_Impl::ZoomPopup_Impl( USHORT nZ, USHORT nValueSet ) +ZoomPopup_Impl::ZoomPopup_Impl( sal_uInt16 nZ, sal_uInt16 nValueSet ) : PopupMenu( ResId( RID_SVXMNU_ZOOM, DIALOG_MGR() ) ), nZoom( nZ ) { - static USHORT aTable[] = + static sal_uInt16 aTable[] = { SVX_ZOOM_ENABLE_50, ZOOM_50, SVX_ZOOM_ENABLE_100, ZOOM_100, @@ -83,9 +83,9 @@ ZoomPopup_Impl::ZoomPopup_Impl( USHORT nZ, USHORT nValueSet ) SVX_ZOOM_ENABLE_PAGEWIDTH, ZOOM_PAGE_WIDTH }; - for ( USHORT nPos = 0; nPos < sizeof(aTable) / sizeof(USHORT); nPos += 2 ) + for ( sal_uInt16 nPos = 0; nPos < sizeof(aTable) / sizeof(sal_uInt16); nPos += 2 ) if ( ( aTable[nPos] != ( aTable[nPos] & nValueSet ) ) ) - EnableItem( aTable[nPos+1], FALSE ); + EnableItem( aTable[nPos+1], sal_False ); } // ----------------------------------------------------------------------- @@ -111,8 +111,8 @@ void ZoomPopup_Impl::Select() // class SvxZoomStatusBarControl ------------------------------------------ -SvxZoomStatusBarControl::SvxZoomStatusBarControl( USHORT _nSlotId, - USHORT _nId, +SvxZoomStatusBarControl::SvxZoomStatusBarControl( sal_uInt16 _nSlotId, + sal_uInt16 _nId, StatusBar& rStb ) : SfxStatusBarControl( _nSlotId, _nId, rStb ), @@ -123,7 +123,7 @@ SvxZoomStatusBarControl::SvxZoomStatusBarControl( USHORT _nSlotId, // ----------------------------------------------------------------------- -void SvxZoomStatusBarControl::StateChanged( USHORT, SfxItemState eState, +void SvxZoomStatusBarControl::StateChanged( sal_uInt16, SfxItemState eState, const SfxPoolItem* pState ) { if( SFX_ITEM_AVAILABLE != eState ) @@ -214,7 +214,7 @@ void SvxZoomStatusBarControl::Command( const CommandEvent& rCEvt ) SfxStatusBarControl::Command( rCEvt ); } -ULONG SvxZoomStatusBarControl::GetDefItemWidth(const StatusBar& rStb) +sal_uIntPtr SvxZoomStatusBarControl::GetDefItemWidth(const StatusBar& rStb) { long nWidth1 = rStb.GetTextWidth(String::CreateFromAscii("XXXXX%")); return nWidth1; diff --git a/svx/source/stbctrls/zoomsliderctrl.cxx b/svx/source/stbctrls/zoomsliderctrl.cxx index 729538f707c7..a957482405c4 100644 --- a/svx/source/stbctrls/zoomsliderctrl.cxx +++ b/svx/source/stbctrls/zoomsliderctrl.cxx @@ -51,12 +51,12 @@ SFX_IMPL_STATUSBAR_CONTROL( SvxZoomSliderControl, SvxZoomSliderItem ); struct SvxZoomSliderControl::SvxZoomSliderControl_Impl { - USHORT mnCurrentZoom; - USHORT mnMinZoom; - USHORT mnMaxZoom; - USHORT mnSliderCenter; + sal_uInt16 mnCurrentZoom; + sal_uInt16 mnMinZoom; + sal_uInt16 mnMaxZoom; + sal_uInt16 mnSliderCenter; std::vector< long > maSnappingPointOffsets; - std::vector< USHORT > maSnappingPointZooms; + std::vector< sal_uInt16 > maSnappingPointZooms; Image maSliderButton; Image maIncreaseButton; Image maDecreaseButton; @@ -93,10 +93,10 @@ const long nSnappingPointsMinDist = nSnappingEpsilon; // minimum distance of two // nOffset referes to the origin of the control: // + ----------- - -USHORT SvxZoomSliderControl::Offset2Zoom( long nOffset ) const +sal_uInt16 SvxZoomSliderControl::Offset2Zoom( long nOffset ) const { const long nControlWidth = getControlRect().GetWidth(); - USHORT nRet = 0; + sal_uInt16 nRet = 0; if ( nOffset < nSliderXOffset ) return mpImpl->mnMinZoom;; @@ -105,7 +105,7 @@ USHORT SvxZoomSliderControl::Offset2Zoom( long nOffset ) const return mpImpl->mnMaxZoom; // check for snapping points: - USHORT nCount = 0; + sal_uInt16 nCount = 0; std::vector< long >::iterator aSnappingPointIter; for ( aSnappingPointIter = mpImpl->maSnappingPointOffsets.begin(); aSnappingPointIter != mpImpl->maSnappingPointOffsets.end(); @@ -130,7 +130,7 @@ USHORT SvxZoomSliderControl::Offset2Zoom( long nOffset ) const const long nHalfSliderWidth = nControlWidth/2 - nSliderXOffset; const long nZoomPerSliderPixel = (1000 * nFirstHalfRange) / nHalfSliderWidth; const long nOffsetToSliderLeft = nOffset - nSliderXOffset; - nRet = mpImpl->mnMinZoom + USHORT( nOffsetToSliderLeft * nZoomPerSliderPixel / 1000 ); + nRet = mpImpl->mnMinZoom + sal_uInt16( nOffsetToSliderLeft * nZoomPerSliderPixel / 1000 ); } else { @@ -139,7 +139,7 @@ USHORT SvxZoomSliderControl::Offset2Zoom( long nOffset ) const const long nHalfSliderWidth = nControlWidth/2 - nSliderXOffset; const long nZoomPerSliderPixel = 1000 * nSecondHalfRange / nHalfSliderWidth; const long nOffsetToSliderCenter = nOffset - nControlWidth/2; - nRet = mpImpl->mnSliderCenter + USHORT( nOffsetToSliderCenter * nZoomPerSliderPixel / 1000 ); + nRet = mpImpl->mnSliderCenter + sal_uInt16( nOffsetToSliderCenter * nZoomPerSliderPixel / 1000 ); } } @@ -152,7 +152,7 @@ USHORT SvxZoomSliderControl::Offset2Zoom( long nOffset ) const } // returns the offset to the left control border -long SvxZoomSliderControl::Zoom2Offset( USHORT nCurrentZoom ) const +long SvxZoomSliderControl::Zoom2Offset( sal_uInt16 nCurrentZoom ) const { const long nControlWidth = getControlRect().GetWidth(); long nRet = nSliderXOffset; @@ -181,7 +181,7 @@ long SvxZoomSliderControl::Zoom2Offset( USHORT nCurrentZoom ) const // ----------------------------------------------------------------------- -SvxZoomSliderControl::SvxZoomSliderControl( USHORT _nSlotId, USHORT _nId, StatusBar& _rStb ) : +SvxZoomSliderControl::SvxZoomSliderControl( sal_uInt16 _nSlotId, sal_uInt16 _nId, StatusBar& _rStb ) : SfxStatusBarControl( _nSlotId, _nId, _rStb ), mpImpl( new SvxZoomSliderControl_Impl ) { @@ -200,7 +200,7 @@ SvxZoomSliderControl::~SvxZoomSliderControl() // ----------------------------------------------------------------------- -void SvxZoomSliderControl::StateChanged( USHORT /*nSID*/, SfxItemState eState, const SfxPoolItem* pState ) +void SvxZoomSliderControl::StateChanged( sal_uInt16 /*nSID*/, SfxItemState eState, const SfxPoolItem* pState ) { if ( (SFX_ITEM_AVAILABLE != eState) || pState->ISA( SfxVoidItem ) ) { @@ -217,7 +217,7 @@ void SvxZoomSliderControl::StateChanged( USHORT /*nSID*/, SfxItemState eState, c mpImpl->mbValuesSet = true; if ( mpImpl->mnSliderCenter == mpImpl->mnMaxZoom ) - mpImpl->mnSliderCenter = mpImpl->mnMinZoom + (USHORT)((mpImpl->mnMaxZoom - mpImpl->mnMinZoom) * 0.5); + mpImpl->mnSliderCenter = mpImpl->mnMinZoom + (sal_uInt16)((mpImpl->mnMaxZoom - mpImpl->mnMinZoom) * 0.5); DBG_ASSERT( mpImpl->mnMinZoom <= mpImpl->mnCurrentZoom && @@ -231,20 +231,20 @@ void SvxZoomSliderControl::StateChanged( USHORT /*nSID*/, SfxItemState eState, c mpImpl->maSnappingPointZooms.clear(); // get all snapping points: - std::set< USHORT > aTmpSnappingPoints; - for ( USHORT j = 0; j < rSnappingPoints.getLength(); ++j ) + std::set< sal_uInt16 > aTmpSnappingPoints; + for ( sal_uInt16 j = 0; j < rSnappingPoints.getLength(); ++j ) { const sal_Int32 nSnappingPoint = rSnappingPoints[j]; - aTmpSnappingPoints.insert( (USHORT)nSnappingPoint ); + aTmpSnappingPoints.insert( (sal_uInt16)nSnappingPoint ); } // remove snapping points that are to close to each other: - std::set< USHORT >::iterator aSnappingPointIter; + std::set< sal_uInt16 >::iterator aSnappingPointIter; long nLastOffset = 0; for ( aSnappingPointIter = aTmpSnappingPoints.begin(); aSnappingPointIter != aTmpSnappingPoints.end(); ++aSnappingPointIter ) { - const USHORT nCurrent = *aSnappingPointIter; + const sal_uInt16 nCurrent = *aSnappingPointIter; const long nCurrentOffset = Zoom2Offset( nCurrent ); if ( nCurrentOffset - nLastOffset >= nSnappingPointsMinDist ) @@ -347,10 +347,10 @@ void SvxZoomSliderControl::Paint( const UserDrawEvent& rUsrEvt ) // ----------------------------------------------------------------------- -BOOL SvxZoomSliderControl::MouseButtonDown( const MouseEvent & rEvt ) +sal_Bool SvxZoomSliderControl::MouseButtonDown( const MouseEvent & rEvt ) { if ( !mpImpl->mbValuesSet ) - return TRUE;; + return sal_True;; const Rectangle aControlRect = getControlRect(); const Point aPoint = rEvt.GetPosPixel(); @@ -378,7 +378,7 @@ BOOL SvxZoomSliderControl::MouseButtonDown( const MouseEvent & rEvt ) mpImpl->mnCurrentZoom = mpImpl->mnMaxZoom; if ( nOldZoom == mpImpl->mnCurrentZoom ) - return TRUE; + return sal_True; if ( GetStatusBar().AreItemsVisible() ) GetStatusBar().SetItemData( GetId(), 0 ); // force repaint @@ -399,15 +399,15 @@ BOOL SvxZoomSliderControl::MouseButtonDown( const MouseEvent & rEvt ) mpImpl->mbOmitPaint = false; - return TRUE; + return sal_True; } // ----------------------------------------------------------------------- -BOOL SvxZoomSliderControl::MouseMove( const MouseEvent & rEvt ) +sal_Bool SvxZoomSliderControl::MouseMove( const MouseEvent & rEvt ) { if ( !mpImpl->mbValuesSet ) - return TRUE;; + return sal_True;; const short nButtons = rEvt.GetButtons(); @@ -444,5 +444,5 @@ BOOL SvxZoomSliderControl::MouseMove( const MouseEvent & rEvt ) } } - return TRUE; + return sal_True; } |