LCOV - code coverage report
Current view: top level - svx/source/sidebar/area - AreaTransparencyGradientControl.cxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 1 211 0.5 %
Date: 2015-06-13 12:38:46 Functions: 2 15 13.3 %
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             : #include "AreaTransparencyGradientControl.hxx"
      20             : #include "AreaPropertyPanel.hxx"
      21             : #include "AreaPropertyPanel.hrc"
      22             : 
      23             : #include <svx/dialogs.hrc>
      24             : #include <svx/dialmgr.hxx>
      25             : #include <svx/xflftrit.hxx>
      26             : #include <sfx2/sidebar/ResourceDefinitions.hrc>
      27             : #include <sfx2/bindings.hxx>
      28             : #include <sfx2/dispatch.hxx>
      29             : 
      30             : namespace svx { namespace sidebar {
      31             : 
      32             : // positioning helpers
      33             : #define APOS1_1 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL), MAP_APPFONT))
      34             : #define APOS2_1 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL), MAP_APPFONT))
      35             : #define APOS1_2 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL+CONTROL_WIDTH+CONTROL_SPACING_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL), MAP_APPFONT))
      36             : #define APOS2_2 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL+CONTROL_WIDTH+CONTROL_SPACING_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL), MAP_APPFONT))
      37             : #define APOS1_3 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL+MBOX_HEIGHT+CONTROL_SPACING_VERTICAL), MAP_APPFONT))
      38             : #define APOS1_4 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + 2*(FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL)+MBOX_HEIGHT+CONTROL_SPACING_VERTICAL), MAP_APPFONT))
      39             : #define APOS2_3 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL+CONTROL_WIDTH+CONTROL_SPACING_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL+MBOX_HEIGHT+CONTROL_SPACING_VERTICAL), MAP_APPFONT))
      40             : #define APOS2_4 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL+CONTROL_WIDTH+CONTROL_SPACING_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + 2*(FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL)+MBOX_HEIGHT+CONTROL_SPACING_VERTICAL), MAP_APPFONT))
      41             : #define APOS1_5 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + 2*(FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL+MBOX_HEIGHT+CONTROL_SPACING_VERTICAL)), MAP_APPFONT))
      42             : #define APOS1_6 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + 3*(FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL)+2*(MBOX_HEIGHT+CONTROL_SPACING_VERTICAL)), MAP_APPFONT))
      43             : #define APOS2_5 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL+CONTROL_WIDTH+CONTROL_SPACING_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + 2*(FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL+MBOX_HEIGHT+CONTROL_SPACING_VERTICAL)), MAP_APPFONT))
      44             : #define APOS2_6 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL+CONTROL_WIDTH+CONTROL_SPACING_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + 3*(FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL)+2*(MBOX_HEIGHT+CONTROL_SPACING_VERTICAL)), MAP_APPFONT))
      45             : #define APOS1_7 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + 3*(FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL+MBOX_HEIGHT+CONTROL_SPACING_VERTICAL)), MAP_APPFONT))
      46             : #define APOS1_8 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + 4*(FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL)+3*(MBOX_HEIGHT+CONTROL_SPACING_VERTICAL)), MAP_APPFONT))
      47             : #define APOS_Left_Right_1 Point(LogicToPixel(Point(LEFT_RIGHT_X1,LEFT_RIGHT_Y1), MAP_APPFONT))
      48             : #define APOS_Left_Right_2 Point(LogicToPixel(Point(LEFT_RIGHT_X2,LEFT_RIGHT_Y1), MAP_APPFONT))
      49             : #define APOS_Left_Right_3 Point(LogicToPixel(Point(LEFT_RIGHT_X1,LEFT_RIGHT_Y2), MAP_APPFONT))
      50             : #define APOS_Left_Right_4 Point(LogicToPixel(Point(LEFT_RIGHT_X2,LEFT_RIGHT_Y2), MAP_APPFONT))
      51             : 
      52             : 
      53             : 
      54             : 
      55           0 : AreaTransparencyGradientControl::AreaTransparencyGradientControl (
      56             :     vcl::Window* pParent,
      57             :     AreaPropertyPanel& rPanel)
      58           0 :     : PopupControl( pParent,SVX_RES(RID_POPUPPANEL_AREAPAGE_TRGR)),
      59           0 :       maFtTrgrCenterX(VclPtr<FixedText>::Create(this, SVX_RES(FT_TRGR_CENTER_X))),
      60           0 :       maMtrTrgrCenterX(VclPtr<MetricField>::Create(this, SVX_RES(MTR_TRGR_CENTER_X))),
      61           0 :       maFtTrgrCenterY(VclPtr<FixedText>::Create(this, SVX_RES(FT_TRGR_CENTER_Y))),
      62           0 :       maMtrTrgrCenterY(VclPtr<MetricField>::Create(this, SVX_RES(MTR_TRGR_CENTER_Y))),
      63           0 :       maFtTrgrAngle(VclPtr<FixedText>::Create(this, SVX_RES(FT_TRGR_ANGLE))),
      64           0 :       maMtrTrgrAngle(VclPtr<MetricField>::Create(this, SVX_RES(MTR_TRGR_ANGLE))),
      65           0 :       maBtnLeft45(VclPtr<ToolBox>::Create(this, SVX_RES(BTN_LEFT_SECOND))),
      66           0 :       maBtnRight45(VclPtr<ToolBox>::Create(this, SVX_RES(BTN_RIGHT_FIRST))),
      67           0 :       maFtTrgrStartValue(VclPtr<FixedText>::Create(this, SVX_RES(FT_TRGR_START_VALUE))),
      68           0 :       maMtrTrgrStartValue(VclPtr<MetricField>::Create(this, SVX_RES(MTR_TRGR_START_VALUE))),
      69           0 :       maFtTrgrEndValue(VclPtr<FixedText>::Create(this, SVX_RES(FT_TRGR_END_VALUE))),
      70           0 :       maMtrTrgrEndValue(VclPtr<MetricField>::Create(this, SVX_RES(MTR_TRGR_END_VALUE))),
      71           0 :       maFtTrgrBorder(VclPtr<FixedText>::Create(this, SVX_RES(FT_TRGR_BORDER))),
      72           0 :       maMtrTrgrBorder(VclPtr<MetricField>::Create(this, SVX_RES(MTR_TRGR_BORDER))),
      73           0 :       maRotLeft( SVX_RES(IMG_ROT_LEFT)),
      74           0 :       maRotRight( SVX_RES(IMG_ROT_RIGHT)),
      75             :       mrAreaPropertyPanel(rPanel),
      76           0 :       mpBindings(NULL)
      77             : {
      78           0 :     Link<> aLink = LINK( this, AreaTransparencyGradientControl, ModifiedTrgrHdl_Impl);
      79           0 :     maMtrTrgrCenterX->SetModifyHdl( aLink );
      80           0 :     maMtrTrgrCenterY->SetModifyHdl( aLink );
      81           0 :     maMtrTrgrAngle->SetModifyHdl( aLink );
      82           0 :     maMtrTrgrBorder->SetModifyHdl( aLink );
      83           0 :     maMtrTrgrStartValue->SetModifyHdl( aLink );
      84           0 :     maMtrTrgrEndValue->SetModifyHdl( aLink );
      85           0 :     maBtnLeft45->SetSelectHdl( LINK( this, AreaTransparencyGradientControl, Left_Click45_Impl) );
      86           0 :     maBtnRight45->SetSelectHdl( LINK( this, AreaTransparencyGradientControl, Right_Click45_Impl) );
      87           0 :     maBtnLeft45->SetItemImage(1,maRotLeft);
      88           0 :     Size aTbxSize = maBtnLeft45->CalcWindowSizePixel();
      89           0 :     maBtnLeft45->SetOutputSizePixel( aTbxSize );
      90           0 :     maBtnLeft45->SetQuickHelpText(1, SVX_RESSTR(STR_HELP_LEFT));    //acc wj
      91             : 
      92           0 :     maBtnRight45->SetItemImage(1,maRotRight);
      93           0 :     aTbxSize = maBtnRight45->CalcWindowSizePixel();
      94           0 :     maBtnRight45->SetOutputSizePixel( aTbxSize );
      95           0 :     maBtnRight45->SetQuickHelpText(1, SVX_RESSTR(STR_HELP_RIGHT));  //acc wj
      96             : 
      97           0 :     maBtnLeft45->SetBackground(Wallpaper());
      98           0 :     maBtnLeft45->SetPaintTransparent(true);
      99           0 :     maBtnRight45->SetBackground(Wallpaper());
     100           0 :     maBtnRight45->SetPaintTransparent(true);
     101             : 
     102           0 :     FreeResource();
     103           0 :     mpBindings = mrAreaPropertyPanel.GetBindings();
     104           0 : }
     105             : 
     106             : 
     107           0 : AreaTransparencyGradientControl::~AreaTransparencyGradientControl()
     108             : {
     109           0 :     disposeOnce();
     110           0 : }
     111             : 
     112           0 : void AreaTransparencyGradientControl::dispose()
     113             : {
     114           0 :     maFtTrgrCenterX.disposeAndClear();
     115           0 :     maMtrTrgrCenterX.disposeAndClear();
     116           0 :     maFtTrgrCenterY.disposeAndClear();
     117           0 :     maMtrTrgrCenterY.disposeAndClear();
     118           0 :     maFtTrgrAngle.disposeAndClear();
     119           0 :     maMtrTrgrAngle.disposeAndClear();
     120           0 :     maBtnLeft45.disposeAndClear();
     121           0 :     maBtnRight45.disposeAndClear();
     122           0 :     maFtTrgrStartValue.disposeAndClear();
     123           0 :     maMtrTrgrStartValue.disposeAndClear();
     124           0 :     maFtTrgrEndValue.disposeAndClear();
     125           0 :     maMtrTrgrEndValue.disposeAndClear();
     126           0 :     maFtTrgrBorder.disposeAndClear();
     127           0 :     maMtrTrgrBorder.disposeAndClear();
     128           0 :     PopupControl::dispose();
     129           0 : }
     130             : 
     131           0 : void AreaTransparencyGradientControl::Rearrange(XFillFloatTransparenceItem* pGradientItem)
     132             : {
     133           0 :     InitStatus(pGradientItem);
     134           0 :     const XGradient& rGradient = pGradientItem->GetGradientValue();
     135           0 :     css::awt::GradientStyle eXGS(rGradient.GetGradientStyle());
     136           0 :     Size aSize(POP_WIDTH,POP_HEIGHT);
     137           0 :     aSize = LogicToPixel( aSize, MapMode(MAP_APPFONT) );
     138           0 :     Size aSize2(POP_WIDTH,POP_HEIGHT2);
     139           0 :     aSize2 = LogicToPixel( aSize2, MapMode(MAP_APPFONT) );
     140           0 :     long aPosY = 0;
     141           0 :     Point aPointAngle;
     142           0 :     Size aSizeAngle = maMtrTrgrAngle->GetSizePixel();
     143           0 :     Size aTbxSize = maBtnLeft45->CalcWindowSizePixel();
     144             : 
     145           0 :     switch(eXGS)
     146             :     {
     147             :     case css::awt::GradientStyle_LINEAR:
     148             :     case css::awt::GradientStyle_AXIAL:
     149           0 :         maFtTrgrCenterX->Hide();
     150           0 :         maMtrTrgrCenterX->Hide();
     151           0 :         maFtTrgrCenterY->Hide();
     152           0 :         maMtrTrgrCenterY->Hide();
     153           0 :         maFtTrgrAngle->Show();
     154           0 :         maFtTrgrAngle->SetPosPixel(APOS1_1);
     155           0 :         maMtrTrgrAngle->Show();
     156           0 :         maMtrTrgrAngle->SetPosPixel(APOS2_1);
     157           0 :         maFtTrgrStartValue->SetPosPixel(APOS1_3);
     158           0 :         maMtrTrgrStartValue->SetPosPixel(APOS1_4);
     159           0 :         maFtTrgrEndValue->SetPosPixel(APOS2_3);
     160           0 :         maMtrTrgrEndValue->SetPosPixel(APOS2_4);
     161           0 :         maFtTrgrBorder->SetPosPixel(APOS1_5);
     162           0 :         maMtrTrgrBorder->SetPosPixel(APOS1_6);
     163             : 
     164           0 :         maBtnLeft45->Show();
     165           0 :         maBtnRight45->Show();
     166             : 
     167           0 :         aPointAngle = maMtrTrgrAngle->GetPosPixel();
     168           0 :         aPosY = aPointAngle.getY() + aSizeAngle.getHeight() - aTbxSize.getHeight();
     169             : 
     170           0 :         maBtnLeft45->SetPosPixel(Point(APOS_Left_Right_1.getX(), aPosY));
     171           0 :         maBtnRight45->SetPosPixel(Point(APOS_Left_Right_2.getX(), aPosY));
     172             : 
     173           0 :         SetSizePixel(aSize2);
     174           0 :         break;
     175             : 
     176             :     case css::awt::GradientStyle_RADIAL:
     177           0 :         maFtTrgrCenterX->Show();
     178           0 :         maFtTrgrCenterX->SetPosPixel(APOS1_1);
     179           0 :         maMtrTrgrCenterX->Show();
     180           0 :         maMtrTrgrCenterX->SetPosPixel(APOS2_1);
     181           0 :         maFtTrgrCenterY->Show();
     182           0 :         maFtTrgrCenterY->SetPosPixel(APOS1_2);
     183           0 :         maMtrTrgrCenterY->Show();
     184           0 :         maMtrTrgrCenterY->SetPosPixel(APOS2_2);
     185           0 :         maFtTrgrAngle->Hide();
     186           0 :         maMtrTrgrAngle->Hide();
     187           0 :         maFtTrgrStartValue->SetPosPixel(APOS1_3);
     188           0 :         maMtrTrgrStartValue->SetPosPixel(APOS1_4);
     189           0 :         maFtTrgrEndValue->SetPosPixel(APOS2_3);
     190           0 :         maMtrTrgrEndValue->SetPosPixel(APOS2_4);
     191           0 :         maFtTrgrBorder->SetPosPixel(APOS1_5);
     192           0 :         maMtrTrgrBorder->SetPosPixel(APOS1_6);
     193             : 
     194           0 :         maBtnLeft45->Hide();
     195           0 :         maBtnRight45->Hide();
     196             : 
     197           0 :         SetSizePixel(aSize2);
     198             : 
     199           0 :         break;
     200             : 
     201             :     case css::awt::GradientStyle_ELLIPTICAL:
     202             :     case css::awt::GradientStyle_SQUARE:
     203             :     case css::awt::GradientStyle_RECT:
     204           0 :         maFtTrgrCenterX->Show();
     205           0 :         maFtTrgrCenterX->SetPosPixel(APOS1_1);
     206           0 :         maMtrTrgrCenterX->Show();
     207           0 :         maMtrTrgrCenterX->SetPosPixel(APOS2_1);
     208           0 :         maFtTrgrCenterY->Show();
     209           0 :         maFtTrgrCenterY->SetPosPixel(APOS1_2);
     210           0 :         maMtrTrgrCenterY->Show();
     211           0 :         maMtrTrgrCenterY->SetPosPixel(APOS2_2);
     212           0 :         maFtTrgrAngle->Show();
     213           0 :         maFtTrgrAngle->SetPosPixel(APOS1_3);
     214           0 :         maMtrTrgrAngle->Show();
     215           0 :         maMtrTrgrAngle->SetPosPixel(APOS1_4);
     216             : 
     217           0 :         maFtTrgrStartValue->SetPosPixel(APOS1_5);
     218           0 :         maMtrTrgrStartValue->SetPosPixel(APOS1_6);
     219           0 :         maFtTrgrEndValue->SetPosPixel(APOS2_5);
     220           0 :         maMtrTrgrEndValue->SetPosPixel(APOS2_6);
     221           0 :         maFtTrgrBorder->SetPosPixel(APOS1_7);
     222           0 :         maMtrTrgrBorder->SetPosPixel(APOS1_8);
     223             : 
     224           0 :         maBtnLeft45->Show();
     225           0 :         maBtnRight45->Show();
     226             : 
     227           0 :         aPointAngle = maMtrTrgrAngle->GetPosPixel();
     228           0 :         aPosY = aPointAngle.getY() + aSizeAngle.getHeight() - aTbxSize.getHeight();
     229             : 
     230           0 :         maBtnLeft45->SetPosPixel(Point(APOS_Left_Right_3.getX(), aPosY));
     231           0 :         maBtnRight45->SetPosPixel(Point(APOS_Left_Right_4.getX(), aPosY));
     232             : 
     233           0 :         SetSizePixel(aSize);
     234             : 
     235           0 :         break;
     236             : 
     237             :     default:
     238           0 :         break;
     239             :     }
     240           0 : }
     241             : 
     242             : 
     243             : 
     244             : 
     245           0 : void AreaTransparencyGradientControl::InitStatus(XFillFloatTransparenceItem* pGradientItem)
     246             : {
     247           0 :     const XGradient& rGradient = pGradientItem->GetGradientValue();
     248             : 
     249           0 :     XGradient aGradient;
     250             : 
     251           0 :     if (rGradient.GetXOffset() == AreaPropertyPanel::DEFAULT_CENTERX
     252           0 :         && rGradient.GetYOffset() == AreaPropertyPanel::DEFAULT_CENTERY
     253           0 :         && (rGradient.GetAngle() / 10) == AreaPropertyPanel::DEFAULT_ANGLE
     254           0 :         && ((sal_uInt16)((((sal_uInt16)rGradient.GetStartColor().GetRed() + 1) * 100) / 255))
     255           0 :             == AreaPropertyPanel::DEFAULT_STARTVALUE
     256           0 :         && ((sal_uInt16)((((sal_uInt16)rGradient.GetEndColor().GetRed() + 1) * 100) / 255))
     257           0 :             == AreaPropertyPanel::DEFAULT_ENDVALUE
     258           0 :         && rGradient.GetBorder() == AreaPropertyPanel::DEFAULT_BORDER)
     259             :     {
     260           0 :         aGradient = mrAreaPropertyPanel.GetGradient(rGradient.GetGradientStyle());
     261             :     }
     262             :     else
     263             :     {
     264           0 :         aGradient = rGradient;
     265             :     }
     266           0 :     maMtrTrgrCenterX->SetValue(aGradient.GetXOffset());
     267           0 :     maMtrTrgrCenterY->SetValue(aGradient.GetYOffset());
     268           0 :     maMtrTrgrAngle->SetValue(aGradient.GetAngle() / 10);
     269           0 :     maMtrTrgrStartValue->SetValue((sal_uInt16)((((sal_uInt16)aGradient.GetStartColor().GetRed() + 1) * 100) / 255));
     270           0 :     maMtrTrgrEndValue->SetValue((sal_uInt16)((((sal_uInt16)aGradient.GetEndColor().GetRed() + 1) * 100) / 255));
     271           0 :     maMtrTrgrBorder->SetValue(aGradient.GetBorder());
     272           0 : }
     273             : 
     274             : 
     275             : 
     276             : 
     277           0 : void AreaTransparencyGradientControl::ExecuteValueModify( sal_uInt8 nStartCol, sal_uInt8 nEndCol )
     278             : {
     279             :     //Added
     280           0 :     sal_Int16 aMtrValue = (sal_Int16)maMtrTrgrAngle->GetValue();
     281           0 :     while(aMtrValue<0)
     282           0 :         aMtrValue += 360;
     283           0 :     sal_uInt16 nVal = aMtrValue/360;
     284           0 :     nVal = aMtrValue - nVal*360;
     285           0 :     maMtrTrgrAngle->SetValue(nVal);
     286             :     //End of new code
     287             :     XGradient aTmpGradient(
     288             :         Color(nStartCol, nStartCol, nStartCol),
     289             :         Color(nEndCol, nEndCol, nEndCol),
     290           0 :         (css::awt::GradientStyle)(mrAreaPropertyPanel.GetSelectedTransparencyTypeIndex()-2),
     291           0 :         (sal_uInt16)maMtrTrgrAngle->GetValue() * 10,
     292           0 :         (sal_uInt16)maMtrTrgrCenterX->GetValue(),
     293           0 :         (sal_uInt16)maMtrTrgrCenterY->GetValue(),
     294           0 :         (sal_uInt16)maMtrTrgrBorder->GetValue(),
     295           0 :         100, 100);
     296             : 
     297           0 :     mrAreaPropertyPanel.SetGradient(aTmpGradient);
     298             : 
     299           0 :     SfxItemPool* pPool = NULL;
     300           0 :     bool bEnable = true;
     301           0 :     XFillFloatTransparenceItem aGradientItem(pPool,aTmpGradient, bEnable );
     302             : 
     303           0 :     mpBindings->GetDispatcher()->Execute( SID_ATTR_FILL_FLOATTRANSPARENCE, SfxCallMode::RECORD, &aGradientItem, 0L );
     304           0 : }
     305             : 
     306             : 
     307             : 
     308             : 
     309           0 : IMPL_LINK_NOARG(AreaTransparencyGradientControl, ModifiedTrgrHdl_Impl)
     310             : {
     311           0 :     sal_uInt8 nStartCol = (sal_uInt8)(((sal_uInt16)maMtrTrgrStartValue->GetValue() * 255) / 100);
     312           0 :     sal_uInt8 nEndCol = (sal_uInt8)(((sal_uInt16)maMtrTrgrEndValue->GetValue() * 255) / 100);
     313           0 :     ExecuteValueModify( nStartCol, nEndCol );
     314           0 :     return 0L;
     315             : }
     316             : 
     317             : 
     318             : 
     319             : 
     320           0 : IMPL_LINK_NOARG_TYPED(AreaTransparencyGradientControl, Left_Click45_Impl, ToolBox *, void)
     321             : {
     322           0 :     sal_uInt8 nStartCol = (sal_uInt8)(((sal_uInt16)maMtrTrgrStartValue->GetValue() * 255) / 100);
     323           0 :     sal_uInt8 nEndCol = (sal_uInt8)(((sal_uInt16)maMtrTrgrEndValue->GetValue() * 255) / 100);
     324           0 :     sal_uInt16 aTemp = (sal_uInt16)maMtrTrgrAngle->GetValue();
     325           0 :     if(aTemp>=315)
     326           0 :         aTemp -= 360;
     327           0 :     aTemp += 45;
     328           0 :     maMtrTrgrAngle->SetValue(aTemp);
     329           0 :     ExecuteValueModify( nStartCol, nEndCol );
     330           0 : }
     331             : 
     332             : 
     333             : 
     334             : 
     335           0 : IMPL_LINK_NOARG_TYPED(AreaTransparencyGradientControl, Right_Click45_Impl, ToolBox *, void)
     336             : {
     337           0 :     sal_uInt8 nStartCol = (sal_uInt8)(((sal_uInt16)maMtrTrgrStartValue->GetValue() * 255) / 100);
     338           0 :     sal_uInt8 nEndCol = (sal_uInt8)(((sal_uInt16)maMtrTrgrEndValue->GetValue() * 255) / 100);
     339           0 :     sal_uInt16 aTemp = (sal_uInt16)maMtrTrgrAngle->GetValue();
     340           0 :     if(aTemp<45)
     341           0 :         aTemp += 360;
     342           0 :     aTemp -= 45;
     343           0 :     maMtrTrgrAngle->SetValue(aTemp);
     344           0 :     ExecuteValueModify( nStartCol, nEndCol );
     345           0 : }
     346             : 
     347         390 : } } // end of namespace svx::sidebar
     348             : 
     349             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11