Browse Source

Rename KLocale to enhance compatibility with KDE4

tags/r14.0.0
Timothy Pearson 7 years ago
parent
commit
0dda6e85e1
45 changed files with 86 additions and 86 deletions
  1. +2
    -2
      filters/kspread/libkspreadexport/KSpreadLeader.cc
  2. +2
    -2
      filters/kspread/opencalc/opencalcexport.cc
  3. +2
    -2
      filters/kspread/opencalc/opencalcexport.h
  4. +4
    -4
      filters/kword/oowriter/oowriterimport.cc
  5. +5
    -5
      filters/kword/rtf/export/ExportFilter.cc
  6. +1
    -1
      karbon/karbon_part.cc
  7. +1
    -1
      kexi/3rdparty/kolibs/koGlobal.cc
  8. +1
    -1
      kexi/3rdparty/kolibs/koUnitWidgets.cc
  9. +1
    -1
      kexi/kexidb/utils.h
  10. +1
    -1
      kexi/main/printing/kexisimpleprintingpagesetup.cpp
  11. +2
    -2
      kexi/widget/utils/kexidatetimeformatter.cpp
  12. +1
    -1
      kexi/widget/utils/kexidatetimeformatter.h
  13. +1
    -1
      kivio/kiviopart/kivioglobal.cpp
  14. +1
    -1
      kplato/kptaccountsview.cc
  15. +3
    -3
      kplato/kptganttview.cc
  16. +1
    -1
      kplato/kptreportview.cc
  17. +1
    -1
      kplato/kptresourceappointmentsview.cc
  18. +1
    -1
      kplato/kpttaskappointmentsview.cc
  19. +1
    -1
      kspread/dialogs/kspread_dlg_layout.h
  20. +3
    -3
      kspread/dialogs/kspread_dlg_preference.cc
  21. +1
    -1
      kspread/dialogs/kspread_dlg_preference.h
  22. +3
    -3
      kspread/formula.cc
  23. +2
    -2
      kspread/formula.h
  24. +3
    -3
      kspread/kspread_cell.cc
  25. +2
    -2
      kspread/kspread_cell.h
  26. +2
    -2
      kspread/kspread_doc.cc
  27. +1
    -1
      kspread/kspread_doc.h
  28. +1
    -1
      kspread/kspread_format.h
  29. +3
    -3
      kspread/kspread_functions_text.cc
  30. +2
    -2
      kspread/kspread_locale.cc
  31. +1
    -1
      kspread/kspread_locale.h
  32. +3
    -3
      kspread/kspread_numformat.cc
  33. +2
    -2
      kspread/kspread_util.cc
  34. +3
    -3
      kspread/kspread_util.h
  35. +1
    -1
      kspread/tests/formula_tester.cc
  36. +1
    -1
      kspread/valueconverter.cc
  37. +2
    -2
      kspread/valueconverter.h
  38. +5
    -5
      kspread/valueparser.cc
  39. +4
    -4
      kspread/valueparser.h
  40. +1
    -1
      kugar/kudesigner/main.cpp
  41. +2
    -2
      kword/KWStatisticsDialog.cpp
  42. +1
    -1
      lib/kofficecore/KoDocument.cpp
  43. +1
    -1
      lib/kofficecore/KoGlobal.cpp
  44. +1
    -1
      lib/kofficeui/KoUnitWidgets.cpp
  45. +3
    -3
      lib/kotext/KoAutoFormat.cpp

+ 2
- 2
filters/kspread/libkspreadexport/KSpreadLeader.cc View File

@@ -186,8 +186,8 @@ KoFilter::ConversionStatus Leader::doSpreadBook(KSpreadDoc *document) {
docSpreadBookProperty["dateformat"] = document->locale()->dateFormat();
docSpreadBookProperty["dateformatshort"] = document->locale()->dateFormatShort();
docSpreadBookProperty["timeformat"] = document->locale()->timeFormat();
docSpreadBookProperty["defaultlanguage"] = KLocale::defaultLanguage();
docSpreadBookProperty["defaultcountry"] = KLocale::defaultCountry();
docSpreadBookProperty["defaultlanguage"] = TDELocale::defaultLanguage();
docSpreadBookProperty["defaultcountry"] = TDELocale::defaultCountry();
docSpreadBookProperty["defaultgridpencolorname"] = document->defaultGridPen().color().name();
docSpreadBookProperty["defaultgridpencolorred"] = TQString::number(document->defaultGridPen().color().red());
docSpreadBookProperty["defaultgridpencolorgreen"] = TQString::number(document->defaultGridPen().color().green());


+ 2
- 2
filters/kspread/opencalc/opencalcexport.cc View File

@@ -832,13 +832,13 @@ void OpenCalcExport::exportDefaultCellStyle( TQDomDocument & doc, TQDomElement &
Doc * ksdoc = static_cast<Doc *>(document);

Format * format = new Format( 0, ksdoc->styleManager()->defaultStyle() );
const KLocale *locale = ksdoc->locale();
const TDELocale *locale = ksdoc->locale();
TQString language;
TQString country;
TQString charSet;

TQString l( locale->language() );
KLocale::splitLocale( l, language, country, charSet );
TDELocale::splitLocale( l, language, country, charSet );
TQFont font( format->font() );
m_styles.addFont( font, true );



+ 2
- 2
filters/kspread/opencalc/opencalcexport.h View File

@@ -28,7 +28,7 @@

class TQDomDocument;
class TQDomElement;
class KLocale;
class TDELocale;
class KoStore;

namespace KSpread
@@ -84,7 +84,7 @@ class OpenCalcExport : public KoFilter
TQString convertFormula( TQString const & formula ) const;
private:
/// Pointer to the KSpread locale
KLocale* m_locale;
TDELocale* m_locale;
};

#endif

+ 4
- 4
filters/kword/oowriter/oowriterimport.cc View File

@@ -749,7 +749,7 @@ void OoWriterImport::importDateTimeStyle( const TQDomElement& parent )
#if 0
// TQDate doesn't work both ways!!! It can't parse something back from
// a string and a format (e.g. 01/02/03 and dd/MM/yy, it will assume MM/dd/yy).
// So we also need to generate a KLocale-like format, to parse the value
// So we also need to generate a TDELocale-like format, to parse the value
// Update: we don't need to parse the date back.

TQString kdeFormat;
@@ -776,13 +776,13 @@ void OoWriterImport::importDateTimeStyle( const TQDomElement& parent )
} else if ( localName == "year" ) {
kdeFormat += shortForm ? "%y" : "%Y";
} else if ( localName == "week-of-year" || localName == "quarter") {
// ### not supported in KLocale
// ### not supported in TDELocale
} else if ( localName == "hours" ) {
kdeFormat += shortForm ? "%k" : "%H"; // TODO should depend on presence of am/pm
} else if ( localName == "minutes" ) {
kdeFormat += shortForm ? "%M" : "%M"; // KLocale doesn't have 1-digit minutes
kdeFormat += shortForm ? "%M" : "%M"; // TDELocale doesn't have 1-digit minutes
} else if ( localName == "seconds" ) {
kdeFormat += shortForm ? "%S" : "%S"; // KLocale doesn't have 1-digit seconds
kdeFormat += shortForm ? "%S" : "%S"; // TDELocale doesn't have 1-digit seconds
} else if ( localName == "am-pm" ) {
kdeFormat += "%p";
} else if ( localName == "text" ) { // litteral


+ 5
- 5
filters/kword/rtf/export/ExportFilter.cc View File

@@ -604,9 +604,9 @@ TQString RTFWorker::ProcessParagraphData ( const TQString &paraText,
key += TDEGlobal::locale()->timeFormat();
}

kdDebug(30515) << "Locale date in KLocale format: " << key << endl;
kdDebug(30515) << "Locale date in TDELocale format: " << key << endl;

// KLocale's key differ from KWord
// TDELocale's key differ from KWord

// Date
key.replace( "%Y", "yyyy" ); // Year 4 digits
@@ -620,15 +620,15 @@ TQString RTFWorker::ProcessParagraphData ( const TQString &paraText,
key.replace( "%a", "ddd" ); // Day 3 letters
key.replace( "%A", "dddd" ); // Day all letters
// 12h
key.replace( "%p", "am/pm" ); // AM/PM (KLocale knows it only lower case)
key.replace( "%p", "am/pm" ); // AM/PM (TDELocale knows it only lower case)
key.replace( "%I", "hh" ); // 12 hour 2 digits
key.replace( "%l", "h" ); // 12 hour 1 digits
// 24h
key.replace( "%H", "HH" ); // 24 hour 2 digits
key.replace( "%k", "H" ); // 24 hour 1 digit
// Other times
key.replace( "%M", "mm" ); // minute 2 digits (KLocale knows it with 2 digits)
key.replace( "%S", "ss" ); // second 2 digits (KLocale knows it with 2 digits)
key.replace( "%M", "mm" ); // minute 2 digits (TDELocale knows it with 2 digits)
key.replace( "%S", "ss" ); // second 2 digits (TDELocale knows it with 2 digits)

kdDebug(30515) << "Locale date in RTF format: " << key << endl;
}


+ 1
- 1
karbon/karbon_part.cc View File

@@ -635,7 +635,7 @@ KarbonPart::initConfig()
undos = config->readNumEntry( "UndoRedo", -1 );
TQString defaultUnit = "cm";

if( TDEGlobal::locale()->measureSystem() == KLocale::Imperial )
if( TDEGlobal::locale()->measureSystem() == TDELocale::Imperial )
defaultUnit = "in";

setUnit( KoUnit::unit( config->readEntry( "Units", defaultUnit ) ) );


+ 1
- 1
kexi/3rdparty/kolibs/koGlobal.cc View File

@@ -109,7 +109,7 @@ TQStringList KoGlobal::_listOfLanguages()
void KoGlobal::createListOfLanguages()
{
TDEConfig config( "all_languages", true, false, "locale" );
// Note that we could also use KLocale::allLanguagesTwoAlpha
// Note that we could also use TDELocale::allLanguagesTwoAlpha

TQMap<TQString, bool> seenLanguages;
const TQStringList langlist = config.groupList();


+ 1
- 1
kexi/3rdparty/kolibs/koUnitWidgets.cc View File

@@ -97,7 +97,7 @@ TQString KoUnitDoubleBase::getVisibleText( double value ) const
double KoUnitDoubleBase::toDouble( const TQString& str, bool* ok ) const
{
TQString str2( str );
/* KLocale::readNumber wants the thousand separator exactly at 1000.
/* TDELocale::readNumber wants the thousand separator exactly at 1000.
But when editing, it might be anywhere. So we need to remove it. */
const TQString sep( TDEGlobal::locale()->thousandsSeparator() );
if ( !sep.isEmpty() )


+ 1
- 1
kexi/kexidb/utils.h View File

@@ -304,7 +304,7 @@ namespace KexiDB
For example, "12.345" becomes "12.345000" if N=6.

No rounding is actually performed.
KLocale::formatNumber() and KLocale::decimalSymbol() are used to get locale settings.
TDELocale::formatNumber() and TDELocale::decimalSymbol() are used to get locale settings.

@see KexiDB::Field::visibleDecimalPlaces() */
KEXI_DB_EXPORT TQString formatNumberForVisibleDecimalPlaces(double value, int decimalPlaces);


+ 1
- 1
kexi/main/printing/kexisimpleprintingpagesetup.cpp View File

@@ -324,7 +324,7 @@ KexiSimplePrintingPageSetup::KexiSimplePrintingPageSetup( KexiMainWindow *mainWi

// settings
//! @todo default?
m_unit = KLocale::Metric == TDEGlobal::locale()->measureSystem() ? KoUnit::U_CM : KoUnit::U_INCH;
m_unit = TDELocale::Metric == TDEGlobal::locale()->measureSystem() ? KoUnit::U_CM : KoUnit::U_INCH;

// GUI
TQVBoxLayout *lyr = new TQVBoxLayout(this);


+ 2
- 2
kexi/widget/utils/kexidatetimeformatter.cpp View File

@@ -45,8 +45,8 @@ KexiDateFormatter::KexiDateFormatter()
bool ok = df.length()>=8;
int yearpos, monthpos, daypos; //result of df.find()
if (ok) {//look at % variables
//! @todo more variables are possible here, see void KLocale::setDateFormatShort() docs
//! http://developer.kde.org/documentation/library/3.5-api/tdelibs-apidocs/tdecore/html/classKLocale.html#a59
//! @todo more variables are possible here, see void TDELocale::setDateFormatShort() docs
//! http://developer.kde.org/documentation/library/3.5-api/tdelibs-apidocs/tdecore/html/classTDELocale.html#a59
yearpos = df.find("%y", 0, false); //&y or %y
m_longYear = !(yearpos>=0 && df.mid(yearpos+1, 1)=="y");
if (!m_longYear) {


+ 1
- 1
kexi/widget/utils/kexidatetimeformatter.h View File

@@ -131,7 +131,7 @@ class KEXIGUIUTILS_EXPORT KexiTimeFormatter

bool m_hoursWithLeadingZero;

//! Time format used in timeToString(). Notation from KLocale::setTimeFormat() is used.
//! Time format used in timeToString(). Notation from TDELocale::setTimeFormat() is used.
TQString m_outputFormat;

//! Used in stringToTime() to convert string back to TQTime


+ 1
- 1
kivio/kiviopart/kivioglobal.cpp View File

@@ -1285,7 +1285,7 @@ TQString Kivio::systemDefaultUnit()
{
TQString defMS = "cm";

if(TDEGlobal::locale()->measureSystem() == KLocale::Imperial) {
if(TDEGlobal::locale()->measureSystem() == TDELocale::Imperial) {
defMS = "in";
}



+ 1
- 1
kplato/kptaccountsview.cc View File

@@ -209,7 +209,7 @@ void AccountsView::slotUpdate() {
//kdDebug()<<k_funcinfo<<endl;
TQApplication::setOverrideCursor(TQt::waitCursor);
createPeriods();
KLocale *locale = TDEGlobal::locale();
TDELocale *locale = TDEGlobal::locale();
const KCalendarSystem *cal = locale->calendar();
TQString t;


+ 3
- 3
kplato/kptganttview.cc View File

@@ -482,7 +482,7 @@ void GanttView::modifyProject(KDGanttViewItem *item, Node *node)
void GanttView::modifySummaryTask(KDGanttViewItem *item, Task *task)
{
//kdDebug()<<k_funcinfo<<endl;
KLocale *locale = TDEGlobal::locale();
TDELocale *locale = TDEGlobal::locale();
//kdDebug()<<k_funcinfo<<task->name()<<": "<<task->currentSchedule()<<", "<<task->notScheduled()<<", "<<(m_project ? m_project->notScheduled() : false)<<endl;
if (task->currentSchedule() == 0) {
item->setShowNoInformation(m_showNoInformation);
@@ -530,7 +530,7 @@ void GanttView::modifySummaryTask(KDGanttViewItem *item, Task *task)
void GanttView::modifyTask(KDGanttViewItem *item, Task *task)
{
//kdDebug()<<k_funcinfo<<endl;
KLocale *locale = TDEGlobal::locale();
TDELocale *locale = TDEGlobal::locale();
//kdDebug()<<k_funcinfo<<task->name()<<": "<<task->currentSchedule()<<", "<<task->notScheduled()<<", "<<(m_project ? m_project->notScheduled() : false)<<endl;
item->setListViewText(task->name());
item->setListViewText(1, task->wbs());
@@ -652,7 +652,7 @@ void GanttView::modifyTask(KDGanttViewItem *item, Task *task)
void GanttView::modifyMilestone(KDGanttViewItem *item, Task *task)
{
//kdDebug()<<k_funcinfo<<endl;
KLocale *locale = TDEGlobal::locale();
TDELocale *locale = TDEGlobal::locale();
//kdDebug()<<k_funcinfo<<task->name()<<": "<<task->currentSchedule()<<", "<<task->notScheduled()<<", "<<(m_project ? m_project->notScheduled() : false)<<endl;
if (task->currentSchedule() == 0) {
item->setShowNoInformation(m_showNoInformation);


+ 1
- 1
kplato/kptreportview.cc View File

@@ -79,7 +79,7 @@ public:

TQString getData(TQString tag) const {
//kdDebug()<<k_funcinfo<<"tag="<<tag<<endl;
KLocale *l = TDEGlobal::locale();
TDELocale *l = TDEGlobal::locale();
if (!tag.contains('.')) {
// global tags
if (tag == "currentdate") {


+ 1
- 1
kplato/kptresourceappointmentsview.cc View File

@@ -126,7 +126,7 @@ void ResourceAppointmentsView::slotUpdate() {
return;
TQApplication::setOverrideCursor(TQt::waitCursor);
createSlaveItems();
KLocale *locale = TDEGlobal::locale();
TDELocale *locale = TDEGlobal::locale();
const KCalendarSystem *cal = locale->calendar();
const Calendar *resCal = m_resource->calendar();
const TQDateTime availFrom = m_resource->availableFrom();


+ 1
- 1
kplato/kpttaskappointmentsview.cc View File

@@ -108,7 +108,7 @@ void TaskAppointmentsView::slotUpdate() {
return;
TQApplication::setOverrideCursor(TQt::waitCursor);
createSlaveItems();
KLocale *locale = TDEGlobal::locale();
TDELocale *locale = TDEGlobal::locale();
const KCalendarSystem *cal = locale->calendar();
// Add columns for selected period/periods


+ 1
- 1
kspread/dialogs/kspread_dlg_layout.h View File

@@ -518,7 +518,7 @@ public:
bool isSingleCell() { return ( left == right && top == bottom ); }
bool checkCircle( TQString const & name, TQString const & parent );

KLocale * locale() const { return m_pView->doc()->locale(); }
TDELocale * locale() const { return m_pView->doc()->locale(); }


struct CellBorderFormat


+ 3
- 3
kspread/dialogs/kspread_dlg_preference.cc View File

@@ -157,7 +157,7 @@ parameterLocale::parameterLocale( View* _view, TQVBox *box , char *name )
m_bUpdateLocale=false;
TQGroupBox* tmpTQGroupBox = new TQVGroupBox( i18n("Settings"), box, "GroupBox" );

KLocale* locale=_view->doc()->locale();
TDELocale* locale=_view->doc()->locale();

m_language=new TQLabel( tmpTQGroupBox,"label");
m_number=new TQLabel( tmpTQGroupBox,"label6");
@@ -186,11 +186,11 @@ void parameterLocale::updateDefaultSystemConfig()
{
m_bUpdateLocale=true;
static_cast<Locale*>(m_pView->doc()->locale())->defaultSystemConfig( );
KLocale* locale=m_pView->doc()->locale();
TDELocale* locale=m_pView->doc()->locale();
updateToMatchLocale( locale );
}

void parameterLocale::updateToMatchLocale(KLocale* locale)
void parameterLocale::updateToMatchLocale(TDELocale* locale)
{
m_language->setText( i18n("Language: %1").arg( locale->language() ));
m_number->setText( i18n("Default number format: %1").arg( locale->formatNumber(12.55) ));


+ 1
- 1
kspread/dialogs/kspread_dlg_preference.h View File

@@ -57,7 +57,7 @@ public slots:
/**
* Updates the GUI widgets to match the specified locale.
*/
void updateToMatchLocale(KLocale* locale);
void updateToMatchLocale(TDELocale* locale);

TQLabel *m_shortDate,*m_time,*m_money,*m_date,*m_language,*m_number;
TQPushButton *m_updateButton;


+ 3
- 3
kspread/formula.cc View File

@@ -425,7 +425,7 @@ bool Formula::isValid() const
{
if( d->dirty )
{
KLocale* locale = d->cell ? d->cell->locale() : 0;
TDELocale* locale = d->cell ? d->cell->locale() : 0;
if ((!locale) && d->sheet)
locale = d->sheet->doc()->locale();
Tokens tokens = scan( d->expression, locale );
@@ -455,13 +455,13 @@ void Formula::clear()

Tokens Formula::tokens() const
{
KLocale* locale = d->cell ? d->cell->locale() : 0;
TDELocale* locale = d->cell ? d->cell->locale() : 0;
if ((!locale) && d->sheet)
locale = d->sheet->doc()->locale();
return scan( d->expression, locale );
}

Tokens Formula::scan( const TQString& expr, KLocale* locale ) const
Tokens Formula::scan( const TQString& expr, TDELocale* locale ) const
{
// to hold the result
Tokens tokens;


+ 2
- 2
kspread/formula.h View File

@@ -23,7 +23,7 @@
#include <tqstring.h>
#include <tqvaluevector.h>

class KLocale;
class TDELocale;

namespace KSpread
{
@@ -304,7 +304,7 @@ class Formula
* If the expression contains error (e.g. unknown operator, string no terminated)
* this function returns tokens which is not valid.
*/
Tokens scan( const TQString& expr, KLocale* locale = 0 ) const;
Tokens scan( const TQString& expr, TDELocale* locale = 0 ) const;

TQString dump() const;



+ 3
- 3
kspread/kspread_cell.cc View File

@@ -404,7 +404,7 @@ TQString Cell::columnName() const
return columnName( d->column );
}

KLocale* Cell::locale() const
TDELocale* Cell::locale() const
{
return d->format->sheet()->doc()->locale();
}
@@ -6814,9 +6814,9 @@ bool Cell::loadCellData(const TQDomElement & text, Paste::Operation op )
kdWarning(36001) << "Couldn't parse '" << t << "' as number." << endl;
}
/* We will need to localize the text version of the number */
KLocale* locale = format()->sheet()->doc()->locale();
TDELocale* locale = format()->sheet()->doc()->locale();

/* KLocale::formatNumber requires the precision we want to return.
/* TDELocale::formatNumber requires the precision we want to return.
*/
int precision = t.length() - t.find('.') - 1;



+ 2
- 2
kspread/kspread_cell.h View File

@@ -41,7 +41,7 @@

#include "kspread_condition.h"

class KLocale;
class TDELocale;
class TQDomElement;
class TQDomDocument;
class KoXmlWriter;
@@ -211,7 +211,7 @@ public:
/**
* Returns the locale setting of this cell.
*/
KLocale* locale() const;
TDELocale* locale() const;
/**
* Returns true if this cell holds a formula.
*/


+ 2
- 2
kspread/kspread_doc.cc View File

@@ -95,7 +95,7 @@ class Doc::Private
public:

Map *map;
KLocale *locale;
TDELocale *locale;
StyleManager *styleManager;
ValueParser *parser;
ValueFormatter *formatter;
@@ -395,7 +395,7 @@ void Doc::initEmpty()
KoDocument::initEmpty();
}

KLocale *Doc::locale () const
TDELocale *Doc::locale () const
{
return d->locale;
}


+ 1
- 1
kspread/kspread_doc.h View File

@@ -151,7 +151,7 @@ public:
*/
virtual TQCString mimeType() const { return MIME_TYPE; }

KLocale *locale () const;
TDELocale *locale () const;
Map *map () const;
StyleManager *styleManager () const;
ValueParser *parser () const;


+ 1
- 1
kspread/kspread_format.h View File

@@ -34,7 +34,7 @@
class TQDomElement;
class TQDomDocument;
class DCOPObject;
class KLocale;
class TDELocale;
class KoGenStyle;
class KoGenStyles;
class KoOasisLoadingContext;


+ 3
- 3
kspread/kspread_functions_text.cc View File

@@ -252,7 +252,7 @@ Value func_dollar (valVector args, ValueCalc *calc, FuncExtra *)
// do round, because formatMoney doesn't
value = floor (value * pow (10.0, precision) + 0.5) / pow (10.0, precision);
KLocale *locale = calc->conv()->locale();
TDELocale *locale = calc->conv()->locale();
TQString s = locale->formatMoney (value, locale->currencySymbol(), precision);
return Value (s);
@@ -303,9 +303,9 @@ Value func_fixed (valVector args, ValueCalc *calc, FuncExtra *)
no_commas = calc->conv()->asBoolean (args[2]).asBoolean();

TQString result;
KLocale *locale = calc->conv()->locale();
TDELocale *locale = calc->conv()->locale();

// unfortunately, we can't just use KLocale::formatNumber because
// unfortunately, we can't just use TDELocale::formatNumber because
// * if decimals < 0, number is rounded
// * if no_commas is true, thousand separators shouldn't show up



+ 2
- 2
kspread/kspread_locale.cc View File

@@ -5,7 +5,7 @@
using namespace KSpread;

Locale::Locale()
: KLocale("kspread")
: TDELocale("kspread")
{
insertCatalogue("koffice");
}
@@ -84,7 +84,7 @@ TQDomElement Locale::save( TQDomDocument& doc ) const

void Locale::defaultSystemConfig( )
{
KLocale locale("kspread");
TDELocale locale("kspread");
setWeekStartDay( locale.weekStartDay() );
setDecimalSymbol( locale.decimalSymbol());
setThousandsSeparator( locale.thousandsSeparator() );


+ 1
- 1
kspread/kspread_locale.h View File

@@ -9,7 +9,7 @@ class TQDomDocument;
namespace KSpread
{

class Locale : public KLocale
class Locale : public TDELocale
{
public:
Locale();


+ 3
- 3
kspread/kspread_numformat.cc View File

@@ -253,7 +253,7 @@ void resetGlobals()
g_convertionInfo.ampm = false;
}

void initGlobals( KLocale const * const locale )
void initGlobals( TDELocale const * const locale )
{
g_Monday = locale->calendar()->weekDayName( 1, false );
g_Tuesday = locale->calendar()->weekDayName( 2, false );
@@ -438,7 +438,7 @@ void createScientificStruct( BaseFormat * data, TQString const & format, bool in
}


int doPreScan( TQString & format, TQString const & formatBack, KLocale const * const /* locale */,
int doPreScan( TQString & format, TQString const & formatBack, TDELocale const * const /* locale */,
bool insert, BaseFormat * data )
{
int type = g_formatStore.getType( format, data );
@@ -1571,7 +1571,7 @@ void createDateTime( TQString & result, Value const & value,
}

TQString formatNumber( Value const & value, TQString format, bool & setRed,
KLocale const * const locale, bool insert )
TDELocale const * const locale, bool insert )
{
// need delocalized strings: dcSymbol: '.', thSymbol = ','
if ( !g_init )


+ 2
- 2
kspread/kspread_util.cc View File

@@ -1015,7 +1015,7 @@ bool KSpread::localReferenceAnchor( const TQString &_ref )
}


TQString KSpread::Oasis::decodeFormula(const TQString& expr, const KLocale* locale)
TQString KSpread::Oasis::decodeFormula(const TQString& expr, const TDELocale* locale)
{
// parsing state
enum { Start, InNumber, InString, InIdentifier, InReference, InSheetName } state;
@@ -1208,7 +1208,7 @@ TQString KSpread::Oasis::decodeFormula(const TQString& expr, const KLocale* loca
return result;
}

/*TQString KSpread::Oasis::encodeFormula(const TQString& expr, const KLocale* locale)
/*TQString KSpread::Oasis::encodeFormula(const TQString& expr, const TDELocale* locale)
{
// TODO move Cell::convertFormulaToOasisFormat to this point
//expr = "not here yet";


+ 3
- 3
kspread/kspread_util.h View File

@@ -35,7 +35,7 @@ class TQPen;
class TQDomElement;
class TQDomDocument;

class KLocale;
class TDELocale;

bool util_isPointValid(TQPoint point);
bool util_isRectValid(TQRect rect);
@@ -340,14 +340,14 @@ namespace Oasis
* @param locale The locale to which the expression should be converted.
*/
// TODO check visibility
KSPREAD_EXPORT TQString decodeFormula(const TQString& expr, const KLocale* locale = 0);
KSPREAD_EXPORT TQString decodeFormula(const TQString& expr, const TDELocale* locale = 0);
/**
* Converts a localized formula/cell reference to an OpenDocument
* representation of a formula/cell reference.
* @param expr The expression to convert to OpenDocument format.
* @param locale The locale from which the expression should be converted.
*/
KSPREAD_EXPORT TQString encodeFormula(const TQString& expr, const KLocale* locale = 0);
KSPREAD_EXPORT TQString encodeFormula(const TQString& expr, const TDELocale* locale = 0);
}

} // namespace KSpread


+ 1
- 1
kspread/tests/formula_tester.cc View File

@@ -414,7 +414,7 @@ void FormulaOasisConversionTester::checkOasis( const char *file, int line, const
{
testCount++;

KLocale locale("en_US");
TDELocale locale("en_US");
locale.setDecimalSymbol(",");

// KSpread -> OpenDocument


+ 1
- 1
kspread/valueconverter.cc View File

@@ -28,7 +28,7 @@ ValueConverter::ValueConverter (ValueParser* p) : parser( p )
{
}

KLocale* ValueConverter::locale()
TDELocale* ValueConverter::locale()
{
return parser->locale();
}


+ 2
- 2
kspread/valueconverter.h View File

@@ -20,7 +20,7 @@
#ifndef KSPREAD_VALUECONVERTER
#define KSPREAD_VALUECONVERTER

class KLocale;
class TDELocale;

#include "kspread_value.h"

@@ -48,7 +48,7 @@ class ValueConverter {
Value asDate (const Value &value) const;
Value asTime (const Value &value) const;
KLocale* locale();
TDELocale* locale();
private:
ValueParser *parser;


+ 5
- 5
kspread/valueparser.cc View File

@@ -27,11 +27,11 @@

using namespace KSpread;

ValueParser::ValueParser( KLocale* locale ) : parserLocale( locale )
ValueParser::ValueParser( TDELocale* locale ) : parserLocale( locale )
{
}

KLocale* ValueParser::locale()
TDELocale* ValueParser::locale()
{
return parserLocale;
}
@@ -364,7 +364,7 @@ Value ValueParser::tryParseDate (const TQString& str, bool *ok)
{
// Note: if shortdate format only specifies 2 digits year, then 3/4/1955
// will be treated as in year 3055, while 3/4/55 as year 2055
// (because 55 < 69, see KLocale) and thus there's no way to enter for
// (because 55 < 69, see TDELocale) and thus there's no way to enter for
// year 1995
// The following fixes the problem, 3/4/1955 will always be 1955
@@ -374,11 +374,11 @@ Value ValueParser::tryParseDate (const TQString& str, bool *ok)
tmpDate = tmpDate.addYears( -1900 );

// this is another HACK !
// with two digit years, 0-69 is treated as year 2000-2069 (see KLocale)
// with two digit years, 0-69 is treated as year 2000-2069 (see TDELocale)
// however, in Excel only 0-29 is year 2000-2029, 30 or later is 1930
// onwards

// the following provides workaround for KLocale so we're compatible
// the following provides workaround for TDELocale so we're compatible
// with Excel
// (e.g 3/4/45 is Mar 4, 1945 not Mar 4, 2045)
if( ( tmpDate.year() >= 2030 ) && ( tmpDate.year() <= 2069 ) )


+ 4
- 4
kspread/valueparser.h View File

@@ -25,7 +25,7 @@

#include "kspread_global.h"

class KLocale;
class TDELocale;

namespace KSpread
{
@@ -40,9 +40,9 @@ Value in the desired format.
class ValueParser {
public:
/** constructor */
ValueParser (KLocale *locale);
ValueParser (TDELocale *locale);
KLocale* locale();
TDELocale* locale();
/** try to parse the text in a given cell and set value accordingly */
void parse (const TQString& str, Cell *cell);
@@ -56,7 +56,7 @@ class ValueParser {
Value tryParseTime (const TQString& str, bool *ok = 0);
protected:
KLocale* parserLocale;
TDELocale* parserLocale;

// Try to parse the text as a bool/number/date/time/etc.
// Helpers for parse.


+ 1
- 1
kugar/kudesigner/main.cpp View File

@@ -35,7 +35,7 @@ static const KCmdLineOptions options[] =

extern "C" KUGARDESIGNER_EXPORT int kdemain( int argc, char **argv )
{
KLocale::setMainCatalogue( "kugar" );
TDELocale::setMainCatalogue( "kugar" );
TDECmdLineArgs::init( argc, argv, newKudesignerAboutData() );
TDECmdLineArgs::addCmdLineOptions( options );
KoApplication app;


+ 2
- 2
kword/KWStatisticsDialog.cpp View File

@@ -110,7 +110,7 @@ void KWStatisticsDialog::slotRefreshValue(bool state)

void KWStatisticsDialog::calcGeneral( TQLabel **resultLabel )
{
KLocale *locale = TDEGlobal::locale();
TDELocale *locale = TDEGlobal::locale();

resultLabel[0]->setText( locale->formatNumber( m_doc->pageCount(), 0) );
int table =0;
@@ -194,7 +194,7 @@ bool KWStatisticsDialog::calcStats( TQLabel **resultLabel, bool selection, bool
}

// assign results
KLocale *locale = TDEGlobal::locale();
TDELocale *locale = TDEGlobal::locale();
resultLabel[0]->setText( locale->formatNumber( charsWithSpace, 0) );
resultLabel[1]->setText( locale->formatNumber( charsWithoutSpace, 0 ) );
resultLabel[2]->setText( locale->formatNumber( syllables, 0 ) );


+ 1
- 1
lib/kofficecore/KoDocument.cpp View File

@@ -112,7 +112,7 @@ public:
{
m_confirmNonNativeSave[0] = true;
m_confirmNonNativeSave[1] = true;
if ( TDEGlobal::locale()->measureSystem() == KLocale::Imperial ) {
if ( TDEGlobal::locale()->measureSystem() == TDELocale::Imperial ) {
m_unit = KoUnit::U_INCH;
} else {
m_unit = KoUnit::U_CM;


+ 1
- 1
lib/kofficecore/KoGlobal.cpp View File

@@ -112,7 +112,7 @@ TQStringList KoGlobal::_listOfLanguages()
void KoGlobal::createListOfLanguages()
{
TDEConfig config( "all_languages", true, false, "locale" );
// Note that we could also use KLocale::allLanguagesTwoAlpha
// Note that we could also use TDELocale::allLanguagesTwoAlpha

TQMap<TQString, bool> seenLanguages;
const TQStringList langlist = config.groupList();


+ 1
- 1
lib/kofficeui/KoUnitWidgets.cpp View File

@@ -98,7 +98,7 @@ TQString KoUnitDoubleBase::getVisibleText( double value ) const
double KoUnitDoubleBase::toDouble( const TQString& str, bool* ok ) const
{
TQString str2( str );
/* KLocale::readNumber wants the thousand separator exactly at 1000.
/* TDELocale::readNumber wants the thousand separator exactly at 1000.
But when editing, it might be anywhere. So we need to remove it. */
const TQString sep( TDEGlobal::locale()->thousandsSeparator() );
if ( !sep.isEmpty() )


+ 3
- 3
lib/kotext/KoAutoFormat.cpp View File

@@ -166,7 +166,7 @@ KoAutoFormat::KoAutoFormat( KoDocument *_doc, KoVariableCollection *_varCollecti
loadListOfWordCompletion();
m_listCompletion->setIgnoreCase( true );
updateMaxWords();
KLocale klocale(m_doc->instance()->instanceName());
TDELocale klocale(m_doc->instance()->instanceName());
for (int i = 1; i <=7; i++)
{
m_cacheNameOfDays.append(klocale.calendar()->weekDayName( i ).lower());
@@ -391,7 +391,7 @@ void KoAutoFormat::readConfig(bool force)
void KoAutoFormat::readAutoCorrectConfig()
{
Q_ASSERT( m_entries.isEmpty() ); // readConfig is only called once...
KLocale klocale(m_doc->instance()->instanceName());
TDELocale klocale(m_doc->instance()->instanceName());
TQString kdelang = klocale.languageList().front();
kdelang.remove( TQRegExp( "@.*" ) );
kdDebug(32500) << "KoAutoFormat: m_autoFormatLanguage=" << m_autoFormatLanguage << " kdelang=" << kdelang << endl;
@@ -616,7 +616,7 @@ void KoAutoFormat::loadEntry( const TQDomElement &nl, bool _allLanguages)
void KoAutoFormat::saveConfig()
{
TDEConfig* config = KoGlobal::kofficeConfig();
KLocale klocale(m_doc->instance()->instanceName());
TDELocale klocale(m_doc->instance()->instanceName());

TDEConfigGroupSaver cgs( config, "AutoFormat" );
config->writeEntry( "ConvertUpperCase", m_convertUpperCase );


Loading…
Cancel
Save