From c4da31d33bcd00230153929bba3165f5257aabde Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 18 Apr 2013 16:20:30 +0100 Subject: Related: fdo#63546 bundle both changes together as one undo Change-Id: I2a9608339c372ccdeeca2ca0fd9499a4c527cff3 --- 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(-) (limited to 'sc') diff --git a/sc/inc/globstr.hrc b/sc/inc/globstr.hrc index 2dd33309a79b..208876a7b4d8 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 2cb9d4db7e1a..e5fe2dc80990 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 a8518932331b..3f2b26d36a72 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; } -- cgit