[Libreoffice-commits] core.git: sc/source sd/source sw/source

Justin Luth justin_luth at sil.org
Fri Sep 25 22:50:51 PDT 2015


 sc/source/ui/view/editsh.cxx        |    2 +-
 sd/source/ui/view/drviewse.cxx      |    8 ++++----
 sw/source/uibase/shells/textsh1.cxx |   11 ++++++-----
 3 files changed, 11 insertions(+), 10 deletions(-)

New commits:
commit e2c7ef060397c4e0a0297b14b008596fb1c089a4
Author: Justin Luth <justin_luth at sil.org>
Date:   Fri Sep 18 15:28:38 2015 +0300

    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 at cib.de>
    Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>

diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index 9b1d2b0a..c225286 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -354,7 +354,7 @@ void ScEditShell::Execute( SfxRequest& rReq )
                             aSel.nEndPos = nUtf16Pos;
                    }
 
-                    ToggleUnicodeCodepoint aToggle = ToggleUnicodeCodepoint();
+                    ToggleUnicodeCodepoint aToggle;
                     while( nUtf16Pos && aToggle.AllowMoreInput( sInput[nUtf16Pos-1]) )
                         --nUtf16Pos;
                     OUString sReplacement = aToggle.ReplacementString();
diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx
index d9e0a99..9a86ddb 100644
--- a/sd/source/ui/view/drviewse.cxx
+++ b/sd/source/ui/view/drviewse.cxx
@@ -840,14 +840,14 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
 
         case SID_UNICODE_NOTATION_TOGGLE:
         {
-            if ( mpDrawView->IsTextEdit() )
+            if( mpDrawView->IsTextEdit() )
             {
                 OutlinerView* pOLV = mpDrawView->GetTextEditOutlinerView();
-                if (pOLV)
+                if( pOLV )
                 {
                     OUString sInput = pOLV->GetSurroundingText();
                     ESelection aSel( pOLV->GetSelection() );
-                    if ( aSel.nStartPos > aSel.nEndPos )
+                    if( aSel.nStartPos > aSel.nEndPos )
                         aSel.nEndPos = aSel.nStartPos;
 
                     //calculate a valid end-position by reading logical characters
@@ -861,7 +861,7 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
                             aSel.nEndPos = nUtf16Pos;
                     }
 
-                    ToggleUnicodeCodepoint aToggle = ToggleUnicodeCodepoint();
+                    ToggleUnicodeCodepoint aToggle;
                     while( nUtf16Pos && aToggle.AllowMoreInput( sInput[nUtf16Pos-1]) )
                         --nUtf16Pos;
                     OUString sReplacement = aToggle.ReplacementString();
diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx
index 372c29e..49a1dc5 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;
 


More information about the Libreoffice-commits mailing list