diff options
author | Oliver Bolte <obo@openoffice.org> | 2009-09-08 08:54:47 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2009-09-08 08:54:47 +0000 |
commit | b8aa674e67db69da52e55d8079242901ab51de1c (patch) | |
tree | 0c685640569bb494795944215229429a72d5a3ff /dbaccess/source/ui/tabledesign/TableController.cxx | |
parent | c6c11dbe997c96729ba523ef7e9bec78bbb0f2e1 (diff) |
CWS-TOOLING: integrate CWS dba32f
2009-08-31 10:43:51 +0200 msc r275590 : #no issuezilla available# make the testcase more error proof
2009-08-31 10:43:28 +0200 msc r275589 : #no issuezilla available# make the testcase more error proof
2009-08-31 10:40:33 +0200 msc r275588 : i85993 remove bugid
2009-08-31 10:38:28 +0200 msc r275587 : i100000
2009-08-27 13:27:32 +0200 fs r275476 : #i103882#
2009-08-27 12:47:54 +0200 fs r275474 : #i104544#
do not allow re-entrance for impl_ensureControl_nothrow
Actually, this is part of the fix only. I also removed the code which triggered this re-entrance (from
the grid control implementation), but to ensure it won't happen, again, I added some safety herein.
2009-08-27 12:47:16 +0200 fs r275473 : #i104544# SetState: Do not call Update at the window which we just set text for. It should (sic\!) not be needed, but causes trouble
2009-08-27 10:18:05 +0200 mav r275461 : #i103266# do not allow any stream operation on package streams while commiting the package
2009-08-20 15:25:48 +0200 fs r275184 : #i104362# fall back to a ViewObjectContactOfSdrObj in case we don't have a page view
2009-08-20 15:25:06 +0200 fs r275183 : AUGMENT_LIBRARY_PATH
2009-08-20 15:10:34 +0200 fs r275182 : AUGMENT_LIBRARY_PATH
2009-08-20 09:50:36 +0200 oj r275167 : #i104266# notify propertyforward when new dest was created
2009-08-19 08:01:28 +0200 mav r275133 : #i103266# fix the typo
2009-08-18 22:45:34 +0200 fs r275131 : #i10000#
2009-08-18 13:53:07 +0200 oj r275105 : #i104266# set column settings after alter columns
2009-08-18 13:41:49 +0200 fs r275103 : #i102550# do not interpret names of existing data sources as system path
2009-08-18 13:13:05 +0200 oj r275097 : #i103882# use correct number Format
2009-08-18 12:59:13 +0200 fs r275094 : #i104181#
2009-08-18 09:07:48 +0200 fs r275079 : updated readme to refer to proper 1.1.14
2009-08-18 08:32:31 +0200 oj r275077 : #i104187# wrong default for FirstCellAsLabel corrected
2009-08-18 08:10:00 +0200 oj r275076 : #i104187# dispose status controller to avoid access of dead statusBar in sfx
2009-08-17 21:56:19 +0200 fs r275074 : merge fix for issue #102564# from dba32e
2009-08-17 15:34:40 +0200 fs r275058 : don't set MaxFieldSize to 0 unconditionally
2009-08-17 14:33:57 +0200 oj r275054 : #i103528# patch for bitxtor
2009-08-17 14:12:26 +0200 oj r275051 : #i104160# fix VerticalAlignment
2009-08-17 14:11:47 +0200 oj r275050 : #i104160# fix VerticalAlignment
2009-08-14 15:54:04 +0200 mav r274989 : #i103266# avoid possibility for race condition
2009-08-13 13:52:43 +0200 fs r274939 : improved diagnostics
2009-08-13 13:52:28 +0200 fs r274938 : typo
2009-08-13 12:51:03 +0200 fs r274934 : #i103763# provided by cloph: correct libIDL check when compiling Mozilla
2009-08-13 12:43:23 +0200 fs r274933 : #i103763# provided by cloph: allow to cross-compile prebuilt zips on Mac
2009-08-13 12:41:15 +0200 fs r274932 : #i103371# fire PREPARECLOSEDOC even for embedded objects (why not?)
2009-08-13 12:24:49 +0200 fs r274930 : #i99890# remove 'Insert Control' from the popup menu
2009-08-13 12:23:38 +0200 fs r274929 : #i99890# DoToolboxAction: assert unknown/unimplemented actions
2009-08-13 09:32:07 +0200 fs r274923 : #i103721#
2009-08-13 09:26:32 +0200 fs r274922 : #i99894# provided by dtardon: xforms_nowFunction: use proper memory allocation function
2009-08-13 09:20:21 +0200 fs r274921 : #i103938# provided by cmc: pass proper arguments to OUString::intern
2009-08-12 22:34:28 +0200 fs r274916 : #i104139# when executing a PopupMenu, pass the POPUPMENU_NOMOUSEUPCLOSE flag
Diffstat (limited to 'dbaccess/source/ui/tabledesign/TableController.cxx')
-rw-r--r-- | dbaccess/source/ui/tabledesign/TableController.cxx | 71 |
1 files changed, 37 insertions, 34 deletions
diff --git a/dbaccess/source/ui/tabledesign/TableController.cxx b/dbaccess/source/ui/tabledesign/TableController.cxx index 87077ef9b766..c447c002a830 100644 --- a/dbaccess/source/ui/tabledesign/TableController.cxx +++ b/dbaccess/source/ui/tabledesign/TableController.cxx @@ -1179,7 +1179,8 @@ void OTableController::alterColumns() ::std::vector< ::boost::shared_ptr<OTableRow> >::iterator aIter = m_vRowList.begin(); ::std::vector< ::boost::shared_ptr<OTableRow> >::iterator aEnd = m_vRowList.end(); // first look for columns where something other than the name changed - for(sal_Int32 nPos = 0;aIter != aEnd;++aIter,++nPos) + sal_Int32 nPos = 0; + for(;aIter != aEnd;++aIter,++nPos) { OSL_ENSURE(*aIter,"OTableRow is null!"); OFieldDescription* pField = (*aIter)->GetActFieldDescr(); @@ -1198,10 +1199,9 @@ void OTableController::alterColumns() xColumns->getByName(pField->GetName()) >>= xColumn; OSL_ENSURE(xColumn.is(),"Column is null!"); - sal_Int32 nType=0,nPrecision=0,nScale=0,nNullable=0,nFormatKey=0,nAlignment=0; + sal_Int32 nType=0,nPrecision=0,nScale=0,nNullable=0; sal_Bool bAutoIncrement = false; - ::rtl::OUString sDescription, sTypeName; - Any aControlDefault; + ::rtl::OUString sTypeName; xColumn->getPropertyValue(PROPERTY_TYPE) >>= nType; xColumn->getPropertyValue(PROPERTY_PRECISION) >>= nPrecision; @@ -1220,19 +1220,10 @@ void OTableController::alterColumns() } // xColumn->getPropertyValue(PROPERTY_ISCURRENCY,::cppu::bool2any(pField->IsCurrency())); - if(xColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_HELPTEXT)) - xColumn->getPropertyValue(PROPERTY_HELPTEXT) >>= sDescription; - if(xColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_CONTROLDEFAULT)) - aControlDefault = xColumn->getPropertyValue(PROPERTY_CONTROLDEFAULT); - if(xColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_FORMATKEY)) - xColumn->getPropertyValue(PROPERTY_FORMATKEY) >>= nFormatKey; - if(xColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_ALIGN)) - xColumn->getPropertyValue(PROPERTY_ALIGN) >>= nAlignment; - // check if something changed if((nType != pField->GetType() || sTypeName != pField->GetTypeName() || - nPrecision != pField->GetPrecision() || + (nPrecision != pField->GetPrecision() && nPrecision ) || nScale != pField->GetScale() || nNullable != pField->GetIsNullable() || bAutoIncrement != pField->IsAutoIncrement())&& @@ -1285,26 +1276,7 @@ void OTableController::alterColumns() bReload = sal_True; } - if(nFormatKey != pField->GetFormatKey()) - { - if(xColumn.is() && xColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_FORMATKEY)) - xColumn->setPropertyValue(PROPERTY_FORMATKEY,makeAny(pField->GetFormatKey())); - } - if(nAlignment != dbaui::mapTextAllign(pField->GetHorJustify())) - { - if(xColumn.is() && xColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_ALIGN)) - xColumn->setPropertyValue(PROPERTY_ALIGN,makeAny(dbaui::mapTextAllign(pField->GetHorJustify()))); - } - if(sDescription != pField->GetDescription()) - { - if(xColumn.is() && xColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_HELPTEXT)) - xColumn->setPropertyValue(PROPERTY_HELPTEXT,makeAny(pField->GetDescription())); - } - if ( aControlDefault != pField->GetControlDefault()) - { - if(xColumn.is() && xColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_CONTROLDEFAULT)) - xColumn->setPropertyValue(PROPERTY_CONTROLDEFAULT,pField->GetControlDefault()); - } + } else if(xColumnFactory.is() && xAlter.is() && nPos < nColumnCount) { // we can't find the column so we could try it with the index before we drop and append a new column @@ -1350,6 +1322,37 @@ void OTableController::alterColumns() } else bReload = sal_True; + } // for(sal_Int32 nPos = 0;aIter != aEnd;++aIter,++nPos) + // alter column settings + aIter = m_vRowList.begin(); + + // first look for columns where something other than the name changed + for(nPos = 0;aIter != aEnd;++aIter,++nPos) + { + OSL_ENSURE(*aIter,"OTableRow is null!"); + OFieldDescription* pField = (*aIter)->GetActFieldDescr(); + if ( !pField ) + continue; + if ( (*aIter)->IsReadOnly() ) + { + aColumns[pField->GetName()] = sal_True; + continue; + } + + Reference<XPropertySet> xColumn; + if ( xColumns->hasByName(pField->GetName()) ) + { + xColumns->getByName(pField->GetName()) >>= xColumn; + Reference<XPropertySetInfo> xInfo = xColumn->getPropertySetInfo(); + if ( xInfo->hasPropertyByName(PROPERTY_HELPTEXT) ) + xColumn->setPropertyValue(PROPERTY_HELPTEXT,makeAny(pField->GetDescription())); + if(xInfo->hasPropertyByName(PROPERTY_CONTROLDEFAULT)) + xColumn->setPropertyValue(PROPERTY_CONTROLDEFAULT,pField->GetControlDefault()); + if(xInfo->hasPropertyByName(PROPERTY_FORMATKEY)) + xColumn->setPropertyValue(PROPERTY_FORMATKEY,makeAny(pField->GetFormatKey())); + if(xInfo->hasPropertyByName(PROPERTY_ALIGN)) + xColumn->setPropertyValue(PROPERTY_ALIGN,makeAny(dbaui::mapTextAllign(pField->GetHorJustify()))); + } // if ( xColumns->hasByName(pField->GetName()) ) } // second drop all columns which could be found by name Reference<XNameAccess> xKeyColumns = getKeyColumns(); |