[Libreoffice-commits] .: svl/source
svl/source/items/style.cxx |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit 4ad425818402e96e526010ae00ee9a26d21c9ec3 Author: David Tardon dtar...@redhat.com Date: Tue Jan 22 15:24:29 2013 +0100 silence MacOS X tinderbox Change-Id: I53e2c5789c9d96187b13bb0d52da9d70f24b39b6 diff --git a/svl/source/items/style.cxx b/svl/source/items/style.cxx index 812567c..9116640 100644 --- a/svl/source/items/style.cxx +++ b/svl/source/items/style.cxx @@ -872,7 +872,8 @@ SfxStyleSheet::SfxStyleSheet(const XubString rName, SfxStyleSheet::SfxStyleSheet(const SfxStyleSheet rStyle) : SfxStyleSheetBase(rStyle), SfxListener( rStyle ), -SfxBroadcaster( rStyle ) +SfxBroadcaster( rStyle ), +svl::StyleSheetUser() {} SfxStyleSheet::~SfxStyleSheet() ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: svl/source
svl/source/numbers/zforfind.cxx | 67 +--- svl/source/numbers/zforfind.hxx | 10 + 2 files changed, 72 insertions(+), 5 deletions(-) New commits: commit f2851a270eb9c617fce9bfdde5c8f2428ced7014 Author: Eike Rathke er...@redhat.com Date: Wed Dec 19 19:21:55 2012 +0100 resolved fdo#54336 accept abbreviated combined date/time input Abbreviated combined date/time input was not accepted if the date acceptance pattern ended in a separator, like D.M. with input D.M. hh:mm. Additionally check that for D.M. # input against a D.M. pattern the '#' (any number) is not interpreted as year if the input so far was recognized to possibly match a date without time, in which case the count of numbers in input must match the count of numbers in pattern and input here is not a date. Change-Id: I3b123b872fbab9dab58afe3b6754b8ad70a61356 diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx index 6a19dd7..7e05fe4 100644 --- a/svl/source/numbers/zforfind.cxx +++ b/svl/source/numbers/zforfind.cxx @@ -140,6 +140,7 @@ void ImpSvNumberInputScan::Reset() nMayBeMonthDate = 0; nAcceptedDatePattern = -2; nDatePatternStart = 0; +nDatePatternNumbers = 0; nCanForceToIso8601 = 0; } @@ -1179,6 +1180,7 @@ bool ImpSvNumberInputScan::IsAcceptedDatePattern( sal_uInt16 nStartPatternAt ) for (sal_Int32 nPattern=0; nPattern sDateAcceptancePatterns.getLength(); ++nPattern) { sal_uInt16 nNext = nDatePatternStart; +nDatePatternNumbers = 0; bool bOk = true; const OUString rPat = sDateAcceptancePatterns[nPattern]; sal_Int32 nPat = 0; @@ -1190,6 +1192,8 @@ bool ImpSvNumberInputScan::IsAcceptedDatePattern( sal_uInt16 nStartPatternAt ) case 'M': case 'D': bOk = IsNum[nNext]; +if (bOk) +++nDatePatternNumbers; break; default: bOk = !IsNum[nNext]; @@ -1227,12 +1231,45 @@ bool ImpSvNumberInputScan::IsAcceptedDatePattern( sal_uInt16 nStartPatternAt ) if (nNext nAnzStrings) { // Pattern end but not input end. -if (!IsNum[nNext]) +// A trailing blank may be part of the current pattern input, +// if pattern is D.M. and input is D.M. hh:mm last was +// . , or may be following the current pattern input, if +// pattern is D.M and input is D.M hh:mm last was M. +sal_Int32 nPos = 0; +sal_uInt16 nCheck; +if (nPat 0 nNext 0) +{ +// nPat is one behind after the for loop. +sal_Int32 nPatCheck = nPat - 1; +switch (rPat[nPatCheck]) +{ +case 'Y': +case 'M': +case 'D': +nCheck = nNext; +break; +default: +{ +nCheck = nNext - 1; +// Advance position in input to match length of +// non-YMD (separator) characters in pattern. +sal_Unicode c; +do +{ +++nPos; +} while ((c = rPat[--nPatCheck]) != 'Y' c != 'M' c != 'D'); +} +} +} +else +{ +nCheck = nNext; +} +if (!IsNum[nCheck]) { // Trailing (or separating if time follows) blanks are ok. -sal_Int32 nPos = 0; -SkipBlanks( sStrArray[nNext], nPos); -if (nPos == sStrArray[nNext].getLength()) +SkipBlanks( sStrArray[nCheck], nPos); +if (nPos == sStrArray[nCheck].getLength()) { nAcceptedDatePattern = nPattern; return true; @@ -1307,6 +1344,18 @@ bool ImpSvNumberInputScan::SkipDatePatternSeparator( sal_uInt16 nParticle, sal_I //--- +sal_uInt16 ImpSvNumberInputScan::GetDatePatternNumbers() +{ +// If not initialized yet start with first number, if any. +if (!IsAcceptedDatePattern( (nAnzNums ? nNums[0] : 0))) +{ +return 0; +} +return nDatePatternNumbers; +} + +//--- + sal_uInt32 ImpSvNumberInputScan::GetDatePatternOrder() { // If not initialized yet start with first number, if
[Libreoffice-commits] .: svl/source
svl/source/numbers/zforfind.cxx | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) New commits: commit 8041285b369e58df477b5e92df4bde68e96056a2 Author: Eike Rathke er...@redhat.com Date: Wed Dec 19 21:53:13 2012 +0100 resolved fdo#54344 let date pattern match overrule incomplete format match Change-Id: I69a0c62ab5b4da036a77bd6c3b2baec0af7c8339 diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx index 7e05fe4..d5adf88 100644 --- a/svl/source/numbers/zforfind.cxx +++ b/svl/source/numbers/zforfind.cxx @@ -1678,11 +1678,21 @@ input for the following reasons: { case 0: // not found { -bool bHadExact; sal_uInt32 nExactDateOrder = (bFormatTurn ? pFormat-GetExactDateOrder() : GetDatePatternOrder()); bool bIsExact = (0xff nExactDateOrder nExactDateOrder = 0x); +if (!bIsExact bFormatTurn IsAcceptedDatePattern( nNums[0])) +{ +// If input does not match format but pattern, use pattern +// instead, even if eEDF==NF_EVALDATEFORMAT_FORMAT_INTL. +// For example, format has Y-M-D and pattern is D.M., +// input with 2 numbers can't match format and 31.12. would +// lead to 1931-12-01 (fdo#54344) +nExactDateOrder = GetDatePatternOrder(); +bIsExact = (0xff nExactDateOrder nExactDateOrder = 0x); +} +bool bHadExact; if (bIsExact) { // formatted as date and exactly 2 parts ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: svl/source
svl/source/numbers/zforscan.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 91d3c0ce2b808e917ee45f18f2c40a58329d2c19 Author: Eike Rathke er...@redhat.com Date: Tue Dec 18 19:16:43 2012 +0100 resolved fdo#58179 ImpSvNumberformatScan::RemoveQuotes: both ... Bug crept in with String to OUString change of 1599fc9e54a7c4855bee1c30d92dd1f5be05f530 Change-Id: I25a6b40de10785bc861fa2b353edada0e4a623c9 diff --git a/svl/source/numbers/zforscan.cxx b/svl/source/numbers/zforscan.cxx index 0b88129..24c14a7 100644 --- a/svl/source/numbers/zforscan.cxx +++ b/svl/source/numbers/zforscan.cxx @@ -2853,7 +2853,7 @@ sal_Int32 ImpSvNumberformatScan::RemoveQuotes( OUString rStr ) sal_Int32 n = rStr.getLength() - 1; if ( c == '' rStr[n] == '' ) { -rStr = rStr.copy(1,n); +rStr = rStr.copy( 1, n-1); return 2; } else if ( c == '\\' ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: svl/source
svl/source/misc/restrictedpaths.cxx |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) New commits: commit 422ed6bc3a7811121dea060a9e36d64de434f261 Author: Norbert Thiebaud nthieb...@gmail.com Date: Wed Nov 28 00:13:54 2012 -0600 fix windows miss in svl OUString work Change-Id: Iff20613231058db92d65cfecc5e4b16dd5395589 diff --git a/svl/source/misc/restrictedpaths.cxx b/svl/source/misc/restrictedpaths.cxx index 1cff971..c1b7f86 100644 --- a/svl/source/misc/restrictedpaths.cxx +++ b/svl/source/misc/restrictedpaths.cxx @@ -91,12 +91,13 @@ namespace svt boolm_bAllowParent; public: inline CheckURLAllowed( const OUString _rCheckURL, bool bAllowParent = true ) -:m_sCheckURL( _rCheckURL ), m_bAllowParent( bAllowParent ) +: m_sCheckURL( _rCheckURL ) +, m_bAllowParent( bAllowParent ) { #ifdef WNT // on windows, assume that the relevant file systems are case insensitive, // thus normalize the URL -m_sCheckURL = m_aSysLocale.GetCharClass().lowercase( m_sCheckURL, 0, m_sCheckURL.Len() ); +m_sCheckURL = m_aSysLocale.GetCharClass().lowercase( m_sCheckURL, 0, m_sCheckURL.getLength() ); #endif } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: svl/source
svl/source/items/itempool.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit c6c3bf968fed804bc31f6b3a5af74a7141dac139 Author: Eike Rathke er...@redhat.com Date: Thu Nov 22 12:45:54 2012 +0100 silenced a SAL_WARN that was HACK macro, use SAL_INFO instead Change-Id: Ifea40945c1ac9596a97bf8b84aab734a86be8f38 diff --git a/svl/source/items/itempool.cxx b/svl/source/items/itempool.cxx index 5448421..cc678eb 100644 --- a/svl/source/items/itempool.cxx +++ b/svl/source/items/itempool.cxx @@ -376,7 +376,7 @@ void SfxItemPool::SetSecondaryPool( SfxItemPool *pPool ) if ( pImp-mpSecondary ) { #ifdef DBG_UTIL -SAL_WARN( svl.items, fuer Image, dort gibt es derzeit keine Statics - Bug ); +SAL_INFO( svl.items, fuer Image, dort gibt es derzeit keine Statics - Bug ); if ( pImp-ppStaticDefaults ) { // Delete() ist noch nicht gelaufen? @@ -514,7 +514,7 @@ void SfxItemPool::Delete() sal_uInt16 nArrCnt; //Erst die SetItems abraeumen -SAL_WARN( svl.items, fuer Image, dort gibt es derzeit keine Statics - Bug ); +SAL_INFO( svl.items, fuer Image, dort gibt es derzeit keine Statics - Bug ); if ( pImp-ppStaticDefaults ) { for ( nArrCnt = GetSize_Impl(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: svl/source
svl/source/numbers/zforlist.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 760ef2ef7457aad9486a12a7f21da2b298749bf1 Author: Michael Stahl mst...@redhat.com Date: Mon Nov 19 13:33:45 2012 +0100 SvNumberFormatter: warning C4701 pot. uninitialized variable nCheckPos used Change-Id: I497d7ddc90bdfed9cd49e0b0c988a74f733bfa36 diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index ae02773..f609417 100644 --- a/svl/source/numbers/zforlist.cxx +++ b/svl/source/numbers/zforlist.cxx @@ -422,7 +422,7 @@ void SvNumberFormatter::ReplaceSystemCL( LanguageType eOldLanguage ) ChangeIntl( eOldLanguage ); LanguageType eLge = eOldLanguage; // ConvertMode changes this bool bCheck = false; -xub_StrLen nCheckPos; +xub_StrLen nCheckPos = 0; SvNumberformat* pNewEntry = new SvNumberformat( aString, pFormatScanner, pStringScanner, nCheckPos, eLge ); if ( nCheckPos != 0 ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: svl/source
svl/source/numbers/zformat.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 9b24ce6da284505aed2bbaf4ad2790c161fbc232 Author: Eike Rathke er...@redhat.com Date: Fri Nov 16 15:57:22 2012 +0100 use LanguageTag Change-Id: I28aff5533ec6cc31a3d6f3de3198452bd716ba62 diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index 52ae19c..8a171ea 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -5206,7 +5206,7 @@ String SvNumberformat::ImpGetNatNumString( const SvNumberNatNum rNum, OUString SvNumberformat::impTransliterateImpl(const OUString rStr, const SvNumberNatNum rNum ) const { -com::sun::star::lang::Locale aLocale( MsLangId::convertLanguageToLocale( rNum.GetLang() ) ); +com::sun::star::lang::Locale aLocale( LanguageTag( rNum.GetLang() ).getLocale() ); return GetFormatter().GetNatNum()-getNativeNumberString( rStr, aLocale, rNum.GetNatNum() ); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: svl/source
svl/source/items/nranges.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit cc6798946dd8ab54d3fac1e49e9a201724e6d747 Author: Stephan Bergmann sberg...@redhat.com Date: Wed Nov 14 09:24:12 2012 +0100 Turn odd number of Which-IDs into a true assert ...as it leads to crashes anyway (as witnessed with what got fixed with 09ee17974f31ca188df532a2fea33a79ca367ebe Fix Which-ID range of OfaTreeOptionsDialog item set). Change-Id: I9ad24d3dd11530ad002a5277d22b60e651e67d70 diff --git a/svl/source/items/nranges.cxx b/svl/source/items/nranges.cxx index b3a7210..c2c08cd 100644 --- a/svl/source/items/nranges.cxx +++ b/svl/source/items/nranges.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ - +#include cassert #include vector // compiled via include from itemset.cxx only! @@ -86,7 +86,7 @@ NUMTYPE InitializeRanges_Impl( NUMTYPE *rpRanges, va_list pArgs, aNumArr.push_back( nIns ); } -DBG_ASSERT( bEndOfRange, ungerade Anzahl von Which-Paaren! ); +assert( bEndOfRange ); // odd number of Which-IDs // so, jetzt sind alle Bereiche vorhanden und rpRanges = new NUMTYPE[ aNumArr.size() + 1 ]; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: svl/source
svl/source/numbers/zforscan.cxx |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) New commits: commit 0cd1ae1f9b85261e6915471938c5f6c3e0ec9283 Author: Noel Power noel.po...@suse.com Date: Tue Nov 13 16:30:07 2012 + don't always show integer part for fraction formats with hard denom fdo#56205 fixes bug when you have a fraction format with a forced denominator e.g. '?/5' which showed the integer part of the fraction ( as if the format was '# ?/5' ) but even without the space e.g. before fix pi 3.14159265358979 with format '?/8' would be shown as 31/8 after the fix 3.14159265358979 with format '?/8' would be shown as 25/8 Change-Id: I1feb8b78af94b90db1bcc30da248077243dd8dfc Reviewed-on: https://gerrit.libreoffice.org/1047 Reviewed-by: Eike Rathke er...@redhat.com Tested-by: Eike Rathke er...@redhat.com diff --git a/svl/source/numbers/zforscan.cxx b/svl/source/numbers/zforscan.cxx index 4916ff2..fb3649c 100644 --- a/svl/source/numbers/zforscan.cxx +++ b/svl/source/numbers/zforscan.cxx @@ -1595,7 +1595,9 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String rString ) nCounter = nCntPost; else if (nCntPre) nCounter = nCntPre; -if (!nCntPre) +// don't artificially increment nCntPre +// for forced denominator +if ( ( eScannedType != NUMBERFORMAT_FRACTION ) (!nCntPre) ) nCntPre++; } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: svl/source
svl/source/numbers/zforfind.cxx | 22 -- 1 file changed, 16 insertions(+), 6 deletions(-) New commits: commit 5391bd1e54157457abe1098b29f067d6e0059113 Author: Eike Rathke er...@redhat.com Date: Tue Nov 13 14:23:01 2012 +0100 resolved fdo#55369 accept fraction input if preset Accept fraction input without integer portion if the format was preset as fraction, e.g. 1/5 instead of 0 1/5 and don't force to date. Change-Id: I188593c57e5779aae029a1aa2ebd2c18de441804 diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx index 55d7fd7..4767f45 100644 --- a/svl/source/numbers/zforfind.cxx +++ b/svl/source/numbers/zforfind.cxx @@ -2014,14 +2014,24 @@ bool ImpSvNumberInputScan::ScanMidString( const String rString, { if ( eScannedType != NUMBERFORMAT_UNDEFINED // already another type eScannedType != NUMBERFORMAT_DATE) // except date -return MatchedReturn(); // = jan/31/1994 -else if (eScannedType != NUMBERFORMAT_DATE // analyzed date until now - (eSetType == NUMBERFORMAT_FRACTION // and preset was fraction - || (nAnzNums == 3 // or 3 numbers - nStringPos 2) ) ) // and what ??? +return MatchedReturn(); // = jan/31/1994 +else if (eScannedType != NUMBERFORMAT_DATE // analyzed no date until now + ( eSetType == NUMBERFORMAT_FRACTION // and preset was fraction +|| (nAnzNums == 3 // or 3 numbers + (nStringPos == 3 // and 3rd string particle +|| (nStringPos == 4 // or 4th + nSign) // if signed { SkipBlanks(rString, nPos); -eScannedType = NUMBERFORMAT_FRACTION; // !!! it IS a fraction +if (nPos == rString.Len()) +{ +eScannedType = NUMBERFORMAT_FRACTION; // !!! it IS a fraction (so far) +if (eSetType == NUMBERFORMAT_FRACTION + nAnzNums == 2 + (nStringPos == 1 // for 4/5 +|| (nStringPos == 2 nSign))) // or signed -4/5 +return true;// don't fall into date trap +} } else nPos--; // put '/' back ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: svl/source
svl/source/numbers/zforfind.cxx | 12 ++-- svl/source/numbers/zforlist.cxx | 18 +- svl/source/numbers/zformat.cxx | 12 ++-- 3 files changed, 21 insertions(+), 21 deletions(-) New commits: commit 09908f8da622d5443fb75fabeff87df81472b5e8 Author: Eike Rathke er...@redhat.com Date: Fri Oct 26 15:46:10 2012 +0200 consistently use SAL_WARN svl.numbers Change-Id: I16c555e87f8df19a74c8d34f21bce4570c1d756f diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx index b2f8d2b..da2a66f 100644 --- a/svl/source/numbers/zforfind.cxx +++ b/svl/source/numbers/zforfind.cxx @@ -886,7 +886,7 @@ bool ImpSvNumberInputScan::GetTimeRef( { nHour = 0; bRet = false; -SAL_WARN( svl, ImpSvNumberInputScan::GetTimeRef: bad number index); +SAL_WARN( svl.numbers, ImpSvNumberInputScan::GetTimeRef: bad number index); } if (nDecPos == 2 nAnz == 2) // 45.5 nMinute = 0; @@ -1082,7 +1082,7 @@ bool ImpSvNumberInputScan::IsAcceptedDatePattern( sal_uInt16 nStartPatternAt ) else if (!sDateAcceptancePatterns.getLength()) { sDateAcceptancePatterns = pFormatter-GetLocaleData()-getDateAcceptancePatterns(); -SAL_WARN_IF( !sDateAcceptancePatterns.getLength(), svl, ImpSvNumberInputScan::IsAcceptedDatePattern: no date acceptance patterns); +SAL_WARN_IF( !sDateAcceptancePatterns.getLength(), svl.numbers, ImpSvNumberInputScan::IsAcceptedDatePattern: no date acceptance patterns); nAcceptedDatePattern = (sDateAcceptancePatterns.getLength() ? -2 : -1); } @@ -1300,7 +1300,7 @@ DateFormat ImpSvNumberInputScan::GetDateOrder() break; } } -SAL_WARN( svl, ImpSvNumberInputScan::GetDateOrder: undefined, falling back to locale's default); +SAL_WARN( svl.numbers, ImpSvNumberInputScan::GetDateOrder: undefined, falling back to locale's default); return pFormatter-GetLocaleData()-getDateFormat(); } @@ -1379,7 +1379,7 @@ bool ImpSvNumberInputScan::GetDateRef( double fDays, sal_uInt16 nCounter, } break; default: -OSL_FAIL( ImpSvNumberInputScan::GetDateRef: unknown NfEvalDateFormat ); +SAL_WARN( svl.numbers, ImpSvNumberInputScan::GetDateRef: unknown NfEvalDateFormat ); DateFmt = YMD; bFormatTurn = false; } @@ -1550,7 +1550,7 @@ input for the following reasons: default: bHadExact = false; } -SAL_WARN_IF( !bHadExact, svl, ImpSvNumberInputScan::GetDateRef: error in exact date order); +SAL_WARN_IF( !bHadExact, svl.numbers, ImpSvNumberInputScan::GetDateRef: error in exact date order); } else bHadExact = false; @@ -3230,7 +3230,7 @@ bool ImpSvNumberInputScan::IsNumberFormat( break; default: -SAL_WARN( svl, Some number recognized but what's it? ); +SAL_WARN( svl.numbers, Some number recognized but what's it? ); fOutNumber = 0.0; break; } diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index db12eda..7236766 100644 --- a/svl/source/numbers/zforlist.cxx +++ b/svl/source/numbers/zforlist.cxx @@ -511,7 +511,7 @@ bool SvNumberFormatter::PutEntry(String rString, sal_uInt32 nPos = CLOffset + pStdFormat-GetLastInsertKey(); if (nPos - CLOffset = SV_COUNTRY_LANGUAGE_OFFSET) { -OSL_FAIL(SvNumberFormatter:: Zu viele Formate pro CL); +SAL_WARN( svl.numbers, SvNumberFormatter:: Zu viele Formate pro CL); delete p_Entry; } else if (!aFTable.insert(make_pair( nPos+1,p_Entry)).second) @@ -829,7 +829,7 @@ String SvNumberFormatter::GetKeyword( LanguageType eLnge, sal_uInt16 nIndex ) if ( nIndex NF_KEYWORD_ENTRIES_COUNT ) return rTable[nIndex]; -OSL_FAIL(GetKeyword: invalid index); +SAL_WARN( svl.numbers, GetKeyword: invalid index); return String(); } @@ -2928,7 +2928,7 @@ SvNumberFormatterIndexTable* SvNumberFormatter::MergeFormatter(SvNumberFormatter nNewKey = nPos+1; if (nPos - nCLOffset = SV_COUNTRY_LANGUAGE_OFFSET) { -OSL_FAIL( +SAL_WARN( svl.numbers, SvNumberFormatter:: Zu viele Formate pro CL); delete pNewEntry; } @@ -3880,7 +3880,7 @@ void NfCurrencyEntry::CompletePositiveFormatString(OUStringBuffer rStr, } break; default: -OSL_FAIL(NfCurrencyEntry::CompletePositiveFormatString: unknown option); +
[Libreoffice-commits] .: svl/source
svl/source/numbers/zforlist.cxx | 31 ++- 1 file changed, 26 insertions(+), 5 deletions(-) New commits: commit dbd85e2b73b87c7f9ad53a8e4dbc124b24c3ec89 Author: Eike Rathke er...@redhat.com Date: Fri Oct 26 16:25:04 2012 +0200 SAL_WARN on dup positions Change-Id: I6ac3940fb0b07d280998a56d5eaede0909f14bce diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index 7236766..9bc4f5d 100644 --- a/svl/source/numbers/zforlist.cxx +++ b/svl/source/numbers/zforlist.cxx @@ -509,13 +509,16 @@ bool SvNumberFormatter::PutEntry(String rString, SvNumberformat* pStdFormat = GetFormatEntry(CLOffset + ZF_STANDARD); sal_uInt32 nPos = CLOffset + pStdFormat-GetLastInsertKey(); -if (nPos - CLOffset = SV_COUNTRY_LANGUAGE_OFFSET) +if (nPos+1 - CLOffset = SV_COUNTRY_LANGUAGE_OFFSET) { -SAL_WARN( svl.numbers, SvNumberFormatter:: Zu viele Formate pro CL); +SAL_WARN( svl.numbers, SvNumberFormatter::PutEntry: too many formats for CL); delete p_Entry; } else if (!aFTable.insert(make_pair( nPos+1,p_Entry)).second) +{ +SAL_WARN( svl.numbers, SvNumberFormatter::PutEntry: dup position); delete p_Entry; +} else { bCheck = true; @@ -714,7 +717,10 @@ bool SvNumberFormatter::Load( SvStream rStream ) pEnt-SetLastInsertKey(pEntry-GetLastInsertKey()); } if (!aFTable.insert(make_pair( nPos, pEntry)).second) +{ +SAL_WARN( svl.numbers, SvNumberFormatter::Load: dup position); delete pEntry; +} rStream nPos; } @@ -1843,6 +1849,10 @@ SvNumberformat* SvNumberFormatter::ImpInsertFormat( aMsg += rCode.Code; LocaleDataWrapper::outputCheckMessage( xLocaleData-appendLocaleInfo( aMsg)); } +else +{ +SAL_WARN( svl.numbers, SvNumberFormatter::ImpInsertFormat: dup position); +} delete pFormat; return NULL; } @@ -2203,7 +2213,10 @@ void SvNumberFormatter::ImpGenerateFormats( sal_uInt32 CLOffset, bool bNoAdditio if ( !aFTable.insert(make_pair( CLOffset + SetIndexTable( NF_BOOLEAN, ZF_STANDARD_LOGICAL ), pNewFormat)).second) +{ +SAL_WARN( svl.numbers, SvNumberFormatter::ImpGenerateFormats: dup position Boolean); delete pNewFormat; +} // Text aFormatCode = '@'; @@ -2214,7 +2227,10 @@ void SvNumberFormatter::ImpGenerateFormats( sal_uInt32 CLOffset, bool bNoAdditio if ( !aFTable.insert(make_pair( CLOffset + SetIndexTable( NF_TEXT, ZF_STANDARD_TEXT ), pNewFormat)).second) +{ +SAL_WARN( svl.numbers, SvNumberFormatter::ImpGenerateFormats: dup position Text); delete pNewFormat; +} @@ -2904,7 +2920,10 @@ SvNumberFormatterIndexTable* SvNumberFormatter::MergeFormatter(SvNumberFormatter // pNewEntry = new SvNumberformat(*pFormat); // Copy is not sufficient! pNewEntry = new SvNumberformat( *pFormat, *pFormatScanner ); if (!aFTable.insert(make_pair( nNewKey, pNewEntry)).second) +{ +SAL_WARN( svl.numbers, SvNumberFormatter::MergeFormatter: dup position); delete pNewEntry; +} } if (nNewKey != nOldKey) // new index { @@ -2926,14 +2945,16 @@ SvNumberFormatterIndexTable* SvNumberFormatter::MergeFormatter(SvNumberFormatter GetFormatEntry(nCLOffset + ZF_STANDARD); sal_uInt32 nPos = nCLOffset + pStdFormat-GetLastInsertKey(); nNewKey = nPos+1; -if (nPos - nCLOffset = SV_COUNTRY_LANGUAGE_OFFSET) +if (nNewKey - nCLOffset = SV_COUNTRY_LANGUAGE_OFFSET) { -SAL_WARN( svl.numbers, -SvNumberFormatter:: Zu viele Formate pro CL); +SAL_WARN( svl.numbers, SvNumberFormatter::MergeFormatter: too many formats for CL); delete pNewEntry; } else if (!aFTable.insert(make_pair( nNewKey, pNewEntry)).second) +{ +SAL_WARN( svl.numbers, SvNumberFormatter::MergeFormatter: dup position); delete pNewEntry; +} else pStdFormat-SetLastInsertKey((sal_uInt16) (nNewKey - nCLOffset)); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: svl/source svtools/source
svl/source/numbers/zformat.cxx |2 +- svtools/source/misc/ehdl.cxx | 40 +--- 2 files changed, 10 insertions(+), 32 deletions(-) New commits: commit 55149144cb926513ef250c87fdf0c59e11e2f6cf Author: Michael Stahl mst...@redhat.com Date: Tue Oct 9 23:32:18 2012 +0200 SfxErrorHandler::CreateString: remove pointless loops Change-Id: I585add18ea917249df252827e0eee944e59ce410 diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index 4049881..447bcf5 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -4721,7 +4721,7 @@ OUString SvNumberformat::GetMappedFormatstring( { // append empty subformats aStr.append( ';' ); } -return aStr.getStr(); +return aStr.makeStringAndClear(); } String SvNumberformat::ImpGetNatNumString( const SvNumberNatNum rNum, diff --git a/svtools/source/misc/ehdl.cxx b/svtools/source/misc/ehdl.cxx index 97b81fd..1fac294 100644 --- a/svtools/source/misc/ehdl.cxx +++ b/svtools/source/misc/ehdl.cxx @@ -192,13 +192,7 @@ sal_Bool SfxErrorHandler::CreateString( { if(GetMessageString(nErrCode, rStr, nFlags)) { -for (xub_StrLen i = 0; i rStr.getLength();) -{ -if( rStr.indexOf(OUString($(ARG1)), i) == -1 ) -break; -rStr = rStr.replaceAll($(ARG1), pMsgInfo-GetMessageArg(), i); -i = i + pMsgInfo-GetMessageArg().getLength(); -} +rStr = rStr.replaceAll($(ARG1), pMsgInfo-GetMessageArg()); return sal_True; } } @@ -206,35 +200,19 @@ sal_Bool SfxErrorHandler::CreateString( { StringErrorInfo *pStringInfo=PTR_CAST(StringErrorInfo,pErr); if(pStringInfo) -for (xub_StrLen i = 0; i rStr.getLength();) -{ -if( rStr.indexOf($(ARG1), i) == -1 ) -break; -rStr = rStr.replaceAll(rtl::OUString($(ARG1)), - pStringInfo-GetErrorString(), i); -i = i + pStringInfo-GetErrorString().getLength(); -} +{ +rStr = rStr.replaceAll(rtl::OUString($(ARG1)), + pStringInfo-GetErrorString()); +} else { TwoStringErrorInfo * pTwoStringInfo = PTR_CAST(TwoStringErrorInfo, pErr); if (pTwoStringInfo) -for (sal_uInt16 i = 0; i rStr.getLength();) -{ -sal_uInt16 nArg1Pos = rStr.indexOf(rtl::OUString($(ARG1)), i); -sal_uInt16 nArg2Pos = rStr.indexOf(rtl::OUString($(ARG2)), i); -if (nArg1Pos nArg2Pos) -{ -rStr = rStr.replaceAt(nArg1Pos, 7, pTwoStringInfo-GetArg1()); -i = nArg1Pos + pTwoStringInfo-GetArg1().getLength(); -} -else if (nArg2Pos nArg1Pos) -{ -rStr = rStr.replaceAt(nArg2Pos, 7, pTwoStringInfo-GetArg2()); -i = nArg2Pos + pTwoStringInfo-GetArg2().getLength(); -} -else break; -} +{ +rStr = rStr.replaceAll($(ARG1), pTwoStringInfo-GetArg1()); +rStr = rStr.replaceAll($(ARG2), pTwoStringInfo-GetArg2()); +} } return sal_True; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: svl/source
svl/source/numbers/numfmuno.cxx | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) New commits: commit 61b94e06ef5a822e0dbe24528bc5d4d112a2547b Author: Caolán McNamara caol...@redhat.com Date: Tue Oct 9 23:13:29 2012 +0100 These are now already OUStrings, so no need for extra temp OUStrings Change-Id: I3cf01d975e468299d9dc009f389e88bff7c8f4a2 diff --git a/svl/source/numbers/numfmuno.cxx b/svl/source/numbers/numfmuno.cxx index 6b60052..e669a7f 100644 --- a/svl/source/numbers/numfmuno.cxx +++ b/svl/source/numbers/numfmuno.cxx @@ -804,13 +804,13 @@ uno::Any SAL_CALL SvNumberFormatObj::getPropertyValue( const rtl::OUString aPro { OUString aSymbol, aExt; pFormat-GetNewCurrencySymbol( aSymbol, aExt ); -aRet = rtl::OUString( aSymbol ); +aRet = aSymbol; } else if (aString.EqualsAscii( PROPERTYNAME_CURREXT )) { OUString aSymbol, aExt; pFormat-GetNewCurrencySymbol( aSymbol, aExt ); -aRet = rtl::OUString( aExt ); +aRet = aExt; } else if (aString.EqualsAscii( PROPERTYNAME_CURRABB )) { @@ -877,7 +877,7 @@ uno::Sequencebeans::PropertyValue SAL_CALL SvNumberFormatObj::getPropertyValue if (pFormat) { OUString aSymbol, aExt; -String aAbb; +OUString aAbb; bool bBank = false; pFormat-GetNewCurrencySymbol( aSymbol, aExt ); const NfCurrencyEntry* pCurr = pFormatter-GetCurrencyEntry( bBank, @@ -885,8 +885,8 @@ uno::Sequencebeans::PropertyValue SAL_CALL SvNumberFormatObj::getPropertyValue if ( pCurr ) aAbb = pCurr-GetBankSymbol(); -String aFmtStr = pFormat-GetFormatstring(); -String aComment = pFormat-GetComment(); +OUString aFmtStr = pFormat-GetFormatstring(); +OUString aComment = pFormat-GetComment(); sal_Bool bStandard = ( ( nKey % SV_COUNTRY_LANGUAGE_OFFSET ) == 0 ); //! SvNumberformat Member bStandard rausreichen? sal_Bool bUserDef = ( ( pFormat-GetType() NUMBERFORMAT_DEFINED ) != 0 ); @@ -900,13 +900,13 @@ uno::Sequencebeans::PropertyValue SAL_CALL SvNumberFormatObj::getPropertyValue beans::PropertyValue* pArray = aSeq.getArray(); pArray[0].Name = rtl::OUString(PROPERTYNAME_FMTSTR ); -pArray[0].Value = rtl::OUString( aFmtStr ); +pArray[0].Value = aFmtStr; pArray[1].Name = rtl::OUString(PROPERTYNAME_LOCALE ); pArray[1].Value = aLocale; pArray[2].Name = rtl::OUString(PROPERTYNAME_TYPE ); pArray[2].Value = (sal_Int16)( pFormat-GetType() ); pArray[3].Name = rtl::OUString(PROPERTYNAME_COMMENT ); -pArray[3].Value = rtl::OUString( aComment ); +pArray[3].Value = aComment; pArray[4].Name = rtl::OUString(PROPERTYNAME_STDFORM ); pArray[4].Value.setValue( bStandard, getBooleanCppuType() ); pArray[5].Name = rtl::OUString(PROPERTYNAME_USERDEF ); @@ -920,11 +920,11 @@ uno::Sequencebeans::PropertyValue SAL_CALL SvNumberFormatObj::getPropertyValue pArray[9].Name = rtl::OUString(PROPERTYNAME_THOUS ); pArray[9].Value.setValue( bThousand, getBooleanCppuType() ); pArray[10].Name = rtl::OUString(PROPERTYNAME_CURRSYM ); -pArray[10].Value = rtl::OUString( aSymbol ); +pArray[10].Value = aSymbol; pArray[11].Name = rtl::OUString(PROPERTYNAME_CURREXT ); -pArray[11].Value = rtl::OUString( aExt ); +pArray[11].Value = aExt; pArray[12].Name = rtl::OUString(PROPERTYNAME_CURRABB ); -pArray[12].Value = rtl::OUString( aAbb ); +pArray[12].Value = aAbb; return aSeq; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: svl/source
svl/source/items/style.cxx|3 ++- svl/source/misc/inethist.cxx |6 +++--- svl/source/misc/strmadpt.cxx | 11 ++- svl/source/numbers/numuno.cxx |2 +- 4 files changed, 12 insertions(+), 10 deletions(-) New commits: commit a3ffd9ed6ee0723de407691de93340af9975d3b7 Author: Arnaud Versini arnaud.vers...@gmail.com Date: Sun Sep 2 14:55:54 2012 +0200 Replace usage of rtl/memory.h in svl with equivalent from string.h Change-Id: I44e6b162a190939bfa17e04f551309d6249c48df diff --git a/svl/source/items/style.cxx b/svl/source/items/style.cxx index 06f70e0..3f6b768 100644 --- a/svl/source/items/style.cxx +++ b/svl/source/items/style.cxx @@ -33,6 +33,7 @@ #include unotools/syslocale.hxx #include algorithm #include comphelper/servicehelper.hxx +#include string.h #ifdef DBG_UTIL class DbgStyleSheetReferences @@ -942,7 +943,7 @@ SfxUnoStyleSheet* SfxUnoStyleSheet::getUnoStyleSheet( const ::com::sun::star::un ::sal_Int64 SAL_CALL SfxUnoStyleSheet::getSomething( const ::com::sun::star::uno::Sequence ::sal_Int8 rId ) throw (::com::sun::star::uno::RuntimeException) { -if( rId.getLength() == 16 0 == rtl_compareMemory( getIdentifier().getConstArray(), rId.getConstArray(), 16 ) ) +if( rId.getLength() == 16 0 == memcmp( getIdentifier().getConstArray(), rId.getConstArray(), 16 ) ) { return sal::static_int_castsal_Int64(reinterpret_castsal_uIntPtr(this)); } diff --git a/svl/source/misc/inethist.cxx b/svl/source/misc/inethist.cxx index 3530ced..8233358 100644 --- a/svl/source/misc/inethist.cxx +++ b/svl/source/misc/inethist.cxx @@ -20,10 +20,10 @@ #include svl/inethist.hxx #include algorithm +#include string.h #include rtl/instance.hxx #include rtl/crc.h -#include rtl/memory.h #include tools/solar.h #include tools/debug.hxx #include tools/string.hxx @@ -273,7 +273,7 @@ void INetURLHistory_Impl::move (sal_uInt16 nSI, sal_uInt16 nDI) if (nSI nDI) { // shift left. -rtl_moveMemory ( +memmove ( m_pHash[nSI], m_pHash[nSI + 1], (nDI - nSI) * sizeof(hash_entry)); @@ -281,7 +281,7 @@ void INetURLHistory_Impl::move (sal_uInt16 nSI, sal_uInt16 nDI) if (nSI nDI) { // shift right. -rtl_moveMemory ( +memmove ( m_pHash[nDI + 1], m_pHash[nDI], (nSI - nDI) * sizeof(hash_entry)); diff --git a/svl/source/misc/strmadpt.cxx b/svl/source/misc/strmadpt.cxx index cf1d41e..77a8676 100644 --- a/svl/source/misc/strmadpt.cxx +++ b/svl/source/misc/strmadpt.cxx @@ -23,8 +23,9 @@ #include algorithm #include limits #include set +#include string.h + #include rtl/alloc.h -#include rtl/memory.h #include svl/instrm.hxx #include svl/outstrm.hxx #include svl/strmadpt.hxx @@ -511,7 +512,7 @@ sal_uLong SvInputStream::GetData(void * pData, sal_uLong nSize) SetError(ERRCODE_IO_CANTREAD); return nRead; } -rtl_copyMemory(static_cast sal_Int8 * (pData) + nRead, +memcpy(static_cast sal_Int8 * (pData) + nRead, aBuffer.getConstArray(), sal_uInt32(nCount)); nRead += nCount; if (nCount nRemain) @@ -879,7 +880,7 @@ sal_uInt32 SvDataPipe_Impl::read() sal_uInt32 nBlock = std::min(sal_uInt32(m_pReadPage-m_pEnd - m_pReadPage-m_pRead), nRemain); -rtl_copyMemory(m_pReadBuffer, m_pReadPage-m_pRead, nBlock); +memcpy(m_pReadBuffer, m_pReadPage-m_pRead, nBlock); m_pReadPage-m_pRead += nBlock; m_pReadBuffer += nBlock; m_nReadBufferSize -= nBlock; @@ -942,7 +943,7 @@ sal_uInt32 SvDataPipe_Impl::write(sal_Int8 const * pBuffer, sal_uInt32 nSize) if (nBlock 0) { -rtl_copyMemory(m_pReadBuffer + m_nReadBufferFilled, pBuffer, +memcpy(m_pReadBuffer + m_nReadBufferFilled, pBuffer, nBlock); m_nReadBufferFilled += nBlock; nRemain -= nBlock; @@ -963,7 +964,7 @@ sal_uInt32 SvDataPipe_Impl::write(sal_Int8 const * pBuffer, sal_uInt32 nSize) = std::min(sal_uInt32(m_pWritePage-m_aBuffer + m_nPageSize - m_pWritePage-m_pEnd), nRemain); -rtl_copyMemory(m_pWritePage-m_pEnd, pBuffer, nBlock); +memcpy(m_pWritePage-m_pEnd, pBuffer, nBlock); m_pWritePage-m_pEnd += nBlock; pBuffer += nBlock; nRemain -= nBlock; diff --git a/svl/source/numbers/numuno.cxx b/svl/source/numbers/numuno.cxx index ee68795..8e5b4a1 100644 --- a/svl/source/numbers/numuno.cxx +++ b/svl/source/numbers/numuno.cxx @@ -106,7 +106,7 @@ sal_Int64 SAL_CALL SvNumberFormatsSupplierObj::getSomething( const uno::Sequencesal_Int8 rId )
[Libreoffice-commits] .: svl/source
svl/source/svdde/ddesvr.cxx | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) New commits: commit 8df3fbe5249c3f4a1ea3d5586b5c073d5a756fb0 Author: Fridrich Å trba fridrich.st...@bluewin.ch Date: Tue Jul 31 22:30:34 2012 +0200 Fix mingw build of svl Change-Id: I9992dba75903fea3d31be73de69e49f439df3a41 diff --git a/svl/source/svdde/ddesvr.cxx b/svl/source/svdde/ddesvr.cxx index dadba45..25cc3cf 100644 --- a/svl/source/svdde/ddesvr.cxx +++ b/svl/source/svdde/ddesvr.cxx @@ -82,8 +82,9 @@ HDDEDATA CALLBACK _export DdeInternal::SvrCallback( DdeQueryString( pInst-hDdeInstSvr, hText1, chTopicBuf, sizeof(chTopicBuf)/sizeof(TCHAR), CP_WINUNICODE ); -for( pService = rAll.First();pService;pService = rAll.Next() ) +for (DdeServices::iterator aI = rAll.begin(); aI != rAll.end(); ++aI) { +pService = *aI; if ( !hText2 || ( *pService-pName == hText2 ) ) { String sTopics( pService-Topics() ); @@ -113,8 +114,9 @@ HDDEDATA CALLBACK _export DdeInternal::SvrCallback( return (HDDEDATA)NULL; HSZPAIR* q = pPairs; -for( pService = rAll.First(); pService; pService = rAll.Next() ) +for (DdeServices::iterator aI = rAll.begin(); aI != rAll.end(); ++aI) { +pService = *aI; if ( !hText2 || (*pService-pName == hText2 ) ) { String sTopics( pService-Topics() ); @@ -177,8 +179,9 @@ HDDEDATA CALLBACK _export DdeInternal::SvrCallback( return (HDDEDATA)NULL; } -for ( pService = rAll.First(); pService; pService = rAll.Next() ) +for (DdeServices::iterator aI = rAll.begin(); aI != rAll.end(); ++aI) { +pService = *aI; for ( size_t i = 0, n = pService-pConv-size(); i n; ++i ) { pC = (*pService-pConv)[ i ]; @@ -365,8 +368,9 @@ DdeService* DdeInternal::FindService( HSZ hService ) { DdeService* s; DdeServices rSvc = DdeService::GetServices(); -for ( s = rSvc.First(); s; s = rSvc.Next() ) +for (DdeServices::iterator aI = rSvc.begin(); aI != rSvc.end(); ++aI) { +s = *aI; if ( *s-pName == hService ) return s; } @@ -1033,7 +1037,7 @@ String DdeService::Formats() { TCHAR buf[128]; GetClipboardFormatName( (UINT)f, buf, sizeof(buf) / sizeof(TCHAR) ); -s += rtl::OUString(buf); +s += rtl::OUString(reinterpret_castsal_Unicode*(buf)); } break; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: svl/source
svl/source/items/cstitem.src | 23 +++ 1 file changed, 23 insertions(+) New commits: commit f674de15e17e9608003d7b0af2abe3c11d1b1856 Author: Norbert Thiebaud nthieb...@gmail.com Date: Wed Jul 18 18:16:17 2012 -0500 Revert hrc cleanup: Remove unused cstitem.src This reverts commit ae95e31831916df760503bfc2496b7bc55bc638b. diff --git a/svl/source/items/cstitem.src b/svl/source/items/cstitem.src new file mode 100644 index 000..cc972e6 --- /dev/null +++ b/svl/source/items/cstitem.src @@ -0,0 +1,23 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the License); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include svl/svl.hrc +String STR_COLUM_DT_AUTO +{ +Text [ en-US ] = automatic ; +}; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: svl/source
svl/source/numbers/zforlist.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit e8bc25ab32b4b562ec4aa0ef648c08d7ee706f6a Author: David Tardon dtar...@redhat.com Date: Wed Jul 4 07:59:58 2012 +0200 explicitly convert to int to help the compiler select overloaded func Change-Id: I8462319d0c5ccea0bc4d5327c94660e2e683e268 diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index 368a022..252ff7b 100644 --- a/svl/source/numbers/zforlist.cxx +++ b/svl/source/numbers/zforlist.cxx @@ -1954,7 +1954,7 @@ sal_Int32 SvNumberFormatter::ImpGetFormatCodeIndex( || nTabOff == NF_CURRENCY_1000DEC2_CCC)) { // currency entries with decimals might not exist, e.g. Italian Lira rtl::OUString aMsg( SvNumberFormatter::ImpGetFormatCodeIndex: not found: ); -aMsg += rtl::OUString::valueOf( nTabOff ); +aMsg += rtl::OUString::valueOf( sal_Int32( nTabOff ) ); LocaleDataWrapper::outputCheckMessage( xLocaleData-appendLocaleInfo(aMsg)); } if ( nLen ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: svl/source
svl/source/numbers/zforlist.cxx | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) New commits: commit 7f5f50052df9222dd3bb0908cff7d864859ae213 Author: Olivier Hallot olivier.hal...@alta.org.br Date: Tue Jul 3 23:22:25 2012 -0300 Make windows tinderbox happy fix some cast for OUString Change-Id: I20563d404169b9e1f29699d52567760509fabb13 diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index 934a043..368a022 100644 --- a/svl/source/numbers/zforlist.cxx +++ b/svl/source/numbers/zforlist.cxx @@ -949,7 +949,7 @@ sal_uInt32 SvNumberFormatter::ImpGenerateCL( LanguageType eLnge, bool bNoAdditio if ( !aDupes.isEmpty() ) { rtl::OUString aMsg(XML locale data FormatElement formatindex dupe: ); -aMsg += rtl::OUString::valueOf( nIdx ); +aMsg += rtl::OUString::valueOf( sal_Int32(nIdx) ); aMsg += \nFormatElements: ; aMsg += rtl::OUString::valueOf( j ); aMsg += (; @@ -1740,7 +1740,7 @@ SvNumberformat* SvNumberFormatter::ImpInsertFormat( rCode.Index != NF_CURRENCY_1000DEC2_CCC ) { rtl::OUString aMsg(SvNumberFormatter::ImpInsertFormat: no [$...] on currency format code, index ); -aMsg += rtl::OUString::valueOf( rCode.Index ); +aMsg += rtl::OUString::valueOf( sal_Int32(rCode.Index) ); aMsg += :\n; aMsg += rCode.Code; LocaleDataWrapper::outputCheckMessage( xLocaleData-appendLocaleInfo( aMsg)); @@ -1758,7 +1758,7 @@ SvNumberformat* SvNumberFormatter::ImpInsertFormat( if (LocaleDataWrapper::areChecksEnabled()) { rtl::OUString aMsg( SvNumberFormatter::ImpInsertFormat: bad format code, index ); -aMsg += rtl::OUString::valueOf( rCode.Index ); +aMsg += rtl::OUString::valueOf( sal_Int32(rCode.Index) ); aMsg += \n; aMsg += rCode.Code; LocaleDataWrapper::outputCheckMessage( xLocaleData-appendLocaleInfo( aMsg)); @@ -1788,7 +1788,7 @@ SvNumberformat* SvNumberFormatter::ImpInsertFormat( default: { rtl::OUString aMsg(SvNumberFormatter::ImpInsertFormat: dup format code, index ); -aMsg += rtl::OUString::valueOf( rCode.Index ); +aMsg += rtl::OUString::valueOf( sal_Int32(rCode.Index) ); aMsg += \n; aMsg += rCode.Code; LocaleDataWrapper::outputCheckMessage( xLocaleData-appendLocaleInfo( aMsg)); @@ -1803,7 +1803,7 @@ SvNumberformat* SvNumberFormatter::ImpInsertFormat( if (LocaleDataWrapper::areChecksEnabled()) { rtl::OUString aMsg( SvNumberFormatter::ImpInsertFormat: too many format codes, index ); -aMsg += rtl::OUString::valueOf( rCode.Index ); +aMsg += rtl::OUString::valueOf( sal_Int32(rCode.Index) ); aMsg += \n; aMsg += rCode.Code; LocaleDataWrapper::outputCheckMessage( xLocaleData-appendLocaleInfo( aMsg)); @@ -1819,7 +1819,7 @@ SvNumberformat* SvNumberFormatter::ImpInsertFormat( rtl::OUString aMsg( ImpInsertFormat: can't insert number format key pos: ); aMsg += rtl::OUString::valueOf( sal_Int32( nPos ) ); aMsg += , code index ; -aMsg += rtl::OUString::valueOf( rCode.Index ); +aMsg += rtl::OUString::valueOf( sal_Int32(rCode.Index) ); aMsg += \n; aMsg += rCode.Code; LocaleDataWrapper::outputCheckMessage( xLocaleData-appendLocaleInfo( aMsg)); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: svl/source
svl/source/passwordcontainer/passwordcontainer.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 837c864bb3e1c1ea868d3b6f65f2af1a4cfb03e1 Author: Julien Nabet serval2...@yahoo.fr Date: Sat May 12 16:13:15 2012 +0200 Replace !var.size() by var.empty() Change-Id: I936b59a5bf339d1520cbc10e51b1e9fdc937f0f3 diff --git a/svl/source/passwordcontainer/passwordcontainer.cxx b/svl/source/passwordcontainer/passwordcontainer.cxx index 52bdbcb..dccff95 100644 --- a/svl/source/passwordcontainer/passwordcontainer.cxx +++ b/svl/source/passwordcontainer/passwordcontainer.cxx @@ -933,7 +933,7 @@ UrlRecord PasswordContainer::find( else { vector ::rtl::OUString aRM( DecodePasswords( aEncodedMP, aPass ) ); -if( !aRM.size() || !aPass.equals( aRM[0] ) ) +if( aRM.empty() || !aPass.equals( aRM[0] ) ) { bAskAgain = sal_True; aRMode = PasswordRequestMode_PASSWORD_REENTER; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: svl/source
svl/source/numbers/zforfind.cxx | 13 + svl/source/numbers/zforfind.hxx |6 +- 2 files changed, 14 insertions(+), 5 deletions(-) New commits: commit 803b5513eff8f8c185a91e91aee235dfab38d3bc Author: Eike Rathke er...@redhat.com Date: Thu May 10 16:19:44 2012 +0200 resolved fdo#46233 value 12 with AM/PM can't be clock time diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx index cce08f9..31f9c2c 100644 --- a/svl/source/numbers/zforfind.cxx +++ b/svl/source/numbers/zforfind.cxx @@ -860,11 +860,12 @@ inline bool ImpSvNumberInputScan::GetNextNumber( sal_uInt16 i, sal_uInt16 j ) //--- // GetTimeRef -void ImpSvNumberInputScan::GetTimeRef( +bool ImpSvNumberInputScan::GetTimeRef( double fOutNumber, sal_uInt16 nIndex, // j-value of the first numeric time part of input, default 0 sal_uInt16 nAnz ) // count of numeric time parts { +bool bRet = true; sal_uInt16 nHour; sal_uInt16 nMinute = 0; sal_uInt16 nSecond = 0; @@ -893,6 +894,7 @@ void ImpSvNumberInputScan::GetTimeRef( else { nHour = 0; +bRet = false; SAL_WARN( svl.items, ImpSvNumberInputScan::GetTimeRef: bad number index); } if (nDecPos == 2 nAnz == 2) // 45.5 @@ -903,7 +905,9 @@ void ImpSvNumberInputScan::GetTimeRef( nSecond = (sal_uInt16) sStrArray[nNums[nIndex++]].ToInt32(); if (nIndex - nStartIndex nAnz) fSecond100 = StringToDouble( sStrArray[nNums[nIndex]], true ); -if (nAmPm == -1 nHour != 12) // PM +if (nAmPm nHour 12)// not a valid AM/PM clock time +bRet = false; +else if (nAmPm == -1 nHour != 12)// PM nHour += 12; else if (nAmPm == 1 nHour == 12) // 12 AM nHour = 0; @@ -912,6 +916,7 @@ void ImpSvNumberInputScan::GetTimeRef( (double)nMinute*60 + (double)nSecond + fSecond100)/86400.0; +return bRet; } @@ -3171,7 +3176,7 @@ bool ImpSvNumberInputScan::IsNumberFormat( break; case NUMBERFORMAT_TIME: -GetTimeRef(fOutNumber, 0, nAnzNums); +res = GetTimeRef(fOutNumber, 0, nAnzNums); if ( nSign 0 ) fOutNumber = -fOutNumber; break; @@ -3190,7 +3195,7 @@ bool ImpSvNumberInputScan::IsNumberFormat( if ( res ) { double fTime; -GetTimeRef( fTime, nCounter, nAnzNums - nCounter ); +res = GetTimeRef( fTime, nCounter, nAnzNums - nCounter ); fOutNumber += fTime; } } diff --git a/svl/source/numbers/zforfind.hxx b/svl/source/numbers/zforfind.hxx index c57c90a..7c2e8eb 100644 --- a/svl/source/numbers/zforfind.hxx +++ b/svl/source/numbers/zforfind.hxx @@ -294,7 +294,11 @@ private: sal_uInt16 i, sal_uInt16 j ); -void GetTimeRef(// Converts time - double (only decimals) +/** Converts time - double (only decimals) + +@return TRUE if time, FALSE if not (e.g. hours 12 with AM/PM) + */ +bool GetTimeRef( double fOutNumber, // result as double sal_uInt16 nIndex, // Index of hour in input sal_uInt16 nAnz ); // Count of time substrings in input ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: svl/source
svl/source/svdde/ddesvr.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit d9051c4ce5c8302f7739a171b80cd5c9e6bf74b8 Author: Julien Nabet serval2...@yahoo.fr Date: Wed May 2 17:09:10 2012 +0200 != instead of for comparison with end iterator Change-Id: I16f3b768cdb3304d3f7a9b3a63a4262377c7c89b diff --git a/svl/source/svdde/ddesvr.cxx b/svl/source/svdde/ddesvr.cxx index 0d887a3..35a0ba7 100644 --- a/svl/source/svdde/ddesvr.cxx +++ b/svl/source/svdde/ddesvr.cxx @@ -204,7 +204,7 @@ found: { pC-pTopic-_Disconnect( (long) hConv ); for ( ConvList::iterator it = pService-pConv-begin(); - it pService-pConv-end(); + it != pService-pConv-end(); ++it ) { if ( *it == pC ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: svl/source
svl/source/numbers/zforlist.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit cf9c715aee2f97a1a6f611fe46a47e238cb03658 Author: Stephan Bergmann sberg...@redhat.com Date: Mon Apr 23 21:39:14 2012 +0200 Avoid bogus warnings (GCC 4.4.6) diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index 83a1232..93007ab 100644 --- a/svl/source/numbers/zforlist.cxx +++ b/svl/source/numbers/zforlist.cxx @@ -1303,7 +1303,7 @@ sal_uInt32 SvNumberFormatter::ImpGetDefaultFormat( short nType ) if ( nDefaultFormat == NUMBERFORMAT_ENTRY_NOT_FOUND ) { // look for a defined standard sal_uInt32 nStopKey = CLOffset + SV_COUNTRY_LANGUAGE_OFFSET; -sal_uInt32 nKey; +sal_uInt32 nKey = 0; // avoid bogus warning (GCC 4.4.6) SvNumberFormatTable::iterator it2 = aFTable.find( CLOffset ); while ( it2 != aFTable.end() (nKey = it2-first ) = CLOffset nKey nStopKey ) { @@ -3326,7 +3326,7 @@ sal_uInt32 SvNumberFormatter::ImpGetDefaultCurrencyFormat() { // look for a defined standard sal_uInt32 nStopKey = CLOffset + SV_COUNTRY_LANGUAGE_OFFSET; -sal_uInt32 nKey; +sal_uInt32 nKey = 0; // avoid bogus warning (GCC 4.4.6) SvNumberFormatTable::iterator it2 = aFTable.lower_bound( CLOffset ); while ( it2 != aFTable.end() (nKey = it2-first) = CLOffset nKey nStopKey ) { ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: svl/source
svl/source/numbers/zforfind.cxx | 47 +++- svl/source/numbers/zforfind.hxx | 42 --- svl/source/numbers/zforlist.cxx |2 - 3 files changed, 80 insertions(+), 11 deletions(-) New commits: commit 9e1862b21684f650ebc1d8d0e5bbdd877b886945 Author: Eike Rathke er...@redhat.com Date: Wed Apr 18 19:01:09 2012 +0200 resolved fdo#48875 do not let ISO 8601 detection override locale's date order If the locale's date separator was '-' the ISO 8601 detection interfered with the locale's date order, e.g. DMY in nl_NL locale. diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx index 3c5d835..cce08f9 100644 --- a/svl/source/numbers/zforfind.cxx +++ b/svl/source/numbers/zforfind.cxx @@ -148,6 +148,7 @@ void ImpSvNumberInputScan::Reset() nMayBeMonthDate = 0; nAcceptedDatePattern = -2; nDatePatternStart = 0; +nCanForceToIso8601 = 0; } @@ -999,6 +1000,50 @@ bool ImpSvNumberInputScan::MayBeIso8601() //--- +bool ImpSvNumberInputScan::CanForceToIso8601( DateFormat eDateFormat ) +{ +if (nCanForceToIso8601 == 0) +{ +nCanForceToIso8601 = 1; +do +{ +if (!MayBeIso8601()) +break; + +if (nMayBeIso8601 = 3) +{ +nCanForceToIso8601 = 2; // at least 3 digits in year +break; +} + +if (pFormatter-GetDateSep() != '-') +{ +nCanForceToIso8601 = 2; // date separator does not interfere +break; +} + +sal_Int32 n; +switch (eDateFormat) +{ +case DMY: // day value out of range = ISO 8601 year +if ((n = sStrArray[nNums[0]].ToInt32()) 1 || n 31) +nCanForceToIso8601 = 2; +break; +case MDY: // month value out of range = ISO 8601 year +if ((n = sStrArray[nNums[0]].ToInt32()) 1 || n 12) +nCanForceToIso8601 = 2; +break; +case YMD: // always possible +nCanForceToIso8601 = 2; +break; +} +} while (0); +} +return nCanForceToIso8601 1; +} + +//--- + bool ImpSvNumberInputScan::MayBeMonthDate() { if (nMayBeMonthDate == 0) @@ -1596,7 +1641,7 @@ input for the following reasons: } } // ISO 8601 -mm-dd forced recognition -DateFormat eDF = (MayBeIso8601() ? YMD : DateFmt); +DateFormat eDF = (CanForceToIso8601( DateFmt) ? YMD : DateFmt); switch (eDF) { case MDY: diff --git a/svl/source/numbers/zforfind.hxx b/svl/source/numbers/zforfind.hxx index e808c30..c57c90a 100644 --- a/svl/source/numbers/zforfind.hxx +++ b/svl/source/numbers/zforfind.hxx @@ -71,19 +71,17 @@ public: /// get threshold of two-digit year input sal_uInt16 GetYear2000() const { return nYear2000; } -/** Whether input may be an ISO 8601 date format, -mm-dd... +/** Whether input can be forced to ISO 8601 format. -Checks if input has at least 3 numbers for -mm-dd and the separator -is '-', and 1=mm=12 and 1=dd=31. +Depends on locale's date separator and a specific date format order. -@see nMayBeIso8601 - */ -bool MayBeIso8601(); +@param eDateFormat +Evaluated only on first call during one scan process, subsequent +calls return state of nCanForceToIso8601! -/** Whether input may be a dd-month-yy format, with month name, not -number. +@see nCanForceToIso8601 */ -bool MayBeMonthDate(); +bool CanForceToIso8601( DateFormat eDateFormat ); private: SvNumberFormatter* pFormatter; @@ -154,6 +152,16 @@ private: */ sal_uInt8nMayBeIso8601; +/** State of ISO 8601 can be forced. + +0:= don't know yet +1:= no +2:= yes + +@see CanForceToIso8601() + */ +sal_uInt8 nCanForceToIso8601; + /** State of dd-month-yy or yy-month-dd detection, with month name. 0:= don't know yet @@ -364,6 +372,22 @@ private: */ DateFormat GetDateOrder(); +/** Whether input may be an ISO 8601 date format, -mm-dd... + +Checks if input has at least 3 numbers for -mm-dd and the separator +is '-', and 1=mm=12 and 1=dd=31. + +@see nMayBeIso8601 + */ +bool MayBeIso8601(); + +/** Whether input may be a dd-month-yy format, with month name, not +
[Libreoffice-commits] .: svl/source
svl/source/numbers/zforfind.cxx |5 + 1 file changed, 5 insertions(+) New commits: commit a6ad8e8f0a52881311b16af611e1ad701946c608 Author: Eike Rathke er...@redhat.com Date: Sun Apr 15 02:38:46 2012 +0200 resolved fdo#48706 recognize $.12 as currency number diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx index 9a0c59a..3c5d835 100644 --- a/svl/source/numbers/zforfind.cxx +++ b/svl/source/numbers/zforfind.cxx @@ -1811,6 +1811,11 @@ bool ImpSvNumberInputScan::ScanStartString( const String rString, if ( nSign ) // DM -1 SkipBlanks(rString, nPos); } +if ( GetDecSep(rString, nPos) ) // decimal separator follows currency +{ +nDecPos = 1; +SkipBlanks(rString, nPos); +} } else { ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: svl/source
svl/source/numbers/zformat.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit c8ef98c5ad22ba585a28d81360e15fe2dcefc3ad Author: Julien Nabet serval2...@yahoo.fr Date: Sun Mar 18 18:30:07 2012 +0100 Add parenthesis for avoid false report by cppcheck diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index 0aed979..aa7a243 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -3840,7 +3840,7 @@ bool SvNumberformat::ImpGetNumberOutput(double fNumber, nPrecExp = 0; if (rInfo.nCntPost)// NachkommaStellen { -if (rInfo.nCntPost + nPrecExp 15 nPrecExp 15) +if ((rInfo.nCntPost + nPrecExp) 15 nPrecExp 15) { sStr = ::rtl::math::doubleToUString( fNumber, rtl_math_StringFormat_F, 15-nPrecExp, '.'); ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: svl/source
svl/source/svdde/ddecli.cxx |2 +- svl/source/svdde/ddesvr.cxx | 10 +- 2 files changed, 6 insertions(+), 6 deletions(-) New commits: commit acddd09bc2e635a63c3d924eec6026c5254cd576 Author: Caolán McNamara caol...@redhat.com Date: Mon Feb 13 15:53:52 2012 + WaE: NULL vs 0 with mingw diff --git a/svl/source/svdde/ddecli.cxx b/svl/source/svdde/ddecli.cxx index fba0c25..fd7b09c 100644 --- a/svl/source/svdde/ddecli.cxx +++ b/svl/source/svdde/ddecli.cxx @@ -211,7 +211,7 @@ DdeConnection::~DdeConnection() { if( DdeUninitialize( pInst-hDdeInstCli ) ) { -pInst-hDdeInstCli = NULL; +pInst-hDdeInstCli = 0; if( pInst-nRefCount == 0 ) ImpDeinitInstData(); } diff --git a/svl/source/svdde/ddesvr.cxx b/svl/source/svdde/ddesvr.cxx index 916823c..d47a6c0 100644 --- a/svl/source/svdde/ddesvr.cxx +++ b/svl/source/svdde/ddesvr.cxx @@ -290,7 +290,7 @@ found: else bRes = pTopic-Put( d ); } -pInst-hCurConvSvr = NULL; +pInst-hCurConvSvr = 0; if ( bRes ) return (HDDEDATA)DDE_FACK; else @@ -332,7 +332,7 @@ found: if (pItem) { pItem-IncMonitor( (long)hConv ); -pInst-hCurConvSvr = NULL; +pInst-hCurConvSvr = 0; } } return (HDDEDATA)sal_True; @@ -341,7 +341,7 @@ found: pItem-DecMonitor( (long)hConv ); if( !pItem-pImpData ) pTopic-StopAdviseLoop(); -pInst-hCurConvSvr = NULL; +pInst-hCurConvSvr = 0; return (HDDEDATA)sal_True; case XTYP_EXECUTE: @@ -359,7 +359,7 @@ found: else bRes = pTopic-Execute( aName ); } -pInst-hCurConvSvr = NULL; +pInst-hCurConvSvr = 0; if ( bRes ) return (HDDEDATA)DDE_FACK; else @@ -513,7 +513,7 @@ DdeService::~DdeService() { if( DdeUninitialize( pInst-hDdeInstSvr ) ) { -pInst-hDdeInstSvr = NULL; +pInst-hDdeInstSvr = 0; delete pInst-pServicesSvr; pInst-pServicesSvr = NULL; if( pInst-nRefCount == 0) ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: svl/source
svl/source/numbers/zforfind.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 0f1fc0dfea41b7c74565683ba13e0dfc9177c7e5 Author: Eike Rathke er...@redhat.com Date: Tue Jan 17 17:57:37 2012 +0100 a can't-happen-but-do-it-correct-anyway one character fix diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx index d944a11..0835278 100644 --- a/svl/source/numbers/zforfind.cxx +++ b/svl/source/numbers/zforfind.cxx @@ -991,7 +991,7 @@ bool ImpSvNumberInputScan::MayBeIso8601() (n = sStrArray[nNums[2]].ToInt32()) = 1 n = 31)// day // Year (nNums[0]) value not checked, may be anything, but // length (number of digits) is checked. -nMayBeIso8601 = (nLen = 4 ? 4 : (nLen == 3 ? 3 : (nLen 0 ? 2 : 0))); +nMayBeIso8601 = (nLen = 4 ? 4 : (nLen == 3 ? 3 : (nLen 0 ? 2 : 1))); } } return nMayBeIso8601 1; ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: svl/source
svl/source/memtools/svarray.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 6fd08caf5f15fba48ea4600ab57acd34f9600017 Author: Christina Rossmanith chrrossman...@web.de Date: Tue Nov 8 20:29:24 2011 +0100 Translated German comments diff --git a/svl/source/memtools/svarray.cxx b/svl/source/memtools/svarray.cxx index ee37bdf..e49af56 100644 --- a/svl/source/memtools/svarray.cxx +++ b/svl/source/memtools/svarray.cxx @@ -60,7 +60,7 @@ SV_IMPL_PTRARR( SvStringsDtor, StringPtr ) // strings - -// Array mit anderer Seek-Methode! +// Array with different Seek method _SV_IMPL_SORTAR_ALG( SvStringsISort, StringPtr ) void SvStringsISort::DeleteAndDestroy( sal_uInt16 nP, sal_uInt16 nL ) { @@ -107,7 +107,7 @@ sal_Bool SvStringsISort::Seek_Entry( const StringPtr aE, sal_uInt16* pP ) const // strings - -// Array mit anderer Seek-Methode! +// Array with different Seek method _SV_IMPL_SORTAR_ALG( SvStringsISortDtor, StringPtr ) void SvStringsISortDtor::DeleteAndDestroy( sal_uInt16 nP, sal_uInt16 nL ) { ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: svl/source
svl/source/misc/inettype.cxx | 38 ++ 1 file changed, 22 insertions(+), 16 deletions(-) New commits: commit 9fd35cc973e12a07d82e5ca14ec1f4307dbbada9 Author: Marcel Metz mm...@adrian-broher.net Date: Mon Dec 12 16:50:32 2011 + Related: fdo#38832 Replace Table with std::map diff --git a/svl/source/misc/inettype.cxx b/svl/source/misc/inettype.cxx index 1cba9dc..b043f06 100644 --- a/svl/source/misc/inettype.cxx +++ b/svl/source/misc/inettype.cxx @@ -85,8 +85,9 @@ class Registration { typedef boost::ptr_mapUniString, TypeNameMapEntry TypeNameMap; typedef boost::ptr_mapUniString, ExtensionMapEntry ExtensionMap; +typedef std::mapINetContentType, TypeIDMapEntry* TypeIDMap; -Table m_aTypeIDMap; // map TypeID to TypeName, Presentation +TypeIDMapm_aTypeIDMap;// map ContentType to TypeID TypeNameMap m_aTypeNameMap; // map TypeName to TypeID, Extension ExtensionMap m_aExtensionMap; // map Extension to TypeID sal_uInt32 m_nNextDynamicID; @@ -127,8 +128,13 @@ namespace // static inline TypeIDMapEntry * Registration::getEntry(INetContentType eTypeID) { -return static_cast TypeIDMapEntry * (theRegistration::get(). -m_aTypeIDMap.Get(eTypeID)); +Registration rRegistration = theRegistration::get(); + +TypeIDMap::iterator it = rRegistration.m_aTypeIDMap.find( eTypeID ); +if( it != rRegistration.m_aTypeIDMap.end() ) +return it-second; +else +return NULL; } // @@ -526,10 +532,8 @@ MediaTypeEntry const aStaticPresentationMap[] // Registration::~Registration() { -{for (sal_uLong i = 0; i m_aTypeIDMap.Count(); ++i) -delete static_cast TypeIDMapEntry * (m_aTypeIDMap.GetObject(i)); -} -m_aTypeIDMap.Clear(); +for ( TypeIDMap::iterator it = m_aTypeIDMap.begin(); it != m_aTypeIDMap.end(); ++it ) +delete it-second; } // @@ -571,7 +575,7 @@ INetContentType Registration::RegisterContentType(UniString const rTypeName, pTypeIDMapEntry-m_aPresentation = rPresentation; if (pSystemFileType) pTypeIDMapEntry-m_aSystemFileType = *pSystemFileType; -rRegistration.m_aTypeIDMap.Insert(eTypeID, pTypeIDMapEntry); +rRegistration.m_aTypeIDMap.insert( ::std::make_pair( eTypeID, pTypeIDMapEntry ) ); std::auto_ptrTypeNameMapEntry pTypeNameMapEntry(new TypeNameMapEntry()); if (pExtension) @@ -609,10 +613,11 @@ UniString Registration::GetContentType(INetContentType eTypeID) { Registration rRegistration = theRegistration::get(); -TypeIDMapEntry * pEntry -= static_cast TypeIDMapEntry * (rRegistration. - m_aTypeIDMap.Get(eTypeID)); -return pEntry ? pEntry-m_aTypeName : UniString(); +TypeIDMap::iterator pEntry = rRegistration.m_aTypeIDMap.find( eTypeID ); +if( pEntry != rRegistration.m_aTypeIDMap.end() ) +return pEntry-second-m_aTypeName; +else +return UniString(); } // @@ -621,10 +626,11 @@ UniString Registration::GetPresentation(INetContentType eTypeID) { Registration rRegistration = theRegistration::get(); -TypeIDMapEntry * pEntry -= static_cast TypeIDMapEntry * (rRegistration. - m_aTypeIDMap.Get(eTypeID)); -return pEntry ? pEntry-m_aPresentation : UniString(); +TypeIDMap::iterator pEntry = rRegistration.m_aTypeIDMap.find( eTypeID ); +if( pEntry != rRegistration.m_aTypeIDMap.end() ) +return pEntry-second-m_aPresentation; +else +return UniString(); } // ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: svl/source vcl/source
svl/source/items/dateitem.cxx |2 +- vcl/source/control/field2.cxx |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) New commits: commit c593018f6f2deec8eb98880ac89f19b59a3aee1f Author: Eike Rathke er...@redhat.com Date: Wed Nov 30 13:15:34 2011 +0100 no need to check for Gregorian cut-off date here diff --git a/svl/source/items/dateitem.cxx b/svl/source/items/dateitem.cxx index accd1cf..67ed229 100644 --- a/svl/source/items/dateitem.cxx +++ b/svl/source/items/dateitem.cxx @@ -148,7 +148,7 @@ SfxItemPresentation SfxDateTimeItem::GetPresentation ) const { DBG_CHKTHIS(SfxDateTimeItem, 0); -if (aDateTime.IsValidAndGregorian()) +if (aDateTime.IsValidDate()) if (pIntlWrapper) { rText = pIntlWrapper-getLocaleData()-getDate(aDateTime); diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx index 5fadf7e..8705c6e 100644 --- a/vcl/source/control/field2.cxx +++ b/vcl/source/control/field2.cxx @@ -1309,7 +1309,7 @@ static sal_Bool ImplDateGetValue( const XubString rStr, Date rDate, ExtDateFie Date aNewDate( nDay, nMonth, nYear ); DateFormatter::ExpandCentury( aNewDate, utl::MiscCfg().GetYear2000() ); -if ( aNewDate.IsValidAndGregorian() ) +if ( aNewDate.IsValidDate() ) { rDate = aNewDate; return sal_True; ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: svl/source
svl/source/misc/inettype.cxx |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) New commits: commit 2ea9da71470a9e2a442ec6a660de47691a3f8723 Author: Caolán McNamara caol...@redhat.com Date: Mon Nov 7 12:41:47 2011 + don't need typename outside a template diff --git a/svl/source/misc/inettype.cxx b/svl/source/misc/inettype.cxx index c5a7603..1f55f21 100644 --- a/svl/source/misc/inettype.cxx +++ b/svl/source/misc/inettype.cxx @@ -542,7 +542,7 @@ TypeNameMapEntry * Registration::getExtensionEntry(UniString const UniString aTheTypeName = rTypeName; aTheTypeName.ToLowerAscii(); Registration rRegistration = theRegistration::get(); -typename TypeNameMap::iterator it = rRegistration.m_aTypeNameMap.find(aTheTypeName); +TypeNameMap::iterator it = rRegistration.m_aTypeNameMap.find(aTheTypeName); if (it != rRegistration.m_aTypeNameMap.end()) return it-second; return 0; @@ -599,7 +599,7 @@ INetContentType Registration::GetContentType(UniString const rTypeName) UniString aTheTypeName = rTypeName; aTheTypeName.ToLowerAscii(); -typename TypeNameMap::iterator it = rRegistration.m_aTypeNameMap.find(aTheTypeName); +TypeNameMap::iterator it = rRegistration.m_aTypeNameMap.find(aTheTypeName); return it != rRegistration.m_aTypeNameMap.end() ? it-second-m_eTypeID : CONTENT_TYPE_UNKNOWN; @@ -636,7 +636,7 @@ INetContentType Registration::GetContentType4Extension(UniString const { Registration rRegistration = theRegistration::get(); -typename ExtensionMap::iterator it = rRegistration.m_aExtensionMap.find(rExtension); +ExtensionMap::iterator it = rRegistration.m_aExtensionMap.find(rExtension); return it != rRegistration.m_aExtensionMap.end() ? it-second-m_eTypeID : CONTENT_TYPE_UNKNOWN; ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: svl/source
svl/source/undo/undo.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 58462caa5164af85d801e73c36672d61cddb53fd Author: Tor Lillqvist t...@iki.fi Date: Fri Sep 30 10:41:14 2011 +0300 Fix error reported by gcc 4.4.3: NULL used in arithmetic diff --git a/svl/source/undo/undo.cxx b/svl/source/undo/undo.cxx index a84bbcf..3e4d4db 100644 --- a/svl/source/undo/undo.cxx +++ b/svl/source/undo/undo.cxx @@ -267,13 +267,13 @@ namespace svl { namespace undo { namespace impl bool is() const { -return ( m_notificationMethod != NULL ) || ( m_altNotificationMethod != NULL ); +return ( m_notificationMethod != 0 ) || ( m_altNotificationMethod != 0 ); } void operator()( SfxUndoListener* i_listener ) const { OSL_PRECOND( is(), NotifyUndoListener: this will crash! ); -if ( m_altNotificationMethod != NULL ) +if ( m_altNotificationMethod != 0 ) { ( i_listener-*m_altNotificationMethod )( m_sActionComment ); } ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits