diff options
author | Baole Fang <baole.fang@gmail.com> | 2024-03-06 20:00:27 -0500 |
---|---|---|
committer | Thorsten Behrens <thorsten.behrens@allotropia.de> | 2024-03-11 22:55:44 +0100 |
commit | 1999e2b35c8106fa959f04bbd381ddb49d257a1d (patch) | |
tree | cc24f3dbcb75ade3259f419afa196d3ab084c18e /sd/source | |
parent | f8bb64a3cffb80793a6b3b9c41f78c5feccb168e (diff) |
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>
Diffstat (limited to 'sd/source')
-rw-r--r-- | sd/source/ui/framework/factories/BasicPaneFactory.cxx | 3 | ||||
-rw-r--r-- | sd/source/ui/framework/factories/FullScreenPane.cxx | 14 | ||||
-rw-r--r-- | sd/source/ui/framework/factories/FullScreenPane.hxx | 9 |
3 files changed, 19 insertions, 7 deletions
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; |