[Libreoffice-commits] core.git: 3 commits - dbaccess/source forms/source svx/source

Caolán McNamara caolanm at redhat.com
Wed Jan 15 07:36:53 PST 2014


 dbaccess/source/ui/dlg/TextConnectionHelper.cxx         |    6 +--
 dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx   |   12 ++----
 forms/source/richtext/specialdispatchers.cxx            |    2 -
 svx/source/customshapes/EnhancedCustomShapeFontWork.cxx |    5 +-
 svx/source/dialog/fntctrl.cxx                           |   18 +++++-----
 svx/source/dialog/srchdlg.cxx                           |    4 +-
 svx/source/svdraw/svdotextpathdecomposition.cxx         |   28 ++++++++--------
 7 files changed, 36 insertions(+), 39 deletions(-)

New commits:
commit 854188e3b14c8eb67a1871f2c9d666f4bd22f08b
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Jan 15 15:32:45 2014 +0000

    remove last xub_StrLen in forms
    
    Change-Id: If6c711cf9c317411c72260b4029521782f8a282c

diff --git a/forms/source/richtext/specialdispatchers.cxx b/forms/source/richtext/specialdispatchers.cxx
index 15c2c42..f39ecc8 100644
--- a/forms/source/richtext/specialdispatchers.cxx
+++ b/forms/source/richtext/specialdispatchers.cxx
@@ -71,7 +71,7 @@ namespace frm
         if ( nParagraphs )
         {
             sal_Int32 nLastParaNumber = nParagraphs - 1;
-            xub_StrLen nParaLen = pEngine->GetTextLen( nLastParaNumber );
+            sal_Int32 nParaLen = pEngine->GetTextLen( nLastParaNumber );
             getEditView()->SetSelection( ESelection( 0, 0, nLastParaNumber, nParaLen ) );
         }
     }
commit 48ed1d39a00c2ad617fab9191f192ef7509e8747
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Jan 15 15:26:41 2014 +0000

    make dbaccess xub_StrLen free
    
    Change-Id: I2c91c23f3dabacdb4ee65c18dc73f096041b74a9

diff --git a/dbaccess/source/ui/dlg/TextConnectionHelper.cxx b/dbaccess/source/ui/dlg/TextConnectionHelper.cxx
index 83f1feb..ad34c24 100644
--- a/dbaccess/source/ui/dlg/TextConnectionHelper.cxx
+++ b/dbaccess/source/ui/dlg/TextConnectionHelper.cxx
@@ -87,7 +87,7 @@ DBG_NAME(OTextConnectionHelper)
         DBG_CTOR(OTextConnectionHelper,NULL);
 
         sal_Int32 nCnt = comphelper::string::getTokenCount(m_aFieldSeparatorList, '\t');
-        xub_StrLen i;
+        sal_Int32 i;
 
         for( i = 0 ; i < nCnt ; i += 2 )
             m_aFieldSeparator.InsertEntry( m_aFieldSeparatorList.getToken( i, '\t' ) );
@@ -454,7 +454,7 @@ DBG_NAME(OTextConnectionHelper)
     OUString OTextConnectionHelper::GetSeparator( const ComboBox& rBox, const OUString& rList )
     {
         sal_Unicode nTok = '\t';
-        xub_StrLen  nPos(rBox.GetEntryPos( rBox.GetText() ));
+        sal_uInt16 nPos(rBox.GetEntryPos( rBox.GetText() ));
 
         if( nPos == COMBOBOX_ENTRY_NOTFOUND )
             return rBox.GetText().copy(0);
@@ -470,7 +470,7 @@ DBG_NAME(OTextConnectionHelper)
     {
         char    nTok = '\t';
         sal_Int32   nCnt = comphelper::string::getTokenCount(rList, nTok);
-        xub_StrLen  i;
+        sal_Int32 i;
 
         for( i=0 ; i<nCnt ; i+=2 )
         {
diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
index 423882b..c3b0184 100644
--- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
+++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
@@ -1259,9 +1259,8 @@ void OSelectionBrowseBox::PaintStatusCell(OutputDevice& rDev, const Rectangle& r
     OUString  aLabel(ModuleRes(STR_QUERY_HANDLETEXT));
 
    // from BROW_CRIT2_ROW onwards all rows are shown "or"
-    xub_StrLen nToken = (xub_StrLen) (m_nSeekRow >= GetBrowseRow(BROW_CRIT2_ROW))
-                                ?
-            xub_StrLen(BROW_CRIT2_ROW) : xub_StrLen(GetRealRow(m_nSeekRow));
+    sal_Int32 nToken = (m_nSeekRow >= GetBrowseRow(BROW_CRIT2_ROW))
+        ?  BROW_CRIT2_ROW : GetRealRow(m_nSeekRow);
     rDev.DrawText(aRect, aLabel.getToken(nToken, ';'),TEXT_DRAW_VCENTER);
 }
 
@@ -2648,9 +2647,8 @@ OUString OSelectionBrowseBox::GetRowDescription( sal_Int32 _nRow ) const
     OUString  aLabel(ModuleRes(STR_QUERY_HANDLETEXT));
 
     // from BROW_CRIT2_ROW onwards all rows are shown as "or"
-    xub_StrLen nToken = (xub_StrLen) (_nRow >= GetBrowseRow(BROW_CRIT2_ROW))
-                                ?
-            xub_StrLen(BROW_CRIT2_ROW) : xub_StrLen(GetRealRow(_nRow));
+    sal_Int32 nToken = (_nRow >= GetBrowseRow(BROW_CRIT2_ROW))
+        ?  BROW_CRIT2_ROW : GetRealRow(_nRow);
     return aLabel.getToken(nToken, ';');
 }
 
@@ -2704,7 +2702,7 @@ void OSelectionBrowseBox::setFunctionCell(OTableFieldDescRef& _pEntry)
                 m_pFunctionCell->InsertEntry(m_aFunctionStrings.getToken(2, ';')); // 2 -> COUNT
             else
             {
-                xub_StrLen nCount = comphelper::string::getTokenCount(m_aFunctionStrings, ';');
+                sal_Int32 nCount = comphelper::string::getTokenCount(m_aFunctionStrings, ';');
                 if ( _pEntry->isNumeric() )
                     --nCount;
                 for( sal_Int32 nIdx = 1; nIdx < nCount; nIdx++ )
commit 878dcbee6488f2a3dfbc1f86abc8857cf6608d20
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Jan 15 15:14:25 2014 +0000

    more xub_Strlen->sal_Int32
    
    Change-Id: I9bab4c8c0e5b62eace308b90a43800c21c9cba41

diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
index e7a67fa..9f131f1 100644
--- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
@@ -230,9 +230,8 @@ void GetTextAreaOutline( const FWData& rFWData, const SdrObject* pCustomShape, F
                 nScriptType = xBI->getScriptType( rText, 0 );
                 if( i18n::ScriptType::WEAK == nScriptType )
                 {
-                    sal_uInt16 nChg = 0;
-                    nChg = (xub_StrLen)xBI->endOfScript( rText, nChg, nScriptType );
-                    if( nChg < rText.getLength() )
+                    sal_Int32 nChg = xBI->endOfScript( rText, nChg, nScriptType );
+                    if (nChg < rText.getLength() && nChg >= 0)
                         nScriptType = xBI->getScriptType( rText, nChg );
                     else
                         nScriptType = i18n::ScriptType::LATIN;
diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx
index 55eac72..cf0a969 100644
--- a/svx/source/dialog/fntctrl.cxx
+++ b/svx/source/dialog/fntctrl.cxx
@@ -138,7 +138,7 @@ class FontPrevWin_Impl
 
     Reference < XBreakIterator >    xBreak;
     std::vector<sal_uIntPtr>        aTextWidth;
-    std::deque<xub_StrLen>         aScriptChg;
+    std::deque<sal_Int32>           aScriptChg;
     std::vector<sal_uInt16>         aScriptType;
     SvxFont                         aCJKFont;
     SvxFont                         aCTLFont;
@@ -246,11 +246,11 @@ void FontPrevWin_Impl::CheckScript()
         xBreak = BreakIterator::create(xContext);
     }
     sal_uInt16 nScript = xBreak->getScriptType( aText, 0 );
-    sal_uInt16 nChg = 0;
+    sal_Int32 nChg = 0;
     if( com::sun::star::i18n::ScriptType::WEAK == nScript )
     {
-        nChg = (xub_StrLen)xBreak->endOfScript( aText, nChg, nScript );
-        if( nChg < aText.getLength() )
+        nChg = xBreak->endOfScript( aText, nChg, nScript );
+        if (nChg < aText.getLength() && nChg >= 0)
             nScript = xBreak->getScriptType( aText, nChg );
         else
             nScript = com::sun::star::i18n::ScriptType::LATIN;
@@ -258,7 +258,7 @@ void FontPrevWin_Impl::CheckScript()
 
     do
     {
-        nChg = (xub_StrLen)xBreak->endOfScript( aText, nChg, nScript );
+        nChg = xBreak->endOfScript( aText, nChg, nScript );
         if (nChg < aText.getLength() && nChg > 0 &&
             (com::sun::star::i18n::ScriptType::WEAK ==
              xBreak->getScriptType(aText, nChg - 1)))
@@ -303,8 +303,8 @@ Size FontPrevWin_Impl::CalcTextSize( OutputDevice* pWin, OutputDevice* _pPrinter
 {
     sal_uInt16 nScript;
     sal_uInt16 nIdx = 0;
-    xub_StrLen nStart = 0;
-    xub_StrLen nEnd;
+    sal_Int32 nStart = 0;
+    sal_Int32 nEnd;
     size_t nCnt = aScriptChg.size();
     if( nCnt )
     {
@@ -385,8 +385,8 @@ void FontPrevWin_Impl::DrawPrev( OutputDevice* pWin, Printer* _pPrinter,
     Font aOldFont = _pPrinter->GetFont();
     sal_uInt16 nScript;
     sal_uInt16 nIdx = 0;
-    xub_StrLen nStart = 0;
-    xub_StrLen nEnd;
+    sal_Int32 nStart = 0;
+    sal_Int32 nEnd;
     size_t nCnt = aScriptChg.size();
     if( nCnt )
     {
diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx
index e5df140..07a07b6 100644
--- a/svx/source/dialog/srchdlg.cxx
+++ b/svx/source/dialog/srchdlg.cxx
@@ -1394,10 +1394,10 @@ IMPL_LINK( SvxSearchDialog, ModifyHdl_Impl, ComboBox *, pEd )
         sal_Int32 nReplTxtLen = 0;
         if (bAllowEmptySearch)
             nReplTxtLen = m_pReplaceLB->GetText().getLength();
-        xub_StrLen nAttrTxtLen = 0;
+        sal_Int32 nAttrTxtLen = 0;
 
         if ( !pImpl->bMultiLineEdit )
-           nAttrTxtLen = m_pSearchAttrText->GetText().getLength();
+            nAttrTxtLen = m_pSearchAttrText->GetText().getLength();
         else
             nAttrTxtLen = pImpl->m_pSearchFormats->GetText().getLength();
 
diff --git a/svx/source/svdraw/svdotextpathdecomposition.cxx b/svx/source/svdraw/svdotextpathdecomposition.cxx
index a849d17..fbbbba7 100644
--- a/svx/source/svdraw/svdotextpathdecomposition.cxx
+++ b/svx/source/svdraw/svdotextpathdecomposition.cxx
@@ -72,8 +72,8 @@ namespace
     {
         basegfx::B2DVector                          maOffset;
         OUString                                    maText;
-        xub_StrLen                                  mnTextStart;
-        xub_StrLen                                  mnTextLength;
+        sal_Int32                                   mnTextStart;
+        sal_Int32                                   mnTextLength;
         sal_Int32                                   mnParagraph;
         SvxFont                                     maFont;
         ::std::vector< double >                     maDblDXArray;   // double DXArray, font size independent -> unit coordinate system
@@ -122,15 +122,15 @@ namespace
         }
 
         const OUString& getText() const { return maText; }
-        xub_StrLen getTextStart() const { return mnTextStart; }
-        xub_StrLen getTextLength() const { return mnTextLength; }
+        sal_Int32 getTextStart() const { return mnTextStart; }
+        sal_Int32 getTextLength() const { return mnTextLength; }
         sal_Int32 getParagraph() const { return mnParagraph; }
         const SvxFont& getFont() const { return maFont; }
         bool isRTL() const { return mbRTL; }
         const ::std::vector< double >& getDoubleDXArray() const { return maDblDXArray; }
         const ::com::sun::star::lang::Locale& getLocale() const { return maLocale; }
 
-        xub_StrLen getPortionIndex(xub_StrLen nIndex, xub_StrLen nLength) const
+        sal_Int32 getPortionIndex(sal_Int32 nIndex, sal_Int32 nLength) const
         {
             if(mbRTL)
             {
@@ -142,7 +142,7 @@ namespace
             }
         }
 
-        double getDisplayLength(xub_StrLen nIndex, xub_StrLen nLength) const
+        double getDisplayLength(sal_Int32 nIndex, sal_Int32 nLength) const
         {
             drawinglayer::primitive2d::TextLayouterDevice aTextLayouter;
             double fRetval(0.0);
@@ -233,14 +233,14 @@ namespace
             return fRetval;
         }
 
-        xub_StrLen getNextGlyphLen(const impPathTextPortion* pCandidate, xub_StrLen nPosition, const ::com::sun::star::lang::Locale& rFontLocale)
+        sal_Int32 getNextGlyphLen(const impPathTextPortion* pCandidate, sal_Int32 nPosition, const ::com::sun::star::lang::Locale& rFontLocale)
         {
-            xub_StrLen nNextGlyphLen(1);
+            sal_Int32 nNextGlyphLen(1);
 
             if(mxBreak.is())
             {
                 sal_Int32 nDone(0L);
-                nNextGlyphLen = (xub_StrLen)mxBreak->nextCharacters(pCandidate->getText(), nPosition,
+                nNextGlyphLen = mxBreak->nextCharacters(pCandidate->getText(), nPosition,
                     rFontLocale, CharacterIteratorMode::SKIPCELL, 1, nDone) - nPosition;
             }
 
@@ -353,11 +353,11 @@ namespace
 
                     drawinglayer::primitive2d::TextLayouterDevice aTextLayouter;
                     aTextLayouter.setFont(pCandidate->getFont());
-                    xub_StrLen nUsedTextLength(0);
+                    sal_Int32 nUsedTextLength(0);
 
                     while(nUsedTextLength < pCandidate->getTextLength() && fPolyStart < fPolyEnd)
                     {
-                        xub_StrLen nNextGlyphLen(getNextGlyphLen(pCandidate, pCandidate->getTextStart() + nUsedTextLength, pCandidate->getLocale()));
+                        sal_Int32 nNextGlyphLen(getNextGlyphLen(pCandidate, pCandidate->getTextStart() + nUsedTextLength, pCandidate->getLocale()));
 
                         // prepare portion length. Takes RTL sections into account.
                         double fPortionLength(pCandidate->getDisplayLength(nUsedTextLength, nNextGlyphLen));
@@ -479,7 +479,7 @@ namespace
 
                         if(!pCandidate->getText().isEmpty() && nNextGlyphLen)
                         {
-                            const xub_StrLen nPortionIndex(pCandidate->getPortionIndex(nUsedTextLength, nNextGlyphLen));
+                            const sal_Int32 nPortionIndex(pCandidate->getPortionIndex(nUsedTextLength, nNextGlyphLen));
                             ::std::vector< double > aNewDXArray;
 
                             if(nNextGlyphLen > 1 && pCandidate->getDoubleDXArray().size())
@@ -548,8 +548,8 @@ namespace
                             }
                         }
 
-                        // consume from portion // no += here, xub_StrLen is sal_uInt16 and the compiler will generate a warning here
-                        nUsedTextLength = nUsedTextLength + nNextGlyphLen;
+                        // consume from portion
+                        nUsedTextLength += nNextGlyphLen;
 
                         // consume from polygon
                         fPolyStart += fPortionLength;


More information about the Libreoffice-commits mailing list