tdf#84381: Disable the line arrowheads when non-line object is selected
When a non-line object is selected, the arrow subsection of line tab is hidden Change-Id: Id23245aadeaef5327449679a20a6243da4ad2b3a Reviewed-on: https://gerrit.libreoffice.org/21740 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: jan iversen <jani@documentfoundation.org>
This commit is contained in:
@@ -72,7 +72,8 @@ LinePropertyPanel::LinePropertyPanel(
|
||||
maTransControl(SID_ATTR_LINE_TRANSPARENCE, *pBindings, *this),
|
||||
maEdgeStyle(SID_ATTR_LINE_JOINT, *pBindings, *this),
|
||||
maCapStyle(SID_ATTR_LINE_CAP, *pBindings, *this),
|
||||
mpBindings(pBindings)
|
||||
mpBindings(pBindings),
|
||||
maContext()
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
@@ -186,6 +187,30 @@ void LinePropertyPanel::NotifyItemUpdate(
|
||||
ActivateControls();
|
||||
}
|
||||
|
||||
void LinePropertyPanel::HandleContextChange(
|
||||
const sfx2::sidebar::EnumContext& rContext)
|
||||
{
|
||||
if(maContext == rContext)
|
||||
{
|
||||
// Nothing to do
|
||||
return;
|
||||
}
|
||||
|
||||
maContext = rContext;
|
||||
bool bShowArrows = false;
|
||||
|
||||
switch(maContext.GetCombinedContext_DI())
|
||||
{
|
||||
case CombinedEnumContext(Application_Calc, Context_DrawLine):
|
||||
case CombinedEnumContext(Application_DrawImpress, Context_DrawLine):
|
||||
bShowArrows = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if(!bShowArrows)
|
||||
disableArrowHead();
|
||||
}
|
||||
|
||||
void LinePropertyPanel::setLineStyle(const XLineStyleItem& rItem)
|
||||
{
|
||||
GetBindings()->GetDispatcher()->Execute(SID_ATTR_LINE_STYLE, SfxCallMode::RECORD, &rItem, 0L);
|
||||
|
@@ -23,6 +23,7 @@
|
||||
#include <vcl/ctrl.hxx>
|
||||
#include <sfx2/sidebar/SidebarPanelBase.hxx>
|
||||
#include <sfx2/sidebar/ControllerItem.hxx>
|
||||
#include <sfx2/sidebar/IContextChangeReceiver.hxx>
|
||||
#include <vcl/fixed.hxx>
|
||||
#include <vcl/field.hxx>
|
||||
#include <vcl/layout.hxx>
|
||||
@@ -58,6 +59,7 @@ class PopupContainer;
|
||||
class LineWidthControl;
|
||||
|
||||
class LinePropertyPanel : public LinePropertyPanelBase,
|
||||
public sfx2::sidebar::IContextChangeReceiver,
|
||||
public sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
|
||||
{
|
||||
public:
|
||||
@@ -69,6 +71,9 @@ public:
|
||||
const css::uno::Reference<css::frame::XFrame>& rxFrame,
|
||||
SfxBindings* pBindings);
|
||||
|
||||
virtual void HandleContextChange(
|
||||
const ::sfx2::sidebar::EnumContext& rContext) override;
|
||||
|
||||
virtual void NotifyItemUpdate(
|
||||
const sal_uInt16 nSId,
|
||||
const SfxItemState eState,
|
||||
@@ -109,6 +114,7 @@ private:
|
||||
sfx2::sidebar::ControllerItem maCapStyle;
|
||||
|
||||
SfxBindings* mpBindings;
|
||||
sfx2::sidebar::EnumContext maContext;
|
||||
|
||||
void Initialize();
|
||||
};
|
||||
|
Reference in New Issue
Block a user