summaryrefslogtreecommitdiff
path: root/sfx2/source
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2012-05-10 12:09:21 +0200
committerStephan Bergmann <sbergman@redhat.com>2012-05-10 12:12:09 +0200
commitd16c1b9290e11ca31850523a2b01426bca0937a3 (patch)
tree3e33533a695a827e64798a1cf5de8a7b2566237c /sfx2/source
parent1173bb0dc01ef504ea453a272b77b0b4d92a662f (diff)
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
Diffstat (limited to 'sfx2/source')
-rw-r--r--sfx2/source/doc/objmisc.cxx36
-rw-r--r--sfx2/source/view/impviewframe.hxx1
-rw-r--r--sfx2/source/view/viewfrm.cxx9
-rw-r--r--sfx2/source/view/viewfrm2.cxx94
4 files changed, 2 insertions, 138 deletions
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index 2d6398b3da69..900858c1f923 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -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;
diff --git a/sfx2/source/view/impviewframe.hxx b/sfx2/source/view/impviewframe.hxx
index c4b3d081843e..16fe88a346fd 100644
--- a/sfx2/source/view/impviewframe.hxx
+++ b/sfx2/source/view/impviewframe.hxx
@@ -39,7 +39,6 @@ struct SfxViewFrame_Impl
SvBorder aBorder;
Size aMargin;
Size aSize;
- String aFrameTitle;
TypeId aLastType;
String aActualURL;
SfxFrame& rFrame;
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 278f6f9b29cf..34929e20702c 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -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:
{
diff --git a/sfx2/source/view/viewfrm2.cxx b/sfx2/source/view/viewfrm2.cxx
index 41937a3bca61..7f2e6ca2c057 100644
--- a/sfx2/source/view/viewfrm2.cxx
+++ b/sfx2/source/view/viewfrm2.cxx
@@ -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 )