diff --git a/include/vcl/edit.hxx b/include/vcl/edit.hxx index a5f77577139a..23fce469f155 100644 --- a/include/vcl/edit.hxx +++ b/include/vcl/edit.hxx @@ -234,7 +234,7 @@ public: virtual Size CalcMinimumSizeForText(const OUString &rString) const; virtual Size GetOptimalSize() const; virtual Size CalcSize( sal_uInt16 nChars ) const; - virtual xub_StrLen GetMaxVisChars() const; + virtual sal_Int32 GetMaxVisChars() const; sal_Int32 GetCharPos( const Point& rWindowPos ) const; diff --git a/svtools/source/uno/unoiface.cxx b/svtools/source/uno/unoiface.cxx index d8c3721cefcf..6675253e2035 100644 --- a/svtools/source/uno/unoiface.cxx +++ b/svtools/source/uno/unoiface.cxx @@ -788,7 +788,7 @@ void VCLXFileControl::getColumnsAndLines( sal_Int16& nCols, sal_Int16& nLines ) nLines = 1; FileControl* pControl = (FileControl*) GetWindow(); if ( pControl ) - nCols = (sal_Int16) pControl->GetEdit().GetMaxVisChars(); + nCols = pControl->GetEdit().GetMaxVisChars(); } void VCLXFileControl::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds ) diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index dee721f0893b..85022c9a4d1e 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -2957,12 +2957,12 @@ Size Edit::CalcSize( xub_StrLen nChars ) const // ----------------------------------------------------------------------- -xub_StrLen Edit::GetMaxVisChars() const +sal_Int32 Edit::GetMaxVisChars() const { const Window* pW = mpSubEdit ? mpSubEdit : this; - long nOutWidth = pW->GetOutputSizePixel().Width(); - long nCharWidth = GetTextWidth( OUString('x') ); - return nCharWidth ? (xub_StrLen)(nOutWidth/nCharWidth) : 0; + sal_Int32 nOutWidth = pW->GetOutputSizePixel().Width(); + sal_Int32 nCharWidth = GetTextWidth( OUString('x') ); + return nCharWidth ? nOutWidth/nCharWidth : 0; } // -----------------------------------------------------------------------