[Libreoffice-commits] .: sfx2/inc sfx2/sdi sfx2/source

Stephan Bergmann sbergmann at kemper.freedesktop.org
Thu May 10 03:13:03 PDT 2012


 sfx2/inc/sfx2/objsh.hxx           |    1 
 sfx2/inc/sfx2/sfxsids.hrc         |    1 
 sfx2/inc/sfx2/viewfrm.hxx         |    2 
 sfx2/sdi/frmslots.sdi             |    4 -
 sfx2/sdi/sfx.sdi                  |   27 ----------
 sfx2/source/doc/objmisc.cxx       |   36 --------------
 sfx2/source/view/impviewframe.hxx |    1 
 sfx2/source/view/viewfrm.cxx      |    9 ---
 sfx2/source/view/viewfrm2.cxx     |   94 --------------------------------------
 9 files changed, 3 insertions(+), 172 deletions(-)

New commits:
commit d16c1b9290e11ca31850523a2b01426bca0937a3
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu May 10 12:09:21 2012 +0200

    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

diff --git a/sfx2/inc/sfx2/objsh.hxx b/sfx2/inc/sfx2/objsh.hxx
index fdb53b2..3c1837b 100644
--- a/sfx2/inc/sfx2/objsh.hxx
+++ b/sfx2/inc/sfx2/objsh.hxx
@@ -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 >
diff --git a/sfx2/inc/sfx2/sfxsids.hrc b/sfx2/inc/sfx2/sfxsids.hrc
index c6fbdc4..fbd8995 100644
--- a/sfx2/inc/sfx2/sfxsids.hrc
+++ b/sfx2/inc/sfx2/sfxsids.hrc
@@ -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)
diff --git a/sfx2/inc/sfx2/viewfrm.hxx b/sfx2/inc/sfx2/viewfrm.hxx
index 266e058..5a99c48 100644
--- a/sfx2/inc/sfx2/viewfrm.hxx
+++ b/sfx2/inc/sfx2/viewfrm.hxx
@@ -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 );
 
diff --git a/sfx2/sdi/frmslots.sdi b/sfx2/sdi/frmslots.sdi
index c17b2b1..7ad2317 100644
--- a/sfx2/sdi/frmslots.sdi
+++ b/sfx2/sdi/frmslots.sdi
@@ -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 ;
diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi
index 7ae6fd2..396fbb7 100644
--- a/sfx2/sdi/sfx.sdi
+++ b/sfx2/sdi/sfx.sdi
@@ -1884,33 +1884,6 @@ SfxTemplateItem FrameStyle SID_STYLE_FAMILY3
 ]
 
 //--------------------------------------------------------------------------
-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
 
 [
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index 2d6398b..900858c 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 c4b3d08..16fe88a 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 278f6f9..34929e2 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 41937a3..7f2e6ca 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 )


More information about the Libreoffice-commits mailing list