summaryrefslogtreecommitdiff
path: root/svtools/source/control
diff options
context:
space:
mode:
Diffstat (limited to 'svtools/source/control')
-rw-r--r--svtools/source/control/autocmpledit.cxx4
-rw-r--r--svtools/source/control/breadcrumb.cxx4
-rw-r--r--svtools/source/control/calendar.cxx50
-rw-r--r--svtools/source/control/ctrlbox.cxx2
-rw-r--r--svtools/source/control/headbar.cxx10
-rw-r--r--svtools/source/control/inettbc.cxx6
-rw-r--r--svtools/source/control/roadmap.cxx4
-rw-r--r--svtools/source/control/scrwin.cxx4
-rw-r--r--svtools/source/control/toolbarmenu.cxx4
-rw-r--r--svtools/source/control/valueset.cxx10
10 files changed, 49 insertions, 49 deletions
diff --git a/svtools/source/control/autocmpledit.cxx b/svtools/source/control/autocmpledit.cxx
index 262c7341d81c..d008ee41bc69 100644
--- a/svtools/source/control/autocmpledit.cxx
+++ b/svtools/source/control/autocmpledit.cxx
@@ -39,7 +39,7 @@ IMPL_LINK_NOARG(AutocompleteEdit, AutoCompleteHdl_Impl, Edit&, void)
if( aSelection.Max() != aCurText.getLength() )
return;
- sal_uInt16 nLen = ( sal_uInt16 )aSelection.Min();
+ sal_uInt16 nLen = static_cast<sal_uInt16>(aSelection.Min());
aCurText = aCurText.copy( 0, nLen );
if( aCurText.isEmpty() )
return;
@@ -87,7 +87,7 @@ bool AutocompleteEdit::PreNotify( NotifyEvent& rNEvt )
if( ( aCode == KEY_UP || aCode == KEY_DOWN ) && !rKey.IsMod2() )
{
Selection aSelection( GetSelection() );
- sal_uInt16 nLen = ( sal_uInt16 )aSelection.Min();
+ sal_uInt16 nLen = static_cast<sal_uInt16>(aSelection.Min());
if( m_aMatching.size() &&
( ( aCode == KEY_DOWN && m_nCurrent + 1 < m_aMatching.size() )
diff --git a/svtools/source/control/breadcrumb.cxx b/svtools/source/control/breadcrumb.cxx
index 3bb9fa390263..cbaa8ccf655c 100644
--- a/svtools/source/control/breadcrumb.cxx
+++ b/svtools/source/control/breadcrumb.cxx
@@ -135,7 +135,7 @@ void Breadcrumb::SetURL( const OUString& rURL )
// fill the other fields
- for( unsigned int i = 1; i < (unsigned int)nSegments + 1; i++ )
+ for( unsigned int i = 1; i < static_cast<unsigned int>(nSegments) + 1; i++ )
{
if( i >= m_aLinks.size() )
appendField();
@@ -210,7 +210,7 @@ void Breadcrumb::SetURL( const OUString& rURL )
}
}
- if( nSegments + i == (int)m_aLinks.size() )
+ if( nSegments + i == static_cast<int>(m_aLinks.size()) )
bRight = false;
if( i != 0 && bRight )
diff --git a/svtools/source/control/calendar.cxx b/svtools/source/control/calendar.cxx
index e4bfa6e58cf4..b558629551c8 100644
--- a/svtools/source/control/calendar.cxx
+++ b/svtools/source/control/calendar.cxx
@@ -48,10 +48,10 @@
#define SPIN_OFFX 4
#define SPIN_OFFY TITLE_BORDERY
-#define CALENDAR_HITTEST_DAY ((sal_uInt16)0x0001)
-#define CALENDAR_HITTEST_MONTHTITLE ((sal_uInt16)0x0004)
-#define CALENDAR_HITTEST_PREV ((sal_uInt16)0x0008)
-#define CALENDAR_HITTEST_NEXT ((sal_uInt16)0x0010)
+#define CALENDAR_HITTEST_DAY (sal_uInt16(0x0001))
+#define CALENDAR_HITTEST_MONTHTITLE (sal_uInt16(0x0004))
+#define CALENDAR_HITTEST_PREV (sal_uInt16(0x0008))
+#define CALENDAR_HITTEST_NEXT (sal_uInt16(0x0010))
#define MENU_YEAR_COUNT 3
@@ -292,12 +292,12 @@ void Calendar::ImplFormat()
sal_uInt16 nWeekDay;
Date aTempDate = GetFirstMonth();
maFirstDate = aTempDate;
- nWeekDay = (sal_uInt16)aTempDate.GetDayOfWeek();
- nWeekDay = (nWeekDay+(7-(sal_uInt16)eStartDay)) % 7;
+ nWeekDay = static_cast<sal_uInt16>(aTempDate.GetDayOfWeek());
+ nWeekDay = (nWeekDay+(7-static_cast<sal_uInt16>(eStartDay))) % 7;
maFirstDate.AddDays( -nWeekDay );
mnDayCount = nWeekDay;
sal_uInt16 nDaysInMonth;
- sal_uInt16 nMonthCount = (sal_uInt16)(mnMonthPerLine*mnLines);
+ sal_uInt16 nMonthCount = static_cast<sal_uInt16>(mnMonthPerLine*mnLines);
for ( sal_uInt16 i = 0; i < nMonthCount; i++ )
{
nDaysInMonth = aTempDate.GetDaysInMonth();
@@ -308,8 +308,8 @@ void Calendar::ImplFormat()
--aTempDate2;
nDaysInMonth = aTempDate2.GetDaysInMonth();
aTempDate2.AddDays( -(nDaysInMonth-1) );
- nWeekDay = (sal_uInt16)aTempDate2.GetDayOfWeek();
- nWeekDay = (nWeekDay+(7-(sal_uInt16)eStartDay)) % 7;
+ nWeekDay = static_cast<sal_uInt16>(aTempDate2.GetDayOfWeek());
+ nWeekDay = (nWeekDay+(7-static_cast<sal_uInt16>(eStartDay))) % 7;
mnDayCount += 42-nDaysInMonth-nWeekDay;
// determine colours
@@ -391,8 +391,8 @@ sal_uInt16 Calendar::ImplHitTest( const Point& rPos, Date& rDate ) const
long nDayY = nY+mnDaysOffY;
if ( rPos.Y() < nDayY )
return 0;
- sal_Int32 nDayIndex = (sal_Int32)rDate.GetDayOfWeek();
- nDayIndex = (nDayIndex+(7-(sal_Int32)eStartDay)) % 7;
+ sal_Int32 nDayIndex = static_cast<sal_Int32>(rDate.GetDayOfWeek());
+ nDayIndex = (nDayIndex+(7-static_cast<sal_Int32>(eStartDay))) % 7;
if ( (i == 0) && (j == 0) )
{
Date aTempDate = rDate;
@@ -433,8 +433,8 @@ sal_uInt16 Calendar::ImplHitTest( const Point& rPos, Date& rDate ) const
}
if ( (i == mnLines-1) && (j == mnMonthPerLine-1) )
{
- sal_uInt16 nWeekDay = (sal_uInt16)rDate.GetDayOfWeek();
- nWeekDay = (nWeekDay+(7-(sal_uInt16)eStartDay)) % 7;
+ sal_uInt16 nWeekDay = static_cast<sal_uInt16>(rDate.GetDayOfWeek());
+ nWeekDay = (nWeekDay+(7-static_cast<sal_uInt16>(eStartDay))) % 7;
sal_Int32 nDayCount = 42-nDaysInMonth-nWeekDay;
Date aTempDate = rDate;
aTempDate.AddDays( nDaysInMonth );
@@ -745,8 +745,8 @@ void Calendar::ImplDraw(vcl::RenderContext& rRenderContext)
sal_uInt16 nDaysInMonth = aDate.GetDaysInMonth();
nDayX = nX + mnDaysOffX;
nDayY = nY + mnDaysOffY;
- sal_uInt16 nDayIndex = (sal_uInt16) aDate.GetDayOfWeek();
- nDayIndex = (nDayIndex + (7 - (sal_uInt16)eStartDay)) % 7;
+ sal_uInt16 nDayIndex = static_cast<sal_uInt16>(aDate.GetDayOfWeek());
+ nDayIndex = (nDayIndex + (7 - static_cast<sal_uInt16>(eStartDay))) % 7;
if (i == 0 && j == 0)
{
Date aTempDate = aDate;
@@ -756,14 +756,14 @@ void Calendar::ImplDraw(vcl::RenderContext& rRenderContext)
nDeltaX = nDayX + (nDay * mnDayWidth);
ImplDrawDate(rRenderContext, nDeltaX, nDayY, nDay + aTempDate.GetDay(),
aTempDate.GetMonth(), aTempDate.GetYear(),
- (DayOfWeek)((nDay + (sal_uInt16)eStartDay) % 7), true, nToday);
+ (DayOfWeek)((nDay + static_cast<sal_uInt16>(eStartDay)) % 7), true, nToday);
}
}
for (nDay = 1; nDay <= nDaysInMonth; nDay++)
{
nDeltaX = nDayX + (nDayIndex * mnDayWidth);
ImplDrawDate(rRenderContext, nDeltaX, nDayY, nDay, nMonth, nYear,
- (DayOfWeek)((nDayIndex + (sal_uInt16)eStartDay) % 7),
+ (DayOfWeek)((nDayIndex + static_cast<sal_uInt16>(eStartDay)) % 7),
false, nToday);
if (nDayIndex == 6)
{
@@ -775,8 +775,8 @@ void Calendar::ImplDraw(vcl::RenderContext& rRenderContext)
}
if ((i == mnLines - 1) && (j == mnMonthPerLine - 1))
{
- sal_uInt16 nWeekDay = (sal_uInt16)aDate.GetDayOfWeek();
- nWeekDay = (nWeekDay + (7 - (sal_uInt16)eStartDay)) % 7;
+ sal_uInt16 nWeekDay = static_cast<sal_uInt16>(aDate.GetDayOfWeek());
+ nWeekDay = (nWeekDay + (7 - static_cast<sal_uInt16>(eStartDay))) % 7;
sal_uInt16 nDayCount = 42 - nDaysInMonth - nWeekDay;
Date aTempDate = aDate;
aTempDate.AddDays( nDaysInMonth );
@@ -785,7 +785,7 @@ void Calendar::ImplDraw(vcl::RenderContext& rRenderContext)
nDeltaX = nDayX + (nDayIndex * mnDayWidth);
ImplDrawDate(rRenderContext, nDeltaX, nDayY, nDay,
aTempDate.GetMonth(), aTempDate.GetYear(),
- (DayOfWeek)((nDayIndex + (sal_uInt16)eStartDay) % 7),
+ (DayOfWeek)((nDayIndex + static_cast<sal_uInt16>(eStartDay)) % 7),
true, nToday);
if (nDayIndex == 6)
{
@@ -1238,7 +1238,7 @@ void Calendar::RequestHelp( const HelpEvent& rHEvt )
if ( rHEvt.GetMode() & HelpEventMode::QUICK )
{
maCalendarWrapper.setGregorianDateTime( aDate);
- sal_uInt16 nWeek = (sal_uInt16) maCalendarWrapper.getValue( i18n::CalendarFieldIndex::WEEK_OF_YEAR);
+ sal_uInt16 nWeek = static_cast<sal_uInt16>(maCalendarWrapper.getValue( i18n::CalendarFieldIndex::WEEK_OF_YEAR));
sal_uInt16 nMonth = aDate.GetMonth();
OUString aStr = maDayText
+ ": "
@@ -1437,7 +1437,7 @@ sal_uInt16 Calendar::GetMonthCount() const
if ( mbFormat )
return 1;
else
- return (sal_uInt16)(mnMonthPerLine*mnLines);
+ return static_cast<sal_uInt16>(mnMonthPerLine*mnLines);
}
bool Calendar::GetDate( const Point& rPos, Date& rDate ) const
@@ -1480,7 +1480,7 @@ tools::Rectangle Calendar::GetDateRect( const Date& rDate ) const
Date aLastDate = GetLastMonth();
if ( rDate > aLastDate )
{
- sal_Int32 nWeekDay = (sal_Int32)aLastDate.GetDayOfWeek();
+ sal_Int32 nWeekDay = static_cast<sal_Int32>(aLastDate.GetDayOfWeek());
nWeekDay = (nWeekDay+(7-ImplGetWeekStart())) % 7;
aLastDate.AddDays( -nWeekDay );
aRect = GetDateRect( aLastDate );
@@ -1521,8 +1521,8 @@ tools::Rectangle Calendar::GetDateRect( const Date& rDate ) const
{
long nDayX = nX+mnDaysOffX;
long nDayY = nY+mnDaysOffY;
- nDayIndex = (sal_uInt16)aDate.GetDayOfWeek();
- nDayIndex = (nDayIndex+(7-(sal_uInt16)ImplGetWeekStart())) % 7;
+ nDayIndex = static_cast<sal_uInt16>(aDate.GetDayOfWeek());
+ nDayIndex = (nDayIndex+(7-static_cast<sal_uInt16>(ImplGetWeekStart()))) % 7;
for ( sal_uInt16 nDay = 1; nDay <= nDaysInMonth; nDay++ )
{
if ( nDay == rDate.GetDay() )
diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx
index 16c6fdcb7310..de28bb513ae5 100644
--- a/svtools/source/control/ctrlbox.cxx
+++ b/svtools/source/control/ctrlbox.cxx
@@ -561,7 +561,7 @@ sal_Int32 LineListBox::GetEntryPos( SvxBorderLineStyle nStyle ) const
size_t nPos = i;
if (!m_sNone.isEmpty())
nPos ++;
- return (sal_Int32)nPos;
+ return static_cast<sal_Int32>(nPos);
}
}
return LISTBOX_ENTRY_NOTFOUND;
diff --git a/svtools/source/control/headbar.cxx b/svtools/source/control/headbar.cxx
index 42c0f9cd092c..db32b5009191 100644
--- a/svtools/source/control/headbar.cxx
+++ b/svtools/source/control/headbar.cxx
@@ -51,8 +51,8 @@ public:
#define HEADERBAR_DRAGOUTOFF 15
-#define HEAD_HITTEST_ITEM ((sal_uInt16)0x0001)
-#define HEAD_HITTEST_DIVIDER ((sal_uInt16)0x0002)
+#define HEAD_HITTEST_ITEM (sal_uInt16(0x0001))
+#define HEAD_HITTEST_DIVIDER (sal_uInt16(0x0002))
void HeaderBar::ImplInit( WinBits nWinStyle )
{
@@ -154,7 +154,7 @@ tools::Rectangle HeaderBar::ImplGetItemRect( sal_uInt16 nPos ) const
sal_uInt16 HeaderBar::ImplHitTest( const Point& rPos,
long& nMouseOff, sal_uInt16& nPos ) const
{
- size_t nCount = (sal_uInt16)mvItemList.size();
+ size_t nCount = static_cast<sal_uInt16>(mvItemList.size());
bool bLastFixed = true;
long nX = -mnOffset;
@@ -1169,7 +1169,7 @@ void HeaderBar::SetOffset( long nNewOffset )
sal_uInt16 HeaderBar::GetItemCount() const
{
- return (sal_uInt16)mvItemList.size();
+ return static_cast<sal_uInt16>(mvItemList.size());
}
sal_uInt16 HeaderBar::GetItemPos( sal_uInt16 nItemId ) const
@@ -1177,7 +1177,7 @@ sal_uInt16 HeaderBar::GetItemPos( sal_uInt16 nItemId ) const
for ( size_t i = 0, n = mvItemList.size(); i < n; ++i ) {
auto& pItem = mvItemList[ i ];
if ( pItem->mnId == nItemId )
- return (sal_uInt16)i;
+ return static_cast<sal_uInt16>(i);
}
return HEADERBAR_ITEM_NOTFOUND;
}
diff --git a/svtools/source/control/inettbc.cxx b/svtools/source/control/inettbc.cxx
index 5ddcf6f05806..b922c4905104 100644
--- a/svtools/source/control/inettbc.cxx
+++ b/svtools/source/control/inettbc.cxx
@@ -415,7 +415,7 @@ void SvtMatchContext_Impl::ReadFolder( const OUString& rURL,
sal_Unicode aDelimiter = '/';
if ( bSmart )
// when parsing is done "smart", the delimiter must be "guessed"
- aObj.getFSysPath( (FSysStyle)(FSysStyle::Detect & ~FSysStyle::Vos), &aDelimiter );
+ aObj.getFSysPath( static_cast<FSysStyle>(FSysStyle::Detect & ~FSysStyle::Vos), &aDelimiter );
if ( bIsFolder )
aObj.setFinalSlash();
@@ -791,7 +791,7 @@ void SvtURLBox::TryAutoComplete()
Selection aSelection( GetSelection() );
if( aSelection.Max() != aCurText.getLength() )
return;
- sal_uInt16 nLen = (sal_uInt16)aSelection.Min();
+ sal_uInt16 nLen = static_cast<sal_uInt16>(aSelection.Min());
aCurText = aCurText.copy( 0, nLen );
if( !aCurText.isEmpty() && bIsAutoCompleteEnabled )
{
@@ -1062,7 +1062,7 @@ bool SvtURLBox::PreNotify( NotifyEvent& rNEvt )
else if( ( aCode == KEY_UP || aCode == KEY_DOWN ) && !rKey.IsMod2() )
{
Selection aSelection( GetSelection() );
- sal_uInt16 nLen = (sal_uInt16)aSelection.Min();
+ sal_uInt16 nLen = static_cast<sal_uInt16>(aSelection.Min());
GetSubEdit()->KeyInput( rEvent );
SetSelection( Selection( nLen, GetText().getLength() ) );
return true;
diff --git a/svtools/source/control/roadmap.cxx b/svtools/source/control/roadmap.cxx
index 539f4ec2e46e..e53bf7b70799 100644
--- a/svtools/source/control/roadmap.cxx
+++ b/svtools/source/control/roadmap.cxx
@@ -328,7 +328,7 @@ void ORoadmap::SetRoadmapComplete(bool _bComplete)
void ORoadmap::UpdatefollowingHyperLabels(ItemIndex _nIndex)
{
const HL_Vector& rItems = m_pImpl->getHyperLabels();
- if ( _nIndex < (ItemIndex)rItems.size() )
+ if ( _nIndex < static_cast<ItemIndex>(rItems.size()) )
{
for ( HL_Vector::const_iterator i = rItems.begin() + _nIndex;
i != rItems.end();
@@ -450,7 +450,7 @@ const RoadmapItem* ORoadmap::GetByID(ItemId _nID) const
RoadmapItem* ORoadmap::GetByIndex(ItemIndex _nItemIndex)
{
const HL_Vector& rItems = m_pImpl->getHyperLabels();
- if ( ( _nItemIndex > -1 ) && ( _nItemIndex < (ItemIndex)rItems.size() ) )
+ if ( ( _nItemIndex > -1 ) && ( _nItemIndex < static_cast<ItemIndex>(rItems.size()) ) )
{
return rItems.at( _nItemIndex );
}
diff --git a/svtools/source/control/scrwin.cxx b/svtools/source/control/scrwin.cxx
index cf6b83fb624a..e105f0b5fb1a 100644
--- a/svtools/source/control/scrwin.cxx
+++ b/svtools/source/control/scrwin.cxx
@@ -336,8 +336,8 @@ void ScrollableWindow::Scroll( long nDeltaX, long nDeltaY, ScrollFlags )
Update();
// does the new area overlap the old one?
- if ( std::abs( (int)aDeltaPix.Height() ) < aOutPixSz.Height() ||
- std::abs( (int)aDeltaPix.Width() ) < aOutPixSz.Width() )
+ if ( std::abs( static_cast<int>(aDeltaPix.Height()) ) < aOutPixSz.Height() ||
+ std::abs( static_cast<int>(aDeltaPix.Width()) ) < aOutPixSz.Width() )
{
// scroll the overlapping area
SetMapMode( aMap );
diff --git a/svtools/source/control/toolbarmenu.cxx b/svtools/source/control/toolbarmenu.cxx
index 92cb4b88e83f..eb0c3dcc9b03 100644
--- a/svtools/source/control/toolbarmenu.cxx
+++ b/svtools/source/control/toolbarmenu.cxx
@@ -387,7 +387,7 @@ void ToolbarMenu_Impl::notifyHighlightedEntry()
ToolbarMenuEntry* ToolbarMenu_Impl::implGetEntry( int nEntry ) const
{
- if( (nEntry < 0) || (nEntry >= (int)maEntryVector.size() ) )
+ if( (nEntry < 0) || (nEntry >= static_cast<int>(maEntryVector.size()) ) )
return nullptr;
return maEntryVector[nEntry].get();
@@ -1005,7 +1005,7 @@ ToolbarMenuEntry* ToolbarMenu::implCursorUpDown( bool bUp, bool bHomeEnd )
}
else
{
- if( n < ((int)mpImpl->maEntryVector.size()-1) )
+ if( n < (static_cast<int>(mpImpl->maEntryVector.size())-1) )
n++;
else
if( mpImpl->mnHighlightedEntry == -1 )
diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx
index e57152021cbb..76a4dc89465e 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -666,7 +666,7 @@ void ValueSet::Format(vcl::RenderContext const & rRenderContext)
mxScrollBar->SetPosSizePixel(aPos, aSize);
mxScrollBar->SetRangeMax(mnLines);
mxScrollBar->SetVisibleSize(mnVisLines);
- mxScrollBar->SetThumbPos((long)mnFirstLine);
+ mxScrollBar->SetThumbPos(static_cast<long>(mnFirstLine));
long nPageSize = mnVisLines;
if (nPageSize < 1)
nPageSize = 1;
@@ -1065,7 +1065,7 @@ bool ValueSet::ImplHasAccessibleListeners()
IMPL_LINK( ValueSet,ImplScrollHdl, ScrollBar*, pScrollBar, void )
{
- sal_uInt16 nNewFirstLine = (sal_uInt16)pScrollBar->GetThumbPos();
+ sal_uInt16 nNewFirstLine = static_cast<sal_uInt16>(pScrollBar->GetThumbPos());
if ( nNewFirstLine != mnFirstLine )
{
mnFirstLine = nNewFirstLine;
@@ -1794,15 +1794,15 @@ void ValueSet::SelectItem( sal_uInt16 nItemId )
// if necessary scroll to the visible area
if (mbScroll && nItemId && mnCols)
{
- sal_uInt16 nNewLine = (sal_uInt16)(nItemPos / mnCols);
+ sal_uInt16 nNewLine = static_cast<sal_uInt16>(nItemPos / mnCols);
if ( nNewLine < mnFirstLine )
{
mnFirstLine = nNewLine;
bNewLine = true;
}
- else if ( nNewLine > (sal_uInt16)(mnFirstLine+mnVisLines-1) )
+ else if ( nNewLine > static_cast<sal_uInt16>(mnFirstLine+mnVisLines-1) )
{
- mnFirstLine = (sal_uInt16)(nNewLine-mnVisLines+1);
+ mnFirstLine = static_cast<sal_uInt16>(nNewLine-mnVisLines+1);
bNewLine = true;
}
}