tdf#158152: Make presenter console to "Console: file"

Add a new parameter pDrawDocShell to FullScreenPane to extract filename.
A new string STR_FULLSCREEN_CONSOLE is added for presenter console.
Now, the presenter console's title becomes "Console: file".

Change-Id: Ic18d00044dde602dd92210600e3c5311b46500b6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164515
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
diff --git a/sd/inc/strings.hrc b/sd/inc/strings.hrc
index 2522768..3ff7cac 100644
--- a/sd/inc/strings.hrc
+++ b/sd/inc/strings.hrc
@@ -155,6 +155,7 @@
#define STR_EFFECTDLG_PROGRAM                           NC_("STR_EFFECTDLG_PROGRAM", "Program")
#define STR_EFFECTDLG_MACRO                             NC_("STR_EFFECTDLG_MACRO", "Macro")
#define STR_FULLSCREEN_SLIDESHOW                        NC_("STR_FULLSCREEN_SLIDESHOW", "Presenting: %s")
#define STR_FULLSCREEN_CONSOLE                          NC_("STR_FULLSCREEN_CONSOLE", "Console: %s")

// To translators: this is the spinbutton in the slidesorter toolbar to set the number of slides to show per row
#define STR_SLIDES                                      NNC_("STR_SLIDES", "%1 slide", "%1 slides")
diff --git a/sd/source/ui/framework/factories/BasicPaneFactory.cxx b/sd/source/ui/framework/factories/BasicPaneFactory.cxx
index e112ac4..4ce694a 100644
--- a/sd/source/ui/framework/factories/BasicPaneFactory.cxx
+++ b/sd/source/ui/framework/factories/BasicPaneFactory.cxx
@@ -345,7 +345,8 @@ Reference<XResource> BasicPaneFactory::CreateFullScreenPane (
        new FullScreenPane(
            rxComponentContext,
            rxPaneId,
            mpViewShellBase->GetViewWindow()));
            mpViewShellBase->GetViewWindow(),
            mpViewShellBase->GetDocShell()));

    return xPane;
}
diff --git a/sd/source/ui/framework/factories/FullScreenPane.cxx b/sd/source/ui/framework/factories/FullScreenPane.cxx
index 39da061..202032b 100644
--- a/sd/source/ui/framework/factories/FullScreenPane.cxx
+++ b/sd/source/ui/framework/factories/FullScreenPane.cxx
@@ -26,6 +26,9 @@
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/util/URL.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <strings.hrc>
#include <sdresid.hxx>
#include <DrawDocShell.hxx>

using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -36,7 +39,8 @@ namespace sd::framework {
FullScreenPane::FullScreenPane (
    const Reference<XComponentContext>& rxComponentContext,
    const Reference<XResourceId>& rxPaneId,
    const vcl::Window* pViewShellWindow)
    const vcl::Window* pViewShellWindow,
    const DrawDocShell* pDrawDocShell)
    : FrameWindowPane(rxPaneId,nullptr),
      mxComponentContext(rxComponentContext)
{
@@ -76,10 +80,12 @@ FullScreenPane::FullScreenPane (

    // Set title and icon of the new window to those of the current window
    // of the view shell.
    if (pViewShellWindow != nullptr)
    if (pViewShellWindow != nullptr && pDrawDocShell != nullptr)
    {
        const SystemWindow* pSystemWindow = pViewShellWindow->GetSystemWindow();
        mpWorkWindow->SetText(pSystemWindow->GetText());
        SystemWindow* pSystemWindow = pViewShellWindow->GetSystemWindow();
        OUString Title(SdResId(STR_FULLSCREEN_CONSOLE));
        Title = Title.replaceFirst("%s", pDrawDocShell->GetTitle(SFX_TITLE_DETECT));
        mpWorkWindow->SetText(Title);
        mpWorkWindow->SetIcon(pSystemWindow->GetIcon());
    }

diff --git a/sd/source/ui/framework/factories/FullScreenPane.hxx b/sd/source/ui/framework/factories/FullScreenPane.hxx
index 138503d..fb5838d 100644
--- a/sd/source/ui/framework/factories/FullScreenPane.hxx
+++ b/sd/source/ui/framework/factories/FullScreenPane.hxx
@@ -27,6 +27,7 @@ class VclWindowEvent;

namespace vcl { class Window; }
namespace com::sun::star::uno { class XComponentContext; }
namespace sd { class DrawDocShell; }

namespace sd::framework {

@@ -43,13 +44,17 @@ public:
        @param rxPaneId
            The resource id of the new pane.
        @param pViewShellWindow
            The top-level parent of this window is used to obtain title and
            The top-level parent of this window is used to obtain
            icon for the new top-level window.
        @param pDrawDocShell
            The DrawDocShell parent of this window is used to obtain
            title for the new top-level window.
    */
    FullScreenPane (
        const css::uno::Reference<css::uno::XComponentContext>& rxComponentContext,
        const css::uno::Reference<css::drawing::framework::XResourceId>& rxPaneId,
        const vcl::Window* pViewShellWindow);
        const vcl::Window* pViewShellWindow,
        const DrawDocShell* pDrawDocShell);
    virtual ~FullScreenPane() noexcept override;

    virtual void SAL_CALL disposing() override;