diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-10-01 13:58:46 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-10-01 20:36:44 +0200 |
commit | a734dcdd10c7912ae2fbaef4062756f80a00814d (patch) | |
tree | 29318d129708fedb587afbe9a79503ff50e67203 /svx/source/dialog/dlgctrl.cxx | |
parent | 40e157e2a838fd8cecd0e45109b7e62e056d642b (diff) |
SvxPreviewBase is now unused
Change-Id: If8b83b277b71307e87e155c544f6e295b1192f75
Reviewed-on: https://gerrit.libreoffice.org/61191
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx/source/dialog/dlgctrl.cxx')
-rw-r--r-- | svx/source/dialog/dlgctrl.cxx | 140 |
1 files changed, 0 insertions, 140 deletions
diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx index dbf5be9a034f..4830da68e9c7 100644 --- a/svx/source/dialog/dlgctrl.cxx +++ b/svx/source/dialog/dlgctrl.cxx @@ -1196,146 +1196,6 @@ void SvxLineEndLB::Modify( const XLineEndEntry& rEntry, sal_Int32 nPos, const Bi } } -void SvxPreviewBase::InitSettings(bool bForeground, bool bBackground) -{ - const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings(); - - if(bForeground) - { - svtools::ColorConfig aColorConfig; - Color aTextColor(aColorConfig.GetColorValue(svtools::FONTCOLOR).nColor); - - if(IsControlForeground()) - { - aTextColor = GetControlForeground(); - } - - getBufferDevice().SetTextColor(aTextColor); - } - - if(bBackground) - { - if(IsControlBackground()) - { - getBufferDevice().SetBackground(GetControlBackground()); - } - else - { - getBufferDevice().SetBackground(rStyleSettings.GetWindowColor()); - } - } - - // do not paint background self, it gets painted buffered - SetControlBackground(); - SetBackground(); - - Invalidate(); -} - -SvxPreviewBase::SvxPreviewBase(vcl::Window* pParent) - : Control(pParent, WB_BORDER) - , mpModel(new SdrModel(nullptr, nullptr, true)) - , mpBufferDevice(VclPtr<VirtualDevice>::Create(*this)) -{ - // Draw the control's border as a flat thin black line. - SetBorderStyle(WindowBorderStyle::MONO); - SetDrawMode( GetSettings().GetStyleSettings().GetHighContrastMode() ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR ); - SetMapMode(MapMode(MapUnit::Map100thMM)); - - // init model - mpModel->GetItemPool().FreezeIdRanges(); -} - -SvxPreviewBase::~SvxPreviewBase() -{ - disposeOnce(); -} - -void SvxPreviewBase::dispose() -{ - mpModel.reset(); - mpBufferDevice.disposeAndClear(); - Control::dispose(); -} - -void SvxPreviewBase::LocalPrePaint(vcl::RenderContext const & rRenderContext) -{ - // init BufferDevice - if (mpBufferDevice->GetOutputSizePixel() != GetOutputSizePixel()) - { - mpBufferDevice->SetDrawMode(rRenderContext.GetDrawMode()); - mpBufferDevice->SetSettings(rRenderContext.GetSettings()); - mpBufferDevice->SetAntialiasing(rRenderContext.GetAntialiasing()); - mpBufferDevice->SetOutputSizePixel(GetOutputSizePixel()); - mpBufferDevice->SetMapMode(rRenderContext.GetMapMode()); - } - - const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings(); - - if (rStyleSettings.GetPreviewUsesCheckeredBackground()) - { - const Point aNull(0, 0); - static const sal_uInt32 nLen(8); - static const Color aW(COL_WHITE); - static const Color aG(0xef, 0xef, 0xef); - const bool bWasEnabled(mpBufferDevice->IsMapModeEnabled()); - - mpBufferDevice->EnableMapMode(false); - mpBufferDevice->DrawCheckered(aNull, mpBufferDevice->GetOutputSizePixel(), nLen, aW, aG); - mpBufferDevice->EnableMapMode(bWasEnabled); - } - else - { - mpBufferDevice->Erase(); - } -} - -void SvxPreviewBase::LocalPostPaint(vcl::RenderContext& rRenderContext) -{ - // copy to front (in pixel mode) - const bool bWasEnabledSrc(mpBufferDevice->IsMapModeEnabled()); - const bool bWasEnabledDst(IsMapModeEnabled()); - const Point aEmptyPoint; - - mpBufferDevice->EnableMapMode(false); - rRenderContext.EnableMapMode(false); - - rRenderContext.DrawOutDev(aEmptyPoint, GetOutputSizePixel(), - aEmptyPoint, GetOutputSizePixel(), - *mpBufferDevice); - - mpBufferDevice->EnableMapMode(bWasEnabledSrc); - rRenderContext.EnableMapMode(bWasEnabledDst); -} - -void SvxPreviewBase::StateChanged(StateChangedType nType) -{ - Control::StateChanged(nType); - - if(StateChangedType::ControlForeground == nType) - { - InitSettings(true, false); - } - else if(StateChangedType::ControlBackground == nType) - { - InitSettings(false, true); - } -} - -void SvxPreviewBase::DataChanged(const DataChangedEvent& rDCEvt) -{ - SetDrawMode(GetSettings().GetStyleSettings().GetHighContrastMode() ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR); - - if((DataChangedEventType::SETTINGS == rDCEvt.GetType()) && (rDCEvt.GetFlags() & AllSettingsFlags::STYLE)) - { - InitSettings(true, true); - } - else - { - Control::DataChanged(rDCEvt); - } -} - void SvxXLinePreview::Resize() { PreviewBase::Resize(); |