Tag: cws_dev300_dba30d
User: fs      
Date: 2008-06-10 14:00:12+0000
Modified:
   dba/dbaccess/source/ui/app/AppController.cxx

Log:
 #i80943# for consistency with the Selection in a ContextMenuExecuteEvent, use 
more structured data in XSelectionSupplier::getSelection, namely use a 
Sequence< NamedDatabaseObject >

File Changes:

Directory: /dba/dbaccess/source/ui/app/
=======================================

File [changed]: AppController.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/app/AppController.cxx?r1=1.60.10.5&r2=1.60.10.6
Delta lines:  +10 -24
---------------------
--- AppController.cxx   2008-06-10 06:40:49+0000        1.60.10.5
+++ AppController.cxx   2008-06-10 14:00:09+0000        1.60.10.6
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: AppController.cxx,v $
- * $Revision: 1.60.10.5 $
+ * $Revision: 1.60.10.6 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -259,6 +259,7 @@
 using namespace ::com::sun::star::ui::dialogs;
 using namespace ::com::sun::star::task;
 using ::com::sun::star::document::XEmbeddedScripts;
+using ::com::sun::star::sdb::application::NamedDatabaseObject;
 
 
//------------------------------------------------------------------------------
 ::rtl::OUString SAL_CALL OApplicationController::getImplementationName() 
throw( RuntimeException )
@@ -275,7 +276,7 @@
 Sequence< ::rtl::OUString> 
OApplicationController::getSupportedServiceNames_Static(void) throw( 
RuntimeException )
 {
        Sequence< ::rtl::OUString> aSupported(1);
-       aSupported.getArray()[0] = 
::rtl::OUString::createFromAscii("com.sun.star.sdb.ApplicationController");
+       aSupported.getArray()[0] = 
::rtl::OUString::createFromAscii("com.sun.star.sdb.application.DefaultViewController");
        return aSupported;
 }
 //-------------------------------------------------------------------------
@@ -2391,9 +2392,9 @@
 // 
-----------------------------------------------------------------------------
 Any OApplicationController::getCurrentSelection( Control& _rControl ) const
 {
-    Any aSelection;
+    Sequence< NamedDatabaseObject > aSelection;
        getContainer()->describeCurrentSelectionForControl( _rControl, 
aSelection );
-    return aSelection;
+    return makeAny( aSelection );
 }
 
 // 
-----------------------------------------------------------------------------
@@ -2819,25 +2820,10 @@
 {
     ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
        ::osl::MutexGuard aGuard(m_aMutex);
-    Sequence< NamedValue > aCurrentSelection;
-    if ( getContainer() )
-    {
-        ::std::vector< ::rtl::OUString> aList;
-           getSelectionElementNames(aList);
-        NamedValue aType;
-        aType.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Type"));
-        aType.Value <<= 
static_cast<sal_Int32>(getContainer()->getElementType());
-        NamedValue aNames;
-        aNames.Name = 
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Selection"));
-        if ( !aList.empty() )
-            aNames.Value <<= Sequence< 
::rtl::OUString>(&aList[0],aList.size());
-
-        aCurrentSelection.realloc(2);
-        aCurrentSelection[0] = aType;
-        aCurrentSelection[1] = aNames;
-    }
 
-    return makeAny(aCurrentSelection);
+    Sequence< NamedDatabaseObject > aCurrentSelection;
+    getContainer()->describeCurrentSelectionForType( 
getContainer()->getElementType(), aCurrentSelection );
+    return makeAny( aCurrentSelection );
 }
 // 
-----------------------------------------------------------------------------
 void OApplicationController::impl_migrateScripts_nothrow()




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to