diff options
author | Kurt Zenker <kz@openoffice.org> | 2009-06-05 09:47:55 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2009-06-05 09:47:55 +0000 |
commit | bda7e683aeb1e4f64967a0cb2bd69c9152c44037 (patch) | |
tree | a1e2663822ceabfc04d2cce904ac82fa58c9126e /dbaccess | |
parent | d637b522f06e03ef544c7ee367a25a4956c8bb64 (diff) |
CWS-TOOLING: integrate CWS dba32b
2009-06-03 14:58:08 +0200 fs r272581 : #i102439#
2009-05-29 13:56:18 +0200 fs r272456 : remove the sub form when the 'add subform' setting changes from <true/> to <false/>, not only its controls
2009-05-29 13:19:27 +0200 fs r272454 : display '(Default)' instead of an empty string when a control has the default font
2009-05-28 20:49:18 +0200 fs r272428 : #i98162# getFirstSelectedValue: do not return reference to a temporary
2009-05-27 15:30:22 +0200 msc r272353 : #102303#
2009-05-26 13:03:06 +0200 fs r272295 : spelling
2009-05-26 12:59:54 +0200 fs r272294 : merge m48 version to get latest cygwin related fixes
2009-05-25 14:02:06 +0200 fs r272239 : remove references to local files, needed for debugging sessions only
2009-05-25 14:01:16 +0200 fs r272238 : #i102021# ensure members such as bNumberFormat are initialized before actually returning them
2009-05-25 13:10:20 +0200 fs r272236 : #i10000# reset ENABLE_EVOAB2
2009-05-22 06:44:45 +0200 oj r272167 : #i99104# add import handler for calc-sett
2009-05-22 06:42:27 +0200 oj r272166 : #i99104# impl NullDate as member
2009-05-22 06:36:22 +0200 oj r272165 : #i99104# handle nulldate from parent model
2009-05-22 06:33:13 +0200 oj r272164 : #i99104# export and import calculation-settings and nulldate
2009-05-22 06:27:50 +0200 oj r272163 : #i99104# export and import calculation-settings and nulldate
2009-05-20 13:29:58 +0200 oj r272118 : #i99911# handle invalid name
2009-05-20 13:28:49 +0200 oj r272117 : #i101261# handle different rowsets
2009-05-20 11:29:55 +0200 msc r272111 : #i100000#
2009-05-20 11:28:27 +0200 msc r272110 : merge in change from dba32a
2009-05-20 11:27:38 +0200 msc r272109 : #102082# CTRL + C does not work
2009-05-20 09:43:36 +0200 oj r272106 : clean up includes
2009-05-20 09:32:15 +0200 oj r272105 : #i99060# merge error resovled now VERTICAL_ALIGN is in both stmt
2009-05-20 08:37:21 +0200 msc r272104 : add workaround for issue #102010#
2009-05-20 08:10:12 +0200 oj r272103 : #i99104# use numberformatkey
2009-05-20 08:07:02 +0200 oj r272102 : #i99104# use column info from rowset
2009-05-20 08:04:43 +0200 oj r272101 : #i102032# use a special column type where prec and scale are the values currently set at the column
2009-05-20 08:03:04 +0200 oj r272100 : #i102032# correct type info, we have to use SQL defined type names
2009-05-19 10:27:02 +0200 oj r272061 : #i99104# export null-date
2009-05-19 08:26:53 +0200 oj r272056 : #i99104# export null-date
2009-05-18 13:15:10 +0200 msc r272014 : add issue #102019#
2009-05-18 11:33:07 +0200 msc r272005 : add issue #102019#
2009-05-18 08:59:45 +0200 msc r271996 : add workaroud for issue #102010#
2009-05-15 10:21:24 +0200 msc r271929 : #101944#
2009-05-11 21:18:30 +0200 fs r271792 : #i99914#
2009-05-08 13:52:06 +0200 oj r271715 : #i96423# remember column span
2009-05-08 11:26:19 +0200 oj r271708 : #i98605# impl new scale mode
2009-05-08 10:33:35 +0200 fs r271706 : SendUserCall: only call into the shape notification routine for UserCall types where this is necessary (performance issue)
2009-05-07 20:52:44 +0200 fs r271698 : outsource ShapeProperty from shapepropertynotifier.hxx
2009-05-07 20:43:33 +0200 fs r271697 : #i99056# use notifyShapePropertyChange, instead of getShapePropertyChangeNotifier - the latter throws if no shape exists, yet
2009-05-07 20:33:58 +0200 fs r271696 : #i99056# +notifyShapePropertyChange: allow notifying chages without checking whether there actually already exists an SvxShape
2009-05-07 16:22:15 +0200 fs r271679 : #i10000# cygwin needs quotes around the classpath
2009-05-07 16:21:37 +0200 fs r271678 : #i10000# cygwin needs quotes around the classpath
2009-05-07 16:01:11 +0200 oj r271677 : #i99914# notify parent handler
2009-05-07 15:54:54 +0200 fs r271676 : #i10000# cygwin needs some quoting
2009-05-07 14:49:48 +0200 oj r271672 : #i99277# quote alias name
2009-05-07 14:48:12 +0200 oj r271671 : #i92538# add ~ in front of type
2009-05-07 14:37:13 +0200 oj r271667 : #i99118# change type from char to varchar
2009-05-07 14:36:23 +0200 oj r271666 : #i99118# clear dest columns when changing to create new table
2009-05-07 13:35:32 +0200 oj r271657 : #i94467# handle type 0 as double as well
2009-05-07 13:20:49 +0200 oj r271655 : i99743# setNull when varchar is no text
2009-05-07 12:58:06 +0200 fs r271651 : initialize the SdrObject's property change notifier after the ctor, if necessary
2009-05-07 11:47:18 +0200 fs r271647 : #i10000#
2009-05-07 10:57:16 +0200 fs r271639 : OPropertyBrowserController::propertyChange: care for the current property state, too, and properly forward it to the UI
2009-05-07 10:18:14 +0200 fs r271636 : onNewComponent: do not ask the map for grid columns, it will throw
2009-05-07 10:09:55 +0200 fs r271634 : #i101623#
2009-05-07 09:53:44 +0200 fs r271631 : #i101622#
2009-05-06 21:55:53 +0200 fs r271615 : #i10000#
2009-05-06 21:10:42 +0200 fs r271611 : #i10000#
2009-05-06 13:11:48 +0200 fs r271583 : #i10000#
2009-05-05 22:29:31 +0200 fs r271559 : proper assertion message
2009-05-05 22:29:03 +0200 fs r271558 : diagnostics
2009-05-05 22:16:16 +0200 fs r271557 : #i10000#
2009-05-05 13:50:32 +0200 fs r271513 : #i10000#
2009-05-05 10:21:50 +0200 fs r271503 : #i10000#
2009-05-05 09:30:26 +0200 fs r271501 : why did those survive the rebase -C step?
2009-05-05 09:18:12 +0200 fs r271500 : #i10000#
2009-05-04 17:08:17 +0200 fs r271475 : CWS-TOOLING: rebase CWS dba32b to trunk@271427 (milestone: DEV300:m47)
2009-05-04 14:51:26 +0200 fs r271456 : line ends
2009-04-30 15:55:27 +0200 fs r271418 : NewURL -> PublicConnectionURL
2009-04-22 21:18:34 +0200 fs r271141 : #i100944#
2009-04-22 09:12:26 +0200 oj r271071 : #i101261# little code change
2009-04-22 09:11:43 +0200 oj r271070 : #i101261# only ask for parameters which aren't set before
2009-04-22 09:11:25 +0200 oj r271069 : #i101261# new grabage container for nodes
2009-04-22 09:11:02 +0200 oj r271068 : #i101261# new grabage container for nodes
2009-04-22 09:10:44 +0200 oj r271067 : #i101261# new grabage container for nodes
2009-04-22 09:10:21 +0200 oj r271066 : #i101261# only ask for parameters which aren't set before
2009-04-22 09:08:24 +0200 oj r271065 : #i101261# only ask for parameters which aren't set before
2009-04-22 09:07:25 +0200 oj r271064 : #i101261# only ask for parameters which aren't set before
2009-04-22 08:49:07 +0200 oj r271062 : #i77501# preview only when needed
2009-04-22 08:45:44 +0200 oj r271061 : #i101261# new prop max rows
2009-04-22 08:44:18 +0200 oj r271060 : #i101261# create dataprovider earlier to avoid the wrong legend in chart
2009-04-22 08:42:48 +0200 oj r271059 : #i101261# handle parameter
2009-04-17 21:00:23 +0200 fs r270954 : #i98350#
2009-04-17 13:54:19 +0200 fs r270942 : #i99565#
2009-04-17 13:51:34 +0200 fs r270940 : #i101153# only localize the (potentially) localizable properties when there really is support at the control model
2009-04-17 11:43:14 +0200 fs r270932 : removed superfluous include
2009-04-17 10:10:15 +0200 fs r270926 : #i10000#
2009-04-17 10:02:36 +0200 fs r270925 : #i10000#
2009-04-17 09:15:13 +0200 fs r270918 : #i99056# some more refactoring of the recently introduced property change notification mechanism for UNO shapes
2009-04-17 09:14:56 +0200 fs r270917 : #i99056# some more refactoring of the recently introduced property change notification mechanism for UNO shapes
2009-04-17 09:13:25 +0200 fs r270915 : #i99056# some more refactoring of the recently introduced property change notification mechanism for UNO shapes
2009-04-17 08:30:34 +0200 fs r270914 : removed unotools/servicehelper.hxx in favour of the (duplicated) comphelper/servicehelper.hxx
2009-04-16 21:05:25 +0200 fs r270903 : #i10000#
2009-04-16 20:43:43 +0200 fs r270902 : #i99056# shape notification outsourced to the SdrObject, this is what all other shape implementations (which only aggregate an SvxShape) have access to, too
2009-04-16 15:57:36 +0200 fs r270891 : #i99056# make SetUnoControlModel virtual
2009-04-16 15:44:02 +0200 fs r270890 : #i99056# let the ScShapeObj notify changes in its Anchor property
2009-04-16 15:36:47 +0200 fs r270889 : #i99056# enable the sheet anchor type property, too
2009-04-16 15:33:45 +0200 fs r270887 : #i99056# shape notification outsourced to the SdrObject, this is what all other shape implementations (which only aggregate an SvxShape) have access to, too
2009-04-15 14:53:13 +0200 fs r270844 : #i10000#
2009-04-15 13:08:29 +0200 fs r270836 : #i10000#
2009-04-15 12:28:14 +0200 fs r270832 : #i10000#
2009-04-15 10:59:14 +0200 fs r270827 : #i10000#
2009-04-15 09:41:08 +0200 oj r270823 : fix issues found with findbugs and pmd
2009-04-14 21:08:04 +0200 fs r270808 : #i99056# implement SheetAnchorType - now the only thing missing to enable it is the proper notification when it is modified
2009-04-14 17:09:00 +0200 fs r270799 : #i99056# implement XServiceInfo for the ScShapeObj
2009-04-14 17:07:55 +0200 fs r270798 : #i99056# implement TextAnchorType, partially implement SheetAnchorType
2009-04-14 15:54:05 +0200 fs r270786 : #i99056# SwXShape: notify changes of the AnchorType property
2009-04-14 15:47:32 +0200 fs r270785 : #i99056# deliver shapepropertynotifier.hxx
2009-04-14 15:46:54 +0200 fs r270784 : diagnostics
2009-04-14 15:08:28 +0200 fs r270781 : #i99056# outsourced the SvxShape's property change notification code into a dedicated class
2009-04-14 14:41:09 +0200 fs r270773 : #i99056# outsourced the SvxShape's property change notification code into a dedicated class
2009-04-14 14:37:23 +0200 fs r270772 : in dtor, remove the properties from the temporary component context
2009-04-14 14:36:34 +0200 fs r270771 : getWeakUnoShape made const
2009-04-14 12:23:08 +0200 oj r270757 : #i101064# add missing braces
2009-04-14 12:21:25 +0200 oj r270756 : #i101065# add braces for gcc 4.3.2
2009-04-14 12:17:45 +0200 oj r270755 : #i101059# add dep for manifest
2009-04-09 12:06:58 +0200 oj r270686 : #i93100# use OptimalSize from control to get height
2009-04-08 09:56:55 +0200 oj r270619 : #i92537# handle calculations in the select columns as well
2009-04-08 09:30:39 +0200 oj r270615 : #i96657# throw error message when the key doesn't have any columns
2009-04-07 12:08:26 +0200 oj r270592 : #i77501# impl preview of the executed report
2009-04-07 12:01:56 +0200 oj r270591 : #i77501# impl preview of the executed report
2009-04-07 11:41:03 +0200 oj r270590 : #i77501# impl preview of the executed report
2009-04-07 11:39:32 +0200 oj r270589 : #i77501# impl preview of the executed report
2009-04-07 11:29:25 +0200 oj r270588 : #i77501# convert dos to unix lineends
2009-04-07 11:28:23 +0200 oj r270587 : #i77501# impl preview of the executed report
2009-04-07 11:16:50 +0200 oj r270586 : #i77501# impl preview of the executed report
2009-04-07 11:16:00 +0200 oj r270585 : #i77501# impl preview of the executed report
2009-04-07 11:15:44 +0200 oj r270584 : #i77501# impl preview of the executed report
2009-04-07 11:15:28 +0200 oj r270583 : #i77501# impl preview of the executed report
2009-04-07 11:15:04 +0200 oj r270582 : #i77501# impl preview of the executed report
2009-04-06 15:38:54 +0200 fs r270559 : merge changes from CWS dba32a herein
2009-04-03 15:56:16 +0200 fs r270494 : ImpSvMEdit::Resize: do multiple iterations, if necessary
2009-04-03 14:35:49 +0200 fs r270487 : #i10000#
2009-04-03 13:17:16 +0200 fs r270476 : #i99056# display geometry information for controls, too
2009-04-03 13:16:37 +0200 fs r270475 : #i99056# better ordering of the geometry properties
2009-04-03 13:16:07 +0200 fs r270473 : #i99056# now that SvxShape supports property change listeners, forward add/remove requests to it
2009-04-03 13:13:18 +0200 fs r270472 : #i99056# at SvxShape, allow for PropertyChangeListeners for Size/Position
2009-04-03 09:29:27 +0200 oj r270456 : #i94571# use correct prop name
2009-04-03 09:14:54 +0200 fs r270451 : merge changes from CWS dba32a herein
2009-04-02 17:00:51 +0200 fs r270424 : better diagnostics
2009-04-02 16:35:19 +0200 fs r270421 : diagnostics
2009-04-02 16:34:50 +0200 fs r270420 : #i99056# mxUnoShape not accessible anymore, use impl_setUnoShape instead
2009-04-02 16:32:48 +0200 fs r270419 : #i99056# make getUnoShape cheaper: keep the pointer to the SvxShape all the time, so there's no need to ask for it in getUnoShape. As a consequence, we will later be able to use the pointer in scenarious where performance (potentially) matters
2009-04-02 16:31:13 +0200 fs r270417 : merge changes from CWS dba32a herein
2009-04-02 16:23:16 +0200 fs r270414 : merge changes from CWS dba32a herein
2009-04-02 14:10:35 +0200 fs r270405 : #i10000#
2009-04-02 14:06:26 +0200 fs r270404 : merge changes from CWS dba32a herein
2009-04-02 14:03:03 +0200 fs r270401 : #i10000#
2009-04-02 13:58:13 +0200 fs r270400 : #i10000#
2009-04-02 12:59:44 +0200 fs r270397 : merge changes from CWS dba32a herein
2009-04-02 12:46:30 +0200 fs r270396 : #i99056# let the form page maintain a mapping between control models and control shapes
2009-04-02 12:44:07 +0200 fs r270395 : merge changes from CWS dba32a herein
2009-04-02 12:42:06 +0200 fs r270394 : merge changes from CWS dba32a herein
2009-04-02 12:35:20 +0200 fs r270393 : #i10000# precompiled header
2009-04-02 12:05:31 +0200 fs r270392 : merge changes from CWS dba32a herein
2009-04-02 12:00:42 +0200 fs r270391 : merge changes from CWS dba32a herein
2009-04-02 11:47:26 +0200 fs r270390 : merge changes from CWS dba32a herein
2009-04-02 11:39:15 +0200 oj r270389 : #i94467# foxpro impl several new types
2009-04-02 11:35:58 +0200 fs r270387 : merge changes from CWS dba32a herein
2009-04-01 14:10:51 +0200 fs r270329 : merge changes from CWS dba32a herein
2009-03-31 17:29:50 +0200 fs r270290 : merge changes from CWS dba32a herein
2009-03-30 14:53:56 +0200 fs r270233 : #i100417# don't set grid column widths to 0, but to <void/>
2009-03-30 12:31:03 +0200 oj r270213 : #i100552# wrong orb used
2009-03-30 12:19:20 +0200 oj r270212 : #i98303# convertlike corrected to sal_Unicode
2009-03-30 11:58:25 +0200 fs r270210 : merge changes from CWS dba32a herein
2009-03-30 11:38:16 +0200 oj r270205 : remove duplicate code from merge
2009-03-30 11:02:27 +0200 fs r270202 : merge changes from CWS dba32a herein
2009-03-30 11:02:19 +0200 fs r270201 : merge changes from CWS dba32a herein
2009-03-30 10:31:26 +0200 oj r270200 : #i100665# only throw exception and do not drop table
2009-03-30 09:36:24 +0200 fs r270195 : assertion text
2009-03-28 20:21:58 +0100 fs r270187 : #ii10000#
2009-03-28 20:19:54 +0100 fs r270186 : removed unused help ids
2009-03-28 20:19:40 +0100 fs r270185 : removed unused help ids
2009-03-28 20:19:10 +0100 fs r270184 : #i100237# +DefaultState/XReset
2009-03-28 00:29:29 +0100 fs r270177 : CWS-TOOLING: rebase CWS dba32b to trunk@270033 (milestone: DEV300:m45)
2009-03-27 22:56:46 +0100 fs r270173 : #i100237# DEFAULT_CHECKED -> DEFAULT_STATE
2009-03-27 22:55:52 +0100 fs r270172 : #i100237# DefaultState property for buttons, enabled only when Toggle=Yes
2009-03-27 22:54:15 +0100 fs r270171 : #i100237# DEFAULT_CHECKED -> DEFAULT_STATE
2009-03-27 22:53:54 +0100 fs r270170 : #i100237# introduce a DefaultState property for buttons, which implies buttongs supporting XReset, which needed some refactoring
2009-03-27 13:31:41 +0100 fs r270152 : ignore output paths
2009-03-27 11:23:44 +0100 fs r270139 : tuned behavior with respect to invalid keys/values
2009-03-27 09:57:14 +0100 fs r270136 : don't allow Double.NaN
2009-03-27 09:56:16 +0100 fs r270135 : talk about Double.NaN
2009-03-26 12:14:30 +0100 fs r270067 : removed unused parameter
2009-03-26 12:14:02 +0100 fs r270066 : removed widening conversion when checking keys
2009-03-26 09:17:34 +0100 fs r270053 : separated the enumerator functionality into a dedicated interface, this way not burdening XMap with it
2009-03-26 09:17:11 +0100 fs r270052 : separated the enumerator functionality into a dedicated interface, this way not burdening XMap with it
2009-03-26 09:16:49 +0100 fs r270051 : separated the enumerator functionality into a dedicated interface, this way not burdening XMap with it
2009-03-25 21:55:20 +0100 fs r270044 : #i100541# properly calculat bNeedScrollBox
2009-03-25 12:56:17 +0100 fs r270019 : renamed the previously introduced error condition
2009-03-25 12:11:48 +0100 fs r270015 : #i100095# when the error messages contain non-trivial details (SQLState/ErrorCode), then always display the 'Details' button
2009-03-25 12:10:05 +0100 fs r270012 : renamed the previously introduced error condition
2009-03-25 12:01:04 +0100 fs r270011 : #i100095# when no address book (or respective profile) can be found, then use a dedicated ErrorCondition
2009-03-25 10:29:07 +0100 fs r270003 : add missing localization
2009-03-25 10:23:12 +0100 fs r270001 : in preparation of #i1000095#:
rework the error handling, allow using css.sdb.ErrorCondition values, plus
allow propagating the nsresult
2009-03-25 10:21:55 +0100 fs r270000 : in preparation of #i1000095#:
rework the error handling, allow using css.sdb.ErrorCondition values, plus
allow propagating the nsresult
2009-03-20 23:05:38 +0100 fs r269829 : XMap::getSize removed
2009-03-20 23:05:19 +0100 fs r269828 : changes as suggested by sb
2009-03-20 23:04:56 +0100 fs r269827 : enhanced documentation
2009-03-20 15:31:40 +0100 fs r269815 : changes as suggested by sb
2009-03-20 13:23:52 +0100 oj r269804 : #i92538# correct the zorder that fixedtext is infront of control
2009-03-20 12:59:38 +0100 oj r269801 : #i94571# paraadjust now supports BLOCK
2009-03-20 12:58:11 +0100 oj r269800 : #i94571# export style with data style
2009-03-20 12:57:05 +0100 oj r269799 : #i94571# text align is now paraadjust
2009-03-20 12:37:02 +0100 fs r269797 : enum keys only accepted if they have the exact type, not if they have *any* enum type
2009-03-20 12:28:31 +0100 fs r269794 : some changes requested by sb
2009-03-20 08:52:47 +0100 fs r269780 : doc
2009-03-20 07:37:31 +0100 oj r269779 : #i99913# only notifiy when values are different
2009-03-20 07:36:58 +0100 oj r269778 : #i99913# add undoenv as listener at the dataprovider
2009-03-19 22:52:52 +0100 fs r269771 : added comment
2009-03-19 22:40:06 +0100 fs r269770 : +testEnumeration
2009-03-19 22:39:41 +0100 fs r269769 : implemented enumeration, getKeySet, and getValues. Should be finished now.
2009-03-19 14:01:01 +0100 oj r269743 : #i99913# reset the modified state when selecting an object
2009-03-19 12:19:54 +0100 lla r269739 : #i72390# cleanups
2009-03-19 09:25:27 +0100 fs r269727 : #i10000#
2009-03-18 23:37:02 +0100 fs r269708 : extended checks for value type acceptance
2009-03-18 23:36:41 +0100 fs r269707 : fixed value type checks
2009-03-18 14:59:56 +0100 fs r269678 : initial complex test case for the new css.container.Map implementation
2009-03-18 14:59:24 +0100 fs r269677 : verifyExpectedException moved to base class (in complexlib), and renamed to assureException for consistency
2009-03-18 14:58:35 +0100 fs r269676 : removed unused imports
2009-03-18 14:58:03 +0100 fs r269675 : first implementation of the new css.container.Map service (not completed, yet)
2009-03-18 14:57:17 +0100 fs r269674 : base class for UNO components, freeing you from some repeating work
2009-03-18 14:55:53 +0100 fs r269672 : +assureException: call a given method with given parameters on a given object, ensure that a given exception is thrown by the method implementation
2009-03-18 14:54:58 +0100 fs r269671 : +getComponentContext
2009-03-18 14:54:00 +0100 fs r269670 : isEmpty returns a boolean, not a long
2009-03-18 14:14:43 +0100 oj r269663 : #i99743# now text also supports null
2009-03-18 13:54:14 +0100 oj r269660 : #i99223# remove check for 2 params
2009-03-18 13:33:35 +0100 oj r269659 : #i99060# replace text::ParagraphVertAlign with style::VerticalAlignment
2009-03-18 13:32:18 +0100 oj r269658 : #i99060# don't set void property when void isn't allowed
2009-03-18 13:31:11 +0100 oj r269657 : #i99060# handle vertical alignment
2009-03-18 13:28:28 +0100 oj r269656 : #i99060# remove unused elements from sytle
2009-03-18 09:35:42 +0100 lla r269639 : #i72390# cleanups
2009-03-18 09:31:20 +0100 lla r269638 : #i72390# add ButtonList
2009-03-18 09:30:46 +0100 lla r269637 : #i72390# renamed interface
2009-03-18 09:30:15 +0100 lla r269636 : #i72390# use ButtonList instead of ImageList
2009-03-18 09:29:05 +0100 lla r269635 : #i72390# new ButtonList, cleanups
2009-03-18 09:26:34 +0100 lla r269634 : #i72390# cleanups
2009-03-17 12:21:20 +0100 oj r269590 : #i99222# remove assertion
2009-03-17 12:17:22 +0100 oj r269589 : #i98605# impl scale mode
2009-03-17 12:10:42 +0100 oj r269588 : #i98605# impl scale mode
2009-03-17 11:40:15 +0100 oj r269584 : #i96944# doesn't create equation for shapes
2009-03-17 11:33:16 +0100 oj r269583 : #i96423# switch calc from float to long
2009-03-16 15:19:18 +0100 fs r269550 : #i41930# enable zoom for embedded/outplace documents
2009-03-16 14:25:54 +0100 oj r269542 : #i93734# remove ContextSensitive
2009-03-16 14:21:58 +0100 oj r269541 : #i99274# page header before group header
2009-03-16 14:18:23 +0100 oj r269539 : #i99110# fix value type
2009-03-16 14:14:16 +0100 fs r269537 : line ends
2009-03-16 14:11:06 +0100 fs r269535 : line ends
2009-03-16 14:08:34 +0100 fs r269534 : #i100087# (provided my np): allow for polymorphic types with more than one parameter
2009-03-16 12:30:31 +0100 oj r269521 : compile error
2009-03-16 12:19:12 +0100 oj r269519 : compile error
2009-03-16 10:39:28 +0100 oj r269511 : compile error under linux with swap
2009-03-13 10:33:04 +0100 oj r269462 : CWS-TOOLING: rebase CWS dba32b to trunk@269297 (milestone: DEV300:m43)
2009-03-12 14:37:25 +0100 fs r269416 : interface SequenceOutputStreamTest is unneeded, and pollutes the namespace here :)
2009-03-12 14:35:07 +0100 fs r269414 : not needed
2009-03-12 14:34:15 +0100 fs r269413 : preparation for multiple tests in this module
2009-03-12 14:33:02 +0100 fs r269412 : ShowTargets was moved from module integration.forms to module complexlib
2009-03-12 14:32:48 +0100 fs r269411 : helper class for projects containing multiple complex test cases (and following a certain structure)
2009-03-12 14:00:14 +0100 fs r269407 : proper module after the move
2009-03-12 13:59:10 +0100 fs r269406 : superseded by ../makefile.mk
2009-03-12 13:47:38 +0100 fs r269403 : not needed anymore
2009-03-12 13:45:46 +0100 fs r269402 : moved, in preparation of adding more test cases here, with a common infrastructure
2009-03-12 13:45:07 +0100 fs r269401 : moved from ../
2009-03-12 13:43:59 +0100 fs r269400 : moved to ./comphelper, in preparation of adding more test cases here, with a common infrastructure
2009-03-12 13:29:47 +0100 oj r269396 : #i99914# set parent on dataprovider
2009-03-12 13:10:35 +0100 oj r269393 : #i99832# check thrown exception and show error
2009-03-12 13:08:10 +0100 fs r269392 : reorganizing tests
2009-03-12 12:52:55 +0100 oj r269390 : #i99118# convert formatkey in numberformat
2009-03-12 12:34:53 +0100 fs r269388 : new API tests
2009-03-12 12:29:05 +0100 fs r269386 : Map not yet committed
2009-03-12 12:28:36 +0100 fs r269385 : oops, forgot the SequenceInputStream during the previous refactoring
2009-03-12 12:12:39 +0100 oj r269384 : #i99104# set HasCategories prop
2009-03-12 12:12:08 +0100 oj r269383 : #i99104# check HasCategories even for internal dataprovider
2009-03-12 12:10:40 +0100 oj r269382 : #i99104# set HasCategories prop
2009-03-12 10:51:49 +0100 fs r269373 : #i10000# exception specifications
2009-03-12 10:49:18 +0100 fs r269372 : #i10000# exception specifications
2009-03-12 10:44:02 +0100 fs r269371 : #i10000# exception specifications
2009-03-12 10:30:55 +0100 fs r269368 : refactored the UNO service registration in this module, using the helper classes provided by comphelper itself, so you have less effort when extending the list of to-be-registered components
2009-03-12 10:30:37 +0100 fs r269367 : module-local includes
2009-03-12 07:05:54 +0100 oj r269357 : #i99104# database dataprovider doesn't need dataranges and diagramdata
2009-03-11 10:58:28 +0100 oj r269306 : #i99911# check if name of the report is a valid file name
2009-03-11 10:03:23 +0100 oj r269299 : #i99666# the report is new when the HierarchicalDocumentName is empty
2009-03-10 11:32:45 +0100 oj r269258 : #i99221# use fallback for language
2009-03-10 10:48:40 +0100 oj r269255 : #i99433# now use OStringBuffer
2009-03-10 10:36:21 +0100 fs r269252 : initial version of (X)Map
2009-03-10 09:52:23 +0100 oj r269246 : #i99433# now use OStringBuffer
2009-03-10 08:56:13 +0100 oj r269240 : #i99655# patch applied
2009-03-09 07:35:33 +0100 lla r269058 : #i10000# wrong variable assignment fixed
2009-03-06 17:20:40 +0100 fs r269030 : some explicit defaults
2009-03-06 17:20:30 +0100 fs r269029 : #i98600#
2009-03-06 14:40:34 +0100 fs r269009 : #i87692# during reload, prevent the document being modified just because of some control content changes ...
2009-03-06 12:52:20 +0100 lla r268997 : #i10000# ambigous problem with FontWeight fixed
2009-03-06 11:39:32 +0100 fs r268989 : #i10000# (approved by pl): use --without-t1-library configure option
2009-03-06 10:55:43 +0100 fs r268986 : #i99953# depends on xmlscript module now
2009-03-06 10:54:04 +0100 fs r268985 : #i99953# also adjust the event names found in dialogs embedded in the forms
2009-03-06 09:53:41 +0100 fs r268977 : #i10000#
2009-03-06 09:30:41 +0100 lla r268973 : #i10000# merge problems
2009-03-05 17:52:34 +0100 fs r268932 : #i98593# for sub components which are actually controlled by a DocumentDefinition (aka XComponentSupplier aka XCommandProcessor), close them by executing the 'close' command, not by suspending/closing the controller (which cannot be intercepted)
2009-03-05 11:41:56 +0100 fs r268889 : default the drop down line count for list/combo boxes to 20
2009-03-05 11:39:10 +0100 fs r268887 : do not display empty error messages
2009-03-02 10:13:57 +0100 lla r268639 : #i91541# CWS rebase m41 to m42
2009-03-02 09:06:27 +0100 lla r268635 : #i10000# add ';' to strings
2009-02-26 11:18:00 +0100 fs r268492 : reportdesign depends on REPORTBUILDER, not REPORTDESIGN
2009-02-26 10:11:38 +0100 lla r268489 : CWS-TOOLING: rebase CWS dba32b to trunk@268395 (milestone: DEV300:m42)
2009-02-26 09:04:11 +0100 lla r268488 : CWS-TOOLING: rebase CWS dba32b to trunk@268395 (milestone: DEV300:m42)
2009-02-24 12:09:13 +0100 lla r268392 : #i91541# #i91542# cleanups
2009-02-24 08:08:06 +0100 lla r268382 : merge all dba32a changes into dba32b
2009-02-24 07:14:55 +0100 lla r268381 : merge all dba32a changes into dba32b
2009-02-23 21:44:28 +0100 fs r268377 : oops ... don't tamper with m_aListSourceValues at the end of loadData
2009-02-23 20:57:05 +0100 fs r268376 : #i98162# don't hold the values as strings, but as ORowSetValue, this way preserving their type, and being agnostic to different result/rowset implementations doing different to-string-conversations
2009-02-23 20:55:44 +0100 fs r268375 : getObject: throwFunctionNotSupportedException, instead of silently returning NULL
2009-02-23 20:55:20 +0100 fs r268374 : #i98162# some more supported types
2009-02-23 20:54:43 +0100 fs r268373 : #i98162# +operator !=
2009-02-20 09:35:39 +0100 fs r268306 : #i99422# for a font, display the font name, the style, and the size
2009-02-20 09:33:45 +0100 fs r268305 : #i99422# in the property browser, FONT supersedes CHARFONTNAME: the aggregated FormComponentHandler displays them more nicely now
2009-02-19 16:12:06 +0100 fs r268293 : #i99372# recognize DataType::FLOAT as numeric
2009-02-19 15:43:12 +0100 fs r268291 : #i99415#
2009-02-19 15:40:15 +0100 fs r268290 : #i99242# lcl_firstFocussableControl: take disabled controls into account
2009-02-19 15:34:36 +0100 fs r268289 : #i99396# properly decode the base name of the URL when using it as title
2009-02-19 15:19:05 +0100 fs r268287 : #i98247#
Diffstat (limited to 'dbaccess')
36 files changed, 752 insertions, 786 deletions
diff --git a/dbaccess/prj/build.lst b/dbaccess/prj/build.lst index f89f7fef47e9..973e95620b3f 100644 --- a/dbaccess/prj/build.lst +++ b/dbaccess/prj/build.lst @@ -1,4 +1,4 @@ -ba dbaccess : BOOST:boost connectivity svx stoc uui QADEVOOO:qadevOOo NULL +ba dbaccess : BOOST:boost connectivity svx stoc uui QADEVOOO:qadevOOo xmlscript NULL ba dbaccess usr1 - all ba_mkout NULL ba dbaccess\inc nmake - all ba_inc NULL ba dbaccess\source\ui\inc nmake - all ba_uiinc ba_inc NULL diff --git a/dbaccess/qa/complex/dbaccess/DatabaseDocument.java b/dbaccess/qa/complex/dbaccess/DatabaseDocument.java index 145ef40515ae..09f7871dbbbb 100644 --- a/dbaccess/qa/complex/dbaccess/DatabaseDocument.java +++ b/dbaccess/qa/complex/dbaccess/DatabaseDocument.java @@ -338,7 +338,7 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document. for ( int i=0; i<unsupportedMethods.length; ++i) { - verifyExpectedException( _document, unsupportedMethods[i].unoInterfaceClass, + assureException( _document, unsupportedMethods[i].unoInterfaceClass, unsupportedMethods[i].methodName, new Object[]{}, _isInitialized ? null : NotInitializedException.class ); } } @@ -428,9 +428,9 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document. impl_checkDocumentInitState( databaseDoc, true ); // and while we are here ... initilizing the same document again should not be possible - verifyExpectedException( databaseDoc, XLoadable.class, "initNew", new Object[0], + assureException( databaseDoc, XLoadable.class, "initNew", new Object[0], DoubleInitializationException.class ); - verifyExpectedException( databaseDoc, XLoadable.class, "load", new Object[] { new PropertyValue[0] }, + assureException( databaseDoc, XLoadable.class, "load", new Object[] { new PropertyValue[0] }, DoubleInitializationException.class ); // .................................................................... @@ -443,9 +443,9 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document. impl_checkDocumentInitState( databaseDoc, true ); // same as above - initializing the document a second time must fail - verifyExpectedException( databaseDoc, XLoadable.class, "initNew", new Object[0], + assureException( databaseDoc, XLoadable.class, "initNew", new Object[0], DoubleInitializationException.class ); - verifyExpectedException( databaseDoc, XLoadable.class, "load", new Object[] { new PropertyValue[0] }, + assureException( databaseDoc, XLoadable.class, "load", new Object[] { new PropertyValue[0] }, DoubleInitializationException.class ); } diff --git a/dbaccess/qa/complex/dbaccess/TestCase.java b/dbaccess/qa/complex/dbaccess/TestCase.java index 7fdc2c3d886b..fddf055b011e 100644 --- a/dbaccess/qa/complex/dbaccess/TestCase.java +++ b/dbaccess/qa/complex/dbaccess/TestCase.java @@ -36,8 +36,8 @@ import com.sun.star.uno.XComponentContext; import helper.FileTools; import java.io.File; import java.io.IOException; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; +import java.net.URI; +import java.net.URISyntaxException; import java.net.URI; import java.net.URISyntaxException; @@ -108,42 +108,10 @@ public abstract class TestCase extends complexlib.ComplexTestCase } // -------------------------------------------------------------------------------------------------------- - protected void verifyExpectedException( Object _object, Class _unoInterfaceClass, String _methodName, Object[] _methodArgs, + protected void assureException( Object _object, Class _unoInterfaceClass, String _methodName, Object[] _methodArgs, Class _expectedExceptionClass ) { - verifyExpectedException( UnoRuntime.queryInterface( _unoInterfaceClass, _object ), _methodName, + assureException( UnoRuntime.queryInterface( _unoInterfaceClass, _object ), _methodName, _methodArgs, _expectedExceptionClass ); } - - // -------------------------------------------------------------------------------------------------------- - protected void verifyExpectedException( Object _object, String _methodName, Object[] _methodArgs, - Class _expectedExceptionClass ) - { - Class objectClass = _object.getClass(); - Class[] methodArgsClasses = new Class[ _methodArgs.length ]; - for ( int i=0; i<_methodArgs.length; ++i ) - methodArgsClasses[i] = _methodArgs[i].getClass(); - - boolean noExceptionAllowed = _expectedExceptionClass == null; - - boolean caughtExpected = noExceptionAllowed ? true : false; - try - { - Method method = objectClass.getMethod( _methodName, methodArgsClasses ); - method.invoke(_object, _methodArgs ); - } - catch ( InvocationTargetException e ) - { - caughtExpected = noExceptionAllowed - ? false - : ( e.getTargetException().getClass().equals( _expectedExceptionClass ) ); - } - catch( Exception e ) - { - caughtExpected = false; - } - assure( "did not catch the expected exception (" + - ( noExceptionAllowed ? "none" : _expectedExceptionClass.getName() ) + - ") while calling " + _object.getClass().getName() + "." + _methodName, caughtExpected ); - } } diff --git a/dbaccess/qa/complex/dbaccess/makefile.mk b/dbaccess/qa/complex/dbaccess/makefile.mk index fa820f3dbeb3..0d86e53337d9 100755 --- a/dbaccess/qa/complex/dbaccess/makefile.mk +++ b/dbaccess/qa/complex/dbaccess/makefile.mk @@ -59,7 +59,7 @@ JARCLASSDIRS = $(PACKAGE) JARTARGET = $(TARGET).jar JARCOMPRESS = TRUE -RUNNER_ARGS = -cp $(CLASSPATH)$(PATH_SEPERATOR)$(SOLARBINDIR)$/OOoRunner.jar org.openoffice.Runner -TestBase java_complex +RUNNER_ARGS = -cp "$(CLASSPATH)$(PATH_SEPERATOR)$(SOLARBINDIR)$/OOoRunner.jar" org.openoffice.Runner -TestBase java_complex # --- Targets ------------------------------------------------------ diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx index 290c88031349..302bae23c984 100644 --- a/dbaccess/source/core/api/RowSet.cxx +++ b/dbaccess/source/core/api/RowSet.cxx @@ -275,7 +275,6 @@ ORowSet::ORowSet( const Reference< ::com::sun::star::lang::XMultiServiceFactory ,m_bCanUpdateInsertedRows(sal_True) ,m_bOwnConnection(sal_False) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::ORowSet" ); m_nResultSetType = ResultSetType::SCROLL_SENSITIVE; m_nResultSetConcurrency = ResultSetConcurrency::UPDATABLE; m_pMySelf = this; @@ -341,7 +340,6 @@ ORowSet::~ORowSet() // ----------------------------------------------------------------------------- void ORowSet::getPropertyDefaultByHandle( sal_Int32 _nHandle, Any& _rDefault ) const { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::getPropertyDefaultByHandle" ); switch( _nHandle ) { case PROPERTY_ID_COMMAND_TYPE: @@ -377,6 +375,18 @@ void ORowSet::getPropertyDefaultByHandle( sal_Int32 _nHandle, Any& _rDefault ) c case PROPERTY_ID_ESCAPE_PROCESSING: _rDefault <<= sal_True; break; + case PROPERTY_ID_MAXROWS: + _rDefault <<= sal_Int32( 0 ); + break; + case PROPERTY_ID_FILTER: + case PROPERTY_ID_HAVING_CLAUSE: + case PROPERTY_ID_GROUP_BY: + case PROPERTY_ID_ORDER: + case PROPERTY_ID_UPDATE_CATALOGNAME: + case PROPERTY_ID_UPDATE_SCHEMANAME: + case PROPERTY_ID_UPDATE_TABLENAME: + _rDefault <<= ::rtl::OUString(); + break; } } // ------------------------------------------------------------------------- @@ -384,7 +394,6 @@ void ORowSet::getPropertyDefaultByHandle( sal_Int32 _nHandle, Any& _rDefault ) c void SAL_CALL ORowSet::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any& rValue) throw (Exception) { - //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::setFastPropertyValue_NoBroadcast" ); switch(nHandle) { case PROPERTY_ID_ISMODIFIED: @@ -474,7 +483,6 @@ void SAL_CALL ORowSet::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const // ------------------------------------------------------------------------- void SAL_CALL ORowSet::getFastPropertyValue(Any& rValue,sal_Int32 nHandle) const { - //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::getFastPropertyValue" ); if(m_pCache) { switch(nHandle) @@ -517,7 +525,6 @@ void SAL_CALL ORowSet::getFastPropertyValue(Any& rValue,sal_Int32 nHandle) const // com::sun::star::XTypeProvider Sequence< Type > SAL_CALL ORowSet::getTypes() throw (RuntimeException) { - //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::getTypes" ); OTypeCollection aTypes(::getCppuType( (const Reference< XPropertySet > *)0 ), ::getCppuType( (const Reference< XFastPropertySet > *)0 ), ::getCppuType( (const Reference< XMultiPropertySet > *)0 ), @@ -527,7 +534,6 @@ Sequence< Type > SAL_CALL ORowSet::getTypes() throw (RuntimeException) // ------------------------------------------------------------------------- Sequence< sal_Int8 > SAL_CALL ORowSet::getImplementationId() throw (RuntimeException) { - //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::getImplementationId" ); static OImplementationId * pId = 0; if (! pId) { @@ -545,7 +551,6 @@ Sequence< sal_Int8 > SAL_CALL ORowSet::getImplementationId() throw (RuntimeExcep // com::sun::star::XInterface Any SAL_CALL ORowSet::queryInterface( const Type & rType ) throw (RuntimeException) { - //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::queryInterface" ); return ORowSet_BASE1::queryInterface( rType); } // ------------------------------------------------------------------------- @@ -563,7 +568,6 @@ void SAL_CALL ORowSet::release() throw() // com::sun::star::XUnoTunnel sal_Int64 SAL_CALL ORowSet::getSomething( const Sequence< sal_Int8 >& rId ) throw(RuntimeException) { - //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::getSomething" ); if (rId.getLength() == 16 && 0 == rtl_compareMemory(getImplementationId().getConstArray(), rId.getConstArray(), 16 ) ) return reinterpret_cast<sal_Int64>(this); @@ -573,7 +577,6 @@ sal_Int64 SAL_CALL ORowSet::getSomething( const Sequence< sal_Int8 >& rId ) thro // com::sun::star::XAggregation Any SAL_CALL ORowSet::queryAggregation( const Type& rType ) throw(RuntimeException) { - //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::queryAggregation" ); Any aRet(ORowSetBase::queryInterface(rType)); if (!aRet.hasValue()) aRet = ORowSet_BASE1::queryAggregation(rType); @@ -582,26 +585,22 @@ Any SAL_CALL ORowSet::queryAggregation( const Type& rType ) throw(RuntimeExcepti //------------------------------------------------------------------------------ rtl::OUString ORowSet::getImplementationName_static( ) throw(RuntimeException) { - //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::getImplementationName_static" ); return rtl::OUString::createFromAscii("com.sun.star.comp.dba.ORowSet"); } // ------------------------------------------------------------------------- // ::com::sun::star::XServiceInfo ::rtl::OUString SAL_CALL ORowSet::getImplementationName( ) throw(RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::getImplementationName" ); return getImplementationName_static(); } // ------------------------------------------------------------------------- sal_Bool SAL_CALL ORowSet::supportsService( const ::rtl::OUString& _rServiceName ) throw(RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::supportsService" ); return ::comphelper::findValue(getSupportedServiceNames(), _rServiceName, sal_True).getLength() != 0; } //------------------------------------------------------------------------------ Sequence< ::rtl::OUString > ORowSet::getSupportedServiceNames_static( ) throw (RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::getSupportedServiceNames_static" ); Sequence< rtl::OUString > aSNS( 5 ); aSNS[0] = SERVICE_SDBC_RESULTSET; aSNS[1] = SERVICE_SDBC_ROWSET; @@ -613,13 +612,11 @@ Sequence< ::rtl::OUString > ORowSet::getSupportedServiceNames_static( ) throw ( // ------------------------------------------------------------------------- Sequence< ::rtl::OUString > SAL_CALL ORowSet::getSupportedServiceNames( ) throw(RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::getSupportedServiceNames" ); return getSupportedServiceNames_static(); } //------------------------------------------------------------------------------ Reference< XInterface > ORowSet::Create(const Reference< XComponentContext >& _rxContext) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::Create" ); ::comphelper::ComponentContext aContext( _rxContext ); return ORowSet_CreateInstance( aContext.getLegacyServiceFactory() ); } @@ -627,7 +624,6 @@ Reference< XInterface > ORowSet::Create(const Reference< XComponentContext >& _r // OComponentHelper void SAL_CALL ORowSet::disposing() { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::disposing" ); OPropertyStateContainer::disposing(); MutexGuard aGuard(m_aMutex); @@ -658,7 +654,6 @@ void SAL_CALL ORowSet::disposing() // ------------------------------------------------------------------------- void ORowSet::freeResources( bool _bComplete ) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::freeResources" ); MutexGuard aGuard(m_aMutex); // free all clones @@ -712,7 +707,6 @@ void ORowSet::freeResources( bool _bComplete ) // ------------------------------------------------------------------------- void ORowSet::setActiveConnection( Reference< XConnection >& _rxNewConn, sal_Bool _bFireEvent ) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::setActiveConnection" ); if (_rxNewConn.get() == m_xActiveConnection.get()) // nothing to do return; @@ -760,7 +754,6 @@ void ORowSet::setActiveConnection( Reference< XConnection >& _rxNewConn, sal_Boo // ::com::sun::star::XEventListener void SAL_CALL ORowSet::disposing( const ::com::sun::star::lang::EventObject& Source ) throw(RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::disposing" ); // close rowset because the connection is going to be deleted (someone told me :-) Reference<XConnection> xCon(Source.Source,UNO_QUERY); if(m_xActiveConnection == xCon) @@ -778,7 +771,6 @@ void SAL_CALL ORowSet::disposing( const ::com::sun::star::lang::EventObject& Sou // XCloseable void SAL_CALL ORowSet::close( ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::close" ); { MutexGuard aGuard( m_aMutex ); ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed); @@ -790,7 +782,6 @@ void SAL_CALL ORowSet::close( ) throw(SQLException, RuntimeException) // comphelper::OPropertyArrayUsageHelper ::cppu::IPropertyArrayHelper* ORowSet::createArrayHelper( ) const { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::createArrayHelper" ); Sequence< Property > aProps; describeProperties(aProps); return new ::cppu::OPropertyArrayHelper(aProps); @@ -799,14 +790,12 @@ void SAL_CALL ORowSet::close( ) throw(SQLException, RuntimeException) // cppu::OPropertySetHelper ::cppu::IPropertyArrayHelper& SAL_CALL ORowSet::getInfoHelper() { - //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::getInfoHelper" ); typedef ::comphelper::OPropertyArrayUsageHelper<ORowSet> ORowSet_PROP; return *ORowSet_PROP::getArrayHelper(); } // ----------------------------------------------------------------------------- void ORowSet::updateValue(sal_Int32 columnIndex,const ORowSetValue& x) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::updateValue" ); ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed); ::osl::MutexGuard aGuard( *m_pMutex ); @@ -824,85 +813,71 @@ void ORowSet::updateValue(sal_Int32 columnIndex,const ORowSetValue& x) // XRowUpdate void SAL_CALL ORowSet::updateNull( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::updateNull" ); updateValue(columnIndex,ORowSetValue()); } // ------------------------------------------------------------------------- void SAL_CALL ORowSet::updateBoolean( sal_Int32 columnIndex, sal_Bool x ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::updateBoolean" ); updateValue(columnIndex,x); } // ------------------------------------------------------------------------- void SAL_CALL ORowSet::updateByte( sal_Int32 columnIndex, sal_Int8 x ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::updateByte" ); updateValue(columnIndex,x); } // ------------------------------------------------------------------------- void SAL_CALL ORowSet::updateShort( sal_Int32 columnIndex, sal_Int16 x ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::updateShort" ); updateValue(columnIndex,x); } // ------------------------------------------------------------------------- void SAL_CALL ORowSet::updateInt( sal_Int32 columnIndex, sal_Int32 x ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::updateInt" ); updateValue(columnIndex,x); } // ------------------------------------------------------------------------- void SAL_CALL ORowSet::updateLong( sal_Int32 columnIndex, sal_Int64 x ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::updateLong" ); updateValue(columnIndex,x); } // ------------------------------------------------------------------------- void SAL_CALL ORowSet::updateFloat( sal_Int32 columnIndex, float x ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::updateFloat" ); updateValue(columnIndex,x); } // ------------------------------------------------------------------------- void SAL_CALL ORowSet::updateDouble( sal_Int32 columnIndex, double x ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::updateDouble" ); updateValue(columnIndex,x); } // ------------------------------------------------------------------------- void SAL_CALL ORowSet::updateString( sal_Int32 columnIndex, const ::rtl::OUString& x ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::updateString" ); updateValue(columnIndex,x); } // ------------------------------------------------------------------------- void SAL_CALL ORowSet::updateBytes( sal_Int32 columnIndex, const Sequence< sal_Int8 >& x ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::updateBytes" ); updateValue(columnIndex,x); } // ------------------------------------------------------------------------- void SAL_CALL ORowSet::updateDate( sal_Int32 columnIndex, const ::com::sun::star::util::Date& x ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::updateDate" ); updateValue(columnIndex,x); } // ------------------------------------------------------------------------- void SAL_CALL ORowSet::updateTime( sal_Int32 columnIndex, const ::com::sun::star::util::Time& x ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::updateTime" ); updateValue(columnIndex,x); } // ------------------------------------------------------------------------- void SAL_CALL ORowSet::updateTimestamp( sal_Int32 columnIndex, const ::com::sun::star::util::DateTime& x ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::updateTimestamp" ); updateValue(columnIndex,x); } // ------------------------------------------------------------------------- void SAL_CALL ORowSet::updateBinaryStream( sal_Int32 columnIndex, const Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::updateBinaryStream" ); ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed); ::osl::MutexGuard aGuard( *m_pMutex ); @@ -933,7 +908,6 @@ void SAL_CALL ORowSet::updateBinaryStream( sal_Int32 columnIndex, const Referenc // ------------------------------------------------------------------------- void SAL_CALL ORowSet::updateCharacterStream( sal_Int32 columnIndex, const Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::updateCharacterStream" ); ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed); ::osl::MutexGuard aGuard( *m_pMutex ); @@ -950,7 +924,6 @@ void SAL_CALL ORowSet::updateCharacterStream( sal_Int32 columnIndex, const Refer // ------------------------------------------------------------------------- void SAL_CALL ORowSet::updateObject( sal_Int32 columnIndex, const Any& x ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::updateObject" ); ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed); ::osl::MutexGuard aGuard( *m_pMutex ); @@ -999,7 +972,6 @@ void SAL_CALL ORowSet::updateObject( sal_Int32 columnIndex, const Any& x ) throw // ------------------------------------------------------------------------- void SAL_CALL ORowSet::updateNumericObject( sal_Int32 columnIndex, const Any& x, sal_Int32 scale ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::updateNumericObject" ); ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed); ::osl::MutexGuard aGuard( *m_pMutex ); @@ -1018,7 +990,6 @@ void SAL_CALL ORowSet::updateNumericObject( sal_Int32 columnIndex, const Any& x, // XResultSetUpdate void SAL_CALL ORowSet::insertRow( ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::insertRow" ); ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed); // insertRow is not allowd when // standing not on the insert row nor @@ -1068,17 +1039,15 @@ void SAL_CALL ORowSet::insertRow( ) throw(SQLException, RuntimeException) // ------------------------------------------------------------------------- sal_Int32 SAL_CALL ORowSet::getRow( ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::getRow" ); ::osl::MutexGuard aGuard( *m_pMutex ); checkCache(); // check if we are inserting a row - return (m_pCache && ( m_pCache->m_bNew || m_bModified )) ? 0 : impl_getRow(); + return (m_pCache && ( m_pCache->m_bNew || m_bModified )) ? 0 : ORowSetBase::getRow(); } // ------------------------------------------------------------------------- void SAL_CALL ORowSet::updateRow( ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::updateRow" ); ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed); // not allowed when standing on insert row ::osl::ResettableMutexGuard aGuard( *m_pMutex ); @@ -1116,7 +1085,6 @@ void SAL_CALL ORowSet::updateRow( ) throw(SQLException, RuntimeException) // ------------------------------------------------------------------------- void SAL_CALL ORowSet::deleteRow( ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::deleteRow" ); ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed); ::osl::ResettableMutexGuard aGuard( *m_pMutex ); @@ -1134,7 +1102,7 @@ void SAL_CALL ORowSet::deleteRow( ) throw(SQLException, RuntimeException) if ( ( m_pCache->m_nPrivileges & Privilege::DELETE ) != Privilege::DELETE ) throwSQLException( "DELETE privilege not available.", SQL_FUNCTION_SEQUENCE_ERROR, *this ); // TODO: resource - if ( impl_rowDeleted() ) + if ( rowDeleted() ) throwSQLException( "Current row already deleted.", SQL_FUNCTION_SEQUENCE_ERROR, *this ); // TODO: resource @@ -1173,7 +1141,6 @@ void SAL_CALL ORowSet::deleteRow( ) throw(SQLException, RuntimeException) // ------------------------------------------------------------------------- void ORowSet::implCancelRowUpdates( sal_Bool _bNotifyModified ) SAL_THROW( ( SQLException, RuntimeException ) ) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::implCancelRowUpdates" ); ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed); ::osl::MutexGuard aGuard( *m_pMutex ); @@ -1211,14 +1178,12 @@ void ORowSet::implCancelRowUpdates( sal_Bool _bNotifyModified ) SAL_THROW( ( SQL // ------------------------------------------------------------------------- void SAL_CALL ORowSet::cancelRowUpdates( ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::cancelRowUpdates" ); implCancelRowUpdates( sal_True ); } // ------------------------------------------------------------------------- void SAL_CALL ORowSet::addRowSetListener( const Reference< XRowSetListener >& listener ) throw(RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::addRowSetListener" ); ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed); ::osl::MutexGuard aGuard( m_aColumnsMutex ); @@ -1228,7 +1193,6 @@ void SAL_CALL ORowSet::addRowSetListener( const Reference< XRowSetListener >& li // ------------------------------------------------------------------------- void SAL_CALL ORowSet::removeRowSetListener( const Reference< XRowSetListener >& listener ) throw(RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::removeRowSetListener" ); ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed); ::osl::MutexGuard aGuard( m_aColumnsMutex ); @@ -1238,7 +1202,6 @@ void SAL_CALL ORowSet::removeRowSetListener( const Reference< XRowSetListener >& // ----------------------------------------------------------------------------- void ORowSet::notifyAllListeners(::osl::ResettableMutexGuard& _rGuard) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::notifyAllListeners" ); EventObject aEvt(*m_pMySelf); _rGuard.clear(); m_aRowsetListeners.notifyEach( &XRowSetListener::rowSetChanged, aEvt ); @@ -1247,7 +1210,6 @@ void ORowSet::notifyAllListeners(::osl::ResettableMutexGuard& _rGuard) // ------------------------------------------------------------------------- void ORowSet::notifyAllListenersCursorMoved(::osl::ResettableMutexGuard& _rGuard) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::notifyAllListenersCursorMoved" ); EventObject aEvt(*m_pMySelf); _rGuard.clear(); m_aRowsetListeners.notifyEach( &XRowSetListener::cursorMoved, aEvt ); @@ -1256,7 +1218,6 @@ void ORowSet::notifyAllListenersCursorMoved(::osl::ResettableMutexGuard& _rGuard // ------------------------------------------------------------------------- void ORowSet::notifyAllListenersRowChanged(::osl::ResettableMutexGuard& _rGuard, const EventObject& aEvt) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::notifyAllListenersRowChanged" ); _rGuard.clear(); m_aRowsetListeners.notifyEach( &XRowSetListener::rowChanged, aEvt ); _rGuard.reset(); @@ -1264,7 +1225,6 @@ void ORowSet::notifyAllListenersRowChanged(::osl::ResettableMutexGuard& _rGuard, // ------------------------------------------------------------------------- sal_Bool ORowSet::notifyAllListenersCursorBeforeMove(::osl::ResettableMutexGuard& _rGuard) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::notifyAllListenersCursorBeforeMove" ); EventObject aEvt(*m_pMySelf); NOTIFY_LISTERNERS_CHECK(m_aApproveListeners,XRowSetApproveListener,approveCursorMove); return bCheck; @@ -1272,7 +1232,6 @@ sal_Bool ORowSet::notifyAllListenersCursorBeforeMove(::osl::ResettableMutexGuard // ------------------------------------------------------------------------- void ORowSet::notifyAllListenersRowBeforeChange(::osl::ResettableMutexGuard& _rGuard,const RowChangeEvent &aEvt) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::notifyAllListenersRowBeforeChange" ); NOTIFY_LISTERNERS_CHECK(m_aApproveListeners,XRowSetApproveListener,approveRowChange); if ( !bCheck ) m_aErrors.raiseTypedException( sdb::ErrorCondition::ROW_SET_OPERATION_VETOED, *this, ::cppu::UnoType< RowSetVetoException >::get() ); @@ -1280,7 +1239,6 @@ void ORowSet::notifyAllListenersRowBeforeChange(::osl::ResettableMutexGuard& _rG // ------------------------------------------------------------------------- void ORowSet::fireRowcount() { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::fireRowcount" ); sal_Int32 nCurrentRowCount( impl_getRowCount() ); sal_Bool bCurrentRowCountFinal( m_pCache->m_bRowCountFinal ); @@ -1305,7 +1263,6 @@ void ORowSet::fireRowcount() // ------------------------------------------------------------------------- void SAL_CALL ORowSet::moveToInsertRow( ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::moveToInsertRow" ); ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed); ::osl::ResettableMutexGuard aGuard( *m_pMutex ); @@ -1363,7 +1320,6 @@ void SAL_CALL ORowSet::moveToInsertRow( ) throw(SQLException, RuntimeException) // ------------------------------------------------------------------------- void SAL_CALL ORowSet::moveToCurrentRow( ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::moveToCurrentRow" ); ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed); ::osl::ResettableMutexGuard aGuard( *m_pMutex ); @@ -1401,111 +1357,96 @@ void SAL_CALL ORowSet::moveToCurrentRow( ) throw(SQLException, RuntimeException // XRow sal_Bool SAL_CALL ORowSet::wasNull( ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::wasNull" ); ::osl::MutexGuard aGuard( *m_pMutex ); checkCache(); - return ( m_pCache && isInsertRow() ) ? ((*m_pCache->m_aInsertRow)->get())[m_nLastColumnIndex].isNull() : impl_wasNull(); + return ( m_pCache && isInsertRow() ) ? ((*m_pCache->m_aInsertRow)->get())[m_nLastColumnIndex].isNull() : ORowSetBase::wasNull(); } // ----------------------------------------------------------------------------- const ORowSetValue& ORowSet::getInsertValue(sal_Int32 columnIndex) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::getInsertValue" ); checkCache(); if ( m_pCache && isInsertRow() ) return ((*m_pCache->m_aInsertRow)->get())[m_nLastColumnIndex = columnIndex]; - return impl_getValue(columnIndex); + return getValue(columnIndex); } // ------------------------------------------------------------------------- ::rtl::OUString SAL_CALL ORowSet::getString( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::getString" ); ::osl::MutexGuard aGuard( *m_pMutex ); return getInsertValue(columnIndex); } // ------------------------------------------------------------------------- sal_Bool SAL_CALL ORowSet::getBoolean( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::getBoolean" ); ::osl::MutexGuard aGuard( *m_pMutex ); return getInsertValue(columnIndex); } // ------------------------------------------------------------------------- sal_Int8 SAL_CALL ORowSet::getByte( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::getByte" ); ::osl::MutexGuard aGuard( *m_pMutex ); return getInsertValue(columnIndex); } // ------------------------------------------------------------------------- sal_Int16 SAL_CALL ORowSet::getShort( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::getShort" ); ::osl::MutexGuard aGuard( *m_pMutex ); return getInsertValue(columnIndex); } // ------------------------------------------------------------------------- sal_Int32 SAL_CALL ORowSet::getInt( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::getInt" ); ::osl::MutexGuard aGuard( *m_pMutex ); return getInsertValue(columnIndex); } // ------------------------------------------------------------------------- sal_Int64 SAL_CALL ORowSet::getLong( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::getLong" ); ::osl::MutexGuard aGuard( *m_pMutex ); return getInsertValue(columnIndex); } // ------------------------------------------------------------------------- float SAL_CALL ORowSet::getFloat( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::getFloat" ); ::osl::MutexGuard aGuard( *m_pMutex ); return getInsertValue(columnIndex); } // ------------------------------------------------------------------------- double SAL_CALL ORowSet::getDouble( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::getDouble" ); ::osl::MutexGuard aGuard( *m_pMutex ); return getInsertValue(columnIndex); } // ------------------------------------------------------------------------- Sequence< sal_Int8 > SAL_CALL ORowSet::getBytes( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::getBytes" ); ::osl::MutexGuard aGuard( *m_pMutex ); return getInsertValue(columnIndex); } // ------------------------------------------------------------------------- ::com::sun::star::util::Date SAL_CALL ORowSet::getDate( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::getDate" ); ::osl::MutexGuard aGuard( *m_pMutex ); return getInsertValue(columnIndex); } // ------------------------------------------------------------------------- ::com::sun::star::util::Time SAL_CALL ORowSet::getTime( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::getTime" ); ::osl::MutexGuard aGuard( *m_pMutex ); return getInsertValue(columnIndex); } // ------------------------------------------------------------------------- ::com::sun::star::util::DateTime SAL_CALL ORowSet::getTimestamp( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::getTimestamp" ); ::osl::MutexGuard aGuard( *m_pMutex ); return getInsertValue(columnIndex); } // ------------------------------------------------------------------------- Reference< ::com::sun::star::io::XInputStream > SAL_CALL ORowSet::getBinaryStream( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::getBinaryStream" ); ::osl::MutexGuard aGuard( *m_pMutex ); if ( m_pCache && isInsertRow() ) { @@ -1518,7 +1459,6 @@ Reference< ::com::sun::star::io::XInputStream > SAL_CALL ORowSet::getBinaryStrea // ------------------------------------------------------------------------- Reference< ::com::sun::star::io::XInputStream > SAL_CALL ORowSet::getCharacterStream( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::getCharacterStream" ); ::osl::MutexGuard aGuard( *m_pMutex ); if(m_pCache && isInsertRow() ) { @@ -1531,38 +1471,32 @@ Reference< ::com::sun::star::io::XInputStream > SAL_CALL ORowSet::getCharacterSt // ------------------------------------------------------------------------- Any SAL_CALL ORowSet::getObject( sal_Int32 columnIndex, const Reference< XNameAccess >& /*typeMap*/ ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::getObject" ); ::osl::MutexGuard aGuard( *m_pMutex ); return getInsertValue(columnIndex).makeAny(); } // ------------------------------------------------------------------------- Reference< XRef > SAL_CALL ORowSet::getRef( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::getRef" ); return Reference< XRef >(); } // ------------------------------------------------------------------------- Reference< XBlob > SAL_CALL ORowSet::getBlob( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::getBlob" ); return Reference< XBlob >(); } // ------------------------------------------------------------------------- Reference< XClob > SAL_CALL ORowSet::getClob( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::getClob" ); return Reference< XClob >(); } // ------------------------------------------------------------------------- Reference< XArray > SAL_CALL ORowSet::getArray( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::getArray" ); return Reference< XArray >(); } // ------------------------------------------------------------------------- void SAL_CALL ORowSet::executeWithCompletion( const Reference< XInteractionHandler >& _rxHandler ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::executeWithCompletion" ); if (!_rxHandler.is()) execute(); @@ -1588,7 +1522,14 @@ void SAL_CALL ORowSet::executeWithCompletion( const Reference< XInteractionHandl m_bRebuildConnOnExecute = sal_False; Reference< XSingleSelectQueryComposer > xComposer = getCurrentSettingsComposer( this, m_aContext.getLegacyServiceFactory() ); - ::dbtools::askForParameters( xComposer, this, m_xActiveConnection, _rxHandler ); + Reference<XParametersSupplier> xParameters(xComposer, UNO_QUERY); + + Reference<XIndexAccess> xParamsAsIndicies = xParameters.is() ? xParameters->getParameters() : Reference<XIndexAccess>(); + const sal_Int32 nParamCount = xParamsAsIndicies.is() ? xParamsAsIndicies->getCount() : 0; + if ( m_aParametersSet.size() < (size_t)nParamCount ) + m_aParametersSet.resize( nParamCount ,false); + + ::dbtools::askForParameters( xComposer, this, m_xActiveConnection, _rxHandler,m_aParametersSet ); } // ensure that only the allowed exceptions leave this block catch(SQLException&) @@ -1613,7 +1554,6 @@ void SAL_CALL ORowSet::executeWithCompletion( const Reference< XInteractionHandl // ------------------------------------------------------------------------- Reference< XIndexAccess > SAL_CALL ORowSet::getParameters( ) throw (RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::getParameters" ); ::osl::MutexGuard aGuard( *m_pMutex ); ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed); @@ -1641,7 +1581,6 @@ Reference< XIndexAccess > SAL_CALL ORowSet::getParameters( ) throw (RuntimeExce // ------------------------------------------------------------------------- void ORowSet::approveExecution() throw (RowSetVetoException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::approveExecution" ); ::osl::MutexGuard aGuard( m_aColumnsMutex ); EventObject aEvt(*this); @@ -1672,7 +1611,6 @@ void ORowSet::approveExecution() throw (RowSetVetoException, RuntimeException) // ------------------------------------------------------------------------- void SAL_CALL ORowSet::execute( ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::execute" ); ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed); // tell everybody that we will change the result set @@ -1698,7 +1636,6 @@ void SAL_CALL ORowSet::execute( ) throw(SQLException, RuntimeException) //------------------------------------------------------------------------------ void ORowSet::setStatementResultSetType( const Reference< XPropertySet >& _rxStatement, sal_Int32 _nDesiredResultSetType, sal_Int32 _nDesiredResultSetConcurrency ) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::setStatementResultSetType" ); OSL_ENSURE( _rxStatement.is(), "ORowSet::setStatementResultSetType: invalid statement - this will crash!" ); sal_Int32 nResultSetType( _nDesiredResultSetType ); @@ -1749,7 +1686,6 @@ void ORowSet::setStatementResultSetType( const Reference< XPropertySet >& _rxSta // ----------------------------------------------------------------------------- Reference< XResultSet > ORowSet::impl_prepareAndExecute_throw() { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::impl_prepareAndExecute_throw" ); ::rtl::OUString sCommandToExecute; sal_Bool bUseEscapeProcessing = impl_initComposer_throw( sCommandToExecute ); @@ -1814,7 +1750,6 @@ Reference< XResultSet > ORowSet::impl_prepareAndExecute_throw() // ----------------------------------------------------------------------------- void ORowSet::impl_initializeColumnSettings_nothrow( const Reference< XPropertySet >& _rxTemplateColumn, const Reference< XPropertySet >& _rxRowSetColumn ) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::impl_initializeColumnSettings_nothrow" ); OSL_ENSURE( _rxTemplateColumn.is() && _rxRowSetColumn.is(), "ORowSet::impl_initializeColumnSettings_nothrow: this will crash!" ); @@ -2018,7 +1953,6 @@ void ORowSet::execute_NoApprove_NoNewConn(ResettableMutexGuard& _rClearForNotifi else { // create the rowset columns - const Reference< XDatabaseMetaData > xDatabaseMetaData( m_xActiveConnection->getMetaData() ); Reference< XResultSetMetaData > xMeta( getMetaData(), UNO_QUERY_THROW ); sal_Int32 nCount = xMeta->getColumnCount(); m_aDataColumns.reserve(nCount+1); @@ -2073,7 +2007,7 @@ void ORowSet::execute_NoApprove_NoNewConn(ResettableMutexGuard& _rClearForNotifi this, this, i, - xDatabaseMetaData, + m_xActiveConnection->getMetaData(), aDescription, m_aCurrentRow); aColumns->get().push_back(pColumn); @@ -2112,7 +2046,6 @@ void ORowSet::execute_NoApprove_NoNewConn(ResettableMutexGuard& _rClearForNotifi // XRowSetApproveBroadcaster void SAL_CALL ORowSet::addRowSetApproveListener( const Reference< XRowSetApproveListener >& listener ) throw(RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::addRowSetApproveListener" ); ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed); ::osl::MutexGuard aGuard( m_aColumnsMutex ); @@ -2122,7 +2055,6 @@ void SAL_CALL ORowSet::addRowSetApproveListener( const Reference< XRowSetApprove // ------------------------------------------------------------------------- void SAL_CALL ORowSet::removeRowSetApproveListener( const Reference< XRowSetApproveListener >& listener ) throw(RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::removeRowSetApproveListener" ); ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed); ::osl::MutexGuard aGuard( m_aColumnsMutex ); @@ -2134,7 +2066,6 @@ void SAL_CALL ORowSet::removeRowSetApproveListener( const Reference< XRowSetAppr // XResultSetAccess Reference< XResultSet > SAL_CALL ORowSet::createResultSet( ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::createResultSet" ); ::osl::MutexGuard aGuard( m_aColumnsMutex ); if(m_xStatement.is()) @@ -2151,7 +2082,6 @@ Reference< XResultSet > SAL_CALL ORowSet::createResultSet( ) throw(SQLException // ::com::sun::star::util::XCancellable void SAL_CALL ORowSet::cancel( ) throw(RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::cancel" ); ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed); } // ------------------------------------------------------------------------- @@ -2159,7 +2089,6 @@ void SAL_CALL ORowSet::cancel( ) throw(RuntimeException) // ::com::sun::star::sdbcx::XDeleteRows Sequence< sal_Int32 > SAL_CALL ORowSet::deleteRows( const Sequence< Any >& rows ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::deleteRows" ); ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed); if(!m_pCache || m_nResultSetConcurrency == ResultSetConcurrency::READ_ONLY) @@ -2213,7 +2142,6 @@ Sequence< sal_Int32 > SAL_CALL ORowSet::deleteRows( const Sequence< Any >& rows // ----------------------------------------------------------------------------- void ORowSet::notifyRowSetAndClonesRowDelete( const Any& _rBookmark ) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::notifyRowSetAndClonesRowDelete" ); // notify ourself onDeleteRow( _rBookmark ); // notify the clones @@ -2231,7 +2159,6 @@ void ORowSet::notifyRowSetAndClonesRowDelete( const Any& _rBookmark ) //------------------------------------------------------------------------------ void ORowSet::notifyRowSetAndClonesRowDeleted( const Any& _rBookmark, sal_Int32 _nPos ) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::notifyRowSetAndClonesRowDeleted" ); // notify ourself onDeletedRow( _rBookmark, _nPos ); // notify the clones @@ -2249,7 +2176,6 @@ void ORowSet::notifyRowSetAndClonesRowDeleted( const Any& _rBookmark, sal_Int32 //------------------------------------------------------------------------------ Reference< XConnection > ORowSet::calcConnection(const Reference< XInteractionHandler >& _rxHandler) throw( SQLException, RuntimeException ) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::calcConnection" ); MutexGuard aGuard(m_aMutex); if (!m_xActiveConnection.is()) { @@ -2294,7 +2220,6 @@ Reference< XConnection > ORowSet::calcConnection(const Reference< XInteractionH //------------------------------------------------------------------------------ Reference< XNameAccess > ORowSet::impl_getTables_throw() { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::impl_getTables_throw" ); Reference< XNameAccess > xTables; Reference< XTablesSupplier > xTablesAccess( m_xActiveConnection, UNO_QUERY ); @@ -2335,7 +2260,6 @@ Reference< XNameAccess > ORowSet::impl_getTables_throw() //------------------------------------------------------------------------------ void ORowSet::impl_resetTables_nothrow() { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::impl_resetTables_nothrow" ); if ( !m_pTables ) return; @@ -2354,7 +2278,6 @@ void ORowSet::impl_resetTables_nothrow() //------------------------------------------------------------------------------ sal_Bool ORowSet::impl_initComposer_throw( ::rtl::OUString& _out_rCommandToExecute ) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::impl_initComposer_throw" ); sal_Bool bUseEscapeProcessing = impl_buildActiveCommand_throw( ); _out_rCommandToExecute = m_aActiveCommand; if ( !bUseEscapeProcessing ) @@ -2405,7 +2328,6 @@ sal_Bool ORowSet::impl_initComposer_throw( ::rtl::OUString& _out_rCommandToExecu //------------------------------------------------------------------------------ sal_Bool ORowSet::impl_buildActiveCommand_throw() { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::impl_buildActiveCommand_throw" ); // create the sql command // from a table name or get the command out of a query (not a view) // the last use the command as it is @@ -2516,7 +2438,6 @@ sal_Bool ORowSet::impl_buildActiveCommand_throw() //------------------------------------------------------------------------------ void ORowSet::impl_initParametersContainer_nothrow() { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::impl_initParametersContainer_nothrow" ); OSL_PRECOND( !m_pParameters.is(), "ORowSet::impl_initParametersContainer_nothrow: already initialized the parameters!" ); m_pParameters = new param::ParameterWrapperContainer( m_xComposer.get() ); @@ -2531,7 +2452,6 @@ void ORowSet::impl_initParametersContainer_nothrow() //------------------------------------------------------------------------------ void ORowSet::impl_disposeParametersContainer_nothrow() { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::impl_disposeParametersContainer_nothrow" ); if ( !m_pParameters.is() ) return; @@ -2550,11 +2470,18 @@ void ORowSet::impl_disposeParametersContainer_nothrow() // ----------------------------------------------------------------------------- ORowSetValue& ORowSet::getParameterStorage(sal_Int32 parameterIndex) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::getParameterStorage" ); ::connectivity::checkDisposed( ORowSet_BASE1::rBHelper.bDisposed ); if ( parameterIndex < 1 ) throwInvalidIndexException( *this ); + if ( m_aParametersSet.size() < (size_t)parameterIndex ) + m_aParametersSet.resize( parameterIndex ,false); + m_aParametersSet[parameterIndex - 1] = true; + + if ( m_aParametersSet.size() < (size_t)parameterIndex ) + m_aParametersSet.resize( parameterIndex ,false); + m_aParametersSet[parameterIndex - 1] = true; + if ( m_pParameters.is() ) { if ( m_bCommandFacetsDirty ) @@ -2577,7 +2504,6 @@ ORowSetValue& ORowSet::getParameterStorage(sal_Int32 parameterIndex) // XParameters void SAL_CALL ORowSet::setNull( sal_Int32 parameterIndex, sal_Int32 /*sqlType*/ ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::setNull" ); ::osl::MutexGuard aGuard( m_aColumnsMutex ); getParameterStorage( parameterIndex ).setNull(); @@ -2585,13 +2511,11 @@ void SAL_CALL ORowSet::setNull( sal_Int32 parameterIndex, sal_Int32 /*sqlType*/ // ------------------------------------------------------------------------- void SAL_CALL ORowSet::setObjectNull( sal_Int32 parameterIndex, sal_Int32 sqlType, const ::rtl::OUString& /*typeName*/ ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::setObjectNull" ); setNull( parameterIndex, sqlType ); } // ----------------------------------------------------------------------------- void ORowSet::setParameter(sal_Int32 parameterIndex, const ORowSetValue& x) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::setParameter" ); ::osl::MutexGuard aGuard( m_aColumnsMutex ); getParameterStorage( parameterIndex ) = x; @@ -2600,79 +2524,66 @@ void ORowSet::setParameter(sal_Int32 parameterIndex, const ORowSetValue& x) // ------------------------------------------------------------------------- void SAL_CALL ORowSet::setBoolean( sal_Int32 parameterIndex, sal_Bool x ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::setBoolean" ); setParameter(parameterIndex,x); } // ------------------------------------------------------------------------- void SAL_CALL ORowSet::setByte( sal_Int32 parameterIndex, sal_Int8 x ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::setByte" ); setParameter(parameterIndex,x); } // ------------------------------------------------------------------------- void SAL_CALL ORowSet::setShort( sal_Int32 parameterIndex, sal_Int16 x ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::setShort" ); setParameter(parameterIndex,x); } // ------------------------------------------------------------------------- void SAL_CALL ORowSet::setInt( sal_Int32 parameterIndex, sal_Int32 x ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::setInt" ); setParameter(parameterIndex,x); } // ------------------------------------------------------------------------- void SAL_CALL ORowSet::setLong( sal_Int32 parameterIndex, sal_Int64 x ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::setLong" ); setParameter(parameterIndex,x); } // ------------------------------------------------------------------------- void SAL_CALL ORowSet::setFloat( sal_Int32 parameterIndex, float x ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::setFloat" ); setParameter(parameterIndex,x); } // ------------------------------------------------------------------------- void SAL_CALL ORowSet::setDouble( sal_Int32 parameterIndex, double x ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::setDouble" ); setParameter(parameterIndex,x); } // ------------------------------------------------------------------------- void SAL_CALL ORowSet::setString( sal_Int32 parameterIndex, const ::rtl::OUString& x ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::setString" ); setParameter(parameterIndex,x); } // ------------------------------------------------------------------------- void SAL_CALL ORowSet::setBytes( sal_Int32 parameterIndex, const Sequence< sal_Int8 >& x ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::setBytes" ); setParameter(parameterIndex,x); } // ------------------------------------------------------------------------- void SAL_CALL ORowSet::setDate( sal_Int32 parameterIndex, const ::com::sun::star::util::Date& x ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::setDate" ); setParameter(parameterIndex,x); } // ------------------------------------------------------------------------- void SAL_CALL ORowSet::setTime( sal_Int32 parameterIndex, const ::com::sun::star::util::Time& x ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::setTime" ); setParameter(parameterIndex,x); } // ------------------------------------------------------------------------- void SAL_CALL ORowSet::setTimestamp( sal_Int32 parameterIndex, const ::com::sun::star::util::DateTime& x ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::setTimestamp" ); setParameter(parameterIndex,x); } // ------------------------------------------------------------------------- void SAL_CALL ORowSet::setBinaryStream( sal_Int32 parameterIndex, const Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::setBinaryStream" ); ::osl::MutexGuard aGuard( m_aColumnsMutex ); ORowSetValue& rParamValue( getParameterStorage( parameterIndex ) ); @@ -2691,7 +2602,6 @@ void SAL_CALL ORowSet::setBinaryStream( sal_Int32 parameterIndex, const Referenc // ------------------------------------------------------------------------- void SAL_CALL ORowSet::setCharacterStream( sal_Int32 parameterIndex, const Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::setCharacterStream" ); ::osl::MutexGuard aGuard( m_aColumnsMutex ); ORowSetValue& rParamValue( getParameterStorage( parameterIndex ) ); try @@ -2714,7 +2624,6 @@ void SAL_CALL ORowSet::setCharacterStream( sal_Int32 parameterIndex, const Refer // ------------------------------------------------------------------------- void SAL_CALL ORowSet::setObject( sal_Int32 parameterIndex, const Any& x ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::setObject" ); if ( !::dbtools::implSetObject( this, parameterIndex, x ) ) { // there is no other setXXX call which can handle the value in x throw SQLException(); @@ -2723,7 +2632,6 @@ void SAL_CALL ORowSet::setObject( sal_Int32 parameterIndex, const Any& x ) throw // ------------------------------------------------------------------------- void SAL_CALL ORowSet::setObjectWithInfo( sal_Int32 parameterIndex, const Any& x, sal_Int32 targetSqlType, sal_Int32 /*scale*/ ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::setObjectWithInfo" ); ::osl::MutexGuard aGuard( m_aColumnsMutex ); ORowSetValue& rParamValue( getParameterStorage( parameterIndex ) ); setObject( parameterIndex, x ); @@ -2732,31 +2640,26 @@ void SAL_CALL ORowSet::setObjectWithInfo( sal_Int32 parameterIndex, const Any& x // ------------------------------------------------------------------------- void SAL_CALL ORowSet::setRef( sal_Int32 /*parameterIndex*/, const Reference< XRef >& /*x*/ ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::setRef" ); ::dbtools::throwFeatureNotImplementedException( "XParameters::setRef", *this ); } // ------------------------------------------------------------------------- void SAL_CALL ORowSet::setBlob( sal_Int32 /*parameterIndex*/, const Reference< XBlob >& /*x*/ ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::setBlob" ); ::dbtools::throwFeatureNotImplementedException( "XParameters::setBlob", *this ); } // ------------------------------------------------------------------------- void SAL_CALL ORowSet::setClob( sal_Int32 /*parameterIndex*/, const Reference< XClob >& /*x*/ ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::setClob" ); ::dbtools::throwFeatureNotImplementedException( "XParameters::setClob", *this ); } // ------------------------------------------------------------------------- void SAL_CALL ORowSet::setArray( sal_Int32 /*parameterIndex*/, const Reference< XArray >& /*x*/ ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::setArray" ); ::dbtools::throwFeatureNotImplementedException( "XParameters::setArray", *this ); } // ------------------------------------------------------------------------- void SAL_CALL ORowSet::clearParameters( ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::clearParameters" ); ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed); ::osl::MutexGuard aGuard( m_aColumnsMutex ); @@ -2764,11 +2667,11 @@ void SAL_CALL ORowSet::clearParameters( ) throw(SQLException, RuntimeException) size_t nParamCount( m_pParameters.is() ? m_pParameters->size() : m_aPrematureParamValues.get().size() ); for ( size_t i=1; i<=nParamCount; ++i ) getParameterStorage( (sal_Int32)i ).setNull(); + m_aParametersSet.clear(); } // ------------------------------------------------------------------------- void ORowSet::firePropertyChange(sal_Int32 _nPos,const ::connectivity::ORowSetValue& _rOldValue) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::firePropertyChange" ); OSL_ENSURE(_nPos < (sal_Int32)m_aDataColumns.size(),"nPos is invalid!"); m_aDataColumns[_nPos]->fireValueChange(_rOldValue); } @@ -2776,7 +2679,6 @@ void ORowSet::firePropertyChange(sal_Int32 _nPos,const ::connectivity::ORowSetVa // ----------------------------------------------------------------------------- void ORowSet::doCancelModification( ) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::doCancelModification" ); //OSL_ENSURE( isModification(), "ORowSet::doCancelModification: invalid call (no cache!)!" ); if ( isModification() ) m_pCache->cancelRowModification(); @@ -2786,28 +2688,24 @@ void ORowSet::doCancelModification( ) // ----------------------------------------------------------------------------- sal_Bool ORowSet::isModification( ) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::isModification" ); return isNew(); } // ----------------------------------------------------------------------------- sal_Bool ORowSet::isModified( ) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::isModified" ); return m_bModified; } // ----------------------------------------------------------------------------- sal_Bool ORowSet::isNew( ) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::isNew" ); return m_bNew; } // ----------------------------------------------------------------------------- void ORowSet::checkUpdateIterator() { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::checkUpdateIterator" ); if(!m_bModified && !m_bNew) { m_pCache->setUpdateIterator(m_aCurrentRow); @@ -2820,12 +2718,11 @@ void ORowSet::checkUpdateIterator() // ----------------------------------------------------------------------------- void ORowSet::checkUpdateConditions(sal_Int32 columnIndex) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::checkUpdateConditions" ); checkCache(); if ( columnIndex <= 0 ) throwSQLException( "Invalid column index", SQL_INVALID_DESCRIPTOR_INDEX, *this ); // TODO: resource - if ( impl_rowDeleted() ) + if ( rowDeleted() ) throwSQLException( "Current row is deleted", SQL_INVALID_CURSOR_POSITION, *this ); // TODO: resource if ( m_aCurrentRow.isNull() ) @@ -2841,7 +2738,6 @@ void ORowSet::checkUpdateConditions(sal_Int32 columnIndex) // ----------------------------------------------------------------------------- void SAL_CALL ORowSet::refreshRow( ) throw(SQLException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSet::refreshRow" ); ORowSetNotifier aNotifier( this ); // this will call cancelRowModification on the cache if necessary @@ -2893,45 +2789,47 @@ ORowSetClone::ORowSetClone( const ::comphelper::ComponentContext& _rContext, ORo // Locale aLocale; // pConfigMgr->GetDirectConfigProperty(ConfigManager::LOCALE) >>= aLocale; Locale aLocale = SvtSysLocale().GetLocaleData().getLocale(); - const Reference<XDatabaseMetaData> xMetaData( rParent.m_xActiveConnection->getMetaData() ); - const Reference< XResultSetMetaData > xRowMetaData( rParent.getMetaData() ); - - Sequence< ::rtl::OUString> aSeq = rParent.m_pColumns->getElementNames(); - const ::rtl::OUString* pIter = aSeq.getConstArray(); - const ::rtl::OUString* pEnd = pIter + aSeq.getLength(); - aColumns->get().reserve(aSeq.getLength()+1); - for(sal_Int32 i=1;pIter != pEnd ;++pIter,++i) - { - Reference<XPropertySet> xColumn; - rParent.m_pColumns->getByName(*pIter) >>= xColumn; - if(xColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_DESCRIPTION)) - aDescription = comphelper::getString(xColumn->getPropertyValue(PROPERTY_DESCRIPTION)); - - ORowSetColumn* pColumn = new ORowSetColumn( xRowMetaData, - this, - i, - xMetaData, - aDescription, - m_aCurrentRow); - aColumns->get().push_back(pColumn); - pColumn->setName(*pIter); - aNames.push_back(*pIter); - m_aDataColumns.push_back(pColumn); - - pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_ALIGN,xColumn->getPropertyValue(PROPERTY_ALIGN)); - sal_Int32 nFormatKey = comphelper::getINT32(xColumn->getPropertyValue(PROPERTY_NUMBERFORMAT)); - if(!nFormatKey && xColumn.is() && m_xNumberFormatTypes.is()) - nFormatKey = ::dbtools::getDefaultNumberFormat(xColumn,m_xNumberFormatTypes,aLocale); - pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_NUMBERFORMAT,makeAny(nFormatKey)); - pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_RELATIVEPOSITION,xColumn->getPropertyValue(PROPERTY_RELATIVEPOSITION)); - pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_WIDTH,xColumn->getPropertyValue(PROPERTY_WIDTH)); - pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_HIDDEN,xColumn->getPropertyValue(PROPERTY_HIDDEN)); - pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_CONTROLMODEL,xColumn->getPropertyValue(PROPERTY_CONTROLMODEL)); - pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_HELPTEXT,xColumn->getPropertyValue(PROPERTY_HELPTEXT)); - pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_CONTROLDEFAULT,xColumn->getPropertyValue(PROPERTY_CONTROLDEFAULT)); - - } - m_pColumns = new ORowSetDataColumns(xMetaData.is() && xMetaData->supportsMixedCaseQuotedIdentifiers(), + + if ( rParent.m_pColumns ) + { + Sequence< ::rtl::OUString> aSeq = rParent.m_pColumns->getElementNames(); + const ::rtl::OUString* pIter = aSeq.getConstArray(); + const ::rtl::OUString* pEnd = pIter + aSeq.getLength(); + aColumns->get().reserve(aSeq.getLength()+1); + for(sal_Int32 i=1;pIter != pEnd ;++pIter,++i) + { + Reference<XPropertySet> xColumn; + rParent.m_pColumns->getByName(*pIter) >>= xColumn; + if(xColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_DESCRIPTION)) + aDescription = comphelper::getString(xColumn->getPropertyValue(PROPERTY_DESCRIPTION)); + + ORowSetColumn* pColumn = new ORowSetColumn( rParent.getMetaData(), + this, + i, + rParent.m_xActiveConnection->getMetaData(), + aDescription, + m_aCurrentRow); + aColumns->get().push_back(pColumn); + pColumn->setName(*pIter); + aNames.push_back(*pIter); + m_aDataColumns.push_back(pColumn); + + pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_ALIGN,xColumn->getPropertyValue(PROPERTY_ALIGN)); + sal_Int32 nFormatKey = comphelper::getINT32(xColumn->getPropertyValue(PROPERTY_NUMBERFORMAT)); + if(!nFormatKey && xColumn.is() && m_xNumberFormatTypes.is()) + nFormatKey = ::dbtools::getDefaultNumberFormat(xColumn,m_xNumberFormatTypes,aLocale); + pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_NUMBERFORMAT,makeAny(nFormatKey)); + pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_RELATIVEPOSITION,xColumn->getPropertyValue(PROPERTY_RELATIVEPOSITION)); + pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_WIDTH,xColumn->getPropertyValue(PROPERTY_WIDTH)); + pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_HIDDEN,xColumn->getPropertyValue(PROPERTY_HIDDEN)); + pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_CONTROLMODEL,xColumn->getPropertyValue(PROPERTY_CONTROLMODEL)); + pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_HELPTEXT,xColumn->getPropertyValue(PROPERTY_HELPTEXT)); + pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_CONTROLDEFAULT,xColumn->getPropertyValue(PROPERTY_CONTROLDEFAULT)); + + } // for(sal_Int32 i=1;pIter != pEnd ;++pIter,++i) + } + Reference<XDatabaseMetaData> xMeta = rParent.m_xActiveConnection->getMetaData(); + m_pColumns = new ORowSetDataColumns(xMeta.is() && xMeta->supportsMixedCaseQuotedIdentifiers(), aColumns,*this,m_aMutex,aNames); sal_Int32 nRT = PropertyAttribute::READONLY | PropertyAttribute::TRANSIENT; diff --git a/dbaccess/source/core/api/RowSet.hxx b/dbaccess/source/core/api/RowSet.hxx index 843f970bcae5..b36608f1c495 100644 --- a/dbaccess/source/core/api/RowSet.hxx +++ b/dbaccess/source/core/api/RowSet.hxx @@ -131,6 +131,7 @@ namespace dbaccess (since we have not been executed, yet) */ ORowSetValueVector m_aPrematureParamValues; + ::std::bit_vector m_aParametersSet; ::cppu::OInterfaceContainerHelper m_aRowsetListeners; ::cppu::OInterfaceContainerHelper m_aApproveListeners; diff --git a/dbaccess/source/core/api/tablecontainer.cxx b/dbaccess/source/core/api/tablecontainer.cxx index 59737c5fc5d3..7067cf50fce9 100644 --- a/dbaccess/source/core/api/tablecontainer.cxx +++ b/dbaccess/source/core/api/tablecontainer.cxx @@ -66,6 +66,9 @@ #ifndef TOOLS_DIAGNOSE_EX_H #include <tools/diagnose_ex.h> #endif +#ifndef TOOLS_DIAGNOSE_EX_H +#include <tools/diagnose_ex.h> +#endif using namespace dbaccess; using namespace dbtools; @@ -164,6 +167,7 @@ void OTableContainer::removeMasterContainerListener() // XServiceInfo //------------------------------------------------------------------------------ IMPLEMENT_SERVICE_INFO2(OTableContainer, "com.sun.star.sdb.dbaccess.OTableContainer", SERVICE_SDBCX_CONTAINER, SERVICE_SDBCX_TABLES) + // ----------------------------------------------------------------------------- namespace { diff --git a/dbaccess/source/core/inc/DatabaseDataProvider.hxx b/dbaccess/source/core/inc/DatabaseDataProvider.hxx index 68d67808e921..2e3d43443b88 100644 --- a/dbaccess/source/core/inc/DatabaseDataProvider.hxx +++ b/dbaccess/source/core/inc/DatabaseDataProvider.hxx @@ -202,10 +202,11 @@ private: virtual void SAL_CALL disposing(); void impl_fillRowSet_throw(); - void impl_executeRowSet_nothrow(::osl::ResettableMutexGuard& _rClearForNotifies); + void impl_executeRowSet_throw(::osl::ResettableMutexGuard& _rClearForNotifies); bool impl_fillParameters_nothrow( ::osl::ResettableMutexGuard& _rClearForNotifies); - void impl_fillInternalDataProvider_throw(); + void impl_fillInternalDataProvider_throw(sal_Bool _bHasCategories); void impl_invalidateParameter_nothrow(); + ::com::sun::star::uno::Any impl_getNumberFormatKey_nothrow(const ::rtl::OUString & _sRangeRepresentation) const; template <typename T> void set( const ::rtl::OUString& _sProperty ,const T& _Value @@ -214,14 +215,18 @@ private: BoundListeners l; { ::osl::MutexGuard aGuard(m_aMutex); - prepareSet(_sProperty, ::com::sun::star::uno::makeAny(_member), ::com::sun::star::uno::makeAny(_Value), &l); - _member = _Value; + if ( _member != _Value ) + { + prepareSet(_sProperty, ::com::sun::star::uno::makeAny(_member), ::com::sun::star::uno::makeAny(_Value), &l); + _member = _Value; + } } l.notify(); } ::dbtools::ParameterManager m_aParameterManager; ::dbtools::FilterManager m_aFilterManager; + ::std::map< ::rtl::OUString, ::com::sun::star::uno::Any> m_aNumberFormats; ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext; ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > m_xActiveConnection; diff --git a/dbaccess/source/core/misc/DatabaseDataProvider.cxx b/dbaccess/source/core/misc/DatabaseDataProvider.cxx index 33c437f970b9..cd16eb68a5ee 100644 --- a/dbaccess/source/core/misc/DatabaseDataProvider.cxx +++ b/dbaccess/source/core/misc/DatabaseDataProvider.cxx @@ -43,6 +43,8 @@ #include <com/sun/star/sdb/CommandType.hpp> #include <com/sun/star/sdbc/XRow.hpp> #include <com/sun/star/sdbc/XResultSet.hpp> +#include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp> +#include <com/sun/star/sdbc/XResultSetMetaData.hpp> #include <com/sun/star/beans/NamedValue.hpp> #include <com/sun/star/chart/ChartDataRowSource.hpp> #include <com/sun/star/chart/XChartDataArray.hpp> @@ -57,12 +59,6 @@ using ::com::sun::star::sdbc::SQLException; using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::RuntimeException; // ----------------------------------------------------------------------------- -::rtl::OUString lcl_getLabel() -{ - static const ::rtl::OUString s_sLabel(RTL_CONSTASCII_USTRINGPARAM("label ")); - return s_sLabel; -} -// ----------------------------------------------------------------------------- DatabaseDataProvider::DatabaseDataProvider(uno::Reference< uno::XComponentContext > const & context) : TDatabaseDataProvider(m_aMutex), ::cppu::PropertySetMixin< chart2::data::XDatabaseDataProvider >( @@ -74,7 +70,7 @@ DatabaseDataProvider::DatabaseDataProvider(uno::Reference< uno::XComponentContex m_CommandType(sdb::CommandType::COMMAND), // #i94114 m_RowLimit(0), m_EscapeProcessing(sal_True), - m_ApplyFilter(sal_False) + m_ApplyFilter(sal_True) { m_xInternal.set( m_xContext->getServiceManager()->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.chart.InternalDataProvider")),m_xContext ), uno::UNO_QUERY ); m_xRangeConversion.set(m_xInternal,uno::UNO_QUERY); @@ -171,48 +167,87 @@ void SAL_CALL DatabaseDataProvider::initialize(const uno::Sequence< uno::Any > & // ----------------------------------------------------------------------------- // chart2::data::XDataProvider: -::sal_Bool SAL_CALL DatabaseDataProvider::createDataSourcePossible(const uno::Sequence< beans::PropertyValue > & /*aArguments*/) throw (uno::RuntimeException) +::sal_Bool SAL_CALL DatabaseDataProvider::createDataSourcePossible(const uno::Sequence< beans::PropertyValue > & _aArguments) throw (uno::RuntimeException) { - ::osl::ResettableMutexGuard aClearForNotifies(m_aMutex); - bool bRet = false; - if ( m_Command.getLength() != 0 && m_xActiveConnection.is() ) + //::osl::ResettableMutexGuard aClearForNotifies(m_aMutex); + const beans::PropertyValue* pArgIter = _aArguments.getConstArray(); + const beans::PropertyValue* pArgEnd = pArgIter + _aArguments.getLength(); + for(;pArgIter != pArgEnd;++pArgIter) { - try + if ( pArgIter->Name.equalsAscii("DataRowSource") ) { - impl_fillRowSet_throw(); - impl_executeRowSet_nothrow(aClearForNotifies); - impl_fillInternalDataProvider_throw(); - bRet = true; - } - catch(const uno::Exception& /*e*/) + ::com::sun::star::chart::ChartDataRowSource eRowSource = ::com::sun::star::chart::ChartDataRowSource_COLUMNS; + pArgIter->Value >>= eRowSource; + if ( eRowSource != ::com::sun::star::chart::ChartDataRowSource_COLUMNS ) + return sal_False; + } // if ( pArgIter->Name.equalsAscii("DataRowSource") ) + else if ( pArgIter->Name.equalsAscii("CellRangeRepresentation") ) { + ::rtl::OUString sRange; + pArgIter->Value >>= sRange; + if ( !sRange.equalsAscii("all") ) + return sal_False; } - } - if ( !bRet ) // no command set or an error occured, use Internal data handler - { - uno::Reference< lang::XInitialization> xIni(m_xInternal,uno::UNO_QUERY); - if ( xIni.is() ) + else if ( pArgIter->Name.equalsAscii("FirstCellAsLabel") ) { - uno::Sequence< uno::Any > aArgs(1); - beans::NamedValue aParam(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CreateDefaultData")),uno::makeAny(sal_True)); - aArgs[0] <<= aParam; - xIni->initialize(aArgs); + sal_Bool bFirstCellAsLabel = sal_True; + pArgIter->Value >>= bFirstCellAsLabel; + if ( !bFirstCellAsLabel ) + return sal_False; } } - - return bRet; + return sal_True; } // ----------------------------------------------------------------------------- // ----------------------------------------------------------------------------- uno::Reference< chart2::data::XDataSource > SAL_CALL DatabaseDataProvider::createDataSource(const uno::Sequence< beans::PropertyValue > & _aArguments) throw (uno::RuntimeException, lang::IllegalArgumentException) { - osl::MutexGuard g(m_aMutex); - createDataSourcePossible(_aArguments); + osl::ResettableMutexGuard aClearForNotifies(m_aMutex); + if ( createDataSourcePossible(_aArguments) ) + { + sal_Bool bHasCategories = sal_True; + const beans::PropertyValue* pArgIter = _aArguments.getConstArray(); + const beans::PropertyValue* pArgEnd = pArgIter + _aArguments.getLength(); + for(;pArgIter != pArgEnd;++pArgIter) + { + if ( pArgIter->Name.equalsAscii("HasCategories") ) + { + pArgIter->Value >>= bHasCategories; + break; + } + } + bool bRet = false; + if ( m_Command.getLength() != 0 && m_xActiveConnection.is() ) + { + try + { + impl_fillRowSet_throw(); + impl_executeRowSet_throw(aClearForNotifies); + impl_fillInternalDataProvider_throw(bHasCategories); + bRet = true; + } + catch(const uno::Exception& /*e*/) + { + } + } + if ( !bRet ) // no command set or an error occured, use Internal data handler + { + uno::Reference< lang::XInitialization> xIni(m_xInternal,uno::UNO_QUERY); + if ( xIni.is() ) + { + uno::Sequence< uno::Any > aArgs(1); + beans::NamedValue aParam(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CreateDefaultData")),uno::makeAny(sal_True)); + aArgs[0] <<= aParam; + xIni->initialize(aArgs); + } + } + + } return m_xInternal->createDataSource(_aArguments); } // ----------------------------------------------------------------------------- -uno::Sequence< beans::PropertyValue > SAL_CALL DatabaseDataProvider::detectArguments(const uno::Reference< chart2::data::XDataSource > & /*xDataSource*/) throw (uno::RuntimeException) +uno::Sequence< beans::PropertyValue > SAL_CALL DatabaseDataProvider::detectArguments(const uno::Reference< chart2::data::XDataSource > & _xDataSource) throw (uno::RuntimeException) { uno::Sequence< beans::PropertyValue > aArguments( 4 ); aArguments[0] = beans::PropertyValue( @@ -224,8 +259,30 @@ uno::Sequence< beans::PropertyValue > SAL_CALL DatabaseDataProvider::detectArgum // internal data always contains labels and categories aArguments[2] = beans::PropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FirstCellAsLabel")), -1, uno::makeAny( true ), beans::PropertyState_DIRECT_VALUE ); + sal_Bool bHasCategories = sal_False; + if( _xDataSource.is()) + { + uno::Sequence< uno::Reference< chart2::data::XLabeledDataSequence > > aSequences(_xDataSource->getDataSequences()); + const sal_Int32 nCount( aSequences.getLength()); + for( sal_Int32 nIdx=0; nIdx<nCount; ++nIdx ) + { + if( aSequences[nIdx].is() ) + { + uno::Reference< beans::XPropertySet > xSeqProp( aSequences[nIdx]->getValues(), uno::UNO_QUERY ); + ::rtl::OUString aRole; + if( xSeqProp.is() && + (xSeqProp->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Role"))) >>= aRole) && + aRole.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("categories")) ) + { + bHasCategories = sal_True; + break; + } + } + } + } + aArguments[3] = beans::PropertyValue( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HasCategories")), -1, uno::makeAny( true ), beans::PropertyState_DIRECT_VALUE ); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HasCategories")), -1, uno::makeAny( bHasCategories ), beans::PropertyState_DIRECT_VALUE ); return aArguments; } // ----------------------------------------------------------------------------- @@ -235,11 +292,25 @@ uno::Sequence< beans::PropertyValue > SAL_CALL DatabaseDataProvider::detectArgum return sal_True; } // ----------------------------------------------------------------------------- - +uno::Any DatabaseDataProvider::impl_getNumberFormatKey_nothrow(const ::rtl::OUString & _sRangeRepresentation) const +{ + ::std::map< ::rtl::OUString,com::sun::star::uno::Any>::const_iterator aFind = m_aNumberFormats.find(_sRangeRepresentation); + if ( aFind != m_aNumberFormats.end() ) + return aFind->second; + return uno::makeAny(sal_Int32(0)); +} +// ----------------------------------------------------------------------------- uno::Reference< chart2::data::XDataSequence > SAL_CALL DatabaseDataProvider::createDataSequenceByRangeRepresentation(const ::rtl::OUString & _sRangeRepresentation) throw (uno::RuntimeException, lang::IllegalArgumentException) { osl::MutexGuard g(m_aMutex); - return m_xInternal->createDataSequenceByRangeRepresentation(_sRangeRepresentation); + uno::Reference< chart2::data::XDataSequence > xData = m_xInternal->createDataSequenceByRangeRepresentation(_sRangeRepresentation);; + uno::Reference<beans::XPropertySet> xProp(xData,uno::UNO_QUERY); + const static ::rtl::OUString s_sNumberFormatKey(RTL_CONSTASCII_USTRINGPARAM("NumberFormatKey")); + if ( xProp.is() && xProp->getPropertySetInfo()->hasPropertyByName(s_sNumberFormatKey) ) + { + xProp->setPropertyValue(s_sNumberFormatKey,impl_getNumberFormatKey_nothrow(_sRangeRepresentation)); + } + return xData; } // ----------------------------------------------------------------------------- @@ -499,19 +570,13 @@ void SAL_CALL DatabaseDataProvider::setDataSourceName(const ::rtl::OUString& the set(PROPERTY_DATASOURCENAME,the_value,m_DataSourceName); } // ----------------------------------------------------------------------------- -void DatabaseDataProvider::impl_executeRowSet_nothrow(::osl::ResettableMutexGuard& _rClearForNotifies) +void DatabaseDataProvider::impl_executeRowSet_throw(::osl::ResettableMutexGuard& _rClearForNotifies) { - try - { - if ( impl_fillParameters_nothrow(_rClearForNotifies) ) - m_xRowSet->execute(); - } - catch(const uno::Exception&) - { - } + if ( impl_fillParameters_nothrow(_rClearForNotifies) ) + m_xRowSet->execute(); } // ----------------------------------------------------------------------------- -void DatabaseDataProvider::impl_fillInternalDataProvider_throw() +void DatabaseDataProvider::impl_fillInternalDataProvider_throw(sal_Bool _bHasCategories) { // clear the data before fill the new one uno::Reference< chart::XChartDataArray> xChartData(m_xInternal,uno::UNO_QUERY); @@ -522,31 +587,57 @@ void DatabaseDataProvider::impl_fillInternalDataProvider_throw() m_xInternal->deleteSequence(0); } - uno::Sequence< ::rtl::OUString > aColumns = ::dbtools::getFieldNamesByCommandDescriptor(getActiveConnection() - ,getCommandType() - ,m_Command); - + uno::Sequence< ::rtl::OUString > aColumns; + uno::Reference< sdbcx::XColumnsSupplier> xColSup(m_xRowSet,uno::UNO_QUERY_THROW); + uno::Reference< container::XNameAccess > xColumns = xColSup->getColumns(); + if ( xColumns.is() ) + aColumns = xColumns->getElementNames(); // fill the data uno::Reference< sdbc::XResultSet> xRes(m_xRowSet,uno::UNO_QUERY_THROW); uno::Reference< sdbc::XRow> xRow(m_xRowSet,uno::UNO_QUERY_THROW); + uno::Reference< sdbc::XResultSetMetaData> xResultSetMetaData = uno::Reference< sdbc::XResultSetMetaDataSupplier>(m_xRowSet,uno::UNO_QUERY)->getMetaData(); + ::std::vector<sal_Int32> aColumnTypes; uno::Sequence< uno::Any > aLabelArgs(1); const sal_Int32 nCount = aColumns.getLength(); + if ( nCount ) + aColumnTypes.push_back(xResultSetMetaData->getColumnType(1)); for (sal_Int32 i = 1; i < nCount; ++i) { - aLabelArgs[0] <<= aColumns[i]; // i == 0 is the category - const ::rtl::OUString sLabelRange = lcl_getLabel() + ::rtl::OUString::valueOf(i - 1); - m_xInternal->setDataByRangeRepresentation(sLabelRange,aLabelArgs); + aColumnTypes.push_back(xResultSetMetaData->getColumnType(i+1)); + } // for (sal_Int32 i = 1; i < nCount; ++i) + + const ::rtl::OUString* pIter = aColumns.getConstArray(); + const ::rtl::OUString* pEnd = pIter + aColumns.getLength(); + for(sal_Int32 k = 0;pIter != pEnd;++pIter,++k) + { + uno::Reference< beans::XPropertySet> xColumn(xColumns->getByName(*pIter),uno::UNO_QUERY); + if ( xColumn.is() ) + { + m_aNumberFormats.insert( ::std::map< ::rtl::OUString,uno::Any>::value_type(::rtl::OUString::valueOf(k),xColumn->getPropertyValue(PROPERTY_NUMBERFORMAT))); + } } - ::std::vector< ::std::vector< uno::Any > > aDataValues(nCount); + ::std::vector< ::rtl::OUString > aRowLabels; + ::std::vector< ::std::vector< double > > aDataValues; sal_Int32 nRowCount = 0; + ::connectivity::ORowSetValue aValue; while( xRes->next() && (!m_RowLimit || nRowCount < m_RowLimit) ) { ++nRowCount; - for (sal_Int32 j = 1; j <= nCount; ++j) - aDataValues[j-1].push_back(uno::makeAny(xRow->getString(j))); + + aValue.fill(1,aColumnTypes[0],xRow); + aRowLabels.push_back(aValue.getString()); + ::std::vector< double > aRow; + for (sal_Int32 j = _bHasCategories ? 2 : 1,i = 0; j <= nCount; ++j,++i) + { + aValue.fill(j,aColumnTypes[j-1],xRow); + aRow.push_back(aValue.getDouble()); + } // for (sal_Int32 j = 2,i = 0; j <= nCount; ++j,++i) + aDataValues.push_back(aRow); } // while( xRes->next() && (!m_RowLimit || nRowCount < m_RowLimit) ) + + // insert default data when no rows exist if ( !nRowCount ) { nRowCount = 3; @@ -555,30 +646,33 @@ void DatabaseDataProvider::impl_fillInternalDataProvider_throw() 2.40, 8.80, 9.65, 3.10, 1.50, 3.70, 4.30, 9.02, 6.20 }; - for (sal_Int32 j = 1,k = 0; j <= nCount; ++j,++k) + for(sal_Int32 h = 0,k = 0; h < nRowCount; ++h,++k ) { - sal_Int32 nSize = sizeof(fDefaultData)/sizeof(fDefaultData[0]); - if ( k >= nSize ) - k = 0; - aDataValues[j-1].push_back(uno::makeAny(fDefaultData[k])); - } - } - ::std::vector< ::std::vector< uno::Any > >::iterator aDataValuesIter = aDataValues.begin(); - const ::std::vector< ::std::vector< uno::Any > >::iterator aDataValuesEnd = aDataValues.end(); - bool bFirst = true; - for (sal_Int32 nPos = 0;nRowCount && aDataValuesIter != aDataValuesEnd ; ++aDataValuesIter,++nPos) - { - if ( !aDataValuesIter->empty() ) - { - if ( bFirst ) + aRowLabels.push_back(::rtl::OUString::valueOf(h+1)); + ::std::vector< double > aRow; + const sal_Int32 nSize = sizeof(fDefaultData)/sizeof(fDefaultData[0]); + for (sal_Int32 j = 0; j < (nCount-1); ++j,++k) { - m_xInternal->setDataByRangeRepresentation(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("categories")),uno::Sequence< uno::Any >(&(*aDataValuesIter->begin()),aDataValuesIter->size())); - bFirst = false; - } - else - m_xInternal->setDataByRangeRepresentation(::rtl::OUString::valueOf(nPos-1),uno::Sequence< uno::Any >(&(*aDataValuesIter->begin()),aDataValuesIter->size())); + if ( k >= nSize ) + k = 0; + aRow.push_back(fDefaultData[k]); + } // for (sal_Int32 j = 0,k = 0; j < (nCount-1); ++j,++k) + aDataValues.push_back(aRow); } - } // for (sal_Int32 nPos = 0;nRowCount && aDataValuesIter != aDataValuesEnd ; ++aDataValuesIter,++nPos) + } // if ( !nRowCount ) + + uno::Reference< chart::XChartDataArray> xData(m_xInternal,uno::UNO_QUERY); + xData->setRowDescriptions(uno::Sequence< ::rtl::OUString >(&(*aRowLabels.begin()),aRowLabels.size())); + xData->setColumnDescriptions(uno::Sequence< ::rtl::OUString >(aColumns.getArray()+ (_bHasCategories ? 1 : 0),aColumns.getLength() - (_bHasCategories ? 1 : 0) )); + uno::Sequence< uno::Sequence< double > > aData(aDataValues.size()); + uno::Sequence< double >* pDataIter = aData.getArray(); + uno::Sequence< double >* pDataEnd = pDataIter + aData.getLength(); + for(sal_Int32 i= 0;pDataIter != pDataEnd; ++pDataIter,++i ) + { + if ( !aDataValues[i].empty() ) + *pDataIter = uno::Sequence< double >(&(*(aDataValues[i]).begin()),(aDataValues[i]).size()); + } + xData->setData(aData); } // ----------------------------------------------------------------------------- void DatabaseDataProvider::impl_fillRowSet_throw() @@ -743,7 +837,7 @@ void SAL_CALL DatabaseDataProvider::clearParameters() throw( SQLException, Runti void SAL_CALL DatabaseDataProvider::execute() throw( SQLException, RuntimeException ) { uno::Sequence< beans::PropertyValue > aEmpty; - createDataSourcePossible(aEmpty); + createDataSource(aEmpty); } //------------------------------------------------------------------------------ void SAL_CALL DatabaseDataProvider::addRowSetListener(const uno::Reference<sdbc::XRowSetListener>& _rListener) throw( RuntimeException ) @@ -886,4 +980,3 @@ void DatabaseDataProvider::impl_invalidateParameter_nothrow() } // ----------------------------------------------------------------------------- } // namespace dbaccess - diff --git a/dbaccess/source/ext/macromigration/makefile.mk b/dbaccess/source/ext/macromigration/makefile.mk index 880a62afc173..32be89263968 100644 --- a/dbaccess/source/ext/macromigration/makefile.mk +++ b/dbaccess/source/ext/macromigration/makefile.mk @@ -79,7 +79,8 @@ SHL1STDLIBS= \ $(SVLLIB) \ $(VCLLIB) \ $(SVXLIB) \ - $(UCBHELPERLIB) + $(UCBHELPERLIB) \ + $(XMLSCRIPTLIB) SHL1LIBS= $(SLB)$/$(TARGET).lib SHL1IMPLIB= i$(TARGET) diff --git a/dbaccess/source/ext/macromigration/migrationengine.cxx b/dbaccess/source/ext/macromigration/migrationengine.cxx index acb3cfcfca22..c1d1c41eca39 100644 --- a/dbaccess/source/ext/macromigration/migrationengine.cxx +++ b/dbaccess/source/ext/macromigration/migrationengine.cxx @@ -68,6 +68,8 @@ #include <com/sun/star/script/XEventAttacherManager.hpp> #include <com/sun/star/script/XLibraryContainerPassword.hpp> #include <com/sun/star/io/WrongFormatException.hpp> +#include <com/sun/star/script/XScriptEventsSupplier.hpp> +#include <com/sun/star/io/XInputStreamProvider.hpp> /** === end UNO includes === **/ #include <comphelper/documentinfo.hxx> @@ -82,6 +84,7 @@ #include <rtl/ustrbuf.hxx> #include <rtl/ref.hxx> #include <unotools/sharedunocomponent.hxx> +#include <xmlscript/xmldlg_imexp.hxx> #include <vector> #include <set> @@ -143,6 +146,9 @@ namespace dbmm using ::com::sun::star::script::ScriptEventDescriptor; using ::com::sun::star::script::XLibraryContainerPassword; using ::com::sun::star::io::WrongFormatException; + using ::com::sun::star::script::XScriptEventsSupplier; + using ::com::sun::star::io::XInputStreamProvider; + using ::com::sun::star::io::XInputStream; /** === end UNO using === **/ namespace ElementModes = ::com::sun::star::embed::ElementModes; @@ -925,6 +931,23 @@ namespace dbmm const PhaseID _nPhaseID ) const; + /** adjusts the events for the given dialog/element, taking into account the new names + of the moved libraries + */ + void impl_adjustDialogElementEvents_throw( + const Reference< XInterface >& _rxElement + ) const; + + /** adjusts the events in the given dialog, and its controls, taking into account the new names + of the moved libraries + */ + bool impl_adjustDialogEvents_nothrow( + Any& _inout_rDialogLibraryElement, + const ::rtl::OUString& _rDocName, + const ::rtl::OUString& _rDialogLibName, + const ::rtl::OUString& _rDialogName + ) const; + /** adjust the document-events which refer to macros/scripts in the document, taking into account the new names of the moved libraries */ @@ -1158,6 +1181,8 @@ namespace dbmm bSuccess = bSuccess && impl_migrateContainerLibraries_nothrow( aSubDocument, eBasic, aProgressMixer, PHASE_BASIC ) && impl_migrateContainerLibraries_nothrow( aSubDocument, eDialog, aProgressMixer, PHASE_DIALOGS ); + // order matters: First Basic scripts, then dialogs. So we can adjust references from the latter + // to the former // adjust the events in the document // (note that errors are ignored here - failure to convert a script reference @@ -1547,6 +1572,14 @@ namespace dbmm Any aElement = xSourceLib->getByName( *pSourceElementName ); OSL_ENSURE( aElement.hasValue(), "MigrationEngine_Impl::impl_migrateContainerLibraries_nothrow: invalid (empty) lib element!" ); + + // if this is a dialog, adjust the references to scripts + if ( _eScriptType == eDialog ) + { + impl_adjustDialogEvents_nothrow( aElement, lcl_getSubDocumentDescription( _rDocument ), + *pSourceLibName, *pSourceElementName ); + } + xTargetLib->insertByName( *pSourceElementName, aElement ); } @@ -1773,6 +1806,71 @@ namespace dbmm } //-------------------------------------------------------------------- + void MigrationEngine_Impl::impl_adjustDialogElementEvents_throw( const Reference< XInterface >& _rxElement ) const + { + Reference< XScriptEventsSupplier > xEventsSupplier( _rxElement, UNO_QUERY_THROW ); + Reference< XNameReplace > xEvents( xEventsSupplier->getEvents(), UNO_QUERY_THROW ); + Sequence< ::rtl::OUString > aEventNames( xEvents->getElementNames() ); + + const ::rtl::OUString* eventName = aEventNames.getArray(); + const ::rtl::OUString* eventNamesEnd = eventName + aEventNames.getLength(); + + ScriptEventDescriptor aScriptEvent; + for ( ; eventName != eventNamesEnd; ++eventName ) + { + OSL_VERIFY( xEvents->getByName( *eventName ) >>= aScriptEvent ); + + if ( !impl_adjustScriptLibrary_nothrow( aScriptEvent ) ) + continue; + + xEvents->replaceByName( *eventName, makeAny( aScriptEvent ) ); + } + } + + //-------------------------------------------------------------------- + bool MigrationEngine_Impl::impl_adjustDialogEvents_nothrow( Any& _inout_rDialogLibraryElement, + const ::rtl::OUString& _rDocName, const ::rtl::OUString& _rDialogLibName, const ::rtl::OUString& _rDialogName ) const + { + try + { + // load a dialog model from the stream describing it + Reference< XInputStreamProvider > xISP( _inout_rDialogLibraryElement, UNO_QUERY_THROW ); + Reference< XInputStream > xInput( xISP->createInputStream(), UNO_QUERY_THROW ); + + Reference< XNameContainer > xDialogModel( m_aContext.createComponent( "com.sun.star.awt.UnoControlDialogModel" ), UNO_QUERY_THROW ); + ::xmlscript::importDialogModel( xInput, xDialogModel, m_aContext.getUNOContext() ); + + // adjust the events of the dialog + impl_adjustDialogElementEvents_throw( xDialogModel ); + + // adjust the events of the controls + Sequence< ::rtl::OUString > aControlNames( xDialogModel->getElementNames() ); + const ::rtl::OUString* controlName = aControlNames.getConstArray(); + const ::rtl::OUString* controlNamesEnd = controlName + aControlNames.getLength(); + for ( ; controlName != controlNamesEnd; ++controlName ) + { + impl_adjustDialogElementEvents_throw( Reference< XInterface >( xDialogModel->getByName( *controlName ), UNO_QUERY ) ); + } + + // export dialog model + xISP = ::xmlscript::exportDialogModel( xDialogModel, m_aContext.getUNOContext() ); + _inout_rDialogLibraryElement <<= xISP; + } + catch( const Exception& ) + { + m_rLogger.logRecoverable( MigrationError( + ERR_ADJUSTING_DIALOG_EVENTS_FAILED, + _rDocName, + _rDialogLibName, + _rDialogName, + ::cppu::getCaughtException() + ) ); + return false; + } + return true; + } + + //-------------------------------------------------------------------- void MigrationEngine_Impl::impl_adjustFormComponentEvents_throw( const Reference< XIndexAccess >& _rxComponentContainer ) const { FormComponentIterator aCompIter( _rxComponentContainer ); diff --git a/dbaccess/source/ext/macromigration/migrationerror.hxx b/dbaccess/source/ext/macromigration/migrationerror.hxx index 84b972f0e9bf..fa7e058a5622 100644 --- a/dbaccess/source/ext/macromigration/migrationerror.hxx +++ b/dbaccess/source/ext/macromigration/migrationerror.hxx @@ -59,6 +59,7 @@ namespace dbmm ERR_SCRIPT_TRANSLATION_FAILURE, ERR_INVALID_SCRIPT_DESCRIPTOR_FORMAT, ERR_ADJUSTING_DOCUMENT_EVENTS_FAILED, + ERR_ADJUSTING_DIALOG_EVENTS_FAILED, ERR_ADJUSTING_FORMCOMP_EVENTS_FAILED, ERR_BIND_SCRIPT_STORAGE_FAILED, ERR_REMOVE_SCRIPTS_STORAGE_FAILED, @@ -136,6 +137,18 @@ namespace dbmm const MigrationErrorType _eType, const ::rtl::OUString& _rDetail1, const ::rtl::OUString& _rDetail2, + const ::rtl::OUString& _rDetail3, + const ::com::sun::star::uno::Any& _rCaughtException ) + :eType( _eType ) + ,aCaughtException( _rCaughtException ) + { + impl_constructDetails( _rDetail1, _rDetail2, _rDetail3 ); + } + + MigrationError( + const MigrationErrorType _eType, + const ::rtl::OUString& _rDetail1, + const ::rtl::OUString& _rDetail2, const ::rtl::OUString& _rDetail3 ) :eType( _eType ) { diff --git a/dbaccess/source/ext/macromigration/migrationlog.cxx b/dbaccess/source/ext/macromigration/migrationlog.cxx index 1b22367857aa..0d3cb09427b8 100644 --- a/dbaccess/source/ext/macromigration/migrationlog.cxx +++ b/dbaccess/source/ext/macromigration/migrationlog.cxx @@ -329,6 +329,13 @@ namespace dbmm aAsciiParameterNames.push_back( "#doc#" ); break; + case ERR_ADJUSTING_DIALOG_EVENTS_FAILED: + pAsciiErrorDescription = "adjusting events for dialog #lib#.#dlg# in document '#doc#' failed"; + aAsciiParameterNames.push_back( "#doc#" ); + aAsciiParameterNames.push_back( "#lib#" ); + aAsciiParameterNames.push_back( "#dlg#" ); + break; + case ERR_ADJUSTING_FORMCOMP_EVENTS_FAILED: pAsciiErrorDescription = "adjusting form component events for '#doc#' failed"; aAsciiParameterNames.push_back( "#doc#" ); diff --git a/dbaccess/source/ui/app/AppControllerGen.cxx b/dbaccess/source/ui/app/AppControllerGen.cxx index 2570822ca6e2..0b1be1189bd4 100644 --- a/dbaccess/source/ui/app/AppControllerGen.cxx +++ b/dbaccess/source/ui/app/AppControllerGen.cxx @@ -619,7 +619,7 @@ void OApplicationController::onDocumentOpened( const ::rtl::OUString& _rName, co try { - m_pSubComponentManager->onSubComponentOpened( _rName, _nType, _eMode, _xDocument ); + m_pSubComponentManager->onSubComponentOpened( _rName, _nType, _eMode, _rxDefinition.is() ? _rxDefinition : _xDocument ); if ( _rxDefinition.is() ) { diff --git a/dbaccess/source/ui/app/subcomponentmanager.cxx b/dbaccess/source/ui/app/subcomponentmanager.cxx index 59a552ffc7cf..8ef4f77f20c7 100644 --- a/dbaccess/source/ui/app/subcomponentmanager.cxx +++ b/dbaccess/source/ui/app/subcomponentmanager.cxx @@ -36,6 +36,8 @@ #include <com/sun/star/frame/XModel2.hpp> #include <com/sun/star/util/XCloseable.hpp> #include <com/sun/star/awt/XTopWindow.hpp> +#include <com/sun/star/embed/XComponentSupplier.hpp> +#include <com/sun/star/ucb/XCommandProcessor.hpp> #include <com/sun/star/document/XDocumentEventBroadcaster.hpp> /** === end UNO includes === **/ @@ -73,6 +75,9 @@ namespace dbaui using ::com::sun::star::container::XEnumeration; using ::com::sun::star::util::XCloseable; using ::com::sun::star::awt::XTopWindow; + using ::com::sun::star::embed::XComponentSupplier; + using ::com::sun::star::ucb::XCommandProcessor; + using ::com::sun::star::ucb::Command; using ::com::sun::star::document::XDocumentEventBroadcaster; /** === end UNO using === **/ @@ -84,11 +89,13 @@ namespace dbaui struct SubComponentDescriptor { /// the frame which the component resides in. Must not be <NULL/> - Reference< XFrame > xFrame; + Reference< XFrame > xFrame; /// the controller of the sub component. Must not be <NULL/> - Reference< XController > xController; + Reference< XController > xController; /// the model of the sub component. Might be <NULL/> - Reference< XModel > xModel; + Reference< XModel > xModel; + /// the document definition which holds the component, if any + Reference< XCommandProcessor > xComponentCommandProcessor; SubComponentDescriptor() :xFrame() @@ -99,28 +106,53 @@ namespace dbaui SubComponentDescriptor( const Reference< XComponent >& _rxComponent ) { - xModel.set( _rxComponent, UNO_QUERY ); + if ( !impl_constructFrom( _rxComponent ) ) + { + Reference< XComponentSupplier > xCompSupp( _rxComponent, UNO_QUERY_THROW ); + Reference< XComponent > xComponent( xCompSupp->getComponent(), UNO_QUERY_THROW ); + if ( !impl_constructFrom( xComponent ) ) + throw RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Illegal component type." ) ), NULL ); + xComponentCommandProcessor.set( _rxComponent, UNO_QUERY_THROW ); + } + } + + inline bool is() const { return xFrame.is(); } + private: + bool impl_constructFrom( const Reference< XComponent >& _rxComponent ) + { + // is it a model? + xModel.set( _rxComponent, UNO_QUERY ); if ( xModel.is() ) + { xController.set( xModel->getCurrentController(), UNO_SET_THROW ); - else - xController.set( _rxComponent, UNO_QUERY ); - - if ( xController.is() ) xFrame.set( xController->getFrame(), UNO_SET_THROW ); + } else - xFrame.set( _rxComponent, UNO_QUERY_THROW ); + { + // is it a controller? + xController.set( _rxComponent, UNO_QUERY ); + if ( xController.is() ) + { + xFrame.set( xController->getFrame(), UNO_SET_THROW ); + } + else + { + // is it a frame? + xFrame.set( _rxComponent, UNO_QUERY ); + if ( !xFrame.is() ) + return false; - // if the given component was a frame, then ensure we have a controller - if ( xFrame.is() && !xController.is() ) - xController.set( xFrame->getController(), UNO_SET_THROW ); + // ensure we have a controller + xController.set( xFrame->getController(), UNO_SET_THROW ); + } - // if the component was a frame or a controller, then check wether there is a model (not required) - if ( !xModel.is() ) + // check wether there is a model (not required) xModel.set( xController->getModel() ); - } + } - inline bool is() const { return xFrame.is(); } + return true; + } }; struct SelectSubComponent : public ::std::unary_function< SubComponentDescriptor, Reference< XComponent > > @@ -260,8 +292,32 @@ namespace dbaui } //---------------------------------------------------------------- + bool lcl_closeComponent( const Reference< XCommandProcessor >& _rxCommandProcessor ) + { + bool bSuccess = false; + try + { + Reference< XCommandProcessor > xCommandProcessor( _rxCommandProcessor, UNO_SET_THROW ); + sal_Int32 nCommandIdentifier = xCommandProcessor->createCommandIdentifier(); + + Command aCommand; + aCommand.Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "close" ) ); + xCommandProcessor->execute( aCommand, nCommandIdentifier, NULL ); + bSuccess = true; + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + return bSuccess; + } + + //---------------------------------------------------------------- bool lcl_closeComponent( const SubComponentDescriptor& _rComponent ) { + if ( _rComponent.xComponentCommandProcessor.is() ) + return lcl_closeComponent( _rComponent.xComponentCommandProcessor ); + Reference< XController > xController( _rComponent.xController ); OSL_ENSURE( xController.is(), "lcl_closeComponent: invalid controller!" ); diff --git a/dbaccess/source/ui/control/FieldDescControl.cxx b/dbaccess/source/ui/control/FieldDescControl.cxx index fad75416bb3c..a9c757a3cf70 100644 --- a/dbaccess/source/ui/control/FieldDescControl.cxx +++ b/dbaccess/source/ui/control/FieldDescControl.cxx @@ -37,111 +37,44 @@ #define ITEMID_LINEBREAK SID_ATTR_ALIGN_LINEBREAK #define ITEMID_MARGIN SID_ATTR_ALIGN_MARGIN -#ifndef DBAUI_FIELDDESCRIPTIONCONTROL_HXX #include "FieldDescControl.hxx" -#endif -#ifndef DBAUI_FIELDCONTROLS_HXX #include "FieldControls.hxx" -#endif -#ifndef _ZFORLIST_HXX //autogen -#define _ZFORLIST_DECLARE_TABLE // ohne das bekomme ich einen Compiler-Fehler in <svtools/zforlist.hxx> -#include <svtools/zforlist.hxx> -#endif -#ifndef _TOOLS_DEBUG_HXX #include <tools/debug.hxx> -#endif -#ifndef DBAUI_TABLEDESIGNHELPBAR_HXX +#include <tools/diagnose_ex.h> #include "TableDesignHelpBar.hxx" -#endif -#ifndef _SV_SCRBAR_HXX #include <vcl/scrbar.hxx> -#endif -#ifndef _SV_BUTTON_HXX #include <vcl/button.hxx> -#endif -#ifndef _SVX_NUMFMTSH_HXX -#include <svx/numfmtsh.hxx> -#endif -#ifndef _DBU_CONTROL_HRC_ -#include "dbu_control.hrc" -#endif -#ifndef _DBU_TBL_HRC_ -#include "dbu_tbl.hrc" -#endif - -#ifndef _SV_SVAPP_HXX #include <vcl/svapp.hxx> -#endif -#ifndef _SV_FIXED_HXX #include <vcl/fixed.hxx> -#endif -#ifndef _SV_MSGBOX_HXX #include <vcl/msgbox.hxx> -#endif -#ifndef _VECTOR_ #include <vector> -#endif -#ifndef DBAUI_FIELDDESCRIPTIONS_HXX #include "FieldDescriptions.hxx" -#endif -#ifndef _SFXITEMPOOL_HXX -#include <svtools/itempool.hxx> -#endif -#ifndef DBAUI_SBATTRDLG_HXX #include "dlgattr.hxx" -#endif -#ifndef _SVX_SVXIDS_HRC +#include <svx/numfmtsh.hxx> #include <svx/svxids.hrc> -#endif -#ifndef _SVX_ALGITEM_HXX #include <svx/algitem.hxx> -#endif -#ifndef _SFXRNGITEM_HXX +#include <svtools/itempool.hxx> +#define _ZFORLIST_DECLARE_TABLE // ohne das bekomme ich einen Compiler-Fehler in <svtools/zforlist.hxx> +#include <svtools/zforlist.hxx> #include <svtools/rngitem.hxx> -#endif -#ifndef _SFXINTITEM_HXX #include <svtools/intitem.hxx> -#endif -#ifndef _COM_SUN_STAR_LANG_XUNOTUNNEL_HPP_ +#include <svtools/numuno.hxx> +#include <svtools/transfer.hxx> #include <com/sun/star/lang/XUnoTunnel.hpp> -#endif -#ifndef _COM_SUN_STAR_UTIL_NUMBERFORMAT_HPP_ #include <com/sun/star/util/NumberFormat.hpp> -#endif -#ifndef _COM_SUN_STAR_UTIL_XNUMBERFORMATPREVIEWER_HPP_ #include <com/sun/star/util/XNumberFormatPreviewer.hpp> -#endif -#ifndef _COM_SUN_STAR_UTIL_XNUMBERFORMATTYPES_HPP_ #include <com/sun/star/util/XNumberFormatTypes.hpp> -#endif -#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_ #include <com/sun/star/beans/XPropertySet.hpp> -#endif -#ifndef DBAUI_ENUMTYPES_HXX #include "QEnumTypes.hxx" -#endif -#ifndef _DBA_DBACCESS_HELPID_HRC_ #include "dbaccess_helpid.hrc" -#endif -#ifndef _NUMUNO_HXX -#include <svtools/numuno.hxx> -#endif -#ifndef _CONNECTIVITY_DBTOOLS_HXX_ #include <connectivity/dbtools.hxx> -#endif -#ifndef _COMPHELPER_NUMBERS_HXX_ +#include <connectivity/dbconversion.hxx> #include <comphelper/numbers.hxx> -#endif -#ifndef DBAUI_TOOLS_HXX #include "UITools.hxx" -#endif #include <memory> -#ifndef _DBHELPER_DBCONVERSION_HXX_ -#include <connectivity/dbconversion.hxx> -#endif -#ifndef _TRANSFER_HXX -#include <svtools/transfer.hxx> -#endif +#include "dbu_control.hrc" +#include "dbu_tbl.hrc" + using namespace dbaui; using namespace dbtools; @@ -156,7 +89,6 @@ using namespace ::com::sun::star::util; // fuer die Controls auf der OFieldDescGenPage #define CONTROL_SPACING_X 18 // 6 #define CONTROL_SPACING_Y 4 -#define CONTROL_HEIGHT 10 #define CONTROL_WIDTH_1 160 // 100 #define CONTROL_WIDTH_2 100 // 60 #define CONTROL_WIDTH_3 250 @@ -185,6 +117,20 @@ namespace return nValue; } // ----------------------------------------------------------------------------- + template< typename T1, typename T2> void lcl_HideAndDeleteControl(short& _nPos,T1** _pControl,T2** _pControlText) + { + if ( *_pControl ) + { + --_nPos; + (*_pControl)->Hide(); + (*_pControlText)->Hide(); + delete *_pControl; + delete *_pControlText; + (*_pControl) = NULL; + (*_pControlText) = NULL; + } + } + } //================================================================== @@ -241,22 +187,7 @@ OFieldDescControl::OFieldDescControl( Window* pParent, const ResId& rResId, OTab { DBG_CTOR(OFieldDescControl,NULL); - m_pVertScroll = new ScrollBar(this, WB_VSCROLL | WB_REPEAT | WB_DRAG); - m_pHorzScroll = new ScrollBar(this, WB_HSCROLL | WB_REPEAT | WB_DRAG); - m_pVertScroll->SetScrollHdl(LINK(this, OFieldDescControl, OnScroll)); - m_pHorzScroll->SetScrollHdl(LINK(this, OFieldDescControl, OnScroll)); - m_pVertScroll->Show(); - m_pHorzScroll->Show(); - - m_pVertScroll->EnableClipSiblings(); - m_pHorzScroll->EnableClipSiblings(); - - m_pVertScroll->SetLineSize(1); - m_pVertScroll->SetPageSize(1); - m_pHorzScroll->SetLineSize(1); - m_pHorzScroll->SetPageSize(1); - - m_nOldVThumb = m_nOldHThumb = 0; + Contruct(); } //------------------------------------------------------------------------------ OFieldDescControl::OFieldDescControl( Window* pParent, OTableDesignHelpBar* pHelpBar ) @@ -305,7 +236,11 @@ OFieldDescControl::OFieldDescControl( Window* pParent, OTableDesignHelpBar* pHel ,pActFieldDescr(NULL) { DBG_CTOR(OFieldDescControl,NULL); - + Contruct(); +} +// ----------------------------------------------------------------------------- +void OFieldDescControl::Contruct() +{ m_pVertScroll = new ScrollBar(this, WB_VSCROLL | WB_REPEAT | WB_DRAG); m_pHorzScroll = new ScrollBar(this, WB_HSCROLL | WB_REPEAT | WB_DRAG); m_pVertScroll->SetScrollHdl(LINK(this, OFieldDescControl, OnScroll)); @@ -322,7 +257,6 @@ OFieldDescControl::OFieldDescControl( Window* pParent, OTableDesignHelpBar* pHel m_pHorzScroll->SetPageSize(1); m_nOldVThumb = m_nOldHThumb = 0; - } //------------------------------------------------------------------------------ @@ -451,7 +385,7 @@ void OFieldDescControl::CheckScrollBars() sal_uInt16 nActive = CountActiveAggregates(); // welches ist das letzte, was ganz drauf passt ? sal_uInt16 nLastVisible; - const sal_Int32 nControlHeight = LogicToPixel(Size(0, CONTROL_HEIGHT),MAP_APPFONT).Height(); + const sal_Int32 nControlHeight = GetMaxControlHeight(); const sal_Int32 nControl_Spacing_y = LogicToPixel(Size(0, CONTROL_SPACING_Y),MAP_APPFONT).Height(); if (bNeedHScrollBar) nLastVisible = static_cast<sal_uInt16>((szOverallSize.Height() - nControl_Spacing_y - nHScrollHeight) / (nControl_Spacing_y + nControlHeight)); @@ -536,7 +470,7 @@ void OFieldDescControl::ScrollAllAggregates() if (m_nOldVThumb != m_pVertScroll->GetThumbPos()) { - const sal_Int32 nControlHeight = LogicToPixel(Size(0, CONTROL_HEIGHT),MAP_APPFONT).Height(); + const sal_Int32 nControlHeight = GetMaxControlHeight(); const sal_Int32 nControl_Spacing_y = LogicToPixel(Size(0, CONTROL_SPACING_Y),MAP_APPFONT).Height(); nDeltaY = (m_nOldVThumb - m_pVertScroll->GetThumbPos()) * (nControl_Spacing_y + nControlHeight); m_nOldVThumb = m_pVertScroll->GetThumbPos(); @@ -573,7 +507,23 @@ sal_uInt16 OFieldDescControl::CountActiveAggregates() const ++nVisibleAggregates; return nVisibleAggregates; } +//------------------------------------------------------------------------------ +sal_Int32 OFieldDescControl::GetMaxControlHeight() const +{ + Size aHeight; + Control* ppAggregates[] = { pRequired, pNumType, pAutoIncrement, pDefault, pTextLen, pLength, pScale, pFormat, m_pColumnName, m_pType,m_pAutoIncrementValue}; + for (sal_uInt16 i=0; i<sizeof(ppAggregates)/sizeof(ppAggregates[0]); ++i) + { + if ( ppAggregates[i] ) + { + const Size aTemp( ppAggregates[i]->GetOptimalSize(WINDOWSIZE_PREFERRED) ); + if ( aTemp.Height() > aHeight.Height() ) + aHeight.Height() = aTemp.Height(); + } // if ( ppAggregates[i] ) + } + return aHeight.Height(); +} //------------------------------------------------------------------------------ void OFieldDescControl::SetReadOnly( sal_Bool bReadOnly ) { @@ -909,7 +859,8 @@ void OFieldDescControl::ArrangeAggregates() // die Z-Order so, dass die Controls auch wirklich in derselben Reihenfolge durchwandert werden koennen, in der sie // hier angeordnet wurden - adAggregates[i].pctrlInputControl->SetZOrder(pZOrderPredecessor, pZOrderPredecessor ? WINDOW_ZORDER_BEHIND : WINDOW_ZORDER_FIRST); + adAggregates[i].pctrlTextControl->SetZOrder(pZOrderPredecessor, pZOrderPredecessor ? WINDOW_ZORDER_BEHIND : WINDOW_ZORDER_FIRST); + adAggregates[i].pctrlInputControl->SetZOrder(adAggregates[i].pctrlTextControl, WINDOW_ZORDER_BEHIND ); pZOrderPredecessor = adAggregates[i].pctrlInputControl; if (adAggregates[i].pctrlInputControl == pFormatSample) @@ -947,36 +898,18 @@ void OFieldDescControl::ActivateAggregate( EControlType eType ) if( pDefault ) return; m_nPos++; - pDefaultText =new FixedText( this ); - pDefaultText->SetText( ModuleRes(STR_DEFAULT_VALUE) ); + pDefaultText = CreateText(STR_DEFAULT_VALUE); pDefault = new OPropEditCtrl( this, STR_HELP_DEFAULT_VALUE, FIELD_PROPERTY_DEFAULT, WB_BORDER ); - pDefault->SetHelpId(HID_TAB_ENT_DEFAULT); - // SetPosSize( (Control**)&pDefaultText, m_nPos, 0 ); - // SetPosSize( (Control**)&pDefault, m_nPos, 3 ); - - pDefault->SetGetFocusHdl(LINK(this, OFieldDescControl, OnControlFocusGot)); - pDefault->SetLoseFocusHdl(LINK(this, OFieldDescControl, OnControlFocusLost)); - - pDefaultText->EnableClipSiblings(); - pDefault->EnableClipSiblings(); + InitializeControl(pDefault,HID_TAB_ENT_DEFAULT,false); break; case tpAutoIncrementValue: if( m_pAutoIncrementValue || !isAutoIncrementValueEnabled() ) return; m_nPos++; - m_pAutoIncrementValueText =new FixedText( this ); - m_pAutoIncrementValueText->SetText( ModuleRes(STR_AUTOINCREMENT_VALUE) ); + m_pAutoIncrementValueText = CreateText(STR_AUTOINCREMENT_VALUE); m_pAutoIncrementValue = new OPropEditCtrl( this, STR_HELP_AUTOINCREMENT_VALUE, FIELD_PRPOERTY_AUTOINCREMENT, WB_BORDER ); - m_pAutoIncrementValue->SetHelpId(HID_TAB_AUTOINCREMENTVALUE); - // SetPosSize( (Control**)&m_pAutoIncrementValueText, m_nPos, 0 ); - // SetPosSize( (Control**)&m_pAutoIncrementValue, m_nPos, 3 ); - - m_pAutoIncrementValue->SetGetFocusHdl(LINK(this, OFieldDescControl, OnControlFocusGot)); - m_pAutoIncrementValue->SetLoseFocusHdl(LINK(this, OFieldDescControl, OnControlFocusLost)); - - m_pAutoIncrementValueText->EnableClipSiblings(); - m_pAutoIncrementValue->EnableClipSiblings(); m_pAutoIncrementValue->SetText( getAutoIncrementValue() ); + InitializeControl(m_pAutoIncrementValue,HID_TAB_AUTOINCREMENTVALUE,false); break; case tpRequired: @@ -988,21 +921,14 @@ void OFieldDescControl::ActivateAggregate( EControlType eType ) if(xMetaData.is() && xMetaData->supportsNonNullableColumns()) { m_nPos++; - pRequiredText =new FixedText( this ); - pRequiredText->SetText( ModuleRes(STR_FIELD_REQUIRED) ); + pRequiredText = CreateText(STR_FIELD_REQUIRED); pRequired = new OPropListBoxCtrl( this, STR_HELP_FIELD_REQUIRED, FIELD_PROPERTY_REQUIRED, WB_DROPDOWN); - pRequired->SetHelpId(HID_TAB_ENT_REQUIRED); pRequired->InsertEntry( aYes ); pRequired->InsertEntry( aNo ); pRequired->SelectEntryPos(1); - pRequired->SetSelectHdl(LINK(this,OFieldDescControl,ChangeHdl)); - - pRequired->SetGetFocusHdl(LINK(this, OFieldDescControl, OnControlFocusGot)); - pRequired->SetLoseFocusHdl(LINK(this, OFieldDescControl, OnControlFocusLost)); - pRequiredText->EnableClipSiblings(); - pRequired->EnableClipSiblings(); + InitializeControl(pRequired,HID_TAB_ENT_REQUIRED,true); } } break; @@ -1011,53 +937,28 @@ void OFieldDescControl::ActivateAggregate( EControlType eType ) if( pAutoIncrement ) return; m_nPos++; - pAutoIncrementText =new FixedText( this ); - pAutoIncrementText->SetText( ModuleRes(STR_FIELD_AUTOINCREMENT) ); + pAutoIncrementText = CreateText(STR_FIELD_AUTOINCREMENT); pAutoIncrement = new OPropListBoxCtrl( this, STR_HELP_AUTOINCREMENT, FIELD_PROPERTY_AUTOINC, WB_DROPDOWN ); - pAutoIncrement->SetHelpId(HID_TAB_ENT_AUTOINCREMENT); - pAutoIncrement->InsertEntry( aYes ); pAutoIncrement->InsertEntry( aNo ); pAutoIncrement->SelectEntryPos(0); - pAutoIncrement->SetSelectHdl(LINK(this,OFieldDescControl,ChangeHdl)); - - pAutoIncrement->SetGetFocusHdl(LINK(this, OFieldDescControl, OnControlFocusGot)); - pAutoIncrement->SetLoseFocusHdl(LINK(this, OFieldDescControl, OnControlFocusLost)); - - pAutoIncrementText->EnableClipSiblings(); - pAutoIncrement->EnableClipSiblings(); + InitializeControl(pAutoIncrement,HID_TAB_ENT_AUTOINCREMENT,true); } break; case tpTextLen: if( pTextLen ) return; m_nPos++; - pTextLenText =new FixedText( this ); - pTextLenText->SetText( ModuleRes(STR_TEXT_LENGTH) ); - - pTextLen = new OPropNumericEditCtrl( this, STR_HELP_TEXT_LENGTH, FIELD_PROPERTY_TEXTLEN, WB_BORDER ); - pTextLen->SetDecimalDigits(0); - pTextLen->SetMin(0); - pTextLen->SetMax(0x7FFFFFFF); // soll draussen geaendert werden, wenn noetig - pTextLen->SetStrictFormat(TRUE); - - pTextLen->SetHelpId(HID_TAB_ENT_TEXT_LEN); - - pTextLen->SetGetFocusHdl(LINK(this, OFieldDescControl, OnControlFocusGot)); - pTextLen->SetLoseFocusHdl(LINK(this, OFieldDescControl, OnControlFocusLost)); - - pTextLenText->EnableClipSiblings(); - pTextLen->EnableClipSiblings(); + pTextLenText = CreateText(STR_TEXT_LENGTH); + pTextLen = CreateNumericControl(STR_HELP_TEXT_LENGTH, FIELD_PROPERTY_TEXTLEN,HID_TAB_ENT_TEXT_LEN); break; case tpType: if( m_pType) return; m_nPos++; - m_pTypeText =new FixedText( this ); - m_pTypeText->SetText( ModuleRes(STR_TAB_FIELD_DATATYPE) ); + m_pTypeText = CreateText(STR_TAB_FIELD_DATATYPE); m_pType = new OPropListBoxCtrl( this, STR_HELP_AUTOINCREMENT, FIELD_PRPOERTY_TYPE, WB_DROPDOWN ); - m_pType->SetHelpId(HID_TAB_ENT_TYPE); m_pType->SetDropDownLineCount(20); { const OTypeInfoMap* pTypeInfo = getTypeInfo(); @@ -1066,50 +967,48 @@ void OFieldDescControl::ActivateAggregate( EControlType eType ) m_pType->InsertEntry( aIter->second->aUIName ); } m_pType->SelectEntryPos(0); - m_pType->SetSelectHdl(LINK(this,OFieldDescControl,ChangeHdl)); - - m_pType->SetGetFocusHdl(LINK(this, OFieldDescControl, OnControlFocusGot)); - m_pType->SetLoseFocusHdl(LINK(this, OFieldDescControl, OnControlFocusLost)); - - m_pTypeText->EnableClipSiblings(); - m_pType->EnableClipSiblings(); + InitializeControl(m_pType,HID_TAB_ENT_TYPE,true); break; case tpColumnName: if( m_pColumnName ) return; m_nPos++; { - Reference< XDatabaseMetaData> xMetaData = getMetaData(); - sal_uInt32 nMax = xMetaData.is() ? xMetaData->getMaxColumnNameLength() : EDIT_NOLIMIT; - m_pColumnNameText =new FixedText( this ); - m_pColumnNameText->SetText( ModuleRes(STR_TAB_FIELD_NAME) ); - ::rtl::OUString aTmpString( xMetaData.is() ? xMetaData->getExtraNameCharacters() : ::rtl::OUString() ); + sal_uInt32 nMax = EDIT_NOLIMIT; + ::rtl::OUString aTmpString; + try + { + Reference< XDatabaseMetaData> xMetaData = getMetaData(); + if ( xMetaData.is() ) + { + nMax = xMetaData->getMaxColumnNameLength(); + aTmpString = xMetaData->getExtraNameCharacters(); + } + } + catch(Exception&) + { + DBG_UNHANDLED_EXCEPTION(); + } + m_pColumnNameText = CreateText(STR_TAB_FIELD_NAME); m_pColumnName = new OPropColumnEditCtrl( this, aTmpString, STR_HELP_DEFAULT_VALUE, FIELD_PRPOERTY_COLUMNNAME, WB_BORDER ); - m_pColumnName->SetHelpId(HID_TAB_ENT_COLUMNNAME); m_pColumnName->SetMaxTextLen(xub_StrLen( nMax ? nMax : EDIT_NOLIMIT)); m_pColumnName->setCheck( isSQL92CheckEnabled(getConnection()) ); } - m_pColumnName->SetGetFocusHdl(LINK(this, OFieldDescControl, OnControlFocusGot)); - m_pColumnName->SetLoseFocusHdl(LINK(this, OFieldDescControl, OnControlFocusLost)); - - m_pColumnNameText->EnableClipSiblings(); - m_pColumnName->EnableClipSiblings(); + InitializeControl(m_pColumnName,HID_TAB_ENT_COLUMNNAME,false); break; case tpNumType: if( pNumType ) return; m_nPos++; - pNumTypeText =new FixedText( this ); - pNumTypeText->SetText( ModuleRes(STR_NUMERIC_TYPE) ); + pNumTypeText = CreateText(STR_NUMERIC_TYPE); pNumType = new OPropListBoxCtrl( this, STR_HELP_NUMERIC_TYPE, FIELD_PROPERTY_NUMTYPE, WB_DROPDOWN ); pNumType->SetDropDownLineCount(5); - pNumType->SetHelpId(HID_TAB_ENT_NUMTYP); pNumType->InsertEntry( String::CreateFromAscii("Byte") ); pNumType->InsertEntry( String::CreateFromAscii("SmallInt") ); @@ -1117,84 +1016,41 @@ void OFieldDescControl::ActivateAggregate( EControlType eType ) pNumType->InsertEntry( String::CreateFromAscii("Single") ); pNumType->InsertEntry( String::CreateFromAscii("Double") ); pNumType->SelectEntryPos(2); - pNumType->SetSelectHdl(LINK(this,OFieldDescControl,ChangeHdl)); - - pNumType->SetGetFocusHdl(LINK(this, OFieldDescControl, OnControlFocusGot)); - pNumType->SetLoseFocusHdl(LINK(this, OFieldDescControl, OnControlFocusLost)); - - pNumTypeText->EnableClipSiblings(); - pNumType->EnableClipSiblings(); + InitializeControl(pNumType,HID_TAB_ENT_NUMTYP,true); break; case tpLength: if( pLength ) return; m_nPos++; - pLengthText =new FixedText( this ); - pLengthText->SetText( ModuleRes(STR_LENGTH) ); - - pLength = new OPropNumericEditCtrl( this, STR_HELP_LENGTH, FIELD_PROPERTY_LENGTH, WB_BORDER ); - pLength->SetDecimalDigits(0); - pLength->SetMin(0); - pLength->SetMax(0x7FFFFFFF); // soll draussen geaendert werden, wenn noetig - pLength->SetStrictFormat(TRUE); - - pLength->SetHelpId(HID_TAB_ENT_LEN); - - pLength->SetGetFocusHdl(LINK(this, OFieldDescControl, OnControlFocusGot)); - pLength->SetLoseFocusHdl(LINK(this, OFieldDescControl, OnControlFocusLost)); - - pLengthText->EnableClipSiblings(); - pLength->EnableClipSiblings(); + pLengthText = CreateText(STR_LENGTH); + pLength = CreateNumericControl(STR_HELP_LENGTH, FIELD_PROPERTY_LENGTH,HID_TAB_ENT_LEN); break; case tpScale: if( pScale ) return; m_nPos++; - pScaleText =new FixedText( this ); - pScaleText->SetText( ModuleRes(STR_SCALE) ); - pScale = new OPropNumericEditCtrl( this, STR_HELP_SCALE, FIELD_PROPERTY_SCALE, WB_BORDER ); - pScale->SetDecimalDigits(0); - pScale->SetMin(0); - pScale->SetMax(0x7FFFFFFF); // soll draussen geaendert werden, wenn noetig - pScale->SetStrictFormat(TRUE); - - pScale->SetHelpId(HID_TAB_ENT_SCALE); - - pScale->SetGetFocusHdl(LINK(this, OFieldDescControl, OnControlFocusGot)); - pScale->SetLoseFocusHdl(LINK(this, OFieldDescControl, OnControlFocusLost)); - - pScaleText->EnableClipSiblings(); - pScale->EnableClipSiblings(); + pScaleText = CreateText(STR_SCALE); + pScale = CreateNumericControl(STR_HELP_SCALE, FIELD_PROPERTY_SCALE,HID_TAB_ENT_SCALE); break; case tpFormat: if (!pFormat) { m_nPos++; - pFormatText =new FixedText( this ); - pFormatText->SetText( ModuleRes(STR_FORMAT) ); + pFormatText = CreateText(STR_FORMAT); pFormatSample = new OPropEditCtrl( this, STR_HELP_FORMAT_CODE, -1, WB_BORDER ); - pFormatSample->SetHelpId(HID_TAB_ENT_FORMAT_SAMPLE); pFormatSample->SetReadOnly(sal_True); pFormatSample->Enable(sal_False); + InitializeControl(pFormatSample,HID_TAB_ENT_FORMAT_SAMPLE,false); pFormat = new PushButton( this, ModuleRes(PB_FORMAT) ); - pFormat->SetHelpId(HID_TAB_ENT_FORMAT); - const sal_Int32 nControlHeight = LogicToPixel(Size(0, CONTROL_HEIGHT),MAP_APPFONT).Height(); + const sal_Int32 nControlHeight = GetMaxControlHeight(); pFormat->SetSizePixel(Size(nControlHeight, nControlHeight)); pFormat->SetClickHdl( LINK( this, OFieldDescControl, FormatClickHdl ) ); - - pFormatSample->SetGetFocusHdl(LINK(this, OFieldDescControl, OnControlFocusGot)); - pFormatSample->SetLoseFocusHdl(LINK(this, OFieldDescControl, OnControlFocusLost)); - pFormat->SetGetFocusHdl(LINK(this, OFieldDescControl, OnControlFocusGot)); - pFormat->SetLoseFocusHdl(LINK(this, OFieldDescControl, OnControlFocusLost)); - - pFormatText->EnableClipSiblings(); - pFormatSample->EnableClipSiblings(); - pFormat->EnableClipSiblings(); + InitializeControl(pFormat,HID_TAB_ENT_FORMAT,false); } UpdateFormatSample(pActFieldDescr); @@ -1204,25 +1060,49 @@ void OFieldDescControl::ActivateAggregate( EControlType eType ) return; m_nPos++; - pBoolDefaultText =new FixedText(this); - pBoolDefaultText->SetText(ModuleRes(STR_DEFAULT_VALUE)); + pBoolDefaultText = CreateText(STR_DEFAULT_VALUE); pBoolDefault = new OPropListBoxCtrl( this, STR_HELP_BOOL_DEFAULT, FIELD_PROPERTY_BOOL_DEFAULT, WB_DROPDOWN ); pBoolDefault->SetDropDownLineCount(3); pBoolDefault->InsertEntry(String(ModuleRes(STR_VALUE_NONE))); pBoolDefault->InsertEntry(aYes); pBoolDefault->InsertEntry(aNo); - pBoolDefault->SetHelpId(HID_TAB_ENT_BOOL_DEFAULT); - pBoolDefault->SetGetFocusHdl(LINK(this, OFieldDescControl, OnControlFocusGot)); - pBoolDefault->SetLoseFocusHdl(LINK(this, OFieldDescControl, OnControlFocusLost)); - - pBoolDefaultText->EnableClipSiblings(); - pBoolDefault->EnableClipSiblings(); + InitializeControl(pBoolDefault,HID_TAB_ENT_BOOL_DEFAULT,false); break; - } } +// ----------------------------------------------------------------------------- +void OFieldDescControl::InitializeControl(Control* _pControl,ULONG _nHelpId,bool _bAddChangeHandler) +{ + _pControl->SetHelpId(_nHelpId); + if ( _bAddChangeHandler ) + ((OPropListBoxCtrl*)_pControl)->SetSelectHdl(LINK(this,OFieldDescControl,ChangeHdl)); + _pControl->SetGetFocusHdl(LINK(this, OFieldDescControl, OnControlFocusGot)); + _pControl->SetLoseFocusHdl(LINK(this, OFieldDescControl, OnControlFocusLost)); + _pControl->EnableClipSiblings(); +} +// ----------------------------------------------------------------------------- +FixedText* OFieldDescControl::CreateText(USHORT _nTextRes) +{ + FixedText* pFixedText = new FixedText( this ); + pFixedText->SetText( ModuleRes(_nTextRes) ); + pFixedText->EnableClipSiblings(); + return pFixedText; +} +// ----------------------------------------------------------------------------- +OPropNumericEditCtrl* OFieldDescControl::CreateNumericControl(USHORT _nHelpStr,short _nProperty,ULONG _nHelpId) +{ + OPropNumericEditCtrl* pControl = new OPropNumericEditCtrl( this, _nHelpStr, _nProperty, WB_BORDER ); + pControl->SetDecimalDigits(0); + pControl->SetMin(0); + pControl->SetMax(0x7FFFFFFF); // soll draussen geaendert werden, wenn noetig + pControl->SetStrictFormat(TRUE); + + InitializeControl(pControl,_nHelpId,false); + + return pControl; +} //------------------------------------------------------------------------------ void OFieldDescControl::DeactivateAggregate( EControlType eType ) { @@ -1233,150 +1113,58 @@ void OFieldDescControl::DeactivateAggregate( EControlType eType ) switch( eType ) { case tpDefault: - if( !pDefault ) - return; - m_nPos--; - pDefault->Hide(); - pDefaultText->Hide(); - delete pDefault; - delete pDefaultText; - pDefault = NULL; - pDefaultText =NULL; + lcl_HideAndDeleteControl(m_nPos,&pDefault,&pDefaultText); break; case tpAutoIncrementValue: - if( !m_pAutoIncrementValue ) - return; - m_nPos--; - m_pAutoIncrementValue->Hide(); - m_pAutoIncrementValueText->Hide(); - delete m_pAutoIncrementValue; - delete m_pAutoIncrementValueText; - m_pAutoIncrementValue = NULL; - m_pAutoIncrementValueText =NULL; + lcl_HideAndDeleteControl(m_nPos,&m_pAutoIncrementValue,&m_pAutoIncrementValueText); break; case tpColumnName: - if( !m_pColumnName ) - return; - m_nPos--; - m_pColumnName->Hide(); - m_pColumnNameText->Hide(); - delete m_pColumnName; - delete m_pColumnNameText; - m_pColumnName = NULL; - m_pColumnNameText =NULL; + lcl_HideAndDeleteControl(m_nPos,&m_pColumnName,&m_pColumnNameText); break; case tpType: - if( !m_pType ) - return; - m_nPos--; - m_pType->Hide(); - m_pTypeText->Hide(); - delete m_pType; - delete m_pTypeText; - m_pType = NULL; - m_pTypeText =NULL; + lcl_HideAndDeleteControl(m_nPos,&m_pType,&m_pTypeText); break; case tpAutoIncrement: - if( !pAutoIncrement ) - return; - m_nPos--; - pAutoIncrement->Hide(); - pAutoIncrementText->Hide(); - delete pAutoIncrement; - delete pAutoIncrementText; - pAutoIncrement = NULL; - pAutoIncrementText =NULL; + lcl_HideAndDeleteControl(m_nPos,&pAutoIncrement,&pAutoIncrementText); break; case tpRequired: - if( !pRequired ) - return; - m_nPos--; - pRequired->Hide(); - pRequiredText->Hide(); - delete pRequired; - delete pRequiredText; - pRequired = NULL; - pRequiredText =NULL; + lcl_HideAndDeleteControl(m_nPos,&pRequired,&pRequiredText); break; case tpTextLen: - if( !pTextLen ) - return; - m_nPos--; - pTextLen->Hide(); - pTextLenText->Hide(); - delete pTextLen; - delete pTextLenText; - pTextLen = NULL; - pTextLenText =NULL; + lcl_HideAndDeleteControl(m_nPos,&pTextLen,&pTextLenText); break; case tpNumType: - if( !pNumType ) - return; - m_nPos--; - pNumType->Hide(); - pNumTypeText->Hide(); - delete pNumType; - delete pNumTypeText; - pNumType = NULL; - pNumTypeText =NULL; + lcl_HideAndDeleteControl(m_nPos,&pNumType,&pNumTypeText); break; case tpLength: - if( !pLength ) - return; - m_nPos--; - pLength->Hide(); - pLengthText->Hide(); - delete pLength; - delete pLengthText; - pLength = NULL; - pLengthText =NULL; + lcl_HideAndDeleteControl(m_nPos,&pLength,&pLengthText); break; case tpScale: - if( !pScale ) - return; - m_nPos--; - pScale->Hide(); - pScaleText->Hide(); - delete pScale; - delete pScaleText; - pScale = NULL; - pScaleText =NULL; + lcl_HideAndDeleteControl(m_nPos,&pScale,&pScaleText); break; case tpFormat: - if( !pFormat ) - return; - pFormatText->Hide(); - pFormatSample->Hide(); - pFormat->Hide(); - delete pFormatText; - delete pFormatSample; - delete pFormat; - pFormatText =NULL; - pFormatSample = NULL; - pFormat = NULL; + // TODO: we have to check if we have to increment m_nPos again + lcl_HideAndDeleteControl(m_nPos,&pFormat,&pFormatText); + if ( pFormatSample ) + { + pFormatSample->Hide(); + delete pFormatSample; + pFormatSample = NULL; + } break; case tpBoolDefault: - if (!pBoolDefault) - return; - m_nPos--; - pBoolDefault->Hide(); - pBoolDefaultText->Hide(); - delete pBoolDefault; - delete pBoolDefaultText; - pBoolDefault = NULL; - pBoolDefaultText =NULL; + lcl_HideAndDeleteControl(m_nPos,&pBoolDefault,&pBoolDefaultText); break; - } } @@ -1387,48 +1175,28 @@ void OFieldDescControl::SetPosSize( Control** ppControl, long nRow, sal_uInt16 n ////////////////////////////////////////////////////////////////////// // Groesse ermitteln - const sal_Int32 nControlHeight = LogicToPixel(Size(0, CONTROL_HEIGHT),MAP_APPFONT).Height(); - Size aSize; - switch( nCol ) + const sal_Int32 nControlHeight = GetMaxControlHeight(); + Size aSize(0,nControlHeight); + if ( isRightAligned() && nCol ) + aSize.Width() = LogicToPixel(Size(m_nWidth, 0),MAP_APPFONT).Width(); + else { - case 0: - aSize.Width() = CONTROL_WIDTH_1; - aSize.Height() = nControlHeight; - break; - case 1: - if ( isRightAligned() ) - aSize.Width() = LogicToPixel(Size(m_nWidth, 0),MAP_APPFONT).Width(); - else - aSize.Width() = CONTROL_WIDTH_2; - aSize.Height() = nControlHeight; - break; - case 2: - if ( isRightAligned() ) - aSize.Width() = LogicToPixel(Size(m_nWidth, 0),MAP_APPFONT).Width(); - else + switch( nCol ) + { + case 0: + default: + aSize.Width() = CONTROL_WIDTH_1; + break; + case 1: aSize.Width() = CONTROL_WIDTH_2; - aSize.Height() = long(1.5*nControlHeight); - break; - case 3: - if ( isRightAligned() ) - aSize.Width() = LogicToPixel(Size(m_nWidth, 0),MAP_APPFONT).Width(); - else + break; + case 3: aSize.Width() = CONTROL_WIDTH_3; - aSize.Height() = nControlHeight; - break; - case 4: - if ( isRightAligned() ) - aSize.Width() = LogicToPixel(Size(m_nWidth, 0),MAP_APPFONT).Width(); - else + break; + case 4: aSize.Width() = CONTROL_WIDTH_4; - aSize.Height() = nControlHeight; - break; - default: - if ( isRightAligned() ) - aSize.Width() = LogicToPixel(Size(m_nWidth, 0),MAP_APPFONT).Width(); - else - aSize.Width() = CONTROL_WIDTH_1; - aSize.Height() = nControlHeight; + break; + } // switch( nCol ) } @@ -1442,7 +1210,6 @@ void OFieldDescControl::SetPosSize( Control** ppControl, long nRow, sal_uInt16 n aPosition.Y() = 1; break; case 1: - case 2: case 3: case 4: if ( isRightAligned() ) @@ -1965,12 +1732,8 @@ void OFieldDescControl::SaveData( OFieldDescription* pFieldDescr ) //------------------------------------------------------------------------------ void OFieldDescControl::UpdateFormatSample(OFieldDescription* pFieldDescr) { - if(!pFieldDescr) - return; - if(!pFormatSample) - return; - - pFormatSample->SetText(getControlDefault(pFieldDescr,sal_False)); + if ( pFieldDescr && pFormatSample ) + pFormatSample->SetText(getControlDefault(pFieldDescr,sal_False)); } //------------------------------------------------------------------------------ @@ -2169,8 +1932,3 @@ String OFieldDescControl::getControlDefault( const OFieldDescription* _pFieldDes return sDefault; } // ----------------------------------------------------------------------------- - - - - - diff --git a/dbaccess/source/ui/control/opendoccontrols.cxx b/dbaccess/source/ui/control/opendoccontrols.cxx index c65285cf414a..5b089f764337 100644 --- a/dbaccess/source/ui/control/opendoccontrols.cxx +++ b/dbaccess/source/ui/control/opendoccontrols.cxx @@ -300,14 +300,10 @@ namespace dbaui aURL.SetPass( sPassword ); if ( !sTitle.Len() ) - sTitle = aURL.getName(); + sTitle = aURL.getBase( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_UNAMBIGUOUS ); String sDecodedURL = aURL.GetMainURL( INetURLObject::NO_DECODE ); -// sTitle.AppendAscii( " (" ); -// sTitle += String( ::svt::OFileNotation( sDecodedURL ).get( ::svt::OFileNotation::N_SYSTEM ) ); -// sTitle.AppendAscii( ")" ); - USHORT nPos = InsertEntry( sTitle ); m_aURLs.insert( MapIndexToStringPair::value_type( nPos, StringPair( sDecodedURL, sFilter ) ) ); } diff --git a/dbaccess/source/ui/dlg/UserAdmin.hxx b/dbaccess/source/ui/dlg/UserAdmin.hxx index 57c7a59a140c..b4eae1591b3d 100644 --- a/dbaccess/source/ui/dlg/UserAdmin.hxx +++ b/dbaccess/source/ui/dlg/UserAdmin.hxx @@ -79,7 +79,6 @@ protected: ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> m_xConnection; ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > m_xUsers; - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory> m_xORB; ::com::sun::star::uno::Sequence< ::rtl::OUString> m_aUserNames; String m_UserName; @@ -93,8 +92,6 @@ protected: OUserAdmin( Window* pParent, const SfxItemSet& _rCoreAttrs); public: - void setServiceFactory(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _xORB) { m_xORB = _xORB; } - static SfxTabPage* Create( Window* pParent, const SfxItemSet& _rAttrSet ); ~OUserAdmin(); diff --git a/dbaccess/source/ui/dlg/dbwizsetup.cxx b/dbaccess/source/ui/dlg/dbwizsetup.cxx index 80b8b389c45a..6df5537544a4 100644 --- a/dbaccess/source/ui/dlg/dbwizsetup.cxx +++ b/dbaccess/source/ui/dlg/dbwizsetup.cxx @@ -316,7 +316,7 @@ ODbTypeWizDialogSetup::ODbTypeWizDialogSetup(Window* _pParent if (pCollectionItem) m_pCollection = pCollectionItem->getCollection(); - DBG_ASSERT(m_pCollection, "OGeneralPage::OGeneralPage : really need a DSN type collection !"); + DBG_ASSERT(m_pCollection, "ODbTypeWizDialogSetup::ODbTypeWizDialogSetup : really need a DSN type collection !"); FreeResource(); diff --git a/dbaccess/source/ui/dlg/sqlmessage.cxx b/dbaccess/source/ui/dlg/sqlmessage.cxx index bd5a4c1e6392..cc8f01dd4daf 100644 --- a/dbaccess/source/ui/dlg/sqlmessage.cxx +++ b/dbaccess/source/ui/dlg/sqlmessage.cxx @@ -258,6 +258,14 @@ namespace ExceptionDisplayInfo( SQLExceptionInfo::TYPE _eType ) : eType( _eType ), bSubEntry( false ) { } }; + static bool lcl_hasDetails( const ExceptionDisplayInfo& _displayInfo ) + { + return ( _displayInfo.sErrorCode.Len() ) + || ( _displayInfo.sSQLState.Len() + && !_displayInfo.sSQLState.EqualsAscii( "S1000" ) + ); + } + typedef ::std::vector< ExceptionDisplayInfo > ExceptionDisplayChain; //------------------------------------------------------------------------------ @@ -303,11 +311,19 @@ namespace ExceptionDisplayInfo aDisplayInfo( aCurrentElement.getType() ); - aDisplayInfo.sMessage = pCurrentError->Message; + aDisplayInfo.sMessage = pCurrentError->Message.trim(); aDisplayInfo.sSQLState = pCurrentError->SQLState; if ( pCurrentError->ErrorCode ) aDisplayInfo.sErrorCode = String::CreateFromInt32( pCurrentError->ErrorCode ); + if ( !aDisplayInfo.sMessage.Len() + && !lcl_hasDetails( aDisplayInfo ) + ) + { + OSL_ENSURE( false, "lcl_buildExceptionChain: useles exception: no state, no error code, no message!" ); + continue; + } + aDisplayInfo.pImageProvider = _rFactory.getImageProvider( aCurrentElement.getType() ); aDisplayInfo.pLabelProvider = _rFactory.getLabelProvider( aCurrentElement.getType(), false ); @@ -685,7 +701,25 @@ void OSQLMessageBox::impl_createStandardButtons( WinBits _nStyle ) void OSQLMessageBox::impl_addDetailsButton() { size_t nFirstPageVisible = m_aMessage.IsVisible() ? 2 : 1; + bool bMoreDetailsAvailable = m_pImpl->aDisplayInfo.size() > nFirstPageVisible; + if ( !bMoreDetailsAvailable ) + { + // even if the text fits into what we can display, we might need to details button + // if there is more non-trivial information in the errors than the mere messages + for ( ExceptionDisplayChain::const_iterator error = m_pImpl->aDisplayInfo.begin(); + error != m_pImpl->aDisplayInfo.end(); + ++error + ) + { + if ( lcl_hasDetails( *error ) ) + { + bMoreDetailsAvailable = true; + break; + } + } + } + if ( bMoreDetailsAvailable ) { AddButton( BUTTON_MORE, BUTTONID_MORE, 0 ); diff --git a/dbaccess/source/ui/inc/FieldDescControl.hxx b/dbaccess/source/ui/inc/FieldDescControl.hxx index ca0e411a09cd..c77942cd71c0 100644 --- a/dbaccess/source/ui/inc/FieldDescControl.hxx +++ b/dbaccess/source/ui/inc/FieldDescControl.hxx @@ -160,6 +160,10 @@ namespace dbaui void ScrollAllAggregates(); sal_Bool isTextFormat(const OFieldDescription* _pFieldDescr,sal_uInt32& _nFormatKey) const; + void Contruct(); + OPropNumericEditCtrl* CreateNumericControl(USHORT _nHelpStr,short _nProperty,ULONG _nHelpId); + FixedText* CreateText(USHORT _nTextRes); + void InitializeControl(Control* _pControl,ULONG _nHelpId,bool _bAddChangeHandler); protected: inline void setRightAligned() { m_bRightAligned = true; } @@ -169,7 +173,8 @@ namespace dbaui inline OFieldDescription* getCurrentFieldDescData() { return pActFieldDescr; } inline void setCurrentFieldDescData( OFieldDescription* _pDesc ) { pActFieldDescr = _pDesc; } - USHORT CountActiveAggregates() const; + sal_uInt16 CountActiveAggregates() const; + sal_Int32 GetMaxControlHeight() const; virtual void ActivateAggregate( EControlType eType ); virtual void DeactivateAggregate( EControlType eType ); diff --git a/dbaccess/source/ui/inc/FieldDescriptions.hxx b/dbaccess/source/ui/inc/FieldDescriptions.hxx index 7b54d2617bc3..ee473b032853 100644 --- a/dbaccess/source/ui/inc/FieldDescriptions.hxx +++ b/dbaccess/source/ui/inc/FieldDescriptions.hxx @@ -123,6 +123,7 @@ namespace dbaui sal_Int32 GetFormatKey() const; SvxCellHorJustify GetHorJustify() const; TOTypeInfoSP getTypeInfo() const; + TOTypeInfoSP getSpecialTypeInfo() const; sal_Bool IsAutoIncrement() const; sal_Bool IsPrimaryKey() const; sal_Bool IsCurrency() const; diff --git a/dbaccess/source/ui/inc/dbu_rel.hrc b/dbaccess/source/ui/inc/dbu_rel.hrc index 1e0e2f3423da..c8d224cbdcad 100644 --- a/dbaccess/source/ui/inc/dbu_rel.hrc +++ b/dbaccess/source/ui/inc/dbu_rel.hrc @@ -41,9 +41,10 @@ #define STR_QUERY_REL_DELETE_WINDOW RID_STR_REL_START + 3 #define STR_QUERY_REL_EDIT RID_STR_REL_START + 4 #define STR_QUERY_REL_CREATE RID_STR_REL_START + 5 +#define STR_QUERY_REL_COULD_NOT_CREATE RID_STR_REL_START + 6 // please adjust checking before insert new strings -#if STR_QUERY_REL_DELETE_WINDOW > RID_STR_REL_END +#if STR_QUERY_REL_COULD_NOT_CREATE > RID_STR_REL_END #error Resource-Id Ueberlauf in #file, #line #endif diff --git a/dbaccess/source/ui/misc/DExport.cxx b/dbaccess/source/ui/misc/DExport.cxx index dc71f6588828..880bb91b3727 100644 --- a/dbaccess/source/ui/misc/DExport.cxx +++ b/dbaccess/source/ui/misc/DExport.cxx @@ -234,7 +234,7 @@ ODatabaseExport::ODatabaseExport(const SharedConnection& _rxConnection, sal_Int32 nType = aValue; ++nPos; - if( nType == DataType::VARCHAR) + if( nType == DataType::VARCHAR ) { m_pTypeInfo = TOTypeInfoSP(new OTypeInfo()); @@ -291,7 +291,9 @@ ODatabaseExport::ODatabaseExport(const SharedConnection& _rxConnection, break; } } - } + } // if(xSet.is()) + if ( !m_pTypeInfo ) + m_pTypeInfo = TOTypeInfoSP(new OTypeInfo()); SetColumnTypes(pList,_pInfoMap); } //--------------------------------------------------------------------------- @@ -432,10 +434,11 @@ sal_Int16 ODatabaseExport::CheckString(const String& aCheckToken, sal_Int16 _nOl if ( m_pFormatter && m_sNumToken.Len() ) { LanguageType eNumLang; - sal_uInt32 nNumberFormat2; - fOutNumber = SfxHTMLParser::GetTableDataOptionsValNum(nNumberFormat2,eNumLang,m_sTextToken,m_sNumToken,*m_pFormatter); + sal_uInt32 nFormatKey; + fOutNumber = SfxHTMLParser::GetTableDataOptionsValNum(nFormatKey,eNumLang,m_sTextToken,m_sNumToken,*m_pFormatter); //double fOutNumber2 = SfxHTMLParser::GetTableDataOptionsValNum(nNumberFormat2,eNumLang,m_sValToken,m_sNumToken,*m_pFormatter); - nNumberFormat = static_cast<sal_Int16>(nNumberFormat2); + Reference<XPropertySet> xProp = xFormats->getByKey(nFormatKey); + xProp->getPropertyValue(PROPERTY_TYPE) >>= nNumberFormat; } else { @@ -559,16 +562,15 @@ void ODatabaseExport::SetColumnTypes(const TColumnVector* _pList,const OTypeInfo DBG_CHKTHIS(ODatabaseExport,NULL); if(_pList && _pInfoMap) { + OSL_ENSURE(m_vNumberFormat.size() == m_vColumnSize.size() && m_vColumnSize.size() == _pList->size(),"Illegal columns in list"); Reference< XNumberFormatsSupplier > xSupplier = m_xFormatter->getNumberFormatsSupplier(); Reference< XNumberFormats > xFormats = xSupplier->getNumberFormats(); TColumnVector::const_iterator aIter = _pList->begin(); TColumnVector::const_iterator aEnd = _pList->end(); - for(sal_Int32 i= 0;aIter != aEnd;++aIter,++i) + for(sal_Int32 i= 0;aIter != aEnd && (i) < static_cast<sal_Int32>(m_vNumberFormat.size()) && (i) < static_cast<sal_Int32>(m_vColumnSize.size()) ;++aIter,++i) { sal_Int32 nDataType; sal_Int32 nLength(0),nScale(0); - OSL_ENSURE((i) < static_cast<sal_Int32>(m_vNumberFormat.size()),"m_vFormatKey: Illegal index for vector"); - OSL_ENSURE((i) < static_cast<sal_Int32>(m_vColumnSize.size()),"m_vColumnSize: Illegal index for vector"); sal_Int16 nType = m_vNumberFormat[i]; switch ( nType ) diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx index e38da91c606c..809f9c407e51 100644 --- a/dbaccess/source/ui/misc/UITools.cxx +++ b/dbaccess/source/ui/misc/UITools.cxx @@ -590,11 +590,11 @@ TOTypeInfoSP getTypeInfoFromType(const OTypeInfoMap& _rTypeInfo, // -> drop the precision and the scale restriction, accept any type with the property // type id (nType) - OSL_ENSURE(sal_False, - ( ::rtl::OString("getTypeInfoFromType: did not find a matching type") - += ::rtl::OString(" (expected type name: ") - += ::rtl::OString(_sTypeName.getStr(), _sTypeName.getLength(), gsl_getSystemTextEncoding()) - += ::rtl::OString(")! Defaulting to the first matching type.")).getStr()); + //OSL_ENSURE(sal_False, + // ( ::rtl::OString("getTypeInfoFromType: did not find a matching type") + // += ::rtl::OString(" (expected type name: ") + // += ::rtl::OString(_sTypeName.getStr(), _sTypeName.getLength(), gsl_getSystemTextEncoding()) + // += ::rtl::OString(")! Defaulting to the first matching type.")).getStr()); for(aIter = aPair.first; aIter != aPair.second; ++aIter) { // search the best matching type (now comparing the local names) @@ -700,6 +700,7 @@ void fillTypeInfo( const Reference< ::com::sun::star::sdbc::XConnection>& _rxCo nCount = 18; aTypes.reserve(nCount+1); aTypes.push_back(-1); + aNullable.push_back(sal_False); for (sal_Int32 j = 1; j <= nCount ; ++j) { aTypes.push_back(xResultSetMetaData->getColumnType(j)); diff --git a/dbaccess/source/ui/misc/WCPage.cxx b/dbaccess/source/ui/misc/WCPage.cxx index 2b4cd971ffa1..a6788ac1926f 100644 --- a/dbaccess/source/ui/misc/WCPage.cxx +++ b/dbaccess/source/ui/misc/WCPage.cxx @@ -216,6 +216,7 @@ sal_Bool OCopyTable::LeavePage() // first check if the table already exists in the database if( m_pParent->getOperation() != CopyTableOperation::AppendData ) { + m_pParent->clearDestColumns(); DynamicTableOrQueryNameCheck aNameCheck( m_pParent->m_xDestConnection, CommandType::TABLE ); SQLExceptionInfo aErrorInfo; if ( !aNameCheck.isNameValid( m_edTableName.GetText(), aErrorInfo ) ) @@ -342,7 +343,7 @@ sal_Bool OCopyTable::checkAppendData() { bNotConvert = sal_True; m_pParent->m_vColumnPos[i] = ODatabaseExport::TPositions::value_type(nPos,nPos); - TOTypeInfoSP pTypeInfo = m_pParent->convertType((*aDestIter)->second->getTypeInfo(),bNotConvert); + TOTypeInfoSP pTypeInfo = m_pParent->convertType((*aDestIter)->second->getSpecialTypeInfo(),bNotConvert); if ( !bNotConvert ) { m_pParent->showColumnTypeNotSupported((*aDestIter)->first); diff --git a/dbaccess/source/ui/misc/WColumnSelect.cxx b/dbaccess/source/ui/misc/WColumnSelect.cxx index 0f3f036102d5..9b4ad13d8dc7 100644 --- a/dbaccess/source/ui/misc/WColumnSelect.cxx +++ b/dbaccess/source/ui/misc/WColumnSelect.cxx @@ -336,7 +336,7 @@ void OWizColumnSelect::createNewColumn( ListBox* _pListbox, OFieldDescription* pNewField = new OFieldDescription(*_pSrcField); pNewField->SetName(sConvertedName); sal_Bool bNotConvert = sal_True; - pNewField->SetType(m_pParent->convertType(_pSrcField->getTypeInfo(),bNotConvert)); + pNewField->SetType(m_pParent->convertType(_pSrcField->getSpecialTypeInfo(),bNotConvert)); if ( !m_pParent->supportsPrimaryKey() ) pNewField->SetPrimaryKey(sal_False); diff --git a/dbaccess/source/ui/misc/WCopyTable.cxx b/dbaccess/source/ui/misc/WCopyTable.cxx index 0cd8ae2dbeb4..ca9aeacf73e4 100644 --- a/dbaccess/source/ui/misc/WCopyTable.cxx +++ b/dbaccess/source/ui/misc/WCopyTable.cxx @@ -860,7 +860,7 @@ sal_Bool OCopyTableWizard::CheckColumns(sal_Int32& _rnBreakPos) { OFieldDescription* pField = new OFieldDescription(*(*aSrcIter)->second); pField->SetName(convertColumnName(TExportColumnFindFunctor(&m_vDestColumns),(*aSrcIter)->first,sExtraChars,nMaxNameLen)); - TOTypeInfoSP pType = convertType((*aSrcIter)->second->getTypeInfo(),bRet); + TOTypeInfoSP pType = convertType((*aSrcIter)->second->getSpecialTypeInfo(),bRet); pField->SetType(pType); if ( !bPKeyAllowed ) pField->SetPrimaryKey(sal_False); diff --git a/dbaccess/source/ui/misc/WNameMatch.cxx b/dbaccess/source/ui/misc/WNameMatch.cxx index 93feb3aa49b1..5325f0388cfc 100644 --- a/dbaccess/source/ui/misc/WNameMatch.cxx +++ b/dbaccess/source/ui/misc/WNameMatch.cxx @@ -206,7 +206,7 @@ sal_Bool OWizNameMatching::LeavePage() m_pParent->m_vColumnPos[nPos].first = ++nParamPos; m_pParent->m_vColumnPos[nPos].second = ::std::distance(pDestColumns->begin(),aDestIter) + 1; sal_Bool bNotConvert = sal_True; - TOTypeInfoSP pTypeInfo = m_pParent->convertType((*aDestIter)->second->getTypeInfo(),bNotConvert); + TOTypeInfoSP pTypeInfo = m_pParent->convertType((*aDestIter)->second->getSpecialTypeInfo(),bNotConvert); sal_Int32 nType = ::com::sun::star::sdbc::DataType::VARCHAR; if ( pTypeInfo.get() ) nType = pTypeInfo->nType; diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx index 2ae24b6f6423..440be631a3ae 100644 --- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx +++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx @@ -740,6 +740,7 @@ sal_Bool OSelectionBrowseBox::saveField(const String& _sFieldName,OTableFieldDes // second test if the name can be set as select columns in a pseudo statement // we have to look which entries we should quote + const ::rtl::OUString sFieldAlias = _pEntry->GetFieldAlias(); size_t nPass = 4; ::connectivity::OSQLParser& rParser( rController.getParser() ); OSQLParseNode* pParseNode = NULL; @@ -759,6 +760,11 @@ sal_Bool OSelectionBrowseBox::saveField(const String& _sFieldName,OTableFieldDes sSql += ::dbtools::quoteName( xMetaData->getIdentifierQuoteString(), _sFieldName ); else sSql += _sFieldName; + if ( sFieldAlias.getLength() ) + { // always quote the alias name there canbe no function in it + sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ")); + sSql += ::dbtools::quoteName( xMetaData->getIdentifierQuoteString(), sFieldAlias ); + } sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" FROM x")); pParseNode = rParser.parseTree( sErrorMsg, sSql, bInternational ); diff --git a/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx b/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx index 6e81b8b15088..f052003c2c58 100644 --- a/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx +++ b/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx @@ -30,42 +30,22 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_dbaccess.hxx" -#ifndef DBAUI_RTABLECONNECTIONDATA_HXX #include "RTableConnectionData.hxx" -#endif -#ifndef _TOOLS_DEBUG_HXX #include <tools/debug.hxx> -#endif -#ifndef _COM_SUN_STAR_SDBC_KEYRULE_HPP_ #include <com/sun/star/sdbc/KeyRule.hpp> -#endif -#ifndef _COM_SUN_STAR_SDBCX_KEYTYPE_HPP_ #include <com/sun/star/sdbcx/KeyType.hpp> -#endif -#ifndef _COM_SUN_STAR_SDBCX_XKEYSSUPPLIER_HPP_ #include <com/sun/star/sdbcx/XKeysSupplier.hpp> -#endif -#ifndef _COM_SUN_STAR_SDBCX_XCOLUMNSSUPPLIER_HPP_ #include <com/sun/star/sdbcx/XColumnsSupplier.hpp> -#endif -#ifndef _COM_SUN_STAR_SDBCX_XDATADESCRIPTORFACTORY_HPP_ #include <com/sun/star/sdbcx/XDataDescriptorFactory.hpp> -#endif -#ifndef _COM_SUN_STAR_SDBCX_XAPPEND_HPP_ #include <com/sun/star/sdbcx/XAppend.hpp> -#endif -#ifndef _COM_SUN_STAR_SDBCX_XDROP_HPP_ #include <com/sun/star/sdbcx/XDrop.hpp> -#endif -#ifndef _COM_SUN_STAR_CONTAINER_XINDEXACCESS_HPP_ #include <com/sun/star/container/XIndexAccess.hpp> -#endif -#ifndef DBACCESS_SHARED_DBUSTRINGS_HRC #include "dbustrings.hrc" -#endif -#ifndef DBAUI_TOOLS_HXX +#include "dbu_rel.hrc" #include "UITools.hxx" -#endif +#include "moduledbu.hxx" +#include <connectivity/dbexception.hxx> + using namespace dbaui; using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::sdbcx; @@ -382,6 +362,7 @@ BOOL ORelationTableConnectionData::Update() // get the name of foreign key // search for columns m_aConnName = ::rtl::OUString(); xKey = NULL; + bool bDropRelation = false; for(sal_Int32 i=0;i<xKeys->getCount();++i) { xKeys->getByIndex(i) >>= xKey; @@ -426,6 +407,7 @@ BOOL ORelationTableConnectionData::Update() { xKey->getPropertyValue(PROPERTY_NAME) >>= sName; m_aConnName = sName; + bDropRelation = aNames.getLength() == 0; // the key contains no column, so it isn't valid and we have to drop it //here we already know our column structure so we don't have to recreate the table connection data xColSup.clear(); break; @@ -437,15 +419,20 @@ BOOL ORelationTableConnectionData::Update() } } xKey = NULL; + } // for(sal_Int32 i=0;i<xKeys->getCount();++i) + if ( bDropRelation ) + { + DropRelation(); + String sError(ModuleRes(STR_QUERY_REL_COULD_NOT_CREATE)); + ::dbtools::throwGenericSQLException(sError,NULL); } // OSL_ENSURE(xKey.is(),"No key found have insertion!"); + // The fields the relation marks may not be the same as our LineDatas mark after the relation has been updated if ( xColSup.is() ) { - // The fields the relation marks may not be the same as our LineDatas mark after the relation has been updated OConnectionLineDataVec().swap(m_vConnLineData); - Reference<XNameAccess> xColumns = xColSup->getColumns(); Sequence< ::rtl::OUString> aNames = xColumns->getElementNames(); const ::rtl::OUString* pIter = aNames.getConstArray(); @@ -470,7 +457,7 @@ BOOL ORelationTableConnectionData::Update() m_vConnLineData.push_back(pNewData); } } - } + } // if ( xColSup.is() ) // NOTE : the caller is resposible for updating any other objects referencing the old LineDatas (for instance a ConnLine) //////////////////////////////////////////////////////////// diff --git a/dbaccess/source/ui/relationdesign/relation.src b/dbaccess/source/ui/relationdesign/relation.src index e3fe71452fc8..391205223886 100644 --- a/dbaccess/source/ui/relationdesign/relation.src +++ b/dbaccess/source/ui/relationdesign/relation.src @@ -70,15 +70,15 @@ QueryBox RELATION_DESIGN_SAVEMODIFIED Message [ en-US ] = "The relation design has been changed.\nDo you want to save the changes?" ; }; -/* - The menubar resource has become obsolete - you can now find the menubar definition at: <project>/uiconfig/dbrelation/menubar/menubar.xml -*/ - String STR_QUERY_REL_DELETE_WINDOW { Text [ en-US ] = "When you delete this table all corresponding relations will be deleted as well. Continue?"; }; +String STR_QUERY_REL_COULD_NOT_CREATE +{ + Text [ en-US ] = "The datbase could not create the relation. May be foreign keys for this kind of table aren't supported.\nPlease check your documentation of the database."; +}; diff --git a/dbaccess/source/ui/tabledesign/FieldDescriptions.cxx b/dbaccess/source/ui/tabledesign/FieldDescriptions.cxx index a7ddd801fc51..4ece37f2fa51 100644 --- a/dbaccess/source/ui/tabledesign/FieldDescriptions.cxx +++ b/dbaccess/source/ui/tabledesign/FieldDescriptions.cxx @@ -578,6 +578,15 @@ TOTypeInfoSP OFieldDescription::getTypeInfo() const return m_pType; } // ----------------------------------------------------------------------------- +TOTypeInfoSP OFieldDescription::getSpecialTypeInfo() const +{ + TOTypeInfoSP pSpecialType( new OTypeInfo() ); + *pSpecialType = *m_pType; + pSpecialType->nPrecision = GetPrecision(); + pSpecialType->nMaximumScale = static_cast<sal_Int16>(GetScale()); + return pSpecialType; +} +// ----------------------------------------------------------------------------- sal_Bool OFieldDescription::IsAutoIncrement() const { if ( m_xDest.is() && m_xDestInfo->hasPropertyByName(PROPERTY_ISAUTOINCREMENT) ) diff --git a/dbaccess/source/ui/tabledesign/TEditControl.cxx b/dbaccess/source/ui/tabledesign/TEditControl.cxx index 29a8ca4951b3..353ff0ea11d5 100644 --- a/dbaccess/source/ui/tabledesign/TEditControl.cxx +++ b/dbaccess/source/ui/tabledesign/TEditControl.cxx @@ -349,6 +349,16 @@ void OTableEditorCtrl::InitCellController() pTypeCell->SetHelpId(HID_TABDESIGN_TYPECELL); pDescrCell->SetHelpId(HID_TABDESIGN_COMMENTCELL); + Size aHeight; + const Control* pControls[] = { pTypeCell,pDescrCell,pNameCell}; + for(sal_Size i= 0; i < sizeof(pControls)/sizeof(pControls[0]);++i) + { + const Size aTemp( pControls[i]->GetOptimalSize(WINDOWSIZE_PREFERRED) ); + if ( aTemp.Height() > aHeight.Height() ) + aHeight.Height() = aTemp.Height(); + } // for(int i= 0; i < sizeof(pControls)/sizeof(pControls[0]);++i + SetDataRowHeight(aHeight.Height()); + ClearModified(); } diff --git a/dbaccess/source/ui/tabledesign/TableController.cxx b/dbaccess/source/ui/tabledesign/TableController.cxx index d81cf5f9a5cf..f54c5104c955 100644 --- a/dbaccess/source/ui/tabledesign/TableController.cxx +++ b/dbaccess/source/ui/tabledesign/TableController.cxx @@ -1482,6 +1482,7 @@ void OTableController::alterColumns() // ----------------------------------------------------------------------------- void OTableController::dropPrimaryKey() { + SQLExceptionInfo aInfo; try { Reference<XKeysSupplier> xKeySup(m_xTable,UNO_QUERY); @@ -1506,11 +1507,24 @@ void OTableController::dropPrimaryKey() } } } + catch(const SQLContext& e) + { + aInfo = SQLExceptionInfo(e); + } + catch(const SQLWarning& e) + { + aInfo = SQLExceptionInfo(e); + } + catch(const SQLException& e) + { + aInfo = SQLExceptionInfo(e); + } catch( const Exception& ) { DBG_UNHANDLED_EXCEPTION(); } + showError(aInfo); } // ----------------------------------------------------------------------------- void OTableController::assignTable() diff --git a/dbaccess/source/ui/tabledesign/table.src b/dbaccess/source/ui/tabledesign/table.src index c242fcecd3b1..af911ec85c07 100644 --- a/dbaccess/source/ui/tabledesign/table.src +++ b/dbaccess/source/ui/tabledesign/table.src @@ -96,7 +96,7 @@ String STR_TAB_FIELD_COLUMN_NAME }; String STR_TAB_FIELD_DATATYPE { - Text [ en-US ] = "Field type" ; + Text [ en-US ] = "Field ~type" ; }; String STR_TAB_FIELD_COLUMN_DATATYPE { |