16#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
17#include <com/sun/star/ui/XPanel.hpp>
36 return SidebarController::GetSidebarControllerForFrame(
xFrame);
53 throw container::NoSuchElementException();
67 ResourceManager::PanelContextDescriptorContainer aPanels;
68 uno::Sequence< OUString > panelList(aPanels.size());
70 if (pSidebarController)
72 pSidebarController->GetResourceManager()->GetMatchingPanels(aPanels,
73 pSidebarController->GetCurrentContext(),
77 panelList.realloc(aPanels.size());
78 std::transform(aPanels.begin(), aPanels.end(), panelList.getArray(),
79 [](
const auto& rPanel) { return rPanel.msId; });
92 if (pSidebarController)
94 ResourceManager::PanelContextDescriptorContainer aPanels;
96 pSidebarController->GetResourceManager()->GetMatchingPanels(aPanels,
97 pSidebarController->GetCurrentContext(),
101 bool bIsDocumentReadOnly = pSidebarController->IsDocumentReadOnly();
103 return std::any_of(aPanels.begin(), aPanels.end(),
104 [&bIsDocumentReadOnly, &
aName](
const ResourceManager::PanelContextDescriptor& rPanel) {
105 return (!bIsDocumentReadOnly || rPanel.mbShowForReadOnlyDocuments)
106 && (rPanel.msId == aName);
122 return panels.getLength();
133 if (
Index > panels.getLength()-1 ||
Index < 0)
134 throw lang::IndexOutOfBoundsException();
153 return panels.hasElements();
virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override
const css::uno::Reference< css::frame::XFrame > xFrame
virtual sal_Bool SAL_CALL hasElements() override
virtual css::uno::Any SAL_CALL getByName(const OUString &aName) override
sfx2::sidebar::SidebarController * getSidebarController()
SfxUnoPanels(css::uno::Reference< css::frame::XFrame >, const OUString &)
virtual sal_Int32 SAL_CALL getCount() override
virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 Index) override
virtual css::uno::Type SAL_CALL getElementType() override
virtual sal_Bool SAL_CALL hasByName(const OUString &aName) override
virtual OUString SAL_CALL getDeckId() override
Reference< XFrame > xFrame