Kaydet (Commit) 58b5c13b authored tarafından Miklos Vajna's avatar Miklos Vajna

sfx2: add SfxLokHelper

This is meant to be a class that is visible outside sfx2 (so e.g.
desktop can use it later), but has access to various sfx2 internals.

Change-Id: I83204963492b11c1c4a621e86528a64fba27acf3
üst 7b0de91f
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include <sfx2/dllapi.h>
class SfxViewShell;
class SFX2_DLLPUBLIC SfxLokHelper
{
public:
/// Create a new view shell for pViewShell's object shell.
static int createView(SfxViewShell* pViewShell);
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -297,6 +297,7 @@ $(eval $(call gb_Library_add_exception_objects,sfx,\
sfx2/source/view/frame2 \
sfx2/source/view/frmload \
sfx2/source/view/ipclient \
sfx2/source/view/lokhelper \
sfx2/source/view/printer \
sfx2/source/view/sfxbasecontroller \
sfx2/source/view/userinputinterception \
......
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include <sfx2/lokhelper.hxx>
#include <sfx2/viewsh.hxx>
#include <sfx2/request.hxx>
#include <sfx2/sfxsids.hrc>
#include <sfx2/viewfrm.hxx>
#include <shellimpl.hxx>
int SfxLokHelper::createView(SfxViewShell* pViewShell)
{
SfxViewFrame* pViewFrame = pViewShell->GetViewFrame();
SfxRequest aRequest(pViewFrame, SID_NEWWINDOW);
pViewFrame->ExecView_Impl(aRequest);
// The SfxViewShell ctor always puts the view shell to the end of the vector.
SfxViewShellArr_Impl& rViewArr = SfxGetpApp()->GetViewShells_Impl();
return rViewArr.size() - 1;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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