summaryrefslogtreecommitdiff
path: root/sd/source/ui/sidebar/MasterPagesSelector.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sd/source/ui/sidebar/MasterPagesSelector.cxx')
-rw-r--r--sd/source/ui/sidebar/MasterPagesSelector.cxx36
1 files changed, 15 insertions, 21 deletions
diff --git a/sd/source/ui/sidebar/MasterPagesSelector.cxx b/sd/source/ui/sidebar/MasterPagesSelector.cxx
index a70ba8ce22dd..776426158af8 100644
--- a/sd/source/ui/sidebar/MasterPagesSelector.cxx
+++ b/sd/source/ui/sidebar/MasterPagesSelector.cxx
@@ -35,40 +35,34 @@
#include "PreviewValueSet.hxx"
#include <ViewShellBase.hxx>
#include <o3tl/safeint.hxx>
-#include <vcl/commandevent.hxx>
#include <vcl/image.hxx>
-#include <vcl/weldutils.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/viewfrm.hxx>
#include <sfx2/sidebar/Theme.hxx>
#include <memory>
-using namespace ::com::sun::star::text;
-
namespace sd::sidebar {
/** menu entry that is executed as default action when the left mouse button is
clicked over a master page.
*/
-constexpr OStringLiteral gsDefaultClickAction = "applyselect";
+constexpr OUStringLiteral gsDefaultClickAction = u"applyselect";
MasterPagesSelector::MasterPagesSelector (
weld::Widget* pParent,
SdDrawDocument& rDocument,
ViewShellBase& rBase,
- const std::shared_ptr<MasterPageContainer>& rpContainer,
- const css::uno::Reference<css::ui::XSidebar>& rxSidebar)
- : PanelLayout( pParent, "MasterPagePanel", "modules/simpress/ui/masterpagepanel.ui" ),
- maMutex(),
- mpContainer(rpContainer),
+ std::shared_ptr<MasterPageContainer> pContainer,
+ css::uno::Reference<css::ui::XSidebar> xSidebar,
+ const OUString& rUIFileName,
+ const OUString& rValueSetName)
+ : PanelLayout( pParent, "MasterPagePanel", rUIFileName ),
+ mpContainer(std::move(pContainer)),
mxPreviewValueSet(new PreviewValueSet),
- mxPreviewValueSetWin(new weld::CustomWeld(*m_xBuilder, "valueset", *mxPreviewValueSet)),
+ mxPreviewValueSetWin(new weld::CustomWeld(*m_xBuilder, rValueSetName, *mxPreviewValueSet)),
mrDocument(rDocument),
mrBase(rBase),
- maCurrentItemList(),
- maTokenToValueSetIndex(),
- maLockedMasterPages(),
- mxSidebar(rxSidebar)
+ mxSidebar(std::move(xSidebar))
{
mxPreviewValueSet->SetSelectHdl (
LINK(this, MasterPagesSelector, ClickHandler));
@@ -216,7 +210,7 @@ void MasterPagesSelector::ProcessPopupMenu(weld::Menu& rMenu)
rMenu.set_sensitive("large", false);
}
-void MasterPagesSelector::ExecuteCommand(const OString &rIdent)
+void MasterPagesSelector::ExecuteCommand(const OUString &rIdent)
{
if (rIdent == "applyall")
{
@@ -254,16 +248,16 @@ void MasterPagesSelector::ExecuteCommand(const OString &rIdent)
assert(pMasterPage); //rhbz#902884
if (pMasterPage)
xSelectedMaster.set(pMasterPage->getUnoPage(), uno::UNO_QUERY);
- SfxViewFrame* pViewFrame = mrBase.GetViewFrame();
- if (pViewFrame != nullptr && xSelectedMaster.is())
+ SfxViewFrame& rViewFrame = mrBase.GetViewFrame();
+ if (xSelectedMaster.is())
{
- SfxDispatcher* pDispatcher = pViewFrame->GetDispatcher();
+ SfxDispatcher* pDispatcher = rViewFrame.GetDispatcher();
if (pDispatcher != nullptr)
{
sal_uInt16 nIndex = mxPreviewValueSet->GetSelectedItemId();
pDispatcher->Execute(SID_MASTERPAGE, SfxCallMode::SYNCHRON);
mxPreviewValueSet->SelectItem (nIndex);
- mrBase.GetDrawController().setCurrentPage(xSelectedMaster);
+ mrBase.GetDrawController()->setCurrentPage(xSelectedMaster);
}
}
}
@@ -541,7 +535,7 @@ void MasterPagesSelector::ClearPageSet()
mxPreviewValueSet->Clear();
}
-void MasterPagesSelector::SetHelpId( const OString& aId )
+void MasterPagesSelector::SetHelpId( const OUString& aId )
{
const ::osl::MutexGuard aGuard (maMutex);