diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-08 16:12:06 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-09 08:10:59 +0200 |
commit | 453879cfd8f4a8e22847043231a0929e4d50f238 (patch) | |
tree | e3f9e78f4be775a31f99e27e20747b54d2e9a941 /sd/source/ui/sidebar | |
parent | ec7e3609917092ee00667c78ff40cd4c2f0adec1 (diff) |
loplugin:constfields in sd
Change-Id: Ia072401c71dacf089b9f5213957c2cd25bb1a1b3
Reviewed-on: https://gerrit.libreoffice.org/61553
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd/source/ui/sidebar')
-rw-r--r-- | sd/source/ui/sidebar/LayoutMenu.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/sidebar/MasterPageContainerProviders.hxx | 6 | ||||
-rw-r--r-- | sd/source/ui/sidebar/MasterPageContainerQueue.cxx | 6 | ||||
-rw-r--r-- | sd/source/ui/sidebar/MasterPageContainerQueue.hxx | 2 | ||||
-rw-r--r-- | sd/source/ui/sidebar/MasterPageDescriptor.hxx | 6 | ||||
-rw-r--r-- | sd/source/ui/sidebar/MasterPagesSelector.cxx | 8 | ||||
-rw-r--r-- | sd/source/ui/sidebar/MasterPagesSelector.hxx | 4 | ||||
-rw-r--r-- | sd/source/ui/sidebar/RecentlyUsedMasterPages.cxx | 5 | ||||
-rw-r--r-- | sd/source/ui/sidebar/RecentlyUsedMasterPages.hxx | 3 | ||||
-rw-r--r-- | sd/source/ui/sidebar/SlideBackground.hxx | 14 |
10 files changed, 29 insertions, 29 deletions
diff --git a/sd/source/ui/sidebar/LayoutMenu.cxx b/sd/source/ui/sidebar/LayoutMenu.cxx index 0f623c705a3f..a3c50ad1a044 100644 --- a/sd/source/ui/sidebar/LayoutMenu.cxx +++ b/sd/source/ui/sidebar/LayoutMenu.cxx @@ -71,8 +71,8 @@ struct snewfoil_value_info { const char* msBmpResId; const char* mpStrResId; - WritingMode meWritingMode; - AutoLayout maAutoLayout; + WritingMode const meWritingMode; + AutoLayout const maAutoLayout; }; static const snewfoil_value_info notes[] = diff --git a/sd/source/ui/sidebar/MasterPageContainerProviders.hxx b/sd/source/ui/sidebar/MasterPageContainerProviders.hxx index da480cb1ac10..9ca123b1af0c 100644 --- a/sd/source/ui/sidebar/MasterPageContainerProviders.hxx +++ b/sd/source/ui/sidebar/MasterPageContainerProviders.hxx @@ -116,7 +116,7 @@ public: virtual SdPage* operator () (SdDrawDocument* pDocument) override; virtual int GetCostIndex() override; private: - OUString msURL; + OUString const msURL; SfxObjectShellLock mxDocumentShell; ::sd::DrawDocShell* LoadDocument (const OUString& sFileName); }; @@ -133,7 +133,7 @@ public: virtual int GetCostIndex() override; virtual bool NeedsPageObject() override; private: - OUString msURL; + OUString const msURL; }; /** Create an empty default master page. @@ -158,7 +158,7 @@ public: virtual SdPage* operator() (SdDrawDocument* pDocument) override; virtual int GetCostIndex() override; private: - SdPage* mpPage; + SdPage* const mpPage; }; } } // end of namespace sd::sidebar diff --git a/sd/source/ui/sidebar/MasterPageContainerQueue.cxx b/sd/source/ui/sidebar/MasterPageContainerQueue.cxx index 5493c2be72fb..98e42367e1f6 100644 --- a/sd/source/ui/sidebar/MasterPageContainerQueue.cxx +++ b/sd/source/ui/sidebar/MasterPageContainerQueue.cxx @@ -40,8 +40,8 @@ public: : mpDescriptor(rpDescriptor), mnPriority(nPriority) {} - SharedMasterPageDescriptor mpDescriptor; - int mnPriority; + SharedMasterPageDescriptor const mpDescriptor; + int const mnPriority; class Compare { public: @@ -63,7 +63,7 @@ public: class CompareToken { public: - MasterPageContainer::Token maToken; + MasterPageContainer::Token const maToken; explicit CompareToken(MasterPageContainer::Token aToken) : maToken(aToken) {} bool operator() (const PreviewCreationRequest& rRequest) const { return maToken==rRequest.mpDescriptor->maToken; } diff --git a/sd/source/ui/sidebar/MasterPageContainerQueue.hxx b/sd/source/ui/sidebar/MasterPageContainerQueue.hxx index 092af203e894..7857fd4752b0 100644 --- a/sd/source/ui/sidebar/MasterPageContainerQueue.hxx +++ b/sd/source/ui/sidebar/MasterPageContainerQueue.hxx @@ -77,7 +77,7 @@ public: void ProcessAllRequests(); private: - std::weak_ptr<ContainerAdapter> mpWeakContainer; + std::weak_ptr<ContainerAdapter> const mpWeakContainer; class PreviewCreationRequest; class RequestQueue; std::unique_ptr<RequestQueue> mpRequestQueue; diff --git a/sd/source/ui/sidebar/MasterPageDescriptor.hxx b/sd/source/ui/sidebar/MasterPageDescriptor.hxx index dfc7795189b5..9355c2a2f304 100644 --- a/sd/source/ui/sidebar/MasterPageDescriptor.hxx +++ b/sd/source/ui/sidebar/MasterPageDescriptor.hxx @@ -201,12 +201,12 @@ public: sal_Int32 mnUseCount; class URLComparator { public: - OUString msURL; + OUString const msURL; explicit URLComparator (const OUString& sURL); bool operator() (const SharedMasterPageDescriptor& rDescriptor); }; class StyleNameComparator { public: - OUString msStyleName; + OUString const msStyleName; explicit StyleNameComparator (const OUString& sStyleName); bool operator() (const SharedMasterPageDescriptor& rDescriptor); }; @@ -219,7 +219,7 @@ public: explicit AllComparator(const SharedMasterPageDescriptor& rDescriptor); bool operator() (const SharedMasterPageDescriptor& rDescriptor); private: - SharedMasterPageDescriptor mpDescriptor; + SharedMasterPageDescriptor const mpDescriptor; }; }; diff --git a/sd/source/ui/sidebar/MasterPagesSelector.cxx b/sd/source/ui/sidebar/MasterPagesSelector.cxx index a5b8479dee45..4fea1417a7a9 100644 --- a/sd/source/ui/sidebar/MasterPagesSelector.cxx +++ b/sd/source/ui/sidebar/MasterPagesSelector.cxx @@ -61,6 +61,11 @@ using namespace ::com::sun::star::text; namespace sd { namespace sidebar { + /** menu entry that is executed as default action when the left mouse button is + clicked over a master page. + */ +static const char gsDefaultClickAction[] = "applyselect"; + MasterPagesSelector::MasterPagesSelector ( vcl::Window* pParent, SdDrawDocument& rDocument, @@ -72,7 +77,6 @@ MasterPagesSelector::MasterPagesSelector ( mpContainer(rpContainer), mrDocument(rDocument), mrBase(rBase), - msDefaultClickAction("applyselect"), maCurrentItemList(), maTokenToValueSetIndex(), maLockedMasterPages(), @@ -171,7 +175,7 @@ IMPL_LINK_NOARG(MasterPagesSelector, ClickHandler, ValueSet*, void) // We use the framework to assign the clicked-on master page because we // so use the same mechanism as the context menu does (where we do not // have the option to call the assignment method directly.) - ExecuteCommand(msDefaultClickAction); + ExecuteCommand(gsDefaultClickAction); } IMPL_LINK(MasterPagesSelector, RightClickHandler, const MouseEvent&, rEvent, void) diff --git a/sd/source/ui/sidebar/MasterPagesSelector.hxx b/sd/source/ui/sidebar/MasterPagesSelector.hxx index 09090f70ee2d..c058368c2793 100644 --- a/sd/source/ui/sidebar/MasterPagesSelector.hxx +++ b/sd/source/ui/sidebar/MasterPagesSelector.hxx @@ -99,10 +99,6 @@ protected: SdDrawDocument& mrDocument; ViewShellBase& mrBase; - /** menu entry that is executed as default action when the left mouse button is - clicked over a master page. - */ - OString msDefaultClickAction; SdPage* GetSelectedMasterPage(); diff --git a/sd/source/ui/sidebar/RecentlyUsedMasterPages.cxx b/sd/source/ui/sidebar/RecentlyUsedMasterPages.cxx index 30785589e4ad..5d471b11d53f 100644 --- a/sd/source/ui/sidebar/RecentlyUsedMasterPages.cxx +++ b/sd/source/ui/sidebar/RecentlyUsedMasterPages.cxx @@ -85,10 +85,11 @@ RecentlyUsedMasterPages& RecentlyUsedMasterPages::Instance() return *mpInstance; } +static constexpr size_t gnMaxListSize(8); + RecentlyUsedMasterPages::RecentlyUsedMasterPages() : maListeners(), mvMasterPages(), - mnMaxListSize(8), mpContainer(new MasterPageContainer()) { } @@ -341,7 +342,7 @@ void RecentlyUsedMasterPages::AddMasterPage ( mpContainer->GetStyleNameForToken(aToken))); // Shorten list to maximal size. - while (mvMasterPages.size() > mnMaxListSize) + while (mvMasterPages.size() > gnMaxListSize) { mvMasterPages.pop_back (); } diff --git a/sd/source/ui/sidebar/RecentlyUsedMasterPages.hxx b/sd/source/ui/sidebar/RecentlyUsedMasterPages.hxx index 01747f2da040..88411a859c15 100644 --- a/sd/source/ui/sidebar/RecentlyUsedMasterPages.hxx +++ b/sd/source/ui/sidebar/RecentlyUsedMasterPages.hxx @@ -74,7 +74,7 @@ private: { return maToken==rDescriptor.maToken; } private: - ::sd::sidebar::MasterPageContainer::Token maToken; + ::sd::sidebar::MasterPageContainer::Token const maToken; }; }; @@ -87,7 +87,6 @@ private: typedef ::std::vector<Descriptor> MasterPageList; MasterPageList mvMasterPages; - unsigned long int mnMaxListSize; std::shared_ptr<MasterPageContainer> mpContainer; RecentlyUsedMasterPages(); diff --git a/sd/source/ui/sidebar/SlideBackground.hxx b/sd/source/ui/sidebar/SlideBackground.hxx index 7ad06782e278..a1035ec5aab1 100644 --- a/sd/source/ui/sidebar/SlideBackground.hxx +++ b/sd/source/ui/sidebar/SlideBackground.hxx @@ -124,12 +124,12 @@ private: css::uno::Reference<css::frame::XFrame> mxFrame; vcl::EnumContext maContext; - vcl::EnumContext maDrawOtherContext; - vcl::EnumContext maDrawMasterContext; - vcl::EnumContext maImpressOtherContext; - vcl::EnumContext maImpressMasterContext; - vcl::EnumContext maImpressHandoutContext; - vcl::EnumContext maImpressNotesContext; + vcl::EnumContext const maDrawOtherContext; + vcl::EnumContext const maDrawMasterContext; + vcl::EnumContext const maImpressOtherContext; + vcl::EnumContext const maImpressMasterContext; + vcl::EnumContext const maImpressHandoutContext; + vcl::EnumContext const maImpressNotesContext; bool mbTitle; std::unique_ptr<SvxLongLRSpaceItem> mpPageLRMarginItem; std::unique_ptr<SvxLongULSpaceItem> mpPageULMarginItem; @@ -139,7 +139,7 @@ private: long m_nPageBottomMargin; OUString maCustomEntry; - SfxBindings* mpBindings; + SfxBindings* const mpBindings; MapUnit meUnit; |