summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authornavin patidar <patidar@kacst.edu.sa>2013-04-15 12:59:12 +0300
committerCaolán McNamara <caolanm@redhat.com>2013-04-18 09:32:29 +0000
commit16f508686c29bfa244ca6f81b5ab3bbaf5fef2a7 (patch)
tree42c4c6c859e03bd0572bf1b1d7aca56bc65db28c /sc
parent025857d81d4781a95cda4e790808b05b97eb97d9 (diff)
fix fdo#63546 : set appropriate alignment when writing direction is changed.
Change-Id: I3aa22be6ae85b6f18ed48e3ffd6abc5102a2e92e Reviewed-on: https://gerrit.libreoffice.org/3424 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.cxx23
1 files changed, 23 insertions, 0 deletions
diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index f93849d102c7..c4e7e40cd1bf 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -2084,6 +2084,29 @@ 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;
}