sd/inc/strings.hrc                                    |    1 +
 sd/source/ui/framework/factories/BasicPaneFactory.cxx |    3 ++-
 sd/source/ui/framework/factories/FullScreenPane.cxx   |   14 ++++++++++----
 sd/source/ui/framework/factories/FullScreenPane.hxx   |    9 +++++++--
 4 files changed, 20 insertions(+), 7 deletions(-)

New commits:
commit 1999e2b35c8106fa959f04bbd381ddb49d257a1d
Author:     Baole Fang <baole.f...@gmail.com>
AuthorDate: Wed Mar 6 20:00:27 2024 -0500
Commit:     Thorsten Behrens <thorsten.behr...@allotropia.de>
CommitDate: Mon Mar 11 22:55:44 2024 +0100

    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.behr...@allotropia.de>

diff --git a/sd/inc/strings.hrc b/sd/inc/strings.hrc
index 2522768a6a7b..3ff7cac89795 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 e112ac4c315a..4ce694a2e7df 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 39da06144c09..202032b3d6f9 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 138503d02f1a..fb5838d9eccd 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;

Reply via email to