[Libreoffice-commits] core.git: config_host.mk.in configure.ac download.lst external/libqxp external/Module_external.mk filter/Configuration_filter.mk filter/source Makefile.fetch RepositoryExternal.m
Makefile.fetch |1 RepositoryExternal.mk | 33 +++ config_host.mk.in |3 configure.ac|2 download.lst|2 external/Module_external.mk |1 external/libqxp/0001-add-missing-includes.patch.1 | 37 external/libqxp/0001-don-t-use-RVNGStringStream-in-the-main-lib.patch.1 | 89 ++ external/libqxp/ExternalProject_libqxp.mk | 45 + external/libqxp/Makefile|7 external/libqxp/Module_libqxp.mk| 17 + external/libqxp/README |4 external/libqxp/UnpackedTarball_libqxp.mk | 29 +++ external/libqxp/ubsan-visibility.patch | 11 + filter/Configuration_filter.mk |2 filter/source/config/fragments/filters/QXPDocument.xcu | 13 + filter/source/config/fragments/types/draw_QXP_Document.xcu | 12 + writerperfect/Library_wpftdraw.mk |2 writerperfect/source/draw/QXPImportFilter.cxx | 66 +++ writerperfect/source/draw/QXPImportFilter.hxx | 38 writerperfect/source/draw/wpftdraw.component|5 21 files changed, 419 insertions(+) New commits: commit e59b5b1fc7266d56a17e387b8df0f6d6956e8ea5 Author: Aleksas Pantechovskis <alex.pan...@gmail.com> Date: Sun Aug 27 22:10:14 2017 +0300 integrate libqxp Change-Id: Ic7479b82d09c1e36d28267434a77bf4bc158adfa Reviewed-on: https://gerrit.libreoffice.org/41612 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: David Tardon <dtar...@redhat.com> diff --git a/Makefile.fetch b/Makefile.fetch index e93af0bb5e48..9194164be33f 100644 --- a/Makefile.fetch +++ b/Makefile.fetch @@ -197,6 +197,7 @@ $(WORKDIR)/download: $(BUILDDIR)/config_$(gb_Side).mk $(SRCDIR)/download.lst $(S $(call fetch_Optional,POPPLER,POPPLER_TARBALL) \ $(call fetch_Optional,POSTGRESQL,POSTGRESQL_TARBALL) \ $(call fetch_Optional,PYTHON,PYTHON_TARBALL) \ + $(call fetch_Optional,QXP,QXP_TARBALL) \ $(call fetch_Optional,REDLAND,RAPTOR_TARBALL) \ $(call fetch_Optional,REDLAND,RASQAL_TARBALL) \ $(call fetch_Optional,REDLAND,REDLAND_TARBALL) \ diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk index d511d51cebcc..2db2ebfb3d81 100644 --- a/RepositoryExternal.mk +++ b/RepositoryExternal.mk @@ -1991,6 +1991,39 @@ endef endif # SYSTEM_PAGEMAKER +ifneq ($(SYSTEM_QXP),) + +define gb_LinkTarget__use_qxp +$(call gb_LinkTarget_set_include,$(1),\ + $$(INCLUDE) \ +$(QXP_CFLAGS) \ +) +$(call gb_LinkTarget_add_libs,$(1),$(QXP_LIBS)) + +endef +gb_ExternalProject__use_qxp := + +else # !SYSTEM_QXP + +define gb_LinkTarget__use_qxp +$(call gb_LinkTarget_set_include,$(1),\ + -I$(call gb_UnpackedTarball_get_dir,libqxp)/inc \ + $$(INCLUDE) \ +) +$(call gb_LinkTarget_add_libs,$(1),\ + $(call gb_UnpackedTarball_get_dir,libqxp)/src/lib/.libs/libqxp-0.0$(gb_StaticLibrary_PLAINEXT) \ +) +$(call gb_LinkTarget_use_external_project,$(1),libqxp) + +endef +define gb_ExternalProject__use_qxp +$(call gb_ExternalProject_use_external_project,$(1),libqxp) + +endef + +endif # SYSTEM_QXP + + ifneq ($(SYSTEM_ZMF),) define gb_LinkTarget__use_zmf diff --git a/config_host.mk.in b/config_host.mk.in index 71993077899a..e125bd90641f 100644 --- a/config_host.mk.in +++ b/config_host.mk.in @@ -457,6 +457,8 @@ export PYTHON_LIBS=$(gb_SPACE)@PYTHON_LIBS@ export PYTHON_VERSION=@PYTHON_VERSION@ export PYTHON_VERSION_MAJOR=@PYTHON_VERSION_MAJOR@ export PYTHON_VERSION_MINOR=@PYTHON_VERSION_MINOR@ +export QXP_CFLAGS=$(gb_SPACE)@QXP_CFLAGS@ +export QXP_LIBS=$(gb_SPACE)@QXP_LIBS@ export RANLIB=@RANLIB@ export RAPTOR_MAJOR=@RAPTOR_MAJOR@ export RASQAL_MAJOR=@RASQAL_MAJOR@ @@ -556,6 +558,7 @@ export SYSTEM_PAGEMAKER=@SYSTEM_PAGEMAKER@ export SYSTEM_POPPLER=@SYSTEM_POPPLER@ export SYSTEM_POSTGRESQL=@SYSTEM_POSTGRESQL@ export SYSTEM_PYTHON=@SYSTEM_PYTHON@ +export SYSTEM_QXP=@SYSTEM_QXP@ export SYSTEM_REDLAND=@SYSTEM_REDLAND@ export SYSTEM_REVENGE=@SYSTEM_REVENGE@ export SYSTEM_RHINO=@SYSTEM_RHINO@ diff --git a/configure.ac b/configure.ac index 1a8f2f9c9f84..81a3ac0877ef 100644 --- a/configure.ac +++ b/configure.ac @@ -7776,6 +7776,8 @@ libo_CHECK_SYSTEM_MODULE([libabw],[ABW],[libabw-0.1]) libo_CHECK_SYSTEM_MODULE([libpag
[Libreoffice-commits] core.git: config_host.mk.in configure.ac download.lst external/libzmf external/Module_external.mk filter/Configuration_filter.mk filter/source Makefile.fetch RepositoryExternal.m
Makefile.fetch |1 RepositoryExternal.mk | 33 ++ config_host.mk.in |3 configure.ac |5 download.lst |2 external/Module_external.mk|1 external/libzmf/ExternalProject_libzmf.mk | 43 external/libzmf/Makefile |7 + external/libzmf/Module_libzmf.mk | 17 +++ external/libzmf/README |6 + external/libzmf/UnpackedTarball_libzmf.mk | 24 external/libzmf/ubsan-visibility.patch | 11 ++ filter/Configuration_filter.mk |2 filter/source/config/fragments/filters/ZMFDocument.xcu | 13 ++ filter/source/config/fragments/types/draw_ZMF_Document.xcu | 12 ++ writerperfect/Library_wpftdraw.mk |2 writerperfect/source/draw/ZMFImportFilter.cxx | 69 + writerperfect/source/draw/ZMFImportFilter.hxx | 41 +++ writerperfect/source/draw/wpftdraw.component |5 19 files changed, 297 insertions(+) New commits: commit aaed6fe55a67ee3e92bedf9eed2e2f7c044be19d Author: Aleksas Pantechovskis <alex.pan...@gmail.com> Date: Wed Jun 22 19:02:29 2016 +0300 integrate libzmf Change-Id: I0c7ea5b56ea4ed4839ff38798c0b915aaca81774 Reviewed-on: https://gerrit.libreoffice.org/26574 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: David Tardon <dtar...@redhat.com> diff --git a/Makefile.fetch b/Makefile.fetch index 3884f7f..e78ad98 100644 --- a/Makefile.fetch +++ b/Makefile.fetch @@ -209,6 +209,7 @@ $(WORKDIR)/download: $(BUILDDIR)/config_host.mk $(SRCDIR)/download.lst $(SRCDIR) $(call fetch_Optional,WPS,WPS_TARBALL) \ $(call fetch_Optional,XSLTML,XSLTML_TARBALL) \ $(call fetch_Optional,ZLIB,ZLIB_TARBALL) \ + $(call fetch_Optional,ZMF,ZMF_TARBALL) \ ,$(call fetch_Download_item,http://dev-www.libreoffice.org/src,$(item))) $(foreach item, \ $(call fetch_Optional,DBGHELP,DBGHELP_DLL) \ diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk index 62d3bfd..04546e5 100644 --- a/RepositoryExternal.mk +++ b/RepositoryExternal.mk @@ -2001,6 +2001,39 @@ endef endif # SYSTEM_PAGEMAKER +ifneq ($(SYSTEM_ZMF),) + +define gb_LinkTarget__use_zmf +$(call gb_LinkTarget_set_include,$(1),\ + $$(INCLUDE) \ +$(ZMF_CFLAGS) \ +) +$(call gb_LinkTarget_add_libs,$(1),$(ZMF_LIBS)) + +endef +gb_ExternalProject__use_zmf := + +else # !SYSTEM_ZMF + +define gb_LinkTarget__use_zmf +$(call gb_LinkTarget_set_include,$(1),\ + -I$(call gb_UnpackedTarball_get_dir,libzmf)/inc \ + $$(INCLUDE) \ +) +$(call gb_LinkTarget_add_libs,$(1),\ + $(call gb_UnpackedTarball_get_dir,libzmf)/src/lib/.libs/libzmf-0.0$(gb_StaticLibrary_PLAINEXT) \ +) +$(call gb_LinkTarget_use_external_project,$(1),libzmf) + +endef +define gb_ExternalProject__use_zmf +$(call gb_ExternalProject_use_external_project,$(1),libzmf) + +endef + +endif # SYSTEM_ZMF + + ifneq ($(SYSTEM_VISIO),) define gb_LinkTarget__use_visio diff --git a/config_host.mk.in b/config_host.mk.in index 620df66..04613e1 100644 --- a/config_host.mk.in +++ b/config_host.mk.in @@ -585,6 +585,7 @@ export SYSTEM_WPD=@SYSTEM_WPD@ export SYSTEM_WPG=@SYSTEM_WPG@ export SYSTEM_WPS=@SYSTEM_WPS@ export SYSTEM_ZLIB=@SYSTEM_ZLIB@ +export SYSTEM_ZMF=@SYSTEM_ZMF@ export TARFILE_LOCATION=@TARFILE_LOCATION@ export TDE_CFLAGS=$(gb_SPACE)@TDE_CFLAGS@ export TDE_LIBS=$(gb_SPACE)@TDE_LIBS@ @@ -655,6 +656,8 @@ export XRENDER_LIBS=$(gb_SPACE)@XRENDER_LIBS@ export XSLTPROC=@XSLTPROC@ export ZLIB_CFLAGS=$(gb_SPACE)@ZLIB_CFLAGS@ export ZLIB_LIBS=$(gb_SPACE)@ZLIB_LIBS@ +export ZMF_CFLAGS=$(gb_SPACE)@ZMF_CFLAGS@ +export ZMF_LIBS=$(gb_SPACE)@ZMF_LIBS@ # lang-related stuff include $(BUILDDIR)/config_$(gb_Side)_lang.mk diff --git a/configure.ac b/configure.ac index 590e326..c5e484b 100644 --- a/configure.ac +++ b/configure.ac @@ -7873,6 +7873,11 @@ dnl === libo_CHECK_SYSTEM_MODULE([libpagemaker],[PAGEMAKER],[libpagemaker-0.0]) dnl === +dnl Check for system libzmf +dnl === +libo_CHECK_SYSTEM_MODULE([libzmf],[ZMF],[libzmf-0.0]) + +dnl === dnl Check for system libvisio dnl === libo_CHECK_SYSTEM_MODULE([libvisio],[VISIO],[libvisio-0.1]) diff --git a/download.lst b/download.lst inde
[Libreoffice-commits] core.git: sc/source
sc/source/ui/view/spelleng.cxx | 19 +-- sc/source/ui/view/viewfunc.cxx |9 + 2 files changed, 18 insertions(+), 10 deletions(-) New commits: commit e3e0ac4d3d3d7f701618358ccbb3d667683c6b20 Author: Aleksas Pantechovskis <alex.pan...@gmail.com> Date: Wed Mar 30 23:05:19 2016 +0300 tdf#98893 Remove expensive calls to GetCellType + GetValue/... in calc Change-Id: If8aa0158c60d5727d9bdd66aa351c50c987c3e5f Reviewed-on: https://gerrit.libreoffice.org/23662 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com> diff --git a/sc/source/ui/view/spelleng.cxx b/sc/source/ui/view/spelleng.cxx index 871de86..ffb20f5 100644 --- a/sc/source/ui/view/spelleng.cxx +++ b/sc/source/ui/view/spelleng.cxx @@ -34,6 +34,8 @@ #include "spelldialog.hxx" #include "tabvwsh.hxx" #include "docsh.hxx" +#include "cellvalue.hxx" +#include "cellform.hxx" #include "formulacell.hxx" #include "patattr.hxx" #include "waitoff.hxx" @@ -247,19 +249,24 @@ void ScConversionEngineBase::FillFromCell( SCCOL nCol, SCROW nRow, SCTAB nTab ) { ScAddress aPos(nCol, nRow, nTab); -switch (mrDoc.GetCellType(aPos)) +ScRefCellValue aCell(mrDoc, aPos); +switch (aCell.meType) { case CELLTYPE_STRING: { -OUString aText = mrDoc.GetString(aPos); -SetText( aText ); +SvNumberFormatter* pFormatter = mrDoc.GetFormatTable(); +sal_uLong nNumFmt = mrDoc.GetNumberFormat(aPos); +OUString aText; +Color* pColor; +ScCellFormat::GetString(aCell, nNumFmt, aText, , *pFormatter, ); + +SetText(aText); } break; case CELLTYPE_EDIT: { -const EditTextObject* pNewEditObj = mrDoc.GetEditText(aPos); -if (pNewEditObj) -SetText(*pNewEditObj); +const EditTextObject* pNewEditObj = aCell.mpEditText; +SetText(*pNewEditObj); } break; default: diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index f43695d..2e26c66 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -1189,13 +1189,14 @@ void ScViewFunc::ApplySelectionPattern( const ScPatternAttr& rAttr, bool bCursor EditTextObject* pOldEditData = nullptr; EditTextObject* pNewEditData = nullptr; ScAddress aPos(nCol, nRow, nTab); -if (rDoc.GetCellType(aPos) == CELLTYPE_EDIT) +ScRefCellValue aCell(rDoc, aPos); +if (aCell.meType == CELLTYPE_EDIT) { -const EditTextObject* pEditObj = rDoc.GetEditText(aPos); -pOldEditData = pEditObj ? pEditObj->Clone() : nullptr; +const EditTextObject* pEditObj = aCell.mpEditText; +pOldEditData = pEditObj->Clone(); rDoc.RemoveEditTextCharAttribs(aPos, rAttr); pEditObj = rDoc.GetEditText(aPos); -pNewEditData = pEditObj ? pEditObj->Clone() : nullptr; +pNewEditData = pEditObj->Clone(); } aChangeRanges.Append(aPos); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sc/source
sc/source/filter/excel/xicontent.cxx | 16 --- sc/source/filter/rtf/rtfexp.cxx | 15 +++--- sc/source/filter/xml/xmlcelli.cxx | 33 +++--- sc/source/ui/Accessibility/AccessibleCell.cxx | 18 --- sc/source/ui/Accessibility/AccessibleText.cxx | 11 ++-- sc/source/ui/app/transobj.cxx | 17 +-- sc/source/ui/docshell/impex.cxx | 59 ++ sc/source/ui/unoobj/cellsuno.cxx | 17 --- sc/source/ui/unoobj/chart2uno.cxx |9 +-- sc/source/ui/unoobj/textuno.cxx | 13 +++-- 10 files changed, 117 insertions(+), 91 deletions(-) New commits: commit fa7416a6af4b40d9223c27ce58e66b69bdd53fd1 Author: Aleksas Pantechovskis <alex.pan...@gmail.com> Date: Mon Mar 28 00:16:42 2016 +0300 tdf#98893 Remove expensive calls to GetCellType + GetValue/... in calc Change-Id: Ie9a16fa1b44d41cc9d10b50c37ba15f3b7e786c8 Reviewed-on: https://gerrit.libreoffice.org/23561 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com> diff --git a/sc/source/filter/excel/xicontent.cxx b/sc/source/filter/excel/xicontent.cxx index 69ecaa6..a7a857a 100644 --- a/sc/source/filter/excel/xicontent.cxx +++ b/sc/source/filter/excel/xicontent.cxx @@ -37,6 +37,8 @@ #include #include #include "stringutil.hxx" +#include "cellform.hxx" +#include "cellvalue.hxx" #include "document.hxx" #include "editutil.hxx" #include "formulacell.hxx" @@ -163,23 +165,27 @@ void lclInsertUrl( XclImpRoot& rRoot, const OUString& rUrl, SCCOL nScCol, SCROW { ScDocumentImport& rDoc = rRoot.GetDocImport(); ScAddress aScPos( nScCol, nScRow, nScTab ); -CellType eCellType = rDoc.getDoc().GetCellType(aScPos); -switch( eCellType ) +ScRefCellValue aCell(rDoc.getDoc(), aScPos); +switch( aCell.meType ) { // #i54261# hyperlinks in string cells case CELLTYPE_STRING: case CELLTYPE_EDIT: { -OUString aDisplText = rDoc.getDoc().GetString(nScCol, nScRow, nScTab); +sal_uLong nNumFmt = rDoc.getDoc().GetNumberFormat(aScPos); +SvNumberFormatter* pFormatter = rDoc.getDoc().GetFormatTable(); +Color* pColor; +OUString aDisplText; +ScCellFormat::GetString(aCell, nNumFmt, aDisplText, , *pFormatter, ()); if (aDisplText.isEmpty()) aDisplText = rUrl; ScEditEngineDefaulter& rEE = rRoot.GetEditEngine(); SvxURLField aUrlField( rUrl, aDisplText, SVXURLFORMAT_APPDEFAULT ); -const EditTextObject* pEditObj = rDoc.getDoc().GetEditText(aScPos); -if( pEditObj ) +if( aCell.meType == CELLTYPE_EDIT ) { +const EditTextObject* pEditObj = aCell.mpEditText; rEE.SetText( *pEditObj ); rEE.QuickInsertField( SvxFieldItem( aUrlField, EE_FEATURE_FIELD ), ESelection( 0, 0, EE_PARA_ALL, 0 ) ); } diff --git a/sc/source/filter/rtf/rtfexp.cxx b/sc/source/filter/rtf/rtfexp.cxx index 4c16276..c2d065d 100644 --- a/sc/source/filter/rtf/rtfexp.cxx +++ b/sc/source/filter/rtf/rtfexp.cxx @@ -33,6 +33,7 @@ #include "rtfexp.hxx" #include "filter.hxx" +#include "cellvalue.hxx" #include "document.hxx" #include "patattr.hxx" #include "attrib.hxx" @@ -165,7 +166,8 @@ void ScRTFExport::WriteCell( SCTAB nTab, SCROW nRow, SCCOL nCol ) bool bValueData = false; OUString aContent; ScAddress aPos(nCol, nRow, nTab); -switch (pDoc->GetCellType(aPos)) +ScRefCellValue aCell(*pDoc, aPos); +switch (aCell.meType) { case CELLTYPE_NONE: bValueData = false; @@ -173,13 +175,10 @@ void ScRTFExport::WriteCell( SCTAB nTab, SCROW nRow, SCCOL nCol ) case CELLTYPE_EDIT: { bValueData = false; -const EditTextObject* pObj = pDoc->GetEditText(aPos); -if (pObj) -{ -EditEngine& rEngine = GetEditEngine(); -rEngine.SetText(*pObj); -aContent = rEngine.GetText(); // LineFeed in between paragraphs! -} +const EditTextObject* pObj = aCell.mpEditText; +EditEngine& rEngine = GetEditEngine(); +rEngine.SetText(*pObj); +aContent = rEngine.GetText(); // LineFeed in between paragraphs! } break; default: diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx index 6fbad6d..556d4ab 100644 --- a/sc/source/filter/xml/xmlcelli.cxx +++ b/sc/source/filter/xml/xmlcelli.cxx @@ -23,6 +23,7 @@ #include "xmlstyli.hxx" #include "xmlannoi.hxx" #include "global.hxx"
[Libreoffice-commits] core.git: sal/inc sal/Library_sal.mk sal/osl
sal/Library_sal.mk|1 sal/inc/internal/signalshared.hxx | 47 sal/osl/all/signalshared.cxx | 177 sal/osl/unx/signal.cxx| 209 +++--- sal/osl/w32/signal.cxx| 207 ++--- 5 files changed, 302 insertions(+), 339 deletions(-) New commits: commit 97858ca008fd8cf405e52795c8db415ef6c5afb3 Author: Aleksas Pantechovskis <alex.pan...@gmail.com> Date: Sat Mar 26 14:36:40 2016 +0200 tdf#93548 Refactor sal signal to reduce code duplication Change-Id: Iff331a48fadc23da8b24f9ca3a841000313a03dd Reviewed-on: https://gerrit.libreoffice.org/23477 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Stephan Bergmann <sberg...@redhat.com> diff --git a/sal/Library_sal.mk b/sal/Library_sal.mk index ed2e914..2eb4cb2 100644 --- a/sal/Library_sal.mk +++ b/sal/Library_sal.mk @@ -87,6 +87,7 @@ $(eval $(call gb_Library_add_exception_objects,sal,\ sal/osl/all/filepath \ sal/osl/all/loadmodulerelative \ sal/osl/all/log \ + sal/osl/all/signalshared \ sal/osl/all/utility \ sal/rtl/alloc_arena \ sal/rtl/alloc_cache \ diff --git a/sal/inc/internal/signalshared.hxx b/sal/inc/internal/signalshared.hxx new file mode 100644 index 000..07f9976 --- /dev/null +++ b/sal/inc/internal/signalshared.hxx @@ -0,0 +1,47 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * 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/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * 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 + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_SAL_INC_INTERNAL_SIGNALSHARED_HXX +#define INCLUDED_SAL_INC_INTERNAL_SIGNALSHARED_HXX + +#include +#include +#include + +struct oslSignalHandlerImpl +{ +oslSignalHandlerFunctionHandler; +void* pData; +oslSignalHandlerImpl* pNext; +}; + +typedef void (*ErrorReportingChangedHandler)(bool); + +extern bool bErrorReportingEnabled; +extern bool bInitSignal; + +void setErrorReportingChangedHandler(ErrorReportingChangedHandler handler); + +oslSignalAction callSignalHandler(oslSignalInfo* pInfo); + +// platform-specific functions that need to be implemented +bool onInitSignal(); +bool onDeInitSignal(); + +#endif + diff --git a/sal/osl/all/signalshared.cxx b/sal/osl/all/signalshared.cxx new file mode 100644 index 000..fcafacd --- /dev/null +++ b/sal/osl/all/signalshared.cxx @@ -0,0 +1,177 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * 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/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * 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 + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include + +#include + +bool bErrorReportingEnabled = true; +bool bInitSignal = false; + +namespace +{ +oslSignalHandlerImpl* SignalList; +oslMutex SignalListMutex; + +ErrorReportingChangedHandler errorReportingChangedHandler; + +bool initSignal() +{ +SignalListMutex = osl_createMutex(); + +return onInitSignal(); +} + +bool deInitSignal() +{ +bool bRet = onDeInitSignal(); + +osl_destroyMutex(SignalListMutex); + +return bRet; +} + +} + +void setErrorReportingChangedHandler(ErrorReportingChangedHandler handler) +{ +errorReportingChangedHandler = handler; +} + +oslSignalAction callSignalHandler(oslSignalInfo* pInfo) +{ +oslSignalHandlerImpl* pHandler = SignalList; +oslSignalAction Action = osl_Signal_ActCallNext
[Libreoffice-commits] core.git: sc/source
sc/source/core/data/colorscale.cxx | 54 - sc/source/core/data/conditio.cxx | 30 ++-- sc/source/core/tool/chartarr.cxx |9 +++--- sc/source/ui/view/tabvwsha.cxx | 22 +++ 4 files changed, 37 insertions(+), 78 deletions(-) New commits: commit 1cc2d4115e7e36f01dde759209802e2ac2477117 Author: Aleksas Pantechovskis <alex.pan...@gmail.com> Date: Sat Mar 26 22:20:15 2016 +0200 tdf#98893 Remove expensive calls to GetCellType + GetValue/... in calc Conflicts: sc/source/core/tool/cellform.cxx Change-Id: Id949800f6e13e268df798d2f1868f26deff66191 Reviewed-on: https://gerrit.libreoffice.org/23543 Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com> Tested-by: Jenkins <c...@libreoffice.org> diff --git a/sc/source/core/data/colorscale.cxx b/sc/source/core/data/colorscale.cxx index f5b4d52..bdf306f 100644 --- a/sc/source/core/data/colorscale.cxx +++ b/sc/source/core/data/colorscale.cxx @@ -413,21 +413,12 @@ std::vector& ScColorFormat::getValues() const for(SCROW nRow = nRowStart; nRow <= nRowEnd; ++nRow) { ScAddress aAddr(nCol, nRow, nTab); -CellType eType = mpDoc->GetCellType(aAddr); -if(eType == CELLTYPE_VALUE) +ScRefCellValue rCell(*mpDoc, aAddr); +if(rCell.hasNumeric()) { -double aVal = mpDoc->GetValue(nCol, nRow, nTab); +double aVal = rCell.getValue(); rValues.push_back(aVal); } -else if(eType == CELLTYPE_FORMULA) -{ -ScFormulaCell *pCell = mpDoc->GetFormulaCell(aAddr); -if (pCell && pCell->IsValue()) -{ -double aVal = mpDoc->GetValue(nCol, nRow, nTab); -rValues.push_back(aVal); -} -} } } } @@ -540,19 +531,12 @@ double ScColorScaleFormat::CalcValue(double nMin, double nMax, ScColorScaleEntri Color* ScColorScaleFormat::GetColor( const ScAddress& rAddr ) const { -CellType eCellType = mpDoc->GetCellType(rAddr); -if(eCellType != CELLTYPE_VALUE && eCellType != CELLTYPE_FORMULA) +ScRefCellValue rCell(*mpDoc, rAddr); +if(!rCell.hasNumeric()) return nullptr; -if (eCellType == CELLTYPE_FORMULA) -{ -ScFormulaCell *pCell = mpDoc->GetFormulaCell(rAddr); -if (!pCell || !pCell->IsValue()) -return nullptr; -} - // now we have for sure a value -double nVal = mpDoc->GetValue(rAddr); +double nVal = rCell.getValue(); if (maColorScales.size() < 2) return nullptr; @@ -796,17 +780,10 @@ double ScDataBarFormat::getMax(double nMin, double nMax) const ScDataBarInfo* ScDataBarFormat::GetDataBarInfo(const ScAddress& rAddr) const { -CellType eCellType = mpDoc->GetCellType(rAddr); -if(eCellType != CELLTYPE_VALUE && eCellType != CELLTYPE_FORMULA) +ScRefCellValue rCell(*mpDoc, rAddr); +if(!rCell.hasNumeric()) return nullptr; -if (eCellType == CELLTYPE_FORMULA) -{ -ScFormulaCell *pCell = mpDoc->GetFormulaCell(rAddr); -if (!pCell || !pCell->IsValue()) -return nullptr; -} - // now we have for sure a value double nValMin = getMinValue(); @@ -816,7 +793,7 @@ ScDataBarInfo* ScDataBarFormat::GetDataBarInfo(const ScAddress& rAddr) const double nMinLength = mpFormatData->mnMinLength; double nMaxLength = mpFormatData->mnMaxLength; -double nValue = mpDoc->GetValue(rAddr); +double nValue = rCell.getValue(); ScDataBarInfo* pInfo = new ScDataBarInfo(); if(mpFormatData->meAxisPosition == databar::NONE) @@ -982,19 +959,12 @@ const ScIconSetFormatData* ScIconSetFormat::GetIconSetData() const ScIconSetInfo* ScIconSetFormat::GetIconSetInfo(const ScAddress& rAddr) const { -CellType eCellType = mpDoc->GetCellType(rAddr); -if(eCellType != CELLTYPE_VALUE && eCellType != CELLTYPE_FORMULA) +ScRefCellValue rCell(*mpDoc, rAddr); +if(!rCell.hasNumeric()) return nullptr; -if (eCellType == CELLTYPE_FORMULA) -{ -ScFormulaCell *pCell = mpDoc->GetFormulaCell(rAddr); -if (!pCell || !pCell->IsValue()) -return nullptr; -} - // now we have for sure a value -double nVal = mpDoc->GetValue(rAddr); +double nVal = rCell.getValue(); if (mpFormatData->m_Entries.size() < 2) return nullptr; diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx index 57f3718..8cbc8ef 100644 --- a
[Libreoffice-commits] core.git: sd/qa
sd/qa/unit/export-tests.cxx | 14 ++ sd/qa/unit/import-tests.cxx | 10 ++ 2 files changed, 24 insertions(+) New commits: commit 080f355f11ee3422e9512815efd9f8d7eb896d32 Author: Aleksas Pantechovskis <alex.pan...@gmail.com> Date: Mon Mar 7 16:09:06 2016 +0200 tdf#65219 Fix temp files clean up in sd unit tests Change-Id: I99037b01c1d644b1803b315cc5e3d8fa5a19bcfb Reviewed-on: https://gerrit.libreoffice.org/22986 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: jan iversen <j...@documentfoundation.org> diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx index 222c7f0..a81d32f 100644 --- a/sd/qa/unit/export-tests.cxx +++ b/sd/qa/unit/export-tests.cxx @@ -431,6 +431,8 @@ void SdExportTest::testTransparentBackground() const SdrTextObj *pObj2 = dynamic_cast( pPage->GetObj( 1 ) ); checkFontAttributes<Color, SvxBackgroundColorItem>( pObj2, Color(COL_YELLOW)); + +xDocShRef->DoClose(); } void SdExportTest::testMediaEmbedding() @@ -474,6 +476,8 @@ void SdExportTest::testFdo84043() const SdrPage *pPage = GetPage( 1, xDocShRef ); SdrObject const* pShape = pPage->GetObj(1); CPPUNIT_ASSERT_MESSAGE("no shape", pShape != nullptr); + +xDocShRef->DoClose(); } void SdExportTest::testFdo71961() @@ -743,6 +747,8 @@ void SdExportTest::testTdf80020() uno::Reference xStyleFamily(xStyleFamilies->getByName("graphics"), uno::UNO_QUERY); uno::Reference xStyle(xStyleFamily->getByName("Test Style"), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(OUString("text"), xStyle->getParentStyle()); + +xDocShRef->DoClose(); } void SdExportTest::testLinkedGraphicRT() @@ -1009,6 +1015,8 @@ void SdExportTest::testBulletColor() const SvxNumBulletItem *pNumFmt = dynamic_cast(aEdit.GetParaAttribs(0).GetItem(EE_PARA_NUMBULLET)); CPPUNIT_ASSERT(pNumFmt); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bullet's color is wrong!", sal_uInt32(0xff),pNumFmt->GetNumRule()->GetLevel(0).GetBulletColor().GetColor()); + +xDocShRef->DoClose(); } void SdExportTest::testTdf62176() @@ -1052,6 +1060,8 @@ void SdExportTest::testTdf62176() //Checking the *Text* in TextBox uno::Reference xParagraph2( getParagraphFromShape( 0, xShape2 ) ); CPPUNIT_ASSERT_EQUAL(OUString("Hello World"), xParagraph2->getString()); + +xDocShRef->DoClose(); } void SdExportTest::testBulletCharAndFont() @@ -1262,6 +1272,8 @@ void SdExportTest::testBulletMarginAndIndentation() CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bullet's left margin is wrong!", sal_uInt32(1000),sal_uInt32(pNumFmt->GetNumRule()->GetLevel(0).GetAbsLSpace()) ); // left margin is 0.79 cm CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bullet's indentation is wrong!", sal_Int32(-998),sal_Int32(pNumFmt->GetNumRule()->GetLevel(0). GetFirstLineOffset())); + +xDocShRef->DoClose(); } void SdExportTest::testParaMarginAndindentation() @@ -1464,6 +1476,8 @@ void SdExportTest::testExportTransitionsPPTX() // NEWSFLASH CPPUNIT_ASSERT(checkTransitionOnPage(xDoc, 74, TransitionType::ZOOM, TransitionSubType::ROTATEIN)); + +xDocShRef->DoClose(); } void SdExportTest::testTdf92527() diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index 89b47ab..b102396 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -478,6 +478,8 @@ void SdImportTest::testGradientAngle() CPPUNIT_ASSERT(xTranspGradients->getByName("Transparency 4") >>= gradient); CPPUNIT_ASSERT_EQUAL(sal_Int16(1800), gradient.Angle); // 1000grad + +xDocShRef->DoClose(); } void SdImportTest::testN778859() @@ -597,6 +599,8 @@ void SdImportTest::testTdf97808() CPPUNIT_ASSERT_EQUAL(xStyle, xParent); CPPUNIT_ASSERT(xLine->getPropertyValue("LineEndName") >>= lineend); CPPUNIT_ASSERT_EQUAL(OUString(), lineend); + +xDocShRef->DoClose(); } void SdImportTest::testFdo64512() @@ -1124,6 +1128,8 @@ void SdImportTest::testBnc910045() xCell.set(xTable->getCellByPosition(0, 0), uno::UNO_QUERY_THROW); xCell->getPropertyValue("FillColor") >>= nColor; CPPUNIT_ASSERT_EQUAL(sal_Int32(5210557), nColor); + +xDocShRef->DoClose(); } void SdImportTest::testRowHeight() @@ -1141,6 +1147,8 @@ void SdImportTest::testRowHeight() uno::Reference< beans::XPropertySet > xRefRow( xRows->getByIndex(0), uno::UNO_QUERY_THROW ); xRefRow->getPropertyValue( sHeight ) >>= nHeight; CPPUNIT_ASSERT_EQUAL( sal_Int32(507), nHeight); + +xDocShRef->DoClose(); } void SdImportTest::testTdf93830() { @@ -1192,6 +1200,8 @@ void SdImportTest::testTdf62255() aAny >>= aFillStyle; CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_NONE, aFillStyle); } + +xDocShRef->DoClose(); } void SdImportTest::testTdf89927() ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/svtools svtools/source
include/svtools/svparser.hxx |5 +++-- svtools/source/svrtf/svparser.cxx | 11 +++ 2 files changed, 6 insertions(+), 10 deletions(-) New commits: commit 50336412f775af154509d67b1ebbdb4b5feb147b Author: Aleksas Pantechovskis <alex.pan...@gmail.com> Date: Wed Mar 9 14:27:10 2016 +0200 tdf#89329 Use std::unique_ptr for pImpl in svparser Change-Id: Ia791bade1a1f9d27a48994f8bb380ffec50e23bb Reviewed-on: https://gerrit.libreoffice.org/23072 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Noel Grandin <noelgran...@gmail.com> diff --git a/include/svtools/svparser.hxx b/include/svtools/svparser.hxx index cfbd115..527c192 100644 --- a/include/svtools/svparser.hxx +++ b/include/svtools/svparser.hxx @@ -27,6 +27,7 @@ #include #include #include +#include struct SvParser_Impl; class SvStream; @@ -51,7 +52,7 @@ protected: sal_uLong nlLineNr; // current line number sal_uLong nlLinePos; // current column number -SvParser_Impl *pImplData; // internal data +std::unique_ptr pImplData; // internal data longnTokenValue;// additional value (RTF) boolbTokenHasValue; // indicates whether nTokenValue is valid SvParserState eState; // status also in derived classes @@ -230,7 +231,7 @@ public: class SVT_DLLPUBLIC SvKeyValueIterator : public SvRefBase { struct Impl; -Impl* mpImpl; +std::unique_ptr mpImpl; public: /** Construction/Destruction. diff --git a/svtools/source/svrtf/svparser.cxx b/svtools/source/svrtf/svparser.cxx index 3350492..a17ca8a 100644 --- a/svtools/source/svrtf/svparser.cxx +++ b/svtools/source/svrtf/svparser.cxx @@ -94,8 +94,6 @@ SvParser::~SvParser() rtl_destroyTextToUnicodeConverter( pImplData->hConv ); } -delete pImplData; - delete [] pTokenStack; } @@ -124,7 +122,7 @@ void SvParser::SetSrcEncoding( rtl_TextEncoding eEnc ) { eSrcEnc = eEnc; if( !pImplData ) -pImplData = new SvParser_Impl; +pImplData.reset(new SvParser_Impl); pImplData->hConv = rtl_createTextToUnicodeConverter( eSrcEnc ); DBG_ASSERT( pImplData->hConv, "SvParser::SetSrcEncoding: no converter for source encoding" ); @@ -523,7 +521,7 @@ void SvParser::SaveState( int nToken ) // save actual status if( !pImplData ) { -pImplData = new SvParser_Impl; +pImplData.reset(new SvParser_Impl); pImplData->nSaveToken = 0; } @@ -672,10 +670,7 @@ struct SvKeyValueIterator::Impl SvKeyValueIterator::SvKeyValueIterator() : mpImpl(new Impl) {} -SvKeyValueIterator::~SvKeyValueIterator() -{ -delete mpImpl; -} +SvKeyValueIterator::~SvKeyValueIterator() = default; bool SvKeyValueIterator::GetFirst (SvKeyValue ) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sw/qa
sw/qa/core/macros-test.cxx |5 + sw/qa/extras/uiwriter/uiwriter.cxx |2 ++ 2 files changed, 7 insertions(+) New commits: commit 123b41c3870810d61fde5e17c74a352e3fd2a694 Author: Aleksas Pantechovskis <alex.pan...@gmail.com> Date: Sat Mar 5 23:56:35 2016 +0200 tdf#65219 Fix temp files clean up in sw unit tests Change-Id: I57f4dc90bc2ad8488af8cd42515b195f4320a9d9 Reviewed-on: https://gerrit.libreoffice.org/22939 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Michael Stahl <mst...@redhat.com> diff --git a/sw/qa/core/macros-test.cxx b/sw/qa/core/macros-test.cxx index ab9203e..44ac68f 100644 --- a/sw/qa/core/macros-test.cxx +++ b/sw/qa/core/macros-test.cxx @@ -45,6 +45,7 @@ #include #include #include +#include #include #include @@ -483,6 +484,10 @@ void SwMacrosTest::testFindReplace() // we need a full document with view and layout etc. because ::GetNode() Reference const xComponent = loadFromDesktop("private:factory/swriter", "com.sun.star.text.TextDocument"); + +const ::comphelper::ScopeGuard xComponentScopeGuard( +[]() { xComponent->dispose(); } ); + SwXTextDocument *const pTextDoc = dynamic_cast(xComponent.get()); CPPUNIT_ASSERT(pTextDoc); SwDoc *const pDoc = pTextDoc->GetDocShell()->GetDoc(); diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index 7887874..a7e92537 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -1004,6 +1004,8 @@ void SwUiWriterTest::testMergeDoc() getParagraph(5, "Para Six: One Three Four Five"); getParagraph(6, ""); getParagraph(7, ""); + +xDoc2Component->dispose(); } void SwUiWriterTest::testCreatePortions() ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sc/qa
sc/qa/extras/new_cond_format.cxx |5 - sc/qa/extras/sccondformats.cxx |2 ++ sc/qa/unit/subsequent_export-test.cxx |4 sc/qa/unit/subsequent_filters-test.cxx | 15 +++ 4 files changed, 25 insertions(+), 1 deletion(-) New commits: commit 14c14094e8587d28eb9cd2a3b5c0c57b355635b5 Author: Aleksas Pantechovskis <alex.pan...@gmail.com> Date: Sun Mar 6 16:47:31 2016 +0200 tdf#65219 Fix temp files clean up in sc unit tests Change-Id: I23bf5d47c2cce31d6dd076eeac58cb2ce47b248a Reviewed-on: https://gerrit.libreoffice.org/22953 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Michael Stahl <mst...@redhat.com> diff --git a/sc/qa/extras/new_cond_format.cxx b/sc/qa/extras/new_cond_format.cxx index c4fab7c..0ac9888 100644 --- a/sc/qa/extras/new_cond_format.cxx +++ b/sc/qa/extras/new_cond_format.cxx @@ -25,7 +25,10 @@ using namespace css; namespace sc_apitest { -#define NUMBER_OF_TESTS 5 +// tearDown checks this value before disposing mxCompnent +// if NUMBER_OF_TESTS is less than the number of tests that call init(), +// then the component is created again but not disposed, resulting in temp file leak +#define NUMBER_OF_TESTS 7 class ScConditionalFormatTest : public CalcUnoApiTest { diff --git a/sc/qa/extras/sccondformats.cxx b/sc/qa/extras/sccondformats.cxx index 02ebd51..0ac865b 100644 --- a/sc/qa/extras/sccondformats.cxx +++ b/sc/qa/extras/sccondformats.cxx @@ -218,6 +218,8 @@ void ScConditionalFormatTest::testUndoAnchor() CPPUNIT_ASSERT_MESSAGE( sFailedMessage.getStr(), newType == ScDrawLayer::GetAnchorType(*pObject) ); CPPUNIT_ASSERT_EQUAL_MESSAGE( sFailedMessage.getStr(), GRAPHIC_BITMAP, rGraphicObj.GetGraphic().GetType()); CPPUNIT_ASSERT_EQUAL_MESSAGE( sFailedMessage.getStr(), sal_uLong(864900), rGraphicObj.GetSizeBytes()); + +xComponent->dispose(); } void ScConditionalFormatTest::setUp() diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx index 4c6e6d8..a32cd5a 100644 --- a/sc/qa/unit/subsequent_export-test.cxx +++ b/sc/qa/unit/subsequent_export-test.cxx @@ -3075,6 +3075,8 @@ void ScExportTest::testRefStringConfigXLSX() CPPUNIT_ASSERT_EQUAL_MESSAGE("String ref syntax doesn't match", formula::FormulaGrammar::CONV_OOO, aConfig.meStringRefAddressSyntax); +xDocSh->DoClose(); + // this doc has no entry for ref syntax xDocSh = loadDoc("empty-noconf.", FORMAT_XLSX); CPPUNIT_ASSERT_MESSAGE("Failed to open 2nd doc", xDocSh.Is()); @@ -3142,6 +3144,8 @@ void ScExportTest::testHeaderImage() OUString aURL; xStyle->getPropertyValue("HeaderBackGraphicURL") >>= aURL; CPPUNIT_ASSERT(aURL.startsWith("vnd.sun.star.GraphicObject:")); + +xDocSh->DoClose(); } void ScExportTest::testTextDirection() diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx index d4a8426..144e19e 100644 --- a/sc/qa/unit/subsequent_filters-test.cxx +++ b/sc/qa/unit/subsequent_filters-test.cxx @@ -1731,6 +1731,8 @@ void ScFiltersTest::testCellAnchoredHiddenShapesXLSX() SdrObject* pObj = pPage->GetObj(1); CPPUNIT_ASSERT_MESSAGE("Failed to get drawing object.", pObj); CPPUNIT_ASSERT_MESSAGE("The shape having same twocellanchor from and to attribute values, is visible.", !pObj->IsVisible()); + +xDocSh->DoClose(); } namespace { @@ -2439,6 +2441,8 @@ void ScFiltersTest::testCondFormatThemeColorXLSX() pColorScaleEntry = pColorScale->GetEntry(1); CPPUNIT_ASSERT(pColorScaleEntry); CPPUNIT_ASSERT_EQUAL(Color(157, 195, 230), pColorScaleEntry->GetColor()); + +xDocSh->DoClose(); } void ScFiltersTest::testCondFormatThemeColor2XLSX() @@ -2460,6 +2464,8 @@ void ScFiltersTest::testCondFormatThemeColor2XLSX() CPPUNIT_ASSERT(pDataBarFormatData->mpNegativeColor.get()); CPPUNIT_ASSERT_EQUAL(Color(217, 217, 217), *pDataBarFormatData->mpNegativeColor.get()); CPPUNIT_ASSERT_EQUAL(Color(197, 90, 17), pDataBarFormatData->maAxisColor); + +xDocSh->DoClose(); } namespace { @@ -2520,6 +2526,8 @@ void ScFiltersTest::testComplexIconSetsXLSX() testCustomIconSetsXLSX_Impl(rDoc, 3, 1, IconSet_4RedToBlack, 3); testCustomIconSetsXLSX_Impl(rDoc, 3, 2, IconSet_3TrafficLights1, 1); testCustomIconSetsXLSX_Impl(rDoc, 3, 3, IconSet_3Arrows, 2); + +xDocSh->DoClose(); } void ScFiltersTest::testCondFormatParentXLSX() @@ -2534,6 +2542,8 @@ void ScFiltersTest::testCondFormatParentXLSX() const SfxPoolItem& rPoolItem = pPattern->GetItem(ATTR_VER_JUSTIFY, pCondSet); const SvxVerJustifyItem& rVerJustify = static_cast(rPoolItem); CPPUNIT_ASSERT_EQUAL(SVX_VER_JUSTIFY_TOP, static_cast(rVerJustify.GetValue())); + +xDocSh->DoClose(); } void ScFiltersTest::testColorSc
[Libreoffice-commits] core.git: sc/qa
sc/qa/unit/filters-test.cxx | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) New commits: commit 714281d859ac1b25c6cf678aec865654f8ce1dee Author: Aleksas Pantechovskis <alex.pan...@gmail.com> Date: Fri Mar 4 18:25:59 2016 +0200 tdf#98264, replace CPPUNIT_ASSERT with CPPUNIT_ASSERT_EQUAL Use correct assert in places from the clang plugin output in the bug report, also fix some asserts of doubles and argument order (expected, actual) Change-Id: I4e8e36f3025d74af2baf4a9be27fe4869c82e8cd Reviewed-on: https://gerrit.libreoffice.org/22911 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com> diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx index 33bf054..096d3fb 100644 --- a/sc/qa/unit/filters-test.cxx +++ b/sc/qa/unit/filters-test.cxx @@ -159,20 +159,20 @@ void testRangeNameImpl(ScDocument& rDoc) CPPUNIT_ASSERT_MESSAGE("range name Global1 not found", pRangeData); double aValue; rDoc.GetValue(1,0,0,aValue); -CPPUNIT_ASSERT_MESSAGE("range name Global1 should reference Sheet1.A1", aValue == 1); +ASSERT_DOUBLES_EQUAL_MESSAGE("range name Global1 should reference Sheet1.A1", 1.0, aValue); pRangeData = rDoc.GetRangeName(0)->findByUpperName(OUString("LOCAL1")); CPPUNIT_ASSERT_MESSAGE("range name Sheet1.Local1 not found", pRangeData); rDoc.GetValue(1,2,0,aValue); -CPPUNIT_ASSERT_MESSAGE("range name Sheet1.Local1 should reference Sheet1.A3", aValue == 3); +ASSERT_DOUBLES_EQUAL_MESSAGE("range name Sheet1.Local1 should reference Sheet1.A3", 3.0, aValue); pRangeData = rDoc.GetRangeName(1)->findByUpperName(OUString("LOCAL2")); CPPUNIT_ASSERT_MESSAGE("range name Sheet2.Local2 not found", pRangeData); //check for correct results for the remaining formulas rDoc.GetValue(1,1,0, aValue); -CPPUNIT_ASSERT_MESSAGE("=global2 should be 2", aValue == 2); +ASSERT_DOUBLES_EQUAL_MESSAGE("=global2 should be 2", 2.0, aValue); rDoc.GetValue(1,3,0, aValue); -CPPUNIT_ASSERT_MESSAGE("=local2 should be 4", aValue == 4); +ASSERT_DOUBLES_EQUAL_MESSAGE("=local2 should be 4", 4.0, aValue); rDoc.GetValue(2,0,0, aValue); -CPPUNIT_ASSERT_MESSAGE("=SUM(global3) should be 10", aValue == 10); +ASSERT_DOUBLES_EQUAL_MESSAGE("=SUM(global3) should be 10", 10.0, aValue); } } @@ -202,26 +202,26 @@ void testContentImpl(ScDocument& rDoc, sal_Int32 nFormat ) //same code for ods, double fValue; //check value import rDoc.GetValue(0,0,0,fValue); -CPPUNIT_ASSERT_MESSAGE("value not imported correctly", fValue == 1); +ASSERT_DOUBLES_EQUAL_MESSAGE("value not imported correctly", 1.0, fValue); rDoc.GetValue(0,1,0,fValue); -CPPUNIT_ASSERT_MESSAGE("value not imported correctly", fValue == 2); +ASSERT_DOUBLES_EQUAL_MESSAGE("value not imported correctly", 2.0, fValue); OUString aString = rDoc.GetString(1, 0, 0); //check string import -CPPUNIT_ASSERT_MESSAGE("string imported not correctly", aString == "String1"); +CPPUNIT_ASSERT_EQUAL_MESSAGE("string imported not correctly", OUString("String1"), aString); aString = rDoc.GetString(1, 1, 0); -CPPUNIT_ASSERT_MESSAGE("string not imported correctly", aString == "String2"); +CPPUNIT_ASSERT_EQUAL_MESSAGE("string not imported correctly", OUString("String2"), aString); //check basic formula import // in case of DIF it just contains values rDoc.GetValue(2,0,0,fValue); -CPPUNIT_ASSERT_MESSAGE("=2*3", fValue == 6); +ASSERT_DOUBLES_EQUAL_MESSAGE("=2*3", 6.0, fValue); rDoc.GetValue(2,1,0,fValue); -CPPUNIT_ASSERT_MESSAGE("=2+3", fValue == 5); +ASSERT_DOUBLES_EQUAL_MESSAGE("=2+3", 5.0, fValue); rDoc.GetValue(2,2,0,fValue); -CPPUNIT_ASSERT_MESSAGE("=2-3", fValue == -1); +ASSERT_DOUBLES_EQUAL_MESSAGE("=2-3", -1.0, fValue); rDoc.GetValue(2,3,0,fValue); -CPPUNIT_ASSERT_MESSAGE("=C1+C2", fValue == 11); +ASSERT_DOUBLES_EQUAL_MESSAGE("=C1+C2", 11.0, fValue); //check merged cells import if (nFormat != FORMAT_LOTUS123 && nFormat != FORMAT_DIF) @@ -418,7 +418,7 @@ void ScFiltersTest::testSheetNamesXLSX() ScDocument& rDoc = xDocSh->GetDocument(); std::vector aTabNames = rDoc.GetAllTableNames(); -CPPUNIT_ASSERT_MESSAGE("The document should have 5 sheets in total.", aTabNames.size() == 5); +CPPUNIT_ASSERT_EQUAL_MESSAGE("The document should have 5 sheets in total.", size_t(5), aTabNames.size()); CPPUNIT_ASSERT_EQUAL(OUString("S"), aTabNames[0]); CPPUNIT_ASSERT_EQUAL(OUString("Sam's Club"), aTabNames[1]); CPPUNIT_ASSERT_EQUAL(OUString("\"The Sheet\""), aTabNames[2]); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sc/qa
sc/qa/unit/ucalc_formula.cxx | 132 +-- 1 file changed, 66 insertions(+), 66 deletions(-) New commits: commit c0207352c053690adad68caa7d4e34b8fe1c1956 Author: Aleksas Pantechovskis <alex.pan...@gmail.com> Date: Fri Mar 4 17:38:42 2016 +0200 tdf#98264, replace CPPUNIT_ASSERT with CPPUNIT_ASSERT_EQUAL Change-Id: I3d3079b061a52a384762a354e66759713c91ba77 Reviewed-on: https://gerrit.libreoffice.org/22910 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com> diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx index 63aa7d9..2a87de4 100644 --- a/sc/qa/unit/ucalc_formula.cxx +++ b/sc/qa/unit/ucalc_formula.cxx @@ -923,16 +923,16 @@ void Test::testFormulaRefData() aDoubleRef.Extend(aRef, ScAddress()); ScRange aTest = aDoubleRef.toAbs(ScAddress()); -CPPUNIT_ASSERT_MESSAGE("Wrong start position of extended range.", aTest.aStart == ScAddress(2,2,0)); -CPPUNIT_ASSERT_MESSAGE("Wrong end position of extended range.", aTest.aEnd == ScAddress(6,5,0)); +CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong start position of extended range.", ScAddress(2,2,0), aTest.aStart); +CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong end position of extended range.", ScAddress(6,5,0), aTest.aEnd); ScComplexRefData aDoubleRef2; aDoubleRef2.InitRangeRel(ScRange(1,2,0,8,6,0), ScAddress(5,5,0)); aDoubleRef.Extend(aDoubleRef2, ScAddress(5,5,0)); aTest = aDoubleRef.toAbs(ScAddress(5,5,0)); -CPPUNIT_ASSERT_MESSAGE("Wrong start position of extended range.", aTest.aStart == ScAddress(1,2,0)); -CPPUNIT_ASSERT_MESSAGE("Wrong end position of extended range.", aTest.aEnd == ScAddress(8,6,0)); +CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong start position of extended range.", ScAddress(1,2,0), aTest.aStart); +CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong end position of extended range.", ScAddress(8,6,0), aTest.aEnd); } void Test::testFormulaCompiler() @@ -999,7 +999,7 @@ void Test::testFormulaCompilerJumpReordering() }; sal_uInt16 nLen = pCode->GetCodeLen(); -CPPUNIT_ASSERT_MESSAGE("Wrong RPN token count.", nLen == SAL_N_ELEMENTS(aCheckRPN)); +CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong RPN token count.", static_cast(SAL_N_ELEMENTS(aCheckRPN)), nLen); FormulaToken** ppTokens = pCode->GetCode(); for (sal_uInt16 i = 0; i < nLen; ++i) @@ -1026,7 +1026,7 @@ void Test::testFormulaCompilerJumpReordering() }; nLen = pCode->GetCodeLen(); -CPPUNIT_ASSERT_MESSAGE("Wrong RPN token count.", nLen == SAL_N_ELEMENTS(aCheckRPN2)); +CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong RPN token count.", static_cast(SAL_N_ELEMENTS(aCheckRPN2)), nLen); ppTokens = pCode->GetCode(); for (sal_uInt16 i = 0; i < nLen; ++i) { @@ -1951,8 +1951,8 @@ void Test::testFormulaRefUpdateInsertRows() rFunc.InsertCells(ScRange(0,1,0,MAXCOL,3,0), , INS_INSROWS_BEFORE, false, true); ScFormulaCell* pFC = m_pDoc->GetFormulaCell(ScAddress(0,5,0)); CPPUNIT_ASSERT(pFC); -CPPUNIT_ASSERT_MESSAGE("This formula cell should not be an error.", pFC->GetErrCode() == 0); -CPPUNIT_ASSERT_EQUAL(3.0, m_pDoc->GetValue(ScAddress(0,5,0))); +CPPUNIT_ASSERT_EQUAL_MESSAGE("This formula cell should not be an error.", static_cast(0), pFC->GetErrCode()); +ASSERT_DOUBLES_EQUAL(3.0, m_pDoc->GetValue(ScAddress(0,5,0))); if (!checkFormula(*m_pDoc, ScAddress(0,5,0), "MAX(A7:A9)")) CPPUNIT_FAIL("Wrong formula!"); @@ -2424,7 +2424,7 @@ void Test::testFormulaRefUpdateDeleteContent() aMark.SetMarkArea(ScAddress(1,1,0)); rFunc.DeleteContents(aMark, InsertDeleteFlags::CONTENTS, true, true); -CPPUNIT_ASSERT_MESSAGE("B2 should be empty.", m_pDoc->GetCellType(ScAddress(1,1,0)) == CELLTYPE_NONE); +CPPUNIT_ASSERT_EQUAL_MESSAGE("B2 should be empty.", CELLTYPE_NONE, m_pDoc->GetCellType(ScAddress(1,1,0))); CPPUNIT_ASSERT_EQUAL(0.0, m_pDoc->GetValue(ScAddress(2,1,0))); SfxUndoManager* pUndoMgr = m_pDoc->GetUndoManager(); @@ -2437,7 +2437,7 @@ void Test::testFormulaRefUpdateDeleteContent() // Redo and check. pUndoMgr->Redo(); -CPPUNIT_ASSERT_MESSAGE("B2 should be empty.", m_pDoc->GetCellType(ScAddress(1,1,0)) == CELLTYPE_NONE); +CPPUNIT_ASSERT_EQUAL_MESSAGE("B2 should be empty.", CELLTYPE_NONE, m_pDoc->GetCellType(ScAddress(1,1,0))); CPPUNIT_ASSERT_EQUAL(0.0, m_pDoc->GetValue(ScAddress(2,1,0))); m_pDoc->DeleteTab(0); @@ -3414,7 +3414,7 @@ void Test::testFuncCOUNTBLANK() ScAddress aPos(0,0,0); ScRange aRange = insertRangeData(m_pDoc, aPos, aData, SAL_N_E
[Libreoffice-commits] core.git: 2 commits - sc/qa
sc/qa/unit/rangelst_test.cxx |4 ++-- sc/qa/unit/ucalc_sort.cxx| 20 ++-- 2 files changed, 12 insertions(+), 12 deletions(-) New commits: commit 2406edd37d425a7f710667b68fa285d1df70763d Author: Aleksas Pantechovskis <alex.pan...@gmail.com> Date: Fri Mar 4 16:07:57 2016 +0200 tdf#98264, replace CPPUNIT_ASSERT with CPPUNIT_ASSERT_EQUAL Change-Id: Id17cf3a1001af950fdbc09239d023bf52790710f Reviewed-on: https://gerrit.libreoffice.org/22909 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com> diff --git a/sc/qa/unit/rangelst_test.cxx b/sc/qa/unit/rangelst_test.cxx index 7b13b0d..b1b1712 100644 --- a/sc/qa/unit/rangelst_test.cxx +++ b/sc/qa/unit/rangelst_test.cxx @@ -406,7 +406,7 @@ void Test::testJoin_Case1() aList.Join(ScRange(4,1,0,6,3,0)); CPPUNIT_ASSERT_EQUAL(static_cast(1), aList.size()); -CPPUNIT_ASSERT( ScRange(1,1,0,6,3,0) == *aList[0]); +CPPUNIT_ASSERT_EQUAL( ScRange(1,1,0,6,3,0), *aList[0]); } void Test::testJoin_Case2() @@ -419,7 +419,7 @@ void Test::testJoin_Case2() aList.Join(*aList[2], true); CPPUNIT_ASSERT_EQUAL(static_cast(1), aList.size()); -CPPUNIT_ASSERT(ScRange(1,1,0,9,3,0) == *aList[0]); +CPPUNIT_ASSERT_EQUAL(ScRange(1,1,0,9,3,0), *aList[0]); } void Test::testUpdateReference_DeleteRow() commit 0355b6b5d252e10193171e86cc5edbf0ab1e9503 Author: Aleksas Pantechovskis <alex.pan...@gmail.com> Date: Fri Mar 4 16:03:17 2016 +0200 tdf#98264, replace CPPUNIT_ASSERT with CPPUNIT_ASSERT_EQUAL Change-Id: Ic02ed30b7135d648c8aac97f65e286c163597f86 Reviewed-on: https://gerrit.libreoffice.org/22908 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com> diff --git a/sc/qa/unit/ucalc_sort.cxx b/sc/qa/unit/ucalc_sort.cxx index bb8151d..e692ec8 100644 --- a/sc/qa/unit/ucalc_sort.cxx +++ b/sc/qa/unit/ucalc_sort.cxx @@ -43,7 +43,7 @@ void Test::testSort() clearRange(m_pDoc, ScRange(0, 0, 0, 1, SAL_N_ELEMENTS(aData), 0)); aDataRange = insertRangeData(m_pDoc, aPos, aData, SAL_N_ELEMENTS(aData)); -CPPUNIT_ASSERT_MESSAGE("failed to insert range data at correct position", aDataRange.aStart == aPos); +CPPUNIT_ASSERT_EQUAL_MESSAGE("failed to insert range data at correct position", aPos, aDataRange.aStart); } // Insert note in cell B2. @@ -85,7 +85,7 @@ void Test::testSort() }; aDataRange = insertRangeData(m_pDoc, aPos, aData, SAL_N_ELEMENTS(aData)); -CPPUNIT_ASSERT_MESSAGE("failed to insert range data at correct position", aDataRange.aStart == aPos); +CPPUNIT_ASSERT_EQUAL_MESSAGE("failed to insert range data at correct position", aPos, aDataRange.aStart); } aSortData.nCol1 = aDataRange.aStart.Col(); @@ -1062,7 +1062,7 @@ void Test::testSortRefUpdate4_Impl() ScAddress aPos(0,0,nTab); clearRange(m_pDoc, ScRange(0, 0, nTab, 1, SAL_N_ELEMENTS(aData), nTab)); aLesson1Range = insertRangeData(m_pDoc, aPos, aData, SAL_N_ELEMENTS(aData)); -CPPUNIT_ASSERT_MESSAGE("failed to insert range data at correct position", aLesson1Range.aStart == aPos); +CPPUNIT_ASSERT_EQUAL_MESSAGE("failed to insert range data at correct position", aPos, aLesson1Range.aStart); } ScRange aLesson2Range; @@ -1080,7 +1080,7 @@ void Test::testSortRefUpdate4_Impl() ScAddress aPos(0,0,nTab); clearRange(m_pDoc, ScRange(0, 0, nTab, 1, SAL_N_ELEMENTS(aData), nTab)); aLesson2Range = insertRangeData(m_pDoc, aPos, aData, SAL_N_ELEMENTS(aData)); -CPPUNIT_ASSERT_MESSAGE("failed to insert range data at correct position", aLesson2Range.aStart == aPos); +CPPUNIT_ASSERT_EQUAL_MESSAGE("failed to insert range data at correct position", aPos, aLesson2Range.aStart); } ScRange aSortRange; @@ -1098,7 +1098,7 @@ void Test::testSortRefUpdate4_Impl() ScAddress aPos(0,0,nTab); clearRange(m_pDoc, ScRange(0, 0, nTab, 1, SAL_N_ELEMENTS(aData), nTab)); aSortRange = insertRangeData(m_pDoc, aPos, aData, SAL_N_ELEMENTS(aData)); -CPPUNIT_ASSERT_MESSAGE("failed to insert range data at correct position", aSortRange.aStart == aPos); +CPPUNIT_ASSERT_EQUAL_MESSAGE("failed to insert range data at correct position", aPos, aSortRange.aStart); } ScDBDocFunc aFunc(getDocShell()); @@ -1265,7 +1265,7 @@ void Test::testSortRefUpdate5() ScAddress aPos(0,0,nTab); clearRange(m_pDoc, ScRange(0, 0, nTab, 2, SAL_N_ELEMENTS(aData), nTab)); aSortRange = insertRangeData(m_pDoc, aPos, aData, SAL_N_ELEMENTS(aData)); -CPPUNIT_ASSERT_MESSAGE("failed to insert range data at correct position", aSortRange.aStart == aPos); +CP
[Libreoffice-commits] core.git: 2 commits - sc/qa
sc/qa/unit/ucalc.cxx | 22 +-- sc/qa/unit/ucalc_sharedformula.cxx | 70 ++--- 2 files changed, 46 insertions(+), 46 deletions(-) New commits: commit 4ccd0d99f00b11f1615a50f5eabaf261cc218c76 Author: Aleksas Pantechovskis <alex.pan...@gmail.com> Date: Fri Mar 4 15:50:37 2016 +0200 tdf#98264, replace CPPUNIT_ASSERT with CPPUNIT_ASSERT_EQUAL Change-Id: I682eba5e733fdd3f93781d48c0cfcb3452ba7da0 Reviewed-on: https://gerrit.libreoffice.org/22907 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com> diff --git a/sc/qa/unit/ucalc_sharedformula.cxx b/sc/qa/unit/ucalc_sharedformula.cxx index ba4d8dd..d543deb 100644 --- a/sc/qa/unit/ucalc_sharedformula.cxx +++ b/sc/qa/unit/ucalc_sharedformula.cxx @@ -43,7 +43,7 @@ void Test::testSharedFormulas() CPPUNIT_ASSERT_MESSAGE("This cell is expected to be a shared formula cell.", pFC && pFC->IsShared()); CPPUNIT_ASSERT_EQUAL(static_cast(9), pFC->GetSharedTopRow()); CPPUNIT_ASSERT_EQUAL(static_cast(2), pFC->GetSharedLength()); -CPPUNIT_ASSERT_MESSAGE("The token is expected to be shared.", pFC->GetCode() == pFC->GetSharedCode()); +CPPUNIT_ASSERT_EQUAL_MESSAGE("The token is expected to be shared.", pFC->GetCode(), pFC->GetSharedCode()); aPos.SetRow(8); // B9 m_pDoc->SetString(aPos, "=A9*2"); @@ -51,7 +51,7 @@ void Test::testSharedFormulas() CPPUNIT_ASSERT_MESSAGE("This cell is expected to be a shared formula cell.", pFC && pFC->IsShared()); CPPUNIT_ASSERT_EQUAL(static_cast(8), pFC->GetSharedTopRow()); CPPUNIT_ASSERT_EQUAL(static_cast(3), pFC->GetSharedLength()); -CPPUNIT_ASSERT_MESSAGE("The token is expected to be shared.", pFC->GetCode() == pFC->GetSharedCode()); +CPPUNIT_ASSERT_EQUAL_MESSAGE("The token is expected to be shared.", pFC->GetCode(), pFC->GetSharedCode()); aPos.SetRow(12); // B13 m_pDoc->SetString(aPos, "=A13*2"); @@ -65,7 +65,7 @@ void Test::testSharedFormulas() CPPUNIT_ASSERT_MESSAGE("This cell is expected to be a shared formula cell.", pFC && pFC->IsShared()); CPPUNIT_ASSERT_EQUAL(static_cast(8), pFC->GetSharedTopRow()); CPPUNIT_ASSERT_EQUAL(static_cast(5), pFC->GetSharedLength()); -CPPUNIT_ASSERT_MESSAGE("The token is expected to be shared.", pFC->GetCode() == pFC->GetSharedCode()); +CPPUNIT_ASSERT_EQUAL_MESSAGE("The token is expected to be shared.", pFC->GetCode(), pFC->GetSharedCode()); // Insert formulas to B15:B16. aPos.SetRow(14); // B15 @@ -76,7 +76,7 @@ void Test::testSharedFormulas() CPPUNIT_ASSERT_MESSAGE("This cell is expected to be a shared formula cell.", pFC && pFC->IsShared()); CPPUNIT_ASSERT_EQUAL(static_cast(14), pFC->GetSharedTopRow()); CPPUNIT_ASSERT_EQUAL(static_cast(2), pFC->GetSharedLength()); -CPPUNIT_ASSERT_MESSAGE("The token is expected to be shared.", pFC->GetCode() == pFC->GetSharedCode()); +CPPUNIT_ASSERT_EQUAL_MESSAGE("The token is expected to be shared.", pFC->GetCode(), pFC->GetSharedCode()); // Insert a formula to B14, and B9:B16 should be shared. aPos.SetRow(13); // B14 @@ -85,7 +85,7 @@ void Test::testSharedFormulas() CPPUNIT_ASSERT_MESSAGE("This cell is expected to be a shared formula cell.", pFC && pFC->IsShared()); CPPUNIT_ASSERT_EQUAL(static_cast(8), pFC->GetSharedTopRow()); CPPUNIT_ASSERT_EQUAL(static_cast(8), pFC->GetSharedLength()); -CPPUNIT_ASSERT_MESSAGE("The token is expected to be shared.", pFC->GetCode() == pFC->GetSharedCode()); +CPPUNIT_ASSERT_EQUAL_MESSAGE("The token is expected to be shared.", pFC->GetCode(), pFC->GetSharedCode()); // Insert an incompatible formula to B12, to split the shared range to B9:B11 and B13:B16. aPos.SetRow(11); // B12 @@ -98,14 +98,14 @@ void Test::testSharedFormulas() CPPUNIT_ASSERT_MESSAGE("This cell is expected to be a shared formula cell.", pFC && pFC->IsShared()); CPPUNIT_ASSERT_EQUAL(static_cast(8), pFC->GetSharedTopRow()); CPPUNIT_ASSERT_EQUAL(static_cast(3), pFC->GetSharedLength()); -CPPUNIT_ASSERT_MESSAGE("The token is expected to be shared.", pFC->GetCode() == pFC->GetSharedCode()); +CPPUNIT_ASSERT_EQUAL_MESSAGE("The token is expected to be shared.", pFC->GetCode(), pFC->GetSharedCode()); aPos.SetRow(12); // B13 pFC = m_pDoc->GetFormulaCell(aPos); CPPUNIT_ASSERT_MESSAGE("This cell is expected to be a shared formula cell.", pFC && pFC->IsShared()); CPPUNIT_ASSERT_EQUAL(static
[Libreoffice-commits] core.git: sc/qa
sc/qa/unit/ucalc.cxx| 450 sc/qa/unit/ucalc_column.cxx | 24 +- sc/qa/unit/ucalc_condformat.cxx | 24 +- sc/qa/unit/ucalc_pivottable.cxx | 204 +- 4 files changed, 361 insertions(+), 341 deletions(-) New commits: commit c189b032236498e93cbc79c63617303aa1ba81eb Author: Aleksas Pantechovskis <alex.pan...@gmail.com> Date: Fri Mar 4 15:11:00 2016 +0200 tdf#98264, replace CPPUNIT_ASSERT with CPPUNIT_ASSERT_EQUAL Change-Id: Ieae48c6a2b611d853f2320e27d5836d8c5dbedfb Reviewed-on: https://gerrit.libreoffice.org/22905 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com> diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 7f155947..00a2108 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -509,12 +509,12 @@ void Test::testSharedStringPool() aSS1 = m_pDoc->GetSharedString(ScAddress(0,2,0)); aSS2 = m_pDoc->GetSharedString(ScAddress(0,4,0)); CPPUNIT_ASSERT_MESSAGE("They must differ", aSS1.getData() != aSS2.getData()); -CPPUNIT_ASSERT_MESSAGE("They must be equal when cases are ignored.", aSS1.getDataIgnoreCase() == aSS2.getDataIgnoreCase()); +CPPUNIT_ASSERT_EQUAL_MESSAGE("They must be equal when cases are ignored.", aSS1.getDataIgnoreCase(), aSS2.getDataIgnoreCase()); // A2 and A4 should be equal when ignoring cases. aSS1 = m_pDoc->GetSharedString(ScAddress(0,1,0)); aSS2 = m_pDoc->GetSharedString(ScAddress(0,3,0)); -CPPUNIT_ASSERT_MESSAGE("They must be equal when cases are ignored.", aSS1.getDataIgnoreCase() == aSS2.getDataIgnoreCase()); +CPPUNIT_ASSERT_EQUAL_MESSAGE("They must be equal when cases are ignored.", aSS1.getDataIgnoreCase(), aSS2.getDataIgnoreCase()); } // Check the string counts after purging. Purging shouldn't remove any strings in this case. @@ -667,7 +667,7 @@ void Test::testRangeList() ScRangeList aRL; aRL.Append(ScRange(1,1,0,3,10,0)); -CPPUNIT_ASSERT_MESSAGE("List should have one range.", aRL.size() == 1); +CPPUNIT_ASSERT_EQUAL_MESSAGE("List should have one range.", size_t(1), aRL.size()); const ScRange* p = aRL[0]; CPPUNIT_ASSERT_MESSAGE("Failed to get the range object.", p); CPPUNIT_ASSERT_MESSAGE("Wrong range.", p->aStart == ScAddress(1,1,0) && p->aEnd == ScAddress(3,10,0)); @@ -690,38 +690,38 @@ void Test::testMarkData() // Select B3:F7. aMarkData.SetMarkArea(ScRange(1,2,0,5,6,0)); aSpans = aMarkData.GetMarkedRowSpans(); -CPPUNIT_ASSERT_MESSAGE("There should be one selected row span.", aSpans.size() == 1); +CPPUNIT_ASSERT_EQUAL_MESSAGE("There should be one selected row span.", size_t(1), aSpans.size()); CPPUNIT_ASSERT_EQUAL(static_cast(2), aSpans[0].mnStart); CPPUNIT_ASSERT_EQUAL(static_cast(6), aSpans[0].mnEnd); aSpans = aMarkData.GetMarkedColSpans(); -CPPUNIT_ASSERT_MESSAGE("There should be one selected column span.", aSpans.size() == 1); +CPPUNIT_ASSERT_EQUAL_MESSAGE("There should be one selected column span.", size_t(1), aSpans.size()); CPPUNIT_ASSERT_EQUAL(static_cast(1), aSpans[0].mnStart); CPPUNIT_ASSERT_EQUAL(static_cast(5), aSpans[0].mnEnd); // Select A11:B13. aMarkData.SetMultiMarkArea(ScRange(0,10,0,1,12,0)); aSpans = aMarkData.GetMarkedRowSpans(); -CPPUNIT_ASSERT_MESSAGE("There should be 2 selected row spans.", aSpans.size() == 2); +CPPUNIT_ASSERT_EQUAL_MESSAGE("There should be 2 selected row spans.", size_t(2), aSpans.size()); CPPUNIT_ASSERT_EQUAL(static_cast(2), aSpans[0].mnStart); CPPUNIT_ASSERT_EQUAL(static_cast(6), aSpans[0].mnEnd); CPPUNIT_ASSERT_EQUAL(static_cast(10), aSpans[1].mnStart); CPPUNIT_ASSERT_EQUAL(static_cast(12), aSpans[1].mnEnd); aSpans = aMarkData.GetMarkedColSpans(); -CPPUNIT_ASSERT_MESSAGE("There should be one selected column span.", aSpans.size() == 1); +CPPUNIT_ASSERT_EQUAL_MESSAGE("There should be one selected column span.", size_t(1), aSpans.size()); CPPUNIT_ASSERT_EQUAL(static_cast(0), aSpans[0].mnStart); CPPUNIT_ASSERT_EQUAL(static_cast(5), aSpans[0].mnEnd); // Select C8:C10. aMarkData.SetMultiMarkArea(ScRange(2,7,0,2,9,0)); aSpans = aMarkData.GetMarkedRowSpans(); -CPPUNIT_ASSERT_MESSAGE("There should be one selected row span.", aSpans.size() == 1); +CPPUNIT_ASSERT_EQUAL_MESSAGE("There should be one selected row span.", size_t(1), aSpans.size()); CPPUNIT_ASSERT_EQUAL(static_cast(2), aSpans[0].mnStart); CPPUNIT_ASSERT_EQUAL(static_cast(12), aSpans[0].mnEnd); aSpans = aMarkData.GetMarkedColSpans(); -CPPUNIT_ASSERT_MESSAGE
[Libreoffice-commits] core.git: basctl/source sax/source sc/source sd/source starmath/inc starmath/source
basctl/source/basicide/basicbox.cxx |2 +- basctl/source/basicide/bastype2.cxx |2 +- basctl/source/basicide/bastypes.cxx |2 +- basctl/source/basicide/macrodlg.cxx |6 +++--- basctl/source/basicide/moduldl2.cxx |6 +++--- basctl/source/basicide/moduldlg.cxx | 16 sax/source/tools/converter.cxx |4 ++-- sc/source/core/data/global.cxx |2 +- sc/source/core/tool/detfunc.cxx |6 +++--- sc/source/filter/excel/excdoc.cxx |4 ++-- sc/source/filter/excel/xecontent.cxx|2 +- sc/source/ui/Accessibility/AccessibleCsvControl.cxx |2 +- sc/source/ui/app/drwtrans.cxx |2 +- sc/source/ui/app/inputwin.cxx |2 +- sc/source/ui/condformat/condformatdlgentry.cxx |2 +- sc/source/ui/dialogs/searchresults.cxx |2 +- sc/source/ui/formdlg/formula.cxx|2 +- sc/source/ui/vba/vbainterior.cxx|2 +- sc/source/ui/vba/vbaworksheets.cxx |2 +- sc/source/ui/view/olinewin.cxx |2 +- sc/source/ui/view/tabvwsh5.cxx |2 +- sc/source/ui/view/tabvwsh9.cxx |2 +- sc/source/ui/view/tabvwshe.cxx |4 ++-- sc/source/ui/view/viewfun2.cxx |2 +- sc/source/ui/view/viewfun4.cxx |4 ++-- sc/source/ui/view/viewfun6.cxx |2 +- sc/source/ui/view/viewutil.cxx |2 +- sd/source/filter/cgm/sdcgmfilter.cxx|2 +- sd/source/filter/grf/sdgrffilter.cxx|2 +- sd/source/ui/view/drviews1.cxx |2 +- sd/source/ui/view/drviews2.cxx |6 +++--- sd/source/ui/view/drviews4.cxx |2 +- sd/source/ui/view/drviews5.cxx |4 ++-- sd/source/ui/view/drviews9.cxx |2 +- sd/source/ui/view/drviewsa.cxx |2 +- sd/source/ui/view/drviewsb.cxx |2 +- sd/source/ui/view/drviewsd.cxx |2 +- sd/source/ui/view/drviewse.cxx |2 +- sd/source/ui/view/drviewsi.cxx |2 +- starmath/inc/rect.hxx |2 +- starmath/source/ElementsDockingWindow.cxx |2 +- starmath/source/dialog.cxx |2 +- starmath/source/edit.cxx|8 starmath/source/view.cxx|6 +++--- 44 files changed, 69 insertions(+), 69 deletions(-) New commits: commit 57d0caacee2f395be2e89b78f8ece2d47b2c8683 Author: Aleksas Pantechovskis <alex.pan...@gmail.com> Date: Thu Mar 3 15:43:51 2016 +0200 tdf#96505 Remove long integer literal specifier when not needed Remove L from integer literals if it does not produce warnings and does not change semantics Change-Id: I9573a47d3e3401993a1f0fbcf7df4be20f9e6eba Reviewed-on: https://gerrit.libreoffice.org/22867 Reviewed-by: Noel Grandin <noelgran...@gmail.com> Tested-by: Noel Grandin <noelgran...@gmail.com> diff --git a/basctl/source/basicide/basicbox.cxx b/basctl/source/basicide/basicbox.cxx index cc7c5cb..847a1a0 100644 --- a/basctl/source/basicide/basicbox.cxx +++ b/basctl/source/basicide/basicbox.cxx @@ -311,7 +311,7 @@ void LibBox::NotifyIDE() if (SfxDispatcher* pDispatcher = GetDispatcher()) pDispatcher->Execute( SID_BASICIDE_LIBSELECTED, -SfxCallMode::SYNCHRON, , , 0L +SfxCallMode::SYNCHRON, , , 0 ); } ReleaseFocus(); diff --git a/basctl/source/basicide/bastype2.cxx b/basctl/source/basicide/bastype2.cxx index 30fa792..288d7ed 100644 --- a/basctl/source/basicide/bastype2.cxx +++ b/basctl/source/basicide/bastype2.cxx @@ -932,7 +932,7 @@ bool TreeListBox::OpenCurrent() ); pDispatcher->Execute( SID_BASICIDE_SHOWSBX, -SfxCallMode::SYNCHRON, , 0L +SfxCallMode::SYNCHRON, , 0 ); return true; } diff --git a/basctl/source/basicide/bastypes.cxx b/basctl/source/basicide/bastypes.cxx index f911713..01e0b6d 100644 --- a/basctl/source/basicide/bastypes.cxx +++ b/basctl/source/basicide/bastypes.cxx @@ -555,7 +555,7 @@ void TabBar::EndRenaming() SfxStringItem aNewName( SID_BASICIDE_ARG_MODULENAME, GetEditText() ); if (SfxDispatcher* pDispatcher = GetDispatcher()) pDispatcher->Execute( SID_BASICIDE_NAMECHANGEDONTAB, - Sf