sc/source/ui/view/formatsh.cxx | 59 ----------------------------------------- 1 file changed, 59 deletions(-)
New commits: commit 6ea1fb229ba3a273b373cad3c567e346597f799b Author: Eike Rathke <er...@redhat.com> Date: Tue Oct 29 18:17:18 2013 +0100 resolved fdo#70750 reverted inappropriate implementation of fdo#63546 This is a combination of 2 commits. Revert "fdo#63546: set appropriate alignment when wrt direction of cells is changed." This reverts commit 706e3b8e43df94310b2fe8458da67875073a046c. Related previous commits that commit depends on will also be reverted. Triggered by fdo#70750 inspecting the code it turned out that the changes for fdo#63546 did several things wrong: * looping over individual cells of a large selected range results in slicing and merging ScAttrArray for each row in each column which is utterly slow (the reason for fdo#70750) * instead of executing the changes in ScFormatShell calls should had been forwarded through ScTabViewShell to be passed down to ScViewFunc, ScDocFunc, ScDocument, ... * setting hard attributes on all cells (except if already centered or block justified) is not wanted * value cells for example should stay automatically right justified if no justification is given yet * overwriting already existing left or right justification may not be what the user expects * applied styles' justification is overridden this way (cherry picked from commit 2f29e544932633a01162ecb80e50872eabdd2bc1) Revert "fix fdo#63546 : set appropriate alignment when writing direction is changed." This reverts commit 16f508686c29bfa244ca6f81b5ab3bbaf5fef2a7. (cherry picked from commit 955281e50e2728932edc3b688ce3cf235bdfd0c9) Conflicts: sc/source/ui/view/formatsh.cxx Change-Id: I53fc56a09f2b396577fff3ec679b39837fc2f649 Reviewed-on: https://gerrit.libreoffice.org/6691 Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx index 4749116..526d717 100644 --- a/sc/source/ui/view/formatsh.cxx +++ b/sc/source/ui/view/formatsh.cxx @@ -2540,66 +2540,7 @@ void ScFormatShell::ExecuteTextDirection( SfxRequest& rReq ) { SvxFrameDirection eDirection = ( nSlot == SID_ATTR_PARA_LEFT_TO_RIGHT ) ? FRMDIR_HORI_LEFT_TOP : FRMDIR_HORI_RIGHT_TOP; - - String aUndo = ScGlobal::GetRscString( nSlot == SID_ATTR_PARA_LEFT_TO_RIGHT ? - STR_UNDO_L2R : STR_UNDO_R2L ); - ScDocShell* pDocSh = GetViewData()->GetDocShell(); - pDocSh->GetUndoManager()->EnterListAction( aUndo, aUndo ); - pTabViewShell->ApplyAttr( SvxFrameDirectionItem( eDirection, ATTR_WRITINGDIR ) ); - - const SfxPoolItem* pItem = NULL; - const SvxHorJustifyItem* pHorJustify = NULL; - SvxCellHorJustify eHorJustify = SVX_HOR_JUSTIFY_STANDARD; - ScRange aRange; - GetViewData()->GetMarkData().GetMarkArea(aRange); - ScMarkData aMark = GetViewData()->GetMarkData(); - ScDocument * pDoc = GetViewData()->GetDocument(); - if (aMark.IsMultiMarked()) - { - SCCOL nCol = aRange.aStart.Col(); - SCROW nRow = aRange.aStart.Row(); - for ( ; nCol <= aRange.aEnd.Col(); nCol++ ) - { - for ( ; nRow <= aRange.aEnd.Row(); nRow++ ) - { - pItem = pDoc->GetAttr( nCol, nRow, aMark.GetFirstSelected(), ATTR_HOR_JUSTIFY ); - pHorJustify = (const SvxHorJustifyItem*)pItem; - eHorJustify = SvxCellHorJustify( pHorJustify->GetValue() ); - - if( eHorJustify != SVX_HOR_JUSTIFY_CENTER && eHorJustify != SVX_HOR_JUSTIFY_BLOCK ) - { - if( nSlot == SID_ATTR_PARA_LEFT_TO_RIGHT ) - pDoc->ApplyAttr( nCol, nRow, aMark.GetFirstSelected(), SvxHorJustifyItem( SVX_HOR_JUSTIFY_LEFT, ATTR_HOR_JUSTIFY ) ); - else - pDoc->ApplyAttr( nCol, nRow, aMark.GetFirstSelected(), SvxHorJustifyItem( SVX_HOR_JUSTIFY_RIGHT, ATTR_HOR_JUSTIFY ) ); - } - } - nRow = 0; - } - } - else - { - const SfxItemSet& rAttrSet = pTabViewShell->GetSelectionPattern()->GetItemSet(); - if( rAttrSet.GetItemState(ATTR_HOR_JUSTIFY, sal_True, &pItem) == SFX_ITEM_SET ) - { - pHorJustify = (const SvxHorJustifyItem*)pItem; - eHorJustify = SvxCellHorJustify( pHorJustify->GetValue() ); - } - - if( eHorJustify != SVX_HOR_JUSTIFY_CENTER && eHorJustify != SVX_HOR_JUSTIFY_BLOCK ) - { - if( nSlot == SID_ATTR_PARA_LEFT_TO_RIGHT ) - rReq.AppendItem( SvxHorJustifyItem( SVX_HOR_JUSTIFY_LEFT, SID_H_ALIGNCELL ) ); - else - rReq.AppendItem( SvxHorJustifyItem( SVX_HOR_JUSTIFY_RIGHT, SID_H_ALIGNCELL ) ); - - rReq.SetSlot( SID_H_ALIGNCELL ); - ExecuteSlot( rReq, GetInterface() ); - } - } - - pDocSh->GetUndoManager()->LeaveListAction(); } break; }
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits