From fd205e40c58aa749fbe458d74ca0c2373a1017dc Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Fri, 11 Dec 2015 08:04:47 +0100 Subject: sw: clean up no longer needed SwViewShell::isTiledRendering() Change-Id: Icd719c461613f8c59cad81b256678307f69974e1 --- sw/source/core/crsr/swcrsr.cxx | 3 ++- sw/source/core/crsr/viscrs.cxx | 4 ++-- sw/source/core/layout/trvlfrm.cxx | 3 ++- sw/source/core/view/viewimp.cxx | 5 +++-- sw/source/core/view/viewsh.cxx | 20 ++++++++------------ sw/source/uibase/docvw/PostItMgr.cxx | 2 +- sw/source/uibase/docvw/SidebarWin.cxx | 2 +- sw/source/uibase/docvw/edtwin.cxx | 18 +++++++++--------- sw/source/uibase/wrtsh/wrtsh2.cxx | 4 ++-- 9 files changed, 30 insertions(+), 31 deletions(-) (limited to 'sw/source') diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx index dfba8e38369d..471fa9e5aa69 100644 --- a/sw/source/core/crsr/swcrsr.cxx +++ b/sw/source/core/crsr/swcrsr.cxx @@ -52,6 +52,7 @@ #include #include #include +#include using namespace ::com::sun::star::i18n; @@ -1379,7 +1380,7 @@ bool SwCursor::SelectWordWT( SwViewShell* pViewShell, sal_Int16 nWordType, const nWordType, bForward )); - if (pViewShell->isTiledRendering() && aBndry.startPos == aBndry.endPos && nPtPos > 0) + if (comphelper::LibreOfficeKit::isActive() && aBndry.startPos == aBndry.endPos && nPtPos > 0) { // nPtPos is the end of the paragraph, select the last word then. --nPtPos; diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx index 044083b0431e..50344ee42e9e 100644 --- a/sw/source/core/crsr/viscrs.cxx +++ b/sw/source/core/crsr/viscrs.cxx @@ -92,7 +92,7 @@ void SwVisibleCursor::Show() m_bIsVisible = true; // display at all? - if( m_pCursorShell->VisArea().IsOver( m_pCursorShell->m_aCharRect ) || m_pCursorShell->isTiledRendering() ) + if( m_pCursorShell->VisArea().IsOver( m_pCursorShell->m_aCharRect ) || comphelper::LibreOfficeKit::isActive() ) _SetPosAndShow(); } } @@ -756,7 +756,7 @@ void SwShellTableCursor::FillRects() bool bStart = true; SwRegionRects aReg( GetShell()->VisArea() ); - if (GetShell()->isTiledRendering()) + if (comphelper::LibreOfficeKit::isActive()) aReg = GetShell()->getIDocumentLayoutAccess().GetCurrentLayout()->Frame(); SwNodes& rNds = GetDoc()->GetNodes(); SwFrame* pEndFrame = nullptr; diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx index aa8673225901..c955254f9116 100644 --- a/sw/source/core/layout/trvlfrm.cxx +++ b/sw/source/core/layout/trvlfrm.cxx @@ -47,6 +47,7 @@ #include #include +#include namespace { bool lcl_GetCursorOfst_Objects( const SwPageFrame* pPageFrame, bool bSearchBackground, @@ -2020,7 +2021,7 @@ void SwRootFrame::CalcFrameRects(SwShellCursor &rCursor) bool bIgnoreVisArea = true; if (pSh) - bIgnoreVisArea = pSh->GetViewOptions()->IsPDFExport() || pSh->isTiledRendering(); + bIgnoreVisArea = pSh->GetViewOptions()->IsPDFExport() || comphelper::LibreOfficeKit::isActive(); // #i12836# enhanced pdf SwRegionRects aRegion( !bIgnoreVisArea ? diff --git a/sw/source/core/view/viewimp.cxx b/sw/source/core/view/viewimp.cxx index d84ffa91d15d..7d6017ce23d7 100644 --- a/sw/source/core/view/viewimp.cxx +++ b/sw/source/core/view/viewimp.cxx @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -132,13 +133,13 @@ void SwViewShellImp::DelRegion() bool SwViewShellImp::AddPaintRect( const SwRect &rRect ) { // In case of tiled rendering the visual area is the last painted tile -> not interesting. - if ( rRect.IsOver( m_pShell->VisArea() ) || m_pShell->isTiledRendering() ) + if ( rRect.IsOver( m_pShell->VisArea() ) || comphelper::LibreOfficeKit::isActive() ) { if ( !m_pRegion ) { // In case of normal rendering, this makes sure only visible rectangles are painted. // Otherwise get the rectangle of the full document, so all paint rectangles are invalidated. - const SwRect& rArea = m_pShell->isTiledRendering() ? m_pShell->GetLayout()->Frame() : m_pShell->VisArea(); + const SwRect& rArea = comphelper::LibreOfficeKit::isActive() ? m_pShell->GetLayout()->Frame() : m_pShell->VisArea(); m_pRegion = new SwRegionRects( rArea ); } (*m_pRegion) -= rRect; diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index 1b01d6e6d02c..e0ff3fd4e3f5 100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -80,6 +80,7 @@ #include #include #include +#include #if !HAVE_FEATURE_DESKTOP #include @@ -134,11 +135,6 @@ void SwViewShell::setTiledRendering(bool bTiledRendering) getIDocumentDrawModelAccess().GetDrawModel()->setTiledRendering(bTiledRendering); } -bool SwViewShell::isTiledRendering() const -{ - return getIDocumentDrawModelAccess().GetDrawModel()->isTiledRendering(); -} - void SwViewShell::setOutputToWindow(bool bOutputToWindow) { mbOutputToWindow = bOutputToWindow; @@ -195,7 +191,7 @@ void SwViewShell::DLPrePaint2(const vcl::Region& rRegion) MakeDrawView(); // Prefer window; if not available, get mpOut (e.g. printer) - const bool bWindow = GetWin() && !isTiledRendering() && !isOutputToWindow(); + const bool bWindow = GetWin() && !comphelper::LibreOfficeKit::isActive() && !isOutputToWindow(); mpPrePostOutDev = bWindow ? GetWin(): GetOut(); // #i74769# use SdrPaintWindow now direct @@ -424,7 +420,7 @@ void SwViewShell::ImplEndAction( const bool bIdleEnd ) if ( bPaintsFromSystem ) PaintDesktop(*GetOut(), aRect); - if (!isTiledRendering()) + if (!comphelper::LibreOfficeKit::isActive()) pCurrentLayout->Paint( *mpOut, aRect ); else pCurrentLayout->GetCurrShell()->InvalidateWindows(aRect.SVRect()); @@ -567,7 +563,7 @@ void SwViewShell::InvalidateWindows( const SwRect &rRect ) ::RepaintPagePreview( &rSh, rRect ); // In case of tiled rendering, invalidation is wanted even if // the rectangle is outside the visual area. - else if ( rSh.VisArea().IsOver( rRect ) || rSh.isTiledRendering() ) + else if ( rSh.VisArea().IsOver( rRect ) || comphelper::LibreOfficeKit::isActive() ) rSh.GetWin()->Invalidate( rRect.SVRect() ); } } @@ -578,7 +574,7 @@ const SwRect& SwViewShell::VisArea() const { // when using the tiled rendering, consider the entire document as our // visible area - return isTiledRendering()? GetLayout()->Frame(): maVisArea; + return comphelper::LibreOfficeKit::isActive()? GetLayout()->Frame(): maVisArea; } void SwViewShell::MakeVisible( const SwRect &rRect ) @@ -1022,7 +1018,7 @@ void SwViewShell::SizeChgNotify() OUString sDisplay = rNum.GetNumStr( nVirtNum ); PageNumNotify( this, pCnt->GetPhyPageNum(), nVirtNum, sDisplay ); - if (isTiledRendering()) + if (comphelper::LibreOfficeKit::isActive()) { Size aDocSize = GetDocSize(); std::stringstream ss; @@ -1182,7 +1178,7 @@ void SwViewShell::VisPortChgd( const SwRect &rRect) // When tiled rendering, the map mode of the window is disabled, avoid // enabling it here. - if (!isTiledRendering()) + if (!comphelper::LibreOfficeKit::isActive()) { Point aPt( VisArea().Pos() ); aPt.X() = -aPt.X(); aPt.Y() = -aPt.Y(); @@ -1860,7 +1856,7 @@ void SwViewShell::PaintTile(VirtualDevice &rDevice, int contextWidth, int contex // TODO clean up SwViewShell's approach to output devices (the many of // them - mpBufferedOut, mpOut, mpWin, ...) OutputDevice *pSaveOut = mpOut; - bool bTiledRendering = isTiledRendering(); + bool bTiledRendering = comphelper::LibreOfficeKit::isActive(); setTiledRendering(true); mbInLibreOfficeKitCallback = true; mpOut = &rDevice; diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx index d9859402ac1a..c4d0f6a4e87e 100644 --- a/sw/source/uibase/docvw/PostItMgr.cxx +++ b/sw/source/uibase/docvw/PostItMgr.cxx @@ -889,7 +889,7 @@ void SwPostItMgr::registerLibreOfficeKitCallback(LibreOfficeKitCallback pCallbac if (!pPostIt) continue; - pPostIt->GetOutlinerView()->setTiledRendering(mpWrtShell->isTiledRendering()); + pPostIt->GetOutlinerView()->setTiledRendering(comphelper::LibreOfficeKit::isActive()); pPostIt->GetOutlinerView()->registerLibreOfficeKitCallback(pCallback, pData); } } diff --git a/sw/source/uibase/docvw/SidebarWin.cxx b/sw/source/uibase/docvw/SidebarWin.cxx index c0ec62d1acd5..6f73a63b0272 100644 --- a/sw/source/uibase/docvw/SidebarWin.cxx +++ b/sw/source/uibase/docvw/SidebarWin.cxx @@ -618,7 +618,7 @@ void SwSidebarWin::InitControls() LibreOfficeKitCallback pCallback = nullptr; void* pData = nullptr; pDrawModel->getLibreOfficeKitCallback(pCallback, pData); - mpOutlinerView->setTiledRendering(mrView.GetWrtShellPtr()->isTiledRendering()); + mpOutlinerView->setTiledRendering(comphelper::LibreOfficeKit::isActive()); mpOutlinerView->registerLibreOfficeKitCallback(pCallback, pData); } diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx index 852f52575f61..2a11d57df0a5 100644 --- a/sw/source/uibase/docvw/edtwin.cxx +++ b/sw/source/uibase/docvw/edtwin.cxx @@ -3293,7 +3293,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) { case nsSelectionType::SEL_GRF: RstMBDownFlags(); - if (!rSh.isTiledRendering()) + if (!comphelper::LibreOfficeKit::isActive()) { GetView().GetViewFrame()->GetBindings().Execute( FN_FORMAT_GRAFIC_DLG, nullptr, 0, @@ -3312,7 +3312,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) case nsSelectionType::SEL_FRM: RstMBDownFlags(); - if (!rSh.isTiledRendering()) + if (!comphelper::LibreOfficeKit::isActive()) { GetView().GetViewFrame()->GetBindings().Execute( FN_FORMAT_FRAME_DLG, nullptr, 0, @@ -3331,7 +3331,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) // if the cursor position was corrected or if a Fly // was selected in ReadOnlyMode, no word selection, except when tiled rendering. - if ((!g_bValidCursorPos || rSh.IsFrameSelected()) && !rSh.isTiledRendering()) + if ((!g_bValidCursorPos || rSh.IsFrameSelected()) && !comphelper::LibreOfficeKit::isActive()) return; SwField *pField; @@ -3383,7 +3383,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) } else { - if (!rSh.SelWrd(&aDocPos) && rSh.isTiledRendering()) + if (!rSh.SelWrd(&aDocPos) && comphelper::LibreOfficeKit::isActive()) // Double click did not select any word: try to // select the current cell in case we are in a // table. @@ -3786,7 +3786,7 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) } const Point aOldPt( rSh.VisArea().Pos() ); - const bool bInsWin = rSh.VisArea().IsInside( aDocPt ) || rSh.isTiledRendering(); + const bool bInsWin = rSh.VisArea().IsInside( aDocPt ) || comphelper::LibreOfficeKit::isActive(); if( m_pShadCursor && !bInsWin ) delete m_pShadCursor, m_pShadCursor = nullptr; @@ -4891,7 +4891,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) if (bCallBase) Window::MouseButtonUp(rMEvt); - if (pSdrView && rMEvt.GetClicks() == 1 && rSh.isTiledRendering()) + if (pSdrView && rMEvt.GetClicks() == 1 && comphelper::LibreOfficeKit::isActive()) { // When tiled rendering, single click on a shape text starts editing already. SdrViewEvent aViewEvent; @@ -6301,7 +6301,7 @@ void SwEditWin::LogicInvalidate(const Rectangle* pRectangle) void SwEditWin::LogicMouseButtonDown(const MouseEvent& rMouseEvent) { // When we're not doing tiled rendering, then positions must be passed as pixels. - assert(m_rView.GetWrtShell().isTiledRendering()); + assert(comphelper::LibreOfficeKit::isActive()); Point aPoint = GetPointerPosPixel(); SetLastMousePos(rMouseEvent.GetPosPixel()); @@ -6314,7 +6314,7 @@ void SwEditWin::LogicMouseButtonDown(const MouseEvent& rMouseEvent) void SwEditWin::LogicMouseButtonUp(const MouseEvent& rMouseEvent) { // When we're not doing tiled rendering, then positions must be passed as pixels. - assert(m_rView.GetWrtShell().isTiledRendering()); + assert(comphelper::LibreOfficeKit::isActive()); Point aPoint = GetPointerPosPixel(); SetLastMousePos(rMouseEvent.GetPosPixel()); @@ -6327,7 +6327,7 @@ void SwEditWin::LogicMouseButtonUp(const MouseEvent& rMouseEvent) void SwEditWin::LogicMouseMove(const MouseEvent& rMouseEvent) { // When we're not doing tiled rendering, then positions must be passed as pixels. - assert(m_rView.GetWrtShell().isTiledRendering()); + assert(comphelper::LibreOfficeKit::isActive()); Point aPoint = GetPointerPosPixel(); SetLastMousePos(rMouseEvent.GetPosPixel()); diff --git a/sw/source/uibase/wrtsh/wrtsh2.cxx b/sw/source/uibase/wrtsh/wrtsh2.cxx index 1f88e467c616..4cc21fa0bfd0 100644 --- a/sw/source/uibase/wrtsh/wrtsh2.cxx +++ b/sw/source/uibase/wrtsh/wrtsh2.cxx @@ -63,10 +63,10 @@ #include #include -#include #include #include +#include void SwWrtShell::Insert(SwField &rField) { @@ -472,7 +472,7 @@ void LoadURL( SwViewShell& rVSh, const OUString& rURL, sal_uInt16 nFilter, return; // We are doing tiledRendering, let the client handles the URL loading. - if (rVSh.isTiledRendering()) + if (comphelper::LibreOfficeKit::isActive()) { rVSh.libreOfficeKitCallback(LOK_CALLBACK_HYPERLINK_CLICKED, rURL.toUtf8().getStr()); return; -- cgit v1.2.3