Tag: cws_src680_rpt23fix02
User: oj      
Date: 2007-07-24 12:45:34+0000
Modified:
   dba/dbaccess/source/core/dataaccess/documentdefinition.cxx
   dba/dbaccess/source/core/dataaccess/documentdefinition.hxx
   dba/dbaccess/source/ui/app/AppController.cxx
   dba/dbaccess/source/ui/app/AppDetailView.cxx
   dba/dbaccess/source/ui/browser/dbloader.cxx
   dba/dbaccess/source/ui/browser/genericcontroller.cxx
   dba/dbaccess/source/ui/dlg/ExtensionNotPresent.src
   dba/dbaccess/source/ui/misc/UITools.cxx

Log:
 merge from rpt23fix01

File Changes:

Directory: /dba/dbaccess/source/core/dataaccess/
================================================

File [changed]: documentdefinition.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/documentdefinition.cxx?r1=1.43.14.2&r2=1.43.14.3
Delta lines:  +28 -31
---------------------
--- documentdefinition.cxx      2007-07-24 09:49:43+0000        1.43.14.2
+++ documentdefinition.cxx      2007-07-24 12:45:30+0000        1.43.14.3
@@ -669,30 +669,6 @@
 }
 
 // 
-----------------------------------------------------------------------------
-void ODocumentDefinition::impl_appendFrameToDocumentFrames_throw( const 
Reference< XFrame >& _rxFrame )
-{
-    Reference< XModel > xDatabaseDocumentModel;
-    if ( m_pImpl->m_pDataSource )
-        xDatabaseDocumentModel = m_pImpl->m_pDataSource->getModel_noCreate();
-
-    Reference< XController > xDatabaseDocumentController;
-    if ( xDatabaseDocumentModel.is() )
-        xDatabaseDocumentController = 
xDatabaseDocumentModel->getCurrentController();
-
-    Reference< XFramesSupplier > xDatabaseDocumentFramesSupp;
-    if ( xDatabaseDocumentController.is() )
-        xDatabaseDocumentFramesSupp = xDatabaseDocumentFramesSupp.query( 
xDatabaseDocumentController->getFrame() );
-
-    Reference< XFrames > xDatabaseDocumentFrames;
-    if ( xDatabaseDocumentFramesSupp.is() )
-        xDatabaseDocumentFrames = xDatabaseDocumentFramesSupp->getFrames();
-
-    OSL_ENSURE( xDatabaseDocumentFrames.is(), 
"ODocumentDefinition::impl_appendFrameToDocumentFrames_throw: cannot append the 
component frame to the document's frame!" );
-    if ( xDatabaseDocumentFrames.is() )
-        xDatabaseDocumentFrames->append( _rxFrame );
-}
-
-// 
-----------------------------------------------------------------------------
 void ODocumentDefinition::impl_onActivateEmbeddedObject( bool 
_bOpenedInDesignMode )
 {
     try
@@ -716,9 +692,6 @@
 
             // remove the frame from the desktop's frame collection because we 
need full control of it.
             impl_removeFrameFromDesktop_throw( xFrame );
-
-            // ensure that the component's frame is a child of the database 
document's frame
-            impl_appendFrameToDocumentFrames_throw( xFrame );
         }
 
         // ensure that we ourself are kept alive as long as the embedded 
object's frame is
@@ -1284,10 +1257,34 @@
        m_pInterceptor->acquire();
        Reference<XDispatchProviderInterceptor> xInterceptor = m_pInterceptor;
 
-       _rEmbeddedObjectDescriptor.realloc(1);
+       _rEmbeddedObjectDescriptor.realloc(2);
        nLen = 0;
        _rEmbeddedObjectDescriptor[nLen].Name = 
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OutplaceDispatchInterceptor"));
        _rEmbeddedObjectDescriptor[nLen++].Value <<= xInterceptor;
+
+    uno::Sequence< uno::Any > aOutFrameProps(2);
+    PropertyValue aProp;
+    aProp.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TopWindow"));
+       aProp.Value <<= sal_True;
+    aOutFrameProps[0] <<= aProp;
+       
+    Reference< XModel > xDatabaseDocumentModel;
+    if ( m_pImpl->m_pDataSource )
+        xDatabaseDocumentModel = m_pImpl->m_pDataSource->getModel_noCreate();
+
+    Reference< XController > xDatabaseDocumentController;
+    if ( xDatabaseDocumentModel.is() )
+        xDatabaseDocumentController = 
xDatabaseDocumentModel->getCurrentController();
+
+    if ( xDatabaseDocumentController.is() )
+    {
+        aProp.Name = 
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ParentFrame"));
+        aProp.Value <<= xDatabaseDocumentController->getFrame();
+        aOutFrameProps[1] <<= aProp;
+    }
+
+    _rEmbeddedObjectDescriptor[nLen].Name = 
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OutplaceFrameProperties"));
+       _rEmbeddedObjectDescriptor[nLen++].Value <<= aOutFrameProps;
 }
 // 
-----------------------------------------------------------------------------
 void ODocumentDefinition::loadEmbeddedObject(const Sequence< sal_Int8 >& 
_aClassID,const Reference<XConnection>& _xConnection,sal_Bool _bReadOnly)

File [changed]: documentdefinition.hxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/documentdefinition.hxx?r1=1.21&r2=1.21.16.1
Delta lines:  +0 -4
-------------------
--- documentdefinition.hxx      2007-07-06 07:54:31+0000        1.21
+++ documentdefinition.hxx      2007-07-24 12:45:30+0000        1.21.16.1
@@ -208,10 +208,6 @@
     */
     void impl_initObjectEditView( const ::com::sun::star::uno::Reference< 
::com::sun::star::frame::XController >& _rxController );
 
-    /** appends the given frame to the frames collection of our database 
document's current controller
-    */
-    void impl_appendFrameToDocumentFrames_throw( const 
::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _rxFrame );
-
     /** removes the given frame from the desktop's frame collection
         @raises ::com::sun::star::uno::RuntimeException
     */

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.42.12.1&r2=1.42.12.2
Delta lines:  +14 -39
---------------------
--- AppController.cxx   2007-07-23 11:12:16+0000        1.42.12.1
+++ AppController.cxx   2007-07-24 12:45:31+0000        1.42.12.2
@@ -666,18 +666,8 @@
                                break;
                        case SID_APP_NEW_REPORT:
                                aReturn.bEnabled = !isDataSourceReadOnly() 
-                                    && 
SvtModuleOptions().IsModuleInstalled(SvtModuleOptions::E_SWRITER);
-                if ( aReturn.bEnabled )
-                {
-                    Reference< XContentEnumerationAccess > 
xEnumAccess(m_xServiceFactory, UNO_QUERY);
-                                       aReturn.bEnabled = xEnumAccess.is();
-                       if ( aReturn.bEnabled )
-                    {
-                        static ::rtl::OUString 
s_sReportDesign(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.report.pentaho.SOReportJobFactory"));
-                       Reference< XEnumeration > xEnumDrivers = 
xEnumAccess->createContentEnumeration(s_sReportDesign);
-                        aReturn.bEnabled = xEnumDrivers.is() && 
xEnumDrivers->hasMoreElements();
-                    }
-                }
+                                    && 
(SvtModuleOptions().IsModuleInstalled(SvtModuleOptions::E_SWRITER)
+                                    ||  
SvtModuleOptions().IsModuleInstalled(SvtModuleOptions::E_SCALC));
                                break;
                        case SID_DB_APP_VIEW_TABLES:
                                aReturn.bEnabled = sal_True;
@@ -1681,30 +1671,6 @@
        switch ( _eType )
        {
                case E_REPORT:
-//            {
-//                Reference< XContentEnumerationAccess > 
xEnumAccess(m_xServiceFactory, UNO_QUERY);
-//                static ::rtl::OUString 
s_sReportDesign(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.report.pentaho.SOReportJobFactory"));
-//                Reference< XEnumeration > xEnumDrivers = 
xEnumAccess->createContentEnumeration(s_sReportDesign);
-//                if ( !xEnumDrivers.is() || !xEnumDrivers->hasMoreElements() )
-//                             {
-//                    OExtensionNotPresentDialog aDlg(getView(), getORB());
-//                    aDlg.Execute();
-                                       // // is there no report designer 
available?
-                    // static const ::rtl::OUString sStatus = 
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("S1000"));
-                    // String sMsg = String( ModuleRes( 
RID_STR_ERROR_NO_REPORT_INSTALLED ) );
-                    // // sMsg.SearchAndReplace('#',e.Message);
-                    // SQLExceptionInfo aInfo;
-                    // 
-                    // SQLException aSQLException;
-                    // aSQLException.Message = sMsg;
-                    // // aSQLException.Context = e.Context;
-                    // aInfo = SQLExceptionInfo(aSQLException);
-                    // 
-                    // showError(aInfo);
-
-//                                     break;
-//                             }
-//            }// run through
                case E_FORM:
                        {
                                ::std::auto_ptr<OLinkedDocumentsAccess> aHelper 
= getDocumentsAccess(_eType);
@@ -1853,6 +1819,15 @@
                        break;
                case E_REPORT:
                        {
+                Reference< XContentEnumerationAccess > 
xEnumAccess(m_xServiceFactory, UNO_QUERY);
+                static ::rtl::OUString 
s_sReportDesign(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.report.pentaho.SOReportJobFactory"));
+                Reference< XEnumeration > xEnumDrivers = 
xEnumAccess->createContentEnumeration(s_sReportDesign);
+                if ( !xEnumDrivers.is() || !xEnumDrivers->hasMoreElements() )
+                               {
+                    OExtensionNotPresentDialog aDlg(getView(), getORB());
+                    aDlg.Execute();
+                                       break;
+                               }
                                ::std::auto_ptr<OLinkedDocumentsAccess> aHelper 
= getDocumentsAccess(_eType);
                                Reference< XComponent > xComponent,xDefinition;
                                xComponent = 
aHelper->newForm(ID_REPORT_NEW_TEXT,xDefinition);

File [changed]: AppDetailView.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/app/AppDetailView.cxx?r1=1.23&r2=1.23.16.1
Delta lines:  +19 -3
--------------------
--- AppDetailView.cxx   2007-07-06 07:59:01+0000        1.23
+++ AppDetailView.cxx   2007-07-24 12:45:31+0000        1.23.16.1
@@ -480,10 +480,21 @@
 {
        DBG_CHKTHIS(OTasksWindow,NULL);
     if ( _nId )
-           m_aHelpText.SetText(ModuleRes(_nId));
+    {
+        String sText = ModuleRes(_nId);
+
+        // calulate the size of the text field
+        // Size aHelpTextSize = m_aHelpText.GetSizePixel();
+        // Size aHelpTextPixelSize = LogicToPixel( aHelpTextSize, MAP_APPFONT 
);
+        // Rectangle aPrimaryRect( Point(0,0), aHelpTextSize );
+        // Rectangle aSuggestedRect( GetTextRect( aPrimaryRect, sText, 
TEXT_DRAW_MULTILINE | TEXT_DRAW_LEFT | TEXT_DRAW_WORDBREAK ) );
+           m_aHelpText.SetText(sText);
+    }
     else
+    {
         m_aHelpText.SetText(String());
 }
+}
 // 
-----------------------------------------------------------------------------
 IMPL_LINK(OTasksWindow, OnEntrySelectHdl, SvTreeListBox*, /*_pTreeBox*/)
 {
@@ -508,9 +519,14 @@
        long nHalfOutputWidth = static_cast<long>(nOutputWidth * 0.5);
        
        m_aCreation.SetPosSizePixel( Point(0, 0), Size(nHalfOutputWidth - 
n6PPT, nOutputHeight) );
-       m_aDescription.SetPosSizePixel( Point(nHalfOutputWidth + n6PPT, 0), 
Size(nOutputWidth - nHalfOutputWidth - aFLSize.Width(), nOutputHeight) );
+    // i77897 make the m_aHelpText a little bit smaller. (-5)
+       sal_Int32 nNewWidth = nOutputWidth - nHalfOutputWidth - aFLSize.Width() 
- 5;
+       // m_aHelpText.SetBackground( MAKE_SALCOLOR( 0xe0, 0xe0, 0xe0 ) );
+    // Wallpaper aLightGray(Color(0xe0, 0xe0, 0xe0));
+       // m_aHelpText.SetBackground( aLightGray );
+       m_aDescription.SetPosSizePixel( Point(nHalfOutputWidth + n6PPT, 0), 
Size(nNewWidth, nOutputHeight) );
        Size aDesc = m_aDescription.CalcMinimumSize();
-       m_aHelpText.SetPosSizePixel( Point(nHalfOutputWidth + n6PPT, 
aDesc.Height() ), Size(nOutputWidth - nHalfOutputWidth - aFLSize.Width(), 
nOutputHeight - aDesc.Height() - n6PPT) );
+       m_aHelpText.SetPosSizePixel( Point(nHalfOutputWidth + n6PPT, 
aDesc.Height() ), Size(nNewWidth, nOutputHeight - aDesc.Height() - n6PPT) );
        
        m_aFL.SetPosSizePixel( Point(nHalfOutputWidth , 0), 
Size(aFLSize.Width(), nOutputHeight ) );
 }

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

File [changed]: dbloader.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/browser/dbloader.cxx?r1=1.29&r2=1.29.16.1
Delta lines:  +3 -0
-------------------
--- dbloader.cxx        2007-07-06 08:03:30+0000        1.29
+++ dbloader.cxx        2007-07-24 12:45:31+0000        1.29.16.1
@@ -106,6 +106,7 @@
 #include "UITools.hxx"
 #endif
 
+
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::frame;
 using namespace ::com::sun::star::beans;
@@ -330,6 +331,7 @@
 
             OSL_ENSURE( bSuccess, "DBContentLoader::load: missing the required 
arguments - could not initialize the query design!" );
                }
+               // init controller
                if ( bSuccess )
                {
                        ::vos::OGuard aGuard(Application::GetSolarMutex());
@@ -368,6 +370,7 @@
 
        }
 
+       // assign controller and frame
        if (bSuccess && rListener.is())
        {
                if ( xController.is() && rFrame.is() )

File [changed]: genericcontroller.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/browser/genericcontroller.cxx?r1=1.78&r2=1.78.14.1
Delta lines:  +35 -2
--------------------
--- genericcontroller.cxx       2007-07-06 08:04:34+0000        1.78
+++ genericcontroller.cxx       2007-07-24 12:45:31+0000        1.78.14.1
@@ -1244,14 +1244,47 @@
 }
 
 
//------------------------------------------------------------------------------
-void OGenericUnoController::openHelpAgent(sal_Int32 _nHelpId)
+// prototype out of UITools.cxx
+namespace dbaui
 {
-       try
+    void AppendConfigToken_Impl( ::rtl::OUString& _rURL, sal_Bool 
_bQuestionMark );
+}
+// 
-----------------------------------------------------------------------------
+
+void OGenericUnoController::openHelpAgent(rtl::OUString const& 
_suHelpStringURL )
+{
+    rtl::OUString suURL(_suHelpStringURL);
+    rtl::OUString sLanguage = rtl::OUString::createFromAscii("Language=");
+    if (suURL.indexOf(sLanguage) == -1)
+    {
+        dbaui::AppendConfigToken_Impl(suURL, sal_False /* sal_False := add '&' 
*/ );
+    }
+    URL aURL;
+    aURL.Complete = suURL;
+    
+    if (m_xUrlTransformer.is())
+        m_xUrlTransformer->parseStrict(aURL);
+
+    openHelpAgent(aURL);
+}
+
+void OGenericUnoController::openHelpAgent(sal_Int32 _nHelpId)
        {
                URL aURL = createHelpAgentURL(lcl_getModuleHelpModuleName( 
getFrame() ),_nHelpId);
                if (m_xUrlTransformer.is())
                        m_xUrlTransformer->parseStrict(aURL);
 
+       openHelpAgent(aURL);
+}
+
+void OGenericUnoController::openHelpAgent(URL aURL)
+{
+       try
+       {
+               // URL aURL = createHelpAgentURL(lcl_getModuleHelpModuleName( 
getFrame() ),_nHelpId);
+               // if (m_xUrlTransformer.is())
+               //      m_xUrlTransformer->parseStrict(aURL);
+
                Reference< XDispatchProvider > xDispProv(m_xCurrentFrame, 
UNO_QUERY);
                Reference< XDispatch > xHelpDispatch;
                if (xDispProv.is())

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

File [changed]: ExtensionNotPresent.src
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/dlg/ExtensionNotPresent.src?r1=1.2&r2=1.2.16.1
Delta lines:  +7 -7
-------------------
--- ExtensionNotPresent.src     2007-07-06 08:11:45+0000        1.2
+++ ExtensionNotPresent.src     2007-07-24 12:45:31+0000        1.2.16.1
@@ -45,10 +45,10 @@
        Text [ en-US ] = "To open a report you require the extension 
%RPT_EXTENSION_NAME.\n\nClick 'Download...' to download and install the 
extension.";
 };
 // To open a report you require the extension Sun Report Designer weiss der 
Geier Hauptsache extra langer Name
-String RID_STR_EXTENSION_NAME
-{
-       Text = "Sun(TM) Report Builder";
-};
+// String RID_STR_EXTENSION_NAME
+// {
+//     Text = "Sun(TM) Report Builder";
+// };
 
 ModalDialog RID_EXTENSION_NOT_PRESENT_DLG
 {

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

File [changed]: UITools.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/misc/UITools.cxx?r1=1.72&r2=1.72.16.1
Delta lines:  +2 -2
-------------------
--- UITools.cxx 2007-07-06 08:34:20+0000        1.72
+++ UITools.cxx 2007-07-24 12:45:32+0000        1.72.16.1
@@ -1436,8 +1436,6 @@
        return sName;
 }
 // 
-----------------------------------------------------------------------------
-namespace
-{
        void AppendConfigToken_Impl( ::rtl::OUString& _rURL, sal_Bool 
_bQuestionMark )
        {
                // this completes a help url with the system parameters 
"Language" and "System"
@@ -1464,6 +1462,8 @@
                _rURL += SvtHelpOptions().GetSystem();
        }
 
+namespace
+{
        // 
-----------------------------------------------------------------------
 
        sal_Bool GetHelpAnchor_Impl( const ::rtl::OUString& _rURL, 
::rtl::OUString& _rAnchor )




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

Reply via email to