21 #include <document.hxx>
22 #include <docfunc.hxx>
24 #include <strings.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);
232 bool bResult =
false;
235 uno::Reference<XAccessibleStateSet> xParentStates;
238 uno::Reference<XAccessibleContext> xParentContext =
getAccessibleParent()->getAccessibleContext();
239 xParentStates = xParentContext->getAccessibleStateSet();
266 return "ScAccessibleCellBase";
276 uno::Sequence<sal_Int8> SAL_CALL
279 return css::uno::Sequence<sal_Int8>();
283 const uno::Reference<XAccessibleStateSet>& rxParentStates)
285 bool bEditable(
false);
286 if (rxParentStates.is() && rxParentStates->contains(AccessibleStateType::EDITABLE))
301 uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc( pObjSh->
GetModel(), uno::UNO_QUERY );
302 if ( xSpreadDoc.is() )
304 uno::Reference<sheet::XSpreadsheets> xSheets = xSpreadDoc->getSheets();
305 uno::Reference<container::XIndexAccess> xIndex( xSheets, uno::UNO_QUERY );
309 uno::Reference<sheet::XSpreadsheet> xTable;
315 uno::Reference <sheet::XSheetAnnotationAnchor> xAnnotationAnchor ( xCell, uno::UNO_QUERY);
316 if(xAnnotationAnchor.is())
318 uno::Reference <sheet::XSheetAnnotation> xSheetAnnotation = xAnnotationAnchor->getAnnotation();
319 if (xSheetAnnotation.is())
321 uno::Reference <text::XSimpleText> xText (xSheetAnnotation, uno::UNO_QUERY);
324 sNote = xText->getString();
341 table::ShadowFormat aShadowFmt;
347 uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc( pObjSh->
GetModel(), uno::UNO_QUERY );
348 if ( xSpreadDoc.is() )
350 uno::Reference<sheet::XSpreadsheets> xSheets = xSpreadDoc->getSheets();
351 uno::Reference<container::XIndexAccess> xIndex( xSheets, uno::UNO_QUERY );
355 uno::Reference<sheet::XSpreadsheet> xTable;
361 uno::Reference<beans::XPropertySet> xCellProps(xCell, uno::UNO_QUERY);
374 OUString sShadowAttrs(
"Shadow:");
375 OUString sInnerSplit(
",");
376 OUString sOuterSplit(
";");
377 sal_Int32 nLocationVal = 0;
378 switch( aShadowFmt.Location )
380 case table::ShadowLocation_TOP_LEFT:
383 case table::ShadowLocation_TOP_RIGHT:
386 case table::ShadowLocation_BOTTOM_LEFT:
389 case table::ShadowLocation_BOTTOM_RIGHT:
396 if ( nLocationVal == 0 )
398 sShadowAttrs += sOuterSplit;
402 sShadowAttrs +=
"Location=" +
403 OUString::number( nLocationVal ) +
406 OUString::number( static_cast<sal_Int32>(aShadowFmt.ShadowWidth) ) +
409 OUString::number( static_cast<int>(aShadowFmt.IsTransparent) ) +
412 OUString::number( aShadowFmt.Color ) +
421 table::BorderLine aTopBorder;
422 table::BorderLine aBottomBorder;
423 table::BorderLine aLeftBorder;
424 table::BorderLine aRightBorder;
430 uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc( pObjSh->
GetModel(), uno::UNO_QUERY );
431 if ( xSpreadDoc.is() )
433 uno::Reference<sheet::XSpreadsheets> xSheets = xSpreadDoc->getSheets();
434 uno::Reference<container::XIndexAccess> xIndex( xSheets, uno::UNO_QUERY );
438 uno::Reference<sheet::XSpreadsheet> xTable;
444 uno::Reference<beans::XPropertySet> xCellProps(xCell, uno::UNO_QUERY);
450 aAny >>= aBottomBorder;
452 aAny >>= aLeftBorder;
454 aAny >>= aRightBorder;
467 aTopBorder.Color = sal_Int32(aColor);
468 aBottomBorder.Color = sal_Int32(aColor);
469 aLeftBorder.Color = sal_Int32(aColor);
470 aRightBorder.Color = sal_Int32(aColor);
478 OUString sBorderAttrs;
479 OUString sInnerSplit(
",");
480 OUString sOuterSplit(
";");
483 if ( aTopBorder.InnerLineWidth == 0 && aTopBorder.OuterLineWidth == 0 )
485 sBorderAttrs +=
"TopBorder:;";
489 sBorderAttrs +=
"TopBorder:Color=" +
490 OUString::number( aTopBorder.Color ) +
493 OUString::number( static_cast<sal_Int32>(aTopBorder.InnerLineWidth) ) +
496 OUString::number( static_cast<sal_Int32>(aTopBorder.OuterLineWidth) ) +
499 OUString::number( static_cast<sal_Int32>(aTopBorder.LineDistance) ) +
503 if ( aBottomBorder.InnerLineWidth == 0 && aBottomBorder.OuterLineWidth == 0 )
505 sBorderAttrs +=
"BottomBorder:;";
509 sBorderAttrs +=
"BottomBorder:Color=" +
510 OUString::number( aBottomBorder.Color ) +
513 OUString::number( static_cast<sal_Int32>(aBottomBorder.InnerLineWidth) ) +
516 OUString::number( static_cast<sal_Int32>(aBottomBorder.OuterLineWidth) ) +
519 OUString::number( static_cast<sal_Int32>(aBottomBorder.LineDistance) ) +
523 if ( aLeftBorder.InnerLineWidth == 0 && aLeftBorder.OuterLineWidth == 0 )
525 sBorderAttrs +=
"LeftBorder:;";
529 sBorderAttrs +=
"LeftBorder:Color=" +
530 OUString::number( aLeftBorder.Color ) +
533 OUString::number( static_cast<sal_Int32>(aLeftBorder.InnerLineWidth) ) +
536 OUString::number( static_cast<sal_Int32>(aLeftBorder.OuterLineWidth) ) +
539 OUString::number( static_cast<sal_Int32>(aLeftBorder.LineDistance) ) +
543 if ( aRightBorder.InnerLineWidth == 0 && aRightBorder.OuterLineWidth == 0 )
545 sBorderAttrs +=
"RightBorder:;";
549 sBorderAttrs +=
"RightBorder:Color=" +
550 OUString::number( aRightBorder.Color ) +
553 OUString::number( static_cast<sal_Int32>(aRightBorder.InnerLineWidth) ) +
556 OUString::number( static_cast<sal_Int32>(aRightBorder.OuterLineWidth) ) +
559 OUString::number( static_cast<sal_Int32>(aRightBorder.LineDistance) ) +
569 OUString strTrackText;
572 bool bLeftedge =
false;
575 if (!strTrackText.isEmpty())
578 strNote = strTrackText;
virtual sal_Bool SAL_CALL setCurrentValue(const css::uno::Any &aNumber) override
virtual bool isVisible() override
SC_DLLPUBLIC void Format(OStringBuffer &r, ScRefFlags nFlags, const ScDocument *pDocument=nullptr, const Details &rDetails=detailsOOOa1) const
virtual css::uno::Any SAL_CALL getMinimumValue() override
virtual OUString createAccessibleDescription() override
Return this object's description.
#define DEFAULT_LINE_WIDTH
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
Returns an implementation id.
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent() override
Return a reference to the parent.
virtual void SAL_CALL release() override
css::uno::Reference< css::frame::XModel > GetModel() const
#define SC_UNONAME_CCOLOR
#define SC_UNONAME_CELLBACK
ScAccessibleCellBase(const css::uno::Reference< css::accessibility::XAccessible > &rxParent, ScDocument *pDoc, const ScAddress &rCellAddress, sal_Int32 nIndex)
#define SC_UNONAME_LEFTBORDER
bool ColFiltered(SCCOL nCol, SCTAB nTab) const
virtual OUString createAccessibleName() override
Return the object's current name.
SC_DLLPUBLIC double GetValue(const ScAddress &rPos) const
virtual OUString SAL_CALL getImplementationName() override
===== XServiceInfo ====================================================
bool SetValueCell(const ScAddress &rPos, double fVal, bool bInteraction)
#define SC_UNONAME_TOPBORDER
bool IsCellInChangeTrack(const ScAddress &cell, Color *pColCellBorder)
SC_DLLPUBLIC bool ColHidden(SCCOL nCol, SCTAB nTab, SCCOL *pFirstCol=nullptr, SCCOL *pLastCol=nullptr) const
void GetCellChangeTrackNote(const ScAddress &cell, OUString &strTrackText, bool &pbLeftEdge)
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
===== XTypeProvider ===================================================
SC_DLLPUBLIC bool RowFiltered(SCROW nRow, SCTAB nTab, SCROW *pFirstRow=nullptr, SCROW *pLastRow=nullptr) const
void IsObjectValid() const
OUString getBorderAttrs()
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
===== XTypeProvider ===================================================
virtual void SAL_CALL acquire() override
css::uno::Sequence< T > concatSequences(const css::uno::Sequence< T > &rS1, const Ss &...rSn)
virtual css::uno::Any SAL_CALL queryInterface(css::uno::Type const &rType) SAL_OVERRIDE
virtual ~ScAccessibleCellBase() override
virtual void SAL_CALL acquire() override
virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() override
===== XAccessibleContext ==============================================
OUString GetAllDisplayNote() const
static void AppendChangTrackNoteSeparator(OUString &str)
#define SC_UNONAME_SHADOW
#define SC_UNONAME_BOTTBORDER
OUString getShadowAttrs() const
virtual css::uno::Any SAL_CALL getMaximumValue() override
virtual bool IsEditable(const css::uno::Reference< css::accessibility::XAccessibleStateSet > &rxParentStates)
SC_DLLPUBLIC bool RowHidden(SCROW nRow, SCTAB nTab, SCROW *pFirstRow=nullptr, SCROW *pLastRow=nullptr) const
#define STR_ACC_CELL_DESCR
virtual void SAL_CALL release() override
SfxObjectShell * GetDocumentShell() const
virtual sal_Int32 SAL_CALL getBackground() override
virtual css::uno::Any SAL_CALL queryInterface(css::uno::Type const &rType) override
===== XInterface =====================================================
virtual css::uno::Any SAL_CALL queryInterface(css::uno::Type const &rType) override
===== XInterface =====================================================
virtual sal_Int32 SAL_CALL getForeground() override
===== XAccessibleComponent ============================================
#define SC_UNONAME_RIGHTBORDER
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() SAL_OVERRIDE
virtual css::uno::Any SAL_CALL getCurrentValue() override
===== XAccessibleValue ================================================