/* -*- 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 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
uno::Reference<beans::XPropertySet> getShapeFromPage(int nShape, int nPage)
{
uno::Reference<drawing::XDrawPage> xPage(getPage(nPage));
uno::Reference<beans::XPropertySet> xShape(getShape(nShape, xPage));
CPPUNIT_ASSERT_MESSAGE("Failed to load shape", xShape.is());
return xShape;
}
// very confusing ... UNO index-based access to pages is 0-based. This one is 1-based const SdrPage* GetPage(int nPage)
{
SdXImpressDocument* pXImpressDocument
= dynamic_cast<SdXImpressDocument*>(mxComponent.get());
CPPUNIT_ASSERT(pXImpressDocument);
SdDrawDocument* pDoc = pXImpressDocument->GetDoc();
CPPUNIT_ASSERT_MESSAGE("no document", pDoc != nullptr);
uno::Reference<text::XTextField> getTextFieldFromPage(int nRun, int nPara, int nShape, int nPage)
{ // get TextShape 1 from the first page
uno::Reference<beans::XPropertySet> xShape(getShapeFromPage(nShape, nPage));
// Get first paragraph
uno::Reference<text::XTextRange> xParagraph(getParagraphFromShape(nPara, xShape));
// first chunk of text
uno::Reference<text::XTextRange> xRun(getRunFromParagraph(nRun, xParagraph));
¤ 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.0.13Bemerkung:
(vorverarbeitet)
¤
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.