selctrl.cxx (f6e50924) selctrl.cxx (07662b26)
1/**************************************************************
1/**************************************************************
2 *
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
10 *
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
19 *
20 *************************************************************/
21
22
23
24// MARKER(update_precomp.py): autogen include statement, do not remove
25#include "precompiled_svx.hxx"
26
27// include ---------------------------------------------------------------

--- 47 unchanged lines hidden (view full) ---

75void SvxSelectionModeControl::Click()
76{
77 if ( !GetStatusBar().GetItemText( GetId() ).Len() )
78 return;
79 nState++;
80 if ( nState > 3 )
81 nState = 0;
82
20 *************************************************************/
21
22
23
24// MARKER(update_precomp.py): autogen include statement, do not remove
25#include "precompiled_svx.hxx"
26
27// include ---------------------------------------------------------------

--- 47 unchanged lines hidden (view full) ---

75void SvxSelectionModeControl::Click()
76{
77 if ( !GetStatusBar().GetItemText( GetId() ).Len() )
78 return;
79 nState++;
80 if ( nState > 3 )
81 nState = 0;
82
83 ::com::sun::star::uno::Any a;
84 SfxUInt16Item aState( GetSlotId(), nState );
85 INetURLObject aObj( m_aCommandURL );
86
87 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aArgs( 1 );
88 aArgs[0].Name = aObj.GetURLPath();
89 aState.QueryValue( a );
90 aArgs[0].Value = a;
91
92 execute( aArgs );
83 ::com::sun::star::uno::Any a;
84 SfxUInt16Item aState( GetSlotId(), nState );
85 INetURLObject aObj( m_aCommandURL );
86
87 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aArgs( 1 );
88 aArgs[0].Name = aObj.GetURLPath();
89 aState.QueryValue( a );
90 aArgs[0].Value = a;
91
92 execute( aArgs );
93}
94
95// -----------------------------------------------------------------------
96
97void SvxSelectionModeControl::Paint( const UserDrawEvent& )
98{
99 DrawItemText_Impl();
100}

--- 24 unchanged lines hidden (view full) ---

125
126 if ( _nId )
127 sTxt = SVX_RESSTR( _nId );
128 GetStatusBar().SetItemText( GetId(), sTxt );
129}
130
131sal_uIntPtr SvxSelectionModeControl::GetDefItemWidth(const StatusBar& rStb)
132{
93}
94
95// -----------------------------------------------------------------------
96
97void SvxSelectionModeControl::Paint( const UserDrawEvent& )
98{
99 DrawItemText_Impl();
100}

--- 24 unchanged lines hidden (view full) ---

125
126 if ( _nId )
127 sTxt = SVX_RESSTR( _nId );
128 GetStatusBar().SetItemText( GetId(), sTxt );
129}
130
131sal_uIntPtr SvxSelectionModeControl::GetDefItemWidth(const StatusBar& rStb)
132{
133 long nWidth1 = rStb.GetTextWidth(SVX_RESSTR(RID_SVXSTR_SELMODE_STD));
134 long nWidth2 = rStb.GetTextWidth(SVX_RESSTR(RID_SVXSTR_SELMODE_ER));
135 long nWidth3 = rStb.GetTextWidth(SVX_RESSTR(RID_SVXSTR_SELMODE_ERG));
136 long nWidth4 = rStb.GetTextWidth(SVX_RESSTR(RID_SVXSTR_SELMODE_BLK));
133 long nWidth1 = rStb.GetTextWidth(SVX_RESSTR(RID_SVXSTR_SELMODE_STD));
134 long nWidth2 = rStb.GetTextWidth(SVX_RESSTR(RID_SVXSTR_SELMODE_ER));
135 long nWidth3 = rStb.GetTextWidth(SVX_RESSTR(RID_SVXSTR_SELMODE_ERG));
136 long nWidth4 = rStb.GetTextWidth(SVX_RESSTR(RID_SVXSTR_SELMODE_BLK));
137
138 if(nWidth1<nWidth2)
139 nWidth1=nWidth2;
140
141 if(nWidth1<nWidth3)
142 nWidth1=nWidth3;
143
137
138 if(nWidth1<nWidth2)
139 nWidth1=nWidth2;
140
141 if(nWidth1<nWidth3)
142 nWidth1=nWidth3;
143
144 if(nWidth1<nWidth4)
144 if(nWidth1<nWidth4)
145 nWidth1=nWidth4;
146
147 return nWidth1+PAINT_OFFSET;
148}
149
145 nWidth1=nWidth4;
146
147 return nWidth1+PAINT_OFFSET;
148}
149
150
150/* vim: set noet sw=4 ts=4: */