AccessiblePageShape::AccessiblePageShape (
uno::Reference<drawing::XDrawPage> xPage, const uno::Reference<XAccessible>& rxParent, const AccessibleShapeTreeInfo& rShapeTreeInfo)
: AccessibleShape (AccessibleShapeInfo (nullptr, rxParent), rShapeTreeInfo),
mxPage (std::move(xPage))
{ // The main part of the initialization is done in the init method which // has to be called from this constructor's caller.
}
/** Forward the request to the shape. Return the requested shape or throw anexceptionforawrongindex.
*/
uno::Reference<XAccessible> SAL_CALL
AccessiblePageShape::getAccessibleChild( sal_Int64 )
{ throw lang::IndexOutOfBoundsException (u"page shape has no children"_ustr, static_cast<uno::XWeak*>(this));
}
// Clip the shape's bounding box with the bounding box of its parent.
Reference<XAccessibleComponent> xParentComponent (
getAccessibleParent(), uno::UNO_QUERY); if (xParentComponent.is())
{ // Make the coordinates relative to the parent.
awt::Point aParentLocation (xParentComponent->getLocationOnScreen()); int x = aPixelPosition.getX() - aParentLocation.X; int y = aPixelPosition.getY() - aParentLocation.Y;
/** Extract the background color from the Background property of the drawpageoritsmasterpage.
*/
sal_Int32 SAL_CALL AccessiblePageShape::getBackground()
{
ensureAlive();
sal_Int32 nColor (0x01020ffL);
try
{
uno::Reference<beans::XPropertySet> xSet (mxPage, uno::UNO_QUERY); if (xSet.is())
{
uno::Any aBGSet = xSet->getPropertyValue (u"Background"_ustr);
Reference<beans::XPropertySet> xBGSet (aBGSet, uno::UNO_QUERY); if ( ! xBGSet.is())
{ // Draw page has no Background property. Try the master // page instead.
Reference<drawing::XMasterPageTarget> xTarget (mxPage, uno::UNO_QUERY); if (xTarget.is())
{
xSet.set(xTarget->getMasterPage(), uno::UNO_QUERY);
aBGSet = xSet->getPropertyValue (u"Background"_ustr);
xBGSet.set(aBGSet, uno::UNO_QUERY);
}
} // Fetch the fill color. Has to be extended to cope with // gradients, hashes, and bitmaps. if (xBGSet.is())
{
uno::Any aColor = xBGSet->getPropertyValue (u"FillColor"_ustr);
aColor >>= nColor;
} else
SAL_WARN("sd", "no Background property in page");
}
} catch (const css::beans::UnknownPropertyException&)
{
TOOLS_WARN_EXCEPTION("sd", "caught exception due to unknown property"); // Ignore exception and return default color.
} return nColor;
}
// Get name of the current slide.
OUString sCurrentSlideName; try
{ if (xPageProperties.is())
{
xPageProperties->getPropertyValue( u"LinkDisplayName"_ustr ) >>= sCurrentSlideName;
}
} catch (const beans::UnknownPropertyException&)
{
}
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.