Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : :
30 : : #include <tools/debug.hxx>
31 : : #include <vcl/svapp.hxx>
32 : : #include <svtools/svmedit.hxx>
33 : : #include <unoiface.hxx>
34 : : #include <svtools/filectrl.hxx>
35 : : #include <svtools/roadmap.hxx>
36 : : #include <svtools/fixedhyper.hxx>
37 : : #include <com/sun/star/lang/XMultiServiceFactory.hpp>
38 : : #include <com/sun/star/lang/XSingleServiceFactory.hpp>
39 : : #include <com/sun/star/awt/LineEndFormat.hpp>
40 : : #include <comphelper/processfactory.hxx>
41 : : #include <toolkit/helper/convert.hxx>
42 : : #include <toolkit/helper/property.hxx>
43 : : #include <svtools/fmtfield.hxx>
44 : : #include <svl/numuno.hxx>
45 : : #include <svtools/calendar.hxx>
46 : : #include <svtools/prgsbar.hxx>
47 : : #include <svtools/svtreebx.hxx>
48 : : #include "treecontrolpeer.hxx"
49 : : #include "svtxgridcontrol.hxx"
50 : : #include <svtools/table/tablecontrol.hxx>
51 : :
52 : : namespace
53 : : {
54 : 26 : static void lcl_setWinBits( Window* _pWindow, WinBits _nBits, sal_Bool _bSet )
55 : : {
56 : 26 : WinBits nStyle = _pWindow->GetStyle();
57 [ + + ]: 26 : if ( _bSet )
58 : 22 : nStyle |= _nBits;
59 : : else
60 : 4 : nStyle &= ~_nBits;
61 : 26 : _pWindow->SetStyle( nStyle );
62 : 26 : }
63 : : }
64 : :
65 : : // ----------------------------------------------------
66 : : // help function for the toolkit...
67 : : // ----------------------------------------------------
68 : :
69 : : extern "C" {
70 : :
71 : 16392 : SAL_DLLPUBLIC_EXPORT Window* CreateWindow( VCLXWindow** ppNewComp, const ::com::sun::star::awt::WindowDescriptor* pDescriptor, Window* pParent, WinBits nWinBits )
72 : : {
73 : 16392 : Window* pWindow = NULL;
74 [ + - ]: 16392 : String aServiceName( pDescriptor->WindowServiceName );
75 [ + - ][ + + ]: 16392 : if ( aServiceName.EqualsIgnoreCaseAscii( "MultiLineEdit" ) )
76 : : {
77 [ + - ]: 22 : if ( pParent )
78 : : {
79 [ + - ][ + - ]: 22 : pWindow = new MultiLineEdit( pParent, nWinBits|WB_IGNORETAB);
80 [ + - ]: 22 : static_cast< MultiLineEdit* >( pWindow )->DisableSelectionOnFocus();
81 [ + - ][ + - ]: 22 : *ppNewComp = new VCLXMultiLineEdit;
82 : : }
83 : : else
84 : : {
85 : 0 : *ppNewComp = NULL;
86 : 0 : return NULL;
87 : : }
88 : : }
89 [ + - ][ - + ]: 16370 : else if ( aServiceName.EqualsIgnoreCaseAscii( "FileControl" ) )
90 : : {
91 [ # # ]: 0 : if ( pParent )
92 : : {
93 [ # # ][ # # ]: 0 : pWindow = new FileControl( pParent, nWinBits );
94 [ # # ][ # # ]: 0 : *ppNewComp = new VCLXFileControl;
95 : : }
96 : : else
97 : : {
98 : 0 : *ppNewComp = NULL;
99 : 0 : return NULL;
100 : : }
101 : : }
102 [ + - ][ + + ]: 16370 : else if (aServiceName.EqualsIgnoreCaseAscii("FormattedField") )
103 : : {
104 [ + - ][ + - ]: 2 : pWindow = new FormattedField( pParent, nWinBits );
105 [ + - ][ + - ]: 2 : *ppNewComp = new SVTXFormattedField;
106 : : }
107 [ + - ][ + + ]: 16368 : else if (aServiceName.EqualsIgnoreCaseAscii("NumericField") )
108 : : {
109 [ + - ][ + - ]: 34 : pWindow = new DoubleNumericField( pParent, nWinBits );
110 [ + - ][ + - ]: 34 : *ppNewComp = new SVTXNumericField;
111 : : }
112 [ + - ][ + + ]: 16334 : else if (aServiceName.EqualsIgnoreCaseAscii("LongCurrencyField") )
113 : : {
114 [ + - ][ + - ]: 34 : pWindow = new DoubleCurrencyField( pParent, nWinBits );
115 [ + - ][ + - ]: 34 : *ppNewComp = new SVTXCurrencyField;
116 : : }
117 [ + - ][ + + ]: 16300 : else if (aServiceName.EqualsIgnoreCaseAscii("datefield") )
118 : : {
119 [ + - ][ + - ]: 54 : pWindow = new CalendarField( pParent, nWinBits);
120 : 54 : static_cast<CalendarField*>(pWindow)->EnableToday();
121 : 54 : static_cast<CalendarField*>(pWindow)->EnableNone();
122 : 54 : static_cast<CalendarField*>(pWindow)->EnableEmptyFieldValue( sal_True );
123 [ + - ][ + - ]: 54 : *ppNewComp = new SVTXDateField;
124 [ + - ][ + - ]: 54 : ((VCLXFormattedSpinField*)*ppNewComp)->SetFormatter( (FormatterBase*)(DateField*)pWindow );
125 : : }
126 [ + - ][ - + ]: 16246 : else if (aServiceName.EqualsIgnoreCaseAscii("roadmap") )
127 : : {
128 [ # # ][ # # ]: 0 : pWindow = new ::svt::ORoadmap( pParent, WB_TABSTOP );
129 [ # # ]: 0 : *ppNewComp = new SVTXRoadmap;
130 : : }
131 [ + - ][ - + ]: 16246 : else if ( aServiceName.EqualsIgnoreCaseAscii( "ProgressBar" ) )
132 : : {
133 [ # # ]: 0 : if ( pParent )
134 : : {
135 [ # # ][ # # ]: 0 : pWindow = new ProgressBar( pParent, nWinBits );
136 [ # # ][ # # ]: 0 : *ppNewComp = new VCLXProgressBar;
137 : : }
138 : : else
139 : : {
140 : 0 : *ppNewComp = NULL;
141 : 0 : return NULL;
142 : : }
143 : : }
144 [ + - ][ - + ]: 16246 : else if ( aServiceName.EqualsIgnoreCaseAscii( "Tree" ) )
145 : : {
146 [ # # ]: 0 : TreeControlPeer* pPeer = new TreeControlPeer;
147 : 0 : *ppNewComp = pPeer;
148 [ # # ]: 0 : pWindow = pPeer->createVclControl( pParent, nWinBits );
149 : : }
150 [ + - ][ - + ]: 16246 : else if ( aServiceName.EqualsIgnoreCaseAscii( "FixedHyperlink" ) )
151 : : {
152 [ # # ]: 0 : if ( pParent )
153 : : {
154 [ # # ][ # # ]: 0 : pWindow = new ::svt::FixedHyperlink( pParent, nWinBits );
155 [ # # ][ # # ]: 0 : *ppNewComp = new VCLXFixedHyperlink;
156 : : }
157 : : else
158 : : {
159 : 0 : *ppNewComp = NULL;
160 : 0 : return NULL;
161 : : }
162 : : }
163 [ + - ][ - + ]: 16246 : else if ( aServiceName.EqualsIgnoreCaseAscii( "Grid" ) )
164 : : {
165 [ # # ]: 0 : if ( pParent )
166 : : {
167 [ # # ][ # # ]: 0 : pWindow = new ::svt::table::TableControl(pParent, nWinBits);
168 [ # # ]: 0 : *ppNewComp = new SVTXGridControl;
169 : : }
170 : : else
171 : : {
172 : 0 : *ppNewComp = NULL;
173 : 0 : return NULL;
174 : : }
175 : : }
176 [ + - ]: 16392 : return pWindow;
177 : : }
178 : :
179 : : } // extern "C"
180 : :
181 : : // ----------------------------------------------------
182 : : // class VCLXMultiLineEdit
183 : : // ----------------------------------------------------
184 : 22 : VCLXMultiLineEdit::VCLXMultiLineEdit()
185 : : :maTextListeners( *this )
186 [ + - ][ + - ]: 22 : ,meLineEndType( LINEEND_LF ) // default behavior before introducing this property: LF (unix-like)
187 : : {
188 : 22 : }
189 : :
190 [ + - ][ + - ]: 22 : VCLXMultiLineEdit::~VCLXMultiLineEdit()
191 : : {
192 [ - + ]: 44 : }
193 : :
194 : 983 : ::com::sun::star::uno::Any VCLXMultiLineEdit::queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException)
195 : : {
196 : : ::com::sun::star::uno::Any aRet = ::cppu::queryInterface( rType,
197 : : (static_cast< ::com::sun::star::awt::XTextComponent* >(this)),
198 : : (static_cast< ::com::sun::star::awt::XTextArea* >(this)),
199 : : (static_cast< ::com::sun::star::awt::XTextLayoutConstrains* >(this)),
200 [ + - ]: 983 : (static_cast< ::com::sun::star::lang::XTypeProvider* >(this)) );
201 [ + + ][ + - ]: 983 : return (aRet.hasValue() ? aRet : VCLXWindow::queryInterface( rType ));
202 : : }
203 : :
204 : : // ::com::sun::star::lang::XTypeProvider
205 [ # # ][ # # ]: 0 : IMPL_XTYPEPROVIDER_START( VCLXMultiLineEdit )
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
206 [ # # ]: 0 : getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTextComponent>* ) NULL ),
207 [ # # ]: 0 : getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTextArea>* ) NULL ),
208 [ # # ]: 0 : getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTextLayoutConstrains>* ) NULL ),
209 : : VCLXWindow::getTypes()
210 [ # # ][ # # ]: 0 : IMPL_XTYPEPROVIDER_END
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ]
211 : :
212 : 22 : void VCLXMultiLineEdit::addTextListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTextListener > & l ) throw(::com::sun::star::uno::RuntimeException)
213 : : {
214 : 22 : maTextListeners.addInterface( l );
215 : 22 : }
216 : :
217 : 0 : void VCLXMultiLineEdit::removeTextListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTextListener > & l ) throw(::com::sun::star::uno::RuntimeException)
218 : : {
219 : 0 : maTextListeners.removeInterface( l );
220 : 0 : }
221 : :
222 : 32 : void VCLXMultiLineEdit::setText( const ::rtl::OUString& aText ) throw(::com::sun::star::uno::RuntimeException)
223 : : {
224 [ + - ]: 32 : SolarMutexGuard aGuard;
225 : :
226 : 32 : MultiLineEdit* pEdit = (MultiLineEdit*)GetWindow();
227 [ + - ]: 32 : if ( pEdit )
228 : : {
229 [ + - ][ + - ]: 32 : pEdit->SetText( aText );
[ + - ]
230 : :
231 : : // #107218# Call same listeners like VCL would do after user interaction
232 [ + - ]: 32 : SetSynthesizingVCLEvent( sal_True );
233 [ + - ]: 32 : pEdit->SetModifyFlag();
234 [ + - ]: 32 : pEdit->Modify();
235 [ + - ]: 32 : SetSynthesizingVCLEvent( sal_False );
236 [ + - ]: 32 : }
237 : 32 : }
238 : :
239 : 0 : void VCLXMultiLineEdit::insertText( const ::com::sun::star::awt::Selection& rSel, const ::rtl::OUString& aText ) throw(::com::sun::star::uno::RuntimeException)
240 : : {
241 [ # # ]: 0 : SolarMutexGuard aGuard;
242 : :
243 : 0 : MultiLineEdit* pEdit = (MultiLineEdit*)GetWindow();
244 [ # # ]: 0 : if ( pEdit )
245 : : {
246 [ # # ]: 0 : setSelection( rSel );
247 [ # # ][ # # ]: 0 : pEdit->ReplaceSelected( aText );
[ # # ]
248 [ # # ]: 0 : }
249 : 0 : }
250 : :
251 : 0 : ::rtl::OUString VCLXMultiLineEdit::getText() throw(::com::sun::star::uno::RuntimeException)
252 : : {
253 [ # # ]: 0 : SolarMutexGuard aGuard;
254 : :
255 : 0 : ::rtl::OUString aText;
256 : 0 : MultiLineEdit* pEdit = (MultiLineEdit*)GetWindow();
257 [ # # ]: 0 : if ( pEdit )
258 [ # # ][ # # ]: 0 : aText = pEdit->GetText( meLineEndType );
[ # # ]
259 [ # # ]: 0 : return aText;
260 : : }
261 : :
262 : 0 : ::rtl::OUString VCLXMultiLineEdit::getSelectedText() throw(::com::sun::star::uno::RuntimeException)
263 : : {
264 [ # # ]: 0 : SolarMutexGuard aGuard;
265 : :
266 : 0 : ::rtl::OUString aText;
267 : 0 : MultiLineEdit* pMultiLineEdit = (MultiLineEdit*) GetWindow();
268 [ # # ]: 0 : if ( pMultiLineEdit)
269 [ # # ][ # # ]: 0 : aText = pMultiLineEdit->GetSelected( meLineEndType );
[ # # ]
270 [ # # ]: 0 : return aText;
271 : :
272 : : }
273 : :
274 : 0 : void VCLXMultiLineEdit::setSelection( const ::com::sun::star::awt::Selection& aSelection ) throw(::com::sun::star::uno::RuntimeException)
275 : : {
276 [ # # ]: 0 : SolarMutexGuard aGuard;
277 : :
278 : 0 : MultiLineEdit* pMultiLineEdit = (MultiLineEdit*) GetWindow();
279 [ # # ]: 0 : if ( pMultiLineEdit )
280 : : {
281 [ # # ]: 0 : pMultiLineEdit->SetSelection( Selection( aSelection.Min, aSelection.Max ) );
282 [ # # ]: 0 : }
283 : 0 : }
284 : :
285 : 0 : ::com::sun::star::awt::Selection VCLXMultiLineEdit::getSelection() throw(::com::sun::star::uno::RuntimeException)
286 : : {
287 [ # # ]: 0 : SolarMutexGuard aGuard;
288 : :
289 : 0 : ::com::sun::star::awt::Selection aSel;
290 : 0 : MultiLineEdit* pMultiLineEdit = (MultiLineEdit*) GetWindow();
291 [ # # ]: 0 : if ( pMultiLineEdit )
292 : : {
293 [ # # ]: 0 : aSel.Min = pMultiLineEdit->GetSelection().Min();
294 [ # # ]: 0 : aSel.Max = pMultiLineEdit->GetSelection().Max();
295 : : }
296 [ # # ]: 0 : return aSel;
297 : : }
298 : :
299 : 0 : sal_Bool VCLXMultiLineEdit::isEditable() throw(::com::sun::star::uno::RuntimeException)
300 : : {
301 [ # # ]: 0 : SolarMutexGuard aGuard;
302 : :
303 : 0 : MultiLineEdit* pMultiLineEdit = (MultiLineEdit*) GetWindow();
304 [ # # ][ # # ]: 0 : return ( pMultiLineEdit && !pMultiLineEdit->IsReadOnly() && pMultiLineEdit->IsEnabled() ) ? sal_True : sal_False;
[ # # ][ # # ]
[ # # ][ # # ]
305 : : }
306 : :
307 : 0 : void VCLXMultiLineEdit::setEditable( sal_Bool bEditable ) throw(::com::sun::star::uno::RuntimeException)
308 : : {
309 [ # # ]: 0 : SolarMutexGuard aGuard;
310 : :
311 : 0 : MultiLineEdit* pMultiLineEdit = (MultiLineEdit*) GetWindow();
312 [ # # ]: 0 : if ( pMultiLineEdit )
313 [ # # ][ # # ]: 0 : pMultiLineEdit->SetReadOnly( !bEditable );
314 : 0 : }
315 : :
316 : 0 : void VCLXMultiLineEdit::setMaxTextLen( sal_Int16 nLen ) throw(::com::sun::star::uno::RuntimeException)
317 : : {
318 [ # # ]: 0 : SolarMutexGuard aGuard;
319 : :
320 : 0 : MultiLineEdit* pMultiLineEdit = (MultiLineEdit*) GetWindow();
321 [ # # ]: 0 : if ( pMultiLineEdit )
322 [ # # ][ # # ]: 0 : pMultiLineEdit->SetMaxTextLen( nLen );
323 : 0 : }
324 : :
325 : 0 : sal_Int16 VCLXMultiLineEdit::getMaxTextLen() throw(::com::sun::star::uno::RuntimeException)
326 : : {
327 [ # # ]: 0 : SolarMutexGuard aGuard;
328 : :
329 : 0 : MultiLineEdit* pMultiLineEdit = (MultiLineEdit*) GetWindow();
330 [ # # ][ # # ]: 0 : return pMultiLineEdit ? (sal_Int16)pMultiLineEdit->GetMaxTextLen() : (sal_Int16)0;
[ # # ]
331 : : }
332 : :
333 : 0 : ::rtl::OUString VCLXMultiLineEdit::getTextLines() throw(::com::sun::star::uno::RuntimeException)
334 : : {
335 [ # # ]: 0 : SolarMutexGuard aGuard;
336 : :
337 : 0 : ::rtl::OUString aText;
338 : 0 : MultiLineEdit* pEdit = (MultiLineEdit*)GetWindow();
339 [ # # ]: 0 : if ( pEdit )
340 [ # # ][ # # ]: 0 : aText = pEdit->GetTextLines( meLineEndType );
[ # # ]
341 [ # # ]: 0 : return aText;
342 : : }
343 : :
344 : 0 : ::com::sun::star::awt::Size VCLXMultiLineEdit::getMinimumSize() throw(::com::sun::star::uno::RuntimeException)
345 : : {
346 [ # # ]: 0 : SolarMutexGuard aGuard;
347 : :
348 : 0 : ::com::sun::star::awt::Size aSz;
349 : 0 : MultiLineEdit* pEdit = (MultiLineEdit*) GetWindow();
350 [ # # ]: 0 : if ( pEdit )
351 [ # # ]: 0 : aSz = AWTSize(pEdit->CalcMinimumSize());
352 [ # # ]: 0 : return aSz;
353 : : }
354 : :
355 : 0 : ::com::sun::star::awt::Size VCLXMultiLineEdit::getPreferredSize() throw(::com::sun::star::uno::RuntimeException)
356 : : {
357 : 0 : return getMinimumSize();
358 : : }
359 : :
360 : 0 : ::com::sun::star::awt::Size VCLXMultiLineEdit::calcAdjustedSize( const ::com::sun::star::awt::Size& rNewSize ) throw(::com::sun::star::uno::RuntimeException)
361 : : {
362 [ # # ]: 0 : SolarMutexGuard aGuard;
363 : :
364 : 0 : ::com::sun::star::awt::Size aSz = rNewSize;
365 : 0 : MultiLineEdit* pEdit = (MultiLineEdit*) GetWindow();
366 [ # # ]: 0 : if ( pEdit )
367 [ # # ]: 0 : aSz = AWTSize(pEdit->CalcAdjustedSize( VCLSize(rNewSize )));
368 [ # # ]: 0 : return aSz;
369 : : }
370 : :
371 : 0 : ::com::sun::star::awt::Size VCLXMultiLineEdit::getMinimumSize( sal_Int16 nCols, sal_Int16 nLines ) throw(::com::sun::star::uno::RuntimeException)
372 : : {
373 [ # # ]: 0 : SolarMutexGuard aGuard;
374 : :
375 : 0 : ::com::sun::star::awt::Size aSz;
376 : 0 : MultiLineEdit* pEdit = (MultiLineEdit*) GetWindow();
377 [ # # ]: 0 : if ( pEdit )
378 [ # # ]: 0 : aSz = AWTSize(pEdit->CalcSize( nCols, nLines ));
379 [ # # ]: 0 : return aSz;
380 : : }
381 : :
382 : 0 : void VCLXMultiLineEdit::getColumnsAndLines( sal_Int16& nCols, sal_Int16& nLines ) throw(::com::sun::star::uno::RuntimeException)
383 : : {
384 [ # # ]: 0 : SolarMutexGuard aGuard;
385 : :
386 : 0 : nCols = nLines = 0;
387 : 0 : MultiLineEdit* pEdit = (MultiLineEdit*) GetWindow();
388 [ # # ]: 0 : if ( pEdit )
389 : : {
390 : : sal_uInt16 nC, nL;
391 [ # # ]: 0 : pEdit->GetMaxVisColumnsAndLines( nC, nL );
392 : 0 : nCols = nC;
393 : 0 : nLines = nL;
394 [ # # ]: 0 : }
395 : 0 : }
396 : :
397 : 148 : void VCLXMultiLineEdit::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
398 : : {
399 [ - + ]: 148 : switch ( rVclWindowEvent.GetId() )
400 : : {
401 : : case VCLEVENT_EDIT_MODIFY:
402 : : {
403 [ # # ]: 0 : if ( maTextListeners.getLength() )
404 : : {
405 [ # # ]: 0 : ::com::sun::star::awt::TextEvent aEvent;
406 [ # # ]: 0 : aEvent.Source = (::cppu::OWeakObject*)this;
407 [ # # ][ # # ]: 0 : maTextListeners.textChanged( aEvent );
408 : : }
409 : : }
410 : 0 : break;
411 : : default:
412 : : {
413 : 148 : VCLXWindow::ProcessWindowEvent( rVclWindowEvent );
414 : : }
415 : 148 : break;
416 : : }
417 : 148 : }
418 : :
419 : 2764 : void VCLXMultiLineEdit::setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value) throw(::com::sun::star::uno::RuntimeException)
420 : : {
421 [ + - ]: 2764 : SolarMutexGuard aGuard;
422 : :
423 : 2764 : MultiLineEdit* pMultiLineEdit = (MultiLineEdit*)GetWindow();
424 [ + - ]: 2764 : if ( pMultiLineEdit )
425 : : {
426 [ + - ]: 2764 : sal_uInt16 nPropType = GetPropertyId( PropertyName );
427 [ + + + + : 2764 : switch ( nPropType )
+ ]
428 : : {
429 : : case BASEPROPERTY_LINE_END_FORMAT:
430 : : {
431 : 22 : sal_Int16 nLineEndType = ::com::sun::star::awt::LineEndFormat::LINE_FEED;
432 : 22 : OSL_VERIFY( Value >>= nLineEndType );
433 [ - - + - ]: 22 : switch ( nLineEndType )
434 : : {
435 : 0 : case ::com::sun::star::awt::LineEndFormat::CARRIAGE_RETURN: meLineEndType = LINEEND_CR; break;
436 : 0 : case ::com::sun::star::awt::LineEndFormat::LINE_FEED: meLineEndType = LINEEND_LF; break;
437 : 22 : case ::com::sun::star::awt::LineEndFormat::CARRIAGE_RETURN_LINE_FEED: meLineEndType = LINEEND_CRLF; break;
438 : 0 : default: OSL_FAIL( "VCLXMultiLineEdit::setProperty: invalid line end value!" ); break;
439 : : }
440 : : }
441 : 22 : break;
442 : :
443 : : case BASEPROPERTY_READONLY:
444 : : {
445 : 26 : sal_Bool b = sal_Bool();
446 [ + - ]: 26 : if ( Value >>= b )
447 [ + - ]: 26 : pMultiLineEdit->SetReadOnly( b );
448 : : }
449 : 26 : break;
450 : : case BASEPROPERTY_MAXTEXTLEN:
451 : : {
452 : 26 : sal_Int16 n = sal_Int16();
453 [ + - ]: 26 : if ( Value >>= n )
454 [ + - ]: 26 : pMultiLineEdit->SetMaxTextLen( n );
455 : : }
456 : 26 : break;
457 : : case BASEPROPERTY_HIDEINACTIVESELECTION:
458 : : {
459 : 26 : sal_Bool b = sal_Bool();
460 [ + - ]: 26 : if ( Value >>= b )
461 : : {
462 [ + - ]: 26 : pMultiLineEdit->EnableFocusSelectionHide( b );
463 [ + - ]: 26 : lcl_setWinBits( pMultiLineEdit, WB_NOHIDESELECTION, !b );
464 : : }
465 : : }
466 : 26 : break;
467 : : default:
468 : : {
469 [ + - ]: 2764 : VCLXWindow::setProperty( PropertyName, Value );
470 : : }
471 : : }
472 [ + - ]: 2764 : }
473 : 2764 : }
474 : :
475 : 0 : ::com::sun::star::uno::Any VCLXMultiLineEdit::getProperty( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException)
476 : : {
477 [ # # ]: 0 : SolarMutexGuard aGuard;
478 : :
479 : 0 : ::com::sun::star::uno::Any aProp;
480 : 0 : MultiLineEdit* pMultiLineEdit = (MultiLineEdit*)GetWindow();
481 [ # # ]: 0 : if ( pMultiLineEdit )
482 : : {
483 [ # # ]: 0 : sal_uInt16 nPropType = GetPropertyId( PropertyName );
484 [ # # # # ]: 0 : switch ( nPropType )
485 : : {
486 : : case BASEPROPERTY_LINE_END_FORMAT:
487 : : {
488 : 0 : sal_Int16 nLineEndType = ::com::sun::star::awt::LineEndFormat::LINE_FEED;
489 [ # # # # ]: 0 : switch ( meLineEndType )
490 : : {
491 : 0 : case LINEEND_CR: nLineEndType = ::com::sun::star::awt::LineEndFormat::CARRIAGE_RETURN; break;
492 : 0 : case LINEEND_LF: nLineEndType = ::com::sun::star::awt::LineEndFormat::LINE_FEED; break;
493 : 0 : case LINEEND_CRLF: nLineEndType = ::com::sun::star::awt::LineEndFormat::CARRIAGE_RETURN_LINE_FEED; break;
494 : 0 : default: OSL_FAIL( "VCLXMultiLineEdit::getProperty: invalid line end value!" ); break;
495 : : }
496 [ # # ]: 0 : aProp <<= nLineEndType;
497 : : }
498 : 0 : break;
499 : :
500 : : case BASEPROPERTY_READONLY:
501 : : {
502 [ # # ][ # # ]: 0 : aProp <<= pMultiLineEdit->IsReadOnly();
503 : : }
504 : 0 : break;
505 : : case BASEPROPERTY_MAXTEXTLEN:
506 : : {
507 [ # # ][ # # ]: 0 : aProp <<= (sal_Int16) pMultiLineEdit->GetMaxTextLen();
508 : : }
509 : 0 : break;
510 : : default:
511 : : {
512 [ # # ][ # # ]: 0 : aProp <<= VCLXWindow::getProperty( PropertyName );
513 : : }
514 : : }
515 : : }
516 [ # # ]: 0 : return aProp;
517 : : }
518 : :
519 : 0 : void SAL_CALL VCLXMultiLineEdit::setFocus( ) throw(::com::sun::star::uno::RuntimeException)
520 : : {
521 [ # # ]: 0 : SolarMutexGuard aGuard;
522 : :
523 : : // don't grab the focus if we already have it. Reason is that the only thing which the edit
524 : : // does is forwarding the focus to it's text window. This text window then does a "select all".
525 : : // So if the text window already has the focus, and we give the focus to the multi line
526 : : // edit, then all which happens is that everything is selected.
527 : : // #i27072#
528 [ # # ][ # # ]: 0 : if ( GetWindow() && !GetWindow()->HasChildPathFocus() )
[ # # ][ # # ]
529 [ # # ][ # # ]: 0 : GetWindow()->GrabFocus();
530 : 0 : }
531 : :
532 : 0 : void VCLXMultiLineEdit::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
533 : : {
534 : : PushPropertyIds( rIds,
535 : : // FIXME: elide duplication ?
536 : : BASEPROPERTY_LINE_END_FORMAT,
537 : : BASEPROPERTY_READONLY,
538 : : BASEPROPERTY_MAXTEXTLEN,
539 : : BASEPROPERTY_HIDEINACTIVESELECTION,
540 : 0 : 0);
541 : 0 : VCLXWindow::ImplGetPropertyIds( rIds, true );
542 : :
543 : 0 : }
544 : : // ----------------------------------------------------
545 : : // class VCLXFileControl
546 : : // ----------------------------------------------------
547 [ # # ][ # # ]: 0 : VCLXFileControl::VCLXFileControl() : maTextListeners( *this )
548 : : {
549 : 0 : }
550 : :
551 [ # # ][ # # ]: 0 : VCLXFileControl::~VCLXFileControl()
552 : : {
553 : 0 : FileControl* pControl = (FileControl*) GetWindow();
554 [ # # ]: 0 : if ( pControl )
555 [ # # ][ # # ]: 0 : pControl->GetEdit().SetModifyHdl( Link() );
556 [ # # ]: 0 : }
557 : :
558 : 0 : ::com::sun::star::uno::Any VCLXFileControl::queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException)
559 : : {
560 : : ::com::sun::star::uno::Any aRet = ::cppu::queryInterface( rType,
561 : : (static_cast< ::com::sun::star::awt::XTextComponent* >(this)),
562 : : (static_cast< ::com::sun::star::awt::XTextLayoutConstrains* >(this)),
563 [ # # ]: 0 : (static_cast< ::com::sun::star::lang::XTypeProvider* >(this)) );
564 [ # # ][ # # ]: 0 : return (aRet.hasValue() ? aRet : VCLXWindow::queryInterface( rType ));
565 : : }
566 : :
567 : : // ::com::sun::star::lang::XTypeProvider
568 [ # # ][ # # ]: 0 : IMPL_XTYPEPROVIDER_START( VCLXFileControl )
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
569 [ # # ]: 0 : getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTextComponent>* ) NULL ),
570 [ # # ]: 0 : getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTextLayoutConstrains>* ) NULL ),
571 : : VCLXWindow::getTypes()
572 [ # # ][ # # ]: 0 : IMPL_XTYPEPROVIDER_END
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ]
573 : :
574 : 0 : void SAL_CALL VCLXFileControl::setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value) throw(::com::sun::star::uno::RuntimeException)
575 : : {
576 [ # # ]: 0 : SolarMutexGuard aGuard;
577 : :
578 : 0 : FileControl* pControl = (FileControl*)GetWindow();
579 [ # # ]: 0 : if ( pControl )
580 : : {
581 [ # # ]: 0 : sal_uInt16 nPropType = GetPropertyId( PropertyName );
582 [ # # ]: 0 : switch ( nPropType )
583 : : {
584 : : case BASEPROPERTY_HIDEINACTIVESELECTION:
585 : : {
586 : 0 : sal_Bool bValue( sal_False );
587 : 0 : OSL_VERIFY( Value >>= bValue );
588 : :
589 [ # # ]: 0 : lcl_setWinBits( pControl, WB_NOHIDESELECTION, !bValue );
590 [ # # ]: 0 : lcl_setWinBits( &pControl->GetEdit(), WB_NOHIDESELECTION, !bValue );
591 : : }
592 : 0 : break;
593 : :
594 : : default:
595 [ # # ]: 0 : VCLXWindow::setProperty( PropertyName, Value );
596 : 0 : break;
597 : : }
598 [ # # ]: 0 : }
599 : 0 : }
600 : :
601 : 0 : void VCLXFileControl::SetWindow( Window* pWindow )
602 : : {
603 [ # # ]: 0 : FileControl* pPrevFileControl = dynamic_cast<FileControl*>( GetWindow() );
604 [ # # ]: 0 : if ( pPrevFileControl )
605 [ # # ]: 0 : pPrevFileControl->GetEdit().SetModifyHdl( Link() );
606 : :
607 [ # # ]: 0 : FileControl* pNewFileControl = dynamic_cast<FileControl*>( pWindow );
608 [ # # ]: 0 : if ( pNewFileControl )
609 [ # # ]: 0 : pNewFileControl->GetEdit().SetModifyHdl( LINK( this, VCLXFileControl, ModifyHdl ) );
610 : :
611 : 0 : VCLXWindow::SetWindow( pWindow );
612 : 0 : }
613 : :
614 : 0 : void VCLXFileControl::addTextListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTextListener > & l ) throw(::com::sun::star::uno::RuntimeException)
615 : : {
616 : 0 : maTextListeners.addInterface( l );
617 : 0 : }
618 : :
619 : 0 : void VCLXFileControl::removeTextListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTextListener > & l ) throw(::com::sun::star::uno::RuntimeException)
620 : : {
621 : 0 : maTextListeners.removeInterface( l );
622 : 0 : }
623 : :
624 : 0 : void VCLXFileControl::setText( const ::rtl::OUString& aText ) throw(::com::sun::star::uno::RuntimeException)
625 : : {
626 [ # # ]: 0 : SolarMutexGuard aGuard;
627 : :
628 : 0 : Window* pWindow = GetWindow();
629 [ # # ]: 0 : if ( pWindow )
630 : : {
631 [ # # ][ # # ]: 0 : pWindow->SetText( aText );
[ # # ]
632 : :
633 : : // In JAVA wird auch ein textChanged ausgeloest, in VCL nicht.
634 : : // ::com::sun::star::awt::Toolkit soll JAVA-komform sein...
635 [ # # ]: 0 : ModifyHdl( NULL );
636 [ # # ]: 0 : }
637 : 0 : }
638 : :
639 : 0 : void VCLXFileControl::insertText( const ::com::sun::star::awt::Selection& rSel, const ::rtl::OUString& aText ) throw(::com::sun::star::uno::RuntimeException)
640 : : {
641 [ # # ]: 0 : SolarMutexGuard aGuard;
642 : :
643 : 0 : FileControl* pFileControl = (FileControl*) GetWindow();
644 [ # # ]: 0 : if ( pFileControl )
645 : : {
646 [ # # ]: 0 : pFileControl->GetEdit().SetSelection( Selection( rSel.Min, rSel.Max ) );
647 [ # # ][ # # ]: 0 : pFileControl->GetEdit().ReplaceSelected( aText );
[ # # ]
648 [ # # ]: 0 : }
649 : 0 : }
650 : :
651 : 0 : ::rtl::OUString VCLXFileControl::getText() throw(::com::sun::star::uno::RuntimeException)
652 : : {
653 [ # # ]: 0 : SolarMutexGuard aGuard;
654 : :
655 : 0 : ::rtl::OUString aText;
656 : 0 : Window* pWindow = GetWindow();
657 [ # # ]: 0 : if ( pWindow )
658 [ # # ][ # # ]: 0 : aText = pWindow->GetText();
[ # # ]
659 [ # # ]: 0 : return aText;
660 : : }
661 : :
662 : 0 : ::rtl::OUString VCLXFileControl::getSelectedText() throw(::com::sun::star::uno::RuntimeException)
663 : : {
664 [ # # ]: 0 : SolarMutexGuard aGuard;
665 : :
666 : 0 : ::rtl::OUString aText;
667 : 0 : FileControl* pFileControl = (FileControl*) GetWindow();
668 [ # # ]: 0 : if ( pFileControl)
669 [ # # ][ # # ]: 0 : aText = pFileControl->GetEdit().GetSelected();
[ # # ]
670 [ # # ]: 0 : return aText;
671 : :
672 : : }
673 : :
674 : 0 : void VCLXFileControl::setSelection( const ::com::sun::star::awt::Selection& aSelection ) throw(::com::sun::star::uno::RuntimeException)
675 : : {
676 [ # # ]: 0 : SolarMutexGuard aGuard;
677 : :
678 : 0 : FileControl* pFileControl = (FileControl*) GetWindow();
679 [ # # ]: 0 : if ( pFileControl )
680 [ # # ][ # # ]: 0 : pFileControl->GetEdit().SetSelection( Selection( aSelection.Min, aSelection.Max ) );
681 : 0 : }
682 : :
683 : 0 : ::com::sun::star::awt::Selection VCLXFileControl::getSelection() throw(::com::sun::star::uno::RuntimeException)
684 : : {
685 [ # # ]: 0 : SolarMutexGuard aGuard;
686 : :
687 : 0 : ::com::sun::star::awt::Selection aSel;
688 : 0 : FileControl* pFileControl = (FileControl*) GetWindow();
689 [ # # ]: 0 : if ( pFileControl )
690 : : {
691 [ # # ]: 0 : aSel.Min = pFileControl->GetEdit().GetSelection().Min();
692 [ # # ]: 0 : aSel.Max = pFileControl->GetEdit().GetSelection().Max();
693 : : }
694 [ # # ]: 0 : return aSel;
695 : : }
696 : :
697 : 0 : sal_Bool VCLXFileControl::isEditable() throw(::com::sun::star::uno::RuntimeException)
698 : : {
699 [ # # ]: 0 : SolarMutexGuard aGuard;
700 : :
701 : 0 : FileControl* pFileControl = (FileControl*) GetWindow();
702 [ # # ][ # # ]: 0 : return ( pFileControl && !pFileControl->GetEdit().IsReadOnly() && pFileControl->GetEdit().IsEnabled() ) ? sal_True : sal_False;
[ # # ][ # # ]
[ # # ][ # # ]
703 : : }
704 : :
705 : 0 : void VCLXFileControl::setEditable( sal_Bool bEditable ) throw(::com::sun::star::uno::RuntimeException)
706 : : {
707 [ # # ]: 0 : SolarMutexGuard aGuard;
708 : :
709 : 0 : FileControl* pFileControl = (FileControl*) GetWindow();
710 [ # # ]: 0 : if ( pFileControl )
711 [ # # ][ # # ]: 0 : pFileControl->GetEdit().SetReadOnly( !bEditable );
712 : 0 : }
713 : :
714 : 0 : void VCLXFileControl::setMaxTextLen( sal_Int16 nLen ) throw(::com::sun::star::uno::RuntimeException)
715 : : {
716 [ # # ]: 0 : SolarMutexGuard aGuard;
717 : :
718 : 0 : FileControl* pFileControl = (FileControl*) GetWindow();
719 [ # # ]: 0 : if ( pFileControl )
720 [ # # ][ # # ]: 0 : pFileControl->GetEdit().SetMaxTextLen( nLen );
721 : 0 : }
722 : :
723 : 0 : sal_Int16 VCLXFileControl::getMaxTextLen() throw(::com::sun::star::uno::RuntimeException)
724 : : {
725 [ # # ]: 0 : SolarMutexGuard aGuard;
726 : :
727 : 0 : FileControl* pFileControl = (FileControl*) GetWindow();
728 [ # # ][ # # ]: 0 : return pFileControl ? pFileControl->GetEdit().GetMaxTextLen() : 0;
[ # # ]
729 : : }
730 : :
731 : :
732 : 0 : IMPL_LINK_NOARG(VCLXFileControl, ModifyHdl)
733 : : {
734 [ # # ]: 0 : ::com::sun::star::awt::TextEvent aEvent;
735 [ # # ]: 0 : aEvent.Source = (::cppu::OWeakObject*)this;
736 [ # # ]: 0 : maTextListeners.textChanged( aEvent );
737 : :
738 [ # # ]: 0 : return 1;
739 : : }
740 : :
741 : 0 : ::com::sun::star::awt::Size VCLXFileControl::getMinimumSize() throw(::com::sun::star::uno::RuntimeException)
742 : : {
743 [ # # ]: 0 : SolarMutexGuard aGuard;
744 : :
745 : 0 : ::com::sun::star::awt::Size aSz;
746 : 0 : FileControl* pControl = (FileControl*) GetWindow();
747 [ # # ]: 0 : if ( pControl )
748 : : {
749 [ # # ]: 0 : Size aTmpSize = pControl->GetEdit().CalcMinimumSize();
750 [ # # ]: 0 : aTmpSize.Width() += pControl->GetButton().CalcMinimumSize().Width();
751 [ # # ]: 0 : aSz = AWTSize(pControl->CalcWindowSize( aTmpSize ));
752 : : }
753 [ # # ]: 0 : return aSz;
754 : : }
755 : :
756 : 0 : ::com::sun::star::awt::Size VCLXFileControl::getPreferredSize() throw(::com::sun::star::uno::RuntimeException)
757 : : {
758 : 0 : ::com::sun::star::awt::Size aSz = getMinimumSize();
759 : 0 : aSz.Height += 4;
760 : 0 : return aSz;
761 : : }
762 : :
763 : 0 : ::com::sun::star::awt::Size VCLXFileControl::calcAdjustedSize( const ::com::sun::star::awt::Size& rNewSize ) throw(::com::sun::star::uno::RuntimeException)
764 : : {
765 [ # # ]: 0 : SolarMutexGuard aGuard;
766 : :
767 : 0 : ::com::sun::star::awt::Size aSz =rNewSize;
768 : 0 : FileControl* pControl = (FileControl*) GetWindow();
769 [ # # ]: 0 : if ( pControl )
770 : : {
771 [ # # ]: 0 : ::com::sun::star::awt::Size aMinSz = getMinimumSize();
772 [ # # ]: 0 : if ( aSz.Height != aMinSz.Height )
773 : 0 : aSz.Height = aMinSz.Height;
774 : : }
775 [ # # ]: 0 : return aSz;
776 : : }
777 : :
778 : 0 : ::com::sun::star::awt::Size VCLXFileControl::getMinimumSize( sal_Int16 nCols, sal_Int16 ) throw(::com::sun::star::uno::RuntimeException)
779 : : {
780 [ # # ]: 0 : SolarMutexGuard aGuard;
781 : :
782 : 0 : ::com::sun::star::awt::Size aSz;
783 : 0 : FileControl* pControl = (FileControl*) GetWindow();
784 [ # # ]: 0 : if ( pControl )
785 : : {
786 [ # # ]: 0 : aSz = AWTSize(pControl->GetEdit().CalcSize( nCols ));
787 [ # # ]: 0 : aSz.Width += pControl->GetButton().CalcMinimumSize().Width();
788 : : }
789 [ # # ]: 0 : return aSz;
790 : : }
791 : :
792 : 0 : void VCLXFileControl::getColumnsAndLines( sal_Int16& nCols, sal_Int16& nLines ) throw(::com::sun::star::uno::RuntimeException)
793 : : {
794 [ # # ]: 0 : SolarMutexGuard aGuard;
795 : :
796 : 0 : nCols = 0;
797 : 0 : nLines = 1;
798 : 0 : FileControl* pControl = (FileControl*) GetWindow();
799 [ # # ]: 0 : if ( pControl )
800 [ # # ][ # # ]: 0 : nCols = (sal_Int16) pControl->GetEdit().GetMaxVisChars();
801 : 0 : }
802 : :
803 : 0 : void VCLXFileControl::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
804 : : {
805 : : PushPropertyIds( rIds,
806 : : // FIXME: elide duplication ?
807 : : BASEPROPERTY_HIDEINACTIVESELECTION,
808 : 0 : 0);
809 : 0 : VCLXWindow::ImplGetPropertyIds( rIds, true );
810 : 0 : }
811 : :
812 : :
813 : : // ----------------------------------------------------
814 : : // class SVTXFormattedField
815 : : // ----------------------------------------------------
816 : : // --------------------------------------------------------------------------------------
817 : 70 : SVTXFormattedField::SVTXFormattedField()
818 : : :m_pCurrentSupplier(NULL)
819 : : ,bIsStandardSupplier(sal_True)
820 : 70 : ,nKeyToSetDelayed(-1)
821 : : {
822 : 70 : }
823 : :
824 : : // --------------------------------------------------------------------------------------
825 : 70 : SVTXFormattedField::~SVTXFormattedField()
826 : : {
827 [ + + ]: 70 : if (m_pCurrentSupplier)
828 : : {
829 : 2 : m_pCurrentSupplier->release();
830 : 2 : m_pCurrentSupplier = NULL;
831 : : }
832 [ - + ]: 72 : }
833 : :
834 : : // --------------------------------------------------------------------------------------
835 : 210 : void SVTXFormattedField::SetWindow( Window* _pWindow )
836 : : {
837 : 210 : VCLXSpinField::SetWindow(_pWindow);
838 [ + + ]: 210 : if (GetFormattedField())
839 : 70 : GetFormattedField()->SetAutoColor(sal_True);
840 : 210 : }
841 : :
842 : : // --------------------------------------------------------------------------------------
843 : 5780 : void SVTXFormattedField::setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value) throw(::com::sun::star::uno::RuntimeException)
844 : : {
845 [ + - ]: 5780 : SolarMutexGuard aGuard;
846 : :
847 : 5780 : FormattedField* pField = GetFormattedField();
848 [ + - ]: 5780 : if ( pField )
849 : : {
850 [ + - ]: 5780 : sal_uInt16 nPropType = GetPropertyId( PropertyName );
851 [ + + + + : 5780 : switch (nPropType)
+ + + + +
+ + + ]
852 : : {
853 : : case BASEPROPERTY_ENFORCE_FORMAT:
854 : : {
855 : 107 : sal_Bool bEnable( sal_True );
856 [ + - ]: 107 : if ( Value >>= bEnable )
857 [ + - ]: 107 : pField->EnableNotANumber( !bEnable );
858 : : }
859 : 107 : break;
860 : :
861 : : case BASEPROPERTY_EFFECTIVE_MIN:
862 : : case BASEPROPERTY_VALUEMIN_DOUBLE:
863 [ + - ]: 118 : SetMinValue(Value);
864 : 118 : break;
865 : :
866 : : case BASEPROPERTY_EFFECTIVE_MAX:
867 : : case BASEPROPERTY_VALUEMAX_DOUBLE:
868 [ + - ]: 118 : SetMaxValue(Value);
869 : 118 : break;
870 : :
871 : : case BASEPROPERTY_EFFECTIVE_DEFAULT:
872 [ + - ]: 2 : SetDefaultValue(Value);
873 : 2 : break;
874 : :
875 : : case BASEPROPERTY_TREATASNUMBER:
876 : : {
877 : 2 : sal_Bool b = sal_Bool();
878 [ + - ]: 2 : if ( Value >>= b )
879 : 2 : SetTreatAsNumber(b);
880 : : }
881 : 2 : break;
882 : :
883 : : case BASEPROPERTY_FORMATSSUPPLIER:
884 [ - + ]: 2 : if (!Value.hasValue())
885 [ # # ][ # # ]: 0 : setFormatsSupplier(::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier > (NULL));
886 : : else
887 : : {
888 : 2 : ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier > xNFS;
889 [ + - ][ + - ]: 2 : if ( Value >>= xNFS )
890 [ + - ]: 2 : setFormatsSupplier(xNFS);
891 : : }
892 : 2 : break;
893 : : case BASEPROPERTY_FORMATKEY:
894 [ + - ]: 2 : if (!Value.hasValue())
895 [ + - ]: 2 : setFormatKey(0);
896 : : else
897 : : {
898 : 0 : sal_Int32 n = 0;
899 [ # # ]: 0 : if ( Value >>= n )
900 [ # # ]: 0 : setFormatKey(n);
901 : : }
902 : 2 : break;
903 : :
904 : : case BASEPROPERTY_EFFECTIVE_VALUE:
905 : : case BASEPROPERTY_VALUE_DOUBLE:
906 : : {
907 : 82 : const ::com::sun::star::uno::TypeClass rTC = Value.getValueType().getTypeClass();
908 [ + - ]: 82 : if (rTC != ::com::sun::star::uno::TypeClass_STRING)
909 : : // no string
910 [ + + ]: 82 : if (rTC != ::com::sun::star::uno::TypeClass_DOUBLE)
911 : : // no double
912 [ - + ]: 62 : if (Value.hasValue())
913 : : { // but a value
914 : : // try if it is something converitble
915 : 0 : sal_Int32 nValue = 0;
916 [ # # ]: 0 : if (!(Value >>= nValue))
917 [ # # ]: 0 : throw ::com::sun::star::lang::IllegalArgumentException();
918 [ # # ][ # # ]: 0 : SetValue(::com::sun::star::uno::makeAny((double)nValue));
919 : : break;
920 : : }
921 : :
922 [ + - ]: 82 : SetValue(Value);
923 : : }
924 : 82 : break;
925 : : case BASEPROPERTY_VALUESTEP_DOUBLE:
926 : : {
927 : 117 : double d = 0.0;
928 [ + - ]: 117 : if ( Value >>= d )
929 : 117 : pField->SetSpinSize( d );
930 : : else
931 : : {
932 : 0 : sal_Int32 n = 0;
933 [ # # ]: 0 : if ( Value >>= n )
934 : 0 : pField->SetSpinSize( n );
935 : : }
936 : : }
937 : 117 : break;
938 : : case BASEPROPERTY_DECIMALACCURACY:
939 : : {
940 : 108 : sal_Int32 n = 0;
941 [ + - ]: 108 : if ( Value >>= n )
942 [ + - ]: 108 : pField->SetDecimalDigits( (sal_uInt16)n );
943 : : }
944 : 108 : break;
945 : : case BASEPROPERTY_NUMSHOWTHOUSANDSEP:
946 : : {
947 : 100 : sal_Bool b = sal_Bool();
948 [ + - ]: 100 : if ( Value >>= b )
949 [ + - ]: 100 : pField->SetThousandsSep( b );
950 : : }
951 : 100 : break;
952 : :
953 : : default:
954 [ + - ]: 5022 : VCLXSpinField::setProperty( PropertyName, Value );
955 : : }
956 : :
957 [ + + ]: 5780 : if (BASEPROPERTY_TEXTCOLOR == nPropType)
958 : : { // after setting a new text color, think again about the AutoColor flag of the control
959 : : // 17.05.2001 - 86859 - frank.schoenheit@germany.sun.com
960 [ + - ]: 70 : pField->SetAutoColor(!Value.hasValue());
961 : : }
962 : : }
963 : : else
964 [ # # ][ + - ]: 5780 : VCLXSpinField::setProperty( PropertyName, Value );
965 : 5780 : }
966 : :
967 : : // --------------------------------------------------------------------------------------
968 : 24 : ::com::sun::star::uno::Any SVTXFormattedField::getProperty( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException)
969 : : {
970 [ + - ]: 24 : SolarMutexGuard aGuard;
971 : :
972 : 24 : ::com::sun::star::uno::Any aReturn;
973 : :
974 : 24 : FormattedField* pField = GetFormattedField();
975 [ + - ]: 24 : if ( pField )
976 : : {
977 [ + - ]: 24 : sal_uInt16 nPropType = GetPropertyId( PropertyName );
978 [ - - - - : 24 : switch (nPropType)
+ - - - -
+ ]
979 : : {
980 : : case BASEPROPERTY_EFFECTIVE_MIN:
981 : : case BASEPROPERTY_VALUEMIN_DOUBLE:
982 [ # # ][ # # ]: 0 : aReturn <<= GetMinValue();
983 : 0 : break;
984 : :
985 : : case BASEPROPERTY_EFFECTIVE_MAX:
986 : : case BASEPROPERTY_VALUEMAX_DOUBLE:
987 [ # # ][ # # ]: 0 : aReturn <<= GetMaxValue();
988 : 0 : break;
989 : :
990 : : case BASEPROPERTY_EFFECTIVE_DEFAULT:
991 [ # # ][ # # ]: 0 : aReturn <<= GetDefaultValue();
992 : 0 : break;
993 : :
994 : : case BASEPROPERTY_TREATASNUMBER:
995 [ # # ]: 0 : aReturn <<= GetTreatAsNumber();
996 : 0 : break;
997 : :
998 : : case BASEPROPERTY_EFFECTIVE_VALUE:
999 : : case BASEPROPERTY_VALUE_DOUBLE:
1000 [ + - ][ + - ]: 12 : aReturn <<= GetValue();
1001 : 12 : break;
1002 : :
1003 : : case BASEPROPERTY_VALUESTEP_DOUBLE:
1004 [ # # ]: 0 : aReturn <<= pField->GetSpinSize();
1005 : 0 : break;
1006 : :
1007 : : case BASEPROPERTY_DECIMALACCURACY:
1008 [ # # ][ # # ]: 0 : aReturn <<= pField->GetDecimalDigits();
1009 : 0 : break;
1010 : :
1011 : : case BASEPROPERTY_FORMATSSUPPLIER:
1012 : : {
1013 [ # # ]: 0 : if (!bIsStandardSupplier)
1014 : : { // ansonsten void
1015 [ # # ]: 0 : ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier > xSupplier = getFormatsSupplier();
1016 [ # # ]: 0 : aReturn <<= xSupplier;
1017 : : }
1018 : : }
1019 : 0 : break;
1020 : :
1021 : : case BASEPROPERTY_FORMATKEY:
1022 : : {
1023 [ # # ]: 0 : if (!bIsStandardSupplier)
1024 [ # # ]: 0 : aReturn <<= getFormatKey();
1025 : : }
1026 : 0 : break;
1027 : :
1028 : : default:
1029 [ + - ][ + - ]: 24 : aReturn <<= VCLXSpinField::getProperty(PropertyName);
1030 : : }
1031 : : }
1032 [ + - ]: 24 : return aReturn;
1033 : : }
1034 : :
1035 : : // --------------------------------------------------------------------------------------
1036 : 2 : ::com::sun::star::uno::Any SVTXFormattedField::convertEffectiveValue(const ::com::sun::star::uno::Any& rValue)
1037 : : {
1038 : 2 : ::com::sun::star::uno::Any aReturn;
1039 : :
1040 : 2 : FormattedField* pField = GetFormattedField();
1041 [ - + ]: 2 : if (!pField)
1042 : 0 : return aReturn;
1043 : :
1044 [ - - + ]: 2 : switch (rValue.getValueType().getTypeClass())
1045 : : {
1046 : : case ::com::sun::star::uno::TypeClass_DOUBLE:
1047 [ # # ]: 0 : if (pField->TreatingAsNumber())
1048 : : {
1049 : 0 : double d = 0.0;
1050 : 0 : rValue >>= d;
1051 [ # # ]: 0 : aReturn <<= d;
1052 : : }
1053 : : else
1054 : : {
1055 : 0 : SvNumberFormatter* pFormatter = pField->GetFormatter();
1056 [ # # ]: 0 : if (!pFormatter)
1057 [ # # ]: 0 : pFormatter = pField->StandardFormatter();
1058 : : // should never fail
1059 : :
1060 : : Color* pDum;
1061 : 0 : double d = 0.0;
1062 : 0 : rValue >>= d;
1063 [ # # ]: 0 : String sConverted;
1064 [ # # ]: 0 : pFormatter->GetOutputString(d, 0, sConverted, &pDum);
1065 [ # # ][ # # ]: 0 : aReturn <<= ::rtl::OUString( sConverted );
[ # # ]
1066 : : }
1067 : 0 : break;
1068 : : case ::com::sun::star::uno::TypeClass_STRING:
1069 : : {
1070 : 0 : ::rtl::OUString aStr;
1071 : 0 : rValue >>= aStr;
1072 [ # # ]: 0 : String sValue = aStr;
1073 [ # # ]: 0 : if (pField->TreatingAsNumber())
1074 : : {
1075 : 0 : SvNumberFormatter* pFormatter = pField->GetFormatter();
1076 [ # # ]: 0 : if (!pFormatter)
1077 [ # # ]: 0 : pFormatter = pField->StandardFormatter();
1078 : :
1079 : : double dVal;
1080 : 0 : sal_uInt32 nTestFormat(0);
1081 [ # # ][ # # ]: 0 : if (!pFormatter->IsNumberFormat(sValue, nTestFormat, dVal))
1082 : 0 : aReturn.clear();
1083 [ # # ]: 0 : aReturn <<=dVal;
1084 : : }
1085 : : else
1086 [ # # ][ # # ]: 0 : aReturn <<= aStr;
1087 : : }
1088 : 0 : break;
1089 : : default:
1090 : 2 : aReturn.clear();
1091 : 2 : break;
1092 : : }
1093 : 2 : return aReturn;
1094 : : }
1095 : :
1096 : : // --------------------------------------------------------------------------------------
1097 : 118 : void SVTXFormattedField::SetMinValue(const ::com::sun::star::uno::Any& rValue)
1098 : : {
1099 : 118 : FormattedField* pField = GetFormattedField();
1100 [ - + ]: 118 : if (!pField)
1101 : 118 : return;
1102 : :
1103 [ + + ]: 118 : switch (rValue.getValueType().getTypeClass())
1104 : :
1105 : : {
1106 : : case ::com::sun::star::uno::TypeClass_DOUBLE:
1107 : : {
1108 : 116 : double d = 0.0;
1109 : 116 : rValue >>= d;
1110 [ + - ]: 116 : pField->SetMinValue(d);
1111 : : }
1112 : 116 : break;
1113 : : default:
1114 : : DBG_ASSERT(rValue.getValueType().getTypeClass() == ::com::sun::star::uno::TypeClass_VOID, "SVTXFormattedField::SetMinValue : invalid argument (an exception will be thrown) !");
1115 [ - + ]: 2 : if ( rValue.getValueType().getTypeClass() != ::com::sun::star::uno::TypeClass_VOID )
1116 : :
1117 : : {
1118 [ # # ]: 0 : throw ::com::sun::star::lang::IllegalArgumentException();
1119 : : }
1120 : 2 : pField->ClearMinValue();
1121 : 2 : break;
1122 : : }
1123 : : }
1124 : :
1125 : : // --------------------------------------------------------------------------------------
1126 : 0 : ::com::sun::star::uno::Any SVTXFormattedField::GetMinValue()
1127 : : {
1128 : 0 : FormattedField* pField = GetFormattedField();
1129 [ # # ][ # # ]: 0 : if (!pField || !pField->HasMinValue())
[ # # ]
1130 : 0 : return ::com::sun::star::uno::Any();
1131 : :
1132 : 0 : ::com::sun::star::uno::Any aReturn;
1133 [ # # ]: 0 : aReturn <<= pField->GetMinValue();
1134 : 0 : return aReturn;
1135 : : }
1136 : :
1137 : : // --------------------------------------------------------------------------------------
1138 : 118 : void SVTXFormattedField::SetMaxValue(const ::com::sun::star::uno::Any& rValue)
1139 : : {
1140 : 118 : FormattedField* pField = GetFormattedField();
1141 [ - + ]: 118 : if (!pField)
1142 : 118 : return;
1143 : :
1144 [ + + ]: 118 : switch (rValue.getValueType().getTypeClass())
1145 : :
1146 : : {
1147 : : case ::com::sun::star::uno::TypeClass_DOUBLE:
1148 : : {
1149 : 116 : double d = 0.0;
1150 : 116 : rValue >>= d;
1151 [ + - ]: 116 : pField->SetMaxValue(d);
1152 : : }
1153 : 116 : break;
1154 : : default:
1155 [ - + ]: 2 : if (rValue.getValueType().getTypeClass() != ::com::sun::star::uno::TypeClass_VOID)
1156 : :
1157 : : {
1158 [ # # ]: 0 : throw ::com::sun::star::lang::IllegalArgumentException();
1159 : : }
1160 : 2 : pField->ClearMaxValue();
1161 : 2 : break;
1162 : : }
1163 : : }
1164 : :
1165 : : // --------------------------------------------------------------------------------------
1166 : 0 : ::com::sun::star::uno::Any SVTXFormattedField::GetMaxValue()
1167 : : {
1168 : 0 : FormattedField* pField = GetFormattedField();
1169 [ # # ][ # # ]: 0 : if (!pField || !pField->HasMaxValue())
[ # # ]
1170 : 0 : return ::com::sun::star::uno::Any();
1171 : :
1172 : 0 : ::com::sun::star::uno::Any aReturn;
1173 [ # # ]: 0 : aReturn <<= pField->GetMaxValue();
1174 : 0 : return aReturn;
1175 : : }
1176 : :
1177 : : // --------------------------------------------------------------------------------------
1178 : 2 : void SVTXFormattedField::SetDefaultValue(const ::com::sun::star::uno::Any& rValue)
1179 : : {
1180 : 2 : FormattedField* pField = GetFormattedField();
1181 [ + - ]: 2 : if (!pField)
1182 : 2 : return;
1183 : :
1184 [ + - ]: 2 : ::com::sun::star::uno::Any aConverted = convertEffectiveValue(rValue);
1185 : :
1186 [ - - + ]: 2 : switch (aConverted.getValueType().getTypeClass())
1187 : :
1188 : : {
1189 : : case ::com::sun::star::uno::TypeClass_DOUBLE:
1190 : : {
1191 : 0 : double d = 0.0;
1192 : 0 : aConverted >>= d;
1193 : 0 : pField->SetDefaultValue(d);
1194 : : }
1195 : 0 : break;
1196 : : case ::com::sun::star::uno::TypeClass_STRING:
1197 : : {
1198 : 0 : ::rtl::OUString aStr;
1199 : 0 : aConverted >>= aStr;
1200 [ # # ][ # # ]: 0 : pField->SetDefaultText( aStr );
[ # # ]
1201 : : }
1202 : 0 : break;
1203 : : default:
1204 [ + - ]: 2 : pField->EnableEmptyField(sal_True);
1205 : : // nur noch void erlaubt
1206 : 2 : break;
1207 : 2 : }
1208 : : }
1209 : :
1210 : : // --------------------------------------------------------------------------------------
1211 : 0 : ::com::sun::star::uno::Any SVTXFormattedField::GetDefaultValue()
1212 : : {
1213 : 0 : FormattedField* pField = GetFormattedField();
1214 [ # # ][ # # ]: 0 : if (!pField || pField->IsEmptyFieldEnabled())
[ # # ]
1215 : 0 : return ::com::sun::star::uno::Any();
1216 : :
1217 : 0 : ::com::sun::star::uno::Any aReturn;
1218 [ # # ]: 0 : if (pField->TreatingAsNumber())
1219 [ # # ]: 0 : aReturn <<= pField->GetDefaultValue();
1220 : : else
1221 [ # # ][ # # ]: 0 : aReturn <<= ::rtl::OUString( pField->GetDefaultText() );
[ # # ][ # # ]
1222 : 0 : return aReturn;
1223 : : }
1224 : :
1225 : : // --------------------------------------------------------------------------------------
1226 : 0 : sal_Bool SVTXFormattedField::GetTreatAsNumber()
1227 : : {
1228 : 0 : FormattedField* pField = GetFormattedField();
1229 [ # # ]: 0 : if (pField)
1230 : 0 : return pField->TreatingAsNumber();
1231 : :
1232 : 0 : return sal_True;
1233 : : }
1234 : :
1235 : : // --------------------------------------------------------------------------------------
1236 : 2 : void SVTXFormattedField::SetTreatAsNumber(sal_Bool bSet)
1237 : : {
1238 : 2 : FormattedField* pField = GetFormattedField();
1239 [ + - ]: 2 : if (pField)
1240 : 2 : pField->TreatAsNumber(bSet);
1241 : 2 : }
1242 : :
1243 : : // --------------------------------------------------------------------------------------
1244 : 14 : ::com::sun::star::uno::Any SVTXFormattedField::GetValue()
1245 : : {
1246 : 14 : FormattedField* pField = GetFormattedField();
1247 [ - + ]: 14 : if (!pField)
1248 : 0 : return ::com::sun::star::uno::Any();
1249 : :
1250 : 14 : ::com::sun::star::uno::Any aReturn;
1251 [ - + ]: 14 : if (!pField->TreatingAsNumber())
1252 : : {
1253 [ # # ][ # # ]: 0 : ::rtl::OUString sText = pField->GetTextValue();
[ # # ]
1254 [ # # ]: 0 : aReturn <<= sText;
1255 : : }
1256 : : else
1257 : : {
1258 [ + - ][ + - ]: 14 : if (pField->GetText().Len()) // empty wird erst mal standardmaessig als void nach draussen gereicht
[ + + ]
1259 [ + - ][ + - ]: 12 : aReturn <<= pField->GetValue();
1260 : : }
1261 : :
1262 : 14 : return aReturn;
1263 : : }
1264 : :
1265 : : // --------------------------------------------------------------------------------------
1266 : 84 : void SVTXFormattedField::SetValue(const ::com::sun::star::uno::Any& rValue)
1267 : : {
1268 : 84 : FormattedField* pField = GetFormattedField();
1269 [ - + ]: 84 : if (!pField)
1270 : 84 : return;
1271 : :
1272 [ + + ]: 84 : if (!rValue.hasValue())
1273 : : {
1274 [ + - ]: 64 : pField->SetText(String());
1275 : : }
1276 : : else
1277 : : {
1278 [ + - ]: 20 : if (rValue.getValueType().getTypeClass() == ::com::sun::star::uno::TypeClass_DOUBLE )
1279 : : {
1280 : 20 : double d = 0.0;
1281 : 20 : rValue >>= d;
1282 [ + - ]: 20 : pField->SetValue(d);
1283 : : }
1284 : : else
1285 : : {
1286 : : DBG_ASSERT(rValue.getValueType().getTypeClass() == ::com::sun::star::uno::TypeClass_STRING, "SVTXFormattedField::SetValue : invalid argument !");
1287 : :
1288 : 0 : ::rtl::OUString sText;
1289 : 0 : rValue >>= sText;
1290 [ # # ]: 0 : String aStr( sText );
1291 [ # # ]: 0 : if (!pField->TreatingAsNumber())
1292 [ # # ]: 0 : pField->SetTextFormatted(aStr);
1293 : : else
1294 [ # # ][ # # ]: 0 : pField->SetTextValue(aStr);
1295 : : }
1296 : : }
1297 : : // NotifyTextListeners();
1298 : : }
1299 : :
1300 : : // --------------------------------------------------------------------------------------
1301 : 0 : ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier > SVTXFormattedField::getFormatsSupplier(void) const
1302 : : {
1303 [ # # ]: 0 : return ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier > ((::com::sun::star::util::XNumberFormatsSupplier*)m_pCurrentSupplier);
1304 : : }
1305 : :
1306 : : // --------------------------------------------------------------------------------------
1307 : 2 : void SVTXFormattedField::setFormatsSupplier(const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier > & xSupplier)
1308 : : {
1309 : 2 : FormattedField* pField = GetFormattedField();
1310 : :
1311 : 2 : SvNumberFormatsSupplierObj* pNew = NULL;
1312 [ - + ]: 2 : if (!xSupplier.is())
1313 : : {
1314 [ # # ]: 0 : if (pField)
1315 : : {
1316 [ # # ]: 0 : pNew = new SvNumberFormatsSupplierObj(pField->StandardFormatter());
1317 : 0 : bIsStandardSupplier = sal_True;
1318 : : }
1319 : : }
1320 : : else
1321 : : {
1322 [ + - ]: 2 : pNew = SvNumberFormatsSupplierObj::getImplementation(xSupplier);
1323 : 2 : bIsStandardSupplier = sal_False;
1324 : : }
1325 : :
1326 [ - + ]: 2 : if (!pNew)
1327 : 2 : return; // TODO : wie das behandeln ?
1328 : :
1329 [ - + ]: 2 : if (m_pCurrentSupplier)
1330 : 0 : m_pCurrentSupplier->release();
1331 : 2 : m_pCurrentSupplier = pNew;
1332 : 2 : m_pCurrentSupplier->acquire();
1333 [ + - ]: 2 : if (pField)
1334 : : {
1335 : : // den aktuellen Value mit hinueberretten
1336 [ + - ]: 2 : ::com::sun::star::uno::Any aCurrent = GetValue();
1337 [ + - ][ + - ]: 2 : pField->SetFormatter(m_pCurrentSupplier->GetNumberFormatter(), sal_False);
1338 [ + - ]: 2 : if (nKeyToSetDelayed != -1)
1339 : : {
1340 [ + - ]: 2 : pField->SetFormatKey(nKeyToSetDelayed);
1341 : 2 : nKeyToSetDelayed = -1;
1342 : : }
1343 [ + - ]: 2 : SetValue(aCurrent);
1344 [ + - ]: 2 : NotifyTextListeners();
1345 : : }
1346 : : }
1347 : :
1348 : : // --------------------------------------------------------------------------------------
1349 : 0 : sal_Int32 SVTXFormattedField::getFormatKey(void) const
1350 : : {
1351 : 0 : FormattedField* pField = GetFormattedField();
1352 [ # # ]: 0 : return pField ? pField->GetFormatKey() : 0;
1353 : : }
1354 : :
1355 : : // --------------------------------------------------------------------------------------
1356 : 2 : void SVTXFormattedField::setFormatKey(sal_Int32 nKey)
1357 : : {
1358 : 2 : FormattedField* pField = GetFormattedField();
1359 [ + - ]: 2 : if (pField)
1360 : : {
1361 [ - + ]: 2 : if (pField->GetFormatter())
1362 : 0 : pField->SetFormatKey(nKey);
1363 : : else
1364 : : { // Wahrscheinlich bin ich gerade in einem Block, in dem erst der Key und dann der Formatter gesetzt
1365 : : // wird, das passiert initial mit ziemlicher Sicherheit, da die Properties in alphabetischer Reihenfolge
1366 : : // gesetzt werden, und der FormatsSupplier nun mal vor dem FormatKey kommt
1367 : 2 : nKeyToSetDelayed = nKey;
1368 : : }
1369 : 2 : NotifyTextListeners();
1370 : : }
1371 : 2 : }
1372 : :
1373 : : // --------------------------------------------------------------------------------------
1374 : 4 : void SVTXFormattedField::NotifyTextListeners()
1375 : : {
1376 [ - + ]: 4 : if ( GetTextListeners().getLength() )
1377 : : {
1378 [ # # ]: 0 : ::com::sun::star::awt::TextEvent aEvent;
1379 [ # # ]: 0 : aEvent.Source = (::cppu::OWeakObject*)this;
1380 [ # # ][ # # ]: 0 : GetTextListeners().textChanged( aEvent );
1381 : : }
1382 : 4 : }
1383 : :
1384 : 0 : void SVTXFormattedField::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
1385 : : {
1386 : : PushPropertyIds( rIds,
1387 : : // FIXME: elide duplication ?
1388 : : BASEPROPERTY_EFFECTIVE_MIN,
1389 : : BASEPROPERTY_VALUEMIN_DOUBLE,
1390 : : BASEPROPERTY_EFFECTIVE_MAX,
1391 : : BASEPROPERTY_VALUEMAX_DOUBLE,
1392 : : BASEPROPERTY_EFFECTIVE_DEFAULT,
1393 : : BASEPROPERTY_TREATASNUMBER,
1394 : : BASEPROPERTY_EFFECTIVE_VALUE,
1395 : : BASEPROPERTY_VALUE_DOUBLE,
1396 : : BASEPROPERTY_VALUESTEP_DOUBLE,
1397 : : BASEPROPERTY_DECIMALACCURACY,
1398 : : BASEPROPERTY_FORMATSSUPPLIER,
1399 : : BASEPROPERTY_NUMSHOWTHOUSANDSEP,
1400 : : BASEPROPERTY_FORMATKEY,
1401 : : BASEPROPERTY_TREATASNUMBER,
1402 : : BASEPROPERTY_ENFORCE_FORMAT,
1403 : 0 : 0);
1404 : 0 : VCLXWindow::ImplGetPropertyIds( rIds, true );
1405 : 0 : VCLXSpinField::ImplGetPropertyIds( rIds );
1406 : 0 : }
1407 : :
1408 : :
1409 : : // ----------------------------------------------------
1410 : : // class SVTXRoadmap
1411 : : // ----------------------------------------------------
1412 : :
1413 : : using namespace svt;
1414 : :
1415 : : // --------------------------------------------------------------------------------------
1416 [ # # ]: 0 : SVTXRoadmap::SVTXRoadmap() : maItemListeners( *this )
1417 : : {
1418 : 0 : }
1419 : :
1420 : : // --------------------------------------------------------------------------------------
1421 [ # # ]: 0 : SVTXRoadmap::~SVTXRoadmap()
1422 : : {
1423 [ # # ]: 0 : }
1424 : :
1425 : 0 : void SVTXRoadmap::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
1426 : : {
1427 [ # # ]: 0 : switch ( rVclWindowEvent.GetId() )
1428 : : {
1429 : : case VCLEVENT_ROADMAP_ITEMSELECTED:
1430 : : {
1431 [ # # ]: 0 : SolarMutexGuard aGuard;
1432 : 0 : ::svt::ORoadmap* pField = GetRoadmap();
1433 [ # # ]: 0 : if ( pField )
1434 : : {
1435 [ # # ]: 0 : sal_Int16 CurItemID = pField->GetCurrentRoadmapItemID();
1436 [ # # ]: 0 : ::com::sun::star::awt::ItemEvent aEvent;
1437 : 0 : aEvent.Selected = CurItemID;
1438 : 0 : aEvent.Highlighted = CurItemID;
1439 : 0 : aEvent.ItemId = CurItemID;
1440 [ # # ][ # # ]: 0 : maItemListeners.itemStateChanged( aEvent );
1441 [ # # ]: 0 : }
1442 : : }
1443 : 0 : break;
1444 : : default:
1445 : 0 : SVTXRoadmap_Base::ProcessWindowEvent( rVclWindowEvent );
1446 : 0 : break;
1447 : : }
1448 : 0 : }
1449 : :
1450 : :
1451 : 0 : void SVTXRoadmap::propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& evt ) throw (::com::sun::star::uno::RuntimeException)
1452 : : {
1453 [ # # ]: 0 : SolarMutexGuard aGuard;
1454 : 0 : ::svt::ORoadmap* pField = GetRoadmap();
1455 [ # # ]: 0 : if ( pField )
1456 : : {
1457 : 0 : ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xRoadmapItem;
1458 [ # # ]: 0 : xRoadmapItem = evt.Source;
1459 : 0 : sal_Int32 nID = 0;
1460 [ # # ]: 0 : ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > xPropertySet( xRoadmapItem, ::com::sun::star::uno::UNO_QUERY );
1461 [ # # ][ # # ]: 0 : ::com::sun::star::uno::Any aValue = xPropertySet->getPropertyValue(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ID" )));
[ # # ]
1462 : 0 : aValue >>= nID;
1463 : :
1464 : 0 : ::com::sun::star::uno::Any rVal = evt.NewValue;
1465 : 0 : evt.NewValue >>= rVal;
1466 : 0 : ::rtl::OUString sPropertyName = evt.PropertyName;
1467 [ # # ]: 0 : if ( sPropertyName == "Enabled" )
1468 : : {
1469 : 0 : sal_Bool bEnable = false;
1470 : 0 : evt.NewValue >>= bEnable;
1471 [ # # ]: 0 : pField->EnableRoadmapItem( (RoadmapTypes::ItemId)nID , bEnable );
1472 : : }
1473 [ # # ]: 0 : else if ( sPropertyName == "Label" )
1474 : : {
1475 : 0 : ::rtl::OUString sLabel;
1476 : 0 : evt.NewValue >>= sLabel;
1477 [ # # ]: 0 : pField->ChangeRoadmapItemLabel( (RoadmapTypes::ItemId)nID , sLabel );
1478 : : }
1479 [ # # ]: 0 : else if ( sPropertyName == "ID" )
1480 : : {
1481 : 0 : sal_Int32 nNewID = 0;
1482 : 0 : evt.NewValue >>= nNewID;
1483 : 0 : evt.OldValue >>= nID;
1484 [ # # ]: 0 : pField->ChangeRoadmapItemID( (RoadmapTypes::ItemId)nID, (RoadmapTypes::ItemId)nNewID );
1485 : 0 : }
1486 : : // else
1487 : : // Todo: handle Interactive appropriately
1488 [ # # ]: 0 : }
1489 : 0 : }
1490 : :
1491 : :
1492 : 0 : void SVTXRoadmap::addItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l ) throw (::com::sun::star::uno::RuntimeException)
1493 : : {
1494 : 0 : maItemListeners.addInterface( l );
1495 : 0 : }
1496 : :
1497 : 0 : void SVTXRoadmap::removeItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l ) throw (::com::sun::star::uno::RuntimeException)
1498 : : {
1499 : 0 : maItemListeners.removeInterface( l );
1500 : 0 : }
1501 : :
1502 : 0 : RMItemData SVTXRoadmap::GetRMItemData( const ::com::sun::star::container::ContainerEvent& _rEvent )
1503 : : {
1504 : 0 : RMItemData aCurRMItemData;
1505 : 0 : ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xRoadmapItem;
1506 [ # # ]: 0 : _rEvent.Element >>= xRoadmapItem;
1507 [ # # ]: 0 : ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > xPropertySet( xRoadmapItem, ::com::sun::star::uno::UNO_QUERY );
1508 [ # # ]: 0 : if ( xPropertySet.is() )
1509 : : {
1510 [ # # ][ # # ]: 0 : ::com::sun::star::uno::Any aValue = xPropertySet->getPropertyValue(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Label" )));
[ # # ]
1511 : 0 : aValue >>= aCurRMItemData.Label;
1512 [ # # ][ # # ]: 0 : aValue = xPropertySet->getPropertyValue(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ID" )));
[ # # ]
1513 : 0 : aValue >>= aCurRMItemData.n_ID;
1514 [ # # ][ # # ]: 0 : aValue = xPropertySet->getPropertyValue(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Enabled" )));
[ # # ]
1515 : 0 : aValue >>= aCurRMItemData.b_Enabled;
1516 : : }
1517 : 0 : return aCurRMItemData;
1518 : : }
1519 : :
1520 : 0 : void SVTXRoadmap::elementInserted( const ::com::sun::star::container::ContainerEvent& _rEvent )throw(::com::sun::star::uno::RuntimeException)
1521 : : {
1522 [ # # ]: 0 : SolarMutexGuard aGuard;
1523 : 0 : ::svt::ORoadmap* pField = GetRoadmap();
1524 [ # # ]: 0 : if ( pField )
1525 : : {
1526 [ # # ]: 0 : RMItemData CurItemData = GetRMItemData( _rEvent );
1527 : 0 : sal_Int32 InsertIndex = 0;
1528 : 0 : _rEvent.Accessor >>= InsertIndex;
1529 [ # # ]: 0 : pField->InsertRoadmapItem( InsertIndex, CurItemData.Label, (RoadmapTypes::ItemId)CurItemData.n_ID, CurItemData.b_Enabled );
1530 [ # # ]: 0 : }
1531 : 0 : }
1532 : :
1533 : 0 : void SVTXRoadmap::elementRemoved( const ::com::sun::star::container::ContainerEvent& _rEvent )throw(::com::sun::star::uno::RuntimeException)
1534 : : {
1535 [ # # ]: 0 : SolarMutexGuard aGuard;
1536 : 0 : ::svt::ORoadmap* pField = GetRoadmap();
1537 [ # # ]: 0 : if ( pField )
1538 : : {
1539 : 0 : sal_Int32 DelIndex = 0;
1540 : 0 : _rEvent.Accessor >>= DelIndex;
1541 [ # # ]: 0 : pField->DeleteRoadmapItem(DelIndex);
1542 [ # # ]: 0 : }
1543 : 0 : }
1544 : :
1545 : 0 : void SVTXRoadmap::elementReplaced( const ::com::sun::star::container::ContainerEvent& _rEvent )throw(::com::sun::star::uno::RuntimeException)
1546 : : {
1547 [ # # ]: 0 : SolarMutexGuard aGuard;
1548 : 0 : ::svt::ORoadmap* pField = GetRoadmap();
1549 [ # # ]: 0 : if ( pField )
1550 : : {
1551 [ # # ]: 0 : RMItemData CurItemData = GetRMItemData( _rEvent );
1552 : 0 : sal_Int32 ReplaceIndex = 0;
1553 : 0 : _rEvent.Accessor >>= ReplaceIndex;
1554 [ # # ]: 0 : pField->ReplaceRoadmapItem( ReplaceIndex, CurItemData.Label, (RoadmapTypes::ItemId)CurItemData.n_ID, CurItemData.b_Enabled );
1555 [ # # ]: 0 : }
1556 : 0 : }
1557 : :
1558 : :
1559 : :
1560 : : // --------------------------------------------------------------------------------------
1561 : 0 : void SVTXRoadmap::setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value) throw(::com::sun::star::uno::RuntimeException)
1562 : : {
1563 [ # # ]: 0 : SolarMutexGuard aGuard;
1564 : :
1565 : 0 : ::svt::ORoadmap* pField = GetRoadmap();
1566 [ # # ]: 0 : if ( pField )
1567 : : {
1568 [ # # ]: 0 : sal_uInt16 nPropType = GetPropertyId( PropertyName );
1569 [ # # # # : 0 : switch (nPropType)
# ]
1570 : : {
1571 : : case BASEPROPERTY_COMPLETE:
1572 : : {
1573 : 0 : sal_Bool b = false;
1574 : 0 : Value >>= b;
1575 [ # # ]: 0 : pField->SetRoadmapComplete( b);
1576 : : }
1577 : 0 : break;
1578 : :
1579 : : case BASEPROPERTY_ACTIVATED:
1580 : : {
1581 : 0 : sal_Bool b = false;
1582 : 0 : Value >>= b;
1583 [ # # ]: 0 : pField->SetRoadmapInteractive( b);
1584 : : }
1585 : 0 : break;
1586 : :
1587 : : case BASEPROPERTY_CURRENTITEMID:
1588 : : {
1589 : 0 : sal_Int32 nId = 0;
1590 : 0 : Value >>= nId;
1591 [ # # ]: 0 : pField->SelectRoadmapItemByID( (RoadmapTypes::ItemId)nId );
1592 : : }
1593 : 0 : break;
1594 : :
1595 : : case BASEPROPERTY_TEXT:
1596 : : {
1597 : 0 : ::rtl::OUString aStr;
1598 : 0 : Value >>= aStr;
1599 [ # # ][ # # ]: 0 : pField->SetText( aStr );
[ # # ]
1600 [ # # ]: 0 : pField->Invalidate();
1601 : : }
1602 : 0 : break;
1603 : :
1604 : : default:
1605 [ # # ]: 0 : SVTXRoadmap_Base::setProperty( PropertyName, Value );
1606 : 0 : break;
1607 : : }
1608 : :
1609 : : }
1610 : : else
1611 [ # # ][ # # ]: 0 : SVTXRoadmap_Base::setProperty( PropertyName, Value );
1612 : 0 : }
1613 : :
1614 : :
1615 : : // --------------------------------------------------------------------------------------
1616 : 0 : ::com::sun::star::uno::Any SVTXRoadmap::getProperty( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException)
1617 : : {
1618 [ # # ]: 0 : SolarMutexGuard aGuard;
1619 : :
1620 : 0 : ::com::sun::star::uno::Any aReturn;
1621 : :
1622 : 0 : ::svt::ORoadmap* pField = GetRoadmap();
1623 [ # # ]: 0 : if ( pField )
1624 : : {
1625 [ # # ]: 0 : sal_uInt16 nPropType = GetPropertyId( PropertyName );
1626 [ # # # # ]: 0 : switch (nPropType)
1627 : : {
1628 : : case BASEPROPERTY_COMPLETE:
1629 [ # # ][ # # ]: 0 : aReturn <<= pField->IsRoadmapComplete();
1630 : 0 : break;
1631 : : case BASEPROPERTY_ACTIVATED:
1632 [ # # ][ # # ]: 0 : aReturn <<= pField->IsRoadmapInteractive();
1633 : 0 : break;
1634 : : case BASEPROPERTY_CURRENTITEMID:
1635 [ # # ][ # # ]: 0 : aReturn <<= pField->GetCurrentRoadmapItemID();
1636 : 0 : break;
1637 : : default:
1638 [ # # ]: 0 : aReturn = SVTXRoadmap_Base::getProperty(PropertyName);
1639 : 0 : break;
1640 : : }
1641 : : }
1642 [ # # ]: 0 : return aReturn;
1643 : : }
1644 : :
1645 : 0 : void SVTXRoadmap::ImplSetNewImage()
1646 : : {
1647 : : OSL_PRECOND( GetWindow(), "SVTXRoadmap::ImplSetNewImage: window is required to be not-NULL!" );
1648 : 0 : ::svt::ORoadmap* pButton = static_cast< ::svt::ORoadmap* >( GetWindow() );
1649 [ # # ]: 0 : pButton->SetRoadmapBitmap( GetImage().GetBitmapEx() );
1650 : 0 : }
1651 : :
1652 : 0 : void SVTXRoadmap::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
1653 : : {
1654 : : PushPropertyIds( rIds,
1655 : : BASEPROPERTY_COMPLETE,
1656 : : BASEPROPERTY_ACTIVATED,
1657 : : BASEPROPERTY_CURRENTITEMID,
1658 : : BASEPROPERTY_TEXT,
1659 : 0 : 0);
1660 : 0 : VCLXWindow::ImplGetPropertyIds( rIds, true );
1661 : 0 : VCLXGraphicControl::ImplGetPropertyIds( rIds );
1662 : 0 : }
1663 : :
1664 : : // ----------------------------------------------------
1665 : : // class SVTXNumericField
1666 : : // ----------------------------------------------------
1667 [ + - ]: 34 : SVTXNumericField::SVTXNumericField()
1668 : : {
1669 : 34 : }
1670 : :
1671 [ + - ]: 34 : SVTXNumericField::~SVTXNumericField()
1672 : : {
1673 [ - + ]: 68 : }
1674 : :
1675 : 6677 : ::com::sun::star::uno::Any SVTXNumericField::queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException)
1676 : : {
1677 : : ::com::sun::star::uno::Any aRet = ::cppu::queryInterface( rType,
1678 : : (static_cast< ::com::sun::star::awt::XNumericField* >(this)),
1679 [ + - ]: 6677 : (static_cast< ::com::sun::star::lang::XTypeProvider* >(this)) );
1680 [ + + ][ + - ]: 6677 : return (aRet.hasValue() ? aRet : SVTXFormattedField::queryInterface( rType ));
1681 : : }
1682 : :
1683 : : // ::com::sun::star::lang::XTypeProvider
1684 [ # # ][ # # ]: 0 : IMPL_XTYPEPROVIDER_START( SVTXNumericField )
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
1685 [ # # ]: 0 : getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XNumericField>* ) NULL ),
1686 : : SVTXFormattedField::getTypes()
1687 [ # # ][ # # ]: 0 : IMPL_XTYPEPROVIDER_END
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ]
1688 : :
1689 : :
1690 : 0 : void SVTXNumericField::setValue( double Value ) throw(::com::sun::star::uno::RuntimeException)
1691 : : {
1692 [ # # ]: 0 : SolarMutexGuard aGuard;
1693 : :
1694 : 0 : FormattedField* pField = GetFormattedField();
1695 [ # # ]: 0 : if ( pField )
1696 [ # # ][ # # ]: 0 : pField->SetValue( Value );
1697 : 0 : }
1698 : :
1699 : 212 : double SVTXNumericField::getValue() throw(::com::sun::star::uno::RuntimeException)
1700 : : {
1701 [ + - ]: 212 : SolarMutexGuard aGuard;
1702 : :
1703 : 212 : FormattedField* pField = GetFormattedField();
1704 [ + - ][ + - ]: 212 : return pField ? pField->GetValue() : 0;
[ + - ]
1705 : : }
1706 : :
1707 : 0 : void SVTXNumericField::setMin( double Value ) throw(::com::sun::star::uno::RuntimeException)
1708 : : {
1709 [ # # ]: 0 : SolarMutexGuard aGuard;
1710 : :
1711 : 0 : FormattedField* pField = GetFormattedField();
1712 [ # # ]: 0 : if ( pField )
1713 [ # # ][ # # ]: 0 : pField->SetMinValue( Value );
1714 : 0 : }
1715 : :
1716 : 0 : double SVTXNumericField::getMin() throw(::com::sun::star::uno::RuntimeException)
1717 : : {
1718 [ # # ]: 0 : SolarMutexGuard aGuard;
1719 : :
1720 : 0 : FormattedField* pField = GetFormattedField();
1721 [ # # ][ # # ]: 0 : return pField ? pField->GetMinValue() : 0;
1722 : : }
1723 : :
1724 : 0 : void SVTXNumericField::setMax( double Value ) throw(::com::sun::star::uno::RuntimeException)
1725 : : {
1726 [ # # ]: 0 : SolarMutexGuard aGuard;
1727 : :
1728 : 0 : FormattedField* pField = GetFormattedField();
1729 [ # # ]: 0 : if ( pField )
1730 [ # # ][ # # ]: 0 : pField->SetMaxValue( Value );
1731 : 0 : }
1732 : :
1733 : 0 : double SVTXNumericField::getMax() throw(::com::sun::star::uno::RuntimeException)
1734 : : {
1735 [ # # ]: 0 : SolarMutexGuard aGuard;
1736 : :
1737 : 0 : FormattedField* pField = GetFormattedField();
1738 [ # # ][ # # ]: 0 : return pField ? pField->GetMaxValue() : 0;
1739 : : }
1740 : :
1741 : 42 : void SVTXNumericField::setFirst( double Value ) throw(::com::sun::star::uno::RuntimeException)
1742 : : {
1743 [ + - ]: 42 : SolarMutexGuard aGuard;
1744 : :
1745 : 42 : FormattedField* pField = GetFormattedField();
1746 [ + - ]: 42 : if ( pField )
1747 [ + - ]: 42 : pField->SetSpinFirst( Value );
1748 : 42 : }
1749 : :
1750 : 0 : double SVTXNumericField::getFirst() throw(::com::sun::star::uno::RuntimeException)
1751 : : {
1752 [ # # ]: 0 : SolarMutexGuard aGuard;
1753 : :
1754 : 0 : FormattedField* pField = GetFormattedField();
1755 [ # # ][ # # ]: 0 : return pField ? pField->GetSpinFirst() : 0;
1756 : : }
1757 : :
1758 : 42 : void SVTXNumericField::setLast( double Value ) throw(::com::sun::star::uno::RuntimeException)
1759 : : {
1760 [ + - ]: 42 : SolarMutexGuard aGuard;
1761 : :
1762 : 42 : FormattedField* pField = GetFormattedField();
1763 [ + - ]: 42 : if ( pField )
1764 [ + - ]: 42 : pField->SetSpinLast( Value );
1765 : 42 : }
1766 : :
1767 : 0 : double SVTXNumericField::getLast() throw(::com::sun::star::uno::RuntimeException)
1768 : : {
1769 [ # # ]: 0 : SolarMutexGuard aGuard;
1770 : :
1771 : 0 : FormattedField* pField = GetFormattedField();
1772 [ # # ][ # # ]: 0 : return pField ? pField->GetSpinLast() : 0;
1773 : : }
1774 : :
1775 : 0 : void SVTXNumericField::setSpinSize( double Value ) throw(::com::sun::star::uno::RuntimeException)
1776 : : {
1777 [ # # ]: 0 : SolarMutexGuard aGuard;
1778 : :
1779 : 0 : FormattedField* pField = GetFormattedField();
1780 [ # # ]: 0 : if ( pField )
1781 [ # # ]: 0 : pField->SetSpinSize( Value );
1782 : 0 : }
1783 : :
1784 : 0 : double SVTXNumericField::getSpinSize() throw(::com::sun::star::uno::RuntimeException)
1785 : : {
1786 [ # # ]: 0 : SolarMutexGuard aGuard;
1787 : :
1788 : 0 : FormattedField* pField = GetFormattedField();
1789 [ # # ][ # # ]: 0 : return pField ? pField->GetSpinSize() : 0;
1790 : : }
1791 : :
1792 : 0 : void SVTXNumericField::setDecimalDigits( sal_Int16 Value ) throw(::com::sun::star::uno::RuntimeException)
1793 : : {
1794 [ # # ]: 0 : SolarMutexGuard aGuard;
1795 : :
1796 : 0 : FormattedField* pField = GetFormattedField();
1797 [ # # ]: 0 : if ( pField )
1798 [ # # ][ # # ]: 0 : pField->SetDecimalDigits( Value );
1799 : 0 : }
1800 : :
1801 : 0 : sal_Int16 SVTXNumericField::getDecimalDigits() throw(::com::sun::star::uno::RuntimeException)
1802 : : {
1803 [ # # ]: 0 : SolarMutexGuard aGuard;
1804 : :
1805 : 0 : FormattedField* pField = GetFormattedField();
1806 [ # # ][ # # ]: 0 : return pField ? pField->GetDecimalDigits() : 0;
[ # # ]
1807 : : }
1808 : :
1809 : 0 : void SVTXNumericField::setStrictFormat( sal_Bool bStrict ) throw(::com::sun::star::uno::RuntimeException)
1810 : : {
1811 [ # # ]: 0 : SolarMutexGuard aGuard;
1812 : :
1813 : 0 : FormattedField* pField = GetFormattedField();
1814 [ # # ]: 0 : if ( pField )
1815 [ # # ]: 0 : pField->SetStrictFormat( bStrict );
1816 : 0 : }
1817 : :
1818 : 0 : sal_Bool SVTXNumericField::isStrictFormat() throw(::com::sun::star::uno::RuntimeException)
1819 : : {
1820 [ # # ]: 0 : SolarMutexGuard aGuard;
1821 : :
1822 : 0 : FormattedField* pField = GetFormattedField();
1823 [ # # ][ # # ]: 0 : return pField ? pField->IsStrictFormat() : sal_False;
1824 : : }
1825 : :
1826 : 0 : void SVTXNumericField::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
1827 : : {
1828 : 0 : SVTXFormattedField::ImplGetPropertyIds( rIds );
1829 : 0 : }
1830 : :
1831 : : // ----------------------------------------------------
1832 : : // class SVTXCurrencyField
1833 : : // ----------------------------------------------------
1834 [ + - ]: 34 : SVTXCurrencyField::SVTXCurrencyField()
1835 : : {
1836 : 34 : }
1837 : :
1838 [ + - ]: 34 : SVTXCurrencyField::~SVTXCurrencyField()
1839 : : {
1840 [ - + ]: 68 : }
1841 : :
1842 : 6167 : ::com::sun::star::uno::Any SVTXCurrencyField::queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException)
1843 : : {
1844 : : ::com::sun::star::uno::Any aRet = ::cppu::queryInterface( rType,
1845 : : (static_cast< ::com::sun::star::awt::XCurrencyField* >(this)),
1846 [ + - ]: 6167 : (static_cast< ::com::sun::star::lang::XTypeProvider* >(this)) );
1847 [ + + ][ + - ]: 6167 : return (aRet.hasValue() ? aRet : SVTXFormattedField::queryInterface( rType ));
1848 : : }
1849 : :
1850 : : // ::com::sun::star::lang::XTypeProvider
1851 [ # # ][ # # ]: 0 : IMPL_XTYPEPROVIDER_START( SVTXCurrencyField )
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
1852 [ # # ]: 0 : getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XCurrencyField>* ) NULL ),
1853 : : SVTXFormattedField::getTypes()
1854 [ # # ][ # # ]: 0 : IMPL_XTYPEPROVIDER_END
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ]
1855 : :
1856 : 0 : void SVTXCurrencyField::setValue( double Value ) throw(::com::sun::star::uno::RuntimeException)
1857 : : {
1858 [ # # ]: 0 : SolarMutexGuard aGuard;
1859 : :
1860 : 0 : FormattedField* pField = GetFormattedField();
1861 [ # # ]: 0 : if ( pField )
1862 [ # # ][ # # ]: 0 : pField->SetValue( Value );
1863 : 0 : }
1864 : :
1865 : 180 : double SVTXCurrencyField::getValue() throw(::com::sun::star::uno::RuntimeException)
1866 : : {
1867 [ + - ]: 180 : SolarMutexGuard aGuard;
1868 : :
1869 : 180 : FormattedField* pField = GetFormattedField();
1870 [ + - ][ + - ]: 180 : return pField ? pField->GetValue() : 0;
[ + - ]
1871 : : }
1872 : :
1873 : 0 : void SVTXCurrencyField::setMin( double Value ) throw(::com::sun::star::uno::RuntimeException)
1874 : : {
1875 [ # # ]: 0 : SolarMutexGuard aGuard;
1876 : :
1877 : 0 : FormattedField* pField = GetFormattedField();
1878 [ # # ]: 0 : if ( pField )
1879 [ # # ][ # # ]: 0 : pField->SetMinValue( Value );
1880 : 0 : }
1881 : :
1882 : 0 : double SVTXCurrencyField::getMin() throw(::com::sun::star::uno::RuntimeException)
1883 : : {
1884 [ # # ]: 0 : SolarMutexGuard aGuard;
1885 : :
1886 : 0 : FormattedField* pField = GetFormattedField();
1887 [ # # ][ # # ]: 0 : return pField ? pField->GetMinValue() : 0;
1888 : : }
1889 : :
1890 : 0 : void SVTXCurrencyField::setMax( double Value ) throw(::com::sun::star::uno::RuntimeException)
1891 : : {
1892 [ # # ]: 0 : SolarMutexGuard aGuard;
1893 : :
1894 : 0 : FormattedField* pField = GetFormattedField();
1895 [ # # ]: 0 : if ( pField )
1896 [ # # ][ # # ]: 0 : pField->SetMaxValue( Value );
1897 : 0 : }
1898 : :
1899 : 0 : double SVTXCurrencyField::getMax() throw(::com::sun::star::uno::RuntimeException)
1900 : : {
1901 [ # # ]: 0 : SolarMutexGuard aGuard;
1902 : :
1903 : 0 : FormattedField* pField = GetFormattedField();
1904 [ # # ][ # # ]: 0 : return pField ? pField->GetMaxValue() : 0;
1905 : : }
1906 : :
1907 : 42 : void SVTXCurrencyField::setFirst( double Value ) throw(::com::sun::star::uno::RuntimeException)
1908 : : {
1909 [ + - ]: 42 : SolarMutexGuard aGuard;
1910 : :
1911 : 42 : FormattedField* pField = GetFormattedField();
1912 [ + - ]: 42 : if ( pField )
1913 [ + - ]: 42 : pField->SetSpinFirst( Value );
1914 : 42 : }
1915 : :
1916 : 0 : double SVTXCurrencyField::getFirst() throw(::com::sun::star::uno::RuntimeException)
1917 : : {
1918 [ # # ]: 0 : SolarMutexGuard aGuard;
1919 : :
1920 : 0 : FormattedField* pField = GetFormattedField();
1921 [ # # ][ # # ]: 0 : return pField ? pField->GetSpinFirst() : 0;
1922 : : }
1923 : :
1924 : 42 : void SVTXCurrencyField::setLast( double Value ) throw(::com::sun::star::uno::RuntimeException)
1925 : : {
1926 [ + - ]: 42 : SolarMutexGuard aGuard;
1927 : :
1928 : 42 : FormattedField* pField = GetFormattedField();
1929 [ + - ]: 42 : if ( pField )
1930 [ + - ]: 42 : pField->SetSpinLast( Value );
1931 : 42 : }
1932 : :
1933 : 0 : double SVTXCurrencyField::getLast() throw(::com::sun::star::uno::RuntimeException)
1934 : : {
1935 [ # # ]: 0 : SolarMutexGuard aGuard;
1936 : :
1937 : 0 : FormattedField* pField = GetFormattedField();
1938 [ # # ][ # # ]: 0 : return pField ? pField->GetSpinLast() : 0;
1939 : : }
1940 : :
1941 : 0 : void SVTXCurrencyField::setSpinSize( double Value ) throw(::com::sun::star::uno::RuntimeException)
1942 : : {
1943 [ # # ]: 0 : SolarMutexGuard aGuard;
1944 : :
1945 : 0 : FormattedField* pField = GetFormattedField();
1946 [ # # ]: 0 : if ( pField )
1947 [ # # ]: 0 : pField->SetSpinSize( Value );
1948 : 0 : }
1949 : :
1950 : 0 : double SVTXCurrencyField::getSpinSize() throw(::com::sun::star::uno::RuntimeException)
1951 : : {
1952 [ # # ]: 0 : SolarMutexGuard aGuard;
1953 : :
1954 : 0 : FormattedField* pField = GetFormattedField();
1955 [ # # ][ # # ]: 0 : return pField ? pField->GetSpinSize() : 0;
1956 : : }
1957 : :
1958 : 0 : void SVTXCurrencyField::setDecimalDigits( sal_Int16 Value ) throw(::com::sun::star::uno::RuntimeException)
1959 : : {
1960 [ # # ]: 0 : SolarMutexGuard aGuard;
1961 : :
1962 : 0 : FormattedField* pField = GetFormattedField();
1963 [ # # ]: 0 : if ( pField )
1964 [ # # ][ # # ]: 0 : pField->SetDecimalDigits( Value );
1965 : 0 : }
1966 : :
1967 : 0 : sal_Int16 SVTXCurrencyField::getDecimalDigits() throw(::com::sun::star::uno::RuntimeException)
1968 : : {
1969 [ # # ]: 0 : SolarMutexGuard aGuard;
1970 : :
1971 : 0 : FormattedField* pField = GetFormattedField();
1972 [ # # ][ # # ]: 0 : return pField ? pField->GetDecimalDigits() : 0;
[ # # ]
1973 : : }
1974 : :
1975 : 0 : void SVTXCurrencyField::setStrictFormat( sal_Bool bStrict ) throw(::com::sun::star::uno::RuntimeException)
1976 : : {
1977 [ # # ]: 0 : SolarMutexGuard aGuard;
1978 : :
1979 : 0 : FormattedField* pField = GetFormattedField();
1980 [ # # ]: 0 : if ( pField )
1981 [ # # ]: 0 : pField->SetStrictFormat( bStrict );
1982 : 0 : }
1983 : :
1984 : 0 : sal_Bool SVTXCurrencyField::isStrictFormat() throw(::com::sun::star::uno::RuntimeException)
1985 : : {
1986 [ # # ]: 0 : SolarMutexGuard aGuard;
1987 : :
1988 : 0 : FormattedField* pField = GetFormattedField();
1989 [ # # ][ # # ]: 0 : return pField ? pField->IsStrictFormat() : sal_False;
1990 : : }
1991 : :
1992 : 3000 : void SVTXCurrencyField::setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value) throw(::com::sun::star::uno::RuntimeException)
1993 : : {
1994 [ + - ]: 3000 : SolarMutexGuard aGuard;
1995 : :
1996 : 3000 : ::com::sun::star::uno::Any aReturn;
1997 : :
1998 : 3000 : DoubleCurrencyField* pField = (DoubleCurrencyField*)GetFormattedField();
1999 [ + - ]: 3000 : if ( pField )
2000 : : {
2001 [ + - ]: 3000 : sal_uInt16 nPropType = GetPropertyId( PropertyName );
2002 [ + + + ]: 3000 : switch (nPropType)
2003 : : {
2004 : : case BASEPROPERTY_CURRENCYSYMBOL:
2005 : : {
2006 : 50 : ::rtl::OUString aStr;
2007 : 50 : Value >>= aStr;
2008 [ + - ][ + - ]: 50 : pField->setCurrencySymbol( aStr );
[ + - ]
2009 : : }
2010 : 50 : break;
2011 : : case BASEPROPERTY_CURSYM_POSITION:
2012 : : {
2013 : 51 : sal_Bool b = false;
2014 : 51 : Value >>= b;
2015 [ + - ]: 51 : pField->setPrependCurrSym(b);
2016 : : }
2017 : 51 : break;
2018 : :
2019 : : default:
2020 [ + - ]: 3000 : SVTXFormattedField::setProperty(PropertyName, Value);
2021 : : }
2022 : : }
2023 : : else
2024 [ # # ][ + - ]: 3000 : SVTXFormattedField::setProperty(PropertyName, Value);
2025 : 3000 : }
2026 : :
2027 : 0 : ::com::sun::star::uno::Any SVTXCurrencyField::getProperty( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException)
2028 : : {
2029 [ # # ]: 0 : SolarMutexGuard aGuard;
2030 : :
2031 : 0 : ::com::sun::star::uno::Any aReturn;
2032 : :
2033 : 0 : DoubleCurrencyField* pField = (DoubleCurrencyField*)GetFormattedField();
2034 [ # # ]: 0 : if ( pField )
2035 : : {
2036 [ # # ]: 0 : sal_uInt16 nPropType = GetPropertyId( PropertyName );
2037 [ # # # ]: 0 : switch (nPropType)
2038 : : {
2039 : : case BASEPROPERTY_CURRENCYSYMBOL:
2040 : : {
2041 [ # # ][ # # ]: 0 : aReturn <<= ::rtl::OUString( pField->getCurrencySymbol() );
[ # # ][ # # ]
2042 : : }
2043 : 0 : break;
2044 : : case BASEPROPERTY_CURSYM_POSITION:
2045 : : {
2046 [ # # ]: 0 : aReturn <<= pField->getPrependCurrSym();
2047 : : }
2048 : 0 : break;
2049 : : default:
2050 [ # # ]: 0 : return SVTXFormattedField::getProperty(PropertyName);
2051 : : }
2052 : : }
2053 [ # # ][ # # ]: 0 : return SVTXFormattedField::getProperty(PropertyName);
2054 : : }
2055 : :
2056 : 0 : void SVTXCurrencyField::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
2057 : : {
2058 : : PushPropertyIds( rIds,
2059 : : BASEPROPERTY_CURRENCYSYMBOL,
2060 : : BASEPROPERTY_CURSYM_POSITION,
2061 : 0 : 0);
2062 : 0 : SVTXFormattedField::ImplGetPropertyIds( rIds );
2063 : 0 : }
2064 : :
2065 : :
2066 : : // ----------------------------------------------------
2067 : : // class VCLXProgressBar
2068 : : // ----------------------------------------------------
2069 : :
2070 : 0 : VCLXProgressBar::VCLXProgressBar()
2071 : : :m_nValue(0)
2072 : : ,m_nValueMin(0)
2073 [ # # ]: 0 : ,m_nValueMax(100)
2074 : : {
2075 : 0 : }
2076 : :
2077 [ # # ]: 0 : VCLXProgressBar::~VCLXProgressBar()
2078 : : {
2079 [ # # ]: 0 : }
2080 : :
2081 : 0 : void VCLXProgressBar::ImplUpdateValue()
2082 : : {
2083 : 0 : ProgressBar* pProgressBar = (ProgressBar*) GetWindow();
2084 [ # # ]: 0 : if ( pProgressBar )
2085 : : {
2086 : : sal_Int32 nVal;
2087 : : sal_Int32 nValMin;
2088 : : sal_Int32 nValMax;
2089 : :
2090 : : // check min and max
2091 [ # # ]: 0 : if (m_nValueMin < m_nValueMax)
2092 : : {
2093 : 0 : nValMin = m_nValueMin;
2094 : 0 : nValMax = m_nValueMax;
2095 : : }
2096 : : else
2097 : : {
2098 : 0 : nValMin = m_nValueMax;
2099 : 0 : nValMax = m_nValueMin;
2100 : : }
2101 : :
2102 : : // check value
2103 [ # # ]: 0 : if (m_nValue < nValMin)
2104 : : {
2105 : 0 : nVal = nValMin;
2106 : : }
2107 [ # # ]: 0 : else if (m_nValue > nValMax)
2108 : : {
2109 : 0 : nVal = nValMax;
2110 : : }
2111 : : else
2112 : : {
2113 : 0 : nVal = m_nValue;
2114 : : }
2115 : :
2116 : : // calculate percent
2117 : : sal_Int32 nPercent;
2118 [ # # ]: 0 : if (nValMin != nValMax)
2119 : : {
2120 : 0 : nPercent = 100 * (nVal - nValMin) / (nValMax - nValMin);
2121 : : }
2122 : : else
2123 : : {
2124 : 0 : nPercent = 0;
2125 : : }
2126 : :
2127 : : // set progressbar value
2128 : 0 : pProgressBar->SetValue( (sal_uInt16) nPercent );
2129 : : }
2130 : 0 : }
2131 : :
2132 : : // ::com::sun::star::uno::XInterface
2133 : 0 : ::com::sun::star::uno::Any VCLXProgressBar::queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException)
2134 : : {
2135 : : ::com::sun::star::uno::Any aRet = ::cppu::queryInterface( rType,
2136 : : (static_cast< ::com::sun::star::awt::XProgressBar* >(this)),
2137 [ # # ]: 0 : (static_cast< ::com::sun::star::lang::XTypeProvider* >(this)) );
2138 [ # # ][ # # ]: 0 : return (aRet.hasValue() ? aRet : VCLXWindow::queryInterface( rType ));
2139 : : }
2140 : :
2141 : : // ::com::sun::star::lang::XTypeProvider
2142 [ # # ][ # # ]: 0 : IMPL_XTYPEPROVIDER_START( VCLXProgressBar )
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
2143 [ # # ]: 0 : getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XProgressBar>* ) NULL ),
2144 : : VCLXWindow::getTypes()
2145 [ # # ][ # # ]: 0 : IMPL_XTYPEPROVIDER_END
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ]
2146 : :
2147 : : // ::com::sun::star::awt::XProgressBar
2148 : 0 : void VCLXProgressBar::setForegroundColor( sal_Int32 nColor ) throw(::com::sun::star::uno::RuntimeException)
2149 : : {
2150 [ # # ]: 0 : SolarMutexGuard aGuard;
2151 : :
2152 : 0 : Window* pWindow = GetWindow();
2153 [ # # ]: 0 : if ( pWindow )
2154 : : {
2155 : 0 : Color aColor( nColor );
2156 [ # # ]: 0 : pWindow->SetControlForeground( aColor );
2157 [ # # ]: 0 : }
2158 : 0 : }
2159 : :
2160 : 0 : void VCLXProgressBar::setBackgroundColor( sal_Int32 nColor ) throw(::com::sun::star::uno::RuntimeException)
2161 : : {
2162 [ # # ]: 0 : SolarMutexGuard aGuard;
2163 : :
2164 : 0 : Window* pWindow = GetWindow();
2165 [ # # ]: 0 : if ( pWindow )
2166 : : {
2167 : 0 : Color aColor( nColor );
2168 [ # # ][ # # ]: 0 : pWindow->SetBackground( aColor );
[ # # ]
2169 [ # # ]: 0 : pWindow->SetControlBackground( aColor );
2170 [ # # ]: 0 : pWindow->Invalidate();
2171 [ # # ]: 0 : }
2172 : 0 : }
2173 : :
2174 : 0 : void VCLXProgressBar::setValue( sal_Int32 nValue ) throw(::com::sun::star::uno::RuntimeException)
2175 : : {
2176 [ # # ]: 0 : SolarMutexGuard aGuard;
2177 : :
2178 : 0 : m_nValue = nValue;
2179 [ # # ][ # # ]: 0 : ImplUpdateValue();
2180 : 0 : }
2181 : :
2182 : 0 : void VCLXProgressBar::setRange( sal_Int32 nMin, sal_Int32 nMax ) throw(::com::sun::star::uno::RuntimeException )
2183 : : {
2184 [ # # ]: 0 : SolarMutexGuard aGuard;
2185 : :
2186 [ # # ]: 0 : if ( nMin < nMax )
2187 : : {
2188 : : // take correct min and max
2189 : 0 : m_nValueMin = nMin;
2190 : 0 : m_nValueMax = nMax;
2191 : : }
2192 : : else
2193 : : {
2194 : : // change min and max
2195 : 0 : m_nValueMin = nMax;
2196 : 0 : m_nValueMax = nMin;
2197 : : }
2198 : :
2199 [ # # ][ # # ]: 0 : ImplUpdateValue();
2200 : 0 : }
2201 : :
2202 : 0 : sal_Int32 VCLXProgressBar::getValue() throw(::com::sun::star::uno::RuntimeException)
2203 : : {
2204 [ # # ]: 0 : SolarMutexGuard aGuard;
2205 : :
2206 [ # # ]: 0 : return m_nValue;
2207 : : }
2208 : :
2209 : : // ::com::sun::star::awt::VclWindowPeer
2210 : 0 : void VCLXProgressBar::setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value) throw(::com::sun::star::uno::RuntimeException)
2211 : : {
2212 [ # # ]: 0 : SolarMutexGuard aGuard;
2213 : :
2214 : 0 : ProgressBar* pProgressBar = (ProgressBar*)GetWindow();
2215 [ # # ]: 0 : if ( pProgressBar )
2216 : : {
2217 [ # # ]: 0 : sal_uInt16 nPropType = GetPropertyId( PropertyName );
2218 [ # # # # : 0 : switch ( nPropType )
# ]
2219 : : {
2220 : : case BASEPROPERTY_PROGRESSVALUE:
2221 : : {
2222 [ # # ]: 0 : if ( Value >>= m_nValue )
2223 [ # # ]: 0 : ImplUpdateValue();
2224 : : }
2225 : 0 : break;
2226 : : case BASEPROPERTY_PROGRESSVALUE_MIN:
2227 : : {
2228 [ # # ]: 0 : if ( Value >>= m_nValueMin )
2229 [ # # ]: 0 : ImplUpdateValue();
2230 : : }
2231 : 0 : break;
2232 : : case BASEPROPERTY_PROGRESSVALUE_MAX:
2233 : : {
2234 [ # # ]: 0 : if ( Value >>= m_nValueMax )
2235 [ # # ]: 0 : ImplUpdateValue();
2236 : : }
2237 : 0 : break;
2238 : : case BASEPROPERTY_FILLCOLOR:
2239 : : {
2240 : 0 : Window* pWindow = GetWindow();
2241 [ # # ]: 0 : if ( pWindow )
2242 : : {
2243 : 0 : sal_Bool bVoid = Value.getValueType().getTypeClass() == ::com::sun::star::uno::TypeClass_VOID;
2244 : :
2245 [ # # ]: 0 : if ( bVoid )
2246 : : {
2247 [ # # ]: 0 : pWindow->SetControlForeground();
2248 : : }
2249 : : else
2250 : : {
2251 : 0 : sal_Int32 nColor = 0;
2252 [ # # ]: 0 : if ( Value >>= nColor )
2253 : : {
2254 : 0 : Color aColor( nColor );
2255 [ # # ]: 0 : pWindow->SetControlForeground( aColor );
2256 : : }
2257 : : }
2258 : : }
2259 : : }
2260 : 0 : break;
2261 : : default:
2262 [ # # ]: 0 : VCLXWindow::setProperty( PropertyName, Value );
2263 : 0 : break;
2264 : : }
2265 [ # # ]: 0 : }
2266 : 0 : }
2267 : :
2268 : 0 : ::com::sun::star::uno::Any VCLXProgressBar::getProperty( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException)
2269 : : {
2270 [ # # ]: 0 : SolarMutexGuard aGuard;
2271 : :
2272 : 0 : ::com::sun::star::uno::Any aProp;
2273 : 0 : ProgressBar* pProgressBar = (ProgressBar*)GetWindow();
2274 [ # # ]: 0 : if ( pProgressBar )
2275 : : {
2276 [ # # ]: 0 : sal_uInt16 nPropType = GetPropertyId( PropertyName );
2277 [ # # # # ]: 0 : switch ( nPropType )
2278 : : {
2279 : : case BASEPROPERTY_PROGRESSVALUE:
2280 : : {
2281 [ # # ]: 0 : aProp <<= m_nValue;
2282 : : }
2283 : 0 : break;
2284 : : case BASEPROPERTY_PROGRESSVALUE_MIN:
2285 : : {
2286 [ # # ]: 0 : aProp <<= m_nValueMin;
2287 : : }
2288 : 0 : break;
2289 : : case BASEPROPERTY_PROGRESSVALUE_MAX:
2290 : : {
2291 [ # # ]: 0 : aProp <<= m_nValueMax;
2292 : : }
2293 : 0 : break;
2294 : : default:
2295 [ # # ][ # # ]: 0 : aProp <<= VCLXWindow::getProperty( PropertyName );
2296 : 0 : break;
2297 : : }
2298 : : }
2299 [ # # ]: 0 : return aProp;
2300 : : }
2301 : :
2302 : 0 : void VCLXProgressBar::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
2303 : : {
2304 : : PushPropertyIds( rIds,
2305 : : BASEPROPERTY_PROGRESSVALUE,
2306 : : BASEPROPERTY_PROGRESSVALUE_MIN,
2307 : : BASEPROPERTY_PROGRESSVALUE_MAX,
2308 : : BASEPROPERTY_FILLCOLOR,
2309 : 0 : 0);
2310 : 0 : VCLXWindow::ImplGetPropertyIds( rIds, true );
2311 : 0 : }
2312 : :
2313 : :
2314 : : // ----------------------------------------------------
2315 : : // class SVTXDateField
2316 : : // ----------------------------------------------------
2317 : 54 : SVTXDateField::SVTXDateField()
2318 : 54 : :VCLXDateField()
2319 : : {
2320 : 54 : }
2321 : :
2322 : 54 : SVTXDateField::~SVTXDateField()
2323 : : {
2324 [ - + ]: 108 : }
2325 : :
2326 : 4200 : void SAL_CALL SVTXDateField::setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException)
2327 : : {
2328 : 4200 : VCLXDateField::setProperty( PropertyName, Value );
2329 : :
2330 : : // some properties need to be forwarded to the sub edit, too
2331 [ + - ]: 4200 : Edit* pSubEdit = GetWindow() ? static_cast< Edit* >( GetWindow() )->GetSubEdit() : NULL;
2332 [ + + ]: 4200 : if ( !pSubEdit )
2333 : 4200 : return;
2334 : :
2335 [ + + ]: 2360 : switch ( GetPropertyId( PropertyName ) )
2336 : : {
2337 : : case BASEPROPERTY_TEXTLINECOLOR:
2338 [ + - ]: 28 : if ( !Value.hasValue() )
2339 : 28 : pSubEdit->SetTextLineColor();
2340 : : else
2341 : : {
2342 : 0 : sal_Int32 nColor = 0;
2343 [ # # ]: 0 : if ( Value >>= nColor )
2344 [ # # ]: 0 : pSubEdit->SetTextLineColor( Color( nColor ) );
2345 : : }
2346 : 28 : break;
2347 : : }
2348 : : }
2349 : :
2350 : 0 : void SVTXDateField::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
2351 : : {
2352 : : PushPropertyIds( rIds,
2353 : : BASEPROPERTY_TEXTLINECOLOR,
2354 : 0 : 0);
2355 : 0 : VCLXDateField::ImplGetPropertyIds( rIds );
2356 : 0 : }
2357 : :
2358 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|