Line 7
Link Here
|
7 |
* $Revision: 1.24 $ |
7 |
* $Revision: 1.1 $ |
8 |
-- |
|
|
Line 9
Link Here
|
9 |
* last change: $Author: kz $ $Date: 2006/07/21 11:47:43 $ |
9 |
* last change: $Author: ooo $ $Date: 2006/11/02 12:10:17 $ |
10 |
-- |
|
|
Line 85
Link Here
|
|
|
85 |
#ifndef _SVX_FRMDIRITEM_HXX |
86 |
#include <svx/frmdiritem.hxx> |
87 |
#endif |
88 |
|
89 |
#ifndef _SVX_ALGITEM_HXX |
90 |
#include <svx/algitem.hxx> |
91 |
#endif |
92 |
|
93 |
#ifndef SC_CELL_HXX |
94 |
#include "cell.hxx" |
95 |
#endif |
Line 194
Link Here
|
|
|
205 |
for( const ScAddress* pAddr = xFilter->CellIDList.First(); pAddr; pAddr = xFilter->CellIDList.Next() ) |
206 |
{ |
207 |
|
208 |
ScBaseCell* pCell = pDocument->GetCell( *pAddr ); |
209 |
if (pCell->HasStringData()) |
210 |
{ |
211 |
// For i37905: |
212 |
int nLen = pCell->GetStringData().Len(); |
213 |
#define IS_HEBREW(x) (x >= 0x590) && (x <= 0x5FF) |
214 |
#define IS_LATIN(x) (((x >= 'A') && (x <= 'Z')) || ((x >= 'a') && (x <= 'z'))) |
215 |
|
216 |
const sal_Unicode *p = pCell->GetStringData().GetBuffer(); |
217 |
BOOL bHasLatin = FALSE; |
218 |
BOOL bHasHebrew = FALSE; |
219 |
BOOL bFirstCharHebrew = IS_HEBREW(*p); |
220 |
for (int i = 0; (i < nLen); i++) |
221 |
{ |
222 |
p++; |
223 |
if (IS_HEBREW(*p)) bHasHebrew = TRUE; |
224 |
if (IS_LATIN(*p)) bHasLatin = TRUE; |
225 |
} |
226 |
|
227 |
// Get cell's writing direction |
228 |
const SvxFrameDirectionItem* pItem = static_cast< const SvxFrameDirectionItem* >( |
229 |
pDocument->GetAttr( pAddr->Col(), pAddr->Row(), pAddr->Tab(), ATTR_WRITINGDIR ) ); |
230 |
SvxFrameDirection eCellDir = (SvxFrameDirection)pItem->GetValue(); |
231 |
|
232 |
// Get cell's alignment |
233 |
const SvxHorJustifyItem* pHorJustItem = static_cast< const SvxHorJustifyItem* >( |
234 |
pDocument->GetAttr( pAddr->Col(), pAddr->Row(), pAddr->Tab(), ATTR_HOR_JUSTIFY ) ); |
235 |
SvxCellHorJustify eHorJust = (SvxCellHorJustify)pHorJustItem->GetValue(); |
236 |
|
237 |
if (bFirstCharHebrew && (eHorJust == SVX_HOR_JUSTIFY_STANDARD)) |
238 |
pDocument->ApplyAttr( pAddr->Col(), pAddr->Row(), pAddr->Tab(), |
239 |
SvxHorJustifyItem( SVX_HOR_JUSTIFY_RIGHT, ATTR_HOR_JUSTIFY ) ); |
240 |
|
241 |
else if (bFirstCharHebrew && (eHorJust == SVX_HOR_JUSTIFY_RIGHT) && (eCellDir == FRMDIR_ENVIRONMENT)) |
242 |
pDocument->ApplyAttr( pAddr->Col(), pAddr->Row(), pAddr->Tab(), |
243 |
SvxFrameDirectionItem( FRMDIR_HORI_RIGHT_TOP, ATTR_WRITINGDIR ) ); |
244 |
|
245 |
else if (bHasHebrew && (eCellDir == FRMDIR_ENVIRONMENT)) |
246 |
pDocument->ApplyAttr( pAddr->Col(), pAddr->Row(), pAddr->Tab(), |
247 |
SvxFrameDirectionItem( FRMDIR_HORI_LEFT_TOP, ATTR_WRITINGDIR ) ); |
248 |
} |
249 |
} |
250 |
|
Line 196
Link Here
|
|
|
253 |
|