From a234804c9de3f2659f766eae452b25eaf15eae22 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Fri, 15 Jun 2012 15:21:36 +0200 Subject: [PATCH] sw/qa: move getStyles from rtftok to base class, to be used by ooxmltok Change-Id: I137c0a42ab8413213d93f1bbd868077e2c042ce0 --- sw/qa/extras/rtftok/rtftok.cxx | 10 ---------- sw/qa/extras/swmodeltestbase.hxx | 10 ++++++++++ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/sw/qa/extras/rtftok/rtftok.cxx b/sw/qa/extras/rtftok/rtftok.cxx index e1f4fa76064a..e7ed1bb82297 100644 --- a/sw/qa/extras/rtftok/rtftok.cxx +++ b/sw/qa/extras/rtftok/rtftok.cxx @@ -33,7 +33,6 @@ #include #include #include -#include #include #include #include @@ -144,7 +143,6 @@ private: void load(const OUString& rURL); /// Get page count. int getPages(); - uno::Reference getStyles(OUString aFamily); }; void Test::load(const OUString& rFilename) @@ -161,14 +159,6 @@ int Test::getPages() return xCursor->getPage(); } -uno::Reference Test::getStyles(OUString aFamily) -{ - uno::Reference xStyleFamiliesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xStyles(xStyleFamiliesSupplier->getStyleFamilies(), uno::UNO_QUERY); - uno::Reference xPageStyles(xStyles->getByName(aFamily), uno::UNO_QUERY); - return xPageStyles; -} - void Test::testFdo45553() { load("fdo45553.rtf"); diff --git a/sw/qa/extras/swmodeltestbase.hxx b/sw/qa/extras/swmodeltestbase.hxx index 347d408c9b30..0ddd2266b830 100644 --- a/sw/qa/extras/swmodeltestbase.hxx +++ b/sw/qa/extras/swmodeltestbase.hxx @@ -25,6 +25,7 @@ * instead of those above. */ +#include #include #include @@ -74,6 +75,15 @@ protected: return aBuf.getLength(); } + /// Get a family of styles, see com.sun.star.style.StyleFamilies for possible values. + uno::Reference getStyles(rtl::OUString aFamily) + { + uno::Reference xStyleFamiliesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xStyleFamilies(xStyleFamiliesSupplier->getStyleFamilies(), uno::UNO_QUERY); + uno::Reference xStyleFamily(xStyleFamilies->getByName(aFamily), uno::UNO_QUERY); + return xStyleFamily; + } + uno::Reference mxComponent; };