sw/qa: move getStyles from rtftok to base class, to be used by ooxmltok

Change-Id: I137c0a42ab8413213d93f1bbd868077e2c042ce0
This commit is contained in:
Miklos Vajna 2012-06-15 15:21:36 +02:00
parent 47e4a33a64
commit a234804c9d
2 changed files with 10 additions and 10 deletions

View File

@ -33,7 +33,6 @@
#include <com/sun/star/style/CaseMap.hpp>
#include <com/sun/star/style/LineSpacing.hpp>
#include <com/sun/star/style/LineSpacingMode.hpp>
#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
#include <com/sun/star/table/BorderLine2.hpp>
#include <com/sun/star/table/BorderLineStyle.hpp>
#include <com/sun/star/text/RelOrientation.hpp>
@ -144,7 +143,6 @@ private:
void load(const OUString& rURL);
/// Get page count.
int getPages();
uno::Reference<container::XNameAccess> getStyles(OUString aFamily);
};
void Test::load(const OUString& rFilename)
@ -161,14 +159,6 @@ int Test::getPages()
return xCursor->getPage();
}
uno::Reference<container::XNameAccess> Test::getStyles(OUString aFamily)
{
uno::Reference<style::XStyleFamiliesSupplier> xStyleFamiliesSupplier(mxComponent, uno::UNO_QUERY);
uno::Reference<container::XNameAccess> xStyles(xStyleFamiliesSupplier->getStyleFamilies(), uno::UNO_QUERY);
uno::Reference<container::XNameAccess> xPageStyles(xStyles->getByName(aFamily), uno::UNO_QUERY);
return xPageStyles;
}
void Test::testFdo45553()
{
load("fdo45553.rtf");

View File

@ -25,6 +25,7 @@
* instead of those above.
*/
#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
#include <com/sun/star/text/XTextDocument.hpp>
#include <test/bootstrapfixture.hxx>
@ -74,6 +75,15 @@ protected:
return aBuf.getLength();
}
/// Get a family of styles, see com.sun.star.style.StyleFamilies for possible values.
uno::Reference<container::XNameAccess> getStyles(rtl::OUString aFamily)
{
uno::Reference<style::XStyleFamiliesSupplier> xStyleFamiliesSupplier(mxComponent, uno::UNO_QUERY);
uno::Reference<container::XNameAccess> xStyleFamilies(xStyleFamiliesSupplier->getStyleFamilies(), uno::UNO_QUERY);
uno::Reference<container::XNameAccess> xStyleFamily(xStyleFamilies->getByName(aFamily), uno::UNO_QUERY);
return xStyleFamily;
}
uno::Reference<lang::XComponent> mxComponent;
};