summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-03-28 12:30:11 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-03-28 13:08:59 +0100
commit38814653ba6b76a6d6b4603c037cb52e0be300e8 (patch)
tree474d8e7e432a0428737bac9647347c126ff53fe5
parentd2ed905c85301e2124125ad7701ab85ced7e2bee (diff)
remove static OUStrings from static_initialization_and_destruction chain
-rw-r--r--svx/source/fmcomp/gridcell.cxx15
-rw-r--r--unotools/source/config/lingucfg.cxx27
-rw-r--r--xmlscript/source/xmllib_imexp/xmllib_export.cxx20
3 files changed, 33 insertions, 29 deletions
diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx
index 66c51c313dd9..f807cccdfedd 100644
--- a/svx/source/fmcomp/gridcell.cxx
+++ b/svx/source/fmcomp/gridcell.cxx
@@ -92,9 +92,8 @@ using namespace ::com::sun::star::form;
using ::com::sun::star::util::XNumberFormatter;
namespace MouseWheelBehavior = ::com::sun::star::awt::MouseWheelBehavior;
-String INVALIDTEXT = String::CreateFromAscii("###");
-String OBJECTTEXT = String::CreateFromAscii("<OBJECT>");
- // TODO: resource
+const char INVALIDTEXT[] = "###";
+const char OBJECTTEXT[] = "<OBJECT>";
//==================================================================
//= helper
@@ -423,7 +422,7 @@ String DbGridColumn::GetCellText(const DbGridRow* pRow, const Reference< XNumber
return aText;
if (!pRow || !pRow->IsValid())
- aText = INVALIDTEXT;
+ aText = rtl::OUString(INVALIDTEXT);
else if (pRow->HasField(m_nFieldPos))
{
aText = GetCellText( pRow->GetField( m_nFieldPos ).getColumn(), xFormatter );
@@ -441,7 +440,7 @@ String DbGridColumn::GetCellText(const Reference< ::com::sun::star::sdb::XColumn
if (pTextCell)
aText = pTextCell->GetText(xField, xFormatter);
else if (m_bObject)
- aText = OBJECTTEXT;
+ aText = rtl::OUString(OBJECTTEXT);
}
return aText;
}
@@ -476,7 +475,7 @@ void DbGridColumn::Paint(OutputDevice& rDev,
if ( !bEnabled )
nStyle |= TEXT_DRAW_DISABLE;
- rDev.DrawText(rRect, INVALIDTEXT, nStyle);
+ rDev.DrawText(rRect, rtl::OUString(INVALIDTEXT), nStyle);
}
else if (m_bAutoValue && pRow->IsNew())
{
@@ -512,14 +511,14 @@ void DbGridColumn::Paint(OutputDevice& rDev,
if ( !bEnabled )
nStyle |= TEXT_DRAW_DISABLE;
- rDev.DrawText(rRect, INVALIDTEXT, nStyle);
+ rDev.DrawText(rRect, rtl::OUString(INVALIDTEXT), nStyle);
}
else if (pRow->HasField(m_nFieldPos) && m_bObject)
{
sal_uInt16 nStyle = TEXT_DRAW_CLIP | TEXT_DRAW_CENTER;
if ( !bEnabled )
nStyle |= TEXT_DRAW_DISABLE;
- rDev.DrawText(rRect, OBJECTTEXT, nStyle);
+ rDev.DrawText(rRect, rtl::OUString(OBJECTTEXT), nStyle);
}
}
else if ( m_pCell->ISA( FmXFilterCell ) )
diff --git a/unotools/source/config/lingucfg.cxx b/unotools/source/config/lingucfg.cxx
index 866e142f1788..5e60a3d4d797 100644
--- a/unotools/source/config/lingucfg.cxx
+++ b/unotools/source/config/lingucfg.cxx
@@ -810,13 +810,12 @@ sal_Bool SvtLinguConfigItem::IsReadOnly( sal_Int32 nPropertyHandle ) const
static SvtLinguConfigItem *pCfgItem = 0;
static sal_Int32 nCfgItemRefCount = 0;
-static const rtl::OUString aG_SupportedDictionaryFormats(RTL_CONSTASCII_USTRINGPARAM("SupportedDictionaryFormats"));
-static const rtl::OUString aG_Dictionaries(RTL_CONSTASCII_USTRINGPARAM("Dictionaries"));
-static const rtl::OUString aG_Locations(RTL_CONSTASCII_USTRINGPARAM("Locations"));
-static const rtl::OUString aG_Format(RTL_CONSTASCII_USTRINGPARAM("Format"));
-static const rtl::OUString aG_Locales(RTL_CONSTASCII_USTRINGPARAM("Locales"));
-static const rtl::OUString aG_DisabledDictionaries(RTL_CONSTASCII_USTRINGPARAM("DisabledDictionaries"));
-static const rtl::OUString aG_LastActiveDictionaries(RTL_CONSTASCII_USTRINGPARAM("LastActiveDictionaries"));
+static const char aG_SupportedDictionaryFormats[] = "SupportedDictionaryFormats";
+static const char aG_Dictionaries[] = "Dictionaries";
+static const char aG_Locations[] = "Locations";
+static const char aG_Format[] = "Format";
+static const char aG_Locales[] = "Locales";
+static const char aG_DisabledDictionaries[] = "DisabledDictionaries";
SvtLinguConfig::SvtLinguConfig()
{
@@ -932,7 +931,7 @@ sal_Bool SvtLinguConfig::GetSupportedDictionaryFormatsFor(
xNA.set( xNA->getByName(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ServiceManager"))), uno::UNO_QUERY_THROW );
xNA.set( xNA->getByName( rSetName ), uno::UNO_QUERY_THROW );
xNA.set( xNA->getByName( rSetEntry ), uno::UNO_QUERY_THROW );
- if (xNA->getByName( aG_SupportedDictionaryFormats ) >>= rFormatList)
+ if (xNA->getByName( rtl::OUString(aG_SupportedDictionaryFormats) ) >>= rFormatList)
bSuccess = true;
DBG_ASSERT( rFormatList.getLength(), "supported dictionary format list is empty" );
}
@@ -1018,16 +1017,16 @@ sal_Bool SvtLinguConfig::GetDictionaryEntry(
{
uno::Reference< container::XNameAccess > xNA( GetMainUpdateAccess(), uno::UNO_QUERY_THROW );
xNA.set( xNA->getByName(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ServiceManager"))), uno::UNO_QUERY_THROW );
- xNA.set( xNA->getByName( aG_Dictionaries ), uno::UNO_QUERY_THROW );
+ xNA.set( xNA->getByName(rtl::OUString(aG_Dictionaries)), uno::UNO_QUERY_THROW );
xNA.set( xNA->getByName( rNodeName ), uno::UNO_QUERY_THROW );
// read group data...
uno::Sequence< rtl::OUString > aLocations;
rtl::OUString aFormatName;
uno::Sequence< rtl::OUString > aLocaleNames;
- bSuccess = (xNA->getByName( aG_Locations ) >>= aLocations) &&
- (xNA->getByName( aG_Format ) >>= aFormatName) &&
- (xNA->getByName( aG_Locales ) >>= aLocaleNames);
+ bSuccess = (xNA->getByName( rtl::OUString(aG_Locations) ) >>= aLocations) &&
+ (xNA->getByName( rtl::OUString(aG_Format) ) >>= aFormatName) &&
+ (xNA->getByName( rtl::OUString(aG_Locales) ) >>= aLocaleNames);
DBG_ASSERT( aLocations.getLength(), "Dictionary locations not set" );
DBG_ASSERT( !aFormatName.isEmpty(), "Dictionary format name not set" );
DBG_ASSERT( aLocaleNames.getLength(), "No locales set for the dictionary" );
@@ -1066,7 +1065,7 @@ uno::Sequence< rtl::OUString > SvtLinguConfig::GetDisabledDictionaries() const
{
uno::Reference< container::XNameAccess > xNA( GetMainUpdateAccess(), uno::UNO_QUERY_THROW );
xNA.set( xNA->getByName(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ServiceManager"))), uno::UNO_QUERY_THROW );
- xNA->getByName( aG_DisabledDictionaries ) >>= aResult;
+ xNA->getByName( rtl::OUString(aG_DisabledDictionaries) ) >>= aResult;
}
catch (uno::Exception &)
{
@@ -1084,7 +1083,7 @@ std::vector< SvtLinguConfigDictionaryEntry > SvtLinguConfig::GetActiveDictionari
try
{
uno::Sequence< rtl::OUString > aElementNames;
- GetElementNamesFor( aG_Dictionaries, aElementNames );
+ GetElementNamesFor( rtl::OUString(aG_Dictionaries), aElementNames );
sal_Int32 nLen = aElementNames.getLength();
const rtl::OUString *pElementNames = aElementNames.getConstArray();
diff --git a/xmlscript/source/xmllib_imexp/xmllib_export.cxx b/xmlscript/source/xmllib_imexp/xmllib_export.cxx
index 97f42c95b7a0..e20f335e17fa 100644
--- a/xmlscript/source/xmllib_imexp/xmllib_export.cxx
+++ b/xmlscript/source/xmllib_imexp/xmllib_export.cxx
@@ -38,8 +38,8 @@ using ::rtl::OUString;
namespace xmlscript
{
-static OUString aTrueStr ( RTL_CONSTASCII_USTRINGPARAM("true") );
-static OUString aFalseStr( RTL_CONSTASCII_USTRINGPARAM("false") );
+const char aTrueStr[] = "true";
+const char aFalseStr[] = "false";
//##################################################################################################
@@ -74,6 +74,9 @@ SAL_CALL exportLibraryContainer(
xOut->ignorableWhitespace( OUString() );
xOut->startElement( aLibrariesName, xAttributes );
+ rtl::OUString sTrueStr(aTrueStr);
+ rtl::OUString sFalseStr(aFalseStr);
+
int nLibCount = pLibArray->mnLibCount;
for( sal_Int32 i = 0 ; i < nLibCount ; i++ )
{
@@ -97,12 +100,12 @@ SAL_CALL exportLibraryContainer(
}
pLibElement->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_LIBRARY_PREFIX ":link") ),
- rLib.bLink ? aTrueStr : aFalseStr );
+ rLib.bLink ? sTrueStr : sFalseStr );
if( rLib.bLink )
{
pLibElement->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_LIBRARY_PREFIX ":readonly") ),
- rLib.bReadOnly ? aTrueStr : aFalseStr );
+ rLib.bReadOnly ? sTrueStr : sFalseStr );
}
pLibElement->dump( xOut.get() );
@@ -141,14 +144,17 @@ SAL_CALL exportLibrary(
pLibElement->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_LIBRARY_PREFIX ":name") ),
rLib.aName );
+ rtl::OUString sTrueStr(aTrueStr);
+ rtl::OUString sFalseStr(aFalseStr);
+
pLibElement->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_LIBRARY_PREFIX ":readonly") ),
- rLib.bReadOnly ? aTrueStr : aFalseStr );
+ rLib.bReadOnly ? sTrueStr : sFalseStr );
pLibElement->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_LIBRARY_PREFIX ":passwordprotected") ),
- rLib.bPasswordProtected ? aTrueStr : aFalseStr );
+ rLib.bPasswordProtected ? sTrueStr : sFalseStr );
if( rLib.bPreload )
- pLibElement->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_LIBRARY_PREFIX ":preload") ), aTrueStr );
+ pLibElement->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_LIBRARY_PREFIX ":preload") ), sTrueStr );
sal_Int32 nElementCount = rLib.aElementNames.getLength();
if( nElementCount )