Commits

Anonymous committed 5445f8d

extbxctrls: implementation of the recent files toolbar controller.

Comments (0)

Files changed (2)

framework/inc/uielement/recentfilelisttoolbarcontroller.hxx

 
 	private:
 	    struct RecentFileEntry
-        {
+            {
                rtl::OUString aURL;
                rtl::OUString aFilter;
                rtl::OUString aTitle;
                rtl::OUString aPassword;
-        };
+            };
         
-		typedef std::vector< RecentFileEntry > RecentFileMenuEntries;
-		RecentFileMenuEntries                                   m_aRecentFilesItems;
-		sal_Bool                                                m_bUriAbbreviationInit;
-		css::uno::Reference< css::util::XStringAbbreviation >   m_xUriAbbreviation;
-		PopupMenu                                               * m_pPopupMenu;
-        css::uno::Reference< css::util::XStringWidth >          m_xStringWidth;
+	    typedef std::vector< RecentFileEntry > RecentFileMenuEntries;
+	    RecentFileMenuEntries                                   m_aRecentFilesItems;
+	    sal_Bool                                                m_bUriAbbreviationInit;
+	    css::uno::Reference< css::util::XStringAbbreviation >   m_xUriAbbreviation;
+	    PopupMenu                                               * m_pPopupMenu;
+            css::uno::Reference< css::util::XStringWidth >          m_xStringWidth;
 
-		void showPopupMenu();
-		void fillPopupMenu();
-		void initAbbreviation();//transfer the string
-
+	    void showPopupMenu();
+	    void fillPopupMenu();
+	    void initAbbreviation();//transfer the string
 };
 
 }

framework/source/uielement/recentfilelisttoolbarcontroller.cxx

 };
 
 DEFINE_XSERVICEINFO_MULTISERVICE (   RecentFileListToolbarController ,
-									 OWeakObject						,
-									 SERVICENAME_TOOLBARCONTROLLER	,
-									 IMPLEMENTATIONNAME_RECENTFILELISTTOOLBARCONTROLLER
-								 )
+				     OWeakObject						,
+				     SERVICENAME_TOOLBARCONTROLLER	,
+				     IMPLEMENTATIONNAME_RECENTFILELISTTOOLBARCONTROLLER
+				 )
 
 DEFINE_INIT_SERVICE ( RecentFileListToolbarController, {} )
 
 	css::uno::Reference< css::frame::XDispatch >       xDispatch;
 	css::uno::Reference< css::frame::XDispatchProvider >   xDispatchProvider;
 	css::uno::Reference< css::lang::XMultiServiceFactory > xSrvMgr;
-    ::osl::ResettableGuard < ::osl::Mutex > aGuard( m_aMutex );
+        ::osl::ResettableGuard < ::osl::Mutex > aGuard( m_aMutex );
 	xDispatchProvider = css::uno::Reference< css::frame::XDispatchProvider >( getFrameInterface(), css::uno::UNO_QUERY );
-    xSrvMgr           = m_xServiceManager; 
-    aGuard.clear();
+        xSrvMgr           = m_xServiceManager; 
+        aGuard.clear();
   
 	css::util::URL aTargetURL;
 	css::uno::Sequence< css::beans::PropertyValue > aArgsList( NUM_OF_PICKLIST_ARGS );
-    if(pMenu && xDispatchProvider.is())
+        if(pMenu && xDispatchProvider.is())
 	{
-		css::uno::Reference< css::util::XURLTransformer > xURLTransformer( 
+	    css::uno::Reference< css::util::XURLTransformer > xURLTransformer( 
             xSrvMgr->createInstance( 
-                rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))),
+            rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))),
 				css::uno::UNO_QUERY );
 
-        sal_Bool            bEntryFound( false );
-		sal_Bool		    bResetList( false );
-        RecentFileEntry aRecentFile;
+            sal_Bool            bEntryFound( false );
+	    sal_Bool		    bResetList( false );
+            RecentFileEntry aRecentFile;
         
-        sal_Int32 nIdx = pMenu->GetCurItemId(); 
-        aGuard.reset();
-	if ( ( nIdx >= 1 ) && ( nIdx <= sal::static_int_cast<sal_Int32>(m_aRecentFilesItems.size()) ) )
-        {
-            aRecentFile = m_aRecentFilesItems[ nIdx-1 ];
-            bEntryFound = sal_True;
-        }
-	else
-	{
-	    bResetList = sal_False;
-	}
-        aGuard.clear();
-	if ( bEntryFound && xURLTransformer.is() )
-        {
-	    aTargetURL.Complete = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:Open" ));
-            xURLTransformer->parseStrict( aTargetURL );
+            sal_Int32 nIdx = pMenu->GetCurItemId(); 
+            aGuard.reset();
+	    if ( ( nIdx >= 1 ) && ( nIdx <= sal::static_int_cast<sal_Int32>(m_aRecentFilesItems.size()) ) )
+            {
+                aRecentFile = m_aRecentFilesItems[ nIdx-1 ];
+                bEntryFound = sal_True;
+            }
+	    else
+	    {
+	        bResetList = sal_False;
+	    }
+            aGuard.clear();
+	    if ( bEntryFound && xURLTransformer.is() )
+            {
+	        aTargetURL.Complete = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:Open" ));
+                xURLTransformer->parseStrict( aTargetURL );
 
             // templates in the picklist will never be opened as documents
-            sal_Int32 nIndex( 0 );
-            aArgsList[nIndex].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AsTemplate" ));
+               sal_Int32 nIndex( 0 );
+               aArgsList[nIndex].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AsTemplate" ));
 			aArgsList[nIndex].Value = css::uno::makeAny( sal_False );
-            ++nIndex;
+               ++nIndex;
 
-            ::rtl::OUString  aFilter( aRecentFile.aFilter );
-            sal_Int32 nPos = aFilter.indexOf( '|' );
-            if ( nPos >= 0 )
-            {
+               ::rtl::OUString  aFilter( aRecentFile.aFilter );
+               sal_Int32 nPos = aFilter.indexOf( '|' );
+               if ( nPos >= 0 )
+               {
 	            ::rtl::OUString aFilterOptions;
 
 	            if ( nPos < ( aFilter.getLength() - 1 ) )
 
 	            aArgsList[nIndex].Name  = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FilterOptions" ));
 				aArgsList[nIndex].Value = css::uno::makeAny( aFilterOptions );
-                ++nIndex;
+                     ++nIndex;
 
 	            aFilter = aFilter.copy( 0, nPos-1 );
-                aArgsList.realloc( NUM_OF_PICKLIST_ARGS + 1 );
-            }
+                    aArgsList.realloc( NUM_OF_PICKLIST_ARGS + 1 );
+               }
 
-	        aArgsList[nIndex].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FilterName" ));
-			aArgsList[nIndex].Value = css::uno::makeAny( aFilter );
-			++nIndex;
+	       aArgsList[nIndex].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FilterName" ));
+	       aArgsList[nIndex].Value = css::uno::makeAny( aFilter );
+	       ++nIndex;
 
-			aArgsList[nIndex].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "URL" ));
-			::rtl::OUString  aComd(pMenu->GetItemCommand( pMenu->GetCurItemId()));
-			aArgsList[nIndex].Value = css::uno::makeAny(aComd);
-			++nIndex;
+	       aArgsList[nIndex].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "URL" ));
+	       ::rtl::OUString  aComd(pMenu->GetItemCommand( pMenu->GetCurItemId()));
+	       aArgsList[nIndex].Value = css::uno::makeAny(aComd);
+	       ++nIndex;
 
-			aArgsList[nIndex].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SynchronMode" ));
-			aArgsList[nIndex].Value = css::uno::makeAny( sal_False );
-			++nIndex;
+	       aArgsList[nIndex].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SynchronMode" ));
+	       aArgsList[nIndex].Value = css::uno::makeAny( sal_False );
+	       ++nIndex;
 
-			aArgsList[nIndex].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FrameName" ));
-			aArgsList[nIndex].Value = css::uno::makeAny( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_default" )));
+	       aArgsList[nIndex].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FrameName" ));
+	       aArgsList[nIndex].Value = css::uno::makeAny( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_default" )));
 			
-			const ::rtl::OUString aSelf( RTL_CONSTASCII_USTRINGPARAM( "_self" ));
-			xDispatch = xDispatchProvider->queryDispatch( aTargetURL, aSelf, 0 );
-            if ( xDispatch.is() )
-                xDispatch->dispatch( aTargetURL, aArgsList ); 
-        }
+	       const ::rtl::OUString aSelf( RTL_CONSTASCII_USTRINGPARAM( "_self" ));
+	       xDispatch = xDispatchProvider->queryDispatch( aTargetURL, aSelf, 0 );
+               if ( xDispatch.is() )
+                   xDispatch->dispatch( aTargetURL, aArgsList ); 
+           }
 	}
 
     return 1;
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.