Kaydet (Commit) a95c7069 authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl

sd html test: move local vars on top, clean-up

Change-Id: Iac393561337825e316a974801a6061944b8fd72a
üst 2dd1f71b
...@@ -18,7 +18,7 @@ using namespace rtl; ...@@ -18,7 +18,7 @@ using namespace rtl;
class SdHTMLFilterTest : public SdModelTestBase, public XmlTestTools, public HtmlTestTools class SdHTMLFilterTest : public SdModelTestBase, public XmlTestTools, public HtmlTestTools
{ {
private: private:
htmlDocPtr exportAndparseHtml(sd::DrawDocShellRef& xDocShRef) htmlDocPtr exportAndParseHtml(sd::DrawDocShellRef& xDocShRef)
{ {
FileFormat* pFormat = getFormat(HTML); FileFormat* pFormat = getFormat(HTML);
OUString aExt = OUString( "." ) + OUString::createFromAscii(pFormat->pName); OUString aExt = OUString( "." ) + OUString::createFromAscii(pFormat->pName);
...@@ -33,7 +33,7 @@ public: ...@@ -33,7 +33,7 @@ public:
void testHTMLExport() void testHTMLExport()
{ {
sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/HtmlExportTestDocument.odp")); sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/HtmlExportTestDocument.odp"));
htmlDocPtr htmlDoc = exportAndparseHtml(xDocShRef); htmlDocPtr htmlDoc = exportAndParseHtml(xDocShRef);
assertXPath(htmlDoc, "/html", 1); assertXPath(htmlDoc, "/html", 1);
assertXPath(htmlDoc, "/html/body", 1); assertXPath(htmlDoc, "/html/body", 1);
......
...@@ -63,10 +63,12 @@ FileFormat aFileFormats[] = { ...@@ -63,10 +63,12 @@ FileFormat aFileFormats[] = {
/// Base class for filter tests loading or roundtriping a document, and asserting the document model. /// Base class for filter tests loading or roundtriping a document, and asserting the document model.
class SdModelTestBase : public test::BootstrapFixture, public unotest::MacrosTest class SdModelTestBase : public test::BootstrapFixture, public unotest::MacrosTest
{ {
private:
uno::Reference<uno::XInterface> mxDrawComponent;
public: public:
SdModelTestBase() SdModelTestBase()
{ {}
}
virtual void setUp() SAL_OVERRIDE virtual void setUp() SAL_OVERRIDE
{ {
...@@ -74,13 +76,13 @@ public: ...@@ -74,13 +76,13 @@ public:
// This is a bit of a fudge, we do this to ensure that ScGlobals::ensure, // This is a bit of a fudge, we do this to ensure that ScGlobals::ensure,
// which is a private symbol to us, gets called // which is a private symbol to us, gets called
m_xDrawComponent = getMultiServiceFactory()->createInstance("com.sun.star.comp.Draw.PresentationDocument"); mxDrawComponent = getMultiServiceFactory()->createInstance("com.sun.star.comp.Draw.PresentationDocument");
CPPUNIT_ASSERT_MESSAGE("no impress component!", m_xDrawComponent.is()); CPPUNIT_ASSERT_MESSAGE("no impress component!", mxDrawComponent.is());
} }
virtual void tearDown() SAL_OVERRIDE virtual void tearDown() SAL_OVERRIDE
{ {
uno::Reference< lang::XComponent >( m_xDrawComponent, uno::UNO_QUERY_THROW )->dispose(); uno::Reference<lang::XComponent>(mxDrawComponent, uno::UNO_QUERY_THROW)->dispose();
test::BootstrapFixture::tearDown(); test::BootstrapFixture::tearDown();
} }
...@@ -230,10 +232,6 @@ protected: ...@@ -230,10 +232,6 @@ protected:
} }
xDocShRef->DoClose(); xDocShRef->DoClose();
} }
private:
uno::Reference<uno::XInterface> m_xDrawComponent;
}; };
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment