Kaydet (Commit) fc48a4cf authored tarafından Noel Grandin's avatar Noel Grandin

msCommandName in ControllerItem is unused

ever since

    commit 1c5cae47
    Date:   Thu Apr 20 08:44:33 2017 +0200
    loplugin:unusedmethods

Change-Id: I7c02e8bf0ef377303dedf4e6690fd937f52a3605
üst 3c695c5b
......@@ -67,7 +67,7 @@ public:
Changes of this state are notified via the
ItemUpdateReceiverInterface::NotifyContextChang() method.
*/
bool IsEnabled (const SfxItemState eState) const;
static bool IsEnabled (const SfxItemState eState);
/** Force the controller item to call its NotifyItemUpdate
callback with up-to-date data.
......@@ -81,7 +81,6 @@ protected:
private:
ItemUpdateReceiverInterface& mrItemUpdateReceiver;
css::uno::Reference<css::lang::XComponent> mxFrameActionListener;
const ::rtl::OUString msCommandName;
};
} } // end of namespace sfx2::sidebar
......
......@@ -41,8 +41,7 @@ ControllerItem::ControllerItem (
ItemUpdateReceiverInterface& rItemUpdateReceiver)
: SfxControllerItem(nSlotId, rBindings),
mrItemUpdateReceiver(rItemUpdateReceiver),
mxFrameActionListener(),
msCommandName()
mxFrameActionListener()
{
}
......@@ -68,7 +67,7 @@ void ControllerItem::StateChanged (
mrItemUpdateReceiver.NotifyItemUpdate(nSID, eState, pState, IsEnabled(eState));
}
bool ControllerItem::IsEnabled (SfxItemState eState) const
bool ControllerItem::IsEnabled (SfxItemState eState)
{
if (eState == SfxItemState::DISABLED)
return false;
......@@ -77,19 +76,12 @@ bool ControllerItem::IsEnabled (SfxItemState eState) const
// There are no disabled commands.
return true;
}
else if (msCommandName.getLength() == 0)
else
{
// We were not given a command name at construction and can
// not check the state now. Assume the best and return true.
return true;
}
else if (SvtCommandOptions().Lookup(SvtCommandOptions::CMDOPTION_DISABLED, msCommandName))
{
// The command is part of a list of disabled commands.
return false;
}
else
return true;
}
void ControllerItem::RequestUpdate()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment