xref: /trunk/main/sc/source/ui/Accessibility/AccessibleCellBase.cxx (revision 91144cd0085a7583d2099b982122deb2184ab956)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_sc.hxx"
26 
27 
28 #include "AccessibleCellBase.hxx"
29 #include "attrib.hxx"
30 #include "scitems.hxx"
31 #include "miscuno.hxx"
32 #include "document.hxx"
33 #include "docfunc.hxx"
34 #include "cell.hxx"
35 #include "unoguard.hxx"
36 #include "scresid.hxx"
37 #ifndef SC_SC_HRC
38 #include "sc.hrc"
39 #endif
40 #include "unonames.hxx"
41 #include "detfunc.hxx"
42 #include "chgtrack.hxx"
43 #ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLEROLE_HPP_
44 #include <com/sun/star/accessibility/AccessibleRole.hpp>
45 #endif
46 #ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLESTATETYPE_HPP_
47 #include <com/sun/star/accessibility/AccessibleStateType.hpp>
48 #endif
49 #include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
50 #include <com/sun/star/sheet/XSpreadsheet.hpp>
51 #include <tools/debug.hxx>
52 #include <editeng/brshitem.hxx>
53 #include <rtl/uuid.h>
54 #include <comphelper/sequence.hxx>
55 #include <sfx2/objsh.hxx>
56 #include <com/sun/star/sheet/XSheetAnnotation.hpp>
57 #include <com/sun/star/sheet/XSheetAnnotationAnchor.hpp>
58 #include <com/sun/star/text/XSimpleText.hpp>
59 
60 #include <float.h>
61 
62 using namespace ::com::sun::star;
63 using namespace ::com::sun::star::accessibility;
64 
65 //=====  internal  ============================================================
66 
ScAccessibleCellBase(const uno::Reference<XAccessible> & rxParent,ScDocument * pDoc,const ScAddress & rCellAddress,sal_Int32 nIndex)67 ScAccessibleCellBase::ScAccessibleCellBase(
68         const uno::Reference<XAccessible>& rxParent,
69         ScDocument* pDoc,
70         const ScAddress& rCellAddress,
71         sal_Int32 nIndex)
72     :
73     ScAccessibleContextBase(rxParent, AccessibleRole::TABLE_CELL),
74     maCellAddress(rCellAddress),
75     mpDoc(pDoc),
76     mnIndex(nIndex)
77 {
78 }
79 
~ScAccessibleCellBase()80 ScAccessibleCellBase::~ScAccessibleCellBase()
81 {
82 }
83 
84     //=====  XAccessibleComponent  ============================================
85 
isVisible()86 sal_Bool SAL_CALL ScAccessibleCellBase::isVisible(  )
87 {
88     ScUnoGuard aGuard;
89     IsObjectValid();
90     // test whether the cell is hidden (column/row - hidden/filtered)
91     sal_Bool bVisible(sal_True);
92     if (mpDoc)
93     {
94         bool bColHidden = mpDoc->ColHidden(maCellAddress.Col(), maCellAddress.Tab());
95         bool bRowHidden = mpDoc->RowHidden(maCellAddress.Row(), maCellAddress.Tab());
96         bool bColFiltered = mpDoc->ColFiltered(maCellAddress.Col(), maCellAddress.Tab());
97         bool bRowFiltered = mpDoc->RowFiltered(maCellAddress.Row(), maCellAddress.Tab());
98 
99         if (bColHidden || bColFiltered || bRowHidden || bRowFiltered)
100             bVisible = sal_False;
101     }
102     return bVisible;
103 }
104 
getForeground()105 sal_Int32 SAL_CALL ScAccessibleCellBase::getForeground()
106 {
107     ScUnoGuard aGuard;
108     IsObjectValid();
109     sal_Int32 nColor(0);
110     if (mpDoc)
111     {
112         SfxObjectShell* pObjSh = mpDoc->GetDocumentShell();
113         if ( pObjSh )
114         {
115             uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc( pObjSh->GetModel(), uno::UNO_QUERY );
116             if ( xSpreadDoc.is() )
117             {
118                 uno::Reference<sheet::XSpreadsheets> xSheets = xSpreadDoc->getSheets();
119                 uno::Reference<container::XIndexAccess> xIndex( xSheets, uno::UNO_QUERY );
120                 if ( xIndex.is() )
121                 {
122                     uno::Any aTable = xIndex->getByIndex(maCellAddress.Tab());
123                     uno::Reference<sheet::XSpreadsheet> xTable;
124                     if (aTable>>=xTable)
125                     {
126                         uno::Reference<table::XCell> xCell = xTable->getCellByPosition(maCellAddress.Col(), maCellAddress.Row());
127                         if (xCell.is())
128                         {
129                             uno::Reference<beans::XPropertySet> xCellProps(xCell, uno::UNO_QUERY);
130                             if (xCellProps.is())
131                             {
132                                 uno::Any aAny = xCellProps->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNONAME_CCOLOR)));
133                                 aAny >>= nColor;
134                             }
135                         }
136                     }
137                 }
138             }
139         }
140     }
141     return nColor;
142 }
143 
getBackground()144 sal_Int32 SAL_CALL ScAccessibleCellBase::getBackground()
145 {
146     ScUnoGuard aGuard;
147     IsObjectValid();
148     sal_Int32 nColor(0);
149 
150     if (mpDoc)
151     {
152         SfxObjectShell* pObjSh = mpDoc->GetDocumentShell();
153         if ( pObjSh )
154         {
155             uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc( pObjSh->GetModel(), uno::UNO_QUERY );
156             if ( xSpreadDoc.is() )
157             {
158                 uno::Reference<sheet::XSpreadsheets> xSheets = xSpreadDoc->getSheets();
159                 uno::Reference<container::XIndexAccess> xIndex( xSheets, uno::UNO_QUERY );
160                 if ( xIndex.is() )
161                 {
162                     uno::Any aTable = xIndex->getByIndex(maCellAddress.Tab());
163                     uno::Reference<sheet::XSpreadsheet> xTable;
164                     if (aTable>>=xTable)
165                     {
166                         uno::Reference<table::XCell> xCell = xTable->getCellByPosition(maCellAddress.Col(), maCellAddress.Row());
167                         if (xCell.is())
168                         {
169                             uno::Reference<beans::XPropertySet> xCellProps(xCell, uno::UNO_QUERY);
170                             if (xCellProps.is())
171                             {
172                                 uno::Any aAny = xCellProps->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNONAME_CELLBACK)));
173                                 aAny >>= nColor;
174                             }
175                         }
176                     }
177                 }
178             }
179         }
180     }
181 
182     return nColor;
183 }
184 
185     //=====  XInterface  =====================================================
186 
queryInterface(uno::Type const & rType)187 uno::Any SAL_CALL ScAccessibleCellBase::queryInterface( uno::Type const & rType )
188 {
189     uno::Any aAny (ScAccessibleCellBaseImpl::queryInterface(rType));
190     return aAny.hasValue() ? aAny : ScAccessibleContextBase::queryInterface(rType);
191 }
192 
acquire()193 void SAL_CALL ScAccessibleCellBase::acquire()
194     throw ()
195 {
196     ScAccessibleContextBase::acquire();
197 }
198 
release()199 void SAL_CALL ScAccessibleCellBase::release()
200     throw ()
201 {
202     ScAccessibleContextBase::release();
203 }
204 
205     //=====  XAccessibleContext  ==============================================
206 
207 sal_Int32
getAccessibleIndexInParent(void)208     ScAccessibleCellBase::getAccessibleIndexInParent(void)
209 {
210     ScUnoGuard aGuard;
211     IsObjectValid();
212     return mnIndex;
213 }
214 
215 ::rtl::OUString SAL_CALL
createAccessibleDescription(void)216     ScAccessibleCellBase::createAccessibleDescription(void)
217 {
218     rtl::OUString sDescription = String(ScResId(STR_ACC_CELL_DESCR));
219 
220     return sDescription;
221 }
222 
223 ::rtl::OUString SAL_CALL
createAccessibleName(void)224     ScAccessibleCellBase::createAccessibleName(void)
225 {
226     String sAddress;
227     // Document not needed, because only the cell address, but not the tablename is needed
228     // always us OOO notation
229     maCellAddress.Format( sAddress, SCA_VALID, NULL );
230     //sName.SearchAndReplaceAscii("%1", sAddress);
231     /*  #i65103# ZoomText merges cell address and contents, e.g. if value 2 is
232         contained in cell A1, ZT reads "cell A twelve" instead of "cell A1 - 2".
233         Simple solution: Append a space character to the cell address. */
234     return rtl::OUString(sAddress);
235 }
236 
237     //=====  XAccessibleValue  ================================================
238 
239 uno::Any SAL_CALL
getCurrentValue()240     ScAccessibleCellBase::getCurrentValue(  )
241 {
242     ScUnoGuard aGuard;
243     IsObjectValid();
244     uno::Any aAny;
245     if (mpDoc)
246     {
247         String valStr;
248         mpDoc->GetString(maCellAddress.Col(),maCellAddress.Row(),maCellAddress.Tab(), valStr);
249         aAny <<= rtl::OUString(valStr);
250     }
251     return aAny;
252 }
253 
254 sal_Bool SAL_CALL
setCurrentValue(const uno::Any & aNumber)255     ScAccessibleCellBase::setCurrentValue( const uno::Any& aNumber )
256 {
257     ScUnoGuard aGuard;
258     IsObjectValid();
259     double fValue = 0;
260     sal_Bool bResult(sal_False);
261     if((aNumber >>= fValue) && mpDoc && mpDoc->GetDocumentShell())
262     {
263         uno::Reference<XAccessibleStateSet> xParentStates;
264         if (getAccessibleParent().is())
265         {
266             uno::Reference<XAccessibleContext> xParentContext = getAccessibleParent()->getAccessibleContext();
267             xParentStates = xParentContext->getAccessibleStateSet();
268         }
269         if (IsEditable(xParentStates))
270         {
271             ScDocShell* pDocShell = (ScDocShell*) mpDoc->GetDocumentShell();
272             ScDocFunc aFunc(*pDocShell);
273             bResult = aFunc.PutCell( maCellAddress, new ScValueCell(fValue), sal_True );
274         }
275     }
276     return bResult;
277 }
278 
279 uno::Any SAL_CALL
getMaximumValue()280     ScAccessibleCellBase::getMaximumValue(  )
281 {
282     uno::Any aAny;
283     aAny <<= DBL_MAX;
284 
285     return aAny;
286 }
287 
288 uno::Any SAL_CALL
getMinimumValue()289     ScAccessibleCellBase::getMinimumValue(  )
290 {
291     uno::Any aAny;
292     aAny <<= -DBL_MAX;
293 
294     return aAny;
295 }
296 
297     //=====  XServiceInfo  ====================================================
298 
getImplementationName(void)299 ::rtl::OUString SAL_CALL ScAccessibleCellBase::getImplementationName(void)
300 {
301     return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM ("ScAccessibleCellBase"));
302 }
303 
304     //=====  XTypeProvider  ===================================================
305 
getTypes()306 uno::Sequence< uno::Type > SAL_CALL ScAccessibleCellBase::getTypes()
307 {
308     return comphelper::concatSequences(ScAccessibleCellBaseImpl::getTypes(), ScAccessibleContextBase::getTypes());
309 }
310 
311 uno::Sequence<sal_Int8> SAL_CALL
getImplementationId(void)312     ScAccessibleCellBase::getImplementationId(void)
313 {
314     ScUnoGuard aGuard;
315     IsObjectValid();
316     static uno::Sequence<sal_Int8> aId;
317     if (aId.getLength() == 0)
318     {
319         aId.realloc (16);
320         rtl_createUuid (reinterpret_cast<sal_uInt8 *>(aId.getArray()), 0, sal_True);
321     }
322     return aId;
323 }
324 
IsEditable(const uno::Reference<XAccessibleStateSet> & rxParentStates)325 sal_Bool ScAccessibleCellBase::IsEditable(
326     const uno::Reference<XAccessibleStateSet>& rxParentStates)
327 {
328     sal_Bool bEditable(sal_False);
329     if (rxParentStates.is() && rxParentStates->contains(AccessibleStateType::EDITABLE))
330         bEditable = sal_True;
331     return bEditable;
332 }
GetNote(void)333 ::rtl::OUString SAL_CALL ScAccessibleCellBase::GetNote(void)
334 {
335     ScUnoGuard aGuard;
336     IsObjectValid();
337     rtl::OUString msNote;
338     if (mpDoc)
339     {
340         SfxObjectShell* pObjSh = mpDoc->GetDocumentShell();
341         if ( pObjSh )
342         {
343             uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc( pObjSh->GetModel(), uno::UNO_QUERY );
344             if ( xSpreadDoc.is() )
345             {
346                 uno::Reference<sheet::XSpreadsheets> xSheets = xSpreadDoc->getSheets();
347                 uno::Reference<container::XIndexAccess> xIndex( xSheets, uno::UNO_QUERY );
348                 if ( xIndex.is() )
349                 {
350                     uno::Any aTable = xIndex->getByIndex(maCellAddress.Tab());
351                     uno::Reference<sheet::XSpreadsheet> xTable;
352                     if (aTable>>=xTable)
353                     {
354                         uno::Reference<table::XCell> xCell = xTable->getCellByPosition(maCellAddress.Col(), maCellAddress.Row());
355                         if (xCell.is())
356                         {
357                             uno::Reference <sheet::XSheetAnnotationAnchor> xAnnotationAnchor ( xCell, uno::UNO_QUERY);
358                             if(xAnnotationAnchor.is())
359                             {
360                                 uno::Reference <sheet::XSheetAnnotation> xSheetAnnotation = xAnnotationAnchor->getAnnotation();
361                                 if (xSheetAnnotation.is())
362                                 {
363                                     uno::Reference <text::XSimpleText> xText (xSheetAnnotation, uno::UNO_QUERY);
364                                     if (xText.is())
365                                     {
366                                         msNote = xText->getString();
367                                     }
368                                 }
369                             }
370                         }
371                     }
372                 }
373             }
374         }
375     }
376     return msNote;
377 }
378 #ifndef _COM_SUN_STAR_TABLE_SHADOWFORMAT_HPP_
379 #include <com/sun/star/table/ShadowFormat.hpp>
380 #endif
getShadowAttrs(void)381 ::rtl::OUString SAL_CALL ScAccessibleCellBase::getShadowAttrs(void)
382 {
383     ScUnoGuard aGuard;
384     IsObjectValid();
385     table::ShadowFormat aShadowFmt;
386     if (mpDoc)
387     {
388         SfxObjectShell* pObjSh = mpDoc->GetDocumentShell();
389         if ( pObjSh )
390         {
391             uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc( pObjSh->GetModel(), uno::UNO_QUERY );
392             if ( xSpreadDoc.is() )
393             {
394                 uno::Reference<sheet::XSpreadsheets> xSheets = xSpreadDoc->getSheets();
395                 uno::Reference<container::XIndexAccess> xIndex( xSheets, uno::UNO_QUERY );
396                 if ( xIndex.is() )
397                 {
398                     uno::Any aTable = xIndex->getByIndex(maCellAddress.Tab());
399                     uno::Reference<sheet::XSpreadsheet> xTable;
400                     if (aTable>>=xTable)
401                     {
402                         uno::Reference<table::XCell> xCell = xTable->getCellByPosition(maCellAddress.Col(), maCellAddress.Row());
403                         if (xCell.is())
404                         {
405                             uno::Reference<beans::XPropertySet> xCellProps(xCell, uno::UNO_QUERY);
406                             if (xCellProps.is())
407                             {
408                                 uno::Any aAny = xCellProps->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNONAME_SHADOW)));
409                                 aAny >>= aShadowFmt;
410                             }
411                         }
412                     }
413                 }
414             }
415         }
416     }
417     //construct shadow attributes string
418     rtl::OUString sShadowAttrs( RTL_CONSTASCII_USTRINGPARAM("Shadow:") );
419     rtl::OUString sInnerSplit( RTL_CONSTASCII_USTRINGPARAM(",") );
420     rtl::OUString sOuterSplit( RTL_CONSTASCII_USTRINGPARAM(";") );
421     sal_Int32 nLocationVal = 0;
422     switch( aShadowFmt.Location )
423     {
424     case table::ShadowLocation_TOP_LEFT:
425         nLocationVal = 1;
426         break;
427     case table::ShadowLocation_TOP_RIGHT:
428         nLocationVal = 2;
429         break;
430     case table::ShadowLocation_BOTTOM_LEFT:
431         nLocationVal = 3;
432         break;
433     case table::ShadowLocation_BOTTOM_RIGHT:
434         nLocationVal = 4;
435         break;
436     default:
437         break;
438     }
439     //if there is no shadow property for the cell
440     if ( nLocationVal == 0 )
441     {
442         sShadowAttrs += sOuterSplit;
443         return sShadowAttrs;
444     }
445     //else return all the shadow properties
446     sShadowAttrs += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Location=") );
447     sShadowAttrs += rtl::OUString::valueOf( (sal_Int32)nLocationVal );
448     sShadowAttrs += sInnerSplit;
449     sShadowAttrs += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ShadowWidth=") );
450     sShadowAttrs += rtl::OUString::valueOf( (sal_Int32)aShadowFmt.ShadowWidth ) ;
451     sShadowAttrs += sInnerSplit;
452     sShadowAttrs += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("IsTransparent=") );
453     sShadowAttrs += rtl::OUString::valueOf( (sal_Bool)aShadowFmt.IsTransparent ) ;
454     sShadowAttrs += sInnerSplit;
455     sShadowAttrs += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Color=") );
456     sShadowAttrs += rtl::OUString::valueOf( (sal_Int32)aShadowFmt.Color );
457     sShadowAttrs += sOuterSplit;
458     return sShadowAttrs;
459 }
460 #ifndef _COM_SUN_STAR_TABLE_BORDERLINE_HPP_
461 #include <com/sun/star/table/BorderLine.hpp>
462 #endif
getBorderAttrs(void)463 ::rtl::OUString SAL_CALL ScAccessibleCellBase::getBorderAttrs(void)
464 {
465     ScUnoGuard aGuard;
466     IsObjectValid();
467     table::BorderLine aTopBorder;
468     table::BorderLine aBottomBorder;
469     table::BorderLine aLeftBorder;
470     table::BorderLine aRightBorder;
471     if (mpDoc)
472     {
473         SfxObjectShell* pObjSh = mpDoc->GetDocumentShell();
474         if ( pObjSh )
475         {
476             uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc( pObjSh->GetModel(), uno::UNO_QUERY );
477             if ( xSpreadDoc.is() )
478             {
479                 uno::Reference<sheet::XSpreadsheets> xSheets = xSpreadDoc->getSheets();
480                 uno::Reference<container::XIndexAccess> xIndex( xSheets, uno::UNO_QUERY );
481                 if ( xIndex.is() )
482                 {
483                     uno::Any aTable = xIndex->getByIndex(maCellAddress.Tab());
484                     uno::Reference<sheet::XSpreadsheet> xTable;
485                     if (aTable>>=xTable)
486                     {
487                         uno::Reference<table::XCell> xCell = xTable->getCellByPosition(maCellAddress.Col(), maCellAddress.Row());
488                         if (xCell.is())
489                         {
490                             uno::Reference<beans::XPropertySet> xCellProps(xCell, uno::UNO_QUERY);
491                             if (xCellProps.is())
492                             {
493                                 uno::Any aAny = xCellProps->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNONAME_TOPBORDER)));
494                                 aAny >>= aTopBorder;
495                                 aAny = xCellProps->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNONAME_BOTTBORDER)));
496                                 aAny >>= aBottomBorder;
497                                 aAny = xCellProps->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNONAME_LEFTBORDER)));
498                                 aAny >>= aLeftBorder;
499                                 aAny = xCellProps->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNONAME_RIGHTBORDER)));
500                                 aAny >>= aRightBorder;
501                             }
502                         }
503                     }
504                 }
505             }
506         }
507     }
508 
509     Color aColor;
510     sal_Bool bIn = mpDoc ? mpDoc->IsCellInChangeTrack(maCellAddress,&aColor) : sal_False;
511     if (bIn)
512     {
513         aTopBorder.Color = aColor.GetColor();
514         aBottomBorder.Color = aColor.GetColor();
515         aLeftBorder.Color = aColor.GetColor();
516         aRightBorder.Color = aColor.GetColor();
517         aTopBorder.OuterLineWidth =2;
518         aBottomBorder.OuterLineWidth =2;
519         aLeftBorder.OuterLineWidth =2;
520         aRightBorder.OuterLineWidth =2;
521     }
522 
523     //construct border attributes string
524     rtl::OUString sBorderAttrs;
525     rtl::OUString sInnerSplit( RTL_CONSTASCII_USTRINGPARAM(",") );
526     rtl::OUString sOuterSplit( RTL_CONSTASCII_USTRINGPARAM(";") );
527     //top border
528     //if top of the cell has no border
529     if ( aTopBorder.InnerLineWidth == 0 && aTopBorder.OuterLineWidth == 0 )
530     {
531         sBorderAttrs += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("TopBorder:;") );
532     }
533     else//add all the border properties to the return string.
534     {
535         sBorderAttrs += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("TopBorder:Color=") );
536         sBorderAttrs += rtl::OUString::valueOf( (sal_Int32)aTopBorder.Color );
537         sBorderAttrs += sInnerSplit;
538         sBorderAttrs += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("InnerLineWidth=") );
539         sBorderAttrs += rtl::OUString::valueOf( (sal_Int32)aTopBorder.InnerLineWidth );
540         sBorderAttrs += sInnerSplit;
541         sBorderAttrs += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("OuterLineWidth=") );
542         sBorderAttrs += rtl::OUString::valueOf( (sal_Int32)aTopBorder.OuterLineWidth );
543         sBorderAttrs += sInnerSplit;
544         sBorderAttrs += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("LineDistance=") );
545         sBorderAttrs += rtl::OUString::valueOf( (sal_Int32)aTopBorder.LineDistance );
546         sBorderAttrs += sOuterSplit;
547     }
548     //bottom border
549     if ( aBottomBorder.InnerLineWidth == 0 && aBottomBorder.OuterLineWidth == 0 )
550     {
551         sBorderAttrs += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("BottomBorde:;") );
552     }
553     else
554     {
555         sBorderAttrs += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("BottomBorder:Color=") );
556         sBorderAttrs += rtl::OUString::valueOf( (sal_Int32)aBottomBorder.Color );
557         sBorderAttrs += sInnerSplit;
558         sBorderAttrs += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("InnerLineWidth=") );
559         sBorderAttrs += rtl::OUString::valueOf( (sal_Int32)aBottomBorder.InnerLineWidth );
560         sBorderAttrs += sInnerSplit;
561         sBorderAttrs += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("OuterLineWidth=") );
562         sBorderAttrs += rtl::OUString::valueOf( (sal_Int32)aBottomBorder.OuterLineWidth );
563         sBorderAttrs += sInnerSplit;
564         sBorderAttrs += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("LineDistance=") );
565         sBorderAttrs += rtl::OUString::valueOf( (sal_Int32)aBottomBorder.LineDistance );
566         sBorderAttrs += sOuterSplit;
567     }
568     //left border
569     if ( aLeftBorder.InnerLineWidth == 0 && aLeftBorder.OuterLineWidth == 0 )
570     {
571         sBorderAttrs += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("LeftBorder:;") );
572     }
573     else
574     {
575         sBorderAttrs += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("LeftBorder:Color=") );
576         sBorderAttrs += rtl::OUString::valueOf( (sal_Int32)aLeftBorder.Color );
577         sBorderAttrs += sInnerSplit;
578         sBorderAttrs += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("InnerLineWidth=") );
579         sBorderAttrs += rtl::OUString::valueOf( (sal_Int32)aLeftBorder.InnerLineWidth );
580         sBorderAttrs += sInnerSplit;
581         sBorderAttrs += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("OuterLineWidth=") );
582         sBorderAttrs += rtl::OUString::valueOf( (sal_Int32)aLeftBorder.OuterLineWidth );
583         sBorderAttrs += sInnerSplit;
584         sBorderAttrs += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("LineDistance=") );
585         sBorderAttrs += rtl::OUString::valueOf( (sal_Int32)aLeftBorder.LineDistance );
586         sBorderAttrs += sOuterSplit;
587     }
588     //right border
589     if ( aRightBorder.InnerLineWidth == 0 && aRightBorder.OuterLineWidth == 0 )
590     {
591         sBorderAttrs += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("RightBorder:;") );
592     }
593     else
594     {
595         sBorderAttrs += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("RightBorder:Color=") );
596         sBorderAttrs += rtl::OUString::valueOf( (sal_Int32)aRightBorder.Color );
597         sBorderAttrs += sInnerSplit;
598         sBorderAttrs += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("InnerLineWidth=") );
599         sBorderAttrs += rtl::OUString::valueOf( (sal_Int32)aRightBorder.InnerLineWidth );
600         sBorderAttrs += sInnerSplit;
601         sBorderAttrs += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("OuterLineWidth=") );
602         sBorderAttrs += rtl::OUString::valueOf( (sal_Int32)aRightBorder.OuterLineWidth );
603         sBorderAttrs += sInnerSplit;
604         sBorderAttrs += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("LineDistance=") );
605         sBorderAttrs += rtl::OUString::valueOf( (sal_Int32)aRightBorder.LineDistance );
606         sBorderAttrs += sOuterSplit;
607     }
608     return sBorderAttrs;
609 }
610 //end of cell attributes
611 
GetAllDisplayNote(void)612 ::rtl::OUString SAL_CALL ScAccessibleCellBase::GetAllDisplayNote(void)
613 {
614     ::rtl::OUString strNote;
615     String strTrackText;
616     if (mpDoc)
617     {
618         sal_Bool bLeftedge=sal_False;
619         mpDoc->GetCellChangeTrackNote(maCellAddress,strTrackText,bLeftedge);
620     }
621     if (strTrackText.Len() > 0 )
622     {
623         ScDetectiveFunc::AppendChangTrackNoteSeparator(strTrackText);
624         strNote = strTrackText;
625     }
626     strNote += GetNote();
627     return strNote;
628 }
629