[Libreoffice-commits] core.git: 7 commits - connectivity/source formula/source include/tools linguistic/workben sw/inc sw/source ucb/workben vcl/workben

Noel Grandin noel at peralex.com
Tue Dec 3 23:07:48 PST 2013


 connectivity/source/inc/file/FStatement.hxx |    2 
 formula/source/ui/dlg/formula.cxx           |  162 ++++++++++++++--------------
 include/tools/string.hxx                    |    1 
 linguistic/workben/sspellimp.cxx            |   12 +-
 sw/inc/splargs.hxx                          |   39 +++---
 sw/source/core/doc/docedt.cxx               |    2 
 sw/source/core/doc/doctxm.cxx               |   18 +--
 sw/source/core/text/txthyph.cxx             |    6 -
 sw/source/core/txtnode/txtedt.cxx           |    2 
 ucb/workben/ucb/ucbdemo.cxx                 |   15 +-
 vcl/workben/svpclient.cxx                   |    6 -
 11 files changed, 129 insertions(+), 136 deletions(-)

New commits:
commit d6de313b043154e70a84c0fc29cbae94fe7541b1
Author: Noel Grandin <noel at peralex.com>
Date:   Tue Dec 3 14:40:22 2013 +0200

    STRING_NOTFOUND is no more
    
    Change-Id: Ia8937e07786c497c5cb8485fa161fd68231c17f8

diff --git a/include/tools/string.hxx b/include/tools/string.hxx
index 0c4571d..76e271e 100644
--- a/include/tools/string.hxx
+++ b/include/tools/string.hxx
@@ -26,7 +26,6 @@
  * THIS CODE IS DEPRECATED.  DO NOT USE IT IN ANY NEW CODE.
  ******************************************************************************/
 
-#define STRING_NOTFOUND    ((xub_StrLen)0xFFFF)
 #define STRING_LEN         ((xub_StrLen)0xFFFF)
 #define STRING_MAXLEN      ((xub_StrLen)0xFFFF)
 
commit eb56848029a3b26a9d4f07a55364749e9e7d8339
Author: Noel Grandin <noel at peralex.com>
Date:   Tue Dec 3 14:39:34 2013 +0200

    convert SwInterHyphInfo from xub_StrLen->sal_Int32
    
    Change-Id: Ie5a877fb90c360506f05d0417524966e137e5d77

diff --git a/sw/inc/splargs.hxx b/sw/inc/splargs.hxx
index 45fc34d..0210ad5 100644
--- a/sw/inc/splargs.hxx
+++ b/sw/inc/splargs.hxx
@@ -126,43 +126,40 @@ struct SwSpellArgs : SwArgsBase
 
 class SwInterHyphInfo
 {
-    ::com::sun::star::uno::Reference<
-        ::com::sun::star::linguistic2::XHyphenatedWord >    xHyphWord;
-    const   Point aCrsrPos;
+    ::css::uno::Reference< ::css::linguistic2::XHyphenatedWord >    xHyphWord;
+    const Point aCrsrPos;
     sal_Bool    bNoLang : 1;
     sal_Bool    bCheck  : 1;
 public:
-    xub_StrLen nStart;
-    xub_StrLen nLen;
-    xub_StrLen nWordStart;
-    xub_StrLen nWordLen;
-    xub_StrLen nHyphPos;
+    sal_Int32 nStart;
+    sal_Int32 nEnd;
+    sal_Int32 nWordStart;
+    sal_Int32 nWordLen;
+    sal_Int32 nHyphPos;
     sal_uInt16 nMinTrail;
 
     inline SwInterHyphInfo( const Point &rCrsrPos,
-                            const sal_uInt16 nStartPos = 0,
-                            const sal_uInt16 nLength = USHRT_MAX )
+                            sal_Int32 nStartPos = 0,
+                            sal_Int32 nLength = SAL_MAX_INT32 )
          : aCrsrPos( rCrsrPos ),
            bNoLang(sal_False), bCheck(sal_False),
-           nStart(nStartPos), nLen(nLength),
+           nStart(nStartPos),
+           nEnd( std::max(SAL_MAX_INT32, nStartPos + nLength) ),
            nWordStart(0), nWordLen(0),
            nHyphPos(0), nMinTrail(0)
          { }
-    inline xub_StrLen GetEnd() const
-    { return STRING_LEN == nLen ? nLen : nStart + nLen; }
+    inline sal_Int32 GetEnd() const
+        { return nEnd; }
     inline const Point *GetCrsrPos() const
-    { return aCrsrPos.X() || aCrsrPos.Y() ? &aCrsrPos : 0; }
+        { return aCrsrPos.X() || aCrsrPos.Y() ? &aCrsrPos : 0; }
     inline sal_Bool IsCheck() const { return bCheck; }
     inline void SetCheck( const sal_Bool bNew ) { bCheck = bNew; }
     inline void SetNoLang( const sal_Bool bNew ) { bNoLang = bNew; }
 
-    inline void
-            SetHyphWord(const ::com::sun::star::uno::Reference<
-                ::com::sun::star::linguistic2::XHyphenatedWord >  &rxHW)
-            { xHyphWord = rxHW; }
-    inline ::com::sun::star::uno::Reference<
-        ::com::sun::star::linguistic2::XHyphenatedWord >
-            GetHyphWord() { return xHyphWord; }
+    inline void SetHyphWord(const ::css::uno::Reference< ::css::linguistic2::XHyphenatedWord >  &rxHW)
+        { xHyphWord = rxHW; }
+    inline ::css::uno::Reference< ::css::linguistic2::XHyphenatedWord > GetHyphWord()
+        { return xHyphWord; }
 };
 
 
diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx
index 79fbd43..a1d3e2e 100644
--- a/sw/source/core/doc/docedt.cxx
+++ b/sw/source/core/doc/docedt.cxx
@@ -2047,7 +2047,7 @@ SwHyphArgs::SwHyphArgs( const SwPaM *pPam, const Point &rCrsrPos,
 inline void SwHyphArgs::SetRange( const SwNode *pNew )
 {
     nStart = pStart == pNew ? nPamStart : 0;
-    nLen   = pEnd   == pNew ? nPamLen : STRING_NOTFOUND;
+    nEnd   = pEnd   == pNew ? nPamStart + nPamLen : SAL_MAX_INT32;
 }
 
 void SwHyphArgs::SetPam( SwPaM *pPam ) const
diff --git a/sw/source/core/text/txthyph.cxx b/sw/source/core/text/txthyph.cxx
index 909f2ad..4aa235e 100644
--- a/sw/source/core/text/txthyph.cxx
+++ b/sw/source/core/text/txthyph.cxx
@@ -100,7 +100,7 @@ sal_Bool SwTxtFrm::Hyphenate( SwInterHyphInfo &rHyphInf )
                 aLine.Next();
         }
 
-        const xub_StrLen nEnd = rHyphInf.GetEnd();
+        const sal_Int32 nEnd = rHyphInf.GetEnd();
         while( !bRet && aLine.GetStart() < nEnd )
         {
             bRet = aLine.Hyphenate( rHyphInf );
@@ -177,9 +177,9 @@ sal_Bool SwTxtFormatter::Hyphenate( SwInterHyphInfo &rHyphInf )
         // Bereich.
 
         SwLinePortion *pPos = pCurr->GetPortion();
-        const xub_StrLen nPamStart = rHyphInf.nStart;
+        const sal_Int32 nPamStart = rHyphInf.nStart;
         nWrdStart = nStart;
-        const xub_StrLen nEnd = rHyphInf.GetEnd();
+        const sal_Int32 nEnd = rHyphInf.GetEnd();
         while( pPos )
         {
             // Entweder wir liegen drueber oder wir laufen gerade auf eine
diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx
index 4a31aef..900419c 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -1611,7 +1611,7 @@ sal_Bool SwTxtNode::Hyphenate( SwInterHyphInfo &rHyphInf )
         pFrm = (SwTxtFrm*)(pFrm->GetFollow());
         if( pFrm )
         {
-            rHyphInf.nLen = rHyphInf.nLen - (pFrm->GetOfst() - rHyphInf.nStart);
+            rHyphInf.nEnd = rHyphInf.nEnd - (pFrm->GetOfst() - rHyphInf.nStart);
             rHyphInf.nStart = pFrm->GetOfst();
         }
     }
commit e7c10fba9083e8ec9498a1fee4ef3ce31eb3e8d1
Author: Noel Grandin <noel at peralex.com>
Date:   Tue Dec 3 14:18:00 2013 +0200

    remove usage of STRING_NOTFOUND in formula.cxx
    
    and tidy up the method a little
    
    Change-Id: I408fd96286749ec9e3743dbdad8cf424a7bb9035

diff --git a/formula/source/ui/dlg/formula.cxx b/formula/source/ui/dlg/formula.cxx
index deec0f0..4e2ba70 100644
--- a/formula/source/ui/dlg/formula.cxx
+++ b/formula/source/ui/dlg/formula.cxx
@@ -463,109 +463,109 @@ namespace
 // -----------------------------------------------------------------------------
 sal_Int32 FormulaDlg_Impl::GetFunctionPos(sal_Int32 nPos)
 {
+    if ( !m_aTokenList.hasElements() )
+        return SAL_MAX_INT32;
+
     const sal_Unicode sep = m_pHelper->getFunctionManager()->getSingleToken(IFunctionManager::eSep);
 
-    sal_Int32 nFuncPos = STRING_NOTFOUND;
+    sal_Int32 nFuncPos = SAL_MAX_INT32;
     sal_Bool  bFlag = sal_False;
     OUString  aFormString = m_aFormulaHelper.GetCharClass()->uppercase(pMEdit->GetText());
 
-    if ( m_aTokenList.getLength() )
-    {
-        const uno::Reference< sheet::XFormulaParser > xParser(m_pHelper->getFormulaParser());
-        const table::CellAddress aRefPos(m_pHelper->getReferencePosition());
+    const uno::Reference< sheet::XFormulaParser > xParser(m_pHelper->getFormulaParser());
+    const table::CellAddress aRefPos(m_pHelper->getReferencePosition());
 
-        const sheet::FormulaToken* pIter = m_aTokenList.getConstArray();
-        const sheet::FormulaToken* pEnd = pIter + m_aTokenList.getLength();
-        try
+    const sheet::FormulaToken* pIter = m_aTokenList.getConstArray();
+    const sheet::FormulaToken* pEnd = pIter + m_aTokenList.getLength();
+    try
+    {
+        sal_Int32 nTokPos = 1;
+        sal_Int32 nOldTokPos = 1;
+        sal_Int32 nPrevFuncPos = 1;
+        short nBracketCount = 0;
+        while ( pIter != pEnd )
         {
-            sal_Int32 nTokPos=1;
-            sal_Int32 nOldTokPos=1;
-            sal_Int32 nPrevFuncPos = 1;
-            short nBracketCount = 0;
-            while ( pIter != pEnd )
+            const sal_Int32 eOp = pIter->OpCode;
+            uno::Sequence<sheet::FormulaToken> aArgs(1);
+            aArgs[0] = *pIter;
+            const OUString aString = xParser->printFormula(aArgs, aRefPos);
+            const sheet::FormulaToken* pNextToken = pIter + 1;
+
+            if( !bUserMatrixFlag && FormulaCompiler::IsMatrixFunction((OpCode)eOp) )
             {
-                const sal_Int32 eOp = pIter->OpCode;
-                uno::Sequence<sheet::FormulaToken> aArgs(1);
-                aArgs[0] = *pIter;
-                const OUString aString = xParser->printFormula(aArgs, aRefPos);
-                const sheet::FormulaToken* pNextToken = pIter + 1;
+                aBtnMatrix.Check();
+            }
 
-                if(!bUserMatrixFlag && FormulaCompiler::IsMatrixFunction((OpCode)eOp) )
+            if( eOp == m_aSpecialOpCodes[sheet::FormulaMapGroupSpecialOffset::PUSH].Token.OpCode ||
+                eOp == m_aSpecialOpCodes[sheet::FormulaMapGroupSpecialOffset::SPACES].Token.OpCode )
+            {
+                const sal_Int32 n1 = aFormString.indexOf(sep, nTokPos);
+                const sal_Int32 n2 = aFormString.indexOf(')',nTokPos);
+                sal_Int32 nXXX = nTokPos;
+                if( n1 < n2 )
                 {
-                    aBtnMatrix.Check();
-                }
-
-                if ( eOp == m_aSpecialOpCodes[sheet::FormulaMapGroupSpecialOffset::PUSH].Token.OpCode ||
-                    eOp == m_aSpecialOpCodes[sheet::FormulaMapGroupSpecialOffset::SPACES].Token.OpCode )
-                {
-                    const sal_Int32 n1 = aFormString.indexOf(sep, nTokPos);
-                    const sal_Int32 n2 = aFormString.indexOf(')',nTokPos);
-                    sal_Int32 nXXX = nTokPos;
-                    if(n1<n2)
-                    {
-                        nTokPos=n1;
-                    }
-                    else
-                    {
-                        nTokPos=n2;
-                    }
-                    if ( pNextToken != pEnd )
-                    {
-                        aArgs[0] = *pNextToken;
-                        const OUString a2String = xParser->printFormula(aArgs, aRefPos);
-                        const sal_Int32 n3 = aFormString.indexOf(a2String,nXXX);
-                        if ( n3 < nTokPos )
-                            nTokPos = n3;
-                    }
+                    nTokPos=n1;
                 }
                 else
                 {
-                    nTokPos = nTokPos + aString.getLength();
+                    nTokPos=n2;
                 }
-
-                if ( eOp == m_aSeparatorsOpCodes[TOKEN_OPEN].OpCode )
+                if( pNextToken != pEnd )
                 {
-                    nBracketCount++;
-                    bFlag=sal_True;
+                    aArgs[0] = *pNextToken;
+                    const OUString a2String = xParser->printFormula(aArgs, aRefPos);
+                    const sal_Int32 n3 = aFormString.indexOf(a2String,nXXX);
+                    if ( n3 < nTokPos )
+                        nTokPos = n3;
                 }
-                else if ( eOp == m_aSeparatorsOpCodes[TOKEN_CLOSE].OpCode )
-                {
-                    nBracketCount--;
-                    bFlag=sal_False;
-                    nFuncPos=nPrevFuncPos;
-                }
-                bool bIsFunction = ::std::find_if(m_aFunctionOpCodes.getConstArray(),m_pFunctionOpCodesEnd,::std::bind2nd(OpCodeCompare(),boost::cref(eOp))) != m_pFunctionOpCodesEnd;
+            }
+            else
+            {
+                nTokPos = nTokPos + aString.getLength();
+            }
 
-                if ( bIsFunction && m_aSpecialOpCodes[sheet::FormulaMapGroupSpecialOffset::SPACES].Token.OpCode != eOp )
-                {
-                    nPrevFuncPos = nFuncPos;
-                    nFuncPos = nOldTokPos;
-                }
+            if( eOp == m_aSeparatorsOpCodes[TOKEN_OPEN].OpCode )
+            {
+                nBracketCount++;
+                bFlag = sal_True;
+            }
+            else if( eOp == m_aSeparatorsOpCodes[TOKEN_CLOSE].OpCode )
+            {
+                nBracketCount--;
+                bFlag = sal_False;
+                nFuncPos = nPrevFuncPos;
+            }
+            bool bIsFunction = ::std::find_if(m_aFunctionOpCodes.getConstArray(),m_pFunctionOpCodesEnd,::std::bind2nd(OpCodeCompare(),boost::cref(eOp))) != m_pFunctionOpCodesEnd;
+
+            if( bIsFunction && m_aSpecialOpCodes[sheet::FormulaMapGroupSpecialOffset::SPACES].Token.OpCode != eOp )
+            {
+                nPrevFuncPos = nFuncPos;
+                nFuncPos = nOldTokPos;
+            }
 
-                if ( nOldTokPos <= nPos && nPos < nTokPos )
+            if( nOldTokPos <= nPos && nPos < nTokPos )
+            {
+                if( !bIsFunction )
                 {
-                    if ( !bIsFunction )
+                    if( nBracketCount < 1 )
+                    {
+                        nFuncPos = pMEdit->GetText().getLength();
+                    }
+                    else if( !bFlag )
                     {
-                        if ( nBracketCount < 1 )
-                        {
-                            nFuncPos= pMEdit->GetText().getLength();
-                        }
-                        else if ( !bFlag )
-                        {
-                            nFuncPos=nPrevFuncPos;
-                        }
+                        nFuncPos = nPrevFuncPos;
                     }
-                    break;
                 }
+                break;
+            }
 
-                pIter = pNextToken;
-                nOldTokPos = nTokPos;
-            } // while ( pIter != pEnd )
-        }
-        catch(const uno::Exception& )
-        {
-            OSL_FAIL("Exception caught!");
-        }
+            pIter = pNextToken;
+            nOldTokPos = nTokPos;
+        } // while ( pIter != pEnd )
+    }
+    catch( const uno::Exception& )
+    {
+        OSL_FAIL("Exception caught!");
     }
 
     return nFuncPos;
commit a0be5278c24efcc9a6f22fe5398d780b0744f8ce
Author: Noel Grandin <noel at peralex.com>
Date:   Tue Dec 3 14:06:45 2013 +0200

    remove condition that cannot be hit
    
    GetFunctionEnd cannot return STRING_NOTFOUND
    
    Change-Id: Ic9abee0ea77789e01acedf57c6c13edb0a5c08d9

diff --git a/formula/source/ui/dlg/formula.cxx b/formula/source/ui/dlg/formula.cxx
index f1f0a78..deec0f0 100644
--- a/formula/source/ui/dlg/formula.cxx
+++ b/formula/source/ui/dlg/formula.cxx
@@ -1330,7 +1330,7 @@ IMPL_LINK_NOARG(FormulaDlg_Impl, FormulaCursorHdl)
         {
             sal_Int32 nPos1 = m_aFormulaHelper.GetFunctionEnd(aString,nFStart);
 
-            if(nPos1>nPos || nPos1==STRING_NOTFOUND)
+            if(nPos1>nPos)
             {
                 EditThisFunc(nFStart);
             }
commit 8b306ebb2c479bccbaf7a5ab170816cfe5850f71
Author: Noel Grandin <noel at peralex.com>
Date:   Tue Dec 3 14:05:53 2013 +0200

    convert xub_StrLen->sal_Int32 in doctxm.cxx
    
    Change-Id: I0981631d516e18c065c3f5fcc1a049119b47ec76

diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index bece385..5ac032a 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -75,9 +75,9 @@ TYPEINIT2( SwTOXBaseSection, SwTOXBase, SwSection );    // for RTTI
 struct LinkStruct
 {
     SwFmtINetFmt    aINetFmt;
-    xub_StrLen nStartTextPos, nEndTextPos;
+    sal_Int32 nStartTextPos, nEndTextPos;
 
-    LinkStruct( const OUString& rURL, xub_StrLen nStart, xub_StrLen nEnd )
+    LinkStruct( const OUString& rURL, sal_Int32 nStart, sal_Int32 nEnd )
         : aINetFmt( rURL, aEmptyOUStr),
         nStartTextPos( nStart),
         nEndTextPos(nEnd) {}
@@ -188,9 +188,9 @@ void SwDoc::DeleteTOXMark( const SwTOXMark* pTOXMark )
 class CompareNodeCntnt
 {
     sal_uLong nNode;
-    xub_StrLen nCntnt;
+    sal_Int32 nCntnt;
 public:
-    CompareNodeCntnt( sal_uLong nNd, xub_StrLen nCnt )
+    CompareNodeCntnt( sal_uLong nNd, sal_Int32 nCnt )
         : nNode( nNd ), nCntnt( nCnt ) {}
 
     int operator==( const CompareNodeCntnt& rCmp ) const
@@ -221,9 +221,9 @@ const SwTOXMark& SwDoc::GotoTOXMark( const SwTOXMark& rCurTOXMark,
 
     CompareNodeCntnt aAbsIdx( pTOXSrc->GetIndex(), *pMark->GetStart() );
     CompareNodeCntnt aPrevPos( 0, 0 );
-    CompareNodeCntnt aNextPos( ULONG_MAX, STRING_NOTFOUND );
+    CompareNodeCntnt aNextPos( ULONG_MAX, SAL_MAX_INT32 );
     CompareNodeCntnt aMax( 0, 0 );
-    CompareNodeCntnt aMin( ULONG_MAX, STRING_NOTFOUND );
+    CompareNodeCntnt aMin( ULONG_MAX, SAL_MAX_INT32 );
 
     const SwTOXMark*    pNew    = 0;
     const SwTOXMark*    pMax    = &rCurTOXMark;
@@ -2020,7 +2020,7 @@ void SwTOXBaseSection::_UpdatePageNum( SwTxtNode* pNd,
         for(sal_uInt16 nHintIdx = 0; nHintIdx < pHints->GetStartCount(); nHintIdx++)
         {
             SwTxtAttr* pAttr = pHints->GetStart(nHintIdx);
-            const xub_StrLen nTmpEnd = pAttr->End() ? *pAttr->End() : 0;
+            const sal_Int32 nTmpEnd = pAttr->End() ? *pAttr->End() : 0;
             if( nStartPos >= *pAttr->GetStart() &&
                 (nStartPos + 2) <= nTmpEnd &&
                 pAttr->Which() == RES_TXTATR_CHARFMT)
@@ -2136,8 +2136,8 @@ void SwTOXBaseSection::_UpdatePageNum( SwTxtNode* pNd,
         SwFmtCharFmt aCharFmt(pCharFmt);
         for (sal_uInt16 j = 0; j < xCharStyleIdx->size(); j += 2)
         {
-            xub_StrLen nStartIdx = (*xCharStyleIdx)[j] + nOffset;
-            xub_StrLen nEndIdx = (*xCharStyleIdx)[j + 1]  + nOffset;
+            sal_Int32 nStartIdx = (*xCharStyleIdx)[j] + nOffset;
+            sal_Int32 nEndIdx   = (*xCharStyleIdx)[j + 1]  + nOffset;
             pNd->InsertItem(aCharFmt, nStartIdx, nEndIdx, nsSetAttrMode::SETATTR_DONTEXPAND);
         }
 
commit 39c8524f7d9180fe500e1b5d9a272cabd72399e9
Author: Noel Grandin <noel at peralex.com>
Date:   Tue Dec 3 12:09:30 2013 +0200

    remove some STRING_NOTFOUND usage
    
    from old, probably dead code. Completely untested. But at
    least it's not in my grep results anymore.
    
    Change-Id: I9d917d0558bcab25a48fa36140beaa92150b62c9

diff --git a/linguistic/workben/sspellimp.cxx b/linguistic/workben/sspellimp.cxx
index 77c8820..e9cd7d9 100644
--- a/linguistic/workben/sspellimp.cxx
+++ b/linguistic/workben/sspellimp.cxx
@@ -135,12 +135,12 @@ sal_Int16 SpellChecker::GetSpellFailure( const OUString &rWord, const Locale & )
     String aTmp( rWord );
     if (aTmp.Len())
     {
-        if (STRING_NOTFOUND != aTmp.SearchAscii( "liss" ))
+        if (-1 != aTmp.indexOf( "liss" ))
         {
             nRes = SpellFailure::IS_NEGATIVE_WORD;
         }
-        else if (STRING_NOTFOUND != aTmp.Search( (sal_Unicode) 'x' )  ||
-                 STRING_NOTFOUND != aTmp.Search( (sal_Unicode) 'X' ))
+        else if (-1 != aTmp.indexOf( (sal_Unicode) 'x' )  ||
+                 -1 != aTmp.indexOf( (sal_Unicode) 'X' ))
         {
             nRes = SpellFailure::SPELLING_ERROR;
         }
@@ -216,14 +216,14 @@ Reference< XSpellAlternatives >
     {
         sal_Int16 nLang = LinguLocaleToLanguage( rLocale );
 
-        if (STRING_NOTFOUND != aTmp.SearchAscii( "liss" ))
+        if (-1 != aTmp.indexOf( "liss" ))
         {
             aTmp.SearchAndReplaceAllAscii( "liss", "liz" );
             xRes = new SpellAlternatives( aTmp, nLang,
                         SpellFailure::IS_NEGATIVE_WORD, ::com::sun::star::uno::Sequence< OUString >() );
         }
-        else if (STRING_NOTFOUND != aTmp.Search( (sal_Unicode) 'x' )  ||
-                 STRING_NOTFOUND != aTmp.Search( (sal_Unicode) 'X' ))
+        else if (-1 != aTmp.indexOf( (sal_Unicode) 'x' )  ||
+                 -1 != aTmp.indexOf( (sal_Unicode) 'X' ))
         {
             Sequence< OUString > aStr( 2 );
             OUString *pStr = aStr.getArray();
diff --git a/ucb/workben/ucb/ucbdemo.cxx b/ucb/workben/ucb/ucbdemo.cxx
index ce48a6b..6a7a601 100644
--- a/ucb/workben/ucb/ucbdemo.cxx
+++ b/ucb/workben/ucb/ucbdemo.cxx
@@ -96,10 +96,10 @@ public:
 //-------------------------------------------------------------------------
 void MyOutWindow::Append( const String &rLine )
 {
-    String aLine( rLine );
+    OUString aLine( rLine );
 
-    xub_StrLen nPos = aLine.Search( '\n' );
-    while ( nPos != STRING_NOTFOUND )
+    sal_Int32 nPos = aLine.indexOf( '\n' );
+    while ( nPos != -1 )
     {
         if ( GetEntryCount() >= MYOUTWINDOW_MAXLINES )
             RemoveEntry( 0 );
@@ -2254,17 +2254,16 @@ void MyApp::Main()
     USHORT nParams = Application::GetCommandLineParamCount();
     for ( USHORT n = 0; n < nParams; ++n )
     {
-        String aParam( Application::GetCommandLineParam( n ) );
+        OUString aParam( Application::GetCommandLineParam( n ) );
         if (aParam.CompareIgnoreCaseToAscii("-key=",
                                             RTL_CONSTASCII_LENGTH("-key="))
                 == COMPARE_EQUAL)
         {
-            xub_StrLen nSlash
-                = aParam.Search('/', RTL_CONSTASCII_LENGTH("-key="));
-            if (nSlash == STRING_NOTFOUND)
+            sal_Int32 nSlash = aParam.indexOf('/', RTL_CONSTASCII_LENGTH("-key="));
+            if (nSlash == -1)
             {
                 aConfigurationKey1
-                    = aParam.Copy(RTL_CONSTASCII_LENGTH("-key="));
+                    = aParam.copy(RTL_CONSTASCII_LENGTH("-key="));
                 aConfigurationKey2 = "";
             }
             else
diff --git a/vcl/workben/svpclient.cxx b/vcl/workben/svpclient.cxx
index 54a51d9..9125cb1 100644
--- a/vcl/workben/svpclient.cxx
+++ b/vcl/workben/svpclient.cxx
@@ -231,9 +231,9 @@ IMPL_LINK( MyWin, QuitHdl, Button*, )
 
 IMPL_LINK( MyWin, SelectHdl, ListBox*, )
 {
-    String aEntry = m_aSvpBitmaps.GetSelectEntry();
-    sal_uInt16 nPos = aEntry.SearchAscii( ": " );
-    if( nPos != STRING_NOTFOUND )
+    OUString aEntry = m_aSvpBitmaps.GetSelectEntry();
+    sal_Int32 nPos = aEntry.indexOf( ": " );
+    if( nPos != -1 )
     {
         OStringBuffer aCommand( 64 );
         aCommand.append( "get " );
commit aa4a39c9d754d0f7e953a3a642db5ad15053c63f
Author: Noel Grandin <noel at peralex.com>
Date:   Tue Dec 3 12:05:35 2013 +0200

    remove unused #define SQL_COLUMN_NOTFOUND
    
    Change-Id: Ic8914484c23c586036280bdf12a3fef3128d03ff

diff --git a/connectivity/source/inc/file/FStatement.hxx b/connectivity/source/inc/file/FStatement.hxx
index fa7f8d0..b4cad7c 100644
--- a/connectivity/source/inc/file/FStatement.hxx
+++ b/connectivity/source/inc/file/FStatement.hxx
@@ -42,8 +42,6 @@
 #include <tools/string.hxx>
 #include "TSortIndex.hxx"
 
-#define SQL_COLUMN_NOTFOUND STRING_NOTFOUND
-
 namespace connectivity
 {
     namespace file


More information about the Libreoffice-commits mailing list