User: hr      
Date: 2007-11-01 15:27:24+0000
Modified:
   dba/dbaccess/source/ui/querydesign/JoinController.cxx

Log:
 INTEGRATION: CWS dba24b (1.42.130); FILE MERGED
 2007/08/24 11:15:57 oj 1.42.130.2: #i80894# reset range to show all tables
 2007/08/16 06:14:43 oj 1.42.130.1: #i56898# clean up of the class structure

File Changes:

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

File [changed]: JoinController.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/querydesign/JoinController.cxx?r1=1.42&r2=1.43
Delta lines:  +32 -38
---------------------
--- JoinController.cxx  2006-09-17 07:20:17+0000        1.42
+++ JoinController.cxx  2007-11-01 15:27:20+0000        1.43
@@ -287,18 +287,8 @@
 
        m_pView                     = NULL;     
 
-       {
-               ::std::vector< OTableConnectionData*>::iterator aIter = 
m_vTableConnectionData.begin();
-               for(;aIter != m_vTableConnectionData.end();++aIter)
-                       delete *aIter;
                m_vTableConnectionData.clear();
-       }
-       {
-               ::std::vector< OTableWindowData*>::iterator aIter = 
m_vTableData.begin();
-               for(;aIter != m_vTableData.end();++aIter)
-                       delete *aIter;
                m_vTableData.clear();
-       }
 }
 // 
-----------------------------------------------------------------------------
 void OJoinController::reconnect( sal_Bool _bUI )
@@ -318,7 +308,7 @@
 void OJoinController::SaveTabWinPosSize(OTableWindow* pTabWin, long nOffsetX, 
long nOffsetY)
 {
        // die Daten zum Fenster
-       OTableWindowData* pData = pTabWin->GetData();
+       TTableWindowData::value_type pData = pTabWin->GetData();
        OSL_ENSURE(pData != NULL, "SaveTabWinPosSize : TabWin hat keine Daten 
!");
 
        // Position & Size der Daten neu setzen (aus den aktuellen 
Fenster-Parametern)
@@ -434,7 +424,7 @@
                SaveTabWinPosSize(aIter->second, nOffsetX, nOffsetY);
 }
 // 
-----------------------------------------------------------------------------
-void OJoinController::removeConnectionData(OTableConnectionData* _pData)
+void OJoinController::removeConnectionData(const 
TTableConnectionData::value_type& _pData)
 {
        m_vTableConnectionData.erase( 
::std::remove(m_vTableConnectionData.begin(),m_vTableConnectionData.end(),_pData),m_vTableConnectionData.end());
 }
@@ -470,9 +460,6 @@
 // 
-----------------------------------------------------------------------------
 void OJoinController::loadTableWindows(const Sequence<PropertyValue>& 
aViewProps)
 {
-       ::std::vector< OTableWindowData*>::iterator aIter = 
m_vTableData.begin();
-       for(;aIter != m_vTableData.end();++aIter)
-               delete *aIter;
        m_vTableData.clear();
 
        const PropertyValue *pIter = aViewProps.getConstArray();
@@ -481,6 +468,7 @@
        {
                if ( pIter->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( 
"Tables" ) ) )
                {
+            m_aMinimumTableViewSize = Point();
                        Sequence<PropertyValue> aWindow;
                        pIter->Value >>= aWindow;
                        const PropertyValue *pTablesIter = 
aWindow.getConstArray();
@@ -491,38 +479,31 @@
                                pTablesIter->Value >>= aTable;
                                loadTableWindow(aTable);
                        }
+            if ( m_aMinimumTableViewSize != Point() )
+            {
+                
getJoinView()->getScrollHelper()->resetRange(m_aMinimumTableViewSize);
+            }
+            break;
                }
        }
 }
 // 
-----------------------------------------------------------------------------
 void OJoinController::loadTableWindow(const Sequence<PropertyValue>& _rTable)
 {
-       OTableWindowData* pData = createTableWindowData();
-       
        sal_Int32 nX = -1, nY = -1, nHeight = -1, nWidth = -1;
 
+    ::rtl::OUString sComposedName,sTableName,sWindowName;
+    sal_Bool bShowAll = false;
        const PropertyValue *pIter = _rTable.getConstArray();
        const PropertyValue *pEnd = pIter + _rTable.getLength();
        for (; pIter != pEnd; ++pIter)
        {
                if ( pIter->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( 
"ComposedName" ) ) )
-               {
-                       ::rtl::OUString sName;
-                       pIter->Value >>= sName;
-                       pData->SetComposedName(sName);
-               }
+                       pIter->Value >>= sComposedName;
                else if ( pIter->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM 
( "TableName" ) ) )
-               {
-                       ::rtl::OUString sName;
-                       pIter->Value >>= sName;
-                       pData->SetTableName(sName);
-               }
+                       pIter->Value >>= sTableName;
                else if ( pIter->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM 
( "WindowName" ) ) )
-               {
-                       ::rtl::OUString sName;
-                       pIter->Value >>= sName;
-                       pData->SetWinName(sName);
-               }
+                       pIter->Value >>= sWindowName;
                else if ( pIter->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM 
( "WindowTop" ) ) )
                {
                        pIter->Value >>= nY;
@@ -541,14 +522,18 @@
                }
                else if ( pIter->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM 
( "ShowAll" ) ) )
                {
-                       sal_Bool bShowAll = false;
                        pIter->Value >>= bShowAll;
-                       pData->ShowAll(bShowAll);
                }
        }
+    TTableWindowData::value_type pData = 
createTableWindowData(sComposedName,sTableName,sWindowName);
        pData->SetPosition(Point(nX,nY));
        pData->SetSize( Size( nWidth, nHeight ) );
+    pData->ShowAll(bShowAll);
        m_vTableData.push_back(pData);
+    if ( m_aMinimumTableViewSize.X() < (nX+nWidth) )
+        m_aMinimumTableViewSize.X() = (nX+nWidth);
+    if ( m_aMinimumTableViewSize.Y() < (nY+nHeight) )
+        m_aMinimumTableViewSize.Y() = (nY+nHeight);
 }
 // 
-----------------------------------------------------------------------------
 void OJoinController::saveTableWindows(Sequence<PropertyValue>& _rViewProps)
@@ -574,8 +559,8 @@
 
                Sequence<PropertyValue> aWindow(8);
 
-               ::std::vector< OTableWindowData*>::iterator aIter = 
m_vTableData.begin();
-               ::std::vector< OTableWindowData*>::iterator aEnd = 
m_vTableData.end();
+               TTableWindowData::iterator aIter = m_vTableData.begin();
+               TTableWindowData::iterator aEnd = m_vTableData.end();
                for(sal_Int32 i = 1;aIter != aEnd;++aIter,++pIter,++i)
                {
                        pIter->Name = 
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Table")) + 
::rtl::OUString::valueOf(i);
@@ -603,7 +588,16 @@
                pViewIter->Value <<= aTables;
        }
 }
+// 
-----------------------------------------------------------------------------
+TTableWindowData::value_type OJoinController::createTableWindowData(const 
::rtl::OUString& _sComposedName,const ::rtl::OUString& _sTableName,const 
::rtl::OUString& _sWindowName)
+{
+    OJoinDesignView* pView = getJoinView();
+       if( pView )
+               return 
pView->getTableView()->createTableWindowData(_sComposedName,_sTableName,_sWindowName);
+    OSL_ENSURE(0,"We should never ever reach this point!");
 
+    return TTableWindowData::value_type();
+}
 // 
.............................................................................
 }   // namespace dbaui
 // 
.............................................................................




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

Reply via email to