summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2016-11-01 13:10:08 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2016-11-01 13:25:08 +0000
commit9bdec0831afc45af45ea6d9350ef3372188b45cb (patch)
tree9f761fe2589569a7cd0fbafd6e5fcc4d350d4d64 /sfx2
parent49c7bc5af291dbf6b34bcea82c9c0513f65b308b (diff)
loplugin:oncevar in sd..svgio
Change-Id: I58565460fcc3279c9771c6e1272d0af540b2c87c Reviewed-on: https://gerrit.libreoffice.org/30459 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/appl/appuno.cxx6
-rw-r--r--sfx2/source/bastyp/frmhtmlw.cxx4
-rw-r--r--sfx2/source/bastyp/sfxhtml.cxx10
-rw-r--r--sfx2/source/dialog/backingcomp.cxx7
-rw-r--r--sfx2/source/dialog/dinfdlg.cxx6
-rw-r--r--sfx2/source/dialog/filtergrouping.cxx16
-rw-r--r--sfx2/source/doc/DocumentMetadataAccess.cxx7
-rw-r--r--sfx2/source/doc/Metadatable.cxx3
-rw-r--r--sfx2/source/doc/docfac.cxx12
-rw-r--r--sfx2/source/doc/guisaveas.cxx3
-rw-r--r--sfx2/source/doc/templatedlg.cxx4
-rw-r--r--sfx2/source/sidebar/SidebarController.cxx3
-rw-r--r--sfx2/source/view/viewsh.cxx6
13 files changed, 26 insertions, 61 deletions
diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx
index afafe4c8a5d5..bbd9a1f16df6 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 967631000c37..0bbe5f71758e 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 ac5dd5affeb0..54024936ddeb 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 3ba48e3f94fa..43f018de78b5 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 446e94df16c9..dd1d784665f4 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 bcf06eb745b5..dfe0fc664435 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 a7dcc655cec5..065ae5aeda0f 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 03dd8bf10ee7..5382cc3db427 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 1f0b3dc41720..dbeeb746c893 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 9f99eab33a98..03b005fc4d11 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 f11fccd97eec..941f451f1916 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 71d8592c7062..98112eb0028e 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 757741169e77..f6f432b87443 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