diff options
author | Kurt Zenker <kz@openoffice.org> | 2009-06-05 09:47:55 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2009-06-05 09:47:55 +0000 |
commit | f69c97860cc62e2aad46e9cfb68a643817e8ad4a (patch) | |
tree | 28dd9434276da5b6d415359de4676f3d89b5f824 /extensions | |
parent | 62cd9aa9be35282c94bd140998b182bfdac7c325 (diff) |
CWS-TOOLING: integrate CWS dba32b
2009-06-03 14:58:08 +0200 fs r272581 : #i102439#
2009-05-29 13:56:18 +0200 fs r272456 : remove the sub form when the 'add subform' setting changes from <true/> to <false/>, not only its controls
2009-05-29 13:19:27 +0200 fs r272454 : display '(Default)' instead of an empty string when a control has the default font
2009-05-28 20:49:18 +0200 fs r272428 : #i98162# getFirstSelectedValue: do not return reference to a temporary
2009-05-27 15:30:22 +0200 msc r272353 : #102303#
2009-05-26 13:03:06 +0200 fs r272295 : spelling
2009-05-26 12:59:54 +0200 fs r272294 : merge m48 version to get latest cygwin related fixes
2009-05-25 14:02:06 +0200 fs r272239 : remove references to local files, needed for debugging sessions only
2009-05-25 14:01:16 +0200 fs r272238 : #i102021# ensure members such as bNumberFormat are initialized before actually returning them
2009-05-25 13:10:20 +0200 fs r272236 : #i10000# reset ENABLE_EVOAB2
2009-05-22 06:44:45 +0200 oj r272167 : #i99104# add import handler for calc-sett
2009-05-22 06:42:27 +0200 oj r272166 : #i99104# impl NullDate as member
2009-05-22 06:36:22 +0200 oj r272165 : #i99104# handle nulldate from parent model
2009-05-22 06:33:13 +0200 oj r272164 : #i99104# export and import calculation-settings and nulldate
2009-05-22 06:27:50 +0200 oj r272163 : #i99104# export and import calculation-settings and nulldate
2009-05-20 13:29:58 +0200 oj r272118 : #i99911# handle invalid name
2009-05-20 13:28:49 +0200 oj r272117 : #i101261# handle different rowsets
2009-05-20 11:29:55 +0200 msc r272111 : #i100000#
2009-05-20 11:28:27 +0200 msc r272110 : merge in change from dba32a
2009-05-20 11:27:38 +0200 msc r272109 : #102082# CTRL + C does not work
2009-05-20 09:43:36 +0200 oj r272106 : clean up includes
2009-05-20 09:32:15 +0200 oj r272105 : #i99060# merge error resovled now VERTICAL_ALIGN is in both stmt
2009-05-20 08:37:21 +0200 msc r272104 : add workaround for issue #102010#
2009-05-20 08:10:12 +0200 oj r272103 : #i99104# use numberformatkey
2009-05-20 08:07:02 +0200 oj r272102 : #i99104# use column info from rowset
2009-05-20 08:04:43 +0200 oj r272101 : #i102032# use a special column type where prec and scale are the values currently set at the column
2009-05-20 08:03:04 +0200 oj r272100 : #i102032# correct type info, we have to use SQL defined type names
2009-05-19 10:27:02 +0200 oj r272061 : #i99104# export null-date
2009-05-19 08:26:53 +0200 oj r272056 : #i99104# export null-date
2009-05-18 13:15:10 +0200 msc r272014 : add issue #102019#
2009-05-18 11:33:07 +0200 msc r272005 : add issue #102019#
2009-05-18 08:59:45 +0200 msc r271996 : add workaroud for issue #102010#
2009-05-15 10:21:24 +0200 msc r271929 : #101944#
2009-05-11 21:18:30 +0200 fs r271792 : #i99914#
2009-05-08 13:52:06 +0200 oj r271715 : #i96423# remember column span
2009-05-08 11:26:19 +0200 oj r271708 : #i98605# impl new scale mode
2009-05-08 10:33:35 +0200 fs r271706 : SendUserCall: only call into the shape notification routine for UserCall types where this is necessary (performance issue)
2009-05-07 20:52:44 +0200 fs r271698 : outsource ShapeProperty from shapepropertynotifier.hxx
2009-05-07 20:43:33 +0200 fs r271697 : #i99056# use notifyShapePropertyChange, instead of getShapePropertyChangeNotifier - the latter throws if no shape exists, yet
2009-05-07 20:33:58 +0200 fs r271696 : #i99056# +notifyShapePropertyChange: allow notifying chages without checking whether there actually already exists an SvxShape
2009-05-07 16:22:15 +0200 fs r271679 : #i10000# cygwin needs quotes around the classpath
2009-05-07 16:21:37 +0200 fs r271678 : #i10000# cygwin needs quotes around the classpath
2009-05-07 16:01:11 +0200 oj r271677 : #i99914# notify parent handler
2009-05-07 15:54:54 +0200 fs r271676 : #i10000# cygwin needs some quoting
2009-05-07 14:49:48 +0200 oj r271672 : #i99277# quote alias name
2009-05-07 14:48:12 +0200 oj r271671 : #i92538# add ~ in front of type
2009-05-07 14:37:13 +0200 oj r271667 : #i99118# change type from char to varchar
2009-05-07 14:36:23 +0200 oj r271666 : #i99118# clear dest columns when changing to create new table
2009-05-07 13:35:32 +0200 oj r271657 : #i94467# handle type 0 as double as well
2009-05-07 13:20:49 +0200 oj r271655 : i99743# setNull when varchar is no text
2009-05-07 12:58:06 +0200 fs r271651 : initialize the SdrObject's property change notifier after the ctor, if necessary
2009-05-07 11:47:18 +0200 fs r271647 : #i10000#
2009-05-07 10:57:16 +0200 fs r271639 : OPropertyBrowserController::propertyChange: care for the current property state, too, and properly forward it to the UI
2009-05-07 10:18:14 +0200 fs r271636 : onNewComponent: do not ask the map for grid columns, it will throw
2009-05-07 10:09:55 +0200 fs r271634 : #i101623#
2009-05-07 09:53:44 +0200 fs r271631 : #i101622#
2009-05-06 21:55:53 +0200 fs r271615 : #i10000#
2009-05-06 21:10:42 +0200 fs r271611 : #i10000#
2009-05-06 13:11:48 +0200 fs r271583 : #i10000#
2009-05-05 22:29:31 +0200 fs r271559 : proper assertion message
2009-05-05 22:29:03 +0200 fs r271558 : diagnostics
2009-05-05 22:16:16 +0200 fs r271557 : #i10000#
2009-05-05 13:50:32 +0200 fs r271513 : #i10000#
2009-05-05 10:21:50 +0200 fs r271503 : #i10000#
2009-05-05 09:30:26 +0200 fs r271501 : why did those survive the rebase -C step?
2009-05-05 09:18:12 +0200 fs r271500 : #i10000#
2009-05-04 17:08:17 +0200 fs r271475 : CWS-TOOLING: rebase CWS dba32b to trunk@271427 (milestone: DEV300:m47)
2009-05-04 14:51:26 +0200 fs r271456 : line ends
2009-04-30 15:55:27 +0200 fs r271418 : NewURL -> PublicConnectionURL
2009-04-22 21:18:34 +0200 fs r271141 : #i100944#
2009-04-22 09:12:26 +0200 oj r271071 : #i101261# little code change
2009-04-22 09:11:43 +0200 oj r271070 : #i101261# only ask for parameters which aren't set before
2009-04-22 09:11:25 +0200 oj r271069 : #i101261# new grabage container for nodes
2009-04-22 09:11:02 +0200 oj r271068 : #i101261# new grabage container for nodes
2009-04-22 09:10:44 +0200 oj r271067 : #i101261# new grabage container for nodes
2009-04-22 09:10:21 +0200 oj r271066 : #i101261# only ask for parameters which aren't set before
2009-04-22 09:08:24 +0200 oj r271065 : #i101261# only ask for parameters which aren't set before
2009-04-22 09:07:25 +0200 oj r271064 : #i101261# only ask for parameters which aren't set before
2009-04-22 08:49:07 +0200 oj r271062 : #i77501# preview only when needed
2009-04-22 08:45:44 +0200 oj r271061 : #i101261# new prop max rows
2009-04-22 08:44:18 +0200 oj r271060 : #i101261# create dataprovider earlier to avoid the wrong legend in chart
2009-04-22 08:42:48 +0200 oj r271059 : #i101261# handle parameter
2009-04-17 21:00:23 +0200 fs r270954 : #i98350#
2009-04-17 13:54:19 +0200 fs r270942 : #i99565#
2009-04-17 13:51:34 +0200 fs r270940 : #i101153# only localize the (potentially) localizable properties when there really is support at the control model
2009-04-17 11:43:14 +0200 fs r270932 : removed superfluous include
2009-04-17 10:10:15 +0200 fs r270926 : #i10000#
2009-04-17 10:02:36 +0200 fs r270925 : #i10000#
2009-04-17 09:15:13 +0200 fs r270918 : #i99056# some more refactoring of the recently introduced property change notification mechanism for UNO shapes
2009-04-17 09:14:56 +0200 fs r270917 : #i99056# some more refactoring of the recently introduced property change notification mechanism for UNO shapes
2009-04-17 09:13:25 +0200 fs r270915 : #i99056# some more refactoring of the recently introduced property change notification mechanism for UNO shapes
2009-04-17 08:30:34 +0200 fs r270914 : removed unotools/servicehelper.hxx in favour of the (duplicated) comphelper/servicehelper.hxx
2009-04-16 21:05:25 +0200 fs r270903 : #i10000#
2009-04-16 20:43:43 +0200 fs r270902 : #i99056# shape notification outsourced to the SdrObject, this is what all other shape implementations (which only aggregate an SvxShape) have access to, too
2009-04-16 15:57:36 +0200 fs r270891 : #i99056# make SetUnoControlModel virtual
2009-04-16 15:44:02 +0200 fs r270890 : #i99056# let the ScShapeObj notify changes in its Anchor property
2009-04-16 15:36:47 +0200 fs r270889 : #i99056# enable the sheet anchor type property, too
2009-04-16 15:33:45 +0200 fs r270887 : #i99056# shape notification outsourced to the SdrObject, this is what all other shape implementations (which only aggregate an SvxShape) have access to, too
2009-04-15 14:53:13 +0200 fs r270844 : #i10000#
2009-04-15 13:08:29 +0200 fs r270836 : #i10000#
2009-04-15 12:28:14 +0200 fs r270832 : #i10000#
2009-04-15 10:59:14 +0200 fs r270827 : #i10000#
2009-04-15 09:41:08 +0200 oj r270823 : fix issues found with findbugs and pmd
2009-04-14 21:08:04 +0200 fs r270808 : #i99056# implement SheetAnchorType - now the only thing missing to enable it is the proper notification when it is modified
2009-04-14 17:09:00 +0200 fs r270799 : #i99056# implement XServiceInfo for the ScShapeObj
2009-04-14 17:07:55 +0200 fs r270798 : #i99056# implement TextAnchorType, partially implement SheetAnchorType
2009-04-14 15:54:05 +0200 fs r270786 : #i99056# SwXShape: notify changes of the AnchorType property
2009-04-14 15:47:32 +0200 fs r270785 : #i99056# deliver shapepropertynotifier.hxx
2009-04-14 15:46:54 +0200 fs r270784 : diagnostics
2009-04-14 15:08:28 +0200 fs r270781 : #i99056# outsourced the SvxShape's property change notification code into a dedicated class
2009-04-14 14:41:09 +0200 fs r270773 : #i99056# outsourced the SvxShape's property change notification code into a dedicated class
2009-04-14 14:37:23 +0200 fs r270772 : in dtor, remove the properties from the temporary component context
2009-04-14 14:36:34 +0200 fs r270771 : getWeakUnoShape made const
2009-04-14 12:23:08 +0200 oj r270757 : #i101064# add missing braces
2009-04-14 12:21:25 +0200 oj r270756 : #i101065# add braces for gcc 4.3.2
2009-04-14 12:17:45 +0200 oj r270755 : #i101059# add dep for manifest
2009-04-09 12:06:58 +0200 oj r270686 : #i93100# use OptimalSize from control to get height
2009-04-08 09:56:55 +0200 oj r270619 : #i92537# handle calculations in the select columns as well
2009-04-08 09:30:39 +0200 oj r270615 : #i96657# throw error message when the key doesn't have any columns
2009-04-07 12:08:26 +0200 oj r270592 : #i77501# impl preview of the executed report
2009-04-07 12:01:56 +0200 oj r270591 : #i77501# impl preview of the executed report
2009-04-07 11:41:03 +0200 oj r270590 : #i77501# impl preview of the executed report
2009-04-07 11:39:32 +0200 oj r270589 : #i77501# impl preview of the executed report
2009-04-07 11:29:25 +0200 oj r270588 : #i77501# convert dos to unix lineends
2009-04-07 11:28:23 +0200 oj r270587 : #i77501# impl preview of the executed report
2009-04-07 11:16:50 +0200 oj r270586 : #i77501# impl preview of the executed report
2009-04-07 11:16:00 +0200 oj r270585 : #i77501# impl preview of the executed report
2009-04-07 11:15:44 +0200 oj r270584 : #i77501# impl preview of the executed report
2009-04-07 11:15:28 +0200 oj r270583 : #i77501# impl preview of the executed report
2009-04-07 11:15:04 +0200 oj r270582 : #i77501# impl preview of the executed report
2009-04-06 15:38:54 +0200 fs r270559 : merge changes from CWS dba32a herein
2009-04-03 15:56:16 +0200 fs r270494 : ImpSvMEdit::Resize: do multiple iterations, if necessary
2009-04-03 14:35:49 +0200 fs r270487 : #i10000#
2009-04-03 13:17:16 +0200 fs r270476 : #i99056# display geometry information for controls, too
2009-04-03 13:16:37 +0200 fs r270475 : #i99056# better ordering of the geometry properties
2009-04-03 13:16:07 +0200 fs r270473 : #i99056# now that SvxShape supports property change listeners, forward add/remove requests to it
2009-04-03 13:13:18 +0200 fs r270472 : #i99056# at SvxShape, allow for PropertyChangeListeners for Size/Position
2009-04-03 09:29:27 +0200 oj r270456 : #i94571# use correct prop name
2009-04-03 09:14:54 +0200 fs r270451 : merge changes from CWS dba32a herein
2009-04-02 17:00:51 +0200 fs r270424 : better diagnostics
2009-04-02 16:35:19 +0200 fs r270421 : diagnostics
2009-04-02 16:34:50 +0200 fs r270420 : #i99056# mxUnoShape not accessible anymore, use impl_setUnoShape instead
2009-04-02 16:32:48 +0200 fs r270419 : #i99056# make getUnoShape cheaper: keep the pointer to the SvxShape all the time, so there's no need to ask for it in getUnoShape. As a consequence, we will later be able to use the pointer in scenarious where performance (potentially) matters
2009-04-02 16:31:13 +0200 fs r270417 : merge changes from CWS dba32a herein
2009-04-02 16:23:16 +0200 fs r270414 : merge changes from CWS dba32a herein
2009-04-02 14:10:35 +0200 fs r270405 : #i10000#
2009-04-02 14:06:26 +0200 fs r270404 : merge changes from CWS dba32a herein
2009-04-02 14:03:03 +0200 fs r270401 : #i10000#
2009-04-02 13:58:13 +0200 fs r270400 : #i10000#
2009-04-02 12:59:44 +0200 fs r270397 : merge changes from CWS dba32a herein
2009-04-02 12:46:30 +0200 fs r270396 : #i99056# let the form page maintain a mapping between control models and control shapes
2009-04-02 12:44:07 +0200 fs r270395 : merge changes from CWS dba32a herein
2009-04-02 12:42:06 +0200 fs r270394 : merge changes from CWS dba32a herein
2009-04-02 12:35:20 +0200 fs r270393 : #i10000# precompiled header
2009-04-02 12:05:31 +0200 fs r270392 : merge changes from CWS dba32a herein
2009-04-02 12:00:42 +0200 fs r270391 : merge changes from CWS dba32a herein
2009-04-02 11:47:26 +0200 fs r270390 : merge changes from CWS dba32a herein
2009-04-02 11:39:15 +0200 oj r270389 : #i94467# foxpro impl several new types
2009-04-02 11:35:58 +0200 fs r270387 : merge changes from CWS dba32a herein
2009-04-01 14:10:51 +0200 fs r270329 : merge changes from CWS dba32a herein
2009-03-31 17:29:50 +0200 fs r270290 : merge changes from CWS dba32a herein
2009-03-30 14:53:56 +0200 fs r270233 : #i100417# don't set grid column widths to 0, but to <void/>
2009-03-30 12:31:03 +0200 oj r270213 : #i100552# wrong orb used
2009-03-30 12:19:20 +0200 oj r270212 : #i98303# convertlike corrected to sal_Unicode
2009-03-30 11:58:25 +0200 fs r270210 : merge changes from CWS dba32a herein
2009-03-30 11:38:16 +0200 oj r270205 : remove duplicate code from merge
2009-03-30 11:02:27 +0200 fs r270202 : merge changes from CWS dba32a herein
2009-03-30 11:02:19 +0200 fs r270201 : merge changes from CWS dba32a herein
2009-03-30 10:31:26 +0200 oj r270200 : #i100665# only throw exception and do not drop table
2009-03-30 09:36:24 +0200 fs r270195 : assertion text
2009-03-28 20:21:58 +0100 fs r270187 : #ii10000#
2009-03-28 20:19:54 +0100 fs r270186 : removed unused help ids
2009-03-28 20:19:40 +0100 fs r270185 : removed unused help ids
2009-03-28 20:19:10 +0100 fs r270184 : #i100237# +DefaultState/XReset
2009-03-28 00:29:29 +0100 fs r270177 : CWS-TOOLING: rebase CWS dba32b to trunk@270033 (milestone: DEV300:m45)
2009-03-27 22:56:46 +0100 fs r270173 : #i100237# DEFAULT_CHECKED -> DEFAULT_STATE
2009-03-27 22:55:52 +0100 fs r270172 : #i100237# DefaultState property for buttons, enabled only when Toggle=Yes
2009-03-27 22:54:15 +0100 fs r270171 : #i100237# DEFAULT_CHECKED -> DEFAULT_STATE
2009-03-27 22:53:54 +0100 fs r270170 : #i100237# introduce a DefaultState property for buttons, which implies buttongs supporting XReset, which needed some refactoring
2009-03-27 13:31:41 +0100 fs r270152 : ignore output paths
2009-03-27 11:23:44 +0100 fs r270139 : tuned behavior with respect to invalid keys/values
2009-03-27 09:57:14 +0100 fs r270136 : don't allow Double.NaN
2009-03-27 09:56:16 +0100 fs r270135 : talk about Double.NaN
2009-03-26 12:14:30 +0100 fs r270067 : removed unused parameter
2009-03-26 12:14:02 +0100 fs r270066 : removed widening conversion when checking keys
2009-03-26 09:17:34 +0100 fs r270053 : separated the enumerator functionality into a dedicated interface, this way not burdening XMap with it
2009-03-26 09:17:11 +0100 fs r270052 : separated the enumerator functionality into a dedicated interface, this way not burdening XMap with it
2009-03-26 09:16:49 +0100 fs r270051 : separated the enumerator functionality into a dedicated interface, this way not burdening XMap with it
2009-03-25 21:55:20 +0100 fs r270044 : #i100541# properly calculat bNeedScrollBox
2009-03-25 12:56:17 +0100 fs r270019 : renamed the previously introduced error condition
2009-03-25 12:11:48 +0100 fs r270015 : #i100095# when the error messages contain non-trivial details (SQLState/ErrorCode), then always display the 'Details' button
2009-03-25 12:10:05 +0100 fs r270012 : renamed the previously introduced error condition
2009-03-25 12:01:04 +0100 fs r270011 : #i100095# when no address book (or respective profile) can be found, then use a dedicated ErrorCondition
2009-03-25 10:29:07 +0100 fs r270003 : add missing localization
2009-03-25 10:23:12 +0100 fs r270001 : in preparation of #i1000095#:
rework the error handling, allow using css.sdb.ErrorCondition values, plus
allow propagating the nsresult
2009-03-25 10:21:55 +0100 fs r270000 : in preparation of #i1000095#:
rework the error handling, allow using css.sdb.ErrorCondition values, plus
allow propagating the nsresult
2009-03-20 23:05:38 +0100 fs r269829 : XMap::getSize removed
2009-03-20 23:05:19 +0100 fs r269828 : changes as suggested by sb
2009-03-20 23:04:56 +0100 fs r269827 : enhanced documentation
2009-03-20 15:31:40 +0100 fs r269815 : changes as suggested by sb
2009-03-20 13:23:52 +0100 oj r269804 : #i92538# correct the zorder that fixedtext is infront of control
2009-03-20 12:59:38 +0100 oj r269801 : #i94571# paraadjust now supports BLOCK
2009-03-20 12:58:11 +0100 oj r269800 : #i94571# export style with data style
2009-03-20 12:57:05 +0100 oj r269799 : #i94571# text align is now paraadjust
2009-03-20 12:37:02 +0100 fs r269797 : enum keys only accepted if they have the exact type, not if they have *any* enum type
2009-03-20 12:28:31 +0100 fs r269794 : some changes requested by sb
2009-03-20 08:52:47 +0100 fs r269780 : doc
2009-03-20 07:37:31 +0100 oj r269779 : #i99913# only notifiy when values are different
2009-03-20 07:36:58 +0100 oj r269778 : #i99913# add undoenv as listener at the dataprovider
2009-03-19 22:52:52 +0100 fs r269771 : added comment
2009-03-19 22:40:06 +0100 fs r269770 : +testEnumeration
2009-03-19 22:39:41 +0100 fs r269769 : implemented enumeration, getKeySet, and getValues. Should be finished now.
2009-03-19 14:01:01 +0100 oj r269743 : #i99913# reset the modified state when selecting an object
2009-03-19 12:19:54 +0100 lla r269739 : #i72390# cleanups
2009-03-19 09:25:27 +0100 fs r269727 : #i10000#
2009-03-18 23:37:02 +0100 fs r269708 : extended checks for value type acceptance
2009-03-18 23:36:41 +0100 fs r269707 : fixed value type checks
2009-03-18 14:59:56 +0100 fs r269678 : initial complex test case for the new css.container.Map implementation
2009-03-18 14:59:24 +0100 fs r269677 : verifyExpectedException moved to base class (in complexlib), and renamed to assureException for consistency
2009-03-18 14:58:35 +0100 fs r269676 : removed unused imports
2009-03-18 14:58:03 +0100 fs r269675 : first implementation of the new css.container.Map service (not completed, yet)
2009-03-18 14:57:17 +0100 fs r269674 : base class for UNO components, freeing you from some repeating work
2009-03-18 14:55:53 +0100 fs r269672 : +assureException: call a given method with given parameters on a given object, ensure that a given exception is thrown by the method implementation
2009-03-18 14:54:58 +0100 fs r269671 : +getComponentContext
2009-03-18 14:54:00 +0100 fs r269670 : isEmpty returns a boolean, not a long
2009-03-18 14:14:43 +0100 oj r269663 : #i99743# now text also supports null
2009-03-18 13:54:14 +0100 oj r269660 : #i99223# remove check for 2 params
2009-03-18 13:33:35 +0100 oj r269659 : #i99060# replace text::ParagraphVertAlign with style::VerticalAlignment
2009-03-18 13:32:18 +0100 oj r269658 : #i99060# don't set void property when void isn't allowed
2009-03-18 13:31:11 +0100 oj r269657 : #i99060# handle vertical alignment
2009-03-18 13:28:28 +0100 oj r269656 : #i99060# remove unused elements from sytle
2009-03-18 09:35:42 +0100 lla r269639 : #i72390# cleanups
2009-03-18 09:31:20 +0100 lla r269638 : #i72390# add ButtonList
2009-03-18 09:30:46 +0100 lla r269637 : #i72390# renamed interface
2009-03-18 09:30:15 +0100 lla r269636 : #i72390# use ButtonList instead of ImageList
2009-03-18 09:29:05 +0100 lla r269635 : #i72390# new ButtonList, cleanups
2009-03-18 09:26:34 +0100 lla r269634 : #i72390# cleanups
2009-03-17 12:21:20 +0100 oj r269590 : #i99222# remove assertion
2009-03-17 12:17:22 +0100 oj r269589 : #i98605# impl scale mode
2009-03-17 12:10:42 +0100 oj r269588 : #i98605# impl scale mode
2009-03-17 11:40:15 +0100 oj r269584 : #i96944# doesn't create equation for shapes
2009-03-17 11:33:16 +0100 oj r269583 : #i96423# switch calc from float to long
2009-03-16 15:19:18 +0100 fs r269550 : #i41930# enable zoom for embedded/outplace documents
2009-03-16 14:25:54 +0100 oj r269542 : #i93734# remove ContextSensitive
2009-03-16 14:21:58 +0100 oj r269541 : #i99274# page header before group header
2009-03-16 14:18:23 +0100 oj r269539 : #i99110# fix value type
2009-03-16 14:14:16 +0100 fs r269537 : line ends
2009-03-16 14:11:06 +0100 fs r269535 : line ends
2009-03-16 14:08:34 +0100 fs r269534 : #i100087# (provided my np): allow for polymorphic types with more than one parameter
2009-03-16 12:30:31 +0100 oj r269521 : compile error
2009-03-16 12:19:12 +0100 oj r269519 : compile error
2009-03-16 10:39:28 +0100 oj r269511 : compile error under linux with swap
2009-03-13 10:33:04 +0100 oj r269462 : CWS-TOOLING: rebase CWS dba32b to trunk@269297 (milestone: DEV300:m43)
2009-03-12 14:37:25 +0100 fs r269416 : interface SequenceOutputStreamTest is unneeded, and pollutes the namespace here :)
2009-03-12 14:35:07 +0100 fs r269414 : not needed
2009-03-12 14:34:15 +0100 fs r269413 : preparation for multiple tests in this module
2009-03-12 14:33:02 +0100 fs r269412 : ShowTargets was moved from module integration.forms to module complexlib
2009-03-12 14:32:48 +0100 fs r269411 : helper class for projects containing multiple complex test cases (and following a certain structure)
2009-03-12 14:00:14 +0100 fs r269407 : proper module after the move
2009-03-12 13:59:10 +0100 fs r269406 : superseded by ../makefile.mk
2009-03-12 13:47:38 +0100 fs r269403 : not needed anymore
2009-03-12 13:45:46 +0100 fs r269402 : moved, in preparation of adding more test cases here, with a common infrastructure
2009-03-12 13:45:07 +0100 fs r269401 : moved from ../
2009-03-12 13:43:59 +0100 fs r269400 : moved to ./comphelper, in preparation of adding more test cases here, with a common infrastructure
2009-03-12 13:29:47 +0100 oj r269396 : #i99914# set parent on dataprovider
2009-03-12 13:10:35 +0100 oj r269393 : #i99832# check thrown exception and show error
2009-03-12 13:08:10 +0100 fs r269392 : reorganizing tests
2009-03-12 12:52:55 +0100 oj r269390 : #i99118# convert formatkey in numberformat
2009-03-12 12:34:53 +0100 fs r269388 : new API tests
2009-03-12 12:29:05 +0100 fs r269386 : Map not yet committed
2009-03-12 12:28:36 +0100 fs r269385 : oops, forgot the SequenceInputStream during the previous refactoring
2009-03-12 12:12:39 +0100 oj r269384 : #i99104# set HasCategories prop
2009-03-12 12:12:08 +0100 oj r269383 : #i99104# check HasCategories even for internal dataprovider
2009-03-12 12:10:40 +0100 oj r269382 : #i99104# set HasCategories prop
2009-03-12 10:51:49 +0100 fs r269373 : #i10000# exception specifications
2009-03-12 10:49:18 +0100 fs r269372 : #i10000# exception specifications
2009-03-12 10:44:02 +0100 fs r269371 : #i10000# exception specifications
2009-03-12 10:30:55 +0100 fs r269368 : refactored the UNO service registration in this module, using the helper classes provided by comphelper itself, so you have less effort when extending the list of to-be-registered components
2009-03-12 10:30:37 +0100 fs r269367 : module-local includes
2009-03-12 07:05:54 +0100 oj r269357 : #i99104# database dataprovider doesn't need dataranges and diagramdata
2009-03-11 10:58:28 +0100 oj r269306 : #i99911# check if name of the report is a valid file name
2009-03-11 10:03:23 +0100 oj r269299 : #i99666# the report is new when the HierarchicalDocumentName is empty
2009-03-10 11:32:45 +0100 oj r269258 : #i99221# use fallback for language
2009-03-10 10:48:40 +0100 oj r269255 : #i99433# now use OStringBuffer
2009-03-10 10:36:21 +0100 fs r269252 : initial version of (X)Map
2009-03-10 09:52:23 +0100 oj r269246 : #i99433# now use OStringBuffer
2009-03-10 08:56:13 +0100 oj r269240 : #i99655# patch applied
2009-03-09 07:35:33 +0100 lla r269058 : #i10000# wrong variable assignment fixed
2009-03-06 17:20:40 +0100 fs r269030 : some explicit defaults
2009-03-06 17:20:30 +0100 fs r269029 : #i98600#
2009-03-06 14:40:34 +0100 fs r269009 : #i87692# during reload, prevent the document being modified just because of some control content changes ...
2009-03-06 12:52:20 +0100 lla r268997 : #i10000# ambigous problem with FontWeight fixed
2009-03-06 11:39:32 +0100 fs r268989 : #i10000# (approved by pl): use --without-t1-library configure option
2009-03-06 10:55:43 +0100 fs r268986 : #i99953# depends on xmlscript module now
2009-03-06 10:54:04 +0100 fs r268985 : #i99953# also adjust the event names found in dialogs embedded in the forms
2009-03-06 09:53:41 +0100 fs r268977 : #i10000#
2009-03-06 09:30:41 +0100 lla r268973 : #i10000# merge problems
2009-03-05 17:52:34 +0100 fs r268932 : #i98593# for sub components which are actually controlled by a DocumentDefinition (aka XComponentSupplier aka XCommandProcessor), close them by executing the 'close' command, not by suspending/closing the controller (which cannot be intercepted)
2009-03-05 11:41:56 +0100 fs r268889 : default the drop down line count for list/combo boxes to 20
2009-03-05 11:39:10 +0100 fs r268887 : do not display empty error messages
2009-03-02 10:13:57 +0100 lla r268639 : #i91541# CWS rebase m41 to m42
2009-03-02 09:06:27 +0100 lla r268635 : #i10000# add ';' to strings
2009-02-26 11:18:00 +0100 fs r268492 : reportdesign depends on REPORTBUILDER, not REPORTDESIGN
2009-02-26 10:11:38 +0100 lla r268489 : CWS-TOOLING: rebase CWS dba32b to trunk@268395 (milestone: DEV300:m42)
2009-02-26 09:04:11 +0100 lla r268488 : CWS-TOOLING: rebase CWS dba32b to trunk@268395 (milestone: DEV300:m42)
2009-02-24 12:09:13 +0100 lla r268392 : #i91541# #i91542# cleanups
2009-02-24 08:08:06 +0100 lla r268382 : merge all dba32a changes into dba32b
2009-02-24 07:14:55 +0100 lla r268381 : merge all dba32a changes into dba32b
2009-02-23 21:44:28 +0100 fs r268377 : oops ... don't tamper with m_aListSourceValues at the end of loadData
2009-02-23 20:57:05 +0100 fs r268376 : #i98162# don't hold the values as strings, but as ORowSetValue, this way preserving their type, and being agnostic to different result/rowset implementations doing different to-string-conversations
2009-02-23 20:55:44 +0100 fs r268375 : getObject: throwFunctionNotSupportedException, instead of silently returning NULL
2009-02-23 20:55:20 +0100 fs r268374 : #i98162# some more supported types
2009-02-23 20:54:43 +0100 fs r268373 : #i98162# +operator !=
2009-02-20 09:35:39 +0100 fs r268306 : #i99422# for a font, display the font name, the style, and the size
2009-02-20 09:33:45 +0100 fs r268305 : #i99422# in the property browser, FONT supersedes CHARFONTNAME: the aggregated FormComponentHandler displays them more nicely now
2009-02-19 16:12:06 +0100 fs r268293 : #i99372# recognize DataType::FLOAT as numeric
2009-02-19 15:43:12 +0100 fs r268291 : #i99415#
2009-02-19 15:40:15 +0100 fs r268290 : #i99242# lcl_firstFocussableControl: take disabled controls into account
2009-02-19 15:34:36 +0100 fs r268289 : #i99396# properly decode the base name of the URL when using it as title
2009-02-19 15:19:05 +0100 fs r268287 : #i98247#
Diffstat (limited to 'extensions')
24 files changed, 1136 insertions, 132 deletions
diff --git a/extensions/inc/extensio.hrc b/extensions/inc/extensio.hrc index a831143b5eeb..c2b627d25ecf 100644 --- a/extensions/inc/extensio.hrc +++ b/extensions/inc/extensio.hrc @@ -216,7 +216,7 @@ #define HID_PROP_SUBMIT_ENCODING (HID_FORMS_START + 58) #define HID_PROP_DEFAULTVALUE (HID_FORMS_START + 59) #define HID_PROP_SUBMIT_TARGET (HID_FORMS_START + 60) -#define HID_PROP_DEFAULT_CHECKED (HID_FORMS_START + 61) +#define HID_PROP_DEFAULT_STATE (HID_FORMS_START + 61) #define HID_PROP_IMAGE_URL (HID_FORMS_START + 62) #define HID_PROP_DEFAULT_SELECT_SEQ (HID_FORMS_START + 63) #define HID_PROP_MULTISELECTION (HID_FORMS_START + 64) @@ -458,9 +458,10 @@ #define HID_PROP_IMAGEPOSITION (HID_FORMS_START + 339) #define HID_PROP_NOLABEL (HID_FORMS_START + 340) #define HID_PROP_WRITING_MODE (HID_FORMS_START + 341) +#define HID_PROP_ANCHOR_TYPE (HID_FORMS_START + 343) // please adjust HID_LAST_FORMS_ID if you add new ids here! -#define HID_LAST_FORMS_ID HID_PROP_WRITING_MODE +#define HID_LAST_FORMS_ID HID_PROP_ANCHOR_TYPE #if HID_LAST_FORMS_ID > HID_FORMS_END #error id overflow diff --git a/extensions/source/dbpilots/gridwizard.cxx b/extensions/source/dbpilots/gridwizard.cxx index 1c0e9a684e05..ad09e2d7122c 100644 --- a/extensions/source/dbpilots/gridwizard.cxx +++ b/extensions/source/dbpilots/gridwizard.cxx @@ -218,8 +218,8 @@ namespace dbp xColumn->setPropertyValue(s_sDataFieldProperty, makeAny(*pFormFieldName)); // the label xColumn->setPropertyValue(s_sLabelProperty, makeAny(::rtl::OUString(*pFormFieldName) += *pColumnLabelPostfix)); - // the width (0 => column will be auto-sized) - xColumn->setPropertyValue(s_sWidthProperty, makeAny(sal_Int32(0))); + // the width (<void/> => column will be auto-sized) + xColumn->setPropertyValue(s_sWidthProperty, Any()); // insert the column xColumnContainer->insertByName(sColumnName, makeAny(xColumn)); diff --git a/extensions/source/propctrlr/browserlistbox.cxx b/extensions/source/propctrlr/browserlistbox.cxx index 4cb35e9f0c6f..23008fc9a1de 100644 --- a/extensions/source/propctrlr/browserlistbox.cxx +++ b/extensions/source/propctrlr/browserlistbox.cxx @@ -667,11 +667,21 @@ namespace pcr } //------------------------------------------------------------------ - void OBrowserListBox::SetPropertyValue(const ::rtl::OUString& _rEntryName, const Any& _rValue) + void OBrowserListBox::SetPropertyValue(const ::rtl::OUString& _rEntryName, const Any& _rValue, bool _bUnknownValue ) { ListBoxLines::iterator line = m_aLines.find( _rEntryName ); if ( line != m_aLines.end() ) - impl_setControlAsPropertyValue( line->second, _rValue ); + { + if ( _bUnknownValue ) + { + Reference< XPropertyControl > xControl( line->second.pLine->getControl() ); + OSL_ENSURE( xControl.is(), "OBrowserListBox::SetPropertyValue: illegal control!" ); + if ( xControl.is() ) + xControl->setValue( Any() ); + } + else + impl_setControlAsPropertyValue( line->second, _rValue ); + } } //------------------------------------------------------------------------ diff --git a/extensions/source/propctrlr/browserlistbox.hxx b/extensions/source/propctrlr/browserlistbox.hxx index faa6facb6fe4..a89e1dc83c39 100644 --- a/extensions/source/propctrlr/browserlistbox.hxx +++ b/extensions/source/propctrlr/browserlistbox.hxx @@ -164,7 +164,7 @@ namespace pcr sal_Bool RemoveEntry( const ::rtl::OUString& _rName ); void ChangeEntry( const OLineDescriptor&, sal_uInt16 nPos ); - void SetPropertyValue( const ::rtl::OUString& rEntryName, const ::com::sun::star::uno::Any& rValue ); + void SetPropertyValue( const ::rtl::OUString& rEntryName, const ::com::sun::star::uno::Any& rValue, bool _bUnknownValue ); ::com::sun::star::uno::Any GetPropertyValue( const ::rtl::OUString& rEntryName ) const; sal_uInt16 GetPropertyPos( const ::rtl::OUString& rEntryName ) const; ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControl > diff --git a/extensions/source/propctrlr/cellbindinghelper.cxx b/extensions/source/propctrlr/cellbindinghelper.cxx index e1fc88553e76..d609dea69436 100644 --- a/extensions/source/propctrlr/cellbindinghelper.cxx +++ b/extensions/source/propctrlr/cellbindinghelper.cxx @@ -44,8 +44,10 @@ #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/beans/NamedValue.hpp> +#include <com/sun/star/sheet/XSpreadsheet.hpp> #include <unotools/transliterationwrapper.hxx> #include <osl/diagnose.h> +#include <tools/diagnose_ex.h> #include "formstrings.hxx" #include <functional> @@ -109,7 +111,7 @@ namespace pcr } //------------------------------------------------------------------------ - sal_Int16 CellBindingHelper::getControlSheetIndex( ) const + sal_Int16 CellBindingHelper::getControlSheetIndex( Reference< XSpreadsheet >& _out_rxSheet ) const { sal_Int16 nSheetIndex = -1; // every sheet has a draw page, and every draw page has a forms collection. @@ -137,18 +139,13 @@ namespace pcr { for ( sal_Int32 i = 0; i < xSheets->getCount(); ++i ) { - Reference< XDrawPageSupplier > xSuppPage; - xSheets->getByIndex( i ) >>= xSuppPage; + Reference< XDrawPageSupplier > xSuppPage( xSheets->getByIndex( i ), UNO_QUERY_THROW ); + Reference< XFormsSupplier > xSuppForms( xSuppPage->getDrawPage(), UNO_QUERY_THROW ); - Reference< XFormsSupplier > xSuppForms; - if ( xSuppPage.is() ) - xSuppForms = xSuppForms.query( xSuppPage->getDrawPage() ); - - OSL_ENSURE( xSuppForms.is(), "CellBindingHelper::getControlSheetIndex: could not determine the forms supplier!" ); - - if ( xSuppForms.is() && ( xSuppForms->getForms() == xFormsCollection ) ) + if ( xSuppForms->getForms() == xFormsCollection ) { // found it nSheetIndex = (sal_Int16)i; + _out_rxSheet.set( xSuppPage, UNO_QUERY_THROW ); break; } } @@ -156,7 +153,7 @@ namespace pcr } catch( const Exception& ) { - OSL_ENSURE( sal_False, "CellBindingHelper::getControlSheetIndex: caught an exception!" ); + DBG_UNHANDLED_EXCEPTION(); } return nSheetIndex; @@ -195,7 +192,8 @@ namespace pcr { try { - xConverter->setPropertyValue( PROPERTY_REFERENCE_SHEET, makeAny( (sal_Int32)getControlSheetIndex() ) ); + Reference< XSpreadsheet > xSheet; + xConverter->setPropertyValue( PROPERTY_REFERENCE_SHEET, makeAny( (sal_Int32)getControlSheetIndex( xSheet ) ) ); xConverter->setPropertyValue( _rInputProperty, _rInputValue ); _rOutputValue = xConverter->getPropertyValue( _rOutputProperty ); bSuccess = true; diff --git a/extensions/source/propctrlr/cellbindinghelper.hxx b/extensions/source/propctrlr/cellbindinghelper.hxx index 4660bb681507..e612bda0983a 100644 --- a/extensions/source/propctrlr/cellbindinghelper.hxx +++ b/extensions/source/propctrlr/cellbindinghelper.hxx @@ -40,6 +40,7 @@ #include <com/sun/star/form/binding/XValueBinding.hpp> #include <com/sun/star/form/binding/XListEntrySource.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <com/sun/star/sheet/XSpreadsheet.hpp> /** === end UNO includes === **/ //............................................................................ @@ -205,6 +206,13 @@ namespace pcr const ::com::sun::star::uno::Reference< ::com::sun::star::form::binding::XListEntrySource >& _rxSource ) const; + /** retrieves the index of the sheet which our control belongs to + @return the index of the sheet which our control belongs to or -1, if an error occured + */ + sal_Int16 getControlSheetIndex( + ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheet >& _out_rxSheet + ) const; + protected: /** creates an address object from a string representation of a cell address */ @@ -220,11 +228,6 @@ namespace pcr ::com::sun::star::table::CellRangeAddress& /* [out] */ _rAddress ) const; - /** retrieves the index of the sheet which our control belongs to - @return the index of the sheet which our control belongs to or -1, if an error occured - */ - sal_Int16 getControlSheetIndex( ) const; - /** determines if our document is a spreadsheet document, *and* can supply the given service */ diff --git a/extensions/source/propctrlr/defaultforminspection.cxx b/extensions/source/propctrlr/defaultforminspection.cxx index de4a907157d7..aed1d120bb09 100644 --- a/extensions/source/propctrlr/defaultforminspection.cxx +++ b/extensions/source/propctrlr/defaultforminspection.cxx @@ -163,7 +163,10 @@ namespace pcr { "com.sun.star.form.inspection.XSDValidationPropertyHandler", true }, // a handler which cares for XForms submissions - { "com.sun.star.form.inspection.SubmissionPropertyHandler", true } + { "com.sun.star.form.inspection.SubmissionPropertyHandler", true }, + + // a handler which cares for geometry properties of form controls + { "com.sun.star.form.inspection.FormGeometryHandler", true } }; sal_Int32 nFactories = sizeof( aFactories ) / sizeof( aFactories[ 0 ] ); diff --git a/extensions/source/propctrlr/editpropertyhandler.cxx b/extensions/source/propctrlr/editpropertyhandler.cxx index 0de64030db41..cd9d197e3fb5 100644 --- a/extensions/source/propctrlr/editpropertyhandler.cxx +++ b/extensions/source/propctrlr/editpropertyhandler.cxx @@ -293,7 +293,7 @@ namespace pcr _rxInspectorUI->enablePropertyUI( PROPERTY_WORDBREAK, nTextType == TEXTTYPE_RICHTEXT ); _rxInspectorUI->enablePropertyUI( PROPERTY_MAXTEXTLEN, nTextType != TEXTTYPE_RICHTEXT ); _rxInspectorUI->enablePropertyUI( PROPERTY_ECHO_CHAR, nTextType == TEXTTYPE_SINGLELINE ); - _rxInspectorUI->enablePropertyUI( PROPERTY_FONT_NAME, nTextType != TEXTTYPE_RICHTEXT ); + _rxInspectorUI->enablePropertyUI( PROPERTY_FONT, nTextType != TEXTTYPE_RICHTEXT ); _rxInspectorUI->enablePropertyUI( PROPERTY_ALIGN, nTextType != TEXTTYPE_RICHTEXT ); _rxInspectorUI->enablePropertyUI( PROPERTY_DEFAULT_TEXT, nTextType != TEXTTYPE_RICHTEXT ); _rxInspectorUI->enablePropertyUI( PROPERTY_SHOW_SCROLLBARS, nTextType != TEXTTYPE_SINGLELINE ); diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx index b6dc84dff225..e28eb2e89224 100644 --- a/extensions/source/propctrlr/formcomponenthandler.cxx +++ b/extensions/source/propctrlr/formcomponenthandler.cxx @@ -103,7 +103,6 @@ #include <svx/svxids.hrc> #include <toolkit/helper/vclunohelper.hxx> #include <tools/diagnose_ex.h> -#include <unotools/confignode.hxx> #include <vcl/msgbox.hxx> #include <vcl/stdtext.hxx> #include <vcl/wrkwin.hxx> @@ -344,7 +343,7 @@ namespace pcr sObjectID = sObjectID + xGrfObj->getUniqueID(); m_xComponent->setPropertyValue( _rPropertyName, uno::makeAny( sObjectID ) ); } - else if ( PROPERTY_ID_FONT_NAME == nPropId ) + else if ( PROPERTY_ID_FONT == nPropId ) { // special handling, the value is a faked value we generated ourself in impl_executeFontDialog_nothrow Sequence< NamedValue > aFontPropertyValues; @@ -619,7 +618,7 @@ namespace pcr case 1: nWritingMode = WritingMode2::RL_TB; break; case 2: nWritingMode = WritingMode2::CONTEXT; break; default: - OSL_ENSURE( false, "FormComponentPropertyHandler::convertToControlValue: unexpected 'normalized value' for WritingMode!" ); + OSL_ENSURE( false, "FormComponentPropertyHandler::convertToPropertyValue: unexpected 'normalized value' for WritingMode!" ); nWritingMode = WritingMode2::CONTEXT; break; } @@ -764,6 +763,51 @@ namespace pcr } break; + case PROPERTY_ID_FONT: + { + FontDescriptor aFont; + OSL_VERIFY( _rPropertyValue >>= aFont ); + + ::rtl::OUStringBuffer displayName; + if ( !aFont.Name.getLength() ) + { + displayName.append( String( PcrRes( RID_STR_FONT_DEFAULT ) ) ); + } + else + { + // font name + displayName.append( aFont.Name ); + displayName.appendAscii( ", " ); + + // font style + ::FontWeight eWeight = VCLUnoHelper::ConvertFontWeight( aFont.Weight ); + USHORT nStyleResID = RID_STR_FONTSTYLE_REGULAR; + if ( aFont.Slant == FontSlant_ITALIC ) + { + if ( eWeight > WEIGHT_NORMAL ) + nStyleResID = RID_STR_FONTSTYLE_BOLD_ITALIC; + else + nStyleResID = RID_STR_FONTSTYLE_ITALIC; + } + else + { + if ( eWeight > WEIGHT_NORMAL ) + nStyleResID = RID_STR_FONTSTYLE_BOLD; + } + displayName.append( String( PcrRes( nStyleResID ) ) ); + + // font size + if ( aFont.Height ) + { + displayName.appendAscii( ", " ); + displayName.append( sal_Int32( aFont.Height ) ); + } + } + + aControlValue <<= displayName.makeStringAndClear(); + } + break; + default: aControlValue = FormComponentPropertyHandler_Base::convertToControlValue( _rPropertyName, _rPropertyValue, _rControlValueType ); break; @@ -924,6 +968,7 @@ namespace pcr aInterestingProperties.push_back( PROPERTY_SHOWTHOUSANDSEP ); aInterestingProperties.push_back( PROPERTY_FORMATKEY ); aInterestingProperties.push_back( PROPERTY_EMPTY_IS_NULL ); + aInterestingProperties.push_back( PROPERTY_TOGGLE ); return Sequence< ::rtl::OUString >( &(*aInterestingProperties.begin()), aInterestingProperties.size() ); } @@ -1010,7 +1055,7 @@ namespace pcr }; break; - case PROPERTY_ID_FONT_NAME: + case PROPERTY_ID_FONT: bReadOnly = sal_True; aDescriptor.PrimaryButtonId = UID_PROP_DLG_FONT_TYPE; break; @@ -1238,7 +1283,7 @@ namespace pcr ::std::vector< ::rtl::OUString >::const_iterator pEnd = aEnumValues.end(); // for a checkbox: if "ambiguous" is not allowed, remove this from the sequence - if ( ( PROPERTY_ID_DEFAULTCHECKED == nPropId ) + if ( ( PROPERTY_ID_DEFAULT_STATE == nPropId ) || ( PROPERTY_ID_STATE == nPropId ) ) { @@ -1434,7 +1479,7 @@ namespace pcr eResult = InteractiveSelectionResult_ObtainedValue; break; - case PROPERTY_ID_FONT_NAME: + case PROPERTY_ID_FONT: if ( impl_executeFontDialog_nothrow( _rData, aGuard ) ) eResult = InteractiveSelectionResult_ObtainedValue; break; @@ -1661,7 +1706,7 @@ namespace pcr // ----- TriState ----- case PROPERTY_ID_TRISTATE: if ( !_bFirstTimeInit ) - _rxInspectorUI->rebuildPropertyUI( m_eComponentClass == eFormControl ? PROPERTY_DEFAULTCHECKED : PROPERTY_STATE ); + _rxInspectorUI->rebuildPropertyUI( m_eComponentClass == eFormControl ? PROPERTY_DEFAULT_STATE : PROPERTY_STATE ); break; // case PROPERTY_ID_TRISTATE // ----- DecimalAccuracy ----- @@ -1747,6 +1792,14 @@ namespace pcr } break; + case PROPERTY_ID_TOGGLE: + { + sal_Bool bIsToggleButton = sal_False; + OSL_VERIFY( _rNewValue >>= bIsToggleButton ); + _rxInspectorUI->enablePropertyUI( PROPERTY_DEFAULT_STATE, bIsToggleButton ); + } + break; + default: DBG_ERROR( "FormComponentPropertyHandler::actuatingPropertyChanged: did not register for this property!" ); break; @@ -2260,67 +2313,6 @@ namespace pcr } //------------------------------------------------------------------------ - sal_Int16 FormComponentPropertyHandler::impl_getDocumentMeasurementUnit_throw() const - { - FieldUnit eUnit = FUNIT_NONE; - - Reference< XServiceInfo > xDocumentSI( impl_getContextDocument_nothrow(), UNO_QUERY ); - OSL_ENSURE( xDocumentSI.is(), "FormComponentPropertyHandler::impl_getDocumentMeasurementUnit_throw: No context document - where do I live?" ); - if ( xDocumentSI.is() ) - { - // determine the application type we live in - ::rtl::OUString sConfigurationLocation; - ::rtl::OUString sConfigurationProperty; - if ( xDocumentSI->supportsService( SERVICE_WEB_DOCUMENT ) ) - { // writer - sConfigurationLocation = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.WriterWeb/Layout/Other" ) ); - sConfigurationProperty = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MeasureUnit" ) ); - } - else if ( xDocumentSI->supportsService( SERVICE_TEXT_DOCUMENT ) ) - { // writer - sConfigurationLocation = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.Writer/Layout/Other" ) ); - sConfigurationProperty = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MeasureUnit" ) ); - } - else if ( xDocumentSI->supportsService( SERVICE_SPREADSHEET_DOCUMENT ) ) - { // calc - sConfigurationLocation = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.Calc/Layout/Other/MeasureUnit" ) ); - sConfigurationProperty = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Metric" ) ); - } - else if ( xDocumentSI->supportsService( SERVICE_DRAWING_DOCUMENT ) ) - { - sConfigurationLocation = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.Draw/Layout/Other/MeasureUnit" ) ); - sConfigurationProperty = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Metric" ) ); - } - else if ( xDocumentSI->supportsService( SERVICE_PRESENTATION_DOCUMENT ) ) - { - sConfigurationLocation = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.Impress/Layout/Other/MeasureUnit" ) ); - sConfigurationProperty = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Metric" ) ); - } - - // read the measurement unit from the configuration - if ( sConfigurationLocation.getLength() && sConfigurationProperty.getLength() ) - { - ::utl::OConfigurationTreeRoot aConfigTree( ::utl::OConfigurationTreeRoot::createWithServiceFactory( - m_aContext.getLegacyServiceFactory(), sConfigurationLocation, -1, ::utl::OConfigurationTreeRoot::CM_READONLY ) ); - sal_Int32 nUnitAsInt = (sal_Int32)FUNIT_NONE; - aConfigTree.getNodeValue( sConfigurationProperty ) >>= nUnitAsInt; - - // if this denotes a valid (and accepted) unit, then use it - if ( ( nUnitAsInt > FUNIT_NONE ) && ( nUnitAsInt <= FUNIT_100TH_MM ) ) - eUnit = static_cast< FieldUnit >( nUnitAsInt ); - } - } - - if ( FUNIT_NONE == eUnit ) - { - MeasurementSystem eSystem = SvtSysLocale().GetLocaleData().getMeasurementSystemEnum(); - eUnit = MEASURE_METRIC == eSystem ? FUNIT_CM : FUNIT_INCH; - } - - return VCLUnoHelper::ConvertToMeasurementUnit( eUnit, 1 ); - } - - //------------------------------------------------------------------------ Reference< XRowSet > FormComponentPropertyHandler::impl_getRowSet_throw( ) const { Reference< XRowSet > xRowSet = m_xRowSet; diff --git a/extensions/source/propctrlr/formcomponenthandler.hxx b/extensions/source/propctrlr/formcomponenthandler.hxx index ad6f19cce98b..9b972896e856 100644 --- a/extensions/source/propctrlr/formcomponenthandler.hxx +++ b/extensions/source/propctrlr/formcomponenthandler.hxx @@ -174,10 +174,6 @@ namespace pcr */ bool impl_shouldExcludeProperty_nothrow( const ::com::sun::star::beans::Property& _rProperty ) const; - /** determines the default measure unit for the document in which our component lives - */ - sal_Int16 impl_getDocumentMeasurementUnit_throw() const; - /** initializes the list of field names, if we're handling a control which supports the DataField property */ diff --git a/extensions/source/propctrlr/formgeometryhandler.cxx b/extensions/source/propctrlr/formgeometryhandler.cxx new file mode 100644 index 000000000000..00cfb70ee31e --- /dev/null +++ b/extensions/source/propctrlr/formgeometryhandler.cxx @@ -0,0 +1,825 @@ +/************************************************************************* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2009 by Sun Microsystems, Inc. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +************************************************************************/ +
+// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_extensions.hxx" + +#include "propertyhandler.hxx" +#include "formmetadata.hxx" +#include "formstrings.hxx" +#include "handlerhelper.hxx" +#include "cellbindinghelper.hxx" + +/** === begin UNO includes === **/ +#include <com/sun/star/inspection/XObjectInspectorUI.hpp> +#include <com/sun/star/awt/XControlModel.hpp> +#include <com/sun/star/drawing/XControlShape.hpp> +#include <com/sun/star/container/XMap.hpp> +#include <com/sun/star/inspection/XNumericControl.hpp> +#include <com/sun/star/util/MeasureUnit.hpp> +#include <com/sun/star/text/TextContentAnchorType.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/sheet/XSpreadsheet.hpp> +#include <com/sun/star/table/XColumnRowRange.hpp> +#include <com/sun/star/table/XCellRange.hpp> +#include <com/sun/star/container/XChild.hpp> +#include <com/sun/star/form/XGridColumnFactory.hpp> +/** === end UNO includes === **/ + +#include <cppuhelper/interfacecontainer.hxx> +#include <comphelper/componentbase.hxx> +#include <tools/debug.hxx> +#include <tools/diagnose_ex.h> + +//........................................................................ +namespace pcr +{ +//........................................................................ + + /** === begin UNO using === **/ + using ::com::sun::star::uno::Reference; + using ::com::sun::star::uno::XInterface; + using ::com::sun::star::uno::UNO_QUERY; + using ::com::sun::star::uno::UNO_QUERY_THROW; + using ::com::sun::star::uno::UNO_SET_THROW; + using ::com::sun::star::uno::Exception; + using ::com::sun::star::uno::RuntimeException; + using ::com::sun::star::uno::Any; + using ::com::sun::star::uno::makeAny; + using ::com::sun::star::uno::Sequence; + using ::com::sun::star::uno::Type; + using ::com::sun::star::uno::XComponentContext; + using ::com::sun::star::beans::UnknownPropertyException; + using ::com::sun::star::beans::Property; + using ::com::sun::star::awt::XControlModel; + using ::com::sun::star::drawing::XControlShape; + using ::com::sun::star::container::XMap; + using ::com::sun::star::inspection::LineDescriptor; + using ::com::sun::star::inspection::XPropertyControlFactory; + using ::com::sun::star::lang::NullPointerException; + using ::com::sun::star::beans::Optional; + using ::com::sun::star::inspection::XNumericControl; + using ::com::sun::star::drawing::XShape; + using ::com::sun::star::beans::PropertyChangeEvent; + using ::com::sun::star::lang::EventObject; + using ::com::sun::star::beans::XPropertySet; + using ::com::sun::star::beans::XPropertyChangeListener; + using ::com::sun::star::text::TextContentAnchorType; + using ::com::sun::star::text::TextContentAnchorType_AT_PARAGRAPH; + using ::com::sun::star::text::TextContentAnchorType_AS_CHARACTER; + using ::com::sun::star::beans::XPropertySetInfo; + using ::com::sun::star::inspection::XObjectInspectorUI; + using ::com::sun::star::lang::XServiceInfo; + using ::com::sun::star::sheet::XSpreadsheet; + using ::com::sun::star::table::XColumnRowRange; + using ::com::sun::star::table::XTableColumns; + using ::com::sun::star::table::XTableRows; + using ::com::sun::star::table::XCellRange; + using ::com::sun::star::container::XIndexAccess; + using ::com::sun::star::container::XChild; + using ::com::sun::star::form::XGridColumnFactory; + /** === end UNO using === **/ + namespace MeasureUnit = ::com::sun::star::util::MeasureUnit; + + typedef ::com::sun::star::awt::Point AwtPoint; + typedef ::com::sun::star::awt::Size AwtSize; + + #define ANCHOR_TO_SHEET 0 + #define ANCHOR_TO_CELL 1 + + //==================================================================== + //= BroadcastHelperBase + //==================================================================== + class BroadcastHelperBase + { + protected: + BroadcastHelperBase( ::osl::Mutex& _rMutex ) + :maBHelper( _rMutex ) + { + } + + protected: + ::cppu::OBroadcastHelper& getBroadcastHelper() { return maBHelper; } + + private: + ::cppu::OBroadcastHelper maBHelper; + }; + + //==================================================================== + //= ShapeGeometryChangeNotifier - declaration + //==================================================================== + /** helper class to work around the ...unfortunate implementation of property change broadcasts + in the XShape implementation, which broadcasts way too generous and unspecified + */ + typedef ::comphelper::ComponentBase ShapeGeometryChangeNotifier_CBase; + typedef ::cppu::WeakImplHelper1 < ::com::sun::star::beans::XPropertyChangeListener + > ShapeGeometryChangeNotifier_IBase; + + class ShapeGeometryChangeNotifier :public BroadcastHelperBase + ,public ShapeGeometryChangeNotifier_CBase + ,public ShapeGeometryChangeNotifier_IBase + { + public: + ShapeGeometryChangeNotifier( ::cppu::OWeakObject& _rParent, ::osl::Mutex& _rParentMutex, const Reference< XShape >& _shape ) + :BroadcastHelperBase( _rParentMutex ) + ,ShapeGeometryChangeNotifier_CBase( BroadcastHelperBase::getBroadcastHelper(), ::comphelper::ComponentBase::NoInitializationNeeded() ) + ,ShapeGeometryChangeNotifier_IBase() + ,m_rParent( _rParent ) + ,m_aPropertyChangeListeners( _rParentMutex ) + ,m_xShape( _shape ) + { + ENSURE_OR_THROW( m_xShape.is(), "illegal shape!" ); + impl_init_nothrow(); + } + + // property change broadcasting + void addPropertyChangeListener( const Reference< XPropertyChangeListener >& _listener ) + { + m_aPropertyChangeListeners.addInterface( _listener ); + } + void removePropertyChangeListener( const Reference< XPropertyChangeListener >& _listener ) + { + m_aPropertyChangeListeners.removeInterface( _listener ); + } + + // XComponent equivalent + void dispose() + { + ::osl::MutexGuard aGuard( getMutex() ); + impl_dispose_nothrow(); + } + + // XInterface + virtual void SAL_CALL acquire( ) throw () + { + m_rParent.acquire(); + } + + virtual void SAL_CALL release( ) throw () + { + m_rParent.release(); + } + + // XPropertyChangeListener + virtual void SAL_CALL propertyChange( const PropertyChangeEvent& _event ) throw (RuntimeException); + + // XEventListener + virtual void SAL_CALL disposing( const EventObject& _event ) throw (RuntimeException); + + protected: + virtual ~ShapeGeometryChangeNotifier() + { + if ( !getBroadcastHelper().bDisposed ) + { + acquire(); + dispose(); + } + } + + protected: + ::cppu::OBroadcastHelper& getBroadcastHelper() { return BroadcastHelperBase::getBroadcastHelper(); } + + private: + void impl_init_nothrow(); + void impl_dispose_nothrow(); + + private: + ::cppu::OWeakObject& m_rParent; + ::cppu::OInterfaceContainerHelper m_aPropertyChangeListeners; + Reference< XShape > m_xShape; + }; + + //==================================================================== + //= FormGeometryHandler - declaration + //==================================================================== + class FormGeometryHandler; + typedef HandlerComponentBase< FormGeometryHandler > FormGeometryHandler_Base; + /** a property handler for any virtual string properties + */ + class FormGeometryHandler : public FormGeometryHandler_Base + { + public: + FormGeometryHandler( + const Reference< XComponentContext >& _rxContext + ); + + static ::rtl::OUString SAL_CALL getImplementationName_static( ) throw (RuntimeException); + static Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames_static( ) throw (RuntimeException); + + protected: + ~FormGeometryHandler(); + + protected: + // XPropertyHandler overriables + virtual Any SAL_CALL getPropertyValue( const ::rtl::OUString& _rPropertyName ) throw (UnknownPropertyException, RuntimeException); + virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& _rPropertyName, const Any& _rValue ) throw (UnknownPropertyException, RuntimeException); + virtual LineDescriptor SAL_CALL describePropertyLine( const ::rtl::OUString& _rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControlFactory >& _rxControlFactory ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::NullPointerException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& _rxListener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removePropertyChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& _rxListener ) throw (::com::sun::star::uno::RuntimeException); + virtual Sequence< ::rtl::OUString > SAL_CALL getActuatingProperties( ) throw (RuntimeException); + virtual void SAL_CALL actuatingPropertyChanged( const ::rtl::OUString& _rActuatingPropertyName, const Any& _rNewValue, const Any& _rOldValue, const Reference< XObjectInspectorUI >& _rxInspectorUI, sal_Bool _bFirstTimeInit ) throw (NullPointerException, RuntimeException); + + // OComponentHandler overridables + virtual void SAL_CALL disposing(); + + // PropertyHandler overridables + virtual Sequence< Property > SAL_CALL doDescribeSupportedProperties() const; + + protected: + virtual void onNewComponent(); + + private: + bool impl_haveTextAnchorType_nothrow() const; + bool impl_haveSheetAnchorType_nothrow() const; + void impl_setSheetAnchorType_nothrow( const sal_Int32 _nAnchorType ) const; + + private: + Reference< XControlShape > m_xAssociatedShape; + Reference< XPropertySet > m_xShapeProperties; + ::rtl::Reference< ShapeGeometryChangeNotifier > m_xChangeNotifier; + }; + + //==================================================================== + //= FormGeometryHandler - implementation + //==================================================================== + DBG_NAME( FormGeometryHandler ) + //-------------------------------------------------------------------- + FormGeometryHandler::FormGeometryHandler( const Reference< XComponentContext >& _rxContext ) + :FormGeometryHandler_Base( _rxContext ) + { + DBG_CTOR( FormGeometryHandler, NULL ); + } + + //-------------------------------------------------------------------- + FormGeometryHandler::~FormGeometryHandler( ) + { + if ( !rBHelper.bDisposed ) + { + acquire(); + dispose(); + } + + DBG_DTOR( FormGeometryHandler, NULL ); + } + + //-------------------------------------------------------------------- + void FormGeometryHandler::onNewComponent() + { + if ( m_xChangeNotifier.is() ) + { + m_xChangeNotifier->dispose(); + m_xChangeNotifier.clear(); + } + m_xAssociatedShape.clear(); + m_xShapeProperties.clear(); + + FormGeometryHandler_Base::onNewComponent(); + + try + { + Reference< XControlModel > xControlModel( m_xComponent, UNO_QUERY ); + if ( xControlModel.is() ) + { + // do not ask the map for shapes for grid control columns .... + Reference< XChild > xCompChild( m_xComponent, UNO_QUERY_THROW ); + Reference< XGridColumnFactory > xCheckGrid( xCompChild->getParent(), UNO_QUERY ); + if ( !xCheckGrid.is() ) + { + Reference< XMap > xControlMap( m_aContext.getContextValueByAsciiName( "ControlShapeAccess" ), UNO_QUERY_THROW ); + m_xAssociatedShape.set( xControlMap->get( makeAny( xControlModel ) ), UNO_QUERY_THROW ); + m_xShapeProperties.set( m_xAssociatedShape, UNO_QUERY_THROW ); + } + } + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + + if ( m_xAssociatedShape.is() ) + m_xChangeNotifier = new ShapeGeometryChangeNotifier( *this, m_aMutex, m_xAssociatedShape.get() ); + } + + //-------------------------------------------------------------------- + ::rtl::OUString SAL_CALL FormGeometryHandler::getImplementationName_static( ) throw (RuntimeException) + { + return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.extensions.FormGeometryHandler" ) ); + } + + //-------------------------------------------------------------------- + Sequence< ::rtl::OUString > SAL_CALL FormGeometryHandler::getSupportedServiceNames_static( ) throw (RuntimeException) + { + Sequence< ::rtl::OUString > aSupported( 1 ); + aSupported[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.inspection.FormGeometryHandler" ) ); + return aSupported; + } + + //-------------------------------------------------------------------- + Any SAL_CALL FormGeometryHandler::getPropertyValue( const ::rtl::OUString& _rPropertyName ) throw (UnknownPropertyException, RuntimeException) + { + ::osl::MutexGuard aGuard( m_aMutex ); + PropertyId nPropId( impl_getPropertyId_throw( _rPropertyName ) ); + + ENSURE_OR_THROW2( m_xAssociatedShape.is(), "internal error: properties, but no shape!", *this ); + ENSURE_OR_THROW2( m_xShapeProperties.is(), "internal error: no shape properties!", *this ); + + Any aReturn; + try + { + switch ( nPropId ) + { + case PROPERTY_ID_POSITIONX: + aReturn <<= m_xAssociatedShape->getPosition().X; + break; + case PROPERTY_ID_POSITIONY: + aReturn <<= m_xAssociatedShape->getPosition().Y; + break; + case PROPERTY_ID_WIDTH: + aReturn <<= m_xAssociatedShape->getSize().Width; + break; + case PROPERTY_ID_HEIGHT: + aReturn <<= m_xAssociatedShape->getSize().Height; + break; + case PROPERTY_ID_TEXT_ANCHOR_TYPE: + aReturn = m_xShapeProperties->getPropertyValue( PROPERTY_ANCHOR_TYPE ); + OSL_ENSURE( aReturn.hasValue(), "FormGeometryHandler::getPropertyValue: illegal anchor type!" ); + break; + case PROPERTY_ID_SHEET_ANCHOR_TYPE: + { + Reference< XSpreadsheet > xAnchorSheet( m_xShapeProperties->getPropertyValue( PROPERTY_ANCHOR ), UNO_QUERY ); + aReturn <<= sal_Int32( xAnchorSheet.is() ? ANCHOR_TO_SHEET : ANCHOR_TO_CELL ); + } + break; + + default: + OSL_ENSURE( false, "FormGeometryHandler::getPropertyValue: huh?" ); + break; + } + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + return aReturn; + } + + //-------------------------------------------------------------------- + void SAL_CALL FormGeometryHandler::setPropertyValue( const ::rtl::OUString& _rPropertyName, const Any& _rValue ) throw (UnknownPropertyException, RuntimeException) + { + ::osl::MutexGuard aGuard( m_aMutex ); + PropertyId nPropId( impl_getPropertyId_throw( _rPropertyName ) ); + + ENSURE_OR_THROW2( m_xAssociatedShape.is(), "internal error: properties, but no shape!", *this ); + ENSURE_OR_THROW2( m_xShapeProperties.is(), "internal error: properties, but no shape!", *this ); + + try + { + switch ( nPropId ) + { + case PROPERTY_ID_POSITIONX: + case PROPERTY_ID_POSITIONY: + { + sal_Int32 nPosition(0); + OSL_VERIFY( _rValue >>= nPosition ); + + AwtPoint aPos( m_xAssociatedShape->getPosition() ); + if ( nPropId == PROPERTY_ID_POSITIONX ) + aPos.X = nPosition; + else + aPos.Y = nPosition; + m_xAssociatedShape->setPosition( aPos ); + } + break; + + case PROPERTY_ID_WIDTH: + case PROPERTY_ID_HEIGHT: + { + sal_Int32 nSize(0); + OSL_VERIFY( _rValue >>= nSize ); + + AwtSize aSize( m_xAssociatedShape->getSize() ); + if ( nPropId == PROPERTY_ID_WIDTH ) + aSize.Width = nSize; + else + aSize.Height = nSize; + m_xAssociatedShape->setSize( aSize ); + } + break; + + case PROPERTY_ID_TEXT_ANCHOR_TYPE: + m_xShapeProperties->setPropertyValue( PROPERTY_ANCHOR_TYPE, _rValue ); + break; + + case PROPERTY_ID_SHEET_ANCHOR_TYPE: + { + sal_Int32 nSheetAnchorType = 0; + OSL_VERIFY( _rValue >>= nSheetAnchorType ); + impl_setSheetAnchorType_nothrow( nSheetAnchorType ); + } + break; + + default: + OSL_ENSURE( false, "FormGeometryHandler::getPropertyValue: huh?" ); + break; + } + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + } + + //-------------------------------------------------------------------- + LineDescriptor SAL_CALL FormGeometryHandler::describePropertyLine( const ::rtl::OUString& _rPropertyName, + const Reference< XPropertyControlFactory >& _rxControlFactory ) + throw (UnknownPropertyException, NullPointerException, RuntimeException) + { + ::osl::MutexGuard aGuard( m_aMutex ); + PropertyId nPropId( impl_getPropertyId_throw( _rPropertyName ) ); + + LineDescriptor aLineDesc( PropertyHandler::describePropertyLine( _rPropertyName, _rxControlFactory ) ); + try + { + bool bIsSize = false; + switch ( nPropId ) + { + case PROPERTY_ID_WIDTH: + case PROPERTY_ID_HEIGHT: + bIsSize = true; + // NO break! + case PROPERTY_ID_POSITIONX: + case PROPERTY_ID_POSITIONY: + { + Optional< double > aZero( sal_True, 0 ); + Optional< double > aValueNotPresent( sal_False, 0 ); + aLineDesc.Control = PropertyHandlerHelper::createNumericControl( + _rxControlFactory, 2, bIsSize ? aZero : aValueNotPresent, aValueNotPresent, sal_False ); + + Reference< XNumericControl > xNumericControl( aLineDesc.Control, UNO_QUERY_THROW ); + xNumericControl->setValueUnit( MeasureUnit::MM_100TH ); + xNumericControl->setDisplayUnit( impl_getDocumentMeasurementUnit_throw() ); + } + break; + + case PROPERTY_ID_TEXT_ANCHOR_TYPE: + case PROPERTY_ID_SHEET_ANCHOR_TYPE: + // default handling from PropertyHandler is sufficient + break; + + default: + OSL_ENSURE( false, "FormGeometryHandler::describePropertyLine: huh?" ); + break; + } + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + return aLineDesc; + } + + //-------------------------------------------------------------------- + void SAL_CALL FormGeometryHandler::addPropertyChangeListener( const Reference< XPropertyChangeListener >& _listener ) throw (RuntimeException) + { + ::osl::MutexGuard aGuard( m_aMutex ); + OSL_PRECOND( m_xChangeNotifier.is(), "FormGeometryHandler::addPropertyChangeListener: no notified, implies no shape!?" ); + if ( m_xChangeNotifier.is() ) + m_xChangeNotifier->addPropertyChangeListener( _listener ); + } + + //-------------------------------------------------------------------- + void SAL_CALL FormGeometryHandler::removePropertyChangeListener( const Reference< XPropertyChangeListener >& _listener ) throw (RuntimeException) + { + ::osl::MutexGuard aGuard( m_aMutex ); + OSL_PRECOND( m_xChangeNotifier.is(), "FormGeometryHandler::removePropertyChangeListener: no notified, implies no shape!?" ); + if ( m_xChangeNotifier.is() ) + m_xChangeNotifier->removePropertyChangeListener( _listener ); + } + + //-------------------------------------------------------------------- + Sequence< ::rtl::OUString > SAL_CALL FormGeometryHandler::getActuatingProperties( ) throw (RuntimeException) + { + Sequence< ::rtl::OUString > aInterestedIn(1); + aInterestedIn[0] = PROPERTY_TEXT_ANCHOR_TYPE; + return aInterestedIn; + } + + //-------------------------------------------------------------------- + void SAL_CALL FormGeometryHandler::actuatingPropertyChanged( const ::rtl::OUString& _rActuatingPropertyName, const Any& _rNewValue, const Any& /*_rOldValue*/, const Reference< XObjectInspectorUI >& _rxInspectorUI, sal_Bool /*_bFirstTimeInit*/ ) throw (NullPointerException, RuntimeException) + { + if ( !_rxInspectorUI.is() ) + throw NullPointerException(); + + ::osl::MutexGuard aGuard( m_aMutex ); + PropertyId nActuatingPropId( impl_getPropertyId_throw( _rActuatingPropertyName ) ); + + switch ( nActuatingPropId ) + { + case PROPERTY_ID_TEXT_ANCHOR_TYPE: + { + TextContentAnchorType eAnchorType( TextContentAnchorType_AT_PARAGRAPH ); + OSL_VERIFY( _rNewValue >>= eAnchorType ); + _rxInspectorUI->enablePropertyUI( PROPERTY_POSITIONX, eAnchorType != TextContentAnchorType_AS_CHARACTER ); + } + break; + default: + OSL_ENSURE( false, "FormGeometryHandler::actuatingPropertyChanged: not registered for this property!" ); + break; + } + } + + //-------------------------------------------------------------------- + Sequence< Property > SAL_CALL FormGeometryHandler::doDescribeSupportedProperties() const + { + if ( !m_xAssociatedShape.is() ) + return Sequence< Property >(); + + ::std::vector< Property > aProperties; + + addInt32PropertyDescription( aProperties, PROPERTY_POSITIONX ); + addInt32PropertyDescription( aProperties, PROPERTY_POSITIONY ); + addInt32PropertyDescription( aProperties, PROPERTY_WIDTH ); + addInt32PropertyDescription( aProperties, PROPERTY_HEIGHT ); + + if ( impl_haveTextAnchorType_nothrow() ) + implAddPropertyDescription( aProperties, PROPERTY_TEXT_ANCHOR_TYPE, ::cppu::UnoType< TextContentAnchorType >::get() ); + + if ( impl_haveSheetAnchorType_nothrow() ) + addInt32PropertyDescription( aProperties, PROPERTY_SHEET_ANCHOR_TYPE ); + + return Sequence< Property >( &(*aProperties.begin()), aProperties.size() ); + } + + //-------------------------------------------------------------------- + void SAL_CALL FormGeometryHandler::disposing() + { + FormGeometryHandler_Base::disposing(); + + if ( m_xChangeNotifier.is() ) + { + m_xChangeNotifier->dispose(); + m_xChangeNotifier.clear(); + } + } + + //-------------------------------------------------------------------- + bool FormGeometryHandler::impl_haveTextAnchorType_nothrow() const + { + ENSURE_OR_THROW( m_xShapeProperties.is(), "not to be called without shape properties" ); + try + { + Reference< XPropertySetInfo > xPSI( m_xShapeProperties->getPropertySetInfo(), UNO_SET_THROW ); + if ( xPSI->hasPropertyByName( PROPERTY_ANCHOR_TYPE ) ) + return true; + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + return false; + } + + //-------------------------------------------------------------------- + bool FormGeometryHandler::impl_haveSheetAnchorType_nothrow() const + { + ENSURE_OR_THROW( m_xShapeProperties.is(), "not to be called without shape properties" ); + try + { + Reference< XPropertySetInfo > xPSI( m_xShapeProperties->getPropertySetInfo(), UNO_SET_THROW ); + if ( !xPSI->hasPropertyByName( PROPERTY_ANCHOR ) ) + return false; + Reference< XServiceInfo > xSI( m_xAssociatedShape, UNO_QUERY_THROW ); + if ( xSI->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sheet.Shape" ) ) ) ) + return true; + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + return false; + } + + //-------------------------------------------------------------------- + namespace + { + static sal_Int32 lcl_getLowerBoundRowOrColumn( const Reference< XIndexAccess >& _rxRowsOrColumns, const bool _bRows, + const AwtPoint& _rRelativePosition ) + { + sal_Int32 nAccumulated = 0; + + const sal_Int32& rRelativePos = _bRows ? _rRelativePosition.Y : _rRelativePosition.X; + + sal_Int32 nElements = _rxRowsOrColumns->getCount(); + sal_Int32 currentPos = 0; + for ( currentPos=0; currentPos<nElements; ++currentPos ) + { + Reference< XPropertySet > xRowOrColumn( _rxRowsOrColumns->getByIndex( currentPos ), UNO_QUERY_THROW ); + + sal_Bool bIsVisible = sal_True; + OSL_VERIFY( xRowOrColumn->getPropertyValue( PROPERTY_IS_VISIBLE ) >>= bIsVisible ); + if ( !bIsVisible ) + continue; + + sal_Int32 nHeightOrWidth( 0 ); + OSL_VERIFY( xRowOrColumn->getPropertyValue( _bRows ? PROPERTY_HEIGHT : PROPERTY_WIDTH ) >>= nHeightOrWidth ); + + if ( nAccumulated + nHeightOrWidth > rRelativePos ) + break; + + nAccumulated += nHeightOrWidth; + } + + return currentPos; + } + } + + //-------------------------------------------------------------------- + void FormGeometryHandler::impl_setSheetAnchorType_nothrow( const sal_Int32 _nAnchorType ) const + { + ENSURE_OR_THROW( m_xShapeProperties.is(), "illegal to be called without shape properties." ); + try + { + CellBindingHelper aHelper( m_xComponent, impl_getContextDocument_nothrow() ); + // find the sheet which the control belongs to + Reference< XSpreadsheet > xSheet; + aHelper.getControlSheetIndex( xSheet ); + + switch ( _nAnchorType ) + { + case ANCHOR_TO_SHEET: + OSL_ENSURE( xSheet.is(), + "FormGeometryHandler::impl_setSheetAnchorType_nothrow: sheet not found!" ); + if ( xSheet.is() ) + { + AwtPoint aPreservePosition( m_xAssociatedShape->getPosition() ); + m_xShapeProperties->setPropertyValue( PROPERTY_ANCHOR, makeAny( xSheet ) ); + m_xAssociatedShape->setPosition( aPreservePosition ); + } + break; + + case ANCHOR_TO_CELL: + { + Reference< XColumnRowRange > xColsRows( xSheet, UNO_QUERY_THROW ); + + // get the current anchor + Reference< XSpreadsheet > xCurrentAnchor; + OSL_VERIFY( m_xShapeProperties->getPropertyValue( PROPERTY_ANCHOR ) >>= xCurrentAnchor ); + OSL_ENSURE( xCurrentAnchor.is(), "FormGeometryHandler::impl_setSheetAnchorType_nothrow: only to be called when currently anchored to a sheet!" ); + + // get the current position + AwtPoint aRelativePosition( m_xAssociatedShape->getPosition() ); + + Reference< XTableColumns > xCols( xColsRows->getColumns(), UNO_SET_THROW ); + sal_Int32 nNewAnchorCol = lcl_getLowerBoundRowOrColumn( xCols.get(), false, aRelativePosition ); + + Reference< XTableRows > xRows( xColsRows->getRows(), UNO_SET_THROW ); + sal_Int32 nNewAnchorRow = lcl_getLowerBoundRowOrColumn( xRows.get(), true, aRelativePosition ); + + Reference< XCellRange > xSheetCellRange( xSheet, UNO_QUERY_THROW ); + Any aNewAnchorCell( xSheetCellRange->getCellByPosition( nNewAnchorCol, nNewAnchorRow ) ); + m_xShapeProperties->setPropertyValue( PROPERTY_ANCHOR, aNewAnchorCell ); + } + break; + + default: + OSL_ENSURE( false, "FormGeometryHandler::impl_setSheetAnchorType_nothrow: illegal anchor type!" ); + break; + } + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + } + + //==================================================================== + //= ShapeGeometryChangeNotifier - implementation + //==================================================================== + namespace + { + struct EventTranslation + { + ::rtl::OUString sPropertyName; + Any aNewPropertyValue; + + EventTranslation( const ::rtl::OUString& _propertyName, const Any& _newPropertyValue ) + :sPropertyName( _propertyName ) + ,aNewPropertyValue( _newPropertyValue ) + { + } + }; + } + + //-------------------------------------------------------------------- + void SAL_CALL ShapeGeometryChangeNotifier::propertyChange( const PropertyChangeEvent& _event ) throw (RuntimeException) + { + ::comphelper::ComponentMethodGuard aGuard( *this ); + + ::std::vector< EventTranslation > aEventTranslations; + aEventTranslations.reserve(2); + + if ( _event.PropertyName.equalsAscii( "Position" ) ) + { + AwtPoint aPos = m_xShape->getPosition(); + aEventTranslations.push_back( EventTranslation( PROPERTY_POSITIONX, makeAny( aPos.X ) ) ); + aEventTranslations.push_back( EventTranslation( PROPERTY_POSITIONY, makeAny( aPos.Y ) ) ); + } + else if ( _event.PropertyName.equalsAscii( "Size" ) ) + { + AwtSize aSize = m_xShape->getSize(); + aEventTranslations.push_back( EventTranslation( PROPERTY_WIDTH, makeAny( aSize.Width ) ) ); + aEventTranslations.push_back( EventTranslation( PROPERTY_HEIGHT, makeAny( aSize.Height ) ) ); + } + else if ( _event.PropertyName == PROPERTY_ANCHOR_TYPE ) + { + aEventTranslations.push_back( EventTranslation( PROPERTY_TEXT_ANCHOR_TYPE, makeAny( _event.NewValue ) ) ); + } + else if ( _event.PropertyName == PROPERTY_ANCHOR ) + { + aEventTranslations.push_back( EventTranslation( PROPERTY_SHEET_ANCHOR_TYPE, makeAny( _event.NewValue ) ) ); + } + + PropertyChangeEvent aTranslatedEvent( _event ); + aTranslatedEvent.Source = m_rParent; + + aGuard.clear(); + for ( ::std::vector< EventTranslation >::const_iterator t = aEventTranslations.begin(); + t != aEventTranslations.end(); + ++t + ) + { + aTranslatedEvent.PropertyName = t->sPropertyName; + aTranslatedEvent.NewValue = t->aNewPropertyValue; + m_aPropertyChangeListeners.notifyEach( &XPropertyChangeListener::propertyChange, aTranslatedEvent ); + } + } + + //-------------------------------------------------------------------- + void SAL_CALL ShapeGeometryChangeNotifier::disposing( const EventObject& /*_event*/ ) throw (RuntimeException) + { + ::comphelper::ComponentMethodGuard aGuard( *this ); + impl_dispose_nothrow(); + } + + //-------------------------------------------------------------------- + void ShapeGeometryChangeNotifier::impl_init_nothrow() + { + osl_incrementInterlockedCount( &m_refCount ); + try + { + Reference< XPropertySet > xShapeProperties( m_xShape, UNO_QUERY_THROW ); + xShapeProperties->addPropertyChangeListener( ::rtl::OUString(), this ); + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + osl_decrementInterlockedCount( &m_refCount ); + } + + //-------------------------------------------------------------------- + void ShapeGeometryChangeNotifier::impl_dispose_nothrow() + { + try + { + Reference< XPropertySet > xShapeProperties( m_xShape, UNO_QUERY_THROW ); + xShapeProperties->removePropertyChangeListener( ::rtl::OUString(), this ); + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + + getBroadcastHelper().bDisposed = true; + } + +//........................................................................ +} // namespace pcr +//........................................................................ + +extern "C" void SAL_CALL createRegistryInfo_FormGeometryHandler() +{ + ::pcr::FormGeometryHandler::registerImplementation(); +} diff --git a/extensions/source/propctrlr/formmetadata.cxx b/extensions/source/propctrlr/formmetadata.cxx index 70ae992e7044..ccfc3f746ef7 100644 --- a/extensions/source/propctrlr/formmetadata.cxx +++ b/extensions/source/propctrlr/formmetadata.cxx @@ -284,21 +284,23 @@ namespace pcr DEF_INFO_3( SPIN, SPIN, SPIN, FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ), DEF_INFO_3( REPEAT, REPEAT, REPEAT, FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ), DEF_INFO_3( REPEAT_DELAY, REPEAT_DELAY, REPEAT_DELAY, FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ), - DEF_INFO_3( TOGGLE, TOGGLE, TOGGLE, FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ), - DEF_INFO_3( FOCUSONCLICK, FOCUSONCLICK, FOCUSONCLICK, FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ), DEF_INFO_3( VISIBLESIZE, VISIBLESIZE, VISIBLESIZE, FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ), DEF_INFO_4( ORIENTATION, ORIENTATION, ORIENTATION, FORM_VISIBLE, DIALOG_VISIBLE, ENUM, COMPOSEABLE ), + DEF_INFO_3( FOCUSONCLICK, FOCUSONCLICK, FOCUSONCLICK, FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ), + DEF_INFO_3( TOGGLE, TOGGLE, TOGGLE, FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ), + DEF_INFO_3( DEFAULT_STATE, DEFAULT_STATE, DEFAULT_STATE, FORM_VISIBLE, ENUM, COMPOSEABLE ), - DEF_INFO_2( CLASSID, CLASSID, CLASSID, FORM_VISIBLE, COMPOSEABLE ), - DEF_INFO_3( HEIGHT, HEIGHT, HEIGHT, FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ), - DEF_INFO_3( WIDTH, WIDTH, WIDTH, FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ), + DEF_INFO_3( TEXT_ANCHOR_TYPE, ANCHOR_TYPE, ANCHOR_TYPE, FORM_VISIBLE, ENUM, COMPOSEABLE ), + DEF_INFO_3( SHEET_ANCHOR_TYPE, ANCHOR_TYPE, ANCHOR_TYPE, FORM_VISIBLE, ENUM, COMPOSEABLE ), DEF_INFO_3( POSITIONX, POSITIONX, POSITIONX, FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ), DEF_INFO_3( POSITIONY, POSITIONY, POSITIONY, FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ), + DEF_INFO_3( WIDTH, WIDTH, WIDTH, FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ), + DEF_INFO_3( HEIGHT, HEIGHT, HEIGHT, FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ), DEF_INFO_1( LISTINDEX, LISTINDEX, LISTINDEX, FORM_VISIBLE ), DEF_INFO_3( STRINGITEMLIST, STRINGITEMLIST, STRINGITEMLIST, FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ), DEF_INFO_2( DEFAULT_TEXT, DEFAULTTEXT, DEFAULTVALUE, FORM_VISIBLE, COMPOSEABLE ), - DEF_INFO_3( FONT_NAME, FONT, FONT, FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ), + DEF_INFO_3( FONT, FONT, FONT, FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ), DEF_INFO_4( VISUALEFFECT, VISUALEFFECT, VISUALEFFECT, FORM_VISIBLE, DIALOG_VISIBLE, ENUM_ONE, COMPOSEABLE ), DEF_INFO_4( ALIGN, ALIGN, ALIGN, FORM_VISIBLE, DIALOG_VISIBLE, ENUM, COMPOSEABLE ), DEF_INFO_3( VERTICAL_ALIGN, VERTICAL_ALIGN, VERTICAL_ALIGN, FORM_VISIBLE, ENUM, COMPOSEABLE ), @@ -337,7 +339,6 @@ namespace pcr DEF_INFO_3( SUBMIT_ENCODING, SUBMIT_ENCODING, SUBMIT_ENCODING, FORM_VISIBLE, ENUM, COMPOSEABLE ), DEF_INFO_3( SUBMIT_METHOD, SUBMIT_METHOD, SUBMIT_METHOD, FORM_VISIBLE, ENUM, COMPOSEABLE ), DEF_INFO_3( STATE, STATE, STATE, DIALOG_VISIBLE, ENUM, COMPOSEABLE ), - DEF_INFO_3( DEFAULTCHECKED, DEFAULT_CHECKED, DEFAULT_CHECKED, FORM_VISIBLE, ENUM, COMPOSEABLE ), DEF_INFO_3( DEFAULTBUTTON, DEFAULT_BUTTON, DEFAULT_BUTTON, FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ), DEF_INFO_3( IMAGE_URL, IMAGE_URL, IMAGE_URL, FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ), DEF_INFO_4( IMAGEPOSITION, IMAGEPOSITION, IMAGEPOSITION, FORM_VISIBLE, DIALOG_VISIBLE, ENUM, COMPOSEABLE ), @@ -469,7 +470,7 @@ namespace pcr case PROPERTY_ID_TIMEFORMAT: nStringItemsResId = RID_RSC_ENUM_TIMEFORMAT_LIST; break; - case PROPERTY_ID_DEFAULTCHECKED: + case PROPERTY_ID_DEFAULT_STATE: case PROPERTY_ID_STATE: nStringItemsResId = RID_RSC_ENUM_CHECKED; break; @@ -512,6 +513,12 @@ namespace pcr case PROPERTY_ID_WRITING_MODE: nStringItemsResId = RID_RSC_ENUM_WRITING_MODE; break; + case PROPERTY_ID_TEXT_ANCHOR_TYPE: + nStringItemsResId = RID_RSC_ENUM_TEXT_ANCHOR_TYPE; + break; + case PROPERTY_ID_SHEET_ANCHOR_TYPE: + nStringItemsResId = RID_RSC_ENUM_SHEET_ANCHOR_TYPE; + break; default: OSL_ENSURE( sal_False, "OPropertyInfoService::getPropertyEnumRepresentations: unknown enum property!" ); break; diff --git a/extensions/source/propctrlr/formmetadata.hxx b/extensions/source/propctrlr/formmetadata.hxx index b1b23153dbdb..b49fae5cf3d8 100644 --- a/extensions/source/propctrlr/formmetadata.hxx +++ b/extensions/source/propctrlr/formmetadata.hxx @@ -200,7 +200,7 @@ namespace pcr #define PROPERTY_ID_LISTINDEX 56 #define PROPERTY_ID_STRINGITEMLIST 57 #define PROPERTY_ID_DEFAULT_TEXT 58 - #define PROPERTY_ID_FONT_NAME 59 + #define PROPERTY_ID_FONT 59 #define PROPERTY_ID_ALIGN 60 #define PROPERTY_ID_ROWHEIGHT 61 #define PROPERTY_ID_BACKGROUNDCOLOR 62 @@ -225,7 +225,7 @@ namespace pcr #define PROPERTY_ID_SUBMIT_TARGET 81 #define PROPERTY_ID_SUBMIT_METHOD 82 #define PROPERTY_ID_SUBMIT_ENCODING 83 - #define PROPERTY_ID_DEFAULTCHECKED 84 + #define PROPERTY_ID_DEFAULT_STATE 84 #define PROPERTY_ID_DEFAULTBUTTON 85 #define PROPERTY_ID_IMAGE_URL 86 #define PROPERTY_ID_DEFAULT_SELECT_SEQ 87 @@ -340,6 +340,8 @@ namespace pcr #define PROPERTY_ID_SCALE_MODE 196 #define PROPERTY_ID_INPUT_REQUIRED 197 #define PROPERTY_ID_WRITING_MODE 198 + #define PROPERTY_ID_TEXT_ANCHOR_TYPE 199 + #define PROPERTY_ID_SHEET_ANCHOR_TYPE 200 //............................................................................ } // namespace pcr diff --git a/extensions/source/propctrlr/formres.src b/extensions/source/propctrlr/formres.src index 084825dfd05c..224587b11729 100644 --- a/extensions/source/propctrlr/formres.src +++ b/extensions/source/propctrlr/formres.src @@ -426,7 +426,7 @@ String RID_STR_SUBMIT_METHOD { Text [ en-US ] = "Type of submission" ; }; -String RID_STR_DEFAULT_CHECKED +String RID_STR_DEFAULT_STATE { Text [ en-US ] = "Default status" ; }; @@ -1430,3 +1430,73 @@ Resource RID_RSC_ENUM_WRITING_MODE Text [ en-US ] = "Use superordinate object settings"; }; }; + +String RID_STR_ANCHOR_TYPE +{ + Text [ en-US ] = "Anchor"; +}; + +Resource RID_RSC_ENUM_TEXT_ANCHOR_TYPE +{ + String 1 + { + Text [ en-US ] = "To Paragraph"; + }; + String 2 + { + Text [ en-US ] = "As Character"; + }; + String 3 + { + Text [ en-US ] = "To Page"; + }; + String 4 + { + Text [ en-US ] = "To Frame"; + }; + String 5 + { + Text [ en-US ] = "To Character"; + }; +}; + +Resource RID_RSC_ENUM_SHEET_ANCHOR_TYPE +{ + String 1 + { + Text [ en-US ] = "To Page"; + }; + String 2 + { + Text [ en-US ] = "To Cell"; + }; +}; + +String RID_STR_FONTSTYLE_REGULAR +{ + Text [ en-US ] = "Regular"; + Text [ x-comment ] = "That's the 'Regular' as used for a font style (as opposed to 'italic' and 'bold'), so please use a consistent translation."; +}; + +String RID_STR_FONTSTYLE_BOLD_ITALIC +{ + Text [ en-US ] = "Bold Italic"; + Text [ x-comment ] = "That's the 'Bold Italic' as used for a font style, so please use a consistent translation."; +}; + +String RID_STR_FONTSTYLE_ITALIC +{ + Text [ en-US ] = "Italic"; + Text [ x-comment ] = "That's the 'Italic' as used for a font style, so please use a consistent translation."; +}; + +String RID_STR_FONTSTYLE_BOLD +{ + Text [ en-US ] = "Bold"; + Text [ x-comment ] = "That's the 'Bold' as used for a font style, so please use a consistent translation."; +}; + +String RID_STR_FONT_DEFAULT +{ + Text [ en-US ] = "(Default)"; +}; diff --git a/extensions/source/propctrlr/formresid.hrc b/extensions/source/propctrlr/formresid.hrc index cfd9e7aaebfe..ad10cfd379e2 100644 --- a/extensions/source/propctrlr/formresid.hrc +++ b/extensions/source/propctrlr/formresid.hrc @@ -132,7 +132,7 @@ #define RID_STR_SUBMIT_TARGET ( RID_FORMBROWSER_START + 101 ) #define RID_STR_SUBMIT_METHOD ( RID_FORMBROWSER_START + 102 ) #define RID_STR_SUBMIT_ENCODING ( RID_FORMBROWSER_START + 103 ) -#define RID_STR_DEFAULT_CHECKED ( RID_FORMBROWSER_START + 104 ) +#define RID_STR_DEFAULT_STATE ( RID_FORMBROWSER_START + 104 ) #define RID_STR_DEFAULT_BUTTON ( RID_FORMBROWSER_START + 105 ) #define RID_STR_IMAGE_URL ( RID_FORMBROWSER_START + 106 ) #define RID_STR_DEFAULT_SELECT_SEQ ( RID_FORMBROWSER_START + 107 ) @@ -222,7 +222,7 @@ #define RID_STR_BOUND_CELL ( RID_FORMBROWSER_START + 191 ) #define RID_STR_LIST_CELL_RANGE ( RID_FORMBROWSER_START + 192 ) #define RID_STR_CELL_EXCHANGE_TYPE ( RID_FORMBROWSER_START + 193 ) - // FREE +#define RID_STR_ANCHOR_TYPE ( RID_FORMBROWSER_START + 194 ) #define RID_STR_SCROLLVALUE_MIN ( RID_FORMBROWSER_START + 195 ) #define RID_STR_DEFAULT_SCROLLVALUE ( RID_FORMBROWSER_START + 196 ) #define RID_STR_REPEAT_DELAY ( RID_FORMBROWSER_START + 197 ) @@ -279,7 +279,12 @@ #define RID_STR_SHOWS_ROOT_HANDLES ( RID_FORMBROWSER_START + 247 ) #define RID_STR_EDITABLE ( RID_FORMBROWSER_START + 248 ) #define RID_STR_INVOKES_STOP_NOT_EDITING ( RID_FORMBROWSER_START + 249 ) -#define RID_STR_NOLABEL ( RID_FORMBROWSER_START + 250 ) +#define RID_STR_NOLABEL ( RID_FORMBROWSER_START + 250 ) +#define RID_STR_FONTSTYLE_REGULAR ( RID_FORMBROWSER_START + 251 ) +#define RID_STR_FONTSTYLE_BOLD_ITALIC ( RID_FORMBROWSER_START + 252 ) +#define RID_STR_FONTSTYLE_ITALIC ( RID_FORMBROWSER_START + 253 ) +#define RID_STR_FONTSTYLE_BOLD ( RID_FORMBROWSER_START + 254 ) +#define RID_STR_FONT_DEFAULT ( RID_FORMBROWSER_START + 255 ) // ----------------------------------------------------------------------- @@ -340,6 +345,8 @@ #define RID_RSC_ENUM_YESNO ( RID_PROPCONTROLLER_START + 27 ) #define RID_RSC_ENUM_SHOWHIDE ( RID_PROPCONTROLLER_START + 28 ) #define RID_RSC_ENUM_WRITING_MODE ( RID_PROPCONTROLLER_START + 29 ) +#define RID_RSC_ENUM_TEXT_ANCHOR_TYPE ( RID_PROPCONTROLLER_START + 30 ) +#define RID_RSC_ENUM_SHEET_ANCHOR_TYPE ( RID_PROPCONTROLLER_START + 31 ) // ----------------------------------------------------------------------- // - ImageList - local ids diff --git a/extensions/source/propctrlr/formstrings.hxx b/extensions/source/propctrlr/formstrings.hxx index 0d77b45bb6cf..cc6bc9db824b 100644 --- a/extensions/source/propctrlr/formstrings.hxx +++ b/extensions/source/propctrlr/formstrings.hxx @@ -74,7 +74,7 @@ namespace pcr PCR_CONSTASCII_STRING( PROPERTY_XFORMS_BUTTONTYPE, "XFormsButtonType"); PCR_CONSTASCII_STRING( PROPERTY_STRINGITEMLIST, "StringItemList"); PCR_CONSTASCII_STRING( PROPERTY_DEFAULT_TEXT, "DefaultText"); - PCR_CONSTASCII_STRING( PROPERTY_DEFAULTCHECKED, "DefaultState"); + PCR_CONSTASCII_STRING( PROPERTY_DEFAULT_STATE, "DefaultState"); PCR_CONSTASCII_STRING( PROPERTY_FORMATKEY, "FormatKey"); PCR_CONSTASCII_STRING( PROPERTY_FORMATSSUPPLIER, "FormatsSupplier"); PCR_CONSTASCII_STRING( PROPERTY_SUBMIT_ACTION, "SubmitAction"); @@ -130,6 +130,7 @@ namespace pcr PCR_CONSTASCII_STRING( PROPERTY_ECHO_CHAR, "EchoChar"); PCR_CONSTASCII_STRING( PROPERTY_ROWHEIGHT, "RowHeight"); PCR_CONSTASCII_STRING( PROPERTY_HELPTEXT, "HelpText"); + PCR_CONSTASCII_STRING( PROPERTY_FONT, "FontDescriptor"); PCR_CONSTASCII_STRING( PROPERTY_FONT_NAME, "FontName"); PCR_CONSTASCII_STRING( PROPERTY_FONT_STYLENAME, "FontStyleName"); PCR_CONSTASCII_STRING( PROPERTY_FONT_FAMILY, "FontFamily"); @@ -263,6 +264,11 @@ namespace pcr PCR_CONSTASCII_STRING( PROPERTY_BINDING_ID, "BindingID" ); PCR_CONSTASCII_STRING( PROPERTY_ID, "ID" ); PCR_CONSTASCII_STRING( PROPERTY_WRITING_MODE, "WritingMode" ); + PCR_CONSTASCII_STRING( PROPERTY_TEXT_ANCHOR_TYPE, "TextAnchorType" ); + PCR_CONSTASCII_STRING( PROPERTY_SHEET_ANCHOR_TYPE, "SheetAnchorType" ); + PCR_CONSTASCII_STRING( PROPERTY_ANCHOR_TYPE, "AnchorType" ); + PCR_CONSTASCII_STRING( PROPERTY_ANCHOR, "Anchor" ); + PCR_CONSTASCII_STRING( PROPERTY_IS_VISIBLE, "IsVisible" ); PCR_CONSTASCII_STRING( PROPERTY_MODEL, "Model" ); diff --git a/extensions/source/propctrlr/makefile.mk b/extensions/source/propctrlr/makefile.mk index 47e0c995a49b..c043850e3c73 100644 --- a/extensions/source/propctrlr/makefile.mk +++ b/extensions/source/propctrlr/makefile.mk @@ -98,7 +98,8 @@ SLOFILES= $(SLO)$/controlfontdialog.obj \ $(SLO)$/defaulthelpprovider.obj \ $(SLO)$/MasterDetailLinkDialog.obj \ $(SLO)$/inspectormodelbase.obj \ - $(SLO)$/propertycontrolextender.obj + $(SLO)$/propertycontrolextender.obj \ + $(SLO)$/formgeometryhandler.obj SRS1NAME=$(TARGET) SRC1FILES= propres.src \ diff --git a/extensions/source/propctrlr/pcrservices.cxx b/extensions/source/propctrlr/pcrservices.cxx index 0673c9ff5f3c..b4c87ab58ef2 100644 --- a/extensions/source/propctrlr/pcrservices.cxx +++ b/extensions/source/propctrlr/pcrservices.cxx @@ -62,6 +62,7 @@ extern "C" void SAL_CALL createRegistryInfo_ObjectInspectorModel(); extern "C" void SAL_CALL createRegistryInfo_SubmissionPropertyHandler(); extern "C" void SAL_CALL createRegistryInfo_StringRepresentation(); extern "C" void SAL_CALL createRegistryInfo_MasterDetailLinkDialog(); +extern "C" void SAL_CALL createRegistryInfo_FormGeometryHandler(); //--------------------------------------------------------------------------------------- @@ -88,6 +89,7 @@ extern "C" void SAL_CALL pcr_initializeModule() createRegistryInfo_SubmissionPropertyHandler(); createRegistryInfo_StringRepresentation(); createRegistryInfo_MasterDetailLinkDialog(); + createRegistryInfo_FormGeometryHandler(); s_bInit = sal_True; } } diff --git a/extensions/source/propctrlr/propcontroller.cxx b/extensions/source/propctrlr/propcontroller.cxx index 1789ff0e9c00..c4dff2512a29 100644 --- a/extensions/source/propctrlr/propcontroller.cxx +++ b/extensions/source/propctrlr/propcontroller.cxx @@ -755,23 +755,32 @@ namespace pcr return; } - if ( m_sCommittingProperty != _rEvent.PropertyName ) + if ( m_sCommittingProperty == _rEvent.PropertyName ) + return; + + if ( !haveView() ) + return; + + Any aNewValue( _rEvent.NewValue ); + if ( impl_hasPropertyHandlerFor_nothrow( _rEvent.PropertyName ) ) { - Any aNewValue( _rEvent.NewValue ); - if ( impl_hasPropertyHandlerFor_nothrow( _rEvent.PropertyName ) ) - { - aNewValue = impl_getPropertyValue_throw( _rEvent.PropertyName ); + // forward the new value to the property box, to reflect the change in the UI + aNewValue = impl_getPropertyValue_throw( _rEvent.PropertyName ); - if ( haveView() ) - // forward the new value to the property box, to reflect the change in the UI - getPropertyBox().SetPropertyValue( _rEvent.PropertyName, aNewValue ); - } + // check whether the state is ambiguous. This is interesting in case we display the properties + // for multiple objects at once: In this case, we'll get a notification from one of the objects, + // but need to care for the "composed" value, which can be "ambiguous". + PropertyHandlerRef xHandler( impl_getHandlerForProperty_throw( _rEvent.PropertyName ), UNO_SET_THROW ); + PropertyState ePropertyState( xHandler->getPropertyState( _rEvent.PropertyName ) ); + bool bAmbiguousValue = ( PropertyState_AMBIGUOUS_VALUE == ePropertyState ); - // if it's a actuating property, then update the UI for any dependent - // properties - if ( impl_isActuatingProperty_nothrow( _rEvent.PropertyName ) ) - impl_broadcastPropertyChange_nothrow( _rEvent.PropertyName, aNewValue, _rEvent.OldValue, false ); + getPropertyBox().SetPropertyValue( _rEvent.PropertyName, aNewValue, bAmbiguousValue ); } + + // if it's a actuating property, then update the UI for any dependent + // properties + if ( impl_isActuatingProperty_nothrow( _rEvent.PropertyName ) ) + impl_broadcastPropertyChange_nothrow( _rEvent.PropertyName, aNewValue, _rEvent.OldValue, false ); } //------------------------------------------------------------------------ @@ -1423,14 +1432,14 @@ namespace pcr impl_broadcastPropertyChange_nothrow( rName, aNormalizedValue, aOldValue, false ); // and display it again. This ensures proper formatting - getPropertyBox().SetPropertyValue( rName, aNormalizedValue ); + getPropertyBox().SetPropertyValue( rName, aNormalizedValue, false ); } catch(PropertyVetoException& eVetoException) { InfoBox(m_pView, eVetoException.Message).Execute(); PropertyHandlerRef handler = impl_getHandlerForProperty_throw( rName ); Any aNormalizedValue = handler->getPropertyValue( rName ); - getPropertyBox().SetPropertyValue( rName, aNormalizedValue ); + getPropertyBox().SetPropertyValue( rName, aNormalizedValue, false ); } catch(Exception&) { diff --git a/extensions/source/propctrlr/propertyeditor.cxx b/extensions/source/propctrlr/propertyeditor.cxx index d2ccc1ee83d5..f076da707800 100644 --- a/extensions/source/propctrlr/propertyeditor.cxx +++ b/extensions/source/propctrlr/propertyeditor.cxx @@ -437,11 +437,11 @@ namespace pcr } //------------------------------------------------------------------ - void OPropertyEditor::SetPropertyValue( const ::rtl::OUString& rEntryName, const Any& _rValue ) + void OPropertyEditor::SetPropertyValue( const ::rtl::OUString& rEntryName, const Any& _rValue, bool _bUnknownValue ) { OBrowserPage* pPage = getPage( rEntryName ); if ( pPage ) - pPage->getListBox().SetPropertyValue( rEntryName, _rValue ); + pPage->getListBox().SetPropertyValue( rEntryName, _rValue, _bUnknownValue ); } //------------------------------------------------------------------ diff --git a/extensions/source/propctrlr/propertyeditor.hxx b/extensions/source/propctrlr/propertyeditor.hxx index e2715e2fd425..5881b579c3e0 100644 --- a/extensions/source/propctrlr/propertyeditor.hxx +++ b/extensions/source/propctrlr/propertyeditor.hxx @@ -107,7 +107,7 @@ namespace pcr sal_uInt16 GetCurPage(); void ClearAll(); - void SetPropertyValue(const ::rtl::OUString& _rEntryName, const ::com::sun::star::uno::Any& _rValue ); + void SetPropertyValue(const ::rtl::OUString& _rEntryName, const ::com::sun::star::uno::Any& _rValue, bool _bUnknownValue ); ::com::sun::star::uno::Any GetPropertyValue(const ::rtl::OUString& rEntryName ) const; sal_uInt16 GetPropertyPos(const ::rtl::OUString& rEntryName ) const; ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControl > diff --git a/extensions/source/propctrlr/propertyhandler.cxx b/extensions/source/propctrlr/propertyhandler.cxx index 5b3eb4919764..8d730d3e8c9c 100644 --- a/extensions/source/propctrlr/propertyhandler.cxx +++ b/extensions/source/propctrlr/propertyhandler.cxx @@ -34,13 +34,19 @@ #include "formmetadata.hxx" #include "formbrowsertools.hxx" #include "handlerhelper.hxx" +#include "formstrings.hxx" /** === begin UNO includes === **/ #include <com/sun/star/beans/PropertyAttribute.hpp> #include <com/sun/star/lang/NullPointerException.hpp> #include <com/sun/star/util/XModifiable.hpp> /** === end UNO includes === **/ + #include <tools/debug.hxx> +#include <unotools/confignode.hxx> +#include <unotools/localedatawrapper.hxx> +#include <svtools/syslocale.hxx> +#include <toolkit/helper/vclunohelper.hxx> #include <algorithm> @@ -374,6 +380,67 @@ namespace pcr return m_xComponentPropertyInfo.is() && m_xComponentPropertyInfo->hasPropertyByName( _rPropName ); } + //-------------------------------------------------------------------- + sal_Int16 PropertyHandler::impl_getDocumentMeasurementUnit_throw() const + { + FieldUnit eUnit = FUNIT_NONE; + + Reference< XServiceInfo > xDocumentSI( impl_getContextDocument_nothrow(), UNO_QUERY ); + OSL_ENSURE( xDocumentSI.is(), "PropertyHandlerHelper::impl_getDocumentMeasurementUnit_throw: No context document - where do I live?" ); + if ( xDocumentSI.is() ) + { + // determine the application type we live in + ::rtl::OUString sConfigurationLocation; + ::rtl::OUString sConfigurationProperty; + if ( xDocumentSI->supportsService( SERVICE_WEB_DOCUMENT ) ) + { // writer + sConfigurationLocation = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.WriterWeb/Layout/Other" ) ); + sConfigurationProperty = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MeasureUnit" ) ); + } + else if ( xDocumentSI->supportsService( SERVICE_TEXT_DOCUMENT ) ) + { // writer + sConfigurationLocation = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.Writer/Layout/Other" ) ); + sConfigurationProperty = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MeasureUnit" ) ); + } + else if ( xDocumentSI->supportsService( SERVICE_SPREADSHEET_DOCUMENT ) ) + { // calc + sConfigurationLocation = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.Calc/Layout/Other/MeasureUnit" ) ); + sConfigurationProperty = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Metric" ) ); + } + else if ( xDocumentSI->supportsService( SERVICE_DRAWING_DOCUMENT ) ) + { + sConfigurationLocation = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.Draw/Layout/Other/MeasureUnit" ) ); + sConfigurationProperty = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Metric" ) ); + } + else if ( xDocumentSI->supportsService( SERVICE_PRESENTATION_DOCUMENT ) ) + { + sConfigurationLocation = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.Impress/Layout/Other/MeasureUnit" ) ); + sConfigurationProperty = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Metric" ) ); + } + + // read the measurement unit from the configuration + if ( sConfigurationLocation.getLength() && sConfigurationProperty.getLength() ) + { + ::utl::OConfigurationTreeRoot aConfigTree( ::utl::OConfigurationTreeRoot::createWithServiceFactory( + m_aContext.getLegacyServiceFactory(), sConfigurationLocation, -1, ::utl::OConfigurationTreeRoot::CM_READONLY ) ); + sal_Int32 nUnitAsInt = (sal_Int32)FUNIT_NONE; + aConfigTree.getNodeValue( sConfigurationProperty ) >>= nUnitAsInt; + + // if this denotes a valid (and accepted) unit, then use it + if ( ( nUnitAsInt > FUNIT_NONE ) && ( nUnitAsInt <= FUNIT_100TH_MM ) ) + eUnit = static_cast< FieldUnit >( nUnitAsInt ); + } + } + + if ( FUNIT_NONE == eUnit ) + { + MeasurementSystem eSystem = SvtSysLocale().GetLocaleData().getMeasurementSystemEnum(); + eUnit = MEASURE_METRIC == eSystem ? FUNIT_CM : FUNIT_INCH; + } + + return VCLUnoHelper::ConvertToMeasurementUnit( eUnit, 1 ); + } + //==================================================================== //= PropertyHandlerComponent //==================================================================== diff --git a/extensions/source/propctrlr/propertyhandler.hxx b/extensions/source/propctrlr/propertyhandler.hxx index d44252cca0e7..4f1aa8f3e82f 100644 --- a/extensions/source/propctrlr/propertyhandler.hxx +++ b/extensions/source/propctrlr/propertyhandler.hxx @@ -298,6 +298,10 @@ namespace pcr /// determines whether our component has a given property bool impl_componentHasProperty_throw( const ::rtl::OUString& _rPropName ) const; + /** determines the default measure unit for the document in which our component lives + */ + sal_Int16 impl_getDocumentMeasurementUnit_throw() const; + private: PropertyHandler(); // never implemented PropertyHandler( const PropertyHandler& ); // never implemented diff --git a/extensions/util/hidother.src b/extensions/util/hidother.src index 0b82734c645d..5c14a2e8d08e 100644 --- a/extensions/util/hidother.src +++ b/extensions/util/hidother.src @@ -308,3 +308,4 @@ hidspecial HID_CHECK_FOR_UPD_CANCEL { HelpId = HID_CHECK_FOR_UPD_CAN hidspecial HID_PROP_NOLABEL { HelpId = HID_PROP_NOLABEL; } hidspecial HID_PROP_INPUT_REQUIRED { HelpId = HID_PROP_INPUT_REQUIRED; } hidspecial HID_PROP_WRITING_MODE { HelpId = HID_PROP_WRITING_MODE; } +hidspecial HID_PROP_ANCHOR_TYPE { HelpId = HID_PROP_ANCHOR_TYPE; } |