Commit 7de592ac authored by Mojtaba Shahi Senobari's avatar Mojtaba Shahi Senobari Committed by Gopalakrishna Bhat A

Fix the list number saving in Arabic/Kannada etc.

BUGS: 292427
parent 887bc5de
......@@ -6,6 +6,7 @@
* Copyright (C) 2010 Nandita Suri <suri.nandita@gmail.com>
* Copyright (C) 2011 Lukáš Tvrdý <lukas.tvrdy@ixonos.com>
* Copyright (C) 2011-2012 Gopalakrishna Bhat A <gopalakbhat@gmail.com>
* Copyright (C) 2011 Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
......@@ -586,6 +587,45 @@ void KoListLevelProperties::loadOdf(KoShapeLoadingContext& scontext, const KoXml
case KoOdfNumberDefinition::RomanUpperCase:
setStyle(KoListStyle::UpperRomanItem);
break;
case KoOdfNumberDefinition::ArabicAlphabet:
setStyle(KoListStyle::ArabicAlphabet);
break;
case KoOdfNumberDefinition::Thai:
setStyle(KoListStyle::Thai);
break;
case KoOdfNumberDefinition::Abjad:
setStyle(KoListStyle::Abjad);
break;
case KoOdfNumberDefinition::AbjadMinor:
setStyle(KoListStyle::AbjadMinor);
break;
case KoOdfNumberDefinition::Tibetan:
setStyle(KoListStyle::Tibetan);
break;
case KoOdfNumberDefinition::Telugu:
setStyle(KoListStyle::Telugu);
break;
case KoOdfNumberDefinition::Tamil:
setStyle(KoListStyle::Tamil);
break;
case KoOdfNumberDefinition::Oriya:
setStyle(KoListStyle::Oriya);
break;
case KoOdfNumberDefinition::Malayalam:
setStyle(KoListStyle::Malayalam);
break;
case KoOdfNumberDefinition::Kannada:
setStyle(KoListStyle::Kannada);
break;
case KoOdfNumberDefinition::Gurumukhi:
setStyle(KoListStyle::Gurumukhi);
break;
case KoOdfNumberDefinition::Gujarati:
setStyle(KoListStyle::Gujarati);
break;
case KoOdfNumberDefinition::Bengali:
setStyle(KoListStyle::Bengali);
break;
case KoOdfNumberDefinition::Numeric:
default:
setStyle(KoListStyle::DecimalItem);
......@@ -752,14 +792,26 @@ void KoListLevelProperties::saveOdf(KoXmlWriter *writer, KoShapeSavingContext &c
if (d->stylesPrivate.contains(KoListStyle::DisplayLevel))
writer->addAttribute("text:display-levels", d->stylesPrivate.value(KoListStyle::DisplayLevel).toInt());
QChar format;
QByteArray format;
switch (style()) {
case KoListStyle::DecimalItem: format = '1'; break;
case KoListStyle::AlphaLowerItem: format = 'a'; break;
case KoListStyle::UpperAlphaItem: format = 'A'; break;
case KoListStyle::RomanLowerItem: format = 'i'; break;
case KoListStyle::UpperRomanItem: format = 'I'; break;
default: format = QChar::Null; break;
case KoListStyle::DecimalItem: format = "1"; break;
case KoListStyle::AlphaLowerItem: format = "a"; break;
case KoListStyle::UpperAlphaItem: format = "A"; break;
case KoListStyle::RomanLowerItem: format = "i"; break;
case KoListStyle::UpperRomanItem: format = "I"; break;
case KoListStyle::ArabicAlphabet: format = "أ, ب, ت, ..."; break;
case KoListStyle::Thai: format = "ก, ข, ค, ..."; break;
case KoListStyle::Abjad: format = "أ, ب, ج, ..."; break;
case KoListStyle::AbjadMinor: format = "ﺃ,ﺏ, ﺝ, ... "; break;
case KoListStyle::Telugu: format = "౧, ౨, ౩, ..."; break;
case KoListStyle::Tamil: format = "௧, ௨, ௪, ..."; break;
case KoListStyle::Oriya: format = "୧, ୨, ୩, ..."; break;
case KoListStyle::Malayalam: format = "൧, ൨, ൩, ..."; break;
case KoListStyle::Kannada: format = "೧, ೨, ೩, ..."; break;
case KoListStyle::Gurumukhi: format = "੧, ੨, ੩, ..."; break;
case KoListStyle::Gujarati: format = "૧, ૨, ૩, ..."; break;
case KoListStyle::Bengali: format = "১, ২, ৩, ..."; break;
default: format = ""; break;
}
writer->addAttribute("style:num-format", format);
}
......
/* This file is part of the KDE project
Copyright (C) 2010 Boudewijn Rempt
Copyright (C) 2011 Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
......@@ -79,6 +80,42 @@ void KoOdfNumberDefinition::loadOdf(const KoXmlElement &element)
else if (format[0] == 'I') {
d->formatSpecification = RomanUpperCase;
}
else if (format == QString::fromUtf8("أ, ب, ت, ...")){
d->formatSpecification = ArabicAlphabet;
}
else if (format == QString::fromUtf8("ก, ข, ค, ...")){
d->formatSpecification = Thai;
}
else if (format == QString::fromUtf8("أ, ب, ج, ...")) {
d->formatSpecification = Abjad;
}
else if (format == QString::fromUtf8("ﺃ,ﺏ, ﺝ, ... ")) {
d->formatSpecification = AbjadMinor;
}
else if (format == QString::fromUtf8("౧, ౨, ౩, ...")) {
d->formatSpecification = Telugu;
}
else if (format == QString::fromUtf8("௧, ௨, ௪, ...")) {
d->formatSpecification = Tamil;
}
else if (format == QString::fromUtf8("୧, ୨, ୩, ...")) {
d->formatSpecification = Oriya;
}
else if (format == QString::fromUtf8("൧, ൨, ൩, ...")) {
d->formatSpecification = Malayalam;
}
else if (format == QString::fromUtf8("೧, ೨, ೩, ...")) {
d->formatSpecification = Kannada;
}
else if (format == QString::fromUtf8("੧, ੨, ੩, ...")) {
d->formatSpecification = Gurumukhi;
}
else if (format == QString::fromUtf8("૧, ૨, ૩, ...")) {
d->formatSpecification = Gujarati;
}
else if (format == QString::fromUtf8("১, ২, ৩, ...")) {
d->formatSpecification = Bengali;
}
else {
d->formatSpecification = Numeric;
}
......@@ -99,22 +136,52 @@ void KoOdfNumberDefinition::saveOdf(KoXmlWriter *writer) const
if (!d->suffix.isNull()) {
writer->addAttribute("style:num-suffix", d->suffix);
}
QChar format;
QByteArray format;
switch(d->formatSpecification) {
case Numeric:
format = '1';
format = "1";
break;
case AlphabeticLowerCase:
format = 'a';
format = "a";
break;
case AlphabeticUpperCase:
format = 'A';
format = "A";
break;
case RomanLowerCase:
format = 'i';
format = "i";
break;
case RomanUpperCase:
format = 'I';
format = "I";
break;
case ArabicAlphabet:
format = "أ, ب, ت, ...";
break;
case Thai:
format = "ก, ข, ค, ...";
break;
case Telugu:
format = "౧, ౨, ౩, ...";
break;
case Tamil:
format = "௧, ௨, ௪, ...";
break;
case Oriya:
format = "୧, ୨, ୩, ...";
break;
case Malayalam:
format = "൧, ൨, ൩, ...";
break;
case Kannada:
format = "೧, ೨, ೩, ...";
break;
case Gurumukhi:
format = "੧, ੨, ੩, ...";
break;
case Gujarati:
format = "૧, ૨, ૩, ...";
break;
case Bengali:
format = "১, ২, ৩, ...";
break;
case Empty:
default:
......
/* This file is part of the KDE project
Copyright (C) 2010 Boudewijn Rempt
Copyright (C) 2011 Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
......@@ -88,6 +89,19 @@ public:
AlphabeticUpperCase,
RomanLowerCase,
RomanUpperCase,
ArabicAlphabet,
Thai,
Abjad,
AbjadMinor,
Tibetan,
Telugu,
Tamil,
Oriya,
Malayalam,
Kannada,
Gurumukhi,
Gujarati,
Bengali,
Empty
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment