diff options
-rw-r--r-- | vbahelper/source/vbahelper/vbacommandbarhelper.cxx | 3 | ||||
-rw-r--r-- | vbahelper/source/vbahelper/vbadocumentsbase.cxx | 7 | ||||
-rw-r--r-- | vbahelper/source/vbahelper/vbahelper.cxx | 6 | ||||
-rw-r--r-- | vcl/source/font/PhysicalFontCollection.cxx | 4 | ||||
-rw-r--r-- | vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx | 7 | ||||
-rw-r--r-- | vcl/unx/gtk/gtksalmenu.cxx | 2 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 12 | ||||
-rw-r--r-- | writerfilter/source/dmapper/FormControlHelper.cxx | 5 | ||||
-rw-r--r-- | writerfilter/source/dmapper/OLEHandler.cxx | 3 |
9 files changed, 15 insertions, 34 deletions
diff --git a/vbahelper/source/vbahelper/vbacommandbarhelper.cxx b/vbahelper/source/vbahelper/vbacommandbarhelper.cxx index fe6527217805..8bd5fb02a6b6 100644 --- a/vbahelper/source/vbahelper/vbacommandbarhelper.cxx +++ b/vbahelper/source/vbahelper/vbacommandbarhelper.cxx @@ -200,8 +200,7 @@ OUString VbaCommandBarHelper::findToolbarByName( const css::uno::Reference< css: } // the customize toolbars creating during importing, should found there. - static const char sToolbarPrefix[] = "private:resource/toolbar/custom_"; - sResourceUrl = sToolbarPrefix + sName; + sResourceUrl = "private:resource/toolbar/custom_" + sName; if( hasToolbar( sResourceUrl, sName ) ) return sResourceUrl; diff --git a/vbahelper/source/vbahelper/vbadocumentsbase.cxx b/vbahelper/source/vbahelper/vbadocumentsbase.cxx index 230a7f022b1d..28169927e813 100644 --- a/vbahelper/source/vbahelper/vbadocumentsbase.cxx +++ b/vbahelper/source/vbahelper/vbadocumentsbase.cxx @@ -55,9 +55,6 @@ using namespace ::ooo::vba; using namespace ::com::sun::star; -static const char aSpreadsheetDocument[] = "com.sun.star.sheet.SpreadsheetDocument"; -static const char aTextDocument[] = "com.sun.star.text.TextDocument"; - typedef std::unordered_map< OUString, sal_Int32, OUStringHash > NameIndexHash; @@ -131,8 +128,8 @@ public: { uno::Reference< lang::XServiceInfo > xServiceInfo( xEnum->nextElement(), uno::UNO_QUERY ); if ( xServiceInfo.is() - && ( ( xServiceInfo->supportsService( aSpreadsheetDocument ) && meDocType == VbaDocumentsBase::EXCEL_DOCUMENT ) - || ( xServiceInfo->supportsService( aTextDocument ) && meDocType == VbaDocumentsBase::WORD_DOCUMENT ) ) ) + && ( ( xServiceInfo->supportsService( "com.sun.star.sheet.SpreadsheetDocument" ) && meDocType == VbaDocumentsBase::EXCEL_DOCUMENT ) + || ( xServiceInfo->supportsService( "com.sun.star.text.TextDocument" ) && meDocType == VbaDocumentsBase::WORD_DOCUMENT ) ) ) { uno::Reference< frame::XModel > xModel( xServiceInfo, uno::UNO_QUERY_THROW ); // that the spreadsheetdocument is a xmodel is a given m_documents.push_back( xModel ); diff --git a/vbahelper/source/vbahelper/vbahelper.cxx b/vbahelper/source/vbahelper/vbahelper.cxx index 76b0e7e54f55..e19c1288ef0b 100644 --- a/vbahelper/source/vbahelper/vbahelper.cxx +++ b/vbahelper/source/vbahelper/vbahelper.cxx @@ -259,11 +259,10 @@ getThisWordDoc( const uno::Reference< uno::XComponentContext >& xContext ) throw uno::Reference< frame::XModel > getCurrentExcelDoc( const uno::Reference< uno::XComponentContext >& xContext ) throw (uno::RuntimeException) { - static const char sThisExcelDoc[] = "ThisExcelDoc"; uno::Reference< frame::XModel > xModel; try { - xModel = getCurrentDoc( sThisExcelDoc ); + xModel = getCurrentDoc( "ThisExcelDoc" ); } catch (const uno::Exception&) { @@ -275,11 +274,10 @@ getCurrentExcelDoc( const uno::Reference< uno::XComponentContext >& xContext ) t uno::Reference< frame::XModel > getCurrentWordDoc( const uno::Reference< uno::XComponentContext >& xContext ) throw (uno::RuntimeException) { - static const char sThisWordDoc[] = "ThisWordDoc"; uno::Reference< frame::XModel > xModel; try { - xModel = getCurrentDoc( sThisWordDoc ); + xModel = getCurrentDoc( "ThisWordDoc" ); } catch (const uno::Exception&) { diff --git a/vcl/source/font/PhysicalFontCollection.cxx b/vcl/source/font/PhysicalFontCollection.cxx index 9bef807eea5e..0f7449719fc9 100644 --- a/vcl/source/font/PhysicalFontCollection.cxx +++ b/vcl/source/font/PhysicalFontCollection.cxx @@ -1138,9 +1138,7 @@ PhysicalFontFamily* PhysicalFontCollection::FindFontFamily( FontSelectPattern& r a korean bitmap font that is not suitable here. Use the font replacement table, that automatically leads to the desired "HG Mincho Light J". Same story for MS Gothic, there are thai and korean "Gothic" fonts, so we even prefer Andale */ - static const char aMS_Mincho[] = "msmincho"; - static const char aMS_Gothic[] = "msgothic"; - if ((aSearchName != aMS_Mincho) && (aSearchName != aMS_Gothic)) + if ((aSearchName != "msmincho") && (aSearchName != "msgothic")) // TODO: add heuristic to only throw out the fake ms* fonts #endif { diff --git a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx index 26d6c74efe83..d4f8dfb71427 100644 --- a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx +++ b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx @@ -786,8 +786,6 @@ uno::Sequence<OUString> SAL_CALL SalGtkFilePicker::getSelectedFiles() throw( uno if( sExtension.getLength() >= 3 ) // 3 = typical/minimum extension length { - static const char aStarDot[] = "*."; - OUString aNewFilter; OUString aOldFilter = getCurrentFilter(); bool bChangeFilter = true; @@ -797,7 +795,7 @@ uno::Sequence<OUString> SAL_CALL SalGtkFilePicker::getSelectedFiles() throw( uno ++aListIter ) { - if( lcl_matchFilter( aListIter->getFilter(), aStarDot+sExtension ) ) + if( lcl_matchFilter( aListIter->getFilter(), "*." + sExtension ) ) { if( aNewFilter.isEmpty() ) aNewFilter = aListIter->getTitle(); @@ -1831,7 +1829,6 @@ GtkFileFilter* SalGtkFilePicker::implAddFilter( const OUString& rFilter, const O OString aFilterName = OUStringToOString( aShrunkName, RTL_TEXTENCODING_UTF8 ); gtk_file_filter_set_name( filter, aFilterName.getStr() ); - static const char aStarDot[] = "*."; OUString aTokens; bool bAllGlob = rType == "*.*" || rType == "*"; @@ -1845,7 +1842,7 @@ GtkFileFilter* SalGtkFilePicker::implAddFilter( const OUString& rFilter, const O { aToken = rType.getToken( 0, ';', nIndex ); // Assume all have the "*.<extn>" syntax - sal_Int32 nStarDot = aToken.lastIndexOf( aStarDot ); + sal_Int32 nStarDot = aToken.lastIndexOf( "*." ); if (nStarDot >= 0) aToken = aToken.copy( nStarDot + 2 ); if (!aToken.isEmpty()) diff --git a/vcl/unx/gtk/gtksalmenu.cxx b/vcl/unx/gtk/gtksalmenu.cxx index 2d321682fe46..c5cbb542c591 100644 --- a/vcl/unx/gtk/gtksalmenu.cxx +++ b/vcl/unx/gtk/gtksalmenu.cxx @@ -623,7 +623,7 @@ void GtkSalMenu::ShowCloseButton(bool bShow) GtkStyleContext *pButtonContext = gtk_widget_get_style_context(GTK_WIDGET(mpCloseButton)); GtkCssProvider *pProvider = gtk_css_provider_new(); - const gchar data[] = "* { " + static const gchar data[] = "* { " "padding: 0;" "margin-left: 8px;" "margin-right: 8px;" diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index be369fa7a0af..1408a62b59b5 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -1348,10 +1348,9 @@ void DomainMapper_Impl::appendTextContent( void DomainMapper_Impl::appendOLE( const OUString& rStreamName, const OLEHandlerPtr& pOLEHandler ) { - static const char sEmbeddedService[] = "com.sun.star.text.TextEmbeddedObject"; try { - uno::Reference< text::XTextContent > xOLE( m_xTextFactory->createInstance(sEmbeddedService), uno::UNO_QUERY_THROW ); + uno::Reference< text::XTextContent > xOLE( m_xTextFactory->createInstance("com.sun.star.text.TextEmbeddedObject"), uno::UNO_QUERY_THROW ); uno::Reference< beans::XPropertySet > xOLEProperties(xOLE, uno::UNO_QUERY_THROW); OUString aCLSID = pOLEHandler->getCLSID(m_xComponentContext); @@ -1419,10 +1418,9 @@ void DomainMapper_Impl::appendStarMath( const Value& val ) val.getAny() >>= formula; if( formula.is() ) { - static const char sEmbeddedService[] = "com.sun.star.text.TextEmbeddedObject"; try { - uno::Reference< text::XTextContent > xStarMath( m_xTextFactory->createInstance(sEmbeddedService), uno::UNO_QUERY_THROW ); + uno::Reference< text::XTextContent > xStarMath( m_xTextFactory->createInstance("com.sun.star.text.TextEmbeddedObject"), uno::UNO_QUERY_THROW ); uno::Reference< beans::XPropertySet > xStarMathProperties(xStarMath, uno::UNO_QUERY_THROW); xStarMathProperties->setPropertyValue(getPropertyName( PROP_EMBEDDED_OBJECT ), @@ -1470,8 +1468,7 @@ uno::Reference< beans::XPropertySet > DomainMapper_Impl::appendTextSectionAfter( xCursor->gotoEnd( true ); //the paragraph after this new section is already inserted xCursor->goLeft(1, true); - static const char sSectionService[] = "com.sun.star.text.TextSection"; - uno::Reference< text::XTextContent > xSection( m_xTextFactory->createInstance(sSectionService), uno::UNO_QUERY_THROW ); + uno::Reference< text::XTextContent > xSection( m_xTextFactory->createInstance("com.sun.star.text.TextSection"), uno::UNO_QUERY_THROW ); xSection->attach( uno::Reference< text::XTextRange >( xCursor, uno::UNO_QUERY_THROW) ); xRet.set(xSection, uno::UNO_QUERY ); } @@ -4629,10 +4626,9 @@ void DomainMapper_Impl::StartOrEndBookmark( const OUString& rId ) { if( aBookmarkIter != m_aBookmarkMap.end() ) { - static const char sBookmarkService[] = "com.sun.star.text.Bookmark"; if (m_xTextFactory.is()) { - uno::Reference< text::XTextContent > xBookmark( m_xTextFactory->createInstance( sBookmarkService ), uno::UNO_QUERY_THROW ); + uno::Reference< text::XTextContent > xBookmark( m_xTextFactory->createInstance( "com.sun.star.text.Bookmark" ), uno::UNO_QUERY_THROW ); uno::Reference< text::XTextCursor > xCursor; uno::Reference< text::XText > xText = aBookmarkIter->second.m_xTextRange->getText(); if( aBookmarkIter->second.m_bIsStartOfText && !bIsAfterDummyPara) diff --git a/writerfilter/source/dmapper/FormControlHelper.cxx b/writerfilter/source/dmapper/FormControlHelper.cxx index 93c3ae0e9360..f4efa9011ed5 100644 --- a/writerfilter/source/dmapper/FormControlHelper.cxx +++ b/writerfilter/source/dmapper/FormControlHelper.cxx @@ -258,16 +258,13 @@ void FormControlHelper::insertControl(uno::Reference<text::XTextRange> const& xT if (! xFormComps.is()) return; - static const char sControl[] = "Control"; - sal_Int32 nControl = 0; bool bDone = false; OUString sControlName; do { - OUString sTmp(sControl); - sTmp += OUString::number(nControl); + OUString sTmp = "Control" + OUString::number(nControl); nControl++; if (! xFormCompsByName->hasByName(sTmp)) diff --git a/writerfilter/source/dmapper/OLEHandler.cxx b/writerfilter/source/dmapper/OLEHandler.cxx index 13ea16ecfebf..26f12c109f1d 100644 --- a/writerfilter/source/dmapper/OLEHandler.cxx +++ b/writerfilter/source/dmapper/OLEHandler.cxx @@ -273,9 +273,8 @@ OUString OLEHandler::copyOLEOStream( ::oox::ole::SaveInteropProperties(xTextDocument, aURL, nullptr, m_sProgId, m_sDrawAspect); - static const char sProtocol[] = "vnd.sun.star.EmbeddedObject:"; OUString aPersistName( xEmbeddedResolver->resolveEmbeddedObjectURL( aURL ) ); - sRet = aPersistName.copy( strlen(sProtocol) ); + sRet = aPersistName.copy( strlen("vnd.sun.star.EmbeddedObject:") ); } uno::Reference< lang::XComponent > xComp( xEmbeddedResolver, uno::UNO_QUERY_THROW ); |