class SwXTextDocument; namespace comphelper
{ class ConfigurationChanges;
} namespace vcl
{ namespace pdf
{ class PDFiumDocument;
}
}
/// Temporarily enables the ExportFormFields setting. class SWQAHELPER_DLLPUBLIC SwExportFormFieldsGuard
{
std::shared_ptr<comphelper::ConfigurationChanges> m_pBatch; bool m_bValue; public:
SwExportFormFieldsGuard();
~SwExportFormFieldsGuard();
};
/// Base class for filter tests loading or roundtripping a document, then asserting the document model. class SWQAHELPER_DLLPUBLIC SwModelTestBase : public UnoApiXmlTest
{ protected:
xmlBufferPtr mpXmlBuffer;
OUString mpFilter;
/** *Functionoverriddenbyunittest.SeeDECLARE_SW_*_TESTmacros
*/ virtualvoid verify()
{
CPPUNIT_FAIL( "verify method must be overridden" );
}
void calcLayout(bool bRecalc = false);
/// Get the body text of the whole document.
OUString getBodyText() const;
/// Get a family of styles, see com.sun.star.style.StyleFamilies for possible values.
css::uno::Reference<css::container::XNameAccess> getStyles(const OUString& aFamily);
/// Get a family of auto styles, see com.sun.star.style.StyleFamilies for possible values.
css::uno::Reference<css::style::XAutoStyleFamily> getAutoStyles(const OUString& aFamily);
/// Similar to parseExport(), but this gives the xmlDocPtr of the layout dump.
xmlDocUniquePtr parseLayoutDump(const css::uno::Reference< css::lang::XComponent >& xComponent = nullptr);
template< typename T >
T getProperty( const css::uno::Any& obj, const OUString& name ) const
{
css::uno::Reference< css::beans::XPropertySet > properties( obj, uno::UNO_QUERY_THROW );
T data; if (!css::uno::fromAny(properties->getPropertyValue(name), &data))
{
OString const msg("the property is of unexpected type or void: "
+ OUStringToOString(name, RTL_TEXTENCODING_UTF8));
CPPUNIT_FAIL(msg.getStr());
} return data;
}
template< typename T >
T getProperty( const css::uno::Reference< css::uno::XInterface >& obj, const OUString& name ) const
{
css::uno::Reference< css::beans::XPropertySet > properties( obj, uno::UNO_QUERY_THROW );
T data = T(); if (!(properties->getPropertyValue(name) >>= data))
{
OString const msg("the property is of unexpected type or void: "
+ OUStringToOString(name, RTL_TEXTENCODING_UTF8));
CPPUNIT_FAIL(msg.getStr());
} return data;
}
// Get paragraph (counted from 1), optionally check it contains the given text.
css::uno::Reference< css::text::XTextRange > getParagraph( int number, const OUString& content = OUString() ) const;
/// get nth object/fly that is anchored AT paragraph
css::uno::Reference<css::beans::XPropertySet> getParagraphAnchoredObject( intconst index, css::uno::Reference<css::text::XTextRange> const & xPara) const;
/// Get run (counted from 1) of a paragraph, optionally check it contains the given text.
css::uno::Reference<css::text::XTextRange> getRun(uno::Reference<css::text::XTextRange> const & xParagraph, int number, const OUString& content = OUString()) const;
/// Get math formula string of a run.
OUString getFormula(css::uno::Reference<css::text::XTextRange> const & xRun) const;
/// get cell of a table; table can be retrieved with getParagraphOrTable
css::uno::Reference<css::table::XCell> getCell(
css::uno::Reference<css::uno::XInterface> const& xTableIfc,
OUString const& rCell, OUString const& rContent = OUString());
/// Get shape (counted from 1)
css::uno::Reference<css::drawing::XShape> getShape(int number);
/// Select shape (counted from 1) void selectShape(int number);
/// Get shape by name
css::uno::Reference<css::drawing::XShape> getShapeByName(std::u16string_view aName);
/// Get TextFrame by name
css::uno::Reference<css::drawing::XShape> getTextFrameByName(const OUString& aName);
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.