fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / chart2 / source / controller / dialogs / tp_PolarOptions.cxx
blobd01f02b97cb8be858b1f4a75f8976307881a0d3f
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include "tp_PolarOptions.hxx"
21 #include "ResId.hxx"
22 #include "chartview/ChartSfxItemIds.hxx"
24 #include <svl/eitem.hxx>
25 #include <svl/intitem.hxx>
26 #include <svtools/controldims.hrc>
28 namespace chart
31 PolarOptionsTabPage::PolarOptionsTabPage( vcl::Window* pWindow,const SfxItemSet& rInAttrs ) :
32 SfxTabPage( pWindow
33 ,"tp_PolarOptions"
34 ,"modules/schart/ui/tp_PolarOptions.ui"
35 ,&rInAttrs)
37 get(m_pCB_Clockwise, "CB_CLOCKWISE");
38 get(m_pFL_StartingAngle, "frameANGLE");
39 get(m_pAngleDial, "CT_ANGLE_DIAL");
40 get(m_pNF_StartingAngle, "NF_STARTING_ANGLE");
41 get(m_pFL_PlotOptions, "framePLOT_OPTIONS");
42 get(m_pCB_IncludeHiddenCells, "CB_INCLUDE_HIDDEN_CELLS_POLAR");
44 m_pAngleDial->SetLinkedField( m_pNF_StartingAngle );
47 PolarOptionsTabPage::~PolarOptionsTabPage()
49 disposeOnce();
52 void PolarOptionsTabPage::dispose()
54 m_pCB_Clockwise.clear();
55 m_pFL_StartingAngle.clear();
56 m_pAngleDial.clear();
57 m_pNF_StartingAngle.clear();
58 m_pFL_PlotOptions.clear();
59 m_pCB_IncludeHiddenCells.clear();
60 SfxTabPage::dispose();
63 VclPtr<SfxTabPage> PolarOptionsTabPage::Create( vcl::Window* pWindow,const SfxItemSet* rOutAttrs )
65 return VclPtr<PolarOptionsTabPage>::Create( pWindow, *rOutAttrs );
68 bool PolarOptionsTabPage::FillItemSet( SfxItemSet* rOutAttrs )
70 if( m_pAngleDial->IsVisible() )
72 rOutAttrs->Put(SfxInt32Item(SCHATTR_STARTING_ANGLE,
73 static_cast< sal_Int32 >(m_pAngleDial->GetRotation()/100)));
76 if( m_pCB_Clockwise->IsVisible() )
77 rOutAttrs->Put(SfxBoolItem(SCHATTR_CLOCKWISE,m_pCB_Clockwise->IsChecked()));
79 if (m_pCB_IncludeHiddenCells->IsVisible())
80 rOutAttrs->Put(SfxBoolItem(SCHATTR_INCLUDE_HIDDEN_CELLS, m_pCB_IncludeHiddenCells->IsChecked()));
82 return true;
85 void PolarOptionsTabPage::Reset(const SfxItemSet* rInAttrs)
87 const SfxPoolItem *pPoolItem = NULL;
89 if (rInAttrs->GetItemState(SCHATTR_STARTING_ANGLE, true, &pPoolItem) == SfxItemState::SET)
91 long nTmp = (long)static_cast<const SfxInt32Item*>(pPoolItem)->GetValue();
92 m_pAngleDial->SetRotation( nTmp*100 );
94 else
96 m_pFL_StartingAngle->Show(false);
98 if (rInAttrs->GetItemState(SCHATTR_CLOCKWISE, true, &pPoolItem) == SfxItemState::SET)
100 bool bCheck = static_cast< const SfxBoolItem * >( pPoolItem )->GetValue();
101 m_pCB_Clockwise->Check(bCheck);
103 else
105 m_pCB_Clockwise->Show(false);
107 if (rInAttrs->GetItemState(SCHATTR_INCLUDE_HIDDEN_CELLS, true, &pPoolItem) == SfxItemState::SET)
109 bool bVal = static_cast<const SfxBoolItem*>(pPoolItem)->GetValue();
110 m_pCB_IncludeHiddenCells->Check(bVal);
112 else
114 m_pFL_PlotOptions->Show(false);
118 } //namespace chart
120 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */