diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2012-03-05 12:20:00 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2012-03-05 13:11:51 +0100 |
commit | 282e96fb345761edb9015e8066189c3cbe5b8396 (patch) | |
tree | 3edf61f34f849e632c60249204058b7025b35d61 /sw | |
parent | optimized OUString operators =,==,!= for string literals (diff) | |
download | core-282e96fb345761edb9015e8066189c3cbe5b8396.tar.gz core-282e96fb345761edb9015e8066189c3cbe5b8396.zip |
remove RTL_CONSTASCII_USTRINGPARAM usage
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 12 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxexport.cxx | 78 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxexportfilter.cxx | 6 | ||||
-rw-r--r-- | sw/source/filter/ww8/hash_wrap.hxx | 4 | ||||
-rw-r--r-- | sw/source/filter/ww8/rtfattributeoutput.cxx | 38 | ||||
-rw-r--r-- | sw/source/filter/ww8/rtfexportfilter.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/ww8/rtfimportfilter.cxx | 6 | ||||
-rw-r--r-- | sw/source/filter/ww8/rtfsdrexport.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/sortedarray.hxx | 4 | ||||
-rw-r--r-- | sw/source/filter/ww8/writerwordglue.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtw8nds.cxx | 54 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtww8.cxx | 60 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtww8gr.cxx | 5 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par.cxx | 23 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par3.cxx | 22 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par5.cxx | 28 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8toolbar.cxx | 38 |
17 files changed, 185 insertions, 201 deletions
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 18ade4684eda..1b1de4f6f1a8 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -649,11 +649,11 @@ void DocxAttributeOutput::WriteFFData( const FieldInfos& rInfos ) rtl::OUString sName, sHelp, sToolTip, sSelected; FieldMarkParamsHelper params( rFieldmark ); - params.extractParam( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ODF_FORMDROPDOWN_LISTENTRY) ), vListEntries ); + params.extractParam( ODF_FORMDROPDOWN_LISTENTRY, vListEntries ); sName = params.getName(); sal_Int32 nSelectedIndex = 0; - if ( params.extractParam( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ODF_FORMDROPDOWN_RESULT) ), nSelectedIndex ) ) + if ( params.extractParam( ODF_FORMDROPDOWN_RESULT, nSelectedIndex ) ) { if (nSelectedIndex < vListEntries.getLength() ) sSelected = vListEntries[ nSelectedIndex ]; @@ -667,7 +667,7 @@ void DocxAttributeOutput::WriteFFData( const FieldInfos& rInfos ) bool bChecked = false; FieldMarkParamsHelper params( rFieldmark ); - params.extractParam( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ODF_FORMCHECKBOX_NAME ) ), sName ); + params.extractParam( ODF_FORMCHECKBOX_NAME, sName ); const sw::mark::ICheckboxFieldmark* pCheckboxFm = dynamic_cast<const sw::mark::ICheckboxFieldmark*>(&rFieldmark); if ( pCheckboxFm && pCheckboxFm->IsChecked() ) @@ -1102,7 +1102,7 @@ void DocxAttributeOutput::StartRuby( const SwTxtNode& rNode, xub_StrLen nPos, co rNode.GetLang( nPos ) ) ); OUString sLang( aLocale.Language ); if ( !aLocale.Country.isEmpty() ) - sLang += OUString(RTL_CONSTASCII_USTRINGPARAM( "-" )) + OUString( aLocale.Country ); + sLang += OUString( "-" ) + OUString( aLocale.Country ); m_pSerializer->singleElementNS( XML_w, XML_lid, FSNS( XML_w, XML_val ), OUStringToOString( sLang, RTL_TEXTENCODING_UTF8 ).getStr( ), FSEND ); @@ -2229,7 +2229,7 @@ bool DocxAttributeOutput::WriteOLEChart( const SdrObject* pSdrObj, const Size& r { uno::Reference< beans::XPropertySet > xPropSet( xShape, uno::UNO_QUERY ); if( xPropSet.is() ) - xChartDoc.set( xPropSet->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Model")) ), uno::UNO_QUERY ); + xChartDoc.set( xPropSet->getPropertyValue( "Model" ), uno::UNO_QUERY ); } if( xChartDoc.is() ) @@ -2254,7 +2254,7 @@ bool DocxAttributeOutput::WriteOLEChart( const SdrObject* pSdrObj, const Size& r // should get the unique id sal_Int32 nID = 1; - OUString sName(RTL_CONSTASCII_USTRINGPARAM("Object 1")); + OUString sName("Object 1"); uno::Reference< container::XNamed > xNamed( xShape, uno::UNO_QUERY ); if( xNamed.is() ) sName = xNamed->getName(); diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx index 6d8930c5b09e..5f7c6dac567c 100644 --- a/sw/source/filter/ww8/docxexport.cxx +++ b/sw/source/filter/ww8/docxexport.cxx @@ -80,8 +80,6 @@ using rtl::OUStringBuffer; using sw::mark::IMark; -#define S( x ) OUString( RTL_CONSTASCII_USTRINGPARAM( x ) ) - AttributeOutputBase& DocxExport::AttrOutput() const { return *m_pAttrOutput; @@ -313,7 +311,7 @@ rtl::OString DocxExport::OutputChart( uno::Reference< frame::XModel >& xModel, s .makeStringAndClear(); OUString sId = m_pFilter->addRelation( m_pDocumentFS->getOutputStream(), - S( "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart" ), + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart", aFileName ); aFileName = rtl::OUStringBuffer() @@ -324,7 +322,7 @@ rtl::OString DocxExport::OutputChart( uno::Reference< frame::XModel >& xModel, s ::sax_fastparser::FSHelperPtr pChartFS = m_pFilter->openFragmentStreamWithSerializer( aFileName, - S( "application/vnd.openxmlformats-officedocument.drawingml.chart" ) ); + "application/vnd.openxmlformats-officedocument.drawingml.chart" ); oox::drawingml::ChartExport aChartExport( XML_w, pChartFS, xModel, m_pFilter, oox::drawingml::DrawingML::DOCUMENT_DOCX ); aChartExport.ExportContent(); @@ -459,12 +457,12 @@ void DocxExport::InitStyles() // setup word/styles.xml and the relations + content type m_pFilter->addRelation( m_pDocumentFS->getOutputStream(), - S( "http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" ), - S( "styles.xml" ) ); + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles", + "styles.xml" ); ::sax_fastparser::FSHelperPtr pStylesFS = - m_pFilter->openFragmentStreamWithSerializer( S( "word/styles.xml" ), - S( "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml" ) ); + m_pFilter->openFragmentStreamWithSerializer( "word/styles.xml", + "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml" ); // switch the serializer to redirect the output to word/styles.xml m_pAttrOutput->SetSerializer( pStylesFS ); @@ -482,12 +480,12 @@ void DocxExport::WriteFootnotesEndnotes() { // setup word/styles.xml and the relations + content type m_pFilter->addRelation( m_pDocumentFS->getOutputStream(), - S( "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes" ), - S( "footnotes.xml" ) ); + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes", + "footnotes.xml" ); ::sax_fastparser::FSHelperPtr pFootnotesFS = - m_pFilter->openFragmentStreamWithSerializer( S( "word/footnotes.xml" ), - S( "application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml" ) ); + m_pFilter->openFragmentStreamWithSerializer( "word/footnotes.xml", + "application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml" ); // switch the serializer to redirect the output to word/footnotes.xml m_pAttrOutput->SetSerializer( pFootnotesFS ); @@ -503,12 +501,12 @@ void DocxExport::WriteFootnotesEndnotes() { // setup word/styles.xml and the relations + content type m_pFilter->addRelation( m_pDocumentFS->getOutputStream(), - S( "http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes" ), - S( "endnotes.xml" ) ); + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes", + "endnotes.xml" ); ::sax_fastparser::FSHelperPtr pEndnotesFS = - m_pFilter->openFragmentStreamWithSerializer( S( "word/endnotes.xml" ), - S( "application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml" ) ); + m_pFilter->openFragmentStreamWithSerializer( "word/endnotes.xml", + "application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml" ); // switch the serializer to redirect the output to word/endnotes.xml m_pAttrOutput->SetSerializer( pEndnotesFS ); @@ -526,12 +524,12 @@ void DocxExport::WritePostitFields() if ( m_pAttrOutput->HasPostitFields() ) { m_pFilter->addRelation( m_pDocumentFS->getOutputStream(), - S( "http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments" ), - S( "comments.xml" ) ); + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments", + "comments.xml" ); ::sax_fastparser::FSHelperPtr pPostitFS = - m_pFilter->openFragmentStreamWithSerializer( S( "word/comments.xml" ), - S( "application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml" ) ); + m_pFilter->openFragmentStreamWithSerializer( "word/comments.xml", + "application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml" ); pPostitFS->startElementNS( XML_w, XML_comments, MainXmlNamespaces( pPostitFS )); m_pAttrOutput->SetSerializer( pPostitFS ); @@ -547,11 +545,11 @@ void DocxExport::WriteNumbering() return; // no numbering is used m_pFilter->addRelation( m_pDocumentFS->getOutputStream(), - S( "http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering" ), - S( "numbering.xml" ) ); + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering", + "numbering.xml" ); - ::sax_fastparser::FSHelperPtr pNumberingFS = m_pFilter->openFragmentStreamWithSerializer( S( "word/numbering.xml" ), - S( "application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml" ) ); + ::sax_fastparser::FSHelperPtr pNumberingFS = m_pFilter->openFragmentStreamWithSerializer( "word/numbering.xml", + "application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml" ); // switch the serializer to redirect the output to word/nubering.xml m_pAttrOutput->SetSerializer( pNumberingFS ); @@ -582,11 +580,11 @@ void DocxExport::WriteHeaderFooter( const SwFmt& rFmt, bool bHeader, const char* .makeStringAndClear() ); aRelId = m_pFilter->addRelation( m_pDocumentFS->getOutputStream(), - S( "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header" ), + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header", aName ); pFS = m_pFilter->openFragmentStreamWithSerializer( OUStringBuffer().appendAscii(RTL_CONSTASCII_STRINGPARAM("word/")).append( aName ).makeStringAndClear(), - S( "application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml" ) ); + "application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml" ); pFS->startElementNS( XML_w, XML_hdr, MainXmlNamespaces( pFS )); } @@ -595,11 +593,11 @@ void DocxExport::WriteHeaderFooter( const SwFmt& rFmt, bool bHeader, const char* OUString aName( OUStringBuffer().appendAscii(RTL_CONSTASCII_STRINGPARAM("footer")).append( ++m_nFooters ).appendAscii(RTL_CONSTASCII_STRINGPARAM(".xml")).makeStringAndClear() ); aRelId = m_pFilter->addRelation( m_pDocumentFS->getOutputStream(), - S( "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer" ), + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer", aName ); pFS = m_pFilter->openFragmentStreamWithSerializer( OUStringBuffer().appendAscii(RTL_CONSTASCII_STRINGPARAM("word/")).append( aName ).makeStringAndClear(), - S( "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml" ) ); + "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml" ); pFS->startElementNS( XML_w, XML_ftr, MainXmlNamespaces( pFS )); } @@ -636,12 +634,12 @@ void DocxExport::WriteHeaderFooter( const SwFmt& rFmt, bool bHeader, const char* void DocxExport::WriteFonts() { m_pFilter->addRelation( m_pDocumentFS->getOutputStream(), - S( "http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable" ), - S( "fontTable.xml" ) ); + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable", + "fontTable.xml" ); ::sax_fastparser::FSHelperPtr pFS = m_pFilter->openFragmentStreamWithSerializer( - S( "word/fontTable.xml" ), - S( "application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml" ) ); + "word/fontTable.xml", + "application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml" ); pFS->startElementNS( XML_w, XML_fonts, FSNS( XML_xmlns, XML_w ), "http://schemas.openxmlformats.org/wordprocessingml/2006/main", @@ -681,12 +679,12 @@ void DocxExport::WriteSettings() return; m_pFilter->addRelation( m_pDocumentFS->getOutputStream(), - S( "http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings" ), - S( "settings.xml" ) ); + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings", + "settings.xml" ); ::sax_fastparser::FSHelperPtr pFS = m_pFilter->openFragmentStreamWithSerializer( - S( "word/settings.xml" ), - S( "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml" ) ); + "word/settings.xml", + "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml" ); pFS->startElementNS( XML_w, XML_settings, FSNS( XML_xmlns, XML_w ), "http://schemas.openxmlformats.org/wordprocessingml/2006/main", @@ -812,12 +810,12 @@ DocxExport::DocxExport( DocxExportFilter *pFilter, SwDoc *pDocument, SwPaM *pCur WriteProperties( ); // relations for the document - m_pFilter->addRelation( S( "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" ), - S( "word/document.xml" ) ); + m_pFilter->addRelation( "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument", + "word/document.xml" ); // the actual document - m_pDocumentFS = m_pFilter->openFragmentStreamWithSerializer( S( "word/document.xml" ), - S( "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml" ) ); + m_pDocumentFS = m_pFilter->openFragmentStreamWithSerializer( "word/document.xml", + "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml" ); // the DrawingML access m_pDrawingML = new oox::drawingml::DrawingML( m_pDocumentFS, m_pFilter, oox::drawingml::DrawingML::DOCUMENT_DOCX ); diff --git a/sw/source/filter/ww8/docxexportfilter.cxx b/sw/source/filter/ww8/docxexportfilter.cxx index a780c5c3457f..83bc819466a6 100644 --- a/sw/source/filter/ww8/docxexportfilter.cxx +++ b/sw/source/filter/ww8/docxexportfilter.cxx @@ -42,8 +42,6 @@ using namespace ::comphelper; using namespace ::com::sun::star; using ::rtl::OUString; -#define S( x ) OUString( RTL_CONSTASCII_USTRINGPARAM( x ) ) - DocxExportFilter::DocxExportFilter( const uno::Reference< uno::XComponentContext >& xContext ) : oox::core::XmlFilterBase( xContext ) { @@ -107,7 +105,7 @@ bool DocxExportFilter::exportDocument() OUString DocxExport_getImplementationName() { - return OUString( RTL_CONSTASCII_USTRINGPARAM( IMPL_NAME ) ); + return OUString( IMPL_NAME ); } OUString DocxExportFilter::implGetImplementationName() const @@ -117,7 +115,7 @@ OUString DocxExportFilter::implGetImplementationName() const uno::Sequence< OUString > SAL_CALL DocxExport_getSupportedServiceNames() throw() { - const OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.ExportFilter" ) ); + const OUString aServiceName( "com.sun.star.document.ExportFilter" ); const uno::Sequence< OUString > aSeq( &aServiceName, 1 ); return aSeq; } diff --git a/sw/source/filter/ww8/hash_wrap.hxx b/sw/source/filter/ww8/hash_wrap.hxx index a27d1b00e9d1..8031cf0b10ca 100644 --- a/sw/source/filter/ww8/hash_wrap.hxx +++ b/sw/source/filter/ww8/hash_wrap.hxx @@ -83,12 +83,12 @@ namespace ww { if (!bBroken) { - sError = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + sError = "WW8: Duplicate in list, almost certainly don't " "want that!\n" "(You will not see this message again unless you " "restart)\n" - "Extra entries are...\n")); + "Extra entries are...\n"; bBroken=true; } diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index b9afd1b22083..87b4ebcf3048 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -1592,7 +1592,7 @@ void RtfAttributeOutput::OutputFlyFrame_Impl( const sw::Frame& rFrame, const Poi uno::Reference<beans::XPropertySet> xPropSet(xControlModel, uno::UNO_QUERY); uno::Reference<beans::XPropertySetInfo> xPropSetInfo = xPropSet->getPropertySetInfo(); OUString sName; - if (xInfo->supportsService(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.component.CheckBox")))) + if (xInfo->supportsService("com.sun.star.form.component.CheckBox")) { m_aRun->append(OUStringToOString(OUString(FieldString(ww::eFORMCHECKBOX)), m_rExport.eCurrentEncoding)); @@ -1602,7 +1602,7 @@ void RtfAttributeOutput::OutputFlyFrame_Impl( const sw::Frame& rFrame, const Poi m_aRun->append(OOO_STRING_SVTOOLS_RTF_FFHPS "20"); OUString aStr; - sName = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Name")); + sName = "Name"; if (xPropSetInfo->hasPropertyByName(sName)) { xPropSet->getPropertyValue(sName) >>= aStr; @@ -1611,7 +1611,7 @@ void RtfAttributeOutput::OutputFlyFrame_Impl( const sw::Frame& rFrame, const Poi m_aRun->append('}'); } - sName = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HelpText")); + sName = "HelpText"; if (xPropSetInfo->hasPropertyByName(sName)) { xPropSet->getPropertyValue(sName) >>= aStr; @@ -1621,7 +1621,7 @@ void RtfAttributeOutput::OutputFlyFrame_Impl( const sw::Frame& rFrame, const Poi m_aRun->append('}'); } - sName = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HelpF1Text")); + sName = "HelpF1Text"; if (xPropSetInfo->hasPropertyByName(sName)) { xPropSet->getPropertyValue(sName) >>= aStr; @@ -1632,10 +1632,10 @@ void RtfAttributeOutput::OutputFlyFrame_Impl( const sw::Frame& rFrame, const Poi } sal_Int16 nTemp = 0; - xPropSet->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultState"))) >>= nTemp; + xPropSet->getPropertyValue("DefaultState") >>= nTemp; m_aRun->append(OOO_STRING_SVTOOLS_RTF_FFDEFRES); m_aRun->append((sal_Int32)nTemp); - xPropSet->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("State"))) >>= nTemp; + xPropSet->getPropertyValue("State") >>= nTemp; m_aRun->append(OOO_STRING_SVTOOLS_RTF_FFRES); m_aRun->append((sal_Int32)nTemp); @@ -1644,7 +1644,7 @@ void RtfAttributeOutput::OutputFlyFrame_Impl( const sw::Frame& rFrame, const Poi // field result is empty, ffres already contains the form result m_aRun->append("}{" OOO_STRING_SVTOOLS_RTF_FLDRSLT " "); } - else if (xInfo->supportsService(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.component.TextField")))) + else if (xInfo->supportsService("com.sun.star.form.component.TextField")) { OStringBuffer aBuf; OString aStr; @@ -1654,12 +1654,12 @@ void RtfAttributeOutput::OutputFlyFrame_Impl( const sw::Frame& rFrame, const Poi m_aRun->append(OUStringToOString(OUString(FieldString(ww::eFORMTEXT)), m_rExport.eCurrentEncoding)); m_aRun->append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_DATAFIELD " "); for (int i = 0; i < 8; i++) aBuf.append((sal_Char)0x00); - xPropSet->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Name"))) >>= aTmp; + xPropSet->getPropertyValue("Name") >>= aTmp; aStr = OUStringToOString(aTmp, m_rExport.eCurrentEncoding); aBuf.append((sal_Char)aStr.getLength()); aBuf.append(aStr); aBuf.append((sal_Char)0x00); - xPropSet->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultText"))) >>= aTmp; + xPropSet->getPropertyValue("DefaultText") >>= aTmp; aStr = OUStringToOString(aTmp, m_rExport.eCurrentEncoding); aBuf.append((sal_Char)aStr.getLength()); aBuf.append(aStr); @@ -1670,11 +1670,11 @@ void RtfAttributeOutput::OutputFlyFrame_Impl( const sw::Frame& rFrame, const Poi m_aRun->append(m_rExport.OutHex(*pStr, 2)); m_aRun->append('}'); m_aRun->append("}{" OOO_STRING_SVTOOLS_RTF_FLDRSLT " "); - xPropSet->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Text"))) >>= aTmp; + xPropSet->getPropertyValue("Text") >>= aTmp; m_aRun->append(OUStringToOString(aTmp, m_rExport.eCurrentEncoding)); m_aRun->append('}'); m_aRun->append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FORMFIELD "{"); - sName = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HelpText")); + sName = "HelpText"; if (xPropSetInfo->hasPropertyByName(sName)) { xPropSet->getPropertyValue(sName) >>= aTmp; @@ -1684,7 +1684,7 @@ void RtfAttributeOutput::OutputFlyFrame_Impl( const sw::Frame& rFrame, const Poi m_aRun->append('}'); } - sName = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HelpF1Text")); + sName = "HelpF1Text"; if (xPropSetInfo->hasPropertyByName(sName)) { xPropSet->getPropertyValue(sName) >>= aTmp; @@ -1695,7 +1695,7 @@ void RtfAttributeOutput::OutputFlyFrame_Impl( const sw::Frame& rFrame, const Poi } m_aRun->append("}"); } - else if (xInfo->supportsService(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.component.ListBox")))) + else if (xInfo->supportsService("com.sun.star.form.component.ListBox")) { OUString aStr; uno::Sequence<sal_Int16> aIntSeq; @@ -1706,7 +1706,7 @@ void RtfAttributeOutput::OutputFlyFrame_Impl( const sw::Frame& rFrame, const Poi m_aRun->append(OOO_STRING_SVTOOLS_RTF_FFTYPE "2"); // 2 = list m_aRun->append(OOO_STRING_SVTOOLS_RTF_FFHASLISTBOX); - xPropSet->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultSelection"))) >>= aIntSeq; + xPropSet->getPropertyValue("DefaultSelection") >>= aIntSeq; if( aIntSeq.getLength() ) { m_aRun->append(OOO_STRING_SVTOOLS_RTF_FFDEFRES); @@ -1714,7 +1714,7 @@ void RtfAttributeOutput::OutputFlyFrame_Impl( const sw::Frame& rFrame, const Poi m_aRun->append((sal_Int32)aIntSeq[0]); } - xPropSet->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SelectedItems"))) >>= aIntSeq; + xPropSet->getPropertyValue("SelectedItems") >>= aIntSeq; if( aIntSeq.getLength() ) { m_aRun->append(OOO_STRING_SVTOOLS_RTF_FFRES); @@ -1722,7 +1722,7 @@ void RtfAttributeOutput::OutputFlyFrame_Impl( const sw::Frame& rFrame, const Poi m_aRun->append((sal_Int32)aIntSeq[0]); } - sName = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Name")); + sName = "Name"; if (xPropSetInfo->hasPropertyByName(sName)) { xPropSet->getPropertyValue(sName) >>= aStr; @@ -1731,7 +1731,7 @@ void RtfAttributeOutput::OutputFlyFrame_Impl( const sw::Frame& rFrame, const Poi m_aRun->append('}'); } - sName = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HelpText")); + sName = "HelpText"; if (xPropSetInfo->hasPropertyByName(sName)) { xPropSet->getPropertyValue(sName) >>= aStr; @@ -1741,7 +1741,7 @@ void RtfAttributeOutput::OutputFlyFrame_Impl( const sw::Frame& rFrame, const Poi m_aRun->append('}'); } - sName = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HelpF1Text")); + sName = "HelpF1Text"; if (xPropSetInfo->hasPropertyByName(sName)) { xPropSet->getPropertyValue(sName) >>= aStr; @@ -1752,7 +1752,7 @@ void RtfAttributeOutput::OutputFlyFrame_Impl( const sw::Frame& rFrame, const Poi } - xPropSet->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("StringItemList"))) >>= aStrSeq; + xPropSet->getPropertyValue("StringItemList") >>= aStrSeq; sal_uInt32 nListItems = aStrSeq.getLength(); for (sal_uInt32 i = 0; i < nListItems; i++) m_aRun->append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFL " ") diff --git a/sw/source/filter/ww8/rtfexportfilter.cxx b/sw/source/filter/ww8/rtfexportfilter.cxx index b417f3049ea4..72bec5044a64 100644 --- a/sw/source/filter/ww8/rtfexportfilter.cxx +++ b/sw/source/filter/ww8/rtfexportfilter.cxx @@ -123,12 +123,12 @@ void RtfExportFilter::setSourceDocument( const uno::Reference< lang::XComponent OUString RtfExport_getImplementationName() { - return OUString( RTL_CONSTASCII_USTRINGPARAM( IMPL_NAME_RTFEXPORT ) ); + return OUString( IMPL_NAME_RTFEXPORT ); } uno::Sequence< OUString > SAL_CALL RtfExport_getSupportedServiceNames() throw() { - const OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.ExportFilter" ) ); + const OUString aServiceName( "com.sun.star.document.ExportFilter" ); const uno::Sequence< OUString > aSeq( &aServiceName, 1 ); return aSeq; } diff --git a/sw/source/filter/ww8/rtfimportfilter.cxx b/sw/source/filter/ww8/rtfimportfilter.cxx index e3b553bcaaa1..284e6456c7e3 100644 --- a/sw/source/filter/ww8/rtfimportfilter.cxx +++ b/sw/source/filter/ww8/rtfimportfilter.cxx @@ -84,7 +84,7 @@ sal_Bool RtfImportFilter::filter( const uno::Sequence< beans::PropertyValue >& a OUString sTemp; for ( sal_Int32 i = 0; i < aDescriptor.getLength(); i++ ) { - if( aDescriptor[i].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("URL")) ) + if( aDescriptor[i].Name == "URL" ) { aDescriptor[i].Value >>= sTemp; aURL = sTemp; @@ -114,12 +114,12 @@ void RtfImportFilter::setTargetDocument( const uno::Reference< lang::XComponent OUString RtfImport_getImplementationName() { - return OUString( RTL_CONSTASCII_USTRINGPARAM( IMPL_NAME_RTFIMPORT ) ); + return OUString( IMPL_NAME_RTFIMPORT ); } uno::Sequence< OUString > SAL_CALL RtfImport_getSupportedServiceNames() throw() { - const OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.ImportFilter" ) ); + const OUString aServiceName( "com.sun.star.document.ImportFilter" ); const uno::Sequence< OUString > aSeq( &aServiceName, 1 ); return aSeq; } diff --git a/sw/source/filter/ww8/rtfsdrexport.cxx b/sw/source/filter/ww8/rtfsdrexport.cxx index 3ea06130c457..0916342b2c70 100644 --- a/sw/source/filter/ww8/rtfsdrexport.cxx +++ b/sw/source/filter/ww8/rtfsdrexport.cxx @@ -432,7 +432,7 @@ void RtfSdrExport::impl_writeGraphic() uno::Reference<drawing::XShape> xShape = GetXShapeForSdrObject(const_cast<SdrObject*>(m_pSdrObject)); uno::Reference<beans::XPropertySet> xPropertySet(xShape, uno::UNO_QUERY); OUString sGraphicURL; - xPropertySet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("GraphicURL"))) >>= sGraphicURL; + xPropertySet->getPropertyValue("GraphicURL") >>= sGraphicURL; OString aURLBS(OUStringToOString(sGraphicURL, RTL_TEXTENCODING_UTF8)); const char aURLBegin[] = "vnd.sun.star.GraphicObject:"; Graphic aGraphic = GraphicObject(aURLBS.copy(RTL_CONSTASCII_LENGTH(aURLBegin))).GetTransformedGraphic(); diff --git a/sw/source/filter/ww8/sortedarray.hxx b/sw/source/filter/ww8/sortedarray.hxx index 3beca5959e19..7a559b565b0d 100644 --- a/sw/source/filter/ww8/sortedarray.hxx +++ b/sw/source/filter/ww8/sortedarray.hxx @@ -80,12 +80,12 @@ namespace ww { if (!bBroken) { - sError = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + sError = "WW8: Duplicate in list, almost certainly don't " "want that!\n" "(You will not see this message again unless you " "restart)\n" - "Extra entries are...\n")); + "Extra entries are...\n"; bBroken=true; } diff --git a/sw/source/filter/ww8/writerwordglue.cxx b/sw/source/filter/ww8/writerwordglue.cxx index 3b289d916d00..de8247666915 100644 --- a/sw/source/filter/ww8/writerwordglue.cxx +++ b/sw/source/filter/ww8/writerwordglue.cxx @@ -774,7 +774,7 @@ namespace sw SwapQuotesInField(rParams); // Force to Japanese when finding one of 'geaE' - rtl::OUString sJChars(RTL_CONSTASCII_USTRINGPARAM("geE")); + rtl::OUString sJChars( "geE" ); bool bForceJapanese = ( STRING_NOTFOUND != rParams.SearchChar( sJChars.getStr() ) ); if ( bForceJapanese ) { diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index 998197d008c9..53f95ad594b6 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -122,17 +122,17 @@ static String lcl_getFieldCode( const IFieldmark* pFieldmark ) { if ( !pFieldmark) { return String(); - } else if ( pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMTEXT ) ) ) { + } else if ( pFieldmark->GetFieldname( ) == ODF_FORMTEXT ) { return String::CreateFromAscii(" FORMTEXT "); - } else if ( pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMDROPDOWN ) ) ) { + } else if ( pFieldmark->GetFieldname( ) == ODF_FORMDROPDOWN ) { return String::CreateFromAscii(" FORMDROPDOWN "); - } else if ( pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMCHECKBOX ) ) ) { + } else if ( pFieldmark->GetFieldname( ) == ODF_FORMCHECKBOX ) { return String::CreateFromAscii(" FORMCHECKBOX "); - } else if ( pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_TOC ) ) ) { + } else if ( pFieldmark->GetFieldname( ) == ODF_TOC ) { return String::CreateFromAscii(" TOC "); - } else if ( pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_HYPERLINK ) ) ) { + } else if ( pFieldmark->GetFieldname( ) == ODF_HYPERLINK ) { return String::CreateFromAscii(" HYPERLINK "); - } else if ( pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_PAGEREF ) ) ) { + } else if ( pFieldmark->GetFieldname( ) == ODF_PAGEREF ) { return String::CreateFromAscii(" PAGEREF "); } else { return pFieldmark->GetFieldname(); @@ -143,17 +143,17 @@ ww::eField lcl_getFieldId( const IFieldmark* pFieldmark ) { OSL_ENSURE(pFieldmark!=NULL, "where is my fieldmark???"); if ( !pFieldmark ) { return ww::eUNKNOWN; - } else if ( pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMTEXT ) ) ) { + } else if ( pFieldmark->GetFieldname( ) == ODF_FORMTEXT ) { return ww::eFORMTEXT; - } else if ( pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMDROPDOWN ) ) ) { + } else if ( pFieldmark->GetFieldname( ) == ODF_FORMDROPDOWN ) { return ww::eFORMDROPDOWN; - } else if ( pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMCHECKBOX ) ) ) { + } else if ( pFieldmark->GetFieldname( ) == ODF_FORMCHECKBOX ) { return ww::eFORMCHECKBOX; - } else if ( pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_TOC ) ) ) { + } else if ( pFieldmark->GetFieldname( ) == ODF_TOC ) { return ww::eTOC; - } else if ( pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_HYPERLINK ) ) ) { + } else if ( pFieldmark->GetFieldname( ) == ODF_HYPERLINK ) { return ww::eHYPERLINK; - } else if ( pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_PAGEREF ) ) ) { + } else if ( pFieldmark->GetFieldname( ) == ODF_PAGEREF ) { return ww::ePAGEREF; } else { return ww::eUNKNOWN; @@ -1839,14 +1839,13 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode ) ::sw::mark::IFieldmark const * const pFieldmark = pMarkAccess->getFieldmarkFor( aPosition ); OSL_ENSURE( pFieldmark, "Looks like this doc is broken...; where is the Fieldmark for the FIELDSTART??" ); - if ( pFieldmark && pFieldmark->GetFieldname().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMTEXT ) ) ) + if ( pFieldmark && pFieldmark->GetFieldname() == ODF_FORMTEXT ) AppendBookmark( pFieldmark->GetName(), false ); ww::eField eFieldId = lcl_getFieldId( pFieldmark ); String sCode = lcl_getFieldCode( pFieldmark ); - if ( pFieldmark && pFieldmark->GetFieldname().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_UNHANDLED ) ) ) + if ( pFieldmark && pFieldmark->GetFieldname() == ODF_UNHANDLED ) { - IFieldmark::parameter_map_t::const_iterator it = pFieldmark->GetParameters()->find( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ODF_ID_PARAM )) ); + IFieldmark::parameter_map_t::const_iterator it = pFieldmark->GetParameters()->find( ODF_ID_PARAM ); if ( it != pFieldmark->GetParameters()->end() ) { rtl::OUString sFieldId; @@ -1854,8 +1853,7 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode ) eFieldId = (ww::eField)sFieldId.toInt32(); } - it = pFieldmark->GetParameters()->find( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ODF_CODE_PARAM )) ); + it = pFieldmark->GetParameters()->find( ODF_CODE_PARAM ); if ( it != pFieldmark->GetParameters()->end() ) { rtl::OUString sOUCode; @@ -1864,17 +1862,16 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode ) } } OutputField( NULL, eFieldId, sCode, WRITEFIELD_START | WRITEFIELD_CMD_START ); - if ( pFieldmark && pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMTEXT ) ) ) + if ( pFieldmark && pFieldmark->GetFieldname( ) == ODF_FORMTEXT ) WriteFormData( *pFieldmark ); - else if ( pFieldmark && pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_HYPERLINK ) ) ) + else if ( pFieldmark && pFieldmark->GetFieldname( ) == ODF_HYPERLINK ) WriteHyperlinkData( *pFieldmark ); OutputField( NULL, lcl_getFieldId( pFieldmark ), String(), WRITEFIELD_CMD_END ); - if ( pFieldmark && pFieldmark->GetFieldname().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_UNHANDLED ) ) ) + if ( pFieldmark && pFieldmark->GetFieldname() == ODF_UNHANDLED ) { // Check for the presence of a linked OLE object - IFieldmark::parameter_map_t::const_iterator it = pFieldmark->GetParameters()->find( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ODF_OLE_PARAM )) ); + IFieldmark::parameter_map_t::const_iterator it = pFieldmark->GetParameters()->find( ODF_OLE_PARAM ); if ( it != pFieldmark->GetParameters()->end() ) { rtl::OUString sOleId; @@ -1892,10 +1889,9 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode ) OSL_ENSURE( pFieldmark, "Looks like this doc is broken...; where is the Fieldmark for the FIELDEND??" ); ww::eField eFieldId = lcl_getFieldId( pFieldmark ); - if ( pFieldmark && pFieldmark->GetFieldname().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_UNHANDLED ) ) ) + if ( pFieldmark && pFieldmark->GetFieldname() == ODF_UNHANDLED ) { - IFieldmark::parameter_map_t::const_iterator it = pFieldmark->GetParameters()->find( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ODF_ID_PARAM )) ); + IFieldmark::parameter_map_t::const_iterator it = pFieldmark->GetParameters()->find( ODF_ID_PARAM ); if ( it != pFieldmark->GetParameters()->end() ) { rtl::OUString sFieldId; @@ -1905,7 +1901,7 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode ) } OutputField( NULL, eFieldId, String(), WRITEFIELD_CLOSE ); - if ( pFieldmark && pFieldmark->GetFieldname().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMTEXT ) ) ) + if ( pFieldmark && pFieldmark->GetFieldname() == ODF_FORMTEXT ) AppendBookmark( pFieldmark->GetName(), false ); } else if ( ch == CH_TXT_ATR_FORMELEMENT ) @@ -1914,8 +1910,8 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode ) ::sw::mark::IFieldmark const * const pFieldmark = pMarkAccess->getFieldmarkFor( aPosition ); OSL_ENSURE( pFieldmark, "Looks like this doc is broken...; where is the Fieldmark for the FIELDSTART??" ); - bool isDropdownOrCheckbox = pFieldmark && (pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMDROPDOWN ) ) || - pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMCHECKBOX ) )); + bool isDropdownOrCheckbox = pFieldmark && (pFieldmark->GetFieldname( ) == ODF_FORMDROPDOWN || + pFieldmark->GetFieldname( ) == ODF_FORMCHECKBOX ); if ( isDropdownOrCheckbox ) AppendBookmark( pFieldmark->GetName(), 0 ); diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index d7170af48c5c..048a547169b9 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -3464,21 +3464,21 @@ void WW8Export::WriteFormData( const ::sw::mark::IFieldmark& rFieldmark ) const ::sw::mark::ICheckboxFieldmark* pAsCheckbox = dynamic_cast< const ::sw::mark::ICheckboxFieldmark* >( pFieldmark ); - OSL_ENSURE(rFieldmark.GetFieldname().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMTEXT ) ) || - rFieldmark.GetFieldname().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMDROPDOWN ) ) || - rFieldmark.GetFieldname().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMCHECKBOX ) ), "Unknown field type!!!"); - if ( ! ( rFieldmark.GetFieldname().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMTEXT ) ) || - rFieldmark.GetFieldname().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMDROPDOWN ) ) || - rFieldmark.GetFieldname().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMCHECKBOX ) ) ) ) + OSL_ENSURE(rFieldmark.GetFieldname() == ODF_FORMTEXT || + rFieldmark.GetFieldname() == ODF_FORMDROPDOWN || + rFieldmark.GetFieldname() == ODF_FORMCHECKBOX, "Unknown field type!!!"); + if ( ! ( rFieldmark.GetFieldname() == ODF_FORMTEXT || + rFieldmark.GetFieldname() == ODF_FORMDROPDOWN || + rFieldmark.GetFieldname() == ODF_FORMCHECKBOX ) ) return; int type = 0; // TextFieldmark if ( pAsCheckbox ) type = 1; - if ( rFieldmark.GetFieldname().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMDROPDOWN ) ) ) + if ( rFieldmark.GetFieldname() == ODF_FORMDROPDOWN ) type=2; - ::sw::mark::IFieldmark::parameter_map_t::const_iterator pNameParameter = rFieldmark.GetParameters()->find(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("name"))); + ::sw::mark::IFieldmark::parameter_map_t::const_iterator pNameParameter = rFieldmark.GetParameters()->find("name"); ::rtl::OUString ffname; if(pNameParameter != rFieldmark.GetParameters()->end()) pNameParameter->second >>= ffname; @@ -3518,7 +3518,7 @@ void WW8Export::WriteFormData( const ::sw::mark::IFieldmark& rFieldmark ) ffres = 1; else if ( type == 2 ) { - ::sw::mark::IFieldmark::parameter_map_t::const_iterator pResParameter = rFieldmark.GetParameters()->find(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ODF_FORMDROPDOWN_RESULT))); + ::sw::mark::IFieldmark::parameter_map_t::const_iterator pResParameter = rFieldmark.GetParameters()->find(ODF_FORMDROPDOWN_RESULT); if(pResParameter != rFieldmark.GetParameters()->end()) pResParameter->second >>= ffres; else @@ -3531,7 +3531,7 @@ void WW8Export::WriteFormData( const ::sw::mark::IFieldmark& rFieldmark ) { aFldHeader.bits |= 0x8000; // ffhaslistbox const ::sw::mark::IFieldmark::parameter_map_t* const pParameters = rFieldmark.GetParameters(); - ::sw::mark::IFieldmark::parameter_map_t::const_iterator pListEntries = pParameters->find(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ODF_FORMDROPDOWN_LISTENTRY))); + ::sw::mark::IFieldmark::parameter_map_t::const_iterator pListEntries = pParameters->find(ODF_FORMDROPDOWN_LISTENTRY); if(pListEntries != pParameters->end()) { uno::Sequence< ::rtl::OUString > vListEntries; @@ -3769,26 +3769,26 @@ const NfKeywordTable & MSWordExportBase::GetNfKeywordTable() { pKeyMap.reset(new NfKeywordTable); NfKeywordTable & rKeywordTable = *pKeyMap; - rKeywordTable[NF_KEY_D] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("d")); - rKeywordTable[NF_KEY_DD] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("dd")); - rKeywordTable[NF_KEY_DDD] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ddd")); - rKeywordTable[NF_KEY_DDDD] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("dddd")); - rKeywordTable[NF_KEY_M] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("M")); - rKeywordTable[NF_KEY_MM] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MM")); - rKeywordTable[NF_KEY_MMM] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MMM")); - rKeywordTable[NF_KEY_MMMM] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MMMM")); - rKeywordTable[NF_KEY_NN] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ddd")); - rKeywordTable[NF_KEY_NNN] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("dddd")); - rKeywordTable[NF_KEY_NNNN] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("dddd")); - rKeywordTable[NF_KEY_YY] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("yy")); - rKeywordTable[NF_KEY_YYYY] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("yyyy")); - rKeywordTable[NF_KEY_H] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("H")); - rKeywordTable[NF_KEY_HH] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HH")); - rKeywordTable[NF_KEY_MI] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("m")); - rKeywordTable[NF_KEY_MMI] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("mm")); - rKeywordTable[NF_KEY_S] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("s")); - rKeywordTable[NF_KEY_SS] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ss")); - rKeywordTable[NF_KEY_AMPM] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AM/PM")); + rKeywordTable[NF_KEY_D] = "d"; + rKeywordTable[NF_KEY_DD] = "dd"; + rKeywordTable[NF_KEY_DDD] = "ddd"; + rKeywordTable[NF_KEY_DDDD] = "dddd"; + rKeywordTable[NF_KEY_M] = "M"; + rKeywordTable[NF_KEY_MM] = "MM"; + rKeywordTable[NF_KEY_MMM] = "MMM"; + rKeywordTable[NF_KEY_MMMM] = "MMMM"; + rKeywordTable[NF_KEY_NN] = "ddd"; + rKeywordTable[NF_KEY_NNN] = "dddd"; + rKeywordTable[NF_KEY_NNNN] = "dddd"; + rKeywordTable[NF_KEY_YY] = "yy"; + rKeywordTable[NF_KEY_YYYY] = "yyyy"; + rKeywordTable[NF_KEY_H] = "H"; + rKeywordTable[NF_KEY_HH] = "HH"; + rKeywordTable[NF_KEY_MI] = "m"; + rKeywordTable[NF_KEY_MMI] = "mm"; + rKeywordTable[NF_KEY_S] = "s"; + rKeywordTable[NF_KEY_SS] = "ss"; + rKeywordTable[NF_KEY_AMPM] = "AM/PM"; } return *pKeyMap; diff --git a/sw/source/filter/ww8/wrtww8gr.cxx b/sw/source/filter/ww8/wrtww8gr.cxx index b1d7bcad1028..6524abc348d0 100644 --- a/sw/source/filter/ww8/wrtww8gr.cxx +++ b/sw/source/filter/ww8/wrtww8gr.cxx @@ -274,7 +274,7 @@ void WW8Export::OutputOLENode( const SwOLENode& rOLENode ) GetOLEExp().ExportOLEObject( aObjRef, *xOleStg ); if ( nAspect == embed::Aspects::MSOLE_ICON ) { - ::rtl::OUString aObjInfo( RTL_CONSTASCII_USTRINGPARAM( "\3ObjInfo" ) ); + ::rtl::OUString aObjInfo( "\3ObjInfo" ); if ( !xOleStg->IsStream( aObjInfo ) ) { const sal_uInt8 pObjInfoData[] = { 0x40, 0x00, 0x03, 0x00 }; @@ -353,8 +353,7 @@ void WW8Export::OutputOLENode( const SwOLENode& rOLENode ) void WW8Export::OutputLinkedOLE( const rtl::OUString& rOleId ) { uno::Reference< embed::XStorage > xDocStg = pDoc->GetDocStorage(); - uno::Reference< embed::XStorage > xOleStg = xDocStg->openStorageElement( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OLELinks")), embed::ElementModes::READ ); + uno::Reference< embed::XStorage > xOleStg = xDocStg->openStorageElement( "OLELinks", embed::ElementModes::READ ); SotStorageRef xObjSrc = SotStorage::OpenOLEStorage( xOleStg, rOleId, STREAM_READ ); SotStorageRef xObjStg = GetWriter().GetStorage().OpenSotStorage( diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 84d3752d4a8c..7f7354fa6710 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -216,13 +216,13 @@ bool BasicProjImportHelper::import( const uno::Reference< io::XInputStream >& rx rtl::OUString BasicProjImportHelper::getProjectName() { - rtl::OUString sProjName( RTL_CONSTASCII_USTRINGPARAM("Standard") ); + rtl::OUString sProjName( "Standard" ); uno::Reference< beans::XPropertySet > xProps( mrDocShell.GetModel(), uno::UNO_QUERY ); if ( xProps.is() ) { try { - uno::Reference< script::vba::XVBACompatibility > xVBA( xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "BasicLibraries" ) ) ), uno::UNO_QUERY_THROW ); + uno::Reference< script::vba::XVBACompatibility > xVBA( xProps->getPropertyValue( "BasicLibraries" ), uno::UNO_QUERY_THROW ); sProjName = xVBA->getProjectName(); } @@ -771,7 +771,7 @@ SdrObject* SwMSDffManager::ProcessObj(SvStream& rSt, { fExtraTextRotation /= 100.0; SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)pCustomShape->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) ); - const rtl::OUString sTextRotateAngle( RTL_CONSTASCII_USTRINGPARAM ( "TextRotateAngle" ) ); + const rtl::OUString sTextRotateAngle( "TextRotateAngle" ); com::sun::star::beans::PropertyValue aPropVal; aPropVal.Name = sTextRotateAngle; aPropVal.Value <<= fExtraTextRotation; @@ -1590,10 +1590,9 @@ void SwWW8ImplReader::ImportDop() sal_Bool bValue = false; if (xInfo.is()) { - if (xInfo->hasPropertyByName(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ApplyFormDesignMode")))) + if (xInfo->hasPropertyByName("ApplyFormDesignMode")) { - xDocProps->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ApplyFormDesignMode")), - cppu::bool2any(bValue)); + xDocProps->setPropertyValue("ApplyFormDesignMode", cppu::bool2any(bValue)); } } } @@ -4307,7 +4306,7 @@ bool SwWW8ImplReader::ReadGlobalTemplateSettings( const rtl::OUString& sCreatedF uno::Sequence< rtl::OUString > sGlobalTemplates; // first get the autoload addins in the directory STARTUP - uno::Reference< ucb::XSimpleFileAccess > xSFA( ::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.SimpleFileAccess")) ), uno::UNO_QUERY_THROW ); + uno::Reference< ucb::XSimpleFileAccess > xSFA( ::comphelper::getProcessServiceFactory()->createInstance( "com.sun.star.ucb.SimpleFileAccess" ), uno::UNO_QUERY_THROW ); if( xSFA->isFolder( aAddinPath ) ) sGlobalTemplates = xSFA->getFolderContents( aAddinPath, sal_False ); @@ -4334,7 +4333,7 @@ bool SwWW8ImplReader::ReadGlobalTemplateSettings( const rtl::OUString& sCreatedF aBasicImporter.import( mpDocShell->GetMedium()->GetInputStream() ); lcl_createTemplateToProjectEntry( xPrjNameCache, aURL, aBasicImporter.getProjectName() ); // Read toolbars & menus - SvStorageStreamRef refMainStream = rRoot->OpenSotStream( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("WordDocument") ) ); + SvStorageStreamRef refMainStream = rRoot->OpenSotStream( String::CreateFromAscii( "WordDocument" )); refMainStream->SetNumberFormatInt(NUMBERFORMAT_INT_LITTLEENDIAN); WW8Fib aWwFib( *refMainStream, 8 ); SvStorageStreamRef xTableStream = rRoot->OpenSotStream(String::CreateFromAscii( aWwFib.fWhichTblStm ? SL::a1Table : SL::a0Table), STREAM_STD_READ); @@ -4598,7 +4597,7 @@ sal_uLong SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss, const SwPosition &rPos) uno::Reference< container::XNameContainer > xPrjNameCache; uno::Reference< lang::XMultiServiceFactory> xSF(mpDocShell->GetModel(), uno::UNO_QUERY); if ( xSF.is() ) - xPrjNameCache.set( xSF->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.VBAProjectNameProvider" ) ) ), uno::UNO_QUERY ); + xPrjNameCache.set( xSF->createInstance( "ooo.vba.VBAProjectNameProvider" ), uno::UNO_QUERY ); // Read Global templates ReadGlobalTemplateSettings( sCreatedFrom, xPrjNameCache ); @@ -4607,7 +4606,7 @@ sal_uLong SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss, const SwPosition &rPos) uno::Any aGlobs; uno::Sequence< uno::Any > aArgs(1); aArgs[ 0 ] <<= mpDocShell->GetModel(); - aGlobs <<= ::comphelper::getProcessServiceFactory()->createInstanceWithArguments( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.Globals")), aArgs ); + aGlobs <<= ::comphelper::getProcessServiceFactory()->createInstanceWithArguments( "ooo.vba.word.Globals", aArgs ); BasicManager *pBasicMan = mpDocShell->GetBasicManager(); if (pBasicMan) pBasicMan->SetGlobalUNOConstant( "VBAGlobals", aGlobs ); @@ -5465,9 +5464,7 @@ sal_uLong WW8Reader::OpenMainStream( SvStorageStreamRef& rRef, sal_uInt16& rBuff { sal_uLong nRet = ERR_SWG_READ_ERROR; OSL_ENSURE( pStg, "wo ist mein Storage?" ); - rRef = pStg->OpenSotStream( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("WordDocument")), - STREAM_READ | STREAM_SHARE_DENYALL); + rRef = pStg->OpenSotStream( String::CreateFromAscii( "WordDocument" ), STREAM_READ | STREAM_SHARE_DENYALL); if( rRef.Is() ) { diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx index 3ac1645b39ba..f6bed3cd8d89 100644 --- a/sw/source/filter/ww8/ww8par3.cxx +++ b/sw/source/filter/ww8/ww8par3.cxx @@ -168,9 +168,9 @@ eF_ResT SwWW8ImplReader::Read_F_FormTextBox( WW8FieldDesc* pF, String& rStr ) if (aBookmarkName.Len()>0) { maFieldStack.back().SetBookmarkName(aBookmarkName); - maFieldStack.back().SetBookmarkType(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ODF_FORMTEXT))); - maFieldStack.back().getParameters()[::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Description"))] = uno::makeAny(::rtl::OUString(aFormula.sToolTip)); - maFieldStack.back().getParameters()[::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Name"))] = uno::makeAny(::rtl::OUString(aFormula.sTitle)); + maFieldStack.back().SetBookmarkType(ODF_FORMTEXT); + maFieldStack.back().getParameters()["Description"] = uno::makeAny(::rtl::OUString(aFormula.sToolTip)); + maFieldStack.back().getParameters()["Name"] = uno::makeAny(::rtl::OUString(aFormula.sTitle)); } return FLD_TEXT; } @@ -217,14 +217,13 @@ eF_ResT SwWW8ImplReader::Read_F_FormCheckBox( WW8FieldDesc* pF, String& rStr ) { IDocumentMarkAccess* pMarksAccess = rDoc.getIDocumentMarkAccess( ); IFieldmark* pFieldmark = dynamic_cast<IFieldmark*>( pMarksAccess->makeNoTextFieldBookmark( - *pPaM, aBookmarkName, - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ODF_FORMCHECKBOX )) ) ); + *pPaM, aBookmarkName, ODF_FORMCHECKBOX ) ); OSL_ENSURE(pFieldmark!=NULL, "hmmm; why was the bookmark not created?"); if (pFieldmark!=NULL) { IFieldmark::parameter_map_t* const pParameters = pFieldmark->GetParameters(); ICheckboxFieldmark* pCheckboxFm = dynamic_cast<ICheckboxFieldmark*>(pFieldmark); - (*pParameters)[::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ODF_FORMCHECKBOX_NAME))] = uno::makeAny(::rtl::OUString(aFormula.sTitle)); - (*pParameters)[::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ODF_FORMCHECKBOX_HELPTEXT))] = uno::makeAny(::rtl::OUString(aFormula.sToolTip)); + (*pParameters)[ODF_FORMCHECKBOX_NAME] = uno::makeAny(::rtl::OUString(aFormula.sTitle)); + (*pParameters)[ODF_FORMCHECKBOX_HELPTEXT] = uno::makeAny(::rtl::OUString(aFormula.sToolTip)); if(pCheckboxFm) pCheckboxFm->SetChecked(aFormula.nChecked); @@ -291,16 +290,15 @@ eF_ResT SwWW8ImplReader::Read_F_FormListBox( WW8FieldDesc* pF, String& rStr) { IDocumentMarkAccess* pMarksAccess = rDoc.getIDocumentMarkAccess( ); IFieldmark *pFieldmark = dynamic_cast<IFieldmark*>( - pMarksAccess->makeNoTextFieldBookmark( *pPaM, aBookmarkName, - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ODF_FORMDROPDOWN )) ) ); + pMarksAccess->makeNoTextFieldBookmark( *pPaM, aBookmarkName, ODF_FORMDROPDOWN ) ); OSL_ENSURE(pFieldmark!=NULL, "hmmm; why was the bookmark not created?"); if ( pFieldmark != NULL ) { uno::Sequence< ::rtl::OUString > vListEntries(aFormula.maListEntries.size()); ::std::copy(aFormula.maListEntries.begin(), aFormula.maListEntries.end(), ::comphelper::stl_begin(vListEntries)); - (*pFieldmark->GetParameters())[::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ODF_FORMDROPDOWN_LISTENTRY))] = uno::makeAny(vListEntries); + (*pFieldmark->GetParameters())[ODF_FORMDROPDOWN_LISTENTRY] = uno::makeAny(vListEntries); sal_Int32 nIndex = aFormula.fDropdownIndex < aFormula.maListEntries.size() ? aFormula.fDropdownIndex : 0; - (*pFieldmark->GetParameters())[::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ODF_FORMDROPDOWN_RESULT))] = uno::makeAny(nIndex); + (*pFieldmark->GetParameters())[ODF_FORMDROPDOWN_RESULT] = uno::makeAny(nIndex); // set field data here... } } @@ -2185,7 +2183,7 @@ void WW8FormulaControl::FormulaRead(SwWw8ControlType nWhich, { if ( iRes != 25 ) nChecked = iRes; - sDefault = ( wDef == 0 ) ? rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("0") ) : rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("1") ); + sDefault = ( wDef == 0 ) ? "0" : "1"; } } // xstzTextFormat diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx index b5fcd5694cfc..0a24803c4e11 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -694,7 +694,7 @@ sal_uInt16 SwWW8ImplReader::End_Field() SwPaM aFldPam( maFieldStack.back().GetPtNode(), maFieldStack.back().GetPtCntnt(), aEndPos.nNode, aEndPos.nContent.GetIndex()); IDocumentMarkAccess* pMarksAccess = rDoc.getIDocumentMarkAccess( ); IFieldmark *pFieldmark = dynamic_cast<IFieldmark*>( pMarksAccess->makeFieldBookmark( - aFldPam, maFieldStack.back().GetBookmarkName(), ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ODF_FORMTEXT )) ) ); + aFldPam, maFieldStack.back().GetBookmarkName(), ODF_FORMTEXT ) ); OSL_ENSURE(pFieldmark!=NULL, "hmmm; why was the bookmark not created?"); if (pFieldmark!=NULL) { const IFieldmark::parameter_map_t& pParametersToAdd = maFieldStack.back().getParameters(); @@ -744,7 +744,7 @@ sal_uInt16 SwWW8ImplReader::End_Field() IFieldmark* pFieldmark = pMarksAccess->makeFieldBookmark( aFldPam, maFieldStack.back().GetBookmarkName(), - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ODF_UNHANDLED )) ); + ODF_UNHANDLED ); if ( pFieldmark ) { const IFieldmark::parameter_map_t& pParametersToAdd = maFieldStack.back().getParameters(); @@ -752,11 +752,11 @@ sal_uInt16 SwWW8ImplReader::End_Field() rtl::OUString sFieldId = rtl::OUString::valueOf( sal_Int32( maFieldStack.back().mnFieldId ) ); pFieldmark->GetParameters()->insert( std::pair< rtl::OUString, uno::Any > ( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ODF_ID_PARAM )), + ODF_ID_PARAM, uno::makeAny( sFieldId ) ) ); pFieldmark->GetParameters()->insert( std::pair< rtl::OUString, uno::Any > ( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ODF_CODE_PARAM )), + ODF_CODE_PARAM, uno::makeAny( aCode ) ) ); if ( maFieldStack.back().mnObjLocFc > 0 ) @@ -773,7 +773,7 @@ sal_uInt16 SwWW8ImplReader::End_Field() if (xDocStg.is()) { uno::Reference< embed::XStorage > xOleStg = xDocStg->openStorageElement( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OLELinks")), embed::ElementModes::WRITE ); + "OLELinks", embed::ElementModes::WRITE ); SotStorageRef xObjDst = SotStorage::OpenOLEStorage( xOleStg, sOleId ); if ( xObjDst.Is() ) @@ -792,8 +792,7 @@ sal_uInt16 SwWW8ImplReader::End_Field() // Store the OLE Id as a parameter pFieldmark->GetParameters()->insert( std::pair< rtl::OUString, uno::Any >( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ODF_OLE_PARAM )), - uno::makeAny( rtl::OUString( sOleId ) ) ) ); + ODF_OLE_PARAM, uno::makeAny( rtl::OUString( sOleId ) ) ) ); } } @@ -2221,9 +2220,9 @@ eF_ResT SwWW8ImplReader::Read_F_PgRef( WW8FieldDesc*, String& rStr ) #if defined(WW_NATIVE_TOC) if (1) { - ::rtl::OUString aBookmarkName=(RTL_CONSTASCII_USTRINGPARAM("_REF")); + ::rtl::OUString aBookmarkName("_REF"); maFieldStack.back().SetBookmarkName(aBookmarkName); - maFieldStack.back().SetBookmarkType(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ODF_PAGEREF))); + maFieldStack.back().SetBookmarkType(ODF_PAGEREF); maFieldStack.back().AddParam(rtl::OUString(), sName); return FLD_TEXT; } @@ -2319,8 +2318,7 @@ bool CanUseRemoteLink(const String &rGrfName) ucb::XCommandEnvironment >() ); rtl::OUString aTitle; - aCnt.getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Title"))) - >>= aTitle; + aCnt.getPropertyValue("Title") >>= aTitle; bUseRemote = !aTitle.isEmpty(); } catch ( ... ) @@ -2930,9 +2928,9 @@ eF_ResT SwWW8ImplReader::Read_F_Tox( WW8FieldDesc* pF, String& rStr ) { #if defined(WW_NATIVE_TOC) if (1) { - ::rtl::OUString aBookmarkName=(RTL_CONSTASCII_USTRINGPARAM("_TOC")); + ::rtl::OUString aBookmarkName("_TOC"); maFieldStack.back().SetBookmarkName(aBookmarkName); - maFieldStack.back().SetBookmarkType(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ODF_TOC))); + maFieldStack.back().SetBookmarkType(ODF_TOC); return FLD_TEXT; } #endif @@ -3453,9 +3451,9 @@ eF_ResT SwWW8ImplReader::Read_F_Hyperlink( WW8FieldDesc* /*pF*/, String& rStr ) { #if defined(WW_NATIVE_TOC) if (1) { - ::rtl::OUString aBookmarkName=(RTL_CONSTASCII_USTRINGPARAM("_HYPERLINK")); + ::rtl::OUString aBookmarkName("_HYPERLINK"); maFieldStack.back().SetBookmarkName(aBookmarkName); - maFieldStack.back().SetBookmarkType(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ODF_HYPERLINK))); + maFieldStack.back().SetBookmarkType(ODF_HYPERLINK); return FLD_TEXT; } #endif diff --git a/sw/source/filter/ww8/ww8toolbar.cxx b/sw/source/filter/ww8/ww8toolbar.cxx index 32472173f3c3..0b668fa69d03 100644 --- a/sw/source/filter/ww8/ww8toolbar.cxx +++ b/sw/source/filter/ww8/ww8toolbar.cxx @@ -64,12 +64,12 @@ MSOWordCommandConvertor::MSOWordCommandConvertor() { // mso command id to ooo command string // #FIXME and *HUNDREDS* of id's to added here - msoToOOcmd[ 0x20b ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(".uno:CloseDoc") ); - msoToOOcmd[ 0x50 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(".uno:Open") ); + msoToOOcmd[ 0x20b ] = ".uno:CloseDoc"; + msoToOOcmd[ 0x50 ] = ".uno:Open"; // mso tcid to ooo command string // #FIXME and *HUNDREDS* of id's to added here - tcidToOOcmd[ 0x9d9 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(".uno:Print") ); + tcidToOOcmd[ 0x9d9 ] = ".uno:Print"; } rtl::OUString MSOWordCommandConvertor::MSOCommandToOOCommand( sal_Int16 key ) @@ -241,8 +241,8 @@ bool CTBWrapper::ImportCustomToolBar( SfxObjectShell& rDocSh ) try { uno::Reference< lang::XMultiServiceFactory > xMSF( ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW ); - uno::Reference< ui::XModuleUIConfigurationManagerSupplier > xAppCfgSupp( xMSF->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.ModuleUIConfigurationManagerSupplier" ) ) ), uno::UNO_QUERY_THROW ); - CustomToolBarImportHelper helper( rDocSh, xAppCfgSupp->getUIConfigurationManager( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextDocument" ) ) ) ); + uno::Reference< ui::XModuleUIConfigurationManagerSupplier > xAppCfgSupp( xMSF->createInstance( "com.sun.star.ui.ModuleUIConfigurationManagerSupplier" ), uno::UNO_QUERY_THROW ); + CustomToolBarImportHelper helper( rDocSh, xAppCfgSupp->getUIConfigurationManager( "com.sun.star.text.TextDocument" ) ); helper.setMSOCommandMap( new MSOWordCommandConvertor() ); if ( !(*it).ImportCustomToolBar( *this, helper ) ) @@ -342,9 +342,9 @@ bool Customization::ImportMenu( CTBWrapper& rWrapper, CustomToolBarImportHelper& if ( pCust ) { // currently only support built-in menu - rtl::OUString sMenuBar( RTL_CONSTASCII_USTRINGPARAM("private:resource/menubar/") ); + rtl::OUString sMenuBar( "private:resource/menubar/" ); - sMenuBar = sMenuBar.concat( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("menubar") ) ); + sMenuBar = sMenuBar.concat( "menubar" ); // Get menu name TBC* pTBC = pWrapper->GetTBCAtOffset( it->TBCStreamOffset() ); if ( !pTBC ) @@ -371,16 +371,16 @@ bool Customization::ImportMenu( CTBWrapper& rWrapper, CustomToolBarImportHelper& uno::Reference< lang::XSingleComponentFactory > xSCF( xIndexContainer, uno::UNO_QUERY_THROW ); uno::Reference< beans::XPropertySet > xProps( ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW ); - uno::Reference< uno::XComponentContext > xContext( xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))), uno::UNO_QUERY_THROW ); + uno::Reference< uno::XComponentContext > xContext( xProps->getPropertyValue( "DefaultContext" ), uno::UNO_QUERY_THROW ); // create the popup menu uno::Sequence< beans::PropertyValue > aPopupMenu( 4 ); - aPopupMenu[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("CommandURL") ); - aPopupMenu[0].Value = uno::makeAny( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("vnd.openoffice.org:") ) + sMenuName ); - aPopupMenu[1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Label") ); + aPopupMenu[0].Name = "CommandURL"; + aPopupMenu[0].Value = uno::makeAny( rtl::OUString( "vnd.openoffice.org:" ) + sMenuName ); + aPopupMenu[1].Name = "Label"; aPopupMenu[1].Value <<= sMenuName; - aPopupMenu[2].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Type" ) ); + aPopupMenu[2].Name = "Type"; aPopupMenu[2].Value <<= sal_Int32( 0 ); - aPopupMenu[3].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ItemDescriptorContainer") ); + aPopupMenu[3].Name = "ItemDescriptorContainer"; uno::Reference< container::XIndexContainer > xMenuContainer( xSCF->createInstanceWithContext( xContext ), uno::UNO_QUERY_THROW ); aPopupMenu[3].Value <<= xMenuContainer; if ( pCust->customizationDataCTB.get() && !pCust->customizationDataCTB->ImportMenuTB( rWrapper, xMenuContainer, helper ) ) @@ -565,7 +565,7 @@ CTB::Print( FILE* fp ) bool CTB::ImportCustomToolBar( CTBWrapper& rWrapper, CustomToolBarImportHelper& helper ) { - static rtl::OUString sToolbarPrefix( RTL_CONSTASCII_USTRINGPARAM( "private:resource/toolbar/custom_" ) ); + static rtl::OUString sToolbarPrefix( "private:resource/toolbar/custom_" ); bool bRes = false; try { @@ -577,7 +577,7 @@ bool CTB::ImportCustomToolBar( CTBWrapper& rWrapper, CustomToolBarImportHelper& uno::Reference< beans::XPropertySet > xProps( xIndexContainer, uno::UNO_QUERY_THROW ); // set UI name for toolbar - xProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("UIName") ), uno::makeAny( name.getString() ) ); + xProps->setPropertyValue( "UIName", uno::makeAny( name.getString() ) ); rtl::OUString sToolBarName = sToolbarPrefix.concat( name.getString() ); for ( std::vector< TBC >::iterator it = rTBC.begin(); it != rTBC.end(); ++it ) @@ -711,7 +711,7 @@ TBC::ImportToolBarControl( CTBWrapper& rWrapper, const css::uno::Reference< css: { beans::PropertyValue aProp; - aProp.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("CommandURL") ); + aProp.Name = "CommandURL"; aProp.Value <<= sCommand; props.push_back( aProp ); } @@ -733,7 +733,7 @@ TBC::ImportToolBarControl( CTBWrapper& rWrapper, const css::uno::Reference< css: { uno::Reference< container::XIndexContainer > xMenuDesc; uno::Reference< lang::XMultiServiceFactory > xMSF( ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW ); - xMenuDesc.set( xMSF->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.IndexedPropertyValues" ) ) ), uno::UNO_QUERY_THROW ); + xMenuDesc.set( xMSF->createInstance( "com.sun.star.document.IndexedPropertyValues" ), uno::UNO_QUERY_THROW ); if ( !pCustTB->ImportMenuTB( rWrapper,xMenuDesc, helper ) ) return false; if ( !bIsMenuBar ) @@ -744,7 +744,7 @@ TBC::ImportToolBarControl( CTBWrapper& rWrapper, const css::uno::Reference< css: else { beans::PropertyValue aProp; - aProp.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ItemDescriptorContainer") ); + aProp.Name = "ItemDescriptorContainer"; aProp.Value <<= xMenuDesc; props.push_back( aProp ); } @@ -755,7 +755,7 @@ TBC::ImportToolBarControl( CTBWrapper& rWrapper, const css::uno::Reference< css: { // insert spacer uno::Sequence< beans::PropertyValue > sProps( 1 ); - sProps[ 0 ].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Type") ); + sProps[ 0 ].Name = "Type"; sProps[ 0 ].Value = uno::makeAny( ui::ItemType::SEPARATOR_LINE ); toolbarcontainer->insertByIndex( toolbarcontainer->getCount(), uno::makeAny( sProps ) ); } |