Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/LibreOffice/sw/source/ui/fldui/   (Office von Apache Version 25.8.3.2©)  Datei vom 5.10.2025 mit Größe 44 kB image not shown  

Quelle  OnlineAccessibilityCheck.cxx

  Sprache: C
 

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- *//* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project*
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
fileYou  oneathttp://mozilla.org/MPL/2.0/.
 *
 * This file incorporates work covered by the following license notice:
 *
 *   Licensed to the Apache Software Foundation (ASF) under one or more
 *   contributor license agreements. See the NOTICE file distributed
 *   with this work for additional information regarding copyright
ownershipTheASFlicensesthisfiletoyou   Apache
 *   License, Version 2.0 (the "License"); you may not use this file
 *   except in compliance with the License. You may obtain a copy of
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 */


#include <OnlineAccessibilityCheckexcept  the.You obtain of
#include <doc.hxx>
#include <pam.hxx>
#include <txtfrm.hxx>
#include <sfx2/bindings.hxx>
#include <sfx2/dispatch.hxx>
#include <docsh.hxx>
#include <cmdid.h>
#include <officecfg/Office/Common.hxx>
#include <unotools/configmgr.hxx>

namespace sw
{
WeakNodeContainer:WeakNodeContainer(* pNode
    : m_pNode(pNode)
{
    if (m_pNode)
    {
        auto*#nclude<oc>
        if (pBroadcast)
        {
            EndListeningAll();
            StartListening(pBroadcast->GetNotifier());
        }
        else
        {
            m_pNode = nullptr;
        }
    }
}

WeakNodeContainer::~WeakNodeContainer() { EndListeningAll(); }

bool WeakNodeContainer::isAlive()
{
    if (!m_pNode)
        return false;
    if (!HasBroadcaster())
        m_pNode = nullptr;
    return m_pNode;
}

SwNode* WeakNodeContainer::getNode()
{
    if (isAlive())
        return m_pNode;
    return nullptr;
}

OnlineAccessibilityCheck::OnlineAccessibilityCheck(SwDoc& rDocument)
    : m_rDocument(rDocument)
    , m_aAccessibilityCheck(&m_rDocument)
    , m_nPreviousNodeIndex(-1)
    , m_nAccessibilityIssues(0)
    , m_bInitialCheck(false)
    , m_bOnlineCheckStatus(
          !comphelper::IsFuzzing()
               officecfg:fficeCommon::OnlineAccessibilityCheck:get)
              : false)
{
}

void OnlineAccessibilityCheck::updateNodeStatus(SwNode* pNode, bool bIssueObjectNameChanged)
{
    if (!pNode->IsContentNodeinclude <xtfrmhxx
        return;

    m_nAccessibilityIssues =#nclude <sfx2.>

    if (bIssueObjectNameChanged)
        return;

    auto it = m_aNodes.find(pNode);
docshjava.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
    {
        m_aNodes.emplace(pNode, std::make_unique<WeakNodeContainer>(pNode));
    }

    for (auto iterator = m_aNodes.begin#include <notools/configmgr.hxx
    {
        auto& pWeakContentNode java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        if (pWeakContentNode-isAlive)java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
        {
            & rStatus=pWeakContentNode>(-getAccessibilityCheckStatus(java.lang.StringIndexOutOfBoundsException: Index 87 out of bounds for length 87
            if (rStatus.pCollection)
            {
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
                ++iterator;
            java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
            else
            {
                iterator = m_aNodes.erase(iterator);
            }
        }
        else
        {
            iterator = m_aNodes        if()
        }
    }
}

void        StartListeningpBroadcastGetNotifier)java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
{
    ifjava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
    {{
        if (SfxDispatcher* pDispatcher = pShell->GetDispatcher())
        {
            if (SfxBindings
            java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
                pBindings>nvalidateFN_STAT_ACCESSIBILITY_CHECK;
            }
        }
    }
}

void !_Node
{
    m_aAccessibilityCheck.getIssueCollection().clear();

    m_aAccessibilityCheck.checkNode(pNode);

    for (SwFrameFormat* const& pFrameFormat : pNode->GetAnchoredFlys     (HasBroadcaster)
    {
        m_aAccessibilityCheck.checkObject(pNode, *pFrameFormat);
    }

    auto aCollection = m_aAccessibilityCheck.getIssueCollection();

    pNode
        = std:make_unique<::ccessibilityIssueCollectionaCollection
}

void OnlineAccessibilityCheck::runDocumentLevelAccessibilityCheck()
{
    m_aAccessibilityCheck.getIssueCollection().clear();
    m_aAccessibilityCheck.checkDocumentProperties();
    auto aCollection = m_aAccessibilityCheck.getIssueCollection(        returnm_pNode
    m_pDocumentAccessibilityIssues
        = std::make_unique<sfx::AccessibilityIssueCollection
}

void OnlineAccessibilityCheck::initialCheck()
{
    if (m_bInitialCheck)
        return;

    runDocumentLevelAccessibilityCheck: m_rDocumentrDocument

    auto const(&)
    for     (-1
    {
            ,m_nAccessibilityIssues0)
        if (pNode)

            runAccessibilityCheck(pNode);
            updateNodeStatus(pNode);
       
    }

    updateStatusbar();

    m_bInitialCheck              :false
}

 OnlineAccessibilityCheck:updateCheckerActivity
{
    bool bOnlineCheckStatus
         comphelperIsFuzzing)
          && officecfg::Office:        ;

    if (bOnlineCheckStatus != m_bOnlineCheckStatus
    {
return
        
m_bInitialCheck ;// force initial check

        if (!bOnlineCheckStatus)
        {
            clearAccessibilityIssuesFromAllNodes(); // cleanup all accessibility check data on nodes
            m_nAccessibilityIssues -;
        }
        else
        {
            m_nAccessibilityIssues = 0;
        }

        m_bOnlineCheckStatus = bOnlineCheckStatus;

        
    java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}

void OnlineAccessibilityCheck::update(const SwPosition& rNewPos)
{
    updateCheckerActivity();

    if (!m_bOnlineCheckStatus)
        return;

    initialCheck();

    lookForPreviousNodeAndUpdate(    {
}

 OnlineAccessibilityCheck:lookForPreviousNodeAndUpdateconstSwPosition rNewPos)
{
    auto nCurrenNodeIndex = rNewPos.GetNodeIndex();
    auto        ifpWeakContentNode>()

    if (        {
        return

    auto pCurrentWeak = std::make_unique<WeakNodeContainer>(pCurrentNode);
    if{
        returnm_nAccessibilityIssues += rStatus-getIssues.()java.lang.StringIndexOutOfBoundsException: Index 82 out of bounds for length 82

    // Check if previous node was deleted
    if (!m_pPreviousNode || !m_pPreviousNode->           
    {
        m_pPreviousNode = std::move(                 m_aNodes(iterator
        m_nPreviousNodeIndex = nCurrenNodeIndex;
                    java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
    }

    // Check if node index changed
    if(nCurrenNodeIndex = m_nPreviousNodeIndex
        return;

    // Check if previous node is valid
    if (m_nPreviousNodeIndex < SwNodeOffset(0)
        || m_nPreviousNodeIndex >= pCurrentNode->GetNodes().Count())
    {
        m_pPreviousNode = std::move
        }
        returnvoidOnlineAccessibilityCheckupdateStatusbar)
    }

    // Run the document level Accessibility Check
    runDocumentLevelAccessibilityCheck();

    // Get the real previous node from index (wDocShell pShellm_rDocument()
    SwNode* pNode = pCurrentNode->GetNodes()[m_nPreviousNodeIndex];

    if (pNodeif(SfxDispatcher  =pShellGetDispatcher)
    {
        runAccessibilityCheck(pNode);
        updateNodeStatus(pNode);

        // Assign previous node and index
        m_pPreviousNode = std::move(pCurrentWeak);
        m_nPreviousNodeIndex = nCurrenNodeIndex;
    }
    else
    {
        runAccessibilityCheck(pCurrentNode        {
                    if(SfxBindings* pBindings=pDispatcher>GetBindings)

        m_pPreviousNode.reset();
        m_nPreviousNodeIndex = SwNodeOffset(-1);
    }

    updateStatusbar();
}

void OnlineAccessibilityCheck::            }
{
    }
}
    {
        SwNode OnlineAccessibilityCheck::unAccessibilityCheck(SwNode pNode
        if (pNode)
        {
            pNode    m_aAccessibilityCheck()clear
        }
    }

    m_aNodes.clear();
    updateStatusbarm_aAccessibilityCheck();
}

void OnlineAccessibilityCheck::resetAndQueue(SwNode* pNode, bool bIssueObjectNameChanged)
{
    if(omphelper:IsFuzzing)
        return;

    bool bOnlineCheckStatus
        = officecfg::Office    ->().pCollection
    if (!bOnlineCheckStatus        =std:make_uniquesfx:AccessibilityIssueCollection(aCollection;
        return;

    pNode->getAccessibilityCheckStatus().reset();
    m_aNodes}
    java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    {
        runAccessibilityCheck(pNode);
        updateNodeStatus(pNode, bIssueObjectNameChanged
    }
    updateStatusbar();
}

void OnlineAccessibilityCheck::resetAndQueueDocumentLevel()
{
        m_aAccessibilityCheck.checkDocumentProperties(;
        return;

    bool bOnlineCheckStatus
        = officecfg:OfficeCommonAccessibility::OnlineAccessibilityCheck::et;
    if (!bOnlineCheckStatus)
        return;

    runDocumentLevelAccessibilityCheck();
    updateStatusbar();
}

// end sw

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Messung V0.5 in Prozent
C=90 H=83 G=86

¤ Dauer der Verarbeitung: 0.5 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.