21#include <document.hxx>
25#include <unonames.hxx>
28#include <com/sun/star/accessibility/AccessibleRole.hpp>
29#include <com/sun/star/accessibility/AccessibleStateType.hpp>
30#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
31#include <com/sun/star/sheet/XSpreadsheet.hpp>
32#include <com/sun/star/sheet/XSheetAnnotationAnchor.hpp>
33#include <com/sun/star/text/XSimpleText.hpp>
34#include <com/sun/star/table/BorderLine.hpp>
35#include <com/sun/star/table/ShadowFormat.hpp>
45#define DEFAULT_LINE_WIDTH 2
50 const uno::Reference<XAccessible>& rxParent,
56 maCellAddress(rCellAddress),
81 if (bColHidden || bColFiltered || bRowHidden || bRowFiltered)
97 uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc( pObjSh->
GetModel(), uno::UNO_QUERY );
98 if ( xSpreadDoc.is() )
100 uno::Reference<sheet::XSpreadsheets> xSheets = xSpreadDoc->getSheets();
101 uno::Reference<container::XIndexAccess> xIndex( xSheets, uno::UNO_QUERY );
105 uno::Reference<sheet::XSpreadsheet> xTable;
111 uno::Reference<beans::XPropertySet> xCellProps(xCell, uno::UNO_QUERY);
137 uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc( pObjSh->
GetModel(), uno::UNO_QUERY );
138 if ( xSpreadDoc.is() )
140 uno::Reference<sheet::XSpreadsheets> xSheets = xSpreadDoc->getSheets();
141 uno::Reference<container::XIndexAccess> xIndex( xSheets, uno::UNO_QUERY );
145 uno::Reference<sheet::XSpreadsheet> xTable;
151 uno::Reference<beans::XPropertySet> xCellProps(xCell, uno::UNO_QUERY);
172 return aAny.
hasValue() ? aAny : ScAccessibleContextBase::queryInterface(rType);
178 ScAccessibleContextBase::acquire();
184 ScAccessibleContextBase::release();
232 bool bResult =
false;
235 sal_Int64 nParentStates = 0;
238 uno::Reference<XAccessibleContext> xParentContext =
getAccessibleParent()->getAccessibleContext();
239 nParentStates = xParentContext->getAccessibleStateSet();
272 return "ScAccessibleCellBase";
282uno::Sequence<sal_Int8> SAL_CALL
285 return css::uno::Sequence<sal_Int8>();
290 bool bEditable = nParentStates & AccessibleStateType::EDITABLE;
304 uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc( pObjSh->
GetModel(), uno::UNO_QUERY );
305 if ( xSpreadDoc.is() )
307 uno::Reference<sheet::XSpreadsheets> xSheets = xSpreadDoc->getSheets();
308 uno::Reference<container::XIndexAccess> xIndex( xSheets, uno::UNO_QUERY );
312 uno::Reference<sheet::XSpreadsheet> xTable;
318 uno::Reference <sheet::XSheetAnnotationAnchor> xAnnotationAnchor ( xCell, uno::UNO_QUERY);
319 if(xAnnotationAnchor.is())
321 uno::Reference <sheet::XSheetAnnotation> xSheetAnnotation = xAnnotationAnchor->getAnnotation();
322 if (xSheetAnnotation.is())
324 uno::Reference <text::XSimpleText> xText (xSheetAnnotation, uno::UNO_QUERY);
327 sNote = xText->getString();
344 table::ShadowFormat aShadowFmt;
350 uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc( pObjSh->
GetModel(), uno::UNO_QUERY );
351 if ( xSpreadDoc.is() )
353 uno::Reference<sheet::XSpreadsheets> xSheets = xSpreadDoc->getSheets();
354 uno::Reference<container::XIndexAccess> xIndex( xSheets, uno::UNO_QUERY );
358 uno::Reference<sheet::XSpreadsheet> xTable;
364 uno::Reference<beans::XPropertySet> xCellProps(xCell, uno::UNO_QUERY);
377 OUString sShadowAttrs(
"Shadow:");
378 OUString sInnerSplit(
",");
379 OUString sOuterSplit(
";");
380 sal_Int32 nLocationVal = 0;
381 switch( aShadowFmt.Location )
383 case table::ShadowLocation_TOP_LEFT:
386 case table::ShadowLocation_TOP_RIGHT:
389 case table::ShadowLocation_BOTTOM_LEFT:
392 case table::ShadowLocation_BOTTOM_RIGHT:
399 if ( nLocationVal == 0 )
401 sShadowAttrs += sOuterSplit;
405 sShadowAttrs +=
"Location=" +
406 OUString::number( nLocationVal ) +
409 OUString::number(
static_cast<sal_Int32
>(aShadowFmt.ShadowWidth) ) +
412 OUString::number(
static_cast<int>(aShadowFmt.IsTransparent) ) +
415 OUString::number( aShadowFmt.Color ) +
424 table::BorderLine aTopBorder;
425 table::BorderLine aBottomBorder;
426 table::BorderLine aLeftBorder;
427 table::BorderLine aRightBorder;
433 uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc( pObjSh->
GetModel(), uno::UNO_QUERY );
434 if ( xSpreadDoc.is() )
436 uno::Reference<sheet::XSpreadsheets> xSheets = xSpreadDoc->getSheets();
437 uno::Reference<container::XIndexAccess> xIndex( xSheets, uno::UNO_QUERY );
441 uno::Reference<sheet::XSpreadsheet> xTable;
447 uno::Reference<beans::XPropertySet> xCellProps(xCell, uno::UNO_QUERY);
453 aAny >>= aBottomBorder;
455 aAny >>= aLeftBorder;
457 aAny >>= aRightBorder;
470 aTopBorder.Color = sal_Int32(aColor);
471 aBottomBorder.Color = sal_Int32(aColor);
472 aLeftBorder.Color = sal_Int32(aColor);
473 aRightBorder.Color = sal_Int32(aColor);
481 OUString sBorderAttrs;
482 OUString sInnerSplit(
",");
483 OUString sOuterSplit(
";");
486 if ( aTopBorder.InnerLineWidth == 0 && aTopBorder.OuterLineWidth == 0 )
488 sBorderAttrs +=
"TopBorder:;";
492 sBorderAttrs +=
"TopBorder:Color=" +
493 OUString::number( aTopBorder.Color ) +
496 OUString::number(
static_cast<sal_Int32
>(aTopBorder.InnerLineWidth) ) +
499 OUString::number(
static_cast<sal_Int32
>(aTopBorder.OuterLineWidth) ) +
502 OUString::number(
static_cast<sal_Int32
>(aTopBorder.LineDistance) ) +
506 if ( aBottomBorder.InnerLineWidth == 0 && aBottomBorder.OuterLineWidth == 0 )
508 sBorderAttrs +=
"BottomBorder:;";
512 sBorderAttrs +=
"BottomBorder:Color=" +
513 OUString::number( aBottomBorder.Color ) +
516 OUString::number(
static_cast<sal_Int32
>(aBottomBorder.InnerLineWidth) ) +
519 OUString::number(
static_cast<sal_Int32
>(aBottomBorder.OuterLineWidth) ) +
522 OUString::number(
static_cast<sal_Int32
>(aBottomBorder.LineDistance) ) +
526 if ( aLeftBorder.InnerLineWidth == 0 && aLeftBorder.OuterLineWidth == 0 )
528 sBorderAttrs +=
"LeftBorder:;";
532 sBorderAttrs +=
"LeftBorder:Color=" +
533 OUString::number( aLeftBorder.Color ) +
536 OUString::number(
static_cast<sal_Int32
>(aLeftBorder.InnerLineWidth) ) +
539 OUString::number(
static_cast<sal_Int32
>(aLeftBorder.OuterLineWidth) ) +
542 OUString::number(
static_cast<sal_Int32
>(aLeftBorder.LineDistance) ) +
546 if ( aRightBorder.InnerLineWidth == 0 && aRightBorder.OuterLineWidth == 0 )
548 sBorderAttrs +=
"RightBorder:;";
552 sBorderAttrs +=
"RightBorder:Color=" +
553 OUString::number( aRightBorder.Color ) +
556 OUString::number(
static_cast<sal_Int32
>(aRightBorder.InnerLineWidth) ) +
559 OUString::number(
static_cast<sal_Int32
>(aRightBorder.OuterLineWidth) ) +
562 OUString::number(
static_cast<sal_Int32
>(aRightBorder.LineDistance) ) +
572 OUString strTrackText;
575 bool bLeftedge =
false;
578 if (!strTrackText.isEmpty())
581 strNote = strTrackText;
#define DEFAULT_LINE_WIDTH
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
===== XTypeProvider ===================================================
virtual sal_Int32 SAL_CALL getForeground() override
===== XAccessibleComponent ============================================
virtual ~ScAccessibleCellBase() override
virtual sal_Int64 SAL_CALL getAccessibleIndexInParent() override
===== XAccessibleContext ==============================================
OUString getShadowAttrs() const
virtual css::uno::Any SAL_CALL getCurrentValue() override
===== XAccessibleValue ================================================
virtual css::uno::Any SAL_CALL getMaximumValue() override
virtual OUString createAccessibleDescription() override
Return this object's description.
virtual OUString SAL_CALL getImplementationName() override
===== XServiceInfo ====================================================
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
Returns an implementation id.
virtual bool IsEditable(sal_Int64 nParentStates)
ScAccessibleCellBase(const css::uno::Reference< css::accessibility::XAccessible > &rxParent, ScDocument *pDoc, const ScAddress &rCellAddress, sal_Int64 nIndex)
virtual css::uno::Any SAL_CALL queryInterface(css::uno::Type const &rType) override
===== XInterface =====================================================
OUString GetAllDisplayNote() const
virtual sal_Bool SAL_CALL setCurrentValue(const css::uno::Any &aNumber) override
virtual css::uno::Any SAL_CALL getMinimumIncrement() override
OUString getBorderAttrs()
virtual void SAL_CALL acquire() noexcept override
virtual bool isVisible() override
virtual void SAL_CALL release() noexcept override
virtual OUString createAccessibleName() override
Return the object's current name.
virtual css::uno::Any SAL_CALL getMinimumValue() override
virtual sal_Int32 SAL_CALL getBackground() override
void IsObjectValid() const
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent() override
Return a reference to the parent.
SC_DLLPUBLIC void Format(OStringBuffer &r, ScRefFlags nFlags, const ScDocument *pDocument=nullptr, const Details &rDetails=detailsOOOa1) const
static void AppendChangTrackNoteSeparator(OUString &str)
bool SetValueCell(const ScAddress &rPos, double fVal, bool bInteraction)
bool IsCellInChangeTrack(const ScAddress &cell, Color *pColCellBorder)
SC_DLLPUBLIC bool RowFiltered(SCROW nRow, SCTAB nTab, SCROW *pFirstRow=nullptr, SCROW *pLastRow=nullptr) const
bool ColFiltered(SCCOL nCol, SCTAB nTab) const
SC_DLLPUBLIC double GetValue(const ScAddress &rPos) const
void GetCellChangeTrackNote(const ScAddress &cell, OUString &strTrackText, bool &pbLeftEdge)
SC_DLLPUBLIC bool RowHidden(SCROW nRow, SCTAB nTab, SCROW *pFirstRow=nullptr, SCROW *pLastRow=nullptr) const
SfxObjectShell * GetDocumentShell() const
SC_DLLPUBLIC bool ColHidden(SCCOL nCol, SCTAB nTab, SCCOL *pFirstCol=nullptr, SCCOL *pLastCol=nullptr) const
css::uno::Reference< css::frame::XModel3 > GetModel() const
virtual css::uno::Any SAL_CALL queryInterface(css::uno::Type const &rType) SAL_OVERRIDE
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() SAL_OVERRIDE
css::uno::Sequence< T > concatSequences(const css::uno::Sequence< T > &rS1, const Ss &... rSn)
constexpr OUStringLiteral STR_ACC_CELL_DESCR
constexpr OUStringLiteral SC_UNONAME_TOPBORDER
constexpr OUStringLiteral SC_UNONAME_BOTTBORDER
constexpr OUStringLiteral SC_UNONAME_CCOLOR
constexpr OUStringLiteral SC_UNONAME_RIGHTBORDER
constexpr OUStringLiteral SC_UNONAME_LEFTBORDER
constexpr OUStringLiteral SC_UNONAME_CELLBACK
constexpr OUStringLiteral SC_UNONAME_SHADOW