diff options
author | Mathias Bauer <mba@openoffice.org> | 2010-10-28 23:02:10 +0200 |
---|---|---|
committer | Mathias Bauer <mba@openoffice.org> | 2010-10-28 23:02:10 +0200 |
commit | e775b40a11ca0eab7964dacc8387367086e2b029 (patch) | |
tree | 6ef64962794427131bea51ffc182b11a394bcc59 /svl | |
parent | acbb009ba0992ec4ad4c9848c0b0ac9ee81effa4 (diff) | |
parent | d5d2a1cffc728100f8119252ff26f95949e6d35c (diff) |
CWS gnumake: resync to m91; conflicts unresolved
Diffstat (limited to 'svl')
32 files changed, 562 insertions, 476 deletions
diff --git a/svl/inc/svl/lngmisc.hxx b/svl/inc/svl/lngmisc.hxx index d85de673c4c9..5143d147227d 100644 --- a/svl/inc/svl/lngmisc.hxx +++ b/svl/inc/svl/lngmisc.hxx @@ -32,6 +32,7 @@ #include <tools/solar.h> #include <sal/types.h> #include <rtl/ustring.hxx> +#include <tools/string.hxx> /////////////////////////////////////////////////////////////////////////// @@ -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/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 + <FALSE/> if format code contains an error + <TRUE/> 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/prj/build.lst b/svl/prj/build.lst index dc1b23e2971a..54eb363e906d 100644 --- a/svl/prj/build.lst +++ b/svl/prj/build.lst @@ -2,4 +2,8 @@ sl svl : l10n rsc offuh ucbhelper unotools cppu cppuhelper comphelper sal sot NU sl svl usr1 - all svl_mkout NULL sl svl\prj nmake - all svl_prj NULL +# complex test for ConfigItems are marked as defect +# 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 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/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 <com/sun/star/uno/XComponentContext.hpp> @@ -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..b4241f24dfee 100644 --- a/svl/qa/complex/ConfigItems/makefile.mk +++ b/svl/qa/complex/ConfigItems/makefile.mk @@ -24,60 +24,38 @@ # 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 - -JARCLASSDIRS = $(PACKAGE) -JARTARGET = $(TARGET).jar -JARCOMPRESS = TRUE +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: +.ELSE -# --- Parameters for the test -------------------------------------- +PRJ = ../../.. +PRJNAME = svl +TARGET = qa_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 +.IF "$(OOO_JUNIT_JAR)" != "" +PACKAGE = complex/ConfigItems -# test base is java complex -CT_TESTBASE = -TestBase java_complex +# here store only Files which contain a @Test +JAVATESTFILES = \ + CheckConfigItems.java -# test looks something like the.full.package.TestName -CT_TEST = -o $(PACKAGE:s\$/\.\).$(JAVAFILES:b) +# put here all other files +JAVAFILES = $(JAVATESTFILES) -# start the runner application -CT_APP = org.openoffice.Runner +JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar +EXTRAJARFILES = $(OOO_JUNIT_JAR) -# --- 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..625404682761 100644 --- a/svl/qa/complex/passwordcontainer/makefile.mk +++ b/svl/qa/complex/passwordcontainer/makefile.mk @@ -25,63 +25,110 @@ # #************************************************************************* -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) +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: +.ELSE -#----- make a jar from compiled files ------------------------------ +PRJ = ../../.. +PRJNAME = svl +TARGET = qa_complex_passwordcontainer -MAXLINELENGTH = 100000 +.IF "$(OOO_JUNIT_JAR)" != "" +PACKAGE = complex/passwordcontainer -JARCLASSDIRS = $(PACKAGE) -JARTARGET = $(TARGET).jar -JARCOMPRESS = TRUE +# here store only Files which contain a @Test +JAVATESTFILES = \ + PasswordContainerUnitTest.java -# --- 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 +# put here all other files +JAVAFILES = $(JAVATESTFILES) \ + PasswordContainerTest.java\ + Test01.java\ + Test02.java\ + Test03.java\ + TestHelper.java\ + MasterPasswdHandler.java -# 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) +JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar +EXTRAJARFILES = $(OOO_JUNIT_JAR) -# 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) +# +# 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 e95058347bd1..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 - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_svl.hxx" - -#include <svl/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, sal_Int32 _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 += OUString::valueOf( _nHelpId ); - 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, sal_Int32 _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 += OUString::valueOf( _nHelpId ); - xDialogProps->setPropertyValue( sHelpURLPropertyName, css::uno::makeAny( sId ) ); - } - } - catch( const css::uno::Exception& ) - { - DBG_ERROR( "svt::SetDialogHelpId(): caught an exception while setting the help id!" ); - } - } -} - 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 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* 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 +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.comp.embed.FileSystemStorageFactory"> + <service name="com.sun.star.comp.embed.FileSystemStorageFactory"/> + <service name="com.sun.star.embed.FileSystemStorageFactory"/> + </implementation> +</component> 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/misc/lngmisc.cxx b/svl/source/misc/lngmisc.cxx index 4f203b22e200..c0866b21e785 100644 --- a/svl/source/misc/lngmisc.cxx +++ b/svl/source/misc/lngmisc.cxx @@ -27,7 +27,12 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svl.hxx" +<<<<<<< local #include <svl/lngmisc.hxx> +======= + +#include <lngmisc.hxx> +>>>>>>> other #include <tools/solar.h> #include <tools/string.hxx> #include <tools/debug.hxx> @@ -132,6 +137,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 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 - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_svl.hxx" - -#ifdef WIN -#include <svwin.h> - -#ifndef _SYSDEP_HXX -#include <sysdep.hxx> -#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/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 dbcad199f367..3d943fef230c 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; @@ -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<sal_uInt16>(14)); // limits to 14 decimals 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 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* 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 +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="stardiv.svl.PasswordContainer"> + <service name="com.sun.star.task.PasswordContainer"/> + </implementation> +</component> 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/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 <osl/thread.h> -#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<LPCWSTR>(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/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 <svl/svdde.hxx> -#if defined( WIN ) && defined( MSC ) -#pragma code_seg( "SVDDE_MISC_CODE" ) -#endif - // --- DdeString::DdeString() -------------------------------------- DdeString::DdeString( DWORD hDdeInst, const sal_Unicode* p ) : 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 7f8518b5cf47..8f0ced38aca8 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 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* 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 +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.comp.svl.PathService"> + <service name="com.sun.star.config.SpecialConfigManager"/> + </implementation> + <implementation name="com.sun.star.uno.util.numbers.SvNumberFormatsSupplierServiceObject"> + <service name="com.sun.star.util.NumberFormatsSupplier"/> + </implementation> + <implementation name="com.sun.star.uno.util.numbers.SvNumberFormatterServiceObject"> + <service name="com.sun.star.util.NumberFormatter"/> + </implementation> +</component> |