diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-12-11 08:04:47 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-12-11 08:06:29 +0100 |
commit | fd205e40c58aa749fbe458d74ca0c2373a1017dc (patch) | |
tree | cea0d6809b0a6d3d1acc6df952f9b0ccf53f4dab | |
parent | bd05eec9e30647394c0624c94b97e46bf8b7533f (diff) |
sw: clean up no longer needed SwViewShell::isTiledRendering()
Change-Id: Icd719c461613f8c59cad81b256678307f69974e1
-rw-r--r-- | sw/inc/viewsh.hxx | 2 | ||||
-rw-r--r-- | sw/qa/extras/tiledrendering/tiledrendering.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/crsr/swcrsr.cxx | 3 | ||||
-rw-r--r-- | sw/source/core/crsr/viscrs.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/layout/trvlfrm.cxx | 3 | ||||
-rw-r--r-- | sw/source/core/view/viewimp.cxx | 5 | ||||
-rw-r--r-- | sw/source/core/view/viewsh.cxx | 20 | ||||
-rw-r--r-- | sw/source/uibase/docvw/PostItMgr.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/docvw/SidebarWin.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/docvw/edtwin.cxx | 18 | ||||
-rw-r--r-- | sw/source/uibase/wrtsh/wrtsh2.cxx | 4 |
11 files changed, 36 insertions, 33 deletions
diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx index 7a83589478b7..bd1a0b5457ea 100644 --- a/sw/inc/viewsh.hxx +++ b/sw/inc/viewsh.hxx @@ -574,8 +574,6 @@ public: void libreOfficeKitCallback(int nType, const char* pPayload) const; /// Set if we are doing tiled rendering. void setTiledRendering(bool bTiledRendering); - /// Are we doing tiled rendering? - bool isTiledRendering() const; void setOutputToWindow(bool bOutputToWindow); bool isOutputToWindow() const; diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx b/sw/qa/extras/tiledrendering/tiledrendering.cxx index a975fff35ade..0e5539c70bbf 100644 --- a/sw/qa/extras/tiledrendering/tiledrendering.cxx +++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx @@ -151,6 +151,7 @@ void SwTiledRenderingTest::callbackImpl(int nType, const char* pPayload) void SwTiledRenderingTest::testRegisterCallback() { + comphelper::LibreOfficeKit::setActive(); SwXTextDocument* pXTextDocument = createDoc("dummy.fodt"); pXTextDocument->registerCallback(&SwTiledRenderingTest::callback, this); SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell(); @@ -161,6 +162,7 @@ void SwTiledRenderingTest::testRegisterCallback() CPPUNIT_ASSERT(!m_aInvalidation.IsEmpty()); Rectangle aTopLeft(0, 0, 256*15, 256*15); // 1 px = 15 twips, assuming 96 DPI. CPPUNIT_ASSERT(m_aInvalidation.IsOver(aTopLeft)); + comphelper::LibreOfficeKit::setActive(false); } void SwTiledRenderingTest::testPostKeyEvent() @@ -180,6 +182,7 @@ void SwTiledRenderingTest::testPostKeyEvent() void SwTiledRenderingTest::testPostMouseEvent() { + comphelper::LibreOfficeKit::setActive(); SwXTextDocument* pXTextDocument = createDoc("dummy.fodt"); SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell(); pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false); @@ -193,6 +196,7 @@ void SwTiledRenderingTest::testPostMouseEvent() pXTextDocument->postMouseEvent(LOK_MOUSEEVENT_MOUSEBUTTONUP, aStart.getX(), aStart.getY(), 1); // The new cursor position must be before the first word. CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), pShellCursor->GetPoint()->nContent.GetIndex()); + comphelper::LibreOfficeKit::setActive(false); } void SwTiledRenderingTest::testSetTextSelection() @@ -419,6 +423,7 @@ void SwTiledRenderingTest::testSearchTextFrameWrapAround() void SwTiledRenderingTest::testDocumentSizeChanged() { + comphelper::LibreOfficeKit::setActive(); // Get the current document size. SwXTextDocument* pXTextDocument = createDoc("2-pages.odt"); pXTextDocument->registerCallback(&SwTiledRenderingTest::callback, this); @@ -432,6 +437,7 @@ void SwTiledRenderingTest::testDocumentSizeChanged() CPPUNIT_ASSERT_EQUAL(aSize.getWidth(), m_aDocumentSize.getWidth()); // Document height should be smaller now. CPPUNIT_ASSERT(aSize.getHeight() > m_aDocumentSize.getHeight()); + comphelper::LibreOfficeKit::setActive(false); } void SwTiledRenderingTest::testSearchAll() 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 <redline.hxx> #include <txatbase.hxx> #include <memory> +#include <comphelper/lok.hxx> 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 <cfloat> #include <swselectionlist.hxx> +#include <comphelper/lok.hxx> 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 <pagepreviewlayout.hxx> #include <comcore.hrc> #include <svx/svdundo.hxx> +#include <comphelper/lok.hxx> #include <IDocumentLayoutAccess.hxx> #include <IDocumentDrawModelAccess.hxx> #include <IDocumentDeviceAccess.hxx> @@ -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 <svx/sdrpaintwindow.hxx> #include <svx/sdr/overlay/overlaymanager.hxx> #include <LibreOfficeKit/LibreOfficeKitEnums.h> +#include <comphelper/lok.hxx> #if !HAVE_FEATURE_DESKTOP #include <vcl/sysdata.hxx> @@ -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 <com/sun/star/document/XDocumentProperties.hpp> #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp> -#include <xmloff/odffields.hxx> #include <memory> #include <LibreOfficeKit/LibreOfficeKitEnums.h> +#include <comphelper/lok.hxx> 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; |