Kaydet (Commit) 8c147078 authored tarafından Khaled Hosny's avatar Khaled Hosny

Rename bNeedEdit → bUseEditEngine

Make it a bit clear that edit here means edit engine not merely text
editing as one would naïvely assume. Took me a while to realize that!

Change-Id: I570a0556d3272c480dc1ae95640de32f56ab9607
Reviewed-on: https://gerrit.libreoffice.org/54783Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarKhaled Hosny <khaledhosny@eglug.org>
üst 40e431de
...@@ -1500,7 +1500,7 @@ tools::Rectangle ScOutputData::LayoutStrings(bool bPixelToLogic, bool bPaint, co ...@@ -1500,7 +1500,7 @@ tools::Rectangle ScOutputData::LayoutStrings(bool bPixelToLogic, bool bPaint, co
SCCOL nCellX = nX; // position where the cell really starts SCCOL nCellX = nX; // position where the cell really starts
SCROW nCellY = nY; SCROW nCellY = nY;
bool bDoCell = false; bool bDoCell = false;
bool bNeedEdit = false; bool bUseEditEngine = false;
// Part of a merged cell? // Part of a merged cell?
...@@ -1589,17 +1589,17 @@ tools::Rectangle ScOutputData::LayoutStrings(bool bPixelToLogic, bool bPaint, co ...@@ -1589,17 +1589,17 @@ tools::Rectangle ScOutputData::LayoutStrings(bool bPixelToLogic, bool bPaint, co
if (aCell.isEmpty()) if (aCell.isEmpty())
bDoCell = false; bDoCell = false;
else if (aCell.meType == CELLTYPE_EDIT) else if (aCell.meType == CELLTYPE_EDIT)
bNeedEdit = true; bUseEditEngine = true;
} }
// Check if this cell is mis-spelled. // Check if this cell is mis-spelled.
if (bDoCell && !bNeedEdit && aCell.meType == CELLTYPE_STRING) if (bDoCell && !bUseEditEngine && aCell.meType == CELLTYPE_STRING)
{ {
if (mpSpellCheckCxt && mpSpellCheckCxt->isMisspelled(nCellX, nCellY)) if (mpSpellCheckCxt && mpSpellCheckCxt->isMisspelled(nCellX, nCellY))
bNeedEdit = true; bUseEditEngine = true;
} }
if (bDoCell && !bNeedEdit) if (bDoCell && !bUseEditEngine)
{ {
if ( nCellY == nY && nCellX >= nX1 && nCellX <= nX2 ) if ( nCellY == nY && nCellX >= nX1 && nCellX <= nX2 )
{ {
...@@ -1677,20 +1677,20 @@ tools::Rectangle ScOutputData::LayoutStrings(bool bPixelToLogic, bool bPaint, co ...@@ -1677,20 +1677,20 @@ tools::Rectangle ScOutputData::LayoutStrings(bool bPixelToLogic, bool bPaint, co
// use edit engine for rotated, stacked or mixed-script text // use edit engine for rotated, stacked or mixed-script text
if ( aVars.GetOrient() == SvxCellOrientation::Stacked || if ( aVars.GetOrient() == SvxCellOrientation::Stacked ||
aVars.IsRotated() || IsAmbiguousScript(nScript) ) aVars.IsRotated() || IsAmbiguousScript(nScript) )
bNeedEdit = true; bUseEditEngine = true;
} }
if (bDoCell && !bNeedEdit) if (bDoCell && !bUseEditEngine)
{ {
bool bFormulaCell = (aCell.meType == CELLTYPE_FORMULA); bool bFormulaCell = (aCell.meType == CELLTYPE_FORMULA);
if ( bFormulaCell ) if ( bFormulaCell )
lcl_CreateInterpretProgress(bProgress, mpDoc, aCell.mpFormula); lcl_CreateInterpretProgress(bProgress, mpDoc, aCell.mpFormula);
if ( aVars.SetText(aCell) ) if ( aVars.SetText(aCell) )
pOldPattern = nullptr; pOldPattern = nullptr;
bNeedEdit = aVars.HasEditCharacters() || (bFormulaCell && aCell.mpFormula->IsMultilineResult()); bUseEditEngine = aVars.HasEditCharacters() || (bFormulaCell && aCell.mpFormula->IsMultilineResult());
} }
long nTotalMargin = 0; long nTotalMargin = 0;
SvxCellHorJustify eOutHorJust = SvxCellHorJustify::Standard; SvxCellHorJustify eOutHorJust = SvxCellHorJustify::Standard;
if (bDoCell && !bNeedEdit) if (bDoCell && !bUseEditEngine)
{ {
CellType eCellType = aCell.meType; CellType eCellType = aCell.meType;
bCellIsValue = ( eCellType == CELLTYPE_VALUE ); bCellIsValue = ( eCellType == CELLTYPE_VALUE );
...@@ -1731,7 +1731,7 @@ tools::Rectangle ScOutputData::LayoutStrings(bool bPixelToLogic, bool bPaint, co ...@@ -1731,7 +1731,7 @@ tools::Rectangle ScOutputData::LayoutStrings(bool bPixelToLogic, bool bPaint, co
{ {
// Only horizontal scaling is handled here. // Only horizontal scaling is handled here.
// DrawEdit is used to vertically scale 90 deg rotated text. // DrawEdit is used to vertically scale 90 deg rotated text.
bNeedEdit = true; bUseEditEngine = true;
} }
else if ( aAreaParam.mbLeftClip || aAreaParam.mbRightClip ) // horizontal else if ( aAreaParam.mbLeftClip || aAreaParam.mbRightClip ) // horizontal
{ {
...@@ -1796,23 +1796,23 @@ tools::Rectangle ScOutputData::LayoutStrings(bool bPixelToLogic, bool bPaint, co ...@@ -1796,23 +1796,23 @@ tools::Rectangle ScOutputData::LayoutStrings(bool bPixelToLogic, bool bPaint, co
if ( bBreak ) if ( bBreak )
{ {
if ( aVars.GetOrient() == SvxCellOrientation::Standard ) if ( aVars.GetOrient() == SvxCellOrientation::Standard )
bNeedEdit = ( aAreaParam.mbLeftClip || aAreaParam.mbRightClip ); bUseEditEngine = ( aAreaParam.mbLeftClip || aAreaParam.mbRightClip );
else else
{ {
long nHeight = aVars.GetTextSize().Height() + long nHeight = aVars.GetTextSize().Height() +
static_cast<long>(aVars.GetMargin()->GetTopMargin()*mnPPTY) + static_cast<long>(aVars.GetMargin()->GetTopMargin()*mnPPTY) +
static_cast<long>(aVars.GetMargin()->GetBottomMargin()*mnPPTY); static_cast<long>(aVars.GetMargin()->GetBottomMargin()*mnPPTY);
bNeedEdit = ( nHeight > aAreaParam.maClipRect.GetHeight() ); bUseEditEngine = ( nHeight > aAreaParam.maClipRect.GetHeight() );
} }
} }
if (!bNeedEdit) if (!bUseEditEngine)
{ {
bNeedEdit = bUseEditEngine =
aVars.GetHorJust() == SvxCellHorJustify::Block && aVars.GetHorJust() == SvxCellHorJustify::Block &&
aVars.GetHorJustMethod() == SvxCellJustifyMethod::Distribute; aVars.GetHorJustMethod() == SvxCellJustifyMethod::Distribute;
} }
} }
if (bNeedEdit) if (bUseEditEngine)
{ {
// mark the cell in CellInfo to be drawn in DrawEdit: // mark the cell in CellInfo to be drawn in DrawEdit:
// Cells to the left are marked directly, cells to the // Cells to the left are marked directly, cells to the
......
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