include/sfx2/lnkbase.hxx             |    7 --
 include/sfx2/objsh.hxx               |    2 
 sc/inc/autoform.hxx                  |    3 
 sc/inc/chgtrack.hxx                  |    2 
 sc/source/filter/inc/xihelper.hxx    |    2 
 sc/source/ui/inc/tpsubt.hxx          |   29 ++++-----
 sd/source/filter/eppt/grouptable.hxx |    2 
 sd/source/ui/inc/DrawDocShell.hxx    |    8 --
 sd/source/ui/inc/DrawViewShell.hxx   |  112 +++++++++++++++--------------------
 sd/source/ui/inc/ViewClipboard.hxx   |    4 -
 sd/source/ui/inc/unopage.hxx         |    3 
 sd/source/ui/inc/unosrch.hxx         |    2 
 starmath/inc/node.hxx                |    2 
 svtools/inc/framestatuslistener.hxx  |    2 
 14 files changed, 81 insertions(+), 99 deletions(-)

New commits:
commit 3de6d4d3c7b733fde0feef3d77aeb7c4c48724d0
Author:     Noel Grandin <[email protected]>
AuthorDate: Thu Nov 24 12:58:51 2022 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Thu Nov 24 13:51:10 2022 +0100

    loplugin:unusedfields make some fields private
    
    this is one of the secondary analyses this plugin performs
    
    Change-Id: I022b9eda994acbd25714025b666194266e896640
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143215
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>

diff --git a/include/sfx2/lnkbase.hxx b/include/sfx2/lnkbase.hxx
index cf108319758f..00f48067bbbe 100644
--- a/include/sfx2/lnkbase.hxx
+++ b/include/sfx2/lnkbase.hxx
@@ -88,6 +88,9 @@ private:
     bool                    bSynchron : 1;
     bool                    bWasLastEditOK : 1;
     bool                    m_bIsConnect : 1;
+    bool                    m_bIsReadOnly;
+    css::uno::Reference<css::io::XInputStream>
+                            m_xInputStreamToLoadFrom;
 
     DECL_DLLPRIVATE_LINK( EndEditHdl, const OUString&, void );
 
@@ -99,10 +102,6 @@ protected:
     // Set LinkSourceName without action
     void            SetName( const OUString & rLn );
 
-    bool            m_bIsReadOnly;
-    css::uno::Reference<css::io::XInputStream>
-                    m_xInputStreamToLoadFrom;
-
                     SvBaseLink();
                     SvBaseLink( SfxLinkUpdateMode nLinkType, 
SotClipboardFormatId nContentType );
     virtual         ~SvBaseLink() override;
diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx
index f27948d81b64..ef1a0a33e1dc 100644
--- a/include/sfx2/objsh.hxx
+++ b/include/sfx2/objsh.hxx
@@ -798,8 +798,10 @@ public:
 
     struct ModifyBlocker_Impl
     {
+    private:
         SfxObjectShell* pPersist;
         bool bWasEnabled;
+    public:
         ModifyBlocker_Impl( SfxObjectShell* pPersistP ) : pPersist( pPersistP )
         {
             bWasEnabled = pPersistP->IsEnableSetModified();
diff --git a/sc/inc/autoform.hxx b/sc/inc/autoform.hxx
index ee57b435f090..b6facd437e12 100644
--- a/sc/inc/autoform.hxx
+++ b/sc/inc/autoform.hxx
@@ -72,9 +72,10 @@ struct AutoFormatSwBlob
 /// Struct with version numbers of the Items
 struct ScAfVersions : public AutoFormatVersions
 {
-public:
+private:
     AutoFormatSwBlob swVersions;
 
+public:
     ScAfVersions();
 
     void Load( SvStream& rStream, sal_uInt16 nVer );
diff --git a/sc/inc/chgtrack.hxx b/sc/inc/chgtrack.hxx
index dde6beb837f6..24e4f653b165 100644
--- a/sc/inc/chgtrack.hxx
+++ b/sc/inc/chgtrack.hxx
@@ -104,8 +104,6 @@ class ScChangeActionLinkEntry
     ScChangeActionLinkEntry( const ScChangeActionLinkEntry& ) = delete;
     ScChangeActionLinkEntry& operator=( const ScChangeActionLinkEntry& ) = 
delete;
 
-protected:
-
     ScChangeActionLinkEntry*    pNext;
     ScChangeActionLinkEntry**   ppPrev;
     ScChangeAction*             pAction;
diff --git a/sc/source/filter/inc/xihelper.hxx 
b/sc/source/filter/inc/xihelper.hxx
index d887df2cd4da..746259e844e4 100644
--- a/sc/source/filter/inc/xihelper.hxx
+++ b/sc/source/filter/inc/xihelper.hxx
@@ -319,7 +319,7 @@ public:
     /** Returns the cached Calc error code, if this value has Error type, else 
0. */
     FormulaError        GetScError() const;
 
-protected:
+private:
     typedef ::std::unique_ptr< const ScTokenArray >   ScTokenArrayPtr;
 
     OUString            maStr;      /// Cached value is a string.
diff --git a/sc/source/ui/inc/tpsubt.hxx b/sc/source/ui/inc/tpsubt.hxx
index a6dfc3cb5a02..ecfa2ec18522 100644
--- a/sc/source/ui/inc/tpsubt.hxx
+++ b/sc/source/ui/inc/tpsubt.hxx
@@ -39,7 +39,20 @@ public:
                                       const SfxItemSet& rArgSet  );
     bool            DoFillItemSet   ( sal_uInt16        nGroupNo,
                                       SfxItemSet&   rArgSet  );
-protected:
+private:
+    void            Init            ();
+    void            FillListBoxes   ();
+    static ScSubTotalFunc  LbPosToFunc     ( sal_uInt16 nPos );
+    static sal_uInt16      FuncToLbPos     ( ScSubTotalFunc eFunc );
+    sal_uInt16          GetFieldSelPos  ( SCCOL nField );
+
+    // Handler ------------------------
+    DECL_LINK( SelectListBoxHdl, weld::ComboBox&, void );
+    DECL_LINK( SelectTreeListBoxHdl, weld::TreeView&, void );
+    DECL_LINK(CheckHdl, const weld::TreeView::iter_col&, void);
+    DECL_LINK(CheckBoxHdl, weld::Toggleable&, void);
+    void SelectHdl(const weld::Widget*);
+
     const OUString    aStrNone;
     const OUString    aStrColumn;
 
@@ -55,20 +68,6 @@ protected:
     std::unique_ptr<weld::TreeView> mxLbColumns;
     std::unique_ptr<weld::TreeView> mxLbFunctions;
     std::unique_ptr<weld::CheckButton> mxLbSelectAllColumns;
-
-private:
-    void            Init            ();
-    void            FillListBoxes   ();
-    static ScSubTotalFunc  LbPosToFunc     ( sal_uInt16 nPos );
-    static sal_uInt16      FuncToLbPos     ( ScSubTotalFunc eFunc );
-    sal_uInt16          GetFieldSelPos  ( SCCOL nField );
-
-    // Handler ------------------------
-    DECL_LINK( SelectListBoxHdl, weld::ComboBox&, void );
-    DECL_LINK( SelectTreeListBoxHdl, weld::TreeView&, void );
-    DECL_LINK(CheckHdl, const weld::TreeView::iter_col&, void);
-    DECL_LINK(CheckBoxHdl, weld::Toggleable&, void);
-    void SelectHdl(const weld::Widget*);
 };
 
 class ScTpSubTotalGroup1 final : public ScTpSubTotalGroup
diff --git a/sd/source/filter/eppt/grouptable.hxx 
b/sd/source/filter/eppt/grouptable.hxx
index 885f9574164e..39a6a13a8091 100644
--- a/sd/source/filter/eppt/grouptable.hxx
+++ b/sd/source/filter/eppt/grouptable.hxx
@@ -45,8 +45,6 @@ struct GroupEntry
 
 class GroupTable
 {
-    protected:
-
         sal_uInt32              mnIndex;
         sal_uInt32              mnGroupsClosed;
         std::vector<GroupEntry> mvGroupEntry;
diff --git a/sd/source/ui/inc/DrawDocShell.hxx 
b/sd/source/ui/inc/DrawDocShell.hxx
index 15fa5ebd41ad..86917fcb7402 100644
--- a/sd/source/ui/inc/DrawDocShell.hxx
+++ b/sd/source/ui/inc/DrawDocShell.hxx
@@ -203,7 +203,9 @@ public:
 
     std::vector<Color> GetThemeColors() override;
 
-protected:
+private:
+    static void setEditMode(DrawViewShell* pDrawViewShell, bool isMasterPage);
+    void                    Construct(bool bClipboard);
 
     SdDrawDocument*         mpDoc;
     std::unique_ptr<SfxUndoManager> mpUndoManager;
@@ -218,11 +220,7 @@ protected:
     bool                    mbSdDataObj;
     bool                    mbInDestruction;
     bool                    mbOwnPrinter;
-
     bool                    mbOwnDocument;          // if true, we own mpDoc 
and will delete it in our d'tor
-    void                    Construct(bool bClipboard);
-private:
-    static void setEditMode(DrawViewShell* pDrawViewShell, bool isMasterPage);
 };
 
 #ifndef SV_DECL_DRAW_DOC_SHELL_DEFINED
diff --git a/sd/source/ui/inc/DrawViewShell.hxx 
b/sd/source/ui/inc/DrawViewShell.hxx
index e0ae9746f24a..a8e48c723d2e 100644
--- a/sd/source/ui/inc/DrawViewShell.hxx
+++ b/sd/source/ui/inc/DrawViewShell.hxx
@@ -376,24 +376,6 @@ public:
     //move this method to ViewShell.
     //void  NotifyAccUpdate();
 protected:
-    std::unique_ptr<DrawView> mpDrawView;
-    SdPage*             mpActualPage;
-    ::tools::Rectangle           maMarkRect;
-    Point               maMousePos;
-    VclPtr<TabControl>  maTabControl;
-    EditMode            meEditMode;
-    PageKind            mePageKind;
-    // tdf#137445 at context menu popup time set if the EditHyperlink entry
-    // should be disabled and use that state if queried about it if
-    // EditHyperlink is dispatched from the menu. So ignoring where the mouse
-    // currently happens to be when the menu was dismissed.
-    std::optional<bool> moAtContextMenu_DisableEditHyperlink;
-    bool                mbZoomOnPage;
-    bool                mbIsRulerDrag;
-    sal_uLong           mnLockCount;
-    bool                mbReadOnly;
-    static bool         mbPipette;
-
                     DECL_DLLPRIVATE_LINK( ClipboardChanged, 
TransferableDataHelper*, void );
                     DECL_DLLPRIVATE_LINK( TabSplitHdl, TabBar *, void );
                     DECL_DLLPRIVATE_LINK( NameObjectHdl, 
AbstractSvxObjectNameDialog&, bool );
@@ -414,37 +396,6 @@ protected:
     void            GetMenuStateSel(SfxItemSet& rSet);
 
 private:
-    /** Prevents grabbing focus while loading - see tdf#83773 that introduced
-        the grabbing, and tdf#150773 that needs grabbing disabled on loading
-    */
-    bool mbFirstTimeActivation = true;
-
-    /** This flag controls whether the layer mode is active, i.e. the layer
-        dialog is visible.
-    */
-    bool mbIsLayerModeActive;
-
-    /** This item contains the clipboard formats of the current clipboard
-        content that are supported both by that content and by the
-        DrawViewShell.
-    */
-    ::std::unique_ptr<SvxClipboardFormatItem> mpCurrentClipboardFormats;
-
-    /** On some occasions it is necessary to make SwitchPage calls
-        asynchronously.
-    */
-    tools::AsynchronousCall maAsynchronousSwitchPageCall;
-
-    /** This flag is used to prevent nested calls to SwitchPage().
-    */
-    bool mbIsInSwitchPage;
-
-    RotateTransliteration m_aRotateCase;
-
-    /** Listen for selection changes and broadcast context changes for the 
sidebar.
-    */
-    ::rtl::Reference<svx::sidebar::SelectionChangeHandler> 
mpSelectionChangeHandler;
-
     void Construct (DrawDocShell* pDocSh, PageKind ePageKind);
 
     /** Depending on the given request create a new page or duplicate an
@@ -459,13 +410,6 @@ private:
 
     void DuplicateSelectedSlides (SfxRequest& rRequest);
 
-    css::uno::Reference< css::scanner::XScannerManager2 > mxScannerManager;
-    css::uno::Reference< css::lang::XEventListener >      mxScannerListener;
-    rtl::Reference<TransferableClipboardListener>         mxClipEvtLstnr;
-    bool                                                  mbPastePossible;
-    bool                                                  mbMouseButtonDown;
-    bool                                                  mbMouseSelecting;
-
     virtual void Notify (SfxBroadcaster& rBC, const SfxHint& rHint) override;
 
     /** Stop a running slide show.
@@ -491,11 +435,6 @@ private:
 
     using ViewShell::Notify;
 
-    ::std::unique_ptr< AnnotationManager > mpAnnotationManager;
-    ::std::unique_ptr< ViewOverlayManager > mpViewOverlayManager;
-
-    std::vector<std::unique_ptr<SdrExternalToolEdit>> m_ExternalEdits;
-
     virtual void ConfigurationChanged( utl::ConfigurationBroadcaster* pCb, 
ConfigurationHints ) override;
 
     void ConfigureAppBackgroundColor( svtools::ColorConfig* pColorConfig = 
nullptr );
@@ -506,6 +445,57 @@ private:
     /// later Invalidated to reset it back to its natural value
     void EnableEditHyperlink();
 
+private:
+    std::unique_ptr<DrawView> mpDrawView;
+    SdPage*             mpActualPage;
+    ::tools::Rectangle           maMarkRect;
+    Point               maMousePos;
+    VclPtr<TabControl>  maTabControl;
+    EditMode            meEditMode;
+    PageKind            mePageKind;
+    // tdf#137445 at context menu popup time set if the EditHyperlink entry
+    // should be disabled and use that state if queried about it if
+    // EditHyperlink is dispatched from the menu. So ignoring where the mouse
+    // currently happens to be when the menu was dismissed.
+    std::optional<bool> moAtContextMenu_DisableEditHyperlink;
+    bool                mbZoomOnPage;
+    bool                mbIsRulerDrag;
+    sal_uLong           mnLockCount;
+    bool                mbReadOnly;
+    static bool         mbPipette;
+    /** Prevents grabbing focus while loading - see tdf#83773 that introduced
+        the grabbing, and tdf#150773 that needs grabbing disabled on loading
+    */
+    bool mbFirstTimeActivation = true;
+    /** This flag controls whether the layer mode is active, i.e. the layer
+        dialog is visible.
+    */
+    bool mbIsLayerModeActive;
+    /** This item contains the clipboard formats of the current clipboard
+        content that are supported both by that content and by the
+        DrawViewShell.
+    */
+    ::std::unique_ptr<SvxClipboardFormatItem> mpCurrentClipboardFormats;
+    /** On some occasions it is necessary to make SwitchPage calls
+        asynchronously.
+    */
+    tools::AsynchronousCall maAsynchronousSwitchPageCall;
+    /** This flag is used to prevent nested calls to SwitchPage().
+    */
+    bool mbIsInSwitchPage;
+    RotateTransliteration m_aRotateCase;
+    /** Listen for selection changes and broadcast context changes for the 
sidebar.
+    */
+    ::rtl::Reference<svx::sidebar::SelectionChangeHandler> 
mpSelectionChangeHandler;
+    css::uno::Reference< css::scanner::XScannerManager2 > mxScannerManager;
+    css::uno::Reference< css::lang::XEventListener >      mxScannerListener;
+    rtl::Reference<TransferableClipboardListener>         mxClipEvtLstnr;
+    bool                                                  mbPastePossible;
+    bool                                                  mbMouseButtonDown;
+    bool                                                  mbMouseSelecting;
+    ::std::unique_ptr< AnnotationManager > mpAnnotationManager;
+    ::std::unique_ptr< ViewOverlayManager > mpViewOverlayManager;
+    std::vector<std::unique_ptr<SdrExternalToolEdit>> m_ExternalEdits;
     // The colour of the area behind the slide (used to be called "Wiese")
     Color mnAppBackgroundColor;
 };
diff --git a/sd/source/ui/inc/ViewClipboard.hxx 
b/sd/source/ui/inc/ViewClipboard.hxx
index f16c0ad33781..d39fdb8f0bbb 100644
--- a/sd/source/ui/inc/ViewClipboard.hxx
+++ b/sd/source/ui/inc/ViewClipboard.hxx
@@ -32,6 +32,8 @@ class View;
 */
 class ViewClipboard
 {
+    ::sd::View& mrView;
+
 public:
     ViewClipboard(::sd::View& rView);
     virtual ~ViewClipboard();
@@ -42,8 +44,6 @@ public:
     void HandlePageDrop(const SdTransferable& rTransferable);
 
 protected:
-    ::sd::View& mrView;
-
     /** Return the first master page of the given transferable.  When the
         bookmark list of the transferable contains at least one non-master
         page then NULL is returned.
diff --git a/sd/source/ui/inc/unopage.hxx b/sd/source/ui/inc/unopage.hxx
index 775e68ba7e57..1eb3cb6d83b1 100644
--- a/sd/source/ui/inc/unopage.hxx
+++ b/sd/source/ui/inc/unopage.hxx
@@ -56,14 +56,13 @@ private:
     SdrModel* mpSdrModel;
     bool      mbIsImpressDocument;
     sal_Int16 mnTempPageNumber; // for printing handouts
+    const SvxItemPropertySet*   mpPropSet;
 
     void UpdateModel();
 
 protected:
     friend class SdXImpressDocument;
 
-    const SvxItemPropertySet*   mpPropSet;
-
     /// @throws css::lang::IllegalArgumentException
     virtual void setBackground( const css::uno::Any& rValue );
     /// @throws std::exception
diff --git a/sd/source/ui/inc/unosrch.hxx b/sd/source/ui/inc/unosrch.hxx
index 6dcf681cbee6..965e80278e8d 100644
--- a/sd/source/ui/inc/unosrch.hxx
+++ b/sd/source/ui/inc/unosrch.hxx
@@ -39,9 +39,9 @@ class SdUnoSearchReplaceDescriptor;
 /** this class implements a search or replace operation on a given page or a 
given sdrobj */
 class SdUnoSearchReplaceShape : public css::util::XReplaceable
 {
-protected:
     css::drawing::XDrawPage* mpPage;
 
+protected:
     css::uno::Reference< css::text::XTextRange >  Search( const 
css::uno::Reference< css::text::XTextRange >&  xText, 
SdUnoSearchReplaceDescriptor* pDescr );
     bool Search( const OUString& rText, sal_Int32& nStartPos, sal_Int32& 
nEndPos, SdUnoSearchReplaceDescriptor* pDescr ) noexcept;
     static ESelection GetSelection( const css::uno::Reference< 
css::text::XTextRange >&  xTextRange ) noexcept;
diff --git a/starmath/inc/node.hxx b/starmath/inc/node.hxx
index 69cc0a323ce9..f162b83aa754 100644
--- a/starmath/inc/node.hxx
+++ b/starmath/inc/node.hxx
@@ -755,8 +755,6 @@ public:
  */
 class SmTextNode : public SmVisibleNode
 {
-
-protected:
     OUString   maText;
     sal_uInt16 mnFontDesc;
     /** Index within text where the selection starts
diff --git a/svtools/inc/framestatuslistener.hxx 
b/svtools/inc/framestatuslistener.hxx
index c3ed32233b2c..045b3874f143 100644
--- a/svtools/inc/framestatuslistener.hxx
+++ b/svtools/inc/framestatuslistener.hxx
@@ -68,7 +68,7 @@ class FrameStatusListener : public 
css::frame::XStatusListener,
         // XFrameActionListener
         virtual void SAL_CALL frameAction( const css::frame::FrameActionEvent& 
Action ) override;
 
-    protected:
+    private:
         struct Listener
         {
             Listener( css::util::URL _aURL, css::uno::Reference< 
css::frame::XDispatch > _xDispatch ) :

Reply via email to