summaryrefslogtreecommitdiff
path: root/cui/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2016-11-07 10:47:55 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2016-11-07 11:00:47 +0000
commitfae35e535d2757244eccf4b5f5555293a24180b3 (patch)
tree0253f7d409c4e49bcd20d6604495b45a2354d1cc /cui/source
parent0f96b3f33f98ecd56f0fe55a65315d6762ff978a (diff)
loplugin:oncevar in cui..connectivity
Change-Id: Ibe9d04932b0a57040db4fee11886dc1701f6ea17 Reviewed-on: https://gerrit.libreoffice.org/30653 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cui/source')
-rw-r--r--cui/source/customize/acccfg.cxx13
-rw-r--r--cui/source/customize/cfg.cxx6
-rw-r--r--cui/source/customize/cfgutil.cxx17
-rw-r--r--cui/source/customize/macropg.cxx3
-rw-r--r--cui/source/dialogs/hlinettp.cxx3
-rw-r--r--cui/source/options/optupdt.cxx3
-rw-r--r--cui/source/tabpages/autocdlg.cxx15
-rw-r--r--cui/source/tabpages/numpages.cxx18
8 files changed, 26 insertions, 52 deletions
diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx
index ae7d1cc5d26f..6d36d9c2dc1d 100644
--- a/cui/source/customize/acccfg.cxx
+++ b/cui/source/customize/acccfg.cxx
@@ -74,14 +74,9 @@
using namespace css;
-static const char MODULEPROP_SHORTNAME [] = "ooSetupFactoryShortName";
-static const char MODULEPROP_UINAME [] = "ooSetupFactoryUIName";
-static const char CMDPROP_UINAME [] = "Name";
-
static const char FOLDERNAME_UICONFIG [] = "Configurations2";
static const char MEDIATYPE_PROPNAME [] = "MediaType";
-static const char MEDIATYPE_UICONFIG [] = "application/vnd.sun.xml.ui.configuration";
static const sal_uInt16 KEYCODE_ARRAY[] =
{
@@ -884,8 +879,8 @@ void SfxAcceleratorConfigPage::InitAccCfg()
frame::ModuleManager::create(m_xContext);
m_sModuleLongName = xModuleManager->identify(m_xFrame);
comphelper::SequenceAsHashMap lModuleProps(xModuleManager->getByName(m_sModuleLongName));
- m_sModuleShortName = lModuleProps.getUnpackedValueOrDefault(MODULEPROP_SHORTNAME, OUString());
- m_sModuleUIName = lModuleProps.getUnpackedValueOrDefault(MODULEPROP_UINAME , OUString());
+ m_sModuleShortName = lModuleProps.getUnpackedValueOrDefault("ooSetupFactoryShortName", OUString());
+ m_sModuleUIName = lModuleProps.getUnpackedValueOrDefault("ooSetupFactoryUIName", OUString());
// get global accelerator configuration
m_xGlobal = css::ui::GlobalAcceleratorConfiguration::create(m_xContext);
@@ -1357,7 +1352,7 @@ IMPL_LINK_NOARG(SfxAcceleratorConfigPage, SaveHdl, sfx2::FileDialogHelper*, void
OUString sMediaType;
xUIConfigProps->getPropertyValue(MEDIATYPE_PROPNAME) >>= sMediaType;
if (sMediaType.isEmpty())
- xUIConfigProps->setPropertyValue(MEDIATYPE_PROPNAME, uno::makeAny(OUString(MEDIATYPE_UICONFIG)));
+ xUIConfigProps->setPropertyValue(MEDIATYPE_PROPNAME, uno::makeAny(OUString("application/vnd.sun.xml.ui.configuration")));
uno::Reference<ui::XUIConfigurationManager2> xCfgMgr2 = ui::UIConfigurationManager::create(m_xContext);
xCfgMgr2->setStorage(xUIConfig);
@@ -1522,7 +1517,7 @@ OUString SfxAcceleratorConfigPage::GetLabel4Command(const OUString& sCommand)
if (xModuleConf.is())
{
::comphelper::SequenceAsHashMap lProps(xModuleConf->getByName(sCommand));
- OUString sLabel = lProps.getUnpackedValueOrDefault(CMDPROP_UINAME, OUString());
+ OUString sLabel = lProps.getUnpackedValueOrDefault("Name", OUString());
if (!sLabel.isEmpty())
return sLabel;
}
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index 20dece223187..cf734f776336 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -114,9 +114,7 @@ static const char ITEM_MENUBAR_URL[] = "private:resource/menubar/menubar";
static const char ITEM_TOOLBAR_URL[] = "private:resource/toolbar/";
static const char CUSTOM_TOOLBAR_STR[] = "custom_toolbar_";
-static const char CUSTOM_MENU_STR[] = "vnd.openoffice.org:CustomMenu";
-static const char aSeparatorStr[] = "----------------------------------";
static const char aMenuSeparatorStr[] = " | ";
namespace uno = com::sun::star::uno;
@@ -337,7 +335,7 @@ generateCustomMenuURL(
SvxEntries* entries,
sal_Int32 suffix = 1 )
{
- OUString url = CUSTOM_MENU_STR + OUString::number( suffix );
+ OUString url = "vnd.openoffice.org:CustomMenu" + OUString::number( suffix );
if (!entries)
return url;
@@ -2321,7 +2319,7 @@ SvTreeListEntry* SvxConfigPage::InsertEntryIntoUI(
if (pNewEntryData->IsSeparator())
{
pNewEntry = m_pContentsListBox->InsertEntry(
- OUString(aSeparatorStr),
+ OUString("----------------------------------"),
nullptr, false, nPos, pNewEntryData);
}
else
diff --git a/cui/source/customize/cfgutil.cxx b/cui/source/customize/cfgutil.cxx
index 1209658c0d60..99cc9fec65d1 100644
--- a/cui/source/customize/cfgutil.cxx
+++ b/cui/source/customize/cfgutil.cxx
@@ -76,9 +76,6 @@ void SfxStylesInfo_Impl::setModel(const css::uno::Reference< css::frame::XModel
m_xDoc = xModel;
}
-static const char CMDURL_SPART [] = ".uno:StyleApply?Style:string=";
-static const char CMDURL_FPART2[] = "&FamilyName:string=";
-
static const char CMDURL_STYLEPROT_ONLY[] = ".uno:StyleApply?";
static const char CMDURL_SPART_ONLY [] = "Style:string=";
static const char CMDURL_FPART_ONLY [] = "FamilyName:string=";
@@ -87,12 +84,10 @@ static const char STYLEPROP_UINAME[] = "DisplayName";
OUString SfxStylesInfo_Impl::generateCommand(const OUString& sFamily, const OUString& sStyle)
{
- OUStringBuffer sCommand(1024);
- sCommand.append(CMDURL_SPART );
- sCommand.append(sStyle );
- sCommand.append(CMDURL_FPART2);
- sCommand.append(sFamily );
- return sCommand.makeStringAndClear();
+ return ".uno:StyleApply?Style:string="
+ + sStyle
+ + "&FamilyName:string="
+ + sFamily;
}
bool SfxStylesInfo_Impl::parseStyleCommand(SfxStyleInfo_Impl& aStyle)
@@ -206,8 +201,6 @@ void SfxStylesInfo_Impl::getLabel4Style(SfxStyleInfo_Impl& aStyle)
::std::vector< SfxStyleInfo_Impl > SfxStylesInfo_Impl::getStyles(const OUString& sFamily)
{
- static const char PROP_UINAME[] = "DisplayName";
-
css::uno::Sequence< OUString > lStyleNames;
css::uno::Reference< css::style::XStyleFamiliesSupplier > xModel(m_xDoc, css::uno::UNO_QUERY_THROW);
css::uno::Reference< css::container::XNameAccess > xFamilies = xModel->getStyleFamilies();
@@ -238,7 +231,7 @@ void SfxStylesInfo_Impl::getLabel4Style(SfxStyleInfo_Impl& aStyle)
xStyleSet->getByName(aStyleInfo.sStyle) >>= xStyle;
if (!xStyle.is())
continue;
- xStyle->getPropertyValue(PROP_UINAME) >>= aStyleInfo.sLabel;
+ xStyle->getPropertyValue("DisplayName") >>= aStyleInfo.sLabel;
}
catch(const css::uno::RuntimeException&)
{ throw; }
diff --git a/cui/source/customize/macropg.cxx b/cui/source/customize/macropg.cxx
index 4575e9ffa4e2..70dbf42d335b 100644
--- a/cui/source/customize/macropg.cxx
+++ b/cui/source/customize/macropg.cxx
@@ -51,7 +51,6 @@ using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
static const char aVndSunStarUNO[] = "vnd.sun.star.UNO:";
-static const char aVndSunStarScript[] = "vnd.sun.star.script:";
SvxMacroTabPage_Impl::SvxMacroTabPage_Impl( const SfxItemSet& rAttrSet )
: pAssignPB(nullptr)
@@ -470,7 +469,7 @@ void IconLBoxString::Paint(const Point& aPos, SvTreeListBox& /*aDevice*/, vcl::R
}
else
{
- aPureMethod = aURL.copy(strlen(aVndSunStarScript));
+ aPureMethod = aURL.copy(strlen("vnd.sun.star.script:"));
aPureMethod = aPureMethod.copy( 0, aPureMethod.indexOf( '?' ) );
}
diff --git a/cui/source/dialogs/hlinettp.cxx b/cui/source/dialogs/hlinettp.cxx
index 71cc15c57c38..0f6d2c6efd30 100644
--- a/cui/source/dialogs/hlinettp.cxx
+++ b/cui/source/dialogs/hlinettp.cxx
@@ -25,7 +25,6 @@
#include "hlmarkwn_def.hxx"
sal_Char const sAnonymous[] = "anonymous";
-sal_Char const sHTTPScheme[] = INET_HTTP_SCHEME;
sal_Char const sFTPScheme[] = INET_FTP_SCHEME;
/*************************************************************************
@@ -276,7 +275,7 @@ void SvxHyperlinkInternetTp::SetScheme(const OUString& rScheme)
m_pCbAnonymous->Show( bFTP );
//update 'link target in document'-window and opening-button
- if (rScheme.startsWith(sHTTPScheme) || rScheme.isEmpty())
+ if (rScheme.startsWith(INET_HTTP_SCHEME) || rScheme.isEmpty())
{
if ( mbMarkWndOpen )
ShowMarkWnd ();
diff --git a/cui/source/options/optupdt.cxx b/cui/source/options/optupdt.cxx
index 58bd1aa60a00..36e2b998c879 100644
--- a/cui/source/options/optupdt.cxx
+++ b/cui/source/options/optupdt.cxx
@@ -277,8 +277,7 @@ void SvxOnlineUpdateTabPage::Reset( const SfxItemSet* )
{
bool bValue = false;
m_xUpdateAccess->getByName( "AutoCheckEnabled" ) >>= bValue;
- OUStringLiteral sPath("/org.openoffice.Office.Jobs/Jobs/org.openoffice.Office.Jobs:Job['UpdateCheck']/Arguments/AutoCheckEnabled");
- beans::Property aProperty = m_xReadWriteAccess->getPropertyByHierarchicalName(sPath);
+ beans::Property aProperty = m_xReadWriteAccess->getPropertyByHierarchicalName("/org.openoffice.Office.Jobs/Jobs/org.openoffice.Office.Jobs:Job['UpdateCheck']/Arguments/AutoCheckEnabled");
bool bReadOnly = (aProperty.Attributes & beans::PropertyAttribute::READONLY) != 0;
m_pAutoCheckCheckBox->Check(bValue);
diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx
index 67efba2e1b2c..3ebc03a73cfb 100644
--- a/cui/source/tabpages/autocdlg.cxx
+++ b/cui/source/tabpages/autocdlg.cxx
@@ -2391,16 +2391,9 @@ void OfaAutoCompleteTabPage::CopyToClipboard() const
if (m_pAutoCompleteList && nSelCnt)
{
TransferDataContainer* pCntnr = new TransferDataContainer;
- css::uno::Reference<
- css::datatransfer::XTransferable > xRef( pCntnr );
+ css::uno::Reference< css::datatransfer::XTransferable > xRef( pCntnr );
OStringBuffer sData;
- const sal_Char aLineEnd[] =
-#if defined(_WIN32)
- "\015\012";
-#else
- "\012";
-#endif
rtl_TextEncoding nEncode = osl_getThreadTextEncoding();
@@ -2408,7 +2401,11 @@ void OfaAutoCompleteTabPage::CopyToClipboard() const
{
sData.append(OUStringToOString(m_pLBEntries->GetSelectEntry(n),
nEncode));
- sData.append(aLineEnd);
+#if defined(_WIN32)
+ sData.append("\015\012");
+#else
+ sData.append("\012");
+#endif
}
pCntnr->CopyByteString( SotClipboardFormatId::STRING, sData.makeStringAndClear() );
pCntnr->CopyToClipboard( static_cast<vcl::Window*>(const_cast<OfaAutoCompleteTabPage *>(this)) );
diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx
index 5846d9ea4f65..6aacd7e695b7 100644
--- a/cui/source/tabpages/numpages.cxx
+++ b/cui/source/tabpages/numpages.cxx
@@ -101,12 +101,6 @@ using namespace css::style;
#define SEARCHFILENAME_DELIMITER ((sal_Unicode)'/')
static bool bLastRelative = false;
-static const sal_Char cNumberingType[] = "NumberingType";
-static const sal_Char cParentNumbering[] = "ParentNumbering";
-static const sal_Char cPrefix[] = "Prefix";
-static const sal_Char cSuffix[] = "Suffix";
-static const sal_Char cBulletChar[] = "BulletChar";
-static const sal_Char cBulletFontName[] = "BulletFontName";
static SvxNumSettings_Impl* lcl_CreateNumSettingsPtr(const Sequence<PropertyValue>& rLevelProps)
{
@@ -114,17 +108,17 @@ static SvxNumSettings_Impl* lcl_CreateNumSettingsPtr(const Sequence<PropertyValu
SvxNumSettings_Impl* pNew = new SvxNumSettings_Impl;
for(sal_Int32 j = 0; j < rLevelProps.getLength(); j++)
{
- if ( pValues[j].Name == cNumberingType )
+ if ( pValues[j].Name == "NumberingType" )
pValues[j].Value >>= pNew->nNumberType;
- else if ( pValues[j].Name == cPrefix )
+ else if ( pValues[j].Name == "Prefix" )
pValues[j].Value >>= pNew->sPrefix;
- else if ( pValues[j].Name == cSuffix )
+ else if ( pValues[j].Name == "Suffix" )
pValues[j].Value >>= pNew->sSuffix;
- else if ( pValues[j].Name == cParentNumbering )
+ else if ( pValues[j].Name == "ParentNumbering" )
pValues[j].Value >>= pNew->nParentNumbering;
- else if ( pValues[j].Name == cBulletChar )
+ else if ( pValues[j].Name == "BulletChar" )
pValues[j].Value >>= pNew->sBulletChar;
- else if ( pValues[j].Name == cBulletFontName )
+ else if ( pValues[j].Name == "BulletFontName" )
pValues[j].Value >>= pNew->sBulletFont;
}
return pNew;