summaryrefslogtreecommitdiff
path: root/unotools/source/misc
diff options
context:
space:
mode:
Diffstat (limited to 'unotools/source/misc')
-rw-r--r--unotools/source/misc/atom.cxx29
-rw-r--r--unotools/source/misc/componentresmodule.cxx3
-rw-r--r--unotools/source/misc/datetime.cxx2
-rw-r--r--unotools/source/misc/desktopterminationobserver.cxx4
-rw-r--r--unotools/source/misc/eventlisteneradapter.cxx5
-rw-r--r--unotools/source/misc/fontcvt.cxx11
-rw-r--r--unotools/source/misc/fontdefs.cxx16
-rw-r--r--unotools/source/misc/sharedunocomponent.cxx13
-rw-r--r--unotools/source/misc/syslocale.cxx4
9 files changed, 58 insertions, 29 deletions
diff --git a/unotools/source/misc/atom.cxx b/unotools/source/misc/atom.cxx
index 3d7ccd1dd10e..d8bf5bbfa053 100644
--- a/unotools/source/misc/atom.cxx
+++ b/unotools/source/misc/atom.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -46,7 +47,7 @@ AtomProvider::~AtomProvider()
int AtomProvider::getAtom( const ::rtl::OUString& rString, sal_Bool bCreate )
{
- ::std::hash_map< ::rtl::OUString, int, ::rtl::OUStringHash >::iterator it = m_aAtomMap.find( rString );
+ ::boost::unordered_map< ::rtl::OUString, int, ::rtl::OUStringHash >::iterator it = m_aAtomMap.find( rString );
if( it != m_aAtomMap.end() )
return it->second;
if( ! bCreate )
@@ -60,7 +61,7 @@ int AtomProvider::getAtom( const ::rtl::OUString& rString, sal_Bool bCreate )
void AtomProvider::getAll( ::std::list< ::utl::AtomDescription >& atoms )
{
atoms.clear();
- ::std::hash_map< ::rtl::OUString, int, ::rtl::OUStringHash >::const_iterator it = m_aAtomMap.begin();
+ ::boost::unordered_map< ::rtl::OUString, int, ::rtl::OUStringHash >::const_iterator it = m_aAtomMap.begin();
::utl::AtomDescription aDesc;
while( it != m_aAtomMap.end() )
@@ -76,7 +77,7 @@ void AtomProvider::getRecent( int atom, ::std::list< ::utl::AtomDescription >& a
{
atoms.clear();
- ::std::hash_map< ::rtl::OUString, int, ::rtl::OUStringHash >::const_iterator it = m_aAtomMap.begin();
+ ::boost::unordered_map< ::rtl::OUString, int, ::rtl::OUStringHash >::const_iterator it = m_aAtomMap.begin();
::utl::AtomDescription aDesc;
while( it != m_aAtomMap.end() )
@@ -94,7 +95,7 @@ void AtomProvider::getRecent( int atom, ::std::list< ::utl::AtomDescription >& a
const ::rtl::OUString& AtomProvider::getString( int nAtom ) const
{
static ::rtl::OUString aEmpty;
- ::std::hash_map< int, ::rtl::OUString, ::std::hash< int > >::const_iterator it = m_aStringMap.find( nAtom );
+ ::boost::unordered_map< int, ::rtl::OUString, ::boost::hash< int > >::const_iterator it = m_aStringMap.find( nAtom );
return it == m_aStringMap.end() ? aEmpty : it->second;
}
@@ -120,14 +121,14 @@ MultiAtomProvider::MultiAtomProvider()
MultiAtomProvider::~MultiAtomProvider()
{
- for( ::std::hash_map< int, AtomProvider*, ::std::hash< int > >::iterator it = m_aAtomLists.begin(); it != m_aAtomLists.end(); ++it )
+ for( ::boost::unordered_map< int, AtomProvider*, ::boost::hash< int > >::iterator it = m_aAtomLists.begin(); it != m_aAtomLists.end(); ++it )
delete it->second;
}
sal_Bool MultiAtomProvider::insertAtomClass( int atomClass )
{
- ::std::hash_map< int, AtomProvider*, ::std::hash< int > >::iterator it =
+ ::boost::unordered_map< int, AtomProvider*, ::boost::hash< int > >::iterator it =
m_aAtomLists.find( atomClass );
if( it != m_aAtomLists.end() )
return sal_False;
@@ -137,7 +138,7 @@ sal_Bool MultiAtomProvider::insertAtomClass( int atomClass )
int MultiAtomProvider::getAtom( int atomClass, const ::rtl::OUString& rString, sal_Bool bCreate )
{
- ::std::hash_map< int, AtomProvider*, ::std::hash< int > >::iterator it =
+ ::boost::unordered_map< int, AtomProvider*, ::boost::hash< int > >::iterator it =
m_aAtomLists.find( atomClass );
if( it != m_aAtomLists.end() )
return it->second->getAtom( rString, bCreate );
@@ -153,7 +154,7 @@ int MultiAtomProvider::getAtom( int atomClass, const ::rtl::OUString& rString, s
int MultiAtomProvider::getLastAtom( int atomClass ) const
{
- ::std::hash_map< int, AtomProvider*, ::std::hash< int > >::const_iterator it =
+ ::boost::unordered_map< int, AtomProvider*, ::boost::hash< int > >::const_iterator it =
m_aAtomLists.find( atomClass );
return it != m_aAtomLists.end() ? it->second->getLastAtom() : INVALID_ATOM;
@@ -161,7 +162,7 @@ int MultiAtomProvider::getLastAtom( int atomClass ) const
void MultiAtomProvider::getRecent( int atomClass, int atom, ::std::list< ::utl::AtomDescription >& atoms )
{
- ::std::hash_map< int, AtomProvider*, ::std::hash< int > >::const_iterator it =
+ ::boost::unordered_map< int, AtomProvider*, ::boost::hash< int > >::const_iterator it =
m_aAtomLists.find( atomClass );
if( it != m_aAtomLists.end() )
it->second->getRecent( atom, atoms );
@@ -171,7 +172,7 @@ void MultiAtomProvider::getRecent( int atomClass, int atom, ::std::list< ::utl::
const ::rtl::OUString& MultiAtomProvider::getString( int atomClass, int atom ) const
{
- ::std::hash_map< int, AtomProvider*, ::std::hash< int > >::const_iterator it =
+ ::boost::unordered_map< int, AtomProvider*, ::boost::hash< int > >::const_iterator it =
m_aAtomLists.find( atomClass );
if( it != m_aAtomLists.end() )
return it->second->getString( atom );
@@ -182,13 +183,13 @@ const ::rtl::OUString& MultiAtomProvider::getString( int atomClass, int atom ) c
sal_Bool MultiAtomProvider::hasAtom( int atomClass, int atom ) const
{
- ::std::hash_map< int, AtomProvider*, ::std::hash< int > >::const_iterator it = m_aAtomLists.find( atomClass );
+ ::boost::unordered_map< int, AtomProvider*, ::boost::hash< int > >::const_iterator it = m_aAtomLists.find( atomClass );
return it != m_aAtomLists.end() ? it->second->hasAtom( atom ) : sal_False;
}
void MultiAtomProvider::getClass( int atomClass, ::std::list< ::utl::AtomDescription >& atoms) const
{
- ::std::hash_map< int, AtomProvider*, ::std::hash< int > >::const_iterator it = m_aAtomLists.find( atomClass );
+ ::boost::unordered_map< int, AtomProvider*, ::boost::hash< int > >::const_iterator it = m_aAtomLists.find( atomClass );
if( it != m_aAtomLists.end() )
it->second->getAll( atoms );
@@ -198,7 +199,7 @@ void MultiAtomProvider::getClass( int atomClass, ::std::list< ::utl::AtomDescrip
void MultiAtomProvider::overrideAtom( int atomClass, int atom, const ::rtl::OUString& description )
{
- ::std::hash_map< int, AtomProvider*, ::std::hash< int > >::const_iterator it = m_aAtomLists.find( atomClass );
+ ::boost::unordered_map< int, AtomProvider*, ::boost::hash< int > >::const_iterator it = m_aAtomLists.find( atomClass );
if( it == m_aAtomLists.end() )
m_aAtomLists[ atomClass ] = new AtomProvider();
m_aAtomLists[ atomClass ]->overrideAtom( atom, description );
@@ -381,3 +382,5 @@ void AtomClient::updateAtomClasses( const Sequence< sal_Int32 >& atomClasses )
m_aProvider.overrideAtom( nClass, pDesc->atom, pDesc->description );
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/misc/componentresmodule.cxx b/unotools/source/misc/componentresmodule.cxx
index 21c50d9ec7f1..ea99f394aadf 100644
--- a/unotools/source/misc/componentresmodule.cxx
+++ b/unotools/source/misc/componentresmodule.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -144,3 +145,5 @@ namespace utl
//........................................................................
} // namespace utl
//........................................................................
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/misc/datetime.cxx b/unotools/source/misc/datetime.cxx
index 6bfd053b3fe9..428cc05f3cb3 100644
--- a/unotools/source/misc/datetime.cxx
+++ b/unotools/source/misc/datetime.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -119,3 +120,4 @@ sal_Bool operator ==(const starutil::Time& _rLeft, const starutil::Time& _rRi
} // namespace utl
//.........................................................................
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/misc/desktopterminationobserver.cxx b/unotools/source/misc/desktopterminationobserver.cxx
index 3900449f03c9..b9f457792dde 100644
--- a/unotools/source/misc/desktopterminationobserver.cxx
+++ b/unotools/source/misc/desktopterminationobserver.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -122,7 +123,7 @@ namespace utl
}
catch( const Exception& )
{
- OSL_ENSURE( sal_False, "OObserverImpl::ensureObservation: caught an exception!" );
+ OSL_FAIL( "OObserverImpl::ensureObservation: caught an exception!" );
}
}
@@ -229,3 +230,4 @@ namespace utl
} // namespace utl
//........................................................................
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/misc/eventlisteneradapter.cxx b/unotools/source/misc/eventlisteneradapter.cxx
index 0e14a54cd3c0..4ee8c8430027 100644
--- a/unotools/source/misc/eventlisteneradapter.cxx
+++ b/unotools/source/misc/eventlisteneradapter.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -168,7 +169,7 @@ namespace utl
{
if (!_rxComp.is())
{
- OSL_ENSURE(sal_False, "OEventListenerAdapter::startComponentListening: invalid component!");
+ OSL_FAIL("OEventListenerAdapter::startComponentListening: invalid component!");
return;
}
@@ -180,3 +181,5 @@ namespace utl
//.........................................................................
} // namespace utl
//.........................................................................
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/misc/fontcvt.cxx b/unotools/source/misc/fontcvt.cxx
index b7e3b452483a..00f4ffce1e6b 100644
--- a/unotools/source/misc/fontcvt.cxx
+++ b/unotools/source/misc/fontcvt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,6 +30,7 @@
#include "precompiled_unotools.hxx"
#include <unotools/fontcvt.hxx>
#include <unotools/fontdefs.hxx>
+#include <sal/macros.h>
#ifndef _STLP_MAP
#include <map>
@@ -1187,7 +1189,7 @@ StarSymbolToMSMultiFontImpl::StarSymbolToMSMultiFontImpl(bool bPerfectOnly)
//Reverse map from a given starsymbol char to exact matches in ms symbol
//fonts.
- int nEntries = sizeof(aConservativeTable) / sizeof(aConservativeTable[0]);
+ int nEntries = SAL_N_ELEMENTS(aConservativeTable);
int i;
for (i = 0; i < nEntries; ++i)
{
@@ -1218,7 +1220,7 @@ StarSymbolToMSMultiFontImpl::StarSymbolToMSMultiFontImpl(bool bPerfectOnly)
//Allow extra conversions that are not perfect, but "good enough"
if (!bPerfectOnly)
- nEntries = sizeof(aAgressiveTable) / sizeof(aAgressiveTable[0]);
+ nEntries = SAL_N_ELEMENTS(aAgressiveTable);
else
nEntries = 1;
@@ -1438,7 +1440,7 @@ const ConvertChar* ConvertChar::GetRecodeData( const String& rOrgFontName, const
if( aMapName.EqualsAscii( "starsymbol" )
|| aMapName.EqualsAscii( "opensymbol" ) )
{
- int nEntries = sizeof(aRecodeTable) / sizeof(aRecodeTable[0]);
+ int nEntries = SAL_N_ELEMENTS(aRecodeTable);
for( int i = 0; i < nEntries; ++i)
{
RecodeTable& r = aRecodeTable[i];
@@ -1469,7 +1471,7 @@ FontToSubsFontConverter CreateFontToSubsFontConverter(
if ( nFlags & FONTTOSUBSFONT_IMPORT )
{
- int nEntries = sizeof(aRecodeTable) / sizeof(aRecodeTable[0]);
+ int nEntries = SAL_N_ELEMENTS(aRecodeTable);
if ( nFlags & FONTTOSUBSFONT_ONLYOLDSOSYMBOLFONTS ) // only StarMath+StarBats
nEntries = 2;
for( int i = 0; i < nEntries; ++i )
@@ -1518,3 +1520,4 @@ String GetFontToSubsFontName( FontToSubsFontConverter hConverter )
return String::CreateFromAscii( pName );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/misc/fontdefs.cxx b/unotools/source/misc/fontdefs.cxx
index c93175ed1c73..d51c30ec7f58 100644
--- a/unotools/source/misc/fontdefs.cxx
+++ b/unotools/source/misc/fontdefs.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,7 +30,7 @@
#include "precompiled_unotools.hxx"
#include <unotools/fontdefs.hxx>
#include <unotools/fontcfg.hxx>
-#include <hash_map>
+#include <boost/unordered_map.hpp>
struct ImplLocalizedFontName
{
@@ -90,6 +91,10 @@ static sal_Unicode const aIPAPMincho[] = { 'i', 'p', 'a', 'p', 0x660E, 0x671D, 0
static sal_Unicode const aIPAGothic[] = { 'i', 'p', 'a', 0x30B4, 0x30B7, 0x30C3, 0x30AF, 0 };
static sal_Unicode const aIPAPGothic[] = { 'i', 'p', 'a', 'p', 0x30B4, 0x30B7, 0x30C3, 0x30AF, 0 };
static sal_Unicode const aIPAUIGothic[] = { 'i', 'p', 'a', 'u', 'i', 0x30B4, 0x30B7, 0x30C3, 0x30AF, 0 };
+static sal_Unicode const aTakaoMincho[] = { 't', 'a', 'k', 'a', 'o', 0x660E, 0x671D, 0 };
+static sal_Unicode const aTakaoPMincho[] = { 't', 'a', 'k', 'a', 'o', 'p', 0x660E, 0x671D, 0 };
+static sal_Unicode const aTakaoGothic[] = { 't', 'a', 'k', 'a', 'o', 0x30B4, 0x30B7, 0x30C3, 0x30AF, 0 };
+static sal_Unicode const aTakaoPGothic[] = { 't', 'a', 'k', 'a', 'o', 'p', 0x30B4, 0x30B7, 0x30C3, 0x30AF, 0 };
static sal_Unicode const aSazanamiMincho[] = { 0x3055, 0x3056, 0x306A, 0x307F, 0x660E, 0x671D, 0, 0 };
static sal_Unicode const aSazanamiGothic[] = { 0x3055, 0x3056, 0x306A, 0x307F, 0x30B4, 0x30B7, 0x30C3, 0x30AF, 0, 0 };
static sal_Unicode const aKochiMincho[] = { 0x6771, 0x98A8, 0x660E, 0x671D, 0, 0 };
@@ -235,6 +240,10 @@ static ImplLocalizedFontName aImplLocalizedNamesList[] =
{ "ipagothic", aIPAGothic },
{ "ipapgothic", aIPAPGothic },
{ "ipauigothic", aIPAUIGothic },
+{ "takaomincho", aTakaoMincho },
+{ "takaopmincho", aTakaoPMincho },
+{ "takaogothic", aTakaoGothic },
+{ "takaopgothic", aTakaoPGothic },
{ "sazanamimincho", aSazanamiMincho },
{ "sazanamigothic", aSazanamiGothic },
{ "kochimincho", aKochiMincho },
@@ -412,7 +421,7 @@ void GetEnglishSearchFontName( String& rName )
// translate normalized localized name to its normalized English ASCII name
if( bNeedTranslation )
{
- typedef std::hash_map<const String, const char*,FontNameHash> FontNameDictionary;
+ typedef boost::unordered_map<const String, const char*,FontNameHash> FontNameDictionary;
static FontNameDictionary aDictionary( sizeof(aImplLocalizedNamesList) / sizeof(*aImplLocalizedNamesList) );
// the font name dictionary needs to be intialized once
if( aDictionary.empty() )
@@ -533,7 +542,7 @@ String GetSubsFontName( const String& rName, sal_uLong nFlags )
|| aOrgName.EqualsAscii( "opensymbol" ) ) )
return aName;
- const utl::FontNameAttr* pAttr = utl::FontSubstConfiguration::get()->getSubstInfo( aOrgName );
+ const utl::FontNameAttr* pAttr = utl::FontSubstConfiguration::get().getSubstInfo( aOrgName );
if ( pAttr )
{
for( int i = 0; i < 3; i++ )
@@ -596,3 +605,4 @@ int FontNameHash::operator()( const String& rStr ) const
return nHash;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/misc/sharedunocomponent.cxx b/unotools/source/misc/sharedunocomponent.cxx
index 5402ebc06085..8da98aa34954 100644
--- a/unotools/source/misc/sharedunocomponent.cxx
+++ b/unotools/source/misc/sharedunocomponent.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -70,7 +71,7 @@ namespace utl
}
catch( const Exception& )
{
- OSL_ENSURE( sal_False, "DisposableComponent::~DisposableComponent: caught an exception!" );
+ OSL_FAIL( "DisposableComponent::~DisposableComponent: caught an exception!" );
}
m_xComponent.clear();
}
@@ -156,7 +157,7 @@ namespace utl
catch( const CloseVetoException& ) { /* fine */ }
catch( const Exception& )
{
- OSL_ENSURE( sal_False, "CloseableComponentImpl::nf_closeComponent: caught an unexpected exception!" );
+ OSL_FAIL( "CloseableComponentImpl::nf_closeComponent: caught an unexpected exception!" );
}
// reset
@@ -178,7 +179,7 @@ namespace utl
}
catch( const Exception& )
{
- OSL_ENSURE( sal_False, "CloseableComponentImpl::impl_nf_switchListening: caught an exception!" );
+ OSL_FAIL( "CloseableComponentImpl::impl_nf_switchListening: caught an exception!" );
}
}
@@ -207,7 +208,7 @@ namespace utl
// this should be unreachable: As long as we're a CloseListener, we veto the closing. If we're going
// to close the component ourself, then we revoke ourself as listener *before* the close call. So,
// if this here fires, something went definately wrong.
- DBG_ERROR( "CloseableComponentImpl::notifyClosing: unreachable!" );
+ OSL_FAIL( "CloseableComponentImpl::notifyClosing: unreachable!" );
}
//--------------------------------------------------------------------
@@ -218,7 +219,7 @@ namespace utl
) throw (RuntimeException)
{
DBG_ASSERT( Source.Source == m_xCloseable, "CloseableComponentImpl::disposing: where did this come from?" );
- DBG_ERROR( "CloseableComponentImpl::disposing: unreachable!" );
+ OSL_FAIL( "CloseableComponentImpl::disposing: unreachable!" );
// same reasoning for this assertion as in ->notifyClosing
}
@@ -244,3 +245,5 @@ namespace utl
//............................................................................
} // namespace utl
//............................................................................
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/misc/syslocale.cxx b/unotools/source/misc/syslocale.cxx
index f51ef35512cb..f5382b2c2074 100644
--- a/unotools/source/misc/syslocale.cxx
+++ b/unotools/source/misc/syslocale.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,8 +28,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_unotools.hxx"
-#ifndef GCC
-#endif
#include <unotools/syslocale.hxx>
#include <tools/string.hxx>
@@ -212,3 +211,4 @@ rtl_TextEncoding SvtSysLocale::GetBestMimeEncoding()
return nRet;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */