xref: /aoo42x/main/sfx2/source/sidebar/TabBar.cxx (revision 101538fc)
122de8995SAndre Fischer /**************************************************************
222de8995SAndre Fischer  *
322de8995SAndre Fischer  * Licensed to the Apache Software Foundation (ASF) under one
422de8995SAndre Fischer  * or more contributor license agreements.  See the NOTICE file
522de8995SAndre Fischer  * distributed with this work for additional information
622de8995SAndre Fischer  * regarding copyright ownership.  The ASF licenses this file
722de8995SAndre Fischer  * to you under the Apache License, Version 2.0 (the
822de8995SAndre Fischer  * "License"); you may not use this file except in compliance
922de8995SAndre Fischer  * with the License.  You may obtain a copy of the License at
1022de8995SAndre Fischer  *
1122de8995SAndre Fischer  *   http://www.apache.org/licenses/LICENSE-2.0
1222de8995SAndre Fischer  *
1322de8995SAndre Fischer  * Unless required by applicable law or agreed to in writing,
1422de8995SAndre Fischer  * software distributed under the License is distributed on an
1522de8995SAndre Fischer  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1622de8995SAndre Fischer  * KIND, either express or implied.  See the License for the
1722de8995SAndre Fischer  * specific language governing permissions and limitations
1822de8995SAndre Fischer  * under the License.
1922de8995SAndre Fischer  *
2022de8995SAndre Fischer  *************************************************************/
2122de8995SAndre Fischer 
2222de8995SAndre Fischer #include "precompiled_sfx2.hxx"
2322de8995SAndre Fischer 
2422de8995SAndre Fischer #include "TabBar.hxx"
25ff12d537SAndre Fischer #include "TabItem.hxx"
2695a18594SAndre Fischer #include "sidebar/ControlFactory.hxx"
27ff12d537SAndre Fischer #include "DeckDescriptor.hxx"
28ff12d537SAndre Fischer #include "Paint.hxx"
29b9e67834SAndre Fischer #include "sfx2/sidebar/Theme.hxx"
30f35c6d02SAndre Fischer #include "sfx2/sidebar/Tools.hxx"
3165908a7eSAndre Fischer #include "FocusManager.hxx"
32ff12d537SAndre Fischer 
3322de8995SAndre Fischer #include <vcl/gradient.hxx>
34ff12d537SAndre Fischer #include <vcl/image.hxx>
357a32b0c8SAndre Fischer #include <vcl/wrkwin.hxx>
36ff12d537SAndre Fischer #include <comphelper/processfactory.hxx>
37ff12d537SAndre Fischer #include <comphelper/componentcontext.hxx>
3895a18594SAndre Fischer #include <tools/svborder.hxx>
39ff12d537SAndre Fischer 
40ff12d537SAndre Fischer #include <com/sun/star/graphic/XGraphicProvider.hpp>
41ff12d537SAndre Fischer 
42ff12d537SAndre Fischer 
43ff12d537SAndre Fischer using namespace ::com::sun::star;
44ff12d537SAndre Fischer using namespace ::com::sun::star::uno;
45ff12d537SAndre Fischer 
46ff12d537SAndre Fischer 
47ff12d537SAndre Fischer 
4822de8995SAndre Fischer 
49ff12d537SAndre Fischer namespace sfx2 { namespace sidebar {
5022de8995SAndre Fischer 
51ff12d537SAndre Fischer TabBar::TabBar (
52ff12d537SAndre Fischer     Window* pParentWindow,
53ff12d537SAndre Fischer     const Reference<frame::XFrame>& rxFrame,
5495a18594SAndre Fischer     const ::boost::function<void(const ::rtl::OUString&)>& rDeckActivationFunctor,
5595a18594SAndre Fischer     const PopupMenuProvider& rPopupMenuProvider)
5665908a7eSAndre Fischer     : Window(pParentWindow, WB_DIALOGCONTROL),
57ff12d537SAndre Fischer       mxFrame(rxFrame),
58ff12d537SAndre Fischer       mpMenuButton(ControlFactory::CreateMenuButton(this)),
59ff12d537SAndre Fischer       maItems(),
60ff12d537SAndre Fischer       maDeckActivationFunctor(rDeckActivationFunctor),
61ff12d537SAndre Fischer       maPopupMenuProvider(rPopupMenuProvider)
6222de8995SAndre Fischer {
63b9e67834SAndre Fischer     SetBackground(Theme::GetPaint(Theme::Paint_TabBarBackground).GetWallpaper());
64ff12d537SAndre Fischer 
65ff12d537SAndre Fischer     mpMenuButton->SetModeImage(
667a32b0c8SAndre Fischer         Theme::GetImage(Theme::Image_TabBarMenu),
67ff12d537SAndre Fischer         Theme::IsHighContrastMode()
68ff12d537SAndre Fischer             ? BMP_COLOR_HIGHCONTRAST
69ff12d537SAndre Fischer             : BMP_COLOR_NORMAL);
70ff12d537SAndre Fischer     mpMenuButton->SetClickHdl(LINK(this, TabBar, OnToolboxClicked));
7195a18594SAndre Fischer     Layout();
727a32b0c8SAndre Fischer 
737a32b0c8SAndre Fischer #ifdef DEBUG
747a32b0c8SAndre Fischer     SetText(A2S("TabBar"));
757a32b0c8SAndre Fischer #endif
7622de8995SAndre Fischer }
7722de8995SAndre Fischer 
7822de8995SAndre Fischer 
7922de8995SAndre Fischer 
8022de8995SAndre Fischer 
8122de8995SAndre Fischer TabBar::~TabBar (void)
8222de8995SAndre Fischer {
8322de8995SAndre Fischer }
8422de8995SAndre Fischer 
8522de8995SAndre Fischer 
8622de8995SAndre Fischer 
8722de8995SAndre Fischer 
8822de8995SAndre Fischer void TabBar::Paint (const Rectangle& rUpdateArea)
8922de8995SAndre Fischer {
90ff12d537SAndre Fischer     Window::Paint(rUpdateArea);
91ff12d537SAndre Fischer 
92b9e67834SAndre Fischer     const sal_Int32 nHorizontalPadding (Theme::GetInteger(Theme::Int_TabMenuSeparatorPadding));
93b9e67834SAndre Fischer     SetLineColor(Theme::GetColor(Theme::Color_TabMenuSeparator));
94ff12d537SAndre Fischer     DrawLine(
95ff12d537SAndre Fischer         Point(nHorizontalPadding, mnMenuSeparatorY),
96ff12d537SAndre Fischer         Point(GetSizePixel().Width()-nHorizontalPadding, mnMenuSeparatorY));
9722de8995SAndre Fischer }
9822de8995SAndre Fischer 
9922de8995SAndre Fischer 
10022de8995SAndre Fischer 
10122de8995SAndre Fischer 
10222de8995SAndre Fischer sal_Int32 TabBar::GetDefaultWidth (void)
10322de8995SAndre Fischer {
104b9e67834SAndre Fischer     return Theme::GetInteger(Theme::Int_TabItemWidth)
105b9e67834SAndre Fischer         + Theme::GetInteger(Theme::Int_TabBarLeftPadding)
106b9e67834SAndre Fischer         + Theme::GetInteger(Theme::Int_TabBarRightPadding);
107ff12d537SAndre Fischer }
108ff12d537SAndre Fischer 
109ff12d537SAndre Fischer 
110ff12d537SAndre Fischer 
111ff12d537SAndre Fischer 
112ff12d537SAndre Fischer void TabBar::SetDecks (
11313e1c3b4SAndre Fischer     const ResourceManager::DeckContextDescriptorContainer& rDecks)
114ff12d537SAndre Fischer {
115ff12d537SAndre Fischer     // Remove the current buttons.
116ff12d537SAndre Fischer     {
1177a32b0c8SAndre Fischer         for(ItemContainer::iterator
118ff12d537SAndre Fischer                 iItem(maItems.begin()), iEnd(maItems.end());
119ff12d537SAndre Fischer             iItem!=iEnd;
120ff12d537SAndre Fischer             ++iItem)
121ff12d537SAndre Fischer         {
1227a32b0c8SAndre Fischer             iItem->mpButton.reset();
123ff12d537SAndre Fischer         }
124ff12d537SAndre Fischer         maItems.clear();
125ff12d537SAndre Fischer     }
126ff12d537SAndre Fischer 
12713e1c3b4SAndre Fischer     maItems.resize(rDecks.size());
128ff12d537SAndre Fischer     sal_Int32 nIndex (0);
12913e1c3b4SAndre Fischer     for (ResourceManager::DeckContextDescriptorContainer::const_iterator
13013e1c3b4SAndre Fischer              iDeck(rDecks.begin()),
13113e1c3b4SAndre Fischer              iEnd(rDecks.end());
13213e1c3b4SAndre Fischer          iDeck!=iEnd;
13313e1c3b4SAndre Fischer          ++iDeck)
134ff12d537SAndre Fischer     {
13513e1c3b4SAndre Fischer         const DeckDescriptor* pDescriptor = ResourceManager::Instance().GetDeckDescriptor(iDeck->msId);
13695a18594SAndre Fischer         if (pDescriptor == NULL)
13795a18594SAndre Fischer         {
13895a18594SAndre Fischer             OSL_ASSERT(pDescriptor!=NULL);
13995a18594SAndre Fischer             continue;
14095a18594SAndre Fischer         }
14195a18594SAndre Fischer 
142ff12d537SAndre Fischer         Item& rItem (maItems[nIndex++]);
14395a18594SAndre Fischer         rItem.msDeckId = pDescriptor->msId;
1447a32b0c8SAndre Fischer         rItem.mpButton.reset(CreateTabItem(*pDescriptor));
145ff12d537SAndre Fischer         rItem.mpButton->SetClickHdl(LINK(&rItem, TabBar::Item, HandleClick));
146ff12d537SAndre Fischer         rItem.maDeckActivationFunctor = maDeckActivationFunctor;
147ff12d537SAndre Fischer         rItem.mbIsHiddenByDefault = false;
14895a18594SAndre Fischer         rItem.mbIsHidden = ! pDescriptor->mbIsEnabled;
14913e1c3b4SAndre Fischer 
15013e1c3b4SAndre Fischer         rItem.mpButton->Enable(iDeck->mbIsEnabled);
151ff12d537SAndre Fischer     }
152ff12d537SAndre Fischer 
153ff12d537SAndre Fischer     UpdateButtonIcons();
154ff12d537SAndre Fischer     Layout();
155ff12d537SAndre Fischer }
156ff12d537SAndre Fischer 
157ff12d537SAndre Fischer 
158ff12d537SAndre Fischer 
159ff12d537SAndre Fischer 
160ff12d537SAndre Fischer void TabBar::UpdateButtonIcons (void)
161ff12d537SAndre Fischer {
162ff12d537SAndre Fischer     const BmpColorMode eColorMode (
163ff12d537SAndre Fischer         Theme::IsHighContrastMode()
164ff12d537SAndre Fischer             ? BMP_COLOR_HIGHCONTRAST
165ff12d537SAndre Fischer             : BMP_COLOR_NORMAL);
166ff12d537SAndre Fischer 
1677a32b0c8SAndre Fischer     mpMenuButton->SetModeImage(Theme::GetImage(Theme::Image_TabBarMenu), eColorMode);
168ff12d537SAndre Fischer 
169ff12d537SAndre Fischer     for(ItemContainer::const_iterator
170ff12d537SAndre Fischer             iItem(maItems.begin()), iEnd(maItems.end());
171ff12d537SAndre Fischer         iItem!=iEnd;
172ff12d537SAndre Fischer         ++iItem)
173ff12d537SAndre Fischer     {
17495a18594SAndre Fischer         const DeckDescriptor* pDeckDescriptor = ResourceManager::Instance().GetDeckDescriptor(iItem->msDeckId);
17595a18594SAndre Fischer         if (pDeckDescriptor != NULL)
17695a18594SAndre Fischer             iItem->mpButton->SetModeImage(
17795a18594SAndre Fischer                 GetItemImage(*pDeckDescriptor),
17895a18594SAndre Fischer                 eColorMode);
179ff12d537SAndre Fischer     }
18095a18594SAndre Fischer 
18195a18594SAndre Fischer     Invalidate();
182ff12d537SAndre Fischer }
183ff12d537SAndre Fischer 
184ff12d537SAndre Fischer 
185ff12d537SAndre Fischer 
186ff12d537SAndre Fischer 
187ff12d537SAndre Fischer void TabBar::Layout (void)
188ff12d537SAndre Fischer {
189b9e67834SAndre Fischer     const SvBorder aPadding (
190b9e67834SAndre Fischer         Theme::GetInteger(Theme::Int_TabBarLeftPadding),
191b9e67834SAndre Fischer         Theme::GetInteger(Theme::Int_TabBarTopPadding),
192b9e67834SAndre Fischer         Theme::GetInteger(Theme::Int_TabBarRightPadding),
193b9e67834SAndre Fischer         Theme::GetInteger(Theme::Int_TabBarBottomPadding));
194ff12d537SAndre Fischer     sal_Int32 nX (aPadding.Top());
195ff12d537SAndre Fischer     sal_Int32 nY (aPadding.Left());
196b9e67834SAndre Fischer     const Size aTabItemSize (
197b9e67834SAndre Fischer         Theme::GetInteger(Theme::Int_TabItemWidth),
198b9e67834SAndre Fischer         Theme::GetInteger(Theme::Int_TabItemHeight));
199ff12d537SAndre Fischer 
20095a18594SAndre Fischer     // Place the menu button and the separator.
201ff12d537SAndre Fischer     if (mpMenuButton != NULL)
202ff12d537SAndre Fischer     {
203ff12d537SAndre Fischer         mpMenuButton->SetPosSizePixel(
204ff12d537SAndre Fischer             Point(nX,nY),
205b9e67834SAndre Fischer             aTabItemSize);
206ff12d537SAndre Fischer         mpMenuButton->Show();
207b9e67834SAndre Fischer         nY += mpMenuButton->GetSizePixel().Height() + 1 + Theme::GetInteger(Theme::Int_TabMenuPadding);
208b9e67834SAndre Fischer         mnMenuSeparatorY = nY - Theme::GetInteger(Theme::Int_TabMenuPadding)/2 - 1;
209ff12d537SAndre Fischer     }
21095a18594SAndre Fischer 
21195a18594SAndre Fischer     // Place the deck selection buttons.
212ff12d537SAndre Fischer     for(ItemContainer::const_iterator
213ff12d537SAndre Fischer             iItem(maItems.begin()), iEnd(maItems.end());
214ff12d537SAndre Fischer         iItem!=iEnd;
215ff12d537SAndre Fischer         ++iItem)
216ff12d537SAndre Fischer     {
21795a18594SAndre Fischer         Button& rButton (*iItem->mpButton);
21895a18594SAndre Fischer         rButton.Show( ! iItem->mbIsHidden);
21995a18594SAndre Fischer 
220ff12d537SAndre Fischer         if (iItem->mbIsHidden)
221ff12d537SAndre Fischer             continue;
222ff12d537SAndre Fischer 
223ff12d537SAndre Fischer         // Place and size the icon.
224ff12d537SAndre Fischer         rButton.SetPosSizePixel(
225ff12d537SAndre Fischer             Point(nX,nY),
226b9e67834SAndre Fischer             aTabItemSize);
227ff12d537SAndre Fischer         rButton.Show();
228ff12d537SAndre Fischer 
229ff12d537SAndre Fischer         nY += rButton.GetSizePixel().Height() + 1 + aPadding.Bottom();
230ff12d537SAndre Fischer     }
231ff12d537SAndre Fischer     Invalidate();
232ff12d537SAndre Fischer }
233ff12d537SAndre Fischer 
234ff12d537SAndre Fischer 
235ff12d537SAndre Fischer 
236ff12d537SAndre Fischer 
237ff12d537SAndre Fischer void TabBar::HighlightDeck (const ::rtl::OUString& rsDeckId)
238ff12d537SAndre Fischer {
23913e1c3b4SAndre Fischer     Item* pItem = GetItemForId(rsDeckId);
24013e1c3b4SAndre Fischer     if (pItem != NULL)
24113e1c3b4SAndre Fischer         pItem->mpButton->Check();
24213e1c3b4SAndre Fischer }
24313e1c3b4SAndre Fischer 
24413e1c3b4SAndre Fischer 
24513e1c3b4SAndre Fischer 
24613e1c3b4SAndre Fischer 
24713e1c3b4SAndre Fischer TabBar::Item* TabBar::GetItemForId (const ::rtl::OUString& rsDeckId)
24813e1c3b4SAndre Fischer {
24913e1c3b4SAndre Fischer     for (ItemContainer::iterator iItem(maItems.begin()),iEnd(maItems.end());
250ff12d537SAndre Fischer          iItem!=iEnd;
251ff12d537SAndre Fischer          ++iItem)
252ff12d537SAndre Fischer     {
25395a18594SAndre Fischer         if (iItem->msDeckId.equals(rsDeckId))
25413e1c3b4SAndre Fischer             return &*iItem;
255ff12d537SAndre Fischer     }
25613e1c3b4SAndre Fischer     return NULL;
257ff12d537SAndre Fischer }
258ff12d537SAndre Fischer 
259ff12d537SAndre Fischer 
260ff12d537SAndre Fischer 
261ff12d537SAndre Fischer 
262ff12d537SAndre Fischer void TabBar::DataChanged (const DataChangedEvent& rDataChangedEvent)
263ff12d537SAndre Fischer {
26495a18594SAndre Fischer     SetBackground(Theme::GetPaint(Theme::Paint_TabBarBackground).GetWallpaper());
26595a18594SAndre Fischer     UpdateButtonIcons();
26695a18594SAndre Fischer 
26795a18594SAndre Fischer     Window::DataChanged(rDataChangedEvent);
268ff12d537SAndre Fischer }
269ff12d537SAndre Fischer 
270ff12d537SAndre Fischer 
271ff12d537SAndre Fischer 
272ff12d537SAndre Fischer 
273*101538fcSAndre Fischer long TabBar::Notify (NotifyEvent& rEvent)
274*101538fcSAndre Fischer {
275*101538fcSAndre Fischer     return sal_False;
276*101538fcSAndre Fischer }
277*101538fcSAndre Fischer 
278*101538fcSAndre Fischer 
279*101538fcSAndre Fischer 
280*101538fcSAndre Fischer 
281ff12d537SAndre Fischer RadioButton* TabBar::CreateTabItem (const DeckDescriptor& rDeckDescriptor)
282ff12d537SAndre Fischer {
283ff12d537SAndre Fischer     RadioButton* pItem = ControlFactory::CreateTabItem(this);
284ff12d537SAndre Fischer     pItem->SetHelpText(rDeckDescriptor.msHelpText);
285ff12d537SAndre Fischer     pItem->SetQuickHelpText(rDeckDescriptor.msHelpText);
286ff12d537SAndre Fischer 
287ff12d537SAndre Fischer     return pItem;
28822de8995SAndre Fischer }
28922de8995SAndre Fischer 
29022de8995SAndre Fischer 
291ff12d537SAndre Fischer 
292ff12d537SAndre Fischer Image TabBar::GetItemImage (const DeckDescriptor& rDeckDescriptor) const
293ff12d537SAndre Fischer {
294b9e67834SAndre Fischer     return Tools::GetImage(
295b9e67834SAndre Fischer         rDeckDescriptor.msIconURL,
296b9e67834SAndre Fischer         rDeckDescriptor.msHighContrastIconURL,
297b9e67834SAndre Fischer         mxFrame);
298ff12d537SAndre Fischer }
299ff12d537SAndre Fischer 
300ff12d537SAndre Fischer 
301ff12d537SAndre Fischer 
302ff12d537SAndre Fischer 
303ff12d537SAndre Fischer 
30495a18594SAndre Fischer IMPL_LINK(TabBar::Item, HandleClick, Button*, EMPTYARG)
305ff12d537SAndre Fischer {
30695a18594SAndre Fischer     maDeckActivationFunctor(msDeckId);
30795a18594SAndre Fischer     return 1;
308ff12d537SAndre Fischer }
309ff12d537SAndre Fischer 
310ff12d537SAndre Fischer 
311ff12d537SAndre Fischer 
312ff12d537SAndre Fischer 
31395a18594SAndre Fischer const ::rtl::OUString TabBar::GetDeckIdForIndex (const sal_Int32 nIndex) const
314ff12d537SAndre Fischer {
31595a18594SAndre Fischer     if (nIndex<0 || static_cast<size_t>(nIndex)>=maItems.size())
316ff12d537SAndre Fischer         throw RuntimeException();
317ff12d537SAndre Fischer     else
31895a18594SAndre Fischer         return maItems[nIndex].msDeckId;
319ff12d537SAndre Fischer }
320ff12d537SAndre Fischer 
321ff12d537SAndre Fischer 
322ff12d537SAndre Fischer 
323ff12d537SAndre Fischer 
324ff12d537SAndre Fischer void TabBar::ToggleHideFlag (const sal_Int32 nIndex)
325ff12d537SAndre Fischer {
32695a18594SAndre Fischer     if (nIndex<0 || static_cast<size_t>(nIndex)>=maItems.size())
327ff12d537SAndre Fischer         throw RuntimeException();
328ff12d537SAndre Fischer     else
329ff12d537SAndre Fischer     {
330ff12d537SAndre Fischer         maItems[nIndex].mbIsHidden = ! maItems[nIndex].mbIsHidden;
33195a18594SAndre Fischer         ResourceManager::Instance().SetIsDeckEnabled(
33295a18594SAndre Fischer             maItems[nIndex].msDeckId,
33395a18594SAndre Fischer             maItems[nIndex].mbIsHidden);
334ff12d537SAndre Fischer         Layout();
335ff12d537SAndre Fischer     }
336ff12d537SAndre Fischer }
337ff12d537SAndre Fischer 
338ff12d537SAndre Fischer 
339ff12d537SAndre Fischer 
340ff12d537SAndre Fischer 
341ff12d537SAndre Fischer void TabBar::RestoreHideFlags (void)
342ff12d537SAndre Fischer {
343ff12d537SAndre Fischer     bool bNeedsLayout (false);
344ff12d537SAndre Fischer     for(ItemContainer::iterator iItem(maItems.begin()),iEnd(maItems.end());
345ff12d537SAndre Fischer         iItem!=iEnd;
346ff12d537SAndre Fischer         ++iItem)
347ff12d537SAndre Fischer     {
348ff12d537SAndre Fischer         if (iItem->mbIsHidden != iItem->mbIsHiddenByDefault)
349ff12d537SAndre Fischer         {
350ff12d537SAndre Fischer             iItem->mbIsHidden = iItem->mbIsHiddenByDefault;
351ff12d537SAndre Fischer             bNeedsLayout = true;
352ff12d537SAndre Fischer         }
353ff12d537SAndre Fischer     }
354ff12d537SAndre Fischer     if (bNeedsLayout)
355ff12d537SAndre Fischer         Layout();
356ff12d537SAndre Fischer }
357ff12d537SAndre Fischer 
358ff12d537SAndre Fischer 
359ff12d537SAndre Fischer 
360ff12d537SAndre Fischer 
36165908a7eSAndre Fischer void TabBar::UpdateFocusManager (FocusManager& rFocusManager)
36265908a7eSAndre Fischer {
36365908a7eSAndre Fischer     ::std::vector<Button*> aButtons;
36465908a7eSAndre Fischer     aButtons.reserve(maItems.size()+1);
36565908a7eSAndre Fischer 
36665908a7eSAndre Fischer     aButtons.push_back(mpMenuButton.get());
36765908a7eSAndre Fischer     for(ItemContainer::const_iterator
36865908a7eSAndre Fischer             iItem(maItems.begin()), iEnd(maItems.end());
36965908a7eSAndre Fischer         iItem!=iEnd;
37065908a7eSAndre Fischer         ++iItem)
37165908a7eSAndre Fischer     {
37265908a7eSAndre Fischer         aButtons.push_back(iItem->mpButton.get());
37365908a7eSAndre Fischer     }
37465908a7eSAndre Fischer     rFocusManager.SetButtons(aButtons);
37565908a7eSAndre Fischer }
37665908a7eSAndre Fischer 
37765908a7eSAndre Fischer 
37865908a7eSAndre Fischer 
37965908a7eSAndre Fischer 
38095a18594SAndre Fischer IMPL_LINK(TabBar, OnToolboxClicked, void*, EMPTYARG)
381ff12d537SAndre Fischer {
38295a18594SAndre Fischer     ::std::vector<DeckMenuData> aSelectionData;
38395a18594SAndre Fischer     ::std::vector<DeckMenuData> aShowData;
38495a18594SAndre Fischer 
38595a18594SAndre Fischer     for(ItemContainer::const_iterator iItem(maItems.begin()),iEnd(maItems.end());
38695a18594SAndre Fischer         iItem!=iEnd;
38795a18594SAndre Fischer         ++iItem)
38895a18594SAndre Fischer     {
38995a18594SAndre Fischer         const DeckDescriptor* pDeckDescriptor = ResourceManager::Instance().GetDeckDescriptor(iItem->msDeckId);
39095a18594SAndre Fischer         if (pDeckDescriptor != NULL)
39195a18594SAndre Fischer         {
39295a18594SAndre Fischer             if ( ! iItem->mbIsHidden)
39395a18594SAndre Fischer                 aSelectionData.push_back(
39495a18594SAndre Fischer                     DeckMenuData(
39595a18594SAndre Fischer                         pDeckDescriptor->msTitle,
39695a18594SAndre Fischer                         pDeckDescriptor->msId,
39795a18594SAndre Fischer                         iItem->mpButton->IsChecked()));
39895a18594SAndre Fischer 
39995a18594SAndre Fischer             aShowData.push_back(
40095a18594SAndre Fischer                 DeckMenuData(
40195a18594SAndre Fischer                     pDeckDescriptor->msTitle,
40295a18594SAndre Fischer                     pDeckDescriptor->msId,
40395a18594SAndre Fischer                     !iItem->mbIsHidden));
40495a18594SAndre Fischer         }
40595a18594SAndre Fischer     }
40695a18594SAndre Fischer 
407ff12d537SAndre Fischer     maPopupMenuProvider(
408ff12d537SAndre Fischer         Rectangle(
409ff12d537SAndre Fischer             mpMenuButton->GetPosPixel(),
41095a18594SAndre Fischer             mpMenuButton->GetSizePixel()),
41195a18594SAndre Fischer         aSelectionData,
41295a18594SAndre Fischer         aShowData);
413ff12d537SAndre Fischer 
414ff12d537SAndre Fischer     return 0;
415ff12d537SAndre Fischer }
416ff12d537SAndre Fischer 
417ff12d537SAndre Fischer 
418ff12d537SAndre Fischer 
419ff12d537SAndre Fischer } } // end of namespace sfx2::sidebar
420