diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-02-15 20:41:33 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-02-16 12:54:44 +0000 |
commit | a1ceacc17e3f30d5e9c06b3218ad8ec26ca2f1b9 (patch) | |
tree | 56a29f66f75f326a0a677ab1697ce28f1bc9fcbf /svx/source/sidebar | |
parent | 18f41dfaf19d656d290c47d196ef2702e169a522 (diff) |
boost::foo_ptr->std::foo_ptr
Change-Id: I9219619b538b6530a89f5932ac51eb3b62eb396a
Diffstat (limited to 'svx/source/sidebar')
-rw-r--r-- | svx/source/sidebar/area/AreaTransparencyGradientPopup.cxx | 8 | ||||
-rw-r--r-- | svx/source/sidebar/line/LineWidthPopup.cxx | 13 | ||||
-rw-r--r-- | svx/source/sidebar/text/TextCharacterSpacingPopup.cxx | 10 | ||||
-rw-r--r-- | svx/source/sidebar/text/TextUnderlinePopup.cxx | 8 | ||||
-rw-r--r-- | svx/source/sidebar/tools/Popup.cxx | 73 |
5 files changed, 32 insertions, 80 deletions
diff --git a/svx/source/sidebar/area/AreaTransparencyGradientPopup.cxx b/svx/source/sidebar/area/AreaTransparencyGradientPopup.cxx index f2d1390580a2..5a1971ad4e68 100644 --- a/svx/source/sidebar/area/AreaTransparencyGradientPopup.cxx +++ b/svx/source/sidebar/area/AreaTransparencyGradientPopup.cxx @@ -32,21 +32,15 @@ AreaTransparencyGradientPopup::AreaTransparencyGradientPopup ( { } - - - AreaTransparencyGradientPopup::~AreaTransparencyGradientPopup (void) { } - - - void AreaTransparencyGradientPopup::Rearrange (XFillFloatTransparenceItem* pItem) { ProvideContainerAndControl(); - AreaTransparencyGradientControl* pControl = dynamic_cast<AreaTransparencyGradientControl*>(mpControl.get()); + AreaTransparencyGradientControl* pControl = dynamic_cast<AreaTransparencyGradientControl*>(mxControl.get()); if (pControl != NULL) pControl->Rearrange(pItem); } diff --git a/svx/source/sidebar/line/LineWidthPopup.cxx b/svx/source/sidebar/line/LineWidthPopup.cxx index fe464a415700..5e587821b21a 100644 --- a/svx/source/sidebar/line/LineWidthPopup.cxx +++ b/svx/source/sidebar/line/LineWidthPopup.cxx @@ -38,31 +38,22 @@ LineWidthPopup::LineWidthPopup ( SetPopupModeEndHandler(::boost::bind(&LineWidthPopup::PopupModeEndCallback, this)); } - - - LineWidthPopup::~LineWidthPopup (void) { } - - - void LineWidthPopup::SetWidthSelect (long lValue, bool bValuable, SfxMapUnit eMapUnit) { ProvideContainerAndControl(); - LineWidthControl* pControl = dynamic_cast<LineWidthControl*>(mpControl.get()); + LineWidthControl* pControl = dynamic_cast<LineWidthControl*>(mxControl.get()); if (pControl != NULL) pControl->SetWidthSelect(lValue, bValuable, eMapUnit); } - - - void LineWidthPopup::PopupModeEndCallback (void) { - LineWidthControl* pControl = dynamic_cast<LineWidthControl*>(mpControl.get()); + LineWidthControl* pControl = dynamic_cast<LineWidthControl*>(mxControl.get()); if (pControl != NULL) { if (pControl->IsCloseByEdit()) diff --git a/svx/source/sidebar/text/TextCharacterSpacingPopup.cxx b/svx/source/sidebar/text/TextCharacterSpacingPopup.cxx index 7a4fe17f94db..57ea21ad0c52 100644 --- a/svx/source/sidebar/text/TextCharacterSpacingPopup.cxx +++ b/svx/source/sidebar/text/TextCharacterSpacingPopup.cxx @@ -34,21 +34,15 @@ TextCharacterSpacingPopup::TextCharacterSpacingPopup ( SetPopupModeEndHandler(::boost::bind(&TextCharacterSpacingPopup::PopupModeEndCallback, this)); } - - - TextCharacterSpacingPopup::~TextCharacterSpacingPopup (void) { } - - - void TextCharacterSpacingPopup::Rearrange (bool bLBAvailable,bool bAvailable, long nKerning) { ProvideContainerAndControl(); - TextCharacterSpacingControl* pControl = dynamic_cast<TextCharacterSpacingControl*>(mpControl.get()); + TextCharacterSpacingControl* pControl = dynamic_cast<TextCharacterSpacingControl*>(mxControl.get()); if (pControl != NULL) pControl->Rearrange(bLBAvailable,bAvailable,nKerning); } @@ -56,7 +50,7 @@ void TextCharacterSpacingPopup::Rearrange (bool bLBAvailable,bool bAvailable, lo void TextCharacterSpacingPopup::PopupModeEndCallback (void) { ProvideContainerAndControl(); - TextCharacterSpacingControl* pControl = dynamic_cast<TextCharacterSpacingControl*>(mpControl.get()); + TextCharacterSpacingControl* pControl = dynamic_cast<TextCharacterSpacingControl*>(mxControl.get()); if (pControl == NULL) return; diff --git a/svx/source/sidebar/text/TextUnderlinePopup.cxx b/svx/source/sidebar/text/TextUnderlinePopup.cxx index b71e33b4303c..0aab2b4e58a9 100644 --- a/svx/source/sidebar/text/TextUnderlinePopup.cxx +++ b/svx/source/sidebar/text/TextUnderlinePopup.cxx @@ -32,21 +32,15 @@ TextUnderlinePopup::TextUnderlinePopup ( { } - - - TextUnderlinePopup::~TextUnderlinePopup (void) { } - - - void TextUnderlinePopup::Rearrange (FontUnderline eLine) { ProvideContainerAndControl(); - TextUnderlineControl* pControl = dynamic_cast<TextUnderlineControl*>(mpControl.get()); + TextUnderlineControl* pControl = dynamic_cast<TextUnderlineControl*>(mxControl.get()); if (pControl != NULL) pControl->Rearrange(eLine); } diff --git a/svx/source/sidebar/tools/Popup.cxx b/svx/source/sidebar/tools/Popup.cxx index 2744547cbec3..18109ec39f9d 100644 --- a/svx/source/sidebar/tools/Popup.cxx +++ b/svx/source/sidebar/tools/Popup.cxx @@ -29,86 +29,71 @@ Popup::Popup ( vcl::Window* pParent, const ::boost::function<PopupControl*(PopupContainer*)>& rControlCreator, const ::rtl::OUString& rsAccessibleName) - : mpControl(), + : mxControl(), mpParent(pParent), maControlCreator(rControlCreator), maPopupModeEndCallback(), msAccessibleName(rsAccessibleName), - mpContainer() + mxContainer() { OSL_ASSERT(mpParent!=NULL); OSL_ASSERT(maControlCreator); } - - - Popup::~Popup (void) { - mpControl.reset(); - mpContainer.reset(); + mxControl.reset(); + mxContainer.reset(); } - - - void Popup::Show (ToolBox& rToolBox) { rToolBox.SetItemDown(rToolBox.GetCurItemId(), true); ProvideContainerAndControl(); - if ( ! (mpContainer && mpControl)) + if ( ! (mxContainer && mxControl)) { - OSL_ASSERT(mpContainer); - OSL_ASSERT(mpControl); + OSL_ASSERT(mxContainer); + OSL_ASSERT(mxControl); return; } - if ( !mpContainer->IsInPopupMode() ) + if ( !mxContainer->IsInPopupMode() ) { - mpContainer->SetSizePixel(mpControl->GetOutputSizePixel()); + mxContainer->SetSizePixel(mxControl->GetOutputSizePixel()); const Point aPos (rToolBox.GetParent()->OutputToScreenPixel(rToolBox.GetPosPixel())); const Size aSize (rToolBox.GetSizePixel()); const Rectangle aRect (aPos, aSize); - mpContainer->StartPopupMode( + mxContainer->StartPopupMode( aRect, FLOATWIN_POPUPMODE_NOFOCUSCLOSE|FLOATWIN_POPUPMODE_DOWN); - mpContainer->SetPopupModeFlags( - mpContainer->GetPopupModeFlags() + mxContainer->SetPopupModeFlags( + mxContainer->GetPopupModeFlags() | FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE); - mpControl->GetFocus(); + mxControl->GetFocus(); } } - - - void Popup::Hide (void) { - if (mpContainer) - if (mpContainer->IsInPopupMode()) - mpContainer->EndPopupMode(); + if (mxContainer) + if (mxContainer->IsInPopupMode()) + mxContainer->EndPopupMode(); } - - - void Popup::SetPopupModeEndHandler (const ::boost::function<void(void)>& rCallback) { maPopupModeEndCallback = rCallback; - if (mpContainer) - mpContainer->SetPopupModeEndHdl(LINK(this, Popup, PopupModeEndHandler)); + if (mxContainer) + mxContainer->SetPopupModeEndHdl(LINK(this, Popup, PopupModeEndHandler)); } - - - void Popup::ProvideContainerAndControl (void) { - if ( ! (mpContainer && mpControl) + if ( ! (mxContainer && mxControl) && mpParent!=NULL && maControlCreator) { @@ -116,30 +101,24 @@ void Popup::ProvideContainerAndControl (void) } } - - - void Popup::CreateContainerAndControl (void) { - mpContainer.reset(new PopupContainer(mpParent)); - mpContainer->SetAccessibleName(msAccessibleName); - mpContainer->SetPopupModeEndHdl(LINK(this, Popup, PopupModeEndHandler)); - mpContainer->SetBorderStyle(mpContainer->GetBorderStyle() | WindowBorderStyle::MENU); + mxContainer.reset(new PopupContainer(mpParent)); + mxContainer->SetAccessibleName(msAccessibleName); + mxContainer->SetPopupModeEndHdl(LINK(this, Popup, PopupModeEndHandler)); + mxContainer->SetBorderStyle(mxContainer->GetBorderStyle() | WindowBorderStyle::MENU); - mpControl.reset(maControlCreator(mpContainer.get())); + mxControl.reset(maControlCreator(mxContainer.get())); } - - - IMPL_LINK(Popup, PopupModeEndHandler, void*, EMPTYARG) { if (maPopupModeEndCallback) maPopupModeEndCallback(); // Popup control is no longer needed and can be destroyed. - mpControl.reset(); - mpContainer.reset(); + mxControl.reset(); + mxContainer.reset(); return 0; } |