summaryrefslogtreecommitdiff
path: root/connectivity/source
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2009-06-05 09:47:55 +0000
committerKurt Zenker <kz@openoffice.org>2009-06-05 09:47:55 +0000
commit60698c8a619f219129dbeac7da1f962f3fa63f6a (patch)
tree7391337766d2e76725bab43dac16d18f9c409dbc /connectivity/source
parentc3e9297cb1fd34478e529f95892bcd93be9121ab (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 'connectivity/source')
-rw-r--r--connectivity/source/commontools/FValue.cxx45
-rw-r--r--connectivity/source/commontools/dbmetadata.cxx1
-rw-r--r--connectivity/source/commontools/dbtools.cxx76
-rw-r--r--connectivity/source/drivers/calc/CDriver.cxx6
-rw-r--r--connectivity/source/drivers/calc/CTable.cxx180
-rw-r--r--connectivity/source/drivers/dbase/DDatabaseMetaData.cxx50
-rw-r--r--connectivity/source/drivers/dbase/DTable.cxx595
-rw-r--r--connectivity/source/drivers/file/fanalyzer.cxx3
-rw-r--r--connectivity/source/drivers/jdbc/DatabaseMetaData.cxx1
-rw-r--r--connectivity/source/drivers/jdbc/PreparedStatement.cxx2
-rw-r--r--connectivity/source/drivers/jdbc/ResultSet.cxx1
-rw-r--r--connectivity/source/drivers/mozab/MConnection.cxx82
-rw-r--r--connectivity/source/drivers/mozab/MConnection.hxx28
-rw-r--r--connectivity/source/drivers/mozab/MDatabaseMetaData.cxx6
-rw-r--r--connectivity/source/drivers/mozab/MDriver.cxx4
-rw-r--r--connectivity/source/drivers/mozab/MResultSet.cxx75
-rw-r--r--connectivity/source/drivers/mozab/MStatement.cxx10
-rw-r--r--connectivity/source/drivers/mozab/mozillasrc/MDatabaseMetaDataHelper.cxx93
-rw-r--r--connectivity/source/drivers/mozab/mozillasrc/MDatabaseMetaDataHelper.hxx6
-rw-r--r--connectivity/source/drivers/mozab/mozillasrc/MErrorResource.hxx43
-rw-r--r--connectivity/source/drivers/mozab/mozillasrc/MQuery.cxx32
-rw-r--r--connectivity/source/drivers/mozab/mozillasrc/MQuery.hxx14
-rw-r--r--connectivity/source/drivers/mozab/mozillasrc/MQueryHelper.cxx18
-rw-r--r--connectivity/source/drivers/mozab/mozillasrc/MQueryHelper.hxx5
-rw-r--r--connectivity/source/drivers/mysql/YDriver.cxx2
-rw-r--r--connectivity/source/inc/dbase/DTable.hxx2
-rw-r--r--connectivity/source/inc/internalnode.hxx2
-rw-r--r--connectivity/source/inc/resource/mozab_res.hrc12
-rw-r--r--connectivity/source/parse/internalnode.cxx16
-rw-r--r--connectivity/source/parse/sqlbison.y47
-rw-r--r--connectivity/source/parse/sqlflex.l60
-rw-r--r--connectivity/source/parse/sqlnode.cxx182
-rw-r--r--connectivity/source/resource/conn_error_message.src8
-rw-r--r--connectivity/source/resource/conn_shared_res.src198
34 files changed, 1238 insertions, 667 deletions
diff --git a/connectivity/source/commontools/FValue.cxx b/connectivity/source/commontools/FValue.cxx
index a6da2b165612..433b5ffc69ec 100644
--- a/connectivity/source/commontools/FValue.cxx
+++ b/connectivity/source/commontools/FValue.cxx
@@ -35,6 +35,7 @@
#include "connectivity/FValue.hxx"
#include "connectivity/CommonTools.hxx"
#include <connectivity/dbconversion.hxx>
+#include <cppuhelper/extract.hxx>
#include <com/sun/star/io/XInputStream.hpp>
#include <rtl/logfile.hxx>
@@ -1811,15 +1812,17 @@ void ORowSetValue::fill(sal_Int32 _nPos,
sal_Int32 _nType,
const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow>& _xRow)
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbtools", "Ocke.Janssen@sun.com", "ORowSetValue::fill" );
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbtools", "Ocke.Janssen@sun.com", "ORowSetValue::fill (1)" );
fill(_nPos,_nType,sal_True,_xRow);
}
+
+// -----------------------------------------------------------------------------
void ORowSetValue::fill(sal_Int32 _nPos,
sal_Int32 _nType,
sal_Bool _bNullable,
const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow>& _xRow)
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbtools", "Ocke.Janssen@sun.com", "ORowSetValue::fill" );
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbtools", "Ocke.Janssen@sun.com", "ORowSetValue::fill (2)" );
sal_Bool bReadData = sal_True;
switch(_nType)
{
@@ -1888,7 +1891,8 @@ void ORowSetValue::fill(sal_Int32 _nPos,
setTypeKind(DataType::BLOB);
break;
default:
- bReadData = sal_False;
+ OSL_ENSURE( false, "ORowSetValue::fill: unsupported type!" );
+ bReadData = false;
break;
}
if ( bReadData && _bNullable && _xRow->wasNull() )
@@ -1898,7 +1902,7 @@ void ORowSetValue::fill(sal_Int32 _nPos,
// -----------------------------------------------------------------------------
void ORowSetValue::fill(const Any& _rValue)
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbtools", "Ocke.Janssen@sun.com", "ORowSetValue::fill" );
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbtools", "Ocke.Janssen@sun.com", "ORowSetValue::fill (3)" );
switch (_rValue.getValueType().getTypeClass())
{
case TypeClass_VOID:
@@ -1991,11 +1995,44 @@ void ORowSetValue::fill(const Any& _rValue)
setSigned(sal_False);
break;
}
+ case TypeClass_ENUM:
+ {
+ sal_Int32 enumValue( 0 );
+ ::cppu::enum2int( enumValue, _rValue );
+ (*this) = enumValue;
+ }
+ break;
+
case TypeClass_SEQUENCE:
{
Sequence<sal_Int8> aDummy;
if ( _rValue >>= aDummy )
(*this) = aDummy;
+ else
+ OSL_ENSURE( false, "ORowSetValue::fill: unsupported sequence type!" );
+ break;
+ }
+
+ case TypeClass_STRUCT:
+ {
+ ::com::sun::star::util::Date aDate;
+ ::com::sun::star::util::Time aTime;
+ ::com::sun::star::util::DateTime aDateTime;
+ if ( _rValue >>= aDate )
+ {
+ (*this) = aDate;
+ }
+ else if ( _rValue >>= aTime )
+ {
+ (*this) = aTime;
+ }
+ else if ( _rValue >>= aDateTime )
+ {
+ (*this) = aDateTime;
+ }
+ else
+ OSL_ENSURE( false, "ORowSetValue::fill: unsupported structure!" );
+
break;
}
diff --git a/connectivity/source/commontools/dbmetadata.cxx b/connectivity/source/commontools/dbmetadata.cxx
index c68fed6905ce..66d2791c3fce 100644
--- a/connectivity/source/commontools/dbmetadata.cxx
+++ b/connectivity/source/commontools/dbmetadata.cxx
@@ -297,6 +297,7 @@ namespace dbtools
}
catch( const Exception& )
{
+ DBG_UNHANDLED_EXCEPTION();
}
try
{
diff --git a/connectivity/source/commontools/dbtools.cxx b/connectivity/source/commontools/dbtools.cxx
index a1847c98d2ab..6730d7beb9ce 100644
--- a/connectivity/source/commontools/dbtools.cxx
+++ b/connectivity/source/commontools/dbtools.cxx
@@ -1711,13 +1711,63 @@ sal_Bool implSetObject( const Reference< XParameters >& _rxParameters,
}
//..................................................................
-
+namespace
+{
+ class OParameterWrapper : public ::cppu::WeakImplHelper1< XIndexAccess >
+ {
+ ::std::bit_vector m_aSet;
+ Reference<XIndexAccess> m_xSource;
+ public:
+ OParameterWrapper(const ::std::bit_vector& _aSet,const Reference<XIndexAccess>& _xSource) : m_aSet(_aSet),m_xSource(_xSource){}
+ private:
+ // ::com::sun::star::container::XElementAccess
+ virtual Type SAL_CALL getElementType() throw(RuntimeException)
+ {
+ return m_xSource->getElementType();
+ }
+ virtual sal_Bool SAL_CALL hasElements( ) throw(RuntimeException)
+ {
+ if ( m_aSet.empty() )
+ return m_xSource->hasElements();
+ return ::std::count(m_aSet.begin(),m_aSet.end(),false) != 0;
+ }
+ // ::com::sun::star::container::XIndexAccess
+ virtual sal_Int32 SAL_CALL getCount( ) throw(RuntimeException)
+ {
+ if ( m_aSet.empty() )
+ return m_xSource->getCount();
+ return ::std::count(m_aSet.begin(),m_aSet.end(),false);
+ }
+ virtual Any SAL_CALL getByIndex( sal_Int32 Index ) throw(IndexOutOfBoundsException, WrappedTargetException, RuntimeException)
+ {
+ if ( m_aSet.empty() )
+ return m_xSource->getByIndex(Index);
+ if ( m_aSet.size() < (size_t)Index )
+ throw IndexOutOfBoundsException();
+
+ ::std::bit_vector::iterator aIter = m_aSet.begin();
+ ::std::bit_vector::iterator aEnd = m_aSet.end();
+ sal_Int32 i = 0;
+ sal_Int32 nParamPos = -1;
+ for(; aIter != aEnd && i <= Index; ++aIter)
+ {
+ ++nParamPos;
+ if ( !*aIter )
+ {
+ ++i;
+ }
+ }
+ return m_xSource->getByIndex(nParamPos);
+ }
+ };
+}
// -----------------------------------------------------------------------------
void askForParameters(const Reference< XSingleSelectQueryComposer >& _xComposer,
const Reference<XParameters>& _xParameters,
const Reference< XConnection>& _xConnection,
- const Reference< XInteractionHandler >& _rxHandler)
+ const Reference< XInteractionHandler >& _rxHandler,
+ const ::std::bit_vector& _aParametersSet)
{
OSL_ENSURE(_xComposer.is(),"dbtools::askForParameters XSQLQueryComposer is null!");
OSL_ENSURE(_xParameters.is(),"dbtools::askForParameters XParameters is null!");
@@ -1730,7 +1780,7 @@ void askForParameters(const Reference< XSingleSelectQueryComposer >& _xComposer,
Reference<XIndexAccess> xParamsAsIndicies = xParameters.is() ? xParameters->getParameters() : Reference<XIndexAccess>();
Reference<XNameAccess> xParamsAsNames(xParamsAsIndicies, UNO_QUERY);
sal_Int32 nParamCount = xParamsAsIndicies.is() ? xParamsAsIndicies->getCount() : 0;
- if (nParamCount)
+ if ( (nParamCount && _aParametersSet.empty()) || ::std::count(_aParametersSet.begin(),_aParametersSet.end(),true) != nParamCount )
{
// build an interaction request
// two continuations (Ok and Cancel)
@@ -1738,7 +1788,8 @@ void askForParameters(const Reference< XSingleSelectQueryComposer >& _xComposer,
OParameterContinuation* pParams = new OParameterContinuation;
// the request
ParametersRequest aRequest;
- aRequest.Parameters = xParamsAsIndicies;
+ Reference<XIndexAccess> xWrappedParameters = new OParameterWrapper(_aParametersSet,xParamsAsIndicies);
+ aRequest.Parameters = xWrappedParameters;
aRequest.Connection = _xConnection;
OInteractionRequest* pRequest = new OInteractionRequest(makeAny(aRequest));
Reference< XInteractionRequest > xRequest(pRequest);
@@ -1762,8 +1813,7 @@ void askForParameters(const Reference< XSingleSelectQueryComposer >& _xComposer,
const PropertyValue* pFinalValues = aFinalValues.getConstArray();
for (sal_Int32 i=0; i<aFinalValues.getLength(); ++i, ++pFinalValues)
{
- Reference< XPropertySet > xParamColumn;
- ::cppu::extractInterface(xParamColumn, xParamsAsIndicies->getByIndex(i));
+ Reference< XPropertySet > xParamColumn(xWrappedParameters->getByIndex(i),UNO_QUERY);
if (xParamColumn.is())
{
#ifdef DBG_UTIL
@@ -1779,7 +1829,19 @@ void askForParameters(const Reference< XSingleSelectQueryComposer >& _xComposer,
if (hasProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCALE), xParamColumn))
xParamColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCALE)) >>= nScale;
// and set the value
- _xParameters->setObjectWithInfo(i + 1, pFinalValues->Value, nParamType, nScale);
+ ::std::bit_vector::const_iterator aIter = _aParametersSet.begin();
+ ::std::bit_vector::const_iterator aEnd = _aParametersSet.end();
+ sal_Int32 j = 0;
+ sal_Int32 nParamPos = -1;
+ for(; aIter != aEnd && j <= i; ++aIter)
+ {
+ ++nParamPos;
+ if ( !*aIter )
+ {
+ ++j;
+ }
+ }
+ _xParameters->setObjectWithInfo(nParamPos + 1, pFinalValues->Value, nParamType, nScale);
// (the index of the parameters is one-based)
}
}
diff --git a/connectivity/source/drivers/calc/CDriver.cxx b/connectivity/source/drivers/calc/CDriver.cxx
index df3937803190..525ef9596317 100644
--- a/connectivity/source/drivers/calc/CDriver.cxx
+++ b/connectivity/source/drivers/calc/CDriver.cxx
@@ -91,11 +91,7 @@ Reference< XConnection > SAL_CALL ODriver::connect( const ::rtl::OUString& url,
sal_Bool SAL_CALL ODriver::acceptsURL( const ::rtl::OUString& url )
throw(SQLException, RuntimeException)
{
- if(!url.compareTo(::rtl::OUString::createFromAscii("sdbc:calc:"),10))
- {
- return sal_True;
- }
- return sal_False;
+ return url.compareTo(::rtl::OUString::createFromAscii("sdbc:calc:"),10) == 0;
}
Sequence< DriverPropertyInfo > SAL_CALL ODriver::getPropertyInfo( const ::rtl::OUString& url, const Sequence< PropertyValue >& /*info*/ ) throw(SQLException, RuntimeException)
diff --git a/connectivity/source/drivers/calc/CTable.cxx b/connectivity/source/drivers/calc/CTable.cxx
index 2d35c16c11dd..91f917224496 100644
--- a/connectivity/source/drivers/calc/CTable.cxx
+++ b/connectivity/source/drivers/calc/CTable.cxx
@@ -164,11 +164,11 @@ CellContentType lcl_GetContentOrResultType( const Reference<XCell>& xCell )
CellContentType eCellType = xCell->getType();
if ( eCellType == CellContentType_FORMULA )
{
+ static const ::rtl::OUString s_sFormulaResultType(RTL_CONSTASCII_USTRINGPARAM("FormulaResultType"));
Reference<XPropertySet> xProp( xCell, UNO_QUERY );
try
{
- static ::rtl::OUString s_FormulaResultType(RTL_CONSTASCII_USTRINGPARAM("FormulaResultType"));
- xProp->getPropertyValue( s_FormulaResultType ) >>= eCellType; // type of formula result
+ xProp->getPropertyValue( s_sFormulaResultType ) >>= eCellType; // type of formula result
}
catch (UnknownPropertyException&)
{
@@ -346,101 +346,101 @@ void lcl_SetValue( ORowSetValue& rValue, const Reference<XSpreadsheet>& xSheet,
const Reference<XCell> xCell = xSheet->getCellByPosition( nDocColumn, nDocRow );
if ( xCell.is() )
{
- if ( DataType::VARCHAR == nType )
+ CellContentType eCellType = lcl_GetContentOrResultType( xCell );
+ switch (nType)
{
- // no difference between empty cell and empty string in spreadsheet
- const Reference<XText> xText( xCell, UNO_QUERY );
- if ( xText.is() )
- rValue = xText->getString();
- }
- else
- {
- CellContentType eCellType = lcl_GetContentOrResultType( xCell );
- switch (nType)
- {
- case DataType::DECIMAL:
- if ( eCellType == CellContentType_VALUE )
- rValue = xCell->getValue(); // double
- else
- rValue.setNull();
- break;
- case DataType::BIT:
- if ( eCellType == CellContentType_VALUE )
- rValue = (sal_Bool)( xCell->getValue() != 0.0 );
- else
- rValue.setNull();
- break;
- case DataType::DATE:
- if ( eCellType == CellContentType_VALUE )
- {
- ::Date aDate( rNullDate );
- aDate += (long)::rtl::math::approxFloor( xCell->getValue() );
- ::com::sun::star::util::Date aDateStruct( aDate.GetDay(), aDate.GetMonth(), aDate.GetYear() );
- rValue = aDateStruct;
- }
- else
- rValue.setNull();
- break;
- case DataType::TIME:
- if ( eCellType == CellContentType_VALUE )
+ case DataType::VARCHAR:
+ if ( eCellType == CellContentType_TEXT )
+ {
+ const Reference<XText> xText( xCell, UNO_QUERY );
+ if ( xText.is() )
+ rValue = xText->getString();
+ } // if ( eCellType == CellContentType_TEXT )
+ else
+ rValue.setNull();
+ break;
+ case DataType::DECIMAL:
+ if ( eCellType == CellContentType_VALUE )
+ rValue = xCell->getValue(); // double
+ else
+ rValue.setNull();
+ break;
+ case DataType::BIT:
+ if ( eCellType == CellContentType_VALUE )
+ rValue = (sal_Bool)( xCell->getValue() != 0.0 );
+ else
+ rValue.setNull();
+ break;
+ case DataType::DATE:
+ if ( eCellType == CellContentType_VALUE )
+ {
+ ::Date aDate( rNullDate );
+ aDate += (long)::rtl::math::approxFloor( xCell->getValue() );
+ ::com::sun::star::util::Date aDateStruct( aDate.GetDay(), aDate.GetMonth(), aDate.GetYear() );
+ rValue = aDateStruct;
+ }
+ else
+ rValue.setNull();
+ break;
+ case DataType::TIME:
+ if ( eCellType == CellContentType_VALUE )
+ {
+ double fCellVal = xCell->getValue();
+ double fTime = fCellVal - rtl::math::approxFloor( fCellVal );
+ long nIntTime = (long)rtl::math::round( fTime * 8640000.0 );
+ if ( nIntTime == 8640000 )
+ nIntTime = 0; // 23:59:59.995 and above is 00:00:00.00
+ ::com::sun::star::util::Time aTime;
+ aTime.HundredthSeconds = (sal_uInt16)( nIntTime % 100 );
+ nIntTime /= 100;
+ aTime.Seconds = (sal_uInt16)( nIntTime % 60 );
+ nIntTime /= 60;
+ aTime.Minutes = (sal_uInt16)( nIntTime % 60 );
+ nIntTime /= 60;
+ OSL_ENSURE( nIntTime < 24, "error in time calculation" );
+ aTime.Hours = (sal_uInt16) nIntTime;
+ rValue = aTime;
+ }
+ else
+ rValue.setNull();
+ break;
+ case DataType::TIMESTAMP:
+ if ( eCellType == CellContentType_VALUE )
+ {
+ double fCellVal = xCell->getValue();
+ double fDays = ::rtl::math::approxFloor( fCellVal );
+ double fTime = fCellVal - fDays;
+ long nIntDays = (long)fDays;
+ long nIntTime = (long)::rtl::math::round( fTime * 8640000.0 );
+ if ( nIntTime == 8640000 )
{
- double fCellVal = xCell->getValue();
- double fTime = fCellVal - rtl::math::approxFloor( fCellVal );
- long nIntTime = (long)rtl::math::round( fTime * 8640000.0 );
- if ( nIntTime == 8640000 )
- nIntTime = 0; // 23:59:59.995 and above is 00:00:00.00
- ::com::sun::star::util::Time aTime;
- aTime.HundredthSeconds = (sal_uInt16)( nIntTime % 100 );
- nIntTime /= 100;
- aTime.Seconds = (sal_uInt16)( nIntTime % 60 );
- nIntTime /= 60;
- aTime.Minutes = (sal_uInt16)( nIntTime % 60 );
- nIntTime /= 60;
- OSL_ENSURE( nIntTime < 24, "error in time calculation" );
- aTime.Hours = (sal_uInt16) nIntTime;
- rValue = aTime;
+ nIntTime = 0; // 23:59:59.995 and above is 00:00:00.00
+ ++nIntDays; // (next day)
}
- else
- rValue.setNull();
- break;
- case DataType::TIMESTAMP:
- if ( eCellType == CellContentType_VALUE )
- {
- double fCellVal = xCell->getValue();
- double fDays = ::rtl::math::approxFloor( fCellVal );
- double fTime = fCellVal - fDays;
- long nIntDays = (long)fDays;
- long nIntTime = (long)::rtl::math::round( fTime * 8640000.0 );
- if ( nIntTime == 8640000 )
- {
- nIntTime = 0; // 23:59:59.995 and above is 00:00:00.00
- ++nIntDays; // (next day)
- }
- ::com::sun::star::util::DateTime aDateTime;
+ ::com::sun::star::util::DateTime aDateTime;
- aDateTime.HundredthSeconds = (sal_uInt16)( nIntTime % 100 );
- nIntTime /= 100;
- aDateTime.Seconds = (sal_uInt16)( nIntTime % 60 );
- nIntTime /= 60;
- aDateTime.Minutes = (sal_uInt16)( nIntTime % 60 );
- nIntTime /= 60;
- OSL_ENSURE( nIntTime < 24, "error in time calculation" );
- aDateTime.Hours = (sal_uInt16) nIntTime;
+ aDateTime.HundredthSeconds = (sal_uInt16)( nIntTime % 100 );
+ nIntTime /= 100;
+ aDateTime.Seconds = (sal_uInt16)( nIntTime % 60 );
+ nIntTime /= 60;
+ aDateTime.Minutes = (sal_uInt16)( nIntTime % 60 );
+ nIntTime /= 60;
+ OSL_ENSURE( nIntTime < 24, "error in time calculation" );
+ aDateTime.Hours = (sal_uInt16) nIntTime;
- ::Date aDate( rNullDate );
- aDate += nIntDays;
- aDateTime.Day = aDate.GetDay();
- aDateTime.Month = aDate.GetMonth();
- aDateTime.Year = aDate.GetYear();
+ ::Date aDate( rNullDate );
+ aDate += nIntDays;
+ aDateTime.Day = aDate.GetDay();
+ aDateTime.Month = aDate.GetMonth();
+ aDateTime.Year = aDate.GetYear();
- rValue = aDateTime;
- }
- else
- rValue.setNull();
- break;
- } // switch (nType)
- }
+ rValue = aDateTime;
+ }
+ else
+ rValue.setNull();
+ break;
+ } // switch (nType)
}
// rValue.setTypeKind(nType);
diff --git a/connectivity/source/drivers/dbase/DDatabaseMetaData.cxx b/connectivity/source/drivers/dbase/DDatabaseMetaData.cxx
index 469656bcbf11..bcc734c0e07a 100644
--- a/connectivity/source/drivers/dbase/DDatabaseMetaData.cxx
+++ b/connectivity/source/drivers/dbase/DDatabaseMetaData.cxx
@@ -87,8 +87,8 @@ Reference< XResultSet > ODbaseDatabaseMetaData::impl_getTypeInfo_throw( )
aRow.reserve(18);
aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
- aRow.push_back(new ORowSetValueDecorator(::rtl::OUString::createFromAscii("CHAR")));
- aRow.push_back(new ORowSetValueDecorator(DataType::CHAR));
+ aRow.push_back(new ORowSetValueDecorator(::rtl::OUString::createFromAscii("VARCHAR")));
+ aRow.push_back(new ORowSetValueDecorator(DataType::VARCHAR));
aRow.push_back(new ORowSetValueDecorator((sal_Int32)254));
aRow.push_back(ODatabaseMetaDataResultSet::getQuoteValue());
aRow.push_back(ODatabaseMetaDataResultSet::getQuoteValue());
@@ -99,7 +99,7 @@ Reference< XResultSet > ODbaseDatabaseMetaData::impl_getTypeInfo_throw( )
aRow.push_back(ODatabaseMetaDataResultSet::get1Value());
aRow.push_back(ODatabaseMetaDataResultSet::get0Value());
aRow.push_back(ODatabaseMetaDataResultSet::get0Value());
- aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
+ aRow.push_back(new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("C"))));
aRow.push_back(ODatabaseMetaDataResultSet::get0Value());
aRow.push_back(ODatabaseMetaDataResultSet::get0Value());
aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
@@ -108,23 +108,17 @@ Reference< XResultSet > ODbaseDatabaseMetaData::impl_getTypeInfo_throw( )
aRows.push_back(aRow);
- aRow[1] = new ORowSetValueDecorator(::rtl::OUString::createFromAscii("VARCHAR"));
- aRow[2] = new ORowSetValueDecorator(DataType::VARCHAR);
- aRow[4] = ODatabaseMetaDataResultSet::getQuoteValue();
- aRow[5] = ODatabaseMetaDataResultSet::getQuoteValue();
- aRow[6] = new ORowSetValueDecorator(::rtl::OUString::createFromAscii("length"));
- aRows.push_back(aRow);
-
-
aRow[1] = new ORowSetValueDecorator(::rtl::OUString::createFromAscii("LONGVARCHAR"));
aRow[2] = new ORowSetValueDecorator(DataType::LONGVARCHAR);
- aRow[3] = new ORowSetValueDecorator((sal_Int32)65535);
+ aRow[3] = new ORowSetValueDecorator((sal_Int32)2147483647);
aRow[6] = new ORowSetValueDecorator();
+ aRow[13] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("M")));
aRows.push_back(aRow);
aRow[1] = new ORowSetValueDecorator(::rtl::OUString::createFromAscii("DATE"));
aRow[2] = new ORowSetValueDecorator(DataType::DATE);
aRow[3] = new ORowSetValueDecorator((sal_Int32)10);
+ aRow[13] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("D")));
aRows.push_back(aRow);
aRow[1] = new ORowSetValueDecorator(::rtl::OUString::createFromAscii("BOOLEAN"));
@@ -134,13 +128,43 @@ Reference< XResultSet > ODbaseDatabaseMetaData::impl_getTypeInfo_throw( )
aRow[5] = ODatabaseMetaDataResultSet::getEmptyValue();
aRow[6] = new ORowSetValueDecorator(::rtl::OUString());
aRow[9] = ODatabaseMetaDataResultSet::getBasicValue();
+ aRow[13] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("L")));
+ aRows.push_back(aRow);
+
+ aRow[1] = new ORowSetValueDecorator(::rtl::OUString::createFromAscii("DOUBLE"));
+ aRow[2] = new ORowSetValueDecorator(DataType::DOUBLE);
+ aRow[3] = new ORowSetValueDecorator((sal_Int32)8);
+ aRow[13] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("B")));
+ aRows.push_back(aRow);
+
+ aRow[11] = new ORowSetValueDecorator(sal_True);
+ aRow[13] = new ORowSetValueDecorator(::rtl::OUString::createFromAscii("Y"));
+ aRows.push_back(aRow);
+
+ aRow[1] = new ORowSetValueDecorator(::rtl::OUString::createFromAscii("TIMESTAMP"));
+ aRow[2] = new ORowSetValueDecorator(DataType::TIMESTAMP);
+ aRow[11] = new ORowSetValueDecorator(sal_False);
+ aRow[13] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("T")));
+ aRows.push_back(aRow);
+
+ aRow[1] = new ORowSetValueDecorator(::rtl::OUString::createFromAscii("INTEGER"));
+ aRow[2] = new ORowSetValueDecorator(DataType::INTEGER);
+ aRow[3] = new ORowSetValueDecorator((sal_Int32)10);
+ aRow[13] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("I")));
aRows.push_back(aRow);
aRow[1] = new ORowSetValueDecorator(::rtl::OUString::createFromAscii("DECIMAL"));
aRow[2] = new ORowSetValueDecorator(DataType::DECIMAL);
aRow[3] = new ORowSetValueDecorator((sal_Int32)20);
aRow[6] = new ORowSetValueDecorator(::rtl::OUString::createFromAscii("length,scale"));
- aRow[15] = new ORowSetValueDecorator((sal_Int32)20);
+ aRow[13] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("F")));
+ aRows.push_back(aRow);
+
+ aRow[1] = new ORowSetValueDecorator(::rtl::OUString::createFromAscii("NUMERIC"));
+ aRow[2] = new ORowSetValueDecorator(DataType::DECIMAL);
+ aRow[3] = new ORowSetValueDecorator((sal_Int32)16);
+ aRow[13] = new ORowSetValueDecorator(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("N")));
+ aRow[15] = new ORowSetValueDecorator((sal_Int32)16);
aRows.push_back(aRow);
}
diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx
index 5449235eb739..1c5210bfcdc6 100644
--- a/connectivity/source/drivers/dbase/DTable.cxx
+++ b/connectivity/source/drivers/dbase/DTable.cxx
@@ -42,8 +42,10 @@
#include <tools/config.hxx>
#include "dbase/DIndex.hxx"
#include "dbase/DIndexes.hxx"
+//#include "file/FDriver.hxx"
#include <comphelper/sequence.hxx>
#include <svtools/zforlist.hxx>
+#include <svtools/syslocale.hxx>
#include <rtl/math.hxx>
#include <stdio.h> //sprintf
#include <ucbhelper/content.hxx>
@@ -52,6 +54,7 @@
#include <connectivity/dbconversion.hxx>
#include <com/sun/star/lang/DisposedException.hpp>
#include <comphelper/property.hxx>
+//#include <unotools/calendarwrapper.hxx>
#include <unotools/tempfile.hxx>
#include <unotools/ucbhelper.hxx>
#include <comphelper/types.hxx>
@@ -81,15 +84,14 @@ using namespace ::com::sun::star::sdbcx;
using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::i18n;
// stored as the Field Descriptor terminator
#define FIELD_DESCRIPTOR_TERMINATOR 0x0D
#define DBF_EOL 0x1A
-//==================================================================
namespace
{
-//==================================================================
sal_Int32 lcl_getFileSize(SvStream& _rStream)
{
sal_Int32 nFileSize = 0;
@@ -102,9 +104,123 @@ sal_Int32 lcl_getFileSize(SvStream& _rStream)
nFileSize -= 1;
return nFileSize;
}
-//==================================================================
+/**
+ calculates the Julian date
+*/
+void lcl_CalcJulDate(sal_Int32& _nJulianDate,sal_Int32& _nJulianTime,const com::sun::star::util::DateTime _aDateTime)
+{
+ com::sun::star::util::DateTime aDateTime = _aDateTime;
+ // weird: months fix
+ if (aDateTime.Month > 12)
+ {
+ aDateTime.Month--;
+ sal_uInt16 delta = _aDateTime.Month / 12;
+ aDateTime.Year += delta;
+ aDateTime.Month -= delta * 12;
+ aDateTime.Month++;
+ }
+
+ _nJulianTime = ((aDateTime.Hours*3600000)+(aDateTime.Minutes*60000)+(aDateTime.Seconds*1000)+(aDateTime.HundredthSeconds*10));
+ /* conversion factors */
+ sal_uInt16 iy0;
+ sal_uInt16 im0;
+ if ( aDateTime.Month <= 2 )
+ {
+ iy0 = aDateTime.Year - 1;
+ im0 = aDateTime.Month + 12;
+ }
+ else
+ {
+ iy0 = aDateTime.Year;
+ im0 = aDateTime.Month;
+ }
+ sal_Int32 ia = iy0 / 100;
+ sal_Int32 ib = 2 - ia + (ia >> 2);
+ /* calculate julian date */
+ if ( aDateTime.Year <= 0 )
+ {
+ _nJulianDate = (sal_Int32) ((365.25 * iy0) - 0.75)
+ + (sal_Int32) (30.6001 * (im0 + 1) )
+ + aDateTime.Day + 1720994;
+ } // if ( _aDateTime.Year <= 0 )
+ else
+ {
+ _nJulianDate = static_cast<sal_Int32>( ((365.25 * iy0)
+ + (sal_Int32) (30.6001 * (im0 + 1))
+ + aDateTime.Day + 1720994));
+ }
+ double JD = _nJulianDate + 0.5;
+ _nJulianDate = (sal_Int32)( JD + 0.5);
+ const double gyr = aDateTime.Year + (0.01 * aDateTime.Month) + (0.0001 * aDateTime.Day);
+ if ( gyr >= 1582.1015 ) /* on or after 15 October 1582 */
+ _nJulianDate += ib;
+}
+
+/**
+ calculates date time from the Julian Date
+*/
+void lcl_CalDate(sal_Int32 _nJulianDate,sal_Int32 _nJulianTime,com::sun::star::util::DateTime& _rDateTime)
+{
+ if ( _nJulianDate )
+ {
+ sal_Int32 ialp;
+ sal_Int32 ka = _nJulianDate;
+ if ( _nJulianDate >= 2299161 )
+ {
+ ialp = (sal_Int32)( ((double) _nJulianDate - 1867216.25 ) / ( 36524.25 ));
+ ka = _nJulianDate + 1 + ialp - ( ialp >> 2 );
+ }
+ sal_Int32 kb = ka + 1524;
+ sal_Int32 kc = (sal_Int32) ( ((double) kb - 122.1 ) / 365.25 );
+ sal_Int32 kd = (sal_Int32) ((double) kc * 365.25);
+ sal_Int32 ke = (sal_Int32) ((double) ( kb - kd ) / 30.6001 );
+ _rDateTime.Day = static_cast<sal_uInt16>(kb - kd - ((sal_Int32) ( (double) ke * 30.6001 )));
+ if ( ke > 13 )
+ _rDateTime.Month = static_cast<sal_uInt16>(ke - 13);
+ else
+ _rDateTime.Month = static_cast<sal_uInt16>(ke - 1);
+ if ( (_rDateTime.Month == 2) && (_rDateTime.Day > 28) )
+ _rDateTime.Day = 29;
+ if ( (_rDateTime.Month == 2) && (_rDateTime.Day == 29) && (ke == 3) )
+ _rDateTime.Year = static_cast<sal_uInt16>(kc - 4716);
+ else if ( _rDateTime.Month > 2 )
+ _rDateTime.Year = static_cast<sal_uInt16>(kc - 4716);
+ else
+ _rDateTime.Year = static_cast<sal_uInt16>(kc - 4715);
+ } // if ( _nJulianDate )
+
+ if ( _nJulianTime )
+ {
+ double d_s = _nJulianTime / 1000;
+ double d_m = d_s / 60;
+ double d_h = d_m / 60;
+ _rDateTime.Hours = (sal_uInt16) (d_h);
+ _rDateTime.Minutes = (sal_uInt16) d_m; // integer _aDateTime.Minutes
+ //// weird: time fix
+ // int test = (_rDateTime.Hours % 3) * 100 + _rDateTime.Minutes;
+ //int test_tbl[] = {0, 1, 2, 11, 12, 13, 22, 23, 24, 25, 34, 35, 36,
+ // 45, 46, 47, 56, 57, 58, 107, 108, 109, 110, 119, 120, 121,
+ // 130, 131, 132, 141, 142, 143, 152, 153, 154, 155, 204, 205,
+ // 206, 215, 216, 217, 226, 227, 228, 237, 238, 239, 240, 249,
+ // 250, 251};
+ // for (int i = 0; i < sizeof(test_tbl)/sizeof(test_tbl[0]); i++)
+ //{
+ // if (test == test_tbl[i])
+ // {
+ // // frac += 0.000012;
+ // //d_hour = frac * 24.0;
+ // _rDateTime.Hours = (sal_uInt16)d_hour;
+ // d_minute = (d_hour - (double)_rDateTime.Hours) * 60.0;
+ // _rDateTime.Minutes = (sal_uInt16)d_minute;
+ // break;
+ // }
+ // }
+
+ _rDateTime.Seconds = static_cast<sal_uInt16>(( d_m - (double) _rDateTime.Minutes ) * 60.0);
+ }
+}
+
}
-//==================================================================
// -------------------------------------------------------------------------
void ODbaseTable::readHeader()
@@ -152,6 +268,7 @@ void ODbaseTable::readHeader()
case dBaseIV:
case dBaseV:
case VisualFoxPro:
+ case VisualFoxProAuto:
case dBaseFS:
case dBaseFSMemo:
case dBaseIVMemoSQL:
@@ -227,6 +344,7 @@ void ODbaseTable::fillColumns()
::rtl::OUString aTypeName;
static const ::rtl::OUString sVARCHAR(RTL_CONSTASCII_USTRINGPARAM("VARCHAR"));
const sal_Bool bCase = getConnection()->getMetaData()->storesMixedCaseQuotedIdentifiers();
+ const bool bFoxPro = m_aHeader.db_typ == VisualFoxPro || m_aHeader.db_typ == VisualFoxProAuto || m_aHeader.db_typ == FoxProMemo;
sal_Int32 i = 0;
for (; i < nFieldCount; i++)
@@ -236,61 +354,96 @@ void ODbaseTable::fillColumns()
if ( FIELD_DESCRIPTOR_TERMINATOR == aDBFColumn.db_fnm[0] ) // 0x0D stored as the Field Descriptor terminator.
break;
+ sal_Bool bIsRowVersion = bFoxPro && ( aDBFColumn.db_frei2[0] & 0x01 ) == 0x01;
+ //if ( bFoxPro && ( aDBFColumn.db_frei2[0] & 0x01 ) == 0x01 ) // system column not visible to user
+ // continue;
const String aColumnName((const char *)aDBFColumn.db_fnm,m_eEncoding);
+ m_aRealFieldLengths.push_back(aDBFColumn.db_flng);
sal_Int32 nPrecision = aDBFColumn.db_flng;
sal_Int32 eType;
+ sal_Bool bIsCurrency = sal_False;
+
+ char cType[2];
+ cType[0] = aDBFColumn.db_typ;
+ cType[1] = 0;
+ aTypeName = ::rtl::OUString::createFromAscii(cType);
switch (aDBFColumn.db_typ)
{
case 'C':
- eType = DataType::VARCHAR;
- aTypeName = sVARCHAR;
+ eType = DataType::CHAR;
+ aTypeName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VARCHAR"));
break;
case 'F':
+ aTypeName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DECIMAL"));
case 'N':
+ if ( aDBFColumn.db_typ == 'N' )
+ aTypeName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("NUMERIC"));
eType = DataType::DECIMAL;
- aTypeName = ::rtl::OUString::createFromAscii("DECIMAL");
// Bei numerischen Feldern werden zwei Zeichen mehr geschrieben, als die Precision der Spaltenbeschreibung eigentlich
// angibt, um Platz fuer das eventuelle Vorzeichen und das Komma zu haben. Das muss ich jetzt aber wieder rausrechnen.
nPrecision = SvDbaseConverter::ConvertPrecisionToOdbc(nPrecision,aDBFColumn.db_dez);
// leider gilt das eben Gesagte nicht fuer aeltere Versionen ....
- ;
break;
case 'L':
eType = DataType::BIT;
- aTypeName = ::rtl::OUString::createFromAscii("BIT");
+ aTypeName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BOOLEAN"));
+ break;
+ case 'Y':
+ bIsCurrency = sal_True;
+ eType = DataType::DOUBLE;
+ aTypeName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DOUBLE"));
break;
case 'D':
eType = DataType::DATE;
- aTypeName = ::rtl::OUString::createFromAscii("DATE");
+ aTypeName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DATE"));
+ break;
+ case 'T':
+ eType = DataType::TIMESTAMP;
+ aTypeName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TIMESTAMP"));
+ break;
+ case 'I':
+ eType = DataType::INTEGER;
+ aTypeName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("INTEGER"));
break;
case 'M':
- eType = DataType::LONGVARCHAR;
- aTypeName = ::rtl::OUString::createFromAscii("LONGVARCHAR");
- nPrecision = 65535;
+ if ( bFoxPro && ( aDBFColumn.db_frei2[0] & 0x04 ) == 0x04 )
+ {
+ eType = DataType::LONGVARBINARY;
+ aTypeName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LONGVARBINARY"));
+ }
+ else
+ {
+ aTypeName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LONGVARCHAR"));
+ eType = DataType::LONGVARCHAR;
+ }
+ nPrecision = 2147483647;
+ break;
+ case 'P':
+ aTypeName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LONGVARBINARY"));
+ eType = DataType::LONGVARBINARY;
+ nPrecision = 2147483647;
+ break;
+ case '0':
+ case 'B':
+ if ( m_aHeader.db_typ == VisualFoxPro || m_aHeader.db_typ == VisualFoxProAuto )
+ {
+ aTypeName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DOUBLE"));
+ eType = DataType::DOUBLE;
+ }
+ else
+ {
+ aTypeName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LONGVARBINARY"));
+ eType = DataType::LONGVARBINARY;
+ nPrecision = 2147483647;
+ }
break;
default:
- aTypeName = ::rtl::OUString::createFromAscii("OTHER");
eType = DataType::OTHER;
-
}
-// sal_Int32 nFlags = 0;
-// switch (aDBFColumn.db_typ)
-// {
-// case 'C':
-// case 'D':
-// case 'L': nFlags = ColumnSearch::FULL; break;
-// case 'F':
-// case 'N': nFlags = ColumnSearch::BASIC; break;
-// case 'M': nFlags = ColumnSearch::CHAR; break;
-// default:
-// nFlags = ColumnSearch::NONE;
-//
-// }
-
m_aTypes.push_back(eType);
m_aPrecisions.push_back(nPrecision);
m_aScales.push_back(aDBFColumn.db_dez);
@@ -303,8 +456,8 @@ void ODbaseTable::fillColumns()
aDBFColumn.db_dez,
eType,
sal_False,
- sal_False,
- sal_False,
+ bIsRowVersion,
+ bIsCurrency,
bCase);
m_aColumns->get().push_back(xCol);
} // for (; i < nFieldCount; i++)
@@ -380,7 +533,7 @@ void ODbaseTable::construct()
// Memo-Dateinamen bilden (.DBT):
// nyi: Unschoen fuer Unix und Mac!
- if ( m_aHeader.db_typ == FoxProMemo || VisualFoxPro == m_aHeader.db_typ ) // foxpro uses another extension
+ if ( m_aHeader.db_typ == FoxProMemo || VisualFoxPro == m_aHeader.db_typ || VisualFoxProAuto == m_aHeader.db_typ ) // foxpro uses another extension
aURL.SetExtension(String::CreateFromAscii("fpt"));
else
aURL.SetExtension(String::CreateFromAscii("dbt"));
@@ -465,6 +618,7 @@ BOOL ODbaseTable::ReadMemoHeader()
}
break;
case VisualFoxPro:
+ case VisualFoxProAuto:
case FoxProMemo:
m_aMemoHeader.db_typ = MemoFoxPro;
m_pMemoStream->Seek(6L);
@@ -693,15 +847,23 @@ sal_Bool ODbaseTable::fetchRow(OValueRefRow& _rRow,const OSQLColumns & _rCols, s
}
switch(nType)
{
- case DataType::DATE: nLen = 8; break;
+ case DataType::INTEGER:
+ case DataType::DOUBLE:
+ case DataType::TIMESTAMP:
+ case DataType::DATE:
+ case DataType::BIT:
+ case DataType::LONGVARCHAR:
+ case DataType::LONGVARBINARY:
+ nLen = m_aRealFieldLengths[i-1];
+ break;
case DataType::DECIMAL:
if(_bUseTableDefs)
nLen = SvDbaseConverter::ConvertPrecisionToDbase(nLen,m_aScales[i-1]);
else
nLen = SvDbaseConverter::ConvertPrecisionToDbase(nLen,getINT32((*aIter)->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCALE))));
break; // das Vorzeichen und das Komma
- case DataType::BIT: nLen = 1; break;
- case DataType::LONGVARCHAR: nLen = 10; break;
+
+ case DataType::BINARY:
case DataType::OTHER:
nByteOffset += nLen;
continue;
@@ -714,7 +876,9 @@ sal_Bool ODbaseTable::fetchRow(OValueRefRow& _rRow,const OSQLColumns & _rCols, s
nByteOffset += nLen;
OSL_ENSURE( nByteOffset <= m_nBufferSize ,"ByteOffset > m_nBufferSize!");
continue;
- }
+ } // if ( !(_rRow->get())[i]->isBound() )
+ if ( ( nByteOffset + nLen) > m_nBufferSize )
+ break; // length doesn't match buffer size.
char *pData = (char *) (m_pBuffer + nByteOffset);
@@ -733,6 +897,48 @@ sal_Bool ODbaseTable::fetchRow(OValueRefRow& _rRow,const OSQLColumns & _rCols, s
(_rRow->get())[i]->setNull();
pData[nLen] = cLast;
+ } // if (nType == DataType::CHAR || nType == DataType::VARCHAR)
+ else if ( DataType::TIMESTAMP == nType )
+ {
+ sal_Int32 nDate = 0,nTime = 0;
+ memcpy(&nDate, pData, 4);
+ memcpy(&nTime, pData+ 4, 4);
+ if ( !nDate && !nTime )
+ {
+ (_rRow->get())[i]->setNull();
+ }
+ else
+ {
+ ::com::sun::star::util::DateTime aDateTime;
+ lcl_CalDate(nDate,nTime,aDateTime);
+ *(_rRow->get())[i] = aDateTime;
+ }
+ }
+ else if ( DataType::INTEGER == nType )
+ {
+ sal_Int32 nValue = 0;
+ memcpy(&nValue, pData, nLen);
+ *(_rRow->get())[i] = nValue;
+ }
+ else if ( DataType::DOUBLE == nType )
+ {
+ double d = 0.0;
+ if (getBOOL((*aIter)->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISCURRENCY)))) // Currency wird gesondert behandelt
+ {
+ sal_Int64 nValue = 0;
+ memcpy(&nValue, pData, nLen);
+
+ if ( m_aScales[i-1] )
+ d = (double)(nValue / pow(10.0,(int)m_aScales[i-1]));
+ else
+ d = (double)(nValue);
+ }
+ else
+ {
+ memcpy(&d, pData, nLen);
+ }
+
+ *(_rRow->get())[i] = d;
}
else
{
@@ -789,6 +995,8 @@ sal_Bool ODbaseTable::fetchRow(OValueRefRow& _rRow,const OSQLColumns & _rCols, s
// pVal->setDouble(b);
}
break;
+ case DataType::LONGVARBINARY:
+ case DataType::BINARY:
case DataType::LONGVARCHAR:
{
const long nBlockNo = aStr.ToInt32(); // Blocknummer lesen
@@ -806,9 +1014,6 @@ sal_Bool ODbaseTable::fetchRow(OValueRefRow& _rRow,const OSQLColumns & _rCols, s
(_rRow->get())[i]->setTypeKind(nType);
}
-// if (aStatus.IsError())
-// break;
- // Und weiter ...
nByteOffset += nLen;
OSL_ENSURE( nByteOffset <= m_nBufferSize ,"ByteOffset > m_nBufferSize!");
}
@@ -978,38 +1183,78 @@ BOOL ODbaseTable::CreateFile(const INetURLObject& aFile, BOOL& bCreateMemo)
if (!m_pFileStream)
return sal_False;
+ BYTE nDbaseType = dBaseIII;
+ Reference<XIndexAccess> xColumns(getColumns(),UNO_QUERY);
+ Reference<XPropertySet> xCol;
+ const ::rtl::OUString sPropType = OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE);
+
+ try
+ {
+ const sal_Int32 nCount = xColumns->getCount();
+ for(sal_Int32 i=0;i<nCount;++i)
+ {
+ xColumns->getByIndex(i) >>= xCol;
+ OSL_ENSURE(xCol.is(),"This should be a column!");
+
+ switch (getINT32(xCol->getPropertyValue(sPropType)))
+ {
+ case DataType::DOUBLE:
+ case DataType::INTEGER:
+ case DataType::TIMESTAMP:
+ case DataType::LONGVARBINARY:
+ nDbaseType = VisualFoxPro;
+ i = nCount; // no more columns need to be checked
+ break;
+ } // switch (getINT32(xCol->getPropertyValue(sPropType)))
+ }
+ }
+ catch ( const Exception& e )
+ {
+ (void)e;
+
+ try
+ {
+ // we have to drop the file because it is corrupted now
+ DropImpl();
+ }
+ catch(const Exception&) { }
+ throw;
+ }
+
char aBuffer[21]; // write buffer
memset(aBuffer,0,sizeof(aBuffer));
m_pFileStream->Seek(0L);
- (*m_pFileStream) << (BYTE) dBaseIII; // dBase format
+ (*m_pFileStream) << (BYTE) nDbaseType; // dBase format
(*m_pFileStream) << (BYTE) (aDate.GetYear() % 100); // aktuelles Datum
(*m_pFileStream) << (BYTE) aDate.GetMonth();
(*m_pFileStream) << (BYTE) aDate.GetDay();
- (*m_pFileStream) << 0L; // Anzahl der Datensaetze
- (*m_pFileStream) << (USHORT)((m_pColumns->getCount()+1) * 32 + 1); // Kopfinformationen,
+ (*m_pFileStream) << 0L; // Anzahl der Datensaetze
+ (*m_pFileStream) << (USHORT)((m_pColumns->getCount()+1) * 32 + 1); // Kopfinformationen,
// pColumns erhaelt immer eine Spalte mehr
- (*m_pFileStream) << (USHORT) 0; // Satzlaenge wird spaeter bestimmt
+ (*m_pFileStream) << (USHORT) 0; // Satzlaenge wird spaeter bestimmt
m_pFileStream->Write(aBuffer, 20);
- USHORT nRecLength = 1; // Laenge 1 fuer deleted flag
+ USHORT nRecLength = 1; // Laenge 1 fuer deleted flag
sal_Int32 nMaxFieldLength = m_pConnection->getMetaData()->getMaxColumnNameLength();
- Reference<XIndexAccess> xColumns(getColumns(),UNO_QUERY);
-
::rtl::OUString aName;
- Reference<XPropertySet> xCol;
+ const ::rtl::OUString sPropName = OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME);
+ const ::rtl::OUString sPropPrec = OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PRECISION);
+ const ::rtl::OUString sPropScale = OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCALE);
+
try
{
- for(sal_Int32 i=0;i<xColumns->getCount();++i)
+ const sal_Int32 nCount = xColumns->getCount();
+ for(sal_Int32 i=0;i<nCount;++i)
{
- ::cppu::extractInterface(xCol,xColumns->getByIndex(i));
+ xColumns->getByIndex(i) >>= xCol;
OSL_ENSURE(xCol.is(),"This should be a column!");
char cTyp( 'C' );
- xCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME)) >>= aName;
+ xCol->getPropertyValue(sPropName) >>= aName;
::rtl::OString aCol;
if ( DBTypeConversion::convertUnicodeString( aName, aCol, m_eEncoding ) > nMaxFieldLength)
@@ -1020,22 +1265,39 @@ BOOL ODbaseTable::CreateFile(const INetURLObject& aFile, BOOL& bCreateMemo)
(*m_pFileStream) << aCol.getStr();
m_pFileStream->Write(aBuffer, 11 - aCol.getLength());
- switch (getINT32(xCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE))))
+ sal_Int32 nPrecision = 0;
+ xCol->getPropertyValue(sPropPrec) >>= nPrecision;
+ sal_Int32 nScale = 0;
+ xCol->getPropertyValue(sPropScale) >>= nScale;
+
+ bool bBinary = false;
+
+ switch (getINT32(xCol->getPropertyValue(sPropType)))
{
case DataType::CHAR:
case DataType::VARCHAR:
cTyp = 'C';
break;
+ case DataType::DOUBLE:
+ if (getBOOL(xCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISCURRENCY)))) // Currency wird gesondert behandelt
+ cTyp = 'Y';
+ else
+ cTyp = 'B';
+ break;
+ case DataType::INTEGER:
+ cTyp = 'I';
+ break;
case DataType::TINYINT:
case DataType::SMALLINT:
- case DataType::INTEGER:
case DataType::BIGINT:
case DataType::DECIMAL:
case DataType::NUMERIC:
case DataType::REAL:
- case DataType::DOUBLE:
cTyp = 'N'; // nur dBase 3 format
break;
+ case DataType::TIMESTAMP:
+ cTyp = 'T';
+ break;
case DataType::DATE:
cTyp = 'D';
break;
@@ -1043,6 +1305,8 @@ BOOL ODbaseTable::CreateFile(const INetURLObject& aFile, BOOL& bCreateMemo)
cTyp = 'L';
break;
case DataType::LONGVARBINARY:
+ bBinary = true;
+ // run through
case DataType::LONGVARCHAR:
cTyp = 'M';
break;
@@ -1053,12 +1317,10 @@ BOOL ODbaseTable::CreateFile(const INetURLObject& aFile, BOOL& bCreateMemo)
}
(*m_pFileStream) << cTyp;
- m_pFileStream->Write(aBuffer, 4);
-
- sal_Int32 nPrecision = 0;
- xCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PRECISION)) >>= nPrecision;
- sal_Int32 nScale = 0;
- xCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCALE)) >>= nScale;
+ if ( nDbaseType == VisualFoxPro )
+ (*m_pFileStream) << (nRecLength-1);
+ else
+ m_pFileStream->Write(aBuffer, 4);
switch(cTyp)
{
@@ -1092,14 +1354,22 @@ BOOL ODbaseTable::CreateFile(const INetURLObject& aFile, BOOL& bCreateMemo)
(*m_pFileStream) << (BYTE)( nPrec);
(*m_pFileStream) << (BYTE)nScale;
- nRecLength = nRecLength + (USHORT)nPrec;
+ nRecLength += (USHORT)nPrec;
}
break;
case 'L':
(*m_pFileStream) << (BYTE)1;
(*m_pFileStream) << (BYTE)0;
- nRecLength++;
+ ++nRecLength;
+ break;
+ case 'I':
+ (*m_pFileStream) << (BYTE)4;
+ (*m_pFileStream) << (BYTE)0;
+ nRecLength += 4;
break;
+ case 'Y':
+ case 'B':
+ case 'T':
case 'D':
(*m_pFileStream) << (BYTE)8;
(*m_pFileStream) << (BYTE)0;
@@ -1110,11 +1380,14 @@ BOOL ODbaseTable::CreateFile(const INetURLObject& aFile, BOOL& bCreateMemo)
(*m_pFileStream) << (BYTE)10;
(*m_pFileStream) << (BYTE)0;
nRecLength += 10;
+ if ( bBinary )
+ aBuffer[0] = 0x06;
break;
default:
throwInvalidColumnType(STR_INVALID_COLUMN_TYPE, aName);
}
m_pFileStream->Write(aBuffer, 14);
+ aBuffer[0] = 0x00;
}
(*m_pFileStream) << (BYTE)FIELD_DESCRIPTOR_TERMINATOR; // kopf ende
@@ -1125,7 +1398,10 @@ BOOL ODbaseTable::CreateFile(const INetURLObject& aFile, BOOL& bCreateMemo)
if (bCreateMemo)
{
m_pFileStream->Seek(0L);
- (*m_pFileStream) << (BYTE) dBaseIIIMemo;
+ if (nDbaseType == VisualFoxPro)
+ (*m_pFileStream) << (BYTE) FoxProMemo;
+ else
+ (*m_pFileStream) << (BYTE) dBaseIIIMemo;
} // if (bCreateMemo)
}
catch ( const Exception& e )
@@ -1252,7 +1528,7 @@ BOOL ODbaseTable::InsertRow(OValueRefVector& rRow, BOOL bFlush,const Reference<X
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseTable::InsertRow" );
// Buffer mit Leerzeichen fuellen
AllocBuffer();
- memset(m_pBuffer, ' ', m_aHeader.db_slng);
+ memset(m_pBuffer, 0, m_aHeader.db_slng);
// Gesamte neue Row uebernehmen:
// ... und am Ende als neuen Record hinzufuegen:
@@ -1436,7 +1712,7 @@ BOOL ODbaseTable::UpdateBuffer(OValueRefVector& rRow, OValueRefRow pOrgRow,const
Reference<XPropertySet> xIndex;
USHORT i;
::rtl::OUString aColName;
- sal_Int32 nColumnCount = m_pColumns->getCount();
+ const sal_Int32 nColumnCount = m_pColumns->getCount();
::std::vector< Reference<XPropertySet> > aIndexedCols(nColumnCount);
::comphelper::UStringMixEqual aCase(isCaseSensitive());
@@ -1490,7 +1766,11 @@ BOOL ODbaseTable::UpdateBuffer(OValueRefVector& rRow, OValueRefRow pOrgRow,const
xCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME)) >>= aColName;
xCol = NULL;
} // if ( !aColName.getLength() )
- throwInvalidColumnType(STR_DUPLICATE_VALUE_IN_COLUMN,aColName);
+ const ::rtl::OUString sError( getConnection()->getResources().getResourceStringWithSubstitution(
+ STR_DUPLICATE_VALUE_IN_COLUMN
+ ,"$columnname$", aColName
+ ) );
+ ::dbtools::throwGenericSQLException( sError, *this );
}
}
}
@@ -1522,15 +1802,24 @@ BOOL ODbaseTable::UpdateBuffer(OValueRefVector& rRow, OValueRefRow pOrgRow,const
}
}
+ bool bSetZero = false;
switch (nType)
{
- case DataType::DATE: nLen = 8; break;
+ case DataType::INTEGER:
+ case DataType::DOUBLE:
+ case DataType::TIMESTAMP:
+ bSetZero = true;
+ case DataType::LONGVARBINARY:
+ case DataType::DATE:
+ case DataType::BIT:
+ case DataType::LONGVARCHAR:
+ nLen = m_aRealFieldLengths[i];
+ break;
case DataType::DECIMAL:
nLen = SvDbaseConverter::ConvertPrecisionToDbase(nLen,nScale);
break; // das Vorzeichen und das Komma
- case DataType::BIT: nLen = 1; break;
- case DataType::LONGVARCHAR: nLen = 10; break;
- default: break;
+ default:
+ break;
} // switch (nType)
@@ -1580,7 +1869,10 @@ BOOL ODbaseTable::UpdateBuffer(OValueRefVector& rRow, OValueRefRow pOrgRow,const
char* pData = (char *)(m_pBuffer + nByteOffset);
if (rRow.get()[nPos]->getValue().isNull())
{
- memset(pData,' ',nLen); // Zuruecksetzen auf NULL
+ if ( bSetZero )
+ memset(pData,0,nLen); // Zuruecksetzen auf NULL
+ else
+ memset(pData,' ',nLen); // Zuruecksetzen auf NULL
nByteOffset += nLen;
OSL_ENSURE( nByteOffset <= m_nBufferSize ,"ByteOffset > m_nBufferSize!");
continue;
@@ -1591,6 +1883,15 @@ BOOL ODbaseTable::UpdateBuffer(OValueRefVector& rRow, OValueRefRow pOrgRow,const
{
switch (nType)
{
+ case DataType::TIMESTAMP:
+ {
+ sal_Int32 nJulianDate = 0, nJulianTime = 0;
+ lcl_CalcJulDate(nJulianDate,nJulianTime,rRow.get()[nPos]->getValue());
+ // Genau 8 Byte kopieren:
+ memcpy(pData,&nJulianDate,4);
+ memcpy(pData+4,&nJulianTime,4);
+ }
+ break;
case DataType::DATE:
{
::com::sun::star::util::Date aDate;
@@ -1609,6 +1910,30 @@ BOOL ODbaseTable::UpdateBuffer(OValueRefVector& rRow, OValueRefRow pOrgRow,const
// Genau 8 Byte kopieren:
strncpy(pData,s,sizeof s - 1);
} break;
+ case DataType::INTEGER:
+ {
+ sal_Int32 nValue = rRow.get()[nPos]->getValue();
+ memcpy(pData,&nValue,nLen);
+ }
+ break;
+ case DataType::DOUBLE:
+ {
+ const double d = rRow.get()[nPos]->getValue();
+ m_pColumns->getByIndex(i) >>= xCol;
+
+ if (getBOOL(xCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISCURRENCY)))) // Currency wird gesondert behandelt
+ {
+ sal_Int64 nValue = 0;
+ if ( m_aScales[i] )
+ nValue = (sal_Int64)(d * pow(10.0,(int)m_aScales[i]));
+ else
+ nValue = (sal_Int64)(d);
+ memcpy(pData,&nValue,nLen);
+ } // if (getBOOL(xCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISCURRENCY)))) // Currency wird gesondert behandelt
+ else
+ memcpy(pData,&d,nLen);
+ }
+ break;
case DataType::DECIMAL:
{
memset(pData,' ',nLen); // Zuruecksetzen auf NULL
@@ -1647,6 +1972,7 @@ BOOL ODbaseTable::UpdateBuffer(OValueRefVector& rRow, OValueRefRow pOrgRow,const
case DataType::BIT:
*pData = rRow.get()[nPos]->getValue().getBool() ? 'T' : 'F';
break;
+ case DataType::LONGVARBINARY:
case DataType::LONGVARCHAR:
{
char cNext = pData[nLen]; // merken und temporaer durch 0 ersetzen
@@ -1714,12 +2040,20 @@ BOOL ODbaseTable::WriteMemo(ORowSetValue& aVariable, ULONG& rBlockNr)
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseTable::WriteMemo" );
// wird die BlockNr 0 vorgegeben, wird der block ans Ende gehaengt
-
- BYTE nHeader[4];
-
- ::rtl::OUString sStringToWrite( aVariable.getString() );
+ ULONG nSize = 0;
::rtl::OString aStr;
- ULONG nSize = DBTypeConversion::convertUnicodeString( sStringToWrite, aStr, m_eEncoding );
+ ::com::sun::star::uno::Sequence<sal_Int8> aValue;
+ BYTE nHeader[4];
+ const bool bBinary = aVariable.getTypeKind() == DataType::LONGVARBINARY && m_aMemoHeader.db_typ == MemoFoxPro;
+ if ( bBinary )
+ {
+ aValue = aVariable.getSequence();
+ nSize = aValue.getLength();
+ }
+ else
+ {
+ nSize = DBTypeConversion::convertUnicodeString( aVariable.getString(), aStr, m_eEncoding );
+ }
// Anhaengen oder ueberschreiben
BOOL bAppend = rBlockNr == 0;
@@ -1779,29 +2113,28 @@ BOOL ODbaseTable::WriteMemo(ORowSetValue& aVariable, ULONG& rBlockNr)
{
const char cEOF = (char) DBF_EOL;
nSize++;
-
-// if (pData)
-// {
-// m_pMemoStream->Write((const char*) pData->getConstArray(), pData->getLength());
-// }
-// else
-// {
- m_pMemoStream->Write( aStr.getStr(), aStr.getLength() );
- // }
-
+ m_pMemoStream->Write( aStr.getStr(), aStr.getLength() );
(*m_pMemoStream) << cEOF << cEOF;
} break;
case MemoFoxPro:
case MemodBaseIV: // dBase IV-Memofeld mit Laengenangabe
{
- (*m_pMemoStream) << (BYTE)0xFF
- << (BYTE)0xFF
- << (BYTE)0x08;
+ if ( MemodBaseIV == m_aMemoHeader.db_typ )
+ (*m_pMemoStream) << (BYTE)0xFF
+ << (BYTE)0xFF
+ << (BYTE)0x08;
+ else
+ (*m_pMemoStream) << (BYTE)0x00
+ << (BYTE)0x00
+ << (BYTE)0x00;
UINT32 nWriteSize = nSize;
if (m_aMemoHeader.db_typ == MemoFoxPro)
{
- (*m_pMemoStream) << (BYTE) 0x01; // ((pData = NULL) ? 0x01 : 0x00);
+ if ( bBinary )
+ (*m_pMemoStream) << (BYTE) 0x00; // Picture
+ else
+ (*m_pMemoStream) << (BYTE) 0x01; // Memo
for (int i = 4; i > 0; nWriteSize >>= 8)
nHeader[--i] = (BYTE) (nWriteSize % 256);
}
@@ -1814,14 +2147,10 @@ BOOL ODbaseTable::WriteMemo(ORowSetValue& aVariable, ULONG& rBlockNr)
}
m_pMemoStream->Write(nHeader,4);
-// if (pData)
-// {
-// m_pMemoStream->Write((const char*) pData->getConstArray(), pData->getLength());
-// }
-// else
-// {
+ if ( bBinary )
+ m_pMemoStream->Write( aValue.getConstArray(), aValue.getLength() );
+ else
m_pMemoStream->Write( aStr.getStr(), aStr.getLength() );
- // }
m_pMemoStream->Flush();
}
}
@@ -2419,18 +2748,18 @@ BOOL ODbaseTable::ReadMemo(ULONG nBlockNo, ORowSetValue& aVariable)
// Foxpro stores text and binary data
if (m_aMemoHeader.db_typ == MemoFoxPro)
{
- if (((BYTE)sHeader[0]) != 0 || ((BYTE)sHeader[1]) != 0 || ((BYTE)sHeader[2]) != 0)
- {
-// String aText = String(SdbResId(STR_STAT_IResultSetHelper::INVALID));
-// aText.SearchAndReplace(String::CreateFromAscii("%%d"),m_pMemoStream->GetFileName());
-// aText.SearchAndReplace(String::CreateFromAscii("%%t"),aStatus.TypeToString(MEMO));
-// aStatus.Set(SDB_STAT_ERROR,
-// String::CreateFromAscii("01000"),
-// aStatus.CreateErrorMessage(aText),
-// 0, String() );
- return sal_False;
- }
-
+// if (((BYTE)sHeader[0]) != 0 || ((BYTE)sHeader[1]) != 0 || ((BYTE)sHeader[2]) != 0)
+// {
+//// String aText = String(SdbResId(STR_STAT_IResultSetHelper::INVALID));
+//// aText.SearchAndReplace(String::CreateFromAscii("%%d"),m_pMemoStream->GetFileName());
+//// aText.SearchAndReplace(String::CreateFromAscii("%%t"),aStatus.TypeToString(MEMO));
+//// aStatus.Set(SDB_STAT_ERROR,
+//// String::CreateFromAscii("01000"),
+//// aStatus.CreateErrorMessage(aText),
+//// 0, String() );
+// return sal_False;
+// }
+//
bIsText = sHeader[3] != 0;
}
else if (((BYTE)sHeader[0]) != 0xFF || ((BYTE)sHeader[1]) != 0xFF || ((BYTE)sHeader[2]) != 0x08)
@@ -2451,28 +2780,40 @@ BOOL ODbaseTable::ReadMemo(ULONG nBlockNo, ORowSetValue& aVariable)
if (m_aMemoHeader.db_typ == MemodBaseIV)
nLength -= 8;
- // char cChar;
- ::rtl::OUString aStr;
- while ( nLength > STRING_MAXLEN )
+ if ( nLength )
{
- ByteString aBStr;
- aBStr.Expand(STRING_MAXLEN);
- m_pMemoStream->Read(aBStr.AllocBuffer(STRING_MAXLEN),STRING_MAXLEN);
- aStr += ::rtl::OUString(aBStr.GetBuffer(),aBStr.Len(), m_eEncoding);
- nLength -= STRING_MAXLEN;
- }
- if ( nLength > 0 )
- {
- ByteString aBStr;
- aBStr.Expand(static_cast<xub_StrLen>(nLength));
- m_pMemoStream->Read(aBStr.AllocBuffer(static_cast<xub_StrLen>(nLength)),nLength);
- // aBStr.ReleaseBufferAccess();
+ if ( bIsText )
+ {
+ // char cChar;
+ ::rtl::OUString aStr;
+ while ( nLength > STRING_MAXLEN )
+ {
+ ByteString aBStr;
+ aBStr.Expand(STRING_MAXLEN);
+ m_pMemoStream->Read(aBStr.AllocBuffer(STRING_MAXLEN),STRING_MAXLEN);
+ aStr += ::rtl::OUString(aBStr.GetBuffer(),aBStr.Len(), m_eEncoding);
+ nLength -= STRING_MAXLEN;
+ }
+ if ( nLength > 0 )
+ {
+ ByteString aBStr;
+ aBStr.Expand(static_cast<xub_StrLen>(nLength));
+ m_pMemoStream->Read(aBStr.AllocBuffer(static_cast<xub_StrLen>(nLength)),nLength);
+ // aBStr.ReleaseBufferAccess();
- aStr += ::rtl::OUString(aBStr.GetBuffer(),aBStr.Len(), m_eEncoding);
+ aStr += ::rtl::OUString(aBStr.GetBuffer(),aBStr.Len(), m_eEncoding);
- }
- if ( aStr.getLength() )
- aVariable = aStr;
+ }
+ if ( aStr.getLength() )
+ aVariable = aStr;
+ } // if ( bIsText )
+ else
+ {
+ ::com::sun::star::uno::Sequence< sal_Int8 > aData(nLength);
+ m_pMemoStream->Read(aData.getArray(),nLength);
+ aVariable = aData;
+ }
+ } // if ( nLength )
}
}
return sal_True;
diff --git a/connectivity/source/drivers/file/fanalyzer.cxx b/connectivity/source/drivers/file/fanalyzer.cxx
index c866db55275e..eceb58e10611 100644
--- a/connectivity/source/drivers/file/fanalyzer.cxx
+++ b/connectivity/source/drivers/file/fanalyzer.cxx
@@ -90,6 +90,9 @@ void OSQLAnalyzer::start(OSQLParseNode* pSQLParseNode)
|| SQL_ISRULE(pColumnRef,position_exp)
|| SQL_ISRULE(pColumnRef,fold)
|| SQL_ISRULE(pColumnRef,length_exp)
+ || SQL_ISRULE(pColumnRef,num_value_exp)
+ || SQL_ISRULE(pColumnRef,term)
+ || SQL_ISRULE(pColumnRef,factor)
|| SQL_ISRULE(pColumnRef,set_fct_spec) )
{
::vos::ORef<OPredicateCompiler> pCompiler = new OPredicateCompiler(this);
diff --git a/connectivity/source/drivers/jdbc/DatabaseMetaData.cxx b/connectivity/source/drivers/jdbc/DatabaseMetaData.cxx
index b6d18be2a346..11863be3b8bf 100644
--- a/connectivity/source/drivers/jdbc/DatabaseMetaData.cxx
+++ b/connectivity/source/drivers/jdbc/DatabaseMetaData.cxx
@@ -169,7 +169,6 @@ Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getTables(
args[3].l = pObjArray;
}
}
-
// if we are to display "all catalogs", then respect m_aCatalogRestriction
Any aCatalogFilter( catalog );
if ( !aCatalogFilter.hasValue() )
diff --git a/connectivity/source/drivers/jdbc/PreparedStatement.cxx b/connectivity/source/drivers/jdbc/PreparedStatement.cxx
index beef4792ba1e..dbf7241885da 100644
--- a/connectivity/source/drivers/jdbc/PreparedStatement.cxx
+++ b/connectivity/source/drivers/jdbc/PreparedStatement.cxx
@@ -120,7 +120,7 @@ sal_Int32 SAL_CALL java_sql_PreparedStatement::executeUpdate( ) throw(::com::su
checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed);
m_aLogger.log( LogLevel::FINE, STR_LOG_EXECUTING_PREPARED_UPDATE );
static jmethodID mID(NULL);
- return impl_getProperty("executeUpdate",mID);
+ return callIntMethod("executeUpdate",mID);
}
// -------------------------------------------------------------------------
diff --git a/connectivity/source/drivers/jdbc/ResultSet.cxx b/connectivity/source/drivers/jdbc/ResultSet.cxx
index 9b8de989bb51..e78488ffbba3 100644
--- a/connectivity/source/drivers/jdbc/ResultSet.cxx
+++ b/connectivity/source/drivers/jdbc/ResultSet.cxx
@@ -348,6 +348,7 @@ Any SAL_CALL java_sql_ResultSet::getObject( sal_Int32 columnIndex, const Referen
} //t.pEnv
// ACHTUNG: der Aufrufer wird Eigentuemer des zurueckgelieferten Zeigers !!!
+ ::dbtools::throwFunctionNotSupportedException( "XRow::getObject", *this );
return out==0 ? Any() : Any();//new java_lang_Object( t.pEnv, out );
}
// -------------------------------------------------------------------------
diff --git a/connectivity/source/drivers/mozab/MConnection.cxx b/connectivity/source/drivers/mozab/MConnection.cxx
index 2f9386b09f98..6fc45d4ed07f 100644
--- a/connectivity/source/drivers/mozab/MConnection.cxx
+++ b/connectivity/source/drivers/mozab/MConnection.cxx
@@ -30,22 +30,26 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_connectivity.hxx"
-#include "MConnection.hxx"
+#include "diagnose_ex.h"
+#include "MConnection.hxx"
#include "MDatabaseMetaData.hxx"
#include "MDriver.hxx"
#include "MColumnAlias.hxx"
#include "MStatement.hxx"
#include "MPreparedStatement.hxx"
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/TransactionIsolation.hpp>
+
#include <connectivity/dbcharset.hxx>
#include <connectivity/dbexception.hxx>
-#include "diagnose_ex.h"
+#include <connectivity/sqlerror.hxx>
#include "resource/mozab_res.hrc"
#include "resource/common_res.hrc"
+
+#include <com/sun/star/sdbc/ColumnValue.hpp>
+#include <com/sun/star/sdbc/XRow.hpp>
+#include <com/sun/star/sdbc/TransactionIsolation.hpp>
+
#include <comphelper/officeresourcebundle.hxx>
#if OSL_DEBUG_LEVEL > 0
@@ -173,7 +177,7 @@ void OConnection::construct(const ::rtl::OUString& url,const Sequence< PropertyV
else
{
OSL_TRACE( "No subschema given!!!\n");
- throwGenericSQLException( STR_URI_SYNTAX_ERROR,*this );
+ throwSQLException( STR_URI_SYNTAX_ERROR, *this );
}
}
else
@@ -284,7 +288,7 @@ void OConnection::construct(const ::rtl::OUString& url,const Sequence< PropertyV
m_sMozillaURI += m_sHostName;
}
else
- throwGenericSQLException( STR_NO_HOSTNAME ,*this);
+ throwSQLException( STR_NO_HOSTNAME, *this );
if ( nPortNumber > 0 ) {
m_sMozillaURI += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(":") );
@@ -296,7 +300,7 @@ void OConnection::construct(const ::rtl::OUString& url,const Sequence< PropertyV
m_sMozillaURI += sBaseDN;
}
else
- throwGenericSQLException( STR_NO_BASEDN ,*this);
+ throwSQLException( STR_NO_BASEDN, *this );
// Addition of a fake query to enable the Mozilla LDAP directory to work correctly.
m_sMozillaURI += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("?(or(DisplayName,=,DontDoThisAtHome)))"));
@@ -313,7 +317,7 @@ void OConnection::construct(const ::rtl::OUString& url,const Sequence< PropertyV
else
{
OSL_TRACE("Invalid subschema given!!!\n");
- throwGenericSQLException( STR_URI_SYNTAX_ERROR ,*this);
+ throwSQLException( STR_URI_SYNTAX_ERROR, *this );
}
OSL_TRACE("Moz URI = %s, %s\n", ((OUtoCStr(m_sMozillaURI)) ? (OUtoCStr(m_sMozillaURI)):("NULL")), usesFactory() ? "uses factory" : "no factory");
@@ -324,12 +328,15 @@ void OConnection::construct(const ::rtl::OUString& url,const Sequence< PropertyV
// The creation of the nsIAbDirectory i/f for LDAP doesn't actually test
// the validity of the connection, it's normally delayed until the query
// is executed, but it's a bit late then to fail...
- if ( isLDAP() ) {
- if ( !_aDbHelper.testLDAPConnection( this ) ) {
+ if ( isLDAP() )
+ {
+ if ( !_aDbHelper.testLDAPConnection( this ) )
+ {
OSL_TRACE("testLDAPConnection : FAILED\n" );
- throwGenericSQLException( _aDbHelper.getErrorResourceId() ,*this);
+ throwSQLException( _aDbHelper.getError(), *this );
}
- else {
+ else
+ {
OSL_TRACE("testLDAPConnection : SUCCESS\n" );
}
}
@@ -337,8 +344,9 @@ void OConnection::construct(const ::rtl::OUString& url,const Sequence< PropertyV
// Test connection by getting to get the Table Names
::std::vector< ::rtl::OUString > tables;
::std::vector< ::rtl::OUString > types;
- if ( !_aDbHelper.getTableStrings( this, tables, types ) ) {
- throwGenericSQLException( _aDbHelper.getErrorResourceId() ,*this);
+ if ( !_aDbHelper.getTableStrings( this, tables, types ) )
+ {
+ throwSQLException( _aDbHelper.getError(), *this );
}
}
@@ -550,6 +558,50 @@ MNameMapper* OConnection::getNameMapper ()
return m_aNameMapper;
}
+
+// -----------------------------------------------------------------------------
+void OConnection::throwSQLException( const ErrorDescriptor& _rError, const Reference< XInterface >& _rxContext )
+{
+ if ( _rError.getResId() != 0 )
+ {
+ OSL_ENSURE( ( _rError.getErrorCondition() == 0 ),
+ "OConnection::throwSQLException: unsupported error code combination!" );
+
+ ::rtl::OUString sParameter( _rError.getParameter() );
+ if ( sParameter.getLength() )
+ {
+ const ::rtl::OUString sError( getResources().getResourceStringWithSubstitution(
+ _rError.getResId(),
+ "$1$", sParameter
+ ) );
+ ::dbtools::throwGenericSQLException( sError, _rxContext );
+ OSL_ENSURE( false, "OConnection::throwSQLException: unreachable (1)!" );
+ }
+
+ throwGenericSQLException( _rError.getResId(), _rxContext );
+ OSL_ENSURE( false, "OConnection::throwSQLException: unreachable (2)!" );
+ }
+
+ if ( _rError.getErrorCondition() != 0 )
+ {
+ SQLError aErrorHelper( getDriver()->getMSFactory() );
+ ::rtl::OUString sParameter( _rError.getParameter() );
+ if ( sParameter.getLength() )
+ aErrorHelper.raiseException( _rError.getErrorCondition(), _rxContext, sParameter );
+ else
+ aErrorHelper.raiseException( _rError.getErrorCondition(), _rxContext);
+ OSL_ENSURE( false, "OConnection::throwSQLException: unreachable (3)!" );
+ }
+
+ throwGenericSQLException( STR_UNSPECIFIED_ERROR, _rxContext );
+}
+
// -----------------------------------------------------------------------------
+void OConnection::throwSQLException( const sal_uInt16 _nErrorResourceId, const Reference< XInterface >& _rxContext )
+{
+ ErrorDescriptor aError;
+ aError.setResId( _nErrorResourceId );
+ throwSQLException( aError, _rxContext );
+}
} } // namespace connectivity::mozab
diff --git a/connectivity/source/drivers/mozab/MConnection.hxx b/connectivity/source/drivers/mozab/MConnection.hxx
index 883c003ba883..741bd9ef20e1 100644
--- a/connectivity/source/drivers/mozab/MConnection.hxx
+++ b/connectivity/source/drivers/mozab/MConnection.hxx
@@ -30,23 +30,19 @@
#ifndef CONNECTIVITY_SCONNECTION_HXX
#define CONNECTIVITY_SCONNECTION_HXX
+#include "connectivity/CommonTools.hxx"
+
+#include "MCatalog.hxx"
#include "MColumnAlias.hxx"
-#ifndef _CONNECTIVITY_MAB_CATALOG_HXX_
-#include "MCatalog.hxx"
-#endif
-
+#include "OSubComponent.hxx"
+#include "TConnection.hxx"
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/mozilla/MozillaProductType.hpp>
#include <com/sun/star/sdbc/SQLWarning.hpp>
-#include <com/sun/star/beans/PropertyValue.hpp>
-#include "OSubComponent.hxx"
-// #include <map>
#include <com/sun/star/sdbcx/XTablesSupplier.hpp>
-#include "connectivity/CommonTools.hxx"
-#include "TConnection.hxx"
+
#include <cppuhelper/weakref.hxx>
-#ifndef _COM_SUN_STAR_MOZILLA_MOZILLPRODUCTTYPE_HPP_
-#include <com/sun/star/mozilla/MozillaProductType.hpp>
-#endif
#include <memory>
@@ -59,6 +55,7 @@ namespace connectivity
class MozabDriver;
class ODatabaseMetaData;
class MNameMapper;
+ class ErrorDescriptor;
namespace SDBCAddress {
typedef enum {
@@ -225,7 +222,12 @@ namespace connectivity
void setForceLoadTables(sal_Bool aForce){ m_bForceLoadTable = aForce;}
sal_Bool getForceLoadTables() { return m_bForceLoadTable;}
- // End of Additions from the land of mozilla
+ void throwSQLException( const ErrorDescriptor& _rError, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxContext );
+ void throwSQLException( const sal_uInt16 _nErrorResourceId, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxContext );
+
+ private:
+ // make this private - clients should use throwSQLException instead
+ using OConnection_BASE::throwGenericSQLException;
};
}
}
diff --git a/connectivity/source/drivers/mozab/MDatabaseMetaData.cxx b/connectivity/source/drivers/mozab/MDatabaseMetaData.cxx
index 6f19e821e476..55350e350474 100644
--- a/connectivity/source/drivers/mozab/MDatabaseMetaData.cxx
+++ b/connectivity/source/drivers/mozab/MDatabaseMetaData.cxx
@@ -97,7 +97,7 @@ ODatabaseMetaDataResultSet::ORows& SAL_CALL ODatabaseMetaData::getColumnRows(
::std::vector< ::rtl::OUString > tables;
::std::vector< ::rtl::OUString > types;
if ( !m_pDbMetaDataHelper->getTableStrings( m_pConnection, tables, types) ) {
- getOwnConnection()->throwGenericSQLException( m_pDbMetaDataHelper->getErrorResourceId(),*this );
+ getOwnConnection()->throwSQLException( m_pDbMetaDataHelper->getError(), *this );
}
// ****************************************************
@@ -961,7 +961,7 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTables(
// pResultSet->setRows( aRows );
ODatabaseMetaDataResultSet::ORows _rRows;
if ( !m_pDbMetaDataHelper->getTables( m_pConnection, tableNamePattern, types,_rRows ) ) {
- getOwnConnection()->throwGenericSQLException( m_pDbMetaDataHelper->getErrorResourceId() ,*this);
+ getOwnConnection()->throwSQLException( m_pDbMetaDataHelper->getError(), *this );
}
pResultSet->setRows( _rRows );
@@ -979,7 +979,7 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTablePrivileges(
::std::vector< ::rtl::OUString > tables;
::std::vector< ::rtl::OUString > types;
if ( !m_pDbMetaDataHelper->getTableStrings( m_pConnection, tables, types ) )
- getOwnConnection()->throwGenericSQLException( m_pDbMetaDataHelper->getErrorResourceId() ,*this);
+ getOwnConnection()->throwSQLException( m_pDbMetaDataHelper->getError(), *this );
::connectivity::ODatabaseMetaDataResultSet::ORows aRows;
::connectivity::ODatabaseMetaDataResultSet::ORow aRow(8);
diff --git a/connectivity/source/drivers/mozab/MDriver.cxx b/connectivity/source/drivers/mozab/MDriver.cxx
index d7f1fb9d6e2d..bdb9d9447cfe 100644
--- a/connectivity/source/drivers/mozab/MDriver.cxx
+++ b/connectivity/source/drivers/mozab/MDriver.cxx
@@ -304,9 +304,9 @@ bool MozabDriver::ensureInit()
const ::rtl::OUString sModuleName = ::rtl::OUString::createFromAscii(SVLIBRARY( "mozabdrv" ));
- // load the dbtools library
+ // load the mozabdrv library
m_hModule = osl_loadModuleRelative(&thisModule, sModuleName.pData, 0);
- OSL_ENSURE(NULL != m_hModule, "MozabDriver::ensureInit: could not load the dbtools library!");
+ OSL_ENSURE(NULL != m_hModule, "MozabDriver::ensureInit: could not load the mozabdrv library!");
if ( !m_hModule )
return false;
diff --git a/connectivity/source/drivers/mozab/MResultSet.cxx b/connectivity/source/drivers/mozab/MResultSet.cxx
index 4ae7b695390a..a58e442fcc30 100644
--- a/connectivity/source/drivers/mozab/MResultSet.cxx
+++ b/connectivity/source/drivers/mozab/MResultSet.cxx
@@ -357,8 +357,9 @@ sal_Bool OResultSet::pushCard(sal_uInt32 cardNumber) throw(SQLException, Runtime
//
// Everything in the addressbook is a string!
//
- if ( !m_aQuery.setRowValue( (m_aRow->get())[i], cardNumber, m_aColumnNames[i-1], DataType::VARCHAR )) {
- m_pStatement->getOwnConnection()->throwGenericSQLException( m_aQuery.getErrorResourceId(),*this );
+ if ( !m_aQuery.setRowValue( (m_aRow->get())[i], cardNumber, m_aColumnNames[i-1], DataType::VARCHAR ))
+ {
+ m_pStatement->getOwnConnection()->throwSQLException( m_aQuery.getError(), *this );
}
}
}
@@ -398,8 +399,9 @@ sal_Bool OResultSet::fetchRow(sal_Int32 cardNumber,sal_Bool bForceReload) throw(
//
// Everything in the addressbook is a string!
//
- if ( !m_aQuery.getRowValue( (m_aRow->get())[i], cardNumber, m_aColumnNames[i-1], DataType::VARCHAR )) {
- m_pStatement->getOwnConnection()->throwGenericSQLException( m_aQuery.getErrorResourceId(),*this );
+ if ( !m_aQuery.getRowValue( (m_aRow->get())[i], cardNumber, m_aColumnNames[i-1], DataType::VARCHAR ))
+ {
+ m_pStatement->getOwnConnection()->throwSQLException( m_aQuery.getError(), *this );
}
}
}
@@ -613,7 +615,7 @@ void SAL_CALL OResultSet::refreshRow( ) throw(SQLException, RuntimeException)
{
OSL_TRACE("In/Out: OResultSet::refreshRow" );
if (fetchRow(getCurrentCardNumber(),sal_True)) //force fetch current row will cause we lose all change to the current row
- m_pStatement->getOwnConnection()->throwGenericSQLException(STR_ERROR_REFRESH_ROW,*this);
+ m_pStatement->getOwnConnection()->throwSQLException( STR_ERROR_REFRESH_ROW, *this );
}
// -------------------------------------------------------------------------
IPropertyArrayHelper* OResultSet::createArrayHelper( ) const
@@ -852,7 +854,7 @@ void OResultSet::analyseWhereClause( const OSQLParseNode* parseT
// odbc date
(SQL_ISRULE(parseTree->getChild(2),set_fct_spec) && SQL_ISPUNCTUATION(parseTree->getChild(2)->getChild(0),"{"))))
{
- m_pStatement->getOwnConnection()->throwGenericSQLException(STR_QUERY_TOO_COMPLEX,*this);
+ m_pStatement->getOwnConnection()->throwSQLException( STR_QUERY_TOO_COMPLEX, *this );
}
OSQLParseNode *pPrec = parseTree->getChild(1);
@@ -889,7 +891,7 @@ void OResultSet::analyseWhereClause( const OSQLParseNode* parseT
if ( !(SQL_ISRULE(parseTree->getChild(0), column_ref)) )
{
- m_pStatement->getOwnConnection()->throwGenericSQLException(STR_QUERY_INVALID_LIKE_COLUMN,*this);
+ m_pStatement->getOwnConnection()->throwSQLException( STR_QUERY_INVALID_LIKE_COLUMN, *this );
}
@@ -909,7 +911,7 @@ void OResultSet::analyseWhereClause( const OSQLParseNode* parseT
{
OSL_TRACE("analyseSQL : pAtom->count() = %d\n", pAtom->count() );
- m_pStatement->getOwnConnection()->throwGenericSQLException(STR_QUERY_INVALID_LIKE_STRING,*this);
+ m_pStatement->getOwnConnection()->throwSQLException( STR_QUERY_INVALID_LIKE_STRING, *this );
}
const sal_Unicode WILDCARD = '%';
@@ -971,7 +973,7 @@ void OResultSet::analyseWhereClause( const OSQLParseNode* parseT
{
// We currently can't handle a 'NOT LIKE' when there are '%' or
// '_' dispersed throughout
- m_pStatement->getOwnConnection()->throwGenericSQLException(STR_QUERY_NOT_LIKE_TOO_COMPLEX,*this);
+ m_pStatement->getOwnConnection()->throwSQLException( STR_QUERY_NOT_LIKE_TOO_COMPLEX, *this );
}
else
{
@@ -1026,7 +1028,7 @@ void OResultSet::analyseWhereClause( const OSQLParseNode* parseT
if (!SQL_ISRULE(parseTree->getChild(0),column_ref))
{
- m_pStatement->getOwnConnection()->throwGenericSQLException(STR_QUERY_INVALID_IS_NULL_COLUMN,*this);
+ m_pStatement->getOwnConnection()->throwSQLException( STR_QUERY_INVALID_IS_NULL_COLUMN, *this );
}
if (SQL_ISTOKEN(parseTree->getChild(2),NOT))
@@ -1045,7 +1047,7 @@ void OResultSet::analyseWhereClause( const OSQLParseNode* parseT
{
OSL_TRACE( "Unexpected statement!!!" );
- m_pStatement->getOwnConnection()->throwGenericSQLException(STR_QUERY_TOO_COMPLEX,*this);
+ m_pStatement->getOwnConnection()->throwSQLException( STR_QUERY_TOO_COMPLEX, *this );
}
}
@@ -1131,7 +1133,7 @@ void OResultSet::fillRowData()
sal_Int32 rv = m_aQuery.executeQuery(xConnection);
if ( rv == -1 ) {
- m_pStatement->getOwnConnection()->throwGenericSQLException(STR_ERR_EXECUTING_QUERY,*this);
+ m_pStatement->getOwnConnection()->throwSQLException( STR_ERR_EXECUTING_QUERY, *this );
}
//determine whether the address book is readonly
determineReadOnly();
@@ -1179,7 +1181,7 @@ sal_Int32 OResultSet::getRowForCardNumber(sal_Int32 nCardNum)
}
}
- m_pStatement->getOwnConnection()->throwGenericSQLException(STR_INVALID_BOOKMARK,*this);
+ m_pStatement->getOwnConnection()->throwSQLException( STR_INVALID_BOOKMARK, *this );
return 0;
}
@@ -1194,7 +1196,7 @@ void SAL_CALL OResultSet::executeQuery() throw( ::com::sun::star::sdbc::SQLExcep
{
const OSQLTables& xTabs = m_pSQLIterator->getTables();
if ((xTabs.begin() == xTabs.end()) || !xTabs.begin()->second.is())
- m_pStatement->getOwnConnection()->throwGenericSQLException(STR_QUERY_TOO_COMPLEX,*this);
+ m_pStatement->getOwnConnection()->throwSQLException( STR_QUERY_TOO_COMPLEX, *this );
m_pTable = static_cast< OTable* > ((xTabs.begin()->second).get());
@@ -1219,7 +1221,7 @@ void SAL_CALL OResultSet::executeQuery() throw( ::com::sun::star::sdbc::SQLExcep
}
else if(isCount())
{
- m_pStatement->getOwnConnection()->throwGenericSQLException(STR_NO_COUNT_SUPPORT,*this);
+ m_pStatement->getOwnConnection()->throwSQLException( STR_NO_COUNT_SUPPORT, *this );
}
else
{
@@ -1284,8 +1286,9 @@ void SAL_CALL OResultSet::executeQuery() throw( ::com::sun::star::sdbc::SQLExcep
OSL_TRACE("Query is to be sorted");
if( ! m_aQuery.queryComplete() )
- if ( !m_aQuery.waitForQueryComplete() ) {
- m_pStatement->getOwnConnection()->throwGenericSQLException( m_aQuery.getErrorResourceId(),*this );
+ if ( !m_aQuery.waitForQueryComplete() )
+ {
+ m_pStatement->getOwnConnection()->throwSQLException( m_aQuery.getError(), *this );
}
OSL_ENSURE( m_aQuery.queryComplete(), "Query not complete!!");
@@ -1360,7 +1363,7 @@ void SAL_CALL OResultSet::executeQuery() throw( ::com::sun::star::sdbc::SQLExcep
case SQL_STATEMENT_INSERT:
break;
default:
- m_pStatement->getOwnConnection()->throwGenericSQLException(STR_STMT_TYPE_NOT_SUPPORTED,*this);
+ m_pStatement->getOwnConnection()->throwSQLException( STR_STMT_TYPE_NOT_SUPPORTED, *this );
break;
}
}
@@ -1472,8 +1475,9 @@ sal_Bool OResultSet::validRow( sal_uInt32 nRow )
OSL_TRACE("validRow: waiting...");
#endif
m_aQuery.checkRowAvailable( nRow );
- if ( m_aQuery.errorOccurred() ) {
- m_pStatement->getOwnConnection()->throwGenericSQLException( m_aQuery.getErrorResourceId() ,*this);
+ if ( m_aQuery.hadError() )
+ {
+ m_pStatement->getOwnConnection()->throwSQLException( m_aQuery.getError(), *this );
}
nNumberOfRecords = m_aQuery.getRealRowCount();
}
@@ -1515,7 +1519,7 @@ sal_Bool OResultSet::seekRow( eRowPosition pos, sal_Int32 nOffset )
{
ResultSetEntryGuard aGuard( *this );
if ( !m_pKeySet.isValid() )
- m_pStatement->getOwnConnection()->throwGenericSQLException(STR_ILLEGAL_MOVEMENT,*this);
+ m_pStatement->getOwnConnection()->throwSQLException( STR_ILLEGAL_MOVEMENT, *this );
sal_Int32 nNumberOfRecords = m_aQuery.getRealRowCount();
sal_Int32 nRetrivedRows = currentRowCount();
@@ -1567,8 +1571,9 @@ sal_Bool OResultSet::seekRow( eRowPosition pos, sal_Int32 nOffset )
while ( nCurCard > nNumberOfRecords && !m_aQuery.queryComplete() ) {
m_aQuery.checkRowAvailable( nCurCard );
- if ( m_aQuery.errorOccurred() ) {
- m_pStatement->getOwnConnection()->throwGenericSQLException( m_aQuery.getErrorResourceId(),*this );
+ if ( m_aQuery.hadError() )
+ {
+ m_pStatement->getOwnConnection()->throwSQLException( m_aQuery.getError(), *this );
}
nNumberOfRecords = m_aQuery.getRealRowCount();
}
@@ -1602,7 +1607,7 @@ void OResultSet::setColumnMapping(const ::std::vector<sal_Int32>& _aColumnMappin
OSL_TRACE("getBookmark, m_nRowPos = %u", m_nRowPos );
ResultSetEntryGuard aGuard( *this );
if ( fetchCurrentRow() == sal_False )
- m_pStatement->getOwnConnection()->throwGenericSQLException(STR_ERROR_GET_ROW,*this);
+ m_pStatement->getOwnConnection()->throwSQLException( STR_ERROR_GET_ROW, *this );
OSL_ENSURE((!m_aRow->isDeleted()),"getBookmark called for deleted row");
return makeAny((sal_Int32)(m_aRow->get())[0]);
@@ -1633,7 +1638,7 @@ sal_Int32 OResultSet::compareBookmarks( const ::com::sun::star::uno::Any& lhs, c
sal_Int32 nResult=0;
if ( !( lhs >>= nFirst ) || !( rhs >>= nSecond ) )
- m_pStatement->getOwnConnection()->throwGenericSQLException(STR_INVALID_BOOKMARK,*this);
+ m_pStatement->getOwnConnection()->throwSQLException( STR_INVALID_BOOKMARK, *this );
if(nFirst < nSecond)
nResult = -1;
@@ -1686,7 +1691,7 @@ void OResultSet::updateValue(sal_Int32 columnIndex ,const ORowSetValue& x) throw
OSL_TRACE("updateValue, m_nRowPos = %u", m_nRowPos );
ResultSetEntryGuard aGuard( *this );
if ( fetchCurrentRow() == sal_False )
- m_pStatement->getOwnConnection()->throwGenericSQLException(STR_ERROR_GET_ROW,*this);
+ m_pStatement->getOwnConnection()->throwSQLException( STR_ERROR_GET_ROW, *this );
checkPendingUpdate();
@@ -1706,7 +1711,7 @@ void SAL_CALL OResultSet::updateNull( sal_Int32 columnIndex ) throw(SQLException
OSL_TRACE("updateNull, m_nRowPos = %u", m_nRowPos );
ResultSetEntryGuard aGuard( *this );
if ( fetchCurrentRow() == sal_False )
- m_pStatement->getOwnConnection()->throwGenericSQLException(STR_ERROR_GET_ROW,*this);
+ m_pStatement->getOwnConnection()->throwSQLException( STR_ERROR_GET_ROW, *this );
checkPendingUpdate();
checkIndex(columnIndex );
@@ -1847,21 +1852,21 @@ void SAL_CALL OResultSet::updateRow( ) throw(::com::sun::star::sdbc::SQLExcepti
impl_ensureKeySet();
if (!m_nRowPos || m_pKeySet->get().size() < m_nRowPos )
- m_pStatement->getOwnConnection()->throwGenericSQLException(STR_INVALID_ROW_UPDATE,*this);
+ m_pStatement->getOwnConnection()->throwSQLException( STR_INVALID_ROW_UPDATE, *this );
const sal_Int32 nCurrentCard = getCurrentCardNumber();
if (!pushCard(nCurrentCard))
{
m_RowStates = RowStates_Error;
- m_pStatement->getOwnConnection()->throwGenericSQLException(STR_ROW_CAN_NOT_SAVE,*this);
+ m_pStatement->getOwnConnection()->throwSQLException( STR_ROW_CAN_NOT_SAVE, *this );
}
if (!m_aQuery.commitRow(nCurrentCard))
{
m_RowStates = RowStates_Error;
m_nUpdatedRow = 0;
- m_pStatement->getOwnConnection()->throwGenericSQLException( m_aQuery.getErrorResourceId() ,*this);
+ m_pStatement->getOwnConnection()->throwSQLException( m_aQuery.getError(), *this );
}
m_nUpdatedRow = 0;
@@ -1874,16 +1879,16 @@ void SAL_CALL OResultSet::deleteRow( ) throw(::com::sun::star::sdbc::SQLExcepti
OSL_TRACE("deleteRow, m_nRowPos = %u", m_nRowPos );
ResultSetEntryGuard aGuard( *this );
if (rowDeleted())
- m_pStatement->getOwnConnection()->throwGenericSQLException(STR_ROW_ALREADY_DELETED,*this);
+ m_pStatement->getOwnConnection()->throwSQLException( STR_ROW_ALREADY_DELETED, *this );
const sal_Int32 nCurrentRow = getCurrentCardNumber();
//fetchRow(nCurrentRow);
if (!nCurrentRow)
- m_pStatement->getOwnConnection()->throwGenericSQLException(STR_ERROR_GET_ROW,*this);
+ m_pStatement->getOwnConnection()->throwSQLException( STR_ERROR_GET_ROW, *this );
sal_Bool m_bRowDeleted = ( m_aQuery.deleteRow( nCurrentRow ) > 0 );
if (!m_bRowDeleted)
- m_pStatement->getOwnConnection()->throwGenericSQLException( m_aQuery.getErrorResourceId() ,*this);
+ m_pStatement->getOwnConnection()->throwSQLException( m_aQuery.getError(), *this );
m_aQuery.setRowStates(nCurrentRow,RowStates_Deleted);
m_pKeySet->get().erase(m_pKeySet->get().begin() + m_nRowPos -1);
@@ -1896,7 +1901,7 @@ void SAL_CALL OResultSet::cancelRowUpdates( ) throw(::com::sun::star::sdbc::SQL
ResultSetEntryGuard aGuard( *this );
OSL_TRACE("cancelRowUpdates, m_nRowPos = %u", m_nRowPos );
if (fetchRow(getCurrentCardNumber(),sal_True)) //force fetch current row will cause we lose all change to the current row
- m_pStatement->getOwnConnection()->throwGenericSQLException(STR_CAN_NOT_CANCEL_ROW_UPDATE,*this);
+ m_pStatement->getOwnConnection()->throwSQLException( STR_CAN_NOT_CANCEL_ROW_UPDATE, *this );
}
// -------------------------------------------------------------------------
void SAL_CALL OResultSet::moveToInsertRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
@@ -1916,7 +1921,7 @@ void SAL_CALL OResultSet::moveToInsertRow( ) throw(::com::sun::star::sdbc::SQLE
}
m_nNewRow = m_aQuery.createNewCard();
if (!m_nNewRow)
- m_pStatement->getOwnConnection()->throwGenericSQLException(STR_CAN_NOT_CREATE_ROW,*this);
+ m_pStatement->getOwnConnection()->throwSQLException( STR_CAN_NOT_CREATE_ROW, *this );
m_RowStates = RowStates_Normal;
fillKeySet(m_nNewRow);
diff --git a/connectivity/source/drivers/mozab/MStatement.cxx b/connectivity/source/drivers/mozab/MStatement.cxx
index a74128532dc6..50d0b63941f9 100644
--- a/connectivity/source/drivers/mozab/MStatement.cxx
+++ b/connectivity/source/drivers/mozab/MStatement.cxx
@@ -222,7 +222,7 @@ void OStatement_Base::createTable( )
MDatabaseMetaDataHelper _aDbHelper;
if (!_aDbHelper.NewAddressBook(m_pConnection,ouTableName))
{
- getOwnConnection()->throwGenericSQLException( _aDbHelper.getErrorResourceId(),*this );
+ getOwnConnection()->throwSQLException( _aDbHelper.getError(), *this );
}
m_pSQLIterator.reset( new ::connectivity::OSQLParseTreeIterator(
m_pConnection, m_pConnection->createCatalog()->getTables(), m_aParser, NULL ) );
@@ -230,7 +230,7 @@ void OStatement_Base::createTable( )
}
else
- getOwnConnection()->throwGenericSQLException( STR_QUERY_TOO_COMPLEX ,*this);
+ getOwnConnection()->throwSQLException( STR_QUERY_TOO_COMPLEX, *this );
}
// -------------------------------------------------------------------------
sal_Bool OStatement_Base::parseSql( const ::rtl::OUString& sql , sal_Bool bAdjusted)
@@ -256,7 +256,7 @@ sal_Bool OStatement_Base::parseSql( const ::rtl::OUString& sql , sal_Bool bAdjus
m_pSQLIterator->traverseAll();
const OSQLTables& xTabs = m_pSQLIterator->getTables();
if(xTabs.empty())
- getOwnConnection()->throwGenericSQLException( STR_QUERY_AT_LEAST_ONE_TABLES,*this );
+ getOwnConnection()->throwSQLException( STR_QUERY_AT_LEAST_ONE_TABLES, *this );
#if OSL_DEBUG_LEVEL > 0
OSQLTables::const_iterator citer;
@@ -290,7 +290,7 @@ sal_Bool OStatement_Base::parseSql( const ::rtl::OUString& sql , sal_Bool bAdjus
createTable();
return sal_False;
default:
- getOwnConnection()->throwGenericSQLException( STR_QUERY_TOO_COMPLEX ,*this);
+ getOwnConnection()->throwSQLException( STR_QUERY_TOO_COMPLEX, *this );
}
}
else if(!bAdjusted) //Our sql parser does not support a statement like "create table foo"
@@ -299,7 +299,7 @@ sal_Bool OStatement_Base::parseSql( const ::rtl::OUString& sql , sal_Bool bAdjus
return parseSql(sql + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("(""E-mail"" caracter)")),sal_True);
}
else
- getOwnConnection()->throwGenericSQLException( STR_QUERY_TOO_COMPLEX ,*this);
+ getOwnConnection()->throwSQLException( STR_QUERY_TOO_COMPLEX, *this );
return sal_True;
}
diff --git a/connectivity/source/drivers/mozab/mozillasrc/MDatabaseMetaDataHelper.cxx b/connectivity/source/drivers/mozab/mozillasrc/MDatabaseMetaDataHelper.cxx
index ee637ff763a6..f681d6953e04 100644
--- a/connectivity/source/drivers/mozab/mozillasrc/MDatabaseMetaDataHelper.cxx
+++ b/connectivity/source/drivers/mozab/mozillasrc/MDatabaseMetaDataHelper.cxx
@@ -64,6 +64,7 @@ static ::osl::Mutex m_aMetaMutex;
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/XPropertySetInfo.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
+#include <com/sun/star/sdb/ErrorCondition.hpp>
#include <unotools/processfactory.hxx>
#include <com/sun/star/mozilla/XMozillaBootstrap.hpp>
@@ -86,6 +87,7 @@ using namespace com::sun::star::lang;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::sdbc;
using namespace com::sun::star::mozilla;
+using namespace com::sun::star::sdb;
namespace connectivity
{
@@ -341,43 +343,43 @@ static nsresult getSubsFromURI(const rtl::OString& aUri, nsIEnumerator **aSubs)
return retCode ;
}
-void MDatabaseMetaDataHelper::setAbSpecificError( OConnection* _pCon, sal_Bool bGivenURI )
+namespace
{
- if ( ! bGivenURI && m_ProductType ==::com::sun::star::mozilla::MozillaProductType_Mozilla)
+ static void lcl_setNoAddressBookFoundError( ErrorDescriptor& _rError, OConnection& _rCon, MozillaProductType _eProductType,
+ sal_Bool bGivenURI )
{
- setError( STR_NO_MOZIILA_ADDRESSBOOK );
- }
- else
- {
- if ( m_ProductType ==::com::sun::star::mozilla::MozillaProductType_Thunderbird)
+ sal_uInt16 nAddressBookNameRes = 0;
+ if ( !bGivenURI && _eProductType == MozillaProductType_Mozilla)
{
- setError( STR_NO_THUNDERBIRD_ADDRESSBOOK );
+ nAddressBookNameRes = STR_MOZILLA_ADDRESSBOOKS;
}
else
{
- if (_pCon->usesFactory())
+ if ( _eProductType == MozillaProductType_Thunderbird )
{
- if ( _pCon->isOutlookExpress() )
- {
- setError( STR_NO_OUTLOOKEXPRESS_ADDRESSBOOK );
- }
- else
- {
- setError( STR_NO_OUTLOOK_ADDRESSBOOK );
- }
+ nAddressBookNameRes = STR_THUNDERBIRD_ADDRESSBOOKS;
}
else
{
- if (_pCon->isLDAP())
+ if ( _rCon.usesFactory() )
{
- setError( STR_COULDNOTCONNECT_TO_LDAP );
+ if ( _rCon.isOutlookExpress() )
+ {
+ nAddressBookNameRes = STR_OE_ADDRESSBOOK;
+ }
+ else
+ {
+ nAddressBookNameRes = STR_OUTLOOK_MAPI_ADDRESSBOOK;
+ }
}
else
{
- setError( STR_NO_MOZIILA_ADDRESSBOOK );
+ OSL_ENSURE( !_rCon.isLDAP(), "lcl_setNoAddressBookFoundError: not to be called for LDAP connections!" );
+ nAddressBookNameRes = STR_MOZILLA_ADDRESSBOOKS;
}
}
}
+ _rError.set( 0, ErrorCondition::AB_ADDRESSBOOK_NOT_FOUND, _rCon.getResources().getResourceString( nAddressBookNameRes ) );
}
}
@@ -521,7 +523,7 @@ sal_Bool MDatabaseMetaDataHelper::getTableStrings( OConnection*
nsresult rv = NS_OK;
nsCOMPtr<nsIEnumerator> subDirectories;
sal_Int32 nDirectoryType=0;
- m_ProductType=::com::sun::star::mozilla::MozillaProductType_Mozilla;
+ m_ProductType = MozillaProductType_Mozilla;
m_ProfileName = _pCon->getMozProfile();
@@ -530,30 +532,35 @@ sal_Bool MDatabaseMetaDataHelper::getTableStrings( OConnection*
if (!bGivenURI)
sAbURIString = s_pADDRESSBOOKROOTDIR;
nDirectoryType = SDBCAddress::ThunderBird;
- m_ProductType = ::com::sun::star::mozilla::MozillaProductType_Thunderbird;
+ m_ProductType = MozillaProductType_Thunderbird;
}
- else
- if (!bGivenURI) {
+ else if (!bGivenURI)
+ {
sAbURIString = s_pADDRESSBOOKROOTDIR;
nDirectoryType = SDBCAddress::Mozilla;
}
- else {
- if (_pCon->usesFactory()) {
+ else
+ {
+ if (_pCon->usesFactory())
+ {
nDirectoryType = SDBCAddress::Outlook;
}
- else {
- if (_pCon->isLDAP()) {
+ else
+ {
+ if (_pCon->isLDAP())
+ {
nDirectoryType = SDBCAddress::LDAP;
}
- else {
+ else
+ {
sAbURIString = s_pADDRESSBOOKROOTDIR;
nDirectoryType = SDBCAddress::Mozilla;
}
}
}
- if (!m_bProfileExists)
- {
+ if ( !_pCon->isLDAP() && !m_bProfileExists )
+ { // no need to boot up a Mozilla profile for an LDAP connection
Reference<XMozillaBootstrap> xMozillaBootstrap;
Reference<XMultiServiceFactory> xFactory = ::comphelper::getProcessServiceFactory();
OSL_ENSURE( xFactory.is(), "can't get service factory" );
@@ -572,11 +579,14 @@ sal_Bool MDatabaseMetaDataHelper::getTableStrings( OConnection*
m_bProfileExists = sal_True;
}
- if ( ( nDirectoryType == SDBCAddress::Mozilla
- || m_ProductType ==::com::sun::star::mozilla::MozillaProductType_Thunderbird)
- && !m_bProfileExists)
+ if ( !m_bProfileExists
+ && !_pCon->isLDAP()
+ && ( ( nDirectoryType == SDBCAddress::Mozilla )
+ || ( nDirectoryType == SDBCAddress::ThunderBird )
+ )
+ )
{
- setAbSpecificError( _pCon, bGivenURI );
+ lcl_setNoAddressBookFoundError( m_aError, *_pCon, m_ProductType, bGivenURI );
return sal_False;
}
@@ -596,11 +606,12 @@ sal_Bool MDatabaseMetaDataHelper::getTableStrings( OConnection*
args.arg5 = (void*)&m_aTableTypes;
args.arg6 = (void*)&nErrorResourceId;
rv = xMProxy.StartProxy(&args,m_ProductType,m_ProfileName);
- setError( static_cast<sal_uInt16>(nErrorResourceId) );
+ m_aError.setResId( static_cast<sal_uInt16>(nErrorResourceId) );
if (NS_FAILED(rv))
{
- setAbSpecificError( _pCon, bGivenURI );
+ if ( nErrorResourceId == 0 )
+ m_aError.setResId( STR_UNSPECIFIED_ERROR );
return sal_False;
}
OSL_TRACE( "\tOUT MDatabaseMetaDataHelper::getTableStrings()\n" );
@@ -729,7 +740,7 @@ MDatabaseMetaDataHelper::testLDAPConnection( OConnection* _pCon )
osl_waitThread( &timeValue );
}
}
- setError( STR_COULD_NOT_CONNECT_LDAP );
+ m_aError.setResId( STR_COULD_NOT_CONNECT_LDAP );
return NS_SUCCEEDED( rv ) ? sal_True : sal_False;
}
@@ -741,7 +752,7 @@ sal_Bool MDatabaseMetaDataHelper::NewAddressBook(OConnection* _pCon,const ::rtl:
if ( !bIsMozillaAB )
{
- setError( STR_NO_TABLE_CREATION_SUPPORT );
+ m_aError.setResId( STR_NO_TABLE_CREATION_SUPPORT );
return sal_False;
}
else
@@ -760,11 +771,11 @@ sal_Bool MDatabaseMetaDataHelper::NewAddressBook(OConnection* _pCon,const ::rtl:
_pCon->setForceLoadTables(sal_True); //force reload table next time
if (rv == NS_ERROR_FILE_IS_LOCKED)
{
- setError( STR_MOZILLA_IS_RUNNING );
+ m_aError.setResId( STR_MOZILLA_IS_RUNNING );
}
else if (NS_FAILED(rv))
{
- setAbSpecificError( _pCon, !bIsMozillaAB );
+ m_aError.set( STR_COULD_NOT_CREATE_ADDRESSBOOK, 0, ::rtl::OUString::valueOf( sal_Int32(rv), 16 ) );
}
OSL_TRACE( "OUT MDatabaseMetaDataHelper::NewAddressBook()\n" );
return( NS_SUCCEEDED(rv) ? sal_True : sal_False );
diff --git a/connectivity/source/drivers/mozab/mozillasrc/MDatabaseMetaDataHelper.hxx b/connectivity/source/drivers/mozab/mozillasrc/MDatabaseMetaDataHelper.hxx
index 9fcdc90d9a3e..8d2971f3e57f 100644
--- a/connectivity/source/drivers/mozab/mozillasrc/MDatabaseMetaDataHelper.hxx
+++ b/connectivity/source/drivers/mozab/mozillasrc/MDatabaseMetaDataHelper.hxx
@@ -48,7 +48,7 @@ namespace connectivity
{
namespace mozab
{
- class MDatabaseMetaDataHelper : public ErrorResourceAccess
+ class MDatabaseMetaDataHelper
{
private:
sal_Bool m_bProfileExists ;
@@ -56,6 +56,7 @@ namespace connectivity
::std::vector< ::rtl::OUString > m_aTableTypes;
::com::sun::star::mozilla::MozillaProductType m_ProductType;
::rtl::OUString m_ProfileName;
+ ErrorDescriptor m_aError;
public:
MDatabaseMetaDataHelper();
@@ -73,8 +74,7 @@ namespace connectivity
sal_Bool testLDAPConnection( OConnection* _pCon );
sal_Bool NewAddressBook( OConnection* _pCon,const ::rtl::OUString & aTableName);
- private:
- void setAbSpecificError( OConnection* _pCon, sal_Bool bGivenURI );
+ inline const ErrorDescriptor& getError() const { return m_aError; }
};
}
diff --git a/connectivity/source/drivers/mozab/mozillasrc/MErrorResource.hxx b/connectivity/source/drivers/mozab/mozillasrc/MErrorResource.hxx
index 20a13554c7fa..1a644285f2cb 100644
--- a/connectivity/source/drivers/mozab/mozillasrc/MErrorResource.hxx
+++ b/connectivity/source/drivers/mozab/mozillasrc/MErrorResource.hxx
@@ -31,25 +31,48 @@
#ifndef CONNECITIVITY_MOZAB_ERROR_RESOURCE_HXX
#define CONNECITIVITY_MOZAB_ERROR_RESOURCE_HXX
-#include <sal/types.h>
+#include <rtl/ustring.hxx>
namespace connectivity
{
namespace mozab
{
- class ErrorResourceAccess
+ class ErrorDescriptor
{
private:
- mutable sal_uInt16 m_nErrorResourceId;
+ sal_uInt16 m_nErrorResourceId;
+ sal_Int32 m_nErrorCondition;
+ ::rtl::OUString m_sParameter;
- protected:
- ErrorResourceAccess() : m_nErrorResourceId(0) { }
-
- inline void setError( sal_uInt16 _nErrorResourceId ) const { const_cast< ErrorResourceAccess* >( this )->m_nErrorResourceId = _nErrorResourceId; }
- inline void resetError( ) const { const_cast< ErrorResourceAccess* >( this )->m_nErrorResourceId = 0; }
public:
- inline sal_uInt16 getErrorResourceId() const
- { return m_nErrorResourceId; }
+ ErrorDescriptor()
+ :m_nErrorResourceId(0)
+ ,m_nErrorCondition(0)
+ ,m_sParameter()
+ {
+ }
+
+ inline void set( const sal_uInt16 _nErrorResourceId, const sal_Int32 _nErrorCondition, const ::rtl::OUString& _rParam )
+ {
+ m_nErrorResourceId = _nErrorResourceId;
+ m_nErrorCondition = _nErrorCondition;
+ m_sParameter = _rParam;
+ }
+ inline void setResId( const sal_uInt16 _nErrorResourceId )
+ {
+ m_nErrorResourceId = _nErrorResourceId;
+ }
+ inline void reset()
+ {
+ m_nErrorResourceId = 0;
+ m_nErrorCondition = 0;
+ }
+
+ inline sal_uInt16 getResId() const { return m_nErrorResourceId; }
+ inline sal_Int32 getErrorCondition() const { return m_nErrorCondition; }
+ inline const ::rtl::OUString& getParameter() const { return m_sParameter; }
+
+ inline bool is() const { return ( m_nErrorResourceId != 0 ) || ( m_nErrorCondition != 0 ); }
};
}
}
diff --git a/connectivity/source/drivers/mozab/mozillasrc/MQuery.cxx b/connectivity/source/drivers/mozab/mozillasrc/MQuery.cxx
index 295231635efd..b298e56262cc 100644
--- a/connectivity/source/drivers/mozab/mozillasrc/MQuery.cxx
+++ b/connectivity/source/drivers/mozab/mozillasrc/MQuery.cxx
@@ -127,7 +127,7 @@ MQuery::~MQuery()
void MQuery::construct()
{
// Set default values. (For now just as a reminder).
- m_aErrorOccurred = sal_False;
+ m_aError.reset();
m_bQuerySubDirs = sal_True; // LDAP Queryies require this to be set!
m_nMaxNrOfReturns = -1; // Unlimited number of returns.
@@ -459,7 +459,7 @@ sal_Int32 MQuery::commitRow(const sal_Int32 rowIndex)
args.arg2 = (void*)&rowIndex;
args.arg3 = (void*)m_aQueryDirectory->directory;
nsresult rv = xMProxy.StartProxy(&args,m_Product,m_Profile);
- setError( m_aQueryHelper->getErrorResourceId() );
+ m_aError = m_aQueryHelper->getError();
return rv;
}
@@ -476,7 +476,7 @@ sal_Int32 MQuery::deleteRow(const sal_Int32 rowIndex)
args.arg2 = (void*)&rowIndex;
args.arg3 = (void*)m_aQueryDirectory->directory;
nsresult rv = xMProxy.StartProxy(&args,m_Product,m_Profile);
- setError( m_aQueryHelper->getErrorResourceId() );
+ m_aError = m_aQueryHelper->getError();
return rv;
}
@@ -623,7 +623,7 @@ sal_Int32 MQuery::executeQueryProxied(OConnection* _pCon)
// Execute the query.
OSL_TRACE( "****** calling DoQuery\n");
- m_aErrorOccurred = sal_False;
+ m_aError.reset();
m_aQueryHelper->reset();
@@ -679,7 +679,7 @@ MQuery::getRealRowCount()
sal_Bool
MQuery::queryComplete( void )
{
- return( m_aErrorOccurred || m_aQueryHelper->queryComplete() );
+ return( hadError() || m_aQueryHelper->queryComplete() );
}
sal_Bool
@@ -687,8 +687,7 @@ MQuery::waitForQueryComplete( void )
{
if( m_aQueryHelper->waitForQueryComplete( ) )
return sal_True;
- setError( m_aQueryHelper->getErrorResourceId() );
- m_aErrorOccurred = sal_True;
+ m_aError = m_aQueryHelper->getError();
return( sal_False );
}
@@ -699,8 +698,7 @@ MQuery::checkRowAvailable( sal_Int32 nDBRow )
{
while( !queryComplete() && m_aQueryHelper->getRealCount() <= (sal_uInt32)nDBRow )
if ( !m_aQueryHelper->waitForRow( nDBRow ) ) {
- m_aErrorOccurred = sal_True;
- setError( m_aQueryHelper->getErrorResourceId() );
+ m_aError = m_aQueryHelper->getError();
return( sal_False );
}
@@ -715,8 +713,7 @@ MQuery::setRowValue( ORowSetValue& rValue, sal_Int32 nDBRow,const rtl::OUString&
OSL_ENSURE( xResEntry != NULL, "xResEntry == NULL");
if (xResEntry == NULL )
{
- m_aErrorOccurred = sal_True;
- setError( m_aQueryHelper->getErrorResourceId() );
+ const_cast< MQuery* >( this )->m_aError = m_aQueryHelper->getError();
return sal_False;
}
switch ( nType )
@@ -741,8 +738,7 @@ MQuery::getRowValue( ORowSetValue& rValue, sal_Int32 nDBRow,const rtl::OUString&
OSL_ENSURE( xResEntry != NULL, "xResEntry == NULL");
if (xResEntry == NULL )
{
- m_aErrorOccurred = sal_True;
- setError( m_aQueryHelper->getErrorResourceId() );
+ const_cast< MQuery* >( this )->m_aError = m_aQueryHelper->getError();
rValue.setNull();
return sal_False;
}
@@ -768,8 +764,7 @@ MQuery::getRowStates(sal_Int32 nDBRow)
OSL_ENSURE( xResEntry != NULL, "xResEntry == NULL");
if (xResEntry == NULL )
{
- m_aErrorOccurred = sal_True;
- setError( m_aQueryHelper->getErrorResourceId() );
+ m_aError = m_aQueryHelper->getError();
return RowStates_Error;
}
return xResEntry->getRowStates();
@@ -782,8 +777,7 @@ MQuery::setRowStates(sal_Int32 nDBRow,sal_Int32 aState)
OSL_ENSURE( xResEntry != NULL, "xResEntry == NULL");
if (xResEntry == NULL )
{
- m_aErrorOccurred = sal_True;
- setError( m_aQueryHelper->getErrorResourceId() );
+ m_aError = m_aQueryHelper->getError();
return sal_False;
}
return xResEntry->setRowStates(aState);
@@ -799,7 +793,7 @@ MQuery::resyncRow(sal_Int32 nDBRow)
args.arg1 = (void*)m_aQueryHelper;
args.arg2 = (void*)&nDBRow;
nsresult rv = xMProxy.StartProxy(&args,m_Product,m_Profile);
- setError( m_aQueryHelper->getErrorResourceId() );
+ m_aError = m_aQueryHelper->getError();
return NS_SUCCEEDED( rv ) ? sal_True : sal_False;
}
@@ -815,7 +809,7 @@ MQuery::createNewCard()
args.arg2 = (void*)&nNumber;
nsresult rv = xMProxy.StartProxy(&args,m_Product,m_Profile);
- setError( m_aQueryHelper->getErrorResourceId() );
+ m_aError = m_aQueryHelper->getError();
NS_ENSURE_SUCCESS(rv,0);
return nNumber;
}
diff --git a/connectivity/source/drivers/mozab/mozillasrc/MQuery.hxx b/connectivity/source/drivers/mozab/mozillasrc/MQuery.hxx
index 75dc59732403..7ff57d8d0d23 100644
--- a/connectivity/source/drivers/mozab/mozillasrc/MQuery.hxx
+++ b/connectivity/source/drivers/mozab/mozillasrc/MQuery.hxx
@@ -156,7 +156,7 @@ namespace connectivity
};
- class MQuery : public ErrorResourceAccess
+ class MQuery
{
/*
* A query resultset with a maximum limit of
@@ -211,9 +211,11 @@ namespace connectivity
sal_Bool m_bQuerySubDirs;
MQueryExpression m_aExpr;
const OColumnAlias& m_rColumnAlias;
- mutable sal_Bool m_aErrorOccurred;
- ::com::sun::star::mozilla::MozillaProductType m_Product;
- ::rtl::OUString m_Profile;
+ ::com::sun::star::mozilla::MozillaProductType
+ m_Product;
+ ::rtl::OUString m_Profile;
+ ErrorDescriptor m_aError;
+
void construct();
protected:
::osl::Mutex m_aMutex;
@@ -270,8 +272,8 @@ namespace connectivity
sal_Int32 getRowStates(sal_Int32 nDBRow);
sal_Bool setRowStates(sal_Int32 nDBRow,sal_Int32 aState);
- sal_Bool errorOccurred() const
- { return m_aErrorOccurred; };
+ bool hadError() const { return m_aError.is(); }
+ inline const ErrorDescriptor& getError() const { return m_aError; }
public:
// MQuery();
diff --git a/connectivity/source/drivers/mozab/mozillasrc/MQueryHelper.cxx b/connectivity/source/drivers/mozab/mozillasrc/MQueryHelper.cxx
index 6e941175b59a..01fed34d8b39 100644
--- a/connectivity/source/drivers/mozab/mozillasrc/MQueryHelper.cxx
+++ b/connectivity/source/drivers/mozab/mozillasrc/MQueryHelper.cxx
@@ -238,16 +238,16 @@ MQueryHelper::waitForResultOrComplete( )
}
if (times >= 20 && rv == ::osl::Condition::result_timeout ) {
OSL_TRACE("waitForResultOrComplete() : Timeout!");
- setError( STR_TIMEOUT_WAITING );
+ m_aError.setResId( STR_TIMEOUT_WAITING );
return sal_False;
}
if ( isError() ) {
OSL_TRACE("waitForResultOrComplete() : Error returned!");
- setError( STR_ERR_EXECUTING_QUERY );
+ m_aError.setResId( STR_ERR_EXECUTING_QUERY );
return sal_False;
}
- resetError();
+ m_aError.reset();
OSL_TRACE(" Out : waitForResultOrComplete()");
return sal_True;
}
@@ -583,7 +583,7 @@ nsIAbCard * getUpdatedCard( nsIAbCard* card)
#define ENSURE_MOZAB_PROFILE_NOT_LOOKED(directory) \
if (getDirectoryType(directory) == SDBCAddress::Mozilla && isProfileLocked(NULL)) \
{ \
- setError( STR_MOZILLA_IS_RUNNIG_NO_CHANGES ); \
+ m_aError.setResId( STR_MOZILLA_IS_RUNNIG_NO_CHANGES ); \
return sal_False; \
}
@@ -620,7 +620,7 @@ sal_Int32 MQueryHelper::commitCard(const sal_Int32 rowIndex,nsIAbDirectory * dir
}
//We return NS_ERROR_FILE_ACCESS_DENIED in the case the mozillaAB has been changed out side of our process
if (rv == NS_ERROR_FILE_ACCESS_DENIED )
- setError( STR_FOREIGN_PROCESS_CHANGED_AB );
+ m_aError.setResId( STR_FOREIGN_PROCESS_CHANGED_AB );
return !(NS_FAILED(rv));
}
@@ -668,7 +668,7 @@ sal_Int32 MQueryHelper::deleteCard(const sal_Int32 rowIndex,nsIAbDirectory * dir
resEntry->setRowStates(RowStates_Deleted);
//We return NS_ERROR_FILE_ACCESS_DENIED in the case the mozillaAB has been changed out side of our process
if (rv == NS_ERROR_FILE_ACCESS_DENIED )
- setError( STR_FOREIGN_PROCESS_CHANGED_AB );
+ m_aError.setResId( STR_FOREIGN_PROCESS_CHANGED_AB );
return !(NS_FAILED(rv));
}
@@ -677,13 +677,13 @@ sal_Bool MQueryHelper::setCardValues(const sal_Int32 rowIndex)
MQueryHelperResultEntry *resEntry = getByIndex(rowIndex);
if (!resEntry)
{
- setError( STR_CANT_FIND_ROW );
+ m_aError.setResId( STR_CANT_FIND_ROW );
return sal_False;
}
nsIAbCard *card=resEntry->getCard();
if (!card)
{
- setError( STR_CANT_FIND_CARD_FOR_ROW );
+ m_aError.setResId( STR_CANT_FIND_CARD_FOR_ROW );
return sal_False;
}
@@ -967,7 +967,7 @@ sal_Bool MQueryHelper::resyncRow(sal_Int32 rowIndex)
MQueryHelperResultEntry *resEntry = getByIndex(rowIndex);
if (!resEntry)
{
- setError( STR_CANT_FIND_ROW );
+ m_aError.setResId( STR_CANT_FIND_ROW );
return sal_False;
}
nsIAbCard *card=resEntry->getCard();
diff --git a/connectivity/source/drivers/mozab/mozillasrc/MQueryHelper.hxx b/connectivity/source/drivers/mozab/mozillasrc/MQueryHelper.hxx
index a077b26f0bab..2f3f4db2d7c5 100644
--- a/connectivity/source/drivers/mozab/mozillasrc/MQueryHelper.hxx
+++ b/connectivity/source/drivers/mozab/mozillasrc/MQueryHelper.hxx
@@ -68,7 +68,7 @@ namespace connectivity
sal_Int32 getRowStates() { return m_RowStates;};
};
- class MQueryHelper : public nsIAbDirectoryQueryResultListener, public ErrorResourceAccess
+ class MQueryHelper : public nsIAbDirectoryQueryResultListener
{
private:
typedef std::vector< MQueryHelperResultEntry* > resultsArray;
@@ -81,6 +81,7 @@ namespace connectivity
sal_Bool m_bAtEnd;
sal_Bool m_bErrorCondition;
sal_Bool m_bQueryComplete;
+ ErrorDescriptor m_aError;
void append(MQueryHelperResultEntry* resEnt );
@@ -113,6 +114,8 @@ namespace connectivity
MQueryHelperResultEntry* getByIndex( sal_uInt32 nRow );
+ const ErrorDescriptor& getError() const { return m_aError; }
+
sal_Bool isError() const;
sal_Bool hasMore() const;
diff --git a/connectivity/source/drivers/mysql/YDriver.cxx b/connectivity/source/drivers/mysql/YDriver.cxx
index dcee418b88e5..ea5afad3719e 100644
--- a/connectivity/source/drivers/mysql/YDriver.cxx
+++ b/connectivity/source/drivers/mysql/YDriver.cxx
@@ -193,7 +193,7 @@ namespace connectivity
else
{
aProps.push_back( PropertyValue(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("NewURL"))
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PublicConnectionURL"))
,0
,makeAny(_sUrl)
,PropertyState_DIRECT_VALUE) );
diff --git a/connectivity/source/inc/dbase/DTable.hxx b/connectivity/source/inc/dbase/DTable.hxx
index 80aa1a10fdf5..b9965b6c85a7 100644
--- a/connectivity/source/inc/dbase/DTable.hxx
+++ b/connectivity/source/inc/dbase/DTable.hxx
@@ -55,6 +55,7 @@ namespace connectivity
dBaseIV = 0x04,
dBaseV = 0x05,
VisualFoxPro = 0x30,
+ VisualFoxProAuto = 0x31, // Visual FoxPro w. AutoIncrement field
dBaseFS = 0x43,
dBaseFSMemo = 0xB3,
dBaseIIIMemo = 0x83,
@@ -95,6 +96,7 @@ namespace connectivity
::std::vector<sal_Int32> m_aTypes; // holds all type for columns just to avoid to ask the propertyset
::std::vector<sal_Int32> m_aPrecisions; // same as aboth
::std::vector<sal_Int32> m_aScales;
+ ::std::vector<sal_Int32> m_aRealFieldLengths;
DBFHeader m_aHeader;
DBFMemoHeader m_aMemoHeader;
SvStream* m_pMemoStream;
diff --git a/connectivity/source/inc/internalnode.hxx b/connectivity/source/inc/internalnode.hxx
index bb2f32c24d69..d313525a6a03 100644
--- a/connectivity/source/inc/internalnode.hxx
+++ b/connectivity/source/inc/internalnode.hxx
@@ -40,7 +40,7 @@ namespace connectivity
//==========================================================================
/** special node for avoiding memory leaks
*/
- class OOO_DLLPUBLIC_DBTOOLS OSQLInternalNode : public OSQLParseNode
+ class OSQLInternalNode : public OSQLParseNode
{
public:
OSQLInternalNode(const sal_Char* pNewValue,
diff --git a/connectivity/source/inc/resource/mozab_res.hrc b/connectivity/source/inc/resource/mozab_res.hrc
index 5ad8fc86e95c..c866291d1492 100644
--- a/connectivity/source/inc/resource/mozab_res.hrc
+++ b/connectivity/source/inc/resource/mozab_res.hrc
@@ -39,11 +39,11 @@
// = the mozab driver's resource strings
// ============================================================================
-#define STR_NO_MOZIILA_ADDRESSBOOK ( STR_MOZAB_BASE + 0 )
-#define STR_NO_THUNDERBIRD_ADDRESSBOOK ( STR_MOZAB_BASE + 1 )
-#define STR_NO_OUTLOOKEXPRESS_ADDRESSBOOK ( STR_MOZAB_BASE + 2 )
-#define STR_NO_OUTLOOK_ADDRESSBOOK ( STR_MOZAB_BASE + 3 )
-#define STR_COULDNOTCONNECT_TO_LDAP ( STR_MOZAB_BASE + 4 )
+#define STR_MOZILLA_ADDRESSBOOKS ( STR_MOZAB_BASE + 0 )
+#define STR_THUNDERBIRD_ADDRESSBOOKS ( STR_MOZAB_BASE + 1 )
+#define STR_OE_ADDRESSBOOK ( STR_MOZAB_BASE + 2 )
+#define STR_OUTLOOK_MAPI_ADDRESSBOOK ( STR_MOZAB_BASE + 3 )
+ // FREE
#define STR_NO_TABLE_CREATION_SUPPORT ( STR_MOZAB_BASE + 5 )
#define STR_MOZILLA_IS_RUNNING ( STR_MOZAB_BASE + 6 )
#define STR_COULD_NOT_RETRIEVE_AB_ENTRY ( STR_MOZAB_BASE + 7 )
@@ -70,6 +70,8 @@
#define STR_NO_COUNT_SUPPORT ( STR_MOZAB_BASE + 28 )
#define STR_STMT_TYPE_NOT_SUPPORTED ( STR_MOZAB_BASE + 29 )
#define STR_COULD_NOT_LOAD_LIB ( STR_MOZAB_BASE + 30 )
+#define STR_UNSPECIFIED_ERROR ( STR_MOZAB_BASE + 31 )
+#define STR_COULD_NOT_CREATE_ADDRESSBOOK ( STR_MOZAB_BASE + 32 )
#endif // CONNECTIVITY_RESOURCE_MOZAB_HRC
diff --git a/connectivity/source/parse/internalnode.cxx b/connectivity/source/parse/internalnode.cxx
index 9b83e708e452..752211c423d2 100644
--- a/connectivity/source/parse/internalnode.cxx
+++ b/connectivity/source/parse/internalnode.cxx
@@ -44,7 +44,7 @@ OSQLInternalNode::OSQLInternalNode(const sal_Char* pNewValue,
: OSQLParseNode(pNewValue,eNodeType,nNodeID)
{
OSL_ENSURE(OSQLParser::s_pGarbageCollector, "Collector not initialized");
- OSQLParser::s_pGarbageCollector->push_back(this);
+ (*OSQLParser::s_pGarbageCollector)->push_back(this);
}
//-----------------------------------------------------------------------------
@@ -54,7 +54,7 @@ OSQLInternalNode::OSQLInternalNode(const ::rtl::OString &_NewValue,
:OSQLParseNode(_NewValue,eNodeType,nNodeID)
{
OSL_ENSURE(OSQLParser::s_pGarbageCollector, "Collector not initialized");
- OSQLParser::s_pGarbageCollector->push_back(this);
+ (*OSQLParser::s_pGarbageCollector)->push_back(this);
}
//-----------------------------------------------------------------------------
@@ -64,7 +64,7 @@ OSQLInternalNode::OSQLInternalNode(const sal_Unicode* pNewValue,
:OSQLParseNode(pNewValue,eNodeType,nNodeID)
{
OSL_ENSURE(OSQLParser::s_pGarbageCollector, "Collector not initialized");
- OSQLParser::s_pGarbageCollector->push_back(this);
+ (*OSQLParser::s_pGarbageCollector)->push_back(this);
}
//-----------------------------------------------------------------------------
@@ -74,7 +74,7 @@ OSQLInternalNode::OSQLInternalNode(const ::rtl::OUString &_NewValue,
:OSQLParseNode(_NewValue,eNodeType,nNodeID)
{
OSL_ENSURE(OSQLParser::s_pGarbageCollector, "Collector not initialized");
- OSQLParser::s_pGarbageCollector->push_back(this);
+ (*OSQLParser::s_pGarbageCollector)->push_back(this);
}
@@ -82,11 +82,7 @@ OSQLInternalNode::OSQLInternalNode(const ::rtl::OUString &_NewValue,
OSQLInternalNode::~OSQLInternalNode()
{
// remove the node from the garbage list
+
OSL_ENSURE(OSQLParser::s_pGarbageCollector, "Collector not initialized");
- if (!OSQLParser::s_pGarbageCollector->empty())
- {
- OSQLParser::s_pGarbageCollector->erase(
- ::std::find(OSQLParser::s_pGarbageCollector->begin(), OSQLParser::s_pGarbageCollector->end(),
- this));
- }
+ (*OSQLParser::s_pGarbageCollector)->erase(this);
}
diff --git a/connectivity/source/parse/sqlbison.y b/connectivity/source/parse/sqlbison.y
index 6f625bd2312c..a42c3cb2302c 100644
--- a/connectivity/source/parse/sqlbison.y
+++ b/connectivity/source/parse/sqlbison.y
@@ -90,6 +90,7 @@
#ifndef _DBHELPER_DBCONVERSION_HXX_
#include "connectivity/dbconversion.hxx"
#endif
+#include <rtl/ustrbuf.hxx>
#if defined __GNUC__
#pragma GCC system_header
@@ -3362,34 +3363,44 @@ const double fMilliSecondsPerDay = 86400000.0;
//------------------------------------------------------------------
::rtl::OUString ConvertLikeToken(const OSQLParseNode* pTokenNode, const OSQLParseNode* pEscapeNode, sal_Bool bInternational)
{
- ::rtl::OUString aMatchStr;
+ ::rtl::OUStringBuffer aMatchStr;
if (pTokenNode->isToken())
{
- sal_Char cEscape = 0;
+ sal_Unicode cEscape = 0;
if (pEscapeNode->count())
- cEscape = static_cast<sal_Char>(pEscapeNode->getChild(1)->getTokenValue().toChar());
+ cEscape = pEscapeNode->getChild(1)->getTokenValue().toChar();
// Platzhalter austauschen
aMatchStr = pTokenNode->getTokenValue();
- sal_Int32 nLen = aMatchStr.getLength();
- const sal_Char* sSearch = bInternational ? "%_" : "*?";
- const sal_Char* sReplace = bInternational ? "*?" : "%_";
+ const sal_Int32 nLen = aMatchStr.getLength();
+ ::rtl::OUStringBuffer sSearch,sReplace;
+ if ( bInternational )
+ {
+ sSearch.appendAscii("%_",2);
+ sReplace.appendAscii("*?",2);
+ }
+ else
+ {
+ sSearch.appendAscii("*?",2);
+ sReplace.appendAscii("%_",2);
+ }
+
for (sal_Int32 i = 0; i < nLen; i++)
{
- sal_Char c = static_cast<sal_Char>(aMatchStr.getStr()[i]);
- if (c == sSearch[0] || c == sSearch[1])
+ const sal_Unicode c = aMatchStr.charAt(i);
+ if (c == sSearch.charAt(0) || c == sSearch.charAt(1))
{
- if (i > 0 && aMatchStr.getStr()[i-1] == cEscape)
+ if (i > 0 && aMatchStr.charAt(i-1) == cEscape)
continue;
else
{
- sal_Unicode cCharacter = sReplace[(c == sSearch[0]) ? 0 : 1];
- aMatchStr = aMatchStr.replaceAt(i , 1, ::rtl::OUString(&cCharacter, 1));
+ const sal_Unicode cCharacter = sReplace.charAt( (c == sSearch.charAt(0)) ? 0 : 1);
+ aMatchStr.setCharAt(i , cCharacter);
}
}
}
}
- return aMatchStr;
+ return aMatchStr.makeStringAndClear();
}
//==========================================================================
@@ -3403,7 +3414,7 @@ OParseContext OSQLParser::s_aDefaultContext;
sal_Int32 OSQLParser::s_nRefCount = 0;
// ::osl::Mutex OSQLParser::s_aMutex;
OSQLScanner* OSQLParser::s_pScanner = 0;
-OSQLParseNodes* OSQLParser::s_pGarbageCollector = 0;
+OSQLParseNodesGarbageCollector* OSQLParser::s_pGarbageCollector = 0;
::com::sun::star::uno::Reference< ::com::sun::star::i18n::XLocaleData> OSQLParser::s_xLocaleData = NULL;
//-----------------------------------------------------------------------------
void setParser(OSQLParser* _pParser)
@@ -3449,18 +3460,12 @@ OSQLParseNode* OSQLParser::parseTree(::rtl::OUString& rErrorMessage,
rErrorMessage = m_sErrorMessage;
// clear the garbage collector
- while (!s_pGarbageCollector->empty())
- {
- OSQLParseNode* pNode = *s_pGarbageCollector->begin();
- while (pNode->getParent())
- pNode = pNode->getParent();
- delete pNode;
- }
+ (*s_pGarbageCollector)->clearAndDelete();
return NULL;
}
else
{
- s_pGarbageCollector->clear();
+ (*s_pGarbageCollector)->clear();
// Das Ergebnis liefern (den Root Parse Node):
diff --git a/connectivity/source/parse/sqlflex.l b/connectivity/source/parse/sqlflex.l
index 8004276e5961..19d2b8a27d8e 100644
--- a/connectivity/source/parse/sqlflex.l
+++ b/connectivity/source/parse/sqlflex.l
@@ -41,9 +41,7 @@
#include <string.h>
#endif
-#ifndef _CONNECTIVITY_SQLINTERNALNODE_HXX
#include "internalnode.hxx"
-#endif
#ifndef _CONNECTIVITY_SQLYACC_HXX
#define _CONNECTIVITY_SQLYACC_HXX
@@ -54,15 +52,10 @@
#include "sqlbison.hxx"
#endif
-#ifndef _CONNECTIVITY_SQLSCAN_HXX
#include "sqlscan.hxx"
-#endif
-#ifndef _OSL_DIAGNOSE_H_
#include <osl/diagnose.h>
-#endif
-#ifndef _CONNECTIVITY_SQLPARSE_HXX
+#include <rtl/strbuf.hxx>
#include <connectivity/sqlparse.hxx>
-#endif
#if defined __GNUC__
#pragma GCC system_header
@@ -460,14 +453,8 @@ inline bool checkeof(int c) { return c == 0 || c == EOF; }
*/
sal_Int32 gatherString( sal_Int32 delim, sal_Int32 nTyp)
{
- sal_Int32 ch;
- static sal_Int32 BUFFERSIZE = 256;
- static sal_Char* Buffer = 0;
- if(!Buffer)
- Buffer = new sal_Char[BUFFERSIZE];
-
- sal_Char *s = Buffer;
- sal_Int32 nPos = 0;
+ sal_Char ch;
+ ::rtl::OStringBuffer sBuffer(256);
while (!checkeof(ch = yyinput()))
{
@@ -478,40 +465,22 @@ sal_Int32 gatherString( sal_Int32 delim, sal_Int32 nTyp)
if (!checkeof(ch))
unput(ch);
- *s = '\0';
-
switch(nTyp)
{
case 0:
- SQL_NEW_NODE(::rtl::OUString(Buffer,nPos,RTL_TEXTENCODING_UTF8), SQL_NODE_NAME);
- delete[] Buffer;
- Buffer = NULL;
+ SQL_NEW_NODE(::rtl::OStringToOUString(sBuffer.makeStringAndClear(),RTL_TEXTENCODING_UTF8), SQL_NODE_NAME);
return SQL_TOKEN_NAME;
case 1:
- SQL_NEW_NODE(::rtl::OUString(Buffer,nPos,RTL_TEXTENCODING_UTF8), SQL_NODE_STRING);
- delete[] Buffer;
- Buffer = NULL;
+ SQL_NEW_NODE(::rtl::OStringToOUString(sBuffer.makeStringAndClear(),RTL_TEXTENCODING_UTF8), SQL_NODE_STRING);
return SQL_TOKEN_STRING;
case 2:
- SQL_NEW_NODE(::rtl::OUString(Buffer,nPos,RTL_TEXTENCODING_UTF8), SQL_NODE_ACCESS_DATE);
- delete[] Buffer;
- Buffer = NULL;
+ SQL_NEW_NODE(::rtl::OStringToOUString(sBuffer.makeStringAndClear(),RTL_TEXTENCODING_UTF8), SQL_NODE_ACCESS_DATE);
return SQL_TOKEN_ACCESS_DATE;
}
}
else
{
- *s++ = ch;
- if (++nPos == BUFFERSIZE)
- {
- ::rtl::OString aBuf(Buffer);
- delete[] Buffer;
- BUFFERSIZE *=2;
- Buffer = new sal_Char[BUFFERSIZE];
- for(sal_Int32 i=0;i<aBuf.getLength();++i,++Buffer)
- *Buffer = aBuf.getStr()[i];
- s = &Buffer[nPos];
- }
+ sBuffer.append(ch);
}
}
@@ -519,23 +488,10 @@ sal_Int32 gatherString( sal_Int32 delim, sal_Int32 nTyp)
break;
else
{
- *s++ = ch;
- if (++nPos == BUFFERSIZE)
- {
- ::rtl::OString aBuf(Buffer);
- delete[] Buffer;
- BUFFERSIZE *=2;
- Buffer = new sal_Char[BUFFERSIZE];
- for(sal_Int32 i=0;i<aBuf.getLength();++i,++Buffer)
- *Buffer = aBuf.getStr()[i];
- s = &Buffer[nPos];
- }
+ sBuffer.append(ch);
}
}
- *s = '\0';
YY_FATAL_ERROR("Unterminated name string");
- delete[] Buffer;
- Buffer = NULL;
return SQL_TOKEN_INVALIDSYMBOL;
}
diff --git a/connectivity/source/parse/sqlnode.cxx b/connectivity/source/parse/sqlnode.cxx
index 4f8517d41703..23aba56aec44 100644
--- a/connectivity/source/parse/sqlnode.cxx
+++ b/connectivity/source/parse/sqlnode.cxx
@@ -386,17 +386,17 @@ void OSQLParseNode::impl_parseNodeToString_throw(::rtl::OUString& rString, const
if(rString.getLength())
rString += ::rtl::OUString::createFromAscii(" ");
if (nCount == 1) // ?
- m_aChilds[0]->impl_parseNodeToString_throw( rString, rParam );
+ m_aChildren[0]->impl_parseNodeToString_throw( rString, rParam );
else if (nCount == 2) // :Name
{
- m_aChilds[0]->impl_parseNodeToString_throw( rString, rParam );
- rString += m_aChilds[1]->m_aNodeValue;
+ m_aChildren[0]->impl_parseNodeToString_throw( rString, rParam );
+ rString += m_aChildren[1]->m_aNodeValue;
} // [Name]
else
{
- m_aChilds[0]->impl_parseNodeToString_throw( rString, rParam );
- rString += m_aChilds[1]->m_aNodeValue;
- rString += m_aChilds[2]->m_aNodeValue;
+ m_aChildren[0]->impl_parseNodeToString_throw( rString, rParam );
+ rString += m_aChildren[1]->m_aNodeValue;
+ rString += m_aChildren[2]->m_aNodeValue;
}
bHandled = true;
}
@@ -443,13 +443,13 @@ void OSQLParseNode::impl_parseNodeToString_throw(::rtl::OUString& rString, const
SQLParseNodeParameter aNewParam(rParam);
aNewParam.bQuote = ( SQL_ISRULE(this,length_exp) || SQL_ISRULE(this,char_value_fct) );
- m_aChilds[0]->impl_parseNodeToString_throw( rString, aNewParam );
+ m_aChildren[0]->impl_parseNodeToString_throw( rString, aNewParam );
aNewParam.bQuote = rParam.bQuote;
//aNewParam.bPredicate = sal_False; // disable [ ] around names // look at i73215
::rtl::OUString aStringPara;
for (sal_uInt32 i=1; i<nCount; i++)
{
- const OSQLParseNode * pSubTree = m_aChilds[i];
+ const OSQLParseNode * pSubTree = m_aChildren[i];
if (pSubTree)
{
pSubTree->impl_parseNodeToString_throw( aStringPara, aNewParam );
@@ -473,8 +473,8 @@ void OSQLParseNode::impl_parseNodeToString_throw(::rtl::OUString& rString, const
if ( !bHandled )
{
- for (OSQLParseNodes::const_iterator i = m_aChilds.begin();
- i != m_aChilds.end();)
+ for (OSQLParseNodes::const_iterator i = m_aChildren.begin();
+ i != m_aChildren.end();)
{
const OSQLParseNode* pSubTree = *i;
if ( !pSubTree )
@@ -508,7 +508,7 @@ void OSQLParseNode::impl_parseNodeToString_throw(::rtl::OUString& rString, const
if(pSubTree->count())
{
- const OSQLParseNode* pCol = pSubTree->m_aChilds[pSubTree->count()-1];
+ const OSQLParseNode* pCol = pSubTree->m_aChildren[pSubTree->count()-1];
if ( ( SQL_ISRULE(pCol,column_val)
&& pCol->getChild(0)->getTokenValue().equalsIgnoreAsciiCase(aFieldName)
)
@@ -524,7 +524,7 @@ void OSQLParseNode::impl_parseNodeToString_throw(::rtl::OUString& rString, const
if (SQL_ISRULE(this, comparison_predicate))
{
++i;
- if(i != m_aChilds.end())
+ if(i != m_aChildren.end())
{
pSubTree = *i;
if (pSubTree && pSubTree->getNodeType() == SQL_NODE_EQUAL)
@@ -540,7 +540,7 @@ void OSQLParseNode::impl_parseNodeToString_throw(::rtl::OUString& rString, const
i++;
// bei den CommaListen zwischen alle Subtrees Commas setzen
- if ((m_eNodeType == SQL_NODE_COMMALISTRULE) && (i != m_aChilds.end()))
+ if ((m_eNodeType == SQL_NODE_COMMALISTRULE) && (i != m_aChildren.end()))
rString += ::rtl::OUString::createFromAscii(",");
}
}
@@ -550,7 +550,7 @@ void OSQLParseNode::impl_parseNodeToString_throw(::rtl::OUString& rString, const
i++;
// bei den CommaListen zwischen alle Subtrees Commas setzen
- if ((m_eNodeType == SQL_NODE_COMMALISTRULE) && (i != m_aChilds.end()))
+ if ((m_eNodeType == SQL_NODE_COMMALISTRULE) && (i != m_aChildren.end()))
{
if (SQL_ISRULE(this,value_exp_commalist) && rParam.bPredicate)
rString += ::rtl::OUString::createFromAscii(";");
@@ -668,7 +668,7 @@ void OSQLParseNode::impl_parseTableRangeNodeToString_throw(::rtl::OUString& rStr
OSL_PRECOND( ( count() == 2 ) || ( count() == 3 ) || ( count() == 5 ) ,"Illegal count");
// rString += ::rtl::OUString::createFromAscii(" ");
- ::std::for_each(m_aChilds.begin(),m_aChilds.end(),
+ ::std::for_each(m_aChildren.begin(),m_aChildren.end(),
boost::bind( &OSQLParseNode::impl_parseNodeToString_throw, _1, boost::ref( rString ), boost::cref( rParam ) ));
}
@@ -701,9 +701,9 @@ void OSQLParseNode::impl_parseLikeNodeToString_throw( ::rtl::OUString& rString,
{
OSL_ENSURE( false, "OSQLParseNode::impl_parseLikeNodeToString_throw Exception occured!" );
}
- if ( !m_aChilds[0]->isLeaf() )
+ if ( !m_aChildren[0]->isLeaf() )
{
- const OSQLParseNode* pCol = m_aChilds[0]->getChild(m_aChilds[0]->count()-1);
+ const OSQLParseNode* pCol = m_aChildren[0]->getChild(m_aChildren[0]->count()-1);
if ((SQL_ISRULE(pCol,column_val) && pCol->getChild(0)->getTokenValue().equalsIgnoreAsciiCase(aFieldName)) ||
pCol->getTokenValue().equalsIgnoreAsciiCase(aFieldName) )
bAddName = sal_False;
@@ -711,15 +711,15 @@ void OSQLParseNode::impl_parseLikeNodeToString_throw( ::rtl::OUString& rString,
}
if (bAddName)
- m_aChilds[0]->impl_parseNodeToString_throw( rString, aNewParam );
+ m_aChildren[0]->impl_parseNodeToString_throw( rString, aNewParam );
- m_aChilds[1]->impl_parseNodeToString_throw( rString, aNewParam );
+ m_aChildren[1]->impl_parseNodeToString_throw( rString, aNewParam );
if(count() == 5)
- m_aChilds[2]->impl_parseNodeToString_throw( rString, aNewParam );
+ m_aChildren[2]->impl_parseNodeToString_throw( rString, aNewParam );
- sal_Int32 nCurentPos = m_aChilds.size()-2;
- pParaNode = m_aChilds[nCurentPos];
- pEscNode = m_aChilds[nCurentPos+1];
+ sal_Int32 nCurentPos = m_aChildren.size()-2;
+ pParaNode = m_aChildren[nCurentPos];
+ pEscNode = m_aChildren[nCurentPos+1];
if (pParaNode->isToken())
{
@@ -1255,18 +1255,12 @@ OSQLParseNode* OSQLParser::predicateTree(::rtl::OUString& rErrorMessage, const :
rErrorMessage = m_sErrorMessage;
// clear the garbage collector
- while (!s_pGarbageCollector->empty())
- {
- OSQLParseNode* pNode = *s_pGarbageCollector->begin();
- while (pNode->getParent())
- pNode = pNode->getParent();
- delete pNode;
- }
+ (*s_pGarbageCollector)->clearAndDelete();
return NULL;
}
else
{
- s_pGarbageCollector->clear();
+ (*s_pGarbageCollector)->clear();
m_sFieldName= ::rtl::OUString();
m_xField = NULL;
@@ -1309,7 +1303,7 @@ OSQLParser::OSQLParser(const ::com::sun::star::uno::Reference< ::com::sun::star:
{
s_pScanner = new OSQLScanner();
s_pScanner->setScanner();
- s_pGarbageCollector = new OSQLParseNodes();
+ s_pGarbageCollector = new OSQLParseNodesGarbageCollector();
if(!s_xLocaleData.is())
s_xLocaleData = Reference<XLocaleData>(m_xServiceFactory->createInstance(::rtl::OUString::createFromAscii("com.sun.star.i18n.LocaleData")),UNO_QUERY);
@@ -1620,8 +1614,8 @@ OSQLParseNode::OSQLParseNode(const OSQLParseNode& rParseNode)
// Zeigers wieder eingehangen.
// wenn kein Blatt, dann SubTrees bearbeiten
- for (OSQLParseNodes::const_iterator i = rParseNode.m_aChilds.begin();
- i != rParseNode.m_aChilds.end(); i++)
+ for (OSQLParseNodes::const_iterator i = rParseNode.m_aChildren.begin();
+ i != rParseNode.m_aChildren.end(); i++)
append(new OSQLParseNode(**i));
}
// -----------------------------------------------------------------------------
@@ -1635,14 +1629,14 @@ OSQLParseNode& OSQLParseNode::operator=(const OSQLParseNode& rParseNode)
m_eNodeType = rParseNode.m_eNodeType;
m_nNodeID = rParseNode.m_nNodeID;
- for (OSQLParseNodes::const_iterator i = m_aChilds.begin();
- i != m_aChilds.end(); i++)
+ for (OSQLParseNodes::const_iterator i = m_aChildren.begin();
+ i != m_aChildren.end(); i++)
delete *i;
- m_aChilds.clear();
+ m_aChildren.clear();
- for (OSQLParseNodes::const_iterator j = rParseNode.m_aChilds.begin();
- j != rParseNode.m_aChilds.end(); j++)
+ for (OSQLParseNodes::const_iterator j = rParseNode.m_aChildren.begin();
+ j != rParseNode.m_aChildren.end(); j++)
append(new OSQLParseNode(**j));
}
return *this;
@@ -1670,10 +1664,10 @@ sal_Bool OSQLParseNode::operator==(OSQLParseNode& rParseNode) const
//-----------------------------------------------------------------------------
OSQLParseNode::~OSQLParseNode()
{
- for (OSQLParseNodes::const_iterator i = m_aChilds.begin();
- i != m_aChilds.end(); i++)
+ for (OSQLParseNodes::const_iterator i = m_aChildren.begin();
+ i != m_aChildren.end(); i++)
delete *i;
- m_aChilds.clear();
+ m_aChildren.clear();
}
//-----------------------------------------------------------------------------
@@ -1683,23 +1677,23 @@ void OSQLParseNode::append(OSQLParseNode* pNewNode)
OSL_ENSURE(pNewNode != NULL, "OSQLParseNode: ungueltiger NewSubTree");
OSL_ENSURE(pNewNode->getParent() == NULL, "OSQLParseNode: Knoten ist kein Waise");
- OSL_ENSURE(::std::find(m_aChilds.begin(), m_aChilds.end(), pNewNode) == m_aChilds.end(),
+ OSL_ENSURE(::std::find(m_aChildren.begin(), m_aChildren.end(), pNewNode) == m_aChildren.end(),
"OSQLParseNode::append() Node already element of parent");
// stelle Verbindung zum getParent her:
pNewNode->setParent( this );
// und haenge den SubTree hinten an
- m_aChilds.push_back(pNewNode);
+ m_aChildren.push_back(pNewNode);
}
// -----------------------------------------------------------------------------
sal_Bool OSQLParseNode::addDateValue(::rtl::OUString& rString, const SQLParseNodeParameter& rParam) const
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseNode::addDateValue" );
// special display for date/time values
- if (SQL_ISRULE(this,set_fct_spec) && SQL_ISPUNCTUATION(m_aChilds[0],"{"))
+ if (SQL_ISRULE(this,set_fct_spec) && SQL_ISPUNCTUATION(m_aChildren[0],"{"))
{
- const OSQLParseNode* pODBCNode = m_aChilds[1];
- const OSQLParseNode* pODBCNodeChild = pODBCNode->m_aChilds[0];
+ const OSQLParseNode* pODBCNode = m_aChildren[1];
+ const OSQLParseNode* pODBCNodeChild = pODBCNode->m_aChildren[0];
if (pODBCNodeChild->getNodeType() == SQL_NODE_KEYWORD && (
SQL_ISTOKEN(pODBCNodeChild, D) ||
@@ -1734,7 +1728,7 @@ sal_Bool OSQLParseNode::addDateValue(::rtl::OUString& rString, const SQLParseNod
if (rString.getLength())
rString += ::rtl::OUString::createFromAscii(" ");
rString += suQuote;
- const ::rtl::OUString sTokenValue = pODBCNode->m_aChilds[1]->getTokenValue();
+ const ::rtl::OUString sTokenValue = pODBCNode->m_aChildren[1]->getTokenValue();
if (SQL_ISTOKEN(pODBCNodeChild, D))
{
rString += rParam.bPredicate ? convertDateString(rParam, sTokenValue) : sTokenValue;
@@ -1779,8 +1773,8 @@ OSQLParseNode* OSQLParseNode::getByRule(OSQLParseNode::Rule eRule) const
pRetNode = (OSQLParseNode*)this;
else
{
- for (OSQLParseNodes::const_iterator i = m_aChilds.begin();
- !pRetNode && i != m_aChilds.end(); i++)
+ for (OSQLParseNodes::const_iterator i = m_aChildren.begin();
+ !pRetNode && i != m_aChildren.end(); i++)
pRetNode = (*i)->getByRule(eRule);
}
return pRetNode;
@@ -1938,7 +1932,7 @@ void OSQLParseNode::negateSearchCondition(OSQLParseNode*& pSearchCondition,sal_B
OSQLParseNode *pNot = pSearchCondition->removeAt((sal_uInt32)0);
delete pNot;
OSQLParseNode *pBooleanTest = pSearchCondition->removeAt((sal_uInt32)0);
- pBooleanTest->setParent(NULL);
+ // TODO is this needed // pBooleanTest->setParent(NULL);
replaceAndReset(pSearchCondition,pBooleanTest);
if (!bNegate)
@@ -2007,7 +2001,7 @@ void OSQLParseNode::negateSearchCondition(OSQLParseNode*& pSearchCondition,sal_B
else if(bNegate && (SQL_ISRULE(pSearchCondition,like_predicate)))
{
OSQLParseNode* pCheckForNOT = pSearchCondition->getChild( 1 );
- if ( pCheckForNOT->getNodeType() == SQL_TOKEN_NOT )
+ if ( SQL_ISTOKEN(pCheckForNOT,NOT) )
delete pSearchCondition->removeAt( 1 );
else
{
@@ -2256,8 +2250,8 @@ void OSQLParseNode::showParseTree(::rtl::OUString& rString, sal_uInt32 nLevel)
rString+= ::rtl::OUString::createFromAscii("\n");
// hol dir den ersten Subtree
- for (OSQLParseNodes::const_iterator i = m_aChilds.begin();
- i != m_aChilds.end(); i++)
+ for (OSQLParseNodes::const_iterator i = m_aChildren.begin();
+ i != m_aChildren.end(); i++)
(*i)->showParseTree(rString, nLevel+1);
}
else
@@ -2336,7 +2330,7 @@ void OSQLParseNode::insert(sal_uInt32 nPos, OSQLParseNode* pNewSubTree)
// stelle Verbindung zum getParent her:
pNewSubTree->setParent( this );
- m_aChilds.insert(m_aChilds.begin() + nPos, pNewSubTree);
+ m_aChildren.insert(m_aChildren.begin() + nPos, pNewSubTree);
}
// removeAt-Methoden
@@ -2344,14 +2338,14 @@ void OSQLParseNode::insert(sal_uInt32 nPos, OSQLParseNode* pNewSubTree)
OSQLParseNode* OSQLParseNode::removeAt(sal_uInt32 nPos)
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseNode::removeAt" );
- OSL_ENSURE(nPos < m_aChilds.size(),"Illegal position for removeAt");
- OSQLParseNodes::iterator aPos(m_aChilds.begin() + nPos);
+ OSL_ENSURE(nPos < m_aChildren.size(),"Illegal position for removeAt");
+ OSQLParseNodes::iterator aPos(m_aChildren.begin() + nPos);
OSQLParseNode* pNode = *aPos;
// setze den getParent des removeten auf NULL
pNode->setParent( NULL );
- m_aChilds.erase(aPos);
+ m_aChildren.erase(aPos);
return pNode;
}
//-----------------------------------------------------------------------------
@@ -2359,12 +2353,12 @@ OSQLParseNode* OSQLParseNode::remove(OSQLParseNode* pSubTree)
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseNode::remove" );
OSL_ENSURE(pSubTree != NULL, "OSQLParseNode: ungueltiger SubTree");
- OSQLParseNodes::iterator aPos = ::std::find(m_aChilds.begin(), m_aChilds.end(), pSubTree);
- if (aPos != m_aChilds.end())
+ OSQLParseNodes::iterator aPos = ::std::find(m_aChildren.begin(), m_aChildren.end(), pSubTree);
+ if (aPos != m_aChildren.end())
{
// setze den getParent des removeten auf NULL
pSubTree->setParent( NULL );
- m_aChilds.erase(aPos);
+ m_aChildren.erase(aPos);
return pSubTree;
}
else
@@ -2378,17 +2372,17 @@ OSQLParseNode* OSQLParseNode::replaceAt(sal_uInt32 nPos, OSQLParseNode* pNewSubN
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseNode::replaceAt" );
OSL_ENSURE(pNewSubNode != NULL, "OSQLParseNode: invalid nodes");
OSL_ENSURE(pNewSubNode->getParent() == NULL, "OSQLParseNode: node already has getParent");
- OSL_ENSURE(nPos < m_aChilds.size(), "OSQLParseNode: invalid position");
- OSL_ENSURE(::std::find(m_aChilds.begin(), m_aChilds.end(), pNewSubNode) == m_aChilds.end(),
+ OSL_ENSURE(nPos < m_aChildren.size(), "OSQLParseNode: invalid position");
+ OSL_ENSURE(::std::find(m_aChildren.begin(), m_aChildren.end(), pNewSubNode) == m_aChildren.end(),
"OSQLParseNode::Replace() Node already element of parent");
- OSQLParseNode* pOldSubNode = m_aChilds[nPos];
+ OSQLParseNode* pOldSubNode = m_aChildren[nPos];
// stelle Verbindung zum getParent her:
pNewSubNode->setParent( this );
pOldSubNode->setParent( NULL );
- m_aChilds[nPos] = pNewSubNode;
+ m_aChildren[nPos] = pNewSubNode;
return pOldSubNode;
}
@@ -2398,14 +2392,14 @@ OSQLParseNode* OSQLParseNode::replace (OSQLParseNode* pOldSubNode, OSQLParseNode
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseNode::replace " );
OSL_ENSURE(pOldSubNode != NULL && pNewSubNode != NULL, "OSQLParseNode: invalid nodes");
OSL_ENSURE(pNewSubNode->getParent() == NULL, "OSQLParseNode: node already has getParent");
- OSL_ENSURE(::std::find(m_aChilds.begin(), m_aChilds.end(), pOldSubNode) != m_aChilds.end(),
+ OSL_ENSURE(::std::find(m_aChildren.begin(), m_aChildren.end(), pOldSubNode) != m_aChildren.end(),
"OSQLParseNode::Replace() Node not element of parent");
- OSL_ENSURE(::std::find(m_aChilds.begin(), m_aChilds.end(), pNewSubNode) == m_aChilds.end(),
+ OSL_ENSURE(::std::find(m_aChildren.begin(), m_aChildren.end(), pNewSubNode) == m_aChildren.end(),
"OSQLParseNode::Replace() Node already element of parent");
pOldSubNode->setParent( NULL );
pNewSubNode->setParent( this );
- ::std::replace(m_aChilds.begin(), m_aChilds.end(), pOldSubNode, pNewSubNode);
+ ::std::replace(m_aChildren.begin(), m_aChildren.end(), pOldSubNode, pNewSubNode);
return pOldSubNode;
}
// -----------------------------------------------------------------------------
@@ -2620,5 +2614,55 @@ OSQLParseNode::Rule OSQLParseNode::getKnownRuleID() const
return sTableRange;
}
-
+// -----------------------------------------------------------------------------
+OSQLParseNodesContainer::OSQLParseNodesContainer()
+{
+}
+// -----------------------------------------------------------------------------
+OSQLParseNodesContainer::~OSQLParseNodesContainer()
+{
+}
+// -----------------------------------------------------------------------------
+void OSQLParseNodesContainer::push_back(OSQLParseNode* _pNode)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ m_aNodes.push_back(_pNode);
+}
+// -----------------------------------------------------------------------------
+void OSQLParseNodesContainer::erase(OSQLParseNode* _pNode)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ if ( !m_aNodes.empty() )
+ {
+ ::std::vector< OSQLParseNode* >::iterator aFind = ::std::find(m_aNodes.begin(), m_aNodes.end(),_pNode);
+ if ( aFind != m_aNodes.end() )
+ m_aNodes.erase(aFind);
+ }
+}
+// -----------------------------------------------------------------------------
+bool OSQLParseNodesContainer::empty() const
+{
+ return m_aNodes.empty();
+}
+// -----------------------------------------------------------------------------
+void OSQLParseNodesContainer::clear()
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ m_aNodes.clear();
+}
+// -----------------------------------------------------------------------------
+void OSQLParseNodesContainer::clearAndDelete()
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ // clear the garbage collector
+ while ( !m_aNodes.empty() )
+ {
+ OSQLParseNode* pNode = m_aNodes[0];
+ while ( pNode->getParent() )
+ {
+ pNode = pNode->getParent();
+ }
+ delete pNode;
+ }
+}
} // namespace connectivity
diff --git a/connectivity/source/resource/conn_error_message.src b/connectivity/source/resource/conn_error_message.src
index 7833269ee5f2..48d60d424cc5 100644
--- a/connectivity/source/resource/conn_error_message.src
+++ b/connectivity/source/resource/conn_error_message.src
@@ -75,11 +75,15 @@ String 256 + 2*303 + 0
String 256 + 2*304 + 0
{
- Text = "No connection to the database exists.";
- // TODO: localize
+ Text [ en-US ] = "No connection to the database exists.";
};
String 256 + 2*304 + 1
{
Text = "08003";
};
+
+String 256 + 2*500 + 0
+{
+ Text [ en-US ] = "No $1$ exists.";
+};
diff --git a/connectivity/source/resource/conn_shared_res.src b/connectivity/source/resource/conn_shared_res.src
index bc96fab7d51c..a455aae269c2 100644
--- a/connectivity/source/resource/conn_shared_res.src
+++ b/connectivity/source/resource/conn_shared_res.src
@@ -28,7 +28,6 @@
*
************************************************************************/
-// #include "resource/common_res.hrc"
#include "resource/mozab_res.hrc"
#include "resource/macab_res.hrc"
#include "resource/calc_res.hrc"
@@ -44,29 +43,28 @@
// = the mozab driver's resource strings
// ============================================================================
-String STR_NO_MOZIILA_ADDRESSBOOK
+String STR_MOZILLA_ADDRESSBOOKS
{
- Text [ en-US ] = "No Mozilla Addressbook Directories Exist.";
+ Text [ en-US ] = "Mozilla/Seamonkey Addressbook Directory";
+ Text [ x-comment ] = "This must be the term referring to address books in the user's "
+ "Mozilla/Seamonkey profile in the system.";
};
-String STR_NO_THUNDERBIRD_ADDRESSBOOK
+String STR_THUNDERBIRD_ADDRESSBOOKS
{
- Text [ en-US ] = "No Thunderbird Addressbook Directories Exist.";
+ Text [ en-US ] = "Thunderbird Addressbook Directory";
+ Text [ x-comment ] = "This must be the term referring to address books in the user's "
+ "Thunderbird profile in the system.";
};
-String STR_NO_OUTLOOKEXPRESS_ADDRESSBOOK
+String STR_OE_ADDRESSBOOK
{
- Text [ en-US ] = "No Outlook Express Addressbook Exists.";
+ Text [ en-US ] = "Outlook Express Addressbook";
};
-String STR_NO_OUTLOOK_ADDRESSBOOK
+String STR_OUTLOOK_MAPI_ADDRESSBOOK
{
- Text [ en-US ] = "No Outlook (MAPI) Addressbook Exists.";
-};
-
-String STR_COULDNOTCONNECT_TO_LDAP
-{
- Text [ en-US ] = "Unable to connect to LDAP Server.";
+ Text [ en-US ] = "Outlook (MAPI) Addressbook";
};
String STR_NO_TABLE_CREATION_SUPPORT
@@ -119,6 +117,96 @@ String STR_CANT_FIND_CARD_FOR_ROW
Text [ en-US ] = "Can't find the card for the requested row.";
};
+String STR_QUERY_AT_LEAST_ONE_TABLES
+{
+ Text [ en-US ] = "The query can not be executed. It needs at least one table.";
+};
+
+String STR_NO_COUNT_SUPPORT
+{
+ Text [ en-US ] = "The driver does not support the 'COUNT' function.";
+};
+
+String STR_STMT_TYPE_NOT_SUPPORTED
+{
+ Text [ en-US ] = "This statement type not supported by this database driver.";
+};
+
+String STR_UNSPECIFIED_ERROR
+{
+ Text [ en-US ] = "An unknown error occured.";
+};
+
+String STR_COULD_NOT_CREATE_ADDRESSBOOK
+{
+ Text [ en-US ] = "Could not create a new address book. Mozilla error code is $1$.";
+};
+
+String STR_COULD_NOT_LOAD_LIB
+{
+ Text [ en-US ] = "The library '$libname$' could not be loaded.";
+};
+
+String STR_ERROR_REFRESH_ROW
+{
+ Text [ en-US ] = "An error occured while refreshing the current row.";
+};
+
+String STR_ERROR_GET_ROW
+{
+ Text [ en-US ] = "An error occured while getting the current row.";
+};
+
+String STR_CAN_NOT_CANCEL_ROW_UPDATE
+{
+ Text [ en-US ] = "The row update can not be canceled.";
+};
+
+String STR_CAN_NOT_CREATE_ROW
+{
+ Text [ en-US ] = "A new row can not be created.";
+};
+
+String STR_QUERY_INVALID_IS_NULL_COLUMN
+{
+ Text [ en-US ] = "The query can not be executed. The 'IS NULL' can only be used with a column name.";
+};
+
+String STR_ILLEGAL_MOVEMENT
+{
+ Text [ en-US ] = "Illegal cursor movement occured.";
+};
+
+String STR_COMMIT_ROW
+{
+ Text [ en-US ] = "Please commit row '$position$' before update rows or insert new rows.";
+};
+
+String STR_INVALID_ROW_UPDATE
+{
+ Text [ en-US ] = "The update call can not be executed. The row is invalid.";
+};
+
+String STR_ROW_CAN_NOT_SAVE
+{
+ Text [ en-US ] = "The current row can not be saved.";
+};
+
+String STR_NO_HOSTNAME
+{
+ Text [ en-US ] = "No hostname was provided.";
+};
+
+String STR_NO_BASEDN
+{
+ Text [ en-US ] = "No Base DN was provided.";
+};
+
+String STR_COULD_NOT_CONNECT_LDAP
+{
+ Text [ en-US ] = "The connection to the LDAP server could not be established.";
+};
+
// ============================================================================
// = common strings
// ============================================================================
@@ -235,31 +323,6 @@ String STR_COLUMN_NOT_UPDATEABLE
Text [ en-US ] = "The column at position '$position$' could not be updated.";
};
-//
-String STR_NO_HOSTNAME
-{
- Text [ en-US ] = "No hostname was provided.";
-};
-
-String STR_NO_BASEDN
-{
- Text [ en-US ] = "No Base DN was provided.";
-};
-
-String STR_COULD_NOT_CONNECT_LDAP
-{
- Text [ en-US ] = "The connection to the LDAP server could not be established.";
-};
-
-// ============================================================================
-// = the mozab driver's resource strings
-// ============================================================================
-
-String STR_COULD_NOT_LOAD_LIB
-{
- Text [ en-US ] = "The library '$libname$' could not be loaded.";
-};
-
String STR_COULD_NOT_LOAD_FILE
{
Text [ en-US ] = "The file $filename$ could not be loaded.";
@@ -270,63 +333,6 @@ String STR_LOAD_FILE_ERROR_MESSAGE
Text [ en-US ] = "The attempt to load the file resulted in the following error message ($exception_type$):\n\n$error_message$";
};
-String STR_ERROR_REFRESH_ROW
-{
- Text [ en-US ] = "An error occured while refreshing the current row.";
-};
-
-String STR_ERROR_GET_ROW
-{
- Text [ en-US ] = "An error occured while getting the current row.";
-};
-String STR_CAN_NOT_CANCEL_ROW_UPDATE
-{
- Text [ en-US ] = "The row update can not be canceled.";
-};
-
-String STR_CAN_NOT_CREATE_ROW
-{
- Text [ en-US ] = "A new row can not be created.";
-};
-
-String STR_QUERY_INVALID_IS_NULL_COLUMN
-{
- Text [ en-US ] = "The query can not be executed. The 'IS NULL' can only be used with a column name.";
-};
-
-String STR_ILLEGAL_MOVEMENT
-{
- Text [ en-US ] = "Illegal cursor movement occured.";
-};
-
-String STR_COMMIT_ROW
-{
- Text [ en-US ] = "Please commit row '$position$' before update rows or insert new rows.";
-};
-
-String STR_INVALID_ROW_UPDATE
-{
- Text [ en-US ] = "The update call can not be executed. The row is invalid.";
-};
-
-String STR_ROW_CAN_NOT_SAVE
-{
- Text [ en-US ] = "The current row can not be saved.";
-};
-
-String STR_QUERY_AT_LEAST_ONE_TABLES
-{
- Text [ en-US ] = "The query can not be executed. It needs at least one table.";
-};
-
-String STR_NO_COUNT_SUPPORT
-{
- Text [ en-US ] = "The driver does not support the 'COUNT' function.";
-};
-String STR_STMT_TYPE_NOT_SUPPORTED
-{
- Text [ en-US ] = "This statement type not supported by this database driver.";
-};
// ============================================================================
// = the ado driver's resource strings
// ============================================================================