From 2182dd7499013e970ca177142ec13f43c3ec184f Mon Sep 17 00:00:00 2001 From: Release Engineers Date: Sun, 12 Apr 2009 04:24:43 +0000 Subject: CWS-TOOLING: integrate CWS macshortcuts01 2009-04-02 18:13:38 +0200 pl r270430 : CWS-TOOLING: rebase CWS macshortcuts01 to trunk@270033 (milestone: DEV300:m45) 2009-03-04 13:02:01 +0100 pl r268816 : make compile with oldish gtk headers 2009-03-04 11:23:41 +0100 rvojta r268799 : Remove #ifndef MACOSX as Mac OS X X11 port is obsolote, no need to check for non Mac OS X 2009-03-03 16:33:34 +0100 rvojta r268764 : Meta/Super to MOD3 on all Unix platforms except Mac OS X 2009-03-03 16:08:46 +0100 rvojta r268744 : Map GDK_Meta_L/R and GDK_Super_L/R keys to KEY_MOD3 on Unix systems except Mac OS X 2009-03-03 16:04:23 +0100 rvojta r268742 : IsMod3(), IsLeftMod3(), IsRightMod3() added 2009-03-03 16:03:48 +0100 rvojta r268741 : MODKEY_LMOD3, MODKEY_RMOD3, MODKEY_MOD3 support 2009-02-28 00:09:26 +0100 rvojta r268620 : New KeyCode constructors support, by default MOD3 is not used here (probably temporary solution) 2009-02-25 22:53:02 +0100 rvojta r268469 : MOD3 support (META_DOWN_MASK) 2009-02-25 13:22:13 +0100 rvojta r268435 : Cmd-M to minimize window, Cmd-Option-M to minimize all windows 2009-02-25 11:09:20 +0100 rvojta r268417 : Add back F11 for non Mac OS X platforms (removed by accident in r268405) 2009-02-24 18:32:31 +0100 rvojta r268405 : F11 replaced by Cmd-T on Mac OS X 2009-02-23 15:21:53 +0100 sb r268358 : #i99296# support values with both xml:lang and install:module (which are moved into the spool tree, not the res tree) 2009-02-16 22:45:34 +0100 rvojta r267839 : Multiplatform shortcuts support 2009-02-16 22:41:03 +0100 rvojta r267838 : Use install:module instead of separate xcu file 2009-02-16 18:35:36 +0100 rvojta r267833 : Removed accelerators target 2009-02-16 09:27:42 +0100 rvojta r267776 : MOD3 added 2009-02-16 09:18:32 +0100 rvojta r267775 : MOD3 support 2009-02-16 09:17:11 +0100 rvojta r267774 : MOD3 support 2009-02-15 22:11:37 +0100 rvojta r267773 : Check for MOD3 too 2009-02-15 22:11:15 +0100 rvojta r267772 : Check for MOD3 too 2009-02-15 22:10:37 +0100 rvojta r267771 : Check for MOD3 too 2009-02-15 22:10:15 +0100 rvojta r267770 : Check for MOD3 during mouse event too 2009-02-15 22:09:54 +0100 rvojta r267769 : IsMod3() added 2009-02-15 19:34:59 +0100 rvojta r267768 : MOD3 added (Ctrl on Mac OS X) 2009-02-15 19:33:43 +0100 rvojta r267767 : Cmd-M -> Ctrl-M for default format 2009-02-15 19:32:19 +0100 rvojta r267766 : MOD3 added (Ctrl on Mac OS X) 2009-02-15 19:31:30 +0100 rvojta r267765 : MOD3 added (Ctrl on Mac OS X) 2009-02-15 19:31:04 +0100 rvojta r267764 : MOD3 added (Ctrl on Mac OS X) 2009-02-15 19:30:33 +0100 rvojta r267763 : MOD3 added (Ctrl on Mac OS X) 2009-02-15 19:30:09 +0100 rvojta r267762 : MOD3 added (Ctrl on Mac OS X) 2009-02-13 22:11:22 +0100 rvojta r267751 : Cmd-Shift-Z for .uno:Redo 2009-02-13 22:04:19 +0100 rvojta r267748 : F11 -> Cmd-T for .uno:DesignerDialog 2009-02-13 21:09:11 +0100 rvojta r267743 : F11 -> Cmd-T (all occurences) 2009-02-13 19:47:21 +0100 rvojta r267741 : accelerators target added for Mac OS X shortcuts 2009-02-13 19:46:58 +0100 rvojta r267740 : Spreadsheet - replace F11 with Cmd-T 2009-02-13 19:24:19 +0100 rvojta r267739 : Remove Accelerators-Mac.xcs 2009-02-13 18:50:01 +0100 rvojta r267738 : Accelerators-Mac.xcs test 2009-02-13 18:48:10 +0100 rvojta r267737 : Accelerators-Mac.xcu added 2009-02-13 18:46:48 +0100 rvojta r267736 : F11 -> Cmd-T for stylist in Spreadsheet --- forms/source/richtext/richtextvclcontrol.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'forms') diff --git a/forms/source/richtext/richtextvclcontrol.cxx b/forms/source/richtext/richtextvclcontrol.cxx index 7c5505d1d87d..f3c56cc6cd88 100644 --- a/forms/source/richtext/richtextvclcontrol.cxx +++ b/forms/source/richtext/richtextvclcontrol.cxx @@ -233,7 +233,7 @@ namespace frm { // Ctrl-Tab is used to step out of the control // -> build a new key event without the Ctrl-key, and let the very base class handle it - KeyCode aNewCode( KEY_TAB, bShift, sal_False, sal_False ); + KeyCode aNewCode( KEY_TAB, bShift, sal_False, sal_False, sal_False ); ::KeyEvent aNewEvent( pKeyEvent->GetCharCode(), aNewCode ); Control::KeyInput( aNewEvent ); return 1; // handled -- cgit From 59389868dc1536dbfec4b564543ab38ee463cb14 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Wed, 22 Apr 2009 11:01:27 +0000 Subject: CWS-TOOLING: integrate CWS dba32a 2009-04-16 13:08:19 +0200 oj r270882 : #i14538# set property at control 2009-04-16 13:04:28 +0200 oj r270881 : #i98557# remove binary string for SRB 2009-04-15 13:19:10 +0200 oj r270838 : #i96782# use type set at view 2009-04-14 14:53:20 +0200 oj r270778 : #i96782# set initialize size for custom shape 2009-04-06 14:19:14 +0200 oj r270546 : #i88432# correct pos when < 0 while resizing 2009-04-06 13:36:13 +0200 oj r270541 : #i96782# handle toolbar and menubar differently 2009-04-06 13:33:54 +0200 oj r270540 : #i96782# handle toolbar and menubar differently 2009-04-06 12:28:23 +0200 oj r270534 : #i96782# handle toolbar and menubar differently 2009-04-06 12:27:44 +0200 oj r270533 : #i96782# handle toolbar and menubar differently 2009-04-06 12:24:32 +0200 oj r270532 : #i96782# handle toolbar and menubar differently 2009-04-06 12:15:15 +0200 oj r270531 : do not initialze when field is empty 2009-04-06 10:06:08 +0200 oj r270528 : #i96782# clean up of menubar and remove duplicates 2009-04-06 09:47:49 +0200 oj r270527 : #i96519# adjust help text dynamic 2009-04-03 13:43:20 +0200 oj r270482 : do not need to remove section from observer they are already disposed 2009-04-03 13:27:28 +0200 fs r270479 : #i97356# 2009-04-02 11:30:39 +0200 fs r270386 : UNX line ends 2009-04-02 10:54:51 +0200 fs r270379 : UNX line ends 2009-04-02 10:39:57 +0200 fs r270378 : UNX line ends 2009-04-02 10:37:24 +0200 fs r270377 : why did this survive the rebase? was removed on trunk ... 2009-03-31 13:31:12 +0200 fs r270277 : component_foo should be public 2009-03-28 00:21:01 +0100 fs r270176 : manuallly merged the changes which happened in CWS before resync to m45, where the directory had been moved from reportdesign/registry to reportbuilder/registry 2009-03-27 23:01:20 +0100 fs r270174 : CWS-TOOLING: rebase CWS dba32a to trunk@270033 (milestone: DEV300:m45) 2009-03-11 12:23:35 +0100 fs r269310 : #i99958# ensure the ControlModelLock doesn't release twice 2009-03-06 09:07:32 +0100 fs r268970 : ignore output paths in SVN's status 2009-03-06 09:07:08 +0100 fs r268969 : ignore output paths in SVN's status 2009-03-04 11:28:02 +0100 oj r268800 : copy and paste error, check correct end now 2009-03-03 15:49:11 +0100 fs r268736 : #i10000# those merges were lost during the rebase (m38->m42) 2009-03-03 13:25:27 +0100 lla r268720 : #i99652# fix wrong refactoring 2009-02-27 11:12:56 +0100 fs r268566 : beautified 2009-02-27 10:53:47 +0100 fs r268561 : doFormListening(false) only when actually isFormListening() (found during complex test case XMLFormSettings with assertions) 2009-02-26 20:55:31 +0100 fs r268546 : #i96530# set the Label property of the bound control, if we didn't create a dedicated label control 2009-02-26 11:53:09 +0100 fs r268494 : #i10000# 2009-02-26 11:27:50 +0100 fs r268493 : #i10000# 2009-02-26 11:17:08 +0100 fs r268490 : reportdesign depends on REPORTBUILDER, not REPORTDESIGN 2009-02-25 11:39:48 +0100 fs r268422 : #i10000# post-resync: INFO_ESCAPE_DATETIME got lost during rebase 2009-02-24 23:24:10 +0100 fs r268411 : CWS-TOOLING: rebase CWS dba32a to trunk@268395 (milestone: DEV300:m42) 2009-02-20 15:09:48 +0100 fs r268324 : respect ImplicitCatalog/SchemaRestriction in all necessary places 2009-02-20 13:48:10 +0100 oj r268318 : order of initialize corrected 2009-02-14 15:07:52 +0100 fs r267759 : #i98975# when an image does not have a bitmap, but a text, draw this (as placeholder) 2009-02-14 15:02:40 +0100 fs r267758 : consolidated and removed some duplicate code 2009-02-14 13:52:23 +0100 fs r267756 : #i10000# 2009-02-13 22:08:34 +0100 fs r267750 : #i100000# 2009-02-13 22:07:25 +0100 fs r267749 : #i10000# 2009-02-13 21:55:36 +0100 fs r267747 : #i10000# 2009-02-13 21:54:27 +0100 fs r267746 : use const_cast 2009-02-13 21:29:10 +0100 fs r267745 : #i10000# 2009-02-13 21:27:39 +0100 fs r267744 : #i10000# 2009-02-13 20:59:13 +0100 fs r267742 : #i10000# 2009-02-13 13:21:30 +0100 fs r267717 : better diagnostics 2009-02-13 13:17:24 +0100 fs r267715 : #i58313# support Catalog/SchemaRestriction settings, which are applied in getTables when 'all catalogs/schemas' are to be retrieved 2009-02-13 13:16:14 +0100 fs r267714 : filter out some more known global settings 2009-02-13 12:39:43 +0100 fs r267713 : #i58313# ImplicitCatalog/SchemaRestriction 2009-02-13 12:36:50 +0100 fs r267712 : when exporting data source settings, allow for properties which have a VOID default value, but are currently not VOID 2009-02-13 12:35:57 +0100 fs r267711 : implement XSet, to allow inserting properties which have a default value of VOID 2009-02-13 12:35:03 +0100 fs r267710 : +addVoidProperty 2009-02-13 10:20:08 +0100 fs r267697 : removed unused variable 2009-02-13 09:46:46 +0100 fs r267695 : refactored the table filtering code, to have a better base for introducing additional low level filters 2009-02-10 09:23:07 +0100 lla r267537 : #i10000# wrong line feed, double named variable 2009-02-09 12:13:08 +0100 oj r267508 : #i98605# notify hanlder 2009-02-09 11:50:34 +0100 oj r267507 : #i98926# solve refcount problem 2009-02-09 11:50:05 +0100 oj r267506 : #i98971# fix for simple html 2009-02-09 11:49:24 +0100 oj r267505 : #i98971# fix for simple html 2009-02-09 11:47:27 +0100 oj r267504 : invoke on copy 2009-02-09 09:51:00 +0100 fs r267500 : #i98316# 2009-02-09 09:46:10 +0100 fs r267499 : setCurrentSelection: don't reset the current form when we de-select everything 2009-02-09 09:43:45 +0100 fs r267498 : #i98316# 2009-02-08 21:25:18 +0100 fs r267496 : #i98272# introduce late ctor for cloning 2009-02-07 21:08:39 +0100 fs r267485 : #i98272# when copy-constructing a FmFormPageImpl, use the XCloneable of the forms collection, instead of XPersistObject (which is incompletely implemented) 2009-02-07 21:07:26 +0100 fs r267484 : removed obsolete include guards 2009-02-07 21:05:22 +0100 fs r267483 : #i98272# implement XCloneable 2009-02-06 15:02:48 +0100 lla r267467 : #i96523# add XImageControl 2009-02-06 14:41:38 +0100 oj r267463 : #i98926# late init when connection disposed but only when asked for 2009-02-06 13:49:57 +0100 lla r267457 : #i92860# bigint in forms doesn't allow input of values > 1, fixed 2009-02-06 13:03:55 +0100 oj r267455 : ImageScaleMode 2009-02-05 14:48:19 +0100 lla r267424 : #i89335# dropdown listboxes are 14 instead of 7 lines high 2009-02-05 13:40:00 +0100 oj r267423 : #i96945# insert new prop Opaque 2009-02-05 13:39:19 +0100 oj r267422 : #i96945# insert layer handling for hell and heaven 2009-02-05 13:29:32 +0100 lla r267420 : #i89335# add is null, is not null, is not like filter condition 2009-02-04 12:23:02 +0100 oj r267364 : #i98821# load table font settings 2009-02-04 10:05:27 +0100 oj r267351 : #i98821# load table font settings 2009-02-04 09:23:22 +0100 fs r267350 : checking persistency of UI settings in database documents - for the moment, capture table formattings (which is issue 98821) 2009-02-04 09:22:15 +0100 fs r267349 : moved some methods which are of wider interest from DatabaseDocument to FileHelper resp. TestCase 2009-02-04 08:56:27 +0100 oj r267347 : #i97586# UcbStreamHelper::CreateStream doesn't check all streamModes use different method 2009-02-04 08:23:26 +0100 oj r267346 : #i98701# check key size is >= 3 and some redesign 2009-02-03 23:29:24 +0100 fs r267345 : return the component (controller), not the frame 2009-02-03 23:28:53 +0100 fs r267344 : openExisting returns a controller now, not the frame (this was a bug) 2009-02-03 23:28:25 +0100 fs r267343 : openElement: properly return the component in the table/query case 2009-02-02 12:48:17 +0100 oj r267261 : #i96013# fix for relative path 2009-02-02 10:33:28 +0100 lla r267253 : #i98557# cleanups and consolidation 2009-02-02 09:37:23 +0100 lla r267250 : #i88432# resize will no longer move components to other sections 2009-02-02 09:08:24 +0100 oj r267245 : #i97475# write 0x1A at the end of the file 2009-01-30 19:39:20 +0100 lla r267230 : #i10000# unused parameters 2009-01-30 09:51:09 +0100 fs r267181 : onsolete 2009-01-30 09:49:27 +0100 fs r267180 : onsolete 2009-01-29 14:28:22 +0100 oj r267139 : #i96825# import cell style 2009-01-29 14:23:12 +0100 oj r267137 : #i98601# export imagescalehandler 2009-01-29 14:19:57 +0100 lla r267135 : #i98601# add ImageScaleMode 2009-01-29 13:21:08 +0100 oj r267124 : #i98601# impl ScaleMode 2009-01-29 13:20:56 +0100 oj r267123 : #i98601# impl ScaleMode 2009-01-29 08:46:40 +0100 oj r267095 : new property: ScaleMode 2009-01-29 08:45:23 +0100 oj r267094 : new ScaleMode from UnControlImageModel 2009-01-29 08:28:12 +0100 oj r267093 : #i87930# close all sub forms/reports when the desktop is going to be terminated and no db frame exists 2009-01-28 19:54:34 +0100 lla r267082 : #i98557# pictures in report wizard 2009-01-28 15:06:25 +0100 oj r267060 : #i87930# close all sub forms/reports when the desktop is going to be terminated and no db frame exists 2009-01-28 11:38:41 +0100 lla r267046 : #i76783# handle binary fields in forms 2009-01-28 09:24:43 +0100 lla r267025 : #i10000# 2009-01-28 08:40:04 +0100 fs r267024 : #i10000# 2009-01-28 08:04:43 +0100 oj r267023 : #i93456# use resource strings for function names 2009-01-27 13:26:05 +0100 oj r266988 : check data field is type field or expression 2009-01-27 13:07:17 +0100 oj r266985 : check data field length 2009-01-27 11:48:19 +0100 oj r266974 : #i96823# return dll string as column name when no alias exists 2009-01-27 09:53:11 +0100 fs r266958 : display the message of a caught exception 2009-01-27 09:44:13 +0100 fs r266957 : #i58313# when retrieving all tables, just set an empty table type filter - the connection will care for translating this, by respecting the TableTypeFilterMode setting 2009-01-27 09:36:09 +0100 fs r266956 : #i58313# getTables: per JDBC spec, is not a valid table type filter. Translate it to 'null'. 2009-01-26 11:24:49 +0100 lla r266912 : #i97865# cleanups (AddField viewable in remote mode) 2009-01-26 07:49:27 +0100 lla r266897 : #i97865# AddField opens in remote case 2009-01-26 07:48:58 +0100 lla r266896 : #i97865# AddField opens in remote case 2009-01-26 07:48:42 +0100 lla r266895 : #i97865# AddField opens in remote case 2009-01-23 15:04:40 +0100 fs r266825 : consolidate the usage of OSQLMessageBox with MessageType==Warning into OSQLWarningBox 2009-01-23 10:47:33 +0100 fs r266787 : +supportsUserAdministration 2009-01-23 10:47:11 +0100 fs r266784 : use DatabaseMetaData.supportsUserAdministration 2009-01-23 07:55:59 +0100 lla r266767 : #i10000# fix gcc compiler failures 2009-01-21 15:08:55 +0100 lla r266673 : #i97265# Labels in HC (IsDark) with other color (viewable) 2009-01-19 14:58:54 +0100 lla r266504 : #i96523# last problems with FormatKey and '0' values fixed 2009-01-19 14:58:00 +0100 lla r266503 : #i96519# AddField help text 2009-01-19 11:59:02 +0100 fs r266485 : #i96523# for formatted field models, init them with TreatAsNumber = false 2009-01-16 10:31:49 +0100 lla r266405 : #i96793# add shrink to popup menu 2009-01-16 09:21:44 +0100 lla r266401 : #i96519# AddField contains a help text 2009-01-15 11:21:49 +0100 lla r266357 : #i96523# problem with XVclWindowPeer not fixed now 2009-01-15 09:19:20 +0100 lla r266335 : #i96523# more crashes fixed. 2009-01-14 13:08:34 +0100 lla r266291 : #i96523# problems with crashes fixed 2009-01-13 10:54:24 +0100 lla r266199 : #i96523# show datasource in formattedfields new files 2009-01-13 10:52:39 +0100 lla r266198 : #i96523# show datasource in formattedfields 2009-01-13 09:41:50 +0100 lla r266197 : #i96526# handling none existance default.otr 2009-01-12 12:55:49 +0100 fs r266151 : don't expect the control model to be a BoundComponent before adding as modify listener 2009-01-12 12:51:33 +0100 fs r266149 : #i88458# let the ImageControl be an XModifyBroadcaster, so the forms runtime can notice when the user changes the control content while it does not have the focus 2009-01-09 13:41:22 +0100 fs r266080 : doc 2009-01-09 13:14:14 +0100 fs r266077 : #i97377# SetModified when order is changed via DnD 2009-01-07 09:55:40 +0100 oj r265951 : merge from master 2009-01-07 09:55:24 +0100 oj r265950 : removed observer 2009-01-07 09:55:06 +0100 oj r265949 : merge from master 2009-01-07 07:29:11 +0100 oj r265945 : shadow var changed 2009-01-06 07:25:57 +0100 oj r265893 : CWS-TOOLING: rebase CWS dba32a to trunk@265758 (milestone: DEV300:m38) 2009-01-05 13:18:22 +0100 oj r265865 : convert to unix le 2009-01-05 09:13:52 +0100 lla r265857 : #i79423# lc_ sc_ permutation fix 2009-01-02 19:40:59 +0100 lla r265847 : #i79423# section shrink icons 2008-12-22 11:37:57 +0100 lla r265749 : #i97484# move component to negative Y-position 2008-12-22 11:37:05 +0100 lla r265748 : #i97484# move component to negative Y-position 2008-12-22 11:35:33 +0100 lla r265747 : #i97484# move component to negative Y-position 2008-12-22 11:25:07 +0100 lla r265745 : #i96757# changes via property browser was not undoable 2008-12-18 15:10:38 +0100 fs r265694 : corrected an condition in doFormListening, which otherwise leads to uncommitable grid columns in documents which are loaded from disc (not in documents which are newly created) 2008-12-18 14:54:39 +0100 fs r265692 : Hide Columns text slightly changed 2008-12-18 13:44:15 +0100 fs r265683 : #i94068# properly display erros happening during a form operation - at least once, and at most once 2008-12-18 11:28:29 +0100 fs r265677 : document the new InputRequired property 2008-12-18 11:04:15 +0100 fs r265676 : #i96530# createControlLabelPair: don't actually create a label for a checkbox 2008-12-18 10:35:53 +0100 fs r265674 : #i95226# when a column is replaced, and it's the selected column, update the selection 2008-12-18 10:34:42 +0100 fs r265673 : #i95226# refactoring of the implReplaced method 2008-12-18 10:34:28 +0100 fs r265672 : #i95226# when replacing a grid column, update the property browser 2008-12-18 10:33:17 +0100 fs r265671 : when an element is removed, remove it from m_aCurrentSelection, too (if necessary) 2008-12-18 10:31:57 +0100 fs r265670 : Hide Columns text slightly changed 2008-12-18 10:15:56 +0100 lla r265669 : #i14538# do not allow to press finish button twice 2008-12-18 08:56:33 +0100 lla r265665 : #i10000# build depend=t problem hacked. 2008-12-17 20:59:10 +0100 fs r265656 : #i89821# don't let a MultiLineEdit select all text when it receives the focus 2008-12-17 12:10:54 +0100 fs r265594 : #i97356# 2008-12-17 12:06:29 +0100 fs r265593 : #i97355# Print -> Printable 2008-12-17 11:59:31 +0100 fs r265591 : #i97350# combo boxes comment on list selection (as list boxes already do) 2008-12-16 09:53:57 +0100 lla r265527 : #i96526# handling none existance default.otr 2008-12-15 14:48:39 +0100 lla r265500 : #i79423# reparing, was wrong implemented 2008-12-12 15:08:33 +0100 lla r265424 : #i10000# remove wrong carridge returns 2008-12-12 15:07:55 +0100 lla r265423 : #i10000# remove wrong carridge returns 2008-12-12 15:06:41 +0100 lla r265422 : #i10000# remove wrong carridge returns 2008-12-12 10:23:13 +0100 lla r265395 : #i95234# reset DragDelta 2008-12-12 10:11:02 +0100 lla r265393 : #i79423# pre versions of shrink buttons 2008-12-11 15:32:13 +0100 fs r265318 : prevent a deadlock during complex.dbaccess.DatabaseDocument test 2008-12-11 15:30:06 +0100 fs r265316 : prevent a deadlock during complex.dbaccess.DatabaseDocument test 2008-12-11 15:07:05 +0100 fs r265307 : removed superfluous text 2008-12-11 12:29:54 +0100 lla r265282 : #i96757# cleanup second try 2008-12-11 12:09:15 +0100 lla r265278 : #i96757# cleanup 2008-12-11 12:07:56 +0100 lla r265277 : #i95234# 2008-12-10 14:04:39 +0100 lla r265183 : #i93472# D&D fixes 2008-12-10 12:29:33 +0100 lla r265168 : #i94067# add (APP|SYS)FONT to XUnitConversion 2008-12-10 12:15:02 +0100 lla r265166 : #i94067# add APPFONT, SYSFONT to MeasureUnit 2008-12-10 11:52:10 +0100 lla r265163 : #i94067# add comments 2008-12-06 20:33:05 +0100 fs r264935 : #i10000# precompiled header 2008-12-05 09:29:26 +0100 fs r264889 : #i10000# 2008-12-05 09:07:31 +0100 fs r264888 : #i10000# 2008-12-04 13:25:46 +0100 fs r264838 : CWS-TOOLING: rebase CWS dba32a to trunk@264807 (milestone: DEV300:m37) 2008-12-03 23:49:13 +0100 fs r264808 : merge changes from trunk, to be able to do a rebase 2008-12-03 17:13:09 +0100 lla r264801 : #i91041# update documentation 2008-12-03 16:57:04 +0100 lla r264799 : #i94067# allow convert(Point|Size)ToLogic as pixel also 2008-12-02 12:36:32 +0100 lla r264687 : #i96782# bring toolbar objects to menu structure 2008-12-02 10:32:44 +0100 lla r264667 : #i86255# make property work 2008-12-02 09:22:47 +0100 lla r264659 : #i79423# add section shrink toolbar 2008-12-02 07:41:22 +0100 lla r264657 : #i86255# add check box for Escape DateTime property 2008-12-02 07:37:17 +0100 lla r264656 : #i79423# new shrink buttons 2008-11-26 11:55:28 +0100 fs r264362 : #i96541# FillPropertySet: do not only catch UnknownPropertyException when setting the Char/ParaAutoStyleName, but also care for the other exceptions which can be thrown by XPropertySet::setPropertyValue. This is actually not the real fix for #i96541#, but only a follow-up. The root cause of the issue was fixed in CWS dba301b, but this here was another (potential) bug which popped up during investigations. 2008-11-25 09:04:40 +0100 lla r264273 : #i82083# new toolbox in GroupsSorting dialog 2008-11-25 08:56:08 +0100 lla r264272 : #i94729# change token strings into string list, move class out of function 2008-11-24 15:52:22 +0100 fs r264251 : #i96532# do not set AppendTableAlias, NameLengthLimit, etc., if the OXMLDataSourceInstance is used for elements at which those attributes never appear 2008-11-24 15:51:45 +0100 fs r264249 : #i96532# do not set AppendTableAlias, NameLengthLimit, etc., if the OXMLDataSourceInstance is used for elements at which those attributes never appear 2008-11-24 15:45:21 +0100 fs r264244 : #i96532# the API default for ParamNameSubst is false 2008-11-24 15:45:04 +0100 fs r264243 : #i96532# do not set AppendTableAlias, NameLengthLimit, etc., if the OXMLDataSourceInstance is used for elements at which those attributes never appear 2008-11-24 15:44:14 +0100 fs r264241 : #i96532# slight refactoring of exporting properties which have a XML default different from the API default 2008-11-24 10:50:01 +0100 lla r264216 : #i82083# icons for new toolbox 2008-11-24 09:38:45 +0100 lla r264205 : #i82083# new toolbox in GroupsSorting dialog 2008-11-24 09:32:20 +0100 lla r264201 : #i96501# cleanup assertions 2008-11-24 09:12:55 +0100 lla r264198 : #i83082# enhancement for toolboxes, better HC comfort 2008-11-24 08:46:43 +0100 lla r264197 : #i96501# fix problem with negative positions 2008-11-21 11:44:47 +0100 fs r264118 : #i57042# introduce a counter for suspending change notifications of a given property, so recursive calls are possible 2008-11-21 11:02:17 +0100 fs r264116 : #i96388# don't call ExecuteContextMenuAction when no action was chosen by the user 2008-11-21 10:36:53 +0100 fs r264114 : #i47384# assertion was wrong 2008-11-14 12:33:15 +0100 fs r263673 : #i47318# XRowSetChangeBroadcaster/Listener, to be able to listen for changes in an XRowSetSupplier's RowSet 2008-11-14 12:30:29 +0100 fs r263672 : #i47318# more refactoring - BoundControlModels now listen at the XRowSetSupplier for changes in the supplied RowSet, to properly revoke/register old/new listeners at the RowSet - replaced ::osl::Mutex in various places with a ControlModelLock 2008-11-14 12:20:55 +0100 fs r263671 : when BUILD_TYPE includes QADEVOOO, the BUILD_QADEVOOO needs to bet set, too 2008-11-14 12:19:21 +0100 fs r263670 : oops, this was not intended to be committed 2008-11-12 11:08:10 +0100 fs r263579 : #i96096# new ctors taking UNO_QUERY_THROW 2008-11-12 09:15:54 +0100 fs r263576 : no need to load the complete dialog just to get a string which the dialog itself loads from resource 2008-11-10 17:55:45 +0100 fs r263535 : spelling in comment 2008-11-10 15:51:14 +0100 fs r263523 : #i47318# various refactorings 1. don't forward syntetic XLoadListener events from the grid control to the grid columns. Instead, forward GridColumn::XChild::setParent to the base class, which then can add itself as load listener 2. removed various occurances of XMultiServiceFactory, instead use the ::comphelper::ComponentContext 3. in O(Bound)ControlModel, have a mechanism to lock the instance (using ControlModelLock) and fire property changes when the last lock dies. 2008-11-10 12:49:24 +0100 oj r263513 : #i94729# change token strings into string list 2008-11-10 12:13:15 +0100 oj r263512 : #i95222# export chart:title style as well 2008-11-10 08:55:25 +0100 oj r263507 : #i93471# show the correct tabpage when selecting a different object 2008-11-07 23:38:29 +0100 fs r263490 : #i95977# for the event input controls, add a component extending their functionality so they're reset when the users presses DEL 2008-11-07 23:35:39 +0100 fs r263489 : during #i95977#: When a VCL Window is deleted from within VCL code, the respective WindowPeer was never disposed. Corrected this. 2008-11-07 14:57:07 +0100 fs r263420 : #i95963# human-readable display names for event bindings 2008-11-06 10:34:52 +0100 fs r263366 : #i95865# don't use library names containing InvalidZipEntryFileNames - workaround until i95409 is fixed 2008-11-06 10:33:28 +0100 fs r263365 : #i95865# copied the following change from CWS odfmetadata2 (not yet integrated) into CWS dba31d - comphelper/inc/comphelper/storagehelper.hxx, comphelper/source/misc/storagehelper.cxx: + add function IsValidZipEntryFileName (moved from module package) --- forms/source/component/Button.cxx | 2 +- forms/source/component/Columns.cxx | 23 +- forms/source/component/Columns.hxx | 81 +++-- forms/source/component/ComboBox.cxx | 14 +- forms/source/component/ComboBox.hxx | 2 +- forms/source/component/DatabaseForm.cxx | 334 ++++++++++++++------- forms/source/component/DatabaseForm.hxx | 6 + forms/source/component/Edit.cxx | 6 +- forms/source/component/FormComponent.cxx | 457 +++++++++++++++++++---------- forms/source/component/FormattedField.cxx | 4 +- forms/source/component/FormsCollection.cxx | 27 +- forms/source/component/FormsCollection.hxx | 4 + forms/source/component/Grid.cxx | 210 ++++++------- forms/source/component/Grid.hxx | 55 ++-- forms/source/component/ImageControl.cxx | 181 +++++------- forms/source/component/ImageControl.hxx | 63 +--- forms/source/component/ListBox.cxx | 14 +- forms/source/component/ListBox.hxx | 2 +- forms/source/component/entrylisthelper.cxx | 48 +-- forms/source/component/entrylisthelper.hxx | 19 +- forms/source/inc/FormComponent.hxx | 276 +++++++++++------ forms/source/inc/InterfaceContainer.hxx | 50 +++- forms/source/misc/InterfaceContainer.cxx | 163 +++++++--- 23 files changed, 1214 insertions(+), 827 deletions(-) (limited to 'forms') diff --git a/forms/source/component/Button.cxx b/forms/source/component/Button.cxx index 5b41b825ff9c..38b1a0376a76 100644 --- a/forms/source/component/Button.cxx +++ b/forms/source/component/Button.cxx @@ -555,7 +555,7 @@ sal_Int32 OButtonControl::getModelUrlFeatureId( ) const // is it a feature URL? if ( isFormControllerURL( sUrl ) ) { - OFormNavigationMapper aMapper( getORB() ); + OFormNavigationMapper aMapper( m_aContext.getLegacyServiceFactory() ); nFeatureId = aMapper.getFeatureId( sUrl ); } } diff --git a/forms/source/component/Columns.cxx b/forms/source/component/Columns.cxx index fae95b36f180..b9b2b6cb5936 100644 --- a/forms/source/component/Columns.cxx +++ b/forms/source/component/Columns.cxx @@ -204,11 +204,11 @@ Any SAL_CALL OGridColumn::queryAggregation( const Type& _rType ) throw (RuntimeE DBG_NAME(OGridColumn); //------------------------------------------------------------------------------ -OGridColumn::OGridColumn(const Reference& _rxFactory, const ::rtl::OUString& _sModelName) +OGridColumn::OGridColumn( const comphelper::ComponentContext& _rContext, const ::rtl::OUString& _sModelName ) :OGridColumn_BASE(m_aMutex) ,OPropertySetAggregationHelper(OGridColumn_BASE::rBHelper) ,m_aHidden( makeAny( sal_False ) ) - ,m_xORB( _rxFactory ) + ,m_aContext( _rContext ) ,m_aModelName(_sModelName) { DBG_CTOR(OGridColumn,NULL); @@ -218,15 +218,13 @@ OGridColumn::OGridColumn(const Reference& _rxFactory, cons { increment( m_refCount ); - // Muss im eigenen Block, - // da xAgg vor dem delegator setzen wieder freigesetzt sein muss! { - m_xAggregate = Reference< XAggregation >( _rxFactory->createInstance( m_aModelName ), UNO_QUERY ); + m_xAggregate.set( m_aContext.createComponent( m_aModelName ), UNO_QUERY ); setAggregation( m_xAggregate ); } - if (m_xAggregate.is()) - { // don't omit this brackets - they ensure that the following temporary is properly deleted + if ( m_xAggregate.is() ) + { // don't omit those brackets - they ensure that the following temporary is properly deleted m_xAggregate->setDelegator( static_cast< ::cppu::OWeakObject* >( this ) ); } @@ -239,7 +237,7 @@ OGridColumn::OGridColumn(const Reference& _rxFactory, cons OGridColumn::OGridColumn( const OGridColumn* _pOriginal ) :OGridColumn_BASE( m_aMutex ) ,OPropertySetAggregationHelper( OGridColumn_BASE::rBHelper ) - ,m_xORB( _pOriginal->m_xORB ) + ,m_aContext( _pOriginal->m_aContext ) { DBG_CTOR(OGridColumn,NULL); @@ -283,13 +281,6 @@ OGridColumn::~OGridColumn() DBG_DTOR(OGridColumn,NULL); } -// XChild -//------------------------------------------------------------------------------ -void SAL_CALL OGridColumn::setParent(const InterfaceRef& Parent) throw(NoSupportException, RuntimeException) -{ - m_xParent = Parent; -} - // XEventListener //------------------------------------------------------------------------------ void SAL_CALL OGridColumn::disposing(const EventObject& _rSource) throw(RuntimeException) @@ -311,8 +302,6 @@ void OGridColumn::disposing() Reference xComp; if (query_aggregation(m_xAggregate, xComp)) xComp->dispose(); - - setParent(InterfaceRef ()); } //------------------------------------------------------------------------------ diff --git a/forms/source/component/Columns.hxx b/forms/source/component/Columns.hxx index 0e5c7a570c62..f1aafd47cb5d 100644 --- a/forms/source/component/Columns.hxx +++ b/forms/source/component/Columns.hxx @@ -31,19 +31,23 @@ #ifndef _FRM_COLUMNS_HXX #define _FRM_COLUMNS_HXX -#include -#include -#include -#include -#include "frm_strings.hxx" -#include -#include -#include -#include -#include -#include -#include -#include "cloneable.hxx" +#include "cloneable.hxx" +#include "frm_strings.hxx" + +/** === begin UNO includes === **/ +#include +#include +#include +#include +/** === end UNO includes === **/ + +#include +#include +#include +#include +#include +#include +#include using namespace comphelper; @@ -55,8 +59,7 @@ namespace frm //================================================================== // OGridColumn //================================================================== -typedef ::cppu::WeakAggComponentImplHelper3 < ::com::sun::star::container::XChild - , ::com::sun::star::lang::XUnoTunnel +typedef ::cppu::WeakAggComponentImplHelper2 < ::com::sun::star::lang::XUnoTunnel , ::com::sun::star::util::XCloneable > OGridColumn_BASE; class OGridColumn :public ::comphelper::OBaseMutex ,public OGridColumn_BASE @@ -70,17 +73,15 @@ protected: ::com::sun::star::uno::Any m_aHidden; // column hidden? // [properties] - InterfaceRef m_xParent; - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory> - m_xORB; - ::rtl::OUString m_aModelName; + ::comphelper::ComponentContext m_aContext; + ::rtl::OUString m_aModelName; // [properties] ::rtl::OUString m_aLabel; // Name der Spalte // [properties] public: - OGridColumn(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory, const ::rtl::OUString& _sModelName = ::rtl::OUString()); + OGridColumn(const ::comphelper::ComponentContext& _rContext, const ::rtl::OUString& _sModelName = ::rtl::OUString()); OGridColumn(const OGridColumn* _pOriginal ); virtual ~OGridColumn(); @@ -102,10 +103,6 @@ public: // XEventListener virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& _rSource) throw(::com::sun::star::uno::RuntimeException); - // XChild - virtual InterfaceRef SAL_CALL getParent() throw(::com::sun::star::uno::RuntimeException){return m_xParent;} - virtual void SAL_CALL setParent(const InterfaceRef& Parent) throw(::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException); - // XPersistObject virtual void SAL_CALL write(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectOutputStream>& _rxOutStream); virtual void SAL_CALL read(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectInputStream>& _rxInStream); @@ -135,30 +132,30 @@ protected: virtual OGridColumn* createCloneColumn() const = 0; }; -#define DECL_COLUMN(ClassName) \ -class ClassName \ - :public OGridColumn \ - ,public OAggregationArrayUsageHelper< ClassName > \ -{ \ -public: \ - ClassName(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory);\ - ClassName(const ClassName* _pCloneFrom);\ - \ +#define DECL_COLUMN(ClassName) \ +class ClassName \ + :public OGridColumn \ + ,public OAggregationArrayUsageHelper< ClassName > \ +{ \ +public: \ + ClassName(const ::comphelper::ComponentContext& _rContext ); \ + ClassName(const ClassName* _pCloneFrom); \ + \ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException); \ - virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); \ - \ - virtual void fillProperties( \ - ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps, \ + virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); \ + \ + virtual void fillProperties( \ + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps, \ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rAggregateProps \ - ) const; \ - \ - virtual OGridColumn* createCloneColumn() const; \ + ) const; \ + \ + virtual OGridColumn* createCloneColumn() const; \ }; #define IMPL_COLUMN(ClassName, Model, bAllowDropDown) \ -ClassName::ClassName(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory) \ - :OGridColumn(_rxFactory, Model) \ + ClassName::ClassName( const ::comphelper::ComponentContext& _rContext ) \ + :OGridColumn(_rContext, Model) \ { \ } \ ClassName::ClassName( const ClassName* _pCloneFrom ) \ diff --git a/forms/source/component/ComboBox.cxx b/forms/source/component/ComboBox.cxx index fc8cd78fdfde..3491c2142449 100644 --- a/forms/source/component/ComboBox.cxx +++ b/forms/source/component/ComboBox.cxx @@ -143,7 +143,7 @@ DBG_NAME( OComboBoxModel ) OComboBoxModel::OComboBoxModel(const Reference& _rxFactory) :OBoundControlModel( _rxFactory, VCL_CONTROLMODEL_COMBOBOX, FRM_SUN_CONTROL_COMBOBOX, sal_True, sal_True, sal_True ) // use the old control name for compytibility reasons - ,OEntryListHelper( m_aMutex ) + ,OEntryListHelper( (OControlModel&)*this ) ,OErrorBroadcaster( OComponentHelper::rBHelper ) ,m_aListRowSet( getContext() ) ,m_eListSourceType(ListSourceType_TABLE) @@ -158,7 +158,7 @@ OComboBoxModel::OComboBoxModel(const Reference& _rxFactory //------------------------------------------------------------------ OComboBoxModel::OComboBoxModel( const OComboBoxModel* _pOriginal, const Reference& _rxFactory ) :OBoundControlModel( _pOriginal, _rxFactory ) - ,OEntryListHelper( *_pOriginal, m_aMutex ) + ,OEntryListHelper( *_pOriginal, (OControlModel&)*this ) ,OErrorBroadcaster( OComponentHelper::rBHelper ) ,m_aListRowSet( getContext() ) ,m_aListSource( _pOriginal->m_aListSource ) @@ -265,8 +265,8 @@ void OComboBoxModel::setFastPropertyValue_NoBroadcast(sal_Int32 _nHandle, const case PROPERTY_ID_STRINGITEMLIST: { - ::osl::ResettableMutexGuard aGuard( m_aMutex ); - setNewStringItemList( _rValue, aGuard ); + ControlModelLock aLock( *this ); + setNewStringItemList( _rValue, aLock ); // TODO: this is bogus. setNewStringItemList expects a guard which has the *only* // lock to the mutex, but setFastPropertyValue_NoBroadcast is already called with // a lock - so we effectively has two locks here, of which setNewStringItemList can @@ -384,7 +384,7 @@ void SAL_CALL OComboBoxModel::write(const Reference void SAL_CALL OComboBoxModel::read(const Reference& _rxInStream) throw(stario::IOException, RuntimeException) { OBoundControlModel::read(_rxInStream); - ::osl::ResettableMutexGuard aGuard(m_aMutex); + ControlModelLock aLock( *this ); // since we are "overwriting" the StringItemList of our aggregate (means we have // an own place to store the value, instead of relying on our aggregate storing it), @@ -392,7 +392,7 @@ void SAL_CALL OComboBoxModel::read(const Reference& try { if ( m_xAggregateSet.is() ) - setNewStringItemList( m_xAggregateSet->getPropertyValue( PROPERTY_STRINGITEMLIST ), aGuard ); + setNewStringItemList( m_xAggregateSet->getPropertyValue( PROPERTY_STRINGITEMLIST ), aLock ); } catch( const Exception& ) { @@ -853,7 +853,7 @@ Any OComboBoxModel::getDefaultForReset() const } //-------------------------------------------------------------------- -void OComboBoxModel::stringItemListChanged( ::osl::ResettableMutexGuard& /*_rInstanceLock*/ ) +void OComboBoxModel::stringItemListChanged( ControlModelLock& /*_rInstanceLock*/ ) { if ( m_xAggregateSet.is() ) m_xAggregateSet->setPropertyValue( PROPERTY_STRINGITEMLIST, makeAny( getStringItemList() ) ); diff --git a/forms/source/component/ComboBox.hxx b/forms/source/component/ComboBox.hxx index 28e17ebe9f42..835099a7637c 100644 --- a/forms/source/component/ComboBox.hxx +++ b/forms/source/component/ComboBox.hxx @@ -146,7 +146,7 @@ protected: getDefaultForReset() const; // OEntryListHelper overriables - virtual void stringItemListChanged( ::osl::ResettableMutexGuard& _rInstanceLock ); + virtual void stringItemListChanged( ControlModelLock& _rInstanceLock ); virtual void connectedExternalListSource( ); virtual void disconnectedExternalListSource( ); virtual void refreshInternalEntryList(); diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx index f524142865e5..bba5b48ffe28 100644 --- a/forms/source/component/DatabaseForm.cxx +++ b/forms/source/component/DatabaseForm.cxx @@ -31,72 +31,71 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_forms.hxx" -#include -#include -#include - -#include "DatabaseForm.hxx" -#include "EventThread.hxx" -#include "frm_resource.hxx" -#include "frm_resource.hrc" -#include "GroupManager.hxx" -#include "property.hrc" -#include "property.hxx" -#include "services.hxx" -#include "frm_module.hxx" -#include "componenttools.hxx" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#ifndef _INETSTRM_HXX //autogen -#include -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "componenttools.hxx" +#include "DatabaseForm.hxx" +#include "EventThread.hxx" +#include "frm_module.hxx" +#include "frm_resource.hrc" +#include "frm_resource.hxx" +#include "GroupManager.hxx" +#include "property.hrc" +#include "property.hxx" +#include "services.hxx" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +//#include // compatiblity: DatabaseCursorType is dead, but for compatiblity reasons we still have to write it ... namespace com { @@ -115,8 +114,6 @@ enum DatabaseCursorType } } } } -#define DATABASEFORM_IMPLEMENTATION_NAME ::rtl::OUString::createFromAscii("com.sun.star.comp.forms.ODatabaseForm") - using namespace ::dbtools; using namespace ::comphelper; using namespace ::com::sun::star::uno; @@ -261,51 +258,152 @@ Any SAL_CALL ODatabaseForm::queryAggregation(const Type& _rType) throw(RuntimeEx DBG_NAME(ODatabaseForm); //------------------------------------------------------------------ ODatabaseForm::ODatabaseForm(const Reference& _rxFactory) - :OFormComponents(_rxFactory) - ,OPropertySetAggregationHelper(OComponentHelper::rBHelper) - ,OPropertyChangeListener(m_aMutex) - ,m_aLoadListeners(m_aMutex) - ,m_aRowSetApproveListeners(m_aMutex) - ,m_aRowSetListeners(m_aMutex) - ,m_aSubmitListeners(m_aMutex) - ,m_aErrorListeners(m_aMutex) - ,m_aResetListeners( *this, m_aMutex ) - ,m_aPropertyBagHelper( *this ) - ,m_pAggregatePropertyMultiplexer(NULL) - ,m_pGroupManager( NULL ) - ,m_aParameterManager( m_aMutex, _rxFactory ) - ,m_aFilterManager( _rxFactory ) - ,m_pLoadTimer(NULL) - ,m_pThread(NULL) - ,m_nResetsPending(0) - ,m_nPrivileges(0) - ,m_bInsertOnly( sal_False ) - ,m_eSubmitMethod(FormSubmitMethod_GET) - ,m_eSubmitEncoding(FormSubmitEncoding_URL) - ,m_eNavigation(NavigationBarMode_CURRENT) - ,m_bAllowInsert(sal_True) - ,m_bAllowUpdate(sal_True) - ,m_bAllowDelete(sal_True) - ,m_bLoaded(sal_False) - ,m_bSubForm(sal_False) - ,m_bForwardingConnection(sal_False) - ,m_bSharingConnection( sal_False ) -{ - DBG_CTOR(ODatabaseForm,NULL); + :OFormComponents(_rxFactory) + ,OPropertySetAggregationHelper(OComponentHelper::rBHelper) + ,OPropertyChangeListener(m_aMutex) + ,m_aLoadListeners(m_aMutex) + ,m_aRowSetApproveListeners(m_aMutex) + ,m_aRowSetListeners(m_aMutex) + ,m_aSubmitListeners(m_aMutex) + ,m_aErrorListeners(m_aMutex) + ,m_aResetListeners( *this, m_aMutex ) + ,m_aPropertyBagHelper( *this ) + ,m_pAggregatePropertyMultiplexer(NULL) + ,m_pGroupManager( NULL ) + ,m_aParameterManager( m_aMutex, _rxFactory ) + ,m_aFilterManager( _rxFactory ) + ,m_pLoadTimer(NULL) + ,m_pThread(NULL) + ,m_nResetsPending(0) + ,m_nPrivileges(0) + ,m_bInsertOnly( sal_False ) + ,m_eSubmitMethod(FormSubmitMethod_GET) + ,m_eSubmitEncoding(FormSubmitEncoding_URL) + ,m_eNavigation(NavigationBarMode_CURRENT) + ,m_bAllowInsert(sal_True) + ,m_bAllowUpdate(sal_True) + ,m_bAllowDelete(sal_True) + ,m_bLoaded(sal_False) + ,m_bSubForm(sal_False) + ,m_bForwardingConnection(sal_False) + ,m_bSharingConnection( sal_False ) +{ + DBG_CTOR( ODatabaseForm, NULL ); + impl_construct(); +} + +//------------------------------------------------------------------ +ODatabaseForm::ODatabaseForm( const ODatabaseForm& _cloneSource ) + :OFormComponents( _cloneSource ) + ,OPropertySetAggregationHelper( OComponentHelper::rBHelper ) + ,OPropertyChangeListener( m_aMutex ) + ,ODatabaseForm_BASE1() + ,ODatabaseForm_BASE2() + ,ODatabaseForm_BASE3() + ,IPropertyBagHelperContext() + ,m_aLoadListeners( m_aMutex ) + ,m_aRowSetApproveListeners( m_aMutex ) + ,m_aRowSetListeners( m_aMutex ) + ,m_aSubmitListeners( m_aMutex ) + ,m_aErrorListeners( m_aMutex ) + ,m_aResetListeners( *this, m_aMutex ) + ,m_aPropertyBagHelper( *this ) + ,m_pAggregatePropertyMultiplexer( NULL ) + ,m_pGroupManager( NULL ) + ,m_aParameterManager( m_aMutex, _cloneSource.m_xServiceFactory ) + ,m_aFilterManager( _cloneSource.m_xServiceFactory ) + ,m_pLoadTimer( NULL ) + ,m_pThread( NULL ) + ,m_nResetsPending( 0 ) + ,m_nPrivileges( 0 ) + ,m_bInsertOnly( _cloneSource.m_bInsertOnly ) + ,m_aControlBorderColorFocus( _cloneSource.m_aControlBorderColorFocus ) + ,m_aControlBorderColorMouse( _cloneSource.m_aControlBorderColorMouse ) + ,m_aControlBorderColorInvalid( _cloneSource.m_aControlBorderColorInvalid ) + ,m_aDynamicControlBorder( _cloneSource.m_aDynamicControlBorder ) + ,m_sName( _cloneSource.m_sName ) + ,m_aTargetURL( _cloneSource.m_aTargetURL ) + ,m_aTargetFrame( _cloneSource.m_aTargetFrame ) + ,m_eSubmitMethod( _cloneSource.m_eSubmitMethod ) + ,m_eSubmitEncoding( _cloneSource.m_eSubmitEncoding ) + ,m_eNavigation( _cloneSource.m_eNavigation ) + ,m_bAllowInsert( _cloneSource.m_bAllowInsert ) + ,m_bAllowUpdate( _cloneSource.m_bAllowUpdate ) + ,m_bAllowDelete( _cloneSource.m_bAllowDelete ) + ,m_bLoaded( sal_False ) + ,m_bSubForm( sal_False ) + ,m_bForwardingConnection( sal_False ) + ,m_bSharingConnection( sal_False ) +{ + DBG_CTOR( ODatabaseForm, NULL ); + + impl_construct(); + + osl_incrementInterlockedCount( &m_refCount ); + { + // our aggregated rowset itself is not cloneable, so simply copy the properties + ::comphelper::copyProperties( _cloneSource.m_xAggregateSet, m_xAggregateSet ); + + // also care for the dynamic properties: If the clone source has properties which we do not have, + // then add them + try + { + Reference< XPropertySet > xSourceProps( const_cast< ODatabaseForm& >( _cloneSource ).queryAggregation( + XPropertySet::static_type() ), UNO_QUERY_THROW ); + Reference< XPropertySetInfo > xSourcePSI( xSourceProps->getPropertySetInfo(), UNO_SET_THROW ); + Reference< XPropertyState > xSourcePropState( xSourceProps, UNO_QUERY ); + + Reference< XPropertySetInfo > xDestPSI( getPropertySetInfo(), UNO_QUERY_THROW ); + + Sequence< Property > aSourceProperties( xSourcePSI->getProperties() ); + for ( const Property* pSourceProperty = aSourceProperties.getConstArray(); + pSourceProperty != aSourceProperties.getConstArray() + aSourceProperties.getLength(); + ++pSourceProperty + ) + { + if ( xDestPSI->hasPropertyByName( pSourceProperty->Name ) ) + continue; + + // the initial value passed to XPropertyContainer is also used as default, usually. So, try + // to retrieve the default of the source property + Any aInitialValue; + if ( xSourcePropState.is() ) + { + aInitialValue = xSourcePropState->getPropertyDefault( pSourceProperty->Name ); + } + else + { + aInitialValue = xSourceProps->getPropertyValue( pSourceProperty->Name ); + } + addProperty( pSourceProperty->Name, pSourceProperty->Attributes, aInitialValue ); + setPropertyValue( pSourceProperty->Name, xSourceProps->getPropertyValue( pSourceProperty->Name ) ); + } + } + catch( const Exception& ) + { + throw WrappedTargetException( + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Could not clone the given database form." ) ), + *const_cast< ODatabaseForm* >( &_cloneSource ), + ::cppu::getCaughtException() + ); + } + } + osl_decrementInterlockedCount( &m_refCount ); +} +//------------------------------------------------------------------ +void ODatabaseForm::impl_construct() +{ // aggregate a row set increment(m_refCount); - { - m_xAggregate = Reference(m_xServiceFactory->createInstance(SRV_SDB_ROWSET), UNO_QUERY); - // m_xAggregate = Reference(m_xServiceFactory->createInstance(rtl::OUString::createFromAscii("com.sun.star.sdb.dbaccess.ORowSet")), UNO_QUERY); - DBG_ASSERT(m_xAggregate.is(), "ODatabaseForm::ODatabaseForm : could not instantiate an SDB rowset !"); - m_xAggregateAsRowSet = Reference (m_xAggregate,UNO_QUERY); - setAggregation(m_xAggregate); + m_xAggregate = Reference< XAggregation >( m_xServiceFactory->createInstance( SRV_SDB_ROWSET ), UNO_QUERY_THROW ); + m_xAggregateAsRowSet.set( m_xAggregate, UNO_QUERY_THROW ); + setAggregation( m_xAggregate ); } // listen for the properties, important for Parameters - if (m_xAggregateSet.is()) + if ( m_xAggregateSet.is() ) { m_pAggregatePropertyMultiplexer = new OPropertyChangeMultiplexer(this, m_xAggregateSet, sal_False); m_pAggregatePropertyMultiplexer->acquire(); @@ -313,9 +411,9 @@ ODatabaseForm::ODatabaseForm(const Reference& _rxFactory) m_pAggregatePropertyMultiplexer->addProperty(PROPERTY_ACTIVE_CONNECTION); } - if (m_xAggregate.is()) + if ( m_xAggregate.is() ) { - m_xAggregate->setDelegator(static_cast(this)); + m_xAggregate->setDelegator( static_cast< XWeak* >( this ) ); } { @@ -324,10 +422,9 @@ ODatabaseForm::ODatabaseForm(const Reference& _rxFactory) declareForwardedProperty( PROPERTY_ID_ACTIVE_CONNECTION ); } + decrement( m_refCount ); - decrement(m_refCount); - - m_pGroupManager = new OGroupManager(this); + m_pGroupManager = new OGroupManager( this ); m_pGroupManager->acquire(); } @@ -337,9 +434,10 @@ ODatabaseForm::~ODatabaseForm() DBG_DTOR(ODatabaseForm,NULL); m_pGroupManager->release(); + m_pGroupManager = NULL; if (m_xAggregate.is()) - m_xAggregate->setDelegator(InterfaceRef()); + m_xAggregate->setDelegator( NULL ); if (m_pAggregatePropertyMultiplexer) { @@ -1367,6 +1465,16 @@ void SAL_CALL ODatabaseForm::setPropertyValues( const Sequence< PropertyValue >& m_aPropertyBagHelper.setPropertyValues( _rProps ); } +//------------------------------------------------------------------------------ +Reference< XCloneable > SAL_CALL ODatabaseForm::createClone( ) throw (RuntimeException) +{ + ODatabaseForm* pClone = new ODatabaseForm( *this ); + osl_incrementInterlockedCount( &pClone->m_refCount ); + pClone->clonedFrom( *this ); + osl_decrementInterlockedCount( &pClone->m_refCount ); + return pClone; +} + //------------------------------------------------------------------------------ void ODatabaseForm::fire( sal_Int32* pnHandles, const Any* pNewValues, const Any* pOldValues, sal_Int32 nCount, sal_Bool bVetoable ) { @@ -3694,7 +3802,7 @@ void SAL_CALL ODatabaseForm::propertyChange( const PropertyChangeEvent& evt ) th //------------------------------------------------------------------------------ ::rtl::OUString SAL_CALL ODatabaseForm::getImplementationName_Static() { - return DATABASEFORM_IMPLEMENTATION_NAME; + return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.forms.ODatabaseForm" ) ); } //------------------------------------------------------------------------------ diff --git a/forms/source/component/DatabaseForm.hxx b/forms/source/component/DatabaseForm.hxx index 47b43fb53f03..3cbbbcec2bbd 100644 --- a/forms/source/component/DatabaseForm.hxx +++ b/forms/source/component/DatabaseForm.hxx @@ -228,6 +228,7 @@ class ODatabaseForm :public OFormComponents public: ODatabaseForm(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); + ODatabaseForm( const ODatabaseForm& _cloneSource ); ~ODatabaseForm(); // UNO binding @@ -440,6 +441,9 @@ public: virtual void SAL_CALL setPropertyValues( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aProps ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); using OPropertySetAggregationHelper::setPropertyValues; + // XCloneable + virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone( ) throw (::com::sun::star::uno::RuntimeException); + inline void submitNBC( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl>& Control, const ::com::sun::star::awt::MouseEvent& MouseEvt ); protected: @@ -538,6 +542,8 @@ private: void impl_createLoadTimer(); + void impl_construct(); + DECL_LINK( OnTimeout, void* ); protected: using OPropertySetHelper::getPropertyValues; diff --git a/forms/source/component/Edit.cxx b/forms/source/component/Edit.cxx index 4ada0ca85861..0f4abd687d65 100644 --- a/forms/source/component/Edit.cxx +++ b/forms/source/component/Edit.cxx @@ -519,7 +519,8 @@ void OEditModel::writeAggregate( const Reference< XObjectOutputStream >& _rxOutS // but for compatibility, we need to use an "old" aggregate for writing and reading Reference< XPropertySet > xFakedAggregate( - getORB()->createInstance( VCL_CONTROLMODEL_EDIT ), UNO_QUERY + getContext().createComponent( (rtl::OUString)VCL_CONTROLMODEL_EDIT ), + UNO_QUERY ); OSL_ENSURE( xFakedAggregate.is(), "OEditModel::writeAggregate: could not create an old EditControlModel!" ); if ( !xFakedAggregate.is() ) @@ -540,7 +541,8 @@ void OEditModel::readAggregate( const Reference< XObjectInputStream >& _rxInStre // but for compatibility, we need to use an "old" aggregate for writing and reading Reference< XPropertySet > xFakedAggregate( - getORB()->createInstance( VCL_CONTROLMODEL_EDIT ), UNO_QUERY + getContext().createComponent( (rtl::OUString)VCL_CONTROLMODEL_EDIT ), + UNO_QUERY ); Reference< XPersistObject > xFakedPersist( xFakedAggregate, UNO_QUERY ); OSL_ENSURE( xFakedPersist.is(), "OEditModel::readAggregate: no XPersistObject, or no faked aggregate at all!" ); diff --git a/forms/source/component/FormComponent.cxx b/forms/source/component/FormComponent.cxx index 4b1bc5515836..5b00c5fbb9a2 100644 --- a/forms/source/component/FormComponent.cxx +++ b/forms/source/component/FormComponent.cxx @@ -30,35 +30,39 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_forms.hxx" -#include "FormComponent.hxx" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifndef _FRM_PROPERTY_HRC_ -#include "property.hrc" -#endif -#include "services.hxx" -#include "componenttools.hxx" -#include -#include -#include -#include - -#include "frm_resource.hxx" -#include "frm_resource.hrc" + +#include "componenttools.hxx" +#include "FormComponent.hxx" +#include "frm_resource.hrc" +#include "frm_resource.hxx" +#include "property.hrc" +#include "services.hxx" + +/** === begin UNO includes === **/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +/** === end UNO includes === **/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -88,15 +92,67 @@ namespace frm using namespace ::dbtools; using namespace ::comphelper; -//========================================================================= + //========================================================================= + //= FieldChangeNotifier + //========================================================================= + //------------------------------------------------------------------------- + void ControlModelLock::impl_notifyAll_nothrow() + { + m_rModel.firePropertyChanges( m_aHandles, m_aOldValues, m_aNewValues, OControlModel::LockAccess() ); + } + + //------------------------------------------------------------------------- + void ControlModelLock::addPropertyNotification( const sal_Int32 _nHandle, const Any& _rOldValue, const Any& _rNewValue ) + { + sal_Int32 nOldLength = m_aHandles.getLength(); + if ( ( nOldLength != m_aOldValues.getLength() ) + || ( nOldLength != m_aNewValues.getLength() ) + ) + throw RuntimeException( ::rtl::OUString(), m_rModel ); + + m_aHandles.realloc( nOldLength + 1 ); + m_aHandles[ nOldLength ] = _nHandle; + m_aOldValues.realloc( nOldLength + 1 ); + m_aOldValues[ nOldLength ] = _rOldValue; + m_aNewValues.realloc( nOldLength + 1 ); + m_aNewValues[ nOldLength ] = _rNewValue; + } + + //========================================================================= + //= FieldChangeNotifier + //========================================================================= + //------------------------------------------------------------------------- + class FieldChangeNotifier + { + public: + FieldChangeNotifier( ControlModelLock& _rLock ) + :m_rLock( _rLock ) + ,m_rModel( dynamic_cast< OBoundControlModel& >( _rLock.getModel() ) ) + { + m_xOldField = m_rModel.getField(); + } + + ~FieldChangeNotifier() + { + Reference< XPropertySet > xNewField( m_rModel.getField() ); + if ( m_xOldField != xNewField ) + m_rLock.addPropertyNotification( PROPERTY_ID_BOUNDFIELD, makeAny( m_xOldField ), makeAny( xNewField ) ); + } + + private: + ControlModelLock& m_rLock; + OBoundControlModel& m_rModel; + Reference< XPropertySet > m_xOldField; + }; + +//============================================================================= //= base class for form layer controls -//========================================================================= +//============================================================================= DBG_NAME(frm_OControl) //------------------------------------------------------------------------------ OControl::OControl( const Reference< XMultiServiceFactory >& _rxFactory, const rtl::OUString& _rAggregateService, const sal_Bool _bSetDelegator ) :OComponentHelper(m_aMutex) ,m_aContext( _rxFactory ) - ,m_xServiceFactory(_rxFactory) { DBG_CTOR(frm_OControl, NULL); // VCL-Control aggregieren @@ -554,7 +610,7 @@ OControlModel::OControlModel( :OComponentHelper(m_aMutex) ,OPropertySetAggregationHelper(OComponentHelper::rBHelper) ,m_aContext( _rxFactory ) - ,m_xServiceFactory(_rxFactory) + ,m_lockCount( 0 ) ,m_aPropertyBagHelper( *this ) ,m_nTabIndex(FRM_DEFAULT_TABINDEX) ,m_nClassId(FormComponentType::CONTROL) @@ -599,7 +655,7 @@ OControlModel::OControlModel( const OControlModel* _pOriginal, const Reference< :OComponentHelper( m_aMutex ) ,OPropertySetAggregationHelper( OComponentHelper::rBHelper ) ,m_aContext( _rxFactory ) - ,m_xServiceFactory( _rxFactory ) + ,m_lockCount( 0 ) ,m_aPropertyBagHelper( *this ) ,m_nTabIndex( FRM_DEFAULT_TABINDEX ) ,m_nClassId( FormComponentType::CONTROL ) @@ -685,14 +741,11 @@ void SAL_CALL OControlModel::setParent(const InterfaceRef& _rxParent) throw(com: if (xComp.is()) xComp->removeEventListener(static_cast(this)); - { - xComp = xComp.query( _rxParent ); - RTL_LOGFILE_CONTEXT( aLogger, "OControlModel::setParent::logOnEventListener" ); - if ( xComp.is() ) - xComp->addEventListener(static_cast(this)); - } - m_xParent = _rxParent; + xComp = xComp.query( m_xParent ); + + if ( xComp.is() ) + xComp->addEventListener(static_cast(this)); } // XNamed @@ -1131,6 +1184,35 @@ void SAL_CALL OControlModel::setPropertyValues( const Sequence< PropertyValue >& m_aPropertyBagHelper.setPropertyValues( _rProps ); } +//-------------------------------------------------------------------- +void OControlModel::lockInstance( LockAccess ) +{ + m_aMutex.acquire(); + osl_incrementInterlockedCount( &m_lockCount ); +} + +//-------------------------------------------------------------------- +oslInterlockedCount OControlModel::unlockInstance( LockAccess ) +{ + OSL_ENSURE( m_lockCount > 0, "OControlModel::unlockInstance: not locked!" ); + oslInterlockedCount lockCount = osl_decrementInterlockedCount( &m_lockCount ); + m_aMutex.release(); + return lockCount; +} + +//-------------------------------------------------------------------- +void OControlModel::firePropertyChanges( const Sequence< sal_Int32 >& _rHandles, const Sequence< Any >& _rOldValues, + const Sequence< Any >& _rNewValues, LockAccess ) +{ + OPropertySetHelper::fire( + const_cast< Sequence< sal_Int32 >& >( _rHandles ).getArray(), + _rNewValues.getConstArray(), + _rOldValues.getConstArray(), + _rHandles.getLength(), + sal_False + ); +} + //================================================================== //= OBoundControlModel //================================================================== @@ -1163,6 +1245,8 @@ OBoundControlModel::OBoundControlModel( const sal_Bool _bCommitable, const sal_Bool _bSupportExternalBinding, const sal_Bool _bSupportsValidation ) :OControlModel( _rxFactory, _rUnoControlModelTypeName, _rDefault, sal_False ) ,OPropertyChangeListener( m_aMutex ) + ,m_xField() + ,m_xAmbientForm() ,m_nValuePropertyAggregateHandle( -1 ) ,m_nFieldType( DataType::OTHER ) ,m_bValuePropertyMayBeVoid( false ) @@ -1171,7 +1255,7 @@ OBoundControlModel::OBoundControlModel( ,m_aFormComponentListeners( m_aMutex ) ,m_bInputRequired( sal_True ) ,m_pAggPropMultiplexer( NULL ) - ,m_bLoadListening( sal_False ) + ,m_bFormListening( false ) ,m_bLoaded(sal_False) ,m_bRequired(sal_False) ,m_bCommitable(_bCommitable) @@ -1196,6 +1280,8 @@ OBoundControlModel::OBoundControlModel( const OBoundControlModel* _pOriginal, const Reference< XMultiServiceFactory>& _rxFactory ) :OControlModel( _pOriginal, _rxFactory, sal_True, sal_False ) ,OPropertyChangeListener( m_aMutex ) + ,m_xField() + ,m_xAmbientForm() ,m_nValuePropertyAggregateHandle( _pOriginal->m_nValuePropertyAggregateHandle ) ,m_nFieldType( DataType::OTHER ) ,m_bValuePropertyMayBeVoid( _pOriginal->m_bValuePropertyMayBeVoid ) @@ -1205,7 +1291,7 @@ OBoundControlModel::OBoundControlModel( ,m_xValidator( _pOriginal->m_xValidator ) ,m_bInputRequired( sal_True ) ,m_pAggPropMultiplexer( NULL ) - ,m_bLoadListening( sal_False ) + ,m_bFormListening( false ) ,m_bLoaded( sal_False ) ,m_bRequired( sal_False ) ,m_bCommitable( _pOriginal->m_bCommitable ) @@ -1395,7 +1481,7 @@ void OBoundControlModel::disposing() m_aUpdateListeners.disposeAndClear( aEvt ); // disconnect from our database column - // TODO: could we replace the following 5 lines with a call to disconnectDatabaseColumn? + // TODO: could we replace the following 5 lines with a call to impl_disconnectDatabaseColumn_noNotify? // The only more thing which it does is calling onDisconnectedDbColumn - could this // cause trouble? At least when we continue to call OControlModel::disposing before, it *may*. if ( hasField() ) @@ -1421,7 +1507,7 @@ void OBoundControlModel::disposing() //------------------------------------------------------------------------------ void OBoundControlModel::_propertyChanged( const PropertyChangeEvent& _rEvt ) throw ( RuntimeException ) { - ::osl::ResettableMutexGuard aGuard( m_aMutex ); + ControlModelLock aLock( *this ); OSL_ENSURE( _rEvt.PropertyName == m_sValuePropertyName, "OBoundControlModel::_propertyChanged: where did this come from (1)?" ); @@ -1435,7 +1521,7 @@ void OBoundControlModel::_propertyChanged( const PropertyChangeEvent& _rEvt ) th { // the control value changed, while we have an external value binding // -> forward the value to it if ( m_eControlValueChangeInstigator != eExternalBinding ) - transferControlValueToExternal( aGuard ); + transferControlValueToExternal( aLock ); } else if ( !m_bCommitable && m_xColumnUpdate.is() ) { // the control value changed, while we are bound to a database column, @@ -1465,56 +1551,71 @@ void OBoundControlModel::startAggregatePropertyListening( const ::rtl::OUString& } //------------------------------------------------------------------------------ -void OBoundControlModel::startLoadListening( ) +void OBoundControlModel::doFormListening( const bool _bStart ) { - OSL_PRECOND( !isLoadListening(), "OBoundControlModel::startLoadListening: already listening!" ); - OSL_PRECOND( m_xParent.is(), "OBoundControlModel::startLoadListening: no parent to listen at!" ); - OSL_PRECOND( !hasExternalValueBinding(), "OBoundControlModel::startLoadListening: external value binding should overrule the database binding!" ); + OSL_PRECOND( !hasExternalValueBinding(), "OBoundControlModel::doFormListening: external value binding should overrule the database binding!" ); - Reference< XLoadable > xLoadable( m_xParent, UNO_QUERY ); - if ( xLoadable.is() ) - { - RTL_LOGFILE_CONTEXT( aLogger, "forms::OBoundControlModel::startLoadListening" ); - xLoadable->addLoadListener( this ); - m_bLoadListening = sal_True; - } -} + if ( isFormListening() == _bStart ) + return; -//------------------------------------------------------------------------------ -void OBoundControlModel::stopLoadListening( ) -{ - OSL_PRECOND( isLoadListening(), "OBoundControlModel::stopLoadListening: not listening!" ); + if ( m_xAmbientForm.is() ) + _bStart ? m_xAmbientForm->addLoadListener( this ) : m_xAmbientForm->removeLoadListener( this ); - Reference< XLoadable > xLoadable( m_xParent, UNO_QUERY ); - if ( xLoadable.is() && isLoadListening() ) + Reference< XLoadable > xParentLoadable( getParent(), UNO_QUERY ); + if ( getParent().is() && !xParentLoadable.is() ) { - xLoadable->removeLoadListener( this ); - m_bLoadListening = sal_False; + // if our parent does not directly support the XLoadable interface, then it might support the + // XRowSetSupplier/XRowSetChangeBroadcaster interfaces. In this case we have to listen for changes + // broadcasted by the latter. + Reference< XRowSetChangeBroadcaster > xRowSetBroadcaster( getParent(), UNO_QUERY ); + if ( xRowSetBroadcaster.is() ) + _bStart ? xRowSetBroadcaster->addRowSetChangeListener( this ) : xRowSetBroadcaster->removeRowSetChangeListener( this ); } + + m_bFormListening = _bStart && m_xAmbientForm.is(); } // XChild //------------------------------------------------------------------------------ void SAL_CALL OBoundControlModel::setParent(const Reference& _rxParent) throw(com::sun::star::lang::NoSupportException, RuntimeException) { - ::osl::MutexGuard aGuard( m_aMutex ); + ControlModelLock aLock( *this ); + FieldChangeNotifier aBoundFieldNotifier( aLock ); + + if ( getParent() == _rxParent ) + return; + + // disconnect from database column (which is controlled by parent, directly or indirectly) + if ( hasField() ) + impl_disconnectDatabaseColumn_noNotify(); // log off old listeners - if ( isLoadListening() ) - stopLoadListening( ); + if ( isFormListening() ) + doFormListening( false ); - OControlModel::setParent(_rxParent); + // actually set the new parent + OControlModel::setParent( _rxParent ); + + // a new parent means a new ambient form + impl_determineAmbientForm_nothrow(); + + if ( !hasExternalValueBinding() ) + { + // log on new listeners + doFormListening( true ); - // log on new listeners - only in case we do not have an external value binding - if ( m_xParent.is() && !hasExternalValueBinding() ) - startLoadListening( ); + // re-connect to database column of the new parent + if ( m_xAmbientForm.is() && m_xAmbientForm->isLoaded() ) + impl_connectDatabaseColumn_noNotify( false ); + } } // XEventListener //------------------------------------------------------------------------------ void SAL_CALL OBoundControlModel::disposing(const com::sun::star::lang::EventObject& _rEvent) throw (RuntimeException) { - ::osl::ClearableMutexGuard aGuard( m_aMutex ); + ControlModelLock aLock( *this ); + if ( _rEvent.Source == getField() ) { resetField(); @@ -1524,11 +1625,8 @@ void SAL_CALL OBoundControlModel::disposing(const com::sun::star::lang::EventObj Reference xOldValue = m_xLabelControl; m_xLabelControl = NULL; - // fire a property change event - Any aOldValue; aOldValue <<= xOldValue; - Any aNewValue; aNewValue <<= m_xLabelControl; - sal_Int32 nHandle = PROPERTY_ID_CONTROLLABEL; - OPropertySetHelper::fire( &nHandle, &aNewValue, &aOldValue, 1, sal_False ); + // fire a propertyChanged (when we leave aLock's scope) + aLock.addPropertyNotification( PROPERTY_ID_CONTROLLABEL, makeAny( xOldValue ), makeAny( m_xLabelControl ) ); } else if ( _rEvent.Source == m_xExternalBinding ) { // *first* check for the external binding @@ -1884,6 +1982,31 @@ void SAL_CALL OBoundControlModel::propertyChange( const PropertyChangeEvent& evt } } +//------------------------------------------------------------------------------ +void SAL_CALL OBoundControlModel::onRowSetChanged( const EventObject& /*i_Event*/ ) throw (RuntimeException) +{ + ControlModelLock aLock( *this ); + FieldChangeNotifier aBoundFieldNotifier( aLock ); + + // disconnect from database column (which is controlled by parent, directly or indirectly) + if ( hasField() ) + impl_disconnectDatabaseColumn_noNotify(); + + // log off old listeners + if ( isFormListening() ) + doFormListening( false ); + + // determine the new ambient form + impl_determineAmbientForm_nothrow(); + + // log on new listeners + doFormListening( true ); + + // re-connect to database column if needed and possible + if ( m_xAmbientForm.is() && m_xAmbientForm->isLoaded() ) + impl_connectDatabaseColumn_noNotify( false ); +} + // XBoundComponent //------------------------------------------------------------------------------ void SAL_CALL OBoundControlModel::addUpdateListener(const Reference& _rxListener) throw(RuntimeException) @@ -1900,7 +2023,7 @@ void SAL_CALL OBoundControlModel::removeUpdateListener(const Reference< XUpdateL //------------------------------------------------------------------------------ sal_Bool SAL_CALL OBoundControlModel::commit() throw(RuntimeException) { - ::osl::ResettableMutexGuard aGuard( m_aMutex ); + ControlModelLock aLock( *this ); OSL_PRECOND( m_bCommitable, "OBoundControlModel::commit: invalid call (I'm not commitable !) " ); if ( hasExternalValueBinding() ) @@ -1911,7 +2034,7 @@ sal_Bool SAL_CALL OBoundControlModel::commit() throw(RuntimeException) if ( !m_sValuePropertyName.getLength() ) // but for those derivees which did not use this feature, we need an // explicit transfer - transferControlValueToExternal( aGuard ); + transferControlValueToExternal( aLock ); return sal_True; } @@ -1926,12 +2049,12 @@ sal_Bool SAL_CALL OBoundControlModel::commit() throw(RuntimeException) aEvent.Source = static_cast< XWeak* >( this ); sal_Bool bSuccess = sal_True; - aGuard.clear(); + aLock.release(); // >>>>>>>> ----- UNSAFE ----- >>>>>>>> while (aIter.hasMoreElements() && bSuccess) bSuccess = static_cast< XUpdateListener* >( aIter.next() )->approveUpdate( aEvent ); // <<<<<<<< ----- UNSAFE ----- <<<<<<<< - aGuard.reset(); + aLock.acquire(); if ( bSuccess ) { @@ -1948,7 +2071,7 @@ sal_Bool SAL_CALL OBoundControlModel::commit() throw(RuntimeException) if ( bSuccess ) { - aGuard.clear(); + aLock.release(); m_aUpdateListeners.notifyEach( &XUpdateListener::updated, aEvent ); } @@ -1997,24 +2120,31 @@ sal_Bool OBoundControlModel::connectToField(const Reference& rForm) sal_Int32 nFieldType = 0; xFieldCandidate->getPropertyValue( PROPERTY_FIELDTYPE ) >>= nFieldType; if ( approveDbColumnType( nFieldType ) ) + impl_setField_noNotify( xFieldCandidate ); + } + else + impl_setField_noNotify( NULL ); + + if ( m_xField.is() ) + { + if( m_xField->getPropertySetInfo()->hasPropertyByName( PROPERTY_VALUE ) ) { - m_xField = xFieldCandidate; + // an wertaenderungen horchen m_xField->addPropertyChangeListener( PROPERTY_VALUE, this ); - m_nFieldType = nFieldType; - - // listen to value changes m_xColumnUpdate = Reference< XColumnUpdate >( m_xField, UNO_QUERY ); m_xColumn = Reference< XColumn >( m_xField, UNO_QUERY ); INT32 nNullableFlag = ColumnValue::NO_NULLS; - m_xField->getPropertyValue( PROPERTY_ISNULLABLE ) >>= nNullableFlag; - m_bRequired = ( ColumnValue::NO_NULLS == nNullableFlag ); + m_xField->getPropertyValue(PROPERTY_ISNULLABLE) >>= nNullableFlag; + m_bRequired = (ColumnValue::NO_NULLS == nNullableFlag); // we're optimistic : in case of ColumnValue_NULLABLE_UNKNOWN we assume nullability .... } + else + { + OSL_ENSURE(sal_False, "OBoundControlModel::connectToField: property NAME not supported!"); + impl_setField_noNotify( NULL ); + } } - else - resetField(); - } catch( const Exception& ) { @@ -2056,25 +2186,39 @@ sal_Bool OBoundControlModel::approveDbColumnType(sal_Int32 _nColumnType) return sal_True; } -//============================================================================== -// value binding handling +//------------------------------------------------------------------------------ +void OBoundControlModel::impl_determineAmbientForm_nothrow() +{ + Reference< XInterface > xParent( const_cast< OBoundControlModel* >( this )->getParent() ); + + m_xAmbientForm.set( xParent, UNO_QUERY ); + if ( !m_xAmbientForm.is() ) + { + Reference< XRowSetSupplier > xSupRowSet( xParent, UNO_QUERY ); + if ( xSupRowSet.is() ) + m_xAmbientForm.set( xSupRowSet->getRowSet(), UNO_QUERY ); + } +} //------------------------------------------------------------------------------ -void OBoundControlModel::connectDatabaseColumn( const Reference< XRowSet >& _rxRowSet, bool _bFromReload ) +void OBoundControlModel::impl_connectDatabaseColumn_noNotify( bool _bFromReload ) { - OSL_PRECOND( !hasExternalValueBinding(), "OBoundControlModel::connectDatabaseColumn: not to be called with an external value binding!" ); - ::osl::MutexGuard aGuard( m_aMutex ); + OSL_PRECOND( !hasExternalValueBinding(), "OBoundControlModel::impl_connectDatabaseColumn_noNotify: not to be called with an external value binding!" ); // consistency checks DBG_ASSERT( !( hasField() && !_bFromReload ), - "OBoundControlModel::connectDatabaseColumn: the form is just *loaded*, but we already have a field!" ); + "OBoundControlModel::impl_connectDatabaseColumn_noNotify: the form is just *loaded*, but we already have a field!" ); (void)_bFromReload; - Reference< XPropertySet > xOldField = getField(); + Reference< XRowSet > xRowSet( m_xAmbientForm, UNO_QUERY ); + OSL_ENSURE( xRowSet.is(), "OBoundControlModel::impl_connectDatabaseColumn_noNotify: no row set!" ); + if ( !xRowSet.is() ) + return; + if ( !hasField() ) { // connect to the column - connectToField( _rxRowSet ); + connectToField( xRowSet ); } // now that we're connected (more or less, even if we did not find a column), @@ -2083,26 +2227,17 @@ void OBoundControlModel::connectDatabaseColumn( const Reference< XRowSet >& _rxR // let derived classes react on this new connection m_bLoaded = sal_True; - onConnectedDbColumn( _rxRowSet ); + onConnectedDbColumn( xRowSet ); // initially transfer the db column value to the control, if we successfully connected to a database column if ( hasField() ) - initFromField( _rxRowSet ); - - if ( xOldField != getField() ) - { - Any aNewValue; aNewValue <<= getField(); - Any aOldValue; aOldValue <<= xOldField; - sal_Int32 nHandle = PROPERTY_ID_BOUNDFIELD; - OPropertySetHelper::fire(&nHandle, &aNewValue, &aOldValue, 1, sal_False); - } + initFromField( xRowSet ); } //------------------------------------------------------------------------------ -void OBoundControlModel::disconnectDatabaseColumn( ) +void OBoundControlModel::impl_disconnectDatabaseColumn_noNotify() { - OSL_PRECOND( !hasExternalValueBinding(), "OBoundControlModel::disconnectDatabaseColumn: not to be called with an external value binding!" ); - ::osl::MutexGuard aGuard( m_aMutex ); + OSL_PRECOND( !hasExternalValueBinding(), "OBoundControlModel::impl_disconnectDatabaseColumn_noNotify: not to be called with an external value binding!" ); // let derived classes react on this onDisconnectedDbColumn(); @@ -2122,14 +2257,17 @@ void OBoundControlModel::disconnectDatabaseColumn( ) //------------------------------------------------------------------------------ void SAL_CALL OBoundControlModel::loaded( const EventObject& _rEvent ) throw(RuntimeException) { + ControlModelLock aLock( *this ); + FieldChangeNotifier aBoundFieldNotifier( aLock ); + + OSL_ENSURE( _rEvent.Source == m_xAmbientForm, "OBoundControlModel::loaded: where does this come from?" ); + (void)_rEvent; + OSL_PRECOND( !hasExternalValueBinding(), "OBoundControlModel::loaded: we should never reach this with an external value binding!" ); if ( hasExternalValueBinding() ) return; - // connect to the database column described by our SQL-binding-related properties - Reference< XRowSet > xRowSet( _rEvent.Source, UNO_QUERY ); - DBG_ASSERT( xRowSet.is(), "OBoundControlModel::loaded: event source is no RowSet?!" ); - connectDatabaseColumn( xRowSet, false ); + impl_connectDatabaseColumn_noNotify( false ); } @@ -2153,24 +2291,30 @@ void SAL_CALL OBoundControlModel::reloading( const com::sun::star::lang::EventOb //------------------------------------------------------------------------------ void SAL_CALL OBoundControlModel::unloading(const com::sun::star::lang::EventObject& /*aEvent*/) throw(RuntimeException) { + ControlModelLock aLock( *this ); + FieldChangeNotifier aBoundFieldNotifier( aLock ); + OSL_PRECOND( !hasExternalValueBinding(), "OBoundControlModel::unloading: we should never reach this with an external value binding!" ); if ( hasExternalValueBinding() ) return; - // disconnect from the database column described by our SQL-binding-related properties - disconnectDatabaseColumn(); + impl_disconnectDatabaseColumn_noNotify(); } //------------------------------------------------------------------------------ void SAL_CALL OBoundControlModel::reloaded( const EventObject& _rEvent ) throw(RuntimeException) { + ControlModelLock aLock( *this ); + FieldChangeNotifier aBoundFieldNotifier( aLock ); + + OSL_ENSURE( _rEvent.Source == m_xAmbientForm, "OBoundControlModel::reloaded: where does this come from?" ); + (void)_rEvent; + OSL_PRECOND( !hasExternalValueBinding(), "OBoundControlModel::reloaded: we should never reach this with an external value binding!" ); if ( hasExternalValueBinding() ) return; - Reference< XRowSet > xRowSet( _rEvent.Source, UNO_QUERY ); - DBG_ASSERT( xRowSet.is(), "OBoundControlModel::reloaded: event source is no RowSet?!" ); - connectDatabaseColumn( xRowSet, true ); + impl_connectDatabaseColumn_noNotify( true ); } //------------------------------------------------------------------------------ @@ -2310,7 +2454,7 @@ void OBoundControlModel::reset() throw (RuntimeException) if (!bContinue) return; - ::osl::ResettableMutexGuard aGuard( m_aMutex ); + ControlModelLock aLock( *this ); // on a new record? sal_Bool bIsNewRecord = sal_False; @@ -2414,17 +2558,25 @@ void OBoundControlModel::reset() throw (RuntimeException) // transfer to the external binding, if necessary if ( hasExternalValueBinding() ) - transferControlValueToExternal( aGuard ); + transferControlValueToExternal( aLock ); } // revalidate, if necessary if ( hasValidator() ) recheckValidity( true ); - aGuard.clear(); + aLock.release(); m_aResetListeners.notifyEach( &XResetListener::resetted, aResetEvent ); } + +// ----------------------------------------------------------------------------- +void OBoundControlModel::impl_setField_noNotify( const Reference< XPropertySet>& _rxField ) +{ + DBG_ASSERT( !hasExternalValueBinding(), "OBoundControlModel::impl_setField_noNotify: We have an external value binding!" ); + m_xField = _rxField; +} + //-------------------------------------------------------------------- sal_Bool OBoundControlModel::impl_approveValueBinding_nolock( const Reference< XValueBinding >& _rxBinding ) { @@ -2433,10 +2585,10 @@ sal_Bool OBoundControlModel::impl_approveValueBinding_nolock( const Reference< X Sequence< Type > aTypeCandidates; { - // >>>>>>>> ----- SAFE ----- >>>>>>>> + // SYNCHRONIZED --> ::osl::MutexGuard aGuard( m_aMutex ); aTypeCandidates = getSupportedBindingTypes(); - // <<<<<<<< ----- SAFE ----- <<<<<<<< + // <-- SYNCHRONIZED } for ( const Type* pType = aTypeCandidates.getConstArray(); @@ -2453,18 +2605,19 @@ sal_Bool OBoundControlModel::impl_approveValueBinding_nolock( const Reference< X //-------------------------------------------------------------------- void OBoundControlModel::connectExternalValueBinding( - const Reference< XValueBinding >& _rxBinding, ::osl::ResettableMutexGuard& _rInstanceLock ) + const Reference< XValueBinding >& _rxBinding, ControlModelLock& _rInstanceLock ) { OSL_PRECOND( _rxBinding.is(), "OBoundControlModel::connectExternalValueBinding: invalid binding instance!" ); OSL_PRECOND( !hasExternalValueBinding( ), "OBoundControlModel::connectExternalValueBinding: precond not met (currently have a binding)!" ); - // Suspend being a load listener at our parent form. This is because - // an external value binding overrules a possible database binding - if ( isLoadListening() ) - stopLoadListening( ); + // if we're connected to a database column, suspend this + if ( hasField() ) + impl_disconnectDatabaseColumn_noNotify(); - // TODO: if we're already connected to a db column, we should disconnect from it here, - // shouldn't we? + // suspend listening for load-related events at out ambient form. + // This is because an external value binding overrules a possible database binding. + if ( isFormListening() ) + doFormListening( false ); // remember this new binding m_xExternalBinding = _rxBinding; @@ -2551,13 +2704,13 @@ void OBoundControlModel::disconnectExternalValueBinding( ) // no binding anymore m_xExternalBinding.clear(); - // be a load listener at our parent, again. This was suspended while we had + // be a load listener at our form, again. This was suspended while we had // an external value binding in place. - if ( m_xParent.is() ) - startLoadListening( ); + doFormListening( true ); - // TODO: anything to care for here? Changing values? Falling back to a - // database binding if appropriate? + // re-connect to database column of the new parent + if ( m_xAmbientForm.is() && m_xAmbientForm->isLoaded() ) + impl_connectDatabaseColumn_noNotify( false ); // tell the derivee onDisconnectedExternalValue(); @@ -2578,7 +2731,11 @@ void SAL_CALL OBoundControlModel::setValueBinding( const Reference< XValueBindin ); } - ::osl::ResettableMutexGuard aGuard( m_aMutex ); + ControlModelLock aLock( *this ); + + // since a ValueBinding overrules any potentially active database binding, the change in a ValueBinding + // might trigger a change in our BoundField. + FieldChangeNotifier aBoundFieldNotifier( aLock ); // disconnect from the old binding if ( hasExternalValueBinding() ) @@ -2586,7 +2743,7 @@ void SAL_CALL OBoundControlModel::setValueBinding( const Reference< XValueBindin // connect to the new binding if ( _rxBinding.is() ) - connectExternalValueBinding( _rxBinding, aGuard ); + connectExternalValueBinding( _rxBinding, aLock ); } //-------------------------------------------------------------------- @@ -2603,12 +2760,12 @@ Reference< XValueBinding > SAL_CALL OBoundControlModel::getValueBinding( ) thro //-------------------------------------------------------------------- void SAL_CALL OBoundControlModel::modified( const EventObject& _rEvent ) throw ( RuntimeException ) { - ::osl::ResettableMutexGuard aGuard( m_aMutex ); + ControlModelLock aLock( *this ); OSL_PRECOND( hasExternalValueBinding(), "OBoundControlModel::modified: Where did this come from?" ); if ( !m_bTransferingValue && ( m_xExternalBinding == _rEvent.Source ) && m_xExternalBinding.is() ) { - transferExternalValueToControl( aGuard ); + transferExternalValueToControl( aLock ); } } @@ -2619,12 +2776,12 @@ void OBoundControlModel::transferDbValueToControl( ) } //------------------------------------------------------------------------------ -void OBoundControlModel::transferExternalValueToControl( ::osl::ResettableMutexGuard& _rInstanceLock ) +void OBoundControlModel::transferExternalValueToControl( ControlModelLock& _rInstanceLock ) { Reference< XValueBinding > xExternalBinding( m_xExternalBinding ); Type aValueExchangeType( getExternalValueType() ); - _rInstanceLock.clear(); + _rInstanceLock.release(); // >>>>>>>> ----- UNSAFE ----- >>>>>>>> Any aExternalValue; try @@ -2636,13 +2793,13 @@ void OBoundControlModel::transferExternalValueToControl( ::osl::ResettableMutexG DBG_UNHANDLED_EXCEPTION(); } // <<<<<<<< ----- UNSAFE ----- <<<<<<<< - _rInstanceLock.reset(); + _rInstanceLock.acquire(); setControlValue( translateExternalValueToControlValue( aExternalValue ), eExternalBinding ); } //------------------------------------------------------------------------------ -void OBoundControlModel::transferControlValueToExternal( ::osl::ResettableMutexGuard& _rInstanceLock ) +void OBoundControlModel::transferControlValueToExternal( ControlModelLock& _rInstanceLock ) { OSL_PRECOND( m_bSupportsExternalBinding && hasExternalValueBinding(), "OBoundControlModel::transferControlValueToExternal: precondition not met!" ); @@ -2652,7 +2809,7 @@ void OBoundControlModel::transferControlValueToExternal( ::osl::ResettableMutexG Any aExternalValue( translateControlValueToExternalValue() ); m_bTransferingValue = sal_True; - _rInstanceLock.clear(); + _rInstanceLock.release(); // >>>>>>>> ----- UNSAFE ----- >>>>>>>> try { @@ -2663,7 +2820,7 @@ void OBoundControlModel::transferControlValueToExternal( ::osl::ResettableMutexG DBG_UNHANDLED_EXCEPTION(); } // <<<<<<<< ----- UNSAFE ----- <<<<<<<< - _rInstanceLock.reset(); + _rInstanceLock.acquire(); m_bTransferingValue = sal_False; } diff --git a/forms/source/component/FormattedField.cxx b/forms/source/component/FormattedField.cxx index 00a8de08a5ef..bc0e952f1735 100644 --- a/forms/source/component/FormattedField.cxx +++ b/forms/source/component/FormattedField.cxx @@ -671,14 +671,14 @@ Reference OFormattedModel::calcFormFormatsSupplier() co Reference< XRowSet > xRowSet( xNextParentForm, UNO_QUERY ); Reference< XNumberFormatsSupplier > xSupplier; if (xRowSet.is()) - xSupplier = getNumberFormats(getConnection(xRowSet), sal_True, m_xServiceFactory); + xSupplier = getNumberFormats( getConnection(xRowSet), sal_True, getContext().getLegacyServiceFactory() ); return xSupplier; } //------------------------------------------------------------------------------ Reference< XNumberFormatsSupplier > OFormattedModel::calcDefaultFormatsSupplier() const { - return StandardFormatsSupplier::get( m_xServiceFactory ); + return StandardFormatsSupplier::get( getContext().getLegacyServiceFactory() ); } // XBoundComponent diff --git a/forms/source/component/FormsCollection.cxx b/forms/source/component/FormsCollection.cxx index 81419eca6c77..ff4e0185826c 100644 --- a/forms/source/component/FormsCollection.cxx +++ b/forms/source/component/FormsCollection.cxx @@ -46,6 +46,8 @@ using namespace ::com::sun::star::lang; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::form; using namespace ::com::sun::star::container; +using namespace ::com::sun::star::util; + //------------------------------------------------------------------ DBG_NAME(OFormsCollection) //------------------------------------------------------------------ @@ -74,12 +76,22 @@ Sequence SAL_CALL OFormsCollection::getTypes() throw(RuntimeException) //------------------------------------------------------------------ OFormsCollection::OFormsCollection(const Reference& _rxFactory) - :FormsCollectionComponentBase(m_aMutex) - ,OInterfaceContainer(_rxFactory, m_aMutex, ::getCppuType(static_cast*>(NULL))) + :FormsCollectionComponentBase( m_aMutex ) + ,OInterfaceContainer( _rxFactory, m_aMutex, XForm::static_type() ) + ,OFormsCollection_BASE() { DBG_CTOR(OFormsCollection, NULL); } +//------------------------------------------------------------------------------ +OFormsCollection::OFormsCollection( const OFormsCollection& _cloneSource ) + :FormsCollectionComponentBase( m_aMutex ) + ,OInterfaceContainer( m_aMutex, _cloneSource ) + ,OFormsCollection_BASE() +{ + DBG_CTOR( OFormsCollection, NULL ); +} + //------------------------------------------------------------------------------ OFormsCollection::~OFormsCollection() { @@ -134,6 +146,17 @@ StringSequence SAL_CALL OFormsCollection::getSupportedServiceNames() throw(Runti return aReturn; } +// XCloneable +//------------------------------------------------------------------------------ +Reference< XCloneable > SAL_CALL OFormsCollection::createClone( ) throw (RuntimeException) +{ + OFormsCollection* pClone = new OFormsCollection( *this ); + osl_incrementInterlockedCount( &pClone->m_refCount ); + pClone->clonedFrom( *this ); + osl_decrementInterlockedCount( &pClone->m_refCount ); + return pClone; +} + // OComponentHelper //------------------------------------------------------------------------------ void OFormsCollection::disposing() diff --git a/forms/source/component/FormsCollection.hxx b/forms/source/component/FormsCollection.hxx index c93256d399fd..0ef86327dc52 100644 --- a/forms/source/component/FormsCollection.hxx +++ b/forms/source/component/FormsCollection.hxx @@ -63,6 +63,7 @@ class OFormsCollection public: OFormsCollection(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); + OFormsCollection( const OFormsCollection& _cloneSource ); virtual ~OFormsCollection(); public: @@ -82,6 +83,9 @@ public: virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException); virtual StringSequence SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException); + // XCloneable + virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone( ) throw (::com::sun::star::uno::RuntimeException); + // OComponentHelper virtual void SAL_CALL disposing(); diff --git a/forms/source/component/Grid.cxx b/forms/source/component/Grid.cxx index 270fa2c9547e..9ca5a1b02ef3 100644 --- a/forms/source/component/Grid.cxx +++ b/forms/source/component/Grid.cxx @@ -99,6 +99,7 @@ OGridControlModel::OGridControlModel(const Reference& _rxF ,FontControlModel( false ) ,m_aSelectListeners(m_aMutex) ,m_aResetListeners(m_aMutex) + ,m_aRowSetChangeListeners(m_aMutex) ,m_aDefaultControl( FRM_SUN_CONTROL_GRIDCONTROL ) ,m_nBorder(1) ,m_nWritingMode( WritingMode2::CONTEXT ) @@ -123,6 +124,7 @@ OGridControlModel::OGridControlModel( const OGridControlModel* _pOriginal, const ,FontControlModel( _pOriginal ) ,m_aSelectListeners( m_aMutex ) ,m_aResetListeners( m_aMutex ) + ,m_aRowSetChangeListeners( m_aMutex ) { DBG_CTOR(OGridControlModel,NULL); @@ -157,7 +159,17 @@ OGridControlModel::~OGridControlModel() // XCloneable //------------------------------------------------------------------------------ -IMPLEMENT_DEFAULT_CLONING( OGridControlModel ) +Reference< XCloneable > SAL_CALL OGridControlModel::createClone( ) throw (RuntimeException) +{ + OGridControlModel* pClone = new OGridControlModel( this, getContext().getLegacyServiceFactory() ); + osl_incrementInterlockedCount( &pClone->m_refCount ); + pClone->OControlModel::clonedFrom( this ); + // do not call OInterfaceContainer::clonedFrom, it would clone the elements aka columns, which is + // already done in the ctor + //pClone->OInterfaceContainer::clonedFrom( *this ); + osl_decrementInterlockedCount( &pClone->m_refCount ); + return static_cast< XCloneable* >( static_cast< OControlModel* >( pClone ) ); +} //------------------------------------------------------------------------------ void OGridControlModel::cloneColumns( const OGridControlModel* _pOriginalContainer ) @@ -234,20 +246,47 @@ void SAL_CALL OGridControlModel::errorOccured( const SQLErrorEvent& _rEvent ) th onError( _rEvent ); } +// XRowSetSupplier +//------------------------------------------------------------------------------ +Reference< XRowSet > SAL_CALL OGridControlModel::getRowSet( ) throw (RuntimeException) +{ + return Reference< XRowSet >( getParent(), UNO_QUERY ); +} + +//------------------------------------------------------------------------------ +void SAL_CALL OGridControlModel::setRowSet( const Reference< XRowSet >& /*_rxDataSource*/ ) throw (RuntimeException) +{ + OSL_ENSURE( false, "OGridControlModel::setRowSet: not supported!" ); +} + +//-------------------------------------------------------------------- +void SAL_CALL OGridControlModel::addRowSetChangeListener( const Reference< XRowSetChangeListener >& i_Listener ) throw (RuntimeException) +{ + if ( i_Listener.is() ) + m_aRowSetChangeListeners.addInterface( i_Listener ); +} + +//-------------------------------------------------------------------- +void SAL_CALL OGridControlModel::removeRowSetChangeListener( const Reference< XRowSetChangeListener >& i_Listener ) throw (RuntimeException) +{ + m_aRowSetChangeListeners.removeInterface( i_Listener ); +} + // XChild //------------------------------------------------------------------------------ -void SAL_CALL OGridControlModel::setParent(const InterfaceRef& Parent) throw(NoSupportException, RuntimeException) +void SAL_CALL OGridControlModel::setParent( const InterfaceRef& i_Parent ) throw(NoSupportException, RuntimeException) { - if (m_xParentFormLoadable.is()) - m_xParentFormLoadable->removeLoadListener(this); + ::osl::ClearableMutexGuard aGuard( m_aMutex ); + if ( i_Parent == getParent() ) + return; - OControlModel::setParent(Parent); + OControlModel::setParent( i_Parent ); - Reference< XForm > xForm(m_xParent, UNO_QUERY); - m_xParentFormLoadable = Reference< XLoadable > (xForm, UNO_QUERY); - if (m_xParentFormLoadable.is()) - m_xParentFormLoadable->addLoadListener(this); + EventObject aEvent( *this ); + aGuard.clear(); + m_aRowSetChangeListeners.notifyEach( &XRowSetChangeListener::onRowSetChanged, aEvent ); } + //------------------------------------------------------------------------------ Sequence< Type > SAL_CALL OGridControlModel::getTypes( ) throw(RuntimeException) { @@ -274,6 +313,7 @@ void OGridControlModel::disposing() EventObject aEvt(static_cast(this)); m_aSelectListeners.disposeAndClear(aEvt); m_aResetListeners.disposeAndClear(aEvt); + m_aRowSetChangeListeners.disposeAndClear(aEvt); } // XEventListener @@ -288,6 +328,8 @@ void OGridControlModel::disposing(const EventObject& _rEvent) throw( RuntimeExce //----------------------------------------------------------------------------- sal_Bool SAL_CALL OGridControlModel::select(const Any& rElement) throw(IllegalArgumentException, RuntimeException) { + ::osl::ClearableMutexGuard aGuard( m_aMutex ); + Reference xSel; if (rElement.hasValue() && !::cppu::extractInterface(xSel, rElement)) { @@ -304,11 +346,11 @@ sal_Bool SAL_CALL OGridControlModel::select(const Any& rElement) throw(IllegalAr } } - if (xSel != m_xSelection) + if ( xSel != m_xSelection ) { m_xSelection = xSel; - EventObject aEvt(xMe); - m_aSelectListeners.notifyEach( &XSelectionChangeListener::selectionChanged, aEvt ); + aGuard.clear(); + m_aSelectListeners.notifyEach( &XSelectionChangeListener::selectionChanged, EventObject( *this ) ); return sal_True; } return sal_False; @@ -346,16 +388,16 @@ Reference OGridControlModel::createColumn(sal_Int32 nTypeId) cons Reference xReturn; switch (nTypeId) { - case TYPE_CHECKBOX: xReturn = new CheckBoxColumn(OControlModel::m_xServiceFactory); break; - case TYPE_COMBOBOX: xReturn = new ComboBoxColumn(OControlModel::m_xServiceFactory); break; - case TYPE_CURRENCYFIELD: xReturn = new CurrencyFieldColumn(OControlModel::m_xServiceFactory); break; - case TYPE_DATEFIELD: xReturn = new DateFieldColumn(OControlModel::m_xServiceFactory); break; - case TYPE_LISTBOX: xReturn = new ListBoxColumn(OControlModel::m_xServiceFactory); break; - case TYPE_NUMERICFIELD: xReturn = new NumericFieldColumn(OControlModel::m_xServiceFactory); break; - case TYPE_PATTERNFIELD: xReturn = new PatternFieldColumn(OControlModel::m_xServiceFactory); break; - case TYPE_TEXTFIELD: xReturn = new TextFieldColumn(OControlModel::m_xServiceFactory); break; - case TYPE_TIMEFIELD: xReturn = new TimeFieldColumn(OControlModel::m_xServiceFactory); break; - case TYPE_FORMATTEDFIELD: xReturn = new FormattedFieldColumn(OControlModel::m_xServiceFactory); break; + case TYPE_CHECKBOX: xReturn = new CheckBoxColumn( getContext() ); break; + case TYPE_COMBOBOX: xReturn = new ComboBoxColumn( getContext() ); break; + case TYPE_CURRENCYFIELD: xReturn = new CurrencyFieldColumn( getContext() ); break; + case TYPE_DATEFIELD: xReturn = new DateFieldColumn( getContext() ); break; + case TYPE_LISTBOX: xReturn = new ListBoxColumn( getContext() ); break; + case TYPE_NUMERICFIELD: xReturn = new NumericFieldColumn( getContext() ); break; + case TYPE_PATTERNFIELD: xReturn = new PatternFieldColumn( getContext() ); break; + case TYPE_TEXTFIELD: xReturn = new TextFieldColumn( getContext() ); break; + case TYPE_TIMEFIELD: xReturn = new TimeFieldColumn( getContext() ); break; + case TYPE_FORMATTEDFIELD: xReturn = new FormattedFieldColumn( getContext() ); break; default: DBG_ERROR("OGridControlModel::createColumn: Unknown Column"); break; @@ -735,72 +777,6 @@ Any OGridControlModel::getPropertyDefaultByHandle( sal_Int32 nHandle ) const return aReturn; } -// XLoadListener -//------------------------------------------------------------------------------ -void SAL_CALL OGridControlModel::loaded(const EventObject& rEvent) throw(RuntimeException) -{ - Reference xListener; - sal_Int32 nCount = getCount(); - for (sal_Int32 nIndex=0; nIndex < nCount; ++nIndex) - { - getByIndex(nIndex) >>= xListener; - if (xListener.is()) - xListener->loaded(rEvent); - } -} - -//------------------------------------------------------------------------------ -void SAL_CALL OGridControlModel::unloaded(const EventObject& rEvent) throw(RuntimeException) -{ - Reference xListener; - sal_Int32 nCount = getCount(); - for (sal_Int32 nIndex=0; nIndex < nCount; nIndex++) - { - getByIndex(nIndex) >>= xListener; - if (xListener.is()) - xListener->unloaded(rEvent); - } -} - -//------------------------------------------------------------------------------ -void SAL_CALL OGridControlModel::reloading(const EventObject& rEvent) throw(RuntimeException) -{ - Reference xListener; - sal_Int32 nCount = getCount(); - for (sal_Int32 nIndex=0; nIndex < nCount; nIndex++) - { - getByIndex(nIndex) >>= xListener; - if (xListener.is()) - xListener->reloading(rEvent); - } -} - -//------------------------------------------------------------------------------ -void SAL_CALL OGridControlModel::unloading(const EventObject& rEvent) throw(RuntimeException) -{ - Reference xListener; - sal_Int32 nCount = getCount(); - for (sal_Int32 nIndex=0; nIndex < nCount; nIndex++) - { - getByIndex(nIndex) >>= xListener; - if (xListener.is()) - xListener->unloading(rEvent); - } -} - -//------------------------------------------------------------------------------ -void SAL_CALL OGridControlModel::reloaded(const EventObject& rEvent) throw(RuntimeException) -{ - Reference xListener; - sal_Int32 nCount = getCount(); - for (sal_Int32 nIndex=0; nIndex < nCount; nIndex++) - { - getByIndex(nIndex) >>= xListener; - if (xListener.is()) - xListener->reloaded(rEvent); - } -} - //------------------------------------------------------------------------------ OGridColumn* OGridControlModel::getColumnImplementation(const InterfaceRef& _rxIFace) const { @@ -813,42 +789,32 @@ OGridColumn* OGridControlModel::getColumnImplementation(const InterfaceRef& _rxI } //------------------------------------------------------------------------------ -void OGridControlModel::gotColumn(const Reference< XInterface >& _rxColumn) +void OGridControlModel::gotColumn( const Reference< XInterface >& _rxColumn ) { - // if our form is already loaded, tell the column - // 18.05.2001 - 86558 - frank.schoenheit@germany.sun.com - if (m_xParentFormLoadable.is() && m_xParentFormLoadable->isLoaded()) - { - Reference< XLoadListener > xColumnLoadListener(_rxColumn, UNO_QUERY); - if (xColumnLoadListener.is()) - { // it's kind of a fake ... - EventObject aFakedLoadEvent; - aFakedLoadEvent.Source = m_xParentFormLoadable; - xColumnLoadListener->loaded(aFakedLoadEvent); - } - } + Reference< XSQLErrorBroadcaster > xBroadcaster( _rxColumn, UNO_QUERY ); + if ( xBroadcaster.is() ) + xBroadcaster->addSQLErrorListener( this ); } //------------------------------------------------------------------------------ void OGridControlModel::lostColumn(const Reference< XInterface >& _rxColumn) { - if (Reference(m_xSelection, UNO_QUERY).get() == Reference(_rxColumn, UNO_QUERY).get()) + if ( m_xSelection == _rxColumn ) { // the currently selected element was replaced m_xSelection.clear(); - EventObject aEvt(static_cast(this)); + EventObject aEvt( static_cast< XWeak* >( this ) ); m_aSelectListeners.notifyEach( &XSelectionChangeListener::selectionChanged, aEvt ); } + + Reference< XSQLErrorBroadcaster > xBroadcaster( _rxColumn, UNO_QUERY ); + if ( xBroadcaster.is() ) + xBroadcaster->removeSQLErrorListener( this ); } //------------------------------------------------------------------------------ void OGridControlModel::implRemoved(const InterfaceRef& _rxObject) { OInterfaceContainer::implRemoved(_rxObject); - - Reference< XSQLErrorBroadcaster > xBroadcaster( _rxObject, UNO_QUERY ); - if ( xBroadcaster.is() ) - xBroadcaster->removeSQLErrorListener( this ); - lostColumn(_rxObject); } @@ -856,20 +822,30 @@ void OGridControlModel::implRemoved(const InterfaceRef& _rxObject) void OGridControlModel::implInserted( const ElementDescription* _pElement ) { OInterfaceContainer::implInserted( _pElement ); - - Reference< XSQLErrorBroadcaster > xBroadcaster( _pElement->xInterface, UNO_QUERY ); - if ( xBroadcaster.is() ) - xBroadcaster->addSQLErrorListener( this ); - gotColumn( _pElement->xInterface ); } //------------------------------------------------------------------------------ -void OGridControlModel::implReplaced( const InterfaceRef& _rxReplacedObject, const ElementDescription* _pElement ) +void OGridControlModel::impl_replacedElement( const ContainerEvent& _rEvent, ::osl::ClearableMutexGuard& _rInstanceLock ) { - OInterfaceContainer::implReplaced( _rxReplacedObject, _pElement ); - lostColumn( _rxReplacedObject ); - gotColumn( _pElement->xInterface ); + Reference< XInterface > xOldColumn( _rEvent.ReplacedElement, UNO_QUERY ); + Reference< XInterface > xNewColumn( _rEvent.Element, UNO_QUERY ); + + bool bNewSelection = ( xOldColumn == m_xSelection ); + + lostColumn( xOldColumn ); + gotColumn( xNewColumn ); + + if ( bNewSelection ) + m_xSelection.set( xNewColumn, UNO_QUERY ); + + OInterfaceContainer::impl_replacedElement( _rEvent, _rInstanceLock ); + // <<---- SYNCHRONIZED + + if ( bNewSelection ) + { + m_aSelectListeners.notifyEach( &XSelectionChangeListener::selectionChanged, EventObject( *this ) ); + } } //------------------------------------------------------------------------------ diff --git a/forms/source/component/Grid.hxx b/forms/source/component/Grid.hxx index 716f1a4ca739..56981f54349b 100644 --- a/forms/source/component/Grid.hxx +++ b/forms/source/component/Grid.hxx @@ -28,16 +28,22 @@ * ************************************************************************/ -#include "FormComponent.hxx" -#include -#include -#include -#include -#include "InterfaceContainer.hxx" -#include -#include -#include "errorbroadcaster.hxx" -#include "formcontrolfont.hxx" +#include "errorbroadcaster.hxx" +#include "FormComponent.hxx" +#include "formcontrolfont.hxx" +#include "InterfaceContainer.hxx" + +/** === begin UNO includes === **/ +#include +#include +#include +#include +#include +/** === end UNO includes === **/ + +#include +#include +#include //......................................................................... namespace frm @@ -59,12 +65,13 @@ class OGridColumn; //================================================================== // OGridControlModel //================================================================== -typedef ::cppu::ImplHelper6 < ::com::sun::star::awt::XControlModel +typedef ::cppu::ImplHelper7 < ::com::sun::star::awt::XControlModel , ::com::sun::star::form::XGridColumnFactory - , ::com::sun::star::form::XLoadListener , ::com::sun::star::form::XReset , ::com::sun::star::view::XSelectionSupplier , ::com::sun::star::sdb::XSQLErrorListener + , ::com::sun::star::sdb::XRowSetSupplier + , ::com::sun::star::sdb::XRowSetChangeBroadcaster > OGridControlModel_BASE; class OGridControlModel :public OControlModel @@ -74,7 +81,8 @@ class OGridControlModel :public OControlModel ,public OGridControlModel_BASE { ::cppu::OInterfaceContainerHelper m_aSelectListeners, - m_aResetListeners; + m_aResetListeners, + m_aRowSetChangeListeners; // [properties] ::com::sun::star::uno::Any m_aRowHeight; // Zeilenhoehe @@ -87,7 +95,6 @@ class OGridControlModel :public OControlModel // [properties] ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xSelection; - ::com::sun::star::uno::Reference< ::com::sun::star::form::XLoadable > m_xParentFormLoadable; // [properties] ::rtl::OUString m_sHelpURL; // URL @@ -128,13 +135,6 @@ public: // XEventListener virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& _rSource) throw(::com::sun::star::uno::RuntimeException); - // XLoadListener - virtual void SAL_CALL loaded(const ::com::sun::star::lang::EventObject& aEvent) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL unloaded(const ::com::sun::star::lang::EventObject& aEvent) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL unloading(const ::com::sun::star::lang::EventObject& aEvent) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL reloading(const ::com::sun::star::lang::EventObject& aEvent) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL reloaded(const ::com::sun::star::lang::EventObject& aEvent) throw(::com::sun::star::uno::RuntimeException); - // XReset virtual void SAL_CALL reset() throw ( ::com::sun::star::uno::RuntimeException); virtual void SAL_CALL addResetListener(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XResetListener>& _rxListener) throw ( ::com::sun::star::uno::RuntimeException); @@ -168,6 +168,14 @@ public: // XSQLErrorListener virtual void SAL_CALL errorOccured( const ::com::sun::star::sdb::SQLErrorEvent& _rEvent ) throw (::com::sun::star::uno::RuntimeException); + // XRowSetSupplier + virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet > SAL_CALL getRowSet( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setRowSet( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet >& xDataSource ) throw (::com::sun::star::uno::RuntimeException); + + // XRowSetChangeBroadcaster + virtual void SAL_CALL addRowSetChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XRowSetChangeListener >& i_Listener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeRowSetChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XRowSetChangeListener >& i_Listener ) throw (::com::sun::star::uno::RuntimeException); + // OControlModel's property handling virtual void describeFixedProperties( ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps @@ -195,7 +203,10 @@ protected: protected: virtual void implRemoved(const InterfaceRef& _rxObject); virtual void implInserted( const ElementDescription* _pElement ); - virtual void implReplaced( const InterfaceRef& _rxReplacedObject, const ElementDescription* _pElement ); + virtual void impl_replacedElement( + const ::com::sun::star::container::ContainerEvent& _rEvent, + ::osl::ClearableMutexGuard& _rInstanceLock + ); void gotColumn(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxColumn); void lostColumn(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxColumn); diff --git a/forms/source/component/ImageControl.cxx b/forms/source/component/ImageControl.cxx index 6376f0401a6e..5d30c2776659 100644 --- a/forms/source/component/ImageControl.cxx +++ b/forms/source/component/ImageControl.cxx @@ -378,7 +378,7 @@ sal_Bool OImageControlModel::impl_updateStreamForURL_lck( const ::rtl::OUString& if ( ::svt::GraphicAccess::isSupportedURL( _rURL ) ) { - xImageStream = ::svt::GraphicAccess::getImageXStream( getORB(), _rURL ); + xImageStream = ::svt::GraphicAccess::getImageXStream( getContext().getLegacyServiceFactory(), _rURL ); } else { @@ -591,7 +591,7 @@ void OImageControlModel::doSetControlValue( const Any& _rValue ) // OComponentHelper //------------------------------------------------------------------ -void OImageControlModel::disposing() +void SAL_CALL OImageControlModel::disposing() { OBoundControlModel::disposing(); @@ -646,25 +646,16 @@ InterfaceRef SAL_CALL OImageControlControl_CreateInstance(const Reference OImageControlControl::_getTypes() { - static Sequence aTypes; - if (!aTypes.getLength()) - { - // my base class - Sequence aBaseClassTypes = OBoundControl::_getTypes(); - - Sequence aOwnTypes(1); - Type* pOwnTypes = aOwnTypes.getArray(); - pOwnTypes[0] = getCppuType((Reference*)NULL); - - aTypes = concatSequences(aBaseClassTypes, aOwnTypes); - } - return aTypes; + return concatSequences( + OBoundControl::_getTypes(), + OImageControlControl_Base::getTypes() + ); } //------------------------------------------------------------------------------ OImageControlControl::OImageControlControl(const Reference& _rxFactory) :OBoundControl(_rxFactory, VCL_CONTROL_IMAGECONTROL) - ,m_pImageIndicator( new OImageIndicator ) + ,m_aModifyListeners( m_aMutex ) { increment(m_refCount); { @@ -677,14 +668,15 @@ OImageControlControl::OImageControlControl(const Reference decrement(m_refCount); } -// UNO Anbindung //------------------------------------------------------------------------------ Any SAL_CALL OImageControlControl::queryAggregation(const Type& _rType) throw (RuntimeException) { - Any aReturn = OBoundControl::queryAggregation(_rType); - if (!aReturn.hasValue()) - aReturn = ::cppu::queryInterface(_rType - ,static_cast(this) + Any aReturn = OBoundControl::queryAggregation( _rType ); + if ( !aReturn.hasValue() ) + aReturn = ::cppu::queryInterface( + _rType, + static_cast< XMouseListener* >( this ), + static_cast< XModifyBroadcaster* >( this ) ); return aReturn; @@ -701,23 +693,31 @@ StringSequence OImageControlControl::getSupportedServiceNames() throw() return aSupported; } -//-------------------------------------------------------------------- -sal_Bool SAL_CALL OImageControlControl::setModel(const Reference& _rxModel ) throw (RuntimeException) +//------------------------------------------------------------------------------ +void SAL_CALL OImageControlControl::addModifyListener( const Reference< XModifyListener >& _Listener ) throw (RuntimeException) { - Reference< XImageProducer > xProducer( getModel(), UNO_QUERY ); - if ( xProducer.is() ) - xProducer->removeConsumer( m_pImageIndicator.getRef() ); + m_aModifyListeners.addInterface( _Listener ); +} - sal_Bool bReturn = OBoundControl::setModel( _rxModel ); +//------------------------------------------------------------------------------ +void SAL_CALL OImageControlControl::removeModifyListener( const Reference< XModifyListener >& _Listener ) throw (RuntimeException) +{ + m_aModifyListeners.removeInterface( _Listener ); +} - xProducer = xProducer.query( getModel() ); - if ( xProducer.is() ) - { - m_pImageIndicator->reset(); - xProducer->addConsumer( m_pImageIndicator.getRef() ); - } +//------------------------------------------------------------------------------ +void SAL_CALL OImageControlControl::disposing() +{ + EventObject aEvent( *this ); + m_aModifyListeners.disposeAndClear( aEvent ); - return bReturn; + OBoundControl::disposing(); +} + +//------------------------------------------------------------------------------ +void SAL_CALL OImageControlControl::disposing( const EventObject& _Event ) throw(RuntimeException) +{ + OBoundControl::disposing( _Event ); } //------------------------------------------------------------------------------ @@ -744,11 +744,11 @@ void OImageControlControl::implClearGraphics( sal_Bool _bForce ) } //------------------------------------------------------------------------------ -void OImageControlControl::implInsertGraphics() +bool OImageControlControl::implInsertGraphics() { Reference< XPropertySet > xSet( getModel(), UNO_QUERY ); if ( !xSet.is() ) - return; + return false; ::rtl::OUString sTitle = FRM_RES_STRING(RID_STR_IMPORT_GRAPHIC); // build some arguments for the upcoming dialog @@ -757,30 +757,26 @@ void OImageControlControl::implInsertGraphics() ::sfx2::FileDialogHelper aDialog( TemplateDescription::FILEOPEN_LINK_PREVIEW, SFXWB_GRAPHIC ); aDialog.SetTitle( sTitle ); - Reference< XFilePickerControlAccess > xController(aDialog.GetFilePicker(), UNO_QUERY); - DBG_ASSERT( xController.is(), "OImageControlControl::implInsertGraphics: invalid file picker!" ); - if ( xController.is() ) - { - xController->setValue(ExtendedFilePickerElementIds::CHECKBOX_PREVIEW, 0, ::cppu::bool2any(sal_True)); + Reference< XFilePickerControlAccess > xController( aDialog.GetFilePicker(), UNO_QUERY_THROW ); + xController->setValue(ExtendedFilePickerElementIds::CHECKBOX_PREVIEW, 0, ::cppu::bool2any(sal_True)); - Reference xBoundField; - if ( hasProperty( PROPERTY_BOUNDFIELD, xSet ) ) - xSet->getPropertyValue( PROPERTY_BOUNDFIELD ) >>= xBoundField; - sal_Bool bHasField = xBoundField.is(); + Reference xBoundField; + if ( hasProperty( PROPERTY_BOUNDFIELD, xSet ) ) + xSet->getPropertyValue( PROPERTY_BOUNDFIELD ) >>= xBoundField; + sal_Bool bHasField = xBoundField.is(); - // if the control is bound to a DB field, then it's not possible to decide whether or not to link - xController->enableControl(ExtendedFilePickerElementIds::CHECKBOX_LINK, !bHasField ); + // if the control is bound to a DB field, then it's not possible to decide whether or not to link + xController->enableControl(ExtendedFilePickerElementIds::CHECKBOX_LINK, !bHasField ); - // if the control is bound to a DB field, then linking of the image depends on the type of the field - sal_Bool bImageIsLinked = sal_True; - if ( bHasField ) - { - sal_Int32 nFieldType = DataType::OTHER; - OSL_VERIFY( xBoundField->getPropertyValue( PROPERTY_FIELDTYPE ) >>= nFieldType ); - bImageIsLinked = ( lcl_getImageStoreType( nFieldType ) == ImageStoreLink ); - } - xController->setValue(ExtendedFilePickerElementIds::CHECKBOX_LINK, 0, makeAny( bImageIsLinked ) ); + // if the control is bound to a DB field, then linking of the image depends on the type of the field + sal_Bool bImageIsLinked = sal_True; + if ( bHasField ) + { + sal_Int32 nFieldType = DataType::OTHER; + OSL_VERIFY( xBoundField->getPropertyValue( PROPERTY_FIELDTYPE ) >>= nFieldType ); + bImageIsLinked = ( lcl_getImageStoreType( nFieldType ) == ImageStoreLink ); } + xController->setValue(ExtendedFilePickerElementIds::CHECKBOX_LINK, 0, makeAny( bImageIsLinked ) ); if ( ERRCODE_NONE == aDialog.Execute() ) { @@ -802,12 +798,15 @@ void OImageControlControl::implInsertGraphics() } else xSet->setPropertyValue( PROPERTY_IMAGE_URL, makeAny( ::rtl::OUString( aDialog.GetPath() ) ) ); + + return true; } } catch(Exception&) { DBG_ERROR("OImageControlControl::implInsertGraphics: caught an exception while attempting to execute the FilePicker!"); } + return false; } //------------------------------------------------------------------------------ @@ -839,10 +838,11 @@ void OImageControlControl::mousePressed(const ::com::sun::star::awt::MouseEvent& if (e.Buttons != MouseButton::LEFT) return; + bool bModified = false; // is this a request for a context menu? if ( e.PopupTrigger ) { - Reference< XPopupMenu > xMenu( m_xServiceFactory->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.awt.PopupMenu" ) ), UNO_QUERY ); + Reference< XPopupMenu > xMenu( m_aContext.createComponent( "com.sun.star.awt.PopupMenu" ), UNO_QUERY ); DBG_ASSERT( xMenu.is(), "OImageControlControl::mousePressed: could not create a popup menu!" ); Reference< XWindowPeer > xWindowPeer = getPeer(); @@ -878,10 +878,12 @@ void OImageControlControl::mousePressed(const ::com::sun::star::awt::MouseEvent& { case ID_OPEN_GRAPHICS: implInsertGraphics(); + bModified = true; break; case ID_CLEAR_GRAPHICS: implClearGraphics( sal_True ); + bModified = true; break; } } @@ -916,9 +918,16 @@ void OImageControlControl::mousePressed(const ::com::sun::star::awt::MouseEvent& if (bReadOnly) return; - implInsertGraphics(); + if ( implInsertGraphics() ) + bModified = true; } } + + if ( bModified ) + { + EventObject aEvent( *this ); + m_aModifyListeners.notifyEach( &XModifyListener::modified, aEvent ); + } } //------------------------------------------------------------------------------ @@ -936,62 +945,6 @@ void SAL_CALL OImageControlControl::mouseExited(const awt::MouseEvent& /*e*/) th { } - -//============================================================================== -//= OImageIndicator -//============================================================================== -DBG_NAME( OImageIndicator ) -//------------------------------------------------------------------------------ -OImageIndicator::OImageIndicator( ) - :m_bIsProducing( sal_False ) - ,m_bIsEmptyImage( sal_True ) -{ - DBG_CTOR( OImageIndicator, NULL ); -} - -//------------------------------------------------------------------------------ -OImageIndicator::~OImageIndicator( ) -{ - DBG_DTOR( OImageIndicator, NULL ); -} - -//-------------------------------------------------------------------- -void OImageIndicator::reset() -{ - OSL_ENSURE( !m_bIsProducing, "OImageIndicator::reset: sure you know what you're doing? The producer is currently producing!" ); - m_bIsProducing = sal_True; -} - -//-------------------------------------------------------------------- -void SAL_CALL OImageIndicator::init( sal_Int32 /*Width*/, sal_Int32 /*Height*/ ) throw (RuntimeException) -{ - m_bIsProducing = sal_True; - m_bIsEmptyImage = sal_True; -} - -//-------------------------------------------------------------------- -void SAL_CALL OImageIndicator::setColorModel( sal_Int16 /*BitCount*/, const Sequence< sal_Int32 >& /*RGBAPal*/, sal_Int32 /*RedMask*/, sal_Int32 /*GreenMask*/, sal_Int32 /*BlueMask*/, sal_Int32 /*AlphaMask*/ ) throw (RuntimeException) -{ -} - -//-------------------------------------------------------------------- -void SAL_CALL OImageIndicator::setPixelsByBytes( sal_Int32 /*nX*/, sal_Int32 /*nY*/, sal_Int32 /*nWidth*/, sal_Int32 /*nHeight*/, const Sequence< sal_Int8 >& /*aProducerData*/, sal_Int32 /*nOffset*/, sal_Int32 /*nScanSize*/ ) throw (RuntimeException) -{ - m_bIsEmptyImage = sal_False; -} - -//-------------------------------------------------------------------- -void SAL_CALL OImageIndicator::setPixelsByLongs( sal_Int32 /*nX*/, sal_Int32 /*nY*/, sal_Int32 /*nWidth*/, sal_Int32 /*nHeight*/, const Sequence< sal_Int32 >& /*aProducerData*/, sal_Int32 /*nOffset*/, sal_Int32 /*nScanSize*/ ) throw (RuntimeException) -{ - m_bIsEmptyImage = sal_False; -} - -//-------------------------------------------------------------------- -void SAL_CALL OImageIndicator::complete( sal_Int32 /*Status*/, const Reference< XImageProducer >& /*xProducer*/ ) throw (RuntimeException) -{ - m_bIsProducing = sal_False; -} - //......................................................................... } // namespace frm //......................................................................... diff --git a/forms/source/component/ImageControl.hxx b/forms/source/component/ImageControl.hxx index 9c43484006c3..49ae9ff81964 100644 --- a/forms/source/component/ImageControl.hxx +++ b/forms/source/component/ImageControl.hxx @@ -35,6 +35,7 @@ #include "imgprod.hxx" #include #include +#include #include #include #include @@ -144,50 +145,18 @@ protected: sal_Bool impl_updateStreamForURL_lck( const ::rtl::OUString& _rURL, ValueChangeInstigator _eInstigator ); }; -//================================================================== -//= OImageIndicator (helper class for OImageControlControl) -//================================================================== -typedef ::cppu::WeakImplHelper1 < ::com::sun::star::awt::XImageConsumer - > OImageIndicator_Base; - -class OImageIndicator : public OImageIndicator_Base -{ -private: - sal_Bool m_bIsProducing : 1; - sal_Bool m_bIsEmptyImage : 1; - -public: - OImageIndicator( ); - - void reset(); - inline sal_Bool isEmptyImage() const { return m_bIsEmptyImage; } - -protected: - ~OImageIndicator( ); - // XImageProducer - virtual void SAL_CALL init( sal_Int32 Width, sal_Int32 Height ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setColorModel( sal_Int16 BitCount, const ::com::sun::star::uno::Sequence< sal_Int32 >& RGBAPal, sal_Int32 RedMask, sal_Int32 GreenMask, sal_Int32 BlueMask, sal_Int32 AlphaMask ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setPixelsByBytes( sal_Int32 nX, sal_Int32 nY, sal_Int32 nWidth, sal_Int32 nHeight, const ::com::sun::star::uno::Sequence< sal_Int8 >& aProducerData, sal_Int32 nOffset, sal_Int32 nScanSize ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setPixelsByLongs( sal_Int32 nX, sal_Int32 nY, sal_Int32 nWidth, sal_Int32 nHeight, const ::com::sun::star::uno::Sequence< sal_Int32 >& aProducerData, sal_Int32 nOffset, sal_Int32 nScanSize ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL complete( sal_Int32 Status, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XImageProducer >& xProducer ) throw (::com::sun::star::uno::RuntimeException); - -private: - OImageIndicator( const OImageIndicator& ); // never implemented - OImageIndicator& operator=( const OImageIndicator& ); // never implemented -}; - //================================================================== //= OImageControlControl //================================================================== -class OImageControlControl :public ::com::sun::star::awt::XMouseListener - ,public OBoundControl +typedef ::cppu::ImplHelper2 < ::com::sun::star::awt::XMouseListener + , ::com::sun::star::util::XModifyBroadcaster + > OImageControlControl_Base; +class OImageControlControl : public OBoundControl + , public OImageControlControl_Base { private: - typedef ::comphelper::ImplementationReference< OImageIndicator, ::com::sun::star::awt::XImageConsumer > - ImageIndicatorReference; - ImageIndicatorReference m_pImageIndicator; + ::cppu::OInterfaceContainerHelper m_aModifyListeners; -protected: // XTypeProvider virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes(); @@ -195,12 +164,11 @@ public: OImageControlControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); // UNO - DECLARE_UNO3_AGG_DEFAULTS(OImageControlControl, OBoundControl); - virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation(const ::com::sun::star::uno::Type& _rType) throw(::com::sun::star::uno::RuntimeException); + DECLARE_UNO3_AGG_DEFAULTS( OImageControlControl, OBoundControl ); + virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw(::com::sun::star::uno::RuntimeException); // XEventListener - virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& _rSource) throw(::com::sun::star::uno::RuntimeException) - { OBoundControl::disposing(_rSource); } + virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& _rSource) throw(::com::sun::star::uno::RuntimeException); // XServiceInfo IMPLEMENTATION_NAME(OImageControlControl); @@ -212,15 +180,16 @@ public: virtual void SAL_CALL mouseEntered(const ::com::sun::star::awt::MouseEvent& e) throw ( ::com::sun::star::uno::RuntimeException); virtual void SAL_CALL mouseExited(const ::com::sun::star::awt::MouseEvent& e) throw ( ::com::sun::star::uno::RuntimeException); - // XControl - virtual sal_Bool SAL_CALL setModel(const ::com::sun::star::uno::Reference& _rxModel ) throw (::com::sun::star::uno::RuntimeException); + // XModifyBroadcaster + virtual void SAL_CALL addModifyListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeModifyListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener ) throw (::com::sun::star::uno::RuntimeException); - // prevent method hiding - using OBoundControl::disposing; + // OComponentHelper + virtual void SAL_CALL disposing(); private: void implClearGraphics( sal_Bool _bForce ); - void implInsertGraphics(); + bool implInsertGraphics(); /** determines whether the control does currently have an empty grahic set */ diff --git a/forms/source/component/ListBox.cxx b/forms/source/component/ListBox.cxx index a2de412fa3a4..f7bc39fa1b89 100644 --- a/forms/source/component/ListBox.cxx +++ b/forms/source/component/ListBox.cxx @@ -124,7 +124,7 @@ namespace frm OListBoxModel::OListBoxModel(const Reference& _rxFactory) :OBoundControlModel( _rxFactory, VCL_CONTROLMODEL_LISTBOX, FRM_SUN_CONTROL_LISTBOX, sal_True, sal_True, sal_True ) // use the old control name for compytibility reasons - ,OEntryListHelper( m_aMutex ) + ,OEntryListHelper( (OControlModel&)*this ) ,OErrorBroadcaster( OComponentHelper::rBHelper ) ,m_aListRowSet( getContext() ) ,m_nNULLPos(-1) @@ -141,7 +141,7 @@ namespace frm //------------------------------------------------------------------ OListBoxModel::OListBoxModel( const OListBoxModel* _pOriginal, const Reference& _rxFactory ) :OBoundControlModel( _pOriginal, _rxFactory ) - ,OEntryListHelper( *_pOriginal, m_aMutex ) + ,OEntryListHelper( *_pOriginal, (OControlModel&)*this ) ,OErrorBroadcaster( OComponentHelper::rBHelper ) ,m_aListRowSet( getContext() ) ,m_eListSourceType( _pOriginal->m_eListSourceType ) @@ -297,8 +297,8 @@ namespace frm case PROPERTY_ID_STRINGITEMLIST: { - ::osl::ResettableMutexGuard aGuard( m_aMutex ); - setNewStringItemList( _rValue, aGuard ); + ControlModelLock aLock( *this ); + setNewStringItemList( _rValue, aLock ); // TODO: this is bogus. setNewStringItemList expects a guard which has the *only* // lock to the mutex, but setFastPropertyValue_NoBroadcast is already called with // a lock - so we effectively has two locks here, of which setNewStringItemList can @@ -459,7 +459,7 @@ namespace frm // Deshalb muessen sie explizit ueber setPropertyValue() gesetzt werden. OBoundControlModel::read(_rxInStream); - ::osl::ResettableMutexGuard aGuard(m_aMutex); + ControlModelLock aLock( *this ); // since we are "overwriting" the StringItemList of our aggregate (means we have // an own place to store the value, instead of relying on our aggregate storing it), @@ -467,7 +467,7 @@ namespace frm try { if ( m_xAggregateSet.is() ) - setNewStringItemList( m_xAggregateSet->getPropertyValue( PROPERTY_STRINGITEMLIST ), aGuard ); + setNewStringItemList( m_xAggregateSet->getPropertyValue( PROPERTY_STRINGITEMLIST ), aLock ); } catch( const Exception& ) { @@ -1329,7 +1329,7 @@ namespace frm } //-------------------------------------------------------------------- - void OListBoxModel::stringItemListChanged( ::osl::ResettableMutexGuard& _rInstanceLock ) + void OListBoxModel::stringItemListChanged( ControlModelLock& _rInstanceLock ) { if ( !m_xAggregateSet.is() ) return; diff --git a/forms/source/component/ListBox.hxx b/forms/source/component/ListBox.hxx index 16fe8cd4482b..9aeca0e851e2 100644 --- a/forms/source/component/ListBox.hxx +++ b/forms/source/component/ListBox.hxx @@ -164,7 +164,7 @@ protected: getCurrentFormComponentValue() const; // OEntryListHelper overriables - virtual void stringItemListChanged( ::osl::ResettableMutexGuard& _rInstanceLock ); + virtual void stringItemListChanged( ControlModelLock& _rInstanceLock ); virtual void connectedExternalListSource( ); virtual void disconnectedExternalListSource( ); virtual void refreshInternalEntryList(); diff --git a/forms/source/component/entrylisthelper.cxx b/forms/source/component/entrylisthelper.cxx index 81a9346ae6e7..3d7217cc162c 100644 --- a/forms/source/component/entrylisthelper.cxx +++ b/forms/source/component/entrylisthelper.cxx @@ -31,6 +31,8 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_forms.hxx" #include "entrylisthelper.hxx" +#include "FormComponent.hxx" + #include #include #include @@ -50,18 +52,18 @@ namespace frm //= OEntryListHelper //===================================================================== //--------------------------------------------------------------------- - OEntryListHelper::OEntryListHelper( ::osl::Mutex& _rMutex ) - :m_rMutex( _rMutex ) - ,m_aRefreshListeners( _rMutex ) + OEntryListHelper::OEntryListHelper( OControlModel& _rControlModel ) + :m_rControlModel( _rControlModel ) + ,m_aRefreshListeners( _rControlModel.getInstanceMutex() ) { } //--------------------------------------------------------------------- - OEntryListHelper::OEntryListHelper( const OEntryListHelper& _rSource, ::osl::Mutex& _rMutex ) - :m_rMutex( _rMutex ) + OEntryListHelper::OEntryListHelper( const OEntryListHelper& _rSource, OControlModel& _rControlModel ) + :m_rControlModel( _rControlModel ) ,m_xListSource ( _rSource.m_xListSource ) ,m_aStringItems( _rSource.m_aStringItems ) - ,m_aRefreshListeners( _rMutex ) + ,m_aRefreshListeners( _rControlModel.getInstanceMutex() ) { } @@ -73,14 +75,14 @@ namespace frm //--------------------------------------------------------------------- void SAL_CALL OEntryListHelper::setListEntrySource( const Reference< XListEntrySource >& _rxSource ) throw (RuntimeException) { - ::osl::ResettableMutexGuard aGuard( m_rMutex ); + ControlModelLock aLock( m_rControlModel ); // disconnect from the current external list source disconnectExternalListSource(); // and connect to the new one if ( _rxSource.is() ) - connectExternalListSource( _rxSource, aGuard ); + connectExternalListSource( _rxSource, aLock ); } //--------------------------------------------------------------------- @@ -93,7 +95,8 @@ namespace frm //--------------------------------------------------------------------- void SAL_CALL OEntryListHelper::entryChanged( const ListEntryEvent& _rEvent ) throw (RuntimeException) { - ::osl::ResettableMutexGuard aGuard( m_rMutex ); + ControlModelLock aLock( m_rControlModel ); + OSL_ENSURE( _rEvent.Source == m_xListSource, "OEntryListHelper::entryChanged: where did this come from?" ); OSL_ENSURE( ( _rEvent.Position >= 0 ) && ( _rEvent.Position < m_aStringItems.getLength() ), @@ -107,14 +110,15 @@ namespace frm ) { m_aStringItems[ _rEvent.Position ] = _rEvent.Entries[ 0 ]; - stringItemListChanged( aGuard ); + stringItemListChanged( aLock ); } } //--------------------------------------------------------------------- void SAL_CALL OEntryListHelper::entryRangeInserted( const ListEntryEvent& _rEvent ) throw (RuntimeException) { - ::osl::ResettableMutexGuard aGuard( m_rMutex ); + ControlModelLock aLock( m_rControlModel ); + OSL_ENSURE( _rEvent.Source == m_xListSource, "OEntryListHelper::entryRangeInserted: where did this come from?" ); OSL_ENSURE( ( _rEvent.Position > 0 ) && ( _rEvent.Position < m_aStringItems.getLength() ) && ( _rEvent.Entries.getLength() > 0 ), @@ -143,14 +147,15 @@ namespace frm aMovedEntries ); - stringItemListChanged( aGuard ); + stringItemListChanged( aLock ); } } //--------------------------------------------------------------------- void SAL_CALL OEntryListHelper::entryRangeRemoved( const ListEntryEvent& _rEvent ) throw (RuntimeException) { - ::osl::ResettableMutexGuard aGuard( m_rMutex ); + ControlModelLock aLock( m_rControlModel ); + OSL_ENSURE( _rEvent.Source == m_xListSource, "OEntryListHelper::entryRangeRemoved: where did this come from?" ); OSL_ENSURE( ( _rEvent.Position > 0 ) && ( _rEvent.Count > 0 ) && ( _rEvent.Position + _rEvent.Count <= m_aStringItems.getLength() ), @@ -170,21 +175,22 @@ namespace frm // shrink the array m_aStringItems.realloc( m_aStringItems.getLength() - _rEvent.Count ); - stringItemListChanged( aGuard ); + stringItemListChanged( aLock ); } } //--------------------------------------------------------------------- void SAL_CALL OEntryListHelper::allEntriesChanged( const EventObject& _rEvent ) throw (RuntimeException) { - ::osl::ResettableMutexGuard aGuard( m_rMutex ); + ControlModelLock aLock( m_rControlModel ); + OSL_ENSURE( _rEvent.Source == m_xListSource, "OEntryListHelper::allEntriesChanged: where did this come from?" ); Reference< XListEntrySource > xSource( _rEvent.Source, UNO_QUERY ); if ( _rEvent.Source == m_xListSource ) { - impl_lock_refreshList( aGuard ); + impl_lock_refreshList( aLock ); } } @@ -207,8 +213,8 @@ namespace frm void SAL_CALL OEntryListHelper::refresh() throw(RuntimeException) { { - ::osl::ResettableMutexGuard aGuard( m_rMutex ); - impl_lock_refreshList( aGuard ); + ControlModelLock aLock( m_rControlModel ); + impl_lock_refreshList( aLock ); } EventObject aEvt( static_cast< XRefreshable* >( this ) ); @@ -216,7 +222,7 @@ namespace frm } //--------------------------------------------------------------------- - void OEntryListHelper::impl_lock_refreshList( ::osl::ResettableMutexGuard& _rInstanceLock ) + void OEntryListHelper::impl_lock_refreshList( ControlModelLock& _rInstanceLock ) { if ( hasExternalListSource() ) { @@ -272,7 +278,7 @@ namespace frm } //--------------------------------------------------------------------- - void OEntryListHelper::connectExternalListSource( const Reference< XListEntrySource >& _rxSource, ::osl::ResettableMutexGuard& _rInstanceLock ) + void OEntryListHelper::connectExternalListSource( const Reference< XListEntrySource >& _rxSource, ControlModelLock& _rInstanceLock ) { OSL_ENSURE( !hasExternalListSource(), "OEntryListHelper::connectExternalListSource: only to be called if no external source is active!" ); OSL_ENSURE( _rxSource.is(), "OEntryListHelper::connectExternalListSource: invalid list source!" ); @@ -306,7 +312,7 @@ namespace frm } //--------------------------------------------------------------------- - void OEntryListHelper::setNewStringItemList( const ::com::sun::star::uno::Any& _rValue, ::osl::ResettableMutexGuard& _rInstanceLock ) + void OEntryListHelper::setNewStringItemList( const ::com::sun::star::uno::Any& _rValue, ControlModelLock& _rInstanceLock ) { OSL_PRECOND( !hasExternalListSource(), "OEntryListHelper::setNewStringItemList: this should never have survived convertNewListSourceProperty!" ); OSL_VERIFY( _rValue >>= m_aStringItems ); diff --git a/forms/source/component/entrylisthelper.hxx b/forms/source/component/entrylisthelper.hxx index 5b5b0ca46610..3d0f1de784b6 100644 --- a/forms/source/component/entrylisthelper.hxx +++ b/forms/source/component/entrylisthelper.hxx @@ -46,6 +46,9 @@ namespace frm { //......................................................................... + class OControlModel; + class ControlModelLock; + //===================================================================== //= OEntryListHelper //===================================================================== @@ -57,19 +60,19 @@ namespace frm class OEntryListHelper : public OEntryListHelper_BASE { private: - ::osl::Mutex& m_rMutex; + OControlModel& m_rControlModel; ::com::sun::star::uno::Reference< ::com::sun::star::form::binding::XListEntrySource > m_xListSource; /// our external list source ::com::sun::star::uno::Sequence< ::rtl::OUString > m_aStringItems; /// "overridden" StringItemList property value - ::cppu::OInterfaceContainerHelper + ::cppu::OInterfaceContainerHelper m_aRefreshListeners; protected: - OEntryListHelper( ::osl::Mutex& _rMutex ); - OEntryListHelper( const OEntryListHelper& _rSource, ::osl::Mutex& _rMutex ); + OEntryListHelper( OControlModel& _rControlModel ); + OEntryListHelper( const OEntryListHelper& _rSource, OControlModel& _rControlModel ); virtual ~OEntryListHelper( ); /// returns the current string item list @@ -117,7 +120,7 @@ namespace frm not to be called when we have an external list source @see hasExternalListSource */ - void setNewStringItemList( const ::com::sun::star::uno::Any& _rValue, ::osl::ResettableMutexGuard& _rInstanceLock ); + void setNewStringItemList( const ::com::sun::star::uno::Any& _rValue, ControlModelLock& _rInstanceLock ); /** announces that the list of entries has changed. @@ -127,7 +130,7 @@ namespace frm @pure @see getStringItemList */ - virtual void stringItemListChanged( ::osl::ResettableMutexGuard& _rInstanceLock ) = 0; + virtual void stringItemListChanged( ControlModelLock& _rInstanceLock ) = 0; /** called whenever a connection to a new external list source has been established */ @@ -171,7 +174,7 @@ namespace frm */ void connectExternalListSource( const ::com::sun::star::uno::Reference< ::com::sun::star::form::binding::XListEntrySource >& _rxSource, - ::osl::ResettableMutexGuard& _rInstanceLock + ControlModelLock& _rInstanceLock ); /** refreshes our list entries @@ -182,7 +185,7 @@ namespace frm In case we do not have an external list source, refreshInternalEntryList is called. */ - void impl_lock_refreshList( ::osl::ResettableMutexGuard& _rInstanceLock ); + void impl_lock_refreshList( ControlModelLock& _rInstanceLock ); private: OEntryListHelper(); // never implemented diff --git a/forms/source/inc/FormComponent.hxx b/forms/source/inc/FormComponent.hxx index d396cbd2df6a..9329ca92ba14 100644 --- a/forms/source/inc/FormComponent.hxx +++ b/forms/source/inc/FormComponent.hxx @@ -31,57 +31,60 @@ #ifndef _FORMS_FORMCOMPONENT_HXX_ #define _FORMS_FORMCOMPONENT_HXX_ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "cloneable.hxx" +#include "ids.hxx" +#include "property.hrc" +#include "property.hxx" +#include "propertybaghelper.hxx" +#include "services.hxx" +#include "windowstateguard.hxx" + +/** === begin UNO includes === **/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include "services.hxx" -#ifndef _FRM_PROPERTY_HRC_ -#include "property.hrc" -#endif -#include "property.hxx" -#include "cloneable.hxx" -#include "ids.hxx" -#include "windowstateguard.hxx" -#include "propertybaghelper.hxx" -#include +#include +/** === end UNO includes === **/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include @@ -104,6 +107,64 @@ namespace frm virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException) \ { return ::rtl::OUString::createFromAscii("com.sun.star.comp.forms.") + ::rtl::OUString::createFromAscii(#ImplName); } + class OControlModel; + + //========================================================================= + //= ControlModelLock + //========================================================================= + /** class whose instances lock a OControlModel + + Locking here merely means locking the OControlModel's mutex. + + In addition to the locking facility, the class is also able to fire property + change notifications. This happens when the last ControlModelLock instance on a stack + dies. + */ + class ControlModelLock + { + public: + ControlModelLock( OControlModel& _rModel ) + :m_rModel( _rModel ) + ,m_bLocked( false ) + { + acquire(); + } + + ~ControlModelLock() + { + if ( m_bLocked ) + release(); + } + inline void acquire(); + inline void release(); + + inline OControlModel& getModel() const { return m_rModel; }; + + /** adds a property change notification, which is to be fired when the last lock on the model + (in the current thread) is released. + */ + void addPropertyNotification( + const sal_Int32 _nHandle, + const ::com::sun::star::uno::Any& _rOldValue, + const ::com::sun::star::uno::Any& _rNewValue + ); + + private: + void impl_notifyAll_nothrow(); + + private: + OControlModel& m_rModel; + bool m_bLocked; + ::com::sun::star::uno::Sequence< sal_Int32 > m_aHandles; + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > m_aOldValues; + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > m_aNewValues; + + private: + ControlModelLock(); // never implemented + ControlModelLock( const ControlModelLock& ); // never implemented + ControlModelLock& operator=( const ControlModelLock& ); // never implemented + }; + //========================================================================= //= OControl //= base class for form layer controls @@ -117,7 +178,7 @@ class OControl :public ::cppu::OComponentHelper ,public OControl_BASE { protected: - osl::Mutex m_aMutex; + ::osl::Mutex m_aMutex; OImplementationIdsRef m_aHoldIdHelper; ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > m_xControl; @@ -125,8 +186,6 @@ protected: m_xAggregate; ::comphelper::ComponentContext m_aContext; - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > - m_xServiceFactory; // legacy only, use m_aContext instead WindowStateGuard m_aWindowStateGuard; public: @@ -301,19 +360,14 @@ class OControlModel :public ::cppu::OComponentHelper protected: ::comphelper::ComponentContext m_aContext; - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > - m_xServiceFactory; // legacy only, use m_aContext instead - ::osl::Mutex m_aMutex; + ::osl::Mutex m_aMutex; + oslInterlockedCount m_lockCount; InterfaceRef m_xParent; // ParentComponent OImplementationIdsRef m_aHoldIdHelper; PropertyBagHelper m_aPropertyBagHelper; - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& - getORB( ) const { return m_xServiceFactory; } - // legacy only, use getContext instead! - const ::comphelper::ComponentContext& getContext() const { return m_aContext; } @@ -465,6 +519,22 @@ protected: virtual void describeAggregateProperties( ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rAggregateProps ) const; + +public: + struct LockAccess { friend class ControlModelLock; private: LockAccess() { } }; + + void lockInstance( LockAccess ); + oslInterlockedCount unlockInstance( LockAccess ); + + void firePropertyChanges( + const ::com::sun::star::uno::Sequence< sal_Int32 >& _rHandles, + const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& _rOldValues, + const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& _rNewValues, + LockAccess + ); + + inline ::osl::Mutex& + getInstanceMutex() { return m_aMutex; } }; //================================================================== @@ -520,7 +590,7 @@ protected: #define IMPLEMENT_DEFAULT_CLONING( classname ) \ ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL classname::createClone( ) throw (::com::sun::star::uno::RuntimeException) \ { \ - classname* pClone = new classname( this, getORB() ); \ + classname* pClone = new classname( this, getContext().getLegacyServiceFactory() ); \ pClone->clonedFrom( this ); \ return pClone; \ } @@ -529,9 +599,10 @@ protected: //= OBoundControlModel //= model of a form layer control which is bound to a data source field //================================================================== -typedef ::cppu::ImplHelper3 < ::com::sun::star::form::XLoadListener +typedef ::cppu::ImplHelper4 < ::com::sun::star::form::XLoadListener , ::com::sun::star::form::XReset , ::com::sun::star::beans::XPropertyChangeListener + , ::com::sun::star::sdb::XRowSetChangeListener > OBoundControlModel_BASE1; // separated into an own base class since derivees can disable the support for this @@ -565,6 +636,12 @@ protected: }; private: + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > + m_xField; + // the form which controls supplies the field we bind to. + ::com::sun::star::uno::Reference< ::com::sun::star::form::XLoadable > + m_xAmbientForm; + ::rtl::OUString m_sValuePropertyName; sal_Int32 m_nValuePropertyAggregateHandle; sal_Int32 m_nFieldType; @@ -585,15 +662,13 @@ private: ::rtl::OUString m_aControlSource; // Datenquelle, Name des Feldes ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xLabelControl; // reference to a sibling control (model) which is our label - ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > - m_xField; sal_Bool m_bInputRequired; // ::comphelper::OPropertyChangeMultiplexer* m_pAggPropMultiplexer; - sal_Bool m_bLoadListening : 1; // are we currently a load listener at our parent form? + bool m_bFormListening : 1; // are we currently a XLoadListener at our ambient form? sal_Bool m_bLoaded : 1; sal_Bool m_bRequired : 1; const sal_Bool m_bCommitable : 1; // do we support XBoundComponent? @@ -910,10 +985,10 @@ protected: virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes(); - inline const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& getField() const - { - return m_xField; - } + /// sets m_xField to the given new value, without notifying our listeners + void impl_setField_noNotify( + const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxField + ); inline bool hasField() const { return m_xField.is(); @@ -928,6 +1003,12 @@ protected: ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps ) const; +public: + inline const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& getField() const + { + return m_xField; + } + public: // UNO Anbindung DECLARE_UNO3_AGG_DEFAULTS(OBoundControlModel, OControlModel); @@ -979,6 +1060,9 @@ public: // XPropertyChangeListener virtual void SAL_CALL propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& evt ) throw(::com::sun::star::uno::RuntimeException); + // XRowSetChangeListener + virtual void SAL_CALL onRowSetChanged( const ::com::sun::star::lang::EventObject& i_Event ) throw (::com::sun::star::uno::RuntimeException); + // XLoadListener virtual void SAL_CALL loaded( const ::com::sun::star::lang::EventObject& aEvent ) throw(::com::sun::star::uno::RuntimeException); virtual void SAL_CALL unloading( const ::com::sun::star::lang::EventObject& aEvent ) throw(::com::sun::star::uno::RuntimeException); @@ -1030,7 +1114,7 @@ protected: @precond we do have an active external binding in place */ - void transferExternalValueToControl( ::osl::ResettableMutexGuard& _rInstanceLock ); + void transferExternalValueToControl( ControlModelLock& _rInstanceLock ); /** transfers the control value to the external binding @precond @@ -1038,7 +1122,7 @@ protected: @precond we do have an active external binding in place */ - void transferControlValueToExternal( ::osl::ResettableMutexGuard& _rInstanceLock ); + void transferControlValueToExternal( ControlModelLock& _rInstanceLock ); /** calculates the type which is to be used to communicate with the current external binding, and stores it in m_aExternalValueType @@ -1093,46 +1177,41 @@ private: /// initializes listening at the value property void implInitValuePropertyListening( ) const; - /** adds the component as load listener to the parent form + /** adds or removes the component as load listener to/from our form, and (if necessary) as RowSetChange listener at + our parent. - @precond there is a valid (non-NULL) parent form @precond there must no external value binding be in place - @precond We are currently *not* listening at the parent form. */ - void startLoadListening( ); + void doFormListening( const bool _bStart ); - /** removes the component as load listener from the parent form - @precond We currently *are* listening at the parent form. + inline bool isFormListening() const { return m_bFormListening; } + + /** determines the new value of m_xAmbientForm */ - void stopLoadListening( ); + void impl_determineAmbientForm_nothrow(); - inline sal_Bool isLoadListening() const { return m_bLoadListening; } + /** connects to a value supplier which is an database column. - /** connects to a value supplier which is an database column + The column is take from our parent, which must be a database form respectively row set. @precond The control does not have an external value supplier - @precond Our mutex is not locked - @param _rxRowSet - The row set which contains the column which we should connect to @param _bFromReload Determines whether the connection is made after the row set has been loaded () or reloaded () - @see disconnectDatabaseColumn + @see impl_disconnectDatabaseColumn_noNotify */ - void connectDatabaseColumn( - const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet >& _rxRowSet, + void impl_connectDatabaseColumn_noNotify( bool _bFromReload ); /** disconnects from a value supplier which is an database column @precond The control does not have an external value supplier - @precond Our mutex is not locked - @see connectDatabaseColumn + @see impl_connectDatabaseColumn_noNotify */ - void disconnectDatabaseColumn( ); + void impl_disconnectDatabaseColumn_noNotify(); /** connects to an external value binding @@ -1147,7 +1226,7 @@ private: */ void connectExternalValueBinding( const ::com::sun::star::uno::Reference< ::com::sun::star::form::binding::XValueBinding >& _rxBinding, - ::osl::ResettableMutexGuard& _rInstanceLock + ControlModelLock& _rInstanceLock ); /** disconnects from an external value binding @@ -1196,6 +1275,23 @@ private: ); }; + //========================================================================= + //= inlines + //========================================================================= + inline void ControlModelLock::acquire() + { + m_rModel.lockInstance( OControlModel::LockAccess() ); + m_bLocked = true; + } + inline void ControlModelLock::release() + { + OSL_ENSURE( m_bLocked, "ControlModelLock::release: not locked!" ); + m_bLocked = false; + + if ( 0 == m_rModel.unlockInstance( OControlModel::LockAccess() ) ) + impl_notifyAll_nothrow(); + } + //......................................................................... } //......................................................................... diff --git a/forms/source/inc/InterfaceContainer.hxx b/forms/source/inc/InterfaceContainer.hxx index 9bdbf3bdc402..f9939d17623b 100644 --- a/forms/source/inc/InterfaceContainer.hxx +++ b/forms/source/inc/InterfaceContainer.hxx @@ -53,10 +53,11 @@ #include #include #include +#include #include #include #include -#include +#include using namespace comphelper; @@ -91,13 +92,15 @@ typedef ::std::hash_multimap< ::rtl::OUString, InterfaceRef, ::comphelper::UStri // OInterfaceContainer // implements a container for form components //================================================================== -typedef ::cppu::ImplHelper7< ::com::sun::star::container::XNameContainer, - ::com::sun::star::container::XIndexContainer, - ::com::sun::star::container::XContainer, - ::com::sun::star::container::XEnumerationAccess, - ::com::sun::star::script::XEventAttacherManager, - ::com::sun::star::beans::XPropertyChangeListener, - ::com::sun::star::io::XPersistObject > OInterfaceContainer_BASE; +typedef ::cppu::ImplHelper8 < ::com::sun::star::container::XNameContainer + , ::com::sun::star::container::XIndexContainer + , ::com::sun::star::container::XContainer + , ::com::sun::star::container::XEnumerationAccess + , ::com::sun::star::script::XEventAttacherManager + , ::com::sun::star::beans::XPropertyChangeListener + , ::com::sun::star::io::XPersistObject + , ::com::sun::star::util::XCloneable + > OInterfaceContainer_BASE; class OInterfaceContainer : public OInterfaceContainer_BASE { @@ -108,7 +111,7 @@ protected: OInterfaceMap m_aMap; ::cppu::OInterfaceContainerHelper m_aContainerListeners; - ::com::sun::star::uno::Type m_aElementType; + const ::com::sun::star::uno::Type m_aElementType; ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory> m_xServiceFactory; @@ -122,6 +125,12 @@ public: ::osl::Mutex& _rMutex, const ::com::sun::star::uno::Type& _rElementType); + OInterfaceContainer( ::osl::Mutex& _rMutex, const OInterfaceContainer& _cloneSource ); + + // late constructor for cloning + void clonedFrom( const OInterfaceContainer& _cloneSource ); + +protected: virtual ~OInterfaceContainer(); public: @@ -221,11 +230,17 @@ protected: ) throw(::com::sun::star::lang::IllegalArgumentException); // called after the object is inserted, but before the "real listeners" are notified - virtual void implInserted( const ElementDescription* /*_pElement*/ ) { } + virtual void implInserted( const ElementDescription* _pElement ); // called after the object is removed, but before the "real listeners" are notified - virtual void implRemoved(const InterfaceRef& /*_rxObject*/) { } - // called after an object was replaced, but before the "real listeners" are notified - virtual void implReplaced( const InterfaceRef& /*_rxReplacedObject*/, const ElementDescription* /*_pElement*/ ) { } + virtual void implRemoved(const InterfaceRef& _rxObject); + + /** called after an object was replaced. The default implementation notifies our listeners, after releasing + the instance lock. + */ + virtual void impl_replacedElement( + const ::com::sun::star::container::ContainerEvent& _rEvent, + ::osl::ClearableMutexGuard& _rInstanceLock + ); void SAL_CALL writeEvents(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectOutputStream>& _rxOutStream); void SAL_CALL readEvents(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectInputStream>& _rxInStream); @@ -267,6 +282,8 @@ private: efVersionSO6x }; void transformEvents( const EventFormat _eTargetFormat ); + + void impl_createEventAttacher_nothrow(); }; //================================================================== @@ -275,9 +292,9 @@ private: typedef ::cppu::ImplHelper1< ::com::sun::star::form::XFormComponent> OFormComponents_BASE; typedef ::cppu::OComponentHelper FormComponentsBase; // else MSVC kills itself on some statements -class OFormComponents : public FormComponentsBase, - public OInterfaceContainer, - public OFormComponents_BASE +class OFormComponents :public FormComponentsBase + ,public OInterfaceContainer + ,public OFormComponents_BASE { protected: ::osl::Mutex m_aMutex; @@ -285,6 +302,7 @@ protected: public: OFormComponents(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); + OFormComponents( const OFormComponents& _cloneSource ); virtual ~OFormComponents(); DECLARE_UNO3_AGG_DEFAULTS(OFormComponents, FormComponentsBase); diff --git a/forms/source/misc/InterfaceContainer.cxx b/forms/source/misc/InterfaceContainer.cxx index 55fec77ffb11..f1b59d77af7e 100644 --- a/forms/source/misc/InterfaceContainer.cxx +++ b/forms/source/misc/InterfaceContainer.cxx @@ -30,34 +30,34 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_forms.hxx" -#include "InterfaceContainer.hxx" -#include -#include -#include -#include -#include -#include -#include - -#ifndef _FRM_PROPERTY_HRC_ -#include "property.hrc" -#endif -#include "services.hxx" -#ifndef _FRM_RESOURCE_HRC_ -#include "frm_resource.hrc" -#endif -#include "frm_resource.hxx" -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include + +#include "frm_resource.hrc" +#include "frm_resource.hxx" +#include "InterfaceContainer.hxx" +#include "property.hrc" +#include "services.hxx" + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include //......................................................................... namespace frm @@ -71,6 +71,7 @@ using namespace ::com::sun::star::container; using namespace ::com::sun::star::script; using namespace ::com::sun::star::io; using namespace ::com::sun::star::form; +using namespace ::com::sun::star::util; namespace { @@ -102,15 +103,56 @@ OInterfaceContainer::OInterfaceContainer( const Reference& _rxFactory, ::osl::Mutex& _rMutex, const Type& _rElementType) - :m_rMutex(_rMutex) - ,m_aContainerListeners(_rMutex) - ,m_aElementType(_rElementType) - ,m_xServiceFactory(_rxFactory) + :OInterfaceContainer_BASE() + ,m_rMutex(_rMutex) + ,m_aContainerListeners(_rMutex) + ,m_aElementType(_rElementType) + ,m_xServiceFactory(_rxFactory) +{ + impl_createEventAttacher_nothrow(); +} + +//------------------------------------------------------------------------------ +OInterfaceContainer::OInterfaceContainer( ::osl::Mutex& _rMutex, const OInterfaceContainer& _cloneSource ) + :OInterfaceContainer_BASE() + ,m_rMutex( _rMutex ) + ,m_aContainerListeners( _rMutex ) + ,m_aElementType( _cloneSource.m_aElementType ) + ,m_xServiceFactory( _cloneSource.m_xServiceFactory ) +{ + impl_createEventAttacher_nothrow(); +} + +//------------------------------------------------------------------------------ +void OInterfaceContainer::clonedFrom( const OInterfaceContainer& _cloneSource ) +{ + try + { + const Reference< XIndexAccess > xSourceHierarchy( const_cast< OInterfaceContainer* >( &_cloneSource ) ); + const sal_Int32 nCount = xSourceHierarchy->getCount(); + for ( sal_Int32 i=0; i xCloneable( xSourceHierarchy->getByIndex( i ), UNO_QUERY_THROW ); + Reference< XInterface > xClone( xCloneable->createClone() ); + insertByIndex( i, makeAny( xClone ) ); + } + } + catch( const Exception& ) + { + throw WrappedTargetException( + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Could not clone the given interface hierarchy." ) ), + static_cast< XIndexContainer* >( const_cast< OInterfaceContainer* >( &_cloneSource ) ), + ::cppu::getCaughtException() + ); + } +} + +//------------------------------------------------------------------------------ +void OInterfaceContainer::impl_createEventAttacher_nothrow() { try { - m_xEventAttacher = ::comphelper::createEventAttacherManager(m_xServiceFactory); - OSL_ENSURE( m_xEventAttacher.is(), "OInterfaceContainer::OInterfaceContainer: no event attacher manager!" ); + m_xEventAttacher.set( ::comphelper::createEventAttacherManager( m_xServiceFactory ), UNO_SET_THROW ); } catch( const Exception& ) { @@ -118,7 +160,10 @@ OInterfaceContainer::OInterfaceContainer( } } -OInterfaceContainer::~OInterfaceContainer() {} +//------------------------------------------------------------------------------ +OInterfaceContainer::~OInterfaceContainer() +{ +} //------------------------------------------------------------------------------ void OInterfaceContainer::disposing() @@ -783,6 +828,25 @@ void OInterfaceContainer::removeElementsNoEvents(sal_Int32 nIndex) xChild->setParent(InterfaceRef ()); } +//------------------------------------------------------------------------------ +void OInterfaceContainer::implInserted( const ElementDescription* /*_pElement*/ ) +{ + // not inrerested in +} + +//------------------------------------------------------------------------------ +void OInterfaceContainer::implRemoved( const InterfaceRef& /*_rxObject*/ ) +{ + // not inrerested in +} + +//------------------------------------------------------------------------------ +void OInterfaceContainer::impl_replacedElement( const ContainerEvent& _rEvent, ::osl::ClearableMutexGuard& _rInstanceLock ) +{ + _rInstanceLock.clear(); + m_aContainerListeners.notifyEach( &XContainerListener::elementReplaced, _rEvent ); +} + // XIndexContainer //------------------------------------------------------------------------------ void SAL_CALL OInterfaceContainer::insertByIndex( sal_Int32 _nIndex, const Any& _rElement ) throw(IllegalArgumentException, IndexOutOfBoundsException, WrappedTargetException, RuntimeException) @@ -856,17 +920,13 @@ void OInterfaceContainer::implReplaceByIndex( const sal_Int32 _nIndex, const Any m_xEventAttacher->attach( _nIndex, aElementMetaData.get()->xInterface, makeAny( aElementMetaData.get()->xPropertySet ) ); } - implReplaced( xOldElement, aElementMetaData.get() ); - - // benachrichtigen - ContainerEvent aEvt; - aEvt.Source = static_cast(this); - aEvt.Accessor <<= _nIndex; - aEvt.Element = aElementMetaData.get()->aElementTypeInterface; - aEvt.ReplacedElement = xOldElement->queryInterface( m_aElementType ); + ContainerEvent aReplaceEvent; + aReplaceEvent.Source = static_cast< XContainer* >( this ); + aReplaceEvent.Accessor <<= _nIndex; + aReplaceEvent.Element = aElementMetaData.get()->xInterface->queryInterface( m_aElementType ); + aReplaceEvent.ReplacedElement = xOldElement->queryInterface( m_aElementType ); - _rClearBeforeNotify.clear(); - m_aContainerListeners.notifyEach( &XContainerListener::elementReplaced, aEvt ); + impl_replacedElement( aReplaceEvent, _rClearBeforeNotify ); } //------------------------------------------------------------------------------ @@ -1124,8 +1184,17 @@ Sequence SAL_CALL OFormComponents::getTypes() throw(RuntimeException) //------------------------------------------------------------------------------ OFormComponents::OFormComponents(const Reference& _rxFactory) - :FormComponentsBase(m_aMutex) - ,OInterfaceContainer(_rxFactory, m_aMutex, ::getCppuType(static_cast*>(NULL))) + :FormComponentsBase( m_aMutex ) + ,OInterfaceContainer( _rxFactory, m_aMutex, XFormComponent::static_type() ) + ,OFormComponents_BASE() +{ +} + +//------------------------------------------------------------------------------ +OFormComponents::OFormComponents( const OFormComponents& _cloneSource ) + :FormComponentsBase( m_aMutex ) + ,OInterfaceContainer( m_aMutex, _cloneSource ) + ,OFormComponents_BASE() { } -- cgit From 11498c64d60d55240f440f28dbf563888668f3c0 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Thu, 23 Apr 2009 10:42:05 +0000 Subject: CWS-TOOLING: integrate CWS dbaperf1 2009-04-02 09:12:25 +0200 oj r270372 : CWS-TOOLING: rebase CWS dbaperf1 to trunk@270033 (milestone: DEV300:m45) 2009-03-17 10:20:34 +0100 oj r269577 : add parameter 2009-03-17 10:20:05 +0100 oj r269576 : add parameter 2009-03-12 12:32:24 +0100 oj r269387 : add missing ++ 2009-03-11 12:53:35 +0100 oj r269315 : compile error 2009-03-06 08:52:11 +0100 oj r268968 : #i99264# remove duplicate code 2009-03-06 08:20:08 +0100 oj r268966 : add missingheader 2009-03-06 08:17:41 +0100 oj r268965 : add header 2009-03-06 08:15:07 +0100 oj r268964 : #i99708# remove duplicate code 2009-03-06 07:24:11 +0100 oj r268963 : #i99708# remove duplicate code 2009-03-06 07:22:24 +0100 oj r268962 : #i99708# use tenary operator 2009-03-06 07:19:21 +0100 oj r268961 : remove unused rtl_logs 2009-03-06 07:15:55 +0100 oj r268960 : #i99708# extract getLength from for loop 2009-03-06 07:15:35 +0100 oj r268959 : #i99708# extract getLength from for loop 2009-03-06 07:14:57 +0100 oj r268958 : remove unused rtl_logs 2009-03-06 07:13:01 +0100 oj r268957 : insert DBG_ helper 2009-03-06 07:12:17 +0100 oj r268956 : remove unused rtl_logs 2009-03-06 07:10:26 +0100 oj r268955 : remove unused rtl_logs 2009-03-06 07:04:51 +0100 oj r268954 : #i99708# use tenary operator 2009-03-05 12:04:46 +0100 oj r268895 : comment RTL_LOG out 2009-03-05 09:05:07 +0100 oj r268874 : add rtl logfile 2009-03-04 14:21:18 +0100 oj r268828 : #i99708# make static inplace and some method calls in for loop removed 2009-03-04 14:20:34 +0100 oj r268827 : #i99708# impl double check pattern for getInfohelper 2009-03-02 09:31:42 +0100 oj r268636 : add rtl logfile 2009-03-02 08:18:37 +0100 oj r268633 : add rtl logfile 2009-02-27 11:22:16 +0100 oj r268570 : #i99709# change algorithm for marking objects 2009-02-27 11:17:04 +0100 oj r268568 : #i99708# some improvements to load forms, controls faster and replacement of size() call with !empty() which is much faster 2009-02-24 10:09:35 +0100 sb r268383 : #i99290# no longer care to set a sensible context class loader for native threads attached to the VM 2009-02-23 13:44:04 +0100 oj r268354 : #i76606# seekrow changes 2009-02-23 12:27:30 +0100 oj r268349 : deleted 2009-02-20 15:14:23 +0100 oj r268325 : #i76606# some code changes 2009-02-19 14:15:25 +0100 oj r268284 : #i76606# use of simple prep stmt instead of full blown rowset, when source and dest connection are the same use insert into ... ( select ... ) 2009-02-19 11:27:55 +0100 oj r268265 : #i76606# insert some RTL_LOG and setObject impl 2009-02-18 14:45:37 +0100 oj r268222 : #i99363# insert RTL_LOG 2009-02-18 14:45:18 +0100 oj r268221 : #i99363# insert RTL_LOG 2009-02-18 11:14:54 +0100 oj r268207 : #i99363# call some impl_ methods to avoid duplicate cechCache calls 2009-02-18 11:10:47 +0100 oj r268206 : #i99363# make isCount inline 2009-02-18 10:33:22 +0100 oj r268203 : #i99363# use bookmarkable if available and inserted some RTL_LOG 2009-02-18 10:32:57 +0100 oj r268202 : #i99363# use bookmarkable if available and inserted some RTL_LOG 2009-02-17 07:29:05 +0100 oj r267843 : #i96897# remove some dll public 2009-02-16 15:01:04 +0100 oj r267816 : #i96897# remove some dll public 2009-02-16 14:25:53 +0100 oj r267810 : #i99264# remove duplicate code 2009-02-16 14:25:33 +0100 oj r267809 : #i99264# remove duplicate code 2009-02-16 14:24:59 +0100 oj r267808 : #i99264# remove duplicate code 2009-02-13 10:56:17 +0100 oj r267703 : #i99191# comment the contextclassloader 2009-02-13 10:32:40 +0100 oj r267700 : reduce call to resultset meta data 2009-02-13 10:27:31 +0100 oj r267699 : reduce call to resultset meta data 2009-02-13 10:27:08 +0100 oj r267698 : reduce call to resultset meta data --- forms/source/component/DatabaseForm.cxx | 161 +++++++-------------- forms/source/component/DatabaseForm.hxx | 1 + forms/source/component/FormComponent.cxx | 113 +++++++++++---- forms/source/component/propertybaghelper.cxx | 51 +++++-- forms/source/xforms/submission/replace.cxx | 30 +++- forms/source/xforms/submission/submission.hxx | 17 ++- forms/source/xforms/submission/submission_get.cxx | 1 - forms/source/xforms/submission/submission_post.cxx | 19 +-- forms/source/xforms/submission/submission_post.hxx | 4 - forms/source/xforms/submission/submission_put.cxx | 22 +-- forms/source/xforms/submission/submission_put.hxx | 2 - 11 files changed, 219 insertions(+), 202 deletions(-) (limited to 'forms') diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx index bba5b48ffe28..21e3be3c4820 100644 --- a/forms/source/component/DatabaseForm.cxx +++ b/forms/source/component/DatabaseForm.cxx @@ -452,14 +452,18 @@ ODatabaseForm::~ODatabaseForm() //------------------------------------------------------------------------ ::rtl::OUString ODatabaseForm::GetDataURLEncoded(const Reference& SubmitButton, const ::com::sun::star::awt::MouseEvent& MouseEvt) { - + return GetDataEncoded(true,SubmitButton,MouseEvt); +} +// ----------------------------------------------------------------------------- +::rtl::OUString ODatabaseForm::GetDataEncoded(bool _bURLEncoded,const Reference& SubmitButton, const ::com::sun::star::awt::MouseEvent& MouseEvt) +{ // Liste von successful Controls fuellen HtmlSuccessfulObjList aSuccObjList; FillSuccessfulList( aSuccObjList, SubmitButton, MouseEvt ); // Liste zu ::rtl::OUString zusammensetzen - ::rtl::OUString aResult; + ::rtl::OUStringBuffer aResult; ::rtl::OUString aName; ::rtl::OUString aValue; @@ -482,17 +486,24 @@ ODatabaseForm::~ODatabaseForm() } Encode( aName ); Encode( aValue ); - aResult += aName; - aResult += UniString('='); - aResult += aValue; + + aResult.append(aName); + aResult.append(sal_Unicode('=')); + aResult.append(aValue); + if (pSuccObj < aSuccObjList.end() - 1) - aResult += UniString('&'); + { + if ( _bURLEncoded ) + aResult.append(sal_Unicode('&')); + else + aResult.appendAscii("\r\n"); + } } aSuccObjList.clear(); - return aResult; + return aResult.makeStringAndClear(); } //============================================================================== @@ -500,46 +511,7 @@ ODatabaseForm::~ODatabaseForm() //------------------------------------------------------------------------ ::rtl::OUString ODatabaseForm::GetDataTextEncoded(const Reference& SubmitButton, const ::com::sun::star::awt::MouseEvent& MouseEvt) { - - // Liste von successful Controls fuellen - HtmlSuccessfulObjList aSuccObjList; - FillSuccessfulList( aSuccObjList, SubmitButton, MouseEvt ); - // Liste zu ::rtl::OUString zusammensetzen - ::rtl::OUString aResult; - ::rtl::OUString aName; - ::rtl::OUString aValue; - - for ( HtmlSuccessfulObjListIterator pSuccObj = aSuccObjList.begin(); - pSuccObj < aSuccObjList.end(); - ++pSuccObj - ) - { - aName = pSuccObj->aName; - aValue = pSuccObj->aValue; - if (pSuccObj->nRepresentation == SUCCESSFUL_REPRESENT_FILE && aValue.getLength()) - { - // Bei File-URLs wird der Dateiname und keine URL uebertragen, - // weil Netscape dies so macht. - INetURLObject aURL; - aURL.SetSmartProtocol(INET_PROT_FILE); - aURL.SetSmartURL(aValue); - if( INET_PROT_FILE == aURL.GetProtocol() ) - aValue = INetURLObject::decode(aURL.PathToFileName(), '%', INetURLObject::DECODE_UNAMBIGUOUS); - } - Encode( aName ); - Encode( aValue ); - aResult += pSuccObj->aName; - aResult += UniString('='); - aResult += pSuccObj->aValue; - if (pSuccObj < aSuccObjList.end() - 1) - aResult += ::rtl::OUString::createFromAscii("\r\n"); - } - - - // Liste loeschen - aSuccObjList.clear(); - - return aResult; + return GetDataEncoded(false,SubmitButton,MouseEvt); } //------------------------------------------------------------------------ @@ -2148,7 +2120,36 @@ void SAL_CALL ODatabaseForm::submit( const Reference& Control, submit_impl( Control, MouseEvt, true ); } } +// ----------------------------------------------------------------------------- +void lcl_dispatch(const Reference< XFrame >& xFrame,const Reference& xTransformer,const ::rtl::OUString& aURLStr,const ::rtl::OUString& aReferer,const ::rtl::OUString& aTargetName + ,const ::rtl::OUString& aData,rtl_TextEncoding _eEncoding) +{ + URL aURL; + aURL.Complete = aURLStr; + xTransformer->parseStrict(aURL); + + Reference< XDispatch > xDisp = Reference< XDispatchProvider > (xFrame,UNO_QUERY)->queryDispatch(aURL, aTargetName, + FrameSearchFlag::SELF | FrameSearchFlag::PARENT | FrameSearchFlag::CHILDREN | + FrameSearchFlag::SIBLINGS | FrameSearchFlag::CREATE | FrameSearchFlag::TASKS); + + if (xDisp.is()) + { + Sequence aArgs(2); + aArgs.getArray()[0].Name = ::rtl::OUString::createFromAscii("Referer"); + aArgs.getArray()[0].Value <<= aReferer; + + // build a sequence from the to-be-submitted string + ByteString a8BitData(aData.getStr(), (sal_uInt16)aData.getLength(), _eEncoding); + // always ANSI #58641 + Sequence< sal_Int8 > aPostData((sal_Int8*)a8BitData.GetBuffer(), a8BitData.Len()); + Reference< XInputStream > xPostData = new SequenceInputStream(aPostData); + + aArgs.getArray()[1].Name = ::rtl::OUString::createFromAscii("PostData"); + aArgs.getArray()[1].Value <<= xPostData; + xDisp->dispatch(aURL, aArgs); + } // if (xDisp.is()) +} //------------------------------------------------------------------------------ void ODatabaseForm::submit_impl(const Reference& Control, const ::com::sun::star::awt::MouseEvent& MouseEvt, bool _bAproveByListeners) { @@ -2196,6 +2197,9 @@ void ODatabaseForm::submit_impl(const Reference& Control, const ::com: if (!xModel.is()) return; + Reference< XFrame > xFrame = xModel->getCurrentController()->getFrame(); + if (!xFrame.is()) + return; Reference xTransformer(m_xServiceFactory->createInstance( @@ -2211,10 +2215,6 @@ void ODatabaseForm::submit_impl(const Reference& Control, const ::com: aData = GetDataURLEncoded( Control, MouseEvt ); } - Reference< XFrame > xFrame = xModel->getCurrentController()->getFrame(); - if (!xFrame.is()) - return; - URL aURL; // FormMethod GET if( eSubmitMethod == FormSubmitMethod_GET ) @@ -2240,38 +2240,11 @@ void ODatabaseForm::submit_impl(const Reference& Control, const ::com: // FormMethod POST else if( eSubmitMethod == FormSubmitMethod_POST ) { - aURL.Complete = aURLStr; - xTransformer->parseStrict(aURL); - - Reference< XDispatch > xDisp = Reference< XDispatchProvider > (xFrame,UNO_QUERY)->queryDispatch(aURL, aTargetName, - FrameSearchFlag::SELF | FrameSearchFlag::PARENT | FrameSearchFlag::CHILDREN | - FrameSearchFlag::SIBLINGS | FrameSearchFlag::CREATE | FrameSearchFlag::TASKS); - - if (xDisp.is()) - { - Sequence aArgs(2); - aArgs.getArray()[0].Name = ::rtl::OUString::createFromAscii("Referer"); - aArgs.getArray()[0].Value <<= aReferer; - - // build a sequence from the to-be-submitted string - ByteString a8BitData(aData.getStr(), (sal_uInt16)aData.getLength(), RTL_TEXTENCODING_MS_1252); - // always ANSI #58641 - Sequence< sal_Int8 > aPostData((sal_Int8*)a8BitData.GetBuffer(), a8BitData.Len()); - Reference< XInputStream > xPostData = new SequenceInputStream(aPostData); - - aArgs.getArray()[1].Name = ::rtl::OUString::createFromAscii("PostData"); - aArgs.getArray()[1].Value <<= xPostData; - - xDisp->dispatch(aURL, aArgs); - } + lcl_dispatch(xFrame,xTransformer,aURLStr,aReferer,aTargetName,aData,RTL_TEXTENCODING_MS_1252); } } else if( eSubmitEncoding == FormSubmitEncoding_MULTIPART ) { - Reference< XFrame > xFrame = xModel->getCurrentController()->getFrame(); - if (!xFrame.is()) - return; - URL aURL; aURL.Complete = aURLStr; xTransformer->parseStrict(aURL); @@ -2314,35 +2287,7 @@ void ODatabaseForm::submit_impl(const Reference& Control, const ::com: aData = GetDataTextEncoded( Reference (), MouseEvt ); } - Reference< XFrame > xFrame = xModel->getCurrentController()->getFrame(); - if (!xFrame.is()) - return; - - URL aURL; - - aURL.Complete = aURLStr; - xTransformer->parseStrict(aURL); - - Reference< XDispatch > xDisp = Reference< XDispatchProvider > (xFrame,UNO_QUERY)->queryDispatch(aURL, aTargetName, - FrameSearchFlag::SELF | FrameSearchFlag::PARENT | FrameSearchFlag::CHILDREN | - FrameSearchFlag::SIBLINGS | FrameSearchFlag::CREATE | FrameSearchFlag::TASKS); - - if (xDisp.is()) - { - Sequence aArgs(2); - aArgs.getArray()[0].Name = ::rtl::OUString::createFromAscii("Referer"); - aArgs.getArray()[0].Value <<= aReferer; - - // build a sequence from the to-be-submitted string - ByteString aSystemEncodedData(aData.getStr(), (sal_uInt16)aData.getLength(), osl_getThreadTextEncoding()); - Sequence< sal_Int8 > aPostData((sal_Int8*)aSystemEncodedData.GetBuffer(), aSystemEncodedData.Len()); - Reference< XInputStream > xPostData = new SequenceInputStream(aPostData); - - aArgs.getArray()[1].Name = ::rtl::OUString::createFromAscii("PostData"); - aArgs.getArray()[1].Value <<= xPostData; - - xDisp->dispatch(aURL, aArgs); - } + lcl_dispatch(xFrame,xTransformer,aURLStr,aReferer,aTargetName,aData,osl_getThreadTextEncoding()); } else { DBG_ERROR("ODatabaseForm::submit_Impl : wrong encoding !"); diff --git a/forms/source/component/DatabaseForm.hxx b/forms/source/component/DatabaseForm.hxx index 3cbbbcec2bbd..d4b0f3811a24 100644 --- a/forms/source/component/DatabaseForm.hxx +++ b/forms/source/component/DatabaseForm.hxx @@ -524,6 +524,7 @@ private: void onError(const ::com::sun::star::sdbc::SQLException&, const ::rtl::OUString& _rContextDescription); // html tools + ::rtl::OUString GetDataEncoded(bool _bURLEncoded,const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl>& SubmitButton, const ::com::sun::star::awt::MouseEvent& MouseEvt); ::rtl::OUString GetDataURLEncoded(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl>& SubmitButton, const ::com::sun::star::awt::MouseEvent& MouseEvt); ::rtl::OUString GetDataTextEncoded(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl>& SubmitButton, const ::com::sun::star::awt::MouseEvent& MouseEvt); ::com::sun::star::uno::Sequence GetDataMultiPartEncoded(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl>& SubmitButton, const ::com::sun::star::awt::MouseEvent& MouseEvt, diff --git a/forms/source/component/FormComponent.cxx b/forms/source/component/FormComponent.cxx index 5b00c5fbb9a2..f0cc505d125e 100644 --- a/forms/source/component/FormComponent.cxx +++ b/forms/source/component/FormComponent.cxx @@ -31,38 +31,38 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_forms.hxx" -#include "componenttools.hxx" -#include "FormComponent.hxx" -#include "frm_resource.hrc" -#include "frm_resource.hxx" -#include "property.hrc" -#include "services.hxx" - -/** === begin UNO includes === **/ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -/** === end UNO includes === **/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "componenttools.hxx" +#include "FormComponent.hxx" +#include "frm_resource.hrc" +#include "frm_resource.hxx" +#include "property.hrc" +#include "services.hxx" + +/** === begin UNO includes === **/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +/** === end UNO includes === **/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -523,12 +523,14 @@ DBG_NAME(OControlModel) //------------------------------------------------------------------ Sequence SAL_CALL OControlModel::getImplementationId() throw(RuntimeException) { + // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::getImplementationId" ); return OImplementationIds::getImplementationId(getTypes()); } //------------------------------------------------------------------ Sequence SAL_CALL OControlModel::getTypes() throw(RuntimeException) { + // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::getTypes" ); TypeBag aTypes( _getTypes() ); Reference< XTypeProvider > xProv; @@ -541,6 +543,7 @@ Sequence SAL_CALL OControlModel::getTypes() throw(RuntimeException) //------------------------------------------------------------------------------ Sequence OControlModel::_getTypes() { + // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::_getTypes" ); return TypeBag( OComponentHelper::getTypes(), OPropertySetAggregationHelper::getTypes(), OControlModel_BASE::getTypes() @@ -550,6 +553,7 @@ Sequence OControlModel::_getTypes() //------------------------------------------------------------------ Any SAL_CALL OControlModel::queryAggregation(const Type& _rType) throw (RuntimeException) { + // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::queryAggregation" ); // base class 1 Any aReturn(OComponentHelper::queryAggregation(_rType)); @@ -573,6 +577,7 @@ Any SAL_CALL OControlModel::queryAggregation(const Type& _rType) throw (RuntimeE //------------------------------------------------------------------------------ void OControlModel::readHelpTextCompatibly(const staruno::Reference< stario::XObjectInputStream >& _rxInStream) { + // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::readHelpTextCompatibly" ); ::rtl::OUString sHelpText; ::comphelper::operator>>( _rxInStream, sHelpText); try @@ -589,6 +594,7 @@ void OControlModel::readHelpTextCompatibly(const staruno::Reference< stario::XOb //------------------------------------------------------------------------------ void OControlModel::writeHelpTextCompatibly(const staruno::Reference< stario::XObjectOutputStream >& _rxOutStream) { + // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::writeHelpTextCompatibly" ); ::rtl::OUString sHelpText; try { @@ -619,6 +625,7 @@ OControlModel::OControlModel( // the native look is ugly .... // #i37342# / 2004-11-19 / frank.schoenheit@sun.com { + // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::OControlModel" ); DBG_CTOR(OControlModel, NULL); if (_rUnoControlModelTypeName.getLength()) // the is a model we have to aggregate { @@ -660,6 +667,7 @@ OControlModel::OControlModel( const OControlModel* _pOriginal, const Reference< ,m_nTabIndex( FRM_DEFAULT_TABINDEX ) ,m_nClassId( FormComponentType::CONTROL ) { + // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::OControlModel(copy)" ); DBG_CTOR( OControlModel, NULL ); DBG_ASSERT( _pOriginal, "OControlModel::OControlModel: invalid original!" ); @@ -704,12 +712,14 @@ OControlModel::~OControlModel() //------------------------------------------------------------------ void OControlModel::clonedFrom( const OControlModel* /*_pOriginal*/ ) { + // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::clonedFrom" ); // nothing to do in this base class } //------------------------------------------------------------------------------ void OControlModel::doResetDelegator() { + // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::doResetDelegator" ); if (m_xAggregate.is()) m_xAggregate->setDelegator(NULL); } @@ -717,6 +727,7 @@ void OControlModel::doResetDelegator() //------------------------------------------------------------------------------ void OControlModel::doSetDelegator() { + // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::doSetDelegator" ); increment(m_refCount); if (m_xAggregate.is()) { @@ -729,12 +740,14 @@ void OControlModel::doSetDelegator() //------------------------------------------------------------------------------ InterfaceRef SAL_CALL OControlModel::getParent() throw(RuntimeException) { + // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::getParent" ); return m_xParent; } //------------------------------------------------------------------------------ void SAL_CALL OControlModel::setParent(const InterfaceRef& _rxParent) throw(com::sun::star::lang::NoSupportException, RuntimeException) { + // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::setParent" ); osl::MutexGuard aGuard(m_aMutex); Reference xComp(m_xParent, UNO_QUERY); @@ -752,6 +765,7 @@ void SAL_CALL OControlModel::setParent(const InterfaceRef& _rxParent) throw(com: //------------------------------------------------------------------------------ ::rtl::OUString SAL_CALL OControlModel::getName() throw(RuntimeException) { + // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::getName" ); ::rtl::OUString aReturn; OPropertySetHelper::getFastPropertyValue(PROPERTY_ID_NAME) >>= aReturn; return aReturn; @@ -760,6 +774,7 @@ void SAL_CALL OControlModel::setParent(const InterfaceRef& _rxParent) throw(com: //------------------------------------------------------------------------------ void SAL_CALL OControlModel::setName(const ::rtl::OUString& _rName) throw(RuntimeException) { + // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::setName" ); setFastPropertyValue(PROPERTY_ID_NAME, makeAny(_rName)); } @@ -767,6 +782,7 @@ void SAL_CALL OControlModel::setName(const ::rtl::OUString& _rName) throw(Runtim //------------------------------------------------------------------------------ sal_Bool SAL_CALL OControlModel::supportsService(const rtl::OUString& _rServiceName) throw ( RuntimeException) { + // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::supportsService" ); Sequence aSupported = getSupportedServiceNames(); const rtl::OUString* pSupported = aSupported.getConstArray(); for (sal_Int32 i=0; i OControlModel::getAggregateServiceNames() { + // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::getAggregateServiceNames" ); Sequence< ::rtl::OUString > aAggServices; Reference< XServiceInfo > xInfo; if ( query_aggregation( m_xAggregate, xInfo ) ) @@ -788,6 +805,7 @@ Sequence< ::rtl::OUString > OControlModel::getAggregateServiceNames() //------------------------------------------------------------------------------ Sequence SAL_CALL OControlModel::getSupportedServiceNames() throw(RuntimeException) { + // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::getSupportedServiceNames" ); return ::comphelper::concatSequences( getAggregateServiceNames(), getSupportedServiceNames_Static() @@ -797,6 +815,7 @@ Sequence SAL_CALL OControlModel::getSupportedServiceNames() throw //------------------------------------------------------------------------------ Sequence< ::rtl::OUString > SAL_CALL OControlModel::getSupportedServiceNames_Static() throw( RuntimeException ) { + // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::getSupportedServiceNames_Static" ); Sequence< ::rtl::OUString > aServiceNames( 2 ); aServiceNames[ 0 ] = FRM_SUN_FORMCOMPONENT; aServiceNames[ 1 ] = ::rtl::OUString::createFromAscii( "com.sun.star.form.FormControlModel" ); @@ -807,6 +826,7 @@ Sequence< ::rtl::OUString > SAL_CALL OControlModel::getSupportedServiceNames_Sta //------------------------------------------------------------------------------ void SAL_CALL OControlModel::disposing(const com::sun::star::lang::EventObject& _rSource) throw (RuntimeException) { + // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::disposing" ); // release the parent if (_rSource.Source == m_xParent) { @@ -828,6 +848,7 @@ void SAL_CALL OControlModel::disposing(const com::sun::star::lang::EventObject& //----------------------------------------------------------------------------- void OControlModel::disposing() { + // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::disposing" ); OPropertySetAggregationHelper::disposing(); Reference xComp; @@ -842,6 +863,7 @@ void OControlModel::disposing() //------------------------------------------------------------------------------ void OControlModel::writeAggregate( const Reference< XObjectOutputStream >& _rxOutStream ) const { + // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::writeAggregate" ); Reference< XPersistObject > xPersist; if ( query_aggregation( m_xAggregate, xPersist ) ) xPersist->write( _rxOutStream ); @@ -850,6 +872,7 @@ void OControlModel::writeAggregate( const Reference< XObjectOutputStream >& _rxO //------------------------------------------------------------------------------ void OControlModel::readAggregate( const Reference< XObjectInputStream >& _rxInStream ) { + // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::readAggregate" ); Reference< XPersistObject > xPersist; if ( query_aggregation( m_xAggregate, xPersist ) ) xPersist->read( _rxInStream ); @@ -859,6 +882,7 @@ void OControlModel::readAggregate( const Reference< XObjectInputStream >& _rxInS void SAL_CALL OControlModel::write(const Reference& _rxOutStream) throw(stario::IOException, RuntimeException) { + // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::write" ); osl::MutexGuard aGuard(m_aMutex); // 1. Schreiben des UnoControls @@ -904,6 +928,7 @@ void SAL_CALL OControlModel::write(const Reference& //------------------------------------------------------------------------------ void OControlModel::read(const Reference& InStream) throw (::com::sun::star::io::IOException, RuntimeException) { + // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::read" ); osl::MutexGuard aGuard(m_aMutex); Reference xMark(InStream, UNO_QUERY); @@ -957,6 +982,7 @@ void OControlModel::read(const Reference& InStream) //------------------------------------------------------------------------------ PropertyState OControlModel::getPropertyStateByHandle( sal_Int32 _nHandle ) { + // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::getPropertyStateByHandle" ); // simply compare the current and the default value Any aCurrentValue = getPropertyDefaultByHandle( _nHandle ); Any aDefaultValue; getFastPropertyValue( aDefaultValue, _nHandle ); @@ -973,6 +999,7 @@ PropertyState OControlModel::getPropertyStateByHandle( sal_Int32 _nHandle ) //------------------------------------------------------------------------------ void OControlModel::setPropertyToDefaultByHandle( sal_Int32 _nHandle) { + // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::setPropertyToDefaultByHandle" ); Any aDefault = getPropertyDefaultByHandle( _nHandle ); Any aConvertedValue, aOldValue; @@ -986,6 +1013,7 @@ void OControlModel::setPropertyToDefaultByHandle( sal_Int32 _nHandle) //------------------------------------------------------------------------------ Any OControlModel::getPropertyDefaultByHandle( sal_Int32 _nHandle ) const { + // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::getPropertyDefaultByHandle" ); Any aReturn; switch ( _nHandle ) { @@ -1018,6 +1046,7 @@ Any OControlModel::getPropertyDefaultByHandle( sal_Int32 _nHandle ) const //------------------------------------------------------------------------------ void OControlModel::getFastPropertyValue( Any& _rValue, sal_Int32 _nHandle ) const { + // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::getFastPropertyValue" ); switch ( _nHandle ) { case PROPERTY_ID_NAME: @@ -1049,6 +1078,7 @@ sal_Bool OControlModel::convertFastPropertyValue( Any& _rConvertedValue, Any& _rOldValue, sal_Int32 _nHandle, const Any& _rValue) throw (com::sun::star::lang::IllegalArgumentException) { + // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::convertFastPropertyValue" ); sal_Bool bModified(sal_False); switch (_nHandle) { @@ -1078,6 +1108,7 @@ sal_Bool OControlModel::convertFastPropertyValue( void OControlModel::setFastPropertyValue_NoBroadcast(sal_Int32 _nHandle, const Any& _rValue) throw (Exception) { + // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::setFastPropertyValue_NoBroadcast" ); switch (_nHandle) { case PROPERTY_ID_NAME: @@ -1110,6 +1141,7 @@ void OControlModel::setFastPropertyValue_NoBroadcast(sal_Int32 _nHandle, const A //------------------------------------------------------------------------------ void OControlModel::describeFixedProperties( Sequence< Property >& _rProps ) const { + // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::describeFixedProperties" ); BEGIN_DESCRIBE_BASE_PROPERTIES( 4 ) DECL_PROP2 (CLASSID, sal_Int16, READONLY, TRANSIENT); DECL_PROP1 (NAME, ::rtl::OUString, BOUND); @@ -1121,6 +1153,7 @@ void OControlModel::describeFixedProperties( Sequence< Property >& _rProps ) con //------------------------------------------------------------------------------ void OControlModel::describeAggregateProperties( Sequence< Property >& /* [out] */ _rAggregateProps ) const { + // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::describeAggregateProperties" ); if ( m_xAggregateSet.is() ) { Reference< XPropertySetInfo > xPSI( m_xAggregateSet->getPropertySetInfo() ); @@ -1132,12 +1165,14 @@ void OControlModel::describeAggregateProperties( Sequence< Property >& /* [out] //------------------------------------------------------------------------------ ::osl::Mutex& OControlModel::getMutex() { + // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::getMutex" ); return m_aMutex; } //------------------------------------------------------------------------------ void OControlModel::describeFixedAndAggregateProperties( Sequence< Property >& _out_rFixedProperties, Sequence< Property >& _out_rAggregateProperties ) const { + // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::describeFixedAndAggregateProperties" ); describeFixedProperties( _out_rFixedProperties ); describeAggregateProperties( _out_rAggregateProperties ); } @@ -1145,42 +1180,49 @@ void OControlModel::describeFixedAndAggregateProperties( Sequence< Property >& _ //------------------------------------------------------------------------------ Reference< XMultiPropertySet > OControlModel::getPropertiesInterface() { + // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::getPropertiesInterface" ); return Reference< XMultiPropertySet >( *this, UNO_QUERY ); } //------------------------------------------------------------------------------ Reference< XPropertySetInfo> SAL_CALL OControlModel::getPropertySetInfo() throw( RuntimeException) { + // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::getPropertySetInfo" ); return createPropertySetInfo( getInfoHelper() ); } //------------------------------------------------------------------------------ ::cppu::IPropertyArrayHelper& OControlModel::getInfoHelper() { + // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::getInfoHelper" ); return m_aPropertyBagHelper.getInfoHelper(); } //-------------------------------------------------------------------- void SAL_CALL OControlModel::addProperty( const ::rtl::OUString& _rName, ::sal_Int16 _nAttributes, const Any& _rInitialValue ) throw (PropertyExistException, IllegalTypeException, IllegalArgumentException, RuntimeException) { + // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::addProperty" ); m_aPropertyBagHelper.addProperty( _rName, _nAttributes, _rInitialValue ); } //-------------------------------------------------------------------- void SAL_CALL OControlModel::removeProperty( const ::rtl::OUString& _rName ) throw (UnknownPropertyException, NotRemoveableException, RuntimeException) { + // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::removeProperty" ); m_aPropertyBagHelper.removeProperty( _rName ); } //-------------------------------------------------------------------- Sequence< PropertyValue > SAL_CALL OControlModel::getPropertyValues() throw (RuntimeException) { + // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::getPropertyValues" ); return m_aPropertyBagHelper.getPropertyValues(); } //-------------------------------------------------------------------- void SAL_CALL OControlModel::setPropertyValues( const Sequence< PropertyValue >& _rProps ) throw (UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException) { + // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::setPropertyValues" ); m_aPropertyBagHelper.setPropertyValues( _rProps ); } @@ -1223,6 +1265,7 @@ Any SAL_CALL OBoundControlModel::queryAggregation( const Type& _rType ) throw (R Any aReturn( OControlModel::queryAggregation(_rType) ); if (!aReturn.hasValue()) { + // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::queryAggregation" ); aReturn = OBoundControlModel_BASE1::queryInterface(_rType); if ( !aReturn.hasValue() && m_bCommitable ) @@ -1468,6 +1511,7 @@ Sequence< Type > OBoundControlModel::_getTypes() //----------------------------------------------------------------------------- void OBoundControlModel::disposing() { + // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::_getTypes" ); OControlModel::disposing(); ::osl::ClearableMutexGuard aGuard(m_aMutex); @@ -1645,6 +1689,7 @@ void SAL_CALL OBoundControlModel::disposing(const com::sun::star::lang::EventObj //------------------------------------------------------------------------------ StringSequence SAL_CALL OBoundControlModel::getSupportedServiceNames() throw(RuntimeException) { + // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::disposing" ); return ::comphelper::concatSequences( getAggregateServiceNames(), getSupportedServiceNames_Static() @@ -1667,6 +1712,7 @@ Sequence< ::rtl::OUString > SAL_CALL OBoundControlModel::getSupportedServiceName //------------------------------------------------------------------------------ void SAL_CALL OBoundControlModel::write( const Reference& _rxOutStream ) throw(stario::IOException, RuntimeException) { + // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::getSupportedServiceNames_Static" ); OControlModel::write(_rxOutStream); osl::MutexGuard aGuard(m_aMutex); @@ -1767,6 +1813,7 @@ void SAL_CALL OBoundControlModel::read( const Reference< stario::XObjectInputStr //------------------------------------------------------------------------------ void OBoundControlModel::getFastPropertyValue(Any& rValue, sal_Int32 nHandle) const { + // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OBoundControlModel::getFastPropertyValue" ); switch (nHandle) { case PROPERTY_ID_INPUT_REQUIRED: @@ -1835,6 +1882,7 @@ sal_Bool OBoundControlModel::convertFastPropertyValue( //------------------------------------------------------------------------------ Any OBoundControlModel::getPropertyDefaultByHandle( sal_Int32 _nHandle ) const { + // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::convertFastPropertyValue" ); Any aDefault; switch ( _nHandle ) { @@ -1942,6 +1990,7 @@ void OBoundControlModel::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, co //------------------------------------------------------------------------------ void SAL_CALL OBoundControlModel::propertyChange( const PropertyChangeEvent& evt ) throw(RuntimeException) { + // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::setFastPropertyValue_NoBroadcast" ); // if the DBColumn value changed, transfer it to the control if ( evt.PropertyName.equals( PROPERTY_VALUE ) ) { diff --git a/forms/source/component/propertybaghelper.cxx b/forms/source/component/propertybaghelper.cxx index 796f683ac1aa..a14aaf6d3ed3 100644 --- a/forms/source/component/propertybaghelper.cxx +++ b/forms/source/component/propertybaghelper.cxx @@ -45,6 +45,9 @@ #include #include +#include +#include "rtl/instance.hxx" + #define NEW_HANDLE_BASE 10000 @@ -93,6 +96,7 @@ namespace frm ,m_pPropertyArrayHelper( NULL ) ,m_bDisposed( false ) { + // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "PropertyBagHelper::PropertyBagHelper" ); } //-------------------------------------------------------------------- @@ -104,12 +108,14 @@ namespace frm //-------------------------------------------------------------------- void PropertyBagHelper::dispose() { + // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "PropertyBagHelper::dispose" ); m_bDisposed = true; } //-------------------------------------------------------------------- void PropertyBagHelper::impl_nts_checkDisposed_throw() const { + // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "PropertyBagHelper::impl_nts_checkDisposed_throw" ); if ( m_bDisposed ) throw DisposedException(); } @@ -117,12 +123,14 @@ namespace frm //-------------------------------------------------------------------- void PropertyBagHelper::impl_nts_invalidatePropertySetInfo() { + // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "PropertyBagHelper::impl_nts_invalidatePropertySetInfo" ); delete m_pPropertyArrayHelper, m_pPropertyArrayHelper = NULL; } //-------------------------------------------------------------------- sal_Int32 PropertyBagHelper::impl_findFreeHandle( const ::rtl::OUString& _rPropertyName ) { + // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "PropertyBagHelper::impl_findFreeHandle" ); ::comphelper::OPropertyArrayAggregationHelper& rPropInfo( impl_ts_getArrayHelper() ); // check the preferred handle @@ -162,29 +170,43 @@ namespace frm //-------------------------------------------------------------------- ::comphelper::OPropertyArrayAggregationHelper& PropertyBagHelper::impl_ts_getArrayHelper() const { - ::osl::MutexGuard aGuard( m_rContext.getMutex() ); - if ( !m_pPropertyArrayHelper ) + // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "PropertyBagHelper::impl_ts_getArrayHelper" ); + //::osl::MutexGuard aGuard( m_rContext.getMutex() ); + OPropertyArrayAggregationHelper* p = m_pPropertyArrayHelper; + if ( !p ) { - // our own fixed and our aggregate's properties - Sequence< Property > aFixedProps; - Sequence< Property > aAggregateProps; - m_rContext.describeFixedAndAggregateProperties( aFixedProps, aAggregateProps ); + ::osl::MutexGuard aGuard( m_rContext.getMutex() ); + p = m_pPropertyArrayHelper; + if ( !p ) + { + // our own fixed and our aggregate's properties + Sequence< Property > aFixedProps; + Sequence< Property > aAggregateProps; + m_rContext.describeFixedAndAggregateProperties( aFixedProps, aAggregateProps ); - // our dynamic properties - Sequence< Property > aDynamicProps; - m_aDynamicProperties.describeProperties( aDynamicProps ); + // our dynamic properties + Sequence< Property > aDynamicProps; + m_aDynamicProperties.describeProperties( aDynamicProps ); - Sequence< Property > aOwnProps( - ::comphelper::concatSequences( aFixedProps, aDynamicProps ) ); + Sequence< Property > aOwnProps( + ::comphelper::concatSequences( aFixedProps, aDynamicProps ) ); - const_cast< PropertyBagHelper* >( this )->m_pPropertyArrayHelper = new OPropertyArrayAggregationHelper( aOwnProps, aAggregateProps, &lcl_getPropertyInfos(), NEW_HANDLE_BASE ); + p = new OPropertyArrayAggregationHelper( aOwnProps, aAggregateProps, &lcl_getPropertyInfos(), NEW_HANDLE_BASE ); + OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER(); + const_cast< PropertyBagHelper* >( this )->m_pPropertyArrayHelper = p; + } + } // if ( !p ) + else + { + OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER(); } - return *m_pPropertyArrayHelper; + return *p; } //-------------------------------------------------------------------- void PropertyBagHelper::addProperty( const ::rtl::OUString& _rName, ::sal_Int16 _nAttributes, const Any& _rInitialValue ) { + // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "PropertyBagHelper::addProperty" ); ::osl::MutexGuard aGuard( m_rContext.getMutex() ); impl_nts_checkDisposed_throw(); @@ -212,6 +234,7 @@ namespace frm //-------------------------------------------------------------------- void PropertyBagHelper::removeProperty( const ::rtl::OUString& _rName ) { + // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "PropertyBagHelper::removeProperty" ); ::osl::MutexGuard aGuard( m_rContext.getMutex() ); impl_nts_checkDisposed_throw(); @@ -260,6 +283,7 @@ namespace frm //-------------------------------------------------------------------- Sequence< PropertyValue > PropertyBagHelper::getPropertyValues() { + // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "PropertyBagHelper::getPropertyValues" ); ::osl::MutexGuard aGuard( m_rContext.getMutex() ); impl_nts_checkDisposed_throw(); @@ -302,6 +326,7 @@ namespace frm //-------------------------------------------------------------------- void PropertyBagHelper::setPropertyValues( const Sequence< PropertyValue >& _rProps ) { + // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "PropertyBagHelper::setPropertyValues" ); ::osl::ClearableMutexGuard aGuard( m_rContext.getMutex() ); impl_nts_checkDisposed_throw(); diff --git a/forms/source/xforms/submission/replace.cxx b/forms/source/xforms/submission/replace.cxx index e0504973f7ac..9c54d6e7164a 100644 --- a/forms/source/xforms/submission/replace.cxx +++ b/forms/source/xforms/submission/replace.cxx @@ -30,8 +30,9 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_forms.hxx" - +#include #include "submission.hxx" +#include "serialization_app_xml.hxx" #include #include @@ -44,11 +45,14 @@ #include #include #include +#include using namespace com::sun::star::uno; +using namespace com::sun::star::ucb; using namespace com::sun::star::frame; using namespace com::sun::star::lang; using namespace com::sun::star::beans; +using namespace com::sun::star::task; using namespace com::sun::star::xml::dom; CSubmission::SubmissionResult CSubmission::replace(const ::rtl::OUString& aReplace, const Reference& aDocument, const Reference& aFrame) @@ -116,5 +120,29 @@ CSubmission::SubmissionResult CSubmission::replace(const ::rtl::OUString& aRepla } return CSubmission::UNKNOWN_ERROR; } +::std::auto_ptr< CSerialization > CSubmission::createSerialization(const Reference< XInteractionHandler >& _xHandler,Reference& _rOutEnv) +{ + // PUT always uses application/xml + ::std::auto_ptr< CSerialization > apSerialization(new CSerializationAppXML()); + apSerialization->setSource(m_aFragment); + apSerialization->serialize(); + + // create a commandEnvironment and use the default interaction handler + CCommandEnvironmentHelper *pHelper = new CCommandEnvironmentHelper; + if( _xHandler.is() ) + pHelper->m_aInteractionHandler = _xHandler; + else + pHelper->m_aInteractionHandler = CSS::uno::Reference< XInteractionHandler >(m_aFactory->createInstance( + ::rtl::OUString::createFromAscii("com.sun.star.task.InteractionHandler")), UNO_QUERY); + OSL_ENSURE(pHelper->m_aInteractionHandler.is(), "failed to create IntreractionHandler"); + + CProgressHandlerHelper *pProgressHelper = new CProgressHandlerHelper; + pHelper->m_aProgressHandler = Reference< XProgressHandler >(pProgressHelper); + + // UCB has ownership of environment... + _rOutEnv = pHelper; + return apSerialization; +} + diff --git a/forms/source/xforms/submission/submission.hxx b/forms/source/xforms/submission/submission.hxx index a435d7c7fc15..c146282903c4 100644 --- a/forms/source/xforms/submission/submission.hxx +++ b/forms/source/xforms/submission/submission.hxx @@ -35,12 +35,14 @@ #include #include #include +#include #include #include #include #include #include #include +#include #include #include @@ -66,10 +68,12 @@ class CCommandEnvironmentHelper : public cppu::WeakImplHelper1< CSS::ucb::XComma friend class CSubmissionPut; friend class CSubmissionPost; friend class CSubmissionGet; + friend class CSubmission; protected: - CSS::uno::Reference< CSS::task::XInteractionHandler > m_aInteractionHandler; - CSS::uno::Reference< CSS::ucb::XProgressHandler > m_aProgressHandler; + CSS::uno::Reference< CSS::task::XInteractionHandler > m_aInteractionHandler; + CSS::uno::Reference< CSS::ucb::XProgressHandler > m_aProgressHandler; + public: virtual CSS::uno::Reference< CSS::task::XInteractionHandler > SAL_CALL getInteractionHandler() throw (CSS::uno::RuntimeException) { @@ -118,11 +122,15 @@ class CSubmission protected: INetURLObject m_aURLObj; - CSS::uno::Reference< CSS::xml::xpath::XXPathObject > m_aXPathObject; + CSS::uno::Reference< CSS::xml::xpath::XXPathObject > m_aXPathObject; CSS::uno::Reference< CSS::xml::dom::XDocumentFragment > m_aFragment; - CSS::uno::Reference< CSS::io::XInputStream > m_aResultStream; + CSS::uno::Reference< CSS::io::XInputStream > m_aResultStream; + CSS::uno::Reference< CSS::lang::XMultiServiceFactory > m_aFactory; rtl::OUString m_aEncoding; + ::std::auto_ptr< CSerialization > createSerialization(const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& aHandler + ,com::sun::star::uno::Reference& _rOutEnv); + public: enum SubmissionResult { SUCCESS, @@ -136,6 +144,7 @@ public: CSubmission(const rtl::OUString& aURL, const CSS::uno::Reference< CSS::xml::dom::XDocumentFragment >& aFragment) : m_aURLObj(aURL) , m_aFragment(aFragment) + , m_aFactory(::utl::getProcessServiceFactory()) {} virtual ~CSubmission() {} diff --git a/forms/source/xforms/submission/submission_get.cxx b/forms/source/xforms/submission/submission_get.cxx index 9ca195be946f..c310be9fc82f 100644 --- a/forms/source/xforms/submission/submission_get.cxx +++ b/forms/source/xforms/submission/submission_get.cxx @@ -55,7 +55,6 @@ using namespace std; CSubmissionGet::CSubmissionGet(const rtl::OUString& aURL, const CSS::uno::Reference< CSS::xml::dom::XDocumentFragment >& aFragment) : CSubmission(aURL, aFragment) - , m_aFactory(utl::getProcessServiceFactory()) { } diff --git a/forms/source/xforms/submission/submission_post.cxx b/forms/source/xforms/submission/submission_post.cxx index 53047c7036e9..8142fec3df05 100644 --- a/forms/source/xforms/submission/submission_post.cxx +++ b/forms/source/xforms/submission/submission_post.cxx @@ -55,29 +55,14 @@ using namespace std; CSubmissionPost::CSubmissionPost(const rtl::OUString& aURL, const CSS::uno::Reference< CSS::xml::dom::XDocumentFragment >& aFragment) : CSubmission(aURL, aFragment) - , m_aFactory(utl::getProcessServiceFactory()) { } CSubmission::SubmissionResult CSubmissionPost::submit(const CSS::uno::Reference< CSS::task::XInteractionHandler >& aInteractionHandler) { // PUT always uses application/xml - auto_ptr< CSerialization > apSerialization(new CSerializationAppXML()); - apSerialization->setSource(m_aFragment); - apSerialization->serialize(); - - // create a commandEnvironment and use the default interaction handler - CCommandEnvironmentHelper *pHelper = new CCommandEnvironmentHelper; - if( aInteractionHandler.is() ) - pHelper->m_aInteractionHandler = aInteractionHandler; - else - pHelper->m_aInteractionHandler = CSS::uno::Reference< XInteractionHandler >(m_aFactory->createInstance( - OUString::createFromAscii("com.sun.star.task.InteractionHandler")), UNO_QUERY); - OSL_ENSURE(pHelper->m_aInteractionHandler.is(), "failed to create IntreractionHandler"); - CProgressHandlerHelper *pProgressHelper = new CProgressHandlerHelper; - pHelper->m_aProgressHandler = CSS::uno::Reference< XProgressHandler >(pProgressHelper); - // UCB has ownership of environment... - CSS::uno::Reference< XCommandEnvironment > aEnvironment(pHelper); + CSS::uno::Reference< XCommandEnvironment > aEnvironment; + auto_ptr< CSerialization > apSerialization(createSerialization(aInteractionHandler,aEnvironment)); try { ucbhelper::Content aContent(m_aURLObj.GetMainURL(INetURLObject::NO_DECODE), aEnvironment); diff --git a/forms/source/xforms/submission/submission_post.hxx b/forms/source/xforms/submission/submission_post.hxx index d812c0bec858..a3c109033664 100644 --- a/forms/source/xforms/submission/submission_post.hxx +++ b/forms/source/xforms/submission/submission_post.hxx @@ -31,14 +31,10 @@ #ifndef __SUBMISSION_POST_HXX #define __SUBMISSION_POST_HXX -#include - #include "submission.hxx" class CSubmissionPost : public CSubmission { -private: - CSS::uno::Reference< CSS::lang::XMultiServiceFactory > m_aFactory; public: CSubmissionPost(const rtl::OUString& aURL, const CSS::uno::Reference< CSS::xml::dom::XDocumentFragment >& aFragment); virtual SubmissionResult submit(const CSS::uno::Reference< CSS::task::XInteractionHandler >& aInteractionHandler); diff --git a/forms/source/xforms/submission/submission_put.cxx b/forms/source/xforms/submission/submission_put.cxx index 50d80880b07a..10bc0e2b0896 100644 --- a/forms/source/xforms/submission/submission_put.cxx +++ b/forms/source/xforms/submission/submission_put.cxx @@ -53,31 +53,13 @@ using namespace std; CSubmissionPut::CSubmissionPut(const rtl::OUString& aURL, const CSS::uno::Reference< CSS::xml::dom::XDocumentFragment >& aFragment) : CSubmission(aURL, aFragment) - , m_aFactory(utl::getProcessServiceFactory()) { } CSubmission::SubmissionResult CSubmissionPut::submit(const CSS::uno::Reference< CSS::task::XInteractionHandler >& aInteractionHandler) { - // PUT always uses application/xml - auto_ptr< CSerialization > apSerialization(new CSerializationAppXML()); - apSerialization->setSource(m_aFragment); - apSerialization->serialize(); - - // create a commandEnvironment and use the default interaction handler - CCommandEnvironmentHelper *pHelper = new CCommandEnvironmentHelper; - if( aInteractionHandler.is() ) - pHelper->m_aInteractionHandler = aInteractionHandler; - else - pHelper->m_aInteractionHandler = CSS::uno::Reference< XInteractionHandler >(m_aFactory->createInstance( - OUString::createFromAscii("com.sun.star.task.InteractionHandler")), UNO_QUERY); - OSL_ENSURE(pHelper->m_aInteractionHandler.is(), "failed to create IntreractionHandler"); - - CProgressHandlerHelper *pProgressHelper = new CProgressHandlerHelper; - pHelper->m_aProgressHandler = CSS::uno::Reference< XProgressHandler >(pProgressHelper); - - // UCB has ownership of environment... - CSS::uno::Reference< XCommandEnvironment > aEnvironment(pHelper); + CSS::uno::Reference< XCommandEnvironment > aEnvironment; + auto_ptr< CSerialization > apSerialization(createSerialization(aInteractionHandler,aEnvironment)); try { ucbhelper::Content aContent(m_aURLObj.GetMainURL(INetURLObject::NO_DECODE), aEnvironment); diff --git a/forms/source/xforms/submission/submission_put.hxx b/forms/source/xforms/submission/submission_put.hxx index da95f926ebaf..3bf3d2fd92a1 100644 --- a/forms/source/xforms/submission/submission_put.hxx +++ b/forms/source/xforms/submission/submission_put.hxx @@ -38,8 +38,6 @@ class CSubmissionPut : public CSubmission { -private: - CSS::uno::Reference< CSS::lang::XMultiServiceFactory > m_aFactory; public: CSubmissionPut(const rtl::OUString& aURL, const CSS::uno::Reference< CSS::xml::dom::XDocumentFragment >& aFragment); virtual SubmissionResult submit(const CSS::uno::Reference< CSS::task::XInteractionHandler >& aInteractionHandler); -- cgit From 65d3b7eea08aeb5bb6b510d683a1de602fc856cc Mon Sep 17 00:00:00 2001 From: Kurt Zenker Date: Wed, 3 Jun 2009 11:26:39 +0000 Subject: CWS-TOOLING: integrate CWS os128 2009-04-22 12:58:26 +0200 b_michaelsen r271093 : #i101084# using the frames enumeration for other SwXFrames-queries; also added a complex test to ensure the behavior to be the same 2009-04-20 14:53:03 +0200 mav r270987 : #i101219# adjust the testcases to test memory cache and temporary file cache 2009-04-20 14:52:09 +0200 mav r270986 : #i101219#,#i99077# use memory to cache data; no precopying on commit 2009-04-20 14:39:21 +0200 mav r270984 : #i101219# use memory to cache data 2009-04-20 14:39:08 +0200 mav r270983 : #i101219# use memory to cache data 2009-04-20 14:38:45 +0200 mav r270982 : #i101219# use memory to cache data 2009-04-17 07:37:52 +0200 os r270912 : CWS-TOOLING: rebase CWS os128 to trunk@270723 (milestone: DEV300:m46) 2009-04-15 14:54:18 +0200 b_michaelsen r270845 : #i101084# using frame enumerations for paragraph export for better performance 2009-04-15 14:52:54 +0200 b_michaelsen r270843 : #i101084# implemented XEnumerationAccess interface on framesets 2009-04-03 17:08:10 +0200 mav r270504 : #i100722# do not compress streams of known compressed types per default 2009-04-03 13:49:50 +0200 os r270484 : resync error fixed 2009-04-03 12:55:32 +0200 mav r270470 : #i100722# do not compress streams of known compressed types per default 2009-04-03 10:00:58 +0200 os r270463 : resync error fixed 2009-04-03 09:52:53 +0200 os r270462 : resync error fixed 2009-04-03 09:10:14 +0200 os r270449 : #i99568# string compare operator of hash_map changed 2009-04-03 09:03:49 +0200 os r270446 : #i100683# normalize file URLs 2009-04-02 11:09:27 +0200 os r270381 : #i100683# making URLs relative without file access 2009-04-02 09:04:42 +0200 os r270366 : CWS-TOOLING: rebase CWS os128 to trunk@270033 (milestone: DEV300:m45) 2009-03-31 08:08:37 +0200 os r270258 : #i100683# reducing calls to URIHelper::simpleNormalizeMakeRelative() 2009-03-19 17:06:22 +0100 os r269756 : #i99568# XTolerantMultiPropertySet activated 2009-03-16 11:46:14 +0100 os r269517 : wrong commit to #i97471# removed 2009-03-16 11:36:50 +0100 os r269514 : #i97471# SwDrawTextShell::Init(): mouse double click and key input in group objects at the same time: prevent crash 2009-03-13 11:08:54 +0100 os r269464 : #i99568# static SfxItemPropertySet 2009-03-13 11:03:22 +0100 os r269463 : #i99568# static SfxItemPropertySet 2009-03-11 12:59:27 +0100 os r269320 : #i99568# WhichId of properties handled from ScDocOptionsObj added 2009-03-06 09:09:58 +0100 os r268972 : #i99568# SfxItemPropertySet improvements 2009-03-05 20:54:43 +0100 os r268942 : #i99568# Sfx/SvxItemPropertySet improvements 2009-03-05 20:19:52 +0100 os r268941 : #i99568# SfxItemPropertySet improvements 2009-03-05 20:05:03 +0100 os r268940 : #i99568# SfxItemPropertySet improvements 2009-03-05 18:54:47 +0100 os r268936 : #i99568# Sfx/SvxItemPropertySet improvements 2009-03-05 17:51:38 +0100 os r268931 : #i99568# Sfx/SvxItemPropertySet improvements 2009-03-05 17:33:03 +0100 os r268930 : #i99568# Sfx/SvxItemPropertySet improvements 2009-03-05 15:53:00 +0100 os r268920 : #i99568# Sfx/SvxItemPropertySet improvements 2009-03-05 15:52:50 +0100 os r268919 : #i99568# Sfx/SvxItemPropertySet improvements 2009-03-05 15:50:41 +0100 os r268918 : #i99568# Sfx/SvxItemPropertySet improvements 2009-03-05 15:41:04 +0100 os r268916 : #i99568# Sfx/SvxItemPropertySet improvements 2009-03-05 15:40:40 +0100 os r268915 : #i99568# Sfx/SvxItemPropertySet improvements 2009-03-05 10:16:20 +0100 os r268881 : #i99568# Sfx/SvxItemPropertySet improvements 2009-03-05 10:15:55 +0100 os r268880 : #i99568# Sfx/SvxItemPropertySet improvements 2009-03-03 08:40:09 +0100 os r268704 : ScTableSheetObj::GetItemPropertyMap fixed 2009-03-03 07:50:00 +0100 os r268703 : SfxItemProperty set as pointer 2009-03-03 07:49:46 +0100 os r268702 : SfxItemProperty set as pointer 2009-03-02 08:15:37 +0100 os r268631 : minor fix 2009-03-02 07:58:38 +0100 os r268630 : minor fix 2009-02-27 13:03:25 +0100 os r268584 : exports 2009-02-27 11:17:04 +0100 os r268567 : debug code removed 2009-02-27 11:04:07 +0100 os r268565 : duplicate return removed 2009-02-27 10:17:37 +0100 os r268558 : syntax fixed 2009-02-27 09:56:14 +0100 os r268554 : #i99568# type mix fixed 2009-02-27 09:40:56 +0100 os r268553 : #i99568# exports changes reverted 2009-02-25 12:50:54 +0100 os r268433 : #i99568# SfxItemPropertySet rework 2009-02-25 12:13:39 +0100 os r268432 : #i99568# SfxItemPropertySet rework 2009-02-25 12:12:47 +0100 os r268431 : #i99568# SfxItemPropertySet rework 2009-02-25 12:10:27 +0100 os r268430 : #i99568# SfxItemPropertySet rework 2009-02-25 12:09:36 +0100 os r268429 : #i99568# SfxItemPropertySet rework 2009-02-25 12:07:39 +0100 os r268428 : #i99568# SfxItemPropertySet rework 2009-02-25 11:59:35 +0100 os r268427 : #i99568# SfxItemPropertySet rework 2009-02-25 11:52:52 +0100 os r268425 : #i99568# SfxItemPropertySet rework 2009-02-25 11:49:17 +0100 os r268424 : #i99568# SfxItemPropertySet rework 2009-02-25 11:45:17 +0100 os r268423 : #i99568# SfxItemPropertySet rework 2009-02-11 11:39:04 +0100 os r267587 : #i57008# use registration of index marks at SwUnoCallback --- forms/source/richtext/richtextunowrapper.cxx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'forms') diff --git a/forms/source/richtext/richtextunowrapper.cxx b/forms/source/richtext/richtextunowrapper.cxx index 13da356d0ad3..f5a9d178d32c 100644 --- a/forms/source/richtext/richtextunowrapper.cxx +++ b/forms/source/richtext/richtextunowrapper.cxx @@ -37,6 +37,7 @@ /** === end UNO includes === **/ #include #include +#include //........................................................................ namespace frm @@ -51,10 +52,10 @@ namespace frm //==================================================================== namespace { - const SfxItemPropertyMap* getTextEnginePropertyMap() + const SvxItemPropertySet* getTextEnginePropertySet() { // Propertymap fuer einen Outliner Text - static const SfxItemPropertyMap aTextEnginePropertyMap[] = + static const SfxItemPropertyMapEntry aTextEnginePropertyMap[] = { SVX_UNOEDIT_CHAR_PROPERTIES, SVX_UNOEDIT_FONT_PROPERTIES, @@ -63,8 +64,8 @@ namespace frm { MAP_CHAR_LEN("ParaUserDefinedAttributes"), EE_PARA_XMLATTRIBS, &::getCppuType( static_cast< const Reference< XNameContainer >* >( NULL ) ), 0, 0 }, { NULL, 0, 0, NULL, 0, 0 } }; - - return aTextEnginePropertyMap; + static SvxItemPropertySet aTextEnginePropertySet( aTextEnginePropertyMap ); + return &aTextEnginePropertySet; } } @@ -73,7 +74,7 @@ namespace frm //==================================================================== //-------------------------------------------------------------------- ORichTextUnoWrapper::ORichTextUnoWrapper( EditEngine& _rEngine, IEngineTextChangeListener* _pTextChangeListener ) - :SvxUnoText( getTextEnginePropertyMap() ) + :SvxUnoText( getTextEnginePropertySet() ) { SetEditSource( new RichTextEditSource( _rEngine, _pTextChangeListener ) ); } -- cgit From f69c97860cc62e2aad46e9cfb68a643817e8ad4a Mon Sep 17 00:00:00 2001 From: Kurt Zenker Date: Fri, 5 Jun 2009 09:47:55 +0000 Subject: CWS-TOOLING: integrate CWS dba32b 2009-06-03 14:58:08 +0200 fs r272581 : #i102439# 2009-05-29 13:56:18 +0200 fs r272456 : remove the sub form when the 'add subform' setting changes from to , not only its controls 2009-05-29 13:19:27 +0200 fs r272454 : display '(Default)' instead of an empty string when a control has the default font 2009-05-28 20:49:18 +0200 fs r272428 : #i98162# getFirstSelectedValue: do not return reference to a temporary 2009-05-27 15:30:22 +0200 msc r272353 : #102303# 2009-05-26 13:03:06 +0200 fs r272295 : spelling 2009-05-26 12:59:54 +0200 fs r272294 : merge m48 version to get latest cygwin related fixes 2009-05-25 14:02:06 +0200 fs r272239 : remove references to local files, needed for debugging sessions only 2009-05-25 14:01:16 +0200 fs r272238 : #i102021# ensure members such as bNumberFormat are initialized before actually returning them 2009-05-25 13:10:20 +0200 fs r272236 : #i10000# reset ENABLE_EVOAB2 2009-05-22 06:44:45 +0200 oj r272167 : #i99104# add import handler for calc-sett 2009-05-22 06:42:27 +0200 oj r272166 : #i99104# impl NullDate as member 2009-05-22 06:36:22 +0200 oj r272165 : #i99104# handle nulldate from parent model 2009-05-22 06:33:13 +0200 oj r272164 : #i99104# export and import calculation-settings and nulldate 2009-05-22 06:27:50 +0200 oj r272163 : #i99104# export and import calculation-settings and nulldate 2009-05-20 13:29:58 +0200 oj r272118 : #i99911# handle invalid name 2009-05-20 13:28:49 +0200 oj r272117 : #i101261# handle different rowsets 2009-05-20 11:29:55 +0200 msc r272111 : #i100000# 2009-05-20 11:28:27 +0200 msc r272110 : merge in change from dba32a 2009-05-20 11:27:38 +0200 msc r272109 : #102082# CTRL + C does not work 2009-05-20 09:43:36 +0200 oj r272106 : clean up includes 2009-05-20 09:32:15 +0200 oj r272105 : #i99060# merge error resovled now VERTICAL_ALIGN is in both stmt 2009-05-20 08:37:21 +0200 msc r272104 : add workaround for issue #102010# 2009-05-20 08:10:12 +0200 oj r272103 : #i99104# use numberformatkey 2009-05-20 08:07:02 +0200 oj r272102 : #i99104# use column info from rowset 2009-05-20 08:04:43 +0200 oj r272101 : #i102032# use a special column type where prec and scale are the values currently set at the column 2009-05-20 08:03:04 +0200 oj r272100 : #i102032# correct type info, we have to use SQL defined type names 2009-05-19 10:27:02 +0200 oj r272061 : #i99104# export null-date 2009-05-19 08:26:53 +0200 oj r272056 : #i99104# export null-date 2009-05-18 13:15:10 +0200 msc r272014 : add issue #102019# 2009-05-18 11:33:07 +0200 msc r272005 : add issue #102019# 2009-05-18 08:59:45 +0200 msc r271996 : add workaroud for issue #102010# 2009-05-15 10:21:24 +0200 msc r271929 : #101944# 2009-05-11 21:18:30 +0200 fs r271792 : #i99914# 2009-05-08 13:52:06 +0200 oj r271715 : #i96423# remember column span 2009-05-08 11:26:19 +0200 oj r271708 : #i98605# impl new scale mode 2009-05-08 10:33:35 +0200 fs r271706 : SendUserCall: only call into the shape notification routine for UserCall types where this is necessary (performance issue) 2009-05-07 20:52:44 +0200 fs r271698 : outsource ShapeProperty from shapepropertynotifier.hxx 2009-05-07 20:43:33 +0200 fs r271697 : #i99056# use notifyShapePropertyChange, instead of getShapePropertyChangeNotifier - the latter throws if no shape exists, yet 2009-05-07 20:33:58 +0200 fs r271696 : #i99056# +notifyShapePropertyChange: allow notifying chages without checking whether there actually already exists an SvxShape 2009-05-07 16:22:15 +0200 fs r271679 : #i10000# cygwin needs quotes around the classpath 2009-05-07 16:21:37 +0200 fs r271678 : #i10000# cygwin needs quotes around the classpath 2009-05-07 16:01:11 +0200 oj r271677 : #i99914# notify parent handler 2009-05-07 15:54:54 +0200 fs r271676 : #i10000# cygwin needs some quoting 2009-05-07 14:49:48 +0200 oj r271672 : #i99277# quote alias name 2009-05-07 14:48:12 +0200 oj r271671 : #i92538# add ~ in front of type 2009-05-07 14:37:13 +0200 oj r271667 : #i99118# change type from char to varchar 2009-05-07 14:36:23 +0200 oj r271666 : #i99118# clear dest columns when changing to create new table 2009-05-07 13:35:32 +0200 oj r271657 : #i94467# handle type 0 as double as well 2009-05-07 13:20:49 +0200 oj r271655 : i99743# setNull when varchar is no text 2009-05-07 12:58:06 +0200 fs r271651 : initialize the SdrObject's property change notifier after the ctor, if necessary 2009-05-07 11:47:18 +0200 fs r271647 : #i10000# 2009-05-07 10:57:16 +0200 fs r271639 : OPropertyBrowserController::propertyChange: care for the current property state, too, and properly forward it to the UI 2009-05-07 10:18:14 +0200 fs r271636 : onNewComponent: do not ask the map for grid columns, it will throw 2009-05-07 10:09:55 +0200 fs r271634 : #i101623# 2009-05-07 09:53:44 +0200 fs r271631 : #i101622# 2009-05-06 21:55:53 +0200 fs r271615 : #i10000# 2009-05-06 21:10:42 +0200 fs r271611 : #i10000# 2009-05-06 13:11:48 +0200 fs r271583 : #i10000# 2009-05-05 22:29:31 +0200 fs r271559 : proper assertion message 2009-05-05 22:29:03 +0200 fs r271558 : diagnostics 2009-05-05 22:16:16 +0200 fs r271557 : #i10000# 2009-05-05 13:50:32 +0200 fs r271513 : #i10000# 2009-05-05 10:21:50 +0200 fs r271503 : #i10000# 2009-05-05 09:30:26 +0200 fs r271501 : why did those survive the rebase -C step? 2009-05-05 09:18:12 +0200 fs r271500 : #i10000# 2009-05-04 17:08:17 +0200 fs r271475 : CWS-TOOLING: rebase CWS dba32b to trunk@271427 (milestone: DEV300:m47) 2009-05-04 14:51:26 +0200 fs r271456 : line ends 2009-04-30 15:55:27 +0200 fs r271418 : NewURL -> PublicConnectionURL 2009-04-22 21:18:34 +0200 fs r271141 : #i100944# 2009-04-22 09:12:26 +0200 oj r271071 : #i101261# little code change 2009-04-22 09:11:43 +0200 oj r271070 : #i101261# only ask for parameters which aren't set before 2009-04-22 09:11:25 +0200 oj r271069 : #i101261# new grabage container for nodes 2009-04-22 09:11:02 +0200 oj r271068 : #i101261# new grabage container for nodes 2009-04-22 09:10:44 +0200 oj r271067 : #i101261# new grabage container for nodes 2009-04-22 09:10:21 +0200 oj r271066 : #i101261# only ask for parameters which aren't set before 2009-04-22 09:08:24 +0200 oj r271065 : #i101261# only ask for parameters which aren't set before 2009-04-22 09:07:25 +0200 oj r271064 : #i101261# only ask for parameters which aren't set before 2009-04-22 08:49:07 +0200 oj r271062 : #i77501# preview only when needed 2009-04-22 08:45:44 +0200 oj r271061 : #i101261# new prop max rows 2009-04-22 08:44:18 +0200 oj r271060 : #i101261# create dataprovider earlier to avoid the wrong legend in chart 2009-04-22 08:42:48 +0200 oj r271059 : #i101261# handle parameter 2009-04-17 21:00:23 +0200 fs r270954 : #i98350# 2009-04-17 13:54:19 +0200 fs r270942 : #i99565# 2009-04-17 13:51:34 +0200 fs r270940 : #i101153# only localize the (potentially) localizable properties when there really is support at the control model 2009-04-17 11:43:14 +0200 fs r270932 : removed superfluous include 2009-04-17 10:10:15 +0200 fs r270926 : #i10000# 2009-04-17 10:02:36 +0200 fs r270925 : #i10000# 2009-04-17 09:15:13 +0200 fs r270918 : #i99056# some more refactoring of the recently introduced property change notification mechanism for UNO shapes 2009-04-17 09:14:56 +0200 fs r270917 : #i99056# some more refactoring of the recently introduced property change notification mechanism for UNO shapes 2009-04-17 09:13:25 +0200 fs r270915 : #i99056# some more refactoring of the recently introduced property change notification mechanism for UNO shapes 2009-04-17 08:30:34 +0200 fs r270914 : removed unotools/servicehelper.hxx in favour of the (duplicated) comphelper/servicehelper.hxx 2009-04-16 21:05:25 +0200 fs r270903 : #i10000# 2009-04-16 20:43:43 +0200 fs r270902 : #i99056# shape notification outsourced to the SdrObject, this is what all other shape implementations (which only aggregate an SvxShape) have access to, too 2009-04-16 15:57:36 +0200 fs r270891 : #i99056# make SetUnoControlModel virtual 2009-04-16 15:44:02 +0200 fs r270890 : #i99056# let the ScShapeObj notify changes in its Anchor property 2009-04-16 15:36:47 +0200 fs r270889 : #i99056# enable the sheet anchor type property, too 2009-04-16 15:33:45 +0200 fs r270887 : #i99056# shape notification outsourced to the SdrObject, this is what all other shape implementations (which only aggregate an SvxShape) have access to, too 2009-04-15 14:53:13 +0200 fs r270844 : #i10000# 2009-04-15 13:08:29 +0200 fs r270836 : #i10000# 2009-04-15 12:28:14 +0200 fs r270832 : #i10000# 2009-04-15 10:59:14 +0200 fs r270827 : #i10000# 2009-04-15 09:41:08 +0200 oj r270823 : fix issues found with findbugs and pmd 2009-04-14 21:08:04 +0200 fs r270808 : #i99056# implement SheetAnchorType - now the only thing missing to enable it is the proper notification when it is modified 2009-04-14 17:09:00 +0200 fs r270799 : #i99056# implement XServiceInfo for the ScShapeObj 2009-04-14 17:07:55 +0200 fs r270798 : #i99056# implement TextAnchorType, partially implement SheetAnchorType 2009-04-14 15:54:05 +0200 fs r270786 : #i99056# SwXShape: notify changes of the AnchorType property 2009-04-14 15:47:32 +0200 fs r270785 : #i99056# deliver shapepropertynotifier.hxx 2009-04-14 15:46:54 +0200 fs r270784 : diagnostics 2009-04-14 15:08:28 +0200 fs r270781 : #i99056# outsourced the SvxShape's property change notification code into a dedicated class 2009-04-14 14:41:09 +0200 fs r270773 : #i99056# outsourced the SvxShape's property change notification code into a dedicated class 2009-04-14 14:37:23 +0200 fs r270772 : in dtor, remove the properties from the temporary component context 2009-04-14 14:36:34 +0200 fs r270771 : getWeakUnoShape made const 2009-04-14 12:23:08 +0200 oj r270757 : #i101064# add missing braces 2009-04-14 12:21:25 +0200 oj r270756 : #i101065# add braces for gcc 4.3.2 2009-04-14 12:17:45 +0200 oj r270755 : #i101059# add dep for manifest 2009-04-09 12:06:58 +0200 oj r270686 : #i93100# use OptimalSize from control to get height 2009-04-08 09:56:55 +0200 oj r270619 : #i92537# handle calculations in the select columns as well 2009-04-08 09:30:39 +0200 oj r270615 : #i96657# throw error message when the key doesn't have any columns 2009-04-07 12:08:26 +0200 oj r270592 : #i77501# impl preview of the executed report 2009-04-07 12:01:56 +0200 oj r270591 : #i77501# impl preview of the executed report 2009-04-07 11:41:03 +0200 oj r270590 : #i77501# impl preview of the executed report 2009-04-07 11:39:32 +0200 oj r270589 : #i77501# impl preview of the executed report 2009-04-07 11:29:25 +0200 oj r270588 : #i77501# convert dos to unix lineends 2009-04-07 11:28:23 +0200 oj r270587 : #i77501# impl preview of the executed report 2009-04-07 11:16:50 +0200 oj r270586 : #i77501# impl preview of the executed report 2009-04-07 11:16:00 +0200 oj r270585 : #i77501# impl preview of the executed report 2009-04-07 11:15:44 +0200 oj r270584 : #i77501# impl preview of the executed report 2009-04-07 11:15:28 +0200 oj r270583 : #i77501# impl preview of the executed report 2009-04-07 11:15:04 +0200 oj r270582 : #i77501# impl preview of the executed report 2009-04-06 15:38:54 +0200 fs r270559 : merge changes from CWS dba32a herein 2009-04-03 15:56:16 +0200 fs r270494 : ImpSvMEdit::Resize: do multiple iterations, if necessary 2009-04-03 14:35:49 +0200 fs r270487 : #i10000# 2009-04-03 13:17:16 +0200 fs r270476 : #i99056# display geometry information for controls, too 2009-04-03 13:16:37 +0200 fs r270475 : #i99056# better ordering of the geometry properties 2009-04-03 13:16:07 +0200 fs r270473 : #i99056# now that SvxShape supports property change listeners, forward add/remove requests to it 2009-04-03 13:13:18 +0200 fs r270472 : #i99056# at SvxShape, allow for PropertyChangeListeners for Size/Position 2009-04-03 09:29:27 +0200 oj r270456 : #i94571# use correct prop name 2009-04-03 09:14:54 +0200 fs r270451 : merge changes from CWS dba32a herein 2009-04-02 17:00:51 +0200 fs r270424 : better diagnostics 2009-04-02 16:35:19 +0200 fs r270421 : diagnostics 2009-04-02 16:34:50 +0200 fs r270420 : #i99056# mxUnoShape not accessible anymore, use impl_setUnoShape instead 2009-04-02 16:32:48 +0200 fs r270419 : #i99056# make getUnoShape cheaper: keep the pointer to the SvxShape all the time, so there's no need to ask for it in getUnoShape. As a consequence, we will later be able to use the pointer in scenarious where performance (potentially) matters 2009-04-02 16:31:13 +0200 fs r270417 : merge changes from CWS dba32a herein 2009-04-02 16:23:16 +0200 fs r270414 : merge changes from CWS dba32a herein 2009-04-02 14:10:35 +0200 fs r270405 : #i10000# 2009-04-02 14:06:26 +0200 fs r270404 : merge changes from CWS dba32a herein 2009-04-02 14:03:03 +0200 fs r270401 : #i10000# 2009-04-02 13:58:13 +0200 fs r270400 : #i10000# 2009-04-02 12:59:44 +0200 fs r270397 : merge changes from CWS dba32a herein 2009-04-02 12:46:30 +0200 fs r270396 : #i99056# let the form page maintain a mapping between control models and control shapes 2009-04-02 12:44:07 +0200 fs r270395 : merge changes from CWS dba32a herein 2009-04-02 12:42:06 +0200 fs r270394 : merge changes from CWS dba32a herein 2009-04-02 12:35:20 +0200 fs r270393 : #i10000# precompiled header 2009-04-02 12:05:31 +0200 fs r270392 : merge changes from CWS dba32a herein 2009-04-02 12:00:42 +0200 fs r270391 : merge changes from CWS dba32a herein 2009-04-02 11:47:26 +0200 fs r270390 : merge changes from CWS dba32a herein 2009-04-02 11:39:15 +0200 oj r270389 : #i94467# foxpro impl several new types 2009-04-02 11:35:58 +0200 fs r270387 : merge changes from CWS dba32a herein 2009-04-01 14:10:51 +0200 fs r270329 : merge changes from CWS dba32a herein 2009-03-31 17:29:50 +0200 fs r270290 : merge changes from CWS dba32a herein 2009-03-30 14:53:56 +0200 fs r270233 : #i100417# don't set grid column widths to 0, but to 2009-03-30 12:31:03 +0200 oj r270213 : #i100552# wrong orb used 2009-03-30 12:19:20 +0200 oj r270212 : #i98303# convertlike corrected to sal_Unicode 2009-03-30 11:58:25 +0200 fs r270210 : merge changes from CWS dba32a herein 2009-03-30 11:38:16 +0200 oj r270205 : remove duplicate code from merge 2009-03-30 11:02:27 +0200 fs r270202 : merge changes from CWS dba32a herein 2009-03-30 11:02:19 +0200 fs r270201 : merge changes from CWS dba32a herein 2009-03-30 10:31:26 +0200 oj r270200 : #i100665# only throw exception and do not drop table 2009-03-30 09:36:24 +0200 fs r270195 : assertion text 2009-03-28 20:21:58 +0100 fs r270187 : #ii10000# 2009-03-28 20:19:54 +0100 fs r270186 : removed unused help ids 2009-03-28 20:19:40 +0100 fs r270185 : removed unused help ids 2009-03-28 20:19:10 +0100 fs r270184 : #i100237# +DefaultState/XReset 2009-03-28 00:29:29 +0100 fs r270177 : CWS-TOOLING: rebase CWS dba32b to trunk@270033 (milestone: DEV300:m45) 2009-03-27 22:56:46 +0100 fs r270173 : #i100237# DEFAULT_CHECKED -> DEFAULT_STATE 2009-03-27 22:55:52 +0100 fs r270172 : #i100237# DefaultState property for buttons, enabled only when Toggle=Yes 2009-03-27 22:54:15 +0100 fs r270171 : #i100237# DEFAULT_CHECKED -> DEFAULT_STATE 2009-03-27 22:53:54 +0100 fs r270170 : #i100237# introduce a DefaultState property for buttons, which implies buttongs supporting XReset, which needed some refactoring 2009-03-27 13:31:41 +0100 fs r270152 : ignore output paths 2009-03-27 11:23:44 +0100 fs r270139 : tuned behavior with respect to invalid keys/values 2009-03-27 09:57:14 +0100 fs r270136 : don't allow Double.NaN 2009-03-27 09:56:16 +0100 fs r270135 : talk about Double.NaN 2009-03-26 12:14:30 +0100 fs r270067 : removed unused parameter 2009-03-26 12:14:02 +0100 fs r270066 : removed widening conversion when checking keys 2009-03-26 09:17:34 +0100 fs r270053 : separated the enumerator functionality into a dedicated interface, this way not burdening XMap with it 2009-03-26 09:17:11 +0100 fs r270052 : separated the enumerator functionality into a dedicated interface, this way not burdening XMap with it 2009-03-26 09:16:49 +0100 fs r270051 : separated the enumerator functionality into a dedicated interface, this way not burdening XMap with it 2009-03-25 21:55:20 +0100 fs r270044 : #i100541# properly calculat bNeedScrollBox 2009-03-25 12:56:17 +0100 fs r270019 : renamed the previously introduced error condition 2009-03-25 12:11:48 +0100 fs r270015 : #i100095# when the error messages contain non-trivial details (SQLState/ErrorCode), then always display the 'Details' button 2009-03-25 12:10:05 +0100 fs r270012 : renamed the previously introduced error condition 2009-03-25 12:01:04 +0100 fs r270011 : #i100095# when no address book (or respective profile) can be found, then use a dedicated ErrorCondition 2009-03-25 10:29:07 +0100 fs r270003 : add missing localization 2009-03-25 10:23:12 +0100 fs r270001 : in preparation of #i1000095#: rework the error handling, allow using css.sdb.ErrorCondition values, plus allow propagating the nsresult 2009-03-25 10:21:55 +0100 fs r270000 : in preparation of #i1000095#: rework the error handling, allow using css.sdb.ErrorCondition values, plus allow propagating the nsresult 2009-03-20 23:05:38 +0100 fs r269829 : XMap::getSize removed 2009-03-20 23:05:19 +0100 fs r269828 : changes as suggested by sb 2009-03-20 23:04:56 +0100 fs r269827 : enhanced documentation 2009-03-20 15:31:40 +0100 fs r269815 : changes as suggested by sb 2009-03-20 13:23:52 +0100 oj r269804 : #i92538# correct the zorder that fixedtext is infront of control 2009-03-20 12:59:38 +0100 oj r269801 : #i94571# paraadjust now supports BLOCK 2009-03-20 12:58:11 +0100 oj r269800 : #i94571# export style with data style 2009-03-20 12:57:05 +0100 oj r269799 : #i94571# text align is now paraadjust 2009-03-20 12:37:02 +0100 fs r269797 : enum keys only accepted if they have the exact type, not if they have *any* enum type 2009-03-20 12:28:31 +0100 fs r269794 : some changes requested by sb 2009-03-20 08:52:47 +0100 fs r269780 : doc 2009-03-20 07:37:31 +0100 oj r269779 : #i99913# only notifiy when values are different 2009-03-20 07:36:58 +0100 oj r269778 : #i99913# add undoenv as listener at the dataprovider 2009-03-19 22:52:52 +0100 fs r269771 : added comment 2009-03-19 22:40:06 +0100 fs r269770 : +testEnumeration 2009-03-19 22:39:41 +0100 fs r269769 : implemented enumeration, getKeySet, and getValues. Should be finished now. 2009-03-19 14:01:01 +0100 oj r269743 : #i99913# reset the modified state when selecting an object 2009-03-19 12:19:54 +0100 lla r269739 : #i72390# cleanups 2009-03-19 09:25:27 +0100 fs r269727 : #i10000# 2009-03-18 23:37:02 +0100 fs r269708 : extended checks for value type acceptance 2009-03-18 23:36:41 +0100 fs r269707 : fixed value type checks 2009-03-18 14:59:56 +0100 fs r269678 : initial complex test case for the new css.container.Map implementation 2009-03-18 14:59:24 +0100 fs r269677 : verifyExpectedException moved to base class (in complexlib), and renamed to assureException for consistency 2009-03-18 14:58:35 +0100 fs r269676 : removed unused imports 2009-03-18 14:58:03 +0100 fs r269675 : first implementation of the new css.container.Map service (not completed, yet) 2009-03-18 14:57:17 +0100 fs r269674 : base class for UNO components, freeing you from some repeating work 2009-03-18 14:55:53 +0100 fs r269672 : +assureException: call a given method with given parameters on a given object, ensure that a given exception is thrown by the method implementation 2009-03-18 14:54:58 +0100 fs r269671 : +getComponentContext 2009-03-18 14:54:00 +0100 fs r269670 : isEmpty returns a boolean, not a long 2009-03-18 14:14:43 +0100 oj r269663 : #i99743# now text also supports null 2009-03-18 13:54:14 +0100 oj r269660 : #i99223# remove check for 2 params 2009-03-18 13:33:35 +0100 oj r269659 : #i99060# replace text::ParagraphVertAlign with style::VerticalAlignment 2009-03-18 13:32:18 +0100 oj r269658 : #i99060# don't set void property when void isn't allowed 2009-03-18 13:31:11 +0100 oj r269657 : #i99060# handle vertical alignment 2009-03-18 13:28:28 +0100 oj r269656 : #i99060# remove unused elements from sytle 2009-03-18 09:35:42 +0100 lla r269639 : #i72390# cleanups 2009-03-18 09:31:20 +0100 lla r269638 : #i72390# add ButtonList 2009-03-18 09:30:46 +0100 lla r269637 : #i72390# renamed interface 2009-03-18 09:30:15 +0100 lla r269636 : #i72390# use ButtonList instead of ImageList 2009-03-18 09:29:05 +0100 lla r269635 : #i72390# new ButtonList, cleanups 2009-03-18 09:26:34 +0100 lla r269634 : #i72390# cleanups 2009-03-17 12:21:20 +0100 oj r269590 : #i99222# remove assertion 2009-03-17 12:17:22 +0100 oj r269589 : #i98605# impl scale mode 2009-03-17 12:10:42 +0100 oj r269588 : #i98605# impl scale mode 2009-03-17 11:40:15 +0100 oj r269584 : #i96944# doesn't create equation for shapes 2009-03-17 11:33:16 +0100 oj r269583 : #i96423# switch calc from float to long 2009-03-16 15:19:18 +0100 fs r269550 : #i41930# enable zoom for embedded/outplace documents 2009-03-16 14:25:54 +0100 oj r269542 : #i93734# remove ContextSensitive 2009-03-16 14:21:58 +0100 oj r269541 : #i99274# page header before group header 2009-03-16 14:18:23 +0100 oj r269539 : #i99110# fix value type 2009-03-16 14:14:16 +0100 fs r269537 : line ends 2009-03-16 14:11:06 +0100 fs r269535 : line ends 2009-03-16 14:08:34 +0100 fs r269534 : #i100087# (provided my np): allow for polymorphic types with more than one parameter 2009-03-16 12:30:31 +0100 oj r269521 : compile error 2009-03-16 12:19:12 +0100 oj r269519 : compile error 2009-03-16 10:39:28 +0100 oj r269511 : compile error under linux with swap 2009-03-13 10:33:04 +0100 oj r269462 : CWS-TOOLING: rebase CWS dba32b to trunk@269297 (milestone: DEV300:m43) 2009-03-12 14:37:25 +0100 fs r269416 : interface SequenceOutputStreamTest is unneeded, and pollutes the namespace here :) 2009-03-12 14:35:07 +0100 fs r269414 : not needed 2009-03-12 14:34:15 +0100 fs r269413 : preparation for multiple tests in this module 2009-03-12 14:33:02 +0100 fs r269412 : ShowTargets was moved from module integration.forms to module complexlib 2009-03-12 14:32:48 +0100 fs r269411 : helper class for projects containing multiple complex test cases (and following a certain structure) 2009-03-12 14:00:14 +0100 fs r269407 : proper module after the move 2009-03-12 13:59:10 +0100 fs r269406 : superseded by ../makefile.mk 2009-03-12 13:47:38 +0100 fs r269403 : not needed anymore 2009-03-12 13:45:46 +0100 fs r269402 : moved, in preparation of adding more test cases here, with a common infrastructure 2009-03-12 13:45:07 +0100 fs r269401 : moved from ../ 2009-03-12 13:43:59 +0100 fs r269400 : moved to ./comphelper, in preparation of adding more test cases here, with a common infrastructure 2009-03-12 13:29:47 +0100 oj r269396 : #i99914# set parent on dataprovider 2009-03-12 13:10:35 +0100 oj r269393 : #i99832# check thrown exception and show error 2009-03-12 13:08:10 +0100 fs r269392 : reorganizing tests 2009-03-12 12:52:55 +0100 oj r269390 : #i99118# convert formatkey in numberformat 2009-03-12 12:34:53 +0100 fs r269388 : new API tests 2009-03-12 12:29:05 +0100 fs r269386 : Map not yet committed 2009-03-12 12:28:36 +0100 fs r269385 : oops, forgot the SequenceInputStream during the previous refactoring 2009-03-12 12:12:39 +0100 oj r269384 : #i99104# set HasCategories prop 2009-03-12 12:12:08 +0100 oj r269383 : #i99104# check HasCategories even for internal dataprovider 2009-03-12 12:10:40 +0100 oj r269382 : #i99104# set HasCategories prop 2009-03-12 10:51:49 +0100 fs r269373 : #i10000# exception specifications 2009-03-12 10:49:18 +0100 fs r269372 : #i10000# exception specifications 2009-03-12 10:44:02 +0100 fs r269371 : #i10000# exception specifications 2009-03-12 10:30:55 +0100 fs r269368 : refactored the UNO service registration in this module, using the helper classes provided by comphelper itself, so you have less effort when extending the list of to-be-registered components 2009-03-12 10:30:37 +0100 fs r269367 : module-local includes 2009-03-12 07:05:54 +0100 oj r269357 : #i99104# database dataprovider doesn't need dataranges and diagramdata 2009-03-11 10:58:28 +0100 oj r269306 : #i99911# check if name of the report is a valid file name 2009-03-11 10:03:23 +0100 oj r269299 : #i99666# the report is new when the HierarchicalDocumentName is empty 2009-03-10 11:32:45 +0100 oj r269258 : #i99221# use fallback for language 2009-03-10 10:48:40 +0100 oj r269255 : #i99433# now use OStringBuffer 2009-03-10 10:36:21 +0100 fs r269252 : initial version of (X)Map 2009-03-10 09:52:23 +0100 oj r269246 : #i99433# now use OStringBuffer 2009-03-10 08:56:13 +0100 oj r269240 : #i99655# patch applied 2009-03-09 07:35:33 +0100 lla r269058 : #i10000# wrong variable assignment fixed 2009-03-06 17:20:40 +0100 fs r269030 : some explicit defaults 2009-03-06 17:20:30 +0100 fs r269029 : #i98600# 2009-03-06 14:40:34 +0100 fs r269009 : #i87692# during reload, prevent the document being modified just because of some control content changes ... 2009-03-06 12:52:20 +0100 lla r268997 : #i10000# ambigous problem with FontWeight fixed 2009-03-06 11:39:32 +0100 fs r268989 : #i10000# (approved by pl): use --without-t1-library configure option 2009-03-06 10:55:43 +0100 fs r268986 : #i99953# depends on xmlscript module now 2009-03-06 10:54:04 +0100 fs r268985 : #i99953# also adjust the event names found in dialogs embedded in the forms 2009-03-06 09:53:41 +0100 fs r268977 : #i10000# 2009-03-06 09:30:41 +0100 lla r268973 : #i10000# merge problems 2009-03-05 17:52:34 +0100 fs r268932 : #i98593# for sub components which are actually controlled by a DocumentDefinition (aka XComponentSupplier aka XCommandProcessor), close them by executing the 'close' command, not by suspending/closing the controller (which cannot be intercepted) 2009-03-05 11:41:56 +0100 fs r268889 : default the drop down line count for list/combo boxes to 20 2009-03-05 11:39:10 +0100 fs r268887 : do not display empty error messages 2009-03-02 10:13:57 +0100 lla r268639 : #i91541# CWS rebase m41 to m42 2009-03-02 09:06:27 +0100 lla r268635 : #i10000# add ';' to strings 2009-02-26 11:18:00 +0100 fs r268492 : reportdesign depends on REPORTBUILDER, not REPORTDESIGN 2009-02-26 10:11:38 +0100 lla r268489 : CWS-TOOLING: rebase CWS dba32b to trunk@268395 (milestone: DEV300:m42) 2009-02-26 09:04:11 +0100 lla r268488 : CWS-TOOLING: rebase CWS dba32b to trunk@268395 (milestone: DEV300:m42) 2009-02-24 12:09:13 +0100 lla r268392 : #i91541# #i91542# cleanups 2009-02-24 08:08:06 +0100 lla r268382 : merge all dba32a changes into dba32b 2009-02-24 07:14:55 +0100 lla r268381 : merge all dba32a changes into dba32b 2009-02-23 21:44:28 +0100 fs r268377 : oops ... don't tamper with m_aListSourceValues at the end of loadData 2009-02-23 20:57:05 +0100 fs r268376 : #i98162# don't hold the values as strings, but as ORowSetValue, this way preserving their type, and being agnostic to different result/rowset implementations doing different to-string-conversations 2009-02-23 20:55:44 +0100 fs r268375 : getObject: throwFunctionNotSupportedException, instead of silently returning NULL 2009-02-23 20:55:20 +0100 fs r268374 : #i98162# some more supported types 2009-02-23 20:54:43 +0100 fs r268373 : #i98162# +operator != 2009-02-20 09:35:39 +0100 fs r268306 : #i99422# for a font, display the font name, the style, and the size 2009-02-20 09:33:45 +0100 fs r268305 : #i99422# in the property browser, FONT supersedes CHARFONTNAME: the aggregated FormComponentHandler displays them more nicely now 2009-02-19 16:12:06 +0100 fs r268293 : #i99372# recognize DataType::FLOAT as numeric 2009-02-19 15:43:12 +0100 fs r268291 : #i99415# 2009-02-19 15:40:15 +0100 fs r268290 : #i99242# lcl_firstFocussableControl: take disabled controls into account 2009-02-19 15:34:36 +0100 fs r268289 : #i99396# properly decode the base name of the URL when using it as title 2009-02-19 15:19:05 +0100 fs r268287 : #i98247# --- forms/qa/integration/forms/ShowTargets.java | 103 -------- forms/qa/makefile.mk | 4 +- forms/source/component/Button.cxx | 161 +++++++++++- forms/source/component/Button.hxx | 51 +++- forms/source/component/CheckBox.cxx | 2 +- forms/source/component/DatabaseForm.cxx | 40 +++ forms/source/component/FormComponent.cxx | 22 +- forms/source/component/ListBox.cxx | 363 +++++++++++++++------------ forms/source/component/ListBox.hxx | 25 +- forms/source/component/RadioButton.cxx | 6 +- forms/source/component/refvaluecomponent.cxx | 10 +- forms/source/component/refvaluecomponent.hxx | 15 +- forms/source/helper/makefile.mk | 4 +- forms/source/helper/resettable.cxx | 101 ++++++++ forms/source/inc/FormComponent.hxx | 3 +- forms/source/inc/frm_strings.hxx | 2 +- forms/source/inc/property.hrc | 2 +- forms/source/inc/resettable.hxx | 75 ++++++ forms/source/inc/togglestate.hxx | 43 ++++ forms/source/misc/property.cxx | 2 +- 20 files changed, 702 insertions(+), 332 deletions(-) delete mode 100644 forms/qa/integration/forms/ShowTargets.java create mode 100644 forms/source/helper/resettable.cxx create mode 100644 forms/source/inc/resettable.hxx create mode 100644 forms/source/inc/togglestate.hxx (limited to 'forms') diff --git a/forms/qa/integration/forms/ShowTargets.java b/forms/qa/integration/forms/ShowTargets.java deleted file mode 100644 index 3c747adfb2bc..000000000000 --- a/forms/qa/integration/forms/ShowTargets.java +++ /dev/null @@ -1,103 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: ShowTargets.java,v $ - * $Revision: 1.4 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -package integration.forms; - -/** - * - * @author fs93730 - */ -public class ShowTargets -{ - /** Creates a new instance of ShowTargets */ - public ShowTargets() - { - } - - public static void main( String[] args ) - { - System.out.println( "possible targets (* denotes a test case which requires user interaction):" ); - System.out.println( " run" ); - - for ( int i = 0; i < args.length; ++i ) - { - // filter - if ( args[i].equals( "TestCase" ) ) - continue; - if ( args[i].equals( "TestSkeleton" ) ) - continue; - - String completePotentialClassName = args[i].replace( '/', '.' ); - - // get the class - Class potentialTestClass = null; - try { potentialTestClass = Class.forName( completePotentialClassName ); } - catch( java.lang.ClassNotFoundException e ) - { - continue; - } - - // see if it is derived from complexlib.ComplexTestCase - Class superClass = potentialTestClass.getSuperclass(); - while ( superClass != null ) - { - if ( superClass.getName().equals( "complexlib.ComplexTestCase" ) ) - { - if ( isInteractiveTest( potentialTestClass ) ) - System.out.print( "* " ); - else - System.out.print( " " ); - System.out.println( "run_" + args[i] ); - } - superClass = superClass.getSuperclass(); - } - } - } - - /** determines if the test denoted by a given Class is an interactive test - */ - static private boolean isInteractiveTest( Class testClass ) - { - java.lang.reflect.Method interactiveTestMethod = null; - try { interactiveTestMethod = testClass.getMethod( "isInteractiveTest", new Class[]{} ); } - catch( Exception e ) { } - - if ( interactiveTestMethod != null ) - { - try - { - Boolean result = (Boolean)interactiveTestMethod.invoke( null, new Object[]{} ); - return result.booleanValue(); - } - catch( Exception e ) { } - } - return false; - } -} diff --git a/forms/qa/makefile.mk b/forms/qa/makefile.mk index 7be518dc063b..822f67e1bb46 100644 --- a/forms/qa/makefile.mk +++ b/forms/qa/makefile.mk @@ -56,7 +56,7 @@ JARCOMPRESS = TRUE # --- Runner Settings ---------------------------------------------- # classpath and argument list -RUNNER_CLASSPATH = -cp $(CLASSPATH)$(PATH_SEPERATOR)$(SOLARBINDIR)$/OOoRunner.jar$(PATH_SEPERATOR)$(CLASSPATH)$(PATH_SEPERATOR)$(SOLARBINDIR)$/ConnectivityTools.jar +RUNNER_CLASSPATH = -cp "$(CLASSPATH)$(PATH_SEPERATOR)$(SOLARBINDIR)$/OOoRunner.jar$(PATH_SEPERATOR)$(SOLARBINDIR)$/ConnectivityTools.jar" RUNNER_ARGS = org.openoffice.Runner -TestBase java_complex .END @@ -75,7 +75,7 @@ ALL: ALLDEP .IF "$(BUILD_QADEVOOO)" == "YES" show_targets: - +@java $(RUNNER_CLASSPATH) integration.forms.ShowTargets $(foreach,i,$(JAVAFILES) $(i:s/.\$///:s/.java//)) + +@java $(RUNNER_CLASSPATH) complexlib.ShowTargets $(foreach,i,$(JAVAFILES) $(i:s/.\$///:s/.java//)) run: +$(COPY) integration$/forms$/*.props $(CLASSDIR)$/$(PACKAGE) && java $(RUNNER_CLASSPATH) $(RUNNER_ARGS) -sce forms_all.sce diff --git a/forms/source/component/Button.cxx b/forms/source/component/Button.cxx index 38b1a0376a76..8907dcd82712 100644 --- a/forms/source/component/Button.cxx +++ b/forms/source/component/Button.cxx @@ -30,14 +30,18 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_forms.hxx" + #include "Button.hxx" + +#include + +#include +#include +#include #include #include -#include #include -#include -#include -#include +#include //......................................................................... namespace frm @@ -71,16 +75,40 @@ InterfaceRef SAL_CALL OButtonModel_CreateInstance(const Reference& _rxFactory) :OClickableImageBaseModel( _rxFactory, VCL_CONTROLMODEL_COMMANDBUTTON, FRM_SUN_CONTROL_COMMANDBUTTON ) // use the old control name for compatibility reasons + ,m_aResetHelper( *this, m_aMutex ) + ,m_eDefaultState( STATE_NOCHECK ) { DBG_CTOR( OButtonModel, NULL ); m_nClassId = FormComponentType::COMMANDBUTTON; } +//------------------------------------------------------------------ +Any SAL_CALL OButtonModel::queryAggregation( const Type& _type ) throw(RuntimeException) +{ + Any aReturn = OClickableImageBaseModel::queryAggregation( _type ); + if ( !aReturn.hasValue() ) + aReturn = OButtonModel_Base::queryInterface( _type ); + return aReturn; +} + +//------------------------------------------------------------------ +Sequence< Type > OButtonModel::_getTypes() +{ + return ::comphelper::concatSequences( + OClickableImageBaseModel::_getTypes(), + OButtonModel_Base::getTypes() + ); +} + //------------------------------------------------------------------ OButtonModel::OButtonModel( const OButtonModel* _pOriginal, const Reference& _rxFactory ) :OClickableImageBaseModel( _pOriginal, _rxFactory ) + ,m_aResetHelper( *this, m_aMutex ) + ,m_eDefaultState( _pOriginal->m_eDefaultState ) { DBG_CTOR( OButtonModel, NULL ); + m_nClassId = FormComponentType::COMMANDBUTTON; + implInitializeImageURL(); } @@ -93,12 +121,13 @@ OButtonModel::~OButtonModel() //------------------------------------------------------------------------------ void OButtonModel::describeFixedProperties( Sequence< Property >& _rProps ) const { - BEGIN_DESCRIBE_PROPERTIES( 5, OClickableImageBaseModel ) - DECL_PROP1(BUTTONTYPE, FormButtonType, BOUND); - DECL_PROP1(DISPATCHURLINTERNAL, sal_Bool, BOUND); - DECL_PROP1(TARGET_URL, ::rtl::OUString, BOUND); - DECL_PROP1(TARGET_FRAME, ::rtl::OUString, BOUND); - DECL_PROP1(TABINDEX, sal_Int16, BOUND); + BEGIN_DESCRIBE_PROPERTIES( 6, OClickableImageBaseModel ) + DECL_PROP1( BUTTONTYPE, FormButtonType, BOUND ); + DECL_PROP1( DEFAULT_STATE, sal_Int16, BOUND ); + DECL_PROP1( DISPATCHURLINTERNAL, sal_Bool, BOUND ); + DECL_PROP1( TARGET_URL, ::rtl::OUString, BOUND ); + DECL_PROP1( TARGET_FRAME, ::rtl::OUString, BOUND ); + DECL_PROP1( TABINDEX, sal_Int16, BOUND ); END_DESCRIBE_PROPERTIES(); } @@ -205,6 +234,118 @@ void OButtonModel::read(const Reference& _rxInStream) throw } } +//-------------------------------------------------------------------- +void SAL_CALL OButtonModel::disposing() +{ + m_aResetHelper.disposing(); + OClickableImageBaseModel::disposing(); +} + +//-------------------------------------------------------------------- +void SAL_CALL OButtonModel::reset() throw (RuntimeException) +{ + if ( !m_aResetHelper.approveReset() ) + return; + + impl_resetNoBroadcast_nothrow(); + + m_aResetHelper.notifyResetted(); +} + +//-------------------------------------------------------------------- +void SAL_CALL OButtonModel::addResetListener( const Reference< XResetListener >& _listener ) throw (RuntimeException) +{ + m_aResetHelper.addResetListener( _listener ); +} + +//-------------------------------------------------------------------- +void SAL_CALL OButtonModel::removeResetListener( const Reference< XResetListener >& _listener ) throw (RuntimeException) +{ + m_aResetHelper.removeResetListener( _listener ); +} + +//-------------------------------------------------------------------- +void SAL_CALL OButtonModel::getFastPropertyValue( Any& _rValue, sal_Int32 _nHandle ) const +{ + switch ( _nHandle ) + { + case PROPERTY_ID_DEFAULT_STATE: + _rValue <<= (sal_Int16)m_eDefaultState; + break; + + default: + OClickableImageBaseModel::getFastPropertyValue( _rValue, _nHandle ); + break; + } +} + +//-------------------------------------------------------------------- +void SAL_CALL OButtonModel::setFastPropertyValue_NoBroadcast( sal_Int32 _nHandle, const Any& _rValue ) throw (Exception) +{ + switch ( _nHandle ) + { + case PROPERTY_ID_DEFAULT_STATE: + { + sal_Int16 nDefaultState( (sal_Int16)STATE_NOCHECK ); + OSL_VERIFY( _rValue >>= nDefaultState ); + m_eDefaultState = (ToggleState)nDefaultState; + impl_resetNoBroadcast_nothrow(); + } + break; + + default: + OClickableImageBaseModel::setFastPropertyValue_NoBroadcast( _nHandle, _rValue ); + break; + } +} + +//-------------------------------------------------------------------- +sal_Bool SAL_CALL OButtonModel::convertFastPropertyValue( Any& _rConvertedValue, Any& _rOldValue, sal_Int32 _nHandle, const Any& _rValue ) throw (IllegalArgumentException) +{ + sal_Bool bModified = sal_False; + switch ( _nHandle ) + { + case PROPERTY_ID_DEFAULT_STATE: + bModified = tryPropertyValue( _rConvertedValue, _rOldValue, _rValue, (sal_Int16)m_eDefaultState ); + break; + + default: + bModified = OClickableImageBaseModel::convertFastPropertyValue( _rConvertedValue, _rOldValue, _nHandle, _rValue ); + break; + } + return bModified; +} + +//-------------------------------------------------------------------- +Any OButtonModel::getPropertyDefaultByHandle( sal_Int32 _nHandle ) const +{ + Any aDefault; + switch ( _nHandle ) + { + case PROPERTY_ID_DEFAULT_STATE: + aDefault <<= (sal_Int16)STATE_NOCHECK; + break; + + default: + aDefault = OClickableImageBaseModel::getPropertyDefaultByHandle( _nHandle ); + break; + } + return aDefault; +} + +//-------------------------------------------------------------------- +void OButtonModel::impl_resetNoBroadcast_nothrow() +{ + try + { + setPropertyValue( PROPERTY_STATE, getPropertyValue( PROPERTY_DEFAULT_STATE ) ); + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } +} + //================================================================== // OButtonControl //================================================================== diff --git a/forms/source/component/Button.hxx b/forms/source/component/Button.hxx index 038f5b1e8aec..5bbb7f387f85 100644 --- a/forms/source/component/Button.hxx +++ b/forms/source/component/Button.hxx @@ -32,13 +32,19 @@ #define _FRM_BUTTON_HXX_ #include "clickableimage.hxx" +#include "togglestate.hxx" +#include "formnavigation.hxx" +#include "resettable.hxx" + #include #include #include #include #include +#include #include -#include "formnavigation.hxx" + +#include //......................................................................... namespace frm @@ -48,12 +54,20 @@ namespace frm //================================================================== // OButtonModel //================================================================== -class OButtonModel - :public OClickableImageBaseModel +typedef ::cppu::ImplHelper1 < ::com::sun::star::form::XReset + > OButtonModel_Base; +class OButtonModel :public OClickableImageBaseModel + ,public OButtonModel_Base { public: DECLARE_DEFAULT_LEAF_XTOR( OButtonModel ); + // UNO + DECLARE_UNO3_AGG_DEFAULTS( OButtonModel, OClickableImageBaseModel ); + virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw(::com::sun::star::uno::RuntimeException); + + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes(); + // ::com::sun::star::lang::XServiceInfo IMPLEMENTATION_NAME(OButtonModel); virtual StringSequence SAL_CALL getSupportedServiceNames() throw(); @@ -63,13 +77,44 @@ public: virtual void SAL_CALL write(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectOutputStream>& _rxOutStream) throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); virtual void SAL_CALL read(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectInputStream>& _rxInStream) throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + // XReset + virtual void SAL_CALL reset( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addResetListener( const ::com::sun::star::uno::Reference< ::com::sun::star::form::XResetListener >& aListener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeResetListener( const ::com::sun::star::uno::Reference< ::com::sun::star::form::XResetListener >& aListener ) throw (::com::sun::star::uno::RuntimeException); + // OControlModel's property handling virtual void describeFixedProperties( ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps ) const; + // XPropertySet and friends + virtual void SAL_CALL getFastPropertyValue(::com::sun::star::uno::Any& rValue, sal_Int32 nHandle) const; + virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) + throw (::com::sun::star::uno::Exception); + virtual sal_Bool SAL_CALL convertFastPropertyValue( + ::com::sun::star::uno::Any& _rConvertedValue, ::com::sun::star::uno::Any& _rOldValue, sal_Int32 _nHandle, const ::com::sun::star::uno::Any& _rValue ) + throw (::com::sun::star::lang::IllegalArgumentException); + virtual ::com::sun::star::uno::Any getPropertyDefaultByHandle( sal_Int32 nHandle ) const; + + // OComponentHelper + virtual void SAL_CALL disposing(); + protected: DECLARE_XCLONEABLE(); + +private: + void impl_resetNoBroadcast_nothrow(); + + using ::cppu::OPropertySetHelper::getFastPropertyValue; + +private: + ResetHelper m_aResetHelper; + + // + ToggleState m_eDefaultState; // the default check state + // +protected: + using OClickableImageBaseModel::disposing; }; //================================================================== diff --git a/forms/source/component/CheckBox.cxx b/forms/source/component/CheckBox.cxx index a8086d39b597..8e66ebc60ab6 100644 --- a/forms/source/component/CheckBox.cxx +++ b/forms/source/component/CheckBox.cxx @@ -209,7 +209,7 @@ void SAL_CALL OCheckBoxModel::read(const Reference& break; } setReferenceValue( sReferenceValue ); - setDefaultChecked( static_cast< CheckState >( nDefaultChecked ) ); + setDefaultChecked( static_cast< ToggleState >( nDefaultChecked ) ); // Nach dem Lesen die Defaultwerte anzeigen if ( getControlSource().getLength() ) diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx index 21e3be3c4820..142f0f249b36 100644 --- a/forms/source/component/DatabaseForm.cxx +++ b/forms/source/component/DatabaseForm.cxx @@ -65,6 +65,7 @@ #include #include #include +#include #include #include @@ -142,6 +143,41 @@ namespace frm { //......................................................................... +//================================================================== +//= DocumentModifyGuard +//================================================================== +class DocumentModifyGuard +{ +public: + DocumentModifyGuard( const Reference< XInterface >& _rxFormComponent ) + :m_xDocumentModify( getXModel( _rxFormComponent ), UNO_QUERY ) + { + OSL_ENSURE( m_xDocumentModify.is(), "DocumentModifyGuard::DocumentModifyGuard: no document, or no XModifiable2!" ); + impl_changeModifiableFlag_nothrow( false ); + } + ~DocumentModifyGuard() + { + impl_changeModifiableFlag_nothrow( true ); + } + +private: + void impl_changeModifiableFlag_nothrow( const bool _enable ) + { + try + { + if ( m_xDocumentModify.is() ) + _enable ? m_xDocumentModify->enableSetModified() : m_xDocumentModify->disableSetModified(); + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + } + +private: + Reference< XModifiable2 > m_xDocumentModify; +}; + //================================================================== //= OFormSubmitResetThread //=----------------------------------------------------------------- @@ -2941,6 +2977,10 @@ void ODatabaseForm::reload_impl(sal_Bool bMoveToFirst, const Reference< XInterac if (!isLoaded()) return; + DocumentModifyGuard aModifyGuard( *this ); + // ensures the document is not marked as "modified" just because we change some control's content during + // reloading ... + EventObject aEvent(static_cast(this)); { // only if there is no approve listener we can post the event at this time diff --git a/forms/source/component/FormComponent.cxx b/forms/source/component/FormComponent.cxx index f0cc505d125e..6e700c28f6d8 100644 --- a/forms/source/component/FormComponent.cxx +++ b/forms/source/component/FormComponent.cxx @@ -1293,8 +1293,8 @@ OBoundControlModel::OBoundControlModel( ,m_nValuePropertyAggregateHandle( -1 ) ,m_nFieldType( DataType::OTHER ) ,m_bValuePropertyMayBeVoid( false ) + ,m_aResetHelper( *this, m_aMutex ) ,m_aUpdateListeners(m_aMutex) - ,m_aResetListeners(m_aMutex) ,m_aFormComponentListeners( m_aMutex ) ,m_bInputRequired( sal_True ) ,m_pAggPropMultiplexer( NULL ) @@ -1328,8 +1328,8 @@ OBoundControlModel::OBoundControlModel( ,m_nValuePropertyAggregateHandle( _pOriginal->m_nValuePropertyAggregateHandle ) ,m_nFieldType( DataType::OTHER ) ,m_bValuePropertyMayBeVoid( _pOriginal->m_bValuePropertyMayBeVoid ) + ,m_aResetHelper( *this, m_aMutex ) ,m_aUpdateListeners( m_aMutex ) - ,m_aResetListeners( m_aMutex ) ,m_aFormComponentListeners( m_aMutex ) ,m_xValidator( _pOriginal->m_xValidator ) ,m_bInputRequired( sal_True ) @@ -1521,8 +1521,8 @@ void OBoundControlModel::disposing() // notify all our listeners com::sun::star::lang::EventObject aEvt( static_cast< XWeak* >( this ) ); - m_aResetListeners.disposeAndClear( aEvt ); m_aUpdateListeners.disposeAndClear( aEvt ); + m_aResetHelper.disposing(); // disconnect from our database column // TODO: could we replace the following 5 lines with a call to impl_disconnectDatabaseColumn_noNotify? @@ -2482,26 +2482,20 @@ void OBoundControlModel::resetNoBroadcast() //----------------------------------------------------------------------------- void OBoundControlModel::addResetListener(const Reference& l) throw (RuntimeException) { - m_aResetListeners.addInterface(l); + m_aResetHelper.addResetListener( l ); } //----------------------------------------------------------------------------- void OBoundControlModel::removeResetListener(const Reference& l) throw (RuntimeException) { - m_aResetListeners.removeInterface(l); + m_aResetHelper.removeResetListener( l ); } //----------------------------------------------------------------------------- void OBoundControlModel::reset() throw (RuntimeException) { - cppu::OInterfaceIteratorHelper aIter(m_aResetListeners); - EventObject aResetEvent(static_cast(this)); - sal_Bool bContinue = sal_True; - while ( aIter.hasMoreElements() && bContinue ) - bContinue = static_cast< XResetListener* >( aIter.next() )->approveReset( aResetEvent ); - - if (!bContinue) - return; + if ( !m_aResetHelper.approveReset() ) + return; ControlModelLock aLock( *this ); @@ -2616,7 +2610,7 @@ void OBoundControlModel::reset() throw (RuntimeException) aLock.release(); - m_aResetListeners.notifyEach( &XResetListener::resetted, aResetEvent ); + m_aResetHelper.notifyResetted(); } // ----------------------------------------------------------------------------- diff --git a/forms/source/component/ListBox.cxx b/forms/source/component/ListBox.cxx index f7bc39fa1b89..ec953f66c6f6 100644 --- a/forms/source/component/ListBox.cxx +++ b/forms/source/component/ListBox.cxx @@ -54,27 +54,22 @@ #include /** === end UNO includes === **/ -#include -#include -#include - -#include - -#include - -#include -#include - #include #include #include #include - +#include +#include +#include #include - #include +#include +#include +#include +#include #include +#include //......................................................................... @@ -94,14 +89,61 @@ namespace frm using namespace ::com::sun::star::form::binding; using namespace ::dbtools; - //================================================================== - //= ItemEvent - //================================================================== + using ::connectivity::ORowSetValue; + + //============================================================================== + //= helper + //============================================================================== + namespace + { + //-------------------------------------------------------------------------- + struct RowSetValueToString : public ::std::unary_function< ORowSetValue, ::rtl::OUString > + { + ::rtl::OUString operator()( const ORowSetValue& _value ) const + { + return _value.getString(); + } + }; + + //-------------------------------------------------------------------------- + struct AppendRowSetValueString : public ::std::unary_function< ::rtl::OUString, void > + { + AppendRowSetValueString( ::rtl::OUString& _string ) + :m_string( _string ) + { + } + + void operator()( const ::rtl::OUString _append ) + { + m_string += _append; + } + + private: + ::rtl::OUString& m_string; + }; + + //-------------------------------------------------------------------------- + Sequence< ::rtl::OUString > lcl_convertToStringSequence( const ValueList& _values ) + { + Sequence< ::rtl::OUString > aStrings( _values.size() ); + ::std::transform( + _values.begin(), + _values.end(), + aStrings.getArray(), + RowSetValueToString() + ); + return aStrings; + } + } + + //============================================================================== + //= ItemEventDescription + //============================================================================== typedef ::comphelper::EventHolder< ItemEvent > ItemEventDescription; - //================================================================== + //============================================================================== //= OListBoxModel - //================================================================== + //============================================================================== //------------------------------------------------------------------ InterfaceRef SAL_CALL OListBoxModel_CreateInstance(const Reference& _rxFactory) throw (RuntimeException) { @@ -146,8 +188,8 @@ namespace frm ,m_aListRowSet( getContext() ) ,m_eListSourceType( _pOriginal->m_eListSourceType ) ,m_aBoundColumn( _pOriginal->m_aBoundColumn ) - ,m_aListSourceSeq( _pOriginal->m_aListSourceSeq ) - ,m_aValueSeq( _pOriginal->m_aValueSeq ) + ,m_aListSourceValues( _pOriginal->m_aListSourceValues ) + ,m_aBoundValues( _pOriginal->m_aBoundValues ) ,m_aDefaultSelectSeq( _pOriginal->m_aDefaultSelectSeq ) ,m_nNULLPos(-1) ,m_bBoundComponent(sal_False) @@ -229,11 +271,11 @@ namespace frm break; case PROPERTY_ID_LISTSOURCE: - _rValue <<= m_aListSourceSeq; + _rValue <<= lcl_convertToStringSequence( m_aListSourceValues ); break; case PROPERTY_ID_VALUE_SEQ: - _rValue <<= m_aValueSeq; + _rValue <<= lcl_convertToStringSequence( m_aBoundValues ); break; case PROPERTY_ID_DEFAULT_SELECT_SEQ: @@ -266,24 +308,38 @@ namespace frm _rValue >>= m_eListSourceType; break; - case PROPERTY_ID_LISTSOURCE : - DBG_ASSERT(_rValue.getValueType().equals(::getCppuType(reinterpret_cast(NULL))), - "OListBoxModel::setFastPropertyValue_NoBroadcast : invalid type !" ); - _rValue >>= m_aListSourceSeq; - - if (m_eListSourceType == ListSourceType_VALUELIST) - m_aValueSeq = m_aListSourceSeq; - else if ( m_xCursor.is() && !hasField() && !hasExternalListSource() ) - // listbox is already connected to a database, and no external list source - // data source changed -> refresh - loadData( false ); - break; + case PROPERTY_ID_LISTSOURCE: + { + // extract + Sequence< ::rtl::OUString > aListSource; + OSL_VERIFY( _rValue >>= aListSource ); + + // copy to member + ValueList().swap(m_aListSourceValues); + ::std::copy( + aListSource.getConstArray(), + aListSource.getConstArray() + aListSource.getLength(), + ::std::insert_iterator< ValueList >( m_aListSourceValues, m_aListSourceValues.end() ) + ); + + // propagate + if ( m_eListSourceType == ListSourceType_VALUELIST ) + { + m_aBoundValues = m_aListSourceValues; + } + else + { + if ( m_xCursor.is() && !hasField() && !hasExternalListSource() ) + // listbox is already connected to a database, and no external list source + // data source changed -> refresh + loadData( false ); + } + } + break; case PROPERTY_ID_VALUE_SEQ : - DBG_ASSERT(_rValue.getValueType().equals(::getCppuType(reinterpret_cast(NULL))), - "OListBoxModel::setFastPropertyValue_NoBroadcast : invalid type !" ); - _rValue >>= m_aValueSeq; - break; + OSL_ENSURE( false, "ValueItemList is read-only!" ); + throw PropertyVetoException(); case PROPERTY_ID_DEFAULT_SELECT_SEQ : DBG_ASSERT(_rValue.getValueType().equals(::getCppuType(reinterpret_cast< Sequence*>(NULL))), @@ -329,12 +385,12 @@ namespace frm break; case PROPERTY_ID_LISTSOURCE: - bModified = tryPropertyValue(_rConvertedValue, _rOldValue, _rValue, m_aListSourceSeq); + bModified = tryPropertyValue(_rConvertedValue, _rOldValue, _rValue, lcl_convertToStringSequence( m_aListSourceValues ) ); break; case PROPERTY_ID_VALUE_SEQ : - bModified = tryPropertyValue(_rConvertedValue, _rOldValue, _rValue, m_aValueSeq); - break; + OSL_ENSURE( false, "ValueItemList is read-only!" ); + throw PropertyVetoException(); case PROPERTY_ID_DEFAULT_SELECT_SEQ : bModified = tryPropertyValue(_rConvertedValue, _rOldValue, _rValue, m_aDefaultSelectSeq); @@ -435,7 +491,7 @@ namespace frm _rxOutStream << nAnyMask; - _rxOutStream << m_aListSourceSeq; + _rxOutStream << lcl_convertToStringSequence( m_aListSourceValues ); _rxOutStream << (sal_Int16)m_eListSourceType; _rxOutStream << aDummySeq; _rxOutStream << m_aDefaultSelectSeq; @@ -481,9 +537,9 @@ namespace frm if (nVersion > 0x0004) { DBG_ERROR("OListBoxModel::read : invalid (means unknown) version !"); - m_aListSourceSeq.realloc(0); + ValueList().swap(m_aListSourceValues); m_aBoundColumn <<= (sal_Int16)0; - m_aValueSeq.realloc(0); + ValueList().swap(m_aBoundValues); m_eListSourceType = ListSourceType_VALUELIST; m_aDefaultSelectSeq.realloc(0); defaultCommonProperties(); @@ -588,17 +644,18 @@ namespace frm // PRE2: list source ::rtl::OUString sListSource; - // if our list source type is no value list, we need to concatenete + // if our list source type is no value list, we need to concatenate // the single list source elements - const ::rtl::OUString* pListSourceItem = m_aListSourceSeq.getConstArray(); - sal_Int32 i(0); - for ( i=0; i aValueList, aStringList; - aValueList.reserve(16); - aStringList.reserve(16); + ValueList aDisplayList, aValueList; sal_Bool bUseNULL = hasField() && !isRequired(); try @@ -780,23 +835,20 @@ namespace frm ::dbtools::FormattedColumnValue aValueFormatter( getContext(), m_xCursor, xDataField ); // Feld der BoundColumn des ResultSets holen - Reference< XPropertySet > xBoundField; - if ((nBoundColumn > 0) && m_xColumn.is()) + sal_Int32 nBoundColumnType = DataType::SQLNULL; + if ( ( nBoundColumn > 0 ) && m_xColumn.is() ) { // don't look for a bound column if we're not connected to a field try { - xColumns->getByIndex(nBoundColumn) >>= xBoundField; + Reference< XPropertySet > xBoundField( xColumns->getByIndex( nBoundColumn ), UNO_QUERY_THROW ); + OSL_VERIFY( xBoundField->getPropertyValue( ::rtl::OUString::createFromAscii( "Type" ) ) >>= nBoundColumnType ); } catch( const Exception& ) { DBG_UNHANDLED_EXCEPTION(); } } - m_bBoundComponent = xBoundField.is(); - - ::std::auto_ptr< ::dbtools::FormattedColumnValue > pBoundFieldFormatter; - if ( xBoundField.is() ) - pBoundFieldFormatter.reset( new ::dbtools::FormattedColumnValue( getContext(), m_xCursor, xBoundField ) ); + m_bBoundComponent = ( nBoundColumnType != DataType::SQLNULL ); // Ist die LB an ein Feld gebunden und sind Leereintraege zulaessig // dann wird die Position fuer einen Leereintrag gemerkt @@ -804,20 +856,21 @@ namespace frm RTL_LOGFILE_CONTEXT( aLogContext, "OListBoxModel::loadData: string collection" ); ::rtl::OUString aStr; sal_Int16 entryPos = 0; - // per definitionem the list cursor is positioned _before_ the first row at the moment + ORowSetValue aBoundValue; + Reference< XRow > xCursorRow( xListCursor, UNO_QUERY_THROW ); while ( xListCursor->next() && ( entryPos++ < SHRT_MAX ) ) // SHRT_MAX is the maximum number of entries { aStr = aValueFormatter.getFormattedValue(); - aStringList.push_back(aStr); + aDisplayList.push_back( aStr ); - if ( pBoundFieldFormatter.get() ) + if ( m_bBoundComponent ) { - aStr = pBoundFieldFormatter->getFormattedValue(); - aValueList.push_back( aStr ); + aBoundValue.fill( nBoundColumn + 1, nBoundColumnType, xCursorRow ); + aValueList.push_back( aBoundValue ); } - if (bUseNULL && (m_nNULLPos == -1) && !aStr.getLength()) - m_nNULLPos = (sal_Int16)aStringList.size() - 1; + if ( bUseNULL && ( m_nNULLPos == -1 ) && !aStr.getLength() ) + m_nNULLPos = sal_Int16( aDisplayList.size() - 1 ); } } break; @@ -828,11 +881,11 @@ namespace frm if (xFieldNames.is()) { StringSequence seqNames = xFieldNames->getElementNames(); - sal_Int32 nFieldsCount = seqNames.getLength(); - const ::rtl::OUString* pustrNames = seqNames.getConstArray(); - - for (sal_Int32 k=0; k( aDisplayList, aDisplayList.end() ) + ); } } break; @@ -857,25 +910,16 @@ namespace frm // NULL eintrag hinzufuegen if (bUseNULL && m_nNULLPos == -1) { - if (m_bBoundComponent) - aValueList.insert(aValueList.begin(), ::rtl::OUString()); + if ( m_bBoundComponent ) + aValueList.insert( aValueList.begin(), ORowSetValue() ); - aStringList.insert(aStringList.begin(), ::rtl::OUString()); + aDisplayList.insert( aDisplayList.begin(), ORowSetValue( ::rtl::OUString() ) ); m_nNULLPos = 0; } - m_aValueSeq.realloc(aValueList.size()); - ::rtl::OUString* pValues = m_aValueSeq.getArray(); - for ( i = 0; i < (sal_Int32)aValueList.size(); ++i, ++pValues) - *pValues = aValueList[i]; - - // String-Sequence fuer ListBox erzeugen - StringSequence aStringSeq(aStringList.size()); - ::rtl::OUString* pStrings = aStringSeq.getArray(); - for ( i = 0; i < (sal_Int32)aStringList.size(); ++i, ++pStrings ) - *pStrings = aStringList[i]; + m_aBoundValues = aValueList; - setFastPropertyValue(PROPERTY_ID_STRINGITEMLIST, makeAny(aStringSeq)); + setFastPropertyValue( PROPERTY_ID_STRINGITEMLIST, makeAny( lcl_convertToStringSequence( aDisplayList ) ) ); } //------------------------------------------------------------------------------ @@ -890,19 +934,14 @@ namespace frm if ( !hasExternalListSource() ) impl_refreshDbEntryList( false ); - - if ( hasField() ) - m_pBoundFieldFormatter.reset( new ::dbtools::FormattedColumnValue( getContext(), m_xCursor, getField() ) ); } //------------------------------------------------------------------------------ void OListBoxModel::onDisconnectedDbColumn() { - m_pBoundFieldFormatter.reset( NULL ); - - if (m_eListSourceType != ListSourceType_VALUELIST) + if ( m_eListSourceType != ListSourceType_VALUELIST ) { - m_aValueSeq = StringSequence(); + ValueList().swap(m_aBoundValues); m_nNULLPos = -1; m_bBoundComponent = sal_False; @@ -914,81 +953,73 @@ namespace frm } //------------------------------------------------------------------------------ - StringSequence OListBoxModel::GetCurValueSeq() const + ValueList OListBoxModel::impl_getValues() const { - StringSequence aCurValues; + if ( !m_aBoundValues.empty() ) + return m_aBoundValues; - // Aus den selektierten Indizes Werte-Sequence aufbauen - DBG_ASSERT(m_xAggregateFastSet.is(), "OListBoxModel::GetCurValueSeq : invalid aggregate !"); - if (!m_xAggregateFastSet.is()) - return aCurValues; - - Any aTmp = m_xAggregateFastSet->getFastPropertyValue( getValuePropertyAggHandle() ); - - Sequence aSelectSeq; aTmp >>= aSelectSeq; - const sal_Int16 *pSels = aSelectSeq.getConstArray(); - sal_uInt32 nSelCount = aSelectSeq.getLength(); + Sequence< ::rtl::OUString > aStringItems( getStringItemList() ); + ValueList aValues( aStringItems.getLength() ); + ::std::copy( + aStringItems.getConstArray(), + aStringItems.getConstArray() + aStringItems.getLength(), + aValues.begin() + ); - if (nSelCount) - { - StringSequence aValues( impl_getValues() ); + return aValues; + } + //------------------------------------------------------------------------------ + ORowSetValue OListBoxModel::getFirstSelectedValue() const + { + static const ORowSetValue s_aEmptyVaue; - const ::rtl::OUString *pVals = aValues.getConstArray(); - sal_Int32 nValCnt = aValues.getLength(); + DBG_ASSERT( m_xAggregateFastSet.is(), "OListBoxModel::getFirstSelectedValue: invalid aggregate!" ); + if ( !m_xAggregateFastSet.is() ) + return s_aEmptyVaue; - if (nSelCount > 1) - { - // Einfach- oder Mehrfach-Selektion - sal_Bool bMultiSel = false; - const_cast(this)->OPropertySetAggregationHelper::getFastPropertyValue(PROPERTY_ID_MULTISELECTION) >>= bMultiSel; - if (bMultiSel) - nSelCount = 1; - } + Sequence< sal_Int16 > aSelectedIndices; + OSL_VERIFY( m_xAggregateFastSet->getFastPropertyValue( getValuePropertyAggHandle() ) >>= aSelectedIndices ); + if ( !aSelectedIndices.getLength() ) + // nothing selected at all + return s_aEmptyVaue; - // ist der Eintrag fuer NULL selektiert ? - // dann leere Selektion liefern - if (m_nNULLPos != -1 && nSelCount == 1 && pSels[0] == m_nNULLPos) - nSelCount = 0; + if ( ( m_nNULLPos != -1 ) && ( aSelectedIndices[0] == m_nNULLPos ) ) + // the dedicated "NULL" entry is selected + return s_aEmptyVaue; - aCurValues.realloc(nSelCount); - ::rtl::OUString *pCurVals = aCurValues.getArray(); + ValueList aValues( impl_getValues() ); - for (sal_uInt16 i = 0; i < nSelCount; i++) - { - if (pSels[i] < nValCnt) - pCurVals[i] = pVals[pSels[i]]; - } + size_t selectedValue = aSelectedIndices[0]; + if ( selectedValue >= aValues.size() ) + { + OSL_ENSURE( false, "OListBoxModel::getFirstSelectedValue: inconsistent selection/valuelist!" ); + return s_aEmptyVaue; } - return aCurValues; + + return aValues[ selectedValue ]; } //------------------------------------------------------------------------------ sal_Bool OListBoxModel::commitControlValueToDbColumn( bool /*_bPostReset*/ ) { // current selektion list - Any aCurrentValue; - StringSequence aCurValueSeq = GetCurValueSeq(); - if ( aCurValueSeq.getLength() ) - aCurrentValue <<= aCurValueSeq.getConstArray()[0]; - - if ( !compare( aCurrentValue, m_aSaveValue ) ) + const ORowSetValue rCurrentValue( getFirstSelectedValue() ); + if ( rCurrentValue != m_aSaveValue ) { - if ( !aCurrentValue.hasValue() ) + if ( rCurrentValue.isNull() ) m_xColumnUpdate->updateNull(); else { try { - ::rtl::OUString sNewValue; - aCurrentValue >>= sNewValue; - m_xColumnUpdate->updateString( sNewValue ); + m_xColumnUpdate->updateObject( rCurrentValue.makeAny() ); } - catch(Exception&) + catch ( const Exception& ) { return sal_False; } } - m_aSaveValue = aCurrentValue; + m_aSaveValue = rCurrentValue; } return sal_True; } @@ -997,37 +1028,41 @@ namespace frm //------------------------------------------------------------------------------ Any OListBoxModel::translateDbColumnToControlValue() { - DBG_ASSERT( m_xAggregateFastSet.is() && m_xAggregateSet.is(), "OListBoxModel::translateDbColumnToControlValue: invalid aggregate !" ); - if ( !m_xAggregateFastSet.is() || !m_xAggregateSet.is() ) - return Any(); - - OSL_ENSURE( m_pBoundFieldFormatter.get(), "OListBoxModel::translateDbColumnToControlValue: illegal call!" ); - if ( !m_pBoundFieldFormatter.get() ) + Reference< XPropertySet > xBoundField( getField() ); + if ( !xBoundField.is() ) + { + OSL_ENSURE( false, "OListBoxModel::translateDbColumnToControlValue: no field? How could that happen?!" ); return Any(); + } - Sequence aSelSeq; + Sequence< sal_Int16 > aSelectionIndicies; // Bei NULL-Eintraegen Selektion aufheben! - ::rtl::OUString sValue = m_pBoundFieldFormatter->getFormattedValue(); - OSL_PRECOND( getField() == m_xColumn, "OListBoxModel::translateDbColumnToControlValue: inconsistency!" ); - // m_pBoundFieldFormatter is based on m_xField, and we use m_xColumn to check for wasNull - // => both should better be the same object ... - if ( m_xColumn->wasNull() ) + ORowSetValue aCurrentValue; + aCurrentValue.fill( xBoundField->getPropertyValue( PROPERTY_VALUE ) ); + + if ( aCurrentValue.isNull() ) { - m_aSaveValue.clear(); - if (m_nNULLPos != -1) + if ( m_nNULLPos != -1 ) { - aSelSeq.realloc(1); - aSelSeq.getArray()[0] = m_nNULLPos; + aSelectionIndicies.realloc(1); + aSelectionIndicies[0] = m_nNULLPos; } } else { - m_aSaveValue <<= sValue; - - aSelSeq = findValue( impl_getValues(), sValue, m_bBoundComponent ); + ValueList aValues( impl_getValues() ); + ValueList::const_iterator curValuePos = ::std::find( aValues.begin(), aValues.end(), aCurrentValue ); + if ( curValuePos != aValues.end() ) + { + aSelectionIndicies.realloc( 1 ); + aSelectionIndicies[0] = curValuePos - aValues.begin(); + } } - return makeAny( aSelSeq ); + + m_aSaveValue = aCurrentValue; + + return makeAny( aSelectionIndicies ); } // XReset @@ -1158,7 +1193,7 @@ namespace frm aThisEntryIndexes.getConstArray(), aThisEntryIndexes.getConstArray() + aThisEntryIndexes.getLength(), ::std::insert_iterator< ::std::set< sal_Int16 > >( aSelectionSet, aSelectionSet.begin() ) - ); + ); } // copy the indexes to the sequence diff --git a/forms/source/component/ListBox.hxx b/forms/source/component/ListBox.hxx index 9aeca0e851e2..60bd63b3712d 100644 --- a/forms/source/component/ListBox.hxx +++ b/forms/source/component/ListBox.hxx @@ -46,14 +46,13 @@ #include /** === end UNO includes === **/ -#include - #include - +#include #include #include +#include -#include +#include namespace dbtools { @@ -67,21 +66,21 @@ namespace frm //================================================================== //= OListBoxModel //================================================================== +typedef ::std::vector< ::connectivity::ORowSetValue > ValueList; + class OListBoxModel :public OBoundControlModel ,public OEntryListHelper ,public OErrorBroadcaster { - CachedRowSet m_aListRowSet; // the row set to fill the list - ::std::auto_ptr< ::dbtools::FormattedColumnValue > - m_pBoundFieldFormatter; - ::com::sun::star::uno::Any m_aSaveValue; + CachedRowSet m_aListRowSet; // the row set to fill the list + ::connectivity::ORowSetValue m_aSaveValue; // ::com::sun::star::form::ListSourceType m_eListSourceType; // type der list source ::com::sun::star::uno::Any m_aBoundColumn; - StringSequence m_aListSourceSeq; // - StringSequence m_aValueSeq; // alle Werte, readonly + ValueList m_aListSourceValues; + ValueList m_aBoundValues; ::com::sun::star::uno::Sequence m_aDefaultSelectSeq; // DefaultSelected // @@ -89,8 +88,7 @@ class OListBoxModel :public OBoundControlModel sal_Bool m_bBoundComponent : 1; private: - // Helper functions - StringSequence GetCurValueSeq() const; + ::connectivity::ORowSetValue getFirstSelectedValue() const; virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes(); @@ -180,8 +178,7 @@ private: */ void impl_refreshDbEntryList( bool _bForce ); - StringSequence - impl_getValues() const { return m_aValueSeq.getLength() ? m_aValueSeq : getStringItemList(); } + ValueList impl_getValues() const; }; //================================================================== diff --git a/forms/source/component/RadioButton.cxx b/forms/source/component/RadioButton.cxx index 78841aa89ecf..cd70d200f376 100644 --- a/forms/source/component/RadioButton.cxx +++ b/forms/source/component/RadioButton.cxx @@ -259,7 +259,7 @@ void ORadioButtonModel::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, cons } } - if (nHandle == PROPERTY_ID_DEFAULTCHECKED) + if (nHandle == PROPERTY_ID_DEFAULT_STATE) { sal_Int16 nValue; rValue >>= nValue; @@ -269,7 +269,7 @@ void ORadioButtonModel::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, cons Any aZero; nValue = 0; aZero <<= nValue; - SetSiblingPropsTo(PROPERTY_DEFAULTCHECKED, aZero); + SetSiblingPropsTo(PROPERTY_DEFAULT_STATE, aZero); } } } @@ -341,7 +341,7 @@ void SAL_CALL ORadioButtonModel::read(const Reference& _rxIn } setReferenceValue( sReferenceValue ); - setDefaultChecked( (CheckState)nDefaultChecked ); + setDefaultChecked( (ToggleState)nDefaultChecked ); // Nach dem Lesen die Defaultwerte anzeigen if ( getControlSource().getLength() ) diff --git a/forms/source/component/refvaluecomponent.cxx b/forms/source/component/refvaluecomponent.cxx index 7a9f71475229..cd6fd6eba04e 100644 --- a/forms/source/component/refvaluecomponent.cxx +++ b/forms/source/component/refvaluecomponent.cxx @@ -90,7 +90,7 @@ namespace frm switch ( _nHandle ) { case PROPERTY_ID_REFVALUE: _rValue <<= m_sReferenceValue; break; - case PROPERTY_ID_DEFAULTCHECKED: _rValue <<= (sal_Int16)m_eDefaultChecked; break; + case PROPERTY_ID_DEFAULT_STATE: _rValue <<= (sal_Int16)m_eDefaultChecked; break; case PROPERTY_ID_UNCHECKED_REFVALUE: OSL_ENSURE( m_bSupportSecondRefValue, "OReferenceValueComponent::getFastPropertyValue: not supported!" ); @@ -117,11 +117,11 @@ namespace frm OSL_VERIFY( _rValue >>= m_sNoCheckReferenceValue ); break; - case PROPERTY_ID_DEFAULTCHECKED: + case PROPERTY_ID_DEFAULT_STATE: { sal_Int16 nDefaultChecked( (sal_Int16)STATE_NOCHECK ); OSL_VERIFY( _rValue >>= nDefaultChecked ); - m_eDefaultChecked = (CheckState)nDefaultChecked; + m_eDefaultChecked = (ToggleState)nDefaultChecked; resetNoBroadcast(); } break; @@ -146,7 +146,7 @@ namespace frm bModified = tryPropertyValue( _rConvertedValue, _rOldValue, _rValue, m_sNoCheckReferenceValue ); break; - case PROPERTY_ID_DEFAULTCHECKED: + case PROPERTY_ID_DEFAULT_STATE: bModified = tryPropertyValue( _rConvertedValue, _rOldValue, _rValue, (sal_Int16)m_eDefaultChecked ); break; @@ -168,7 +168,7 @@ namespace frm { BEGIN_DESCRIBE_PROPERTIES( m_bSupportSecondRefValue ? 3 : 2, OBoundControlModel ) DECL_PROP1( REFVALUE, ::rtl::OUString, BOUND ); - DECL_PROP1( DEFAULTCHECKED, sal_Int16, BOUND ); + DECL_PROP1( DEFAULT_STATE, sal_Int16, BOUND ); if ( m_bSupportSecondRefValue ) { DECL_PROP1( UNCHECKED_REFVALUE, ::rtl::OUString, BOUND ); diff --git a/forms/source/component/refvaluecomponent.hxx b/forms/source/component/refvaluecomponent.hxx index 856c53572432..40745b22764d 100644 --- a/forms/source/component/refvaluecomponent.hxx +++ b/forms/source/component/refvaluecomponent.hxx @@ -28,10 +28,11 @@ * ************************************************************************/ -#ifndef EFORMS2_FORMS_SOURCE_COMPONENT_REFVALUECOMPONENT_HXX -#define EFORMS2_FORMS_SOURCE_COMPONENT_REFVALUECOMPONENT_HXX +#ifndef FORMS_SOURCE_COMPONENT_REFVALUECOMPONENT_HXX +#define FORMS_SOURCE_COMPONENT_REFVALUECOMPONENT_HXX #include "FormComponent.hxx" +#include "togglestate.hxx" /** === begin UNO includes === **/ /** === end UNO includes === **/ @@ -41,8 +42,6 @@ namespace frm { //........................................................................ - enum CheckState { STATE_NOCHECK = 0, STATE_CHECK = 1, STATE_DONTKNOW = 2 }; - //==================================================================== //= OReferenceValueComponent //==================================================================== @@ -54,7 +53,7 @@ namespace frm // ::rtl::OUString m_sReferenceValue; // the reference value to use for data exchange ::rtl::OUString m_sNoCheckReferenceValue; // the reference value to be exchanged when the control is not checked - CheckState m_eDefaultChecked; // the default check state + ToggleState m_eDefaultChecked; // the default check state // sal_Bool m_bSupportSecondRefValue; // do we support the SecondaryRefValue property? @@ -65,8 +64,8 @@ namespace frm const ::rtl::OUString& getNoCheckReferenceValue() const { return m_sNoCheckReferenceValue; } - CheckState getDefaultChecked() const { return m_eDefaultChecked; } - void setDefaultChecked( CheckState _eChecked ) { m_eDefaultChecked = _eChecked; } + ToggleState getDefaultChecked() const { return m_eDefaultChecked; } + void setDefaultChecked( ToggleState _eChecked ) { m_eDefaultChecked = _eChecked; } protected: OReferenceValueComponent( @@ -109,5 +108,5 @@ namespace frm } // namespace frm //........................................................................ -#endif // EFORMS2_FORMS_SOURCE_COMPONENT_REFVALUECOMPONENT_HXX +#endif // FORMS_SOURCE_COMPONENT_REFVALUECOMPONENT_HXX diff --git a/forms/source/helper/makefile.mk b/forms/source/helper/makefile.mk index 4c2d68fd639e..5739d1fcb6d0 100644 --- a/forms/source/helper/makefile.mk +++ b/forms/source/helper/makefile.mk @@ -1,3 +1,4 @@ + #************************************************************************* # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -50,7 +51,8 @@ INCPRE+=$(SOLARINCDIR)$/offuh SLOFILES= $(SLO)$/formnavigation.obj \ $(SLO)$/controlfeatureinterception.obj \ $(SLO)$/urltransformer.obj \ - $(SLO)$/windowstateguard.obj + $(SLO)$/windowstateguard.obj \ + $(SLO)$/resettable.obj \ # --- Targets ---------------------------------- diff --git a/forms/source/helper/resettable.cxx b/forms/source/helper/resettable.cxx new file mode 100644 index 000000000000..3c67dfa5e46e --- /dev/null +++ b/forms/source/helper/resettable.cxx @@ -0,0 +1,101 @@ +/************************************************************************* +* 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 +* +* for a copy of the LGPLv3 License. +************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_forms.hxx" + +#include "resettable.hxx" + +/** === begin UNO includes === **/ +/** === end UNO includes === **/ + +#include + +//........................................................................ +namespace frm +{ +//........................................................................ + + /** === 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::form::XResetListener; + using ::com::sun::star::lang::EventObject; + /** === end UNO using === **/ + + //==================================================================== + //= ResetHelper + //==================================================================== + //-------------------------------------------------------------------- + void ResetHelper::addResetListener( const Reference< XResetListener >& _listener ) + { + m_aResetListeners.addInterface( _listener ); + } + + //-------------------------------------------------------------------- + void ResetHelper::removeResetListener( const Reference< XResetListener >& _listener ) + { + m_aResetListeners.removeInterface( _listener ); + } + + //-------------------------------------------------------------------- + bool ResetHelper::approveReset() + { + ::cppu::OInterfaceIteratorHelper aIter( m_aResetListeners ); + EventObject aResetEvent( m_rParent ); + + sal_Bool bContinue = sal_True; + while ( aIter.hasMoreElements() && bContinue ) + bContinue = static_cast< XResetListener* >( aIter.next() )->approveReset( aResetEvent ); + + return bContinue; + } + + //-------------------------------------------------------------------- + void ResetHelper::notifyResetted() + { + EventObject aResetEvent( m_rParent ); + m_aResetListeners.notifyEach( &XResetListener::resetted, aResetEvent ); + } + + //-------------------------------------------------------------------- + void ResetHelper::disposing() + { + EventObject aEvent( m_rParent ); + m_aResetListeners.disposeAndClear( aEvent ); + } + +//........................................................................ +} // namespace frm +//........................................................................ diff --git a/forms/source/inc/FormComponent.hxx b/forms/source/inc/FormComponent.hxx index 9329ca92ba14..05c8ad587902 100644 --- a/forms/source/inc/FormComponent.hxx +++ b/forms/source/inc/FormComponent.hxx @@ -36,6 +36,7 @@ #include "property.hrc" #include "property.hxx" #include "propertybaghelper.hxx" +#include "resettable.hxx" #include "services.hxx" #include "windowstateguard.hxx" @@ -648,8 +649,8 @@ private: ::com::sun::star::uno::Type m_aValuePropertyType; bool m_bValuePropertyMayBeVoid; + ResetHelper m_aResetHelper; ::cppu::OInterfaceContainerHelper m_aUpdateListeners; - ::cppu::OInterfaceContainerHelper m_aResetListeners; ::cppu::OInterfaceContainerHelper m_aFormComponentListeners; ::com::sun::star::uno::Reference< ::com::sun::star::form::binding::XValueBinding > diff --git a/forms/source/inc/frm_strings.hxx b/forms/source/inc/frm_strings.hxx index 13fbf9723eeb..1eaee92f8421 100644 --- a/forms/source/inc/frm_strings.hxx +++ b/forms/source/inc/frm_strings.hxx @@ -135,7 +135,7 @@ namespace frm FORMS_CONSTASCII_STRING( PROPERTY_BUTTONTYPE, "ButtonType" ); FORMS_CONSTASCII_STRING( PROPERTY_STRINGITEMLIST, "StringItemList" ); FORMS_CONSTASCII_STRING( PROPERTY_DEFAULT_TEXT, "DefaultText" ); - FORMS_CONSTASCII_STRING( PROPERTY_DEFAULTCHECKED, "DefaultState" ); + FORMS_CONSTASCII_STRING( PROPERTY_DEFAULT_STATE, "DefaultState" ); FORMS_CONSTASCII_STRING( PROPERTY_FORMATKEY, "FormatKey" ); FORMS_CONSTASCII_STRING( PROPERTY_FORMATSSUPPLIER, "FormatsSupplier" ); FORMS_CONSTASCII_STRING( PROPERTY_SUBMIT_ACTION, "SubmitAction" ); diff --git a/forms/source/inc/property.hrc b/forms/source/inc/property.hrc index 065a46eb5b8c..0a3e3739d31a 100644 --- a/forms/source/inc/property.hrc +++ b/forms/source/inc/property.hrc @@ -118,7 +118,7 @@ namespace frm #define PROPERTY_ID_SUBMIT_ENCODING (PROPERTY_ID_START + 74) // FmSubmitEncoding #define PROPERTY_ID_DEFAULT_VALUE (PROPERTY_ID_START + 75) // ::rtl::OUString #define PROPERTY_ID_SUBMIT_TARGET (PROPERTY_ID_START + 76) // ::rtl::OUString -#define PROPERTY_ID_DEFAULTCHECKED (PROPERTY_ID_START + 77) // UINT16 +#define PROPERTY_ID_DEFAULT_STATE (PROPERTY_ID_START + 77) // UINT16 #define PROPERTY_ID_VALUE_SEQ (PROPERTY_ID_START + 78) // StringSeq #define PROPERTY_ID_IMAGE_URL (PROPERTY_ID_START + 79) // ::rtl::OUString // free diff --git a/forms/source/inc/resettable.hxx b/forms/source/inc/resettable.hxx new file mode 100644 index 000000000000..f8815d5e3eb3 --- /dev/null +++ b/forms/source/inc/resettable.hxx @@ -0,0 +1,75 @@ +/************************************************************************* +* 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 +* +* for a copy of the LGPLv3 License. +************************************************************************/ + +#ifndef FORMS_RESETTABLE_HXX +#define FORMS_RESETTABLE_HXX + +/** === begin UNO includes === **/ +#include +/** === end UNO includes === **/ + +#include + +namespace cppu +{ + class OWeakObject; +} + +//........................................................................ +namespace frm +{ +//........................................................................ + + //==================================================================== + //= ResetHelper + //==================================================================== + class ResetHelper + { + public: + ResetHelper( ::cppu::OWeakObject& _parent, ::osl::Mutex& _mutex ) + :m_rParent( _parent ) + ,m_aResetListeners( _mutex ) + { + } + + // XReset equivalents + void addResetListener( const ::com::sun::star::uno::Reference< ::com::sun::star::form::XResetListener >& _listener ); + void removeResetListener( const ::com::sun::star::uno::Reference< ::com::sun::star::form::XResetListener >& _listener ); + + // calling listeners + bool approveReset(); + void notifyResetted(); + void disposing(); + + private: + ::cppu::OWeakObject& m_rParent; + ::cppu::OInterfaceContainerHelper m_aResetListeners; + }; + +//........................................................................ +} // namespace frm +//........................................................................ + +#endif // FORMS_RESETTABLE_HXX diff --git a/forms/source/inc/togglestate.hxx b/forms/source/inc/togglestate.hxx new file mode 100644 index 000000000000..04755000db19 --- /dev/null +++ b/forms/source/inc/togglestate.hxx @@ -0,0 +1,43 @@ +/************************************************************************* +* 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 +* +* for a copy of the LGPLv3 License. +************************************************************************/ + +#ifndef FORMS_TOGGLESTATE_HXX +#define FORMS_TOGGLESTATE_HXX + +/** === begin UNO includes === **/ +/** === end UNO includes === **/ + +//........................................................................ +namespace frm +{ +//........................................................................ + + enum ToggleState { STATE_NOCHECK = 0, STATE_CHECK = 1, STATE_DONTKNOW = 2 }; + +//........................................................................ +} // namespace frm +//........................................................................ + +#endif // FORMS_TOGGLESTATE_HXX diff --git a/forms/source/misc/property.cxx b/forms/source/misc/property.cxx index a47b7b73b706..564cd822f145 100644 --- a/forms/source/misc/property.cxx +++ b/forms/source/misc/property.cxx @@ -125,7 +125,7 @@ void PropertyInfoService::initialize() ADD_PROP_ASSIGNMENT(BUTTONTYPE); ADD_PROP_ASSIGNMENT(STRINGITEMLIST); ADD_PROP_ASSIGNMENT(DEFAULT_TEXT); - ADD_PROP_ASSIGNMENT(DEFAULTCHECKED); + ADD_PROP_ASSIGNMENT(DEFAULT_STATE); ADD_PROP_ASSIGNMENT(DEFAULT_DATE); ADD_PROP_ASSIGNMENT(DEFAULT_TIME); ADD_PROP_ASSIGNMENT(DEFAULT_VALUE); -- cgit From f1c41b51ab29b1cc91cc627147ecb09b8cad015f Mon Sep 17 00:00:00 2001 From: Kurt Zenker Date: Fri, 5 Jun 2009 12:31:05 +0000 Subject: CWS-TOOLING: integrate CWS evoab2def 2009-05-28 16:00:19 +0200 fs r272412 : don't use createFalse - Evo 2.22 simply hangs when ask for all contacts without a first name. Instead, in the WHERE 0=1 case, simply create an empty result set 2009-05-22 14:25:51 +0200 fs r272193 : #i10000# 2009-05-22 14:25:37 +0200 fs r272192 : oops, ENABLE_EVOAB2 for some platforms only, not generically 2009-05-22 14:19:00 +0200 fs r272191 : #i10000# 2009-05-22 12:42:38 +0200 fs r272183 : when sorting, properly use a syslocale collator, instead of comparing the numerical values of the string's UTF-16 code points 2009-05-20 15:09:00 +0200 fs r272131 : clear/getWarnings: also allowed without cache 2009-05-20 14:11:19 +0200 fs r272128 : removed debug traces 2009-05-20 14:03:31 +0200 fs r272126 : #i55701# +STR_SORT_BY_COL_ONLY 2009-05-20 14:02:29 +0200 fs r272125 : implement sorting 2009-05-20 10:10:19 +0200 fs r272107 : #i10000# 2009-05-19 16:02:17 +0200 fs r272089 : #i10000# 2009-05-19 16:02:02 +0200 fs r272088 : #i55701# strings for new error condition DATA_CANNOT_SELECT_UNFILTERED 2009-05-19 16:01:31 +0200 fs r272087 : #i55701# use DATA_CANNOT_SELECT_UNFILTERED as standardized error code 2009-05-19 15:59:59 +0200 fs r272086 : #i55701# +DATA_CANNOT_SELECT_UNFILTERED 2009-05-19 15:46:12 +0200 fs r272084 : #i55701# recognize the DATA_CANNOT_SELECT_UNFILTERED error condition, and allow filtering in this case, even when the result set is empty 2009-05-19 09:06:50 +0200 fs r272059 : merging changes from CWS dba32b, to prevent future conflicts with upcoming local changes 2009-05-18 21:48:58 +0200 fs r272054 : accessing a non-local unfiltered address book now returns an empty result set, and reports a warning, instead of ungracefully failing 2009-05-18 21:48:42 +0200 fs r272053 : accessing a non-local unfiltered address book now returns an empty result set, and reports a warning, instead of ungracefully failing 2009-05-18 21:47:41 +0200 fs r272052 : +setExternalWarnings 2009-05-18 21:47:12 +0200 fs r272051 : #i55701# when re/loading the form, display any possible warnings 2009-05-18 21:43:26 +0200 fs r272050 : #i55701# implement XWarningsSupplier, exposing the warnings of our result set 2009-05-18 21:42:51 +0200 fs r272049 : #i55701# implement XWarningsSupplier, exposing the warnings of our aggregate RowSet 2009-05-18 17:53:59 +0200 fs r272041 : #i55701# moved the (I)WarningsContainer from dbaccess to connectivity, to be able to use it in the latter module, too 2009-05-18 17:24:10 +0200 fs r272040 : #i55701# properly enable the various Evolution types 2009-05-18 14:52:19 +0200 fs r272024 : #i55701# properly enable the Evolution types 2009-05-18 13:57:10 +0200 fs r272018 : fixed/extended whereAnalysis (column searching still not enabled, as neither LIKE nor = seem to work with my (somewhat older) Evolution version) 2009-05-18 13:56:08 +0200 fs r272017 : extended showParseTree 2009-05-18 13:55:25 +0200 fs r272016 : extended showParseTree 2009-05-18 11:40:16 +0200 fs r272008 : #i55701# 2009-05-18 11:39:02 +0200 fs r272006 : let the PreparedStatement return proper meta data, too 2009-05-18 10:05:37 +0200 fs r271999 : moved the XStatement interface to from OCommonStatement to OStatement - the former class is also the base for other classes which should not have this interface 2009-05-15 21:53:22 +0200 fs r271973 : collectColumnInformation: report invalid meta data as assertion 2009-05-15 21:51:40 +0200 fs r271972 : showParseTree should be const 2009-05-15 21:51:26 +0200 fs r271971 : showParseTree should be const 2009-05-15 21:51:03 +0200 fs r271970 : properly recognize the 'WHERE 0 = 1' clause, this way having proper statement meta data, this way saving much much calls from the DBA framework 2009-05-15 20:29:03 +0200 fs r271969 : cleaned up the mess with the statement classes 2009-05-15 15:51:11 +0200 fs r271944 : let the result set properly init its meta data 2009-05-15 15:29:54 +0200 fs r271939 : proper property implementations for the resultset class 2009-05-15 15:01:31 +0200 fs r271936 : proper property implementations for the statement class 2009-05-08 14:46:33 +0200 fs r271717 : component_foo must be PUBLIC 2009-05-06 09:20:05 +0200 fs r271565 : #i10000# (warnings on unxlngi6) 2009-05-06 09:01:30 +0200 fs r271564 : #i101493# 2009-05-05 23:08:12 +0200 fs r271560 : #i55701# merging the changes from the ancient (CVS-based) CWS evoab2default into this CWS here --- forms/source/component/DatabaseForm.cxx | 19 +++++++++++++++++++ forms/source/component/DatabaseForm.hxx | 16 ++++++++++++---- 2 files changed, 31 insertions(+), 4 deletions(-) (limited to 'forms') diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx index 142f0f249b36..96412feed10a 100644 --- a/forms/source/component/DatabaseForm.cxx +++ b/forms/source/component/DatabaseForm.cxx @@ -447,6 +447,11 @@ void ODatabaseForm::impl_construct() m_pAggregatePropertyMultiplexer->addProperty(PROPERTY_ACTIVE_CONNECTION); } + { + Reference< XWarningsSupplier > xRowSetWarnings( m_xAggregate, UNO_QUERY ); + m_aWarnings.setExternalWarnings( xRowSetWarnings ); + } + if ( m_xAggregate.is() ) { m_xAggregate->setDelegator( static_cast< XWeak* >( this ) ); @@ -475,6 +480,8 @@ ODatabaseForm::~ODatabaseForm() if (m_xAggregate.is()) m_xAggregate->setDelegator( NULL ); + m_aWarnings.setExternalWarnings( NULL ); + if (m_pAggregatePropertyMultiplexer) { m_pAggregatePropertyMultiplexer->dispose(); @@ -1473,6 +1480,18 @@ void SAL_CALL ODatabaseForm::setPropertyValues( const Sequence< PropertyValue >& m_aPropertyBagHelper.setPropertyValues( _rProps ); } +//------------------------------------------------------------------------------ +Any SAL_CALL ODatabaseForm::getWarnings( ) throw (SQLException, RuntimeException) +{ + return m_aWarnings.getWarnings(); +} + +//------------------------------------------------------------------------------ +void SAL_CALL ODatabaseForm::clearWarnings( ) throw (SQLException, RuntimeException) +{ + m_aWarnings.clearWarnings(); +} + //------------------------------------------------------------------------------ Reference< XCloneable > SAL_CALL ODatabaseForm::createClone( ) throw (RuntimeException) { diff --git a/forms/source/component/DatabaseForm.hxx b/forms/source/component/DatabaseForm.hxx index d4b0f3811a24..a19d20930538 100644 --- a/forms/source/component/DatabaseForm.hxx +++ b/forms/source/component/DatabaseForm.hxx @@ -63,13 +63,15 @@ #include #include #include +#include #include #include "InterfaceContainer.hxx" -#include "connectivity/parameters.hxx" -#include "connectivity/filtermanager.hxx" +#include +#include +#include #ifndef FORMS_SOURCE_MISC_LISTENERCONTAINERS_HXX #include "listenercontainers.hxx" @@ -79,7 +81,7 @@ #include #include #include -#include +#include #include namespace com { namespace sun { namespace star { namespace sdbc { @@ -143,9 +145,10 @@ typedef ::cppu::ImplHelper12 < ::com::sun::star::form::XForm > ODatabaseForm_BASE1; -typedef ::cppu::ImplHelper3 < ::com::sun::star::lang::XServiceInfo +typedef ::cppu::ImplHelper4 < ::com::sun::star::lang::XServiceInfo , ::com::sun::star::beans::XPropertyContainer , ::com::sun::star::beans::XPropertyAccess + , ::com::sun::star::sdbc::XWarningsSupplier > ODatabaseForm_BASE2; typedef ::cppu::ImplHelper7< ::com::sun::star::sdbc::XCloseable, @@ -188,6 +191,7 @@ class ODatabaseForm :public OFormComponents ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet> m_xAggregateAsRowSet; PropertyBagHelper m_aPropertyBagHelper; + ::dbtools::WarningsContainer m_aWarnings; OPropertyChangeMultiplexer* m_pAggregatePropertyMultiplexer; // Verwaltung der ControlGruppen OGroupManager* m_pGroupManager; @@ -441,6 +445,10 @@ public: virtual void SAL_CALL setPropertyValues( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aProps ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); using OPropertySetAggregationHelper::setPropertyValues; + // XWarningsSupplier + virtual ::com::sun::star::uno::Any SAL_CALL getWarnings( ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL clearWarnings( ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + // XCloneable virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone( ) throw (::com::sun::star::uno::RuntimeException); -- cgit From 6647ad75a68f470f770597d794fb03bc12bfb453 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Wed, 17 Jun 2009 13:15:46 +0000 Subject: CWS-TOOLING: integrate CWS l10ncleanup04 2009-05-28 13:46:54 +0200 ihi r272407 : remove forgotten sdf's 2009-05-25 22:32:35 +0200 ihi r272273 : no WITH_LANG fix 2009-05-25 20:45:58 +0200 ihi r272272 : remove some comments 2009-05-25 19:55:21 +0200 ihi r272271 : svx dialog -> cui l10n move 2009-05-25 18:30:58 +0200 ihi r272268 : build fix 2009-05-18 16:32:02 +0200 ihi r272033 : bash fix 2009-05-18 16:31:32 +0200 ihi r272032 : bash fix 2009-05-14 16:23:39 +0200 ihi r271901 : #i79750# Translation moved to l10n module 2009-05-11 23:36:05 +0200 ihi r271793 : #i79750# Translation moved into own module --- forms/prj/build.lst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'forms') diff --git a/forms/prj/build.lst b/forms/prj/build.lst index 4393408051d7..3a4182b82c99 100644 --- a/forms/prj/build.lst +++ b/forms/prj/build.lst @@ -1,4 +1,4 @@ -fm forms : svx sfx2 ucb configmgr fileaccess QADEVOOO:qadevOOo NULL +fm forms : l10n svx sfx2 ucb configmgr fileaccess QADEVOOO:qadevOOo NULL fm forms usr1 - all fm_mkofrm NULL fm forms\inc nmake - all fm_inc NULL fm forms\source\inc get - all fm_sinc NULL -- cgit From 7d3b6d29c0eddccf348ada2af707567ffe98479f Mon Sep 17 00:00:00 2001 From: Release Engineers Date: Fri, 3 Jul 2009 14:21:50 +0000 Subject: CWS-TOOLING: integrate CWS dba32c 2009-06-29 20:53:25 +0200 fs r273484 : #i103138# Rectangle conversion 2009-06-29 20:51:50 +0200 fs r273483 : #i103138# yet more refactoring, now also setting the proper zoom level at the proper point in time 2009-06-29 13:40:26 +0200 fs r273470 : added svn:ignore to ignore output paths 2009-06-29 10:08:54 +0200 fs r273455 : #i103138# refactored the code for positioning/zooming the control Basically, we now allow adjustControlGeometry_throw (formerly known as positionControl_throw and setControlZoom) to take an additional ViewTransformation parameter, describing the transformation to obtain the actual control position/size. Consequently, positionControl itself also allows for a ViewTransformation parameter. This has become necessary since during painting, the device which we created our control for might not necessarily have a proper MapMode set. In this case, if we would use this map mode for calculating the control's position/size, this would lead to wrong results. Note that this problem was introduced by the fix for #i101398#: During the fix, we postponed the control creation to a later time (when it is really needed). At this later time, the MapMode at the device is broken, at the earlier time where we formerly crearted the control (createPrimitive2DSequence), it is not yet broken. Whether or not the MapMode is defined as "broken" might depend on one's point of view, however ... I consider it broken, since: - we need the map mode to obtain the proper zoom level, which is to be forwarded to the control - there are scenarios where the MapMode is *not* set to MAP_PIXEL (in those scenarios, everything works fine), and there are scenarios where it *is* set to MAP_PIXEL (in those the bug 103138 appears). It somehow feels wrong that one cannot rely on the device's map mode this way, but on the other hand one has no possibility to obtain the current zoom by other means. Note that one issue (still to be submitted) is left: In the page pane of a Draw/Impress document, controls have a wrong text size. This is because in this pane, the above-mentioned "broken" map mode is used, which means the controls have a zoom of "1:1" set, which is wrong here. 2009-06-25 13:41:35 +0200 msc r273380 : #100000# the tabs changed die to new properties 2009-06-24 12:42:40 +0200 msc r273330 : #102082# remove issue warning 2009-06-22 10:43:14 +0200 fs r273201 : createPrimitive2DSequence: care for being disposed 2009-06-18 12:35:13 +0200 oj r273109 : #i102305# make nooptfiles for gcc 2009-06-17 12:14:37 +0200 oj r273056 : #i102305# fix for linux 2009-06-17 07:20:22 +0200 oj r273046 : #i102305# move ValueTransfer into the for loop to avoid a crash under Linux 2009-06-17 07:17:28 +0200 oj r273045 : #i102305# use varchar 2009-06-15 14:11:27 +0200 fs r272983 : added since tag 2009-06-15 12:11:39 +0200 oj r272973 : #i102305# SAL_DLLPUBLIC_EXPORT inserted 2009-06-15 11:08:53 +0200 fs r272969 : #i10000# 2009-06-15 09:25:13 +0200 fs r272963 : merging fix for P1 issue #i102701# 2009-06-11 11:31:24 +0200 fs r272858 : #i10000# copied the fix which before the rebase was done in ../dialog/macropg.src 2009-06-11 09:38:14 +0200 fs r272846 : CWS-TOOLING: rebase CWS dba32c to trunk@272827 (milestone: DEV300:m50) 2009-06-02 09:53:10 +0200 fs r272483 : #i10000# 2009-05-29 15:55:03 +0200 fs r272465 : #i100818# 2009-05-29 12:58:43 +0200 fs r272452 : don't apply comphelper::getString on possibly VOID any 2009-05-29 10:38:35 +0200 oj r272437 : #i101519# handle where condition 2009-05-29 09:53:39 +0200 fs r272434 : #i100818# call into releaseStubs /without/ locked GlobalMutex 2009-05-28 07:53:44 +0200 oj r272375 : #i101369# parse tree changed 2009-05-27 14:53:36 +0200 fs r272347 : #i10000# 2009-05-27 09:29:15 +0200 oj r272327 : #i101626# check for double before hard cast 2009-05-27 09:13:58 +0200 oj r272326 : #i101626# handle void correctly 2009-05-27 08:04:39 +0200 oj r272321 : #i102256# wrong method signature used 2009-05-27 07:55:52 +0200 oj r272320 : #i101519# look up parameter typ if used in function 2009-05-27 06:49:07 +0200 oj r272319 : #i101519# set parameter from rowset as well 2009-05-26 13:30:56 +0200 oj r272297 : #i101987# impl XBatchExecution 2009-05-26 12:44:34 +0200 oj r272293 : #i101700# check if group is not set 2009-05-26 12:16:53 +0200 oj r272290 : #i101369# resolved some reduce7reduce problems with boolean_term and search_condition 2009-05-26 12:12:42 +0200 oj r272289 : #i101369# fix for or on one line criteria 2009-05-25 16:02:25 +0200 fs r272257 : #i999704# +PROPERTY_MOUSE_WHEEL_BEHAVIOR 2009-05-25 16:01:55 +0200 fs r272256 : merging the changes from CWS dba32b herein 2009-05-25 15:49:57 +0200 fs r272254 : #i999704# 2009-05-25 15:32:57 +0200 fs r272252 : #i99704# grid columns also to respect the MouseWheelBehavior property 2009-05-25 15:23:43 +0200 fs r272251 : don't pass empty Anys to ::comphelper::getString 2009-05-25 14:48:43 +0200 fs r272248 : merged changes from CWS dba32b herein 2009-05-25 14:44:40 +0200 fs r272247 : #i99704# support new MouseWheelBehavior property 2009-05-25 14:43:18 +0200 fs r272246 : #i99704# WheelWithoutFocus (peer property) superseded by MouseWheelBehavior (model property) 2009-05-25 14:41:03 +0200 fs r272245 : #i99704# no need to set the mouse wheel behavior at the peer, this is now a model property, having the right default 2009-05-25 14:39:31 +0200 fs r272243 : removed dead import 2009-05-25 14:35:36 +0200 fs r272242 : the new EnableVisible doesn't make sense for grid columns 2009-05-25 14:34:33 +0200 fs r272241 : #i99704# +MouseWheelBehavior - allow to enable/disable the mouse wheel for the control, or make it focus-dependent 2009-05-25 14:26:11 +0200 fs r272240 : #i99704# change MouseSettings wheel flag (NoWheelActionWithoutFocus) to a three-state option, allowing to completely ignore the mouse wheel 2009-05-23 21:35:59 +0200 fs r272213 : localize 'sub component opened/closed' event 2009-05-22 21:42:47 +0200 fs r272211 : #i102003# 2009-05-22 21:42:20 +0200 fs r272210 : grammar 2009-05-22 21:36:10 +0200 fs r272209 : #i102140# load only once, not twice, and show error messages during loading (and during any form action, that is) asynchronously 2009-05-22 21:35:11 +0200 fs r272208 : #i102140# +clear 2009-05-22 14:50:30 +0200 fs r272194 : #i102139# for newly created DB docs, set the MacroExecutionMode to USE_CONFIG 2009-05-22 12:03:42 +0200 fs r272180 : #i88878# provided by noel.power@novell.com implement a visibility property (EnableVisible) for toolkit controls, and usage in forms and UNO dialogs 2009-05-15 15:37:31 +0200 fs r271942 : #i100671# corrected some @since tags, so autodoc has better chances of correctly reading them 2009-05-15 15:33:11 +0200 fs r271940 : don't call comphelper::getFOO for VOID values 2009-05-15 15:08:31 +0200 fs r271937 : includes 2009-05-15 13:39:22 +0200 fs r271934 : #i101398# createPrimitive2DSequence: when we already have a control, use the old code. In particular, call positionControlForPaint 2009-05-15 12:33:48 +0200 fs r271933 : make the geometry a part of the ControlPrimitive2D's identity 2009-05-15 10:15:44 +0200 fs r271928 : #i10000# 2009-05-14 20:55:38 +0200 fs r271921 : #i101398# don't reuse the name PRIMITIVE_ID_CONTROLPRIMITIVE2D, make the name of our own ControlPrimitive2D unique 2009-05-14 20:55:31 +0200 fs r271920 : #i101398# don't reuse the name PRIMITIVE_ID_CONTROLPRIMITIVE2D, make the name of our own ControlPrimitive2D unique 2009-05-14 20:23:23 +0200 fs r271919 : #i101622# 2009-05-14 16:04:38 +0200 fs r271898 : don't use comphelper::getInt32 on voids 2009-05-14 16:04:12 +0200 fs r271897 : merge fix for issue whose number just slipped my memory ... (originally fixed in CWS dba32b) 2009-05-14 15:36:55 +0200 fs r271895 : merging changes from DEV300:m48 2009-05-07 14:43:19 +0200 fs r271670 : #i101477# 2009-05-07 14:37:30 +0200 fs r271668 : #i101477# 2009-05-07 09:27:30 +0200 oj r271628 : #i101343# remove pch 2009-05-06 09:36:02 +0200 fs r271568 : getFoo: diagnostics 2009-05-04 09:23:06 +0200 oj r271438 : CWS-TOOLING: rebase CWS dba32c to trunk@271427 (milestone: DEV300:m47) 2009-04-29 23:18:13 +0200 fs r271394 : #i101398# use a dedicated 2DPrimitive for UNO Controls, which is able to provide the B2DRange *without* actually creating the control 2009-04-29 13:52:25 +0200 fs r271366 : #i101308# --- forms/source/component/Columns.cxx | 1 + forms/source/component/ComboBox.cxx | 2 ++ forms/source/component/FormComponent.cxx | 17 ++-------------- forms/source/component/Grid.cxx | 15 ++++++++++++++- forms/source/component/Grid.hxx | 33 ++++++++++++++++---------------- forms/source/component/navigationbar.cxx | 4 ++++ forms/source/component/navigationbar.hxx | 1 + forms/source/inc/frm_strings.hxx | 1 + forms/source/inc/property.hrc | 2 +- forms/source/misc/property.cxx | 1 + forms/source/richtext/richtextmodel.cxx | 4 ++++ forms/source/richtext/richtextmodel.hxx | 1 + 12 files changed, 49 insertions(+), 33 deletions(-) (limited to 'forms') diff --git a/forms/source/component/Columns.cxx b/forms/source/component/Columns.cxx index b9b2b6cb5936..c307783f179b 100644 --- a/forms/source/component/Columns.cxx +++ b/forms/source/component/Columns.cxx @@ -345,6 +345,7 @@ void OGridColumn::clearAggregateProperties( Sequence< Property >& _rProps, sal_B aForbiddenProperties.insert( PROPERTY_VERTICALALIGN ); aForbiddenProperties.insert( PROPERTY_IMAGE_URL ); aForbiddenProperties.insert( PROPERTY_IMAGE_POSITION ); + aForbiddenProperties.insert( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "EnableVisible" ) ) ); if ( !bAllowDropDown ) aForbiddenProperties.insert( PROPERTY_DROPDOWN ); diff --git a/forms/source/component/ComboBox.cxx b/forms/source/component/ComboBox.cxx index 3491c2142449..1d6d204ea977 100644 --- a/forms/source/component/ComboBox.cxx +++ b/forms/source/component/ComboBox.cxx @@ -733,6 +733,8 @@ void OComboBoxModel::onDisconnectedDbColumn() // reset the string item list if ( !hasExternalListSource() ) setFastPropertyValue( PROPERTY_ID_STRINGITEMLIST, makeAny( m_aDesignModeStringItems ) ); + + m_aListRowSet.dispose(); } //------------------------------------------------------------------------------ diff --git a/forms/source/component/FormComponent.cxx b/forms/source/component/FormComponent.cxx index 6e700c28f6d8..ed3e85a905ec 100644 --- a/forms/source/component/FormComponent.cxx +++ b/forms/source/component/FormComponent.cxx @@ -239,22 +239,9 @@ Sequence OControl::_getTypes() } //------------------------------------------------------------------------------ -void OControl::initFormControlPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& _rxPeer ) +void OControl::initFormControlPeer( const Reference< XWindowPeer >& /*_rxPeer*/ ) { - try - { - Reference< XVclWindowPeer > xVclWindowPeer( _rxPeer, UNO_QUERY_THROW ); - - // #i63103# - form controls should only react on the mouse wheel when they're focused - xVclWindowPeer->setProperty( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "WheelWithoutFocus" ) ), - makeAny( sal_Bool( sal_False ) ) - ); - } - catch( const Exception& ) - { - DBG_UNHANDLED_EXCEPTION(); - } + // nothing to do here } // OComponentHelper diff --git a/forms/source/component/Grid.cxx b/forms/source/component/Grid.cxx index 9ca5a1b02ef3..ef0abf146632 100644 --- a/forms/source/component/Grid.cxx +++ b/forms/source/component/Grid.cxx @@ -104,6 +104,7 @@ OGridControlModel::OGridControlModel(const Reference& _rxF ,m_nBorder(1) ,m_nWritingMode( WritingMode2::CONTEXT ) ,m_nContextWritingMode( WritingMode2::CONTEXT ) + ,m_bEnableVisible(sal_True) ,m_bEnable(sal_True) ,m_bNavigation(sal_True) ,m_bRecordMarker(sal_True) @@ -130,6 +131,7 @@ OGridControlModel::OGridControlModel( const OGridControlModel* _pOriginal, const m_aDefaultControl = _pOriginal->m_aDefaultControl; m_bEnable = _pOriginal->m_bEnable; + m_bEnableVisible = _pOriginal->m_bEnableVisible; m_bNavigation = _pOriginal->m_bNavigation; m_nBorder = _pOriginal->m_nBorder; m_nWritingMode = _pOriginal->m_nWritingMode; @@ -457,7 +459,7 @@ void OGridControlModel::_reset() //------------------------------------------------------------------------------ void OGridControlModel::describeFixedProperties( Sequence< Property >& _rProps ) const { - BEGIN_DESCRIBE_BASE_PROPERTIES( 36 ) + BEGIN_DESCRIBE_BASE_PROPERTIES( 37 ) DECL_PROP1(NAME, ::rtl::OUString, BOUND); DECL_PROP2(CLASSID, sal_Int16, READONLY, TRANSIENT); DECL_PROP1(TAG, ::rtl::OUString, BOUND); @@ -465,6 +467,7 @@ void OGridControlModel::describeFixedProperties( Sequence< Property >& _rProps ) DECL_PROP3(TABSTOP, sal_Bool, BOUND, MAYBEDEFAULT, MAYBEVOID); DECL_PROP2(HASNAVIGATION, sal_Bool, BOUND, MAYBEDEFAULT); DECL_PROP1(ENABLED, sal_Bool, BOUND); + DECL_PROP2(ENABLEVISIBLE, sal_Bool, BOUND, MAYBEDEFAULT); DECL_PROP1(BORDER, sal_Int16, BOUND); DECL_PROP2(BORDERCOLOR, sal_Int16, BOUND, MAYBEVOID); DECL_PROP1(DEFAULTCONTROL, ::rtl::OUString, BOUND); @@ -538,6 +541,9 @@ void OGridControlModel::getFastPropertyValue(Any& rValue, sal_Int32 nHandle ) co case PROPERTY_ID_ENABLED: setBOOL(rValue, m_bEnable); break; + case PROPERTY_ID_ENABLEVISIBLE: + setBOOL(rValue, m_bEnableVisible); + break; case PROPERTY_ID_BORDER: rValue <<= (sal_Int16)m_nBorder; break; @@ -616,6 +622,9 @@ sal_Bool OGridControlModel::convertFastPropertyValue( Any& rConvertedValue, Any& case PROPERTY_ID_ENABLED: bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, m_bEnable); break; + case PROPERTY_ID_ENABLEVISIBLE: + bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, m_bEnableVisible); + break; case PROPERTY_ID_BORDER: bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, m_nBorder); break; @@ -687,6 +696,9 @@ void OGridControlModel::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, con case PROPERTY_ID_ENABLED: m_bEnable = getBOOL(rValue); break; + case PROPERTY_ID_ENABLEVISIBLE: + m_bEnableVisible = getBOOL(rValue); + break; case PROPERTY_ID_RECORDMARKER: m_bRecordMarker = getBOOL(rValue); break; @@ -744,6 +756,7 @@ Any OGridControlModel::getPropertyDefaultByHandle( sal_Int32 nHandle ) const case PROPERTY_ID_RECORDMARKER: case PROPERTY_ID_DISPLAYSYNCHRON: case PROPERTY_ID_ENABLED: + case PROPERTY_ID_ENABLEVISIBLE: aReturn = makeBoolAny(sal_True); break; diff --git a/forms/source/component/Grid.hxx b/forms/source/component/Grid.hxx index 56981f54349b..f5bb60489e45 100644 --- a/forms/source/component/Grid.hxx +++ b/forms/source/component/Grid.hxx @@ -28,22 +28,22 @@ * ************************************************************************/ -#include "errorbroadcaster.hxx" -#include "FormComponent.hxx" -#include "formcontrolfont.hxx" -#include "InterfaceContainer.hxx" - -/** === begin UNO includes === **/ -#include -#include -#include -#include -#include -/** === end UNO includes === **/ - -#include -#include -#include +#include "errorbroadcaster.hxx" +#include "FormComponent.hxx" +#include "formcontrolfont.hxx" +#include "InterfaceContainer.hxx" + +/** === begin UNO includes === **/ +#include +#include +#include +#include +#include +/** === end UNO includes === **/ + +#include +#include +#include //......................................................................... namespace frm @@ -101,6 +101,7 @@ class OGridControlModel :public OControlModel sal_Int16 m_nBorder; sal_Int16 m_nWritingMode; sal_Int16 m_nContextWritingMode; + sal_Bool m_bEnableVisible : 1; sal_Bool m_bEnable : 1; sal_Bool m_bNavigation : 1; sal_Bool m_bRecordMarker : 1; diff --git a/forms/source/component/navigationbar.cxx b/forms/source/component/navigationbar.cxx index 236f64f762a8..abe5b5c45488 100644 --- a/forms/source/component/navigationbar.cxx +++ b/forms/source/component/navigationbar.cxx @@ -84,6 +84,7 @@ namespace frm getPropertyDefaultByHandle( PROPERTY_ID_BORDER ) >>= m_nBorder; getPropertyDefaultByHandle( PROPERTY_ID_DELAY ) >>= m_nDelay; getPropertyDefaultByHandle( PROPERTY_ID_ENABLED ) >>= m_bEnabled; + getPropertyDefaultByHandle( PROPERTY_ID_ENABLEVISIBLE ) >>= m_bEnableVisible; getPropertyDefaultByHandle( PROPERTY_ID_SHOW_POSITION ) >>= m_bShowPosition; getPropertyDefaultByHandle( PROPERTY_ID_SHOW_NAVIGATION ) >>= m_bShowNavigation; getPropertyDefaultByHandle( PROPERTY_ID_SHOW_RECORDACTIONS ) >>= m_bShowActions; @@ -107,6 +108,7 @@ namespace frm m_sHelpText = _pOriginal->m_sHelpText; m_sHelpURL = _pOriginal->m_sHelpURL; m_bEnabled = _pOriginal->m_bEnabled; + m_bEnableVisible = _pOriginal->m_bEnableVisible; m_nIconSize = _pOriginal->m_nIconSize; m_nBorder = _pOriginal->m_nBorder; m_nDelay = _pOriginal->m_nDelay; @@ -125,6 +127,7 @@ namespace frm REGISTER_PROP_2( HELPTEXT, m_sHelpText, BOUND, MAYBEDEFAULT ); REGISTER_PROP_2( HELPURL, m_sHelpURL, BOUND, MAYBEDEFAULT ); REGISTER_PROP_2( ENABLED, m_bEnabled, BOUND, MAYBEDEFAULT ); + REGISTER_PROP_2( ENABLEVISIBLE, m_bEnableVisible, BOUND, MAYBEDEFAULT ); REGISTER_PROP_2( ICONSIZE, m_nIconSize, BOUND, MAYBEDEFAULT ); REGISTER_PROP_2( BORDER, m_nBorder, BOUND, MAYBEDEFAULT ); REGISTER_PROP_2( DELAY, m_nDelay, BOUND, MAYBEDEFAULT ); @@ -444,6 +447,7 @@ namespace frm break; case PROPERTY_ID_ENABLED: + case PROPERTY_ID_ENABLEVISIBLE: case PROPERTY_ID_SHOW_POSITION: case PROPERTY_ID_SHOW_NAVIGATION: case PROPERTY_ID_SHOW_RECORDACTIONS: diff --git a/forms/source/component/navigationbar.hxx b/forms/source/component/navigationbar.hxx index a1f525e61980..1dd94eff2bbc 100644 --- a/forms/source/component/navigationbar.hxx +++ b/forms/source/component/navigationbar.hxx @@ -70,6 +70,7 @@ namespace frm sal_Int16 m_nBorder; sal_Int32 m_nDelay; sal_Bool m_bEnabled; + sal_Bool m_bEnableVisible; sal_Bool m_bShowPosition; sal_Bool m_bShowNavigation; sal_Bool m_bShowActions; diff --git a/forms/source/inc/frm_strings.hxx b/forms/source/inc/frm_strings.hxx index 1eaee92f8421..bf2d5d4d7446 100644 --- a/forms/source/inc/frm_strings.hxx +++ b/forms/source/inc/frm_strings.hxx @@ -113,6 +113,7 @@ namespace frm FORMS_CONSTASCII_STRING( PROPERTY_CYCLE, "Cycle" ); FORMS_CONSTASCII_STRING( PROPERTY_CONTROLSOURCE, "DataField" ); FORMS_CONSTASCII_STRING( PROPERTY_ENABLED, "Enabled" ); + FORMS_CONSTASCII_STRING( PROPERTY_ENABLEVISIBLE, "EnableVisible" ); FORMS_CONSTASCII_STRING( PROPERTY_READONLY, "ReadOnly" ); FORMS_CONSTASCII_STRING( PROPERTY_RELEVANT, "Relevant" ); FORMS_CONSTASCII_STRING( PROPERTY_ISREADONLY, "IsReadOnly" ); diff --git a/forms/source/inc/property.hrc b/forms/source/inc/property.hrc index 0a3e3739d31a..df94d1575a5a 100644 --- a/forms/source/inc/property.hrc +++ b/forms/source/inc/property.hrc @@ -206,7 +206,7 @@ namespace frm #define PROPERTY_ID_FILTERPROPOSAL (PROPERTY_ID_START +162) // BOOL #define PROPERTY_ID_FIELDSOURCE (PROPERTY_ID_START +163) // String #define PROPERTY_ID_TABLENAME (PROPERTY_ID_START +164) // String - // FREE +#define PROPERTY_ID_ENABLEVISIBLE (PROPERTY_ID_START +165) // BOOL // FREE // FREE // FREE diff --git a/forms/source/misc/property.cxx b/forms/source/misc/property.cxx index 564cd822f145..12cc73e10264 100644 --- a/forms/source/misc/property.cxx +++ b/forms/source/misc/property.cxx @@ -106,6 +106,7 @@ void PropertyInfoService::initialize() ADD_PROP_ASSIGNMENT(CYCLE); ADD_PROP_ASSIGNMENT(CONTROLSOURCE); ADD_PROP_ASSIGNMENT(ENABLED); + ADD_PROP_ASSIGNMENT(ENABLEVISIBLE); ADD_PROP_ASSIGNMENT(SPIN); ADD_PROP_ASSIGNMENT(READONLY); ADD_PROP_ASSIGNMENT(FILTER); diff --git a/forms/source/richtext/richtextmodel.cxx b/forms/source/richtext/richtextmodel.cxx index ca2bf688a92d..d38b350ada32 100644 --- a/forms/source/richtext/richtextmodel.cxx +++ b/forms/source/richtext/richtextmodel.cxx @@ -88,6 +88,7 @@ namespace frm getPropertyDefaultByHandle( PROPERTY_ID_DEFAULTCONTROL ) >>= m_sDefaultControl; getPropertyDefaultByHandle( PROPERTY_ID_BORDER ) >>= m_nBorder; getPropertyDefaultByHandle( PROPERTY_ID_ENABLED ) >>= m_bEnabled; + getPropertyDefaultByHandle( PROPERTY_ID_ENABLEVISIBLE ) >>= m_bEnableVisible; getPropertyDefaultByHandle( PROPERTY_ID_HARDLINEBREAKS ) >>= m_bHardLineBreaks; getPropertyDefaultByHandle( PROPERTY_ID_HSCROLL ) >>= m_bHScroll; getPropertyDefaultByHandle( PROPERTY_ID_VSCROLL ) >>= m_bVScroll; @@ -124,6 +125,7 @@ namespace frm m_sHelpURL = _pOriginal->m_sHelpURL; m_nBorder = _pOriginal->m_nBorder; m_bEnabled = _pOriginal->m_bEnabled; + m_bEnableVisible = _pOriginal->m_bEnableVisible; m_bHardLineBreaks = _pOriginal->m_bHardLineBreaks; m_bHScroll = _pOriginal->m_bHScroll; m_bVScroll = _pOriginal->m_bVScroll; @@ -188,6 +190,7 @@ namespace frm REGISTER_PROP_2( HELPTEXT, m_sHelpText, BOUND, MAYBEDEFAULT ); REGISTER_PROP_2( HELPURL, m_sHelpURL, BOUND, MAYBEDEFAULT ); REGISTER_PROP_2( ENABLED, m_bEnabled, BOUND, MAYBEDEFAULT ); + REGISTER_PROP_2( ENABLEVISIBLE, m_bEnableVisible, BOUND, MAYBEDEFAULT ); REGISTER_PROP_2( BORDER, m_nBorder, BOUND, MAYBEDEFAULT ); REGISTER_PROP_2( HARDLINEBREAKS, m_bHardLineBreaks, BOUND, MAYBEDEFAULT ); REGISTER_PROP_2( HSCROLL, m_bHScroll, BOUND, MAYBEDEFAULT ); @@ -456,6 +459,7 @@ namespace frm break; case PROPERTY_ID_ENABLED: + case PROPERTY_ID_ENABLEVISIBLE: case PROPERTY_ID_PRINTABLE: case PROPERTY_ID_HIDEINACTIVESELECTION: aDefault <<= (sal_Bool)sal_True; diff --git a/forms/source/richtext/richtextmodel.hxx b/forms/source/richtext/richtextmodel.hxx index b124f76c4237..5e905e2873ad 100644 --- a/forms/source/richtext/richtextmodel.hxx +++ b/forms/source/richtext/richtextmodel.hxx @@ -83,6 +83,7 @@ namespace frm sal_Int16 m_nContextWritingMode; sal_Int16 m_nBorder; sal_Bool m_bEnabled; + sal_Bool m_bEnableVisible; sal_Bool m_bHardLineBreaks; sal_Bool m_bHScroll; sal_Bool m_bVScroll; -- cgit