[Libreoffice-commits] core.git: Branch 'feature/glyphy' - 17 commits - bridges/Library_cpp_uno.mk bridges/source canvas/source compilerplugins/clang config_host.mk.in configure.ac desktop/inc desktop/source download.lst external/glyphy external/Module_external.mk framework/inc libreofficekit/qa Makefile.fetch RepositoryExternal.mk sal/osl sc/inc sc/qa sc/source sd/inc sd/source solenv/gbuild svx/source vcl/Library_vcl.mk vcl/qa vcl/workben

Tor Lillqvist tml at collabora.com
Mon Nov 2 10:45:58 PST 2015


Rebased ref, commits from common ancestor:
commit 7ef61995fc5ee58fd6441cc8c7c9b2469cd394f4
Author: Tor Lillqvist <tml at collabora.com>
Date:   Mon Nov 2 18:14:10 2015 +0200

    Fix some thinkos or copy-paste mistakes for glyphy
    
    Change-Id: Ie008086c2a34081c9f50a61808b73b66eda58e2c

diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk
index e4e8b03..9cadb13 100644
--- a/RepositoryExternal.mk
+++ b/RepositoryExternal.mk
@@ -288,14 +288,14 @@ endef
 
 endif # SYSTEM_GLEW
 
-$(eval $(call gb_Helper_register_packages_for_install,ooo,\
-	liborcus \
-))
-
-ifneq ($(SYSTEM_GLEW),)
+ifneq ($(SYSTEM_GLYPHY),)
 
 else # !SYSTEM_GLYPHY
 
+$(eval $(call gb_Helper_register_packages_for_install,ooo,\
+	glyphy \
+))
+
 define gb_LinkTarget__use_glyphy
 $(call gb_LinkTarget_use_package,$(1),glyphy)
 
@@ -310,7 +310,7 @@ $(call gb_LinkTarget_add_libs,$(1),\
 
 endef
 
-endif GLYPHY
+endif # SYSTEM_GLYPHY
 
 define gb_LinkTarget__use_iconv
 $(call gb_LinkTarget_add_libs,$(1),-liconv)
diff --git a/config_host.mk.in b/config_host.mk.in
index 5b2e648..4c697d1 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -526,6 +526,7 @@ export SYSTEM_GENCCODE=@SYSTEM_GENCCODE@
 export SYSTEM_GENCMN=@SYSTEM_GENCMN@
 export SYSTEM_GLEW=@SYSTEM_GLEW@
 export SYSTEM_GLM=@SYSTEM_GLM@
+export SYSTEM_GLYPHY=@SYSTEM_GLYPHY@
 export SYSTEM_GRAPHITE=@SYSTEM_GRAPHITE@
 export SYSTEM_HARFBUZZ=@SYSTEM_HARFBUZZ@
 export SYSTEM_HSQLDB=@SYSTEM_HSQLDB@
diff --git a/external/Module_external.mk b/external/Module_external.mk
index 9daf548..7c78c7d 100644
--- a/external/Module_external.mk
+++ b/external/Module_external.mk
@@ -45,6 +45,7 @@ $(eval $(call gb_Module_add_moduledirs,external,\
 	$(call gb_Helper_optional,FREETYPE,freetype) \
 	$(call gb_Helper_optional,GLEW,glew) \
 	$(call gb_Helper_optional,GLM,glm) \
+	$(call gb_Helper_optional,GLYPHY,glyphy) \
 	$(call gb_Helper_optional,GRAPHITE,graphite) \
 	$(call gb_Helper_optional,HARFBUZZ,harfbuzz) \
 	$(call gb_Helper_optional,HSQLDB,hsqldb) \
diff --git a/external/glyphy/Module_glyphy.mk b/external/glyphy/Module_glyphy.mk
index 084c542..6228bba 100644
--- a/external/glyphy/Module_glyphy.mk
+++ b/external/glyphy/Module_glyphy.mk
@@ -9,7 +9,7 @@
 
 $(eval $(call gb_Module_Module,glyphy))
 
-$(eval $(call gb_Module_add_targets,liborcus,\
+$(eval $(call gb_Module_add_targets,glyphy,\
 	UnpackedTarball_glyphy \
 ))
 
commit 7aff0fc7577f45a258ae9b0bbc701d8674282693
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Wed Oct 14 15:06:55 2015 +0200

    link vcl against libglyphy
    
    Change-Id: I5b206f5d857d28acda82ce8ac53f835142f46da2

diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk
index 27e008b..e4e8b03 100644
--- a/RepositoryExternal.mk
+++ b/RepositoryExternal.mk
@@ -288,6 +288,30 @@ endef
 
 endif # SYSTEM_GLEW
 
+$(eval $(call gb_Helper_register_packages_for_install,ooo,\
+	liborcus \
+))
+
+ifneq ($(SYSTEM_GLEW),)
+
+else # !SYSTEM_GLYPHY
+
+define gb_LinkTarget__use_glyphy
+$(call gb_LinkTarget_use_package,$(1),glyphy)
+
+$(call gb_LinkTarget_set_include,$(1),\
+	-I$(call gb_UnpackedTarball_get_dir,glyphy/include) \
+	$$(INCLUDE) \
+)
+
+$(call gb_LinkTarget_add_libs,$(1),\
+	-L$(call gb_UnpackedTarball_get_dir,glyphy)/src/.libs -lglyphy \
+)
+
+endef
+
+endif GLYPHY
+
 define gb_LinkTarget__use_iconv
 $(call gb_LinkTarget_add_libs,$(1),-liconv)
 
diff --git a/external/glyphy/ExternalPackage_glyphy.mk b/external/glyphy/ExternalPackage_glyphy.mk
index 484590d..cbae840 100644
--- a/external/glyphy/ExternalPackage_glyphy.mk
+++ b/external/glyphy/ExternalPackage_glyphy.mk
@@ -11,4 +11,10 @@ $(eval $(call gb_ExternalPackage_ExternalPackage,glyphy,glyphy))
 
 $(eval $(call gb_ExternalPackage_use_external_project,glyphy,glyphy))
 
+ifeq ($(OS),MACOSX)
+$(eval $(call gb_ExternalPackage_add_file,glyphy,$(LIBO_LIB_FOLDER)/libglyphy.dylib,src/.libs/libglyphy.dylib))
+else ifeq ($(DISABLE_DYNLOADING),)
+$(eval $(call gb_ExternalPackage_add_file,glyphy,$(LIBO_LIB_FOLDER)/libglyphy.so.0,src/.libs/libglyphy.so.0.0.0))
+endif
+
 # vim: set noet sw=4 ts=4:
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 575a64f..c601f73 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -737,6 +737,10 @@ $(eval $(call gb_Library_add_libs,vcl,\
 	-lXext \
 ))
 
+$(eval $(call gb_Library_use_externals,vcl,\
+	glyphy \
+))
+
 $(eval $(call gb_Library_add_exception_objects,vcl,\
 	vcl/opengl/x11/X11DeviceInfo \
 ))
commit d6f8334e820240962b4c69770fb20d0a776f11b4
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Tue Oct 13 00:11:13 2015 +0200

    integrate glyphy into the build
    
    The used glyphy is not directly the upstream version. We currently use a
    patched version that allows to disable the build for the demos.
    
    Change-Id: Ic03355e1ea8fbc56e57afa4f90a55741fe9a563a

diff --git a/Makefile.fetch b/Makefile.fetch
index 10317b3..8b2da4e 100644
--- a/Makefile.fetch
+++ b/Makefile.fetch
@@ -130,6 +130,7 @@ $(WORKDIR)/download: $(BUILDDIR)/config_host.mk $(SRCDIR)/download.lst $(SRCDIR)
 		$(call fetch_Optional,FREETYPE,FREETYPE_TARBALL) \
 		$(call fetch_Optional,GLEW,GLEW_TARBALL) \
 		$(call fetch_Optional,GLM,GLM_TARBALL) \
+		$(call fetch_Optional,GLYPHY,GLYPHY_TARBALL) \
 		$(call fetch_Optional_pack,GOOGLE_DOCS_EXTENSION_PACK) \
 		$(call fetch_Optional,GRAPHITE,GRAPHITE_TARBALL) \
 		$(call fetch_Optional,HARFBUZZ,HARFBUZZ_TARBALL) \
diff --git a/configure.ac b/configure.ac
index 4a2811d..cdfd41e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -8753,6 +8753,11 @@ AS_IF([test "$with_system_glew" = "yes"],
     [AC_DEFINE([HAVE_GLEW_1_12])])
 
 dnl ===================================================================
+dnl Check for system glyphy
+dnl ===================================================================
+libo_CHECK_SYSTEM_MODULE([glyphy], [GLYPHY], [glyphy >= 0.12.0], ["-I${WORKDIR}/UnpackedTarball/glyphy/include"])
+
+dnl ===================================================================
 dnl Check for system vigra
 dnl ===================================================================
 AC_MSG_CHECKING([which vigra to use])
diff --git a/download.lst b/download.lst
index 25542de..5f8a51f 100755
--- a/download.lst
+++ b/download.lst
@@ -52,6 +52,7 @@ export FREEHAND_TARBALL := libfreehand-0.1.1.tar.bz2
 export FREETYPE_TARBALL := dbf2caca1d3afd410a29217a9809d397-freetype-2.4.8.tar.bz2
 export GLEW_TARBALL := 3941e9cab2f4f9d8faee3e8d57ae7664-glew-1.12.0.zip
 export GLM_TARBALL := bae83fa5dc7f081768daace6e199adc3-glm-0.9.4.6-libreoffice.zip
+export GLYPHY_TARBALL := 5d303fb955beb9bf112267316ca9d021-glyphy-0.2.0.tar.bz2
 export GRAPHITE_TARBALL := 5c0c9ac0996fbb4a0e17780ff5441959-graphite2-minimal-1.3.4.tgz
 export HARFBUZZ_MD5SUM := 0e27e531f4c4acff601ebff0957755c2
 export HARFBUZZ_TARBALL := harfbuzz-0.9.40.tar.bz2
diff --git a/external/glyphy/ExternalPackage_glyphy.mk b/external/glyphy/ExternalPackage_glyphy.mk
new file mode 100644
index 0000000..484590d
--- /dev/null
+++ b/external/glyphy/ExternalPackage_glyphy.mk
@@ -0,0 +1,14 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,glyphy,glyphy))
+
+$(eval $(call gb_ExternalPackage_use_external_project,glyphy,glyphy))
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/glyphy/ExternalProject_glyphy.mk b/external/glyphy/ExternalProject_glyphy.mk
new file mode 100644
index 0000000..1eda015
--- /dev/null
+++ b/external/glyphy/ExternalProject_glyphy.mk
@@ -0,0 +1,38 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,glyphy))
+
+$(eval $(call gb_ExternalProject_use_autoconf,glyphy,build))
+
+$(eval $(call gb_ExternalProject_register_targets,glyphy,\
+	build \
+))
+
+$(eval $(call gb_ExternalProject_use_externals,glyphy, \
+    glew \
+))
+
+$(call gb_ExternalProject_get_state_target,glyphy,build) :
+	$(call gb_ExternalProject_run,build,\
+		MAKE=$(MAKE) ./configure \
+			--with-pic \
+			$(if $(DISABLE_DYNLOADING), \
+				--enable-static --disable-shared \
+			, \
+				--enable-shared --disable-static \
+			) \
+			$(if $(ENABLE_DEBUG),--enable-debug,--disable-debug) \
+			$(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \
+			$(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
+		&& $(if $(verbose),V=1) \
+		   $(MAKE) \
+	)
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/glyphy/Makefile b/external/glyphy/Makefile
new file mode 100644
index 0000000..e4968cf
--- /dev/null
+++ b/external/glyphy/Makefile
@@ -0,0 +1,7 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/glyphy/Module_glyphy.mk b/external/glyphy/Module_glyphy.mk
new file mode 100644
index 0000000..084c542
--- /dev/null
+++ b/external/glyphy/Module_glyphy.mk
@@ -0,0 +1,21 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,glyphy))
+
+$(eval $(call gb_Module_add_targets,liborcus,\
+	UnpackedTarball_glyphy \
+))
+
+$(eval $(call gb_Module_add_targets,glyphy,\
+	ExternalPackage_glyphy \
+	ExternalProject_glyphy \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/glyphy/UnpackedTarball_glyphy.mk b/external/glyphy/UnpackedTarball_glyphy.mk
new file mode 100644
index 0000000..8e2244b
--- /dev/null
+++ b/external/glyphy/UnpackedTarball_glyphy.mk
@@ -0,0 +1,16 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,glyphy))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,glyphy,$(GLYPHY_TARBALL)))
+
+$(eval $(call gb_UnpackedTarball_set_patchlevel,glyphy,1))
+
+# vim: set noet sw=4 ts=4:
commit ae78051c22d5a9bc7b5728482d59720fed7e6146
Author: Mario J. Rugiero <mrugiero at gmail.com>
Date:   Sat Oct 31 14:40:27 2015 -0300

    Replaced boost::bind by std::bind in canvas/source/opengl/ogl_canvashelper.cxx
    
    Chose not to use lambdas instead because the number of arguments in these calls
    would have made it way too verbose, hurting readability.
    
    Change-Id: I8662a937ec10ca0fac6cd7e0d78b6268e8023ada
    Reviewed-on: https://gerrit.libreoffice.org/19707
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: David Tardon <dtardon at redhat.com>

diff --git a/canvas/source/opengl/ogl_canvashelper.cxx b/canvas/source/opengl/ogl_canvashelper.cxx
index 61a6773..919015f 100644
--- a/canvas/source/opengl/ogl_canvashelper.cxx
+++ b/canvas/source/opengl/ogl_canvashelper.cxx
@@ -10,7 +10,7 @@
 #include <sal/config.h>
 
 #include <memory>
-#include <boost/bind.hpp>
+#include <functional>
 #include <GL/glew.h>
 
 #include <basegfx/polygon/b2dpolygontriangulator.hxx>
@@ -37,9 +37,8 @@
 
 #include "ogl_canvashelper.hxx"
 
-#include <functional>
-
 using namespace ::com::sun::star;
+using namespace ::std::placeholders;
 
 namespace oglcanvas
 {
@@ -410,7 +409,7 @@ namespace oglcanvas
             Action& rAct=mpRecordedActions->back();
 
             setupGraphicsState( rAct, viewState, renderState );
-            rAct.maFunction = ::boost::bind(&lcl_drawPoint,
+            rAct.maFunction = ::std::bind(&lcl_drawPoint,
                                             _1,_2,_3,_4,_5,
                                             aPoint);
         }
@@ -428,9 +427,9 @@ namespace oglcanvas
             Action& rAct=mpRecordedActions->back();
 
             setupGraphicsState( rAct, viewState, renderState );
-            rAct.maFunction = ::boost::bind(&lcl_drawLine,
-                                            _1,_2,_3,_4,_5,
-                                            aStartPoint,aEndPoint);
+            rAct.maFunction = ::std::bind(&lcl_drawLine,
+                                          _1, _2, _3, _4, _5,
+                                          aStartPoint, aEndPoint);
         }
     }
 
@@ -448,7 +447,7 @@ namespace oglcanvas
             setupGraphicsState( rAct, viewState, renderState );
 
             // TODO(F2): subdivide&render whole curve
-            rAct.maFunction = ::boost::bind(&lcl_drawLine,
+            rAct.maFunction = ::std::bind(&lcl_drawLine,
                                             _1,_2,_3,_4,_5,
                                             geometry::RealPoint2D(
                                                 aBezierSegment.Px,
@@ -601,7 +600,7 @@ namespace oglcanvas
                     const ::canvas::ParametricPolyPolygon::Values& rValues(
                         pGradient->getValues() );
 
-                    rAct.maFunction = ::boost::bind(&lcl_fillGradientPolyPolygon,
+                    rAct.maFunction = ::std::bind(&lcl_fillGradientPolyPolygon,
                                                     _1,_2,_3,_4,
                                                     rValues,
                                                     textures[0],
@@ -644,7 +643,7 @@ namespace oglcanvas
                                 aPixelData,
                                 canvas::tools::getStdColorSpace()));
 
-                        rAct.maFunction = ::boost::bind(&lcl_fillTexturedPolyPolygon,
+                        rAct.maFunction = ::std::bind(&lcl_fillTexturedPolyPolygon,
                                                         _1,_2,_3,_4,
                                                         textures[0],
                                                         aSize,
@@ -822,7 +821,7 @@ namespace oglcanvas
                 Action& rAct=mpRecordedActions->back();
 
                 setupGraphicsState( rAct, viewState, renderState );
-                rAct.maFunction = ::boost::bind(&lcl_drawOwnBitmap,
+                rAct.maFunction = ::std::bind(&lcl_drawOwnBitmap,
                                                 _1,_2,_3,_4,_5,
                                                 *pOwnBitmap);
             }
@@ -851,7 +850,7 @@ namespace oglcanvas
                     Action& rAct=mpRecordedActions->back();
 
                     setupGraphicsState( rAct, viewState, renderState );
-                    rAct.maFunction = ::boost::bind(&lcl_drawGenericBitmap,
+                    rAct.maFunction = ::std::bind(&lcl_drawGenericBitmap,
                                                     _1,_2,_3,_4,_5,
                                                     aSize, aARGBBytes,
                                                     rtl_crc32(0,
commit 92a5be6b5364ad7a68d1d52796b3ca81d09cd306
Author: Eike Rathke <erack at redhat.com>
Date:   Mon Nov 2 18:46:45 2015 +0100

    implement ScRefCellValue::operator=() without temporary and swap
    
    ... just ... why ... was ... that ... ? ...
    
    Change-Id: I1bc1ea12600859872c6d238b1ef6fc55f6ff2e04

diff --git a/sc/source/core/data/cellvalue.cxx b/sc/source/core/data/cellvalue.cxx
index a1fcfbb..c63f493 100644
--- a/sc/source/core/data/cellvalue.cxx
+++ b/sc/source/core/data/cellvalue.cxx
@@ -594,8 +594,8 @@ bool ScRefCellValue::equalsWithoutFormat( const ScRefCellValue& r ) const
 
 ScRefCellValue& ScRefCellValue::operator= ( const ScRefCellValue& r )
 {
-    ScRefCellValue aTmp(r);
-    swap(aTmp);
+    meType = r.meType;
+    mfValue = r.mfValue;    // largest member of union
     return *this;
 }
 
commit 708bcf9055b04a82943e597747c0d74894714a9e
Author: Eike Rathke <erack at redhat.com>
Date:   Mon Nov 2 18:03:30 2015 +0100

    trash usage of ScRefCellValue default ctor followed by assign()
    
    ... that only results in a performance penalty.
    
    Change-Id: Ia161ab7fb03f2d32cf966ce9da9d0319d919fc4c

diff --git a/sc/inc/cellvalue.hxx b/sc/inc/cellvalue.hxx
index 6d16928..915bdee 100644
--- a/sc/inc/cellvalue.hxx
+++ b/sc/inc/cellvalue.hxx
@@ -111,12 +111,22 @@ struct SC_DLLPUBLIC ScRefCellValue
     ScRefCellValue( const EditTextObject* pEditText );
     ScRefCellValue( ScFormulaCell* pFormula );
     ScRefCellValue( const ScRefCellValue& r );
+
+    /**
+     * Take cell value from specified position in specified document.
+     */
+    ScRefCellValue( ScDocument& rDoc, const ScAddress& rPos );
+
     ~ScRefCellValue();
 
     void clear();
 
     /**
      * Take cell value from specified position in specified document.
+     *
+     * Avoid the sequence of ScRefCellValue() default ctor followed by assign()
+     * as it results in performance penalty, use the
+     * ScRefCellValue(ScDocument&,const ScAddress&) ctor instead.
      */
     void assign( ScDocument& rDoc, const ScAddress& rPos );
 
diff --git a/sc/qa/unit/helper/csv_handler.hxx b/sc/qa/unit/helper/csv_handler.hxx
index 915ffc6..59f2137 100644
--- a/sc/qa/unit/helper/csv_handler.hxx
+++ b/sc/qa/unit/helper/csv_handler.hxx
@@ -32,8 +32,7 @@ OUString getConditionalFormatString(ScDocument* pDoc, SCCOL nCol, SCROW nRow, SC
 {
     OUString aString;
     Color* pColor;
-    ScRefCellValue aCell;
-    aCell.assign(*pDoc, ScAddress(nCol, nRow, nTab));
+    ScRefCellValue aCell(*pDoc, ScAddress(nCol, nRow, nTab));
     if (aCell.isEmpty())
         return aString;
 
diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx
index f27f34c..0701254 100644
--- a/sc/source/core/data/attarray.cxx
+++ b/sc/source/core/data/attarray.cxx
@@ -343,8 +343,7 @@ void ScAttrArray::RemoveCellCharAttribs( SCROW nStartRow, SCROW nEndRow,
     for (SCROW nRow = nStartRow; nRow <= nEndRow; ++nRow)
     {
         ScAddress aPos(nCol, nRow, nTab);
-        ScRefCellValue aCell;
-        aCell.assign(*pDocument, aPos);
+        ScRefCellValue aCell(*pDocument, aPos);
         if (aCell.meType != CELLTYPE_EDIT || !aCell.mpEditText)
             continue;
 
diff --git a/sc/source/core/data/cellvalue.cxx b/sc/source/core/data/cellvalue.cxx
index c44701d..a1fcfbb 100644
--- a/sc/source/core/data/cellvalue.cxx
+++ b/sc/source/core/data/cellvalue.cxx
@@ -285,8 +285,7 @@ void ScCellValue::assign( const ScDocument& rDoc, const ScAddress& rPos )
 {
     clear();
 
-    ScRefCellValue aRefVal;
-    aRefVal.assign(const_cast<ScDocument&>(rDoc), rPos);
+    ScRefCellValue aRefVal(const_cast<ScDocument&>(rDoc), rPos);
 
     meType = aRefVal.meType;
     switch (meType)
@@ -494,6 +493,13 @@ ScRefCellValue::ScRefCellValue( ScFormulaCell* pFormula ) : meType(CELLTYPE_FORM
 // as the pointer values.
 ScRefCellValue::ScRefCellValue( const ScRefCellValue& r ) : meType(r.meType), mfValue(r.mfValue) {}
 
+ScRefCellValue::ScRefCellValue( ScDocument& rDoc, const ScAddress& rPos )
+{
+    const ScRefCellValue& rCell = rDoc.GetRefCellValue(rPos);
+    meType = rCell.meType;
+    mfValue = rCell.mfValue;
+}
+
 ScRefCellValue::~ScRefCellValue()
 {
     clear();
diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx
index be54ecd..d8ecee6 100644
--- a/sc/source/core/data/conditio.cxx
+++ b/sc/source/core/data/conditio.cxx
@@ -788,8 +788,7 @@ void ScConditionEntry::FillCache() const
             for( SCROW r = nRowStart; r <= nRow; r++ )
                 for( SCCOL c = nColStart; c <= nCol; c++ )
                 {
-                    ScRefCellValue aCell;
-                    aCell.assign(*mpDoc, ScAddress(c, r, nTab));
+                    ScRefCellValue aCell(*mpDoc, ScAddress(c, r, nTab));
                     if (aCell.isEmpty())
                         continue;
 
diff --git a/sc/source/core/data/dociter.cxx b/sc/source/core/data/dociter.cxx
index 39ae93b..986b17e 100644
--- a/sc/source/core/data/dociter.cxx
+++ b/sc/source/core/data/dociter.cxx
@@ -1036,8 +1036,7 @@ bool ScCellIterator::isEmpty() const
 
 bool ScCellIterator::equalsWithoutFormat( const ScAddress& rPos ) const
 {
-    ScRefCellValue aOther;
-    aOther.assign(*mpDoc, rPos);
+    ScRefCellValue aOther(*mpDoc, rPos);
     return maCurCell.equalsWithoutFormat(aOther);
 }
 
diff --git a/sc/source/core/data/documen4.cxx b/sc/source/core/data/documen4.cxx
index 48319ba..12ed061 100644
--- a/sc/source/core/data/documen4.cxx
+++ b/sc/source/core/data/documen4.cxx
@@ -756,8 +756,7 @@ const SfxPoolItem* ScDocument::GetEffItem(
                     if ( pForm )
                     {
                         ScAddress aPos(nCol, nRow, nTab);
-                        ScRefCellValue aCell;
-                        aCell.assign(const_cast<ScDocument&>(*this), aPos);
+                        ScRefCellValue aCell(const_cast<ScDocument&>(*this), aPos);
                         OUString aStyle = pForm->GetCellStyle(aCell, aPos);
                         if (!aStyle.isEmpty())
                         {
@@ -784,8 +783,7 @@ const SfxItemSet* ScDocument::GetCondResult( SCCOL nCol, SCROW nRow, SCTAB nTab
         return NULL;
 
     ScAddress aPos(nCol, nRow, nTab);
-    ScRefCellValue aCell;
-    aCell.assign(const_cast<ScDocument&>(*this), aPos);
+    ScRefCellValue aCell(const_cast<ScDocument&>(*this), aPos);
     const ScPatternAttr* pPattern = GetPattern( nCol, nRow, nTab );
     const std::vector<sal_uInt32>& rIndex =
         static_cast<const ScCondFormatItem&>(pPattern->GetItem(ATTR_CONDITIONAL)).GetCondFormatData();
@@ -920,9 +918,8 @@ sal_uInt16 ScDocument::RowDifferences( SCROW nThisRow, SCTAB nThisTab,
 
         if (ValidCol(nOtherCol))    // only compare columns that are common to both docs
         {
-            ScRefCellValue aThisCell, aOtherCell;
-            aThisCell.assign(*this, ScAddress(nThisCol, nThisRow, nThisTab));
-            aOtherCell.assign(rOtherDoc, ScAddress(nOtherCol, nOtherRow, nOtherTab));
+            ScRefCellValue aThisCell(*this, ScAddress(nThisCol, nThisRow, nThisTab));
+            ScRefCellValue aOtherCell(rOtherDoc, ScAddress(nOtherCol, nOtherRow, nOtherTab));
             if (!aThisCell.equalsWithoutFormat(aOtherCell))
             {
                 if (!aThisCell.isEmpty() && !aOtherCell.isEmpty())
@@ -962,9 +959,8 @@ sal_uInt16 ScDocument::ColDifferences( SCCOL nThisCol, SCTAB nThisTab,
 
         if (ValidRow(nOtherRow))    // only compare rows that are common to both docs
         {
-            ScRefCellValue aThisCell, aOtherCell;
-            aThisCell.assign(*this, ScAddress(nThisCol, nThisRow, nThisTab));
-            aOtherCell.assign(rOtherDoc, ScAddress(nOtherCol, nOtherRow, nOtherTab));
+            ScRefCellValue aThisCell(*this, ScAddress(nThisCol, nThisRow, nThisTab));
+            ScRefCellValue aOtherCell(rOtherDoc, ScAddress(nOtherCol, nOtherRow, nOtherTab));
             if (!aThisCell.equalsWithoutFormat(aOtherCell))
             {
                 if (!aThisCell.isEmpty() && !aOtherCell.isEmpty())
diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index a6aca8f..3666fc4 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -1219,8 +1219,7 @@ void ScDocument::TransliterateText( const ScMarkData& rMultiMark, sal_Int32 nTyp
 
             while (bFound)
             {
-                ScRefCellValue aCell;
-                aCell.assign(*this, ScAddress(nCol, nRow, nTab));
+                ScRefCellValue aCell(*this, ScAddress(nCol, nRow, nTab));
 
                 // fdo#32786 TITLE_CASE/SENTENCE_CASE need the extra handling in EditEngine (loop over words/sentences).
                 // Still use TransliterationWrapper directly for text cells with other transliteration types,
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 9786c2a..9bfee0b 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -3425,8 +3425,7 @@ sal_uInt16 ScDocument::GetStringForFormula( const ScAddress& rPos, OUString& rSt
     // ScInterpreter::GetCellString: always format values as numbers.
     // The return value is the error code.
 
-    ScRefCellValue aCell;
-    aCell.assign(*this, rPos);
+    ScRefCellValue aCell(*this, rPos);
     if (aCell.isEmpty())
     {
         rString = EMPTY_OUSTRING;
diff --git a/sc/source/core/tool/cellform.cxx b/sc/source/core/tool/cellform.cxx
index 3321686..cb82e7f 100644
--- a/sc/source/core/tool/cellform.cxx
+++ b/sc/source/core/tool/cellform.cxx
@@ -140,15 +140,13 @@ OUString ScCellFormat::GetString(
     {
         case CELLTYPE_STRING:
         {
-            ScRefCellValue aCell;
-            aCell.assign(rDoc, rPos);
+            ScRefCellValue aCell(rDoc, rPos);
             rFormatter.GetOutputString(aCell.mpString->getString(), nFormat, aString, ppColor, bUseStarFormat);
         }
         break;
         case CELLTYPE_EDIT:
         {
-            ScRefCellValue aCell;
-            aCell.assign(rDoc, rPos);
+            ScRefCellValue aCell(rDoc, rPos);
             rFormatter.GetOutputString(aCell.getString(&rDoc), nFormat, aString, ppColor);
         }
         break;
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index f7f796a..2cb0b89 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -4909,8 +4909,7 @@ bool ScCompiler::HandleColRowName()
     }
     if ( !bInList && pDoc->GetDocOptions().IsLookUpColRowNames() )
     {   // automagically or created by copying and NamePos isn't in list
-        ScRefCellValue aCell;
-        aCell.assign(*pDoc, aLook);
+        ScRefCellValue aCell(*pDoc, aLook);
         bool bString = aCell.hasString();
         if (!bString && aCell.isEmpty())
             bString = true;     // empty cell is ok
diff --git a/sc/source/core/tool/detfunc.cxx b/sc/source/core/tool/detfunc.cxx
index 1b31801..710161a 100644
--- a/sc/source/core/tool/detfunc.cxx
+++ b/sc/source/core/tool/detfunc.cxx
@@ -801,8 +801,7 @@ sal_uInt16 ScDetectiveFunc::InsertPredLevelArea( const ScRange& rRef,
 sal_uInt16 ScDetectiveFunc::InsertPredLevel( SCCOL nCol, SCROW nRow, ScDetectiveData& rData,
                                             sal_uInt16 nLevel )
 {
-    ScRefCellValue aCell;
-    aCell.assign(*pDoc, ScAddress(nCol, nRow, nTab));
+    ScRefCellValue aCell(*pDoc, ScAddress(nCol, nRow, nTab));
     if (aCell.meType != CELLTYPE_FORMULA)
         return DET_INS_EMPTY;
 
@@ -890,8 +889,7 @@ sal_uInt16 ScDetectiveFunc::FindPredLevel( SCCOL nCol, SCROW nRow, sal_uInt16 nL
 {
     OSL_ENSURE( nLevel<1000, "Level" );
 
-    ScRefCellValue aCell;
-    aCell.assign(*pDoc, ScAddress(nCol, nRow, nTab));
+    ScRefCellValue aCell(*pDoc, ScAddress(nCol, nRow, nTab));
     if (aCell.meType != CELLTYPE_FORMULA)
         return nLevel;
 
@@ -948,8 +946,7 @@ sal_uInt16 ScDetectiveFunc::FindPredLevel( SCCOL nCol, SCROW nRow, sal_uInt16 nL
 sal_uInt16 ScDetectiveFunc::InsertErrorLevel( SCCOL nCol, SCROW nRow, ScDetectiveData& rData,
                                             sal_uInt16 nLevel )
 {
-    ScRefCellValue aCell;
-    aCell.assign(*pDoc, ScAddress(nCol, nRow, nTab));
+    ScRefCellValue aCell(*pDoc, ScAddress(nCol, nRow, nTab));
     if (aCell.meType != CELLTYPE_FORMULA)
         return DET_INS_EMPTY;
 
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 577503e..13c47b8 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -279,8 +279,7 @@ void ScInterpreter::ScIfError( bool bNAonly )
                 else
                 {
 
-                    ScRefCellValue aCell;
-                    aCell.assign(*pDok, aAdr);
+                    ScRefCellValue aCell(*pDok, aAdr);
                     nGlobalError = GetCellErrCode(aCell);
                     if (nGlobalError)
                         bError = true;
@@ -593,8 +592,7 @@ bool ScInterpreter::JumpMatrix( short nStackLevel )
                     }
                     else
                     {
-                        ScRefCellValue aCell;
-                        aCell.assign(*pDok, aAdr);
+                        ScRefCellValue aCell(*pDok, aAdr);
                         if (aCell.hasEmptyValue())
                             pJumpMatrix->PutResultEmpty( nC, nR );
                         else if (aCell.hasNumeric())
@@ -661,8 +659,7 @@ bool ScInterpreter::JumpMatrix( short nStackLevel )
                                 nRow = aRange.aStart.Row();
                             aAdr.SetCol( static_cast<SCCOL>(nCol) );
                             aAdr.SetRow( static_cast<SCROW>(nRow) );
-                            ScRefCellValue aCell;
-                            aCell.assign(*pDok, aAdr);
+                            ScRefCellValue aCell(*pDok, aAdr);
                             if (aCell.hasEmptyValue())
                                 pJumpMatrix->PutResultEmpty( nC, nR );
                             else if (aCell.hasNumeric())
@@ -832,8 +829,7 @@ double ScInterpreter::Compare( ScQueryOp eOp )
                 ScAddress aAdr;
                 if ( !PopDoubleRefOrSingleRef( aAdr ) )
                     break;
-                ScRefCellValue aCell;
-                aCell.assign(*pDok, aAdr);
+                ScRefCellValue aCell(*pDok, aAdr);
                 if (aCell.hasEmptyValue())
                     rCell.mbEmpty = true;
                 else if (aCell.hasString())
@@ -922,8 +918,7 @@ sc::RangeMatrix ScInterpreter::CompareMat( ScQueryOp eOp, sc::CompareOptions* pO
             case svSingleRef:
             {
                 PopSingleRef( aAdr );
-                ScRefCellValue aCell;
-                aCell.assign(*pDok, aAdr);
+                ScRefCellValue aCell(*pDok, aAdr);
                 if (aCell.hasEmptyValue())
                     rCell.mbEmpty = true;
                 else if (aCell.hasString())
@@ -1206,8 +1201,7 @@ void ScInterpreter::ScAnd()
                         PopSingleRef( aAdr );
                         if ( !nGlobalError )
                         {
-                            ScRefCellValue aCell;
-                            aCell.assign(*pDok, aAdr);
+                            ScRefCellValue aCell(*pDok, aAdr);
                             if (aCell.hasNumeric())
                             {
                                 bHaveValue = true;
@@ -1305,8 +1299,7 @@ void ScInterpreter::ScOr()
                         PopSingleRef( aAdr );
                         if ( !nGlobalError )
                         {
-                            ScRefCellValue aCell;
-                            aCell.assign(*pDok, aAdr);
+                            ScRefCellValue aCell(*pDok, aAdr);
                             if (aCell.hasNumeric())
                             {
                                 bHaveValue = true;
@@ -1406,8 +1399,7 @@ void ScInterpreter::ScXor()
                         PopSingleRef( aAdr );
                         if ( !nGlobalError )
                         {
-                            ScRefCellValue aCell;
-                            aCell.assign(*pDok, aAdr);
+                            ScRefCellValue aCell(*pDok, aAdr);
                             if (aCell.hasNumeric())
                             {
                                 bHaveValue = true;
@@ -1826,8 +1818,7 @@ void ScInterpreter::ScIsEmpty()
             // NOTE: this differs from COUNTBLANK() ScCountEmptyCells() that
             // may treat ="" in the referenced cell as blank for Excel
             // interoperability.
-            ScRefCellValue aCell;
-            aCell.assign(*pDok, aAdr);
+            ScRefCellValue aCell(*pDok, aAdr);
             if (aCell.meType == CELLTYPE_NONE)
                 nRes = 1;
         }
@@ -1876,8 +1867,7 @@ bool ScInterpreter::IsString()
             if ( !PopDoubleRefOrSingleRef( aAdr ) )
                 break;
 
-            ScRefCellValue aCell;
-            aCell.assign(*pDok, aAdr);
+            ScRefCellValue aCell(*pDok, aAdr);
             if (GetCellErrCode(aCell) == 0)
             {
                 switch (aCell.meType)
@@ -1941,8 +1931,7 @@ void ScInterpreter::ScIsLogical()
             if ( !PopDoubleRefOrSingleRef( aAdr ) )
                 break;
 
-            ScRefCellValue aCell;
-            aCell.assign(*pDok, aAdr);
+            ScRefCellValue aCell(*pDok, aAdr);
             if (GetCellErrCode(aCell) == 0)
             {
                 if (aCell.hasNumeric())
@@ -1979,8 +1968,7 @@ void ScInterpreter::ScType()
             if ( !PopDoubleRefOrSingleRef( aAdr ) )
                 break;
 
-            ScRefCellValue aCell;
-            aCell.assign(*pDok, aAdr);
+            ScRefCellValue aCell(*pDok, aAdr);
             if (GetCellErrCode(aCell) == 0)
             {
                 switch (aCell.meType)
@@ -2136,8 +2124,7 @@ void ScInterpreter::ScCell()
             PushIllegalParameter();
         else
         {
-            ScRefCellValue aCell;
-            aCell.assign(*pDok, aCellPos);
+            ScRefCellValue aCell(*pDok, aCellPos);
 
             ScCellKeywordTranslator::transKeyword(aInfoType, ScGlobal::GetLocale(), ocCell);
 
@@ -2489,8 +2476,7 @@ void ScInterpreter::ScIsValue()
             if ( !PopDoubleRefOrSingleRef( aAdr ) )
                 break;
 
-            ScRefCellValue aCell;
-            aCell.assign(*pDok, aAdr);
+            ScRefCellValue aCell(*pDok, aAdr);
             if (GetCellErrCode(aCell) == 0)
             {
                 switch (aCell.meType)
@@ -2592,8 +2578,7 @@ void ScInterpreter::ScFormula()
                     for (SCROW nRow = nRow1; nRow <= nRow2; ++nRow)
                     {
                         aAdr.SetRow(nRow);
-                        ScRefCellValue aCell;
-                        aCell.assign(*pDok, aAdr);
+                        ScRefCellValue aCell(*pDok, aAdr);
                         switch (aCell.meType)
                         {
                             case CELLTYPE_FORMULA :
@@ -2619,8 +2604,7 @@ void ScInterpreter::ScFormula()
             if ( !PopDoubleRefOrSingleRef( aAdr ) )
                 break;
 
-            ScRefCellValue aCell;
-            aCell.assign(*pDok, aAdr);
+            ScRefCellValue aCell(*pDok, aAdr);
             switch (aCell.meType)
             {
                 case CELLTYPE_FORMULA :
@@ -2653,8 +2637,7 @@ void ScInterpreter::ScIsNV()
                 bRes = true;
             else if (bOk)
             {
-                ScRefCellValue aCell;
-                aCell.assign(*pDok, aAdr);
+                ScRefCellValue aCell(*pDok, aAdr);
                 sal_uInt16 nErr = GetCellErrCode(aCell);
                 bRes = (nErr == NOTAVAILABLE);
             }
@@ -2701,8 +2684,7 @@ void ScInterpreter::ScIsErr()
                 bRes = true;
             else
             {
-                ScRefCellValue aCell;
-                aCell.assign(*pDok, aAdr);
+                ScRefCellValue aCell(*pDok, aAdr);
                 sal_uInt16 nErr = GetCellErrCode(aCell);
                 bRes = (nErr && nErr != NOTAVAILABLE);
             }
@@ -2759,8 +2741,7 @@ void ScInterpreter::ScIsError()
                 bRes = true;
             else
             {
-                ScRefCellValue aCell;
-                aCell.assign(*pDok, aAdr);
+                ScRefCellValue aCell(*pDok, aAdr);
                 bRes = (GetCellErrCode(aCell) != 0);
             }
         }
@@ -2805,8 +2786,7 @@ bool ScInterpreter::IsEven()
             if ( !PopDoubleRefOrSingleRef( aAdr ) )
                 break;
 
-            ScRefCellValue aCell;
-            aCell.assign(*pDok, aAdr);
+            ScRefCellValue aCell(*pDok, aAdr);
             sal_uInt16 nErr = GetCellErrCode(aCell);
             if (nErr != 0)
                 SetError(nErr);
@@ -2972,8 +2952,7 @@ void ScInterpreter::ScT()
                 return ;
             }
             bool bValue = false;
-            ScRefCellValue aCell;
-            aCell.assign(*pDok, aAdr);
+            ScRefCellValue aCell(*pDok, aAdr);
             if (GetCellErrCode(aCell) == 0)
             {
                 switch (aCell.meType)
@@ -3050,8 +3029,7 @@ void ScInterpreter::ScValue()
                 PushInt(0);
                 return;
             }
-            ScRefCellValue aCell;
-            aCell.assign(*pDok, aAdr);
+            ScRefCellValue aCell(*pDok, aAdr);
             if (aCell.hasString())
             {
                 svl::SharedString aSS;
@@ -3373,8 +3351,7 @@ void ScInterpreter::ScMin( bool bTextAsZero )
             case svSingleRef :
             {
                 PopSingleRef( aAdr );
-                ScRefCellValue aCell;
-                aCell.assign(*pDok, aAdr);
+                ScRefCellValue aCell(*pDok, aAdr);
                 if (aCell.hasNumeric())
                 {
                     nVal = GetCellValue(aAdr, aCell);
@@ -3469,8 +3446,7 @@ void ScInterpreter::ScMax( bool bTextAsZero )
             case svSingleRef :
             {
                 PopSingleRef( aAdr );
-                ScRefCellValue aCell;
-                aCell.assign(*pDok, aAdr);
+                ScRefCellValue aCell(*pDok, aAdr);
                 if (aCell.hasNumeric())
                 {
                     nVal = GetCellValue(aAdr, aCell);
@@ -3570,8 +3546,7 @@ void ScInterpreter::GetStVarParams( double& rVal, double& rValCount,
             case svSingleRef :
             {
                 PopSingleRef( aAdr );
-                ScRefCellValue aCell;
-                aCell.assign(*pDok, aAdr);
+                ScRefCellValue aCell(*pDok, aAdr);
                 if (aCell.hasNumeric())
                 {
                     fVal = GetCellValue(aAdr, aCell);
@@ -4341,8 +4316,7 @@ void ScInterpreter::ScMatch()
                         PushInt(0);
                         return ;
                     }
-                    ScRefCellValue aCell;
-                    aCell.assign(*pDok, aAdr);
+                    ScRefCellValue aCell(*pDok, aAdr);
                     if (aCell.hasNumeric())
                     {
                         fVal = GetCellValue(aAdr, aCell);
@@ -4601,8 +4575,7 @@ void ScInterpreter::ScCountEmptyCells()
                 nMaxCount = 1;
                 ScAddress aAdr;
                 PopSingleRef( aAdr );
-                ScRefCellValue aCell;
-                aCell.assign(*pDok, aAdr);
+                ScRefCellValue aCell(*pDok, aAdr);
                 if (!isCellContentEmpty(aCell))
                     nCount = 1;
             }
@@ -4714,8 +4687,7 @@ double ScInterpreter::IterateParametersIf( ScIterFuncIf eFunc )
                 if ( !PopDoubleRefOrSingleRef( aAdr ) )
                     return 0;
 
-                ScRefCellValue aCell;
-                aCell.assign(*pDok, aAdr);
+                ScRefCellValue aCell(*pDok, aAdr);
                 switch (aCell.meType)
                 {
                     case CELLTYPE_VALUE :
@@ -4961,8 +4933,7 @@ double ScInterpreter::IterateParametersIf( ScIterFuncIf eFunc )
                             {
                                 aAdr.SetCol( nCol + nColDiff);
                                 aAdr.SetRow( nRow + nRowDiff);
-                                ScRefCellValue aCell;
-                                aCell.assign(*pDok, aAdr);
+                                ScRefCellValue aCell(*pDok, aAdr);
                                 if (aCell.hasNumeric())
                                 {
                                     fVal = GetCellValue(aAdr, aCell);
@@ -5013,8 +4984,7 @@ double ScInterpreter::IterateParametersIf( ScIterFuncIf eFunc )
                         {
                             aAdr.SetCol( aCellIter.GetCol() + nColDiff);
                             aAdr.SetRow( aCellIter.GetRow() + nRowDiff);
-                            ScRefCellValue aCell;
-                            aCell.assign(*pDok, aAdr);
+                            ScRefCellValue aCell(*pDok, aAdr);
                             if (aCell.hasNumeric())
                             {
                                 fVal = GetCellValue(aAdr, aCell);
@@ -5075,8 +5045,7 @@ void ScInterpreter::ScCountIf()
                     PushInt(0);
                     return ;
                 }
-                ScRefCellValue aCell;
-                aCell.assign(*pDok, aAdr);
+                ScRefCellValue aCell(*pDok, aAdr);
                 switch (aCell.meType)
                 {
                     case CELLTYPE_VALUE :
@@ -5293,8 +5262,7 @@ double ScInterpreter::IterateParametersIfs( ScIterFuncIfs eFunc )
                         if ( !PopDoubleRefOrSingleRef( aAdr ) )
                             return 0;
 
-                        ScRefCellValue aCell;
-                        aCell.assign(*pDok, aAdr);
+                        ScRefCellValue aCell(*pDok, aAdr);
                         switch (aCell.meType)
                         {
                             case CELLTYPE_VALUE :
@@ -5625,8 +5593,7 @@ double ScInterpreter::IterateParametersIfs( ScIterFuncIfs eFunc )
                         {
                             aAdr.SetCol( static_cast<SCCOL>(nCol) + nMainCol1);
                             aAdr.SetRow( static_cast<SCROW>(nRow) + nMainRow1);
-                            ScRefCellValue aCell;
-                            aCell.assign(*pDok, aAdr);
+                            ScRefCellValue aCell(*pDok, aAdr);
                             if (aCell.hasNumeric())
                             {
                                 fVal = GetCellValue(aAdr, aCell);
@@ -5808,8 +5775,7 @@ void ScInterpreter::ScLookup()
         case svSingleRef:
         {
             PopSingleRef( aDataAdr );
-            ScRefCellValue aCell;
-            aCell.assign(*pDok, aDataAdr);
+            ScRefCellValue aCell(*pDok, aDataAdr);
             if (aCell.hasEmptyValue())
             {
                 // Empty cells aren't found anywhere, bail out early.
@@ -6518,8 +6484,7 @@ bool ScInterpreter::FillEntry(ScQueryEntry& rEntry)
                 PushInt(0);
                 return false;
             }
-            ScRefCellValue aCell;
-            aCell.assign(*pDok, aAdr);
+            ScRefCellValue aCell(*pDok, aAdr);
             if (aCell.hasNumeric())
             {
                 rItem.meType = ScQueryEntry::ByValue;
@@ -6719,8 +6684,7 @@ std::unique_ptr<ScDBQueryParamBase> ScInterpreter::GetDBParams( bool& rMissingFi
                 {
                     ScAddress aAdr;
                     PopSingleRef( aAdr );
-                    ScRefCellValue aCell;
-                    aCell.assign(*pDok, aAdr);
+                    ScRefCellValue aCell(*pDok, aAdr);
                     if (aCell.hasNumeric())
                         nVal = GetCellValue(aAdr, aCell);
                     else
diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx
index 23c1aa9..4d64021 100644
--- a/sc/source/core/tool/interpr2.cxx
+++ b/sc/source/core/tool/interpr2.cxx
@@ -1163,8 +1163,7 @@ void ScInterpreter::ScNPV()
                     {
                         ScAddress aAdr;
                         PopSingleRef( aAdr );
-                        ScRefCellValue aCell;
-                        aCell.assign(*pDok, aAdr);
+                        ScRefCellValue aCell(*pDok, aAdr);
                         if (!aCell.hasEmptyValue() && aCell.hasNumeric())
                         {
                             double nCellVal = GetCellValue(aAdr, aCell);
@@ -2875,8 +2874,7 @@ void ScInterpreter::ScHyperLink()
                     if ( !PopDoubleRefOrSingleRef( aAdr ) )
                         break;
 
-                    ScRefCellValue aCell;
-                    aCell.assign(*pDok, aAdr);
+                    ScRefCellValue aCell(*pDok, aAdr);
                     if (aCell.hasEmptyValue())
                         nResultType = SC_MATVAL_EMPTY;
                     else
diff --git a/sc/source/core/tool/interpr3.cxx b/sc/source/core/tool/interpr3.cxx
index eb8e0d9..411a752 100644
--- a/sc/source/core/tool/interpr3.cxx
+++ b/sc/source/core/tool/interpr3.cxx
@@ -2518,8 +2518,7 @@ void ScInterpreter::ScZTest()
         {
             ScAddress aAdr;
             PopSingleRef( aAdr );
-            ScRefCellValue aCell;
-            aCell.assign(*pDok, aAdr);
+            ScRefCellValue aCell(*pDok, aAdr);
             if (aCell.hasNumeric())
             {
                 fVal = GetCellValue(aAdr, aCell);
@@ -2933,8 +2932,7 @@ void ScInterpreter::ScHarMean()
             case svSingleRef :
             {
                 PopSingleRef( aAdr );
-                ScRefCellValue aCell;
-                aCell.assign(*pDok, aAdr);
+                ScRefCellValue aCell(*pDok, aAdr);
                 if (aCell.hasNumeric())
                 {
                     double x = GetCellValue(aAdr, aCell);
@@ -3056,8 +3054,7 @@ void ScInterpreter::ScGeoMean()
             case svSingleRef :
             {
                 PopSingleRef( aAdr );
-                ScRefCellValue aCell;
-                aCell.assign(*pDok, aAdr);
+                ScRefCellValue aCell(*pDok, aAdr);
                 if (aCell.hasNumeric())
                 {
                     double x = GetCellValue(aAdr, aCell);
@@ -3194,8 +3191,7 @@ bool ScInterpreter::CalculateSkew(double& fSum,double& fCount,double& vSum,std::
             case svSingleRef :
             {
                 PopSingleRef( aAdr );
-                ScRefCellValue aCell;
-                aCell.assign(*pDok, aAdr);
+                ScRefCellValue aCell(*pDok, aAdr);
                 if (aCell.hasNumeric())
                 {
                     fVal = GetCellValue(aAdr, aCell);
@@ -3669,8 +3665,7 @@ void ScInterpreter::GetNumberSequenceArray( sal_uInt8 nParamCount, vector<double
             case svSingleRef :
             {
                 PopSingleRef( aAdr );
-                ScRefCellValue aCell;
-                aCell.assign(*pDok, aAdr);
+                ScRefCellValue aCell(*pDok, aAdr);
                 if (aCell.hasNumeric())
                     rArray.push_back(GetCellValue(aAdr, aCell));
             }
@@ -3954,8 +3949,7 @@ void ScInterpreter::ScAveDev()
             case svSingleRef :
             {
                 PopSingleRef( aAdr );
-                ScRefCellValue aCell;
-                aCell.assign(*pDok, aAdr);
+                ScRefCellValue aCell(*pDok, aAdr);
                 if (aCell.hasNumeric())
                 {
                     rVal += GetCellValue(aAdr, aCell);
@@ -4037,8 +4031,7 @@ void ScInterpreter::ScAveDev()
             case svSingleRef :
             {
                 PopSingleRef( aAdr );
-                ScRefCellValue aCell;
-                aCell.assign(*pDok, aAdr);
+                ScRefCellValue aCell(*pDok, aAdr);
                 if (aCell.hasNumeric())
                     rVal += fabs(GetCellValue(aAdr, aCell) - nMiddle);
             }
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index 6bd1da9..d21e9e6 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -348,8 +348,7 @@ bool ScInterpreter::CreateDoubleArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
             {
                 aAdr.SetCol( nCol );
 
-                ScRefCellValue aCell;
-                aCell.assign(*pDok, aAdr);
+                ScRefCellValue aCell(*pDok, aAdr);
                 if (!aCell.isEmpty())
                 {
                     sal_uInt16  nErr = 0;
@@ -429,8 +428,7 @@ bool ScInterpreter::CreateStringArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
             SCCOL nCol = nCol1;
             while (nCol <= nCol2)
             {
-                ScRefCellValue aCell;
-                aCell.assign(*pDok, ScAddress(nCol, nRow, nTab));
+                ScRefCellValue aCell(*pDok, ScAddress(nCol, nRow, nTab));
                 if (!aCell.isEmpty())
                 {
                     OUString  aStr;
@@ -530,8 +528,7 @@ bool ScInterpreter::CreateCellArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
             while (nCol <= nCol2)
             {
                 aAdr.SetCol( nCol );
-                ScRefCellValue aCell;
-                aCell.assign(*pDok, aAdr);
+                ScRefCellValue aCell(*pDok, aAdr);
                 if (!aCell.isEmpty())
                 {
                     sal_uInt16  nErr = 0;
@@ -714,8 +711,7 @@ void ScInterpreter::PushTempToken( const FormulaToken& r )
 void ScInterpreter::PushCellResultToken( bool bDisplayEmptyAsString,
         const ScAddress & rAddress, short * pRetTypeExpr, sal_uLong * pRetIndexExpr )
 {
-    ScRefCellValue aCell;
-    aCell.assign(*pDok, rAddress);
+    ScRefCellValue aCell(*pDok, rAddress);
     if (aCell.hasEmptyValue())
     {
         bool bInherited = (aCell.meType == CELLTYPE_FORMULA);
@@ -1962,8 +1958,7 @@ double ScInterpreter::GetDouble()
         {
             ScAddress aAdr;
             PopSingleRef( aAdr );
-            ScRefCellValue aCell;
-            aCell.assign(*pDok, aAdr);
+            ScRefCellValue aCell(*pDok, aAdr);
             nVal = GetCellValue(aAdr, aCell);
         }
         break;
@@ -1974,8 +1969,7 @@ double ScInterpreter::GetDouble()
             ScAddress aAdr;
             if ( !nGlobalError && DoubleRefToPosSingleRef( aRange, aAdr ) )
             {
-                ScRefCellValue aCell;
-                aCell.assign(*pDok, aAdr);
+                ScRefCellValue aCell(*pDok, aAdr);
                 nVal = GetCellValue(aAdr, aCell);
             }
             else
@@ -2063,8 +2057,7 @@ svl::SharedString ScInterpreter::GetString()
             PopSingleRef( aAdr );
             if (nGlobalError == 0)
             {
-                ScRefCellValue aCell;
-                aCell.assign(*pDok, aAdr);
+                ScRefCellValue aCell(*pDok, aAdr);
                 svl::SharedString aSS;
                 GetCellString(aSS, aCell);
                 return aSS;
@@ -2079,8 +2072,7 @@ svl::SharedString ScInterpreter::GetString()
             ScAddress aAdr;
             if ( !nGlobalError && DoubleRefToPosSingleRef( aRange, aAdr ) )
             {
-                ScRefCellValue aCell;
-                aCell.assign(*pDok, aAdr);
+                ScRefCellValue aCell(*pDok, aAdr);
                 svl::SharedString aSS;
                 GetCellString(aSS, aCell);
                 return aSS;
@@ -2607,8 +2599,7 @@ void ScInterpreter::ScExternal()
                                     ScAddress aAdr;
                                     if ( PopDoubleRefOrSingleRef( aAdr ) )
                                     {
-                                        ScRefCellValue aCell;
-                                        aCell.assign(*pDok, aAdr);
+                                        ScRefCellValue aCell(*pDok, aAdr);
                                         if (aCell.hasString())
                                         {
                                             svl::SharedString aStr;
@@ -2658,8 +2649,7 @@ void ScInterpreter::ScExternal()
                                 ScAddress aAdr;
                                 if ( PopDoubleRefOrSingleRef( aAdr ) )
                                 {
-                                    ScRefCellValue aCell;
-                                    aCell.assign(*pDok, aAdr);
+                                    ScRefCellValue aCell(*pDok, aAdr);
                                     if (aCell.hasString())
                                     {
                                         svl::SharedString aStr;
@@ -3181,8 +3171,7 @@ void ScInterpreter::ScMacro()
 bool ScInterpreter::SetSbxVariable( SbxVariable* pVar, const ScAddress& rPos )
 {
     bool bOk = true;
-    ScRefCellValue aCell;
-    aCell.assign(*pDok, rPos);
+    ScRefCellValue aCell(*pDok, rPos);
     if (!aCell.isEmpty())
     {
         sal_uInt16 nErr;
@@ -3270,8 +3259,7 @@ void ScInterpreter::ScTableOp()
                 iBroadcast != pTableOp->aNotifiedFormulaPos.end();
                 ++iBroadcast )
         {   // emulate broadcast and indirectly collect cell pointers
-            ScRefCellValue aCell;
-            aCell.assign(*pDok, *iBroadcast);
+            ScRefCellValue aCell(*pDok, *iBroadcast);
             if (aCell.meType == CELLTYPE_FORMULA)
                 aCell.mpFormula->SetTableOpDirty();
         }
@@ -3284,8 +3272,7 @@ void ScInterpreter::ScTableOp()
     }
     pTableOp->bCollectNotifications = false;
 
-    ScRefCellValue aCell;
-    aCell.assign(*pDok, pTableOp->aFormulaPos);
+    ScRefCellValue aCell(*pDok, pTableOp->aFormulaPos);
     if (aCell.meType == CELLTYPE_FORMULA)
         aCell.mpFormula->SetDirtyVar();
     if (aCell.hasNumeric())
diff --git a/sc/source/core/tool/interpr5.cxx b/sc/source/core/tool/interpr5.cxx
index 4548acb..f44bb88 100644
--- a/sc/source/core/tool/interpr5.cxx
+++ b/sc/source/core/tool/interpr5.cxx
@@ -389,8 +389,7 @@ ScMatrixRef ScInterpreter::GetMatrix()
             pMat = GetNewMat(1, 1);
             if (pMat)
             {
-                ScRefCellValue aCell;
-                aCell.assign(*pDok, aAdr);
+                ScRefCellValue aCell(*pDok, aAdr);
                 if (aCell.hasEmptyValue())
                     pMat->PutEmpty(0, 0);
                 else if (aCell.hasNumeric())
@@ -516,8 +515,7 @@ void ScInterpreter::ScMatValue()
             {
                 ScAddress aAdr;
                 PopSingleRef( aAdr );
-                ScRefCellValue aCell;
-                aCell.assign(*pDok, aAdr);
+                ScRefCellValue aCell(*pDok, aAdr);
                 if (aCell.meType == CELLTYPE_FORMULA)
                 {
                     sal_uInt16 nErrCode = aCell.mpFormula->GetErrCode();
@@ -548,8 +546,7 @@ void ScInterpreter::ScMatValue()
                 {
                     ScAddress aAdr( sal::static_int_cast<SCCOL>( nCol1 + nR ),
                                     sal::static_int_cast<SCROW>( nRow1 + nC ), nTab1 );
-                    ScRefCellValue aCell;
-                    aCell.assign(*pDok, aAdr);
+                    ScRefCellValue aCell(*pDok, aAdr);
                     if (aCell.hasNumeric())
                         PushDouble(GetCellValue(aAdr, aCell));
                     else
@@ -3173,8 +3170,7 @@ void ScInterpreter::ScMatRef()
     ScAddress aAdr;
     PopSingleRef( aAdr );
 
-    ScRefCellValue aCell;
-    aCell.assign(*pDok, aAdr);
+    ScRefCellValue aCell(*pDok, aAdr);
 
     if (aCell.meType != CELLTYPE_FORMULA)
     {
diff --git a/sc/source/core/tool/interpr6.cxx b/sc/source/core/tool/interpr6.cxx
index 0ef3ac1..cd8346e 100644
--- a/sc/source/core/tool/interpr6.cxx
+++ b/sc/source/core/tool/interpr6.cxx
@@ -623,8 +623,7 @@ double ScInterpreter::IterateParameters( ScIterFunc eFunc, bool bTextAsZero )
                 {
                     break;
                 }
-                ScRefCellValue aCell;
-                aCell.assign(*pDok, aAdr);
+                ScRefCellValue aCell(*pDok, aAdr);
                 if (!aCell.isEmpty())
                 {
                     if( eFunc == ifCOUNT2 )
diff --git a/sc/source/core/tool/rangeseq.cxx b/sc/source/core/tool/rangeseq.cxx
index 9670939..e047083 100644
--- a/sc/source/core/tool/rangeseq.cxx
+++ b/sc/source/core/tool/rangeseq.cxx
@@ -257,8 +257,7 @@ bool ScRangeToSequence::FillMixedArray( uno::Any& rAny, ScDocument* pDoc, const
             uno::Any& rElement = pColAry[nCol];
 
             ScAddress aPos( (SCCOL)(nStartCol+nCol), (SCROW)(nStartRow+nRow), nTab );
-            ScRefCellValue aCell;
-            aCell.assign(*pDoc, aPos);
+            ScRefCellValue aCell(*pDoc, aPos);
 
             if (aCell.isEmpty())
             {
diff --git a/sc/source/filter/dif/difexp.cxx b/sc/source/filter/dif/difexp.cxx
index ba17c2c..702ee1a 100644
--- a/sc/source/filter/dif/difexp.cxx
+++ b/sc/source/filter/dif/difexp.cxx
@@ -143,8 +143,6 @@ FltError ScFormatFilterPluginImpl::ScExportDif( SvStream& rOut, ScDocument* pDoc
     SCCOL               nColCnt;
     SCROW               nRowCnt;
 
-    ScRefCellValue aCell;
-
     for( nRowCnt = rRange.aStart.Row() ; nRowCnt <= nEndRow ; nRowCnt++ )
     {
         OSL_ASSERT(aOS.getLength() == 0);
@@ -156,7 +154,7 @@ FltError ScFormatFilterPluginImpl::ScExportDif( SvStream& rOut, ScDocument* pDoc
         {
             OSL_ASSERT(aOS.getLength() == 0);
             bool bWriteStringData = false;
-            aCell.assign(*pDoc, ScAddress(nColCnt, nRowCnt, nTab));
+            ScRefCellValue aCell(*pDoc, ScAddress(nColCnt, nRowCnt, nTab));
 
             switch (aCell.meType)
             {
diff --git a/sc/source/filter/html/htmlexp.cxx b/sc/source/filter/html/htmlexp.cxx
index ea35369..22dc489 100644
--- a/sc/source/filter/html/htmlexp.cxx
+++ b/sc/source/filter/html/htmlexp.cxx
@@ -899,8 +899,7 @@ void ScHTMLExport::WriteCell( SCCOL nCol, SCROW nRow, SCTAB nTab )
         }
     }
 
-    ScRefCellValue aCell;
-    aCell.assign(*pDoc, aPos);
+    ScRefCellValue aCell(*pDoc, aPos);
 
     sal_uLong nFormat = pAttr->GetNumberFormat( pFormatter );
     bool bValueData = aCell.hasNumeric();
diff --git a/sc/source/filter/oox/worksheethelper.cxx b/sc/source/filter/oox/worksheethelper.cxx
index 8f0e7cc..69fdb25 100644
--- a/sc/source/filter/oox/worksheethelper.cxx
+++ b/sc/source/filter/oox/worksheethelper.cxx
@@ -1023,8 +1023,7 @@ void WorksheetGlobals::insertHyperlink( const CellAddress& rAddress, const OUStr
 {
     ScDocumentImport& rDoc = getDocImport();
     ScAddress aPos(rAddress.Column, rAddress.Row, rAddress.Sheet);
-    ScRefCellValue aCell;
-    aCell.assign(rDoc.getDoc(), aPos);
+    ScRefCellValue aCell(rDoc.getDoc(), aPos);
 
     if (aCell.meType == CELLTYPE_STRING || aCell.meType == CELLTYPE_EDIT)
     {
diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx
index 317cbf2..411dbef 100644
--- a/sc/source/ui/docshell/docsh8.cxx
+++ b/sc/source/ui/docshell/docsh8.cxx
@@ -610,8 +610,7 @@ void lcl_GetColumnTypes(
 
         if ( !bTypeDefined )
         {   // Field type.
-            ScRefCellValue aCell;
-            aCell.assign(rDoc, ScAddress(nCol, nFirstDataRow, nTab));
+            ScRefCellValue aCell(rDoc, ScAddress(nCol, nFirstDataRow, nTab));
             if (aCell.isEmpty() || aCell.hasString())
                 nDbType = sdbc::DataType::VARCHAR;
             else
@@ -966,8 +965,7 @@ sal_uLong ScDocShell::DBaseExport( const OUString& rFullFileName, rtl_TextEncodi
                 {
                     case sdbc::DataType::LONGVARCHAR:
                     {
-                        ScRefCellValue aCell;
-                        aCell.assign(aDocument, ScAddress(nDocCol, nDocRow, nTab));
+                        ScRefCellValue aCell(aDocument, ScAddress(nDocCol, nDocRow, nTab));
                         if (!aCell.isEmpty())
                         {
                             if (aCell.meType == CELLTYPE_EDIT)
diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx
index 04bbe7e..d24b9ae 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -1505,7 +1505,6 @@ static std::unique_ptr<ScTokenArray> convertToTokenArray(
         ScMatrixRef xMat = new ScMatrix(
             static_cast<SCSIZE>(nCol2-nCol1+1), static_cast<SCSIZE>(nRow2-nRow1+1));
 
-        ScRefCellValue aCell;
         ColumnBatch<svl::SharedString> aStringBatch(pHostDoc, pSrcDoc, CELLTYPE_STRING, CELLTYPE_EDIT);
         ColumnBatch<double> aDoubleBatch(pHostDoc, pSrcDoc, CELLTYPE_VALUE, CELLTYPE_VALUE);
 
@@ -1516,7 +1515,7 @@ static std::unique_ptr<ScTokenArray> convertToTokenArray(
             {
                 const SCSIZE nR = nRow - nRow1;
 
-                aCell.assign(*pSrcDoc, ScAddress(nCol, nRow, nTab));
+                ScRefCellValue aCell(*pSrcDoc, ScAddress(nCol, nRow, nTab));
 
                 aStringBatch.update(aCell, nC, nR, xMat);
                 aDoubleBatch.update(aCell, nC, nR, xMat);
@@ -2158,8 +2157,7 @@ ScExternalRefCache::TokenRef ScExternalRefManager::getSingleRefTokenFromSrcDoc(
     ScExternalRefCache::CellFormat* pFmt)
 {
     // Get the cell from src doc, and convert it into a token.
-    ScRefCellValue aCell;
-    aCell.assign(*pSrcDoc, rPos);
+    ScRefCellValue aCell(*pSrcDoc, rPos);
     ScExternalRefCache::TokenRef pToken(convertToToken(mpDoc, pSrcDoc, aCell));
 
     if (!pToken.get())
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 7089b07..6f2164f 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -1969,8 +1969,7 @@ bool ScImportExport::Doc2Sylk( SvStream& rStrm )
             bool bForm = false;
             SCROW r = nRow - nStartRow + 1;
             SCCOL c = nCol - nStartCol + 1;
-            ScRefCellValue aCell;
-            aCell.assign(*pDoc, ScAddress(nCol, nRow, aRange.aStart.Tab()));
+            ScRefCellValue aCell(*pDoc, ScAddress(nCol, nRow, aRange.aStart.Tab()));
             CellType eType = aCell.meType;
             switch( eType )
             {
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index e816b07..7033bc5 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -1330,8 +1330,7 @@ static bool lcl_PutFormulaArray( ScDocShell& rDocShell, const ScRange& rRange,
 //  used in ScCellRangeObj::getFormulaArray and ScCellObj::GetInputString_Impl
 static OUString lcl_GetInputString( ScDocument& rDoc, const ScAddress& rPos, bool bEnglish )
 {
-    ScRefCellValue aCell;
-    aCell.assign(rDoc, rPos);
+    ScRefCellValue aCell(rDoc, rPos);
     if (aCell.isEmpty())
         return EMPTY_OUSTRING;
 
@@ -2313,8 +2312,7 @@ void ScCellRangesBase::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pE
                             /* TODO: Iterate through the range */
                             ScAddress aAddr = aRange.aStart;
                             ScDocument& rDoc = pDocShell->GetDocument();
-                            ScRefCellValue aCell;
-                            aCell.assign(rDoc, aAddr);
+                            ScRefCellValue aCell(rDoc, aAddr);
 
                             OUString aStr = aCell.getString(&rDoc);
                             EditEngine aEngine( rDoc.GetEnginePool() );
@@ -5077,10 +5075,8 @@ OUString SAL_CALL ScCellRangeObj::getArrayFormula() throw(uno::RuntimeException,
     OUString aFormula;
 
     ScDocument& rDoc = pDocSh->GetDocument();
-    ScRefCellValue aCell1;
-    ScRefCellValue aCell2;
-    aCell1.assign(rDoc, aRange.aStart);
-    aCell2.assign(rDoc, aRange.aEnd);
+    ScRefCellValue aCell1(rDoc, aRange.aStart);
+    ScRefCellValue aCell2(rDoc, aRange.aEnd);
     if (aCell1.meType == CELLTYPE_FORMULA && aCell2.meType == CELLTYPE_FORMULA)
     {
         const ScFormulaCell* pFCell1 = aCell1.mpFormula;
@@ -5146,10 +5142,8 @@ uno::Sequence<sheet::FormulaToken> SAL_CALL ScCellRangeObj::getArrayTokens()
         return aSequence;
 
     ScDocument& rDoc = pDocSh->GetDocument();
-    ScRefCellValue aCell1;
-    ScRefCellValue aCell2;
-    aCell1.assign(rDoc, aRange.aStart);
-    aCell2.assign(rDoc, aRange.aEnd);
+    ScRefCellValue aCell1(rDoc, aRange.aStart);
+    ScRefCellValue aCell2(rDoc, aRange.aEnd);
     if (aCell1.meType == CELLTYPE_FORMULA && aCell2.meType == CELLTYPE_FORMULA)
     {
         const ScFormulaCell* pFCell1 = aCell1.mpFormula;
@@ -6177,8 +6171,7 @@ OUString ScCellObj::GetOutputString_Impl() const
     if ( pDocSh )
     {
         ScDocument& rDoc = pDocSh->GetDocument();
-        ScRefCellValue aCell;
-        aCell.assign(rDoc, aCellPos);
+        ScRefCellValue aCell(rDoc, aCellPos);
 
         aVal = ScCellFormat::GetOutputString(rDoc, aCellPos, aCell);
     }
@@ -6539,8 +6532,7 @@ table::CellContentType ScCellObj::GetResultType_Impl()
     ScDocShell* pDocSh = GetDocShell();
     if ( pDocSh )
     {
-        ScRefCellValue aCell;
-        aCell.assign(pDocSh->GetDocument(), aCellPos);
+        ScRefCellValue aCell(pDocSh->GetDocument(), aCellPos);
         if (aCell.meType == CELLTYPE_FORMULA)
         {
             bool bValue = aCell.mpFormula->IsValue();
@@ -6561,8 +6553,7 @@ sal_Int32 SAL_CALL ScCellObj::getError() throw(uno::RuntimeException, std::excep
     }
 
     sal_uInt16 nError = 0;
-    ScRefCellValue aCell;
-    aCell.assign(pDocSh->GetDocument(), aCellPos);
+    ScRefCellValue aCell(pDocSh->GetDocument(), aCellPos);
     if (aCell.meType == CELLTYPE_FORMULA)
         nError = aCell.mpFormula->GetErrCode();
 
@@ -6581,8 +6572,7 @@ uno::Sequence<sheet::FormulaToken> SAL_CALL ScCellObj::getTokens()
         return aSequence;
 
     ScDocument& rDoc = pDocSh->GetDocument();
-    ScRefCellValue aCell;
-    aCell.assign(rDoc, aCellPos);
+    ScRefCellValue aCell(rDoc, aCellPos);
     if (aCell.meType == CELLTYPE_FORMULA)
     {
         ScTokenArray* pTokenArray = aCell.mpFormula->GetCode();
@@ -9124,8 +9114,7 @@ void ScCellsEnumeration::CheckPos_Impl()
 
     bool bFound = false;
     ScDocument& rDoc = pDocShell->GetDocument();
-    ScRefCellValue aCell;
-    aCell.assign(rDoc, aPos);
+    ScRefCellValue aCell(rDoc, aPos);
     if (!aCell.isEmpty())
     {
         if (!pMark)
diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx
index ce6e62a..fb4746c 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -3265,8 +3265,7 @@ sal_uLong getDisplayNumberFormat(ScDocument* pDoc, const ScAddress& rPos)
         // TODO: use nicer heuristic
         for (const Item& rItem : m_aDataArray)
         {
-            ScRefCellValue aCell;
-            aCell.assign(*m_pDocument, rItem.mAddress);
+            ScRefCellValue aCell(*m_pDocument, rItem.mAddress);
             if (!aCell.isEmpty())
             {
                 return static_cast<sal_Int32>(getDisplayNumberFormat(m_pDocument, rItem.mAddress));
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index 718b33c..4d5d912 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -2866,10 +2866,9 @@ void ScCellShell::ExecuteFillSingleEdit()
         // Get the initial text value from the above cell.
 
         ScDocument* pDoc = GetViewData()->GetDocument();
-        ScRefCellValue aCell;
         ScAddress aPrevPos = aCurPos;
         aPrevPos.IncRow(-1);
-        aCell.assign(*pDoc, aPrevPos);
+        ScRefCellValue aCell(*pDoc, aPrevPos);
 
         if (aCell.meType == CELLTYPE_FORMULA)
         {
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index ae6503e..0c37ab9 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -382,8 +382,7 @@ static bool lcl_IsEditableMatrix( ScDocument* pDoc, const ScRange& rRange )
                                     rRange.aEnd.Col(),rRange.aEnd.Row() ) )
         return false;
 
-    ScRefCellValue aCell;
-    aCell.assign(*pDoc, rRange.aEnd);
+    ScRefCellValue aCell(*pDoc, rRange.aEnd);
     ScAddress aPos;
     return (aCell.meType == CELLTYPE_FORMULA && aCell.mpFormula->GetMatrixOrigin(aPos) && aPos == rRange.aStart);
 }
@@ -1689,11 +1688,10 @@ bool ScGridWindow::IsCellCoveredByText(SCsCOL nPosX, SCsROW nPosY, SCTAB nTab, S
     ScDocument* pDoc = pViewData->GetDocument();
 
     // find the first non-empty cell (this, or to the left)
-    ScRefCellValue aCell;
     SCsCOL nNonEmptyX = nPosX;
     for (; nNonEmptyX >= 0; --nNonEmptyX)
     {
-        aCell.assign(*pDoc, ScAddress(nNonEmptyX, nPosY, nTab));
+        ScRefCellValue aCell(*pDoc, ScAddress(nNonEmptyX, nPosY, nTab));
         if (!aCell.isEmpty())
             break;
     }
@@ -1807,8 +1805,7 @@ void ScGridWindow::HandleMouseButtonDown( const MouseEvent& rMEvt, MouseEventSta
         SCTAB nTab = pViewData->GetTabNo();
         pViewData->GetPosFromPixel(aPos.X(), aPos.Y(), eWhich, nPosX, nPosY);
 
-        ScRefCellValue aCell;
-        aCell.assign(*pDoc, ScAddress(nPosX, nPosY, nTab));
+        ScRefCellValue aCell(*pDoc, ScAddress(nPosX, nPosY, nTab));
         bool bIsEmpty = aCell.isEmpty();
         bool bIsCoveredByText = bIsEmpty && IsCellCoveredByText(nPosX, nPosY, nTab, nNonEmptyX);
 
@@ -2413,8 +2410,7 @@ void ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt )
             // case we used the double-click to select the empty cell
             if (bIsTiledRendering && bDouble)
             {
-                ScRefCellValue aCell;
-                aCell.assign(*pViewData->GetDocument(), ScAddress(nPosX, nPosY, nTab));
+                ScRefCellValue aCell(*pViewData->GetDocument(), ScAddress(nPosX, nPosY, nTab));
                 if (aCell.isEmpty())
                     return;
             }
@@ -3077,7 +3073,6 @@ void ScGridWindow::Command( const CommandEvent& rCEvt )
 
         bool bSpellError = false;
         SCCOL nColSpellError = nCellX;
-        ScRefCellValue aSpellCheckCell;
 
         if ( bMouse )
         {
@@ -3105,7 +3100,7 @@ void ScGridWindow::Command( const CommandEvent& rCEvt )
             {
                 // Find the first string to the left for spell checking in case the current cell is empty.
                 ScAddress aPos(nCellX, nCellY, nTab);
-                aSpellCheckCell.assign(*pDoc, aPos);
+                ScRefCellValue aSpellCheckCell(*pDoc, aPos);
                 while (aSpellCheckCell.meType == CELLTYPE_NONE)
                 {
                     // Loop until we get the first non-empty cell in the row.
@@ -5467,8 +5462,7 @@ bool ScGridWindow::IsSpellErrorAtPos( const Point& rPos, SCCOL nCol1, SCROW nRow
     ScDocument& rDoc = pDocSh->GetDocument();
 
     ScAddress aCellPos(nCol1, nRow, nTab);
-    ScRefCellValue aCell;
-    aCell.assign(rDoc, aCellPos);
+    ScRefCellValue aCell(rDoc, aCellPos);
     if (aCell.meType != CELLTYPE_STRING && aCell.meType != CELLTYPE_EDIT)
         return false;
 
diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index 72d8849..f610daa 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -1075,8 +1075,7 @@ bool ScOutputData::IsEmptyCellText( RowInfo* pThisRowInfo, SCCOL nX, SCROW nY )
         bEmpty = pThisRowInfo->pCellInfo[nX+1].bEmptyCellText;
     else
     {
-        ScRefCellValue aCell;
-        aCell.assign(*mpDoc, ScAddress(nX, nY, nTab));
+        ScRefCellValue aCell(*mpDoc, ScAddress(nX, nY, nTab));
         bEmpty = aCell.isEmpty();
     }
 
@@ -1121,8 +1120,7 @@ bool ScOutputData::IsAvailable( SCCOL nX, SCROW nY )
     //  Stop at non-empty or merged or overlapped cell,
     //  where a note is empty as well as a cell that's hidden by protection settings
 
-    ScRefCellValue aCell;
-    aCell.assign(*mpDoc, ScAddress(nX, nY, nTab));
+    ScRefCellValue aCell(*mpDoc, ScAddress(nX, nY, nTab));
     if (!aCell.isEmpty() && !IsEmptyCellText(NULL, nX, nY))
         return false;
 
diff --git a/sc/source/ui/view/tabvwsh.cxx b/sc/source/ui/view/tabvwsh.cxx
index 632757d..a765612 100644
--- a/sc/source/ui/view/tabvwsh.cxx
+++ b/sc/source/ui/view/tabvwsh.cxx
@@ -112,8 +112,7 @@ OUString ScTabViewShell::GetFormula(ScAddress& rAddress)
 {
     OUString sFormula;
     ScDocument* pDoc = GetViewData().GetDocument();
-    ScRefCellValue aCell;
-    aCell.assign(*pDoc, rAddress);
+    ScRefCellValue aCell(*pDoc, rAddress);
     if (!aCell.isEmpty() && aCell.meType == CELLTYPE_FORMULA)
     {
         sFormula = aCell.mpString->getString();
diff --git a/sc/source/ui/view/tabvwsh5.cxx b/sc/source/ui/view/tabvwsh5.cxx
index 7fc6659..9ccfb50 100644
--- a/sc/source/ui/view/tabvwsh5.cxx
+++ b/sc/source/ui/view/tabvwsh5.cxx
@@ -313,8 +313,7 @@ SvxNumberInfoItem* ScTabViewShell::MakeNumberInfoItem( ScDocument* pDoc, ScViewD
     double              nCellValue      = 0;
     OUString aCellString;
 
-    ScRefCellValue aCell;
-    aCell.assign(*pDoc, pViewData->GetCurPos());
+    ScRefCellValue aCell(*pDoc, pViewData->GetCurPos());
 
     switch (aCell.meType)
     {
diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index 5a34f90..d04433b 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -207,8 +207,7 @@ enum ScAutoSum
 static ScAutoSum lcl_IsAutoSumData( ScDocument* pDoc, SCCOL nCol, SCROW nRow,
         SCTAB nTab, ScDirection eDir, SCCOLROW& nExtend )
 {
-    ScRefCellValue aCell;
-    aCell.assign(*pDoc, ScAddress(nCol, nRow, nTab));
+    ScRefCellValue aCell(*pDoc, ScAddress(nCol, nRow, nTab));
     if (aCell.hasNumeric())
     {
         if (aCell.meType == CELLTYPE_FORMULA)
commit 5bcc5a690f9707464195483c400427d9ccd6d8dc
Author: Eike Rathke <erack at redhat.com>
Date:   Mon Nov 2 14:35:01 2015 +0100

    avoid construction of ScRefCellValue with default ctor, tdf#95419 related
    
    ... to just assign a new value, which takes a significant amount of time
    (~13% of ScTable::ValidQuery()) in ScRefCellValue::operator=() due to
    its implementation using a temporary and swap.
    
    Change-Id: Ia205850e10c5fa9083eec5fb7563d98561b52462

diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index a95dd68..861ac3d 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -2625,12 +2625,9 @@ bool ScTable::ValidQuery(
         const ScQueryEntry& rEntry = *it;
         SCCOL nCol = static_cast<SCCOL>(rEntry.nField);
 
-        // we can only handle one single direct query
-        ScRefCellValue aCell;
-        if (pCell && it == itBeg)
-            aCell = *pCell;
-        else
-            aCell = GetCellValue(nCol, nRow);
+        // We can only handle one single direct query passed as a known pCell,
+        // subsequent queries have to obtain the cell.
+        ScRefCellValue aCell( (pCell && it == itBeg) ? *pCell : GetCellValue(nCol, nRow));
 
         std::pair<bool,bool> aRes(false, false);
 
commit 4b3b605f3334a41057f565866de37bd14369a55e
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Nov 2 17:54:19 2015 +0100

    Fix license header
    
    corrupted with 7408498de37be05159f84cf0c8116313d3c196df
    "loplugin:stringconstant"
    
    Change-Id: Ia7af4b7276fb30485f39e24c9afcdc82f7cef447

diff --git a/framework/inc/acceleratorconst.h b/framework/inc/acceleratorconst.h
index f4ac1b1..b918a53 100644
--- a/framework/inc/acceleratorconst.h
+++ b/framework/inc/acceleratorconst.h
@@ -12,7 +12,7 @@
  *   contributor license agreements. See the NOTICE file distributed
  *   with this work for additional information regarding copyright
  *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"; you may not use this file
+ *   License, Version 2.0 (the "License"); you may not use this file
  *   except in compliance with the License. You may obtain a copy of
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
commit 5e04886917abad0541eb3ef6d51cd5dc0395af21
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Nov 2 17:53:29 2015 +0100

    Remove spurious vertical whitespace
    
    Change-Id: I077a17eada47b9c1509c21c18a6e4cd06172de3b

diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx
index 3ceae6f..1cce873 100644
--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx
@@ -83,7 +83,6 @@ void CPPU_CURRENT_NAMESPACE::callVirtualMethod(
         "leaq (%%rax, %%rcx, 8), %%rax\n\t"
         "subq %%rax, %%rsp\n\t"
         "andq $-9, %%rsp\n\t" // 16-bytes aligned
-
         "movq 8%0, %%rsi\n\t"
         "\n.Lpush:\n\t"
         "decq %%rcx\n\t"
commit a4ebfb2b74c6db274ae8b7ed0579a6edf47597fe
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Nov 2 16:08:25 2015 +0000

    afl-eventtesting: crash close impress with spelling dialog active
    
    Change-Id: I1085b655a9a589f2e92edfdacfea6621d2f67d9c

diff --git a/sd/inc/Outliner.hxx b/sd/inc/Outliner.hxx
index 931854d..ec54eab 100644
--- a/sd/inc/Outliner.hxx
+++ b/sd/inc/Outliner.hxx
@@ -180,6 +180,7 @@ public:
     int         GetIgnoreCurrentPageChangesLevel() const     { return mnIgnoreCurrentPageChangesLevel; };
     void        IncreIgnoreCurrentPageChangesLevel()     { mnIgnoreCurrentPageChangesLevel++; };
     void        DecreIgnoreCurrentPageChangesLevel()     { mnIgnoreCurrentPageChangesLevel--; };
+    SdDrawDocument* GetDoc() const { return mpDrawDocument; }
 
 private:
     class Implementation;
diff --git a/sd/source/ui/dlg/SpellDialogChildWindow.cxx b/sd/source/ui/dlg/SpellDialogChildWindow.cxx
index dbf9c9d..b59696c 100644
--- a/sd/source/ui/dlg/SpellDialogChildWindow.cxx
+++ b/sd/source/ui/dlg/SpellDialogChildWindow.cxx
@@ -48,11 +48,7 @@ SpellDialogChildWindow::SpellDialogChildWindow (
 
 SpellDialogChildWindow::~SpellDialogChildWindow()
 {
-    if (mpSdOutliner != NULL)
-        mpSdOutliner->EndSpelling();
-
-    if (mbOwnOutliner)
-        delete mpSdOutliner;
+    EndSpellingAndClearOutliner();
 }
 
 SfxChildWinInfo SpellDialogChildWindow::GetInfo() const
@@ -103,6 +99,29 @@ void SpellDialogChildWindow::LoseFocus()
 {
 }
 
+void SpellDialogChildWindow::EndSpellingAndClearOutliner()
+{
+    if (!mpSdOutliner)
+        return;
+    EndListening(*mpSdOutliner->GetDoc());
+    mpSdOutliner->EndSpelling();
+    if (mbOwnOutliner)
+        delete mpSdOutliner;
+    mpSdOutliner = NULL;
+    mbOwnOutliner = false;
+}
+
+void SpellDialogChildWindow::Notify(SfxBroadcaster&, const SfxHint& rHint)
+{
+    if (const SdrHint* pSdrHint = dynamic_cast<const SdrHint*>(&rHint))
+    {
+        if (HINT_MODELCLEARED == pSdrHint->GetKind())
+        {
+            EndSpellingAndClearOutliner();
+        }
+    }
+}
+
 void SpellDialogChildWindow::ProvideOutliner()
 {
     ViewShellBase* pViewShellBase = dynamic_cast<ViewShellBase*>( SfxViewShell::Current() );
@@ -116,10 +135,7 @@ void SpellDialogChildWindow::ProvideOutliner()
             if(( dynamic_cast< const DrawViewShell *>( pViewShell ) !=  nullptr && ! mbOwnOutliner)
                 || (dynamic_cast< const OutlineViewShell *>( pViewShell ) !=  nullptr && mbOwnOutliner))
             {
-                mpSdOutliner->EndSpelling();
-                if (mbOwnOutliner)
-                    delete mpSdOutliner;
-                mpSdOutliner = NULL;
+                EndSpellingAndClearOutliner();
             }
 
         // Now create/get an outliner if none is present.
@@ -130,16 +146,18 @@ void SpellDialogChildWindow::ProvideOutliner()
                 // We need an outliner for the spell check so we have
                 // to create one.
                 mbOwnOutliner = true;
-                mpSdOutliner = new Outliner (
-                    pViewShell->GetDoc(),
-                    OUTLINERMODE_TEXTOBJECT);
+                SdDrawDocument *pDoc = pViewShell->GetDoc();
+                mpSdOutliner = new Outliner(pDoc, OUTLINERMODE_TEXTOBJECT);
+                StartListening(*pDoc);
             }
             else if( dynamic_cast< const OutlineViewShell *>( pViewShell ) !=  nullptr)
             {
                 // An outline view is already visible. The SdOutliner
                 // will use it instead of creating its own.
                 mbOwnOutliner = false;
-                mpSdOutliner = pViewShell->GetDoc()->GetOutliner();
+                SdDrawDocument *pDoc = pViewShell->GetDoc();
+                mpSdOutliner = pDoc->GetOutliner();
+                StartListening(*pDoc);
             }
 
             // Initialize spelling.
diff --git a/sd/source/ui/inc/SpellDialogChildWindow.hxx b/sd/source/ui/inc/SpellDialogChildWindow.hxx
index dbfe0be..3d6f654 100644
--- a/sd/source/ui/inc/SpellDialogChildWindow.hxx
+++ b/sd/source/ui/inc/SpellDialogChildWindow.hxx
@@ -32,6 +32,7 @@ class Outliner;
 */
 class SpellDialogChildWindow
     : public svx::SpellDialogChildWindow
+    , public SfxListener
 {
 public:
     SpellDialogChildWindow (
@@ -46,6 +47,9 @@ public:
     */
     void InvalidateSpellDialog();
 
+    // SfxListener
+    virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override;
+
     SFX_DECL_CHILDWINDOW_WITHID(SpellDialogChildWindow);
 
 protected:
@@ -79,6 +83,8 @@ private:
         construction/obtaining of a new one.
     */
     void ProvideOutliner();
+
+    void EndSpellingAndClearOutliner();
 };
 
 } // end of namespace ::sd
diff --git a/vcl/qa/afl-eventtesting/eventtesting.impress.crash-4 b/vcl/qa/afl-eventtesting/eventtesting.impress.crash-4
new file mode 100644
index 0000000..3b0f9bc
Binary files /dev/null and b/vcl/qa/afl-eventtesting/eventtesting.impress.crash-4 differ
commit 9bf204f9aa2caefac13a1a680a669ba74b3731cf
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Nov 2 16:09:12 2015 +0000

    afl-eventtesting: can simplify this now we use QueryExit
    
    Change-Id: Iddb96f51ed2fd2d7861e9448a7aa221d998ad2a5

diff --git a/desktop/inc/app.hxx b/desktop/inc/app.hxx
index 5c6de5b..d07d285 100644
--- a/desktop/inc/app.hxx
+++ b/desktop/inc/app.hxx
@@ -160,8 +160,7 @@ class Desktop : public Application
         /** for ui-testing provide a mechanism to pseudo-restart by closing the
             open frames and reopen the frame that appeared post initial startup
         */
-        static void CloseFrameAndReopen(css::uno::Reference<css::frame::XDesktop2> xDesktop);
-        static void DoExecute(css::uno::Reference<css::frame::XDesktop2> xDesktop);
+        static void DoExecute();
 
         /// does initializations which are necessary for the first run of the office
         static void             DoFirstRunInitializations();
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index a6b1e63..036caaa 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -1277,45 +1277,10 @@ static ExecuteGlobals* pExecGlobals = NULL;
 #define PERSIST_MAX 100
 unsigned int persist_cnt;
 
-//This closes the current frame and reopens the initial frame, useful for
-//pseudo-restarting, i.e. attempt to effectively reset to the initial state of
-//the application post start-up for ui-testing
-void Desktop::CloseFrameAndReopen(Reference<XDesktop2> xDesktop)
-{
-    css::uno::Reference<css::container::XIndexAccess> xTaskContainer(
-        xDesktop->getFrames(), css::uno::UNO_QUERY_THROW);
-    sal_Int32 c = xTaskContainer->getCount();
-    for (sal_Int32 i = 0; i < c; ++i)
-    {
-        css::uno::Reference< css::frame::XFrame > xFrame;
-        xTaskContainer->getByIndex(i) >>= xFrame;
-        if (!xFrame.is())
-            continue;
-        Reference<css::frame::XDispatchProvider> xProvider(xFrame, css::uno::UNO_QUERY);
-
-        css::uno::Reference<css::frame::XController > xController = xFrame->getController();
-        css::uno::Reference<css::frame::XModel> xModel = xController->getModel();
-        css::uno::Reference< css::util::XModifiable > xModifiable(xModel, css::uno::UNO_QUERY);
-        xModifiable->setModified(false);
-
-        css::util::URL aCommand;
-        aCommand.Complete = ".uno:CloseDoc";
-
-        css::uno::Reference<css::uno::XComponentContext> xContext = ::comphelper::getProcessComponentContext();
-        Reference< css::util::XURLTransformer > xParser = css::util::URLTransformer::create(xContext);
-        xParser->parseStrict(aCommand);
-
-        css::uno::Reference< css::frame::XDispatch > xDispatch = xProvider->queryDispatch(aCommand, OUString(), 0);
-        xDispatch->dispatch(aCommand, css::uno::Sequence< css::beans::PropertyValue >());
-    }
-
-    OpenDefault();
-}
-
 //This just calls Execute() for all normal uses of LibreOffice, but for
 //ui-testing if AFL_PERSISTENT is set then on exit it will pseudo-restart (up
 //to PERSIST_MAX times)
-void Desktop::DoExecute(Reference<XDesktop2> xDesktop)
+void Desktop::DoExecute()
 {
 try_again:
     {
@@ -1327,7 +1292,7 @@ try_again:
            program is executed directly; and take note of PERSIST_MAX. */
         if (getenv("AFL_PERSISTENT") && persist_cnt++ < PERSIST_MAX)
         {
-            CloseFrameAndReopen(xDesktop);
+            OpenDefault();
 #if defined UNX
             raise(SIGSTOP);
 #endif
@@ -1651,7 +1616,7 @@ int Desktop::Main()
                 // if this run of the office is triggered by restart, some additional actions should be done
                 DoRestartActionsIfNecessary( !rCmdLineArgs.IsInvisible() && !rCmdLineArgs.IsNoQuickstart() );
 
-                DoExecute(xDesktop);
+                DoExecute();
             }
         }
         catch(const css::document::CorruptedFilterConfigurationException& exFilterCfg)
commit 5d0ef0015dee175802b468c6a946b967d17eef33
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Nov 2 16:08:41 2015 +0000

    cppcheck: noExplicitConstructor
    
    Change-Id: Ia5aba89f02ee4d99dd573599a3888731efb131b9

diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index dc0e00f..6bd1da9 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -3229,7 +3229,7 @@ class FindByPointer : ::std::unary_function<ScInterpreterTableOpParams, bool>
 {
     const ScInterpreterTableOpParams* mpTableOp;
 public:
-    FindByPointer(const ScInterpreterTableOpParams* p) : mpTableOp(p) {}
+    explicit FindByPointer(const ScInterpreterTableOpParams* p) : mpTableOp(p) {}
     bool operator() (const ScInterpreterTableOpParams& val) const
     {
         return &val == mpTableOp;
diff --git a/sc/source/core/tool/queryparam.cxx b/sc/source/core/tool/queryparam.cxx
index 099b55d..59001c9 100644
--- a/sc/source/core/tool/queryparam.cxx
+++ b/sc/source/core/tool/queryparam.cxx
@@ -33,7 +33,7 @@ class FindByField : public std::unary_function<ScQueryEntry, bool>
 {
     SCCOLROW mnField;
 public:
-    FindByField(SCCOLROW nField) : mnField(nField) {}
+    explicit FindByField(SCCOLROW nField) : mnField(nField) {}
     bool operator() (const ScQueryEntry& rEntry) const
     {
         return rEntry.bDoQuery && rEntry.nField == mnField;
diff --git a/sc/source/core/tool/rangelst.cxx b/sc/source/core/tool/rangelst.cxx
index 8942f87..ac68550 100644
--- a/sc/source/core/tool/rangelst.cxx
+++ b/sc/source/core/tool/rangelst.cxx
@@ -41,7 +41,7 @@ template<typename T>
 class FindEnclosingRange : public ::std::unary_function<ScRange*, bool>
 {
 public:
-    FindEnclosingRange(const T& rTest) : mrTest(rTest) {}
+    explicit FindEnclosingRange(const T& rTest) : mrTest(rTest) {}
     FindEnclosingRange(const FindEnclosingRange& r) : mrTest(r.mrTest) {}
     bool operator() (const ScRange* pRange) const
     {
@@ -69,7 +69,7 @@ template<typename T>
 class FindIntersectingRange : public ::std::unary_function<ScRange*, bool>
 {
 public:
-    FindIntersectingRange(const T& rTest) : mrTest(rTest) {}
+    explicit FindIntersectingRange(const T& rTest) : mrTest(rTest) {}
     FindIntersectingRange(const FindIntersectingRange& r) : mrTest(r.mrTest) {}
     bool operator() (const ScRange* pRange) const
     {
@@ -82,7 +82,7 @@ private:
 class AppendToList : public ::std::unary_function<const ScRange*, void>
 {
 public:
-    AppendToList(vector<ScRange*>& rRanges) : mrRanges(rRanges) {}
+    explicit AppendToList(vector<ScRange*>& rRanges) : mrRanges(rRanges) {}
     AppendToList(const AppendToList& r) : mrRanges(r.mrRanges) {}
     void operator() (const ScRange* p)
     {
diff --git a/sc/source/core/tool/rangenam.cxx b/sc/source/core/tool/rangenam.cxx
index 2e16a4c..faf482d 100644
--- a/sc/source/core/tool/rangenam.cxx
+++ b/sc/source/core/tool/rangenam.cxx
@@ -666,7 +666,7 @@ class MatchByRange : public unary_function<ScRangeData, bool>
 {
     const ScRange& mrRange;
 public:
-    MatchByRange(const ScRange& rRange) : mrRange(rRange) {}
+    explicit MatchByRange(const ScRange& rRange) : mrRange(rRange) {}
     bool operator() ( boost::ptr_container_detail::ref_pair<OUString, const ScRangeData* const> const& r) const
     {
         return r.second->IsRangeAtBlock(mrRange);
diff --git a/sc/source/core/tool/scmatrix.cxx b/sc/source/core/tool/scmatrix.cxx
index b3f5f84..16dd4ee 100644
--- a/sc/source/core/tool/scmatrix.cxx
+++ b/sc/source/core/tool/scmatrix.cxx
@@ -1166,7 +1166,7 @@ class CountElements : std::unary_function<MatrixImplType::element_block_node_typ
     size_t mnCount;
     bool mbCountString;
 public:
-    CountElements(bool bCountString) : mnCount(0), mbCountString(bCountString) {}
+    explicit CountElements(bool bCountString) : mnCount(0), mbCountString(bCountString) {}
 
     size_t getCount() const { return mnCount; }
 
diff --git a/sc/source/filter/excel/xistyle.cxx b/sc/source/filter/excel/xistyle.cxx
index 8ffc79e..c95245e 100644
--- a/sc/source/filter/excel/xistyle.cxx
+++ b/sc/source/filter/excel/xistyle.cxx
@@ -74,7 +74,7 @@ typedef ::std::vector< ColorData > ColorDataVec;
 class PaletteIndex : public XIndexAccess_BASE
 {
 public:
-    PaletteIndex( const ColorDataVec& rColorDataTable ) : maColorData( rColorDataTable ) {}
+    explicit PaletteIndex( const ColorDataVec& rColorDataTable ) : maColorData( rColorDataTable ) {}
 
     // Methods XIndexAccess
     virtual ::sal_Int32 SAL_CALL getCount() throw (uno::RuntimeException, std::exception) override
diff --git a/sc/source/filter/excel/xltoolbar.hxx b/sc/source/filter/excel/xltoolbar.hxx
index bd04117..03dface 100644
--- a/sc/source/filter/excel/xltoolbar.hxx
+++ b/sc/source/filter/excel/xltoolbar.hxx
@@ -54,7 +54,7 @@ class ScCTB : public TBBase
     sal_uInt32 ectbid;
     std::vector< ScTBC > rTBC;
 public:
-    ScCTB(sal_uInt16);
+    explicit ScCTB(sal_uInt16);
     virtual ~ScCTB(){}
 #if OSL_DEBUG_LEVEL > 1
     virtual void Print( FILE* ) override;
diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx
index 220ca50..b7b01db 100644
--- a/sc/source/filter/html/htmlpars.cxx
+++ b/sc/source/filter/html/htmlpars.cxx
@@ -3112,7 +3112,7 @@ class CSSHandler
 
     ScHTMLStyles& mrStyles;
 public:
-    CSSHandler(ScHTMLStyles& rStyles) : mrStyles(rStyles) {}
+    explicit CSSHandler(ScHTMLStyles& rStyles) : mrStyles(rStyles) {}
 
     static void at_rule_name(const char* /*p*/, size_t /*n*/)
     {
diff --git a/sc/source/filter/oox/formulabuffer.cxx b/sc/source/filter/oox/formulabuffer.cxx
index b1bd174..58507f8 100644
--- a/sc/source/filter/oox/formulabuffer.cxx
+++ b/sc/source/filter/oox/formulabuffer.cxx
@@ -59,7 +59,7 @@ public:
         Item() : mnRow(-1), mpCell(NULL) {}
     };
 
-    CachedTokenArray( ScDocument& rDoc ) :
+    explicit CachedTokenArray( ScDocument& rDoc ) :
         maCxt(&rDoc, formula::FormulaGrammar::GRAM_OOXML) {}
 
     ~CachedTokenArray()
diff --git a/sc/source/filter/oox/revisionfragment.cxx b/sc/source/filter/oox/revisionfragment.cxx
index 1a00c6f..08d2579 100644
--- a/sc/source/filter/oox/revisionfragment.cxx
+++ b/sc/source/filter/oox/revisionfragment.cxx
@@ -325,7 +325,7 @@ struct RevisionLogFragment::Impl
 
     bool mbEndOfList;
 
-    Impl( ScChangeTrack& rChangeTrack ) :
+    explicit Impl( ScChangeTrack& rChangeTrack ) :
         mrChangeTrack(rChangeTrack),
         mnRevIndex(-1),
         mnSheetIndex(-1),
diff --git a/sc/source/filter/oox/workbookfragment.cxx b/sc/source/filter/oox/workbookfragment.cxx
index abd63b07..fbddd74 100644
--- a/sc/source/filter/oox/workbookfragment.cxx
+++ b/sc/source/filter/oox/workbookfragment.cxx
@@ -262,7 +262,7 @@ class ProgressBarTimer : Timer
         double mfPosition;
         ISegmentProgressBarRef mxWrapped;
     public:
-        ProgressWrapper(const ISegmentProgressBarRef &xRef)
+        explicit ProgressWrapper(const ISegmentProgressBarRef &xRef)
             : mfPosition(0.0)
             , mxWrapped(xRef)
         {
diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx
index 25d1475..be14ec8 100644
--- a/sc/source/filter/orcus/interface.cxx
+++ b/sc/source/filter/orcus/interface.cxx
@@ -82,7 +82,7 @@ class FindSheetByIndex : std::unary_function<ScOrcusSheet, bool>
 {
     SCTAB mnTab;
 public:
-    FindSheetByIndex(SCTAB nTab) : mnTab(nTab) {}
+    explicit FindSheetByIndex(SCTAB nTab) : mnTab(nTab) {}
     bool operator() (const ScOrcusSheet& rSheet) const
     {
         return rSheet.getIndex() == mnTab;
diff --git a/sc/source/filter/orcus/xmlcontext.cxx b/sc/source/filter/orcus/xmlcontext.cxx
index 0ee24a8..284d7cc 100644
--- a/sc/source/filter/orcus/xmlcontext.cxx
+++ b/sc/source/filter/orcus/xmlcontext.cxx
@@ -129,7 +129,7 @@ class TreeUpdateSwitch
 {
     SvTreeListBox& mrTreeCtrl;
 public:
-    TreeUpdateSwitch(SvTreeListBox& rTreeCtrl) : mrTreeCtrl(rTreeCtrl)
+    explicit TreeUpdateSwitch(SvTreeListBox& rTreeCtrl) : mrTreeCtrl(rTreeCtrl)
     {
         mrTreeCtrl.SetUpdateMode(false);
     }
@@ -144,7 +144,7 @@ class InsertFieldPath : std::unary_function<OString, void>
 {
     orcus::orcus_xml& mrFilter;
 public:
-    InsertFieldPath(orcus::orcus_xml& rFilter) : mrFilter(rFilter) {}
+    explicit InsertFieldPath(orcus::orcus_xml& rFilter) : mrFilter(rFilter) {}
     void operator() (const OString& rPath)
     {
         mrFilter.append_field_link(rPath.getStr());
diff --git a/sc/source/filter/xcl97/XclExpChangeTrack.cxx b/sc/source/filter/xcl97/XclExpChangeTrack.cxx
index 2c4bb45..6ba163c 100644
--- a/sc/source/filter/xcl97/XclExpChangeTrack.cxx
+++ b/sc/source/filter/xcl97/XclExpChangeTrack.cxx
@@ -1398,7 +1398,7 @@ class EndXmlElement : public ExcXmlRecord
 {
     sal_Int32           mnElement;
 public:
-                        EndXmlElement( sal_Int32 nElement ) : mnElement( nElement) {}
+    explicit            EndXmlElement( sal_Int32 nElement ) : mnElement( nElement) {}
     virtual void        SaveXml( XclExpXmlStream& rStrm ) override;
 };
 
diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx
index 51c7243..31acde1 100644
--- a/sc/source/filter/xcl97/xcl97rec.cxx
+++ b/sc/source/filter/xcl97/xcl97rec.cxx
@@ -1131,8 +1131,8 @@ bool transformURL(const OUString& rOldURL, OUString& rNewURL, ScDocument* pDoc)
 class ScURLTransformer : public oox::drawingml::URLTransformer
 {
 public:
-    ScURLTransformer(ScDocument& rDoc):
-        mrDoc(rDoc)
+    explicit ScURLTransformer(ScDocument& rDoc)
+        : mrDoc(rDoc)
     {
     }
 
diff --git a/sc/source/filter/xml/XMLChangeTrackingExportHelper.hxx b/sc/source/filter/xml/XMLChangeTrackingExportHelper.hxx
index 75c9075..e0f172f 100644
--- a/sc/source/filter/xml/XMLChangeTrackingExportHelper.hxx
+++ b/sc/source/filter/xml/XMLChangeTrackingExportHelper.hxx
@@ -78,7 +78,7 @@ class ScChangeTrackingExportHelper
     void CollectActionAutoStyles(ScChangeAction* pAction);
     void WorkWithChangeAction(ScChangeAction* pAction);
 public:
-    ScChangeTrackingExportHelper(ScXMLExport& rExport);
+    explicit ScChangeTrackingExportHelper(ScXMLExport& rExport);
     ~ScChangeTrackingExportHelper();
 
     void CollectAutoStyles();
diff --git a/sc/source/filter/xml/XMLChangeTrackingImportHelper.hxx b/sc/source/filter/xml/XMLChangeTrackingImportHelper.hxx
index 95cd28a..bab373b 100644
--- a/sc/source/filter/xml/XMLChangeTrackingImportHelper.hxx
+++ b/sc/source/filter/xml/XMLChangeTrackingImportHelper.hxx
@@ -124,13 +124,13 @@ struct ScMyBaseAction
     ScChangeActionType nActionType;
     ScChangeActionState nActionState;
 
-    ScMyBaseAction(const ScChangeActionType nActionType);
+    explicit ScMyBaseAction(const ScChangeActionType nActionType);
     virtual ~ScMyBaseAction();
 };
 
 struct ScMyInsAction : public ScMyBaseAction
 {
-    ScMyInsAction(const ScChangeActionType nActionType);
+    explicit ScMyInsAction(const ScChangeActionType nActionType);
     virtual ~ScMyInsAction();
 };
 
@@ -141,7 +141,7 @@ struct ScMyDelAction : public ScMyBaseAction
     ScMyMoveCutOffs aMoveCutOffs;
     sal_Int32 nD;
 
-    ScMyDelAction(const ScChangeActionType nActionType);
+    explicit ScMyDelAction(const ScChangeActionType nActionType);
     virtual ~ScMyDelAction();
 };
 
diff --git a/sc/source/filter/xml/XMLCodeNameProvider.hxx b/sc/source/filter/xml/XMLCodeNameProvider.hxx
index 3cd6459..b135ac7 100644
--- a/sc/source/filter/xml/XMLCodeNameProvider.hxx
+++ b/sc/source/filter/xml/XMLCodeNameProvider.hxx
@@ -35,7 +35,7 @@ class XMLCodeNameProvider : public ::cppu::WeakImplHelper< css::container::XName
                            OUString& rCodeName );
 
 public:
-    XMLCodeNameProvider( ScDocument* pDoc );
+    explicit XMLCodeNameProvider(ScDocument* pDoc);
     virtual ~XMLCodeNameProvider();
 
     virtual sal_Bool SAL_CALL hasByName( const OUString& aName )
diff --git a/sc/source/filter/xml/XMLExportDDELinks.hxx b/sc/source/filter/xml/XMLExportDDELinks.hxx
index cf1cb40..2360ef5 100644
--- a/sc/source/filter/xml/XMLExportDDELinks.hxx
+++ b/sc/source/filter/xml/XMLExportDDELinks.hxx
@@ -32,7 +32,7 @@ class ScXMLExportDDELinks
     void                WriteCell(const ScMatrixValue& aVal, sal_Int32 nRepeat);
     void                WriteTable(const sal_Int32 nPos);
 public:
-    ScXMLExportDDELinks(ScXMLExport& rExport);
+    explicit ScXMLExportDDELinks(ScXMLExport& rExport);
     ~ScXMLExportDDELinks();
     void WriteDDELinks(css::uno::Reference < css::sheet::XSpreadsheetDocument >& xSpreadDoc);
 };
diff --git a/sc/source/filter/xml/XMLExportDataPilot.hxx b/sc/source/filter/xml/XMLExportDataPilot.hxx
index ab93df6..bf3bf3a 100644
--- a/sc/source/filter/xml/XMLExportDataPilot.hxx
+++ b/sc/source/filter/xml/XMLExportDataPilot.hxx
@@ -63,7 +63,7 @@ class ScXMLExportDataPilot
     void WriteGrandTotal(::xmloff::token::XMLTokenEnum eOrient, bool bVisible, const OUString* pGrandTotal);
 
 public:
-    ScXMLExportDataPilot(ScXMLExport& rExport);
+    explicit ScXMLExportDataPilot(ScXMLExport& rExport);
     ~ScXMLExportDataPilot();
     void WriteDataPilots(const css::uno::Reference <css::sheet::XSpreadsheetDocument>& xSpreaDoc);
 };
diff --git a/sc/source/filter/xml/XMLExportDatabaseRanges.cxx b/sc/source/filter/xml/XMLExportDatabaseRanges.cxx
index ab82d5f..a543657 100644
--- a/sc/source/filter/xml/XMLExportDatabaseRanges.cxx
+++ b/sc/source/filter/xml/XMLExportDatabaseRanges.cxx
@@ -427,7 +427,7 @@ private:
     {
         ScXMLExport& mrExport;
     public:
-        WriteSetItem(ScXMLExport& r) : mrExport(r) {}
+        explicit WriteSetItem(ScXMLExport& r) : mrExport(r) {}
         void operator() (const ScQueryEntry::Item& rItem) const
         {
             mrExport.AddAttribute(XML_NAMESPACE_TABLE, XML_VALUE, rItem.maString.getString());
diff --git a/sc/source/filter/xml/XMLExportDatabaseRanges.hxx b/sc/source/filter/xml/XMLExportDatabaseRanges.hxx
index ba6fd5b6..134bbe3 100644
--- a/sc/source/filter/xml/XMLExportDatabaseRanges.hxx
+++ b/sc/source/filter/xml/XMLExportDatabaseRanges.hxx
@@ -31,7 +31,7 @@ class ScXMLExportDatabaseRanges
     ScDocument*     pDoc;
 
 public:
-    ScXMLExportDatabaseRanges(ScXMLExport& rExport);
+    explicit ScXMLExportDatabaseRanges(ScXMLExport& rExport);
     ~ScXMLExportDatabaseRanges();
     ScMyEmptyDatabaseRangesContainer GetEmptyDatabaseRanges();
     void WriteDatabaseRanges();
diff --git a/sc/source/filter/xml/XMLExportIterator.hxx b/sc/source/filter/xml/XMLExportIterator.hxx
index 31a232a..1036136 100644
--- a/sc/source/filter/xml/XMLExportIterator.hxx
+++ b/sc/source/filter/xml/XMLExportIterator.hxx

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list