Kaydet (Commit) cf5593ae authored tarafından Miklos Vajna's avatar Miklos Vajna

cui: kill C2U and UNISTRING macros

Change-Id: I69d883e623f7fffd37c05b85a6655009da9c23a8
üst b29ecc91
......@@ -44,8 +44,6 @@ using namespace com::sun::star::frame;
using namespace com::sun::star::beans;
using rtl::OUString;
#define C2U(cChar) rtl::OUString::createFromAscii(cChar)
const sal_Char cIsKernAsianPunctuation[] = "IsKernAsianPunctuation";
const sal_Char cCharacterCompressionType[] = "CharacterCompressionType";
......@@ -171,7 +169,7 @@ sal_Bool SvxAsianLayoutPage::FillItemSet( SfxItemSet& )
if(aCharKerningRB.IsChecked() != aCharKerningRB.GetSavedValue())
{
pImpl->aConfig.SetKerningWesternTextOnly(aCharKerningRB.IsChecked());
OUString sPunct(C2U(cIsKernAsianPunctuation));
OUString sPunct(cIsKernAsianPunctuation);
if(pImpl->xPrSetInfo.is() && pImpl->xPrSetInfo->hasPropertyByName(sPunct))
{
Any aVal;
......@@ -187,7 +185,7 @@ sal_Bool SvxAsianLayoutPage::FillItemSet( SfxItemSet& )
sal_Int16 nSet = aNoCompressionRB.IsChecked() ? 0 :
aPunctCompressionRB.IsChecked() ? 1 : 2;
pImpl->aConfig.SetCharDistanceCompression(nSet);
OUString sCompress(C2U(cCharacterCompressionType));
OUString sCompress(cCharacterCompressionType);
if(pImpl->xPrSetInfo.is() && pImpl->xPrSetInfo->hasPropertyByName(sCompress))
{
Any aVal;
......@@ -233,11 +231,11 @@ void SvxAsianLayoutPage::Reset( const SfxItemSet& )
if(xFact.is())
{
pImpl->xPrSet = Reference<XPropertySet>(
xFact->createInstance(C2U("com.sun.star.document.Settings")), UNO_QUERY);
xFact->createInstance("com.sun.star.document.Settings"), UNO_QUERY);
}
if( pImpl->xPrSet.is() )
pImpl->xPrSetInfo = pImpl->xPrSet->getPropertySetInfo();
OUString sForbidden(C2U("ForbiddenCharacters"));
OUString sForbidden("ForbiddenCharacters");
sal_Bool bKernWesternText = pImpl->aConfig.IsKerningWesternTextOnly();
sal_Int16 nCompress = pImpl->aConfig.GetCharDistanceCompression();
if(pImpl->xPrSetInfo.is())
......@@ -247,13 +245,13 @@ void SvxAsianLayoutPage::Reset( const SfxItemSet& )
Any aForbidden = pImpl->xPrSet->getPropertyValue(sForbidden);
aForbidden >>= pImpl->xForbidden;
}
OUString sCompress(C2U(cCharacterCompressionType));
OUString sCompress(cCharacterCompressionType);
if(pImpl->xPrSetInfo->hasPropertyByName(sCompress))
{
Any aVal = pImpl->xPrSet->getPropertyValue(sCompress);
aVal >>= nCompress;
}
OUString sPunct(C2U(cIsKernAsianPunctuation));
OUString sPunct(cIsKernAsianPunctuation);
if(pImpl->xPrSetInfo->hasPropertyByName(sPunct))
{
Any aVal = pImpl->xPrSet->getPropertyValue(sPunct);
......
......@@ -98,8 +98,6 @@ using namespace ::utl;
using ::rtl::OString;
using ::rtl::OUString;
#define C2U(cChar) OUString::createFromAscii(cChar)
// class OfaMiscTabPage --------------------------------------------------
int OfaMiscTabPage::DeactivatePage( SfxItemSet* pSet_ )
......@@ -1496,7 +1494,7 @@ sal_Bool OfaLanguagesTabPage::FillItemSet( SfxItemSet& rSet )
sNewLang = aLocale.Language;
if ( !aLocale.Country.isEmpty() )
{
sNewLang += C2U("-");
sNewLang += "-";
sNewLang += aLocale.Country;
}
}
......@@ -1549,7 +1547,7 @@ sal_Bool OfaLanguagesTabPage::FillItemSet( SfxItemSet& rSet )
Any aValue;
Locale aLocale = MsLangId::convertLanguageToLocale( eSelectLang, false );
aValue <<= aLocale;
OUString aPropName( C2U("DefaultLocale") );
OUString aPropName( "DefaultLocale" );
pLangConfig->aLinguConfig.SetProperty( aPropName, aValue );
if (xLinguProp.is())
xLinguProp->setPropertyValue( aPropName, aValue );
......@@ -1569,7 +1567,7 @@ sal_Bool OfaLanguagesTabPage::FillItemSet( SfxItemSet& rSet )
Any aValue;
Locale aLocale = MsLangId::convertLanguageToLocale( eSelectLang, false );
aValue <<= aLocale;
OUString aPropName( C2U("DefaultLocale_CJK") );
OUString aPropName( "DefaultLocale_CJK" );
pLangConfig->aLinguConfig.SetProperty( aPropName, aValue );
if (xLinguProp.is())
xLinguProp->setPropertyValue( aPropName, aValue );
......@@ -1589,7 +1587,7 @@ sal_Bool OfaLanguagesTabPage::FillItemSet( SfxItemSet& rSet )
Any aValue;
Locale aLocale = MsLangId::convertLanguageToLocale( eSelectLang, false );
aValue <<= aLocale;
OUString aPropName( C2U("DefaultLocale_CTL") );
OUString aPropName( "DefaultLocale_CTL" );
pLangConfig->aLinguConfig.SetProperty( aPropName, aValue );
if (xLinguProp.is())
xLinguProp->setPropertyValue( aPropName, aValue );
......@@ -1713,18 +1711,18 @@ void OfaLanguagesTabPage::Reset( const SfxItemSet& rSet )
Any aCTLLang;
try
{
aWestLang = pLangConfig->aLinguConfig.GetProperty(C2U("DefaultLocale"));
aWestLang = pLangConfig->aLinguConfig.GetProperty("DefaultLocale");
Locale aLocale;
aWestLang >>= aLocale;
eCurLang = MsLangId::convertLocaleToLanguage( aLocale );
aCJKLang = pLangConfig->aLinguConfig.GetProperty(C2U("DefaultLocale_CJK"));
aCJKLang = pLangConfig->aLinguConfig.GetProperty("DefaultLocale_CJK");
aLocale = Locale();
aCJKLang >>= aLocale;
eCurLangCJK = MsLangId::convertLocaleToLanguage( aLocale );
aCTLLang = pLangConfig->aLinguConfig.GetProperty(C2U("DefaultLocale_CTL"));
aCTLLang = pLangConfig->aLinguConfig.GetProperty("DefaultLocale_CTL");
aLocale = Locale();
aCTLLang >>= aLocale;
eCurLangCTL = MsLangId::convertLocaleToLanguage( aLocale );
......@@ -1779,7 +1777,7 @@ void OfaLanguagesTabPage::Reset( const SfxItemSet& rSet )
aComplexLanguageLB.SaveValue();
aCurrentDocCB.SaveValue();
sal_Bool bEnable = !pLangConfig->aLinguConfig.IsReadOnly( C2U("DefaultLocale") );
sal_Bool bEnable = !pLangConfig->aLinguConfig.IsReadOnly( "DefaultLocale" );
aWesternLanguageFT.Enable( bEnable );
aWesternLanguageLB.Enable( bEnable );
......@@ -1788,11 +1786,11 @@ void OfaLanguagesTabPage::Reset( const SfxItemSet& rSet )
// #i15812# controls for CJK/CTL already enabled/disabled from LocaleSettingHdl
#if 0
bEnable = ( !pLangConfig->aLinguConfig.IsReadOnly( C2U("DefaultLocale_CJK") ) && aAsianSupportCB.IsChecked() );
bEnable = ( !pLangConfig->aLinguConfig.IsReadOnly( "DefaultLocale_CJK" ) && aAsianSupportCB.IsChecked() );
aAsianLanguageFT.Enable( bEnable );
aAsianLanguageLB.Enable( bEnable );
bEnable = ( !pLangConfig->aLinguConfig.IsReadOnly( C2U("DefaultLocale_CTL") ) && aCTLSupportCB.IsChecked() );
bEnable = ( !pLangConfig->aLinguConfig.IsReadOnly( "DefaultLocale_CTL" ) && aCTLSupportCB.IsChecked() );
aComplexLanguageFT.Enable( bEnable );
aComplexLanguageLB.Enable( bEnable );
#endif
......@@ -1814,7 +1812,7 @@ IMPL_LINK( OfaLanguagesTabPage, SupportHdl, CheckBox*, pBox )
sal_Bool bCheck = pBox->IsChecked();
if ( &aAsianSupportCB == pBox )
{
sal_Bool bReadonly = pLangConfig->aLinguConfig.IsReadOnly( C2U("DefaultLocale_CJK"));
sal_Bool bReadonly = pLangConfig->aLinguConfig.IsReadOnly("DefaultLocale_CJK");
bCheck = ( bCheck && !bReadonly );
aAsianLanguageFT.Enable( bCheck );
aAsianLanguageLB.Enable( bCheck );
......@@ -1824,7 +1822,7 @@ IMPL_LINK( OfaLanguagesTabPage, SupportHdl, CheckBox*, pBox )
}
else if ( &aCTLSupportCB == pBox )
{
sal_Bool bReadonly = pLangConfig->aLinguConfig.IsReadOnly( C2U("DefaultLocale_CTL"));
sal_Bool bReadonly = pLangConfig->aLinguConfig.IsReadOnly("DefaultLocale_CTL");
bCheck = ( bCheck && !bReadonly );
aComplexLanguageFT.Enable( bCheck );
aComplexLanguageLB.Enable( bCheck );
......
......@@ -97,8 +97,6 @@ using ::rtl::OUString;
// static ----------------------------------------------------------------
#define C2U(cChar) OUString::createFromAscii(cChar)
#include <sal/config.h>
// -----------------------------------------------------------------------
......@@ -1251,7 +1249,7 @@ public:
/* -------------------------------------------------------------------------*/
MailerProgramCfg_Impl::MailerProgramCfg_Impl() :
utl::ConfigItem(C2U("Office.Common/ExternalMailer")),
utl::ConfigItem("Office.Common/ExternalMailer"),
bROProgram(sal_False)
{
const Sequence< OUString > aNames = GetPropertyNames();
......@@ -1288,7 +1286,7 @@ const Sequence<OUString> MailerProgramCfg_Impl::GetPropertyNames()
{
Sequence<OUString> aRet(1);
OUString* pRet = aRet.getArray();
pRet[0] = C2U("Program");
pRet[0] = "Program";
return aRet;
}
......
This diff is collapsed.
......@@ -52,9 +52,7 @@ using namespace com::sun::star::lang;
using namespace com::sun::star::beans;
using namespace com::sun::star::container;
using namespace comphelper;
using rtl::OUString;
#define C2U(cChar) OUString::createFromAscii(cChar)
#define C2S(cChar) String( RTL_CONSTASCII_USTRINGPARAM(cChar) )
#define CFG_PAGE_AND_GROUP C2S("General"), C2S("LoadSave")
// !! you have to update these index, if you changed the list of the child windows !!
......@@ -415,7 +413,7 @@ void SfxSaveTabPage::Reset( const SfxItemSet& )
{
Reference< XMultiServiceFactory > xMSF = comphelper::getProcessServiceFactory();
pImpl->xFact = Reference<XNameContainer>(
xMSF->createInstance(C2U("com.sun.star.document.FilterFactory")), UNO_QUERY);
xMSF->createInstance("com.sun.star.document.FilterFactory"), UNO_QUERY);
DBG_ASSERT(pImpl->xFact.is(), "service com.sun.star.document.FilterFactory unavailable");
Reference< XContainerQuery > xQuery(pImpl->xFact, UNO_QUERY);
......@@ -425,21 +423,21 @@ void SfxSaveTabPage::Reset( const SfxItemSet& )
{
long nData = (long) aDocTypeLB.GetEntryData(n);
OUString sCommand;
sCommand = C2U("matchByDocumentService=%1:iflags=");
sCommand = "matchByDocumentService=%1:iflags=";
sCommand += String::CreateFromInt32(SFX_FILTER_IMPORT|SFX_FILTER_EXPORT);
sCommand += C2U(":eflags=");
sCommand += ":eflags=";
sCommand += String::CreateFromInt32(SFX_FILTER_NOTINFILEDLG);
sCommand += C2U(":default_first");
sCommand += ":default_first";
String sReplace;
switch(nData)
{
case APP_WRITER : sReplace = C2U("com.sun.star.text.TextDocument"); break;
case APP_WRITER_WEB : sReplace = C2U("com.sun.star.text.WebDocument"); break;
case APP_WRITER_GLOBAL : sReplace = C2U("com.sun.star.text.GlobalDocument"); break;
case APP_CALC : sReplace = C2U("com.sun.star.sheet.SpreadsheetDocument");break;
case APP_IMPRESS : sReplace = C2U("com.sun.star.presentation.PresentationDocument");break;
case APP_DRAW : sReplace = C2U("com.sun.star.drawing.DrawingDocument");break;
case APP_MATH : sReplace = C2U("com.sun.star.formula.FormulaProperties");break;
case APP_WRITER : sReplace = "com.sun.star.text.TextDocument"; break;
case APP_WRITER_WEB : sReplace = "com.sun.star.text.WebDocument"; break;
case APP_WRITER_GLOBAL : sReplace = "com.sun.star.text.GlobalDocument"; break;
case APP_CALC : sReplace = "com.sun.star.sheet.SpreadsheetDocument";break;
case APP_IMPRESS : sReplace = "com.sun.star.presentation.PresentationDocument";break;
case APP_DRAW : sReplace = "com.sun.star.drawing.DrawingDocument";break;
case APP_MATH : sReplace = "com.sun.star.formula.FormulaProperties";break;
default: OSL_FAIL("illegal user data");
}
String sTmp(sCommand);
......
......@@ -46,10 +46,6 @@ namespace lang = ::com::sun::star::lang;
namespace uno = ::com::sun::star::uno;
namespace util = ::com::sun::star::util;
// define ----------------------------------------------------------------
#define UNISTRING(s) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s))
// class SvxOnlineUpdateTabPage --------------------------------------------------
SvxOnlineUpdateTabPage::SvxOnlineUpdateTabPage( Window* pParent, const SfxItemSet& rSet ) :
......@@ -77,11 +73,11 @@ SvxOnlineUpdateTabPage::SvxOnlineUpdateTabPage( Window* pParent, const SfxItemSe
uno::Reference < lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
m_xUpdateAccess = uno::Reference < container::XNameReplace >(
xFactory->createInstance( UNISTRING( "com.sun.star.setup.UpdateCheckConfig" ) ),
xFactory->createInstance( "com.sun.star.setup.UpdateCheckConfig" ),
uno::UNO_QUERY_THROW );
sal_Bool bDownloadSupported = sal_False;
m_xUpdateAccess->getByName( UNISTRING( "DownloadSupported") ) >>= bDownloadSupported;
m_xUpdateAccess->getByName( "DownloadSupported" ) >>= bDownloadSupported;
WinBits nStyle = m_aDestPath.GetStyle();
nStyle |= WB_PATHELLIPSIS;
......@@ -114,7 +110,7 @@ void SvxOnlineUpdateTabPage::UpdateLastCheckedText()
rtl::OUString aText;
sal_Int64 lastChecked = 0;
m_xUpdateAccess->getByName( UNISTRING( "LastCheck") ) >>= lastChecked;
m_xUpdateAccess->getByName("LastCheck") >>= lastChecked;
if( lastChecked == 0 ) // never checked
{
......@@ -155,11 +151,11 @@ void SvxOnlineUpdateTabPage::UpdateLastCheckedText()
delete pNumberFormatter;
aText = m_aLastCheckedTemplate;
sal_Int32 nIndex = aText.indexOf( UNISTRING( "%DATE%" ) );
sal_Int32 nIndex = aText.indexOf( "%DATE%" );
if ( nIndex != -1 )
aText = aText.replaceAt( nIndex, 6, aDateStr );
nIndex = aText.indexOf( UNISTRING( "%TIME%" ) );
nIndex = aText.indexOf( "%TIME%" );
if ( nIndex != -1 )
aText = aText.replaceAt( nIndex, 6, aTimeStr );
}
......@@ -188,7 +184,7 @@ sal_Bool SvxOnlineUpdateTabPage::FillItemSet( SfxItemSet& )
if( m_aAutoCheckCheckBox.GetSavedValue() != m_aAutoCheckCheckBox.IsChecked() )
{
bValue = (sal_True == m_aAutoCheckCheckBox.IsChecked());
m_xUpdateAccess->replaceByName( UNISTRING("AutoCheckEnabled"), uno::makeAny( bValue ) );
m_xUpdateAccess->replaceByName( "AutoCheckEnabled", uno::makeAny( bValue ) );
bModified = sal_True;
}
......@@ -211,24 +207,24 @@ sal_Bool SvxOnlineUpdateTabPage::FillItemSet( SfxItemSet& )
if( nValue > 0 )
{
m_xUpdateAccess->replaceByName( UNISTRING("CheckInterval"), uno::makeAny( nValue ) );
m_xUpdateAccess->replaceByName( "CheckInterval", uno::makeAny( nValue ) );
bModified = sal_True;
}
if( m_aAutoDownloadCheckBox.GetSavedValue() != m_aAutoDownloadCheckBox.IsChecked() )
{
bValue = (sal_True == m_aAutoDownloadCheckBox.IsChecked());
m_xUpdateAccess->replaceByName( UNISTRING("AutoDownloadEnabled"), uno::makeAny( bValue ) );
m_xUpdateAccess->replaceByName( "AutoDownloadEnabled", uno::makeAny( bValue ) );
bModified = sal_True;
}
rtl::OUString sValue, aURL;
m_xUpdateAccess->getByName( UNISTRING("DownloadDestination") ) >>= sValue;
m_xUpdateAccess->getByName( "DownloadDestination" ) >>= sValue;
if( ( osl::FileBase::E_None == osl::FileBase::getFileURLFromSystemPath(m_aDestPath.GetText(), aURL) ) &&
( ! aURL.equals( sValue ) ) )
{
m_xUpdateAccess->replaceByName( UNISTRING("DownloadDestination"), uno::makeAny( aURL ) );
m_xUpdateAccess->replaceByName( "DownloadDestination", uno::makeAny( aURL ) );
bModified = sal_True;
}
......@@ -244,7 +240,7 @@ sal_Bool SvxOnlineUpdateTabPage::FillItemSet( SfxItemSet& )
void SvxOnlineUpdateTabPage::Reset( const SfxItemSet& )
{
sal_Bool bValue = sal_Bool();
m_xUpdateAccess->getByName( UNISTRING("AutoCheckEnabled") ) >>= bValue;
m_xUpdateAccess->getByName( "AutoCheckEnabled" ) >>= bValue;
m_aAutoCheckCheckBox.Check(bValue);
m_aEveryDayButton.Enable(bValue);
......@@ -252,7 +248,7 @@ void SvxOnlineUpdateTabPage::Reset( const SfxItemSet& )
m_aEveryMonthButton.Enable(bValue);
sal_Int64 nValue = 0;
m_xUpdateAccess->getByName( UNISTRING("CheckInterval") ) >>= nValue;
m_xUpdateAccess->getByName( "CheckInterval" ) >>= nValue;
if( nValue == 86400 )
m_aEveryDayButton.Check();
......@@ -266,14 +262,14 @@ void SvxOnlineUpdateTabPage::Reset( const SfxItemSet& )
m_aEveryWeekButton.SaveValue();
m_aEveryMonthButton.SaveValue();
m_xUpdateAccess->getByName( UNISTRING("AutoDownloadEnabled") ) >>= bValue;
m_xUpdateAccess->getByName( "AutoDownloadEnabled" ) >>= bValue;
m_aAutoDownloadCheckBox.Check(bValue);
m_aDestPathLabel.Enable(sal_True);
m_aDestPath.Enable(sal_True);
m_aChangePathButton.Enable(sal_True);
rtl::OUString sValue, aPath;
m_xUpdateAccess->getByName( UNISTRING("DownloadDestination") ) >>= sValue;
m_xUpdateAccess->getByName( "DownloadDestination" ) >>= sValue;
if( osl::FileBase::E_None == osl::FileBase::getSystemPathFromFileURL(sValue, aPath) )
m_aDestPath.SetText(aPath);
......@@ -339,19 +335,19 @@ IMPL_LINK_NOARG(SvxOnlineUpdateTabPage, CheckNowHdl_Impl)
comphelper::getProcessComponentContext() ) );
beans::NamedValue aProperty;
aProperty.Name = UNISTRING( "nodepath" );
aProperty.Value = uno::makeAny( UNISTRING("org.openoffice.Office.Addons/AddonUI/OfficeHelp/UpdateCheckJob") );
aProperty.Name = "nodepath";
aProperty.Value = uno::makeAny( OUString("org.openoffice.Office.Addons/AddonUI/OfficeHelp/UpdateCheckJob") );
uno::Sequence< uno::Any > aArgumentList( 1 );
aArgumentList[0] = uno::makeAny( aProperty );
uno::Reference< container::XNameAccess > xNameAccess(
xConfigProvider->createInstanceWithArguments(
UNISTRING("com.sun.star.configuration.ConfigurationAccess"), aArgumentList ),
"com.sun.star.configuration.ConfigurationAccess", aArgumentList ),
uno::UNO_QUERY_THROW );
util::URL aURL;
xNameAccess->getByName(UNISTRING("URL")) >>= aURL.Complete;
xNameAccess->getByName("URL") >>= aURL.Complete;
uno::Reference < util::XURLTransformer > xTransformer(
util::URLTransformer::create( comphelper::getProcessComponentContext() ) );
......@@ -359,7 +355,7 @@ IMPL_LINK_NOARG(SvxOnlineUpdateTabPage, CheckNowHdl_Impl)
xTransformer->parseStrict(aURL);
uno::Reference < frame::XDesktop > xDesktop(
xFactory->createInstance( UNISTRING( "com.sun.star.frame.Desktop" ) ),
xFactory->createInstance( "com.sun.star.frame.Desktop" ),
uno::UNO_QUERY_THROW );
uno::Reference< frame::XDispatchProvider > xDispatchProvider(
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment