1. mst
  2. ooo340

Commits

Oliver-Rainer Wittmann  committed d0cd620

textalignment01: #i105270# - intermediate commit on the way of an ODF conform text alignment

- introduction of new text alignments SVX_ADJUST_START and SVX_ADJUST_END
- adjustment of <SvxAdjustItem>
- new UNO-API for the new text alignments
- support of the new text alignment in the ODF import
- handling of legacy ODF documents from former OOo versions
- support in Writer almost complete
- support in Edit Engine almost complete
- start of support in paragraph dialog and paragraph style dialog

  • Participants
  • Parent commits 025c436
  • Branches default

Comments (0)

Files changed (87)

File cui/source/inc/paragrph.hxx

View file
 #include <svx/frmdirlbox.hxx>
 #include <vcl/lstbox.hxx>
 #include <svx/flagsdef.hxx>
-
-// define ----------------------------------------------------------------
-
-// 1/2 cm in TWIPS
-// wird auch fuer Minimalgrosse der LayFrms aller Arten benutzt
-//CHINA001 #define MM50   283
+// --> OD #i15270#
+#include <editeng/frmdir.hxx>
+// <--
 
 // forward ---------------------------------------------------------------
 
     FixedText               	aTextDirectionFT;
     svx::FrameDirectionListBox	aTextDirectionLB;
 
+    // --> OD #i105270#
+    // for handling text direction dependent text alignments SVX_ADJUST_START 
+    // and SVX_ADJUST_END
+    SvxFrameDirection meTextDirection;
+    // <--
+
 #ifdef _SVX_PARAGRPH_CXX
 	DECL_LINK( 				AlignHdl_Impl, RadioButton* );
     DECL_LINK( 				LastLineHdl_Impl, ListBox* );
     DECL_LINK( 				TextDirectionHdl_Impl, ListBox* );
 
 	void					UpdateExample_Impl( BOOL bAll = FALSE );
+
+    // --> OD #i105270#
+    bool                    InitTextDirection( const SvxFrameDirection eTextDirection );
+    // <--
 #endif
 
 							SvxParaAlignTabPage( Window* pParent, const SfxItemSet& rSet );

File cui/source/tabpages/paragrph.cxx

View file
 
 --------------------------------------------------*/
 SvxParaAlignTabPage::SvxParaAlignTabPage( Window* pParent, const SfxItemSet& rSet )
-	: SfxTabPage(pParent, CUI_RES( RID_SVXPAGE_ALIGN_PARAGRAPH ),rSet),
-    aAlignFrm           ( this, CUI_RES( FL_ALIGN ) ),
-    aLeft               ( this, CUI_RES( BTN_LEFTALIGN ) ),
-	aRight				( this, CUI_RES( BTN_RIGHTALIGN ) ),
-	aCenter				( this, CUI_RES( BTN_CENTERALIGN ) ),
-	aJustify			( this, CUI_RES( BTN_JUSTIFYALIGN ) ),
-    aLastLineFT         ( this, CUI_RES( FT_LASTLINE ) ),
-	aLastLineLB			( this, CUI_RES( LB_LASTLINE ) ),
-	aExpandCB			( this, CUI_RES( CB_EXPAND ) ),
-	aSnapToGridCB		( this, CUI_RES( CB_SNAP ) ),
-	aExampleWin			( this, CUI_RES( WN_EXAMPLE ) ),
+    : SfxTabPage( pParent, CUI_RES( RID_SVXPAGE_ALIGN_PARAGRAPH ), rSet)
+    , aAlignFrm           ( this, CUI_RES( FL_ALIGN ) )
+    , aLeft               ( this, CUI_RES( BTN_LEFTALIGN ) )
+    , aRight              ( this, CUI_RES( BTN_RIGHTALIGN ) )
+    , aCenter             ( this, CUI_RES( BTN_CENTERALIGN ) )
+    , aJustify            ( this, CUI_RES( BTN_JUSTIFYALIGN ) )
+    , aLastLineFT         ( this, CUI_RES( FT_LASTLINE ) )
+    , aLastLineLB         ( this, CUI_RES( LB_LASTLINE ) )
+    , aExpandCB           ( this, CUI_RES( CB_EXPAND ) )
+    , aSnapToGridCB       ( this, CUI_RES( CB_SNAP ) )
+    , aExampleWin         ( this, CUI_RES( WN_EXAMPLE ) )
+    
+    , aVertAlignFL       ( this, CUI_RES( FL_VERTALIGN ) )
+    , aVertAlignFT        ( this, CUI_RES( FT_VERTALIGN ) )
+    , aVertAlignLB        ( this, CUI_RES( LB_VERTALIGN ) )
+    
+    , aPropertiesFL       ( this, CUI_RES( FL_PROPERTIES    ))
+    , aTextDirectionFT    ( this, CUI_RES( FT_TEXTDIRECTION ))
+    , aTextDirectionLB    ( this, CUI_RES( LB_TEXTDIRECTION ))
 
-	aVertAlignFL		( this, CUI_RES( FL_VERTALIGN ) ),
-	aVertAlignFT		( this, CUI_RES( FT_VERTALIGN ) ),
-	aVertAlignLB		( this, CUI_RES( LB_VERTALIGN ) ),
-
-	aPropertiesFL		( this, CUI_RES( FL_PROPERTIES    )),
-	aTextDirectionFT	( this, CUI_RES( FT_TEXTDIRECTION )),
-	aTextDirectionLB	( this, CUI_RES( LB_TEXTDIRECTION ))
+    // --> OD #i105270#
+    , meTextDirection( FRMDIR_HORI_LEFT_TOP )
+    // <--
 {
 	SvtLanguageOptions aLangOptions;
 	USHORT nLastLinePos = LASTLINEPOS_DEFAULT;
             aTextDirectionLB.Show();
         }
     }
+
+    // --> OD #i105270#
+    {
+        SvxFrameDirection eTextDirection = FRMDIR_ENVIRONMENT;
+        const USHORT _nFrmDirWhich = GetWhich( SID_ATTR_FRAMEDIRECTION );
+        if ( SFX_ITEM_AVAILABLE <= rSet.GetItemState( _nFrmDirWhich ) )
+        {
+            const SvxFrameDirectionItem& rFrameDirItem = 
+                    static_cast<const SvxFrameDirectionItem&>(rSet.Get( _nFrmDirWhich ));
+            eTextDirection = static_cast<SvxFrameDirection>(rFrameDirItem.GetValue());
+        }
+        InitTextDirection( eTextDirection );
+    }
+    // <--
 }
 
+bool SvxParaAlignTabPage::InitTextDirection( const SvxFrameDirection eTextDirection )
+{
+    const SvxFrameDirection eOldTextDirection( meTextDirection );
+    
+    meTextDirection = FRMDIR_HORI_LEFT_TOP;
+    if ( eTextDirection != FRMDIR_ENVIRONMENT )
+    {
+        meTextDirection = eTextDirection;
+    }
+    else
+    {        
+        if ( GetItemSet().GetItemState( SID_ENVIRONMENT_TEXTDIRECTION ) != SFX_ITEM_SET )
+        {
+            DBG_ASSERT( false, "<SvxParaAlignTabPage::InitTextDirection(..)> - environment text direction not provided!" );
+        }
+        else
+        {        
+            const SvxFrameDirectionItem& rEnvironmentFrameDirItem =
+                static_cast<const SvxFrameDirectionItem&>(GetItemSet().Get( SID_ENVIRONMENT_TEXTDIRECTION ));
+            meTextDirection = static_cast<SvxFrameDirection>(rEnvironmentFrameDirItem.GetValue());
+        }            
+    }
+
+    return meTextDirection != eOldTextDirection;
+}            
+
 /*-----------------16.01.97 19.33-------------------
 
 --------------------------------------------------*/
 {
 	BOOL bModified = FALSE;
 
-	FASTBOOL bAdj = FALSE, bChecked = FALSE;
-	SvxAdjust eAdjust = SVX_ADJUST_LEFT;
+    bool bAdj = false;
+    bool bChecked = false;
+    // --> OD #i105270#
+    SvxAdjust eAdjust = SVX_ADJUST_START;
+    // <--
 
 	if ( aLeft.IsChecked() )
 	{
-		eAdjust = SVX_ADJUST_LEFT;
+        // --> OD #i105270#
+        if ( meTextDirection == FRMDIR_HORI_RIGHT_TOP )
+        {
+            eAdjust = SVX_ADJUST_END;
+        }
+        else
+        {        
+            eAdjust = SVX_ADJUST_START;
+        }
+        // <--
 		bAdj = !aLeft.GetSavedValue();
-		bChecked = TRUE;
+        bChecked = true;
 	}
 	else if ( aRight.IsChecked() )
 	{
-		eAdjust = SVX_ADJUST_RIGHT;
+        // --> OD #i105270#
+        if ( meTextDirection == FRMDIR_HORI_RIGHT_TOP )
+        {
+            eAdjust = SVX_ADJUST_START;
+        }
+        else
+        {        
+            eAdjust = SVX_ADJUST_END;
+        }
+        // <--
 		bAdj = !aRight.GetSavedValue();
-		bChecked = TRUE;
+        bChecked = true;
 	}
 	else if ( aCenter.IsChecked() )
 	{
 		eAdjust = SVX_ADJUST_CENTER;
 		bAdj = !aCenter.GetSavedValue();
-		bChecked = TRUE;
+        bChecked = true;
 	}
 	else if ( aJustify.IsChecked() )
 	{
 		eAdjust = SVX_ADJUST_BLOCK;
 		bAdj = !aJustify.GetSavedValue() ||
-			aExpandCB.IsChecked() != aExpandCB.GetSavedValue() ||
-			aLastLineLB.GetSelectEntryPos() != aLastLineLB.GetSavedValue();
-		bChecked = TRUE;
+               aExpandCB.IsChecked() != aExpandCB.GetSavedValue() ||
+               aLastLineLB.GetSelectEntryPos() != aLastLineLB.GetSavedValue();
+        bChecked = true;
 	}
-    USHORT _nWhich = GetWhich( SID_ATTR_PARA_ADJUST );
 
     if ( bAdj )
     {
         const SvxAdjustItem* pOld =
             (const SvxAdjustItem*)GetOldItem( rOutSet, SID_ATTR_PARA_ADJUST );
         const bool bOneWordBlocked = aExpandCB.IsChecked();
-        USHORT nLBPos = aLastLineLB.GetSelectEntryPos();
+        
         SvxAdjust eLastLineAdjust = SVX_ADJUST_LEFT;
+        {
+            const USHORT nLBPos = aLastLineLB.GetSelectEntryPos();
+            if ( 1 == nLBPos )
+                eLastLineAdjust = SVX_ADJUST_CENTER;
+            else if ( 2 == nLBPos )
+                eLastLineAdjust = SVX_ADJUST_BLOCK;
+        }
 
-        if ( 1 == nLBPos )
-            eLastLineAdjust = SVX_ADJUST_CENTER;
-        else if ( 2 == nLBPos )
-            eLastLineAdjust = SVX_ADJUST_BLOCK;
-
-        FASTBOOL bNothingWasChecked =
-            !aLeft.GetSavedValue() && !aRight.GetSavedValue() &&
-            !aCenter.GetSavedValue() && !aJustify.GetSavedValue();
+        const bool bNothingWasChecked =
+                        !aLeft.GetSavedValue() && !aRight.GetSavedValue() &&
+                        !aCenter.GetSavedValue() && !aJustify.GetSavedValue();
 
         if ( !pOld || pOld->GetAdjust() != eAdjust ||
              pOld->GetOneWordBlocked() != bOneWordBlocked ||
         {
             bModified |= TRUE;
             SvxAdjustItem aAdj(
-                (const SvxAdjustItem&)GetItemSet().Get( _nWhich ) );
+                (const SvxAdjustItem&)GetItemSet().Get( GetWhich( SID_ATTR_PARA_ADJUST ) ) );
             aAdj.SetAdjust( eAdjust );
             aAdj.SetOneWordBlocked( bOneWordBlocked );
             aAdj.SetLastLineAdjust( eLastLineAdjust );
             rOutSet.Put( aAdj );
         }
     }
+    
     if(aSnapToGridCB.IsChecked() != aSnapToGridCB.GetSavedValue())
     {
         rOutSet.Put(SvxParaGridItem(aSnapToGridCB.IsChecked(), GetWhich( SID_ATTR_PARA_SNAPTOGRID )));
         bModified = TRUE;
     }
+    
     if(aVertAlignLB.GetSavedValue() != aVertAlignLB.GetSelectEntryPos())
     {
         rOutSet.Put(SvxParaVertAlignItem(aVertAlignLB.GetSelectEntryPos(), GetWhich( SID_PARA_VERTALIGN )));
 	{
         const SvxAdjustItem& rAdj = (const SvxAdjustItem&)rSet.Get( _nWhich );
 
-		switch ( rAdj.GetAdjust() /*!!! VB fragen rAdj.GetLastBlock()*/ )
+        switch ( rAdj.GetAdjust() )
 		{
+            // --> OD #i105270#
+            case SVX_ADJUST_START:
+            {
+                if ( meTextDirection == FRMDIR_HORI_RIGHT_TOP )
+                {
+                    aRight.Check();
+                }
+                else
+                {        
+                    aLeft.Check();
+                }
+            }
+            break;        
+            case SVX_ADJUST_END:
+            {
+                if ( meTextDirection == FRMDIR_HORI_RIGHT_TOP )
+                {
+                    aLeft.Check();
+                }
+                else
+                {        
+                    aRight.Check();
+                }
+            }
+            break;        
+            // <--
 			case SVX_ADJUST_LEFT: aLeft.Check(); break;
 
 			case SVX_ADJUST_RIGHT: aRight.Check(); break;
 			case SVX_ADJUST_BLOCK: aJustify.Check(); break;
             default: ; //prevent warning
 		}
-		BOOL bEnable = aJustify.IsChecked();
+        const BOOL bEnable = aJustify.IsChecked();
 		aLastLineFT.Enable(bEnable);
 		aLastLineLB.Enable(bEnable);
 		aExpandCB  .Enable(bEnable);
 	{
         const SvxFrameDirectionItem& rFrameDirItem = ( const SvxFrameDirectionItem& ) rSet.Get( _nWhich );
         aTextDirectionLB.SelectEntryValue( (SvxFrameDirection)rFrameDirItem.GetValue() );
-        aTextDirectionLB.SaveValue();
 	}
+    // --> OD #i105270#
+    // correction: save value of <aTextDirectionLB> in order to assure correct
+    //             check on its change in <FillItemSet(..)>
+    aTextDirectionLB.SaveValue();
+    // <--
 
     aSnapToGridCB.SaveValue();
     aVertAlignLB.SaveValue();
 --------------------------------------------------*/
 IMPL_LINK( SvxParaAlignTabPage, AlignHdl_Impl, RadioButton*, EMPTYARG )
 {
-	BOOL bJustify = aJustify.IsChecked();
+    const BOOL bJustify = aJustify.IsChecked();
 	aLastLineFT.Enable(bJustify);
 	aLastLineLB.Enable(bJustify);
 	aExpandCB.Enable(bJustify);
 IMPL_LINK( SvxParaAlignTabPage, TextDirectionHdl_Impl, ListBox*, EMPTYARG )
 {
 	SvxFrameDirection eDir = aTextDirectionLB.GetSelectEntryValue();
+    // --> OD #i105270#
+    const bool bTextDirChanged = InitTextDirection( eDir );
+    // <--
 	switch ( eDir )
 	{
-		// check the default alignment for this text direction
-		case FRMDIR_HORI_LEFT_TOP :		aLeft.Check( TRUE ); break;
-		case FRMDIR_HORI_RIGHT_TOP :	aRight.Check( TRUE ); break;
-		case FRMDIR_ENVIRONMENT :		/* do nothing */ break;
+        // --> OD #i105270#
+        case FRMDIR_HORI_LEFT_TOP:
+        {
+            aLeft.Check( TRUE );
+            UpdateExample_Impl(FALSE);
+        }
+        break;
+        case FRMDIR_HORI_RIGHT_TOP:
+        {    
+            aRight.Check( TRUE );
+            UpdateExample_Impl(FALSE);
+        }
+        break;
+        case FRMDIR_ENVIRONMENT:
+        {
+            if ( bTextDirChanged )
+            {
+                if ( aLeft.IsChecked() && aLeft.GetSavedValue() )
+                {
+                    aRight.Check( TRUE );
+                }
+                else if ( aRight.IsChecked() && aRight.GetSavedValue() )
+                {
+                    aLeft.Check( TRUE );
+                }
+                UpdateExample_Impl(FALSE);
+            }
+        }
+        break;        
 		default:
 		{
 			DBG_ERRORFILE( "SvxParaAlignTabPage::TextDirectionHdl_Impl(): other directions not supported" );

File editeng/inc/editeng/adjitem.hxx

View file
 public:
 	TYPEINFO();
 
-    SvxAdjustItem( const SvxAdjust eAdjst /*= SVX_ADJUST_LEFT*/,
+    SvxAdjustItem( const SvxAdjust eAdjst,
                    const USHORT nId );
 
 	// "pure virtual Methoden" vom SfxPoolItem
 //            eRet = SVX_ADJUST_BLOCK;
 //        return eRet;
 //    }
+    // <--
 };
 
 #endif

File editeng/inc/editeng/editrids.hrc

View file
 #define RID_SVXITEMS_ITALIC_OBLIQUE			(RID_EDIT_START + 207)
 #define RID_SVXITEMS_ITALIC_NORMAL			(RID_EDIT_START + 208)
 
-// enum SvxAdjust -----------------------------------------------------------
-#define RID_SVXITEMS_ADJUST_BEGIN			(RID_EDIT_START + 209)
-#define RID_SVXITEMS_ADJUST_LEFT			(RID_EDIT_START + 209)
-#define RID_SVXITEMS_ADJUST_RIGHT			(RID_EDIT_START + 210)
-#define RID_SVXITEMS_ADJUST_BLOCK			(RID_EDIT_START + 211)
-#define RID_SVXITEMS_ADJUST_CENTER			(RID_EDIT_START + 212)
-#define RID_SVXITEMS_ADJUST_BLOCKLINE		(RID_EDIT_START + 213)
+// --> OD #i105270#
+// defines for enum SvxAdjust removed here and added at end, because enum has been extented
+// <--
 
 // for SvxTabStop -----------------------------------------------------------
 #define RID_SVXITEMS_TAB_DECIMAL_CHAR		(RID_EDIT_START + 214)
 #define RID_SVXSTR_A11Y_IMAGEBULLET_DESCRIPTION	(RID_EDIT_START + 314)
 #define RID_SVXSTR_A11Y_IMAGEBULLET_NAME		(RID_EDIT_START + 315)
 
-#if 315 > (RID_EDIT_END-RID_EDIT_START)
+// --> OD #i105270#
+// enum SvxAdjust -----------------------------------------------------------
+#define RID_SVXITEMS_ADJUST_BEGIN                       (RID_EDIT_START + 316)
+#define RID_SVXITEMS_ADJUST_LEFT                        (RID_EDIT_START + 316)
+#define RID_SVXITEMS_ADJUST_RIGHT                       (RID_EDIT_START + 317)
+#define RID_SVXITEMS_ADJUST_BLOCK                       (RID_EDIT_START + 318)
+#define RID_SVXITEMS_ADJUST_CENTER                      (RID_EDIT_START + 319)
+#define RID_SVXITEMS_ADJUST_BLOCKLINE                   (RID_EDIT_START + 320)
+#define RID_SVXITEMS_ADJUST_START                       (RID_EDIT_START + 321)
+#define RID_SVXITEMS_ADJUST_END                         (RID_EDIT_START + 322)
+// <--
+
+#if 322 > (RID_EDIT_END-RID_EDIT_START)
 #error Resource-Ueberlauf in #line, #file
 #endif
 
 #endif
 
 // ******************************************************************* EOF
-

File editeng/inc/editeng/editview.hxx

View file
 	void			SpellIgnoreWord();
 	void			ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack = 0 );
 
+    // --> OD #i105270#
+    bool IsCursorInRightToLeftText() const;
+    // <--
+
 	void 				InsertField( const SvxFieldItem& rFld );
 	const SvxFieldItem*	GetFieldUnderMousePointer() const;
 	const SvxFieldItem*	GetFieldUnderMousePointer( USHORT& nPara, xub_StrLen& nPos ) const;

File editeng/inc/editeng/memberids.hrc

View file
 #define MID_VALIDFLAGS          4
 
 //AdjustItem
-#define MID_PARA_ADJUST			0
+#define MID_PARA_ADJUST         0
 #define MID_LAST_LINE_ADJUST    1
 #define MID_EXPAND_SINGLE       2
+#define MID_PARA_TEXT_ALIGN     3
 
 //SvxFontItem
 // Don't use 0 as it used for the whole struct

File editeng/inc/editeng/outliner.hxx

View file
 
     String		GetSurroundingText() const;
  	Selection	GetSurroundingTextSelection() const;
+
+    // --> OD #i105270#
+    bool IsCursorInRightToLeftText() const;
+    // <--
 };
 
 

File editeng/inc/editeng/svxenum.hxx

View file
 
 enum SvxAdjust
 {
-    // --> OD 2010-10-28 #i105270#
+    // --> OD #i105270#
     // left and right text alignment does not exist in ODF
     // Still supporting left and right text alignment for 
     // -- legacy documents
     // <--
 	SVX_ADJUST_BLOCK,
 	SVX_ADJUST_CENTER,
-    // --> OD 2010-10-28 #i105270#
+    // --> OD #i105270#
     // only needed for UNO-API com::sun::star::style::ParagraphProperties::ParaAdjust
     // in order to support property value com::sun::star::style::ParagraphAdjust::STRETCH
     SVX_ADJUST_BLOCKLINE,
     // <--
-    // --> OD 2010-10-28 #i105270#
+    // --> OD #i105270#
     // new text alignments
-//    SVX_ADJUST_START,
-//    SVX_ADJUST_END,
+    SVX_ADJUST_START,
+    SVX_ADJUST_END,
     // <--
-    // --> OD 2010-10-27 #i105270#
+    // --> OD #i105270#
     // renamed
     SVX_ADJUST_INVALID_ENUM_END
     // <--
 enum SvxCellHorJustify
 {
 	SVX_HOR_JUSTIFY_STANDARD,
-    // --> OD 2010-10-28 #i105270#
+    // --> OD #i105270#
     // left text alignment does not exist in ODF
     // Still supporting left text alignment for 
     // -- legacy documents
 	SVX_HOR_JUSTIFY_LEFT,
     // <--
 	SVX_HOR_JUSTIFY_CENTER,
-    // --> OD 2010-10-28 #i105270#
+    // --> OD #i105270#
     // right text alignment does not exist in ODF
     // Still supporting right text alignment for 
     // -- legacy documents
     // <--
 	SVX_HOR_JUSTIFY_BLOCK,
     SVX_HOR_JUSTIFY_REPEAT,
-    // --> OD 2010-10-28 #i105270#
+    // --> OD #i105270#
     // new text alignments
-//    SVX_HOR_JUSTIFY_START,
-//    SVX_HOR_JUSTIFY_END
+    SVX_HOR_JUSTIFY_START,
+    SVX_HOR_JUSTIFY_END
     // <--
 };
 

File editeng/inc/editeng/unoprnms.hxx

View file
 #define UNO_NAME_EDIT_FONT_DESCRIPTOR			"FontDescriptor"
 #define UNO_NAME_EDIT_FONT_STYLENAME			"FontStyleName"
 
-#define UNO_NAME_EDIT_PARA_ADJUST				"ParaAdjust"
-#define UNO_NAME_EDIT_PARA_BMARGIN				"ParaBottomMargin"
+#define UNO_NAME_EDIT_PARA_ADJUST               "ParaAdjust"
+// --> OD #i105270#
+#define UNO_NAME_EDIT_PARA_TEXT_ALIGN           "ParaTextAlign"
+// <--
+#define UNO_NAME_EDIT_PARA_BMARGIN              "ParaBottomMargin"
 #define UNO_NAME_EDIT_PARA_LASTLINEADJ			"ParaLastLineAdjust"
 #define UNO_NAME_EDIT_PARA_LMARGIN				"ParaLeftMargin"
 #define UNO_NAME_EDIT_PARA_LRPARAMARGIN			"ParaLeftRightParaMargin"

File editeng/inc/editeng/unotext.hxx

View file
 	{MAP_CHAR_LEN(UNO_NAME_EDIT_FONT_DESCRIPTOR),	WID_FONTDESC,		&::getCppuType((const ::com::sun::star::awt::FontDescriptor*)0),	0, MID_FONT_FAMILY_NAME }
 
 #define SVX_UNOEDIT_PARA_PROPERTIES \
-	{MAP_CHAR_LEN(UNO_NAME_EDIT_PARA_ADJUST),		EE_PARA_JUST,				&::getCppuType((const sal_Int16*)0),			0, MID_PARA_ADJUST }, \
-	{MAP_CHAR_LEN(UNO_NAME_EDIT_PARA_BMARGIN),		EE_PARA_ULSPACE,			&::getCppuType((const sal_Int32*)0),			0, MID_LO_MARGIN|SFX_METRIC_ITEM }, \
+    {MAP_CHAR_LEN(UNO_NAME_EDIT_PARA_ADJUST),       EE_PARA_JUST,               &::getCppuType((const sal_Int16*)0),            0, MID_PARA_ADJUST }, \
+    {MAP_CHAR_LEN(UNO_NAME_EDIT_PARA_TEXT_ALIGN),   EE_PARA_JUST,               &::getCppuType((const sal_Int16*)0),            0, MID_PARA_TEXT_ALIGN }, \
+    {MAP_CHAR_LEN(UNO_NAME_EDIT_PARA_BMARGIN),      EE_PARA_ULSPACE,            &::getCppuType((const sal_Int32*)0),            0, MID_LO_MARGIN|SFX_METRIC_ITEM }, \
 	{MAP_CHAR_LEN(UNO_NAME_EDIT_PARA_IS_HYPHEN),	EE_PARA_HYPHENATE,			&::getBooleanCppuType(),				0, 0 }, \
 	{MAP_CHAR_LEN(UNO_NAME_EDIT_PARA_LASTLINEADJ),	EE_PARA_JUST,				&::getCppuType((const sal_Int16*)0),			0, MID_LAST_LINE_ADJUST }, \
 	{MAP_CHAR_LEN(UNO_NAME_EDIT_PARA_LMARGIN),		EE_PARA_LRSPACE,			&::getCppuType((const sal_Int32*)0),			0, MID_TXT_LMARGIN|SFX_METRIC_ITEM }, \

File editeng/source/editeng/editview.cxx

View file
 	return pImpEditView->IsWrongSpelledWord( aPaM , bMarkIfWrong );
 }
 
+// --> OD #i105270#
+bool EditView::IsCursorInRightToLeftText() const
+{
+    DBG_CHKTHIS( EditView, 0 );
+    DBG_CHKOBJ( pImpEditView->pEditEngine, EditEngine, 0 );
+    DBG_ASSERT( !pImpEditView->aEditSelection.IsInvalid(), "invalid selection found" );
+    const SfxItemSet aItemSet = PIMPEE->GetAttribs( pImpEditView->GetEditSelection() );
+    return ( PIMPEE->IsRightToLeft( aItemSet ) ) ? true : false;
+}            
+// <--
 
 static Image lcl_GetImageFromPngUrl( const OUString &rFileUrl )
 {

File editeng/source/editeng/eerdll.cxx

View file
 		ppDefItems[11]  = new SvxLRSpaceItem( EE_PARA_LRSPACE );
 		ppDefItems[12]  = new SvxULSpaceItem( EE_PARA_ULSPACE );
 		ppDefItems[13]  = new SvxLineSpacingItem( 0, EE_PARA_SBL );
-		ppDefItems[14]  = new SvxAdjustItem( SVX_ADJUST_LEFT, EE_PARA_JUST );
+        // --> OD #i105270#
+        ppDefItems[14]  = new SvxAdjustItem( SVX_ADJUST_START, EE_PARA_JUST );
+        // <--
 		ppDefItems[15]  = new SvxTabStopItem( 0, 0, SVX_TAB_ADJUST_LEFT, EE_PARA_TABS );
 
 		// Zeichenattribute:

File editeng/source/editeng/impedit.hxx

View file
 
 class SvUShorts;
 class SvxNumberFormat;
-
+class SvxFrameDirectionItem;
 
 namespace com {
 namespace sun {
 
     SpellInfo *     CreateSpellInfo( const EditSelection &rSel, bool bMultipleDocs );
 
+    // --> OD #i105270#
+    BOOL ImplIsRightToLeft( const SvxFrameDirectionItem& rFrameDirItem ) const;
+    // <--
+
 protected:
 	virtual void			Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
 
 
 	void				    InitWritingDirections( USHORT nPara );
     BOOL                    IsRightToLeft( USHORT nPara ) const;
+    // --> OD #i105270#
+    BOOL                    IsRightToLeft( const SfxItemSet& rAttribs ) const;
+    // <--
     BYTE                    GetRightToLeft( USHORT nPara, USHORT nChar, USHORT* pStart = NULL, USHORT* pEnd = NULL );
     BOOL                    HasDifferentRTLLevels( const ContentNode* pNode );
 

File editeng/source/editeng/impedit2.cxx

View file
 
 }
 
-BOOL ImpEditEngine::IsRightToLeft( USHORT nPara ) const
+// --> OD #i105270#
+BOOL ImpEditEngine::ImplIsRightToLeft( const SvxFrameDirectionItem& rFrameDirItem ) const
 {
     BOOL bR2L = FALSE;
-    const SvxFrameDirectionItem* pFrameDirItem = NULL;
+    const SvxFrameDirectionItem* pFrameDirItem = 0;
 
     if ( !IsVertical() )
     {
         bR2L = GetDefaultHorizontalTextDirection() == EE_HTEXTDIR_R2L;
-        pFrameDirItem = &(const SvxFrameDirectionItem&)GetParaAttrib( nPara, EE_PARA_WRITINGDIR );
+        pFrameDirItem = &rFrameDirItem;
         if ( pFrameDirItem->GetValue() == FRMDIR_ENVIRONMENT )
         {
             // #103045# if DefaultHorizontalTextDirection is set, use that value, otherwise pool default.
             if ( GetDefaultHorizontalTextDirection() != EE_HTEXTDIR_DEFAULT )
             {
-                pFrameDirItem = NULL; // bR2L allready set to default horizontal text direction
+                pFrameDirItem = 0; // bR2L already set to default horizontal text direction
             }
             else
             {
         }
     }
 
-    if ( pFrameDirItem )
+    if ( pFrameDirItem != 0 )
+    {        
         bR2L = pFrameDirItem->GetValue() == FRMDIR_HORI_RIGHT_TOP;
+    }
 
     return bR2L;
+}            
+
+BOOL ImpEditEngine::IsRightToLeft( USHORT nPara ) const
+{
+    // --> OD #i105270#
+    const SvxFrameDirectionItem& rFrameDirItem( 
+        (const SvxFrameDirectionItem&)(GetParaAttrib( nPara, EE_PARA_WRITINGDIR )) );
+    return ImplIsRightToLeft( rFrameDirItem );
+    // <--
+//    BOOL bR2L = FALSE;
+//    const SvxFrameDirectionItem* pFrameDirItem = NULL;
+
+//    if ( !IsVertical() )
+//    {
+//        bR2L = GetDefaultHorizontalTextDirection() == EE_HTEXTDIR_R2L;
+//        pFrameDirItem = &(const SvxFrameDirectionItem&)GetParaAttrib( nPara, EE_PARA_WRITINGDIR );
+//        if ( pFrameDirItem->GetValue() == FRMDIR_ENVIRONMENT )
+//        {
+//            // #103045# if DefaultHorizontalTextDirection is set, use that value, otherwise pool default.
+//            if ( GetDefaultHorizontalTextDirection() != EE_HTEXTDIR_DEFAULT )
+//            {
+//                pFrameDirItem = NULL; // bR2L allready set to default horizontal text direction
+//            }
+//            else
+//            {
+//                // Use pool default
+//                pFrameDirItem = &(const SvxFrameDirectionItem&)((ImpEditEngine*)this)->GetEmptyItemSet().Get( EE_PARA_WRITINGDIR );
+//            }
+//        }
+//    }
+
+//    if ( pFrameDirItem )
+//        bR2L = pFrameDirItem->GetValue() == FRMDIR_HORI_RIGHT_TOP;
+
+//    return bR2L;
 }
 
+// --> OD #i105270#
+BOOL ImpEditEngine::IsRightToLeft( const SfxItemSet& rAttribs ) const
+{
+    return ImplIsRightToLeft( (const SvxFrameDirectionItem&)(rAttribs.Get( EE_PARA_WRITINGDIR )) );
+}            
+// <--
+
 BOOL ImpEditEngine::HasDifferentRTLLevels( const ContentNode* pNode )
 {
     USHORT nPara = GetEditDoc().GetPos( (ContentNode*)pNode );
 
 SvxAdjust ImpEditEngine::GetJustification( USHORT nPara ) const
 {
-	SvxAdjust eJustification = SVX_ADJUST_LEFT;
+    // --> OD #i105270# - new default
+    SvxAdjust eJustification = SVX_ADJUST_START;
+    // <--
 
     if ( !aStatus.IsOutliner() )
     {
 		eJustification = ((const SvxAdjustItem&) GetParaAttrib( nPara, EE_PARA_JUST )).GetAdjust();
 
+        // The EditEngine text formatting treats SVX_ADJUST_LEFT and SVX_ADJUST_RIGHT
+        // according XSL's <left> and <right> alignment attribute values which state
+        // that the alignment has to be interpreted depending on the writing direction:
+        // - <left> == <start> and <right> == <end>
+        // - <start> means that the content has to be aligned on the start-edge 
+        //   in the writing direction.
+        // - <end> mean that the content has to be aligned on the end-edge in the 
+        //   writing direction.
+        // (Note: no "real" <left> and <right> exist in XSL.)
+        // But for OpenOffice.org "real" <left> and <right> has been established:
+        // - SVX_ADJUST_LEFT means that the content has to be aligned on the 
+        //   left-edge _independent_ from the writing direction.
+        // - SVX_ADJUST_RIGHT means that the content has to be aligned on the 
+        //   right-edge _independent_ from the writing direction.
+        // Thus, in a right-to-left environment the following mappings are made for
+        // the EditEngine text formatting:
+        // - SVX_ADJUST_LEFT is mapped to SVX_ADJUST_RIGHT to get the content
+        //   aligned at the left-edge - the end-edge for a right-to-left paragraph.
+        // - SVX_ADJUST_RIGHT is mapped to SVX_ADJUST_LEFT to get the content
+        //   aligned at the right-edge - the start-edge for a right-to-left paragraph.
         if ( IsRightToLeft( nPara ) )
         {
             if ( eJustification == SVX_ADJUST_LEFT )

File editeng/source/editeng/impedit3.cxx

View file
 				// Die Hoehe kann sich hier nicht mehr aendern.
 				ParaPortion* pParaPortion = GetParaPortions().GetObject( nPara );
 				ContentNode* pNode = pParaPortion->GetNode();
-				SvxAdjust eJustification = GetJustification( nPara );
-				if ( eJustification != SVX_ADJUST_LEFT )
+                const SvxAdjust eJustification = GetJustification( nPara );
+                // --> OD #i105270#
+                if ( eJustification != SVX_ADJUST_LEFT &&
+                     eJustification != SVX_ADJUST_START )
+                // <--
 				{
 					pParaPortion->MarkSelectionInvalid( 0, pNode->Len() );
 					CreateLines( nPara, 0 );	// 0: Bei AutoPageSize kein TextRange!
 	// ---------------------------------------------------------------
 	ContentNode* const pNode = pParaPortion->GetNode();
 
-    BOOL bRightToLeftPara = IsRightToLeft( nPara );
-
-    SvxAdjust eJustification = GetJustification( nPara );
+    const BOOL bRightToLeftPara = IsRightToLeft( nPara );
+
+    const SvxAdjust eJustification = GetJustification( nPara );
 	sal_Bool bHyphenatePara = ((const SfxBoolItem&)pNode->GetContentAttribs().GetItem( EE_PARA_HYPHENATE )).GetValue();
     sal_Int32 nSpaceBefore      = 0;
     sal_Int32 nMinLabelWidth    = 0;
 
 			}
 			break;
-			case SVX_ADJUST_RIGHT:
+            // --> OD #i105270#
+            case SVX_ADJUST_START:
+            case SVX_ADJUST_LEFT:
+            {
+                pLine->SetStartPosX( (sal_uInt16)nStartX ); // FI, LI
+            }
+            break;
+            case SVX_ADJUST_END:
+            case SVX_ADJUST_RIGHT:
 			{
 				// Bei automatisch umgebrochenen Zeilen, die ein Blank
 				// am Ende enthalten, darf das Blank nicht ausgegeben werden!
 					pLine->SetStartPosX( 0 );
 			}
 			break;
+            // <--                    
 			case SVX_ADJUST_BLOCK:
 			{
 				long nRemainingSpace = nMaxLineWidth - aTextSize.Width();
 					ImpAdjustBlocks( pParaPortion, pLine, nRemainingSpace );
 			}
 			break;
-			default:
-			{
-				pLine->SetStartPosX( (sal_uInt16)nStartX ); // FI, LI
-			}
-			break;
+            // --> OD #i105270# - SVX_ADJUST_LEFT now explicit - see above
+            default:
+            {
+                DBG_ASSERT( false, "unsupported text alignment!" );
+            }    
+            // <--
 		}
 
 		// -----------------------------------------------------------------
 	pTmpLine->SetEnd( pParaPortion->GetNode()->Len() );
 	pParaPortion->GetLines().Insert( pTmpLine, pParaPortion->GetLines().Count() );
 
-	sal_Bool bLineBreak = pParaPortion->GetNode()->Len() ? sal_True : sal_False;
+    const sal_Bool bLineBreak = pParaPortion->GetNode()->Len() ? sal_True : sal_False;
     sal_Int32 nSpaceBefore = 0;
-    sal_Int32 nSpaceBeforeAndMinLabelWidth = GetSpaceBeforeAndMinLabelWidth( pParaPortion->GetNode(), &nSpaceBefore );
+    const sal_Int32 nSpaceBeforeAndMinLabelWidth = GetSpaceBeforeAndMinLabelWidth( pParaPortion->GetNode(), &nSpaceBefore );
 	const SvxLRSpaceItem& rLRItem = GetLRSpaceItem( pParaPortion->GetNode() );
 	const SvxLineSpacingItem& rLSItem = (const SvxLineSpacingItem&)pParaPortion->GetNode()->GetContentAttribs().GetItem( EE_PARA_SBL );
     short nStartX = GetXValue( (short)(rLRItem.GetTxtLeft() + rLRItem.GetTxtFirstLineOfst() + nSpaceBefore));
 
 	if ( !aStatus.IsOutliner() )
 	{
-        USHORT nPara = GetParaPortions().GetPos( pParaPortion );
-		SvxAdjust eJustification = GetJustification( nPara );
+        const USHORT nPara = GetParaPortions().GetPos( pParaPortion );
+        const SvxAdjust eJustification = GetJustification( nPara );
 		long nMaxLineWidth = !IsVertical() ? aPaperSize.Width() : aPaperSize.Height();
 		nMaxLineWidth -= GetXValue( rLRItem.GetRight() );
-		long nTextXOffset = 0;
+        const long nTextXOffset = 0;
 		if ( nMaxLineWidth < 0 )
 			nMaxLineWidth = 1;
-		if ( eJustification ==  SVX_ADJUST_CENTER )
+        if ( eJustification == SVX_ADJUST_CENTER )
+        {        
 			nStartX = sal::static_int_cast< short >(nMaxLineWidth / 2);
-		else if ( eJustification ==  SVX_ADJUST_RIGHT )
+        }
+        // --> OD #i105270#
+        else if ( eJustification == SVX_ADJUST_RIGHT ||
+                  eJustification == SVX_ADJUST_END )
+        // <--
+        {        
 			nStartX = sal::static_int_cast< short >(nMaxLineWidth);
+        }
 
 		nStartX = sal::static_int_cast< short >(nStartX + nTextXOffset);
 	}
 
 	if ( !bCompressBlank && !bHangingPunctuation )
 	{
-		// #96187# When justification is not SVX_ADJUST_LEFT, it's important to compress
-		// the trailing space even if there is enough room for the space...
-		// Don't check for SVX_ADJUST_LEFT, doesn't matter to compress in this case too...
 		DBG_ASSERT( nBreakPos > pLine->GetStart(), "ImpBreakLines - BreakPos not expected!" );
 		if ( pNode->GetChar( nBreakPos-1 ) == ' ' )
 			bCompressBlank = sal_True;

File editeng/source/items/paraitem.cxx

View file
 #include <com/sun/star/style/TabStop.hpp>
 #include <com/sun/star/style/LineSpacing.hpp>
 #include <com/sun/star/style/LineSpacingMode.hpp>
+#include <com/sun/star/style/ParagraphAdjust.hpp>
+#include <com/sun/star/style/ParagraphTextAlignment.hpp>
 #include <com/sun/star/uno/Sequence.hxx>
 #include <comphelper/processfactory.hxx>
 #include <unotools/syslocale.hxx>
 
 SvxAdjustItem::SvxAdjustItem(const SvxAdjust eAdjst, const sal_uInt16 nId )
     : SfxEnumItemInterface( nId )
-    // --> OD 2010-10-28 #i105270#
-    , meAdjust( SVX_ADJUST_LEFT )
+    , meAdjust( SVX_ADJUST_START )
     , meLastLineAdjust( SVX_ADJUST_LEFT )
     , mbOneWordBlocked( false )
-    // <--
 {
 	SetAdjust( eAdjst );
 }
 --------------------------------------------------*/
 sal_Bool SvxAdjustItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const
 {
+    sal_Bool bSuccess = sal_True;
+
     nMemberId &= ~CONVERT_TWIPS;
 	switch( nMemberId )
 	{
-		case MID_PARA_ADJUST	  :	rVal <<= (sal_Int16)GetAdjust(); break;
+        case MID_PARA_ADJUST:
+        {
+            style::ParagraphAdjust eUno = style::ParagraphAdjust_LEFT;
+            switch ( GetAdjust() )
+            {
+                case SVX_ADJUST_LEFT: eUno = style::ParagraphAdjust_LEFT; break;
+                case SVX_ADJUST_RIGHT: eUno = style::ParagraphAdjust_RIGHT; break;
+                case SVX_ADJUST_BLOCK: eUno = style::ParagraphAdjust_BLOCK; break;
+                case SVX_ADJUST_CENTER: eUno = style::ParagraphAdjust_CENTER; break;
+                case SVX_ADJUST_BLOCKLINE: eUno = style::ParagraphAdjust_STRETCH; break;
+                default:
+                    {
+                        DBG_ASSERT( false, 
+                                    "<SvxAdjustItem::QueryValue( MID_PARA_ADJUST ) - item contains unsupported value for com::sun::star::style::ParagraphProperties::ParaAdjust - conversion needed" );
+                        bSuccess = sal_False;
+                    }            
+                    break;
+            }
+            rVal <<= eUno;
+        }
+        break;        
         case MID_LAST_LINE_ADJUST : rVal <<= (sal_Int16)GetLastLineAdjust(); break;
 		case MID_EXPAND_SINGLE    :
 		{
 			rVal.setValue( &bValue, ::getCppuBooleanType() );
 			break;
 		}
+        // --> OD #i105270#
+        case MID_PARA_TEXT_ALIGN:
+        {
+            style::ParagraphTextAlignment eUno = style::ParagraphTextAlignment_START;
+            switch ( GetAdjust() )
+            {
+                case SVX_ADJUST_START: eUno = style::ParagraphTextAlignment_START; break;
+                case SVX_ADJUST_END: eUno = style::ParagraphTextAlignment_END; break;
+                case SVX_ADJUST_BLOCK: eUno = style::ParagraphTextAlignment_BLOCK; break;
+                case SVX_ADJUST_CENTER: eUno = style::ParagraphTextAlignment_CENTER; break;
+                default:
+                    {
+                        DBG_ASSERT( false, 
+                                    "<SvxAdjustItem::QueryValue( MID_PARA_TEXT_ALIGN ) - item contains unsupported value for com::sun::star::style::ParagraphProperties::ParaTextAlign - conversion needed" );
+                        bSuccess = sal_False;
+                    }            
+                    break;
+            }
+            rVal <<= eUno;
+        }
+        break;
+        // <--
         default: ;//prevent warning
     }
-	return sal_True;
+    return bSuccess;
 }
 /*-----------------18.03.98 16:15-------------------
 
 
 sal_Bool SvxAdjustItem::PutValue( const uno::Any& rVal, BYTE nMemberId  )
 {
-//    sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS);
+    sal_Bool bSuccess = sal_True;
+    
     nMemberId &= ~CONVERT_TWIPS;
 	switch( nMemberId )
 	{
-		case MID_PARA_ADJUST			  :
+        case MID_PARA_ADJUST :
 		case MID_LAST_LINE_ADJUST :
 		{
-			sal_Int32 eVal = - 1;
-			try
-			{
-				eVal = ::comphelper::getEnumAsINT32(rVal);
-			}
-			catch(...) {}
+            style::ParagraphAdjust eUno;
+            if ( !(rVal >>= eUno) )
+            {
+                sal_Int32 nValue = 0;
+                if ( !(rVal >>= nValue) )
+                    return sal_False;
+                eUno = (style::ParagraphAdjust)nValue;
+            }
+            SvxAdjust eSvx = SVX_ADJUST_LEFT;
+            switch (eUno)
+            {
+                case style::ParagraphAdjust_LEFT:    eSvx = SVX_ADJUST_LEFT;      break;
+                case style::ParagraphAdjust_RIGHT:   eSvx = SVX_ADJUST_RIGHT;     break;
+                case style::ParagraphAdjust_BLOCK:   eSvx = SVX_ADJUST_BLOCK;     break;
+                case style::ParagraphAdjust_CENTER:  eSvx = SVX_ADJUST_CENTER;    break;
+                case style::ParagraphAdjust_STRETCH: eSvx = SVX_ADJUST_BLOCKLINE; break;
+                default: ; //prevent warning
+                    {
+                        DBG_ASSERT( false, 
+                                    "<SvxAdjustItem::PutValue( MID_PARA_ADJUST|MID_LAST_LINE_ADJUST ) - value contains unsupported value for com::sun::star::style::ParagraphProperties::ParaAdjust - conversion needed" );
+                        bSuccess = sal_False;
+                    }
+            }
             
-            if ( eVal >= 0 && eVal < (sal_uInt16)SVX_ADJUST_INVALID_ENUM_END )
-			{
-                if ( MID_LAST_LINE_ADJUST == nMemberId &&
-                     eVal != SVX_ADJUST_LEFT &&
-                     eVal != SVX_ADJUST_BLOCK &&
-                     eVal != SVX_ADJUST_CENTER )
-                {
-                        return sal_False;
-                }
+            if ( MID_LAST_LINE_ADJUST == nMemberId &&
+                 eSvx != SVX_ADJUST_LEFT &&
+                 eSvx != SVX_ADJUST_BLOCK &&
+                 eSvx != SVX_ADJUST_CENTER )
+            {
+                    return sal_False;
+            }
                 
-                nMemberId == MID_PARA_ADJUST 
-                ? SetAdjust((SvxAdjust)eVal) 
-                : SetLastLineAdjust((SvxAdjust)eVal);
-			}
+            nMemberId == MID_PARA_ADJUST 
+            ? SetAdjust(eSvx) 
+            : SetLastLineAdjust(eSvx);
 		}
 		break;
 		case MID_EXPAND_SINGLE :
             SetOneWordBlocked( Any2Bool(rVal) );
 			break;
-	}
-	return sal_True;
+        // --> OD #i105270#
+        case MID_PARA_TEXT_ALIGN :
+        {
+            style::ParagraphTextAlignment eUno;
+            if ( !(rVal >>= eUno) )
+            {
+                sal_Int32 nValue = 0;
+                if ( !(rVal >>= nValue) )
+                    return sal_False;
+                eUno = (style::ParagraphTextAlignment)nValue;
+            }
+            SvxAdjust eSvx = SVX_ADJUST_START;
+            switch (eUno)
+            {
+                case style::ParagraphTextAlignment_START:  eSvx = SVX_ADJUST_START;  break;
+                case style::ParagraphTextAlignment_END:    eSvx = SVX_ADJUST_END;    break;
+                case style::ParagraphTextAlignment_BLOCK:  eSvx = SVX_ADJUST_BLOCK;  break;
+                case style::ParagraphTextAlignment_CENTER: eSvx = SVX_ADJUST_CENTER; break;
+                default: ; //prevent warning
+                    {
+                        DBG_ASSERT( false, 
+                                    "<SvxAdjustItem::PutValue( MID_PARA_TEXT_ALIGN ) - value contains unsupported value for com::sun::star::style::ParagraphProperties::ParaTextAlign - conversion needed" );
+                        bSuccess = sal_False;
+                    }
+            }
+            
+            SetAdjust(eSvx) ;
+        }
+        break;
+        // <--
+    }
+    return bSuccess;
 }
 
 // -----------------------------------------------------------------------

File editeng/source/items/svxitems.src

View file
 {
 	Text [ en-US ] = "Justify" ;
 };
+String RID_SVXITEMS_ADJUST_START
+{
+    Text [ en-US ] = "Align at start" ;
+};
+String RID_SVXITEMS_ADJUST_END
+{
+    Text [ en-US ] = "Align at end" ;
+};
  // enum SvxTabAdjust --------------------------------------------------------
 String RID_SVXITEMS_TAB_DECIMAL_CHAR
 {

File editeng/source/outliner/outliner.cxx

View file
 		{
 			// Bei zentriert/rechtsbuendig anpassen
 			const SvxAdjustItem& rItem = (const SvxAdjustItem&)pEditEngine->GetParaAttrib( nPara, EE_PARA_JUST );
-			if ( ( !pEditEngine->IsRightToLeft( nPara ) && ( rItem.GetAdjust() != SVX_ADJUST_LEFT ) ) ||
-				 ( pEditEngine->IsRightToLeft( nPara ) && ( rItem.GetAdjust() != SVX_ADJUST_RIGHT ) ) )
+            // --> OD #i105270#
+            if ( ( !pEditEngine->IsRightToLeft( nPara ) && 
+                   ( rItem.GetAdjust() != SVX_ADJUST_LEFT ) &&
+                   ( rItem.GetAdjust() != SVX_ADJUST_START ) ) ||
+                 ( pEditEngine->IsRightToLeft( nPara ) && 
+                   ( rItem.GetAdjust() != SVX_ADJUST_RIGHT ) &&
+                   ( rItem.GetAdjust() != SVX_ADJUST_END ) ) )
+            // <--
 			{
 				aTopLeft.X() = pEditEngine->GetFirstLineStartX( nPara ) - nBulletWidth;
 			}

File editeng/source/outliner/outlvw.cxx

View file
 	pEditView->SpellIgnoreWord();
 }
 
+// --> OD #i105270#
+bool OutlinerView::IsCursorInRightToLeftText() const
+{
+    DBG_CHKTHIS(OutlinerView,0);
+    return pEditView->IsCursorInRightToLeftText();
+}
+// <--
 
 void OutlinerView::ExecuteSpellPopup( const Point& rPosPixel, Link* pStartDlg )
 {

File forms/source/richtext/rtattributehandler.cxx

View file
 	//--------------------------------------------------------------------
     ParaAlignmentHandler::ParaAlignmentHandler( AttributeId _nAttributeId )
         :AttributeHandler( _nAttributeId, EE_PARA_JUST )
-        ,m_eAdjust( SVX_ADJUST_CENTER )
+        ,m_eAdjustForLTR( SVX_ADJUST_CENTER )
+        ,m_eAdjustForRTL( SVX_ADJUST_CENTER )
     {
         switch ( getAttribute() )
         {
-            case SID_ATTR_PARA_ADJUST_LEFT  : m_eAdjust = SVX_ADJUST_LEFT;    break;
-	    	case SID_ATTR_PARA_ADJUST_CENTER: m_eAdjust = SVX_ADJUST_CENTER;  break;
-		    case SID_ATTR_PARA_ADJUST_RIGHT : m_eAdjust = SVX_ADJUST_RIGHT;   break;
-		    case SID_ATTR_PARA_ADJUST_BLOCK : m_eAdjust = SVX_ADJUST_BLOCK;   break;
+            // --> OD #i105270#
+            case SID_ATTR_PARA_ADJUST_LEFT: 
+                m_eAdjustForLTR = SVX_ADJUST_START;
+                m_eAdjustForRTL = SVX_ADJUST_END;
+                break;
+            case SID_ATTR_PARA_ADJUST_CENTER:
+                m_eAdjustForLTR = m_eAdjustForRTL = SVX_ADJUST_CENTER;
+                break;
+            case SID_ATTR_PARA_ADJUST_RIGHT:
+                m_eAdjustForLTR = SVX_ADJUST_END;
+                m_eAdjustForRTL = SVX_ADJUST_START;
+                break;
+            case SID_ATTR_PARA_ADJUST_BLOCK:
+                m_eAdjustForLTR = SVX_ADJUST_BLOCK;
+                m_eAdjustForRTL = SVX_ADJUST_BLOCK;
+                break;
+            // <--
             default:
                 OSL_ENSURE( sal_False, "ParaAlignmentHandler::ParaAlignmentHandler: invalid slot!" );
                 break;
     }
 
 	//--------------------------------------------------------------------
-    AttributeCheckState ParaAlignmentHandler::implGetCheckState( const SfxPoolItem& _rItem ) const
+    // --> OD #i105270#
+    AttributeState ParaAlignmentHandler::getState( const SfxItemSet& _rAttribs ) const
     {
-        OSL_ENSURE( _rItem.ISA( SvxAdjustItem ), "ParaAlignmentHandler::implGetCheckState: invalid pool item!" );
-        SvxAdjust eAdjust = static_cast< const SvxAdjustItem& >( _rItem ).GetAdjust();
-        return ( eAdjust == m_eAdjust ) ? eChecked : eUnchecked;
+        AttributeState aState( eIndetermined );
+
+        const SfxPoolItem* pItem = _rAttribs.GetItem( getWhich() );
+        if ( pItem )
+        {        
+            OSL_ENSURE( pItem->ISA( SvxAdjustItem ), "ParaAlignmentHandler::getState: invalid pool item!" );
+            const SvxAdjust eAdjust = static_cast< const SvxAdjustItem* >(pItem)->GetAdjust();
+
+            bool bRTL = false;
+            {
+                pItem = _rAttribs.GetItem( EE_PARA_WRITINGDIR );
+                if ( pItem && pItem->ISA( SvxFrameDirectionItem ) )
+                {
+                    bRTL = 
+                        static_cast< const SvxFrameDirectionItem* >(pItem)->GetValue() == FRMDIR_HORI_RIGHT_TOP;
+                }
+            }
+
+            if ( bRTL )
+            {
+                aState.eSimpleState = ( eAdjust == m_eAdjustForRTL ) ? eChecked : eUnchecked;
+            }
+            else
+            {
+                aState.eSimpleState = ( eAdjust == m_eAdjustForLTR ) ? eChecked : eUnchecked;
+            }            
+        }
+
+        return aState;
     }
+    // <--
 
 	//--------------------------------------------------------------------
-    void ParaAlignmentHandler::executeAttribute( const SfxItemSet& /*_rCurrentAttribs*/, SfxItemSet& _rNewAttribs, const SfxPoolItem* _pAdditionalArg, ScriptType /*_nForScriptType*/ ) const
+    void ParaAlignmentHandler::executeAttribute( const SfxItemSet& _rCurrentAttribs, 
+                                                 SfxItemSet& _rNewAttribs, 
+                                                 const SfxPoolItem* _pAdditionalArg, 
+                                                 ScriptType /*_nForScriptType*/ ) const
     {
         OSL_ENSURE( !_pAdditionalArg, "ParaAlignmentHandler::executeAttribute: this is a simple toggle attribute - no args possible!" );
         (void)_pAdditionalArg;
-        _rNewAttribs.Put( SvxAdjustItem( m_eAdjust, getWhich() ) );
+
+        // --> OD #i105270#
+        bool bRTL = false;
+        {
+            const SfxPoolItem* pItem = _rCurrentAttribs.GetItem( EE_PARA_WRITINGDIR );
+            if ( pItem && pItem->ISA( SvxFrameDirectionItem ) )
+            {
+                bRTL = static_cast< const SvxFrameDirectionItem* >(pItem)->GetValue() == FRMDIR_HORI_RIGHT_TOP;
+            }
+        }
+
+        if ( bRTL )
+        {
+            _rNewAttribs.Put( SvxAdjustItem( m_eAdjustForRTL, getWhich() ) );
+        }
+        else
+        {
+            _rNewAttribs.Put( SvxAdjustItem( m_eAdjustForLTR, getWhich() ) );
+        }            
+        // <--
     }
 
     //====================================================================
     ParagraphDirectionHandler::ParagraphDirectionHandler( AttributeId _nAttributeId )
         :AttributeHandler( _nAttributeId, EE_PARA_WRITINGDIR )
         ,m_eParagraphDirection( FRMDIR_HORI_LEFT_TOP )
-        ,m_eDefaultAdjustment( SVX_ADJUST_RIGHT )
-        ,m_eOppositeDefaultAdjustment( SVX_ADJUST_LEFT )
+        ,m_eDefaultAdjustment( SVX_ADJUST_START )
+        ,m_eLegacyOppositeDefaultAdjustment( SVX_ADJUST_RIGHT )
     {
         switch ( getAttributeId() )
         {
-            case SID_ATTR_PARA_LEFT_TO_RIGHT: m_eParagraphDirection = FRMDIR_HORI_LEFT_TOP; m_eDefaultAdjustment = SVX_ADJUST_LEFT; break;
-            case SID_ATTR_PARA_RIGHT_TO_LEFT: m_eParagraphDirection = FRMDIR_HORI_RIGHT_TOP; m_eDefaultAdjustment = SVX_ADJUST_RIGHT; break;
+            case SID_ATTR_PARA_LEFT_TO_RIGHT: 
+                m_eParagraphDirection = FRMDIR_HORI_LEFT_TOP;
+                m_eLegacyOppositeDefaultAdjustment = SVX_ADJUST_RIGHT;
+                break;
+            case SID_ATTR_PARA_RIGHT_TO_LEFT: 
+                m_eParagraphDirection = FRMDIR_HORI_RIGHT_TOP; 
+                m_eLegacyOppositeDefaultAdjustment = SVX_ADJUST_LEFT;
+                break;
             default:
                 OSL_ENSURE( sal_False, "ParagraphDirectionHandler::ParagraphDirectionHandler: invalid attribute id!" );
         }
-
-        if ( SVX_ADJUST_RIGHT == m_eDefaultAdjustment )
-            m_eOppositeDefaultAdjustment = SVX_ADJUST_LEFT;
-        else
-            m_eOppositeDefaultAdjustment = SVX_ADJUST_RIGHT;
     }
 
 	//--------------------------------------------------------------------
     AttributeCheckState ParagraphDirectionHandler::implGetCheckState( const SfxPoolItem& _rItem ) const
     {
         OSL_ENSURE( _rItem.ISA( SvxFrameDirectionItem ), "ParagraphDirectionHandler::implGetCheckState: invalid pool item!" );
-        SvxFrameDirection eDirection = static_cast< SvxFrameDirection >( static_cast< const SvxFrameDirectionItem& >( _rItem ).GetValue() );
+        const SvxFrameDirection eDirection = static_cast< SvxFrameDirection >( static_cast< const SvxFrameDirectionItem& >( _rItem ).GetValue() );
         return ( eDirection == m_eParagraphDirection ) ? eChecked : eUnchecked;
     }
 
     {
         _rNewAttribs.Put( SvxFrameDirectionItem( m_eParagraphDirection, getWhich() ) );
 
-        // if the current adjustment of the was the default adjustment for the *previous* text direction,
-        // then we toggle the adjustment, too
-        SvxAdjust eCurrentAdjustment = SVX_ADJUST_LEFT;
+        // --> OD #i105270#
+        // if the current adjustment was the legacy default adjustment for 
+        // the *previous* text direction, apply default adjustment.
+        SvxAdjust eCurrentAdjustment = m_eDefaultAdjustment;
         const SfxPoolItem* pCurrentAdjustment = NULL;
         if ( SFX_ITEM_ON == _rCurrentAttribs.GetItemState( EE_PARA_JUST, TRUE, &pCurrentAdjustment ) )
+        {        
             eCurrentAdjustment = static_cast< const SvxAdjustItem* >( pCurrentAdjustment )->GetAdjust();
-
-        if ( eCurrentAdjustment == m_eOppositeDefaultAdjustment )
+        }
+        
+        if ( eCurrentAdjustment == m_eLegacyOppositeDefaultAdjustment )
+        {
             _rNewAttribs.Put( SvxAdjustItem( m_eDefaultAdjustment, EE_PARA_JUST ) );
+        }
+        // <--
     }
 
     //====================================================================

File forms/source/richtext/rtattributehandler.hxx

View file
     class ParaAlignmentHandler : public AttributeHandler
     {
     private:
-        SvxAdjust   m_eAdjust;
+        // --> OD #i105270#
+        SvxAdjust   m_eAdjustForLTR;
+        SvxAdjust   m_eAdjustForRTL;
+        // <--
 
     public:
         ParaAlignmentHandler( AttributeId _nAttributeId );
 
     public:
-        virtual     AttributeCheckState implGetCheckState( const SfxPoolItem& _rItem ) const;
+        // --> OD #i105270# - implement <getState(..)> instead of <implGetCheckState(..)>
+        virtual     AttributeState  getState( const SfxItemSet& _rAttribs ) const;
+        // <--
         virtual     void                executeAttribute( const SfxItemSet& _rCurrentAttribs, SfxItemSet& _rNewAttribs, const SfxPoolItem* _pAdditionalArg, ScriptType _nForScriptType ) const;
     };
 
     {
     private:
         SvxFrameDirection   m_eParagraphDirection;
-        SvxAdjust           m_eDefaultAdjustment;
-        SvxAdjust           m_eOppositeDefaultAdjustment;
+        // --> OD #i105270# 
+        // - for legacy documents/extensions which are still using
+        //   SVX_ADJUST_LEFT and SVX_ADJUST_RIGHT resp. the corresponding legacy UNO_API
+        const SvxAdjust     m_eDefaultAdjustment;
+        SvxAdjust           m_eLegacyOppositeDefaultAdjustment;
+        // <--
 
     public:
         ParagraphDirectionHandler( AttributeId _nAttributeId );

File offapi/com/sun/star/style/ParagraphProperties.idl

View file
 #include <com/sun/star/style/ParagraphAdjust.idl>
 #endif
 
+#ifndef __com_sun_star_style_ParagraphTextAlignment_idl__
+#include <com/sun/star/style/ParagraphTextAlignment.idl>
+#endif
+
 #ifndef __com_sun_star_util_Color_idl__
 #include <com/sun/star/util/Color.idl>
 #endif
  */
 published service ParagraphProperties
 {
-	//-------------------------------------------------------------------------
+        //-------------------------------------------------------------------------
 
-	/** determines the adjustment of a paragraph.
-	 */
-	[property] com::sun::star::style::ParagraphAdjust ParaAdjust;
+        /** determines the adjustment of a paragraph.
+         
+            <p>Setting value <const>ParagraphAdjust::STRETCH</const> has the effect
+            that <member>ParagraphProperties::ParaAdjust</member> is set to 
+            <const>ParagraphAdjust::BLOCK</const> and 
+            <member>>ParagraphProperties::ParaLastLineAdjust</member> is set to
+            <const>ParagraphAdjust::BLOCK</const>.</p>
+            
+            @deprecated in favor of property <member>ParagraphProperties::ParaTextAlign</member>
+         */
+        [property] com::sun::star::style::ParagraphAdjust ParaAdjust;
+
+        //-------------------------------------------------------------------------
+
+        /** determines the alignment of the text of a paragraph.
+         
+            <p>introduced to replace property <member>ParagraphProperties::ParaAdjust</member></p>
+         
+            @since OOo 3.4
+         */
+        [optional, property] com::sun::star::style::ParagraphTextAlignment ParaTextAlign;
 
 	//-------------------------------------------------------------------------
 

File offapi/com/sun/star/style/ParagraphTextAlignment.idl

View file
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef __com_sun_star_style_ParagraphTextAlignment_idl__ 
+#define __com_sun_star_style_ParagraphTextAlignment_idl__ 
+ 
+ 
+//============================================================================= 
+ 
+ module com {  module sun {  module star {  module style {  
+ 
+//============================================================================= 
+ 
+/** These enumeration values describe the alignment of the text of a paragraph.
+ */
+published enum ParagraphTextAlignment
+{ 
+	//------------------------------------------------------------------------- 
+	 
+        /** align text at the border at which the text starts
+	 */
+        START, 
+ 
+	//------------------------------------------------------------------------- 
+	 
+        /** align text at the border at which the text ends
+	 */
+        END, 
+ 
+	//------------------------------------------------------------------------- 
+	 
+        /** stretch the text inside the available area
+	 */
+	BLOCK, 
+ 
+	//------------------------------------------------------------------------- 
+	 
+        /** center the text inside the available area
+	 */
+        CENTER 
+ 
+}; 
+ 
+//============================================================================= 
+ 
+}; }; }; };  
+ 
+/*============================================================================= 
+ 
+=============================================================================*/ 
+#endif 

File offapi/com/sun/star/style/makefile.mk

View file
 	ParagraphPropertiesComplex.idl\
 	ParagraphStyle.idl\
 	ParagraphStyleCategory.idl\
+        ParagraphTextAlignment.idl\
 	Style.idl\
 	StyleFamilies.idl\
 	StyleFamily.idl\

File offapi/com/sun/star/table/CellProperties.idl

View file
 #include <com/sun/star/table/ShadowFormat.idl>
 #endif
 
+#ifndef __com_sun_star_table_CellTextAlignment_idl__
+#include <com/sun/star/table/CellTextAlignment.idl>
+#endif
+
 #ifndef __com_sun_star_table_CellHoriJustify_idl__
 #include <com/sun/star/table/CellHoriJustify.idl>
 #endif
 	//-------------------------------------------------------------------------
 
 	/** contains the horizontal alignment of the cell contents.
+         
+            @deprecated in favor of property <member>CellProperties::CellTextAlign</member>
 	 */
 	[property] com::sun::star::table::CellHoriJustify HoriJustify;
 
 	//-------------------------------------------------------------------------
 
+        /** contains the horizontal alignment of the cell contents.
+         
+            <p>introduced to replace property <member>CellProperties::HoriJustify</member></p>    
+         
+            @since OOo 3.4
+         */
+        [optional, property] com::sun::star::table::CellTextAlignment CellTextAlign;
+
+        //-------------------------------------------------------------------------
 	/** contains the vertical alignment of the cell contents.
 	 */
 	[property] com::sun::star::table::CellVertJustify VertJustify;

File offapi/com/sun/star/table/CellTextAlignment.idl

View file
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef __com_sun_star_table_CellTextAlignment_idl__
+#define __com_sun_star_table_CellTextAlignment_idl__
+
+//=============================================================================
+
+module com {  module sun {  module star {  module table {
+
+//=============================================================================
+
+/** specifies how cell contents are aligned horizontally.
+ */
+published enum CellTextAlignment
+{
+	//-------------------------------------------------------------------------
+
+        /** default alignment is used (start for numbers, end for text).
+	 */
+	STANDARD,
+
+	//-------------------------------------------------------------------------
+
+        /** contents are aligned at the edge of the cell at which the text starts
+	 */
+        START,
+
+	//-------------------------------------------------------------------------
+
+	/** contents are horizontally centered.
+	 */
+	CENTER,
+
+	//-------------------------------------------------------------------------
+
+        /** contents are aligned to the edge of the cell at which the text ends
+	 */
+        END,
+
+	//-------------------------------------------------------------------------
+
+	/** contents are justified to the cell width.
+	 */
+	BLOCK,
+
+	//-------------------------------------------------------------------------
+
+	/** contents are repeated to fill the cell.
+	 */
+	REPEAT
+
+};
+
+//=============================================================================
+
+}; }; }; };
+
+#endif
+

File offapi/com/sun/star/table/makefile.mk

View file
 	CellOrientation.idl\
 	CellProperties.idl\
 	CellRange.idl\
-	CellRangeAddress.idl\
+        CellRangeAddress.idl\
+        CellTextAlignment.idl\
 	CellVertJustify.idl\
 	ShadowFormat.idl\
 	ShadowLocation.idl\

File sc/source/ui/view/gridwin.cxx

View file
 		case SVX_HOR_JUSTIFY_BLOCK:
 				eSvxAdjust = SVX_ADJUST_BLOCK;
 				break;
+        default: ; // prevent warning
 	}
     aDefault.Put( SvxAdjustItem( eSvxAdjust, EE_PARA_JUST ) );
 	aEngine.SetDefaults( aDefault );

File sc/source/ui/view/output2.cxx

View file
 										case SVX_HOR_JUSTIFY_BLOCK:
 											eSvxAdjust = SVX_ADJUST_BLOCK;
 											break;
-									}
+                                        default: ; // prevent warning
+                                    }
 								else
 									switch (eVerJust)
 									{

File starmath/sdi/smitems.sdi

View file
 	SVX_ADJUST_BLOCK,
 	SVX_ADJUST_CENTER,
 	SVX_ADJUST_BLOCKLINE,
+        SVX_ADJUST_START,
+        SVX_ADJUST_END,
         SVX_ADJUST_INVALID_ENUM_END
 };
 item SvxAdjust SvxAdjustItem;
 	SVX_HOR_JUSTIFY_CENTER,
 	SVX_HOR_JUSTIFY_RIGHT,
 	SVX_HOR_JUSTIFY_BLOCK,
-	SVX_HOR_JUSTIFY_REPEAT
+        SVX_HOR_JUSTIFY_REPEAT,
+        SVX_HOR_JUSTIFY_START,
+        SVX_HOR_JUSTIFY_END
 };
 item SvxCellHorJustifyEnum SvxCellHorJustifyEnumItem;
 

File svx/inc/svx/svxids.hrc

View file
 #define SID_TRANSLITERATE_SENTENCE_CASE                 (SID_SVX_START+1102)
 #define SID_TRANSLITERATE_TITLE_CASE                    (SID_SVX_START+1103)
 #define SID_TRANSLITERATE_TOGGLE_CASE                   (SID_SVX_START+1104)
+#define SID_ENVIRONMENT_TEXTDIRECTION                   (SID_SVX_START+1105)
 
 // IMPORTANT NOTE: adjust SID_SVX_FIRSTFREE, when adding new slot id
-#define SID_SVX_FIRSTFREE								(SID_TRANSLITERATE_TOGGLE_CASE + 1)
+#define SID_SVX_FIRSTFREE                               (SID_ENVIRONMENT_TEXTDIRECTION + 1)
 
 // --------------------------------------------------------------------------
 // Overflow check for slot IDs

File svx/inc/svx/svxitems.hrc

View file
 #define RID_SVXITEMS_CHARSET_SYSTEM			(RID_SVXITEMS_START + 154)
 #define RID_SVXITEMS_CHARSET_SYMBOL			(RID_SVXITEMS_START + 155)
 
-// enum SvxCellHorJustify
-#define RID_SVXITEMS_HORJUST_STANDARD		(RID_SVXITEMS_START + 400)
-#define RID_SVXITEMS_HORJUST_LEFT			(RID_SVXITEMS_START + 401)
-#define RID_SVXITEMS_HORJUST_CENTER			(RID_SVXITEMS_START + 402)
-#define RID_SVXITEMS_HORJUST_RIGHT			(RID_SVXITEMS_START + 403)
-#define RID_SVXITEMS_HORJUST_BLOCK			(RID_SVXITEMS_START + 404)
-#define RID_SVXITEMS_HORJUST_REPEAT			(RID_SVXITEMS_START + 405)
+// --> OD #i105270#
+// defines for enum SvxCellHorJustify removed here and added at end, because enum has been extented
+// <--
 
 // enum SvxCellVerJustify
 #define RID_SVXITEMS_VERJUST_STANDARD		(RID_SVXITEMS_START + 406)
 #define RID_SVXITEMS_BRUSH_CHAR				(RID_SVXITEMS_START + 527)
 #define RID_ATTR_NAMES                      (RID_SVXITEMS_START + 528)
 
+// --> OD #i105270#
+// enum SvxCellHorJustify
+#define RID_SVXITEMS_HORJUST_STANDARD                   (RID_SVXITEMS_START + 529)
+#define RID_SVXITEMS_HORJUST_LEFT                       (RID_SVXITEMS_START + 530)
+#define RID_SVXITEMS_HORJUST_CENTER                     (RID_SVXITEMS_START + 531)
+#define RID_SVXITEMS_HORJUST_RIGHT                      (RID_SVXITEMS_START + 532)
+#define RID_SVXITEMS_HORJUST_BLOCK                      (RID_SVXITEMS_START + 533)
+#define RID_SVXITEMS_HORJUST_REPEAT                     (RID_SVXITEMS_START + 534)
+#define RID_SVXITEMS_HORJUST_START                      (RID_SVXITEMS_START + 535)
+#define RID_SVXITEMS_HORJUST_END                        (RID_SVXITEMS_START + 536)
+
 // Ueberlaufpruefung --------------------------------------------------------
 
 // Resource-Id's
-#define ACT_RID_SVXITEMS_END    RID_ATTR_NAMES
+#define ACT_RID_SVXITEMS_END    RID_SVXITEMS_HORJUST_END
 #if ACT_RID_SVXITEMS_END > RID_SVXITEMS_END
 #error Resource-Ueberlauf in #line, #file
 #endif

File svx/inc/svx/unomid.hxx

View file
 #ifndef _SVX_UNOMID_HXX
 #define _SVX_UNOMID_HXX
 
-//AdjustItem
-#define MID_PARA_ADJUST			0
-#define MID_LAST_LINE_ADJUST    1
-#define MID_EXPAND_SINGLE       2
-
 //SvxPageItem
 #define MID_PAGE_NUMTYPE		0
 #define MID_PAGE_ORIENTATION    1
 // SvxHorJustifyItem
 #define MID_HORJUST_HORJUST		0
 #define MID_HORJUST_ADJUST		1
+#define MID_HORJUST_TEXT_ALIGN  2
 
 // SvxZoomItem
 #define MID_VALUE               2

File svx/sdi/svxitems.sdi

View file
 	SVX_HOR_JUSTIFY_CENTER,
 	SVX_HOR_JUSTIFY_RIGHT,
 	SVX_HOR_JUSTIFY_BLOCK,
-	SVX_HOR_JUSTIFY_REPEAT
+        SVX_HOR_JUSTIFY_REPEAT,
+        SVX_HOR_JUSTIFY_START,
+        SVX_HOR_JUSTIFY_END
 };
 item SvxCellHorJustifyEnum SvxCellHorJustifyEnumItem;
 
 	SVX_ADJUST_BLOCK,
 	SVX_ADJUST_CENTER,
 	SVX_ADJUST_BLOCKLINE,
+        SVX_ADJUST_START,
+        SVX_ADJUST_END,
         SVX_ADJUST_INVALID_ENUM_END
 };
 

File svx/source/dialog/paraprev.cxx

View file
     nFirstLineOfst  ( 0 ),
     nUpper          ( 0 ),
 	nLower			( 0 ),
-	eAdjust			( SVX_ADJUST_LEFT ),
-	eLastLine       ( SVX_ADJUST_LEFT ),
+    eAdjust         ( SVX_ADJUST_LEFT ),
+    eLastLine       ( SVX_ADJUST_LEFT ),
 	eLine			( SVX_PREV_LINESPACE_1 ),
 	nLineVal		( 0 )
 

File svx/source/form/formcontrolfactory.cxx

View file
             "CharFontPitchComplex",
             "CharPostureComplex",
             "CharLocaleComplex",
-            "ParaAdjust",
+            // --> OD #i105270#
+//            "ParaAdjust",
+            "ParaTextAlign",
+            // <--
             "ParaLineSpacing",
             "ParaBackColor",
             "ParaBackTransparent",

File svx/source/items/algitem.cxx

View file
 #include <com/sun/star/util/SortFieldType.hpp>
 #include <com/sun/star/table/CellOrientation.hpp>
 #include <com/sun/star/table/CellAddress.hpp>
+#include <com/sun/star/table/CellTextAlignment.hpp>
 
 #include <svx/algitem.hxx>
 #include <svx/dialmgr.hxx>
 
 sal_Bool SvxHorJustifyItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const
 {
-//    sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS);
+    sal_Bool bSuccess = sal_True;
+    
     nMemberId &= ~CONVERT_TWIPS;
 	switch ( nMemberId )
 	{
 					case SVX_HOR_JUSTIFY_RIGHT:	   eUno = table::CellHoriJustify_RIGHT;	   break;
 					case SVX_HOR_JUSTIFY_BLOCK:	   eUno = table::CellHoriJustify_BLOCK;	   break;
 					case SVX_HOR_JUSTIFY_REPEAT:   eUno = table::CellHoriJustify_REPEAT;   break;
+                    default: 
+                        {
+                            DBG_ASSERT( false, 
+                                        "<SvxHorJustifyItem::QueryValue( MID_HORJUST_HORJUST ) - item contains unsupported value for com::sun::star::table::CellProperties::HoriJustify - conversion needed" );
+                            bSuccess = sal_False;
+                        }
 				}
 				rVal <<= eUno;
 			}
 					case SVX_HOR_JUSTIFY_CENTER: nAdjust = style::ParagraphAdjust_CENTER; break;
 					case SVX_HOR_JUSTIFY_RIGHT:	 nAdjust = style::ParagraphAdjust_RIGHT;  break;
 					case SVX_HOR_JUSTIFY_BLOCK:	 nAdjust = style::ParagraphAdjust_BLOCK;  break;
-				}
+                    default: ; // prevent warning
+                }
 				rVal <<= nAdjust;		// as sal_Int16
 			}
 			break;
+        // --> OD #i105270#
+        case MID_HORJUST_TEXT_ALIGN :