| insctrl.cxx (f6e50924) | insctrl.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 --------------------------------------------------------------- --- 14 unchanged lines hidden (view full) --- 42 43#define PAINT_OFFSET 5 44 45SFX_IMPL_STATUSBAR_CONTROL(SvxInsertStatusBarControl, SfxBoolItem); 46 47// class SvxInsertStatusBarControl --------------------------------------- 48 49SvxInsertStatusBarControl::SvxInsertStatusBarControl( sal_uInt16 _nSlotId, | 20 *************************************************************/ 21 22 23 24// MARKER(update_precomp.py): autogen include statement, do not remove 25#include "precompiled_svx.hxx" 26 27// include --------------------------------------------------------------- --- 14 unchanged lines hidden (view full) --- 42 43#define PAINT_OFFSET 5 44 45SFX_IMPL_STATUSBAR_CONTROL(SvxInsertStatusBarControl, SfxBoolItem); 46 47// class SvxInsertStatusBarControl --------------------------------------- 48 49SvxInsertStatusBarControl::SvxInsertStatusBarControl( sal_uInt16 _nSlotId, |
| 50 sal_uInt16 _nId, | 50 sal_uInt16 _nId, |
| 51 StatusBar& rStb ) : 52 53 SfxStatusBarControl( _nSlotId, _nId, rStb ), 54 bInsert( sal_True ) 55{ 56} 57 58// ----------------------------------------------------------------------- --- 21 unchanged lines hidden (view full) --- 80// ----------------------------------------------------------------------- 81 82void SvxInsertStatusBarControl::Click() 83{ 84 if ( !GetStatusBar().GetItemText( GetId() ).Len() ) 85 return; 86 bInsert = !bInsert; 87 SfxBoolItem aIns( GetSlotId(), bInsert ); | 51 StatusBar& rStb ) : 52 53 SfxStatusBarControl( _nSlotId, _nId, rStb ), 54 bInsert( sal_True ) 55{ 56} 57 58// ----------------------------------------------------------------------- --- 21 unchanged lines hidden (view full) --- 80// ----------------------------------------------------------------------- 81 82void SvxInsertStatusBarControl::Click() 83{ 84 if ( !GetStatusBar().GetItemText( GetId() ).Len() ) 85 return; 86 bInsert = !bInsert; 87 SfxBoolItem aIns( GetSlotId(), bInsert ); |
| 88 89 ::com::sun::star::uno::Any a; 90 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aArgs( 1 ); 91 aArgs[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "InsertMode" )); 92 aIns.QueryValue( a ); 93 aArgs[0].Value = a; 94 95 execute( aArgs ); | 88 89 ::com::sun::star::uno::Any a; 90 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aArgs( 1 ); 91 aArgs[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "InsertMode" )); 92 aIns.QueryValue( a ); 93 aArgs[0].Value = a; 94 95 execute( aArgs ); |
| 96} 97 98// ----------------------------------------------------------------------- 99 100void SvxInsertStatusBarControl::Paint( const UserDrawEvent& ) 101{ 102 DrawItemText_Impl(); 103} --- 6 unchanged lines hidden (view full) --- 110 111 if ( bInsert ) 112 _nId = RID_SVXSTR_INSERT_TEXT; 113 GetStatusBar().SetItemText( GetId(), SVX_RESSTR( _nId ) ); 114} 115 116sal_uIntPtr SvxInsertStatusBarControl::GetDefItemWidth(const StatusBar& rStb) 117{ | 96} 97 98// ----------------------------------------------------------------------- 99 100void SvxInsertStatusBarControl::Paint( const UserDrawEvent& ) 101{ 102 DrawItemText_Impl(); 103} --- 6 unchanged lines hidden (view full) --- 110 111 if ( bInsert ) 112 _nId = RID_SVXSTR_INSERT_TEXT; 113 GetStatusBar().SetItemText( GetId(), SVX_RESSTR( _nId ) ); 114} 115 116sal_uIntPtr SvxInsertStatusBarControl::GetDefItemWidth(const StatusBar& rStb) 117{ |
| 118 long nWidth1 = rStb.GetTextWidth(SVX_RESSTR(RID_SVXSTR_OVERWRITE_TEXT)); 119 long nWidth2 = rStb.GetTextWidth(SVX_RESSTR(RID_SVXSTR_INSERT_TEXT)); | 118 long nWidth1 = rStb.GetTextWidth(SVX_RESSTR(RID_SVXSTR_OVERWRITE_TEXT)); 119 long nWidth2 = rStb.GetTextWidth(SVX_RESSTR(RID_SVXSTR_INSERT_TEXT)); |
| 120 121 if(nWidth1<nWidth2) 122 nWidth1=nWidth2; 123 124 return nWidth1+PAINT_OFFSET; 125} 126 | 120 121 if(nWidth1<nWidth2) 122 nWidth1=nWidth2; 123 124 return nWidth1+PAINT_OFFSET; 125} 126 |
| 127 | 127/* vim: set noet sw=4 ts=4: */ |