summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2013-10-29 18:17:18 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-11-20 03:17:32 -0600
commit6ea1fb229ba3a273b373cad3c567e346597f799b (patch)
tree96a5a982867b23c33f0935fa000283b40ae9f4a3 /sc
parentee3c1ac606771549b1b5a853c87b090b573f5e03 (diff)
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 <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/view/formatsh.cxx59
1 files changed, 0 insertions, 59 deletions
diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index 4749116dd446..526d717e410c 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;
}