Kaydet (Commit) a9585f34 authored tarafından Jan Holesovsky's avatar Jan Holesovsky

No need to use a macro here.

üst b1d4a2ae
...@@ -108,8 +108,7 @@ Reference<ui::XUIElement> SAL_CALL ScPanelFactory::createUIElement ( ...@@ -108,8 +108,7 @@ Reference<ui::XUIElement> SAL_CALL ScPanelFactory::createUIElement (
"PanelFactory::createUIElement called without SfxBindings", "PanelFactory::createUIElement called without SfxBindings",
NULL); NULL);
#define DoesResourceEndWith(s) rsResourceURL.endsWithAsciiL(s,strlen(s)) if (rsResourceURL.endsWith("/AlignmentPropertyPanel"))
if (DoesResourceEndWith("/AlignmentPropertyPanel"))
{ {
AlignmentPropertyPanel* pPanel = AlignmentPropertyPanel::Create( pParentWindow, xFrame, pBindings ); AlignmentPropertyPanel* pPanel = AlignmentPropertyPanel::Create( pParentWindow, xFrame, pBindings );
xElement = sfx2::sidebar::SidebarPanelBase::Create( xElement = sfx2::sidebar::SidebarPanelBase::Create(
...@@ -118,7 +117,7 @@ Reference<ui::XUIElement> SAL_CALL ScPanelFactory::createUIElement ( ...@@ -118,7 +117,7 @@ Reference<ui::XUIElement> SAL_CALL ScPanelFactory::createUIElement (
pPanel, pPanel,
ui::LayoutSize(-1,-1,-1)); ui::LayoutSize(-1,-1,-1));
} }
else if (DoesResourceEndWith("/CellAppearancePropertyPanel")) else if (rsResourceURL.endsWith("/CellAppearancePropertyPanel"))
{ {
CellAppearancePropertyPanel* pPanel = CellAppearancePropertyPanel::Create( pParentWindow, xFrame, pBindings ); CellAppearancePropertyPanel* pPanel = CellAppearancePropertyPanel::Create( pParentWindow, xFrame, pBindings );
xElement = sfx2::sidebar::SidebarPanelBase::Create( xElement = sfx2::sidebar::SidebarPanelBase::Create(
...@@ -127,7 +126,7 @@ Reference<ui::XUIElement> SAL_CALL ScPanelFactory::createUIElement ( ...@@ -127,7 +126,7 @@ Reference<ui::XUIElement> SAL_CALL ScPanelFactory::createUIElement (
pPanel, pPanel,
ui::LayoutSize(-1,-1,-1)); ui::LayoutSize(-1,-1,-1));
} }
else if (DoesResourceEndWith("/NumberFormatPropertyPanel")) else if (rsResourceURL.endsWith("/NumberFormatPropertyPanel"))
{ {
NumberFormatPropertyPanel* pPanel = NumberFormatPropertyPanel::Create( pParentWindow, xFrame, pBindings ); NumberFormatPropertyPanel* pPanel = NumberFormatPropertyPanel::Create( pParentWindow, xFrame, pBindings );
xElement = sfx2::sidebar::SidebarPanelBase::Create( xElement = sfx2::sidebar::SidebarPanelBase::Create(
...@@ -136,7 +135,7 @@ Reference<ui::XUIElement> SAL_CALL ScPanelFactory::createUIElement ( ...@@ -136,7 +135,7 @@ Reference<ui::XUIElement> SAL_CALL ScPanelFactory::createUIElement (
pPanel, pPanel,
ui::LayoutSize(-1,-1,-1)); ui::LayoutSize(-1,-1,-1));
} }
else if (DoesResourceEndWith("/NavigatorPanel")) else if (rsResourceURL.endsWith("/NavigatorPanel"))
{ {
vcl::Window* pPanel = new ScNavigatorDlg(pBindings, NULL, pParentWindow, false); vcl::Window* pPanel = new ScNavigatorDlg(pBindings, NULL, pParentWindow, false);
xElement = sfx2::sidebar::SidebarPanelBase::Create( xElement = sfx2::sidebar::SidebarPanelBase::Create(
...@@ -145,7 +144,7 @@ Reference<ui::XUIElement> SAL_CALL ScPanelFactory::createUIElement ( ...@@ -145,7 +144,7 @@ Reference<ui::XUIElement> SAL_CALL ScPanelFactory::createUIElement (
pPanel, pPanel,
ui::LayoutSize(0,-1,-1)); 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)); vcl::Window* pPanel = new ScFunctionDockWin(pBindings, NULL, pParentWindow, ScResId(FID_FUNCTION_BOX));
xElement = sfx2::sidebar::SidebarPanelBase::Create( xElement = sfx2::sidebar::SidebarPanelBase::Create(
...@@ -154,7 +153,6 @@ Reference<ui::XUIElement> SAL_CALL ScPanelFactory::createUIElement ( ...@@ -154,7 +153,6 @@ Reference<ui::XUIElement> SAL_CALL ScPanelFactory::createUIElement (
pPanel, pPanel,
ui::LayoutSize(0,-1,-1)); ui::LayoutSize(0,-1,-1));
} }
#undef DoesResourceEndWith
} }
catch (const uno::RuntimeException &) catch (const uno::RuntimeException &)
{ {
......
...@@ -102,8 +102,7 @@ Reference<ui::XUIElement> SAL_CALL SwPanelFactory::createUIElement ( ...@@ -102,8 +102,7 @@ Reference<ui::XUIElement> SAL_CALL SwPanelFactory::createUIElement (
"PanelFactory::createUIElement called without SfxBindings", "PanelFactory::createUIElement called without SfxBindings",
NULL); NULL);
#define DoesResourceEndWith(s) rsResourceURL.endsWithAsciiL(s,strlen(s)) if (rsResourceURL.endsWith("/PagePropertyPanel"))
if (DoesResourceEndWith("/PagePropertyPanel"))
{ {
sw::sidebar::PagePropertyPanel* pPanel = sw::sidebar::PagePropertyPanel::Create( pParentWindow, xFrame, pBindings ); sw::sidebar::PagePropertyPanel* pPanel = sw::sidebar::PagePropertyPanel::Create( pParentWindow, xFrame, pBindings );
xElement = sfx2::sidebar::SidebarPanelBase::Create( xElement = sfx2::sidebar::SidebarPanelBase::Create(
...@@ -112,7 +111,7 @@ Reference<ui::XUIElement> SAL_CALL SwPanelFactory::createUIElement ( ...@@ -112,7 +111,7 @@ Reference<ui::XUIElement> SAL_CALL SwPanelFactory::createUIElement (
pPanel, pPanel,
ui::LayoutSize(-1,-1,-1)); 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 ); sw::sidebar::WrapPropertyPanel* pPanel = sw::sidebar::WrapPropertyPanel::Create( pParentWindow, xFrame, pBindings );
xElement = sfx2::sidebar::SidebarPanelBase::Create( xElement = sfx2::sidebar::SidebarPanelBase::Create(
...@@ -121,7 +120,7 @@ Reference<ui::XUIElement> SAL_CALL SwPanelFactory::createUIElement ( ...@@ -121,7 +120,7 @@ Reference<ui::XUIElement> SAL_CALL SwPanelFactory::createUIElement (
pPanel, pPanel,
ui::LayoutSize(-1,-1,-1)); ui::LayoutSize(-1,-1,-1));
} }
else if (DoesResourceEndWith("/NavigatorPanel")) else if (rsResourceURL.endsWith("/NavigatorPanel"))
{ {
vcl::Window* pPanel = new SwNavigationPI(pBindings, NULL, pParentWindow); vcl::Window* pPanel = new SwNavigationPI(pBindings, NULL, pParentWindow);
xElement = sfx2::sidebar::SidebarPanelBase::Create( xElement = sfx2::sidebar::SidebarPanelBase::Create(
...@@ -130,7 +129,6 @@ Reference<ui::XUIElement> SAL_CALL SwPanelFactory::createUIElement ( ...@@ -130,7 +129,6 @@ Reference<ui::XUIElement> SAL_CALL SwPanelFactory::createUIElement (
pPanel, pPanel,
ui::LayoutSize(0,-1,-1)); ui::LayoutSize(0,-1,-1));
} }
#undef DoesResourceEndWith
return xElement; return xElement;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment