diff options
author | Dimitri Bouron <bouron.d@gmail.com> | 2017-09-05 11:51:36 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2017-09-05 19:30:38 +0200 |
commit | 7d96c84d153417ff01efacd89f3f19803a64dddb (patch) | |
tree | 2d8f257a69c2b11565ebe56d21a125e38c73b8c6 | |
parent | f2edc808762f0fb300923e266dde5d68fa70ace9 (diff) |
sc: adjust block height only if needed
Change-Id: Ibc8c101bfaedbcaa5d3ba1554b3301c1f44a8987
Reviewed-on: https://gerrit.libreoffice.org/41928
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Eike Rathke <erack@redhat.com>
-rw-r--r-- | sc/source/ui/inc/viewfunc.hxx | 5 | ||||
-rw-r--r-- | sc/source/ui/view/formatsh.cxx | 12 | ||||
-rw-r--r-- | sc/source/ui/view/viewfunc.cxx | 14 |
3 files changed, 20 insertions, 11 deletions
diff --git a/sc/source/ui/inc/viewfunc.hxx b/sc/source/ui/inc/viewfunc.hxx index d7172038af14..507d6adb44d0 100644 --- a/sc/source/ui/inc/viewfunc.hxx +++ b/sc/source/ui/inc/viewfunc.hxx @@ -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, diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx index 8b77a4bfa87e..479db4170881 100644 --- a/sc/source/ui/view/formatsh.cxx +++ b/sc/source/ui/view/formatsh.cxx @@ -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; diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index c43fb4b61138..0195b22e2540 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -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 } |