summaryrefslogtreecommitdiff
path: root/svx/source/sidebar/line/LinePropertyPanel.cxx
diff options
context:
space:
mode:
authorRishabh <kris.kr296@yahoo.in>2016-01-24 07:07:07 +0530
committerjan iversen <jani@documentfoundation.org>2016-01-25 07:14:34 +0000
commiteede66cd922b0f867b7521a9d96e2c6f42a973dc (patch)
tree5158307abe928b19ca3d77446ebbb1479b5542fc /svx/source/sidebar/line/LinePropertyPanel.cxx
parent45e3e87ddcdfb14186ce6a9d8748fa4b31393600 (diff)
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>
Diffstat (limited to 'svx/source/sidebar/line/LinePropertyPanel.cxx')
-rw-r--r--svx/source/sidebar/line/LinePropertyPanel.cxx27
1 files changed, 26 insertions, 1 deletions
diff --git a/svx/source/sidebar/line/LinePropertyPanel.cxx b/svx/source/sidebar/line/LinePropertyPanel.cxx
index ebf7bf41fd1a..4b1ca42b19eb 100644
--- a/svx/source/sidebar/line/LinePropertyPanel.cxx
+++ b/svx/source/sidebar/line/LinePropertyPanel.cxx
@@ -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);