From 06773ff7391c3d26c4f9d169664ee961cf104fb7 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 29 Jan 2013 23:54:20 +0000 Subject: move color options .ui to right place and adapt code Change-Id: I645775bcec9993a2d8fd4b5ea67197ad3b2a9e03 --- svx/source/dialog/dlgctrl.cxx | 52 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) (limited to 'svx/source') diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx index b6ad22a45455..ed5d5e9e9fa7 100644 --- a/svx/source/dialog/dlgctrl.cxx +++ b/svx/source/dialog/dlgctrl.cxx @@ -890,6 +890,13 @@ XOBitmap SvxBitmapCtl::GetXBitmap() return( aXOBitmap ); } +extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeColorLB(Window *pParent, VclBuilder::stringmap &) +{ + ColorLB *pListBox = new ColorLB(pParent, WB_LEFT|WB_DROPDOWN|WB_VCENTER|WB_3DLOOK|WB_SIMPLEMODE); + pListBox->EnableAutoSize(true); + return pListBox; +} + // Fills the Listbox with color and strings void ColorLB::Fill( const XColorListRef &pColorTab ) @@ -1609,6 +1616,20 @@ SvxPreviewBase::SvxPreviewBase( Window* pParent, const ResId& rResId ) mpModel->GetItemPool().FreezeIdRanges(); } +SvxPreviewBase::SvxPreviewBase(Window* pParent) + : Control(pParent, WB_BORDER) + , mpModel(new SdrModel()) + , mpBufferDevice(new VirtualDevice(*this)) +{ + // Draw the control's border as a flat thin black line. + SetBorderStyle(WINDOW_BORDER_MONO); + SetDrawMode( GetSettings().GetStyleSettings().GetHighContrastMode() ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR ); + SetMapMode(MAP_100TH_MM); + + // init model + mpModel->GetItemPool().FreezeIdRanges(); +} + SvxPreviewBase::~SvxPreviewBase() { delete mpModel; @@ -1810,6 +1831,37 @@ SvxXRectPreview::SvxXRectPreview( Window* pParent, const ResId& rResId ) mpRectangleObject->SetModel(&getModel()); } +SvxXRectPreview::SvxXRectPreview(Window* pParent) + : SvxPreviewBase(pParent) + , mpRectangleObject(0) +{ + InitSettings(true, true); + + // create RectangleObject + const Rectangle aObjectSize(Point(), GetOutputSize()); + mpRectangleObject = new SdrRectObj(aObjectSize); + mpRectangleObject->SetModel(&getModel()); +} + +void SvxXRectPreview::Resize() +{ + const Rectangle aObjectSize(Point(), GetOutputSize()); + SdrObject *pOrigObject = mpRectangleObject; + if (pOrigObject) + { + mpRectangleObject = new SdrRectObj(aObjectSize); + mpRectangleObject->SetModel(&getModel()); + SetAttributes(pOrigObject->GetMergedItemSet()); + SdrObject::Free(pOrigObject); + } + SvxPreviewBase::Resize(); +} + +extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSvxXRectPreview(Window *pParent, VclBuilder::stringmap &) +{ + return new SvxXRectPreview(pParent); +} + SvxXRectPreview::~SvxXRectPreview() { SdrObject::Free(mpRectangleObject); -- cgit