Tag: cws_src680_dba30
User: fs      
Date: 06/03/21 10:43:36

Modified:
 /dba/dbaccess/source/ui/tabledesign/
  TableController.cxx

Log:
 RESYNC: (1.99-1.100); FILE MERGED

File Changes:

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

File [changed]: TableController.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/tabledesign/TableController.cxx?r1=1.99.16.3&r2=1.99.16.4
Delta lines:  +35 -3
--------------------
--- TableController.cxx 2 Jan 2006 09:17:19 -0000       1.99.16.3
+++ TableController.cxx 21 Mar 2006 18:43:33 -0000      1.99.16.4
@@ -1352,6 +1352,19 @@
                        catch(const SQLException&)
                        { // we couldn't alter the column so we have to add new 
columns
                                bReload = sal_True;
+                               if(xDrop.is() && xAppend.is())
+                               {
+                                       String 
aMessage(ModuleRes(STR_TABLEDESIGN_ALTER_ERROR));
+                                       
aMessage.SearchAndReplaceAscii("$column$",pField->GetName());
+                                       String 
sTitle(ModuleRes(STR_STAT_WARNING));
+                                       OSQLMessageBox 
aMsg(getView(),sTitle,aMessage,WB_YES_NO|WB_DEF_YES,OSQLMessageBox::Warning);
+                                       if ( aMsg.Execute() != RET_YES )
+                                       {
+                                               continue;
+                                       }
+                               }
+                               else
+                                       throw;
                        }
                }
                else
@@ -1506,8 +1519,27 @@
                        xProp->getPropertyValue(PROPERTY_TYPE) >>= nKeyType;
                        if(KeyType::PRIMARY == nKeyType)
                        {
+                               Reference<XNameAccess> xKeyColumns      = 
getKeyColumns();
+                               Sequence< ::rtl::OUString> aColumnNames = 
xKeyColumns->getElementNames();
+                               xKeyColumns = NULL;
                                Reference<XDrop> xDrop(xKeys,UNO_QUERY);
                                xDrop->dropByIndex(i); // delete the key
+                               ::std::vector<OTableRow*>::iterator aIter = 
m_vRowList.begin();
+                               ::std::vector<OTableRow*>::iterator aEnd = 
m_vRowList.end();
+                               for(;aIter != aEnd;++aIter)
+                               {
+                                       OSL_ENSURE(*aIter,"OTableRow is null!");
+                                       OFieldDescription* pField = 
(*aIter)->GetActFieldDescr();
+                                       if ( !pField )
+                                               continue;
+                                       ::rtl::OUString sName = 
pField->GetName();
+                                       const ::rtl::OUString* pIter = 
aColumnNames.getConstArray();
+                                       const ::rtl::OUString* pEnd = pIter + 
aColumnNames.getLength();
+                                       for(;pIter != pEnd && *pIter != 
sName;++pIter)
+                                               ;
+                                       if ( pIter != pEnd )
+                                               
pField->SetPrimaryKey(sal_False);
+                               }
                                break;
                        }
                }




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

Reply via email to