summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-01-24 21:12:45 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-01-25 12:28:08 +0000
commit5d7d4e78d72003e75a9aa2c705cd5dad68bdc9be (patch)
tree5292dec8db61143a11be1db3f0c455f979722169 /vcl
parenta4bcd0f35ae89625ce6f1f1014514a3b478e1073 (diff)
coverity#1157769 Logically dead code
Change-Id: I48b83a8fba756ad44f9b823357f3fdd42a297430
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/control/edit.cxx27
1 files changed, 11 insertions, 16 deletions
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index 2a17a04c5efd..1a0d04cd91f1 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -528,8 +528,7 @@ void Edit::ImplRepaint(bool bLayout)
return;
OUString aText = ImplGetText();
- sal_Int32 nStart = 0;
- sal_Int32 nEnd = aText.getLength();
+ sal_Int32 nLen = aText.getLength();
sal_Int32 nDXBuffer[256];
sal_Int32* pDXBuffer = NULL;
@@ -543,7 +542,7 @@ void Edit::ImplRepaint(bool bLayout)
pDX = pDXBuffer;
}
- GetCaretPositions( aText, pDX, nStart, nEnd );
+ GetCaretPositions( aText, pDX, 0, nLen );
}
long nTH = GetTextHeight();
@@ -551,16 +550,14 @@ void Edit::ImplRepaint(bool bLayout)
if( bLayout )
{
- long nPos = nStart ? pDX[2*nStart] : 0;
- aPos.X() = nPos + mnXOffset + ImplGetExtraOffset();
+ aPos.X() = mnXOffset + ImplGetExtraOffset();
MetricVector* pVector = &mpControlData->mpLayoutData->m_aUnicodeBoundRects;
OUString* pDisplayText = &mpControlData->mpLayoutData->m_aDisplayText;
- DrawText( aPos, aText, nStart, nEnd - nStart, pVector, pDisplayText );
+ DrawText( aPos, aText, 0, nLen, pVector, pDisplayText );
- if( pDXBuffer )
- delete [] pDXBuffer;
+ delete [] pDXBuffer;
return;
}
@@ -600,15 +597,14 @@ void Edit::ImplRepaint(bool bLayout)
bool bDrawSelection = maSelection.Len() && ( HasFocus() || ( GetStyle() & WB_NOHIDESELECTION ) || mbActivePopup );
- long nPos = nStart ? pDX[2*nStart] : 0;
- aPos.X() = nPos + mnXOffset + ImplGetExtraOffset();
+ aPos.X() = mnXOffset + ImplGetExtraOffset();
if ( bPaintPlaceholderText )
{
DrawText( aPos, maPlaceholderText );
}
else if ( !bDrawSelection && !mpIMEInfos )
{
- DrawText( aPos, aText, nStart, nEnd - nStart );
+ DrawText( aPos, aText, 0, nLen );
}
else
{
@@ -660,13 +656,13 @@ void Edit::ImplRepaint(bool bLayout)
else
SetTextFillColor( IsControlBackground() ? GetControlBackground() : rStyleSettings.GetFieldColor() );
}
- DrawText( aPos, aText, nStart, nEnd - nStart );
+ DrawText( aPos, aText, 0, nLen );
// draw highlighted text
SetClipRegion( aHiglightClipRegion );
SetTextColor( rStyleSettings.GetHighlightTextColor() );
SetTextFillColor( rStyleSettings.GetHighlightColor() );
- DrawText( aPos, aText, nStart, nEnd - nStart );
+ DrawText( aPos, aText, 0, nLen );
// if IME info exists loop over portions and output different font attributes
if( mpIMEInfos && mpIMEInfos->pAttribs )
@@ -730,7 +726,7 @@ void Edit::ImplRepaint(bool bLayout)
SetTextColor( Color( COL_LIGHTGRAY ) );
SetClipRegion( aClip );
- DrawText( aPos, aText, nStart, nEnd - nStart );
+ DrawText( aPos, aText, 0, nLen );
}
}
}
@@ -743,8 +739,7 @@ void Edit::ImplRepaint(bool bLayout)
if ( bVisCursor && ( !mpIMEInfos || mpIMEInfos->bCursor ) )
pCursor->Show();
- if( pDXBuffer )
- delete [] pDXBuffer;
+ delete [] pDXBuffer;
}
// -----------------------------------------------------------------------