[Libreoffice-commits] .: 2 commits - binfilter/bf_basic binfilter/bf_sc binfilter/bf_svtools binfilter/bf_svx binfilter/bf_sw binfilter/bf_xmloff binfilter/inc

Caolán McNamara caolan at kemper.freedesktop.org
Mon Jun 18 07:20:55 PDT 2012


 binfilter/bf_basic/source/sbx/sbxscan.cxx                     |    4 ++--
 binfilter/bf_sc/source/core/tool/sc_compiler.cxx              |    4 ++--
 binfilter/bf_svtools/source/filter.vcl/filter/svt_sgvtext.cxx |    2 +-
 binfilter/bf_svtools/source/numbers/svt_zforfind.cxx          |    4 ++--
 binfilter/bf_svtools/source/numbers/svt_zforscan.cxx          |    6 +++---
 binfilter/bf_svx/source/items/svx_paraitem.cxx                |    4 ++--
 binfilter/bf_svx/source/svdraw/svx_svdmodel.cxx               |    2 +-
 binfilter/bf_svx/source/svdraw/svx_svdomeas.cxx               |    2 +-
 binfilter/bf_sw/source/core/bastyp/sw_calc.cxx                |   10 +++++-----
 binfilter/bf_xmloff/source/style/xmloff_xmlnumfi.cxx          |    2 +-
 binfilter/inc/bf_tools/string.hxx                             |    5 +++++
 11 files changed, 25 insertions(+), 20 deletions(-)

New commits:
commit 841ffc4a848f8ca496154e4a37be8c3dc0db3107
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Jun 18 11:34:32 2012 +0100

    detect wrong UniString ctor
    
    there's no way j was intended to be used as a rtl_TextEncoding
    here. From context it's clearly meant to create a UniString from
    a subset of the input ByteString
    
    Change-Id: I4aa47173a8c81b3e61a14697ed3db89e93f4637b

diff --git a/binfilter/bf_svtools/source/filter.vcl/filter/svt_sgvtext.cxx b/binfilter/bf_svtools/source/filter.vcl/filter/svt_sgvtext.cxx
index e2bcfe0..ea35f0f 100644
--- a/binfilter/bf_svtools/source/filter.vcl/filter/svt_sgvtext.cxx
+++ b/binfilter/bf_svtools/source/filter.vcl/filter/svt_sgvtext.cxx
@@ -1178,7 +1178,7 @@ void SgfFontOne::ReadOne( const rtl::OString& rID, ByteString& Dsc )
         i--;
         j++;
     }
-    SVFName=String(Dsc,i+1,j);                       // SV-Fontname rausholen
+    SVFName=String(Dsc,i+1,j,RTL_TEXTENCODING_IBM_437); // SV-Fontname rausholen
     Dsc.Erase(i,j);
 
     IFID = (UINT32)rID.toInt32();
diff --git a/binfilter/inc/bf_tools/string.hxx b/binfilter/inc/bf_tools/string.hxx
index ab65840..d8dfdfd 100644
--- a/binfilter/inc/bf_tools/string.hxx
+++ b/binfilter/inc/bf_tools/string.hxx
@@ -277,6 +277,11 @@ private:
 
     //detect and reject use of RTL_CONSTASCII_STRINGPARAM instead of RTL_CONSTASCII_USTRINGPARAM
     UniString( const sal_Char*, sal_Int32 );
+
+    //detect and reject wrong way to attempt to create a UniString from a substring of
+    //a ByteString
+    UniString( const ByteString& rByteStr, xub_StrLen nPos, xub_StrLen nLen,
+               sal_uInt32 nCvtFlags = BYTESTRING_TO_UNISTRING_CVTFLAGS );
 public:
                         UniString();
                         UniString( const UniString& rStr );
commit df9db235f9b1053bda9f220e383c8c5c0475bf23
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Jun 17 21:01:13 2012 +0100

    convert LocaleDataWrapper to OUString
    
    Change-Id: I3b0be7583db3985185ae7bd70d13ef0d233af84a

diff --git a/binfilter/bf_basic/source/sbx/sbxscan.cxx b/binfilter/bf_basic/source/sbx/sbxscan.cxx
index d6874e3..ccce18a 100644
--- a/binfilter/bf_basic/source/sbx/sbxscan.cxx
+++ b/binfilter/bf_basic/source/sbx/sbxscan.cxx
@@ -51,8 +51,8 @@ void ImpGetIntntlSep( sal_Unicode& rcDecimalSep, sal_Unicode& rcThousandSep )
 {
     SvtSysLocale aSysLocale;
     const LocaleDataWrapper& rData = aSysLocale.GetLocaleData();
-    rcDecimalSep = rData.getNumDecimalSep().GetBuffer()[0];
-    rcThousandSep = rData.getNumThousandSep().GetBuffer()[0];
+    rcDecimalSep = rData.getNumDecimalSep()[0];
+    rcThousandSep = rData.getNumThousandSep()[0];
 }
 
 // Scannen eines Strings nach BASIC-Konventionen
diff --git a/binfilter/bf_sc/source/core/tool/sc_compiler.cxx b/binfilter/bf_sc/source/core/tool/sc_compiler.cxx
index cc24c94..1fd82e0 100644
--- a/binfilter/bf_sc/source/core/tool/sc_compiler.cxx
+++ b/binfilter/bf_sc/source/core/tool/sc_compiler.cxx
@@ -867,7 +867,7 @@ namespace binfilter {
 /*N*/     // Has to be called before IsValue
 /*N*/   sal_Unicode ch1 = rName.GetChar(0);
 /*N*/   sal_Unicode cDecSep = ( pSymbolTable == pSymbolTableEnglish ? '.' :
-/*N*/         ScGlobal::pLocaleData->getNumDecimalSep().GetChar(0) );
+/*N*/         ScGlobal::pLocaleData->getNumDecimalSep()[0] );
 /*N*/   if ( ch1 == cDecSep )
 /*N*/       return FALSE;
 /*N*/     // Who was that imbecile introducing '.' as the sheet name separator!?!
@@ -3049,7 +3049,7 @@ namespace binfilter {
 /*N*/                 ::rtl::math::doubleToUStringBuffer( rBuffer, t->GetDouble(),
 /*N*/                         rtl_math_StringFormat_Automatic,
 /*N*/                         rtl_math_DecimalPlaces_Max,
-/*N*/                         ScGlobal::pLocaleData->getNumDecimalSep().GetChar(0),
+/*N*/                         ScGlobal::pLocaleData->getNumDecimalSep()[0],
 /*N*/                         TRUE );
 /*N*/             }
 /*N*/       }
diff --git a/binfilter/bf_svtools/source/numbers/svt_zforfind.cxx b/binfilter/bf_svtools/source/numbers/svt_zforfind.cxx
index 17a38bb..b7b146b 100644
--- a/binfilter/bf_svtools/source/numbers/svt_zforfind.cxx
+++ b/binfilter/bf_svtools/source/numbers/svt_zforfind.cxx
@@ -678,13 +678,13 @@ BOOL ImpSvNumberInputScan::GetTimeAmPm( const String& rString, xub_StrLen& nPos
         if ( StringContains( pChr->uppercase( pLoc->getTimeAM() ), rString, nPos ) )
         {
             nAmPm = 1;
-            nPos = nPos + pLoc->getTimeAM().Len();
+            nPos = nPos + pLoc->getTimeAM().getLength();
             return TRUE;
         }
         else if ( StringContains( pChr->uppercase( pLoc->getTimePM() ), rString, nPos ) )
         {
             nAmPm = -1;
-            nPos = nPos + pLoc->getTimePM().Len();
+            nPos = nPos + pLoc->getTimePM().getLength();
             return TRUE;
         }
     }
diff --git a/binfilter/bf_svtools/source/numbers/svt_zforscan.cxx b/binfilter/bf_svtools/source/numbers/svt_zforscan.cxx
index fe4ed43..e44f921 100644
--- a/binfilter/bf_svtools/source/numbers/svt_zforscan.cxx
+++ b/binfilter/bf_svtools/source/numbers/svt_zforscan.cxx
@@ -1198,7 +1198,7 @@ xub_StrLen ImpSvNumberformatScan::ScanType(const String&)
                     eNewType = NUMBERFORMAT_TEXT;
                 break;
                 default:
-                    if ( sStrArray[i] == pLoc->getTime100SecSep() )
+                    if ( pLoc->getTime100SecSep().equals(sStrArray[i]) )
                         bDecSep = TRUE;                     // for SS,0
                     eNewType = NUMBERFORMAT_UNDEFINED;
                 break;
@@ -1247,7 +1247,7 @@ xub_StrLen ImpSvNumberformatScan::ScanType(const String&)
                         {
                             if (nCurrPos != STRING_NOTFOUND)
                                 eScannedType = NUMBERFORMAT_UNDEFINED;
-                            else if ( sStrArray[i] != pLoc->getTimeSep() )
+                            else if ( !pLoc->getTimeSep().equals(sStrArray[i]) )
                                 return nPos;
                         }
                     }
@@ -1267,7 +1267,7 @@ xub_StrLen ImpSvNumberformatScan::ScanType(const String&)
                             if (nCurrPos != STRING_NOTFOUND)
                                 eScannedType = NUMBERFORMAT_UNDEFINED;
                             else if ( sStrArray[i] != pFormatter->GetDateSep()
-                                   && sStrArray[i] != pLoc->getTimeSep() )
+                                   && !pLoc->getTimeSep().equals(sStrArray[i]) )
                                 return nPos;
                         }
                     }
diff --git a/binfilter/bf_svx/source/items/svx_paraitem.cxx b/binfilter/bf_svx/source/items/svx_paraitem.cxx
index f319202..db791f4 100644
--- a/binfilter/bf_svx/source/items/svx_paraitem.cxx
+++ b/binfilter/bf_svx/source/items/svx_paraitem.cxx
@@ -584,7 +584,7 @@ using namespace ::com::sun::star;
 /*N*/ {
 /*N*/   nTabPos = 0;
 /*N*/   eAdjustment = SVX_TAB_ADJUST_LEFT;
-/*N*/   cDecimal = SvtSysLocale().GetLocaleData().getNumDecimalSep().GetChar(0);
+/*N*/   cDecimal = SvtSysLocale().GetLocaleData().getNumDecimalSep()[0];
 /*N*/   cFill = cDfltFillChar;
 /*N*/ }
 
@@ -595,7 +595,7 @@ using namespace ::com::sun::star;
 /*N*/ {
 /*N*/   nTabPos = nPos;
 /*N*/   eAdjustment = eAdjst;
-/*N*/   cDecimal = ( cDfltDecimalChar == cDec ) ? SvtSysLocale().GetLocaleData().getNumDecimalSep().GetChar(0) : cDec;
+/*N*/   cDecimal = ( cDfltDecimalChar == cDec ) ? SvtSysLocale().GetLocaleData().getNumDecimalSep()[0] : cDec;
 /*N*/   cFill = cFil;
 /*N*/ }
 
diff --git a/binfilter/bf_svx/source/svdraw/svx_svdmodel.cxx b/binfilter/bf_svx/source/svdraw/svx_svdmodel.cxx
index f637e3b..6781f17 100644
--- a/binfilter/bf_svx/source/svdraw/svx_svdmodel.cxx
+++ b/binfilter/bf_svx/source/svdraw/svx_svdmodel.cxx
@@ -1056,7 +1056,7 @@ using namespace ::com::sun::star;
 /*?*/           rStr.Insert(sal_Unicode('0'), 0);
 /*?*/   }
 /*?*/
-/*?*/     sal_Unicode cDec( rLoc.getNumDecimalSep().GetChar(0) );
+/*?*/   sal_Unicode cDec( rLoc.getNumDecimalSep()[0] );
 /*?*/
 /*?*/   // KommaChar einfuegen
 /*?*/   sal_Int32 nVorKomma(rStr.Len() - nKomma);
diff --git a/binfilter/bf_svx/source/svdraw/svx_svdomeas.cxx b/binfilter/bf_svx/source/svdraw/svx_svdomeas.cxx
index e55e6ef..eede59b 100644
--- a/binfilter/bf_svx/source/svdraw/svx_svdomeas.cxx
+++ b/binfilter/bf_svx/source/svdraw/svx_svdomeas.cxx
@@ -146,7 +146,7 @@ namespace binfilter {
 /*?*/                   rStr += sal_Unicode('?');
 /*?*/               }
 /*?*/
-/*?*/                 sal_Unicode cDec(SvtSysLocale().GetLocaleData().getNumDecimalSep().GetChar(0));
+/*?*/               sal_Unicode cDec(SvtSysLocale().GetLocaleData().getNumDecimalSep()[0]);
 /*?*/
 /*?*/               if(rStr.Search(cDec) != STRING_NOTFOUND)
 /*?*/               {
diff --git a/binfilter/bf_sw/source/core/bastyp/sw_calc.cxx b/binfilter/bf_sw/source/core/bastyp/sw_calc.cxx
index 4890880..9c96762 100644
--- a/binfilter/bf_sw/source/core/bastyp/sw_calc.cxx
+++ b/binfilter/bf_sw/source/core/bastyp/sw_calc.cxx
@@ -462,7 +462,7 @@ static int
 /*N*/   String  aRetStr( ::rtl::math::doubleToUString( nValue,
 /*N*/                 rtl_math_StringFormat_Automatic,
 /*N*/                 nDec,
-/*N*/                 pLclData->getNumDecimalSep().GetChar(0),
+/*N*/                 pLclData->getNumDecimalSep()[0],
 /*N*/                 true ));
 /*N*/
 /*N*/   return aRetStr;
@@ -1239,8 +1239,8 @@ static int
 /*N*/     const sal_Unicode* pEnd;
 /*N*/     rVal = rtl_math_uStringToDouble( rCommand.GetBuffer() + rCommandPos,
 /*N*/             rCommand.GetBuffer() + rCommand.Len(),
-/*N*/             pLclD->getNumDecimalSep().GetChar(0),
-/*N*/             pLclD->getNumThousandSep().GetChar(0),
+/*N*/             pLclD->getNumDecimalSep()[0],
+/*N*/             pLclD->getNumThousandSep()[0],
 /*N*/             &eStatus, &pEnd );
 /*N*/   rCommandPos = pEnd - rCommand.GetBuffer();
 /*N*/
@@ -1269,8 +1269,8 @@ static int
 /*N*/     const sal_Unicode* pEnd;
 /*N*/     rVal = rtl_math_uStringToDouble( rCommand.GetBuffer() + rCommandPos,
 /*N*/             rCommand.GetBuffer() + rCommand.Len(),
-/*N*/             pLclD->getNumDecimalSep().GetChar(0),
-/*N*/             pLclD->getNumThousandSep().GetChar(0),
+/*N*/             pLclD->getNumDecimalSep()[0],
+/*N*/             pLclD->getNumThousandSep()[0],
 /*N*/             &eStatus, &pEnd );
 /*N*/   rCommandPos = pEnd - rCommand.GetBuffer();
 /*N*/
diff --git a/binfilter/bf_xmloff/source/style/xmloff_xmlnumfi.cxx b/binfilter/bf_xmloff/source/style/xmloff_xmlnumfi.cxx
index 7875e96..0e096b5 100644
--- a/binfilter/bf_xmloff/source/style/xmloff_xmlnumfi.cxx
+++ b/binfilter/bf_xmloff/source/style/xmloff_xmlnumfi.cxx
@@ -1046,7 +1046,7 @@ void SvXMLNumFmtElementContext::EndElement()
         case XML_TOK_STYLE_TEXT:
             if ( rParent.HasLongDoW() &&
                     rParent.GetLocaleData().getLongDateDayOfWeekSep() ==
-                        String( aContent.getStr() ) )
+                        aContent.toString() )
             {
                 //  skip separator constant after long day of week
                 //  (NF_KEY_NNNN contains the separator)


More information about the Libreoffice-commits mailing list