summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2005-02-24 15:56:13 +0000
committerVladimir Glazounov <vg@openoffice.org>2005-02-24 15:56:13 +0000
commit0cc1b5479481e802d1a00ce45e17e7e9f6b5a6a9 (patch)
treed4cd0d00237a21b2f1b45046e4982a596c28ef10
parent8d413b99bc867c0e5f84c62403327ba4e92e5be5 (diff)
INTEGRATION: CWS tbe19 (1.58.6); FILE MERGED
2005/02/04 17:18:06 tbe 1.58.6.2: RESYNC: (1.58-1.60); FILE MERGED 2005/01/27 17:02:36 tbe 1.58.6.1: #i40118# undo & restore in basic
-rw-r--r--svx/source/tbxctrls/tbcontrl.cxx40
1 files changed, 38 insertions, 2 deletions
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 38f8808308b9..1ec9bdea76ad 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: tbcontrl.cxx,v $
*
- * $Revision: 1.60 $
+ * $Revision: 1.61 $
*
- * last change: $Author: obo $ $Date: 2005-01-27 10:45:20 $
+ * last change: $Author: vg $ $Date: 2005-02-24 16:56:13 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -133,6 +133,9 @@
#ifndef INCLUDED_SVTOOLS_FONTOPTIONS_HXX
#include <svtools/fontoptions.hxx>
#endif
+#ifndef _VCL_MNEMONIC_HXX_
+#include <vcl/mnemonic.hxx>
+#endif
#pragma hdrstop
@@ -214,6 +217,7 @@ SFX_IMPL_TOOLBOX_CONTROL( SvxFrameToolBoxControl, SvxBoxItem );
SFX_IMPL_TOOLBOX_CONTROL( SvxFrameLineStyleToolBoxControl, SvxLineItem );
SFX_IMPL_TOOLBOX_CONTROL( SvxFrameLineColorToolBoxControl, SvxColorItem );
SFX_IMPL_TOOLBOX_CONTROL( SvxReloadControllerItem, SfxBoolItem );
+SFX_IMPL_TOOLBOX_CONTROL( SvxSimpleUndoRedoController, SfxStringItem );
//========================================================================
// class SvxStyleBox_Impl -----------------------------------------------------
@@ -3249,6 +3253,38 @@ void SvxReloadControllerItem::StateChanged(
}
//========================================================================
+// class SvxSimpleUndoRedoController -------------------------------------
+//========================================================================
+
+SvxSimpleUndoRedoController::SvxSimpleUndoRedoController( USHORT nSlotId, USHORT nId, ToolBox& rTbx )
+ :SfxToolBoxControl( nSlotId, nId, rTbx )
+{
+ aDefaultText = rTbx.GetItemText( nId );
+}
+
+// -----------------------------------------------------------------------
+
+SvxSimpleUndoRedoController::~SvxSimpleUndoRedoController()
+{
+}
+
+// -----------------------------------------------------------------------
+
+void SvxSimpleUndoRedoController::StateChanged( USHORT nSID, SfxItemState eState, const SfxPoolItem* pState )
+{
+ SfxStringItem* pItem = PTR_CAST( SfxStringItem, pState );
+ ToolBox& rBox = GetToolBox();
+ if ( pItem && eState != SFX_ITEM_DISABLED )
+ {
+ ::rtl::OUString aNewText( MnemonicGenerator::EraseAllMnemonicChars( pItem->GetValue() ) );
+ rBox.SetQuickHelpText( GetId(), aNewText );
+ }
+ if ( eState == SFX_ITEM_DISABLED )
+ rBox.SetQuickHelpText( GetId(), aDefaultText );
+ rBox.EnableItem( GetId(), eState != SFX_ITEM_DISABLED );
+}
+
+//========================================================================
void lcl_ResizeValueSet( Window &rWin, ValueSet &rValueSet )
{