summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <s.mehrbrodt@gmail.com>2014-11-09 17:15:33 +0100
committerSamuel Mehrbrodt <s.mehrbrodt@gmail.com>2014-11-09 17:19:50 +0100
commit0280a35b20448b7f678b6e150cbc2564da4910ce (patch)
treeac35a323c645197e90bc6294ed10c2dac392469c
parenta700c0b44d8ff6092120315b38f6b10f0278fbf7 (diff)
fdo#82707 Unify click behavior in Statusbar (Writer)
Use single click for primary action, right click for context menu Change-Id: Ia707a88b48f4af144588c45d37acea547e77773e
-rw-r--r--include/svx/insctrl.hxx1
-rw-r--r--include/svx/modctrl.hxx2
-rw-r--r--sfx2/source/statbar/stbitem.cxx8
-rw-r--r--svx/source/stbctrls/insctrl.cxx29
-rw-r--r--svx/source/stbctrls/modctrl.cxx2
-rw-r--r--sw/sdi/swriter.sdi2
-rw-r--r--sw/source/uibase/inc/wordcountctrl.hxx4
-rw-r--r--sw/source/uibase/utlui/wordcountctrl.cxx6
8 files changed, 17 insertions, 37 deletions
diff --git a/include/svx/insctrl.hxx b/include/svx/insctrl.hxx
index d9ec00dca797..291deabb9729 100644
--- a/include/svx/insctrl.hxx
+++ b/include/svx/insctrl.hxx
@@ -29,7 +29,6 @@ class SVX_DLLPUBLIC SvxInsertStatusBarControl : public SfxStatusBarControl
public:
virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
const SfxPoolItem* pState ) SAL_OVERRIDE;
- virtual void Click() SAL_OVERRIDE;
virtual void Paint( const UserDrawEvent& rEvt ) SAL_OVERRIDE;
SFX_DECL_STATUSBAR_CONTROL();
diff --git a/include/svx/modctrl.hxx b/include/svx/modctrl.hxx
index ca1129128b1f..1febdbd53467 100644
--- a/include/svx/modctrl.hxx
+++ b/include/svx/modctrl.hxx
@@ -36,7 +36,7 @@ public:
virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
const SfxPoolItem* pState ) SAL_OVERRIDE;
virtual void Paint( const UserDrawEvent& rUsrEvt ) SAL_OVERRIDE;
- virtual void DoubleClick() SAL_OVERRIDE;
+ virtual void Click() SAL_OVERRIDE;
SFX_DECL_STATUSBAR_CONTROL();
diff --git a/sfx2/source/statbar/stbitem.cxx b/sfx2/source/statbar/stbitem.cxx
index 27ba304cea87..275a61be0fd8 100644
--- a/sfx2/source/statbar/stbitem.cxx
+++ b/sfx2/source/statbar/stbitem.cxx
@@ -560,11 +560,11 @@ void SfxStatusBarControl::Click()
This virtual method is called when the user clicks on the
field in the status row that belongs to this control.
-
- The default implementation is empty.
*/
{
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aArgs;
+ execute( aArgs );
}
@@ -575,11 +575,11 @@ void SfxStatusBarControl::DoubleClick()
This virtual method is called when the user double-clicks on the
field in the status row that belongs to this control.
+
+ The default implementation is empty.
*/
{
- ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aArgs;
- execute( aArgs );
}
diff --git a/svx/source/stbctrls/insctrl.cxx b/svx/source/stbctrls/insctrl.cxx
index 4d477ec969b3..422c12ba7e55 100644
--- a/svx/source/stbctrls/insctrl.cxx
+++ b/svx/source/stbctrls/insctrl.cxx
@@ -38,14 +38,10 @@ SvxInsertStatusBarControl::SvxInsertStatusBarControl( sal_uInt16 _nSlotId,
{
}
-
-
SvxInsertStatusBarControl::~SvxInsertStatusBarControl()
{
}
-
-
void SvxInsertStatusBarControl::StateChanged( sal_uInt16 , SfxItemState eState,
const SfxPoolItem* pState )
{
@@ -66,36 +62,11 @@ void SvxInsertStatusBarControl::StateChanged( sal_uInt16 , SfxItemState eState,
}
}
-
-
-void SvxInsertStatusBarControl::Click()
-{
- if ( GetStatusBar().GetItemText( GetId() ).isEmpty() )
- return;
- bInsert = !bInsert;
- SfxBoolItem aIns( GetSlotId(), bInsert );
-
- ::com::sun::star::uno::Any a;
- bool bHasValue = aIns.QueryValue( a );
- if (!bHasValue)
- return;
-
- ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aArgs( 1 );
- aArgs[0].Name = "InsertMode";
- aArgs[0].Value = a;
-
- execute( aArgs );
-}
-
-
-
void SvxInsertStatusBarControl::Paint( const UserDrawEvent& )
{
DrawItemText_Impl();
}
-
-
void SvxInsertStatusBarControl::DrawItemText_Impl()
{
OUString aText;
diff --git a/svx/source/stbctrls/modctrl.cxx b/svx/source/stbctrls/modctrl.cxx
index 84da501f1a79..cfbaede1589b 100644
--- a/svx/source/stbctrls/modctrl.cxx
+++ b/svx/source/stbctrls/modctrl.cxx
@@ -165,7 +165,7 @@ void SvxModifyControl::Paint( const UserDrawEvent& rUsrEvt )
pDev->DrawImage(aPt, mpImpl->maImages[state]);
}
-void SvxModifyControl::DoubleClick()
+void SvxModifyControl::Click()
{
if (mpImpl->mnModState != ImplData::MODIFICATION_STATE_YES)
// document not modified. nothing to do here.
diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi
index 2d60dff53a18..2ca2c085b76c 100644
--- a/sw/sdi/swriter.sdi
+++ b/sw/sdi/swriter.sdi
@@ -7588,7 +7588,7 @@ SfxStringItem StateZoom FN_STAT_ZOOM
]
SfxStringItem StateWordCount FN_STAT_WORDCOUNT
-()
+
[
/* flags: */
AutoUpdate = FALSE,
diff --git a/sw/source/uibase/inc/wordcountctrl.hxx b/sw/source/uibase/inc/wordcountctrl.hxx
index 9feee89eda64..8d2aeeb05d54 100644
--- a/sw/source/uibase/inc/wordcountctrl.hxx
+++ b/sw/source/uibase/inc/wordcountctrl.hxx
@@ -26,6 +26,10 @@ public:
SwWordCountStatusBarControl(sal_uInt16 nSlotId, sal_uInt16 nId, StatusBar& rStb);
virtual ~SwWordCountStatusBarControl();
+
+ virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
+ const SfxPoolItem* pState ) SAL_OVERRIDE;
+
};
#endif
diff --git a/sw/source/uibase/utlui/wordcountctrl.cxx b/sw/source/uibase/utlui/wordcountctrl.cxx
index 498de51ceb3c..c43c345d00fd 100644
--- a/sw/source/uibase/utlui/wordcountctrl.cxx
+++ b/sw/source/uibase/utlui/wordcountctrl.cxx
@@ -24,4 +24,10 @@ SwWordCountStatusBarControl::~SwWordCountStatusBarControl()
{
}
+void SwWordCountStatusBarControl::StateChanged(
+ sal_uInt16 /*nSID*/, SfxItemState /*eState*/, const SfxPoolItem* pState )
+{
+ GetStatusBar().SetItemText( GetId(), ((SfxStringItem*)pState)->GetValue() );
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */