View | Details | Raw Unified | Return to issue 73707
Collapse All | Expand All

(-)sc/source/ui/miscdlgs/autofmt.cxx (-5 / +17 lines)
Lines 41-46 Link Here
41
//------------------------------------------------------------------
41
//------------------------------------------------------------------
42
42
43
#include "scitems.hxx"
43
#include "scitems.hxx"
44
#include <sfx2/topfrm.hxx>
44
#include <svx/algitem.hxx>
45
#include <svx/algitem.hxx>
45
#include <svx/boxitem.hxx>
46
#include <svx/boxitem.hxx>
46
#include <svx/brshitem.hxx>
47
#include <svx/brshitem.hxx>
Lines 69-74 Link Here
69
#include "autofmt.hxx"
70
#include "autofmt.hxx"
70
#include "scresid.hxx"
71
#include "scresid.hxx"
71
#include "document.hxx"
72
#include "document.hxx"
73
#include "docsh.hxx"
74
#include "tabvwsh.hxx"
72
75
73
#define FRAME_OFFSET 4
76
#define FRAME_OFFSET 4
74
77
Lines 596-602 Link Here
596
        4,  5,  6,  5,  7,
599
        4,  5,  6,  5,  7,
597
        12, 13, 14, 13, 15
600
        12, 13, 14, 13, 15
598
    };
601
    };
599
    return pnFmtMap[ maArray.GetCellIndex( nCol, nRow ) ];
602
    return pnFmtMap[ maArray.GetCellIndex( nCol, nRow, bRTL ) ];
600
}
603
}
601
604
602
const SvxBoxItem& AutoFmtPreview::GetBoxItem( size_t nCol, size_t nRow ) const
605
const SvxBoxItem& AutoFmtPreview::GetBoxItem( size_t nCol, size_t nRow ) const
Lines 626-632 Link Here
626
		ULONG   nNum;
629
		ULONG   nNum;
627
		double  nVal;
630
		double  nVal;
628
		Color*  pDummy = NULL;
631
		Color*  pDummy = NULL;
629
        USHORT  nIndex = static_cast< USHORT >( maArray.GetCellIndex( nCol, nRow ) );
632
        USHORT  nIndex = static_cast< USHORT >( maArray.GetCellIndex( nCol, nRow, bRTL ) );
630
633
631
		switch( nIndex )
634
		switch( nIndex )
632
		{
635
		{
Lines 688-696 Link Here
688
			//-------------
691
			//-------------
689
			// Ausrichtung:
692
			// Ausrichtung:
690
			//-------------
693
			//-------------
691
            eJustification = bJustify ?
694
		eJustification  = bRTL ? SVX_HOR_JUSTIFY_RIGHT : bJustify ?
692
                (SvxCellHorJustify)(((const SvxHorJustifyItem*)pCurData->GetItem( nFmtIndex, ATTR_HOR_JUSTIFY ))->GetValue()) :
695
                	(SvxCellHorJustify)(((const SvxHorJustifyItem*)pCurData->GetItem( nFmtIndex, ATTR_HOR_JUSTIFY ))->GetValue()) :
693
                SVX_HOR_JUSTIFY_STANDARD;
696
			SVX_HOR_JUSTIFY_STANDARD;
694
697
695
			if ( pCurData->GetIncludeFont() )
698
			if ( pCurData->GetIncludeFont() )
696
			{
699
			{
Lines 856-861 Link Here
856
    maArray.SetUseDiagDoubleClipping( false );
859
    maArray.SetUseDiagDoubleClipping( false );
857
	CalcCellArray( FALSE );
860
	CalcCellArray( FALSE );
858
	CalcLineMap();
861
	CalcLineMap();
862
	TypeId aType(TYPE(ScDocShell));
863
	ScDocShell* pDocShell = (ScDocShell*)SfxObjectShell::GetFirst(&aType);
864
	SfxViewFrame* pFrame = SfxViewFrame::GetFirst( pDocShell );
865
	SfxViewShell* p = pFrame->GetViewShell();
866
	ScTabViewShell* pViewSh = PTR_CAST(ScTabViewShell,p);
867
	ScViewData* pViewData = pViewSh->GetViewData();
868
	SCTAB nCurrentTab = pViewData->GetTabNo();
869
	ScDocument* pDoc = pViewData->GetDocument();
870
	bRTL = pDoc->IsLayoutRTL( nCurrentTab );
859
}
871
}
860
872
861
//------------------------------------------------------------------------
873
//------------------------------------------------------------------------
(-)sc/source/ui/inc/autofmt.hxx (+1 lines)
Lines 158-163 Link Here
158
    ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XBreakIterator > xBreakIter;
158
    ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XBreakIterator > xBreakIter;
159
    BOOL                    bFitWidth;
159
    BOOL                    bFitWidth;
160
    svx::frame::Array       maArray;            /// Implementation to draw the frame borders.
160
    svx::frame::Array       maArray;            /// Implementation to draw the frame borders.
161
    BOOL		bRTL;
161
    Size                    aPrvSize;
162
    Size                    aPrvSize;
162
    long                    mnLabelColWidth;
163
    long                    mnLabelColWidth;
163
    long                    mnDataColWidth1;
164
    long                    mnDataColWidth1;
(-)svx/inc/framelinkarray.hxx (-1 / +1 lines)
Lines 120-126 Link Here
120
    size_t              GetRowFromIndex( size_t nCellIndex ) const;
120
    size_t              GetRowFromIndex( size_t nCellIndex ) const;
121
121
122
    /** Returns the cell index from the cell address (nCol,nRow). */
122
    /** Returns the cell index from the cell address (nCol,nRow). */
123
    size_t              GetCellIndex( size_t nCol, size_t nRow ) const;
123
    size_t              GetCellIndex( size_t nCol, size_t nRow, BOOL bRTL ) const;
124
124
125
125
126
    // cell border styles -----------------------------------------------------
126
    // cell border styles -----------------------------------------------------
(-)svx/source/dialog/framelinkarray.cxx (-1 / +3 lines)
Lines 510-518 Link Here
510
    return mxImpl->mnWidth ? (nCellIndex / mxImpl->mnWidth) : 0;
510
    return mxImpl->mnWidth ? (nCellIndex / mxImpl->mnWidth) : 0;
511
}
511
}
512
512
513
size_t Array::GetCellIndex( size_t nCol, size_t nRow ) const
513
size_t Array::GetCellIndex( size_t nCol, size_t nRow, BOOL bRTL  =  FALSE) const
514
{
514
{
515
    DBG_FRAME_CHECK_COLROW( nCol, nRow, "GetCellIndex" );
515
    DBG_FRAME_CHECK_COLROW( nCol, nRow, "GetCellIndex" );
516
    if (bRTL)
517
	    nCol = mxImpl->GetMirrorCol(nCol);
516
    return mxImpl->GetIndex( nCol, nRow );
518
    return mxImpl->GetIndex( nCol, nRow );
517
}
519
}
518
520
(-)sw/source/ui/table/tautofmt.cxx (-3 / +18 lines)
Lines 49-54 Link Here
49
#ifndef _MSGBOX_HXX //autogen
49
#ifndef _MSGBOX_HXX //autogen
50
#include <vcl/msgbox.hxx>
50
#include <vcl/msgbox.hxx>
51
#endif
51
#endif
52
#ifndef _SV_SVAPP_HXX
53
#include <vcl/svapp.hxx>
54
#endif
52
#ifndef _ZFORLIST_HXX //autogen
55
#ifndef _ZFORLIST_HXX //autogen
53
#include <svtools/zforlist.hxx>
56
#include <svtools/zforlist.hxx>
54
#endif
57
#endif
Lines 70-75 Link Here
70
#ifndef SVX_FRAMELINKARRAY_HXX
73
#ifndef SVX_FRAMELINKARRAY_HXX
71
#include <svx/framelinkarray.hxx>
74
#include <svx/framelinkarray.hxx>
72
#endif
75
#endif
76
#ifndef _DOCSH_HXX
77
#include <docsh.hxx>
78
#endif
73
79
74
#ifndef _SWMODULE_HXX
80
#ifndef _SWMODULE_HXX
75
#include "swmodule.hxx"
81
#include "swmodule.hxx"
Lines 122-127 Link Here
122
    SvtScriptedTextHelper   aScriptedText;
128
    SvtScriptedTextHelper   aScriptedText;
123
    svx::frame::Array       maArray;            /// Implementation to draw the frame borders.
129
    svx::frame::Array       maArray;            /// Implementation to draw the frame borders.
124
    BOOL                    bFitWidth;
130
    BOOL                    bFitWidth;
131
    BOOL                    bRTL;
125
    Size                    aPrvSize;
132
    Size                    aPrvSize;
126
    long                    nLabelColWidth;
133
    long                    nLabelColWidth;
127
    long                    nDataColWidth1;
134
    long                    nDataColWidth1;
Lines 635-640 Link Here
635
        nRowHeight      ( (aPrvSize.Height() - 4) / 5 ),
642
        nRowHeight      ( (aPrvSize.Height() - 4) / 5 ),
636
		m_xMSF          ( comphelper::getProcessServiceFactory() )
643
		m_xMSF          ( comphelper::getProcessServiceFactory() )
637
{
644
{
645
    	SwDocShell* pDocShell = (SwDocShell*) SfxObjectShell::Current();
646
    	SwFEShell* pFEShell = pDocShell->GetFEShell();
647
    	if (!pFEShell->GetCurTabColNum()) // We haven't created the table yet
648
		bRTL = Application::GetSettings().GetLayoutRTL();
649
	else
650
		bRTL = pFEShell->IsTableRightToLeft();
638
	DBG_ASSERT( m_xMSF.is(), "AutoFmtPreview: no MultiServiceFactory");
651
	DBG_ASSERT( m_xMSF.is(), "AutoFmtPreview: no MultiServiceFactory");
639
	if ( m_xMSF.is() )
652
	if ( m_xMSF.is() )
640
	{
653
	{
Lines 709-715 Link Here
709
        4,  5,  6,  5,  7,
722
        4,  5,  6,  5,  7,
710
        12, 13, 14, 13, 15
723
        12, 13, 14, 13, 15
711
    };
724
    };
712
    return pnFmtMap[ maArray.GetCellIndex( nCol, nRow ) ];
725
    return pnFmtMap[ maArray.GetCellIndex( nCol, nRow, bRTL ) ];
713
}
726
}
714
727
715
const SvxBoxItem& AutoFmtPreview::GetBoxItem( size_t nCol, size_t nRow ) const
728
const SvxBoxItem& AutoFmtPreview::GetBoxItem( size_t nCol, size_t nRow ) const
Lines 733-739 Link Here
733
	ULONG   nNum;
746
	ULONG   nNum;
734
	double  nVal;
747
	double  nVal;
735
	String cellString;
748
	String cellString;
736
    BYTE    nIndex = static_cast< BYTE >( maArray.GetCellIndex( nCol, nRow ) );
749
    BYTE    nIndex = static_cast< BYTE >( maArray.GetCellIndex( nCol, nRow, bRTL ) );
737
750
738
	switch( nIndex )
751
	switch( nIndex )
739
	{
752
	{
Lines 860-866 Link Here
860
		// horizontal
873
		// horizontal
861
		//-----------
874
		//-----------
862
/* 		  if ( eJustification != SC_HOR_JUSTIFY_STANDARD )*/
875
/* 		  if ( eJustification != SC_HOR_JUSTIFY_STANDARD )*/
863
		if (aCurData.IsJustify())
876
    		if( bRTL )
877
			aPos.X() += nRightX;
878
		else if (aCurData.IsJustify())
864
		{
879
		{
865
			USHORT nHorPos = (USHORT)
880
			USHORT nHorPos = (USHORT)
866
					((cellRect.GetWidth()-aStrSize.Width())/2);
881
					((cellRect.GetWidth()-aStrSize.Width())/2);

Return to issue 73707