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

Jan Holesovsky kendy at collabora.com
Fri Feb 6 02:01:51 PST 2015


 oox/source/export/shapes.cxx |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

New commits:
commit f2f3dd240bf90b2f66de90fb6fe03f83a9024297
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Fri Feb 6 11:00:47 2015 +0100

    static const to avoid re-init all the time + c++11.
    
    Change-Id: I24ac6405f03e2d55f832d1ffe0c71e575883c5c8

diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index a96831e..2d040c7 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -281,7 +281,7 @@ ShapeExport& ShapeExport::WriteGroupShape(uno::Reference<drawing::XShape> xShape
 
 static bool lcl_IsOnBlacklist(OUString& rShapeType)
 {
-    OUString aBlacklist[] = {
+    static const std::vector<OUString> vBlacklist = {
             "ring",
             "can",
             "cube",
@@ -336,18 +336,16 @@ static bool lcl_IsOnBlacklist(OUString& rShapeType)
             "flowchart-direct-access-storage",
             "flowchart-display"
     };
-    std::vector<OUString> vBlacklist(aBlacklist, aBlacklist + SAL_N_ELEMENTS(aBlacklist));
 
     return std::find(vBlacklist.begin(), vBlacklist.end(), rShapeType) != vBlacklist.end();
 }
 
 static bool lcl_IsOnWhitelist(OUString& rShapeType)
 {
-    OUString aWhitelist[] = {
+    static const std::vector<OUString> vWhitelist = {
             "heart",
             "puzzle"
     };
-    std::vector<OUString> vWhitelist(aWhitelist, aWhitelist + SAL_N_ELEMENTS(aWhitelist));
 
     return std::find(vWhitelist.begin(), vWhitelist.end(), rShapeType) != vWhitelist.end();
 }


More information about the Libreoffice-commits mailing list