[PATCH] fix fdo#63546 : set appropriate alignment when writing direc...

navin patidar (via Code Review) gerrit at gerrit.libreoffice.org
Tue Apr 16 22:30:40 PDT 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/3424

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/24/3424/1

fix fdo#63546 : set appropriate alignment when writing direction is changed.

Change-Id: I3aa22be6ae85b6f18ed48e3ffd6abc5102a2e92e
---
M sc/source/ui/view/formatsh.cxx
1 file changed, 23 insertions(+), 0 deletions(-)



diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index 20b0c99..a19f5cb 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -2052,6 +2052,29 @@
             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 )
+            {
+                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;
     }

-- 
To view, visit https://gerrit.libreoffice.org/3424
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3aa22be6ae85b6f18ed48e3ffd6abc5102a2e92e
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: navin patidar <patidar at kacst.edu.sa>



More information about the LibreOffice mailing list