diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-01-13 09:12:45 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-01-13 09:13:38 +0100 |
commit | 64659d59310b17ce6ca410bfca2e231d8b79b0ff (patch) | |
tree | 2e847f8da6181ea4e7d1cc1791b8645bc7b38d9a /sc | |
parent | 9dd258e7029847537e61f34936e1ef200f3b7233 (diff) |
sc: clean up remaining non-static isTiledRendering() usage
Change-Id: I546f644e220069904fc2723f953ce2e6e2bfaca3
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/documen3.cxx | 5 | ||||
-rw-r--r-- | sc/source/core/data/global.cxx | 3 | ||||
-rw-r--r-- | sc/source/ui/app/inputhdl.cxx | 11 | ||||
-rw-r--r-- | sc/source/ui/view/gridwin.cxx | 18 | ||||
-rw-r--r-- | sc/source/ui/view/gridwin2.cxx | 3 | ||||
-rw-r--r-- | sc/source/ui/view/gridwin3.cxx | 3 | ||||
-rw-r--r-- | sc/source/ui/view/gridwin4.cxx | 7 | ||||
-rw-r--r-- | sc/source/ui/view/viewdata.cxx | 12 | ||||
-rw-r--r-- | sc/source/ui/view/viewfun2.cxx | 2 |
9 files changed, 33 insertions, 31 deletions
diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx index f7b662aafad1..c96eb592c6be 100644 --- a/sc/source/core/data/documen3.cxx +++ b/sc/source/core/data/documen3.cxx @@ -74,6 +74,7 @@ #include "globalnames.hxx" #include <LibreOfficeKit/LibreOfficeKitEnums.h> +#include <comphelper/lok.hxx> #include <memory> using namespace com::sun::star; @@ -1301,7 +1302,7 @@ bool ScDocument::SearchAndReplace( rSearchItem, nCol, nRow ); // notify LibreOfficeKit about changed page - if ( GetDrawLayer() && GetDrawLayer()->isTiledRendering() ) + if ( comphelper::LibreOfficeKit::isActive() ) { OString aPayload = OString::number(nTab); GetDrawLayer()->libreOfficeKitCallback(LOK_CALLBACK_SET_PART, aPayload.getStr()); @@ -1331,7 +1332,7 @@ bool ScDocument::SearchAndReplace( rSearchItem, nCol, nRow ); // notify LibreOfficeKit about changed page - if ( GetDrawLayer() && GetDrawLayer()->isTiledRendering() ) + if ( comphelper::LibreOfficeKit::isActive() ) { OString aPayload = OString::number(nTab); GetDrawLayer()->libreOfficeKitCallback(LOK_CALLBACK_SET_PART, aPayload.getStr()); diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx index bc0cdcf9b70e..43e22c109d92 100644 --- a/sc/source/core/data/global.cxx +++ b/sc/source/core/data/global.cxx @@ -59,6 +59,7 @@ #include <unotools/transliterationwrapper.hxx> #include <LibreOfficeKit/LibreOfficeKitEnums.h> +#include <comphelper/lok.hxx> #include "global.hxx" #include "scresid.hxx" @@ -871,7 +872,7 @@ bool ScGlobal::EETextObjEqual( const EditTextObject* pObj1, void ScGlobal::OpenURL(const OUString& rURL, const OUString& rTarget, const SdrModel* pDrawLayer) { - if (pDrawLayer && pDrawLayer->isTiledRendering()) + if (pDrawLayer && comphelper::LibreOfficeKit::isActive()) { pDrawLayer->libreOfficeKitCallback(LOK_CALLBACK_HYPERLINK_CLICKED, rURL.toUtf8().getStr()); return; diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index 82a8185ce0fd..65fd839da6e9 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -53,6 +53,7 @@ #include <comphelper/string.hxx> #include <formula/formulahelper.hxx> #include <LibreOfficeKit/LibreOfficeKitEnums.h> +#include <comphelper/lok.hxx> #include "inputwin.hxx" #include "tabvwsh.hxx" @@ -639,9 +640,8 @@ void ScInputHandler::ImplCreateEditEngine() // paint if (pActiveViewSh) { - ScDocument& rDoc = pActiveViewSh->GetViewData().GetDocShell()->GetDocument(); if (EditView* pEditView = pEngine->GetActiveView()) - pEditView->setTiledRendering(rDoc.GetDrawLayer()->isTiledRendering()); + pEditView->setTiledRendering(comphelper::LibreOfficeKit::isActive()); } } @@ -1719,8 +1719,7 @@ void ScInputHandler::UpdateActiveView() if (pActiveViewSh && pTableView) { ScDocShell* pDocShell = pActiveViewSh->GetViewData().GetDocShell(); - ScDocument& rDoc = pDocShell->GetDocument(); - if (rDoc.GetDrawLayer()->isTiledRendering()) + if (comphelper::LibreOfficeKit::isActive()) { ScDrawLayer *pDrawLayer = pDocShell->GetDocument().GetDrawLayer(); pTableView->registerLibreOfficeKitCallback(pDrawLayer->getLibreOfficeKitCallback(), pDrawLayer->getLibreOfficeKitData()); @@ -2133,7 +2132,7 @@ void ScInputHandler::DataChanged( bool bFromTopNotify, bool bSetModified ) ScDocShell* pDocSh = pActiveViewSh->GetViewData().GetDocShell(); ScDocument& rDoc = pDocSh->GetDocument(); - if ( rDoc.GetDrawLayer()->isTiledRendering() ) + if ( comphelper::LibreOfficeKit::isActive() ) rDoc.GetDrawLayer()->libreOfficeKitCallback(LOK_CALLBACK_CELL_FORMULA, aText.toUtf8().getStr()); } @@ -3470,7 +3469,7 @@ void ScInputHandler::NotifyChange( const ScInputHdlState* pState, if ( pInputWin ) pInputWin->SetTextString(aString); - else if ( rDoc.GetDrawLayer()->isTiledRendering() ) + else if ( comphelper::LibreOfficeKit::isActive() ) rDoc.GetDrawLayer()->libreOfficeKitCallback(LOK_CALLBACK_CELL_FORMULA, aString.toUtf8().getStr()); } diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index fe96a0e982e9..69c16cef2bbe 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -135,6 +135,7 @@ #include <vcl/svapp.hxx> #include <svx/sdr/overlay/overlayselection.hxx> #include <comphelper/string.hxx> +#include <comphelper/lok.hxx> #include <LibreOfficeKit/LibreOfficeKitEnums.h> @@ -1783,7 +1784,7 @@ void ScGridWindow::HandleMouseButtonDown( const MouseEvent& rMEvt, MouseEventSta bool bEditMode = pViewData->HasEditView(eWhich); // also in Mode==SC_INPUT_TYPE bool bDouble = (rMEvt.GetClicks() == 2); ScDocument* pDoc = pViewData->GetDocument(); - bool bIsTiledRendering = pDoc->GetDrawLayer()->isTiledRendering(); + bool bIsTiledRendering = comphelper::LibreOfficeKit::isActive(); // DeactivateIP does only happen when MarkListHasChanged @@ -2336,7 +2337,7 @@ void ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt ) // double click (only left button) // in the tiled rendering case, single click works this way too - bool bIsTiledRendering = pViewData->GetDocument()->GetDrawLayer()->isTiledRendering(); + bool bIsTiledRendering = comphelper::LibreOfficeKit::isActive(); bool bDouble = ( rMEvt.GetClicks() == 2 && rMEvt.IsLeft() ); if ((bDouble || bIsTiledRendering) && !bRefMode && (nMouseStatus == SC_GM_DBLDOWN || bIsTiledRendering) && !pScMod->IsRefDialogOpen()) { @@ -5944,7 +5945,7 @@ void ScGridWindow::UpdateCopySourceOverlay() */ static void updateLibreOfficeKitSelection(ScViewData* pViewData, ScDrawLayer* pDrawLayer, const std::vector<Rectangle>& rRectangles, std::vector<Rectangle>* pLogicRects = nullptr) { - if (!pDrawLayer->isTiledRendering()) + if (!comphelper::LibreOfficeKit::isActive()) return; double nPPTX = pViewData->GetPPTX(); @@ -6012,9 +6013,7 @@ void ScGridWindow::UpdateCursorOverlay() const ScPatternAttr* pPattern = pDoc->GetPattern(nX,nY,nTab); - ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer(); - - if (!pDrawLayer->isTiledRendering() && !maVisibleRange.isInside(nX, nY)) + if (!comphelper::LibreOfficeKit::isActive() && !maVisibleRange.isInside(nX, nY)) { if (maVisibleRange.mnCol2 < nX || maVisibleRange.mnRow2 < nY) return; // no further check needed, nothing visible @@ -6037,7 +6036,7 @@ void ScGridWindow::UpdateCursorOverlay() bool bOverlapped = rMergeFlag.IsOverlapped(); // left or above of the screen? - bool bVis = pDrawLayer->isTiledRendering() || ( nX>=pViewData->GetPosX(eHWhich) && nY>=pViewData->GetPosY(eVWhich) ); + bool bVis = comphelper::LibreOfficeKit::isActive() || ( nX>=pViewData->GetPosX(eHWhich) && nY>=pViewData->GetPosY(eVWhich) ); if (!bVis) { SCCOL nEndX = nX; @@ -6067,7 +6066,7 @@ void ScGridWindow::UpdateCursorOverlay() } // in the tiled rendering case, don't limit to the screen size - if (bMaybeVisible || pDrawLayer->isTiledRendering()) + if (bMaybeVisible || comphelper::LibreOfficeKit::isActive()) { long nSizeXPix; long nSizeYPix; @@ -6112,7 +6111,8 @@ void ScGridWindow::UpdateCursorOverlay() if ( !aPixelRects.empty() ) { - if (pDrawLayer->isTiledRendering()) { + if (comphelper::LibreOfficeKit::isActive()) + { mpOOCursors.reset(new sdr::overlay::OverlayObjectList); updateLibreOfficeKitCellCursor(); } diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx index b249802186b7..c90d8dbf6d3a 100644 --- a/sc/source/ui/view/gridwin2.cxx +++ b/sc/source/ui/view/gridwin2.cxx @@ -20,6 +20,7 @@ #include "scitems.hxx" #include <vcl/msgbox.hxx> #include <vcl/settings.hxx> +#include <comphelper/lok.hxx> #include "gridwin.hxx" #include "tabvwsh.hxx" @@ -594,7 +595,7 @@ bool ScGridWindow::UpdateVisibleRange() SCCOL nXRight = MAXCOL; SCROW nYBottom = MAXROW; - if (rDoc.GetDrawLayer()->isTiledRendering()) + if (comphelper::LibreOfficeKit::isActive()) { // entire table in the tiled rendering case SCTAB nTab = pViewData->GetTabNo(); diff --git a/sc/source/ui/view/gridwin3.cxx b/sc/source/ui/view/gridwin3.cxx index 4f97aa4f6679..e8335c437f19 100644 --- a/sc/source/ui/view/gridwin3.cxx +++ b/sc/source/ui/view/gridwin3.cxx @@ -42,6 +42,7 @@ #include "userdat.hxx" #include "unitconv.hxx" #include <svx/svdpage.hxx> +#include <comphelper/lok.hxx> bool ScGridWindow::DrawMouseButtonDown(const MouseEvent& rMEvt) { @@ -242,7 +243,7 @@ MapMode ScGridWindow::GetDrawMapMode( bool bForce ) // work in the logic coordinates (ideally 100ths of mm - so that it is // the same as editeng and drawinglayer), and get rid of all the // SetMapMode's and other unneccessary fun we have with pixels - if (pDoc->GetDrawLayer() && pDoc->GetDrawLayer()->isTiledRendering()) + if (comphelper::LibreOfficeKit::isActive()) { return pViewData->GetLogicMode(); } diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index 387db1c09b70..4a4e75670cd5 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -30,6 +30,7 @@ #include <vcl/settings.hxx> #include <LibreOfficeKit/LibreOfficeKitEnums.h> +#include <comphelper/lok.hxx> #include <svx/svdview.hxx> #include "tabvwsh.hxx" @@ -383,7 +384,7 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod // all the rendering should go through PaintTile() in that case. // TODO revisit if we can actually turn this into an assert(), and clean // up the callers - if (rDoc.GetDrawLayer()->isTiledRendering()) + if (comphelper::LibreOfficeKit::isActive()) return; ScModule* pScMod = SC_MOD(); @@ -523,7 +524,7 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI ScDocShell* pDocSh = pViewData->GetDocShell(); ScDocument& rDoc = pDocSh->GetDocument(); const ScViewOptions& rOpts = pViewData->GetOptions(); - bool bIsTiledRendering = rDoc.GetDrawLayer()->isTiledRendering(); + bool bIsTiledRendering = comphelper::LibreOfficeKit::isActive(); SCTAB nTab = aOutputData.nTab; SCCOL nX1 = aOutputData.nX1; @@ -1588,7 +1589,7 @@ void ScGridWindow::GetSelectionRects( ::std::vector< Rectangle >& rPixelRects ) if (nY1 < nPosY) nY1 = nPosY; - if (!pDoc->GetDrawLayer()->isTiledRendering()) + if (!comphelper::LibreOfficeKit::isActive()) { // limit the selection to only what is visible on the screen SCCOL nXRight = nPosX + pViewData->VisibleCellsX(eHWhich); diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index 3488ed9aba06..fdf86d44faaa 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -61,6 +61,7 @@ #include <boost/checked_delete.hpp> #include <comphelper/processfactory.hxx> #include <comphelper/string.hxx> +#include <comphelper/lok.hxx> #include <com/sun/star/container/XNameContainer.hpp> #include <com/sun/star/document/NamedPropertyValues.hpp> @@ -937,7 +938,7 @@ void ScViewData::SetEditEngine( ScSplitPos eWhich, { pEditView[eWhich] = new EditView( pNewEngine, pWin ); - if (pDoc->GetDrawLayer() && pDoc->GetDrawLayer()->isTiledRendering()) + if (pDoc->GetDrawLayer() && comphelper::LibreOfficeKit::isActive()) { pEditView[eWhich]->registerLibreOfficeKitCallback(pDoc->GetDrawLayer()->getLibreOfficeKitCallback(), pDoc->GetDrawLayer()->getLibreOfficeKitData()); @@ -1518,8 +1519,7 @@ Point ScViewData::GetScrPos( SCCOL nWhereX, SCROW nWhereY, ScSplitPos eWhich, } sal_uInt16 nTSize; - ScDrawLayer* pModel = GetDocument()->GetDrawLayer(); - bool bIsTiledRendering = pModel && pModel->isTiledRendering(); + bool bIsTiledRendering = comphelper::LibreOfficeKit::isActive(); SCCOL nPosX = GetPosX(eWhichX); SCCOL nX; @@ -1864,8 +1864,7 @@ void ScViewData::GetMouseQuadrant( const Point& rClickPos, ScSplitPos eWhich, void ScViewData::SetPosX( ScHSplitPos eWhich, SCCOL nNewPosX ) { // in the tiled rendering case, nPosX [the leftmost visible column] must be 0 - ScDrawLayer* pModel = GetDocument()->GetDrawLayer(); - bool bIsTiledRendering = pModel && pModel->isTiledRendering(); + bool bIsTiledRendering = comphelper::LibreOfficeKit::isActive(); if (nNewPosX != 0 && !bIsTiledRendering) { SCCOL nOldPosX = pThisTab->nPosX[eWhich]; @@ -1904,8 +1903,7 @@ void ScViewData::SetPosX( ScHSplitPos eWhich, SCCOL nNewPosX ) void ScViewData::SetPosY( ScVSplitPos eWhich, SCROW nNewPosY ) { // in the tiled rendering case, nPosY [the topmost visible row] must be 0 - ScDrawLayer* pModel = GetDocument()->GetDrawLayer(); - bool bIsTiledRendering = pModel && pModel->isTiledRendering(); + bool bIsTiledRendering = comphelper::LibreOfficeKit::isActive(); if (nNewPosY != 0 && !bIsTiledRendering) { SCROW nOldPosY = pThisTab->nPosY[eWhich]; diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx index 5b5637c320ea..0fa78cb12c76 100644 --- a/sc/source/ui/view/viewfun2.cxx +++ b/sc/source/ui/view/viewfun2.cxx @@ -1835,7 +1835,7 @@ bool ScViewFunc::SearchAndReplace( const SvxSearchItem* pSearchItem, AlignToCursor( nCol, nRow, SC_FOLLOW_JUMP ); SetCursor( nCol, nRow, true ); - if (rDoc.GetDrawLayer()->isTiledRendering()) + if (comphelper::LibreOfficeKit::isActive()) { Point aCurPos = GetViewData().GetScrPos(nCol, nRow, GetViewData().GetActivePart()); |