LibreOffice Module chart2 (master) 1
tp_LegendPosition.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include "tp_LegendPosition.hxx"
24#include <editeng/eeitem.hxx>
26
27namespace chart
28{
29
31 : SfxTabPage(pPage, pController, "modules/schart/ui/tp_LegendPosition.ui", "tp_LegendPosition", &rInAttrs)
32 , m_aLegendPositionResources(*m_xBuilder)
33 , m_aLbTextDirection(m_xBuilder->weld_combo_box("LB_LEGEND_TEXTDIR"))
34 , m_xCBLegendNoOverlay(m_xBuilder->weld_check_button("CB_NO_OVERLAY"))
35{
36}
37
39{
40}
41
42std::unique_ptr<SfxTabPage> SchLegendPosTabPage::Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rOutAttrs)
43{
44 return std::make_unique<SchLegendPosTabPage>(pPage, pController, *rOutAttrs);
45}
46
48{
50
53
54 if (m_xCBLegendNoOverlay->get_visible())
56
57 return true;
58}
59
61{
63
64 if( const SvxFrameDirectionItem* pDirectionItem = rInAttrs->GetItemIfSet( EE_PARA_WRITINGDIR ) )
65 m_aLbTextDirection.set_active_id( pDirectionItem->GetValue() );
66
67 if (const SfxBoolItem* pNoOverlayItem = rInAttrs->GetItemIfSet(SCHATTR_LEGEND_NO_OVERLAY))
68 {
69 bool bVal = pNoOverlayItem->GetValue();
70 m_xCBLegendNoOverlay->set_active(bVal);
71 }
72}
73
74} //namespace chart
75
76/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
constexpr TypedWhichId< SfxBoolItem > SCHATTR_LEGEND_NO_OVERLAY(SCHATTR_LEGEND_START+2)
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
void writeToItemSet(SfxItemSet &rOutAttrs) const
void initFromItemSet(const SfxItemSet &rInAttrs)
virtual void Reset(const SfxItemSet *rInAttrs) override
std::unique_ptr< weld::CheckButton > m_xCBLegendNoOverlay
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rInAttrs)
virtual ~SchLegendPosTabPage() override
SchLegendPosTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rInAttrs)
LegendPositionResources m_aLegendPositionResources
TextDirectionListBox m_aLbTextDirection
virtual bool FillItemSet(SfxItemSet *rOutAttrs) override
SvxFrameDirection get_active_id() const
void set_active_id(SvxFrameDirection eDir)
constexpr TypedWhichId< SvxFrameDirectionItem > EE_PARA_WRITINGDIR(EE_PARA_START+0)