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