[Libreoffice-commits] .: 2 commits - svtools/qa sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Dec 11 02:39:21 PST 2012


 svtools/qa/cppunit/data/gif/fail/EDB-23279-1.gif |    1 
 sw/source/core/txtnode/txtedt.cxx                |   49 -----------------------
 2 files changed, 1 insertion(+), 49 deletions(-)

New commits:
commit f7cee036655926b428cbb7f0c930b74300001121
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

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();
         }
 
commit 7c1ca63995f3d35a79614f2144e1d776619c0be1
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Dec 11 10:32:33 2012 +0000

    add regression test for EDB-23279
    
    Change-Id: I9d31602750dc6516b7bee5c0796328cee07b10ea

diff --git a/svtools/qa/cppunit/data/gif/fail/EDB-23279-1.gif b/svtools/qa/cppunit/data/gif/fail/EDB-23279-1.gif
new file mode 100644
index 0000000..d81d3b0
--- /dev/null
+++ b/svtools/qa/cppunit/data/gif/fail/EDB-23279-1.gif
@@ -0,0 +1 @@
+””&H©1ŠÎ؝'[ek2ΐ™~Ømé®ß1L-h£a[^¦Î.Þð!7¢/&»VOÊ»·BB^ïuËÃî±³È2k]YnEåG)qâ¿
\ No newline at end of file


More information about the Libreoffice-commits mailing list