summaryrefslogtreecommitdiff
path: root/vcl/source/outdev
diff options
context:
space:
mode:
authorNoel <noelgrandin@gmail.com>2020-10-01 11:01:41 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-10-01 12:19:27 +0200
commitcc2b7c1f930bc05253153f3c8381fb4fb352f3ca (patch)
tree0a285ec4c67933a58fcf4ca991bfc745e715e059 /vcl/source/outdev
parent5ed9f4638e1ff12b3246a66ffee8dd9dd74b9693 (diff)
loplugin:reducevarscope in vcl
Change-Id: I768aa9bd87913bc20351fb631a6326fe01f777b0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103748 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/source/outdev')
-rw-r--r--vcl/source/outdev/text.cxx9
1 files changed, 4 insertions, 5 deletions
diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx
index ac4b10eef3b0..1123aa39bb77 100644
--- a/vcl/source/outdev/text.cxx
+++ b/vcl/source/outdev/text.cxx
@@ -522,7 +522,6 @@ long OutputDevice::ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo,
// is broken into more than two lines ...
if ( xHyph.is() )
{
- sal_Unicode cAlternateReplChar = 0;
css::i18n::Boundary aBoundary = xBI->getWordBoundary( rStr, nBreakPos, rDefLocale, css::i18n::WordType::DICTIONARY_WORD, true );
sal_Int32 nWordStart = nPos;
sal_Int32 nWordEnd = aBoundary.endPos;
@@ -592,6 +591,7 @@ long OutputDevice::ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo,
SAL_WARN_IF( ( nAltEnd - nAltStart ) != 1, "vcl", "Alternate: Wrong assumption!" );
+ sal_Unicode cAlternateReplChar = 0;
if ( nTxtEnd > nTxtStart )
cAlternateReplChar = aAlt[ nAltStart ];
@@ -1538,17 +1538,16 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const tools::Recta
if ( nStyle & DrawTextFlags::MultiLine )
{
- OUString aLastLine;
ImplMultiTextLineInfo aMultiLineInfo;
ImplTextLineInfo* pLineInfo;
sal_Int32 i;
- sal_Int32 nLines;
sal_Int32 nFormatLines;
if ( nTextHeight )
{
long nMaxTextWidth = ImplGetTextLines( aMultiLineInfo, nWidth, aStr, nStyle, _rLayout );
- nLines = static_cast<sal_Int32>(nHeight/nTextHeight);
+ sal_Int32 nLines = static_cast<sal_Int32>(nHeight/nTextHeight);
+ OUString aLastLine;
nFormatLines = aMultiLineInfo.Count();
if (nLines <= 0)
nLines = 1;
@@ -2292,9 +2291,9 @@ bool OutputDevice::GetTextBoundRect( tools::Rectangle& rRect,
pSalLayout = ImplLayout(rStr, nIndex, nLen, aPoint, nLayoutWidth, pDXAry, eDefaultLayout,
nullptr, pGlyphs);
- tools::Rectangle aPixelRect;
if( pSalLayout )
{
+ tools::Rectangle aPixelRect;
bRet = pSalLayout->GetBoundRect(aPixelRect);
if( bRet )