Bug 74702 - Remove enum OutDevType from OutputDevice
Summary: Remove enum OutDevType from OutputDevice
Status: ASSIGNED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: Other All
: medium enhancement
Assignee: Adrien Ollier
URL:
Whiteboard: target:4.3.0 target:6.3.0 target:6.4.0
Keywords: difficultyBeginner, easyHack, skillCpp, topicCleanup
Depends on:
Blocks: RTL-CTL 74424
  Show dependency treegraph
 
Reported: 2014-02-08 06:16 UTC by Chris Sherlock
Modified: 2019-06-10 08:58 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Sherlock 2014-02-08 06:16:36 UTC
OutputDevice has an enum OutDevType which has OUTDEV_DONTKNOW, OUTDEV_WINDOW, OUTDEV_PRINTER, OUTDEV_VIRDEV. This is used to determine what sort of OutputDevice is being used. 

This bad design. There are a number of functions in OutputDevice that detect the subclass type and have a conditional on an OutDevType private variable meOutDevType that determines what it should do. This obviously is contrary to go polymorphic construction. 

We need to remove this enum and move the logic to specific classes out of the base classes. This is a massive task, however. There are about 120 functions that rely on this. They are:

* Animation::Draw(...)
* Animation::Start(...)
* ButtonFrame::Draw(...)
* CanvasHelper::flush()
* ComboBox::Draw(...)
* DbGridColumn::Paint(...)
* DecorationView::DrawHighlightFrame(...)
* DecorationView::DrawSeparator(...)
* DecorationView::DrawSymbol(...)
* DrawDocShell::Draw(...)
* DrawGraphic(...) in sw/source/core/layout/paintfrm.cxx
* Edit::Draw(...)
* EditBrowseBox::PaintStatusCell(...)
* EditEngine::Draw(...)
* FmFormShell::PrepareClose(...)
* FmFormView::ChangeDesignMode(...)
* FmXFormView::implCreateFieldControl(...)
* FmXFormView::implCreateXFormsControl(...)
* FmXTextCell::PaintFieldToCell(...)
* FontList::FontList(...) constructors
* FontList::ImplInsertFonts(...)
* GDIMetaFile::Play(...)
* GraphicManager::DrawObj(...)
* GraphicManager::ImplCreateOutput(...)
* GroupBox::ImplDraw(...)
* HeaderBar::ImplDrawItem(...)
* ImpEditEngine::InsertTextObject(...)
* ImpEditEngine::Paint(...)
* ImpEditEngine::RecalcFormatterFontMetrics(...)
* ImpEditEngine::SeekCursor(...)
* ImpGetViewWin(...) in svx/source/toolbars/fontworkbar.cxx
* ImplAnimView::ImplDraw(...)
* ImplAnimView::ImplRepaint()
* ImplAnimView::ImplAnimView() constructor
* ImplDbgCheckOutputDevice(...) debug functions in vcl/source/gdi/outdev.cxx
* ImplDbgCheckOutputDevice(...) debut functions in vcl/source/gdi/outdev.cxx
* ImplDrawButton(...), ImplDrawFrame(...), ImplDrawFrame(...) in vcl/source/window/decoview.cxx
* ImplDrawDefault(...) in vcl/source/gdi/graph.cxx
* ImplDrawSpinButton(...) in /vcl/source/control/spinfld.cxx
* ImplImageBmp::Draw(...)
* ImplSmallBorderWindowView::Init(...)
* ImplSmallBorderWindowView::DrawWindow(...)
* ListBox::Draw(...)
* NavigatorTree::MarkViewObj(...)
* ObjectContactOfObjListPainter::isOutputToVirtualDevice()
* ObjectContactOfPageView::isOutputToPrinter()
* ObjectContactOfPageView::isOutputToVirtualDevice()
* ObjectContactOfPageView::isOutputWindow()
* OutputDevice::DrawImage(...)
* OutputDevice::GetActiveClipRegion()
* OutputDevice::GetBitmap(...)
* OutputDevice::ImplDrawOutDevDirect(...)
* OutputDevice::ImplInitClipRegion()
* OutputDevice::ImplRefreshFontData(...)
* OutputDevice::ImplClearFontData(...)
* OutputDevice::ImplDrawWaveLine(...)
* OutputDevice::SetMapMode(...)
* OverlayManager::getCurrentViewInformation2D()
* OverlayManager::invalidateRange(...)
* OverlayManagerBuffered::ImpRestoreBackground(...)
* SalGraphics::mirror(...) functions
* ScColumn::GetNeededSize(...)
* ScDrawStringsVars::SetShrinkScale(...)
* ScDrawStringsVars::SetAutoText(...)
* ScDrawStringsVars::TextChanged()
* ScDrawStringsVars::SetPattern(...)
* ScDrawView::MarkListHasChanged()
* ScOutputData::DrawStrings()
* ScPrintFunc::DrawToDev(...)
* ScrollBar::ImplDraw(...)
* SdXImpressDocument::render(...)
* SdrItemBrowser::ImpGetViewWin(...)
* SdrObjEditView::AddWindowToPaintView(...)
* SdrObjEditView::DeleteWindowFromPaintView(...)
* SdrObjEditView::SdrBeginTextEdit(...)
* SdrOle2Obj::Connect_Impl()
* SdrOle2Obj::GetObjRef_Impl()
* SdrPaintView::CompleteRedraw(...)
* SdrPaintView::OptimizeDrawLayersRegion(...)
* SdrPaintWindow::OutputToPrinter()/OutputToWindow()/OutputToVirtualDevice()
* SdrPaintWindow::impCreateOverlayManager()
* SdrTextObj::ImpSetCharStretching(...)
* SdrView::DoMouseEvent(...)
* SdrView::PickAnything(...)
* SfxObjectShell::DoDraw_Impl(...)
* SmDocShell::DrawFormula(...)
* SmGetGlyphBoundRect(...) in starmath/source/rect.cxx
* SmRect::BuildRect(...)
* SmTmpDevice2::Impl_GetColor(...)
* SmTmpDevice::Impl_GetColor(...)
* SpinField::Draw(...)
* SpinField::ImplCalcButtonAreas(...)
* SpriteCanvasHelper::updateScreen(...)
* SwColumnFrm::PaintBreak( )
* SwFntObj::DrawText(...)
* SwFrm::PaintBackground(...)
* SwGrfNumPortion::Paint(...)
* SwLayVout::Enter(...)
* SwLineRects::ConnectEdges(...)
* SwNoTxtFrm::Modify(...)
* SwNoTxtFrm::PaintPicture(...)
* SwPageFrm::PaintBreak( )
* SwPageFrm::PaintDecorators( )
* SwPageFrm::PaintGrid(...)
* SwRootFrm::Paint(...)
* SwTxtSizeInfo::CtorInitTxtSizeInfo(...)
* SwViewOption::DrawRect(...)
* The cairo createSurface(...) functions also rely on it. 
* VCLXDevice::getInfo(...)
* VCLXWindow::draw(...)
* VclMultiLineEdit::Draw(...)
* View::CompleteRedraw(...)
* ViewContactOfUnoControl::CreateObjectSpecificViewObjectContact(...)
* ViewObjectContactOfSdrMediaObj::getWindow()
* VirtualDevice::ImplInitVirDev(...)
* Window::GetDrawPixel(...)
* XParaPortionList::XParaPortionList(...) constructor
* grindFunc(...) in vcl/workben/outdevgrind.cxx
* impBufferDevice::impBufferDevice(...) constructor
* lcl_ChgHyperLinkColor(...) in sw/source/core/text/atrstck.cxx
* lcl_IsFontAdjustNecessary(...),  lcl_IsFontAdjustNecessary(...) and lcl_IsFontAdjustNecessary(...) in fntcache.cxx
* lcl_PaintLeftRightLine(...) in sw/source/core/layout/paintfrm.cxx
* lcl_SubtractFlys(...) in sw/source/core/layout/paintfrm.cxx
* lcl_enableNativeWidget(...) in vcl/source/gdi/outdevnative.cxx
Comment 1 Chris Sherlock 2014-03-10 23:09:19 UTC
Two more functions in OutputDevice I missed: ImplInitGraphics and ImplReleaseGraphics
Comment 2 Commit Notification 2014-03-11 16:29:59 UTC
Chris Sherlock committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=e69615ccb016de1c64864bbc9cf1bbef9f50c1da

fdo#74702 Moved ImplInitGraphics into correct classes



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 3 Commit Notification 2014-03-14 11:23:30 UTC
Chris Sherlock committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=0d88e15a8a3fa7fba6471c832d7df3cfd61da962

fdo#74702 Return true if graphics is set, cleanup unused variables



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 4 Commit Notification 2014-03-19 10:40:52 UTC
Chris Sherlock committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=c16186f1b96ecf0933a16f4c9fb196c5be18d7d9

fdo#74702 Move gradient steps logic into OutputDevice or Printer classes



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 5 Commit Notification 2014-03-21 19:11:58 UTC
Chris Sherlock committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=143c059ff7f69a363b3cf736a9f0197a9f25cf9c

fdo#74702 Moved ImplReleaseGraphics into correct classes



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 6 Commit Notification 2014-03-21 20:05:05 UTC
Chris Sherlock committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=c30fd602521986348ef952b7173ea37a064ee82b

fdo#74702 ImplPrintMask() implemented in Printer



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 7 Commit Notification 2014-03-22 02:09:02 UTC
Chris Sherlock committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=f84e7f573dd88cc814bdbc8c1678ed64f1edbf48

fdo#74702 Move BitmapEx drawing code to seperate functions



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 8 Commit Notification 2014-03-22 04:17:39 UTC
Chris Sherlock committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=d4855da9e9718b31b371376ee8a469e9e26495af

fdo#74702 Moved CopyArea() Window specific function



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 9 Commit Notification 2014-03-22 05:33:30 UTC
Chris Sherlock committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=0eb7070e767fd395cf2c8fbb83707e2efda2bf01

fdo#74702 DrawOutDev() and CopyArea() functions now noops in Printer



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 10 Commit Notification 2014-03-24 11:54:11 UTC
Chris Sherlock committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=eb5242851d8242fbadca7ac8fde7b633b207ba90

fdo#74702 GetPaintArea protected function introduced



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 11 Commit Notification 2014-03-24 12:03:51 UTC
Chris Sherlock committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=ca949408b89c990edb6321d59db9eed6d29d21a7

fdo#74702 ImplDrawBitmap functionality moved to protected function



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 12 Commit Notification 2014-03-25 12:17:52 UTC
Chris Sherlock committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=977aae0cdec71577cbdc74baea228a5f267e7fd8

fdo#74702 Moved EnableRTL() logic to specific classes where appropriate



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 13 Commit Notification 2014-03-25 12:26:41 UTC
Chris Sherlock committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=03568b2e2405fc44435b95720f3680ab1daea836

fdo#74702 Move GetBitCount() and GetAlphaBitCount into correct classes



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 14 Commit Notification 2014-03-25 12:28:14 UTC
Chris Sherlock committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=514d33fa3a409681be93bed3fb33f940a5549d88

fdo#74702 DrawTransformedBitmapEx simplified



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 15 Commit Notification 2014-03-26 12:32:05 UTC
Chris Sherlock committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=4d1111aafe4c153ca52d045d726799d4b1753142

fdo#74702 Move device specific bitmap drawing to its own function



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 16 Commit Notification 2014-03-26 12:35:33 UTC
Chris Sherlock committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=29bea73595b1c5dc8ee6c311ae3f43e3345448bb

fdo#74702 Followup to 4d1111aafe4c1$53ca52d045d726799d4b1753142



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 17 Commit Notification 2014-03-29 04:23:04 UTC
Chris Sherlock committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=9153a36b59f2efc2bfb2c9256c39eb5687808deb

fdo#74702 Refactor OutputDevice::DrawTransparent()



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 18 Commit Notification 2014-03-31 14:11:35 UTC
Chris Sherlock committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=ea7102c93c33884a68d4dba0de7d52f8ed4f4579

fdo#74702 OutputDevice::ImplInitFontList() fails if no fonts on device



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 19 Commit Notification 2014-03-31 21:07:06 UTC
Chris Sherlock committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=6d0273b70b228af6b18e0dfdb89759ccad30a03c

fdo#74702 New abstract function UsePolyPolygonForComplexGradient()



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 20 Commit Notification 2014-04-01 13:35:46 UTC
Chris Sherlock committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=04e08fa4aa419b8d89d80a39e6904bc4cd8883be

fdo#74702 Refactor code to use ClipToPaintRegion()



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 21 Commit Notification 2014-04-01 13:46:39 UTC
Chris Sherlock committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=65b3a78058e9d8a0e7c62ac9591c3b9e5c25eed7

fdo#74702 update bad advise in comment in DrawTransparentNatively()



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 22 Commit Notification 2014-04-06 11:06:19 UTC
Chris Sherlock committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=c8e7bae4da31ca7ed0a30ad476b7733f3c770bf9

fdo#74702 use same gradient steps func. to draw linear and complex grads



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 23 Commit Notification 2014-04-07 03:09:24 UTC
Chris Sherlock committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=8659d189ec04aca78c8ffff97fcca507ca0a9ec3

fdo#74702 Refactor gradient clipping functions



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 24 Commit Notification 2014-04-16 17:17:43 UTC
Chris Sherlock committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=bc3625fce46e3e4529b2eb7daabc5c66d7b1cbcc

fdo#74702 Move common mask functionality to ApplyMask



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 25 Commit Notification 2014-04-16 17:48:28 UTC
Chris Sherlock committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=948c4654f683e93b757f96e8859e9e91b45298a4

fdo#74702 Seperate ImplDrawGradientWallpaper and rename



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 26 Commit Notification 2014-04-19 02:26:22 UTC
Chris Sherlock committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=891e6a0be8e835edb102ecb272debe9c4e00b8e8

fdo#74702 Allow Printer & OutputDevice to handle font orientation



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 27 Commit Notification 2014-04-20 02:24:32 UTC
Chris Sherlock committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=588bb542bebdee5a67bd4695253c70646fb8a303

fdo#74702 Only VirtualDevice should handle the Word ext lead bug



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 28 Commit Notification 2014-04-22 14:30:42 UTC
Chris Sherlock committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=efbc6ba6af3db201e610abb93ceab61818b98d28

Fix regression introduced in f4e8bca336 when fixing fdo#74702



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 29 Commit Notification 2014-04-24 16:37:35 UTC
Chris Sherlock committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=95711f5b9e7b6a982d1762d37d5a38e0f40b86f9

fdo#74702 Move ImplInitClipRegion Window code out of OutputDevice



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 30 Commit Notification 2014-04-24 17:19:55 UTC
Chris Sherlock committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=66b2880ad51b69188ea5c2e56a682ed320c53d1e

fdo#74702 Move GetActiveClipRegion code into Window



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 31 Xisco Faulí 2016-09-10 15:40:02 UTC
Hi Chris,
I'm setting this ticket back to NEW as it has been inactive for more than 3 months.
Feel free to assign it back to you if you're still working on this.
Regards
Comment 32 Udaree Kanewala 2017-09-19 12:59:20 UTC
Hi, 

I would like to contribute to this bug. Is this bug still open?
Can someone help me with some starting pointers if this is still available?
Comment 33 Shinnok 2017-09-20 11:21:15 UTC
@Chris, git grep reveals that OutDevType enum hasn't been completely removed, there's still a couple places using it, can you please update this ticket with pointers on how to commence from where you left it?
Comment 34 Eyal Rozenberg 2018-09-17 20:19:50 UTC
(In reply to Shinnok from comment #33)
> @Chris, git grep reveals that OutDevType enum hasn't been completely
> removed, there's still a couple places using it, can you please update this
> ticket with pointers on how to commence from where you left it?

A year has passed with no comment from Chris Sherlock nor any other action on this page. Can you move it forward somehow?
Comment 35 Michael Meeks 2018-09-18 08:14:58 UTC
> A year has passed with no comment from Chris Sherlock nor any other
> action on this page. Can you move it forward somehow?

Its a shame - Chris did some nice work cleaning this up. I guess there is a whole suite of these that probably need the printer device to be special cased via nFlags to the Draw method - and to isolate just one check there.

vcl/source/outdev/nativecontrols.cxx-static bool EnableNativeWidget( const OutputDevice& i_rDevice 

This one should be a virtual bool method on the output device itself I guess.

Otherwise some of them look tougher to remove really - but worth having another easy-hacker have a go I think =)

Thanks !
Comment 36 Adrien Ollier 2019-04-10 19:01:22 UTC
Hello everybody,

I am working on this bug.
I have an idea how to solve this cleanly but there is a lot of work as many files have to be changed:

git grep -lE 'OUTDEV_(WINDOW|PRINTER|VIRDEV|PDF)' -- \*.cpp \*.cxx
canvas/source/vcl/canvashelper.cxx
canvas/source/vcl/spritecanvashelper.cxx
drawinglayer/source/processor2d/vclhelperbufferdevice.cxx
editeng/source/editeng/editeng.cxx
editeng/source/editeng/impedit3.cxx
sc/source/core/data/column2.cxx
sc/source/ui/view/drawview.cxx
sc/source/ui/view/output2.cxx
sc/source/ui/view/printfun.cxx
sd/source/ui/docshell/docshel2.cxx
sd/source/ui/unoidl/unomodel.cxx
sd/source/ui/view/sdview.cxx
sfx2/source/doc/objembed.cxx
starmath/source/document.cxx
starmath/source/rect.cxx
starmath/source/tmpdevice.cxx
svtools/source/brwbox/datwin.cxx
svtools/source/brwbox/editbrowsebox.cxx
svtools/source/control/ctrltool.cxx
svx/source/fmcomp/gridcell.cxx
svx/source/form/fmshell.cxx
svx/source/form/fmview.cxx
svx/source/form/fmvwimp.cxx
svx/source/form/navigatortree.cxx
svx/source/sdr/contact/objectcontactofobjlistpainter.cxx
svx/source/sdr/contact/objectcontactofpageview.cxx
svx/source/sdr/contact/viewcontactofunocontrol.cxx
svx/source/sdr/contact/viewobjectcontactofsdrmediaobj.cxx
svx/source/sdr/overlay/overlaymanager.cxx
svx/source/sdr/overlay/overlaymanagerbuffered.cxx
svx/source/svdraw/sdrpaintwindow.cxx
svx/source/svdraw/svdedxv.cxx
svx/source/svdraw/svdibrow.cxx
svx/source/svdraw/svdmrkv.cxx
svx/source/svdraw/svdotext.cxx
svx/source/svdraw/svdpntv.cxx
svx/source/svdraw/svdview.cxx
svx/source/table/tablecontroller.cxx
sw/source/core/doc/notxtfrm.cxx
sw/source/core/layout/paintfrm.cxx
sw/source/core/layout/virtoutp.cxx
sw/source/core/ole/ndole.cxx
sw/source/core/text/atrstck.cxx
sw/source/core/text/inftxt.cxx
sw/source/core/text/porfld.cxx
sw/source/core/txtnode/fntcache.cxx
sw/source/core/view/vnew.cxx
sw/source/uibase/config/viewopt.cxx
toolkit/source/awt/vclxdevice.cxx
toolkit/source/awt/vclxwindow.cxx
vcl/source/control/combobox.cxx
vcl/source/control/edit.cxx
vcl/source/control/listbox.cxx
vcl/source/control/scrbar.cxx
vcl/source/control/spinfld.cxx
vcl/source/edit/vclmedit.cxx
vcl/source/gdi/animate.cxx
vcl/source/gdi/gdimtf.cxx
vcl/source/gdi/graph.cxx
vcl/source/gdi/impanmvw.cxx
vcl/source/gdi/pdfwriter_impl.cxx
vcl/source/gdi/print.cxx
vcl/source/gdi/print2.cxx
vcl/source/gdi/virdev.cxx
vcl/source/outdev/clipping.cxx
vcl/source/outdev/font.cxx
vcl/source/outdev/hatch.cxx
vcl/source/outdev/map.cxx
vcl/source/outdev/nativecontrols.cxx
vcl/source/outdev/outdev.cxx
vcl/source/outdev/text.cxx
vcl/source/outdev/textline.cxx
vcl/source/toolkit/group.cxx
vcl/source/window/brdwin.cxx
vcl/source/window/decoview.cxx
vcl/source/window/window.cxx
vcl/source/window/window2.cxx
vcl/unx/generic/gdi/salgdi.cxx
vcl/workben/outdevgrind.cxx

It will take me several days to change, test compilation and check that there is no regression.
At the moment I do not know how I can check that there will be no regression.
Comment 37 Adrien Ollier 2019-04-20 12:13:34 UTC
work in progress...
Comment 38 Jan-Marek Glogowski 2019-04-22 11:37:11 UTC
(In reply to Adrien Ollier from comment #36)
> I am working on this bug.
> I have an idea how to solve this cleanly but there is a lot of work as many
> files have to be changed:
> 
> git grep -lE 'OUTDEV_(WINDOW|PRINTER|VIRDEV|PDF)' -- \*.cpp \*.cxx

a long list...
 
> It will take me several days to change, test compilation and check that
> there is no regression.
> At the moment I do not know how I can check that there will be no regression.

The easy hack is not to finish this in one go, but commit separate patches. A single patch will probably be sufficient as a hack, if it solves a call sites problem in a sensible way. Just look at the other patches already commited.

Generally the idea of this change is not to just rip out OutDevType and replacing its test sites with dynamic_cast == nullptr. Quoting the first comment:  "We need to remove this enum and move the logic to specific classes out of the base classes. This is a massive task, however."

Most times you will make a function virtual or add some virtual function and move the if / switch code branches into the respective class functions.
Comment 39 Tomaz Vajngerl 2019-04-23 03:07:55 UTC
A more higher level explanation: This bug is about fixing the current state where the type of the OutputDevice matters to the outside user. The type shouldn't matter - when I draw something to a OutputDevice the API behaviour should be the same if I draw to a window, off-screen surface, printer, PDF. All the details and differences of the different types should then be handled internally.
Comment 40 Commit Notification 2019-05-07 06:29:53 UTC
Adrien Ollier committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/0e791f4e59f0288081375d26d281a5aef41b628d%5E%21

tdf#74702 partial cleanup of OutDevType

It will be available in 6.3.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 41 Commit Notification 2019-06-10 08:58:22 UTC
Adrien Ollier committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/01813e6e86709c929f5e545ba206224f0bb25e5f%5E%21

tdf#74702 partial cleanup of OutDevType

It will be available in 6.4.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.