include/vcl/opengl/OpenGLContext.hxx | 4 ---- sc/qa/unit/ucalc_formula.cxx | 14 ++++++++++++++ sc/source/core/tool/token.cxx | 4 ++++ sc/source/ui/dbgui/PivotLayoutDialog.cxx | 3 +++ vcl/inc/openglgdiimpl.hxx | 4 +++- vcl/opengl/gdiimpl.cxx | 22 +++++++--------------- vcl/source/opengl/OpenGLContext.cxx | 12 ------------ 7 files changed, 31 insertions(+), 32 deletions(-)
New commits: commit 96ec51292301a105effacfcceec44f696ee6e0f0 Author: Markus Mohrhard <markus.mohrh...@collabora.co.uk> Date: Mon Dec 1 05:54:07 2014 +0100 add test case for fdo#86518 Change-Id: I297ba5fe7d218ef3bfce6c95c54f446038b7fdca diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx index 90e906b..56f5f8c 100644 --- a/sc/qa/unit/ucalc_formula.cxx +++ b/sc/qa/unit/ucalc_formula.cxx @@ -2582,6 +2582,20 @@ void Test::testFormulaRefUpdateNameDeleteRow() aExpr = pCode->CreateString(aCxt, ScAddress(0,0,0)); CPPUNIT_ASSERT_EQUAL(OUString("$B$2:$B$4"), aExpr); + m_pDoc->InsertTab(1, "test2"); + + ScMarkData aMark2; + aMark2.SelectOneTable(1); + rFunc.DeleteCells(ScRange(0,2,1,MAXCOL,2,1), &aMark2, DEL_CELLSUP, true, true); + + pName = m_pDoc->GetRangeName()->findByUpperName("MYRANGE"); + CPPUNIT_ASSERT(pName); + pCode = pName->GetCode(); + + aExpr = pCode->CreateString(aCxt, ScAddress(0,0,0)); + CPPUNIT_ASSERT_EQUAL(OUString("$B$2:$B$4"), aExpr); + + m_pDoc->DeleteTab(1); m_pDoc->DeleteTab(0); } commit 4e3baa08cbaf1e15ef668d92878d1f6f8eba1303 Author: Markus Mohrhard <markus.mohrh...@collabora.co.uk> Date: Mon Dec 1 04:05:46 2014 +0100 avoid modifying range name references that are not affected, fdo#86518 Change-Id: I0822fb96ebcb30326bcdd88f3900e6e01c85bcf5 diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index b0bfb99..74b30ad 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -3060,6 +3060,10 @@ sc::RefUpdateResult ScTokenArray::AdjustReferenceInName( // column range of the reference is not entirely in the deleted column range. break; + if (aAbs.aStart.Tab() > rCxt.maRange.aEnd.Tab() || aAbs.aEnd.Tab() < rCxt.maRange.aStart.Tab()) + // wrong tables + break; + ScRange aDeleted = rCxt.maRange; aDeleted.aStart.IncRow(rCxt.mnRowDelta); aDeleted.aEnd.SetRow(aDeleted.aStart.Row()-rCxt.mnRowDelta-1); commit f1cdad3253730c593953b91279d17c8a4590fed9 Author: Markus Mohrhard <markus.mohrh...@collabora.co.uk> Date: Mon Dec 1 02:49:59 2014 +0100 For external data sources this variable can be null, fdo#83534 Change-Id: I8c47cf078b4772fcdba0993880740c22114f1b45 diff --git a/sc/source/ui/dbgui/PivotLayoutDialog.cxx b/sc/source/ui/dbgui/PivotLayoutDialog.cxx index 1d572b8..3d3a191 100644 --- a/sc/source/ui/dbgui/PivotLayoutDialog.cxx +++ b/sc/source/ui/dbgui/PivotLayoutDialog.cxx @@ -387,6 +387,9 @@ void ScPivotLayoutDialog::ItemInserted(ScItemValue* pItemValue, ScPivotLayoutTre void ScPivotLayoutDialog::UpdateSourceRange() { + if (!maPivotTableObject.GetSheetDesc()) + return; + ScSheetSourceDesc aSourceSheet = *maPivotTableObject.GetSheetDesc(); if (mpSourceRadioNamedRange->IsChecked()) commit 8eeb02dcc1a4bc99b083b1a591b4a70003a1604f Author: Markus Mohrhard <markus.mohrh...@collabora.co.uk> Date: Sun Nov 30 04:55:46 2014 +0100 use boost::shared_ptr instead of manual ref counting Change-Id: I3c2ed9b5641202ff965c3a0c833c8201b2b1548b diff --git a/include/vcl/opengl/OpenGLContext.hxx b/include/vcl/opengl/OpenGLContext.hxx index ebfa6ff..7931f4b 100644 --- a/include/vcl/opengl/OpenGLContext.hxx +++ b/include/vcl/opengl/OpenGLContext.hxx @@ -175,9 +175,6 @@ public: bool init( HDC hDC, HWND hWnd ); #endif - void AddRef(); - void DeRef(); - void makeCurrent(); void resetCurrent(); void swapBuffers(); @@ -222,7 +219,6 @@ private: SystemChildWindow* m_pChildWindow; boost::scoped_ptr<SystemChildWindow> m_pChildWindowGC; bool mbInitialized; - int mnRefCount; bool mbRequestLegacyContext; bool mbUseDoubleBufferedRendering; bool mbRequestVirtualDevice; diff --git a/vcl/inc/openglgdiimpl.hxx b/vcl/inc/openglgdiimpl.hxx index 83c5bdb..bc813f1 100644 --- a/vcl/inc/openglgdiimpl.hxx +++ b/vcl/inc/openglgdiimpl.hxx @@ -29,6 +29,8 @@ #include <tools/poly.hxx> #include <vcl/opengl/OpenGLContext.hxx> +#include <boost/shared_ptr.hpp> + class SalFrame; class SalVirtualDevice; @@ -36,7 +38,7 @@ class VCL_PLUGIN_PUBLIC OpenGLSalGraphicsImpl : public SalGraphicsImpl { protected: - OpenGLContext* mpContext; + boost::shared_ptr<OpenGLContext> mpContext; // clipping vcl::Region maClipRegion; diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx index cd97cdf..3b6f67b 100644 --- a/vcl/opengl/gdiimpl.cxx +++ b/vcl/opengl/gdiimpl.cxx @@ -109,20 +109,16 @@ OpenGLSalGraphicsImpl::OpenGLSalGraphicsImpl() OpenGLSalGraphicsImpl::~OpenGLSalGraphicsImpl() { - ReleaseContext(); } bool OpenGLSalGraphicsImpl::AcquireContext( bool bOffscreen ) { ImplSVData* pSVData = ImplGetSVData(); - if( mpContext ) - mpContext->DeRef(); - if( bOffscreen ) { - mpContext = CreatePixmapContext(); - return (mpContext != NULL); + mpContext.reset(CreatePixmapContext()); + return (mpContext.get() != NULL); } OpenGLContext* pContext = pSVData->maGDIData.mpLastContext; @@ -134,20 +130,16 @@ bool OpenGLSalGraphicsImpl::AcquireContext( bool bOffscreen ) pContext = pContext->mpPrevContext; } - if( pContext ) - pContext->AddRef(); - else - pContext = CreateWinContext(); + if (!pContext) + pContext =CreateWinContext(); - mpContext = pContext; + mpContext.reset(pContext); return (mpContext != NULL); } bool OpenGLSalGraphicsImpl::ReleaseContext() { - if( mpContext ) - mpContext->DeRef(); - mpContext = NULL; + mpContext.reset(); return true; } @@ -158,7 +150,7 @@ void OpenGLSalGraphicsImpl::Init() // check if we can simply re-use the same context if( mpContext ) { - if( bOffscreen != mbOffscreen || ( !mbOffscreen && CompareWinContext( mpContext ) ) ) + if( bOffscreen != mbOffscreen || ( !mbOffscreen && CompareWinContext( mpContext.get() ) ) ) ReleaseContext(); } diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx index fb0e4ed..4c64f63 100644 --- a/vcl/source/opengl/OpenGLContext.cxx +++ b/vcl/source/opengl/OpenGLContext.cxx @@ -49,7 +49,6 @@ OpenGLContext::OpenGLContext(): mpWindow(NULL), m_pChildWindow(NULL), mbInitialized(false), - mnRefCount(1), mbRequestLegacyContext(false), mbUseDoubleBufferedRendering(true), mbRequestVirtualDevice(false), @@ -115,17 +114,6 @@ OpenGLContext::~OpenGLContext() pSVData->maGDIData.mpLastContext = mpPrevContext; } -void OpenGLContext::AddRef() -{ - mnRefCount++; -} - -void OpenGLContext::DeRef() -{ - if( --mnRefCount == 0 ) - delete this; -} - void OpenGLContext::requestLegacyContext() { mbRequestLegacyContext = true; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits