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

(-)sc/source/ui/miscdlgs/autofmt.cxx (-5 / +20 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 54-59 Link Here
54
#include <svx/wghtitem.hxx>
55
#include <svx/wghtitem.hxx>
55
#include <svtools/zforlist.hxx>
56
#include <svtools/zforlist.hxx>
56
#include <vcl/msgbox.hxx>
57
#include <vcl/msgbox.hxx>
58
#include <vcl/svapp.hxx>
57
#include <comphelper/processfactory.hxx>
59
#include <comphelper/processfactory.hxx>
58
60
59
#include "sc.hrc"
61
#include "sc.hrc"
Lines 69-74 Link Here
69
#include "autofmt.hxx"
71
#include "autofmt.hxx"
70
#include "scresid.hxx"
72
#include "scresid.hxx"
71
#include "document.hxx"
73
#include "document.hxx"
74
#include "docsh.hxx"
75
#include "tabvwsh.hxx"
72
76
73
#define FRAME_OFFSET 4
77
#define FRAME_OFFSET 4
74
78
Lines 596-602 Link Here
596
        4,  5,  6,  5,  7,
600
        4,  5,  6,  5,  7,
597
        12, 13, 14, 13, 15
601
        12, 13, 14, 13, 15
598
    };
602
    };
599
    return pnFmtMap[ maArray.GetCellIndex( nCol, nRow ) ];
603
    return pnFmtMap[ maArray.GetCellIndex( nCol, nRow, mbRTL ) ];
600
}
604
}
601
605
602
const SvxBoxItem& AutoFmtPreview::GetBoxItem( size_t nCol, size_t nRow ) const
606
const SvxBoxItem& AutoFmtPreview::GetBoxItem( size_t nCol, size_t nRow ) const
Lines 626-632 Link Here
626
		ULONG   nNum;
630
		ULONG   nNum;
627
		double  nVal;
631
		double  nVal;
628
		Color*  pDummy = NULL;
632
		Color*  pDummy = NULL;
629
        USHORT  nIndex = static_cast< USHORT >( maArray.GetCellIndex( nCol, nRow ) );
633
        USHORT  nIndex = static_cast< USHORT >( maArray.GetCellIndex( nCol, nRow, mbRTL ) );
630
634
631
		switch( nIndex )
635
		switch( nIndex )
632
		{
636
		{
Lines 688-696 Link Here
688
			//-------------
692
			//-------------
689
			// Ausrichtung:
693
			// Ausrichtung:
690
			//-------------
694
			//-------------
691
            eJustification = bJustify ?
695
                eJustification  = mbRTL ? SVX_HOR_JUSTIFY_RIGHT : bJustify ?
692
                (SvxCellHorJustify)(((const SvxHorJustifyItem*)pCurData->GetItem( nFmtIndex, ATTR_HOR_JUSTIFY ))->GetValue()) :
696
                        (SvxCellHorJustify)(((const SvxHorJustifyItem*)pCurData->GetItem( nFmtIndex, ATTR_HOR_JUSTIFY ))->GetValue()) :
693
                SVX_HOR_JUSTIFY_STANDARD;
697
                         SVX_HOR_JUSTIFY_STANDARD;
694
698
695
			if ( pCurData->GetIncludeFont() )
699
			if ( pCurData->GetIncludeFont() )
696
			{
700
			{
Lines 856-861 Link Here
856
    maArray.SetUseDiagDoubleClipping( false );
860
    maArray.SetUseDiagDoubleClipping( false );
857
	CalcCellArray( FALSE );
861
	CalcCellArray( FALSE );
858
	CalcLineMap();
862
	CalcLineMap();
863
    TypeId aType(TYPE(ScDocShell));
864
    ScDocShell* pDocShell = (ScDocShell*)SfxObjectShell::GetFirst(&aType);
865
    SfxViewFrame* pFrame = SfxViewFrame::GetFirst( pDocShell );
866
    SfxViewShell* p = pFrame->GetViewShell();
867
    ScTabViewShell* pViewSh = PTR_CAST(ScTabViewShell,p);
868
    ScViewData* pViewData = pViewSh->GetViewData();
869
    SCTAB nCurrentTab = pViewData->GetTabNo();
870
    ScDocument* pDoc = pViewData->GetDocument();
871
    mbRTL = pDoc->IsLayoutRTL( nCurrentTab );
859
}
872
}
860
873
861
//------------------------------------------------------------------------
874
//------------------------------------------------------------------------
Lines 958-963 Link Here
958
    DrawRect( aRect );
971
    DrawRect( aRect );
959
972
960
    Point aPos( (aWndSize.Width() - aPrvSize.Width()) / 2, (aWndSize.Height() - aPrvSize.Height()) / 2 );
973
    Point aPos( (aWndSize.Width() - aPrvSize.Width()) / 2, (aWndSize.Height() - aPrvSize.Height()) / 2 );
974
    if (Application::GetSettings().GetLayoutRTL()) 
975
	    aPos.X() = -aPos.X(); 
961
    DrawOutDev( aPos, aWndSize, Point(), aWndSize, aVD );
976
    DrawOutDev( aPos, aWndSize, Point(), aWndSize, aVD );
962
977
963
    aVD.SetDrawMode( nOldDrawMode );
978
    aVD.SetDrawMode( nOldDrawMode );
(-)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                    mbRTL;
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                    mbRTL;
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
            mbRTL = Application::GetSettings().GetLayoutRTL();
649
        else
650
            mbRTL = 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, mbRTL ) ];
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, mbRTL ) );
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( mbRTL )
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