To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=61005
                  Issue #:|61005
                  Summary:|AutoCorrect [A-z0-9]--[A-z0-9] to emdash is not
                          |suitable for all languages
                Component:|framework
                  Version:|OOo 2.0.1
                 Platform:|All
                      URL:|
               OS/Version:|All
                   Status:|UNCONFIRMED
        Status whiteboard:|
                 Keywords:|
               Resolution:|
               Issue type:|ENHANCEMENT
                 Priority:|P3
             Subcomponent:|code
              Assigned to:|tm
              Reported by:|openskm





------- Additional comments from [EMAIL PROTECTED] Sun Jan 22 05:40:13 -0800 
2006 -------
In svx/source/editeng/svxacorr.cxx there is a code which responsible for
autocorrection of two hyphens to emdash. This behaviour is not dependent of the
language of the current text. However, in Hungarian language the emdash
character is not used. The endash characted should be inserted in this
situation. There has been a patch for it in Hungarian community build for about
two years.

--- svx/source/editeng/svxacorr.cxx.orig        2005-09-11 17:21:38.000000000 
+0200
+++ svx/source/editeng/svxacorr.cxx     2005-10-15 19:37:29.462518100 +0200
@@ -718,7 +718,26 @@
                }
        }
 
-       // ersetze [A-z0-9]--[A-z0-9] durch "emDash"
+       // ersetze [A-z0-9]---[A-z0-9] durch "emDash"
+       if( cEmDash && 4 <= nEndPos - nSttPos )
+       {
+               String sTmp( rTxt.Copy( nSttPos, nEndPos - nSttPos ) );
+               xub_StrLen nFndPos = sTmp.SearchAscii( "---" );
+               if( STRING_NOTFOUND != nFndPos && nFndPos &&
+                       nFndPos + 3 < sTmp.Len() &&
+                       ( rCC.isLetterNumeric( sTmp, nFndPos - 1 ) ||
+                         lcl_IsInAsciiArr( sImplEndSkipChars, rTxt.GetChar( 
nFndPos - 1 ) )) &&
+                       ( rCC.isLetterNumeric( sTmp, nFndPos + 3 ) ||
+                       lcl_IsInAsciiArr( sImplSttSkipChars, rTxt.GetChar( 
nFndPos + 3 ) )))
+               {
+                       nSttPos += nFndPos;
+                       rDoc.Delete( nSttPos, nSttPos + 3 );
+                       rDoc.Insert( nSttPos, cEmDash );
+                       bRet = TRUE;
+               }
+       }
+
+       // ersetze [A-z0-9]--[A-z0-9] durch "enDash"
        if( cEmDash && 4 <= nEndPos - nSttPos )
        {
                String sTmp( rTxt.Copy( nSttPos, nEndPos - nSttPos ) );
@@ -732,7 +751,7 @@
                {
                        nSttPos += nFndPos;
                        rDoc.Delete( nSttPos, nSttPos + 2 );
-                       rDoc.Insert( nSttPos, cEmDash );
+                       rDoc.Insert( nSttPos, cEnDash );
                        bRet = TRUE;
                }
        }

The [A-z0-9]--[A-z0-9] pattern is replaced to endash while [A-z0-9]---[A-z0-9]
is used for emdash (if somebody needs it during writing English text).

It would be better, if this replacement rule was dependent of the language of
the text.

---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to