[Libreoffice-commits] core.git: include/sfx2 sfx2/source
Matteo Casalin
matteo.casalin at yahoo.com
Fri Mar 17 20:22:52 UTC 2017
include/sfx2/docfac.hxx | 1 -
sfx2/source/doc/docfac.cxx | 2 +-
sfx2/source/view/viewfrm.cxx | 8 ++++----
3 files changed, 5 insertions(+), 6 deletions(-)
New commits:
commit b165f0f9cc358e6127f69227fc3e4f6428fe50c7
Author: Matteo Casalin <matteo.casalin at yahoo.com>
Date: Fri Mar 17 11:54:00 2017 +0100
Remove SfxObjectFactory::GetShortName()
Used in just two places, where GetFactoryName can also work.
Change-Id: I8d498345c41aef520ef776a3deb6744cc64756f5
Reviewed-on: https://gerrit.libreoffice.org/35374
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Matteo Casalin <matteo.casalin at yahoo.com>
diff --git a/include/sfx2/docfac.hxx b/include/sfx2/docfac.hxx
index 547ad584b19a..2658eaa07e6c 100644
--- a/include/sfx2/docfac.hxx
+++ b/include/sfx2/docfac.hxx
@@ -53,7 +53,6 @@ public:
const SvGlobalName& GetClassId() const;
SfxObjectShellFlags GetFlags() { return nFlags; }
- const char* GetShortName() const { return pShortName; }
OUString GetFactoryURL() const; // shortcut for "private:factory/GetShortName()"
OUString GetFactoryName() const { return OUString::createFromAscii(pShortName); }
OUString GetModuleName() const;
diff --git a/sfx2/source/doc/docfac.cxx b/sfx2/source/doc/docfac.cxx
index dbeeb746c893..20ebfbcfc0fa 100644
--- a/sfx2/source/doc/docfac.cxx
+++ b/sfx2/source/doc/docfac.cxx
@@ -344,7 +344,7 @@ OUString SfxObjectFactory::GetFactoryURL() const
{
OUStringBuffer aURLComposer;
aURLComposer.append("private:factory/");
- aURLComposer.appendAscii(GetShortName());
+ aURLComposer.appendAscii(pShortName);
return aURLComposer.makeStringAndClear();
}
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 1e9ec49cebf4..70494e9de94a 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -2782,9 +2782,9 @@ void SfxViewFrame::MiscState_Impl(SfxItemSet &rSet)
case SID_RECORDMACRO :
{
SvtMiscOptions aMiscOptions;
- const char* pName = GetObjectShell()->GetFactory().GetShortName();
+ const OUString sName{GetObjectShell()->GetFactory().GetFactoryName()};
if ( !aMiscOptions.IsMacroRecorderMode() ||
- ( strcmp(pName,"swriter") && strcmp(pName,"scalc") ) )
+ ( sName!="swriter" && sName!="scalc" ) )
{
rSet.DisableItem( nWhich );
rSet.Put(SfxVisibilityItem(nWhich, false));
@@ -2808,9 +2808,9 @@ void SfxViewFrame::MiscState_Impl(SfxItemSet &rSet)
case SID_STOP_RECORDING :
{
SvtMiscOptions aMiscOptions;
- const char* pName = GetObjectShell()->GetFactory().GetShortName();
+ const OUString sName{GetObjectShell()->GetFactory().GetFactoryName()};
if ( !aMiscOptions.IsMacroRecorderMode() ||
- ( strcmp(pName,"swriter") && strcmp(pName,"scalc") ) )
+ ( sName!="swriter" && sName!="scalc" ) )
{
rSet.DisableItem( nWhich );
break;
More information about the Libreoffice-commits
mailing list