summaryrefslogtreecommitdiff
path: root/sysui/source/win32
diff options
context:
space:
mode:
authorTino Rachui <tra@openoffice.org>2001-06-27 06:16:25 +0000
committerTino Rachui <tra@openoffice.org>2001-06-27 06:16:25 +0000
commit588ce54109f90942cdaac1c2bc883214caf05c6c (patch)
tree1974ad07512b234171199a0df6c58c745d42b8e1 /sysui/source/win32
parentd9561a13c2ec188f0bc3c1ee7631553a11baa28e (diff)
#86986#removing tilde signes from control labels
Diffstat (limited to 'sysui/source/win32')
-rw-r--r--sysui/source/win32/misc/resourceprovider.cxx57
1 files changed, 44 insertions, 13 deletions
diff --git a/sysui/source/win32/misc/resourceprovider.cxx b/sysui/source/win32/misc/resourceprovider.cxx
index 706b49d085b2..5636c79cb05f 100644
--- a/sysui/source/win32/misc/resourceprovider.cxx
+++ b/sysui/source/win32/misc/resourceprovider.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: resourceprovider.cxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: tra $ $Date: 2001-06-26 18:36:36 $
+ * last change: $Author: tra $ $Date: 2001-06-27 07:16:25 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -67,6 +67,10 @@
#include <osl/diagnose.h>
#endif
+#ifndef _RTL_USTRBUF_HXX_
+#include <rtl/ustrbuf.hxx>
+#endif
+
#ifndef _RESOURCEPROVIDER_HXX_
#include "resourceprovider.hxx"
#endif
@@ -86,6 +90,14 @@
#include "filedlghelper.hrc"
//------------------------------------------------------------
+// namespace directives
+//------------------------------------------------------------
+
+using rtl::OUString;
+using namespace ::com::sun::star::ui::dialogs::ExtendedFilePickerElementIds;
+using namespace ::com::sun::star::ui::dialogs::CommonFilePickerElementIds;
+
+//------------------------------------------------------------
//
//------------------------------------------------------------
@@ -98,13 +110,8 @@
// id + 100
#define LB_LABEL_OFFSET 100
-//------------------------------------------------------------
-// namespace directives
-//------------------------------------------------------------
-
-using rtl::OUString;
-using namespace ::com::sun::star::ui::dialogs::ExtendedFilePickerElementIds;
-using namespace ::com::sun::star::ui::dialogs::CommonFilePickerElementIds;
+const rtl::OUString TILDE = OUString::createFromAscii( "~" );
+const sal_Unicode TILDE_SIGN = L'~';
//------------------------------------------------------------
// we have to translate control ids to resource ids
@@ -199,10 +206,34 @@ public:
aResString = String( ResId( aResId, m_ResMgr ) );
aResOUString = OUString( aResString );
- // filter ~
- #pragma message( "#########################" )
- #pragma message( "implement filter ~" )
- #pragma message( "#########################" )
+ // remove '~' signs, if there are two '~' signs
+ // in a row we remove only one of them
+ if ( aResOUString.indexOf( TILDE ) > -1 )
+ {
+ sal_Int32 nStrLen = aResOUString.getLength( );
+ rtl::OUStringBuffer aBuffer( nStrLen );
+ sal_Int32 i = 0;
+ const sal_Unicode* pPos = aResOUString.getStr( );
+ const sal_Unicode* pNext = aResOUString.getStr( ) + 1;
+ const sal_Unicode* pEnd = aResOUString.getStr( ) + nStrLen;
+
+ while( pPos < pEnd )
+ {
+ // we insert the next character only if the current character
+ // in not a '~' or the following character is also a '~'
+ if ( (*pPos != TILDE_SIGN) ||
+ ((*pPos == TILDE_SIGN) && (pNext < pEnd) && (*pNext == TILDE_SIGN)) )
+ {
+ aBuffer.insert( i, *pPos );
+ i++;
+ }
+
+ pPos++;
+ pNext++;
+ }
+
+ aResOUString = aBuffer.makeStringAndClear( );
+ }
}
}
catch(...)