summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-11-02 16:09:12 +0000
committerCaolán McNamara <caolanm@redhat.com>2015-11-02 16:30:13 +0000
commit9bf204f9aa2caefac13a1a680a669ba74b3731cf (patch)
treecb89694cb9815e2f692a5a5e3106591825a9d9ed /desktop
parent5d0ef0015dee175802b468c6a946b967d17eef33 (diff)
afl-eventtesting: can simplify this now we use QueryExit
Change-Id: Iddb96f51ed2fd2d7861e9448a7aa221d998ad2a5
Diffstat (limited to 'desktop')
-rw-r--r--desktop/inc/app.hxx3
-rw-r--r--desktop/source/app/app.cxx41
2 files changed, 4 insertions, 40 deletions
diff --git a/desktop/inc/app.hxx b/desktop/inc/app.hxx
index 5c6de5b57743..d07d2853da38 100644
--- a/desktop/inc/app.hxx
+++ b/desktop/inc/app.hxx
@@ -160,8 +160,7 @@ class Desktop : public Application
/** for ui-testing provide a mechanism to pseudo-restart by closing the
open frames and reopen the frame that appeared post initial startup
*/
- static void CloseFrameAndReopen(css::uno::Reference<css::frame::XDesktop2> xDesktop);
- static void DoExecute(css::uno::Reference<css::frame::XDesktop2> xDesktop);
+ static void DoExecute();
/// does initializations which are necessary for the first run of the office
static void DoFirstRunInitializations();
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index a6b1e6335900..036caaa378cc 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -1277,45 +1277,10 @@ static ExecuteGlobals* pExecGlobals = NULL;
#define PERSIST_MAX 100
unsigned int persist_cnt;
-//This closes the current frame and reopens the initial frame, useful for
-//pseudo-restarting, i.e. attempt to effectively reset to the initial state of
-//the application post start-up for ui-testing
-void Desktop::CloseFrameAndReopen(Reference<XDesktop2> xDesktop)
-{
- css::uno::Reference<css::container::XIndexAccess> xTaskContainer(
- xDesktop->getFrames(), css::uno::UNO_QUERY_THROW);
- sal_Int32 c = xTaskContainer->getCount();
- for (sal_Int32 i = 0; i < c; ++i)
- {
- css::uno::Reference< css::frame::XFrame > xFrame;
- xTaskContainer->getByIndex(i) >>= xFrame;
- if (!xFrame.is())
- continue;
- Reference<css::frame::XDispatchProvider> xProvider(xFrame, css::uno::UNO_QUERY);
-
- css::uno::Reference<css::frame::XController > xController = xFrame->getController();
- css::uno::Reference<css::frame::XModel> xModel = xController->getModel();
- css::uno::Reference< css::util::XModifiable > xModifiable(xModel, css::uno::UNO_QUERY);
- xModifiable->setModified(false);
-
- css::util::URL aCommand;
- aCommand.Complete = ".uno:CloseDoc";
-
- css::uno::Reference<css::uno::XComponentContext> xContext = ::comphelper::getProcessComponentContext();
- Reference< css::util::XURLTransformer > xParser = css::util::URLTransformer::create(xContext);
- xParser->parseStrict(aCommand);
-
- css::uno::Reference< css::frame::XDispatch > xDispatch = xProvider->queryDispatch(aCommand, OUString(), 0);
- xDispatch->dispatch(aCommand, css::uno::Sequence< css::beans::PropertyValue >());
- }
-
- OpenDefault();
-}
-
//This just calls Execute() for all normal uses of LibreOffice, but for
//ui-testing if AFL_PERSISTENT is set then on exit it will pseudo-restart (up
//to PERSIST_MAX times)
-void Desktop::DoExecute(Reference<XDesktop2> xDesktop)
+void Desktop::DoExecute()
{
try_again:
{
@@ -1327,7 +1292,7 @@ try_again:
program is executed directly; and take note of PERSIST_MAX. */
if (getenv("AFL_PERSISTENT") && persist_cnt++ < PERSIST_MAX)
{
- CloseFrameAndReopen(xDesktop);
+ OpenDefault();
#if defined UNX
raise(SIGSTOP);
#endif
@@ -1651,7 +1616,7 @@ int Desktop::Main()
// if this run of the office is triggered by restart, some additional actions should be done
DoRestartActionsIfNecessary( !rCmdLineArgs.IsInvisible() && !rCmdLineArgs.IsNoQuickstart() );
- DoExecute(xDesktop);
+ DoExecute();
}
}
catch(const css::document::CorruptedFilterConfigurationException& exFilterCfg)