Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  xpcAccessibleTextLeafRange.cpp

  Sprache: C
 

/* 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 file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */


#include "xpcAccessibleTextLeafRange.h"

#include "nsIAccessible.h"
#include "TextLeafRange.h"
#include "xpcAccessibleDocument.h"

using namespace mozilla;
using namespace mozilla::a11y;

// xpcAccessibleTextLeafPoint

NS_IMPL_ADDREF(xpcAccessibleTextLeafPoint)
NS_IMPL_RELEASE(xpcAccessibleTextLeafPoint)

NS_IMPL_QUERY_INTERFACE(xpcAccessibleTextLeafPoint, nsIAccessibleTextLeafPoint)

xpcAccessibleTextLeafPoint::xpcAccessibleTextLeafPoint(
    nsIAccessible* aAccessible, int32_t aOffset)
    : mAccessible(nullptr), mOffset(0) {
  // When constructing a text point it will actualize the offset
  // and adjust the accessible to the appropriate leaf. These
  // might differ from the given constructor arguments.
  if (aAccessible) {
    TextLeafPoint point(aAccessible->ToInternalGeneric(), aOffset);
    mAccessible = ToXPC(point.mAcc);
    mOffset = point.mOffset;
  }
}

NS_IMETHODIMP xpcAccessibleTextLeafPoint::GetAccessible(
    nsIAccessible** aAccessible) {
  NS_ENSURE_ARG_POINTER(aAccessible);
  RefPtr<nsIAccessible> acc = mAccessible;
  acc.forget(aAccessible);
  return NS_OK;
}

NS_IMETHODIMP xpcAccessibleTextLeafPoint::SetAccessible(
    nsIAccessible* aAccessible) {
  mAccessible = aAccessible;
  return NS_OK;
}

NS_IMETHODIMP xpcAccessibleTextLeafPoint::GetOffset(int32_t* aOffset) {
  NS_ENSURE_ARG_POINTER(aOffset);
  *aOffset = mOffset;
  return NS_OK;
}
NS_IMETHODIMP xpcAccessibleTextLeafPoint::SetOffset(int32_t aOffset) {
  mOffset = aOffset;
  return NS_OK;
}

NS_IMETHODIMP xpcAccessibleTextLeafPoint::FindBoundary(
    AccessibleTextBoundary aBoundaryType, uint32_t aDirection, uint32_t aFlags,
    nsIAccessibleTextLeafPoint** aPoint) {
  TextLeafPoint thisPoint = ToPoint();
  if (!thisPoint) {
    return NS_ERROR_FAILURE;
  }

  TextLeafPoint result = thisPoint.FindBoundary(
      aBoundaryType, static_cast<nsDirection>(aDirection),
      static_cast<TextLeafPoint::BoundaryFlags>(aFlags));
  auto point = MakeRefPtr<xpcAccessibleTextLeafPoint>(
      result ? ToXPC(result.mAcc) : nullptr, result ? result.mOffset : 0);
  point.forget(aPoint);
  return NS_OK;
}

TextLeafPoint xpcAccessibleTextLeafPoint::ToPoint() {
  if (mAccessible) {
    return TextLeafPoint(mAccessible->ToInternalGeneric(), mOffset);
  }

  return TextLeafPoint();
}

Messung V0.5 in Prozent
C=94 H=100 G=96

¤ Dauer der Verarbeitung: 0.12 Sekunden  (vorverarbeitet am  2026-08-23) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

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.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

letze Version des Elbe Quellennavigators


Jenseits des Üblichen ....
    

Besucher

Besucher

Statistik
#Sources=141584
#Domains=752002