Index: sc/source/filter/excel/excel.cxx =================================================================== RCS file: /cvs/sc/sc/source/filter/excel/excel.cxx,v --- sc/source/filter/excel/excel.cxx 1.24 +++ sc/source/filter/excel/excel.cxx @@ -7,1 +7,1 @@ - * $Revision: 1.24 $ --- + * $Revision: 1.1 $ @@ -9,1 +9,1 @@ - * last change: $Author: kz $ $Date: 2006/07/21 11:47:43 $ --- + * last change: $Author: ooo $ $Date: 2006/11/02 12:10:17 $ @@ -85,0 +85,11 @@ +#ifndef _SVX_FRMDIRITEM_HXX +#include +#endif + +#ifndef _SVX_ALGITEM_HXX +#include +#endif + +#ifndef SC_CELL_HXX +#include "cell.hxx" +#endif @@ -194,0 +205,46 @@ + for( const ScAddress* pAddr = xFilter->CellIDList.First(); pAddr; pAddr = xFilter->CellIDList.Next() ) + { + + ScBaseCell* pCell = pDocument->GetCell( *pAddr ); + if (pCell->HasStringData()) + { + // For i37905: + int nLen = pCell->GetStringData().Len(); + #define IS_HEBREW(x) (x >= 0x590) && (x <= 0x5FF) + #define IS_LATIN(x) (((x >= 'A') && (x <= 'Z')) || ((x >= 'a') && (x <= 'z'))) + + const sal_Unicode *p = pCell->GetStringData().GetBuffer(); + BOOL bHasLatin = FALSE; + BOOL bHasHebrew = FALSE; + BOOL bFirstCharHebrew = IS_HEBREW(*p); + for (int i = 0; (i < nLen); i++) + { + p++; + if (IS_HEBREW(*p)) bHasHebrew = TRUE; + if (IS_LATIN(*p)) bHasLatin = TRUE; + } + + // Get cell's writing direction + const SvxFrameDirectionItem* pItem = static_cast< const SvxFrameDirectionItem* >( + pDocument->GetAttr( pAddr->Col(), pAddr->Row(), pAddr->Tab(), ATTR_WRITINGDIR ) ); + SvxFrameDirection eCellDir = (SvxFrameDirection)pItem->GetValue(); + + // Get cell's alignment + const SvxHorJustifyItem* pHorJustItem = static_cast< const SvxHorJustifyItem* >( + pDocument->GetAttr( pAddr->Col(), pAddr->Row(), pAddr->Tab(), ATTR_HOR_JUSTIFY ) ); + SvxCellHorJustify eHorJust = (SvxCellHorJustify)pHorJustItem->GetValue(); + + if (bFirstCharHebrew && (eHorJust == SVX_HOR_JUSTIFY_STANDARD)) + pDocument->ApplyAttr( pAddr->Col(), pAddr->Row(), pAddr->Tab(), + SvxHorJustifyItem( SVX_HOR_JUSTIFY_RIGHT, ATTR_HOR_JUSTIFY ) ); + + else if (bFirstCharHebrew && (eHorJust == SVX_HOR_JUSTIFY_RIGHT) && (eCellDir == FRMDIR_ENVIRONMENT)) + pDocument->ApplyAttr( pAddr->Col(), pAddr->Row(), pAddr->Tab(), + SvxFrameDirectionItem( FRMDIR_HORI_RIGHT_TOP, ATTR_WRITINGDIR ) ); + + else if (bHasHebrew && (eCellDir == FRMDIR_ENVIRONMENT)) + pDocument->ApplyAttr( pAddr->Col(), pAddr->Row(), pAddr->Tab(), + SvxFrameDirectionItem( FRMDIR_HORI_LEFT_TOP, ATTR_WRITINGDIR ) ); + } + } + @@ -196,0 +253,1 @@ + Index: sc/source/filter/excel/excimp8.cxx =================================================================== RCS file: /cvs/sc/sc/source/filter/excel/excimp8.cxx,v --- sc/source/filter/excel/excimp8.cxx 1.114 +++ sc/source/filter/excel/excimp8.cxx @@ -7,1 +7,1 @@ - * $Revision: 1.114 $ --- + * $Revision: 1.1 $ @@ -9,1 +9,1 @@ - * last change: $Author: rt $ $Date: 2006/07/25 09:56:55 $ --- + * last change: $Author: ooo $ $Date: 2006/11/02 12:10:17 $ @@ -69,0 +69,1 @@ +#include @@ -286,4 +287,8 @@ - GetXFRangeBuffer().SetXF( aScPos, nXF ); - pColRowBuff->Used( aScPos ); - if( ScBaseCell* pCell = GetSst().CreateCell( nSst, nXF ) ) - GetDoc().PutCell( aScPos.Col(), aScPos.Row(), aScPos.Tab(), pCell ); --- + GetXFRangeBuffer().SetXF( aScPos, nXF ); + pColRowBuff->Used( aScPos ); + if( ScBaseCell* pCell = GetSst().CreateCell( nSst, nXF ) ) + { + GetDoc().PutCell( aScPos.Col(), aScPos.Row(), aScPos.Tab(), pCell ); + ScAddress* aScPosCopy = new ScAddress(aScPos); + CellIDList.Append( aScPosCopy ); + } Index: sc/source/filter/inc/imp_op.hxx =================================================================== RCS file: /cvs/sc/sc/source/filter/inc/imp_op.hxx,v --- sc/source/filter/inc/imp_op.hxx 1.38 +++ sc/source/filter/inc/imp_op.hxx @@ -7,1 +7,1 @@ - * $Revision: 1.38 $ --- + * $Revision: 1.1 $ @@ -9,1 +9,1 @@ - * last change: $Author: rt $ $Date: 2006/07/25 09:59:12 $ --- + * last change: $Author: ooo $ $Date: 2006/11/02 15:46:46 $ @@ -73,1 +73,0 @@ - @@ -88,0 +87,2 @@ +typedef ScfDelList< ScAddress > XclBaseScAddressList; + @@ -274,0 +275,2 @@ + + XclBaseScAddressList CellIDList;