[Libreoffice-commits] core.git: bin/find-most-repeated-functions.py i18nlangtag/source include/i18nlangtag include/vcl vcl/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sat Mar 9 06:30:09 UTC 2019


 bin/find-most-repeated-functions.py            |   42 +++++++++++++++++
 i18nlangtag/source/languagetag/languagetag.cxx |    2 
 include/i18nlangtag/languagetag.hxx            |    2 
 include/vcl/ITiledRenderable.hxx               |   51 ---------------------
 vcl/source/app/ITiledRenderable.cxx            |   60 +++++++++++++++++++++++++
 5 files changed, 107 insertions(+), 50 deletions(-)

New commits:
commit 4c67df150f8d0f1285c8090a8c00e285fb947c4a
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Fri Mar 8 10:37:51 2019 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sat Mar 9 07:29:45 2019 +0100

    out of line some heavily repeated functions
    
    Change-Id: Icd9f7ebab89d6c2b166b6f42fd7682e89127fd51
    Reviewed-on: https://gerrit.libreoffice.org/68903
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/bin/find-most-repeated-functions.py b/bin/find-most-repeated-functions.py
new file mode 100755
index 000000000000..767f802406fb
--- /dev/null
+++ b/bin/find-most-repeated-functions.py
@@ -0,0 +1,42 @@
+#!/usr/bin/python
+#
+# Find the top 100 functions that are repeated in multiple .o files, so we can out-of-line those
+#
+#
+
+import subprocess
+from collections import defaultdict
+
+# the odd bash construction here is because some of the .o files returned by find are not object files
+# and I don't want xargs to stop when it hits an error
+a = subprocess.Popen("find instdir/program/ -name *.so | xargs echo nm --radix=d --size-sort --demangle | bash", stdout=subprocess.PIPE, shell=True)
+
+#xargs sh -c "somecommand || true"
+
+nameDict = defaultdict(int)
+with a.stdout as txt:
+    for line in txt:
+        line = line.strip()
+        idx1 = line.find(" ")
+        idx2 = line.find(" ", idx1 + 1)
+        name = line[idx2:]
+        nameDict[name] += 1
+
+sizeDict = defaultdict(set)
+for k, v in nameDict.iteritems():
+    sizeDict[v].add(k)
+
+cnt = 0
+for k in sorted(list(sizeDict), reverse=True):
+    print k
+    for v in sizeDict[k]:
+        print v
+    cnt += 1
+    if cnt > 100 : break
+
+#first = sorted(list(sizeDict))[-1]
+#print first
+
+
+#include/vcl/ITiledRenderable.hxx
+# why is gaLOKPointerMap declared inside this header?
diff --git a/i18nlangtag/source/languagetag/languagetag.cxx b/i18nlangtag/source/languagetag/languagetag.cxx
index fecfb0bd3703..ad9c2ceea898 100644
--- a/i18nlangtag/source/languagetag/languagetag.cxx
+++ b/i18nlangtag/source/languagetag/languagetag.cxx
@@ -561,6 +561,8 @@ LanguageTag::LanguageTag( const rtl_Locale & rLocale )
     convertFromRtlLocale();
 }
 
+LanguageTag::~LanguageTag() {}
+
 LanguageTag::ImplPtr LanguageTagImpl::registerOnTheFly( LanguageType nRegisterID )
 {
     LanguageTag::ImplPtr pImpl;
diff --git a/include/i18nlangtag/languagetag.hxx b/include/i18nlangtag/languagetag.hxx
index 08fc60dac933..385556eaae0c 100644
--- a/include/i18nlangtag/languagetag.hxx
+++ b/include/i18nlangtag/languagetag.hxx
@@ -107,6 +107,8 @@ public:
      */
     explicit LanguageTag( const rtl_Locale & rLocale );
 
+    ~LanguageTag();
+
     /** Obtain BCP 47 language tag.
 
         @param bResolveSystem
diff --git a/include/vcl/ITiledRenderable.hxx b/include/vcl/ITiledRenderable.hxx
index ae6e58b60da1..d0118e2d809a 100644
--- a/include/vcl/ITiledRenderable.hxx
+++ b/include/vcl/ITiledRenderable.hxx
@@ -31,56 +31,7 @@ namespace vcl
      * by css, it might turn out to be worth mapping some of these missing cursors
      * to available cursors?
      */
-#ifdef _MSC_VER
-#pragma warning(push)
-#pragma warning( disable : 4592)
-#endif
-    static const std::map <PointerStyle, OString> gaLOKPointerMap {
-    { PointerStyle::Arrow, "default" },
-    // PointerStyle::Null ?
-    { PointerStyle::Wait, "wait" },
-    { PointerStyle::Text, "text" },
-    { PointerStyle::Help, "help" },
-    { PointerStyle::Cross, "crosshair" },
-    { PointerStyle::Fill, "fill" },
-    { PointerStyle::Move, "move" },
-    { PointerStyle::NSize, "n-resize" },
-    { PointerStyle::SSize, "s-resize" },
-    { PointerStyle::WSize, "w-resize" },
-    { PointerStyle::ESize, "e-resize" },
-    { PointerStyle::NWSize, "ne-resize" },
-    { PointerStyle::NESize, "ne-resize" },
-    { PointerStyle::SWSize, "sw-resize" },
-    { PointerStyle::SESize, "se-resize" },
-    // WindowNSize through WindowSESize
-    { PointerStyle::HSplit, "col-resize" },
-    { PointerStyle::VSplit, "row-resize" },
-    { PointerStyle::HSizeBar, "col-resize" },
-    { PointerStyle::VSizeBar, "row-resize" },
-    { PointerStyle::Hand, "grab" },
-    { PointerStyle::RefHand, "pointer" },
-    // Pen, Magnify, Fill, Rotate
-    // HShear, VShear
-    // Mirror, Crook, Crop, MovePoint, MoveBezierWeight
-    // MoveData
-    { PointerStyle::CopyData, "copy" },
-    { PointerStyle::LinkData, "alias" },
-    // MoveDataLink, CopyDataLink
-    //MoveFile, CopyFile, LinkFile
-    // MoveFileLink, CopyFileLink, MoveFiless, CopyFiles
-    { PointerStyle::NotAllowed, "not-allowed" },
-    // DrawLine through DrawCaption
-    // Chart, Detective, PivotCol, PivotRow, PivotField, Chain, ChainNotAllowed
-    // TimeEventMove, TimeEventSize
-    // AutoScrollN through AutoScrollNSWE
-    // Airbrush
-    { PointerStyle::TextVertical, "vertical-text" }
-    // Pivot Delete, TabSelectS through TabSelectSW
-    // PaintBrush, HideWhiteSpace, ShowWhiteSpace
-    };
-#ifdef _MSC_VER
-#pragma warning(pop)
-#endif
+    extern const std::map <PointerStyle, OString> gaLOKPointerMap;
 
 
 class VCL_DLLPUBLIC ITiledRenderable
diff --git a/vcl/source/app/ITiledRenderable.cxx b/vcl/source/app/ITiledRenderable.cxx
index 3eb5dcd2da6e..eac1d72cbb6b 100644
--- a/vcl/source/app/ITiledRenderable.cxx
+++ b/vcl/source/app/ITiledRenderable.cxx
@@ -13,6 +13,66 @@
 namespace vcl
 {
 
+    /*
+     * Map directly to css cursor styles to avoid further mapping in the client.
+     * Gtk (via gdk_cursor_new_from_name) also supports the same css cursor styles.
+     *
+     * This was created partially with help of the mappings in gtkdata.cxx.
+     * The list is incomplete as some cursor style simply aren't supported
+     * by css, it might turn out to be worth mapping some of these missing cursors
+     * to available cursors?
+     */
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning( disable : 4592)
+#endif
+    const std::map <PointerStyle, OString> gaLOKPointerMap {
+    { PointerStyle::Arrow, "default" },
+    // PointerStyle::Null ?
+    { PointerStyle::Wait, "wait" },
+    { PointerStyle::Text, "text" },
+    { PointerStyle::Help, "help" },
+    { PointerStyle::Cross, "crosshair" },
+    { PointerStyle::Fill, "fill" },
+    { PointerStyle::Move, "move" },
+    { PointerStyle::NSize, "n-resize" },
+    { PointerStyle::SSize, "s-resize" },
+    { PointerStyle::WSize, "w-resize" },
+    { PointerStyle::ESize, "e-resize" },
+    { PointerStyle::NWSize, "ne-resize" },
+    { PointerStyle::NESize, "ne-resize" },
+    { PointerStyle::SWSize, "sw-resize" },
+    { PointerStyle::SESize, "se-resize" },
+    // WindowNSize through WindowSESize
+    { PointerStyle::HSplit, "col-resize" },
+    { PointerStyle::VSplit, "row-resize" },
+    { PointerStyle::HSizeBar, "col-resize" },
+    { PointerStyle::VSizeBar, "row-resize" },
+    { PointerStyle::Hand, "grab" },
+    { PointerStyle::RefHand, "pointer" },
+    // Pen, Magnify, Fill, Rotate
+    // HShear, VShear
+    // Mirror, Crook, Crop, MovePoint, MoveBezierWeight
+    // MoveData
+    { PointerStyle::CopyData, "copy" },
+    { PointerStyle::LinkData, "alias" },
+    // MoveDataLink, CopyDataLink
+    //MoveFile, CopyFile, LinkFile
+    // MoveFileLink, CopyFileLink, MoveFiless, CopyFiles
+    { PointerStyle::NotAllowed, "not-allowed" },
+    // DrawLine through DrawCaption
+    // Chart, Detective, PivotCol, PivotRow, PivotField, Chain, ChainNotAllowed
+    // TimeEventMove, TimeEventSize
+    // AutoScrollN through AutoScrollNSWE
+    // Airbrush
+    { PointerStyle::TextVertical, "vertical-text" }
+    // Pivot Delete, TabSelectS through TabSelectSW
+    // PaintBrush, HideWhiteSpace, ShowWhiteSpace
+    };
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
 ITiledRenderable::~ITiledRenderable()
 {
 }


More information about the Libreoffice-commits mailing list