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