diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-03-24 17:06:30 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-03-24 17:08:47 -0400 |
commit | e387169daa1b560360e8670a677e233ab2287e61 (patch) | |
tree | 5bf665a27570eb93d7e702119e5a5d2b30d2de31 /sc | |
parent | 2d43fed5870d89a96e3caee7563798bd09a22d6b (diff) |
coverity#735476: bRepeat is always false.
Therefore act accordingly.
Change-Id: Ie737c053a935d3cc0e0c03ab30da2cf3fde0e401
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/view/output2.cxx | 44 |
1 files changed, 2 insertions, 42 deletions
diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx index 54f977c5faef..eb46c4a62d7c 100644 --- a/sc/source/ui/view/output2.cxx +++ b/sc/source/ui/view/output2.cxx @@ -4160,8 +4160,7 @@ void ScOutputData::DrawEditAsianVertical(DrawEditParam& rParam) Size aRefOne = mpRefDevice->PixelToLogic(Size(1,1)); bool bHidden = false; - bool bRepeat = false; - bool bShrink = !rParam.mbBreak && !bRepeat && lcl_GetBoolValue(*rParam.mpPattern, ATTR_SHRINKTOFIT, rParam.mpCondSet); + bool bShrink = !rParam.mbBreak && lcl_GetBoolValue(*rParam.mpPattern, ATTR_SHRINKTOFIT, rParam.mpCondSet); long nAttrRotate = lcl_GetValue<SfxInt32Item, long>(*rParam.mpPattern, ATTR_ROTATE_VALUE, rParam.mpCondSet); if (nAttrRotate) @@ -4276,7 +4275,7 @@ void ScOutputData::DrawEditAsianVertical(DrawEditParam& rParam) // for break, the first GetOutputArea call is sufficient GetOutputArea( nXForPos, nArrYForPos, rParam.mnPosX, rParam.mnPosY, rParam.mnCellX, rParam.mnCellY, nNeededPixel, *rParam.mpPattern, sal::static_int_cast<sal_uInt16>(eOutHorJust), - rParam.mbCellIsValue || bRepeat || bShrink, false, false, aAreaParam ); + rParam.mbCellIsValue || bShrink, false, false, aAreaParam ); if ( bShrink ) { @@ -4286,45 +4285,6 @@ void ScOutputData::DrawEditAsianVertical(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 ) ) { |