summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-10-05 09:08:24 +0200
committerMichael Stahl <mstahl@redhat.com>2012-10-09 21:25:10 +0000
commit68abd6d9258975e9ef1155f726fe4c12bb0918e2 (patch)
tree4cf8bfaf391a8e1b32e021a7ad8a80d6f6c95d9a /svl
parentc90e0064357f78ffc9ee8261c6c100c15d904beb (diff)
String->OUString in SVL::SvNumberFormat calendar methods
Change-Id: I6fe904d25a0675d881ee7c1d761e9af87e23a69d Reviewed-on: https://gerrit.libreoffice.org/772 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'svl')
-rw-r--r--svl/inc/svl/zformat.hxx8
-rw-r--r--svl/source/numbers/zformat.cxx28
2 files changed, 18 insertions, 18 deletions
diff --git a/svl/inc/svl/zformat.hxx b/svl/inc/svl/zformat.hxx
index 1dbb9731552c..015cf9711c8f 100644
--- a/svl/inc/svl/zformat.hxx
+++ b/svl/inc/svl/zformat.hxx
@@ -421,13 +421,13 @@ public:
/** Switches to the first non-"gregorian" calendar, but only if the current
calendar is "gregorian"; original calendar name and date/time returned,
but only if calendar switched and rOrgCalendar was empty. */
- void SwitchToOtherCalendar( String& rOrgCalendar, double& fOrgDateTime ) const;
+ void SwitchToOtherCalendar( OUString& rOrgCalendar, double& fOrgDateTime ) const;
/** Switches to the "gregorian" calendar, but only if the current calendar
is non-"gregorian" and rOrgCalendar is not empty. Thus a preceding
ImpSwitchToOtherCalendar() call should have been placed prior to
calling this method. */
- void SwitchToGregorianCalendar( const String& rOrgCalendar, double fOrgDateTime ) const;
+ void SwitchToGregorianCalendar( const OUString& rOrgCalendar, double fOrgDateTime ) const;
#ifdef THE_FUTURE
/** Switches to the first specified calendar, if any, in subformat nNumFor
@@ -438,7 +438,7 @@ public:
<TRUE/> if a calendar was specified and switched to,
<FALSE/> else.
*/
- bool SwitchToSpecifiedCalendar( String& rOrgCalendar, double& fOrgDateTime,
+ bool SwitchToSpecifiedCalendar( OUString& rOrgCalendar, double& fOrgDateTime,
sal_uInt16 nNumFor ) const
{
if ( nNumFor < 4 )
@@ -620,7 +620,7 @@ private:
// know a "before" era (like zh_TW ROC or ja_JP Gengou). If switched and
// rOrgCalendar was "gregorian" the string is emptied. If rOrgCalendar was
// empty the previous calendar name and date/time are returned.
- SVL_DLLPRIVATE bool ImpFallBackToGregorianCalendar( String& rOrgCalendar, double& fOrgDateTime );
+ SVL_DLLPRIVATE bool ImpFallBackToGregorianCalendar( OUString& rOrgCalendar, double& fOrgDateTime );
// Append a "G" short era string of the given calendar. In the case of a
// Gengou calendar this is a one character abbreviation, for other
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index b5c583cfb081..4049881c1a46 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -3055,7 +3055,7 @@ bool SvNumberformat::ImpIsOtherCalendar( const ImpSvNumFor& rNumFor ) const
return false;
}
-void SvNumberformat::SwitchToOtherCalendar( String& rOrgCalendar,
+void SvNumberformat::SwitchToOtherCalendar( OUString& rOrgCalendar,
double& fOrgDateTime ) const
{
CalendarWrapper& rCal = GetCal();
@@ -3072,7 +3072,7 @@ void SvNumberformat::SwitchToOtherCalendar( String& rOrgCalendar,
{
if ( xCals[j] != rGregorian )
{
- if ( !rOrgCalendar.Len() )
+ if ( !rOrgCalendar.getLength() )
{
rOrgCalendar = rCal.getUniqueID();
fOrgDateTime = rCal.getDateTime();
@@ -3086,19 +3086,19 @@ void SvNumberformat::SwitchToOtherCalendar( String& rOrgCalendar,
}
}
-void SvNumberformat::SwitchToGregorianCalendar( const String& rOrgCalendar,
+void SvNumberformat::SwitchToGregorianCalendar( const OUString& rOrgCalendar,
double fOrgDateTime ) const
{
CalendarWrapper& rCal = GetCal();
const rtl::OUString &rGregorian = Gregorian::get();
- if ( rOrgCalendar.Len() && rCal.getUniqueID() != rGregorian )
+ if ( rOrgCalendar.getLength() && rCal.getUniqueID() != rGregorian )
{
rCal.loadCalendar( rGregorian, rLoc().getLocale() );
rCal.setDateTime( fOrgDateTime );
}
}
-bool SvNumberformat::ImpFallBackToGregorianCalendar( String& rOrgCalendar, double& fOrgDateTime )
+bool SvNumberformat::ImpFallBackToGregorianCalendar( OUString& rOrgCalendar, double& fOrgDateTime )
{
using namespace ::com::sun::star::i18n;
CalendarWrapper& rCal = GetCal();
@@ -3108,13 +3108,13 @@ bool SvNumberformat::ImpFallBackToGregorianCalendar( String& rOrgCalendar, doubl
sal_Int16 nVal = rCal.getValue( CalendarFieldIndex::ERA );
if ( nVal == 0 && rCal.getLoadedCalendar().Eras[0].ID == "Dummy" )
{
- if ( !rOrgCalendar.Len() )
+ if ( !rOrgCalendar.getLength() )
{
rOrgCalendar = rCal.getUniqueID();
fOrgDateTime = rCal.getDateTime();
}
- else if ( rOrgCalendar == String(rGregorian) )
- rOrgCalendar.Erase();
+ else if ( rOrgCalendar == rGregorian )
+ rOrgCalendar = "";
rCal.loadCalendar( rGregorian, rLoc().getLocale() );
rCal.setDateTime( fOrgDateTime );
return true;
@@ -3257,7 +3257,7 @@ bool SvNumberformat::ImpGetDateOutput(double fNumber,
fNumber += fDiff;
rCal.setLocalDateTime( fNumber );
int nUseMonthCase = 0; // not decided yet
- String aOrgCalendar; // empty => not changed yet
+ OUString aOrgCalendar; // empty => not changed yet
double fOrgDateTime;
bool bOtherCalendar = ImpIsOtherCalendar( NumFor[nIx] );
if ( bOtherCalendar )
@@ -3272,7 +3272,7 @@ bool SvNumberformat::ImpGetDateOutput(double fNumber,
switch (rInfo.nTypeArray[i])
{
case NF_SYMBOLTYPE_CALENDAR :
- if ( !aOrgCalendar.Len() )
+ if ( !aOrgCalendar.getLength() )
{
aOrgCalendar = rCal.getUniqueID();
fOrgDateTime = rCal.getDateTime();
@@ -3436,7 +3436,7 @@ bool SvNumberformat::ImpGetDateOutput(double fNumber,
break;
}
}
- if ( aOrgCalendar.Len() )
+ if ( aOrgCalendar.getLength() )
rCal.loadCalendar( aOrgCalendar, rLoc().getLocale() ); // restore calendar
return bRes;
}
@@ -3477,7 +3477,7 @@ bool SvNumberformat::ImpGetDateTimeOutput(double fNumber,
rCal.setLocalDateTime( fNumber );
int nUseMonthCase = 0; // not decided yet
- String aOrgCalendar; // empty => not changed yet
+ OUString aOrgCalendar; // empty => not changed yet
double fOrgDateTime;
bool bOtherCalendar = ImpIsOtherCalendar( NumFor[nIx] );
if ( bOtherCalendar )
@@ -3559,7 +3559,7 @@ bool SvNumberformat::ImpGetDateTimeOutput(double fNumber,
switch (rInfo.nTypeArray[i])
{
case NF_SYMBOLTYPE_CALENDAR :
- if ( !aOrgCalendar.Len() )
+ if ( !aOrgCalendar.getLength() )
{
aOrgCalendar = rCal.getUniqueID();
fOrgDateTime = rCal.getDateTime();
@@ -3772,7 +3772,7 @@ bool SvNumberformat::ImpGetDateTimeOutput(double fNumber,
break;
}
}
- if ( aOrgCalendar.Len() )
+ if ( aOrgCalendar.getLength() )
rCal.loadCalendar( aOrgCalendar, rLoc().getLocale() ); // restore calendar
return bRes;
}