diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-01-26 09:50:06 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-04-03 10:37:51 +0200 |
commit | 8bc951daf79decbd8a599a409c6d33c5456710e0 (patch) | |
tree | 61d220d83e90a176fbcbe667827eee4b9631a4ca /vcl/source/control | |
parent | 10eefdfa6c0250c6069e641e404f34e5a91fe993 (diff) |
long->sal_Int32 in tools/gen.hxx
which triggered a lot of changes in sw/
Change-Id: Ia2aa22ea3f76463a85ea077a411246fcfed00bf6
Reviewed-on: https://gerrit.libreoffice.org/48806
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/source/control')
-rw-r--r-- | vcl/source/control/button.cxx | 2 | ||||
-rw-r--r-- | vcl/source/control/combobox.cxx | 4 | ||||
-rw-r--r-- | vcl/source/control/edit.cxx | 12 | ||||
-rw-r--r-- | vcl/source/control/field.cxx | 2 | ||||
-rw-r--r-- | vcl/source/control/field2.cxx | 18 | ||||
-rw-r--r-- | vcl/source/control/fixed.cxx | 2 | ||||
-rw-r--r-- | vcl/source/control/imp_listbox.cxx | 6 | ||||
-rw-r--r-- | vcl/source/control/listbox.cxx | 2 | ||||
-rw-r--r-- | vcl/source/control/notebookbar.cxx | 4 | ||||
-rw-r--r-- | vcl/source/control/tabctrl.cxx | 8 |
10 files changed, 30 insertions, 30 deletions
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index 35400b70ed8a..7c3238979e7d 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -1639,7 +1639,7 @@ Size PushButton::CalcMinimumSize() const Size textSize = GetTextRect( tools::Rectangle( Point(), Size( 0x7fffffff, 0x7fffffff ) ), PushButton::GetText(), ImplGetTextStyle( DrawFlags::NONE ) ).GetSize(); aSize.AdjustWidth(textSize.Width() ); - aSize.setHeight( std::max( aSize.Height(), long( textSize.Height() * 1.15 ) ) ); + aSize.setHeight( std::max<sal_Int32>( aSize.Height(), sal_Int32( textSize.Height() * 1.15 ) ) ); } // cf. ImplDrawPushButton ... diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx index 7b14c8da64c2..abb0a5e0c677 100644 --- a/vcl/source/control/combobox.cxx +++ b/vcl/source/control/combobox.cxx @@ -311,7 +311,7 @@ IMPL_LINK(ComboBox::Impl, ImplAutocompleteHdl, Edit&, rEdit, void) { OUString aFullText = rEdit.GetText(); - OUString aStartText = aFullText.copy( 0, static_cast<sal_Int32>(aSel.Max()) ); + OUString aStartText = aFullText.copy( 0, aSel.Max() ); sal_Int32 nStart = m_pImplLB->GetCurrentPos(); if ( nStart == LISTBOX_ENTRY_NOTFOUND ) @@ -1039,7 +1039,7 @@ Size ComboBox::CalcMinimumSize() const if (m_pImpl->m_nMaxWidthChars != -1) { long nMaxWidth = m_pImpl->m_nMaxWidthChars * approximate_char_width(); - aSz.setWidth( std::min(aSz.Width(), nMaxWidth) ); + aSz.setWidth( std::min<sal_Int32>(aSz.Width(), nMaxWidth) ); } if (IsDropDownBox()) diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index 42dd22296585..e6c8e07bb824 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -743,7 +743,7 @@ void Edit::ImplDelete( const Selection& rSelection, sal_uInt8 nDirection, sal_uI } } - maText.remove( static_cast<sal_Int32>(aSelection.Min()), static_cast<sal_Int32>(aSelection.Len()) ); + maText.remove( aSelection.Min(), aSelection.Len() ); maSelection.Min() = aSelection.Min(); maSelection.Max() = aSelection.Min(); ImplAlignAndPaint(); @@ -807,9 +807,9 @@ void Edit::ImplInsertText( const OUString& rStr, const Selection* pNewSel, bool ImplClearLayoutData(); if ( aSelection.Len() ) - maText.remove( static_cast<sal_Int32>(aSelection.Min()), static_cast<sal_Int32>(aSelection.Len()) ); + maText.remove( aSelection.Min(), aSelection.Len() ); else if ( !mbInsertMode && (aSelection.Max() < maText.getLength()) ) - maText.remove( static_cast<sal_Int32>(aSelection.Max()), 1 ); + maText.remove( aSelection.Max(), 1 ); // take care of input-sequence-checking now if (bIsUserInput && !rStr.isEmpty()) @@ -829,7 +829,7 @@ void Edit::ImplInsertText( const OUString& rStr, const Selection* pNewSel, bool if (bIsInputSequenceChecking && (xISC = ImplGetInputSequenceChecker()).is()) { sal_Unicode cChar = rStr[0]; - sal_Int32 nTmpPos = static_cast< sal_Int32 >( aSelection.Min() ); + sal_Int32 nTmpPos = aSelection.Min(); sal_Int16 nCheckMode = officecfg::Office::Common::I18N::CTL::CTLSequenceCheckingRestricted::get()? i18n::InputSequenceCheckMode::STRICT : i18n::InputSequenceCheckMode::BASIC; @@ -876,7 +876,7 @@ void Edit::ImplInsertText( const OUString& rStr, const Selection* pNewSel, bool } if ( !aNewText.isEmpty() ) - maText.insert( static_cast<sal_Int32>(aSelection.Min()), aNewText ); + maText.insert( aSelection.Min(), aNewText ); if ( !pNewSel ) { @@ -2036,7 +2036,7 @@ void Edit::Command( const CommandEvent& rCEvt ) { DeleteSelected(); delete mpIMEInfos; - sal_Int32 nPos = static_cast<sal_Int32>(maSelection.Max()); + sal_Int32 nPos = maSelection.Max(); mpIMEInfos = new Impl_IMEInfos( nPos, OUString(maText.getStr() + nPos ) ); mpIMEInfos->bWasCursorOverwrite = !IsInsertMode(); } diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx index a59557dcbb9b..13fe3a348a96 100644 --- a/vcl/source/control/field.cxx +++ b/vcl/source/control/field.cxx @@ -713,7 +713,7 @@ void NumericFormatter::ImplNewFieldValue( sal_Int64 nNewValue ) aSelection.Justify(); OUString aText = GetField()->GetText(); // leave it as is if selected until end - if ( static_cast<sal_Int32>(aSelection.Max()) == aText.getLength() ) + if ( aSelection.Max() == aText.getLength() ) { if ( !aSelection.Len() ) aSelection.Min() = SELECTION_MAX; diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx index e438fb0a7efa..e05960b660f0 100644 --- a/vcl/source/control/field2.cxx +++ b/vcl/source/control/field2.cxx @@ -467,7 +467,7 @@ static bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt, sal_Unicode cChar = rKEvt.GetCharCode(); sal_uInt16 nKeyCode = aCode.GetCode(); bool bShift = aCode.IsShift(); - sal_Int32 nCursorPos = static_cast<sal_Int32>(aOldSel.Max()); + sal_Int32 nCursorPos = aOldSel.Max(); sal_Int32 nNewPos; sal_Int32 nTempPos; @@ -524,7 +524,7 @@ static bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt, // all was selected by the focus Selection aSel( aOldSel ); aSel.Justify(); - nCursorPos = static_cast<sal_Int32>(aSel.Min()); + nCursorPos = aSel.Min(); ImplPatternMaxPos( pEdit->GetText(), rEditMask, nFormatFlags, bSameMask, nCursorPos, nNewPos ); aSel.Max() = nNewPos; if ( bShift ) @@ -541,16 +541,16 @@ static bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt, Selection aSel = aOldSel; aSel.Justify(); - nNewPos = static_cast<sal_Int32>(aSel.Min()); + nNewPos = aSel.Min(); // if selection then delete it if ( aSel.Len() ) { if ( bSameMask ) - aStr.remove( static_cast<sal_Int32>(aSel.Min()), static_cast<sal_Int32>(aSel.Len()) ); + aStr.remove( aSel.Min(), aSel.Len() ); else { - OUString aRep = rLiteralMask.copy( static_cast<sal_Int32>(aSel.Min()), static_cast<sal_Int32>(aSel.Len()) ); + OUString aRep = rLiteralMask.copy( aSel.Min(), aSel.Len() ); aStr.remove( aSel.Min(), aRep.getLength() ); aStr.insert( aSel.Min(), aRep ); } @@ -1324,7 +1324,7 @@ void DateField::ImplDateSpinArea( bool bUp ) Selection aSelection = GetField()->GetSelection(); aSelection.Justify(); OUString aText( GetText() ); - if ( static_cast<sal_Int32>(aSelection.Len()) == aText.getLength() ) + if ( aSelection.Len() == aText.getLength() ) ImplDateIncrementDay( aDate, bUp ); else { @@ -1344,7 +1344,7 @@ void DateField::ImplDateSpinArea( bool bUp ) for ( sal_Int8 i = 1; i <= 3; i++ ) { nPos = aText.indexOf( aDateSep, nPos ); - if (nPos < 0 || nPos >= static_cast<sal_Int32>(aSelection.Max())) + if (nPos < 0 || nPos >= aSelection.Max()) { nDateArea = i; break; @@ -1585,7 +1585,7 @@ void DateFormatter::ImplNewFieldValue( const Date& rDate ) OUString aText = GetField()->GetText(); // If selected until the end then keep it that way - if ( static_cast<sal_Int32>(aSelection.Max()) == aText.getLength() ) + if ( aSelection.Max() == aText.getLength() ) { if ( !aSelection.Len() ) aSelection.Min() = SELECTION_MAX; @@ -2364,7 +2364,7 @@ void TimeFormatter::ImplNewFieldValue( const tools::Time& rTime ) OUString aText = GetField()->GetText(); // If selected until the end then keep it that way - if ( static_cast<sal_Int32>(aSelection.Max()) == aText.getLength() ) + if ( aSelection.Max() == aText.getLength() ) { if ( !aSelection.Len() ) aSelection.Min() = SELECTION_MAX; diff --git a/vcl/source/control/fixed.cxx b/vcl/source/control/fixed.cxx index f998285abc1a..f82d1dc992f5 100644 --- a/vcl/source/control/fixed.cxx +++ b/vcl/source/control/fixed.cxx @@ -316,7 +316,7 @@ Size FixedText::getTextDimensions(Control const *pControl, const OUString &rTxt, if ( !( pControl->GetStyle() & WB_NOLABEL ) ) nStyle |= DrawTextFlags::Mnemonic; - return pControl->GetTextRect(tools::Rectangle( Point(), Size(nMaxWidth, 0x7fffffff)), + return pControl->GetTextRect(tools::Rectangle( Point(), Size(nMaxWidth, RECT_MAX)), rTxt, nStyle).GetSize(); } diff --git a/vcl/source/control/imp_listbox.cxx b/vcl/source/control/imp_listbox.cxx index 171b75afd151..6f510684b866 100644 --- a/vcl/source/control/imp_listbox.cxx +++ b/vcl/source/control/imp_listbox.cxx @@ -661,10 +661,10 @@ void ImplListBoxWindow::ImplUpdateEntryMetrics( ImplEntryType& rEntry ) } if ( IsUserDrawEnabled() || aMetrics.bImage ) { - aMetrics.nEntryWidth = std::max( aMetrics.nImgWidth, maUserItemSize.Width() ); + aMetrics.nEntryWidth = std::max<sal_Int32>( aMetrics.nImgWidth, maUserItemSize.Width() ); if ( aMetrics.bText ) aMetrics.nEntryWidth += aMetrics.nTextWidth + IMG_TXT_DISTANCE; - aMetrics.nEntryHeight = std::max( std::max( mnMaxImgHeight, maUserItemSize.Height() ) + 2, + aMetrics.nEntryHeight = std::max<sal_Int32>( std::max<sal_Int32>( mnMaxImgHeight, maUserItemSize.Height() ) + 2, aMetrics.nEntryHeight ); } @@ -1802,7 +1802,7 @@ void ImplListBoxWindow::DrawEntry(vcl::RenderContext& rRenderContext, sal_Int32 if (!bDrawTextAtImagePos && (mpEntryList->HasEntryImage(nPos) || IsUserDrawEnabled())) { - long nImageWidth = std::max(mnMaxImgWidth, maUserItemSize.Width()); + sal_Int32 nImageWidth = std::max<sal_Int32>(mnMaxImgWidth, maUserItemSize.Width()); aTextRect.AdjustLeft(nImageWidth + IMG_TXT_DISTANCE ); } diff --git a/vcl/source/control/listbox.cxx b/vcl/source/control/listbox.cxx index ef945a087659..17d1c9c8cefc 100644 --- a/vcl/source/control/listbox.cxx +++ b/vcl/source/control/listbox.cxx @@ -1230,7 +1230,7 @@ Size ListBox::CalcSubEditSize() const if (m_nMaxWidthChars != -1) { long nMaxWidth = m_nMaxWidthChars * approximate_char_width(); - aSz.setWidth( std::min(aSz.Width(), nMaxWidth) ); + aSz.setWidth( std::min<sal_Int32>(aSz.Width(), nMaxWidth) ); } // Do not create ultrathin ListBoxes, it doesn't look good diff --git a/vcl/source/control/notebookbar.cxx b/vcl/source/control/notebookbar.cxx index 54931df82557..370891802b9f 100644 --- a/vcl/source/control/notebookbar.cxx +++ b/vcl/source/control/notebookbar.cxx @@ -112,9 +112,9 @@ void NotebookBar::setPosSizePixel(long nX, long nY, long nWidth, long nHeight, P Size aSize(GetOptimalSize()); if (!bCanHandleSmallerWidth) - nWidth = std::max(nWidth, aSize.Width()); + nWidth = std::max<sal_Int32>(nWidth, aSize.Width()); if (!bCanHandleSmallerHeight) - nHeight = std::max(nHeight, aSize.Height()); + nHeight = std::max<sal_Int32>(nHeight, aSize.Height()); Control::setPosSizePixel(nX, nY, nWidth, nHeight, nFlags); diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx index a4f06757c2ea..a1bcc29273c6 100644 --- a/vcl/source/control/tabctrl.cxx +++ b/vcl/source/control/tabctrl.cxx @@ -2142,7 +2142,7 @@ Size TabControl::calculateRequisition() const { TabControl* pThis = const_cast<TabControl*>(this); - tools::Rectangle aTabRect = pThis->ImplGetTabRect(nPos, aOptimalPageSize.Width(), LONG_MAX); + tools::Rectangle aTabRect = pThis->ImplGetTabRect(nPos, aOptimalPageSize.Width(), RECT_MAX); if (aTabRect.Bottom() > nTabLabelsBottom) nTabLabelsBottom = aTabRect.Bottom(); if (aTabRect.Right() > nTabLabelsRight) @@ -2151,7 +2151,7 @@ Size TabControl::calculateRequisition() const Size aOptimalSize(aOptimalPageSize); aOptimalSize.AdjustHeight(nTabLabelsBottom ); - aOptimalSize.setWidth( std::max(nTabLabelsRight, aOptimalSize.Width()) ); + aOptimalSize.setWidth( std::max<sal_Int32>(nTabLabelsRight, aOptimalSize.Width()) ); aOptimalSize.AdjustWidth(TAB_OFFSET * 2 ); aOptimalSize.AdjustHeight(TAB_OFFSET * 2 ); @@ -2671,7 +2671,7 @@ Size NotebookbarTabControlBase::calculateRequisition() const { NotebookbarTabControlBase* pThis = const_cast<NotebookbarTabControlBase*>(this); - tools::Rectangle aTabRect = pThis->ImplGetTabRect(nPos, aOptimalPageSize.Width(), LONG_MAX); + tools::Rectangle aTabRect = pThis->ImplGetTabRect(nPos, aOptimalPageSize.Width(), RECT_MAX); if (aTabRect.Bottom() > nTabLabelsBottom) { nTabLabelsBottom = aTabRect.Bottom(); @@ -2683,7 +2683,7 @@ Size NotebookbarTabControlBase::calculateRequisition() const Size aOptimalSize(aOptimalPageSize); aOptimalSize.AdjustHeight(nTabLabelsBottom ); - aOptimalSize.setWidth( std::max(nTabLabelsRight, aOptimalSize.Width()) ); + aOptimalSize.setWidth( std::max<sal_Int32>(nTabLabelsRight, aOptimalSize.Width()) ); aOptimalSize.AdjustWidth(TAB_OFFSET * 2 ); aOptimalSize.AdjustHeight(TAB_OFFSET * 2 ); |