fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / chart2 / source / controller / dialogs / tp_LegendPosition.cxx
blob1a264f5b6b4f32409289e1f975dcd08637753496
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_LegendPosition.hxx"
21 #include "ResId.hxx"
22 #include "ResourceIds.hrc"
23 #include "res_LegendPosition.hxx"
24 #include "chartview/ChartSfxItemIds.hxx"
25 #include <svx/chrtitem.hxx>
26 #include <editeng/eeitem.hxx>
27 #include <editeng/frmdiritem.hxx>
29 namespace chart
32 SchLegendPosTabPage::SchLegendPosTabPage(vcl::Window* pWindow, const SfxItemSet& rInAttrs)
33 : SfxTabPage( pWindow
34 ,"tp_LegendPosition"
35 ,"modules/schart/ui/tp_LegendPosition.ui"
36 , &rInAttrs )
37 , m_aLegendPositionResources(*this)
39 get(m_pLbTextDirection,"LB_LEGEND_TEXTDIR");
41 m_pLbTextDirection->SetDropDownLineCount(3);
44 SchLegendPosTabPage::~SchLegendPosTabPage()
46 disposeOnce();
49 void SchLegendPosTabPage::dispose()
51 m_pLbTextDirection.clear();
52 SfxTabPage::dispose();
56 VclPtr<SfxTabPage> SchLegendPosTabPage::Create(vcl::Window* pWindow, const SfxItemSet* rOutAttrs)
58 return VclPtr<SchLegendPosTabPage>::Create(pWindow, *rOutAttrs);
61 bool SchLegendPosTabPage::FillItemSet(SfxItemSet* rOutAttrs)
63 m_aLegendPositionResources.writeToItemSet(*rOutAttrs);
65 if( m_pLbTextDirection->GetSelectEntryCount() > 0 )
66 rOutAttrs->Put( SvxFrameDirectionItem( m_pLbTextDirection->GetSelectEntryValue(), EE_PARA_WRITINGDIR ) );
68 return true;
71 void SchLegendPosTabPage::Reset(const SfxItemSet* rInAttrs)
73 m_aLegendPositionResources.initFromItemSet(*rInAttrs);
75 const SfxPoolItem* pPoolItem = 0;
76 if( rInAttrs->GetItemState( EE_PARA_WRITINGDIR, true, &pPoolItem ) == SfxItemState::SET )
77 m_pLbTextDirection->SelectEntryValue( SvxFrameDirection(static_cast<const SvxFrameDirectionItem*>(pPoolItem)->GetValue()) );
80 } //namespace chart
82 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */