summaryrefslogtreecommitdiff
path: root/writerperfect/source/calc
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2018-04-30 15:30:22 +0200
committerDavid Tardon <dtardon@redhat.com>2018-05-01 07:59:04 +0200
commitaea66f8a3d5757e073b9bdcf1ff240371777314e (patch)
tree795143016c191d699760ee19265545f455e26cdf /writerperfect/source/calc
parentd324ed83fa6941f5408402d7ab0ec65f5c18d1d2 (diff)
convert a sequence of if to a switch
Change-Id: Ibca33b2170348ce56e9fa376009ee1cdea2dd67e
Diffstat (limited to 'writerperfect/source/calc')
-rw-r--r--writerperfect/source/calc/MSWorksCalcImportFilter.cxx50
1 files changed, 27 insertions, 23 deletions
diff --git a/writerperfect/source/calc/MSWorksCalcImportFilter.cxx b/writerperfect/source/calc/MSWorksCalcImportFilter.cxx
index 969f0e0b4417..2b560e795a55 100644
--- a/writerperfect/source/calc/MSWorksCalcImportFilter.cxx
+++ b/writerperfect/source/calc/MSWorksCalcImportFilter.cxx
@@ -195,31 +195,35 @@ bool MSWorksCalcImportFilter::doImportDocument(librevenge::RVNGInputStream& rInp
if (needEncoding)
{
OUString title, encoding;
- if (creator == libwps::WPS_MSWORKS)
- {
- title = WpResId(STR_ENCODING_DIALOG_TITLE_MSWORKS);
- encoding = "CP850";
- }
- else if (creator == libwps::WPS_LOTUS)
- {
- title = WpResId(STR_ENCODING_DIALOG_TITLE_LOTUS);
- encoding = "CP437";
- }
- else if (creator == libwps::WPS_SYMPHONY)
- {
- title = WpResId(STR_ENCODING_DIALOG_TITLE_SYMPHONY);
- encoding = "CP437";
- }
- else if (creator == libwps::WPS_QUATTRO_PRO)
- {
- title = WpResId(STR_ENCODING_DIALOG_TITLE_QUATTROPRO);
- encoding = "CP437";
- }
- else
+ switch (creator)
{
- title = WpResId(STR_ENCODING_DIALOG_TITLE_MSMULTIPLAN);
- encoding = "CP437";
+ case libwps::WPS_MSWORKS:
+ title = WpResId(STR_ENCODING_DIALOG_TITLE_MSWORKS);
+ encoding = "CP850";
+ break;
+ case libwps::WPS_LOTUS:
+ title = WpResId(STR_ENCODING_DIALOG_TITLE_LOTUS);
+ encoding = "CP437";
+ break;
+ case libwps::WPS_SYMPHONY:
+ title = WpResId(STR_ENCODING_DIALOG_TITLE_SYMPHONY);
+ encoding = "CP437";
+ break;
+ case libwps::WPS_QUATTRO_PRO:
+ title = WpResId(STR_ENCODING_DIALOG_TITLE_QUATTROPRO);
+ encoding = "CP437";
+ break;
+ case libwps::WPS_RESERVED_2:
+ title = WpResId(STR_ENCODING_DIALOG_TITLE_MSMULTIPLAN);
+ encoding = "CP437";
+ break;
+ default:
+ SAL_INFO("writerperfect", "unexpected creator: " << creator);
+ title = WpResId(STR_ENCODING_DIALOG_TITLE);
+ encoding = "CP437";
+ break;
}
+
try
{
const ScopedVclPtrInstance<writerperfect::WPFTEncodingDialog> pDlg(title, encoding);