ooo-build r15324 - in branches/ooo-build-3-0-1: . patches/dev300



Author: challs
Date: Thu Feb 12 17:09:15 2009
New Revision: 15324
URL: http://svn.gnome.org/viewvc/ooo-build?rev=15324&view=rev

Log:
Update recent files list after save as and open
iz#51154; see also bugs.debian.org/505879


Added:
   branches/ooo-build-3-0-1/patches/dev300/sfx2-recent-files.diff
Modified:
   branches/ooo-build-3-0-1/ChangeLog
   branches/ooo-build-3-0-1/patches/dev300/apply

Modified: branches/ooo-build-3-0-1/patches/dev300/apply
==============================================================================
--- branches/ooo-build-3-0-1/patches/dev300/apply	(original)
+++ branches/ooo-build-3-0-1/patches/dev300/apply	Thu Feb 12 17:09:15 2009
@@ -870,6 +870,10 @@
 # always enable file save even when the document is not modified.
 sfx2-always-allow-save-document.diff, n#347423, i#5226, kohei
 
+# Update recent files list after save as and open
+# see also bugs.debian.org/505879
+sfx2-recent-files.diff, i#51154, haggai
+
 # Adjust scroll speed while extending selection beyoud visible sheet area.
 scroll-accel-sc.diff, n#375909, i#71362, kohei
 scroll-accel-vcl.diff, n#375909, i#71362, kohei

Added: branches/ooo-build-3-0-1/patches/dev300/sfx2-recent-files.diff
==============================================================================
--- (empty file)
+++ branches/ooo-build-3-0-1/patches/dev300/sfx2-recent-files.diff	Thu Feb 12 17:09:15 2009
@@ -0,0 +1,118 @@
+diff -urd sfx2/source.orig/appl/sfxpicklist.cxx sfx2/source/appl/sfxpicklist.cxx
+--- sfx2/source.orig/appl/sfxpicklist.cxx	2008-04-15 14:18:30.000000000 +0000
++++ sfx2/source/appl/sfxpicklist.cxx	2009-02-12 15:58:42.000000000 +0000
+@@ -391,19 +391,18 @@
+ 			}
+             break;
+ 
+-            case SFX_EVENT_OPENDOC:
++            case SFX_EVENT_SAVEASDOCDONE:
+             {
+                 SfxMedium *pMed = pDocSh->GetMedium();
+                 if( !pMed )
+                     return;
+ 
+-                // unbenannt-Docs und embedded-Docs nicht in History
+-                if ( !pDocSh->HasName() ||
+-                     SFX_CREATE_MODE_STANDARD != pDocSh->GetCreateMode() )
++                // embedded docs should not be saved to history
++                if ( SFX_CREATE_MODE_STANDARD != pDocSh->GetCreateMode() )
+                     return;
+ 
+-                // Hilfe nicht in History
+-				INetURLObject aURL( pDocSh->IsDocShared() ? pDocSh->GetSharedFileURL() : ::rtl::OUString( pMed->GetOrigURL() ) );
++                // Help documents are not saved to history
++                INetURLObject aURL( pDocSh->IsDocShared() ? pDocSh->GetSharedFileURL() : ::rtl::OUString( pMed->GetOrigURL() ) );
+                 if ( aURL.GetProtocol() == INET_PROT_VND_SUN_STAR_HELP )
+                     return;
+ 
+@@ -413,31 +412,65 @@
+                 if ( pFilter )
+                     aFilter = pFilter->GetFilterName();
+ 
++                // Now add into picklist (File->Recent Documents) if required
++
++                // add no document that forbids this (for example Message-Body)
++                SFX_ITEMSET_ARG( pMed->GetItemSet(), pPicklistItem, SfxBoolItem, SID_PICKLIST, sal_False );
++                if (
++                    (pPicklistItem && !pPicklistItem->GetValue()) ||
++                    (!(pDocSh->Get_Impl()->bWaitingForPicklist) )
++                   )
++                    return;
++
++                // ignore hidden documents
++                if ( !SfxViewFrame::GetFirst( pDocSh, 0, TRUE ) )
++                    return;
++
+                 // add to svtool history options
+-                SvtHistoryOptions().AppendItem( eHISTORY,
++                SvtHistoryOptions().AppendItem( ePICKLIST,
+                         aURL.GetURLNoPass( INetURLObject::NO_DECODE ),
+                         aFilter,
+                         aTitle,
+                         SfxStringEncode( aURL.GetPass() ) );
++
++                pDocSh->Get_Impl()->bWaitingForPicklist = sal_False;
++
++                if ( aURL.GetProtocol() == INET_PROT_FILE )
++                    SystemShell::AddToRecentDocumentList( aURL.GetURLNoPass( INetURLObject::NO_DECODE ), (pFilter) ? pFilter->GetMimeType() : String() );
+             }
+             break;
+ 
+-			case SFX_EVENT_CLOSEDOC:
+-			{
+-				SfxMedium *pMed = pDocSh->GetMedium();
+-				if( !pMed )
+-					return;
++            case SFX_EVENT_OPENDOC:
++            {
++                SfxMedium *pMed = pDocSh->GetMedium();
++                if( !pMed )
++                    return;
+ 
+-				// unbenannt-Docs und embedded-Docs nicht in Pickliste
+-				if ( !pDocSh->HasName() ||
+-					 SFX_CREATE_MODE_STANDARD != pDocSh->GetCreateMode() )
+-					return;
++                // untitled and embedded docs should not be saved to history
++                if ( !pDocSh->HasName() ||
++                     SFX_CREATE_MODE_STANDARD != pDocSh->GetCreateMode() )
++                    return;
+ 
+-                // Hilfe nicht in History
++                // Help documents are not saved to history
+ 				INetURLObject aURL( pDocSh->IsDocShared() ? pDocSh->GetSharedFileURL() : ::rtl::OUString( pMed->GetOrigURL() ) );
+                 if ( aURL.GetProtocol() == INET_PROT_VND_SUN_STAR_HELP )
+                     return;
+ 
++                ::rtl::OUString  aTitle = pDocSh->GetTitle(SFX_TITLE_PICKLIST);
++                ::rtl::OUString  aFilter;
++                const SfxFilter* pFilter = pMed->GetOrigFilter();
++                if ( pFilter )
++                    aFilter = pFilter->GetFilterName();
++
++                // add to svtool history options
++                SvtHistoryOptions().AppendItem( eHISTORY,
++                        aURL.GetURLNoPass( INetURLObject::NO_DECODE ),
++                        aFilter,
++                        aTitle,
++                        SfxStringEncode( aURL.GetPass() ) );
++
++                // Now add into picklist (File->Recent Documents) if required
++
+                 // only add r/w document into picklist
+                 if ( pDocSh->IsReadOnly() || !pMed->IsUpdatePickList() )
+                     return;
+@@ -454,12 +487,6 @@
+                 if ( !SfxViewFrame::GetFirst( pDocSh, 0, TRUE ) )
+                     return;
+ 
+-                ::rtl::OUString	 aTitle = pDocSh->GetTitle(SFX_TITLE_PICKLIST);
+-                ::rtl::OUString	 aFilter;
+-                const SfxFilter* pFilter = pMed->GetOrigFilter();
+-                if ( pFilter )
+-                    aFilter = pFilter->GetFilterName();
+-
+                 // add to svtool history options
+                 SvtHistoryOptions().AppendItem( ePICKLIST,
+                         aURL.GetURLNoPass( INetURLObject::NO_DECODE ),



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]