summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2015-09-18 15:28:38 +0300
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2015-09-26 05:50:19 +0000
commite2c7ef060397c4e0a0297b14b008596fb1c089a4 (patch)
tree0c74803a7e19595ad00c56b32f50d53edeaad20f /sw
parentfc3e36c4188888c7a4277d7f9c6fff1db106fb34 (diff)
making alt-x code consistent
Recent reviewer's comments apply to previously committed code. Made the changes and tested each module. Change-Id: Id67ff103797f18cf233f728b8f93a7747a42e02f Reviewed-on: https://gerrit.libreoffice.org/18713 Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/uibase/shells/textsh1.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx
index 372c29e7cb0c..49a1dc50e8a4 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -290,12 +290,13 @@ void SwTextShell::Execute(SfxRequest &rReq)
{
case SID_UNICODE_NOTATION_TOGGLE:
{
- int nMaxUnits = 256;
- if( rWrtSh.IsSelection() && !rWrtSh.IsMultiSelection() )
- nMaxUnits = rWrtSh.GetSelText().getLength();
+ long nMaxUnits = 256;
+ sal_Int32 nSelLength = rWrtSh.GetSelText().getLength();
+ if( rWrtSh.IsSelection() && !rWrtSh.IsMultiSelection() && (nSelLength < nMaxUnits) )
+ nMaxUnits = nSelLength;
- int index = 0;
- ToggleUnicodeCodepoint aToggle = ToggleUnicodeCodepoint();
+ long index = 0;
+ ToggleUnicodeCodepoint aToggle;
while( nMaxUnits-- && aToggle.AllowMoreInput(rWrtSh.GetChar(true, index-1)) )
--index;