[Libreoffice-commits] core.git: 3 commits - sc/inc sc/source

Eike Rathke erack at redhat.com
Tue Oct 29 19:18:34 CET 2013


 sc/inc/globstr.hrc             |    3 --
 sc/source/ui/src/globstr.src   |    8 -----
 sc/source/ui/view/formatsh.cxx |   59 -----------------------------------------
 3 files changed, 70 deletions(-)

New commits:
commit 955281e50e2728932edc3b688ce3cf235bdfd0c9
Author: Eike Rathke <erack at redhat.com>
Date:   Tue Oct 29 19:10:21 2013 +0100

    Revert "fix fdo#63546 : set appropriate alignment when writing direction is changed."
    
    This reverts commit 16f508686c29bfa244ca6f81b5ab3bbaf5fef2a7.

diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index 39d8fc6..ef45387 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -2607,29 +2607,6 @@ void ScFormatShell::ExecuteTextDirection( SfxRequest& rReq )
             SvxFrameDirection eDirection = ( nSlot == SID_ATTR_PARA_LEFT_TO_RIGHT ) ?
                                                 FRMDIR_HORI_LEFT_TOP : FRMDIR_HORI_RIGHT_TOP;
             pTabViewShell->ApplyAttr( SvxFrameDirectionItem( eDirection, ATTR_WRITINGDIR ) );
-
-            const SfxItemSet& rAttrSet = pTabViewShell->GetSelectionPattern()->GetItemSet();
-            const SfxPoolItem* pItem = NULL;
-            const SvxHorJustifyItem* pHorJustify = NULL;
-            SvxCellHorJustify eHorJustify = SVX_HOR_JUSTIFY_STANDARD;
-
-            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() );
-            }
-
         }
         break;
     }
commit 8276cc057a1caf2e282093fcd90ac7b5a2c1c844
Author: Eike Rathke <erack at redhat.com>
Date:   Tue Oct 29 19:03:24 2013 +0100

    Revert "Related: fdo#63546 bundle both changes together as one undo"
    
    This reverts commit c4da31d33bcd00230153929bba3165f5257aabde.
    
    Conflicts:
    	sc/inc/globstr.hrc
    	sc/source/ui/view/formatsh.cxx
    
    Change-Id: If74872b89dff88f1f1fc7fac1a7b6224f3763d26

diff --git a/sc/inc/globstr.hrc b/sc/inc/globstr.hrc
index 9c064fb..688d589 100644
--- a/sc/inc/globstr.hrc
+++ b/sc/inc/globstr.hrc
@@ -668,9 +668,6 @@
 #define STR_INVALIDINPUT            542
 #define STR_INVALIDCONDITION        543
 
-#define STR_UNDO_L2R                544
-#define STR_UNDO_R2L                545
-
 #define STR_FUN_TEXT_SELECTION_COUNT    546
 
 #define STR_QUERYREMOVE             547
diff --git a/sc/source/ui/src/globstr.src b/sc/source/ui/src/globstr.src
index acab6b0..a19f2c8 100644
--- a/sc/source/ui/src/globstr.src
+++ b/sc/source/ui/src/globstr.src
@@ -1784,14 +1784,6 @@ Resource RID_GLOBSTR
     {
         Text [ en-US ] = "Insert Current Time";
     };
-    String STR_UNDO_L2R
-    {
-        Text [ en-US ] = "Left-to-right" ;
-    };
-    String STR_UNDO_R2L
-    {
-        Text [ en-US ] = "Right-to-left" ;
-    };
     String STR_MANAGE_NAMES
     {
         Text [ en-US ] = "Manage Names...";
diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index b211617..39d8fc6 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -2606,12 +2606,6 @@ void ScFormatShell::ExecuteTextDirection( SfxRequest& rReq )
         {
             SvxFrameDirection eDirection = ( nSlot == SID_ATTR_PARA_LEFT_TO_RIGHT ) ?
                                                 FRMDIR_HORI_LEFT_TOP : FRMDIR_HORI_RIGHT_TOP;
-
-            OUString 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 SfxItemSet& rAttrSet = pTabViewShell->GetSelectionPattern()->GetItemSet();
@@ -2636,7 +2630,6 @@ void ScFormatShell::ExecuteTextDirection( SfxRequest& rReq )
                 ExecuteSlot( rReq, GetInterface() );
             }
 
-            pDocSh->GetUndoManager()->LeaveListAction();
         }
         break;
     }
commit 2f29e544932633a01162ecb80e50872eabdd2bc1
Author: Eike Rathke <erack at redhat.com>
Date:   Tue Oct 29 18:17:18 2013 +0100

    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

diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index 3c3e6db..b211617 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -2614,55 +2614,26 @@ void ScFormatShell::ExecuteTextDirection( SfxRequest& rReq )
 
             pTabViewShell->ApplyAttr( SvxFrameDirectionItem( eDirection, ATTR_WRITINGDIR ) );
 
+            const SfxItemSet& rAttrSet = pTabViewShell->GetSelectionPattern()->GetItemSet();
             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
+            if( rAttrSet.GetItemState(ATTR_HOR_JUSTIFY, sal_True, &pItem) == SFX_ITEM_SET )
             {
-                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() );
-                }
+                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 ) );
+            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() );
-                }
+                rReq.SetSlot( SID_H_ALIGNCELL );
+                ExecuteSlot( rReq, GetInterface() );
             }
 
             pDocSh->GetUndoManager()->LeaveListAction();


More information about the Libreoffice-commits mailing list