Kaydet (Commit) 7d96c84d authored tarafından Dimitri Bouron's avatar Dimitri Bouron Kaydeden (comit) Eike Rathke

sc: adjust block height only if needed

Change-Id: Ibc8c101bfaedbcaa5d3ba1554b3301c1f44a8987
Reviewed-on: https://gerrit.libreoffice.org/41928Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarEike Rathke <erack@redhat.com>
üst f2edc808
......@@ -158,8 +158,9 @@ public:
bool InsertName( const OUString& rName, const OUString& rSymbol,
const OUString& rType );
void ApplyAttributes( const SfxItemSet* pDialogSet, const SfxItemSet* pOldSet );
void ApplyAttr( const SfxPoolItem& rAttrItem );
void ApplyAttributes( const SfxItemSet* pDialogSet, const SfxItemSet* pOldSet, bool bAdjustBlockHeight = true );
void ApplyAttr( const SfxPoolItem& rAttrItem, bool bAdjustBlockHeight = true );
void ApplySelectionPattern( const ScPatternAttr& rAttr,
bool bCursorOnly = false);
void ApplyPatternLines(const ScPatternAttr& rAttr,
......
......@@ -1703,7 +1703,7 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq )
SvxBrushItem aBrushItem( static_cast<const SvxBrushItem&>(
pTabViewShell->GetSelectionPattern()->GetItem( ATTR_BACKGROUND ) ) );
aBrushItem.SetColor( COL_TRANSPARENT );
pTabViewShell->ApplyAttr( aBrushItem );
pTabViewShell->ApplyAttr( aBrushItem, false );
}
break;
......@@ -1776,15 +1776,19 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq )
case SID_ATTR_CHAR_OVERLINE:
case SID_ATTR_CHAR_STRIKEOUT:
case SID_ATTR_ALIGN_LINEBREAK:
case SID_ATTR_CHAR_COLOR:
case SID_ATTR_CHAR_CONTOUR:
case SID_ATTR_CHAR_SHADOWED:
case SID_ATTR_CHAR_RELIEF:
case SID_SCATTR_PROTECTION :
pTabViewShell->ApplyAttr( pNewAttrs->Get( pNewAttrs->GetPool()->GetWhich( nSlot ) ) );
rBindings.Invalidate( nSlot );
rBindings.Update( nSlot );
break;
case SID_ATTR_CHAR_COLOR:
case SID_SCATTR_PROTECTION :
pTabViewShell->ApplyAttr( pNewAttrs->Get( pNewAttrs->GetPool()->GetWhich( nSlot) ), false);
rBindings.Invalidate( nSlot );
rBindings.Update( nSlot );
break;
case SID_ATTR_CHAR_FONT:
case SID_ATTR_CHAR_FONTHEIGHT:
......@@ -1980,7 +1984,7 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq )
aBrushItem.SetColor( rNewColorItem.GetValue() );
pTabViewShell->ApplyAttr( aBrushItem );
pTabViewShell->ApplyAttr( aBrushItem, false );
}
break;
......
......@@ -880,7 +880,8 @@ void ScViewFunc::GetSelectionFrame( SvxBoxItem& rLineOuter,
// complete set ( ATTR_STARTINDEX, ATTR_ENDINDEX )
void ScViewFunc::ApplyAttributes( const SfxItemSet* pDialogSet,
const SfxItemSet* pOldSet )
const SfxItemSet* pOldSet,
bool bAdjustBlockHeight)
{
// not editable because of matrix only? attribute OK nonetheless
bool bOnlyNotBecauseOfMatrix;
......@@ -983,13 +984,14 @@ void ScViewFunc::ApplyAttributes( const SfxItemSet* pDialogSet,
pNewPool->Remove(rNewOuter); // release
pNewPool->Remove(rNewInner);
// adjust height
AdjustBlockHeight();
// adjust height only if needed
if (bAdjustBlockHeight)
AdjustBlockHeight();
// CellContentChanged is called in ApplySelectionPattern / ApplyPatternLines
}
void ScViewFunc::ApplyAttr( const SfxPoolItem& rAttrItem )
void ScViewFunc::ApplyAttr( const SfxPoolItem& rAttrItem, bool bAdjustBlockHeight )
{
// not editable because of matrix only? attribute OK nonetheless
bool bOnlyNotBecauseOfMatrix;
......@@ -1008,7 +1010,9 @@ void ScViewFunc::ApplyAttr( const SfxPoolItem& rAttrItem )
aNewAttrs.GetItemSet().Put( SfxUInt16Item( ATTR_INDENT, 0 ) );
ApplySelectionPattern( aNewAttrs );
AdjustBlockHeight();
// Prevent useless compute
if (bAdjustBlockHeight)
AdjustBlockHeight();
// CellContentChanged is called in ApplySelectionPattern
}
......
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