From 19ed9c3a16889a49f6d6b222de40f7b377ff3e83 Mon Sep 17 00:00:00 2001 From: Kurt Zenker Date: Fri, 5 Jun 2009 09:47:55 +0000 Subject: 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 to , 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 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# --- .../java/com/sun/star/report/DataRow.java | 6 +- .../java/com/sun/star/report/DataSource.java | 8 +- .../java/com/sun/star/report/ImageService.java | 8 +- .../java/com/sun/star/report/InputRepository.java | 14 +- .../com/sun/star/report/JobProgressIndicator.java | 10 +- .../java/com/sun/star/report/JobProperties.java | 6 +- .../java/com/sun/star/report/OfficeToken.java | 3 + .../java/com/sun/star/report/OutputRepository.java | 12 +- .../java/com/sun/star/report/ParameterMap.java | 10 +- .../java/com/sun/star/report/ReportAddIn.java | 6 +- .../com/sun/star/report/ReportEngineMetaData.java | 12 +- .../star/report/ReportEngineParameterNames.java | 1 + .../java/com/sun/star/report/ReportExpression.java | 6 +- .../sun/star/report/ReportExpressionMetaData.java | 14 +- .../java/com/sun/star/report/ReportJob.java | 12 +- .../com/sun/star/report/ReportJobDefinition.java | 4 +- .../java/com/sun/star/report/ReportJobFactory.java | 2 +- .../com/sun/star/report/SDBCReportDataFactory.java | 558 +++++++++++++-------- .../java/com/sun/star/report/SOImageService.java | 2 +- .../com/sun/star/report/StorageRepository.java | 2 +- .../report/function/metadata/AuthorFunction.java | 4 - .../metadata/AuthorFunctionDescription.java | 1 - .../metadata/TitleFunctionDescription.java | 1 - .../star/report/pentaho/DefaultNameGenerator.java | 27 +- .../pentaho/PentahoReportEngineMetaData.java | 2 + .../sun/star/report/pentaho/PentahoReportJob.java | 11 +- .../star/report/pentaho/SOFormulaOpCodeMapper.java | 4 +- .../sun/star/report/pentaho/SOFormulaParser.java | 20 +- .../sun/star/report/pentaho/SOFunctionManager.java | 32 +- .../star/report/pentaho/SOReportJobFactory.java | 12 +- .../star/report/pentaho/StarFunctionCategory.java | 2 +- .../report/pentaho/StarFunctionDescription.java | 16 +- .../layoutprocessor/FormatValueUtility.java | 37 +- .../ImageElementLayoutController.java | 8 +- .../layoutprocessor/ObjectOleLayoutController.java | 1 - ...OfficeGroupInstanceSectionLayoutController.java | 2 +- .../OfficeGroupLayoutController.java | 2 +- .../layoutprocessor/TableCellLayoutController.java | 3 +- .../java/com/sun/star/report/pentaho/makefile.mk | 6 +- .../star/report/pentaho/model/ImageElement.java | 17 +- .../star/report/pentaho/output/ImageProducer.java | 33 +- .../pentaho/output/OfficeDocumentReportTarget.java | 56 ++- .../star/report/pentaho/output/OleProducer.java | 5 +- .../pentaho/output/chart/ChartRawReportTarget.java | 3 +- .../spreadsheet/SpreadsheetRawReportTarget.java | 306 ++++++----- .../pentaho/output/text/MasterPageFactory.java | 4 +- .../report/pentaho/output/text/PageContext.java | 13 +- .../pentaho/output/text/TextRawReportTarget.java | 23 +- .../star/report/pentaho/parser/StyleMapper.java | 2 +- .../rpt/ConditionalPrintExpressionReadHandler.java | 4 - .../pentaho/parser/rpt/GroupReadHandler.java | 2 +- .../stylemapper/fo/BackgroundColorMapper.java | 4 - .../parser/stylemapper/fo/BorderRightMapper.java | 5 - .../java/com/sun/star/report/util/ReportUtil.java | 10 +- .../openoffice/Office/UI/DbReportWindowState.xcu | 5 +- 55 files changed, 799 insertions(+), 580 deletions(-) (limited to 'reportbuilder') diff --git a/reportbuilder/java/com/sun/star/report/DataRow.java b/reportbuilder/java/com/sun/star/report/DataRow.java index 1875578213ed..47f471113362 100644 --- a/reportbuilder/java/com/sun/star/report/DataRow.java +++ b/reportbuilder/java/com/sun/star/report/DataRow.java @@ -41,9 +41,9 @@ package com.sun.star.report; public interface DataRow { - public int getColumnCount() throws DataSourceException; + int getColumnCount() throws DataSourceException; - public String getColumnName(int column) throws DataSourceException; + String getColumnName(int column) throws DataSourceException; - public Object getObject(int column) throws DataSourceException; + Object getObject(int column) throws DataSourceException; } diff --git a/reportbuilder/java/com/sun/star/report/DataSource.java b/reportbuilder/java/com/sun/star/report/DataSource.java index 20f83a8a7798..42d78abcc9d1 100644 --- a/reportbuilder/java/com/sun/star/report/DataSource.java +++ b/reportbuilder/java/com/sun/star/report/DataSource.java @@ -41,11 +41,11 @@ package com.sun.star.report; public interface DataSource extends DataRow { - public int getRowCount() throws DataSourceException; + int getRowCount() throws DataSourceException; - public boolean absolute(int row) throws DataSourceException; + boolean absolute(int row) throws DataSourceException; - public boolean next() throws DataSourceException; + boolean next() throws DataSourceException; - public void close() throws DataSourceException; + void close() throws DataSourceException; } diff --git a/reportbuilder/java/com/sun/star/report/ImageService.java b/reportbuilder/java/com/sun/star/report/ImageService.java index e0b558933703..193b97d66d58 100644 --- a/reportbuilder/java/com/sun/star/report/ImageService.java +++ b/reportbuilder/java/com/sun/star/report/ImageService.java @@ -42,21 +42,21 @@ public interface ImageService /** * @return the mime-type of the image as string. */ - public String getMimeType(final InputStream image) throws ReportExecutionException; + String getMimeType(final InputStream image) throws ReportExecutionException; /** * @return the mime-type of the image as string. */ - public String getMimeType(final byte[] image) throws ReportExecutionException; + String getMimeType(final byte[] image) throws ReportExecutionException; /** * @returns the dimension in 100th mm. **/ - public Dimension getImageSize(final InputStream image) throws ReportExecutionException; + Dimension getImageSize(final InputStream image) throws ReportExecutionException; /** * @returns the dimension in 100th mm. **/ - public Dimension getImageSize(final byte[] image) throws ReportExecutionException; + Dimension getImageSize(final byte[] image) throws ReportExecutionException; } diff --git a/reportbuilder/java/com/sun/star/report/InputRepository.java b/reportbuilder/java/com/sun/star/report/InputRepository.java index 5ee660f9d03a..21564d5851df 100644 --- a/reportbuilder/java/com/sun/star/report/InputRepository.java +++ b/reportbuilder/java/com/sun/star/report/InputRepository.java @@ -54,9 +54,9 @@ public interface InputRepository * * @return the repository id */ - public Object getId(); + Object getId(); - public InputStream createInputStream(final String name) throws IOException; + InputStream createInputStream(final String name) throws IOException; /** allows to acces sub repositories inside this repository * @@ -64,7 +64,7 @@ public interface InputRepository * @return the sub repository * @throws java.io.IOException when the sub repository doesn't exist. */ - public InputRepository openInputRepository(final String name) throws IOException; + InputRepository openInputRepository(final String name) throws IOException; /** * This returns an version number for the given resource. Return zero, if @@ -75,11 +75,11 @@ public interface InputRepository * @param name the name of the resource * @return the version number */ - public long getVersion(final String name); + long getVersion(final String name); - public boolean exists(final String name); + boolean exists(final String name); - public boolean isReadable(final String name); + boolean isReadable(final String name); - public void closeInputRepository(); + void closeInputRepository(); } diff --git a/reportbuilder/java/com/sun/star/report/JobProgressIndicator.java b/reportbuilder/java/com/sun/star/report/JobProgressIndicator.java index 00dcdecc9a8d..4cda72cacb5d 100644 --- a/reportbuilder/java/com/sun/star/report/JobProgressIndicator.java +++ b/reportbuilder/java/com/sun/star/report/JobProgressIndicator.java @@ -43,7 +43,7 @@ public interface JobProgressIndicator * * @param string the new description */ - public void setText(String string); + void setText(String string); /** * Initializes the progress indicator and sets the progress description to @@ -56,7 +56,7 @@ public interface JobProgressIndicator * @param maxValue the maximum value * @see JobProgressIndicator#setText(String) */ - public void start(String text, int maxValue); + void start(String text, int maxValue); /** * Updates the value to the specified value. Invalid values must be ignored. @@ -65,17 +65,17 @@ public interface JobProgressIndicator * @param value the new value that should be shown now. This must fit the * range [0..maxValue] as defined in {@link JobProgressIndicator#start(String, int)}. */ - public void setValue(int value); + void setValue(int value); /** * Stop the progress. A progress indicator cannot be destructed before end() * has been called. */ - public void end(); + void end(); /** * Clear progress value and description. Calling of setValue(0) and * setText("") should do the same. Stopped indicators must ignore this call. */ - public void reset(); + void reset(); } diff --git a/reportbuilder/java/com/sun/star/report/JobProperties.java b/reportbuilder/java/com/sun/star/report/JobProperties.java index b0fcff494b87..9d8932c1219b 100644 --- a/reportbuilder/java/com/sun/star/report/JobProperties.java +++ b/reportbuilder/java/com/sun/star/report/JobProperties.java @@ -32,10 +32,10 @@ package com.sun.star.report; public interface JobProperties { - public void setProperty(String key, Object value) + void setProperty(String key, Object value) throws JobDefinitionException; - public Object getProperty(String key); + Object getProperty(String key); /** * A type safe clone operation. We derive a copy of all properties, @@ -44,5 +44,5 @@ public interface JobProperties * * @return a copy. */ - public JobProperties copy(); + JobProperties copy(); } diff --git a/reportbuilder/java/com/sun/star/report/OfficeToken.java b/reportbuilder/java/com/sun/star/report/OfficeToken.java index 5649abdac863..6685afe297da 100644 --- a/reportbuilder/java/com/sun/star/report/OfficeToken.java +++ b/reportbuilder/java/com/sun/star/report/OfficeToken.java @@ -61,4 +61,7 @@ public class OfficeToken { public static final String SCALE = "scale"; public static final String NAME = "name"; public static final String SHAPES = "shapes"; + public static final String ISOTROPIC = "isotropic"; + public static final String ANISOTROPIC = "anisotropic"; + public static final String NONE = "none"; } diff --git a/reportbuilder/java/com/sun/star/report/OutputRepository.java b/reportbuilder/java/com/sun/star/report/OutputRepository.java index 915ca1b88324..aba5deba5f51 100644 --- a/reportbuilder/java/com/sun/star/report/OutputRepository.java +++ b/reportbuilder/java/com/sun/star/report/OutputRepository.java @@ -53,7 +53,7 @@ public interface OutputRepository * @return the outputstream * @throws IOException if opening the stream fails */ - public OutputStream createOutputStream(final String name, final String mimeType) throws IOException; + OutputStream createOutputStream(final String name, final String mimeType) throws IOException; /** allows to acces sub repositories inside this repository * @@ -61,13 +61,13 @@ public interface OutputRepository * @return the sub repository * @throws java.io.IOException when the sub repository doesn't exist. */ - public OutputRepository openOutputRepository(final String name, final String mimeType) throws IOException; + OutputRepository openOutputRepository(final String name, final String mimeType) throws IOException; - public boolean exists(final String name); + boolean exists(final String name); - public boolean existsStorage(final String name); + boolean existsStorage(final String name); - public boolean isWritable(final String name); + boolean isWritable(final String name); - public void closeOutputRepository(); + void closeOutputRepository(); } diff --git a/reportbuilder/java/com/sun/star/report/ParameterMap.java b/reportbuilder/java/com/sun/star/report/ParameterMap.java index cf3aed4de598..45a5206583ed 100644 --- a/reportbuilder/java/com/sun/star/report/ParameterMap.java +++ b/reportbuilder/java/com/sun/star/report/ParameterMap.java @@ -49,7 +49,7 @@ public interface ParameterMap * @return The stored value, or null if the key does not exist in this * collection. */ - public Object get(final String key); + Object get(final String key); /** * Retrieves the value stored for a key in this properties collection, and returning the @@ -61,11 +61,11 @@ public interface ParameterMap * @return The stored value, or the default value if the key does not exist in this * collection. */ - public Object get(final String key, final Object defaultValue); + Object get(final String key, final Object defaultValue); - public String[] keys(); + String[] keys(); - public void clear(); + void clear(); - public int size(); + int size(); } diff --git a/reportbuilder/java/com/sun/star/report/ReportAddIn.java b/reportbuilder/java/com/sun/star/report/ReportAddIn.java index 6057a1e20eb2..112e182a0663 100644 --- a/reportbuilder/java/com/sun/star/report/ReportAddIn.java +++ b/reportbuilder/java/com/sun/star/report/ReportAddIn.java @@ -40,9 +40,9 @@ package com.sun.star.report; public interface ReportAddIn { - public int getExpressionCount(); + int getExpressionCount(); - public ReportExpression createExpression(int expression); + ReportExpression createExpression(int expression); - public ReportExpressionMetaData getMetaData(int expression); + ReportExpressionMetaData getMetaData(int expression); } diff --git a/reportbuilder/java/com/sun/star/report/ReportEngineMetaData.java b/reportbuilder/java/com/sun/star/report/ReportEngineMetaData.java index 486a58053e51..49ef491177ae 100644 --- a/reportbuilder/java/com/sun/star/report/ReportEngineMetaData.java +++ b/reportbuilder/java/com/sun/star/report/ReportEngineMetaData.java @@ -40,7 +40,7 @@ public interface ReportEngineMetaData * @param mimeType * @return true, if the output type is supported; false otherwise. */ - public boolean isOutputSupported(String mimeType); + boolean isOutputSupported(String mimeType); /** * Lists all supported output parameters for the given mime-type. @@ -50,13 +50,13 @@ public interface ReportEngineMetaData * @param mimeType * @return */ - public String[] getOutputParameters(String mimeType); + String[] getOutputParameters(String mimeType); - public Class getParameterType(String parameter); + Class getParameterType(String parameter); - public boolean isMandatory(String parameter); + boolean isMandatory(String parameter); - public boolean isEnumeration(String parameter); + boolean isEnumeration(String parameter); - public Object[] getEnumerationValues(String parameter); + Object[] getEnumerationValues(String parameter); } diff --git a/reportbuilder/java/com/sun/star/report/ReportEngineParameterNames.java b/reportbuilder/java/com/sun/star/report/ReportEngineParameterNames.java index 4b0002ba8d8c..8c191a77d2a3 100644 --- a/reportbuilder/java/com/sun/star/report/ReportEngineParameterNames.java +++ b/reportbuilder/java/com/sun/star/report/ReportEngineParameterNames.java @@ -51,6 +51,7 @@ public class ReportEngineParameterNames public static final String MIMETYPE = "output.mimetype"; public static final String AUTHOR = "Author"; public static final String TITLE = "Title"; + public static final String MAXROWS = "MaxRows"; private ReportEngineParameterNames () { diff --git a/reportbuilder/java/com/sun/star/report/ReportExpression.java b/reportbuilder/java/com/sun/star/report/ReportExpression.java index c544659f2c4f..5576a74205d5 100644 --- a/reportbuilder/java/com/sun/star/report/ReportExpression.java +++ b/reportbuilder/java/com/sun/star/report/ReportExpression.java @@ -47,8 +47,8 @@ package com.sun.star.report; */ public interface ReportExpression { - public void setParameters (Object[] parameters); - public Object getParameters (); + void setParameters (Object[] parameters); + Object getParameters (); - public Object getValue(DataRow row); + Object getValue(DataRow row); } diff --git a/reportbuilder/java/com/sun/star/report/ReportExpressionMetaData.java b/reportbuilder/java/com/sun/star/report/ReportExpressionMetaData.java index 830ae3927f44..c2caabfec78e 100644 --- a/reportbuilder/java/com/sun/star/report/ReportExpressionMetaData.java +++ b/reportbuilder/java/com/sun/star/report/ReportExpressionMetaData.java @@ -34,17 +34,17 @@ import java.util.Locale; public interface ReportExpressionMetaData { - public int getParameterCount(); + int getParameterCount(); - public String getParameterName(int param); + String getParameterName(int param); - public String getParameterDisplayName(int param, Locale locale); + String getParameterDisplayName(int param, Locale locale); - public String getParameterDescription(int param, Locale locale); + String getParameterDescription(int param, Locale locale); - public String getName(); + String getName(); - public String getDisplayName(Locale l); + String getDisplayName(Locale l); - public String getDescription(Locale l); + String getDescription(Locale l); } diff --git a/reportbuilder/java/com/sun/star/report/ReportJob.java b/reportbuilder/java/com/sun/star/report/ReportJob.java index bbd02ff5e390..8caf39b9bdae 100644 --- a/reportbuilder/java/com/sun/star/report/ReportJob.java +++ b/reportbuilder/java/com/sun/star/report/ReportJob.java @@ -63,20 +63,20 @@ public interface ReportJob * threading code or wont receive any progress information in single * threaded environments. */ - public void execute() + void execute() throws ReportExecutionException, IOException; /** * Interrupt the job. */ - public void interrupt(); + void interrupt(); /** * Queries the jobs execution status. * * @return true, if the job is currently running, false otherwise. */ - public boolean isRunning(); + boolean isRunning(); /** * Queries the jobs result status. @@ -84,9 +84,9 @@ public interface ReportJob * @return true, if the job is finished (or has been interrupted), false * if the job waits for activation. */ - public boolean isFinished(); + boolean isFinished(); - public void addProgressIndicator(JobProgressIndicator indicator); + void addProgressIndicator(JobProgressIndicator indicator); - public void removeProgressIndicator(JobProgressIndicator indicator); + void removeProgressIndicator(JobProgressIndicator indicator); } diff --git a/reportbuilder/java/com/sun/star/report/ReportJobDefinition.java b/reportbuilder/java/com/sun/star/report/ReportJobDefinition.java index ff1b78b6aace..1bad0c4f0de4 100644 --- a/reportbuilder/java/com/sun/star/report/ReportJobDefinition.java +++ b/reportbuilder/java/com/sun/star/report/ReportJobDefinition.java @@ -47,7 +47,7 @@ public interface ReportJobDefinition * * @return a map containing the report parameters */ - public ParameterMap getQueryParameters(); + ParameterMap getQueryParameters(); /** * The report processing parameters control the behaviour of the report. There are @@ -56,5 +56,5 @@ public interface ReportJobDefinition * * @return the processing parameters */ - public JobProperties getProcessingParameters(); + JobProperties getProcessingParameters(); } diff --git a/reportbuilder/java/com/sun/star/report/ReportJobFactory.java b/reportbuilder/java/com/sun/star/report/ReportJobFactory.java index cf8ed01ba736..fda22b4d907e 100644 --- a/reportbuilder/java/com/sun/star/report/ReportJobFactory.java +++ b/reportbuilder/java/com/sun/star/report/ReportJobFactory.java @@ -40,5 +40,5 @@ import com.sun.star.uno.Exception; public interface ReportJobFactory { - public ReportJob createReportJob(final NamedValue[] namedValue) throws IllegalArgumentException, ReportExecutionException, Exception; + ReportJob createReportJob(final NamedValue[] namedValue) throws IllegalArgumentException, ReportExecutionException, Exception; } diff --git a/reportbuilder/java/com/sun/star/report/SDBCReportDataFactory.java b/reportbuilder/java/com/sun/star/report/SDBCReportDataFactory.java index bc248c29bbd9..af396d415338 100644 --- a/reportbuilder/java/com/sun/star/report/SDBCReportDataFactory.java +++ b/reportbuilder/java/com/sun/star/report/SDBCReportDataFactory.java @@ -35,6 +35,7 @@ import com.sun.star.beans.XPropertySet; import com.sun.star.container.NoSuchElementException; import com.sun.star.container.XIndexAccess; import com.sun.star.lang.IllegalArgumentException; +import com.sun.star.lang.IndexOutOfBoundsException; import com.sun.star.lang.WrappedTargetException; import com.sun.star.sdbc.XConnection; import com.sun.star.container.XNameAccess; @@ -44,12 +45,14 @@ import com.sun.star.sdb.CommandType; import com.sun.star.sdb.XCompletedExecution; import com.sun.star.sdb.XParametersSupplier; import com.sun.star.sdb.XQueriesSupplier; +import com.sun.star.sdb.XResultSetAccess; import com.sun.star.sdb.XSingleSelectQueryComposer; import com.sun.star.sdb.tools.XConnectionTools; import com.sun.star.sdbc.SQLException; import com.sun.star.sdbc.XParameters; import com.sun.star.sdbc.XPreparedStatement; import com.sun.star.uno.Exception; +import java.util.HashMap; import java.util.Map; import com.sun.star.sdbc.XRowSet; @@ -63,6 +66,8 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.Iterator; import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -72,6 +77,77 @@ import org.apache.commons.logging.LogFactory; */ public class SDBCReportDataFactory implements DataSourceFactory { + private static final String ESCAPEPROCESSING = "EscapeProcessing"; + + private class RowSetProperties + { + + final Boolean escapeProcessing; + final int commandType; + final Integer maxRows; + final String command; + final String filter; + + public RowSetProperties(final Boolean escapeProcessing, final int commandType, final String command, final String filter, final Integer maxRows) + { + this.escapeProcessing = escapeProcessing; + this.commandType = commandType; + this.command = command; + this.filter = filter; + this.maxRows = maxRows; + } + + + public boolean equals(Object obj) + { + if (obj == null) + { + return false; + } + if (getClass() != obj.getClass()) + { + return false; + } + final RowSetProperties other = (RowSetProperties) obj; + if (this.escapeProcessing != other.escapeProcessing && (this.escapeProcessing == null || !this.escapeProcessing.equals(other.escapeProcessing))) + { + return false; + } + if (this.commandType != other.commandType) + { + return false; + } + if (this.maxRows != other.maxRows && (this.maxRows == null || !this.maxRows.equals(other.maxRows))) + { + return false; + } + if ((this.command == null) ? (other.command != null) : !this.command.equals(other.command)) + { + return false; + } + if ((this.filter == null) ? (other.filter != null) : !this.filter.equals(other.filter)) + { + return false; + } + return true; + } + + public int hashCode() + { + int hash = 3; + hash = 59 * hash + (this.escapeProcessing != null ? this.escapeProcessing.hashCode() : 0); + hash = 59 * hash + this.commandType; + hash = 59 * hash + (this.maxRows != null ? this.maxRows.hashCode() : 0); + hash = 59 * hash + (this.command != null ? this.command.hashCode() : 0); + hash = 59 * hash + (this.filter != null ? this.filter.hashCode() : 0); + return hash; + } + } + class ParameterDefinition + { + int parameterCount = 0; + private ArrayList parameterIndex = new ArrayList(); + } private static final Log LOGGER = LogFactory.getLog(SDBCReportDataFactory.class); public static final String COMMAND_TYPE = "command-type"; public static final String ESCAPE_PROCESSING = "escape-processing"; @@ -94,6 +170,9 @@ public class SDBCReportDataFactory implements DataSourceFactory private static final int HANDLE_QUERY = 4; private static final int HANDLE_TABLE = 5; private static final int HANDLE_SQL = 6; + private final Map rowSetProperties = new HashMap(); + private final Map parameterMap = new HashMap(); + private boolean rowSetCreated = false; public SDBCReportDataFactory(final XComponentContext cmpCtx, final XConnection connection) { @@ -105,19 +184,19 @@ public class SDBCReportDataFactory implements DataSourceFactory { try { - if ( command == null ) + if (command == null) { return new SDBCReportData(null); } int commandType = CommandType.COMMAND; final String commandTypeValue = (String) parameters.get(COMMAND_TYPE); - if ( commandTypeValue != null ) + if (commandTypeValue != null) { - if ( commandTypeValue.equals("query") ) + if ("query".equals(commandTypeValue)) { commandType = CommandType.QUERY; } - else if ( commandTypeValue.equals("table") ) + else if ("table".equals(commandTypeValue)) { commandType = CommandType.TABLE; } @@ -126,18 +205,22 @@ public class SDBCReportDataFactory implements DataSourceFactory commandType = CommandType.COMMAND; } } - final XRowSet rowSet = createRowSet(command, commandType, parameters); - final XPropertySet rowSetProp = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, rowSet); + final Boolean escapeProcessing = (Boolean) parameters.get(ESCAPE_PROCESSING); + final String filter = (String) parameters.get(UNO_FILTER); + final Integer maxRows = (Integer) parameters.get("MaxRows"); + RowSetProperties rowSetProps = new RowSetProperties(escapeProcessing, commandType, command, filter, maxRows); - final XConnectionTools tools = (XConnectionTools) UnoRuntime.queryInterface(XConnectionTools.class, connection); - fillOrderStatement(command, commandType, parameters, tools, rowSetProp); + final Object[] p = createRowSet(rowSetProps,parameters); + final XRowSet rowSet = (XRowSet)p[0]; - if ( command.length() != 0 ) + if (command.length() != 0 ) { - final int oldParameterCount = fillParameter(parameters, tools, command, commandType, rowSet); + final ParameterDefinition paramDef = (ParameterDefinition)p[1]; + fillParameter(parameters, rowSet,paramDef); + rowSetCreated = rowSetCreated && ( maxRows == null || maxRows.intValue() == 0); final XCompletedExecution execute = (XCompletedExecution) UnoRuntime.queryInterface(XCompletedExecution.class, rowSet); - if ( execute != null && oldParameterCount > 0 ) + if (rowSetCreated && execute != null && paramDef.parameterCount > 0) { final XInteractionHandler handler = (XInteractionHandler) UnoRuntime.queryInterface(XInteractionHandler.class, m_cmpCtx.getServiceManager().createInstanceWithContext("com.sun.star.sdb.InteractionHandler", m_cmpCtx)); execute.executeWithCompletion(handler); @@ -147,9 +230,13 @@ public class SDBCReportDataFactory implements DataSourceFactory rowSet.execute(); } } + + rowSetCreated = false; return new SDBCReportData(rowSet); - } catch ( Exception ex ) + } + catch (Exception ex) { + rowSetCreated = false; throw new DataSourceException(ex.getMessage(), ex); } } @@ -158,7 +245,7 @@ public class SDBCReportDataFactory implements DataSourceFactory { final StringBuffer order = new StringBuffer(); final int count = groupExpressions.size(); - if ( count != 0 ) + if (count != 0) { try { @@ -196,10 +283,6 @@ public class SDBCReportDataFactory implements DataSourceFactory } } } - catch (IndexOutOfBoundsException ex) - { - LOGGER.error("ReportProcessing failed", ex); - } catch (SQLException ex) { LOGGER.error("ReportProcessing failed", ex); @@ -219,14 +302,15 @@ public class SDBCReportDataFactory implements DataSourceFactory { tools.getClass().getMethod("getFieldsByCommandDescriptor", parameter); return tools.getFieldsByCommandDescriptor(commandType, command, out); - } catch ( NoSuchMethodException ex ) + } + catch (NoSuchMethodException ex) { } XNameAccess xFields = null; // some kind of state machine to ease the sharing of code int eState = FAILED; - switch ( commandType ) + switch (commandType) { case CommandType.TABLE: eState = HANDLE_TABLE; @@ -248,41 +332,41 @@ public class SDBCReportDataFactory implements DataSourceFactory // go! while ((DONE != eState) && (FAILED != eState)) { - switch ( eState ) + switch (eState) { case HANDLE_TABLE: - { - // initial state for handling the tables + { + // initial state for handling the tables - // get the table objects - final XTablesSupplier xSupplyTables = (XTablesSupplier) UnoRuntime.queryInterface(XTablesSupplier.class, connection); - if ( xSupplyTables != null ) - { - xObjectCollection = xSupplyTables.getTables(); + // get the table objects + final XTablesSupplier xSupplyTables = (XTablesSupplier) UnoRuntime.queryInterface(XTablesSupplier.class, connection); + if (xSupplyTables != null) + { + xObjectCollection = xSupplyTables.getTables(); // if something went wrong 'til here, then this will be handled in the next state // next state: get the object } - eState = RETRIEVE_OBJECT; - } - break; + eState = RETRIEVE_OBJECT; + } + break; case HANDLE_QUERY: - { - // initial state for handling the tables + { + // initial state for handling the tables - // get the table objects - final XQueriesSupplier xSupplyQueries = (XQueriesSupplier) UnoRuntime.queryInterface(XQueriesSupplier.class, connection); - if ( xSupplyQueries != null ) - { - xObjectCollection = xSupplyQueries.getQueries(); + // get the table objects + final XQueriesSupplier xSupplyQueries = (XQueriesSupplier) UnoRuntime.queryInterface(XQueriesSupplier.class, connection); + if (xSupplyQueries != null) + { + xObjectCollection = xSupplyQueries.getQueries(); // if something went wrong 'til here, then this will be handled in the next state // next state: get the object } - eState = RETRIEVE_OBJECT; - } - break; + eState = RETRIEVE_OBJECT; + } + break; case RETRIEVE_OBJECT: // here we should have an object (aka query or table) collection, and are going @@ -291,7 +375,7 @@ public class SDBCReportDataFactory implements DataSourceFactory // next state: default to FAILED eState = FAILED; - if ( xObjectCollection != null && xObjectCollection.hasByName(command) ) + if (xObjectCollection != null && xObjectCollection.hasByName(command)) { xSupplyColumns = (XColumnsSupplier) UnoRuntime.queryInterface(XColumnsSupplier.class, xObjectCollection.getByName(command)); @@ -304,7 +388,7 @@ public class SDBCReportDataFactory implements DataSourceFactory // next state: default to FAILED eState = FAILED; - if ( xSupplyColumns != null ) + if (xSupplyColumns != null) { xFields = xSupplyColumns.getColumns(); // that's it @@ -313,75 +397,78 @@ public class SDBCReportDataFactory implements DataSourceFactory break; case HANDLE_SQL: - { - String sStatementToExecute = command; + { + String sStatementToExecute = command; - // well, the main problem here is to handle statements which contain a parameter - // If we would simply execute a parametrized statement, then this will fail because - // we cannot supply any parameter values. - // Thus, we try to analyze the statement, and to append a WHERE 0=1 filter criterion - // This should cause every driver to not really execute the statement, but to return - // an empty result set with the proper structure. We then can use this result set - // to retrieve the columns. + // well, the main problem here is to handle statements which contain a parameter + // If we would simply execute a parametrized statement, then this will fail because + // we cannot supply any parameter values. + // Thus, we try to analyze the statement, and to append a WHERE 0=1 filter criterion + // This should cause every driver to not really execute the statement, but to return + // an empty result set with the proper structure. We then can use this result set + // to retrieve the columns. - try - { - final XMultiServiceFactory xComposerFac = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class, connection); + try + { + final XMultiServiceFactory xComposerFac = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class, connection); - if ( xComposerFac != null ) + if (xComposerFac != null) + { + final XSingleSelectQueryComposer xComposer = (XSingleSelectQueryComposer) UnoRuntime.queryInterface(XSingleSelectQueryComposer.class, xComposerFac.createInstance("com.sun.star.sdb.SingleSelectQueryComposer")); + if (xComposer != null) { - final XSingleSelectQueryComposer xComposer = (XSingleSelectQueryComposer) UnoRuntime.queryInterface(XSingleSelectQueryComposer.class, xComposerFac.createInstance("com.sun.star.sdb.SingleSelectQueryComposer")); - if ( xComposer != null ) - { - xComposer.setQuery(sStatementToExecute); + xComposer.setQuery(sStatementToExecute); - // Now set the filter to a dummy restriction which will result in an empty - // result set. - xComposer.setFilter("0=1"); + // Now set the filter to a dummy restriction which will result in an empty + // result set. + xComposer.setFilter("0=1"); - sStatementToExecute = xComposer.getQuery(); - } + sStatementToExecute = xComposer.getQuery(); } - } catch ( com.sun.star.uno.Exception ex ) - { - // silent this error, this was just a try. If we're here, we did not change sStatementToExecute, - // so it will still be _rCommand, which then will be executed without being touched + } + } + catch (com.sun.star.uno.Exception ex) + { + // silent this error, this was just a try. If we're here, we did not change sStatementToExecute, + // so it will still be _rCommand, which then will be executed without being touched } - // now execute - final XPreparedStatement xStatement = connection.prepareStatement(sStatementToExecute); - // transfer ownership of this temporary object to the caller - out[0] = (XComponent) UnoRuntime.queryInterface(XComponent.class, xStatement); + // now execute + final XPreparedStatement xStatement = connection.prepareStatement(sStatementToExecute); + // transfer ownership of this temporary object to the caller + out[0] = (XComponent) UnoRuntime.queryInterface(XComponent.class, xStatement); - // set the "MaxRows" to 0. This is just in case our attempt to append a 0=1 filter - // failed - in this case, the MaxRows restriction should at least ensure that there - // is no data returned (which would be potentially expensive) - final XPropertySet xStatementProps = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xStatement); - try - { - if ( xStatementProps != null ) - { - xStatementProps.setPropertyValue("MaxRows", new Integer(0)); - } - } catch ( com.sun.star.uno.Exception ex ) + // set the "MaxRows" to 0. This is just in case our attempt to append a 0=1 filter + // failed - in this case, the MaxRows restriction should at least ensure that there + // is no data returned (which would be potentially expensive) + final XPropertySet xStatementProps = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xStatement); + try + { + if (xStatementProps != null) { - // oh damn. Not much of a chance to recover, we will no retrieve the complete - // full blown result set + xStatementProps.setPropertyValue("MaxRows", Integer.valueOf(0)); + } + } + catch (com.sun.star.uno.Exception ex) + { + // oh damn. Not much of a chance to recover, we will no retrieve the complete + // full blown result set } - xSupplyColumns = (XColumnsSupplier) UnoRuntime.queryInterface(XColumnsSupplier.class, xStatement.executeQuery()); - // this should have given us a result set which does not contain any data, but - // the structural information we need + xSupplyColumns = (XColumnsSupplier) UnoRuntime.queryInterface(XColumnsSupplier.class, xStatement.executeQuery()); + // this should have given us a result set which does not contain any data, but + // the structural information we need - // so the next state is to get the columns - eState = RETRIEVE_COLUMNS; - } - break; + // so the next state is to get the columns + eState = RETRIEVE_COLUMNS; + } + break; default: eState = FAILED; } } - } catch ( com.sun.star.uno.Exception ex ) + } + catch (com.sun.star.uno.Exception ex) { } return xFields; @@ -399,15 +486,18 @@ public class SDBCReportDataFactory implements DataSourceFactory final Object[] param = new Object[2]; param[0] = commandType; param[1] = command; - Method call = tools.getClass().getMethod("getComposer", parameter); + final Method call = tools.getClass().getMethod("getComposer", parameter); return (XSingleSelectQueryComposer) call.invoke(tools, param); - } catch ( NoSuchMethodException ex ) + } + catch (NoSuchMethodException ex) { - } catch ( IllegalAccessException ex ) + } + catch (IllegalAccessException ex) { // should not happen // assert False - } catch ( java.lang.reflect.InvocationTargetException ex ) + } + catch (java.lang.reflect.InvocationTargetException ex) { // should not happen // assert False @@ -418,172 +508,230 @@ public class SDBCReportDataFactory implements DataSourceFactory final XSingleSelectQueryComposer out = (XSingleSelectQueryComposer) UnoRuntime.queryInterface(XSingleSelectQueryComposer.class, factory.createInstance("com.sun.star.sdb.SingleSelectQueryAnalyzer")); final String quote = connection.getMetaData().getIdentifierQuoteString(); String statement = command; - switch ( commandType ) + switch (commandType) { case CommandType.TABLE: statement = "SELECT * FROM " + quote + command + quote; break; case CommandType.QUERY: + { + final XQueriesSupplier xSupplyQueries = (XQueriesSupplier) UnoRuntime.queryInterface(XQueriesSupplier.class, connection); + final XNameAccess queries = xSupplyQueries.getQueries(); + if (queries.hasByName(command)) { - final XQueriesSupplier xSupplyQueries = (XQueriesSupplier) UnoRuntime.queryInterface(XQueriesSupplier.class, connection); - final XNameAccess queries = xSupplyQueries.getQueries(); - if ( queries.hasByName(command) ) + final XPropertySet prop = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, queries.getByName(command)); + final Boolean escape = (Boolean) prop.getPropertyValue(ESCAPEPROCESSING); + if (escape.booleanValue()) { - final XPropertySet prop = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, queries.getByName(command)); - final Boolean escape = (Boolean) prop.getPropertyValue("EscapeProcessing"); - if (escape.booleanValue()) + statement = (String) prop.getPropertyValue(UNO_COMMAND); + final XSingleSelectQueryComposer composer = getComposer(tools, statement, CommandType.COMMAND); + if (composer != null) { - statement = (String) prop.getPropertyValue(UNO_COMMAND); - final XSingleSelectQueryComposer composer = getComposer(tools, statement, CommandType.COMMAND); - if (composer != null) + final String order = (String) prop.getPropertyValue(UNO_ORDER); + if (order != null && order.length() != 0) { - final String order = (String) prop.getPropertyValue(UNO_ORDER); - if (order != null && order.length() != 0) - { - composer.setOrder(order); - } - final Boolean applyFilter = (Boolean) prop.getPropertyValue(UNO_APPLY_FILTER); - if (applyFilter.booleanValue()) + composer.setOrder(order); + } + final Boolean applyFilter = (Boolean) prop.getPropertyValue(UNO_APPLY_FILTER); + if (applyFilter.booleanValue()) + { + final String filter = (String) prop.getPropertyValue(UNO_FILTER); + if (filter != null && filter.length() != 0) { - final String filter = (String) prop.getPropertyValue(UNO_FILTER); - if (filter != null && filter.length() != 0) - { - composer.setFilter(filter); - } + composer.setFilter(filter); } - statement = composer.getQuery(); } + statement = composer.getQuery(); } } } break; + } case CommandType.COMMAND: statement = command; break; } out.setElementaryQuery(statement); return out; - } catch ( Exception e ) + } + catch (Exception e) { } return null; } - int fillParameter(final Map parameters, - final XConnectionTools tools, - final String command, - final int commandType, final XRowSet rowSet) + private void fillParameter(final Map parameters, + final XRowSet rowSet,final ParameterDefinition paramDef) throws SQLException, UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException { - int oldParameterCount = 0; + final ArrayList masterValues = (ArrayList) parameters.get(MASTER_VALUES); + if (masterValues != null && !masterValues.isEmpty()) + { + final XParameters para = (XParameters) UnoRuntime.queryInterface(XParameters.class, rowSet); + + for (int i = 0; + i < masterValues.size(); + i++) + { + Object object = masterValues.get(i); + if (object instanceof BigDecimal) + { + object = ((BigDecimal) object).toString(); + } + final Integer pos = (Integer)paramDef.parameterIndex.get(i); + para.setObject(pos + 1, object); + } + } + } + + private final Object[] createRowSet(final RowSetProperties rowSetProps,final Map parameters) + throws Exception + { + final ArrayList detailColumns = (ArrayList) parameters.get(DETAIL_COLUMNS); + if (rowSetProperties.containsKey(rowSetProps) && detailColumns != null && !detailColumns.isEmpty() ) + { + return new Object[]{ rowSetProperties.get(rowSetProps),parameterMap.get(rowSetProps)}; + } + + rowSetCreated = true; + final XRowSet rowSet = (XRowSet) UnoRuntime.queryInterface(XRowSet.class, m_cmpCtx.getServiceManager().createInstanceWithContext("com.sun.star.sdb.RowSet", m_cmpCtx)); + final XPropertySet rowSetProp = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, rowSet); + + rowSetProp.setPropertyValue("ActiveConnection", connection); + rowSetProp.setPropertyValue(ESCAPEPROCESSING, rowSetProps.escapeProcessing); + rowSetProp.setPropertyValue(UNO_COMMAND_TYPE, Integer.valueOf(rowSetProps.commandType)); + rowSetProp.setPropertyValue(UNO_COMMAND, rowSetProps.command); + + if (rowSetProps.filter != null) + { + rowSetProp.setPropertyValue("Filter", rowSetProps.filter); + rowSetProp.setPropertyValue(APPLY_FILTER, Boolean.valueOf(rowSetProps.filter.length() != 0)); + } + else + { + rowSetProp.setPropertyValue(APPLY_FILTER, Boolean.FALSE); + } + + if (rowSetProps.maxRows != null) + { + rowSetProp.setPropertyValue("MaxRows", rowSetProps.maxRows); + } - final XSingleSelectQueryComposer composer = getComposer(tools, command, commandType); - if ( composer != null ) + final XConnectionTools tools = (XConnectionTools) UnoRuntime.queryInterface(XConnectionTools.class, connection); + fillOrderStatement(rowSetProps.command, rowSetProps.commandType, parameters, tools, rowSetProp); + final ParameterDefinition paramDef = createParameter(parameters, tools, rowSetProps, rowSet); + + rowSetProperties.put(rowSetProps, rowSet); + parameterMap.put(rowSetProps, paramDef); + + return new Object[]{rowSet,paramDef}; + } + + private ParameterDefinition createParameter(final Map parameters, + final XConnectionTools tools, + RowSetProperties rowSetProps, final XRowSet rowSet) + throws SQLException, + UnknownPropertyException, + PropertyVetoException, + IllegalArgumentException, + WrappedTargetException + { + final ParameterDefinition paramDef = new ParameterDefinition(); + final XSingleSelectQueryComposer composer = getComposer(tools, rowSetProps.command, rowSetProps.commandType); + if (composer != null) { final XPropertySet rowSetProp = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, rowSet); - if ( ((Boolean)rowSetProp.getPropertyValue(APPLY_FILTER)).booleanValue() ) + if (((Boolean) rowSetProp.getPropertyValue(APPLY_FILTER)).booleanValue()) { - composer.setFilter((String)rowSetProp.getPropertyValue("Filter")); + composer.setFilter((String) rowSetProp.getPropertyValue("Filter")); } // get old parameter count + final ArrayList detailColumns = (ArrayList) parameters.get(DETAIL_COLUMNS); + final ArrayList handledColumns = new ArrayList(); final XParametersSupplier paraSup = (XParametersSupplier) UnoRuntime.queryInterface(XParametersSupplier.class, composer); - if ( paraSup != null ) + if (paraSup != null) { final XIndexAccess params = paraSup.getParameters(); - if ( params != null ) + if (params != null) { - oldParameterCount = params.getCount(); + final int oldParameterCount = params.getCount(); + paramDef.parameterCount = oldParameterCount; + if ( detailColumns != null ) + { + for (int i = 0; i < oldParameterCount; i++) + { + try + { + final XPropertySet parameter = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, params.getByIndex(i)); + if (parameter != null) + { + final String name = (String) parameter.getPropertyValue("Name"); + for (int j = 0; j < detailColumns.size(); j++) + { + if ( name.equals(detailColumns.get(j) ) ) + { + handledColumns.add(name); + paramDef.parameterIndex.add(Integer.valueOf(i)); + --paramDef.parameterCount; + break; + } + } + } + } + catch (IndexOutOfBoundsException ex) + { + Logger.getLogger(SDBCReportDataFactory.class.getName()).log(Level.SEVERE, null, ex); + } + } + } } } final ArrayList masterValues = (ArrayList) parameters.get(MASTER_VALUES); - if ( masterValues != null && !masterValues.isEmpty() ) + if (masterValues != null && !masterValues.isEmpty() && paramDef.parameterIndex.size() != detailColumns.size() ) { // Vector masterColumns = (Vector) parameters.get("master-columns"); - final ArrayList detailColumns = (ArrayList) parameters.get(DETAIL_COLUMNS); - if ( oldParameterCount < detailColumns.size() ) + + // create the new filter + final String quote = connection.getMetaData().getIdentifierQuoteString(); + final StringBuffer oldFilter = new StringBuffer(); + oldFilter.append(composer.getFilter()); + if (oldFilter.length() != 0) { - // create the new filter - final String quote = connection.getMetaData().getIdentifierQuoteString(); - final StringBuffer oldFilter = new StringBuffer(); - oldFilter.append(composer.getFilter()); - if ( oldFilter.length() != 0 ) - { - oldFilter.append(" AND "); - } - int newParamterCounter = 1; - for (final Iterator it = detailColumns.iterator(); it.hasNext(); - ++newParamterCounter) + oldFilter.append(" AND "); + } + int newParamterCounter = 1; + for (final Iterator it = detailColumns.iterator(); it.hasNext(); + ++newParamterCounter) + { + final String detail = (String) it.next(); + if ( !handledColumns.contains(detail) ) { - final String detail = (String) it.next(); //String master = (String) masterIt.next(); oldFilter.append(quote); oldFilter.append(detail); oldFilter.append(quote); oldFilter.append(" = :link_"); oldFilter.append(newParamterCounter); - if ( it.hasNext() ) + if (it.hasNext()) { oldFilter.append(" AND "); } + paramDef.parameterIndex.add(Integer.valueOf(newParamterCounter + paramDef.parameterCount - 1)); } - - composer.setFilter(oldFilter.toString()); } - else - oldParameterCount = 0; + + composer.setFilter(oldFilter.toString()); final String sQuery = composer.getQuery(); rowSetProp.setPropertyValue(UNO_COMMAND, sQuery); - rowSetProp.setPropertyValue(UNO_COMMAND_TYPE, - new Integer(CommandType.COMMAND)); - - final XParameters para = (XParameters) UnoRuntime.queryInterface(XParameters.class, rowSet); - - for (int i = 0; - i < masterValues.size(); - i++) - { - Object object = masterValues.get(i); - if ( object instanceof BigDecimal ) - { - object = ((BigDecimal) object).toString(); - } - para.setObject(oldParameterCount + i + 1, object); - } + rowSetProp.setPropertyValue(UNO_COMMAND_TYPE,Integer.valueOf(CommandType.COMMAND)); } } - - return oldParameterCount; - } - - private final XRowSet createRowSet(final String command, - final int commandType, final Map parameters) - throws Exception - { - final XRowSet rowSet = (XRowSet) UnoRuntime.queryInterface(XRowSet.class, m_cmpCtx.getServiceManager().createInstanceWithContext("com.sun.star.sdb.RowSet", m_cmpCtx)); - final XPropertySet rowSetProp = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, rowSet); - - rowSetProp.setPropertyValue("ActiveConnection", connection); - final Boolean escapeProcessing = (Boolean)parameters.get(ESCAPE_PROCESSING); - rowSetProp.setPropertyValue("EscapeProcessing", escapeProcessing); - rowSetProp.setPropertyValue(UNO_COMMAND_TYPE, new Integer(commandType)); - rowSetProp.setPropertyValue(UNO_COMMAND, command); - - final String filter = (String) parameters.get(UNO_FILTER); - if ( filter != null ) - { - rowSetProp.setPropertyValue("Filter", filter); - rowSetProp.setPropertyValue(APPLY_FILTER, Boolean.valueOf(filter.length() != 0)); - } - else - { - rowSetProp.setPropertyValue(APPLY_FILTER, Boolean.FALSE); - } - return rowSet; + return paramDef; } void fillOrderStatement(final String command, @@ -598,16 +746,16 @@ public class SDBCReportDataFactory implements DataSourceFactory NoSuchElementException { final StringBuffer order = new StringBuffer(getOrderStatement(commandType, command, (ArrayList) parameters.get(GROUP_EXPRESSIONS))); - if ( order.length() > 0 && commandType != CommandType.TABLE ) + if (order.length() > 0 && commandType != CommandType.TABLE) { String statement = command; final XSingleSelectQueryComposer composer = getComposer(tools, command, commandType); - if ( composer != null ) + if (composer != null) { statement = composer.getQuery(); composer.setQuery(statement); final String sOldOrder = composer.getOrder(); - if ( sOldOrder.length() > 0 ) + if (sOldOrder.length() > 0) { order.append(','); order.append(sOldOrder); @@ -617,15 +765,15 @@ public class SDBCReportDataFactory implements DataSourceFactory } else { - if ( commandType == CommandType.QUERY ) + if (commandType == CommandType.QUERY) { final XQueriesSupplier xSupplyQueries = (XQueriesSupplier) UnoRuntime.queryInterface(XQueriesSupplier.class, connection); final XNameAccess queries = xSupplyQueries.getQueries(); - if ( queries.hasByName(command) ) + if (queries.hasByName(command)) { final XPropertySet prop = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, queries.getByName(command)); - final Boolean escape = (Boolean) prop.getPropertyValue("EscapeProcessing"); - rowSetProp.setPropertyValue("EscapeProcessing", escape); + final Boolean escape = (Boolean) prop.getPropertyValue(ESCAPEPROCESSING); + rowSetProp.setPropertyValue( ESCAPEPROCESSING, escape); final String queryCommand = (String) prop.getPropertyValue(UNO_COMMAND); statement = "SELECT * FROM (" + queryCommand + ")"; } @@ -637,7 +785,7 @@ public class SDBCReportDataFactory implements DataSourceFactory } } rowSetProp.setPropertyValue(UNO_COMMAND, statement); - rowSetProp.setPropertyValue(UNO_COMMAND_TYPE, new Integer(CommandType.COMMAND)); + rowSetProp.setPropertyValue(UNO_COMMAND_TYPE, Integer.valueOf(CommandType.COMMAND)); } rowSetProp.setPropertyValue("Order", order.toString()); } diff --git a/reportbuilder/java/com/sun/star/report/SOImageService.java b/reportbuilder/java/com/sun/star/report/SOImageService.java index 3073a52179fa..83413fe91deb 100644 --- a/reportbuilder/java/com/sun/star/report/SOImageService.java +++ b/reportbuilder/java/com/sun/star/report/SOImageService.java @@ -106,7 +106,7 @@ public class SOImageService implements ImageService { imageSize = (Size) xImage.getPropertyValue("SizePixel"); final int dpi = java.awt.Toolkit.getDefaultToolkit().getScreenResolution(); - final double fac = 2540 / dpi; + final double fac = 2540 / (double)dpi; dim.setSize(imageSize.Width * fac, imageSize.Height * fac); } } diff --git a/reportbuilder/java/com/sun/star/report/StorageRepository.java b/reportbuilder/java/com/sun/star/report/StorageRepository.java index b32bcb3dab86..da0c7fe9e123 100644 --- a/reportbuilder/java/com/sun/star/report/StorageRepository.java +++ b/reportbuilder/java/com/sun/star/report/StorageRepository.java @@ -148,7 +148,7 @@ public class StorageRepository implements InputRepository, OutputRepository { LOGGER.error(REPORT_PROCESSING_FAILED, ex); } - catch (NoSuchElementException ex) + catch (NoSuchElementException e) { // We expect this exception, no need to log it. } diff --git a/reportbuilder/java/com/sun/star/report/function/metadata/AuthorFunction.java b/reportbuilder/java/com/sun/star/report/function/metadata/AuthorFunction.java index 63b15fab0200..87cb540b4a94 100644 --- a/reportbuilder/java/com/sun/star/report/function/metadata/AuthorFunction.java +++ b/reportbuilder/java/com/sun/star/report/function/metadata/AuthorFunction.java @@ -45,10 +45,6 @@ import org.pentaho.reporting.libraries.formula.typing.coretypes.TextType; public class AuthorFunction implements Function { - public AuthorFunction() - { - } - public String getCanonicalName() { return "AUTHOR"; diff --git a/reportbuilder/java/com/sun/star/report/function/metadata/AuthorFunctionDescription.java b/reportbuilder/java/com/sun/star/report/function/metadata/AuthorFunctionDescription.java index fecfcd5753c1..475ce31ab9a1 100644 --- a/reportbuilder/java/com/sun/star/report/function/metadata/AuthorFunctionDescription.java +++ b/reportbuilder/java/com/sun/star/report/function/metadata/AuthorFunctionDescription.java @@ -32,7 +32,6 @@ package com.sun.star.report.function.metadata; import org.pentaho.reporting.libraries.formula.function.AbstractFunctionDescription; import org.pentaho.reporting.libraries.formula.function.FunctionCategory; import org.pentaho.reporting.libraries.formula.typing.Type; -import org.pentaho.reporting.libraries.formula.typing.coretypes.NumberType; import org.pentaho.reporting.libraries.formula.typing.coretypes.TextType; /** diff --git a/reportbuilder/java/com/sun/star/report/function/metadata/TitleFunctionDescription.java b/reportbuilder/java/com/sun/star/report/function/metadata/TitleFunctionDescription.java index 5db1a898b04e..a8dadc17a00d 100644 --- a/reportbuilder/java/com/sun/star/report/function/metadata/TitleFunctionDescription.java +++ b/reportbuilder/java/com/sun/star/report/function/metadata/TitleFunctionDescription.java @@ -32,7 +32,6 @@ package com.sun.star.report.function.metadata; import org.pentaho.reporting.libraries.formula.function.AbstractFunctionDescription; import org.pentaho.reporting.libraries.formula.function.FunctionCategory; import org.pentaho.reporting.libraries.formula.typing.Type; -import org.pentaho.reporting.libraries.formula.typing.coretypes.NumberType; import org.pentaho.reporting.libraries.formula.typing.coretypes.TextType; /** diff --git a/reportbuilder/java/com/sun/star/report/pentaho/DefaultNameGenerator.java b/reportbuilder/java/com/sun/star/report/pentaho/DefaultNameGenerator.java index 6cfac589b900..0f2c858d1c96 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/DefaultNameGenerator.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/DefaultNameGenerator.java @@ -80,25 +80,28 @@ public class DefaultNameGenerator name = "file"; } - String firstFileName = name; + StringBuffer firstFileName = new StringBuffer(); + firstFileName.append(name); final String suffix; if (mimeType != null) { suffix = getSuffixForType(mimeType); - firstFileName += "." + suffix; + firstFileName.append('.'); + firstFileName.append(suffix); } else { suffix = null; } + String newName = firstFileName.toString(); boolean exists; if (isStream) { - exists = outputRepository.exists(firstFileName); + exists = outputRepository.exists(newName); } else { - exists = outputRepository.existsStorage(firstFileName); + exists = outputRepository.existsStorage(newName); } if (exists) { @@ -109,23 +112,27 @@ public class DefaultNameGenerator { throw new IOException(); } - firstFileName = name + counter; + firstFileName.delete(0,firstFileName.length() ); + firstFileName.append(name); + firstFileName.append(counter); if (suffix != null) { - firstFileName += "." + suffix; + firstFileName.append('.'); + firstFileName.append(suffix); } + newName = firstFileName.toString(); if (isStream) { - exists = outputRepository.exists(firstFileName); + exists = outputRepository.exists(newName); } else { - exists = outputRepository.existsStorage(firstFileName); + exists = outputRepository.existsStorage(newName); } - counter += 1; + counter++; } } - return firstFileName; + return newName; } protected String getSuffixForType(final String mimeType) diff --git a/reportbuilder/java/com/sun/star/report/pentaho/PentahoReportEngineMetaData.java b/reportbuilder/java/com/sun/star/report/pentaho/PentahoReportEngineMetaData.java index 7285e9b897be..1f4dce14950d 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/PentahoReportEngineMetaData.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/PentahoReportEngineMetaData.java @@ -73,6 +73,7 @@ public class PentahoReportEngineMetaData mandatoryParameters.add(ReportEngineParameterNames.INPUT_DETAIL_COLUMNS); mandatoryParameters.add(ReportEngineParameterNames.AUTHOR); mandatoryParameters.add(ReportEngineParameterNames.TITLE); + mandatoryParameters.add(ReportEngineParameterNames.MAXROWS); parameterTypes = new HashMap(); @@ -89,6 +90,7 @@ public class PentahoReportEngineMetaData parameterTypes.put(ReportEngineParameterNames.INPUT_DETAIL_COLUMNS, List.class); parameterTypes.put(ReportEngineParameterNames.AUTHOR, String.class); parameterTypes.put(ReportEngineParameterNames.TITLE, String.class); + parameterTypes.put(ReportEngineParameterNames.MAXROWS, Integer.class); enumerationValues = new HashNMap(); enumerationValues.add(CONTENT_TYPE, diff --git a/reportbuilder/java/com/sun/star/report/pentaho/PentahoReportJob.java b/reportbuilder/java/com/sun/star/report/pentaho/PentahoReportJob.java index f64c1bd7d741..e3b5b268ea43 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/PentahoReportJob.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/PentahoReportJob.java @@ -60,9 +60,6 @@ import org.pentaho.reporting.libraries.formula.lvalues.LValue; import org.pentaho.reporting.libraries.formula.lvalues.Term; import org.pentaho.reporting.libraries.formula.parser.FormulaParser; import org.pentaho.reporting.libraries.formula.parser.ParseException; -import org.pentaho.reporting.libraries.formula.DefaultFormulaContext; -import org.pentaho.reporting.libraries.formula.function.FunctionCategory; -import org.pentaho.reporting.libraries.formula.function.FunctionRegistry; import org.jfree.report.expressions.Expression; import org.jfree.report.expressions.FormulaExpression; import org.jfree.report.flow.DefaultReportJob; @@ -96,6 +93,7 @@ public class PentahoReportJob implements ReportJob private final ReportJobDefinition definition; private final List masterValues; private final List detailColumns; + private final Integer maxRows; public ReportJobDefinition getDefinition() { @@ -147,6 +145,7 @@ public class PentahoReportJob implements ReportJob this.masterValues = (ArrayList) jobProperties.getProperty(ReportEngineParameterNames.INPUT_MASTER_VALUES); this.detailColumns = (ArrayList) jobProperties.getProperty(ReportEngineParameterNames.INPUT_DETAIL_COLUMNS); + this.maxRows = (Integer) jobProperties.getProperty(ReportEngineParameterNames.MAXROWS); this.resourceManager = new ResourceManager(); this.resourceManager.registerDefaults(); @@ -241,6 +240,8 @@ public class PentahoReportJob implements ReportJob { final OfficeGroup group = (OfficeGroup) node; final FormulaExpression exp = (FormulaExpression) group.getGroupingExpression(); + if ( exp == null ) + continue; try { @@ -343,11 +344,13 @@ public class PentahoReportJob implements ReportJob final String escapeProcessing = (String) officeReport.getAttribute(OfficeNamespaces.OOREPORT_NS, SDBCReportDataFactory.ESCAPE_PROCESSING); report.setQuery(command); parameters.put(SDBCReportDataFactory.COMMAND_TYPE, commandType); - parameters.put(SDBCReportDataFactory.ESCAPE_PROCESSING,new Boolean(!("false".equals(escapeProcessing)))); + parameters.put(SDBCReportDataFactory.ESCAPE_PROCESSING,Boolean.valueOf(!("false".equals(escapeProcessing)))); final String filter = (String) officeReport.getAttribute(OfficeNamespaces.OOREPORT_NS, "filter"); parameters.put(SDBCReportDataFactory.UNO_FILTER, filter); + parameters.put(ReportEngineParameterNames.MAXROWS, report.getJobProperties().getProperty(ReportEngineParameterNames.MAXROWS)); + final long startTime = System.currentTimeMillis(); final ReportProcessor rp = getProcessorForContentType(contentType); rp.processReport(job); diff --git a/reportbuilder/java/com/sun/star/report/pentaho/SOFormulaOpCodeMapper.java b/reportbuilder/java/com/sun/star/report/pentaho/SOFormulaOpCodeMapper.java index a225c93a749d..30c9711dce05 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/SOFormulaOpCodeMapper.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/SOFormulaOpCodeMapper.java @@ -44,16 +44,14 @@ public final class SOFormulaOpCodeMapper extends WeakBase implements com.sun.star.sheet.XFormulaOpCodeMapper, XServiceInfo { - private final XComponentContext m_xContext; private static final String __serviceName = "com.sun.star.report.pentaho.SOFormulaOpCodeMapper"; private final SOFormulaParser parser; // attributes final private int m_OpCodeExternal = 0; final private int m_OpCodeUnknown = 0; - public SOFormulaOpCodeMapper(XComponentContext context, SOFormulaParser parser) + public SOFormulaOpCodeMapper(SOFormulaParser parser) { - m_xContext = context; this.parser = parser; } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/SOFormulaParser.java b/reportbuilder/java/com/sun/star/report/pentaho/SOFormulaParser.java index 1a8d02d53b64..a5fe1ab5c61f 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/SOFormulaParser.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/SOFormulaParser.java @@ -82,9 +82,9 @@ public final class SOFormulaParser extends ComponentBase private final Map parserAllOpCodes = new HashMap(); private final Map parserNames = new HashMap(); private final Map[] groupOpCodes = new HashMap[5]; - private final Vector specialOpCodes = new Vector(); + private final List specialOpCodes = new ArrayList(); - public Vector getSpecialOpCodes() + public List getSpecialOpCodes() { return specialOpCodes; } @@ -92,7 +92,7 @@ public final class SOFormulaParser extends ComponentBase private final FormulaOpCodeMapEntry opCodePush; private final FormulaParser parser; - public SOFormulaParser(XComponentContext context) + public SOFormulaParser(final XComponentContext context) { m_xContext = context; @@ -131,7 +131,6 @@ public final class SOFormulaParser extends ComponentBase addOpCodes(names, opCodes, ARRAY_SEPARATORS, false); opCodes = mapper.getAvailableMappings(FormulaLanguage.ODFF, FormulaMapGroup.SPECIAL); - names = new String[opCodes.length]; for (int i = 0; i < opCodes.length; i++) { @@ -179,9 +178,9 @@ public final class SOFormulaParser extends ComponentBase final String upper = token.image.toUpperCase(); if ( parserNames.containsKey(upper) ) { - if ( token.image.equals("(")) + if ( "(".equals(token.image)) brackets++; - else if ( token.image.equals(")")) + else if ( ")".equals(token.image)) --brackets; final FormulaOpCodeMapEntry opCode = (FormulaOpCodeMapEntry) parserNames.get(upper); formulaToken = opCode.Token; @@ -237,8 +236,7 @@ public final class SOFormulaParser extends ComponentBase { } } - FormulaToken[] ret = (FormulaToken[]) tokens.toArray(new FormulaToken[tokens.size()]); - return ret; + return (FormulaToken[]) tokens.toArray(new FormulaToken[tokens.size()]); } public String printFormula(com.sun.star.sheet.FormulaToken[] aTokens) @@ -345,7 +343,7 @@ public final class SOFormulaParser extends ComponentBase { if ( formulaOpCodeMapper == null ) { - formulaOpCodeMapper = new SOFormulaOpCodeMapper(m_xContext, this); + formulaOpCodeMapper = new SOFormulaOpCodeMapper(this); } return formulaOpCodeMapper; @@ -384,12 +382,12 @@ public final class SOFormulaParser extends ComponentBase } } - final public Map getNames() + public Map getNames() { return parserNames; } - final public Map getGroup(int group) + public Map getGroup(int group) { return groupOpCodes[group]; } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/SOFunctionManager.java b/reportbuilder/java/com/sun/star/report/pentaho/SOFunctionManager.java index 059aed34796a..333441f8b2b5 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/SOFunctionManager.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/SOFunctionManager.java @@ -31,8 +31,6 @@ package com.sun.star.report.pentaho; import com.sun.star.container.NoSuchElementException; -import com.sun.star.lang.IndexOutOfBoundsException; -import com.sun.star.lang.WrappedTargetException; import com.sun.star.lang.XServiceInfo; import com.sun.star.report.meta.XFunctionDescription; import com.sun.star.uno.XComponentContext; @@ -43,9 +41,6 @@ import org.pentaho.reporting.libraries.formula.DefaultFormulaContext; import org.pentaho.reporting.libraries.formula.function.FunctionCategory; import org.pentaho.reporting.libraries.formula.function.FunctionDescription; import org.pentaho.reporting.libraries.formula.function.FunctionRegistry; -import org.pentaho.reporting.libraries.formula.lvalues.LValue; -import org.pentaho.reporting.libraries.formula.parser.FormulaParser; -import org.pentaho.reporting.libraries.formula.parser.ParseException; /** * This class capsulates the class, that implements the minimal component, a factory for creating the service @@ -150,31 +145,6 @@ public final class SOFunctionManager extends ComponentBase implements XFunctionM return new StarFunctionCategory(defaultContext,m_xContext, functionRegistry, position, categories[position]); } - public int getFunctionStartAtIndex(String formula, int position) - { - int nStartPos = -1; - try - { - final FormulaParser parser = new FormulaParser(); - final LValue x = parser.parse(formula); - String part = x.toString(); - while ( part.length() < position ) - { - final LValue[] children = x.getChildValues(); - if ( children != null ) - { - for(int i = 0; i < children.length;++i) - { - part = children[i].toString(); - } - } - } - } catch ( ParseException ex ) - { - } - return nStartPos; - } - public XFunctionDescription getFunctionByName(String arg0) throws NoSuchElementException { final FunctionDescription func = functionRegistry.getMetaData(arg0); @@ -188,7 +158,7 @@ public final class SOFunctionManager extends ComponentBase implements XFunctionM } try { - return new StarFunctionDescription(defaultContext, m_xContext, getCategory(i), functionRegistry, func); + return new StarFunctionDescription(defaultContext, m_xContext, getCategory(i), func); } catch ( Exception ex ) { diff --git a/reportbuilder/java/com/sun/star/report/pentaho/SOReportJobFactory.java b/reportbuilder/java/com/sun/star/report/pentaho/SOReportJobFactory.java index cda541184968..1acf2c846bcb 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/SOReportJobFactory.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/SOReportJobFactory.java @@ -174,9 +174,9 @@ public class SOReportJobFactory try { simpleReg.open(path, true, false); - XRegistryKey xRegistryRootKey = simpleReg.getRootKey(); + final XRegistryKey xRegistryRootKey = simpleReg.getRootKey(); // read locale - XRegistryKey locale = xRegistryRootKey.openKey(value); + final XRegistryKey locale = xRegistryRootKey.openKey(value); if ( locale != null ) { final String newLocale = locale.getStringValue(); @@ -205,7 +205,7 @@ public class SOReportJobFactory Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader()); try { - XSimpleRegistry simpleReg = (XSimpleRegistry) UnoRuntime.queryInterface(XSimpleRegistry.class, + final XSimpleRegistry simpleReg = (XSimpleRegistry) UnoRuntime.queryInterface(XSimpleRegistry.class, m_cmpCtx.getServiceManager().createInstanceWithContext("com.sun.star.configuration.ConfigurationRegistry", m_cmpCtx)); String currentLocale = getLocaleFromRegistry(simpleReg,"org.openoffice.Setup","L10N/ooSetupSystemLocale"); @@ -242,6 +242,7 @@ public class SOReportJobFactory String mimetype = null; String author = null; String title = null; + Integer maxRows = null; for ( int i = 0; i < namedValue.length; ++i ) { @@ -270,6 +271,10 @@ public class SOReportJobFactory { mimetype = (String) aProps.Value; } + else if ( "MaxRows".equalsIgnoreCase(aProps.Name) ) + { + maxRows = (Integer) aProps.Value; + } else if ( ReportEngineParameterNames.AUTHOR.equalsIgnoreCase(aProps.Name) ) { author = (String) aProps.Value; @@ -324,6 +329,7 @@ public class SOReportJobFactory procParms.setProperty(ReportEngineParameterNames.INPUT_DATASOURCE_FACTORY, dataFactory); procParms.setProperty(ReportEngineParameterNames.IMAGE_SERVICE, new SOImageService(m_cmpCtx)); procParms.setProperty(ReportEngineParameterNames.INPUT_REPORTJOB_FACTORY, this); + procParms.setProperty(ReportEngineParameterNames.MAXROWS, maxRows); if ( author != null ) { procParms.setProperty(ReportEngineParameterNames.AUTHOR, author); diff --git a/reportbuilder/java/com/sun/star/report/pentaho/StarFunctionCategory.java b/reportbuilder/java/com/sun/star/report/pentaho/StarFunctionCategory.java index 9c98f42eb6eb..19b041715acf 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/StarFunctionCategory.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/StarFunctionCategory.java @@ -156,7 +156,7 @@ public final class StarFunctionCategory extends WeakBase { if ( position >= functions.length ) throw new IndexOutOfBoundsException(); - return new StarFunctionDescription(defaultContext,m_xContext,this,functionRegistry,functionRegistry.getMetaData(functions[position])); + return new StarFunctionDescription(defaultContext,m_xContext,this,functionRegistry.getMetaData(functions[position])); } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/StarFunctionDescription.java b/reportbuilder/java/com/sun/star/report/pentaho/StarFunctionDescription.java index bca8ad026b19..df19a3f06174 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/StarFunctionDescription.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/StarFunctionDescription.java @@ -51,11 +51,10 @@ public final class StarFunctionDescription extends WeakBase // attributes // final private com.sun.star.report.meta.XFunctionCategory m_Category; private final FunctionDescription functionDescription; - private final FunctionRegistry functionRegistry; private final XFunctionCategory category; private final Locale defaultLocale; - public StarFunctionDescription(final DefaultFormulaContext defaultContext, final XComponentContext context, final XFunctionCategory category, final FunctionRegistry functionRegistry, final FunctionDescription functionDescription) + public StarFunctionDescription(final DefaultFormulaContext defaultContext, final XComponentContext context, final XFunctionCategory category, final FunctionDescription functionDescription) { m_xContext = context; this.category = category; @@ -71,7 +70,6 @@ public final class StarFunctionDescription extends WeakBase this.defaultLocale = locale; this.functionDescription = functionDescription; - this.functionRegistry = functionRegistry; // use the last parameter of the PropertySetMixin constructor // for your optional attributes if necessary. See the documentation // of the PropertySetMixin helper for further information. @@ -137,14 +135,14 @@ public final class StarFunctionDescription extends WeakBase { final int count = functionDescription.getParameterCount(); final StringBuffer signature = new StringBuffer(getName()); - signature.append("("); + signature.append('('); for (int i = 0; i < count; i++) { signature.append(functionDescription.getParameterDisplayName(i, defaultLocale)); if ( i != (count - 1) ) - signature.append(";"); + signature.append(';'); } - signature.append(")"); + signature.append(')'); return signature.toString(); } @@ -176,16 +174,16 @@ public final class StarFunctionDescription extends WeakBase throw new com.sun.star.lang.IllegalArgumentException(); final StringBuffer formula = new StringBuffer(getName()); - formula.append("("); + formula.append('('); for (int i = 0; i < arguments.length; ++i) { if ( arguments[i].length() == 0 ) break; formula.append(arguments[i]); if ( i < (arguments.length - 1) && arguments[i+1].length() != 0 ) - formula.append(";"); + formula.append(';'); } - formula.append(")"); + formula.append(')'); return formula.toString(); } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FormatValueUtility.java b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FormatValueUtility.java index 4eea93329cb4..e6f27564b519 100755 --- a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FormatValueUtility.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FormatValueUtility.java @@ -43,6 +43,8 @@ import org.jfree.report.data.DefaultDataFlags; import org.jfree.report.expressions.FormulaExpression; import org.jfree.report.flow.FlowController; import org.jfree.report.flow.layoutprocessor.LayoutControllerUtil; +import org.pentaho.reporting.libraries.formula.util.DateUtil; +import org.pentaho.reporting.libraries.formula.util.HSSFDateUtil; /** * Creation-Date: 06.06.2007, 17:03:30 @@ -100,13 +102,21 @@ public class FormatValueUtility return ret; } - public static void applyValueForCell(final Object value, final AttributeMap variableSection) + public static void applyValueForCell(final Object value, final AttributeMap variableSection,final String valueType) { - if (value instanceof Date) + if (value instanceof Date ) { - variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, "date-value", formatDate((Date) value)); + if ( "date".equals(valueType) ) + { + variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, "date-value", formatDate((Date) value)); + } + else + { + variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, "value", String.valueOf(HSSFDateUtil.getExcelDate((Date)value))); + } + } - else if (value instanceof Number) + else if (value instanceof Number ) { variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, "value", String.valueOf(value)); } @@ -123,7 +133,24 @@ public class FormatValueUtility } else if (value != null) { - variableSection.setAttribute(OfficeNamespaces.OFFICE_NS,STRING_VALUE, String.valueOf(value)); + try + { + final Float number = Float.valueOf(String.valueOf(value)); + applyValueForCell(number,variableSection,valueType); + return; + } + catch(NumberFormatException e) + { + + } + if ( !"string".equals(valueType)) + { + variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, "value", String.valueOf(value)); + } + else + { + variableSection.setAttribute(OfficeNamespaces.OFFICE_NS,STRING_VALUE, String.valueOf(value)); + } } else { diff --git a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/ImageElementLayoutController.java b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/ImageElementLayoutController.java index 8cd296151005..68d1fc6351c4 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/ImageElementLayoutController.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/ImageElementLayoutController.java @@ -85,20 +85,20 @@ public class ImageElementLayoutController // A static image is easy. At least at this level. Dont ask about the weird things we have to do in the // output targets ... final String linkTarget = imageElement.getImageData(); - generateImage(target, linkTarget, imageElement.isScale(), imageElement.isPreserveIRI()); + generateImage(target, linkTarget, imageElement.getScaleMode(), imageElement.isPreserveIRI()); } else { final Object value = LayoutControllerUtil.evaluateExpression(getFlowController(), imageElement, formulaExpression); - generateImage(target, value, imageElement.isScale(), imageElement.isPreserveIRI()); + generateImage(target, value, imageElement.getScaleMode(), imageElement.isPreserveIRI()); } return join(getFlowController()); } private void generateImage(final ReportTarget target, final Object linkTarget, - final boolean scale, + final String scale, final boolean preserveIri) throws ReportProcessingException, DataSourceException { @@ -110,7 +110,7 @@ public class ImageElementLayoutController final AttributeMap image = new AttributeMap(); image.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, Element.NAMESPACE_ATTRIBUTE, JFreeReportInfo.REPORT_NAMESPACE); image.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, Element.TYPE_ATTRIBUTE, OfficeToken.IMAGE); - image.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, OfficeToken.SCALE, String.valueOf(scale)); + image.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, OfficeToken.SCALE, scale); image.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, OfficeToken.PRESERVE_IRI, String.valueOf(preserveIri)); image.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, "image-context", createContext()); image.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, OfficeToken.IMAGE_DATA, linkTarget); diff --git a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/ObjectOleLayoutController.java b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/ObjectOleLayoutController.java index 97e4332217a9..54f4fd0b1acb 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/ObjectOleLayoutController.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/ObjectOleLayoutController.java @@ -30,7 +30,6 @@ package com.sun.star.report.pentaho.layoutprocessor; import com.sun.star.report.SDBCReportDataFactory; -import com.sun.star.report.pentaho.OfficeNamespaces; import com.sun.star.report.OfficeToken; import com.sun.star.report.pentaho.model.ObjectOleElement; import java.util.ArrayList; diff --git a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/OfficeGroupInstanceSectionLayoutController.java b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/OfficeGroupInstanceSectionLayoutController.java index 8a3779cebe03..d61f03eb319e 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/OfficeGroupInstanceSectionLayoutController.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/OfficeGroupInstanceSectionLayoutController.java @@ -152,7 +152,7 @@ public class OfficeGroupInstanceSectionLayoutController extends SectionLayoutCon throws DataSourceException { final AttributeMap map = new AttributeMap( super.computeAttributes(fc, element, target) ); - map.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, "iteration-count", new Integer(getIterationCount())); + map.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, "iteration-count", Integer.valueOf(getIterationCount())); map.makeReadOnly(); return map; } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/OfficeGroupLayoutController.java b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/OfficeGroupLayoutController.java index 78180c7dc9cb..25e12d17edab 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/OfficeGroupLayoutController.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/OfficeGroupLayoutController.java @@ -185,7 +185,7 @@ public class OfficeGroupLayoutController extends SectionLayoutController { if (lc instanceof OfficeGroupLayoutController) { - count += 1; + count++; } lc = lc.getParent(); } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/TableCellLayoutController.java b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/TableCellLayoutController.java index daacce47aa48..44117380e176 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/TableCellLayoutController.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/TableCellLayoutController.java @@ -70,6 +70,7 @@ public class TableCellLayoutController extends SectionLayoutController { final AttributeMap attributeMap = new AttributeMap(super.computeAttributes(fc, element, target)); final String definedStyle = (String) attributeMap.getAttribute(OfficeNamespaces.TABLE_NS, OfficeToken.STYLE_NAME); + final String valueType = (String) attributeMap.getAttribute(OfficeNamespaces.OFFICE_NS, FormatValueUtility.VALUE_TYPE); attributeMap.setAttribute(OfficeNamespaces.TABLE_NS, OfficeToken.STYLE_NAME, getDisplayStyleName((Section) element, definedStyle)); try @@ -77,7 +78,7 @@ public class TableCellLayoutController extends SectionLayoutController final DataFlags value = computeValue(); if (value != null) { - FormatValueUtility.applyValueForCell(value.getValue(), attributeMap); + FormatValueUtility.applyValueForCell(value.getValue(), attributeMap,valueType); } } catch (Exception e) diff --git a/reportbuilder/java/com/sun/star/report/pentaho/makefile.mk b/reportbuilder/java/com/sun/star/report/pentaho/makefile.mk index 5d448a6bc2be..36e83afac2d0 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/makefile.mk +++ b/reportbuilder/java/com/sun/star/report/pentaho/makefile.mk @@ -103,18 +103,18 @@ CUSTOMMANIFESTFILE = Manifest.mf $(JARTARGETN) : $(COMP) $(PROPERTYFILES) $(CSSFILES) $(XSDFILES) $(TXTFILES) $(XMLFILES) .ENDIF # "$(JARTARGETN)"!="" -fix_system_libs: +fix_system_libs: $(JARMANIFEST) @echo "Fix Java Class-Path entry for libraries from system." .IF ("$(SYSTEM_JFREEREPORT)" != "YES" && "$(SYSTEM_APACHE_COMMONS)" == "YES") @$(SED) -r -e "s#commons-logging-1.1.1.jar#file://$(COMMONS_LOGGING_JAR)#" \ - -i ../../../../../../$(INPATH)/class/sun-report-builder/META-INF/MANIFEST.MF + -i $< .ENDIF .IF ("$(SYSTEM_JFREEREPORT)" == "YES" && "$(SYSTEM_APACHE_COMMONS)" == "YES") @$(SED) '/flute/,/sac/d' -i ../../../../../../$(INPATH)/class/sun-report-builder/META-INF/MANIFEST.MF @$(SED) -r -e "s#^Class-Path.*#\0\n file://$(LIBBASE_JAR)\n file://$(SAC_JAR)\n file://$(LIBXML_JAR)\n\ file://$(FLUTE_JAR)\n file://$(JFREEREPORT_JAR)\n file://$(LIBLAYOUT_JAR)\n file://$(LIBLOADER_JAR)\n file://$(LIBFORMULA_JAR)\n\ file://$(LIBREPOSITORY_JAR)\n file://$(LIBFONTS_JAR)\n file://$(LIBSERIALIZER_JAR)\n file://$(COMMONS_LOGGING_JAR)#" \ - -i ../../../../../../$(INPATH)/class/sun-report-builder/META-INF/MANIFEST.MF + -i $< .ENDIF $(CLASSDIR)$/$(PACKAGE)$/%.properties : %.properties diff --git a/reportbuilder/java/com/sun/star/report/pentaho/model/ImageElement.java b/reportbuilder/java/com/sun/star/report/pentaho/model/ImageElement.java index 45e11580cd8f..195c569a3028 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/model/ImageElement.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/model/ImageElement.java @@ -59,15 +59,16 @@ public class ImageElement extends ReportElement this.formula = formula; } - public boolean isScale() - { - return OfficeToken.TRUE.equals(getAttribute(OfficeNamespaces.OOREPORT_NS, OfficeToken.SCALE)); - } - public void setScale(final boolean scale) - { - setAttribute(OfficeNamespaces.OOREPORT_NS, OfficeToken.SCALE, String.valueOf(scale)); - } + public String getScaleMode() + { + String val = (String)getAttribute(OfficeNamespaces.OOREPORT_NS, OfficeToken.SCALE); + if ( OfficeToken.TRUE.equals(val) ) + val = OfficeToken.ANISOTROPIC; + else if ( OfficeToken.FALSE.equals(val) || val == null ) + val = OfficeToken.NONE; + return val; + } public boolean isPreserveIRI() { diff --git a/reportbuilder/java/com/sun/star/report/pentaho/output/ImageProducer.java b/reportbuilder/java/com/sun/star/report/pentaho/output/ImageProducer.java index 9866d1a41c5e..af34c5ed5a00 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/output/ImageProducer.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/output/ImageProducer.java @@ -38,6 +38,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.MalformedURLException; +import java.net.URISyntaxException; import java.net.URL; import java.net.URLConnection; import java.sql.Blob; @@ -50,7 +51,10 @@ import com.sun.star.report.OutputRepository; import com.sun.star.report.ImageService; import com.sun.star.report.ReportExecutionException; import com.sun.star.report.pentaho.DefaultNameGenerator; +import java.net.URI; import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.jfree.layouting.input.style.values.CSSNumericType; @@ -347,7 +351,7 @@ public class ImageProducer final CSSNumericValue widthVal = CSSNumericValue.createValue(CSSNumericType.MM, dims.getWidth() / 100.0); final CSSNumericValue heightVal = CSSNumericValue.createValue(CSSNumericType.MM, dims.getHeight() / 100.0); - final String filename = copyToOutputRepository(mimeType, source, data); + final String filename = copyToOutputRepository(mimeType, data); final OfficeImage officeImage = new OfficeImage(filename, widthVal, heightVal); imageCache.put(source, officeImage); return officeImage; @@ -371,7 +375,17 @@ public class ImageProducer private OfficeImage produceFromURL(final URL url, final boolean preserveIRI) { - final OfficeImage o = (OfficeImage) imageCache.get(url); + final String urlString = url.toString(); + URI uri = null; + try + { + uri = new URI(urlString); + } + catch ( URISyntaxException ex ) + { + Logger.getLogger(ImageProducer.class.getName()).log(Level.SEVERE, null, ex); + } + final OfficeImage o = (OfficeImage) imageCache.get(uri); if (o != null) { return o; @@ -398,15 +412,14 @@ public class ImageProducer if (preserveIRI) { - final OfficeImage retval = new OfficeImage(url.toString(), widthVal, heightVal); - imageCache.put(url, retval); + final OfficeImage retval = new OfficeImage(urlString, widthVal, heightVal); + imageCache.put(uri, retval); return retval; } - final String file = url.getFile(); - final String name = copyToOutputRepository(mimeType, file, data); + final String name = copyToOutputRepository(mimeType, data); final OfficeImage officeImage = new OfficeImage(name, widthVal, heightVal); - imageCache.put(url, officeImage); + imageCache.put(uri, officeImage); return officeImage; } catch (IOException e) @@ -420,8 +433,8 @@ public class ImageProducer if (!preserveIRI) { - final OfficeImage image = new OfficeImage(url.toString(), null, null); - imageCache.put(url, image); + final OfficeImage image = new OfficeImage(urlString, null, null); + imageCache.put(uri, image); return image; } @@ -429,7 +442,7 @@ public class ImageProducer return null; } - private String copyToOutputRepository(final String urlMimeType, final String file, final byte[] data) + private String copyToOutputRepository(final String urlMimeType, final byte[] data) throws IOException, ReportExecutionException { final String mimeType; diff --git a/reportbuilder/java/com/sun/star/report/pentaho/output/OfficeDocumentReportTarget.java b/reportbuilder/java/com/sun/star/report/pentaho/output/OfficeDocumentReportTarget.java index e9b6f8da882c..42fef8d10f45 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/output/OfficeDocumentReportTarget.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/output/OfficeDocumentReportTarget.java @@ -43,7 +43,7 @@ import java.util.Iterator; import java.util.Map; import java.util.zip.DeflaterOutputStream; import java.util.zip.InflaterInputStream; - +import com.sun.star.report.ReportEngineParameterNames; import com.sun.star.report.ImageService; import com.sun.star.report.InputRepository; import com.sun.star.report.OutputRepository; @@ -65,6 +65,7 @@ import org.apache.commons.logging.LogFactory; import org.jfree.layouting.input.style.parser.CSSValueFactory; import org.jfree.layouting.input.style.parser.StyleSheetParserUtil; import org.jfree.layouting.input.style.values.CSSNumericValue; +import org.jfree.layouting.input.style.values.CSSNumericType; import org.jfree.layouting.layouter.style.CSSValueResolverUtility; import org.jfree.layouting.namespace.NamespaceDefinition; import org.jfree.layouting.namespace.Namespaces; @@ -300,7 +301,7 @@ public abstract class OfficeDocumentReportTarget extends AbstractReportTarget this.imageNames = new AttributeNameGenerator(); this.imageProducer = new ImageProducer(inputRepository, outputRepository, imageService); - this.oleProducer = new OleProducer(inputRepository, outputRepository, imageService, datasourcefactory); + this.oleProducer = new OleProducer(inputRepository, outputRepository, imageService, datasourcefactory,(Integer)reportJob.getParameters().get(ReportEngineParameterNames.MAXROWS)); try { @@ -1121,7 +1122,7 @@ public abstract class OfficeDocumentReportTarget extends AbstractReportTarget } catch (IOException ioe) { - throw new ReportProcessingException("Unable to create the buffer"); + throw new ReportProcessingException("Unable to create the buffer",ioe); } } @@ -1152,8 +1153,9 @@ public abstract class OfficeDocumentReportTarget extends AbstractReportTarget return null; } - protected AttributeList buildAttributeList(final AttributeMap attrs) + protected AttributeList buildAttributeList(final AttributeMap attrs) { + final String elementType = ReportTargetUtil.getElemenTypeFromAttribute(attrs); final AttributeList attrList = new AttributeList(); final String[] namespaces = attrs.getNameSpaces(); for (int i = 0; i < namespaces.length; i++) @@ -1179,7 +1181,8 @@ public abstract class OfficeDocumentReportTarget extends AbstractReportTarget tableNameGenerator.generateName(saneName)); } else if (OfficeNamespaces.DRAWING_NS.equals(attrNamespace) && - "name".equals(key)) + "name".equals(key) && + !"equation".equals(elementType) ) { final String objectName = String.valueOf(entry.getValue()); attrList.setAttribute(attrNamespace, key, @@ -1284,6 +1287,9 @@ public abstract class OfficeDocumentReportTarget extends AbstractReportTarget CSSNumericValue imageAreaWidthVal; CSSNumericValue imageAreaHeightVal; + CSSNumericValue posX = CSSNumericValue.createValue(CSSNumericType.CM, 0.0); + CSSNumericValue posY = CSSNumericValue.createValue(CSSNumericType.CM, 0.0); + String styleName = null; if (imageContext != null) { @@ -1303,8 +1309,8 @@ public abstract class OfficeDocumentReportTarget extends AbstractReportTarget final CSSNumericValue normalizedImageHeight = CSSValueResolverUtility.convertLength(height, imageAreaHeightVal.getType()); - final boolean scale = OfficeToken.TRUE.equals(attrs.getAttribute(JFreeReportInfo.REPORT_NAMESPACE, OfficeToken.SCALE)); - if (!scale && normalizedImageWidth.getValue() > 0 && normalizedImageHeight.getValue() > 0) + final String scale = (String)attrs.getAttribute(JFreeReportInfo.REPORT_NAMESPACE, OfficeToken.SCALE); + if ( OfficeToken.NONE.equals(scale) && normalizedImageWidth.getValue() > 0 && normalizedImageHeight.getValue() > 0) { final double clipWidth = normalizedImageWidth.getValue() - imageAreaWidthVal.getValue(); final double clipHeight = normalizedImageHeight.getValue() - imageAreaHeightVal.getValue(); @@ -1373,6 +1379,16 @@ public abstract class OfficeDocumentReportTarget extends AbstractReportTarget imageAreaHeightVal = normalizedImageHeight; } } + else if ( OfficeToken.ISOTROPIC.equals(scale) ) + { + final double[] ret = calcPaintSize(imageAreaWidthVal,imageAreaHeightVal,normalizedImageWidth,normalizedImageHeight); + + posX = CSSNumericValue.createValue(imageAreaWidthVal.getType(),( imageAreaWidthVal.getValue() - ret[0]) * 0.5); + posY = CSSNumericValue.createValue(imageAreaHeightVal.getType(),( imageAreaHeightVal.getValue() - ret[1]) * 0.5); + + imageAreaWidthVal = CSSNumericValue.createValue(imageAreaWidthVal.getType(),ret[0]); + imageAreaHeightVal = CSSNumericValue.createValue(imageAreaHeightVal.getType(),ret[1]); + } } // If we do scale, then we simply use the given image-area-size as valid image size and dont // care about the image itself .. @@ -1393,8 +1409,9 @@ public abstract class OfficeDocumentReportTarget extends AbstractReportTarget } frameList.setAttribute(OfficeNamespaces.TEXT_NS, "anchor-type", OfficeToken.PARAGRAPH); frameList.setAttribute(OfficeNamespaces.SVG_NS, "z-index", "0"); - frameList.setAttribute(OfficeNamespaces.SVG_NS, "x", ZERO_CM); - frameList.setAttribute(OfficeNamespaces.SVG_NS, "y", ZERO_CM); + frameList.setAttribute(OfficeNamespaces.SVG_NS, "x", posX.getValue() + posX.getType().getType()); + frameList.setAttribute(OfficeNamespaces.SVG_NS, "y", posY.getValue() + posY.getType().getType()); + LOGGER.debug("Image " + imageData + " A-Width: " + imageAreaWidthVal + ", A-Height: " + imageAreaHeightVal); @@ -1635,7 +1652,28 @@ public abstract class OfficeDocumentReportTarget extends AbstractReportTarget { throw new ReportProcessingException(FAILED, ioe); } + } + static private double[] calcPaintSize( final CSSNumericValue areaWidth, final CSSNumericValue areaHeight, + final CSSNumericValue imageWidth, final CSSNumericValue imageHeight) + { + final double ratioX = areaWidth.getValue() / imageWidth.getValue(); + final double ratioY = areaHeight.getValue() / imageHeight.getValue(); + final double ratioMin = Math.min( ratioX, ratioY ); + double[] ret = new double[2]; + ret[0] = imageWidth.getValue() * ratioMin; + ret[1] = imageHeight.getValue() * ratioMin; + return ret; + } + protected void writeNullDate() throws IOException + { + // write NULL DATE + final XmlWriter xmlWriter = getXmlWriter(); + xmlWriter.writeTag(OfficeNamespaces.TABLE_NS, "calculation-settings", null, XmlWriterSupport.OPEN); + final AttributeMap nullDateAttributes = new AttributeMap(); + nullDateAttributes.setAttribute(OfficeNamespaces.TABLE_NS, "date-value", "1900-01-01"); + xmlWriter.writeTag(OfficeNamespaces.TABLE_NS, "null-date", buildAttributeList(nullDateAttributes), XmlWriterSupport.CLOSE); + xmlWriter.writeCloseTag(); } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/output/OleProducer.java b/reportbuilder/java/com/sun/star/report/pentaho/output/OleProducer.java index cc4b466fae31..36dffa290da1 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/output/OleProducer.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/output/OleProducer.java @@ -57,10 +57,11 @@ public class OleProducer { private final DefaultNameGenerator nameGenerator; private final DataSourceFactory dataSourceFactory; private final ImageService imageService; + private final Integer maxRows; public OleProducer(final InputRepository inputRepository, - final OutputRepository outputRepository,final ImageService imageService,final DataSourceFactory dataSourceFactory) { + final OutputRepository outputRepository,final ImageService imageService,final DataSourceFactory dataSourceFactory,final Integer maxRows) { if (inputRepository == null) { throw new NullPointerException(); } @@ -73,6 +74,7 @@ public class OleProducer { this.nameGenerator = new DefaultNameGenerator(outputRepository); this.dataSourceFactory = dataSourceFactory; this.imageService = imageService; + this.maxRows = maxRows; } String produceOle(final String source,final List masterColumns,final List masterValues,final List detailColumns) { @@ -99,6 +101,7 @@ public class OleProducer { procParms.setProperty(ReportEngineParameterNames.INPUT_MASTER_VALUES, masterValues); procParms.setProperty(ReportEngineParameterNames.INPUT_DETAIL_COLUMNS, detailColumns); procParms.setProperty(ReportEngineParameterNames.IMAGE_SERVICE, imageService); + procParms.setProperty(ReportEngineParameterNames.MAXROWS, maxRows); engine.createJob(definition).execute(); } catch (ReportExecutionException ex) { diff --git a/reportbuilder/java/com/sun/star/report/pentaho/output/chart/ChartRawReportTarget.java b/reportbuilder/java/com/sun/star/report/pentaho/output/chart/ChartRawReportTarget.java index 56a2c036f2e8..9328be4fd031 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/output/chart/ChartRawReportTarget.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/output/chart/ChartRawReportTarget.java @@ -101,6 +101,7 @@ public class ChartRawReportTarget extends OfficeDocumentReportTarget tableCount = 0; final XmlWriter xmlWriter = getXmlWriter(); xmlWriter.writeTag(OfficeNamespaces.OFFICE_NS, getStartContent(), null, XmlWriterSupport.OPEN); + writeNullDate(); ++closeTags; } @@ -280,7 +281,7 @@ public class ChartRawReportTarget extends OfficeDocumentReportTarget } catch (IOException ioe) { - throw new ReportProcessingException("Failed to write settings document"); + throw new ReportProcessingException("Failed to write settings document",ioe); } } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/output/spreadsheet/SpreadsheetRawReportTarget.java b/reportbuilder/java/com/sun/star/report/pentaho/output/spreadsheet/SpreadsheetRawReportTarget.java index 2b764f371fc1..3be3c523662e 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/output/spreadsheet/SpreadsheetRawReportTarget.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/output/spreadsheet/SpreadsheetRawReportTarget.java @@ -81,6 +81,17 @@ import org.pentaho.reporting.libraries.xmlns.writer.XmlWriterSupport; public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget { + private static final String[] FOPROPS = new String[] + { + "letter-spacing", "font-variant", "text-transform" + }; + private static final String NUMBERCOLUMNSSPANNED = "number-columns-spanned"; + private static final String[] STYLEPROPS = new String[] + { + "text-combine", "font-pitch-complex", "text-rotation-angle", "font-name", "text-blinking", "letter-kerning", "text-combine-start-char", "text-combine-end-char", "text-position", "text-scale" + }; + private static final int CELL_WIDTH_FACTOR = 10000; + private static final String TRANSPARENT = "transparent"; private boolean paragraphFound = false; private boolean paragraphHandled = false; @@ -93,9 +104,9 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget { private final Set tableIndices; - private final float boundary; + private final long boundary; - private ColumnBoundary(final float boundary) + private ColumnBoundary(final long boundary) { this.tableIndices = new HashSet(); this.boundary = boundary; @@ -119,13 +130,13 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget public int compareTo(final Object arg0) { - if (arg0.equals(this)) + if ( arg0.equals(this) ) { return 0; } - if (arg0 instanceof ColumnBoundary) + if ( arg0 instanceof ColumnBoundary ) { - if (boundary > ((ColumnBoundary) arg0).boundary) + if ( boundary > ((ColumnBoundary) arg0).boundary ) { return 1; } @@ -139,38 +150,45 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget public boolean equals(final Object obj) { - if (obj instanceof ColumnBoundary) + if ( obj instanceof ColumnBoundary ) { return ((ColumnBoundary) obj).boundary == boundary; } return false; } + + public int hashCode() + { + assert false : "hashCode not designed"; + return 42; // any arbitrary constant will do + } } private String tableBackgroundColor; // null means transparent ... - private static final ColumnBoundary[] EMPTY_COLBOUNDS = new ColumnBoundary[0]; + private static final ColumnBoundary[] EMPTY_COLBOUNDS = new ColumnBoundary[ 0 ]; private boolean elementBoundaryCollectionPass; private boolean oleHandled; private final List columnBoundaryList; - private float currentRowBoundaryMarker; + private long currentRowBoundaryMarker; private ColumnBoundary[] sortedBoundaryArray; private ColumnBoundary[] boundariesForTableArray; private int tableCounter; private int columnCounter; private int columnSpanCounter; + private int currentSpan = 0; private String unitsOfMeasure; - final private ArrayList shapes; - final private ArrayList ole; - final private ArrayList rowHeights; + final private List shapes; + final private List ole; + final private List rowHeights; public SpreadsheetRawReportTarget(final ReportJob reportJob, - final ResourceManager resourceManager, - final ResourceKey baseResource, - final InputRepository inputRepository, - final OutputRepository outputRepository, - final String target, - final ImageService imageService, - final DataSourceFactory dataSourceFactory) - throws ReportProcessingException + final ResourceManager resourceManager, + final ResourceKey baseResource, + final InputRepository inputRepository, + final OutputRepository outputRepository, + final String target, + final ImageService imageService, + final DataSourceFactory dataSourceFactory) + throws ReportProcessingException { super(reportJob, resourceManager, baseResource, inputRepository, outputRepository, target, imageService, dataSourceFactory); columnBoundaryList = new ArrayList(); @@ -183,9 +201,9 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget public void startOther(final AttributeMap attrs) throws DataSourceException, ReportProcessingException { - if (ReportTargetUtil.isElementOfType(JFreeReportInfo.REPORT_NAMESPACE, OfficeToken.OBJECT_OLE, attrs)) + if ( ReportTargetUtil.isElementOfType(JFreeReportInfo.REPORT_NAMESPACE, OfficeToken.OBJECT_OLE, attrs) ) { - if (isElementBoundaryCollectionPass() && getCurrentRole() != ROLE_TEMPLATE) + if ( isElementBoundaryCollectionPass() && getCurrentRole() != ROLE_TEMPLATE ) { ole.add(attrs); } @@ -193,27 +211,27 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget return; } final String namespace = ReportTargetUtil.getNamespaceFromAttribute(attrs); - if (isRepeatingSection() || isFilteredNamespace(namespace)) + if ( isRepeatingSection() || isFilteredNamespace(namespace) ) { return; } final String elementType = ReportTargetUtil.getElemenTypeFromAttribute(attrs); - if (OfficeNamespaces.TEXT_NS.equals(namespace) && OfficeToken.P.equals(elementType) && !paragraphHandled) + if ( OfficeNamespaces.TEXT_NS.equals(namespace) && OfficeToken.P.equals(elementType) && !paragraphHandled ) { paragraphFound = true; return; } - if (OfficeNamespaces.DRAWING_NS.equals(namespace) && OfficeToken.FRAME.equals(elementType)) + if ( OfficeNamespaces.DRAWING_NS.equals(namespace) && OfficeToken.FRAME.equals(elementType) ) { - if (isElementBoundaryCollectionPass() && getCurrentRole() != ROLE_TEMPLATE) + if ( isElementBoundaryCollectionPass() && getCurrentRole() != ROLE_TEMPLATE ) { final LengthCalculator len = new LengthCalculator(); - for (int i = 0; i < rowHeights.size(); i++) + for ( int i = 0; i < rowHeights.size(); i++ ) { len.add((CSSNumericValue) rowHeights.get(i)); - // val += ((CSSNumericValue)rowHeights.get(i)).getValue(); + // val += ((CSSNumericValue)rowHeights.get(i)).getValue(); } rowHeights.clear(); @@ -221,7 +239,7 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget rowHeights.add(currentRowHeight); attrs.setAttribute(OfficeNamespaces.DRAWING_NS, "z-index", String.valueOf(shapes.size())); final String y = (String) attrs.getAttribute(OfficeNamespaces.SVG_NS, "y"); - if (y != null) + if ( y != null ) { len.add(parseLength(y)); final CSSNumericValue currentY = len.getResult(); @@ -231,9 +249,9 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget } return; } - if (oleHandled) + if ( oleHandled ) { - if (isElementBoundaryCollectionPass() && getCurrentRole() != ROLE_TEMPLATE) + if ( isElementBoundaryCollectionPass() && getCurrentRole() != ROLE_TEMPLATE ) { ole.add(attrs); } @@ -241,14 +259,14 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget } // if this is the report namespace, write out a table definition .. - if (OfficeNamespaces.TABLE_NS.equals(namespace) && OfficeToken.TABLE.equals(elementType)) + if ( OfficeNamespaces.TABLE_NS.equals(namespace) && OfficeToken.TABLE.equals(elementType) ) { // whenever we see a new table, we increment our tableCounter // this is used to keep tracked of the boundary conditions per table tableCounter++; } - if (isElementBoundaryCollectionPass()) + if ( isElementBoundaryCollectionPass() ) { collectBoundaryForElement(attrs); } @@ -259,7 +277,7 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget { processElement(attrs, namespace, elementType); } - catch (IOException e) + catch ( IOException e ) { throw new ReportProcessingException("Failed", e); } @@ -268,13 +286,12 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget protected void startReportSection(final AttributeMap attrs, final int role) throws IOException, DataSourceException, ReportProcessingException { - if ((role == OfficeDocumentReportTarget.ROLE_SPREADSHEET_PAGE_HEADER || - role == OfficeDocumentReportTarget.ROLE_SPREADSHEET_PAGE_FOOTER) && - (!PageSection.isPrintWithReportHeader(attrs) || - !PageSection.isPrintWithReportFooter(attrs))) + if ( (role == OfficeDocumentReportTarget.ROLE_SPREADSHEET_PAGE_HEADER || + role == OfficeDocumentReportTarget.ROLE_SPREADSHEET_PAGE_FOOTER ) && + (!PageSection.isPrintWithReportHeader(attrs) || + !PageSection.isPrintWithReportFooter(attrs)) ) { startBuffering(new OfficeStylesCollection(), true); - } else { @@ -284,10 +301,10 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget protected void endReportSection(final AttributeMap attrs, final int role) throws IOException, DataSourceException, ReportProcessingException { - if ((role == OfficeDocumentReportTarget.ROLE_SPREADSHEET_PAGE_HEADER || - role == OfficeDocumentReportTarget.ROLE_SPREADSHEET_PAGE_FOOTER) && - (!PageSection.isPrintWithReportHeader(attrs) || - !PageSection.isPrintWithReportFooter(attrs))) + if ( (role == OfficeDocumentReportTarget.ROLE_SPREADSHEET_PAGE_HEADER || + role == OfficeDocumentReportTarget.ROLE_SPREADSHEET_PAGE_FOOTER) && + (!PageSection.isPrintWithReportHeader(attrs) || + !PageSection.isPrintWithReportFooter(attrs)) ) { finishBuffering(); } @@ -299,7 +316,7 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget private void handleParagraph() { - if (paragraphFound) + if ( paragraphFound ) { try { @@ -308,7 +325,7 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget paragraphHandled = true; paragraphFound = false; } - catch (IOException ex) + catch ( IOException ex ) { LOGGER.error("ReportProcessing failed", ex); } @@ -316,26 +333,25 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget } private void processElement(final AttributeMap attrs, final String namespace, final String elementType) - throws IOException, ReportProcessingException + throws IOException, ReportProcessingException { final XmlWriter xmlWriter = getXmlWriter(); - final AttributeMap retval = new AttributeMap(attrs); - if (ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, OfficeToken.TABLE, attrs)) + if ( ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, OfficeToken.TABLE, attrs) ) { // a new table means we must clear our "calculated" table boundary array cache boundariesForTableArray = null; final String tableStyle = (String) attrs.getAttribute(OfficeNamespaces.TABLE_NS, OfficeToken.STYLE_NAME); - if (tableStyle == null) + if ( tableStyle == null ) { tableBackgroundColor = null; } else { final Object raw = StyleUtilities.queryStyle(getPredefinedStylesCollection(), OfficeToken.TABLE, tableStyle, - "table-properties", OfficeNamespaces.FO_NS, OfficeToken.BACKGROUND_COLOR); - if (raw == null || "transparent".equals(raw)) + "table-properties", OfficeNamespaces.FO_NS, OfficeToken.BACKGROUND_COLOR); + if ( raw == null || TRANSPARENT.equals(raw) ) { tableBackgroundColor = null; } @@ -347,29 +363,29 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget return; } - if (ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, OfficeToken.TABLE_COLUMN, attrs) || - ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, OfficeToken.TABLE_COLUMNS, attrs)) + if ( ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, OfficeToken.TABLE_COLUMN, attrs) || + ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, OfficeToken.TABLE_COLUMNS, attrs) ) { return; } // covered-table-cell elements may appear in the input from row or column spans. In the event that we hit a // column-span we simply ignore these elements because we are going to adjust the span to fit the uniform table. - if (ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, OfficeToken.COVERED_TABLE_CELL, attrs)) + if ( ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, OfficeToken.COVERED_TABLE_CELL, attrs) ) { - if (columnSpanCounter > 0) + if ( columnSpanCounter > 0 ) { columnSpanCounter--; } - if (columnSpanCounter == 0) + if ( columnSpanCounter == 0 ) { // if we weren't expecting a covered-table-cell, let's use it, it's probably from a row-span columnCounter++; final int span = getColumnSpanForCell(tableCounter, columnCounter, 1); // use the calculated span for the column in the uniform table to create any additional covered-table-cell // elements - for (int i = 0; i < span; i++) + for ( int i = 0; i < span; i++ ) { xmlWriter.writeTag(namespace, OfficeToken.COVERED_TABLE_CELL, null, XmlWriter.CLOSE); } @@ -377,17 +393,17 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget return; } - if (ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, OfficeToken.TABLE_ROW, attrs)) + if ( ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, OfficeToken.TABLE_ROW, attrs) ) { // a new row means our column counter gets reset columnCounter = 0; // Lets make sure the color of the table is ok .. - if (tableBackgroundColor != null) + if ( tableBackgroundColor != null ) { final String styleName = (String) attrs.getAttribute(OfficeNamespaces.TABLE_NS, OfficeToken.STYLE_NAME); final OfficeStyle style = deriveStyle(OfficeToken.TABLE_ROW, styleName); Element tableRowProperties = style.getTableRowProperties(); - if (tableRowProperties == null) + if ( tableRowProperties == null ) { tableRowProperties = new Section(); tableRowProperties.setNamespace(OfficeNamespaces.STYLE_NS); @@ -398,44 +414,59 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget else { final Object oldValue = tableRowProperties.getAttribute(OfficeNamespaces.FO_NS, OfficeToken.BACKGROUND_COLOR); - if (oldValue == null || "transparent".equals(oldValue)) + if ( oldValue == null || TRANSPARENT.equals(oldValue) ) { tableRowProperties.setAttribute(OfficeNamespaces.FO_NS, OfficeToken.BACKGROUND_COLOR, tableBackgroundColor); } } - retval.setAttribute(OfficeNamespaces.TABLE_NS, OfficeToken.STYLE_NAME, style.getStyleName()); + attrs.setAttribute(OfficeNamespaces.TABLE_NS, OfficeToken.STYLE_NAME, style.getStyleName()); } } - else if (ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, OfficeToken.TABLE_CELL, attrs)) + else if ( ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, OfficeToken.TABLE_CELL, attrs) ) { columnCounter++; final String styleName = (String) attrs.getAttribute(OfficeNamespaces.TABLE_NS, OfficeToken.STYLE_NAME); - if (styleName != null) + if ( styleName != null ) { final OfficeStyle cellStyle = getPredefinedStylesCollection().getStyle(OfficeToken.TABLE_CELL, styleName); - if (cellStyle != null) + if ( cellStyle != null ) { - final Element props = cellStyle.getTableCellProperties(); - if (props != null) + final Section textProperties = (Section) cellStyle.getTextProperties(); + if ( textProperties != null ) + { + for ( String i : FOPROPS ) + { + textProperties.setAttribute(OfficeNamespaces.FO_NS, i, null); + } + textProperties.setAttribute(OfficeNamespaces.TEXT_NS, "display", null); + for ( String i : STYLEPROPS ) + { + textProperties.setAttribute(OfficeNamespaces.STYLE_NS, i, null); + } + } + final Section props = (Section) cellStyle.getTableCellProperties(); + if ( props != null ) { final Object raw = props.getAttribute(OfficeNamespaces.FO_NS, OfficeToken.BACKGROUND_COLOR); - if (raw == null || "transparent".equals(raw)) + if ( TRANSPARENT.equals(raw) ) { - cellStyle.removeNode(props); + props.setAttribute(OfficeNamespaces.FO_NS, OfficeToken.BACKGROUND_COLOR, null); + // cellStyle.removeNode(props); } } } + attrs.setAttribute(OfficeNamespaces.TABLE_NS, OfficeToken.STYLE_NAME, styleName); } - final String numColSpanStr = (String) attrs.getAttribute(namespace, "number-columns-spanned"); + final String numColSpanStr = (String) attrs.getAttribute(namespace,NUMBERCOLUMNSSPANNED); int initialColumnSpan = columnSpanCounter = 1; - if (numColSpanStr != null) + if ( numColSpanStr != null ) { initialColumnSpan = Integer.parseInt(numColSpanStr); columnSpanCounter = initialColumnSpan; } final int span = getColumnSpanForCell(tableCounter, columnCounter, initialColumnSpan); - if (initialColumnSpan > 1) + if ( initialColumnSpan > 1 ) { // add the initial column span to our column counter index (subtract 1, since it is counted by default) columnCounter += initialColumnSpan - 1; @@ -455,41 +486,42 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget // } // there's no point to create number-columns-spanned attributes if we only span 1 column - if (span > 1) + if ( span > 1 ) { - retval.setAttribute(namespace, "number-columns-spanned", "" + span); + attrs.setAttribute(namespace,NUMBERCOLUMNSSPANNED, "" + span); + currentSpan = span; } - // we must also generate "covered-table-cell" elements for each column spanned - // but we'll do this in the endElement, after we close this OfficeToken.TABLE_CELL + // we must also generate "covered-table-cell" elements for each column spanned + // but we'll do this in the endElement, after we close this OfficeToken.TABLE_CELL } // All styles have to be processed or you will loose the paragraph-styles and inline text-styles. // .. - performStyleProcessing(retval); + performStyleProcessing(attrs); - final AttributeList attrList = buildAttributeList(retval); + final AttributeList attrList = buildAttributeList(attrs); xmlWriter.writeTag(namespace, elementType, attrList, XmlWriter.OPEN); - // System.out.println("elementType = " + elementType); + // System.out.println("elementType = " + elementType); } private void collectBoundaryForElement(final AttributeMap attrs) { - if (ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, OfficeToken.TABLE_COLUMNS, attrs)) + if ( ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, OfficeToken.TABLE_COLUMNS, attrs) ) { // A table row resets the column counter. resetCurrentRowBoundaryMarker(); } - else if (ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, OfficeToken.TABLE_COLUMN, attrs)) + else if ( ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, OfficeToken.TABLE_COLUMN, attrs) ) { final String styleName = (String) attrs.getAttribute(OfficeNamespaces.TABLE_NS, OfficeToken.STYLE_NAME); - if (styleName == null) + if ( styleName == null ) { // This should not happen, but if it does, we will ignore that cell. return; } final OfficeStyle style = getPredefinedStylesCollection().getStyle(OfficeToken.TABLE_COLUMN, styleName); - if (style == null) + if ( style == null ) { // Now this is very bad. It means that there is no style defined with the given name. return; @@ -498,11 +530,12 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget final Element tableColumnProperties = style.getTableColumnProperties(); String widthStr = (String) tableColumnProperties.getAttribute("column-width"); widthStr = widthStr.substring(0, widthStr.indexOf(getUnitsOfMeasure(widthStr))); - addColumnWidthToRowBoundaryMarker(Float.parseFloat(widthStr)); + final float val = Float.parseFloat(widthStr) * CELL_WIDTH_FACTOR; + addColumnWidthToRowBoundaryMarker((long) val); ColumnBoundary currentRowBoundary = new ColumnBoundary(getCurrentRowBoundaryMarker()); final List columnBoundaryList_ = getColumnBoundaryList(); final int idx = columnBoundaryList_.indexOf(currentRowBoundary); - if (idx == -1) + if ( idx == -1 ) { columnBoundaryList_.add(currentRowBoundary); } @@ -516,9 +549,9 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget private String getUnitsOfMeasure(final String str) { - if (unitsOfMeasure == null || "".equals(unitsOfMeasure)) + if ( unitsOfMeasure == null || "".equals(unitsOfMeasure) ) { - if (str == null || "".equals(str)) + if ( str == null || "".equals(str) ) { unitsOfMeasure = "cm"; return unitsOfMeasure; @@ -526,10 +559,10 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget // build units of measure, set it int i = str.length() - 1; - for (; i >= 0; i--) + for ( ; i >= 0; i-- ) { final char c = str.charAt(i); - if (Character.isDigit(c) || c == '.' || c == ',') + if ( Character.isDigit(c) || c == '.' || c == ',' ) { break; } @@ -541,7 +574,7 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget private void createTableShapes() throws ReportProcessingException { - if (!shapes.isEmpty()) + if ( !shapes.isEmpty() ) { try { @@ -554,7 +587,7 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget xmlWriter.writeTag(OfficeNamespaces.TABLE_NS, OfficeToken.SHAPES, null, XmlWriterSupport.OPEN); - for (int i = 0; i < shapes.size(); i++) + for ( int i = 0; i < shapes.size(); i++ ) { final AttributeMap attrs = (AttributeMap) shapes.get(i); final AttributeList attrList = buildAttributeList(attrs); @@ -566,7 +599,7 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget } xmlWriter.writeCloseTag(); } - catch (IOException e) + catch ( IOException e ) { throw new ReportProcessingException("Failed", e); } @@ -589,14 +622,15 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget // blow away current column styles // start processing at i=1 because we added a boundary for "0" which is virtual final ColumnBoundary[] cba = getSortedColumnBoundaryArray(); - for (int i = 1; i < cba.length; i++) + for ( int i = 1; i < cba.length; i++ ) { final ColumnBoundary cb = cba[i]; float columnWidth = cb.getBoundary(); - if (i > 1) + if ( i > 1 ) { columnWidth -= cba[i - 1].getBoundary(); } + columnWidth = columnWidth / CELL_WIDTH_FACTOR; final OfficeStyle style = deriveStyle(OfficeToken.TABLE_COLUMN, ("co" + i + "_")); final Section tableColumnProperties = new Section(); tableColumnProperties.setType("table-column-properties"); @@ -610,7 +644,7 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget } xmlWriter.writeCloseTag(); } - catch (IOException e) + catch ( IOException e ) { throw new ReportProcessingException("Failed", e); } @@ -618,46 +652,46 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget protected void endOther(final AttributeMap attrs) throws DataSourceException, ReportProcessingException { - if (ReportTargetUtil.isElementOfType(JFreeReportInfo.REPORT_NAMESPACE, OfficeToken.OBJECT_OLE, attrs) || oleHandled) + if ( ReportTargetUtil.isElementOfType(JFreeReportInfo.REPORT_NAMESPACE, OfficeToken.OBJECT_OLE, attrs) || oleHandled ) { oleHandled = false; return; } - if (ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, OfficeToken.TABLE_ROW, attrs) && isElementBoundaryCollectionPass() && getCurrentRole() != ROLE_TEMPLATE) + if ( ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, OfficeToken.TABLE_ROW, attrs) && isElementBoundaryCollectionPass() && getCurrentRole() != ROLE_TEMPLATE ) { final String styleName = (String) attrs.getAttribute(OfficeNamespaces.TABLE_NS, OfficeToken.STYLE_NAME); rowHeights.add(computeRowHeight(styleName)); } - if (isRepeatingSection() || isElementBoundaryCollectionPass()) + if ( isRepeatingSection() || isElementBoundaryCollectionPass() ) { return; } final String namespace = ReportTargetUtil.getNamespaceFromAttribute(attrs); - if (isFilteredNamespace(namespace)) + if ( isFilteredNamespace(namespace) ) { return; } final String elementType = ReportTargetUtil.getElemenTypeFromAttribute(attrs); - if (OfficeNamespaces.DRAWING_NS.equals(namespace) && OfficeToken.FRAME.equals(elementType)) + if ( OfficeNamespaces.DRAWING_NS.equals(namespace) && OfficeToken.FRAME.equals(elementType) ) { return; } // if this is the report namespace, write out a table definition .. - if (OfficeNamespaces.TABLE_NS.equals(namespace) && (OfficeToken.TABLE.equals(elementType) || - OfficeToken.COVERED_TABLE_CELL.equals(elementType) || - OfficeToken.TABLE_COLUMN.equals(elementType) || - OfficeToken.TABLE_COLUMNS.equals(elementType))) + if ( OfficeNamespaces.TABLE_NS.equals(namespace) && (OfficeToken.TABLE.equals(elementType) || + OfficeToken.COVERED_TABLE_CELL.equals(elementType) || + OfficeToken.TABLE_COLUMN.equals(elementType) || + OfficeToken.TABLE_COLUMNS.equals(elementType)) ) { return; } - if ( !paragraphHandled && OfficeNamespaces.TEXT_NS.equals(namespace) && OfficeToken.P.equals(elementType)) + if ( !paragraphHandled && OfficeNamespaces.TEXT_NS.equals(namespace) && OfficeToken.P.equals(elementType) ) { - if (!paragraphHandled) + if ( !paragraphHandled ) { return; } @@ -672,7 +706,7 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget // 'covered-table-cell' elements we need to generate generateCoveredTableCells(attrs); } - catch (IOException e) + catch ( IOException e ) { throw new ReportProcessingException("Failed", e); } @@ -680,16 +714,18 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget private void generateCoveredTableCells(final AttributeMap attrs) throws IOException { - if (!ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, OfficeToken.TABLE_CELL, attrs)) + if ( !ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, OfficeToken.TABLE_CELL, attrs) ) { return; } // do this after we close the tag final XmlWriter xmlWriter = getXmlWriter(); - final Object attribute = attrs.getAttribute(OfficeNamespaces.TABLE_NS, "number-columns-spanned"); - final int span = TextUtilities.parseInt((String) attribute, 0); - for (int i = 1; i < span; i++) + // final Object attribute = attrs.getAttribute(OfficeNamespaces.TABLE_NS,NUMBERCOLUMNSSPANNED); + // final int span = TextUtilities.parseInt((String) attribute, 0); + final int span = currentSpan; + currentSpan = 0; + for ( int i = 1; i < span; i++ ) { xmlWriter.writeTag(OfficeNamespaces.TABLE_NS, OfficeToken.COVERED_TABLE_CELL, null, XmlWriter.CLOSE); } @@ -703,7 +739,7 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget // ///////////////////////////////////////////////////////////////////////// public void processText(final String text) throws DataSourceException, ReportProcessingException { - if (!(isRepeatingSection() || isElementBoundaryCollectionPass())) + if ( !(isRepeatingSection() || isElementBoundaryCollectionPass()) ) { handleParagraph(); super.processText(text); @@ -712,7 +748,7 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget public void processContent(final DataFlags value) throws DataSourceException, ReportProcessingException { - if (!(isRepeatingSection() || isElementBoundaryCollectionPass())) + if ( !(isRepeatingSection() || isElementBoundaryCollectionPass()) ) { handleParagraph(); super.processContent(value); @@ -725,13 +761,15 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget } protected void startContent(final AttributeMap attrs) throws IOException, DataSourceException, - ReportProcessingException + ReportProcessingException { - if (!isElementBoundaryCollectionPass()) + if ( !isElementBoundaryCollectionPass() ) { final XmlWriter xmlWriter = getXmlWriter(); xmlWriter.writeTag(OfficeNamespaces.OFFICE_NS, getStartContent(), null, XmlWriterSupport.OPEN); + writeNullDate(); + final AttributeMap tableAttributes = new AttributeMap(); tableAttributes.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, Element.NAMESPACE_ATTRIBUTE, OfficeNamespaces.TABLE_NS); tableAttributes.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, Element.TYPE_ATTRIBUTE, OfficeToken.TABLE); @@ -750,7 +788,7 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget { final OfficeStylesCollection predefStyles = getPredefinedStylesCollection(); final OfficeStyles commonStyles = predefStyles.getAutomaticStyles(); - if (!commonStyles.containsStyle(OfficeToken.TABLE, "Initial_Table")) + if ( !commonStyles.containsStyle(OfficeToken.TABLE, "Initial_Table") ) { final String masterPageName = createMasterPage(); @@ -759,7 +797,7 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget tableStyle.setStyleName("Initial_Table"); tableStyle.setAttribute(OfficeNamespaces.STYLE_NS, "master-page-name", masterPageName); final Element tableProperties = produceFirstChild(tableStyle, OfficeNamespaces.STYLE_NS, "table-properties"); - tableProperties.setAttribute(OfficeNamespaces.FO_NS, OfficeToken.BACKGROUND_COLOR, "transparent"); + tableProperties.setAttribute(OfficeNamespaces.FO_NS, OfficeToken.BACKGROUND_COLOR,TRANSPARENT); commonStyles.addStyle(tableStyle); } return "Initial_Table"; @@ -770,13 +808,13 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget final OfficeStylesCollection predefStyles = getPredefinedStylesCollection(); final MasterPageFactory masterPageFactory = new MasterPageFactory(predefStyles.getMasterStyles()); final OfficeMasterPage masterPage; - if (!masterPageFactory.containsMasterPage("Standard", null, null)) + if ( !masterPageFactory.containsMasterPage("Standard", null, null) ) { masterPage = masterPageFactory.createMasterPage("Standard", null, null); final CSSNumericValue zeroLength = CSSNumericValue.createValue(CSSNumericType.CM, 0); final String pageLayoutTemplate = masterPage.getPageLayout(); - if (pageLayoutTemplate == null) + if ( pageLayoutTemplate == null ) { // there is no pagelayout. Create one .. final String derivedLayout = masterPageFactory.createPageStyle(getGlobalStylesCollection().getAutomaticStyles(), zeroLength, zeroLength); @@ -785,8 +823,8 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget else { final String derivedLayout = masterPageFactory.derivePageStyle(pageLayoutTemplate, - getPredefinedStylesCollection().getAutomaticStyles(), - getGlobalStylesCollection().getAutomaticStyles(), zeroLength, zeroLength); + getPredefinedStylesCollection().getAutomaticStyles(), + getGlobalStylesCollection().getAutomaticStyles(), zeroLength, zeroLength); masterPage.setPageLayout(derivedLayout); } @@ -802,10 +840,10 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget } protected void endContent(final AttributeMap attrs) throws IOException, DataSourceException, - ReportProcessingException + ReportProcessingException { // todo - if (!isElementBoundaryCollectionPass()) + if ( !isElementBoundaryCollectionPass() ) { final XmlWriter xmlWriter = getXmlWriter(); xmlWriter.writeCloseTag(); @@ -833,7 +871,7 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget private ColumnBoundary[] getSortedColumnBoundaryArray() { - if (sortedBoundaryArray == null) + if ( sortedBoundaryArray == null ) { getColumnBoundaryList().add(new ColumnBoundary(0)); sortedBoundaryArray = (ColumnBoundary[]) getColumnBoundaryList().toArray(EMPTY_COLBOUNDS); @@ -847,12 +885,12 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget return columnBoundaryList; } - private void addColumnWidthToRowBoundaryMarker(final float width) + private void addColumnWidthToRowBoundaryMarker(final long width) { currentRowBoundaryMarker += width; } - private float getCurrentRowBoundaryMarker() + private long getCurrentRowBoundaryMarker() { return currentRowBoundaryMarker; } @@ -869,14 +907,14 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget private ColumnBoundary[] getBoundariesForTable(final int table) { - if (boundariesForTableArray == null) + if ( boundariesForTableArray == null ) { final List boundariesForTable = new ArrayList(); final List boundaryList = getColumnBoundaryList(); - for (int i = 0; i < boundaryList.size(); i++) + for ( int i = 0; i < boundaryList.size(); i++ ) { final ColumnBoundary b = (ColumnBoundary) boundaryList.get(i); - if (b.isContainedByTable(table)) + if ( b.isContainedByTable(table) ) { boundariesForTable.add(b); } @@ -897,12 +935,12 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget float cellBoundary = tableBoundaries[col - 1].getBoundary(); float cellWidth = tableBoundaries[col - 1].getBoundary(); - if (col > 1) + if ( col > 1 ) { cellWidth = cellWidth - tableBoundaries[col - 2].getBoundary(); } - if (initialColumnSpan > 1) + if ( initialColumnSpan > 1 ) { // ok we've got some additional spanning specified on the input final int index = (col - 1) + (initialColumnSpan - 1); @@ -912,21 +950,21 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget int beginBoundaryIndex = 0; int endBoundaryIndex = globalBoundaries.length - 1; - for (int i = 0; i < globalBoundaries.length; i++) + for ( int i = 0; i < globalBoundaries.length; i++ ) { // find beginning boundary - if (globalBoundaries[i].getBoundary() <= cellBoundary - cellWidth) + if ( globalBoundaries[i].getBoundary() <= cellBoundary - cellWidth ) { beginBoundaryIndex = i; } - if (globalBoundaries[i].getBoundary() <= cellBoundary) + if ( globalBoundaries[i].getBoundary() <= cellBoundary ) { endBoundaryIndex = i; } } final int span = endBoundaryIndex - beginBoundaryIndex; // span will be zero for the first column, so we adjust it to 1 - if (span == 0) + if ( span == 0 ) { return 1; } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/output/text/MasterPageFactory.java b/reportbuilder/java/com/sun/star/report/pentaho/output/text/MasterPageFactory.java index 48879bf8ce2b..0a5988a44b94 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/output/text/MasterPageFactory.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/output/text/MasterPageFactory.java @@ -265,7 +265,7 @@ public class MasterPageFactory } catch (CloneNotSupportedException cne) { - throw new IllegalStateException("Implementation error: Unable to derive page"); + throw new IllegalStateException("Implementation error: Unable to derive page",cne); } } @@ -403,7 +403,7 @@ public class MasterPageFactory } catch (CloneNotSupportedException e) { - throw new IllegalStateException("Clone failed."); + throw new IllegalStateException("Clone failed.",e); } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/output/text/PageContext.java b/reportbuilder/java/com/sun/star/report/pentaho/output/text/PageContext.java index fdd82694cae3..88c2742c91d5 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/output/text/PageContext.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/output/text/PageContext.java @@ -208,17 +208,8 @@ public class PageContext } final StringBuffer b = new StringBuffer(); - - PageContext pc = this; - while (pc != null) - { - final String header_ = pc.getHeader(); - if (header_ != null) - { - b.append(header_); - } - pc = pc.getParent(); - } + b.append(parent.getPageHeaderContent()); + b.append(getHeader()); if (b.length() != 0) { diff --git a/reportbuilder/java/com/sun/star/report/pentaho/output/text/TextRawReportTarget.java b/reportbuilder/java/com/sun/star/report/pentaho/output/text/TextRawReportTarget.java index 28999ebac793..6ce89c5c0324 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/output/text/TextRawReportTarget.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/output/text/TextRawReportTarget.java @@ -96,7 +96,6 @@ public class TextRawReportTarget extends OfficeDocumentReportTarget private static final String VARIABLES_HIDDEN_STYLE_WITH_KEEPWNEXT = "variables_paragraph_with_next"; private static final String VARIABLES_HIDDEN_STYLE_WITHOUT_KEEPWNEXT = "variables_paragraph_without_next"; private static final int TABLE_LAYOUT_VARIABLES_PARAGRAPH = 0; - private static final int TABLE_LAYOUT_VARIABLES_IN_FIRST_CELL = 1; private static final int TABLE_LAYOUT_SINGLE_DETAIL_TABLE = 2; private static final int CP_SETUP = 0; private static final int CP_FIRST_TABLE = 1; @@ -132,7 +131,6 @@ public class TextRawReportTarget extends OfficeDocumentReportTarget private final int tableLayoutConfig; private int expectedTableRowCount; private boolean firstCellSeen; - private boolean cellEmpty; public TextRawReportTarget(final ReportJob reportJob, final ResourceManager resourceManager, @@ -543,6 +541,8 @@ public class TextRawReportTarget extends OfficeDocumentReportTarget final XmlWriter xmlWriter = getXmlWriter(); xmlWriter.writeTag(OfficeNamespaces.OFFICE_NS, "text", null, XmlWriterSupport.OPEN); + writeNullDate(); + // now start the buffering. We have to insert the variables declaration // later .. startBuffering(getStylesCollection(), true); @@ -646,11 +646,6 @@ public class TextRawReportTarget extends OfficeDocumentReportTarget variables = null; } - if (isTableNS && ObjectUtilities.equal(OfficeToken.TABLE_CELL, elementType)) - { - cellEmpty = true; - } - final boolean keepTogetherOnParagraph = true; if (keepTogetherOnParagraph) @@ -658,7 +653,6 @@ public class TextRawReportTarget extends OfficeDocumentReportTarget if (ReportTargetUtil.isElementOfType(OfficeNamespaces.TEXT_NS, OfficeToken.P, attrs)) { final int keepTogetherState = getCurrentContext().getKeepTogether(); - cellEmpty = false; if (!firstCellSeen && (sectionKeepTogether || keepTogetherState == PageContext.KEEP_TOGETHER_GROUP)) { OfficeStyle style = null; @@ -740,15 +734,12 @@ public class TextRawReportTarget extends OfficeDocumentReportTarget final AttributeList attrList = buildAttributeList(attrs); xmlWriter.writeTag(namespace, elementType, attrList, XmlWriterSupport.OPEN); - if (ReportTargetUtil.isElementOfType(OfficeNamespaces.TEXT_NS, OfficeToken.P, attrs)) + if (ReportTargetUtil.isElementOfType(OfficeNamespaces.TEXT_NS, OfficeToken.P, attrs) && + tableLayoutConfig != TABLE_LAYOUT_VARIABLES_PARAGRAPH && variables != null) { - cellEmpty = false; - if (tableLayoutConfig != TABLE_LAYOUT_VARIABLES_PARAGRAPH && variables != null) - { - //LOGGER.debug("Variables-Section in existing cell " + variables); - xmlWriter.writeText(variables); - variables = null; - } + //LOGGER.debug("Variables-Section in existing cell " + variables); + xmlWriter.writeText(variables); + variables = null; } } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/StyleMapper.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/StyleMapper.java index c3c8013b3fff..f29d0b0abad5 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/parser/StyleMapper.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/StyleMapper.java @@ -35,7 +35,7 @@ import org.jfree.layouting.input.style.CSSDeclarationRule; public interface StyleMapper { - public void updateStyle (final String uri, + void updateStyle (final String uri, final String attrName, final String attrValue, final CSSDeclarationRule targetRule); diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/rpt/ConditionalPrintExpressionReadHandler.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/rpt/ConditionalPrintExpressionReadHandler.java index 4367f4a78c1d..7378637bae15 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/parser/rpt/ConditionalPrintExpressionReadHandler.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/rpt/ConditionalPrintExpressionReadHandler.java @@ -51,10 +51,6 @@ public class ConditionalPrintExpressionReadHandler public ConditionalPrintExpressionReadHandler(final Element element) { - if (element == null) - { - throw new NullPointerException(); - } this.element = element; } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/rpt/GroupReadHandler.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/rpt/GroupReadHandler.java index 2364eb212f9d..55ed4759c6be 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/parser/rpt/GroupReadHandler.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/rpt/GroupReadHandler.java @@ -79,7 +79,7 @@ public class GroupReadHandler extends ElementReadHandler super.startParsing(attrs); final String groupExpr = attrs.getValue(OfficeNamespaces.OOREPORT_NS, "group-expression"); - if (groupExpr != null) + if ( groupExpr != null && !"".equals(groupExpr) ) { final FormulaExpression function = new FormulaExpression(); function.setFormula(groupExpr); diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/fo/BackgroundColorMapper.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/fo/BackgroundColorMapper.java index a0f6c4e217ad..a2ca9ca9e496 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/fo/BackgroundColorMapper.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/fo/BackgroundColorMapper.java @@ -38,10 +38,6 @@ import org.jfree.layouting.util.ColorUtil; public class BackgroundColorMapper implements StyleMapper { - public BackgroundColorMapper() - { - } - public void updateStyle(final String uri, final String attrName, final String attrValue, diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/fo/BorderRightMapper.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/fo/BorderRightMapper.java index b668301c3603..14b9f4dd5b3b 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/fo/BorderRightMapper.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/fo/BorderRightMapper.java @@ -47,11 +47,6 @@ import org.jfree.layouting.input.style.CSSDeclarationRule; public class BorderRightMapper implements StyleMapper { - /** Creates a new instance of BorderRightMapper */ - public BorderRightMapper() - { - } - public void updateStyle(final String uri, final String attrName, final String attrValue, diff --git a/reportbuilder/java/com/sun/star/report/util/ReportUtil.java b/reportbuilder/java/com/sun/star/report/util/ReportUtil.java index b82a25a7a060..e2b3602e19fb 100644 --- a/reportbuilder/java/com/sun/star/report/util/ReportUtil.java +++ b/reportbuilder/java/com/sun/star/report/util/ReportUtil.java @@ -27,7 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - package com.sun.star.report.util; import org.pentaho.reporting.libraries.base.util.ObjectUtilities; @@ -36,9 +35,14 @@ import org.pentaho.reporting.libraries.base.util.ObjectUtilities; * * @author Ocke Janssen */ -public class ReportUtil { +public class ReportUtil +{ + + private ReportUtil() + { + } - public static boolean equalString(final String uri,final String uri2) + public static boolean equalString(final String uri, final String uri2) { return ObjectUtilities.equal(uri, uri2); } diff --git a/reportbuilder/registry/data/org/openoffice/Office/UI/DbReportWindowState.xcu b/reportbuilder/registry/data/org/openoffice/Office/UI/DbReportWindowState.xcu index 2a31839f8a84..7dba5df7901e 100644 --- a/reportbuilder/registry/data/org/openoffice/Office/UI/DbReportWindowState.xcu +++ b/reportbuilder/registry/data/org/openoffice/Office/UI/DbReportWindowState.xcu @@ -66,10 +66,7 @@ true - - - true - + -- cgit