summaryrefslogtreecommitdiff
path: root/sw/source/uibase/uiview/view.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/uibase/uiview/view.cxx')
-rw-r--r--sw/source/uibase/uiview/view.cxx24
1 files changed, 13 insertions, 11 deletions
diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx
index 6244a6771818..c67ae50f800d 100644
--- a/sw/source/uibase/uiview/view.cxx
+++ b/sw/source/uibase/uiview/view.cxx
@@ -241,6 +241,18 @@ uno::Reference<frame::XLayoutManager> getLayoutManager(const SfxViewFrame& rView
}
}
+void SwView::ShowUIElement(const OUString& sElementURL) const
+{
+ if (auto xLayoutManager = getLayoutManager(*GetViewFrame()))
+ {
+ if (!xLayoutManager->getElement(sElementURL).is())
+ {
+ xLayoutManager->createElement(sElementURL);
+ xLayoutManager->showElement(sElementURL);
+ }
+ }
+}
+
void SwView::SelectShell()
{
// Attention: Maintain the SelectShell for the WebView additionally
@@ -444,17 +456,7 @@ void SwView::SelectShell()
// Show Mail Merge toolbar initially for documents with Database fields
if (!m_bInitOnceCompleted && GetWrtShell().IsAnyDatabaseFieldInDoc())
- {
- if (auto xLayoutManager = getLayoutManager(*GetViewFrame()))
- {
- const OUString sResourceURL("private:resource/toolbar/mailmerge");
- if (!xLayoutManager->getElement(sResourceURL).is())
- {
- xLayoutManager->createElement(sResourceURL);
- xLayoutManager->showElement(sResourceURL);
- }
- }
- }
+ ShowUIElement("private:resource/toolbar/mailmerge");
// Activate the toolbar to the new selection which also was active last time.
// Before a flush () must be, but does not affect the UI according to MBA and