[Libreoffice-commits] core.git: sdext/source sd/source sfx2/source shell/source starmath/source svgio/source

Noel Grandin noel.grandin at collabora.co.uk
Tue Nov 1 13:25:35 UTC 2016


 sd/source/filter/eppt/epptso.cxx                     |   23 ++++-----------
 sd/source/filter/xml/sdxmlwrp.cxx                    |   13 ++------
 sd/source/ui/dlg/TemplateScanner.cxx                 |   28 ++++++-------------
 sd/source/ui/slidesorter/cache/SlsCacheCompactor.cxx |   12 ++------
 sd/source/ui/slidesorter/controller/SlsListener.cxx  |    7 +---
 sd/source/ui/unoidl/unomodel.cxx                     |    6 +---
 sdext/source/pdfimport/wrapper/wrapper.cxx           |   25 +++++-----------
 sfx2/source/appl/appuno.cxx                          |    6 +---
 sfx2/source/bastyp/frmhtmlw.cxx                      |    4 --
 sfx2/source/bastyp/sfxhtml.cxx                       |   10 ++----
 sfx2/source/dialog/backingcomp.cxx                   |    7 +---
 sfx2/source/dialog/dinfdlg.cxx                       |    6 ----
 sfx2/source/dialog/filtergrouping.cxx                |   16 +++-------
 sfx2/source/doc/DocumentMetadataAccess.cxx           |    7 +---
 sfx2/source/doc/Metadatable.cxx                      |    3 --
 sfx2/source/doc/docfac.cxx                           |   12 ++------
 sfx2/source/doc/guisaveas.cxx                        |    3 --
 sfx2/source/doc/templatedlg.cxx                      |    4 --
 sfx2/source/sidebar/SidebarController.cxx            |    3 --
 sfx2/source/view/viewsh.cxx                          |    6 +---
 shell/source/unix/sysshell/recently_used_file.cxx    |    5 +--
 starmath/source/cfgitem.cxx                          |    4 --
 svgio/source/svgreader/svgtools.cxx                  |    6 +---
 23 files changed, 68 insertions(+), 148 deletions(-)

New commits:
commit 9bdec0831afc45af45ea6d9350ef3372188b45cb
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Tue Nov 1 13:10:08 2016 +0200

    loplugin:oncevar in sd..svgio
    
    Change-Id: I58565460fcc3279c9771c6e1272d0af540b2c87c
    Reviewed-on: https://gerrit.libreoffice.org/30459
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
    Tested-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx
index 0161375..3a320e1 100644
--- a/sd/source/filter/eppt/epptso.cxx
+++ b/sd/source/filter/eppt/epptso.cxx
@@ -3033,12 +3033,8 @@ void PPTWriter::ImplCreateTable( uno::Reference< drawing::XShape >& rXShape, Esc
 {
     try
     {
-        static const char sModel[] = "Model";
-        static const char sWidth[] = "Width";
-        static const char sHeight[] = "Height";
-
         uno::Reference< table::XTable > xTable;
-        if ( mXPropSet->getPropertyValue( sModel ) >>= xTable )
+        if ( mXPropSet->getPropertyValue( "Model" ) >>= xTable )
         {
             uno::Reference< table::XColumnRowRange > xColumnRowRange( xTable, uno::UNO_QUERY_THROW );
             uno::Reference< container::XIndexAccess > xColumns( xColumnRowRange->getColumns(), uno::UNO_QUERY_THROW );
@@ -3055,7 +3051,7 @@ void PPTWriter::ImplCreateTable( uno::Reference< drawing::XShape >& rXShape, Esc
             {
                 uno::Reference< beans::XPropertySet > xPropSet( xColumns->getByIndex( x ), uno::UNO_QUERY_THROW );
                 awt::Size aS( 0, 0 );
-                xPropSet->getPropertyValue( sWidth ) >>= aS.Width;
+                xPropSet->getPropertyValue( "Width" ) >>= aS.Width;
                 awt::Size aM( MapSize( aS ) );
                 aColumns.push_back( std::pair< sal_Int32, sal_Int32 >( nPosition, aM.Width ) );
                 nPosition += aM.Width;
@@ -3068,7 +3064,7 @@ void PPTWriter::ImplCreateTable( uno::Reference< drawing::XShape >& rXShape, Esc
             {
                 uno::Reference< beans::XPropertySet > xPropSet( xRows->getByIndex( y ), uno::UNO_QUERY_THROW );
                 awt::Size aS( 0, 0 );
-                xPropSet->getPropertyValue( sHeight ) >>= aS.Height;
+                xPropSet->getPropertyValue( "Height" ) >>= aS.Height;
                 awt::Size aM( MapSize( aS ) );
                 aRows.push_back( std::pair< sal_Int32, sal_Int32 >( nPosition, aM.Height ) );
                 nPosition += aM.Height;
@@ -3174,11 +3170,6 @@ void PPTWriter::ImplCreateTable( uno::Reference< drawing::XShape >& rXShape, Esc
                 }
             }
 
-            static const char sTopBorder[] = "TopBorder";
-            static const char sBottomBorder[] = "BottomBorder";
-            static const char sLeftBorder[] = "LeftBorder";
-            static const char sRightBorder[] = "RightBorder";
-
             // creating horz lines
             for( sal_Int32 nLine = 0; nLine < ( xRows->getCount() + 1 ); nLine++ )
             {
@@ -3196,7 +3187,7 @@ void PPTWriter::ImplCreateTable( uno::Reference< drawing::XShape >& rXShape, Esc
                         {
                             uno::Reference< beans::XPropertySet > xPropSet2( xCell, uno::UNO_QUERY_THROW );
                             table::BorderLine aBorderLine;
-                            if ( xPropSet2->getPropertyValue( sTopBorder ) >>= aBorderLine )
+                            if ( xPropSet2->getPropertyValue( "TopBorder" ) >>= aBorderLine )
                                 aCellBorder.maCellBorder = aBorderLine;
                             sal_Int32 nRight  = GetCellRight( nColumn, maRect,aColumns,xCell );
                             bTop = ImplCreateCellBorder( &aCellBorder, aCellBorder.mnPos,
@@ -3222,7 +3213,7 @@ void PPTWriter::ImplCreateTable( uno::Reference< drawing::XShape >& rXShape, Esc
                                     uno::Reference< table::XMergeableCell > xCellOwn( xCellRange->getCellByPosition( nColumn, nRow - 1 ), uno::UNO_QUERY_THROW );
                                     uno::Reference< beans::XPropertySet > xPropSet2( xCellOwn, uno::UNO_QUERY_THROW );
                                     table::BorderLine aBorderLine;
-                                    if ( xPropSet2->getPropertyValue( sBottomBorder ) >>= aBorderLine )
+                                    if ( xPropSet2->getPropertyValue( "BottomBorder" ) >>= aBorderLine )
                                         aCellBorder.maCellBorder = aBorderLine;
                                     ImplCreateCellBorder( &aCellBorder, aCellBorder.mnPos,
                                         nBottom, nRight, nBottom);
@@ -3253,7 +3244,7 @@ void PPTWriter::ImplCreateTable( uno::Reference< drawing::XShape >& rXShape, Esc
                         {
                             uno::Reference< beans::XPropertySet > xCellSet( xCell, uno::UNO_QUERY_THROW );
                             table::BorderLine aBorderLine;
-                            if ( xCellSet->getPropertyValue( sLeftBorder ) >>= aBorderLine )
+                            if ( xCellSet->getPropertyValue( "LeftBorder" ) >>= aBorderLine )
                                 aCellBorder.maCellBorder = aBorderLine;
                             sal_Int32 nBottom = GetCellBottom( nRow, maRect, aRows,xCell );
                             bLeft = ImplCreateCellBorder( &aCellBorder, aColumns[nLine].first, aCellBorder.mnPos,
@@ -3275,7 +3266,7 @@ void PPTWriter::ImplCreateTable( uno::Reference< drawing::XShape >& rXShape, Esc
                                     uno::Reference< table::XMergeableCell > xCellOwn( xCellRange->getCellByPosition( nColumn - 1, nRow ), uno::UNO_QUERY_THROW );
                                     uno::Reference< beans::XPropertySet > xCellSet( xCellOwn, uno::UNO_QUERY_THROW );
                                     table::BorderLine aBorderLine;
-                                    if ( xCellSet->getPropertyValue( sRightBorder ) >>= aBorderLine )
+                                    if ( xCellSet->getPropertyValue( "RightBorder" ) >>= aBorderLine )
                                         aCellBorder.maCellBorder = aBorderLine;
                                     ImplCreateCellBorder( &aCellBorder, nRight, aCellBorder.mnPos,
                                         nRight,  nBottom );
diff --git a/sd/source/filter/xml/sdxmlwrp.cxx b/sd/source/filter/xml/sdxmlwrp.cxx
index 6f26091..7d5eba3 100644
--- a/sd/source/filter/xml/sdxmlwrp.cxx
+++ b/sd/source/filter/xml/sdxmlwrp.cxx
@@ -78,11 +78,6 @@ using namespace comphelper;
 
 #define SD_XML_READERROR 1234
 
-char const sXML_metaStreamName[] = "meta.xml";
-char const sXML_styleStreamName[] = "styles.xml";
-char const sXML_contentStreamName[] = "content.xml";
-char const sXML_settingsStreamName[] = "settings.xml";
-
 char const sXML_export_impress_meta_oasis_service[] = "com.sun.star.comp.Impress.XMLOasisMetaExporter";
 char const sXML_export_impress_styles_oasis_service[] = "com.sun.star.comp.Impress.XMLOasisStylesExporter";
 char const sXML_export_impress_content_oasis_service[] = "com.sun.star.comp.Impress.XMLOasisContentExporter";
@@ -918,18 +913,18 @@ bool SdXMLFilter::Export()
 
             XML_SERVICEMAP aServices[5]; sal_uInt16 i = 0;
             aServices[i  ].mpService = pServiceNames->mpStyles;
-            aServices[i++].mpStream  = sXML_styleStreamName;
+            aServices[i++].mpStream  = "styles.xml";
 
             aServices[i  ].mpService = pServiceNames->mpContent;
-            aServices[i++].mpStream  = sXML_contentStreamName;
+            aServices[i++].mpStream  = "content.xml";
 
             aServices[i  ].mpService = pServiceNames->mpSettings;
-            aServices[i++].mpStream  = sXML_settingsStreamName;
+            aServices[i++].mpStream  = "settings.xml";
 
             if( mrDocShell.GetCreateMode() != SfxObjectCreateMode::EMBEDDED )
             {
                 aServices[i  ].mpService = pServiceNames->mpMeta;
-                aServices[i++].mpStream  = sXML_metaStreamName;
+                aServices[i++].mpStream  = "meta.xml";
             };
 
             aServices[i].mpService = nullptr;
diff --git a/sd/source/ui/dlg/TemplateScanner.cxx b/sd/source/ui/dlg/TemplateScanner.cxx
index 0f6723d..ab816b5 100644
--- a/sd/source/ui/dlg/TemplateScanner.cxx
+++ b/sd/source/ui/dlg/TemplateScanner.cxx
@@ -44,17 +44,6 @@ using namespace ::com::sun::star::uno;
 namespace {
 
 const char TITLE[] = "Title";
-const char TARGET_DIR_URL[] = "TargetDirURL";
-const char DESCRIPTION[] = "TypeDescription";
-const char TARGET_URL[] = "TargetURL";
-
-//  These strings are used to find impress templates in the tree of
-//  template files.  Should probably be determined dynamically.
-const char IMPRESS_BIN_TEMPLATE[] = "application/vnd.stardivision.impress";
-const char IMPRESS_XML_TEMPLATE[] = MIMETYPE_VND_SUN_XML_IMPRESS_ASCII;
-// The following id comes from the bugdoc in #i2764#.
-const char IMPRESS_XML_TEMPLATE_B[] = "Impress 2.0";
-const char IMPRESS_XML_TEMPLATE_OASIS[] = MIMETYPE_OASIS_OPENDOCUMENT_PRESENTATION_ASCII;
 
 class FolderDescriptor
 {
@@ -211,8 +200,8 @@ TemplateScanner::State TemplateScanner::InitializeEntryScanning()
         //  its URL, and its content type.
         Sequence<OUString> aProps (3);
         aProps[0] = TITLE;
-        aProps[1] = TARGET_URL;
-        aProps[2] = DESCRIPTION;
+        aProps[1] = "TargetURL";
+        aProps[2] = "TypeDescription";
 
         //  Create a cursor to iterate over the templates in this folders.
         ::ucbhelper::ResultSetInclude eInclude = ::ucbhelper::INCLUDE_DOCUMENTS_ONLY;
@@ -246,11 +235,14 @@ TemplateScanner::State TemplateScanner::ScanEntry()
                 //  Check whether the entry is an impress template.  If so
                 //  add a new entry to the resulting list (which is created
                 //  first if necessary).
+                //  These strings are used to find impress templates in the tree of
+                //  template files.  Should probably be determined dynamically.
                 if (    (sContentType == MIMETYPE_OASIS_OPENDOCUMENT_PRESENTATION_TEMPLATE_ASCII)
-                    ||  (sContentType == IMPRESS_XML_TEMPLATE_OASIS)
-                    ||  (sContentType == IMPRESS_BIN_TEMPLATE)
-                    ||  (sContentType == IMPRESS_XML_TEMPLATE)
-                    ||  (sContentType == IMPRESS_XML_TEMPLATE_B))
+                    ||  (sContentType == MIMETYPE_OASIS_OPENDOCUMENT_PRESENTATION_ASCII)
+                    ||  (sContentType == "application/vnd.stardivision.impress")
+                    ||  (sContentType == MIMETYPE_VND_SUN_XML_IMPRESS_ASCII)
+                        // The following id comes from the bugdoc in #i2764#.
+                    ||  (sContentType == "Impress 2.0"))
                 {
                     OUString sLocalisedTitle = SfxDocumentTemplates::ConvertResourceString(
                         STR_TEMPLATE_NAME1_DEF, STR_TEMPLATE_NAME1, NUM_TEMPLATE_NAMES, sTitle );
@@ -298,7 +290,7 @@ TemplateScanner::State TemplateScanner::InitializeFolderScanning()
         //  Define the list of properties we are interested in.
         Sequence<OUString> aProps (2);
         aProps[0] = TITLE;
-        aProps[1] = TARGET_DIR_URL;
+        aProps[1] = "TargetDirURL";
 
         //  Create an cursor to iterate over the template folders.
         ::ucbhelper::ResultSetInclude eInclude = ::ucbhelper::INCLUDE_FOLDERS_ONLY;
diff --git a/sd/source/ui/slidesorter/cache/SlsCacheCompactor.cxx b/sd/source/ui/slidesorter/cache/SlsCacheCompactor.cxx
index 694da4f..6e318c0 100644
--- a/sd/source/ui/slidesorter/cache/SlsCacheCompactor.cxx
+++ b/sd/source/ui/slidesorter/cache/SlsCacheCompactor.cxx
@@ -82,27 +82,23 @@ namespace sd { namespace slidesorter { namespace cache {
     sal_Int32 nMaximalCacheSize)
 {
     static const char sNone[] = "None";
-    static const char sCompress[] = "Compress";
-    static const char sErase[] = "Erase";
-    static const char sResolution[] = "ResolutionReduction";
-    static const char sPNGCompression[] = "PNGCompression";
 
     std::shared_ptr<BitmapCompressor> pCompressor;
-    OUString sCompressionPolicy(sPNGCompression);
+    OUString sCompressionPolicy("PNGCompression");
     Any aCompressionPolicy (CacheConfiguration::Instance()->GetValue("CompressionPolicy"));
     if (aCompressionPolicy.has<OUString>())
         aCompressionPolicy >>= sCompressionPolicy;
     if (sCompressionPolicy == sNone)
         pCompressor.reset(new NoBitmapCompression());
-    else if (sCompressionPolicy == sErase)
+    else if (sCompressionPolicy == "Erase")
         pCompressor.reset(new CompressionByDeletion());
-    else if (sCompressionPolicy == sResolution)
+    else if (sCompressionPolicy == "ResolutionReduction")
         pCompressor.reset(new ResolutionReduction());
     else
         pCompressor.reset(new PngCompression());
 
     ::std::unique_ptr<CacheCompactor> pCompactor;
-    OUString sCompactionPolicy(sCompress);
+    OUString sCompactionPolicy("Compress");
     Any aCompactionPolicy (CacheConfiguration::Instance()->GetValue("CompactionPolicy"));
     if (aCompactionPolicy.has<OUString>())
         aCompactionPolicy >>= sCompactionPolicy;
diff --git a/sd/source/ui/slidesorter/controller/SlsListener.cxx b/sd/source/ui/slidesorter/controller/SlsListener.cxx
index cbcd842..4e7ed41 100644
--- a/sd/source/ui/slidesorter/controller/SlsListener.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsListener.cxx
@@ -451,10 +451,7 @@ void SAL_CALL Listener::propertyChange (
             static_cast<uno::XWeak*>(this));
     }
 
-    static const char sCurrentPagePropertyName[] = "CurrentPage";
-    static const char sEditModePropertyName[] = "IsMasterPageMode";
-
-    if (rEvent.PropertyName == sCurrentPagePropertyName)
+    if (rEvent.PropertyName == "CurrentPage")
     {
         Any aCurrentPage = rEvent.NewValue;
         Reference<beans::XPropertySet> xPageSet (aCurrentPage, UNO_QUERY);
@@ -483,7 +480,7 @@ void SAL_CALL Listener::propertyChange (
             }
         }
     }
-    else if (rEvent.PropertyName == sEditModePropertyName)
+    else if (rEvent.PropertyName == "IsMasterPageMode")
     {
         bool bIsMasterPageMode = false;
         rEvent.NewValue >>= bIsMasterPageMode;
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index f67ef59..a648abf 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -2947,7 +2947,6 @@ void SAL_CALL SdDrawPagesAccess::remove( const uno::Reference< drawing::XDrawPag
 }
 
 // XServiceInfo
-const char pSdDrawPagesAccessService[] = "com.sun.star.drawing.DrawPages";
 
 OUString SAL_CALL SdDrawPagesAccess::getImplementationName(  ) throw(uno::RuntimeException, std::exception)
 {
@@ -2961,7 +2960,7 @@ sal_Bool SAL_CALL SdDrawPagesAccess::supportsService( const OUString& ServiceNam
 
 uno::Sequence< OUString > SAL_CALL SdDrawPagesAccess::getSupportedServiceNames(  ) throw(uno::RuntimeException, std::exception)
 {
-    OUString aService( pSdDrawPagesAccessService );
+    OUString aService( "com.sun.star.drawing.DrawPages" );
     uno::Sequence< OUString > aSeq( &aService, 1 );
     return aSeq;
 }
@@ -3213,7 +3212,6 @@ void SAL_CALL SdMasterPagesAccess::remove( const uno::Reference< drawing::XDrawP
 }
 
 // XServiceInfo
-const char pSdMasterPagesAccessService[] = "com.sun.star.drawing.MasterPages";
 
 OUString SAL_CALL SdMasterPagesAccess::getImplementationName(  ) throw(uno::RuntimeException, std::exception)
 {
@@ -3227,7 +3225,7 @@ sal_Bool SAL_CALL SdMasterPagesAccess::supportsService( const OUString& ServiceN
 
 uno::Sequence< OUString > SAL_CALL SdMasterPagesAccess::getSupportedServiceNames(  ) throw(uno::RuntimeException, std::exception)
 {
-    OUString aService( pSdMasterPagesAccessService );
+    OUString aService( "com.sun.star.drawing.MasterPages" );
     uno::Sequence< OUString > aSeq( &aService, 1 );
     return aSeq;
 }
diff --git a/sdext/source/pdfimport/wrapper/wrapper.cxx b/sdext/source/pdfimport/wrapper/wrapper.cxx
index b213e8e..90d471a 100644
--- a/sdext/source/pdfimport/wrapper/wrapper.cxx
+++ b/sdext/source/pdfimport/wrapper/wrapper.cxx
@@ -685,29 +685,20 @@ void Parser::readFont()
 
 uno::Sequence<beans::PropertyValue> Parser::readImageImpl()
 {
-    static const char aJpegMarker[] = "JPEG";
-    static const char aPbmMarker[]  = "PBM";
-    static const char aPpmMarker[]  = "PPM";
-    static const char aPngMarker[]  = "PNG";
-    static const char aJpegFile[]   = "DUMMY.JPEG";
-    static const char aPbmFile[]    = "DUMMY.PBM";
-    static const char aPpmFile[]    = "DUMMY.PPM";
-    static const char aPngFile[]    = "DUMMY.PNG";
-
     OString aToken = readNextToken();
     const sal_Int32 nImageSize( readInt32() );
 
     OUString           aFileName;
-    if( aToken == aPngMarker )
-        aFileName = aPngFile;
-    else if( aToken == aJpegMarker )
-        aFileName = aJpegFile;
-    else if( aToken == aPbmMarker )
-        aFileName = aPbmFile;
+    if( aToken == "PNG" )
+        aFileName = "DUMMY.PNG";
+    else if( aToken == "JPEG" )
+        aFileName = "DUMMY.JPEG";
+    else if( aToken == "PBM" )
+        aFileName = "DUMMY.PBM";
     else
     {
-        SAL_WARN_IF(aToken != aPpmMarker,"sdext.pdfimport","Invalid bitmap format");
-        aFileName = aPpmFile;
+        SAL_WARN_IF(aToken != "PPM","sdext.pdfimport","Invalid bitmap format");
+        aFileName = "DUMMY.PPM";
     }
 
     uno::Sequence<sal_Int8> aDataSequence(nImageSize);
diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx
index afafe4c..bbd9a1f 100644
--- a/sfx2/source/appl/appuno.cxx
+++ b/sfx2/source/appl/appuno.cxx
@@ -129,7 +129,6 @@ static char const sViewOnly[] = "ViewOnly";
 static char const sDontEdit[] = "DontEdit";
 static char const sSilent[] = "Silent";
 static char const sJumpMark[] = "JumpMark";
-static char const sFileName[] = "FileName";
 static char const sSalvagedFile[] = "SalvagedFile";
 static char const sStatusInd[] = "StatusIndicator";
 static char const sModel[] = "Model";
@@ -137,7 +136,6 @@ static char const sFrame[] = "Frame";
 static char const sViewData[] = "ViewData";
 static char const sFilterData[] = "FilterData";
 static char const sSelectionOnly[] = "SelectionOnly";
-static char const sFilterFlags[] = "FilterFlags";
 static char const sMacroExecMode[] = "MacroExecutionMode";
 static char const sUpdateDocMode[] = "UpdateDocMode";
 static char const sMinimized[] = "Minimized";
@@ -690,7 +688,7 @@ void TransformParameters( sal_uInt16 nSlotId, const uno::Sequence<beans::Propert
                     rSet.Put( stringList );
                 }
             }
-            else if ( aName == sFileName )
+            else if ( aName == "FileName" )
             {
                 OUString sVal;
                 bool bOK = ((rProp.Value >>= sVal) && !sVal.isEmpty());
@@ -762,7 +760,7 @@ void TransformParameters( sal_uInt16 nSlotId, const uno::Sequence<beans::Propert
                 if (bOK)
                     rSet.Put( SfxStringItem( SID_CHARSET, sVal ) );
             }
-            else if ( aName == sFilterFlags )
+            else if ( aName == "FilterFlags" )
             {
                 OUString sVal;
                 bool bOK = ((rProp.Value >>= sVal) && !sVal.isEmpty());
diff --git a/sfx2/source/bastyp/frmhtmlw.cxx b/sfx2/source/bastyp/frmhtmlw.cxx
index 9676310..0bbe5f7 100644
--- a/sfx2/source/bastyp/frmhtmlw.cxx
+++ b/sfx2/source/bastyp/frmhtmlw.cxx
@@ -51,7 +51,6 @@ using namespace ::com::sun::star;
 
 static sal_Char const sHTML_SC_yes[] =  "YES";
 static sal_Char const sHTML_SC_no[] =       "NO";
-static sal_Char const sHTML_MIME_text_html[] =  "text/html; charset=";
 
 void SfxFrameHTMLWriter::OutMeta( SvStream& rStrm,
                                   const sal_Char *pIndent,
@@ -89,8 +88,7 @@ void SfxFrameHTMLWriter::Out_DocInfo( SvStream& rStrm, const OUString& rBaseURL,
 
     if( pCharSet )
     {
-        OUString aContentType(sHTML_MIME_text_html);
-        aContentType += OUString(pCharSet, strlen(pCharSet), RTL_TEXTENCODING_UTF8);
+        OUString aContentType = "text/html; charset=" + OUString(pCharSet, strlen(pCharSet), RTL_TEXTENCODING_UTF8);
         OutMeta( rStrm, pIndent, OOO_STRING_SVTOOLS_HTML_META_content_type, aContentType, true,
                  eDestEnc, pNonConvertableChars );
     }
diff --git a/sfx2/source/bastyp/sfxhtml.cxx b/sfx2/source/bastyp/sfxhtml.cxx
index ac5dd5a..5402493 100644
--- a/sfx2/source/bastyp/sfxhtml.cxx
+++ b/sfx2/source/bastyp/sfxhtml.cxx
@@ -46,10 +46,6 @@
 using namespace ::com::sun::star;
 
 
-const sal_Char sHTML_MIME_text[] = "text/";
-const sal_Char sHTML_MIME_application[] = "application/";
-const sal_Char sHTML_MIME_experimental[] = "x-";
-
 // <INPUT TYPE=xxx>
 static HTMLOptionEnum const aAreaShapeOptEnums[] =
 {
@@ -279,14 +275,14 @@ void SfxHTMLParser::GetScriptType_Impl( SvKeyValueIterator *pHTTPHeader )
                 if( !aKV.GetValue().isEmpty() )
                 {
                     OUString aTmp( aKV.GetValue() );
-                    if( aTmp.startsWithIgnoreAsciiCase( sHTML_MIME_text ) )
+                    if( aTmp.startsWithIgnoreAsciiCase( "text/" ) )
                         aTmp = aTmp.copy( 5 );
-                    else if( aTmp.startsWithIgnoreAsciiCase( sHTML_MIME_application ) )
+                    else if( aTmp.startsWithIgnoreAsciiCase( "application/" ) )
                         aTmp = aTmp.copy( 12 );
                     else
                         break;
 
-                    if( aTmp.startsWithIgnoreAsciiCase( sHTML_MIME_experimental ) )
+                    if( aTmp.startsWithIgnoreAsciiCase( "x-" ) ) // MIME-experimental
                     {
                         aTmp = aTmp.copy( 2 );
                     }
diff --git a/sfx2/source/dialog/backingcomp.cxx b/sfx2/source/dialog/backingcomp.cxx
index 3ba48e3..43f018d 100644
--- a/sfx2/source/dialog/backingcomp.cxx
+++ b/sfx2/source/dialog/backingcomp.cxx
@@ -63,9 +63,6 @@
 
 namespace {
 
-const char FRAME_PROPNAME_LAYOUTMANAGER[] = "LayoutManager";
-const char HID_BACKINGWINDOW[] = "FWK_HID_BACKINGWINDOW";
-
 /**
     implements the backing component.
 
@@ -411,7 +408,7 @@ void SAL_CALL BackingComp::attachFrame( /*IN*/ const css::uno::Reference< css::f
     // create the menu bar for the backing component
     css::uno::Reference< css::beans::XPropertySet > xPropSet(m_xFrame, css::uno::UNO_QUERY_THROW);
     css::uno::Reference< css::frame::XLayoutManager > xLayoutManager;
-    xPropSet->getPropertyValue(FRAME_PROPNAME_LAYOUTMANAGER) >>= xLayoutManager;
+    xPropSet->getPropertyValue("LayoutManager") >>= xLayoutManager;
     if (xLayoutManager.is())
     {
         xLayoutManager->lock();
@@ -422,7 +419,7 @@ void SAL_CALL BackingComp::attachFrame( /*IN*/ const css::uno::Reference< css::f
     if (pWindow)
     {
         // set help ID for our canvas
-        pWindow->SetHelpId(HID_BACKINGWINDOW);
+        pWindow->SetHelpId("FWK_HID_BACKINGWINDOW");
     }
 
     // inform BackingWindow about frame
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index 446e94d..dd1d784 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -98,9 +98,6 @@ const sal_uInt16 HI_TYPE = 2;
 const sal_uInt16 HI_VALUE = 3;
 const sal_uInt16 HI_ACTION = 4;
 
-static const char DOCUMENT_SIGNATURE_MENU_CMD[] = "Signature";
-
-
 namespace {
 
 OUString CreateSizeText( sal_Int64 nSize )
@@ -796,8 +793,7 @@ SfxDocumentPage::SfxDocumentPage(vcl::Window* pParent, const SfxItemSet& rItemSe
     // [i96288] Check if the document signature command is enabled
     // on the main list enable/disable the pushbutton accordingly
     SvtCommandOptions aCmdOptions;
-    if ( aCmdOptions.Lookup( SvtCommandOptions::CMDOPTION_DISABLED,
-                             DOCUMENT_SIGNATURE_MENU_CMD ) )
+    if ( aCmdOptions.Lookup( SvtCommandOptions::CMDOPTION_DISABLED, "Signature" ) )
         m_pSignatureBtn->Disable();
 }
 
diff --git a/sfx2/source/dialog/filtergrouping.cxx b/sfx2/source/dialog/filtergrouping.cxx
index bcf06eb..dfe0fc6 100644
--- a/sfx2/source/dialog/filtergrouping.cxx
+++ b/sfx2/source/dialog/filtergrouping.cxx
@@ -150,15 +150,12 @@ namespace sfx2
     void lcl_ReadFilterClass( const OConfigurationNode& _rClassesNode, const OUString& _rLogicalClassName,
         FilterClass& /* [out] */ _rClass )
     {
-        static const char sDisplaNameNodeName[] = "DisplayName";
-        static const char sSubFiltersNodeName[] = "Filters";
-
             // the description node for the current class
         OConfigurationNode aClassDesc = _rClassesNode.openNode( _rLogicalClassName );
 
         // the values
-        aClassDesc.getNodeValue( sDisplaNameNodeName ) >>= _rClass.sDisplayName;
-        aClassDesc.getNodeValue( sSubFiltersNodeName ) >>= _rClass.aSubFilters;
+        aClassDesc.getNodeValue( "DisplayName" ) >>= _rClass.sDisplayName;
+        aClassDesc.getNodeValue( "Filters" ) >>= _rClass.aSubFilters;
     }
 
 
@@ -1154,12 +1151,9 @@ namespace sfx2
                                   const OUString& _rExtension,
                                   bool _bForOpen, FileDialogHelper_Impl& _rFileDlgImpl )
     {
-        static const char sAllFilter[] = "(*.*)";
-        static const char sOpenBracket[] = " (";
-        static const char sCloseBracket[] = ")";
         OUString sRet = _rDisplayText;
 
-        if ( sRet.indexOf( sAllFilter ) == -1 )
+        if ( sRet.indexOf( "(*.*)" ) == -1 )
         {
             OUString sExt = _rExtension;
             if ( !_bForOpen )
@@ -1167,9 +1161,9 @@ namespace sfx2
                 // show '*' in extensions only when opening a document
                 sExt = sExt.replaceAll("*", "");
             }
-            sRet += sOpenBracket;
+            sRet += " (";
             sRet += sExt;
-            sRet += sCloseBracket;
+            sRet += ")";
         }
         _rFileDlgImpl.addFilterPair( _rDisplayText, sRet );
         return sRet;
diff --git a/sfx2/source/doc/DocumentMetadataAccess.cxx b/sfx2/source/doc/DocumentMetadataAccess.cxx
index a7dcc65..065ae5a 100644
--- a/sfx2/source/doc/DocumentMetadataAccess.cxx
+++ b/sfx2/source/doc/DocumentMetadataAccess.cxx
@@ -84,10 +84,7 @@ bool isValidNCName(OUString const & i_rIdref)
 
 static const char s_content [] = "content.xml";
 static const char s_styles  [] = "styles.xml";
-static const char s_meta    [] = "meta.xml";
-static const char s_settings[] = "settings.xml";
 static const char s_manifest[] = "manifest.rdf";
-static const char s_rdfxml  [] = "application/rdf+xml";
 static const char s_odfmime [] = "application/vnd.oasis.opendocument.";
 
 
@@ -110,7 +107,7 @@ bool isValidXmlId(OUString const & i_rStreamName,
 
 static bool isReservedFile(OUString const & i_rPath)
 {
-    return isContentFile(i_rPath) || isStylesFile(i_rPath) || i_rPath == s_meta || i_rPath == s_settings;
+    return isContentFile(i_rPath) || isStylesFile(i_rPath) || i_rPath == "meta.xml" || i_rPath == "settings.xml";
 }
 
 
@@ -611,7 +608,7 @@ exportStream(struct DocumentMetadataAccess_Impl & i_rImpl,
     if (xStreamProps.is()) { // this is NOT supported in FileSystemStorage
         xStreamProps->setPropertyValue(
             "MediaType",
-            uno::makeAny(OUString(s_rdfxml)));
+            uno::makeAny(OUString("application/rdf+xml")));
     }
     const uno::Reference<io::XOutputStream> xOutStream(
         xStream->getOutputStream(), uno::UNO_SET_THROW );
diff --git a/sfx2/source/doc/Metadatable.cxx b/sfx2/source/doc/Metadatable.cxx
index 03dd8bf..5382cc3 100644
--- a/sfx2/source/doc/Metadatable.cxx
+++ b/sfx2/source/doc/Metadatable.cxx
@@ -110,7 +110,6 @@ namespace sfx2 {
 
 static const char s_content [] = "content.xml";
 static const char s_styles  [] = "styles.xml";
-static const char s_prefix  [] = "id";  // prefix for generated xml:id
 
 static bool isContentFile(OUString const & i_rPath)
 {
@@ -388,7 +387,7 @@ template< typename T >
     std::unordered_map< OUString, T, OUStringHash > & i_rXmlIdMap)
 {
     static bool bHack = (getenv("LIBO_ONEWAY_STABLE_ODF_EXPORT") != nullptr);
-    const OUString prefix(s_prefix);
+    static const char prefix[] = "id";  // prefix for generated xml:id
     typename std::unordered_map< OUString, T, OUStringHash >
         ::const_iterator iter;
     OUString id;
diff --git a/sfx2/source/doc/docfac.cxx b/sfx2/source/doc/docfac.cxx
index 1f0b3dc..dbeeb74 100644
--- a/sfx2/source/doc/docfac.cxx
+++ b/sfx2/source/doc/docfac.cxx
@@ -173,13 +173,9 @@ void SfxObjectFactory::SetModule_Impl( SfxModule *pMod )
 void SfxObjectFactory::SetSystemTemplate( const OUString& rServiceName, const OUString& rTemplateName )
 {
     static const int nMaxPathSize = 16000;
-    static const char SERVICE_FILTER_FACTORY[] = "com.sun.star.document.FilterFactory";
-    static const char SERVICE_TYPE_DECTECTION[] = "com.sun.star.document.TypeDetection";
 
-    static const char CONF_ROOT[] = "/org.openoffice.Setup";
     OUString CONF_PATH = "Office/Factories/" + rServiceName;
     static const char PROP_DEF_TEMPL_CHANGED[] = "ooSetupFactorySystemDefaultTemplateChanged";
-    static const char PROP_ACTUAL_FILTER[] = "ooSetupFactoryActualFilter";
 
     static const char DEF_TPL_STR[] = "/soffice.";
 
@@ -197,17 +193,17 @@ void SfxObjectFactory::SetSystemTemplate( const OUString& rServiceName, const OU
         {
             uno::Reference< lang::XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory();
             uno::Reference< uno::XInterface > xConfig = ::comphelper::ConfigurationHelper::openConfig(
-                ::comphelper::getProcessComponentContext(), CONF_ROOT, ::comphelper::EConfigurationModes::Standard );
+                ::comphelper::getProcessComponentContext(), "/org.openoffice.Setup", ::comphelper::EConfigurationModes::Standard );
 
             OUString aActualFilter;
-            ::comphelper::ConfigurationHelper::readRelativeKey( xConfig, CONF_PATH, PROP_ACTUAL_FILTER ) >>= aActualFilter;
+            ::comphelper::ConfigurationHelper::readRelativeKey( xConfig, CONF_PATH, "ooSetupFactoryActualFilter" ) >>= aActualFilter;
             bool bChanged(false);
             ::comphelper::ConfigurationHelper::readRelativeKey( xConfig, CONF_PATH, PROP_DEF_TEMPL_CHANGED ) >>= bChanged;
 
             uno::Reference< container::XNameAccess > xFilterFactory(
-                xFactory->createInstance( SERVICE_FILTER_FACTORY ), uno::UNO_QUERY_THROW );
+                xFactory->createInstance( "com.sun.star.document.FilterFactory" ), uno::UNO_QUERY_THROW );
             uno::Reference< container::XNameAccess > xTypeDetection(
-                xFactory->createInstance( SERVICE_TYPE_DECTECTION ), uno::UNO_QUERY_THROW );
+                xFactory->createInstance( "com.sun.star.document.TypeDetection" ), uno::UNO_QUERY_THROW );
 
             OUString aActualFilterTypeName;
             uno::Sequence< beans::PropertyValue > aActuralFilterData;
diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index 9f99eab..03b005f 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -116,7 +116,6 @@
 const char aFilterNameString[] = "FilterName";
 const char aFilterOptionsString[] = "FilterOptions";
 const char aFilterDataString[] = "FilterData";
-const char aFilterFlagsString[] = "FilterFlags";
 
 using namespace ::com::sun::star;
 using namespace css::system;
@@ -1465,7 +1464,7 @@ bool SfxStoringHelper::GUIStoreModel( const uno::Reference< frame::XModel >& xMo
 
     const OUString sFilterOptionsString(aFilterOptionsString);
     const OUString sFilterDataString(aFilterDataString);
-    const OUString sFilterFlagsString(aFilterFlagsString);
+    const OUString sFilterFlagsString("FilterFlags");
 
     if ( ( nStoreMode & EXPORT_REQUESTED ) && ( nStoreMode & PDFEXPORT_REQUESTED ) && !( nStoreMode & PDFDIRECTEXPORT_REQUESTED ) )
     {
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index f11fccd..941f451 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -63,8 +63,6 @@ const char TM_SETTING_MANAGER[] = "TemplateManager";
 const char TM_SETTING_LASTFOLDER[] = "LastFolder";
 const char TM_SETTING_LASTAPPLICATION[] = "LastApplication";
 
-const char SERVICENAME_CFGREADACCESS[] = "com.sun.star.configuration.ConfigurationAccess";
-
 const char ACTIONBAR_ACTION[] = "action_menu";
 
 #define MNI_ACTION_NEW_FOLDER 1
@@ -1064,7 +1062,7 @@ void SfxTemplateManagerDlg::OnTemplateLink ()
             Any(sNodePath),
             PropertyState_DIRECT_VALUE);
         args.getArray()[0] <<= val;
-        Reference<container::XNameAccess> xNameAccess(xConfig->createInstanceWithArguments(SERVICENAME_CFGREADACCESS,args), UNO_QUERY);
+        Reference<container::XNameAccess> xNameAccess(xConfig->createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess", args), UNO_QUERY);
         if( xNameAccess.is() )
         {
             OUString sURL;
diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx
index 71d8592..98112eb 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -61,7 +61,6 @@ using namespace css::uno;
 namespace
 {
     const static char gsReadOnlyCommandName[] = ".uno:EditDoc";
-    const static char gsHideSidebarCommandName[] = ".uno:Sidebar";
     const static sal_Int32 gnWidthCloseThreshold (70);
     const static sal_Int32 gnWidthOpenThreshold (40);
 }
@@ -1017,7 +1016,7 @@ IMPL_LINK(SidebarController, OnMenuItemSelected, Menu*, pMenu, bool)
 
         case MID_HIDE_SIDEBAR:
         {
-            const util::URL aURL (Tools::GetURL(gsHideSidebarCommandName));
+            const util::URL aURL (Tools::GetURL(".uno:Sidebar"));
             Reference<frame::XDispatch> xDispatch (Tools::GetDispatch(mxFrame, aURL));
             if (xDispatch.is())
                     xDispatch->dispatch(aURL, Sequence<beans::PropertyValue>());
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index 7577411..f6f432b 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -567,8 +567,6 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq )
         // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
         case SID_WEBHTML:
         {
-            static const char HTML_DOCUMENT_TYPE[] = "generic_HTML";
-            static const char HTML_GRAPHIC_TYPE[]  = "graphic_HTML";
             const sal_Int32   FILTERFLAG_EXPORT    = 0x00000002;
 
             css::uno::Reference< lang::XMultiServiceFactory > xSMGR(::comphelper::getProcessServiceFactory(), css::uno::UNO_QUERY_THROW);
@@ -603,7 +601,7 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq )
             if ( xModel.is() && xStorable.is() )
             {
                 OUString aFilterName;
-                OUString aTypeName( HTML_DOCUMENT_TYPE );
+                OUString aTypeName( "generic_HTML" );
                 OUString aFileName;
                 OUString aExtension( "htm" );
 
@@ -624,7 +622,7 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq )
                 {
                     // Draw/Impress uses a different type. 2nd chance try to use alternative type name
                     aFilterName = impl_retrieveFilterNameFromTypeAndModule(
-                        xContainerQuery, HTML_GRAPHIC_TYPE, aModule, nFilterFlags );
+                        xContainerQuery, "graphic_HTML", aModule, nFilterFlags );
                 }
 
                 // No filter found => error
diff --git a/shell/source/unix/sysshell/recently_used_file.cxx b/shell/source/unix/sysshell/recently_used_file.cxx
index b15cc9b..ee0e598 100644
--- a/shell/source/unix/sysshell/recently_used_file.cxx
+++ b/shell/source/unix/sysshell/recently_used_file.cxx
@@ -30,10 +30,9 @@
 #include <fcntl.h>
 #include <unistd.h>
 
-const OUStringLiteral RECENTLY_USED_FILE_NAME(".recently-used");
 const char SLASH[] = "/";
 
-namespace /* private */ {
+namespace {
 
 inline void ensure_final_slash(/*inout*/ OUString& path)
 {
@@ -58,7 +57,7 @@ recently_used_file::recently_used_file() :
 
         OUString rufn = homedir;
         ensure_final_slash(rufn);
-        rufn += RECENTLY_USED_FILE_NAME;
+        rufn += ".recently-used";
 
         OString tmp =
             OUStringToOString(rufn, osl_getThreadTextEncoding());
diff --git a/starmath/source/cfgitem.cxx b/starmath/source/cfgitem.cxx
index 4b1bd12..b849bdd 100644
--- a/starmath/source/cfgitem.cxx
+++ b/starmath/source/cfgitem.cxx
@@ -39,8 +39,6 @@
 using namespace com::sun::star::uno;
 using namespace com::sun::star::beans;
 
-static const char aRootName[] = "Office.Math";
-
 #define SYMBOL_LIST         "SymbolList"
 #define FONT_FORMAT_LIST    "FontFormatList"
 
@@ -332,7 +330,7 @@ const OUString SmFontFormatList::GetNewFontFormatId() const
 
 
 SmMathConfig::SmMathConfig() :
-    ConfigItem(OUString(aRootName))
+    ConfigItem(OUString("Office.Math"))
     , pFormat()
     , pOther()
     , pFontFormatList()
diff --git a/svgio/source/svgreader/svgtools.cxx b/svgio/source/svgreader/svgtools.cxx
index 3ef273f..d78a121 100644
--- a/svgio/source/svgreader/svgtools.cxx
+++ b/svgio/source/svgreader/svgtools.cxx
@@ -1482,15 +1482,13 @@ namespace svgio
 
                     if(!rMimeType.isEmpty() && nPos < nLen)
                     {
-                        static const char aStrImage[] = "image";
-
-                        if(rMimeType.match(aStrImage, 0))
+                        if(rMimeType.startsWith("image"))
                         {
                             // image data
                             OUString aData(rCandidate.copy(nPos));
                             static const char aStrBase64[] = "base64";
 
-                            if(aData.match(aStrBase64, 0))
+                            if(aData.startsWith(aStrBase64))
                             {
                                 // base64 encoded
                                 nPos = strlen(aStrBase64);


More information about the Libreoffice-commits mailing list