[Libreoffice-commits] .: 19 commits - basctl/source basic/source binaryurp/source comphelper/CppunitTest_comphelper_test.mk comphelper/inc comphelper/Module_comphelper.mk comphelper/qa comphelper/source connectivity/source cui/source desktop/source l10ntools/source lotuswordpro/source qadevOOo/testdocs rsc/Executable_rsc.mk rsc/source sc/source sd/source sfx2/inc sfx2/source svl/inc svl/source svtools/bmpmaker svtools/Executable_bmp.mk svtools/source sw/source tools/inc tools/source unotools/source unusedcode.easy vcl/inc vcl/source vcl/unx vcl/win
Caolán McNamara
caolan at kemper.freedesktop.org
Mon Aug 15 01:22:51 PDT 2011
basctl/source/basicide/baside2b.cxx | 3
basic/source/app/app.cxx | 5
binaryurp/source/writer.cxx | 5
comphelper/CppunitTest_comphelper_test.mk | 56 ++
comphelper/Module_comphelper.mk | 4
comphelper/inc/comphelper/string.hxx | 72 +++
comphelper/qa/string/test_string.cxx | 80 +++
comphelper/qa/string/test_string_noadditional.cxx | 33 -
comphelper/source/misc/string.cxx | 67 +++
connectivity/source/drivers/adabas/BDriver.cxx | 4
connectivity/source/drivers/hsqldb/HDriver.cxx | 14
cui/source/options/optinet2.cxx | 5
desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx | 35 -
l10ntools/source/export.cxx | 29 -
l10ntools/source/gsicheck.cxx | 8
l10ntools/source/makefile.mk | 2
lotuswordpro/source/filter/lwpparastyle.cxx | 12
lotuswordpro/source/filter/lwpparastyle.hxx | 2
qadevOOo/testdocs/vertical-testcase.odt |binary
rsc/Executable_rsc.mk | 1
rsc/source/rsc/rsc.cxx | 8
sc/source/ui/app/inputwin.cxx | 3
sc/source/ui/unoobj/docuno.cxx | 3
sc/source/ui/view/tabvwsh3.cxx | 4
sd/source/filter/ppt/pptin.cxx | 5
sd/source/ui/dlg/tpoption.cxx | 24 -
sfx2/inc/sfx2/dispatch.hxx | 1
sfx2/source/control/dispatch.cxx | 15
svl/inc/svl/svstdarr.hxx | 5
svl/inc/svl/zformat.hxx | 9
svl/source/memtools/svarray.cxx | 1
svl/source/numbers/zforfind.cxx | 2
svl/source/numbers/zformat.cxx | 5
svtools/Executable_bmp.mk | 1
svtools/bmpmaker/bmpcore.cxx | 3
svtools/source/filter/sgvtext.cxx | 5
sw/source/core/doc/docnum.cxx | 5
tools/inc/tools/string.hxx | 5
tools/source/inet/inetmsg.cxx | 70 +--
tools/source/string/tstring.cxx | 21
unotools/source/config/configmgr.cxx | 20
unusedcode.easy | 66 --
vcl/inc/glyphcache.hxx | 27 -
vcl/source/glyphs/gcach_ftyp.hxx | 2
vcl/source/glyphs/gcach_vdev.cxx | 290 -------------
vcl/source/glyphs/gcach_vdev.hxx | 60 --
vcl/source/glyphs/glyphcache.cxx | 2
vcl/unx/generic/fontmanager/fontconfig.cxx | 4
vcl/unx/generic/gdi/salgdi3.cxx | 10
vcl/win/source/gdi/salgdi3.cxx | 6
50 files changed, 442 insertions(+), 677 deletions(-)
New commits:
commit 51e0d9a96045329d8e348f752a80e81d1f90309e
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Aug 15 09:11:50 2011 +0100
regenerate list
diff --git a/unusedcode.easy b/unusedcode.easy
index b942358..9a28303 100644
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -2289,7 +2289,6 @@ basegfx::unotools::integerRectangle2DFromB2IRectangle(basegfx::B2IRange const&)
basic::ScriptExtensionIterator::implGetScriptPackageFromPackage(com::sun::star::uno::Reference<com::sun::star::deployment::XPackage>, bool&)
basic::vba::createDocumentsEnumeration(com::sun::star::uno::Reference<com::sun::star::frame::XModel> const&)
basic::vba::getCurrentDirectory(com::sun::star::uno::Reference<com::sun::star::frame::XModel> const&)
-binaryurp::(anonymous namespace)::isProtocolPropertyMessage(rtl::OUString const&)
binfilter::B3dEdgeEntryBucketMemArr::Insert(binfilter::B3dEdgeEntryBucketMemArr const*, unsigned short, unsigned short, unsigned short)
binfilter::B3dEdgeEntryBucketMemArr::Replace(char const*&, unsigned short)
binfilter::B3dEdgeEntryBucketMemArr::Replace(char const**, unsigned short, unsigned short)
@@ -2773,7 +2772,6 @@ comphelper::findProperty(com::sun::star::beans::Property&, com::sun::star::uno::
comphelper::getPathToSystemRegistry()
comphelper::getPathToUserRegistry()
comphelper::string::searchAndReplaceAllAsciiWithAscii(rtl::OUString const&, char const*, char const*, int)
-comphelper::string::searchAndReplaceAsciiL(rtl::OUString const&, char const*, int, rtl::OUString const&, int, int*)
connectivity::OKeyValue::OKeyValue()
connectivity::ORowSetValue::setFromDouble(double const&, int)
connectivity::OSQLInternalNode::OSQLInternalNode(unsigned short const*, connectivity::SQLNodeType, unsigned int)
commit eba1f976ce6fa08dc1a63840e0b4bfce44673aae
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Aug 15 09:11:35 2011 +0100
rename test
diff --git a/comphelper/qa/string/test_string.cxx b/comphelper/qa/string/test_string.cxx
index 4d3d50d..4ac96dc 100644
--- a/comphelper/qa/string/test_string.cxx
+++ b/comphelper/qa/string/test_string.cxx
@@ -41,14 +41,14 @@ namespace {
class TestString: public CppUnit::TestFixture
{
public:
- void test();
+ void testSearchAndReplaceAsciiL();
void testNatural();
void testReplace();
void testToken();
void testDecimalStringToNumber();
CPPUNIT_TEST_SUITE(TestString);
- CPPUNIT_TEST(test);
+ CPPUNIT_TEST(testSearchAndReplaceAsciiL);
CPPUNIT_TEST(testNatural);
CPPUNIT_TEST(testReplace);
CPPUNIT_TEST(testToken);
@@ -56,7 +56,7 @@ public:
CPPUNIT_TEST_SUITE_END();
};
-void TestString::test()
+void TestString::testSearchAndReplaceAsciiL()
{
rtl::OUString s1(RTL_CONSTASCII_USTRINGPARAM("foobarbar"));
sal_Int32 n1;
commit d0964b3ea1f932b7e9e70786d81fff6b4cb7f39f
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Aug 15 09:10:32 2011 +0100
callcatcher: unused methods
diff --git a/binaryurp/source/writer.cxx b/binaryurp/source/writer.cxx
index c01c56c..42a2388 100644
--- a/binaryurp/source/writer.cxx
+++ b/binaryurp/source/writer.cxx
@@ -51,11 +51,6 @@ namespace {
namespace css = com::sun::star;
-bool isProtocolPropertyMessage(rtl::OUString const & oid) {
- return oid.equalsAsciiL(
- RTL_CONSTASCII_STRINGPARAM("UrpProtocolProperties"));
-}
-
}
Writer::Item::Item() {}
commit 061ebc34468c37d27524352de56faaf9df742556
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Aug 15 00:22:23 2011 +0100
add a getToken wrapper for extracting a single token painlessly
diff --git a/comphelper/inc/comphelper/string.hxx b/comphelper/inc/comphelper/string.hxx
index 886074d..c576a24 100644
--- a/comphelper/inc/comphelper/string.hxx
+++ b/comphelper/inc/comphelper/string.hxx
@@ -134,6 +134,34 @@ COMPHELPER_DLLPUBLIC rtl::OString replace(const rtl::OString &rIn,
COMPHELPER_DLLPUBLIC rtl::OUString replace(const rtl::OUString &rIn,
const rtl::OUString &rSearch, const rtl::OUString &rReplace);
+/** Returns a token in the OString
+
+ @param token the number of the token to return
+ @param cTok the character which seperate the tokens.
+ @return the token if token is negative or doesn't exist an empty token
+ is returned
+*/
+COMPHELPER_DLLPUBLIC inline rtl::OString getToken(const rtl::OString &rIn,
+ sal_Int32 nToken, sal_Char cTok) SAL_THROW(())
+{
+ sal_Int32 nIndex = 0;
+ return rIn.getToken(nToken, cTok, nIndex);
+}
+
+/** Returns a token in the OUString
+
+ @param token the number of the token to return
+ @param cTok the character which seperate the tokens.
+ @return the token if token is negative or doesn't exist an empty token
+ is returned
+*/
+COMPHELPER_DLLPUBLIC inline rtl::OUString getToken(const rtl::OUString &rIn,
+ sal_Int32 nToken, sal_Unicode cTok) SAL_THROW(())
+{
+ sal_Int32 nIndex = 0;
+ return rIn.getToken(nToken, cTok, nIndex);
+}
+
/** Convert a sequence of strings to a single comma separated string.
Note that no escaping of commas or anything fancy is done.
diff --git a/comphelper/qa/string/test_string.cxx b/comphelper/qa/string/test_string.cxx
index 8dbd056..4d3d50d 100644
--- a/comphelper/qa/string/test_string.cxx
+++ b/comphelper/qa/string/test_string.cxx
@@ -44,12 +44,14 @@ public:
void test();
void testNatural();
void testReplace();
+ void testToken();
void testDecimalStringToNumber();
CPPUNIT_TEST_SUITE(TestString);
CPPUNIT_TEST(test);
CPPUNIT_TEST(testNatural);
CPPUNIT_TEST(testReplace);
+ CPPUNIT_TEST(testToken);
CPPUNIT_TEST(testDecimalStringToNumber);
CPPUNIT_TEST_SUITE_END();
};
@@ -311,11 +313,39 @@ void TestString::testReplace()
CPPUNIT_ASSERT(aOut.isEmpty());
aIn = rtl::OString(RTL_CONSTASCII_STRINGPARAM("aaa foo aaa foo bbb"));
+
aOut = ::comphelper::string::replace(aIn,
rtl::OString(RTL_CONSTASCII_STRINGPARAM("foo")),
rtl::OString(RTL_CONSTASCII_STRINGPARAM("bar")));
CPPUNIT_ASSERT(aOut.equalsL(
RTL_CONSTASCII_STRINGPARAM("aaa bar aaa bar bbb")));
+
+ aOut = ::comphelper::string::replace(aIn,
+ rtl::OString(' '),
+ rtl::OString());
+ CPPUNIT_ASSERT(aOut.equalsL(
+ RTL_CONSTASCII_STRINGPARAM("aaafooaaafoobbb")));
+}
+
+void TestString::testToken()
+{
+ ::rtl::OString aIn(RTL_CONSTASCII_STRINGPARAM("10.11.12"));
+ ::rtl::OString aOut;
+
+ aOut = ::comphelper::string::getToken(aIn, -1, '.');
+ CPPUNIT_ASSERT(aOut.isEmpty());
+
+ aOut = ::comphelper::string::getToken(aIn, 0, '.');
+ CPPUNIT_ASSERT(aOut.equalsL(RTL_CONSTASCII_STRINGPARAM("10")));
+
+ aOut = ::comphelper::string::getToken(aIn, 1, '.');
+ CPPUNIT_ASSERT(aOut.equalsL(RTL_CONSTASCII_STRINGPARAM("11")));
+
+ aOut = ::comphelper::string::getToken(aIn, 2, '.');
+ CPPUNIT_ASSERT(aOut.equalsL(RTL_CONSTASCII_STRINGPARAM("12")));
+
+ aOut = ::comphelper::string::getToken(aIn, 3, '.');
+ CPPUNIT_ASSERT(aOut.isEmpty());
}
CPPUNIT_TEST_SUITE_REGISTRATION(TestString);
diff --git a/connectivity/source/drivers/hsqldb/HDriver.cxx b/connectivity/source/drivers/hsqldb/HDriver.cxx
index fcb3408..3973cf5 100644
--- a/connectivity/source/drivers/hsqldb/HDriver.cxx
+++ b/connectivity/source/drivers/hsqldb/HDriver.cxx
@@ -53,6 +53,7 @@
#include <osl/process.h>
#include <connectivity/dbexception.hxx>
#include <comphelper/namedvaluecollection.hxx>
+#include <comphelper/string.hxx>
#include <unotools/confignode.hxx>
#include <unotools/ucbstreamhelper.hxx>
#include "resource/hsqldb_res.hrc"
@@ -278,7 +279,7 @@ namespace connectivity
if ( pStream.get() )
{
ByteString sLine;
- ByteString sVersionString;
+ rtl::OString sVersionString;
while ( pStream->ReadLine(sLine) )
{
if ( sLine.Len() == 0 )
@@ -292,18 +293,19 @@ namespace connectivity
else
{
if ( sIniKey.Equals( "version" )
- && ( sVersionString.Len() == 0 )
+ && ( sVersionString.isEmpty() )
)
{
sVersionString = sValue;
}
}
}
- if ( sVersionString.Len() )
+ if (!sVersionString.isEmpty())
{
- const sal_Int32 nMajor = sVersionString.GetToken(0,'.').ToInt32();
- const sal_Int32 nMinor = sVersionString.GetToken(1,'.').ToInt32();
- const sal_Int32 nMicro = sVersionString.GetToken(2,'.').ToInt32();
+ using comphelper::string::getToken;
+ const sal_Int32 nMajor = getToken(sVersionString, 0, '.').toInt32();
+ const sal_Int32 nMinor = getToken(sVersionString, 1, '.').toInt32();
+ const sal_Int32 nMicro = getToken(sVersionString, 2, '.').toInt32();
if ( nMajor > 1
|| ( nMajor == 1 && nMinor > 8 )
|| ( nMajor == 1 && nMinor == 8 && nMicro > 0 ) )
diff --git a/l10ntools/source/export.cxx b/l10ntools/source/export.cxx
index b6a47a0..9cfb032 100644
--- a/l10ntools/source/export.cxx
+++ b/l10ntools/source/export.cxx
@@ -36,6 +36,7 @@
#include <iostream>
#include <vector>
#include <rtl/strbuf.hxx>
+#include <comphelper/string.hxx>
extern "C" { int yyerror( const char * ); }
extern "C" { int YYWarning( const char * ); }
@@ -1032,23 +1033,29 @@ int Export::Execute( int nToken, const char * pToken )
bDontWriteOutput = sal_True;
}
break;
- case APPFONTMAPPING: {
+ case APPFONTMAPPING:
+ {
+ using comphelper::string::replace;
+ using comphelper::string::getToken;
+
bDontWriteOutput = sal_False;
// this is a AppfontMapping, so look if its a definition
// of field size
ByteString sKey = sToken.GetToken( 0, '=' );
sKey.EraseAllChars( ' ' );
sKey.EraseAllChars( '\t' );
- ByteString sMapping = sToken.GetToken( 1, '=' );
- sMapping = sMapping.GetToken( 1, '(' );
- sMapping = sMapping.GetToken( 0, ')' );
- sMapping.EraseAllChars( ' ' );
- sMapping.EraseAllChars( '\t' );
- if ( sKey.ToUpperAscii() == "SIZE" ) {
- pResData->nWidth = ( sal_uInt16 ) sMapping.GetToken( 0, ',' ).ToInt32();
- }
- else if ( sKey == "POSSIZE" ) {
- pResData->nWidth = ( sal_uInt16 ) sMapping.GetToken( 2, ',' ).ToInt32();
+ rtl::OString sMapping = sToken.GetToken( 1, '=' );
+ sMapping = getToken(sMapping, 1, '(');
+ sMapping = getToken(sMapping, 0, ')');
+ sMapping = replace(sMapping, rtl::OString(' '), rtl::OString());
+ sMapping = replace(sMapping, rtl::OString('\t'), rtl::OString());
+ if ( sKey.ToUpperAscii() == "SIZE" )
+ {
+ pResData->nWidth = ( sal_uInt16 ) getToken(sMapping, 0, ',').toInt32();
+ }
+ else if ( sKey == "POSSIZE" )
+ {
+ pResData->nWidth = ( sal_uInt16 ) getToken(sMapping, 2, ',').toInt32();
}
}
break;
diff --git a/l10ntools/source/makefile.mk b/l10ntools/source/makefile.mk
index 5ab3c4f..50e9e33 100644
--- a/l10ntools/source/makefile.mk
+++ b/l10ntools/source/makefile.mk
@@ -77,6 +77,7 @@ APP1TARGET= transex3
APP1OBJS= $(OBJ)$/src_yy_wrapper.obj
APP1STDLIBS+= \
$(TOOLSLIB) \
+ $(COMPHELPERLIB) \
$(SALLIB)
APP1LIBS+= $(LB)$/$(TARGET).lib
APP1DEPN= $(OBJ)$/src_yy_wrapper.obj $(LB)$/$(TARGET).lib
commit 90fe8dadaaad07aee2ec513eab1ad75bbf306cb3
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Aug 15 00:10:42 2011 +0100
add a jdk 1.5-alike string replace to comphelper::string
diff --git a/comphelper/inc/comphelper/string.hxx b/comphelper/inc/comphelper/string.hxx
index dd3261b..886074d 100644
--- a/comphelper/inc/comphelper/string.hxx
+++ b/comphelper/inc/comphelper/string.hxx
@@ -110,6 +110,30 @@ COMPHELPER_DLLPUBLIC ::rtl::OUString&
::rtl::OUString const & replace, sal_Int32 beginAt = 0,
sal_Int32 * replacedAt = NULL );
+/** Replaces each substring of this OString that matches the search OString
+ with the specified replacement OString
+
+ @param rIn The input OString
+ @param rSearch The substring to be replaced
+ @param rReplace The replacement substring
+
+ @return The resulting OString
+ */
+COMPHELPER_DLLPUBLIC rtl::OString replace(const rtl::OString &rIn,
+ const rtl::OString &rSearch, const rtl::OString &rReplace);
+
+/** Replaces each substring of this OUString that matches the search OUString
+ with the specified replacement OUString
+
+ @param rIn The input OUString
+ @param rSearch The substring to be replaced
+ @param rReplace The replacement substring
+
+ @return The resulting OUString
+ */
+COMPHELPER_DLLPUBLIC rtl::OUString replace(const rtl::OUString &rIn,
+ const rtl::OUString &rSearch, const rtl::OUString &rReplace);
+
/** Convert a sequence of strings to a single comma separated string.
Note that no escaping of commas or anything fancy is done.
@@ -213,7 +237,6 @@ COMPHELPER_DLLPUBLIC bool isAsciiDecimalString(const rtl::OString &rString);
*/
COMPHELPER_DLLPUBLIC bool isAsciiDecimalString(const rtl::OUString &rString);
-
} }
#endif
diff --git a/comphelper/qa/string/test_string.cxx b/comphelper/qa/string/test_string.cxx
index eefe7a9..8dbd056 100644
--- a/comphelper/qa/string/test_string.cxx
+++ b/comphelper/qa/string/test_string.cxx
@@ -43,11 +43,13 @@ class TestString: public CppUnit::TestFixture
public:
void test();
void testNatural();
+ void testReplace();
void testDecimalStringToNumber();
CPPUNIT_TEST_SUITE(TestString);
CPPUNIT_TEST(test);
CPPUNIT_TEST(testNatural);
+ CPPUNIT_TEST(testReplace);
CPPUNIT_TEST(testDecimalStringToNumber);
CPPUNIT_TEST_SUITE_END();
};
@@ -288,6 +290,34 @@ void TestString::testNatural()
);
}
+void TestString::testReplace()
+{
+ ::rtl::OString aIn(RTL_CONSTASCII_STRINGPARAM("aaa"));
+ ::rtl::OString aOut;
+
+ aOut = ::comphelper::string::replace(aIn,
+ rtl::OString(RTL_CONSTASCII_STRINGPARAM("aa")),
+ rtl::OString(RTL_CONSTASCII_STRINGPARAM("b")));
+ CPPUNIT_ASSERT(aOut.equalsL(RTL_CONSTASCII_STRINGPARAM("ba")));
+
+ aOut = ::comphelper::string::replace(aIn,
+ rtl::OString(),
+ rtl::OString(RTL_CONSTASCII_STRINGPARAM("whatever")));
+ CPPUNIT_ASSERT(aOut.equalsL(RTL_CONSTASCII_STRINGPARAM("aaa")));
+
+ aOut = ::comphelper::string::replace(aIn,
+ rtl::OString(RTL_CONSTASCII_STRINGPARAM("aaa")),
+ rtl::OString());
+ CPPUNIT_ASSERT(aOut.isEmpty());
+
+ aIn = rtl::OString(RTL_CONSTASCII_STRINGPARAM("aaa foo aaa foo bbb"));
+ aOut = ::comphelper::string::replace(aIn,
+ rtl::OString(RTL_CONSTASCII_STRINGPARAM("foo")),
+ rtl::OString(RTL_CONSTASCII_STRINGPARAM("bar")));
+ CPPUNIT_ASSERT(aOut.equalsL(
+ RTL_CONSTASCII_STRINGPARAM("aaa bar aaa bar bbb")));
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(TestString);
}
diff --git a/comphelper/source/misc/string.cxx b/comphelper/source/misc/string.cxx
index 249ef2e..b31d115 100644
--- a/comphelper/source/misc/string.cxx
+++ b/comphelper/source/misc/string.cxx
@@ -36,6 +36,8 @@
#include <rtl/ustring.hxx>
#include <rtl/ustrbuf.hxx>
+#include <rtl/string.hxx>
+#include <rtl/strbuf.hxx>
#include <sal/types.h>
#include <comphelper/string.hxx>
@@ -94,6 +96,48 @@ rtl::OUString searchAndReplaceAsciiL(
return _source;
}
+namespace
+{
+ template <typename T, typename O> T tmpl_replace(const T &rIn,
+ const T &rSearch, const T &rReplace)
+ {
+ if (rIn.isEmpty() || rSearch.isEmpty())
+ return rIn;
+
+ O aRet;
+
+ sal_Int32 nFromIndex = 0;
+ while (nFromIndex < rIn.getLength())
+ {
+ sal_Int32 nIndex = rIn.indexOf(rSearch, nFromIndex);
+ if (nIndex == -1)
+ {
+ aRet.append(rIn.copy(nFromIndex));
+ break;
+ }
+ aRet.append(rIn.copy(nFromIndex, nIndex-nFromIndex));
+ aRet.append(rReplace);
+ nFromIndex = nIndex+rSearch.getLength();
+ }
+
+ return aRet.makeStringAndClear();
+ }
+}
+
+rtl::OString replace(const rtl::OString &rIn, const rtl::OString &rSearch,
+ const rtl::OString &rReplace)
+{
+ return tmpl_replace<rtl::OString, rtl::OStringBuffer>(rIn, rSearch,
+ rReplace);
+}
+
+rtl::OUString replace(const rtl::OUString &rIn, const rtl::OUString &rSearch,
+ const rtl::OUString &rReplace)
+{
+ return tmpl_replace<rtl::OUString, rtl::OUStringBuffer>(rIn, rSearch,
+ rReplace);
+}
+
sal_uInt32 decimalStringToNumber(
::rtl::OUString const & str )
{
diff --git a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
index 96a279f..7c75f9d 100644
--- a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
+++ b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
@@ -77,6 +77,7 @@
#include "cppuhelper/exc_hlp.hxx"
#include "cppuhelper/implbase3.hxx"
#include "comphelper/anytostring.hxx"
+#include "comphelper/string.hxx"
#include "vcl/msgbox.hxx"
#include "toolkit/helper/vclunohelper.hxx"
#include "comphelper/processfactory.hxx"
@@ -250,9 +251,6 @@ public:
void stop();
bool isBusy();
- static OUString searchAndReplaceAll( const OUString &rSource,
- const OUString &rWhat,
- const OUString &rWith );
private:
Thread( Thread & ); // not defined
void operator =( Thread & ); // not defined
@@ -902,7 +900,7 @@ void ExtensionCmdQueue::Thread::_addExtension( ::rtl::Reference< ProgressCmdEnv
rCmdEnv->setWarnUser( bWarnUser );
uno::Reference< deployment::XExtensionManager > xExtMgr = m_pManager->getExtensionManager();
uno::Reference< task::XAbortChannel > xAbortChannel( xExtMgr->createAbortChannel() );
- OUString sTitle = searchAndReplaceAll( m_sAddingPackages, OUSTR("%EXTENSION_NAME"), sName );
+ OUString sTitle = comphelper::string::replace(m_sAddingPackages, OUSTR("%EXTENSION_NAME"), sName);
rCmdEnv->progressSection( sTitle, xAbortChannel );
try
@@ -929,7 +927,7 @@ void ExtensionCmdQueue::Thread::_removeExtension( ::rtl::Reference< ProgressCmdE
{
uno::Reference< deployment::XExtensionManager > xExtMgr = m_pManager->getExtensionManager();
uno::Reference< task::XAbortChannel > xAbortChannel( xExtMgr->createAbortChannel() );
- OUString sTitle = searchAndReplaceAll( m_sRemovingPackages, OUSTR("%EXTENSION_NAME"), xPackage->getDisplayName() );
+ OUString sTitle = comphelper::string::replace(m_sRemovingPackages, OUSTR("%EXTENSION_NAME"), xPackage->getDisplayName());
rCmdEnv->progressSection( sTitle, xAbortChannel );
OUString id( dp_misc::getIdentifier( xPackage ) );
@@ -1012,7 +1010,7 @@ void ExtensionCmdQueue::Thread::_enableExtension( ::rtl::Reference< ProgressCmdE
uno::Reference< deployment::XExtensionManager > xExtMgr = m_pManager->getExtensionManager();
uno::Reference< task::XAbortChannel > xAbortChannel( xExtMgr->createAbortChannel() );
- OUString sTitle = searchAndReplaceAll( m_sEnablingPackages, OUSTR("%EXTENSION_NAME"), xPackage->getDisplayName() );
+ OUString sTitle = comphelper::string::replace(m_sEnablingPackages, OUSTR("%EXTENSION_NAME"), xPackage->getDisplayName());
rCmdEnv->progressSection( sTitle, xAbortChannel );
try
@@ -1034,7 +1032,7 @@ void ExtensionCmdQueue::Thread::_disableExtension( ::rtl::Reference< ProgressCmd
uno::Reference< deployment::XExtensionManager > xExtMgr = m_pManager->getExtensionManager();
uno::Reference< task::XAbortChannel > xAbortChannel( xExtMgr->createAbortChannel() );
- OUString sTitle = searchAndReplaceAll( m_sDisablingPackages, OUSTR("%EXTENSION_NAME"), xPackage->getDisplayName() );
+ OUString sTitle = comphelper::string::replace(m_sDisablingPackages, OUSTR("%EXTENSION_NAME"), xPackage->getDisplayName());
rCmdEnv->progressSection( sTitle, xAbortChannel );
try
@@ -1056,7 +1054,7 @@ void ExtensionCmdQueue::Thread::_acceptLicense( ::rtl::Reference< ProgressCmdEnv
uno::Reference< deployment::XExtensionManager > xExtMgr = m_pManager->getExtensionManager();
uno::Reference< task::XAbortChannel > xAbortChannel( xExtMgr->createAbortChannel() );
- OUString sTitle = searchAndReplaceAll( m_sAcceptLicense, OUSTR("%EXTENSION_NAME"), xPackage->getDisplayName() );
+ OUString sTitle = comphelper::string::replace(m_sAcceptLicense, OUSTR("%EXTENSION_NAME"), xPackage->getDisplayName());
rCmdEnv->progressSection( sTitle, xAbortChannel );
try
@@ -1090,27 +1088,6 @@ void ExtensionCmdQueue::Thread::_insert(const TExtensionCmd& rExtCmd)
}
//------------------------------------------------------------------------------
-OUString ExtensionCmdQueue::Thread::searchAndReplaceAll( const OUString &rSource,
- const OUString &rWhat,
- const OUString &rWith )
-{
- OUString aRet( rSource );
- sal_Int32 nLen = rWhat.getLength();
-
- if ( !nLen )
- return aRet;
-
- sal_Int32 nIndex = rSource.indexOf( rWhat );
- while ( nIndex != -1 )
- {
- aRet = aRet.replaceAt( nIndex, nLen, rWith );
- nIndex = aRet.indexOf( rWhat, nIndex + rWith.getLength() );
- }
- return aRet;
-}
-
-
-//------------------------------------------------------------------------------
ExtensionCmdQueue::ExtensionCmdQueue( DialogHelper * pDialogHelper,
TheExtensionManager *pManager,
const uno::Reference< uno::XComponentContext > &rContext )
diff --git a/tools/inc/tools/string.hxx b/tools/inc/tools/string.hxx
index fd89e28..ae4d8a9 100644
--- a/tools/inc/tools/string.hxx
+++ b/tools/inc/tools/string.hxx
@@ -169,10 +169,10 @@ private:
// of ByteString(sal_Char);
ByteString( const UniString& rUniStr, xub_StrLen nPos, xub_StrLen nLen,
rtl_TextEncoding eTextEncoding,
- sal_uInt32 nCvtFlags = UNISTRING_TO_BYTESTRING_CVTFLAGS );
+ sal_uInt32 nCvtFlags = UNISTRING_TO_BYTESTRING_CVTFLAGS ); //not implemented, to detect use of removed methods without compiler making something to fit
ByteString( const sal_Unicode* pUniStr, xub_StrLen nLen,
rtl_TextEncoding eTextEncoding,
- sal_uInt32 nCvtFlags = UNISTRING_TO_BYTESTRING_CVTFLAGS );
+ sal_uInt32 nCvtFlags = UNISTRING_TO_BYTESTRING_CVTFLAGS ); //not implemented, to detect use of removed methods without compiler making somethiing to fit
void Assign(int); // not implemented; to detect misuses of
// Assign(sal_Char)
void operator =(int); // not implemented; to detect misuses
commit 3324eca4eddb906c0a0d8efbc86b097f96a2c3a7
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Aug 15 00:02:44 2011 +0100
ByteString->rtl::OString
diff --git a/connectivity/source/drivers/adabas/BDriver.cxx b/connectivity/source/drivers/adabas/BDriver.cxx
index 39365b7..664ba0d 100644
--- a/connectivity/source/drivers/adabas/BDriver.cxx
+++ b/connectivity/source/drivers/adabas/BDriver.cxx
@@ -1635,7 +1635,7 @@ void ODriver::checkAndInsertNewDevSpace(const ::rtl::OUString& sDBName,
UCBContentHelper::Kill(sCommandFile);
#endif
SvStream* pFileStream = aCmdFile.GetStream(STREAM_STD_READWRITE);
- ByteString sStateLine;
+ rtl::OString sStateLine;
sal_Bool bRead = sal_True;
sal_Int32 nDataPages = 0;
while(pFileStream && bRead && !pFileStream->IsEof())
@@ -1643,7 +1643,7 @@ void ODriver::checkAndInsertNewDevSpace(const ::rtl::OUString& sDBName,
bRead = pFileStream->ReadLine(sStateLine);
if(bRead)
{
- nDataPages = sStateLine.ToInt32();
+ nDataPages = sStateLine.toInt32();
if(nDataPages && nDataPages < 100)
{
// the space isn't big enough anymore so we increment it
commit 42fc17bf2f4c0a8ed92e1bf78f54642bd77c23d0
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sun Aug 14 23:59:40 2011 +0100
ByteString->rtl::OString
diff --git a/rsc/source/rsc/rsc.cxx b/rsc/source/rsc/rsc.cxx
index 26520bb..168d93d 100644
--- a/rsc/source/rsc/rsc.cxx
+++ b/rsc/source/rsc/rsc.cxx
@@ -150,8 +150,9 @@ RscCmdLine::RscCmdLine( int argc, char ** argv, RscError * pEH )
nCommands |= PRINTSYNTAX_FLAG;
}
else if( !rsc_strnicmp( (*ppStr) + 1, "RefDeep", 7 ) )
- { // maximale Aufloesungtiefe fuer Referenzen
- nRefDeep = ByteString( (*ppStr) +1 + strlen( "RefDeep" ) ).ToInt32();
+ {
+ // maximale Aufloesungtiefe fuer Referenzen
+ nRefDeep = rtl::OString((*ppStr) + 1 + RTL_CONSTASCII_LENGTH("RefDeep")).toInt32();
}
else if( !rsc_stricmp( (*ppStr) + 1, "p" ) )
{ // kein Preprozessor
commit a04d91ea3b11a37b8717999aeeb72239077b4619
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sun Aug 14 23:46:37 2011 +0100
restore cppunit test (yet again)
diff --git a/comphelper/CppunitTest_comphelper_test.mk b/comphelper/CppunitTest_comphelper_test.mk
new file mode 100644
index 0000000..92c32fe
--- /dev/null
+++ b/comphelper/CppunitTest_comphelper_test.mk
@@ -0,0 +1,56 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#*************************************************************************
+# Version: MPL 1.1 / GPLv3+ / LGPLv3+
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License or as specified alternatively below. You may obtain a copy of
+# the License at http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Initial Developer of the Original Code is
+# Caolán McNamara, Red Hat, Inc. <caolanm at redhat.com>
+# Portions created by the Initial Developer are Copyright (C) 2011 the
+# Initial Developer. All Rights Reserved.
+#
+# Major Contributor(s):
+#
+# For minor contributions see the git repository.
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+# instead of those above.
+#*************************************************************************
+
+$(eval $(call gb_CppunitTest_CppunitTest,comphelper_test))
+
+$(eval $(call gb_CppunitTest_add_exception_objects,comphelper_test, \
+ comphelper/qa/string/test_string \
+))
+
+$(eval $(call gb_CppunitTest_add_api,comphelper_test, \
+ udkapi \
+ offapi \
+))
+
+$(eval $(call gb_CppunitTest_add_linked_libs,comphelper_test, \
+ comphelper \
+ cppuhelper \
+ cppu \
+ sal \
+ $(gb_STDLIBS) \
+))
+
+$(eval $(call gb_CppunitTest_set_include,comphelper_test,\
+ -I$(realpath $(SRCDIR)/comphelper/inc/pch) \
+ -I$(realpath $(SRCDIR)/comphelper/inc) \
+ $$(INCLUDE) \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/comphelper/Module_comphelper.mk b/comphelper/Module_comphelper.mk
index e1220ed..08e3f17 100644
--- a/comphelper/Module_comphelper.mk
+++ b/comphelper/Module_comphelper.mk
@@ -37,4 +37,8 @@ $(eval $(call gb_Module_add_subsequentcheck_targets,comphelper,\
JunitTest_comphelper_complex \
))
+$(eval $(call gb_Module_add_check_targets,comphelper,\
+ CppunitTest_comphelper_test \
+))
+
# vim: set noet sw=4 ts=4:
diff --git a/comphelper/qa/string/test_string.cxx b/comphelper/qa/string/test_string.cxx
index c448ebb..eefe7a9 100644
--- a/comphelper/qa/string/test_string.cxx
+++ b/comphelper/qa/string/test_string.cxx
@@ -27,20 +27,14 @@
************************************************************************/
#include "precompiled_comphelper.hxx"
-#include "sal/config.h"
+#include "sal/cppunit.h"
-#include "comphelper/string.hxx"
+#include <comphelper/string.hxx>
#include <cppuhelper/implbase1.hxx>
#include <com/sun/star/i18n/CharType.hpp>
-#include <cppunit/TestFixture.h>
-#include <cppunit/extensions/HelperMacros.h>
-#include <cppunit/plugin/TestPlugIn.h>
-
-#include "rtl/string.h"
-#include "rtl/ustring.h"
+#include "rtl/string.hxx"
#include "rtl/ustring.hxx"
-#include "sal/types.h"
namespace {
@@ -298,4 +292,6 @@ CPPUNIT_TEST_SUITE_REGISTRATION(TestString);
}
+CPPUNIT_PLUGIN_IMPLEMENT();
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/comphelper/qa/string/test_string_noadditional.cxx b/comphelper/qa/string/test_string_noadditional.cxx
deleted file mode 100644
index 9f3bfe5..0000000
--- a/comphelper/qa/string/test_string_noadditional.cxx
+++ /dev/null
@@ -1,33 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * 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.
- *
- ************************************************************************/
-
-#include <cppunit/plugin/TestPlugIn.h>
-
-CPPUNIT_PLUGIN_IMPLEMENT();
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 80ebe51e60cf67b36946764816b53a5d962bafdb
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sun Aug 14 21:59:18 2011 +0100
callcatcher: strip away some more unused
diff --git a/unusedcode.easy b/unusedcode.easy
index 5910daa..b942358 100644
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -2631,14 +2631,6 @@ binfilter::XDashList::Remove(long)
binfilter::XDashList::Replace(binfilter::XDashEntry*, long)
binfilter::XDashTable::Remove(long)
binfilter::XDashTable::Replace(long, binfilter::XDashEntry*)
-binfilter::XGradientList::Remove(long)
-binfilter::XGradientList::Replace(binfilter::XGradientEntry*, long)
-binfilter::XGradientTable::Remove(long)
-binfilter::XGradientTable::Replace(long, binfilter::XGradientEntry*)
-binfilter::XHatchList::Remove(long)
-binfilter::XHatchList::Replace(binfilter::XHatchEntry*, long)
-binfilter::XHatchTable::Remove(long)
-binfilter::XHatchTable::Replace(long, binfilter::XHatchEntry*)
binfilter::XLineEndList::Remove(long)
binfilter::XLineEndList::Replace(binfilter::XLineEndEntry*, long)
binfilter::XLineEndTable::Remove(long)
commit 9124003eb1e398957a85c5c009ac5eddf5e6f28e
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sun Aug 14 01:37:52 2011 +0100
ByteString::IsNumericAscii->comphelper::string::isAsciiDecimalString
shrink ByteString api, remove need for intermediate OString/ByteString
with random-ish encoding solely for check
diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx
index 28df6b1..e6cf7b1 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -60,6 +60,7 @@
#include <com/sun/star/script/XLibraryContainer2.hpp>
#include <comphelper/processfactory.hxx>
+#include <comphelper/string.hxx>
using namespace ::com::sun::star;
@@ -268,7 +269,7 @@ void EditorWindow::RequestHelp( const HelpEvent& rHEvt )
TextPaM aCursor = GetEditView()->GetTextEngine()->GetPaM( aDocPos, sal_False );
TextPaM aStartOfWord;
String aWord = GetEditView()->GetTextEngine()->GetWord( aCursor, &aStartOfWord );
- if ( aWord.Len() && !ByteString( aWord, RTL_TEXTENCODING_UTF8 ).IsNumericAscii() )
+ if ( aWord.Len() && !comphelper::string::isAsciiDecimalString(aWord) )
{
sal_uInt16 nLastChar =aWord.Len()-1;
if ( strchr( cSuffixes, aWord.GetChar( nLastChar ) ) )
diff --git a/basic/source/app/app.cxx b/basic/source/app/app.cxx
index f605e95..6509ad8 100644
--- a/basic/source/app/app.cxx
+++ b/basic/source/app/app.cxx
@@ -61,6 +61,7 @@
#include <ucbhelper/configurationkeys.hxx>
#include <comphelper/regpathhelper.hxx>
#include <comphelper/processfactory.hxx>
+#include <comphelper/string.hxx>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/lang/XComponent.hpp>
#include <cppuhelper/bootstrap.hxx>
@@ -374,11 +375,11 @@ IMPL_LINK( BasicApp, LateInit, void *, pDummy )
{
if ( (i+1) < Application::GetCommandLineParamCount() )
{
- if ( ByteString( Application::GetCommandLineParam( i+1 ), osl_getThreadTextEncoding() ).IsNumericAscii() )
+ if ( comphelper::string::isAsciiDecimalString(Application::GetCommandLineParam(i+1)) )
{
MsgEdit::SetMaxLogLen( sal::static_int_cast< sal_uInt16 >( Application::GetCommandLineParam( i+1 ).ToInt32() ) );
}
- i++;
+ ++i;
}
}
}
diff --git a/comphelper/inc/comphelper/string.hxx b/comphelper/inc/comphelper/string.hxx
index e71a008..dd3261b 100644
--- a/comphelper/inc/comphelper/string.hxx
+++ b/comphelper/inc/comphelper/string.hxx
@@ -193,6 +193,27 @@ public:
const ::com::sun::star::lang::Locale& getLocale() const { return m_aLocale; }
};
+/** Determine if an OString contains solely ascii numeric digits
+
+ @param rString An OString
+
+ @return false if string contains any characters outside
+ the ascii '0'-'9' range
+ true otherwise, including for empty string
+ */
+COMPHELPER_DLLPUBLIC bool isAsciiDecimalString(const rtl::OString &rString);
+
+/** Determine if an OUString contains solely ascii numeric digits
+
+ @param rString An OUString
+
+ @return false if string contains any characters outside
+ the ascii '0'-'9' range
+ true otherwise, including for empty string
+ */
+COMPHELPER_DLLPUBLIC bool isAsciiDecimalString(const rtl::OUString &rString);
+
+
} }
#endif
diff --git a/comphelper/source/misc/string.cxx b/comphelper/source/misc/string.cxx
index 18ad6ad..249ef2e 100644
--- a/comphelper/source/misc/string.cxx
+++ b/comphelper/source/misc/string.cxx
@@ -308,6 +308,29 @@ NaturalStringSorter::NaturalStringSorter(
uno::UNO_QUERY_THROW);
}
+namespace
+{
+ template <typename T> bool tmpl_isAsciiDecimalString(const T &rString)
+ {
+ for (sal_Int32 i = 0; i < rString.getLength(); ++i)
+ {
+ if ((rString[i] < '0') || (rString[i] > '9'))
+ return false;
+ }
+ return true;
+ }
+}
+
+bool isAsciiDecimalString(const rtl::OString &rString)
+{
+ return tmpl_isAsciiDecimalString(rString);
+}
+
+bool isAsciiDecimalString(const rtl::OUString &rString)
+{
+ return tmpl_isAsciiDecimalString(rString);
+}
+
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx
index cb093d4..4b80409 100644
--- a/cui/source/options/optinet2.cxx
+++ b/cui/source/options/optinet2.cxx
@@ -93,6 +93,7 @@
#include <com/sun/star/beans/XPropertyState.hpp>
#include <com/sun/star/util/XChangesBatch.hpp>
#include <comphelper/processfactory.hxx>
+#include <comphelper/string.hxx>
#include "com/sun/star/ui/dialogs/TemplateDescription.hpp"
#include "com/sun/star/task/XMasterPasswordHandling2.hpp"
@@ -164,7 +165,7 @@ void SvxNoSpaceEdit::Modify()
{
XubString aValue = GetText();
- if ( !ByteString(::rtl::OUStringToOString(aValue,RTL_TEXTENCODING_UTF8)).IsNumericAscii() || (long)aValue.ToInt32() > USHRT_MAX )
+ if ( !comphelper::string::isAsciiDecimalString(aValue) || (long)aValue.ToInt32() > USHRT_MAX )
// der H�chstwert einer Portnummer ist USHRT_MAX
ErrorBox( this, CUI_RES( RID_SVXERR_OPT_PROXYPORTS ) ).Execute();
}
@@ -628,7 +629,7 @@ IMPL_LINK( SvxProxyTabPage, LoseFocusHdl_Impl, Edit *, pEdit )
{
XubString aValue = pEdit->GetText();
- if ( !ByteString(::rtl::OUStringToOString(aValue,RTL_TEXTENCODING_UTF8)).IsNumericAscii() || (long)aValue.ToInt32() > USHRT_MAX )
+ if ( !comphelper::string::isAsciiDecimalString(aValue) || (long)aValue.ToInt32() > USHRT_MAX )
pEdit->SetText( '0' );
return 0;
}
diff --git a/l10ntools/source/gsicheck.cxx b/l10ntools/source/gsicheck.cxx
index 2fd8b8b..da305db 100644
--- a/l10ntools/source/gsicheck.cxx
+++ b/l10ntools/source/gsicheck.cxx
@@ -33,7 +33,7 @@
#include <tools/stream.hxx>
#include <rtl/strbuf.hxx>
-
+#include <comphelper/string.hxx>
#include "tagtest.hxx"
#include "gsicheck.hxx"
@@ -67,7 +67,7 @@ sal_Bool LanguageOK( ByteString aLang )
if ( !aLang.Len() )
return sal_False;
- if ( aLang.IsNumericAscii() )
+ if (comphelper::string::isAsciiDecimalString(aLang))
return sal_True;
if ( aLang.GetTokenCount( '-' ) == 1 )
@@ -153,7 +153,7 @@ GSILine::GSILine( const ByteString &rLine, sal_uLong nLine )
aTitle = rLine.GetToken( 13, '\t' );
// do some more format checks here
- if ( !rLine.GetToken( 8, '\t' ).IsNumericAscii() )
+ if (!comphelper::string::isAsciiDecimalString(rLine.GetToken(8, '\t')))
{
PrintError( "The length field does not contain a number!", "Line format", rLine.GetToken( 8, '\t' ), sal_True, GetLineNumber(), GetUniqId() );
NotOK();
@@ -491,7 +491,7 @@ sal_Bool GSIBlock::IsUTF8( const ByteString &aTestee, sal_Bool bFixTags, sal_uIn
if ( aID.Len() > 0 && aID.GetChar(aID.Len()-1) == '*' )
aID.Erase( aID.Len()-1 );
- if ( aID.IsNumericAscii() && aID.Len() >= 5 )
+ if (comphelper::string::isAsciiDecimalString(aID) && aID.Len() >= 5)
bIsKeyID = sal_True;
}
diff --git a/l10ntools/source/makefile.mk b/l10ntools/source/makefile.mk
index 86bcea3..5ab3c4f 100644
--- a/l10ntools/source/makefile.mk
+++ b/l10ntools/source/makefile.mk
@@ -98,6 +98,7 @@ APP3STDLIBS+= \
APP5TARGET= gsicheck
APP5OBJS= $(OBJ)$/gsicheck.obj $(OBJ)$/tagtest.obj
APP5STDLIBS+= \
+ $(COMPHELPERLIB) \
$(TOOLSLIB) \
$(SALLIB)
diff --git a/rsc/Executable_rsc.mk b/rsc/Executable_rsc.mk
index d4b175c..ec8945f 100644
--- a/rsc/Executable_rsc.mk
+++ b/rsc/Executable_rsc.mk
@@ -48,6 +48,7 @@ $(eval $(call gb_Executable_add_defs,rsc,\
$(eval $(call gb_Executable_add_linked_libs,rsc,\
i18nisolang1 \
+ comphelper \
sal \
tl \
$(gb_STDLIBS) \
diff --git a/rsc/source/rsc/rsc.cxx b/rsc/source/rsc/rsc.cxx
index 6dbf71c..26520bb 100644
--- a/rsc/source/rsc/rsc.cxx
+++ b/rsc/source/rsc/rsc.cxx
@@ -65,6 +65,7 @@
#include <rtl/strbuf.hxx>
#include <rtl/tencinfo.h>
#include <rtl/textenc.h>
+#include <comphelper/string.hxx>
#include <vector>
#include <algorithm>
@@ -1197,7 +1198,7 @@ void RscCompiler::PreprocessSrsFile( const RscCmdLine::OutputFile& rOutputFile,
aLine.EraseLeadingChars( '\t' );
aLine.EraseAllChars( ';' );
- if( aLine.IsNumericAscii() )
+ if (comphelper::string::isAsciiDecimalString(aLine))
{
ByteString aBaseFileName( aPrefix );
sal_Int32 nNumber = atoi( aLine.GetBuffer() );
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index d9efd94..401d68c 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -76,6 +76,7 @@
#include "AccessibleEditObject.hxx"
#include "AccessibleText.hxx"
#include <svtools/miscopt.hxx>
+#include <comphelper/string.hxx>
#define TEXT_STARTPOS 3
#define TEXT_MULTI_STARTPOS 5
@@ -1789,7 +1790,7 @@ ScNameInputType lcl_GetInputType( const String& rText )
eRet = SC_NAME_INPUT_NAMEDRANGE;
else if ( aRangeUtil.MakeRangeFromName( rText, pDoc, nTab, aRange, RUTL_DBASE, eConv ) )
eRet = SC_NAME_INPUT_DATABASE;
- else if ( ByteString( rText, RTL_TEXTENCODING_ASCII_US ).IsNumericAscii() &&
+ else if ( comphelper::string::isAsciiDecimalString( rText ) &&
( nNumeric = rText.ToInt32() ) > 0 && nNumeric <= MAXROW+1 )
eRet = SC_NAME_INPUT_ROW;
else if ( pDoc->GetTable( rText, nNameTab ) )
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 8645e9f..11ef07a 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -67,6 +67,7 @@
#include <com/sun/star/reflection/XIdlClassProvider.hpp>
#include <comphelper/processfactory.hxx>
#include <comphelper/servicehelper.hxx>
+#include <comphelper/string.hxx>
#include "docuno.hxx"
#include "cellsuno.hxx"
@@ -701,7 +702,7 @@ bool lcl_ParseTarget( const String& rTarget, ScRange& rTargetRange, Rectangle& r
{
bRangeValid = true; // named range or database range
}
- else if ( ByteString( rTarget, RTL_TEXTENCODING_ASCII_US ).IsNumericAscii() &&
+ else if ( comphelper::string::isAsciiDecimalString(rTarget) &&
( nNumeric = rTarget.ToInt32() ) > 0 && nNumeric <= MAXROW+1 )
{
// row number is always mapped to cell A(row) on the same sheet
diff --git a/sc/source/ui/view/tabvwsh3.cxx b/sc/source/ui/view/tabvwsh3.cxx
index 922e31c..43775ad 100644
--- a/sc/source/ui/view/tabvwsh3.cxx
+++ b/sc/source/ui/view/tabvwsh3.cxx
@@ -78,6 +78,7 @@
#include <svx/zoomslideritem.hxx>
#include <svx/svxdlg.hxx>
#include <svx/dialogs.hrc>
+#include <comphelper/string.hxx>
#include "scabstdlg.hxx"
#include <memory>
@@ -327,8 +328,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
}
}
- if ( !(nResult & SCA_VALID) &&
- ByteString(aAddress, RTL_TEXTENCODING_ASCII_US).IsNumericAscii() )
+ if ( !(nResult & SCA_VALID) && comphelper::string::isAsciiDecimalString(aAddress) )
{
sal_Int32 nNumeric = aAddress.ToInt32();
if ( nNumeric > 0 && nNumeric <= MAXROW+1 )
diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx
index bae84f0..0e4dab8 100644
--- a/sd/source/filter/ppt/pptin.cxx
+++ b/sd/source/filter/ppt/pptin.cxx
@@ -102,6 +102,7 @@
#include <comphelper/processfactory.hxx>
#include <comphelper/componentcontext.hxx>
+#include <comphelper/string.hxx>
using namespace ::com::sun::star;
@@ -445,7 +446,7 @@ sal_Bool ImplSdPPTImport::Import()
// first pass, searching for a SlideId
for( nToken = 0; nToken < nTokenCount; nToken++ )
{
- if ( aStringAry[ nToken ].IsNumericAscii() )
+ if (comphelper::string::isAsciiDecimalString(aStringAry[nToken]))
{
sal_Int32 nNumber = aStringAry[ nToken ].ToInt32();
if ( nNumber & ~0xff )
@@ -483,7 +484,7 @@ sal_Bool ImplSdPPTImport::Import()
{ // third pass, searching for a slide number
for ( nToken = 0; nToken < nTokenCount; nToken++ )
{
- if ( aStringAry[ nToken ].IsNumericAscii() )
+ if (comphelper::string::isAsciiDecimalString(aStringAry[nToken]))
{
sal_Int32 nNumber = aStringAry[ nToken ].ToInt32();
if ( ( nNumber & ~0xff ) == 0 )
diff --git a/sd/source/ui/dlg/tpoption.cxx b/sd/source/ui/dlg/tpoption.cxx
index 1ed3d3d..f0f2fd2 100644
--- a/sd/source/ui/dlg/tpoption.cxx
+++ b/sd/source/ui/dlg/tpoption.cxx
@@ -40,6 +40,7 @@
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/container/XEnumerationAccess.hpp>
#include <comphelper/processfactory.hxx>
+#include <comphelper/string.hxx>
#include <com/sun/star/uno/Exception.hpp>
#include <sfx2/module.hxx>
#include <sfx2/app.hxx>
@@ -758,28 +759,25 @@ sal_Bool SdTpOptionsMisc::SetScale( const String& aScale, sal_Int32& rX, sal_Int
if( aScale.GetTokenCount( TOKEN ) != 2 )
return( sal_False );
- ByteString aTmp( aScale.GetToken( 0, TOKEN ), RTL_TEXTENCODING_ASCII_US );
- if( !aTmp.IsNumericAscii() )
- return( sal_False );
+ rtl::OUString aTmp(aScale.GetToken( 0, TOKEN ));
+ if (!comphelper::string::isAsciiDecimalString(aTmp))
+ return sal_False;
- rX = (long) aTmp.ToInt32();
+ rX = (long) aTmp.toInt32();
if( rX == 0 )
return( sal_False );
- aTmp = ByteString( aScale.GetToken( 1, TOKEN ), RTL_TEXTENCODING_ASCII_US );
- if( !aTmp.IsNumericAscii() )
- return( sal_False );
+ aTmp = aScale.GetToken( 1, TOKEN );
+ if (!comphelper::string::isAsciiDecimalString(aTmp))
+ return sal_False;
- rY = (long) aTmp.ToInt32();
+ rY = (long) aTmp.toInt32();
if( rY == 0 )
- return( sal_False );
+ return sal_False;
- return( sal_True );
+ return sal_True;
}
-
-
-
void SdTpOptionsMisc::UpdateCompatibilityControls (void)
{
// Disable the compatibility controls by default. Enable them only when
diff --git a/svtools/Executable_bmp.mk b/svtools/Executable_bmp.mk
index c65ff4c..b75fd60 100644
--- a/svtools/Executable_bmp.mk
+++ b/svtools/Executable_bmp.mk
@@ -46,6 +46,7 @@ $(eval $(call gb_Executable_add_api,bmp,\
$(eval $(call gb_Executable_add_linked_libs,bmp,\
sal \
+ comphelper \
tl \
vcl \
$(gb_STDLIBS) \
diff --git a/svtools/bmpmaker/bmpcore.cxx b/svtools/bmpmaker/bmpcore.cxx
index 622cce4..c4f8db8 100644
--- a/svtools/bmpmaker/bmpcore.cxx
+++ b/svtools/bmpmaker/bmpcore.cxx
@@ -29,6 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
+#include <comphelper/string.hxx>
#include <tools/color.hxx>
#include <vcl/bmpacc.hxx>
#include <vcl/bitmapex.hxx>
@@ -133,7 +134,7 @@ void BmpCreator::ImplCreate( const ::std::vector< DirEntry >& rInDirs,
aLine.EraseLeadingChars( '\t' );
aLine.EraseAllChars( ';' );
- if( aLine.IsNumericAscii() )
+ if (comphelper::string::isAsciiDecimalString(aLine))
{
aString = aPrefix;
diff --git a/svtools/source/filter/sgvtext.cxx b/svtools/source/filter/sgvtext.cxx
index c3dfeff..20879f0 100644
--- a/svtools/source/filter/sgvtext.cxx
+++ b/svtools/source/filter/sgvtext.cxx
@@ -30,6 +30,7 @@
#include "precompiled_svtools.hxx"
#include <rtl/math.h>
+#include <comphelper/string.hxx>
#include <tools/config.hxx>
#include <svtools/filter.hxx>
#include "sgffilt.hxx"
@@ -1207,7 +1208,7 @@ void SgfFontOne::ReadOne( ByteString& ID, ByteString& Dsc )
else if ( s.CompareTo( "MAC", 3 ) == COMPARE_EQUAL ) SVChSet=RTL_TEXTENCODING_APPLE_ROMAN;
else if ( s.CompareTo( "SYMBOL", 6 ) == COMPARE_EQUAL ) SVChSet=RTL_TEXTENCODING_SYMBOL;
else if ( s.CompareTo( "SYSTEM", 6 ) == COMPARE_EQUAL ) SVChSet = gsl_getSystemTextEncoding();
- else if ( s.IsNumericAscii() ) SVWidth=sal::static_int_cast< sal_uInt16 >(s.ToInt32());
+ else if ( comphelper::string::isAsciiDecimalString(s) ) SVWidth=sal::static_int_cast< sal_uInt16 >(s.ToInt32());
}
}
}
@@ -1266,7 +1267,7 @@ void SgfFontLst::ReadList()
FID = aCfg.GetKeyName( i );
FID = FID.EraseAllChars(); // Leerzeichen weg
Dsc = aCfg.ReadKey( i );
- if ( FID.IsNumericAscii() )
+ if (comphelper::string::isAsciiDecimalString(FID))
{
P=new SgfFontOne; // neuer Eintrag
if (Last!=NULL) Last->Next=P; else pList=P; Last=P; // einklinken
diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx
index fa37614..51d0ece 100644
--- a/sw/source/core/doc/docnum.cxx
+++ b/sw/source/core/doc/docnum.cxx
@@ -63,6 +63,7 @@
#include <list.hxx>
#include <listfunc.hxx>
#include <switerator.hxx>
+#include <comphelper/string.hxx>
#include <map>
@@ -641,7 +642,7 @@ sal_uInt16 lcl_FindOutlineNum( const SwNodes& rNds, String& rName )
nPos = 0;
sNum = sName.GetToken( 0, '.', nPos );
// #i4533# without this check all parts delimited by a dot are treated as outline numbers
- if(!ByteString(sNum, gsl_getSystemTextEncoding()).IsNumericAscii())
+ if(!comphelper::string::isAsciiDecimalString(sNum))
nPos = STRING_NOTFOUND;
}
rName = sName; // das ist der nachfolgende Text.
@@ -727,7 +728,7 @@ sal_Bool SwDoc::GotoOutline( SwPosition& rPos, const String& rName ) const
String sTempNum;
while(sExpandedText.Len() && (sTempNum = sExpandedText.GetToken(0, '.', nPos)).Len() &&
STRING_NOTFOUND != nPos &&
- ByteString(sTempNum, gsl_getSystemTextEncoding()).IsNumericAscii())
+ comphelper::string::isAsciiDecimalString(sTempNum))
{
sExpandedText.Erase(0, nPos);
nPos = 0;
diff --git a/tools/inc/tools/string.hxx b/tools/inc/tools/string.hxx
index 1141cd3..fd89e28 100644
--- a/tools/inc/tools/string.hxx
+++ b/tools/inc/tools/string.hxx
@@ -258,7 +258,6 @@ public:
sal_Bool IsLowerAscii() const;
sal_Bool IsUpperAscii() const;
sal_Bool IsAlphaAscii() const;
- sal_Bool IsNumericAscii() const;
sal_Bool IsAlphaNumericAscii() const;
ByteString& ToLowerAscii();
diff --git a/tools/source/inet/inetmsg.cxx b/tools/source/inet/inetmsg.cxx
index 1645e9b..d6b67fe 100644
--- a/tools/source/inet/inetmsg.cxx
+++ b/tools/source/inet/inetmsg.cxx
@@ -35,7 +35,7 @@
#include <tools/inetstrm.hxx>
#include <rtl/instance.hxx>
#include <rtl/strbuf.hxx>
-
+#include <comphelper/string.hxx>
#include <stdio.h>
//=======================================================================
@@ -310,10 +310,10 @@ static sal_uInt16 ParseNumber (const ByteString& rStr, sal_uInt16& nIndex)
sal_uInt16 n = nIndex;
while ((n < rStr.Len()) && ascii_isDigit(rStr.GetChar(n))) n++;
- ByteString aNum (rStr.Copy (nIndex, (n - nIndex)));
+ rtl::OString aNum (rStr.Copy (nIndex, (n - nIndex)));
nIndex = n;
- return (sal_uInt16)(aNum.ToInt32());
+ return (sal_uInt16)(aNum.toInt32());
}
static sal_uInt16 ParseMonth (const ByteString& rStr, sal_uInt16& nIndex)
@@ -333,69 +333,71 @@ static sal_uInt16 ParseMonth (const ByteString& rStr, sal_uInt16& nIndex)
sal_Bool INetRFC822Message::ParseDateField (
const UniString& rDateFieldW, DateTime& rDateTime)
{
- ByteString rDateField (rDateFieldW, RTL_TEXTENCODING_ASCII_US);
- if (rDateField.Len() == 0) return sal_False;
+ rtl::OString aDateField(rtl::OUStringToOString(rDateFieldW,
+ RTL_TEXTENCODING_ASCII_US));
+
+ if (aDateField.isEmpty()) return sal_False;
- if (rDateField.Search (':') != STRING_NOTFOUND)
+ if (aDateField.indexOf(':') != -1)
{
// Some DateTime format.
sal_uInt16 nIndex = 0;
// Skip over <Wkd> or <Weekday>, leading and trailing space.
- while ((nIndex < rDateField.Len()) &&
- (rDateField.GetChar(nIndex) == ' '))
+ while ((nIndex < aDateField.getLength()) &&
+ (aDateField[nIndex] == ' '))
nIndex++;
while (
- (nIndex < rDateField.Len()) &&
- (ascii_isLetter (rDateField.GetChar(nIndex)) ||
- (rDateField.GetChar(nIndex) == ',') ))
+ (nIndex < aDateField.getLength()) &&
+ (ascii_isLetter (aDateField[nIndex]) ||
+ (aDateField[nIndex] == ',') ))
nIndex++;
- while ((nIndex < rDateField.Len()) &&
- (rDateField.GetChar(nIndex) == ' '))
+ while ((nIndex < aDateField.getLength()) &&
+ (aDateField[nIndex] == ' '))
nIndex++;
- if (ascii_isLetter (rDateField.GetChar(nIndex)))
+ if (ascii_isLetter (aDateField[nIndex]))
{
// Format: ctime().
- if ((rDateField.Len() - nIndex) < 20) return sal_False;
+ if ((aDateField.getLength() - nIndex) < 20) return sal_False;
- rDateTime.SetMonth (ParseMonth (rDateField, nIndex)); nIndex++;
- rDateTime.SetDay (ParseNumber (rDateField, nIndex)); nIndex++;
+ rDateTime.SetMonth (ParseMonth (aDateField, nIndex)); nIndex++;
+ rDateTime.SetDay (ParseNumber (aDateField, nIndex)); nIndex++;
- rDateTime.SetHour (ParseNumber (rDateField, nIndex)); nIndex++;
- rDateTime.SetMin (ParseNumber (rDateField, nIndex)); nIndex++;
- rDateTime.SetSec (ParseNumber (rDateField, nIndex)); nIndex++;
+ rDateTime.SetHour (ParseNumber (aDateField, nIndex)); nIndex++;
+ rDateTime.SetMin (ParseNumber (aDateField, nIndex)); nIndex++;
+ rDateTime.SetSec (ParseNumber (aDateField, nIndex)); nIndex++;
rDateTime.Set100Sec (0);
- sal_uInt16 nYear = ParseNumber (rDateField, nIndex);
+ sal_uInt16 nYear = ParseNumber (aDateField, nIndex);
if (nYear < 100) nYear += 1900;
rDateTime.SetYear (nYear);
}
else
{
// Format: RFC1036 or RFC1123.
- if ((rDateField.Len() - nIndex) < 17) return sal_False;
+ if ((aDateField.getLength() - nIndex) < 17) return sal_False;
- rDateTime.SetDay (ParseNumber (rDateField, nIndex)); nIndex++;
- rDateTime.SetMonth (ParseMonth (rDateField, nIndex)); nIndex++;
+ rDateTime.SetDay (ParseNumber (aDateField, nIndex)); nIndex++;
+ rDateTime.SetMonth (ParseMonth (aDateField, nIndex)); nIndex++;
- sal_uInt16 nYear = ParseNumber (rDateField, nIndex); nIndex++;
+ sal_uInt16 nYear = ParseNumber (aDateField, nIndex); nIndex++;
if (nYear < 100) nYear += 1900;
rDateTime.SetYear (nYear);
- rDateTime.SetHour (ParseNumber (rDateField, nIndex)); nIndex++;
- rDateTime.SetMin (ParseNumber (rDateField, nIndex)); nIndex++;
- rDateTime.SetSec (ParseNumber (rDateField, nIndex)); nIndex++;
+ rDateTime.SetHour (ParseNumber (aDateField, nIndex)); nIndex++;
+ rDateTime.SetMin (ParseNumber (aDateField, nIndex)); nIndex++;
+ rDateTime.SetSec (ParseNumber (aDateField, nIndex)); nIndex++;
rDateTime.Set100Sec (0);
- if ((rDateField.GetChar(nIndex) == '+') ||
- (rDateField.GetChar(nIndex) == '-') )
+ if ((aDateField[nIndex] == '+') ||
+ (aDateField[nIndex] == '-') )
{
// Offset from GMT: "(+|-)HHMM".
- sal_Bool bEast = (rDateField.GetChar(nIndex++) == '+');
- sal_uInt16 nOffset = ParseNumber (rDateField, nIndex);
+ sal_Bool bEast = (aDateField[nIndex++] == '+');
+ sal_uInt16 nOffset = ParseNumber (aDateField, nIndex);
if (nOffset > 0)
{
Time aDiff;
@@ -412,11 +414,11 @@ sal_Bool INetRFC822Message::ParseDateField (
}
}
}
- else if (rDateField.IsNumericAscii())
+ else if (comphelper::string::isAsciiDecimalString(aDateField))
{
// Format: delta seconds.
Time aDelta (0);
- aDelta.SetTime (rDateField.ToInt32() * 100);
+ aDelta.SetTime (aDateField.toInt32() * 100);
DateTime aNow;
aNow += aDelta;
diff --git a/tools/source/string/tstring.cxx b/tools/source/string/tstring.cxx
index 40310cf..e0872ee 100644
--- a/tools/source/string/tstring.cxx
+++ b/tools/source/string/tstring.cxx
@@ -163,27 +163,6 @@ sal_Bool ByteString::IsAlphaAscii() const
// -----------------------------------------------------------------------
-sal_Bool ByteString::IsNumericAscii() const
-{
- DBG_CHKTHIS( ByteString, DbgCheckByteString );
-
- sal_Int32 nIndex = 0;
- sal_Int32 nLen = mpData->mnLen;
- const sal_Char* pStr = mpData->maStr;
- while ( nIndex < nLen )
- {
- if ( !((*pStr >= 48) && (*pStr <= 57)) )
- return sal_False;
-
- ++pStr,
- ++nIndex;
- }
-
- return sal_True;
-}
-
-// -----------------------------------------------------------------------
-
sal_Bool ByteString::IsAlphaNumericAscii() const
{
DBG_CHKTHIS( ByteString, DbgCheckByteString );
commit a6825d680c7f49dd462a858cc8691757a6dd4cba
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Aug 13 23:25:25 2011 +0100
SvByteStringsSortDtor is now finally gone
diff --git a/svl/inc/svl/svstdarr.hxx b/svl/inc/svl/svstdarr.hxx
index bfeeb35..2dd5b89 100644
--- a/svl/inc/svl/svstdarr.hxx
+++ b/svl/inc/svl/svstdarr.hxx
@@ -93,11 +93,6 @@ SV_DECL_PTRARR_VISIBILITY( SvByteStrings, ByteStringPtr, 1, 1, SVL_DLLPUBLIC )
#define _SVSTDARR_BYTESTRINGS_DECL
#endif
-#ifndef _SVSTDARR_BYTESTRINGSSORTDTOR_DECL
-SV_DECL_PTRARR_SORT_DEL_VISIBILITY( SvByteStringsSortDtor, ByteStringPtr, 1, 1, SVL_DLLPUBLIC )
-#define _SVSTDARR_BYTESTRINGSSORTDTOR_DECL
-#endif
-
typedef std::deque< xub_StrLen > SvXub_StrLens;
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svl/source/memtools/svarray.cxx b/svl/source/memtools/svarray.cxx
index 4032800..bdbadca 100644
--- a/svl/source/memtools/svarray.cxx
+++ b/svl/source/memtools/svarray.cxx
@@ -71,7 +71,6 @@ SV_IMPL_OP_PTRARR_SORT( SvStringsSort, StringPtr )
SV_IMPL_OP_PTRARR_SORT( SvStringsSortDtor, StringPtr )
SV_IMPL_PTRARR( SvByteStrings, ByteStringPtr )
-SV_IMPL_OP_PTRARR_SORT( SvByteStringsSortDtor, ByteStringPtr )
// ---------------- strings -------------------------------------
diff --git a/unusedcode.easy b/unusedcode.easy
index 3e6a557..5910daa 100644
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -1235,13 +1235,6 @@ SvBasicPropertyDataControl::GetName() const
SvBasicPropertyDataControl::GetProperty() const
SvBorder::SvBorder(Rectangle const&, Rectangle const&)
SvByteStrings::DeleteAndDestroy(unsigned short, unsigned short)
-SvByteStringsSortDtor::DeleteAndDestroy(unsigned short, unsigned short)
-SvByteStringsSortDtor::Insert(ByteString* const&)
-SvByteStringsSortDtor::Insert(ByteString* const&, unsigned short&)
-SvByteStringsSortDtor::Insert(ByteString* const*, unsigned short)
-SvByteStringsSortDtor::Insert(SvByteStringsSortDtor const*, unsigned short, unsigned short)
-SvByteStringsSortDtor::Remove(ByteString* const&, unsigned short)
-SvByteStringsSortDtor::Remove(unsigned short, unsigned short)
SvFileStream::UnlockFile()
SvI18NMap_Impl::Insert(SvI18NMapEntry_Impl* const&, unsigned short&)
SvI18NMap_Impl::Insert(SvI18NMapEntry_Impl* const*, unsigned short)
@@ -2445,13 +2438,6 @@ binfilter::SvBools::Replace(unsigned char const&, unsigned short)
binfilter::SvBools::Replace(unsigned char const*, unsigned short, unsigned short)
binfilter::SvBools::_ForEach(unsigned short, unsigned short, unsigned char (*)(unsigned char const&, void*), void*)
binfilter::SvByteStrings::DeleteAndDestroy(unsigned short, unsigned short)
-binfilter::SvByteStringsSortDtor::DeleteAndDestroy(unsigned short, unsigned short)
-binfilter::SvByteStringsSortDtor::Insert(ByteString* const&)
-binfilter::SvByteStringsSortDtor::Insert(ByteString* const&, unsigned short&)
-binfilter::SvByteStringsSortDtor::Insert(ByteString* const*, unsigned short)
-binfilter::SvByteStringsSortDtor::Insert(binfilter::SvByteStringsSortDtor const*, unsigned short, unsigned short)
-binfilter::SvByteStringsSortDtor::Remove(ByteString* const&, unsigned short)
-binfilter::SvByteStringsSortDtor::Remove(unsigned short, unsigned short)
binfilter::SvBytes::Insert(binfilter::SvBytes const*, unsigned short, unsigned short, unsigned short)
binfilter::SvBytes::Replace(unsigned char const&, unsigned short)
binfilter::SvBytes::Replace(unsigned char const*, unsigned short, unsigned short)
commit 5c3b0251b137c5d695d670c643fac1ee8049fb17
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Aug 13 22:53:00 2011 +0100
callcatcher: remove code, hide's erAcks to-do code behind an ifdef
diff --git a/lotuswordpro/source/filter/lwpparastyle.cxx b/lotuswordpro/source/filter/lwpparastyle.cxx
index 0d57b1d..9637e89 100644
--- a/lotuswordpro/source/filter/lwpparastyle.cxx
+++ b/lotuswordpro/source/filter/lwpparastyle.cxx
@@ -795,16 +795,4 @@ LwpTabOverride* LwpParaStyle::GetTabOverride() const
return NULL;
}
-sal_Bool LwpParaStyle::IsNumberRight()
-{
- LwpAlignmentOverride* pAlign = GetAlignment();
- if (pAlign)
- {
- LwpAlignmentOverride::AlignType type;
- type = pAlign->GetAlignType();
- if (type == LwpAlignmentOverride::ALIGN_NUMERICRIGHT)
- return sal_True;
- }
- return sal_False;
-}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/lotuswordpro/source/filter/lwpparastyle.hxx b/lotuswordpro/source/filter/lwpparastyle.hxx
index b078cc9..40e4c61 100644
--- a/lotuswordpro/source/filter/lwpparastyle.hxx
+++ b/lotuswordpro/source/filter/lwpparastyle.hxx
@@ -105,8 +105,6 @@ public:
LwpTabOverride* GetTabOverride() const;
LwpBulletOverride* GetBulletOverride() const;
LwpNumberingOverride* GetNumberingOverride() const;
-
- sal_Bool IsNumberRight();
public:
static void ApplySubBorder(LwpBorderStuff* pBorderStuff, LwpBorderStuff::BorderType eType, XFBorders* pXFBorders);
//end
diff --git a/svl/inc/svl/zformat.hxx b/svl/inc/svl/zformat.hxx
index b534f97..9ad2895 100644
--- a/svl/inc/svl/zformat.hxx
+++ b/svl/inc/svl/zformat.hxx
@@ -101,14 +101,18 @@ class SvNumberNatNum
public:
static sal_uInt8 MapDBNumToNatNum( sal_uInt8 nDBNum, LanguageType eLang, bool bDate );
+#ifdef THE_FUTURE
static sal_uInt8 MapNatNumToDBNum( sal_uInt8 nNatNum, LanguageType eLang, bool bDate );
+#endif
SvNumberNatNum() : eLang( LANGUAGE_DONTKNOW ), nNum(0),
bDBNum(0), bDate(0), bSet(0) {}
bool IsComplete() const { return bSet && eLang != LANGUAGE_DONTKNOW; }
sal_uInt8 GetRawNum() const { return nNum; }
sal_uInt8 GetNatNum() const { return bDBNum ? MapDBNumToNatNum( nNum, eLang, bDate ) : nNum; }
+#ifdef THE_FUTURE
sal_uInt8 GetDBNum() const { return bDBNum ? nNum : MapNatNumToDBNum( nNum, eLang, bDate ); }
+#endif
LanguageType GetLang() const { return eLang; }
void SetLang( LanguageType e ) { eLang = e; }
void SetNum( sal_uInt8 nNumber, bool bDBNumber )
@@ -434,6 +438,7 @@ public:
calling this method. */
void SwitchToGregorianCalendar( const String& rOrgCalendar, double fOrgDateTime ) const;
+#ifdef THE_FUTURE
/** Switches to the first specified calendar, if any, in subformat nNumFor
(0..3). Original calendar name and date/time returned, but only if
calendar switched and rOrgCalendar was empty.
@@ -450,7 +455,7 @@ public:
fOrgDateTime, NumFor[nNumFor] );
return false;
}
-
+#endif
private:
ImpSvNumFor NumFor[4]; // Array for the 4 subformats
String sFormatstring; // The format code string
@@ -471,8 +476,10 @@ private:
SVL_DLLPRIVATE bool ImpIsOtherCalendar( const ImpSvNumFor& rNumFor ) const;
+#ifdef THE_FUTURE
SVL_DLLPRIVATE bool ImpSwitchToSpecifiedCalendar( String& rOrgCalendar,
double& fOrgDateTime, const ImpSvNumFor& rNumFor ) const;
+#endif
#ifdef _ZFORMAT_CXX // ----- private implementation methods -----
diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx
index ad63f02..f241f79 100644
--- a/svl/source/numbers/zforfind.cxx
+++ b/svl/source/numbers/zforfind.cxx
@@ -1028,7 +1028,6 @@ bool ImpSvNumberInputScan::GetDateRef( double& fDays, sal_uInt16& nCounter,
}
if ( bFormatTurn )
{
-#if 0
/* TODO:
We are currently not able to fully support a switch to another calendar during
input for the following reasons:
@@ -1055,6 +1054,7 @@ input for the following reasons:
calendar would have to be implemented. No problem.
*/
+#ifdef THE_FUTURE
if ( pFormat->IsOtherCalendar( nStringScanNumFor ) )
pFormat->SwitchToOtherCalendar( aOrgCalendar, fOrgDateTime );
else
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index 0a5e823..9784d4d 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -246,7 +246,7 @@ sal_uInt8 SvNumberNatNum::MapDBNumToNatNum( sal_uInt8 nDBNum, LanguageType eLang
return nNatNum;
}
-
+#ifdef THE_FUTURE
/* XXX NOTE: even though the MapNatNumToDBNum method is currently unused please
* don't remove it in case we'd have to use it for some obscure exports to
* Excel. */
@@ -329,6 +329,7 @@ sal_uInt8 SvNumberNatNum::MapNatNumToDBNum( sal_uInt8 nNatNum, LanguageType eLan
}
return nDBNum;
}
+#endif
/***********************Funktionen SvNumFor******************************/
@@ -3032,6 +3033,7 @@ bool SvNumberformat::ImpFallBackToGregorianCalendar( String& rOrgCalendar, doubl
}
+#ifdef THE_FUTURE
/* XXX NOTE: even if the ImpSwitchToSpecifiedCalendar method is currently
* unused please don't remove it, it would be needed by
* SwitchToSpecifiedCalendar(), see comment in
@@ -3059,6 +3061,7 @@ bool SvNumberformat::ImpSwitchToSpecifiedCalendar( String& rOrgCalendar,
}
return false;
}
+#endif
// static
void SvNumberformat::ImpAppendEraG( String& OutString,
diff --git a/unusedcode.easy b/unusedcode.easy
index 2172866..3e6a557 100644
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -2386,16 +2386,13 @@ binfilter::ScMultipleWriteHeader::~ScMultipleWriteHeader()
binfilter::ScMyContentAction::~ScMyContentAction()
binfilter::ScMyDelAction::~ScMyDelAction()
binfilter::ScMyMoveAction::~ScMyMoveAction()
-binfilter::ScRangeData::IsBeyond(unsigned short) const
binfilter::ScRangeFindList::~ScRangeFindList()
-binfilter::ScValidationDataList::ResetUsed()
binfilter::ScValidationEntries_Impl::Insert(binfilter::ScValidationData* const&, unsigned short&)
binfilter::ScValidationEntries_Impl::Insert(binfilter::ScValidationData* const*, unsigned short)
binfilter::ScValidationEntries_Impl::Insert(binfilter::ScValidationEntries_Impl const*, unsigned short, unsigned short)
binfilter::ScValidationEntries_Impl::Remove(binfilter::ScValidationData* const&, unsigned short)
binfilter::ScValidationEntries_Impl::Remove(unsigned short, unsigned short)
binfilter::ScViewData::ReadUserDataSequence(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&)
-binfilter::ScViewData::WriteUserData(String&)
binfilter::ScXMLImportWrapper::Export(unsigned char)
binfilter::ScXMLImportWrapper::Import(unsigned char)
binfilter::ScXMLImportWrapper::ScXMLImportWrapper(binfilter::ScDocument&, binfilter::SfxMedium*, binfilter::SvStorage*)
@@ -2405,15 +2402,11 @@ binfilter::ScriptTypePosInfos::Replace(binfilter::ScriptTypePosInfo const&, unsi
binfilter::ScriptTypePosInfos::Replace(binfilter::ScriptTypePosInfo const*, unsigned short, unsigned short)
binfilter::ScriptTypePosInfos::_ForEach(unsigned short, unsigned short, unsigned char (*)(binfilter::ScriptTypePosInfo const&, void*), void*)
binfilter::SdXMLFilter::SdXMLFilter(binfilter::SfxMedium&, binfilter::SdDrawDocShell&, unsigned char, binfilter::SdXMLFilterMode)
-binfilter::SdrObjSurrogate::SdrObjSurrogate(binfilter::SdrObject*, binfilter::SdrObject const*)
-binfilter::SdrPageView::IsLayer(String const&, binfilter::SetOfByte const&) const
binfilter::SdrUnoControlAccessArr::DeleteAndDestroy(unsigned short, unsigned short)
binfilter::SdrUnoControlAccessArr::Insert(binfilter::SdrUnoControlAccess* const&, unsigned short&)
binfilter::SdrUnoControlAccessArr::Insert(binfilter::SdrUnoControlAccess* const*, unsigned short)
binfilter::SdrUnoControlAccessArr::Insert(binfilter::SdrUnoControlAccessArr const*, unsigned short, unsigned short)
binfilter::SdrUnoControlAccessArr::Remove(binfilter::SdrUnoControlAccess* const&, unsigned short)
-binfilter::SfxConfigManagerImExport_Impl::Export(SotStorage*, SotStorage*)
-binfilter::SfxDocumentInfo::SavePropertySet(binfilter::SvStorage*) const
binfilter::SfxHintPoster::LinkStubDoEvent_Impl(void*, void*)
binfilter::SfxItemModifyArr_Impl::Insert(binfilter::SfxItemModifyArr_Impl const*, unsigned short, unsigned short, unsigned short)
binfilter::SfxItemModifyArr_Impl::Remove(unsigned short, unsigned short)
@@ -2422,9 +2415,6 @@ binfilter::SfxItemModifyArr_Impl::Replace(binfilter::SfxItemModifyImpl const*, u
binfilter::SfxItemModifyArr_Impl::_ForEach(unsigned short, unsigned short, unsigned char (*)(binfilter::SfxItemModifyImpl const&, void*), void*)
binfilter::SfxMacroConfig::LinkStubCallbackHdl_Impl(void*, void*)
binfilter::SfxMacroConfig::LinkStubEventHdl_Impl(void*, void*)
-binfilter::SfxMultiMixRecordWriter::NewContent(unsigned short, unsigned char)
-binfilter::SfxMultiVarRecordWriter::NewContent()
-binfilter::SfxMultiVarRecordWriter::SfxMultiVarRecordWriter(SvStream*, unsigned short, unsigned char)
binfilter::SfxMultiVarRecordWriter::SfxMultiVarRecordWriter(unsigned char, SvStream*, unsigned short, unsigned char)
binfilter::SfxObjectShell::GetBaseURL() const
binfilter::SfxPtrArr::Insert(unsigned short, void*)
@@ -2547,8 +2537,6 @@ binfilter::Sw3Bytes::Insert(binfilter::Sw3Bytes const*, unsigned short, unsigned
binfilter::Sw3Bytes::Replace(unsigned char const&, unsigned short)
binfilter::Sw3Bytes::Replace(unsigned char const*, unsigned short, unsigned short)
binfilter::Sw3Bytes::_ForEach(unsigned short, unsigned short, unsigned char (*)(unsigned char const&, void*), void*)
-binfilter::Sw3IoImp::ExportTxtAttrs(binfilter::Sw3ExportTxtAttrs const*, unsigned short, unsigned short)
-binfilter::Sw3IoImp::ExportTxtNode(binfilter::SwTxtNode const&, unsigned short, unsigned short, unsigned short, binfilter::SwInsHardBlankSoftHyph&)
binfilter::Sw3Marks::GetPos(binfilter::Sw3Mark const*) const
binfilter::Sw3Marks::Insert(binfilter::Sw3Mark*)
binfilter::Sw3Marks::Remove(binfilter::Sw3Mark*)
@@ -2573,18 +2561,20 @@ binfilter::SwBookmarks::Insert(binfilter::SwBookmarks const*, unsigned short, un
binfilter::SwBookmarks::Remove(binfilter::SwBookmark* const&, unsigned short)
binfilter::SwChartBoxes::DeleteAndDestroy(unsigned short, unsigned short)
binfilter::SwCurrShells::DeleteAndDestroy(unsigned short, unsigned short)
+binfilter::SwCurrShells::Insert(binfilter::CurrShell* const&)
binfilter::SwCurrShells::Insert(binfilter::CurrShell* const&, unsigned short&)
binfilter::SwCurrShells::Insert(binfilter::CurrShell* const*, unsigned short)
binfilter::SwCurrShells::Insert(binfilter::SwCurrShells const*, unsigned short, unsigned short)
+binfilter::SwCurrShells::Remove(binfilter::CurrShell* const&, unsigned short)
binfilter::SwCurrShells::Remove(unsigned short, unsigned short)
binfilter::SwDependentFields::DeleteAndDestroy(unsigned short, unsigned short)
binfilter::SwDestroyList::DeleteAndDestroy(unsigned short, unsigned short)
binfilter::SwDestroyList::Insert(binfilter::SwDestroyList const*, unsigned short, unsigned short)
+binfilter::SwDestroyList::Insert(binfilter::SwSectionFrm* const&)
binfilter::SwDestroyList::Insert(binfilter::SwSectionFrm* const&, unsigned short&)
binfilter::SwDestroyList::Insert(binfilter::SwSectionFrm* const*, unsigned short)
binfilter::SwDestroyList::Remove(binfilter::SwSectionFrm* const&, unsigned short)
-binfilter::SwDoc::Replace(binfilter::SwPaM&, String const&, unsigned char)
-binfilter::SwInsHardBlankSoftHyph::OutAttr(binfilter::Sw3IoImp&, unsigned short, unsigned short)
+binfilter::SwDestroyList::Remove(unsigned short, unsigned short)
binfilter::SwInsHardBlankSoftHyph::~SwInsHardBlankSoftHyph()
binfilter::SwOLELRUCache::Remove(binfilter::SwOLEObj&)
binfilter::SwOutlineNodes::Insert(binfilter::SwNode* const&, unsigned short&)
@@ -2593,7 +2583,6 @@ binfilter::SwOutlineNodes::Insert(binfilter::SwOutlineNodes const*, unsigned sho
binfilter::SwRects::Replace(binfilter::SwRect const&, unsigned short)
binfilter::SwRects::Replace(binfilter::SwRect const*, unsigned short, unsigned short)
binfilter::SwRects::_ForEach(unsigned short, unsigned short, unsigned char (*)(binfilter::SwRect const&, void*), void*)
-binfilter::SwRootFrm::SwRootFrm(binfilter::SwFrmFmt*, binfilter::ViewShell*)
binfilter::SwRubyList::DeleteAndDestroy(unsigned short, unsigned short)
binfilter::SwSelBoxes::Insert(binfilter::SwTableBox* const&, unsigned short&)
binfilter::SwSelBoxes::Remove(binfilter::SwTableBox* const&, unsigned short)
@@ -2612,7 +2601,6 @@ binfilter::SwTableSortBoxes::DeleteAndDestroy(unsigned short, unsigned short)
binfilter::SwTableSortBoxes::Insert(binfilter::SwTableBox* const&, unsigned short&)
binfilter::SwTableSortBoxes::Insert(binfilter::SwTableBox* const*, unsigned short)
binfilter::SwTableSortBoxes::Insert(binfilter::SwTableSortBoxes const*, unsigned short, unsigned short)
-binfilter::SwTblBoxFormula::GetTableBox()
binfilter::SwXBookmarkPortionArr::DeleteAndDestroy(unsigned short, unsigned short)
binfilter::SwXBookmarkPortionArr::Insert(binfilter::SwXBookmarkPortionArr const*, unsigned short, unsigned short)
binfilter::SwXBookmarkPortionArr::Insert(binfilter::SwXBookmarkPortion_Impl* const&, unsigned short&)
@@ -3280,6 +3268,7 @@ oox::core::FilterBase::getInteractionHandler() const
oox::core::PowerPointExport::WriteAnimationNodeCommonPropsEnd(boost::shared_ptr<sax_fastparser::FastSerializerHelper>)
oox::core::PowerPointExport::WriteTextStyles(boost::shared_ptr<sax_fastparser::FastSerializerHelper>)
oox::core::Relations::getExternalTargetFromFirstType(rtl::OUString const&) const
+oox::core::XmlFilterBase::getChartConverter()
oox::drawingml::ChartExport::GetXmlNamespace() const
oox::drawingml::ChartExport::SetXmlNamespace(int)
oox::drawingml::ChartExport::exportDataSeq(com::sun::star::uno::Reference<com::sun::star::chart2::data::XDataSequence> const&, int)
@@ -3290,6 +3279,7 @@ oox::drawingml::ColorPropertySet::setColor(int)
oox::drawingml::CustomShapeProperties::apply(boost::shared_ptr<oox::drawingml::CustomShapeProperties> const&)
oox::drawingml::CustomShapeProperties::getValue(std::vector<oox::drawingml::CustomShapeGuide, std::allocator<oox::drawingml::CustomShapeGuide> > const&, unsigned int) const
oox::drawingml::Diagram::getLayoutId() const
+oox::drawingml::DiagramLayout::layout(std::vector<oox::drawingml::dgm::Point, std::allocator<oox::drawingml::dgm::Point> > const&, com::sun::star::awt::Point const&)
oox::drawingml::GetPoint2D(com::sun::star::uno::Reference<com::sun::star::xml::sax::XFastAttributeList> const&)
oox::drawingml::GetTextMargin(rtl::OUString const&)
oox::drawingml::GetTextVerticalAdjust(int)
@@ -3743,24 +3733,7 @@ svx::SearchToolbarControllersManager::~SearchToolbarControllersManager()
svx::SvxShowCharSetItem::~SvxShowCharSetItem()
svx::ToolboxButtonColorUpdater::DrawChar(VirtualDevice&, Color const&)
svx::WrapField::WrapField(Window*, long)
-svx::frame::Array::Array(unsigned long, unsigned long)
-svx::frame::Array::Clear()
-svx::frame::Array::DrawCell(OutputDevice&, unsigned long, unsigned long, Color const*) const
-svx::frame::Array::GetColFromIndex(unsigned long) const
-svx::frame::Array::GetColWidth(unsigned long) const
-svx::frame::Array::GetMergedSize(unsigned long&, unsigned long&, unsigned long, unsigned long) const
-svx::frame::Array::GetRowFromIndex(unsigned long) const
-svx::frame::Array::GetRowHeight(unsigned long) const
-svx::frame::Array::GetUseDiagDoubleClipping() const
-svx::frame::Array::IsInClipRange(unsigned long, unsigned long) const
-svx::frame::Array::IsMergedOrigin(unsigned long, unsigned long) const
-svx::frame::Array::IsMergedOverlapped(unsigned long, unsigned long) const
-svx::frame::Array::IsMergedOverlappedBottom(unsigned long, unsigned long) const
-svx::frame::Array::IsMergedOverlappedTop(unsigned long, unsigned long) const
-svx::frame::Array::MirrorSelfY(bool, bool)
-svx::frame::Array::RemoveClipRange()
-svx::frame::Array::RemoveMergedRange(unsigned long, unsigned long)
-svx::frame::ArrayImpl::GetMergedOriginCellAcc(unsigned long, unsigned long)
+svx::frame::Cell::MirrorSelfY(bool, bool)
svx::frame::DrawHorFrameBorder(OutputDevice&, Point const&, Point const&, svx::frame::Style const&, Color const*)
svx::frame::DrawHorFrameBorder(OutputDevice&, Point const&, Point const&, svx::frame::Style const&, svx::frame::Style const&, svx::frame::Style const&, svx::frame::Style const&, svx::frame::Style const&, svx::frame::Style const&, svx::frame::Style const&, Color const*)
svx::frame::DrawVerFrameBorder(OutputDevice&, Point const&, Point const&, svx::frame::Style const&, Color const*)
commit 684d499a42215bc50fcbce3e233a16c3282d9eb6
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Aug 13 15:26:01 2011 +0100
make it a const array
diff --git a/unotools/source/config/configmgr.cxx b/unotools/source/config/configmgr.cxx
index 7f411ea..913f809 100644
--- a/unotools/source/config/configmgr.cxx
+++ b/unotools/source/config/configmgr.cxx
@@ -64,8 +64,8 @@ using ::rtl::OString;
#define UNISTRING(s) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s))
//-----------------------------------------------------------------------------
-const char* pConfigBaseURL = "/org.openoffice.";
-const char* pAccessSrvc = "com.sun.star.configuration.ConfigurationUpdateAccess";
+const char aConfigBaseURL[] = "/org.openoffice.";
+const char aAccessSrvc[] = "com.sun.star.configuration.ConfigurationUpdateAccess";
namespace
{
@@ -252,7 +252,7 @@ Reference< XHierarchicalNameAccess> ConfigManager::AcquireTree(utl::ConfigItem&
}
OSL_ENSURE(bFound, "AcquireTree: ConfigItem unknown!");
#endif
- OUString sPath(OUString::createFromAscii(pConfigBaseURL));
+ OUString sPath(RTL_CONSTASCII_USTRINGPARAM(aConfigBaseURL));
sPath += rCfgItem.GetSubTreeName();
Sequence< Any > aArgs(2);
Any* pArgs = aArgs.getArray();
@@ -287,7 +287,7 @@ Reference< XHierarchicalNameAccess> ConfigManager::AcquireTree(utl::ConfigItem&
try
{
xIFace = xCfgProvider->createInstanceWithArguments(
- OUString::createFromAscii(pAccessSrvc),
+ OUString(RTL_CONSTASCII_USTRINGPARAM(aAccessSrvc)),
aArgs);
}
catch (const Exception& rEx)
@@ -357,7 +357,7 @@ ConfigManager& ConfigManager::GetConfigManager()
rtl::OUString ConfigManager::GetConfigBaseURL()
{
- return OUString::createFromAscii(pConfigBaseURL);
+ return OUString(RTL_CONSTASCII_USTRINGPARAM(aConfigBaseURL));
}
Any ConfigManager::GetDirectConfigProperty(ConfigProperty eProp)
@@ -463,7 +463,7 @@ Any ConfigManager::GetDirectConfigProperty(ConfigProperty eProp)
}
}
- OUString sPath = OUString::createFromAscii(pConfigBaseURL);
+ OUString sPath(RTL_CONSTASCII_USTRINGPARAM(aConfigBaseURL));
switch(eProp)
{
case LOCALE: sPath += UNISTRING("Setup/L10N"); break;
@@ -493,7 +493,7 @@ Any ConfigManager::GetDirectConfigProperty(ConfigProperty eProp)
try
{
xIFace = xCfgProvider->createInstanceWithArguments(
- OUString::createFromAscii(pAccessSrvc),
+ OUString(RTL_CONSTASCII_USTRINGPARAM(aAccessSrvc)),
aArgs);
}
@@ -625,7 +625,7 @@ Reference< XHierarchicalNameAccess> ConfigManager::GetHierarchyAccess(const OUSt
try
{
xIFace = xCfgProvider->createInstanceWithArguments(
- OUString::createFromAscii(pAccessSrvc),
+ OUString(RTL_CONSTASCII_USTRINGPARAM(aAccessSrvc)),
aArgs);
}
#if OSL_DEBUG_LEVEL > 1
@@ -648,7 +648,7 @@ Reference< XHierarchicalNameAccess> ConfigManager::GetHierarchyAccess(const OUSt
Any ConfigManager::GetLocalProperty(const OUString& rProperty)
{
- OUString sPath(OUString::createFromAscii(pConfigBaseURL));
+ OUString sPath(RTL_CONSTASCII_USTRINGPARAM(aConfigBaseURL));
sPath += rProperty;
OUString sNode, sProperty;
@@ -680,7 +680,7 @@ Any ConfigManager::GetLocalProperty(const OUString& rProperty)
void ConfigManager::PutLocalProperty(const OUString& rProperty, const Any& rValue)
{
- OUString sPath(OUString::createFromAscii(pConfigBaseURL));
+ OUString sPath(RTL_CONSTASCII_USTRINGPARAM(aConfigBaseURL));
sPath += rProperty;
OUString sNode, sProperty;
commit 5bc86df0c8a013af21d5fbc8f6e024db6f0b9936
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Aug 13 15:11:33 2011 +0100
lets keep original encoding
diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx
index db30b9d..ca8cc2f 100644
--- a/vcl/win/source/gdi/salgdi3.cxx
+++ b/vcl/win/source/gdi/salgdi3.cxx
@@ -2812,7 +2812,7 @@ sal_Bool WinSalGraphics::CreateFontSubset( const rtl::OUString& rToFile,
if( osl_File_E_None != osl_getSystemPathFromFileURL( rToFile.pData, &aSysPath.pData ) )
return FALSE;
const rtl_TextEncoding aThreadEncoding = osl_getThreadTextEncoding();
- const ByteString aToFile( rtl::OUStringToOString( aSysPath, aThreadEncoding ) );
+ const rtl::OString aToFile(rtl::OUStringToOString(aSysPath, aThreadEncoding));
// check if the font has a CFF-table
const DWORD nCffTag = CalcTag( "CFF " );
@@ -2840,7 +2840,7 @@ sal_Bool WinSalGraphics::CreateFontSubset( const rtl::OUString& rToFile,
pCharMap->DeReference(); // TODO: and and use a RAII object
// provide a font subset from the CFF-table
- FILE* pOutFile = fopen( aToFile.GetBuffer(), "wb" );
+ FILE* pOutFile = fopen( aToFile.getStr(), "wb" );
rInfo.LoadFont( FontSubsetInfo::CFF_FONT, aRawCffData.get(), aRawCffData.size() );
bool bRC = rInfo.CreateFontSubset( FontSubsetInfo::TYPE1_PFB, pOutFile, NULL,
nRealGlyphIds, pEncoding, nGlyphCount, pGlyphWidths );
@@ -2929,7 +2929,7 @@ sal_Bool WinSalGraphics::CreateFontSubset( const rtl::OUString& rToFile,
free( pMetrics );
// write subset into destination file
- nRC = ::CreateTTFromTTGlyphs( aSftTTF.get(), aToFile.GetBuffer(), aShortIDs,
+ nRC = ::CreateTTFromTTGlyphs( aSftTTF.get(), aToFile.getStr(), aShortIDs,
aTempEncs, nGlyphCount, 0, NULL, 0 );
return (nRC == SF_OK);
}
commit e44738096c7cc5f06247366cc9f9a1c4ac003b69
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Aug 13 00:47:47 2011 +0100
callcatcher: remove ResetObjectBars_Impl
diff --git a/sfx2/inc/sfx2/dispatch.hxx b/sfx2/inc/sfx2/dispatch.hxx
index 177918c..b54d2f4 100644
--- a/sfx2/inc/sfx2/dispatch.hxx
+++ b/sfx2/inc/sfx2/dispatch.hxx
@@ -237,7 +237,6 @@ public:
SAL_DLLPRIVATE void Update_Impl( sal_Bool bForce = sal_False ); // ObjectBars etc.
SAL_DLLPRIVATE sal_Bool IsUpdated_Impl() const;
SAL_DLLPRIVATE void DebugOutput_Impl() const;
- SAL_DLLPRIVATE void ResetObjectBars_Impl();
SAL_DLLPRIVATE int GetShellAndSlot_Impl( sal_uInt16 nSlot, SfxShell **ppShell, const SfxSlot **ppSlot,
sal_Bool bOwnShellsOnly, sal_Bool bModal, sal_Bool bRealSlot=sal_True );
SAL_DLLPRIVATE void LockUI_Impl( sal_Bool bLock = sal_True );
diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx
index e28e68b..1bd4c13 100644
--- a/sfx2/source/control/dispatch.cxx
+++ b/sfx2/source/control/dispatch.cxx
@@ -2609,21 +2609,6 @@ sal_uInt32 SfxDispatcher::GetObjectBarId( sal_uInt16 nPos ) const
}
//--------------------------------------------------------------------
-void SfxDispatcher::ResetObjectBars_Impl()
-
-/* [Description]
-
- With this method all Objectbar requirements which this Dispatcher
- imposes on the AppWindow are eliminated.
-*/
-{
- for (sal_uInt16 n=0; n<SFX_OBJECTBAR_MAX; n++)
- pImp->aObjBars[n].nResId = 0;
- pImp->aChildWins.Remove(0, pImp->aChildWins.Count());
-}
-
-
-//--------------------------------------------------------------------
void SfxDispatcher::DebugOutput_Impl() const
{
#ifdef DBG_UTIL
diff --git a/unusedcode.easy b/unusedcode.easy
index d495e0e..2172866 100644
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -990,7 +990,6 @@ SfxDispatcher::Execute(SfxExecuteItem const&)
SfxDispatcher::ExecutePopup(unsigned short, Window*, Point const*, SfxPoolItem const*, ...)
SfxDispatcher::GetSlotId(String const&)
SfxDispatcher::HasSlot_Impl(unsigned short)
-SfxDispatcher::ResetObjectBars_Impl()
SfxDispatcher::SetModalMode_Impl(unsigned char)
SfxDispatcher::_Execute(SfxSlotServer const&)
SfxDocTemplate_Impl::GetTemplates(ucbhelper::Content&, ucbhelper::Content&, RegionData_Impl*)
commit ad282070c5b351e8cbfe12ec3b5d172f307277c9
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Aug 13 00:33:18 2011 +0100
make these pure virtual to prove all implemented in sole sub-class
Facilitates merging of ServerFont and FreetypeServerFont
diff --git a/vcl/inc/glyphcache.hxx b/vcl/inc/glyphcache.hxx
index 3368d30..62d27c7 100644
--- a/vcl/inc/glyphcache.hxx
+++ b/vcl/inc/glyphcache.hxx
@@ -178,24 +178,23 @@ private:
class VCL_PLUGIN_PUBLIC ServerFont
{
public:
- virtual const ::rtl::OString* GetFontFileName() const { return NULL; }
- virtual int GetFontFaceNumber() const { return 0; }
- virtual bool TestFont() const { return true; }
- virtual void* GetFtFace() const { return 0; }
- virtual int GetLoadFlags() const { return 0; }
- virtual void SetFontOptions( boost::shared_ptr<ImplFontOptions> ) {}
- virtual boost::shared_ptr<ImplFontOptions> GetFontOptions() const
- { return boost::shared_ptr<ImplFontOptions>(); }
- virtual bool NeedsArtificialBold() const { return false; }
- virtual bool NeedsArtificialItalic() const { return false; }
+ virtual const ::rtl::OString* GetFontFileName() const = 0;
+ virtual int GetFontFaceNumber() const = 0;
+ virtual bool TestFont() const = 0;
+ virtual void* GetFtFace() const = 0;
+ virtual int GetLoadFlags() const = 0;
+ virtual void SetFontOptions( boost::shared_ptr<ImplFontOptions> ) = 0;
+ virtual boost::shared_ptr<ImplFontOptions> GetFontOptions() const = 0;
+ virtual bool NeedsArtificialBold() const = 0;
+ virtual bool NeedsArtificialItalic() const = 0;
const ImplFontSelectData& GetFontSelData() const { return maFontSelData; }
virtual void FetchFontMetric( ImplFontMetricData&, long& rFactor ) const = 0;
- virtual sal_uLong GetKernPairs( ImplKernPairData** ) const { return 0; }
- virtual int GetGlyphKernValue( int, int ) const { return 0; }
+ virtual sal_uLong GetKernPairs( ImplKernPairData** ) const = 0;
+ virtual int GetGlyphKernValue( int, int ) const = 0;
virtual const ImplFontCharMap* GetImplFontCharMap() const = 0;
- virtual bool GetFontCapabilities(vcl::FontCapabilities &) const { return false; }
+ virtual bool GetFontCapabilities(vcl::FontCapabilities &) const = 0;
Point TransformPoint( const Point& ) const;
GlyphData& GetGlyphData( int nGlyphIndex );
@@ -228,7 +227,7 @@ protected:
virtual void GarbageCollect( long );
void ReleaseFromGarbageCollect();
- virtual ServerFontLayoutEngine* GetLayoutEngine() { return NULL; }
+ virtual ServerFontLayoutEngine* GetLayoutEngine() = 0;
private:
typedef ::boost::unordered_map<int,GlyphData> GlyphList;
commit 935afabf6fb28c288b51b896ace5ee4ce3cd4fef
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Aug 13 00:31:44 2011 +0100
virtual method with wrong name, doesn't override what it thinks it does
diff --git a/vcl/source/glyphs/gcach_ftyp.hxx b/vcl/source/glyphs/gcach_ftyp.hxx
index 95e6a3a..d6cb493 100644
--- a/vcl/source/glyphs/gcach_ftyp.hxx
+++ b/vcl/source/glyphs/gcach_ftyp.hxx
@@ -187,7 +187,7 @@ public:
virtual ~FreetypeServerFont();
virtual const ::rtl::OString* GetFontFileName() const { return mpFontInfo->GetFontFileName(); }
- virtual int GetFontFaceNum() const { return mpFontInfo->GetFaceNum(); }
+ virtual int GetFontFaceNumber() const { return mpFontInfo->GetFaceNum(); }
virtual bool TestFont() const;
virtual void* GetFtFace() const;
virtual void SetFontOptions( boost::shared_ptr<ImplFontOptions> );
commit 2e6ee683ada51245973351d7f823ec9ce7cf2066
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Aug 13 00:15:44 2011 +0100
VirtDevServerFont isn't really implemented, remove to allow to simplify
diff --git a/vcl/source/glyphs/gcach_vdev.cxx b/vcl/source/glyphs/gcach_vdev.cxx
deleted file mode 100644
index 944d9ae..0000000
--- a/vcl/source/glyphs/gcach_vdev.cxx
+++ /dev/null
@@ -1,290 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * 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_vcl.hxx"
-
-#include <gcach_vdev.hxx>
-
-#include <vcl/svapp.hxx>
-#include <vcl/bitmap.hxx>
-#include <vcl/outfont.hxx>
-#include <vcl/virdev.hxx>
-#include <vcl/metric.hxx>
-
-// =======================================================================
-// VirtDevServerFont
-// =======================================================================
-
-// -----------------------------------------------------------------------
-
-void VirtDevServerFont::AnnounceFonts( ImplDevFontList* pToAdd )
-{
- // TODO: get fonts on server but not on client,
- // problem is that currently there is no serverside virtual device...
- VirtualDevice vdev( 1 );
- long nCount = vdev.GetDevFontCount();
-
- for( int i = 0; i < nCount; ++i )
- {
- const FontInfo aFontInfo = vdev.GetDevFont( i );
-
- ImplFontData& rData = *new ImplFontData;
- rData.SetSysData( new FontSysData( (void*)SERVERFONT_MAGIC ) );
-
- rData.maName = aFontInfo.GetName();
- rData.maStyleName = aFontInfo.GetStyleName();
- rData.mnWidth = aFontInfo.GetWidth();
- rData.mnHeight = aFontInfo.GetHeight();
- rData.meFamily = aFontInfo.GetFamily();
- rData.meCharSet = aFontInfo.GetCharSet();
- rData.mePitch = aFontInfo.GetPitch();
- rData.meWidthType = aFontInfo.GetWidthType();
- rData.meWeight = aFontInfo.GetWeight();
- rData.meItalic = aFontInfo.GetItalic();
- rData.meType = aFontInfo.GetType();
- rData.meFamily = aFontInfo.GetFamily();
-
- rData.mbOrientation = true; // TODO: where to get this info?
- rData.mbDevice = false;
- rData.mnQuality = 0; // prefer client-side fonts if available
-
- pToAdd->Add( &rData );
- }
-}
-
-// -----------------------------------------------------------------------
-
-void VirtDevServerFont::ClearFontList()
-{
- // TODO
-}
-
-// -----------------------------------------------------------------------
-
-VirtDevServerFont* VirtDevServerFont::CreateFont( const ImplFontSelectData& rFSD )
-{
- VirtDevServerFont* pServerFont = NULL;
- // TODO: search list of VirtDevServerFonts, return NULL if not found
- // pServerFont = new VirtDevServerFont( rFSD );
- return pServerFont;
-}
-
-// -----------------------------------------------------------------------
-
-VirtDevServerFont::VirtDevServerFont( const ImplFontSelectData& rFSD )
-: ServerFont( rFSD)
-{}
-
-// -----------------------------------------------------------------------
-
-void VirtDevServerFont::FetchFontMetric( ImplFontMetricData& rTo, long& rFactor ) const
-{
- const ImplFontSelectData& aFSD = GetFontSelData();
-
- Font aFont;
- aFont.SetName ( aFSD.maName );
- aFont.SetStyleName ( aFSD.maStyleName );
- aFont.SetHeight ( aFSD.mnHeight );
- aFont.SetWidth ( aFSD.mnWidth );
- aFont.SetOrientation( aFSD.mnOrientation );
- aFont.SetVertical ( GetFontSelData().mbVertical );
-
- VirtualDevice vdev( 1 );
- FontMetric aMetric( vdev.GetFontMetric( aFont ) );
-
- rFactor = 0x100;
-
- rTo.mnAscent = aMetric.GetAscent();
- rTo.mnDescent = aMetric.GetDescent();
- rTo.mnIntLeading = aMetric.GetIntLeading();
- rTo.mnExtLeading = aMetric.GetExtLeading();
- rTo.mnSlant = aMetric.GetSlant();
- rTo.meType = aMetric.GetType();
- rTo.mnFirstChar = 0x0020; // TODO: where to get this info?
- rTo.mnLastChar = 0xFFFE; // TODO: where to get this info?
-
- rTo.mnWidth = aFSD.mnWidth;
- rTo.maName = aFSD.maName;
- rTo.maStyleName = aFSD.maStyleName;
- rTo.mnOrientation = aFSD.mnOrientation;
- rTo.meFamily = aFSD.meFamily;
- rTo.meCharSet = aFSD.meCharSet;
- rTo.meWeight = aFSD.meWeight;
- rTo.meItalic = aFSD.meItalic;
- rTo.mePitch = aFSD.mePitch;
- rTo.mbDevice = sal_False;
-}
-
-// -----------------------------------------------------------------------
-
-int VirtDevServerFont::GetGlyphIndex( sal_Unicode aChar ) const
-{
- return aChar;
-}
-
-// -----------------------------------------------------------------------
-
-void VirtDevServerFont::InitGlyphData( int nGlyphIndex, GlyphData& rGD ) const
-{
- Font aFont;
- aFont.SetName ( GetFontSelData().maName );
- aFont.SetStyleName ( GetFontSelData().maStyleName );
- aFont.SetHeight ( GetFontSelData().mnHeight );
- aFont.SetWidth ( GetFontSelData().mnWidth );
- aFont.SetOrientation( GetFontSelData().mnOrientation );
- aFont.SetVertical ( GetFontSelData().mbVertical );
-
- VirtualDevice vdev( 1 );
- vdev.SetFont( aFont );
-
- // get glyph metrics
- sal_Int32 nCharWidth = 10;
-// TODO: vdev.GetCharWidth( nGlyphIndex, nGlyphIndex, &nCharWidth );
- rGD.SetCharWidth( nCharWidth );
-
- sal_Unicode aChar = nGlyphIndex;
- String aGlyphStr( &aChar, 1 );
- Rectangle aRect;
- if( vdev.GetTextBoundRect( aRect, aGlyphStr, 0, 1 ) )
- {
- rGD.SetOffset( aRect.Top(), aRect.Left() );
- rGD.SetDelta( vdev.GetTextWidth( nGlyphIndex ), 0 );
- rGD.SetSize( aRect.GetSize() );
- }
-}
-
-// -----------------------------------------------------------------------
-
-bool VirtDevServerFont::GetAntialiasAdvice( void ) const
-{
- return false;
-}
-
-// -----------------------------------------------------------------------
-
-bool VirtDevServerFont::GetGlyphBitmap1( int nGlyphIndex, RawBitmap& ) const
-{
- /*
- sal_Unicode aChar = nGlyphIndex;
- String aGlyphStr( &aChar, 1 );
-
- // draw bitmap
- vdev.SetOutputSizePixel( aSize, sal_True );
- vdev.DrawText( Point(0,0)-rGD.GetMetric().GetOffset(), aGlyphStr );
-
- // create new glyph item
-
- const Bitmap& rBitmap = vdev.GetBitmap( Point(0,0), aSize );
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list