From ec0ee57607a1e8a800bb4809a0be6921df1f2e19 Mon Sep 17 00:00:00 2001 From: sb Date: Fri, 29 Jan 2010 17:01:54 +0100 Subject: sb118: #i108776# changed addsym.awk to also export STLport num_put symbols, and simplified it by requiring that first section is labeled UDK_3_0_0; adapted map files accordingly, replacing many individual ones with solenv/src templates --- configmgr/qa/unit/export.map | 2 +- configmgr/util/configmgr.map | 8 -------- configmgr/util/configmgrl.map | 8 -------- configmgr/util/makefile.mk | 2 +- 4 files changed, 2 insertions(+), 18 deletions(-) delete mode 100644 configmgr/util/configmgr.map delete mode 100644 configmgr/util/configmgrl.map (limited to 'configmgr') diff --git a/configmgr/qa/unit/export.map b/configmgr/qa/unit/export.map index 4ca70fa85463..879fa8953788 100644 --- a/configmgr/qa/unit/export.map +++ b/configmgr/qa/unit/export.map @@ -1,4 +1,4 @@ -UDK_3.0 { +UDK_3_0_0 { global: registerAllTestFunction; diff --git a/configmgr/util/configmgr.map b/configmgr/util/configmgr.map deleted file mode 100644 index ad92fbe03e9f..000000000000 --- a/configmgr/util/configmgr.map +++ /dev/null @@ -1,8 +0,0 @@ -CFGMGR_2_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/configmgr/util/configmgrl.map b/configmgr/util/configmgrl.map deleted file mode 100644 index ad92fbe03e9f..000000000000 --- a/configmgr/util/configmgrl.map +++ /dev/null @@ -1,8 +0,0 @@ -CFGMGR_2_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/configmgr/util/makefile.mk b/configmgr/util/makefile.mk index eaea5d343503..1a1785d9ea21 100644 --- a/configmgr/util/makefile.mk +++ b/configmgr/util/makefile.mk @@ -44,7 +44,7 @@ DLLPRE = # --- Library ----------------------------------- SHL1TARGET= $(CFGMGR_TARGET)$(CFGMGR_MAJOR).uno -SHL1VERSIONMAP= $(TARGET).map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1OBJS=$(SLOFILES) SHL1STDLIBS=\ -- cgit v1.2.3 From e3f3cc2d7f5dc477a01eef94601ca3082e82e3a9 Mon Sep 17 00:00:00 2001 From: sb Date: Tue, 16 Feb 2010 11:53:58 +0100 Subject: sb118: adapted remaining */qa/unoapi tests to new framework --- configmgr/prj/build.lst | 2 +- configmgr/qa/unoapi/Test.java | 51 ++++++++++++++++++++++++++++++++++++++++ configmgr/qa/unoapi/makefile.mk | 42 ++++++++++++++++----------------- framework/prj/build.lst | 2 +- framework/qa/unoapi/Test.java | 51 ++++++++++++++++++++++++++++++++++++++++ framework/qa/unoapi/makefile.mk | 39 +++++++++++++++--------------- linguistic/prj/build.lst | 1 + linguistic/qa/unoapi/Test.java | 51 ++++++++++++++++++++++++++++++++++++++++ linguistic/qa/unoapi/makefile.mk | 36 +++++++++++++++------------- sfx2/prj/build.lst | 1 + sfx2/qa/unoapi/Test.java | 51 ++++++++++++++++++++++++++++++++++++++++ sfx2/qa/unoapi/makefile.mk | 36 +++++++++++++++------------- svx/prj/build.lst | 1 + svx/qa/unoapi/Test.java | 51 ++++++++++++++++++++++++++++++++++++++++ svx/qa/unoapi/makefile.mk | 36 +++++++++++++++------------- ucb/prj/build.lst | 1 + ucb/qa/unoapi/Test.java | 51 ++++++++++++++++++++++++++++++++++++++++ ucb/qa/unoapi/makefile.mk | 36 +++++++++++++++------------- xmloff/prj/build.lst | 1 + xmloff/qa/unoapi/Test.java | 51 ++++++++++++++++++++++++++++++++++++++++ xmloff/qa/unoapi/makefile.mk | 36 +++++++++++++++------------- 21 files changed, 505 insertions(+), 122 deletions(-) create mode 100644 configmgr/qa/unoapi/Test.java create mode 100644 framework/qa/unoapi/Test.java create mode 100644 linguistic/qa/unoapi/Test.java create mode 100644 sfx2/qa/unoapi/Test.java create mode 100644 svx/qa/unoapi/Test.java create mode 100644 ucb/qa/unoapi/Test.java create mode 100644 xmloff/qa/unoapi/Test.java (limited to 'configmgr') diff --git a/configmgr/prj/build.lst b/configmgr/prj/build.lst index a3d93b598abe..46edcd8b9f28 100644 --- a/configmgr/prj/build.lst +++ b/configmgr/prj/build.lst @@ -15,4 +15,4 @@ cg configmgr\source\registry nmake - all cg_reg cg_inc NULL cg configmgr\source\platformbe nmake - all cg_platformbe cg_inc NULL cg configmgr\util nmake - all cg_util cg_platformbe cg_api cg_api2 cg_misc cg_reg cg_trcache cg_data cg_tree cg_treemgr cg_xml cg_backend cg_localbe NULL cg configmgr\source\localbe nmake - all cg_localbe cg_inc NULL - +cg configmgr\qa\unoapi nmake - all cg_qa_unoapi NULL diff --git a/configmgr/qa/unoapi/Test.java b/configmgr/qa/unoapi/Test.java new file mode 100644 index 000000000000..5c820ed53dc1 --- /dev/null +++ b/configmgr/qa/unoapi/Test.java @@ -0,0 +1,51 @@ +/************************************************************************* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* +* for a copy of the LGPLv3 License. +************************************************************************/ + +package org.openoffice.configmgr.qa.unoapi; + +import org.openoffice.Runner; +import org.openoffice.test.OfficeConnection; +import static org.junit.Assert.*; + +public final class Test { + @org.junit.Before public void setUp() throws Exception { + connection.setUp(); + } + + @org.junit.After public void tearDown() + throws InterruptedException, com.sun.star.uno.Exception + { + connection.tearDown(); + } + + @org.junit.Test public void test() { + assertTrue( + Runner.run( + "-sce", "cfgmgr2.sce", "-xcl", "knownissues.xcl", "-cs", + connection.getDescription())); + } + + private final OfficeConnection connection = new OfficeConnection(); +} diff --git a/configmgr/qa/unoapi/makefile.mk b/configmgr/qa/unoapi/makefile.mk index 6be9331b2cc4..879e3bebde74 100644 --- a/configmgr/qa/unoapi/makefile.mk +++ b/configmgr/qa/unoapi/makefile.mk @@ -1,14 +1,9 @@ #************************************************************************* -# # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ +# Copyright 2000, 2010 Oracle and/or its affiliates. # -# $Revision: 1.7 $ +# OpenOffice.org - a multi-platform office productivity suite # # This file is part of OpenOffice.org. # @@ -26,23 +21,28 @@ # version 3 along with OpenOffice.org. If not, see # # for a copy of the LGPLv3 License. -# -#************************************************************************* +#***********************************************************************/ -PRJ=..$/.. -PRJNAME=configmgr -TARGET=qa_unoapi +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: +.ELSE -.INCLUDE: settings.mk +PRJ = ../.. +PRJNAME = configmgr +TARGET = qa_unoapi +.IF "$(OOO_JUNIT_JAR)" != "" +PACKAGE = org/openoffice/configmgr/qa/unoapi +JAVATESTFILES = Test.java +JAVAFILES = $(JAVATESTFILES) +JARFILES = OOoRunner.jar ridl.jar test.jar +EXTRAJARFILES = $(OOO_JUNIT_JAR) +.END + +.INCLUDE: settings.mk .INCLUDE: target.mk +.INCLUDE: installationtest.mk -ALLTAR : UNOAPI_TEST +ALLTAR : javatest -UNOAPI_TEST: - +$(SOLARENV)$/bin$/checkapi -sce cfgmgr2.sce -xcl knownissues.xcl -tdoc $(PWD)$/testdocuments - @echo ======================================================================= - @echo In case of problems with sysmgr1.SystemIntegration make sure that you - @echo ======================================================================= - @echo built and registered qadevOOo/testsdocs/backend/org/openoffice/JavaSystemBackend - @echo ======================================================================= +.END diff --git a/framework/prj/build.lst b/framework/prj/build.lst index b9814037e729..5c745e09077d 100644 --- a/framework/prj/build.lst +++ b/framework/prj/build.lst @@ -20,4 +20,4 @@ fr framework\source\uiconfiguration nmake - all fr_uiconfiguration f fr framework\source\accelerators nmake - all fr_accelerators fr_threadhelp fr_inc NULL fr framework\source\tabwin nmake - all fr_tabwin fr_threadhelp fr_inc NULL fr framework\util nmake - all fr_util fr_constant fr_threadhelp fr_classes fr_loadenv fr_jobs fr_interaction fr_helper fr_dispatch fr_services fr_register fr_recording fr_layoutmanager fr_uielement fr_uifactory fr_xml fr_uiconfiguration fr_accelerators fr_tabwin NULL - +fr framework\qa\unoapi nmake - all fr_qa_unoapi NULL diff --git a/framework/qa/unoapi/Test.java b/framework/qa/unoapi/Test.java new file mode 100644 index 000000000000..da9bb3bd5020 --- /dev/null +++ b/framework/qa/unoapi/Test.java @@ -0,0 +1,51 @@ +/************************************************************************* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* +* for a copy of the LGPLv3 License. +************************************************************************/ + +package org.openoffice.framework.qa.unoapi; + +import org.openoffice.Runner; +import org.openoffice.test.OfficeConnection; +import static org.junit.Assert.*; + +public final class Test { + @org.junit.Before public void setUp() throws Exception { + connection.setUp(); + } + + @org.junit.After public void tearDown() + throws InterruptedException, com.sun.star.uno.Exception + { + connection.tearDown(); + } + + @org.junit.Test public void test() { + assertTrue( + Runner.run( + "-sce", "framework.sce", "-xcl", "knownissues.xcl", "-tdoc", + "testdocuments", "-cs", connection.getDescription())); + } + + private final OfficeConnection connection = new OfficeConnection(); +} diff --git a/framework/qa/unoapi/makefile.mk b/framework/qa/unoapi/makefile.mk index 69c76f3e89ee..38a6cf7cced8 100755 --- a/framework/qa/unoapi/makefile.mk +++ b/framework/qa/unoapi/makefile.mk @@ -1,14 +1,9 @@ #************************************************************************* -# # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ +# Copyright 2000, 2010 Oracle and/or its affiliates. # -# $Revision: 1.9 $ +# OpenOffice.org - a multi-platform office productivity suite # # This file is part of OpenOffice.org. # @@ -26,22 +21,28 @@ # version 3 along with OpenOffice.org. If not, see # # for a copy of the LGPLv3 License. -# -#************************************************************************* +#***********************************************************************/ -PRJ=..$/.. +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: +.ELSE -PRJNAME=framework -TARGET=qa_unoapi +PRJ = ../.. +PRJNAME = framework +TARGET = qa_unoapi -.INCLUDE: settings.mk +.IF "$(OOO_JUNIT_JAR)" != "" +PACKAGE = org/openoffice/framework/qa/unoapi +JAVATESTFILES = Test.java +JAVAFILES = $(JAVATESTFILES) +JARFILES = OOoRunner.jar ridl.jar test.jar +EXTRAJARFILES = $(OOO_JUNIT_JAR) +.END +.INCLUDE: settings.mk .INCLUDE: target.mk +.INCLUDE: installationtest.mk -ALLTAR : UNOAPI_TEST +ALLTAR : javatest -UNOAPI_TEST: - +$(SOLARENV)$/bin$/checkapi -sce framework.sce -xcl knownissues.xcl -tdoc $(PWD)$/testdocuments -THRCNT 1 -AutoRestart true - @echo ======================================================================= - @echo In case you noticed a failures of fwk.JobExecutor or fwk.JobHandler make sure that you registered $(SOLARSRC)$/qadevOOo$/testdocs$/qadevlibs$/JobExecutor.jar - @echo ======================================================================= +.END diff --git a/linguistic/prj/build.lst b/linguistic/prj/build.lst index 8e09e3fd4226..57c332f6f3ea 100644 --- a/linguistic/prj/build.lst +++ b/linguistic/prj/build.lst @@ -3,3 +3,4 @@ lg linguistic usr1 - all lg_mkout NULL lg linguistic\prj get - all lg_prj NULL lg linguistic\inc nmake - all lg_inc NULL lg linguistic\source nmake - all lg_src lg_inc NULL +lg linguistic\qa\unoapi nmake - all lg_qa_unoapi NULL diff --git a/linguistic/qa/unoapi/Test.java b/linguistic/qa/unoapi/Test.java new file mode 100644 index 000000000000..4a96418255ff --- /dev/null +++ b/linguistic/qa/unoapi/Test.java @@ -0,0 +1,51 @@ +/************************************************************************* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* +* for a copy of the LGPLv3 License. +************************************************************************/ + +package org.openoffice.linguistic.qa.unoapi; + +import org.openoffice.Runner; +import org.openoffice.test.OfficeConnection; +import static org.junit.Assert.*; + +public final class Test { + @org.junit.Before public void setUp() throws Exception { + connection.setUp(); + } + + @org.junit.After public void tearDown() + throws InterruptedException, com.sun.star.uno.Exception + { + connection.tearDown(); + } + + @org.junit.Test public void test() { + assertTrue( + Runner.run( + "-sce", "lng.sce", "-xcl", "knownissues.xcl", "-cs", + connection.getDescription())); + } + + private final OfficeConnection connection = new OfficeConnection(); +} diff --git a/linguistic/qa/unoapi/makefile.mk b/linguistic/qa/unoapi/makefile.mk index 8bac81ca334e..bd330c6fbaca 100644 --- a/linguistic/qa/unoapi/makefile.mk +++ b/linguistic/qa/unoapi/makefile.mk @@ -1,14 +1,9 @@ #************************************************************************* -# # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ +# Copyright 2000, 2010 Oracle and/or its affiliates. # -# $Revision: 1.6 $ +# OpenOffice.org - a multi-platform office productivity suite # # This file is part of OpenOffice.org. # @@ -26,19 +21,28 @@ # version 3 along with OpenOffice.org. If not, see # # for a copy of the LGPLv3 License. -# -#************************************************************************* +#***********************************************************************/ -PRJ=..$/.. +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: +.ELSE -PRJNAME=linguistic -TARGET=qa_unoapi +PRJ = ../.. +PRJNAME = linguistic +TARGET = qa_unoapi -.INCLUDE: settings.mk +.IF "$(OOO_JUNIT_JAR)" != "" +PACKAGE = org/openoffice/linguistic/qa/unoapi +JAVATESTFILES = Test.java +JAVAFILES = $(JAVATESTFILES) +JARFILES = OOoRunner.jar ridl.jar test.jar +EXTRAJARFILES = $(OOO_JUNIT_JAR) +.END +.INCLUDE: settings.mk .INCLUDE: target.mk +.INCLUDE: installationtest.mk -ALLTAR : UNOAPI_TEST +ALLTAR : javatest -UNOAPI_TEST: - +$(SOLARENV)$/bin$/checkapi -sce lng.sce -xcl knownissues.xcl -tdoc $(PWD)$/testdocuments +.END diff --git a/sfx2/prj/build.lst b/sfx2/prj/build.lst index 89e618e8fc12..3e791fbc2000 100644 --- a/sfx2/prj/build.lst +++ b/sfx2/prj/build.lst @@ -21,3 +21,4 @@ sf sfx2\source\toolbox nmake - all sf_tbox sf_sdi sf_inc NULL sf sfx2\source\inet nmake - all sf_inet sf_sdi sf_inc NULL sf sfx2\source\explorer nmake - all sf_expl sf_sdi sf_inc NULL sf sfx2\util nmake - all sf_util sf_appl sf_bast sf_cnfg sf_ctrl sf_dlg sf_doc sf_expl sf_inet sf_menu sf_layout sf_noti sf_sbar sf_tbox sf_view NULL +sf sfx2\qa\unoapi nmake - all sf_qa_unoapi NULL diff --git a/sfx2/qa/unoapi/Test.java b/sfx2/qa/unoapi/Test.java new file mode 100644 index 000000000000..4263985c133f --- /dev/null +++ b/sfx2/qa/unoapi/Test.java @@ -0,0 +1,51 @@ +/************************************************************************* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* +* for a copy of the LGPLv3 License. +************************************************************************/ + +package org.openoffice.sfx2.qa.unoapi; + +import org.openoffice.Runner; +import org.openoffice.test.OfficeConnection; +import static org.junit.Assert.*; + +public final class Test { + @org.junit.Before public void setUp() throws Exception { + connection.setUp(); + } + + @org.junit.After public void tearDown() + throws InterruptedException, com.sun.star.uno.Exception + { + connection.tearDown(); + } + + @org.junit.Test public void test() { + assertTrue( + Runner.run( + "-sce", "sfx.sce", "-xcl", "knownissues.xcl", "-tdoc", + "testdocuments", "-cs", connection.getDescription())); + } + + private final OfficeConnection connection = new OfficeConnection(); +} diff --git a/sfx2/qa/unoapi/makefile.mk b/sfx2/qa/unoapi/makefile.mk index 9d5403bb7c01..ea91ba4d1c44 100644 --- a/sfx2/qa/unoapi/makefile.mk +++ b/sfx2/qa/unoapi/makefile.mk @@ -1,14 +1,9 @@ #************************************************************************* -# # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ +# Copyright 2000, 2010 Oracle and/or its affiliates. # -# $Revision: 1.6 $ +# OpenOffice.org - a multi-platform office productivity suite # # This file is part of OpenOffice.org. # @@ -26,19 +21,28 @@ # version 3 along with OpenOffice.org. If not, see # # for a copy of the LGPLv3 License. -# -#************************************************************************* +#***********************************************************************/ -PRJ=..$/.. +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: +.ELSE -PRJNAME=sfx2 -TARGET=qa_unoapi +PRJ = ../.. +PRJNAME = sfx2 +TARGET = qa_unoapi -.INCLUDE: settings.mk +.IF "$(OOO_JUNIT_JAR)" != "" +PACKAGE = org/openoffice/sfx2/qa/unoapi +JAVATESTFILES = Test.java +JAVAFILES = $(JAVATESTFILES) +JARFILES = OOoRunner.jar ridl.jar test.jar +EXTRAJARFILES = $(OOO_JUNIT_JAR) +.END +.INCLUDE: settings.mk .INCLUDE: target.mk +.INCLUDE: installationtest.mk -ALLTAR : UNOAPI_TEST +ALLTAR : javatest -UNOAPI_TEST: - +$(SOLARENV)$/bin$/checkapi -sce sfx.sce -xcl knownissues.xcl -tdoc $(PWD)$/testdocuments +.END diff --git a/svx/prj/build.lst b/svx/prj/build.lst index 3f66b2ae19f8..03e5316d1560 100644 --- a/svx/prj/build.lst +++ b/svx/prj/build.lst @@ -49,3 +49,4 @@ sx svx\source\customshapes nmake - all sx_customshapes sx_inc NULL sx svx\source\toolbars nmake - all sx_toolbars sx_inc NULL sx svx\util nmake - all sx_util sx_3deng sx_dlg sx_draw sx_attribute sx_properties sx_contact sx_event sx_animation sx_primitive2d sx_primitive3d sx_overlay sx_eeng sx_fmcmp sx_form sx_gall sx_items sx_link sx_mnuc sx_opt sx_outl sx_rtf sx_sdi sx_stbc sx_tbxc sx_undrw sx_unedt sx_ungal sx_xml sx_xout sx_accessibility sx_intro sx_customshapes sx_toolbars sx_table sx_smarttags NULL sx svx\source\gengal nmake - all sx_gengal sx_util NULL +sx svx\qa\unoapi nmake - all sx_qa_unoapi NULL diff --git a/svx/qa/unoapi/Test.java b/svx/qa/unoapi/Test.java new file mode 100644 index 000000000000..90abd12776d0 --- /dev/null +++ b/svx/qa/unoapi/Test.java @@ -0,0 +1,51 @@ +/************************************************************************* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* +* for a copy of the LGPLv3 License. +************************************************************************/ + +package org.openoffice.svx.qa.unoapi; + +import org.openoffice.Runner; +import org.openoffice.test.OfficeConnection; +import static org.junit.Assert.*; + +public final class Test { + @org.junit.Before public void setUp() throws Exception { + connection.setUp(); + } + + @org.junit.After public void tearDown() + throws InterruptedException, com.sun.star.uno.Exception + { + connection.tearDown(); + } + + @org.junit.Test public void test() { + assertTrue( + Runner.run( + "-sce", "svx.sce", "-xcl", "knownissues.xcl", "-tdoc", + "testdocuments", "-cs", connection.getDescription())); + } + + private final OfficeConnection connection = new OfficeConnection(); +} diff --git a/svx/qa/unoapi/makefile.mk b/svx/qa/unoapi/makefile.mk index da8e595ccb2b..133e9a3458e4 100644 --- a/svx/qa/unoapi/makefile.mk +++ b/svx/qa/unoapi/makefile.mk @@ -1,14 +1,9 @@ #************************************************************************* -# # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ +# Copyright 2000, 2010 Oracle and/or its affiliates. # -# $Revision: 1.7 $ +# OpenOffice.org - a multi-platform office productivity suite # # This file is part of OpenOffice.org. # @@ -26,19 +21,28 @@ # version 3 along with OpenOffice.org. If not, see # # for a copy of the LGPLv3 License. -# -#************************************************************************* +#***********************************************************************/ -PRJ=..$/.. +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: +.ELSE -PRJNAME=svx -TARGET=qa_unoapi +PRJ = ../.. +PRJNAME = svx +TARGET = qa_unoapi -.INCLUDE: settings.mk +.IF "$(OOO_JUNIT_JAR)" != "" +PACKAGE = org/openoffice/svx/qa/unoapi +JAVATESTFILES = Test.java +JAVAFILES = $(JAVATESTFILES) +JARFILES = OOoRunner.jar ridl.jar test.jar +EXTRAJARFILES = $(OOO_JUNIT_JAR) +.END +.INCLUDE: settings.mk .INCLUDE: target.mk +.INCLUDE: installationtest.mk -ALLTAR : UNOAPI_TEST +ALLTAR : javatest -UNOAPI_TEST: - +$(SOLARENV)$/bin$/checkapi -sce svx.sce -xcl knownissues.xcl -tdoc $(PWD)$/testdocuments +.END diff --git a/ucb/prj/build.lst b/ucb/prj/build.lst index f0eb0da8395e..a4d7ef6b4f6b 100644 --- a/ucb/prj/build.lst +++ b/ucb/prj/build.lst @@ -14,3 +14,4 @@ uc ucb\source\ucp\webdav nmake - all uc_webdav uc_inc NULL uc ucb\source\ucp\package nmake - all uc_package uc_inc NULL uc ucb\source\ucp\tdoc nmake - all uc_tdoc uc_inc NULL uc ucb\source\ucp\expand nmake - all uc_expand uc_inc NULL +uc ucb\qa\unoapi nmake - all uc_qa_unoapi NULL diff --git a/ucb/qa/unoapi/Test.java b/ucb/qa/unoapi/Test.java new file mode 100644 index 000000000000..145716d871d4 --- /dev/null +++ b/ucb/qa/unoapi/Test.java @@ -0,0 +1,51 @@ +/************************************************************************* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* +* for a copy of the LGPLv3 License. +************************************************************************/ + +package org.openoffice.ucb.qa.unoapi; + +import org.openoffice.Runner; +import org.openoffice.test.OfficeConnection; +import static org.junit.Assert.*; + +public final class Test { + @org.junit.Before public void setUp() throws Exception { + connection.setUp(); + } + + @org.junit.After public void tearDown() + throws InterruptedException, com.sun.star.uno.Exception + { + connection.tearDown(); + } + + @org.junit.Test public void test() { + assertTrue( + Runner.run( + "-sce", "ucb.sce", "-xcl", "knownissues.xcl", "-cs", + connection.getDescription())); + } + + private final OfficeConnection connection = new OfficeConnection(); +} diff --git a/ucb/qa/unoapi/makefile.mk b/ucb/qa/unoapi/makefile.mk index 556e93f97d34..80c7caae73b7 100644 --- a/ucb/qa/unoapi/makefile.mk +++ b/ucb/qa/unoapi/makefile.mk @@ -1,14 +1,9 @@ #************************************************************************* -# # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ +# Copyright 2000, 2010 Oracle and/or its affiliates. # -# $Revision: 1.6 $ +# OpenOffice.org - a multi-platform office productivity suite # # This file is part of OpenOffice.org. # @@ -26,19 +21,28 @@ # version 3 along with OpenOffice.org. If not, see # # for a copy of the LGPLv3 License. -# -#************************************************************************* +#***********************************************************************/ -PRJ=..$/.. +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: +.ELSE -PRJNAME=ucb -TARGET=qa_unoapi +PRJ = ../.. +PRJNAME = ucb +TARGET = qa_unoapi -.INCLUDE: settings.mk +.IF "$(OOO_JUNIT_JAR)" != "" +PACKAGE = org/openoffice/ucb/qa/unoapi +JAVATESTFILES = Test.java +JAVAFILES = $(JAVATESTFILES) +JARFILES = OOoRunner.jar ridl.jar test.jar +EXTRAJARFILES = $(OOO_JUNIT_JAR) +.END +.INCLUDE: settings.mk .INCLUDE: target.mk +.INCLUDE: installationtest.mk -ALLTAR : UNOAPI_TEST +ALLTAR : javatest -UNOAPI_TEST: - +$(SOLARENV)$/bin$/checkapi -sce ucb.sce -xcl knownissues.xcl -tdoc $(PWD)$/testdocuments +.END diff --git a/xmloff/prj/build.lst b/xmloff/prj/build.lst index 8817d4590715..7b68ed08ff82 100644 --- a/xmloff/prj/build.lst +++ b/xmloff/prj/build.lst @@ -14,3 +14,4 @@ xo xmloff\source\transform nmake - all xo_transform xo_util xo xmloff\source\xforms nmake - all xo_xforms xo_inc NULL xo xmloff\source\table nmake - all xo_table xo_inc NULL xo xmloff\util nmake - all xo_util xo_chart xo_core xo_draw xo_forms xo_meta xo_script xo_style xo_text xo_xforms xo_table NULL +xo xmloff\qa\unoapi nmake - all xo_qa_unoapi NULL diff --git a/xmloff/qa/unoapi/Test.java b/xmloff/qa/unoapi/Test.java new file mode 100644 index 000000000000..d66144f108e7 --- /dev/null +++ b/xmloff/qa/unoapi/Test.java @@ -0,0 +1,51 @@ +/************************************************************************* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* +* for a copy of the LGPLv3 License. +************************************************************************/ + +package org.openoffice.xmloff.qa.unoapi; + +import org.openoffice.Runner; +import org.openoffice.test.OfficeConnection; +import static org.junit.Assert.*; + +public final class Test { + @org.junit.Before public void setUp() throws Exception { + connection.setUp(); + } + + @org.junit.After public void tearDown() + throws InterruptedException, com.sun.star.uno.Exception + { + connection.tearDown(); + } + + @org.junit.Test public void test() { + assertTrue( + Runner.run( + "-sce", "xmloff.sce", "-xcl", "knownissues.xcl", "-tdoc", + "testdocuments", "-cs", connection.getDescription())); + } + + private final OfficeConnection connection = new OfficeConnection(); +} diff --git a/xmloff/qa/unoapi/makefile.mk b/xmloff/qa/unoapi/makefile.mk index 61d01403a1b9..3cbbc5f2a797 100644 --- a/xmloff/qa/unoapi/makefile.mk +++ b/xmloff/qa/unoapi/makefile.mk @@ -1,14 +1,9 @@ #************************************************************************* -# # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ +# Copyright 2000, 2010 Oracle and/or its affiliates. # -# $Revision: 1.6 $ +# OpenOffice.org - a multi-platform office productivity suite # # This file is part of OpenOffice.org. # @@ -26,19 +21,28 @@ # version 3 along with OpenOffice.org. If not, see # # for a copy of the LGPLv3 License. -# -#************************************************************************* +#***********************************************************************/ -PRJ=..$/.. +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: +.ELSE -PRJNAME=xmloff -TARGET=qa_unoapi +PRJ = ../.. +PRJNAME = xmloff +TARGET = qa_unoapi -.INCLUDE: settings.mk +.IF "$(OOO_JUNIT_JAR)" != "" +PACKAGE = org/openoffice/xmloff/qa/unoapi +JAVATESTFILES = Test.java +JAVAFILES = $(JAVATESTFILES) +JARFILES = OOoRunner.jar ridl.jar test.jar +EXTRAJARFILES = $(OOO_JUNIT_JAR) +.END +.INCLUDE: settings.mk .INCLUDE: target.mk +.INCLUDE: installationtest.mk -ALLTAR : UNOAPI_TEST +ALLTAR : javatest -UNOAPI_TEST: - +$(SOLARENV)$/bin$/checkapi -sce xmloff.sce -xcl knownissues.xcl -tdoc $(PWD)$/testdocuments +.END -- cgit v1.2.3 From c31ffc7ccdfa767adb0e06830a6baad3333ea608 Mon Sep 17 00:00:00 2001 From: sb Date: Tue, 23 Feb 2010 13:51:38 +0100 Subject: sb118: do not use vector::front if vector::empty --- configmgr/source/localbe/localhierarchybrowsersvc.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'configmgr') diff --git a/configmgr/source/localbe/localhierarchybrowsersvc.cxx b/configmgr/source/localbe/localhierarchybrowsersvc.cxx index 2a6196e87fd5..2e953d594cbe 100644 --- a/configmgr/source/localbe/localhierarchybrowsersvc.cxx +++ b/configmgr/source/localbe/localhierarchybrowsersvc.cxx @@ -527,7 +527,7 @@ uno::Sequence< ::rtl::OUString > SAL_CALL } } - return uno::Sequence< rtl::OUString >(&components.front(),components.size()); + return components.empty() ? uno::Sequence< rtl::OUString >() : uno::Sequence< rtl::OUString >(&components.front(),components.size()); } //------------------------------------------------------------------------------ -- cgit v1.2.3 From fea6cf46ea0cc4f25aed62cb4f06377fe190661d Mon Sep 17 00:00:00 2001 From: Rene Engelhard Date: Thu, 4 Mar 2010 00:11:19 +0100 Subject: sb118: add missing CFLAGS+= $(CPPUNIT_CFLAGS) to loads of other makefiles, too --- configmgr/qa/unit/makefile.mk | 4 ++++ desktop/qa/deployment_misc/makefile.mk | 4 ++++ shell/qa/makefile.mk | 4 ++++ 3 files changed, 12 insertions(+) (limited to 'configmgr') diff --git a/configmgr/qa/unit/makefile.mk b/configmgr/qa/unit/makefile.mk index 39f73183a98a..b6f1bb2e55ba 100644 --- a/configmgr/qa/unit/makefile.mk +++ b/configmgr/qa/unit/makefile.mk @@ -33,6 +33,10 @@ ENABLE_EXCEPTIONS := TRUE .INCLUDE: settings.mk +.IF "$(SYSTEM_CPPUNIT)"=="YES" +CFLAGS+= $(CPPUNIT_CFLAGS) +.ENDIF + DLLPRE = # no leading "lib" on .so files SHL1TARGET = $(TARGET) diff --git a/desktop/qa/deployment_misc/makefile.mk b/desktop/qa/deployment_misc/makefile.mk index 556df1a623c4..d8a3317ff61f 100644 --- a/desktop/qa/deployment_misc/makefile.mk +++ b/desktop/qa/deployment_misc/makefile.mk @@ -34,6 +34,10 @@ ENABLE_EXCEPTIONS := TRUE .INCLUDE: settings.mk .INCLUDE: $(PRJ)$/source$/deployment$/inc$/dp_misc.mk +.IF "$(SYSTEM_CPPUNIT)"=="YES" +CFLAGS+= $(CPPUNIT_CFLAGS) +.ENDIF + DLLPRE = # no leading "lib" on .so files SHL1TARGET = $(TARGET) diff --git a/shell/qa/makefile.mk b/shell/qa/makefile.mk index a9047f97cf83..b918d571adfa 100755 --- a/shell/qa/makefile.mk +++ b/shell/qa/makefile.mk @@ -37,6 +37,10 @@ ENABLE_EXCEPTIONS=TRUE .INCLUDE : settings.mk +.IF "$(SYSTEM_CPPUNIT)"=="YES" +CFLAGS+= $(CPPUNIT_CFLAGS) +.ENDIF + # BEGIN ---------------------------------------------------------------- # auto generated Target:testjob by codegen.pl -- cgit v1.2.3 From ff783db420cdb801613ca46ffec6dc6812d9ad0d Mon Sep 17 00:00:00 2001 From: sb Date: Thu, 4 Mar 2010 22:13:08 +0100 Subject: sb118: #i109791# improved CPPUNIT_CFLAGS handling --- configmgr/qa/unit/makefile.mk | 4 +--- desktop/qa/deployment_misc/makefile.mk | 5 +---- shell/qa/makefile.mk | 4 +--- 3 files changed, 3 insertions(+), 10 deletions(-) (limited to 'configmgr') diff --git a/configmgr/qa/unit/makefile.mk b/configmgr/qa/unit/makefile.mk index b6f1bb2e55ba..94b4c58c41c9 100644 --- a/configmgr/qa/unit/makefile.mk +++ b/configmgr/qa/unit/makefile.mk @@ -33,9 +33,7 @@ ENABLE_EXCEPTIONS := TRUE .INCLUDE: settings.mk -.IF "$(SYSTEM_CPPUNIT)"=="YES" -CFLAGS+= $(CPPUNIT_CFLAGS) -.ENDIF +CFLAGSCXX += $(CPPUNIT_CFLAGS) DLLPRE = # no leading "lib" on .so files diff --git a/desktop/qa/deployment_misc/makefile.mk b/desktop/qa/deployment_misc/makefile.mk index d8a3317ff61f..15faef0dc46e 100644 --- a/desktop/qa/deployment_misc/makefile.mk +++ b/desktop/qa/deployment_misc/makefile.mk @@ -34,10 +34,7 @@ ENABLE_EXCEPTIONS := TRUE .INCLUDE: settings.mk .INCLUDE: $(PRJ)$/source$/deployment$/inc$/dp_misc.mk -.IF "$(SYSTEM_CPPUNIT)"=="YES" -CFLAGS+= $(CPPUNIT_CFLAGS) -.ENDIF - +CFLAGSCXX += $(CPPUNIT_CFLAGS) DLLPRE = # no leading "lib" on .so files SHL1TARGET = $(TARGET) diff --git a/shell/qa/makefile.mk b/shell/qa/makefile.mk index b918d571adfa..cc91a6b1ad5c 100755 --- a/shell/qa/makefile.mk +++ b/shell/qa/makefile.mk @@ -37,9 +37,7 @@ ENABLE_EXCEPTIONS=TRUE .INCLUDE : settings.mk -.IF "$(SYSTEM_CPPUNIT)"=="YES" -CFLAGS+= $(CPPUNIT_CFLAGS) -.ENDIF +CFLAGSCXX += $(CPPUNIT_CFLAGS) # BEGIN ---------------------------------------------------------------- # auto generated Target:testjob by codegen.pl -- cgit v1.2.3 From 69ab7ceb64db5efa79c3c7a6fd880247252ea648 Mon Sep 17 00:00:00 2001 From: sb Date: Fri, 5 Mar 2010 07:57:12 +0100 Subject: sb118: fixed configmgr/qa/unoapi/Test.java after merge --- configmgr/qa/unoapi/Test.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'configmgr') diff --git a/configmgr/qa/unoapi/Test.java b/configmgr/qa/unoapi/Test.java index 5c820ed53dc1..4d1f5a3c4be7 100644 --- a/configmgr/qa/unoapi/Test.java +++ b/configmgr/qa/unoapi/Test.java @@ -43,8 +43,7 @@ public final class Test { @org.junit.Test public void test() { assertTrue( Runner.run( - "-sce", "cfgmgr2.sce", "-xcl", "knownissues.xcl", "-cs", - connection.getDescription())); + "-sce", "module.sce", "-cs", connection.getDescription())); } private final OfficeConnection connection = new OfficeConnection(); -- cgit v1.2.3 From ecbebd83b28891e6a57791a62f8049f8cfe30f47 Mon Sep 17 00:00:00 2001 From: sb Date: Thu, 11 Mar 2010 13:31:37 +0100 Subject: sb121: #i110006# do not leak Component singleton (based on a patch by cmc) --- configmgr/source/components.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'configmgr') diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx index 51a1a6547d9b..51cc76bef602 100644 --- a/configmgr/source/components.cxx +++ b/configmgr/source/components.cxx @@ -112,7 +112,7 @@ rtl::OUString expand(rtl::OUString const & str) { } static bool singletonCreated = false; -static Components * singleton; // leaks +static Components * singleton = 0; } @@ -122,7 +122,8 @@ void Components::initSingleton( OSL_ASSERT(context.is()); if (!singletonCreated) { singletonCreated = true; - singleton = new Components(context); + static Components theSingleton(context); + singleton = &theSingleton; } } -- cgit v1.2.3 From ad9699488ff66d8f8a90253ce06d2f1a8ee63297 Mon Sep 17 00:00:00 2001 From: sb Date: Thu, 18 Mar 2010 11:17:44 +0100 Subject: sb121: #i110198# generally ignore unknown elements in xcu data --- configmgr/source/components.cxx | 7 ++--- configmgr/source/xcuparser.cxx | 58 ++++++++++++++++++----------------------- 2 files changed, 28 insertions(+), 37 deletions(-) (limited to 'configmgr') diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx index 51cc76bef602..a6956e5a13f9 100644 --- a/configmgr/source/components.cxx +++ b/configmgr/source/components.cxx @@ -316,7 +316,6 @@ Components::Components( context_(context) { OSL_ASSERT(context.is()); -/*SB*/try{ parseXcsXcuLayer( 0, expand( @@ -381,13 +380,11 @@ Components::Components( ":UNO_USER_PACKAGES_CACHE}/registry/" "com.sun.star.comp.deployment.configuration." "PackageRegistryBackend/configmgr.ini")))); -/*SB*/}catch(css::uno::Exception&e){fprintf(stderr,"caught <%s>\n",rtl::OUStringToOString(e.Message,RTL_TEXTENCODING_UTF8).getStr());throw;} try { parseModificationLayer(); } catch (css::uno::Exception & e) { //TODO: more specific exception catching - // Silently ignore unreadable parts of a corrupted - // registrymodifications.xcu file, instead of completely preventing OOo - // from starting: + // Silently ignore unreadable parts of a corrupted user modification + // layer, instead of completely preventing OOo from starting: OSL_TRACE( "configmgr error reading user modification layer: %s", rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).getStr()); diff --git a/configmgr/source/xcuparser.cxx b/configmgr/source/xcuparser.cxx index 220168c62725..4f15b24afb01 100644 --- a/configmgr/source/xcuparser.cxx +++ b/configmgr/source/xcuparser.cxx @@ -332,12 +332,14 @@ void XcuParser::handleComponentData(XmlReader & reader) { Data::findNode( valueParser_.getLayer(), data_->components, componentName_)); if (!node.is()) { - throw css::uno::RuntimeException( - (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("unknown component ")) + - componentName_ + - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" in ")) + - reader.getUrl()), - css::uno::Reference< css::uno::XInterface >()); + OSL_TRACE( + "configmgr unknown component %s in %s", + rtl::OUStringToOString( + componentName_, RTL_TEXTENCODING_UTF8).getStr(), + rtl::OUStringToOString( + reader.getUrl(), RTL_TEXTENCODING_UTF8).getStr()); + state_.push(State()); // ignored + return; } switch (op) { case OPERATION_MODIFY: @@ -389,17 +391,11 @@ void XcuParser::handleItem(XmlReader & reader) { data_->resolvePathRepresentation( path, &modificationPath_, &finalizedLayer)); if (!node.is()) { - //TODO: Within Components::parseModificationLayer (but only there) it - // can rightly happen that data is read that does not match a schema - // (that no schema exists, or that the schema specifies a different - // type), namely if the schema was brought along by an extension that - // has been removed or replaced; instead of taking care of that at all - // the relevant places, as a hack, only "top-level" s (that only - // appear in modification layer data) with unknown path are filtered out - // here. OSL_TRACE( - "configmgr unknown ", - rtl::OUStringToOString(path, RTL_TEXTENCODING_UTF8).getStr()); + "configmgr unknown item %s in %s", + rtl::OUStringToOString(path, RTL_TEXTENCODING_UTF8).getStr(), + rtl::OUStringToOString( + reader.getUrl(), RTL_TEXTENCODING_UTF8).getStr()); state_.push(State()); // ignored return; } @@ -672,17 +668,10 @@ void XcuParser::handleUnknownGroupProp( XmlReader const & reader, GroupNode * group, rtl::OUString const & name, Type type, Operation operation, bool finalized) { - if (!group->isExtensible()) { - throw css::uno::RuntimeException( - (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("unknown prop ")) + - name + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" in ")) + - reader.getUrl()), - css::uno::Reference< css::uno::XInterface >()); - } switch (operation) { case OPERATION_REPLACE: case OPERATION_FUSE: - { + if (group->isExtensible()) { if (type == TYPE_ERROR) { throw css::uno::RuntimeException( (rtl::OUString( @@ -705,12 +694,15 @@ void XcuParser::handleUnknownGroupProp( modificationPath_.push_back(name); modifications_->add(modificationPath_); } + break; } - break; + // fall through default: OSL_TRACE( - "ignoring modify or remove of unknown (presumably extension)" - " property"); + "configmgr unknown property %s in %s", + rtl::OUStringToOString(name, RTL_TEXTENCODING_UTF8).getStr(), + rtl::OUStringToOString( + reader.getUrl(), RTL_TEXTENCODING_UTF8).getStr()); state_.push(State()); break; } @@ -879,11 +871,13 @@ void XcuParser::handleGroupNode( rtl::Reference< Node > child( Data::findNode(valueParser_.getLayer(), group->getMembers(), name)); if (!child.is()) { - throw css::uno::RuntimeException( - (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("unknown node ")) + - name + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" in ")) + - reader.getUrl()), - css::uno::Reference< css::uno::XInterface >()); + OSL_TRACE( + "configmgr unknown node %s in %s", + rtl::OUStringToOString(name, RTL_TEXTENCODING_UTF8).getStr(), + rtl::OUStringToOString( + reader.getUrl(), RTL_TEXTENCODING_UTF8).getStr()); + state_.push(State()); // ignored + return; } if (op != OPERATION_MODIFY && op != OPERATION_FUSE) { throw css::uno::RuntimeException( -- cgit v1.2.3 From 8e5a36c9718accfb883cc674e364ecf08f768aed Mon Sep 17 00:00:00 2001 From: sb Date: Fri, 19 Mar 2010 16:50:36 +0100 Subject: sb121: #i110230# when writing top-level localized value changes do not omit the part from the triple --- configmgr/source/writemodfile.cxx | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) (limited to 'configmgr') diff --git a/configmgr/source/writemodfile.cxx b/configmgr/source/writemodfile.cxx index a8e0f77cbd2e..c6a23d5bc8ef 100644 --- a/configmgr/source/writemodfile.cxx +++ b/configmgr/source/writemodfile.cxx @@ -463,13 +463,25 @@ void writeModifications( // components themselves have no parent but must have children if (node.is()) { writeData(handle, RTL_CONSTASCII_STRINGPARAM("getTemplateName(), parentName))); - writeData(handle, RTL_CONSTASCII_STRINGPARAM("\">")); - writeNode(components, handle, parent, nodeName, node); + if (parent->kind() == Node::KIND_LOCALIZED_PROPERTY) { + writeAttributeValue(handle, grandparentPathRepresentation); + writeData( + handle, RTL_CONSTASCII_STRINGPARAM("\">")); + writeNode(components, handle, parent, nodeName, node); + writeData(handle, RTL_CONSTASCII_STRINGPARAM("")); + } else { + writeAttributeValue( + handle, + (grandparentPathRepresentation + + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")) + + Data::createSegment( + parent->getTemplateName(), parentName))); + writeData(handle, RTL_CONSTASCII_STRINGPARAM("\">")); + writeNode(components, handle, parent, nodeName, node); + } writeData(handle, RTL_CONSTASCII_STRINGPARAM("")); } else { writeData(handle, RTL_CONSTASCII_STRINGPARAM(" Date: Mon, 22 Mar 2010 16:04:16 +0100 Subject: sb121: #i110264# in registrymodifications.xcu, allow localized property values to be described directly as (instead of ) --- configmgr/source/writemodfile.cxx | 84 +++++++++------------------------ configmgr/source/xcuparser.cxx | 17 +++++++ officecfg/registry/component-update.dtd | 5 +- 3 files changed, 41 insertions(+), 65 deletions(-) (limited to 'configmgr') diff --git a/configmgr/source/writemodfile.cxx b/configmgr/source/writemodfile.cxx index c6a23d5bc8ef..c2573ab67439 100644 --- a/configmgr/source/writemodfile.cxx +++ b/configmgr/source/writemodfile.cxx @@ -451,9 +451,9 @@ void writeNode( void writeModifications( Components & components, oslFileHandle handle, - rtl::OUString const & grandparentPathRepresentation, - rtl::OUString const & parentName, rtl::Reference< Node > const & parent, - rtl::OUString const & nodeName, rtl::Reference< Node > const & node, + rtl::OUString const & parentPathRepresentation, + rtl::Reference< Node > const & parent, rtl::OUString const & nodeName, + rtl::Reference< Node > const & node, Modifications::Node const & modifications) { // It is never necessary to write oor:finalized or oor:mandatory attributes, @@ -461,39 +461,15 @@ void writeModifications( if (modifications.children.empty()) { OSL_ASSERT(parent.is()); // components themselves have no parent but must have children + writeData(handle, RTL_CONSTASCII_STRINGPARAM("")); if (node.is()) { - writeData(handle, RTL_CONSTASCII_STRINGPARAM("kind() == Node::KIND_LOCALIZED_PROPERTY) { - writeAttributeValue(handle, grandparentPathRepresentation); - writeData( - handle, RTL_CONSTASCII_STRINGPARAM("\">")); - writeNode(components, handle, parent, nodeName, node); - writeData(handle, RTL_CONSTASCII_STRINGPARAM("")); - } else { - writeAttributeValue( - handle, - (grandparentPathRepresentation + - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")) + - Data::createSegment( - parent->getTemplateName(), parentName))); - writeData(handle, RTL_CONSTASCII_STRINGPARAM("\">")); - writeNode(components, handle, parent, nodeName, node); - } - writeData(handle, RTL_CONSTASCII_STRINGPARAM("")); + writeNode(components, handle, parent, nodeName, node); } else { - writeData(handle, RTL_CONSTASCII_STRINGPARAM("kind()) { case Node::KIND_LOCALIZED_PROPERTY: - writeAttributeValue(handle, grandparentPathRepresentation); - writeData( - handle, RTL_CONSTASCII_STRINGPARAM("\">")); + handle, RTL_CONSTASCII_STRINGPARAM(" oor:op=\"remove\"/>")); break; case Node::KIND_GROUP: OSL_ASSERT( dynamic_cast< GroupNode * >(parent.get())->isExtensible()); - writeAttributeValue( - handle, - (grandparentPathRepresentation + - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")) + - Data::createSegment( - parent->getTemplateName(), parentName))); writeData( - handle, RTL_CONSTASCII_STRINGPARAM("\">")); + RTL_CONSTASCII_STRINGPARAM("\" oor:op=\"remove\"/>")); break; case Node::KIND_SET: - writeAttributeValue( - handle, - (grandparentPathRepresentation + - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")) + - Data::createSegment( - parent->getTemplateName(), parentName))); writeData( - handle, RTL_CONSTASCII_STRINGPARAM("\">")); + RTL_CONSTASCII_STRINGPARAM("\" oor:op=\"remove\"/>")); break; default: OSL_ASSERT(false); // this cannot happen break; } } + writeData(handle, RTL_CONSTASCII_STRINGPARAM("")); } else { - rtl::OUString parentPathRep; - if (parent.is()) { // components themselves have no parent - parentPathRep = grandparentPathRepresentation + - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")) + - Data::createSegment(parent->getTemplateName(), parentName); - } OSL_ASSERT(node.is()); + rtl::OUString pathRep( + parentPathRepresentation + + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")) + + Data::createSegment(node->getTemplateName(), nodeName)); for (Modifications::Node::Children::const_iterator i( modifications.children.begin()); i != modifications.children.end(); ++i) { writeModifications( - components, handle, parentPathRep, nodeName, node, i->first, + components, handle, pathRep, node, i->first, node->getMember(i->first), i->second); } } @@ -617,9 +576,8 @@ void writeModFile( j != data.modifications.getRoot().children.end(); ++j) { writeModifications( - components, tmp.handle, rtl::OUString(), rtl::OUString(), - rtl::Reference< Node >(), j->first, - Data::findNode(Data::NO_LAYER, data.components, j->first), + components, tmp.handle, rtl::OUString(), rtl::Reference< Node >(), + j->first, Data::findNode(Data::NO_LAYER, data.components, j->first), j->second); } writeData(tmp.handle, RTL_CONSTASCII_STRINGPARAM("")); diff --git a/configmgr/source/xcuparser.cxx b/configmgr/source/xcuparser.cxx index 4f15b24afb01..60ea59ca0248 100644 --- a/configmgr/source/xcuparser.cxx +++ b/configmgr/source/xcuparser.cxx @@ -399,6 +399,23 @@ void XcuParser::handleItem(XmlReader & reader) { state_.push(State()); // ignored return; } + switch (node->kind()) { + case Node::KIND_PROPERTY: + case Node::KIND_LOCALIZED_VALUE: + OSL_TRACE( + "configmgr item of bad type %s in %s", + rtl::OUStringToOString(path, RTL_TEXTENCODING_UTF8).getStr(), + rtl::OUStringToOString( + reader.getUrl(), RTL_TEXTENCODING_UTF8).getStr()); + state_.push(State()); // ignored + return; + case Node::KIND_LOCALIZED_PROPERTY: + valueParser_.type_ = dynamic_cast< LocalizedPropertyNode * >( + node.get())->getStaticType(); + break; + default: + break; + } OSL_ASSERT(!modificationPath_.empty()); componentName_ = modificationPath_.front(); if (modifications_ == 0) { diff --git a/officecfg/registry/component-update.dtd b/officecfg/registry/component-update.dtd index 51623f40bafa..81acc5e35eee 100644 --- a/officecfg/registry/component-update.dtd +++ b/officecfg/registry/component-update.dtd @@ -113,7 +113,8 @@ - + - + -- cgit v1.2.3 From cd48abe95c6205a27c46b54740b42838036cbd8e Mon Sep 17 00:00:00 2001 From: sb Date: Wed, 24 Mar 2010 09:48:47 +0100 Subject: sb121: #i110258# when parsing .xcs, conservatively merge new templates/components into existing instances (to not let extension update fail) --- configmgr/source/xcsparser.cxx | 87 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 79 insertions(+), 8 deletions(-) (limited to 'configmgr') diff --git a/configmgr/source/xcsparser.cxx b/configmgr/source/xcsparser.cxx index 15141844a276..4de9973594c1 100644 --- a/configmgr/source/xcsparser.cxx +++ b/configmgr/source/xcsparser.cxx @@ -60,6 +60,63 @@ namespace { namespace css = com::sun::star; +// Conservatively merge a template or component (and its recursive parts) into +// an existing instance: +void merge( + rtl::Reference< Node > const & original, + rtl::Reference< Node > const & update) +{ + OSL_ASSERT( + original.is() && update.is() && original->kind() == update->kind() && + update->getFinalized() == Data::NO_LAYER); + if (update->getLayer() >= original->getLayer() && + update->getLayer() <= original->getFinalized()) + { + switch (original->kind()) { + case Node::KIND_PROPERTY: + case Node::KIND_LOCALIZED_PROPERTY: + case Node::KIND_LOCALIZED_VALUE: + break; //TODO: merge certain parts? + case Node::KIND_GROUP: + if (dynamic_cast< GroupNode * >(original.get())->isExtensible()) { + for (NodeMap::iterator i2(update->getMembers().begin()); + i2 != update->getMembers().end(); ++i2) + { + NodeMap::iterator i1( + original->getMembers().find(i2->first)); + if (i1 == original->getMembers().end()) { + if (i2->second->kind() == Node::KIND_PROPERTY) { + original->getMembers().insert(*i2); + } + } else if (i2->second->kind() == i1->second->kind()) { + merge(i1->second, i2->second); + } + } + } + break; + case Node::KIND_SET: + for (NodeMap::iterator i2(update->getMembers().begin()); + i2 != update->getMembers().end(); ++i2) + { + NodeMap::iterator i1(original->getMembers().find(i2->first)); + if (i1 == original->getMembers().end()) { + if (dynamic_cast< SetNode * >(original.get())-> + isValidTemplate(i2->second->getTemplateName())) + { + original->getMembers().insert(*i2); + } + } else if (i2->second->kind() == i1->second->kind() && + (i2->second->getTemplateName() == + i1->second->getTemplateName())) + { + merge(i1->second, i2->second); + } + } + break; + } + } +} + } XcsParser::XcsParser(int layer, Data * data): @@ -218,15 +275,30 @@ void XcsParser::endElement(XmlReader const & reader) { Element top(elements_.top()); elements_.pop(); if (top.node.is()) { - NodeMap * map; if (elements_.empty()) { switch (state_) { case STATE_TEMPLATES: - map = &data_->templates; + { + NodeMap::iterator i(data_->templates.find(top.name)); + if (i == data_->templates.end()) { + data_->templates.insert( + NodeMap::value_type(top.name, top.node)); + } else { + merge(i->second, top.node); + } + } break; case STATE_COMPONENT: - map = &data_->components; - state_ = STATE_COMPONENT_DONE; + { + NodeMap::iterator i(data_->components.find(top.name)); + if (i == data_->components.end()) { + data_->components.insert( + NodeMap::value_type(top.name, top.node)); + } else { + merge(i->second, top.node); + } + state_ = STATE_COMPONENT_DONE; + } break; default: OSL_ASSERT(false); @@ -235,10 +307,9 @@ void XcsParser::endElement(XmlReader const & reader) { RTL_CONSTASCII_USTRINGPARAM("this cannot happen")), css::uno::Reference< css::uno::XInterface >()); } - } else { - map = &elements_.top().node->getMembers(); - } - if (!map->insert(NodeMap::value_type(top.name, top.node)).second) { + } else if (!elements_.top().node->getMembers().insert( + NodeMap::value_type(top.name, top.node)).second) + { throw css::uno::RuntimeException( (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("duplicate ")) + top.name + -- cgit v1.2.3 From 22cf34ac5ea7aea96b9f50078cb4b0874f031dd6 Mon Sep 17 00:00:00 2001 From: sb Date: Wed, 24 Mar 2010 10:31:27 +0100 Subject: sb121: added profiling tracepoints --- configmgr/source/components.cxx | 3 +++ 1 file changed, 3 insertions(+) (limited to 'configmgr') diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx index a6956e5a13f9..cb8fb261e60e 100644 --- a/configmgr/source/components.cxx +++ b/configmgr/source/components.cxx @@ -46,6 +46,7 @@ #include "osl/diagnose.h" #include "osl/file.hxx" #include "rtl/bootstrap.hxx" +#include "rtl/logfile.h" #include "rtl/ref.hxx" #include "rtl/string.h" #include "rtl/textenc.h" @@ -316,6 +317,7 @@ Components::Components( context_(context) { OSL_ASSERT(context.is()); + RTL_LOGFILE_TRACE_AUTHOR("configmgr", "sb", "begin parsing"); parseXcsXcuLayer( 0, expand( @@ -389,6 +391,7 @@ Components::Components( "configmgr error reading user modification layer: %s", rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).getStr()); } + RTL_LOGFILE_TRACE_AUTHOR("configmgr", "sb", "end parsing"); } Components::~Components() {} -- cgit v1.2.3 From 41b28993173f98f858a90fb7d8f259e24207ccbe Mon Sep 17 00:00:00 2001 From: sb Date: Wed, 24 Mar 2010 16:04:08 +0100 Subject: sb121: #i110203# use in Setup.xcu string-list values; pass it through XSLT scripts intact; handle it correctly in configmgr::ValueParser --- configmgr/source/valueparser.cxx | 22 ++--- configmgr/source/valueparser.hxx | 4 +- configmgr/source/xcsparser.cxx | 2 +- configmgr/source/xcuparser.cxx | 4 +- officecfg/registry/data/org/openoffice/Setup.xcu | 119 +++++++++++------------ officecfg/util/alllang.xsl | 6 +- 6 files changed, 74 insertions(+), 83 deletions(-) (limited to 'configmgr') diff --git a/configmgr/source/valueparser.cxx b/configmgr/source/valueparser.cxx index f951aac5ca01..4adf452c409b 100644 --- a/configmgr/source/valueparser.cxx +++ b/configmgr/source/valueparser.cxx @@ -270,6 +270,10 @@ XmlReader::Text ValueParser::getTextMode() const { if (node_.is()) { switch (state_) { case STATE_TEXT: + if (!items_.empty()) { + break; + } + // fall through case STATE_IT: return (type_ == TYPE_STRING || type_ == TYPE_STRING_LIST || @@ -294,7 +298,9 @@ bool ValueParser::startElement( name.equals(RTL_CONSTASCII_STRINGPARAM("it")) && isListType(type_) && separator_.getLength() == 0) { - checkEmptyPad(reader); + pad_.clear(); + // before first , characters are not ignored; assume they + // are only whitespace state_ = STATE_IT; return true; } @@ -351,7 +357,7 @@ bool ValueParser::startElement( css::uno::Reference< css::uno::XInterface >()); } -bool ValueParser::endElement(XmlReader const & reader) { +bool ValueParser::endElement() { if (!node_.is()) { return false; } @@ -363,7 +369,6 @@ bool ValueParser::endElement(XmlReader const & reader) { value = parseValue(separator_, pad_.get(), type_); pad_.clear(); } else { - checkEmptyPad(reader); switch (type_) { case TYPE_BOOLEAN_LIST: value = convertItems< sal_Bool >(); @@ -454,17 +459,6 @@ int ValueParser::getLayer() const { return layer_; } -void ValueParser::checkEmptyPad(XmlReader const & reader) const { - if (pad_.is()) { - throw css::uno::RuntimeException( - (rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "mixed text and elements in ")) + - reader.getUrl()), - css::uno::Reference< css::uno::XInterface >()); - } -} - template< typename T > css::uno::Any ValueParser::convertItems() { css::uno::Sequence< T > seq(items_.size()); for (sal_Int32 i = 0; i < seq.getLength(); ++i) { diff --git a/configmgr/source/valueparser.hxx b/configmgr/source/valueparser.hxx index c328fe7eddce..4e899f4632dd 100644 --- a/configmgr/source/valueparser.hxx +++ b/configmgr/source/valueparser.hxx @@ -61,7 +61,7 @@ public: bool startElement( XmlReader & reader, XmlReader::Namespace ns, Span const & name); - bool endElement(XmlReader const & reader); + bool endElement(); void characters(Span const & text); @@ -75,8 +75,6 @@ public: rtl::OString separator_; private: - void checkEmptyPad(XmlReader const & reader) const; - template< typename T > com::sun::star::uno::Any convertItems(); enum State { STATE_TEXT, STATE_TEXT_UNICODE, STATE_IT, STATE_IT_UNICODE }; diff --git a/configmgr/source/xcsparser.cxx b/configmgr/source/xcsparser.cxx index 4de9973594c1..3fc719f00fe9 100644 --- a/configmgr/source/xcsparser.cxx +++ b/configmgr/source/xcsparser.cxx @@ -266,7 +266,7 @@ bool XcsParser::startElement( } void XcsParser::endElement(XmlReader const & reader) { - if (valueParser_.endElement(reader)) { + if (valueParser_.endElement()) { return; } if (ignoring_ > 0) { diff --git a/configmgr/source/xcuparser.cxx b/configmgr/source/xcuparser.cxx index 60ea59ca0248..80dc501e9435 100644 --- a/configmgr/source/xcuparser.cxx +++ b/configmgr/source/xcuparser.cxx @@ -209,8 +209,8 @@ bool XcuParser::startElement( return true; } -void XcuParser::endElement(XmlReader const & reader) { - if (valueParser_.endElement(reader)) { +void XcuParser::endElement(XmlReader const &) { + if (valueParser_.endElement()) { return; } OSL_ASSERT(!state_.empty()); diff --git a/officecfg/registry/data/org/openoffice/Setup.xcu b/officecfg/registry/data/org/openoffice/Setup.xcu index 4acf93dee764..6720ab5c37a3 100644 --- a/officecfg/registry/data/org/openoffice/Setup.xcu +++ b/officecfg/registry/data/org/openoffice/Setup.xcu @@ -765,12 +765,12 @@ org.openoffice.Office.DataAccess - - org.openoffice.Office.DataAccess/Bibliography - org.openoffice.Office.DataAccess/ConnectionPool - org.openoffice.Office.DataAccess/DataSources - org.openoffice.Office.DataAccess/DriverManager - + + org.openoffice.Office.DataAccess/Bibliography + org.openoffice.Office.DataAccess/ConnectionPool + org.openoffice.Office.DataAccess/DataSources + org.openoffice.Office.DataAccess/DriverManager + @@ -780,8 +780,7 @@ - org.openoffice.Inet - + org.openoffice.Inet @@ -796,63 +795,63 @@ - - .*/autotext/.* - .*/autocorr/.* - .*/config/.*\.so[bcdegh] - .*/config/soffice.cfg/modules/.*/toolbar/custom.*\.xml - .*/config/soffice.cfg/modules/.*/images/.* - .*/gallery/.* - .*/template/.* + + .*/autotext/.* + .*/autocorr/.* + .*/config/.*\.so[bcdegh] + .*/config/soffice.cfg/modules/.*/toolbar/custom.*\.xml + .*/config/soffice.cfg/modules/.*/images/.* + .*/gallery/.* + .*/template/.* - org.openoffice.Office.Compatibility - org.openoffice.Office.Custom - org.openoffice.Office.Embedding - org.openoffice.Office.Events - org.openoffice.Office.ExtendedColorScheme - org.openoffice.Office.Common/Accessibility - org.openoffice.Office.Common/Accessibility/AutoDetectSystemHC - org.openoffice.Office.Common/AsianLayout - org.openoffice.Office.Common/AutoCorrect - org.openoffice.Office.Common/Cache - org.openoffice.Office.Common/DateFormat - org.openoffice.Office.Common/ExternalMailer/Program - org.openoffice.Office.Common/Filter - org.openoffice.Office.Common/Font - org.openoffice.Office.Common/Forms - org.openoffice.Office.Common/Gallery - org.openoffice.Office.Common/Help - org.openoffice.Office.Common/History - org.openoffice.Office.Common/I18N - org.openoffice.Office.Common/InternalMSExport - org.openoffice.Office.Common/Load - org.openoffice.Office.Common/Misc/FormControlPilotsEnabled - org.openoffice.Office.Common/Misc/PluginsEnabled - org.openoffice.Office.Common/Misc/SymbolSet - org.openoffice.Office.Common/Misc/UseSystemFileDialog - org.openoffice.Office.Common/Misc/UseSystemPrintDialog - org.openoffice.Office.Common/Misc/SymbolStyle - org.openoffice.Office.Common/Passwords - org.openoffice.Office.Common/Print/PrintingModifiesDocument - org.openoffice.Office.Common/Print/Warning - org.openoffice.Office.Common/Vectorize - org.openoffice.Office.Common/Save - org.openoffice.Office.Common/SearchOptions - org.openoffice.Office.Common/Undo - org.openoffice.Office.Common/View/Dialog/Dialog/MiddleMouseButton - org.openoffice.Office.Common/View/Dialog/MousePositioning - org.openoffice.Office.Common/View/Localization - org.openoffice.Office.Common/View/Menu - org.openoffice.Office.Common/_3D_Engine + org.openoffice.Office.Compatibility + org.openoffice.Office.Custom + org.openoffice.Office.Embedding + org.openoffice.Office.Events + org.openoffice.Office.ExtendedColorScheme + org.openoffice.Office.Common/Accessibility + org.openoffice.Office.Common/Accessibility/AutoDetectSystemHC + org.openoffice.Office.Common/AsianLayout + org.openoffice.Office.Common/AutoCorrect + org.openoffice.Office.Common/Cache + org.openoffice.Office.Common/DateFormat + org.openoffice.Office.Common/ExternalMailer/Program + org.openoffice.Office.Common/Filter + org.openoffice.Office.Common/Font + org.openoffice.Office.Common/Forms + org.openoffice.Office.Common/Gallery + org.openoffice.Office.Common/Help + org.openoffice.Office.Common/History + org.openoffice.Office.Common/I18N + org.openoffice.Office.Common/InternalMSExport + org.openoffice.Office.Common/Load + org.openoffice.Office.Common/Misc/FormControlPilotsEnabled + org.openoffice.Office.Common/Misc/PluginsEnabled + org.openoffice.Office.Common/Misc/SymbolSet + org.openoffice.Office.Common/Misc/UseSystemFileDialog + org.openoffice.Office.Common/Misc/UseSystemPrintDialog + org.openoffice.Office.Common/Misc/SymbolStyle + org.openoffice.Office.Common/Passwords + org.openoffice.Office.Common/Print/PrintingModifiesDocument + org.openoffice.Office.Common/Print/Warning + org.openoffice.Office.Common/Vectorize + org.openoffice.Office.Common/Save + org.openoffice.Office.Common/SearchOptions + org.openoffice.Office.Common/Undo + org.openoffice.Office.Common/View/Dialog/Dialog/MiddleMouseButton + org.openoffice.Office.Common/View/Dialog/MousePositioning + org.openoffice.Office.Common/View/Localization + org.openoffice.Office.Common/View/Menu + org.openoffice.Office.Common/_3D_Engine - org.openoffice.Office.Common/_3D_Engine/OpenGL - org.openoffice.Office.Common/Help/Registration + org.openoffice.Office.Common/_3D_Engine/OpenGL + org.openoffice.Office.Common/Help/Registration @@ -910,9 +909,9 @@ - org.openoffice.Office.Writer - org.openoffice.Office.WriterWeb - + org.openoffice.Office.Writer + org.openoffice.Office.WriterWeb + org.openoffice.Office.Writer/Wizard diff --git a/officecfg/util/alllang.xsl b/officecfg/util/alllang.xsl index 339c6685fa0e..dafb45c85c11 100644 --- a/officecfg/util/alllang.xsl +++ b/officecfg/util/alllang.xsl @@ -100,7 +100,7 @@ - + @@ -275,7 +275,7 @@ - + @@ -285,7 +285,7 @@ - + -- cgit v1.2.3 From 7ff56983823047120541f724dfd2fb80b2a6432d Mon Sep 17 00:00:00 2001 From: sb Date: Fri, 26 Mar 2010 11:06:19 +0100 Subject: sb121: #i110203# added configmgr::update::insertModificationXcuFile and adapted old configuration data migration to it; some cleanup --- configmgr/inc/configmgr/update.hxx | 7 + configmgr/source/README | 1 + configmgr/source/components.cxx | 50 +++-- configmgr/source/components.hxx | 18 +- configmgr/source/makefile.mk | 1 + configmgr/source/partial.cxx | 137 ++++++++++++ configmgr/source/partial.hxx | 71 +++++++ configmgr/source/update.cxx | 19 ++ configmgr/source/xcdparser.cxx | 4 +- configmgr/source/xcdparser.hxx | 4 +- configmgr/source/xcsparser.cxx | 16 +- configmgr/source/xcsparser.hxx | 4 +- configmgr/source/xcuparser.cxx | 234 ++++++++++++--------- configmgr/source/xcuparser.hxx | 27 ++- desktop/source/app/makefile.mk | 1 + desktop/source/migration/migration.cxx | 195 ++++++++--------- desktop/source/migration/migration_impl.hxx | 5 - desktop/source/splash/makefile.mk | 1 + officecfg/registry/data/org/openoffice/Setup.xcu | 128 +++++------ officecfg/registry/schema/org/openoffice/Setup.xcs | 6 - 20 files changed, 594 insertions(+), 335 deletions(-) create mode 100644 configmgr/source/partial.cxx create mode 100644 configmgr/source/partial.hxx (limited to 'configmgr') diff --git a/configmgr/inc/configmgr/update.hxx b/configmgr/inc/configmgr/update.hxx index b27a32487400..3a152959342b 100644 --- a/configmgr/inc/configmgr/update.hxx +++ b/configmgr/inc/configmgr/update.hxx @@ -30,6 +30,8 @@ #include "sal/config.h" +#include + #include "configmgr/detail/configmgrdllapi.hxx" namespace rtl { class OUString; } @@ -44,6 +46,11 @@ OOO_DLLPUBLIC_CONFIGMGR void insertExtensionXcsFile( OOO_DLLPUBLIC_CONFIGMGR void insertExtensionXcuFile( bool shared, rtl::OUString const & fileUri); +OOO_DLLPUBLIC_CONFIGMGR void insertModificationXcuFile( + rtl::OUString const & fileUri, + std::set< rtl::OUString > const & includedPaths, + std::set< rtl::OUString > const & excludedPaths); + } } diff --git a/configmgr/source/README b/configmgr/source/README index 6d19a3b78610..b731043d34ed 100644 --- a/configmgr/source/README +++ b/configmgr/source/README @@ -76,6 +76,7 @@ update.cxx data.cxx lock.cxx nodemap.cxx +partial.cxx path.hxx type.cxx Utilities. diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx index cb8fb261e60e..6d97971e1a2c 100644 --- a/configmgr/source/components.cxx +++ b/configmgr/source/components.cxx @@ -59,6 +59,7 @@ #include "modifications.hxx" #include "node.hxx" #include "parsemanager.hxx" +#include "partial.hxx" #include "rootaccess.hxx" #include "writemodfile.hxx" #include "xcdparser.hxx" @@ -83,26 +84,29 @@ struct UnresolvedListItem { typedef std::list< UnresolvedListItem > UnresolvedList; -void parseXcsFile(rtl::OUString const & url, int layer, Data * data, +void parseXcsFile( + rtl::OUString const & url, int layer, Data & data, Partial const * partial, Modifications * modifications) SAL_THROW(( css::container::NoSuchElementException, css::uno::RuntimeException)) { - OSL_ASSERT(modifications == 0); (void) modifications; + OSL_ASSERT(partial == 0 && modifications == 0); + (void) partial; (void) modifications; OSL_VERIFY( rtl::Reference< ParseManager >( new ParseManager(url, new XcsParser(layer, data)))->parse()); } void parseXcuFile( - rtl::OUString const & url, int layer, Data * data, + rtl::OUString const & url, int layer, Data & data, Partial const * partial, Modifications * modifications) SAL_THROW(( css::container::NoSuchElementException, css::uno::RuntimeException)) { OSL_VERIFY( rtl::Reference< ParseManager >( - new ParseManager(url, new XcuParser(layer, data, modifications)))-> + new ParseManager( + url, new XcuParser(layer, data, partial, modifications)))-> parse()); } @@ -213,7 +217,7 @@ void Components::insertExtensionXcsFile( bool shared, rtl::OUString const & fileUri) { try { - parseXcsFile(fileUri, shared ? 9 : 13, &data_, 0); + parseXcsFile(fileUri, shared ? 9 : 13, data_, 0, 0); } catch (css::container::NoSuchElementException & e) { throw css::uno::RuntimeException( (rtl::OUString( @@ -229,7 +233,7 @@ void Components::insertExtensionXcuFile( { OSL_ASSERT(modifications != 0); try { - parseXcuFile(fileUri, shared ? 10 : 14, &data_, modifications); + parseXcuFile(fileUri, shared ? 10 : 14, data_, 0, modifications); } catch (css::container::NoSuchElementException & e) { throw css::uno::RuntimeException( (rtl::OUString( @@ -240,6 +244,24 @@ void Components::insertExtensionXcuFile( } } +void Components::insertModificationXcuFile( + rtl::OUString const & fileUri, + std::set< rtl::OUString > const & includedPaths, + std::set< rtl::OUString > const & excludedPaths, + Modifications * modifications) +{ + OSL_ASSERT(modifications != 0); + try { + Partial part(includedPaths, excludedPaths); + parseXcuFile(fileUri, Data::NO_LAYER, data_, &part, modifications); + } catch (css::uno::Exception & e) { //TODO: more specific exception catching + OSL_TRACE( + "configmgr error inserting %s: %s", + rtl::OUStringToOString(fileUri, RTL_TEXTENCODING_UTF8).getStr(), + rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).getStr()); + } +} + css::beans::Optional< css::uno::Any > Components::getExternalValue( rtl::OUString const & descriptor) { @@ -397,8 +419,7 @@ Components::Components( Components::~Components() {} void Components::parseFiles( - int layer, rtl::OUString const & extension, - void (* parseFile)(rtl::OUString const &, int, Data *, Modifications *), + int layer, rtl::OUString const & extension, FileParser * parseFile, rtl::OUString const & url, bool recursive) { osl::Directory dir(url); @@ -448,7 +469,7 @@ void Components::parseFiles( file.match(extension, file.getLength() - extension.getLength())) { try { - (*parseFile)(stat.getFileURL(), layer, &data_, 0); + (*parseFile)(stat.getFileURL(), layer, data_, 0, 0); } catch (css::container::NoSuchElementException & e) { throw css::uno::RuntimeException( (rtl::OUString( @@ -463,16 +484,15 @@ void Components::parseFiles( } void Components::parseFileList( - int layer, - void (* parseFile)(rtl::OUString const &, int, Data *, Modifications *), - rtl::OUString const & urls, rtl::Bootstrap const & ini) + int layer, FileParser * parseFile, rtl::OUString const & urls, + rtl::Bootstrap const & ini) { for (sal_Int32 i = 0;;) { rtl::OUString url(urls.getToken(0, ' ', i)); if (url.getLength() != 0) { ini.expandMacrosFrom(url); //TODO: detect failure try { - (*parseFile)(url, layer, &data_, 0); + (*parseFile)(url, layer, data_, 0, 0); } catch (css::container::NoSuchElementException & e) { throw css::uno::RuntimeException( (rtl::OUString( @@ -540,7 +560,7 @@ void Components::parseXcdFiles(int layer, rtl::OUString const & url) { rtl::Reference< ParseManager > manager; try { manager = new ParseManager( - stat.getFileURL(), new XcdParser(layer, deps, &data_)); + stat.getFileURL(), new XcdParser(layer, deps, data_)); } catch (css::container::NoSuchElementException & e) { throw css::uno::RuntimeException( (rtl::OUString( @@ -631,7 +651,7 @@ rtl::OUString Components::getModificationFileUrl() const { void Components::parseModificationLayer() { try { - parseXcuFile(getModificationFileUrl(), Data::NO_LAYER, &data_, 0); + parseXcuFile(getModificationFileUrl(), Data::NO_LAYER, data_, 0, 0); } catch (css::container::NoSuchElementException &) { OSL_TRACE( "configmgr user registrymodifications.xcu does not (yet) exist"); diff --git a/configmgr/source/components.hxx b/configmgr/source/components.hxx index 8523b02cbbaf..a78ed325969d 100644 --- a/configmgr/source/components.hxx +++ b/configmgr/source/components.hxx @@ -58,6 +58,7 @@ namespace configmgr { class Broadcaster; class Modifications; class Node; +class Partial; class RootAccess; class Components: private boost::noncopyable { @@ -96,10 +97,19 @@ public: bool shared, rtl::OUString const & fileUri, Modifications * modifications); + void insertModificationXcuFile( + rtl::OUString const & fileUri, + std::set< rtl::OUString > const & includedPaths, + std::set< rtl::OUString > const & excludedPaths, + Modifications * modifications); + com::sun::star::beans::Optional< com::sun::star::uno::Any > getExternalValue(rtl::OUString const & descriptor); private: + typedef void FileParser( + rtl::OUString const &, int, Data &, Partial const *, Modifications *); + Components( com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > const & context); @@ -107,14 +117,12 @@ private: ~Components(); void parseFiles( - int layer, rtl::OUString const & extension, - void (* parseFile)(rtl::OUString const &, int, Data *, Modifications *), + int layer, rtl::OUString const & extension, FileParser * parseFile, rtl::OUString const & url, bool recursive); void parseFileList( - int layer, - void (* parseFile)(rtl::OUString const &, int, Data *, Modifications *), - rtl::OUString const & urls, rtl::Bootstrap const & ini); + int layer, FileParser * parseFile, rtl::OUString const & urls, + rtl::Bootstrap const & ini); void parseXcdFiles(int layer, rtl::OUString const & url); diff --git a/configmgr/source/makefile.mk b/configmgr/source/makefile.mk index d6972e12b9d8..317e08bdf49c 100644 --- a/configmgr/source/makefile.mk +++ b/configmgr/source/makefile.mk @@ -54,6 +54,7 @@ SLOFILES = \ $(SLO)/nodemap.obj \ $(SLO)/pad.obj \ $(SLO)/parsemanager.obj \ + $(SLO)/partial.obj \ $(SLO)/propertynode.obj \ $(SLO)/rootaccess.obj \ $(SLO)/services.obj \ diff --git a/configmgr/source/partial.cxx b/configmgr/source/partial.cxx new file mode 100644 index 000000000000..4c9189ed05c4 --- /dev/null +++ b/configmgr/source/partial.cxx @@ -0,0 +1,137 @@ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* +* for a copy of the LGPLv3 License. +* +************************************************************************/ + +#include "precompiled_configmgr.hxx" +#include "sal/config.h" + +#include +#include + +#include "com/sun/star/uno/Reference.hxx" +#include "com/sun/star/uno/RuntimeException.hpp" +#include "com/sun/star/uno/XInterface.hpp" +#include "osl/diagnose.h" +#include "rtl/ustring.h" +#include "rtl/ustring.hxx" +#include "sal/types.h" + +#include "data.hxx" +#include "partial.hxx" + +namespace configmgr { + +namespace { + +namespace css = com::sun::star; + +bool parseSegment( + rtl::OUString const & path, sal_Int32 * index, rtl::OUString * segment) +{ + OSL_ASSERT( + index != 0 && *index >= 0 && *index <= path.getLength() && + segment != 0); + if (path[(*index)++] == '/') { + rtl::OUString name; + bool setElement; + rtl::OUString templateName; + *index = Data::parseSegment( + path, *index, &name, &setElement, &templateName); + if (*index != -1) { + *segment = Data::createSegment(templateName, name); + return *index == path.getLength(); + } + } + throw css::uno::RuntimeException( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bad path ")) + path, + css::uno::Reference< css::uno::XInterface >()); +} + +} + +Partial::Partial( + std::set< rtl::OUString > const & includedPaths, + std::set< rtl::OUString > const & excludedPaths) +{ + for (std::set< rtl::OUString >::const_iterator i(includedPaths.begin()); + i != includedPaths.end(); ++i) + { + sal_Int32 n = 0; + for (Node * p = &root_;;) { + rtl::OUString seg; + bool end = parseSegment(*i, &n, &seg); + p = &p->children[seg]; + if (p->startInclude) { + break; + } + if (end) { + p->children.clear(); + p->startInclude = true; + break; + } + } + } + for (std::set< rtl::OUString >::const_iterator i(excludedPaths.begin()); + i != excludedPaths.end(); ++i) + { + sal_Int32 n = 0; + for (Node * p = &root_;;) { + rtl::OUString seg; + bool end = parseSegment(*i, &n, &seg); + if (end) { + p->children[seg] = Node(); + break; + } + Node::Children::iterator j(p->children.find(seg)); + if (j == p->children.end()) { + break; + } + p = &j->second; + } + } +} + +Partial::~Partial() {} + +Partial::Containment Partial::contains(Path const & path) const { + //TODO: For set elements, the segment names recorded in the node tree need + // not match the corresponding path segments, so this function can fail. + Node const * p = &root_; + bool includes = false; + for (Path::const_iterator i(path.begin()); i != path.end(); ++i) { + Node::Children::const_iterator j(p->children.find(*i)); + if (j == p->children.end()) { + break; + } + p = &j->second; + includes |= p->startInclude; + } + return p->children.empty() && !p->startInclude + ? CONTAINS_NOT + : includes ? CONTAINS_NODE : CONTAINS_SUBNODES; +} + +} diff --git a/configmgr/source/partial.hxx b/configmgr/source/partial.hxx new file mode 100644 index 000000000000..39931448c66d --- /dev/null +++ b/configmgr/source/partial.hxx @@ -0,0 +1,71 @@ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* +* for a copy of the LGPLv3 License. +* +************************************************************************/ + +#ifndef INCLUDED_CONFIGMGR_SOURCE_PARTIAL_HXX +#define INCLUDED_CONFIGMGR_SOURCE_PARTIAL_HXX + +#include "sal/config.h" + +#include +#include + +#include "boost/noncopyable.hpp" + +#include "path.hxx" + +namespace rtl { class OUString; } + +namespace configmgr { + +class Partial: private boost::noncopyable { +public: + enum Containment { CONTAINS_NOT, CONTAINS_SUBNODES, CONTAINS_NODE }; + + Partial( + std::set< rtl::OUString > const & includedPaths, + std::set< rtl::OUString > const & excludedPaths); + + ~Partial(); + + Containment contains(Path const & path) const; + +private: + struct Node { + typedef std::map< rtl::OUString, Node > Children; + + Node(): startInclude(false) {} + + Children children; + bool startInclude; + }; + + Node root_; +}; + +} + +#endif diff --git a/configmgr/source/update.cxx b/configmgr/source/update.cxx index ab711c3bec10..57f45068d954 100644 --- a/configmgr/source/update.cxx +++ b/configmgr/source/update.cxx @@ -28,6 +28,8 @@ #include "precompiled_configmgr.hxx" #include "sal/config.h" +#include + #include "configmgr/update.hxx" #include "osl/mutex.hxx" #include "rtl/ref.hxx" @@ -61,6 +63,23 @@ void insertExtensionXcuFile(bool shared, rtl::OUString const & fileUri) { bc.send(); } +void insertModificationXcuFile( + rtl::OUString const & fileUri, + std::set< rtl::OUString > const & includedPaths, + std::set< rtl::OUString > const & excludedPaths) +{ + Broadcaster bc; + { + osl::MutexGuard g(lock); + Modifications mods; + Components::getSingleton().insertModificationXcuFile( + fileUri, includedPaths, excludedPaths, &mods); + Components::getSingleton().initGlobalBroadcaster( + mods, rtl::Reference< RootAccess >(), &bc); + } + bc.send(); +} + } } diff --git a/configmgr/source/xcdparser.cxx b/configmgr/source/xcdparser.cxx index 8306c692c30f..498254b35644 100644 --- a/configmgr/source/xcdparser.cxx +++ b/configmgr/source/xcdparser.cxx @@ -53,7 +53,7 @@ namespace css = com::sun::star; } -XcdParser::XcdParser(int layer, Dependencies const & dependencies, Data * data): +XcdParser::XcdParser(int layer, Dependencies const & dependencies, Data & data): layer_(layer), dependencies_(dependencies), data_(data), state_(STATE_START) {} @@ -137,7 +137,7 @@ bool XcdParser::startElement( if (ns == XmlReader::NAMESPACE_OOR && name.equals(RTL_CONSTASCII_STRINGPARAM("component-data"))) { - nestedParser_ = new XcuParser(layer_ + 1, data_, 0); + nestedParser_ = new XcuParser(layer_ + 1, data_, 0, 0); nesting_ = 1; return nestedParser_->startElement(reader, ns, name); } diff --git a/configmgr/source/xcdparser.hxx b/configmgr/source/xcdparser.hxx index 2e35b3686e60..2ad8ecea7f93 100644 --- a/configmgr/source/xcdparser.hxx +++ b/configmgr/source/xcdparser.hxx @@ -47,7 +47,7 @@ class XcdParser: public Parser { public: typedef std::set< rtl::OUString > Dependencies; - XcdParser(int layer, Dependencies const & dependencies, Data * data); + XcdParser(int layer, Dependencies const & dependencies, Data & data); private: virtual ~XcdParser(); @@ -66,7 +66,7 @@ private: int layer_; Dependencies const & dependencies_; - Data * data_; + Data & data_; State state_; rtl::OUString dependency_; rtl::Reference< Parser > nestedParser_; diff --git a/configmgr/source/xcsparser.cxx b/configmgr/source/xcsparser.cxx index 3fc719f00fe9..12e64ebbe171 100644 --- a/configmgr/source/xcsparser.cxx +++ b/configmgr/source/xcsparser.cxx @@ -119,7 +119,7 @@ void merge( } -XcsParser::XcsParser(int layer, Data * data): +XcsParser::XcsParser(int layer, Data & data): valueParser_(layer), data_(data), state_(STATE_START) {} @@ -279,9 +279,9 @@ void XcsParser::endElement(XmlReader const & reader) { switch (state_) { case STATE_TEMPLATES: { - NodeMap::iterator i(data_->templates.find(top.name)); - if (i == data_->templates.end()) { - data_->templates.insert( + NodeMap::iterator i(data_.templates.find(top.name)); + if (i == data_.templates.end()) { + data_.templates.insert( NodeMap::value_type(top.name, top.node)); } else { merge(i->second, top.node); @@ -290,9 +290,9 @@ void XcsParser::endElement(XmlReader const & reader) { break; case STATE_COMPONENT: { - NodeMap::iterator i(data_->components.find(top.name)); - if (i == data_->components.end()) { - data_->components.insert( + NodeMap::iterator i(data_.components.find(top.name)); + if (i == data_.components.end()) { + data_.components.insert( NodeMap::value_type(top.name, top.node)); } else { merge(i->second, top.node); @@ -443,7 +443,7 @@ void XcsParser::handleNodeRef(XmlReader & reader) { css::uno::Reference< css::uno::XInterface >()); } rtl::Reference< Node > tmpl( - data_->getTemplate( + data_.getTemplate( valueParser_.getLayer(), xmldata::parseTemplateReference( component, hasNodeType, nodeType, 0))); diff --git a/configmgr/source/xcsparser.hxx b/configmgr/source/xcsparser.hxx index 21a124945a2e..196add9a826a 100644 --- a/configmgr/source/xcsparser.hxx +++ b/configmgr/source/xcsparser.hxx @@ -48,7 +48,7 @@ struct Span; class XcsParser: public Parser { public: - XcsParser(int layer, Data * data); + XcsParser(int layer, Data & data); private: virtual ~XcsParser(); @@ -94,7 +94,7 @@ private: typedef std::stack< Element > ElementStack; ValueParser valueParser_; - Data * data_; + Data & data_; rtl::OUString componentName_; State state_; long ignoring_; diff --git a/configmgr/source/xcuparser.cxx b/configmgr/source/xcuparser.cxx index 80dc501e9435..77b0f747f313 100644 --- a/configmgr/source/xcuparser.cxx +++ b/configmgr/source/xcuparser.cxx @@ -49,6 +49,7 @@ #include "modifications.hxx" #include "node.hxx" #include "nodemap.hxx" +#include "partial.hxx" #include "path.hxx" #include "propertynode.hxx" #include "setnode.hxx" @@ -65,14 +66,15 @@ namespace css = com::sun::star; } -XcuParser::XcuParser(int layer, Data * data, Modifications * modifications): - valueParser_(layer), data_(data), modifications_(modifications) -{ - if (layer == Data::NO_LAYER) { - OSL_ASSERT(modifications_ == 0); - modifications_ = &data_->modifications; - } -} +XcuParser::XcuParser( + int layer, Data & data, Partial const * partial, + Modifications * broadcastModifications): + valueParser_(layer), data_(data), + partial_(partial), broadcastModifications_(broadcastModifications), + recordModifications_(layer == Data::NO_LAYER), + trackPath_( + partial_ != 0 || broadcastModifications_ != 0 || recordModifications_) +{} XcuParser::~XcuParser() {} @@ -105,7 +107,7 @@ bool XcuParser::startElement( css::uno::Reference< css::uno::XInterface >()); } } else if (state_.top().ignore) { - state_.push(state_.top()); + state_.push(State(false)); } else if (!state_.top().node.is()) { if (ns == XmlReader::NAMESPACE_NONE && name.equals(RTL_CONSTASCII_STRINGPARAM("item"))) @@ -214,7 +216,7 @@ void XcuParser::endElement(XmlReader const &) { return; } OSL_ASSERT(!state_.empty()); - bool ignore = state_.top().ignore; + bool pop = state_.top().pop; rtl::Reference< Node > insert; rtl::OUString name; if (state_.top().insert) { @@ -227,10 +229,10 @@ void XcuParser::endElement(XmlReader const &) { OSL_ASSERT(!state_.empty() && state_.top().node.is()); state_.top().node->getMembers()[name] = insert; } - if (!ignore && !modificationPath_.empty()) { - modificationPath_.pop_back(); + if (pop && !path_.empty()) { + path_.pop_back(); // will pop less than pushed, but that is harmless, - // as the next will reset modificationPath_ + // as the next will reset path_ } } @@ -328,9 +330,18 @@ void XcuParser::handleComponentData(XmlReader & reader) { } componentName_ = xmldata::convertFromUtf8( Span(buf.getStr(), buf.getLength())); + if (trackPath_) { + OSL_ASSERT(path_.empty()); + path_.push_back(componentName_); + if (partial_ != 0 && partial_->contains(path_) == Partial::CONTAINS_NOT) + { + state_.push(State(true)); // ignored + return; + } + } rtl::Reference< Node > node( Data::findNode( - valueParser_.getLayer(), data_->components, componentName_)); + valueParser_.getLayer(), data_.components, componentName_)); if (!node.is()) { OSL_TRACE( "configmgr unknown component %s in %s", @@ -338,7 +349,7 @@ void XcuParser::handleComponentData(XmlReader & reader) { componentName_, RTL_TEXTENCODING_UTF8).getStr(), rtl::OUStringToOString( reader.getUrl(), RTL_TEXTENCODING_UTF8).getStr()); - state_.push(State()); // ignored + state_.push(State(true)); // ignored return; } switch (op) { @@ -358,10 +369,6 @@ void XcuParser::handleComponentData(XmlReader & reader) { node->getFinalized()); node->setFinalized(finalizedLayer); state_.push(State(node, finalizedLayer < valueParser_.getLayer())); - if (modifications_ != 0) { - OSL_ASSERT(modificationPath_.empty()); - modificationPath_.push_back(componentName_); - } } void XcuParser::handleItem(XmlReader & reader) { @@ -388,17 +395,27 @@ void XcuParser::handleItem(XmlReader & reader) { rtl::OUString path(xmldata::convertFromUtf8(attrPath)); int finalizedLayer; rtl::Reference< Node > node( - data_->resolvePathRepresentation( - path, &modificationPath_, &finalizedLayer)); + data_.resolvePathRepresentation(path, &path_, &finalizedLayer)); if (!node.is()) { OSL_TRACE( "configmgr unknown item %s in %s", rtl::OUStringToOString(path, RTL_TEXTENCODING_UTF8).getStr(), rtl::OUStringToOString( reader.getUrl(), RTL_TEXTENCODING_UTF8).getStr()); - state_.push(State()); // ignored + state_.push(State(true)); // ignored return; } + OSL_ASSERT(!path_.empty()); + componentName_ = path_.front(); + if (trackPath_) { + if (partial_ != 0 && partial_->contains(path_) == Partial::CONTAINS_NOT) + { + state_.push(State(true)); // ignored + return; + } + } else { + path_.clear(); + } switch (node->kind()) { case Node::KIND_PROPERTY: case Node::KIND_LOCALIZED_VALUE: @@ -407,7 +424,7 @@ void XcuParser::handleItem(XmlReader & reader) { rtl::OUStringToOString(path, RTL_TEXTENCODING_UTF8).getStr(), rtl::OUStringToOString( reader.getUrl(), RTL_TEXTENCODING_UTF8).getStr()); - state_.push(State()); // ignored + state_.push(State(true)); // ignored return; case Node::KIND_LOCALIZED_PROPERTY: valueParser_.type_ = dynamic_cast< LocalizedPropertyNode * >( @@ -416,11 +433,6 @@ void XcuParser::handleItem(XmlReader & reader) { default: break; } - OSL_ASSERT(!modificationPath_.empty()); - componentName_ = modificationPath_.front(); - if (modifications_ == 0) { - modificationPath_.clear(); - } state_.push(State(node, finalizedLayer < valueParser_.getLayer())); } @@ -496,13 +508,13 @@ void XcuParser::handlePropValue(XmlReader & reader, PropertyNode * prop) { css::uno::Reference< css::uno::XInterface >()); } prop->setValue(valueParser_.getLayer(), css::uno::Any()); - state_.push(State()); + state_.push(State(false)); } else if (external.getLength() == 0) { valueParser_.separator_ = separator; valueParser_.start(prop); } else { prop->setExternal(valueParser_.getLayer(), external); - state_.push(State()); + state_.push(State(false)); } } @@ -559,11 +571,20 @@ void XcuParser::handleLocpropValue( op = parseOperation(reader.getAttributeValue(true)); } } + if (trackPath_) { + path_.push_back(name); + if (partial_ != 0 && + partial_->contains(path_) != Partial::CONTAINS_NODE) + { + state_.push(State(true)); // ignored + return; + } + } NodeMap::iterator i(locprop->getMembers().find(name)); if (i != locprop->getMembers().end() && i->second->getLayer() > valueParser_.getLayer()) { - state_.push(State()); // ignored + state_.push(State(true)); // ignored return; } if (nil && !locprop->isNillable()) { @@ -576,23 +597,29 @@ void XcuParser::handleLocpropValue( } switch (op) { case OPERATION_FUSE: - if (nil) { - if (i == locprop->getMembers().end()) { - locprop->getMembers()[name] = new LocalizedValueNode( - valueParser_.getLayer(), css::uno::Any()); + { + bool pop = false; + if (nil) { + if (i == locprop->getMembers().end()) { + locprop->getMembers()[name] = new LocalizedValueNode( + valueParser_.getLayer(), css::uno::Any()); + } else { + dynamic_cast< LocalizedValueNode * >( + i->second.get())->setValue( + valueParser_.getLayer(), css::uno::Any()); + } + state_.push(State(true)); } else { - dynamic_cast< LocalizedValueNode * >(i->second.get())->setValue( - valueParser_.getLayer(), css::uno::Any()); + valueParser_.separator_ = separator; + valueParser_.start(locprop, name); + pop = true; + } + if (trackPath_) { + recordModification(); + if (pop) { + path_.pop_back(); + } } - state_.push(State()); - } else { - valueParser_.separator_ = separator; - valueParser_.start(locprop, name); - } - if (modifications_ != 0) { - modificationPath_.push_back(name); - modifications_->add(modificationPath_); - modificationPath_.pop_back(); } break; case OPERATION_REMOVE: @@ -601,12 +628,8 @@ void XcuParser::handleLocpropValue( if (i != locprop->getMembers().end()) { locprop->getMembers().erase(i); } - state_.push(State()); - if (modifications_ != 0) { - modificationPath_.push_back(name); - modifications_->add(modificationPath_); - modificationPath_.pop_back(); - } + state_.push(State(true)); + recordModification(); break; default: throw css::uno::RuntimeException( @@ -656,6 +679,17 @@ void XcuParser::handleGroupProp(XmlReader & reader, GroupNode * group) { reader.getUrl()), css::uno::Reference< css::uno::XInterface >()); } + if (trackPath_) { + path_.push_back(name); + //TODO: This ignores locprop values for which specific include paths + // exist (i.e., for which contains(locprop path) = CONTAINS_SUBNODES): + if (partial_ != 0 && + partial_->contains(path_) != Partial::CONTAINS_NODE) + { + state_.push(State(true)); // ignored + return; + } + } NodeMap::iterator i(group->getMembers().find(name)); if (i == group->getMembers().end()) { handleUnknownGroupProp(reader, group, name, type, op, finalized); @@ -707,10 +741,7 @@ void XcuParser::handleUnknownGroupProp( prop->setFinalized(valueParser_.getLayer()); } state_.push(State(prop, name, state_.top().locked)); - if (modifications_ != 0) { - modificationPath_.push_back(name); - modifications_->add(modificationPath_); - } + recordModification(); break; } // fall through @@ -720,7 +751,7 @@ void XcuParser::handleUnknownGroupProp( rtl::OUStringToOString(name, RTL_TEXTENCODING_UTF8).getStr(), rtl::OUStringToOString( reader.getUrl(), RTL_TEXTENCODING_UTF8).getStr()); - state_.push(State()); + state_.push(State(true)); // ignored break; } } @@ -733,7 +764,7 @@ void XcuParser::handlePlainGroupProp( PropertyNode * property = dynamic_cast< PropertyNode * >( propertyIndex->second.get()); if (property->getLayer() > valueParser_.getLayer()) { - state_.push(State()); // ignored + state_.push(State(true)); // ignored return; } int finalizedLayer = std::min( @@ -760,10 +791,7 @@ void XcuParser::handlePlainGroupProp( property, (state_.top().locked || finalizedLayer < valueParser_.getLayer()))); - if (modifications_ != 0) { - modificationPath_.push_back(name); - modifications_->add(modificationPath_); - } + recordModification(); break; case OPERATION_REMOVE: if (!property->isExtension()) { @@ -776,12 +804,8 @@ void XcuParser::handlePlainGroupProp( css::uno::Reference< css::uno::XInterface >()); } group->getMembers().erase(propertyIndex); - state_.push(State()); // ignore children - if (modifications_ != 0) { - modificationPath_.push_back(name); - modifications_->add(modificationPath_); - modificationPath_.pop_back(); - } + state_.push(State(true)); // ignore children + recordModification(); break; } } @@ -791,7 +815,7 @@ void XcuParser::handleLocalizedGroupProp( rtl::OUString const & name, Type type, Operation operation, bool finalized) { if (property->getLayer() > valueParser_.getLayer()) { - state_.push(State()); // ignored + state_.push(State(true)); // ignored return; } int finalizedLayer = std::min( @@ -817,9 +841,6 @@ void XcuParser::handleLocalizedGroupProp( property, (state_.top().locked || finalizedLayer < valueParser_.getLayer()))); - if (modifications_ != 0) { - modificationPath_.push_back(name); - } break; case OPERATION_REPLACE: { @@ -833,10 +854,7 @@ void XcuParser::handleLocalizedGroupProp( replacement, name, (state_.top().locked || finalizedLayer < valueParser_.getLayer()))); - if (modifications_ != 0) { - modificationPath_.push_back(name); - modifications_->add(modificationPath_); - } + recordModification(); } break; case OPERATION_REMOVE: @@ -885,6 +903,14 @@ void XcuParser::handleGroupNode( reader.getUrl()), css::uno::Reference< css::uno::XInterface >()); } + if (trackPath_) { + path_.push_back(name); + if (partial_ != 0 && partial_->contains(path_) == Partial::CONTAINS_NOT) + { + state_.push(State(true)); // ignored + return; + } + } rtl::Reference< Node > child( Data::findNode(valueParser_.getLayer(), group->getMembers(), name)); if (!child.is()) { @@ -893,7 +919,7 @@ void XcuParser::handleGroupNode( rtl::OUStringToOString(name, RTL_TEXTENCODING_UTF8).getStr(), rtl::OUStringToOString( reader.getUrl(), RTL_TEXTENCODING_UTF8).getStr()); - state_.push(State()); // ignored + state_.push(State(true)); // ignored return; } if (op != OPERATION_MODIFY && op != OPERATION_FUSE) { @@ -912,9 +938,6 @@ void XcuParser::handleGroupNode( State( child, state_.top().locked || finalizedLayer < valueParser_.getLayer())); - if (modifications_ != 0) { - modificationPath_.push_back(name); - } } void XcuParser::handleSetNode(XmlReader & reader, SetNode * set) { @@ -969,6 +992,14 @@ void XcuParser::handleSetNode(XmlReader & reader, SetNode * set) { reader.getUrl()), css::uno::Reference< css::uno::XInterface >()); } + if (trackPath_) { + path_.push_back(name); + if (partial_ != 0 && partial_->contains(path_) == Partial::CONTAINS_NOT) + { + state_.push(State(true)); // ignored + return; + } + } rtl::OUString templateName( xmldata::parseTemplateReference( component, hasNodeType, nodeType, &set->getDefaultTemplateName())); @@ -983,7 +1014,7 @@ void XcuParser::handleSetNode(XmlReader & reader, SetNode * set) { css::uno::Reference< css::uno::XInterface >()); } rtl::Reference< Node > tmpl( - data_->getTemplate(valueParser_.getLayer(), templateName)); + data_.getTemplate(valueParser_.getLayer(), templateName)); if (!tmpl.is()) { throw css::uno::RuntimeException( (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("set member node ")) + @@ -1004,7 +1035,7 @@ void XcuParser::handleSetNode(XmlReader & reader, SetNode * set) { mandatoryLayer = std::min(mandatoryLayer, i->second->getMandatory()); i->second->setMandatory(mandatoryLayer); if (i->second->getLayer() > valueParser_.getLayer()) { - state_.push(State()); // ignored + state_.push(State(true)); // ignored return; } } @@ -1012,48 +1043,39 @@ void XcuParser::handleSetNode(XmlReader & reader, SetNode * set) { case OPERATION_MODIFY: if (i == set->getMembers().end()) { OSL_TRACE("ignoring modify of unknown set member node"); - state_.push(State()); + state_.push(State(true)); // ignored } else { state_.push( State( i->second, (state_.top().locked || finalizedLayer < valueParser_.getLayer()))); - if (modifications_ != 0) { - modificationPath_.push_back(name); - } } break; case OPERATION_REPLACE: if (state_.top().locked || finalizedLayer < valueParser_.getLayer()) { - state_.push(State()); // ignored + state_.push(State(true)); // ignored } else { rtl::Reference< Node > member(tmpl->clone()); member->setLayer(valueParser_.getLayer()); member->setFinalized(finalizedLayer); member->setMandatory(mandatoryLayer); state_.push(State(member, name, false)); - if (modifications_ != 0) { - modificationPath_.push_back(name); - modifications_->add(modificationPath_); - } + recordModification(); } break; case OPERATION_FUSE: if (i == set->getMembers().end()) { if (state_.top().locked || finalizedLayer < valueParser_.getLayer()) { - state_.push(State()); // ignored + state_.push(State(true)); // ignored } else { rtl::Reference< Node > member(tmpl->clone()); member->setLayer(valueParser_.getLayer()); member->setFinalized(finalizedLayer); member->setMandatory(mandatoryLayer); state_.push(State(member, name, false)); - if (modifications_ != 0) { - modificationPath_.push_back(name); - modifications_->add(modificationPath_); - } + recordModification(); } } else { state_.push( @@ -1061,9 +1083,6 @@ void XcuParser::handleSetNode(XmlReader & reader, SetNode * set) { i->second, (state_.top().locked || finalizedLayer < valueParser_.getLayer()))); - if (modifications_ != 0) { - modificationPath_.push_back(name); - } } break; case OPERATION_REMOVE: @@ -1075,14 +1094,19 @@ void XcuParser::handleSetNode(XmlReader & reader, SetNode * set) { { set->getMembers().erase(i); } - state_.push(State()); - if (modifications_ != 0) { - modificationPath_.push_back(name); - modifications_->add(modificationPath_); - modificationPath_.pop_back(); - } + state_.push(State(true)); + recordModification(); break; } } +void XcuParser::recordModification() { + if (broadcastModifications_ != 0) { + broadcastModifications_->add(path_); + } + if (recordModifications_) { + data_.modifications.add(path_); + } +} + } diff --git a/configmgr/source/xcuparser.hxx b/configmgr/source/xcuparser.hxx index 21806edebe9c..64108451b4ef 100644 --- a/configmgr/source/xcuparser.hxx +++ b/configmgr/source/xcuparser.hxx @@ -49,6 +49,7 @@ namespace configmgr { class GroupNode; class LocalizedPropertyNode; class Modifications; +class Partial; class PropertyNode; class SetNode; struct Data; @@ -56,7 +57,9 @@ struct Span; class XcuParser: public Parser { public: - XcuParser(int layer, Data * data, Modifications * modifications); + XcuParser( + int layer, Data & data, Partial const * partial, + Modifications * broadcastModifications); private: virtual ~XcuParser(); @@ -105,36 +108,44 @@ private: void handleSetNode(XmlReader & reader, SetNode * set); + void recordModification(); + struct State { rtl::Reference< Node > node; // empty iff ignore or rtl::OUString name; // empty and ignored if !insert bool ignore; bool insert; bool locked; + bool pop; - inline State(): ignore(true), insert(false), locked(false) {} + inline State(bool thePop): + ignore(true), insert(false), locked(false), pop(thePop) + {} inline State(rtl::Reference< Node > const & theNode, bool theLocked): - node(theNode), ignore(false), insert(false), locked(theLocked) + node(theNode), ignore(false), insert(false), locked(theLocked), + pop(true) {} inline State( rtl::Reference< Node > const & theNode, rtl::OUString const & theName, bool theLocked): node(theNode), name(theName), ignore(false), insert(true), - locked(theLocked) + locked(theLocked), pop(true) {} }; typedef std::stack< State > StateStack; ValueParser valueParser_; - Data * data_; - Modifications * modifications_; + Data & data_; + Partial const * partial_; + Modifications * broadcastModifications_; + bool recordModifications_; + bool trackPath_; rtl::OUString componentName_; StateStack state_; - Path modificationPath_; - rtl::OUString path_; + Path path_; }; } diff --git a/desktop/source/app/makefile.mk b/desktop/source/app/makefile.mk index d9db7c163481..83bec9011283 100644 --- a/desktop/source/app/makefile.mk +++ b/desktop/source/app/makefile.mk @@ -65,6 +65,7 @@ SHL1LIBS = $(SLB)$/mig.lib SHL1STDLIBS = \ $(COMPHELPERLIB) \ + $(CONFIGMGRLIB) \ $(CPPUHELPERLIB) \ $(CPPULIB) \ $(I18NISOLANGLIB) \ diff --git a/desktop/source/migration/migration.cxx b/desktop/source/migration/migration.cxx index 250fe58841f8..fd6193187402 100644 --- a/desktop/source/migration/migration.cxx +++ b/desktop/source/migration/migration.cxx @@ -28,14 +28,19 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_desktop.hxx" +#include +#include + #include "migration.hxx" #include "migration_impl.hxx" #include "cfgfilter.hxx" #include #include +#include #include #include +#include #include #include #include @@ -143,7 +148,6 @@ MigrationImpl::MigrationImpl(const uno::Reference< XMultiServiceFactory >& xFact , m_vrMigrations(readMigrationSteps()) , m_aInfo(findInstallation()) , m_vrFileList(compileFileList()) - , m_vrServiceList(compileServiceList()) { } @@ -159,9 +163,7 @@ sal_Bool MigrationImpl::doMigration() copyFiles(); // execute the migration items from Setup.xcu - // and refresh the cache copyConfig(); - refresh(); // execute custom migration services from Setup.xcu // and refresh the cache @@ -273,14 +275,6 @@ migrations_vr MigrationImpl::readMigrationSteps() tmpStep.excludeConfig.push_back(tmpSeq[j]); } - // config components - if (tmpAccess->getByName(OUString::createFromAscii("ServiceConfigComponents")) >>= tmpSeq) - { - for (sal_Int32 j=0; jgetByName(OUString::createFromAscii("MigrationService")) >>= tmpStep.service; @@ -445,80 +439,88 @@ strings_vr MigrationImpl::compileFileList() return vrResult; } +namespace { -void MigrationImpl::copyConfig() -{ - try { - // 1. get a list of all components from hierachy browser - uno::Reference< XJob > xBrowser(m_xFactory->createInstance( - OUString::createFromAscii("com.sun.star.configuration.backend.LocalHierarchyBrowser")), uno::UNO_QUERY_THROW); - - uno::Sequence< NamedValue > seqArgs(2); - seqArgs[0] = NamedValue( - OUString::createFromAscii("LayerDataUrl"), - uno::makeAny(m_aInfo.userdata + OUString::createFromAscii("/user/registry"))); - seqArgs[1] = NamedValue( - OUString::createFromAscii("FetchComponentNames"), - uno::makeAny(sal_True)); - - // execute the search - uno::Any aResult = xBrowser->execute(seqArgs); - uno::Sequence< OUString > seqComponents; - aResult >>= seqComponents; - OSL_ENSURE(seqComponents.getLength()>0, "MigrationImpl::copyConfig(): no config components available"); - - // 2. create an importer - uno::Reference< XJob > xImporter(m_xFactory->createInstance( - OUString::createFromAscii("com.sun.star.configuration.backend.LocalDataImporter")), uno::UNO_QUERY_THROW); - - // 3. for each migration step... - uno::Sequence< NamedValue > importerArgs(3); - importerArgs[0] = NamedValue( - OUString::createFromAscii("LayerDataUrl"), - uno::makeAny(m_aInfo.userdata + OUString::createFromAscii("/user/registry"))); - importerArgs[1] = NamedValue( - OUString::createFromAscii("LayerFilter"), - uno::Any()); - importerArgs[2] = NamedValue( - OUString::createFromAscii("Component"), - uno::Any()); - - migrations_v::const_iterator i_mig = m_vrMigrations->begin(); - while (i_mig != m_vrMigrations->end()) - { - // a. create config filter for step - uno::Reference< XInitialization > xFilter( - new CConfigFilter(&(i_mig->includeConfig), &(i_mig->excludeConfig))); - importerArgs[1].Value = uno::makeAny(xFilter); +struct componentParts { + std::set< rtl::OUString > includedPaths; + std::set< rtl::OUString > excludedPaths; +}; - // b. run each importer with config filter - for (sal_Int32 i=0; iexecute(importerArgs); - Exception myException; - if (aResult >>= myException) throw myException; - } catch(Exception& aException) { - OString aMsg("Exception in config layer import.\ncomponent: "); - aMsg += OUStringToOString(seqComponents[i], RTL_TEXTENCODING_ASCII_US); - aMsg += "\nmessage: "; - aMsg += OUStringToOString(aException.Message, RTL_TEXTENCODING_ASCII_US); - OSL_ENSURE(sal_False, aMsg.getStr()); - } +typedef std::map< rtl::OUString, componentParts > Components; + +bool getComponent(rtl::OUString const & path, rtl::OUString * component) { + OSL_ASSERT(component != 0); + if (path.getLength() == 0 || path[0] != '/') { + OSL_TRACE( + ("configuration migration in/exclude path %s ignored (does not" + " start with slash)"), + rtl::OUStringToOString(path, RTL_TEXTENCODING_UTF8).getStr()); + return false; + } + sal_Int32 i = path.indexOf('/', 1); + *component = i < 0 ? path.copy(1) : path.copy(1, i - 1); + return true; +} + +} + +void MigrationImpl::copyConfig() { + Components comps; + for (migrations_v::const_iterator i(m_vrMigrations->begin()); + i != m_vrMigrations->end(); ++i) + { + for (strings_v::const_iterator j(i->includeConfig.begin()); + j != i->includeConfig.end(); ++j) + { + rtl::OUString comp; + if (getComponent(*j, &comp)) { + comps[comp].includedPaths.insert(*j); + } + } + for (strings_v::const_iterator j(i->excludeConfig.begin()); + j != i->excludeConfig.end(); ++j) + { + rtl::OUString comp; + if (getComponent(*j, &comp)) { + comps[comp].excludedPaths.insert(*j); } - i_mig++; } } - catch (Exception& e) - { - OString aMsg("Exception in config layer import.\nmessage: "); - aMsg += OUStringToOString(e.Message, RTL_TEXTENCODING_ASCII_US); - OSL_ENSURE(sal_False, aMsg.getStr()); + for (Components::const_iterator i(comps.begin()); i != comps.end(); ++i) { + if (!i->second.includedPaths.empty()) { + rtl::OUStringBuffer buf(m_aInfo.userdata); + buf.appendAscii(RTL_CONSTASCII_STRINGPARAM("/user/registry/data")); + sal_Int32 n = 0; + do { + rtl::OUString seg(i->first.getToken(0, '.', n)); + rtl::OUString enc( + rtl::Uri::encode( + seg, rtl_UriCharClassPchar, rtl_UriEncodeStrict, + RTL_TEXTENCODING_UTF8)); + if (enc.getLength() == 0 && seg.getLength() != 0) { + OSL_TRACE( + ("configuration migration component %s ignored (cannot" + " be encoded as file path)"), + rtl::OUStringToOString( + i->first, RTL_TEXTENCODING_UTF8).getStr()); + goto next; + } + buf.append(sal_Unicode('/')); + buf.append(enc); + } while (n >= 0); + buf.appendAscii(RTL_CONSTASCII_STRINGPARAM(".xcu")); + configmgr::update::insertModificationXcuFile( + buf.makeStringAndClear(), i->second.includedPaths, + i->second.excludedPaths); + } else { + OSL_TRACE( + ("configuration migration component %s ignored (only excludes," + " no includes)"), + rtl::OUStringToOString( + i->first, RTL_TEXTENCODING_UTF8).getStr()); + } + next:; } - - } // removes elements of vector 2 in vector 1 @@ -637,7 +639,7 @@ void MigrationImpl::runServices() aStratumSvc, stratumArgs), uno::UNO_QUERY); // Build argument array - uno::Sequence< uno::Any > seqArguments(3); + uno::Sequence< uno::Any > seqArguments(2); seqArguments[0] = uno::makeAny(NamedValue( OUString::createFromAscii("Productname"), uno::makeAny(m_aInfo.productname))); @@ -658,26 +660,6 @@ void MigrationImpl::runServices() try { - // create access to old configuration components in the user layer - // that were requested by the migration service - uno::Sequence< NamedValue > seqComponents(i_mig->configComponents.size()); - strings_v::const_iterator i_comp = i_mig->configComponents.begin(); - sal_Int32 i = 0; - while (i_comp != i_mig->configComponents.end() && xStartum.is()) - { - // create Layer for i_comp - seqComponents[i] = NamedValue( - *i_comp, uno::makeAny(xStartum->getLayer(*i_comp, OUString()))); - - // next component - i_comp++; - i++; - } - // set old config argument - seqArguments[2] = uno::makeAny(NamedValue( - OUString::createFromAscii("OldConfiguration"), - uno::makeAny(seqComponents))); - xMigrationJob = uno::Reference< XJob >(m_xFactory->createInstanceWithArguments( i_mig->service, seqArguments), uno::UNO_QUERY_THROW); @@ -703,17 +685,4 @@ void MigrationImpl::runServices() } } - -strings_vr MigrationImpl::compileServiceList() -{ - strings_vr vrResult(new strings_v); - migrations_v::const_iterator i_migr = m_vrMigrations->begin(); - while (i_migr != m_vrMigrations->end()) - { - vrResult->push_back(i_migr->service); - i_migr++; - } - return vrResult; -} - } // namespace desktop diff --git a/desktop/source/migration/migration_impl.hxx b/desktop/source/migration/migration_impl.hxx index 95b0c3535a80..8077f92a6d19 100644 --- a/desktop/source/migration/migration_impl.hxx +++ b/desktop/source/migration/migration_impl.hxx @@ -64,7 +64,6 @@ struct migration_step strings_v excludeFiles; strings_v includeConfig; strings_v excludeConfig; - strings_v configComponents; rtl::OUString service; }; @@ -80,15 +79,11 @@ private: migrations_vr m_vrMigrations; // list of all migration specs from config install_info m_aInfo; // info about the version being migrated strings_vr m_vrFileList; // final list of files to be copied - strings_vr m_vrConfigList; // final list of nodes to be copied - strings_vr m_vrServiceList; // final list of services to be called // initializer functions... migrations_vr readMigrationSteps(); install_info findInstallation(); strings_vr compileFileList(); - strings_vr compileConfigList(); - strings_vr compileServiceList(); // helpers void substract(strings_v& va, const strings_v& vb_c) const; diff --git a/desktop/source/splash/makefile.mk b/desktop/source/splash/makefile.mk index 518ccc11ad0c..d91c9f3d83ba 100644 --- a/desktop/source/splash/makefile.mk +++ b/desktop/source/splash/makefile.mk @@ -63,6 +63,7 @@ SHL1STDLIBS= \ $(SVLLIB) \ $(SVTOOLLIB) \ $(COMPHELPERLIB) \ + $(CONFIGMGRLIB) \ $(UNOTOOLSLIB) \ $(TOOLSLIB) \ $(UCBHELPERLIB) \ diff --git a/officecfg/registry/data/org/openoffice/Setup.xcu b/officecfg/registry/data/org/openoffice/Setup.xcu index 6720ab5c37a3..bc34875bc47d 100644 --- a/officecfg/registry/data/org/openoffice/Setup.xcu +++ b/officecfg/registry/data/org/openoffice/Setup.xcu @@ -762,14 +762,14 @@ - org.openoffice.Office.DataAccess + /org.openoffice.Office.DataAccess - org.openoffice.Office.DataAccess/Bibliography - org.openoffice.Office.DataAccess/ConnectionPool - org.openoffice.Office.DataAccess/DataSources - org.openoffice.Office.DataAccess/DriverManager + /org.openoffice.Office.DataAccess/Bibliography + /org.openoffice.Office.DataAccess/ConnectionPool + /org.openoffice.Office.DataAccess/DataSources + /org.openoffice.Office.DataAccess/DriverManager @@ -780,7 +780,7 @@ - org.openoffice.Inet + /org.openoffice.Inet @@ -790,7 +790,7 @@ - org.openoffice.UserProfile + /org.openoffice.UserProfile @@ -807,77 +807,77 @@ - org.openoffice.Office.Compatibility - org.openoffice.Office.Custom - org.openoffice.Office.Embedding - org.openoffice.Office.Events - org.openoffice.Office.ExtendedColorScheme - org.openoffice.Office.Common/Accessibility - org.openoffice.Office.Common/Accessibility/AutoDetectSystemHC - org.openoffice.Office.Common/AsianLayout - org.openoffice.Office.Common/AutoCorrect - org.openoffice.Office.Common/Cache - org.openoffice.Office.Common/DateFormat - org.openoffice.Office.Common/ExternalMailer/Program - org.openoffice.Office.Common/Filter - org.openoffice.Office.Common/Font - org.openoffice.Office.Common/Forms - org.openoffice.Office.Common/Gallery - org.openoffice.Office.Common/Help - org.openoffice.Office.Common/History - org.openoffice.Office.Common/I18N - org.openoffice.Office.Common/InternalMSExport - org.openoffice.Office.Common/Load - org.openoffice.Office.Common/Misc/FormControlPilotsEnabled - org.openoffice.Office.Common/Misc/PluginsEnabled - org.openoffice.Office.Common/Misc/SymbolSet - org.openoffice.Office.Common/Misc/UseSystemFileDialog - org.openoffice.Office.Common/Misc/UseSystemPrintDialog - org.openoffice.Office.Common/Misc/SymbolStyle - org.openoffice.Office.Common/Passwords - org.openoffice.Office.Common/Print/PrintingModifiesDocument - org.openoffice.Office.Common/Print/Warning - org.openoffice.Office.Common/Vectorize - org.openoffice.Office.Common/Save - org.openoffice.Office.Common/SearchOptions - org.openoffice.Office.Common/Undo - org.openoffice.Office.Common/View/Dialog/Dialog/MiddleMouseButton - org.openoffice.Office.Common/View/Dialog/MousePositioning - org.openoffice.Office.Common/View/Localization - org.openoffice.Office.Common/View/Menu - org.openoffice.Office.Common/_3D_Engine + /org.openoffice.Office.Compatibility + /org.openoffice.Office.Custom + /org.openoffice.Office.Embedding + /org.openoffice.Office.Events + /org.openoffice.Office.ExtendedColorScheme + /org.openoffice.Office.Common/Accessibility + /org.openoffice.Office.Common/Accessibility/AutoDetectSystemHC + /org.openoffice.Office.Common/AsianLayout + /org.openoffice.Office.Common/AutoCorrect + /org.openoffice.Office.Common/Cache + /org.openoffice.Office.Common/DateFormat + /org.openoffice.Office.Common/ExternalMailer/Program + /org.openoffice.Office.Common/Filter + /org.openoffice.Office.Common/Font + /org.openoffice.Office.Common/Forms + /org.openoffice.Office.Common/Gallery + /org.openoffice.Office.Common/Help + /org.openoffice.Office.Common/History + /org.openoffice.Office.Common/I18N + /org.openoffice.Office.Common/InternalMSExport + /org.openoffice.Office.Common/Load + /org.openoffice.Office.Common/Misc/FormControlPilotsEnabled + /org.openoffice.Office.Common/Misc/PluginsEnabled + /org.openoffice.Office.Common/Misc/SymbolSet + /org.openoffice.Office.Common/Misc/UseSystemFileDialog + /org.openoffice.Office.Common/Misc/UseSystemPrintDialog + /org.openoffice.Office.Common/Misc/SymbolStyle + /org.openoffice.Office.Common/Passwords + /org.openoffice.Office.Common/Print/PrintingModifiesDocument + /org.openoffice.Office.Common/Print/Warning + /org.openoffice.Office.Common/Vectorize + /org.openoffice.Office.Common/Save + /org.openoffice.Office.Common/SearchOptions + /org.openoffice.Office.Common/Undo + /org.openoffice.Office.Common/View/Dialog/Dialog/MiddleMouseButton + /org.openoffice.Office.Common/View/Dialog/MousePositioning + /org.openoffice.Office.Common/View/Localization + /org.openoffice.Office.Common/View/Menu + /org.openoffice.Office.Common/_3D_Engine - org.openoffice.Office.Common/_3D_Engine/OpenGL - org.openoffice.Office.Common/Help/Registration + /org.openoffice.Office.Common/_3D_Engine/OpenGL + /org.openoffice.Office.Common/Help/Registration - org.openoffice.Office.Calc + /org.openoffice.Office.Calc - org.openoffice.Office.Chart + /org.openoffice.Office.Chart - org.openoffice.Office.Draw + /org.openoffice.Office.Draw - org.openoffice.Office.Impress + /org.openoffice.Office.Impress - org.openoffice.Office.Labels + /org.openoffice.Office.Labels @@ -885,37 +885,37 @@ com.sun.star.migration.Wordbooks - org.openoffice.Office.Linguistic - - - org.openoffice.Office.Linguistic/ServiceManager + /org.openoffice.Office.Linguistic + + + /org.openoffice.Office.Linguistic/ServiceManager - org.openoffice.Office.Math + /org.openoffice.Office.Math - org.openoffice.Office.Security + /org.openoffice.Office.Security - org.openoffice.Office.UI/ColorScheme + /org.openoffice.Office.UI/ColorScheme - org.openoffice.Office.Writer - org.openoffice.Office.WriterWeb + /org.openoffice.Office.Writer + /org.openoffice.Office.WriterWeb - org.openoffice.Office.Writer/Wizard - + /org.openoffice.Office.Writer/Wizard + diff --git a/officecfg/registry/schema/org/openoffice/Setup.xcs b/officecfg/registry/schema/org/openoffice/Setup.xcs index 9e5551bda18a..69e54c347a31 100644 --- a/officecfg/registry/schema/org/openoffice/Setup.xcs +++ b/officecfg/registry/schema/org/openoffice/Setup.xcs @@ -55,12 +55,6 @@ an optional uno service that is called after files and nodes have been copied in order to perform custom migration actions. The service needs to support XInitializable and XJob interfaces according do http://specs.openoffice.org/appwide/migration/spec_migration.sxw - - - LO - a list of config components that are to be passed to service - - LO -- cgit v1.2.3 From 3a08c284e3128ef8ee5f5a3b4387bb9ee32ba97b Mon Sep 17 00:00:00 2001 From: sb Date: Tue, 6 Apr 2010 17:40:33 +0200 Subject: sb122: silently ignore unknown files in Components::parseFileList (the extension manager's file lists can accrue garbage when extension deployment fails mid-way through) --- configmgr/source/components.cxx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'configmgr') diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx index 51a1a6547d9b..58e8c68d636a 100644 --- a/configmgr/source/components.cxx +++ b/configmgr/source/components.cxx @@ -473,12 +473,10 @@ void Components::parseFileList( try { (*parseFile)(url, layer, &data_, 0); } catch (css::container::NoSuchElementException & e) { - throw css::uno::RuntimeException( - (rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "stat'ed file does not exist: ")) + - e.Message), - css::uno::Reference< css::uno::XInterface >()); + OSL_TRACE( + "configmgr file does not exist: %s", + rtl::OUStringToOString( + e.Message, RTL_TEXTENCODING_UTF8).getStr()); } } if (i == -1) { -- cgit v1.2.3 From 3e41502e56c37991dd6e645fd1ff8fb7a325ff1b Mon Sep 17 00:00:00 2001 From: sb Date: Mon, 12 Apr 2010 15:12:26 +0200 Subject: sb122: #i110083# improve xcsparser.cxx merge function --- configmgr/source/xcsparser.cxx | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'configmgr') diff --git a/configmgr/source/xcsparser.cxx b/configmgr/source/xcsparser.cxx index 12e64ebbe171..8bda874cc5b3 100644 --- a/configmgr/source/xcsparser.cxx +++ b/configmgr/source/xcsparser.cxx @@ -78,19 +78,19 @@ void merge( case Node::KIND_LOCALIZED_VALUE: break; //TODO: merge certain parts? case Node::KIND_GROUP: - if (dynamic_cast< GroupNode * >(original.get())->isExtensible()) { - for (NodeMap::iterator i2(update->getMembers().begin()); - i2 != update->getMembers().end(); ++i2) - { - NodeMap::iterator i1( - original->getMembers().find(i2->first)); - if (i1 == original->getMembers().end()) { - if (i2->second->kind() == Node::KIND_PROPERTY) { - original->getMembers().insert(*i2); - } - } else if (i2->second->kind() == i1->second->kind()) { - merge(i1->second, i2->second); + for (NodeMap::iterator i2(update->getMembers().begin()); + i2 != update->getMembers().end(); ++i2) + { + NodeMap::iterator i1(original->getMembers().find(i2->first)); + if (i1 == original->getMembers().end()) { + if (i2->second->kind() == Node::KIND_PROPERTY && + dynamic_cast< GroupNode * >( + original.get())->isExtensible()) + { + original->getMembers().insert(*i2); } + } else if (i2->second->kind() == i1->second->kind()) { + merge(i1->second, i2->second); } } break; -- cgit v1.2.3 From 74155ef0d4806b2cad2e550ce337e7f6a02adf38 Mon Sep 17 00:00:00 2001 From: sb Date: Tue, 4 May 2010 16:29:02 +0200 Subject: sb122: #i110491# turned configmgr API from C++ to UNO --- configmgr/inc/configmgr/detail/configmgrdllapi.hxx | 41 ------ configmgr/inc/configmgr/update.hxx | 58 --------- configmgr/prj/d.lst | 11 +- configmgr/source/makefile.mk | 4 +- configmgr/source/services.cxx | 17 +++ configmgr/source/update.cxx | 143 +++++++++++++++++++-- configmgr/source/update.hxx | 59 +++++++++ desktop/prj/build.lst | 2 +- desktop/source/app/makefile.mk | 1 - desktop/source/deployment/makefile.mk | 3 +- .../registry/configuration/dp_configuration.cxx | 12 +- desktop/source/migration/migration.cxx | 26 +++- desktop/source/splash/makefile.mk | 1 - 13 files changed, 246 insertions(+), 132 deletions(-) delete mode 100644 configmgr/inc/configmgr/detail/configmgrdllapi.hxx delete mode 100644 configmgr/inc/configmgr/update.hxx create mode 100644 configmgr/source/update.hxx (limited to 'configmgr') diff --git a/configmgr/inc/configmgr/detail/configmgrdllapi.hxx b/configmgr/inc/configmgr/detail/configmgrdllapi.hxx deleted file mode 100644 index 6eb2ea7bc9d9..000000000000 --- a/configmgr/inc/configmgr/detail/configmgrdllapi.hxx +++ /dev/null @@ -1,41 +0,0 @@ -/************************************************************************* -* -* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -* -* Copyright 2000, 2010 Oracle and/or its affiliates. -* -* OpenOffice.org - a multi-platform office productivity suite -* -* This file is part of OpenOffice.org. -* -* OpenOffice.org is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License version 3 -* only, as published by the Free Software Foundation. -* -* OpenOffice.org is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU Lesser General Public License version 3 for more details -* (a copy is included in the LICENSE file that accompanied this code). -* -* You should have received a copy of the GNU Lesser General Public License -* version 3 along with OpenOffice.org. If not, see -* -* for a copy of the LGPLv3 License. -* -************************************************************************/ - -#ifndef INCLUDED_CONFIGMGR_DETAIL_CONFIGMGRDLLAPI_HXX -#define INCLUDED_CONFIGMGR_DETAIL_CONFIGMGRDLLAPI_HXX - -#include "sal/config.h" - -#include "sal/types.h" - -#if defined OOO_DLLIMPLEMENTATION_CONFIGMGR -#define OOO_DLLPUBLIC_CONFIGMGR SAL_DLLPUBLIC_EXPORT -#else -#define OOO_DLLPUBLIC_CONFIGMGR SAL_DLLPUBLIC_IMPORT -#endif - -#endif diff --git a/configmgr/inc/configmgr/update.hxx b/configmgr/inc/configmgr/update.hxx deleted file mode 100644 index 3a152959342b..000000000000 --- a/configmgr/inc/configmgr/update.hxx +++ /dev/null @@ -1,58 +0,0 @@ -/************************************************************************* -* -* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -* -* Copyright 2000, 2010 Oracle and/or its affiliates. -* -* OpenOffice.org - a multi-platform office productivity suite -* -* This file is part of OpenOffice.org. -* -* OpenOffice.org is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License version 3 -* only, as published by the Free Software Foundation. -* -* OpenOffice.org is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU Lesser General Public License version 3 for more details -* (a copy is included in the LICENSE file that accompanied this code). -* -* You should have received a copy of the GNU Lesser General Public License -* version 3 along with OpenOffice.org. If not, see -* -* for a copy of the LGPLv3 License. -* -************************************************************************/ - -#ifndef INCLUDED_CONFIGMGR_UPDATE_HXX -#define INCLUDED_CONFIGMGR_UPDATE_HXX - -#include "sal/config.h" - -#include - -#include "configmgr/detail/configmgrdllapi.hxx" - -namespace rtl { class OUString; } - -namespace configmgr { - -namespace update { - -OOO_DLLPUBLIC_CONFIGMGR void insertExtensionXcsFile( - bool shared, rtl::OUString const & fileUri); - -OOO_DLLPUBLIC_CONFIGMGR void insertExtensionXcuFile( - bool shared, rtl::OUString const & fileUri); - -OOO_DLLPUBLIC_CONFIGMGR void insertModificationXcuFile( - rtl::OUString const & fileUri, - std::set< rtl::OUString > const & includedPaths, - std::set< rtl::OUString > const & excludedPaths); - -} - -} - -#endif diff --git a/configmgr/prj/d.lst b/configmgr/prj/d.lst index a9d91980b213..17ccdbe86a08 100644 --- a/configmgr/prj/d.lst +++ b/configmgr/prj/d.lst @@ -1,8 +1,3 @@ -mkdir: %_DEST%\inc%_EXT%\configmgr -mkdir: %_DEST%\inc%_EXT%\configmgr\detail -..\%__SRC%\bin\configmgr.dll %_DEST%\bin%_EXT%\configmgr.dll -..\%__SRC%\lib\iconfigmgr.lib %_DEST%\lib%_EXT%\iconfigmgr.lib -..\%__SRC%\lib\libconfigmgr.dylib %_DEST%\lib%_EXT%\libconfigmgr.dylib -..\%__SRC%\lib\libconfigmgr.so %_DEST%\lib%_EXT%\libconfigmgr.so -..\inc\configmgr\detail\configmgrdllapi.hxx %_DEST%\inc%_EXT%\configmgr\detail\configmgrdllapi.hxx -..\inc\configmgr\update.hxx %_DEST%\inc%_EXT%\configmgr\update.hxx +..\%__SRC%\bin\configmgr.uno.dll %_DEST%\bin%_EXT%\configmgr.uno.dll +..\%__SRC%\lib\configmgr.uno.dylib %_DEST%\lib%_EXT%\configmgr.uno.dylib +..\%__SRC%\lib\configmgr.uno.so %_DEST%\lib%_EXT%\configmgr.uno.so diff --git a/configmgr/source/makefile.mk b/configmgr/source/makefile.mk index 317e08bdf49c..777fed3323d8 100644 --- a/configmgr/source/makefile.mk +++ b/configmgr/source/makefile.mk @@ -34,7 +34,7 @@ VISIBILITY_HIDDEN = TRUE .INCLUDE: settings.mk -CDEFS += -DOOO_DLLIMPLEMENTATION_CONFIGMGR +DLLPRE = SLOFILES = \ $(SLO)/access.obj \ @@ -77,7 +77,7 @@ SHL1STDLIBS = \ $(CPPULIB) \ $(SALHELPERLIB) \ $(SALLIB) -SHL1TARGET = configmgr +SHL1TARGET = configmgr.uno SHL1USE_EXPORTS = name DEF1NAME = $(SHL1TARGET) diff --git a/configmgr/source/services.cxx b/configmgr/source/services.cxx index 3a009b3cee15..f8c3289664ef 100644 --- a/configmgr/source/services.cxx +++ b/configmgr/source/services.cxx @@ -44,6 +44,7 @@ #include "configurationprovider.hxx" #include "configurationregistry.hxx" #include "defaultprovider.hxx" +#include "update.hxx" namespace { @@ -67,6 +68,9 @@ static cppu::ImplementationEntry const services[] = { { &dummy, &configmgr::configuration_registry::getImplementationName, &configmgr::configuration_registry::getSupportedServiceNames, &configmgr::configuration_registry::createFactory, 0, 0 }, + { &dummy, &configmgr::update::getImplementationName, + &configmgr::update::getSupportedServiceNames, + &configmgr::update::createFactory, 0, 0 }, { 0, 0, 0, 0, 0, 0 } }; @@ -107,6 +111,19 @@ extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.DefaultProvider"))); + css::uno::Reference< css::registry::XRegistryKey >( + (css::uno::Reference< css::registry::XRegistryKey >( + static_cast< css::registry::XRegistryKey * >(pRegistryKey))-> + createKey( + rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( + "/com.sun.star.comp.configuration.Update/UNO/" + "SINGLETONS/com.sun.star.configuration.Update")))), + css::uno::UNO_SET_THROW)-> + setStringValue( + rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.configuration.Update_Service"))); } catch (css::uno::Exception & e) { (void) e; OSL_TRACE( diff --git a/configmgr/source/update.cxx b/configmgr/source/update.cxx index 57f45068d954..4c1d59d5d054 100644 --- a/configmgr/source/update.cxx +++ b/configmgr/source/update.cxx @@ -30,27 +30,84 @@ #include -#include "configmgr/update.hxx" +#include "boost/noncopyable.hpp" +#include "com/sun/star/configuration/XUpdate.hpp" +#include "com/sun/star/lang/XSingleComponentFactory.hpp" +#include "com/sun/star/uno/Any.hxx" +#include "com/sun/star/uno/Exception.hpp" +#include "com/sun/star/uno/Reference.hxx" +#include "com/sun/star/uno/RuntimeException.hpp" +#include "com/sun/star/uno/Sequence.hxx" +#include "com/sun/star/uno/XComponentContext.hpp" +#include "com/sun/star/uno/XInterface.hpp" +#include "cppuhelper/factory.hxx" +#include "cppuhelper/implbase1.hxx" +#include "cppuhelper/weak.hxx" #include "osl/mutex.hxx" #include "rtl/ref.hxx" +#include "rtl/unload.h" +#include "rtl/ustring.h" #include "rtl/ustring.hxx" +#include "sal/types.h" #include "broadcaster.hxx" #include "components.hxx" #include "lock.hxx" #include "modifications.hxx" #include "rootaccess.hxx" +#include "update.hxx" -namespace configmgr { +namespace configmgr { namespace update { -namespace update { +namespace { -void insertExtensionXcsFile(bool shared, rtl::OUString const & fileUri) { +namespace css = com::sun::star; + +std::set< rtl::OUString > seqToSet( + css::uno::Sequence< rtl::OUString > const & sequence) +{ + return std::set< rtl::OUString >( + sequence.getConstArray(), + sequence.getConstArray() + sequence.getLength()); +} + +class Service: + public cppu::WeakImplHelper1< css::configuration::XUpdate >, + private boost::noncopyable +{ +public: + Service() {} + +private: + virtual ~Service() {} + + virtual void SAL_CALL insertExtensionXcsFile( + sal_Bool shared, rtl::OUString const & fileUri) + throw (css::uno::RuntimeException); + + virtual void SAL_CALL insertExtensionXcuFile( + sal_Bool shared, rtl::OUString const & fileUri) + throw (css::uno::RuntimeException); + + virtual void SAL_CALL insertModificationXcuFile( + rtl::OUString const & fileUri, + css::uno::Sequence< rtl::OUString > const & includedPaths, + css::uno::Sequence< rtl::OUString > const & excludedPaths) + throw (css::uno::RuntimeException); +}; + +void Service::insertExtensionXcsFile( + sal_Bool shared, rtl::OUString const & fileUri) + throw (css::uno::RuntimeException) +{ osl::MutexGuard g(lock); Components::getSingleton().insertExtensionXcsFile(shared, fileUri); } -void insertExtensionXcuFile(bool shared, rtl::OUString const & fileUri) { +void Service::insertExtensionXcuFile( + sal_Bool shared, rtl::OUString const & fileUri) + throw (css::uno::RuntimeException) +{ Broadcaster bc; { osl::MutexGuard g(lock); @@ -63,23 +120,91 @@ void insertExtensionXcuFile(bool shared, rtl::OUString const & fileUri) { bc.send(); } -void insertModificationXcuFile( +void Service::insertModificationXcuFile( rtl::OUString const & fileUri, - std::set< rtl::OUString > const & includedPaths, - std::set< rtl::OUString > const & excludedPaths) + css::uno::Sequence< rtl::OUString > const & includedPaths, + css::uno::Sequence< rtl::OUString > const & excludedPaths) + throw (css::uno::RuntimeException) { Broadcaster bc; { osl::MutexGuard g(lock); Modifications mods; Components::getSingleton().insertModificationXcuFile( - fileUri, includedPaths, excludedPaths, &mods); + fileUri, seqToSet(includedPaths), seqToSet(excludedPaths), &mods); Components::getSingleton().initGlobalBroadcaster( mods, rtl::Reference< RootAccess >(), &bc); } bc.send(); } +class Factory: + public cppu::WeakImplHelper1< css::lang::XSingleComponentFactory >, + private boost::noncopyable +{ +public: + Factory() {} + +private: + virtual ~Factory() {} + + virtual css::uno::Reference< css::uno::XInterface > SAL_CALL + createInstanceWithContext( + css::uno::Reference< css::uno::XComponentContext > const & Context) + throw (css::uno::Exception, css::uno::RuntimeException); + + virtual css::uno::Reference< css::uno::XInterface > SAL_CALL + createInstanceWithArgumentsAndContext( + css::uno::Sequence< css::uno::Any > const & Arguments, + css::uno::Reference< css::uno::XComponentContext > const & Context) + throw (css::uno::Exception, css::uno::RuntimeException); +}; + +css::uno::Reference< css::uno::XInterface > Factory::createInstanceWithContext( + css::uno::Reference< css::uno::XComponentContext > const & Context) + throw (css::uno::Exception, css::uno::RuntimeException) +{ + return createInstanceWithArgumentsAndContext( + css::uno::Sequence< css::uno::Any >(), Context); +} + +css::uno::Reference< css::uno::XInterface > +Factory::createInstanceWithArgumentsAndContext( + css::uno::Sequence< css::uno::Any > const & Arguments, + css::uno::Reference< css::uno::XComponentContext > const &) + throw (css::uno::Exception, css::uno::RuntimeException) +{ + if (Arguments.getLength() != 0) { + throw css::uno::Exception( + rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.comp.configuration.Update must be" + " instantiated without arguments")), + static_cast< cppu::OWeakObject * >(this)); + } + return static_cast< cppu::OWeakObject * >(new Service); } } + +rtl::OUString getImplementationName() { + return rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.configuration.Update")); +} + +css::uno::Sequence< rtl::OUString > getSupportedServiceNames() { + rtl::OUString name( + RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.configuration.Update_Service")); + return css::uno::Sequence< rtl::OUString >(&name, 1); +} + +css::uno::Reference< css::lang::XSingleComponentFactory > createFactory( + cppu::ComponentFactoryFunc, rtl::OUString const &, + css::uno::Sequence< rtl::OUString > const &, rtl_ModuleCount *) + SAL_THROW(()) +{ + return new Factory; +} + +} } diff --git a/configmgr/source/update.hxx b/configmgr/source/update.hxx new file mode 100644 index 000000000000..faa5c86b15fa --- /dev/null +++ b/configmgr/source/update.hxx @@ -0,0 +1,59 @@ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* +* for a copy of the LGPLv3 License. +* +************************************************************************/ + +#ifndef INCLUDED_CONFIGMGR_SOURCE_UPDATE_HXX +#define INCLUDED_CONFIGMGR_SOURCE_UPDATE_HXX + +#include "sal/config.h" + +#include "com/sun/star/uno/Reference.hxx" +#include "com/sun/star/uno/Sequence.hxx" +#include "cppuhelper/factory.hxx" +#include "rtl/unload.h" +#include "sal/types.h" + +namespace com { namespace sun { namespace star { namespace lang { + class XSingleComponentFactory; +} } } } +namespace rtl { class OUString; } + +namespace configmgr { namespace update { + +rtl::OUString SAL_CALL getImplementationName(); + +com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL +getSupportedServiceNames(); + +com::sun::star::uno::Reference< com::sun::star::lang::XSingleComponentFactory > +SAL_CALL createFactory( + cppu::ComponentFactoryFunc, rtl::OUString const &, + com::sun::star::uno::Sequence< rtl::OUString > const &, rtl_ModuleCount *) + SAL_THROW(()); + +} } + +#endif diff --git a/desktop/prj/build.lst b/desktop/prj/build.lst index 9253b4e82bc7..6f611926a0df 100644 --- a/desktop/prj/build.lst +++ b/desktop/prj/build.lst @@ -1,4 +1,4 @@ -dt desktop : l10n sfx2 stoc BERKELEYDB:berkeleydb sysui SO:sysui_so BOOST:boost svx xmlhelp sal unoil officecfg configmgr NULL +dt desktop : l10n sfx2 stoc BERKELEYDB:berkeleydb sysui SO:sysui_so BOOST:boost svx xmlhelp sal unoil officecfg offuh NULL dt desktop usr1 - all dt_mkout NULL dt desktop\inc nmake - all dt_inc NULL dt desktop\prj get - all dt_prj NULL diff --git a/desktop/source/app/makefile.mk b/desktop/source/app/makefile.mk index 83bec9011283..d9db7c163481 100644 --- a/desktop/source/app/makefile.mk +++ b/desktop/source/app/makefile.mk @@ -65,7 +65,6 @@ SHL1LIBS = $(SLB)$/mig.lib SHL1STDLIBS = \ $(COMPHELPERLIB) \ - $(CONFIGMGRLIB) \ $(CPPUHELPERLIB) \ $(CPPULIB) \ $(I18NISOLANGLIB) \ diff --git a/desktop/source/deployment/makefile.mk b/desktop/source/deployment/makefile.mk index 7eda0f582e15..173ff35bec1d 100644 --- a/desktop/source/deployment/makefile.mk +++ b/desktop/source/deployment/makefile.mk @@ -80,8 +80,7 @@ SHL1STDLIBS = \ $(SVLLIB) \ $(UNOTOOLSLIB) \ $(DEPLOYMENTMISCLIB) \ - $(HELPLINKERLIB) \ - $(CONFIGMGRLIB) + $(HELPLINKERLIB) SHL1DEPN = SHL1IMPLIB = i$(TARGET) diff --git a/desktop/source/deployment/registry/configuration/dp_configuration.cxx b/desktop/source/deployment/registry/configuration/dp_configuration.cxx index 460ba5e9fed0..6cf6d4ff7818 100644 --- a/desktop/source/deployment/registry/configuration/dp_configuration.cxx +++ b/desktop/source/deployment/registry/configuration/dp_configuration.cxx @@ -45,9 +45,9 @@ #include "ucbhelper/content.hxx" #include "comphelper/anytostring.hxx" #include "comphelper/servicedecl.hxx" -#include "configmgr/update.hxx" #include "xmlscript/xml_helper.hxx" #include "svl/inettype.hxx" +#include "com/sun/star/configuration/Update.hpp" #include "com/sun/star/ucb/NameClash.hpp" #include "com/sun/star/io/XActiveDataSink.hpp" #include "com/sun/star/lang/WrappedTargetRuntimeException.hpp" @@ -645,14 +645,16 @@ void BackendImpl::PackageImpl::processPackage_( { if (m_isSchema) { - configmgr::update::insertExtensionXcsFile( - that->m_eContext == CONTEXT_SHARED, expandUnoRcUrl(url)); + com::sun::star::configuration::Update::get( + that->m_xComponentContext)->insertExtensionXcsFile( + that->m_eContext == CONTEXT_SHARED, expandUnoRcUrl(url)); } else { url = replaceOrigin(url, xCmdEnv); - configmgr::update::insertExtensionXcuFile( - that->m_eContext == CONTEXT_SHARED, expandUnoRcUrl(url)); + com::sun::star::configuration::Update::get( + that->m_xComponentContext)->insertExtensionXcuFile( + that->m_eContext == CONTEXT_SHARED, expandUnoRcUrl(url)); } that->addToConfigmgrIni( m_isSchema, url, xCmdEnv ); diff --git a/desktop/source/migration/migration.cxx b/desktop/source/migration/migration.cxx index 634bce451476..6ab5d8478de7 100644 --- a/desktop/source/migration/migration.cxx +++ b/desktop/source/migration/migration.cxx @@ -29,6 +29,7 @@ #include "precompiled_desktop.hxx" #include +#include #include #include "migration.hxx" @@ -38,7 +39,6 @@ #include #include #include -#include #include #include #include @@ -51,6 +51,7 @@ #include #include +#include #include #include #include @@ -539,6 +540,21 @@ bool getComponent(rtl::OUString const & path, rtl::OUString * component) { return true; } +uno::Sequence< rtl::OUString > setToSeq(std::set< rtl::OUString > const & set) { + std::set< rtl::OUString >::size_type n = set.size(); + if (n > SAL_MAX_INT32) { + throw std::bad_alloc(); + } + uno::Sequence< rtl::OUString > seq(static_cast< sal_Int32 >(n)); + sal_Int32 i = 0; + for (std::set< rtl::OUString >::const_iterator j(set.begin()); + j != set.end(); ++j) + { + seq[i++] = *j; + } + return seq; +} + } void MigrationImpl::copyConfig() { @@ -586,9 +602,11 @@ void MigrationImpl::copyConfig() { buf.append(enc); } while (n >= 0); buf.appendAscii(RTL_CONSTASCII_STRINGPARAM(".xcu")); - configmgr::update::insertModificationXcuFile( - buf.makeStringAndClear(), i->second.includedPaths, - i->second.excludedPaths); + configuration::Update::get( + comphelper::getProcessComponentContext())-> + insertModificationXcuFile( + buf.makeStringAndClear(), setToSeq(i->second.includedPaths), + setToSeq(i->second.excludedPaths)); } else { OSL_TRACE( ("configuration migration component %s ignored (only excludes," diff --git a/desktop/source/splash/makefile.mk b/desktop/source/splash/makefile.mk index 2f163fe7b9d6..89609687438c 100644 --- a/desktop/source/splash/makefile.mk +++ b/desktop/source/splash/makefile.mk @@ -63,7 +63,6 @@ SHL1STDLIBS= \ $(SVLLIB) \ $(SVTOOLLIB) \ $(COMPHELPERLIB) \ - $(CONFIGMGRLIB) \ $(UNOTOOLSLIB) \ $(TOOLSLIB) \ $(UCBHELPERLIB) \ -- cgit v1.2.3 From c593c31aa9865baef540da5732fb425dd32b9b03 Mon Sep 17 00:00:00 2001 From: sb Date: Tue, 11 May 2010 09:29:37 +0200 Subject: sb122: #i111492# node-ref clone must not copy templateName_ --- configmgr/source/access.cxx | 2 +- configmgr/source/groupnode.cxx | 12 +++++++----- configmgr/source/groupnode.hxx | 4 ++-- configmgr/source/localizedpropertynode.cxx | 2 +- configmgr/source/localizedpropertynode.hxx | 2 +- configmgr/source/localizedvaluenode.cxx | 2 +- configmgr/source/localizedvaluenode.hxx | 2 +- configmgr/source/node.hxx | 2 +- configmgr/source/nodemap.cxx | 2 +- configmgr/source/propertynode.cxx | 2 +- configmgr/source/propertynode.hxx | 2 +- configmgr/source/setnode.cxx | 11 +++++++---- configmgr/source/setnode.hxx | 4 ++-- configmgr/source/xcsparser.cxx | 2 +- configmgr/source/xcuparser.cxx | 4 ++-- 15 files changed, 30 insertions(+), 25 deletions(-) (limited to 'configmgr') diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx index 7af9c1f8d9c0..60f6a4a54e46 100644 --- a/configmgr/source/access.cxx +++ b/configmgr/source/access.cxx @@ -1917,7 +1917,7 @@ css::uno::Reference< css::uno::XInterface > Access::createInstance() tmplName), static_cast< cppu::OWeakObject * >(this)); } - rtl::Reference< Node > node(tmpl->clone()); + rtl::Reference< Node > node(tmpl->clone(true)); node->setLayer(Data::NO_LAYER); return static_cast< cppu::OWeakObject * >( new ChildAccess(components_, getRootAccess(), node)); diff --git a/configmgr/source/groupnode.cxx b/configmgr/source/groupnode.cxx index 60d825451d69..59c0f89df5d1 100644 --- a/configmgr/source/groupnode.cxx +++ b/configmgr/source/groupnode.cxx @@ -44,8 +44,8 @@ GroupNode::GroupNode( mandatory_(Data::NO_LAYER) {} -rtl::Reference< Node > GroupNode::clone() const { - return new GroupNode(*this); +rtl::Reference< Node > GroupNode::clone(bool keepTemplateName) const { + return new GroupNode(*this, keepTemplateName); } NodeMap & GroupNode::getMembers() { @@ -68,11 +68,13 @@ bool GroupNode::isExtensible() const { return extensible_; } -GroupNode::GroupNode(GroupNode const & other): - Node(other), extensible_(other.extensible_), - templateName_(other.templateName_), mandatory_(other.mandatory_) +GroupNode::GroupNode(GroupNode const & other, bool keepTemplateName): + Node(other), extensible_(other.extensible_), mandatory_(other.mandatory_) { cloneNodeMap(other.members_, &members_); + if (keepTemplateName) { + templateName_ = other.templateName_; + } } GroupNode::~GroupNode() {} diff --git a/configmgr/source/groupnode.hxx b/configmgr/source/groupnode.hxx index be4907b86ce3..9d7bbbafa5b3 100644 --- a/configmgr/source/groupnode.hxx +++ b/configmgr/source/groupnode.hxx @@ -42,7 +42,7 @@ class GroupNode: public Node { public: GroupNode(int layer, bool extensible, rtl::OUString const & templateName); - virtual rtl::Reference< Node > clone() const; + virtual rtl::Reference< Node > clone(bool keepTemplateName) const; virtual NodeMap & getMembers(); @@ -55,7 +55,7 @@ public: bool isExtensible() const; private: - GroupNode(GroupNode const & other); + GroupNode(GroupNode const & other, bool keepTemplateName); virtual ~GroupNode(); diff --git a/configmgr/source/localizedpropertynode.cxx b/configmgr/source/localizedpropertynode.cxx index 9c5fa3328a58..54560d7aded4 100644 --- a/configmgr/source/localizedpropertynode.cxx +++ b/configmgr/source/localizedpropertynode.cxx @@ -51,7 +51,7 @@ LocalizedPropertyNode::LocalizedPropertyNode( Node(layer), staticType_(staticType), nillable_(nillable) {} -rtl::Reference< Node > LocalizedPropertyNode::clone() const { +rtl::Reference< Node > LocalizedPropertyNode::clone(bool) const { return new LocalizedPropertyNode(*this); } diff --git a/configmgr/source/localizedpropertynode.hxx b/configmgr/source/localizedpropertynode.hxx index d5a16af0e54d..4ebcf8e243da 100644 --- a/configmgr/source/localizedpropertynode.hxx +++ b/configmgr/source/localizedpropertynode.hxx @@ -47,7 +47,7 @@ class LocalizedPropertyNode: public Node { public: LocalizedPropertyNode(int layer, Type staticType, bool nillable); - virtual rtl::Reference< Node > clone() const; + virtual rtl::Reference< Node > clone(bool keepTemplateName) const; virtual NodeMap & getMembers(); diff --git a/configmgr/source/localizedvaluenode.cxx b/configmgr/source/localizedvaluenode.cxx index f6246106c8fe..c0e3bc333187 100644 --- a/configmgr/source/localizedvaluenode.cxx +++ b/configmgr/source/localizedvaluenode.cxx @@ -48,7 +48,7 @@ LocalizedValueNode::LocalizedValueNode(int layer, css::uno::Any const & value): Node(layer), value_(value) {} -rtl::Reference< Node > LocalizedValueNode::clone() const { +rtl::Reference< Node > LocalizedValueNode::clone(bool) const { return new LocalizedValueNode(*this); } diff --git a/configmgr/source/localizedvaluenode.hxx b/configmgr/source/localizedvaluenode.hxx index 7f8a5dd987ce..bfcbdea1de51 100644 --- a/configmgr/source/localizedvaluenode.hxx +++ b/configmgr/source/localizedvaluenode.hxx @@ -43,7 +43,7 @@ class LocalizedValueNode: public Node { public: LocalizedValueNode(int layer, com::sun::star::uno::Any const & value); - virtual rtl::Reference< Node > clone() const; + virtual rtl::Reference< Node > clone(bool keepTemplateName) const; virtual rtl::OUString getTemplateName() const; diff --git a/configmgr/source/node.hxx b/configmgr/source/node.hxx index 10f168520595..7c9417e68ea9 100644 --- a/configmgr/source/node.hxx +++ b/configmgr/source/node.hxx @@ -46,7 +46,7 @@ public: virtual Kind kind() const = 0; - virtual rtl::Reference< Node > clone() const = 0; + virtual rtl::Reference< Node > clone(bool keepTemplateName) const = 0; virtual NodeMap & getMembers(); diff --git a/configmgr/source/nodemap.cxx b/configmgr/source/nodemap.cxx index 6b22863b5672..8e4d06030bdf 100644 --- a/configmgr/source/nodemap.cxx +++ b/configmgr/source/nodemap.cxx @@ -42,7 +42,7 @@ void cloneNodeMap(NodeMap const & source, NodeMap * target) { OSL_ASSERT(target != 0 && target->empty()); NodeMap clone(source); for (NodeMap::iterator i(clone.begin()); i != clone.end(); ++i) { - i->second = i->second->clone(); + i->second = i->second->clone(true); } std::swap(clone, *target); } diff --git a/configmgr/source/propertynode.cxx b/configmgr/source/propertynode.cxx index 070b56d9be9a..f3e459998e7e 100644 --- a/configmgr/source/propertynode.cxx +++ b/configmgr/source/propertynode.cxx @@ -55,7 +55,7 @@ PropertyNode::PropertyNode( extension_(extension) {} -rtl::Reference< Node > PropertyNode::clone() const { +rtl::Reference< Node > PropertyNode::clone(bool) const { return new PropertyNode(*this); } diff --git a/configmgr/source/propertynode.hxx b/configmgr/source/propertynode.hxx index 1566cbf72dbe..506526ffcc1e 100644 --- a/configmgr/source/propertynode.hxx +++ b/configmgr/source/propertynode.hxx @@ -48,7 +48,7 @@ public: int layer, Type staticType, bool nillable, com::sun::star::uno::Any const & value, bool extension); - virtual rtl::Reference< Node > clone() const; + virtual rtl::Reference< Node > clone(bool keepTemplateName) const; Type getStaticType() const; diff --git a/configmgr/source/setnode.cxx b/configmgr/source/setnode.cxx index f19c36c0bba5..465345a5f856 100644 --- a/configmgr/source/setnode.cxx +++ b/configmgr/source/setnode.cxx @@ -69,8 +69,8 @@ SetNode::SetNode( templateName_(templateName), mandatory_(Data::NO_LAYER) {} -rtl::Reference< Node > SetNode::clone() const { - return new SetNode(*this); +rtl::Reference< Node > SetNode::clone(bool keepTemplateName) const { + return new SetNode(*this, keepTemplateName); } NodeMap & SetNode::getMembers() { @@ -105,12 +105,15 @@ bool SetNode::isValidTemplate(rtl::OUString const & templateName) const { additionalTemplateNames_.end()); } -SetNode::SetNode(SetNode const & other): +SetNode::SetNode(SetNode const & other, bool keepTemplateName): Node(other), defaultTemplateName_(other.defaultTemplateName_), additionalTemplateNames_(other.additionalTemplateNames_), - templateName_(other.templateName_), mandatory_(other.mandatory_) + mandatory_(other.mandatory_) { cloneNodeMap(other.members_, &members_); + if (keepTemplateName) { + templateName_ = other.templateName_; + } } SetNode::~SetNode() {} diff --git a/configmgr/source/setnode.hxx b/configmgr/source/setnode.hxx index 7bf1ab0a199e..94ce537adda1 100644 --- a/configmgr/source/setnode.hxx +++ b/configmgr/source/setnode.hxx @@ -46,7 +46,7 @@ public: int layer, rtl::OUString const & defaultTemplateName, rtl::OUString const & templateName); - virtual rtl::Reference< Node > clone() const; + virtual rtl::Reference< Node > clone(bool keepTemplateName) const; virtual NodeMap & getMembers(); @@ -63,7 +63,7 @@ public: bool isValidTemplate(rtl::OUString const & templateName) const; private: - SetNode(SetNode const & other); + SetNode(SetNode const & other, bool keepTemplateName); virtual ~SetNode(); diff --git a/configmgr/source/xcsparser.cxx b/configmgr/source/xcsparser.cxx index 8bda874cc5b3..79e122759fc8 100644 --- a/configmgr/source/xcsparser.cxx +++ b/configmgr/source/xcsparser.cxx @@ -456,7 +456,7 @@ void XcsParser::handleNodeRef(XmlReader & reader) { reader.getUrl()), css::uno::Reference< css::uno::XInterface >()); } - rtl::Reference< Node > node(tmpl->clone()); + rtl::Reference< Node > node(tmpl->clone(false)); node->setLayer(valueParser_.getLayer()); elements_.push(Element(node, name)); } diff --git a/configmgr/source/xcuparser.cxx b/configmgr/source/xcuparser.cxx index 77b0f747f313..f9f439c98916 100644 --- a/configmgr/source/xcuparser.cxx +++ b/configmgr/source/xcuparser.cxx @@ -1056,7 +1056,7 @@ void XcuParser::handleSetNode(XmlReader & reader, SetNode * set) { if (state_.top().locked || finalizedLayer < valueParser_.getLayer()) { state_.push(State(true)); // ignored } else { - rtl::Reference< Node > member(tmpl->clone()); + rtl::Reference< Node > member(tmpl->clone(true)); member->setLayer(valueParser_.getLayer()); member->setFinalized(finalizedLayer); member->setMandatory(mandatoryLayer); @@ -1070,7 +1070,7 @@ void XcuParser::handleSetNode(XmlReader & reader, SetNode * set) { { state_.push(State(true)); // ignored } else { - rtl::Reference< Node > member(tmpl->clone()); + rtl::Reference< Node > member(tmpl->clone(true)); member->setLayer(valueParser_.getLayer()); member->setFinalized(finalizedLayer); member->setMandatory(mandatoryLayer); -- cgit v1.2.3