[Libreoffice-commits] core.git: sc/source sw/source

Jan Holesovsky kendy at collabora.com
Tue Dec 9 06:07:24 PST 2014


 sc/source/ui/sidebar/ScPanelFactory.cxx     |   12 +++++-------
 sw/source/uibase/sidebar/SwPanelFactory.cxx |    8 +++-----
 2 files changed, 8 insertions(+), 12 deletions(-)

New commits:
commit a9585f343b1642c119721de23dccf748de3c094a
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Tue Dec 9 14:56:31 2014 +0100

    No need to use a macro here.

diff --git a/sc/source/ui/sidebar/ScPanelFactory.cxx b/sc/source/ui/sidebar/ScPanelFactory.cxx
index 6f7fdf9..a53ae72 100644
--- a/sc/source/ui/sidebar/ScPanelFactory.cxx
+++ b/sc/source/ui/sidebar/ScPanelFactory.cxx
@@ -108,8 +108,7 @@ Reference<ui::XUIElement> SAL_CALL ScPanelFactory::createUIElement (
                 "PanelFactory::createUIElement called without SfxBindings",
                 NULL);
 
-    #define DoesResourceEndWith(s) rsResourceURL.endsWithAsciiL(s,strlen(s))
-        if (DoesResourceEndWith("/AlignmentPropertyPanel"))
+        if (rsResourceURL.endsWith("/AlignmentPropertyPanel"))
         {
             AlignmentPropertyPanel* pPanel = AlignmentPropertyPanel::Create( pParentWindow, xFrame, pBindings );
             xElement = sfx2::sidebar::SidebarPanelBase::Create(
@@ -118,7 +117,7 @@ Reference<ui::XUIElement> SAL_CALL ScPanelFactory::createUIElement (
                 pPanel,
                 ui::LayoutSize(-1,-1,-1));
         }
-        else if (DoesResourceEndWith("/CellAppearancePropertyPanel"))
+        else if (rsResourceURL.endsWith("/CellAppearancePropertyPanel"))
         {
             CellAppearancePropertyPanel* pPanel = CellAppearancePropertyPanel::Create( pParentWindow, xFrame, pBindings );
             xElement = sfx2::sidebar::SidebarPanelBase::Create(
@@ -127,7 +126,7 @@ Reference<ui::XUIElement> SAL_CALL ScPanelFactory::createUIElement (
                 pPanel,
                 ui::LayoutSize(-1,-1,-1));
         }
-        else if (DoesResourceEndWith("/NumberFormatPropertyPanel"))
+        else if (rsResourceURL.endsWith("/NumberFormatPropertyPanel"))
         {
             NumberFormatPropertyPanel* pPanel = NumberFormatPropertyPanel::Create( pParentWindow, xFrame, pBindings );
             xElement = sfx2::sidebar::SidebarPanelBase::Create(
@@ -136,7 +135,7 @@ Reference<ui::XUIElement> SAL_CALL ScPanelFactory::createUIElement (
                 pPanel,
                 ui::LayoutSize(-1,-1,-1));
         }
-        else if (DoesResourceEndWith("/NavigatorPanel"))
+        else if (rsResourceURL.endsWith("/NavigatorPanel"))
         {
             vcl::Window* pPanel = new ScNavigatorDlg(pBindings, NULL, pParentWindow, false);
             xElement = sfx2::sidebar::SidebarPanelBase::Create(
@@ -145,7 +144,7 @@ Reference<ui::XUIElement> SAL_CALL ScPanelFactory::createUIElement (
                 pPanel,
                 ui::LayoutSize(0,-1,-1));
         }
-        else if (DoesResourceEndWith("/FunctionsPanel"))
+        else if (rsResourceURL.endsWith("/FunctionsPanel"))
         {
             vcl::Window* pPanel = new ScFunctionDockWin(pBindings, NULL, pParentWindow, ScResId(FID_FUNCTION_BOX));
             xElement = sfx2::sidebar::SidebarPanelBase::Create(
@@ -154,7 +153,6 @@ Reference<ui::XUIElement> SAL_CALL ScPanelFactory::createUIElement (
                 pPanel,
                 ui::LayoutSize(0,-1,-1));
         }
-#undef DoesResourceEndWith
     }
     catch (const uno::RuntimeException &)
     {
diff --git a/sw/source/uibase/sidebar/SwPanelFactory.cxx b/sw/source/uibase/sidebar/SwPanelFactory.cxx
index f2c085e..4acd661 100644
--- a/sw/source/uibase/sidebar/SwPanelFactory.cxx
+++ b/sw/source/uibase/sidebar/SwPanelFactory.cxx
@@ -102,8 +102,7 @@ Reference<ui::XUIElement> SAL_CALL SwPanelFactory::createUIElement (
             "PanelFactory::createUIElement called without SfxBindings",
             NULL);
 
-#define DoesResourceEndWith(s) rsResourceURL.endsWithAsciiL(s,strlen(s))
-    if (DoesResourceEndWith("/PagePropertyPanel"))
+    if (rsResourceURL.endsWith("/PagePropertyPanel"))
     {
         sw::sidebar::PagePropertyPanel* pPanel = sw::sidebar::PagePropertyPanel::Create( pParentWindow, xFrame, pBindings );
         xElement = sfx2::sidebar::SidebarPanelBase::Create(
@@ -112,7 +111,7 @@ Reference<ui::XUIElement> SAL_CALL SwPanelFactory::createUIElement (
             pPanel,
             ui::LayoutSize(-1,-1,-1));
     }
-    else if (DoesResourceEndWith("/WrapPropertyPanel"))
+    else if (rsResourceURL.endsWith("/WrapPropertyPanel"))
     {
         sw::sidebar::WrapPropertyPanel* pPanel = sw::sidebar::WrapPropertyPanel::Create( pParentWindow, xFrame, pBindings );
         xElement = sfx2::sidebar::SidebarPanelBase::Create(
@@ -121,7 +120,7 @@ Reference<ui::XUIElement> SAL_CALL SwPanelFactory::createUIElement (
             pPanel,
             ui::LayoutSize(-1,-1,-1));
     }
-    else if (DoesResourceEndWith("/NavigatorPanel"))
+    else if (rsResourceURL.endsWith("/NavigatorPanel"))
     {
         vcl::Window* pPanel = new SwNavigationPI(pBindings, NULL, pParentWindow);
         xElement = sfx2::sidebar::SidebarPanelBase::Create(
@@ -130,7 +129,6 @@ Reference<ui::XUIElement> SAL_CALL SwPanelFactory::createUIElement (
             pPanel,
             ui::LayoutSize(0,-1,-1));
     }
-#undef DoesResourceEndWith
 
     return xElement;
 }


More information about the Libreoffice-commits mailing list