LCOV - code coverage report
Current view: top level - svx/source/engine3d - float3d.cxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 2 1890 0.1 %
Date: 2014-04-11 Functions: 4 47 8.5 %
Legend: Lines: hit not hit

          Line data    Source code
       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 <sfx2/dispatch.hxx>
      21             : #include <sfx2/module.hxx>
      22             : #include <sfx2/viewfrm.hxx>
      23             : #include <svl/eitem.hxx>
      24             : #include <svtools/colrdlg.hxx>
      25             : #include <vcl/msgbox.hxx>
      26             : #include <sfx2/viewsh.hxx>
      27             : #include <tools/shl.hxx>
      28             : #include <svx/xflclit.hxx>
      29             : #include <svx/svdmodel.hxx>
      30             : #include <svx/globl3d.hxx>
      31             : #include <svx/view3d.hxx>
      32             : #include <svx/obj3d.hxx>
      33             : #include <svx/sphere3d.hxx>
      34             : #include <svx/scene3d.hxx>
      35             : #include <svx/camera3d.hxx>
      36             : #include <svx/fmmodel.hxx>
      37             : #include <svx/fmpage.hxx>
      38             : #include <svx/polysc3d.hxx>
      39             : #include <editeng/eeitem.hxx>
      40             : #include <svl/style.hxx>
      41             : #include <svx/dlgutil.hxx>
      42             : 
      43             : #include <svx/dialmgr.hxx>
      44             : #include <svx/viewpt3d.hxx>
      45             : 
      46             : #include <svx/svxids.hrc>
      47             : #include <svx/dialogs.hrc>
      48             : 
      49             : #include <editeng/colritem.hxx>
      50             : #include <svx/e3ditem.hxx>
      51             : #include <svx/gallery.hxx>
      52             : #include <svl/whiter.hxx>
      53             : 
      54             : #include <svx/float3d.hxx>
      55             : #include "float3d.hrc"
      56             : 
      57         400 : SFX_IMPL_DOCKINGWINDOW_WITHID( Svx3DChildWindow, SID_3D_WIN )
      58             : 
      59             : struct Svx3DWinImpl
      60             : {
      61             :     SfxItemPool*        pPool;
      62             : };
      63             : 
      64             : namespace {
      65             :     /** Get the dispatcher from the current view frame, or, if that is not
      66             :         available, from the given bindings.
      67             :         @param pBindings
      68             :             May be NULL.
      69             :         @returns NULL when both the current view frame is NULL and the given
      70             :             bindings are NULL.
      71             :     */
      72           0 :     SfxDispatcher* LocalGetDispatcher (const SfxBindings* pBindings)
      73             :     {
      74           0 :         SfxDispatcher* pDispatcher = NULL;
      75             : 
      76           0 :         if (SfxViewFrame::Current() != NULL)
      77           0 :             pDispatcher = SfxViewFrame::Current()->GetDispatcher();
      78           0 :         else if (pBindings != NULL)
      79           0 :             pDispatcher = pBindings->GetDispatcher();
      80             : 
      81           0 :         return pDispatcher;
      82             :     }
      83             : }
      84             : 
      85             : 
      86             : /*************************************************************************
      87             : |*  Svx3DWin - FloatingWindow
      88             : \************************************************************************/
      89           0 : Svx3DWin::Svx3DWin( SfxBindings* pInBindings,
      90             :                 SfxChildWindow *pCW, Window* pParent ) :
      91             :         SfxDockingWindow    ( pInBindings, pCW, pParent,
      92           0 :                                     SVX_RES( RID_SVXFLOAT_3D ) ),
      93           0 :         aBtnGeo             ( this, SVX_RES( BTN_GEO ) ),
      94           0 :         aBtnRepresentation  ( this, SVX_RES( BTN_REPRESENTATION ) ),
      95           0 :         aBtnLight           ( this, SVX_RES( BTN_LIGHT ) ),
      96           0 :         aBtnTexture         ( this, SVX_RES( BTN_TEXTURE ) ),
      97           0 :         aBtnMaterial        ( this, SVX_RES( BTN_MATERIAL ) ),
      98           0 :         aBtnUpdate          ( this, SVX_RES( BTN_UPDATE ) ),
      99           0 :         aBtnAssign          ( this, SVX_RES( BTN_ASSIGN ) ),
     100           0 :         aFLGeometrie       ( this, SVX_RES( FL_GEOMETRIE ) ),
     101             : 
     102             :         // Geometry
     103           0 :         aFtPercentDiagonal  ( this, SVX_RES( FT_PERCENT_DIAGONAL ) ),
     104           0 :         aMtrPercentDiagonal ( this, SVX_RES( MTR_PERCENT_DIAGONAL ) ),
     105           0 :         aFtBackscale        ( this, SVX_RES( FT_BACKSCALE ) ),
     106           0 :         aMtrBackscale       ( this, SVX_RES( MTR_BACKSCALE ) ),
     107           0 :         aFtEndAngle         ( this, SVX_RES( FT_END_ANGLE ) ),
     108           0 :         aMtrEndAngle        ( this, SVX_RES( MTR_END_ANGLE ) ),
     109           0 :         aFtDepth            ( this, SVX_RES( FT_DEPTH ) ),
     110           0 :         aMtrDepth           ( this, SVX_RES( MTR_DEPTH ) ),
     111           0 :         aFLSegments        ( this, SVX_RES( FL_SEGMENTS ) ),
     112             : 
     113           0 :         aFtHorizontal       ( this, SVX_RES( FT_HORIZONTAL ) ),
     114           0 :         aNumHorizontal      ( this, SVX_RES( NUM_HORIZONTAL ) ),
     115           0 :         aFtVertical         ( this, SVX_RES( FT_VERTICAL ) ),
     116           0 :         aNumVertical        ( this, SVX_RES( NUM_VERTICAL ) ),
     117             : 
     118           0 :         aFLNormals         ( this, SVX_RES( FL_NORMALS ) ),
     119           0 :         aBtnNormalsObj      ( this, SVX_RES( BTN_NORMALS_OBJ ) ),
     120           0 :         aBtnNormalsFlat     ( this, SVX_RES( BTN_NORMALS_FLAT ) ),
     121           0 :         aBtnNormalsSphere   ( this, SVX_RES( BTN_NORMALS_SPHERE ) ),
     122           0 :         aBtnNormalsInvert   ( this, SVX_RES( BTN_NORMALS_INVERT ) ),
     123           0 :         aBtnTwoSidedLighting( this, SVX_RES( BTN_TWO_SIDED_LIGHTING ) ),
     124             : 
     125           0 :         aBtnDoubleSided     ( this, SVX_RES( BTN_DOUBLE_SIDED ) ),
     126             : 
     127             :         // Representation
     128           0 :         aFLRepresentation  ( this, SVX_RES( FL_REPRESENTATION ) ),
     129           0 :         aFtShademode        ( this, SVX_RES( FT_SHADEMODE ) ),
     130           0 :         aLbShademode        ( this, SVX_RES( LB_SHADEMODE ) ),
     131           0 :         aFLShadow          ( this, SVX_RES( FL_SHADOW ) ),
     132           0 :         aBtnShadow3d        ( this, SVX_RES( BTN_SHADOW_3D ) ),
     133           0 :         aFtSlant            ( this, SVX_RES( FT_SLANT ) ),
     134           0 :         aMtrSlant           ( this, SVX_RES( MTR_SLANT ) ),
     135           0 :         aFtDistance         ( this, SVX_RES( FT_DISTANCE ) ),
     136           0 :         aMtrDistance        ( this, SVX_RES( MTR_DISTANCE ) ),
     137           0 :         aFtFocalLeng        ( this, SVX_RES( FT_FOCAL_LENGTH ) ),
     138           0 :         aMtrFocalLength     ( this, SVX_RES( MTR_FOCAL_LENGTH ) ),
     139           0 :         aFLCamera          ( this, SVX_RES( FL_CAMERA ) ),
     140           0 :         aFLLight           ( this, SVX_RES( FL_LIGHT ) ),
     141             : 
     142             :         // Lighting
     143           0 :         aBtnLight1          ( this, SVX_RES( BTN_LIGHT_1 ) ),
     144           0 :         aBtnLight2          ( this, SVX_RES( BTN_LIGHT_2 ) ),
     145           0 :         aBtnLight3          ( this, SVX_RES( BTN_LIGHT_3 ) ),
     146           0 :         aBtnLight4          ( this, SVX_RES( BTN_LIGHT_4 ) ),
     147           0 :         aBtnLight5          ( this, SVX_RES( BTN_LIGHT_5 ) ),
     148           0 :         aBtnLight6          ( this, SVX_RES( BTN_LIGHT_6 ) ),
     149           0 :         aBtnLight7          ( this, SVX_RES( BTN_LIGHT_7 ) ),
     150           0 :         aBtnLight8          ( this, SVX_RES( BTN_LIGHT_8 ) ),
     151           0 :         aFTLightsource     ( this, SVX_RES( FT_LIGHTSOURCE ) ),
     152           0 :         aLbLight1           ( this, SVX_RES( LB_LIGHT_1 ) ),
     153           0 :         aLbLight2           ( this, SVX_RES( LB_LIGHT_2 ) ),
     154           0 :         aLbLight3           ( this, SVX_RES( LB_LIGHT_3 ) ),
     155           0 :         aLbLight4           ( this, SVX_RES( LB_LIGHT_4 ) ),
     156           0 :         aLbLight5           ( this, SVX_RES( LB_LIGHT_5 ) ),
     157           0 :         aLbLight6           ( this, SVX_RES( LB_LIGHT_6 ) ),
     158           0 :         aLbLight7           ( this, SVX_RES( LB_LIGHT_7 ) ),
     159           0 :         aLbLight8           ( this, SVX_RES( LB_LIGHT_8 ) ),
     160             : 
     161           0 :         aBtnLightColor      ( this, SVX_RES( BTN_LIGHT_COLOR ) ),
     162             : 
     163             :         // Keyboard shortcuts activate the next control, so the
     164             :         // order needed to be changed here
     165           0 :         aFTAmbientlight     ( this, SVX_RES( FT_AMBIENTLIGHT ) ),   // Text label
     166           0 :         aLbAmbientlight     ( this, SVX_RES( LB_AMBIENTLIGHT ) ),   // ListBox
     167           0 :         aBtnAmbientColor    ( this, SVX_RES( BTN_AMBIENT_COLOR ) ), // color button
     168           0 :         aFLTexture         ( this, SVX_RES( FL_TEXTURE ) ),
     169             : 
     170             :         // Textures
     171           0 :         aFtTexKind          ( this, SVX_RES( FT_TEX_KIND ) ),
     172           0 :         aBtnTexLuminance    ( this, SVX_RES( BTN_TEX_LUMINANCE ) ),
     173           0 :         aBtnTexColor        ( this, SVX_RES( BTN_TEX_COLOR ) ),
     174           0 :         aFtTexMode          ( this, SVX_RES( FT_TEX_MODE ) ),
     175           0 :         aBtnTexReplace      ( this, SVX_RES( BTN_TEX_REPLACE ) ),
     176           0 :         aBtnTexModulate     ( this, SVX_RES( BTN_TEX_MODULATE ) ),
     177           0 :         aBtnTexBlend        ( this, SVX_RES( BTN_TEX_BLEND ) ),
     178           0 :         aFtTexProjectionX   ( this, SVX_RES( FT_TEX_PROJECTION_X ) ),
     179           0 :         aBtnTexObjectX      ( this, SVX_RES( BTN_TEX_OBJECT_X ) ),
     180           0 :         aBtnTexParallelX    ( this, SVX_RES( BTN_TEX_PARALLEL_X ) ),
     181           0 :         aBtnTexCircleX      ( this, SVX_RES( BTN_TEX_CIRCLE_X ) ),
     182           0 :         aFtTexProjectionY   ( this, SVX_RES( FT_TEX_PROJECTION_Y ) ),
     183           0 :         aBtnTexObjectY      ( this, SVX_RES( BTN_TEX_OBJECT_Y ) ),
     184           0 :         aBtnTexParallelY    ( this, SVX_RES( BTN_TEX_PARALLEL_Y ) ),
     185           0 :         aBtnTexCircleY      ( this, SVX_RES( BTN_TEX_CIRCLE_Y ) ),
     186           0 :         aFtTexFilter        ( this, SVX_RES( FT_TEX_FILTER ) ),
     187           0 :         aBtnTexFilter       ( this, SVX_RES( BTN_TEX_FILTER ) ),
     188           0 :         aFLMaterial        ( this, SVX_RES( FL_MATERIAL ) ),
     189             : 
     190             :         // Material
     191           0 :         aFtMatFavorites     ( this, SVX_RES( FT_MAT_FAVORITES ) ),
     192           0 :         aLbMatFavorites     ( this, SVX_RES( LB_MAT_FAVORITES ) ),
     193           0 :         aFtMatColor         ( this, SVX_RES( FT_MAT_COLOR ) ),
     194           0 :         aLbMatColor         ( this, SVX_RES( LB_MAT_COLOR ) ),
     195           0 :         aBtnMatColor        ( this, SVX_RES( BTN_MAT_COLOR ) ),
     196           0 :         aFtMatEmission      ( this, SVX_RES( FT_MAT_EMISSION ) ),
     197           0 :         aLbMatEmission      ( this, SVX_RES( LB_MAT_EMISSION ) ),
     198           0 :         aBtnEmissionColor   ( this, SVX_RES( BTN_EMISSION_COLOR ) ),
     199           0 :         aFLMatSpecular     ( this, SVX_RES( FL_MAT_SPECULAR ) ),
     200           0 :         aFtMatSpecular      ( this, SVX_RES( FT_MAT_SPECULAR ) ),
     201           0 :         aLbMatSpecular      ( this, SVX_RES( LB_MAT_SPECULAR ) ),
     202           0 :         aBtnSpecularColor   ( this, SVX_RES( BTN_SPECULAR_COLOR ) ),
     203           0 :         aFtMatSpecularIntensity( this, SVX_RES( FT_MAT_SPECULAR_INTENSITY ) ),
     204           0 :         aMtrMatSpecularIntensity( this, SVX_RES( MTR_MAT_SPECULAR_INTENSITY ) ),
     205           0 :         aCtlPreview         ( this, SVX_RES( CTL_PREVIEW ) ),
     206           0 :         aCtlLightPreview    ( this, SVX_RES( CTL_LIGHT_PREVIEW ) ),
     207             : 
     208             :         // Lower Range
     209           0 :         aBtnConvertTo3D     ( this, SVX_RES( BTN_CHANGE_TO_3D ) ),
     210           0 :         aBtnLatheObject     ( this, SVX_RES( BTN_LATHE_OBJ ) ),
     211           0 :         aBtnPerspective     ( this, SVX_RES( BTN_PERSPECTIVE ) ),
     212             : 
     213           0 :         aImgLightOn         ( SVX_RES( RID_SVXIMAGE_LIGHT_ON ) ),
     214           0 :         aImgLightOff        ( SVX_RES( RID_SVXIMAGE_LIGHT_OFF ) ),
     215             : 
     216             :         bUpdate             ( false ),
     217             :         eViewType           ( VIEWTYPE_GEO ),
     218             : 
     219             :         pModel              ( NULL ),
     220             :         pVDev               ( NULL ),
     221             :         p3DView             ( NULL ),
     222             : 
     223             :         pBindings           ( pInBindings ),
     224             :         pControllerItem(0L),
     225             :         pConvertTo3DItem(0L),
     226             :         pConvertTo3DLatheItem(0L),
     227             :         mpImpl              ( new Svx3DWinImpl() ),
     228             :         mpRemember2DAttributes(NULL),
     229           0 :         bOnly3DChanged      ( false )
     230             : {
     231           0 :     OUString accname(SVX_RESSTR(RID_SVXFLOAT3D_COLOR_LIGHT_PRE));
     232           0 :     aCtlLightPreview.SetAccessibleName(accname);
     233           0 :     aCtlPreview.SetAccessibleName(accname);
     234           0 :     aLbAmbientlight.SetAccessibleName(aFTAmbientlight.GetDisplayText());
     235             : 
     236           0 :     mpImpl->pPool = NULL;
     237           0 :     FreeResource();
     238             : 
     239             :     // Set Metric
     240           0 :     eFUnit = pInBindings->GetDispatcher()->GetModule()->GetFieldUnit();
     241             : 
     242           0 :     aMtrDepth.SetUnit( eFUnit );
     243           0 :     aMtrDistance.SetUnit( eFUnit );
     244           0 :     aMtrFocalLength.SetUnit( eFUnit );
     245             : 
     246           0 :     pControllerItem = new Svx3DCtrlItem(SID_3D_STATE, pBindings);
     247           0 :     pConvertTo3DItem = new SvxConvertTo3DItem(SID_CONVERT_TO_3D, pBindings);
     248           0 :     pConvertTo3DLatheItem = new SvxConvertTo3DItem(SID_CONVERT_TO_3D_LATHE_FAST, pBindings);
     249             : 
     250           0 :     aBtnAssign.SetClickHdl( LINK( this, Svx3DWin, ClickAssignHdl ) );
     251           0 :     aBtnUpdate.SetClickHdl( LINK( this, Svx3DWin, ClickUpdateHdl ) );
     252             : 
     253           0 :     Link aLink( LINK( this, Svx3DWin, ClickViewTypeHdl ) );
     254           0 :     aBtnGeo.SetClickHdl( aLink );
     255           0 :     aBtnRepresentation.SetClickHdl( aLink );
     256           0 :     aBtnLight.SetClickHdl( aLink );
     257           0 :     aBtnTexture.SetClickHdl( aLink );
     258           0 :     aBtnMaterial.SetClickHdl( aLink );
     259             : 
     260           0 :     aLink = LINK( this, Svx3DWin, ClickHdl );
     261           0 :     aBtnPerspective.SetClickHdl( aLink );
     262           0 :     aBtnConvertTo3D.SetClickHdl( aLink );
     263           0 :     aBtnLatheObject.SetClickHdl( aLink );
     264             : 
     265             :     // Geometry
     266           0 :     aBtnNormalsObj.SetClickHdl( aLink );
     267           0 :     aBtnNormalsFlat.SetClickHdl( aLink );
     268           0 :     aBtnNormalsSphere.SetClickHdl( aLink );
     269           0 :     aBtnTwoSidedLighting.SetClickHdl( aLink );
     270           0 :     aBtnNormalsInvert.SetClickHdl( aLink );
     271           0 :     aBtnDoubleSided.SetClickHdl( aLink );
     272             : 
     273             :     // Representation
     274           0 :     aBtnShadow3d.SetClickHdl( aLink );
     275             : 
     276             :     // Lighting
     277           0 :     aBtnLight1.SetClickHdl( aLink );
     278           0 :     aBtnLight2.SetClickHdl( aLink );
     279           0 :     aBtnLight3.SetClickHdl( aLink );
     280           0 :     aBtnLight4.SetClickHdl( aLink );
     281           0 :     aBtnLight5.SetClickHdl( aLink );
     282           0 :     aBtnLight6.SetClickHdl( aLink );
     283           0 :     aBtnLight7.SetClickHdl( aLink );
     284           0 :     aBtnLight8.SetClickHdl( aLink );
     285             : 
     286             :     // Textures
     287           0 :     aBtnTexLuminance.SetClickHdl( aLink );
     288           0 :     aBtnTexColor.SetClickHdl( aLink );
     289           0 :     aBtnTexReplace.SetClickHdl( aLink );
     290           0 :     aBtnTexModulate.SetClickHdl( aLink );
     291           0 :     aBtnTexParallelX.SetClickHdl( aLink );
     292           0 :     aBtnTexCircleX.SetClickHdl( aLink );
     293           0 :     aBtnTexObjectX.SetClickHdl( aLink );
     294           0 :     aBtnTexParallelY.SetClickHdl( aLink );
     295           0 :     aBtnTexCircleY.SetClickHdl( aLink );
     296           0 :     aBtnTexObjectY.SetClickHdl( aLink );
     297           0 :     aBtnTexFilter.SetClickHdl( aLink );
     298             : 
     299             :     // Material
     300           0 :     aLink = LINK( this, Svx3DWin, ClickColorHdl );
     301           0 :     aBtnLightColor.SetClickHdl( aLink );
     302           0 :     aBtnAmbientColor.SetClickHdl( aLink );
     303           0 :     aBtnMatColor.SetClickHdl( aLink );
     304           0 :     aBtnEmissionColor.SetClickHdl( aLink );
     305           0 :     aBtnSpecularColor.SetClickHdl( aLink );
     306             : 
     307             : 
     308           0 :     aLink = LINK( this, Svx3DWin, SelectHdl );
     309           0 :     aLbMatFavorites.SetSelectHdl( aLink );
     310           0 :     aLbMatColor.SetSelectHdl( aLink );
     311           0 :     aLbMatEmission.SetSelectHdl( aLink );
     312           0 :     aLbMatSpecular.SetSelectHdl( aLink );
     313           0 :     aLbLight1.SetSelectHdl( aLink );
     314           0 :     aLbLight2.SetSelectHdl( aLink );
     315           0 :     aLbLight3.SetSelectHdl( aLink );
     316           0 :     aLbLight4.SetSelectHdl( aLink );
     317           0 :     aLbLight5.SetSelectHdl( aLink );
     318           0 :     aLbLight6.SetSelectHdl( aLink );
     319           0 :     aLbLight7.SetSelectHdl( aLink );
     320           0 :     aLbLight8.SetSelectHdl( aLink );
     321           0 :     aLbAmbientlight.SetSelectHdl( aLink );
     322           0 :     aLbShademode.SetSelectHdl( aLink );
     323             : 
     324           0 :     aLink = LINK( this, Svx3DWin, ModifyHdl );
     325           0 :     aMtrMatSpecularIntensity.SetModifyHdl( aLink );
     326           0 :     aNumHorizontal.SetModifyHdl( aLink );
     327           0 :     aNumVertical.SetModifyHdl( aLink );
     328           0 :     aMtrSlant.SetModifyHdl( aLink );
     329             : 
     330             :     // Preview callback
     331           0 :     aLink = LINK( this, Svx3DWin, ChangeLightCallbackHdl );
     332           0 :     aCtlLightPreview.SetUserInteractiveChangeCallback(aLink);
     333           0 :     aLink = LINK( this, Svx3DWin, ChangeSelectionCallbackHdl );
     334           0 :     aCtlLightPreview.SetUserSelectionChangeCallback(aLink);
     335             : 
     336           0 :     aSize = GetOutputSizePixel();
     337           0 :     SetMinOutputSizePixel( aSize );
     338             : 
     339           0 :     Construct();
     340             : 
     341             :     // Initiation of the initialization of the ColorLBs
     342           0 :     SfxDispatcher* pDispatcher = LocalGetDispatcher(pBindings);
     343           0 :     if (pDispatcher != NULL)
     344             :     {
     345           0 :         SfxBoolItem aItem( SID_3D_INIT, true );
     346             :         pDispatcher->Execute(
     347           0 :             SID_3D_INIT, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD, &aItem, 0L );
     348             :     }
     349             : 
     350           0 :     Reset();
     351             : 
     352           0 :     aBtnNormalsObj.SetAccessibleRelationMemberOf( &aFLNormals );
     353           0 :     aBtnNormalsFlat.SetAccessibleRelationMemberOf( &aFLNormals );
     354           0 :     aBtnNormalsSphere.SetAccessibleRelationMemberOf( &aFLNormals );
     355           0 :     aBtnNormalsInvert.SetAccessibleRelationMemberOf( &aFLNormals );
     356           0 :     aBtnTwoSidedLighting.SetAccessibleRelationMemberOf( &aFLNormals );
     357           0 :     aBtnDoubleSided.SetAccessibleRelationMemberOf( &aFLNormals );
     358             : 
     359           0 :     aBtnLight1.SetAccessibleRelationMemberOf( &aFLLight );
     360           0 :     aBtnLight2.SetAccessibleRelationMemberOf( &aFLLight );
     361           0 :     aBtnLight3.SetAccessibleRelationMemberOf( &aFLLight );
     362           0 :     aBtnLight4.SetAccessibleRelationMemberOf( &aFLLight );
     363           0 :     aBtnLight5.SetAccessibleRelationMemberOf( &aFLLight );
     364           0 :     aBtnLight6.SetAccessibleRelationMemberOf( &aFLLight );
     365           0 :     aBtnLight7.SetAccessibleRelationMemberOf( &aFLLight );
     366           0 :     aBtnLight8.SetAccessibleRelationMemberOf( &aFLLight );
     367             : 
     368           0 :     aBtnLight1.SetAccessibleRelationLabeledBy( &aFTLightsource );
     369           0 :     aBtnLight2.SetAccessibleRelationLabeledBy( &aFTLightsource );
     370           0 :     aBtnLight3.SetAccessibleRelationLabeledBy( &aFTLightsource );
     371           0 :     aBtnLight4.SetAccessibleRelationLabeledBy( &aFTLightsource );
     372           0 :     aBtnLight5.SetAccessibleRelationLabeledBy( &aFTLightsource );
     373           0 :     aBtnLight6.SetAccessibleRelationLabeledBy( &aFTLightsource );
     374           0 :     aBtnLight7.SetAccessibleRelationLabeledBy( &aFTLightsource );
     375           0 :     aBtnLight8.SetAccessibleRelationLabeledBy( &aFTLightsource );
     376           0 :     aBtnLightColor.SetAccessibleRelationMemberOf( &aFLLight );
     377           0 :     aBtnLightColor.SetAccessibleRelationLabeledBy( &aFTLightsource );
     378           0 :     aBtnAmbientColor.SetAccessibleRelationMemberOf( &aFLLight );
     379           0 :     aBtnAmbientColor.SetAccessibleRelationLabeledBy( &aFTAmbientlight );
     380             : 
     381           0 :     aBtnSpecularColor.SetAccessibleRelationLabeledBy( &aFtMatSpecular );
     382           0 :     aBtnMatColor.SetAccessibleRelationLabeledBy( &aFtMatColor );
     383           0 :     aBtnEmissionColor.SetAccessibleRelationLabeledBy( &aFtMatEmission );
     384           0 :     aBtnTexLuminance.SetAccessibleRelationLabeledBy( &aFtTexKind );
     385           0 :     aBtnTexColor.SetAccessibleRelationLabeledBy( &aFtTexKind );
     386           0 :     aBtnTexReplace.SetAccessibleRelationLabeledBy( &aFtTexMode );
     387           0 :     aBtnTexModulate.SetAccessibleRelationLabeledBy( &aFtTexMode );
     388           0 :     aBtnTexBlend.SetAccessibleRelationLabeledBy( &aFtTexMode );
     389           0 :     aBtnTexObjectX.SetAccessibleRelationLabeledBy( &aFtTexProjectionX );
     390           0 :     aBtnTexParallelX.SetAccessibleRelationLabeledBy( &aFtTexProjectionX );
     391           0 :     aBtnTexCircleX.SetAccessibleRelationLabeledBy( &aFtTexProjectionX );
     392           0 :     aBtnTexObjectY.SetAccessibleRelationLabeledBy( &aFtTexProjectionY );
     393           0 :     aBtnTexParallelY.SetAccessibleRelationLabeledBy( &aFtTexProjectionY );
     394           0 :     aBtnTexCircleY.SetAccessibleRelationLabeledBy( &aFtTexProjectionY );
     395           0 :     aBtnTexFilter.SetAccessibleRelationLabeledBy( &aFtTexFilter );
     396           0 :     aCtlLightPreview.SetAccessibleRelationLabeledBy( &aCtlLightPreview );
     397           0 :     aBtnNormalsObj.SetAccessibleRelationMemberOf(&aFLNormals);
     398           0 :     aBtnNormalsFlat.SetAccessibleRelationMemberOf(&aFLNormals);
     399           0 :     aBtnNormalsSphere.SetAccessibleRelationMemberOf(&aFLNormals);
     400           0 :     aBtnNormalsInvert.SetAccessibleRelationMemberOf(&aFLNormals);
     401           0 :     aBtnTwoSidedLighting.SetAccessibleRelationMemberOf(&aFLNormals);
     402             : 
     403           0 :     aBtnShadow3d.SetAccessibleRelationMemberOf(&aFLShadow);
     404             : 
     405           0 :     aBtnLight1.SetAccessibleRelationMemberOf(&aFLLight);
     406           0 :     aBtnLight2.SetAccessibleRelationMemberOf(&aFLLight);
     407           0 :     aBtnLight3.SetAccessibleRelationMemberOf(&aFLLight);
     408           0 :     aBtnLight4.SetAccessibleRelationMemberOf(&aFLLight);
     409           0 :     aBtnLight5.SetAccessibleRelationMemberOf(&aFLLight);
     410           0 :     aBtnLight6.SetAccessibleRelationMemberOf(&aFLLight);
     411           0 :     aBtnLight7.SetAccessibleRelationMemberOf(&aFLLight);
     412           0 :     aBtnLight8.SetAccessibleRelationMemberOf(&aFLLight);
     413             : 
     414           0 :     aBtnTexLuminance.SetAccessibleRelationMemberOf(&aFLTexture);
     415           0 :     aBtnTexColor.SetAccessibleRelationMemberOf(&aFLTexture);
     416           0 :     aBtnTexReplace.SetAccessibleRelationMemberOf(&aFLTexture);
     417           0 :     aBtnTexModulate.SetAccessibleRelationMemberOf(&aFLTexture);
     418           0 :     aBtnTexBlend.SetAccessibleRelationMemberOf(&aFLTexture);
     419           0 :     aBtnTexObjectX.SetAccessibleRelationMemberOf(&aFLTexture);
     420           0 :     aBtnTexParallelX.SetAccessibleRelationMemberOf(&aFLTexture);
     421           0 :     aBtnTexCircleX.SetAccessibleRelationMemberOf(&aFLTexture);
     422           0 :     aBtnTexObjectY.SetAccessibleRelationMemberOf(&aFLTexture);
     423           0 :     aBtnTexParallelY.SetAccessibleRelationMemberOf(&aFLTexture);
     424           0 :     aBtnTexCircleY.SetAccessibleRelationMemberOf(&aFLTexture);
     425           0 :     aBtnTexFilter.SetAccessibleRelationMemberOf(&aFLTexture);
     426             : 
     427           0 :     aBtnMatColor.SetAccessibleRelationMemberOf(&aFLMaterial);
     428           0 :     aBtnEmissionColor.SetAccessibleRelationMemberOf(&aFLMaterial);
     429             : 
     430           0 :     aBtnSpecularColor.SetAccessibleRelationMemberOf(&aFLMatSpecular);
     431           0 : }
     432             : 
     433             : 
     434           0 : Svx3DWin::~Svx3DWin()
     435             : {
     436           0 :     delete p3DView;
     437           0 :     delete pVDev;
     438           0 :     delete pModel;
     439             : 
     440           0 :     delete pControllerItem;
     441           0 :     delete pConvertTo3DItem;
     442           0 :     delete pConvertTo3DLatheItem;
     443             : 
     444           0 :     delete mpRemember2DAttributes;
     445             : 
     446           0 :     delete mpImpl;
     447           0 : }
     448             : 
     449             : 
     450           0 : void Svx3DWin::Construct()
     451             : {
     452           0 :     aBtnGeo.Check();
     453           0 :     Link aLink( LINK( this, Svx3DWin, ClickViewTypeHdl ) );
     454           0 :     aLink.Call( &aBtnGeo );
     455           0 :     aCtlLightPreview.Hide();
     456           0 : }
     457             : 
     458             : 
     459           0 : void Svx3DWin::Reset()
     460             : {
     461             :     // Various initializations, default is AllAttributes
     462           0 :     aLbShademode.SelectEntryPos( 0 );
     463           0 :     aMtrMatSpecularIntensity.SetValue( 50 );
     464             : 
     465           0 :     aBtnLight1.Check();
     466           0 :     ClickUpdateHdl( NULL );
     467             : 
     468             :     // Select nothing, to avoid errors when selecting the first
     469           0 :     aCtlLightPreview.GetSvx3DLightControl().SelectLight(0);
     470           0 :     aCtlLightPreview.CheckSelection();
     471           0 : }
     472             : 
     473           0 : bool Svx3DWin::GetUILightState( const ImageButton& rBtn ) const
     474             : {
     475           0 :     return (rBtn.GetModeImage() == aImgLightOn);
     476             : }
     477             : 
     478           0 : void Svx3DWin::SetUILightState( ImageButton& aBtn, bool bState )
     479             : {
     480           0 :     aBtn.SetModeImage( bState ? aImgLightOn : aImgLightOff );
     481           0 : }
     482             : 
     483             : 
     484           0 : void Svx3DWin::Update( SfxItemSet& rAttrs )
     485             : {
     486             :     // remember 2d attributes
     487           0 :     if(mpRemember2DAttributes)
     488           0 :         mpRemember2DAttributes->ClearItem();
     489             :     else
     490             :         mpRemember2DAttributes = new SfxItemSet(*rAttrs.GetPool(),
     491             :             SDRATTR_START, SDRATTR_SHADOW_LAST,
     492             :             SDRATTR_3D_FIRST, SDRATTR_3D_LAST,
     493           0 :             0, 0);
     494             : 
     495           0 :     SfxWhichIter aIter(*mpRemember2DAttributes);
     496           0 :     sal_uInt16 nWhich(aIter.FirstWhich());
     497             : 
     498           0 :     while(nWhich)
     499             :     {
     500           0 :         SfxItemState eState = rAttrs.GetItemState(nWhich, false);
     501           0 :         if(SFX_ITEM_DONTCARE == eState)
     502           0 :             mpRemember2DAttributes->InvalidateItem(nWhich);
     503           0 :         else if(SFX_ITEM_SET == eState)
     504           0 :             mpRemember2DAttributes->Put(rAttrs.Get(nWhich, false));
     505             : 
     506           0 :         nWhich = aIter.NextWhich();
     507             :     }
     508             : 
     509             :     // construct field values
     510             :     const SfxPoolItem* pItem;
     511             : 
     512             :     // Possible determine PoolUnit
     513           0 :     if( !mpImpl->pPool )
     514             :     {
     515           0 :         mpImpl->pPool = rAttrs.GetPool();
     516             :         DBG_ASSERT( mpImpl->pPool, "Where is the Pool? ");
     517           0 :         ePoolUnit = mpImpl->pPool->GetMetric( SID_ATTR_LINE_WIDTH );
     518             :     }
     519           0 :     eFUnit = GetModuleFieldUnit( rAttrs );
     520             : 
     521             : 
     522             :     // Segment Number Can be changed? and other states
     523           0 :     SfxItemState eState = rAttrs.GetItemState( SID_ATTR_3D_INTERN, false, &pItem );
     524           0 :     if( SFX_ITEM_SET == eState )
     525             :     {
     526           0 :         sal_uInt32 nState = ( ( const SfxUInt32Item* )pItem )->GetValue();
     527           0 :         bool bExtrude = ( nState & 2 );
     528           0 :         bool bSphere  = ( nState & 4 );
     529           0 :         bool bCube    = ( nState & 8 );
     530             : 
     531           0 :         bool bChart = ( nState & 32 ); // Chart
     532             : 
     533           0 :         if( !bChart )
     534             :         {
     535             :             // For cube objects are no segments set
     536           0 :             aFtHorizontal.Enable( !bCube );
     537           0 :             aNumHorizontal.Enable( !bCube );
     538           0 :             aFtVertical.Enable( !bCube );
     539           0 :             aNumVertical.Enable( !bCube );
     540           0 :             aFLSegments.Enable( !bCube );
     541             : 
     542           0 :             aFtPercentDiagonal.Enable( !bCube && !bSphere );
     543           0 :             aMtrPercentDiagonal.Enable( !bCube && !bSphere );
     544           0 :             aFtBackscale.Enable( !bCube && !bSphere );
     545           0 :             aMtrBackscale.Enable( !bCube && !bSphere );
     546           0 :             aFtDepth.Enable( !bCube && !bSphere );
     547           0 :             aMtrDepth.Enable( !bCube && !bSphere );
     548           0 :             if( bCube )
     549             :             {
     550           0 :                 aNumHorizontal.SetEmptyFieldValue();
     551           0 :                 aNumVertical.SetEmptyFieldValue();
     552             :             }
     553           0 :             if( bCube || bSphere )
     554             :             {
     555           0 :                 aMtrPercentDiagonal.SetEmptyFieldValue();
     556           0 :                 aMtrBackscale.SetEmptyFieldValue();
     557           0 :                 aMtrDepth.SetEmptyFieldValue();
     558             :             }
     559             : 
     560             :             // There is a final angle only for Lathe objects.
     561           0 :             aFtEndAngle.Enable( !bExtrude && !bCube && !bSphere );
     562           0 :             aMtrEndAngle.Enable( !bExtrude && !bCube && !bSphere );
     563           0 :             if( bExtrude || bCube || bSphere )
     564           0 :                 aMtrEndAngle.SetEmptyFieldValue();
     565             :         }
     566             :         else
     567             :         {
     568             :             // Geometry
     569           0 :             aFtHorizontal.Enable( false );
     570           0 :             aNumHorizontal.Enable( false );
     571           0 :             aNumHorizontal.SetEmptyFieldValue();
     572           0 :             aFtVertical.Enable( false );
     573           0 :             aNumVertical.Enable( false );
     574           0 :             aNumVertical.SetEmptyFieldValue();
     575           0 :             aFLSegments.Enable( false );
     576           0 :             aFtEndAngle.Enable( false );
     577           0 :             aMtrEndAngle.Enable( false );
     578           0 :             aMtrEndAngle.SetEmptyFieldValue();
     579           0 :             aFtDepth.Enable( false );
     580           0 :             aMtrDepth.Enable( false );
     581           0 :             aMtrDepth.SetEmptyFieldValue();
     582             : 
     583             :             // Representation
     584           0 :             aBtnShadow3d.Enable( false );
     585           0 :             aFtSlant.Enable( false );
     586           0 :             aMtrSlant.Enable( false );
     587           0 :             aFLShadow.Enable( false );
     588             : 
     589           0 :             aFtDistance.Enable( false );
     590           0 :             aMtrDistance.Enable( false );
     591           0 :             aMtrDistance.SetEmptyFieldValue();
     592           0 :             aFtFocalLeng.Enable( false );
     593           0 :             aMtrFocalLength.Enable( false );
     594           0 :             aMtrFocalLength.SetEmptyFieldValue();
     595           0 :             aFLCamera.Enable( false );
     596             : 
     597             :             //Lower Range
     598           0 :             aBtnConvertTo3D.Enable( false );
     599           0 :             aBtnLatheObject.Enable( false );
     600             :         }
     601             :     }
     602             :     // Bitmap fill ? -> Status
     603           0 :     sal_Bool bBitmap(sal_False);
     604           0 :     eState = rAttrs.GetItemState(XATTR_FILLSTYLE);
     605           0 :     if(eState != SFX_ITEM_DONTCARE)
     606             :     {
     607           0 :         XFillStyle eXFS = (XFillStyle)((const XFillStyleItem&)rAttrs.Get(XATTR_FILLSTYLE)).GetValue();
     608           0 :         bBitmap = (eXFS == XFILL_BITMAP || eXFS == XFILL_GRADIENT || eXFS == XFILL_HATCH);
     609             :     }
     610             : 
     611           0 :     aFtTexKind.Enable( bBitmap );
     612           0 :     aBtnTexLuminance.Enable( bBitmap );
     613           0 :     aBtnTexColor.Enable( bBitmap );
     614           0 :     aFtTexMode.Enable( bBitmap );
     615           0 :     aBtnTexReplace.Enable( bBitmap );
     616           0 :     aBtnTexModulate.Enable( bBitmap );
     617           0 :     aBtnTexBlend.Enable( bBitmap );
     618           0 :     aFtTexProjectionX.Enable( bBitmap );
     619           0 :     aBtnTexParallelX.Enable( bBitmap );
     620           0 :     aBtnTexCircleX.Enable( bBitmap );
     621           0 :     aBtnTexObjectX.Enable( bBitmap );
     622           0 :     aFtTexProjectionY.Enable( bBitmap );
     623           0 :     aBtnTexParallelY.Enable( bBitmap );
     624           0 :     aBtnTexCircleY.Enable( bBitmap );
     625           0 :     aBtnTexObjectY.Enable( bBitmap );
     626           0 :     aFtTexFilter.Enable( bBitmap );
     627           0 :     aBtnTexFilter.Enable( bBitmap );
     628           0 :     aFLTexture.Enable( bBitmap );
     629             : 
     630             : 
     631             :     // Geometry
     632             :     // Number of segments (horizontal)
     633           0 :     if( aNumHorizontal.IsEnabled() )
     634             :     {
     635           0 :         eState = rAttrs.GetItemState(SDRATTR_3DOBJ_HORZ_SEGS);
     636           0 :         if(eState != SFX_ITEM_DONTCARE)
     637             :         {
     638           0 :             sal_uInt32 nValue = ((const Svx3DHorizontalSegmentsItem&)rAttrs.Get(SDRATTR_3DOBJ_HORZ_SEGS)).GetValue();
     639           0 :             if(nValue != (sal_uInt32 )aNumHorizontal.GetValue())
     640             :             {
     641           0 :                 aNumHorizontal.SetValue( nValue );
     642           0 :                 bUpdate = true;
     643             :             }
     644           0 :             else if( aNumHorizontal.IsEmptyFieldValue() )
     645           0 :                 aNumHorizontal.SetValue( nValue );
     646             :         }
     647             :         else
     648             :         {
     649           0 :             if( !aNumHorizontal.IsEmptyFieldValue() )
     650             :             {
     651           0 :                 aNumHorizontal.SetEmptyFieldValue();
     652           0 :                 bUpdate = true;
     653             :             }
     654             :         }
     655             :     }
     656             : 
     657             :     //Number of segments (vertical)
     658           0 :     if( aNumVertical.IsEnabled() )
     659             :     {
     660           0 :         eState = rAttrs.GetItemState(SDRATTR_3DOBJ_VERT_SEGS);
     661           0 :         if( eState != SFX_ITEM_DONTCARE )
     662             :         {
     663           0 :             sal_uInt32 nValue = ((const Svx3DVerticalSegmentsItem&)rAttrs.Get(SDRATTR_3DOBJ_VERT_SEGS)).GetValue();
     664           0 :             if( nValue != (sal_uInt32) aNumVertical.GetValue() )
     665             :             {
     666           0 :                 aNumVertical.SetValue( nValue );
     667           0 :                 bUpdate = true;
     668             :             }
     669           0 :             else if( aNumVertical.IsEmptyFieldValue() )
     670           0 :                 aNumVertical.SetValue( nValue );
     671             :         }
     672             :         else
     673             :         {
     674           0 :             if( !aNumVertical.IsEmptyFieldValue() )
     675             :             {
     676           0 :                 aNumVertical.SetEmptyFieldValue();
     677           0 :                 bUpdate = true;
     678             :             }
     679             :         }
     680             :     }
     681             : 
     682             :     // Depth
     683           0 :     if( aMtrDepth.IsEnabled() )
     684             :     {
     685           0 :         eState = rAttrs.GetItemState(SDRATTR_3DOBJ_DEPTH);
     686           0 :         if( eState != SFX_ITEM_DONTCARE )
     687             :         {
     688           0 :             sal_uInt32 nValue = ((const Svx3DDepthItem&)rAttrs.Get(SDRATTR_3DOBJ_DEPTH)).GetValue();
     689           0 :             sal_uInt32 nValue2 = GetCoreValue( aMtrDepth, ePoolUnit );
     690           0 :             if( nValue != nValue2 )
     691             :             {
     692           0 :                 if( eFUnit != aMtrDepth.GetUnit() )
     693           0 :                     SetFieldUnit( aMtrDepth, eFUnit );
     694             : 
     695           0 :                 SetMetricValue( aMtrDepth, nValue, ePoolUnit );
     696           0 :                 bUpdate = true;
     697             :             }
     698           0 :             else if( aMtrDepth.IsEmptyFieldValue() )
     699           0 :                 aMtrDepth.SetValue( aMtrDepth.GetValue() );
     700             :         }
     701             :         else
     702             :         {
     703           0 :             if( !aMtrDepth.IsEmptyFieldValue() )
     704             :             {
     705           0 :                 aMtrDepth.SetEmptyFieldValue();
     706           0 :                 bUpdate = true;
     707             :             }
     708             :         }
     709             :     }
     710             : 
     711             :     // Double walled / Double sided
     712           0 :     eState = rAttrs.GetItemState(SDRATTR_3DOBJ_DOUBLE_SIDED);
     713           0 :     if( eState != SFX_ITEM_DONTCARE )
     714             :     {
     715           0 :         bool bValue = ((const Svx3DDoubleSidedItem&)rAttrs.Get(SDRATTR_3DOBJ_DOUBLE_SIDED)).GetValue();
     716           0 :         if( bValue != aBtnDoubleSided.IsChecked() )
     717             :         {
     718           0 :             aBtnDoubleSided.Check( bValue );
     719           0 :             bUpdate = true;
     720             :         }
     721           0 :         else if( aBtnDoubleSided.GetState() == TRISTATE_INDET )
     722           0 :             aBtnDoubleSided.Check( bValue );
     723             :     }
     724             :     else
     725             :     {
     726           0 :         if( aBtnDoubleSided.GetState() != TRISTATE_INDET )
     727             :         {
     728           0 :             aBtnDoubleSided.SetState( TRISTATE_INDET );
     729           0 :             bUpdate = true;
     730             :         }
     731             :     }
     732             : 
     733             :     // Edge rounding
     734           0 :     if( aMtrPercentDiagonal.IsEnabled() )
     735             :     {
     736           0 :         eState = rAttrs.GetItemState(SDRATTR_3DOBJ_PERCENT_DIAGONAL);
     737           0 :         if( eState != SFX_ITEM_DONTCARE )
     738             :         {
     739           0 :             sal_uInt16 nValue = ((const Svx3DPercentDiagonalItem&)rAttrs.Get(SDRATTR_3DOBJ_PERCENT_DIAGONAL)).GetValue();
     740           0 :             if( nValue != aMtrPercentDiagonal.GetValue() )
     741             :             {
     742           0 :                 aMtrPercentDiagonal.SetValue( nValue );
     743           0 :                 bUpdate = true;
     744             :             }
     745           0 :             else if( aMtrPercentDiagonal.IsEmptyFieldValue() )
     746           0 :                 aMtrPercentDiagonal.SetValue( nValue );
     747             :         }
     748             :         else
     749             :         {
     750           0 :             if( !aMtrPercentDiagonal.IsEmptyFieldValue() )
     751             :             {
     752           0 :                 aMtrPercentDiagonal.SetEmptyFieldValue();
     753           0 :                 bUpdate = true;
     754             :             }
     755             :         }
     756             :     }
     757             : 
     758             :     // Depth scaling
     759           0 :     if( aMtrBackscale.IsEnabled() )
     760             :     {
     761           0 :         eState = rAttrs.GetItemState(SDRATTR_3DOBJ_BACKSCALE);
     762           0 :         if( eState != SFX_ITEM_DONTCARE )
     763             :         {
     764           0 :             sal_uInt16 nValue = ((const Svx3DBackscaleItem&)rAttrs.Get(SDRATTR_3DOBJ_BACKSCALE)).GetValue();
     765           0 :             if( nValue != aMtrBackscale.GetValue() )
     766             :             {
     767           0 :                 aMtrBackscale.SetValue( nValue );
     768           0 :                 bUpdate = true;
     769             :             }
     770           0 :             else if( aMtrBackscale.IsEmptyFieldValue() )
     771           0 :                 aMtrBackscale.SetValue( nValue );
     772             :         }
     773             :         else
     774             :         {
     775           0 :             if( !aMtrBackscale.IsEmptyFieldValue() )
     776             :             {
     777           0 :                 aMtrBackscale.SetEmptyFieldValue();
     778           0 :                 bUpdate = true;
     779             :             }
     780             :         }
     781             :     }
     782             : 
     783             :     // End angle
     784           0 :     if( aMtrEndAngle.IsEnabled() )
     785             :     {
     786           0 :         eState = rAttrs.GetItemState(SDRATTR_3DOBJ_END_ANGLE);
     787           0 :         if( eState != SFX_ITEM_DONTCARE )
     788             :         {
     789           0 :             sal_Int32 nValue = ((const Svx3DEndAngleItem&)rAttrs.Get(SDRATTR_3DOBJ_END_ANGLE)).GetValue();
     790           0 :             if( nValue != aMtrEndAngle.GetValue() )
     791             :             {
     792           0 :                 aMtrEndAngle.SetValue( nValue );
     793           0 :                 bUpdate = true;
     794             :             }
     795             :         }
     796             :         else
     797             :         {
     798           0 :             if( !aMtrEndAngle.IsEmptyFieldValue() )
     799             :             {
     800           0 :                 aMtrEndAngle.SetEmptyFieldValue();
     801           0 :                 bUpdate = true;
     802             :             }
     803             :         }
     804             :     }
     805             : 
     806             :     // Normal type
     807           0 :     eState = rAttrs.GetItemState(SDRATTR_3DOBJ_NORMALS_KIND);
     808           0 :     if( eState != SFX_ITEM_DONTCARE )
     809             :     {
     810           0 :         sal_uInt16 nValue = ((const Svx3DNormalsKindItem&)rAttrs.Get(SDRATTR_3DOBJ_NORMALS_KIND)).GetValue();
     811             : 
     812           0 :         if( ( !aBtnNormalsObj.IsChecked() && nValue == 0 ) ||
     813           0 :             ( !aBtnNormalsFlat.IsChecked() && nValue == 1 ) ||
     814           0 :             ( !aBtnNormalsSphere.IsChecked() && nValue == 2 ) )
     815             :         {
     816           0 :             aBtnNormalsObj.Check( nValue == 0 );
     817           0 :             aBtnNormalsFlat.Check( nValue == 1 );
     818           0 :             aBtnNormalsSphere.Check( nValue == 2 );
     819           0 :             bUpdate = true;
     820             :         }
     821             :     }
     822             :     else
     823             :     {
     824           0 :         if( aBtnNormalsObj.IsChecked() ||
     825           0 :             aBtnNormalsFlat.IsChecked() ||
     826           0 :             aBtnNormalsSphere.IsChecked() )
     827             :         {
     828           0 :             aBtnNormalsObj.Check( false );
     829           0 :             aBtnNormalsFlat.Check( false );
     830           0 :             aBtnNormalsSphere.Check( false );
     831           0 :             bUpdate = true;
     832             :         }
     833             :     }
     834             : 
     835             :     // Normal inverted
     836           0 :     eState = rAttrs.GetItemState(SDRATTR_3DOBJ_NORMALS_INVERT);
     837           0 :     if( eState != SFX_ITEM_DONTCARE )
     838             :     {
     839           0 :         bool bValue = ((const Svx3DNormalsInvertItem&)rAttrs.Get(SDRATTR_3DOBJ_NORMALS_INVERT)).GetValue();
     840           0 :         if( bValue != aBtnNormalsInvert.IsChecked() )
     841             :         {
     842           0 :             aBtnNormalsInvert.Check( bValue );
     843           0 :             bUpdate = true;
     844             :         }
     845           0 :         else if( aBtnNormalsInvert.GetState() == TRISTATE_INDET )
     846           0 :             aBtnNormalsInvert.Check( bValue );
     847             :     }
     848             :     else
     849             :     {
     850           0 :         if( aBtnNormalsInvert.GetState() != TRISTATE_INDET )
     851             :         {
     852           0 :             aBtnNormalsInvert.SetState( TRISTATE_INDET );
     853           0 :             bUpdate = true;
     854             :         }
     855             :     }
     856             : 
     857             :     // 2-sided lighting
     858           0 :     eState = rAttrs.GetItemState(SDRATTR_3DSCENE_TWO_SIDED_LIGHTING);
     859           0 :     if( eState != SFX_ITEM_DONTCARE )
     860             :     {
     861           0 :         bool bValue = ((const Svx3DTwoSidedLightingItem&)rAttrs.Get(SDRATTR_3DSCENE_TWO_SIDED_LIGHTING)).GetValue();
     862           0 :         if( bValue != aBtnTwoSidedLighting.IsChecked() )
     863             :         {
     864           0 :             aBtnTwoSidedLighting.Check( bValue );
     865           0 :             bUpdate = true;
     866             :         }
     867           0 :         else if( aBtnTwoSidedLighting.GetState() == TRISTATE_INDET )
     868           0 :             aBtnTwoSidedLighting.Check( bValue );
     869             :     }
     870             :     else
     871             :     {
     872           0 :         if( aBtnTwoSidedLighting.GetState() != TRISTATE_INDET )
     873             :         {
     874           0 :             aBtnTwoSidedLighting.SetState( TRISTATE_INDET );
     875           0 :             bUpdate = true;
     876             :         }
     877             :     }
     878             : 
     879             :     // Representation
     880             :     // Shademode
     881           0 :     eState = rAttrs.GetItemState(SDRATTR_3DSCENE_SHADE_MODE);
     882           0 :     if( eState != SFX_ITEM_DONTCARE )
     883             :     {
     884           0 :         sal_uInt16 nValue = ((const Svx3DShadeModeItem&)rAttrs.Get(SDRATTR_3DSCENE_SHADE_MODE)).GetValue();
     885           0 :         if( nValue != aLbShademode.GetSelectEntryPos() )
     886             :         {
     887           0 :             aLbShademode.SelectEntryPos( nValue );
     888           0 :             bUpdate = true;
     889             :         }
     890             :     }
     891             :     else
     892             :     {
     893           0 :         if( aLbShademode.GetSelectEntryCount() != 0 )
     894             :         {
     895           0 :             aLbShademode.SetNoSelection();
     896           0 :             bUpdate = true;
     897             :         }
     898             :     }
     899             : 
     900             :     // 3D-Shadow
     901           0 :     eState = rAttrs.GetItemState(SDRATTR_3DOBJ_SHADOW_3D);
     902           0 :     if( eState != SFX_ITEM_DONTCARE )
     903             :     {
     904           0 :         bool bValue = ((const Svx3DShadow3DItem&)rAttrs.Get(SDRATTR_3DOBJ_SHADOW_3D)).GetValue();
     905           0 :         if( bValue != aBtnShadow3d.IsChecked() )
     906             :         {
     907           0 :             aBtnShadow3d.Check( bValue );
     908           0 :             aFtSlant.Enable( bValue );
     909           0 :             aMtrSlant.Enable( bValue );
     910           0 :             bUpdate = true;
     911             :         }
     912           0 :         else if( aBtnShadow3d.GetState() == TRISTATE_INDET )
     913           0 :             aBtnShadow3d.Check( bValue );
     914             :     }
     915             :     else
     916             :     {
     917           0 :         if( aBtnShadow3d.GetState() != TRISTATE_INDET )
     918             :         {
     919           0 :             aBtnShadow3d.SetState( TRISTATE_INDET );
     920           0 :             bUpdate = true;
     921             :         }
     922             :     }
     923             : 
     924             :     // Inclination (Shadow)
     925           0 :     eState = rAttrs.GetItemState(SDRATTR_3DSCENE_SHADOW_SLANT);
     926           0 :     if( eState != SFX_ITEM_DONTCARE )
     927             :     {
     928           0 :         sal_uInt16 nValue = ((const Svx3DShadowSlantItem&)rAttrs.Get(SDRATTR_3DSCENE_SHADOW_SLANT)).GetValue();
     929           0 :         if( nValue != aMtrSlant.GetValue() )
     930             :         {
     931           0 :             aMtrSlant.SetValue( nValue );
     932           0 :             bUpdate = true;
     933             :         }
     934             :     }
     935             :     else
     936             :     {
     937           0 :         if( !aMtrSlant.IsEmptyFieldValue() )
     938             :         {
     939           0 :             aMtrSlant.SetEmptyFieldValue();
     940           0 :             bUpdate = true;
     941             :         }
     942             :     }
     943             : 
     944             :     // Distance
     945           0 :     eState = rAttrs.GetItemState(SDRATTR_3DSCENE_DISTANCE);
     946           0 :     if( eState != SFX_ITEM_DONTCARE )
     947             :     {
     948           0 :         sal_uInt32 nValue = ((const Svx3DDistanceItem&)rAttrs.Get(SDRATTR_3DSCENE_DISTANCE)).GetValue();
     949           0 :         sal_uInt32 nValue2 = GetCoreValue( aMtrDistance, ePoolUnit );
     950           0 :         if( nValue != nValue2 )
     951             :         {
     952           0 :             if( eFUnit != aMtrDistance.GetUnit() )
     953           0 :                 SetFieldUnit( aMtrDistance, eFUnit );
     954             : 
     955           0 :             SetMetricValue( aMtrDistance, nValue, ePoolUnit );
     956           0 :             bUpdate = true;
     957             :         }
     958             :     }
     959             :     else
     960             :     {
     961           0 :         if( !aMtrDepth.IsEmptyFieldValue() )
     962             :         {
     963           0 :             aMtrDepth.SetEmptyFieldValue();
     964           0 :             bUpdate = true;
     965             :         }
     966             :     }
     967             : 
     968             :     // Focal length
     969           0 :     eState = rAttrs.GetItemState(SDRATTR_3DSCENE_FOCAL_LENGTH);
     970           0 :     if( eState != SFX_ITEM_DONTCARE )
     971             :     {
     972           0 :         sal_uInt32 nValue = ((const Svx3DFocalLengthItem&)rAttrs.Get(SDRATTR_3DSCENE_FOCAL_LENGTH)).GetValue();
     973           0 :         sal_uInt32 nValue2 = GetCoreValue( aMtrFocalLength, ePoolUnit );
     974           0 :         if( nValue != nValue2 )
     975             :         {
     976           0 :             if( eFUnit != aMtrFocalLength.GetUnit() )
     977           0 :                 SetFieldUnit( aMtrFocalLength, eFUnit );
     978             : 
     979           0 :             SetMetricValue( aMtrFocalLength, nValue, ePoolUnit );
     980           0 :             bUpdate = true;
     981             :         }
     982             :     }
     983             :     else
     984             :     {
     985           0 :         if( !aMtrFocalLength.IsEmptyFieldValue() )
     986             :         {
     987           0 :             aMtrFocalLength.SetEmptyFieldValue();
     988           0 :             bUpdate = true;
     989             :         }
     990             :     }
     991             : 
     992             : // Lighting
     993           0 :     Color aColor;
     994           0 :     basegfx::B3DVector aVector;
     995             :     // Light 1 (Color)
     996           0 :     eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTCOLOR_1);
     997           0 :     if( eState != SFX_ITEM_DONTCARE )
     998             :     {
     999           0 :         aColor = ((const Svx3DLightcolor1Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTCOLOR_1)).GetValue();
    1000           0 :         ColorLB* pLb = &aLbLight1;
    1001           0 :         if( aColor != pLb->GetSelectEntryColor() )
    1002             :         {
    1003           0 :             LBSelectColor( pLb, aColor );
    1004           0 :             bUpdate = true;
    1005             :         }
    1006             :     }
    1007             :     else
    1008             :     {
    1009           0 :         if( aLbLight1.GetSelectEntryCount() != 0 )
    1010             :         {
    1011           0 :             aLbLight1.SetNoSelection();
    1012           0 :             bUpdate = true;
    1013             :         }
    1014             :     }
    1015             :     // Light 1 (on/off)
    1016           0 :     eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTON_1);
    1017           0 :     if( eState != SFX_ITEM_DONTCARE )
    1018             :     {
    1019           0 :         bool bOn = ((const Svx3DLightOnOff1Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTON_1)).GetValue();
    1020           0 :         if( ( bOn && !GetUILightState( aBtnLight1 )) ||
    1021           0 :             ( !bOn && GetUILightState( aBtnLight1 )) )
    1022             :         {
    1023           0 :             SetUILightState( aBtnLight1, bOn );
    1024           0 :             bUpdate = true;
    1025             :         }
    1026           0 :         if( aBtnLight1.GetState() == TRISTATE_INDET )
    1027           0 :             aBtnLight1.Check( aBtnLight1.IsChecked() );
    1028             :     }
    1029             :     else
    1030             :     {
    1031           0 :         if( aBtnLight1.GetState() != TRISTATE_INDET )
    1032             :         {
    1033           0 :             aBtnLight1.SetState( TRISTATE_INDET );
    1034           0 :             bUpdate = true;
    1035             :         }
    1036             :     }
    1037             :     // Light 1 (direction)
    1038           0 :     eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTDIRECTION_1);
    1039           0 :     if( eState != SFX_ITEM_DONTCARE )
    1040             :     {
    1041           0 :         bUpdate = true;
    1042             :     }
    1043             : 
    1044             :     //Light 2 (color)
    1045           0 :     eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTCOLOR_2);
    1046           0 :     if( eState != SFX_ITEM_DONTCARE )
    1047             :     {
    1048           0 :         aColor = ((const Svx3DLightcolor2Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTCOLOR_2)).GetValue();
    1049           0 :         ColorLB* pLb = &aLbLight2;
    1050           0 :         if( aColor != pLb->GetSelectEntryColor() )
    1051             :         {
    1052           0 :             LBSelectColor( pLb, aColor );
    1053           0 :             bUpdate = true;
    1054             :         }
    1055             :     }
    1056             :     else
    1057             :     {
    1058           0 :         if( aLbLight2.GetSelectEntryCount() != 0 )
    1059             :         {
    1060           0 :             aLbLight2.SetNoSelection();
    1061           0 :             bUpdate = true;
    1062             :         }
    1063             :     }
    1064             :     // Light 2 (on/off)
    1065           0 :     eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTON_2);
    1066           0 :     if( eState != SFX_ITEM_DONTCARE )
    1067             :     {
    1068           0 :         bool bOn = ((const Svx3DLightOnOff2Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTON_2)).GetValue();
    1069           0 :         if( ( bOn && !GetUILightState( aBtnLight2 )) ||
    1070           0 :             ( !bOn && GetUILightState( aBtnLight2 )) )
    1071             :         {
    1072           0 :             SetUILightState( aBtnLight2, bOn );
    1073           0 :             bUpdate = true;
    1074             :         }
    1075           0 :         if( aBtnLight2.GetState() == TRISTATE_INDET )
    1076           0 :             aBtnLight2.Check( aBtnLight2.IsChecked() );
    1077             :     }
    1078             :     else
    1079             :     {
    1080           0 :         if( aBtnLight2.GetState() != TRISTATE_INDET )
    1081             :         {
    1082           0 :             aBtnLight2.SetState( TRISTATE_INDET );
    1083           0 :             bUpdate = true;
    1084             :         }
    1085             :     }
    1086             :     //Light 2 (Direction)
    1087           0 :     eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTDIRECTION_2);
    1088           0 :     if( eState != SFX_ITEM_DONTCARE )
    1089             :     {
    1090           0 :         bUpdate = true;
    1091             :     }
    1092             : 
    1093             :     //Light 3 (color)
    1094           0 :     eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTCOLOR_3);
    1095           0 :     if( eState != SFX_ITEM_DONTCARE )
    1096             :     {
    1097           0 :         aColor = ((const Svx3DLightcolor3Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTCOLOR_3)).GetValue();
    1098           0 :         ColorLB* pLb = &aLbLight3;
    1099           0 :         if( aColor != pLb->GetSelectEntryColor() )
    1100             :         {
    1101           0 :             LBSelectColor( pLb, aColor );
    1102           0 :             bUpdate = true;
    1103             :         }
    1104             :     }
    1105             :     else
    1106             :     {
    1107           0 :         if( aLbLight3.GetSelectEntryCount() != 0 )
    1108             :         {
    1109           0 :             aLbLight3.SetNoSelection();
    1110           0 :             bUpdate = true;
    1111             :         }
    1112             :     }
    1113             :     // Ligh 3 (on/off)
    1114           0 :     eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTON_3);
    1115           0 :     if( eState != SFX_ITEM_DONTCARE )
    1116             :     {
    1117           0 :         bool bOn = ((const Svx3DLightOnOff3Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTON_3)).GetValue();
    1118           0 :         if( ( bOn && !GetUILightState( aBtnLight3)) ||
    1119           0 :             ( !bOn && GetUILightState( aBtnLight3)) )
    1120             :         {
    1121           0 :             SetUILightState( aBtnLight3, bOn );
    1122           0 :             bUpdate = true;
    1123             :         }
    1124           0 :         if( aBtnLight3.GetState() == TRISTATE_INDET )
    1125           0 :             aBtnLight3.Check( aBtnLight3.IsChecked() );
    1126             :     }
    1127             :     else
    1128             :     {
    1129           0 :         if( aBtnLight3.GetState() != TRISTATE_INDET )
    1130             :         {
    1131           0 :             aBtnLight3.SetState( TRISTATE_INDET );
    1132           0 :             bUpdate = true;
    1133             :         }
    1134             :     }
    1135             :     // Light 3 (Direction)
    1136           0 :     eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTDIRECTION_3);
    1137           0 :     if( eState != SFX_ITEM_DONTCARE )
    1138             :     {
    1139           0 :         bUpdate = true;
    1140             :     }
    1141             : 
    1142             :     // Light 4 (Color)
    1143           0 :     eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTCOLOR_4);
    1144           0 :     if( eState != SFX_ITEM_DONTCARE )
    1145             :     {
    1146           0 :         aColor = ((const Svx3DLightcolor4Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTCOLOR_4)).GetValue();
    1147           0 :         ColorLB* pLb = &aLbLight4;
    1148           0 :         if( aColor != pLb->GetSelectEntryColor() )
    1149             :         {
    1150           0 :             LBSelectColor( pLb, aColor );
    1151           0 :             bUpdate = true;
    1152             :         }
    1153             :     }
    1154             :     else
    1155             :     {
    1156           0 :         if( aLbLight4.GetSelectEntryCount() != 0 )
    1157             :         {
    1158           0 :             aLbLight4.SetNoSelection();
    1159           0 :             bUpdate = true;
    1160             :         }
    1161             :     }
    1162             :     // Light 4 (on/off)
    1163           0 :     eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTON_4);
    1164           0 :     if( eState != SFX_ITEM_DONTCARE )
    1165             :     {
    1166           0 :         bool bOn = ((const Svx3DLightOnOff4Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTON_4)).GetValue();
    1167           0 :         if( ( bOn && !GetUILightState( aBtnLight4 )) ||
    1168           0 :             ( !bOn && GetUILightState( aBtnLight4 )) )
    1169             :         {
    1170           0 :             SetUILightState( aBtnLight4, bOn );
    1171           0 :             bUpdate = true;
    1172             :         }
    1173           0 :         if( aBtnLight4.GetState() == TRISTATE_INDET )
    1174           0 :             aBtnLight4.Check( aBtnLight4.IsChecked() );
    1175             :     }
    1176             :     else
    1177             :     {
    1178           0 :         if( aBtnLight4.GetState() != TRISTATE_INDET )
    1179             :         {
    1180           0 :             aBtnLight4.SetState( TRISTATE_INDET );
    1181           0 :             bUpdate = true;
    1182             :         }
    1183             :     }
    1184             :     // Light 4 (direction)
    1185           0 :     eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTDIRECTION_4);
    1186           0 :     if( eState != SFX_ITEM_DONTCARE )
    1187             :     {
    1188           0 :         bUpdate = true;
    1189             :     }
    1190             : 
    1191             :     // Light 5 (color)
    1192           0 :     eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTCOLOR_5);
    1193           0 :     if( eState != SFX_ITEM_DONTCARE )
    1194             :     {
    1195           0 :         aColor = ((const Svx3DLightcolor5Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTCOLOR_5)).GetValue();
    1196           0 :         ColorLB* pLb = &aLbLight5;
    1197           0 :         if( aColor != pLb->GetSelectEntryColor() )
    1198             :         {
    1199           0 :             LBSelectColor( pLb, aColor );
    1200           0 :             bUpdate = true;
    1201             :         }
    1202             :     }
    1203             :     else
    1204             :     {
    1205           0 :         if( aLbLight5.GetSelectEntryCount() != 0 )
    1206             :         {
    1207           0 :             aLbLight5.SetNoSelection();
    1208           0 :             bUpdate = true;
    1209             :         }
    1210             :     }
    1211             :     // Light 5 (on/off)
    1212           0 :     eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTON_5);
    1213           0 :     if( eState != SFX_ITEM_DONTCARE )
    1214             :     {
    1215           0 :         bool bOn = ((const Svx3DLightOnOff5Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTON_5)).GetValue();
    1216           0 :         if( ( bOn && !GetUILightState( aBtnLight5 )) ||
    1217           0 :             ( !bOn && GetUILightState( aBtnLight5 )) )
    1218             :         {
    1219           0 :             SetUILightState( aBtnLight5, bOn );
    1220           0 :             bUpdate = true;
    1221             :         }
    1222           0 :         if( aBtnLight5.GetState() == TRISTATE_INDET )
    1223           0 :             aBtnLight5.Check( aBtnLight5.IsChecked() );
    1224             :     }
    1225             :     else
    1226             :     {
    1227           0 :         if( aBtnLight5.GetState() != TRISTATE_INDET )
    1228             :         {
    1229           0 :             aBtnLight5.SetState( TRISTATE_INDET );
    1230           0 :             bUpdate = true;
    1231             :         }
    1232             :     }
    1233             :     // Light 5 (direction)
    1234           0 :     eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTDIRECTION_5);
    1235           0 :     if( eState != SFX_ITEM_DONTCARE )
    1236             :     {
    1237           0 :         bUpdate = true;
    1238             :     }
    1239             : 
    1240             :     // Light 6 (color)
    1241           0 :     eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTCOLOR_6);
    1242           0 :     if( eState != SFX_ITEM_DONTCARE )
    1243             :     {
    1244           0 :         aColor = ((const Svx3DLightcolor6Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTCOLOR_6)).GetValue();
    1245           0 :         ColorLB* pLb = &aLbLight6;
    1246           0 :         if( aColor != pLb->GetSelectEntryColor() )
    1247             :         {
    1248           0 :             LBSelectColor( pLb, aColor );
    1249           0 :             bUpdate = true;
    1250             :         }
    1251             :     }
    1252             :     else
    1253             :     {
    1254           0 :         if( aLbLight6.GetSelectEntryCount() != 0 )
    1255             :         {
    1256           0 :             aLbLight6.SetNoSelection();
    1257           0 :             bUpdate = true;
    1258             :         }
    1259             :     }
    1260             :     // Light 6 (on/off)
    1261           0 :     eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTON_6);
    1262           0 :     if( eState != SFX_ITEM_DONTCARE )
    1263             :     {
    1264           0 :         bool bOn = ((const Svx3DLightOnOff6Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTON_6)).GetValue();
    1265           0 :         if( ( bOn && !GetUILightState( aBtnLight6 )) ||
    1266           0 :             ( !bOn && GetUILightState( aBtnLight6 )) )
    1267             :         {
    1268           0 :             SetUILightState( aBtnLight6, bOn );
    1269           0 :             bUpdate = true;
    1270             :         }
    1271           0 :         if( aBtnLight6.GetState() == TRISTATE_INDET )
    1272           0 :             aBtnLight6.Check( aBtnLight6.IsChecked() );
    1273             :     }
    1274             :     else
    1275             :     {
    1276           0 :         if( aBtnLight6.GetState() != TRISTATE_INDET )
    1277             :         {
    1278           0 :             aBtnLight6.SetState( TRISTATE_INDET );
    1279           0 :             bUpdate = true;
    1280             :         }
    1281             :     }
    1282             :     // Light 6 (direction)
    1283           0 :     eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTDIRECTION_6);
    1284           0 :     if( eState != SFX_ITEM_DONTCARE )
    1285             :     {
    1286           0 :         bUpdate = true;
    1287             :     }
    1288             : 
    1289             :     // Light 7 (color)
    1290           0 :     eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTCOLOR_7);
    1291           0 :     if( eState != SFX_ITEM_DONTCARE )
    1292             :     {
    1293           0 :         aColor = ((const Svx3DLightcolor7Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTCOLOR_7)).GetValue();
    1294           0 :         ColorLB* pLb = &aLbLight7;
    1295           0 :         if( aColor != pLb->GetSelectEntryColor() )
    1296             :         {
    1297           0 :             LBSelectColor( pLb, aColor );
    1298           0 :             bUpdate = true;
    1299             :         }
    1300             :     }
    1301             :     else
    1302             :     {
    1303           0 :         if( aLbLight7.GetSelectEntryCount() != 0 )
    1304             :         {
    1305           0 :             aLbLight7.SetNoSelection();
    1306           0 :             bUpdate = true;
    1307             :         }
    1308             :     }
    1309             :     // Light 7 (on/off)
    1310           0 :     eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTON_7);
    1311           0 :     if( eState != SFX_ITEM_DONTCARE )
    1312             :     {
    1313           0 :         bool bOn = ((const Svx3DLightOnOff7Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTON_7)).GetValue();
    1314           0 :         if( ( bOn && !GetUILightState( aBtnLight7 )) ||
    1315           0 :             ( !bOn && GetUILightState( aBtnLight7 )) )
    1316             :         {
    1317           0 :             SetUILightState( aBtnLight7 , bOn );
    1318           0 :             bUpdate = true;
    1319             :         }
    1320           0 :         if( aBtnLight7.GetState() == TRISTATE_INDET )
    1321           0 :             aBtnLight7.Check( aBtnLight7.IsChecked() );
    1322             :     }
    1323             :     else
    1324             :     {
    1325           0 :         if( aBtnLight7.GetState() != TRISTATE_INDET )
    1326             :         {
    1327           0 :             aBtnLight7.SetState( TRISTATE_INDET );
    1328           0 :             bUpdate = true;
    1329             :         }
    1330             :     }
    1331             :     // Light 7 (direction)
    1332           0 :     eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTDIRECTION_7);
    1333           0 :     if( eState != SFX_ITEM_DONTCARE )
    1334             :     {
    1335           0 :         bUpdate = true;
    1336             :     }
    1337             : 
    1338             :     // Light 8 (color)
    1339           0 :     eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTCOLOR_8);
    1340           0 :     if( eState != SFX_ITEM_DONTCARE )
    1341             :     {
    1342           0 :         aColor = ((const Svx3DLightcolor8Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTCOLOR_8)).GetValue();
    1343           0 :         ColorLB* pLb = &aLbLight8;
    1344           0 :         if( aColor != pLb->GetSelectEntryColor() )
    1345             :         {
    1346           0 :             LBSelectColor( pLb, aColor );
    1347           0 :             bUpdate = true;
    1348             :         }
    1349             :     }
    1350             :     else
    1351             :     {
    1352           0 :         if( aLbLight8.GetSelectEntryCount() != 0 )
    1353             :         {
    1354           0 :             aLbLight8.SetNoSelection();
    1355           0 :             bUpdate = true;
    1356             :         }
    1357             :     }
    1358             :     // Light 8 (on/off)
    1359           0 :     eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTON_8);
    1360           0 :     if( eState != SFX_ITEM_DONTCARE )
    1361             :     {
    1362           0 :         bool bOn = ((const Svx3DLightOnOff8Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTON_8)).GetValue();
    1363           0 :         if( ( bOn && !GetUILightState( aBtnLight8 )) ||
    1364           0 :             ( !bOn && GetUILightState( aBtnLight8 )) )
    1365             :         {
    1366           0 :             SetUILightState( aBtnLight8, bOn );
    1367           0 :             bUpdate = true;
    1368             :         }
    1369           0 :         if( aBtnLight8.GetState() == TRISTATE_INDET )
    1370           0 :             aBtnLight8.Check( aBtnLight8.IsChecked() );
    1371             :     }
    1372             :     else
    1373             :     {
    1374           0 :         if( aBtnLight8.GetState() != TRISTATE_INDET )
    1375             :         {
    1376           0 :             aBtnLight8.SetState( TRISTATE_INDET );
    1377           0 :             bUpdate = true;
    1378             :         }
    1379             :     }
    1380             :     // Light 8 (direction)
    1381           0 :     eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTDIRECTION_8);
    1382           0 :     if( eState != SFX_ITEM_DONTCARE )
    1383             :     {
    1384           0 :         bUpdate = true;
    1385             :     }
    1386             : 
    1387             :     // Ambient light
    1388           0 :     eState = rAttrs.GetItemState(SDRATTR_3DSCENE_AMBIENTCOLOR);
    1389           0 :     if( eState != SFX_ITEM_DONTCARE )
    1390             :     {
    1391           0 :         aColor = ((const Svx3DAmbientcolorItem&)rAttrs.Get(SDRATTR_3DSCENE_AMBIENTCOLOR)).GetValue();
    1392           0 :         ColorLB* pLb = &aLbAmbientlight;
    1393           0 :         if( aColor != pLb->GetSelectEntryColor() )
    1394             :         {
    1395           0 :             LBSelectColor( pLb, aColor );
    1396           0 :             bUpdate = true;
    1397             :         }
    1398             :     }
    1399             :     else
    1400             :     {
    1401           0 :         if( aLbAmbientlight.GetSelectEntryCount() != 0 )
    1402             :         {
    1403           0 :             aLbAmbientlight.SetNoSelection();
    1404           0 :             bUpdate = true;
    1405             :         }
    1406             :     }
    1407             : 
    1408             : 
    1409             : // Textures
    1410             :     // Art
    1411           0 :     if( bBitmap )
    1412             :     {
    1413           0 :         eState = rAttrs.GetItemState(SDRATTR_3DOBJ_TEXTURE_KIND);
    1414           0 :         if( eState != SFX_ITEM_DONTCARE )
    1415             :         {
    1416           0 :             sal_uInt16 nValue = ((const Svx3DTextureKindItem&)rAttrs.Get(SDRATTR_3DOBJ_TEXTURE_KIND)).GetValue();
    1417             : 
    1418           0 :             if( ( !aBtnTexLuminance.IsChecked() && nValue == 1 ) ||
    1419           0 :                 ( !aBtnTexColor.IsChecked() && nValue == 3 ) )
    1420             :             {
    1421           0 :                 aBtnTexLuminance.Check( nValue == 1 );
    1422           0 :                 aBtnTexColor.Check( nValue == 3 );
    1423           0 :                 bUpdate = true;
    1424             :             }
    1425             :         }
    1426             :         else
    1427             :         {
    1428           0 :             if( aBtnTexLuminance.IsChecked() ||
    1429           0 :                 aBtnTexColor.IsChecked() )
    1430             :             {
    1431           0 :                 aBtnTexLuminance.Check( false );
    1432           0 :                 aBtnTexColor.Check( false );
    1433           0 :                 bUpdate = true;
    1434             :             }
    1435             :         }
    1436             : 
    1437             :         // Mode
    1438           0 :         eState = rAttrs.GetItemState(SDRATTR_3DOBJ_TEXTURE_MODE);
    1439           0 :         if( eState != SFX_ITEM_DONTCARE )
    1440             :         {
    1441           0 :             sal_uInt16 nValue = ((const Svx3DTextureModeItem&)rAttrs.Get(SDRATTR_3DOBJ_TEXTURE_MODE)).GetValue();
    1442             : 
    1443           0 :             if( ( !aBtnTexReplace.IsChecked() && nValue == 1 ) ||
    1444           0 :                 ( !aBtnTexModulate.IsChecked() && nValue == 2 ) )
    1445             :             {
    1446           0 :                 aBtnTexReplace.Check( nValue == 1 );
    1447           0 :                 aBtnTexModulate.Check( nValue == 2 );
    1448           0 :                 bUpdate = true;
    1449             :             }
    1450             :         }
    1451             :         else
    1452             :         {
    1453           0 :             if( aBtnTexReplace.IsChecked() ||
    1454           0 :                 aBtnTexModulate.IsChecked() )
    1455             :             {
    1456           0 :                 aBtnTexReplace.Check( false );
    1457           0 :                 aBtnTexModulate.Check( false );
    1458           0 :                 bUpdate = true;
    1459             :             }
    1460             :         }
    1461             : 
    1462             :         // Projection X
    1463           0 :         eState = rAttrs.GetItemState(SDRATTR_3DOBJ_TEXTURE_PROJ_X);
    1464           0 :         if( eState != SFX_ITEM_DONTCARE )
    1465             :         {
    1466           0 :             sal_uInt16 nValue = ((const Svx3DTextureProjectionXItem&)rAttrs.Get(SDRATTR_3DOBJ_TEXTURE_PROJ_X)).GetValue();
    1467             : 
    1468           0 :             if( ( !aBtnTexObjectX.IsChecked() && nValue == 0 ) ||
    1469           0 :                 ( !aBtnTexParallelX.IsChecked() && nValue == 1 ) ||
    1470           0 :                 ( !aBtnTexCircleX.IsChecked() && nValue == 2 ) )
    1471             :             {
    1472           0 :                 aBtnTexObjectX.Check( nValue == 0 );
    1473           0 :                 aBtnTexParallelX.Check( nValue == 1 );
    1474           0 :                 aBtnTexCircleX.Check( nValue == 2 );
    1475           0 :                 bUpdate = true;
    1476             :             }
    1477             :         }
    1478             :         else
    1479             :         {
    1480           0 :             if( aBtnTexObjectX.IsChecked() ||
    1481           0 :                 aBtnTexParallelX.IsChecked() ||
    1482           0 :                 aBtnTexCircleX.IsChecked() )
    1483             :             {
    1484           0 :                 aBtnTexObjectX.Check( false );
    1485           0 :                 aBtnTexParallelX.Check( false );
    1486           0 :                 aBtnTexCircleX.Check( false );
    1487           0 :                 bUpdate = true;
    1488             :             }
    1489             :         }
    1490             : 
    1491             :         // Projection Y
    1492           0 :         eState = rAttrs.GetItemState(SDRATTR_3DOBJ_TEXTURE_PROJ_Y);
    1493           0 :         if( eState != SFX_ITEM_DONTCARE )
    1494             :         {
    1495           0 :             sal_uInt16 nValue = ((const Svx3DTextureProjectionYItem&)rAttrs.Get(SDRATTR_3DOBJ_TEXTURE_PROJ_Y)).GetValue();
    1496             : 
    1497           0 :             if( ( !aBtnTexObjectY.IsChecked() && nValue == 0 ) ||
    1498           0 :                 ( !aBtnTexParallelY.IsChecked() && nValue == 1 ) ||
    1499           0 :                 ( !aBtnTexCircleY.IsChecked() && nValue == 2 ) )
    1500             :             {
    1501           0 :                 aBtnTexObjectY.Check( nValue == 0 );
    1502           0 :                 aBtnTexParallelY.Check( nValue == 1 );
    1503           0 :                 aBtnTexCircleY.Check( nValue == 2 );
    1504           0 :                 bUpdate = true;
    1505             :             }
    1506             :         }
    1507             :         else
    1508             :         {
    1509           0 :             if( aBtnTexObjectY.IsChecked() ||
    1510           0 :                 aBtnTexParallelY.IsChecked() ||
    1511           0 :                 aBtnTexCircleY.IsChecked() )
    1512             :             {
    1513           0 :                 aBtnTexObjectY.Check( false );
    1514           0 :                 aBtnTexParallelY.Check( false );
    1515           0 :                 aBtnTexCircleY.Check( false );
    1516           0 :                 bUpdate = true;
    1517             :             }
    1518             :         }
    1519             : 
    1520             :         // Filter
    1521           0 :         eState = rAttrs.GetItemState(SDRATTR_3DOBJ_TEXTURE_FILTER);
    1522           0 :         if( eState != SFX_ITEM_DONTCARE )
    1523             :         {
    1524           0 :             bool bValue = ((const Svx3DTextureFilterItem&)rAttrs.Get(SDRATTR_3DOBJ_TEXTURE_FILTER)).GetValue();
    1525           0 :             if( bValue != aBtnTexFilter.IsChecked() )
    1526             :             {
    1527           0 :                 aBtnTexFilter.Check( bValue );
    1528           0 :                 bUpdate = true;
    1529             :             }
    1530           0 :             if( aBtnTexFilter.GetState() == TRISTATE_INDET )
    1531           0 :                 aBtnTexFilter.Check( bValue );
    1532             :         }
    1533             :         else
    1534             :         {
    1535           0 :             if( aBtnTexFilter.GetState() != TRISTATE_INDET )
    1536             :             {
    1537           0 :                 aBtnTexFilter.SetState( TRISTATE_INDET );
    1538           0 :                 bUpdate = true;
    1539             :             }
    1540             :         }
    1541             :     }
    1542             : 
    1543             : 
    1544             :     // Material Favorites
    1545           0 :     aLbMatFavorites.SelectEntryPos( 0 );
    1546             : 
    1547             :     // Object color
    1548           0 :     eState = rAttrs.GetItemState(XATTR_FILLCOLOR);
    1549           0 :     if( eState != SFX_ITEM_DONTCARE )
    1550             :     {
    1551           0 :         aColor = ((const XFillColorItem&)rAttrs.Get(XATTR_FILLCOLOR)).GetColorValue();
    1552           0 :         ColorLB* pLb = &aLbMatColor;
    1553           0 :         if( aColor != pLb->GetSelectEntryColor() )
    1554             :         {
    1555           0 :             LBSelectColor( pLb, aColor );
    1556           0 :             bUpdate = true;
    1557             :         }
    1558             :     }
    1559             :     else
    1560             :     {
    1561           0 :         if( aLbMatColor.GetSelectEntryCount() != 0 )
    1562             :         {
    1563           0 :             aLbMatColor.SetNoSelection();
    1564           0 :             bUpdate = true;
    1565             :         }
    1566             :     }
    1567             : 
    1568             :     // Self-luminous color
    1569           0 :     eState = rAttrs.GetItemState(SDRATTR_3DOBJ_MAT_EMISSION);
    1570           0 :     if( eState != SFX_ITEM_DONTCARE )
    1571             :     {
    1572           0 :         aColor = ((const Svx3DMaterialEmissionItem&)rAttrs.Get(SDRATTR_3DOBJ_MAT_EMISSION)).GetValue();
    1573           0 :         ColorLB* pLb = &aLbMatEmission;
    1574           0 :         if( aColor != pLb->GetSelectEntryColor() )
    1575             :         {
    1576           0 :             LBSelectColor( pLb, aColor );
    1577           0 :             bUpdate = true;
    1578             :         }
    1579             :     }
    1580             :     else
    1581             :     {
    1582           0 :         if( aLbMatEmission.GetSelectEntryCount() != 0 )
    1583             :         {
    1584           0 :             aLbMatEmission.SetNoSelection();
    1585           0 :             bUpdate = true;
    1586             :         }
    1587             :     }
    1588             : 
    1589             :     // Specular
    1590           0 :     eState = rAttrs.GetItemState(SDRATTR_3DOBJ_MAT_SPECULAR);
    1591           0 :     if( eState != SFX_ITEM_DONTCARE )
    1592             :     {
    1593           0 :         aColor = ((const Svx3DMaterialSpecularItem&)rAttrs.Get(SDRATTR_3DOBJ_MAT_SPECULAR)).GetValue();
    1594           0 :         ColorLB* pLb = &aLbMatSpecular;
    1595           0 :         if( aColor != pLb->GetSelectEntryColor() )
    1596             :         {
    1597           0 :             LBSelectColor( pLb, aColor );
    1598           0 :             bUpdate = true;
    1599             :         }
    1600             :     }
    1601             :     else
    1602             :     {
    1603           0 :         if( aLbMatSpecular.GetSelectEntryCount() != 0 )
    1604             :         {
    1605           0 :             aLbMatSpecular.SetNoSelection();
    1606           0 :             bUpdate = true;
    1607             :         }
    1608             :     }
    1609             : 
    1610             :     // Specular Intensity
    1611           0 :     eState = rAttrs.GetItemState(SDRATTR_3DOBJ_MAT_SPECULAR_INTENSITY);
    1612           0 :     if( eState != SFX_ITEM_DONTCARE )
    1613             :     {
    1614           0 :         sal_uInt16 nValue = ((const Svx3DMaterialSpecularIntensityItem&)rAttrs.Get(SDRATTR_3DOBJ_MAT_SPECULAR_INTENSITY)).GetValue();
    1615           0 :         if( nValue != aMtrMatSpecularIntensity.GetValue() )
    1616             :         {
    1617           0 :             aMtrMatSpecularIntensity.SetValue( nValue );
    1618           0 :             bUpdate = true;
    1619             :         }
    1620             :     }
    1621             :     else
    1622             :     {
    1623           0 :         if( !aMtrMatSpecularIntensity.IsEmptyFieldValue() )
    1624             :         {
    1625           0 :             aMtrMatSpecularIntensity.SetEmptyFieldValue();
    1626           0 :             bUpdate = true;
    1627             :         }
    1628             :     }
    1629             : 
    1630             : 
    1631             : // Other
    1632             :     // Perspective
    1633           0 :     eState = rAttrs.GetItemState(SDRATTR_3DSCENE_PERSPECTIVE);
    1634           0 :     if( eState != SFX_ITEM_DONTCARE )
    1635             :     {
    1636           0 :         ProjectionType ePT = (ProjectionType)((const Svx3DPerspectiveItem&)rAttrs.Get(SDRATTR_3DSCENE_PERSPECTIVE)).GetValue();
    1637           0 :         if( ( !aBtnPerspective.IsChecked() && ePT == PR_PERSPECTIVE ) ||
    1638           0 :             ( aBtnPerspective.IsChecked() && ePT == PR_PARALLEL ) )
    1639             :         {
    1640           0 :             aBtnPerspective.Check( ePT == PR_PERSPECTIVE );
    1641           0 :             bUpdate = true;
    1642             :         }
    1643           0 :         if( aBtnPerspective.GetState() == TRISTATE_INDET )
    1644           0 :             aBtnPerspective.Check( ePT == PR_PERSPECTIVE );
    1645             :     }
    1646             :     else
    1647             :     {
    1648           0 :         if( aBtnPerspective.GetState() != TRISTATE_INDET )
    1649             :         {
    1650           0 :             aBtnPerspective.SetState( TRISTATE_INDET );
    1651           0 :             bUpdate = true;
    1652             :         }
    1653             :     }
    1654             : 
    1655           0 :     if( !bUpdate && !bOnly3DChanged )
    1656             :     {
    1657             :         // however the 2D attributes may be different. Compare these and decide
    1658             : 
    1659           0 :         bUpdate = true;
    1660             :     }
    1661             : 
    1662           0 :     if( bUpdate || bOnly3DChanged )
    1663             :     {
    1664             :         // Update preview
    1665           0 :         SfxItemSet aSet(rAttrs);
    1666             : 
    1667             :         // set LineStyle hard to XLINE_NONE when it's not set so that
    1668             :         // the default (XLINE_SOLID) is not used for 3d preview
    1669           0 :         if(SFX_ITEM_SET != aSet.GetItemState(XATTR_LINESTYLE, false))
    1670           0 :             aSet.Put(XLineStyleItem(XLINE_NONE));
    1671             : 
    1672             :         // set FillColor hard to WHITE when it's SFX_ITEM_DONTCARE so that
    1673             :         // the default (Blue7) is not used for 3d preview
    1674           0 :         if(SFX_ITEM_DONTCARE == aSet.GetItemState(XATTR_FILLCOLOR, false))
    1675           0 :             aSet.Put(XFillColorItem(OUString(), Color(COL_WHITE)));
    1676             : 
    1677           0 :         aCtlPreview.Set3DAttributes(aSet);
    1678           0 :         aCtlLightPreview.GetSvx3DLightControl().Set3DAttributes(aSet);
    1679             : 
    1680             :         // try to select light corresponding to active button
    1681           0 :         sal_uInt32 nNumber(0xffffffff);
    1682             : 
    1683           0 :         if(aBtnLight1.IsChecked())
    1684           0 :             nNumber = 0;
    1685           0 :         else if(aBtnLight2.IsChecked())
    1686           0 :             nNumber = 1;
    1687           0 :         else if(aBtnLight3.IsChecked())
    1688           0 :             nNumber = 2;
    1689           0 :         else if(aBtnLight4.IsChecked())
    1690           0 :             nNumber = 3;
    1691           0 :         else if(aBtnLight5.IsChecked())
    1692           0 :             nNumber = 4;
    1693           0 :         else if(aBtnLight6.IsChecked())
    1694           0 :             nNumber = 5;
    1695           0 :         else if(aBtnLight7.IsChecked())
    1696           0 :             nNumber = 6;
    1697           0 :         else if(aBtnLight8.IsChecked())
    1698           0 :             nNumber = 7;
    1699             : 
    1700           0 :         if(nNumber != 0xffffffff)
    1701             :         {
    1702           0 :             aCtlLightPreview.GetSvx3DLightControl().SelectLight(nNumber);
    1703           0 :         }
    1704             :     }
    1705             : 
    1706             :     // handle state of converts possible
    1707           0 :     aBtnConvertTo3D.Enable(pConvertTo3DItem->GetState());
    1708           0 :     aBtnLatheObject.Enable(pConvertTo3DLatheItem->GetState());
    1709           0 : }
    1710             : 
    1711             : 
    1712           0 : void Svx3DWin::GetAttr( SfxItemSet& rAttrs )
    1713             : {
    1714             :     // get remembered 2d attributes from the dialog
    1715           0 :     if(mpRemember2DAttributes)
    1716             :     {
    1717           0 :         SfxWhichIter aIter(*mpRemember2DAttributes);
    1718           0 :         sal_uInt16 nWhich(aIter.FirstWhich());
    1719             : 
    1720           0 :         while(nWhich)
    1721             :         {
    1722           0 :             SfxItemState eState = mpRemember2DAttributes->GetItemState(nWhich, false);
    1723           0 :             if(SFX_ITEM_DONTCARE == eState)
    1724           0 :                 rAttrs.InvalidateItem(nWhich);
    1725           0 :             else if(SFX_ITEM_SET == eState)
    1726           0 :                 rAttrs.Put(mpRemember2DAttributes->Get(nWhich, false));
    1727             : 
    1728           0 :             nWhich = aIter.NextWhich();
    1729           0 :         }
    1730             :     }
    1731             : 
    1732             : //Others must stand as the front on all sides
    1733             :     // Perspective
    1734           0 :     if( aBtnPerspective.GetState() != TRISTATE_INDET )
    1735             :     {
    1736             :         sal_uInt16 nValue;
    1737           0 :         if( aBtnPerspective.IsChecked() )
    1738           0 :             nValue = PR_PERSPECTIVE;
    1739             :         else
    1740           0 :             nValue = PR_PARALLEL;
    1741           0 :         rAttrs.Put(Svx3DPerspectiveItem(nValue));
    1742             :     }
    1743             :     else
    1744           0 :         rAttrs.InvalidateItem(SDRATTR_3DSCENE_PERSPECTIVE);
    1745             : 
    1746             : // Geometry
    1747             :     // Possible determine PoolUnit (in this case this has not happened in Update() )
    1748           0 :     if( !mpImpl->pPool )
    1749             :     {
    1750             :         OSL_FAIL( "No Pool in GetAttr()! May be incompatible to drviewsi.cxx ?" );
    1751           0 :         mpImpl->pPool = rAttrs.GetPool();
    1752             :         DBG_ASSERT( mpImpl->pPool, "Where is the Pool?" );
    1753           0 :         ePoolUnit = mpImpl->pPool->GetMetric( SID_ATTR_LINE_WIDTH );
    1754             : 
    1755           0 :         eFUnit = GetModuleFieldUnit( rAttrs );
    1756             :     }
    1757             : 
    1758             :     // Number of segments (horizontal)
    1759           0 :     if( !aNumHorizontal.IsEmptyFieldValue() )
    1760             :     {
    1761           0 :         sal_uInt32 nValue = static_cast<sal_uInt32>(aNumHorizontal.GetValue());
    1762           0 :         rAttrs.Put(Svx3DHorizontalSegmentsItem(nValue));
    1763             :     }
    1764             :     else
    1765           0 :         rAttrs.InvalidateItem(SDRATTR_3DOBJ_HORZ_SEGS);
    1766             : 
    1767             :     //  Number of segments (vertical)
    1768           0 :     if( !aNumVertical.IsEmptyFieldValue() )
    1769             :     {
    1770           0 :         sal_uInt32 nValue = static_cast<sal_uInt32>(aNumVertical.GetValue());
    1771           0 :         rAttrs.Put(Svx3DVerticalSegmentsItem(nValue));
    1772             :     }
    1773             :     else
    1774           0 :         rAttrs.InvalidateItem(SDRATTR_3DOBJ_VERT_SEGS);
    1775             : 
    1776             :     // Depth
    1777           0 :     if( !aMtrDepth.IsEmptyFieldValue() )
    1778             :     {
    1779           0 :         sal_uInt32 nValue = GetCoreValue( aMtrDepth, ePoolUnit );
    1780           0 :         rAttrs.Put(Svx3DDepthItem(nValue));
    1781             :     }
    1782             :     else
    1783           0 :         rAttrs.InvalidateItem(SDRATTR_3DOBJ_DEPTH);
    1784             : 
    1785             :     // Double-sided
    1786           0 :     TriState eState = aBtnDoubleSided.GetState();
    1787           0 :     if( eState != TRISTATE_INDET )
    1788             :     {
    1789           0 :         sal_Bool bValue = TRISTATE_TRUE == eState;
    1790           0 :         rAttrs.Put(Svx3DDoubleSidedItem(bValue));
    1791             :     }
    1792             :     else
    1793           0 :         rAttrs.InvalidateItem(SDRATTR_3DOBJ_DOUBLE_SIDED);
    1794             : 
    1795             :     // Edge rounding
    1796           0 :     if( !aMtrPercentDiagonal.IsEmptyFieldValue() )
    1797             :     {
    1798           0 :         sal_uInt16 nValue = (sal_uInt16) aMtrPercentDiagonal.GetValue();
    1799           0 :         rAttrs.Put(Svx3DPercentDiagonalItem(nValue));
    1800             :     }
    1801             :     else
    1802           0 :         rAttrs.InvalidateItem(SDRATTR_3DOBJ_PERCENT_DIAGONAL);
    1803             : 
    1804             :     // Depth scale
    1805           0 :     if( !aMtrBackscale.IsEmptyFieldValue() )
    1806             :     {
    1807           0 :         sal_uInt16 nValue = (sal_uInt16)aMtrBackscale.GetValue();
    1808           0 :         rAttrs.Put(Svx3DBackscaleItem(nValue));
    1809             :     }
    1810             :     else
    1811           0 :         rAttrs.InvalidateItem(SDRATTR_3DOBJ_BACKSCALE);
    1812             : 
    1813             :     // End angle
    1814           0 :     if( !aMtrEndAngle.IsEmptyFieldValue() )
    1815             :     {
    1816           0 :         sal_uInt16 nValue = (sal_uInt16)aMtrEndAngle.GetValue();
    1817           0 :         rAttrs.Put(Svx3DEndAngleItem(nValue));
    1818             :     }
    1819             :     else
    1820           0 :         rAttrs.InvalidateItem(SDRATTR_3DOBJ_END_ANGLE);
    1821             : 
    1822             :     // Normal type
    1823           0 :     sal_uInt16 nValue = 99;
    1824           0 :     if( aBtnNormalsObj.IsChecked() )
    1825           0 :         nValue = 0;
    1826           0 :     else if( aBtnNormalsFlat.IsChecked() )
    1827           0 :         nValue = 1;
    1828           0 :     else if( aBtnNormalsSphere.IsChecked() )
    1829           0 :         nValue = 2;
    1830             : 
    1831           0 :     if( nValue <= 2 )
    1832           0 :         rAttrs.Put(Svx3DNormalsKindItem(nValue));
    1833             :     else
    1834           0 :         rAttrs.InvalidateItem(SDRATTR_3DOBJ_NORMALS_KIND);
    1835             : 
    1836             :     // Normal inverted
    1837           0 :     eState = aBtnNormalsInvert.GetState();
    1838           0 :     if( eState != TRISTATE_INDET )
    1839             :     {
    1840           0 :         sal_Bool bValue = TRISTATE_TRUE == eState;
    1841           0 :         rAttrs.Put(Svx3DNormalsInvertItem(bValue));
    1842             :     }
    1843             :     else
    1844           0 :         rAttrs.InvalidateItem(SDRATTR_3DOBJ_NORMALS_INVERT);
    1845             : 
    1846             :     // 2-sided lighting
    1847           0 :     eState = aBtnTwoSidedLighting.GetState();
    1848           0 :     if( eState != TRISTATE_INDET )
    1849             :     {
    1850           0 :         sal_Bool bValue = TRISTATE_TRUE == eState;
    1851           0 :         rAttrs.Put(Svx3DTwoSidedLightingItem(bValue));
    1852             :     }
    1853             :     else
    1854           0 :         rAttrs.InvalidateItem(SDRATTR_3DSCENE_TWO_SIDED_LIGHTING);
    1855             : 
    1856             : // Representation
    1857             :     // Shade mode
    1858           0 :     if( aLbShademode.GetSelectEntryCount() )
    1859             :     {
    1860           0 :         nValue = aLbShademode.GetSelectEntryPos();
    1861           0 :         rAttrs.Put(Svx3DShadeModeItem(nValue));
    1862             :     }
    1863             :     else
    1864           0 :         rAttrs.InvalidateItem(SDRATTR_3DSCENE_SHADE_MODE);
    1865             : 
    1866             :     // 3D-Shadow
    1867           0 :     eState = aBtnShadow3d.GetState();
    1868           0 :     if( eState != TRISTATE_INDET )
    1869             :     {
    1870           0 :         sal_Bool bValue = TRISTATE_TRUE == eState;
    1871           0 :         rAttrs.Put(Svx3DShadow3DItem(bValue));
    1872           0 :         rAttrs.Put(SdrShadowItem(bValue));
    1873             :     }
    1874             :     else
    1875             :     {
    1876           0 :         rAttrs.InvalidateItem(SDRATTR_3DOBJ_SHADOW_3D);
    1877           0 :         rAttrs.InvalidateItem(SDRATTR_SHADOW);
    1878             :     }
    1879             : 
    1880             :     // Slant (Shadow)
    1881           0 :     if( !aMtrSlant.IsEmptyFieldValue() )
    1882             :     {
    1883           0 :         sal_uInt16 nValue2 = (sal_uInt16) aMtrSlant.GetValue();
    1884           0 :         rAttrs.Put(Svx3DShadowSlantItem(nValue2));
    1885             :     }
    1886             :     else
    1887           0 :         rAttrs.InvalidateItem(SDRATTR_3DSCENE_SHADOW_SLANT);
    1888             : 
    1889             :     // Distance
    1890           0 :     if( !aMtrDistance.IsEmptyFieldValue() )
    1891             :     {
    1892           0 :         sal_uInt32 nValue2 = GetCoreValue( aMtrDistance, ePoolUnit );
    1893           0 :         rAttrs.Put(Svx3DDistanceItem(nValue2));
    1894             :     }
    1895             :     else
    1896           0 :         rAttrs.InvalidateItem(SDRATTR_3DSCENE_DISTANCE);
    1897             : 
    1898             :     // Focal length
    1899           0 :     if( !aMtrFocalLength.IsEmptyFieldValue() )
    1900             :     {
    1901           0 :         sal_uInt32 nValue2 = GetCoreValue( aMtrFocalLength, ePoolUnit );
    1902           0 :         rAttrs.Put(Svx3DFocalLengthItem(nValue2));
    1903             :     }
    1904             :     else
    1905           0 :         rAttrs.InvalidateItem(SDRATTR_3DSCENE_FOCAL_LENGTH);
    1906             : 
    1907             : // Lighting
    1908           0 :     Image aImg;
    1909           0 :     basegfx::B3DVector aVector;
    1910           0 :     Color aColor;
    1911           0 :     const SfxItemSet aLightItemSet(aCtlLightPreview.GetSvx3DLightControl().Get3DAttributes());
    1912             : 
    1913             :     // Light 1 color
    1914           0 :     if( aLbLight1.GetSelectEntryCount() )
    1915             :     {
    1916           0 :         aColor = aLbLight1.GetSelectEntryColor();
    1917           0 :         rAttrs.Put(Svx3DLightcolor1Item(aColor));
    1918             :     }
    1919             :     else
    1920           0 :         rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTCOLOR_1);
    1921             :     // Light 1 (on/off)
    1922           0 :     eState = aBtnLight1.GetState();
    1923           0 :     if( eState != TRISTATE_INDET )
    1924             :     {
    1925           0 :         sal_Bool bValue = GetUILightState( aBtnLight1 );
    1926           0 :         rAttrs.Put(Svx3DLightOnOff1Item(bValue));
    1927             : 
    1928             :         // Light 1 (direction)
    1929           0 :         if( bValue )
    1930             :         {
    1931           0 :             rAttrs.Put(aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_1));
    1932             :         }
    1933             :     }
    1934             :     else
    1935           0 :         rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTON_1);
    1936             : 
    1937             : 
    1938             :     // Light 2 color
    1939           0 :     if( aLbLight2.GetSelectEntryCount() )
    1940             :     {
    1941           0 :         aColor = aLbLight2.GetSelectEntryColor();
    1942           0 :         rAttrs.Put(Svx3DLightcolor2Item(aColor));
    1943             :     }
    1944             :     else
    1945           0 :         rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTCOLOR_2);
    1946             :     // Light 2 (on/off)
    1947           0 :     eState = aBtnLight2.GetState();
    1948           0 :     if( eState != TRISTATE_INDET )
    1949             :     {
    1950           0 :         sal_Bool bValue = GetUILightState( aBtnLight2 );
    1951           0 :         rAttrs.Put(Svx3DLightOnOff2Item(bValue));
    1952             : 
    1953             :         // Light 2 (direction)
    1954           0 :         if( bValue )
    1955             :         {
    1956           0 :             rAttrs.Put(aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_2));
    1957             :         }
    1958             :     }
    1959             :     else
    1960           0 :         rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTON_2);
    1961             : 
    1962             :     // Light 3 color
    1963           0 :     if( aLbLight3.GetSelectEntryCount() )
    1964             :     {
    1965           0 :         aColor = aLbLight3.GetSelectEntryColor();
    1966           0 :         rAttrs.Put(Svx3DLightcolor3Item(aColor));
    1967             :     }
    1968             :     else
    1969           0 :         rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTCOLOR_3);
    1970             :     // Light 3 (on/off)
    1971           0 :     eState = aBtnLight3.GetState();
    1972           0 :     if( eState != TRISTATE_INDET )
    1973             :     {
    1974           0 :         sal_Bool bValue = GetUILightState( aBtnLight3 );
    1975           0 :         rAttrs.Put(Svx3DLightOnOff3Item(bValue));
    1976             : 
    1977             :         // Light 3 (direction)
    1978           0 :         if( bValue )
    1979             :         {
    1980           0 :             rAttrs.Put(aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_3));
    1981             :         }
    1982             :     }
    1983             :     else
    1984           0 :         rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTON_3);
    1985             : 
    1986             :     // Light 4 color
    1987           0 :     if( aLbLight4.GetSelectEntryCount() )
    1988             :     {
    1989           0 :         aColor = aLbLight4.GetSelectEntryColor();
    1990           0 :         rAttrs.Put(Svx3DLightcolor4Item(aColor));
    1991             :     }
    1992             :     else
    1993           0 :         rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTCOLOR_4);
    1994             :     // Light 4 (on/off)
    1995           0 :     eState = aBtnLight4.GetState();
    1996           0 :     if( eState != TRISTATE_INDET )
    1997             :     {
    1998           0 :         sal_Bool bValue = GetUILightState( aBtnLight4 );
    1999           0 :         rAttrs.Put(Svx3DLightOnOff4Item(bValue));
    2000             : 
    2001             :         // Light 4 (direction)
    2002           0 :         if( bValue )
    2003             :         {
    2004           0 :             rAttrs.Put(aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_4));
    2005             :         }
    2006             :     }
    2007             :     else
    2008           0 :         rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTON_4);
    2009             : 
    2010             :     // Light 5 color
    2011           0 :     if( aLbLight5.GetSelectEntryCount() )
    2012             :     {
    2013           0 :         aColor = aLbLight5.GetSelectEntryColor();
    2014           0 :         rAttrs.Put(Svx3DLightcolor5Item(aColor));
    2015             :     }
    2016             :     else
    2017           0 :         rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTCOLOR_5);
    2018             :     // Light 5 (on/off)
    2019           0 :     eState = aBtnLight5.GetState();
    2020           0 :     if( eState != TRISTATE_INDET )
    2021             :     {
    2022           0 :         sal_Bool bValue = GetUILightState( aBtnLight5 );
    2023           0 :         rAttrs.Put(Svx3DLightOnOff5Item(bValue));
    2024             : 
    2025             :         // Light 5 (direction)
    2026           0 :         if( bValue )
    2027             :         {
    2028           0 :             rAttrs.Put(aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_5));
    2029             :         }
    2030             :     }
    2031             :     else
    2032           0 :         rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTON_5);
    2033             : 
    2034             :     // Light 6 color
    2035           0 :     if( aLbLight6.GetSelectEntryCount() )
    2036             :     {
    2037           0 :         aColor = aLbLight6.GetSelectEntryColor();
    2038           0 :         rAttrs.Put(Svx3DLightcolor6Item(aColor));
    2039             :     }
    2040             :     else
    2041           0 :         rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTCOLOR_6);
    2042             :     // Light 6 (on/off)
    2043           0 :     eState = aBtnLight6.GetState();
    2044           0 :     if( eState != TRISTATE_INDET )
    2045             :     {
    2046           0 :         sal_Bool bValue = GetUILightState( aBtnLight6 );
    2047           0 :         rAttrs.Put(Svx3DLightOnOff6Item(bValue));
    2048             : 
    2049             :         // Light 6 (direction)
    2050           0 :         if( bValue )
    2051             :         {
    2052           0 :             rAttrs.Put(aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_6));
    2053             :         }
    2054             :     }
    2055             :     else
    2056           0 :         rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTON_6);
    2057             : 
    2058             :     // Light 7 color
    2059           0 :     if( aLbLight7.GetSelectEntryCount() )
    2060             :     {
    2061           0 :         aColor = aLbLight7.GetSelectEntryColor();
    2062           0 :         rAttrs.Put(Svx3DLightcolor7Item(aColor));
    2063             :     }
    2064             :     else
    2065           0 :         rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTCOLOR_7);
    2066             :     // Light 7 (on/off)
    2067           0 :     eState = aBtnLight7.GetState();
    2068           0 :     if( eState != TRISTATE_INDET )
    2069             :     {
    2070           0 :         sal_Bool bValue = GetUILightState( aBtnLight7 );
    2071           0 :         rAttrs.Put(Svx3DLightOnOff7Item(bValue));
    2072             : 
    2073             :         // Light 7 (direction)
    2074           0 :         if( bValue )
    2075             :         {
    2076           0 :             rAttrs.Put(aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_7));
    2077             :         }
    2078             :     }
    2079             :     else
    2080           0 :         rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTON_7);
    2081             : 
    2082             :     // Light 8 color
    2083           0 :     if( aLbLight8.GetSelectEntryCount() )
    2084             :     {
    2085           0 :         aColor = aLbLight8.GetSelectEntryColor();
    2086           0 :         rAttrs.Put(Svx3DLightcolor8Item(aColor));
    2087             :     }
    2088             :     else
    2089           0 :         rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTCOLOR_8);
    2090             :     // Light 8 (on/off)
    2091           0 :     eState = aBtnLight8.GetState();
    2092           0 :     if( eState != TRISTATE_INDET )
    2093             :     {
    2094           0 :         sal_Bool bValue = GetUILightState( aBtnLight8 );
    2095           0 :         rAttrs.Put(Svx3DLightOnOff8Item(bValue));
    2096             : 
    2097             :         // Light 8 (direction)
    2098           0 :         if( bValue )
    2099             :         {
    2100           0 :             rAttrs.Put(aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_8));
    2101             :         }
    2102             :     }
    2103             :     else
    2104           0 :         rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTON_8);
    2105             : 
    2106             :     // Ambient light
    2107           0 :     if( aLbAmbientlight.GetSelectEntryCount() )
    2108             :     {
    2109           0 :         aColor = aLbAmbientlight.GetSelectEntryColor();
    2110           0 :         rAttrs.Put(Svx3DAmbientcolorItem(aColor));
    2111             :     }
    2112             :     else
    2113           0 :         rAttrs.InvalidateItem(SDRATTR_3DSCENE_AMBIENTCOLOR);
    2114             : 
    2115             : // Textures
    2116             :     // Art
    2117           0 :     nValue = 3;
    2118           0 :     if( aBtnTexLuminance.IsChecked() )
    2119           0 :         nValue = 1;
    2120           0 :     else if( aBtnTexColor.IsChecked() )
    2121           0 :         nValue = 3;
    2122             : 
    2123           0 :     if( nValue == 1 || nValue == 3 )
    2124           0 :         rAttrs.Put(Svx3DTextureKindItem(nValue));
    2125             :     else
    2126           0 :         rAttrs.InvalidateItem(SDRATTR_3DOBJ_TEXTURE_KIND);
    2127             : 
    2128             : 
    2129             :     // Mode
    2130           0 :     nValue = 99;
    2131           0 :     if( aBtnTexReplace.IsChecked() )
    2132           0 :         nValue = 1;
    2133           0 :     else if( aBtnTexModulate.IsChecked() )
    2134           0 :         nValue = 2;
    2135             : 
    2136           0 :     if( nValue == 1 || nValue == 2 )
    2137           0 :         rAttrs.Put(Svx3DTextureModeItem(nValue));
    2138             :     else
    2139           0 :         rAttrs.InvalidateItem(SDRATTR_3DOBJ_TEXTURE_MODE);
    2140             : 
    2141             :     // X projection
    2142           0 :     nValue = 99;
    2143           0 :     if( aBtnTexObjectX.IsChecked() )
    2144           0 :         nValue = 0;
    2145           0 :     else if( aBtnTexParallelX.IsChecked() )
    2146           0 :         nValue = 1;
    2147           0 :     else if( aBtnTexCircleX.IsChecked() )
    2148           0 :         nValue = 2;
    2149             : 
    2150           0 :     if( nValue <= 2 )
    2151           0 :         rAttrs.Put(Svx3DTextureProjectionXItem(nValue));
    2152             :     else
    2153           0 :         rAttrs.InvalidateItem(SDRATTR_3DOBJ_TEXTURE_PROJ_X);
    2154             : 
    2155             :     // Y projection
    2156           0 :     nValue = 99;
    2157           0 :     if( aBtnTexObjectY.IsChecked() )
    2158           0 :         nValue = 0;
    2159           0 :     else if( aBtnTexParallelY.IsChecked() )
    2160           0 :         nValue = 1;
    2161           0 :     else if( aBtnTexCircleY.IsChecked() )
    2162           0 :         nValue = 2;
    2163             : 
    2164           0 :     if( nValue <= 2 )
    2165           0 :         rAttrs.Put(Svx3DTextureProjectionYItem(nValue));
    2166             :     else
    2167           0 :         rAttrs.InvalidateItem(SDRATTR_3DOBJ_TEXTURE_PROJ_Y);
    2168             : 
    2169             : 
    2170             :     // Filter
    2171           0 :     eState = aBtnTexFilter.GetState();
    2172           0 :     if( eState != TRISTATE_INDET )
    2173             :     {
    2174           0 :         sal_Bool bValue = TRISTATE_TRUE == eState;
    2175           0 :         rAttrs.Put(Svx3DTextureFilterItem(bValue));
    2176             :     }
    2177             :     else
    2178           0 :         rAttrs.InvalidateItem(SDRATTR_3DOBJ_TEXTURE_FILTER);
    2179             : 
    2180             : 
    2181             : // Material
    2182             :     // Object color
    2183           0 :     if( aLbMatColor.GetSelectEntryCount() )
    2184             :     {
    2185           0 :         aColor = aLbMatColor.GetSelectEntryColor();
    2186           0 :         rAttrs.Put( XFillColorItem( "", aColor) );
    2187             :     }
    2188             :     else
    2189             :     {
    2190           0 :         rAttrs.InvalidateItem( XATTR_FILLCOLOR );
    2191             :     }
    2192             : 
    2193             :     // luminous color
    2194           0 :     if( aLbMatEmission.GetSelectEntryCount() )
    2195             :     {
    2196           0 :         aColor = aLbMatEmission.GetSelectEntryColor();
    2197           0 :         rAttrs.Put(Svx3DMaterialEmissionItem(aColor));
    2198             :     }
    2199             :     else
    2200           0 :         rAttrs.InvalidateItem(SDRATTR_3DOBJ_MAT_EMISSION);
    2201             : 
    2202             :     // Specular
    2203           0 :     if( aLbMatSpecular.GetSelectEntryCount() )
    2204             :     {
    2205           0 :         aColor = aLbMatSpecular.GetSelectEntryColor();
    2206           0 :         rAttrs.Put(Svx3DMaterialSpecularItem(aColor));
    2207             :     }
    2208             :     else
    2209           0 :         rAttrs.InvalidateItem(SDRATTR_3DOBJ_MAT_SPECULAR);
    2210             : 
    2211             :     // Specular intensity
    2212           0 :     if( !aMtrMatSpecularIntensity.IsEmptyFieldValue() )
    2213             :     {
    2214           0 :         sal_uInt16 nValue2 = (sal_uInt16) aMtrMatSpecularIntensity.GetValue();
    2215           0 :         rAttrs.Put(Svx3DMaterialSpecularIntensityItem(nValue2));
    2216             :     }
    2217             :     else
    2218           0 :         rAttrs.InvalidateItem(SDRATTR_3DOBJ_MAT_SPECULAR_INTENSITY);
    2219           0 : }
    2220             : 
    2221             : 
    2222           0 : void Svx3DWin::Resize()
    2223             : {
    2224           0 :     if ( !IsFloatingMode() ||
    2225           0 :          !GetFloatingWindow()->IsRollUp() )
    2226             :     {
    2227           0 :         Size aWinSize( GetOutputSizePixel() ); // why rSize in Resizing()?
    2228             : 
    2229           0 :         if( aWinSize.Height() >= GetMinOutputSizePixel().Height() &&
    2230           0 :             aWinSize.Width() >= GetMinOutputSizePixel().Width() )
    2231             :         {
    2232           0 :             Size aDiffSize;
    2233           0 :             aDiffSize.Width() = aWinSize.Width() - aSize.Width();
    2234           0 :             aDiffSize.Height() = aWinSize.Height() - aSize.Height();
    2235             : 
    2236           0 :             Point aXPt;
    2237           0 :             Point aYPt;
    2238           0 :             aXPt.X() = aDiffSize.Width();
    2239           0 :             aYPt.Y() = aDiffSize.Height();
    2240             : 
    2241           0 :             Size aObjSize;
    2242             : 
    2243             :             // Hide
    2244           0 :             aBtnUpdate.Hide();
    2245           0 :             aBtnAssign.Hide();
    2246             : 
    2247           0 :             aBtnConvertTo3D.Hide();
    2248           0 :             aBtnLatheObject.Hide();
    2249           0 :             aBtnPerspective.Hide();
    2250             : 
    2251           0 :             aCtlPreview.Hide();
    2252           0 :             aCtlLightPreview.Hide();
    2253             : 
    2254           0 :             aFLGeometrie.Hide();
    2255           0 :             aFLRepresentation.Hide();
    2256           0 :             aFLLight.Hide();
    2257           0 :             aFLTexture.Hide();
    2258           0 :             aFLMaterial.Hide();
    2259             : 
    2260             :             // Moving / resizing
    2261           0 :             aBtnUpdate.SetPosPixel( aBtnUpdate.GetPosPixel() + aXPt );
    2262           0 :             aBtnAssign.SetPosPixel( aBtnAssign.GetPosPixel() + aXPt );
    2263             : 
    2264             :             // Preview controls
    2265           0 :             aObjSize = aCtlPreview.GetOutputSizePixel();
    2266           0 :             aObjSize.Width() += aDiffSize.Width();
    2267           0 :             aObjSize.Height() += aDiffSize.Height();
    2268           0 :             aCtlPreview.SetOutputSizePixel( aObjSize );
    2269           0 :             aCtlLightPreview.SetOutputSizePixel( aObjSize );
    2270             : 
    2271             :             // Groups
    2272           0 :             aObjSize = aFLGeometrie.GetOutputSizePixel();
    2273           0 :             aObjSize.Width() += aDiffSize.Width();
    2274           0 :             aFLGeometrie.SetOutputSizePixel( aObjSize );
    2275           0 :             aFLSegments.SetOutputSizePixel( aObjSize );
    2276           0 :             aFLShadow.SetOutputSizePixel( aObjSize );
    2277           0 :             aFLCamera.SetOutputSizePixel( aObjSize );
    2278           0 :             aFLRepresentation.SetOutputSizePixel( aObjSize );
    2279           0 :             aFLLight.SetOutputSizePixel( aObjSize );
    2280           0 :             aFLTexture.SetOutputSizePixel( aObjSize );
    2281           0 :             aFLMaterial.SetOutputSizePixel( aObjSize );
    2282             : 
    2283             :             // Y-position of the lower buttons
    2284           0 :             aBtnConvertTo3D.SetPosPixel( aBtnConvertTo3D.GetPosPixel() + aYPt );
    2285           0 :             aBtnLatheObject.SetPosPixel( aBtnLatheObject.GetPosPixel() + aYPt );
    2286           0 :             aBtnPerspective.SetPosPixel( aBtnPerspective.GetPosPixel() + aYPt );
    2287             : 
    2288             :             // Show
    2289           0 :             aBtnUpdate.Show();
    2290           0 :             aBtnAssign.Show();
    2291             : 
    2292           0 :             aBtnConvertTo3D.Show();
    2293           0 :             aBtnLatheObject.Show();
    2294           0 :             aBtnPerspective.Show();
    2295             : 
    2296           0 :             if( aBtnGeo.IsChecked() )
    2297           0 :                 ClickViewTypeHdl( &aBtnGeo );
    2298           0 :             if( aBtnRepresentation.IsChecked() )
    2299           0 :                 ClickViewTypeHdl( &aBtnRepresentation );
    2300           0 :             if( aBtnLight.IsChecked() )
    2301           0 :                 ClickViewTypeHdl( &aBtnLight );
    2302           0 :             if( aBtnTexture.IsChecked() )
    2303           0 :                 ClickViewTypeHdl( &aBtnTexture );
    2304           0 :             if( aBtnMaterial.IsChecked() )
    2305           0 :                 ClickViewTypeHdl( &aBtnMaterial );
    2306             : 
    2307           0 :             aSize = aWinSize;
    2308             :         }
    2309             :     }
    2310             : 
    2311           0 :     SfxDockingWindow::Resize();
    2312           0 : }
    2313             : 
    2314             : 
    2315           0 : IMPL_LINK_NOARG(Svx3DWin, ClickUpdateHdl)
    2316             : {
    2317           0 :     bUpdate = !aBtnUpdate.IsChecked();
    2318           0 :     aBtnUpdate.Check( bUpdate );
    2319             : 
    2320           0 :     if( bUpdate )
    2321             :     {
    2322           0 :         SfxDispatcher* pDispatcher = LocalGetDispatcher(pBindings);
    2323           0 :         if (pDispatcher != NULL)
    2324             :         {
    2325           0 :             SfxBoolItem aItem( SID_3D_STATE, true );
    2326             :             pDispatcher->Execute(
    2327           0 :                 SID_3D_STATE, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD, &aItem, 0L );
    2328             :         }
    2329             :     }
    2330             :     else
    2331             :     {
    2332             :         // Controls can be disabled during certain circumstances
    2333             :     }
    2334             : 
    2335           0 :     return( 0L );
    2336             : }
    2337             : 
    2338             : 
    2339           0 : IMPL_LINK_NOARG(Svx3DWin, ClickAssignHdl)
    2340             : {
    2341           0 :     SfxDispatcher* pDispatcher = LocalGetDispatcher(pBindings);
    2342           0 :     if (pDispatcher != NULL)
    2343             :     {
    2344           0 :         SfxBoolItem aItem( SID_3D_ASSIGN, true );
    2345             :         pDispatcher->Execute(
    2346           0 :             SID_3D_ASSIGN, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD, &aItem, 0L );
    2347             :     }
    2348             : 
    2349           0 :     return( 0L );
    2350             : }
    2351             : 
    2352             : 
    2353             : 
    2354           0 : IMPL_LINK( Svx3DWin, ClickViewTypeHdl, void *, pBtn )
    2355             : {
    2356             : 
    2357           0 :     if( pBtn )
    2358             :     {
    2359             :         // Since the permanent updating of the preview would be too expensive
    2360           0 :         sal_Bool bUpdatePreview = aBtnLight.IsChecked();
    2361             : 
    2362           0 :         aBtnGeo.Check( &aBtnGeo == pBtn );
    2363           0 :         aBtnRepresentation.Check( &aBtnRepresentation == pBtn );
    2364           0 :         aBtnLight.Check( &aBtnLight == pBtn );
    2365           0 :         aBtnTexture.Check( &aBtnTexture == pBtn );
    2366           0 :         aBtnMaterial.Check( &aBtnMaterial == pBtn );
    2367             : 
    2368           0 :         if( aBtnGeo.IsChecked() )
    2369           0 :             eViewType = VIEWTYPE_GEO;
    2370           0 :         if( aBtnRepresentation.IsChecked() )
    2371           0 :             eViewType = VIEWTYPE_REPRESENTATION;
    2372           0 :         if( aBtnLight.IsChecked() )
    2373           0 :             eViewType = VIEWTYPE_LIGHT;
    2374           0 :         if( aBtnTexture.IsChecked() )
    2375           0 :             eViewType = VIEWTYPE_TEXTURE;
    2376           0 :         if( aBtnMaterial.IsChecked() )
    2377           0 :             eViewType = VIEWTYPE_MATERIAL;
    2378             : 
    2379             :         // Geometry
    2380           0 :         if( eViewType == VIEWTYPE_GEO )
    2381             :         {
    2382           0 :             aFtHorizontal.Show();
    2383           0 :             aNumHorizontal.Show();
    2384           0 :             aFtVertical.Show();
    2385           0 :             aNumVertical.Show();
    2386           0 :             aFLSegments.Show();
    2387           0 :             aFtPercentDiagonal.Show();
    2388           0 :             aMtrPercentDiagonal.Show();
    2389           0 :             aFtBackscale.Show();
    2390           0 :             aMtrBackscale.Show();
    2391           0 :             aFtEndAngle.Show();
    2392           0 :             aMtrEndAngle.Show();
    2393           0 :             aFtDepth.Show();
    2394           0 :             aMtrDepth.Show();
    2395           0 :             aFLGeometrie.Show();
    2396             : 
    2397           0 :             aBtnNormalsObj.Show();
    2398           0 :             aBtnNormalsFlat.Show();
    2399           0 :             aBtnNormalsSphere.Show();
    2400           0 :             aBtnTwoSidedLighting.Show();
    2401           0 :             aBtnNormalsInvert.Show();
    2402           0 :             aFLNormals.Show();
    2403           0 :             aBtnDoubleSided.Show();
    2404             :         }
    2405             :         else
    2406             :         {
    2407           0 :             aFtHorizontal.Hide();
    2408           0 :             aNumHorizontal.Hide();
    2409           0 :             aFtVertical.Hide();
    2410           0 :             aNumVertical.Hide();
    2411           0 :             aFLSegments.Hide();
    2412           0 :             aFtPercentDiagonal.Hide();
    2413           0 :             aMtrPercentDiagonal.Hide();
    2414           0 :             aFtBackscale.Hide();
    2415           0 :             aMtrBackscale.Hide();
    2416           0 :             aFtEndAngle.Hide();
    2417           0 :             aMtrEndAngle.Hide();
    2418           0 :             aFtDepth.Hide();
    2419           0 :             aMtrDepth.Hide();
    2420           0 :             aFLGeometrie.Hide();
    2421             : 
    2422           0 :             aBtnNormalsObj.Hide();
    2423           0 :             aBtnNormalsFlat.Hide();
    2424           0 :             aBtnNormalsSphere.Hide();
    2425           0 :             aBtnTwoSidedLighting.Hide();
    2426           0 :             aBtnNormalsInvert.Hide();
    2427           0 :             aFLNormals.Hide();
    2428           0 :             aBtnDoubleSided.Hide();
    2429             :         }
    2430             : 
    2431             :         // Representation
    2432           0 :         if( eViewType == VIEWTYPE_REPRESENTATION )
    2433             :         {
    2434           0 :             aFtShademode.Show();
    2435           0 :             aLbShademode.Show();
    2436           0 :             aBtnShadow3d.Show();
    2437           0 :             aFtSlant.Show();
    2438           0 :             aMtrSlant.Show();
    2439           0 :             aFLShadow.Show();
    2440           0 :             aFtDistance.Show();
    2441           0 :             aMtrDistance.Show();
    2442           0 :             aFtFocalLeng.Show();
    2443           0 :             aMtrFocalLength.Show();
    2444           0 :             aFLCamera.Show();
    2445           0 :             aFLRepresentation.Show();
    2446             :         }
    2447             :         else
    2448             :         {
    2449           0 :             aFtShademode.Hide();
    2450           0 :             aLbShademode.Hide();
    2451           0 :             aBtnShadow3d.Hide();
    2452           0 :             aFtSlant.Hide();
    2453           0 :             aMtrSlant.Hide();
    2454           0 :             aFLShadow.Hide();
    2455           0 :             aFtDistance.Hide();
    2456           0 :             aMtrDistance.Hide();
    2457           0 :             aFtFocalLeng.Hide();
    2458           0 :             aMtrFocalLength.Hide();
    2459           0 :             aFLCamera.Hide();
    2460           0 :             aFLRepresentation.Hide();
    2461             :         }
    2462             : 
    2463             :         // Lighting
    2464           0 :         if( eViewType == VIEWTYPE_LIGHT )
    2465             :         {
    2466           0 :             aBtnLight1.Show();
    2467           0 :             aBtnLight2.Show();
    2468           0 :             aBtnLight3.Show();
    2469           0 :             aBtnLight4.Show();
    2470           0 :             aBtnLight5.Show();
    2471           0 :             aBtnLight6.Show();
    2472           0 :             aBtnLight7.Show();
    2473           0 :             aBtnLight8.Show();
    2474           0 :             aBtnLightColor.Show();
    2475           0 :             aFTLightsource.Show();
    2476           0 :             aLbAmbientlight.Show();
    2477           0 :             aBtnAmbientColor.Show();
    2478           0 :             aFTAmbientlight.Show();
    2479           0 :             aFLLight.Show();
    2480             : 
    2481           0 :             ColorLB* pLb = GetLbByButton();
    2482           0 :             if( pLb )
    2483           0 :                 pLb->Show();
    2484             : 
    2485           0 :             aCtlLightPreview.Show();
    2486           0 :             aCtlPreview.Hide();
    2487             :         }
    2488             :         else
    2489             :         {
    2490           0 :             aBtnLight1.Hide();
    2491           0 :             aBtnLight2.Hide();
    2492           0 :             aBtnLight3.Hide();
    2493           0 :             aBtnLight4.Hide();
    2494           0 :             aBtnLight5.Hide();
    2495           0 :             aBtnLight6.Hide();
    2496           0 :             aBtnLight7.Hide();
    2497           0 :             aBtnLight8.Hide();
    2498           0 :             aLbLight1.Hide();
    2499           0 :             aLbLight2.Hide();
    2500           0 :             aLbLight3.Hide();
    2501           0 :             aLbLight4.Hide();
    2502           0 :             aLbLight5.Hide();
    2503           0 :             aLbLight6.Hide();
    2504           0 :             aLbLight7.Hide();
    2505           0 :             aLbLight8.Hide();
    2506           0 :             aBtnLightColor.Hide();
    2507           0 :             aFTLightsource.Hide();
    2508           0 :             aLbAmbientlight.Hide();
    2509           0 :             aBtnAmbientColor.Hide();
    2510           0 :             aFTAmbientlight.Hide();
    2511           0 :             aFLLight.Hide();
    2512             : 
    2513           0 :             if( !aCtlPreview.IsVisible() )
    2514             :             {
    2515           0 :                 aCtlPreview.Show();
    2516           0 :                 aCtlLightPreview.Hide();
    2517             :             }
    2518             :         }
    2519             : 
    2520             :         // Textures
    2521           0 :         if( eViewType == VIEWTYPE_TEXTURE )
    2522             :         {
    2523           0 :             aFtTexKind.Show();
    2524           0 :             aBtnTexLuminance.Show();
    2525           0 :             aBtnTexColor.Show();
    2526           0 :             aFtTexMode.Show();
    2527           0 :             aBtnTexReplace.Show();
    2528           0 :             aBtnTexModulate.Show();
    2529           0 :             aFtTexProjectionX.Show();
    2530           0 :             aBtnTexParallelX.Show();
    2531           0 :             aBtnTexCircleX.Show();
    2532           0 :             aBtnTexObjectX.Show();
    2533           0 :             aFtTexProjectionY.Show();
    2534           0 :             aBtnTexParallelY.Show();
    2535           0 :             aBtnTexCircleY.Show();
    2536           0 :             aBtnTexObjectY.Show();
    2537           0 :             aFtTexFilter.Show();
    2538           0 :             aBtnTexFilter.Show();
    2539           0 :             aFLTexture.Show();
    2540             :         }
    2541             :         else
    2542             :         {
    2543           0 :             aFtTexKind.Hide();
    2544           0 :             aBtnTexLuminance.Hide();
    2545           0 :             aBtnTexColor.Hide();
    2546           0 :             aFtTexMode.Hide();
    2547           0 :             aBtnTexReplace.Hide();
    2548           0 :             aBtnTexModulate.Hide();
    2549           0 :             aBtnTexBlend.Hide();
    2550           0 :             aFtTexProjectionX.Hide();
    2551           0 :             aBtnTexParallelX.Hide();
    2552           0 :             aBtnTexCircleX.Hide();
    2553           0 :             aBtnTexObjectX.Hide();
    2554           0 :             aFtTexProjectionY.Hide();
    2555           0 :             aBtnTexParallelY.Hide();
    2556           0 :             aBtnTexCircleY.Hide();
    2557           0 :             aBtnTexObjectY.Hide();
    2558           0 :             aFtTexFilter.Hide();
    2559           0 :             aBtnTexFilter.Hide();
    2560           0 :             aFLTexture.Hide();
    2561             :         }
    2562             : 
    2563             :         // Material
    2564           0 :         if( eViewType == VIEWTYPE_MATERIAL )
    2565             :         {
    2566           0 :             aFtMatFavorites.Show();
    2567           0 :             aLbMatFavorites.Show();
    2568           0 :             aFtMatColor.Show();
    2569           0 :             aLbMatColor.Show();
    2570           0 :             aBtnMatColor.Show();
    2571           0 :             aFtMatEmission.Show();
    2572           0 :             aLbMatEmission.Show();
    2573           0 :             aBtnEmissionColor.Show();
    2574           0 :             aFtMatSpecular.Show();
    2575           0 :             aLbMatSpecular.Show();
    2576           0 :             aBtnSpecularColor.Show();
    2577           0 :             aFtMatSpecularIntensity.Show();
    2578           0 :             aMtrMatSpecularIntensity.Show();
    2579           0 :             aFLMatSpecular.Show();
    2580           0 :             aFLMaterial.Show();
    2581             :         }
    2582             :         else
    2583             :         {
    2584           0 :             aFtMatFavorites.Hide();
    2585           0 :             aLbMatFavorites.Hide();
    2586           0 :             aFtMatColor.Hide();
    2587           0 :             aLbMatColor.Hide();
    2588           0 :             aBtnMatColor.Hide();
    2589           0 :             aFtMatEmission.Hide();
    2590           0 :             aLbMatEmission.Hide();
    2591           0 :             aBtnEmissionColor.Hide();
    2592           0 :             aFtMatSpecular.Hide();
    2593           0 :             aLbMatSpecular.Hide();
    2594           0 :             aBtnSpecularColor.Hide();
    2595           0 :             aFtMatSpecularIntensity.Hide();
    2596           0 :             aMtrMatSpecularIntensity.Hide();
    2597           0 :             aFLMatSpecular.Hide();
    2598           0 :             aFLMaterial.Hide();
    2599             :         }
    2600           0 :         if( bUpdatePreview && !aBtnLight.IsChecked() )
    2601           0 :             UpdatePreview();
    2602             : 
    2603             :     }
    2604             :     else
    2605             :     {
    2606           0 :         aBtnGeo.Check( eViewType == VIEWTYPE_GEO );
    2607           0 :         aBtnRepresentation.Check( eViewType == VIEWTYPE_REPRESENTATION );
    2608           0 :         aBtnLight.Check( eViewType == VIEWTYPE_LIGHT );
    2609           0 :         aBtnTexture.Check( eViewType == VIEWTYPE_TEXTURE );
    2610           0 :         aBtnMaterial.Check( eViewType == VIEWTYPE_MATERIAL );
    2611             :     }
    2612           0 :     return( 0L );
    2613             : }
    2614             : 
    2615             : 
    2616           0 : IMPL_LINK( Svx3DWin, ClickHdl, PushButton *, pBtn )
    2617             : {
    2618           0 :     bool bUpdatePreview = false;
    2619             : 
    2620           0 :     if( pBtn )
    2621             :     {
    2622           0 :         sal_uInt16 nSId = 0;
    2623             : 
    2624           0 :         if( pBtn == &aBtnConvertTo3D )
    2625             :         {
    2626           0 :             nSId = SID_CONVERT_TO_3D;
    2627             :         }
    2628           0 :         else if( pBtn == &aBtnLatheObject )
    2629             :         {
    2630           0 :             nSId = SID_CONVERT_TO_3D_LATHE_FAST;
    2631             :         }
    2632             :         // Geometry
    2633           0 :         else if( pBtn == &aBtnNormalsObj ||
    2634           0 :                  pBtn == &aBtnNormalsFlat ||
    2635           0 :                  pBtn == &aBtnNormalsSphere )
    2636             :         {
    2637           0 :             aBtnNormalsObj.Check( pBtn == &aBtnNormalsObj );
    2638           0 :             aBtnNormalsFlat.Check( pBtn == &aBtnNormalsFlat );
    2639           0 :             aBtnNormalsSphere.Check( pBtn == &aBtnNormalsSphere );
    2640           0 :             bUpdatePreview = true;
    2641             :         }
    2642           0 :         else if( pBtn == &aBtnLight1 ||
    2643           0 :                  pBtn == &aBtnLight2 ||
    2644           0 :                  pBtn == &aBtnLight3 ||
    2645           0 :                  pBtn == &aBtnLight4 ||
    2646           0 :                  pBtn == &aBtnLight5 ||
    2647           0 :                  pBtn == &aBtnLight6 ||
    2648           0 :                  pBtn == &aBtnLight7 ||
    2649           0 :                  pBtn == &aBtnLight8 )
    2650             :         {
    2651             :             // Lighting
    2652           0 :             ColorLB* pLb = GetLbByButton( pBtn );
    2653           0 :             pLb->Show();
    2654             : 
    2655           0 :             if( pBtn->IsChecked() )
    2656             :             {
    2657           0 :                 SetUILightState( *(ImageButton*)pBtn, !GetUILightState( *(ImageButton*)pBtn ) );
    2658             :             }
    2659             :             else
    2660             :             {
    2661           0 :                 pBtn->Check();
    2662             : 
    2663           0 :                 if( pBtn != &aBtnLight1 && aBtnLight1.IsChecked() )
    2664             :                 {
    2665           0 :                     aBtnLight1.Check( false );
    2666           0 :                     aLbLight1.Hide();
    2667             :                 }
    2668           0 :                 if( pBtn != &aBtnLight2 && aBtnLight2.IsChecked() )
    2669             :                 {
    2670           0 :                     aBtnLight2.Check( false );
    2671           0 :                     aLbLight2.Hide();
    2672             :                 }
    2673           0 :                 if( pBtn != &aBtnLight3 && aBtnLight3.IsChecked() )
    2674             :                 {
    2675           0 :                     aBtnLight3.Check( false );
    2676           0 :                     aLbLight3.Hide();
    2677             :                 }
    2678           0 :                 if( pBtn != &aBtnLight4 && aBtnLight4.IsChecked() )
    2679             :                 {
    2680           0 :                     aBtnLight4.Check( false );
    2681           0 :                     aLbLight4.Hide();
    2682             :                 }
    2683           0 :                 if( pBtn != &aBtnLight5 && aBtnLight5.IsChecked() )
    2684             :                 {
    2685           0 :                     aBtnLight5.Check( false );
    2686           0 :                     aLbLight5.Hide();
    2687             :                 }
    2688           0 :                 if( pBtn != &aBtnLight6 && aBtnLight6.IsChecked() )
    2689             :                 {
    2690           0 :                     aBtnLight6.Check( false );
    2691           0 :                     aLbLight6.Hide();
    2692             :                 }
    2693           0 :                 if( pBtn != &aBtnLight7 && aBtnLight7.IsChecked() )
    2694             :                 {
    2695           0 :                     aBtnLight7.Check( false );
    2696           0 :                     aLbLight7.Hide();
    2697             :                 }
    2698           0 :                 if( pBtn != &aBtnLight8 && aBtnLight8.IsChecked() )
    2699             :                 {
    2700           0 :                     aBtnLight8.Check( false );
    2701           0 :                     aLbLight8.Hide();
    2702             :                 }
    2703             :             }
    2704           0 :             sal_Bool bEnable = GetUILightState( *(ImageButton*)pBtn );
    2705           0 :             aBtnLightColor.Enable( bEnable );
    2706           0 :             pLb->Enable( bEnable );
    2707             : 
    2708           0 :             ClickLight(*pBtn);
    2709           0 :             bUpdatePreview = true;
    2710             :         }
    2711             :         // Textures
    2712           0 :         else if( pBtn == &aBtnTexLuminance ||
    2713           0 :                  pBtn == &aBtnTexColor )
    2714             :         {
    2715           0 :             aBtnTexLuminance.Check( pBtn == &aBtnTexLuminance );
    2716           0 :             aBtnTexColor.Check( pBtn == &aBtnTexColor );
    2717           0 :             bUpdatePreview = true;
    2718             :         }
    2719           0 :         else if( pBtn == &aBtnTexReplace ||
    2720           0 :                  pBtn == &aBtnTexModulate )
    2721             :         {
    2722           0 :             aBtnTexReplace.Check( pBtn == &aBtnTexReplace );
    2723           0 :             aBtnTexModulate.Check( pBtn == &aBtnTexModulate );
    2724           0 :             bUpdatePreview = true;
    2725             :         }
    2726           0 :         else if( pBtn == &aBtnTexParallelX ||
    2727           0 :                  pBtn == &aBtnTexCircleX ||
    2728           0 :                  pBtn == &aBtnTexObjectX )
    2729             :         {
    2730           0 :             aBtnTexParallelX.Check( pBtn == &aBtnTexParallelX );
    2731           0 :             aBtnTexCircleX.Check( pBtn == &aBtnTexCircleX );
    2732           0 :             aBtnTexObjectX.Check( pBtn == &aBtnTexObjectX );
    2733           0 :             bUpdatePreview = true;
    2734             :         }
    2735           0 :         else if( pBtn == &aBtnTexParallelY ||
    2736           0 :                  pBtn == &aBtnTexCircleY ||
    2737           0 :                  pBtn == &aBtnTexObjectY )
    2738             :         {
    2739           0 :             aBtnTexParallelY.Check( pBtn == &aBtnTexParallelY );
    2740           0 :             aBtnTexCircleY.Check( pBtn == &aBtnTexCircleY );
    2741           0 :             aBtnTexObjectY.Check( pBtn == &aBtnTexObjectY );
    2742           0 :             bUpdatePreview = true;
    2743             :         }
    2744           0 :         else if( pBtn == &aBtnShadow3d  )
    2745             :         {
    2746           0 :             pBtn->Check( !pBtn->IsChecked() );
    2747           0 :             aFtSlant.Enable( pBtn->IsChecked() );
    2748           0 :             aMtrSlant.Enable( pBtn->IsChecked() );
    2749           0 :             bUpdatePreview = true;
    2750             :         }
    2751             :         // Other (no groups)
    2752           0 :         else if( pBtn != NULL )
    2753             :         {
    2754           0 :             pBtn->Check( !pBtn->IsChecked() );
    2755           0 :             bUpdatePreview = true;
    2756             :         }
    2757             : 
    2758           0 :         if( nSId > 0 )
    2759             :         {
    2760           0 :             SfxDispatcher* pDispatcher = LocalGetDispatcher(pBindings);
    2761           0 :             if (pDispatcher != NULL)
    2762             :             {
    2763           0 :                 SfxBoolItem aItem( nSId, true );
    2764             :                 pDispatcher->Execute(
    2765           0 :                     nSId, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD, &aItem, 0L );
    2766             :             }
    2767             :         }
    2768           0 :         else if( bUpdatePreview )
    2769           0 :             UpdatePreview();
    2770             :     }
    2771           0 :     return( 0L );
    2772             : }
    2773             : 
    2774             : 
    2775             : 
    2776           0 : IMPL_LINK( Svx3DWin, ClickColorHdl, PushButton *, pBtn )
    2777             : {
    2778           0 :     SvColorDialog aColorDlg( this );
    2779             :     ColorLB* pLb;
    2780             : 
    2781           0 :     if( pBtn == &aBtnLightColor )
    2782           0 :         pLb = GetLbByButton();
    2783           0 :     else if( pBtn == &aBtnAmbientColor )
    2784           0 :         pLb = &aLbAmbientlight;
    2785           0 :     else if( pBtn == &aBtnMatColor )
    2786           0 :         pLb = &aLbMatColor;
    2787           0 :     else if( pBtn == &aBtnEmissionColor )
    2788           0 :         pLb = &aLbMatEmission;
    2789             :     else // if( pBtn == &aBtnSpecularColor )
    2790           0 :         pLb = &aLbMatSpecular;
    2791             : 
    2792           0 :     Color aColor = pLb->GetSelectEntryColor();
    2793             : 
    2794           0 :     aColorDlg.SetColor( aColor );
    2795           0 :     if( aColorDlg.Execute() == RET_OK )
    2796             :     {
    2797           0 :         aColor = aColorDlg.GetColor();
    2798           0 :         if( LBSelectColor( pLb, aColor ) )
    2799           0 :             SelectHdl( pLb );
    2800             :     }
    2801           0 :     return( 0L );
    2802             : }
    2803             : 
    2804             : 
    2805           0 : IMPL_LINK( Svx3DWin, SelectHdl, void *, p )
    2806             : {
    2807           0 :     if( p )
    2808             :     {
    2809           0 :         bool bUpdatePreview = false;
    2810             : 
    2811             :         // Material
    2812           0 :         if( p == &aLbMatFavorites )
    2813             :         {
    2814           0 :             Color aColObj( COL_WHITE );
    2815           0 :             Color aColEmis( COL_BLACK );
    2816           0 :             Color aColSpec( COL_WHITE );
    2817           0 :             sal_uInt16 nSpecIntens = 20;
    2818             : 
    2819           0 :             sal_uInt16 nPos = aLbMatFavorites.GetSelectEntryPos();
    2820           0 :             switch( nPos )
    2821             :             {
    2822             :                 case 1: // Metall
    2823             :                 {
    2824           0 :                     aColObj = Color(230,230,255);
    2825           0 :                     aColEmis = Color(10,10,30);
    2826           0 :                     aColSpec = Color(200,200,200);
    2827           0 :                     nSpecIntens = 20;
    2828             :                 }
    2829           0 :                 break;
    2830             : 
    2831             :                 case 2: // Gold
    2832             :                 {
    2833           0 :                     aColObj = Color(230,255,0);
    2834           0 :                     aColEmis = Color(51,0,0);
    2835           0 :                     aColSpec = Color(255,255,240);
    2836           0 :                     nSpecIntens = 20;
    2837             :                 }
    2838           0 :                 break;
    2839             : 
    2840             :                 case 3: // Chrome
    2841             :                 {
    2842           0 :                     aColObj = Color(36,117,153);
    2843           0 :                     aColEmis = Color(18,30,51);
    2844           0 :                     aColSpec = Color(230,230,255);
    2845           0 :                     nSpecIntens = 2;
    2846             :                 }
    2847           0 :                 break;
    2848             : 
    2849             :                 case 4: // Plastic
    2850             :                 {
    2851           0 :                     aColObj = Color(255,48,57);
    2852           0 :                     aColEmis = Color(35,0,0);
    2853           0 :                     aColSpec = Color(179,202,204);
    2854           0 :                     nSpecIntens = 60;
    2855             :                 }
    2856           0 :                 break;
    2857             : 
    2858             :                 case 5: // Wood
    2859             :                 {
    2860           0 :                     aColObj = Color(153,71,1);
    2861           0 :                     aColEmis = Color(21,22,0);
    2862           0 :                     aColSpec = Color(255,255,153);
    2863           0 :                     nSpecIntens = 75;
    2864             :                 }
    2865           0 :                 break;
    2866             :             }
    2867           0 :             LBSelectColor( &aLbMatColor, aColObj );
    2868           0 :             LBSelectColor( &aLbMatEmission, aColEmis );
    2869           0 :             LBSelectColor( &aLbMatSpecular, aColSpec );
    2870           0 :             aMtrMatSpecularIntensity.SetValue( nSpecIntens );
    2871             : 
    2872           0 :             bUpdatePreview = true;
    2873             :         }
    2874           0 :         else if( p == &aLbMatColor ||
    2875           0 :                  p == &aLbMatEmission ||
    2876           0 :                  p == &aLbMatSpecular )
    2877             :         {
    2878           0 :             aLbMatFavorites.SelectEntryPos( 0 );
    2879           0 :             bUpdatePreview = true;
    2880             :         }
    2881             :         // Lighting
    2882           0 :         else if( p == &aLbAmbientlight )
    2883             :         {
    2884           0 :             bUpdatePreview = true;
    2885             :         }
    2886           0 :         else if( p == &aLbLight1 ||
    2887           0 :                  p == &aLbLight2 ||
    2888           0 :                  p == &aLbLight3 ||
    2889           0 :                  p == &aLbLight4 ||
    2890           0 :                  p == &aLbLight5 ||
    2891           0 :                  p == &aLbLight6 ||
    2892           0 :                  p == &aLbLight7 ||
    2893           0 :                  p == &aLbLight8 )
    2894             :         {
    2895           0 :             bUpdatePreview = true;
    2896             :         }
    2897           0 :         else if( p == &aLbShademode )
    2898           0 :             bUpdatePreview = true;
    2899             : 
    2900           0 :         if( bUpdatePreview )
    2901           0 :             UpdatePreview();
    2902             :     }
    2903           0 :     return( 0L );
    2904             : }
    2905             : 
    2906             : 
    2907           0 : IMPL_LINK( Svx3DWin, ModifyHdl, void*, pField )
    2908             : {
    2909           0 :     if( pField )
    2910             :     {
    2911           0 :         bool bUpdatePreview = false;
    2912             : 
    2913             :         // Material
    2914           0 :         if( pField == &aMtrMatSpecularIntensity )
    2915             :         {
    2916           0 :             bUpdatePreview = true;
    2917             :         }
    2918           0 :         else if( pField == &aNumHorizontal )
    2919             :         {
    2920           0 :             bUpdatePreview = true;
    2921             :         }
    2922           0 :         else if( pField == &aNumVertical )
    2923             :         {
    2924           0 :             bUpdatePreview = true;
    2925             :         }
    2926           0 :         else if( pField == &aMtrSlant )
    2927             :         {
    2928           0 :             bUpdatePreview = true;
    2929             :         }
    2930             : 
    2931           0 :         if( bUpdatePreview )
    2932           0 :             UpdatePreview();
    2933             :     }
    2934           0 :     return( 0L );
    2935             : }
    2936             : 
    2937             : 
    2938             : 
    2939           0 : void Svx3DWin::ClickLight(PushButton& rBtn)
    2940             : {
    2941           0 :     sal_uInt16 nLightSource = GetLightSource( &rBtn );
    2942           0 :     ColorLB* pLb = GetLbByButton( &rBtn );
    2943           0 :     Color aColor( pLb->GetSelectEntryColor() );
    2944           0 :     SfxItemSet aLightItemSet(aCtlLightPreview.GetSvx3DLightControl().Get3DAttributes());
    2945           0 :     const bool bOnOff(GetUILightState( (const ImageButton&)rBtn ));
    2946             : 
    2947           0 :     switch(nLightSource)
    2948             :     {
    2949           0 :         case 0: aLightItemSet.Put(Svx3DLightcolor1Item(aColor)); aLightItemSet.Put(Svx3DLightOnOff1Item(bOnOff)); break;
    2950           0 :         case 1: aLightItemSet.Put(Svx3DLightcolor2Item(aColor)); aLightItemSet.Put(Svx3DLightOnOff2Item(bOnOff)); break;
    2951           0 :         case 2: aLightItemSet.Put(Svx3DLightcolor3Item(aColor)); aLightItemSet.Put(Svx3DLightOnOff3Item(bOnOff)); break;
    2952           0 :         case 3: aLightItemSet.Put(Svx3DLightcolor4Item(aColor)); aLightItemSet.Put(Svx3DLightOnOff4Item(bOnOff)); break;
    2953           0 :         case 4: aLightItemSet.Put(Svx3DLightcolor5Item(aColor)); aLightItemSet.Put(Svx3DLightOnOff5Item(bOnOff)); break;
    2954           0 :         case 5: aLightItemSet.Put(Svx3DLightcolor6Item(aColor)); aLightItemSet.Put(Svx3DLightOnOff6Item(bOnOff)); break;
    2955           0 :         case 6: aLightItemSet.Put(Svx3DLightcolor7Item(aColor)); aLightItemSet.Put(Svx3DLightOnOff7Item(bOnOff)); break;
    2956             :         default:
    2957           0 :         case 7: aLightItemSet.Put(Svx3DLightcolor8Item(aColor)); aLightItemSet.Put(Svx3DLightOnOff8Item(bOnOff)); break;
    2958             :     }
    2959             : 
    2960           0 :     aCtlLightPreview.GetSvx3DLightControl().Set3DAttributes(aLightItemSet);
    2961           0 :     aCtlLightPreview.GetSvx3DLightControl().SelectLight(nLightSource);
    2962           0 :     aCtlLightPreview.CheckSelection();
    2963           0 : }
    2964             : 
    2965             : 
    2966             : 
    2967           0 : IMPL_LINK_NOARG(Svx3DWin, ChangeLightCallbackHdl)
    2968             : {
    2969           0 :     return( 0L );
    2970             : }
    2971             : 
    2972             : 
    2973             : 
    2974             : 
    2975           0 : IMPL_LINK_NOARG(Svx3DWin, ChangeSelectionCallbackHdl)
    2976             : {
    2977           0 :     const sal_uInt32 nLight(aCtlLightPreview.GetSvx3DLightControl().GetSelectedLight());
    2978           0 :     PushButton* pBtn = 0;
    2979             : 
    2980           0 :     switch( nLight )
    2981             :     {
    2982           0 :         case 0: pBtn = &aBtnLight1; break;
    2983           0 :         case 1: pBtn = &aBtnLight2; break;
    2984           0 :         case 2: pBtn = &aBtnLight3; break;
    2985           0 :         case 3: pBtn = &aBtnLight4; break;
    2986           0 :         case 4: pBtn = &aBtnLight5; break;
    2987           0 :         case 5: pBtn = &aBtnLight6; break;
    2988           0 :         case 6: pBtn = &aBtnLight7; break;
    2989           0 :         case 7: pBtn = &aBtnLight8; break;
    2990           0 :         default: break;
    2991             :     }
    2992             : 
    2993           0 :     if( pBtn )
    2994           0 :         ClickHdl( pBtn );
    2995             :     else
    2996             :     {
    2997             :         // Status: No lamp selected
    2998           0 :         if( aBtnLight1.IsChecked() )
    2999             :         {
    3000           0 :             aBtnLight1.Check( false );
    3001           0 :             aLbLight1.Enable( false );
    3002             :         }
    3003           0 :         else if( aBtnLight2.IsChecked() )
    3004             :         {
    3005           0 :             aBtnLight2.Check( false );
    3006           0 :             aLbLight2.Enable( false );
    3007             :         }
    3008           0 :         else if( aBtnLight3.IsChecked() )
    3009             :         {
    3010           0 :             aBtnLight3.Check( false );
    3011           0 :             aLbLight3.Enable( false );
    3012             :         }
    3013           0 :         else if( aBtnLight4.IsChecked() )
    3014             :         {
    3015           0 :             aBtnLight4.Check( false );
    3016           0 :             aLbLight4.Enable( false );
    3017             :         }
    3018           0 :         else if( aBtnLight5.IsChecked() )
    3019             :         {
    3020           0 :             aBtnLight5.Check( false );
    3021           0 :             aLbLight5.Enable( false );
    3022             :         }
    3023           0 :         else if( aBtnLight6.IsChecked() )
    3024             :         {
    3025           0 :             aBtnLight6.Check( false );
    3026           0 :             aLbLight6.Enable( false );
    3027             :         }
    3028           0 :         else if( aBtnLight7.IsChecked() )
    3029             :         {
    3030           0 :             aBtnLight7.Check( false );
    3031           0 :             aLbLight7.Enable( false );
    3032             :         }
    3033           0 :         else if( aBtnLight8.IsChecked() )
    3034             :         {
    3035           0 :             aBtnLight8.Check( false );
    3036           0 :             aLbLight8.Enable( false );
    3037             :         }
    3038           0 :         aBtnLightColor.Enable( false );
    3039             :     }
    3040             : 
    3041           0 :     return( 0L );
    3042             : }
    3043             : 
    3044             : 
    3045             : // Method to ensure that the LB is also associated with a color
    3046             : // returns true if color was added
    3047             : 
    3048           0 : bool Svx3DWin::LBSelectColor( ColorLB* pLb, const Color& rColor )
    3049             : {
    3050           0 :     bool bRet = false;
    3051             : 
    3052           0 :     pLb->SetNoSelection();
    3053           0 :     pLb->SelectEntry( rColor );
    3054           0 :     if( pLb->GetSelectEntryCount() == 0 )
    3055             :     {
    3056           0 :         OUString aStr(SVX_RESSTR(RID_SVXFLOAT3D_FIX_R));
    3057             : 
    3058           0 :         aStr += OUString::number((sal_Int32)rColor.GetRed());
    3059           0 :         aStr += " ";
    3060           0 :         aStr += SVX_RESSTR(RID_SVXFLOAT3D_FIX_G);
    3061           0 :         aStr += OUString::number((sal_Int32)rColor.GetGreen());
    3062           0 :         aStr += " ";
    3063           0 :         aStr += SVX_RESSTR(RID_SVXFLOAT3D_FIX_B);
    3064           0 :         aStr += OUString::number((sal_Int32)rColor.GetBlue());
    3065             : 
    3066           0 :         sal_uInt16 nPos = pLb->InsertEntry( rColor, aStr );
    3067           0 :         pLb->SelectEntryPos( nPos );
    3068           0 :         bRet = true;
    3069             :     }
    3070           0 :     return( bRet );
    3071             : }
    3072             : 
    3073             : 
    3074           0 : void Svx3DWin::UpdatePreview()
    3075             : {
    3076           0 :     if( pModel == NULL )
    3077           0 :         pModel = new FmFormModel();
    3078             : 
    3079           0 :     if(bOnly3DChanged)
    3080             :     {
    3081             :         // Execute slot
    3082           0 :         SfxDispatcher* pDispatcher = LocalGetDispatcher(pBindings);
    3083           0 :         if (pDispatcher != NULL)
    3084             :         {
    3085           0 :             SfxBoolItem aItem( SID_3D_STATE, true );
    3086             :             pDispatcher->Execute(
    3087           0 :                 SID_3D_STATE, SFX_CALLMODE_SYNCHRON | SFX_CALLMODE_RECORD, &aItem, 0L );
    3088             :         }
    3089             :         // Reset Flag
    3090           0 :         bOnly3DChanged = false;
    3091             :     }
    3092             : 
    3093             :     // Get Itemset
    3094           0 :     SfxItemSet aSet( pModel->GetItemPool(), SDRATTR_START, SDRATTR_END);
    3095             : 
    3096             :     // Get Attributes and set the preview
    3097           0 :     GetAttr( aSet );
    3098           0 :     aCtlPreview.Set3DAttributes( aSet );
    3099           0 :     aCtlLightPreview.GetSvx3DLightControl().Set3DAttributes( aSet );
    3100           0 : }
    3101             : 
    3102             : 
    3103             : // document is to be reloaded, destroy remembered ItemSet
    3104           0 : void Svx3DWin::DocumentReload()
    3105             : {
    3106           0 :     delete mpRemember2DAttributes;
    3107           0 :     mpRemember2DAttributes = 0L;
    3108           0 : }
    3109             : 
    3110             : 
    3111           0 : void Svx3DWin::InitColorLB( const SdrModel* pDoc )
    3112             : {
    3113           0 :     aLbLight1.Fill( pDoc->GetColorList() );
    3114           0 :     aLbLight2.CopyEntries( aLbLight1 );
    3115           0 :     aLbLight3.CopyEntries( aLbLight1 );
    3116           0 :     aLbLight4.CopyEntries( aLbLight1 );
    3117           0 :     aLbLight5.CopyEntries( aLbLight1 );
    3118           0 :     aLbLight6.CopyEntries( aLbLight1 );
    3119           0 :     aLbLight7.CopyEntries( aLbLight1 );
    3120           0 :     aLbLight8.CopyEntries( aLbLight1 );
    3121           0 :     aLbAmbientlight.CopyEntries( aLbLight1 );
    3122           0 :     aLbMatColor.CopyEntries( aLbLight1 );
    3123           0 :     aLbMatEmission.CopyEntries( aLbLight1 );
    3124           0 :     aLbMatSpecular.CopyEntries( aLbLight1 );
    3125             : 
    3126             :     // First...
    3127           0 :     Color aColWhite( COL_WHITE );
    3128           0 :     Color aColBlack( COL_BLACK );
    3129           0 :     aLbLight1.SelectEntry( aColWhite );
    3130           0 :     aLbLight2.SelectEntry( aColWhite );
    3131           0 :     aLbLight3.SelectEntry( aColWhite );
    3132           0 :     aLbLight4.SelectEntry( aColWhite );
    3133           0 :     aLbLight5.SelectEntry( aColWhite );
    3134           0 :     aLbLight6.SelectEntry( aColWhite );
    3135           0 :     aLbLight7.SelectEntry( aColWhite );
    3136           0 :     aLbLight8.SelectEntry( aColWhite );
    3137           0 :     aLbAmbientlight.SelectEntry( aColBlack );
    3138           0 :     aLbMatColor.SelectEntry( aColWhite );
    3139           0 :     aLbMatEmission.SelectEntry( aColBlack );
    3140           0 :     aLbMatSpecular.SelectEntry( aColWhite );
    3141           0 : }
    3142             : 
    3143             : 
    3144           0 : sal_uInt16 Svx3DWin::GetLightSource( const PushButton* pBtn )
    3145             : {
    3146           0 :     sal_uInt16 nLight = 8;
    3147             : 
    3148           0 :     if( pBtn == NULL )
    3149             :     {
    3150           0 :         if( aBtnLight1.IsChecked() )
    3151           0 :             nLight = 0;
    3152           0 :         else if( aBtnLight2.IsChecked() )
    3153           0 :             nLight = 1;
    3154           0 :         else if( aBtnLight3.IsChecked() )
    3155           0 :             nLight = 2;
    3156           0 :         else if( aBtnLight4.IsChecked() )
    3157           0 :             nLight = 3;
    3158           0 :         else if( aBtnLight5.IsChecked() )
    3159           0 :             nLight = 4;
    3160           0 :         else if( aBtnLight6.IsChecked() )
    3161           0 :             nLight = 5;
    3162           0 :         else if( aBtnLight7.IsChecked() )
    3163           0 :             nLight = 6;
    3164           0 :         else if( aBtnLight8.IsChecked() )
    3165           0 :             nLight = 7;
    3166             :     }
    3167             :     else
    3168             :     {
    3169           0 :         if( pBtn == &aBtnLight1 )
    3170           0 :             nLight = 0;
    3171           0 :         else if( pBtn == &aBtnLight2 )
    3172           0 :             nLight = 1;
    3173           0 :         else if( pBtn == &aBtnLight3 )
    3174           0 :             nLight = 2;
    3175           0 :         else if( pBtn == &aBtnLight4 )
    3176           0 :             nLight = 3;
    3177           0 :         else if( pBtn == &aBtnLight5 )
    3178           0 :             nLight = 4;
    3179           0 :         else if( pBtn == &aBtnLight6 )
    3180           0 :             nLight = 5;
    3181           0 :         else if( pBtn == &aBtnLight7 )
    3182           0 :             nLight = 6;
    3183           0 :         else if( pBtn == &aBtnLight8 )
    3184           0 :             nLight = 7;
    3185             :     }
    3186           0 :     return( nLight );
    3187             : };
    3188             : 
    3189             : 
    3190           0 : ColorLB* Svx3DWin::GetLbByButton( const PushButton* pBtn )
    3191             : {
    3192           0 :     ColorLB* pLb = NULL;
    3193             : 
    3194           0 :     if( pBtn == NULL )
    3195             :     {
    3196           0 :         if( aBtnLight1.IsChecked() )
    3197           0 :             pLb = &aLbLight1;
    3198           0 :         else if( aBtnLight2.IsChecked() )
    3199           0 :             pLb = &aLbLight2;
    3200           0 :         else if( aBtnLight3.IsChecked() )
    3201           0 :             pLb = &aLbLight3;
    3202           0 :         else if( aBtnLight4.IsChecked() )
    3203           0 :             pLb = &aLbLight4;
    3204           0 :         else if( aBtnLight5.IsChecked() )
    3205           0 :             pLb = &aLbLight5;
    3206           0 :         else if( aBtnLight6.IsChecked() )
    3207           0 :             pLb = &aLbLight6;
    3208           0 :         else if( aBtnLight7.IsChecked() )
    3209           0 :             pLb = &aLbLight7;
    3210           0 :         else if( aBtnLight8.IsChecked() )
    3211           0 :             pLb = &aLbLight8;
    3212             :     }
    3213             :     else
    3214             :     {
    3215           0 :         if( pBtn == &aBtnLight1 )
    3216           0 :             pLb = &aLbLight1;
    3217           0 :         else if( pBtn == &aBtnLight2 )
    3218           0 :             pLb = &aLbLight2;
    3219           0 :         else if( pBtn == &aBtnLight3 )
    3220           0 :             pLb = &aLbLight3;
    3221           0 :         else if( pBtn == &aBtnLight4 )
    3222           0 :             pLb = &aLbLight4;
    3223           0 :         else if( pBtn == &aBtnLight5 )
    3224           0 :             pLb = &aLbLight5;
    3225           0 :         else if( pBtn == &aBtnLight6 )
    3226           0 :             pLb = &aLbLight6;
    3227           0 :         else if( pBtn == &aBtnLight7 )
    3228           0 :             pLb = &aLbLight7;
    3229           0 :         else if( pBtn == &aBtnLight8 )
    3230           0 :             pLb = &aLbLight8;
    3231             :     }
    3232           0 :     return( pLb );
    3233             : };
    3234             : 
    3235             : // Derivation from SfxChildWindow as "containers" for effects
    3236             : 
    3237           0 : Svx3DChildWindow::Svx3DChildWindow( Window* _pParent,
    3238             :                                                          sal_uInt16 nId,
    3239             :                                                          SfxBindings* pBindings,
    3240             :                                                          SfxChildWinInfo* pInfo ) :
    3241           0 :     SfxChildWindow( _pParent, nId )
    3242             : {
    3243           0 :     Svx3DWin* pWin = new Svx3DWin( pBindings, this, _pParent );
    3244           0 :     pWindow = pWin;
    3245             : 
    3246           0 :     eChildAlignment = SFX_ALIGN_NOALIGNMENT;
    3247             : 
    3248           0 :     pWin->Initialize( pInfo );
    3249           0 : }
    3250             : 
    3251           0 : Svx3DCtrlItem::Svx3DCtrlItem( sal_uInt16 _nId,
    3252             :                                 SfxBindings* _pBindings) :
    3253           0 :     SfxControllerItem( _nId, *_pBindings )
    3254             : {
    3255           0 : }
    3256             : 
    3257             : 
    3258           0 : void Svx3DCtrlItem::StateChanged( sal_uInt16 /*nSId*/,
    3259             :                         SfxItemState /*eState*/, const SfxPoolItem* /*pItem*/ )
    3260             : {
    3261           0 : }
    3262             : 
    3263             : // ControllerItem for Status Slot SID_CONVERT_TO_3D
    3264             : 
    3265           0 : SvxConvertTo3DItem::SvxConvertTo3DItem(sal_uInt16 _nId, SfxBindings* _pBindings)
    3266             : :   SfxControllerItem(_nId, *_pBindings),
    3267           0 :     bState(false)
    3268             : {
    3269           0 : }
    3270             : 
    3271           0 : void SvxConvertTo3DItem::StateChanged(sal_uInt16 /*_nId*/, SfxItemState eState, const SfxPoolItem* /*pState*/)
    3272             : {
    3273           0 :     bool bNewState = (eState != SFX_ITEM_DISABLED);
    3274           0 :     if(bNewState != bState)
    3275             :     {
    3276           0 :         bState = bNewState;
    3277           0 :         SfxDispatcher* pDispatcher = LocalGetDispatcher(&GetBindings());
    3278           0 :         if (pDispatcher != NULL)
    3279             :         {
    3280           0 :             SfxBoolItem aItem( SID_3D_STATE, true );
    3281             :             pDispatcher->Execute(
    3282           0 :                 SID_3D_STATE, SFX_CALLMODE_ASYNCHRON|SFX_CALLMODE_RECORD, &aItem, 0L);
    3283             :         }
    3284             :     }
    3285         255 : }
    3286             : 
    3287             : 
    3288             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10