summaryrefslogtreecommitdiff
path: root/sw/source/ui/uno
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2013-12-12 14:44:40 +0100
committerStephan Bergmann <sbergman@redhat.com>2013-12-12 15:10:36 +0100
commit39e9d80bed5241139823b15e07ce2643aaff9579 (patch)
tree45222c2490c154f3a254ee8b374ea3ed7cb02a70 /sw/source/ui/uno
parentc828319753558e25a48ce7808604bcc648f2483d (diff)
Reduce unoprnms.hxx to a set of string literal macros
Change-Id: I955dcb5cedfbdf413054482d2c51d187e6f41898
Diffstat (limited to 'sw/source/ui/uno')
-rw-r--r--sw/source/ui/uno/SwXFilterOptions.cxx2
-rw-r--r--sw/source/ui/uno/unomailmerge.cxx62
-rw-r--r--sw/source/ui/uno/unotxdoc.cxx22
-rw-r--r--sw/source/ui/uno/unotxvw.cxx25
4 files changed, 50 insertions, 61 deletions
diff --git a/sw/source/ui/uno/SwXFilterOptions.cxx b/sw/source/ui/uno/SwXFilterOptions.cxx
index 6f81eb26c9d8..0d4909914448 100644
--- a/sw/source/ui/uno/SwXFilterOptions.cxx
+++ b/sw/source/ui/uno/SwXFilterOptions.cxx
@@ -83,7 +83,7 @@ void SwXFilterOptions::setPropertyValues( const uno::Sequence<beans::PropertyV
const beans::PropertyValue& rProp = pPropArray[i];
OUString aPropName = rProp.Name;
- if ( aPropName.equalsAscii( SW_PROP_NAME_STR(UNO_NAME_FILTER_NAME) ) )
+ if ( aPropName == UNO_NAME_FILTER_NAME )
rProp.Value >>= sFilterName;
else if ( aPropName == FILTER_OPTIONS_NAME )
rProp.Value >>= sFilterOptions;
diff --git a/sw/source/ui/uno/unomailmerge.cxx b/sw/source/ui/uno/unomailmerge.cxx
index db9bf9d0e151..f9d2b0cf3066 100644
--- a/sw/source/ui/uno/unomailmerge.cxx
+++ b/sw/source/ui/uno/unomailmerge.cxx
@@ -451,28 +451,28 @@ uno::Any SAL_CALL SwXMailMerge::execute(
const Any &rValue = pArguments[i].Value;
sal_Bool bOK = sal_True;
- if (rName.equalsAscii( GetPropName( UNO_NAME_SELECTION ) ))
+ if (rName == UNO_NAME_SELECTION)
bOK = rValue >>= aCurSelection;
- else if (rName.equalsAscii( GetPropName( UNO_NAME_RESULT_SET ) ))
+ else if (rName == UNO_NAME_RESULT_SET)
bOK = rValue >>= xCurResultSet;
- else if (rName.equalsAscii( GetPropName( UNO_NAME_CONNECTION ) ))
+ else if (rName == UNO_NAME_CONNECTION)
bOK = rValue >>= xCurConnection;
- else if (rName.equalsAscii( GetPropName( UNO_NAME_MODEL ) ))
+ else if (rName == UNO_NAME_MODEL)
throw PropertyVetoException("Property is read-only: " + rName, static_cast < cppu::OWeakObject * > ( this ) );
- else if (rName.equalsAscii( GetPropName( UNO_NAME_DATA_SOURCE_NAME ) ))
+ else if (rName == UNO_NAME_DATA_SOURCE_NAME)
bOK = rValue >>= aCurDataSourceName;
- else if (rName.equalsAscii( GetPropName( UNO_NAME_DAD_COMMAND ) ))
+ else if (rName == UNO_NAME_DAD_COMMAND)
bOK = rValue >>= aCurDataCommand;
- else if (rName.equalsAscii( GetPropName( UNO_NAME_FILTER ) ))
+ else if (rName == UNO_NAME_FILTER)
bOK = rValue >>= aCurFilter;
- else if (rName.equalsAscii( GetPropName( UNO_NAME_DOCUMENT_URL ) ))
+ else if (rName == UNO_NAME_DOCUMENT_URL)
{
bOK = rValue >>= aCurDocumentURL;
if (!aCurDocumentURL.isEmpty()
&& !LoadFromURL_impl( xCurModel, xCurDocSh, aCurDocumentURL, false ))
throw RuntimeException("Failed to create document from URL: " + aCurDocumentURL, static_cast < cppu::OWeakObject * > ( this ) );
}
- else if (rName.equalsAscii( GetPropName( UNO_NAME_OUTPUT_URL ) ))
+ else if (rName == UNO_NAME_OUTPUT_URL)
{
bOK = rValue >>= aCurOutputURL;
if (!aCurOutputURL.isEmpty())
@@ -483,49 +483,49 @@ uno::Any SAL_CALL SwXMailMerge::execute(
throw IllegalArgumentException("URL is read-only: " + aCurOutputURL, static_cast < cppu::OWeakObject * > ( this ), 0 );
}
}
- else if (rName.equalsAscii( GetPropName( UNO_NAME_FILE_NAME_PREFIX ) ))
+ else if (rName == UNO_NAME_FILE_NAME_PREFIX)
bOK = rValue >>= aCurFileNamePrefix;
- else if (rName.equalsAscii( GetPropName( UNO_NAME_DAD_COMMAND_TYPE ) ))
+ else if (rName == UNO_NAME_DAD_COMMAND_TYPE)
bOK = rValue >>= nCurDataCommandType;
- else if (rName.equalsAscii( GetPropName( UNO_NAME_OUTPUT_TYPE ) ))
+ else if (rName == UNO_NAME_OUTPUT_TYPE)
bOK = rValue >>= nCurOutputType;
- else if (rName.equalsAscii( GetPropName( UNO_NAME_ESCAPE_PROCESSING ) ))
+ else if (rName == UNO_NAME_ESCAPE_PROCESSING)
bOK = rValue >>= bCurEscapeProcessing;
- else if (rName.equalsAscii( GetPropName( UNO_NAME_SINGLE_PRINT_JOBS ) ))
+ else if (rName == UNO_NAME_SINGLE_PRINT_JOBS)
bOK = rValue >>= bCurSinglePrintJobs;
- else if (rName.equalsAscii( GetPropName( UNO_NAME_FILE_NAME_FROM_COLUMN ) ))
+ else if (rName == UNO_NAME_FILE_NAME_FROM_COLUMN)
bOK = rValue >>= bCurFileNameFromColumn;
- else if (rName.equalsAscii( GetPropName( UNO_NAME_SUBJECT ) ))
+ else if (rName == UNO_NAME_SUBJECT)
bOK = rValue >>= sSubject;
- else if (rName.equalsAscii( GetPropName( UNO_NAME_ADDRESS_FROM_COLUMN ) ))
+ else if (rName == UNO_NAME_ADDRESS_FROM_COLUMN)
bOK = rValue >>= sAddressFromColumn;
- else if (rName.equalsAscii( GetPropName( UNO_NAME_SEND_AS_HTML ) ))
+ else if (rName == UNO_NAME_SEND_AS_HTML)
bOK = rValue >>= bSendAsHTML;
- else if (rName.equalsAscii( GetPropName( UNO_NAME_MAIL_BODY ) ))
+ else if (rName == UNO_NAME_MAIL_BODY)
bOK = rValue >>= sMailBody;
- else if (rName.equalsAscii( GetPropName( UNO_NAME_ATTACHMENT_NAME ) ))
+ else if (rName == UNO_NAME_ATTACHMENT_NAME)
bOK = rValue >>= sAttachmentName;
- else if (rName.equalsAscii( GetPropName( UNO_NAME_ATTACHMENT_FILTER ) ))
+ else if (rName == UNO_NAME_ATTACHMENT_FILTER)
bOK = rValue >>= sAttachmentFilter;
- else if (rName.equalsAscii( GetPropName( UNO_NAME_COPIES_TO ) ))
+ else if (rName == UNO_NAME_COPIES_TO)
bOK = rValue >>= aCopiesTo;
- else if (rName.equalsAscii( GetPropName( UNO_NAME_BLIND_COPIES_TO ) ))
+ else if (rName == UNO_NAME_BLIND_COPIES_TO)
bOK = rValue >>= aBlindCopiesTo;
- else if (rName.equalsAscii( GetPropName( UNO_NAME_SEND_AS_ATTACHMENT ) ))
+ else if (rName == UNO_NAME_SEND_AS_ATTACHMENT)
bOK = rValue >>= bSendAsAttachment;
- else if (rName.equalsAscii( GetPropName( UNO_NAME_PRINT_OPTIONS ) ))
+ else if (rName == UNO_NAME_PRINT_OPTIONS)
bOK = rValue >>= aPrintSettings;
- else if (rName.equalsAscii( GetPropName( UNO_NAME_SAVE_AS_SINGLE_FILE ) ))
+ else if (rName == UNO_NAME_SAVE_AS_SINGLE_FILE)
bOK = rValue >>= bSaveAsSingleFile;
- else if (rName.equalsAscii( GetPropName( UNO_NAME_SAVE_FILTER ) ))
+ else if (rName == UNO_NAME_SAVE_FILTER)
bOK = rValue >>= sSaveFilter;
- else if (rName.equalsAscii( GetPropName( UNO_NAME_SAVE_FILTER_OPTIONS ) ))
+ else if (rName == UNO_NAME_SAVE_FILTER_OPTIONS)
bOK = rValue >>= sSaveFilterOptions;
- else if (rName.equalsAscii( GetPropName( UNO_NAME_SAVE_FILTER_DATA ) ))
+ else if (rName == UNO_NAME_SAVE_FILTER_DATA)
bOK = rValue >>= aSaveFilterData;
- else if (rName.equalsAscii( GetPropName( UNO_NAME_IN_SERVER_PASSWORD ) ))
+ else if (rName == UNO_NAME_IN_SERVER_PASSWORD)
bOK = rValue >>= sInServerPassword;
- else if (rName.equalsAscii( GetPropName( UNO_NAME_OUT_SERVER_PASSWORD ) ))
+ else if (rName == UNO_NAME_OUT_SERVER_PASSWORD)
bOK = rValue >>= sOutServerPassword;
else
throw UnknownPropertyException( OUString( "Property is unknown: " ) + rName, static_cast < cppu::OWeakObject * > ( this ) );
diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx
index 095a481c1138..4fbdc9a7d5c1 100644
--- a/sw/source/ui/uno/unotxdoc.cxx
+++ b/sw/source/ui/uno/unotxdoc.cxx
@@ -1142,12 +1142,6 @@ void SwXTextDocument::printPages(const Sequence< beans::PropertyValue >& xOption
pDocShell->GetDoc()->GetAttrPool());
aReq.AppendItem(SfxBoolItem(FN_PRINT_PAGEPREVIEW, sal_True));
- OUString sFileName(OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_FILE_NAME)));
- OUString sCopyCount(OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_COPY_COUNT)));
- OUString sCollate(OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_COLLATE)));
- OUString sSort(OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SORT)));
- OUString sPages(OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_PAGES)));
-
for ( int n = 0; n < xOptions.getLength(); ++n )
{
// get Property-Value from options
@@ -1155,7 +1149,7 @@ void SwXTextDocument::printPages(const Sequence< beans::PropertyValue >& xOption
Any aValue( rProp.Value );
// FileName-Property?
- if ( rProp.Name == sFileName )
+ if ( rProp.Name == UNO_NAME_FILE_NAME )
{
OUString sFileURL;
if ( (rProp.Value >>= sFileURL ) )
@@ -1170,7 +1164,7 @@ void SwXTextDocument::printPages(const Sequence< beans::PropertyValue >& xOption
}
// CopyCount-Property
- else if ( rProp.Name == sCopyCount )
+ else if ( rProp.Name == UNO_NAME_COPY_COUNT )
{
sal_Int32 nCopies = 0;
aValue >>= nCopies;
@@ -1178,7 +1172,7 @@ void SwXTextDocument::printPages(const Sequence< beans::PropertyValue >& xOption
}
// Collate-Property
- else if ( rProp.Name == sCollate )
+ else if ( rProp.Name == UNO_NAME_COLLATE )
{
if ( rProp.Value.getValueType() == ::getBooleanCppuType())
@@ -1188,7 +1182,7 @@ void SwXTextDocument::printPages(const Sequence< beans::PropertyValue >& xOption
}
// Sort-Property
- else if ( rProp.Name == sSort )
+ else if ( rProp.Name == UNO_NAME_SORT )
{
if ( rProp.Value.getValueType() == ::getBooleanCppuType() )
aReq.AppendItem(SfxBoolItem( SID_PRINT_SORT, *(sal_Bool*)rProp.Value.getValue() ) );
@@ -1197,7 +1191,7 @@ void SwXTextDocument::printPages(const Sequence< beans::PropertyValue >& xOption
}
// Pages-Property
- else if ( rProp.Name == sPages )
+ else if ( rProp.Name == UNO_NAME_PAGES )
{
OUString sTmp;
if ( rProp.Value >>= sTmp )
@@ -3706,11 +3700,11 @@ Any SwXLinkNameAccessWrapper::getPropertyValue(const OUString& rPropertyName)
throw( UnknownPropertyException, WrappedTargetException, RuntimeException )
{
Any aRet;
- if( rPropertyName.equalsAsciiL( SW_PROP_NAME(UNO_LINK_DISPLAY_NAME)))
+ if( rPropertyName == UNO_LINK_DISPLAY_NAME )
{
aRet <<= OUString(sLinkDisplayName);
}
- else if( rPropertyName.equalsAsciiL( SW_PROP_NAME(UNO_LINK_DISPLAY_BITMAP)))
+ else if( rPropertyName == UNO_LINK_DISPLAY_BITMAP )
{
aRet = lcl_GetDisplayBitmap(sLinkSuffix);
}
@@ -3793,7 +3787,7 @@ Any SwXOutlineTarget::getPropertyValue(const OUString& rPropertyName)
throw( UnknownPropertyException, WrappedTargetException, RuntimeException )
{
Any aRet;
- if(rPropertyName.equalsAsciiL( SW_PROP_NAME(UNO_LINK_DISPLAY_NAME)))
+ if(rPropertyName == UNO_LINK_DISPLAY_NAME)
aRet <<= OUString(sOutlineText);
else
throw UnknownPropertyException();
diff --git a/sw/source/ui/uno/unotxvw.cxx b/sw/source/ui/uno/unotxvw.cxx
index 6309cdc5b766..c0bf06a54834 100644
--- a/sw/source/ui/uno/unotxvw.cxx
+++ b/sw/source/ui/uno/unotxvw.cxx
@@ -562,16 +562,16 @@ Sequence< Sequence< PropertyValue > > SwXTextView::getRubyList( sal_Bool /*bAuto
pRet[n].realloc(5);
PropertyValue* pValues = pRet[n].getArray();
- pValues[0].Name = OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_RUBY_BASE_TEXT));
+ pValues[0].Name = UNO_NAME_RUBY_BASE_TEXT;
pValues[0].Value <<= OUString(rEntryText);
- pValues[1].Name = OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_RUBY_TEXT));
+ pValues[1].Name = UNO_NAME_RUBY_TEXT;
pValues[1].Value <<= OUString(rAttr.GetText());
- pValues[2].Name = OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_RUBY_CHAR_STYLE_NAME));
+ pValues[2].Name = UNO_NAME_RUBY_CHAR_STYLE_NAME;
SwStyleNameMapper::FillProgName(rAttr.GetCharFmtName(), aString, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT, true );
pValues[2].Value <<= aString;
- pValues[3].Name = OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_RUBY_ADJUST));
+ pValues[3].Name = UNO_NAME_RUBY_ADJUST;
pValues[3].Value <<= (sal_Int16)rAttr.GetAdjustment();
- pValues[4].Name = OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_RUBY_IS_ABOVE));
+ pValues[4].Name = UNO_NAME_RUBY_IS_ABOVE;
sal_Bool bVal = !rAttr.GetPosition();
pValues[4].Value.setValue(&bVal, ::getBooleanCppuType());
}
@@ -604,20 +604,17 @@ void SAL_CALL SwXTextView::setRubyList(
OUString sTmp;
for(sal_Int32 nProp = 0; nProp < pRubyList[nPos].getLength(); nProp++)
{
- if(pProperties[nProp].Name.equalsAsciiL(
- SW_PROP_NAME(UNO_NAME_RUBY_BASE_TEXT)))
+ if(pProperties[nProp].Name == UNO_NAME_RUBY_BASE_TEXT)
{
pProperties[nProp].Value >>= sTmp;
pEntry->SetText(sTmp);
}
- else if(pProperties[nProp].Name.equalsAsciiL(
- SW_PROP_NAME(UNO_NAME_RUBY_TEXT)))
+ else if(pProperties[nProp].Name == UNO_NAME_RUBY_TEXT)
{
pProperties[nProp].Value >>= sTmp;
pEntry->GetRubyAttr().SetText(sTmp);
}
- else if(pProperties[nProp].Name.equalsAsciiL(
- SW_PROP_NAME(UNO_NAME_RUBY_CHAR_STYLE_NAME)))
+ else if(pProperties[nProp].Name == UNO_NAME_RUBY_CHAR_STYLE_NAME)
{
if((pProperties[nProp].Value >>= sTmp))
{
@@ -631,15 +628,13 @@ void SAL_CALL SwXTextView::setRubyList(
pEntry->GetRubyAttr().SetCharFmtId( nPoolId );
}
}
- else if(pProperties[nProp].Name.equalsAsciiL(
- SW_PROP_NAME(UNO_NAME_RUBY_ADJUST)))
+ else if(pProperties[nProp].Name == UNO_NAME_RUBY_ADJUST)
{
sal_Int16 nTmp = 0;
if((pProperties[nProp].Value >>= nTmp))
pEntry->GetRubyAttr().SetAdjustment(nTmp);
}
- else if(pProperties[nProp].Name.equalsAsciiL(
- SW_PROP_NAME(UNO_NAME_RUBY_IS_ABOVE)))
+ else if(pProperties[nProp].Name == UNO_NAME_RUBY_IS_ABOVE)
{
sal_Bool bValue = pProperties[nProp].Value.hasValue() ?
*(sal_Bool*)pProperties[nProp].Value.getValue() : sal_True;