sw/qa/extras/tiledrendering/tiledrendering.cxx | 6 ++++++ sw/source/core/crsr/swcrsr.cxx | 4 +++- sw/source/core/crsr/viscrs.cxx | 4 ++-- sw/source/core/layout/trvlfrm.cxx | 3 ++- sw/source/core/view/viewimp.cxx | 5 +++-- 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 | 3 ++- 9 files changed, 29 insertions(+), 18 deletions(-)
New commits: commit 0d7920952a8748e3e2f02f7b27d624598d974006 Author: Ashod Nakashian <ashod.nakash...@collabora.co.uk> Date: Tue May 24 21:24:34 2016 -0400 bccu#1811 - Writer comment focusing / selection / cursor issue Partially based on fd205e40c58aa749fbe458d74ca0c2373a1017dc which caused make desktop.check to fail when viewsh.?xx changes were included, so left them out. Change-Id: I5b4576d2385c1812f358a2434b87c8ca62024430 Reviewed-on: https://gerrit.libreoffice.org/25421 Reviewed-by: Ashod Nakashian <ashnak...@gmail.com> Tested-by: Ashod Nakashian <ashnak...@gmail.com> diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx b/sw/qa/extras/tiledrendering/tiledrendering.cxx index 00d8595..a745b14 100644 --- a/sw/qa/extras/tiledrendering/tiledrendering.cxx +++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx @@ -174,6 +174,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(); @@ -184,6 +185,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() @@ -203,6 +205,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); @@ -216,6 +219,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), pShellCrsr->GetPoint()->nContent.GetIndex()); + comphelper::LibreOfficeKit::setActive(false); } void SwTiledRenderingTest::testSetTextSelection() @@ -442,6 +446,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); @@ -455,6 +460,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 6140342..fa05c64 100644 --- a/sw/source/core/crsr/swcrsr.cxx +++ b/sw/source/core/crsr/swcrsr.cxx @@ -51,6 +51,8 @@ #include <statstr.hrc> #include <redline.hxx> #include <txatbase.hxx> +#include <memory> +#include <comphelper/lok.hxx> using namespace ::com::sun::star::i18n; @@ -1379,7 +1381,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 1a0d423..9833bcd 100644 --- a/sw/source/core/crsr/viscrs.cxx +++ b/sw/source/core/crsr/viscrs.cxx @@ -92,7 +92,7 @@ void SwVisCrsr::Show() m_bIsVisible = true; // display at all? - if( m_pCrsrShell->VisArea().IsOver( m_pCrsrShell->m_aCharRect ) || m_pCrsrShell->isTiledRendering() ) + if( m_pCrsrShell->VisArea().IsOver( m_pCrsrShell->m_aCharRect ) || comphelper::LibreOfficeKit::isActive() ) _SetPosAndShow(); } } @@ -757,7 +757,7 @@ void SwShellTableCrsr::FillRects() bool bStart = true; SwRegionRects aReg( GetShell()->VisArea() ); - if (GetShell()->isTiledRendering()) + if (comphelper::LibreOfficeKit::isActive()) aReg = GetShell()->getIDocumentLayoutAccess()->GetCurrentLayout()->Frm(); SwNodes& rNds = GetDoc()->GetNodes(); SwFrm* pEndFrm = 0; diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx index 65aa24f..2a64493 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_GetCrsrOfst_Objects( const SwPageFrm* pPageFrm, bool bSearchBackground, @@ -2021,7 +2022,7 @@ void SwRootFrm::CalcFrmRects(SwShellCrsr &rCrsr) bool bIgnoreVisArea = false; 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 9299d6f..06a4715 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> @@ -133,13 +134,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( pSh->VisArea() ) || pSh->isTiledRendering() ) + if ( rRect.IsOver( pSh->VisArea() ) || comphelper::LibreOfficeKit::isActive() ) { if ( !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 = pSh->isTiledRendering() ? pSh->GetLayout()->Frm() : pSh->VisArea(); + const SwRect& rArea = comphelper::LibreOfficeKit::isActive() ? pSh->GetLayout()->Frm() : pSh->VisArea(); pRegion = new SwRegionRects( rArea ); } (*pRegion) -= rRect; diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx index b507247..cf1d13c 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, pSearchable); } } diff --git a/sw/source/uibase/docvw/SidebarWin.cxx b/sw/source/uibase/docvw/SidebarWin.cxx index 79e334e..3dca1cc 100644 --- a/sw/source/uibase/docvw/SidebarWin.cxx +++ b/sw/source/uibase/docvw/SidebarWin.cxx @@ -618,7 +618,7 @@ void SwSidebarWin::InitControls() LibreOfficeKitCallback pCallback = 0; void* pData = 0; pDrawModel->getLibreOfficeKitCallback(pCallback, pData); - mpOutlinerView->setTiledRendering(mrView.GetWrtShellPtr()->isTiledRendering()); + mpOutlinerView->setTiledRendering(true); mpOutlinerView->registerLibreOfficeKitCallback(pCallback, pData, pDrawModel); } diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx index 49d6245..b747965 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, 0, 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, 0, 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_bValidCrsrPos || rSh.IsFrmSelected()) && !rSh.isTiledRendering()) + if ((!g_bValidCrsrPos || rSh.IsFrmSelected()) && !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_pShadCrsr && !bInsWin ) delete m_pShadCrsr, m_pShadCrsr = 0; @@ -4890,7 +4890,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; @@ -6294,7 +6294,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()); @@ -6307,7 +6307,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()); @@ -6320,7 +6320,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 685fa8f..8ce18b8 100644 --- a/sw/source/uibase/wrtsh/wrtsh2.cxx +++ b/sw/source/uibase/wrtsh/wrtsh2.cxx @@ -67,6 +67,7 @@ #include <boost/scoped_ptr.hpp> #include <LibreOfficeKit/LibreOfficeKitEnums.h> +#include <comphelper/lok.hxx> void SwWrtShell::Insert(SwField &rField) { @@ -472,7 +473,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; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits