longparas: convert GetMaxVisChars from xub_StrLen to sal_Int32

Change-Id: I25fcfc3ae5a599bbd7ebef3071895ec9dbf2949e
This commit is contained in:
Caolán McNamara 2014-01-11 16:42:32 +00:00
parent beaa383389
commit f8f18871b0
3 changed files with 6 additions and 6 deletions

View File

@ -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;

View File

@ -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 )

View File

@ -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;
}
// -----------------------------------------------------------------------