diff options
-rw-r--r-- | dbaccess/source/ui/control/FieldDescControl.cxx | 6 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/dlgsave.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/misc/WCPage.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/ui/tabledesign/TEditControl.cxx | 8 | ||||
-rw-r--r-- | include/svtools/editbrowsebox.hxx | 8 | ||||
-rw-r--r-- | include/svtools/editimplementation.hxx | 6 | ||||
-rw-r--r-- | include/vcl/edit.hxx | 10 | ||||
-rw-r--r-- | include/vcl/vclmedit.hxx | 4 | ||||
-rw-r--r-- | svx/source/fmcomp/gridcell.cxx | 8 | ||||
-rw-r--r-- | svx/source/inc/gridcell.hxx | 6 | ||||
-rw-r--r-- | vcl/source/control/edit.cxx | 10 | ||||
-rw-r--r-- | vcl/source/edit/vclmedit.cxx | 23 |
12 files changed, 46 insertions, 49 deletions
diff --git a/dbaccess/source/ui/control/FieldDescControl.cxx b/dbaccess/source/ui/control/FieldDescControl.cxx index 40b2f4b612cd..9f761052c932 100644 --- a/dbaccess/source/ui/control/FieldDescControl.cxx +++ b/dbaccess/source/ui/control/FieldDescControl.cxx @@ -896,7 +896,7 @@ void OFieldDescControl::ActivateAggregate( EControlType eType ) return; m_nPos++; { - sal_uInt32 nMax = EDIT_NOLIMIT; + sal_Int32 nMax = EDIT_NOLIMIT; OUString aTmpString; try { @@ -907,7 +907,7 @@ void OFieldDescControl::ActivateAggregate( EControlType eType ) aTmpString = xMetaData->getExtraNameCharacters(); } } - catch(Exception&) + catch (const Exception&) { DBG_UNHANDLED_EXCEPTION(); } @@ -917,7 +917,7 @@ void OFieldDescControl::ActivateAggregate( EControlType eType ) STR_HELP_DEFAULT_VALUE, FIELD_PRPOERTY_COLUMNNAME, WB_BORDER ); - m_pColumnName->SetMaxTextLen(xub_StrLen( nMax ? nMax : EDIT_NOLIMIT)); + m_pColumnName->SetMaxTextLen(nMax ? nMax : EDIT_NOLIMIT); m_pColumnName->setCheck( isSQL92CheckEnabled(getConnection()) ); } diff --git a/dbaccess/source/ui/dlg/dlgsave.cxx b/dbaccess/source/ui/dlg/dlgsave.cxx index c7d63f7dbca3..ce21f4dda4f2 100644 --- a/dbaccess/source/ui/dlg/dlgsave.cxx +++ b/dbaccess/source/ui/dlg/dlgsave.cxx @@ -271,7 +271,7 @@ OSaveAsDlg::OSaveAsDlg( Window * pParent, m_pImpl->m_aPB_CANCEL.SetPosPixel(Point(m_pImpl->m_aPB_CANCEL.GetPosPixel().X(),aPos.Y())); m_pImpl->m_aPB_HELP.SetPosPixel(Point(m_pImpl->m_aPB_HELP.GetPosPixel().X(),aPos.Y())); - sal_uInt16 nLength = m_pImpl->m_xMetaData.is() ? static_cast<sal_uInt16>(m_pImpl->m_xMetaData->getMaxTableNameLength()) : 0; + sal_Int32 nLength = m_pImpl->m_xMetaData.is() ? m_pImpl->m_xMetaData->getMaxTableNameLength() : 0; nLength = nLength ? nLength : EDIT_NOLIMIT; m_pImpl->m_aTitle.SetMaxTextLen(nLength); diff --git a/dbaccess/source/ui/misc/WCPage.cxx b/dbaccess/source/ui/misc/WCPage.cxx index 67c4eb26b55f..ad6439f56833 100644 --- a/dbaccess/source/ui/misc/WCPage.cxx +++ b/dbaccess/source/ui/misc/WCPage.cxx @@ -71,7 +71,7 @@ OCopyTable::OCopyTable( Window * pParent ) { DBG_CTOR(OCopyTable,NULL); - m_edTableName.SetMaxTextLen( EDIT_NOLIMIT ); + m_edTableName.SetMaxTextLen(EDIT_NOLIMIT); if ( m_pParent->m_xDestConnection.is() ) { @@ -98,7 +98,7 @@ OCopyTable::OCopyTable( Window * pParent ) m_edKeyName.SetText(sKeyName); sal_Int32 nMaxLen = m_pParent->getMaxColumnNameLength(); - m_edKeyName.SetMaxTextLen(nMaxLen ? (xub_StrLen)nMaxLen : EDIT_NOLIMIT); + m_edKeyName.SetMaxTextLen(nMaxLen ? nMaxLen : EDIT_NOLIMIT); } FreeResource(); diff --git a/dbaccess/source/ui/tabledesign/TEditControl.cxx b/dbaccess/source/ui/tabledesign/TEditControl.cxx index 6156cd366c56..820ba0f279d0 100644 --- a/dbaccess/source/ui/tabledesign/TEditControl.cxx +++ b/dbaccess/source/ui/tabledesign/TEditControl.cxx @@ -219,7 +219,7 @@ void OTableEditorCtrl::InitCellController() { DBG_CHKTHIS(OTableEditorCtrl,NULL); // Cell Field name - xub_StrLen nMaxTextLen = EDIT_NOLIMIT; + sal_Int32 nMaxTextLen = EDIT_NOLIMIT; OUString sExtraNameChars; Reference<XConnection> xCon; try @@ -227,7 +227,7 @@ void OTableEditorCtrl::InitCellController() xCon = GetView()->getController().getConnection(); Reference< XDatabaseMetaData> xMetaData = xCon.is() ? xCon->getMetaData() : Reference< XDatabaseMetaData>(); - nMaxTextLen = ((xub_StrLen)xMetaData.is() ? static_cast<xub_StrLen>(xMetaData->getMaxColumnNameLength()) : 0); + nMaxTextLen = xMetaData.is() ? xMetaData->getMaxColumnNameLength() : 0; if( nMaxTextLen == 0 ) nMaxTextLen = EDIT_NOLIMIT; @@ -312,7 +312,7 @@ sal_Bool OTableEditorCtrl::SetDataPtr( long nRow ) if(nRow == -1) return sal_False; - OSL_ENSURE((xub_StrLen)nRow < m_pRowList->size(),"Row is greater than size!"); + OSL_ENSURE(nRow < (long)m_pRowList->size(),"Row is greater than size!"); if(nRow >= (long)m_pRowList->size()) return sal_False; pActRow = (*m_pRowList)[nRow]; @@ -806,7 +806,7 @@ OUString OTableEditorCtrl::GenerateName( const OUString& rName ) Reference<XConnection> xCon = GetView()->getController().getConnection(); Reference< XDatabaseMetaData> xMetaData = xCon.is() ? xCon->getMetaData() : Reference< XDatabaseMetaData>(); - xub_StrLen nMaxTextLen((xub_StrLen)( xMetaData.is() ? xMetaData->getMaxColumnNameLength() : 0)); + sal_Int32 nMaxTextLen(xMetaData.is() ? xMetaData->getMaxColumnNameLength() : 0); if( (rName.getLength()+2) >nMaxTextLen ) aBaseName = rName.copy( 0, nMaxTextLen-2 ); diff --git a/include/svtools/editbrowsebox.hxx b/include/svtools/editbrowsebox.hxx index 93d0c5926b40..517d61caf053 100644 --- a/include/svtools/editbrowsebox.hxx +++ b/include/svtools/editbrowsebox.hxx @@ -134,8 +134,8 @@ namespace svt virtual sal_Bool IsReadOnly() const = 0; virtual void SetReadOnly( sal_Bool bReadOnly ) = 0; - virtual xub_StrLen GetMaxTextLen() const = 0; - virtual void SetMaxTextLen( xub_StrLen _nMaxLen ) = 0; + virtual sal_Int32 GetMaxTextLen() const = 0; + virtual void SetMaxTextLen( sal_Int32 _nMaxLen ) = 0; virtual Selection GetSelection() const = 0; virtual void SetSelection( const Selection& _rSelection ) = 0; @@ -170,8 +170,8 @@ namespace svt virtual sal_Bool IsReadOnly() const; virtual void SetReadOnly( sal_Bool bReadOnly ); - virtual xub_StrLen GetMaxTextLen() const; - virtual void SetMaxTextLen( xub_StrLen _nMaxLen ); + virtual sal_Int32 GetMaxTextLen() const; + virtual void SetMaxTextLen( sal_Int32 _nMaxLen ); virtual Selection GetSelection() const; virtual void SetSelection( const Selection& _rSelection ); diff --git a/include/svtools/editimplementation.hxx b/include/svtools/editimplementation.hxx index 19fb48fabdec..c6de2b783113 100644 --- a/include/svtools/editimplementation.hxx +++ b/include/svtools/editimplementation.hxx @@ -101,16 +101,16 @@ OUString GenericEditImplementation< EDIT >::GetSelected( LineEnd ) const //---------------------------------------------------------------------- template <class EDIT> -void GenericEditImplementation< EDIT >::SetMaxTextLen( xub_StrLen _nMaxLen ) +void GenericEditImplementation< EDIT >::SetMaxTextLen( sal_Int32 _nMaxLen ) { m_rEdit.SetMaxTextLen( _nMaxLen ); } //---------------------------------------------------------------------- template <class EDIT> -xub_StrLen GenericEditImplementation< EDIT >::GetMaxTextLen() const +sal_Int32 GenericEditImplementation< EDIT >::GetMaxTextLen() const { - return (xub_StrLen)m_rEdit.GetMaxTextLen( ); + return m_rEdit.GetMaxTextLen( ); } //---------------------------------------------------------------------- diff --git a/include/vcl/edit.hxx b/include/vcl/edit.hxx index 23fce469f155..6df07147f46e 100644 --- a/include/vcl/edit.hxx +++ b/include/vcl/edit.hxx @@ -44,7 +44,7 @@ struct Impl_IMEInfos; // - Edit-Types - // -------------- -#define EDIT_NOLIMIT STRING_LEN +#define EDIT_NOLIMIT SAL_MAX_INT32 #define EDIT_UPDATEDATA_TIMEOUT 350 typedef OUString (*FncGetSpecialChars)( Window* pWin, const Font& rFont ); @@ -70,7 +70,7 @@ private: long mnXOffset; Selection maSelection; sal_uInt16 mnAlign; - xub_StrLen mnMaxTextLen; + sal_Int32 mnMaxTextLen; sal_Int32 mnWidthInChars; sal_Int32 mnMaxWidthChars; AutocompleteAction meAutocompleteAction; @@ -89,7 +89,7 @@ private: DECL_DLLPRIVATE_LINK( ImplUpdateDataHdl, void* ); - SAL_DLLPRIVATE bool ImplTruncateToMaxLen( OUString&, sal_uInt32 nSelectionLen ) const; + SAL_DLLPRIVATE bool ImplTruncateToMaxLen( OUString&, sal_Int32 nSelectionLen ) const; SAL_DLLPRIVATE void ImplInitEditData(); SAL_DLLPRIVATE void ImplModified(); SAL_DLLPRIVATE OUString ImplGetText() const; @@ -189,8 +189,8 @@ public: void SetInsertMode( sal_Bool bInsert ); sal_Bool IsInsertMode() const; - virtual void SetMaxTextLen( xub_StrLen nMaxLen = EDIT_NOLIMIT ); - virtual xub_StrLen GetMaxTextLen() const { return mnMaxTextLen; } + virtual void SetMaxTextLen( sal_Int32 nMaxLen = EDIT_NOLIMIT ); + virtual sal_Int32 GetMaxTextLen() const { return mnMaxTextLen; } void SetWidthInChars(sal_Int32 nWidthInChars); sal_Int32 GetWidthInChars() const { return mnWidthInChars; } diff --git a/include/vcl/vclmedit.hxx b/include/vcl/vclmedit.hxx index 36a1f69da328..ce567e9b1fb3 100644 --- a/include/vcl/vclmedit.hxx +++ b/include/vcl/vclmedit.hxx @@ -79,8 +79,8 @@ public: void EnableFocusSelectionHide( sal_Bool bHide ); - virtual void SetMaxTextLen( xub_StrLen nMaxLen = 0 ); - virtual xub_StrLen GetMaxTextLen() const; + virtual void SetMaxTextLen(sal_Int32 nMaxLen = 0); + virtual sal_Int32 GetMaxTextLen() const; void SetMaxTextWidth( sal_uLong nMaxWidth ); diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx index b47d510cf548..72b77c59fca6 100644 --- a/svx/source/fmcomp/gridcell.cxx +++ b/svx/source/fmcomp/gridcell.cxx @@ -1067,7 +1067,7 @@ void DbLimitedLengthField::implAdjustGenericFieldSetting( const Reference< XProp } //------------------------------------------------------------------------------ -void DbLimitedLengthField::implSetEffectiveMaxTextLen( sal_Int16 _nMaxLen ) +void DbLimitedLengthField::implSetEffectiveMaxTextLen( sal_Int32 _nMaxLen ) { dynamic_cast< Edit* >( m_pWindow )->SetMaxTextLen( _nMaxLen ); if ( m_pPainter ) @@ -1212,7 +1212,7 @@ void DbTextField::updateFromModel( Reference< XPropertySet > _rxModel ) OUString sText; _rxModel->getPropertyValue( FM_PROP_TEXT ) >>= sText; - xub_StrLen nMaxTextLen = m_pEdit->GetMaxTextLen(); + sal_Int32 nMaxTextLen = m_pEdit->GetMaxTextLen(); if ( EDIT_NOLIMIT != nMaxTextLen && sText.getLength() > nMaxTextLen ) { sal_Int32 nDiff = sText.getLength() - nMaxTextLen; @@ -1229,7 +1229,7 @@ sal_Bool DbTextField::commitControl() { OUString aText( m_pEdit->GetText( getModelLineEndSetting( m_rColumn.getModel() ) ) ); // we have to check if the length before we can decide if the value was modified - xub_StrLen nMaxTextLen = m_pEdit->GetMaxTextLen(); + sal_Int32 nMaxTextLen = m_pEdit->GetMaxTextLen(); if ( EDIT_NOLIMIT != nMaxTextLen ) { OUString sOldValue; @@ -1243,7 +1243,7 @@ sal_Bool DbTextField::commitControl() } //------------------------------------------------------------------------------ -void DbTextField::implSetEffectiveMaxTextLen( sal_Int16 _nMaxLen ) +void DbTextField::implSetEffectiveMaxTextLen( sal_Int32 _nMaxLen ) { if ( m_pEdit ) m_pEdit->SetMaxTextLen( _nMaxLen ); diff --git a/svx/source/inc/gridcell.hxx b/svx/source/inc/gridcell.hxx index e8eed6f11a4b..df3d10d11ecf 100644 --- a/svx/source/inc/gridcell.hxx +++ b/svx/source/inc/gridcell.hxx @@ -381,11 +381,11 @@ protected: virtual void implAdjustGenericFieldSetting( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxModel ); protected: - inline void implSetMaxTextLen( sal_Int16 _nMaxLen ) + void implSetMaxTextLen( sal_Int16 _nMaxLen ) { implSetEffectiveMaxTextLen( _nMaxLen ? _nMaxLen : EDIT_NOLIMIT ); } - virtual void implSetEffectiveMaxTextLen( sal_Int16 _nMaxLen ); + virtual void implSetEffectiveMaxTextLen( sal_Int32 _nMaxLen ); }; //================================================================== @@ -419,7 +419,7 @@ protected: virtual sal_Bool commitControl( ); virtual void updateFromModel( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > _rxModel ); // DbLimitedLengthField - virtual void implSetEffectiveMaxTextLen( sal_Int16 _nMaxLen ); + virtual void implSetEffectiveMaxTextLen( sal_Int32 _nMaxLen ); }; //================================================================== diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index 85022c9a4d1e..460244e75585 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -867,14 +867,12 @@ void Edit::ShowTruncationWarning( Window* pParent ) // ----------------------------------------------------------------------- -bool Edit::ImplTruncateToMaxLen( OUString& rStr, sal_uInt32 nSelectionLen ) const +bool Edit::ImplTruncateToMaxLen( OUString& rStr, sal_Int32 nSelectionLen ) const { bool bWasTruncated = false; - const sal_uInt32 nMaxLen = mnMaxTextLen < 65534 ? mnMaxTextLen : 65534; - sal_uInt32 nLenAfter = static_cast<sal_uInt32>(maText.getLength()) + rStr.getLength() - nSelectionLen; - if ( nLenAfter > nMaxLen ) + if (maText.getLength() - nSelectionLen > mnMaxTextLen - rStr.getLength()) { - sal_uInt32 nErasePos = nMaxLen - static_cast<sal_uInt32>(maText.getLength()) + nSelectionLen; + sal_Int32 nErasePos = mnMaxTextLen - maText.getLength() + nSelectionLen; rStr = rStr.copy( 0, nErasePos ); bWasTruncated = true; } @@ -2594,7 +2592,7 @@ sal_Bool Edit::IsInsertMode() const // ----------------------------------------------------------------------- -void Edit::SetMaxTextLen( xub_StrLen nMaxLen ) +void Edit::SetMaxTextLen(sal_Int32 nMaxLen) { mnMaxTextLen = nMaxLen ? nMaxLen : EDIT_NOLIMIT; diff --git a/vcl/source/edit/vclmedit.cxx b/vcl/source/edit/vclmedit.cxx index 340d8fe218a9..2f4c7556cfc2 100644 --- a/vcl/source/edit/vclmedit.cxx +++ b/vcl/source/edit/vclmedit.cxx @@ -112,8 +112,8 @@ public: void SetReadOnly( sal_Bool bRdOnly ); sal_Bool IsReadOnly() const; - void SetMaxTextLen( xub_StrLen nLen ); - xub_StrLen GetMaxTextLen() const; + void SetMaxTextLen(sal_Int32 nLen); + sal_Int32 GetMaxTextLen() const; void SetMaxTextWidth( sal_uLong nMaxWidth ); @@ -376,15 +376,14 @@ sal_Bool ImpVclMEdit::IsReadOnly() const return mpTextWindow->GetTextView()->IsReadOnly(); } -void ImpVclMEdit::SetMaxTextLen( xub_StrLen nLen ) +void ImpVclMEdit::SetMaxTextLen(sal_Int32 nLen) { - mpTextWindow->GetTextEngine()->SetMaxTextLen( nLen ); + mpTextWindow->GetTextEngine()->SetMaxTextLen(nLen); } -xub_StrLen ImpVclMEdit::GetMaxTextLen() const +sal_Int32 ImpVclMEdit::GetMaxTextLen() const { - return sal::static_int_cast< xub_StrLen >( - mpTextWindow->GetTextEngine()->GetMaxTextLen()); + return mpTextWindow->GetTextEngine()->GetMaxTextLen(); } void ImpVclMEdit::InsertText( const OUString& rStr ) @@ -718,7 +717,7 @@ TextWindow::TextWindow( Window* pParent ) : Window( pParent ) SetPointer( Pointer( POINTER_TEXT ) ); mpExtTextEngine = new ExtTextEngine; - mpExtTextEngine->SetMaxTextLen( STRING_MAXLEN ); + mpExtTextEngine->SetMaxTextLen(EDIT_NOLIMIT); if( pParent->GetStyle() & WB_BORDER ) mpExtTextEngine->SetLeftMargin( 2 ); mpExtTextEngine->SetLocale( GetSettings().GetLanguageTag().getLocale() ); @@ -949,7 +948,7 @@ VclMultiLineEdit::VclMultiLineEdit( Window* pParent, const ResId& rResId ) ImplInitSettings( sal_True, sal_True, sal_True ); pUpdateDataTimer = 0; - sal_uInt16 nMaxLen = Edit::GetMaxTextLen(); + sal_Int32 nMaxLen = Edit::GetMaxTextLen(); if ( nMaxLen ) SetMaxTextLen( nMaxLen ); @@ -1114,9 +1113,9 @@ sal_Bool VclMultiLineEdit::IsReadOnly() const return pImpVclMEdit->IsReadOnly(); } -void VclMultiLineEdit::SetMaxTextLen( xub_StrLen nMaxLen ) +void VclMultiLineEdit::SetMaxTextLen(sal_Int32 nMaxLen) { - pImpVclMEdit->SetMaxTextLen( nMaxLen ); + pImpVclMEdit->SetMaxTextLen(nMaxLen); } void VclMultiLineEdit::SetMaxTextWidth( sal_uLong nMaxWidth ) @@ -1124,7 +1123,7 @@ void VclMultiLineEdit::SetMaxTextWidth( sal_uLong nMaxWidth ) pImpVclMEdit->SetMaxTextWidth(nMaxWidth ); } -xub_StrLen VclMultiLineEdit::GetMaxTextLen() const +sal_Int32 VclMultiLineEdit::GetMaxTextLen() const { return pImpVclMEdit->GetMaxTextLen(); } |