Kaydet (Commit) aea66f8a authored tarafından David Tardon's avatar David Tardon

convert a sequence of if to a switch

Change-Id: Ibca33b2170348ce56e9fa376009ee1cdea2dd67e
üst d324ed83
......@@ -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);
......
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