From f6159bc0c9e016362ef39dca7f7b238512ceb68e Mon Sep 17 00:00:00 2001 From: Lars Langhans Date: Wed, 16 Jun 2010 14:57:23 +0200 Subject: sb123:#i111449# cleanups in svl qa/complex tests --- svl/prj/build.lst | 3 + svl/qa/complex/ConfigItems/CheckConfigItems.java | 129 ++++++++++++------- .../complex/ConfigItems/helper/ConfigItemTest.cxx | 28 ++--- svl/qa/complex/ConfigItems/helper/makefile.mk | 27 ++-- svl/qa/complex/ConfigItems/makefile.mk | 69 ++++------ .../passwordcontainer/MasterPasswdHandler.java | 8 +- .../PasswordContainerUnitTest.java | 81 ++++++++---- svl/qa/complex/passwordcontainer/Test01.java | 10 +- svl/qa/complex/passwordcontainer/Test02.java | 11 +- svl/qa/complex/passwordcontainer/Test03.java | 12 +- svl/qa/complex/passwordcontainer/TestHelper.java | 14 ++- svl/qa/complex/passwordcontainer/makefile.mk | 139 ++++++++++++++------- 12 files changed, 322 insertions(+), 209 deletions(-) (limited to 'svl') diff --git a/svl/prj/build.lst b/svl/prj/build.lst index f2d4bf324d01..4777eea028d3 100644 --- a/svl/prj/build.lst +++ b/svl/prj/build.lst @@ -19,4 +19,7 @@ sl svl\util nmake - all svl_util svl_usdde.u svl_psd sl svl\source\fsstor nmake - all svl_fsstor svl_inc NULL sl svl\source\passwordcontainer nmake - all svl_passcont svl_inc NULL +# complex test for ConfigItems are marked as defect +# sl svl\qa\complex\ConfigItems nmake - all svl_qa_complex svl_util svl_passcont NULL +sl svl\qa\complex\passwordcontainer nmake - all svl_qa_complex svl_util svl_passcont NULL diff --git a/svl/qa/complex/ConfigItems/CheckConfigItems.java b/svl/qa/complex/ConfigItems/CheckConfigItems.java index 4afa2bf33f55..78141b6b20d4 100644 --- a/svl/qa/complex/ConfigItems/CheckConfigItems.java +++ b/svl/qa/complex/ConfigItems/CheckConfigItems.java @@ -27,20 +27,25 @@ package complex.ConfigItems; -import com.sun.star.beans.*; -import com.sun.star.lang.*; -import com.sun.star.uno.*; -import com.sun.star.task.*; +import com.sun.star.beans.NamedValue; +import com.sun.star.lang.XMultiServiceFactory; +import com.sun.star.task.XJob; +import com.sun.star.uno.UnoRuntime; -import complexlib.*; -import java.lang.*; -import java.util.*; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.openoffice.test.OfficeConnection; +// import static org.junit.Assert.*; //----------------------------------------------- /** @short todo document me + * @deprecated this tests seems no longer work as expected. */ -public class CheckConfigItems extends ComplexTestCase +public class CheckConfigItems { //------------------------------------------- // some const @@ -64,43 +69,44 @@ public class CheckConfigItems extends ComplexTestCase @return All test methods. @todo Think about selection of tests from outside ... */ - public String[] getTestMethodNames() - { - return new String[] - { - "checkPicklist", - "checkURLHistory", - "checkHelpBookmarks", - "checkPrintOptions", - "checkAccessibilityOptions", - "checkUserOptions" - }; - } +// public String[] getTestMethodNames() +// { +// return new String[] +// { +// "checkPicklist", +// "checkURLHistory", +// "checkHelpBookmarks", +// "checkPrintOptions", +// "checkAccessibilityOptions", +// "checkUserOptions" +// }; +// } //------------------------------------------- /** @short Create the environment for following tests. - @descr Use either a component loader from desktop or + * @throws java.lang.Exception + * @descr Use either a component loader from desktop or from frame */ - public void before() + @Before public void before() throws java.lang.Exception { // get uno service manager from global test environment - m_xSmgr = (XMultiServiceFactory)param.getMSF(); + m_xSmgr = getMSF(); // TODO register helper service // create module manager - m_xTest = (XJob)UnoRuntime.queryInterface( - XJob.class, - m_xSmgr.createInstance("com.sun.star.comp.svl.ConfigItemTest")); + m_xTest = UnoRuntime.queryInterface(XJob.class, m_xSmgr.createInstance("com.sun.star.comp.svl.ConfigItemTest")); } //------------------------------------------- - /** @short close the environment. + /** + * @throws java.lang.Exception + * @short close the environment. */ - public void after() + @After public void after() throws java.lang.Exception { // TODO deregister helper service @@ -110,54 +116,66 @@ public class CheckConfigItems extends ComplexTestCase } //------------------------------------------- - /** @todo document me + /** + * @throws java.lang.Exception + * @todo document me */ - public void checkPicklist() + @Test public void checkPicklist() throws java.lang.Exception { impl_triggerTest("checkPicklist"); } //------------------------------------------- - /** @todo document me + /** + * @throws java.lang.Exception + * @todo document me */ - public void checkURLHistory() + @Test public void checkURLHistory() throws java.lang.Exception { impl_triggerTest("checkURLHistory"); } //------------------------------------------- - /** @todo document me + /** + * @throws java.lang.Exception + * @todo document me */ - public void checkHelpBookmarks() + @Test public void checkHelpBookmarks() throws java.lang.Exception { impl_triggerTest("checkHelpBookmarks"); } //------------------------------------------- - /** @todo document me + /** + * @throws java.lang.Exception + * @todo document me */ - public void checkPrintOptions() - throws java.lang.Exception - { - impl_triggerTest("checkPrintOptions"); - } +// @Test public void checkPrintOptions() +// throws java.lang.Exception +// { +// impl_triggerTest("checkPrintOptions"); +// } //------------------------------------------- - /** @todo document me + /** + * @throws java.lang.Exception + * @todo document me */ - public void checkAccessibilityOptions() + @Test public void checkAccessibilityOptions() throws java.lang.Exception { impl_triggerTest("checkAccessibilityOptions"); } //------------------------------------------- - /** @todo document me + /** + * @throws java.lang.Exception + * @todo document me */ - public void checkUserOptions() + @Test public void checkUserOptions() throws java.lang.Exception { impl_triggerTest("checkUserOptions"); @@ -175,4 +193,27 @@ public class CheckConfigItems extends ComplexTestCase lArgs[0].Value = sTest; m_xTest.execute(lArgs); } + + + private XMultiServiceFactory getMSF() + { + final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager()); + return xMSF1; + } + + // setup and close connections + @BeforeClass public static void setUpConnection() throws Exception { + System.out.println("setUpConnection()"); + connection.setUp(); + } + + @AfterClass public static void tearDownConnection() + throws InterruptedException, com.sun.star.uno.Exception + { + System.out.println("tearDownConnection()"); + connection.tearDown(); + } + + private static final OfficeConnection connection = new OfficeConnection(); + } diff --git a/svl/qa/complex/ConfigItems/helper/ConfigItemTest.cxx b/svl/qa/complex/ConfigItems/helper/ConfigItemTest.cxx index f9840605a6d5..b342eff7ff76 100644 --- a/svl/qa/complex/ConfigItems/helper/ConfigItemTest.cxx +++ b/svl/qa/complex/ConfigItems/helper/ConfigItemTest.cxx @@ -26,8 +26,8 @@ ************************************************************************/ #include "HistoryOptTest.hxx" -#include "AccessibilityOptTest.hxx" -#include "PrintOptTest.hxx" +// #include "AccessibilityOptTest.hxx" +// #include "PrintOptTest.hxx" #include "UserOptTest.hxx" #include @@ -50,8 +50,8 @@ static const ::rtl::OUString PROP_TEST = ::rtl::OUString::creat static const ::rtl::OUString TEST_PICKLIST = ::rtl::OUString::createFromAscii("checkPicklist"); static const ::rtl::OUString TEST_URLHISTORY = ::rtl::OUString::createFromAscii("checkURLHistory"); static const ::rtl::OUString TEST_HELPBOOKMARKS = ::rtl::OUString::createFromAscii("checkHelpBookmarks"); -static const ::rtl::OUString TEST_ACCESSIBILITYOPTIONS = ::rtl::OUString::createFromAscii("checkAccessibilityOptions"); -static const ::rtl::OUString TEST_PRINTOPTIONS = ::rtl::OUString::createFromAscii("checkPrintOptions"); +// static const ::rtl::OUString TEST_ACCESSIBILITYOPTIONS = ::rtl::OUString::createFromAscii("checkAccessibilityOptions"); +// static const ::rtl::OUString TEST_PRINTOPTIONS = ::rtl::OUString::createFromAscii("checkPrintOptions"); static const ::rtl::OUString TEST_USEROPTIONS = ::rtl::OUString::createFromAscii("checkUserOptions"); //============================================================================= @@ -136,16 +136,16 @@ css::uno::Any SAL_CALL ConfigItemTest::execute(const css::uno::Sequence< css::be HistoryOptTest aOptTest; aOptTest.checkHelpBookmarks(); } - else if (sTest.equals(TEST_ACCESSIBILITYOPTIONS)) - { - AccessibilityOptTest aOptTest; - aOptTest.impl_checkAccessibilityOptions(); - } - else if (sTest.equals(TEST_PRINTOPTIONS)) - { - PrintOptTest aOptTest; - aOptTest.impl_checkPrint(); - } +// else if (sTest.equals(TEST_ACCESSIBILITYOPTIONS)) +// { +// AccessibilityOptTest aOptTest; +// aOptTest.impl_checkAccessibilityOptions(); +// } +// else if (sTest.equals(TEST_PRINTOPTIONS)) +// { +// PrintOptTest aOptTest; +// aOptTest.impl_checkPrint(); +// } else if (sTest.equals(TEST_USEROPTIONS)) { UserOptTest aOptTest; diff --git a/svl/qa/complex/ConfigItems/helper/makefile.mk b/svl/qa/complex/ConfigItems/helper/makefile.mk index 13ea12106792..95f2e456fab3 100644 --- a/svl/qa/complex/ConfigItems/helper/makefile.mk +++ b/svl/qa/complex/ConfigItems/helper/makefile.mk @@ -24,7 +24,7 @@ # for a copy of the LGPLv3 License. # #************************************************************************* -PRJ=..$/..$/..$/.. +PRJ=../../../.. PRJNAME= svl TARGET= ConfigItemTest @@ -38,26 +38,27 @@ NO_BSYMBOLIC= TRUE # --- Generate ----------------------------------------------------- -INCPOST += $(PRJ)$/source$/inc +INCPOST += $(PRJ)/source/inc # --- light services library ---------------------------------------------------- SHL1TARGET= svt_$(TARGET) SHL1OBJS= \ - $(SLO)$/UserOptTest.obj \ - $(SLO)$/PrintOptTest.obj \ - $(SLO)$/AccessibilityOptTest.obj \ - $(SLO)$/HistoryOptTest.obj \ - $(SLO)$/ConfigItemTest.obj + $(SLO)/UserOptTest.obj \ + $(SLO)/HistoryOptTest.obj \ + $(SLO)/ConfigItemTest.obj + +# $(SLO)/PrintOptTest.obj +# $(SLO)/AccessibilityOptTest.obj SHL1STDLIBS= \ - $(SVLIB) \ - $(SVLLIB) \ - $(UNOTOOLSLIB) \ - $(COMPHELPERLIB) \ - $(CPPUHELPERLIB) \ - $(CPPULIB) \ + $(SVLIB) \ + $(SVLLIB) \ + $(UNOTOOLSLIB) \ + $(COMPHELPERLIB) \ + $(CPPUHELPERLIB) \ + $(CPPULIB) \ $(SALLIB) SHL1DEF= $(MISC)$/$(SHL1TARGET).def diff --git a/svl/qa/complex/ConfigItems/makefile.mk b/svl/qa/complex/ConfigItems/makefile.mk index 6838cc79a660..ba980e325904 100644 --- a/svl/qa/complex/ConfigItems/makefile.mk +++ b/svl/qa/complex/ConfigItems/makefile.mk @@ -24,60 +24,41 @@ # for a copy of the LGPLv3 License. # #************************************************************************* -PRJ = ..$/..$/.. -TARGET = CheckConfigItems -PRJNAME = svl -PACKAGE = complex$/ConfigItems - -# --- Settings ----------------------------------------------------- -.INCLUDE: settings.mk - - -#----- compile .java files ----------------------------------------- - -JARFILES = mysql.jar ridl.jar unoil.jar jurt.jar juh.jar jut.jar java_uno.jar \ - OOoRunner.jar - -JAVAFILES = CheckConfigItems.java - -JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class) - -SUBDIRS = helper - -#----- make a jar from compiled files ------------------------------ - -MAXLINELENGTH = 100000 +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: +.ELSE -JARCLASSDIRS = $(PACKAGE) -JARTARGET = $(TARGET).jar -JARCOMPRESS = TRUE +PRJ = ../../.. +PRJNAME = svl +TARGET = qa_complex_ConfigItems -# --- Parameters for the test -------------------------------------- +.IF "$(OOO_JUNIT_JAR)" != "" +PACKAGE = complex/ConfigItems -# start an office if the parameter is set for the makefile -.IF "$(OFFICE)" == "" -CT_APPEXECCOMMAND = -.ELSE -CT_APPEXECCOMMAND = -AppExecutionCommand "$(OFFICE)$/soffice -accept=socket,host=localhost,port=8100;urp;" -.ENDIF +# here store only Files which contain a @Test +JAVATESTFILES = \ + CheckConfigItems.java -# test base is java complex -CT_TESTBASE = -TestBase java_complex +# put here all other files +JAVAFILES = $(JAVATESTFILES) -# test looks something like the.full.package.TestName -CT_TEST = -o $(PACKAGE:s\$/\.\).$(JAVAFILES:b) +JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar +EXTRAJARFILES = $(OOO_JUNIT_JAR) -# start the runner application -CT_APP = org.openoffice.Runner +# subdirectories +SUBDIRS = helper -# --- Targets ------------------------------------------------------ +# Sample how to debug +# JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y -.INCLUDE : target.mk +.END -RUN: run +.INCLUDE: settings.mk +.INCLUDE: target.mk +.INCLUDE: installationtest.mk -run: - java -cp $(CLASSPATH) $(CT_APP) $(CT_TESTBASE) $(CT_APPEXECCOMMAND) $(CT_TEST) +ALLTAR : javatest +.END diff --git a/svl/qa/complex/passwordcontainer/MasterPasswdHandler.java b/svl/qa/complex/passwordcontainer/MasterPasswdHandler.java index bf6159ee38c5..8e886f0b8269 100644 --- a/svl/qa/complex/passwordcontainer/MasterPasswdHandler.java +++ b/svl/qa/complex/passwordcontainer/MasterPasswdHandler.java @@ -36,12 +36,16 @@ public class MasterPasswdHandler extends WeakBase XInteractionSupplyAuthentication xAuthentication = null; for( int i = 0; i < xContinuations.length; ++i ) { - xAuthentication = (XInteractionSupplyAuthentication)UnoRuntime.queryInterface( XInteractionSupplyAuthentication.class, xContinuations[i]); + xAuthentication = UnoRuntime.queryInterface(XInteractionSupplyAuthentication.class, xContinuations[i]); if( xAuthentication != null ) + { break; + } } if( xAuthentication.canSetPassword() ) - xAuthentication.setPassword( "abcdefghijklmnopqrstuvwxyz123456" ); + { + xAuthentication.setPassword("abcdefghijklmnopqrstuvwxyz123456"); + } xAuthentication.select(); } } else { diff --git a/svl/qa/complex/passwordcontainer/PasswordContainerUnitTest.java b/svl/qa/complex/passwordcontainer/PasswordContainerUnitTest.java index 2e3bada4d1bc..ac5c79d134dc 100644 --- a/svl/qa/complex/passwordcontainer/PasswordContainerUnitTest.java +++ b/svl/qa/complex/passwordcontainer/PasswordContainerUnitTest.java @@ -27,47 +27,78 @@ package complex.passwordcontainer; -import complexlib.ComplexTestCase; import com.sun.star.lang.XMultiServiceFactory; +import com.sun.star.uno.UnoRuntime; -public class PasswordContainerUnitTest extends ComplexTestCase { +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.openoffice.test.OfficeConnection; +import static org.junit.Assert.*; + +public class PasswordContainerUnitTest { private XMultiServiceFactory m_xMSF = null; - public String[] getTestMethodNames() { - return new String[] { - "ExecuteTest01", - "ExecuteTest02", - "ExecuteTest03"}; - } - public String getTestObjectName() { - return "PasswordContainerUnitTest"; - } +//// public String[] getTestMethodNames() { +//// return new String[] { +//// "ExecuteTest01", +//// "ExecuteTest02", +//// "ExecuteTest03"}; +//// } +// public String getTestObjectName() { +// return "PasswordContainerUnitTest"; +// } - public void before() { + @Before public void before() { try { - m_xMSF = (XMultiServiceFactory) param.getMSF(); + m_xMSF = getMSF(); } catch (Exception e) { - failed ("Cannot create service factory!"); + fail ("Cannot create service factory!"); } if (m_xMSF == null) { - failed ("Cannot create service factory!"); + fail ("Cannot create service factory!"); } } - public void after() { + @After public void after() { m_xMSF = null; } - public void ExecuteTest01() { - PasswordContainerTest aTest = new Test01(m_xMSF, log); - assure("Test01 failed!", aTest.test()); + @Test public void ExecuteTest01() + { + PasswordContainerTest aTest = new Test01(m_xMSF); + assertTrue("Test01 failed!", aTest.test()); } - public void ExecuteTest02() { - PasswordContainerTest aTest = new Test02(m_xMSF, log); - assure("Test02 failed!", aTest.test()); + @Test public void ExecuteTest02() { + PasswordContainerTest aTest = new Test02(m_xMSF); + assertTrue("Test02 failed!", aTest.test()); } - public void ExecuteTest03() { - PasswordContainerTest aTest = new Test03(m_xMSF, log); - assure("Test03 failed!", aTest.test()); + @Test public void ExecuteTest03() { + PasswordContainerTest aTest = new Test03(m_xMSF); + assertTrue("Test03 failed!", aTest.test()); } + + private XMultiServiceFactory getMSF() + { + final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager()); + return xMSF1; + } + + // setup and close connections + @BeforeClass public static void setUpConnection() throws Exception { + System.out.println("setUpConnection()"); + connection.setUp(); + } + + @AfterClass public static void tearDownConnection() + throws InterruptedException, com.sun.star.uno.Exception + { + System.out.println("tearDownConnection()"); + connection.tearDown(); + } + + private static final OfficeConnection connection = new OfficeConnection(); + } diff --git a/svl/qa/complex/passwordcontainer/Test01.java b/svl/qa/complex/passwordcontainer/Test01.java index 1ca17c922669..9367fea4eb7b 100644 --- a/svl/qa/complex/passwordcontainer/Test01.java +++ b/svl/qa/complex/passwordcontainer/Test01.java @@ -36,17 +36,17 @@ import com.sun.star.task.XMasterPasswordHandling; import com.sun.star.uno.UnoRuntime; -import share.LogWriter; +// import share.LogWriter; public class Test01 implements PasswordContainerTest { XMultiServiceFactory m_xMSF = null; XPasswordContainer m_xPasswordContainer = null; TestHelper m_aTestHelper = null; - public Test01 ( XMultiServiceFactory xMSF, LogWriter aLogWriter ) + public Test01 ( XMultiServiceFactory xMSF ) { m_xMSF = xMSF; - m_aTestHelper = new TestHelper (aLogWriter, "Test01: "); + m_aTestHelper = new TestHelper ( "Test01: "); } public boolean test() { @@ -68,9 +68,9 @@ public class Test01 implements PasswordContainerTest { } try { Object oPasswordContainer = m_xMSF.createInstance( "com.sun.star.task.PasswordContainer" ); - XPasswordContainer xContainer = (XPasswordContainer)UnoRuntime.queryInterface(XPasswordContainer.class, oPasswordContainer); + XPasswordContainer xContainer = UnoRuntime.queryInterface(XPasswordContainer.class, oPasswordContainer); Object oHandler = m_xMSF.createInstance( "com.sun.star.task.InteractionHandler" ); - XInteractionHandler xHandler = (XInteractionHandler)UnoRuntime.queryInterface(XInteractionHandler.class, oHandler); + XInteractionHandler xHandler = UnoRuntime.queryInterface(XInteractionHandler.class, oHandler); MasterPasswdHandler aMHandler = new MasterPasswdHandler( xHandler ); // add a set of users and passwords for the same URL for runtime diff --git a/svl/qa/complex/passwordcontainer/Test02.java b/svl/qa/complex/passwordcontainer/Test02.java index b77b0fe9bf48..3d0123de3179 100644 --- a/svl/qa/complex/passwordcontainer/Test02.java +++ b/svl/qa/complex/passwordcontainer/Test02.java @@ -36,17 +36,16 @@ import com.sun.star.task.UserRecord; import com.sun.star.uno.UnoRuntime; -import share.LogWriter; public class Test02 implements PasswordContainerTest { XMultiServiceFactory m_xMSF = null; XPasswordContainer m_xPasswordContainer = null; TestHelper m_aTestHelper = null; - public Test02 ( XMultiServiceFactory xMSF, LogWriter aLogWriter ) + public Test02 ( XMultiServiceFactory xMSF ) { m_xMSF = xMSF; - m_aTestHelper = new TestHelper (aLogWriter, "Test02: "); + m_aTestHelper = new TestHelper ( "Test02: "); } public boolean test() { @@ -69,11 +68,11 @@ public class Test02 implements PasswordContainerTest { try { Object oPasswordContainer = m_xMSF.createInstance("com.sun.star.task.PasswordContainer"); - XPasswordContainer xContainer = (XPasswordContainer)UnoRuntime.queryInterface(XPasswordContainer.class, oPasswordContainer); + XPasswordContainer xContainer = UnoRuntime.queryInterface(XPasswordContainer.class, oPasswordContainer); Object oHandler = m_xMSF.createInstance("com.sun.star.task.InteractionHandler"); - XInteractionHandler xHandler = (XInteractionHandler)UnoRuntime.queryInterface(XInteractionHandler.class, oHandler); + XInteractionHandler xHandler = UnoRuntime.queryInterface(XInteractionHandler.class, oHandler); MasterPasswdHandler aMHandler = new MasterPasswdHandler(xHandler); - XMasterPasswordHandling xMHandling = (XMasterPasswordHandling)UnoRuntime.queryInterface(XMasterPasswordHandling.class, oPasswordContainer); + XMasterPasswordHandling xMHandling = UnoRuntime.queryInterface(XMasterPasswordHandling.class, oPasswordContainer); // allow the storing of the passwords xMHandling.allowPersistentStoring(true); diff --git a/svl/qa/complex/passwordcontainer/Test03.java b/svl/qa/complex/passwordcontainer/Test03.java index 9e38a55893e0..cf2b3d45cbb0 100644 --- a/svl/qa/complex/passwordcontainer/Test03.java +++ b/svl/qa/complex/passwordcontainer/Test03.java @@ -36,17 +36,17 @@ import com.sun.star.task.XInteractionHandler; import com.sun.star.uno.UnoRuntime; -import share.LogWriter; + public class Test03 implements PasswordContainerTest { XMultiServiceFactory m_xMSF = null; XPasswordContainer m_xPasswordContainer = null; TestHelper m_aTestHelper = null; - public Test03 ( XMultiServiceFactory xMSF, LogWriter aLogWriter ) + public Test03 ( XMultiServiceFactory xMSF ) { m_xMSF = xMSF; - m_aTestHelper = new TestHelper (aLogWriter, "Test03: "); + m_aTestHelper = new TestHelper ( "Test03: "); } public boolean test() { @@ -68,11 +68,11 @@ public class Test03 implements PasswordContainerTest { try { Object oPasswordContainer = m_xMSF.createInstance("com.sun.star.task.PasswordContainer"); - XPasswordContainer xContainer = (XPasswordContainer)UnoRuntime.queryInterface(XPasswordContainer.class, oPasswordContainer); + XPasswordContainer xContainer = UnoRuntime.queryInterface(XPasswordContainer.class, oPasswordContainer); Object oHandler = m_xMSF.createInstance("com.sun.star.task.InteractionHandler"); - XInteractionHandler xHandler = (XInteractionHandler)UnoRuntime.queryInterface(XInteractionHandler.class, oHandler); + XInteractionHandler xHandler = UnoRuntime.queryInterface(XInteractionHandler.class, oHandler); MasterPasswdHandler aMHandler = new MasterPasswdHandler(xHandler); - XMasterPasswordHandling xMHandling = (XMasterPasswordHandling)UnoRuntime.queryInterface(XMasterPasswordHandling.class, oPasswordContainer); + XMasterPasswordHandling xMHandling = UnoRuntime.queryInterface(XMasterPasswordHandling.class, oPasswordContainer); // allow the storing of the passwords xMHandling.allowPersistentStoring(true); diff --git a/svl/qa/complex/passwordcontainer/TestHelper.java b/svl/qa/complex/passwordcontainer/TestHelper.java index 1971b61098f5..c91401e74c91 100644 --- a/svl/qa/complex/passwordcontainer/TestHelper.java +++ b/svl/qa/complex/passwordcontainer/TestHelper.java @@ -29,23 +29,23 @@ package complex.passwordcontainer; import com.sun.star.task.UserRecord; -import share.LogWriter; +// import share.LogWriter; public class TestHelper { - LogWriter m_aLogWriter; + // LogWriter m_aLogWriter; String m_sTestPrefix; - public TestHelper( LogWriter aLogWriter, String sTestPrefix ) { - m_aLogWriter = aLogWriter; + public TestHelper( String sTestPrefix ) { + // m_aLogWriter = aLogWriter; m_sTestPrefix = sTestPrefix; } public void Error( String sError ) { - m_aLogWriter.println( m_sTestPrefix + "Error: " + sError ); + System.out.println( m_sTestPrefix + "Error: " + sError ); } public void Message( String sMessage ) { - m_aLogWriter.println( m_sTestPrefix + sMessage ); + System.out.println( m_sTestPrefix + sMessage ); } public boolean sameLists(UserRecord aUserList1[], UserRecord aUserList2[]) { @@ -60,7 +60,9 @@ public class TestHelper { int j; for(j = 0; j < aUserList2.length; j++) { if(!aUserList1[i].UserName.equals(aUserList2[j].UserName)) + { continue; + } if(aUserList1[i].Passwords[0].equals(aUserList2[j].Passwords[0])) { break; } diff --git a/svl/qa/complex/passwordcontainer/makefile.mk b/svl/qa/complex/passwordcontainer/makefile.mk index 57fd4d560f8d..88a4883f9eeb 100644 --- a/svl/qa/complex/passwordcontainer/makefile.mk +++ b/svl/qa/complex/passwordcontainer/makefile.mk @@ -25,63 +25,114 @@ # #************************************************************************* -PRJ = ..$/..$/.. -TARGET = PasswordContainerUnitTest -PRJNAME=svl -PACKAGE = complex$/passwordcontainer - -# --- Settings ----------------------------------------------------- -.INCLUDE: settings.mk - - -#----- compile .java files ----------------------------------------- - -JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar - -JAVAFILES =\ - PasswordContainerUnitTest.java\ - PasswordContainerTest.java\ - TestHelper.java\ - Test01.java\ - Test02.java\ - Test03.java\ - MasterPasswdHandler.java +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: + @echo "OOO_SUBSEQUENT_TESTS not set, do nothing." +.ELSE -JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class) +PRJ = ../../.. +PRJNAME = svl +TARGET = qa_complex_passwordcontainer -#----- make a jar from compiled files ------------------------------ +.IF "$(OOO_JUNIT_JAR)" != "" +PACKAGE = complex/passwordcontainer -MAXLINELENGTH = 100000 +# here store only Files which contain a @Test +JAVATESTFILES = \ + PasswordContainerUnitTest.java -JARCLASSDIRS = $(PACKAGE) -JARTARGET = $(TARGET).jar -JARCOMPRESS = TRUE -# --- Parameters for the test -------------------------------------- +# put here all other files +JAVAFILES = $(JAVATESTFILES) \ + PasswordContainerTest.java\ + Test01.java\ + Test02.java\ + Test03.java\ + TestHelper.java\ + MasterPasswdHandler.java -# start an office if the parameter is set for the makefile -.IF "$(OFFICE)" == "" -CT_APPEXECCOMMAND = -.ELSE -CT_APPEXECCOMMAND = -AppExecutionCommand "$(OFFICE)$/soffice -accept=socket,host=localhost,port=8100;urp;" -.ENDIF -# test base is java complex -CT_TESTBASE = -TestBase java_complex +JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar +EXTRAJARFILES = $(OOO_JUNIT_JAR) -# test looks something like the.full.package.TestName -CT_TEST = -o $(PACKAGE:s\$/\.\).$(JAVAFILES:b) +# subdirectories +# SUBDIRS = helper -# start the runner application -CT_APP = org.openoffice.Runner +# Sample how to debug +# JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y -# --- Targets ------------------------------------------------------ +.END +.INCLUDE: settings.mk .INCLUDE: target.mk +.INCLUDE: installationtest.mk -RUN: run +ALLTAR : javatest -run: - +java -cp $(CLASSPATH) $(CT_APP) $(CT_TESTBASE) $(CT_APPEXECCOMMAND) $(CT_TEST) +.END +# +# +# +# +# PRJ = ..$/..$/.. +# TARGET = PasswordContainerUnitTest +# PRJNAME=svl +# PACKAGE = complex$/passwordcontainer +# +# # --- Settings ----------------------------------------------------- +# .INCLUDE: settings.mk +# +# +# #----- compile .java files ----------------------------------------- +# +# JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar +# +# JAVAFILES =\ +# PasswordContainerUnitTest.java\ +# PasswordContainerTest.java\ +# TestHelper.java\ +# Test01.java\ +# Test02.java\ +# Test03.java\ +# MasterPasswdHandler.java +# +# JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class) +# +# #----- make a jar from compiled files ------------------------------ +# +# MAXLINELENGTH = 100000 +# +# JARCLASSDIRS = $(PACKAGE) +# JARTARGET = $(TARGET).jar +# JARCOMPRESS = TRUE +# +# # --- Parameters for the test -------------------------------------- +# +# # start an office if the parameter is set for the makefile +# .IF "$(OFFICE)" == "" +# CT_APPEXECCOMMAND = +# .ELSE +# CT_APPEXECCOMMAND = -AppExecutionCommand "$(OFFICE)$/soffice -accept=socket,host=localhost,port=8100;urp;" +# .ENDIF +# +# # test base is java complex +# CT_TESTBASE = -TestBase java_complex +# +# # test looks something like the.full.package.TestName +# CT_TEST = -o $(PACKAGE:s\$/\.\).$(JAVAFILES:b) +# +# # start the runner application +# CT_APP = org.openoffice.Runner +# +# # --- Targets ------------------------------------------------------ +# +# .INCLUDE: target.mk +# +# RUN: run +# +# run: +# +java -cp $(CLASSPATH) $(CT_APP) $(CT_TESTBASE) $(CT_APPEXECCOMMAND) $(CT_TEST) +# +# -- cgit From 5965bb52435916c06d1b5a63df4959203b7cf018 Mon Sep 17 00:00:00 2001 From: Malte Timmermann Date: Fri, 25 Jun 2010 13:15:03 +0200 Subject: codecleanup02: #i112685# Removed ifdefs and code for WIN,W30,W31 --- svl/source/numbers/nbdll.cxx | 79 -------------------------------------------- svl/source/svdde/ddedata.cxx | 10 ++---- svl/source/svdde/ddedll.cxx | 64 ----------------------------------- svl/source/svdde/ddestrg.cxx | 4 --- 4 files changed, 3 insertions(+), 154 deletions(-) delete mode 100644 svl/source/numbers/nbdll.cxx delete mode 100644 svl/source/svdde/ddedll.cxx (limited to 'svl') diff --git a/svl/source/numbers/nbdll.cxx b/svl/source/numbers/nbdll.cxx deleted file mode 100644 index b93eda3e7f37..000000000000 --- a/svl/source/numbers/nbdll.cxx +++ /dev/null @@ -1,79 +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. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_svl.hxx" - -#ifdef WIN -#include - -#ifndef _SYSDEP_HXX -#include -#endif - -// Statische DLL-Verwaltungs-Variablen -static HINSTANCE hDLLInst = 0; // HANDLE der DLL - - -/*************************************************************************** -|* -|* LibMain() -|* -|* Beschreibung Initialisierungsfunktion der DLL -|* Ersterstellung TH 05.05.93 -|* Letzte Aenderung TH 05.05.93 -|* -***************************************************************************/ - -extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR ) -{ -#ifndef WNT - if ( nHeap ) - UnlockData( 0 ); -#endif - - hDLLInst = hDLL; - - return TRUE; -} - -/*************************************************************************** -|* -|* WEP() -|* -|* Beschreibung DLL-Deinitialisierung -|* Ersterstellung TH 05.05.93 -|* Letzte Aenderung TH 05.05.93 -|* -***************************************************************************/ - -extern "C" int CALLBACK WEP( int ) -{ - return 1; -} - -#endif diff --git a/svl/source/svdde/ddedata.cxx b/svl/source/svdde/ddedata.cxx index ba67d451be34..369306c22874 100644 --- a/svl/source/svdde/ddedata.cxx +++ b/svl/source/svdde/ddedata.cxx @@ -41,10 +41,6 @@ #include -#if defined( WIN ) && defined( MSC ) -#pragma code_seg( "SVDDE_MISC_CODE" ) -#endif - // --- DdeData::DdeData() ------------------------------------------ DdeData::DdeData() @@ -164,10 +160,10 @@ ULONG DdeData::GetExternalFormat( ULONG nFmt ) default: { -#if defined(WNT) || defined(WIN) || defined( PM2 ) +#if defined(WNT) || defined( PM2 ) String aName( SotExchange::GetFormatName( nFmt ) ); -#if defined(WNT) || defined(WIN) +#if defined(WNT) if( aName.Len() ) nFmt = RegisterClipboardFormat( reinterpret_cast(aName.GetBuffer()) ); @@ -203,7 +199,7 @@ ULONG DdeData::GetInternalFormat( ULONG nFmt ) break; default: -#if defined(WIN) || defined(WNT) +#if defined(WNT) if( nFmt >= CF_MAX ) { TCHAR szName[ 256 ]; diff --git a/svl/source/svdde/ddedll.cxx b/svl/source/svdde/ddedll.cxx deleted file mode 100644 index a71662dd5e63..000000000000 --- a/svl/source/svdde/ddedll.cxx +++ /dev/null @@ -1,64 +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. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_svl.hxx" -#ifdef WIN - - -#include // included svwin.h - -// Statische DLL-Verwaltungs-Variablen -static HINSTANCE hDLLInst = 0; // HANDLE der DLL - -/*************************************************************************** -|* LibMain() -|* Beschreibung Initialisierungsfunktion der DLL -***************************************************************************/ -extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR ) -{ -#ifndef WNT - if ( nHeap ) - UnlockData( 0 ); -#endif - - hDLLInst = hDLL; - - return TRUE; -} - -/*************************************************************************** -|* WEP() -|* Beschreibung DLL-Deinitialisierung -***************************************************************************/ -extern "C" int CALLBACK WEP( int ) -{ - return 1; -} - -#endif - diff --git a/svl/source/svdde/ddestrg.cxx b/svl/source/svdde/ddestrg.cxx index 4f0e2464a276..007c9f56c544 100644 --- a/svl/source/svdde/ddestrg.cxx +++ b/svl/source/svdde/ddestrg.cxx @@ -33,10 +33,6 @@ #include "ddeimp.hxx" #include -#if defined( WIN ) && defined( MSC ) -#pragma code_seg( "SVDDE_MISC_CODE" ) -#endif - // --- DdeString::DdeString() -------------------------------------- DdeString::DdeString( DWORD hDdeInst, const sal_Unicode* p ) : -- cgit From 37cd7b225e6e97824302ea40b8bb83e3b24a68fc Mon Sep 17 00:00:00 2001 From: Lars Langhans Date: Tue, 29 Jun 2010 13:43:23 +0200 Subject: sb123:#i111449# makefile cleanups for qa/complex tests --- svl/qa/complex/passwordcontainer/makefile.mk | 1 - 1 file changed, 1 deletion(-) (limited to 'svl') diff --git a/svl/qa/complex/passwordcontainer/makefile.mk b/svl/qa/complex/passwordcontainer/makefile.mk index 88a4883f9eeb..d05af97d77f1 100644 --- a/svl/qa/complex/passwordcontainer/makefile.mk +++ b/svl/qa/complex/passwordcontainer/makefile.mk @@ -27,7 +27,6 @@ .IF "$(OOO_SUBSEQUENT_TESTS)" == "" nothing .PHONY: - @echo "OOO_SUBSEQUENT_TESTS not set, do nothing." .ELSE PRJ = ../../.. -- cgit From b7a1670b522a3a094f6653bdd3c875374af7d1a2 Mon Sep 17 00:00:00 2001 From: Lars Langhans Date: Thu, 1 Jul 2010 13:19:11 +0200 Subject: sb123:#i111449# cleanups in build.lst for qa/complex tests --- svl/prj/build.lst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'svl') diff --git a/svl/prj/build.lst b/svl/prj/build.lst index 4777eea028d3..d5897d9e9883 100644 --- a/svl/prj/build.lst +++ b/svl/prj/build.lst @@ -20,6 +20,7 @@ sl svl\source\fsstor nmake - all svl_fsstor svl_inc NULL sl svl\source\passwordcontainer nmake - all svl_passcont svl_inc NULL # complex test for ConfigItems are marked as defect -# sl svl\qa\complex\ConfigItems nmake - all svl_qa_complex svl_util svl_passcont NULL +# sl svl\qa\complex\ConfigItems\helper nmake - all svl_qa_complex_help svl_util svl_passcont NULL +# sl svl\qa\complex\ConfigItems nmake - all svl_qa_complex svl_qa_complex_help svl_util svl_passcont NULL sl svl\qa\complex\passwordcontainer nmake - all svl_qa_complex svl_util svl_passcont NULL -- cgit From bcd4bc56c93dd815da6b5d0e22348dabbc75ca9f Mon Sep 17 00:00:00 2001 From: Niklas Nebel Date: Wed, 7 Jul 2010 17:28:29 +0200 Subject: #i112250# #i113022# better handling of automatic decimals for small values or equal cells --- svl/source/numbers/zformat.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'svl') diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index 707b2362f0ed..2d0909c8782b 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -2086,7 +2086,9 @@ BOOL SvNumberformat::GetOutputString(double fNumber, if (!nLen) return false; - if (nLen > 11) + // #i112250# With the 10-decimal limit, small numbers are formatted as "0". + // Switch to scientific in that case, too: + if (nLen > 11 || (OutString.EqualsAscii("0") && fNumber != 0.0)) { sal_uInt16 nStandardPrec = rScan.GetStandardPrec(); nStandardPrec = ::std::min(nStandardPrec, static_cast(14)); // limits to 14 decimals -- cgit From 8444953804e704a4462c3416c1ad50db2ce9fec4 Mon Sep 17 00:00:00 2001 From: "Eike Rathke [er]" Date: Fri, 16 Jul 2010 20:13:45 +0200 Subject: calc56: #i108385# make TEXT return text if text was passed, handling text formats that include a @ code --- svl/inc/svl/zforlist.hxx | 9 +++++++ svl/source/numbers/zforlist.cxx | 52 +++++++++++++++++++++++++++++++++++++++++ svl/source/numbers/zformat.cxx | 2 +- 3 files changed, 62 insertions(+), 1 deletion(-) (limited to 'svl') diff --git a/svl/inc/svl/zforlist.hxx b/svl/inc/svl/zforlist.hxx index 598295797ea6..5492759d4d36 100644 --- a/svl/inc/svl/zforlist.hxx +++ b/svl/inc/svl/zforlist.hxx @@ -520,6 +520,15 @@ public: String& sOutString, Color** ppColor, LanguageType eLnge = LANGUAGE_DONTKNOW ); + /** Format a string according to a format code string to be scanned. + @return + if format code contains an error + else, in which case the string and color are returned. + */ + BOOL GetPreviewString( const String& sFormatString, const String& sPreviewString, + String& sOutString, Color** ppColor, + LanguageType eLnge = LANGUAGE_DONTKNOW ); + /** Test whether the format code string is already present in container @return NUMBERFORMAT_ENTRY_NOT_FOUND if not found, else the format index. diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index cb66a75558c2..7343a0a9c0e6 100644 --- a/svl/source/numbers/zforlist.cxx +++ b/svl/source/numbers/zforlist.cxx @@ -1697,6 +1697,58 @@ BOOL SvNumberFormatter::GetPreviewStringGuess( const String& sFormatString, return FALSE; } +BOOL SvNumberFormatter::GetPreviewString( const String& sFormatString, + const String& sPreviewString, + String& sOutString, + Color** ppColor, + LanguageType eLnge ) +{ + if (sFormatString.Len() == 0) // no empty string + return FALSE; + + xub_StrLen nCheckPos = STRING_NOTFOUND; + sal_uInt32 nKey; + if (eLnge == LANGUAGE_DONTKNOW) + eLnge = IniLnge; + ChangeIntl(eLnge); // switch if needed + eLnge = ActLnge; + String sTmpString = sFormatString; + SvNumberformat* p_Entry = new SvNumberformat( sTmpString, + pFormatScanner, + pStringScanner, + nCheckPos, + eLnge); + if (nCheckPos == 0) // String ok + { + String aNonConstPreview( sPreviewString); + // May have to create standard formats for this locale. + sal_uInt32 CLOffset = ImpGenerateCL(eLnge); + nKey = ImpIsEntry( p_Entry->GetFormatstring(), CLOffset, eLnge); + if (nKey != NUMBERFORMAT_ENTRY_NOT_FOUND) // already present + GetOutputString( aNonConstPreview, nKey, sOutString, ppColor); + else + { + // If the format is valid but not a text format and does not + // include a text subformat, an empty string would result. Same as + // in SvNumberFormatter::GetOutputString() + if (p_Entry->IsTextFormat() || p_Entry->HasTextFormat()) + p_Entry->GetOutputString( aNonConstPreview, sOutString, ppColor); + else + { + *ppColor = NULL; + sOutString = sPreviewString; + } + } + delete p_Entry; + return TRUE; + } + else + { + delete p_Entry; + return FALSE; + } +} + sal_uInt32 SvNumberFormatter::TestNewString(const String& sFormatString, LanguageType eLnge) { diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index 2d0909c8782b..97f06171a4fc 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -2057,7 +2057,7 @@ BOOL SvNumberformat::GetOutputString(double fNumber, OutString = rScan.GetFalseString(); return FALSE; } - if (eType & NUMBERFORMAT_TEXT && bStandard) + if (eType & NUMBERFORMAT_TEXT) { ImpGetOutputStandard(fNumber, OutString); return FALSE; -- cgit From a3cfa6f635948c67ccb34ad4040230de2ec38da1 Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Mon, 19 Jul 2010 22:05:23 +0200 Subject: CWS changehid: #i111784#: SetDialogHelpId changed --- svl/inc/pickerhelper.hxx | 4 ++-- svl/source/filepicker/pickerhelper.cxx | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'svl') diff --git a/svl/inc/pickerhelper.hxx b/svl/inc/pickerhelper.hxx index 307031b578d1..0c4215a1fb83 100644 --- a/svl/inc/pickerhelper.hxx +++ b/svl/inc/pickerhelper.hxx @@ -56,11 +56,11 @@ namespace svt SVL_DLLPUBLIC void SetDialogHelpId( ::com::sun::star::uno::Reference < ::com::sun::star::ui::dialogs::XFilePicker > _mxFileDlg, - sal_Int32 _nHelpId ); + const rtl::OString& _nHelpId ); SVL_DLLPUBLIC void SetDialogHelpId( ::com::sun::star::uno::Reference < ::com::sun::star::ui::dialogs::XFolderPicker > _mxFileDlg, - sal_Int32 _nHelpId ); + const rtl::OString& _nHelpId ); } diff --git a/svl/source/filepicker/pickerhelper.cxx b/svl/source/filepicker/pickerhelper.cxx index 72096c1bc56a..2d38d395f8f7 100644 --- a/svl/source/filepicker/pickerhelper.cxx +++ b/svl/source/filepicker/pickerhelper.cxx @@ -45,7 +45,7 @@ using rtl::OUString; namespace svt { void SetDialogHelpId( - Reference < css::ui::dialogs::XFilePicker > _mxFileDlg, sal_Int32 _nHelpId ) + Reference < css::ui::dialogs::XFilePicker > _mxFileDlg, const rtl::OString& _nHelpId ) { try { @@ -60,7 +60,7 @@ namespace svt if( xInfo.is() && xInfo->hasPropertyByName( sHelpURLPropertyName ) ) { // yep OUString sId( RTL_CONSTASCII_USTRINGPARAM( "HID:" ) ); - sId += OUString::valueOf( _nHelpId ); + sId += rtl::OStringToOUString( _nHelpId, RTL_TEXTENCODING_UTF8 ); xDialogProps->setPropertyValue( sHelpURLPropertyName, css::uno::makeAny( sId ) ); } } @@ -71,7 +71,7 @@ namespace svt } void SetDialogHelpId( - Reference< css::ui::dialogs::XFolderPicker > _mxFileDlg, sal_Int32 _nHelpId ) + Reference< css::ui::dialogs::XFolderPicker > _mxFileDlg, const rtl::OString& _nHelpId ) { try { @@ -86,7 +86,7 @@ namespace svt if( xInfo.is() && xInfo->hasPropertyByName( sHelpURLPropertyName ) ) { // yep OUString sId( RTL_CONSTASCII_USTRINGPARAM( "HID:" ) ); - sId += OUString::valueOf( _nHelpId ); + sId += rtl::OStringToOUString( _nHelpId, RTL_TEXTENCODING_UTF8 ); xDialogProps->setPropertyValue( sHelpURLPropertyName, css::uno::makeAny( sId ) ); } } -- cgit From a929816d90303defcded933ef0337f2191fa2cec Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Tue, 20 Jul 2010 14:50:49 +0200 Subject: CWS changehid: #i111784#: consolidate usage of HID schema; remove unused SetDialogHelpId methods --- svl/inc/pickerhelper.hxx | 69 ------------------------ svl/source/filepicker/makefile.mk | 1 - svl/source/filepicker/pickerhelper.cxx | 99 ---------------------------------- 3 files changed, 169 deletions(-) delete mode 100644 svl/inc/pickerhelper.hxx delete mode 100644 svl/source/filepicker/pickerhelper.cxx (limited to 'svl') diff --git a/svl/inc/pickerhelper.hxx b/svl/inc/pickerhelper.hxx deleted file mode 100644 index 0c4215a1fb83..000000000000 --- a/svl/inc/pickerhelper.hxx +++ /dev/null @@ -1,69 +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 _PICKERHELPER_HXX -#define _PICKERHELPER_HXX - -#include "svl/svldllapi.h" -#include "sal/types.h" -#include "com/sun/star/uno/Reference.hxx" - -namespace com -{ - namespace sun - { - namespace star - { - namespace ui - { - namespace dialogs - { - class XFilePicker; - class XFolderPicker; - } - } - } - } -} - - -namespace svt -{ - - SVL_DLLPUBLIC void SetDialogHelpId( - ::com::sun::star::uno::Reference < ::com::sun::star::ui::dialogs::XFilePicker > _mxFileDlg, - const rtl::OString& _nHelpId ); - - SVL_DLLPUBLIC void SetDialogHelpId( - ::com::sun::star::uno::Reference < ::com::sun::star::ui::dialogs::XFolderPicker > _mxFileDlg, - const rtl::OString& _nHelpId ); - -} - -//----------------------------------------------------------------------------- - -#endif diff --git a/svl/source/filepicker/makefile.mk b/svl/source/filepicker/makefile.mk index a4c97ea41aa1..b3c2a829cf54 100644 --- a/svl/source/filepicker/makefile.mk +++ b/svl/source/filepicker/makefile.mk @@ -38,7 +38,6 @@ ENABLE_EXCEPTIONS=TRUE # --- Files -------------------------------------------------------------- SLOFILES =\ - $(SLO)$/pickerhelper.obj \ $(SLO)$/pickerhistory.obj # --- Targets ------------------------------------------------------- diff --git a/svl/source/filepicker/pickerhelper.cxx b/svl/source/filepicker/pickerhelper.cxx deleted file mode 100644 index 2d38d395f8f7..000000000000 --- a/svl/source/filepicker/pickerhelper.cxx +++ /dev/null @@ -1,99 +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. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_svl.hxx" - -#include "pickerhelper.hxx" -#include "rtl/ustring.hxx" -#include "com/sun/star/ui/dialogs/XFilePicker.hpp" -#include "com/sun/star/ui/dialogs/XFolderPicker.hpp" -#include "com/sun/star/beans/XPropertySet.hpp" -#include "com/sun/star/beans/XPropertySetInfo.hpp" -#include "com/sun/star/uno/Any.hxx" -#include "tools/debug.hxx" - -namespace css = com::sun::star; - -using css::uno::Reference; -using rtl::OUString; - -namespace svt -{ - void SetDialogHelpId( - Reference < css::ui::dialogs::XFilePicker > _mxFileDlg, const rtl::OString& _nHelpId ) - { - try - { - // does the dialog haver a help URL property? - Reference< css::beans::XPropertySet > xDialogProps( _mxFileDlg, css::uno::UNO_QUERY ); - Reference< css::beans::XPropertySetInfo > xInfo; - if( xDialogProps.is() ) - xInfo = xDialogProps->getPropertySetInfo( ); - - const OUString sHelpURLPropertyName( RTL_CONSTASCII_USTRINGPARAM( "HelpURL" ) ); - - if( xInfo.is() && xInfo->hasPropertyByName( sHelpURLPropertyName ) ) - { // yep - OUString sId( RTL_CONSTASCII_USTRINGPARAM( "HID:" ) ); - sId += rtl::OStringToOUString( _nHelpId, RTL_TEXTENCODING_UTF8 ); - xDialogProps->setPropertyValue( sHelpURLPropertyName, css::uno::makeAny( sId ) ); - } - } - catch( const css::uno::Exception& ) - { - DBG_ERROR( "svt::SetDialogHelpId(): caught an exception while setting the help id!" ); - } - } - - void SetDialogHelpId( - Reference< css::ui::dialogs::XFolderPicker > _mxFileDlg, const rtl::OString& _nHelpId ) - { - try - { - // does the dialog haver a help URL property? - Reference< css::beans::XPropertySet > xDialogProps( _mxFileDlg, css::uno::UNO_QUERY ); - Reference< css::beans::XPropertySetInfo > xInfo; - if( xDialogProps.is() ) - xInfo = xDialogProps->getPropertySetInfo( ); - - const OUString sHelpURLPropertyName( RTL_CONSTASCII_USTRINGPARAM( "HelpURL" ) ); - - if( xInfo.is() && xInfo->hasPropertyByName( sHelpURLPropertyName ) ) - { // yep - OUString sId( RTL_CONSTASCII_USTRINGPARAM( "HID:" ) ); - sId += rtl::OStringToOUString( _nHelpId, RTL_TEXTENCODING_UTF8 ); - xDialogProps->setPropertyValue( sHelpURLPropertyName, css::uno::makeAny( sId ) ); - } - } - catch( const css::uno::Exception& ) - { - DBG_ERROR( "svt::SetDialogHelpId(): caught an exception while setting the help id!" ); - } - } -} - -- cgit From e937a4331fafe99449c42a07cd3ea66ffc3e488a Mon Sep 17 00:00:00 2001 From: "Thomas Lange [tl]" Date: Mon, 26 Jul 2010 13:12:35 +0200 Subject: cws tl82: #i106993# thesaurus code clean-up --- svl/inc/lngmisc.hxx | 3 +++ svl/source/misc/lngmisc.cxx | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) mode change 100644 => 100755 svl/inc/lngmisc.hxx mode change 100644 => 100755 svl/source/misc/lngmisc.cxx (limited to 'svl') diff --git a/svl/inc/lngmisc.hxx b/svl/inc/lngmisc.hxx old mode 100644 new mode 100755 index d85de673c4c9..5143d147227d --- a/svl/inc/lngmisc.hxx +++ b/svl/inc/lngmisc.hxx @@ -32,6 +32,7 @@ #include #include #include +#include /////////////////////////////////////////////////////////////////////////// @@ -68,6 +69,8 @@ SVL_DLLPUBLIC BOOL RemoveControlChars( rtl::OUString &rTxt ); SVL_DLLPUBLIC BOOL ReplaceControlChars( rtl::OUString &rTxt, sal_Char aRplcChar = ' ' ); +SVL_DLLPUBLIC String GetThesaurusReplaceText( const String &rText ); + } // namespace linguistic #endif diff --git a/svl/source/misc/lngmisc.cxx b/svl/source/misc/lngmisc.cxx old mode 100644 new mode 100755 index 2203cc08458e..488e317c6f58 --- a/svl/source/misc/lngmisc.cxx +++ b/svl/source/misc/lngmisc.cxx @@ -27,6 +27,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svl.hxx" + #include #include #include @@ -132,6 +133,38 @@ BOOL ReplaceControlChars( rtl::OUString &rTxt, sal_Char /*aRplcChar*/ ) return bModified; } + +String GetThesaurusReplaceText( const String &rText ) +{ + // The strings for synonyms returned by the thesaurus sometimes have some + // explanation text put in between '(' and ')' or a trailing '*'. + // These parts should not be put in the ReplaceEdit Text that may get + // inserted into the document. Thus we strip them from the text. + + String aText( rText ); + + xub_StrLen nPos = aText.Search( sal_Unicode('(') ); + while (STRING_NOTFOUND != nPos) + { + xub_StrLen nEnd = aText.Search( sal_Unicode(')'), nPos ); + if (STRING_NOTFOUND != nEnd) + aText.Erase( nPos, nEnd-nPos+1 ); + else + break; + nPos = aText.Search( sal_Unicode('(') ); + } + + nPos = aText.Search( sal_Unicode('*') ); + if (STRING_NOTFOUND != nPos) + aText.Erase( nPos ); + + // remove any possible remaining ' ' that may confuse the thesaurus + // when it gets called with the text + aText.EraseLeadingAndTrailingChars( sal_Unicode(' ') ); + + return aText; +} + /////////////////////////////////////////////////////////////////////////// } // namespace linguistic -- cgit From 33358b07384351eb874166c7c2cda2bdbfedbfa5 Mon Sep 17 00:00:00 2001 From: Lars Langhans Date: Mon, 23 Aug 2010 10:38:44 +0200 Subject: sb123:#i111449# remove all subdirs in complex tests --- svl/qa/complex/ConfigItems/makefile.mk | 3 --- svl/qa/complex/passwordcontainer/makefile.mk | 3 --- 2 files changed, 6 deletions(-) (limited to 'svl') diff --git a/svl/qa/complex/ConfigItems/makefile.mk b/svl/qa/complex/ConfigItems/makefile.mk index ba980e325904..b4241f24dfee 100644 --- a/svl/qa/complex/ConfigItems/makefile.mk +++ b/svl/qa/complex/ConfigItems/makefile.mk @@ -45,9 +45,6 @@ JAVAFILES = $(JAVATESTFILES) JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar EXTRAJARFILES = $(OOO_JUNIT_JAR) -# subdirectories -SUBDIRS = helper - # Sample how to debug # JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y diff --git a/svl/qa/complex/passwordcontainer/makefile.mk b/svl/qa/complex/passwordcontainer/makefile.mk index d05af97d77f1..625404682761 100644 --- a/svl/qa/complex/passwordcontainer/makefile.mk +++ b/svl/qa/complex/passwordcontainer/makefile.mk @@ -54,9 +54,6 @@ JAVAFILES = $(JAVATESTFILES) \ JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar EXTRAJARFILES = $(OOO_JUNIT_JAR) -# subdirectories -# SUBDIRS = helper - # Sample how to debug # JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y -- cgit From a3c8a0ed0c5c6be1cb5c940750222f6381608bd7 Mon Sep 17 00:00:00 2001 From: sb Date: Fri, 10 Sep 2010 13:10:07 +0200 Subject: sb129: #i113189# change UNO components to use passive registration --- svl/prj/d.lst | 3 ++ svl/source/fsstor/fsfactory.cxx | 24 ------------- svl/source/fsstor/fsstorage.component | 35 +++++++++++++++++++ svl/source/fsstor/makefile.mk | 8 +++++ svl/source/passwordcontainer/makefile.mk | 8 +++++ .../passwordcontainer/passwordcontainer.component | 34 ++++++++++++++++++ svl/source/passwordcontainer/passwordcontainer.cxx | 18 ---------- svl/source/uno/registerservices.cxx | 31 ----------------- svl/util/makefile.mk | 8 +++++ svl/util/svl.component | 40 ++++++++++++++++++++++ 10 files changed, 136 insertions(+), 73 deletions(-) create mode 100644 svl/source/fsstor/fsstorage.component create mode 100644 svl/source/passwordcontainer/passwordcontainer.component create mode 100644 svl/util/svl.component (limited to 'svl') diff --git a/svl/prj/d.lst b/svl/prj/d.lst index a5c2564e81cd..d79346c16087 100644 --- a/svl/prj/d.lst +++ b/svl/prj/d.lst @@ -20,3 +20,6 @@ dos: sh -c "if test %OS% = MACOSX; then macosx-create-bundle %_DEST%\bin%_EXT%\b *.xml %_DEST%\xml%_EXT%\*.xml +..\%__SRC%\misc\fsstorage.component %_DEST%\xml%_EXT%\fsstorage.component +..\%__SRC%\misc\passwordcontainer.component %_DEST%\xml%_EXT%\passwordcontainer.component +..\%__SRC%\misc\svl.component %_DEST%\xml%_EXT%\svl.component diff --git a/svl/source/fsstor/fsfactory.cxx b/svl/source/fsstor/fsfactory.cxx index 298b6f555e2a..62fc88f6053a 100644 --- a/svl/source/fsstor/fsfactory.cxx +++ b/svl/source/fsstor/fsfactory.cxx @@ -240,30 +240,6 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment ( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo ( - void * /* pServiceManager */, void * pRegistryKey) -{ - if (pRegistryKey) - { - uno::Reference< registry::XRegistryKey > xRegistryKey ( - reinterpret_cast< registry::XRegistryKey*>(pRegistryKey)); - - uno::Reference< registry::XRegistryKey > xNewKey; - xNewKey = xRegistryKey->createKey( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) + - FSStorageFactory::impl_staticGetImplementationName() + - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES"))); - - const uno::Sequence< ::rtl::OUString > aServices ( - FSStorageFactory::impl_staticGetSupportedServiceNames()); - for( sal_Int32 i = 0; i < aServices.getLength(); i++ ) - xNewKey->createKey( aServices.getConstArray()[i] ); - - return sal_True; - } - return sal_False; -} - SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory ( const sal_Char * pImplementationName, void * pServiceManager, void * /* pRegistryKey */) { diff --git a/svl/source/fsstor/fsstorage.component b/svl/source/fsstor/fsstorage.component new file mode 100644 index 000000000000..3ef0be825972 --- /dev/null +++ b/svl/source/fsstor/fsstorage.component @@ -0,0 +1,35 @@ + + + + + + + + + diff --git a/svl/source/fsstor/makefile.mk b/svl/source/fsstor/makefile.mk index dc91814772f9..1dd5d2307037 100644 --- a/svl/source/fsstor/makefile.mk +++ b/svl/source/fsstor/makefile.mk @@ -64,3 +64,11 @@ DEF1NAME= $(SHL1TARGET) .INCLUDE : target.mk + +ALLTAR : $(MISC)/fsstorage.component + +$(MISC)/fsstorage.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + fsstorage.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt fsstorage.component diff --git a/svl/source/passwordcontainer/makefile.mk b/svl/source/passwordcontainer/makefile.mk index d9eb9615cf80..626a6ffc5830 100644 --- a/svl/source/passwordcontainer/makefile.mk +++ b/svl/source/passwordcontainer/makefile.mk @@ -60,3 +60,11 @@ DEF1NAME= $(SHL1TARGET) .INCLUDE : target.mk + +ALLTAR : $(MISC)/passwordcontainer.component + +$(MISC)/passwordcontainer.component .ERRREMOVE : \ + $(SOLARENV)/bin/createcomponent.xslt passwordcontainer.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt passwordcontainer.component diff --git a/svl/source/passwordcontainer/passwordcontainer.component b/svl/source/passwordcontainer/passwordcontainer.component new file mode 100644 index 000000000000..42eb47cf14dd --- /dev/null +++ b/svl/source/passwordcontainer/passwordcontainer.component @@ -0,0 +1,34 @@ + + + + + + + + diff --git a/svl/source/passwordcontainer/passwordcontainer.cxx b/svl/source/passwordcontainer/passwordcontainer.cxx index 7db18c65db1f..6e92d390eea9 100644 --- a/svl/source/passwordcontainer/passwordcontainer.cxx +++ b/svl/source/passwordcontainer/passwordcontainer.cxx @@ -1543,24 +1543,6 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment ( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo ( - void * /* pServiceManager */, void * pRegistryKey) -{ - if (pRegistryKey) - { - Reference< XRegistryKey > xRegistryKey ( - reinterpret_cast< XRegistryKey* >( pRegistryKey )); - Reference< XRegistryKey > xNewKey; - - xNewKey = xRegistryKey->createKey( - ::rtl::OUString::createFromAscii( "/stardiv.svl.PasswordContainer/UNO/SERVICES" )); - xNewKey->createKey( ::rtl::OUString::createFromAscii("com.sun.star.task.PasswordContainer")); - - return sal_True; - } - return sal_False; -} - SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory ( const sal_Char * pImplementationName, void * pServiceManager, void * /* pRegistryKey */) { diff --git a/svl/source/uno/registerservices.cxx b/svl/source/uno/registerservices.cxx index ab01d308c2da..8edbccc2d435 100644 --- a/svl/source/uno/registerservices.cxx +++ b/svl/source/uno/registerservices.cxx @@ -60,37 +60,6 @@ SVL_DLLPUBLIC void SAL_CALL component_getImplementationEnvironment ( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -SVL_DLLPUBLIC sal_Bool SAL_CALL component_writeInfo ( - void * /* _pServiceManager */, void * _pRegistryKey) -{ - if (_pRegistryKey) - { - Reference< css::registry::XRegistryKey > xRegistryKey ( - reinterpret_cast< css::registry::XRegistryKey* >(_pRegistryKey)); - Reference< css::registry::XRegistryKey > xNewKey; - - xNewKey = xRegistryKey->createKey ( - OUString::createFromAscii( - "/com.sun.star.uno.util.numbers.SvNumberFormatsSupplierServiceObject/UNO/SERVICES" ) ); - xNewKey->createKey ( - OUString::createFromAscii( "com.sun.star.util.NumberFormatsSupplier" ) ); - - xNewKey = xRegistryKey->createKey ( - OUString::createFromAscii( - "/com.sun.star.uno.util.numbers.SvNumberFormatterServiceObject/UNO/SERVICES" ) ); - xNewKey->createKey ( - OUString::createFromAscii( "com.sun.star.util.NumberFormatter" ) ); - - xNewKey = xRegistryKey->createKey( - OUString::createFromAscii( "/com.sun.star.comp.svl.PathService/UNO/SERVICES" ) ); - xNewKey->createKey ( - OUString::createFromAscii( "com.sun.star.config.SpecialConfigManager" ) ); - - return sal_True; - } - return sal_False; -} - SVL_DLLPUBLIC void* SAL_CALL component_getFactory ( const sal_Char * pImplementationName, void * _pServiceManager, void * /* _pRegistryKey*/) { diff --git a/svl/util/makefile.mk b/svl/util/makefile.mk index 3cb87dcd33ad..7cb493ae0d94 100644 --- a/svl/util/makefile.mk +++ b/svl/util/makefile.mk @@ -120,3 +120,11 @@ ALL: $(SLB)$/svl.lib \ .INCLUDE : target.mk + +ALLTAR : $(MISC)/svl.component + +$(MISC)/svl.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + svl.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt svl.component diff --git a/svl/util/svl.component b/svl/util/svl.component new file mode 100644 index 000000000000..4af1a31f5782 --- /dev/null +++ b/svl/util/svl.component @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + -- cgit