LibreOffice Module oox (master) 1
axcontrol.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <oox/ole/axcontrol.hxx>
21
22#include <com/sun/star/awt/FontSlant.hpp>
23#include <com/sun/star/awt/FontStrikeout.hpp>
24#include <com/sun/star/awt/FontUnderline.hpp>
25#include <com/sun/star/awt/FontWeight.hpp>
26#include <com/sun/star/awt/ImagePosition.hpp>
27#include <com/sun/star/awt/ImageScaleMode.hpp>
28#include <com/sun/star/awt/Point.hpp>
29#include <com/sun/star/awt/ScrollBarOrientation.hpp>
30#include <com/sun/star/awt/Size.hpp>
31#include <com/sun/star/awt/TextAlign.hpp>
32#include <com/sun/star/awt/VisualEffect.hpp>
33#include <com/sun/star/awt/XControlModel.hpp>
34#include <com/sun/star/beans/NamedValue.hpp>
35#include <com/sun/star/beans/XPropertySet.hpp>
36#include <com/sun/star/container/XIndexContainer.hpp>
37#include <com/sun/star/drawing/XDrawPage.hpp>
38#include <com/sun/star/form/XForm.hpp>
39#include <com/sun/star/form/XFormComponent.hpp>
40#include <com/sun/star/form/XFormsSupplier.hpp>
41#include <com/sun/star/form/binding/XBindableValue.hpp>
42#include <com/sun/star/form/binding/XListEntrySink.hpp>
43#include <com/sun/star/form/binding/XListEntrySource.hpp>
44#include <com/sun/star/form/binding/XValueBinding.hpp>
45#include <com/sun/star/frame/XModel.hpp>
46#include <com/sun/star/lang/XMultiServiceFactory.hpp>
47#include <com/sun/star/sheet/XCellRangeAddressable.hpp>
48#include <com/sun/star/sheet/XCellRangeReferrer.hpp>
49#include <com/sun/star/style/VerticalAlignment.hpp>
50#include <com/sun/star/table/CellAddress.hpp>
51#include <com/sun/star/table/CellRangeAddress.hpp>
52#include <rtl/tencinfo.h>
53#include <osl/diagnose.h>
54#include <utility>
55#include <vcl/font.hxx>
56#include <vcl/outdev.hxx>
57#include <vcl/settings.hxx>
58#include <vcl/svapp.hxx>
64#include <oox/token/properties.hxx>
65#include <oox/token/tokens.hxx>
67#include <o3tl/string_view.hxx>
68
69namespace oox::ole {
70
71using namespace ::com::sun::star;
72using namespace ::com::sun::star::awt;
73using namespace ::com::sun::star::beans;
74using namespace ::com::sun::star::container;
75using namespace ::com::sun::star::drawing;
76using namespace ::com::sun::star::form;
77using namespace ::com::sun::star::form::binding;
78using namespace ::com::sun::star::frame;
79using namespace ::com::sun::star::lang;
80using namespace ::com::sun::star::sheet;
81using namespace ::com::sun::star::style;
82using namespace ::com::sun::star::table;
83using namespace ::com::sun::star::uno;
84
85namespace {
86
87const sal_uInt32 COMCTL_ID_SIZE = 0x12344321;
88
89const sal_uInt32 COMCTL_ID_COMMONDATA = 0xABCDEF01;
90const sal_uInt32 COMCTL_COMMON_FLATBORDER = 0x00000001;
91const sal_uInt32 COMCTL_COMMON_ENABLED = 0x00000002;
92const sal_uInt32 COMCTL_COMMON_3DBORDER = 0x00000004;
93
94const sal_uInt32 COMCTL_ID_COMPLEXDATA = 0xBDECDE1F;
95const sal_uInt32 COMCTL_COMPLEX_FONT = 0x00000001;
96const sal_uInt32 COMCTL_COMPLEX_MOUSEICON = 0x00000002;
97
98const sal_uInt32 COMCTL_ID_SCROLLBAR_60 = 0x99470A83;
99const sal_uInt32 COMCTL_SCROLLBAR_HOR = 0x00000010;
100
101const sal_uInt32 COMCTL_ID_PROGRESSBAR_50 = 0xE6E17E84;
102const sal_uInt32 COMCTL_ID_PROGRESSBAR_60 = 0x97AB8A01;
103
104const sal_uInt32 AX_CMDBUTTON_DEFFLAGS = 0x0000001B;
105const sal_uInt32 AX_LABEL_DEFFLAGS = 0x0080001B;
106const sal_uInt32 AX_IMAGE_DEFFLAGS = 0x0000001B;
107const sal_uInt32 AX_MORPHDATA_DEFFLAGS = 0x2C80081B;
108const sal_uInt32 AX_SPINBUTTON_DEFFLAGS = 0x0000001B;
109const sal_uInt32 AX_SCROLLBAR_DEFFLAGS = 0x0000001B;
110
111const sal_uInt16 AX_POS_TOPLEFT = 0;
112const sal_uInt16 AX_POS_TOP = 1;
113const sal_uInt16 AX_POS_TOPRIGHT = 2;
114const sal_uInt16 AX_POS_LEFT = 3;
115const sal_uInt16 AX_POS_CENTER = 4;
116const sal_uInt16 AX_POS_RIGHT = 5;
117const sal_uInt16 AX_POS_BOTTOMLEFT = 6;
118const sal_uInt16 AX_POS_BOTTOM = 7;
119const sal_uInt16 AX_POS_BOTTOMRIGHT = 8;
120
121#define AX_PICPOS_IMPL( label, image ) ((AX_POS_##label << 16) | AX_POS_##image)
122const sal_uInt32 AX_PICPOS_LEFTTOP = AX_PICPOS_IMPL( TOPRIGHT, TOPLEFT );
123const sal_uInt32 AX_PICPOS_LEFTCENTER = AX_PICPOS_IMPL( RIGHT, LEFT );
124const sal_uInt32 AX_PICPOS_LEFTBOTTOM = AX_PICPOS_IMPL( BOTTOMRIGHT, BOTTOMLEFT );
125const sal_uInt32 AX_PICPOS_RIGHTTOP = AX_PICPOS_IMPL( TOPLEFT, TOPRIGHT );
126const sal_uInt32 AX_PICPOS_RIGHTCENTER = AX_PICPOS_IMPL( LEFT, RIGHT );
127const sal_uInt32 AX_PICPOS_RIGHTBOTTOM = AX_PICPOS_IMPL( BOTTOMLEFT, BOTTOMRIGHT );
128const sal_uInt32 AX_PICPOS_ABOVELEFT = AX_PICPOS_IMPL( BOTTOMLEFT, TOPLEFT );
129const sal_uInt32 AX_PICPOS_ABOVECENTER = AX_PICPOS_IMPL( BOTTOM, TOP );
130const sal_uInt32 AX_PICPOS_ABOVERIGHT = AX_PICPOS_IMPL( BOTTOMRIGHT, TOPRIGHT );
131const sal_uInt32 AX_PICPOS_BELOWLEFT = AX_PICPOS_IMPL( TOPLEFT, BOTTOMLEFT );
132const sal_uInt32 AX_PICPOS_BELOWCENTER = AX_PICPOS_IMPL( TOP, BOTTOM );
133const sal_uInt32 AX_PICPOS_BELOWRIGHT = AX_PICPOS_IMPL( TOPRIGHT, BOTTOMRIGHT );
134const sal_uInt32 AX_PICPOS_CENTER = AX_PICPOS_IMPL( CENTER, CENTER );
135#undef AX_PICPOS_IMPL
136
137const sal_Int32 AX_MATCHENTRY_FIRSTLETTER = 0;
138const sal_Int32 AX_MATCHENTRY_COMPLETE = 1;
139const sal_Int32 AX_MATCHENTRY_NONE = 2;
140
141const sal_Int32 AX_ORIENTATION_AUTO = -1;
142const sal_Int32 AX_ORIENTATION_VERTICAL = 0;
143const sal_Int32 AX_ORIENTATION_HORIZONTAL = 1;
144
145const sal_Int32 AX_PROPTHUMB_ON = -1;
146
147const sal_uInt32 AX_TABSTRIP_TABS = 0;
148const sal_uInt32 AX_TABSTRIP_NONE = 2;
149
150const sal_uInt32 AX_CONTAINER_ENABLED = 0x00000004;
151const sal_uInt32 AX_CONTAINER_NOCLASSTABLE = 0x00008000;
152
153const sal_uInt32 AX_CONTAINER_DEFFLAGS = 0x00000004;
154
155const sal_Int32 AX_CONTAINER_DEFWIDTH = 4000;
156const sal_Int32 AX_CONTAINER_DEFHEIGHT = 3000;
157
158const sal_Int32 AX_CONTAINER_CYCLEALL = 0;
159
160const sal_Int32 AX_CONTAINER_SCR_NONE = 0x00;
161
162const sal_Int16 API_BORDER_NONE = 0;
163const sal_Int16 API_BORDER_SUNKEN = 1;
164const sal_Int16 API_BORDER_FLAT = 2;
165
166const sal_Int16 API_STATE_UNCHECKED = 0;
167const sal_Int16 API_STATE_CHECKED = 1;
168const sal_Int16 API_STATE_DONTKNOW = 2;
169
171bool lclExtractRangeFromName( CellRangeAddress& orRangeAddr, const Reference< XModel >& rxDocModel, const OUString& rAddressString )
172{
173 try
174 {
175 PropertySet aPropSet( rxDocModel );
176 Reference< XNameAccess > xRangesNA( aPropSet.getAnyProperty( PROP_NamedRanges ), UNO_QUERY_THROW );
177 Reference< XCellRangeReferrer > xReferrer( xRangesNA->getByName( rAddressString ), UNO_QUERY_THROW );
178 Reference< XCellRangeAddressable > xAddressable( xReferrer->getReferredCells(), UNO_QUERY_THROW );
179 orRangeAddr = xAddressable->getRangeAddress();
180 return true;
181 }
182 catch (const Exception&)
183 {
184 TOOLS_WARN_EXCEPTION("oox", "");
185 }
186 return false;
187}
188
189bool lclExtractAddressFromName( CellAddress& orAddress, const Reference< XModel >& rxDocModel, const OUString& rAddressString )
190{
191 CellRangeAddress aRangeAddr;
192 if( lclExtractRangeFromName( aRangeAddr, rxDocModel, rAddressString ) &&
193 (aRangeAddr.StartColumn == aRangeAddr.EndColumn) &&
194 (aRangeAddr.StartRow == aRangeAddr.EndRow) )
195 {
196 orAddress.Sheet = aRangeAddr.Sheet;
197 orAddress.Column = aRangeAddr.StartColumn;
198 orAddress.Row = aRangeAddr.StartRow;
199 return true;
200 }
201 return false;
202}
203
204void lclPrepareConverter( PropertySet& rConverter, const Reference< XModel >& rxDocModel,
205 const OUString& rAddressString, sal_Int32 nRefSheet, bool bRange )
206{
207 if( !rConverter.is() ) try
208 {
209 Reference< XMultiServiceFactory > xModelFactory( rxDocModel, UNO_QUERY_THROW );
210 OUString aServiceName = bRange ?
211 OUString( "com.sun.star.table.CellRangeAddressConversion" ) :
212 OUString( "com.sun.star.table.CellAddressConversion" );
213 rConverter.set( xModelFactory->createInstance( aServiceName ) );
214 }
215 catch (const Exception&)
216 {
217 TOOLS_WARN_EXCEPTION("oox", "");
218 }
219 rConverter.setProperty( PROP_XLA1Representation, rAddressString );
220 rConverter.setProperty( PROP_ReferenceSheet, nRefSheet );
221}
222
223} // namespace
224
225ControlConverter::ControlConverter( const Reference< XModel >& rxDocModel,
226 const GraphicHelper& rGraphicHelper, bool bDefaultColorBgr ) :
227 mxDocModel( rxDocModel ),
228 mrGraphicHelper( rGraphicHelper ),
229 mbDefaultColorBgr( bDefaultColorBgr )
230{
231 OSL_ENSURE( mxDocModel.is(), "ControlConverter::ControlConverter - missing document model" );
232}
233
235{
236}
237
238// Generic conversion ---------------------------------------------------------
239
240void ControlConverter::convertPosition( PropertyMap& rPropMap, const AxPairData& rPos ) const
241{
242 // position is given in 1/100 mm, UNO needs AppFont units
243 awt::Point aAppFontPos = mrGraphicHelper.convertHmmToAppFont( awt::Point( rPos.first, rPos.second ) );
244 rPropMap.setProperty( PROP_PositionX, aAppFontPos.X );
245 rPropMap.setProperty( PROP_PositionY, aAppFontPos.Y );
246}
247
248void ControlConverter::convertSize( PropertyMap& rPropMap, const AxPairData& rSize ) const
249{
250 // size is given in 1/100 mm, UNO needs AppFont units
251 awt::Size aAppFontSize = mrGraphicHelper.convertHmmToAppFont( awt::Size( rSize.first, rSize.second ) );
252 rPropMap.setProperty( PROP_Width, aAppFontSize.Width );
253 rPropMap.setProperty( PROP_Height, aAppFontSize.Height );
254}
255
256void ControlConverter::convertColor( PropertyMap& rPropMap, sal_Int32 nPropId, sal_uInt32 nOleColor ) const
257{
259}
260
261void ControlConverter::convertToMSColor( PropertySet const & rPropSet, sal_Int32 nPropId, sal_uInt32& nOleColor, sal_uInt32 nDefault )
262{
263 sal_uInt32 nRGB = 0;
264 if (rPropSet.getProperty( nRGB, nPropId ))
265 nOleColor = OleHelper::encodeOleColor( nRGB );
266 else
267 nOleColor = nDefault;
268}
270{
271 if( rPicData.hasElements() )
272 {
273 uno::Reference<graphic::XGraphic> xGraphic = mrGraphicHelper.importGraphic(rPicData);
274 if (xGraphic.is())
275 rPropMap.setProperty(PROP_Graphic, xGraphic);
276 }
277}
278
279void ControlConverter::convertOrientation( PropertyMap& rPropMap, bool bHorizontal )
280{
281 sal_Int32 nScrollOrient = bHorizontal ? ScrollBarOrientation::HORIZONTAL : ScrollBarOrientation::VERTICAL;
282 rPropMap.setProperty( PROP_Orientation, nScrollOrient );
283}
284
285void ControlConverter::convertToMSOrientation( PropertySet const & rPropSet, bool& bHorizontal )
286{
287 sal_Int32 nScrollOrient = ScrollBarOrientation::HORIZONTAL;
288 if ( rPropSet.getProperty( nScrollOrient, PROP_Orientation ) )
289 bHorizontal = ( nScrollOrient == ScrollBarOrientation::HORIZONTAL );
290}
291
292void ControlConverter::convertVerticalAlign( PropertyMap& rPropMap, sal_Int32 nVerticalAlign )
293{
294 VerticalAlignment eAlign = VerticalAlignment_TOP;
295 switch( nVerticalAlign )
296 {
297 case XML_Top: eAlign = VerticalAlignment_TOP; break;
298 case XML_Center: eAlign = VerticalAlignment_MIDDLE; break;
299 case XML_Bottom: eAlign = VerticalAlignment_BOTTOM; break;
300 }
301 rPropMap.setProperty( PROP_VerticalAlign, eAlign );
302}
303
305 const AxPairData& rScrollPos, const AxPairData& rScrollArea,
306 sal_Int32 nScrollBars ) const
307{
308 awt::Size tmpSize = mrGraphicHelper.convertHmmToAppFont( awt::Size( rScrollArea.first, rScrollArea.second ) );
309 awt::Point tmpPos = mrGraphicHelper.convertHmmToAppFont( awt::Point( rScrollPos.first, rScrollPos.second ) );
310 rPropMap.setProperty( PROP_ScrollHeight, tmpSize.Height );
311 rPropMap.setProperty( PROP_ScrollWidth, tmpSize.Width );
312 rPropMap.setProperty( PROP_ScrollTop, tmpPos.Y );
313 rPropMap.setProperty( PROP_ScrollLeft, tmpPos.X );
314 rPropMap.setProperty( PROP_HScroll, ( nScrollBars & 0x1 ) == 0x1 );
315 rPropMap.setProperty( PROP_VScroll, ( nScrollBars & 0x2 ) == 0x2 );
316}
317
319 sal_Int32 nMin, sal_Int32 nMax, sal_Int32 nPosition,
320 sal_Int32 nSmallChange, sal_Int32 nLargeChange, bool bAwtModel )
321{
322 rPropMap.setProperty( PROP_ScrollValueMin, ::std::min( nMin, nMax ) );
323 rPropMap.setProperty( PROP_ScrollValueMax, ::std::max( nMin, nMax ) );
324 rPropMap.setProperty( PROP_LineIncrement, nSmallChange );
325 rPropMap.setProperty( PROP_BlockIncrement, nLargeChange );
326 rPropMap.setProperty( bAwtModel ? PROP_ScrollValue : PROP_DefaultScrollValue, nPosition );
327}
328
329void ControlConverter::bindToSources( const Reference< XControlModel >& rxCtrlModel,
330 const OUString& rCtrlSource, const OUString& rRowSource, sal_Int32 nRefSheet ) const
331{
332 // value binding
333 if( !rCtrlSource.isEmpty() ) try
334 {
335 // first check if the XBindableValue interface is supported
336 Reference< XBindableValue > xBindable( rxCtrlModel, UNO_QUERY_THROW );
337
338 // convert address string to cell address struct
339 CellAddress aAddress;
340 if( !lclExtractAddressFromName( aAddress, mxDocModel, rCtrlSource ) )
341 {
342 lclPrepareConverter( maAddressConverter, mxDocModel, rCtrlSource, nRefSheet, false );
343 if( !maAddressConverter.getProperty( aAddress, PROP_Address ) )
344 throw RuntimeException();
345 }
346
347 // create argument sequence
348 Sequence< Any > aArgs{ Any(NamedValue("BoundCell", Any(aAddress))) };
349
350 // create the CellValueBinding instance and set at the control model
351 Reference< XMultiServiceFactory > xModelFactory( mxDocModel, UNO_QUERY_THROW );
352 Reference< XValueBinding > xBinding( xModelFactory->createInstanceWithArguments( "com.sun.star.table.CellValueBinding", aArgs ), UNO_QUERY_THROW );
353 xBindable->setValueBinding( xBinding );
354 }
355 catch (const Exception&)
356 {
357 TOOLS_WARN_EXCEPTION("oox", "");
358 }
359
360 // list entry source
361 if( rRowSource.isEmpty() )
362 return;
363
364 try
365 {
366 // first check if the XListEntrySink interface is supported
367 Reference< XListEntrySink > xEntrySink( rxCtrlModel, UNO_QUERY_THROW );
368
369 // convert address string to cell range address struct
370 CellRangeAddress aRangeAddr;
371 if( !lclExtractRangeFromName( aRangeAddr, mxDocModel, rRowSource ) )
372 {
373 lclPrepareConverter( maRangeConverter, mxDocModel, rRowSource, nRefSheet, true );
374 if( !maRangeConverter.getProperty( aRangeAddr, PROP_Address ) )
375 throw RuntimeException();
376 }
377
378 // create argument sequence
379 Sequence< Any > aArgs{ Any(NamedValue("CellRange", Any(aRangeAddr))) };
380
381 // create the EntrySource instance and set at the control model
382 Reference< XMultiServiceFactory > xModelFactory( mxDocModel, UNO_QUERY_THROW );
383 Reference< XListEntrySource > xEntrySource( xModelFactory->createInstanceWithArguments("com.sun.star.table.CellRangeListSource", aArgs ), UNO_QUERY_THROW );
384 xEntrySink->setListEntrySource( xEntrySource );
385 }
386 catch (const Exception&)
387 {
388 TOOLS_WARN_EXCEPTION("oox", "");
389 }
390}
391
392// ActiveX (Forms 2.0) specific conversion ------------------------------------
393
395 sal_uInt32 nBackColor, sal_uInt32 nFlags, ApiTransparencyMode eTranspMode ) const
396{
397 bool bOpaque = getFlag( nFlags, AX_FLAGS_OPAQUE );
398 switch( eTranspMode )
399 {
401 // fake transparency by using system window background if needed
402 convertColor( rPropMap, PROP_BackgroundColor, bOpaque ? nBackColor : AX_SYSCOLOR_WINDOWBACK );
403 break;
405 // keep transparency by leaving the (void) default property value
406 if( bOpaque )
407 convertColor( rPropMap, PROP_BackgroundColor, nBackColor );
408 break;
409 }
410}
411
413 sal_uInt32 nBorderColor, sal_Int32 nBorderStyle, sal_Int32 nSpecialEffect ) const
414{
415 sal_Int16 nBorder = (nBorderStyle == AX_BORDERSTYLE_SINGLE) ? API_BORDER_FLAT :
416 ((nSpecialEffect == AX_SPECIALEFFECT_FLAT) ? API_BORDER_NONE : API_BORDER_SUNKEN);
417 rPropMap.setProperty( PROP_Border, nBorder );
418 convertColor( rPropMap, PROP_BorderColor, nBorderColor );
419}
420
422 sal_uInt32& nBorderColor, sal_Int32& nBorderStyle, sal_Int32& nSpecialEffect )
423{
424 sal_Int16 nBorder = API_BORDER_NONE;
425 rPropSet.getProperty( nBorder, PROP_Border );
426 nBorderStyle = AX_BORDERSTYLE_NONE;
427 nSpecialEffect = AX_SPECIALEFFECT_FLAT;
428 switch ( nBorder )
429 {
430 case API_BORDER_FLAT:
431 nBorderStyle = AX_BORDERSTYLE_SINGLE;
432 break;
433 case API_BORDER_SUNKEN:
434 nSpecialEffect = AX_SPECIALEFFECT_SUNKEN;
435 break;
436 case API_BORDER_NONE:
437 default:
438 break;
439 }
440 convertToMSColor( rPropSet, PROP_BorderColor, nBorderColor );
441}
442
443void ControlConverter::convertAxVisualEffect( PropertyMap& rPropMap, sal_Int32 nSpecialEffect )
444{
445 sal_Int16 nVisualEffect = (nSpecialEffect == AX_SPECIALEFFECT_FLAT) ? VisualEffect::FLAT : VisualEffect::LOOK3D;
446 rPropMap.setProperty( PROP_VisualEffect, nVisualEffect );
447}
448
449void ControlConverter::convertToAxVisualEffect( PropertySet const & rPropSet, sal_Int32& nSpecialEffect )
450{
451 sal_Int16 nVisualEffect = AX_SPECIALEFFECT_FLAT;
452 rPropSet.getProperty( nVisualEffect, PROP_VisualEffect );
453 // is this appropriate AX_SPECIALEFFECT_XXXX value ?
454 if (nVisualEffect == VisualEffect::LOOK3D )
455 nSpecialEffect = AX_SPECIALEFFECT_RAISED;
456}
457
458void ControlConverter::convertAxPicture( PropertyMap& rPropMap, const StreamDataSequence& rPicData, sal_uInt32 nPicPos ) const
459{
460 // the picture
461 convertPicture( rPropMap, rPicData );
462
463 // picture position
464 sal_Int16 nImagePos = ImagePosition::LeftCenter;
465 switch( nPicPos )
466 {
467 case AX_PICPOS_LEFTTOP: nImagePos = ImagePosition::LeftTop; break;
468 case AX_PICPOS_LEFTCENTER: nImagePos = ImagePosition::LeftCenter; break;
469 case AX_PICPOS_LEFTBOTTOM: nImagePos = ImagePosition::LeftBottom; break;
470 case AX_PICPOS_RIGHTTOP: nImagePos = ImagePosition::RightTop; break;
471 case AX_PICPOS_RIGHTCENTER: nImagePos = ImagePosition::RightCenter; break;
472 case AX_PICPOS_RIGHTBOTTOM: nImagePos = ImagePosition::RightBottom; break;
473 case AX_PICPOS_ABOVELEFT: nImagePos = ImagePosition::AboveLeft; break;
474 case AX_PICPOS_ABOVECENTER: nImagePos = ImagePosition::AboveCenter; break;
475 case AX_PICPOS_ABOVERIGHT: nImagePos = ImagePosition::AboveRight; break;
476 case AX_PICPOS_BELOWLEFT: nImagePos = ImagePosition::BelowLeft; break;
477 case AX_PICPOS_BELOWCENTER: nImagePos = ImagePosition::BelowCenter; break;
478 case AX_PICPOS_BELOWRIGHT: nImagePos = ImagePosition::BelowRight; break;
479 case AX_PICPOS_CENTER: nImagePos = ImagePosition::Centered; break;
480 default: OSL_FAIL( "ControlConverter::convertAxPicture - unknown picture position" );
481 }
482 rPropMap.setProperty( PROP_ImagePosition, nImagePos );
483}
484
486 sal_Int32 nPicSizeMode ) const
487{
488 // the picture
489 convertPicture( rPropMap, rPicData );
490
491 // picture scale mode
492 sal_Int16 nScaleMode = ImageScaleMode::NONE;
493 switch( nPicSizeMode )
494 {
495 case AX_PICSIZE_CLIP: nScaleMode = ImageScaleMode::NONE; break;
496 case AX_PICSIZE_STRETCH: nScaleMode = ImageScaleMode::ANISOTROPIC; break;
497 case AX_PICSIZE_ZOOM: nScaleMode = ImageScaleMode::ISOTROPIC; break;
498 default: OSL_FAIL( "ControlConverter::convertAxPicture - unknown picture size mode" );
499 }
500 rPropMap.setProperty( PROP_ScaleMode, nScaleMode );
501}
502
504 std::u16string_view rValue, sal_Int32 nMultiSelect, ApiDefaultStateMode eDefStateMode, bool bAwtModel )
505{
506 bool bBooleanState = eDefStateMode == API_DEFAULTSTATE_BOOLEAN;
507 bool bSupportsTriState = eDefStateMode == API_DEFAULTSTATE_TRISTATE;
508
509 // state
510 sal_Int16 nState = bSupportsTriState ? API_STATE_DONTKNOW : API_STATE_UNCHECKED;
511 if( rValue.size() == 1 ) switch( rValue[ 0 ] )
512 {
513 case '0': nState = API_STATE_UNCHECKED; break;
514 case '1': nState = API_STATE_CHECKED; break;
515 // any other string (also empty) means 'dontknow'
516 }
517 sal_Int32 nPropId = bAwtModel ? PROP_State : PROP_DefaultState;
518 if( bBooleanState )
519 rPropMap.setProperty( nPropId, nState != API_STATE_UNCHECKED );
520 else
521 rPropMap.setProperty( nPropId, nState );
522
523 // tristate
524 if( bSupportsTriState )
525 rPropMap.setProperty( PROP_TriState, nMultiSelect == AX_SELECTION_MULTI );
526}
527
529 OUString& rValue, sal_Int32& nMultiSelect, ApiDefaultStateMode eDefStateMode )
530{
531 bool bSupportsTriState = eDefStateMode == API_DEFAULTSTATE_TRISTATE;
532
533 sal_Int16 nState = API_STATE_DONTKNOW;
534
535 // need to use State for current state ( I think this is regardless of whether
536 // control is awt or not )
537 rPropSet.getProperty( nState, PROP_State );
538
539 rValue.clear(); // empty e.g. 'don't know'
540 if ( nState == API_STATE_UNCHECKED )
541 rValue = "0";
542 else if ( nState == API_STATE_CHECKED )
543 rValue = "1";
544
545 // tristate
546 if( bSupportsTriState )
547 {
548 bool bTriStateEnabled = false;
549 bool bPropertyExists = rPropSet.getProperty( bTriStateEnabled, PROP_TriState );
550 if( bPropertyExists && bTriStateEnabled )
551 nMultiSelect = AX_SELECTION_MULTI;
552 }
553}
554
556 const AxPairData& rSize, sal_Int32 nOrientation )
557{
558 bool bHorizontal = true;
559 switch( nOrientation )
560 {
561 case AX_ORIENTATION_AUTO: bHorizontal = rSize.first > rSize.second; break;
562 case AX_ORIENTATION_VERTICAL: bHorizontal = false; break;
563 case AX_ORIENTATION_HORIZONTAL: bHorizontal = true; break;
564 default: OSL_FAIL( "ControlConverter::convertAxOrientation - unknown orientation" );
565 }
566 convertOrientation( rPropMap, bHorizontal );
567}
568
570 sal_Int32& nOrientation )
571{
572 bool bHorizontal = true;
573 convertToMSOrientation( rPropSet, bHorizontal );
574
575 if ( bHorizontal )
576 nOrientation = AX_ORIENTATION_HORIZONTAL;
577 else
578 nOrientation = AX_ORIENTATION_VERTICAL;
579}
580
582 maSize( 0, 0 ),
583 mbAwtModel( false )
584{
585}
586
588{
589}
590
592{
593 ApiControlType eCtrlType = getControlType();
594 if( mbAwtModel ) switch( eCtrlType )
595 {
596 case API_CONTROL_BUTTON: return "com.sun.star.awt.UnoControlButtonModel";
597 case API_CONTROL_FIXEDTEXT: return "com.sun.star.awt.UnoControlFixedTextModel";
598 case API_CONTROL_IMAGE: return "com.sun.star.awt.UnoControlImageControlModel";
599 case API_CONTROL_CHECKBOX: return "com.sun.star.awt.UnoControlCheckBoxModel";
600 case API_CONTROL_RADIOBUTTON: return "com.sun.star.form.component.RadioButton";
601 case API_CONTROL_EDIT: return "com.sun.star.awt.UnoControlEditModel";
602 case API_CONTROL_NUMERIC: return "com.sun.star.awt.UnoControlNumericFieldModel";
603 case API_CONTROL_LISTBOX: return "com.sun.star.form.component.ListBox";
604 case API_CONTROL_COMBOBOX: return "com.sun.star.form.component.ComboBox";
605 case API_CONTROL_SPINBUTTON: return "com.sun.star.form.component.SpinButton";
606 case API_CONTROL_SCROLLBAR: return "com.sun.star.form.component.ScrollBar";
607 case API_CONTROL_PROGRESSBAR: return "com.sun.star.awt.UnoControlProgressBarModel";
608 case API_CONTROL_GROUPBOX: return "com.sun.star.form.component.GroupBox";
609 case API_CONTROL_FRAME: return "com.sun.star.awt.UnoFrameModel";
610 case API_CONTROL_PAGE: return "com.sun.star.awt.UnoPageModel";
611 case API_CONTROL_MULTIPAGE: return "com.sun.star.awt.UnoMultiPageModel";
612 case API_CONTROL_DIALOG: return "com.sun.star.awt.UnoControlDialogModel";
613 default: OSL_FAIL( "ControlModelBase::getServiceName - no AWT model service supported" );
614 }
615 else switch( eCtrlType )
616 {
617 case API_CONTROL_BUTTON: return "com.sun.star.form.component.CommandButton";
618 case API_CONTROL_FIXEDTEXT: return "com.sun.star.form.component.FixedText";
619 case API_CONTROL_IMAGE: return "com.sun.star.form.component.DatabaseImageControl";
620 case API_CONTROL_CHECKBOX: return "com.sun.star.form.component.CheckBox";
621 case API_CONTROL_RADIOBUTTON: return "com.sun.star.form.component.RadioButton";
622 case API_CONTROL_EDIT: return "com.sun.star.form.component.TextField";
623 case API_CONTROL_NUMERIC: return "com.sun.star.form.component.NumericField";
624 case API_CONTROL_LISTBOX: return "com.sun.star.form.component.ListBox";
625 case API_CONTROL_COMBOBOX: return "com.sun.star.form.component.ComboBox";
626 case API_CONTROL_SPINBUTTON: return "com.sun.star.form.component.SpinButton";
627 case API_CONTROL_SCROLLBAR: return "com.sun.star.form.component.ScrollBar";
628 case API_CONTROL_GROUPBOX: return "com.sun.star.form.component.GroupBox";
629 default: OSL_FAIL( "ControlModelBase::getServiceName - no form component service supported" );
630 }
631 return OUString();
632}
633
634void ControlModelBase::importProperty( sal_Int32 /*nPropId*/, const OUString& /*rValue*/ )
635{
636}
637
638void ControlModelBase::importPictureData( sal_Int32 /*nPropId*/, BinaryInputStream& /*rInStrm*/ )
639{
640}
641
642void ControlModelBase::convertProperties( PropertyMap& /*rPropMap*/, const ControlConverter& /*rConv*/ ) const
643{
644}
645
647{
648}
649
650void ControlModelBase::convertSize( PropertyMap& rPropMap, const ControlConverter& rConv ) const
651{
652 rConv.convertSize( rPropMap, maSize );
653}
654
655ComCtlModelBase::ComCtlModelBase( sal_uInt32 nDataPartId5, sal_uInt32 nDataPartId6,
656 sal_uInt16 nVersion ) :
657 maFontData( "Tahoma", 82500 ),
658 mnFlags( 0 ),
659 mnVersion( nVersion ),
660 mnDataPartId5( nDataPartId5 ),
661 mnDataPartId6( nDataPartId6 ),
662 mbCommonPart( true ),
663 mbComplexPart( true )
664{
665}
666
668{
669 // read initial size part and header of the control data part
670 if( importSizePart( rInStrm ) && readPartHeader( rInStrm, getDataPartId(), mnVersion ) )
671 {
672 // if flags part exists, the first int32 of the data part contains its size
673 sal_uInt32 nCommonPartSize = 0;
674 if (mbCommonPart)
675 nCommonPartSize = rInStrm.readuInt32();
676 // implementations must read the exact amount of data, stream must point to its end afterwards
677 importControlData( rInStrm );
678 // read following parts
679 if( !rInStrm.isEof() &&
680 (!mbCommonPart || importCommonPart( rInStrm, nCommonPartSize )) &&
681 (!mbComplexPart || importComplexPart( rInStrm )) )
682 {
683 return !rInStrm.isEof();
684 }
685 }
686 return false;
687}
688
690{
691 if( mbCommonPart )
692 rPropMap.setProperty( PROP_Enabled, getFlag( mnFlags, COMCTL_COMMON_ENABLED ) );
693 ControlModelBase::convertProperties( rPropMap, rConv );
694}
695
697{
698 switch( mnVersion )
699 {
700 case COMCTL_VERSION_50: return mnDataPartId5;
701 case COMCTL_VERSION_60: return mnDataPartId6;
702 }
703 OSL_FAIL( "ComCtlObjectBase::getDataPartId - unexpected version" );
704 return SAL_MAX_UINT32;
705}
706
707bool ComCtlModelBase::readPartHeader( BinaryInputStream& rInStrm, sal_uInt32 nExpPartId, sal_uInt16 nExpMajor, sal_uInt16 nExpMinor )
708{
709 // no idea if all this is correct...
710 sal_uInt32 nPartId = rInStrm.readuInt32();
711 sal_uInt16 nMinor = rInStrm.readuInt16();
712 sal_uInt16 nMajor = rInStrm.readuInt16();
713 bool bPartId = nPartId == nExpPartId;
714 OSL_ENSURE( bPartId, "ComCtlObjectBase::readPartHeader - unexpected part identifier" );
715 bool bVersion = ((nExpMajor == SAL_MAX_UINT16) || (nExpMajor == nMajor)) && ((nExpMinor == SAL_MAX_UINT16) || (nExpMinor == nMinor));
716 OSL_ENSURE( bVersion, "ComCtlObjectBase::readPartHeader - unexpected part version" );
717 return !rInStrm.isEof() && bPartId && bVersion;
718}
719
721{
722 if( readPartHeader( rInStrm, COMCTL_ID_SIZE, 0, 8 ) )
723 {
724 maSize.first = rInStrm.readInt32();
725 maSize.second = rInStrm.readInt32();
726 return !rInStrm.isEof();
727 }
728 return false;
729}
730
731bool ComCtlModelBase::importCommonPart( BinaryInputStream& rInStrm, sal_uInt32 nPartSize )
732{
733 sal_Int64 nEndPos = rInStrm.tell() + nPartSize;
734 if( (nPartSize >= 16) && readPartHeader( rInStrm, COMCTL_ID_COMMONDATA, 5, 0 ) )
735 {
736 rInStrm.skip( 4 );
737 mnFlags = rInStrm.readuInt32();
738 rInStrm.seek( nEndPos );
739 return !rInStrm.isEof();
740 }
741 return false;
742}
743
745{
746 if( readPartHeader( rInStrm, COMCTL_ID_COMPLEXDATA, 5, 1 ) )
747 {
748 sal_uInt32 nContFlags = rInStrm.readuInt32();
749 bool bReadOk =
750 (!getFlag( nContFlags, COMCTL_COMPLEX_FONT ) || OleHelper::importStdFont( maFontData, rInStrm, true )) &&
751 (!getFlag( nContFlags, COMCTL_COMPLEX_MOUSEICON ) || OleHelper::importStdPic( maMouseIcon, rInStrm ));
752 return bReadOk && !rInStrm.isEof();
753 }
754 return false;
755}
756
758 ComCtlModelBase( SAL_MAX_UINT32, COMCTL_ID_SCROLLBAR_60, nVersion ),
759 mnScrollBarFlags( 0x00000011 ),
760 mnLargeChange( 1 ),
761 mnSmallChange( 1 ),
762 mnMin( 0 ),
763 mnMax( 32767 ),
764 mnPosition( 0 )
765{
766}
767
769{
771}
772
774{
775 rPropMap.setProperty( PROP_Border, API_BORDER_NONE );
776 ControlConverter::convertOrientation( rPropMap, getFlag( mnScrollBarFlags, COMCTL_SCROLLBAR_HOR ) );
778 ComCtlModelBase::convertProperties( rPropMap, rConv );
779}
780
782{
783 mnScrollBarFlags = rInStrm.readuInt32();
784 mnLargeChange = rInStrm.readInt32();
785 mnSmallChange = rInStrm.readInt32();
786 mnMin = rInStrm.readInt32();
787 mnMax = rInStrm.readInt32();
788 mnPosition = rInStrm.readInt32();
789}
790
792 ComCtlModelBase( COMCTL_ID_PROGRESSBAR_50, COMCTL_ID_PROGRESSBAR_60, nVersion ),
793 mfMin( 0.0 ),
794 mfMax( 100.0 ),
795 mnVertical( 0 ),
796 mnSmooth( 0 )
797{
798}
799
801{
803}
804
806{
807 sal_uInt16 nBorder = getFlag( mnFlags, COMCTL_COMMON_3DBORDER ) ? API_BORDER_SUNKEN :
808 (getFlag( mnFlags, COMCTL_COMMON_FLATBORDER ) ? API_BORDER_FLAT : API_BORDER_NONE);
809 rPropMap.setProperty( PROP_Border, nBorder );
810 rPropMap.setProperty( PROP_ProgressValueMin, getLimitedValue< sal_Int32, double >( ::std::min( mfMin, mfMax ), 0.0, SAL_MAX_INT32 ) );
811 rPropMap.setProperty( PROP_ProgressValueMax, getLimitedValue< sal_Int32, double >( ::std::max( mfMin, mfMax ), 0.0, SAL_MAX_INT32 ) );
812 // ComCtl model does not provide current value?
813 ComCtlModelBase::convertProperties( rPropMap, rConv );
814}
815
817{
818 mfMin = rInStrm.readFloat();
819 mfMax = rInStrm.readFloat();
821 {
822 mnVertical = rInStrm.readuInt16();
823 mnSmooth = rInStrm.readuInt16();
824 }
825}
826
828{
829}
830
831void AxControlModelBase::importProperty( sal_Int32 nPropId, const OUString& rValue )
832{
833 switch( nPropId )
834 {
835 // size of the control shape: format is "width;height"
836 case XML_Size:
837 {
838 sal_Int32 nSepPos = rValue.indexOf( ';' );
839 OSL_ENSURE( nSepPos >= 0, "AxControlModelBase::importProperty - missing separator in 'Size' property" );
840 if( nSepPos >= 0 )
841 {
842 maSize.first = o3tl::toInt32(rValue.subView( 0, nSepPos ));
843 maSize.second = o3tl::toInt32(rValue.subView( nSepPos + 1 ));
844 }
845 }
846 break;
847 }
848}
849
850AxFontDataModel::AxFontDataModel( bool bSupportsAlign ) :
851 mbSupportsAlign( bSupportsAlign )
852{
853}
854
855void AxFontDataModel::importProperty( sal_Int32 nPropId, const OUString& rValue )
856{
857 switch( nPropId )
858 {
859 case XML_FontName: maFontData.maFontName = rValue; break;
860 case XML_FontEffects:
862 break;
863 case XML_FontHeight: maFontData.mnFontHeight = AttributeConversion::decodeInteger( rValue ); break;
864 case XML_FontCharSet: maFontData.mnFontCharSet = AttributeConversion::decodeInteger( rValue ); break;
865 case XML_ParagraphAlign:
867 break;
868 default: AxControlModelBase::importProperty( nPropId, rValue );
869 }
870}
871
873{
874 return maFontData.importBinaryModel( rInStrm );
875}
876
878{
879 maFontData.exportBinaryModel( rOutStrm );
880}
882{
883 // font name
884 if( !maFontData.maFontName.isEmpty() )
886
887 // font effects
888 rPropMap.setProperty( PROP_FontWeight, maFontData.mnFontEffects & AxFontFlags::Bold ? awt::FontWeight::BOLD : awt::FontWeight::NORMAL );
889 rPropMap.setProperty( PROP_FontSlant, maFontData.mnFontEffects & AxFontFlags::Italic ? FontSlant_ITALIC : FontSlant_NONE );
891 rPropMap.setProperty( PROP_FontUnderline, maFontData.mbDblUnderline ? awt::FontUnderline::DOUBLE : awt::FontUnderline::SINGLE );
892 else
893 rPropMap.setProperty( PROP_FontUnderline, awt::FontUnderline::NONE );
894 rPropMap.setProperty( PROP_FontStrikeout, maFontData.mnFontEffects & AxFontFlags::Strikeout ? awt::FontStrikeout::SINGLE : awt::FontStrikeout::NONE );
896
897 // font character set
898 rtl_TextEncoding eFontEnc = RTL_TEXTENCODING_DONTKNOW;
900 eFontEnc = rtl_getTextEncodingFromWindowsCharset( static_cast< sal_uInt8 >( maFontData.mnFontCharSet ) );
901 if( eFontEnc != RTL_TEXTENCODING_DONTKNOW )
902 rPropMap.setProperty( PROP_FontCharset, static_cast< sal_Int16 >( eFontEnc ) );
903
904 // text alignment
905 if( mbSupportsAlign )
906 {
907 sal_Int32 nAlign = awt::TextAlign::LEFT;
908 switch( maFontData.mnHorAlign )
909 {
910 case AxHorizontalAlign::Left: nAlign = awt::TextAlign::LEFT; break;
911 case AxHorizontalAlign::Right: nAlign = awt::TextAlign::RIGHT; break;
912 case AxHorizontalAlign::Center: nAlign = awt::TextAlign::CENTER; break;
913 default: OSL_FAIL( "AxFontDataModel::convertProperties - unknown text alignment" );
914 }
915 // form controls expect short value
916 rPropMap.setProperty( PROP_Align, static_cast< sal_Int16 >( nAlign ) );
917 }
918
919 // process base class properties
920 AxControlModelBase::convertProperties( rPropMap, rConv );
921}
922
924{
926 float fontWeight = float(0);
927 if ( rPropSet.getProperty(fontWeight, PROP_FontWeight ) )
928 setFlag( maFontData.mnFontEffects, AxFontFlags::Bold, ( fontWeight == awt::FontWeight::BOLD ) );
929 FontSlant nSlant = FontSlant_NONE;
930 if ( rPropSet.getProperty( nSlant, PROP_FontSlant ) )
931 setFlag( maFontData.mnFontEffects, AxFontFlags::Italic, ( nSlant == FontSlant_ITALIC ) );
932
933 sal_Int16 nUnderLine = awt::FontUnderline::NONE;
934 if ( rPropSet.getProperty( nUnderLine, PROP_FontUnderline ) )
935 setFlag( maFontData.mnFontEffects, AxFontFlags::Underline, nUnderLine != awt::FontUnderline::NONE && nUnderLine != awt::FontUnderline::DONTKNOW);
936 sal_Int16 nStrikeout = awt::FontStrikeout::NONE ;
937 if ( rPropSet.getProperty( nStrikeout, PROP_FontStrikeout ) )
938 setFlag( maFontData.mnFontEffects, AxFontFlags::Strikeout, nStrikeout != awt::FontStrikeout::NONE && nStrikeout != awt::FontStrikeout::DONTKNOW);
939
940 float fontHeight = 0.0;
941 if ( rPropSet.getProperty( fontHeight, PROP_FontHeight ) )
942 {
943 if ( fontHeight == 0 ) // tdf#118684
944 {
946 fontHeight = static_cast< float >( aDefaultVCLFont.GetFontHeight() );
947 }
948 maFontData.setHeightPoints( static_cast< sal_Int16 >( fontHeight ) );
949 }
950
951 // TODO - handle textencoding
952 sal_Int16 nAlign = 0;
953 if ( rPropSet.getProperty( nAlign, PROP_Align ) )
954 {
955 switch ( nAlign )
956 {
957 case awt::TextAlign::LEFT: maFontData.mnHorAlign = AxHorizontalAlign::Left; break;
958 case awt::TextAlign::RIGHT: maFontData.mnHorAlign = AxHorizontalAlign::Right; break;
959 case awt::TextAlign::CENTER: maFontData.mnHorAlign = AxHorizontalAlign::Center; break;
960 default: OSL_FAIL( "AxFontDataModel::convertFromProperties - unknown text alignment" );
961 }
962 }
963}
964
966 mnTextColor( AX_SYSCOLOR_BUTTONTEXT ),
967 mnBackColor( AX_SYSCOLOR_BUTTONFACE ),
968 mnFlags( AX_CMDBUTTON_DEFFLAGS ),
969 mnPicturePos( AX_PICPOS_ABOVECENTER ),
970 mnVerticalAlign( XML_Center ),
971 mbFocusOnClick( true )
972{
973}
974
975void AxCommandButtonModel::importProperty( sal_Int32 nPropId, const OUString& rValue )
976{
977 switch( nPropId )
978 {
979 case XML_Caption: maCaption = rValue; break;
980 case XML_ForeColor: mnTextColor = AttributeConversion::decodeUnsigned( rValue ); break;
981 case XML_BackColor: mnBackColor = AttributeConversion::decodeUnsigned( rValue ); break;
982 case XML_VariousPropertyBits: mnFlags = AttributeConversion::decodeUnsigned( rValue ); break;
983 case XML_PicturePosition: mnPicturePos = AttributeConversion::decodeUnsigned( rValue ); break;
984 case XML_TakeFocusOnClick: mbFocusOnClick = AttributeConversion::decodeInteger( rValue ) != 0; break;
985 default: AxFontDataModel::importProperty( nPropId, rValue );
986 }
987}
988
990{
991 switch( nPropId )
992 {
993 case XML_Picture: OleHelper::importStdPic( maPictureData, rInStrm ); break;
994 default: AxFontDataModel::importPictureData( nPropId, rInStrm );
995 }
996}
997
999{
1000 AxBinaryPropertyReader aReader( rInStrm );
1001 aReader.readIntProperty< sal_uInt32 >( mnTextColor );
1002 aReader.readIntProperty< sal_uInt32 >( mnBackColor );
1003 aReader.readIntProperty< sal_uInt32 >( mnFlags );
1004 aReader.readStringProperty( maCaption );
1005 aReader.readIntProperty< sal_uInt32 >( mnPicturePos );
1006 aReader.readPairProperty( maSize );
1007 aReader.skipIntProperty< sal_uInt8 >(); // mouse pointer
1009 aReader.skipIntProperty< sal_uInt16 >(); // accelerator
1010 aReader.readBoolProperty( mbFocusOnClick, true ); // binary flag means "do not take focus"
1011 aReader.skipPictureProperty(); // mouse icon
1012 return aReader.finalizeImport() && AxFontDataModel::importBinaryModel( rInStrm );
1013}
1014
1016{
1017 AxBinaryPropertyWriter aWriter( rOutStrm );
1018 aWriter.writeIntProperty< sal_uInt32 >( mnTextColor );
1019 if ( mnBackColor )
1020 aWriter.writeIntProperty< sal_uInt32 >( mnBackColor );
1021 else
1022 aWriter.skipProperty(); // default backcolour
1023 aWriter.writeIntProperty< sal_uInt32 >( mnFlags );
1024 aWriter.writeStringProperty( maCaption );
1025 aWriter.skipProperty(); // pict pos
1026 aWriter.writePairProperty( maSize );
1027 aWriter.skipProperty(); // mouse pointer
1028 aWriter.skipProperty(); // picture data
1029 aWriter.skipProperty(); // accelerator
1030 aWriter.writeBoolProperty( mbFocusOnClick ); // binary flag means "do not take focus"
1031 aWriter.skipProperty(); // mouse icon
1032 aWriter.finalizeExport();
1034}
1035
1037{
1038 // should be able to replace this hardcoded foo with
1039 // proper export info from MS-OLEDS spec.
1040 static sal_uInt8 const aCompObj[] = {
1041 0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00,
1042 0xFF, 0xFF, 0xFF, 0xFF, 0x40, 0x32, 0x05, 0xD7,
1043 0x69, 0xCE, 0xCD, 0x11, 0xA7, 0x77, 0x00, 0xDD,
1044 0x01, 0x14, 0x3C, 0x57, 0x22, 0x00, 0x00, 0x00,
1045 0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66,
1046 0x74, 0x20, 0x46, 0x6F, 0x72, 0x6d, 0x73, 0x20,
1047 0x32, 0x2e, 0x30, 0x20, 0x43, 0x6F, 0x6D, 0x6D,
1048 0x61, 0x6E, 0x64, 0x42, 0x75, 0x74, 0x74, 0x6F,
1049 0x6E, 0x00, 0x10, 0x00, 0x00, 0x00, 0x45, 0x6D,
1050 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x20, 0x4F,
1051 0x62, 0x6A, 0x65, 0x63, 0x74, 0x00, 0x16, 0x00,
1052 0x00, 0x00, 0x46, 0x6F, 0x72, 0x6D, 0x73, 0x2E,
1053 0x43, 0x6F, 0x6D, 0x6D, 0x61, 0x6E, 0x64, 0x42,
1054 0x75, 0x74, 0x74, 0x6F, 0x6E, 0x2E, 0x31, 0x00,
1055 0xF4, 0x39, 0xB2, 0x71, 0x00, 0x00, 0x00, 0x00,
1056 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
1057 };
1058 rOutStream.writeMemory( aCompObj, sizeof( aCompObj ) );
1059}
1060
1062{
1063 return API_CONTROL_BUTTON;
1064}
1065
1067{
1068 rPropMap.setProperty( PROP_Label, maCaption );
1069 rPropMap.setProperty( PROP_Enabled, getFlag( mnFlags, AX_FLAGS_ENABLED ) );
1070 rPropMap.setProperty( PROP_MultiLine, getFlag( mnFlags, AX_FLAGS_WORDWRAP ) );
1071 rPropMap.setProperty( PROP_FocusOnClick, mbFocusOnClick );
1072 rConv.convertColor( rPropMap, PROP_TextColor, mnTextColor );
1075 rConv.convertAxPicture( rPropMap, maPictureData, mnPicturePos );
1076 AxFontDataModel::convertProperties( rPropMap, rConv );
1077}
1078
1080{
1081 (void)rPropSet.getProperty(maCaption, PROP_Label);
1082 bool bRes = false;
1083 if ( rPropSet.getProperty( bRes, PROP_Enabled ) )
1085 if ( rPropSet.getProperty( bRes, PROP_MultiLine ) )
1087 (void)rPropSet.getProperty(mbFocusOnClick, PROP_FocusOnClick);
1088
1090 ControlConverter::convertToMSColor( rPropSet, PROP_BackgroundColor, mnBackColor );
1091
1092 AxFontDataModel::convertFromProperties( rPropSet, rConv );
1093}
1094
1096 mnTextColor( AX_SYSCOLOR_BUTTONTEXT ),
1097 mnBackColor( AX_SYSCOLOR_BUTTONFACE ),
1098 mnFlags( AX_LABEL_DEFFLAGS ),
1099 mnBorderColor( AX_SYSCOLOR_WINDOWFRAME ),
1100 mnBorderStyle( AX_BORDERSTYLE_NONE ),
1101 mnSpecialEffect( AX_SPECIALEFFECT_FLAT ),
1102 mnVerticalAlign( XML_Top )
1103{
1104}
1105
1106void AxLabelModel::importProperty( sal_Int32 nPropId, const OUString& rValue )
1107{
1108 switch( nPropId )
1109 {
1110 case XML_Caption: maCaption = rValue; break;
1111 case XML_ForeColor: mnTextColor = AttributeConversion::decodeUnsigned( rValue ); break;
1112 case XML_BackColor: mnBackColor = AttributeConversion::decodeUnsigned( rValue ); break;
1113 case XML_VariousPropertyBits: mnFlags = AttributeConversion::decodeUnsigned( rValue ); break;
1114 case XML_BorderColor: mnBorderColor = AttributeConversion::decodeUnsigned( rValue ); break;
1115 case XML_BorderStyle: mnBorderStyle = AttributeConversion::decodeInteger( rValue ); break;
1116 case XML_SpecialEffect: mnSpecialEffect = AttributeConversion::decodeInteger( rValue ); break;
1117 default: AxFontDataModel::importProperty( nPropId, rValue );
1118 }
1119}
1120
1122{
1123 AxBinaryPropertyReader aReader( rInStrm );
1124 aReader.readIntProperty< sal_uInt32 >( mnTextColor );
1125 aReader.readIntProperty< sal_uInt32 >( mnBackColor );
1126 aReader.readIntProperty< sal_uInt32 >( mnFlags );
1127 aReader.readStringProperty( maCaption );
1128 aReader.skipIntProperty< sal_uInt32 >(); // picture position
1129 aReader.readPairProperty( maSize );
1130 aReader.skipIntProperty< sal_uInt8 >(); // mouse pointer
1131 aReader.readIntProperty< sal_uInt32 >( mnBorderColor );
1132 aReader.readIntProperty< sal_uInt16 >( mnBorderStyle );
1133 aReader.readIntProperty< sal_uInt16 >( mnSpecialEffect );
1134 aReader.skipPictureProperty(); // picture
1135 aReader.skipIntProperty< sal_uInt16 >(); // accelerator
1136 aReader.skipPictureProperty(); // mouse icon
1137 return aReader.finalizeImport() && AxFontDataModel::importBinaryModel( rInStrm );
1138}
1139
1141{
1142 AxBinaryPropertyWriter aWriter( rOutStrm );
1143 aWriter.writeIntProperty< sal_uInt32 >( mnTextColor );
1144 if ( mnBackColor )
1145 aWriter.writeIntProperty< sal_uInt32 >( mnBackColor );
1146 else
1147 // if mnBackColor == 0 then it's the libreoffice default backcolour is
1148 // the MSO Label default which is AX_SYSCOLOR_BUTTONFACE
1149 aWriter.writeIntProperty< sal_uInt32 >( AX_SYSCOLOR_WINDOWBACK );
1150 aWriter.writeIntProperty< sal_uInt32 >( mnFlags );
1151 aWriter.writeStringProperty( maCaption );
1152 aWriter.skipProperty(); // picture position
1153 aWriter.writePairProperty( maSize );
1154 aWriter.skipProperty(); // mouse pointer
1155 aWriter.writeIntProperty< sal_uInt32 >( mnBorderColor );
1156 aWriter.writeIntProperty< sal_uInt16 >( mnBorderStyle );
1157 aWriter.writeIntProperty< sal_uInt16 >( mnSpecialEffect );
1158 aWriter.skipProperty(); // picture
1159 aWriter.skipProperty(); // accelerator
1160 aWriter.skipProperty(); // mouse icon
1161 aWriter.finalizeExport();
1163}
1164
1166{
1167 rPropSet.getProperty( maCaption, PROP_Label );
1168 bool bRes = false;
1169 if ( rPropSet.getProperty( bRes, PROP_Enabled ) )
1171 if ( rPropSet.getProperty( bRes, PROP_MultiLine ) )
1173
1175 // VerticalAlign doesn't seem to be read from binary
1176
1177 // not sure about background color, how do we decide when to set
1178 // AX_FLAGS_OPAQUE ?
1179 ControlConverter::convertToMSColor( rPropSet, PROP_BackgroundColor, mnBackColor );
1181
1182 AxFontDataModel::convertFromProperties( rPropSet, rConv );
1183}
1184
1186{
1187 // should be able to replace this hardcoded foo with
1188 // proper export info from MS-OLEDS spec.
1189 static sal_uInt8 const aCompObj[] = {
1190 0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00,
1191 0xFF, 0xFF, 0xFF, 0xFF, 0x23, 0x9E, 0x8C, 0x97,
1192 0xB0, 0xD4, 0xCE, 0x11, 0xBF, 0x2D, 0x00, 0xAA,
1193 0x00, 0x3F, 0x40, 0xD0, 0x1A, 0x00, 0x00, 0x00,
1194 0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66,
1195 0x74, 0x20, 0x46, 0x6F, 0x72, 0x6D, 0x73, 0x20,
1196 0x32, 0x2E, 0x30, 0x20, 0x4C, 0x61, 0x62, 0x65,
1197 0x6C, 0x00, 0x10, 0x00, 0x00, 0x00, 0x45, 0x6D,
1198 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x20, 0x4F,
1199 0x62, 0x6A, 0x65, 0x63, 0x74, 0x00, 0x0E, 0x00,
1200 0x00, 0x00, 0x46, 0x6F, 0x72, 0x6D, 0x73, 0x2E,
1201 0x4C, 0x61, 0x62, 0x65, 0x6C, 0x2E, 0x31, 0x00,
1202 0xF4, 0x39, 0xB2, 0x71, 0x00, 0x00, 0x00, 0x00,
1203 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
1204 };
1205 rOutStream.writeMemory( aCompObj, sizeof( aCompObj ) );
1206}
1207
1209{
1210 return API_CONTROL_FIXEDTEXT;
1211}
1212
1214{
1215 rPropMap.setProperty( PROP_Label, maCaption );
1216 rPropMap.setProperty( PROP_Enabled, getFlag( mnFlags, AX_FLAGS_ENABLED ) );
1217 rPropMap.setProperty( PROP_MultiLine, getFlag( mnFlags, AX_FLAGS_WORDWRAP ) );
1218 rConv.convertColor( rPropMap, PROP_TextColor, mnTextColor );
1222 AxFontDataModel::convertProperties( rPropMap, rConv );
1223}
1224
1226 mnBackColor( AX_SYSCOLOR_BUTTONFACE ),
1227 mnFlags( AX_IMAGE_DEFFLAGS ),
1228 mnBorderColor( AX_SYSCOLOR_WINDOWFRAME ),
1229 mnBorderStyle( AX_BORDERSTYLE_SINGLE ),
1230 mnSpecialEffect( AX_SPECIALEFFECT_FLAT ),
1231 mnPicSizeMode( AX_PICSIZE_CLIP ),
1232 mnPicAlign( AX_PICALIGN_CENTER ),
1233 mbPicTiling( false )
1234{
1235}
1236
1237void AxImageModel::importProperty( sal_Int32 nPropId, const OUString& rValue )
1238{
1239 switch( nPropId )
1240 {
1241 case XML_BackColor: mnBackColor = AttributeConversion::decodeUnsigned( rValue ); break;
1242 case XML_VariousPropertyBits: mnFlags = AttributeConversion::decodeUnsigned( rValue ); break;
1243 case XML_BorderColor: mnBorderColor = AttributeConversion::decodeUnsigned( rValue ); break;
1244 case XML_BorderStyle: mnBorderStyle = AttributeConversion::decodeInteger( rValue ); break;
1245 case XML_SpecialEffect: mnSpecialEffect = AttributeConversion::decodeInteger( rValue ); break;
1246 case XML_SizeMode: mnPicSizeMode = AttributeConversion::decodeInteger( rValue ); break;
1247 case XML_PictureAlignment: mnPicAlign = AttributeConversion::decodeInteger( rValue ); break;
1248 case XML_PictureTiling: mbPicTiling = AttributeConversion::decodeInteger( rValue ) != 0; break;
1249 default: AxControlModelBase::importProperty( nPropId, rValue );
1250 }
1251}
1252
1253void AxImageModel::importPictureData( sal_Int32 nPropId, BinaryInputStream& rInStrm )
1254{
1255 switch( nPropId )
1256 {
1257 case XML_Picture: OleHelper::importStdPic( maPictureData, rInStrm ); break;
1258 default: AxControlModelBase::importPictureData( nPropId, rInStrm );
1259 }
1260}
1261
1263{
1264 AxBinaryPropertyReader aReader( rInStrm );
1265 aReader.skipUndefinedProperty();
1266 aReader.skipUndefinedProperty();
1267 aReader.skipBoolProperty(); // auto-size
1268 aReader.readIntProperty< sal_uInt32 >( mnBorderColor );
1269 aReader.readIntProperty< sal_uInt32 >( mnBackColor );
1271 aReader.skipIntProperty< sal_uInt8 >(); // mouse pointer
1274 aReader.readPairProperty( maSize );
1276 aReader.readIntProperty< sal_uInt8 >( mnPicAlign );
1277 aReader.readBoolProperty( mbPicTiling );
1278 aReader.readIntProperty< sal_uInt32 >( mnFlags );
1279 aReader.skipPictureProperty(); // mouse icon
1280 return aReader.finalizeImport();
1281}
1282
1284{
1285 AxBinaryPropertyWriter aWriter( rOutStrm );
1286 aWriter.skipProperty(); //undefined
1287 aWriter.skipProperty(); //undefined
1288 aWriter.skipProperty(); //auto-size
1289 aWriter.writeIntProperty< sal_uInt32 >( mnBorderColor );
1290 if ( mnBackColor )
1291 aWriter.writeIntProperty< sal_uInt32 >( mnBackColor );
1292 else
1293 aWriter.skipProperty(); // default backcolour
1295 aWriter.skipProperty(); // mouse pointer
1298 aWriter.writePairProperty( maSize );
1299 aWriter.skipProperty(); //maPictureData );
1301 aWriter.writeBoolProperty( mbPicTiling );
1302 aWriter.writeIntProperty< sal_uInt32 >( mnFlags );
1303 aWriter.skipProperty(); // mouse icon
1304 aWriter.finalizeExport();
1305}
1306
1308{
1309 // should be able to replace this hardcoded foo with
1310 // proper export info from MS-OLEDS spec.
1311 static sal_uInt8 const aCompObj[] = {
1312 0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00,
1313 0xFF, 0xFF, 0xFF, 0xFF, 0x41, 0x92, 0x59, 0x4C,
1314 0x26, 0x69, 0x1B, 0x10, 0x99, 0x92, 0x00, 0x00,
1315 0x0B, 0x65, 0xC6, 0xF9, 0x1A, 0x00, 0x00, 0x00,
1316 0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66,
1317 0x74, 0x20, 0x46, 0x6F, 0x72, 0x6D, 0x73, 0x20,
1318 0x32, 0x2E, 0x30, 0x20, 0x49, 0x6D, 0x61, 0x67,
1319 0x65, 0x00, 0x10, 0x00, 0x00, 0x00, 0x45, 0x6D,
1320 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x20, 0x4F,
1321 0x62, 0x6A, 0x65, 0x63, 0x74, 0x00, 0x0E, 0x00,
1322 0x00, 0x00, 0x46, 0x6F, 0x72, 0x6D, 0x73, 0x2E,
1323 0x49, 0x6D, 0x61, 0x67, 0x65, 0x2E, 0x31, 0x00,
1324 0xF4, 0x39, 0xB2, 0x71, 0x00, 0x00, 0x00, 0x00,
1325 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
1326 };
1327 rOutStream.writeMemory( aCompObj, sizeof( aCompObj ) );
1328}
1329
1331{
1332 return API_CONTROL_IMAGE;
1333}
1334
1336{
1337 rPropMap.setProperty( PROP_Enabled, getFlag( mnFlags, AX_FLAGS_ENABLED ) );
1340 rConv.convertAxPicture( rPropMap, maPictureData, mnPicSizeMode );
1341 AxControlModelBase::convertProperties( rPropMap, rConv );
1342}
1343
1345 mnListIndex( 0 ),
1346 mnTabStyle( 0 ),
1347 mnTabData( 0 ),
1348 mnVariousPropertyBits( 0 )
1349{
1350}
1351
1353{
1354 // not worth reading much here, basically we are interested
1355 // in whether we have tabs, the width, the height and the
1356 // captions, everything else we can pretty much discard ( for now )
1357 AxBinaryPropertyReader aReader( rInStrm );
1358 aReader.readIntProperty< sal_uInt32 >( mnListIndex ); // ListIndex
1359 aReader.skipIntProperty< sal_uInt32 >(); // Backcolor
1360 aReader.skipIntProperty< sal_uInt32 >(); // ForeColor
1361 aReader.skipUndefinedProperty();
1362 aReader.readPairProperty( maSize );
1364 aReader.skipIntProperty< sal_uInt8 >(); // MousePointer
1365 aReader.skipUndefinedProperty();
1366 aReader.skipIntProperty< sal_uInt32 >(); // TabOrientation
1367 aReader.readIntProperty< sal_uInt32 >(mnTabStyle); // TabStyle
1368 aReader.skipBoolProperty(); // MultiRow
1369 aReader.skipIntProperty< sal_uInt32 >(); // TabFixedWidth
1370 aReader.skipIntProperty< sal_uInt32 >(); // TabFixedHeight
1371 aReader.skipBoolProperty(); // ToolTips
1372 aReader.skipUndefinedProperty();
1373 aReader.skipArrayStringProperty(); // ToolTip strings
1374 aReader.skipUndefinedProperty();
1375 aReader.readArrayStringProperty( maTabNames ); // Tab names
1376 aReader.readIntProperty< sal_uInt32 >(mnVariousPropertyBits); // VariousPropertyBits
1377 aReader.skipBoolProperty();// NewVersion
1378 aReader.skipIntProperty< sal_uInt32 >(); // TabsAllocated
1379 aReader.skipArrayStringProperty(); // Tags
1380 aReader.readIntProperty<sal_uInt32 >(mnTabData); // TabData
1381 aReader.skipArrayStringProperty(); // Accelerators
1382 aReader.skipPictureProperty(); // Mouse Icon
1383 return aReader.finalizeImport() && AxFontDataModel::importBinaryModel( rInStrm );
1384}
1385
1387{
1388 return API_CONTROL_TABSTRIP;
1389}
1390
1392 mnTextColor( AX_SYSCOLOR_WINDOWTEXT ),
1393 mnBackColor( AX_SYSCOLOR_WINDOWBACK ),
1394 mnFlags( AX_MORPHDATA_DEFFLAGS ),
1395 mnPicturePos( AX_PICPOS_ABOVECENTER ),
1396 mnBorderColor( AX_SYSCOLOR_WINDOWFRAME ),
1397 mnBorderStyle( AX_BORDERSTYLE_NONE ),
1398 mnSpecialEffect( AX_SPECIALEFFECT_SUNKEN ),
1399 mnDisplayStyle( AX_DISPLAYSTYLE_TEXT ),
1400 mnMultiSelect( AX_SELECTION_SINGLE ),
1401 mnScrollBars( AX_SCROLLBAR_NONE ),
1402 mnMatchEntry( AX_MATCHENTRY_NONE ),
1403 mnShowDropButton( AX_SHOWDROPBUTTON_NEVER ),
1404 mnMaxLength( 0 ),
1405 mnPasswordChar( 0 ),
1406 mnListRows( 8 ),
1407 mnVerticalAlign( XML_Center )
1408{
1409}
1410
1411void AxMorphDataModelBase::importProperty( sal_Int32 nPropId, const OUString& rValue )
1412{
1413 switch( nPropId )
1414 {
1415 case XML_Caption: maCaption = rValue; break;
1416 case XML_Value: maValue = rValue; break;
1417 case XML_GroupName: maGroupName = rValue; break;
1418 case XML_ForeColor: mnTextColor = AttributeConversion::decodeUnsigned( rValue ); break;
1419 case XML_BackColor: mnBackColor = AttributeConversion::decodeUnsigned( rValue ); break;
1420 case XML_VariousPropertyBits: mnFlags = AttributeConversion::decodeUnsigned( rValue ); break;
1421 case XML_PicturePosition: mnPicturePos = AttributeConversion::decodeUnsigned( rValue ); break;
1422 case XML_BorderColor: mnBorderColor = AttributeConversion::decodeUnsigned( rValue ); break;
1423 case XML_BorderStyle: mnBorderStyle = AttributeConversion::decodeInteger( rValue ); break;
1424 case XML_SpecialEffect: mnSpecialEffect = AttributeConversion::decodeInteger( rValue ); break;
1425 case XML_DisplayStyle: mnDisplayStyle = AttributeConversion::decodeInteger( rValue ); break;
1426 case XML_MultiSelect: mnMultiSelect = AttributeConversion::decodeInteger( rValue ); break;
1427 case XML_ScrollBars: mnScrollBars = AttributeConversion::decodeInteger( rValue ); break;
1428 case XML_MatchEntry: mnMatchEntry = AttributeConversion::decodeInteger( rValue ); break;
1429 case XML_ShowDropButtonWhen: mnShowDropButton = AttributeConversion::decodeInteger( rValue );break;
1430 case XML_MaxLength: mnMaxLength = AttributeConversion::decodeInteger( rValue ); break;
1431 case XML_PasswordChar: mnPasswordChar = AttributeConversion::decodeInteger( rValue ); break;
1432 case XML_ListRows: mnListRows = AttributeConversion::decodeInteger( rValue ); break;
1433 default: AxFontDataModel::importProperty( nPropId, rValue );
1434 }
1435}
1436
1438{
1439 switch( nPropId )
1440 {
1441 case XML_Picture: OleHelper::importStdPic( maPictureData, rInStrm ); break;
1442 default: AxFontDataModel::importPictureData( nPropId, rInStrm );
1443 }
1444}
1445
1447{
1448 AxBinaryPropertyReader aReader( rInStrm, true );
1449 aReader.readIntProperty< sal_uInt32 >( mnFlags );
1450 aReader.readIntProperty< sal_uInt32 >( mnBackColor );
1451 aReader.readIntProperty< sal_uInt32 >( mnTextColor );
1452 aReader.readIntProperty< sal_Int32 >( mnMaxLength );
1456 aReader.skipIntProperty< sal_uInt8 >(); // mouse pointer
1457 aReader.readPairProperty( maSize );
1458 aReader.readIntProperty< sal_uInt16 >( mnPasswordChar );
1459 aReader.skipIntProperty< sal_uInt32 >(); // list width
1460 aReader.skipIntProperty< sal_uInt16 >(); // bound column
1461 aReader.skipIntProperty< sal_Int16 >(); // text column
1462 aReader.skipIntProperty< sal_Int16 >(); // column count
1463 aReader.readIntProperty< sal_uInt16 >( mnListRows );
1464 aReader.skipIntProperty< sal_uInt16 >(); // column info count
1466 aReader.skipIntProperty< sal_uInt8 >(); // list style
1468 aReader.skipUndefinedProperty();
1469 aReader.skipIntProperty< sal_uInt8 >(); // drop down style
1471 aReader.readStringProperty( maValue );
1472 aReader.readStringProperty( maCaption );
1473 aReader.readIntProperty< sal_uInt32 >( mnPicturePos );
1474 aReader.readIntProperty< sal_uInt32 >( mnBorderColor );
1475 aReader.readIntProperty< sal_uInt32 >( mnSpecialEffect );
1476 aReader.skipPictureProperty(); // mouse icon
1478 aReader.skipIntProperty< sal_uInt16 >(); // accelerator
1479 aReader.skipUndefinedProperty();
1480 aReader.skipBoolProperty();
1482 return aReader.finalizeImport() && AxFontDataModel::importBinaryModel( rInStrm );
1483}
1484
1486{
1487 AxBinaryPropertyWriter aWriter( rOutStrm, true );
1488 if ( mnFlags != AX_MORPHDATA_DEFFLAGS )
1489 aWriter.writeIntProperty< sal_uInt32 >( mnFlags );
1490 else
1491 aWriter.skipProperty(); //mnFlags
1492 if ( mnBackColor )
1493 aWriter.writeIntProperty< sal_uInt32 >( mnBackColor );
1494 else
1495 aWriter.skipProperty(); // default backcolour
1496 aWriter.writeIntProperty< sal_uInt32 >( mnTextColor );
1497
1498 // only write if different from default
1500 aWriter.writeIntProperty< sal_Int32 >( mnMaxLength );
1501 else
1502 aWriter.skipProperty(); //mnMaxLength
1505 else
1506 aWriter.skipProperty(); //mnBorderStyle
1507
1510 else
1511 aWriter.skipProperty(); //mnScrollBars
1513 aWriter.skipProperty(); // mouse pointer
1514 aWriter.writePairProperty( maSize );
1516 aWriter.writeIntProperty< sal_uInt16 >( mnPasswordChar );
1517 else
1518 aWriter.skipProperty(); // mnPasswordChar
1519 aWriter.skipProperty(); // list width
1520 aWriter.skipProperty(); // bound column
1521 aWriter.skipProperty(); // text column
1522 aWriter.skipProperty(); // column count
1523 aWriter.skipProperty(); // mnListRows
1524 aWriter.skipProperty(); // column info count
1525 aWriter.skipProperty(); // mnMatchEntry
1526 aWriter.skipProperty(); // list style
1527 aWriter.skipProperty(); // mnShowDropButton );
1528 aWriter.skipProperty();
1529 aWriter.skipProperty(); // drop down style
1532 // although CheckBox, ListBox, OptionButton, ToggleButton are also supported
1533 // they can only have the fileformat default
1534 else
1535 aWriter.skipProperty(); //mnMultiSelect
1536 aWriter.writeStringProperty( maValue );
1537
1539 aWriter.writeStringProperty( maCaption );
1540 else
1541 aWriter.skipProperty(); // mnCaption
1542 aWriter.skipProperty(); // mnPicturePos );
1544 aWriter.writeIntProperty< sal_uInt32 >( mnBorderColor );
1545 else
1546 aWriter.skipProperty(); // mnBorderColor
1548 aWriter.writeIntProperty< sal_uInt32 >( mnSpecialEffect );
1549 else
1550 aWriter.skipProperty(); //mnSpecialEffect
1551 aWriter.skipProperty(); // mouse icon
1552 aWriter.skipProperty(); // maPictureData
1553 aWriter.skipProperty(); // accelerator
1554 aWriter.skipProperty(); // undefined
1555 aWriter.writeBoolProperty(true); // must be 1 for morph
1558 else
1559 aWriter.skipProperty(); //maGroupName
1560 aWriter.finalizeExport();
1562}
1563
1565{
1566 rPropMap.setProperty( PROP_Enabled, getFlag( mnFlags, AX_FLAGS_ENABLED ) );
1567 rConv.convertColor( rPropMap, PROP_TextColor, mnTextColor );
1569 {
1570 // If unspecified, radio buttons autoGroup in the same document/sheet
1571 // NOTE: form controls should not autoGroup with ActiveX controls - see drawingfragment.cxx
1572 OUString sGroupName = !maGroupName.isEmpty() ? maGroupName : "autoGroup_";
1573 rPropMap.setProperty( PROP_GroupName, sGroupName );
1574 }
1575 AxFontDataModel::convertProperties( rPropMap, rConv );
1576}
1577
1579{
1581 rPropSet.getProperty( maGroupName, PROP_GroupName );
1582 AxFontDataModel::convertFromProperties( rPropSet, rConv );
1583}
1584
1586{
1588}
1589
1591{
1592 OSL_ENSURE( mnDisplayStyle == AX_DISPLAYSTYLE_TOGGLE, "AxToggleButtonModel::getControlType - invalid control type" );
1593 return API_CONTROL_BUTTON;
1594}
1595
1597{
1598 rPropSet.getProperty( maCaption, PROP_Label );
1599
1600 bool bRes = false;
1601 if ( rPropSet.getProperty( bRes, PROP_MultiLine ) )
1603
1604 ControlConverter::convertToMSColor( rPropSet, PROP_BackgroundColor, mnBackColor );
1606 // need to process the image if one exists
1609}
1610
1612{
1613 rPropMap.setProperty( PROP_Label, maCaption );
1614 rPropMap.setProperty( PROP_MultiLine, getFlag( mnFlags, AX_FLAGS_WORDWRAP ) );
1615 rPropMap.setProperty( PROP_Toggle, true );
1618 rConv.convertAxPicture( rPropMap, maPictureData, mnPicturePos );
1620 AxMorphDataModelBase::convertProperties( rPropMap, rConv );
1621}
1622
1624{
1625 // should be able to replace this hardcoded foo with
1626 // proper export info from MS-OLEDS spec.
1627 static sal_uInt8 const aCompObj[] = {
1628 0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00,
1629 0xFF, 0xFF, 0xFF, 0xFF, 0x60, 0x1D, 0xD2, 0x8B,
1630 0x42, 0xEC, 0xCE, 0x11, 0x9E, 0x0D, 0x00, 0xAA,
1631 0x00, 0x60, 0x02, 0xF3, 0x21, 0x00, 0x00, 0x00,
1632 0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66,
1633 0x74, 0x20, 0x46, 0x6F, 0x72, 0x6D, 0x73, 0x20,
1634 0x32, 0x2E, 0x30, 0x20, 0x54, 0x6F, 0x67, 0x67,
1635 0x6C, 0x65, 0x42, 0x75, 0x74, 0x74, 0x6F, 0x6E,
1636 0x00, 0x10, 0x00, 0x00, 0x00, 0x45, 0x6D, 0x62,
1637 0x65, 0x64, 0x64, 0x65, 0x64, 0x20, 0x4F, 0x62,
1638 0x6A, 0x65, 0x63, 0x74, 0x00, 0x15, 0x00, 0x00,
1639 0x00, 0x46, 0x6F, 0x72, 0x6D, 0x73, 0x2E, 0x54,
1640 0x6F, 0x67, 0x67, 0x6C, 0x65, 0x42, 0x75, 0x74,
1641 0x74, 0x6F, 0x6E, 0x2E, 0x31, 0x00, 0xF4, 0x39,
1642 0xB2, 0x71, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1643 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
1644 };
1645 rOutStream.writeMemory( aCompObj, sizeof( aCompObj ) );
1646}
1647
1649{
1651}
1652
1654{
1655 OSL_ENSURE( mnDisplayStyle == AX_DISPLAYSTYLE_CHECKBOX, "AxCheckBoxModel::getControlType - invalid control type" );
1656 return API_CONTROL_CHECKBOX;
1657}
1658
1660{
1661 rPropMap.setProperty( PROP_Label, maCaption );
1662 rPropMap.setProperty( PROP_MultiLine, getFlag( mnFlags, AX_FLAGS_WORDWRAP ) );
1666 rConv.convertAxPicture( rPropMap, maPictureData, mnPicturePos );
1668 AxMorphDataModelBase::convertProperties( rPropMap, rConv );
1669}
1670
1672{
1673 rPropSet.getProperty( maCaption, PROP_Label );
1674
1675 bool bRes = false;
1676 if ( rPropSet.getProperty( bRes, PROP_MultiLine ) )
1678
1680 ControlConverter::convertToMSColor( rPropSet, PROP_BackgroundColor, mnBackColor );
1682 // need to process the image if one exists
1685}
1686
1688{
1689 // should be able to replace this hardcoded foo with
1690 // proper export info from MS-OLEDS spec.
1691 static sal_uInt8 const aCompObj[] = {
1692 0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00,
1693 0xFF, 0xFF, 0xFF, 0xFF, 0x40, 0x1D, 0xD2, 0x8B,
1694 0x42, 0xEC, 0xCE, 0x11, 0x9E, 0x0D, 0x00, 0xAA,
1695 0x00, 0x60, 0x02, 0xF3, 0x1D, 0x00, 0x00, 0x00,
1696 0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66,
1697 0x74, 0x20, 0x46, 0x6F, 0x72, 0x6D, 0x73, 0x20,
1698 0x32, 0x2E, 0x30, 0x20, 0x43, 0x68, 0x65, 0x63,
1699 0x6B, 0x42, 0x6F, 0x78, 0x00, 0x10, 0x00, 0x00,
1700 0x00, 0x45, 0x6D, 0x62, 0x65, 0x64, 0x64, 0x65,
1701 0x64, 0x20, 0x4F, 0x62, 0x6A, 0x65, 0x63, 0x74,
1702 0x00, 0x11, 0x00, 0x00, 0x00, 0x46, 0x6F, 0x72,
1703 0x6D, 0x73, 0x2E, 0x43, 0x68, 0x65, 0x63, 0x6B,
1704 0x42, 0x6F, 0x78, 0x2E, 0x31, 0x00, 0xF4, 0x39,
1705 0xB2, 0x71, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1706 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
1707 };
1708 rOutStream.writeMemory( aCompObj, sizeof( aCompObj ) );
1709}
1710
1712{
1714}
1715
1717{
1718 OSL_ENSURE( mnDisplayStyle == AX_DISPLAYSTYLE_OPTBUTTON, "AxOptionButtonModel::getControlType - invalid control type" );
1720}
1721
1723{
1724 rPropMap.setProperty( PROP_Label, maCaption );
1725 rPropMap.setProperty( PROP_MultiLine, getFlag( mnFlags, AX_FLAGS_WORDWRAP ) );
1729 rConv.convertAxPicture( rPropMap, maPictureData, mnPicturePos );
1731 AxMorphDataModelBase::convertProperties( rPropMap, rConv );
1732}
1733
1735{
1736 rPropSet.getProperty( maCaption, PROP_Label );
1737
1738 bool bRes = false;
1739 if ( rPropSet.getProperty( bRes, PROP_MultiLine ) )
1741
1743 ControlConverter::convertToMSColor( rPropSet, PROP_BackgroundColor, mnBackColor );
1745 // need to process the image if one exists
1748}
1749
1751{
1752 // should be able to replace this hardcoded foo with
1753 // proper export info from MS-OLEDS spec.
1754 static sal_uInt8 const aCompObj[] = {
1755 0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00,
1756 0xFF, 0xFF, 0xFF, 0xFF, 0x50, 0x1D, 0xD2, 0x8B,
1757 0x42, 0xEC, 0xCE, 0x11, 0x9E, 0x0D, 0x00, 0xAA,
1758 0x00, 0x60, 0x02, 0xF3, 0x21, 0x00, 0x00, 0x00,
1759 0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66,
1760 0x74, 0x20, 0x46, 0x6F, 0x72, 0x6D, 0x73, 0x20,
1761 0x32, 0x2E, 0x30, 0x20, 0x4F, 0x70, 0x74, 0x69,
1762 0x6F, 0x6E, 0x42, 0x75, 0x74, 0x74, 0x6F, 0x6E,
1763 0x00, 0x10, 0x00, 0x00, 0x00, 0x45, 0x6D, 0x62,
1764 0x65, 0x64, 0x64, 0x65, 0x64, 0x20, 0x4F, 0x62,
1765 0x6A, 0x65, 0x63, 0x74, 0x00, 0x15, 0x00, 0x00,
1766 0x00, 0x46, 0x6F, 0x72, 0x6D, 0x73, 0x2E, 0x4F,
1767 0x70, 0x74, 0x69, 0x6F, 0x6E, 0x42, 0x75, 0x74,
1768 0x74, 0x6F, 0x6E, 0x2E, 0x31, 0x00, 0xF4, 0x39,
1769 0xB2, 0x71, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1770 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
1771 };
1772 rOutStream.writeMemory( aCompObj, sizeof( aCompObj ) );
1773}
1774
1776{
1778}
1779
1781{
1782 OSL_ENSURE( mnDisplayStyle == AX_DISPLAYSTYLE_TEXT, "AxTextBoxModel::getControlType - invalid control type" );
1783 return API_CONTROL_EDIT;
1784}
1785
1787{
1789 rPropMap.setProperty( PROP_MultiLine, true );
1790 else
1791 rPropMap.setProperty( PROP_MultiLine, false );
1792 rPropMap.setProperty( PROP_HideInactiveSelection, getFlag( mnFlags, AX_FLAGS_HIDESELECTION ) );
1793 rPropMap.setProperty( PROP_ReadOnly, getFlag( mnFlags, AX_FLAGS_LOCKED ) );
1794 rPropMap.setProperty( mbAwtModel ? PROP_Text : PROP_DefaultText, maValue );
1795 rPropMap.setProperty( PROP_MaxTextLen, getLimitedValue< sal_Int16, sal_Int32 >( mnMaxLength, 0, SAL_MAX_INT16 ) );
1796 if( (0 < mnPasswordChar) && (mnPasswordChar <= SAL_MAX_INT16) )
1797 rPropMap.setProperty( PROP_EchoChar, static_cast< sal_Int16 >( mnPasswordChar ) );
1798 rPropMap.setProperty( PROP_HScroll, getFlag( mnScrollBars, AX_SCROLLBAR_HORIZONTAL ) );
1799 rPropMap.setProperty( PROP_VScroll, getFlag( mnScrollBars, AX_SCROLLBAR_VERTICAL ) );
1802 AxMorphDataModelBase::convertProperties( rPropMap, rConv );
1803}
1804
1806{
1807 bool bRes = false;
1808 if ( rPropSet.getProperty( bRes, PROP_MultiLine ) ) {
1811 }
1812 if ( rPropSet.getProperty( bRes, PROP_HideInactiveSelection ) )
1814 if ( rPropSet.getProperty( bRes, PROP_ReadOnly ) )
1816 rPropSet.getProperty( maValue, ( mbAwtModel ? PROP_Text : PROP_DefaultText ) );
1817 if (maValue.isEmpty() && !mbAwtModel)
1818 // No default value? Then try exporting the current one.
1819 rPropSet.getProperty( maValue, PROP_Text);
1820 sal_Int16 nTmp(0);
1821 if ( rPropSet.getProperty( nTmp, PROP_MaxTextLen ) )
1822 mnMaxLength = nTmp;
1823 if ( rPropSet.getProperty( nTmp, PROP_EchoChar ) )
1824 mnPasswordChar = nTmp;
1825 if ( rPropSet.getProperty( bRes, PROP_HScroll ) )
1827 if ( rPropSet.getProperty( bRes, PROP_VScroll ) )
1829
1830 ControlConverter::convertToMSColor( rPropSet, PROP_BackgroundColor, mnBackColor, 0x80000005L );
1832
1835}
1836
1838{
1839 // should be able to replace this hardcoded foo with
1840 // proper export info from MS-OLEDS spec.
1841 static sal_uInt8 const aCompObj[] = {
1842 0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00,
1843 0xFF, 0xFF, 0xFF, 0xFF, 0x10, 0x1D, 0xD2, 0x8B,
1844 0x42, 0xEC, 0xCE, 0x11, 0x9E, 0x0D, 0x00, 0xAA,
1845 0x00, 0x60, 0x02, 0xF3, 0x1C, 0x00, 0x00, 0x00,
1846 0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66,
1847 0x74, 0x20, 0x46, 0x6F, 0x72, 0x6D, 0x73, 0x20,
1848 0x32, 0x2E, 0x30, 0x20, 0x54, 0x65, 0x78, 0x74,
1849 0x42, 0x6F, 0x78, 0x00, 0x10, 0x00, 0x00, 0x00,
1850 0x45, 0x6D, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64,
1851 0x20, 0x4F, 0x62, 0x6A, 0x65, 0x63, 0x74, 0x00,
1852 0x10, 0x00, 0x00, 0x00, 0x46, 0x6F, 0x72, 0x6D,
1853 0x73, 0x2E, 0x54, 0x65, 0x78, 0x74, 0x42, 0x6F,
1854 0x78, 0x2E, 0x31, 0x00, 0xF4, 0x39, 0xB2, 0x71,
1855 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1856 0x00, 0x00, 0x00, 0x00
1857 };
1858 rOutStream.writeMemory( aCompObj, sizeof( aCompObj ) );
1859}
1860
1862{
1864}
1865
1867{
1868 OSL_ENSURE( mnDisplayStyle == AX_DISPLAYSTYLE_TEXT, "AxNumericFieldModel::getControlType - invalid control type" );
1869 return API_CONTROL_NUMERIC;
1870}
1871
1873{
1874 rPropMap.setProperty( PROP_HideInactiveSelection, getFlag( mnFlags, AX_FLAGS_HIDESELECTION ) );
1875 // TODO: OUString::toDouble() does not handle local decimal separator
1876 rPropMap.setProperty( mbAwtModel ? PROP_Value : PROP_DefaultValue, maValue.toDouble() );
1877 rPropMap.setProperty( PROP_Spin, getFlag( mnScrollBars, AX_SCROLLBAR_VERTICAL ) );
1878 rPropMap.setProperty( PROP_Repeat, true );
1881 AxMorphDataModelBase::convertProperties( rPropMap, rConv );
1882}
1883
1885{
1886 bool bRes = false;
1887 if ( rPropSet.getProperty( bRes, PROP_HideInactiveSelection ) )
1889 rPropSet.getProperty( maValue, ( mbAwtModel ? PROP_Text : PROP_DefaultText ) );
1890 if ( rPropSet.getProperty( bRes, PROP_Spin ) )
1892
1893 ControlConverter::convertToMSColor( rPropSet, PROP_BackgroundColor, mnBackColor );
1895
1898}
1899
1901{
1902 // should be able to replace this hardcoded foo with
1903 // proper export info from MS-OLEDS spec.
1904 static sal_uInt8 const aCompObj[] = {
1905 0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00,
1906 0xFF, 0xFF, 0xFF, 0xFF, 0x10, 0x1D, 0xD2, 0x8B,
1907 0x42, 0xEC, 0xCE, 0x11, 0x9E, 0x0D, 0x00, 0xAA,
1908 0x00, 0x60, 0x02, 0xF3, 0x1C, 0x00, 0x00, 0x00,
1909 0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66,
1910 0x74, 0x20, 0x46, 0x6F, 0x72, 0x6D, 0x73, 0x20,
1911 0x32, 0x2E, 0x30, 0x20, 0x54, 0x65, 0x78, 0x74,
1912 0x42, 0x6F, 0x78, 0x00, 0x10, 0x00, 0x00, 0x00,
1913 0x45, 0x6D, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64,
1914 0x20, 0x4F, 0x62, 0x6A, 0x65, 0x63, 0x74, 0x00,
1915 0x10, 0x00, 0x00, 0x00, 0x46, 0x6F, 0x72, 0x6D,
1916 0x73, 0x2E, 0x54, 0x65, 0x78, 0x74, 0x42, 0x6F,
1917 0x78, 0x2E, 0x31, 0x00, 0xF4, 0x39, 0xB2, 0x71,
1918 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1919 0x00, 0x00, 0x00, 0x00
1920 };
1921 rOutStream.writeMemory( aCompObj, sizeof( aCompObj ) );
1922}
1923
1925{
1927}
1928
1930{
1931 OSL_ENSURE( mnDisplayStyle == AX_DISPLAYSTYLE_LISTBOX, "AxListBoxModel::getControlType - invalid control type" );
1932 return API_CONTROL_LISTBOX;
1933}
1934
1936{
1938 rPropMap.setProperty( PROP_MultiSelection, bMultiSelect );
1939 rPropMap.setProperty( PROP_Dropdown, false );
1942 AxMorphDataModelBase::convertProperties( rPropMap, rConv );
1943}
1944
1946{
1947 bool bRes = false;
1948 if ( rPropSet.getProperty( bRes, PROP_MultiSelection ) )
1949 ControlConverter::convertToMSColor( rPropSet, PROP_BackgroundColor, mnBackColor );
1950
1954}
1955
1957{
1958 // should be able to replace this hardcoded foo with
1959 // proper export info from MS-OLEDS spec.
1960 static sal_uInt8 const aCompObj[] = {
1961 0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00,
1962 0xFF, 0xFF, 0xFF, 0xFF, 0x20, 0x1D, 0xD2, 0x8B,
1963 0x42, 0xEC, 0xCE, 0x11, 0x9E, 0x0D, 0x00, 0xAA,
1964 0x00, 0x60, 0x02, 0xF3, 0x1C, 0x00, 0x00, 0x00,
1965 0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66,
1966 0x74, 0x20, 0x46, 0x6F, 0x72, 0x6D, 0x73, 0x20,
1967 0x32, 0x2E, 0x30, 0x20, 0x4C, 0x69, 0x73, 0x74,
1968 0x42, 0x6F, 0x78, 0x00, 0x10, 0x00, 0x00, 0x00,
1969 0x45, 0x6D, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64,
1970 0x20, 0x4F, 0x62, 0x6A, 0x65, 0x63, 0x74, 0x00,
1971 0x10, 0x00, 0x00, 0x00, 0x46, 0x6F, 0x72, 0x6D,
1972 0x73, 0x2E, 0x4C, 0x69, 0x73, 0x74, 0x42, 0x6F,
1973 0x78, 0x2E, 0x31, 0x00, 0xF4, 0x39, 0xB2, 0x71,
1974 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1975 0x00, 0x00, 0x00, 0x00
1976 };
1977 rOutStream.writeMemory( aCompObj, sizeof( aCompObj ) );
1978}
1979
1981{
1983 mnFlags = 0x2c80481b;
1984}
1985
1987{
1988 OSL_ENSURE( (mnDisplayStyle == AX_DISPLAYSTYLE_COMBOBOX) || (mnDisplayStyle == AX_DISPLAYSTYLE_DROPDOWN), "AxComboBoxModel::getControlType - invalid control type" );
1990}
1991
1993{
1995 {
1996 rPropMap.setProperty( PROP_HideInactiveSelection, getFlag( mnFlags, AX_FLAGS_HIDESELECTION ) );
1997 rPropMap.setProperty( mbAwtModel ? PROP_Text : PROP_DefaultText, maValue );
1998 rPropMap.setProperty( PROP_MaxTextLen, getLimitedValue< sal_Int16, sal_Int32 >( mnMaxLength, 0, SAL_MAX_INT16 ) );
1999 bool bAutoComplete = (mnMatchEntry == AX_MATCHENTRY_FIRSTLETTER) || (mnMatchEntry == AX_MATCHENTRY_COMPLETE);
2000 rPropMap.setProperty( PROP_Autocomplete, bAutoComplete );
2001 }
2003 rPropMap.setProperty( PROP_Dropdown, bShowDropdown );
2004 rPropMap.setProperty( PROP_LineCount, getLimitedValue< sal_Int16, sal_Int32 >( mnListRows, 1, SAL_MAX_INT16 ) );
2007 AxMorphDataModelBase::convertProperties( rPropMap, rConv );
2008}
2009
2011{
2012 // when would we have mnDisplayStyle = AX_DISPLAYSTYLE_DROPDOWN ?
2013 // #TODO check against msocximex
2015 bool bRes = false;
2016
2017 if ( rPropSet.getProperty( bRes, PROP_HideInactiveSelection ) )
2019 rPropSet.getProperty( maValue, ( mbAwtModel ? PROP_Text : PROP_DefaultText ) );
2020
2021 sal_Int16 nTmp(0);
2022 if ( rPropSet.getProperty( nTmp, PROP_MaxTextLen ) )
2023 mnMaxLength = nTmp;
2024 if ( rPropSet.getProperty( bRes, PROP_Autocomplete ) )
2025 {
2026 // when to choose AX_MATCHENTRY_FIRSTLETTER ?
2027 // #TODO check against msocximex
2028 if ( bRes )
2029 mnMatchEntry = AX_MATCHENTRY_COMPLETE;
2030 }
2031 if ( rPropSet.getProperty( bRes, PROP_Dropdown ) )
2032 {
2033 rPropSet.getProperty( mnListRows, PROP_LineCount );
2034 if ( !mnListRows )
2035 mnListRows = 1;
2036 }
2037 ControlConverter::convertToMSColor( rPropSet, PROP_BackgroundColor, mnBackColor );
2039
2042}
2043
2045{
2046 // should be able to replace this hardcoded foo with
2047 // proper export info from MS-OLEDS spec.
2048 static sal_uInt8 const aCompObj[] = {
2049 0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00,
2050 0xFF, 0xFF, 0xFF, 0xFF, 0x30, 0x1D, 0xD2, 0x8B,
2051 0x42, 0xEC, 0xCE, 0x11, 0x9E, 0x0D, 0x00, 0xAA,
2052 0x00, 0x60, 0x02, 0xF3, 0x1D, 0x00, 0x00, 0x00,
2053 0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66,
2054 0x74, 0x20, 0x46, 0x6F, 0x72, 0x6D, 0x73, 0x20,
2055 0x32, 0x2E, 0x30, 0x20, 0x43, 0x6F, 0x6D, 0x62,
2056 0x6F, 0x42, 0x6F, 0x78, 0x00, 0x10, 0x00, 0x00,
2057 0x00, 0x45, 0x6D, 0x62, 0x65, 0x64, 0x64, 0x65,
2058 0x64, 0x20, 0x4F, 0x62, 0x6A, 0x65, 0x63, 0x74,
2059 0x00, 0x11, 0x00, 0x00, 0x00, 0x46, 0x6F, 0x72,
2060 0x6D, 0x73, 0x2E, 0x43, 0x6F, 0x6D, 0x62, 0x6F,
2061 0x42, 0x6F, 0x78, 0x2E, 0x31, 0x00, 0xF4, 0x39,
2062 0xB2, 0x71, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2063 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
2064 };
2065 rOutStream.writeMemory( aCompObj, sizeof( aCompObj ) );
2066}
2067
2069 mnArrowColor( AX_SYSCOLOR_BUTTONTEXT ),
2070 mnBackColor( AX_SYSCOLOR_BUTTONFACE ),
2071 mnFlags( AX_SPINBUTTON_DEFFLAGS ),
2072 mnOrientation( AX_ORIENTATION_AUTO ),
2073 mnMin( 0 ),
2074 mnMax( 100 ),
2075 mnPosition( 0 ),
2076 mnSmallChange( 1 ),
2077 mnDelay( 50 )
2078{
2079}
2080
2082{
2084}
2085
2086void AxSpinButtonModel::importProperty( sal_Int32 nPropId, const OUString& rValue )
2087{
2088 switch( nPropId )
2089 {
2090 case XML_ForeColor: mnArrowColor = AttributeConversion::decodeUnsigned( rValue ); break;
2091 case XML_BackColor: mnBackColor = AttributeConversion::decodeUnsigned( rValue ); break;
2092 case XML_VariousPropertyBits: mnFlags = AttributeConversion::decodeUnsigned( rValue ); break;
2093 case XML_Orientation: mnOrientation = AttributeConversion::decodeInteger( rValue ); break;
2094 case XML_Min: mnMin = AttributeConversion::decodeInteger( rValue ); break;
2095 case XML_Max: mnMax = AttributeConversion::decodeInteger( rValue ); break;
2096 case XML_Position: mnPosition = AttributeConversion::decodeInteger( rValue ); break;
2097 case XML_SmallChange: mnSmallChange = AttributeConversion::decodeInteger( rValue ); break;
2098 case XML_Delay: mnDelay = AttributeConversion::decodeInteger( rValue ); break;
2099 default: AxControlModelBase::importProperty( nPropId, rValue );
2100 }
2101}
2102
2104{
2105 AxBinaryPropertyReader aReader( rInStrm );
2106 aReader.readIntProperty< sal_uInt32 >( mnArrowColor );
2107 aReader.readIntProperty< sal_uInt32 >( mnBackColor );
2108 aReader.readIntProperty< sal_uInt32 >( mnFlags );
2109 aReader.readPairProperty( maSize );
2110 aReader.skipIntProperty< sal_uInt32 >(); // unused
2111 aReader.readIntProperty< sal_Int32 >( mnMin );
2112 aReader.readIntProperty< sal_Int32 >( mnMax );
2113 aReader.readIntProperty< sal_Int32 >( mnPosition );
2114 aReader.skipIntProperty< sal_uInt32 >(); // prev enabled
2115 aReader.skipIntProperty< sal_uInt32 >(); // next enabled
2116 aReader.readIntProperty< sal_Int32 >( mnSmallChange );
2117 aReader.readIntProperty< sal_Int32 >( mnOrientation );
2118 aReader.readIntProperty< sal_Int32 >( mnDelay );
2119 aReader.skipPictureProperty(); // mouse icon
2120 aReader.skipIntProperty< sal_uInt8 >(); // mouse pointer
2121 return aReader.finalizeImport();
2122}
2123
2125{
2126 AxBinaryPropertyWriter aWriter( rOutStrm );
2127 aWriter.writeIntProperty< sal_uInt32 >( mnArrowColor );
2128 if ( mnBackColor )
2129 aWriter.writeIntProperty< sal_uInt32 >( mnBackColor );
2130 else
2131 aWriter.skipProperty(); // default backcolour
2132 aWriter.writeIntProperty< sal_uInt32 >( mnFlags );
2133 aWriter.writePairProperty( maSize );
2134 aWriter.skipProperty(); // unused
2135 aWriter.writeIntProperty< sal_Int32 >( mnMin );
2136 aWriter.writeIntProperty< sal_Int32 >( mnMax );
2137 aWriter.writeIntProperty< sal_Int32 >( mnPosition );
2138 aWriter.skipProperty(); // prev enabled
2139 aWriter.skipProperty(); // next enabled
2140 aWriter.writeIntProperty< sal_Int32 >( mnSmallChange );
2141 aWriter.writeIntProperty< sal_Int32 >( mnOrientation );
2142 aWriter.writeIntProperty< sal_Int32 >( mnDelay );
2143 aWriter.skipProperty(); // mouse icon
2144 aWriter.skipProperty(); // mouse pointer
2145
2146 aWriter.finalizeExport();
2147}
2148
2150{
2151 sal_Int32 nMin = ::std::min( mnMin, mnMax );
2152 sal_Int32 nMax = ::std::max( mnMin, mnMax );
2153 rPropMap.setProperty( PROP_Enabled, getFlag( mnFlags, AX_FLAGS_ENABLED ) );
2154 rPropMap.setProperty( PROP_SpinValueMin, nMin );
2155 rPropMap.setProperty( PROP_SpinValueMax, nMax );
2156 rPropMap.setProperty( PROP_SpinIncrement, mnSmallChange );
2157 rPropMap.setProperty( mbAwtModel ? PROP_SpinValue : PROP_DefaultSpinValue, mnPosition );
2158 rPropMap.setProperty( PROP_Repeat, true );
2159 rPropMap.setProperty( PROP_RepeatDelay, mnDelay );
2160 rPropMap.setProperty( PROP_Border, API_BORDER_NONE );
2161 rConv.convertColor( rPropMap, PROP_SymbolColor, mnArrowColor );
2164 AxControlModelBase::convertProperties( rPropMap, rConv );
2165}
2166
2168{
2169 bool bRes = false;
2170 if ( rPropSet.getProperty( bRes, PROP_Enabled ) )
2172 rPropSet.getProperty( mnMin, PROP_SpinValueMin );
2173 rPropSet.getProperty( mnMax, PROP_SpinValueMax );
2174 rPropSet.getProperty( mnSmallChange, PROP_SpinIncrement );
2175 rPropSet.getProperty( mnPosition, ( mbAwtModel ? PROP_SpinValue : PROP_DefaultSpinValue ) );
2176 rPropSet.getProperty( mnDelay, PROP_RepeatDelay );
2178 ControlConverter::convertToMSColor( rPropSet, PROP_BackgroundColor, mnBackColor );
2179
2181}
2182
2184{
2185 // should be able to replace this hardcoded foo with
2186 // proper export info from MS-OLEDS spec.
2187 static sal_uInt8 const aCompObj[] =
2188 {
2189 0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00,
2190 0xFF, 0xFF, 0xFF, 0xFF, 0xB0, 0x6F, 0x17, 0x79,
2191 0xF2, 0xB7, 0xCE, 0x11, 0x97, 0xEF, 0x00, 0xAA,
2192 0x00, 0x6D, 0x27, 0x76, 0x1F, 0x00, 0x00, 0x00,
2193 0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66,
2194 0x74, 0x20, 0x46, 0x6F, 0x72, 0x6D, 0x73, 0x20,
2195 0x32, 0x2E, 0x30, 0x20, 0x53, 0x70, 0x69, 0x6E,
2196 0x42, 0x75, 0x74, 0x74, 0x6F, 0x6E, 0x00, 0x10,
2197 0x00, 0x00, 0x00, 0x45, 0x6D, 0x62, 0x65, 0x64,
2198 0x64, 0x65, 0x64, 0x20, 0x4F, 0x62, 0x6A, 0x65,
2199 0x63, 0x74, 0x00, 0x13, 0x00, 0x00, 0x00, 0x46,
2200 0x6F, 0x72, 0x6D, 0x73, 0x2E, 0x53, 0x70, 0x69,
2201 0x6E, 0x42, 0x75, 0x74, 0x74, 0x6F, 0x6E, 0x2E,
2202 0x31, 0x00, 0xF4, 0x39, 0xB2, 0x71, 0x00, 0x00,
2203 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2204 0x00, 0x00
2205 };
2206
2207 rOutStream.writeMemory( aCompObj, sizeof( aCompObj ) );
2208}
2209
2211 mnArrowColor( AX_SYSCOLOR_BUTTONTEXT ),
2212 mnBackColor( AX_SYSCOLOR_BUTTONFACE ),
2213 mnFlags( AX_SCROLLBAR_DEFFLAGS ),
2214 mnOrientation( AX_ORIENTATION_AUTO ),
2215 mnPropThumb( AX_PROPTHUMB_ON ),
2216 mnMin( 0 ),
2217 mnMax( 32767 ),
2218 mnPosition( 0 ),
2219 mnSmallChange( 1 ),
2220 mnLargeChange( 1 ),
2221 mnDelay( 50 )
2222{
2223}
2224
2226{
2227 return API_CONTROL_SCROLLBAR;
2228}
2229
2230void AxScrollBarModel::importProperty( sal_Int32 nPropId, const OUString& rValue )
2231{
2232 switch( nPropId )
2233 {
2234 case XML_ForeColor: mnArrowColor = AttributeConversion::decodeUnsigned( rValue ); break;
2235 case XML_BackColor: mnBackColor = AttributeConversion::decodeUnsigned( rValue ); break;
2236 case XML_VariousPropertyBits: mnFlags = AttributeConversion::decodeUnsigned( rValue ); break;
2237 case XML_Orientation: mnOrientation = AttributeConversion::decodeInteger( rValue ); break;
2238 case XML_ProportionalThumb: mnPropThumb = AttributeConversion::decodeInteger( rValue ); break;
2239 case XML_Min: mnMin = AttributeConversion::decodeInteger( rValue ); break;
2240 case XML_Max: mnMax = AttributeConversion::decodeInteger( rValue ); break;
2241 case XML_Position: mnPosition = AttributeConversion::decodeInteger( rValue ); break;
2242 case XML_SmallChange: mnSmallChange = AttributeConversion::decodeInteger( rValue ); break;
2243 case XML_LargeChange: mnLargeChange = AttributeConversion::decodeInteger( rValue ); break;
2244 case XML_Delay: mnDelay = AttributeConversion::decodeInteger( rValue ); break;
2245 default: AxControlModelBase::importProperty( nPropId, rValue );
2246 }
2247}
2248
2250{
2251 AxBinaryPropertyReader aReader( rInStrm );
2252 aReader.readIntProperty< sal_uInt32 >( mnArrowColor );
2253 aReader.readIntProperty< sal_uInt32 >( mnBackColor );
2254 aReader.readIntProperty< sal_uInt32 >( mnFlags );
2255 aReader.readPairProperty( maSize );
2256 aReader.skipIntProperty< sal_uInt8 >(); // mouse pointer
2257 aReader.readIntProperty< sal_Int32 >( mnMin );
2258 aReader.readIntProperty< sal_Int32 >( mnMax );
2259 aReader.readIntProperty< sal_Int32 >( mnPosition );
2260 aReader.skipIntProperty< sal_uInt32 >(); // unused
2261 aReader.skipIntProperty< sal_uInt32 >(); // prev enabled
2262 aReader.skipIntProperty< sal_uInt32 >(); // next enabled
2263 aReader.readIntProperty< sal_Int32 >( mnSmallChange );
2264 aReader.readIntProperty< sal_Int32 >( mnLargeChange );
2265 aReader.readIntProperty< sal_Int32 >( mnOrientation );
2266 aReader.readIntProperty< sal_Int16 >( mnPropThumb );
2267 aReader.readIntProperty< sal_Int32 >( mnDelay );
2268 aReader.skipPictureProperty(); // mouse icon
2269 return aReader.finalizeImport();
2270}
2271
2273{
2274 AxBinaryPropertyWriter aWriter( rOutStrm );
2275 aWriter.writeIntProperty< sal_uInt32 >( mnArrowColor );
2276 if ( mnBackColor )
2277 aWriter.writeIntProperty< sal_uInt32 >( mnBackColor );
2278 else
2279 aWriter.skipProperty(); // default backcolour
2280 aWriter.writeIntProperty< sal_uInt32 >( mnFlags );
2281 aWriter.writePairProperty( maSize );
2282 aWriter.skipProperty(); // mouse pointer
2283 aWriter.writeIntProperty< sal_Int32 >( mnMin );
2284 aWriter.writeIntProperty< sal_Int32 >( mnMax );
2285 aWriter.writeIntProperty< sal_Int32 >( mnPosition );
2286 aWriter.skipProperty(); // unused
2287 aWriter.skipProperty(); // prev enabled
2288 aWriter.skipProperty(); // next enabled
2289 aWriter.writeIntProperty< sal_Int32 >( mnSmallChange );
2290 aWriter.writeIntProperty< sal_Int32 >( mnLargeChange );
2291 aWriter.writeIntProperty< sal_Int32 >( mnOrientation );
2292 aWriter.writeIntProperty< sal_Int16 >( mnPropThumb );
2293 aWriter.writeIntProperty< sal_Int32 >( mnDelay );
2294 aWriter.skipProperty(); // mouse icon
2295 aWriter.finalizeExport();
2296}
2297
2299{
2300 // should be able to replace this hardcoded foo with
2301 // proper export info from MS-OLEDS spec.
2302 static sal_uInt8 const aCompObj[] =
2303 {
2304 0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00,
2305 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x81, 0xD1, 0xDF,
2306 0x2F, 0x5E, 0xCE, 0x11, 0xA4, 0x49, 0x00, 0xAA,
2307 0x00, 0x4A, 0x80, 0x3D, 0x1E, 0x00, 0x00, 0x00,
2308 0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66,
2309 0x74, 0x20, 0x46, 0x6F, 0x72, 0x6D, 0x73, 0x20,
2310 0x32, 0x2E, 0x30, 0x20, 0x53, 0x63, 0x72, 0x6F,
2311 0x6C, 0x6C, 0x42, 0x61, 0x72, 0x00, 0x10, 0x00,
2312 0x00, 0x00, 0x45, 0x6D, 0x62, 0x65, 0x64, 0x64,
2313 0x65, 0x64, 0x20, 0x4F, 0x62, 0x6A, 0x65, 0x63,
2314 0x74, 0x00, 0x12, 0x00, 0x00, 0x00, 0x46, 0x6F,
2315 0x72, 0x6D, 0x73, 0x2E, 0x53, 0x63, 0x72, 0x6F,
2316 0x6C, 0x6C, 0x42, 0x61, 0x72, 0x2E, 0x31, 0x00,
2317 0xF4, 0x39, 0xB2, 0x71, 0x00, 0x00, 0x00, 0x00,
2318 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
2319 };
2320 rOutStream.writeMemory( aCompObj, sizeof( aCompObj ) );
2321}
2322
2324{
2325 rPropMap.setProperty( PROP_Enabled, getFlag( mnFlags, AX_FLAGS_ENABLED ) );
2326 rPropMap.setProperty( PROP_RepeatDelay, mnDelay );
2327 rPropMap.setProperty( PROP_Border, API_BORDER_NONE );
2328 if( (mnPropThumb == AX_PROPTHUMB_ON) && (mnMin != mnMax) && (mnLargeChange > 0) )
2329 {
2330 // use double to prevent integer overflow in division (fInterval+mnLargeChange may become 0 when performed as int)
2331 double fInterval = fabs( static_cast< double >( mnMax - mnMin ) );
2332 sal_Int32 nThumbLen = getLimitedValue< sal_Int32, double >( (fInterval * mnLargeChange) / (fInterval + mnLargeChange), 1, SAL_MAX_INT32 );
2333 rPropMap.setProperty( PROP_VisibleSize, nThumbLen );
2334 }
2335 rConv.convertColor( rPropMap, PROP_SymbolColor, mnArrowColor );
2339 AxControlModelBase::convertProperties( rPropMap, rConv );
2340}
2341
2343{
2344 bool bRes = false;
2345 if ( rPropSet.getProperty( bRes, PROP_Enabled ) )
2347 rPropSet.getProperty( mnDelay, PROP_RepeatDelay );
2348 mnPropThumb = AX_PROPTHUMB_ON; // default
2350 ControlConverter::convertToMSColor( rPropSet, PROP_BackgroundColor, mnBackColor );
2352
2353 rPropSet.getProperty( mnMin, PROP_ScrollValueMin );
2354 rPropSet.getProperty( mnMax, PROP_ScrollValueMax );
2355 rPropSet.getProperty( mnSmallChange, PROP_LineIncrement );
2356 rPropSet.getProperty( mnLargeChange, PROP_BlockIncrement );
2357 rPropSet.getProperty( mnPosition, ( mbAwtModel ? PROP_ScrollValue : PROP_DefaultScrollValue ) );
2358
2359}
2360
2362 AxFontDataModel( false ), // no support for alignment properties
2363 maLogicalSize( AX_CONTAINER_DEFWIDTH, AX_CONTAINER_DEFHEIGHT ),
2364 maScrollPos( 0, 0 ),
2365 mnBackColor( AX_SYSCOLOR_BUTTONFACE ),
2366 mnTextColor( AX_SYSCOLOR_BUTTONTEXT ),
2367 mnFlags( AX_CONTAINER_DEFFLAGS ),
2368 mnBorderColor( AX_SYSCOLOR_BUTTONTEXT ),
2369 mnBorderStyle( AX_BORDERSTYLE_NONE ),
2370 mnScrollBars( AX_CONTAINER_SCR_NONE ),
2371 mnCycleType( AX_CONTAINER_CYCLEALL ),
2372 mnSpecialEffect( AX_SPECIALEFFECT_FLAT ),
2373 mnPicAlign( AX_PICALIGN_CENTER ),
2374 mnPicSizeMode( AX_PICSIZE_CLIP ),
2375 mbPicTiling( false ),
2376 mbFontSupport( bFontSupport )
2377{
2379 // different default size for frame
2380 maSize = AxPairData( AX_CONTAINER_DEFWIDTH, AX_CONTAINER_DEFHEIGHT );
2381}
2382
2383void AxContainerModelBase::importProperty( sal_Int32 nPropId, const OUString& rValue )
2384{
2385 if( nPropId == XML_Caption )
2386 maCaption = rValue;
2387}
2388
2390{
2391 AxBinaryPropertyReader aReader( rInStrm );
2392 aReader.skipUndefinedProperty();
2393 aReader.readIntProperty< sal_uInt32 >( mnBackColor );
2394 aReader.readIntProperty< sal_uInt32 >( mnTextColor );
2395 aReader.skipIntProperty< sal_uInt32 >(); // next available control ID
2396 aReader.skipUndefinedProperty();
2397 aReader.skipUndefinedProperty();
2398 aReader.readIntProperty< sal_uInt32 >( mnFlags );
2400 aReader.skipIntProperty< sal_uInt8 >(); // mouse pointer
2402 aReader.readPairProperty( maSize );
2404 aReader.readPairProperty( maScrollPos );
2405 aReader.skipIntProperty< sal_uInt32 >(); // number of control groups
2406 aReader.skipUndefinedProperty();
2407 aReader.skipPictureProperty(); // mouse icon
2410 aReader.readIntProperty< sal_uInt32 >( mnBorderColor );
2411 aReader.readStringProperty( maCaption );
2412 aReader.readFontProperty( maFontData );
2414 aReader.skipIntProperty< sal_Int32 >(); // zoom
2415 aReader.readIntProperty< sal_uInt8 >( mnPicAlign );
2416 aReader.readBoolProperty( mbPicTiling );
2418 aReader.skipIntProperty< sal_uInt32 >(); // shape cookie
2419 aReader.skipIntProperty< sal_uInt32 >(); // draw buffer size
2420 return aReader.finalizeImport();
2421}
2422
2424{
2425 if( mbFontSupport )
2426 {
2427 rConv.convertColor( rPropMap, PROP_TextColor, mnTextColor );
2428 AxFontDataModel::convertProperties( rPropMap, rConv );
2429 }
2430}
2431
2433{
2434 bool bValid = true;
2435 orClassTable.clear();
2436 if( !getFlag( mnFlags, AX_CONTAINER_NOCLASSTABLE ) )
2437 {
2438 sal_uInt16 nCount = rInStrm.readuInt16();
2439 for( sal_uInt16 nIndex = 0; bValid && (nIndex < nCount); ++nIndex )
2440 {
2441 orClassTable.emplace_back( );
2442 AxBinaryPropertyReader aReader( rInStrm );
2443 aReader.readGuidProperty( orClassTable.back() );
2444 aReader.skipGuidProperty(); // source interface GUID
2445 aReader.skipUndefinedProperty();
2446 aReader.skipGuidProperty(); // default interface GUID
2447 aReader.skipIntProperty< sal_uInt32 >(); // class table and var flags
2448 aReader.skipIntProperty< sal_uInt32 >(); // method count
2449 aReader.skipIntProperty< sal_Int32 >(); // IDispatch identifier for linked cell access
2450 aReader.skipIntProperty< sal_uInt16 >(); // get function index for linked cell access
2451 aReader.skipIntProperty< sal_uInt16 >(); // put function index for linked cell access
2452 aReader.skipIntProperty< sal_uInt16 >(); // linked cell access property type
2453 aReader.skipIntProperty< sal_uInt16 >(); // get function index of value
2454 aReader.skipIntProperty< sal_uInt16 >(); // put function index of value
2455 aReader.skipIntProperty< sal_uInt16 >(); // value type
2456 aReader.skipIntProperty< sal_Int32 >(); // IDispatch identifier for source range access
2457 aReader.skipIntProperty< sal_uInt16 >(); // get function index for source range access
2458 bValid = aReader.finalizeImport();
2459 }
2460 }
2461 return bValid;
2462}
2463
2465 AxContainerModelBase( true )
2466{
2467}
2468
2470{
2472}
2473
2475{
2476 rPropMap.setProperty( PROP_Label, maCaption );
2477 rPropMap.setProperty( PROP_Enabled, getFlag( mnFlags, AX_CONTAINER_ENABLED ) );
2478 AxContainerModelBase::convertProperties( rPropMap, rConv );
2479}
2480
2482{
2483}
2484
2486{
2487 return API_CONTROL_PAGE;
2488}
2489
2491{
2492 rPropMap.setProperty( PROP_Title, maCaption );
2493 rConv.convertColor( rPropMap, PROP_BackgroundColor, mnBackColor );
2494 rPropMap.setProperty( PROP_Enabled, getFlag( mnFlags, AX_CONTAINER_ENABLED ) );
2495 AxContainerModelBase::convertProperties( rPropMap, rConv );
2496}
2497
2499 mnActiveTab( 0 ),
2500 mnTabStyle( AX_TABSTRIP_TABS )
2501{
2502}
2503
2505{
2506 return API_CONTROL_MULTIPAGE;
2507}
2508
2510{
2511 // PageProperties
2512 for ( sal_Int32 nPage = 0; nPage < nPages; ++nPage )
2513 {
2514 AxBinaryPropertyReader aReader( rInStrm );
2515 aReader.skipUndefinedProperty();
2516 aReader.skipIntProperty< sal_uInt32 >(); // TransitionEffect
2517 aReader.skipIntProperty< sal_uInt32 >(); // TransitionPeriod
2518 }
2519 // MultiPageProperties
2520 AxBinaryPropertyReader aReader( rInStrm );
2521 sal_uInt32 nPageCount = 0;
2522 aReader.skipUndefinedProperty();
2523 aReader.readIntProperty< sal_uInt32 >(nPageCount); // PageCount
2524 aReader.skipIntProperty< sal_uInt32 >(); //ID
2525
2526 // IDs
2527 for ( sal_uInt32 count = 0; count < nPageCount; ++count )
2528 {
2529 mnIDs.push_back( rInStrm.readInt32() );
2530 }
2531}
2532
2534{
2535 rPropMap.setProperty( PROP_Title, maCaption );
2536 rPropMap.setProperty( PROP_MultiPageValue, mnActiveTab + 1);
2537 rConv.convertColor( rPropMap, PROP_BackgroundColor, mnBackColor );
2538 rPropMap.setProperty( PROP_Enabled, getFlag( mnFlags, AX_CONTAINER_ENABLED ) );
2539 rPropMap.setProperty( PROP_Decoration, mnTabStyle != AX_TABSTRIP_NONE );
2540
2541 AxContainerModelBase::convertProperties( rPropMap, rConv );
2542}
2543
2545{
2546}
2547
2549{
2550 return API_CONTROL_DIALOG;
2551}
2552
2554{
2555 rPropMap.setProperty( PROP_Title, maCaption );
2556 rConv.convertColor( rPropMap, PROP_BackgroundColor, mnBackColor );
2557 rConv.convertAxPicture( rPropMap, maPictureData, AX_PICPOS_CENTER );
2559 AxContainerModelBase::convertProperties( rPropMap, rConv );
2560}
2561
2563{
2564}
2565
2566bool
2568{
2569 if (rInStrm.size()<=0)
2570 return true;
2571
2572 OUString sStringContents = rInStrm.readUnicodeArray( rInStrm.size() );
2573
2574 // replace crlf with lf
2575 OUString data = sStringContents.replaceAll( "\x0D\x0A" , "\x0A" );
2576
2577 std::vector< OUString > listValues;
2578 std::vector< sal_Int16 > selectedIndices;
2579
2580 // Ultra hacky parser for the info
2581 sal_Int32 nLineIdx {0};
2582 // first line will tell us if multiselect is enabled
2583 if (o3tl::getToken(data, 0, '\n', nLineIdx ) == u"<SELECT MULTIPLE")
2585 // skip first and last lines, no data there
2586 if (nLineIdx>0)
2587 {
2588 for (;;)
2589 {
2590 std::u16string_view sLine( o3tl::getToken(data, 0, '\n', nLineIdx ) );
2591 if (nLineIdx<0)
2592 break; // skip last line
2593
2594 if ( !sLine.empty() )
2595 {
2596 OUString displayValue( o3tl::getToken(sLine, 1, '>' ) );
2597 if ( displayValue.getLength() )
2598 {
2599 // Really we should be using a proper html parser
2600 // escaping some common bits to be escaped
2601 displayValue = displayValue.replaceAll( "&lt;", "<" );
2602 displayValue = displayValue.replaceAll( "&gt;", ">" );
2603 displayValue = displayValue.replaceAll( "&quot;", "\"" );
2604 displayValue = displayValue.replaceAll( "&amp;", "&" );
2605 listValues.push_back( displayValue );
2606 if( sLine.find( u"OPTION SELECTED" ) != std::u16string_view::npos )
2607 selectedIndices.push_back( static_cast< sal_Int16 >( listValues.size() ) - 1 );
2608 }
2609 }
2610 }
2611 }
2612 if ( !listValues.empty() )
2613 {
2614 msListData.realloc( listValues.size() );
2615 auto psListData = msListData.getArray();
2616 sal_Int32 index = 0;
2617 for (auto const& listValue : listValues)
2618 psListData[ index++ ] = listValue;
2619 }
2620 if ( !selectedIndices.empty() )
2621 {
2622 msIndices.realloc( selectedIndices.size() );
2623 auto psIndices = msIndices.getArray();
2624 sal_Int32 index = 0;
2625 for (auto const& selectedIndice : selectedIndices)
2626 psIndices[ index++ ] = selectedIndice;
2627 }
2628 return true;
2629}
2630
2631void
2633{
2634 rPropMap.setProperty( PROP_StringItemList, msListData );
2635 rPropMap.setProperty( PROP_SelectedItems, msIndices );
2636 rPropMap.setProperty( PROP_Dropdown, true );
2637 AxListBoxModel::convertProperties( rPropMap, rConv );
2638}
2639
2641{
2642}
2643
2644bool
2646{
2647#ifdef DEBUG
2648 OUString sStringContents = rInStrm.readUnicodeArray( rInStrm.size() );
2649 // in msocximex ( where this is ported from, it appears *nothing* is read
2650 // from the control stream ), surely there is some useful info there ?
2651 SAL_WARN("oox", "HtmlTextBoxModel::importBinaryModel - string contents of stream: " << sStringContents );
2652#else
2653 (void) rInStrm;
2654#endif
2655 return true;
2656}
2657
2659 maName(std::move( aName ))
2660{
2661}
2662
2664{
2665 if( o3tl::equalsIgnoreAsciiCase(rClassId, u"" AX_GUID_COMMANDBUTTON ) ) return &createModel< AxCommandButtonModel >();
2666 if( o3tl::equalsIgnoreAsciiCase(rClassId, u"" AX_GUID_LABEL ) ) return &createModel< AxLabelModel >();
2667 if( o3tl::equalsIgnoreAsciiCase(rClassId, u"" AX_GUID_IMAGE ) ) return &createModel< AxImageModel >();
2668 if( o3tl::equalsIgnoreAsciiCase(rClassId, u"" AX_GUID_TOGGLEBUTTON ) ) return &createModel< AxToggleButtonModel >();
2669 if( o3tl::equalsIgnoreAsciiCase(rClassId, u"" AX_GUID_CHECKBOX ) ) return &createModel< AxCheckBoxModel >();
2670 if( o3tl::equalsIgnoreAsciiCase(rClassId, u"" AX_GUID_OPTIONBUTTON ) ) return &createModel< AxOptionButtonModel >();
2671 if( o3tl::equalsIgnoreAsciiCase(rClassId, u"" AX_GUID_TEXTBOX ) ) return &createModel< AxTextBoxModel >();
2672 if( o3tl::equalsIgnoreAsciiCase(rClassId, u"" AX_GUID_LISTBOX ) ) return &createModel< AxListBoxModel >();
2673 if( o3tl::equalsIgnoreAsciiCase(rClassId, u"" AX_GUID_COMBOBOX ) ) return &createModel< AxComboBoxModel >();
2674 if( o3tl::equalsIgnoreAsciiCase(rClassId, u"" AX_GUID_SPINBUTTON ) ) return &createModel< AxSpinButtonModel >();
2675 if( o3tl::equalsIgnoreAsciiCase(rClassId, u"" AX_GUID_SCROLLBAR ) ) return &createModel< AxScrollBarModel >();
2676 if( o3tl::equalsIgnoreAsciiCase(rClassId, u"" AX_GUID_FRAME ) ) return &createModel< AxFrameModel >();
2677 if( o3tl::equalsIgnoreAsciiCase(rClassId, u"" COMCTL_GUID_SCROLLBAR_60 ) ) return &createModel< ComCtlScrollBarModel >( COMCTL_VERSION_60 );
2678 if( o3tl::equalsIgnoreAsciiCase(rClassId, u"" HTML_GUID_SELECT ) ) return &createModel< HtmlSelectModel >();
2679 if( o3tl::equalsIgnoreAsciiCase(rClassId, u"" HTML_GUID_TEXTBOX ) ) return &createModel< HtmlTextBoxModel >();
2680
2681 mxModel.reset();
2682 return nullptr;
2683}
2684
2686{
2687 return mxModel ? mxModel->getServiceName() : OUString();
2688}
2689
2690bool EmbeddedControl::convertProperties( const Reference< XControlModel >& rxCtrlModel, const ControlConverter& rConv ) const
2691{
2692 if( mxModel && rxCtrlModel.is() && !maName.isEmpty() )
2693 {
2694 PropertyMap aPropMap;
2695 aPropMap.setProperty( PROP_Name, maName );
2696 try
2697 {
2698 aPropMap.setProperty( PROP_GenerateVbaEvents, true);
2699 }
2700 catch (const Exception&)
2701 {
2702 TOOLS_WARN_EXCEPTION("oox", "");
2703 }
2704 mxModel->convertProperties( aPropMap, rConv );
2705 PropertySet aPropSet( rxCtrlModel );
2706 aPropSet.setProperties( aPropMap );
2707 return true;
2708 }
2709 return false;
2710}
2711
2712void EmbeddedControl::convertFromProperties( const Reference< XControlModel >& rxCtrlModel, const ControlConverter& rConv )
2713{
2714 if( mxModel && rxCtrlModel.is() && !maName.isEmpty() )
2715 {
2716 PropertySet aPropSet( rxCtrlModel );
2717 aPropSet.getProperty( maName, PROP_Name );
2718 mxModel->convertFromProperties( aPropSet, rConv );
2719 }
2720}
2721
2722EmbeddedForm::EmbeddedForm( const Reference< XModel >& rxDocModel,
2723 const Reference< XDrawPage >& rxDrawPage, const GraphicHelper& rGraphicHelper ) :
2724 maControlConv( rxDocModel, rGraphicHelper, true/*bDefaultColorBgr*/ ),
2725 mxModelFactory( rxDocModel, UNO_QUERY ),
2726 mxFormsSupp( rxDrawPage, UNO_QUERY )
2727{
2728 OSL_ENSURE( mxModelFactory.is(), "EmbeddedForm::EmbeddedForm - missing service factory" );
2729}
2730
2731Reference< XControlModel > EmbeddedForm::convertAndInsert( const EmbeddedControl& rControl, sal_Int32& rnCtrlIndex )
2732{
2733 Reference< XControlModel > xRet;
2734 if( mxModelFactory.is() && rControl.hasModel() ) try
2735 {
2736 // create the UNO control model
2737 OUString aServiceName = rControl.getServiceName();
2738 Reference< XFormComponent > xFormComp( mxModelFactory->createInstance( aServiceName ), UNO_QUERY_THROW );
2739 Reference< XControlModel > xCtrlModel( xFormComp, UNO_QUERY_THROW );
2740
2741 // convert the control properties
2742 if( rControl.convertProperties( xCtrlModel, maControlConv ) )
2743 xRet = xCtrlModel;
2744 // insert the control into the form
2745 Reference< XIndexContainer > xFormIC( createXForm(), UNO_SET_THROW );
2746 rnCtrlIndex = xFormIC->getCount();
2747 xFormIC->insertByIndex( rnCtrlIndex, Any( xFormComp ) );
2748 }
2749 catch (const Exception&)
2750 {
2751 TOOLS_WARN_EXCEPTION("oox", "exception creating Control");
2752 }
2753 return xRet;
2754}
2755
2756Reference< XIndexContainer > const & EmbeddedForm::createXForm()
2757{
2758 if( mxFormsSupp.is() )
2759 {
2760 try
2761 {
2762 Reference< XNameContainer > xFormsNC( mxFormsSupp->getForms(), UNO_SET_THROW );
2763 OUString aFormName = "Standard";
2764 if( xFormsNC->hasByName( aFormName ) )
2765 {
2766 mxFormIC.set( xFormsNC->getByName( aFormName ), UNO_QUERY_THROW );
2767 }
2768 else if( mxModelFactory.is() )
2769 {
2770 Reference< XForm > xForm( mxModelFactory->createInstance( "com.sun.star.form.component.Form" ), UNO_QUERY_THROW );
2771 xFormsNC->insertByName( aFormName, Any( xForm ) );
2772 mxFormIC.set( xForm, UNO_QUERY_THROW );
2773 }
2774 }
2775 catch (const Exception&)
2776 {
2777 TOOLS_WARN_EXCEPTION("oox", "exception creating Form");
2778 }
2779 // always clear the forms supplier to not try to create the form again
2780 mxFormsSupp.clear();
2781 }
2782 return mxFormIC;
2783}
2784
2785} // namespace oox
2786
2787/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
geometry::RealSize2D maSize
const sal_uInt64 mnPosition
#define AX_PICPOS_IMPL(label, image)
Definition: axcontrol.cxx:121
#define AX_GUID_IMAGE
Definition: axcontrol.hxx:66
#define AX_GUID_COMBOBOX
Definition: axcontrol.hxx:72
#define AX_GUID_FRAME
Definition: axcontrol.hxx:75
#define AX_GUID_SPINBUTTON
Definition: axcontrol.hxx:73
#define AX_GUID_CHECKBOX
Definition: axcontrol.hxx:68
#define HTML_GUID_SELECT
Definition: axcontrol.hxx:79
#define AX_GUID_LABEL
Definition: axcontrol.hxx:65
#define AX_GUID_TEXTBOX
Definition: axcontrol.hxx:70
#define AX_GUID_SCROLLBAR
Definition: axcontrol.hxx:74
#define HTML_GUID_TEXTBOX
Definition: axcontrol.hxx:80
#define AX_GUID_COMMANDBUTTON
Definition: axcontrol.hxx:64
#define AX_GUID_LISTBOX
Definition: axcontrol.hxx:71
#define COMCTL_GUID_SCROLLBAR_60
Definition: axcontrol.hxx:56
#define AX_GUID_TOGGLEBUTTON
Definition: axcontrol.hxx:67
#define AX_GUID_OPTIONBUTTON
Definition: axcontrol.hxx:69
AxFontFlags
Definition: axfontdata.hxx:33
const StyleSettings & GetStyleSettings() const
static OutputDevice * GetDefaultDevice()
const AllSettings & GetSettings() const
const vcl::Font & GetAppFont() const
static sal_uInt32 decodeUnsigned(std::u16string_view rValue)
Returns the 32-bit unsigned integer value from the passed string (decimal).
static sal_Int32 decodeInteger(std::u16string_view rValue)
Returns the 32-bit signed integer value from the passed string (decimal).
Interface for binary input stream classes.
virtual void skip(sal_Int32 nBytes, size_t nAtomSize=1)=0
Derived classes implement seeking the stream forward by the passed number of bytes.
OUString readUnicodeArray(sal_Int32 nChars)
Reads a Unicode character array and returns the string.
Interface for binary output stream classes.
virtual void writeMemory(const void *pMem, sal_Int32 nBytes, size_t nAtomSize=1)=0
Derived classes implement writing the contents of the (preallocated!) memory buffer pMem.
virtual sal_Int64 size() const =0
Implementations return the size of the stream, if possible.
bool isEof() const
Returns true, if the stream position is invalid (EOF).
virtual sal_Int64 tell() const =0
Implementations return the current stream position, if possible.
virtual void seek(sal_Int64 nPos)=0
Implementations seek the stream to the passed position, if the stream is seekable.
Provides helper functions for colors, device measurement conversion, graphics, and graphic objects ha...
css::uno::Reference< css::graphic::XGraphic > importGraphic(const css::uno::Reference< css::io::XInputStream > &rxInStrm, const WmfExternal *pExtHeader=nullptr) const
Imports a graphic from the passed input stream.
css::awt::Point convertHmmToAppFont(const css::awt::Point &rHmm) const
Converts the passed point from 1/100 mm to AppFont units.
A helper that maps property identifiers to property values.
Definition: propertymap.hxx:52
bool setProperty(sal_Int32 nPropId, Type &&rValue)
Sets the specified property to the passed value.
Definition: propertymap.hxx:72
A wrapper for a UNO property set.
Definition: propertyset.hxx:58
void setProperties(const css::uno::Sequence< OUString > &rPropNames, const css::uno::Sequence< css::uno::Any > &rValues)
Puts the passed properties into the property set.
bool getProperty(Type &orValue, sal_Int32 nPropId) const
Gets the specified property from the property set.
Definition: propertyset.hxx:94
Import helper to read simple and complex ActiveX form control properties from a binary input stream.
void skipGuidProperty()
Skips the next GUID property in the stream, if the respective flag in the property mask is set.
void readIntProperty(DataType &ornValue)
Reads the next integer property value from the stream, if the respective flag in the property mask is...
bool finalizeImport()
Final processing, reads contents of all complex properties.
void skipIntProperty()
Skips the next integer property value in the stream, if the respective flag in the property mask is s...
void skipArrayStringProperty()
Skips the next ArrayString property in the stream, if the respective flag in the property mask is set...
void readGuidProperty(OUString &orGuid)
Reads the next GUID property from the stream, if the respective flag in the property mask is set.
void readFontProperty(AxFontData &orFontData)
Reads the next font property from the stream, if the respective flag in the property mask is set.
void readStringProperty(OUString &orValue)
Reads the next string property from the stream, if the respective flag in the property mask is set.
void skipBoolProperty()
Skips the next boolean property value in the stream, if the respective flag in the property mask is s...
void readPairProperty(AxPairData &orPairData)
Reads the next pair property from the stream, if the respective flag in the property mask is set.
void skipPictureProperty()
Skips the next picture property in the stream, if the respective flag in the property mask is set.
void skipUndefinedProperty()
Has to be called for undefined properties.
void readArrayStringProperty(std::vector< OUString > &rStrings)
Reads ArrayString, an array of fmString ( compressed or uncompressed ) is read from the stream and in...
void readBoolProperty(bool &orbValue, bool bReverse=false)
Reads the next boolean property value from the stream, if the respective flag in the property mask is...
void readPictureProperty(StreamDataSequence &orPicData)
Reads the next picture property from the stream, if the respective flag in the property mask is set.
Export helper to write simple and complex ActiveX form control properties to a binary input stream.
void finalizeExport()
Final processing, write contents of all complex properties, writes record size.
void writeIntProperty(DataType ornValue)
Write an integer property value to the stream, the respective flag in the property mask is set.
void writeBoolProperty(bool orbValue)
Write a boolean property value to the stream, the respective flag in the property mask is set.
void writePairProperty(AxPairData &orPairData)
Write a pair property the stream, the respective flag in the property mask is set.
void skipProperty()
Skips the next property clears the respective flag in the property mask.
void writeStringProperty(OUString &orValue)
Write a string property to the stream, the respective flag in the property mask is set.
virtual void convertProperties(PropertyMap &rPropMap, const ControlConverter &rConv) const override
Derived classes convert all control properties.
Definition: axcontrol.cxx:1659
virtual void convertFromProperties(PropertySet &rPropSet, const ControlConverter &rConv) override
Derived classes convert from uno control properties to equiv.
Definition: axcontrol.cxx:1671
virtual ApiControlType getControlType() const override
Derived classes return the UNO control type enum value.
Definition: axcontrol.cxx:1653
virtual void exportCompObj(BinaryOutputStream &rOutStrm) override
Derived classes export CompObjStream contents.
Definition: axcontrol.cxx:1687
virtual void exportCompObj(BinaryOutputStream &rOutStrm) override
Derived classes export CompObjStream contents.
Definition: axcontrol.cxx:2044
virtual ApiControlType getControlType() const override
Derived classes return the UNO control type enum value.
Definition: axcontrol.cxx:1986
virtual void convertProperties(PropertyMap &rPropMap, const ControlConverter &rConv) const override
Derived classes convert all control properties.
Definition: axcontrol.cxx:1992
virtual void convertFromProperties(PropertySet &rPropSet, const ControlConverter &rConv) override
Derived classes convert from uno control properties to equiv.
Definition: axcontrol.cxx:2010
sal_uInt32 mnTextColor
Text color.
Definition: axcontrol.hxx:523
sal_uInt32 mnFlags
Various flags.
Definition: axcontrol.hxx:525
virtual bool importBinaryModel(BinaryInputStream &rInStrm) override
Derived classes import a form control model from the passed input stream.
Definition: axcontrol.cxx:998
bool mbFocusOnClick
True = take focus on click.
Definition: axcontrol.hxx:528
virtual void importPictureData(sal_Int32 nPropId, BinaryInputStream &rInStrm) override
Derived classes set binary data (picture, mouse icon) at the model structure.
Definition: axcontrol.cxx:989
virtual ApiControlType getControlType() const override
Derived classes return the UNO control type enum value.
Definition: axcontrol.cxx:1061
OUString maCaption
Visible caption of the button.
Definition: axcontrol.hxx:522
virtual void convertProperties(PropertyMap &rPropMap, const ControlConverter &rConv) const override
Derived classes convert all control properties.
Definition: axcontrol.cxx:1066
virtual void exportBinaryModel(BinaryOutputStream &rOutStrm) override
Derived classes export a form control model to the passed output stream.
Definition: axcontrol.cxx:1015
virtual void convertFromProperties(PropertySet &rPropSet, const ControlConverter &rConv) override
Derived classes convert from uno control properties to equiv.
Definition: axcontrol.cxx:1079
sal_uInt32 mnBackColor
Fill color.
Definition: axcontrol.hxx:524
sal_Int32 mnVerticalAlign
Vertical alignment (legacy VML drawing controls only).
Definition: axcontrol.hxx:527
virtual void importProperty(sal_Int32 nPropId, const OUString &rValue) override
Derived classes set specific OOXML properties at the model structure.
Definition: axcontrol.cxx:975
StreamDataSequence maPictureData
Binary picture stream.
Definition: axcontrol.hxx:521
sal_uInt32 mnPicturePos
Position of the picture relative to text.
Definition: axcontrol.hxx:526
virtual void exportCompObj(BinaryOutputStream &rOutStrm) override
Derived classes export CompObjStream contents.
Definition: axcontrol.cxx:1036
Base class for ActiveX container controls.
Definition: axcontrol.hxx:798
OUString maCaption
Visible caption of the form.
Definition: axcontrol.hxx:816
virtual bool importBinaryModel(BinaryInputStream &rInStrm) override
Reads the leading structure in the 'f' stream containing the model for this control.
Definition: axcontrol.cxx:2389
sal_Int32 mnBorderStyle
Flat border style.
Definition: axcontrol.hxx:823
sal_Int32 mnPicSizeMode
Clip, stretch, zoom.
Definition: axcontrol.hxx:828
sal_uInt32 mnBorderColor
Flat border color.
Definition: axcontrol.hxx:822
sal_uInt32 mnBackColor
Fill color.
Definition: axcontrol.hxx:819
bool importClassTable(BinaryInputStream &rInStrm, AxClassTable &orClassTable)
Reads the class table structure for embedded controls following the own model from the 'f' stream.
Definition: axcontrol.cxx:2432
sal_uInt32 mnFlags
Various flags.
Definition: axcontrol.hxx:821
StreamDataSequence maPictureData
Binary picture stream.
Definition: axcontrol.hxx:815
AxContainerModelBase(bool bFontSupport=false)
Definition: axcontrol.cxx:2361
virtual void convertProperties(PropertyMap &rPropMap, const ControlConverter &rConv) const override
Converts font settings if supported.
Definition: axcontrol.cxx:2423
sal_Int32 mnScrollBars
Horizontal/vertical scroll bar.
Definition: axcontrol.hxx:824
bool mbFontSupport
True = control supports the font property.
Definition: axcontrol.hxx:830
sal_Int32 mnCycleType
Cycle in all forms or in this form.
Definition: axcontrol.hxx:825
sal_Int32 mnPicAlign
Anchor position of the picture.
Definition: axcontrol.hxx:827
sal_uInt32 mnTextColor
Text color.
Definition: axcontrol.hxx:820
bool mbPicTiling
True = picture is repeated.
Definition: axcontrol.hxx:829
virtual void importProperty(sal_Int32 nPropId, const OUString &rValue) override
Allows to set single properties specified by XML token identifier.
Definition: axcontrol.cxx:2383
AxPairData maScrollPos
Scroll position.
Definition: axcontrol.hxx:818
sal_Int32 mnSpecialEffect
3D border effect.
Definition: axcontrol.hxx:826
AxPairData maLogicalSize
Logical form size (scroll area).
Definition: axcontrol.hxx:817
virtual void importProperty(sal_Int32 nPropId, const OUString &rValue) override
Derived classes set specific OOXML properties at the model structure.
Definition: axcontrol.cxx:831
Base class for Forms 2.0 controls supporting text formatting.
Definition: axcontrol.hxx:483
AxFontData maFontData
The font settings.
Definition: axcontrol.hxx:497
virtual void importProperty(sal_Int32 nPropId, const OUString &rValue) override
Derived classes set specific OOXML properties at the model structure.
Definition: axcontrol.cxx:855
virtual void convertFromProperties(PropertySet &rPropSet, const ControlConverter &rConv) override
Derived classes convert from uno control properties to equiv.
Definition: axcontrol.cxx:923
bool mbSupportsAlign
True = UNO model supports Align property.
Definition: axcontrol.hxx:500
virtual void exportBinaryModel(BinaryOutputStream &rOutStrm) override
Derived classes export a form control model to the passed output stream.
Definition: axcontrol.cxx:877
AxFontDataModel(bool bSupportsAlign=true)
Definition: axcontrol.cxx:850
virtual void convertProperties(PropertyMap &rPropMap, const ControlConverter &rConv) const override
Derived classes convert all control properties.
Definition: axcontrol.cxx:881
virtual bool importBinaryModel(BinaryInputStream &rInStrm) override
Derived classes import a form control model from the passed input stream.
Definition: axcontrol.cxx:872
virtual ApiControlType getControlType() const override
Derived classes return the UNO control type enum value.
Definition: axcontrol.cxx:2469
virtual void convertProperties(PropertyMap &rPropMap, const ControlConverter &rConv) const override
Converts font settings if supported.
Definition: axcontrol.cxx:2474
sal_Int32 mnPicAlign
Anchor position of the picture.
Definition: axcontrol.hxx:582
virtual bool importBinaryModel(BinaryInputStream &rInStrm) override
Derived classes import a form control model from the passed input stream.
Definition: axcontrol.cxx:1262
virtual void convertProperties(PropertyMap &rPropMap, const ControlConverter &rConv) const override
Derived classes convert all control properties.
Definition: axcontrol.cxx:1335
virtual void exportBinaryModel(BinaryOutputStream &rOutStrm) override
Derived classes export a form control model to the passed output stream.
Definition: axcontrol.cxx:1283
virtual ApiControlType getControlType() const override
Derived classes return the UNO control type enum value.
Definition: axcontrol.cxx:1330
virtual void importProperty(sal_Int32 nPropId, const OUString &rValue) override
Derived classes set specific OOXML properties at the model structure.
Definition: axcontrol.cxx:1237
virtual void exportCompObj(BinaryOutputStream &rOutStrm) override
Derived classes export CompObjStream contents.
Definition: axcontrol.cxx:1307
sal_Int32 mnBorderStyle
Flat border style.
Definition: axcontrol.hxx:579
sal_Int32 mnPicSizeMode
Clip, stretch, zoom.
Definition: axcontrol.hxx:581
virtual void importPictureData(sal_Int32 nPropId, BinaryInputStream &rInStrm) override
Derived classes set binary data (picture, mouse icon) at the model structure.
Definition: axcontrol.cxx:1253
sal_uInt32 mnFlags
Various flags.
Definition: axcontrol.hxx:577
bool mbPicTiling
True = picture is repeated.
Definition: axcontrol.hxx:583
sal_uInt32 mnBackColor
Fill color.
Definition: axcontrol.hxx:576
sal_Int32 mnSpecialEffect
3D border effect.
Definition: axcontrol.hxx:580
sal_uInt32 mnBorderColor
Flat border color.
Definition: axcontrol.hxx:578
StreamDataSequence maPictureData
Binary picture stream.
Definition: axcontrol.hxx:575
virtual ApiControlType getControlType() const override
Derived classes return the UNO control type enum value.
Definition: axcontrol.cxx:1208
sal_Int32 mnSpecialEffect
3D border effect.
Definition: axcontrol.hxx:554
virtual void exportCompObj(BinaryOutputStream &rOutStrm) override
Derived classes export CompObjStream contents.
Definition: axcontrol.cxx:1185
virtual bool importBinaryModel(BinaryInputStream &rInStrm) override
Derived classes import a form control model from the passed input stream.
Definition: axcontrol.cxx:1121
sal_uInt32 mnTextColor
Text color.
Definition: axcontrol.hxx:549
sal_uInt32 mnBackColor
Fill color.
Definition: axcontrol.hxx:550
virtual void exportBinaryModel(BinaryOutputStream &rOutStrm) override
Derived classes export a form control model to the passed output stream.
Definition: axcontrol.cxx:1140
OUString maCaption
Visible caption of the button.
Definition: axcontrol.hxx:548
virtual void convertFromProperties(PropertySet &rPropSet, const ControlConverter &rConv) override
Derived classes convert from uno control properties to equiv.
Definition: axcontrol.cxx:1165
virtual void convertProperties(PropertyMap &rPropMap, const ControlConverter &rConv) const override
Derived classes convert all control properties.
Definition: axcontrol.cxx:1213
sal_Int32 mnBorderStyle
Flat border style.
Definition: axcontrol.hxx:553
sal_uInt32 mnFlags
Various flags.
Definition: axcontrol.hxx:551
sal_uInt32 mnBorderColor
Flat border color.
Definition: axcontrol.hxx:552
virtual void importProperty(sal_Int32 nPropId, const OUString &rValue) override
Derived classes set specific OOXML properties at the model structure.
Definition: axcontrol.cxx:1106
sal_Int32 mnVerticalAlign
Vertical alignment (legacy VML drawing controls only).
Definition: axcontrol.hxx:555
virtual void convertFromProperties(PropertySet &rPropSet, const ControlConverter &rConv) override
Derived classes convert from uno control properties to equiv.
Definition: axcontrol.cxx:1945
virtual void exportCompObj(BinaryOutputStream &rOutStrm) override
Derived classes export CompObjStream contents.
Definition: axcontrol.cxx:1956
virtual ApiControlType getControlType() const override
Derived classes return the UNO control type enum value.
Definition: axcontrol.cxx:1929
virtual void convertProperties(PropertyMap &rPropMap, const ControlConverter &rConv) const override
Derived classes convert all control properties.
Definition: axcontrol.cxx:1935
virtual void importProperty(sal_Int32 nPropId, const OUString &rValue) override
Derived classes set specific OOXML properties at the model structure.
Definition: axcontrol.cxx:1411
sal_Int32 mnVerticalAlign
Vertical alignment (legacy VML drawing controls only).
Definition: axcontrol.hxx:638
sal_Int32 mnListRows
Number of rows in dropdown box.
Definition: axcontrol.hxx:637
sal_Int32 mnMultiSelect
Selection mode.
Definition: axcontrol.hxx:631
sal_uInt32 mnFlags
Various flags.
Definition: axcontrol.hxx:625
sal_Int32 mnShowDropButton
When to show the dropdown button.
Definition: axcontrol.hxx:634
OUString maCaption
Visible caption of the button.
Definition: axcontrol.hxx:620
OUString maValue
Current value of the control.
Definition: axcontrol.hxx:621
sal_Int32 mnMaxLength
Maximum character count.
Definition: axcontrol.hxx:635
sal_uInt32 mnBackColor
Fill color.
Definition: axcontrol.hxx:624
sal_Int32 mnBorderStyle
Flat border style.
Definition: axcontrol.hxx:628
sal_Int32 mnMatchEntry
Auto completion mode.
Definition: axcontrol.hxx:633
sal_Int32 mnPasswordChar
Password character in edit fields.
Definition: axcontrol.hxx:636
OUString maGroupName
Group name for option buttons.
Definition: axcontrol.hxx:622
sal_uInt32 mnBorderColor
Flat border color.
Definition: axcontrol.hxx:627
virtual void convertProperties(PropertyMap &rPropMap, const ControlConverter &rConv) const override
Derived classes convert all control properties.
Definition: axcontrol.cxx:1564
sal_Int32 mnSpecialEffect
3D border effect.
Definition: axcontrol.hxx:629
virtual void exportBinaryModel(BinaryOutputStream &rOutStrm) override
Derived classes export a form control model to the passed output stream.
Definition: axcontrol.cxx:1485
virtual void importPictureData(sal_Int32 nPropId, BinaryInputStream &rInStrm) override
Derived classes set binary data (picture, mouse icon) at the model structure.
Definition: axcontrol.cxx:1437
virtual bool importBinaryModel(BinaryInputStream &rInStrm) override
Derived classes import a form control model from the passed input stream.
Definition: axcontrol.cxx:1446
sal_uInt32 mnPicturePos
Position of the picture relative to text.
Definition: axcontrol.hxx:626
sal_Int32 mnScrollBars
Horizontal/vertical scroll bar.
Definition: axcontrol.hxx:632
StreamDataSequence maPictureData
Binary picture stream.
Definition: axcontrol.hxx:619
virtual void convertFromProperties(PropertySet &rPropSet, const ControlConverter &rConv) override
Derived classes convert from uno control properties to equiv.
Definition: axcontrol.cxx:1578
sal_uInt32 mnTextColor
Text color.
Definition: axcontrol.hxx:623
sal_Int32 mnDisplayStyle
Type of the morph control.
Definition: axcontrol.hxx:630
virtual void convertProperties(PropertyMap &rPropMap, const ControlConverter &rConv) const override
Converts font settings if supported.
Definition: axcontrol.cxx:2533
std::vector< sal_uInt32 > mnIDs
Definition: axcontrol.hxx:861
virtual ApiControlType getControlType() const override
Derived classes return the UNO control type enum value.
Definition: axcontrol.cxx:2504
void importPageAndMultiPageProperties(BinaryInputStream &rInStrm, sal_Int32 nPages)
Definition: axcontrol.cxx:2509
virtual void exportCompObj(BinaryOutputStream &rOutStrm) override
Derived classes export CompObjStream contents.
Definition: axcontrol.cxx:1900
virtual void convertProperties(PropertyMap &rPropMap, const ControlConverter &rConv) const override
Derived classes convert all control properties.
Definition: axcontrol.cxx:1872
virtual ApiControlType getControlType() const override
Derived classes return the UNO control type enum value.
Definition: axcontrol.cxx:1866
virtual void convertFromProperties(PropertySet &rPropSet, const ControlConverter &rConv) override
Derived classes convert from uno control properties to equiv.
Definition: axcontrol.cxx:1884
virtual void convertProperties(PropertyMap &rPropMap, const ControlConverter &rConv) const override
Derived classes convert all control properties.
Definition: axcontrol.cxx:1722
virtual ApiControlType getControlType() const override
Derived classes return the UNO control type enum value.
Definition: axcontrol.cxx:1716
virtual void convertFromProperties(PropertySet &rPropSet, const ControlConverter &rConv) override
Derived classes convert from uno control properties to equiv.
Definition: axcontrol.cxx:1734
virtual void exportCompObj(BinaryOutputStream &rOutStrm) override
Derived classes export CompObjStream contents.
Definition: axcontrol.cxx:1750
virtual void convertProperties(PropertyMap &rPropMap, const ControlConverter &rConv) const override
Converts font settings if supported.
Definition: axcontrol.cxx:2490
virtual ApiControlType getControlType() const override
Derived classes return the UNO control type enum value.
Definition: axcontrol.cxx:2485
sal_Int32 mnMin
Minimum of the value range.
Definition: axcontrol.hxx:785
virtual void importProperty(sal_Int32 nPropId, const OUString &rValue) override
Derived classes set specific OOXML properties at the model structure.
Definition: axcontrol.cxx:2230
sal_uInt32 mnBackColor
Fill color.
Definition: axcontrol.hxx:781
sal_uInt32 mnArrowColor
Button arrow color.
Definition: axcontrol.hxx:780
virtual void exportBinaryModel(BinaryOutputStream &rOutStrm) override
Derived classes export a form control model to the passed output stream.
Definition: axcontrol.cxx:2272
sal_Int32 mnLargeChange
Increment step size (thumb).
Definition: axcontrol.hxx:789
virtual void exportCompObj(BinaryOutputStream &rOutStrm) override
Derived classes export CompObjStream contents.
Definition: axcontrol.cxx:2298
virtual bool importBinaryModel(BinaryInputStream &rInStrm) override
Derived classes import a form control model from the passed input stream.
Definition: axcontrol.cxx:2249
virtual void convertProperties(PropertyMap &rPropMap, const ControlConverter &rConv) const override
Derived classes convert all control properties.
Definition: axcontrol.cxx:2323
sal_Int32 mnSmallChange
Increment step size (buttons).
Definition: axcontrol.hxx:788
sal_Int32 mnPropThumb
Proportional thumb size.
Definition: axcontrol.hxx:784
virtual void convertFromProperties(PropertySet &rPropSet, const ControlConverter &rConv) override
Derived classes convert from uno control properties to equiv.
Definition: axcontrol.cxx:2342
sal_Int32 mnDelay
Repeat delay in milliseconds.
Definition: axcontrol.hxx:790
sal_Int32 mnMax
Maximum of the value range.
Definition: axcontrol.hxx:786
virtual ApiControlType getControlType() const override
Derived classes return the UNO control type enum value.
Definition: axcontrol.cxx:2225
sal_Int32 mnOrientation
Orientation of the buttons.
Definition: axcontrol.hxx:783
sal_Int32 mnPosition
Value of the spin button.
Definition: axcontrol.hxx:787
sal_uInt32 mnFlags
Various flags.
Definition: axcontrol.hxx:782
sal_uInt32 mnBackColor
Fill color.
Definition: axcontrol.hxx:753
sal_Int32 mnDelay
Repeat delay in milliseconds.
Definition: axcontrol.hxx:760
virtual void importProperty(sal_Int32 nPropId, const OUString &rValue) override
Derived classes set specific OOXML properties at the model structure.
Definition: axcontrol.cxx:2086
virtual bool importBinaryModel(BinaryInputStream &rInStrm) override
Derived classes import a form control model from the passed input stream.
Definition: axcontrol.cxx:2103
sal_Int32 mnOrientation
Orientation of the buttons.
Definition: axcontrol.hxx:755
sal_uInt32 mnFlags
Various flags.
Definition: axcontrol.hxx:754
sal_Int32 mnPosition
Value of the spin button.
Definition: axcontrol.hxx:758
virtual void exportCompObj(BinaryOutputStream &rOutStrm) override
Derived classes export CompObjStream contents.
Definition: axcontrol.cxx:2183
sal_Int32 mnSmallChange
Increment step size.
Definition: axcontrol.hxx:759
virtual void exportBinaryModel(BinaryOutputStream &rOutStrm) override
Derived classes export a form control model to the passed output stream.
Definition: axcontrol.cxx:2124
sal_Int32 mnMax
Maximum of the value range.
Definition: axcontrol.hxx:757
sal_Int32 mnMin
Minimum of the value range.
Definition: axcontrol.hxx:756
virtual void convertFromProperties(PropertySet &rPropSet, const ControlConverter &rConv) override
Derived classes convert from uno control properties to equiv.
Definition: axcontrol.cxx:2167
virtual ApiControlType getControlType() const override
Derived classes return the UNO control type enum value.
Definition: axcontrol.cxx:2081
sal_uInt32 mnArrowColor
Button arrow color.
Definition: axcontrol.hxx:752
virtual void convertProperties(PropertyMap &rPropMap, const ControlConverter &rConv) const override
Derived classes convert all control properties.
Definition: axcontrol.cxx:2149
std::vector< OUString > maItems
Definition: axcontrol.hxx:600
std::vector< OUString > maTabNames
Definition: axcontrol.hxx:601
virtual bool importBinaryModel(BinaryInputStream &rInStrm) override
Derived classes import a form control model from the passed input stream.
Definition: axcontrol.cxx:1352
virtual ApiControlType getControlType() const override
Derived classes return the UNO control type enum value.
Definition: axcontrol.cxx:1386
sal_uInt32 mnVariousPropertyBits
Definition: axcontrol.hxx:599
virtual void convertProperties(PropertyMap &rPropMap, const ControlConverter &rConv) const override
Derived classes convert all control properties.
Definition: axcontrol.cxx:1786
virtual ApiControlType getControlType() const override
Derived classes return the UNO control type enum value.
Definition: axcontrol.cxx:1780
virtual void convertFromProperties(PropertySet &rPropSet, const ControlConverter &rConv) override
Derived classes convert from uno control properties to equiv.
Definition: axcontrol.cxx:1805
virtual void exportCompObj(BinaryOutputStream &rOutStrm) override
Derived classes export CompObjStream contents.
Definition: axcontrol.cxx:1837
virtual ApiControlType getControlType() const override
Derived classes return the UNO control type enum value.
Definition: axcontrol.cxx:1590
virtual void convertProperties(PropertyMap &rPropMap, const ControlConverter &rConv) const override
Derived classes convert all control properties.
Definition: axcontrol.cxx:1611
virtual void exportCompObj(BinaryOutputStream &rOutStrm) override
Derived classes export CompObjStream contents.
Definition: axcontrol.cxx:1623
virtual void convertFromProperties(PropertySet &rPropSet, const ControlConverter &rConv) override
Derived classes convert from uno control properties to equiv.
Definition: axcontrol.cxx:1596
virtual void convertProperties(PropertyMap &rPropMap, const ControlConverter &rConv) const override
Converts font settings if supported.
Definition: axcontrol.cxx:2553
virtual ApiControlType getControlType() const override
Derived classes return the UNO control type enum value.
Definition: axcontrol.cxx:2548
Base class for all models of ComCtl form controls.
Definition: axcontrol.hxx:393
StreamDataSequence maMouseIcon
Binary picture stream for mouse icon.
Definition: axcontrol.hxx:419
bool importSizePart(BinaryInputStream &rInStrm)
Definition: axcontrol.cxx:720
virtual bool importBinaryModel(BinaryInputStream &rInStrm) override
Derived classes import a form control model from the passed input stream.
Definition: axcontrol.cxx:667
sal_uInt32 mnFlags
Common flags for ComCtl controls.
Definition: axcontrol.hxx:420
sal_uInt32 mnDataPartId6
Identifier for version 6.0 control data.
Definition: axcontrol.hxx:425
const sal_uInt16 mnVersion
Current version of the ComCtl control model.
Definition: axcontrol.hxx:421
sal_uInt32 getDataPartId() const
Returns the data part identifier according to the model version.
Definition: axcontrol.cxx:696
virtual void convertProperties(PropertyMap &rPropMap, const ControlConverter &rConv) const override
Derived classes convert all control properties.
Definition: axcontrol.cxx:689
bool importComplexPart(BinaryInputStream &rInStrm)
Definition: axcontrol.cxx:744
bool mbCommonPart
True = the COMCTL_COMMONDATA part exists.
Definition: axcontrol.hxx:426
StdFontInfo maFontData
Font formatting.
Definition: axcontrol.hxx:418
sal_uInt32 mnDataPartId5
Identifier for version 5.0 control data.
Definition: axcontrol.hxx:424
bool importCommonPart(BinaryInputStream &rInStrm, sal_uInt32 nPartSize)
Definition: axcontrol.cxx:731
static bool readPartHeader(BinaryInputStream &rInStrm, sal_uInt32 nExpPartId, sal_uInt16 nExpMajor=SAL_MAX_UINT16, sal_uInt16 nExpMinor=SAL_MAX_UINT16)
Definition: axcontrol.cxx:707
bool mbComplexPart
True = the COMCTL_COMPLEXDATA part exists.
Definition: axcontrol.hxx:427
ComCtlModelBase(sal_uInt32 nDataPartId5, sal_uInt32 nDataPartId6, sal_uInt16 nVersion)
Definition: axcontrol.cxx:655
virtual void importControlData(BinaryInputStream &rInStrm)=0
virtual void importControlData(BinaryInputStream &rInStrm) override
Definition: axcontrol.cxx:816
virtual ApiControlType getControlType() const override
Derived classes return the UNO control type enum value.
Definition: axcontrol.cxx:800
float mfMax
Maximum of the value range.
Definition: axcontrol.hxx:465
sal_uInt16 mnVertical
0 = horizontal, 1 = vertical.
Definition: axcontrol.hxx:466
ComCtlProgressBarModel(sal_uInt16 nVersion)
Definition: axcontrol.cxx:791
float mfMin
Minimum of the value range.
Definition: axcontrol.hxx:464
sal_uInt16 mnSmooth
0 = progress blocks, 1 = pixel resolution.
Definition: axcontrol.hxx:467
virtual void convertProperties(PropertyMap &rPropMap, const ControlConverter &rConv) const override
Derived classes convert all control properties.
Definition: axcontrol.cxx:805
virtual void convertProperties(PropertyMap &rPropMap, const ControlConverter &rConv) const override
Derived classes convert all control properties.
Definition: axcontrol.cxx:773
sal_Int32 mnLargeChange
Increment step size (thumb).
Definition: axcontrol.hxx:444
sal_uInt32 mnScrollBarFlags
Special flags for scroll bar model.
Definition: axcontrol.hxx:443
sal_Int32 mnSmallChange
Increment step size (buttons).
Definition: axcontrol.hxx:445
ComCtlScrollBarModel(sal_uInt16 nVersion)
Definition: axcontrol.cxx:757
sal_Int32 mnMax
Maximum of the value range.
Definition: axcontrol.hxx:447
sal_Int32 mnMin
Minimum of the value range.
Definition: axcontrol.hxx:446
virtual ApiControlType getControlType() const override
Derived classes return the UNO control type enum value.
Definition: axcontrol.cxx:768
virtual void importControlData(BinaryInputStream &rInStrm) override
Definition: axcontrol.cxx:781
sal_Int32 mnPosition
Value of the spin button.
Definition: axcontrol.hxx:448
A base class with useful helper functions for something that is able to convert ActiveX and ComCtl fo...
Definition: axcontrol.hxx:194
static void convertToMSColor(PropertySet const &rPropSet, sal_Int32 nPropId, sal_uInt32 &nOleColor, sal_uInt32 nDefault=0)
Definition: axcontrol.cxx:261
void convertPicture(PropertyMap &rPropMap, const StreamDataSequence &rPicData) const
Converts the passed StdPic picture stream to UNO properties.
Definition: axcontrol.cxx:269
static void convertToAxBorder(PropertySet const &rPropSet, sal_uInt32 &nBorderColor, sal_Int32 &nBorderStyle, sal_Int32 &nSpecialEffect)
Definition: axcontrol.cxx:421
void convertScrollabilitySettings(PropertyMap &rPropMap, const AxPairData &rScrollPos, const AxPairData &rScrollArea, sal_Int32 nScrollBars) const
Converts scrollability settings to UNO properties.
Definition: axcontrol.cxx:304
static void convertToAxState(PropertySet const &rPropSet, OUString &rValue, sal_Int32 &nMultiSelect, ApiDefaultStateMode eDefStateMode)
Definition: axcontrol.cxx:528
void bindToSources(const css::uno::Reference< css::awt::XControlModel > &rxCtrlModel, const OUString &rCtrlSource, const OUString &rRowSource, sal_Int32 nRefSheet=0) const
Binds the passed control model to the passed data sources.
Definition: axcontrol.cxx:329
void convertPosition(PropertyMap &rPropMap, const AxPairData &rPos) const
Converts the passed position in 1/100 mm to UNO properties.
Definition: axcontrol.cxx:240
static void convertToMSOrientation(PropertySet const &rPropMap, bool &bHorizontal)
Definition: axcontrol.cxx:285
void convertSize(PropertyMap &rPropMap, const AxPairData &rSize) const
Converts the passed size in 1/100 mm to UNO properties.
Definition: axcontrol.cxx:248
css::uno::Reference< css::frame::XModel > mxDocModel
Definition: axcontrol.hxx:337
void convertAxPicture(PropertyMap &rPropMap, const StreamDataSequence &rPicData, sal_uInt32 nPicPos) const
Converts the passed picture stream and Forms 2.0 position to UNO properties.
Definition: axcontrol.cxx:458
static void convertOrientation(PropertyMap &rPropMap, bool bHorizontal)
Converts the control orientation to UNO properties.
Definition: axcontrol.cxx:279
static void convertToAxOrientation(PropertySet const &rPropSet, sal_Int32 &nOrientation)
Definition: axcontrol.cxx:569
ControlConverter(const css::uno::Reference< css::frame::XModel > &rxDocModel, const GraphicHelper &rGraphicHelper, bool bDefaultColorBgr=true)
Definition: axcontrol.cxx:225
void convertColor(PropertyMap &rPropMap, sal_Int32 nPropId, sal_uInt32 nOleColor) const
Converts the passed encoded OLE color to UNO properties.
Definition: axcontrol.cxx:256
static void convertAxVisualEffect(PropertyMap &rPropMap, sal_Int32 nSpecialEffect)
Converts the Forms 2.0 special effect to UNO properties.
Definition: axcontrol.cxx:443
static void convertAxState(PropertyMap &rPropMap, std::u16string_view rValue, sal_Int32 nMultiSelect, ApiDefaultStateMode eDefStateMode, bool bAwtModel)
Converts the Forms 2.0 value for checked/unchecked/dontknow to UNO properties.
Definition: axcontrol.cxx:503
static void convertAxOrientation(PropertyMap &rPropMap, const AxPairData &rSize, sal_Int32 nOrientation)
Converts the Forms 2.0 control orientation to UNO properties.
Definition: axcontrol.cxx:555
void convertAxBackground(PropertyMap &rPropMap, sal_uInt32 nBackColor, sal_uInt32 nFlags, ApiTransparencyMode eTranspMode) const
Converts the Forms 2.0 background formatting to UNO properties.
Definition: axcontrol.cxx:394
PropertySet maAddressConverter
Definition: axcontrol.hxx:339
void convertAxBorder(PropertyMap &rPropMap, sal_uInt32 nBorderColor, sal_Int32 nBorderStyle, sal_Int32 nSpecialEffect) const
Converts the Forms 2.0 border formatting to UNO properties.
Definition: axcontrol.cxx:412
static void convertToAxVisualEffect(PropertySet const &rPropSet, sal_Int32 &nSpecialEffect)
Definition: axcontrol.cxx:449
const GraphicHelper & mrGraphicHelper
Definition: axcontrol.hxx:338
static void convertScrollBar(PropertyMap &rPropMap, sal_Int32 nMin, sal_Int32 nMax, sal_Int32 nPosition, sal_Int32 nSmallChange, sal_Int32 nLargeChange, bool bAwtModel)
Converts common scrollbar settings to UNO properties.
Definition: axcontrol.cxx:318
static void convertVerticalAlign(PropertyMap &rPropMap, sal_Int32 nVerticalAlign)
Converts the vertical alignment to UNO properties.
Definition: axcontrol.cxx:292
Base class for all models of form controls.
Definition: axcontrol.hxx:347
void setAwtModelMode()
Sets this control model to AWT model mode.
Definition: axcontrol.hxx:353
bool mbAwtModel
True = AWT control model, false = form component.
Definition: axcontrol.hxx:385
void convertSize(PropertyMap &rPropMap, const ControlConverter &rConv) const
Converts the control size to UNO properties.
Definition: axcontrol.cxx:650
AxPairData maSize
Size of the control in 1/100 mm.
Definition: axcontrol.hxx:382
virtual void importProperty(sal_Int32 nPropId, const OUString &rValue)
Derived classes set specific OOXML properties at the model structure.
Definition: axcontrol.cxx:634
virtual void convertProperties(PropertyMap &rPropMap, const ControlConverter &rConv) const
Derived classes convert all control properties.
Definition: axcontrol.cxx:642
virtual void convertFromProperties(PropertySet &rPropSet, const ControlConverter &rConv)
Derived classes convert from uno control properties to equiv.
Definition: axcontrol.cxx:646
OUString getServiceName() const
Returns the UNO service name used to construct the AWT control model, or the control form component.
Definition: axcontrol.cxx:591
virtual void importPictureData(sal_Int32 nPropId, BinaryInputStream &rInStrm)
Derived classes set binary data (picture, mouse icon) at the model structure.
Definition: axcontrol.cxx:638
virtual ApiControlType getControlType() const =0
Derived classes return the UNO control type enum value.
A form control embedded in a document draw page.
Definition: axcontrol.hxx:898
ControlModelRef mxModel
Control model containing the properties.
Definition: axcontrol.hxx:934
ControlModelBase * createModelFromGuid(std::u16string_view rClassId)
Creates and returns the internal control model according to the passed MS class identifier.
Definition: axcontrol.cxx:2663
OUString getServiceName() const
Returns the UNO service name needed to construct the control model.
Definition: axcontrol.cxx:2685
EmbeddedControl(OUString aName)
Definition: axcontrol.cxx:2658
OUString maName
Name of the control.
Definition: axcontrol.hxx:935
void convertFromProperties(const css::uno::Reference< css::awt::XControlModel > &rxCtrlModel, const ControlConverter &rConv)
Definition: axcontrol.cxx:2712
bool hasModel() const
Returns true, if the internal control model exists.
Definition: axcontrol.hxx:915
bool convertProperties(const css::uno::Reference< css::awt::XControlModel > &rxCtrlModel, const ControlConverter &rConv) const
Converts all control properties and inserts them into the passed model.
Definition: axcontrol.cxx:2690
EmbeddedForm(const css::uno::Reference< css::frame::XModel > &rxDocModel, const css::uno::Reference< css::drawing::XDrawPage > &rxDrawPage, const GraphicHelper &rGraphicHelper)
Definition: axcontrol.cxx:2722
css::uno::Reference< css::awt::XControlModel > convertAndInsert(const EmbeddedControl &rControl, sal_Int32 &rnCtrlIndex)
Converts the passed control and inserts the control model into the form.
Definition: axcontrol.cxx:2731
css::uno::Reference< css::lang::XMultiServiceFactory > mxModelFactory
Definition: axcontrol.hxx:983
css::uno::Reference< css::container::XIndexContainer > const & createXForm()
Creates the form that will hold the form controls.
Definition: axcontrol.cxx:2756
ControlConverter maControlConv
Definition: axcontrol.hxx:982
css::uno::Reference< css::container::XIndexContainer > mxFormIC
Definition: axcontrol.hxx:985
css::uno::Reference< css::form::XFormsSupplier > mxFormsSupp
Definition: axcontrol.hxx:984
css::uno::Sequence< sal_Int16 > msIndices
Definition: axcontrol.hxx:880
css::uno::Sequence< OUString > msListData
Definition: axcontrol.hxx:879
virtual bool importBinaryModel(BinaryInputStream &rInStrm) override
Derived classes import a form control model from the passed input stream.
Definition: axcontrol.cxx:2567
virtual void convertProperties(PropertyMap &rPropMap, const ControlConverter &rConv) const override
Derived classes convert all control properties.
Definition: axcontrol.cxx:2632
virtual bool importBinaryModel(BinaryInputStream &rInStrm) override
Derived classes import a form control model from the passed input stream.
Definition: axcontrol.cxx:2645
tools::Long GetFontHeight() const
int nCount
OUString maName
Definition: dffdumper.cxx:161
#define TOOLS_WARN_EXCEPTION(area, stream)
float u
sal_Int32 nState
sal_Int16 nVersion
FuncFlags mnFlags
sal_Int32 nIndex
OUString aName
#define SAL_WARN(area, stream)
tools::Long const nBorder
@ Exception
index
bool equalsIgnoreAsciiCase(std::u16string_view s1, std::u16string_view s2)
sal_Int32 toInt32(std::u16string_view str, sal_Int16 radix=10)
std::basic_string_view< charT, traits > getToken(std::basic_string_view< charT, traits > sv, charT delimiter, std::size_t &position)
OOX_DLLPUBLIC::Color decodeOleColor(const GraphicHelper &rGraphicHelper, sal_uInt32 nOleColor, bool bDefaultColorBgr)
Returns the UNO RGB color from the passed encoded OLE color.
Definition: olehelper.cxx:216
OOX_DLLPUBLIC bool importStdPic(StreamDataSequence &orGraphicData, BinaryInputStream &rInStrm)
Imports an OLE StdPic picture from the current position of the passed binary stream.
Definition: olehelper.cxx:303
OOX_DLLPUBLIC bool importStdFont(StdFontInfo &orFontInfo, BinaryInputStream &rInStrm, bool bWithGuid)
Imports an OLE StdFont font structure from the current position of the passed binary stream.
Definition: olehelper.cxx:280
OOX_DLLPUBLIC sal_uInt32 encodeOleColor(sal_Int32 nRgbColor)
Returns the OLE color from the passed UNO RGB color.
Definition: olehelper.cxx:248
const sal_Int32 AX_BORDERSTYLE_SINGLE
Definition: axcontrol.hxx:111
const sal_uInt32 AX_SYSCOLOR_WINDOWFRAME
Definition: axcontrol.hxx:83
const sal_uInt32 AX_SYSCOLOR_WINDOWTEXT
Definition: axcontrol.hxx:84
const sal_Int32 AX_DISPLAYSTYLE_TOGGLE
Definition: axcontrol.hxx:134
const sal_Int32 AX_DISPLAYSTYLE_TEXT
Definition: axcontrol.hxx:129
const sal_Int32 AX_SELECTION_SINGLE
Definition: axcontrol.hxx:137
const sal_Int32 AX_DISPLAYSTYLE_LISTBOX
Definition: axcontrol.hxx:130
const sal_Int32 AX_DISPLAYSTYLE_DROPDOWN
Definition: axcontrol.hxx:135
const sal_Int32 AX_SPECIALEFFECT_SUNKEN
Definition: axcontrol.hxx:115
const sal_uInt32 AX_FLAGS_ENABLED
Definition: axcontrol.hxx:88
const sal_uInt32 AX_FLAGS_OPAQUE
Definition: axcontrol.hxx:90
const sal_Int32 AX_PICSIZE_CLIP
Definition: axcontrol.hxx:119
ApiDefaultStateMode
Specifies how a form control supports the DefaultState property.
Definition: axcontrol.hxx:183
@ API_DEFAULTSTATE_BOOLEAN
Control does not support tri-state, state is given as boolean.
Definition: axcontrol.hxx:184
@ API_DEFAULTSTATE_TRISTATE
Control supports tri-state, state is given as short.
Definition: axcontrol.hxx:186
@ API_DEFAULTSTATE_SHORT
Control does not support tri-state, state is given as short.
Definition: axcontrol.hxx:185
const sal_Int32 AX_BORDERSTYLE_NONE
Definition: axcontrol.hxx:110
const sal_uInt32 AX_SYSCOLOR_WINDOWBACK
Definition: axcontrol.hxx:82
const sal_uInt32 AX_SYSCOLOR_BUTTONFACE
Definition: axcontrol.hxx:85
const sal_Int32 AX_SHOWDROPBUTTON_NEVER
Definition: axcontrol.hxx:141
const sal_uInt32 AX_FLAGS_MULTILINE
Definition: axcontrol.hxx:108
const sal_Int32 AX_SCROLLBAR_HORIZONTAL
Definition: axcontrol.hxx:146
::std::pair< sal_Int32, sal_Int32 > AxPairData
A pair of integer values as a property.
ApiControlType
Enumerates all UNO API control types supported by these filters.
Definition: axcontrol.hxx:152
@ API_CONTROL_PAGE
Definition: axcontrol.hxx:168
@ API_CONTROL_TABSTRIP
Definition: axcontrol.hxx:164
@ API_CONTROL_RADIOBUTTON
Definition: axcontrol.hxx:157
@ API_CONTROL_COMBOBOX
Definition: axcontrol.hxx:161
@ API_CONTROL_FRAME
Definition: axcontrol.hxx:167
@ API_CONTROL_SCROLLBAR
Definition: axcontrol.hxx:163
@ API_CONTROL_LISTBOX
Definition: axcontrol.hxx:160
@ API_CONTROL_NUMERIC
Definition: axcontrol.hxx:159
@ API_CONTROL_BUTTON
Definition: axcontrol.hxx:153
@ API_CONTROL_IMAGE
Definition: axcontrol.hxx:155
@ API_CONTROL_CHECKBOX
Definition: axcontrol.hxx:156
@ API_CONTROL_MULTIPAGE
Definition: axcontrol.hxx:169
@ API_CONTROL_DIALOG
Definition: axcontrol.hxx:170
@ API_CONTROL_GROUPBOX
Definition: axcontrol.hxx:166
@ API_CONTROL_FIXEDTEXT
Definition: axcontrol.hxx:154
@ API_CONTROL_SPINBUTTON
Definition: axcontrol.hxx:162
@ API_CONTROL_PROGRESSBAR
Definition: axcontrol.hxx:165
@ API_CONTROL_EDIT
Definition: axcontrol.hxx:158
const sal_Int32 AX_SCROLLBAR_VERTICAL
Definition: axcontrol.hxx:147
const sal_Int32 AX_SPECIALEFFECT_RAISED
Definition: axcontrol.hxx:114
const sal_Int32 AX_PICSIZE_STRETCH
Definition: axcontrol.hxx:120
const sal_Int32 AX_DISPLAYSTYLE_COMBOBOX
Definition: axcontrol.hxx:131
const sal_Int32 AX_SELECTION_MULTI
Definition: axcontrol.hxx:138
const sal_uInt16 COMCTL_VERSION_60
Definition: axcontrol.hxx:61
const sal_Int32 AX_SCROLLBAR_NONE
Definition: axcontrol.hxx:145
const sal_uInt16 COMCTL_VERSION_50
Definition: axcontrol.hxx:60
const sal_uInt32 AX_FLAGS_HIDESELECTION
Definition: axcontrol.hxx:106
const sal_Int32 AX_SHOWDROPBUTTON_ALWAYS
Definition: axcontrol.hxx:143
const sal_Int32 AX_SPECIALEFFECT_FLAT
Definition: axcontrol.hxx:113
ApiTransparencyMode
Specifies how a form control supports transparent background.
Definition: axcontrol.hxx:176
@ Void
Transparency is enabled by missing fill color.
@ NotSupported
Control does not support transparency.
const sal_Int32 AX_DISPLAYSTYLE_OPTBUTTON
Definition: axcontrol.hxx:133
const sal_uInt32 AX_FLAGS_LOCKED
Definition: axcontrol.hxx:89
const sal_Int32 AX_SHOWDROPBUTTON_FOCUS
Definition: axcontrol.hxx:142
const sal_Int32 AX_SELECTION_EXTENDED
Definition: axcontrol.hxx:139
::std::vector< OUString > AxClassTable
Definition: axcontrol.hxx:794
const sal_uInt32 AX_FLAGS_WORDWRAP
Definition: axcontrol.hxx:101
const sal_Int32 AX_PICALIGN_CENTER
Definition: axcontrol.hxx:125
const sal_Int32 AX_PICSIZE_ZOOM
Definition: axcontrol.hxx:121
const sal_uInt32 AX_SYSCOLOR_BUTTONTEXT
Definition: axcontrol.hxx:86
const sal_Int32 AX_DISPLAYSTYLE_CHECKBOX
Definition: axcontrol.hxx:132
void setFlag(Type &ornBitField, Type nMask, bool bSet=true)
Sets or clears (according to bSet) all set bits of nMask in ornBitField.
Definition: helper.hxx:167
css::uno::Sequence< sal_Int8 > StreamDataSequence
bool getFlag(Type nBitField, Type nMask)
Returns true, if at least one of the bits set in nMask is set in nBitField.
Definition: helper.hxx:137
AxFontFlags mnFontEffects
Font effect flags.
Definition: axfontdata.hxx:56
bool importBinaryModel(BinaryInputStream &rInStrm)
Reads the font data settings from the passed input stream.
Definition: axfontdata.cxx:49
bool mbDblUnderline
True = double underline style (legacy VML drawing controls only).
Definition: axfontdata.hxx:60
sal_Int32 mnFontCharSet
Windows character set of the font.
Definition: axfontdata.hxx:58
sal_Int16 getHeightPoints() const
Converts the internal representation of the font height to points.
Definition: axfontdata.cxx:36
sal_Int32 mnFontHeight
Height of the font (not really twips, see code).
Definition: axfontdata.hxx:57
void exportBinaryModel(BinaryOutputStream &rOutStrm)
Definition: axfontdata.cxx:68
AxHorizontalAlign mnHorAlign
Horizontal text alignment.
Definition: axfontdata.hxx:59
OUString maFontName
Name of the used font.
Definition: axfontdata.hxx:55
void setHeightPoints(sal_Int16 nPoints)
Converts the passed font height from points to the internal representation.
Definition: axfontdata.cxx:44
#define SAL_MAX_UINT8
unsigned char sal_uInt8
#define SAL_MAX_UINT16
#define SAL_MAX_INT32
#define SAL_MAX_INT16
#define SAL_MAX_UINT32
constexpr OUStringLiteral PROP_TextColor
constexpr OUStringLiteral PROP_BorderColor
constexpr OUStringLiteral PROP_FontStrikeout
constexpr OUStringLiteral PROP_FontUnderline
constexpr OUStringLiteral PROP_Height
constexpr OUStringLiteral PROP_FontHeight
constexpr OUStringLiteral PROP_FontWeight
constexpr OUStringLiteral PROP_FontSlant
constexpr OUStringLiteral PROP_FontCharset
constexpr OUStringLiteral PROP_SymbolColor
constexpr OUStringLiteral PROP_FontName
constexpr OUStringLiteral PROP_Width