Kaydet (Commit) 9104fbc5 authored tarafından Caolán McNamara's avatar Caolán McNamara

coverity#735475 Logically dead code

Change-Id: I6c1538ac40db97d687f446a8059e51b4a588199e
üst 3cd22c2e
......@@ -3879,46 +3879,6 @@ void ScOutputData::DrawEditStacked(DrawEditParam& rParam)
nEngineWidth, nEngineHeight, nNeededPixel,
aAreaParam.mbLeftClip, aAreaParam.mbRightClip );
if ( bRepeat && !aAreaParam.mbLeftClip && !aAreaParam.mbRightClip && rParam.mpEngine->GetParagraphCount() == 1 )
{
// First check if twice the space for the formatted text is available
// (otherwise just keep it unchanged).
long nFormatted = nNeededPixel - nLeftM - nRightM; // without margin
long nAvailable = aAreaParam.maAlignRect.GetWidth() - nLeftM - nRightM;
if ( nAvailable >= 2 * nFormatted )
{
// "repeat" is handled with unformatted text (for performance reasons)
OUString aCellStr = rParam.mpEngine->GetText();
rParam.mpEngine->SetText( aCellStr );
long nRepeatSize = (long) rParam.mpEngine->CalcTextWidth();
if (rParam.mbPixelToLogic)
nRepeatSize = mpRefDevice->LogicToPixel(Size(nRepeatSize,0)).Width();
if ( pFmtDevice != mpRefDevice )
++nRepeatSize;
if ( nRepeatSize > 0 )
{
long nRepeatCount = nAvailable / nRepeatSize;
if ( nRepeatCount > 1 )
{
OUString aRepeated = aCellStr;
for ( long nRepeat = 1; nRepeat < nRepeatCount; nRepeat++ )
aRepeated += aCellStr;
rParam.mpEngine->SetText( aRepeated );
nEngineHeight = rParam.mpEngine->GetTextHeight();
nEngineWidth = (long) rParam.mpEngine->CalcTextWidth();
if (rParam.mbPixelToLogic)
nNeededPixel = mpRefDevice->LogicToPixel(Size(nEngineWidth,0)).Width();
else
nNeededPixel = nEngineWidth;
nNeededPixel += nLeftM + nRightM;
}
}
}
}
if ( rParam.mbCellIsValue && ( aAreaParam.mbLeftClip || aAreaParam.mbRightClip ) )
{
rParam.mpEngine->SetText(OUString("###"));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment