Commits

Anonymous committed 94cc5d4

CWS-TOOLING: integrate CWS gciteratorfix_DEV300
2009-08-04 10:23:19 +0200 od r274608 : add missing patch flags for libaries swui, msword and xo
2009-08-03 16:42:48 +0200 mav r274586 : #i101899# workaround the wrong error code on MAC
2009-08-03 13:24:44 +0200 tl r274575 : #i103936# fix for grammar checking loop
2009-08-03 12:37:37 +0200 tl r274573 : #i103936# fix for grammar checking loop
2009-08-03 12:10:01 +0200 tl r274572 : #i103936# fix for grammar checking loop
2009-08-03 09:06:49 +0200 tl r274565 : #i103936# fix for grammar checking loop
2009-08-03 09:04:50 +0200 tl r274564 : #i103936# fix for grammar checking loop
2009-07-31 17:52:45 +0200 tl r274545 : #i103936# fix for grammar checking loop

Comments (0)

Files changed (3)

comphelper/source/misc/mediadescriptor.cxx

 					css::ucb::InteractiveIOException exIO;
 					xRequest->getRequest() >>= exIO;
 					bAbort = (
-								(exIO.Code == css::ucb::IOErrorCode_ACCESS_DENIED     ) ||
-								(exIO.Code == css::ucb::IOErrorCode_LOCKING_VIOLATION )
+								(exIO.Code == css::ucb::IOErrorCode_ACCESS_DENIED     )
+							 || (exIO.Code == css::ucb::IOErrorCode_LOCKING_VIOLATION )
+#ifdef MACOSX
+                             // this is a workaround for MAC, on this platform if the file is locked
+                             // the returned error code looks to be wrong
+							 || (exIO.Code == css::ucb::IOErrorCode_GENERAL )
+#endif
 							);
 				}
 				break;

linguistic/source/gciterator.cxx

 
 static sal_Int32 lcl_BacktraceWhiteSpaces( const OUString &rText, sal_Int32 nStartPos )
 {
-    // note having nStartPos point right behind the string is OK since that one
+    // note: having nStartPos point right behind the string is OK since that one
     // is a correct end-of-sentence position to be returned from a grammar checker...
 
     const sal_Int32 nLen = rText.getLength();
     sal_Int32 nPosBefore = nStartPos - 1;
     const sal_Unicode *pStart = rText.getStr();
     if (0 <= nPosBefore && nPosBefore < nLen && lcl_IsWhiteSpace( pStart[ nPosBefore ] ))
+    {
         nStartPos = nPosBefore;
-    if (0 <= nStartPos && nStartPos < nLen)
-    {
-        const sal_Unicode *pText = rText.getStr() + nStartPos;
-        while (pText > pStart && lcl_IsWhiteSpace( *pText ))
-            --pText;
-        // now add 1 since we wnat to point to the first char after the last char in the sentence...
-        nRes = pText - pStart + 1;
+        if (0 <= nStartPos && nStartPos < nLen)
+        {
+            const sal_Unicode *pText = rText.getStr() + nStartPos;
+            while (pText > pStart && lcl_IsWhiteSpace( *pText ))
+                --pText;
+            // now add 1 since we want to point to the first char after the last char in the sentence...
+            nRes = pText - pStart + 1;
+        }
     }
     
     DBG_ASSERT( 0 <= nRes && nRes <= nLen, "lcl_BacktraceWhiteSpaces return value out of range" );
 
                     sal_Int32 nStartPos = aFPEntryItem.m_nStartIndex;
                     sal_Int32 nSuggestedEnd = GetSuggestedEndOfSentence( aCurTxt, nStartPos, aCurLocale );
+                    DBG_ASSERT( nSuggestedEnd > nStartPos, "nSuggestedEndOfSentencePos calculation failed?" );
 
                     linguistic2::ProofreadingResult aRes;
 
                         aGuard.clear();
 						uno::Sequence< beans::PropertyValue > aEmptyProps;
                         aRes = xGC->doProofreading( aCurDocId, aCurTxt, aCurLocale, nStartPos, nSuggestedEnd, aEmptyProps );
+                        
+                        //!! work-around to prevent looping if the grammar checker 
+                        //!! failed to properly identify the sentence end
+                        if (aRes.nBehindEndOfSentencePosition <= nStartPos)
+						{
+							DBG_ASSERT( 0, "!! Grammarchecker failed to provide end of sentence !!" );
+                            aRes.nBehindEndOfSentencePosition = nSuggestedEnd;
+						}
+                        
                         aRes.xFlatParagraph      = xFlatPara;
                         aRes.nStartOfSentencePosition = nStartPos;
                     }
                 ::osl::ClearableGuard< ::osl::Mutex > aGuard( MyMutex::get() );
                 aDocId = GetOrCreateDocId( xComponent );
                 nSuggestedEndOfSentencePos = GetSuggestedEndOfSentence( rText, nStartPos, aCurLocale );
+                DBG_ASSERT( nSuggestedEndOfSentencePos > nStartPos, "nSuggestedEndOfSentencePos calculation failed?" );
 
                 xGC = GetGrammarChecker( aCurLocale );
             }
             {
 				uno::Sequence< beans::PropertyValue > aEmptyProps;
                 aTmpRes = xGC->doProofreading( aDocId, rText, aCurLocale, nStartPos, nSuggestedEndOfSentencePos, aEmptyProps );
+
+                //!! work-around to prevent looping if the grammar checker 
+                //!! failed to properly identify the sentence end
+                if (aTmpRes.nBehindEndOfSentencePosition <= nStartPos)
+				{
+					DBG_ASSERT( 0, "!! Grammarchecker failed to provide end of sentence !!" );
+                    aTmpRes.nBehindEndOfSentencePosition = nSuggestedEndOfSentencePos;
+				}
+
                 aTmpRes.xFlatParagraph      	 = xFlatPara;
                 aTmpRes.nStartOfSentencePosition = nStartPos;
                 nEndPos = aTmpRes.nBehindEndOfSentencePosition;

scp2/source/ooo/file_library_ooo.scp

-/*************************************************************************
+*************************************************************************
 *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  * 
 
 File gid_File_Lib_Fps
     TXT_FILE_BODY;
-    Styles = (PACKED,UNO_COMPONENT);
+    Styles = (PACKED,PATCH,UNO_COMPONENT);
     RegistryID = gid_Starregistry_Services_Rdb;
     Dir = gid_Dir_Program;
     Name = "fps.dll";
 
 #endif
 
+STD_UNO_LIB_FILE_PATCH( gid_File_Lib_Lng, lng)
+
 #ifdef WNT
-
 File gid_File_Lib_Rebasemsi
     TXT_FILE_BODY;
     Name = "rebase.dll";
 STD_UNO_LIB_FILE_PATCH( gid_File_Lib_Sw , sw)
 STD_LIB_FILE_PATCH( gid_File_Lib_Swui, swui)
 
-STD_LIB_FILE( gid_File_Lib_Msword, msword )
+STD_LIB_FILE_PATCH( gid_File_Lib_Msword, msword )
 
 File gid_File_Lib_Sysdtrans
     TXT_FILE_BODY;