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