11#include <AccessibilityCheck.hxx>
12#include <AccessibilityIssue.hxx>
13#include <AccessibilityCheckStrings.hrc>
23#include <com/sun/star/frame/XModel.hpp>
24#include <com/sun/star/text/XTextContent.hpp>
25#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
26#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
63 if (pNode->IsTextNode())
71std::shared_ptr<sw::AccessibilityIssue>
75 auto pIssue = std::make_shared<sw::AccessibilityIssue>(eIssue);
76 pIssue->m_aIssueText = rText;
77 rIssueCollection.
getIssues().push_back(pIssue);
93class NoTextNodeAltTextCheck :
public NodeCheck
105 OUString sIssueText =
SwResId(STR_NO_ALT).replaceAll(
"%OBJECT_NAME%",
sName);
109 auto pIssue = lclAddIssue(m_rIssueCollection, sIssueText,
111 pIssue->setDoc(pNoTextNode->
GetDoc());
119 if (!(pIsDecorItem && pIsDecorItem->
GetValue()))
121 auto pIssue = lclAddIssue(m_rIssueCollection, sIssueText,
123 pIssue->setDoc(pNoTextNode->
GetDoc());
126 pIssue->setNode(pNoTextNode);
133 : NodeCheck(rIssueCollection)
143 checkNoTextNode(pNoTextNode);
149class TableNodeMergeSplitCheck :
public NodeCheck
156 OUString sIssueText =
SwResId(STR_TABLE_MERGE_SPLIT).replaceAll(
"%OBJECT_NAME%",
sName);
157 auto pIssue = lclAddIssue(m_rIssueCollection, sIssueText,
159 pIssue->setDoc(rDoc);
161 pIssue->setObjectID(
sName);
173 addTableIssue(rTable, rDoc);
180 size_t nFirstLineSize = 0;
181 bool bAllColumnsSameSize =
true;
182 bool bCellSpansOverMoreRows =
false;
188 nFirstLineSize = pTableLine->GetTabBoxes().size();
192 size_t nLineSize = pTableLine->GetTabBoxes().size();
193 if (nFirstLineSize != nLineSize)
195 bAllColumnsSameSize =
false;
201 for (
SwTableBox const* pBox : pTableLine->GetTabBoxes())
203 if (pBox->getRowSpan() > 1)
204 bCellSpansOverMoreRows =
true;
207 if (!bAllColumnsSameSize || bCellSpansOverMoreRows)
209 addTableIssue(rTable, rDoc);
217 : NodeCheck(rIssueCollection)
227 checkTableNode(pTableNode);
232class TableFormattingCheck :
public NodeCheck
243 size_t nEmptyBoxes = 0;
244 size_t nBoxCount = 0;
247 nBoxCount += pTableLine->GetTabBoxes().size();
248 for (
const SwTableBox* pBox : pTableLine->GetTabBoxes())
253 if (nEmptyBoxes > nBoxCount / 2)
254 lclAddIssue(m_rIssueCollection,
SwResId(STR_TABLE_FORMATTING),
261 : NodeCheck(rIssueCollection)
271 checkTableNode(pTableNode);
276class NumberingCheck :
public NodeCheck
280 {
"1.",
"2." }, {
"(1)",
"(2)" }, {
"1)",
"2)" }, {
"a.",
"b." }, {
"(a)",
"(b)" },
281 {
"a)",
"b)" }, {
"A.",
"B." }, {
"(A)",
"(B)" }, {
"A)",
"B)" }
286 : NodeCheck(rIssueCollection)
296 SwTextNode* pNextTextNode = lclSearchNextTextNode(pCurrent);
303 if (pCurrentTextNode->
GetText().startsWith(rPair.first)
304 && pNextTextNode->
GetText().startsWith(rPair.second))
306 OUString sNumbering = rPair.first +
" " + rPair.second +
"...";
308 =
SwResId(STR_FAKE_NUMBERING).replaceAll(
"%NUMBERING%", sNumbering);
309 auto pIssue = lclAddIssue(m_rIssueCollection, sIssueText,
312 pIssue->setDoc(pCurrent->
GetDoc());
313 pIssue->setNode(pCurrent);
319class HyperlinkCheck :
public NodeCheck
322 void checkTextRange(uno::Reference<text::XTextRange>
const& xTextRange,
SwTextNode* pTextNode,
325 uno::Reference<beans::XPropertySet> xProperties(xTextRange, uno::UNO_QUERY);
326 if (!xProperties->getPropertySetInfo()->hasPropertyByName(
"HyperLinkURL"))
330 xProperties->getPropertyValue(
"HyperLinkURL") >>= sHyperlink;
331 if (!sHyperlink.isEmpty())
333 OUString sText = xTextRange->getString();
337 =
SwResId(STR_HYPERLINK_TEXT_IS_LINK).replaceFirst(
"%LINK%", sHyperlink);
338 lclAddIssue(m_rIssueCollection, sIssueText,
341 else if (sText.getLength() <= 5)
343 auto pIssue = lclAddIssue(m_rIssueCollection,
SwResId(STR_HYPERLINK_TEXT_IS_SHORT),
346 pIssue->setNode(pTextNode);
348 pIssue->setDoc(rDocument);
349 pIssue->setStart(nStart);
350 pIssue->setEnd(nStart + sText.getLength());
357 : NodeCheck(rIssueCollection)
367 uno::Reference<text::XTextContent> xParagraph
369 if (!xParagraph.is())
372 uno::Reference<container::XEnumerationAccess> xRunEnumAccess(xParagraph, uno::UNO_QUERY);
373 uno::Reference<container::XEnumeration> xRunEnum = xRunEnumAccess->createEnumeration();
374 sal_Int32 nStart = 0;
375 while (xRunEnum->hasMoreElements())
377 uno::Reference<text::XTextRange> xRun(xRunEnum->nextElement(), uno::UNO_QUERY);
380 checkTextRange(xRun, pTextNode, nStart);
381 nStart += xRun->getString().getLength();
388double calculateRelativeLuminance(
Color const& rColor)
394 double r = aBColor.
getRed();
399 r = (r <= 0.03928) ? r / 12.92 : std::pow((r + 0.055) / 1.055, 2.4);
400 g = (g <= 0.03928) ? g / 12.92 : std::pow((g + 0.055) / 1.055, 2.4);
401 b = (b <= 0.03928) ? b / 12.92 : std::pow((b + 0.055) / 1.055, 2.4);
403 return 0.2126 * r + 0.7152 * g + 0.0722 * b;
408double calculateContrastRatio(
Color const& rColor1,
Color const& rColor2)
410 const double fLuminance1 = calculateRelativeLuminance(rColor1);
411 const double fLuminance2 = calculateRelativeLuminance(rColor2);
412 const std::pair<const double, const double> aMinMax = std::minmax(fLuminance1, fLuminance2);
417 return (aMinMax.second + 0.05) / (aMinMax.first + 0.05);
420class TextContrastCheck :
public NodeCheck
423 void checkTextRange(uno::Reference<text::XTextRange>
const& xTextRange,
424 uno::Reference<text::XTextContent>
const& xParagraph,
SwTextNode* pTextNode,
425 sal_Int32 nTextStart)
427 if (xTextRange->getString().isEmpty())
430 Color nParaBackColor(COL_AUTO);
431 uno::Reference<beans::XPropertySet> xParagraphProperties(xParagraph, uno::UNO_QUERY);
432 if (!(xParagraphProperties->getPropertyValue(
"ParaBackColor") >>= nParaBackColor))
434 SAL_WARN(
"sw.a11y",
"ParaBackColor void");
438 uno::Reference<beans::XPropertySet> xProperties(xTextRange, uno::UNO_QUERY);
439 if (!xProperties.is())
443 sal_Int32 nCharColor = {};
444 if (!(xProperties->getPropertyValue(
"CharColor") >>= nCharColor))
446 SAL_WARN(
"sw.a11y",
"CharColor void");
451 if (!pPageDescription)
458 Color aPageBackground(COL_AUTO);
460 if (pXFillStyleItem && pXFillStyleItem->GetValue() == css::drawing::FillStyle_SOLID)
467 Color nCharBackColor(COL_AUTO);
469 if (!(xProperties->getPropertyValue(
"CharBackColor") >>= nCharBackColor))
471 SAL_WARN(
"sw.a11y",
"CharBackColor void");
476 Color aBackgroundColor(nCharBackColor);
479 if (aBackgroundColor == COL_AUTO)
480 aBackgroundColor = nParaBackColor;
484 = lclAddIssue(m_rIssueCollection,
SwResId(STR_TEXT_FORMATTING_CONVEYS_MEANING),
487 pIssue->setNode(pTextNode);
489 pIssue->setDoc(rDocument);
490 pIssue->setStart(nTextStart);
491 pIssue->setEnd(nTextStart + xTextRange->getString().getLength());
494 Color aForegroundColor(ColorTransparency, nCharColor);
495 if (aForegroundColor == COL_AUTO)
499 if (aBackgroundColor == COL_AUTO)
500 aBackgroundColor = aPageBackground;
503 if (aBackgroundColor == COL_AUTO)
506 double fContrastRatio = calculateContrastRatio(aForegroundColor, aBackgroundColor);
507 if (fContrastRatio < 4.5)
509 auto pIssue = lclAddIssue(m_rIssueCollection,
SwResId(STR_TEXT_CONTRAST));
511 pIssue->setNode(pTextNode);
512 pIssue->setDoc(pTextNode->
GetDoc());
513 pIssue->setStart(nTextStart);
514 pIssue->setEnd(nTextStart + xTextRange->getString().getLength());
520 : NodeCheck(rIssueCollection)
530 uno::Reference<text::XTextContent> xParagraph;
532 if (!xParagraph.is())
535 uno::Reference<container::XEnumerationAccess> xRunEnumAccess(xParagraph, uno::UNO_QUERY);
536 uno::Reference<container::XEnumeration> xRunEnum = xRunEnumAccess->createEnumeration();
537 sal_Int32 nStart = 0;
538 while (xRunEnum->hasMoreElements())
540 uno::Reference<text::XTextRange> xRun(xRunEnum->nextElement(), uno::UNO_QUERY);
543 checkTextRange(xRun, xParagraph, pTextNode, nStart);
544 nStart += xRun->getString().getLength();
550class TextFormattingCheck :
public NodeCheck
554 : NodeCheck(rIssueCollection)
563 std::vector<OUString> aFormattings;
566 OUString sFormattingType;
567 switch (pItem->
Which())
572 sFormattingType =
"Weight";
577 sFormattingType =
"Posture";
581 sFormattingType =
"Shadowed";
585 sFormattingType =
"Font Color";
591 sFormattingType =
"Font Size";
597 sFormattingType =
"Font";
601 sFormattingType =
"Emphasis Mark";
605 sFormattingType =
"Underline";
609 sFormattingType =
"Overline";
613 sFormattingType =
"Strikethrough";
617 sFormattingType =
"Relief";
621 sFormattingType =
"Outline";
626 if (!sFormattingType.isEmpty())
627 aFormattings.push_back(sFormattingType);
628 pItem = aItemIter.NextItem();
630 if (aFormattings.empty())
634 auto pIssue = lclAddIssue(m_rIssueCollection,
SwResId(STR_TEXT_FORMATTING_CONVEYS_MEANING),
637 pIssue->setNode(pTextNode);
639 pIssue->setDoc(rDocument);
640 pIssue->setStart(pTextAttr->
GetStart());
653 for (
size_t i = 0;
i < rHints.
Count(); ++
i)
658 checkAutoFormat(pTextNode, pTextAttr);
666 auto nParagraphLength = pTextNode->
GetText().getLength();
667 if (nParagraphLength == 0)
685 = lclAddIssue(m_rIssueCollection,
SwResId(STR_TEXT_FORMATTING_CONVEYS_MEANING),
688 pIssue->setNode(pTextNode);
690 pIssue->setDoc(rDocument);
691 pIssue->setEnd(nParagraphLength);
697class NewlineSpacingCheck :
public NodeCheck
708 while (pTextNode ==
nullptr && nIndex >=
SwNodeOffset(0))
711 if (pNode->IsTextNode())
721 : NodeCheck(rIssueCollection)
734 auto nParagraphLength = pTextNode->
GetText().getLength();
735 if (nParagraphLength == 0)
737 SwTextNode* pPrevTextNode = getPrevTextNode(pCurrent);
740 if (pPrevTextNode->
GetText().getLength() == 0)
742 auto pIssue = lclAddIssue(m_rIssueCollection,
SwResId(STR_AVOID_NEWLINES_SPACE),
745 pIssue->setNode(pTextNode);
747 pIssue->setDoc(rDocument);
753 const OUString& sParagraphText = pTextNode->
GetText();
755 for (sal_Int32 i = 0;
i < nParagraphLength;
i++)
757 auto aChar = sParagraphText[
i];
766 = lclAddIssue(m_rIssueCollection,
SwResId(STR_AVOID_NEWLINES_SPACE),
769 pIssue->setNode(pTextNode);
771 pIssue->setDoc(rDocument);
777 else if (aChar !=
'\r')
786class SpaceSpacingCheck :
public NodeCheck
790 : NodeCheck(rIssueCollection)
798 auto nParagraphLength = pTextNode->
GetText().getLength();
799 const OUString& sParagraphText = pTextNode->
GetText();
800 sal_Int32 nSpaceCount = 0;
801 sal_Int32 nSpaceStart = 0;
802 sal_Int32 nTabCount = 0;
803 bool bNonSpaceFound =
false;
804 bool bPreviousWasChar =
false;
805 for (sal_Int32 i = 0;
i < nParagraphLength;
i++)
807 switch (sParagraphText[i])
814 if (nSpaceCount == 2)
821 if (bPreviousWasChar)
824 bPreviousWasChar =
false;
827 auto pIssue = lclAddIssue(m_rIssueCollection,
828 SwResId(STR_AVOID_TABS_FORMATTING),
831 pIssue->setNode(pTextNode);
833 pIssue->setDoc(rDocument);
835 pIssue->setEnd(nParagraphLength);
842 if (nSpaceCount >= 2)
845 = lclAddIssue(m_rIssueCollection,
SwResId(STR_AVOID_SPACES_SPACE),
848 pIssue->setNode(pTextNode);
850 pIssue->setDoc(rDocument);
851 pIssue->setStart(nSpaceStart);
852 pIssue->setEnd(nSpaceStart + nSpaceCount - 1);
854 bNonSpaceFound =
true;
855 bPreviousWasChar =
true;
864class FakeFootnoteCheck :
public NodeCheck
877 if (pEscapementItem->GetEscapement() == SvxEscapement::Superscript
880 auto pIssue = lclAddIssue(m_rIssueCollection,
SwResId(STR_AVOID_FAKE_FOOTNOTES),
883 pIssue->setNode(pTextNode);
885 pIssue->setDoc(rDocument);
887 pIssue->setEnd(pTextNode->
GetText().getLength());
891 pItem = aItemIter.NextItem();
897 : NodeCheck(rIssueCollection)
905 if (pTextNode->
GetText().getLength() == 0)
908 if (pTextNode->
GetText()[0] ==
'*')
910 auto pIssue = lclAddIssue(m_rIssueCollection,
SwResId(STR_AVOID_FAKE_FOOTNOTES),
913 pIssue->setNode(pTextNode);
915 pIssue->setDoc(rDocument);
917 pIssue->setEnd(pTextNode->
GetText().getLength());
922 for (
size_t i = 0;
i < rHints.
Count(); ++
i)
927 checkAutoFormat(pTextNode, pTextAttr);
934class FakeCaptionCheck :
public NodeCheck
938 : NodeCheck(rIssueCollection)
947 const OUString& sText = pTextNode->
GetText();
949 if (sText.getLength() == 0)
960 for (
auto aTextFrame = aIter.First(); aTextFrame; aTextFrame = aIter.Next())
962 auto aObjects = aTextFrame->GetDrawObjs();
964 nCount += aObjects->size();
974 sText.convertToString(&sTemp, RTL_TEXTENCODING_ASCII_US, 0);
975 if (sText.startsWith(
SwResId(STR_POOLCOLL_LABEL))
976 || sText.startsWith(
SwResId(STR_POOLCOLL_LABEL_ABB))
977 || sText.startsWith(
SwResId(STR_POOLCOLL_LABEL_TABLE))
978 || sText.startsWith(
SwResId(STR_POOLCOLL_LABEL_FRAME))
979 || sText.startsWith(
SwResId(STR_POOLCOLL_LABEL_DRAWING))
980 || sText.startsWith(
SwResId(STR_POOLCOLL_LABEL_FIGURE)))
982 auto pIssue = lclAddIssue(m_rIssueCollection,
SwResId(STR_AVOID_FAKE_CAPTIONS),
985 pIssue->setNode(pTextNode);
987 pIssue->setDoc(rDocument);
989 pIssue->setEnd(sText.getLength());
995class BlinkingTextCheck :
public NodeCheck
998 void checkTextRange(uno::Reference<text::XTextRange>
const& xTextRange)
1000 uno::Reference<beans::XPropertySet> xProperties(xTextRange, uno::UNO_QUERY);
1001 if (xProperties.is() && xProperties->getPropertySetInfo()->hasPropertyByName(
"CharFlash"))
1003 bool bBlinking =
false;
1004 xProperties->getPropertyValue(
"CharFlash") >>= bBlinking;
1008 lclAddIssue(m_rIssueCollection,
SwResId(STR_TEXT_BLINKING));
1015 : NodeCheck(rIssueCollection)
1025 uno::Reference<text::XTextContent> xParagraph;
1027 if (!xParagraph.is())
1030 uno::Reference<container::XEnumerationAccess> xRunEnumAccess(xParagraph, uno::UNO_QUERY);
1031 uno::Reference<container::XEnumeration> xRunEnum = xRunEnumAccess->createEnumeration();
1032 while (xRunEnum->hasMoreElements())
1034 uno::Reference<text::XTextRange> xRun(xRunEnum->nextElement(), uno::UNO_QUERY);
1036 checkTextRange(xRun);
1041class HeaderCheck :
public NodeCheck
1048 : NodeCheck(rIssueCollection)
1064 assert(nLevel >= 0);
1067 auto pIssue = lclAddIssue(m_rIssueCollection,
SwResId(STR_HEADINGS_NOT_IN_ORDER));
1069 pIssue->setDoc(pCurrent->
GetDoc());
1070 pIssue->setNode(pCurrent);
1077class NonInteractiveFormCheck :
public NodeCheck
1081 : NodeCheck(rIssueCollection)
1094 bool bCheck =
text.indexOf(
"___") == -1;
1097 bCheck =
text.indexOf(
"....") == -1;
1100 bCheck =
text.indexOf(u
"……") == -1;
1103 bCheck =
text.indexOf(u
"….") == -1;
1106 bCheck =
text.indexOf(u
".…") == -1;
1110 lclAddIssue(m_rIssueCollection,
SwResId(STR_NON_INTERACTIVE_FORMS));
1115class FloatingTextCheck :
public NodeCheck
1119 : NodeCheck(rIssueCollection)
1127 if (!textNode || textNode->
GetText().isEmpty())
1135 auto pIssue = lclAddIssue(m_rIssueCollection,
SwResId(STR_FLOATING_TEXT));
1138 pIssue->setDoc(pCurrent->
GetDoc());
1139 pIssue->setNode(pCurrent);
1145class TableHeadingCheck :
public NodeCheck
1153 : NodeCheck(rIssueCollection)
1172 lclAddIssue(m_rIssueCollection,
SwResId(STR_HEADING_IN_TABLE));
1179class HeadingOrderCheck :
public NodeCheck
1183 : NodeCheck(rIssueCollection)
1202 OUString resultString;
1205 resultString =
SwResId(STR_HEADING_START);
1209 resultString =
SwResId(STR_HEADING_ORDER);
1211 = resultString.replaceAll(
"%LEVEL_PREV%", OUString::number(
m_prevLevel));
1214 = resultString.replaceAll(
"%LEVEL_CURRENT%", OUString::number(currentLevel));
1215 lclAddIssue(m_rIssueCollection, resultString);
1228class ContentControlCheck :
public NodeCheck
1236 : NodeCheck(rIssueCollection)
1254 for (
size_t i = 0;
i < pHts->
Count(); ++
i)
1260 lclAddIssue(m_rIssueCollection,
1261 SwResId(STR_CONTENT_CONTROL_IN_HEADER_OR_FOOTER));
1271class DocumentCheck :
public BaseCheck
1275 : BaseCheck(rIssueCollection)
1283class DocumentDefaultLanguageCheck :
public DocumentCheck
1287 : DocumentCheck(rIssueCollection)
1296 if (eLanguage == LANGUAGE_NONE)
1298 lclAddIssue(m_rIssueCollection,
SwResId(STR_DOCUMENT_DEFAULT_LANGUAGE),
1305 const SwAttrSet& rAttrSet = pTextFormatCollection->GetAttrSet();
1308 OUString
sName = pTextFormatCollection->GetName();
1310 =
SwResId(STR_STYLE_NO_LANGUAGE).replaceAll(
"%STYLE_NAME%", sName);
1311 lclAddIssue(m_rIssueCollection, sIssueText,
1319class DocumentTitleCheck :
public DocumentCheck
1323 : DocumentCheck(rIssueCollection)
1333 const uno::Reference<document::XDocumentPropertiesSupplier> xDPS(pShell->
GetModel(),
1334 uno::UNO_QUERY_THROW);
1335 const uno::Reference<document::XDocumentProperties> xDocumentProperties(
1336 xDPS->getDocumentProperties());
1337 OUString sTitle = xDocumentProperties->getTitle();
1340 auto pIssue = lclAddIssue(m_rIssueCollection,
SwResId(STR_DOCUMENT_TITLE),
1342 pIssue->setDoc(*pDoc);
1348class FootnoteEndnoteCheck :
public DocumentCheck
1352 : DocumentCheck(rIssueCollection)
1361 auto pIssue = lclAddIssue(m_rIssueCollection, rFootnote.
IsEndNote()
1363 :
SwResId(STR_AVOID_FOOTNOTES));
1364 pIssue->setDoc(*pDoc);
1366 pIssue->setTextFootnote(pTextFootnote);
1371class BackgroundImageCheck :
public DocumentCheck
1375 : DocumentCheck(rIssueCollection)
1381 uno::Reference<style::XStyleFamiliesSupplier> xStyleFamiliesSupplier(xDoc, uno::UNO_QUERY);
1382 if (!xStyleFamiliesSupplier.is())
1384 uno::Reference<container::XNameAccess> xStyleFamilies
1385 = xStyleFamiliesSupplier->getStyleFamilies();
1386 uno::Reference<container::XNameAccess> xStyleFamily(xStyleFamilies->getByName(
"PageStyles"),
1388 if (!xStyleFamily.is())
1390 const uno::Sequence<OUString>& xStyleFamilyNames = xStyleFamily->getElementNames();
1391 for (
const OUString& rStyleFamilyName : xStyleFamilyNames)
1393 uno::Reference<beans::XPropertySet> xPropertySet(
1394 xStyleFamily->getByName(rStyleFamilyName), uno::UNO_QUERY);
1395 if (!xPropertySet.is())
1397 auto aFillStyleContainer = xPropertySet->getPropertyValue(
"FillStyle");
1398 if (aFillStyleContainer.has<drawing::FillStyle>())
1400 drawing::FillStyle aFillStyle = aFillStyleContainer.get<drawing::FillStyle>();
1401 if (aFillStyle == drawing::FillStyle_BITMAP)
1403 lclAddIssue(m_rIssueCollection,
SwResId(STR_AVOID_BACKGROUND_IMAGES),
1426 if (pAny->get<OUString>().startsWith(
"fontwork-"))
1437 pIssue->setObjectID(
pObject->GetName());
1440 pIssue->setNode(pCurrent);
1446 if (nObjId == SdrObjKind::CustomShape || nObjId == SdrObjKind::Text
1447 || nObjId == SdrObjKind::Media || nObjId == SdrObjKind::Group
1448 || nObjId == SdrObjKind::Graphic || nInv == SdrInventor::FmForm)
1450 OUString sAlternative =
pObject->GetTitle();
1451 if (sAlternative.isEmpty())
1454 OUString sIssueText =
SwResId(STR_NO_ALT).replaceAll(
"%OBJECT_NAME%",
sName);
1458 if (nInv == SdrInventor::FmForm)
1463 pIssue->setObjectID(
pObject->GetName());
1466 pIssue->setNode(pCurrent);
1506 if (
m_pDoc ==
nullptr || pNode ==
nullptr)
1511 for (std::shared_ptr<BaseCheck>& rpNodeCheck :
m_aNodeChecks)
1513 auto pNodeCheck =
dynamic_cast<NodeCheck*
>(rpNodeCheck.get());
1515 pNodeCheck->check(pNode);
1528 auto pDocumentCheck =
dynamic_cast<DocumentCheck*
>(rpDocumentCheck.get());
1530 pDocumentCheck->check(
m_pDoc);
1550 for (std::shared_ptr<BaseCheck>& rpNodeCheck :
m_aNodeChecks)
1552 auto pNodeCheck =
dynamic_cast<NodeCheck*
>(rpNodeCheck.get());
1554 pNodeCheck->check(pNode);
const std::vector< std::pair< OUString, OUString > > m_aNumberingCombinations
basegfx::BColor getBColor() const
css::uno::Any * GetPropertyValueByName(const OUString &rPropName)
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
css::uno::Reference< css::frame::XModel3 > GetModel() const
css::uno::Reference< css::frame::XModel3 > GetBaseModel() const
LanguageType GetLanguage() const
const SvxLanguageItem & GetLanguage(bool=true) const
bool HasSwAttrSet() const
const SwAttrSet & GetSwAttrSet() const
Does node has already its own auto-attributes? Access to SwAttrSet.
SwFootnoteIdxs & GetFootnoteIdxs()
const SfxPoolItem & GetDefault(sal_uInt16 nFormatHint) const
Get the default attribute in this document.
const SwTextFormatColls * GetTextFormatColls() const
SwDocShell * GetDocShell()
Layout frame for SwNoTextNode, i.e. graphics and OLE nodes (including charts).
OUString GetDescription() const
OUString GetTitle() const
Base class of the Writer document model elements.
SwFrameFormat * GetFlyFormat() const
If node is in a fly return the respective format.
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
SwNodeOffset GetIndex() const
const SwStartNode * FindFooterStartNode() const
SwNodes & GetNodes()
Node is in which nodes-array/doc?
SwTableBox * GetTableBox() const
If node is in a table return the respective table box.
const SwStartNode * FindHeaderStartNode() const
const SwStartNode * FindFlyStartNode() const
const SwPageDesc * FindPageDesc(SwNodeOffset *pPgDescNdIdx=nullptr) const
Search PageDesc with which this node is formatted.
SwTableNode * FindTableNode()
Search table node, in which it is.
SwNoTextNode * GetNoTextNode()
SwTableNode * GetTableNode()
SwNodeType GetNodeType() const
std::vector< SwFrameFormat * > const & GetAnchoredFlys() const
SwNodeOffset Count() const
SwFrameFormat & GetMaster()
SwTableBox is one table cell in the document model.
SwTableLine is one table row in the document model.
const SwTable & GetTable() const
SwTable is one table in the document model, containing rows (which contain cells).
SwTableLines & GetTabLines()
SwTableFormat * GetFrameFormat()
bool IsTableComplex() const
A wrapper around SfxPoolItem to store the start position of (usually) a text portion,...
sal_Int32 GetAnyEnd() const
end (if available), else start
sal_Int32 GetStart() const
const SwFormatAutoFormat & GetAutoFormat() const
Represents the style of a paragraph.
bool IsAssignedToListLevelOfOutlineStyle() const
int GetAssignedOutlineStyleLevel() const
SwTextNode is a paragraph in the document model.
SwpHints & GetSwpHints()
getters for SwpHints
int GetAttrOutlineLevel() const
Returns outline level of this text node.
SwpHints * GetpSwpHints()
const OUString & GetText() const
SwTextFormatColl * GetTextColl() const
static rtl::Reference< SwXParagraph > CreateXParagraph(SwDoc &rDoc, SwTextNode *pTextNode, css::uno::Reference< css::text::XText > const &xParentText=nullptr, const sal_Int32 nSelStart=-1, const sal_Int32 nSelEnd=- 1)
An SwTextAttr container, stores all directly formatted text portions for a text node.
SwTextAttr * Get(size_t nPos) const
const Color & GetColorValue() const
AccessibilityIssueCollection m_aIssueCollection
std::vector< std::shared_ptr< AccessibilityIssue > > & getIssues()
std::vector< std::shared_ptr< BaseCheck > > m_aDocumentChecks
void checkNode(SwNode *pNode)
void checkObject(SwNode *pNode, SdrObject *pObject)
std::vector< std::shared_ptr< BaseCheck > > m_aNodeChecks
void checkDocumentProperties()
Base class for accessibility checks.
constexpr ::Color COL_WHITE(0xFF, 0xFF, 0xFF)
EmbeddedObjectRef * pObject
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_CTL_FONTSIZE(28)
constexpr TypedWhichId< SvxCrossedOutItem > RES_CHRATR_CROSSEDOUT(5)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_CJK_FONT(22)
constexpr TypedWhichId< SvxUnderlineItem > RES_CHRATR_UNDERLINE(14)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_FONTSIZE(8)
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_LANGUAGE(10)
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_WEIGHT(15)
constexpr TypedWhichId< SvxShadowedItem > RES_CHRATR_SHADOWED(13)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_CJK_FONTSIZE(23)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_CTL_FONT(27)
constexpr TypedWhichId< SwFormatAutoFormat > RES_TXTATR_AUTOFMT(50)
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_CTL_WEIGHT(31)
constexpr TypedWhichId< SvxContourItem > RES_CHRATR_CONTOUR(4)
constexpr TypedWhichId< SvxCharReliefItem > RES_CHRATR_RELIEF(36)
constexpr TypedWhichId< SvxEscapementItem > RES_CHRATR_ESCAPEMENT(6)
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_CTL_POSTURE(30)
constexpr TypedWhichId< SvxEmphasisMarkItem > RES_CHRATR_EMPHASIS_MARK(33)
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_POSTURE(11)
constexpr TypedWhichId< SwFormatContentControl > RES_TXTATR_CONTENTCONTROL(56)
constexpr TypedWhichId< SvxOverlineItem > RES_CHRATR_OVERLINE(38)
constexpr TypedWhichId< SfxBoolItem > RES_DECORATIVE(140)
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_CJK_WEIGHT(26)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_FONT(7)
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_CJK_POSTURE(25)
constexpr TypedWhichId< SvxColorItem > RES_CHRATR_COLOR(3)
#define SAL_WARN(area, stream)
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC css::uno::Sequence< css::uno::Reference< css::xml::dom::XElement > > check(dp_misc::DescriptionInfoset const &infoset)
std::basic_string_view< charT, traits > trim(std::basic_string_view< charT, traits > str)
void remove_duplicates(std::vector< T > &rVector)
Dialog to specify the properties of date form field.
@ Table
SwTableNode is derived from SwStartNode.
o3tl::strong_int< sal_Int32, struct Tag_SwNodeOffset > SwNodeOffset
SwNodeOffset abs(const SwNodeOffset &a)
constexpr TypedWhichId< SdrCustomShapeGeometryItem > SDRATTR_CUSTOMSHAPE_GEOMETRY(SDRATTR_CUSTOMSHAPE_FIRST+2)
OUString SwResId(TranslateId aId)
constexpr TypedWhichId< XFillColorItem > XATTR_FILLCOLOR(XATTR_FILL_FIRST+1)