summaryrefslogtreecommitdiff
path: root/svl/source
diff options
context:
space:
mode:
Diffstat (limited to 'svl/source')
-rw-r--r--svl/source/fsstor/fsfactory.cxx8
-rw-r--r--svl/source/fsstor/fsstorage.component2
-rw-r--r--svl/source/items/ilstitem.cxx24
-rw-r--r--svl/source/items/poolio.cxx34
-rw-r--r--svl/source/items/style.cxx4
-rw-r--r--svl/source/items/whassert.hxx10
-rw-r--r--svl/source/memtools/svarray.cxx97
-rw-r--r--svl/source/misc/adrparse.cxx138
-rw-r--r--svl/source/misc/inethist.cxx39
-rw-r--r--svl/source/misc/inettype.cxx221
-rw-r--r--svl/source/misc/ownlist.cxx58
-rw-r--r--svl/source/misc/strmadpt.cxx44
-rw-r--r--svl/source/misc/urihelper.cxx87
-rw-r--r--svl/source/numbers/zforlist.cxx220
-rw-r--r--svl/source/numbers/zformat.cxx17
-rw-r--r--svl/source/passwordcontainer/passwordcontainer.component2
-rw-r--r--svl/source/passwordcontainer/passwordcontainer.cxx8
-rw-r--r--svl/source/svdde/ddesvr.cxx29
-rw-r--r--svl/source/uno/registerservices.cxx8
19 files changed, 152 insertions, 898 deletions
diff --git a/svl/source/fsstor/fsfactory.cxx b/svl/source/fsstor/fsfactory.cxx
index a641a5d80c04..61a8f7f15048 100644
--- a/svl/source/fsstor/fsfactory.cxx
+++ b/svl/source/fsstor/fsfactory.cxx
@@ -235,13 +235,7 @@ uno::Sequence< ::rtl::OUString > SAL_CALL FSStorageFactory::getSupportedServiceN
extern "C"
{
-SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment (
- const sal_Char ** ppEnvTypeName, uno_Environment ** /* ppEnv */)
-{
- *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
-}
-
-SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory (
+SAL_DLLPUBLIC_EXPORT void * SAL_CALL fsstorage_component_getFactory (
const sal_Char * pImplementationName, void * pServiceManager, void * /* pRegistryKey */)
{
void * pResult = 0;
diff --git a/svl/source/fsstor/fsstorage.component b/svl/source/fsstor/fsstorage.component
index 3ef0be825972..f9f08487b8a5 100644
--- a/svl/source/fsstor/fsstorage.component
+++ b/svl/source/fsstor/fsstorage.component
@@ -26,7 +26,7 @@
*
**********************************************************************-->
-<component loader="com.sun.star.loader.SharedLibrary"
+<component loader="com.sun.star.loader.SharedLibrary" prefix="fsstorage"
xmlns="http://openoffice.org/2010/uno-components">
<implementation name="com.sun.star.comp.embed.FileSystemStorageFactory">
<service name="com.sun.star.comp.embed.FileSystemStorageFactory"/>
diff --git a/svl/source/items/ilstitem.cxx b/svl/source/items/ilstitem.cxx
index f8d575b52175..dbf8825e90ba 100644
--- a/svl/source/items/ilstitem.cxx
+++ b/svl/source/items/ilstitem.cxx
@@ -35,20 +35,25 @@
#include <svl/ilstitem.hxx>
-#define _SVSTDARR_ULONGS
-#include <svl/svstdarr.hxx>
-
TYPEINIT1_AUTOFACTORY(SfxIntegerListItem, SfxPoolItem);
SfxIntegerListItem::SfxIntegerListItem()
{
}
-SfxIntegerListItem::SfxIntegerListItem( sal_uInt16 which, const SvULongs& rList )
+SfxIntegerListItem::SfxIntegerListItem( sal_uInt16 which, const ::std::vector < sal_Int32 >& rList )
+ : SfxPoolItem( which )
+{
+ m_aList.realloc( rList.size() );
+ for ( sal_uInt16 n=0; n<rList.size(); ++n )
+ m_aList[n] = rList[n];
+}
+
+SfxIntegerListItem::SfxIntegerListItem( sal_uInt16 which, const ::com::sun::star::uno::Sequence < sal_Int32 >& rList )
: SfxPoolItem( which )
{
- m_aList.realloc( rList.Count() );
- for ( sal_uInt16 n=0; n<rList.Count(); n++ )
+ m_aList.realloc( rList.getLength() );
+ for ( sal_Int32 n=0; n<rList.getLength(); ++n )
m_aList[n] = rList[n];
}
@@ -97,10 +102,11 @@ bool SfxIntegerListItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 )
return true;
}
-void SfxIntegerListItem::GetList( SvULongs& rList ) const
+void SfxIntegerListItem::GetList( ::std::vector< sal_Int32 >& rList ) const
{
- for ( sal_Int32 n=0; n<m_aList.getLength(); n++ )
- rList.Insert( m_aList[n], sal::static_int_cast< sal_uInt16 >(n) );
+ rList.reserve( m_aList.getLength() );
+ for ( sal_Int32 n=0; n<m_aList.getLength(); ++n )
+ rList.push_back( m_aList[n] );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svl/source/items/poolio.cxx b/svl/source/items/poolio.cxx
index d75560f5a26d..4811340af938 100644
--- a/svl/source/items/poolio.cxx
+++ b/svl/source/items/poolio.cxx
@@ -1324,7 +1324,6 @@ void SfxItemPool::SetVersionMap
<SfxItemPool::IsLoadingVersionCurrent()const>
<SfxItemPool::GetNewWhich(sal_uInt16)>
<SfxItemPool::GetVersion()const>
- <SfxItemPool::GetLoadingVersion()const>
*/
{
@@ -1381,7 +1380,6 @@ sal_uInt16 SfxItemPool::GetNewWhich
<SfxItemPool::IsLoadingVersionCurrent()const>
<SfxItemPool::SetVersionMap(sal_uInt16,sal_uInt16,sal_uInt16,sal_uInt16*)>
<SfxItemPool::GetVersion()const>
- <SfxItemPool::GetLoadingVersion()const>
*/
{
@@ -1470,7 +1468,6 @@ bool SfxItemPool::IsCurrentVersionLoading() const
<SfxItemPool::SetVersionMap(sal_uInt16,sal_uInt16,sal_uInt16,sal_uInt16*)>
<SfxItemPool::GetNewWhich(sal_uInt16)const>
<SfxItemPool::GetVersion()const>
- <SfxItemPool::GetLoadingVersion()const>
*/
{
@@ -1503,7 +1500,6 @@ sal_uInt16 SfxItemPool::GetVersion() const
<SfxItemPool::IsLoadingVersionCurrent()const>
<SfxItemPool::SetVersionMap(sal_uInt16,sal_uInt16,sal_uInt16,sal_uInt16*)>
<SfxItemPool::GetNewWhich(sal_uInt16)const>
- <SfxItemPool::GetLoadingVersion()const>
*/
{
@@ -1512,36 +1508,6 @@ sal_uInt16 SfxItemPool::GetVersion() const
// -----------------------------------------------------------------------
-sal_uInt16 SfxItemPool::GetLoadingVersion() const
-
-/* [Beschreibung]
-
- Diese Methode liefert die Versionsnummer des SfxItemPool-Aufbaus
- (also des Which-Bereichs), die bei Laden vorgefunden wurde.
-
- Precondition: Pool mu\s geladen sein
- Postcondition: unver"andert
- Laufzeit: 2
-
-
- [Anmerkung]
-
- Achtung: Es mu\s ggf. die Versionsnummer von Sekund"arpools
- ber"ucksichtigt werden.
-
-
- [Querverweise]
-
- <SfxItemPool::IsLoadingVersionCurrent()const>
- <SfxItemPool::SetVersionMap(sal_uInt16,sal_uInt16,sal_uInt16,sal_uInt16*)>
- <SfxItemPool::GetNewWhich(sal_uInt16)const>
- <SfxItemPool::GetVersion()const>
-*/
-
-{
- return pImp->nLoadingVersion;
-}
-
//-------------------------------------------------------------------------
bool SfxItemPool::IsVer2_Impl() const
diff --git a/svl/source/items/style.cxx b/svl/source/items/style.cxx
index 815247cb4724..2bfbfc40b269 100644
--- a/svl/source/items/style.cxx
+++ b/svl/source/items/style.cxx
@@ -1153,8 +1153,8 @@ sal_Bool SfxStyleSheetBasePool::Store( SvStream& rStream, sal_Bool bUsed )
sal_uInt16 nInsPos, nAdd = aSortConvNames.Count();
while( !aSortConvNames.Insert( pConvName, nInsPos ) )
- (pConvName->Append( '_' )).Append(
- ByteString::CreateFromInt32( nAdd++ ));
+ (pConvName->Append( '_' )).Append(ByteString(
+ rtl::OString::valueOf(static_cast<sal_Int32>(nAdd++))));
aOrigNames.Insert( pName, nInsPos );
}
}
diff --git a/svl/source/items/whassert.hxx b/svl/source/items/whassert.hxx
index 0fa492b19443..379d4794458d 100644
--- a/svl/source/items/whassert.hxx
+++ b/svl/source/items/whassert.hxx
@@ -29,7 +29,7 @@
#define _SFX_WHASSERT_HXX
#include <tools/debug.hxx>
-#include <tools/string.hxx>
+#include <rtl/strbuf.hxx>
//------------------------------------------------------------------------
@@ -40,10 +40,10 @@
{ \
if ( !(bCondition) ) \
{ \
- ByteString aMsg( sMessage ); \
- aMsg.Append(RTL_CONSTASCII_STRINGPARAM("\nwith Id/Pos: ")); \
- aMsg += ByteString::CreateFromInt32( nId ); \
- DbgError( aMsg.GetBuffer(), __FILE__, __LINE__); \
+ rtl::OStringBuffer aMsg(sMessage); \
+ aMsg.append(RTL_CONSTASCII_STRINGPARAM("\nwith Id/Pos: ")); \
+ aMsg.append(static_cast<sal_Int32>(nId)); \
+ DbgError(aMsg.getStr(), __FILE__, __LINE__); \
} \
} \
}
diff --git a/svl/source/memtools/svarray.cxx b/svl/source/memtools/svarray.cxx
index 43eb637ae991..4032800e0a8b 100644
--- a/svl/source/memtools/svarray.cxx
+++ b/svl/source/memtools/svarray.cxx
@@ -71,12 +71,8 @@ SV_IMPL_OP_PTRARR_SORT( SvStringsSort, StringPtr )
SV_IMPL_OP_PTRARR_SORT( SvStringsSortDtor, StringPtr )
SV_IMPL_PTRARR( SvByteStrings, ByteStringPtr )
-SV_IMPL_PTRARR( SvByteStringsDtor, ByteStringPtr )
-SV_IMPL_OP_PTRARR_SORT( SvByteStringsSort, ByteStringPtr )
SV_IMPL_OP_PTRARR_SORT( SvByteStringsSortDtor, ByteStringPtr )
-
-
// ---------------- strings -------------------------------------
// Array mit anderer Seek-Methode!
@@ -171,97 +167,4 @@ sal_Bool SvStringsISortDtor::Seek_Entry( const StringPtr aE, sal_uInt16* pP ) co
return sal_False;
}
-// ---------------- bytestrings -------------------------------------
-
-// Array mit anderer Seek-Methode!
-_SV_IMPL_SORTAR_ALG( SvByteStringsISort, ByteStringPtr )
-void SvByteStringsISort::DeleteAndDestroy( sal_uInt16 nP, sal_uInt16 nL )
-{
- if( nL )
- {
- DBG_ASSERT( nP < nA && nP + nL <= nA, "ERR_VAR_DEL" );
- for( sal_uInt16 n=nP; n < nP + nL; n++ )
- delete *((ByteStringPtr*)pData+n);
- SvPtrarr::Remove( nP, nL );
- }
-}
-sal_Bool SvByteStringsISort::Seek_Entry( const ByteStringPtr aE, sal_uInt16* pP ) const
-{
- register sal_uInt16 nO = SvByteStringsISort_SAR::Count(),
- nM,
- nU = 0;
- if( nO > 0 )
- {
- nO--;
- while( nU <= nO )
- {
- nM = nU + ( nO - nU ) / 2;
- StringCompare eCmp = (*((ByteStringPtr*)pData + nM))->
- CompareIgnoreCaseToAscii( *(aE) );
- if( COMPARE_EQUAL == eCmp )
- {
- if( pP ) *pP = nM;
- return sal_True;
- }
- else if( COMPARE_LESS == eCmp )
- nU = nM + 1;
- else if( nM == 0 )
- {
- if( pP ) *pP = nU;
- return sal_False;
- }
- else
- nO = nM - 1;
- }
- }
- if( pP ) *pP = nU;
- return sal_False;
-}
-
-
-// Array mit anderer Seek-Methode!
-_SV_IMPL_SORTAR_ALG( SvByteStringsISortDtor, ByteStringPtr )
-void SvByteStringsISortDtor::DeleteAndDestroy( sal_uInt16 nP, sal_uInt16 nL )
-{
- if( nL )
- {
- DBG_ASSERT( nP < nA && nP + nL <= nA, "ERR_VAR_DEL" );
- for( sal_uInt16 n=nP; n < nP + nL; n++ )
- delete *((ByteStringPtr*)pData+n);
- SvPtrarr::Remove( nP, nL );
- }
-}
-sal_Bool SvByteStringsISortDtor::Seek_Entry( const ByteStringPtr aE, sal_uInt16* pP ) const
-{
- register sal_uInt16 nO = SvByteStringsISortDtor_SAR::Count(),
- nM,
- nU = 0;
- if( nO > 0 )
- {
- nO--;
- while( nU <= nO )
- {
- nM = nU + ( nO - nU ) / 2;
- StringCompare eCmp = (*((ByteStringPtr*)pData + nM))->
- CompareIgnoreCaseToAscii( *(aE) );
- if( COMPARE_EQUAL == eCmp )
- {
- if( pP ) *pP = nM;
- return sal_True;
- }
- else if( COMPARE_LESS == eCmp )
- nU = nM + 1;
- else if( nM == 0 )
- {
- if( pP ) *pP = nU;
- return sal_False;
- }
- else
- nO = nM - 1;
- }
- }
- if( pP ) *pP = nU;
- return sal_False;
-}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svl/source/misc/adrparse.cxx b/svl/source/misc/adrparse.cxx
index e0087aa5220d..b6aa9d9e6ff2 100644
--- a/svl/source/misc/adrparse.cxx
+++ b/svl/source/misc/adrparse.cxx
@@ -780,142 +780,4 @@ SvAddressParser::~SvAddressParser()
m_aRest.clear();
}
-//============================================================================
-// static
-bool SvAddressParser::createRFC822Mailbox(String const & rPhrase,
- String const & rAddrSpec,
- String & rMailbox)
-{
- String aTheAddrSpec;
- sal_Unicode const * p = rAddrSpec.GetBuffer();
- sal_Unicode const * pEnd = p + rAddrSpec.Len();
- {for (bool bSegment = false;;)
- {
- p = INetMIME::skipLinearWhiteSpaceComment(p, pEnd);
- if (p == pEnd)
- return false;
- if (bSegment)
- {
- sal_Unicode c = *p++;
- if (c == '@')
- break;
- else if (c != '.')
- return false;
- aTheAddrSpec += '.';
- p = INetMIME::skipLinearWhiteSpaceComment(p, pEnd);
- if (p == pEnd)
- return false;
- }
- else
- bSegment = true;
- if (*p == '"')
- {
- aTheAddrSpec += *p++;
- for (;;)
- {
- if (INetMIME::startsWithLineFolding(p, pEnd))
- p += 2;
- if (p == pEnd)
- return false;
- if (*p == '"')
- break;
- if (*p == '\x0D' || (*p == '\\' && ++p == pEnd)
- || !INetMIME::isUSASCII(*p))
- return false;
- if (INetMIME::needsQuotedStringEscape(*p))
- aTheAddrSpec += '\\';
- aTheAddrSpec += *p++;
- }
- aTheAddrSpec += *p++;
- }
- else if (INetMIME::isAtomChar(*p))
- while (p != pEnd && INetMIME::isAtomChar(*p))
- aTheAddrSpec += *p++;
- else
- return false;
- }}
- aTheAddrSpec += '@';
- {for (bool bSegment = false;;)
- {
- p = INetMIME::skipLinearWhiteSpaceComment(p, pEnd);
- if (p == pEnd)
- {
- if (bSegment)
- break;
- else
- return false;
- }
- if (bSegment)
- {
- if (*p++ != '.')
- return false;
- aTheAddrSpec += '.';
- p = INetMIME::skipLinearWhiteSpaceComment(p, pEnd);
- if (p == pEnd)
- return false;
- }
- else
- bSegment = true;
- if (*p == '[')
- {
- aTheAddrSpec += *p++;
- for (;;)
- {
- if (INetMIME::startsWithLineFolding(p, pEnd))
- p += 2;
- if (p == pEnd)
- return false;
- if (*p == ']')
- break;
- if (*p == '\x0D' || *p == '[' || (*p == '\\' && ++p == pEnd)
- || !INetMIME::isUSASCII(*p))
- return false;
- if (*p >= '[' && *p <= ']')
- aTheAddrSpec += '\\';
- aTheAddrSpec += *p++;
- }
- aTheAddrSpec += *p++;
- }
- else if (INetMIME::isAtomChar(*p))
- while (p != pEnd && INetMIME::isAtomChar(*p))
- aTheAddrSpec += *p++;
- else
- return false;
- }}
-
- if (rPhrase.Len() == 0)
- rMailbox = aTheAddrSpec;
- else
- {
- bool bQuotedString = false;
- p = rPhrase.GetBuffer();
- pEnd = p + rPhrase.Len();
- for (;p != pEnd; ++p)
- if (!(INetMIME::isAtomChar(*p)))
- {
- bQuotedString = true;
- break;
- }
- String aTheMailbox;
- if (bQuotedString)
- {
- aTheMailbox = '"';
- for (p = rPhrase.GetBuffer(); p != pEnd; ++p)
- {
- if (INetMIME::needsQuotedStringEscape(*p))
- aTheMailbox += '\\';
- aTheMailbox += *p;
- }
- aTheMailbox += '"';
- }
- else
- aTheMailbox = rPhrase;
- aTheMailbox.AppendAscii(RTL_CONSTASCII_STRINGPARAM(" <"));
- aTheMailbox += aTheAddrSpec;
- aTheMailbox += '>';
- rMailbox = aTheMailbox;
- }
- return true;
-}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svl/source/misc/inethist.cxx b/svl/source/misc/inethist.cxx
index eba1e4083d38..c52c03cf6cef 100644
--- a/svl/source/misc/inethist.cxx
+++ b/svl/source/misc/inethist.cxx
@@ -156,9 +156,6 @@ class INetURLHistory_Impl
*/
void initialize (void);
- void downheap (hash_entry a[], sal_uInt16 n, sal_uInt16 k);
- void heapsort (hash_entry a[], sal_uInt16 n);
-
/** capacity.
*/
sal_uInt16 capacity (void) const
@@ -258,42 +255,6 @@ void INetURLHistory_Impl::initialize (void)
}
/*
- * downheap.
- */
-void INetURLHistory_Impl::downheap (hash_entry a[], sal_uInt16 n, sal_uInt16 k)
-{
- hash_entry h = a[k];
- while (k < n / 2)
- {
- sal_uInt16 i = k + k + 1;
- if (((i + 1) < n) && (a[i] < a[i + 1])) i++;
- if (!(h < a[i])) break;
- a[k] = a[i];
- k = i;
- }
- a[k] = h;
-}
-
-/*
- * heapsort.
- */
-void INetURLHistory_Impl::heapsort (hash_entry a[], sal_uInt16 n)
-{
- hash_entry h;
-
- for (sal_uInt16 k = (n - 1) / 2 + 1; k > 0; k--)
- downheap (a, n, k - 1);
-
- while (n > 0)
- {
- h = a[0 ];
- a[0 ] = a[n - 1];
- a[n - 1] = h;
- downheap (a, --n, 0);
- }
-}
-
-/*
* find.
*/
sal_uInt16 INetURLHistory_Impl::find (sal_uInt32 nHash) const
diff --git a/svl/source/misc/inettype.cxx b/svl/source/misc/inettype.cxx
index cb16349ab487..6234bc0dbe02 100644
--- a/svl/source/misc/inettype.cxx
+++ b/svl/source/misc/inettype.cxx
@@ -116,8 +116,6 @@ public:
static UniString GetPresentation(INetContentType eTypeID);
- static UniString GetExtension(const UniString & rTypeName);
-
static INetContentType GetContentType4Extension(UniString const &
rExtension);
@@ -768,24 +766,6 @@ UniString Registration::GetPresentation(INetContentType eTypeID)
//============================================================================
// static
-UniString Registration::GetExtension(UniString const & rTypeName)
-{
- if (!m_pRegistration)
- m_pRegistration = new Registration;
-
- UniString aTheTypeName = rTypeName;
- aTheTypeName.ToLowerAscii();
- sal_uInt16 nPos;
- return m_pRegistration->m_aTypeNameMap.Seek_Entry(&aTheTypeName, &nPos) ?
- static_cast< TypeNameMapEntry * >(m_pRegistration->
- m_aTypeNameMap.
- GetObject(nPos))->
- m_aExtension :
- UniString();
-}
-
-//============================================================================
-// static
INetContentType Registration::GetContentType4Extension(UniString const &
rExtension)
{
@@ -848,19 +828,6 @@ MediaTypeEntry const * seekEntry(UniString const & rTypeName,
}
-//============================================================================
-//
-// INetContentTypes
-//
-//============================================================================
-
-//static
-void INetContentTypes::Uninitialize()
-{
- Registration::deinitialize();
-}
-
-//============================================================================
//static
INetContentType INetContentTypes::RegisterContentType(UniString const &
rTypeName,
@@ -970,25 +937,6 @@ UniString INetContentTypes::GetPresentation(INetContentType eTypeID,
//============================================================================
//static
-UniString INetContentTypes::GetExtension(UniString const & rTypeName)
-{
- MediaTypeEntry const * pEntry = seekEntry(rTypeName, aStaticTypeNameMap,
- CONTENT_TYPE_LAST + 1);
- if (pEntry)
- return UniString::CreateFromAscii(pEntry->m_pExtension);
-
- UniString aExtension = Registration::GetExtension(rTypeName);
- if (aExtension.Len() != 0)
- return aExtension;
- // special handling of text types, which come in uncounted variations:
- return rTypeName.EqualsIgnoreCaseAscii("text", 0,
- RTL_CONSTASCII_LENGTH("text")) ?
- UniString::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("txt")) :
- UniString::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("tmp"));
-}
-
-//============================================================================
-//static
INetContentType INetContentTypes::GetContentType4Extension(UniString const &
rExtension)
{
@@ -1136,63 +1084,6 @@ bool INetContentTypes::GetExtensionFromURL(UniString const & rURL,
}
//============================================================================
-//static
-INetContentType INetContentTypes::MapStringToContentType(UniString const &
- rPresentation)
-{
- MediaTypeEntry const * pEntry = seekEntry(rPresentation,
- aStaticPresentationMap,
- sizeof aStaticPresentationMap
- / sizeof (MediaTypeEntry));
- return pEntry ? pEntry->m_eTypeID : CONTENT_TYPE_UNKNOWN;
-}
-
-//============================================================================
-// static
-bool INetContentTypes::parse(ByteString const & rMediaType,
- ByteString & rType, ByteString & rSubType,
- INetContentTypeParameterList * pParameters)
-{
- sal_Char const * p = rMediaType.GetBuffer();
- sal_Char const * pEnd = p + rMediaType.Len();
-
- p = INetMIME::skipLinearWhiteSpaceComment(p, pEnd);
- sal_Char const * pToken = p;
- bool bDowncase = false;
- while (p != pEnd && INetMIME::isTokenChar(*p))
- {
- bDowncase = bDowncase || INetMIME::isUpperCase(*p);
- ++p;
- }
- if (p == pToken)
- return false;
- rType = ByteString(pToken, sal::static_int_cast< xub_StrLen >(p - pToken));
- if (bDowncase)
- rType.ToLowerAscii();
-
- p = INetMIME::skipLinearWhiteSpaceComment(p, pEnd);
- if (p == pEnd || *p++ != '/')
- return false;
-
- p = INetMIME::skipLinearWhiteSpaceComment(p, pEnd);
- pToken = p;
- bDowncase = false;
- while (p != pEnd && INetMIME::isTokenChar(*p))
- {
- bDowncase = bDowncase || INetMIME::isUpperCase(*p);
- ++p;
- }
- if (p == pToken)
- return false;
- rSubType = ByteString(
- pToken, sal::static_int_cast< xub_StrLen >(p - pToken));
- if (bDowncase)
- rSubType.ToLowerAscii();
-
- return INetMIME::scanParameters(p, pEnd, pParameters) == pEnd;
-}
-
-//============================================================================
// static
bool INetContentTypes::parse(UniString const & rMediaType,
UniString & rType, UniString & rSubType,
@@ -1237,116 +1128,4 @@ bool INetContentTypes::parse(UniString const & rMediaType,
return INetMIME::scanParameters(p, pEnd, pParameters) == pEnd;
}
-//============================================================================
-// static
-ByteString INetContentTypes::appendUSASCIIParameter(ByteString const &
- rMediaType,
- ByteString const &
- rAttribute,
- ByteString const & rValue)
-{
- ByteString aResult = rMediaType;
- aResult.Append(RTL_CONSTASCII_STRINGPARAM("; "));
- aResult += rAttribute;
- aResult += '=';
- bool bQuote = false;
- for (xub_StrLen i = 0; i < rValue.Len(); ++i)
- {
- // When the value contains any ' characters, use a quoted string
- // instead of a token, in order to avoid confusion with RFC 2231
- // extensions:
- sal_uInt32 nChar = sal_uChar(rValue.GetChar(i));
- DBG_ASSERT(INetMIME::isUSASCII(nChar),
- "INetContentTypes::appendUSASCIIParameter(): Bad value");
- if (!INetMIME::isTokenChar(nChar) || nChar == '\'')
- {
- bQuote = true;
- break;
- }
- }
- if (bQuote)
- {
- aResult += '"';
- for (xub_StrLen i = 0; i < rValue.Len(); ++i)
- {
- // Escape LF as well as CR to avoid confusion with line folding:
- sal_uInt32 nChar = sal_uChar(rValue.GetChar(i));
- DBG_ASSERT(INetMIME::isUSASCII(nChar),
- "INetContentTypes::appendUSASCIIParameter():"
- " Bad value");
- switch (nChar)
- {
- case 0x0A: // LF
- case 0x0D: // CR
- case '"':
- case '\\':
- aResult += '\\';
- default:
- aResult += static_cast< char >(nChar);
- break;
- }
- }
- aResult += '"';
- }
- else
- aResult += rValue;
- return aResult;
-}
-
-//============================================================================
-// static
-UniString INetContentTypes::appendUSASCIIParameter(UniString const &
- rMediaType,
- UniString const &
- rAttribute,
- UniString const & rValue)
-{
- UniString aResult = rMediaType;
- aResult.AppendAscii(RTL_CONSTASCII_STRINGPARAM("; "));
- aResult += rAttribute;
- aResult += '=';
- bool bQuote = false;
- for (xub_StrLen i = 0; i < rValue.Len(); ++i)
- {
- // When the value contains any ' characters, use a quoted string
- // instead of a token, in order to avoid confusion with RFC 2231
- // extensions:
- sal_uInt32 nChar = rValue.GetChar(i);
- DBG_ASSERT(INetMIME::isUSASCII(nChar),
- "INetContentTypes::appendUSASCIIParameter(): Bad value");
- if (!INetMIME::isTokenChar(nChar) || nChar == '\'')
- {
- bQuote = true;
- break;
- }
- }
- if (bQuote)
- {
- aResult += '"';
- for (xub_StrLen i = 0; i < rValue.Len(); ++i)
- {
- // Escape LF as well as CR to avoid confusion with line folding:
- sal_uInt32 nChar = rValue.GetChar(i);
- DBG_ASSERT(INetMIME::isUSASCII(nChar),
- "INetContentTypes::appendUSASCIIParameter():"
- " Bad value");
- switch (nChar)
- {
- case 0x0A: // LF
- case 0x0D: // CR
- case '"':
- case '\\':
- aResult += '\\';
- default:
- aResult += sal_Unicode(nChar);
- break;
- }
- }
- aResult += '"';
- }
- else
- aResult += rValue;
- return aResult;
-}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svl/source/misc/ownlist.cxx b/svl/source/misc/ownlist.cxx
index 0e3fae02ff8e..bb018ba85782 100644
--- a/svl/source/misc/ownlist.cxx
+++ b/svl/source/misc/ownlist.cxx
@@ -166,64 +166,6 @@ SvCommand & SvCommandList::Append
return aCommandList.back();
}
-//=========================================================================
-SvStream & operator >>
-(
- SvStream & rStm, /* Stream aus dem gelesen wird */
- SvCommandList & rThis /* Die zu f"ullende Liste */
-)
-/* [Beschreibung]
-
- Die Liste mit ihren Elementen wird gelesen. Das Format ist:
- 1. Anzahl der Elemente
- 2. Alle Elemente
-
- [R"uckgabewert]
-
- SvStream & Der "ubergebene Stream.
-*/
-{
- sal_uInt32 nCount = 0;
- rStm >> nCount;
- if( !rStm.GetError() )
- {
- while( nCount-- )
- {
- SvCommand aCmd;
- rStm >> aCmd;
- rThis.aCommandList.push_back( aCmd );
- }
- }
- return rStm;
-}
-
-//=========================================================================
-SvStream & operator <<
-(
- SvStream & rStm, /* Stream in den geschrieben wird */
- const SvCommandList & rThis /* Die zu schreibende Liste */
-)
-/* [Beschreibung]
-
- Die Liste mit ihren Elementen wir geschrieben. Das Format ist:
- 1. Anzahl der Elemente
- 2. Alle Elemente
-
- [R"uckgabewert]
-
- SvStream & Der "ubergebene Stream.
-*/
-{
- sal_uInt32 nCount = rThis.aCommandList.size();
- rStm << nCount;
-
- for( sal_uInt32 i = 0; i < nCount; i++ )
- {
- rStm << rThis.aCommandList[ i ];
- }
- return rStm;
-}
-
sal_Bool SvCommandList::FillFromSequence( const com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >& aCommandSequence )
{
const sal_Int32 nCount = aCommandSequence.getLength();
diff --git a/svl/source/misc/strmadpt.cxx b/svl/source/misc/strmadpt.cxx
index d7905f470290..79adbb551d02 100644
--- a/svl/source/misc/strmadpt.cxx
+++ b/svl/source/misc/strmadpt.cxx
@@ -178,7 +178,7 @@ ErrCode SvOutputStreamOpenLockBytes::Flush() const
{
m_xOutputStream->flush();
}
- catch (io::IOException)
+ catch (const io::IOException&)
{
return ERRCODE_IO_CANTWRITE;
}
@@ -223,7 +223,7 @@ ErrCode SvOutputStreamOpenLockBytes::FillAppend(void const * pBuffer,
writeBytes(uno::Sequence< sal_Int8 >(
static_cast< sal_Int8 const * >(pBuffer), nCount));
}
- catch (io::IOException)
+ catch (const io::IOException&)
{
return ERRCODE_IO_CANTWRITE;
}
@@ -252,11 +252,15 @@ sal_uLong SvOutputStreamOpenLockBytes::Seek(sal_uLong)
void SvOutputStreamOpenLockBytes::Terminate()
{
if (m_xOutputStream.is())
+ {
try
{
m_xOutputStream->closeOutput();
}
- catch (io::IOException) {}
+ catch (const io::IOException&)
+ {
+ }
+ }
}
//============================================================================
@@ -492,7 +496,7 @@ sal_uLong SvInputStream::GetData(void * pData, sal_uLong nSize)
{
m_xSeekable->seek(m_nSeekedFrom);
}
- catch (io::IOException)
+ catch (const io::IOException&)
{
SetError(ERRCODE_IO_CANTREAD);
return 0;
@@ -513,7 +517,7 @@ sal_uLong SvInputStream::GetData(void * pData, sal_uLong nSize)
{
nCount = m_xStream->readBytes(aBuffer, nRemain);
}
- catch (io::IOException)
+ catch (const io::IOException&)
{
SetError(ERRCODE_IO_CANTREAD);
return nRead;
@@ -550,7 +554,7 @@ sal_uLong SvInputStream::GetData(void * pData, sal_uLong nSize)
{
nCount = m_xStream->readBytes(aBuffer, nRemain);
}
- catch (io::IOException)
+ catch (const io::IOException&)
{
SetError(ERRCODE_IO_CANTREAD);
break;
@@ -604,7 +608,9 @@ sal_uLong SvInputStream::SeekPos(sal_uLong nPos)
return sal_uLong(nLength);
}
}
- catch (io::IOException) {}
+ catch (const io::IOException&)
+ {
+ }
else
return Tell(); //@@@
}
@@ -617,13 +623,17 @@ sal_uLong SvInputStream::SeekPos(sal_uLong nPos)
return nPos;
}
else if (m_xSeekable.is())
+ {
try
{
m_xSeekable->seek(nPos);
m_nSeekedFrom = STREAM_SEEK_TO_END;
return nPos;
}
- catch (io::IOException) {}
+ catch (const io::IOException&)
+ {
+ }
+ }
else if (m_pPipe->setReadPosition(nPos) == SvDataPipe_Impl::SEEK_OK)
{
m_nSeekedFrom = STREAM_SEEK_TO_END;
@@ -658,11 +668,15 @@ SvInputStream::SvInputStream(
SvInputStream::~SvInputStream()
{
if (m_xStream.is())
+ {
try
{
m_xStream->closeInput();
}
- catch (io::IOException) {}
+ catch (const io::IOException&)
+ {
+ }
+ }
delete m_pPipe;
}
@@ -727,7 +741,7 @@ sal_uLong SvOutputStream::PutData(void const * pData, sal_uLong nSize)
+ nWritten,
nRemain));
}
- catch (io::IOException)
+ catch (const io::IOException&)
{
SetError(ERRCODE_IO_CANTWRITE);
break;
@@ -758,7 +772,9 @@ void SvOutputStream::FlushData()
{
m_xStream->flush();
}
- catch (io::IOException) {}
+ catch (const io::IOException&)
+ {
+ }
}
//============================================================================
@@ -781,11 +797,15 @@ SvOutputStream::SvOutputStream(uno::Reference< io::XOutputStream > const &
SvOutputStream::~SvOutputStream()
{
if (m_xStream.is())
+ {
try
{
m_xStream->closeOutput();
}
- catch (io::IOException) {}
+ catch (const io::IOException&)
+ {
+ }
+ }
}
//============================================================================
diff --git a/svl/source/misc/urihelper.cxx b/svl/source/misc/urihelper.cxx
index ac70f8a6e467..1bef290f3dfd 100644
--- a/svl/source/misc/urihelper.cxx
+++ b/svl/source/misc/urihelper.cxx
@@ -65,10 +65,6 @@
#include <unotools/charclass.hxx>
#include "rtl/instance.hxx"
-namespace unnamed_svl_urihelper {}
-using namespace unnamed_svl_urihelper;
- // unnamed namespaces don't work well yet...
-
namespace css = com::sun::star;
using namespace com::sun::star;
@@ -78,7 +74,7 @@ using namespace com::sun::star;
//
//============================================================================
-namespace unnamed_svl_urihelper {
+namespace {
inline UniString toUniString(ByteString const & rString)
{
@@ -152,24 +148,6 @@ inline UniString SmartRel2Abs_Impl(INetURLObject const & rTheBaseURIRef,
UniString
URIHelper::SmartRel2Abs(INetURLObject const & rTheBaseURIRef,
- ByteString const & rTheRelURIRef,
- Link const & rMaybeFileHdl,
- bool bCheckFileExists,
- bool bIgnoreFragment,
- INetURLObject::EncodeMechanism eEncodeMechanism,
- INetURLObject::DecodeMechanism eDecodeMechanism,
- rtl_TextEncoding eCharset,
- bool bRelativeNonURIs,
- INetURLObject::FSysStyle eStyle)
-{
- return SmartRel2Abs_Impl(rTheBaseURIRef, rTheRelURIRef, rMaybeFileHdl,
- bCheckFileExists, bIgnoreFragment,
- eEncodeMechanism, eDecodeMechanism, eCharset,
- bRelativeNonURIs, eStyle);
-}
-
-UniString
-URIHelper::SmartRel2Abs(INetURLObject const & rTheBaseURIRef,
UniString const & rTheRelURIRef,
Link const & rMaybeFileHdl,
bool bCheckFileExists,
@@ -422,7 +400,7 @@ rtl::OUString URIHelper::simpleNormalizedMakeRelative(
//
//============================================================================
-namespace unnamed_svl_urihelper {
+namespace {
inline xub_StrLen nextChar(UniString const & rStr, xub_StrLen nPos)
{
@@ -887,65 +865,4 @@ URIHelper::removePassword(UniString const & rURI,
String(aObj.GetURLNoPass(eDecodeMechanism, eCharset));
}
-//============================================================================
-//
-// queryFSysStyle
-//
-//============================================================================
-
-INetURLObject::FSysStyle URIHelper::queryFSysStyle(UniString const & rFileUrl,
- bool bAddConvenienceStyles)
- throw (uno::RuntimeException)
-{
- ::ucbhelper::ContentBroker const * pBroker = ::ucbhelper::ContentBroker::get();
- uno::Reference< ucb::XContentProviderManager > xManager;
- if (pBroker)
- xManager = pBroker->getContentProviderManagerInterface();
- uno::Reference< beans::XPropertySet > xProperties;
- if (xManager.is())
- xProperties
- = uno::Reference< beans::XPropertySet >(
- xManager->queryContentProvider(rFileUrl), uno::UNO_QUERY);
- sal_Int32 nNotation = ucb::FileSystemNotation::UNKNOWN_NOTATION;
- if (xProperties.is())
- try
- {
- xProperties->getPropertyValue(rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM(
- "FileSystemNotation")))
- >>= nNotation;
- }
- catch (beans::UnknownPropertyException const &) {}
- catch (lang::WrappedTargetException const &) {}
-
- // The following code depends on the fact that the
- // com::sun::star::ucb::FileSystemNotation constants range from UNKNOWN to
- // MAC, without any holes. The table below has two entries per notation,
- // the first is used if bAddConvenienceStyles == false, while the second
- // is used if bAddConvenienceStyles == true:
- static INetURLObject::FSysStyle const aMap[][2]
- = { { INetURLObject::FSysStyle(0),
- INetURLObject::FSYS_DETECT },
- // UNKNOWN
- { INetURLObject::FSYS_UNX,
- INetURLObject::FSysStyle(INetURLObject::FSYS_VOS
- | INetURLObject::FSYS_UNX) },
- // UNIX
- { INetURLObject::FSYS_DOS,
- INetURLObject::FSysStyle(INetURLObject::FSYS_VOS
- | INetURLObject::FSYS_UNX
- | INetURLObject::FSYS_DOS) },
- // DOS
- { INetURLObject::FSYS_MAC,
- INetURLObject::FSysStyle(INetURLObject::FSYS_VOS
- | INetURLObject::FSYS_UNX
- | INetURLObject::FSYS_MAC) } };
- return aMap[nNotation < ucb::FileSystemNotation::UNKNOWN_NOTATION
- || nNotation > ucb::FileSystemNotation::MAC_NOTATION ?
- 0 :
- nNotation
- - ucb::FileSystemNotation::UNKNOWN_NOTATION]
- [bAddConvenienceStyles];
-}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index ffdb583261f7..8ff4867274c0 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -57,6 +57,7 @@
#include <unotools/digitgroupingiterator.hxx>
#include <rtl/logfile.hxx>
#include <rtl/instance.hxx>
+#include <rtl/strbuf.hxx>
#include <math.h>
#include <limits>
@@ -99,26 +100,28 @@ static sal_uInt32 theIndexTable[NF_INDEX_TABLE_ENTRIES];
also handles one instance of the SysLocale options
*/
+typedef ::std::vector< SvNumberFormatter* > SvNumberFormatterList_impl;
+
class SvNumberFormatterRegistry_Impl : public utl::ConfigurationListener
{
- List aFormatters;
- SvtSysLocaleOptions aSysLocaleOptions;
- LanguageType eSysLanguage;
+ SvNumberFormatterList_impl aFormatters;
+ SvtSysLocaleOptions aSysLocaleOptions;
+ LanguageType eSysLanguage;
public:
SvNumberFormatterRegistry_Impl();
virtual ~SvNumberFormatterRegistry_Impl();
- void Insert( SvNumberFormatter* pThis )
- { aFormatters.Insert( pThis, LIST_APPEND ); }
- SvNumberFormatter* Remove( SvNumberFormatter* pThis )
- { return (SvNumberFormatter*)aFormatters.Remove( pThis ); }
- sal_uInt32 Count()
- { return aFormatters.Count(); }
+ void Insert( SvNumberFormatter* pThis )
+ { aFormatters.push_back( pThis ); }
- virtual void ConfigurationChanged( utl::ConfigurationBroadcaster*, sal_uInt32 );
-};
+ SvNumberFormatter* Remove( SvNumberFormatter* pThis );
+ size_t Count()
+ { return aFormatters.size(); }
+
+ virtual void ConfigurationChanged( utl::ConfigurationBroadcaster*, sal_uInt32 );
+};
SvNumberFormatterRegistry_Impl::SvNumberFormatterRegistry_Impl()
{
@@ -133,26 +136,37 @@ SvNumberFormatterRegistry_Impl::~SvNumberFormatterRegistry_Impl()
}
-void SvNumberFormatterRegistry_Impl::ConfigurationChanged( utl::ConfigurationBroadcaster*, sal_uInt32 nHint )
+SvNumberFormatter* SvNumberFormatterRegistry_Impl::Remove( SvNumberFormatter* pThis )
{
+ for(
+ SvNumberFormatterList_impl::iterator it = aFormatters.begin();
+ it < aFormatters.end();
+ ++it
+ ) {
+ if ( *it == pThis ) {
+ aFormatters.erase( it );
+ break;
+ }
+ }
+ return pThis;
+}
+
+void SvNumberFormatterRegistry_Impl::ConfigurationChanged(
+ utl::ConfigurationBroadcaster*,
+ sal_uInt32 nHint
+) {
if ( nHint & SYSLOCALEOPTIONS_HINT_LOCALE )
{
::osl::MutexGuard aGuard( SvNumberFormatter::GetMutex() );
- for ( SvNumberFormatter* p = (SvNumberFormatter*)aFormatters.First();
- p; p = (SvNumberFormatter*)aFormatters.Next() )
- {
- p->ReplaceSystemCL( eSysLanguage );
- }
+ for( size_t i = 0, n = aFormatters.size(); i < n; ++i )
+ aFormatters[ i ]->ReplaceSystemCL( eSysLanguage );
eSysLanguage = MsLangId::getRealLanguage( LANGUAGE_SYSTEM );
}
if ( nHint & SYSLOCALEOPTIONS_HINT_CURRENCY )
{
::osl::MutexGuard aGuard( SvNumberFormatter::GetMutex() );
- for ( SvNumberFormatter* p = (SvNumberFormatter*)aFormatters.First();
- p; p = (SvNumberFormatter*)aFormatters.Next() )
- {
- p->ResetDefaultSystemCurrency();
- }
+ for( size_t i = 0, n = aFormatters.size(); i < n; ++i )
+ aFormatters[ i ]->ResetDefaultSystemCurrency();
}
}
@@ -2091,8 +2105,9 @@ sal_Int32 SvNumberFormatter::ImpAdjustFormatCodeDefault(
if ( !nCnt )
return -1;
if (bCheckCorrectness && LocaleDataWrapper::areChecksEnabled())
- { // check the locale data for correctness
- ByteString aMsg;
+ {
+ // check the locale data for correctness
+ rtl::OStringBuffer aMsg;
sal_Int32 nElem, nShort, nMedium, nLong, nShortDef, nMediumDef, nLongDef;
nShort = nMedium = nLong = nShortDef = nMediumDef = nLongDef = -1;
for ( nElem = 0; nElem < nCnt; nElem++ )
@@ -2109,7 +2124,7 @@ sal_Int32 SvNumberFormatter::ImpAdjustFormatCodeDefault(
nLong = nElem;
break;
default:
- aMsg = "unknown type";
+ aMsg.append(RTL_CONSTASCII_STRINGPARAM("unknown type"));
}
if ( pFormatArr[nElem].Default )
{
@@ -2117,47 +2132,44 @@ sal_Int32 SvNumberFormatter::ImpAdjustFormatCodeDefault(
{
case i18n::KNumberFormatType::SHORT :
if ( nShortDef != -1 )
- aMsg = "dupe short type default";
+ aMsg.append(RTL_CONSTASCII_STRINGPARAM("dupe short type default"));
nShortDef = nElem;
break;
case i18n::KNumberFormatType::MEDIUM :
if ( nMediumDef != -1 )
- aMsg = "dupe medium type default";
+ aMsg.append(RTL_CONSTASCII_STRINGPARAM("dupe medium type default"));
nMediumDef = nElem;
break;
case i18n::KNumberFormatType::LONG :
if ( nLongDef != -1 )
- aMsg = "dupe long type default";
+ aMsg.append(RTL_CONSTASCII_STRINGPARAM("dupe long type default"));
nLongDef = nElem;
break;
}
}
- if ( aMsg.Len() )
+ if (aMsg.getLength())
{
- aMsg.Insert( "SvNumberFormatter::ImpAdjustFormatCodeDefault: ", 0 );
- aMsg += "\nXML locale data FormatElement formatindex: ";
- aMsg += ByteString::CreateFromInt32( pFormatArr[nElem].Index );
- String aUMsg( aMsg, RTL_TEXTENCODING_ASCII_US);
- LocaleDataWrapper::outputCheckMessage(
- xLocaleData->appendLocaleInfo( aUMsg));
- aMsg.Erase();
+ aMsg.insert(0, RTL_CONSTASCII_STRINGPARAM("SvNumberFormatter::ImpAdjustFormatCodeDefault: "));
+ aMsg.append(RTL_CONSTASCII_STRINGPARAM("\nXML locale data FormatElement formatindex: "));
+ aMsg.append(static_cast<sal_Int32>(pFormatArr[nElem].Index));
+ rtl::OUString aUMsg(rtl::OStringToOUString(aMsg.makeStringAndClear(),
+ RTL_TEXTENCODING_ASCII_US));
+ LocaleDataWrapper::outputCheckMessage(xLocaleData->appendLocaleInfo(aUMsg));
}
}
if ( nShort != -1 && nShortDef == -1 )
- aMsg += "no short type default ";
+ aMsg.append(RTL_CONSTASCII_STRINGPARAM("no short type default "));
if ( nMedium != -1 && nMediumDef == -1 )
- aMsg += "no medium type default ";
+ aMsg.append(RTL_CONSTASCII_STRINGPARAM("no medium type default "));
if ( nLong != -1 && nLongDef == -1 )
- aMsg += "no long type default ";
- if ( aMsg.Len() )
+ aMsg.append(RTL_CONSTASCII_STRINGPARAM("no long type default "));
+ if (aMsg.getLength())
{
- aMsg.Insert( "SvNumberFormatter::ImpAdjustFormatCodeDefault: ", 0 );
- aMsg += "\nXML locale data FormatElement group of: ";
- String aUMsg( aMsg, RTL_TEXTENCODING_ASCII_US);
- aUMsg += String( pFormatArr[0].NameID );
+ aMsg.insert(0, RTL_CONSTASCII_STRINGPARAM("SvNumberFormatter::ImpAdjustFormatCodeDefault: "));
+ aMsg.append(RTL_CONSTASCII_STRINGPARAM("\nXML locale data FormatElement group of: "));
+ rtl::OUString aUMsg(rtl::OStringToOUString(aMsg.makeStringAndClear(), RTL_TEXTENCODING_ASCII_US));
LocaleDataWrapper::outputCheckMessage(
- xLocaleData->appendLocaleInfo( aUMsg));
- aMsg.Erase();
+ xLocaleData->appendLocaleInfo(aUMsg + pFormatArr[0].NameID));
}
}
// find the default (medium preferred, then long) and reset all other defaults
@@ -2749,7 +2761,6 @@ void SvNumberFormatter::GenerateFormat(String& sString,
const String& rThSep = GetNumThousandSep();
SvNumberformat* pFormat = (SvNumberformat*) aFTable.Get(nIndex);
- sal_Bool insertBrackets = pFormat->IsNegativeInBracket();
if (nAnzLeading == 0)
{
@@ -2843,36 +2854,42 @@ void SvNumberFormatter::GenerateFormat(String& sString,
sString += ';';
sString += sNegStr;
}
- if ( (IsRed || insertBrackets ) && eType != NUMBERFORMAT_CURRENCY)
+ if (eType != NUMBERFORMAT_CURRENCY)
{
- String sTmpStr = sString;
-
- if ( pFormat->HasPositiveBracketPlaceholder() )
+ bool insertBrackets = false;
+ if ( eType != NUMBERFORMAT_UNDEFINED)
+ insertBrackets = pFormat->IsNegativeInBracket();
+ if (IsRed || insertBrackets)
{
- sTmpStr += '_';
- sTmpStr += ')';
- }
- sTmpStr += ';';
+ String sTmpStr = sString;
- if (IsRed)
- {
- sTmpStr += '[';
- sTmpStr += pFormatScanner->GetRedString();
- sTmpStr += ']';
- }
+ if ( pFormat->HasPositiveBracketPlaceholder() )
+ {
+ sTmpStr += '_';
+ sTmpStr += ')';
+ }
+ sTmpStr += ';';
- if (insertBrackets)
- {
- sTmpStr += '(';
- sTmpStr += sString;
- sTmpStr += ')';
- }
- else
- {
- sTmpStr += '-';
- sTmpStr +=sString;
- }
- sString = sTmpStr;
+ if (IsRed)
+ {
+ sTmpStr += '[';
+ sTmpStr += pFormatScanner->GetRedString();
+ sTmpStr += ']';
+ }
+
+ if (insertBrackets)
+ {
+ sTmpStr += '(';
+ sTmpStr += sString;
+ sTmpStr += ')';
+ }
+ else
+ {
+ sTmpStr += '-';
+ sTmpStr +=sString;
+ }
+ sString = sTmpStr;
+ }
}
}
@@ -3533,21 +3550,12 @@ void SvNumberFormatter::GetCompatibilityCurrency( String& rSymbol, String& rAbbr
void lcl_CheckCurrencySymbolPosition( const NfCurrencyEntry& rCurr )
{
- short nPos = -1; // -1:=unknown, 0:=vorne, 1:=hinten
- short nNeg = -1;
switch ( rCurr.GetPositiveFormat() )
{
case 0: // $1
- nPos = 0;
- break;
case 1: // 1$
- nPos = 1;
- break;
case 2: // $ 1
- nPos = 0;
- break;
case 3: // 1 $
- nPos = 1;
break;
default:
LocaleDataWrapper::outputCheckMessage(
@@ -3557,75 +3565,27 @@ void lcl_CheckCurrencySymbolPosition( const NfCurrencyEntry& rCurr )
switch ( rCurr.GetNegativeFormat() )
{
case 0: // ($1)
- nNeg = 0;
- break;
case 1: // -$1
- nNeg = 0;
- break;
case 2: // $-1
- nNeg = 0;
- break;
case 3: // $1-
- nNeg = 0;
- break;
case 4: // (1$)
- nNeg = 1;
- break;
case 5: // -1$
- nNeg = 1;
- break;
case 6: // 1-$
- nNeg = 1;
- break;
case 7: // 1$-
- nNeg = 1;
- break;
case 8: // -1 $
- nNeg = 1;
- break;
case 9: // -$ 1
- nNeg = 0;
- break;
case 10: // 1 $-
- nNeg = 1;
- break;
case 11: // $ -1
- nNeg = 0;
- break;
case 12 : // $ 1-
- nNeg = 0;
- break;
case 13 : // 1- $
- nNeg = 1;
- break;
case 14 : // ($ 1)
- nNeg = 0;
- break;
case 15 : // (1 $)
- nNeg = 1;
break;
default:
LocaleDataWrapper::outputCheckMessage(
"lcl_CheckCurrencySymbolPosition: unknown NegativeFormat");
break;
}
- if ( nPos >= 0 && nNeg >= 0 && nPos != nNeg )
- {
- ByteString aStr( "positions of currency symbols differ\nLanguage: " );
- aStr += ByteString::CreateFromInt32( rCurr.GetLanguage() );
- aStr += " <";
- aStr += ByteString( rCurr.GetSymbol(), RTL_TEXTENCODING_UTF8 );
- aStr += "> positive: ";
- aStr += ByteString::CreateFromInt32( rCurr.GetPositiveFormat() );
- aStr += ( nPos ? " (postfix)" : " (prefix)" );
- aStr += ", negative: ";
- aStr += ByteString::CreateFromInt32( rCurr.GetNegativeFormat() );
- aStr += ( nNeg ? " (postfix)" : " (prefix)" );
-#if 0
-// seems that there really are some currencies which differ, e.g. YugoDinar
- DBG_ERRORFILE( aStr.GetBuffer() );
-#endif
- }
}
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index 00ebf41a3dd7..cfc916993885 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -2007,15 +2007,7 @@ sal_Bool SvNumberformat::GetOutputString(String& sString,
}
return sal_False;
}
-/*
-void SvNumberformat::GetNextFareyNumber(sal_uLong nPrec, sal_uLong x0, sal_uLong x1,
- sal_uLong y0, sal_uLong y1,
- sal_uLong& x2,sal_uLong& y2)
-{
- x2 = ((y0+nPrec)/y1)*x1 - x0;
- y2 = ((y0+nPrec)/y1)*y1 - y0;
-}
-*/
+
sal_uLong SvNumberformat::ImpGGT(sal_uLong x, sal_uLong y)
{
if (y == 0)
@@ -2417,7 +2409,6 @@ sal_Bool SvNumberformat::GetOutputString(double fNumber,
{
sal_uLong x2 = ((y0+nBasis)/y1)*x1 - x0; // naechste Farey-Zahl
sal_uLong y2 = ((y0+nBasis)/y1)*y1 - y0;
-// GetNextFareyNumber(nBasis, x0, x1, y0, y1, x2, y2);
x0 = x1;
y0 = y1;
x1 = x2;
@@ -2446,11 +2437,6 @@ sal_Bool SvNumberformat::GetOutputString(double fNumber,
else // grosse Nenner
{ // 0,1234->123/1000
sal_uLong nGgt;
-/*
- nDiv = nBasis+1;
- nFrac = ((sal_uLong)floor(0.5 + fNumber *
- pow(10.0,rInfo.nCntExp)));
-*/
nDiv = 10000000;
nFrac = ((sal_uLong)floor(0.5 + fNumber * 10000000.0));
nGgt = ImpGGT(nDiv, nFrac);
@@ -4421,7 +4407,6 @@ String SvNumberformat::GetMappedFormatstring(
case NF_SYMBOLTYPE_CALDEL :
if ( pStr[j+1].EqualsAscii("buddhist") )
{
- //aStr.InsertAscii( "[$-", aStr.Len() );
aStr.InsertAscii( "[$-", 0 );
if ( rNum.IsSet() && rNum.GetNatNum() == 1 &&
MsLangId::getRealLanguage( rNum.GetLang() ) ==
diff --git a/svl/source/passwordcontainer/passwordcontainer.component b/svl/source/passwordcontainer/passwordcontainer.component
index 42eb47cf14dd..3fc55af1861e 100644
--- a/svl/source/passwordcontainer/passwordcontainer.component
+++ b/svl/source/passwordcontainer/passwordcontainer.component
@@ -26,7 +26,7 @@
*
**********************************************************************-->
-<component loader="com.sun.star.loader.SharedLibrary"
+<component loader="com.sun.star.loader.SharedLibrary" prefix="passwordcontainer"
xmlns="http://openoffice.org/2010/uno-components">
<implementation name="stardiv.svl.PasswordContainer">
<service name="com.sun.star.task.PasswordContainer"/>
diff --git a/svl/source/passwordcontainer/passwordcontainer.cxx b/svl/source/passwordcontainer/passwordcontainer.cxx
index 6e922ea29cd7..86c72fb3619b 100644
--- a/svl/source/passwordcontainer/passwordcontainer.cxx
+++ b/svl/source/passwordcontainer/passwordcontainer.cxx
@@ -1538,13 +1538,7 @@ MasterPasswordRequest_Impl::MasterPasswordRequest_Impl( PasswordRequestMode Mode
extern "C"
{
-SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment (
- const sal_Char ** ppEnvTypeName, uno_Environment ** /* ppEnv */)
-{
- *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
-}
-
-SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory (
+SAL_DLLPUBLIC_EXPORT void * SAL_CALL passwordcontainer_component_getFactory (
const sal_Char * pImplementationName, void * pServiceManager, void * /* pRegistryKey */)
{
void * pResult = 0;
diff --git a/svl/source/svdde/ddesvr.cxx b/svl/source/svdde/ddesvr.cxx
index 99b8cce0ae71..08894db00556 100644
--- a/svl/source/svdde/ddesvr.cxx
+++ b/svl/source/svdde/ddesvr.cxx
@@ -88,7 +88,6 @@ HDDEDATA CALLBACK _export DdeInternal::SvrCallback(
{
int nTopics = 0;
-#if 1
TCHAR chTopicBuf[250];
if( hText1 )
DdeQueryString( pInst->hDdeInstSvr, hText1, chTopicBuf,
@@ -117,20 +116,6 @@ HDDEDATA CALLBACK _export DdeInternal::SvrCallback(
}
}
-#else
- for( pService = rAll.First();pService;pService = rAll.Next() )
- {
- if ( !hText2 || ( *pService->pName == hText2 ) )
- {
- std::vector<DdeTopic*>::const_iterator iter;
- for (iter = pService->aTopics.begin(); iter != pService->aTopics.end(); ++iter)
- {
- if ( !hText1 || iter->pName == hText1 )
- nTopics++;
- }
- }
- }
-#endif
if( !nTopics )
return (HDDEDATA)NULL;
@@ -143,18 +128,6 @@ HDDEDATA CALLBACK _export DdeInternal::SvrCallback(
{
if ( !hText2 || (*pService->pName == hText2 ) )
{
-#if 0
- for ( pTopic = pService->aTopics.First(); pTopic;
- pTopic = pService->aTopics.Next() )
- {
- if ( !hText1 || (*pTopic->pName == hText1) )
- {
- q->hszSvc = *pService->pName;
- q->hszTopic = *pTopic->pName;
- q++;
- }
- }
-#else
String sTopics( pService->Topics() );
sal_uInt16 n = 0;
while( STRING_NOTFOUND != n )
@@ -173,8 +146,6 @@ HDDEDATA CALLBACK _export DdeInternal::SvrCallback(
}
}
}
-
-#endif
}
}
diff --git a/svl/source/uno/registerservices.cxx b/svl/source/uno/registerservices.cxx
index 5caca580694f..d001c73da633 100644
--- a/svl/source/uno/registerservices.cxx
+++ b/svl/source/uno/registerservices.cxx
@@ -55,13 +55,7 @@ DECLARE_CREATEINSTANCE( PathService )
extern "C"
{
-SVL_DLLPUBLIC void SAL_CALL component_getImplementationEnvironment (
- const sal_Char ** ppEnvTypeName, uno_Environment ** /* ppEnv */)
-{
- *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
-}
-
-SVL_DLLPUBLIC void* SAL_CALL component_getFactory (
+SVL_DLLPUBLIC void* SAL_CALL svl_component_getFactory (
const sal_Char * pImplementationName, void * _pServiceManager, void * /* _pRegistryKey*/)
{
void * pResult = 0;