diff options
Diffstat (limited to 'svx/source/sidebar/area')
-rw-r--r-- | svx/source/sidebar/area/AreaPropertyPanel.cxx | 41 | ||||
-rw-r--r-- | svx/source/sidebar/area/AreaPropertyPanel.hxx | 37 | ||||
-rw-r--r-- | svx/source/sidebar/area/AreaTransparencyGradientControl.cxx | 274 | ||||
-rw-r--r-- | svx/source/sidebar/area/AreaTransparencyGradientControl.hxx | 29 |
4 files changed, 213 insertions, 168 deletions
diff --git a/svx/source/sidebar/area/AreaPropertyPanel.cxx b/svx/source/sidebar/area/AreaPropertyPanel.cxx index ab4a4ff4e516..6e2294b56e1d 100644 --- a/svx/source/sidebar/area/AreaPropertyPanel.cxx +++ b/svx/source/sidebar/area/AreaPropertyPanel.cxx @@ -113,12 +113,35 @@ AreaPropertyPanel::AreaPropertyPanel( } - AreaPropertyPanel::~AreaPropertyPanel() { + disposeOnce(); } - +void AreaPropertyPanel::dispose() +{ + mpColorTextFT.clear(); + mpLbFillType.clear(); + mpLbFillAttr.clear(); + mpToolBoxColor.clear(); + mpTrspTextFT.clear(); + mpLBTransType.clear(); + mpMTRTransparent.clear(); + mpBTNGradient.clear(); + + maStyleControl.dispose(); + maColorControl.dispose(); + maGradientControl.dispose(); + maHatchControl.dispose(); + maBitmapControl.dispose(); + maGradientListControl.dispose(); + maHatchListControl.dispose(); + maBitmapListControl.dispose(); + maFillTransparenceController.dispose(); + maFillFloatTransparenceController.dispose(); + + PanelLayout::dispose(); +} void AreaPropertyPanel::Initialize() { @@ -482,9 +505,9 @@ IMPL_LINK( AreaPropertyPanel, SelectFillAttrHdl, ListBox*, pToolBox ) } -PopupControl* AreaPropertyPanel::CreateTransparencyGradientControl (PopupContainer* pParent) +VclPtr<PopupControl> AreaPropertyPanel::CreateTransparencyGradientControl (PopupContainer* pParent) { - return new AreaTransparencyGradientControl(pParent, *this); + return VclPtrInstance<AreaTransparencyGradientControl>(pParent, *this); } @@ -504,7 +527,7 @@ void AreaPropertyPanel::SetupIcons() -AreaPropertyPanel* AreaPropertyPanel::Create ( +VclPtr<vcl::Window> AreaPropertyPanel::Create ( vcl::Window* pParent, const css::uno::Reference<css::frame::XFrame>& rxFrame, SfxBindings* pBindings) @@ -516,10 +539,10 @@ AreaPropertyPanel* AreaPropertyPanel::Create ( if (pBindings == NULL) throw lang::IllegalArgumentException("no SfxBindings given to AreaPropertyPanel::Create", NULL, 2); - return new AreaPropertyPanel( - pParent, - rxFrame, - pBindings); + return VclPtr<AreaPropertyPanel>::Create( + pParent, + rxFrame, + pBindings); } diff --git a/svx/source/sidebar/area/AreaPropertyPanel.hxx b/svx/source/sidebar/area/AreaPropertyPanel.hxx index 544b91b7b7cf..14af720d76bd 100644 --- a/svx/source/sidebar/area/AreaPropertyPanel.hxx +++ b/svx/source/sidebar/area/AreaPropertyPanel.hxx @@ -35,6 +35,7 @@ #include <vcl/lstbox.hxx> #include <vcl/field.hxx> #include <vcl/fixed.hxx> +#include <vcl/vclptr.hxx> #include <svl/intitem.hxx> #include <com/sun/star/ui/XUIElement.hpp> #include <boost/scoped_ptr.hpp> @@ -53,7 +54,10 @@ class AreaPropertyPanel public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface { public: - static AreaPropertyPanel* Create( + virtual ~AreaPropertyPanel(); + virtual void dispose() SAL_OVERRIDE; + + static VclPtr<vcl::Window> Create( vcl::Window* pParent, const css::uno::Reference<css::frame::XFrame>& rxFrame, SfxBindings* pBindings); @@ -80,6 +84,12 @@ public: void SetGradient (const XGradient& rGradient); sal_Int32 GetSelectedTransparencyTypeIndex() const; + // constructor/destuctor + AreaPropertyPanel( + vcl::Window* pParent, + const css::uno::Reference<css::frame::XFrame>& rxFrame, + SfxBindings* pBindings); + private: sal_uInt16 meLastXFS; @@ -96,14 +106,14 @@ private: XGradient maGradientRect; //ui controls - FixedText* mpColorTextFT; - SvxFillTypeBox* mpLbFillType; - SvxFillAttrBox* mpLbFillAttr; - ToolBox* mpToolBoxColor; // for new color picker - FixedText* mpTrspTextFT; - ListBox* mpLBTransType; - MetricField* mpMTRTransparent; - ToolBox* mpBTNGradient; + VclPtr<FixedText> mpColorTextFT; + VclPtr<SvxFillTypeBox> mpLbFillType; + VclPtr<SvxFillAttrBox> mpLbFillAttr; + VclPtr<ToolBox> mpToolBoxColor; // for new color picker + VclPtr<FixedText> mpTrspTextFT; + VclPtr<ListBox> mpLBTransType; + VclPtr<MetricField> mpMTRTransparent; + VclPtr<ToolBox> mpBTNGradient; ::boost::scoped_ptr< XFillStyleItem > mpStyleItem; ::boost::scoped_ptr< XFillColorItem > mpColorItem; @@ -143,16 +153,9 @@ private: DECL_LINK(ModifyTransparentHdl_Impl, void*); // for transparency gradient - PopupControl* CreateTransparencyGradientControl (PopupContainer* pParent); + VclPtr<PopupControl> CreateTransparencyGradientControl (PopupContainer* pParent); DECL_LINK( ClickTrGrHdl_Impl, ToolBox* ); - // constructor/destuctor - AreaPropertyPanel( - vcl::Window* pParent, - const css::uno::Reference<css::frame::XFrame>& rxFrame, - SfxBindings* pBindings); - virtual ~AreaPropertyPanel(); - static void SetupIcons(); void Initialize(); void Update(); diff --git a/svx/source/sidebar/area/AreaTransparencyGradientControl.cxx b/svx/source/sidebar/area/AreaTransparencyGradientControl.cxx index 61bd9f120243..9d31ad746ade 100644 --- a/svx/source/sidebar/area/AreaTransparencyGradientControl.cxx +++ b/svx/source/sidebar/area/AreaTransparencyGradientControl.cxx @@ -56,60 +56,78 @@ AreaTransparencyGradientControl::AreaTransparencyGradientControl ( vcl::Window* pParent, AreaPropertyPanel& rPanel) : PopupControl( pParent,SVX_RES(RID_POPUPPANEL_AREAPAGE_TRGR)), - maFtTrgrCenterX(this, SVX_RES(FT_TRGR_CENTER_X)), - maMtrTrgrCenterX(this, SVX_RES(MTR_TRGR_CENTER_X)), - maFtTrgrCenterY(this, SVX_RES(FT_TRGR_CENTER_Y)), - maMtrTrgrCenterY(this, SVX_RES(MTR_TRGR_CENTER_Y)), - maFtTrgrAngle(this, SVX_RES(FT_TRGR_ANGLE)), - maMtrTrgrAngle(this, SVX_RES(MTR_TRGR_ANGLE)), - maBtnLeft45(this, SVX_RES(BTN_LEFT_SECOND)), - maBtnRight45(this, SVX_RES(BTN_RIGHT_FIRST)), - maFtTrgrStartValue(this, SVX_RES(FT_TRGR_START_VALUE)), - maMtrTrgrStartValue(this, SVX_RES(MTR_TRGR_START_VALUE)), - maFtTrgrEndValue(this, SVX_RES(FT_TRGR_END_VALUE)), - maMtrTrgrEndValue(this, SVX_RES(MTR_TRGR_END_VALUE)), - maFtTrgrBorder(this, SVX_RES(FT_TRGR_BORDER)), - maMtrTrgrBorder(this, SVX_RES(MTR_TRGR_BORDER)), + maFtTrgrCenterX(VclPtr<FixedText>::Create(this, SVX_RES(FT_TRGR_CENTER_X))), + maMtrTrgrCenterX(VclPtr<MetricField>::Create(this, SVX_RES(MTR_TRGR_CENTER_X))), + maFtTrgrCenterY(VclPtr<FixedText>::Create(this, SVX_RES(FT_TRGR_CENTER_Y))), + maMtrTrgrCenterY(VclPtr<MetricField>::Create(this, SVX_RES(MTR_TRGR_CENTER_Y))), + maFtTrgrAngle(VclPtr<FixedText>::Create(this, SVX_RES(FT_TRGR_ANGLE))), + maMtrTrgrAngle(VclPtr<MetricField>::Create(this, SVX_RES(MTR_TRGR_ANGLE))), + maBtnLeft45(VclPtr<ToolBox>::Create(this, SVX_RES(BTN_LEFT_SECOND))), + maBtnRight45(VclPtr<ToolBox>::Create(this, SVX_RES(BTN_RIGHT_FIRST))), + maFtTrgrStartValue(VclPtr<FixedText>::Create(this, SVX_RES(FT_TRGR_START_VALUE))), + maMtrTrgrStartValue(VclPtr<MetricField>::Create(this, SVX_RES(MTR_TRGR_START_VALUE))), + maFtTrgrEndValue(VclPtr<FixedText>::Create(this, SVX_RES(FT_TRGR_END_VALUE))), + maMtrTrgrEndValue(VclPtr<MetricField>::Create(this, SVX_RES(MTR_TRGR_END_VALUE))), + maFtTrgrBorder(VclPtr<FixedText>::Create(this, SVX_RES(FT_TRGR_BORDER))), + maMtrTrgrBorder(VclPtr<MetricField>::Create(this, SVX_RES(MTR_TRGR_BORDER))), maRotLeft( SVX_RES(IMG_ROT_LEFT)), maRotRight( SVX_RES(IMG_ROT_RIGHT)), mrAreaPropertyPanel(rPanel), mpBindings(NULL) { Link aLink = LINK( this, AreaTransparencyGradientControl, ModifiedTrgrHdl_Impl); - maMtrTrgrCenterX.SetModifyHdl( aLink ); - maMtrTrgrCenterY.SetModifyHdl( aLink ); - maMtrTrgrAngle.SetModifyHdl( aLink ); - maMtrTrgrBorder.SetModifyHdl( aLink ); - maMtrTrgrStartValue.SetModifyHdl( aLink ); - maMtrTrgrEndValue.SetModifyHdl( aLink ); + maMtrTrgrCenterX->SetModifyHdl( aLink ); + maMtrTrgrCenterY->SetModifyHdl( aLink ); + maMtrTrgrAngle->SetModifyHdl( aLink ); + maMtrTrgrBorder->SetModifyHdl( aLink ); + maMtrTrgrStartValue->SetModifyHdl( aLink ); + maMtrTrgrEndValue->SetModifyHdl( aLink ); aLink = LINK( this, AreaTransparencyGradientControl, Left_Click45_Impl); - maBtnLeft45.SetSelectHdl( aLink ); + maBtnLeft45->SetSelectHdl( aLink ); aLink = LINK( this, AreaTransparencyGradientControl, Right_Click45_Impl); - maBtnRight45.SetSelectHdl( aLink ); - maBtnLeft45.SetItemImage(1,maRotLeft); - Size aTbxSize = maBtnLeft45.CalcWindowSizePixel(); - maBtnLeft45.SetOutputSizePixel( aTbxSize ); - maBtnLeft45.SetQuickHelpText(1, SVX_RESSTR(STR_HELP_LEFT)); //acc wj - - maBtnRight45.SetItemImage(1,maRotRight); - aTbxSize = maBtnRight45.CalcWindowSizePixel(); - maBtnRight45.SetOutputSizePixel( aTbxSize ); - maBtnRight45.SetQuickHelpText(1, SVX_RESSTR(STR_HELP_RIGHT)); //acc wj - - maBtnLeft45.SetBackground(Wallpaper()); - maBtnLeft45.SetPaintTransparent(true); - maBtnRight45.SetBackground(Wallpaper()); - maBtnRight45.SetPaintTransparent(true); + maBtnRight45->SetSelectHdl( aLink ); + maBtnLeft45->SetItemImage(1,maRotLeft); + Size aTbxSize = maBtnLeft45->CalcWindowSizePixel(); + maBtnLeft45->SetOutputSizePixel( aTbxSize ); + maBtnLeft45->SetQuickHelpText(1, SVX_RESSTR(STR_HELP_LEFT)); //acc wj + + maBtnRight45->SetItemImage(1,maRotRight); + aTbxSize = maBtnRight45->CalcWindowSizePixel(); + maBtnRight45->SetOutputSizePixel( aTbxSize ); + maBtnRight45->SetQuickHelpText(1, SVX_RESSTR(STR_HELP_RIGHT)); //acc wj + + maBtnLeft45->SetBackground(Wallpaper()); + maBtnLeft45->SetPaintTransparent(true); + maBtnRight45->SetBackground(Wallpaper()); + maBtnRight45->SetPaintTransparent(true); FreeResource(); mpBindings = mrAreaPropertyPanel.GetBindings(); } - - AreaTransparencyGradientControl::~AreaTransparencyGradientControl() { + disposeOnce(); +} + +void AreaTransparencyGradientControl::dispose() +{ + maFtTrgrCenterX.disposeAndClear(); + maMtrTrgrCenterX.disposeAndClear(); + maFtTrgrCenterY.disposeAndClear(); + maMtrTrgrCenterY.disposeAndClear(); + maFtTrgrAngle.disposeAndClear(); + maMtrTrgrAngle.disposeAndClear(); + maBtnLeft45.disposeAndClear(); + maBtnRight45.disposeAndClear(); + maFtTrgrStartValue.disposeAndClear(); + maMtrTrgrStartValue.disposeAndClear(); + maFtTrgrEndValue.disposeAndClear(); + maMtrTrgrEndValue.disposeAndClear(); + maFtTrgrBorder.disposeAndClear(); + maMtrTrgrBorder.disposeAndClear(); + PopupControl::dispose(); } void AreaTransparencyGradientControl::Rearrange(XFillFloatTransparenceItem* pGradientItem) @@ -123,60 +141,60 @@ void AreaTransparencyGradientControl::Rearrange(XFillFloatTransparenceItem* pGra aSize2 = LogicToPixel( aSize2, MapMode(MAP_APPFONT) ); long aPosY = 0; Point aPointAngle; - Size aSizeAngle = maMtrTrgrAngle.GetSizePixel(); - Size aTbxSize = maBtnLeft45.CalcWindowSizePixel(); + Size aSizeAngle = maMtrTrgrAngle->GetSizePixel(); + Size aTbxSize = maBtnLeft45->CalcWindowSizePixel(); switch(eXGS) { case css::awt::GradientStyle_LINEAR: case css::awt::GradientStyle_AXIAL: - maFtTrgrCenterX.Hide(); - maMtrTrgrCenterX.Hide(); - maFtTrgrCenterY.Hide(); - maMtrTrgrCenterY.Hide(); - maFtTrgrAngle.Show(); - maFtTrgrAngle.SetPosPixel(APOS1_1); - maMtrTrgrAngle.Show(); - maMtrTrgrAngle.SetPosPixel(APOS2_1); - maFtTrgrStartValue.SetPosPixel(APOS1_3); - maMtrTrgrStartValue.SetPosPixel(APOS1_4); - maFtTrgrEndValue.SetPosPixel(APOS2_3); - maMtrTrgrEndValue.SetPosPixel(APOS2_4); - maFtTrgrBorder.SetPosPixel(APOS1_5); - maMtrTrgrBorder.SetPosPixel(APOS1_6); - - maBtnLeft45.Show(); - maBtnRight45.Show(); - - aPointAngle = maMtrTrgrAngle.GetPosPixel(); + maFtTrgrCenterX->Hide(); + maMtrTrgrCenterX->Hide(); + maFtTrgrCenterY->Hide(); + maMtrTrgrCenterY->Hide(); + maFtTrgrAngle->Show(); + maFtTrgrAngle->SetPosPixel(APOS1_1); + maMtrTrgrAngle->Show(); + maMtrTrgrAngle->SetPosPixel(APOS2_1); + maFtTrgrStartValue->SetPosPixel(APOS1_3); + maMtrTrgrStartValue->SetPosPixel(APOS1_4); + maFtTrgrEndValue->SetPosPixel(APOS2_3); + maMtrTrgrEndValue->SetPosPixel(APOS2_4); + maFtTrgrBorder->SetPosPixel(APOS1_5); + maMtrTrgrBorder->SetPosPixel(APOS1_6); + + maBtnLeft45->Show(); + maBtnRight45->Show(); + + aPointAngle = maMtrTrgrAngle->GetPosPixel(); aPosY = aPointAngle.getY() + aSizeAngle.getHeight() - aTbxSize.getHeight(); - maBtnLeft45.SetPosPixel(Point(APOS_Left_Right_1.getX(), aPosY)); - maBtnRight45.SetPosPixel(Point(APOS_Left_Right_2.getX(), aPosY)); + maBtnLeft45->SetPosPixel(Point(APOS_Left_Right_1.getX(), aPosY)); + maBtnRight45->SetPosPixel(Point(APOS_Left_Right_2.getX(), aPosY)); SetSizePixel(aSize2); break; case css::awt::GradientStyle_RADIAL: - maFtTrgrCenterX.Show(); - maFtTrgrCenterX.SetPosPixel(APOS1_1); - maMtrTrgrCenterX.Show(); - maMtrTrgrCenterX.SetPosPixel(APOS2_1); - maFtTrgrCenterY.Show(); - maFtTrgrCenterY.SetPosPixel(APOS1_2); - maMtrTrgrCenterY.Show(); - maMtrTrgrCenterY.SetPosPixel(APOS2_2); - maFtTrgrAngle.Hide(); - maMtrTrgrAngle.Hide(); - maFtTrgrStartValue.SetPosPixel(APOS1_3); - maMtrTrgrStartValue.SetPosPixel(APOS1_4); - maFtTrgrEndValue.SetPosPixel(APOS2_3); - maMtrTrgrEndValue.SetPosPixel(APOS2_4); - maFtTrgrBorder.SetPosPixel(APOS1_5); - maMtrTrgrBorder.SetPosPixel(APOS1_6); - - maBtnLeft45.Hide(); - maBtnRight45.Hide(); + maFtTrgrCenterX->Show(); + maFtTrgrCenterX->SetPosPixel(APOS1_1); + maMtrTrgrCenterX->Show(); + maMtrTrgrCenterX->SetPosPixel(APOS2_1); + maFtTrgrCenterY->Show(); + maFtTrgrCenterY->SetPosPixel(APOS1_2); + maMtrTrgrCenterY->Show(); + maMtrTrgrCenterY->SetPosPixel(APOS2_2); + maFtTrgrAngle->Hide(); + maMtrTrgrAngle->Hide(); + maFtTrgrStartValue->SetPosPixel(APOS1_3); + maMtrTrgrStartValue->SetPosPixel(APOS1_4); + maFtTrgrEndValue->SetPosPixel(APOS2_3); + maMtrTrgrEndValue->SetPosPixel(APOS2_4); + maFtTrgrBorder->SetPosPixel(APOS1_5); + maMtrTrgrBorder->SetPosPixel(APOS1_6); + + maBtnLeft45->Hide(); + maBtnRight45->Hide(); SetSizePixel(aSize2); @@ -185,34 +203,34 @@ void AreaTransparencyGradientControl::Rearrange(XFillFloatTransparenceItem* pGra case css::awt::GradientStyle_ELLIPTICAL: case css::awt::GradientStyle_SQUARE: case css::awt::GradientStyle_RECT: - maFtTrgrCenterX.Show(); - maFtTrgrCenterX.SetPosPixel(APOS1_1); - maMtrTrgrCenterX.Show(); - maMtrTrgrCenterX.SetPosPixel(APOS2_1); - maFtTrgrCenterY.Show(); - maFtTrgrCenterY.SetPosPixel(APOS1_2); - maMtrTrgrCenterY.Show(); - maMtrTrgrCenterY.SetPosPixel(APOS2_2); - maFtTrgrAngle.Show(); - maFtTrgrAngle.SetPosPixel(APOS1_3); - maMtrTrgrAngle.Show(); - maMtrTrgrAngle.SetPosPixel(APOS1_4); - - maFtTrgrStartValue.SetPosPixel(APOS1_5); - maMtrTrgrStartValue.SetPosPixel(APOS1_6); - maFtTrgrEndValue.SetPosPixel(APOS2_5); - maMtrTrgrEndValue.SetPosPixel(APOS2_6); - maFtTrgrBorder.SetPosPixel(APOS1_7); - maMtrTrgrBorder.SetPosPixel(APOS1_8); - - maBtnLeft45.Show(); - maBtnRight45.Show(); - - aPointAngle = maMtrTrgrAngle.GetPosPixel(); + maFtTrgrCenterX->Show(); + maFtTrgrCenterX->SetPosPixel(APOS1_1); + maMtrTrgrCenterX->Show(); + maMtrTrgrCenterX->SetPosPixel(APOS2_1); + maFtTrgrCenterY->Show(); + maFtTrgrCenterY->SetPosPixel(APOS1_2); + maMtrTrgrCenterY->Show(); + maMtrTrgrCenterY->SetPosPixel(APOS2_2); + maFtTrgrAngle->Show(); + maFtTrgrAngle->SetPosPixel(APOS1_3); + maMtrTrgrAngle->Show(); + maMtrTrgrAngle->SetPosPixel(APOS1_4); + + maFtTrgrStartValue->SetPosPixel(APOS1_5); + maMtrTrgrStartValue->SetPosPixel(APOS1_6); + maFtTrgrEndValue->SetPosPixel(APOS2_5); + maMtrTrgrEndValue->SetPosPixel(APOS2_6); + maFtTrgrBorder->SetPosPixel(APOS1_7); + maMtrTrgrBorder->SetPosPixel(APOS1_8); + + maBtnLeft45->Show(); + maBtnRight45->Show(); + + aPointAngle = maMtrTrgrAngle->GetPosPixel(); aPosY = aPointAngle.getY() + aSizeAngle.getHeight() - aTbxSize.getHeight(); - maBtnLeft45.SetPosPixel(Point(APOS_Left_Right_3.getX(), aPosY)); - maBtnRight45.SetPosPixel(Point(APOS_Left_Right_4.getX(), aPosY)); + maBtnLeft45->SetPosPixel(Point(APOS_Left_Right_3.getX(), aPosY)); + maBtnRight45->SetPosPixel(Point(APOS_Left_Right_4.getX(), aPosY)); SetSizePixel(aSize); @@ -247,12 +265,12 @@ void AreaTransparencyGradientControl::InitStatus(XFillFloatTransparenceItem* pGr { aGradient = rGradient; } - maMtrTrgrCenterX.SetValue(aGradient.GetXOffset()); - maMtrTrgrCenterY.SetValue(aGradient.GetYOffset()); - maMtrTrgrAngle.SetValue(aGradient.GetAngle() / 10); - maMtrTrgrStartValue.SetValue((sal_uInt16)((((sal_uInt16)aGradient.GetStartColor().GetRed() + 1) * 100) / 255)); - maMtrTrgrEndValue.SetValue((sal_uInt16)((((sal_uInt16)aGradient.GetEndColor().GetRed() + 1) * 100) / 255)); - maMtrTrgrBorder.SetValue(aGradient.GetBorder()); + maMtrTrgrCenterX->SetValue(aGradient.GetXOffset()); + maMtrTrgrCenterY->SetValue(aGradient.GetYOffset()); + maMtrTrgrAngle->SetValue(aGradient.GetAngle() / 10); + maMtrTrgrStartValue->SetValue((sal_uInt16)((((sal_uInt16)aGradient.GetStartColor().GetRed() + 1) * 100) / 255)); + maMtrTrgrEndValue->SetValue((sal_uInt16)((((sal_uInt16)aGradient.GetEndColor().GetRed() + 1) * 100) / 255)); + maMtrTrgrBorder->SetValue(aGradient.GetBorder()); } @@ -261,21 +279,21 @@ void AreaTransparencyGradientControl::InitStatus(XFillFloatTransparenceItem* pGr void AreaTransparencyGradientControl::ExecuteValueModify( sal_uInt8 nStartCol, sal_uInt8 nEndCol ) { //Added - sal_Int16 aMtrValue = (sal_Int16)maMtrTrgrAngle.GetValue(); + sal_Int16 aMtrValue = (sal_Int16)maMtrTrgrAngle->GetValue(); while(aMtrValue<0) aMtrValue += 360; sal_uInt16 nVal = aMtrValue/360; nVal = aMtrValue - nVal*360; - maMtrTrgrAngle.SetValue(nVal); + maMtrTrgrAngle->SetValue(nVal); //End of new code XGradient aTmpGradient( Color(nStartCol, nStartCol, nStartCol), Color(nEndCol, nEndCol, nEndCol), (css::awt::GradientStyle)(mrAreaPropertyPanel.GetSelectedTransparencyTypeIndex()-2), - (sal_uInt16)maMtrTrgrAngle.GetValue() * 10, - (sal_uInt16)maMtrTrgrCenterX.GetValue(), - (sal_uInt16)maMtrTrgrCenterY.GetValue(), - (sal_uInt16)maMtrTrgrBorder.GetValue(), + (sal_uInt16)maMtrTrgrAngle->GetValue() * 10, + (sal_uInt16)maMtrTrgrCenterX->GetValue(), + (sal_uInt16)maMtrTrgrCenterY->GetValue(), + (sal_uInt16)maMtrTrgrBorder->GetValue(), 100, 100); mrAreaPropertyPanel.SetGradient(aTmpGradient); @@ -292,8 +310,8 @@ void AreaTransparencyGradientControl::ExecuteValueModify( sal_uInt8 nStartCol, s IMPL_LINK_NOARG(AreaTransparencyGradientControl, ModifiedTrgrHdl_Impl) { - sal_uInt8 nStartCol = (sal_uInt8)(((sal_uInt16)maMtrTrgrStartValue.GetValue() * 255) / 100); - sal_uInt8 nEndCol = (sal_uInt8)(((sal_uInt16)maMtrTrgrEndValue.GetValue() * 255) / 100); + sal_uInt8 nStartCol = (sal_uInt8)(((sal_uInt16)maMtrTrgrStartValue->GetValue() * 255) / 100); + sal_uInt8 nEndCol = (sal_uInt8)(((sal_uInt16)maMtrTrgrEndValue->GetValue() * 255) / 100); ExecuteValueModify( nStartCol, nEndCol ); return 0L; } @@ -303,13 +321,13 @@ IMPL_LINK_NOARG(AreaTransparencyGradientControl, ModifiedTrgrHdl_Impl) IMPL_LINK_NOARG(AreaTransparencyGradientControl, Left_Click45_Impl) { - sal_uInt8 nStartCol = (sal_uInt8)(((sal_uInt16)maMtrTrgrStartValue.GetValue() * 255) / 100); - sal_uInt8 nEndCol = (sal_uInt8)(((sal_uInt16)maMtrTrgrEndValue.GetValue() * 255) / 100); - sal_uInt16 aTemp = (sal_uInt16)maMtrTrgrAngle.GetValue(); + sal_uInt8 nStartCol = (sal_uInt8)(((sal_uInt16)maMtrTrgrStartValue->GetValue() * 255) / 100); + sal_uInt8 nEndCol = (sal_uInt8)(((sal_uInt16)maMtrTrgrEndValue->GetValue() * 255) / 100); + sal_uInt16 aTemp = (sal_uInt16)maMtrTrgrAngle->GetValue(); if(aTemp>=315) aTemp -= 360; aTemp += 45; - maMtrTrgrAngle.SetValue(aTemp); + maMtrTrgrAngle->SetValue(aTemp); ExecuteValueModify( nStartCol, nEndCol ); return 0L; } @@ -319,13 +337,13 @@ IMPL_LINK_NOARG(AreaTransparencyGradientControl, Left_Click45_Impl) IMPL_LINK_NOARG(AreaTransparencyGradientControl, Right_Click45_Impl) { - sal_uInt8 nStartCol = (sal_uInt8)(((sal_uInt16)maMtrTrgrStartValue.GetValue() * 255) / 100); - sal_uInt8 nEndCol = (sal_uInt8)(((sal_uInt16)maMtrTrgrEndValue.GetValue() * 255) / 100); - sal_uInt16 aTemp = (sal_uInt16)maMtrTrgrAngle.GetValue(); + sal_uInt8 nStartCol = (sal_uInt8)(((sal_uInt16)maMtrTrgrStartValue->GetValue() * 255) / 100); + sal_uInt8 nEndCol = (sal_uInt8)(((sal_uInt16)maMtrTrgrEndValue->GetValue() * 255) / 100); + sal_uInt16 aTemp = (sal_uInt16)maMtrTrgrAngle->GetValue(); if(aTemp<45) aTemp += 360; aTemp -= 45; - maMtrTrgrAngle.SetValue(aTemp); + maMtrTrgrAngle->SetValue(aTemp); ExecuteValueModify( nStartCol, nEndCol ); return 0L; } diff --git a/svx/source/sidebar/area/AreaTransparencyGradientControl.hxx b/svx/source/sidebar/area/AreaTransparencyGradientControl.hxx index 3486508cb133..eb8cfc37285d 100644 --- a/svx/source/sidebar/area/AreaTransparencyGradientControl.hxx +++ b/svx/source/sidebar/area/AreaTransparencyGradientControl.hxx @@ -42,6 +42,7 @@ public: vcl::Window* pParent, AreaPropertyPanel& rPanel); virtual ~AreaTransparencyGradientControl(); + virtual void dispose() SAL_OVERRIDE; void Rearrange(XFillFloatTransparenceItem* pGradientItem); void InitStatus(XFillFloatTransparenceItem* pGradientItem); @@ -49,20 +50,20 @@ public: void SetControlState_Impl(css::awt::GradientStyle eXGS); private: - FixedText maFtTrgrCenterX; - MetricField maMtrTrgrCenterX; - FixedText maFtTrgrCenterY; - MetricField maMtrTrgrCenterY; - FixedText maFtTrgrAngle; - MetricField maMtrTrgrAngle; - ToolBox maBtnLeft45; - ToolBox maBtnRight45; - FixedText maFtTrgrStartValue; - MetricField maMtrTrgrStartValue; - FixedText maFtTrgrEndValue; - MetricField maMtrTrgrEndValue; - FixedText maFtTrgrBorder; - MetricField maMtrTrgrBorder; + VclPtr<FixedText> maFtTrgrCenterX; + VclPtr<MetricField> maMtrTrgrCenterX; + VclPtr<FixedText> maFtTrgrCenterY; + VclPtr<MetricField> maMtrTrgrCenterY; + VclPtr<FixedText> maFtTrgrAngle; + VclPtr<MetricField> maMtrTrgrAngle; + VclPtr<ToolBox> maBtnLeft45; + VclPtr<ToolBox> maBtnRight45; + VclPtr<FixedText> maFtTrgrStartValue; + VclPtr<MetricField> maMtrTrgrStartValue; + VclPtr<FixedText> maFtTrgrEndValue; + VclPtr<MetricField> maMtrTrgrEndValue; + VclPtr<FixedText> maFtTrgrBorder; + VclPtr<MetricField> maMtrTrgrBorder; Image maRotLeft; Image maRotRight; |