summaryrefslogtreecommitdiff
path: root/vcl/source/window/mnemonic.cxx
diff options
context:
space:
mode:
authorRĂ¼diger Timm <rt@openoffice.org>2004-01-07 15:22:05 +0000
committerRĂ¼diger Timm <rt@openoffice.org>2004-01-07 15:22:05 +0000
commit90cd40b67a687c93ed42b7e812560c753f2334b3 (patch)
treeba055ed616db57520c2a69af76a8f882dfe7a0a0 /vcl/source/window/mnemonic.cxx
parent666cd20c5f2cc57112c17452336fbab660c98bbf (diff)
INTEGRATION: CWS geordi2q12 (1.13.80); FILE MERGED
2004/01/07 14:14:56 hr 1.13.80.1: #111934#: merge CWS mnemonics -> SRC680
Diffstat (limited to 'vcl/source/window/mnemonic.cxx')
-rw-r--r--vcl/source/window/mnemonic.cxx42
1 files changed, 40 insertions, 2 deletions
diff --git a/vcl/source/window/mnemonic.cxx b/vcl/source/window/mnemonic.cxx
index 194512062fb7..fb64c982ee77 100644
--- a/vcl/source/window/mnemonic.cxx
+++ b/vcl/source/window/mnemonic.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: mnemonic.cxx,v $
*
- * $Revision: 1.14 $
+ * $Revision: 1.15 $
*
- * last change: $Author: vg $ $Date: 2004-01-06 14:14:17 $
+ * last change: $Author: rt $ $Date: 2004-01-07 16:22:05 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -407,3 +407,41 @@ uno::Reference< i18n::XCharacterClassification > MnemonicGenerator::GetCharClass
xCharClass = vcl::unohelper::CreateCharacterClassification();
return xCharClass;
}
+
+// -----------------------------------------------------------------------
+
+String MnemonicGenerator::EraseAllMnemonicChars( const String& rStr )
+{
+ String aStr = rStr;
+ xub_StrLen nLen = aStr.Len();
+ xub_StrLen i = 0;
+
+ while ( i < nLen )
+ {
+ if ( aStr.GetChar( i ) == '~' )
+ {
+ // check for CJK-style mnemonic
+ if( i > 0 && (i+2) < nLen )
+ {
+ sal_Unicode c = aStr.GetChar(i+1);
+ if( aStr.GetChar( i-1 ) == '(' &&
+ aStr.GetChar( i+2 ) == ')' &&
+ c >= MNEMONIC_RANGE_2_START && c <= MNEMONIC_RANGE_2_END )
+ {
+ aStr.Erase( i-1, 4 );
+ nLen -= 4;
+ i--;
+ continue;
+ }
+ }
+
+ // remove standard mnemonics
+ aStr.Erase( i, 1 );
+ nLen--;
+ }
+ else
+ i++;
+ }
+
+ return aStr;
+}