summaryrefslogtreecommitdiffstats
path: root/svl/source/misc
diff options
context:
space:
mode:
Diffstat (limited to 'svl/source/misc')
-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
6 files changed, 34 insertions, 553 deletions
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: */