[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sw/source

Caolán McNamara caolanm at redhat.com
Tue Feb 12 08:08:14 PST 2013


 sw/source/core/txtnode/txtedt.cxx |   49 --------------------------------------
 1 file changed, 49 deletions(-)

New commits:
commit df52800121871f1fd1d8d48a149c15f5618476d9
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Dec 11 10:37:23 2012 +0000

    prefer my own cjk char-as-word counting
    
    Change-Id: I120acd40b83cad074869b404d4e74b5ec69d493d
    Signed-off-by: Michael Meeks <michael.meeks at suse.com>

diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx
index 578579c..e0cc703 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -1898,9 +1898,6 @@ void SwTxtNode::CountWords( SwDocStat& rStat,
     // map start and end points onto the ConversionMap
     const sal_uInt32 nExpandBegin = aConversionMap.ConvertToViewPosition( nStt );
     const sal_uInt32 nExpandEnd   = aConversionMap.ConvertToViewPosition( nEnd );
-#ifdef FIXME_REMOVE_WHEN_RE_BASE_COMPLETE
-    aExpandText = aExpandText.copy( nExpandBegin, nExpandEnd - nExpandBegin );
-#endif
 
     if (aExpandText.isEmpty() && !bCountNumbering)
     {
@@ -1922,49 +1919,9 @@ void SwTxtNode::CountWords( SwDocStat& rStat,
     {
         if (pBreakIt->GetBreakIter().is())
         {
-#ifdef FIXME_REMOVE_WHEN_RE_BASE_COMPLETE
-            // FIXME: check if in fact this is a (sadly) duplicated fix.
-
-            // split into different script languages
-            sal_Int32 nScriptBegin = 0;
-            while ( nScriptBegin < aExpandText.getLength() )
-            {
-                const sal_Int16 nCurrScript = pBreakIt->GetBreakIter()->getScriptType( aExpandText, nScriptBegin );
-                const sal_Int32 nScriptEnd = pBreakIt->GetBreakIter()->endOfScript( aExpandText, nScriptBegin, nCurrScript );
-                rtl::OUString aScriptText = aExpandText.copy( nScriptBegin, nScriptEnd - nScriptBegin );
-
-                // Asian languages count words as characters
-                if ( nCurrScript == ::com::sun::star::i18n::ScriptType::ASIAN )
-                {
-                    // substract white spaces
-                    sal_Int32 nSpaceCount = 0;
-                    sal_Int32 nSpacePos = 0;
-
-                    // substract normal white spaces
-                    nSpacePos = -1;
-                    while ( ( nSpacePos = aScriptText.indexOf( ' ', nSpacePos + 1 ) ) != -1 )
-                    {
-                        nSpaceCount++;
-                    }
-                    // substract Asian full-width white spaces
-                    nSpacePos = -1;
-                    while ( ( nSpacePos = aScriptText.indexOf( 12288, nSpacePos + 1 ) ) != -1 )
-                    {
-                        nSpaceCount++;
-                    }
-                    nTmpWords += nScriptEnd - nScriptBegin - nSpaceCount;
-                }
-                else
-                {
-#endif
-
             // zero is NULL for pLanguage -----------v               last param = true for clipping
             SwScanner aScanner( *this, aExpandText, 0, aConversionMap, i18n::WordType::WORD_COUNT,
-#ifdef FIXME_REMOVE_WHEN_RE_BASE_COMPLETE
-                                (xub_StrLen)0, (xub_StrLen)aScriptText.getLength() );
-#else
                                 nExpandBegin, nExpandEnd, true );
-#endif
 
             // used to filter out scanner returning almost empty strings (len=1; unichar=0x0001)
             const rtl::OUString aBreakWord( CH_TXTATR_BREAKWORD );
@@ -1982,12 +1939,6 @@ void SwTxtNode::CountWords( SwDocStat& rStat,
                 }
             }
 
-#ifdef FIXME_REMOVE_WHEN_RE_BASE_COMPLETE
-nScriptBegin = nScriptEnd;
-}
-}
-#endif
-
             nTmpCharsExcludingSpaces += aScanner.getOverriddenDashCount();
         }
 


More information about the Libreoffice-commits mailing list