xref: /AOO41X/main/chart2/source/controller/dialogs/tp_LegendPosition.cxx (revision cde9e8dc2218e857da4894ecba5c903312256674)
1*cde9e8dcSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*cde9e8dcSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*cde9e8dcSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*cde9e8dcSAndrew Rist  * distributed with this work for additional information
6*cde9e8dcSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*cde9e8dcSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*cde9e8dcSAndrew Rist  * "License"); you may not use this file except in compliance
9*cde9e8dcSAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*cde9e8dcSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*cde9e8dcSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*cde9e8dcSAndrew Rist  * software distributed under the License is distributed on an
15*cde9e8dcSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*cde9e8dcSAndrew Rist  * KIND, either express or implied.  See the License for the
17*cde9e8dcSAndrew Rist  * specific language governing permissions and limitations
18*cde9e8dcSAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*cde9e8dcSAndrew Rist  *************************************************************/
21*cde9e8dcSAndrew Rist 
22*cde9e8dcSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_chart2.hxx"
26cdf0e10cSrcweir #include "tp_LegendPosition.hxx"
27cdf0e10cSrcweir #include "ResId.hxx"
28cdf0e10cSrcweir #include "TabPages.hrc"
29cdf0e10cSrcweir #include "res_LegendPosition.hxx"
30cdf0e10cSrcweir #include "chartview/ChartSfxItemIds.hxx"
31cdf0e10cSrcweir #include "NoWarningThisInCTOR.hxx"
32cdf0e10cSrcweir #include <svx/chrtitem.hxx>
33cdf0e10cSrcweir #include <editeng/eeitem.hxx>
34cdf0e10cSrcweir #include <editeng/frmdiritem.hxx>
35cdf0e10cSrcweir 
36cdf0e10cSrcweir //.............................................................................
37cdf0e10cSrcweir namespace chart
38cdf0e10cSrcweir {
39cdf0e10cSrcweir //.............................................................................
40cdf0e10cSrcweir 
SchLegendPosTabPage(Window * pWindow,const SfxItemSet & rInAttrs)41cdf0e10cSrcweir SchLegendPosTabPage::SchLegendPosTabPage(Window* pWindow,
42cdf0e10cSrcweir 										 const SfxItemSet& rInAttrs)
43cdf0e10cSrcweir     : SfxTabPage( pWindow, SchResId(TP_LEGEND_POS), rInAttrs )
44cdf0e10cSrcweir 	, aGrpLegend( this, SchResId(GRP_LEGEND) )
45cdf0e10cSrcweir     , m_apLegendPositionResources( new LegendPositionResources(this) )
46cdf0e10cSrcweir     , m_aFlTextOrient( this, SchResId( FL_LEGEND_TEXTORIENT ) )
47cdf0e10cSrcweir     , m_aFtTextDirection( this, SchResId( FT_LEGEND_TEXTDIR ) )
48cdf0e10cSrcweir     , m_aLbTextDirection( this, SchResId( LB_LEGEND_TEXTDIR ), &m_aFlTextOrient, &m_aFtTextDirection )
49cdf0e10cSrcweir {
50cdf0e10cSrcweir 	m_apLegendPositionResources->SetAccessibleRelationMemberOf(&aGrpLegend);
51cdf0e10cSrcweir 	FreeResource();
52cdf0e10cSrcweir }
53cdf0e10cSrcweir 
~SchLegendPosTabPage()54cdf0e10cSrcweir SchLegendPosTabPage::~SchLegendPosTabPage()
55cdf0e10cSrcweir {
56cdf0e10cSrcweir }
57cdf0e10cSrcweir 
Create(Window * pWindow,const SfxItemSet & rOutAttrs)58cdf0e10cSrcweir SfxTabPage* SchLegendPosTabPage::Create(Window* pWindow,
59cdf0e10cSrcweir 										const SfxItemSet& rOutAttrs)
60cdf0e10cSrcweir {
61cdf0e10cSrcweir 	return new SchLegendPosTabPage(pWindow, rOutAttrs);
62cdf0e10cSrcweir }
63cdf0e10cSrcweir 
FillItemSet(SfxItemSet & rOutAttrs)64cdf0e10cSrcweir sal_Bool SchLegendPosTabPage::FillItemSet(SfxItemSet& rOutAttrs)
65cdf0e10cSrcweir {
66cdf0e10cSrcweir     m_apLegendPositionResources->writeToItemSet(rOutAttrs);
67cdf0e10cSrcweir 
68cdf0e10cSrcweir     if( m_aLbTextDirection.GetSelectEntryCount() > 0 )
69cdf0e10cSrcweir         rOutAttrs.Put( SfxInt32Item( EE_PARA_WRITINGDIR, m_aLbTextDirection.GetSelectEntryValue() ) );
70cdf0e10cSrcweir 
71cdf0e10cSrcweir 	return sal_True;
72cdf0e10cSrcweir }
73cdf0e10cSrcweir 
Reset(const SfxItemSet & rInAttrs)74cdf0e10cSrcweir void SchLegendPosTabPage::Reset(const SfxItemSet& rInAttrs)
75cdf0e10cSrcweir {
76cdf0e10cSrcweir     m_apLegendPositionResources->initFromItemSet(rInAttrs);
77cdf0e10cSrcweir 
78cdf0e10cSrcweir     const SfxPoolItem* pPoolItem = 0;
79cdf0e10cSrcweir     if( rInAttrs.GetItemState( EE_PARA_WRITINGDIR, sal_True, &pPoolItem ) == SFX_ITEM_SET )
80cdf0e10cSrcweir         m_aLbTextDirection.SelectEntryValue( SvxFrameDirection(((const SvxFrameDirectionItem*)pPoolItem)->GetValue()) );
81cdf0e10cSrcweir }
82cdf0e10cSrcweir 
83cdf0e10cSrcweir //.............................................................................
84cdf0e10cSrcweir } //namespace chart
85cdf0e10cSrcweir //.............................................................................
86