diff options
author | Olivier Hallot <olivier.hallot@edx.srv.br> | 2013-07-25 22:53:02 -0300 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-07-26 16:11:14 +0000 |
commit | 6d21d95f2d24a4f1fd0be5e754953f6cf718e56a (patch) | |
tree | 6f4ef3987607a0677b79c786b6be529e0e774f36 /svx | |
parent | 055edb382a400a90a12bac36c4009372fb96888e (diff) |
Convert shadow tab page to widget UI
Change-Id: I8828100136f73e4f80cb11c2b5003fa7de6b575f
Reviewed-on: https://gerrit.libreoffice.org/5116
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/dialog/dlgctrl.cxx | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx index 29e25f7bf65d..cc88c154356f 100644 --- a/svx/source/dialog/dlgctrl.cxx +++ b/svx/source/dialog/dlgctrl.cxx @@ -1949,10 +1949,10 @@ void SvxXRectPreview::Paint( const Rectangle& ) LocalPostPaint(); } -SvxXShadowPreview::SvxXShadowPreview( Window* pParent, const ResId& rResId ) -: SvxPreviewBase( pParent, rResId ), - mpRectangleObject(0), - mpRectangleShadow(0) +SvxXShadowPreview::SvxXShadowPreview( Window* pParent ) + : SvxPreviewBase(pParent) + , mpRectangleObject(0) + , mpRectangleShadow(0) { InitSettings(true, true); @@ -1972,6 +1972,11 @@ SvxXShadowPreview::SvxXShadowPreview( Window* pParent, const ResId& rResId ) mpRectangleShadow->SetModel(&getModel()); } +extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSvxXShadowPreview (Window *pParent, VclBuilder::stringmap &) +{ + return new SvxXShadowPreview(pParent); +} + SvxXShadowPreview::~SvxXShadowPreview() { SdrObject::Free(mpRectangleObject); @@ -1992,15 +1997,23 @@ void SvxXShadowPreview::SetShadowAttributes(const SfxItemSet& rItemSet) void SvxXShadowPreview::SetShadowPosition(const Point& rPos) { - Rectangle aObjectPosition(mpRectangleObject->GetSnapRect()); - aObjectPosition.Move(rPos.X(), rPos.Y()); - mpRectangleShadow->SetSnapRect(aObjectPosition); + maShadowOffset = rPos; } void SvxXShadowPreview::Paint( const Rectangle& ) { LocalPrePaint(); + // prepare size + Size aSize = GetOutputSize(); + aSize.Width() = aSize.Width() / 3; + aSize.Height() = aSize.Height() / 3; + + Rectangle aObjectRect(Point(aSize.Width(), aSize.Height()), aSize); + mpRectangleObject->SetSnapRect(aObjectRect); + aObjectRect.Move(maShadowOffset.X(), maShadowOffset.Y()); + mpRectangleShadow->SetSnapRect(aObjectRect); + sdr::contact::SdrObjectVector aObjectVector; aObjectVector.push_back(mpRectangleShadow); |