Removed unused SID_FRAMETITLE

...which was only ever written to, never read.  This in turn allowed
SfxViewFrame::UpdateTitle to return void instead of String, and made
SfxObjectShell::UpdateTitle become unused.  (The title appears to be created via
SfxBaseModel::getTitle instead these days?)

Change-Id: I5e1115a707134058a1f3a0beaa180eb471c817e6
This commit is contained in:
Stephan Bergmann
2012-05-10 12:09:21 +02:00
parent 1173bb0dc0
commit d16c1b9290
9 changed files with 3 additions and 172 deletions

View File

@@ -562,7 +562,6 @@ public:
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > GetEventNames();
Window* GetDialogParent( SfxMedium* pMedium=0 );
String UpdateTitle( SfxMedium* pMed=NULL, sal_uInt16 nDocViewNo=0 );
static SfxObjectShell* CreateObject( const String& rServiceName, SfxObjectCreateMode = SFX_CREATE_MODE_STANDARD );
static SfxObjectShell* CreateObjectByFactoryName( const String& rURL, SfxObjectCreateMode = SFX_CREATE_MODE_STANDARD );
static ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >

View File

@@ -374,7 +374,6 @@
#define SID_PLUGFRAMEARG (SID_SFX_START + 666)
#define SID_NEWWINDOWFOREDIT (SID_SFX_START + 667)
#define SID_FRAMETITLE (SID_SFX_START + 668)
#define SID_DOCTEMPLATE (SID_SFX_START + 538)
#define SID_JSCALL (SID_SFX_START + 1382)

View File

@@ -163,7 +163,7 @@ public:
void ShowStatusText( const String& rText );
void HideStatusText();
String UpdateTitle();
void UpdateTitle();
static void ActivateToolPanel( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rFrame, const ::rtl::OUString& i_rPanelURL );

View File

@@ -392,10 +392,6 @@ interface TopWindow : BrowseWindow
ExecMethod = MiscExec_Impl ;
StateMethod = MiscState_Impl ;
]
SID_FRAMETITLE // ole(no) api(play/rec)
[
StateMethod = StateView_Impl ;
]
SID_CLOSEWIN // ole(no) api(final/play/rec)
[
ExecMethod = Exec_Impl ;

View File

@@ -1883,33 +1883,6 @@ SfxTemplateItem FrameStyle SID_STYLE_FAMILY3
GroupId = GID_DOCUMENT;
]
//--------------------------------------------------------------------------
SfxStringItem FrameTitle SID_FRAMETITLE
[
/* flags: */
AutoUpdate = FALSE,
Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = FALSE,
ReadOnlyDoc = TRUE,
Toggle = FALSE,
Container = FALSE,
RecordAbsolute = FALSE,
RecordPerSet;
Synchron;
Readonly = TRUE,
/* config: */
AccelConfig = FALSE,
MenuConfig = FALSE,
StatusBarConfig = FALSE,
ToolBoxConfig = FALSE,
GroupId = ;
]
//--------------------------------------------------------------------------
SfxStringItem FullName SID_PROGFILENAME

View File

@@ -1844,42 +1844,6 @@ Window* SfxObjectShell::GetDialogParent( SfxMedium* pLoadingMedium )
return pWindow;
}
String SfxObjectShell::UpdateTitle( SfxMedium* pMed, sal_uInt16 nDocViewNumber )
{
// Title of the windows
String aTitle;
if ( pMed )
{
INetURLObject aTmp( pMed->GetName() );
aTitle = aTmp.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET );
}
else
{
pMed = GetMedium();
aTitle = GetTitle(SFX_TITLE_CAPTION);
String aName(aTitle);
if ( nDocViewNumber )
{
aName += ':';
aName += String::CreateFromInt32( nDocViewNumber );
}
}
if ( pMed )
{
SFX_ITEMSET_ARG( pMed->GetItemSet(), pRepairedDocItem, SfxBoolItem, SID_REPAIRPACKAGE, sal_False );
if ( pRepairedDocItem && pRepairedDocItem->GetValue() )
aTitle += String( SfxResId(STR_REPAIREDDOCUMENT) );
}
if ( IsReadOnlyUI() || (pMed && pMed->IsReadOnly()) )
aTitle += String( SfxResId(STR_READONLY) );
else if ( IsDocShared() )
aTitle += String( SfxResId(STR_SHARED) );
return aTitle;
}
void SfxObjectShell::SetCreateMode_Impl( SfxObjectCreateMode nMode )
{
eCreateMode = nMode;

View File

@@ -39,7 +39,6 @@ struct SfxViewFrame_Impl
SvBorder aBorder;
Size aMargin;
Size aSize;
String aFrameTitle;
TypeId aLastType;
String aActualURL;
SfxFrame& rFrame;

View File

@@ -2467,15 +2467,6 @@ void SfxViewFrame::StateView_Impl
rSet.DisableItem( nWhich );
break;
}
case SID_FRAMETITLE:
{
if( GetFrameType() & SFXFRAME_HASTITLE )
rSet.Put( SfxStringItem(
SID_FRAMETITLE, pImp->aFrameTitle) );
else
rSet.DisableItem( nWhich );
break;
}
case SID_NEWWINDOW:
{

View File

@@ -44,13 +44,9 @@
#include "sfx2/viewfrm.hxx"
#include "sfx2/viewsh.hxx"
#include <com/sun/star/beans/NamedValue.hpp>
#include <com/sun/star/beans/XMaterialHolder.hpp>
#include <com/sun/star/util/XCloseable.hpp>
#include <comphelper/componentcontext.hxx>
#include <comphelper/namedvaluecollection.hxx>
#include <comphelper/processfactory.hxx>
#include <svtools/asynclink.hxx>
#include <svl/eitem.hxx>
#include <svl/intitem.hxx>
@@ -58,8 +54,6 @@
#include <svl/stritem.hxx>
#include <tools/diagnose_ex.h>
#include <tools/urlobj.hxx>
#include <unotools/bootstrap.hxx>
#include <unotools/configmgr.hxx>
#include <vcl/window.hxx>
using namespace ::com::sun::star;
@@ -71,28 +65,6 @@ using namespace ::com::sun::star::beans;
using ::com::sun::star::lang::XMultiServiceFactory;
using ::com::sun::star::lang::XComponent;
//------------------------------------------------------------------------
static ::rtl::OUString GetModuleName_Impl( const ::rtl::OUString& sDocService )
{
uno::Reference< container::XNameAccess > xMM( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.ModuleManager"))), uno::UNO_QUERY );
::rtl::OUString sVar;
if ( !xMM.is() )
return sVar;
try
{
::comphelper::NamedValueCollection aAnalyzer( xMM->getByName( sDocService ) );
sVar = aAnalyzer.getOrDefault( "ooSetupFactoryUIName", ::rtl::OUString() );
}
catch( uno::Exception& )
{
sVar = ::rtl::OUString();
}
return sVar;
}
//--------------------------------------------------------------------
void SfxFrameViewWindow_Impl::StateChanged( StateChangedType nStateChange )
{
@@ -114,34 +86,10 @@ void SfxFrameViewWindow_Impl::Resize()
pFrame->Resize();
}
static String _getTabString()
{
String result;
Reference < XMaterialHolder > xHolder(
::comphelper::getProcessServiceFactory()->createInstance(
DEFINE_CONST_UNICODE("com.sun.star.tab.tabreg") ), UNO_QUERY );
if (xHolder.is())
{
rtl::OUString aTabString;
Sequence< NamedValue > sMaterial;
if (xHolder->getMaterial() >>= sMaterial) {
for (int i=0; i < sMaterial.getLength(); i++) {
if (( sMaterial[i].Name == "title" ) && ( sMaterial[i].Value >>= aTabString ))
{
result += ' ';
result += String(aTabString);
}
}
}
}
return result;
}
//========================================================================
//--------------------------------------------------------------------
String SfxViewFrame::UpdateTitle()
void SfxViewFrame::UpdateTitle()
/* [Description]
@@ -187,7 +135,7 @@ String SfxViewFrame::UpdateTitle()
SfxObjectShell *pObjSh = GetObjectShell();
if ( !pObjSh )
return String();
return;
const SfxMedium *pMedium = pObjSh->GetMedium();
@@ -203,23 +151,6 @@ String SfxViewFrame::UpdateTitle()
// URL has changed
pImp->aActualURL = aURL;
// Is there another view?
sal_uInt16 nViews=0;
for ( SfxViewFrame *pView= GetFirst(pObjSh);
pView && nViews<2;
pView = GetNext(*pView,pObjSh) )
if ( ( pView->GetFrameType() & SFXFRAME_HASTITLE ) &&
!IsDowning_Impl())
nViews++;
// Window Title
String aTitle;
if ( nViews == 2 || pImp->nDocViewNo > 1 )
// Then attach the number
aTitle = pObjSh->UpdateTitle( NULL, pImp->nDocViewNo );
else
aTitle = pObjSh->UpdateTitle();
// SbxObjects name
String aSbxName = pObjSh->SfxShell::GetName();
if ( IsVisible() )
@@ -229,29 +160,8 @@ String SfxViewFrame::UpdateTitle()
}
SetName( aSbxName );
pImp->aFrameTitle = aTitle;
GetBindings().Invalidate( SID_FRAMETITLE );
GetBindings().Invalidate( SID_CURRENT_URL );
aTitle += String::CreateFromAscii( " - " );
aTitle += utl::ConfigManager::getProductName();
aTitle += ' ';
::rtl::OUString aDocServiceName( GetObjectShell()->GetFactory().GetDocumentServiceName() );
aTitle += String( GetModuleName_Impl( aDocServiceName ) );
#ifdef DBG_UTIL
::rtl::OUString aDefault(RTL_CONSTASCII_USTRINGPARAM("development"));
aTitle += DEFINE_CONST_UNICODE(" [");
String aVerId( utl::Bootstrap::getProductSource( aDefault ));
aTitle += aVerId;
aTitle += ']';
#endif
// append TAB string if available
aTitle += _getTabString();
GetBindings().Invalidate( SID_NEWDOCDIRECT );
return aTitle;
}
void SfxViewFrame::Exec_Impl(SfxRequest &rReq )