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

Caolán McNamara caolanm at redhat.com
Thu Apr 18 08:23:39 PDT 2013


 sc/inc/globstr.hrc             |    5 ++++-
 sc/source/ui/src/globstr.src   |    8 ++++++++
 sc/source/ui/view/formatsh.cxx |    7 +++++++
 3 files changed, 19 insertions(+), 1 deletion(-)

New commits:
commit c4da31d33bcd00230153929bba3165f5257aabde
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Apr 18 16:20:30 2013 +0100

    Related: fdo#63546 bundle both changes together as one undo
    
    Change-Id: I2a9608339c372ccdeeca2ca0fd9499a4c527cff3

diff --git a/sc/inc/globstr.hrc b/sc/inc/globstr.hrc
index 2dd3330..208876a 100644
--- a/sc/inc/globstr.hrc
+++ b/sc/inc/globstr.hrc
@@ -678,7 +678,10 @@
 #define STR_INVALIDINPUT            542
 #define STR_INVALIDCONDITION        543
 
-#define STR_COUNT                   544
+#define STR_UNDO_L2R                544
+#define STR_UNDO_R2L                545
+
+#define STR_COUNT                   546
 
 #endif
 
diff --git a/sc/source/ui/src/globstr.src b/sc/source/ui/src/globstr.src
index 2cb9d4d..e5fe2dc 100644
--- a/sc/source/ui/src/globstr.src
+++ b/sc/source/ui/src/globstr.src
@@ -1815,6 +1815,14 @@ 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 a851893..3f2b26d 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -2078,6 +2078,12 @@ 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 SfxItemSet& rAttrSet = pTabViewShell->GetSelectionPattern()->GetItemSet();
@@ -2102,6 +2108,7 @@ void ScFormatShell::ExecuteTextDirection( SfxRequest& rReq )
                 ExecuteSlot( rReq, GetInterface() );
             }
 
+            pDocSh->GetUndoManager()->LeaveListAction();
         }
         break;
     }


More information about the Libreoffice-commits mailing list