summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-04-18 16:20:30 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-04-18 16:23:19 +0100
commitc4da31d33bcd00230153929bba3165f5257aabde (patch)
treed8bbd18f9a5f78d10efc4a90496b779e1d7ca13f
parent7c3db8a660fbbcfca277e5cf22a3987c35e656d0 (diff)
Related: fdo#63546 bundle both changes together as one undo
Change-Id: I2a9608339c372ccdeeca2ca0fd9499a4c527cff3
-rw-r--r--sc/inc/globstr.hrc5
-rw-r--r--sc/source/ui/src/globstr.src8
-rw-r--r--sc/source/ui/view/formatsh.cxx7
3 files changed, 19 insertions, 1 deletions
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;
}