[Libreoffice-commits] core.git: 2 commits - filter/source writerperfect/inc writerperfect/source

David Tardon dtardon at redhat.com
Tue May 1 05:59:29 UTC 2018


 filter/source/config/fragments/filters/MS_Multiplan.xcu    |    2 
 filter/source/config/fragments/types/calc_MS_Multiplan.xcu |    7 --
 writerperfect/inc/strings.hrc                              |    1 
 writerperfect/source/calc/MSWorksCalcImportFilter.cxx      |   45 +++++++------
 4 files changed, 32 insertions(+), 23 deletions(-)

New commits:
commit aea66f8a3d5757e073b9bdcf1ff240371777314e
Author: David Tardon <dtardon at redhat.com>
Date:   Mon Apr 30 15:30:22 2018 +0200

    convert a sequence of if to a switch
    
    Change-Id: Ibca33b2170348ce56e9fa376009ee1cdea2dd67e

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);
commit d324ed83fa6941f5408402d7ab0ec65f5c18d1d2
Author: osnola <alonso at loria.fr>
Date:   Mon Apr 30 15:25:24 2018 +0200

    tdf#117323 fix import of MS Multiplan for DOS
    
    Change-Id: Ica053852c17ac993b4e50c4c58dbaf2ee4f33035

diff --git a/filter/source/config/fragments/filters/MS_Multiplan.xcu b/filter/source/config/fragments/filters/MS_Multiplan.xcu
index f10e0ddcf6f9..780901d5329f 100644
--- a/filter/source/config/fragments/filters/MS_Multiplan.xcu
+++ b/filter/source/config/fragments/filters/MS_Multiplan.xcu
@@ -12,7 +12,7 @@
         <value>IMPORT ALIEN 3RDPARTYFILTER PREFERRED</value>
     </prop>
     <prop oor:name="FilterService">
-        <value>org.libreoffice.comp.Calc.MSWorksCalcImportFilter</value>
+        <value>com.sun.star.comp.Calc.MSWorksCalcImportFilter</value>
     </prop>
     <prop oor:name="UIName">
         <value xml:lang="en-US">Microsoft Multiplan</value>
diff --git a/filter/source/config/fragments/types/calc_MS_Multiplan.xcu b/filter/source/config/fragments/types/calc_MS_Multiplan.xcu
index d6feee60af25..8f2bba34f0a2 100644
--- a/filter/source/config/fragments/types/calc_MS_Multiplan.xcu
+++ b/filter/source/config/fragments/types/calc_MS_Multiplan.xcu
@@ -9,11 +9,10 @@
 
 <node oor:name="calc_MS_Multiplan" oor:op="replace">
     <prop oor:name="DetectService">
-        <value>org.libreoffice.comp.Calc.MSWorksCalcImportFilter</value>
-    </prop>
-    <prop oor:name="Extensions">
-        <value>*</value>
+        <value>com.sun.star.comp.Calc.MSWorksCalcImportFilter</value>
     </prop>
+    <prop oor:name="Extensions"/>
+    <prop oor:name="URLPattern"/>
     <prop oor:name="Preferred">
         <value>true</value>
     </prop>
diff --git a/writerperfect/inc/strings.hrc b/writerperfect/inc/strings.hrc
index 9f9b60d8bee8..2bd8d27ac82a 100644
--- a/writerperfect/inc/strings.hrc
+++ b/writerperfect/inc/strings.hrc
@@ -13,6 +13,7 @@
 #define NC_(Context, String) (Context "\004" u8##String)
 
 #define STR_ENCODING_DIALOG_TITLE               NC_("STR_ENCODING_DIALOG_TITLE", "Import file")
+#define STR_ENCODING_DIALOG_TITLE_MSMULTIPLAN   NC_("STR_ENCODING_DIALOG_TITLE_MSMULTIPLAN", "Import MS Multiplan for DOS file")
 #define STR_ENCODING_DIALOG_TITLE_MSWORKS       NC_("STR_ENCODING_DIALOG_TITLE_MSWORKS", "Import MS Works file")
 #define STR_ENCODING_DIALOG_TITLE_MSWRITE       NC_("STR_ENCODING_DIALOG_TITLE_MSWRITE", "Import MS Write file")
 #define STR_ENCODING_DIALOG_TITLE_DOSWORD       NC_("STR_ENCODING_DIALOG_TITLE_DOSWORD", "Import MS Word for DOS file")
diff --git a/writerperfect/source/calc/MSWorksCalcImportFilter.cxx b/writerperfect/source/calc/MSWorksCalcImportFilter.cxx
index 04dcffcdac48..969f0e0b4417 100644
--- a/writerperfect/source/calc/MSWorksCalcImportFilter.cxx
+++ b/writerperfect/source/calc/MSWorksCalcImportFilter.cxx
@@ -210,11 +210,16 @@ bool MSWorksCalcImportFilter::doImportDocument(librevenge::RVNGInputStream& rInp
             title = WpResId(STR_ENCODING_DIALOG_TITLE_SYMPHONY);
             encoding = "CP437";
         }
-        else
+        else if (creator == libwps::WPS_QUATTRO_PRO)
         {
             title = WpResId(STR_ENCODING_DIALOG_TITLE_QUATTROPRO);
             encoding = "CP437";
         }
+        else
+        {
+            title = WpResId(STR_ENCODING_DIALOG_TITLE_MSMULTIPLAN);
+            encoding = "CP437";
+        }
         try
         {
             const ScopedVclPtrInstance<writerperfect::WPFTEncodingDialog> pDlg(title, encoding);


More information about the Libreoffice-commits mailing list