Line data Source code
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"
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>
28 :
29 : namespace chart
30 : {
31 :
32 0 : SchLegendPosTabPage::SchLegendPosTabPage(vcl::Window* pWindow, const SfxItemSet& rInAttrs)
33 : : SfxTabPage( pWindow
34 : ,"tp_LegendPosition"
35 : ,"modules/schart/ui/tp_LegendPosition.ui"
36 : , &rInAttrs )
37 0 : , m_aLegendPositionResources(*this)
38 : {
39 0 : get(m_pLbTextDirection,"LB_LEGEND_TEXTDIR");
40 :
41 0 : m_pLbTextDirection->SetDropDownLineCount(3);
42 0 : }
43 :
44 0 : SfxTabPage* SchLegendPosTabPage::Create(vcl::Window* pWindow, const SfxItemSet* rOutAttrs)
45 : {
46 0 : return new SchLegendPosTabPage(pWindow, *rOutAttrs);
47 : }
48 :
49 0 : bool SchLegendPosTabPage::FillItemSet(SfxItemSet* rOutAttrs)
50 : {
51 0 : m_aLegendPositionResources.writeToItemSet(*rOutAttrs);
52 :
53 0 : if( m_pLbTextDirection->GetSelectEntryCount() > 0 )
54 0 : rOutAttrs->Put( SvxFrameDirectionItem( m_pLbTextDirection->GetSelectEntryValue(), EE_PARA_WRITINGDIR ) );
55 :
56 0 : return true;
57 : }
58 :
59 0 : void SchLegendPosTabPage::Reset(const SfxItemSet* rInAttrs)
60 : {
61 0 : m_aLegendPositionResources.initFromItemSet(*rInAttrs);
62 :
63 0 : const SfxPoolItem* pPoolItem = 0;
64 0 : if( rInAttrs->GetItemState( EE_PARA_WRITINGDIR, true, &pPoolItem ) == SfxItemState::SET )
65 0 : m_pLbTextDirection->SelectEntryValue( SvxFrameDirection(static_cast<const SvxFrameDirectionItem*>(pPoolItem)->GetValue()) );
66 0 : }
67 :
68 102 : } //namespace chart
69 :
70 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|