diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2024-06-07 12:09:16 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2024-06-07 15:00:50 +0200 |
commit | 7023e0e8e50acc0a04f202352d948ab7606217b3 (patch) | |
tree | 68786eac84a6b9117219bc213621ed84200a9652 /framework | |
parent | 5f9a955042822d05af5c04b2c852738c7e1e21a2 (diff) |
CppunitTest_framework_CheckXTitle: simplify code a bit
Change-Id: I1e3fe2d081daf6c7b4097c266695f69c2f377b0d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168521
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'framework')
-rw-r--r-- | framework/qa/cppunit/CheckXTitle.cxx | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/framework/qa/cppunit/CheckXTitle.cxx b/framework/qa/cppunit/CheckXTitle.cxx index 8f15eb40d91a..227f89d7b240 100644 --- a/framework/qa/cppunit/CheckXTitle.cxx +++ b/framework/qa/cppunit/CheckXTitle.cxx @@ -40,13 +40,8 @@ CPPUNIT_TEST_FIXTURE(Test, checkDefaultTitle) // and asserts that the title doesn't change. // Load document - uno::Reference<lang::XMultiServiceFactory> xFactory(comphelper::getProcessServiceFactory()); - uno::Reference<uno::XInterface> xInterface - = xFactory->createInstance("com.sun.star.frame.Desktop"); - uno::Reference<frame::XComponentLoader> xComponentLoader(xInterface, uno::UNO_QUERY); uno::Sequence<beans::PropertyValue> aLoadArgs{ comphelper::makePropertyValue("Hidden", false) }; - mxComponent = xComponentLoader->loadComponentFromURL("private:factory/swriter", "_default", 0, - aLoadArgs); + loadWithParams("private:factory/swriter", aLoadArgs); uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY); uno::Reference<frame::XController> xController(xModel->getCurrentController()); @@ -89,8 +84,7 @@ CPPUNIT_TEST_FIXTURE(Test, checkTitleSuggestedFileName) uno::Sequence<beans::PropertyValue> aArguments = { comphelper::makePropertyValue(u"SuggestedSaveAsName"_ustr, u"suggestedname.odt"_ustr), comphelper::makePropertyValue(u"Hidden"_ustr, false) }; - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr, "com.sun.star.text.TextDocument", - aArguments); + loadWithParams("private:factory/swriter", aArguments); uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY); uno::Reference<frame::XController> xController(xModel->getCurrentController()); uno::Reference<frame::XDispatchProvider> xFrame(xController->getFrame(), uno::UNO_QUERY); @@ -106,13 +100,8 @@ CPPUNIT_TEST_FIXTURE(Test, setTitleAndCheck) // Set the frame title, then cycle through default and print preview. Close the window // and check for infinite recursion. - uno::Reference<lang::XMultiServiceFactory> xFactory(comphelper::getProcessServiceFactory()); - uno::Reference<uno::XInterface> xInterface - = xFactory->createInstance("com.sun.star.frame.Desktop"); - uno::Reference<frame::XComponentLoader> xComponentLoader(xInterface, uno::UNO_QUERY); uno::Sequence<beans::PropertyValue> aLoadArgs{ comphelper::makePropertyValue("Hidden", false) }; - mxComponent = xComponentLoader->loadComponentFromURL("private:factory/swriter", "_default", 0, - aLoadArgs); + loadWithParams("private:factory/swriter", aLoadArgs); uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY); uno::Reference<frame::XController> xController(xModel->getCurrentController()); |