diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-06-12 13:40:45 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-06-13 11:20:23 +0100 |
commit | 6191fa0847ac5b27083efe1a8c6cd84d080a638c (patch) | |
tree | b107ce00125d0d204e5c32f6c472e70c73182bb2 /svtools/source/edit | |
parent | 2e16eaf31c7a4849110020aebd5fbc97a1ab3e99 (diff) |
reduce use of UniString ctor from null-terminated unicodearray
Change-Id: I98361309ada084d8f78517ce88f210d785f59cc0
Diffstat (limited to 'svtools/source/edit')
-rw-r--r-- | svtools/source/edit/svmedit.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/svtools/source/edit/svmedit.cxx b/svtools/source/edit/svmedit.cxx index fca8fc477956..8dd65023fda9 100644 --- a/svtools/source/edit/svmedit.cxx +++ b/svtools/source/edit/svmedit.cxx @@ -315,12 +315,12 @@ void ImpSvMEdit::ImpSetScrollBarRanges() void ImpSvMEdit::ImpInitScrollBars() { - static const sal_Unicode sampleText[] = { 'x', '\0' }; + static const sal_Unicode sampleChar = { 'x' }; if ( mpHScrollBar || mpVScrollBar ) { ImpSetScrollBarRanges(); Size aCharBox; - aCharBox.Width() = mpTextWindow->GetTextWidth( sampleText ); + aCharBox.Width() = mpTextWindow->GetTextWidth( rtl::OUString(sampleChar) ); aCharBox.Height() = mpTextWindow->GetTextHeight(); Size aOutSz = mpTextWindow->GetOutputSizePixel(); if ( mpHScrollBar ) @@ -673,11 +673,11 @@ Size ImpSvMEdit::CalcMinimumSize() const Size ImpSvMEdit::CalcSize( sal_uInt16 nColumns, sal_uInt16 nLines ) const { - static const sal_Unicode sampleText[] = { 'X', '\0' }; + static const sal_Unicode sampleChar = 'X'; Size aSz; Size aCharSz; - aCharSz.Width() = mpTextWindow->GetTextWidth( sampleText ); + aCharSz.Width() = mpTextWindow->GetTextWidth( rtl::OUString(sampleChar) ); aCharSz.Height() = mpTextWindow->GetTextHeight(); if ( nLines ) @@ -700,9 +700,9 @@ Size ImpSvMEdit::CalcSize( sal_uInt16 nColumns, sal_uInt16 nLines ) const void ImpSvMEdit::GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines ) const { - static const sal_Unicode sampleText[] = { 'x', '\0' }; + static const sal_Unicode sampleChar = { 'x' }; Size aOutSz = mpTextWindow->GetOutputSizePixel(); - Size aCharSz( mpTextWindow->GetTextWidth( sampleText ), mpTextWindow->GetTextHeight() ); + Size aCharSz( mpTextWindow->GetTextWidth( rtl::OUString(sampleChar) ), mpTextWindow->GetTextHeight() ); rnCols = (sal_uInt16) (aOutSz.Width()/aCharSz.Width()); rnLines = (sal_uInt16) (aOutSz.Height()/aCharSz.Height()); } |