[Libreoffice-commits] core.git: sfx2/source

Caolán McNamara caolanm at redhat.com
Thu Apr 6 12:53:43 UTC 2017


 sfx2/source/appl/sfxhelp.cxx |   67 +++++++++++++++++++++++++------------------
 1 file changed, 40 insertions(+), 27 deletions(-)

New commits:
commit f0e4c91aba989507913d1f88133050409dd109c5
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Apr 6 12:34:48 2017 +0100

    split out module->help mapping
    
    and add the missing not-toplevel-in-help ones from...
    
    ls instdir/share/config/soffice.cfg/modules|sort|uniq
    
    Change-Id: I618d91e1271b3a200928494156d93cbfef45c19f
    Reviewed-on: https://gerrit.libreoffice.org/36206
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx
index 2fa709a4c098..2042ece510c9 100644
--- a/sfx2/source/appl/sfxhelp.cxx
+++ b/sfx2/source/appl/sfxhelp.cxx
@@ -286,6 +286,42 @@ OUString getCurrentModuleIdentifier_Impl()
     return sIdentifier;
 }
 
+namespace
+{
+    OUString MapModuleIdentifier(const OUString &rFactoryShortName)
+    {
+        OUString aFactoryShortName(rFactoryShortName);
+
+        // Map some module identifiers to their "real" help module string.
+        if ( aFactoryShortName == "chart2" )
+            aFactoryShortName = "schart" ;
+        else if ( aFactoryShortName == "BasicIDE" )
+            aFactoryShortName = "sbasic";
+        else if ( aFactoryShortName == "sweb"
+                || aFactoryShortName == "sglobal"
+                || aFactoryShortName == "swxform" )
+            aFactoryShortName = "swriter" ;
+        else if ( aFactoryShortName == "dbquery"
+                || aFactoryShortName == "dbbrowser"
+                || aFactoryShortName == "dbrelation"
+                || aFactoryShortName == "dbtable"
+                || aFactoryShortName == "dbapp"
+                || aFactoryShortName == "dbreport"
+                || aFactoryShortName == "dbtdata"
+                || aFactoryShortName == "swreport"
+                || aFactoryShortName == "swform" )
+            aFactoryShortName = "sdatabase";
+        else if ( aFactoryShortName == "sbibliography"
+                || aFactoryShortName == "sabpilot"
+                || aFactoryShortName == "scanner"
+                || aFactoryShortName == "spropctrlr"
+                || aFactoryShortName == "StartModule" )
+            aFactoryShortName.clear();
+
+        return aFactoryShortName;
+    }
+}
+
 OUString SfxHelp::GetHelpModuleName_Impl()
 {
     OUString aFactoryShortName;
@@ -314,33 +350,10 @@ OUString SfxHelp::GetHelpModuleName_Impl()
         }
     }
 
-    OUString sDefaultModule = getDefaultModule_Impl();
-    if ( !aFactoryShortName.isEmpty() )
-    {
-        // Map some module identifiers to their "real" help module string.
-        if ( aFactoryShortName == "chart2" )
-            aFactoryShortName = "schart" ;
-        else if ( aFactoryShortName == "BasicIDE" )
-            aFactoryShortName = "sbasic";
-        else if ( aFactoryShortName == "sweb"
-                || aFactoryShortName == "sglobal"
-                || aFactoryShortName == "swxform" )
-            aFactoryShortName = "swriter" ;
-        else if ( aFactoryShortName == "dbquery"
-                || aFactoryShortName == "dbbrowser"
-                || aFactoryShortName == "dbrelation"
-                || aFactoryShortName == "dbtable"
-                || aFactoryShortName == "dbapp"
-                || aFactoryShortName == "dbreport"
-                || aFactoryShortName == "swreport"
-                || aFactoryShortName == "swform" )
-            aFactoryShortName = "sdatabase";
-        else if ( aFactoryShortName == "sbibliography"
-                || aFactoryShortName == "StartModule" )
-            aFactoryShortName = sDefaultModule;
-    }
-    else
-        aFactoryShortName = sDefaultModule;
+    if (!aFactoryShortName.isEmpty())
+        aFactoryShortName = MapModuleIdentifier(aFactoryShortName);
+    if (aFactoryShortName.isEmpty())
+        aFactoryShortName = getDefaultModule_Impl();
 
     return aFactoryShortName;
 }


More information about the Libreoffice-commits mailing list